feat: persist compact session state
This commit is contained in:
1 parent
a509509192
commit
9b5e862d8a
7 files changed
+31
-1
No files matched your search
@@ -0,0 +1,7 @@
|
||||
[CmdletBinding()]
|
||||
param()
|
||||
$root = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent
|
||||
$stateDir = Join-Path $root '.ai-session'
|
||||
New-Item $stateDir -ItemType Directory -Force | Out-Null
|
||||
('{"event":"compact","timestamp":"' + (Get-Date).ToUniversalTime().ToString('o') + '"}') | Add-Content (Join-Path $stateDir 'telemetry.jsonl')
|
||||
exit 0
|
||||
@@ -0,0 +1,4 @@
|
||||
[CmdletBinding()]
|
||||
param()
|
||||
$root = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent
|
||||
if (Test-Path (Join-Path $root '.ai-session/state.json')) { Write-Output 'Task state is available in .ai-session/state.json; read it only if needed.' }
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)
|
||||
mkdir -p "$root/.ai-session"
|
||||
printf '{"event":"compact","timestamp":"%s"}\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$root/.ai-session/telemetry.jsonl"
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)
|
||||
[ -f "$root/.ai-session/state.json" ] && printf 'Task state is available in .ai-session/state.json; read it only if needed.\n'
|
||||
Reference in new issue
Block a user