Add SessionStop hook and session-events.tsv duration tracking
- session-audit.json: add SessionStop entry pointing to new end-of-session scripts - report-hook-event-end.sh/.ps1: log payload to hook-events.log and write TSV row to session-events.tsv - report-hook-event.sh/.ps1: also write SessionStart TSV row to session-events.tsv so start/end pairs are queryable for duration
This commit is contained in:
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
state_dir="${COPILOT_RESOURCES_STATE_DIR:-$HOME/.copilot-resources-state}"
|
||||
mkdir -p -- "$state_dir"
|
||||
|
||||
event_payload="$(cat)"
|
||||
printf '%s\n' "$event_payload" >> "$state_dir/hook-events.log"
|
||||
|
||||
# Append a TSV row to session-events.tsv for duration tracking.
|
||||
printf '%s\tSessionEnd\n' "$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> "$state_dir/session-events.tsv"
|
||||
|
||||
printf '{"continue": true}\n'
|
||||
Reference in New Issue
Block a user