commandmate 0.16.0 → 0.18.0
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 +298 -228
- package/.next/app-path-routes-manifest.json +39 -29
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +12 -12
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +57 -0
- package/.next/server/app/_not-found/page_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 +1 -1
- 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 +3 -3
- 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/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.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 -0
- package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -0
- package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/hooks/claude-done/route.js +1 -1
- 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/metrics/vibe/route.js +37 -0
- package/.next/server/app/api/metrics/vibe/route.js.nft.json +1 -0
- package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/subscriptions/route.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_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.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.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/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.js +4 -0
- package/.next/server/app/api/tasks/[taskId]/cancel/route.js.nft.json +1 -0
- package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/tasks/[taskId]/route.js +4 -0
- package/.next/server/app/api/tasks/[taskId]/route.js.nft.json +1 -0
- package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/templates/[id]/route.js +1 -1
- package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/route.js +1 -1
- package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/todos/route.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.js +1 -0
- package/.next/server/app/api/verification/runs/[runId]/route.js.nft.json +1 -0
- package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/verification/runs/route.js +1 -0
- package/.next/server/app/api/verification/runs/route.js.nft.json +1 -0
- package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -0
- 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]/cli-tool/route.js +1 -1
- 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.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]/execution-logs/[logId]/route.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.js +2 -2
- 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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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]/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.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.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.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.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.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.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]/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]/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.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.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.js +2 -2
- package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/search/route.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/route.js +2 -2
- 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.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]/start-polling/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/start-polling/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/start-polling/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tasks/route.js +6 -0
- package/.next/server/app/api/worktrees/[id]/tasks/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -0
- 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.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.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.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.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.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.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/route.js +4 -0
- package/.next/server/app/api/worktrees/[id]/verify/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/worktrees/[id]/verify/runs/route.js +1 -0
- package/.next/server/app/api/worktrees/[id]/verify/runs/route.js.nft.json +1 -0
- package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/worktrees/[id]/viewed/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/viewed/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_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.js +1 -1
- package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
- package/.next/server/app/review/page.js +1 -1
- package/.next/server/app/review/page_client-reference-manifest.js +1 -1
- package/.next/server/app/sessions/page.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 +2 -2
- package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +39 -29
- package/.next/server/chunks/1068.js +1 -1
- package/.next/server/chunks/1117.js +1 -1
- package/.next/server/chunks/1503.js +2 -0
- package/.next/server/chunks/2366.js +1 -0
- package/.next/server/chunks/3042.js +1 -1
- package/.next/server/chunks/3736.js +1 -1
- package/.next/server/chunks/4444.js +1 -1
- package/.next/server/chunks/4689.js +25 -0
- package/.next/server/chunks/5381.js +50 -10
- package/.next/server/chunks/5959.js +3 -3
- package/.next/server/chunks/6130.js +1 -1
- package/.next/server/chunks/6274.js +13 -0
- package/.next/server/chunks/646.js +1 -1
- package/.next/server/chunks/8681.js +1 -1
- package/.next/server/chunks/8807.js +194 -51
- package/.next/server/chunks/8856.js +4 -0
- package/.next/server/chunks/9687.js +2 -2
- 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/static/-BSmW0Ae2YsxyCl_ue7_d/_buildManifest.js +1 -0
- package/.next/static/chunks/{4560-8ffb0bb19f2ba998.js → 4560-0917ae2e6a0e5400.js} +1 -1
- package/.next/static/chunks/{6488-c2a968ec806975c2.js → 6488-109e3825c7249e47.js} +1 -1
- package/.next/static/chunks/app/api/app/update/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/app/update-check/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/assistant/conversation/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/assistant/current-output/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/assistant/messages/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/assistant/session/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/assistant/start/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/assistant/terminal/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/assistant/tools/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/auth/login/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/auth/logout/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/auth/status/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/daily-summary/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/daily-summary/status/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/external-apps/[id]/health/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/external-apps/[id]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/external-apps/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/fs/browse/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/fs/recent-paths/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/hooks/agent-event/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/hooks/claude-done/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/metrics/vibe/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/ollama/models/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/push/subscriptions/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/push/vapid/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/repositories/[id]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/repositories/[id]/todos/[todoId]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/repositories/[id]/todos/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/repositories/clone/[jobId]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/repositories/clone/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/repositories/excluded/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/repositories/restore/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/repositories/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/repositories/scan/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/repositories/sync/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/repositories/validate-path/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/sidebar/group-order/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/skills/[id]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/skills/installations/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/skills/operations/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/skills/reindex/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/skills/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/slash-commands/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/tasks/[taskId]/cancel/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/tasks/[taskId]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/templates/[id]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/templates/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/todos/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/verification/runs/[runId]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/verification/runs/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/auto-yes/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/capture/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/cli-tool/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/cmate/schedules/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/current-output/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/[logId]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/files/[...path]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/branch/create/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/branch/delete/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/branches/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/checkout/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/commit/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/diff/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/fetch/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/log/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/pull/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/push/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/reset/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/revert/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/show/[commitHash]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stage/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/staged/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/[index]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/apply/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/pop/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/push/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/status/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/unstage/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/working-diff/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/interrupt/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/kill-session/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/logs/[filename]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/logs/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/marp-render/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/memos/[memoId]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/memos/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/messages/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/respond/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/[scheduleId]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/active/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/search/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/send/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/install/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/plan/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/slash-commands/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/special-keys/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/start-polling/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/tasks/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/terminal/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/timers/history/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/timers/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/todos/[todoId]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/todos/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/tree/[...path]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/tree/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/upload/[...path]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/verify/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/viewed/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/api/worktrees/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/manifest.webmanifest/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/proxy/[...path]/route-8440b6c72bed83a1.js +1 -0
- package/.next/static/chunks/app/repositories/page-1ed1e5a542ecc168.js +1 -0
- package/.next/static/chunks/app/review/{page-f431d630097c2e85.js → page-b559bfb11c46931b.js} +1 -1
- package/.next/static/chunks/app/sessions/{page-20f07a99db64d2ca.js → page-3fa7e767d0ab3889.js} +1 -1
- package/.next/static/chunks/app/worktrees/[id]/page-12b3c5f32fc6094e.js +1 -0
- package/.next/trace +12 -11
- package/.next/types/app/api/hooks/agent-event/route.ts +347 -0
- package/.next/types/app/api/metrics/vibe/route.ts +347 -0
- package/.next/types/app/api/tasks/[taskId]/cancel/route.ts +347 -0
- package/.next/types/app/api/tasks/[taskId]/route.ts +347 -0
- package/.next/types/app/api/verification/runs/[runId]/route.ts +347 -0
- package/.next/types/app/api/verification/runs/route.ts +347 -0
- package/.next/types/app/api/worktrees/[id]/tasks/route.ts +347 -0
- package/.next/types/app/api/worktrees/[id]/verify/route.ts +347 -0
- package/.next/types/app/api/worktrees/[id]/verify/runs/[runId]/route.ts +347 -0
- package/.next/types/app/api/worktrees/[id]/verify/runs/route.ts +347 -0
- package/.next/types/routes.d.ts +11 -1
- package/.next/types/validator.ts +90 -0
- package/dist/cli/commands/report.d.ts +1 -0
- package/dist/cli/commands/report.d.ts.map +1 -1
- package/dist/cli/commands/report.js +54 -0
- package/dist/cli/commands/send.d.ts.map +1 -1
- package/dist/cli/commands/send.js +116 -14
- package/dist/cli/commands/task.d.ts +11 -0
- package/dist/cli/commands/task.d.ts.map +1 -0
- package/dist/cli/commands/task.js +126 -0
- package/dist/cli/commands/verify.d.ts +19 -0
- package/dist/cli/commands/verify.d.ts.map +1 -0
- package/dist/cli/commands/verify.js +229 -0
- package/dist/cli/commands/wait.d.ts +2 -0
- package/dist/cli/commands/wait.d.ts.map +1 -1
- package/dist/cli/commands/wait.js +128 -13
- package/dist/cli/docs/agent-operations.d.ts +2 -2
- package/dist/cli/docs/agent-operations.d.ts.map +1 -1
- package/dist/cli/docs/agent-operations.js +92 -3
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +6 -0
- package/dist/cli/types/api-responses.d.ts +180 -0
- package/dist/cli/types/api-responses.d.ts.map +1 -1
- package/dist/cli/types/index.d.ts +82 -0
- package/dist/cli/types/index.d.ts.map +1 -1
- package/dist/cli/types/index.js +30 -1
- package/dist/cli/utils/api-client.d.ts +8 -0
- package/dist/cli/utils/api-client.d.ts.map +1 -1
- package/dist/cli/utils/verify-runner.d.ts +63 -0
- package/dist/cli/utils/verify-runner.d.ts.map +1 -0
- package/dist/cli/utils/verify-runner.js +175 -0
- package/dist/server/server.js +15 -0
- package/dist/server/src/config/auto-yes-config.js +22 -0
- package/dist/server/src/lib/auto-yes-poller.js +34 -2
- package/dist/server/src/lib/auto-yes-state.js +6 -19
- package/dist/server/src/lib/db/db.js +34 -1
- package/dist/server/src/lib/db/migrations/index.js +6 -0
- package/dist/server/src/lib/db/migrations/runner.js +1 -1
- package/dist/server/src/lib/db/migrations/v49-verification-runs.js +86 -0
- package/dist/server/src/lib/db/migrations/v50-tasks.js +68 -0
- package/dist/server/src/lib/db/migrations/v51-task-events.js +58 -0
- package/dist/server/src/lib/db/task-events-db.js +59 -0
- package/dist/server/src/lib/db/tasks-db.js +263 -0
- package/dist/server/src/lib/db/verification-db.js +290 -0
- package/dist/server/src/lib/polling/auto-yes-policy.js +117 -0
- package/dist/server/src/lib/polling/auto-yes-resolver.js +144 -4
- package/dist/server/src/lib/polling/response-checker.js +8 -0
- package/dist/server/src/lib/session/agent-event-state.js +46 -0
- package/dist/server/src/lib/session/current-output-builder.js +4 -0
- package/dist/server/src/lib/session/status-mapping.js +146 -0
- package/dist/server/src/lib/tasks/contract-parser.js +385 -0
- package/dist/server/src/lib/tasks/task-state-machine.js +183 -0
- package/dist/server/src/lib/tasks/task-transition-service.js +106 -0
- package/dist/server/src/lib/verification/verification-reconciler.js +49 -0
- package/dist/server/src/types/sidebar.js +7 -20
- package/package.json +5 -2
- package/scripts/hooks/cmate-agent-event.sh +175 -0
- package/.next/server/chunks/2064.js +0 -2
- package/.next/static/AKqbAyuzbFfg05qpbCI_K/_buildManifest.js +0 -1
- package/.next/static/chunks/app/api/app/update/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/app/update-check/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/assistant/conversation/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/assistant/current-output/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/assistant/messages/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/assistant/session/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/assistant/start/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/assistant/terminal/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/assistant/tools/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/auth/login/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/auth/logout/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/auth/status/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/daily-summary/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/daily-summary/status/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/external-apps/[id]/health/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/external-apps/[id]/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/external-apps/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/fs/browse/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/fs/recent-paths/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/hooks/claude-done/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/ollama/models/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/push/subscriptions/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/push/vapid/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/repositories/[id]/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/repositories/[id]/todos/[todoId]/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/repositories/[id]/todos/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/repositories/clone/[jobId]/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/repositories/clone/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/repositories/excluded/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/repositories/restore/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/repositories/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/repositories/scan/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/repositories/sync/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/repositories/validate-path/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/sidebar/group-order/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/skills/[id]/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/skills/installations/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/skills/operations/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/skills/reindex/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/skills/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/slash-commands/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/templates/[id]/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/templates/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/todos/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/auto-yes/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/capture/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/cli-tool/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/cmate/schedules/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/current-output/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/[logId]/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/files/[...path]/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/branch/create/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/branch/delete/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/branches/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/checkout/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/commit/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/diff/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/fetch/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/log/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/pull/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/push/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/reset/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/revert/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/show/[commitHash]/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stage/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/staged/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/[index]/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/apply/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/pop/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/push/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/status/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/unstage/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/working-diff/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/interrupt/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/kill-session/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/logs/[filename]/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/logs/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/marp-render/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/memos/[memoId]/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/memos/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/messages/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/respond/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/[scheduleId]/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/active/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/search/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/send/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/install/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/plan/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/slash-commands/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/special-keys/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/start-polling/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/terminal/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/timers/history/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/timers/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/todos/[todoId]/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/todos/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/tree/[...path]/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/tree/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/upload/[...path]/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/viewed/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/api/worktrees/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/manifest.webmanifest/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/proxy/[...path]/route-55e398bd20e2d7a9.js +0 -1
- package/.next/static/chunks/app/repositories/page-3c4fb889da48ce24.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/page-59a63a2c013ec1eb.js +0 -1
- /package/.next/static/{AKqbAyuzbFfg05qpbCI_K → -BSmW0Ae2YsxyCl_ue7_d}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Verification run database operations (Issue #1542, migration v49).
|
|
4
|
+
*
|
|
5
|
+
* Persists the outcome of a verification gate run: one `verification_runs` row
|
|
6
|
+
* per attempt, one `verification_gate_results` row per command inside it.
|
|
7
|
+
*
|
|
8
|
+
* Both create* functions open a record in `running` state and both finish*
|
|
9
|
+
* functions close it. That split is deliberate: a run that crashes mid-flight
|
|
10
|
+
* leaves a `running` row behind, which is recoverable evidence, whereas a
|
|
11
|
+
* single write-on-completion would leave nothing at all.
|
|
12
|
+
*
|
|
13
|
+
* The timestamps describe the *execution*, not the writes (Issue #1625): a
|
|
14
|
+
* caller that measured a gate closes the row with the window it measured, so
|
|
15
|
+
* `finished_at - started_at` equals `duration_ms` instead of the gap between
|
|
16
|
+
* two adjacent INSERT/UPDATE statements.
|
|
17
|
+
*
|
|
18
|
+
* The finish* functions throw when the target row does not exist. A silent
|
|
19
|
+
* no-op would let a caller believe it recorded a verdict it never recorded —
|
|
20
|
+
* exactly the failure this table exists to make impossible.
|
|
21
|
+
*/
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.MAX_RUN_HISTORY_DAYS = exports.MAX_RUN_HISTORY_LIMIT = exports.DEFAULT_RUN_HISTORY_LIMIT = exports.VERIFICATION_TRIGGERS = void 0;
|
|
24
|
+
exports.createVerificationRun = createVerificationRun;
|
|
25
|
+
exports.finishVerificationRun = finishVerificationRun;
|
|
26
|
+
exports.createGateResult = createGateResult;
|
|
27
|
+
exports.finishGateResult = finishGateResult;
|
|
28
|
+
exports.getVerificationRun = getVerificationRun;
|
|
29
|
+
exports.getRunningVerificationRun = getRunningVerificationRun;
|
|
30
|
+
exports.listRunningVerificationRuns = listRunningVerificationRuns;
|
|
31
|
+
exports.listVerificationRuns = listVerificationRuns;
|
|
32
|
+
exports.listVerificationRunsForPeriod = listVerificationRunsForPeriod;
|
|
33
|
+
/**
|
|
34
|
+
* What caused a verification run to start.
|
|
35
|
+
*
|
|
36
|
+
* The runtime tuple mirrors the `trigger` CHECK constraint in migration v49 and
|
|
37
|
+
* is the single source callers validate untrusted input against, so a new
|
|
38
|
+
* trigger cannot be accepted by an API route and then rejected by SQLite.
|
|
39
|
+
*/
|
|
40
|
+
exports.VERIFICATION_TRIGGERS = ['manual', 'wait', 'api', 'task'];
|
|
41
|
+
const RUN_COLUMNS = `
|
|
42
|
+
id, worktree_id, instance_id, task_id, trigger, status, base_ref, started_at, finished_at
|
|
43
|
+
`;
|
|
44
|
+
const GATE_COLUMNS = `
|
|
45
|
+
id, run_id, gate_id, command, status, exit_code, duration_ms, log_tail, started_at, finished_at
|
|
46
|
+
`;
|
|
47
|
+
function mapRunRow(row) {
|
|
48
|
+
return {
|
|
49
|
+
id: row.id,
|
|
50
|
+
worktreeId: row.worktree_id,
|
|
51
|
+
instanceId: row.instance_id,
|
|
52
|
+
taskId: row.task_id,
|
|
53
|
+
trigger: row.trigger,
|
|
54
|
+
status: row.status,
|
|
55
|
+
baseRef: row.base_ref,
|
|
56
|
+
startedAt: new Date(row.started_at),
|
|
57
|
+
finishedAt: row.finished_at === null ? null : new Date(row.finished_at),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function mapGateRow(row) {
|
|
61
|
+
return {
|
|
62
|
+
id: row.id,
|
|
63
|
+
runId: row.run_id,
|
|
64
|
+
gateId: row.gate_id,
|
|
65
|
+
command: row.command,
|
|
66
|
+
status: row.status,
|
|
67
|
+
exitCode: row.exit_code,
|
|
68
|
+
durationMs: row.duration_ms,
|
|
69
|
+
logTail: row.log_tail,
|
|
70
|
+
startedAt: new Date(row.started_at),
|
|
71
|
+
finishedAt: row.finished_at === null ? null : new Date(row.finished_at),
|
|
72
|
+
timingsMeasured: row.finished_at !== null &&
|
|
73
|
+
row.duration_ms !== null &&
|
|
74
|
+
row.finished_at - row.started_at === row.duration_ms,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/** Open a run in `running` state. */
|
|
78
|
+
function createVerificationRun(db, input) {
|
|
79
|
+
const now = Date.now();
|
|
80
|
+
const info = db
|
|
81
|
+
.prepare(`
|
|
82
|
+
INSERT INTO verification_runs (
|
|
83
|
+
worktree_id, instance_id, task_id, trigger, status, base_ref, started_at, finished_at
|
|
84
|
+
)
|
|
85
|
+
VALUES (?, ?, ?, ?, 'running', ?, ?, NULL)
|
|
86
|
+
`)
|
|
87
|
+
.run(input.worktreeId, input.instanceId ?? null, input.taskId ?? null, input.trigger, input.baseRef ?? null, now);
|
|
88
|
+
const row = db
|
|
89
|
+
.prepare(`SELECT ${RUN_COLUMNS} FROM verification_runs WHERE id = ?`)
|
|
90
|
+
.get(Number(info.lastInsertRowid));
|
|
91
|
+
if (!row) {
|
|
92
|
+
throw new Error('Failed to persist verification run');
|
|
93
|
+
}
|
|
94
|
+
return mapRunRow(row);
|
|
95
|
+
}
|
|
96
|
+
/** Close a run with its final verdict, stamping `finished_at`. */
|
|
97
|
+
function finishVerificationRun(db, runId, status) {
|
|
98
|
+
const info = db
|
|
99
|
+
.prepare('UPDATE verification_runs SET status = ?, finished_at = ? WHERE id = ?')
|
|
100
|
+
.run(status, Date.now(), runId);
|
|
101
|
+
if (info.changes === 0) {
|
|
102
|
+
throw new Error(`Verification run ${runId} not found`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/** Open a gate result under an existing run, in `running` state. */
|
|
106
|
+
function createGateResult(db, runId, input) {
|
|
107
|
+
const now = Date.now();
|
|
108
|
+
const info = db
|
|
109
|
+
.prepare(`
|
|
110
|
+
INSERT INTO verification_gate_results (
|
|
111
|
+
run_id, gate_id, command, status, exit_code, duration_ms, log_tail, started_at, finished_at
|
|
112
|
+
)
|
|
113
|
+
VALUES (?, ?, ?, 'running', NULL, NULL, NULL, ?, NULL)
|
|
114
|
+
`)
|
|
115
|
+
.run(runId, input.gateId, input.command, now);
|
|
116
|
+
const row = db
|
|
117
|
+
.prepare(`SELECT ${GATE_COLUMNS} FROM verification_gate_results WHERE id = ?`)
|
|
118
|
+
.get(Number(info.lastInsertRowid));
|
|
119
|
+
if (!row) {
|
|
120
|
+
throw new Error('Failed to persist verification gate result');
|
|
121
|
+
}
|
|
122
|
+
return mapGateRow(row);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Close a gate result with its outcome and the interval it occupied.
|
|
126
|
+
*
|
|
127
|
+
* `started_at` is rewritten only when the caller declares an
|
|
128
|
+
* {@link FinishGateResultPatch.executionWindow}: the value written when the row
|
|
129
|
+
* was opened is a placeholder for "this gate was entered", and the measured
|
|
130
|
+
* start is a few milliseconds later — after the insert this call is closing.
|
|
131
|
+
* Leaving the placeholder would put that gap inside the reported window.
|
|
132
|
+
*/
|
|
133
|
+
function finishGateResult(db, gateResultId, patch) {
|
|
134
|
+
const info = db
|
|
135
|
+
.prepare(`
|
|
136
|
+
UPDATE verification_gate_results
|
|
137
|
+
SET status = ?, exit_code = ?, duration_ms = ?, log_tail = ?,
|
|
138
|
+
started_at = COALESCE(?, started_at),
|
|
139
|
+
finished_at = ?
|
|
140
|
+
WHERE id = ?
|
|
141
|
+
`)
|
|
142
|
+
.run(patch.status, patch.exitCode ?? null, patch.durationMs ?? null, patch.logTail ?? null, patch.executionWindow?.startedAt ?? null, patch.executionWindow?.finishedAt ?? Date.now(), gateResultId);
|
|
143
|
+
if (info.changes === 0) {
|
|
144
|
+
throw new Error(`Verification gate result ${gateResultId} not found`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/** Fetch a run with its gate results, or null when the run does not exist. */
|
|
148
|
+
function getVerificationRun(db, runId) {
|
|
149
|
+
const runRow = db
|
|
150
|
+
.prepare(`SELECT ${RUN_COLUMNS} FROM verification_runs WHERE id = ?`)
|
|
151
|
+
.get(runId);
|
|
152
|
+
if (!runRow) {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
const gateRows = db
|
|
156
|
+
.prepare(`
|
|
157
|
+
SELECT ${GATE_COLUMNS} FROM verification_gate_results
|
|
158
|
+
WHERE run_id = ?
|
|
159
|
+
ORDER BY started_at ASC, id ASC
|
|
160
|
+
`)
|
|
161
|
+
.all(runId);
|
|
162
|
+
return { ...mapRunRow(runRow), gates: gateRows.map(mapGateRow) };
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* The open run for a worktree, or null when none is in flight.
|
|
166
|
+
*
|
|
167
|
+
* A worktree admits one run at a time: two runs sharing a working tree would
|
|
168
|
+
* see each other's build output and their exit codes would describe neither.
|
|
169
|
+
* `id DESC` is a safety net — the invariant says there is at most one row, and
|
|
170
|
+
* if a bug ever breaks it the newest is the one a caller means.
|
|
171
|
+
*/
|
|
172
|
+
function getRunningVerificationRun(db, worktreeId) {
|
|
173
|
+
const row = db
|
|
174
|
+
.prepare(`
|
|
175
|
+
SELECT ${RUN_COLUMNS} FROM verification_runs
|
|
176
|
+
WHERE worktree_id = ? AND status = 'running'
|
|
177
|
+
ORDER BY id DESC
|
|
178
|
+
LIMIT 1
|
|
179
|
+
`)
|
|
180
|
+
.get(worktreeId);
|
|
181
|
+
return row ? mapRunRow(row) : null;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Every run still marked `running`, across all worktrees, oldest first.
|
|
185
|
+
*
|
|
186
|
+
* Used by startup reconciliation: after a restart no run is actually in flight,
|
|
187
|
+
* so every row this returns is an orphan whose verdict was lost.
|
|
188
|
+
*/
|
|
189
|
+
function listRunningVerificationRuns(db) {
|
|
190
|
+
const rows = db
|
|
191
|
+
.prepare(`
|
|
192
|
+
SELECT ${RUN_COLUMNS} FROM verification_runs
|
|
193
|
+
WHERE status = 'running'
|
|
194
|
+
ORDER BY id ASC
|
|
195
|
+
`)
|
|
196
|
+
.all();
|
|
197
|
+
return rows.map(mapRunRow);
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Most recent runs for a worktree, newest first.
|
|
201
|
+
*
|
|
202
|
+
* `id DESC` breaks ties: runs started within the same millisecond are common
|
|
203
|
+
* enough that without it the "newest first" contract would be unordered.
|
|
204
|
+
*/
|
|
205
|
+
function listVerificationRuns(db, worktreeId, limit = 20) {
|
|
206
|
+
const rows = db
|
|
207
|
+
.prepare(`
|
|
208
|
+
SELECT ${RUN_COLUMNS} FROM verification_runs
|
|
209
|
+
WHERE worktree_id = ?
|
|
210
|
+
ORDER BY started_at DESC, id DESC
|
|
211
|
+
LIMIT ?
|
|
212
|
+
`)
|
|
213
|
+
.all(worktreeId, limit);
|
|
214
|
+
return rows.map(mapRunRow);
|
|
215
|
+
}
|
|
216
|
+
/** Default page size for {@link listVerificationRunsForPeriod}. */
|
|
217
|
+
exports.DEFAULT_RUN_HISTORY_LIMIT = 50;
|
|
218
|
+
/** Largest page {@link listVerificationRunsForPeriod} will return. */
|
|
219
|
+
exports.MAX_RUN_HISTORY_LIMIT = 500;
|
|
220
|
+
/** Longest window {@link listVerificationRunsForPeriod} will look back over. */
|
|
221
|
+
exports.MAX_RUN_HISTORY_DAYS = 90;
|
|
222
|
+
const MS_PER_DAY = 86_400_000;
|
|
223
|
+
/** Clamp to an integer inside [min, max]; non-finite input falls back to `fallback`. */
|
|
224
|
+
function clampInt(value, fallback, min, max) {
|
|
225
|
+
if (value === undefined || !Number.isFinite(value))
|
|
226
|
+
return fallback;
|
|
227
|
+
return Math.min(Math.max(Math.trunc(value), min), max);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Recent runs across worktrees, newest first, each with its gate verdicts but
|
|
231
|
+
* no log bodies (Issue #1593).
|
|
232
|
+
*
|
|
233
|
+
* `worktreeId` is optional because the advisor that consumes this (#1594) looks
|
|
234
|
+
* at a repository's trend, not one worktree's. Ordering follows the same
|
|
235
|
+
* `started_at DESC, id DESC` contract as {@link listVerificationRuns} so both
|
|
236
|
+
* feeds agree about what "newest" means.
|
|
237
|
+
*
|
|
238
|
+
* `days` and `limit` are clamped rather than rejected: this is a read-only feed
|
|
239
|
+
* and a caller asking for 10000 runs wants as many as it can have, not an
|
|
240
|
+
* exception. API routes validate before calling so a user typo still 400s.
|
|
241
|
+
*/
|
|
242
|
+
function listVerificationRunsForPeriod(db, opts = {}) {
|
|
243
|
+
const limit = clampInt(opts.limit, exports.DEFAULT_RUN_HISTORY_LIMIT, 1, exports.MAX_RUN_HISTORY_LIMIT);
|
|
244
|
+
const conditions = [];
|
|
245
|
+
const params = [];
|
|
246
|
+
if (opts.worktreeId !== undefined) {
|
|
247
|
+
conditions.push('worktree_id = ?');
|
|
248
|
+
params.push(opts.worktreeId);
|
|
249
|
+
}
|
|
250
|
+
if (opts.days !== undefined) {
|
|
251
|
+
const days = clampInt(opts.days, exports.MAX_RUN_HISTORY_DAYS, 1, exports.MAX_RUN_HISTORY_DAYS);
|
|
252
|
+
conditions.push('started_at >= ?');
|
|
253
|
+
params.push(Date.now() - days * MS_PER_DAY);
|
|
254
|
+
}
|
|
255
|
+
const where = conditions.length > 0 ? `WHERE ${conditions.join(' AND ')}` : '';
|
|
256
|
+
const runRows = db
|
|
257
|
+
.prepare(`
|
|
258
|
+
SELECT ${RUN_COLUMNS} FROM verification_runs
|
|
259
|
+
${where}
|
|
260
|
+
ORDER BY started_at DESC, id DESC
|
|
261
|
+
LIMIT ?
|
|
262
|
+
`)
|
|
263
|
+
.all(...params, limit);
|
|
264
|
+
if (runRows.length === 0)
|
|
265
|
+
return [];
|
|
266
|
+
const placeholders = runRows.map(() => '?').join(', ');
|
|
267
|
+
const gateRows = db
|
|
268
|
+
.prepare(`
|
|
269
|
+
SELECT run_id, gate_id, status, exit_code, duration_ms
|
|
270
|
+
FROM verification_gate_results
|
|
271
|
+
WHERE run_id IN (${placeholders})
|
|
272
|
+
ORDER BY started_at ASC, id ASC
|
|
273
|
+
`)
|
|
274
|
+
.all(...runRows.map((row) => row.id));
|
|
275
|
+
const byRun = new Map();
|
|
276
|
+
for (const row of gateRows) {
|
|
277
|
+
const summary = {
|
|
278
|
+
gateId: row.gate_id,
|
|
279
|
+
status: row.status,
|
|
280
|
+
exitCode: row.exit_code,
|
|
281
|
+
durationMs: row.duration_ms,
|
|
282
|
+
};
|
|
283
|
+
const bucket = byRun.get(row.run_id);
|
|
284
|
+
if (bucket)
|
|
285
|
+
bucket.push(summary);
|
|
286
|
+
else
|
|
287
|
+
byRun.set(row.run_id, [summary]);
|
|
288
|
+
}
|
|
289
|
+
return runRows.map((row) => ({ ...mapRunRow(row), gates: byRun.get(row.id) ?? [] }));
|
|
290
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Auto-Yes policy lookup — resolves the `autoYes` block of the execution
|
|
4
|
+
* contract governing one agent instance (Issue #1547).
|
|
5
|
+
*
|
|
6
|
+
* Server-only: reads the database. Kept out of auto-yes-state.ts so that module
|
|
7
|
+
* stays free of a database dependency, and out of auto-yes-resolver.ts because
|
|
8
|
+
* that one is bundled into the client.
|
|
9
|
+
*
|
|
10
|
+
* The result is cached per composite key with a short TTL. Without it, a prompt
|
|
11
|
+
* the policy suppresses would be re-read from SQLite on every poll for as long
|
|
12
|
+
* as it stays on screen: the poller's duplicate guard only remembers prompts it
|
|
13
|
+
* *answered*, so a suppressed prompt is re-evaluated every POLLING_INTERVAL_MS
|
|
14
|
+
* indefinitely. The TTL is what bounds staleness — a task that starts or ends is
|
|
15
|
+
* picked up within it, without this module having to observe task transitions.
|
|
16
|
+
*
|
|
17
|
+
* @module lib/polling/auto-yes-policy
|
|
18
|
+
*/
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.AUTO_YES_POLICY_CACHE_TTL_MS = void 0;
|
|
21
|
+
exports.getSessionAutoYesPolicy = getSessionAutoYesPolicy;
|
|
22
|
+
exports.invalidateSessionAutoYesPolicy = invalidateSessionAutoYesPolicy;
|
|
23
|
+
exports.clearAutoYesPolicyCache = clearAutoYesPolicyCache;
|
|
24
|
+
const db_1 = require("../../lib/db");
|
|
25
|
+
const db_instance_1 = require("../../lib/db/db-instance");
|
|
26
|
+
const auto_yes_state_1 = require("../../lib/auto-yes-state");
|
|
27
|
+
const logger_1 = require("../../lib/logger");
|
|
28
|
+
const logger = (0, logger_1.createLogger)('auto-yes-policy');
|
|
29
|
+
/** How long a resolved policy is reused before the task is looked up again. */
|
|
30
|
+
exports.AUTO_YES_POLICY_CACHE_TTL_MS = 5000;
|
|
31
|
+
/**
|
|
32
|
+
* Cache ceiling. Above it, expired entries are dropped on write, so a long-lived
|
|
33
|
+
* server cannot accumulate one entry per worktree ever polled.
|
|
34
|
+
*/
|
|
35
|
+
const MAX_CACHE_ENTRIES = 200;
|
|
36
|
+
/**
|
|
37
|
+
* Plain module-level Map rather than the globalThis pattern used for auto-yes
|
|
38
|
+
* *state*: losing a cache on hot reload costs one database read, while losing
|
|
39
|
+
* state would silently disable auto-yes.
|
|
40
|
+
*/
|
|
41
|
+
const policyCache = new Map();
|
|
42
|
+
function purgeExpired(now) {
|
|
43
|
+
for (const [key, entry] of policyCache.entries()) {
|
|
44
|
+
if (entry.expiresAt <= now) {
|
|
45
|
+
policyCache.delete(key);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Read the policy from the active task, or null when no contract governs this
|
|
51
|
+
* instance.
|
|
52
|
+
*
|
|
53
|
+
* A database failure yields null — the unconstrained behaviour. Failing closed
|
|
54
|
+
* here would suppress auto-yes for every user who has no contract at all, which
|
|
55
|
+
* is the population this feature must not touch; the suppressing decisions
|
|
56
|
+
* (`off`, deny patterns) are made inside the resolver only once a contract has
|
|
57
|
+
* actually been read.
|
|
58
|
+
*/
|
|
59
|
+
function readPolicy(worktreeId, cliToolId, instanceId) {
|
|
60
|
+
try {
|
|
61
|
+
const task = (0, db_1.getActiveTaskForInstance)((0, db_instance_1.getDbInstance)(), worktreeId, cliToolId, instanceId);
|
|
62
|
+
if (!task)
|
|
63
|
+
return null;
|
|
64
|
+
// Assignment, not a cast: a drift in TaskContractAutoYes fails the build here.
|
|
65
|
+
const policy = task.contract.autoYes;
|
|
66
|
+
return policy;
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
logger.warn('policy-lookup-failed', {
|
|
70
|
+
worktreeId,
|
|
71
|
+
cliToolId,
|
|
72
|
+
instanceId,
|
|
73
|
+
error: error instanceof Error ? error.message : String(error),
|
|
74
|
+
});
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The auto-answer policy for an agent instance, cached for
|
|
80
|
+
* {@link AUTO_YES_POLICY_CACHE_TTL_MS}.
|
|
81
|
+
*
|
|
82
|
+
* @param worktreeId - Worktree identifier
|
|
83
|
+
* @param cliToolId - CLI tool being polled
|
|
84
|
+
* @param instanceId - Agent instance id (defaults to the primary, i.e. cliToolId)
|
|
85
|
+
* @returns The contract's autoYes block, or null when no contract governs this instance
|
|
86
|
+
*/
|
|
87
|
+
function getSessionAutoYesPolicy(worktreeId, cliToolId, instanceId) {
|
|
88
|
+
const resolvedInstanceId = instanceId ?? cliToolId;
|
|
89
|
+
const key = (0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, resolvedInstanceId);
|
|
90
|
+
const now = Date.now();
|
|
91
|
+
const cached = policyCache.get(key);
|
|
92
|
+
if (cached && cached.expiresAt > now) {
|
|
93
|
+
return cached.policy;
|
|
94
|
+
}
|
|
95
|
+
const policy = readPolicy(worktreeId, cliToolId, resolvedInstanceId);
|
|
96
|
+
if (policyCache.size >= MAX_CACHE_ENTRIES) {
|
|
97
|
+
purgeExpired(now);
|
|
98
|
+
}
|
|
99
|
+
policyCache.set(key, { policy, expiresAt: now + exports.AUTO_YES_POLICY_CACHE_TTL_MS });
|
|
100
|
+
return policy;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Drop the cached policy for a composite key, so the next lookup re-reads the
|
|
104
|
+
* task. Called when a poller starts or stops.
|
|
105
|
+
*
|
|
106
|
+
* @param compositeKey - Composite key (worktreeId:cliToolId[:instanceId])
|
|
107
|
+
*/
|
|
108
|
+
function invalidateSessionAutoYesPolicy(compositeKey) {
|
|
109
|
+
policyCache.delete(compositeKey);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Clear the whole cache.
|
|
113
|
+
* @internal Exported for testing and worktree teardown.
|
|
114
|
+
*/
|
|
115
|
+
function clearAutoYesPolicyCache() {
|
|
116
|
+
policyCache.clear();
|
|
117
|
+
}
|
|
@@ -2,20 +2,44 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Auto Yes Resolver - Determines automatic answer for prompt data
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* Base rules (unchanged since Issue #479):
|
|
6
6
|
* - yes/no prompt -> 'y'
|
|
7
7
|
* - multiple_choice with default option -> default option number
|
|
8
8
|
* - multiple_choice without default -> first option number
|
|
9
9
|
* - option requiring text input -> null (skip)
|
|
10
10
|
* - unknown type -> null (skip)
|
|
11
|
+
*
|
|
12
|
+
* Issue #1547: an optional {@link AutoYesPolicy} — the `autoYes` block of an
|
|
13
|
+
* execution contract — can withhold an answer the base rules would have sent.
|
|
14
|
+
* The policy can only ever suppress: it never turns a null into an answer, and
|
|
15
|
+
* omitting it (or passing one that states nothing) reproduces the pre-#1547
|
|
16
|
+
* behaviour exactly, which is what keeps contract-less operation untouched.
|
|
17
|
+
*
|
|
18
|
+
* Client-safe: no server-only imports, because a 'use client' hook
|
|
19
|
+
* (`hooks/useAutoYes.ts`) imports this module.
|
|
11
20
|
*/
|
|
12
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.MAX_DENY_MATCH_TEXT_LENGTH = exports.MAX_DENY_PATTERN_LENGTH = void 0;
|
|
23
|
+
exports.resolveAutoAnswerWithPolicy = resolveAutoAnswerWithPolicy;
|
|
13
24
|
exports.resolveAutoAnswer = resolveAutoAnswer;
|
|
25
|
+
const auto_yes_config_1 = require("../../config/auto-yes-config");
|
|
14
26
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
27
|
+
* Upper bound on a deny pattern, mirroring MAX_PATTERN_LENGTH in
|
|
28
|
+
* lib/tasks/contract-parser (asserted equal by the unit tests). Contracts are
|
|
29
|
+
* validated on load, so this is defence in depth for a contract snapshot that
|
|
30
|
+
* reached the database some other way.
|
|
31
|
+
*/
|
|
32
|
+
exports.MAX_DENY_PATTERN_LENGTH = 200;
|
|
33
|
+
/**
|
|
34
|
+
* Upper bound on the text a deny pattern is matched against, per field.
|
|
35
|
+
*
|
|
36
|
+
* A prompt question or option label is a few hundred characters; the bound only
|
|
37
|
+
* exists so a pathological pane cannot make every poll scan megabytes with 32
|
|
38
|
+
* patterns. Matching is over the head of the field, deterministically.
|
|
17
39
|
*/
|
|
18
|
-
|
|
40
|
+
exports.MAX_DENY_MATCH_TEXT_LENGTH = 20_000;
|
|
41
|
+
/** The pre-policy resolution: the rules as they were before Issue #1547. */
|
|
42
|
+
function resolveBaseAnswer(promptData) {
|
|
19
43
|
if (promptData.type === 'yes_no') {
|
|
20
44
|
return 'y';
|
|
21
45
|
}
|
|
@@ -32,3 +56,119 @@ function resolveAutoAnswer(promptData) {
|
|
|
32
56
|
}
|
|
33
57
|
return null;
|
|
34
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Every piece of prompt text a deny pattern is matched against.
|
|
61
|
+
*
|
|
62
|
+
* `instructionText` is included because that is where the dangerous part
|
|
63
|
+
* usually is — Claude's permission prompts put the command being approved in the
|
|
64
|
+
* lines above the question, not in the question itself.
|
|
65
|
+
*/
|
|
66
|
+
function collectDenyMatchTexts(promptData) {
|
|
67
|
+
const texts = [promptData.question];
|
|
68
|
+
if (promptData.instructionText) {
|
|
69
|
+
texts.push(promptData.instructionText);
|
|
70
|
+
}
|
|
71
|
+
if (promptData.type === 'multiple_choice') {
|
|
72
|
+
for (const option of promptData.options) {
|
|
73
|
+
texts.push(option.label);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
texts.push(...promptData.options);
|
|
78
|
+
}
|
|
79
|
+
return texts.map(text => text.length > exports.MAX_DENY_MATCH_TEXT_LENGTH ? text.slice(0, exports.MAX_DENY_MATCH_TEXT_LENGTH) : text);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Test the prompt against every deny pattern.
|
|
83
|
+
*
|
|
84
|
+
* Patterns are screened by {@link validateStopPattern} (length, safe-regex2
|
|
85
|
+
* catastrophic-backtracking detection, syntax) before execution, which is the
|
|
86
|
+
* same ReDoS defence the stop-pattern path uses. A pattern that fails screening
|
|
87
|
+
* — or whose execution throws — is reported as `unusable`, not skipped.
|
|
88
|
+
*/
|
|
89
|
+
function evaluateDenyPatterns(promptData, patterns) {
|
|
90
|
+
if (patterns.length === 0) {
|
|
91
|
+
return { outcome: 'no-match' };
|
|
92
|
+
}
|
|
93
|
+
const texts = collectDenyMatchTexts(promptData);
|
|
94
|
+
for (const pattern of patterns) {
|
|
95
|
+
if (pattern.length > exports.MAX_DENY_PATTERN_LENGTH || !(0, auto_yes_config_1.validateStopPattern)(pattern).valid) {
|
|
96
|
+
return { outcome: 'unusable', pattern };
|
|
97
|
+
}
|
|
98
|
+
const regex = new RegExp(pattern);
|
|
99
|
+
for (const text of texts) {
|
|
100
|
+
const matched = (0, auto_yes_config_1.executeRegexWithTimeout)(regex, text);
|
|
101
|
+
if (matched === null) {
|
|
102
|
+
return { outcome: 'unusable', pattern };
|
|
103
|
+
}
|
|
104
|
+
if (matched) {
|
|
105
|
+
return { outcome: 'match', pattern };
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return { outcome: 'no-match' };
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Decide whether the policy forbids answering this prompt.
|
|
113
|
+
*
|
|
114
|
+
* Deny patterns are honoured even when `mode` is null: a contract that lists
|
|
115
|
+
* them has stated a policy, and a listed pattern that quietly did nothing is the
|
|
116
|
+
* worst failure a contract can have. `mode` null with no deny patterns — what
|
|
117
|
+
* the parser produces for a contract with no `autoYes` block — reaches none of
|
|
118
|
+
* these branches and leaves behaviour identical.
|
|
119
|
+
*/
|
|
120
|
+
function evaluatePolicy(promptData, policy) {
|
|
121
|
+
if (!policy)
|
|
122
|
+
return null;
|
|
123
|
+
if (policy.mode === 'off') {
|
|
124
|
+
return { reason: 'mode-off' };
|
|
125
|
+
}
|
|
126
|
+
const deny = evaluateDenyPatterns(promptData, policy.denyPatterns);
|
|
127
|
+
if (deny.outcome === 'match') {
|
|
128
|
+
return { reason: 'deny-pattern', pattern: deny.pattern };
|
|
129
|
+
}
|
|
130
|
+
if (deny.outcome === 'unusable') {
|
|
131
|
+
return { reason: 'deny-pattern-unusable', pattern: deny.pattern };
|
|
132
|
+
}
|
|
133
|
+
if (policy.mode === 'safe') {
|
|
134
|
+
return promptData.type === 'yes_no' ? null : { reason: 'type-not-allowed' };
|
|
135
|
+
}
|
|
136
|
+
if (policy.mode === 'allow-listed') {
|
|
137
|
+
return policy.allowPromptTypes.includes(promptData.type)
|
|
138
|
+
? null
|
|
139
|
+
: { reason: 'type-not-allowed' };
|
|
140
|
+
}
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Resolve the automatic answer, reporting whether a policy withheld it.
|
|
145
|
+
*
|
|
146
|
+
* `suppressedBy` is set only when an answer was actually withheld, so the
|
|
147
|
+
* escalation log records real suppressions and not prompts the base rules were
|
|
148
|
+
* never going to answer anyway (an empty option list, an option that needs
|
|
149
|
+
* typing). Those still resolve to null, with `suppressedBy` null.
|
|
150
|
+
*
|
|
151
|
+
* @param promptData - Detected prompt
|
|
152
|
+
* @param policy - Contract auto-answer policy; omit for the unconstrained behaviour
|
|
153
|
+
*/
|
|
154
|
+
function resolveAutoAnswerWithPolicy(promptData, policy) {
|
|
155
|
+
const answer = resolveBaseAnswer(promptData);
|
|
156
|
+
if (answer === null) {
|
|
157
|
+
return { answer: null, suppressedBy: null };
|
|
158
|
+
}
|
|
159
|
+
const denial = evaluatePolicy(promptData, policy);
|
|
160
|
+
if (denial) {
|
|
161
|
+
return { answer: null, suppressedBy: denial.reason, pattern: denial.pattern };
|
|
162
|
+
}
|
|
163
|
+
return { answer, suppressedBy: null };
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Resolve the automatic answer for a given prompt.
|
|
167
|
+
*
|
|
168
|
+
* @param promptData - Detected prompt
|
|
169
|
+
* @param policy - Contract auto-answer policy; omit for the unconstrained behaviour
|
|
170
|
+
* @returns The answer string to send, or null if auto-answer is not possible
|
|
171
|
+
*/
|
|
172
|
+
function resolveAutoAnswer(promptData, policy) {
|
|
173
|
+
return resolveAutoAnswerWithPolicy(promptData, policy).answer;
|
|
174
|
+
}
|
|
@@ -27,6 +27,7 @@ const prompt_dedup_1 = require("./prompt-dedup");
|
|
|
27
27
|
const response_dedup_1 = require("./response-dedup");
|
|
28
28
|
const response_poller_core_1 = require("./response-poller-core");
|
|
29
29
|
const push_1 = require("../../lib/push");
|
|
30
|
+
const task_transition_service_1 = require("../../lib/tasks/task-transition-service");
|
|
30
31
|
/**
|
|
31
32
|
* Creates an incomplete extraction result with empty response.
|
|
32
33
|
* Centralizes the repeated pattern of returning an in-progress/incomplete state.
|
|
@@ -420,6 +421,13 @@ async function checkForResponse(worktreeId, cliToolId, instanceId) {
|
|
|
420
421
|
});
|
|
421
422
|
(0, db_1.updateSessionState)(db, worktreeId, cliToolId, result.lineCount, resolvedInstanceId);
|
|
422
423
|
(0, ws_server_1.broadcastMessage)('message', { worktreeId, message });
|
|
424
|
+
// Issue #1548: the agent is blocked on input. Raised after the dedup and
|
|
425
|
+
// save above, so the task log counts prompts the system actually recorded
|
|
426
|
+
// rather than every poll that saw the same one still on screen. No-ops
|
|
427
|
+
// when this instance is not running a contract.
|
|
428
|
+
(0, task_transition_service_1.applyEventToActiveTask)(db, worktreeId, cliToolId, resolvedInstanceId, 'prompt_detected', {
|
|
429
|
+
promptType: promptDetection.promptData?.type,
|
|
430
|
+
});
|
|
423
431
|
// Web Push fan-out (Issue #1125): agent is now waiting for a prompt reply.
|
|
424
432
|
// Fire-and-forget — push is advisory and must never block/break the poller.
|
|
425
433
|
void (0, push_1.notifyPushSubscribers)({
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* In-memory record of the last structured "the agent stopped" event (#1549).
|
|
4
|
+
*
|
|
5
|
+
* The agent CLI telling us it stopped is a different kind of fact from the
|
|
6
|
+
* screen-scraped status: it is exact, but it only exists when someone wired a
|
|
7
|
+
* hook up. So this is kept beside the detector's output rather than folded into
|
|
8
|
+
* it — `buildCurrentOutput` exposes the timestamp, and nothing in the completion
|
|
9
|
+
* decision reads it yet. Phase 3-2 is deliberately observation only; swapping
|
|
10
|
+
* the wait/poller verdict from string matching to hook events before there is
|
|
11
|
+
* field data on how often hooks actually fire would trade a known failure mode
|
|
12
|
+
* for an unknown one.
|
|
13
|
+
*
|
|
14
|
+
* In-memory and not in SQLite for the same reason `auto-yes-state` is: the value
|
|
15
|
+
* describes a live tmux session, and a session does not survive a server restart
|
|
16
|
+
* for the timestamp to still be about.
|
|
17
|
+
*
|
|
18
|
+
* @module lib/session/agent-event-state
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.recordAgentStopEvent = recordAgentStopEvent;
|
|
22
|
+
exports.getLastStopEventAt = getLastStopEventAt;
|
|
23
|
+
exports.clearAgentStopEvents = clearAgentStopEvents;
|
|
24
|
+
const auto_yes_state_1 = require("../../lib/auto-yes-state");
|
|
25
|
+
/** compositeKey -> epoch ms of the most recent stop event. */
|
|
26
|
+
const lastStopEventAt = new Map();
|
|
27
|
+
/**
|
|
28
|
+
* Record that `instanceId` reported it stopped.
|
|
29
|
+
*
|
|
30
|
+
* @param at - Epoch ms; defaults to now. Passed explicitly by callers that need
|
|
31
|
+
* the stored value and their own record of the event to agree exactly.
|
|
32
|
+
*/
|
|
33
|
+
function recordAgentStopEvent(worktreeId, cliToolId, instanceId, at = Date.now()) {
|
|
34
|
+
lastStopEventAt.set((0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId), at);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @returns Epoch ms of the last stop event, or null when none has been received
|
|
38
|
+
* — which is the ordinary case for a session whose agent has no hook set up.
|
|
39
|
+
*/
|
|
40
|
+
function getLastStopEventAt(worktreeId, cliToolId, instanceId) {
|
|
41
|
+
return lastStopEventAt.get((0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId)) ?? null;
|
|
42
|
+
}
|
|
43
|
+
/** Drop every recorded event. Test seam. */
|
|
44
|
+
function clearAgentStopEvents() {
|
|
45
|
+
lastStopEventAt.clear();
|
|
46
|
+
}
|
|
@@ -15,6 +15,7 @@ const cli_session_1 = require("../../lib/session/cli-session");
|
|
|
15
15
|
const status_detector_1 = require("../../lib/detection/status-detector");
|
|
16
16
|
const auto_yes_manager_1 = require("../../lib/polling/auto-yes-manager");
|
|
17
17
|
const status_capture_config_1 = require("../../config/status-capture-config");
|
|
18
|
+
const agent_event_state_1 = require("../../lib/session/agent-event-state");
|
|
18
19
|
/**
|
|
19
20
|
* Build the current-output payload for a worktree session.
|
|
20
21
|
*
|
|
@@ -27,6 +28,7 @@ async function buildCurrentOutput(db, worktreeId, cliToolId, instanceId) {
|
|
|
27
28
|
const resolvedInstanceId = instanceId ?? cliToolId;
|
|
28
29
|
const manager = manager_1.CLIToolManager.getInstance();
|
|
29
30
|
const cliTool = manager.getTool(cliToolId);
|
|
31
|
+
const stopEventAt = (0, agent_event_state_1.getLastStopEventAt)(worktreeId, cliToolId, instanceId);
|
|
30
32
|
const running = await cliTool.isRunning(worktreeId, instanceId);
|
|
31
33
|
if (!running) {
|
|
32
34
|
return {
|
|
@@ -36,6 +38,7 @@ async function buildCurrentOutput(db, worktreeId, cliToolId, instanceId) {
|
|
|
36
38
|
cliToolId,
|
|
37
39
|
sessionStatus: 'idle',
|
|
38
40
|
sessionStatusReason: 'session_not_running',
|
|
41
|
+
lastStopEventAt: stopEventAt,
|
|
39
42
|
};
|
|
40
43
|
}
|
|
41
44
|
const sessionState = (0, db_1.getSessionState)(db, worktreeId, resolvedInstanceId);
|
|
@@ -91,5 +94,6 @@ async function buildCurrentOutput(db, worktreeId, cliToolId, instanceId) {
|
|
|
91
94
|
isUnclassifiedActive,
|
|
92
95
|
lastServerResponseTimestamp,
|
|
93
96
|
serverPollerActive: (0, auto_yes_manager_1.isPollerActive)(compositeKey),
|
|
97
|
+
lastStopEventAt: stopEventAt,
|
|
94
98
|
};
|
|
95
99
|
}
|