commandmate 0.29.2 → 0.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +271 -264
- package/.next/app-path-routes-manifest.json +35 -34
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +8 -8
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/update-check/route.js +1 -1
- package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/conversation/route.js +1 -1
- package/.next/server/app/api/assistant/conversation/route.js.nft.json +1 -1
- package/.next/server/app/api/assistant/conversation/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/current-output/route.js +1 -1
- package/.next/server/app/api/assistant/current-output/route.js.nft.json +1 -1
- package/.next/server/app/api/assistant/current-output/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/messages/route.js +1 -1
- package/.next/server/app/api/assistant/messages/route.js.nft.json +1 -1
- package/.next/server/app/api/assistant/messages/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/session/route.js +1 -1
- package/.next/server/app/api/assistant/session/route.js.nft.json +1 -1
- package/.next/server/app/api/assistant/session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/start/route.js +18 -18
- package/.next/server/app/api/assistant/start/route.js.nft.json +1 -1
- package/.next/server/app/api/assistant/start/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/terminal/route.js +19 -19
- package/.next/server/app/api/assistant/terminal/route.js.nft.json +1 -1
- package/.next/server/app/api/assistant/terminal/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/tools/route.js +1 -1
- package/.next/server/app/api/assistant/tools/route.js.nft.json +1 -1
- package/.next/server/app/api/assistant/tools/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/capabilities/route.js +1 -1
- package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/daily-summary/route.js +1 -1
- package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/agent-event/route.js +1 -1
- package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/claude-done/route.js +2 -2
- package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/permission-request/route.js +1 -1
- package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/escalation/route.js +1 -1
- package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/vapid/route.js +1 -1
- package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/[id]/todos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/clone/route.js +1 -1
- package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/restore/route.js +1 -1
- package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/route.js +1 -1
- package/.next/server/app/api/repositories/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/scan/route.js +1 -1
- package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/sync/route.js +1 -1
- package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/default-agents/route.js +1 -1
- package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/default-surface-mode/route.js +1 -0
- package/.next/server/app/api/settings/default-surface-mode/route.js.nft.json +1 -0
- package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/todos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-reference/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/cli-reference/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/session/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/share/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/resolve-target/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/apply-default-agents/route.js +1 -1
- package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/route.js +1 -1
- package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
- package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
- package/.next/server/app/more/page.js +2 -2
- package/.next/server/app/more/page.js.nft.json +1 -1
- package/.next/server/app/more/page_client-reference-manifest.js +1 -1
- package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
- package/.next/server/app/review/page_client-reference-manifest.js +1 -1
- package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/page.js +11 -11
- package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
- package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/terminal/page.js +3 -3
- package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +35 -34
- package/.next/server/chunks/1058.js +1 -1
- package/.next/server/chunks/1068.js +1 -1
- package/.next/server/chunks/1191.js +1 -1
- package/.next/server/chunks/1341.js +1 -1
- package/.next/server/chunks/1886.js +3 -3
- package/.next/server/chunks/2119.js +1 -1
- package/.next/server/chunks/2445.js +1 -1
- package/.next/server/chunks/261.js +1 -0
- package/.next/server/chunks/2739.js +1 -0
- package/.next/server/chunks/2816.js +1 -1
- package/.next/server/chunks/3099.js +5 -0
- package/.next/server/chunks/3123.js +1 -0
- package/.next/server/chunks/3241.js +1 -1
- package/.next/server/chunks/3543.js +1 -1
- package/.next/server/chunks/3945.js +1 -1
- package/.next/server/chunks/4325.js +1 -0
- package/.next/server/chunks/4390.js +1 -1
- package/.next/server/chunks/4393.js +1 -1
- package/.next/server/chunks/4443.js +6 -0
- package/.next/server/chunks/5017.js +1 -1
- package/.next/server/chunks/5043.js +1 -0
- package/.next/server/chunks/5120.js +1 -0
- package/.next/server/chunks/552.js +25 -0
- package/.next/server/chunks/6130.js +1 -1
- package/.next/server/chunks/6337.js +1 -1
- package/.next/server/chunks/663.js +1 -1
- package/.next/server/chunks/6894.js +8 -0
- package/.next/server/chunks/7685.js +1 -1
- package/.next/server/chunks/7836.js +1 -0
- package/.next/server/chunks/8356.js +1 -1
- package/.next/server/chunks/880.js +1 -1
- package/.next/server/chunks/8807.js +1 -1
- package/.next/server/chunks/9123.js +2 -2
- package/.next/server/chunks/9130.js +3 -3
- package/.next/server/chunks/9627.js +48 -26
- package/.next/server/chunks/9696.js +3 -0
- package/.next/server/chunks/9798.js +1 -1
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/server/src/middleware.js +1 -1
- package/.next/server/src/middleware.js.map +1 -1
- package/.next/static/chunks/{4882-388e94fe0a03c2ba.js → 3916-0e929d089282dc5d.js} +1 -1
- package/.next/static/chunks/{5229-b2a81bb8fb5c19e9.js → 5229-6c89475b61bd2c8b.js} +1 -1
- package/.next/static/chunks/6022-7a7d1760fc9814c7.js +1 -0
- package/.next/static/chunks/6381-dbf04a99647f6018.js +1 -0
- package/.next/static/chunks/app/api/agents/update/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/agents/versions/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/app/update/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/app/update-check/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/assistant/conversation/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/assistant/current-output/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/assistant/messages/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/assistant/session/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/assistant/start/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/assistant/terminal/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/assistant/tools/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/auth/login/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/auth/logout/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/auth/status/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/capabilities/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/daily-summary/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/daily-summary/status/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/external-apps/[id]/health/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/external-apps/[id]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/external-apps/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/fs/browse/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/fs/recent-paths/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/hooks/agent-event/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/hooks/claude-done/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/hooks/permission-request/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/metrics/vibe/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/ollama/models/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/push/escalation/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/push/subscriptions/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/push/vapid/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/remote/pair/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/repositories/[id]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/repositories/[id]/todos/[todoId]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/repositories/[id]/todos/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/repositories/clone/[jobId]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/repositories/clone/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/repositories/excluded/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/repositories/restore/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/repositories/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/repositories/scan/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/repositories/sync/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/repositories/validate-path/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/settings/default-agents/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/settings/default-surface-mode/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/sidebar/group-order/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/skills/[id]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/skills/installations/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/skills/operations/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/skills/reindex/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/skills/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/slash-commands/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/tasks/[taskId]/cancel/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/tasks/[taskId]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/templates/[id]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/templates/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/todos/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/verification/runs/[runId]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/verification/runs/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/auto-yes/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/capture/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/clear-composer/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/cli-reference/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/cli-tool/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/cmate/schedules/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/current-output/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/env/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/[logId]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/files/[...path]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/branch/create/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/branch/delete/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/branches/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/checkout/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/commit/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/diff/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/fetch/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/log/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/pull/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/push/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/reset/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/revert/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/show/[commitHash]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stage/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/staged/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/[index]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/apply/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/pop/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/push/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/status/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/unstage/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/working-diff/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/instances/opencode/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/interrupt/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/kill-session/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/logs/[filename]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/logs/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/marp-render/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/memos/[memoId]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/memos/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/messages/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/opencode/diff/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/opencode/session/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/opencode/share/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/resolve-target/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/respond/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/[scheduleId]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/active/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/search/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/send/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/install/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/plan/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update-plan/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/slash-commands/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/special-keys/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/tasks/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/terminal/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/timers/history/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/timers/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/todos/[todoId]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/todos/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/tree/[...path]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/tree/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/upload/[...path]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/verify/config/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/verify/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/viewed/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/apply-default-agents/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/api/worktrees/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/manifest.webmanifest/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/more/{page-75d3783da0d49a25.js → page-333bba1c8bbc9c11.js} +1 -1
- package/.next/static/chunks/app/proxy/[...path]/route-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/layout-ee11f7b8a34cba8c.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/page-aac399392ec8c273.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/terminal/page-2631bc5c4b0a9fb8.js +1 -0
- package/.next/static/css/23f9c40ecc458c77.css +1 -0
- package/.next/static/pcpB4K6KreMzu2qbhvuRY/_buildManifest.js +1 -0
- package/.next/trace +13 -13
- package/.next/types/app/api/settings/default-surface-mode/route.ts +347 -0
- package/.next/types/app/api/worktrees/[id]/{start-polling → cli-reference}/route.ts +3 -3
- package/.next/types/routes.d.ts +3 -2
- package/.next/types/validator.ts +18 -9
- package/dist/server/server.js +58 -0
- package/dist/server/src/lib/claude-output.js +1 -0
- package/dist/server/src/lib/db/app-settings-db.js +60 -0
- package/dist/server/src/lib/db/chat-db.js +120 -7
- package/dist/server/src/lib/detection/status-detector.js +3 -2
- package/dist/server/src/lib/env.js +122 -0
- package/dist/server/src/lib/git/worktrees.js +154 -0
- package/dist/server/src/lib/history/transcript-tail.js +80 -0
- package/dist/server/src/lib/history/user-turn-recorder.js +252 -0
- package/dist/server/src/lib/hooks/agent-event-service.js +40 -6
- package/dist/server/src/lib/hooks/permission-decision-service.js +85 -1
- package/dist/server/src/lib/hooks/sources/antigravity/history.js +607 -0
- package/dist/server/src/lib/hooks/sources/antigravity/source.js +7 -0
- package/dist/server/src/lib/hooks/sources/antigravity/transcript.js +407 -0
- package/dist/server/src/lib/hooks/sources/claude/history.js +797 -0
- package/dist/server/src/lib/hooks/sources/claude/source.js +4 -0
- package/dist/server/src/lib/hooks/sources/claude/transcript.js +518 -0
- package/dist/server/src/lib/hooks/sources/codex/history.js +663 -0
- package/dist/server/src/lib/hooks/sources/codex/source.js +4 -0
- package/dist/server/src/lib/hooks/sources/codex/transcript.js +448 -0
- package/dist/server/src/lib/hooks/sources/copilot/source.js +2 -0
- package/dist/server/src/lib/hooks/sources/gemini/source.js +2 -0
- package/dist/server/src/lib/hooks/sources/legacy-relay.js +3 -0
- package/dist/server/src/lib/hooks/sources/opencode/history.js +57 -0
- package/dist/server/src/lib/hooks/sources/opencode/source.js +4 -0
- package/dist/server/src/lib/hooks/sources/opencode/transcript.js +10 -28
- package/dist/server/src/lib/hooks/sources/turn-body.js +118 -0
- package/dist/server/src/lib/hooks/stop-history-capture.js +161 -0
- package/dist/server/src/lib/polling/prompt-dedup.js +2 -4
- package/dist/server/src/lib/polling/response-checker.js +87 -6
- package/dist/server/src/lib/polling/response-dedup.js +2 -4
- package/dist/server/src/lib/polling/response-poller-core.js +191 -29
- package/dist/server/src/lib/polling/structured-history-gate.js +272 -16
- package/dist/server/src/lib/push/push-sender.js +21 -1
- package/dist/server/src/lib/push/waiting-push-notifier.js +126 -8
- package/dist/server/src/lib/realtime/publisher-registry.js +171 -0
- package/dist/server/src/lib/realtime/terminal-broadcast.js +14 -1
- package/dist/server/src/lib/realtime/types.js +96 -1
- package/dist/server/src/lib/session/current-output-builder.js +365 -4
- package/dist/server/src/lib/session/send-user-message.js +90 -2
- package/dist/server/src/lib/tui-accumulator.js +2 -8
- package/dist/server/src/lib/ws-server.js +143 -6
- package/dist/server/src/types/agent-transcript.js +241 -5
- package/dist/server/src/types/ui-state.js +24 -1
- package/package.json +1 -1
- package/public/sw.js +15 -1
- package/.next/server/app/api/worktrees/[id]/start-polling/route.js +0 -1
- package/.next/server/app/api/worktrees/[id]/start-polling/route.js.nft.json +0 -1
- package/.next/server/app/api/worktrees/[id]/start-polling/route_client-reference-manifest.js +0 -1
- package/.next/server/chunks/1714.js +0 -7
- package/.next/server/chunks/2198.js +0 -1
- package/.next/server/chunks/221.js +0 -25
- package/.next/server/chunks/2759.js +0 -8
- package/.next/server/chunks/3558.js +0 -1
- package/.next/server/chunks/6781.js +0 -1
- package/.next/server/chunks/9508.js +0 -1
- package/.next/static/0YoRrahue4Vchxg1z83IQ/_buildManifest.js +0 -1
- package/.next/static/chunks/1379-af7af9e08f47c979.js +0 -1
- package/.next/static/chunks/6381-9ba5198c0a6ff197.js +0 -1
- package/.next/static/chunks/app/api/agents/update/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/agents/versions/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/app/update/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/app/update-check/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/assistant/conversation/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/assistant/current-output/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/assistant/messages/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/assistant/session/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/assistant/start/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/assistant/terminal/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/assistant/tools/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/auth/login/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/auth/logout/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/auth/status/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/capabilities/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/daily-summary/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/daily-summary/status/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/external-apps/[id]/health/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/external-apps/[id]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/external-apps/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/fs/browse/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/fs/recent-paths/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/hooks/agent-event/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/hooks/claude-done/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/hooks/permission-request/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/metrics/vibe/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/ollama/models/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/push/escalation/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/push/subscriptions/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/push/vapid/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/remote/pair/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/repositories/[id]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/repositories/[id]/todos/[todoId]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/repositories/[id]/todos/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/repositories/clone/[jobId]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/repositories/clone/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/repositories/excluded/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/repositories/restore/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/repositories/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/repositories/scan/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/repositories/sync/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/repositories/validate-path/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/settings/default-agents/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/sidebar/group-order/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/skills/[id]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/skills/installations/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/skills/operations/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/skills/reindex/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/skills/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/slash-commands/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/tasks/[taskId]/cancel/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/tasks/[taskId]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/templates/[id]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/templates/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/todos/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/verification/runs/[runId]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/verification/runs/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/auto-yes/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/capture/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/clear-composer/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/cli-tool/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/cmate/schedules/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/current-output/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/env/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/[logId]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/files/[...path]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/branch/create/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/branch/delete/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/branches/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/checkout/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/commit/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/diff/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/fetch/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/log/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/pull/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/push/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/reset/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/revert/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/show/[commitHash]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stage/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/staged/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/[index]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/apply/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/pop/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/push/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/status/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/unstage/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/working-diff/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/instances/opencode/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/interrupt/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/kill-session/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/logs/[filename]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/logs/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/marp-render/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/memos/[memoId]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/memos/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/messages/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/opencode/diff/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/opencode/session/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/opencode/share/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/resolve-target/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/respond/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/[scheduleId]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/active/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/search/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/send/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/install/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/plan/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update-plan/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/slash-commands/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/special-keys/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/start-polling/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/tasks/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/terminal/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/timers/history/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/timers/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/todos/[todoId]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/todos/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/tree/[...path]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/tree/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/upload/[...path]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/verify/config/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/verify/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/viewed/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/apply-default-agents/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/api/worktrees/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/manifest.webmanifest/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/proxy/[...path]/route-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/layout-1c30fb8d4d6fa6ef.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/page-ce6279d581d1df95.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/terminal/page-00ad5d9a62a71cab.js +0 -1
- package/.next/static/css/b326c8a734e1928e.css +0 -1
- /package/.next/static/{0YoRrahue4Vchxg1z83IQ → pcpB4K6KreMzu2qbhvuRY}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,663 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Writing codex's own words into conversation history (Issue #2197).
|
|
4
|
+
*
|
|
5
|
+
* The codex half of the stand-down `lib/polling/structured-history-gate`
|
|
6
|
+
* arbitrates, on exactly the terms `../claude/history` established for Claude
|
|
7
|
+
* Code in #2121: the poller captures the pane and cleans it, this reads the
|
|
8
|
+
* agent's own transcript, and the two are mutually exclusive because
|
|
9
|
+
* {@link captureCodexTranscriptTurn} answers whether it wrote the turn.
|
|
10
|
+
*
|
|
11
|
+
* ## Pull, like claude — with a pointer codex hands over itself
|
|
12
|
+
*
|
|
13
|
+
* There is no connection to subscribe to. codex appends every record of a
|
|
14
|
+
* session to `$CODEX_HOME/sessions/<yyyy>/<mm>/<dd>/rollout-<local time>-<session
|
|
15
|
+
* id>.jsonl` as it goes, and the trigger to read it has to come from whatever
|
|
16
|
+
* already knows a turn just ended — the poller.
|
|
17
|
+
*
|
|
18
|
+
* Which file is this instance's is the same question #2121 answered for claude,
|
|
19
|
+
* and it has a better answer here. **The session id is a mutable pointer, not a
|
|
20
|
+
* key**: identity stays the (worktree, tool, instance) triple `buildCompositeKey`
|
|
21
|
+
* spells, and the session id only answers "which rollout does that triple point
|
|
22
|
+
* at *right now*". `/new` changing it is correct rather than a problem, because
|
|
23
|
+
* the conversation really did change — measured on codex-cli 0.151.0, where
|
|
24
|
+
* `/new` minted a new `session_id`, opened a new rollout file and fired a second
|
|
25
|
+
* `SessionStart` hook carrying it.
|
|
26
|
+
*
|
|
27
|
+
* Three consequences, all measured (`docs/design/codex-transcript-reader.md` §3):
|
|
28
|
+
*
|
|
29
|
+
* - **The hook's `session_id` is the rollout file's own uuid.** Verified on
|
|
30
|
+
* three live sessions: the id on every `SessionStart` / `UserPromptSubmit` /
|
|
31
|
+
* `Stop` payload was byte-identical to the uuid in the file name, and the
|
|
32
|
+
* payload's `transcript_path` was the absolute path of that same file.
|
|
33
|
+
* - **Two codex instances in one worktree do not collide.** They share a `cwd`,
|
|
34
|
+
* so a cwd-based guess would hand `codex-2`'s turn to `codex`; they do not
|
|
35
|
+
* share a session id. Verified by running two codex processes in one
|
|
36
|
+
* directory: two session ids, two files. This is why there is no cwd
|
|
37
|
+
* fallback here — see {@link resolveCodexSessionId}.
|
|
38
|
+
* - **A session with no pointer is left to the scraper.** No hooks configured,
|
|
39
|
+
* hooks configured but never trusted (codex skips untrusted hooks in
|
|
40
|
+
* silence — #1757 P4), or a server restarted mid-session: all three produce
|
|
41
|
+
* no pointer, and this module answers false for them. That is the fail-open
|
|
42
|
+
* the acceptance criteria ask for.
|
|
43
|
+
*
|
|
44
|
+
* ## Nothing here throws
|
|
45
|
+
*
|
|
46
|
+
* Same contract as the other two readers, for the same reason: this runs inside
|
|
47
|
+
* the poller's save path, and an exception would cost the scraped reply *as well
|
|
48
|
+
* as* the structured one. The database imports are dynamic so that
|
|
49
|
+
* `better-sqlite3` does not enter the module graph of everything that imports
|
|
50
|
+
* `@/lib/hooks/sources`.
|
|
51
|
+
*
|
|
52
|
+
* @module lib/hooks/sources/codex/history
|
|
53
|
+
*/
|
|
54
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
55
|
+
if (k2 === undefined) k2 = k;
|
|
56
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
57
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
58
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
59
|
+
}
|
|
60
|
+
Object.defineProperty(o, k2, desc);
|
|
61
|
+
}) : (function(o, m, k, k2) {
|
|
62
|
+
if (k2 === undefined) k2 = k;
|
|
63
|
+
o[k2] = m[k];
|
|
64
|
+
}));
|
|
65
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
66
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
67
|
+
}) : function(o, v) {
|
|
68
|
+
o["default"] = v;
|
|
69
|
+
});
|
|
70
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
71
|
+
var ownKeys = function(o) {
|
|
72
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
73
|
+
var ar = [];
|
|
74
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
75
|
+
return ar;
|
|
76
|
+
};
|
|
77
|
+
return ownKeys(o);
|
|
78
|
+
};
|
|
79
|
+
return function (mod) {
|
|
80
|
+
if (mod && mod.__esModule) return mod;
|
|
81
|
+
var result = {};
|
|
82
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
83
|
+
__setModuleDefault(result, mod);
|
|
84
|
+
return result;
|
|
85
|
+
};
|
|
86
|
+
})();
|
|
87
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
88
|
+
exports.CODEX_SESSIONS_MAX_DEPTH = exports.CODEX_ROLLOUT_FILE_PREFIX = exports.CODEX_DEFAULT_HOME_SEGMENT = exports.CODEX_HOME_ENV_VAR = exports.CODEX_TRANSCRIPT_TAIL_BYTES = void 0;
|
|
89
|
+
exports.resetCodexTranscriptSessions = resetCodexTranscriptSessions;
|
|
90
|
+
exports.resolveCodexSessionId = resolveCodexSessionId;
|
|
91
|
+
exports.resolveCodexHome = resolveCodexHome;
|
|
92
|
+
exports.codexSessionsRoot = codexSessionsRoot;
|
|
93
|
+
exports.acceptCodexRolloutPath = acceptCodexRolloutPath;
|
|
94
|
+
exports.isCodexRolloutFileFor = isCodexRolloutFileFor;
|
|
95
|
+
exports.findCodexRolloutPath = findCodexRolloutPath;
|
|
96
|
+
exports.captureCodexTranscriptTurn = captureCodexTranscriptTurn;
|
|
97
|
+
exports.resolveCodexTranscriptPath = resolveCodexTranscriptPath;
|
|
98
|
+
const promises_1 = require("fs/promises");
|
|
99
|
+
const os_1 = require("os");
|
|
100
|
+
const path_1 = require("path");
|
|
101
|
+
const auto_yes_state_1 = require("../../../../lib/auto-yes-state");
|
|
102
|
+
const transcript_tail_1 = require("../../../../lib/history/transcript-tail");
|
|
103
|
+
const user_turn_recorder_1 = require("../../../../lib/history/user-turn-recorder");
|
|
104
|
+
const logger_1 = require("../../../../lib/logger");
|
|
105
|
+
const agent_transcript_1 = require("../../../../types/agent-transcript");
|
|
106
|
+
const transcript_1 = require("./transcript");
|
|
107
|
+
const logger = (0, logger_1.createLogger)('lib/hooks/sources/codex/history');
|
|
108
|
+
/**
|
|
109
|
+
* How much of the rollout's tail is read.
|
|
110
|
+
*
|
|
111
|
+
* The shared bound, named here so codex's reader states it the way claude's
|
|
112
|
+
* does. The largest rollout on this machine on 2026-09-01 was 273 MB, which is
|
|
113
|
+
* an order of magnitude past claude's worst case and the reason the window is
|
|
114
|
+
* not optional.
|
|
115
|
+
*/
|
|
116
|
+
exports.CODEX_TRANSCRIPT_TAIL_BYTES = transcript_tail_1.TRANSCRIPT_TAIL_BYTES;
|
|
117
|
+
/** `$CODEX_HOME`, honoured so a sandboxed codex stays sandboxed. */
|
|
118
|
+
exports.CODEX_HOME_ENV_VAR = 'CODEX_HOME';
|
|
119
|
+
/** `~/.codex` — where codex keeps its state when `$CODEX_HOME` is unset. */
|
|
120
|
+
exports.CODEX_DEFAULT_HOME_SEGMENT = '.codex';
|
|
121
|
+
/** `rollout-` — the prefix codex puts on every session file. */
|
|
122
|
+
exports.CODEX_ROLLOUT_FILE_PREFIX = 'rollout-';
|
|
123
|
+
/**
|
|
124
|
+
* How deep under `sessions/` a rollout file may sit.
|
|
125
|
+
*
|
|
126
|
+
* `<year>/<month>/<day>/<file>` is the observed layout on every one of the 1,791
|
|
127
|
+
* files on this machine, which is three directory levels. The bound is stated so
|
|
128
|
+
* that a scan cannot walk an arbitrary tree if codex ever puts something else
|
|
129
|
+
* under `sessions/`.
|
|
130
|
+
*/
|
|
131
|
+
exports.CODEX_SESSIONS_MAX_DEPTH = 4;
|
|
132
|
+
/**
|
|
133
|
+
* The shape a codex session id has, and the only shape this reader will look up.
|
|
134
|
+
*
|
|
135
|
+
* A UUID, which is what codex mints (a v7, so the ids sort by time). The check
|
|
136
|
+
* is not cosmetic: the value reaches a file-name comparison, and an id carrying
|
|
137
|
+
* `/` or `..` would otherwise be a path expression. Everything that fails it is
|
|
138
|
+
* treated as "no pointer", which falls through to the scraper.
|
|
139
|
+
*/
|
|
140
|
+
const CODEX_SESSION_ID_PATTERN = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
|
|
141
|
+
/**
|
|
142
|
+
* The last session id seen for each instance.
|
|
143
|
+
*
|
|
144
|
+
* On `globalThis` for the reason every shared map in this subsystem is (#1736):
|
|
145
|
+
* under `next dev` the poller's bundle and the hook receiver's bundle would each
|
|
146
|
+
* get a private copy of a module-scoped map, one would write and the other would
|
|
147
|
+
* read, and every lookup would answer null with no error at all.
|
|
148
|
+
*
|
|
149
|
+
* A latch and not a cache: `getLastAgentEvent` holds only the newest event, and
|
|
150
|
+
* codex sends `session_id` on every event it delivers — but a future one that
|
|
151
|
+
* did not would otherwise blank the pointer mid-session.
|
|
152
|
+
*/
|
|
153
|
+
const sessionPointers = (globalThis.__codexTranscriptSessions ??= new Map());
|
|
154
|
+
/**
|
|
155
|
+
* Where each session id's rollout file was found.
|
|
156
|
+
*
|
|
157
|
+
* Keyed by `<codexHome>\0<sessionId>`, and a memo rather than a source of truth:
|
|
158
|
+
* every hit is re-`stat`ed before it is used. It exists because the lookup is a
|
|
159
|
+
* directory scan — codex names the file after the *local* wall-clock time the
|
|
160
|
+
* session started, which is not derivable from the id — and a scan of 1,791
|
|
161
|
+
* files on every finished turn is not something to do twice.
|
|
162
|
+
*/
|
|
163
|
+
const rolloutPaths = (globalThis.__codexTranscriptPaths ??= new Map());
|
|
164
|
+
function keyOf(target) {
|
|
165
|
+
return (0, auto_yes_state_1.buildCompositeKey)(target.worktreeId, target.cliToolId, target.instanceId);
|
|
166
|
+
}
|
|
167
|
+
/** Forget every instance's pointer and every memoised path. Test seam. */
|
|
168
|
+
function resetCodexTranscriptSessions() {
|
|
169
|
+
sessionPointers.clear();
|
|
170
|
+
rolloutPaths.clear();
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* The session id this instance's rollout is under, or null.
|
|
174
|
+
*
|
|
175
|
+
* Reads the structured event state first and falls back to the latched value.
|
|
176
|
+
* The import is dynamic so that `agent-event-state`'s module graph does not
|
|
177
|
+
* become a static dependency of the poller.
|
|
178
|
+
*
|
|
179
|
+
* **There is deliberately no fallback below this.** The obvious one — take the
|
|
180
|
+
* newest rollout whose `cwd` is this worktree — is wrong in the case the
|
|
181
|
+
* feature exists for: `codex` and `codex-2` in one worktree share a `cwd`, so
|
|
182
|
+
* the newest file is whichever of them answered last, and the primary's turn
|
|
183
|
+
* would be filed under the second's conversation. No pointer means the scraper
|
|
184
|
+
* keeps being the only record, which is merely the status quo.
|
|
185
|
+
*/
|
|
186
|
+
async function resolveCodexSessionId(target) {
|
|
187
|
+
const key = keyOf(target);
|
|
188
|
+
try {
|
|
189
|
+
const { getLastAgentEvent } = await Promise.resolve().then(() => __importStar(require('../../../../lib/session/agent-event-state')));
|
|
190
|
+
const sessionId = getLastAgentEvent(target.worktreeId, target.cliToolId, target.instanceId)?.sessionId;
|
|
191
|
+
if (typeof sessionId === 'string' && sessionId.length > 0) {
|
|
192
|
+
sessionPointers.set(key, sessionId);
|
|
193
|
+
return sessionId;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
catch (error) {
|
|
197
|
+
// A state module that cannot be reached is one that knows no session id.
|
|
198
|
+
logger.debug('codex-transcript-session-lookup-failed', {
|
|
199
|
+
worktreeId: target.worktreeId,
|
|
200
|
+
instanceId: target.instanceId ?? target.cliToolId,
|
|
201
|
+
error: error instanceof Error ? error.message : String(error),
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
return sessionPointers.get(key) ?? null;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* `$CODEX_HOME`, or `~/.codex`.
|
|
208
|
+
*
|
|
209
|
+
* @param env - The environment to read; `Record` rather than `NodeJS.ProcessEnv`
|
|
210
|
+
* so a caller can pass the two variables that matter instead of a whole one
|
|
211
|
+
*/
|
|
212
|
+
function resolveCodexHome(env = process.env) {
|
|
213
|
+
const configured = env[exports.CODEX_HOME_ENV_VAR];
|
|
214
|
+
if (typeof configured === 'string' && configured.length > 0)
|
|
215
|
+
return configured;
|
|
216
|
+
return (0, path_1.join)((0, os_1.homedir)(), exports.CODEX_DEFAULT_HOME_SEGMENT);
|
|
217
|
+
}
|
|
218
|
+
/** `<codexHome>/sessions`. */
|
|
219
|
+
function codexSessionsRoot(codexHome) {
|
|
220
|
+
return (0, path_1.join)(codexHome, ...transcript_1.CODEX_SESSIONS_DIR_SEGMENTS);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* A rollout path named by something other than this module, accepted only if it
|
|
224
|
+
* really is one.
|
|
225
|
+
*
|
|
226
|
+
* The same three conditions `acceptClaudeTranscriptHint` applies, for the same
|
|
227
|
+
* reasons: it must be under `<codexHome>/sessions`, so nothing can make this
|
|
228
|
+
* open `/etc/passwd`; it must end in `.jsonl`; and it must carry no NUL.
|
|
229
|
+
* Containment is checked on the *resolved* path so that `..` cannot climb out,
|
|
230
|
+
* and `resolve` is safe here — unlike in `validateHookCwd`, where the value is
|
|
231
|
+
* echoed back — because the resolved string is the only thing ever used.
|
|
232
|
+
*
|
|
233
|
+
* @returns The resolved path, or null when it is not acceptable
|
|
234
|
+
*/
|
|
235
|
+
function acceptCodexRolloutPath(codexHome, candidate) {
|
|
236
|
+
if (!candidate.endsWith(transcript_1.CODEX_ROLLOUT_EXTENSION))
|
|
237
|
+
return null;
|
|
238
|
+
if (candidate.includes('\0'))
|
|
239
|
+
return null;
|
|
240
|
+
const root = (0, path_1.resolve)(codexSessionsRoot(codexHome));
|
|
241
|
+
const resolved = (0, path_1.resolve)(candidate);
|
|
242
|
+
if (resolved !== root && !resolved.startsWith(root + path_1.sep))
|
|
243
|
+
return null;
|
|
244
|
+
return resolved;
|
|
245
|
+
}
|
|
246
|
+
/** Whether a file name is the rollout of this session. */
|
|
247
|
+
function isCodexRolloutFileFor(name, sessionId) {
|
|
248
|
+
return (name.startsWith(exports.CODEX_ROLLOUT_FILE_PREFIX) &&
|
|
249
|
+
name.endsWith(`-${sessionId}${transcript_1.CODEX_ROLLOUT_EXTENSION}`));
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Find this session's rollout file under `<codexHome>/sessions`.
|
|
253
|
+
*
|
|
254
|
+
* A scan, because the file name embeds the **local** wall-clock time the session
|
|
255
|
+
* started (`rollout-2026-09-01T10-08-39-<uuid>.jsonl` for a session whose own
|
|
256
|
+
* `timestamp` is `01:08:53Z`), so the directory and the name cannot be computed
|
|
257
|
+
* from the id. Directories are walked newest-modified first, which puts today's
|
|
258
|
+
* date directory first and makes the common case a two-level descent.
|
|
259
|
+
*
|
|
260
|
+
* @returns The absolute path, or null when nothing under the root matches
|
|
261
|
+
*/
|
|
262
|
+
async function findCodexRolloutPath(codexHome, sessionId, depth = exports.CODEX_SESSIONS_MAX_DEPTH) {
|
|
263
|
+
if (!CODEX_SESSION_ID_PATTERN.test(sessionId))
|
|
264
|
+
return null;
|
|
265
|
+
return scanForRollout(codexSessionsRoot(codexHome), sessionId, depth);
|
|
266
|
+
}
|
|
267
|
+
async function scanForRollout(dir, sessionId, depth) {
|
|
268
|
+
if (depth <= 0)
|
|
269
|
+
return null;
|
|
270
|
+
let entries;
|
|
271
|
+
try {
|
|
272
|
+
entries = await (0, promises_1.readdir)(dir, { withFileTypes: true });
|
|
273
|
+
}
|
|
274
|
+
catch {
|
|
275
|
+
// A root that does not exist is a session this reader cannot see, which is
|
|
276
|
+
// the same answer as a session with no file: null, and the scraper keeps it.
|
|
277
|
+
return null;
|
|
278
|
+
}
|
|
279
|
+
const directories = [];
|
|
280
|
+
for (const entry of entries) {
|
|
281
|
+
if (entry.isFile()) {
|
|
282
|
+
if (isCodexRolloutFileFor(entry.name, sessionId))
|
|
283
|
+
return (0, path_1.join)(dir, entry.name);
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
if (entry.isDirectory())
|
|
287
|
+
directories.push(entry.name);
|
|
288
|
+
}
|
|
289
|
+
// Newest first: the layout is <year>/<month>/<day>, so descending name order
|
|
290
|
+
// is descending date order without a `stat` per directory.
|
|
291
|
+
directories.sort((a, b) => (a < b ? 1 : a > b ? -1 : 0));
|
|
292
|
+
for (const name of directories) {
|
|
293
|
+
const found = await scanForRollout((0, path_1.join)(dir, name), sessionId, depth - 1);
|
|
294
|
+
if (found)
|
|
295
|
+
return found;
|
|
296
|
+
}
|
|
297
|
+
return null;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Read this instance's unwritten turns out of its rollout and write them.
|
|
301
|
+
*
|
|
302
|
+
* **Every turn in the window that is not already a row**, oldest first, which is
|
|
303
|
+
* the shape Issue #2246 gave all three pull readers and the reasoning for it is
|
|
304
|
+
* written out once on `../claude/history`'s
|
|
305
|
+
* {@link captureClaudeTranscriptTurn}. The short version: this reader only runs
|
|
306
|
+
* when the poller judges a turn finished, so a missed judgement used to lose a
|
|
307
|
+
* turn permanently — by the next judgement "the newest turn" had moved on.
|
|
308
|
+
*
|
|
309
|
+
* #2121's one-row-per-turn argument is preserved by the **anchor**: the newest
|
|
310
|
+
* turn in the window this reader has already written is where the backfill
|
|
311
|
+
* starts, and a window with no anchor falls back to the newest turn alone.
|
|
312
|
+
*
|
|
313
|
+
* The return value is the poller's instruction, and it is about the **newest**
|
|
314
|
+
* turn whatever else was written on the way. **True** means History holds
|
|
315
|
+
* this turn as the agent's own Markdown and the scrape must be dropped. **False**
|
|
316
|
+
* means it does not, for any reason at all — no session pointer, no file, an
|
|
317
|
+
* unreadable file, a turn codex has not closed yet — and the scrape must be
|
|
318
|
+
* saved. Everything that can go wrong answers false: two writers duplicate a
|
|
319
|
+
* reply, no writer loses one.
|
|
320
|
+
*
|
|
321
|
+
* The user rows are written even when the assistant row is not, and that is
|
|
322
|
+
* deliberate rather than an oversight. A prompt the operator typed into `tmux
|
|
323
|
+
* attach` is the thing #2196 exists to record, and it is worth recording next to
|
|
324
|
+
* a *scraped* reply just as much as next to a Markdown one.
|
|
325
|
+
*
|
|
326
|
+
* Never throws.
|
|
327
|
+
*
|
|
328
|
+
* @param target - The instance whose turn just ended
|
|
329
|
+
* @param capture - See {@link CodexTranscriptCapture}
|
|
330
|
+
* @returns Whether History now holds this turn as the agent's own Markdown
|
|
331
|
+
*/
|
|
332
|
+
async function captureCodexTranscriptTurn(target, capture = {}) {
|
|
333
|
+
const instanceId = target.instanceId ?? target.cliToolId;
|
|
334
|
+
try {
|
|
335
|
+
const codexHome = capture.codexHome ?? resolveCodexHome();
|
|
336
|
+
const sessionId = await resolveCodexSessionId(target);
|
|
337
|
+
if (!sessionId) {
|
|
338
|
+
logger.debug('codex-transcript-unavailable', {
|
|
339
|
+
worktreeId: target.worktreeId,
|
|
340
|
+
instanceId,
|
|
341
|
+
reason: 'no-session-pointer',
|
|
342
|
+
});
|
|
343
|
+
return false;
|
|
344
|
+
}
|
|
345
|
+
const path = await locateCodexRollout(codexHome, sessionId);
|
|
346
|
+
if (!path) {
|
|
347
|
+
logger.debug('codex-transcript-unavailable', {
|
|
348
|
+
worktreeId: target.worktreeId,
|
|
349
|
+
instanceId,
|
|
350
|
+
sessionId,
|
|
351
|
+
reason: 'no-file',
|
|
352
|
+
});
|
|
353
|
+
return false;
|
|
354
|
+
}
|
|
355
|
+
const text = await (0, transcript_tail_1.readTranscriptTail)(path);
|
|
356
|
+
if (text === null)
|
|
357
|
+
return false;
|
|
358
|
+
const parsed = (0, transcript_1.parseCodexRollout)(text);
|
|
359
|
+
const built = (0, transcript_1.buildCodexTurns)(parsed.records, sessionId);
|
|
360
|
+
if (built.turns.length === 0) {
|
|
361
|
+
logger.info('codex-transcript-no-turn', {
|
|
362
|
+
worktreeId: target.worktreeId,
|
|
363
|
+
instanceId,
|
|
364
|
+
path,
|
|
365
|
+
records: parsed.records.length,
|
|
366
|
+
malformedLines: parsed.malformedLines,
|
|
367
|
+
duplicateStreamRecords: built.duplicateStreamRecords,
|
|
368
|
+
});
|
|
369
|
+
return false;
|
|
370
|
+
}
|
|
371
|
+
if (parsed.malformedLines > 0) {
|
|
372
|
+
// Expected in small numbers — a fragment at the tail of a file being
|
|
373
|
+
// appended to — and the kind of thing that must be visible when it stops
|
|
374
|
+
// being small.
|
|
375
|
+
logger.info('codex-transcript-partial-read', {
|
|
376
|
+
worktreeId: target.worktreeId,
|
|
377
|
+
instanceId,
|
|
378
|
+
path,
|
|
379
|
+
malformedLines: parsed.malformedLines,
|
|
380
|
+
turnlessRecords: built.turnlessRecords,
|
|
381
|
+
duplicateStreamRecords: built.duplicateStreamRecords,
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
const pending = await selectUnwrittenCodexTurns(target, built.turns);
|
|
385
|
+
if (pending.turns.length === 0) {
|
|
386
|
+
logger.debug('codex-transcript-turns-already-saved', {
|
|
387
|
+
worktreeId: target.worktreeId,
|
|
388
|
+
instanceId,
|
|
389
|
+
turnsInWindow: built.turns.length,
|
|
390
|
+
});
|
|
391
|
+
return true;
|
|
392
|
+
}
|
|
393
|
+
if (pending.turns.length > 1) {
|
|
394
|
+
logger.info('codex-transcript-backfilling-turns', {
|
|
395
|
+
worktreeId: target.worktreeId,
|
|
396
|
+
instanceId,
|
|
397
|
+
path,
|
|
398
|
+
pendingTurns: pending.turns.length,
|
|
399
|
+
turnsInWindow: built.turns.length,
|
|
400
|
+
anchored: pending.anchored,
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
let captured = false;
|
|
404
|
+
for (let index = 0; index < pending.turns.length; index += 1) {
|
|
405
|
+
const turn = pending.turns[index];
|
|
406
|
+
const previousStartedAt = index === 0 ? pending.previousStartedAt : pending.turns[index - 1].startedAt;
|
|
407
|
+
const lastUserRow = await recordCodexUserTurns(target, turn, previousStartedAt);
|
|
408
|
+
captured = await writeCodexTurn(target, turn, (0, transcript_1.renderCodexTurn)(turn), resolveAssistantTimestampMs(turn, lastUserRow), path);
|
|
409
|
+
}
|
|
410
|
+
return captured;
|
|
411
|
+
}
|
|
412
|
+
catch (error) {
|
|
413
|
+
logger.error('codex-transcript-capture-failed', {
|
|
414
|
+
worktreeId: target.worktreeId,
|
|
415
|
+
instanceId,
|
|
416
|
+
error: error instanceof Error ? error.message : String(error),
|
|
417
|
+
});
|
|
418
|
+
return false;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* The rollout file this instance would be read from, or null (Issue #2246).
|
|
423
|
+
*
|
|
424
|
+
* The same two steps {@link captureCodexTranscriptTurn} opens with, asked
|
|
425
|
+
* without reading or writing anything; see `../claude/history`'s
|
|
426
|
+
* {@link resolveClaudeTranscriptPath} for what the Stop receiver does with it.
|
|
427
|
+
*
|
|
428
|
+
* Never throws.
|
|
429
|
+
*/
|
|
430
|
+
async function resolveCodexTranscriptPath(target, capture = {}) {
|
|
431
|
+
try {
|
|
432
|
+
const sessionId = await resolveCodexSessionId(target);
|
|
433
|
+
if (!sessionId)
|
|
434
|
+
return null;
|
|
435
|
+
return await locateCodexRollout(capture.codexHome ?? resolveCodexHome(), sessionId);
|
|
436
|
+
}
|
|
437
|
+
catch {
|
|
438
|
+
return null;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* The turns {@link captureCodexTranscriptTurn} still has to write (Issue #2246).
|
|
443
|
+
*
|
|
444
|
+
* The same rule as `../claude/history`'s, on codex's own key: search backwards
|
|
445
|
+
* from the newest turn for one that is already a row, and take everything after
|
|
446
|
+
* it. Record order and never a timestamp, and bounded by the window — a turn
|
|
447
|
+
* whose records fell outside {@link CODEX_TRANSCRIPT_TAIL_BYTES} is not in `turns`.
|
|
448
|
+
*
|
|
449
|
+
* @param turns - Every turn in the window, oldest first
|
|
450
|
+
*/
|
|
451
|
+
async function selectUnwrittenCodexTurns(target, turns) {
|
|
452
|
+
const [{ getDbInstance }, { findMessageByRequestId }] = await Promise.all([
|
|
453
|
+
Promise.resolve().then(() => __importStar(require('../../../../lib/db/db-instance'))),
|
|
454
|
+
Promise.resolve().then(() => __importStar(require('../../../../lib/db'))),
|
|
455
|
+
]);
|
|
456
|
+
const db = getDbInstance();
|
|
457
|
+
for (let index = turns.length - 1; index >= 0; index -= 1) {
|
|
458
|
+
const requestId = (0, agent_transcript_1.codexTurnRequestId)(turns[index].turnId);
|
|
459
|
+
if (!findMessageByRequestId(db, target.worktreeId, requestId))
|
|
460
|
+
continue;
|
|
461
|
+
return {
|
|
462
|
+
turns: turns.slice(index + 1),
|
|
463
|
+
previousStartedAt: turns[index].startedAt,
|
|
464
|
+
anchored: true,
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
return {
|
|
468
|
+
turns: turns.slice(-1),
|
|
469
|
+
previousStartedAt: turns.length > 1 ? turns[turns.length - 2].startedAt : 0,
|
|
470
|
+
anchored: false,
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* The rollout file for this session, or null.
|
|
475
|
+
*
|
|
476
|
+
* The memo first, the scan second, and the filesystem is the arbiter of both:
|
|
477
|
+
* "the path we found last time" and "the path that exists" differ the moment
|
|
478
|
+
* codex rotates or the operator clears a session directory.
|
|
479
|
+
*/
|
|
480
|
+
async function locateCodexRollout(codexHome, sessionId) {
|
|
481
|
+
const memoKey = `${codexHome}\0${sessionId}`;
|
|
482
|
+
const memoised = rolloutPaths.get(memoKey);
|
|
483
|
+
if (memoised && (await isReadableFile(memoised)))
|
|
484
|
+
return memoised;
|
|
485
|
+
if (memoised)
|
|
486
|
+
rolloutPaths.delete(memoKey);
|
|
487
|
+
const found = await findCodexRolloutPath(codexHome, sessionId);
|
|
488
|
+
if (!found)
|
|
489
|
+
return null;
|
|
490
|
+
const accepted = acceptCodexRolloutPath(codexHome, found);
|
|
491
|
+
if (!accepted)
|
|
492
|
+
return null;
|
|
493
|
+
rolloutPaths.set(memoKey, accepted);
|
|
494
|
+
return accepted;
|
|
495
|
+
}
|
|
496
|
+
async function isReadableFile(path) {
|
|
497
|
+
try {
|
|
498
|
+
return (await (0, promises_1.stat)(path)).isFile();
|
|
499
|
+
}
|
|
500
|
+
catch {
|
|
501
|
+
return false;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Record every prompt this turn answers, before the reply is written (#2196).
|
|
506
|
+
*
|
|
507
|
+
* One row per `UserMessage` item rather than one per turn: codex folds a prompt
|
|
508
|
+
* submitted while a turn is running into that same turn, so a turn can carry
|
|
509
|
+
* several, and `codexPromptRequestId` is keyed on the item's own id so that each
|
|
510
|
+
* of them is written once and recognised on a re-read.
|
|
511
|
+
*
|
|
512
|
+
* Ordering is why this runs before the assistant row rather than inside
|
|
513
|
+
* {@link writeCodexTurn}: the user row has to exist first so that
|
|
514
|
+
* {@link resolveAssistantTimestampMs} can put the reply after it, and so that a
|
|
515
|
+
* browser watching the broadcast sees a prompt appear and then an answer.
|
|
516
|
+
*
|
|
517
|
+
* Never throws; `recordUserTurn` reports its failures in the return value.
|
|
518
|
+
*
|
|
519
|
+
* @returns The last row written or found, for the timestamp
|
|
520
|
+
*/
|
|
521
|
+
async function recordCodexUserTurns(target, turn, previousStartedAt = 0) {
|
|
522
|
+
const instanceId = target.instanceId ?? target.cliToolId;
|
|
523
|
+
let last = { outcome: 'skipped', messageId: null, timestampMs: null };
|
|
524
|
+
// Issue #2246: a turn read late is a turn whose `/send` row may be older than
|
|
525
|
+
// #2196's symmetric window reaches. The previous turn's start is the tightest
|
|
526
|
+
// honest bound, and it only ever widens the search.
|
|
527
|
+
const adoption = previousStartedAt > 0 ? { adoptionFromMs: previousStartedAt } : {};
|
|
528
|
+
for (const prompt of turn.prompts) {
|
|
529
|
+
const recorded = await (0, user_turn_recorder_1.recordUserTurn)(target, (0, agent_transcript_1.codexPromptRequestId)(prompt.itemId), prompt.text, prompt.timestampMs, adoption);
|
|
530
|
+
if (recorded.outcome === 'failed') {
|
|
531
|
+
logger.warn('codex-transcript-user-turn-failed', {
|
|
532
|
+
worktreeId: target.worktreeId,
|
|
533
|
+
instanceId,
|
|
534
|
+
sessionId: turn.sessionId,
|
|
535
|
+
turnId: turn.turnId,
|
|
536
|
+
promptItemId: prompt.itemId,
|
|
537
|
+
});
|
|
538
|
+
continue;
|
|
539
|
+
}
|
|
540
|
+
last = recorded;
|
|
541
|
+
}
|
|
542
|
+
return last;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* When the assistant row for this turn is dated.
|
|
546
|
+
*
|
|
547
|
+
* The turn's own clock, from the first record bearing its `turn_id`, so a row
|
|
548
|
+
* written a poll late still sorts where the conversation put it.
|
|
549
|
+
*
|
|
550
|
+
* When there is a user row it sits on the same instant or later, and
|
|
551
|
+
* `groupMessagesIntoPairs` orders by timestamp and nothing else — a tie there is
|
|
552
|
+
* decided by whichever row the database returned first, and the losing
|
|
553
|
+
* arrangement (assistant, then user) is exactly the `orphan` pair #2196 exists
|
|
554
|
+
* to remove. So the reply is moved to the first millisecond after the last
|
|
555
|
+
* prompt: the smallest change that makes the order a property of the data.
|
|
556
|
+
*/
|
|
557
|
+
function resolveAssistantTimestampMs(turn, userRow) {
|
|
558
|
+
if (userRow.timestampMs === null)
|
|
559
|
+
return turn.startedAt;
|
|
560
|
+
return Math.max(turn.startedAt, userRow.timestampMs + 1);
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* Write one rendered turn, unless it is already there.
|
|
564
|
+
*
|
|
565
|
+
* `findMessageByRequestId` is both the idempotency check and the reason a repeat
|
|
566
|
+
* poll does not duplicate the row: the id is codex's own `turn_id`, which does
|
|
567
|
+
* not change between reads of the same file.
|
|
568
|
+
*
|
|
569
|
+
* Answering **true** for a turn that was already saved is deliberate. It means
|
|
570
|
+
* "History holds this turn as Markdown", which is what the poller needs to know
|
|
571
|
+
* — a second poll of the same finished turn must not save the pane's copy on top
|
|
572
|
+
* of the row this path wrote.
|
|
573
|
+
*
|
|
574
|
+
* @returns Whether History holds this turn as the agent's own Markdown
|
|
575
|
+
*/
|
|
576
|
+
async function writeCodexTurn(target, turn, rendered, timestampMs, path) {
|
|
577
|
+
const instanceId = target.instanceId ?? target.cliToolId;
|
|
578
|
+
if (!turn.closed) {
|
|
579
|
+
// codex has not written the `task_complete` for this `turn_id` yet, so what
|
|
580
|
+
// is in the file is a turn in progress. Writing it would put a truncated
|
|
581
|
+
// reply in History permanently — and unlike an empty one, a truncated one
|
|
582
|
+
// looks finished. Handing it back to the scraper costs the Markdown
|
|
583
|
+
// rendering for this turn and nothing else.
|
|
584
|
+
logger.info('codex-transcript-turn-open', {
|
|
585
|
+
worktreeId: target.worktreeId,
|
|
586
|
+
instanceId,
|
|
587
|
+
sessionId: rendered.sessionId,
|
|
588
|
+
turnId: rendered.turnId,
|
|
589
|
+
items: turn.items.length,
|
|
590
|
+
});
|
|
591
|
+
return false;
|
|
592
|
+
}
|
|
593
|
+
if (rendered.body.length === 0) {
|
|
594
|
+
// A closed turn that said nothing — a `/`-command turn, or one whose only
|
|
595
|
+
// items were silent. Answering false hands it to the scraper, which is the
|
|
596
|
+
// only correct answer: an empty row would show as a blank reply forever.
|
|
597
|
+
logger.info('codex-transcript-turn-empty', {
|
|
598
|
+
worktreeId: target.worktreeId,
|
|
599
|
+
instanceId,
|
|
600
|
+
sessionId: rendered.sessionId,
|
|
601
|
+
turnId: rendered.turnId,
|
|
602
|
+
});
|
|
603
|
+
return false;
|
|
604
|
+
}
|
|
605
|
+
if (rendered.unknownBlockTypes.length > 0) {
|
|
606
|
+
// Never dropped in silence: an item type this reader has no rule for is a
|
|
607
|
+
// codex release that has grown one, and the tally is how that becomes
|
|
608
|
+
// visible before somebody notices a missing paragraph.
|
|
609
|
+
logger.info('codex-transcript-unknown-items', {
|
|
610
|
+
worktreeId: target.worktreeId,
|
|
611
|
+
instanceId,
|
|
612
|
+
sessionId: rendered.sessionId,
|
|
613
|
+
turnId: rendered.turnId,
|
|
614
|
+
itemTypes: rendered.unknownBlockTypes,
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
if (turn.overflowed) {
|
|
618
|
+
logger.info('codex-transcript-turn-overflowed', {
|
|
619
|
+
worktreeId: target.worktreeId,
|
|
620
|
+
instanceId,
|
|
621
|
+
sessionId: rendered.sessionId,
|
|
622
|
+
turnId: rendered.turnId,
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
const requestId = (0, agent_transcript_1.codexTurnRequestId)(rendered.turnId);
|
|
626
|
+
const [{ getDbInstance }, { createMessage, findMessageByRequestId }, { broadcastMessage }] = await Promise.all([
|
|
627
|
+
Promise.resolve().then(() => __importStar(require('../../../../lib/db/db-instance'))),
|
|
628
|
+
Promise.resolve().then(() => __importStar(require('../../../../lib/db'))),
|
|
629
|
+
Promise.resolve().then(() => __importStar(require('../../../../lib/ws-server'))),
|
|
630
|
+
]);
|
|
631
|
+
const db = getDbInstance();
|
|
632
|
+
if (findMessageByRequestId(db, target.worktreeId, requestId)) {
|
|
633
|
+
logger.debug('codex-transcript-turn-already-saved', {
|
|
634
|
+
worktreeId: target.worktreeId,
|
|
635
|
+
instanceId,
|
|
636
|
+
requestId,
|
|
637
|
+
});
|
|
638
|
+
return true;
|
|
639
|
+
}
|
|
640
|
+
const message = createMessage(db, {
|
|
641
|
+
worktreeId: target.worktreeId,
|
|
642
|
+
role: 'assistant',
|
|
643
|
+
content: rendered.body,
|
|
644
|
+
messageType: 'normal',
|
|
645
|
+
timestamp: new Date(timestampMs > 0 ? timestampMs : Date.now()),
|
|
646
|
+
cliToolId: target.cliToolId,
|
|
647
|
+
instanceId,
|
|
648
|
+
requestId,
|
|
649
|
+
});
|
|
650
|
+
broadcastMessage('message', { worktreeId: target.worktreeId, message });
|
|
651
|
+
logger.info('codex-transcript-turn-saved', {
|
|
652
|
+
worktreeId: target.worktreeId,
|
|
653
|
+
instanceId,
|
|
654
|
+
sessionId: rendered.sessionId,
|
|
655
|
+
requestId,
|
|
656
|
+
path,
|
|
657
|
+
bodyLength: rendered.body.length,
|
|
658
|
+
textBlocks: rendered.textBlocks,
|
|
659
|
+
toolBlocks: rendered.toolBlocks,
|
|
660
|
+
prompts: turn.prompts.length,
|
|
661
|
+
});
|
|
662
|
+
return true;
|
|
663
|
+
}
|
|
@@ -110,6 +110,10 @@ exports.codexAgentEventSource = (0, define_source_1.definePushHookSource)({
|
|
|
110
110
|
permissionReplyReleasesPrompt: false,
|
|
111
111
|
eventIdentity: null,
|
|
112
112
|
resync: 'none',
|
|
113
|
+
// Issue #2197. codex appends every record of a session to
|
|
114
|
+
// `$CODEX_HOME/sessions/**/rollout-*-<session_id>.jsonl`, and the hook
|
|
115
|
+
// payload names that file outright — see `./history`.
|
|
116
|
+
transcriptHistory: 'pull',
|
|
113
117
|
},
|
|
114
118
|
// Same CamelCase dialect as Claude and copilot (#1757 §8.1). The table is
|
|
115
119
|
// shared, the choice to use it is this source's.
|