commandmate 0.42.2 → 0.44.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 +176 -176
- package/.next/app-path-routes-manifest.json +34 -34
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +15 -15
- 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.js.nft.json +1 -1
- package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/versions/route.js.nft.json +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.js +2 -2
- package/.next/server/app/api/app/update/route.js.nft.json +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.js.nft.json +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.js +1 -1
- package/.next/server/app/api/daily-summary/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/daily-summary/status/route.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +1 -1
- package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/browse/route.js.nft.json +1 -1
- package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/recent-paths/route.js.nft.json +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 +103 -1
- package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/claude-done/route.js +2 -2
- package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/permission-request/route.js +1 -1
- package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/metrics/vibe/route.js.nft.json +1 -1
- package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/escalation/route.js +1 -1
- package/.next/server/app/api/push/escalation/route.js.nft.json +1 -1
- package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/subscriptions/route.js.nft.json +1 -1
- package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/vapid/route.js +1 -1
- package/.next/server/app/api/push/vapid/route.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +1 -1
- package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/default-agents/route.js +1 -1
- package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/default-surface-mode/route.js.nft.json +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.js.nft.json +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.js.nft.json +1 -1
- package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/installations/route.js +1 -1
- package/.next/server/app/api/skills/installations/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/operations/route.js +2 -2
- package/.next/server/app/api/skills/operations/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/reindex/route.js +1 -1
- package/.next/server/app/api/skills/reindex/route.js.nft.json +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.js.nft.json +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.js.nft.json +1 -1
- package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/cancel/route.js.nft.json +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.js.nft.json +1 -1
- package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/route.js.nft.json +1 -1
- package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verification/runs/[runId]/route.js.nft.json +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.js.nft.json +1 -1
- package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-reference/route.js.nft.json +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.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js +3 -1
- package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js.nft.json +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.js.nft.json +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.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/route.js +3 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/route.js.nft.json +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.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branches/route.js.nft.json +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.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/commit/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/diff/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/fetch/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/log/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/pull/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/push/route.js.nft.json +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.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/revert/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stage/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/staged/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/status/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/unstage/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js.nft.json +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.js.nft.json +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 +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.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/route.js.nft.json +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 +7 -7
- package/.next/server/app/api/worktrees/[id]/marp-render/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/messages/route.js.nft.json +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.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/session/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/session/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/share/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/share/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/resolve-target/route.js.nft.json +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 -103
- 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 +3 -1
- package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/active/route.js +3 -1
- package/.next/server/app/api/worktrees/[id]/schedules/active/route.js.nft.json +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 +3 -1
- package/.next/server/app/api/worktrees/[id]/schedules/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/search/route.js.nft.json +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 -103
- 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 +103 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/route.js.nft.json +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.js.nft.json +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.js.nft.json +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 +103 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/history/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js.nft.json +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.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/apply-default-agents/route.js.nft.json +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.js.nft.json +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 +1 -1
- 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 +9 -9
- package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
- package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/terminal/page.js +1 -1
- package/.next/server/app/worktrees/[id]/terminal/page.js.nft.json +1 -1
- package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +34 -34
- package/.next/server/chunks/1068.js +1 -1
- package/.next/server/chunks/1210.js +1 -1
- package/.next/server/chunks/1501.js +3 -3
- package/.next/server/chunks/2119.js +1 -1
- package/.next/server/chunks/22.js +1 -1
- package/.next/server/chunks/2283.js +15 -0
- package/.next/server/chunks/2328.js +1 -1
- package/.next/server/chunks/2404.js +4 -3
- package/.next/server/chunks/2445.js +1 -1
- package/.next/server/chunks/252.js +1 -1
- package/.next/server/chunks/2816.js +1 -1
- package/.next/server/chunks/3543.js +1 -1
- package/.next/server/chunks/3730.js +1 -1
- package/.next/server/chunks/3945.js +1 -1
- package/.next/server/chunks/4207.js +3 -3
- package/.next/server/chunks/4802.js +1 -1
- package/.next/server/chunks/488.js +1 -0
- package/.next/server/chunks/5064.js +1 -1
- package/.next/server/chunks/5326.js +1 -1
- package/.next/server/chunks/5456.js +1 -1
- package/.next/server/chunks/5571.js +1 -1
- package/.next/server/chunks/5775.js +1 -1
- package/.next/server/chunks/611.js +1 -1
- package/.next/server/chunks/6130.js +1 -1
- package/.next/server/chunks/6285.js +1 -1
- package/.next/server/chunks/6401.js +1 -1
- package/.next/server/chunks/6474.js +14 -0
- package/.next/server/chunks/650.js +1 -1
- package/.next/server/chunks/6661.js +1 -1
- package/.next/server/chunks/6781.js +1 -1
- package/.next/server/chunks/6793.js +1 -1
- package/.next/server/chunks/6927.js +1 -0
- package/.next/server/chunks/7491.js +3 -0
- package/.next/server/chunks/7506.js +1 -1
- package/.next/server/chunks/7685.js +1 -1
- package/.next/server/chunks/7905.js +1 -1
- package/.next/server/chunks/8543.js +1 -1
- package/.next/server/chunks/8581.js +2 -2
- package/.next/server/chunks/8728.js +2 -2
- package/.next/server/chunks/8782.js +1 -0
- package/.next/server/chunks/8791.js +1 -1
- package/.next/server/chunks/8800.js +4 -3
- package/.next/server/chunks/8918.js +108 -6
- package/.next/server/chunks/9130.js +3 -3
- package/.next/server/chunks/{8052.js → 9353.js} +4 -2
- package/.next/server/chunks/9390.js +3 -0
- package/.next/server/chunks/9627.js +3 -3
- package/.next/server/chunks/967.js +1 -0
- package/.next/server/chunks/9731.js +3 -3
- package/.next/server/chunks/9882.js +3 -3
- 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/server/src/middleware.js +2 -2
- package/.next/server/src/middleware.js.map +1 -1
- package/.next/static/chunks/2053-85a974ddfe7498fe.js +1 -0
- package/.next/static/chunks/{2407-6b9e12c099fa598c.js → 2407-340774f1a24f2b45.js} +1 -1
- package/.next/static/chunks/5449-6cb80bab2bd06b79.js +1 -0
- package/.next/static/chunks/5521-c358c31f60e5e689.js +1 -0
- package/.next/static/chunks/591-0a45801e83f26f24.js +1 -0
- package/.next/static/chunks/8165-3853772f6ae1299b.js +1 -0
- package/.next/static/chunks/{8566-a6a7c70558927410.js → 8566-aeda747542072ace.js} +1 -1
- package/.next/static/chunks/8811-29eaa24237f48558.js +1 -0
- package/.next/static/chunks/{9619-22adf5367c4b7080.js → 9619-84aced0846cbe3ac.js} +1 -1
- package/.next/static/chunks/app/{layout-5b95e1236dcd9ef6.js → layout-0fc249fb7de75a27.js} +1 -1
- package/.next/static/chunks/app/review/page-ff9efae3f86eb840.js +1 -0
- package/.next/static/chunks/app/sessions/page-55297155e7bf01b9.js +1 -0
- package/.next/static/chunks/app/skills/[skillId]/page-9ee7a381636e60cb.js +1 -0
- package/.next/static/chunks/app/skills/page-182e16168b2fc098.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/page-d2103e0c25be83c8.js +1 -0
- package/.next/static/css/38070d879efa1371.css +1 -0
- package/.next/trace +13 -13
- package/README.md +58 -620
- package/dist/cli/commands/ask.d.ts.map +1 -1
- package/dist/cli/commands/ask.js +23 -149
- package/dist/cli/commands/capture.d.ts.map +1 -1
- package/dist/cli/commands/capture.js +11 -1
- package/dist/cli/commands/docs.d.ts.map +1 -1
- package/dist/cli/commands/docs.js +5 -0
- package/dist/cli/commands/remote.d.ts +24 -1
- package/dist/cli/commands/remote.d.ts.map +1 -1
- package/dist/cli/commands/remote.js +155 -6
- package/dist/cli/commands/reply.d.ts +40 -0
- package/dist/cli/commands/reply.d.ts.map +1 -0
- package/dist/cli/commands/reply.js +133 -0
- package/dist/cli/commands/respond.d.ts.map +1 -1
- package/dist/cli/commands/respond.js +255 -112
- package/dist/cli/commands/stop.d.ts.map +1 -1
- package/dist/cli/commands/stop.js +53 -1
- package/dist/cli/commands/sync.js +3 -3
- package/dist/cli/commands/wait.d.ts +5 -0
- package/dist/cli/commands/wait.d.ts.map +1 -1
- package/dist/cli/commands/wait.js +10 -1
- package/dist/cli/docs/agent-operations.d.ts +2 -2
- package/dist/cli/docs/agent-operations.d.ts.map +1 -1
- package/dist/cli/docs/agent-operations.js +13 -0
- package/dist/cli/docs/setup-guide.d.ts +14 -0
- package/dist/cli/docs/setup-guide.d.ts.map +1 -0
- package/dist/cli/docs/setup-guide.js +366 -0
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +4 -0
- package/dist/cli/types/api-responses.d.ts +11 -0
- package/dist/cli/types/api-responses.d.ts.map +1 -1
- package/dist/cli/types/index.d.ts +2 -0
- package/dist/cli/types/index.d.ts.map +1 -1
- package/dist/cli/utils/daemon.d.ts +42 -2
- package/dist/cli/utils/daemon.d.ts.map +1 -1
- package/dist/cli/utils/daemon.js +222 -40
- package/dist/cli/utils/docs-reader.d.ts +6 -0
- package/dist/cli/utils/docs-reader.d.ts.map +1 -1
- package/dist/cli/utils/docs-reader.js +14 -13
- package/dist/cli/utils/npm-runner.d.ts +12 -0
- package/dist/cli/utils/npm-runner.d.ts.map +1 -1
- package/dist/cli/utils/npm-runner.js +36 -0
- package/dist/cli/utils/process-inspect.d.ts +55 -0
- package/dist/cli/utils/process-inspect.d.ts.map +1 -0
- package/dist/cli/utils/process-inspect.js +214 -0
- package/dist/cli/utils/remote-pairing.d.ts +68 -0
- package/dist/cli/utils/remote-pairing.d.ts.map +1 -0
- package/dist/cli/utils/remote-pairing.js +117 -0
- package/dist/cli/utils/reply-ledger.d.ts +95 -0
- package/dist/cli/utils/reply-ledger.d.ts.map +1 -0
- package/dist/cli/utils/reply-ledger.js +187 -0
- package/dist/cli/utils/server-identity.d.ts +50 -0
- package/dist/cli/utils/server-identity.d.ts.map +1 -0
- package/dist/cli/utils/server-identity.js +118 -0
- package/dist/cli/utils/server-ready.d.ts +13 -0
- package/dist/cli/utils/server-ready.d.ts.map +1 -1
- package/dist/cli/utils/server-ready.js +16 -0
- package/dist/lib/cli-tools/copilot-executable.d.ts +9 -0
- package/dist/lib/cli-tools/copilot-executable.d.ts.map +1 -1
- package/dist/lib/cli-tools/copilot-executable.js +21 -5
- package/dist/lib/cli-tools/opencode-executable.d.ts +103 -0
- package/dist/lib/cli-tools/opencode-executable.d.ts.map +1 -0
- package/dist/lib/cli-tools/opencode-executable.js +179 -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 +5 -1
- package/dist/lib/detection/tools/verified-against.d.ts +15 -0
- package/dist/lib/detection/tools/verified-against.d.ts.map +1 -1
- package/dist/lib/detection/tools/verified-against.js +17 -1
- package/dist/lib/detection/version-probes.d.ts.map +1 -1
- package/dist/lib/detection/version-probes.js +14 -1
- package/dist/lib/security/pairing-code.d.ts +2 -1
- package/dist/lib/security/pairing-code.d.ts.map +1 -1
- package/dist/lib/session/tmux-session-surface.d.ts.map +1 -1
- package/dist/lib/session/tmux-session-surface.js +1 -1
- package/dist/server/locales/en/worktree.json +72 -20
- package/dist/server/locales/ja/worktree.json +72 -20
- package/dist/server/server.js +23 -0
- package/dist/server/src/config/cli-tool-timing-config.js +19 -1
- package/dist/server/src/config/detection-evidence-config.js +3 -0
- package/dist/server/src/config/image-extensions.js +1 -0
- package/dist/server/src/config/schedule-config.js +55 -1
- package/dist/server/src/lib/auto-yes-poller.js +69 -4
- package/dist/server/src/lib/cli-tools/agent-mode-spec.js +54 -2
- package/dist/server/src/lib/cli-tools/base.js +6 -2
- package/dist/server/src/lib/cli-tools/command-code-plan-review.js +175 -0
- package/dist/server/src/lib/cli-tools/command-code.js +81 -2
- package/dist/server/src/lib/cli-tools/composer-spec.js +10 -0
- package/dist/server/src/lib/cli-tools/copilot-executable.js +21 -5
- package/dist/server/src/lib/cli-tools/graceful-exit.js +15 -1
- package/dist/server/src/lib/cli-tools/index.js +3 -1
- package/dist/server/src/lib/cli-tools/install-hints.js +9 -3
- package/dist/server/src/lib/cli-tools/liveness-spec.js +19 -0
- package/dist/server/src/lib/cli-tools/manager.js +2 -0
- package/dist/server/src/lib/cli-tools/opencode-executable.js +179 -0
- package/dist/server/src/lib/cli-tools/opencode-v2.js +369 -0
- package/dist/server/src/lib/cli-tools/opencode.js +29 -5
- package/dist/server/src/lib/cli-tools/types.js +5 -1
- package/dist/server/src/lib/cmate-cli-tool-parser.js +65 -7
- package/dist/server/src/lib/cmate-parser.js +12 -0
- package/dist/server/src/lib/cmate-validator.js +13 -1
- package/dist/server/src/lib/detection/cli-patterns.js +172 -3
- package/dist/server/src/lib/detection/model-info-extractor.js +79 -7
- package/dist/server/src/lib/detection/status-detector.js +10 -1
- package/dist/server/src/lib/detection/tools/codex/cli-patterns.js +2 -1
- package/dist/server/src/lib/detection/tools/codex/detect.js +26 -0
- package/dist/server/src/lib/detection/tools/command-code/plan-review-state.js +75 -0
- package/dist/server/src/lib/detection/tools/opencode-v2/detect.js +253 -0
- package/dist/server/src/lib/detection/tools/opencode-v2/dialog-title.js +48 -0
- package/dist/server/src/lib/detection/tools/registry.js +2 -0
- package/dist/server/src/lib/detection/tools/run-detection.js +9 -0
- package/dist/server/src/lib/detection/tools/verified-against.js +17 -1
- package/dist/server/src/lib/detection/upstream-faults.js +8 -0
- package/dist/server/src/lib/detection/version-probes.js +14 -1
- package/dist/server/src/lib/hooks/agent-session-telemetry.js +36 -1
- package/dist/server/src/lib/hooks/sources/claude/transcript.js +33 -1
- package/dist/server/src/lib/hooks/sources/opencode/log-diagnosis.js +105 -0
- package/dist/server/src/lib/hooks/sources/opencode/source.js +7 -1
- package/dist/server/src/lib/hooks/sources/opencode-v2/client.js +422 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/decision-labels.js +24 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/history.js +421 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/ingest.js +271 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/mappers.js +165 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/payloads.js +351 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/ports.js +230 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/reattach.js +149 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/runtime.js +180 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/secrets.js +182 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/source.js +295 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/subscription.js +455 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/tool-id.js +18 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/usage.js +214 -0
- package/dist/server/src/lib/hooks/sources/registry.js +2 -0
- package/dist/server/src/lib/hooks/structured-decision-response.js +14 -5
- package/dist/server/src/lib/job-executor.js +2 -1
- package/dist/server/src/lib/polling/auto-yes-dialog-gate.js +15 -1
- package/dist/server/src/lib/polling/structured-history-gate.js +19 -5
- package/dist/server/src/lib/relay/relay-delivery.js +4 -1
- package/dist/server/src/lib/session/agent-event-state.js +24 -0
- package/dist/server/src/lib/session/claude-executor.js +186 -12
- package/dist/server/src/lib/session/claude-session.js +131 -15
- package/dist/server/src/lib/session/current-output-builder.js +27 -3
- package/dist/server/src/lib/session/send-user-message.js +4 -0
- package/dist/server/src/lib/session/session-start-error.js +20 -0
- package/dist/server/src/lib/session/structured-prompt.js +54 -0
- package/dist/server/src/lib/session/tmux-session-surface.js +1 -1
- package/dist/server/src/lib/skills/agent-state-paths.js +39 -0
- package/dist/server/src/lib/skills/compatibility-matrix.js +65 -0
- package/dist/server/src/lib/skills/receipt-owned-paths.js +118 -0
- package/dist/server/src/lib/tmux/tmux.js +73 -2
- package/dist/server/src/lib/verification/env-clean-gate.js +281 -10
- package/dist/server/src/lib/verification/gate-runner.js +29 -2
- package/dist/server/src/lib/verification/scope-gate.js +58 -4
- package/dist/server/src/types/cli-tool-contracts.js +10 -2
- package/dist/types/cli-tool-contracts.d.ts +16 -5
- package/dist/types/cli-tool-contracts.d.ts.map +1 -1
- package/dist/types/cli-tool-contracts.js +10 -2
- package/docs/en/architecture.md +722 -0
- package/docs/en/user-guide/agents-guide.md +306 -0
- package/docs/en/user-guide/cli-setup-guide.md +676 -0
- package/docs/en/user-guide/cmate-schedules-guide.md +388 -0
- package/docs/en/user-guide/commands-guide.md +467 -0
- package/docs/en/user-guide/quick-start.md +231 -0
- package/docs/en/user-guide/webapp-guide.md +1020 -0
- package/docs/en/user-guide/workflow-examples.md +463 -0
- package/package.json +19 -7
- package/release-notes/0.43.0.json +130 -0
- package/release-notes/0.44.0.json +82 -0
- package/scripts/hooks/cmate-agent-event.sh +14 -0
- package/scripts/opencode-v2/launch.sh +226 -0
- package/.next/server/chunks/1990.js +0 -103
- package/.next/server/chunks/3707.js +0 -15
- package/.next/server/chunks/4443.js +0 -3
- package/.next/server/chunks/5164.js +0 -1
- package/.next/server/chunks/5742.js +0 -1
- package/.next/server/chunks/7004.js +0 -1
- package/.next/server/chunks/8673.js +0 -14
- package/.next/static/chunks/2039-117a361f795ddc4b.js +0 -1
- package/.next/static/chunks/2053-611dd27d42721b79.js +0 -1
- package/.next/static/chunks/3778-56f41fc2cecb8c43.js +0 -1
- package/.next/static/chunks/5449-550bd273dccc3ae4.js +0 -1
- package/.next/static/chunks/7705-2a2936551b0cf9a3.js +0 -1
- package/.next/static/chunks/8165-934ee7ff3b4ddfd4.js +0 -1
- package/.next/static/chunks/app/review/page-30616daa1dc595c2.js +0 -1
- package/.next/static/chunks/app/sessions/page-1a8ba152bbcb9efb.js +0 -1
- package/.next/static/chunks/app/skills/[skillId]/page-ab7e432b69fccb3b.js +0 -1
- package/.next/static/chunks/app/skills/page-56b4fa11223e0cbd.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/page-59f5337e031518c6.js +0 -1
- package/.next/static/css/b3f433d52b8ed5c8.css +0 -1
- /package/.next/static/{MXZXkcFAnpELZnxxHB4iJ → wu7SUiHTirFcrpo5teyZ3}/_buildManifest.js +0 -0
- /package/.next/static/{MXZXkcFAnpELZnxxHB4iJ → wu7SUiHTirFcrpo5teyZ3}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.44.0",
|
|
3
|
+
"date": "2026-10-03",
|
|
4
|
+
"highlight": {
|
|
5
|
+
"ja": "エージェントに読ませるだけで導入まで案内してくれるセットアップガイドを加えました。スマホからのログインと公開の安全性も改善しています。",
|
|
6
|
+
"en": "A setup guide your agent can read and follow now walks you through installation. Phone login and remote access are also safer."
|
|
7
|
+
},
|
|
8
|
+
"added": [
|
|
9
|
+
{
|
|
10
|
+
"ja": "チャットの吹き出しで、worktree 内の画像を表示できるようになりました。",
|
|
11
|
+
"en": "Chat bubbles now show images from the worktree."
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"ja": "チャットの吹き出しで、worktree 内の動画を再生できるようになりました。",
|
|
15
|
+
"en": "Chat bubbles now play videos from the worktree."
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"ja": "Command Code の計画レビュー画面で、チャット面からコメント・送信・承認・取り消しができるようになりました。承認の前には確認が出ます。",
|
|
19
|
+
"en": "In Command Code's plan review, you can now comment, submit, approve, or cancel from the chat view. Approving asks for confirmation first."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"ja": "ペアリングの QR を失くしたとき、公開を張り直さずに新しいリンクを出せるようになりました。",
|
|
23
|
+
"en": "If you lose the pairing QR code, you can now get a new link without restarting remote access."
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"ja": "エージェントに読ませて導入を進めてもらうセットアップガイドを追加しました。",
|
|
27
|
+
"en": "Added a setup guide that your agent can read to walk you through installation."
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"improved": [
|
|
31
|
+
{
|
|
32
|
+
"ja": "Command Code の計画レビュー画面に、CLI からコメント・送信・承認・取り消しを送れるようになりました。",
|
|
33
|
+
"en": "The CLI can now comment on, submit, approve, or cancel a Command Code plan review."
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"ja": "画面の出力がまだ無いとき、確認ダイアログの見方を案内するようになりました。",
|
|
37
|
+
"en": "When there is no output yet, capture now tells you how to see a waiting confirmation screen."
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"ja": "Command Code が自分で書く設定ファイルを、作業の変更として数えなくなりました。",
|
|
41
|
+
"en": "Settings files that Command Code writes for itself are no longer counted as your changes."
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"fixed": [
|
|
45
|
+
{
|
|
46
|
+
"ja": "停止したはずのサーバーが残り、ログインなしで公開されてしまうことがある問題を直しました。",
|
|
47
|
+
"en": "Fixed a case where a server that should have stopped stayed up and could be exposed without login."
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"ja": "トンネル越しにログインしようとすると localhost に移動してしまう問題を直しました。",
|
|
51
|
+
"en": "Fixed logging in through a tunnel sending you to localhost."
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"ja": "Claude Code の信頼の確認で、終了を選んでしまい最初の送信が届かない問題を直しました。",
|
|
55
|
+
"en": "Fixed Claude Code's trust prompt sometimes choosing to exit, so the first message was not delivered."
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"ja": "初めて使うときに、送信・同期・応答のエラーが誤った対処を案内していた問題を直しました。",
|
|
59
|
+
"en": "Fixed send, sync, and respond errors pointing first-time users to the wrong fix."
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"ja": "npm にまだ出ていない版で更新ボタンが押せてしまう問題を直しました。",
|
|
63
|
+
"en": "Fixed the Update button being available for a version not yet published to npm."
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"ja": "大きすぎる画像を開いたとき、正しく「大きすぎる」と伝えるようになりました。",
|
|
67
|
+
"en": "Opening an image that is too large now correctly says it is too large."
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"ja": "Codex のモデル選択画面に Auto-Yes が答えてしまう問題を直しました。",
|
|
71
|
+
"en": "Fixed Auto-Yes answering Codex's model selection screen."
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"ja": "Claude の /effort の選択画面を正しく認識するようになりました。",
|
|
75
|
+
"en": "Claude's /effort selection screen is now recognized correctly."
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"ja": "依存パッケージの脆弱性を解消しました。",
|
|
79
|
+
"en": "Resolved security vulnerabilities in dependencies."
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
@@ -265,6 +265,20 @@ fi
|
|
|
265
265
|
if [ -n "$DETAIL" ]; then
|
|
266
266
|
BODY="$BODY,\"detail\":\"$(json_escape "$DETAIL")\""
|
|
267
267
|
fi
|
|
268
|
+
# Issue #2955. Claude names its model on `SessionStart` (`"model":
|
|
269
|
+
# "claude-sonnet-5-5"`, measured on 2.1.284), and `SessionStart` is the one
|
|
270
|
+
# Claude event that has to come through this script (http hooks are not
|
|
271
|
+
# supported there). Before #2955 the value was dropped here, so the server's
|
|
272
|
+
# model latch was never written for any claude session. Forwarded on
|
|
273
|
+
# session_start only — other tools' payloads keep the body they had — and
|
|
274
|
+
# omitted when the payload has none (`claude -p`, the `SessionStart` of
|
|
275
|
+
# `/clear`), where an empty value would read as "the model is unknown".
|
|
276
|
+
if [ "$EVENT" = "session_start" ] && [ -n "$HOOK_JSON" ]; then
|
|
277
|
+
MODEL="$(json_string_field "$HOOK_JSON" 'model')"
|
|
278
|
+
if [ -n "$MODEL" ]; then
|
|
279
|
+
BODY="$BODY,\"model\":\"$(json_escape "$MODEL")\""
|
|
280
|
+
fi
|
|
281
|
+
fi
|
|
268
282
|
BODY="$BODY}"
|
|
269
283
|
|
|
270
284
|
# Token via --header rather than the command line of a subprocess: argv is world
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# launch.sh — run an OpenCode V2 (`opencode2`) server and its TUI in ONE tmux
|
|
4
|
+
# pane, so the two live and die together (Issue #2934, Epic #2370 Phase 1).
|
|
5
|
+
#
|
|
6
|
+
# OpenCode 2's TUI does not host the API the way v1's does: the API is a
|
|
7
|
+
# separate `opencode2 serve`, and the TUI attaches to it with `--server`. If
|
|
8
|
+
# CommandMate started the server as a child of its own process, a CommandMate
|
|
9
|
+
# restart would take every agent's server down with it; if the server were
|
|
10
|
+
# started in the pane without a guard, closing the pane would leave the port
|
|
11
|
+
# bound (the #1905 failure, which v1 only avoided because its TUI WAS the
|
|
12
|
+
# server). So this wrapper owns both processes and a trap stops the server on
|
|
13
|
+
# every way out: the TUI exiting, `tmux kill-session` (SIGHUP), Ctrl-C (SIGINT)
|
|
14
|
+
# and SIGTERM.
|
|
15
|
+
#
|
|
16
|
+
# Usage:
|
|
17
|
+
# launch.sh --port <N> --password-file <path> --directory <path>
|
|
18
|
+
# [--executable <path>]
|
|
19
|
+
#
|
|
20
|
+
# The executable
|
|
21
|
+
# The OpenCode V2 binary to run for both the server and the TUI. CommandMate
|
|
22
|
+
# passes the absolute path it identified as OpenCode V2 by `--version`
|
|
23
|
+
# (Issue #2952), which may be named `opencode` as well as `opencode2`, and
|
|
24
|
+
# which the pane's own PATH might resolve differently. Omitted, it is
|
|
25
|
+
# `opencode2` looked up on PATH.
|
|
26
|
+
#
|
|
27
|
+
# The password
|
|
28
|
+
# CommandMate generates one per launch and writes it to a 0600 file under
|
|
29
|
+
# ~/.commandmate/opencode-v2/. It is read here and placed in the environment
|
|
30
|
+
# variable OPENCODE_SERVER_PASSWORD ONLY: it is never echoed, never passed as
|
|
31
|
+
# an argument (argv is readable by `ps`), and the readiness probe hands it to
|
|
32
|
+
# curl through `--config -` on stdin for the same reason. Accepted, and stated
|
|
33
|
+
# so nobody has to rediscover it: the serve and TUI processes carry it in their
|
|
34
|
+
# environment, and so does any shell tool the agent runs. The server listens on
|
|
35
|
+
# 127.0.0.1 only, so what the password protects stays inside the same OS user.
|
|
36
|
+
#
|
|
37
|
+
# Environment (tests only):
|
|
38
|
+
# CM_OPENCODE_V2_READY_TIMEOUT seconds to wait for the server (default 15)
|
|
39
|
+
#
|
|
40
|
+
# Exit codes: the TUI's own status when it exits; 64 usage error; 66 password
|
|
41
|
+
# file unreadable or empty; 69 the server did not answer in time; 129/130/143
|
|
42
|
+
# when stopped by SIGHUP / SIGINT / SIGTERM.
|
|
43
|
+
#
|
|
44
|
+
# Written for bash 3.2 (the macOS system bash): no associative arrays, no
|
|
45
|
+
# `mapfile`, no `${var^^}`, no `wait -n`.
|
|
46
|
+
|
|
47
|
+
set -u
|
|
48
|
+
|
|
49
|
+
PROGRAM_NAME="launch.sh"
|
|
50
|
+
READY_TIMEOUT_SECONDS="${CM_OPENCODE_V2_READY_TIMEOUT:-15}"
|
|
51
|
+
STOP_GRACE_TICKS=30 # x 0.1 s before SIGKILL
|
|
52
|
+
|
|
53
|
+
port=""
|
|
54
|
+
password_file=""
|
|
55
|
+
directory=""
|
|
56
|
+
executable=""
|
|
57
|
+
|
|
58
|
+
usage() {
|
|
59
|
+
echo "Usage: ${PROGRAM_NAME} --port <N> --password-file <path> --directory <path> [--executable <path>]" >&2
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
die() {
|
|
63
|
+
local code="$1"
|
|
64
|
+
shift
|
|
65
|
+
echo "${PROGRAM_NAME}: $*" >&2
|
|
66
|
+
exit "$code"
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
while [ $# -gt 0 ]; do
|
|
70
|
+
case "$1" in
|
|
71
|
+
--port)
|
|
72
|
+
[ $# -ge 2 ] || { usage; exit 64; }
|
|
73
|
+
port="$2"
|
|
74
|
+
shift 2
|
|
75
|
+
;;
|
|
76
|
+
--password-file)
|
|
77
|
+
[ $# -ge 2 ] || { usage; exit 64; }
|
|
78
|
+
password_file="$2"
|
|
79
|
+
shift 2
|
|
80
|
+
;;
|
|
81
|
+
--directory)
|
|
82
|
+
[ $# -ge 2 ] || { usage; exit 64; }
|
|
83
|
+
directory="$2"
|
|
84
|
+
shift 2
|
|
85
|
+
;;
|
|
86
|
+
--executable)
|
|
87
|
+
[ $# -ge 2 ] || { usage; exit 64; }
|
|
88
|
+
executable="$2"
|
|
89
|
+
[ -n "$executable" ] || { usage; exit 64; }
|
|
90
|
+
shift 2
|
|
91
|
+
;;
|
|
92
|
+
-h | --help)
|
|
93
|
+
usage
|
|
94
|
+
exit 0
|
|
95
|
+
;;
|
|
96
|
+
*)
|
|
97
|
+
usage
|
|
98
|
+
die 64 "unknown argument: $1"
|
|
99
|
+
;;
|
|
100
|
+
esac
|
|
101
|
+
done
|
|
102
|
+
|
|
103
|
+
if [ -z "$port" ] || [ -z "$password_file" ] || [ -z "$directory" ]; then
|
|
104
|
+
usage
|
|
105
|
+
exit 64
|
|
106
|
+
fi
|
|
107
|
+
case "$port" in
|
|
108
|
+
'' | *[!0-9]*) die 64 "--port must be a number: ${port}" ;;
|
|
109
|
+
esac
|
|
110
|
+
if [ "$port" -lt 1 ] || [ "$port" -gt 65535 ]; then
|
|
111
|
+
die 64 "--port out of range: ${port}"
|
|
112
|
+
fi
|
|
113
|
+
case "$READY_TIMEOUT_SECONDS" in
|
|
114
|
+
'' | *[!0-9]*) READY_TIMEOUT_SECONDS=15 ;;
|
|
115
|
+
esac
|
|
116
|
+
[ -d "$directory" ] || die 64 "--directory is not a directory: ${directory}"
|
|
117
|
+
if [ -n "$executable" ]; then
|
|
118
|
+
{ [ -f "$executable" ] && [ -x "$executable" ]; } ||
|
|
119
|
+
die 64 "--executable is not an executable file: ${executable}"
|
|
120
|
+
else
|
|
121
|
+
executable="opencode2"
|
|
122
|
+
fi
|
|
123
|
+
[ -r "$password_file" ] || die 66 "password file is not readable: ${password_file}"
|
|
124
|
+
|
|
125
|
+
# `read` returns non-zero on a file without a trailing newline even though it
|
|
126
|
+
# filled the variable, so success is judged by the value, not the status.
|
|
127
|
+
OPENCODE_SERVER_PASSWORD=""
|
|
128
|
+
IFS= read -r OPENCODE_SERVER_PASSWORD <"$password_file" || true
|
|
129
|
+
[ -n "$OPENCODE_SERVER_PASSWORD" ] || die 66 "password file is empty: ${password_file}"
|
|
130
|
+
export OPENCODE_SERVER_PASSWORD
|
|
131
|
+
|
|
132
|
+
# Keep the user's project untouched (Issue #2957). On start the TUI checks for
|
|
133
|
+
# its own update by running `npm`/`pnpm`/`yarn`/`bun list -g` in the directory
|
|
134
|
+
# it was started from; where `pnpm`/`yarn` are corepack shims, corepack then
|
|
135
|
+
# writes a "packageManager" field into the nearest package.json (auto-pin).
|
|
136
|
+
# Measured with opencode2 v2.0.18: OPENCODE_DISABLE_AUTOUPDATE=1 stops those
|
|
137
|
+
# spawns altogether, and COREPACK_ENABLE_AUTO_PIN=0 keeps corepack from writing
|
|
138
|
+
# should any package manager run anyway. CommandMate reports updates itself.
|
|
139
|
+
export OPENCODE_DISABLE_AUTOUPDATE=1
|
|
140
|
+
export COREPACK_ENABLE_AUTO_PIN=0
|
|
141
|
+
|
|
142
|
+
server_url="http://127.0.0.1:${port}"
|
|
143
|
+
serve_pid=""
|
|
144
|
+
tui_pid=""
|
|
145
|
+
|
|
146
|
+
# Stop one child: SIGTERM, a short grace period, then SIGKILL, then reap it so
|
|
147
|
+
# the port is released before this script's own exit is observable.
|
|
148
|
+
# shellcheck disable=SC2329 # invoked from the EXIT trap via cleanup
|
|
149
|
+
stop_child() {
|
|
150
|
+
local pid="$1"
|
|
151
|
+
local ticks=0
|
|
152
|
+
[ -n "$pid" ] || return 0
|
|
153
|
+
kill -TERM "$pid" 2>/dev/null || true
|
|
154
|
+
while kill -0 "$pid" 2>/dev/null; do
|
|
155
|
+
if [ "$ticks" -ge "$STOP_GRACE_TICKS" ]; then
|
|
156
|
+
kill -KILL "$pid" 2>/dev/null || true
|
|
157
|
+
break
|
|
158
|
+
fi
|
|
159
|
+
sleep 0.1
|
|
160
|
+
ticks=$((ticks + 1))
|
|
161
|
+
done
|
|
162
|
+
wait "$pid" 2>/dev/null || true
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
# shellcheck disable=SC2329 # invoked by the EXIT trap
|
|
166
|
+
cleanup() {
|
|
167
|
+
local tui="$tui_pid"
|
|
168
|
+
local serve="$serve_pid"
|
|
169
|
+
tui_pid=""
|
|
170
|
+
serve_pid=""
|
|
171
|
+
stop_child "$tui"
|
|
172
|
+
stop_child "$serve"
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
trap cleanup EXIT
|
|
176
|
+
# Each signal becomes an ordinary exit, which runs the EXIT trap above exactly
|
|
177
|
+
# once. The TUI is waited on with `wait` (below) rather than run as a
|
|
178
|
+
# foreground command precisely so these fire immediately: bash defers a
|
|
179
|
+
# trapped signal until a foreground child returns, and a TUI that ignores the
|
|
180
|
+
# hangup would otherwise keep the server alive forever.
|
|
181
|
+
trap 'exit 129' HUP
|
|
182
|
+
trap 'exit 130' INT
|
|
183
|
+
trap 'exit 143' TERM
|
|
184
|
+
|
|
185
|
+
# The server's own output would only be painted over by the TUI's alternate
|
|
186
|
+
# screen, and with OPENCODE_SERVER_PASSWORD set it prints no secret anyway.
|
|
187
|
+
"$executable" serve --hostname 127.0.0.1 --port "$port" </dev/null >/dev/null 2>&1 &
|
|
188
|
+
serve_pid=$!
|
|
189
|
+
|
|
190
|
+
# Ready means `GET /openapi.json` answered 200 with our credentials. The
|
|
191
|
+
# credentials go to curl on stdin (`--config -`), never on its command line.
|
|
192
|
+
probe_ready() {
|
|
193
|
+
local code
|
|
194
|
+
code="$(printf 'user = "opencode:%s"\n' "$OPENCODE_SERVER_PASSWORD" |
|
|
195
|
+
curl --config - --silent --output /dev/null --write-out '%{http_code}' \
|
|
196
|
+
--max-time 1 "${server_url}/openapi.json" 2>/dev/null)" || true
|
|
197
|
+
[ "$code" = "200" ]
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
ready=0
|
|
201
|
+
deadline=$((SECONDS + READY_TIMEOUT_SECONDS))
|
|
202
|
+
while [ "$SECONDS" -lt "$deadline" ]; do
|
|
203
|
+
if ! kill -0 "$serve_pid" 2>/dev/null; then
|
|
204
|
+
die 69 "${executable} serve exited before answering on ${server_url}"
|
|
205
|
+
fi
|
|
206
|
+
if probe_ready; then
|
|
207
|
+
ready=1
|
|
208
|
+
break
|
|
209
|
+
fi
|
|
210
|
+
sleep 0.25
|
|
211
|
+
done
|
|
212
|
+
[ "$ready" -eq 1 ] || die 69 "${executable} serve did not answer on ${server_url} within ${READY_TIMEOUT_SECONDS}s"
|
|
213
|
+
|
|
214
|
+
# Asynchronous commands in a non-interactive shell get /dev/null as stdin
|
|
215
|
+
# unless they are given an explicit redirection, so the terminal is handed over
|
|
216
|
+
# on fd 3. The TUI still shares this script's process group, which is the
|
|
217
|
+
# pane's foreground group, so it keeps reading the terminal.
|
|
218
|
+
exec 3<&0
|
|
219
|
+
"$executable" --server "$server_url" "$directory" <&3 3<&- &
|
|
220
|
+
tui_pid=$!
|
|
221
|
+
exec 3<&-
|
|
222
|
+
|
|
223
|
+
status=0
|
|
224
|
+
wait "$tui_pid" || status=$?
|
|
225
|
+
tui_pid=""
|
|
226
|
+
exit "$status"
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=1990,exports.ids=[1990],exports.modules={31990:(a,b,c)=>{c.d(b,{Wh:()=>R,WD:()=>S,Lw:()=>U,K1:()=>Q,N5:()=>T});var d=c(43234),e=c(72626),f=c(79892);let g={streamingOutput:!1,explicitResize:!1,snapshotFallback:!0};class h{async unsubscribe(){}}class i{async ensureSession(a,b){await (0,f.N)(a)||await (0,f.jw)(a,b)}async sessionExists(a){return(0,f.N)(a)}async sendInput(a,b){await (0,f.V1)(a,b)}async sendSpecialKey(a,b){if("Escape"!==b&&"C-c"!==b&&"C-d"!==b&&"C-m"!==b&&"Enter"!==b)throw Error(`Unsupported special key for PollingTmuxTransport: ${b}`);await (0,f.ds)(a,b)}async resize(){throw Error("PollingTmuxTransport does not support explicit resize")}async captureSnapshot(a,b){return(0,f.Xg)(a,b)}async subscribe(){return new h}getCapabilities(){return g}async killSession(a){return(0,f.fY)(a)}}let j=null;var k=c(93997),l=c(79646),m=c(28354),n=c(31442),o=c(29021),p=c(21820),q=c(33873),r=c(16983);let s="cm-live-restore.sh",t="cm-live-delegate.sh",u="cm-auto-popup.sh",v=`#!/bin/sh
|
|
2
|
-
# CommandMate live-attach restore (Issue #2317) — generated file, edits are overwritten.
|
|
3
|
-
#
|
|
4
|
-
# sh ~/.commandmate/bin/${s} <session> [control_mode] [width] [height]
|
|
5
|
-
#
|
|
6
|
-
# Pins the session's window back to CommandMate's canvas once no human client is
|
|
7
|
-
# attached to it any more. Safe to run when nothing is delegated: it then simply
|
|
8
|
-
# re-applies the geometry the session already has.
|
|
9
|
-
set -u
|
|
10
|
-
|
|
11
|
-
SESSION="\${1:-}"
|
|
12
|
-
CONTROL_MODE="\${2:-0}"
|
|
13
|
-
WIDTH="\${3:-${r.Jn}}"
|
|
14
|
-
HEIGHT="\${4:-${r.sO}}"
|
|
15
|
-
|
|
16
|
-
case "$SESSION" in
|
|
17
|
-
${n.HL}*) ;;
|
|
18
|
-
*) exit 0 ;;
|
|
19
|
-
esac
|
|
20
|
-
|
|
21
|
-
# A control-mode client detaching is CommandMate's own transport reconnecting,
|
|
22
|
-
# not the human leaving. Doing the restore here would fight the human's attach.
|
|
23
|
-
if [ "$CONTROL_MODE" = "1" ]; then
|
|
24
|
-
exit 0
|
|
25
|
-
fi
|
|
26
|
-
|
|
27
|
-
# Anyone left who is NOT a control client? Then the geometry is still theirs.
|
|
28
|
-
HUMANS=$(tmux list-clients -t "=$SESSION:" -F '#{client_control_mode}' 2>/dev/null \\
|
|
29
|
-
| grep -c -v '^1$') || HUMANS=0
|
|
30
|
-
if [ "\${HUMANS:-0}" -gt 0 ]; then
|
|
31
|
-
exit 0
|
|
32
|
-
fi
|
|
33
|
-
|
|
34
|
-
tmux set-window-option -t "=$SESSION:" window-size manual 2>/dev/null || exit 0
|
|
35
|
-
tmux resize-window -t "=$SESSION:" -x "$WIDTH" -y "$HEIGHT" 2>/dev/null || true
|
|
36
|
-
tmux set-option -u -t "=$SESSION:" @cm_delegated 2>/dev/null || true
|
|
37
|
-
`,w="[0-9a-f]".repeat(8),x=`#!/bin/sh
|
|
38
|
-
# CommandMate live-attach delegate (Issue #2317) — generated file, edits are overwritten.
|
|
39
|
-
#
|
|
40
|
-
# sh ~/.commandmate/bin/${t} <session> <control_mode> [client]
|
|
41
|
-
#
|
|
42
|
-
# Hands the session's window from CommandMate's pinned canvas to the terminal
|
|
43
|
-
# that just attached, so an alternate-screen agent re-lays-out and its transcript
|
|
44
|
-
# becomes readable. Installed as a session-scoped \`client-attached[0]\` hook only
|
|
45
|
-
# when CM_LIVE_ATTACH_HOOK=on; \`commandmate attach --live\` does the same two
|
|
46
|
-
# writes itself and needs no hook.
|
|
47
|
-
#
|
|
48
|
-
# The window is put back by whoever notices the human is gone first: the CLI on
|
|
49
|
-
# return from attach-session, or the server's status poll. This script never
|
|
50
|
-
# restores — the attach edge is the only edge tmux 3.5a lets a session-scoped
|
|
51
|
-
# hook see.
|
|
52
|
-
set -u
|
|
53
|
-
|
|
54
|
-
SESSION="\${1:-}"
|
|
55
|
-
CONTROL_MODE="\${2:-0}"
|
|
56
|
-
|
|
57
|
-
case "$SESSION" in
|
|
58
|
-
${n.HL}claude-*|${n.HL}${w}-claude-*) ;;
|
|
59
|
-
*) exit 0 ;;
|
|
60
|
-
esac
|
|
61
|
-
|
|
62
|
-
# A control-mode client is CommandMate's own transport. Handing it the geometry
|
|
63
|
-
# would resize the canvas to whatever that connection negotiated, which is the
|
|
64
|
-
# #1163 regression this whole feature is built to avoid.
|
|
65
|
-
if [ "$CONTROL_MODE" = "1" ]; then
|
|
66
|
-
exit 0
|
|
67
|
-
fi
|
|
68
|
-
|
|
69
|
-
# Raised BEFORE the size change, so a status poll landing between the two sees
|
|
70
|
-
# "delegated, still pinned" rather than "not delegated, 44 rows".
|
|
71
|
-
tmux set-option -t "=$SESSION:" @cm_delegated 1 2>/dev/null || exit 0
|
|
72
|
-
tmux set-window-option -t "=$SESSION:" window-size latest 2>/dev/null || true
|
|
73
|
-
`,y=`#!/bin/sh
|
|
74
|
-
# CommandMate auto read popup (Issue #2317) — generated file, edits are overwritten.
|
|
75
|
-
#
|
|
76
|
-
# sh ~/.commandmate/bin/${u} <session> <control_mode> <client>
|
|
77
|
-
#
|
|
78
|
-
# Opens the following transcript popup for a human client attaching to a
|
|
79
|
-
# CommandMate session. Never opens for a control-mode client.
|
|
80
|
-
set -u
|
|
81
|
-
|
|
82
|
-
SESSION="\${1:-}"
|
|
83
|
-
CONTROL_MODE="\${2:-0}"
|
|
84
|
-
CLIENT="\${3:-}"
|
|
85
|
-
|
|
86
|
-
case "$SESSION" in
|
|
87
|
-
${n.HL}*) ;;
|
|
88
|
-
*) exit 0 ;;
|
|
89
|
-
esac
|
|
90
|
-
|
|
91
|
-
if [ "$CONTROL_MODE" = "1" ]; then
|
|
92
|
-
exit 0
|
|
93
|
-
fi
|
|
94
|
-
|
|
95
|
-
PAGER_SCRIPT="$HOME/.commandmate/bin/cm-read-pane.sh"
|
|
96
|
-
[ -x "$PAGER_SCRIPT" ] || exit 0
|
|
97
|
-
|
|
98
|
-
if [ -n "$CLIENT" ]; then
|
|
99
|
-
tmux display-popup -c "$CLIENT" -w 90% -h 85% -E "sh \\"$PAGER_SCRIPT\\" --follow \\"$SESSION\\"" 2>/dev/null || true
|
|
100
|
-
else
|
|
101
|
-
tmux display-popup -w 90% -h 85% -E "sh \\"$PAGER_SCRIPT\\" --follow \\"$SESSION\\"" 2>/dev/null || true
|
|
102
|
-
fi
|
|
103
|
-
`;function z(a,b){let c,d=(0,q.join)((0,q.join)((0,p.homedir)(),".commandmate","bin"),a);if((0,o.mkdirSync)((0,q.dirname)(d),{recursive:!0}),(0,o.existsSync)(d))try{c=(0,o.readFileSync)(d,"utf-8")}catch{c=void 0}return c!==b&&(0,o.writeFileSync)(d,b,{mode:493}),(0,o.chmodSync)(d,493),d}var A=c(83598);let B=(0,m.promisify)(l.execFile),C=(0,e.h)("tmux-session-hooks"),D=globalThis.__cmEnsuredSessionHooks??(globalThis.__cmEnsuredSessionHooks=new Set);async function E(a){if((0,n.N_)(a)&&!D.has(a)){D.add(a);try{if((0,n.gM)()&&(0,n.n9)(a)){z(s,v);let b=(0,n.Rr)(a,z(t,x));b&&await B("tmux",b,{timeout:5e3})}else await B("tmux",(0,n.g4)(a),{timeout:5e3});if((0,n.jx)()){let b=(0,n.Ls)(a,z(u,y));b&&await B("tmux",b,{timeout:5e3})}else await B("tmux",(0,n.sL)(a),{timeout:5e3})}catch(b){C.debug("session-hooks:reconcile-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)})}}}async function F(a){try{if(!await (0,A.Us)(a)||await (0,A.Fh)(a))return!1;for(let b of(0,n.RS)(a))await B("tmux",b,{timeout:5e3});return C.info("session-hooks:geometry-restored",{sessionName:a}),!0}catch(b){return C.debug("session-hooks:geometry-restore-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)}),!1}}let G=(0,m.promisify)(l.execFile),H=(0,e.h)("tmux-session-status"),I=globalThis.__cmPublishedTmuxStatus??(globalThis.__cmPublishedTmuxStatus=new Map),J=globalThis.__cmClearedTmuxStatus??(globalThis.__cmClearedTmuxStatus=new Set);async function K(a){let{sessionName:b,worktreeId:c,cliToolId:d,instanceId:e,status:f}=a;if(!(0,n.om)())return J.has(b)||(J.add(b),await M(b)),"disabled";let g=I.get(b);if(g&&g.status===f&&g.worktreeId===c&&g.cliToolId===d&&g.instanceId===e)return"unchanged";let h=(a.now??new Date).toISOString(),i=[[n.eC,f],[n.jp,c],[n.wv,d],[n.L0,e],[n.tx,h]];try{for(let[a,c]of i)await G("tmux",(0,n.ND)(b,a,c),{timeout:5e3});return I.set(b,{status:f,worktreeId:c,cliToolId:d,instanceId:e}),await L(b),"written"}catch(a){return I.delete(b),H.debug("session-status:write-failed",{sessionName:b,error:a instanceof Error?a.message:String(a)}),"error"}}async function L(a){try{let{stdout:b}=await G("tmux",(0,n.Ys)(a,"status-right"),{timeout:5e3}),c=b.trim();if(""!==c&&!c.includes(n.lY))return H.debug("session-status:status-right-user-owned",{sessionName:a,existing:c}),!1;return""===c&&await G("tmux",(0,n.KB)(a,n.lY),{timeout:5e3}),!0}catch(b){return H.debug("session-status:status-right-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)}),!1}}async function M(a){for(let b of(I.delete(a),n.bq))try{await G("tmux",(0,n.cD)(a,b),{timeout:5e3})}catch{}try{let{stdout:b}=await G("tmux",(0,n.Ys)(a,"status-right"),{timeout:5e3});b.includes(n.lY)&&await G("tmux",(0,n.$D)(a),{timeout:5e3})}catch{}}let N=(0,e.h)("cli-session");function O(){return j||(j=new i),j}function P(a,b,c){let e=d.CLIToolManager.getInstance().getTool(b),f=e.getSessionName(a,c);return{cliTool:e,sessionName:f}}async function Q(a,b,c){let{sessionName:d}=P(a,b,c);return O().sessionExists(d)}async function R(a,b,c=1e3,d){let e=N.withContext({worktreeId:a,cliToolId:b});e.debug("captureSessionOutput:start",{requestedLines:c});let{cliTool:f,sessionName:g}=P(a,b,d),h=O();try{let a=await (0,k.aq)(g,c,async()=>{if(!await h.sessionExists(g))throw Error(`${f.name} session ${g} does not exist`);return await h.captureSnapshot(g,{startLine:-k.xE})});return e.debug("captureSessionOutput:success",{actualLines:a.split("\n").length,lastFewLines:a.split("\n").slice(-3).join(" | ")}),a}catch(b){let a=b instanceof Error?b.message:String(b);if(a.includes("does not exist"))throw e.debug("captureSessionOutput:sessionNotFound",{sessionName:g}),b;throw e.error("captureSessionOutput:failed",{error:a}),Error(`Failed to capture ${f.name} output: ${a}`)}}async function S(a,b,c=5e3,d){let e=N.withContext({worktreeId:a,cliToolId:b});e.debug("captureSessionOutputFresh:start",{requestedLines:c});let{cliTool:f,sessionName:g}=P(a,b,d),h=O();try{let a=await h.captureSnapshot(g,{startLine:-c});return a.length>0?(0,k.vF)(g,a,c):(0,k.gm)(g),(0,k.wd)(a,c)}catch(b){(0,k.gm)(g);let a=b instanceof Error?b.message:String(b);throw e.error("captureSessionOutputFresh:failed",{error:a}),Error(`Failed to capture ${f.name} output: ${a}`)}}async function T(a){await E(a.sessionName),(0,n.n9)(a.sessionName)&&await F(a.sessionName),await K(a)}function U(a){I.delete(a),J.delete(a),D.delete(a),(0,A.G9)(a)}}};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=3707,exports.ids=[3707],exports.modules={2412:(a,b,c)=>{c.d(b,{Qb:()=>f,tR:()=>g});var d=c(46065);let e=Symbol("default-branch-unresolved");async function f(a){let b=await (0,d.Bc)(["symbolic-ref","refs/remotes/origin/HEAD","--short"],a);if(null===b)return e;let c=b.trim();return c.startsWith("origin/")?c.slice(7):null}async function g(a){let b=await f(a);return"string"==typeof b?b:null}},23707:(a,b,c)=>{c.d(b,{Wb:()=>P,on:()=>X,AT:()=>ah});var d=c(79646),e=c(29021),f=c(88807),g=c(56791),h=c(48524),i=c(2412),j=c(72626),k=c(81099),l=c(11501),m=c(52767),n=c(74985),o=c(77142),p=c(49987),q=c(53604);let r="skipped: the verification run was cancelled.",s=".commandmate/",t=`(exempt: ${s})`,u=".commandmate/tasks/";function v(a){return a.startsWith(u)}function w(a){return{pattern:a,regexp:function(a){let b=a.replace(/\/+$/,""),c=function(a){let b=0;for(let c of a)if("{"===c)b+=1;else if("}"===c&&(b-=1)<0)return!1;return 0===b}(b),d="",e=0,f=0;for(;f<b.length;){let a=b[f];if("*"===a){let a=f;for(;"*"===b[a];)a+=1;let c=a-f>1,e=0===f||"/"===b[f-1];if(c&&e&&"/"===b[a]){d+="(?:[^/]*/)*",f=a+1;continue}if(c&&e&&a===b.length){d+=".*",f=a;continue}d+="[^/]*",f=a;continue}if("?"===a){d+="[^/]",f+=1;continue}if(c&&"{"===a){e+=1,d+="(?:",f+=1;continue}if(c&&"}"===a&&e>0){e-=1,d+=")",f+=1;continue}if(c&&","===a&&e>0){d+="|",f+=1;continue}d+=a.replace(/[.*+?^${}()|[\]\\]/,"\\$&"),f+=1}return RegExp(`^${d}(?:/.*)?$`)}(a)}}class x{constructor(a,b=null){this.contractPath=b,this.allow=a.allow.map(w),this.deny=a.deny.map(w)}classify(a){let b=this.deny.find(b=>b.regexp.test(a));if(b)return{admitted:!1,pattern:b.pattern};if(a.startsWith(s))return{admitted:!0,pattern:t};if(a===this.contractPath)return{admitted:!0,pattern:"(exempt: contract path)"};let c=this.allow.find(b=>b.regexp.test(a));return c?{admitted:!0,pattern:c.pattern}:{admitted:!1,pattern:null}}isViolation(a){return!this.classify(a).admitted}}function y(a,b){return new Promise(c=>{let e="",f="",g=(0,d.spawn)("git",a,{cwd:b,stdio:["ignore","pipe","pipe"]});g.stdout?.on("data",a=>{e+=a.toString("utf8")}),g.stderr?.on("data",a=>{f+=a.toString("utf8")}),g.on("error",a=>c({code:null,stdout:"",stderr:a.message})),g.on("close",a=>c({code:a,stdout:e,stderr:f}))})}function z(a){let b=a.split("\0"),c=[],d=0;for(;d<b.length;){let a=b[d];if(d+=1,a.length<4)continue;let e=[a.slice(3)],[f,g]=a;if("R"===f||"C"===f||"R"===g||"C"===g){let a=b[d];d+=1,a&&e.push(a)}c.push(e)}return c}async function A(a,b){let c=await y(["merge-base",b,"HEAD"],a);if(0!==c.code||""===c.stdout.trim())return{error:`'git merge-base ${b} HEAD' failed; base ref is unreachable from this worktree.`+(c.stderr.trim()?`
|
|
2
|
-
${c.stderr.trim()}`:"")};let d=c.stdout.trim(),e=await y(["diff","--name-only","-z","--no-renames",d,"HEAD"],a);if(0!==e.code)return{error:`'git diff --name-only ${d} HEAD' failed.`+(e.stderr.trim()?`
|
|
3
|
-
${e.stderr.trim()}`:"")};let f=await y(["status","--porcelain","-z","--untracked-files=all"],a);return 0!==f.code?{error:"'git status --porcelain' failed."+(f.stderr.trim()?`
|
|
4
|
-
${f.stderr.trim()}`:"")}:{paths:[...new Set([...e.stdout.split("\0").filter(a=>""!==a),...z(f.stdout).flat()].filter(a=>!v(a)))].sort(),mergeBase:d}}function B(a){return a.length>0?a.join(", "):"(none)"}function C(a,b,c){return null===c?` ${a} ${b}`:` ${a} ${b} \u2190 ${c}`}async function D(a,b,c,d,e=null){let f=Date.now(),g=(a,b,c)=>({status:a,exitCode:c,startedAt:f,durationMs:Date.now()-f,logTail:b});if(!b)return g("skipped","scope: no contract is attached to this run, so no scope is declared to check.",null);if(!c)return g("skipped","scope: the contract sets success.requireScopeClean: false.",null);if(!d)return g("error","scope: no base ref, so there is nothing to diff against. Set options.baseRef in .commandmate/verify.yaml; origin/HEAD did not resolve a default branch.",null);let h=await A(a,d);if("error"in h)return g("error",`scope: ${h.error}`,null);let i=new x(b,e),j=[],k=[],l=new Map;for(let a of h.paths){let b=i.classify(a);if(b.admitted){j.push({path:a,pattern:b.pattern});continue}k.push(a),null!==b.pattern&&l.set(a,b.pattern)}let m=[`scope: baseRef=${d} changed=${h.paths.length} violations=${k.length}`,`allow: ${B(b.allow)}`,`deny: ${B(b.deny)}`,...function(a){if(0===a.length)return[];let b=a.slice(0,100),c=a.length-b.length;return["admitted:",...b.map(a=>C("+",a.path,a.pattern)),...c>0?[` ... (+${c} more)`]:[]]}(j)].join("\n");if(0===k.length)return g("passed",m,0);let n=k.slice(0,100),o=k.length-n.length;return g("failed",[m,"out of scope:",...n.map(a=>C("-",a,l.get(a)??null)),...o>0?[` ... and ${o} more`]:[],"To allow this diff, add the paths above to the contract's scope.allow (the issue's target-file list) and re-send the task (`send --contract`) — scope is judged from the send-time snapshot, so editing the contract file alone changes nothing. A path matching deny: is a deliberate prohibition; revert it instead."].join("\n"),1)}var E=c(90384),F=c(62171),G=c(85322);let H=(0,j.h)("lib/verification/gate-runner"),I="git diff --name-only / status --porcelain \xd7 contract scope",J="lsof -iTCP -sTCP:LISTEN / tmux list-sessions / $HOME / ~/.commandmate \xd7 task-start snapshot",K="[mutex]",L="[flaky]";function M(a,b){return`--- ${L} run ${a}/2: ${b.status} exit=${O(b.exitCode)} duration=${N(b.durationMs)} ---`}function N(a){return`${(a/1e3).toFixed(1)}s`}function O(a){return null===a?"n/a":String(a)}class P extends Error{constructor(a,b){super(`Verification run ${b} is already running for worktree '${a}'`),this.name="VerificationConflictError",this.worktreeId=a,this.runningRunId=b}}let Q=0,R=[],S=new Map,T=`${r} This gate was terminated before it reached a verdict.`,U=`${r} The run stopped before this gate started.`;class V{get cancelled(){return this.latched}register(a){return this.latched?(a(),()=>{}):(this.killers.add(a),()=>{this.killers.delete(a)})}cancel(){for(let a of(this.latched=!0,[...this.killers]))a()}constructor(){this.latched=!1,this.killers=new Set}}let W=new Map;async function X(a){let b,c=W.get(a),d=S.get(a);if(!c||!d)return{kind:"not-running"};c.cancel();let e=await Promise.race([d,new Promise(a=>{b=setTimeout(()=>a(null),8e3),b.unref?.()})]);return b&&clearTimeout(b),null===e?{kind:"requested"}:{kind:"cancelled",status:e}}class Y{constructor(a){this.maxBytes=a,this.chunks=[],this.size=0}append(a){if(!(this.maxBytes<=0)&&0!==a.length){for(this.chunks.push(a),this.size+=a.length;this.chunks.length>0&&this.size-this.chunks[0].length>=this.maxBytes;)this.size-=this.chunks.shift().length;if(this.size>this.maxBytes){let a=this.size-this.maxBytes;this.chunks[0]=this.chunks[0].subarray(a),this.size-=a}}}toString(){return 0===this.chunks.length?"":Buffer.concat(this.chunks).toString("utf8")}}function Z(a,b,c,e,f,g){return new Promise(h=>{let i,j,k=Date.now(),l=new Y(e),m=!1,n=!1,o=!1,p=(0,d.spawn)(a,{shell:!0,cwd:b,env:function(a){let b={...process.env,CI:"true",...a};return delete b.NODE_ENV,b}(f),detached:!0,stdio:["ignore","pipe","pipe"]});p.stdout?.on("data",a=>l.append(a)),p.stderr?.on("data",a=>l.append(a));let q=a=>{if(void 0!==p.pid)try{process.kill(-p.pid,a)}catch{try{p.kill(a)}catch{}}},r=g?.register(()=>{o=!0,q("SIGTERM"),j=setTimeout(()=>q("SIGKILL"),5e3),j.unref?.()}),s=a=>{m||(m=!0,clearTimeout(t),i&&clearTimeout(i),j&&clearTimeout(j),r?.(),h({...a,startedAt:k,durationMs:Date.now()-k}))},t=setTimeout(()=>{n=!0,q("SIGTERM"),i=setTimeout(()=>q("SIGKILL"),5e3),i.unref?.()},1e3*c);t.unref?.(),p.on("error",a=>{s({status:"error",exitCode:null,logTail:`${l.toString()}
|
|
5
|
-
[gate could not be spawned: ${a.message}]`.trim()})}),p.on("close",(a,b)=>n?void s({status:"timeout",exitCode:null,logTail:`${l.toString()}
|
|
6
|
-
[gate exceeded ${c}s and was terminated (${b??"exited"})]`.trim()}):o?void s({status:"skipped",exitCode:null,logTail:`${l.toString()}
|
|
7
|
-
${T} (${b??"exited"})`.trim()}):void s({status:0===a?"passed":"failed",exitCode:a,logTail:l.toString()||null}))})}async function $(a,b,c,d,e){let f=a.mutex;if(!f)return Z(a.command,b,a.timeoutSec,c,d,e);let g=await (0,p.xL)(f,{timeoutMs:1e3*a.timeoutSec,shouldAbandon:()=>e.cancelled});if(!g.acquired)return{status:"skipped",exitCode:null,startedAt:Date.now(),durationMs:0,logTail:g.abandoned?U:function(a,b,c){var d;if(c.acquired)throw Error("mutexWaitTimeoutLog called for an acquired lock");let e=c.heldBy?` (held by ${c.heldBy})`:"";return`reason=mutex-wait waited=${N(c.waitedMs)}
|
|
8
|
-
${K} name=${b} lock=${d=b,(0,p.M)(d,(0,p.H)())}${e}
|
|
9
|
-
Gate '${a.id}' declares mutex '${b}' and the machine-wide lock stayed held for its whole ${a.timeoutSec}s budget, so the command was never started. This is a resource conflict, not a verdict on the work: re-run once the other run finishes, or raise the gate's timeoutSec.`}(a,f,g)};try{var h,i,j;if(e.cancelled){let a=Date.now();return{status:"skipped",exitCode:null,startedAt:a,durationMs:0,logTail:U}}let k=await Z(a.command,b,a.timeoutSec,c,d,e);return{...k,logTail:(h=g.waitedMs,i=g.handle.path,j=k.logTail,aa(`${K} name=${f} waited=${N(h)} lock=${i}`,j))}}finally{g.handle.release()}}async function _(a,b,c,d,e){let f=await $(a,b,c,d,e);if(1!==a.retryOnFail||"failed"!==f.status)return f;let g=await $(a,b,c,d,e);return"passed"!==g.status&&"failed"!==g.status?{...f,logTail:aa(`${L} retry reached no verdict (${g.status}); the first run's result stands. Retry log:
|
|
10
|
-
`+(g.logTail??"(no output)"),f.logTail)}:function(a,b,c){let d="passed"===c.status?"flaky":"fail",e="flaky"===d&&!0===a.flakyIsPass,f=e?c:"flaky"===d?b:c,g=`${L} runs=2 outcome=${d} exit=${O(b.exitCode)},${O(c.exitCode)} duration=${N(b.durationMs)},${N(c.durationMs)} verdict=${e?"pass":"fail"}`,h=[M(1,b),b.logTail??"",M(2,c),c.logTail??""].join("\n");return{status:e?"passed":"failed",exitCode:f.exitCode,startedAt:b.startedAt,durationMs:b.durationMs+c.durationMs,logTail:`${g}
|
|
11
|
-
${h}`}}(a,f,g)}function aa(a,b){return b?`${a}
|
|
12
|
-
${b}`:a}function ab(a,b){return new Promise(c=>{let e="",f=(0,d.spawn)("git",a,{cwd:b,stdio:["ignore","pipe","ignore"]});f.stdout?.on("data",a=>{e+=a.toString("utf8")}),f.on("error",()=>c({code:null,stdout:""})),f.on("close",a=>c({code:a,stdout:e}))})}async function ac(a,b,c,d){let e=Date.now(),f=(a,b,c)=>({status:a,exitCode:c,startedAt:e,durationMs:Date.now()-e,logTail:b});if(!b)return f("error",`work-evidence: no base ref. Set options.baseRef in ${E.aT}; origin/HEAD did not resolve a default branch.`,null);let g=await ab(["merge-base",b,"HEAD"],a);if(0!==g.code||""===g.stdout.trim())return f("error",`work-evidence: 'git merge-base ${b} HEAD' failed; base ref is unreachable from this worktree.`,null);let h=g.stdout.trim(),i=await ab(["rev-list","--count",`${h}..HEAD`,"--",":(top)",`:(exclude,top)${u}`],a);if(0!==i.code)return f("error",`work-evidence: 'git rev-list --count ${h}..HEAD' failed.`,null);let j=Number.parseInt(i.stdout.trim(),10),k=await ab(["status","--porcelain","-z","--untracked-files=all"],a);if(0!==k.code)return f("error","work-evidence: 'git status --porcelain' failed.",null);let l=z(k.stdout).filter(a=>a.some(a=>!v(a))).length,m=`work-evidence: baseRef=${b} commits=${j} uncommitted=${l}`+(c.required?" requireCommit=true":"")+" (contract files excluded)";if(!Number.isFinite(j)||0===j&&0===l){let a=Number.isFinite(j)?d.fileCount():null;return null===a||0===a?f("failed",`${m}
|
|
13
|
-
No commits and no uncommitted changes: nothing to verify.`,1):f("passed",`${m}
|
|
14
|
-
${d.label}: ${a} file(s) changed. git found nothing; the agent did.`,0)}return c.required&&0===j?f("failed",`${m}
|
|
15
|
-
${c.sources.join(" and ")} requires a commit: uncommitted changes are not work evidence, commit them.`,1):f("passed",m,0)}async function ad(a,b){if(a.options.baseRef)return a.options.baseRef;let c=await (0,i.tR)(b);return c?`origin/${c}`:null}async function ae(a,b,c,d,f,h,i,j,k,m,o,p){var r,s;let{maxLogTailBytes:t,skipInPrimaryCheckout:u}=h.options,{runWorkEvidence:v,gates:w}=i,x={label:"opencode session diff",fileCount:()=>void 0!==f&&(f===G.k||(0,g.getAgentInstances)(a,c).some(a=>a.id===f&&a.cliTool===G.k))?(0,F.pw)(c,f):null},y=(0,l.fc)(k?.contract??null,h),z=null,A=()=>z??={CM_WORKTREE_ID:c,CM_WORKTREE_INDEX:String((0,q.Cr)(c))},B=(b,c)=>((0,g.finishGateResult)(a,b,{status:c.status,exitCode:c.exitCode,durationMs:c.durationMs,logTail:c.logTail,executionWindow:{startedAt:c.startedAt,finishedAt:c.startedAt+c.durationMs}}),c),C=async(c,d,e,f)=>B((0,g.createGateResult)(a,b,{gateId:c,command:d,source:e}).id,await f()),H=(c,d,e,f)=>{let h={status:"skipped",exitCode:null,startedAt:Date.now(),durationMs:0,logTail:f};return B((0,g.createGateResult)(a,b,{gateId:c,command:d,source:e}).id,h)},K=[],L=(a,b)=>{for(let c of(b.scope&&H(E.le,I,"builtin",a),b.envClean&&H(E.Q5,J,"builtin",a),b.gates))H(c.id,c.command,c.source,a)},M=a=>(L(U,a),"cancelled");if(v){let a=await C(E.uz,"git merge-base / rev-list / status --porcelain (excluding contract files)","builtin",()=>ac(d,j,y,x));if("passed"!==a.status)return L("skipped: the work-evidence gate did not pass.",{scope:"off"!==i.scope,envClean:i.runEnvClean,gates:w}),"failed"===a.status?"not_started":"error";if(K.push(a.status),p.cancelled)return M({scope:"off"!==i.scope,envClean:i.runEnvClean,gates:w})}if("off"!==i.scope){let a=m?H(E.le,I,"builtin",(r=m.id,s=m.status,`scope: task ${r} declares a scope for this worktree, but it is ${s} and this run was not attached to it, so its scope was NOT judged. Name the task when starting the run (\`wait --verify\` does this automatically).`)):await C(E.le,I,"builtin",()=>D(d,k?.contract.scope??null,k?.contract.success.requireScopeClean??!1,j,k?.contractPath??null)),b="explicit"===i.scope||null!==m;if(("skipped"!==a.status||b)&&K.push(a.status),p.cancelled)return M({scope:!1,envClean:i.runEnvClean,gates:w})}if(i.runEnvClean){let a=await C(E.Q5,J,"builtin",()=>(0,n.uT)({worktreeId:o.worktreeId,worktreePath:d,taskId:o.taskId,baseline:o.baseline,sources:o.decision.sources,ignoreHomeEntries:h.options.envCleanIgnoreHomeEntries}));if(K.push(a.status),p.cancelled)return M({scope:!1,envClean:!1,gates:w})}let N=u&&function(a,b){try{return(0,e.realpathSync)(a)===(0,e.realpathSync)(b)}catch{return!1}}(d,process.cwd());for(let[a,b]of w.entries()){if(p.cancelled)return M({scope:!1,envClean:!1,gates:w.slice(a)});if(N){K.push(H(b.id,b.command,b.source,"skipped: worktreePath is the server process working directory and options.skipInPrimaryCheckout is true.").status);continue}let c=await C(b.id,b.command,b.source,()=>_(b,d,t,A(),p));K.push(c.status)}return p.cancelled?"cancelled":K.some(a=>"failed"===a||"timeout"===a||"error"===a)?"failed":K.some(a=>"skipped"===a)?"error":"passed"}function af(a,b,c,d){try{(0,m.g)(a,b,c,void 0===d?void 0:{runId:d})}catch(a){H.warn("task-transition-failed",{taskId:b,event:c,error:a instanceof Error?a.message:String(a)})}}function ag(a,b,c,d,e){let f;try{f=(0,g.getVerificationRun)(a,c)?.gates.filter(a=>"passed"!==a.status&&"skipped"!==a.status).map(a=>a.gateId)}catch{}(0,k.notifyVerificationFailurePush)({worktreeId:b.worktreeId,runId:c,taskId:d,status:e,trigger:b.trigger,instanceId:b.instanceId??null,failedGateIds:f}).catch(()=>{})}async function ah(a){let b=(0,f.getDbInstance)(),c=(0,g.getRunningVerificationRun)(b,a.worktreeId);if(c)throw new P(a.worktreeId,c.id);let d=void 0!==a.taskId?(0,g.getTask)(b,a.taskId):(0,h.Zj)(b,a.worktreeId),e=function(a,b,c){if(null!==c||void 0!==b.taskId)return null;let[d]=(0,g.listTasks)(a,b.worktreeId,1);return d&&"pending"!==d.status&&d.contract.success.requireScopeClean?d:null}(b,a,d),i=a.taskId??d?.id??null,j=a.gateIds??(d?(0,l.Ky)(d.contract)??void 0:void 0),k=null,m=null;try{(k=(0,E.yR)(a.worktreePath))||(m=`${E.aT} not found in ${a.worktreePath}. Declare the repository verification gates there before running verification.`)}catch(a){m=a instanceof E.Yp?a.message:`Failed to read ${E.aT}: ${a.message}`}let p=(0,n.Uq)(d?.contract??null,k),q={workEvidence:d?.contract.success.requireWorkEvidence??!1,scope:(d?.contract.success.requireScopeClean??!1)||null!==e,envClean:p.required},r=null;if(k&&!m){let a=function(a,b){let c=a.gates.map(a=>({...a,source:"verify.yaml"})),d=new Set(c.map(a=>a.id)),e=b.filter(a=>d.has(a.id)).map(a=>a.id);return e.length>0?`Contract gate id(s) ${e.join(", ")} are already declared in ${E.aT}. A contract may add gates, never redefine the repository's own.`:[...c,...b.map(a=>({...a,source:"contract"}))]}(k,d?(0,l.cI)(d.contract):[]);if("string"==typeof a)m=a;else{let b=function(a,b,c){if(!b)return{runWorkEvidence:!0,scope:"implicit",runEnvClean:c.envClean,gates:a};let d=new Set([E.uz,E.le,E.Q5,...a.map(a=>a.id)]),e=b.filter(a=>!d.has(a));if(e.length>0)return`Unknown gate id(s): ${e.join(", ")}. Declared gates: ${[...d].join(", ")}.`;let f=new Set(b),g={runWorkEvidence:f.has(E.uz)||c.workEvidence,scope:f.has(E.le)||c.scope?"explicit":"off",runEnvClean:f.has(E.Q5)||c.envClean,gates:a.filter(a=>f.has(a.id))};return g.runWorkEvidence||"off"!==g.scope||g.runEnvClean||0!==g.gates.length?g:"gateIds selected no gates; a run with no gates has nothing to report."}(a,j,q);"string"==typeof b?m=b:r=b}}let s=k?await ad(k,a.worktreePath):null,t=(0,g.createVerificationRun)(b,{worktreeId:a.worktreeId,trigger:a.trigger,instanceId:a.instanceId??null,taskId:i,baseRef:s});if(!k||!r){let c=Date.now(),e=(0,g.createGateResult)(b,t.id,{gateId:"config",command:E.aT,source:"builtin"});return(0,g.finishGateResult)(b,e.id,{status:"error",exitCode:null,durationMs:0,logTail:m,executionWindow:{startedAt:c,finishedAt:c}}),(0,g.finishVerificationRun)(b,t.id,"error"),H.warn("verification-config-unusable",{runId:t.id,worktreeId:a.worktreeId}),ag(b,a,t.id,i,"error"),d&&(af(b,d.id,"verify_started",t.id),af(b,d.id,"verify_failed",t.id)),{runId:t.id}}d&&af(b,d.id,"verify_started",t.id);let u=new V;W.set(t.id,u);let v=k,w=r,x={worktreeId:a.worktreeId,taskId:i,baseline:w.runEnvClean&&i?(0,o.g9)(i):null,decision:p},y=(async()=>{await (Q<2?(Q+=1,Promise.resolve()):new Promise(a=>{R.push(a)}));let c="error";try{if(u.cancelled)return c="cancelled",(0,g.finishVerificationRun)(b,t.id,"cancelled"),"cancelled";let f=await ae(b,t.id,a.worktreeId,a.worktreePath,a.instanceId,v,w,s,d,e,x,u);return c=f,(0,g.finishVerificationRun)(b,t.id,f),f}catch(a){H.error("verification-run-crashed",{runId:t.id,error:a instanceof Error?a.message:String(a)});try{(0,g.finishVerificationRun)(b,t.id,"error")}catch{}return"error"}finally{d&&af(b,d.id,function(a){switch(a){case"passed":return"verify_passed";case"not_started":return"verify_not_started";case"cancelled":return"cancel";default:return"verify_failed"}}(c),t.id),ag(b,a,t.id,i,c),function(){let a=R.shift();if(a)return a();Q-=1}(),S.delete(t.id),W.delete(t.id)}})();return S.set(t.id,y),{runId:t.id}}}};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=4443,exports.ids=[4443],exports.modules={2466:(a,b,c)=>{c.d(b,{ek:()=>h,u_:()=>g});var d=c(13287);function e(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function f(a,b){if("string"!=typeof a)return null;let c=a.trim();return""===c?null:c.slice(0,b)}function g(a){if(!e(a)||!Array.isArray(a.questions)||0===a.questions.length||a.questions.length>20)return null;let b=[];for(let c of a.questions){let a=function(a){if(!e(a))return null;let b=f(a.question,1e3);if(null===b||!Array.isArray(a.options)||0===a.options.length||a.options.length>20)return null;let c=[];for(let b of a.options){let a=function(a){if(!e(a))return null;let b=f(a.label,200);return null===b?null:{label:b,description:f(a.description,500)}}(b);if(null===a)return null;c.push(a)}return{question:b,header:f(a.header,64),multiSelect:!0===a.multiSelect,choices:c}}(c);if(null===a)return null;b.push(a)}return b}function h(a){if(!e(a)||a.tool_name!==d.k$)return null;let b=g(a.tool_input);return null===b?null:{questions:b,promptId:f(a.prompt_id,256)}}},18529:(a,b,c)=>{c.d(b,{$x:()=>s,Lj:()=>t,Q1:()=>r,QH:()=>u});var d=c(29021),e=c(21820),f=c(33873),g=c(8004),h=c(24455),i=c(72626),j=c(43252),k=c(79827);let l=(0,i.h)("lib/hooks/sources/opencode/launch-settings"),m=globalThis.__opencodeLaunchSettings??=new Map;function n(a){return(0,h.v7)(a.worktreeId,a.cliToolId,a.instanceId)}function o(){let a=(0,f.join)((0,e.homedir)(),".commandmate","opencode-launch-settings.json");return(0,g.T)(process.env.CM_OPENCODE_LAUNCH_SETTINGS_FILE,a,"CM_OPENCODE_LAUNCH_SETTINGS_FILE")}function p(){try{let a=JSON.parse((0,d.readFileSync)(o(),"utf8"));if("object"!=typeof a||null===a||Array.isArray(a))return{};let b={};for(let[c,d]of Object.entries(a)){let a=(0,k.ZH)(d);(0,k.Mj)(a)&&(b[c]=a)}return b}catch{return{}}}function q(a){let b=o();try{(0,d.mkdirSync)((0,f.dirname)(b),{recursive:!0}),(0,d.writeFileSync)(b,`${JSON.stringify(a,null,2)}
|
|
2
|
-
`,{mode:384})}catch(a){l.warn("opencode-launch-settings-write-failed",{path:b,error:a instanceof Error?a.message:String(a)})}}function r(a){let b=n(a),c=m.get(b);if(c)return c;let d=p()[b];return d?(m.set(b,d),d):{...k.gF}}function s(a,b){let c=n(a),d=(0,k.ZH)(b??{}),e=p();return(0,k.Mj)(d)?(m.set(c,d),e[c]=d,q(e)):(m.delete(c),c in e&&(delete e[c],q(e))),d}function t(a){let b=(0,k.ZH)(a??{}),c=[];b.agent&&c.push(`--agent ${(0,j.ZL)(b.agent)}`);let d=(0,k.sw)(b);return d&&c.push(`--model ${(0,j.ZL)(d)}`),c.length>0?` ${c.join(" ")}`:""}function u(a){let b=(0,k.ZH)(a??{}),c={};return b.agent&&(c.agent=b.agent),b.providerId&&b.modelId&&(c.model={providerID:b.providerId,modelID:b.modelId}),b.variant&&(c.variant=b.variant),Object.keys(c).length>0?c:null}},27128:(a,b,c)=>{function d(a){return a.split("\n").map(a=>a.length>0?`> ${a}`:">").join("\n")}function e(a){let b=[],c=[],e=[];for(let d of a)0!==d.text.length&&("tool"===d.kind?e.push(d.text):"reasoning"===d.kind?c.push(d.text):b.push(d.text));let f=b.join("\n\n"),g=0===c.length?"":[`> **Thinking (${c.length})**`,">",c.map(d).join("\n>\n")].join("\n"),h=0===e.length?"":[`> **Tool calls (${e.length})**`,">",...e.map(d)].join("\n");return{body:[f,g,h].filter(a=>a.length>0).join("\n\n"),prose:f,reasoningLog:g,reasoningBlocks:c.length,toolLog:h,toolCalls:e.length}}c.d(b,{t3:()=>e})},27939:(a,b,c)=>{c.d(b,{F_:()=>r,KA:()=>s,XO:()=>v,Y2:()=>l,jp:()=>k,lr:()=>t,pr:()=>u});var d=c(29021),e=c(21820),f=c(33873),g=c(8004),h=c(24455);let i=(0,c(72626).h)("lib/session/opencode-session-store"),j=/^ses[A-Za-z0-9_-]{1,128}$/;function k(a){return"string"==typeof a&&j.test(a)}let l=200,m=globalThis.__opencodeSessionMemories??=new Map;function n(a){return(0,h.v7)(a.worktreeId,a.cliToolId,a.instanceId)}function o(){let a=(0,f.join)((0,e.homedir)(),".commandmate","opencode-sessions.json");return(0,g.T)(process.env.CM_OPENCODE_SESSION_FILE,a,"CM_OPENCODE_SESSION_FILE")}function p(){try{let a=JSON.parse((0,d.readFileSync)(o(),"utf8"));if("object"!=typeof a||null===a||Array.isArray(a))return{};let b={};for(let[c,d]of Object.entries(a))!("object"!=typeof d||null===d||Array.isArray(d))&&k(d.sessionId)&&"string"==typeof d.worktreePath&&d.worktreePath.length>0&&(b[c]={sessionId:d.sessionId,title:"string"==typeof d.title?d.title:null,worktreePath:d.worktreePath,updatedAt:"number"==typeof d.updatedAt?d.updatedAt:0});return b}catch{return{}}}function q(a){let b=o();try{(0,d.mkdirSync)((0,f.dirname)(b),{recursive:!0}),(0,d.writeFileSync)(b,`${JSON.stringify(a,null,2)}
|
|
3
|
-
`,{mode:384})}catch(a){i.warn("opencode-session-file-write-failed",{path:b,error:a instanceof Error?a.message:String(a)})}}function r(a,b,c=Date.now()){if(!k(b.sessionId))return i.warn("opencode-session-id-rejected",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId}),!1;if(0===b.worktreePath.length)return!1;let d={sessionId:b.sessionId,title:"string"==typeof b.title?b.title.slice(0,l):null,worktreePath:b.worktreePath,updatedAt:c},e=n(a);m.set(e,d);let f=p();return f[e]=d,q(f),!0}function s(a){let b=n(a),c=m.get(b);if(c)return c;let d=p()[b];return d?(m.set(b,d),d):null}function t(a){let b=n(a);m.delete(b);let c=p();b in c&&(delete c[b],q(c))}function u(a,b){let c=s(a);return c?c.worktreePath!==b?(i.info("opencode-session-recovery-path-mismatch",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,recorded:c.worktreePath}),null):k(c.sessionId)?c.sessionId:null:null}function v(a,b){return k(b)?`${a} -s ${b}`:a}},53163:(a,b,c)=>{c.d(b,{FN:()=>_,lf:()=>T,ym:()=>X,hS:()=>V,f4:()=>W,wb:()=>S,bP:()=>Z,yn:()=>U,H1:()=>Y});var d=c(72626),e=c(24455),f=c(3161),g=c(48083),h=c(27939),i=c(62171),j=c(57510),k=c(49791),l=c(86594),m=c(27128);let n="parentID",o="\n\n_(truncated)_";function p(a,b,c){return{sessionId:a,userMessageId:b,parts:new Map,assistantMessageIds:new Set,startedAt:c,overflowed:!1}}function q(a,b){a.assistantMessageIds.add(b)}function r(a,b){return a.assistantMessageIds.has(b)}function s(a){if(!(0,j.Qd)(a))return null;let b=(0,j.O2)(a,"id"),c=(0,j.O2)(a,"messageID"),d=(0,j.O2)(a,"type");if(!b||!c||!d)return null;let e=(0,j.Qd)(a.state)?a.state:null;return{id:b,messageId:c,type:d,text:"string"==typeof a.text?a.text:null,tool:(0,j.O2)(a,"tool"),status:e?(0,j.O2)(e,"status"):null,title:e?(0,j.O2)(e,"title"):null,error:e?(0,j.O2)(e,"error")??(0,j.NZ)(e,["error","message"]):null}}function t(a,b){return!a.parts.has(b.id)&&a.parts.size>=512?(a.overflowed=!0,!1):(a.parts.set(b.id,b),!0)}let u=new Set(["step-start","step-finish","snapshot","patch"]);function v(a){return a.replace(/\s+/g," ").trim()}function w(a){let b=[],c=new Set,d=0,e=0;for(let f of a.parts.values()){if("text"===f.type){let a=f.text?.trim()??"";if(0===a.length)continue;b.push({kind:"prose",text:a}),d+=1;continue}if("reasoning"===f.type){let a=f.text?.trim()??"";if(0===a.length)continue;b.push({kind:"reasoning",text:a});continue}if("tool"===f.type){if("pending"===f.status)continue;b.push({kind:"tool",text:function(a){let b=a.tool??"tool",c=a.title??null,d="error"===a.status,e=`- \`${b}\`${c?` — ${v(c)}`:""}`;return d?a.error?`${e} _(error: ${v(a.error)})_`:`${e} _(error)_`:e}(f)}),e+=1;continue}u.has(f.type)||c.add(f.type)}let f=(0,m.t3)(b),g=f.body;return g.length>2e5&&(g=g.slice(0,2e5-o.length)+o),{sessionId:a.sessionId,userMessageId:a.userMessageId,body:g,textParts:d,toolParts:e,reasoningParts:f.reasoningBlocks,unknownPartTypes:[...c]}}let x=(0,d.h)("lib/hooks/sources/opencode/history"),y=globalThis.__opencodeTranscripts??=new Map;function z(a){return(0,e.v7)(a.worktreeId,a.cliToolId,a.instanceId)}function A(a){let b=z(a),c=y.get(b);return c||(c=new Map,y.set(b,c)),c}async function B(a,b){try{let{emitChatTurnProgress:d}=await Promise.all([c.e(1356),c.e(1503),c.e(1634),c.e(1191),c.e(8791),c.e(1719),c.e(2119),c.e(2445),c.e(252),c.e(8800),c.e(3480),c.e(9130),c.e(7905),c.e(9731),c.e(8728),c.e(1990),c.e(8918),c.e(650),c.e(611),c.e(9882),c.e(964)]).then(c.bind(c,94676));await d({worktreeId:a.worktreeId,cliToolId:a.cliToolId,instanceId:a.instanceId??a.cliToolId},()=>{let a=w(b);return 0===a.body.length?null:{turnKey:(0,l.jT)(a.userMessageId),body:a.body,partial:!1}})}catch(b){x.debug("opencode-transcript-progress-failed",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,error:b instanceof Error?b.message:String(b)})}}function C(a){return"number"==typeof a&&Number.isFinite(a)?a:null}async function D(a,b,c=Date.now()){let d=y.get(z(a)),e=d?.get(b);return!!e&&!!d&&(d.delete(b),E(a,w(e),Math.max(e.startedAt,c),"stream"))}async function E(a,b,d,e){let f=a.instanceId??a.cliToolId;try{if(0===b.body.length)return x.info("opencode-transcript-turn-empty",{worktreeId:a.worktreeId,instanceId:f,sessionId:b.sessionId,origin:e}),!1;b.unknownPartTypes.length>0&&x.info("opencode-transcript-unknown-parts",{worktreeId:a.worktreeId,instanceId:f,sessionId:b.sessionId,partTypes:b.unknownPartTypes});let g=(0,l.jT)(b.userMessageId),[{getDbInstance:h},{createMessage:i,findMessageByRequestId:j},{broadcastMessage:k}]=await Promise.all([Promise.resolve().then(c.bind(c,88807)),Promise.resolve().then(c.bind(c,56791)),Promise.all([c.e(1356),c.e(1503),c.e(1191),c.e(8791),c.e(1719),c.e(2119),c.e(2445),c.e(8728),c.e(8583)]).then(c.bind(c,43015))]),m=h();if(j(m,a.worktreeId,g))return x.debug("opencode-transcript-turn-already-saved",{worktreeId:a.worktreeId,instanceId:f,requestId:g,origin:e}),!1;let n=i(m,{worktreeId:a.worktreeId,role:"assistant",content:b.body,messageType:"normal",timestamp:new Date(d>0?d:Date.now()),cliToolId:a.cliToolId,instanceId:f,requestId:g});return k("message",{worktreeId:a.worktreeId,message:n}),x.info("opencode-transcript-turn-saved",{worktreeId:a.worktreeId,instanceId:f,sessionId:b.sessionId,requestId:g,origin:e,bodyLength:b.body.length,textParts:b.textParts,toolParts:b.toolParts}),!0}catch(c){return x.error("opencode-transcript-write-failed",{worktreeId:a.worktreeId,instanceId:f,sessionId:b.sessionId,origin:e,error:c instanceof Error?c.message:String(c)}),!1}}async function F(a,b,c){let d=a.instanceId??a.cliToolId;try{let e=await (0,k.EI)(b,c);if(null===e)return x.info("opencode-transcript-backfill-unavailable",{worktreeId:a.worktreeId,instanceId:d,port:b,sessionId:c}),0;let f=function(a,b){if(!Array.isArray(a))return[];let c=new Map;for(let d of a){if(!(0,j.Qd)(d))continue;let a=(0,j.Qd)(d.info)?d.info:null;if(!a||"assistant"!==a.role)continue;let e=(0,j.O2)(a,n);if(!e)continue;let f=function(a,b){let c=a;for(let a of b){if(!(0,j.Qd)(c))return null;c=c[a]}return"number"==typeof c&&Number.isFinite(c)?c:null}(a,["time","created"])??0,g=c.get(e);g||(g=p(b,e,f),c.set(e,g));let h=(0,j.O2)(a,"id");for(let a of(h&&q(g,h),Array.isArray(d.parts)?d.parts:[])){let b=s(a);b&&r(g,b.messageId)&&t(g,b)}}return[...c.values()]}(e,c),g=[...f].sort((a,b)=>b.startedAt-a.startedAt),h=g.slice(0,50);g.length>h.length&&x.warn("opencode-transcript-backfill-truncated",{worktreeId:a.worktreeId,instanceId:d,sessionId:c,examined:h.length,skipped:g.length-h.length,limit:50});let i=function(a){let b=new Map;if(!Array.isArray(a))return b;for(let c of a){if(!(0,j.Qd)(c))continue;let a=(0,j.Qd)(c.info)?c.info:null;if(!a||"assistant"!==a.role)continue;let d=(0,j.O2)(a,n);if(!d)continue;let e=(0,j.Qd)(a.time)?a.time:null,f=C(e?.completed)??C(e?.created)??null;null!==f&&f>(b.get(d)??0)&&b.set(d,f)}return b}(e),l=0;for(let b of[...h].reverse())await E(a,w(b),Math.max(b.startedAt,i.get(b.userMessageId)??0),"backfill")&&(l+=1);return x.info("opencode-transcript-backfill-done",{worktreeId:a.worktreeId,instanceId:d,port:b,sessionId:c,turns:f.length,written:l}),l}catch(e){return x.error("opencode-transcript-backfill-failed",{worktreeId:a.worktreeId,instanceId:d,port:b,sessionId:c,error:e instanceof Error?e.message:String(e)}),0}}var G=c(75356),H=c(98211),I=c(90488),J=c(84574);function K(a){let b=(0,j.Qd)(a.properties)?a.properties:{};return(0,j.NZ)(b,["sessionID"])}function L(a,b){for(;a.size>b;){let b=a.keys().next();if(b.done)break;a.delete(b.value)}}let M=(0,d.h)("lib/hooks/sources/opencode/subscription"),N=[1e3,2e3,4e3,8e3,15e3,3e4],O=globalThis.__opencodeSubscriptions??=new Map,P=globalThis.__opencodeDroppedLiveness??=new Map,Q=globalThis.__opencodeProbedActivity??=new Map;function R(a){return(0,e.v7)(a.worktreeId,a.cliToolId,a.instanceId)}function S(a){return O.has(R(a))}function T(a){let b=R(a);return O.get(b)?.liveness??P.get(b)??{state:"unknown"}}function U(a,b,c){Q.set(R(a),{activity:b,at:c})}function V(a){return Q.get(R(a))??null}function W(a){return"live"===T(a).state}function X(a){return O.get(R(a))?.gate.primarySession()??null}function Y(a,b,c){let d=O.get(R(a));if(!d)return{seen:Promise.resolve(!1),cancel:()=>{}};let e=()=>{},f=new Promise(a=>{e=a}),g=d.idleWaiters.get(b)??new Set;d.idleWaiters.set(b,g);let h=null,i=a=>{g.delete(i)&&(0===g.size&&d.idleWaiters.delete(b),null!==h&&clearTimeout(h),e(a))};return g.add(i),h=setTimeout(()=>i(!1),c),h.unref?.(),{seen:f,cancel:()=>i(!1)}}async function Z(a,b,c,d={}){let e=R(a),f=O.get(e);if(f)return $(f);P.delete(e),Q.delete(e);let g=d.port??(0,J.hC)(a);if(null===g)return M.info("opencode-subscription-skipped-no-port",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId}),{close:async()=>{},liveness:{state:"unknown"}};let h={key:e,target:a,port:g,onEvent:b,normalize:c,gate:function(a=64,b=512,c=64){let d=new Map,e=new Set,f=new Set,g=null,h=(b,c)=>{d.delete(b),d.set(b,c),L(d,a)},i=()=>null!==g&&"busy"===d.get(g),k=a=>{var b;h(a,"busy"),b=a,!f.has(b)&&g!==b&&(i()||(g=b))};return{observe(a,l){let m=function(a){let b=(0,j.Qd)(a.properties)?a.properties:{},c=(0,j.Qd)(b.info)?b.info:null;return null!==c&&(0,j.NZ)(c,["parentID"])?(0,j.NZ)(c,["id"])??(0,j.NZ)(b,["sessionID"]):null}(l);if(null!==m&&(f.add(m),L(f,c),g===m&&(g=null)),"message.updated"===a){let{role:a,id:c}=function(a){let b=(0,j.Qd)(a.properties)?a.properties:{};return{role:(0,j.NZ)(b,["info","role"]),id:(0,j.NZ)(b,["info","id"])}}(l);if("user"!==a||null===c)return{kind:"ignored"};let d=K(l)??"";return e.has(c)?{kind:"suppressed",sessionId:d,reason:"already-announced"}:(e.add(c),L(e,b),{kind:"announced",sessionId:d,messageId:c})}if("session.status"===a){if("busy"!==function(a){let b=(0,j.Qd)(a.properties)?a.properties:{};return(0,j.NZ)(b,["status","type"])}(l))return{kind:"ignored"};let a=K(l);return null===a?{kind:"ignored"}:(k(a),{kind:"armed",sessionId:a})}if("session.error"===a){let a=K(l);return null===a?{kind:"ignored"}:{kind:"failed",sessionId:a,errorName:function(a){let b=(0,j.Qd)(a.properties)?a.properties:{};return(0,j.NZ)(b,["error","name"])}(l)}}if("session.idle"!==a)return{kind:"ignored"};let n=K(l);if(null===n)return{kind:"ignored"};if(f.has(n)||null!==g&&n!==g&&i())return h(n,"idle"),{kind:"suppressed",sessionId:n,reason:"foreign-session"};let o=d.get(n);return void 0===o?{kind:"suppressed",sessionId:n,reason:"never-armed"}:"idle"===o?{kind:"suppressed",sessionId:n,reason:"already-completed"}:(h(n,"idle"),{kind:"completed",sessionId:n})},isArmed:a=>"busy"===d.get(a),arm(a){k(a)},armedSessions:()=>[...d.entries()].filter(([,a])=>"busy"===a).map(([a])=>a),primarySession:()=>g,reset(){d.clear(),g=null}}}(),resync:d.resync??"none",seenDecisions:new Set,idleWaiters:new Map,announcedUpdates:new Set,streamController:new AbortController,lifetimeController:new AbortController,serverVersion:null,liveness:{state:"unknown"},closed:!1,watchdog:null};return O.set(e,h),M.info("opencode-subscription-opened",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,port:g}),ac(h),$(h)}function $(a){return{close:async()=>{await _(a.target)},get liveness(){return a.liveness}}}async function _(a){let b=R(a);P.delete(b),Q.delete(b);let c=O.get(b);if(c){for(let a of(c.closed=!0,aa(c),[...c.idleWaiters.values()]))for(let b of[...a])b(!1);c.idleWaiters.clear(),c.streamController.abort(),c.lifetimeController.abort(),O.delete(b),(0,f.cI)(a),y.delete(z(a)),(0,i.WC)(a),M.info("opencode-subscription-closed",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,port:c.port})}}function aa(a){null!==a.watchdog&&(clearTimeout(a.watchdog),a.watchdog=null)}function ab(a){aa(a);let b=setTimeout(()=>{a.closed||(M.warn("opencode-subscription-heartbeat-lost",{worktreeId:a.target.worktreeId,instanceId:a.target.instanceId??a.target.cliToolId,port:a.port,afterMs:3e4}),a.streamController.abort())},3e4);b.unref?.(),a.watchdog=b}async function ac(a){let b=0;for(;!a.closed;){a.streamController=new AbortController;let c=a.gate.armedSessions();a.gate.reset();let d="stream-ended";try{let e=await ad(a);if(a.closed)break;if("changed"===e)return;if("unreachable"===e)d="health-unreachable";else{let d=await (0,k.mi)(a.port,a.streamController.signal);for await(let e of(a.liveness={state:"live",lastHeartbeatAt:Date.now()},ab(a),await ae(a),await af(a,c),await ag(a),b=0,d))b=0,ab(a),function(a,b){let c=(0,j.O2)(b,"type");("server.heartbeat"===c||"server.connected"===c)&&(a.liveness={state:"live",lastHeartbeatAt:Date.now()}),ah(a,b,Date.now())}(a,e)}}catch(a){d=a instanceof Error?a.message:String(a)}finally{aa(a)}if(a.closed)break;a.liveness={state:"lost",since:Date.now(),reason:d},M.warn("opencode-subscription-disconnected",{worktreeId:a.target.worktreeId,instanceId:a.target.instanceId??a.target.cliToolId,port:a.port,reason:d,attempt:b}),await function(a,b){return new Promise(c=>{if(b.aborted)return void c();let d=()=>{clearTimeout(e),c()};b.addEventListener("abort",d,{once:!0});let e=setTimeout(()=>{b.removeEventListener("abort",d),c()},a);e.unref?.()})}(function(a){let b=Math.min(a,N.length-1);return N[b]}(b),a.lifetimeController.signal),b+=1}}async function ad(a){var b,c;let d=await (0,k.sc)(a.port);if("healthy"!==d.kind)return M.info("opencode-subscription-health-unavailable",{worktreeId:a.target.worktreeId,instanceId:a.target.instanceId??a.target.cliToolId,port:a.port,outcome:d.kind,status:"rejected"===d.kind?d.status:void 0}),"unreachable";let e=d.health.version;return null===a.serverVersion||null===e?(a.serverVersion??=e,"same"):e===a.serverVersion?"same":(b=a,c=e,M.warn("opencode-subscription-port-identity-changed",{worktreeId:b.target.worktreeId,instanceId:b.target.instanceId??b.target.cliToolId,port:b.port,reason:"port_identity_changed",expectedVersion:b.serverVersion,observedVersion:c}),b.closed=!0,aa(b),b.streamController.abort(),b.lifetimeController.abort(),b.liveness={state:"lost",since:Date.now(),reason:"port_identity_changed"},O.delete(b.key),P.set(b.key,b.liveness),"changed")}async function ae(a){let b=Date.now(),[c,d]=await Promise.all([(0,k.Li)(a.port),(0,k.er)(a.port)]),e=(c,d)=>{let e=c.slice(0,50);for(let f of(c.length>e.length&&M.warn("opencode-resync-truncated",{worktreeId:a.target.worktreeId,instanceId:a.target.instanceId??a.target.cliToolId,type:d,examined:e.length,skipped:c.length-e.length,limit:50}),e)){let c=(0,j.O2)(f,"id");!c||a.seenDecisions.has(c)||ah(a,{id:`resync_${c}`,type:d,properties:f},b)}};e(c,"permission.asked"),e(d,"question.asked")}async function af(a,b){if("session-status-poll"!==a.resync)return;let c=await (0,k.mY)(a.port);if(null===c)return void M.info("opencode-resync-status-unavailable",{worktreeId:a.target.worktreeId,instanceId:a.target.instanceId??a.target.cliToolId,port:a.port});let d=[];for(let[b,e]of Object.entries(c))"busy"===e&&(a.gate.arm(b),d.push(b));let e=[];for(let d of b)"idle"===c[d]&&(a.gate.arm(d),e.push(d),ah(a,{id:`resync_idle_${d}`,type:"session.idle",properties:{sessionID:d}},Date.now()));(d.length>0||e.length>0)&&M.info("opencode-turn-state-recovered",{worktreeId:a.target.worktreeId,instanceId:a.target.instanceId??a.target.cliToolId,port:a.port,rearmed:d,synthesized:e,primarySession:a.gate.primarySession()})}async function ag(a){try{let b=(0,h.KA)(a.target)?.sessionId??null,c=a.gate.primarySession()??b;if(!c)return;await F(a.target,a.port,c)}catch(b){M.warn("opencode-history-recovery-failed",{worktreeId:a.target.worktreeId,instanceId:a.target.instanceId??a.target.cliToolId,port:a.port,error:b instanceof Error?b.message:String(b)})}}function ah(a,b,c){var d,e;let h=(0,j.O2)(b,"type");if("message.part.updated"===h){let a=(0,G.Zu)(b),c=(0,G.Dp)(b);a&&c&&(0,H.XL)(a,c)}if("session.updated"===h){let d=(0,f.Tv)(b,c);d&&(0,f.G1)(a.target,d)}if(("session.updated"===h||"message.updated"===h)&&(0,g.recordAgentReportedEffort)(a.target.worktreeId,a.target.cliToolId,a.target.instanceId,(0,G.Jd)(b)),("message.updated"===h||"message.part.updated"===h)&&function(a,b,c){try{let d=(0,j.O2)(b,"type"),e=(0,j.Qd)(b.properties)?b.properties:{},f=(0,j.O2)(e,"sessionID");if(!f)return;if("message.updated"===d){let b=(0,j.Qd)(e.info)?e.info:null;if(!b||"assistant"!==b.role)return;let d=(0,j.O2)(b,"parentID");if(!d)return;let g=A(a),h=g.get(f),i=h?.userMessageId===d?h:p(f,d,c);if(i!==h)for(h&&x.info("opencode-transcript-turn-superseded",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,sessionId:f,abandoned:h.userMessageId}),g.set(f,i);g.size>16;){let b=g.keys().next();if(b.done)break;g.delete(b.value),x.info("opencode-transcript-turn-evicted",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,sessionId:b.value,reason:"max-open-turns"})}let k=(0,j.O2)(b,"id");k&&q(i,k);return}if("message.part.updated"!==d)return;let g=s(e.part);if(!g)return;let h=A(a).get(f);if(!h||!r(h,g.messageId))return void x.debug("opencode-transcript-part-unattached",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,sessionId:f,partType:g.type,reason:h?"foreign-message":"no-open-turn"});t(h,g)||x.warn("opencode-transcript-turn-overflow",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,sessionId:f,partType:g.type}),B(a,h)}catch(b){x.error("opencode-transcript-record-failed",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,error:b instanceof Error?b.message:String(b)})}}(a.target,b,c),("session.diff"===h||"session.updated"===h||"message.updated"===h)&&(0,i.hf)(a.target,b,c),"installation.update-available"===h&&function(a,b,c){let d=(0,j.Qd)(b.properties)?b.properties:{},e=(0,j.O2)(d,"version");if(e){if(a.announcedUpdates.has(e))return M.info("opencode-update-available-repeat-dropped",{worktreeId:a.target.worktreeId,instanceId:a.target.instanceId??a.target.cliToolId,version:e});a.announcedUpdates.add(e),M.info("opencode-update-available",{worktreeId:a.target.worktreeId,instanceId:a.target.instanceId??a.target.cliToolId,version:e}),(0,I.BF)(a.target,a.target.instanceId??a.target.cliToolId,e,c)}}(a,b,c),"session.idle"===h){let c=(0,j.O2)((0,j.Qd)(b.properties)?b.properties:{},"sessionID");if(c){let b=a.idleWaiters.get(c);if(b)for(let a of[...b])a(!0);D(a.target,c)}}let k=a.gate.observe(h,b);"failed"===k.kind&&M.warn("opencode-session-error",{worktreeId:a.target.worktreeId,instanceId:a.target.instanceId??a.target.cliToolId,sessionId:k.sessionId,errorName:k.errorName});let l=null;try{l=a.normalize({payload:b,receivedAt:c})}catch(a){M.error("opencode-normalize-threw",{type:h,error:a instanceof Error?a.message:String(a)});return}if(!l)return;let m=(d=l.event,e=k,"stop"===d&&"completed"!==e.kind?"suppressed"===e.kind?e.reason:"not-a-turn-end":"user_prompt_submit"===d&&"announced"!==e.kind?"suppressed"===e.kind?e.reason:"not-a-new-prompt":null);if(null!==m)return void M.info("opencode-repeat-suppressed",{worktreeId:a.target.worktreeId,instanceId:a.target.instanceId??a.target.cliToolId,sessionId:l.conversationId,event:l.event,reason:m});!function(a,b){let c=(0,j.O2)(b,"type");if("permission.asked"!==c&&"question.asked"!==c)return;let d=(0,j.Qd)(b.properties)?b.properties:{},e=(0,j.O2)(d,"id");if(e)for(a.seenDecisions.add(e);a.seenDecisions.size>256;){let b=a.seenDecisions.values().next();if(b.done)break;a.seenDecisions.delete(b.value)}}(a,b);try{a.onEvent(l)}catch(a){M.error("opencode-event-handler-failed",{type:h,error:a instanceof Error?a.message:String(a)})}}},62171:(a,b,c)=>{c.d(b,{HL:()=>q,WC:()=>r,hf:()=>p,ki:()=>u,pw:()=>v,rn:()=>s,t2:()=>t});var d=c(72626),e=c(24455),f=c(85322),g=c(84574),h=c(49791);let i=(0,d.h)("lib/hooks/sources/opencode/diff"),j=globalThis.__opencodeSessionDiff??(globalThis.__opencodeSessionDiff=new Map),k=globalThis.__opencodeSessionDiffRefreshes??(globalThis.__opencodeSessionDiffRefreshes=new Set);function l(a){return(0,e.v7)(a.worktreeId,a.cliToolId,a.instanceId)}function m(a){return{sessionId:null,turnMessageId:null,files:[],filesAt:null,revertedFiles:[],revertedMessageId:null,at:a}}function n(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function o(a,b){let c=a[b];return"string"!=typeof c||0===c.length?null:c.slice(0,128)}function p(a,b,c){let d=l(a),e=j.get(d)??m(c),f=function(a){if("message.updated"!==a.type)return null;let b=n(a.properties)?a.properties:null,c=b&&n(b.info)?b.info:null;if(!c||"user"!==c.role)return null;let d=o(c,"id");return d?{sessionId:o(c,"sessionID"),messageId:d}:null}(b);if(f){if(f.messageId===e.turnMessageId)return;j.set(d,{...e,sessionId:f.sessionId??e.sessionId,turnMessageId:f.messageId,files:[],filesAt:null,at:c});return}let g=function(a){let b=a.type,c=n(a.properties)?a.properties:null;if(!c)return null;if("session.diff"===b)return{kind:"files",sessionId:o(c,"sessionID"),files:(0,h.M)(c.diff)};if("session.updated"===b){let a=n(c.info)?c.info:null;if(!a||"string"==typeof a.parentID&&a.parentID.length>0)return null;let b=n(a.revert)?a.revert:null;return{kind:"held",sessionId:o(a,"id"),messageId:b?o(b,"messageID"):null}}return null}(b);if(g){if("files"===g.kind)return void j.set(d,{...e,sessionId:g.sessionId??e.sessionId,revertedFiles:g.files,at:c});j.set(d,{...e,sessionId:g.sessionId??e.sessionId,revertedMessageId:g.messageId,revertedFiles:null===g.messageId?[]:e.revertedFiles,at:c})}}function q(a,b,c){return b!==f.k?null:j.get((0,e.v7)(a,b,c))??null}function r(a){let b=l(a);j.delete(b),k.delete(b)}function s(a){if(a.cliToolId!==f.k)return null;let b=l(a),c=j.get(b);if(!c)return null;if(null!==c.filesAt||null===c.sessionId||null===c.turnMessageId||k.has(b))return c;let d=(0,g.hC)(a);return null===d||(k.add(b),t(a,d,c.sessionId,c.turnMessageId).finally(()=>{k.delete(b)})),c}async function t(a,b,c,d){let e=await (0,h.iv)(b,c,d);if(null===e)return i.debug("opencode-turn-diff-unavailable",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,sessionId:c}),null;let f=l(a),g=j.get(f);return g&&g.turnMessageId===d&&j.set(f,{...g,files:e,filesAt:Date.now()}),e}function u(a,b,c){let d=l(a),e=Date.now(),f=j.get(d)??m(e);j.set(d,{...f,revertedMessageId:b,revertedFiles:c,at:e})}function v(a,b){let c=q(a,f.k,b);if(!c)return null;let d=new Set;for(let a of[...c.files,...c.revertedFiles])null!==a.file&&d.add(a.file);let e=[...c.files,...c.revertedFiles].filter(a=>null===a.file).length;return d.size+e}},75356:(a,b,c)=>{c.d(b,{C8:()=>h,Dp:()=>o,Jd:()=>l,Mn:()=>q,Tm:()=>g,Zu:()=>p,aF:()=>f,lu:()=>t,oG:()=>r,pV:()=>k,vE:()=>i});var d=c(62887),e=c(57510);let f="permission_prompt",g="question_prompt",h=d.KC,i="error";function j(a){return(0,e.Qd)(a.properties)?a.properties:{}}function k(a){let b=j(a).info;return(0,e.Qd)(b)?(0,e.NZ)(b,["model","modelID"])??(0,e.NZ)(b,["model","id"]):null}function l(a){let b=j(a).info;return(0,e.Qd)(b)?(0,e.NZ)(b,["model","variant"])??(0,e.NZ)(b,["variant"]):null}function m(a){return(0,e.NZ)(j(a),["part","state","status"])}function n(a){return"tool"===(0,e.NZ)(j(a),["part","type"])}function o(a){return(0,e.NZ)(j(a),["part","tool"])}function p(a){return(0,e.NZ)(j(a),["part","callID"])}function q(a){return(0,e.NZ)(j(a),["requestID"])}function r(a){let b=j(a);switch((0,e.NZ)(a,["type"])){case"permission.asked":case"question.asked":return(0,e.hY)((0,e.NZ)(b,["id"]));case"permission.replied":return(0,e.hY)(q(a));case"message.updated":return(0,e.hY)((0,e.NZ)(b,["info","id"]));case"message.part.updated":return(0,e.hY)(p(a));default:return null}}let s=["completed","error"],t=[(0,e.KR)("session.idle","stop"),(0,e.KR)("session.created","session_start"),(0,e.KR)("session.deleted","session_end"),(a,b)=>"message.updated"===a&&"user"===(0,e.NZ)(j(b),["info","role"])?{event:"user_prompt_submit"}:null,(a,b)=>"message.part.updated"===a&&n(b)&&"running"===m(b)?{event:"pre_tool_use",detail:(0,e.Wv)(o(b)),toolCallId:p(b)}:null,(a,b)=>"message.part.updated"===a&&n(b)&&s.includes(m(b)??"")?{event:"post_tool_use",detail:(0,e.Wv)(o(b)),toolCallId:p(b)}:null,(0,e.KR)("permission.asked","notification",f),(0,e.KR)("question.asked","notification",g),(0,e.KR)("session.error","notification",i),(0,e.KR)("permission.replied","notification",h)].map(function(a){return(b,c)=>{let d=a(b,c);return d?{...d,conversationId:d.conversationId??(0,e.NZ)(j(c),["sessionID"])}:null}})},85322:(a,b,c)=>{c.d(b,{k:()=>d});let d="opencode"},86594:(a,b,c)=>{function d(a){return`oc-turn:${a}`}function e(a){return`claude-turn:${a}`}function f(a){return`claude-prompt:${a}`}c.d(b,{Ac:()=>j,H_:()=>f,O1:()=>k,ST:()=>g,TW:()=>n,Wr:()=>h,ZS:()=>i,jN:()=>l,jT:()=>d,qe:()=>e,sT:()=>m});let g="partial:";function h(a,b){return`${g}${a}:${b}`}function i(a){return`codex-turn:${a}`}function j(a){return`codex-prompt:${a}`}function k(a,b){return`antigravity-turn:${a}#${b}`}function l(a,b){return`antigravity-prompt:${a}#${b}`}function m(a){return`command-code-turn:${a}`}function n(a){return`command-code-prompt:${a}`}},90488:(a,b,c)=>{c.d(b,{BF:()=>j,Vo:()=>h,dJ:()=>i});let d=(0,c(72626).h)("lib/hooks/sources/opencode/push");async function e(a){try{let[{getDbInstance:b},{getWorktreeById:d}]=await Promise.all([Promise.resolve().then(c.bind(c,88807)),Promise.resolve().then(c.bind(c,56791))]);return d(b(),a)?.name??a}catch{return a}}async function f(){return Promise.all([c.e(1356),c.e(1191)]).then(c.bind(c,61191))}async function g(a,b){return{worktreeId:a.worktreeId,worktreeName:await e(a.worktreeId),instanceId:b}}async function h(a,b,c,e){try{let{notifyPushSubscribers:h,buildExcerpt:i}=await f(),j=await g(a,b);await h({...j,kind:"prompt",agentName:b,waitingKind:"prompt",waitingSince:e,excerpt:i(c??void 0,80)},e),d.info("opencode-question-push-sent",{worktreeId:a.worktreeId,instanceId:b,hasQuestion:null!==c})}catch(c){d.warn("opencode-question-push-failed",{worktreeId:a.worktreeId,instanceId:b,error:c instanceof Error?c.message:String(c)})}}async function i(a,b,c,e,h,i){if("MessageAbortedError"===c)return void d.info("opencode-error-push-skipped-interrupt",{worktreeId:a.worktreeId,instanceId:b,errorName:c});try{let{notifyPushSubscribers:j,buildExcerpt:k}=await f(),l=await g(a,b);await j({...l,kind:"failure",agentName:b,excerpt:k(e??void 0,80),failure:{reason:"agent-session-error",signature:`opencode:session-error:${h??"unknown"}:${c??"unknown"}`}},i),d.info("opencode-error-push-sent",{worktreeId:a.worktreeId,instanceId:b,errorName:c,sessionId:h})}catch(c){d.warn("opencode-error-push-failed",{worktreeId:a.worktreeId,instanceId:b,error:c instanceof Error?c.message:String(c)})}}async function j(a,b,c,e){try{let{notifyPushSubscribers:h}=await f(),i=await g(a,b);await h({...i,kind:"completion",agentName:b,excerpt:c,updateAvailable:{agent:b,version:c}},e),d.info("opencode-update-push-sent",{worktreeId:a.worktreeId,instanceId:b,version:c})}catch(c){d.warn("opencode-update-push-failed",{worktreeId:a.worktreeId,instanceId:b,error:c instanceof Error?c.message:String(c)})}}},98211:(a,b,c)=>{c.d(b,{AB:()=>m,FZ:()=>i,LF:()=>l,Lu:()=>k,XL:()=>g,v1:()=>j});var d=c(2466),e=c(57510);let f=globalThis.__opencodeToolCallNames??=new Map;function g(a,b){for(f.delete(a),f.set(a,b);f.size>256;){let a=f.keys().next();if(a.done)break;f.delete(a.value)}}function h(a){return"string"==typeof a.type&&(0,e.Qd)(a.properties)?a.properties:a}function i(a){var b;let c=h(a),d=(0,e.O2)(c,"id"),g=(0,e.O2)(c,"sessionID");if(!d||!g||Array.isArray(c.questions))return null;let i=(0,e.O2)(c,"permission"),j=(0,e.Qd)(c.metadata)?c.metadata:{};return{toolName:((b=(0,e.NZ)(c,["tool","callID"]))?f.get(b)??null:null)??i??"permission",toolInput:{permission:i,patterns:Array.isArray(c.patterns)?c.patterns:[],...j},promptId:d,sessionId:g,permissionMode:null,permissionSuggestions:Array.isArray(c.always)?c.always:null}}function j(a){let b=h(a),c=(0,e.O2)(b,"id");if(!c)return null;let f=(0,d.u_)({questions:b.questions});return null===f?null:{questions:f,promptId:c}}function k(a,b){let c=i(a);return c&&c.promptId?{kind:"permission",id:c.promptId,conversationId:c.sessionId,subject:{kind:"permission",toolName:c.toolName,toolInput:c.toolInput},raw:a,askedAt:b}:null}function l(a,b){let c=k(a,b);if(!c||"permission"!==c.subject.kind)return null;let d=c.subject.toolInput.patterns;return{toolName:c.subject.toolName,patterns:Array.isArray(d)?d:[]}}function m(a,b){let c=h(a),d=(0,e.O2)(c,"id"),f=j(a);return d&&f?{kind:"question",id:d,conversationId:(0,e.O2)(c,"sessionID"),subject:{kind:"question",spec:f},raw:a,askedAt:b}:null}}};
|