GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — idstack/scripts/idstack-timeline-log at main · savvides/idstack

Expand file tree

/

idstack-timeline-log

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
executable file
·
39 lines (32 loc) · 1.54 KB
/

idstack-timeline-log

Copy path

File metadata and controls

executable file
·
39 lines (32 loc) · 1.54 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
# Append one timeline event to .idstack/timeline.jsonl.
# Usage: idstack-timeline-log '{"skill":"course-quality-review","event":"completed","score":72}'
# Injects "ts" field automatically IF the caller did not already supply one.
# A caller-supplied "ts" is preserved verbatim — useful when logging an event
# that occurred at a specific in-conversation moment, not when bash ran.
# Creates .idstack/ if needed. Exit 0 always — never blocks the calling skill.
# Needs python3; without it, it writes nothing and says so on stderr.
set -e
# Windows: a native python3 writes a pipe in the ANSI code page and fails on non-ASCII text (#136).
export PYTHONUTF8=1
JSON_ARG="${1:-}"
[ -z "$JSON_ARG" ] && exit 0
case "$JSON_ARG" in -h|--help) sed -n '2,/^$/p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;; esac
command -v python3 &>/dev/null || { echo "idstack-timeline-log: python3 is necessary" >&2; exit 0; }
IDSTACK_DIR=".idstack"
TIMELINE="$IDSTACK_DIR/timeline.jsonl"
mkdir -p "$IDSTACK_DIR" 2>/dev/null || exit 0
TS=$(date -u +%Y-%m-%dT%H:%M:%SZ)
# Use python3 for safe JSON serialization (injects ts field if absent)
LINE=$(python3 -c "
import json, sys
try:
d = json.loads(sys.argv[1])
# Preserve a caller-supplied ts; only mint one if absent.
d.setdefault('ts', '$TS')
print(json.dumps(d))
except Exception:
# Fallback: wrap raw input with timestamp
print(json.dumps({'raw': sys.argv[1], 'ts': '$TS'}))
" "$JSON_ARG" 2>/dev/null) || LINE="{\"raw\":\"error\",\"ts\":\"$TS\"}"
echo "$LINE" >> "$TIMELINE" 2>/dev/null || true
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.