commandmate 0.30.2 → 0.31.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 +160 -160
- package/.next/app-path-routes-manifest.json +27 -27
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +9 -9
- 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/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 +3 -3
- 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 +4 -4
- package/.next/server/app/api/assistant/terminal/route.js.nft.json +1 -1
- package/.next/server/app/api/assistant/terminal/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/tools/route.js +1 -1
- package/.next/server/app/api/assistant/tools/route.js.nft.json +1 -1
- package/.next/server/app/api/assistant/tools/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/capabilities/route.js +1 -1
- package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/agent-event/route.js +1 -1
- package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/claude-done/route.js +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/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/remote/pair/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/[id]/todos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/clone/route.js +1 -1
- package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/restore/route.js +1 -1
- package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/route.js +1 -1
- package/.next/server/app/api/repositories/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/scan/route.js +1 -1
- package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/sync/route.js +1 -1
- package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/default-agents/route.js +1 -1
- package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/default-surface-mode/route_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.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.js +1 -1
- package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/slash-commands/route.js +1 -1
- package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/todos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-reference/route_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]/env/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_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_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/session/route_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.js +4 -3
- 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.js +4 -3
- 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.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/chat/page.js +2 -2
- package/.next/server/app/chat/page.js.nft.json +1 -1
- package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
- package/.next/server/app/more/page.js +2 -2
- package/.next/server/app/more/page.js.nft.json +1 -1
- package/.next/server/app/more/page_client-reference-manifest.js +1 -1
- package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +1 -1
- package/.next/server/app/page.js.nft.json +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 +2 -2
- package/.next/server/app/repositories/page.js.nft.json +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.js.nft.json +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.js +2 -2
- package/.next/server/app/skills/installed/page.js.nft.json +1 -1
- package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/page.js +1 -1
- package/.next/server/app/skills/page.js.nft.json +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 +10 -10
- 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 +27 -27
- package/.next/server/chunks/1058.js +1 -1
- package/.next/server/chunks/1068.js +1 -1
- package/.next/server/chunks/1262.js +1 -1
- package/.next/server/chunks/1886.js +3 -3
- package/.next/server/chunks/1990.js +103 -0
- package/.next/server/chunks/2119.js +1 -1
- package/.next/server/chunks/2328.js +1 -1
- package/.next/server/chunks/2404.js +1 -1
- package/.next/server/chunks/2445.js +1 -1
- package/.next/server/chunks/261.js +1 -1
- package/.next/server/chunks/3123.js +1 -1
- package/.next/server/chunks/3241.js +1 -1
- package/.next/server/chunks/3480.js +5 -4
- package/.next/server/chunks/4299.js +1 -1
- package/.next/server/chunks/4393.js +1 -1
- package/.next/server/chunks/4443.js +1 -5
- package/.next/server/chunks/5017.js +1 -1
- package/.next/server/chunks/5043.js +1 -1
- package/.next/server/chunks/5164.js +1 -1
- package/.next/server/chunks/552.js +2 -2
- package/.next/server/chunks/6072.js +1 -1
- package/.next/server/chunks/6130.js +1 -1
- package/.next/server/chunks/663.js +4 -3
- package/.next/server/chunks/6894.js +2 -2
- package/.next/server/chunks/7187.js +1 -0
- package/.next/server/chunks/7472.js +1 -1
- package/.next/server/chunks/{880.js → 7859.js} +6 -6
- package/.next/server/chunks/7905.js +1 -1
- package/.next/server/chunks/8800.js +2 -2
- package/.next/server/chunks/8918.js +7 -0
- package/.next/server/chunks/9123.js +2 -2
- package/.next/server/chunks/9130.js +4 -4
- package/.next/server/chunks/9627.js +1 -1
- package/.next/server/chunks/9696.js +1 -1
- package/.next/server/chunks/9798.js +1 -1
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/1783-11c9b4d8a52ebd91.js +1 -0
- package/.next/static/chunks/4718-de1224c9e8a6e7fc.js +1 -0
- package/.next/static/chunks/6022-2fa0b5a82d4ce7b6.js +1 -0
- package/.next/static/chunks/{5229-6c89475b61bd2c8b.js → 6170-951b9f5fe6b4b3b5.js} +1 -1
- package/.next/static/chunks/app/chat/{page-9aa2011410895b0d.js → page-37d7615d17d7e2a0.js} +1 -1
- package/.next/static/chunks/app/layout-4c2f21e3f653ee4c.js +1 -0
- package/.next/static/chunks/app/more/{page-333bba1c8bbc9c11.js → page-353a3924e6d7968e.js} +1 -1
- package/.next/static/chunks/app/{page-214f7ffa13a0cf10.js → page-c2bf871d953a1d6f.js} +1 -1
- package/.next/static/chunks/app/repositories/{page-4951cac905e50224.js → page-7d0f26df0537254c.js} +1 -1
- package/.next/static/chunks/app/review/{page-a0899b2d285318c3.js → page-e3f141b2829973e9.js} +1 -1
- package/.next/static/chunks/app/sessions/{page-fb36145ec732092a.js → page-53f188ed9ca49e5f.js} +1 -1
- package/.next/static/chunks/app/skills/[skillId]/{page-9099e26b60442873.js → page-80569b720aea59cc.js} +1 -1
- package/.next/static/chunks/app/skills/installed/{page-182e32368696d824.js → page-dbd2690ad72da95b.js} +1 -1
- package/.next/static/chunks/app/skills/{page-d3fdc88239ebe0ab.js → page-dacd36f9c11aa7da.js} +1 -1
- package/.next/static/chunks/app/worktrees/[id]/page-97205088520255a5.js +1 -0
- package/.next/static/css/5c13ea243dfdcb66.css +1 -0
- package/.next/trace +13 -13
- package/README.md +37 -11
- package/dist/cli/commands/attach.d.ts +50 -0
- package/dist/cli/commands/attach.d.ts.map +1 -0
- package/dist/cli/commands/attach.js +204 -0
- package/dist/cli/commands/capture.d.ts.map +1 -1
- package/dist/cli/commands/capture.js +114 -0
- package/dist/cli/commands/instances.d.ts.map +1 -1
- package/dist/cli/commands/instances.js +23 -2
- package/dist/cli/commands/ls.d.ts.map +1 -1
- package/dist/cli/commands/ls.js +41 -1
- package/dist/cli/config/cli-dependencies.d.ts.map +1 -1
- package/dist/cli/config/cli-dependencies.js +34 -0
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +5 -0
- package/dist/cli/types/index.d.ts +36 -0
- package/dist/cli/types/index.d.ts.map +1 -1
- package/dist/config/tmux-pane-config.d.ts +153 -0
- package/dist/config/tmux-pane-config.d.ts.map +1 -0
- package/dist/config/tmux-pane-config.js +172 -0
- package/dist/lib/cli-tools/session-name.d.ts +44 -0
- package/dist/lib/cli-tools/session-name.d.ts.map +1 -0
- package/dist/lib/cli-tools/session-name.js +57 -0
- package/dist/lib/cli-tools/types.d.ts +1 -1
- package/dist/lib/cli-tools/types.d.ts.map +1 -1
- package/dist/lib/cli-tools/types.js +6 -1
- package/dist/lib/cli-tools/validation.d.ts +34 -0
- package/dist/lib/cli-tools/validation.d.ts.map +1 -0
- package/dist/lib/cli-tools/validation.js +41 -0
- package/dist/lib/detection/status-reason.d.ts +18 -0
- package/dist/lib/detection/status-reason.d.ts.map +1 -1
- package/dist/lib/detection/status-reason.js +18 -0
- package/dist/lib/detection/tools/verified-against.d.ts +57 -7
- package/dist/lib/detection/tools/verified-against.d.ts.map +1 -1
- package/dist/lib/detection/tools/verified-against.js +59 -8
- package/dist/lib/detection/version-probes.d.ts +26 -5
- package/dist/lib/detection/version-probes.d.ts.map +1 -1
- package/dist/lib/detection/version-probes.js +28 -6
- package/dist/lib/session/tmux-session-surface.d.ts +369 -0
- package/dist/lib/session/tmux-session-surface.d.ts.map +1 -0
- package/dist/lib/session/tmux-session-surface.js +525 -0
- package/dist/server/src/config/cli-tool-timing-config.js +12 -1
- package/dist/server/src/config/detection-evidence-config.js +5 -0
- package/dist/server/src/config/schedule-config.js +28 -1
- package/dist/server/src/lib/cli-tools/antigravity.js +2 -2
- package/dist/server/src/lib/cli-tools/base.js +13 -8
- package/dist/server/src/lib/cli-tools/claude.js +20 -0
- package/dist/server/src/lib/cli-tools/codex.js +205 -61
- package/dist/server/src/lib/cli-tools/command-code.js +349 -0
- package/dist/server/src/lib/cli-tools/composer-spec.js +6 -0
- package/dist/server/src/lib/cli-tools/copilot.js +2 -2
- package/dist/server/src/lib/cli-tools/gemini.js +2 -2
- package/dist/server/src/lib/cli-tools/graceful-exit.js +16 -1
- package/dist/server/src/lib/cli-tools/index.js +4 -1
- package/dist/server/src/lib/cli-tools/install-hints.js +131 -0
- package/dist/server/src/lib/cli-tools/liveness-spec.js +18 -0
- package/dist/server/src/lib/cli-tools/manager.js +2 -0
- package/dist/server/src/lib/cli-tools/opencode.js +2 -2
- package/dist/server/src/lib/cli-tools/start-availability.js +18 -11
- package/dist/server/src/lib/cli-tools/types.js +6 -1
- package/dist/server/src/lib/cli-tools/vibe-local.js +2 -2
- package/dist/server/src/lib/cmate-parser.js +6 -0
- package/dist/server/src/lib/detection/cli-patterns.js +441 -8
- package/dist/server/src/lib/detection/opencode-modal-overlay.js +66 -100
- package/dist/server/src/lib/detection/selection-shape.js +341 -0
- package/dist/server/src/lib/detection/sgr-background.js +210 -0
- package/dist/server/src/lib/detection/status-detector.js +6 -0
- package/dist/server/src/lib/detection/status-reason.js +18 -0
- package/dist/server/src/lib/detection/tools/antigravity/detect.js +38 -15
- package/dist/server/src/lib/detection/tools/codex/cli-patterns.js +392 -0
- package/dist/server/src/lib/detection/tools/codex/detect.js +83 -2
- package/dist/server/src/lib/detection/tools/command-code/detect.js +159 -0
- package/dist/server/src/lib/detection/tools/registry.js +6 -4
- package/dist/server/src/lib/detection/tools/verified-against.js +59 -8
- package/dist/server/src/lib/detection/version-probes.js +28 -6
- package/dist/server/src/lib/hooks/sources/antigravity/history.js +77 -16
- package/dist/server/src/lib/hooks/sources/claude/history.js +94 -18
- package/dist/server/src/lib/hooks/sources/codex/history.js +84 -15
- package/dist/server/src/lib/hooks/sources/codex/hooks-config.js +130 -17
- package/dist/server/src/lib/hooks/sources/codex/relay-install.js +145 -0
- package/dist/server/src/lib/hooks/sources/command-code/history.js +865 -0
- package/dist/server/src/lib/hooks/sources/command-code/hooks-config.js +390 -0
- package/dist/server/src/lib/hooks/sources/command-code/source.js +290 -0
- package/dist/server/src/lib/hooks/sources/command-code/tool-id.js +18 -0
- package/dist/server/src/lib/hooks/sources/command-code/transcript.js +604 -0
- package/dist/server/src/lib/hooks/sources/index.js +3 -1
- package/dist/server/src/lib/hooks/sources/opencode/history.js +57 -3
- package/dist/server/src/lib/hooks/sources/opencode/transcript.js +24 -28
- package/dist/server/src/lib/hooks/sources/registry.js +4 -0
- package/dist/server/src/lib/hooks/sources/turn-body.js +77 -19
- package/dist/server/src/lib/job-executor.js +12 -0
- package/dist/server/src/lib/polling/auto-yes-dialog-gate.js +6 -0
- package/dist/server/src/lib/polling/response-checker.js +112 -7
- package/dist/server/src/lib/polling/structured-history-gate.js +15 -8
- package/dist/server/src/lib/realtime/types.js +15 -5
- package/dist/server/src/lib/response-cleaner.js +24 -1
- package/dist/server/src/lib/response-extractor.js +11 -0
- package/dist/server/src/lib/session/claude-executor.js +223 -4
- package/dist/server/src/lib/session/cli-session.js +52 -0
- package/dist/server/src/lib/session/tmux-session-surface.js +525 -0
- package/dist/server/src/lib/skills/compatibility-matrix.js +117 -1
- package/dist/server/src/lib/tmux/geometry-delegation.js +143 -0
- package/dist/server/src/lib/tmux/read-mode-pager.js +76 -10
- package/dist/server/src/lib/tmux/read-mode.js +44 -2
- package/dist/server/src/lib/tmux/session-hook-scripts.js +249 -0
- package/dist/server/src/lib/tmux/session-hooks.js +122 -0
- package/dist/server/src/lib/tmux/session-status-options.js +213 -0
- package/dist/server/src/lib/tmux/tmux.js +79 -2
- package/dist/server/src/lib/version-checker.js +110 -0
- package/dist/server/src/lib/ws-server.js +16 -10
- package/dist/server/src/types/agent-transcript.js +73 -1
- package/dist/server/src/types/terminal-keys.js +131 -3
- package/dist/types/terminal-keys.d.ts +100 -3
- package/dist/types/terminal-keys.d.ts.map +1 -1
- package/dist/types/terminal-keys.js +131 -3
- package/package.json +1 -1
- package/.next/server/chunks/3099.js +0 -5
- package/.next/server/chunks/7824.js +0 -1
- package/.next/static/chunks/3916-0e929d089282dc5d.js +0 -1
- package/.next/static/chunks/6022-7a7d1760fc9814c7.js +0 -1
- package/.next/static/chunks/6381-147dde2a967e9458.js +0 -1
- package/.next/static/chunks/app/layout-6a26ea22d5cf03dc.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/page-2f73d69187936627.js +0 -1
- package/.next/static/css/23f9c40ecc458c77.css +0 -1
- /package/.next/static/{QXxQbXWoo7ldUyOcv7PCZ → nXW4dPkpE_9xUf_9ySRff}/_buildManifest.js +0 -0
- /package/.next/static/{QXxQbXWoo7ldUyOcv7PCZ → nXW4dPkpE_9xUf_9ySRff}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The hooks CommandMate writes into `<worktree>/.commandcode/settings.local.json`,
|
|
4
|
+
* and the environment that launches Command Code against them (Issue #2251,
|
|
5
|
+
* Epic #2249 Phase B).
|
|
6
|
+
*
|
|
7
|
+
* The file shape is Claude's — `{"hooks":{"<Event>":[{matcher, hooks:[{type,
|
|
8
|
+
* command, timeout}]}]}}` — so this is gemini's generator with four differences,
|
|
9
|
+
* every one of which was measured against **v1.40.1** rather than inferred from
|
|
10
|
+
* the shape.
|
|
11
|
+
*
|
|
12
|
+
* ## 1. There are exactly four events, and the validator says so
|
|
13
|
+
*
|
|
14
|
+
* `dist/cli.mjs` carries `["PreToolUse","PostToolUse","Stop","SessionStart"]` as
|
|
15
|
+
* the list `isHookEvent` tests against, and `loadOne` warns and *skips* anything
|
|
16
|
+
* else (`unknown hook event "…" — skipped`). That is a stronger statement than
|
|
17
|
+
* the spike's "we configured `SessionEnd` and never saw one": the word is not
|
|
18
|
+
* merely unemitted, it is rejected at load. See
|
|
19
|
+
* {@link COMMAND_CODE_REGISTERED_HOOKS}.
|
|
20
|
+
*
|
|
21
|
+
* ## 2. `matcher` must be the EMPTY STRING, and `"*"` silently kills two events
|
|
22
|
+
*
|
|
23
|
+
* The single most consequential line in this module, and the one that fails with
|
|
24
|
+
* no error anywhere. Command Code selects handlers with:
|
|
25
|
+
*
|
|
26
|
+
* ```js
|
|
27
|
+
* for (const h of hooks) if (h.event === event) {
|
|
28
|
+
* if (h.matcher) { // ← an empty string is FALSY
|
|
29
|
+
* if (!toolName) continue; // ← SessionStart/Stop run with toolName ""
|
|
30
|
+
* …regex test…
|
|
31
|
+
* }
|
|
32
|
+
* selected.push(h)
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* `SessionStart` and `Stop` are invoked with `toolName: ""`, so **any non-empty
|
|
37
|
+
* matcher removes them entirely** — including `"*"`, which the *loader* accepts
|
|
38
|
+
* (it is special-cased to a match-everything regex, so no warning is printed).
|
|
39
|
+
* Measured live, two runs in an isolated tmux socket against the same session:
|
|
40
|
+
*
|
|
41
|
+
* ```text
|
|
42
|
+
* matcher "" → ◼ Ran 2 session start hooks (both layers fired)
|
|
43
|
+
* matcher "*" → ◼ Ran 1 session start hook (only the "" layer fired)
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* So {@link COMMAND_CODE_MATCH_ALL_MATCHER} is `''`, and it is not the same
|
|
47
|
+
* choice antigravity made (`'*'`, where the matcher is a tool-name glob and
|
|
48
|
+
* every registered event carries a tool name).
|
|
49
|
+
*
|
|
50
|
+
* ## 3. The three config layers are UNIONED, not overridden
|
|
51
|
+
*
|
|
52
|
+
* `loadSettingsHooks` reads `<cwd>/.commandcode/settings.local.json`, then
|
|
53
|
+
* `<cwd>/.commandcode/settings.json`, then `~/.commandcode/settings.json`, and
|
|
54
|
+
* appends every handler from all three into one flat list — deduplicated only by
|
|
55
|
+
* `${event}:${matcher}:${command}`. Measured: two layers registering
|
|
56
|
+
* *different* commands for `SessionStart` both ran (`Ran 2 session start hooks`).
|
|
57
|
+
*
|
|
58
|
+
* This is why the file below is `settings.local.json` and not `settings.json`:
|
|
59
|
+
*
|
|
60
|
+
* - **A user's hooks cannot be lost either way.** Union across layers means a
|
|
61
|
+
* `settings.json` CommandMate never touches keeps firing, and the in-file
|
|
62
|
+
* merge below keeps the ones in the file it *does* touch.
|
|
63
|
+
* - **`settings.json` is the shared, reviewable file** — the one a team checks
|
|
64
|
+
* in, and the one Command Code's own settings writer labels `projectShared`.
|
|
65
|
+
* Putting an absolute, machine-local relay path into it would put CommandMate
|
|
66
|
+
* installation details into someone's code review.
|
|
67
|
+
* - **`settings.local.json` is Command Code's own machine-local scope**
|
|
68
|
+
* (`projectLocal`), and its worktree helper *copies* the file into a new
|
|
69
|
+
* worktree rather than relying on git to carry it — i.e. the tool itself
|
|
70
|
+
* treats it as untracked.
|
|
71
|
+
*
|
|
72
|
+
* ## 4. It does not make the worktree dirty in a way Command Code does not
|
|
73
|
+
*
|
|
74
|
+
* `.commandcode/` is **not** ignored by git — measured in this repository and in
|
|
75
|
+
* a throwaway `git init`, `git status` reports `?? .commandcode/`. That is the
|
|
76
|
+
* answer to Epic #2249's 未確定事項 4, and it is not caused by this file:
|
|
77
|
+
* Command Code writes `.commandcode/taste/taste.md` itself on the first launch,
|
|
78
|
+
* so the directory is untracked-and-present the moment the agent runs at all.
|
|
79
|
+
* What this module adds is one more file inside a directory the tool already
|
|
80
|
+
* created. gemini has the same property (`<worktree>/.gemini/settings.json`) and
|
|
81
|
+
* the same resolution: write the smallest thing, merge rather than replace, and
|
|
82
|
+
* leave the ignoring to the operator.
|
|
83
|
+
*
|
|
84
|
+
* ## What the reply may say, and why the relay is safe on all four
|
|
85
|
+
*
|
|
86
|
+
* `resolveHookExit` treats **exit code 2 on `PreToolUse` or `Stop` as a block**,
|
|
87
|
+
* and a `decision: "block"` on `PostToolUse`/`Stop` as a retry request.
|
|
88
|
+
* `scripts/hooks/cmate-agent-event.sh` writes nothing to stdout and exits 0 on
|
|
89
|
+
* every delivery failure, so neither path is reachable from a server that is
|
|
90
|
+
* down — which is what makes registering `Stop` on the relay safe here even
|
|
91
|
+
* though its reply can prevent a turn from ending.
|
|
92
|
+
*
|
|
93
|
+
* @module lib/hooks/sources/command-code/hooks-config
|
|
94
|
+
*/
|
|
95
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
96
|
+
exports.COMMAND_CODE_HOOK_TIMEOUT_SECONDS = exports.COMMAND_CODE_REGISTERED_HOOKS = exports.COMMAND_CODE_MATCH_ALL_MATCHER = exports.COMMAND_CODE_SETTINGS_FILENAME = exports.COMMAND_CODE_CONFIG_DIRNAME = void 0;
|
|
97
|
+
exports.getCommandCodeSettingsPath = getCommandCodeSettingsPath;
|
|
98
|
+
exports.buildCommandCodeHookCommand = buildCommandCodeHookCommand;
|
|
99
|
+
exports.isCommandMateHookCommand = isCommandMateHookCommand;
|
|
100
|
+
exports.buildCommandCodeHookGroups = buildCommandCodeHookGroups;
|
|
101
|
+
exports.mergeCommandCodeHookSettings = mergeCommandCodeHookSettings;
|
|
102
|
+
exports.writeCommandCodeHookSettings = writeCommandCodeHookSettings;
|
|
103
|
+
exports.buildCommandCodeLaunchEnvironment = buildCommandCodeLaunchEnvironment;
|
|
104
|
+
const path_1 = require("path");
|
|
105
|
+
const types_1 = require("../../../../lib/cli-tools/types");
|
|
106
|
+
const hook_settings_generator_1 = require("../../../../lib/hooks/hook-settings-generator");
|
|
107
|
+
const logger_1 = require("../../../../lib/logger");
|
|
108
|
+
const event_mapper_1 = require("../event-mapper");
|
|
109
|
+
const launch_command_1 = require("../launch-command");
|
|
110
|
+
// Generic non-destructive JSON config IO. It lives under `gemini/` because that
|
|
111
|
+
// is the tree it was written for, but nothing in it is gemini-specific and
|
|
112
|
+
// `antigravity/hooks-config` already reaches for it across the same edge. A
|
|
113
|
+
// second copy here would be a second implementation of "we do not clobber the
|
|
114
|
+
// user's file", which is the one thing this module must not get wrong twice.
|
|
115
|
+
const shared_config_tree_1 = require("../gemini/shared-config-tree");
|
|
116
|
+
const tool_id_1 = require("./tool-id");
|
|
117
|
+
const logger = (0, logger_1.createLogger)('lib/hooks/sources/command-code/hooks-config');
|
|
118
|
+
/** Directory Command Code reads project configuration from, relative to the worktree. */
|
|
119
|
+
exports.COMMAND_CODE_CONFIG_DIRNAME = '.commandcode';
|
|
120
|
+
/**
|
|
121
|
+
* The layer CommandMate writes.
|
|
122
|
+
*
|
|
123
|
+
* `settings.local.json`, not `settings.json` — see the module comment's §3 for
|
|
124
|
+
* the three reasons and the measurement behind each.
|
|
125
|
+
*/
|
|
126
|
+
exports.COMMAND_CODE_SETTINGS_FILENAME = 'settings.local.json';
|
|
127
|
+
/**
|
|
128
|
+
* The matcher every handler carries: **the empty string**.
|
|
129
|
+
*
|
|
130
|
+
* Not cosmetic and not a placeholder. `''` is the only value that leaves
|
|
131
|
+
* `SessionStart` and `Stop` firing, because Command Code's handler selection
|
|
132
|
+
* tests `if (handler.matcher)` and then requires a tool name — and those two
|
|
133
|
+
* events run with none. `'*'` loads without a warning and removes both. See §2
|
|
134
|
+
* of the module comment for the two live runs.
|
|
135
|
+
*/
|
|
136
|
+
exports.COMMAND_CODE_MATCH_ALL_MATCHER = '';
|
|
137
|
+
/**
|
|
138
|
+
* The Command Code events CommandMate registers, and the word each relay call
|
|
139
|
+
* reports.
|
|
140
|
+
*
|
|
141
|
+
* All four of them, which is *every* event the tool has: its bundled
|
|
142
|
+
* `isHookEvent` tests against exactly `PreToolUse` / `PostToolUse` / `Stop` /
|
|
143
|
+
* `SessionStart` and skips anything else with a warning. There is no
|
|
144
|
+
* `UserPromptSubmit`, no `Notification` and no `SessionEnd` to leave out.
|
|
145
|
+
*
|
|
146
|
+
* `PreToolUse` is on this list and NOT pointed at the permission receiver, which
|
|
147
|
+
* is the opposite of what copilot and antigravity do with the same spelling.
|
|
148
|
+
* Epic #2249 決定 3 is why: Command Code fires `PreToolUse` **after** the
|
|
149
|
+
* approval dialog has been answered (measured — dialog drawn 00:11:37, answered
|
|
150
|
+
* 00:11:46, hook fired 00:11:46), so its reply cannot forecast a dialog, cannot
|
|
151
|
+
* dismiss one, and is only an observation. Registered as an observation, then.
|
|
152
|
+
*
|
|
153
|
+
* Ordered as the file is written, so a diff of two generated files reads in one
|
|
154
|
+
* direction.
|
|
155
|
+
*/
|
|
156
|
+
exports.COMMAND_CODE_REGISTERED_HOOKS = [
|
|
157
|
+
['SessionStart', 'session_start'],
|
|
158
|
+
['PreToolUse', 'pre_tool_use'],
|
|
159
|
+
['PostToolUse', 'post_tool_use'],
|
|
160
|
+
['Stop', 'stop'],
|
|
161
|
+
];
|
|
162
|
+
/**
|
|
163
|
+
* Handler timeout, **in seconds** — the unit gemini does not use.
|
|
164
|
+
*
|
|
165
|
+
* Command Code's own validator is explicit about the range: `translateHandler`
|
|
166
|
+
* skips a handler whose `timeout` is not a number in `(0, 600]`, with the
|
|
167
|
+
* warning `timeout must be a number in (0, 600]`. The default when the field is
|
|
168
|
+
* absent is 30. {@link HOOK_TIMEOUT_SECONDS} is 5, well inside it, and is the
|
|
169
|
+
* same number every other seconds-denominated tool uses so the budget stays one
|
|
170
|
+
* figure.
|
|
171
|
+
*/
|
|
172
|
+
exports.COMMAND_CODE_HOOK_TIMEOUT_SECONDS = hook_settings_generator_1.HOOK_TIMEOUT_SECONDS;
|
|
173
|
+
/** Absolute path of the settings layer CommandMate writes for one worktree. */
|
|
174
|
+
function getCommandCodeSettingsPath(worktreePath) {
|
|
175
|
+
return (0, path_1.join)(worktreePath, exports.COMMAND_CODE_CONFIG_DIRNAME, exports.COMMAND_CODE_SETTINGS_FILENAME);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* The relay invocation for one event.
|
|
179
|
+
*
|
|
180
|
+
* `--event` is passed explicitly even though Command Code's payload carries
|
|
181
|
+
* `hook_event_name` in the CamelCase dialect the relay already maps: an argument
|
|
182
|
+
* the generator wrote cannot drift with the tool's spelling, and it removes the
|
|
183
|
+
* one path in `cmate-agent-event.sh` that `die`s (exit 2) on an unrecognised
|
|
184
|
+
* name — which on `PreToolUse` and `Stop` is how Command Code spells *block*.
|
|
185
|
+
*
|
|
186
|
+
* No `--url`. The endpoint comes from `CM_HOOK_URL`, which
|
|
187
|
+
* {@link buildCommandCodeLaunchEnvironment} puts in the session's environment
|
|
188
|
+
* with the instance baked in; passing `--url` here would override it from a file
|
|
189
|
+
* that cannot know which instance it is serving. `--worktree-id` *is* baked in,
|
|
190
|
+
* because the file already is per-worktree and a body that names the worktree
|
|
191
|
+
* keeps working when the environment does not reach the hook.
|
|
192
|
+
*
|
|
193
|
+
* @param relayPath - Absolute path to the relay script
|
|
194
|
+
* @param event - The word to report
|
|
195
|
+
* @param worktreeId - CommandMate's worktree id
|
|
196
|
+
*/
|
|
197
|
+
function buildCommandCodeHookCommand(relayPath, event, worktreeId) {
|
|
198
|
+
return [
|
|
199
|
+
(0, hook_settings_generator_1.shellQuote)(relayPath),
|
|
200
|
+
'--tool',
|
|
201
|
+
tool_id_1.COMMAND_CODE_CLI_TOOL_ID,
|
|
202
|
+
'--event',
|
|
203
|
+
event,
|
|
204
|
+
'--worktree-id',
|
|
205
|
+
(0, hook_settings_generator_1.shellQuote)(worktreeId),
|
|
206
|
+
'--stdin-json',
|
|
207
|
+
].join(' ');
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Whether a command string is one CommandMate wrote for this worktree.
|
|
211
|
+
*
|
|
212
|
+
* Used to replace our own entries on rewrite instead of appending a duplicate
|
|
213
|
+
* set at every launch. Three tokens have to be present together — the relay's
|
|
214
|
+
* name, this tool, and this worktree id — so a hook the operator wrote for a
|
|
215
|
+
* *different* worktree, or for another tool, or with their own script, is left
|
|
216
|
+
* alone.
|
|
217
|
+
*
|
|
218
|
+
* The same predicate gemini uses, and it matters more here: Command Code
|
|
219
|
+
* deduplicates identical handlers across its three layers by
|
|
220
|
+
* `${event}:${matcher}:${command}`, so an accumulated duplicate inside one file
|
|
221
|
+
* would *not* be folded away — the strings are identical, but they would be
|
|
222
|
+
* identical entries in the same array, and the dedup set is keyed on the string
|
|
223
|
+
* so the second copy is dropped. What accumulation would still cost is a file
|
|
224
|
+
* that grows without bound.
|
|
225
|
+
*/
|
|
226
|
+
function isCommandMateHookCommand(command, worktreeId) {
|
|
227
|
+
return (command.includes('cmate-agent-event.sh') &&
|
|
228
|
+
command.includes(`--tool ${tool_id_1.COMMAND_CODE_CLI_TOOL_ID}`) &&
|
|
229
|
+
command.includes(`--worktree-id ${(0, hook_settings_generator_1.shellQuote)(worktreeId)}`));
|
|
230
|
+
}
|
|
231
|
+
/** Whether one entry of a `hooks[<Event>]` array is CommandMate's. */
|
|
232
|
+
function isCommandMateGroup(group, worktreeId) {
|
|
233
|
+
if (!(0, event_mapper_1.isPlainObject)(group))
|
|
234
|
+
return false;
|
|
235
|
+
const handlers = group.hooks;
|
|
236
|
+
if (Array.isArray(handlers)) {
|
|
237
|
+
return (handlers.length > 0 &&
|
|
238
|
+
handlers.every((handler) => (0, event_mapper_1.isPlainObject)(handler) &&
|
|
239
|
+
typeof handler.command === 'string' &&
|
|
240
|
+
isCommandMateHookCommand(handler.command, worktreeId)));
|
|
241
|
+
}
|
|
242
|
+
// A flat handler. Command Code rejects that shape (`translateGroups` requires
|
|
243
|
+
// `hooks` to be an array and warns otherwise), so this is not something we
|
|
244
|
+
// could have written — but recognising it costs one line and means a
|
|
245
|
+
// hand-flattened copy of ours is replaced rather than left to be skipped
|
|
246
|
+
// forever with a warning the operator never reads.
|
|
247
|
+
return typeof group.command === 'string' && isCommandMateHookCommand(group.command, worktreeId);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* The `hooks` entries CommandMate contributes, keyed by Command Code's event name.
|
|
251
|
+
*
|
|
252
|
+
* @param relayPath - Absolute path to the relay script
|
|
253
|
+
* @param target - The instance being started; only its worktree reaches the file
|
|
254
|
+
* @returns One matcher group per registered event
|
|
255
|
+
*/
|
|
256
|
+
function buildCommandCodeHookGroups(relayPath, target) {
|
|
257
|
+
const groups = {};
|
|
258
|
+
for (const [nativeName, event] of exports.COMMAND_CODE_REGISTERED_HOOKS) {
|
|
259
|
+
groups[nativeName] = [
|
|
260
|
+
{
|
|
261
|
+
// The empty string, and it has to be. See COMMAND_CODE_MATCH_ALL_MATCHER.
|
|
262
|
+
matcher: exports.COMMAND_CODE_MATCH_ALL_MATCHER,
|
|
263
|
+
hooks: [
|
|
264
|
+
{
|
|
265
|
+
type: 'command',
|
|
266
|
+
command: buildCommandCodeHookCommand(relayPath, event, target.worktreeId),
|
|
267
|
+
// Seconds. Command Code's validator rejects anything outside (0, 600].
|
|
268
|
+
timeout: exports.COMMAND_CODE_HOOK_TIMEOUT_SECONDS,
|
|
269
|
+
},
|
|
270
|
+
],
|
|
271
|
+
},
|
|
272
|
+
];
|
|
273
|
+
}
|
|
274
|
+
return groups;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Put CommandMate's hooks into an existing settings object without disturbing
|
|
278
|
+
* anything else in it.
|
|
279
|
+
*
|
|
280
|
+
* Pure, so the guarantee this module exists for is checked without a
|
|
281
|
+
* filesystem. The rules, which are gemini's:
|
|
282
|
+
*
|
|
283
|
+
* - every top-level key other than `hooks` is passed through by identity, in
|
|
284
|
+
* its original position — `permissions`, `disabledSkills`, `mods` and
|
|
285
|
+
* whatever else Command Code grows next;
|
|
286
|
+
* - inside `hooks`, an event CommandMate does not register is passed through
|
|
287
|
+
* **by identity**, including values that are not arrays;
|
|
288
|
+
* - inside an event CommandMate does register, the user's groups are kept and
|
|
289
|
+
* ours are replaced.
|
|
290
|
+
*
|
|
291
|
+
* @param existing - The parsed settings file, or null when there is none
|
|
292
|
+
* @param groups - What {@link buildCommandCodeHookGroups} produced
|
|
293
|
+
* @param worktreeId - Identifies our own previous entries
|
|
294
|
+
* @returns The object to serialise
|
|
295
|
+
*/
|
|
296
|
+
function mergeCommandCodeHookSettings(existing, groups, worktreeId) {
|
|
297
|
+
const existingHooks = (0, event_mapper_1.isPlainObject)(existing?.hooks) ? existing.hooks : {};
|
|
298
|
+
const merged = {};
|
|
299
|
+
for (const [nativeName, value] of Object.entries(existingHooks)) {
|
|
300
|
+
if (!Array.isArray(value)) {
|
|
301
|
+
merged[nativeName] = value;
|
|
302
|
+
continue;
|
|
303
|
+
}
|
|
304
|
+
const kept = value.filter((group) => !isCommandMateGroup(group, worktreeId));
|
|
305
|
+
// Identity when nothing of ours was in there, so an untouched event is
|
|
306
|
+
// untouched down to the array instance.
|
|
307
|
+
merged[nativeName] = kept.length === value.length ? value : kept;
|
|
308
|
+
}
|
|
309
|
+
for (const [nativeName, ours] of Object.entries(groups)) {
|
|
310
|
+
const kept = merged[nativeName];
|
|
311
|
+
merged[nativeName] = Array.isArray(kept) ? [...kept, ...ours] : [...ours];
|
|
312
|
+
}
|
|
313
|
+
return { ...existing, hooks: merged };
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Write `<worktree>/.commandcode/settings.local.json`.
|
|
317
|
+
*
|
|
318
|
+
* @param worktreePath - Absolute path of the worktree Command Code will run in
|
|
319
|
+
* @param target - The instance being started
|
|
320
|
+
* @returns The path written, or null when injection is off or not possible
|
|
321
|
+
*/
|
|
322
|
+
function writeCommandCodeHookSettings(worktreePath, target) {
|
|
323
|
+
if (!(0, hook_settings_generator_1.isHookInjectionEnabled)())
|
|
324
|
+
return null;
|
|
325
|
+
const relayPath = (0, hook_settings_generator_1.resolveRelayScriptPath)();
|
|
326
|
+
if (!relayPath) {
|
|
327
|
+
// No inline-`curl` fallback, for gemini's reason: a fallback would post the
|
|
328
|
+
// agent's payload verbatim and rely on the URL to say which tool sent it,
|
|
329
|
+
// and the URL here lives in an environment variable a settings file cannot
|
|
330
|
+
// read. A Command Code session with no hooks is the Phase A status quo; one
|
|
331
|
+
// posting events nothing can attribute is worse.
|
|
332
|
+
logger.warn('command-code-hook-relay-missing', { worktreeId: target.worktreeId });
|
|
333
|
+
return null;
|
|
334
|
+
}
|
|
335
|
+
const settingsPath = getCommandCodeSettingsPath(worktreePath);
|
|
336
|
+
try {
|
|
337
|
+
const existing = (0, shared_config_tree_1.readJsonObjectFile)(settingsPath);
|
|
338
|
+
const groups = buildCommandCodeHookGroups(relayPath, target);
|
|
339
|
+
(0, shared_config_tree_1.writeJsonObjectFile)(settingsPath, mergeCommandCodeHookSettings(existing, groups, target.worktreeId));
|
|
340
|
+
return settingsPath;
|
|
341
|
+
}
|
|
342
|
+
catch (error) {
|
|
343
|
+
// Fail-open, like every other part of this path: the events are an
|
|
344
|
+
// enhancement to a session that has to start regardless.
|
|
345
|
+
logger.warn('command-code-hook-settings-write-failed', {
|
|
346
|
+
worktreeId: target.worktreeId,
|
|
347
|
+
error: error instanceof Error ? error.message : String(error),
|
|
348
|
+
});
|
|
349
|
+
return null;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* The command and environment that launch Command Code for one instance.
|
|
354
|
+
*
|
|
355
|
+
* `CM_HOOK_URL` is the whole of the instance correlation, and it is an
|
|
356
|
+
* environment variable rather than a value baked into the settings file for the
|
|
357
|
+
* reason the file cannot get around: `.commandcode/settings.local.json` is per
|
|
358
|
+
* *worktree*, and `command-code` and `command-code-2` share it. Measured, not
|
|
359
|
+
* assumed, that this reaches the handler: the spike's relay printed
|
|
360
|
+
* `CM_HOOK_URL=http://127.0.0.1:9/probe` from inside the hook process on all
|
|
361
|
+
* seven captured events, so the launching shell's environment does propagate.
|
|
362
|
+
* Command Code also injects `COMMANDCODE_SESSION_ID` / `COMMANDCODE_PROJECT_DIR`
|
|
363
|
+
* / `COMMANDCODE_HOOK_EVENT` / `COMMANDCODE_PERMISSION_MODE` of its own, none of
|
|
364
|
+
* which CommandMate reads — the payload on stdin carries the same facts.
|
|
365
|
+
*
|
|
366
|
+
* A `{ command, env }` pair rather than one prefixed string (#1846), so
|
|
367
|
+
* `renderAgentLaunchCommand` is the only thing that writes a shell assignment
|
|
368
|
+
* and `CommandCodeTool` can append `--trust --skip-onboarding --no-auto-update`
|
|
369
|
+
* after the rendered line without the assignments moving.
|
|
370
|
+
*
|
|
371
|
+
* Never throws, and returns the executable with an empty environment when
|
|
372
|
+
* injection is off, so `CM_AGENT_HOOKS_INJECT=0` produces the byte-identical
|
|
373
|
+
* command line Phase A shipped.
|
|
374
|
+
*
|
|
375
|
+
* @param executablePath - `commandcode`, or a resolved path to it
|
|
376
|
+
* @param target - The instance being started
|
|
377
|
+
* @returns The command to type into the pane and the environment it needs
|
|
378
|
+
*/
|
|
379
|
+
function buildCommandCodeLaunchEnvironment(executablePath, target, options = {}) {
|
|
380
|
+
if (!(0, hook_settings_generator_1.isHookInjectionEnabled)())
|
|
381
|
+
return { command: executablePath, env: {} };
|
|
382
|
+
if (!(0, types_1.isValidInstanceId)((0, hook_settings_generator_1.resolveTargetInstanceId)(target))) {
|
|
383
|
+
// About to become a URL parameter the receiver re-validates; a value that
|
|
384
|
+
// would be rejected there is not worth injecting.
|
|
385
|
+
logger.warn('command-code-hook-invalid-instance-id', { worktreeId: target.worktreeId });
|
|
386
|
+
return { command: executablePath, env: {} };
|
|
387
|
+
}
|
|
388
|
+
const url = (0, hook_settings_generator_1.buildAgentEventUrl)({ ...target, cliToolId: tool_id_1.COMMAND_CODE_CLI_TOOL_ID }, options);
|
|
389
|
+
return { command: (0, hook_settings_generator_1.shellQuote)(executablePath), env: { [launch_command_1.AGENT_EVENT_URL_ENV_VAR]: url } };
|
|
390
|
+
}
|