commandmate 0.44.3 → 0.45.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 +293 -292
- package/.next/app-path-routes-manifest.json +21 -21
- package/.next/build-manifest.json +5 -5
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +9 -9
- package/.next/react-loadable-manifest.json +29 -29
- package/.next/required-server-files.json +1 -1
- 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/release-notes/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_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_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 +2 -2
- 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_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_client-reference-manifest.js +1 -1
- package/.next/server/app/api/relays/[relayId]/cancel/route.js +1 -1
- package/.next/server/app/api/relays/[relayId]/cancel/route.js.nft.json +1 -1
- package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/relays/route.js +1 -1
- package/.next/server/app/api/relays/route.js.nft.json +1 -1
- package/.next/server/app/api/relays/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/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_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_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/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_client-reference-manifest.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_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]/direct-input/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/direct-input/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/direct-input/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.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.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/notes/route_client-reference-manifest.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.js +3 -3
- 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_client-reference-manifest.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_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 +2 -2
- 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_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/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_client-reference-manifest.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.js.nft.json +1 -1
- package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/[skillId]/page.js +2 -2
- package/.next/server/app/skills/[skillId]/page.js.nft.json +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.js +1 -1
- package/.next/server/app/worktrees/[id]/files/[...path]/page.js.nft.json +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 +5 -5
- 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_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +21 -21
- package/.next/server/chunks/1503.js +2 -2
- package/.next/server/chunks/1559.js +2 -2
- package/.next/server/chunks/1944.js +1 -1
- package/.next/server/chunks/2119.js +1 -1
- package/.next/server/chunks/22.js +1 -1
- package/.next/server/chunks/2335.js +1 -0
- package/.next/server/chunks/2404.js +1 -1
- package/.next/server/chunks/2445.js +1 -1
- package/.next/server/chunks/2460.js +1 -1
- package/.next/server/chunks/2710.js +2 -2
- package/.next/server/chunks/2908.js +1 -1
- package/.next/server/chunks/3241.js +1 -1
- package/.next/server/chunks/4243.js +1 -0
- package/.next/server/chunks/4837.js +3 -3
- package/.next/server/chunks/5048.js +1 -1
- package/.next/server/chunks/5064.js +1 -1
- package/.next/server/chunks/5209.js +1 -1
- package/.next/server/chunks/5292.js +7 -0
- package/.next/server/chunks/5625.js +3 -3
- package/.next/server/chunks/5737.js +1 -1
- package/.next/server/chunks/6065.js +1 -1
- package/.next/server/chunks/6130.js +1 -1
- package/.next/server/chunks/6401.js +1 -1
- package/.next/server/chunks/6927.js +1 -1
- package/.next/server/chunks/850.js +1 -1
- package/.next/server/chunks/8728.js +2 -2
- package/.next/server/chunks/8918.js +4 -6
- package/.next/server/chunks/9051.js +1 -1
- package/.next/server/chunks/9130.js +1 -1
- package/.next/server/chunks/9355.js +1 -0
- package/.next/server/chunks/9390.js +1 -1
- package/.next/server/chunks/9584.js +1 -1
- package/.next/server/chunks/9731.js +1 -1
- package/.next/server/chunks/9862.js +1 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{7485.442b21101fca7257.js → 1111.5ab4f0ffb0d944e5.js} +4 -4
- package/.next/static/chunks/1464.09cd37fee202ec4b.js +1 -0
- package/.next/static/chunks/{1642-767aed8e7c61ef7f.js → 1642-0f1bf8fb8161e10a.js} +1 -1
- package/.next/static/chunks/{2407-06d35bb1aa02de80.js → 2407-86890b00eeecf391.js} +1 -1
- package/.next/static/chunks/{2751-9ef0f4b450bd4ef0.js → 2751-5f0b2702accd164d.js} +1 -1
- package/.next/static/chunks/{282.6b6f2e31a96674dd.js → 282.a1013532fd9a61b4.js} +1 -1
- package/.next/static/chunks/3237.94c29281d9ec122e.js +1 -0
- package/.next/static/chunks/3480.2e21f62e5e9d3ba5.js +1 -0
- package/.next/static/chunks/3662-5a27ee39a3ecba49.js +1 -0
- package/.next/static/chunks/3922.0bc2e4e168d2b522.js +1 -0
- package/.next/static/chunks/4290.c06dbe243819fea0.js +66 -0
- package/.next/static/chunks/4541-b0ce0bf829ae79b7.js +1 -0
- package/.next/static/chunks/4727-4c69d1aa4118cc09.js +1 -0
- package/.next/static/chunks/{5222.305dc0ebba9c0784.js → 5222.39e2034d3fce233c.js} +1 -1
- package/.next/static/chunks/5371-af1c2b68e983da61.js +1 -0
- package/.next/static/chunks/6288-09feba367cc2c65e.js +1 -0
- package/.next/static/chunks/{7095.8c869e553133a40e.js → 7095.87323a4fdf426341.js} +1 -1
- package/.next/static/chunks/953.31c52a251deda22d.js +1 -0
- package/.next/static/chunks/app/{layout-0d1750b833f5cc3e.js → layout-eaa6365f8f942e88.js} +1 -1
- package/.next/static/chunks/app/sessions/{page-2af68c63211c751f.js → page-ebfed2c80e916fb8.js} +1 -1
- package/.next/static/chunks/app/skills/[skillId]/page-e4b14031f946c007.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/files/[...path]/page-9cf1ecc59e36a004.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/page-3372b78fde232b1f.js +1 -0
- package/.next/static/chunks/{webpack-021f0741f22dd16a.js → webpack-ee3ccbe378c4aa06.js} +1 -1
- package/.next/static/css/{057f64a65726c439.css → 6faeb04a0b6819d4.css} +1 -1
- package/.next/trace +13 -13
- package/dist/cli/commands/skill-format.d.ts +8 -0
- package/dist/cli/commands/skill-format.d.ts.map +1 -1
- package/dist/cli/commands/skill-format.js +13 -3
- package/dist/cli/commands/wait.d.ts.map +1 -1
- package/dist/cli/commands/wait.js +71 -3
- package/dist/cli/types/api-responses.d.ts +7 -10
- package/dist/cli/types/api-responses.d.ts.map +1 -1
- package/dist/cli/utils/verify-runner.d.ts +21 -0
- package/dist/cli/utils/verify-runner.d.ts.map +1 -1
- package/dist/cli/utils/verify-runner.js +38 -1
- package/dist/server/locales/en/worktree.json +7 -2
- package/dist/server/locales/ja/worktree.json +7 -2
- package/dist/server/src/lib/auto-yes-poller.js +16 -163
- package/dist/server/src/lib/detection/model-info-extractor.js +57 -3
- package/dist/server/src/lib/detection/status-detector.js +1 -1
- package/dist/server/src/lib/git/git-exec.js +23 -5
- package/dist/server/src/lib/hooks/sources/claude/self-resume.js +213 -0
- package/dist/server/src/lib/hooks/sources/claude/source.js +24 -7
- package/dist/server/src/lib/polling/auto-yes-enter-fallback-state.js +1 -1
- package/dist/server/src/lib/polling/auto-yes-poller-state.js +52 -0
- package/dist/server/src/lib/polling/auto-yes-prompt-suppression.js +125 -0
- package/dist/server/src/lib/polling/prompt-dedup.js +93 -2
- package/dist/server/src/lib/polling/response-checker.js +40 -2
- package/dist/server/src/lib/polling/response-dedup.js +62 -1
- package/dist/server/src/lib/session/agent-event-dedup.js +2 -2
- package/dist/server/src/lib/session/agent-event-state.js +2 -1
- package/dist/server/src/lib/session/agent-event-turn.js +51 -0
- package/dist/server/src/lib/session/current-output-builder.js +0 -5
- package/dist/server/src/lib/skills/install-plan.js +1 -0
- package/dist/server/src/lib/skills/preview-diff.js +24 -3
- package/dist/server/src/lib/skills/uninstall-plan.js +1 -0
- package/dist/server/src/lib/verification/env-clean-gate.js +6 -5
- package/docs/en/user-guide/commands-guide.md +0 -1
- package/package.json +3 -2
- package/release-notes/0.45.0.json +41 -0
- package/release-notes/0.45.1.json +38 -0
- package/scripts/hooks/cmate-agent-event.sh +20 -0
- package/.next/server/chunks/364.js +0 -1
- package/.next/server/chunks/4672.js +0 -5
- package/.next/server/chunks/4802.js +0 -1
- package/.next/server/chunks/488.js +0 -1
- package/.next/server/chunks/5326.js +0 -1
- package/.next/static/chunks/2053-85a974ddfe7498fe.js +0 -1
- package/.next/static/chunks/3922.f45dcfc1e7da552a.js +0 -1
- package/.next/static/chunks/4290.6cf86f68d73b6e77.js +0 -82
- package/.next/static/chunks/4459.a94b52985a76509a.js +0 -1
- package/.next/static/chunks/4727-5d695d71e3fdf97b.js +0 -1
- package/.next/static/chunks/5951.616956b6aa5df63f.js +0 -1
- package/.next/static/chunks/8283-26ad31a4670ea52d.js +0 -1
- package/.next/static/chunks/8566-aeda747542072ace.js +0 -1
- package/.next/static/chunks/8811-29eaa24237f48558.js +0 -1
- package/.next/static/chunks/953.19e4c8178c9eac4c.js +0 -1
- package/.next/static/chunks/9856.15463dd58437e2ac.js +0 -1
- package/.next/static/chunks/app/skills/[skillId]/page-9ee7a381636e60cb.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/files/[...path]/page-5445205c8dd80109.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/page-e36898c3a80e7302.js +0 -1
- /package/.next/static/{tWwHQzmvc-rv9KKUtDWfQ → vYIpFRCU_Mt0wtG8F_3-6}/_buildManifest.js +0 -0
- /package/.next/static/{tWwHQzmvc-rv9KKUtDWfQ → vYIpFRCU_Mt0wtG8F_3-6}/_ssgManifest.js +0 -0
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Issue #525: Composite key migration (worktreeId:cliToolId) for per-agent auto-yes.
|
|
9
9
|
*
|
|
10
|
-
* Dependencies: auto-yes-state.ts (
|
|
11
|
-
*
|
|
10
|
+
* Dependencies: auto-yes-state.ts (composite keys / state), polling/* (prompt
|
|
11
|
+
* detection, resolver, policy, dialog gate, enter fallback, poller state),
|
|
12
|
+
* cli-tools/*, session/cli-session.ts, tmux/*, detection/*, db/*, tasks/*.
|
|
12
13
|
*/
|
|
13
14
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
15
|
if (k2 === undefined) k2 = k;
|
|
@@ -67,7 +68,6 @@ const auto_yes_resolver_1 = require("./polling/auto-yes-resolver");
|
|
|
67
68
|
const auto_yes_policy_1 = require("./polling/auto-yes-policy");
|
|
68
69
|
const detect_1 = require("./detection/tools/codex/detect");
|
|
69
70
|
const frame_1 = require("./detection/tools/frame");
|
|
70
|
-
const auto_yes_suppression_state_1 = require("./polling/auto-yes-suppression-state");
|
|
71
71
|
const auto_yes_dialog_gate_1 = require("./polling/auto-yes-dialog-gate");
|
|
72
72
|
const auto_yes_enter_fallback_1 = require("./polling/auto-yes-enter-fallback");
|
|
73
73
|
const task_transition_service_1 = require("./tasks/task-transition-service");
|
|
@@ -88,6 +88,8 @@ const logger = (0, logger_1.createLogger)('auto-yes-poller');
|
|
|
88
88
|
const path_validator_1 = require("./security/path-validator");
|
|
89
89
|
const auto_yes_state_1 = require("./auto-yes-state");
|
|
90
90
|
const global_state_1 = require("./global-state");
|
|
91
|
+
const auto_yes_poller_state_1 = require("./polling/auto-yes-poller-state");
|
|
92
|
+
const auto_yes_prompt_suppression_1 = require("./polling/auto-yes-prompt-suppression");
|
|
91
93
|
/** In-memory storage for poller states (globalThis for hot reload persistence) */
|
|
92
94
|
const autoYesPollerStates = (0, global_state_1.getOrInitGlobal)('__autoYesPollerStates', () => new Map());
|
|
93
95
|
/**
|
|
@@ -221,45 +223,6 @@ function isDuplicatePrompt(pollerState, promptKey) {
|
|
|
221
223
|
return false;
|
|
222
224
|
return (Date.now() - pollerState.lastAnsweredAt) < auto_yes_state_1.DUPLICATE_RETRY_EXPIRY_MS;
|
|
223
225
|
}
|
|
224
|
-
/**
|
|
225
|
-
* Issue #2995: print a "did not answer" line as WARN once per frame.
|
|
226
|
-
*
|
|
227
|
-
* The poller re-reads a static pane every 2s, so a frame Auto-Yes leaves alone
|
|
228
|
-
* (a reply quoting `1. Yes / 2. No`, a launch dialog, a policy-withheld prompt,
|
|
229
|
-
* a foreign session) would otherwise print the same WARN on every tick. The
|
|
230
|
-
* first one stays WARN -- it is what tells a silently stalled worker apart --
|
|
231
|
-
* and repeats for the same frame drop to `debug`. The frame is identified by
|
|
232
|
-
* the event, `promptFrameKey()` and the event's own detail; a different
|
|
233
|
-
* prompt, a different reason, or a tick with no prompt / an answer sent (both
|
|
234
|
-
* clear the key) makes the next line WARN again.
|
|
235
|
-
* `recordPolicySuppression()` is not throttled: `capture --json` and `wait`
|
|
236
|
-
* read the latest record, not the log.
|
|
237
|
-
*/
|
|
238
|
-
/**
|
|
239
|
-
* Issue #2995: what makes two ticks "the same prompt" for `warnOncePerFrame`.
|
|
240
|
-
*
|
|
241
|
-
* `generatePromptKey` alone is type + question, and the question the detector
|
|
242
|
-
* extracts from an agent's reply is often a fixed line above the list, so two
|
|
243
|
-
* different lists would share it. The option rows (and where the cursor sits)
|
|
244
|
-
* plus `approvalTarget` -- the current prompt's own panel, which leaves out
|
|
245
|
-
* scrollback and footers that change while the prompt does not -- separate them.
|
|
246
|
-
* Not the whole pane: a status bar that ticks every second would defeat it.
|
|
247
|
-
*/
|
|
248
|
-
function promptFrameKey(promptData) {
|
|
249
|
-
const options = promptData.type === 'multiple_choice'
|
|
250
|
-
? promptData.options.map((o) => `${o.isDefault ? '>' : ''}${o.number}.${o.label}`).join('\n')
|
|
251
|
-
: '';
|
|
252
|
-
return [(0, prompt_key_1.generatePromptKey)(promptData), options, promptData.approvalTarget ?? ''].join('\u0000');
|
|
253
|
-
}
|
|
254
|
-
function warnOncePerFrame(pollerState, frameKey, event, fields) {
|
|
255
|
-
const key = `${event}\u0000${frameKey}`;
|
|
256
|
-
if (pollerState.lastSkipWarnKey === key) {
|
|
257
|
-
logger.debug(event, { ...fields, repeated: true });
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
pollerState.lastSkipWarnKey = key;
|
|
261
|
-
logger.warn(event, fields);
|
|
262
|
-
}
|
|
263
226
|
// =============================================================================
|
|
264
227
|
// Extracted Functions for pollAutoYes (Issue #323: SRP decomposition)
|
|
265
228
|
// =============================================================================
|
|
@@ -395,116 +358,6 @@ function logIfWithheldForWantOfReceipt(worktreeId, instanceId, compositeKey, rea
|
|
|
395
358
|
hint: 'hook の受信記録が直近に無いため Auto-Yes は答えなかった。~/.gemini/config/hooks.json の向き先(#2622)を確認',
|
|
396
359
|
});
|
|
397
360
|
}
|
|
398
|
-
/**
|
|
399
|
-
* Issue #3214: the form the four suppression exits of `detectAndRespondToPrompt`
|
|
400
|
-
* share. Records why Auto-Yes left the prompt alone (`recordPolicySuppression`,
|
|
401
|
-
* not throttled), then prints the WARN once per frame (`warnOncePerFrame`).
|
|
402
|
-
*
|
|
403
|
-
* @param suppression - Handed to `recordPolicySuppression` as is
|
|
404
|
-
* @param warnFrameKey - Handed to `warnOncePerFrame` as is: the prompt's
|
|
405
|
-
* `frameKey` plus the exit's own detail
|
|
406
|
-
* @param event - The WARN's log name
|
|
407
|
-
* @param detail - The WARN's fields after `worktreeId`, `cliToolId` and `instanceId`
|
|
408
|
-
*/
|
|
409
|
-
function suppressAndWarnOnce(prompt, suppression, warnFrameKey, event, detail) {
|
|
410
|
-
const { worktreeId, cliToolId, instanceId } = prompt;
|
|
411
|
-
(0, auto_yes_suppression_state_1.recordPolicySuppression)(worktreeId, cliToolId, instanceId, suppression);
|
|
412
|
-
warnOncePerFrame(prompt.pollerState, warnFrameKey, event, {
|
|
413
|
-
worktreeId,
|
|
414
|
-
cliToolId,
|
|
415
|
-
instanceId,
|
|
416
|
-
...detail,
|
|
417
|
-
});
|
|
418
|
-
}
|
|
419
|
-
/**
|
|
420
|
-
* Issue #3214: steps 3, 3.2 and 3.5 of `detectAndRespondToPrompt` -- the frames
|
|
421
|
-
* that read as a prompt and are still not Auto-Yes's to answer, judged in the
|
|
422
|
-
* order they always were. "The detection above" in the comments below is that
|
|
423
|
-
* function's step 1.
|
|
424
|
-
*
|
|
425
|
-
* Issue #3397: step 3.5 no longer records its refusal here. It hands the gate's
|
|
426
|
-
* verdict back so `tryEnterFallback` can look at the frame first, and records
|
|
427
|
-
* through {@link suppressUnclassifiedFrame} when that sends nothing. Steps 3 and
|
|
428
|
-
* 3.2 still win: an Enter never reaches codex's launch dialogs or its `/model`
|
|
429
|
-
* picker.
|
|
430
|
-
*
|
|
431
|
-
* @param frame - The tick's one normalised frame (Issue #3183)
|
|
432
|
-
*/
|
|
433
|
-
function suppressIfNotOursToAnswer(prompt, frame) {
|
|
434
|
-
const { cliToolId, promptData, frameKey } = prompt;
|
|
435
|
-
// 3. Issue #1829: codex's own launch dialogs are CodexTool.waitForReady()'s
|
|
436
|
-
// to answer, not the poller's. Every one of them defaults to option 1, and
|
|
437
|
-
// the base rules answer the default:
|
|
438
|
-
//
|
|
439
|
-
// "Hooks need review" -> 1. Review hooks (undoes Issue #1760; the pane
|
|
440
|
-
// then sits two screens deep in a review UI that
|
|
441
|
-
// only `t`/`esc` leave, reported as `running`)
|
|
442
|
-
// "Update available" -> 1. Update now (undoes Issue #890; runs
|
|
443
|
-
// `npm install -g @openai/codex`, killing codex)
|
|
444
|
-
// "Do you trust …" -> 1. Yes, continue
|
|
445
|
-
//
|
|
446
|
-
// waitForReady answers the same screens deliberately and differently ('3',
|
|
447
|
-
// '2', '1' — each without a trailing Enter), but only during startSession,
|
|
448
|
-
// while this poller runs on its own 2s phase for the life of the session.
|
|
449
|
-
// Whichever sees the dialog first decides, so the fix is to leave them all
|
|
450
|
-
// to the tool. Auto-answer layer only: the detection above still reports the
|
|
451
|
-
// prompt, so the human keeps seeing the screen and the response poller
|
|
452
|
-
// still notifies them about it.
|
|
453
|
-
const launchDialog = cliToolId === 'codex' ? (0, cli_patterns_1.getCodexLifecycleDialog)(frame) : null;
|
|
454
|
-
if (launchDialog) {
|
|
455
|
-
// Recorded through the #1684 channel so `capture --json` and `cmate wait`
|
|
456
|
-
// can name the reason instead of showing a worker that went quiet.
|
|
457
|
-
suppressAndWarnOnce(prompt, { reason: 'agent-launch-dialog', mode: null, promptType: promptData.type }, `${frameKey}\u0000${launchDialog}`, 'poller:auto-yes-skipped-launch-dialog', { dialog: launchDialog, promptType: promptData.type });
|
|
458
|
-
return { kind: 'left-alone' };
|
|
459
|
-
}
|
|
460
|
-
// 3.2. Issue #3062: codex's `/model` picker (both stages) is not ours to
|
|
461
|
-
// answer. A digit there is an immediate decision, so the base rules'
|
|
462
|
-
// default would choose the model and effort for the operator. Judged by the
|
|
463
|
-
// picker's own footer, not by `kind: picker`, which the hooks screens share.
|
|
464
|
-
// The tool's `detectPrompt` still reports the prompt, so `/prompt-response`
|
|
465
|
-
// (the human's answer) is unaffected. Reuses `unclassified-frame`: the tool
|
|
466
|
-
// recognised the frame and deliberately declined it.
|
|
467
|
-
if (cliToolId === 'codex' && (0, detect_1.isCodexModelPickerFrame)(frame)) {
|
|
468
|
-
suppressAndWarnOnce(prompt, { reason: 'unclassified-frame', mode: null, promptType: promptData.type }, `${frameKey}\u0000codex-model-picker`, 'poller:auto-yes-skipped-model-picker', { promptType: promptData.type });
|
|
469
|
-
return { kind: 'left-alone' };
|
|
470
|
-
}
|
|
471
|
-
// 3.5. Issue #1928 (§4 D1 decision 4): the generic numbered-list inference is
|
|
472
|
-
// not enough to send an answer. The detection above judges the ROWS, and the
|
|
473
|
-
// rows of an agent's own reply can be indistinguishable from a dialog's --
|
|
474
|
-
// opencode 1.18 answering "list three options and ask which one" is the
|
|
475
|
-
// reported case (#1896), and the `1` this poller sent in reply was not
|
|
476
|
-
// answering anything, it was SENT AS A USER UTTERANCE. What separates the two
|
|
477
|
-
// is position and chrome, which only the tool's own module knows, so the
|
|
478
|
-
// decision is delegated to `detectDialog` (the seam #1927 declared).
|
|
479
|
-
//
|
|
480
|
-
// Per tool, and only for tools whose dialogs were measured from their own
|
|
481
|
-
// live captures -- see AUTO_YES_DIALOG_GATE_DEFAULT_MODE. An ungated tool
|
|
482
|
-
// reaches `allowed: true` without being judged, which is the pre-#1928
|
|
483
|
-
// behaviour and the right one where nobody has measured anything.
|
|
484
|
-
//
|
|
485
|
-
// Recorded through the #1684 channel with the reason code #1924 landed for
|
|
486
|
-
// exactly this position, so `capture --json` and `cmate wait` can name the
|
|
487
|
-
// gap instead of showing a worker that silently went quiet.
|
|
488
|
-
const dialogGate = (0, auto_yes_dialog_gate_1.evaluateAutoYesDialogGate)(cliToolId, promptData.type, frame);
|
|
489
|
-
if (!dialogGate.allowed) {
|
|
490
|
-
return { kind: 'dialog-gate-refused', dialogGate };
|
|
491
|
-
}
|
|
492
|
-
return { kind: 'ours' };
|
|
493
|
-
}
|
|
494
|
-
/**
|
|
495
|
-
* Step 3.5's record: the tool's dialog detector did not vouch for the frame and
|
|
496
|
-
* nothing was sent (Issue #1928). Split out of `suppressIfNotOursToAnswer` by
|
|
497
|
-
* Issue #3397, unchanged, so it runs after `tryEnterFallback` declined.
|
|
498
|
-
*/
|
|
499
|
-
function suppressUnclassifiedFrame(prompt, dialogGate) {
|
|
500
|
-
const { promptData, frameKey } = prompt;
|
|
501
|
-
suppressAndWarnOnce(prompt, { reason: 'unclassified-frame', mode: null, promptType: promptData.type }, `${frameKey}\u0000${dialogGate.dialog?.kind ?? ''}\u0000${dialogGate.mode}`, 'poller:auto-yes-skipped-unclassified-frame', {
|
|
502
|
-
promptType: promptData.type,
|
|
503
|
-
dialogKind: dialogGate.dialog?.kind ?? null,
|
|
504
|
-
answerMode: dialogGate.dialog?.answerMode ?? null,
|
|
505
|
-
gateMode: dialogGate.mode,
|
|
506
|
-
});
|
|
507
|
-
}
|
|
508
361
|
/**
|
|
509
362
|
* The audit row's `answer` for the Enter (Issue #3397): not a digit, so the
|
|
510
363
|
* History reads as "Auto-Yes pressed Enter" rather than as a chosen option.
|
|
@@ -525,7 +378,7 @@ function isStillEnterFallbackScreen(prompt, fresh) {
|
|
|
525
378
|
const detection = (0, response_checker_1.detectPromptOnCleanFrame)(clean, cliToolId, clean.split('\n'), fresh, { worktreeId, instanceId }, frame);
|
|
526
379
|
if (!detection.isPrompt || !detection.promptData)
|
|
527
380
|
return false;
|
|
528
|
-
if (promptFrameKey(detection.promptData) !== frameKey)
|
|
381
|
+
if ((0, auto_yes_poller_state_1.promptFrameKey)(detection.promptData) !== frameKey)
|
|
529
382
|
return false;
|
|
530
383
|
if (cliToolId === 'codex' && ((0, cli_patterns_1.getCodexLifecycleDialog)(frame) || (0, detect_1.isCodexModelPickerFrame)(frame))) {
|
|
531
384
|
return false;
|
|
@@ -563,7 +416,7 @@ async function tryEnterFallback(prompt, promptDetection, dialogGate, rawOutput)
|
|
|
563
416
|
const judgement = dialogGate.dialog === null ? (0, auto_yes_enter_fallback_1.judgeEnterFallback)(cliToolId, rawOutput) : null;
|
|
564
417
|
if (judgement === null || !judgement.eligible) {
|
|
565
418
|
pollerState.enterFallbackCandidateKey = null;
|
|
566
|
-
suppressUnclassifiedFrame(prompt, dialogGate);
|
|
419
|
+
(0, auto_yes_prompt_suppression_1.suppressUnclassifiedFrame)(prompt, dialogGate);
|
|
567
420
|
return false;
|
|
568
421
|
}
|
|
569
422
|
const screenKey = (0, auto_yes_enter_fallback_1.enterFallbackScreenKey)(promptData);
|
|
@@ -571,8 +424,8 @@ async function tryEnterFallback(prompt, promptDetection, dialogGate, rawOutput)
|
|
|
571
424
|
if (pollerState.enterFallbackSentKey === frameKey) {
|
|
572
425
|
pollerState.enterFallbackCandidateKey = null;
|
|
573
426
|
(0, auto_yes_enter_fallback_1.recordEnterFallbackNoEffect)(worktreeId, cliToolId, instanceId, screenKey);
|
|
574
|
-
suppressUnclassifiedFrame(prompt, dialogGate);
|
|
575
|
-
warnOncePerFrame(pollerState, `${frameKey}\u0000enter-fallback-no-effect`, 'poller:auto-yes-enter-fallback-no-effect', {
|
|
427
|
+
(0, auto_yes_prompt_suppression_1.suppressUnclassifiedFrame)(prompt, dialogGate);
|
|
428
|
+
(0, auto_yes_poller_state_1.warnOncePerFrame)(pollerState, `${frameKey}\u0000enter-fallback-no-effect`, 'poller:auto-yes-enter-fallback-no-effect', {
|
|
576
429
|
worktreeId,
|
|
577
430
|
cliToolId,
|
|
578
431
|
instanceId,
|
|
@@ -586,7 +439,7 @@ async function tryEnterFallback(prompt, promptDetection, dialogGate, rawOutput)
|
|
|
586
439
|
const resolution = (0, auto_yes_resolver_1.resolveAutoAnswerWithPolicy)(promptData, policy);
|
|
587
440
|
if (resolution.suppressedBy) {
|
|
588
441
|
pollerState.enterFallbackCandidateKey = null;
|
|
589
|
-
suppressAndWarnOnce(prompt, {
|
|
442
|
+
(0, auto_yes_prompt_suppression_1.suppressAndWarnOnce)(prompt, {
|
|
590
443
|
reason: resolution.suppressedBy,
|
|
591
444
|
mode: policy?.mode ?? null,
|
|
592
445
|
promptType: promptData.type,
|
|
@@ -608,7 +461,7 @@ async function tryEnterFallback(prompt, promptDetection, dialogGate, rawOutput)
|
|
|
608
461
|
if (resolution.answer === null ||
|
|
609
462
|
(promptData.type === 'multiple_choice' && (0, prompt_answer_semantic_1.isMultiSelectPrompt)(promptData))) {
|
|
610
463
|
pollerState.enterFallbackCandidateKey = null;
|
|
611
|
-
suppressUnclassifiedFrame(prompt, dialogGate);
|
|
464
|
+
(0, auto_yes_prompt_suppression_1.suppressUnclassifiedFrame)(prompt, dialogGate);
|
|
612
465
|
return false;
|
|
613
466
|
}
|
|
614
467
|
// 4. Seen once: wait for the next tick to see the same screen again.
|
|
@@ -629,7 +482,7 @@ async function tryEnterFallback(prompt, promptDetection, dialogGate, rawOutput)
|
|
|
629
482
|
const sessionName = manager_1.CLIToolManager.getInstance().getTool(cliToolId).getSessionName(worktreeId, instanceId);
|
|
630
483
|
const ownership = await (0, worktree_session_ownership_1.checkWorktreeSessionOwnership)(worktreeId, sessionName);
|
|
631
484
|
if (ownership === null || ownership.verdict === 'foreign') {
|
|
632
|
-
warnOncePerFrame(pollerState, `${frameKey}\u0000${sessionName}\u0000${ownership ? 'foreign' : 'worktree_not_found'}`, 'poller:auto-yes-skipped-foreign-session', {
|
|
485
|
+
(0, auto_yes_poller_state_1.warnOncePerFrame)(pollerState, `${frameKey}\u0000${sessionName}\u0000${ownership ? 'foreign' : 'worktree_not_found'}`, 'poller:auto-yes-skipped-foreign-session', {
|
|
633
486
|
worktreeId,
|
|
634
487
|
cliToolId,
|
|
635
488
|
instanceId,
|
|
@@ -841,7 +694,7 @@ async function detectAndRespondToPrompt(worktreeId, pollerState, cliToolId, clea
|
|
|
841
694
|
}
|
|
842
695
|
// 2. Check for duplicate prompt (Issue #306)
|
|
843
696
|
const promptKey = (0, prompt_key_1.generatePromptKey)(promptDetection.promptData);
|
|
844
|
-
const frameKey = promptFrameKey(promptDetection.promptData);
|
|
697
|
+
const frameKey = (0, auto_yes_poller_state_1.promptFrameKey)(promptDetection.promptData);
|
|
845
698
|
if (isDuplicatePrompt(pollerState, promptKey)) {
|
|
846
699
|
return 'duplicate';
|
|
847
700
|
}
|
|
@@ -857,7 +710,7 @@ async function detectAndRespondToPrompt(worktreeId, pollerState, cliToolId, clea
|
|
|
857
710
|
};
|
|
858
711
|
// 3., 3.2., 3.5. Frames that are not Auto-Yes's to answer: see
|
|
859
712
|
// `suppressIfNotOursToAnswer`.
|
|
860
|
-
const notOurs = suppressIfNotOursToAnswer(judged, frame);
|
|
713
|
+
const notOurs = (0, auto_yes_prompt_suppression_1.suppressIfNotOursToAnswer)(judged, frame);
|
|
861
714
|
if (notOurs.kind !== 'dialog-gate-refused') {
|
|
862
715
|
pollerState.enterFallbackCandidateKey = null;
|
|
863
716
|
}
|
|
@@ -883,7 +736,7 @@ async function detectAndRespondToPrompt(worktreeId, pollerState, cliToolId, clea
|
|
|
883
736
|
// Issue #1684: the log line alone leaves a CLI-driven pipeline blind to
|
|
884
737
|
// why its worker stalled. Record the suppression so buildCurrentOutput
|
|
885
738
|
// can publish it (`autoYes.lastSuppression` in capture --json).
|
|
886
|
-
suppressAndWarnOnce(judged, {
|
|
739
|
+
(0, auto_yes_prompt_suppression_1.suppressAndWarnOnce)(judged, {
|
|
887
740
|
reason: resolution.suppressedBy,
|
|
888
741
|
mode: policy?.mode ?? null,
|
|
889
742
|
promptType: promptDetection.promptData.type,
|
|
@@ -907,7 +760,7 @@ async function detectAndRespondToPrompt(worktreeId, pollerState, cliToolId, clea
|
|
|
907
760
|
// server created. The poller keeps running; it just does not type.
|
|
908
761
|
const ownership = await (0, worktree_session_ownership_1.checkWorktreeSessionOwnership)(worktreeId, sessionName);
|
|
909
762
|
if (ownership === null || ownership.verdict === 'foreign') {
|
|
910
|
-
warnOncePerFrame(pollerState, `${frameKey}\u0000${sessionName}\u0000${ownership ? 'foreign' : 'worktree_not_found'}`, 'poller:auto-yes-skipped-foreign-session', {
|
|
763
|
+
(0, auto_yes_poller_state_1.warnOncePerFrame)(pollerState, `${frameKey}\u0000${sessionName}\u0000${ownership ? 'foreign' : 'worktree_not_found'}`, 'poller:auto-yes-skipped-foreign-session', {
|
|
911
764
|
worktreeId,
|
|
912
765
|
cliToolId,
|
|
913
766
|
instanceId,
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
* | copilot | footer: `← open sidebar · … · tab next tab GPT-5 mini · Medium` |
|
|
43
43
|
* | copilot | notice: `● Model changed from gpt-5.6-terra (xhigh) to gpt-5-mini (medium) for this session.` |
|
|
44
44
|
* | opencode | step: `▣ Build · GPT-5.6 Luna · 3.1s` |
|
|
45
|
+
* | opencode2 | step: `Build · Mistral Large 4 · 253ms` (no `▣`, 2.0.18, #3443) |
|
|
45
46
|
*
|
|
46
47
|
* The copilot and opencode rows were added by Issue #1912 and read off the live
|
|
47
48
|
* fixtures #1885 / #1895 / #1893 / #1896 recorded, not off a fresh capture.
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
* @see Issue #1784, Phase 2 of the model/effort visibility series
|
|
63
64
|
*/
|
|
64
65
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
-
exports.ANTIGRAVITY_MODEL_ID_EFFORT_PATTERN = exports.COMMAND_CODE_BANNER_MODELS_PATTERN = exports.OPENCODE_STEP_MODEL_PATTERN = exports.COPILOT_MODEL_CHANGE_PATTERN = exports.ANTIGRAVITY_BANNER_MODEL_PATTERN = exports.ANTIGRAVITY_STATUS_BAR_HINT_PATTERN = exports.CLAUDE_MODEL_SWITCH_PATTERN = exports.CLAUDE_EFFORT_ROW_PATTERN = exports.CLAUDE_STARTUP_BANNER_V2_1_28X_PATTERN = exports.CLAUDE_STARTUP_BANNER_PATTERN = exports.CODEX_STATUS_BAR_WITH_TRAILER_PATTERN = exports.CODEX_FOOTER_EFFORT_SLOT_PATTERN = exports.CODEX_FOOTER_MODEL_PATTERN = exports.REASONING_EFFORT_LEVELS = void 0;
|
|
66
|
+
exports.ANTIGRAVITY_MODEL_ID_EFFORT_PATTERN = exports.COMMAND_CODE_BANNER_MODELS_PATTERN = exports.OPENCODE_V2_STEP_MODEL_PATTERN = exports.OPENCODE_STEP_MODEL_PATTERN = exports.COPILOT_MODEL_CHANGE_PATTERN = exports.ANTIGRAVITY_BANNER_MODEL_PATTERN = exports.ANTIGRAVITY_STATUS_BAR_HINT_PATTERN = exports.CLAUDE_MODEL_SWITCH_PATTERN = exports.CLAUDE_EFFORT_ROW_PATTERN = exports.CLAUDE_STARTUP_BANNER_V2_1_28X_PATTERN = exports.CLAUDE_STARTUP_BANNER_PATTERN = exports.CODEX_STATUS_BAR_WITH_TRAILER_PATTERN = exports.CODEX_FOOTER_EFFORT_SLOT_PATTERN = exports.CODEX_FOOTER_MODEL_PATTERN = exports.REASONING_EFFORT_LEVELS = void 0;
|
|
66
67
|
exports.resolveEffortToken = resolveEffortToken;
|
|
67
68
|
exports.extractModelInfo = extractModelInfo;
|
|
68
69
|
exports.deriveEffortFromModelId = deriveEffortFromModelId;
|
|
@@ -684,6 +685,58 @@ function readOpencodeStepMarker(line) {
|
|
|
684
685
|
const model = match[1].trim();
|
|
685
686
|
return isPlausibleModelLabel(model) ? { model, effort: null } : null;
|
|
686
687
|
}
|
|
688
|
+
/**
|
|
689
|
+
* opencode2's step row (Issue #3443): v1's marker without the `▣`.
|
|
690
|
+
*
|
|
691
|
+
* Measured on opencode2 2.0.18 (`tests/fixtures/opencode-agent-health-3420/`):
|
|
692
|
+
*
|
|
693
|
+
* ` Error: Unauthorized`
|
|
694
|
+
* ` Build · Mistral Large 4 · 721ms`
|
|
695
|
+
* ` ┃` (the next user turn, or the composer)
|
|
696
|
+
*
|
|
697
|
+
* Without the `▣` the shape `<word> · <text> · <duration>` is ordinary prose, so
|
|
698
|
+
* it is only read under three guards, each of which a v1 step row also meets:
|
|
699
|
+
*
|
|
700
|
+
* - the duration is required (a row with two `·` and nothing timed is not one);
|
|
701
|
+
* - the row is transcript text, not inside a `┃` block — the user's own input
|
|
702
|
+
* and shell output are drawn inside one, the composer bar too;
|
|
703
|
+
* - the next non-blank row opens a `┃` block (the next user turn or the
|
|
704
|
+
* composer): the step row closes a reply, so a reply line that merely has the
|
|
705
|
+
* shape is followed by more reply, or by the step row itself.
|
|
706
|
+
*
|
|
707
|
+
* No /g. No nested quantifiers: `[^·]+?` is bounded by literal `·`.
|
|
708
|
+
*/
|
|
709
|
+
exports.OPENCODE_V2_STEP_MODEL_PATTERN = /^\s*[A-Za-z][A-Za-z0-9-]*\s+·\s+([^·]+?)\s+·\s+[\d.]+\s?m?s\s*$/;
|
|
710
|
+
/** A row that opens or continues opencode's `┃` block (a user turn or the composer). */
|
|
711
|
+
const OPENCODE_BLOCK_ROW_PATTERN = /^\s*[┃╹]/;
|
|
712
|
+
function readOpencodeV2StepRow(lines, index) {
|
|
713
|
+
const match = exports.OPENCODE_V2_STEP_MODEL_PATTERN.exec(lines[index]);
|
|
714
|
+
if (!match)
|
|
715
|
+
return null;
|
|
716
|
+
const model = match[1].trim();
|
|
717
|
+
if (!isPlausibleModelLabel(model))
|
|
718
|
+
return null;
|
|
719
|
+
for (let next = index + 1; next < lines.length; next++) {
|
|
720
|
+
if (lines[next].trim() === '')
|
|
721
|
+
continue;
|
|
722
|
+
return OPENCODE_BLOCK_ROW_PATTERN.test(lines[next]) ? { model, effort: null } : null;
|
|
723
|
+
}
|
|
724
|
+
return null;
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* The lowest opencode step row, `▣` (v1) or not (opencode2, #3443). Both tool
|
|
728
|
+
* ids read both shapes: `opencode` may be running a 2.x binary, and a v1 frame
|
|
729
|
+
* never draws a `▣`-less row that passes {@link readOpencodeV2StepRow}'s guards.
|
|
730
|
+
*/
|
|
731
|
+
function readOpencodeStepRow(captureText) {
|
|
732
|
+
const lines = captureText.split('\n').map((line) => (0, ansi_1.stripAnsi)(line));
|
|
733
|
+
for (let i = lines.length - 1; i >= 0; i--) {
|
|
734
|
+
const result = readOpencodeStepMarker(lines[i]) ?? readOpencodeV2StepRow(lines, i);
|
|
735
|
+
if (result)
|
|
736
|
+
return result;
|
|
737
|
+
}
|
|
738
|
+
return null;
|
|
739
|
+
}
|
|
687
740
|
// =============================================================================
|
|
688
741
|
// Command Code (Issue #2358)
|
|
689
742
|
// =============================================================================
|
|
@@ -792,7 +845,7 @@ function scanFromEnd(captureText, read) {
|
|
|
792
845
|
* Pure and side-effect free. Never throws, and answers `{ model: null, effort:
|
|
793
846
|
* null }` for every tool it has no rule for (gemini / vibe-local — neither
|
|
794
847
|
* prints a model on its pane in any captured frame; copilot and opencode were
|
|
795
|
-
* added by Issue #1912) and for every frame that does not show the chrome it
|
|
848
|
+
* added by Issue #1912, opencode-v2 by #3443) and for every frame that does not show the chrome it
|
|
796
849
|
* looks for.
|
|
797
850
|
*
|
|
798
851
|
* **Answering null is a correct outcome, not a failure.** tmux keeps a
|
|
@@ -842,7 +895,8 @@ function extractModelInfo(cliToolId, captureText) {
|
|
|
842
895
|
return sameModel(bar.model, notice.model) ? { model: bar.model, effort: notice.effort } : bar;
|
|
843
896
|
}
|
|
844
897
|
case 'opencode':
|
|
845
|
-
|
|
898
|
+
case 'opencode-v2':
|
|
899
|
+
return readOpencodeStepRow(captureText) ?? unknown();
|
|
846
900
|
case 'command-code':
|
|
847
901
|
// Issue #2358. The banner is the only source — hooks carry no model — and
|
|
848
902
|
// bottom-up is the same "last banner wins" rule Claude uses: a relaunch in
|
|
@@ -76,7 +76,7 @@ exports.SELECTION_LIST_REASONS = new Set([
|
|
|
76
76
|
* The `running` reasons that mean "the agent is producing output right now"
|
|
77
77
|
* (Issue #1912).
|
|
78
78
|
*
|
|
79
|
-
* `current-output-builder` derives `thinking`
|
|
79
|
+
* `current-output-builder` derives `thinking` from this, and it
|
|
80
80
|
* was a single `=== THINKING_INDICATOR` comparison until opencode grew a second
|
|
81
81
|
* one: branch A of the opencode block answers `opencode_processing_indicator`
|
|
82
82
|
* for the footer that reads `esc interrupt`, which is opencode's ONLY signal
|
|
@@ -60,13 +60,33 @@ async function execGitCommand(args, cwd) {
|
|
|
60
60
|
}
|
|
61
61
|
catch (error) {
|
|
62
62
|
// Log error server-side only (no client exposure)
|
|
63
|
-
|
|
63
|
+
const fields = {
|
|
64
64
|
args: args.join(' '),
|
|
65
|
+
worktree: path_1.default.basename(cwd),
|
|
65
66
|
error: error instanceof Error ? error.message : 'Unknown error',
|
|
66
|
-
}
|
|
67
|
+
};
|
|
68
|
+
// Issue #3416: a read killed by the 1s timeout is an EXPECTED outcome on a
|
|
69
|
+
// loaded host (callers already degrade null to '(unknown)' / not dirty), so
|
|
70
|
+
// it is a warn. Any other failure (git exited non-zero) stays an ERROR.
|
|
71
|
+
if (isExecTimeout(error)) {
|
|
72
|
+
logger.warn('git:command-failed', { ...fields, timedOut: true, timeoutMs: GIT_COMMAND_TIMEOUT_MS });
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
logger.error('git:command-failed', fields);
|
|
76
|
+
}
|
|
67
77
|
return null;
|
|
68
78
|
}
|
|
69
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* True when execFile rejected because the child was killed by `timeout`
|
|
82
|
+
* (Node sets `killed` and leaves stderr empty) rather than because git failed.
|
|
83
|
+
*/
|
|
84
|
+
function isExecTimeout(error) {
|
|
85
|
+
const err = error;
|
|
86
|
+
return (err?.killed === true ||
|
|
87
|
+
err?.code === 'ERR_CHILD_PROCESS_EXEC_TIMEOUT' ||
|
|
88
|
+
err?.code === 'ETIMEDOUT');
|
|
89
|
+
}
|
|
70
90
|
/**
|
|
71
91
|
* Execute a READ-ONLY git command like {@link execGitCommand} (never throws,
|
|
72
92
|
* same default 1s timeout) but return the stderr alongside the outcome instead
|
|
@@ -92,9 +112,7 @@ async function execGitCommandCapture(args, cwd, timeout = GIT_COMMAND_TIMEOUT_MS
|
|
|
92
112
|
}
|
|
93
113
|
catch (error) {
|
|
94
114
|
const err = error;
|
|
95
|
-
const timedOut = err
|
|
96
|
-
err.code === 'ERR_CHILD_PROCESS_EXEC_TIMEOUT' ||
|
|
97
|
-
err.code === 'ETIMEDOUT';
|
|
115
|
+
const timedOut = isExecTimeout(err);
|
|
98
116
|
return {
|
|
99
117
|
ok: false,
|
|
100
118
|
stdout: '',
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Whether a Claude Code `Stop` leaves background work behind that will wake the
|
|
4
|
+
* agent again (Issue #3430) — the Claude half of #2614.
|
|
5
|
+
*
|
|
6
|
+
* Claude Code ends a turn with work still running in two measured ways: a
|
|
7
|
+
* `Bash` call that outlived its timeout (or was started with
|
|
8
|
+
* `run_in_background`) and a `Monitor`. When that work finishes Claude queues a
|
|
9
|
+
* `<task-notification>` and, if the session is idle, opens a new turn on it by
|
|
10
|
+
* itself. Measured on 2026-10-08 (worktree commandmate-issue-3423): a worker
|
|
11
|
+
* ended its turn at 23:37:53 "waiting for the related-tests run to finish",
|
|
12
|
+
* `wait --verify` read that `Stop` as the end and verified an uncommitted
|
|
13
|
+
* worktree, and the notification opened the turn that committed at 23:38:32.
|
|
14
|
+
*
|
|
15
|
+
* ## What is read, and why not the `Stop` payload
|
|
16
|
+
*
|
|
17
|
+
* The payload carries `background_tasks`, but only its empty form has ever been
|
|
18
|
+
* captured (`tests/fixtures/hooks/claude/stop.json`), so its shape is a guess.
|
|
19
|
+
* The transcript names the same work in structured fields, measured on the
|
|
20
|
+
* transcripts under `~/.claude/projects` written in the four days to 2026-10-08:
|
|
21
|
+
*
|
|
22
|
+
* - a background `Bash`: `toolUseResult.backgroundTaskId` (1,008 results);
|
|
23
|
+
* - a `Monitor`: `toolUseResult.taskId` beside a boolean `persistent`
|
|
24
|
+
* (115 results);
|
|
25
|
+
* - a background subagent: `toolUseResult.isAsync: true` and `agentId`
|
|
26
|
+
* (30 results);
|
|
27
|
+
* - a `TaskStop`: `toolUseResult.task_id` (39 results). A stopped task is never
|
|
28
|
+
* notified, so this is what retires it.
|
|
29
|
+
*
|
|
30
|
+
* and each finished task is retired by the notification Claude delivers for it:
|
|
31
|
+
* a `type: "user"` prompt or a `queued_command` attachment whose text begins
|
|
32
|
+
* with `<task-notification>` and carries `<task-id>…</task-id>` — the id above.
|
|
33
|
+
* A notice that is only enqueued is not yet delivered, and the session will open
|
|
34
|
+
* a turn on it, so its task still counts as pending.
|
|
35
|
+
*
|
|
36
|
+
* ## Erring towards "finished"
|
|
37
|
+
*
|
|
38
|
+
* Every doubt answers "nothing pending", which is what every Claude `Stop` meant
|
|
39
|
+
* before this Issue: no transcript path, a path outside `~/.claude/projects`, a
|
|
40
|
+
* file that cannot be read, a line that does not parse. A persistent `Monitor`
|
|
41
|
+
* (a watch for the whole session, never notified on its own) is not counted
|
|
42
|
+
* either. A task that really is never notified — a process that died with its
|
|
43
|
+
* session — is bounded by `commandmate wait`'s `SELF_RESUME_HOLD_MS`.
|
|
44
|
+
*
|
|
45
|
+
* @module lib/hooks/sources/claude/self-resume
|
|
46
|
+
*/
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.CLAUDE_SELF_RESUME_TAIL_BYTES = exports.CLAUDE_TRANSCRIPT_PATH_FIELD = void 0;
|
|
49
|
+
exports.pendingClaudeBackgroundTasks = pendingClaudeBackgroundTasks;
|
|
50
|
+
exports.claudeStopLeavesBackgroundWork = claudeStopLeavesBackgroundWork;
|
|
51
|
+
const fs_1 = require("fs");
|
|
52
|
+
const os_1 = require("os");
|
|
53
|
+
const path_1 = require("path");
|
|
54
|
+
const transcript_history_1 = require("../transcript-history");
|
|
55
|
+
const queued_notice_1 = require("./queued-notice");
|
|
56
|
+
const transcript_1 = require("./transcript");
|
|
57
|
+
/** The `Stop` payload field naming the session's transcript. */
|
|
58
|
+
exports.CLAUDE_TRANSCRIPT_PATH_FIELD = 'transcript_path';
|
|
59
|
+
/**
|
|
60
|
+
* How much of the transcript's tail is read on a `Stop`.
|
|
61
|
+
*
|
|
62
|
+
* A task is started before it is notified, so a window that holds the start
|
|
63
|
+
* holds the notification too; a start older than the window is simply not seen
|
|
64
|
+
* (the "finished" direction). 4 MiB is `CLAUDE_TRANSCRIPT_TAIL_BYTES`, the first
|
|
65
|
+
* read of `./history`, which holds 99% of turns whole (#2470).
|
|
66
|
+
*/
|
|
67
|
+
exports.CLAUDE_SELF_RESUME_TAIL_BYTES = 4 * 1024 * 1024;
|
|
68
|
+
const TASK_ID_PATTERN = /<task-id>([^<]+)<\/task-id>/;
|
|
69
|
+
function isRecord(value) {
|
|
70
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
71
|
+
}
|
|
72
|
+
function nonEmptyString(value) {
|
|
73
|
+
return typeof value === 'string' && value.length > 0 ? value : null;
|
|
74
|
+
}
|
|
75
|
+
/** The background task a tool result started, or null. */
|
|
76
|
+
function startedTaskId(result) {
|
|
77
|
+
const bash = nonEmptyString(result.backgroundTaskId);
|
|
78
|
+
if (bash)
|
|
79
|
+
return bash;
|
|
80
|
+
// Monitor. `persistent: true` watches for the life of the session and is not
|
|
81
|
+
// work the turn is waiting on.
|
|
82
|
+
const monitor = nonEmptyString(result.taskId);
|
|
83
|
+
if (monitor && result.persistent === false)
|
|
84
|
+
return monitor;
|
|
85
|
+
const agent = nonEmptyString(result.agentId);
|
|
86
|
+
if (agent && result.isAsync === true)
|
|
87
|
+
return agent;
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
/** The task a `<task-notification>` text retires, or null. */
|
|
91
|
+
function notifiedTaskId(text) {
|
|
92
|
+
if (typeof text !== 'string')
|
|
93
|
+
return null;
|
|
94
|
+
if (!text.trimStart().startsWith(queued_notice_1.CLAUDE_TASK_NOTIFICATION_PREFIX))
|
|
95
|
+
return null;
|
|
96
|
+
return TASK_ID_PATTERN.exec(text)?.[1] ?? null;
|
|
97
|
+
}
|
|
98
|
+
/** Every text a delivered `type: "user"` record carries. */
|
|
99
|
+
function userTexts(record) {
|
|
100
|
+
const message = record.message;
|
|
101
|
+
if (!isRecord(message))
|
|
102
|
+
return [];
|
|
103
|
+
const content = message.content;
|
|
104
|
+
if (typeof content === 'string')
|
|
105
|
+
return [content];
|
|
106
|
+
if (!Array.isArray(content))
|
|
107
|
+
return [];
|
|
108
|
+
return content.filter(isRecord).filter((b) => b.type === 'text').map((b) => b.text);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The ids of background tasks started in `text` (transcript JSONL) and not yet
|
|
112
|
+
* delivered a notification or stopped, in the order they were started.
|
|
113
|
+
*
|
|
114
|
+
* Pure. Lines that do not parse are skipped, as is everything a subagent wrote
|
|
115
|
+
* into the parent's file (`isSidechain: true`).
|
|
116
|
+
*/
|
|
117
|
+
function pendingClaudeBackgroundTasks(text) {
|
|
118
|
+
const started = [];
|
|
119
|
+
const retired = new Set();
|
|
120
|
+
for (const line of text.split('\n')) {
|
|
121
|
+
if (line.trim() === '')
|
|
122
|
+
continue;
|
|
123
|
+
let record;
|
|
124
|
+
try {
|
|
125
|
+
record = JSON.parse(line);
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (!isRecord(record) || record.isSidechain === true)
|
|
131
|
+
continue;
|
|
132
|
+
if (record.type === 'user') {
|
|
133
|
+
const result = record.toolUseResult;
|
|
134
|
+
if (isRecord(result)) {
|
|
135
|
+
const id = startedTaskId(result);
|
|
136
|
+
if (id)
|
|
137
|
+
started.push(id);
|
|
138
|
+
const stopped = nonEmptyString(result.task_id);
|
|
139
|
+
if (stopped)
|
|
140
|
+
retired.add(stopped);
|
|
141
|
+
}
|
|
142
|
+
for (const t of userTexts(record)) {
|
|
143
|
+
const id = notifiedTaskId(t);
|
|
144
|
+
if (id)
|
|
145
|
+
retired.add(id);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
else if (record.type === 'attachment' && isRecord(record.attachment)) {
|
|
149
|
+
if (record.attachment.type !== 'queued_command')
|
|
150
|
+
continue;
|
|
151
|
+
const id = notifiedTaskId(record.attachment.prompt);
|
|
152
|
+
if (id)
|
|
153
|
+
retired.add(id);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return [...new Set(started)].filter((id) => !retired.has(id));
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* The last `maxBytes` of a file, starting at a line boundary; null when it
|
|
160
|
+
* cannot be read.
|
|
161
|
+
*/
|
|
162
|
+
function readTail(path, maxBytes) {
|
|
163
|
+
let fd = null;
|
|
164
|
+
try {
|
|
165
|
+
fd = (0, fs_1.openSync)(path, 'r');
|
|
166
|
+
const size = (0, fs_1.fstatSync)(fd).size;
|
|
167
|
+
const start = Math.max(0, size - maxBytes);
|
|
168
|
+
const buffer = Buffer.alloc(size - start);
|
|
169
|
+
let read = 0;
|
|
170
|
+
while (read < buffer.length) {
|
|
171
|
+
const n = (0, fs_1.readSync)(fd, buffer, read, buffer.length - read, start + read);
|
|
172
|
+
if (n === 0)
|
|
173
|
+
break;
|
|
174
|
+
read += n;
|
|
175
|
+
}
|
|
176
|
+
const text = buffer.subarray(0, read).toString('utf8');
|
|
177
|
+
// A window opened mid-file starts mid-line; that line is dropped.
|
|
178
|
+
return start === 0 ? text : text.slice(text.indexOf('\n') + 1);
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
finally {
|
|
184
|
+
if (fd !== null) {
|
|
185
|
+
try {
|
|
186
|
+
(0, fs_1.closeSync)(fd);
|
|
187
|
+
}
|
|
188
|
+
catch {
|
|
189
|
+
// Nothing to do: the answer is already decided.
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Whether this `Stop` payload's session still has background work that has not
|
|
196
|
+
* been notified — i.e. whether Claude will open another turn by itself.
|
|
197
|
+
*
|
|
198
|
+
* Synchronous: it runs inside event normalization. `false` for every case it
|
|
199
|
+
* cannot vouch for (see the module comment).
|
|
200
|
+
*/
|
|
201
|
+
function claudeStopLeavesBackgroundWork(payload, options = {}) {
|
|
202
|
+
const hint = nonEmptyString(payload[exports.CLAUDE_TRANSCRIPT_PATH_FIELD]);
|
|
203
|
+
if (!hint)
|
|
204
|
+
return false;
|
|
205
|
+
const root = (0, path_1.join)(options.homeDir ?? (0, os_1.homedir)(), ...transcript_1.CLAUDE_PROJECTS_DIR_SEGMENTS);
|
|
206
|
+
const path = (0, transcript_history_1.acceptPathUnderRoot)(root, '.jsonl', hint);
|
|
207
|
+
if (!path)
|
|
208
|
+
return false;
|
|
209
|
+
const text = readTail(path, options.tailBytes ?? exports.CLAUDE_SELF_RESUME_TAIL_BYTES);
|
|
210
|
+
if (text === null)
|
|
211
|
+
return false;
|
|
212
|
+
return pendingClaudeBackgroundTasks(text).length > 0;
|
|
213
|
+
}
|