commandmate 0.49.0 → 0.49.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +238 -231
- package/.next/app-path-routes-manifest.json +19 -18
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +9 -9
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +8 -0
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/release-notes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/capabilities/route.js +1 -1
- package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/agent-event/route.js +2 -2
- package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/claude-done/route.js +2 -2
- package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/permission-request/route.js +1 -1
- package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/subscriptions/route.js +1 -1
- package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/relays/[relayId]/cancel/route.js +1 -1
- package/.next/server/app/api/relays/[relayId]/cancel/route.js.nft.json +1 -1
- package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/relays/[relayId]/route.js +1 -0
- package/.next/server/app/api/relays/[relayId]/route.js.nft.json +1 -0
- package/.next/server/app/api/relays/[relayId]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/relays/route.js +1 -1
- package/.next/server/app/api/relays/route.js.nft.json +1 -1
- package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/clone/route.js +1 -1
- package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/restore/route.js +1 -1
- package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/route.js +1 -1
- package/.next/server/app/api/repositories/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/scan/route.js +1 -1
- package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/sync/route.js +1 -1
- package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/default-agents/route.js +1 -1
- package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/route.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verification/runs/[runId]/route.js +1 -1
- package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verification/runs/route.js +1 -1
- package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-reference/route.js +1 -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 +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/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 +1 -1
- package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branches/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/checkout/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/commit/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/diff/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/fetch/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/log/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/pull/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/push/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/reset/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/revert/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stage/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/staged/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/status/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/unstage/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/notes/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/marp-render/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/messages/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/diff/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/strict/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/strict/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/strict/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/resolve-target/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/active/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route.js +144 -1
- package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +3 -3
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tasks/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route.js +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 +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/config/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/viewed/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/route.js +1 -1
- package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
- package/.next/server/app/more/page_client-reference-manifest.js +1 -1
- package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
- package/.next/server/app/review/page_client-reference-manifest.js +1 -1
- package/.next/server/app/sessions/page.js +1 -1
- package/.next/server/app/sessions/page.js.nft.json +1 -1
- package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/page.js +11 -11
- package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
- package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +19 -18
- package/.next/server/chunks/1656.js +2 -2
- package/.next/server/chunks/2119.js +1 -1
- package/.next/server/chunks/2404.js +1 -1
- package/.next/server/chunks/2445.js +1 -1
- package/.next/server/chunks/3773.js +1 -0
- package/.next/server/chunks/3801.js +31 -0
- package/.next/server/chunks/5209.js +1 -1
- package/.next/server/chunks/5354.js +1 -1
- package/.next/server/chunks/{9130.js → 5630.js} +1 -1
- package/.next/server/chunks/5775.js +1 -0
- package/.next/server/chunks/610.js +1 -0
- package/.next/server/chunks/6119.js +1 -1
- package/.next/server/chunks/6130.js +1 -1
- package/.next/server/chunks/6401.js +1 -1
- package/.next/server/chunks/6486.js +1 -1
- package/.next/server/chunks/6781.js +1 -1
- package/.next/server/chunks/6808.js +4 -0
- package/.next/server/chunks/7023.js +14 -0
- package/.next/server/chunks/7604.js +1 -1
- package/.next/server/chunks/7905.js +1 -1
- package/.next/server/chunks/8581.js +15 -15
- package/.next/server/chunks/8728.js +2 -2
- package/.next/server/chunks/8782.js +1 -1
- package/.next/server/chunks/8807.js +63 -53
- package/.next/server/chunks/8918.js +103 -1
- package/.next/server/chunks/9198.js +144 -0
- package/.next/server/chunks/9390.js +1 -1
- package/.next/server/chunks/9584.js +1 -1
- package/.next/server/chunks/9627.js +1 -1
- package/.next/server/chunks/9731.js +3 -3
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{2407-ab92ae9837c39dce.js → 2407-675ba6b21844dc3b.js} +1 -1
- package/.next/static/chunks/3931-1a1abab16248f14d.js +1 -0
- package/.next/static/chunks/8606-ce17ffa77f39608e.js +1 -0
- package/.next/static/chunks/app/api/agents/update/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/agents/versions/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/app/release-notes/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/app/update/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/app/update-check/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/auth/login/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/auth/logout/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/auth/status/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/capabilities/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/daily-summary/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/daily-summary/status/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/external-apps/[id]/health/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/external-apps/[id]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/external-apps/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/fs/browse/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/fs/recent-paths/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/hooks/agent-event/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/hooks/claude-done/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/hooks/permission-request/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/metrics/vibe/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/ollama/models/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/push/escalation/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/push/subscriptions/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/push/vapid/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/relays/[relayId]/cancel/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/relays/[relayId]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/relays/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/remote/pair/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/repositories/[id]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/repositories/clone/[jobId]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/repositories/clone/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/repositories/excluded/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/repositories/restore/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/repositories/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/repositories/scan/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/repositories/sync/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/repositories/validate-path/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/settings/default-agents/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/settings/default-surface-mode/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/sidebar/group-order/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/skills/[id]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/skills/installations/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/skills/operations/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/skills/reindex/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/skills/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/slash-commands/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/tasks/[taskId]/cancel/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/tasks/[taskId]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/templates/[id]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/templates/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/verification/runs/[runId]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/verification/runs/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/auto-yes/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/capture/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/clear-composer/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/cli-reference/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/cli-tool/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/cmate/schedules/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/current-output/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/direct-input/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/env/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/[logId]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/files/[...path]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/branch/create/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/branch/delete/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/branches/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/checkout/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/commit/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/diff/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/fetch/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/log/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/pull/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/push/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/reset/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/revert/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/show/[commitHash]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stage/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/staged/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/[index]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/apply/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/pop/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/push/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/status/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/unstage/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/git/working-diff/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/instances/notes/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/instances/opencode/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/interrupt/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/kill-session/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/logs/[filename]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/logs/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/marp-render/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/memos/[memoId]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/memos/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/messages/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/opencode/diff/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/opencode/session/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/opencode/share/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/strict/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/resolve-target/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/respond/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/[scheduleId]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/active/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/search/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/send/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/install/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/plan/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update-plan/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/skills/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/slash-commands/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/special-keys/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/tasks/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/terminal/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/timers/history/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/timers/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/todos/[todoId]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/todos/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/tree/[...path]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/tree/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/upload/[...path]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/verify/config/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/verify/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/[id]/viewed/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/apply-default-agents/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/api/worktrees/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/layout-8bfac4724277b47f.js +1 -0
- package/.next/static/chunks/app/manifest.webmanifest/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/proxy/[...path]/route-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/sessions/page-890fd50ec9739973.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/layout-a4f129c451de7859.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/page-f6d3ab8185d93aae.js +1 -0
- package/.next/static/css/c1e307d05daf93b6.css +1 -0
- package/.next/trace +13 -13
- package/.next/types/app/api/relays/[relayId]/route.ts +347 -0
- package/.next/types/routes.d.ts +2 -1
- package/.next/types/validator.ts +9 -0
- package/dist/cli/commands/ask.d.ts.map +1 -1
- package/dist/cli/commands/ask.js +178 -13
- package/dist/cli/commands/message-dispatch.d.ts +25 -5
- package/dist/cli/commands/message-dispatch.d.ts.map +1 -1
- package/dist/cli/commands/message-dispatch.js +92 -6
- package/dist/cli/commands/relays.d.ts +25 -2
- package/dist/cli/commands/relays.d.ts.map +1 -1
- package/dist/cli/commands/relays.js +69 -5
- package/dist/cli/commands/respond.d.ts +12 -0
- package/dist/cli/commands/respond.d.ts.map +1 -1
- package/dist/cli/commands/respond.js +63 -1
- package/dist/cli/commands/send.d.ts.map +1 -1
- package/dist/cli/commands/send.js +6 -4
- package/dist/cli/commands/wait-hook-stop-settle.d.ts +66 -0
- package/dist/cli/commands/wait-hook-stop-settle.d.ts.map +1 -0
- package/dist/cli/commands/wait-hook-stop-settle.js +150 -0
- package/dist/cli/commands/wait-instance.d.ts +21 -0
- package/dist/cli/commands/wait-instance.d.ts.map +1 -0
- package/dist/cli/commands/wait-instance.js +41 -0
- package/dist/cli/commands/wait-notices.d.ts +87 -0
- package/dist/cli/commands/wait-notices.d.ts.map +1 -0
- package/dist/cli/commands/wait-notices.js +301 -0
- package/dist/cli/commands/wait-poll-bookkeeping.d.ts +15 -0
- package/dist/cli/commands/wait-poll-bookkeeping.d.ts.map +1 -0
- package/dist/cli/commands/wait-poll-bookkeeping.js +57 -0
- package/dist/cli/commands/wait-poll-state.d.ts +118 -0
- package/dist/cli/commands/wait-poll-state.d.ts.map +1 -0
- package/dist/cli/commands/wait-poll-state.js +6 -0
- package/dist/cli/commands/wait-timing.d.ts +46 -0
- package/dist/cli/commands/wait-timing.d.ts.map +1 -0
- package/dist/cli/commands/wait-timing.js +99 -0
- package/dist/cli/commands/wait-turn-boundary.d.ts +284 -0
- package/dist/cli/commands/wait-turn-boundary.d.ts.map +1 -0
- package/dist/cli/commands/wait-turn-boundary.js +427 -0
- package/dist/cli/commands/wait-verify.d.ts +50 -0
- package/dist/cli/commands/wait-verify.d.ts.map +1 -0
- package/dist/cli/commands/wait-verify.js +124 -0
- package/dist/cli/commands/wait.d.ts +6 -105
- package/dist/cli/commands/wait.d.ts.map +1 -1
- package/dist/cli/commands/wait.js +207 -959
- 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 +23 -1
- package/dist/cli/types/api-responses.d.ts +47 -3
- package/dist/cli/types/api-responses.d.ts.map +1 -1
- package/dist/cli/utils/api-client.d.ts +15 -1
- package/dist/cli/utils/api-client.d.ts.map +1 -1
- package/dist/cli/utils/api-client.js +7 -1
- package/dist/cli/utils/reply-ledger.d.ts +79 -0
- package/dist/cli/utils/reply-ledger.d.ts.map +1 -1
- package/dist/cli/utils/reply-ledger.js +141 -1
- package/dist/lib/session/send-attempt-types.d.ts +23 -1
- package/dist/lib/session/send-attempt-types.d.ts.map +1 -1
- package/dist/lib/session/send-attempt-types.js +9 -1
- package/dist/server/locales/en/worktree.json +18 -3
- package/dist/server/locales/ja/worktree.json +18 -3
- package/dist/server/src/lib/auto-yes-poller.js +49 -10
- package/dist/server/src/lib/cli-tools/antigravity.js +40 -7
- package/dist/server/src/lib/cli-tools/codex.js +60 -11
- package/dist/server/src/lib/cli-tools/command-code-plan-review.js +24 -2
- package/dist/server/src/lib/cli-tools/copilot.js +120 -30
- package/dist/server/src/lib/cli-tools/gemini.js +28 -9
- package/dist/server/src/lib/cli-tools/opencode.js +55 -13
- package/dist/server/src/lib/cli-tools/submit-composer-read.js +580 -0
- package/dist/server/src/lib/cli-tools/submit-verified-sender.js +356 -621
- package/dist/server/src/lib/db/migrations/index.js +2 -0
- package/dist/server/src/lib/db/migrations/pre-migration-backup.js +266 -0
- package/dist/server/src/lib/db/migrations/runner.js +37 -4
- package/dist/server/src/lib/db/migrations/v62-session-relays-bind.js +102 -0
- package/dist/server/src/lib/db/relay-bind-db.js +437 -0
- package/dist/server/src/lib/db/relay-db.js +59 -96
- package/dist/server/src/lib/detection/upstream-faults.js +40 -6
- package/dist/server/src/lib/hooks/sources/opencode/client.js +12 -6
- package/dist/server/src/lib/polling/response-checker.js +7 -5
- package/dist/server/src/lib/prompt-answer-errors.js +288 -0
- package/dist/server/src/lib/prompt-answer-sender.js +264 -288
- package/dist/server/src/lib/push/failure-episode-state.js +4 -1
- package/dist/server/src/lib/realtime/terminal-broadcast.js +1 -4
- package/dist/server/src/lib/realtime-snippet.js +54 -0
- package/dist/server/src/lib/relay/relay-bind.js +294 -0
- package/dist/server/src/lib/relay/relay-boot.js +51 -0
- package/dist/server/src/lib/relay/relay-bound-reply.js +519 -0
- package/dist/server/src/lib/relay/relay-delivery.js +134 -220
- package/dist/server/src/lib/relay/relay-messages.js +39 -4
- package/dist/server/src/lib/relay/relay-overlap.js +92 -0
- package/dist/server/src/lib/relay/relay-system-line.js +3 -2
- package/dist/server/src/lib/relay/types.js +12 -1
- package/dist/server/src/lib/session/agent-session-lifecycle.js +18 -0
- package/dist/server/src/lib/session/claude-session.js +41 -6
- package/dist/server/src/lib/session/composer-clear.js +54 -1
- package/dist/server/src/lib/session/current-output-builder.js +21 -5
- package/dist/server/src/lib/session/instance-input-lock.js +664 -0
- package/dist/server/src/lib/session/send-attempt-state.js +17 -0
- package/dist/server/src/lib/session/send-attempt-types.js +9 -1
- package/dist/server/src/lib/session/send-user-message.js +82 -13
- package/package.json +1 -1
- package/release-notes/0.49.1.json +66 -0
- package/.next/server/chunks/1210.js +0 -1
- package/.next/server/chunks/1945.js +0 -14
- package/.next/server/chunks/1990.js +0 -103
- package/.next/server/chunks/4194.js +0 -67
- package/.next/server/chunks/4280.js +0 -1
- package/.next/server/chunks/5845.js +0 -1
- package/.next/server/chunks/720.js +0 -103
- package/.next/server/chunks/936.js +0 -1
- package/.next/server/chunks/9540.js +0 -1
- package/.next/static/chunks/8606-cf6bdbff44a764cf.js +0 -1
- package/.next/static/chunks/9079-987939d231704218.js +0 -1
- package/.next/static/chunks/app/api/agents/update/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/agents/versions/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/app/release-notes/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/app/update/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/app/update-check/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/auth/login/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/auth/logout/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/auth/status/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/capabilities/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/daily-summary/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/daily-summary/status/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/external-apps/[id]/health/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/external-apps/[id]/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/external-apps/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/fs/browse/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/fs/recent-paths/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/hooks/agent-event/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/hooks/claude-done/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/hooks/permission-request/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/metrics/vibe/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/ollama/models/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/push/escalation/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/push/subscriptions/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/push/vapid/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/relays/[relayId]/cancel/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/relays/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/remote/pair/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/repositories/[id]/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/repositories/clone/[jobId]/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/repositories/clone/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/repositories/excluded/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/repositories/restore/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/repositories/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/repositories/scan/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/repositories/sync/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/repositories/validate-path/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/settings/default-agents/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/settings/default-surface-mode/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/sidebar/group-order/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/skills/[id]/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/skills/installations/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/skills/operations/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/skills/reindex/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/skills/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/slash-commands/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/tasks/[taskId]/cancel/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/tasks/[taskId]/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/templates/[id]/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/templates/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/verification/runs/[runId]/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/verification/runs/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/auto-yes/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/capture/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/clear-composer/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/cli-reference/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/cli-tool/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/cmate/schedules/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/current-output/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/direct-input/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/env/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/[logId]/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/execution-logs/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/files/[...path]/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/branch/create/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/branch/delete/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/branches/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/checkout/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/commit/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/diff/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/fetch/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/log/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/pull/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/push/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/reset/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/revert/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/show/[commitHash]/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stage/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/staged/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/[index]/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/apply/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/pop/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/push/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/stash/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/status/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/unstage/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/git/working-diff/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/instances/notes/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/instances/opencode/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/interrupt/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/kill-session/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/logs/[filename]/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/logs/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/marp-render/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/memos/[memoId]/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/memos/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/messages/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/opencode/diff/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/opencode/session/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/opencode/share/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/prompt-response/strict/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/resolve-target/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/respond/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/[scheduleId]/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/active/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/schedules/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/search/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/send/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/install/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/plan/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/[skillId]/update-plan/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/skills/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/slash-commands/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/special-keys/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/tasks/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/terminal/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/timers/history/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/timers/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/todos/[todoId]/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/todos/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/tree/[...path]/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/tree/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/upload/[...path]/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/verify/config/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/verify/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/[runId]/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/verify/runs/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/[id]/viewed/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/apply-default-agents/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/api/worktrees/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/layout-aa8e66164a4367af.js +0 -1
- package/.next/static/chunks/app/manifest.webmanifest/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/proxy/[...path]/route-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/sessions/page-cfd645305e25fd33.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/layout-c81284a9d8b35304.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/page-a8d7886703ffc7b4.js +0 -1
- package/.next/static/css/db8959555c3d9c96.css +0 -1
- /package/.next/static/{3_JtAZaKMJEDFIIfkHv4n → fqfSDqQMweROeHUzOt_m1}/_buildManifest.js +0 -0
- /package/.next/static/{3_JtAZaKMJEDFIIfkHv4n → fqfSDqQMweROeHUzOt_m1}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";exports.id=3801,exports.ids=[2839,3801,5220],exports.modules={640:(a,b,c)=>{function d(a){return`[from ${a.alias} / ${a.worktreeId}]`}function e(a,b,c=null){let f=b.trim();return null!==c?`${d(a)}
|
|
2
|
+
${c}
|
|
3
|
+
${""===f?"(no reply body)":f}`:""===f?`${d(a)} (no reply body)`:`${d(a)} ${f}`}c.d(b,{Hr:()=>j,KA:()=>l,Nl:()=>n,Py:()=>g,z0:()=>e});let f={en:"Note: this reply may have been processed in the same turn as another request (overlap={overlap}).",ja:"注意: この返答は、別の依頼と同じターンで処理された可能性があります(overlap={overlap})。"};function g(a,b){return null===b||"none"===b?null:`[CommandMate relay] ${f[a].replace("{overlap}",b)}`}function h(a,b){let c=a.replace(/\s+/g," ").trim();return c.length<=b?c:`${c.slice(0,b-1)}…`}let i={en:{waiting:"is waiting for a confirmation:",options:"Options:",more:"(+{n} more)"},ja:{waiting:"確認待ちです:",options:"選択肢:",more:"(他 {n} 件)"}};function j(a,b,c){let e=i[a],f=`${d(b)} ${e.waiting} ${h(c.question,200)}`;if(0===c.options.length)return f;let g=c.options.slice(0,9),j=c.options.length-g.length,k=g.map(a=>`${a.key}) ${h(a.label,60)}`).join(" "),l=j>0?` ${e.more.replace("{n}",String(j))}`:"";return`${f}
|
|
4
|
+
${e.options} ${k}${l}`}let k={en:"The reply you were waiting for did not arrive within {hours}h; the relay has expired.",ja:"待っていた返信が {hours} 時間以内に届かなかったため、委任は期限切れになりました。"};function l(a,b,c){let e=Math.max(1,Math.round(c/36e5));return`${d(b)} ${k[a].replace("{hours}",String(e))}`}let m={en:{requested:"Delegated to {alias}; waiting for the reply.",replied:"Reply from {alias}.",waiting:"{alias} is waiting for a confirmation.",expired:"The delegation to {alias} expired without a reply."},ja:{requested:"{alias} へ委任、返信待ち",replied:"{alias} から返信",waiting:"{alias} が確認待ち",expired:"{alias} への委任が返信のないまま期限切れ"}};function n(a,b,c,d={}){let e=m[a][b].replace("{alias}",c),f=[];return d.overlap&&f.push(`overlap=${d.overlap}`),d.holdReason&&f.push(`hold=${d.holdReason}`),0===f.length?e:`${e} (${f.join(", ")})`}},10168:(a,b,c)=>{c.d(b,{BR:()=>j,Vg:()=>i,YT:()=>h});var d=c(55511),e=c(24455),f=c(91631),g=c(36925);function h(){return(0,g.v)("__relayServerBootId",()=>(0,d.randomUUID)())}function i(a,b,c){let d=(0,f.Ev)((0,e.v7)(a,b,c));return`${h()}#${d??"-"}`}function j(a){if(null===a)return null;let b=a.lastIndexOf("#");return b<=0?null:a.slice(0,b)}},14887:(a,b,c)=>{c.d(b,{E6:()=>j,yk:()=>i});var d=c(55511),e=c(69198),f=c(10168);let g=(0,c(72626).h)("relay-bind"),h=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,i={sendUnknown:"send_unknown",dispatchUnknown:"dispatch_unknown",generationChanged:"generation_changed",noInputBoundary:"no_input_boundary",serverRestarted:"server_restarted",serverRestartedBeforeInput:"server_restarted_before_input"};function j(a,b,c=Date.now()){if(!h.test(b.relayId))return{ok:!1,refusal:{status:400,code:"RELAY_BIND_INVALID",message:"relayId must be a relay id"}};let i=(0,d.randomUUID)();try{if(!(0,e.ZR)(a,{relayId:b.relayId,attemptId:i,owner:(0,f.YT)(),worktreeId:b.worktreeId,instanceId:b.instanceId,now:c}))return{ok:!1,refusal:(0,e.C$)(a,b.relayId,b.worktreeId,b.instanceId,c)}}catch(a){return g.warn("relay-bind-reserve-failed",{relayId:b.relayId,error:a instanceof Error?a.message:String(a)}),{ok:!1,refusal:{status:500,code:"RELAY_BIND_FAILED",message:"Failed to reserve the relay"}}}return g.info("relay-bind-reserved",{relayId:b.relayId,attemptId:i}),{ok:!0,binding:new k(a,b,i)}}class k{constructor(a,b,c){this.db=a,this.target=b,this.attemptId=c,this.generationBefore=null,this.boundaryWritten=!1,this.observationInvalid=!1,this.refused=!1,this.dispatch="none",this.retryDispatchOpen=!1}get relayId(){return this.target.relayId}begin(a){this.generationBefore=a}hooks(){return{beforeInput:(a,b)=>this.beforeInput(a,b),onDispatchFailed:a=>this.onDispatchFailed(a)}}beforeInput(a,b){let c;if("unknown"===this.dispatch){"dispatch"===b&&(this.retryDispatchOpen=!0);return}let d=this.target.readTurn(),g=d.generation===this.generationBefore,h=g?this.target.hooksReportTurns?"valid":"turn_unknown":"invalid",i=this.target.hooksReportTurns&&g?d.open:null;try{c=(0,e.bT)(this.db,{relayId:this.target.relayId,attemptId:this.attemptId,at:a.getTime(),kind:b,turnOpenAtSend:i,obsState:h,obsSource:(0,f.Vg)(this.target.worktreeId,this.target.cliToolId,this.target.instanceId),replaceDispatch:"not_sent"===this.dispatch})}catch(a){throw this.refused=!0,a}if(!c)throw this.refused=!0,Error(`relay ${this.target.relayId} is no longer reserved for this send`);this.boundaryWritten=!0,this.observationInvalid="invalid"===h,"dispatch"===b&&(this.dispatch="pending")}onDispatchFailed(a){if("unknown"===this.dispatch){this.retryDispatchOpen=!1;return}if("not_sent"===a){this.dispatch="not_sent";return}this.dispatch="unknown",(0,e.ky)(this.db,{relayId:this.target.relayId,attemptId:this.attemptId,from:["input_started"],to:"unknown",holdReason:i.dispatchUnknown})}finish(a){try{return this.settle(a)}catch(b){return g.warn("relay-bind-settle-failed",{relayId:this.target.relayId,error:b instanceof Error?b.message:String(b)}),"sent"===a.kind?"sent":"unknown"}}settle(a){let b={relayId:this.target.relayId,attemptId:this.attemptId};if("unknown"===this.dispatch){if("sent"===a.kind&&this.retryDispatchOpen){let c=this.observationInvalid||a.generationAfter!==this.generationBefore;return(0,e.ky)(this.db,{...b,from:["unknown"],to:"sent",inputMessageId:a.messageId,...c?{holdReason:i.generationChanged,invalidateObservation:!0}:{clearHoldReason:!0}}),"sent"}return"unknown"}if("sent"===a.kind){if(!this.boundaryWritten)return(0,e.ky)(this.db,{...b,from:["awaiting"],to:"unknown",holdReason:i.noInputBoundary}),"unknown";let c=this.observationInvalid||a.generationAfter!==this.generationBefore;return(0,e.ky)(this.db,{...b,from:["input_started"],to:"sent",inputMessageId:a.messageId,holdReason:c?i.generationChanged:null,invalidateObservation:c}),"sent"}return"sent"===a.attempt?((0,e.ky)(this.db,{...b,from:["awaiting","input_started"],to:"unknown",holdReason:i.sendUnknown}),"unknown"):!this.boundaryWritten||this.refused||"not-sent"===a.attempt?((0,e.ky)(this.db,{...b,from:["awaiting","input_started"],to:"failed"}),"not_sent"):((0,e.ky)(this.db,{...b,from:["input_started"],to:"unknown",holdReason:i.sendUnknown}),"unknown")}}},20029:(a,b,c)=>{c.d(b,{C7:()=>r,KF:()=>n,Nq:()=>p,cu:()=>l,m4:()=>s,zE:()=>m});var d=c(55511),e=c(36925),f=c(72626),g=c(2669),h=c(7321);let i=(0,f.h)("session/send-attempt-state"),j=(0,e.v)("__sendAttemptRecords",()=>new Map);function k(a){return JSON.stringify([a.worktreeId,a.cliToolId,a.instanceId])}function l(a){return(0,d.createHash)("sha256").update(a,"utf8").digest("hex").slice(0,16)}function m(a,b,c=Date.now()){try{let d=k(a);for(j.delete(d),j.set(d,{at:Math.floor(c),state:b.state,reason:b.reason,messageDigest:l(b.content)});j.size>1024;){let a=j.keys().next().value;if(void 0===a)break;j.delete(a)}}catch(a){i.warn("send-attempt-record-failed",{error:a instanceof Error?a.message:String(a)})}}function n(a){return j.get(k(a))??null}let o=/Command failed: tmux |Failed to send (?:special )?keys? to tmux session|Failed to send special key:|Failed to paste message into tmux session/;function p(a){if("object"==typeof a&&null!==a&&a.code===g.M7)return{state:"not-sent",reason:"session-starting"};if("object"==typeof a&&null!==a&&a.code===h.Le)return{state:"not-sent",reason:"plan-review"};let b=a instanceof Error?a.message:String(a);return/Enter was not pressed, so nothing was submitted/.test(b)?{state:"indeterminate",reason:"body-not-landed"}:/replaced by a TUI autocompletion/.test(b)?{state:"indeterminate",reason:"replaced-by-completion"}:/submit could not be confirmed/i.test(b)?{state:"indeterminate",reason:"submit-unconfirmed"}:/Could not re-read session \S+ before typing \(.*\); nothing was typed \(Issue #3945\)/s.test(b)?{state:"not-sent",reason:"recheck-failed"}:o.test(b)?{state:"indeterminate",reason:"send-error"}:/prompt not ready/i.test(b)?{state:"not-sent",reason:"prompt-not-ready"}:/input lock not acquired, nothing was typed/.test(b)?/was replaced while this send waited/.test(b)?{state:"not-sent",reason:"session-replaced"}:{state:"not-sent",reason:"input-lock-timeout"}:/\(re-checked under the input lock\); nothing was typed/.test(b)?{state:"not-sent",reason:"prompt-waiting"}:/input lock lost, nothing was typed/.test(b)?{state:"not-sent",reason:"input-lock-lost"}:/still holds unsent text after \d+ clear passes/.test(b)?{state:"not-sent",reason:"composer-not-empty"}:{state:"indeterminate",reason:"send-error"}}function q(a){return a.replace(/\s+/g,"")}function r(a,b){let c=q(b.split("\n").find(a=>""!==a.trim())??"").slice(0,32);return""!==c&&q(a).includes(c)}function s(a){return"not-sent"===a.state?`[send state: not-sent (${a.reason}): the message was not typed. CommandMate does not resend it; send it again once the input prompt is back (\`commandmate prompt <worktree-id> --json\` shows the screen and lastSend).]`:"indeterminate"===a.state?`[send state: indeterminate (${a.reason}): part of the message may have been typed or submitted. CommandMate does not resend it; do not resend before checking the pane (\`commandmate capture <worktree-id> --pane\`), or it may arrive twice.]`:`[send state: sent (${a.reason})]`}},39687:(a,b,c)=>{c.d(b,{d:()=>A});var d=c(56791),e=c(8360),f=c(15194),g=c(95220),h=c(12462),i=c(43015),j=c(54325),k=c(72626),l=c(34331),m=c(40964),n=c(58707),o=c(2669),p=c(31990),q=c(20029),r=c(7321),s=c(94154),t=c(34405),u=c(49973),v=c(49319);let w=(0,k.h)("session/send-user-message");function x(a){return a instanceof Error?a.message:String(a)}async function y(a,b){let c=`${a}:${b}`,d=Date.now()+5e3;for(;(0,g.getActivePollers)().includes(c);){if(Date.now()>=d)return!1;await new Promise(a=>setTimeout(a,100))}return!0}async function z(a,b,c,d){if(!s.wn.has(b))return!1;try{let e=await (0,p.WD)(a,b,t._,c),f=(0,s.ji)(e,b);return"content"===f.state&&(0,q.C7)(f.text,d)}catch(a){return w.warn("send-composer-residue-read-failed",{error:x(a)}),!1}}async function A(a,b){let{worktreeId:c,content:k,cliToolId:p,instanceId:t,absoluteImagePath:A,copilotModel:B}=b,C=b.messageType??"normal",D=t??p,E=e.CLIToolManager.getInstance().getTool(p),F=(a,d)=>{(0,q.zE)({worktreeId:c,cliToolId:p,instanceId:D},{state:a,reason:d,content:k}),b.onAttempt?.({state:a,reason:d})},G=(0,m.mf)(p,c,t),H=await (0,l.L)(c,G,a);if(null===H||"foreign"===H.verdict)return F("not-sent","foreign-session"),w.warn("send-refused-foreign-session",{worktreeId:c,cliToolId:p,instanceId:D,sessionName:G,sessionPath:H?.sessionPath??null,reason:H?"foreign":"worktree_not_found"}),{ok:!1,stage:"foreign_session",error:H?`tmux session "${G}" belongs to another CommandMate server`:`Worktree '${c}' not found; cannot confirm tmux session "${G}" is this server's`};let I=await (0,n.a3)(c,p,t,{ignoreStructured:b.ignoreStructuredPromptGuard});if(I.waiting)return F("not-sent","prompt-waiting"),w.info("send-refused-prompt-waiting",{worktreeId:c,cliToolId:p,reason:I.reason,blockedBy:I.blockedBy}),{ok:!1,stage:"prompt_waiting",error:(0,n.br)(c,I.blockedBy)};if(B&&"copilot"===p){try{await E.sendModelCommand(c,B,t),w.info("copilot-model-command-sent",{model:B})}catch(b){w.error("failed-to-send-model-command:",{error:x(b)});let a=b?.code;if(a===r.a9)return F("not-sent","prompt-waiting"),{ok:!1,stage:"prompt_waiting",error:(0,n.br)(c)};return F("not-sent",a===r.$_?"recheck-failed":"model-switch-failed"),{ok:!1,stage:"model",error:x(b)}}await y(c,D)||w.warn("previous-turn-poller-still-running",{worktreeId:c,instanceId:D,waitedMs:5e3})}let J=new Date;try{await (0,h.o4)(a,c,p,J,t)}catch(a){w.error("failed-to-save-pending-assistant-response:",{error:x(a)})}let K=null;try{let b=(0,d.getMessages)(a,c,{limit:1,cliToolId:p,instanceId:D,matchResolvedInstance:!0});b.length>0&&"user"===b[0].role&&b[0].content===k&&(K=b[0].id)}catch(a){w.error("failed-to-detect-orphaned-messages:",{error:x(a)})}async function L(){try{let{inputStartedAt:a}=await (0,u.x1)(M,b.onInputStart,b.inputBoundary);return{sent:!0,inputStartedAt:a}}catch(b){if(w.error("failed-to-send-message-to:",{error:x(b)}),(0,u.fi)(b))return{error:b,failure:{state:"not-sent",reason:"relay-reservation-lost"}};let a=(0,q.Nq)(b);return"submit-unconfirmed"===a.reason&&await z(c,p,t,k)&&(a={state:"indeterminate",reason:"composer-residue"}),{error:b,failure:a}}}async function M(){A?(0,f._J)(E)?await E.sendMessageWithImage(c,k,A,t):await E.sendMessage(c,(0,v.TZ)(k,A),t):await E.sendMessage(c,k,t)}let N=s.wn.has(p)?await (0,u.hC)(G,()=>L()).catch(a=>({error:a,failure:(0,q.Nq)(a)})):await L();if(!("sent"in N)){let{error:a,failure:b}=N;return(F(b.state,b.reason),"prompt-waiting"===b.reason)?{ok:!1,stage:"prompt_waiting",error:(0,n.br)(c)}:(0,o.wQ)(a)?{ok:!1,stage:"send",error:a.message,code:o.M7}:{ok:!1,stage:"send",error:x(a)}}F("sent","submitted");let O=N.inputStartedAt,P=null!==O&&O.getTime()>J.getTime()?O:J,Q=(0,d.createMessage)(a,{worktreeId:c,role:"user",content:k,messageType:C,timestamp:P,cliToolId:p,instanceId:t,requestId:b.requestId});try{(0,i.broadcastMessage)("message",{worktreeId:c,message:{...Q,cliToolId:p,instanceId:D}})}catch(a){w.warn("user-message-broadcast-failed",{error:x(a)})}if(K)try{if((0,d.deleteMessageById)(a,K)){w.info("cleaned-up-orphaned-user");try{(0,i.broadcastMessage)(j.dz,{worktreeId:c,cliToolId:p,instanceId:D,reason:"orphan_cleanup"})}catch(a){w.warn("orphan-cleanup-broadcast-failed",{error:x(a)})}}}catch(a){w.error("failed-to-clean-up-orphaned-message:",{error:x(a)})}return(0,d.updateLastUserMessage)(a,c,k,P),(0,d.clearInProgressMessageId)(a,c,p,t),w.info("cleared-in-progress-message"),(0,g.startPolling)(c,p,t),{ok:!0,message:Q}}},49798:(a,b,c)=>{c.d(b,{S:()=>h,r:()=>i});var d=c(28274),e=c(73753),f=c(83530);let g=(0,c(72626).h)("relay-session-ref");function h(a,b){let c="claude",e=b.instanceId;try{c=(0,f.iK)(a,b.worktreeId,{instanceId:b.instanceId}).cliToolId;let g=(0,d.BN)(a,b.worktreeId,b.instanceId);g?.alias&&(e=g.alias)}catch(a){g.warn("relay-session-resolve-failed",{worktreeId:b.worktreeId,instanceId:b.instanceId,error:a instanceof Error?a.message:String(a)})}return{worktreeId:b.worktreeId,instanceId:b.instanceId,cliToolId:c,alias:e}}function i(a,b){try{return null!==(0,e.getWorktreeById)(a,b)}catch{return!1}}},53801:(a,b,c)=>{c.d(b,{xK:()=>W,notifyRelayPromptWaiting:()=>_,notifyRelayTurnCompleted:()=>$,runRelayMaintenanceTick:()=>ac});var d=c(88807),e=c(69198),f=c(52660),g=c(55233),h=c(39687),i=c(640),j=c(10168),k=c(55511),l=c(81254),m=c(14887),n=c(18201),o=c(36261),p=c(30008),q=c(70096),r=c(49798),s=c(85016),t=c(25539),u=c(72626);let v=(0,u.h)("relay-delivery"),w=/-turn:/,x=[f.RELAY_SYSTEM_REQUEST_ID_PREFIX,f.MODEL_CHANGE_REQUEST_ID_PREFIX],y={claude:!0,codex:!0,antigravity:!0,"command-code":!0,opencode:!0,copilot:!1,gemini:!1,"vibe-local":!1,"opencode-v2":!0};function z(a,b){let c=(0,r.S)(a,b.to);return{alias:c.alias,worktreeId:c.worktreeId}}function A(a){return!0===y[a]}function B(a,b,c){let d=(0,f.getMessages)(a,b.worktreeId,{limit:40,cliToolId:b.cliToolId,instanceId:b.instanceId,matchResolvedInstance:!0}),e=A(b.cliToolId);for(let a of d){var g;if(!("assistant"!==a.role||"prompt"===a.messageType||function(a){return"string"==typeof a&&x.some(b=>a.startsWith(b))}(a.requestId))){if((!e||"string"==typeof(g=a.requestId)&&w.test(g))&&""!==a.content.trim())return a.timestamp.getTime()<c?null:a}}return null}function C(a,b,c){let d=(0,e.ix)(a,{worktreeId:b.worktreeId,instanceId:b.instanceId});if(0===d.length)return 0;let f=0;for(let g of d){if("bound"===g.bindMode){(function(a,b,c,d){if("awaiting"===c.sendState||"input_started"===c.sendState){for(let f of F(a,b,c.inputBoundaryAt??c.createdAt))(0,e.EG)(a,c.id,{messageId:f.row.id,timestamp:f.orderAt,requestId:f.row.requestId??null},d);return!1}if("sent"!==c.sendState||null===c.inputBoundaryAt)return!1;let f=(0,e.TN)(a,c.id);if(!f||!E(a,b,f))return!1;let[g]=F(a,b,c.inputBoundaryAt);return!!g&&G(a,b,f,g.row,d)})(a,b,g,c)&&(f+=1);continue}let d=B(a,b,g.createdAt);if(!d)continue;let h=(0,i.z0)(z(a,g),d.content);D(a,g.id,{candidateId:d.id,body:h,overlap:null,basis:"legacy"},c)&&(f+=1)}return f}function D(a,b,c,d){let f={...c,payloadId:(0,k.randomUUID)()};if((0,e.be)(a,b,"reply",f.body,d,{payloadId:f.payloadId,overlap:f.overlap??void 0}))return!0;let g=(0,e.V9)(a,b);return!!g&&"prompt"===g.kind&&(!!(!(0,s.p5)(b)&&(0,e.Iq)(a,b,g.payloadId,f,d))||(0,e.nR)(a,b,f,d))}function E(a,b,c){if("invalid"===c.relay.obsState)return!1;let d=(0,j.Vg)(b.worktreeId,b.cliToolId,b.instanceId);if(c.obsSource===d)return!0;let f=(0,j.BR)(c.obsSource)!==(0,j.YT)();return(0,e.FO)(a,c.relay.id,f?m.yk.serverRestarted:m.yk.generationChanged,{invalidate:!0}),v.info("relay-observation-mismatch",{relayId:c.relay.id,restarted:f}),!1}function F(a,b,c){let d=A(b.cliToolId),e=x.map(()=>"request_id NOT LIKE ?").join(" AND "),g=a.prepare(`
|
|
5
|
+
SELECT id, request_id, timestamp FROM chat_messages
|
|
6
|
+
WHERE worktree_id = ? ${f.ACTIVE_FILTER}
|
|
7
|
+
AND COALESCE(cli_tool_id, 'claude') = ?
|
|
8
|
+
AND COALESCE(instance_id, cli_tool_id, 'claude') = ?
|
|
9
|
+
AND role = 'assistant' AND COALESCE(message_type, 'normal') != 'prompt'
|
|
10
|
+
AND (request_id IS NULL OR (${e}))
|
|
11
|
+
${d?"AND request_id LIKE '%-turn:%'":""}
|
|
12
|
+
AND TRIM(content, ' ' || char(9, 10, 13)) != ''
|
|
13
|
+
AND timestamp >= ?
|
|
14
|
+
ORDER BY timestamp ASC, rowid ASC
|
|
15
|
+
LIMIT ?
|
|
16
|
+
`).all(b.worktreeId,b.cliToolId,b.instanceId,...x.map(a=>`${a}%`),c,500),h=[],i=new Set;for(let c of g){if(null!==c.request_id){if(i.has(c.request_id))continue;i.add(c.request_id);let d=function(a,b,c){let d=a.prepare(`
|
|
17
|
+
SELECT id FROM chat_messages
|
|
18
|
+
WHERE worktree_id = ? ${f.ACTIVE_FILTER}
|
|
19
|
+
AND COALESCE(cli_tool_id, 'claude') = ?
|
|
20
|
+
AND COALESCE(instance_id, cli_tool_id, 'claude') = ?
|
|
21
|
+
AND role = 'assistant' AND request_id = ?
|
|
22
|
+
AND TRIM(content, ' ' || char(9, 10, 13)) != ''
|
|
23
|
+
ORDER BY timestamp DESC, rowid DESC
|
|
24
|
+
LIMIT 1
|
|
25
|
+
`).get(b.worktreeId,b.cliToolId,b.instanceId,c);return d?(0,f.getMessageById)(a,d.id):null}(a,b,c.request_id);d&&h.push({row:d,orderAt:c.timestamp});continue}let d=(0,f.getMessageById)(a,c.id);d&&h.push({row:d,orderAt:c.timestamp})}return h}function G(a,b,c,d,e){let h=function(a,b,c,d){let{relay:e}=b,g=!0===e.turnOpenAtSend,h=!1===e.turnOpenAtSend&&"valid"===e.obsState,i=function(a,b,c,d){let e=b.relay.inputBoundaryAt;if(null===e)return"ambiguous";let g=a.prepare("SELECT rowid AS seq FROM chat_messages WHERE id = ?").get(d.id);if(!g)return"ambiguous";let h=a.prepare(`
|
|
26
|
+
SELECT id, content, rowid AS seq FROM chat_messages
|
|
27
|
+
WHERE worktree_id = ? AND role = 'user' ${f.ACTIVE_FILTER}
|
|
28
|
+
AND COALESCE(cli_tool_id, 'claude') = ?
|
|
29
|
+
AND COALESCE(instance_id, cli_tool_id, 'claude') = ?
|
|
30
|
+
AND timestamp >= ? AND timestamp < ?
|
|
31
|
+
`).all(c.worktreeId,c.cliToolId,c.instanceId,e,d.timestamp.getTime()),i=b.inputMessageId?(0,f.getMessageById)(a,b.inputMessageId):null,j=i?(0,n.pk)(i.content):null,k=!1;for(let a of h)if(a.id!==b.inputMessageId){if(null===j||(0,n.pk)(a.content)===j||a.seq>g.seq){k=!0;continue}return"proven"}return k?"ambiguous":"none"}(a,b,c,d);return g&&"proven"===i?{overlap:"both",basis:"turn-open-at-send+foreign-input"}:g?{overlap:"later",basis:"turn-open-at-send"}:"proven"===i?{overlap:"earlier",basis:"foreign-input"}:h&&"none"===i?{overlap:"none",basis:"no-open-turn+no-other-input"}:{overlap:"unknown",basis:h?"other-input-unproven":"turn-state-unknown"}}(a,c,b,d),j=(0,i.Py)((0,g.dV)(a),h.overlap),k=(0,i.z0)(z(a,c.relay),d.content,j),l=D(a,c.relay.id,{candidateId:d.id,body:k,overlap:h.overlap,basis:h.basis},e);return l&&v.info("relay-reply-decided",{relayId:c.relay.id,candidateId:d.id,overlap:h.overlap,basis:h.basis}),l}function H(a,b,c,d){if(!function(a,b,c,d){if("bound"!==c.bindMode)return!0;if("sent"!==c.sendState||null===c.inputBoundaryAt||d.timestamp.getTime()<c.inputBoundaryAt)return!1;let f=(0,e.TN)(a,c.id);return null!==f&&E(a,b,f)}(a,b,c,d)||(0,e.GC)(a,c.id)===d.id)return!1;let f=(0,g.dV)(a),h=function(a){let b=a.promptData;return(0,l.XF)(b)?"yes_no"===b.type?b.options.map(a=>({key:a,label:a})):b.options.map(a=>({key:String(a.number),label:a.label})):[]}(d),j=(0,l.XF)(d.promptData)?d.promptData.question:d.promptData?.question??d.content,k=(0,i.Hr)(f,z(a,c),{question:j,options:h});return!!(0,e.be)(a,c.id,"prompt",k)&&((0,e.UC)(a,c.id,d.id),!0)}var I=c(23854),J=c(8360),K=c(40964),L=c(34331),M=c(31990),N=c(95595),O=c(64501),P=c(34405);let Q=(0,u.h)("relay-readiness");async function R(a,b,c,d){try{let e=(0,K.mf)(b,a,c),f=await (0,L.L)(a,e,d);if(null===f||"foreign"===f.verdict)return"foreign_session";if("absent"===f.verdict)return"session_stopped";let g=J.CLIToolManager.getInstance().getTool(b);if(!await g.isRunning(a,c))return"session_stopped";let h=await (0,M.Wh)(a,b,P._,c);if((0,O.NV)(a,b,c,h))return"generating";let i=(0,N.WC)(h,b);return"running"===i.status?"generating":null}catch(d){return Q.warn("relay-readiness-check-failed",{worktreeId:a,cliToolId:b,instanceId:c,error:d instanceof Error?d.message:String(d)}),null}}var S=c(67164),T=c(36925);let U=(0,u.h)("relay-delivery"),V=(0,T.v)("__relayDeliveryInFlight",()=>new Set);function W(a){try{let b=(0,d.getDbInstance)(),c=(0,e.TN)(b,a);if(!c)return;let{relay:g}=c;if("sent"!==g.sendState||!(0,t.Lo)(g.state)||null===g.inputBoundaryAt)return;let h=(0,r.S)(b,g.to),i={worktreeId:h.worktreeId,cliToolId:h.cliToolId,instanceId:h.instanceId},j=g.inputBoundaryAt,k=Date.now(),l=b.transaction(()=>{if((0,e.UA)(b,a),!E(b,i,c))return!1;let[d]=F(b,i,j);return!!d&&G(b,i,c,d.row,k)})(),m=!l&&function(a,b,c){let d=(0,o.Jp)(b.worktreeId,b.cliToolId,b.instanceId);if(!d||"prompt"!==d.kind||(0,p.yg)(b.worktreeId,b.cliToolId,b.instanceId,(0,q.VM)(b.cliToolId).capabilities.eventIdentity))return!1;let g=(0,f.getLatestOpenPromptMessage)(a,b.worktreeId,b.cliToolId,b.instanceId);if(!g)return!1;let h=(0,e.Ip)(a,c);return!!h&&!!(0,t.Lo)(h.state)&&H(a,b,h,g)}(b,i,a);(l||m)&&ab()}catch(b){U.warn("relay-after-send-failed",{relayId:a,error:b instanceof Error?b.message:String(b)})}}function X(a){let b=(0,j.YT)();if(globalThis.__relayRecoveredBootId!==b){globalThis.__relayRecoveredBootId=b;try{!function(a,b=Date.now()){let c=(0,j.YT)(),d=0;for(let f of(0,e.hA)(a)){let{relay:g}=f;if("awaiting"===g.sendState){if(null===f.bindAttemptId||f.bindOwner===c)continue;(0,e.Yt)(a,g.id,f.bindAttemptId,m.yk.serverRestartedBeforeInput,b)&&(d+=1);continue}if("input_started"===g.sendState){if(f.bindOwner===c||null===f.bindAttemptId)continue;(0,e.ky)(a,{relayId:g.id,attemptId:f.bindAttemptId,from:["input_started"],to:"unknown",holdReason:m.yk.serverRestarted,now:b})&&(d+=1);continue}if("sent"===g.sendState){if(null!==f.pendingKind)continue;if(null!==f.pendingReply){(0,e.jn)(a,g.id,b)&&(d+=1);continue}if((0,j.BR)(f.obsSource)===c||"invalid"===g.obsState)continue;(0,e.FO)(a,g.id,m.yk.serverRestarted,{invalidate:!0,now:b}),d+=1}}d>0&&v.info("relay-bound-recovered",{recovered:d})}(a)}catch(a){U.warn("relay-recovery-failed",{error:a instanceof Error?a.message:String(a)})}}}function Y(a){return new Promise(b=>{setTimeout(b,a)})}async function Z(a,b){let c=Date.now()+15e3;for(;;){if(C(a,b,Date.now())>0)return void ab();if(Date.now()>=c)break;await Y(1e3)}U.info("relay-scrape-row-not-transcript-backed",{worktreeId:b.worktreeId,cliToolId:b.cliToolId,instanceId:b.instanceId,graceMs:15e3})}async function $(a,b){try{let c=(0,d.getDbInstance)(),f=(0,e.ix)(c,{worktreeId:a.worktreeId,instanceId:a.instanceId});if(0===f.length)return;if(b.settled){C(c,a,Date.now())>0&&ab();return}if(A(a.cliToolId))return void await Z(c,a);let g=null;for(let b=0;b<3;b+=1){let b=B(c,a,0);g=b?.id??null,await Y(I.DZ);let d=B(c,a,0);if((d?.id??null)===g){C(c,a,Date.now())>0&&ab();return}}U.info("relay-scrape-never-settled",{worktreeId:a.worktreeId,instanceId:a.instanceId,attempts:3})}catch(b){U.warn("relay-turn-completed-failed",{worktreeId:a.worktreeId,instanceId:a.instanceId,error:b instanceof Error?b.message:String(b)})}}function _(a){try{let b=(0,d.getDbInstance)(),c=(0,e.ix)(b,{worktreeId:a.worktreeId,instanceId:a.instanceId});if(0===c.length)return;let g=(0,f.getLatestOpenPromptMessage)(b,a.worktreeId,a.cliToolId,a.instanceId);if(!g)return;let h=0;for(let d of c)H(b,a,d,g)&&(h+=1);h>0&&ab()}catch(b){U.warn("relay-prompt-notify-failed",{worktreeId:a.worktreeId,instanceId:a.instanceId,error:b instanceof Error?b.message:String(b)})}}async function aa(a,b,c,d){let g=(0,e.Ip)(a,b);if(!g)return"skipped";let i=(0,r.S)(a,g.from),j=await R(i.worktreeId,i.cliToolId,i.instanceId,a);if(j)return U.debug("relay-delivery-held",{relayId:b,kind:c,reason:j}),"held";let k=(0,e.V9)(a,b);if(!k||k.kind!==c||k.body!==d)return U.info("relay-delivery-superseded",{relayId:b,kind:c}),"skipped";if("expired"!==c&&!(0,t.Lo)(k.relay.state))return U.info("relay-delivery-closed",{relayId:b,kind:c,state:k.relay.state}),"skipped";let l=k.relay,m=(0,r.S)(a,l.from);(0,s.o5)(b);let n=!1;try{let g=await (0,h.d)(a,{worktreeId:m.worktreeId,content:d,cliToolId:m.cliToolId,instanceId:m.instanceId,messageType:"relay",requestId:"reply"===c?(0,f.relayRequestId)(l.id):void 0});if(!g.ok)return U.info("relay-delivery-refused",{relayId:b,kind:c,stage:g.stage}),"prompt_waiting"===g.stage?"held":"failed";let i=Date.now();return"reply"===c?((0,e.Bf)(a,l.id,(0,f.relayRequestId)(l.id),i)||U.info("relay-already-closed-on-deliver",{relayId:b}),(0,S._)(a,l.id,"replied",m,(0,r.S)(a,l.to),i,{overlap:l.overlap,holdReason:l.holdReason})):"prompt"===c&&(0,S._)(a,l.id,"waiting",m,(0,r.S)(a,l.to),i),(0,e.uJ)(a,l.id,i,k.payloadId),"prompt"===c&&(0,e.jn)(a,l.id,i)&&(globalThis.__relayPumpAgain=!0),U.info("relay-delivered",{relayId:b,kind:c,to:`${m.worktreeId}/${m.instanceId}`}),n=!0,"delivered"}finally{if(!n&&"prompt"===c)try{(0,e.T)(a,l.id,k.payloadId)&&(U.info("relay-prompt-superseded-after-failed-delivery",{relayId:b}),globalThis.__relayPumpAgain=!0)}catch(a){U.warn("relay-prompt-supersede-failed",{relayId:b,error:a instanceof Error?a.message:String(a)})}(0,s.dJ)(b)}}async function ab(){if(!globalThis.__relayPumpRunning){globalThis.__relayPumpRunning=!0;try{let a=(0,d.getDbInstance)();X(a);for(let b=0;b<3;b+=1){for(let b of(globalThis.__relayPumpAgain=!1,(0,e.uG)(a)))if(!V.has(b.relay.id)){V.add(b.relay.id);try{await aa(a,b.relay.id,b.kind,b.body)}catch(a){U.warn("relay-delivery-failed",{relayId:b.relay.id,error:a instanceof Error?a.message:String(a)})}finally{V.delete(b.relay.id)}}if(!globalThis.__relayPumpAgain)break}}catch(a){U.warn("relay-pump-failed",{error:a instanceof Error?a.message:String(a)})}finally{globalThis.__relayPumpRunning=!1}}}async function ac(){try{X((0,d.getDbInstance)()),function(a,b=Date.now()){for(let c of(0,e.s7)(a,b))if(!(0,s.p5)(c.id))try{let d=(0,g.dV)(a);(0,e.uJ)(a,c.id,b),(0,e.wE)(a,c.id,b);let f=(0,i.KA)(d,z(a,c),c.expiresAt-c.createdAt),h=(0,e.be)(a,c.id,"expired",f,b);if(!(0,e.Cz)(a,c.id,b)){h&&(0,e.uJ)(a,c.id,b);continue}(0,S._)(a,c.id,"expired",(0,r.S)(a,c.from),(0,r.S)(a,c.to),b)}catch(a){U.warn("relay-expire-failed",{relayId:c.id,error:a instanceof Error?a.message:String(a)})}}((0,d.getDbInstance)())}catch(a){U.warn("relay-sweep-failed",{error:a instanceof Error?a.message:String(a)})}await ab()}},58707:(a,b,c)=>{c.d(b,{$n:()=>k,a3:()=>l,br:()=>m});var d=c(8360),e=c(31990),f=c(95595),g=c(34405),h=c(72626),i=c(30008);let j=(0,h.h)("prompt-waiting-guard"),k="PROMPT_WAITING";async function l(a,b,c,h){try{let k=d.CLIToolManager.getInstance().getTool(b);if(!await k.isRunning(a,c))return{waiting:!1};let l=await (0,e.Wh)(a,b,g._,c),m=(0,f.WC)(l,b),n=(0,i._G)({worktreeId:a,cliToolId:b,instanceId:c,scraper:{status:m.status,reason:m.reason,hasActivePrompt:m.hasActivePrompt},ignoreStructured:h?.ignoreStructured});if(!n.blocksSend)return null!==n.structuredSendBlockSuppressed&&j.info("structured-send-guard-not-applied",{worktreeId:a,cliToolId:b,instanceId:c,suppressed:n.structuredSendBlockSuppressed,promptWaitingSince:n.structured?.at??null}),{waiting:!1};return{waiting:!0,reason:n.blockReason??void 0,blockedBy:n.blockedBy??void 0}}catch(c){return j.warn("prompt-waiting-check-failed",{worktreeId:a,cliToolId:b,error:c instanceof Error?c.message:String(c)}),{waiting:!1}}}function m(a,b){let c=`${a} is waiting on a prompt. Sending now would type into the prompt's input line instead of reaching the agent, and would leave that text in place for the next answer. Answer the prompt first: \`commandmate respond ${a} <answer>\`.`;if("structured"!==b)return c;let d=Math.round(i.j0/6e4);return`${c} This dialog was reported by the agent's own hooks and is not visible to the terminal scraper, so if the pane looks idle the record has outlived its dialog: it stops blocking sends ${d} minutes after it was reported, or immediately with \`commandmate send ${a} <message> --ignore-structured-prompt\` (server-wide: ${i.F1}=off).`}},67164:(a,b,c)=>{c.d(b,{_:()=>i});var d=c(52660),e=c(55233),f=c(43015),g=c(640);let h=(0,c(72626).h)("relay-system-line");function i(a,b,c,j,k,l=Date.now(),m={}){let n=`${d.RELAY_SYSTEM_REQUEST_ID_PREFIX}${b}:${c}`;try{if((0,d.findMessageByRequestId)(a,j.worktreeId,n))return!1;let i=(0,e.dV)(a),o=(0,d.createRelaySystemMessage)(a,{worktreeId:j.worktreeId,cliToolId:j.cliToolId,instanceId:j.instanceId,content:(0,g.Nl)(i,c,k.alias,m),relayId:b,kind:c,at:l});try{(0,f.broadcastMessage)("message",{worktreeId:j.worktreeId,message:{...o,cliToolId:j.cliToolId,instanceId:j.instanceId}})}catch(a){h.warn("relay-system-line-broadcast-failed",{relayId:b,kind:c,error:a instanceof Error?a.message:String(a)})}return!0}catch(a){return h.warn("relay-system-line-failed",{relayId:b,kind:c,error:a instanceof Error?a.message:String(a)}),!1}}},85016:(a,b,c)=>{c.d(b,{dJ:()=>f,o5:()=>e,p5:()=>g});let d=(0,c(36925).v)("__relayDeliveryClaims",()=>new Set);function e(a){d.add(a)}function f(a){d.delete(a)}function g(a){return d.has(a)}},95220:(a,b,c)=>{c.r(b),c.d(b,{accumulateTuiContent:()=>g.IZ,cleanClaudeResponse:()=>f.NN,cleanCopilotResponse:()=>f.LH,cleanGeminiResponse:()=>f.IS,cleanOpenCodeResponse:()=>f.aW,clearPromptHashCache:()=>h.iX,clearTuiAccumulator:()=>g.q1,extractCopilotContentLines:()=>g.o0,extractTuiContentLines:()=>g.K0,findOverlapIndex:()=>g.vQ,getAccumulatedContent:()=>g.Uz,getActivePollers:()=>d.KQ,initTuiAccumulator:()=>g.tb,isDuplicatePrompt:()=>h.gv,isOpenCodeComplete:()=>e.bE,migrateResponsePollerWorktreeIds:()=>d.sR,normalizeCopilotLine:()=>g.IW,normalizePromptForDedup:()=>h.zm,renamePromptHashCacheKey:()=>h.i2,resolveExtractionStartIndex:()=>e.QM,startPolling:()=>d.g8,stopAllPolling:()=>d.fq,stopPolling:()=>d.Et,truncateMessage:()=>f.Sj});var d=c(45146),e=c(60),f=c(82450),g=c(13033),h=c(72457)}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=5209,exports.ids=[5209],exports.modules={998:(a,b,c)=>{c.d(b,{BF:()=>h,EH:()=>k,_R:()=>j});var d=c(11456),e=c(35524);let f={"session-killed":{state:"disable",poller:"stop"},"instance-removed":{state:"delete",poller:"stop"},"worktree-deleted":{state:"delete",poller:"stop"},"orphan-swept":{state:"delete",poller:"stop"},"consecutive-errors":{state:"disable",stopReason:"consecutive_errors",poller:"stop"},"server-shutdown":{state:"none",poller:"stop"}},g={"session-killed":"session-killed","instance-removed":"instance-removed","worktree-deleted":"worktree-deleted","orphan-swept":"orphan-swept","consecutive-errors":"consecutive-errors","server-shutdown":"shutdown"};function h(a,b){"stop"===f[a].poller&&(0,d.z)(g[a],()=>(function(a){switch(a.scope){case"instance":(0,e._i)((0,e.v7)(a.worktreeId,a.cliToolId,a.instanceId));return;case"worktree":(0,e._C)(a.worktreeId);return;case"key":(0,e._i)(a.compositeKey);return;case"all":(0,e.BS)();return}})(b))}function i(a,b){let c=(0,e.pL)(a);c&&(0,e.XK)((0,e.Ue)(a),c,b,(0,e.GE)(a)??void 0)}function j(a,b){let c=f[a];if("none"!==c.state)switch(b.scope){case"instance":"disable"===c.state?(0,e.XK)(b.worktreeId,b.cliToolId,c.stopReason,b.instanceId):(0,e.DR)((0,e.v7)(b.worktreeId,b.cliToolId,b.instanceId));return;case"worktree":"disable"===c.state?(0,e.kC)(b.worktreeId).forEach(a=>i(a,c.stopReason)):(0,e.LP)(b.worktreeId);return;case"key":"disable"===c.state?i(b.compositeKey,c.stopReason):(0,e.DR)(b.compositeKey);return;case"all":(0,e.hN)().forEach(a=>"disable"===c.state?i(a,c.stopReason):(0,e.DR)(a));return}}function k(a,b){h(a,b),j(a,b)}},23197:(a,b,c)=>{c.d(b,{H:()=>d});let d="__global__"},65209:(a,b,c)=>{c.d(b,{Nz:()=>t,l7:()=>x,vr:()=>v});var d=c(95220),e=c(998),f=c(56793),g=c(85775),h=c(93997),i=c(15194),j=c(23197),k=c(77093),l=c(72626),m=c(8360),n=c(79892),o=c(82325),p=c(73753),q=c(31347);let r=(0,l.h)("session-cleanup");async function s(a,b){let c={worktreeId:a,sessionsKilled:[],sessionErrors:[],pollersStopped:[],pollerErrors:[]};for(let e of((0,h.pc)(),i.XH)){try{await b(a,e)&&(c.sessionsKilled.push(e),r.info("session:killed",{worktreeId:a,cliToolId:e}))}catch(d){let b=`${e}: ${(0,k.u1)(d)}`;c.sessionErrors.push(b),r.warn("session:kill-failed",{worktreeId:a,cliToolId:e,error:d instanceof Error?d.message:String(d)})}try{(0,d.stopPolling)(a,e),c.pollersStopped.push(`response-poller:${e}`)}catch(d){let b=`response-poller:${e}: ${(0,k.u1)(d)}`;c.pollerErrors.push(b),r.warn("response-poller:stop-failed",{worktreeId:a,cliToolId:e,error:d instanceof Error?d.message:String(d)})}}try{(0,e.BF)("worktree-deleted",{scope:"worktree",worktreeId:a}),c.pollersStopped.push("auto-yes-poller")}catch(d){let b=`auto-yes-poller: ${(0,k.u1)(d)}`;c.pollerErrors.push(b),r.warn("auto-yes-poller:stop-failed",{worktreeId:a,error:d instanceof Error?d.message:String(d)})}try{(0,e._R)("worktree-deleted",{scope:"worktree",worktreeId:a}),c.pollersStopped.push("auto-yes-state")}catch(d){let b=`auto-yes-state: ${(0,k.u1)(d)}`;c.pollerErrors.push(b),r.warn("auto-yes-state:delete-failed",{worktreeId:a,error:d instanceof Error?d.message:String(d)})}try{(0,f.Yg)(a),c.pollersStopped.push("schedule-manager")}catch(d){let b=`schedule-manager: ${(0,k.u1)(d)}`;c.pollerErrors.push(b),r.warn("schedule-manager:stop-failed",{worktreeId:a,error:d instanceof Error?d.message:String(d)})}try{(0,g.Tm)(a),c.pollersStopped.push("timer-manager")}catch(d){let b=`timer-manager: ${(0,k.u1)(d)}`;c.pollerErrors.push(b),r.warn("timer-manager:stop-failed",{worktreeId:a,error:d instanceof Error?d.message:String(d)})}return c}async function t(a,b){let c=await Promise.allSettled(a.map(a=>s(a,b))),d=[],e=[];for(let b=0;b<c.length;b++){let f=c[b],g=a[b];if("fulfilled"===f.status){let a=f.value;for(let b of(d.push(a),a.sessionErrors))e.push(`Session kill error (${g}): ${b}`);for(let b of a.pollerErrors)e.push(`Poller stop error (${g}): ${b}`)}else e.push(`Cleanup failed (${g}): ${(0,k.u1)(f.reason)}`)}return{results:d,warnings:e}}async function u(a,b,c){try{let e=m.CLIToolManager.getInstance().getTool(b);if(!await e.isRunning(a))return!1;let f=e.getSessionName(a),g=await (0,q.s_)(f,c);if("owned"!==g.verdict)return!1;let h=`${a}:${b}`;return(0,d.clearPromptHashCache)(h),(0,n.fY)(f)}catch{return!1}}function v(a){return async(b,c)=>{let d=a.get(b);return void 0!==d&&u(b,c,d)}}async function w(){let a=0,b=m.CLIToolManager.getInstance();for(let c of i.XH)try{let d=b.getTool(c).getSessionName(j.H);await (0,n.N)(d)&&await (0,n.fY)(d)&&(a++,r.info("global-session:killed",{cliToolId:c,sessionName:d}))}catch(a){r.warn("global-session:kill-failed",{cliToolId:c,error:(0,k.u1)(a)})}return a}async function x(a,b){let c=new Map((0,p.Sj)(a).map(a=>[a.id,a.path])),d=(0,o.L0)(a,b);try{await w()}catch(a){r.warn("sync:global-cleanup-failed",{error:(0,k.u1)(a)})}let e=[];if(d.deletedIds.length>0)try{let a=await t(d.deletedIds,v(c));a.warnings.length>0&&(r.warn("sync:cleanup-warnings",{warnings:a.warnings}),e=[`${a.warnings.length} session cleanup warning(s) occurred`])}catch(a){r.error("sync:cleanup-failed",{error:(0,k.u1)(a)}),e=["Session cleanup encountered an error"]}return{syncResult:d,cleanupWarnings:e}}},82325:(a,b,c)=>{c.d(b,{Hz:()=>o,L0:()=>r,Mg:()=>s,YM:()=>p,Yp:()=>q});var d=c(79646),e=c(28354),f=c(29021),g=c.n(f),h=c(33873),i=c.n(h),j=c(23718),k=c(56791),l=c(72626),m=c(64185);let n=(0,l.h)("worktrees");function o(){let a=process.env.WORKTREE_REPOS;return a&&a.trim()?a.split(",").map(a=>a.trim()).filter(a=>a.length>0):[]}async function p(a){let b=(0,e.promisify)(d.exec);if(function(a){if(!a)return!1;try{return g().lstatSync(a),!1}catch(b){let a=b.code;return"ENOENT"===a||"ENOTDIR"===a}}(a))return n.warn("repository:scan-skipped-missing-dir",{repoPath:a}),[];try{let{stdout:c}=await b("git worktree list",{cwd:a}),d=function(a){if(!a||""===a.trim())return[];let b=a.trim().split("\n"),c=[];for(let a of b){let b=a.trim();if(!b)continue;let d=b.match(/^(.+?)\s+([a-z0-9]+)\s+(?:\[(.+?)\]|\(detached HEAD\))/);if(d){let[,a,b,e]=d;c.push({path:a.trim(),branch:e||`detached-${b}`,commit:b})}}return c}(c),e=i().resolve(a),f=i().basename(e);return(0,m.oZ)(e),d.map(a=>{let b=i().resolve(a.path);return{id:(0,j.ko)(b),name:a.branch,branch:a.branch,path:b,repositoryPath:e,repositoryName:f}}).filter(a=>["/etc","/root","/sys","/proc","/dev","/boot","/bin","/sbin","/usr/bin","/usr/sbin"].some(b=>a.path.startsWith(b))?(n.warn("worktree:unsafe-path-skipped",{path:a.path}),!1):!(a.path.includes("\0")||a.path.includes(".."))||(n.warn("worktree:malicious-path-skipped",{path:a.path}),!1))}catch(c){let a=c instanceof Error?c.message:String(c),b=c.code;if(a?.includes("not a git repository")||128===b)return[];throw c}}async function q(a){let b=await Promise.allSettled(a.map(async a=>{n.info("repository:scan-start",{repoPath:a});let b=await p(a);return n.info("repository:scan-complete",{repoPath:a,worktreeCount:b.length}),b})),c=[];for(let d=0;d<b.length;d++){let e=b[d];"fulfilled"===e.status?c.push(...e.value):n.error("repository:scan-failed",{repoPath:a[d],error:e.reason instanceof Error?e.reason.message:String(e.reason)})}return c}function r(a,b){if(0===b.length)return{deletedIds:[],upsertedCount:0};let c=[],d=0,e=new Map;for(let a of b){let b=a.repositoryPath||"";e.has(b)||e.set(b,[]),e.get(b).push(a)}let f=new Set([...(0,k.getAllWorktreeIds)(a),...(0,k.getAliasedWorktreeIds)(a)]),g=new Map((0,k.getAllWorktreePathIds)(a).map(a=>[i().resolve(a.path),a.id])),h=new Map,l=new Map;for(let[a,b]of g)h.set(a,new Set([b])),l.set(b,a);for(let b of(0,k.getAllWorktreeAliases)(a)){let a=l.get(b.worktreeId);a&&h.get(a)?.add(b.oldId)}let m=new Set(b.map(a=>i().resolve(a.path)));for(let[b,o]of e){if(!b)continue;let e=(0,k.getWorktreesByRepository)(a,b).filter(a=>!m.has(i().resolve(a.path))).map(a=>a.id);if(e.length>0){let b=(0,k.deleteWorktreesByIds)(a,e);for(let a of(c.push(...e),e)){f.delete(a);let b=l.get(a);void 0!==b&&(g.delete(b),h.delete(b))}n.info("worktree:cleanup",{deletedCount:b.deletedCount})}for(let b of o){let c=i().resolve(b.path),e=g.get(c),m=b.id,n=e??(m&&!f.has(m)?m:function(a,b,c){if(!c||0===c.size)return(0,j.ko)(a,b);let d=new Set(b);for(let a of c)d.delete(a);return(0,j.ko)(a,d)}(c,f,h.get(c)));f.add(n),g.set(c,n),l.set(n,c),(0,k.upsertWorktree)(a,{...b,id:n,name:b.branch??b.name}),d++}}return{deletedIds:c,upsertedCount:d}}function s(a,b){let c=new Set(b.map(a=>a.repositoryPath).filter(a=>!!a)),d=[];for(let b of(0,k.getRepositories)(a)){let e=b.path;if(!e||c.has(e)||function(a){if(!a)return!1;try{return g().existsSync(a)&&g().existsSync(i().join(a,".git"))}catch{return!0}}(e))continue;let f=(0,k.getWorktreesByRepository)(a,e).map(a=>a.id);if(0===f.length)continue;let h=(0,k.deleteWorktreesByIds)(a,f);d.push(...f),n.info("worktree:stale-repo-pruned",{repoPath:e,deletedCount:h.deletedCount})}return d}},85775:(a,b,c)=>{c.d(b,{Tm:()=>p,x4:()=>n,xJ:()=>o});var d=c(34129),e=c(8360),f=c(88807),g=c(72626),h=c(87374),i=c(39687),j=c(36925);let k=(0,g.h)("timer-manager");function l(){return(0,j.v)("__timerManagerState",()=>({timers:new Map,timerWorktrees:new Map,initialized:!1}))}async function m(a){let b=l(),c=(0,f.getDbInstance)();try{let b=(0,d.kx)(c,a);if(!b||"pending"!==b.status)return;let f=e.CLIToolManager.getInstance().getTool(b.cliToolId),g=b.instanceId,j=await f.isRunning(b.worktreeId,g),l=(0,d.kx)(c,a);if(!l||"pending"!==l.status)return;if(!j){k.warn("timer:no-session",{timerId:a,worktreeId:b.worktreeId,instanceId:g}),(0,d.j2)(c,a,h.HR.NO_SESSION);return}(0,d.j2)(c,a,"sending");let m=await (0,i.d)(c,{worktreeId:b.worktreeId,content:b.message,cliToolId:b.cliToolId,instanceId:g});if(!m.ok){let b=`[${m.stage}] ${m.error}`;(0,d.j2)(c,a,"failed",void 0,b),k.error("timer:send-failed",{timerId:a,stage:m.stage,error:m.error});return}(0,d.j2)(c,a,"sent",Date.now()),k.info("timer:sent",{timerId:a,worktreeId:b.worktreeId})}catch(e){let b=e instanceof Error?e.message:String(e);try{(0,d.j2)(c,a,"failed",void 0,b)}catch{}k.error("timer:send-failed",{timerId:a,error:b})}finally{b.timers.delete(a),b.timerWorktrees.delete(a)}}function n(a,b,c){let d=l(),e=setTimeout(()=>{m(a)},c);d.timers.set(a,e),d.timerWorktrees.set(a,b)}function o(a){let b=l(),c=b.timers.get(a);c&&(clearTimeout(c),b.timers.delete(a),b.timerWorktrees.delete(a));let e=(0,f.getDbInstance)();(0,d.Ud)(e,a)}function p(a){let b=l(),c=(0,f.getDbInstance)();for(let[c,d]of b.timerWorktrees)if(d===a){let a=b.timers.get(c);a&&clearTimeout(a),b.timers.delete(c),b.timerWorktrees.delete(c)}(0,d.$$)(c,a)}}};
|
|
1
|
+
"use strict";exports.id=5209,exports.ids=[5209],exports.modules={998:(a,b,c)=>{c.d(b,{BF:()=>h,EH:()=>k,_R:()=>j});var d=c(11456),e=c(35524);let f={"session-killed":{state:"disable",poller:"stop"},"instance-removed":{state:"delete",poller:"stop"},"worktree-deleted":{state:"delete",poller:"stop"},"orphan-swept":{state:"delete",poller:"stop"},"consecutive-errors":{state:"disable",stopReason:"consecutive_errors",poller:"stop"},"server-shutdown":{state:"none",poller:"stop"}},g={"session-killed":"session-killed","instance-removed":"instance-removed","worktree-deleted":"worktree-deleted","orphan-swept":"orphan-swept","consecutive-errors":"consecutive-errors","server-shutdown":"shutdown"};function h(a,b){"stop"===f[a].poller&&(0,d.z)(g[a],()=>(function(a){switch(a.scope){case"instance":(0,e._i)((0,e.v7)(a.worktreeId,a.cliToolId,a.instanceId));return;case"worktree":(0,e._C)(a.worktreeId);return;case"key":(0,e._i)(a.compositeKey);return;case"all":(0,e.BS)();return}})(b))}function i(a,b){let c=(0,e.pL)(a);c&&(0,e.XK)((0,e.Ue)(a),c,b,(0,e.GE)(a)??void 0)}function j(a,b){let c=f[a];if("none"!==c.state)switch(b.scope){case"instance":"disable"===c.state?(0,e.XK)(b.worktreeId,b.cliToolId,c.stopReason,b.instanceId):(0,e.DR)((0,e.v7)(b.worktreeId,b.cliToolId,b.instanceId));return;case"worktree":"disable"===c.state?(0,e.kC)(b.worktreeId).forEach(a=>i(a,c.stopReason)):(0,e.LP)(b.worktreeId);return;case"key":"disable"===c.state?i(b.compositeKey,c.stopReason):(0,e.DR)(b.compositeKey);return;case"all":(0,e.hN)().forEach(a=>"disable"===c.state?i(a,c.stopReason):(0,e.DR)(a));return}}function k(a,b){h(a,b),j(a,b)}},23197:(a,b,c)=>{c.d(b,{H:()=>d});let d="__global__"},65209:(a,b,c)=>{c.d(b,{Nz:()=>t,l7:()=>x,vr:()=>v});var d=c(95220),e=c(998),f=c(56793),g=c(85775),h=c(93997),i=c(15194),j=c(23197),k=c(77093),l=c(72626),m=c(8360),n=c(79892),o=c(82325),p=c(73753),q=c(31347);let r=(0,l.h)("session-cleanup");async function s(a,b){let c={worktreeId:a,sessionsKilled:[],sessionErrors:[],pollersStopped:[],pollerErrors:[]};for(let e of((0,h.pc)(),i.XH)){try{await b(a,e)&&(c.sessionsKilled.push(e),r.info("session:killed",{worktreeId:a,cliToolId:e}))}catch(d){let b=`${e}: ${(0,k.u1)(d)}`;c.sessionErrors.push(b),r.warn("session:kill-failed",{worktreeId:a,cliToolId:e,error:d instanceof Error?d.message:String(d)})}try{(0,d.stopPolling)(a,e),c.pollersStopped.push(`response-poller:${e}`)}catch(d){let b=`response-poller:${e}: ${(0,k.u1)(d)}`;c.pollerErrors.push(b),r.warn("response-poller:stop-failed",{worktreeId:a,cliToolId:e,error:d instanceof Error?d.message:String(d)})}}try{(0,e.BF)("worktree-deleted",{scope:"worktree",worktreeId:a}),c.pollersStopped.push("auto-yes-poller")}catch(d){let b=`auto-yes-poller: ${(0,k.u1)(d)}`;c.pollerErrors.push(b),r.warn("auto-yes-poller:stop-failed",{worktreeId:a,error:d instanceof Error?d.message:String(d)})}try{(0,e._R)("worktree-deleted",{scope:"worktree",worktreeId:a}),c.pollersStopped.push("auto-yes-state")}catch(d){let b=`auto-yes-state: ${(0,k.u1)(d)}`;c.pollerErrors.push(b),r.warn("auto-yes-state:delete-failed",{worktreeId:a,error:d instanceof Error?d.message:String(d)})}try{(0,f.Yg)(a),c.pollersStopped.push("schedule-manager")}catch(d){let b=`schedule-manager: ${(0,k.u1)(d)}`;c.pollerErrors.push(b),r.warn("schedule-manager:stop-failed",{worktreeId:a,error:d instanceof Error?d.message:String(d)})}try{(0,g.Tm)(a),c.pollersStopped.push("timer-manager")}catch(d){let b=`timer-manager: ${(0,k.u1)(d)}`;c.pollerErrors.push(b),r.warn("timer-manager:stop-failed",{worktreeId:a,error:d instanceof Error?d.message:String(d)})}return c}async function t(a,b){let c=await Promise.allSettled(a.map(a=>s(a,b))),d=[],e=[];for(let b=0;b<c.length;b++){let f=c[b],g=a[b];if("fulfilled"===f.status){let a=f.value;for(let b of(d.push(a),a.sessionErrors))e.push(`Session kill error (${g}): ${b}`);for(let b of a.pollerErrors)e.push(`Poller stop error (${g}): ${b}`)}else e.push(`Cleanup failed (${g}): ${(0,k.u1)(f.reason)}`)}return{results:d,warnings:e}}async function u(a,b,c){try{let e=m.CLIToolManager.getInstance().getTool(b);if(!await e.isRunning(a))return!1;let f=e.getSessionName(a),g=await (0,q.s_)(f,c);if("owned"!==g.verdict)return!1;let h=`${a}:${b}`;return(0,d.clearPromptHashCache)(h),(0,n.fY)(f)}catch{return!1}}function v(a){return async(b,c)=>{let d=a.get(b);return void 0!==d&&u(b,c,d)}}async function w(){let a=0,b=m.CLIToolManager.getInstance();for(let c of i.XH)try{let d=b.getTool(c).getSessionName(j.H);await (0,n.N)(d)&&await (0,n.fY)(d)&&(a++,r.info("global-session:killed",{cliToolId:c,sessionName:d}))}catch(a){r.warn("global-session:kill-failed",{cliToolId:c,error:(0,k.u1)(a)})}return a}async function x(a,b){let c=new Map((0,p.Sj)(a).map(a=>[a.id,a.path])),d=(0,o.L0)(a,b);try{await w()}catch(a){r.warn("sync:global-cleanup-failed",{error:(0,k.u1)(a)})}let e=[];if(d.deletedIds.length>0)try{let a=await t(d.deletedIds,v(c));a.warnings.length>0&&(r.warn("sync:cleanup-warnings",{warnings:a.warnings}),e=[`${a.warnings.length} session cleanup warning(s) occurred`])}catch(a){r.error("sync:cleanup-failed",{error:(0,k.u1)(a)}),e=["Session cleanup encountered an error"]}return{syncResult:d,cleanupWarnings:e}}},82325:(a,b,c)=>{c.d(b,{Hz:()=>o,L0:()=>r,Mg:()=>s,YM:()=>p,Yp:()=>q});var d=c(79646),e=c(28354),f=c(29021),g=c.n(f),h=c(33873),i=c.n(h),j=c(23718),k=c(56791),l=c(72626),m=c(64185);let n=(0,l.h)("worktrees");function o(){let a=process.env.WORKTREE_REPOS;return a&&a.trim()?a.split(",").map(a=>a.trim()).filter(a=>a.length>0):[]}async function p(a){let b=(0,e.promisify)(d.exec);if(function(a){if(!a)return!1;try{return g().lstatSync(a),!1}catch(b){let a=b.code;return"ENOENT"===a||"ENOTDIR"===a}}(a))return n.warn("repository:scan-skipped-missing-dir",{repoPath:a}),[];try{let{stdout:c}=await b("git worktree list",{cwd:a}),d=function(a){if(!a||""===a.trim())return[];let b=a.trim().split("\n"),c=[];for(let a of b){let b=a.trim();if(!b)continue;let d=b.match(/^(.+?)\s+([a-z0-9]+)\s+(?:\[(.+?)\]|\(detached HEAD\))/);if(d){let[,a,b,e]=d;c.push({path:a.trim(),branch:e||`detached-${b}`,commit:b})}}return c}(c),e=i().resolve(a),f=i().basename(e);return(0,m.oZ)(e),d.map(a=>{let b=i().resolve(a.path);return{id:(0,j.ko)(b),name:a.branch,branch:a.branch,path:b,repositoryPath:e,repositoryName:f}}).filter(a=>["/etc","/root","/sys","/proc","/dev","/boot","/bin","/sbin","/usr/bin","/usr/sbin"].some(b=>a.path.startsWith(b))?(n.warn("worktree:unsafe-path-skipped",{path:a.path}),!1):!(a.path.includes("\0")||a.path.includes(".."))||(n.warn("worktree:malicious-path-skipped",{path:a.path}),!1))}catch(c){let a=c instanceof Error?c.message:String(c),b=c.code;if(a?.includes("not a git repository")||128===b)return[];throw c}}async function q(a){let b=await Promise.allSettled(a.map(async a=>{n.info("repository:scan-start",{repoPath:a});let b=await p(a);return n.info("repository:scan-complete",{repoPath:a,worktreeCount:b.length}),b})),c=[];for(let d=0;d<b.length;d++){let e=b[d];"fulfilled"===e.status?c.push(...e.value):n.error("repository:scan-failed",{repoPath:a[d],error:e.reason instanceof Error?e.reason.message:String(e.reason)})}return c}function r(a,b){if(0===b.length)return{deletedIds:[],upsertedCount:0};let c=[],d=0,e=new Map;for(let a of b){let b=a.repositoryPath||"";e.has(b)||e.set(b,[]),e.get(b).push(a)}let f=new Set([...(0,k.getAllWorktreeIds)(a),...(0,k.getAliasedWorktreeIds)(a)]),g=new Map((0,k.getAllWorktreePathIds)(a).map(a=>[i().resolve(a.path),a.id])),h=new Map,l=new Map;for(let[a,b]of g)h.set(a,new Set([b])),l.set(b,a);for(let b of(0,k.getAllWorktreeAliases)(a)){let a=l.get(b.worktreeId);a&&h.get(a)?.add(b.oldId)}let m=new Set(b.map(a=>i().resolve(a.path)));for(let[b,o]of e){if(!b)continue;let e=(0,k.getWorktreesByRepository)(a,b).filter(a=>!m.has(i().resolve(a.path))).map(a=>a.id);if(e.length>0){let b=(0,k.deleteWorktreesByIds)(a,e);for(let a of(c.push(...e),e)){f.delete(a);let b=l.get(a);void 0!==b&&(g.delete(b),h.delete(b))}n.info("worktree:cleanup",{deletedCount:b.deletedCount})}for(let b of o){let c=i().resolve(b.path),e=g.get(c),m=b.id,n=e??(m&&!f.has(m)?m:function(a,b,c){if(!c||0===c.size)return(0,j.ko)(a,b);let d=new Set(b);for(let a of c)d.delete(a);return(0,j.ko)(a,d)}(c,f,h.get(c)));f.add(n),g.set(c,n),l.set(n,c),(0,k.upsertWorktree)(a,{...b,id:n,name:b.branch??b.name}),d++}}return{deletedIds:c,upsertedCount:d}}function s(a,b){let c=new Set(b.map(a=>a.repositoryPath).filter(a=>!!a)),d=[];for(let b of(0,k.getRepositories)(a)){let e=b.path;if(!e||c.has(e)||function(a){if(!a)return!1;try{return g().existsSync(a)&&g().existsSync(i().join(a,".git"))}catch{return!0}}(e))continue;let f=(0,k.getWorktreesByRepository)(a,e).map(a=>a.id);if(0===f.length)continue;let h=(0,k.deleteWorktreesByIds)(a,f);d.push(...f),n.info("worktree:stale-repo-pruned",{repoPath:e,deletedCount:h.deletedCount})}return d}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=5354,exports.ids=[5354],exports.modules={3421:(a,b,c)=>{Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(71237),e=c(55088),f=c(17679);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},27289:(a,b,c)=>{c.d(b,{t:()=>j,z:()=>i});var d=c(10641),e=c(88807),f=c(56791),g=c(95506),h=c(66007);function i(a){if(!a)return a;try{if(!(0,h.h6)(a))return a;let b=(0,e.getDbInstance)();return(0,g.l0)(b,a)??a}catch{return a}}function j(a){if(!(0,h.h6)(a))return d.NextResponse.json({error:"Invalid worktree ID format"},{status:400});let b=(0,e.getDbInstance)(),c=(0,f.getWorktreeById)(b,i(a));return c||d.NextResponse.json({error:"Worktree not found"},{status:404})}},56791:(a,b,c)=>{c.r(b),c.d(b,{ACTIVE_FILTER:()=>d.ks,ACTIVE_TASK_STATUSES:()=>d.EL,AgentInstanceLimitError:()=>d.AC,CURRENT_SCHEMA_VERSION:()=>f.FT,DEFAULT_RUN_HISTORY_LIMIT:()=>d.Tu,InvalidAgentInstanceError:()=>d.ug,MAX_DISABLED_REPOSITORIES:()=>h.nc,MAX_RUN_HISTORY_DAYS:()=>d.eP,MAX_RUN_HISTORY_LIMIT:()=>d.mg,MemoDbError:()=>d.lm,NEW_SUBSCRIPTION_DEFAULTS:()=>d.s6,PUSH_DEFAULTS_VERSION:()=>d.VP,RepositoryDbError:()=>h.j8,TASK_STATUSES:()=>d.Hi,TERMINAL_TASK_STATUSES:()=>d.sA,VERIFICATION_GATE_SOURCES:()=>d.Dx,VERIFICATION_TRIGGERS:()=>d.af,WORKTREE_TODO_STATUSES:()=>d.KG,addAgentInstance:()=>d.Uq,cancelTimer:()=>d.Ud,cancelTimersByWorktree:()=>d.$$,cleanupOldTimers:()=>d.ul,clearInProgressMessageId:()=>d.YX,clearLastUserMessage:()=>d.cf,clearTimerHistory:()=>d.jf,closeDbInstance:()=>e.closeDbInstance,countAgentInstances:()=>d.fs,countDisabledRepositories:()=>h.QJ,countPushSubscriptionsForKind:()=>d.rC,countWorktreesByRepositoryPath:()=>h.kp,createCloneJob:()=>h.tw,createGateResult:()=>d.hl,createMemo:()=>d.To,createMessage:()=>d.oH,createRepository:()=>h.vB,createTask:()=>d.UT,createTimer:()=>d.CR,createVerificationRun:()=>d.rY,createWorktreeTodo:()=>d.yy,deleteAllMessages:()=>d.pE,deleteMemo:()=>d.cP,deleteMessageById:()=>d.DF,deleteMessagesByCliTool:()=>d.lA,deleteMessagesByInstance:()=>d.Qp,deletePushSubscriptionByEndpoint:()=>d.th,deleteRepository:()=>h.oG,deleteRepositoryWorktrees:()=>d.oZ,deleteSessionState:()=>d.ZP,deleteWorktreeTodo:()=>d.vg,deleteWorktreesByIds:()=>d.Rm,disableExistingRepository:()=>h.eP,disableRepository:()=>h.l$,ensureEnvRepositoriesRegistered:()=>h.ES,filterExcludedPaths:()=>h.Ho,findMessageByRequestId:()=>d.Ow,finishGateResult:()=>d.C8,finishVerificationRun:()=>d.u$,getActiveCloneJobByUrl:()=>h.fD,getActiveTask:()=>d.__,getActiveTaskForInstance:()=>d.MH,getAgentInstance:()=>d.BN,getAgentInstances:()=>d.m0,getAliasedWorktreeIds:()=>d.r3,getAllPushSubscriptions:()=>d.Se,getAllRepositories:()=>h.Yg,getAllRepositoriesWithWorktreeCount:()=>h._D,getAllWorktreeAliases:()=>d.fX,getAllWorktreeIds:()=>d.nO,getAllWorktreePathIds:()=>d.Sj,getCloneJob:()=>h.bM,getCloneJobsByStatus:()=>h.n_,getCurrentVersion:()=>f.Mj,getDailyReport:()=>d.ap,getDbInstance:()=>e.getDbInstance,getDefaultDbPath:()=>g.$b,getExcludedRepositories:()=>h.lS,getExcludedRepositoryPaths:()=>h.pr,getInitialBranch:()=>d.p4,getIssueDbPath:()=>g.zm,getLastAssistantMessageAt:()=>d.nP,getLastMessage:()=>d.sy,getLastUserMessage:()=>d.r8,getLegacyDbPaths:()=>q,getMemoById:()=>d.DN,getMemosByWorktreeId:()=>d.pZ,getMessageById:()=>d.kA,getMessages:()=>d.VL,getMessagesByDateRange:()=>d.lr,getMigrationHistory:()=>f.PS,getPendingTimerCountByWorktree:()=>d.GF,getPendingTimers:()=>d._O,getPushSubscriptionByEndpoint:()=>d.CF,getPushSubscriptionsForKind:()=>d.gn,getRepositories:()=>d.NV,getRepositoryById:()=>h.r,getRepositoryByNormalizedUrl:()=>h.Uj,getRepositoryByPath:()=>h.Dp,getRunningVerificationRun:()=>d.WZ,getSessionState:()=>d.y1,getTask:()=>d.gg,getTimerById:()=>d.kx,getTimersByWorktree:()=>d.DP,getTodosByWorktreeId:()=>d.fr,getVerificationRun:()=>d.J6,getWorktreeAliases:()=>d.Q2,getWorktreeById:()=>d.Ui,getWorktreeIdsByRepository:()=>d.P9,getWorktreeTodoById:()=>d.eN,getWorktrees:()=>d.vi,getWorktreesByRepository:()=>d.uJ,initDatabase:()=>d.s4,isTerminalTaskStatus:()=>d.uB,isWorktreeTodoStatus:()=>d.yT,listRunningVerificationRuns:()=>d.Fi,listTaskEvents:()=>d.HB,listTasks:()=>d.Vk,listVerificationRuns:()=>d.Mt,listVerificationRunsForPeriod:()=>d.UE,markPendingPromptsAsAnswered:()=>d.PL,migrateDbIfNeeded:()=>r,migrateWorktreeIdPreservingChildren:()=>d._h,pushSubscriptionNeedsDefaultsNotice:()=>d.Zj,recomputeLastUserMessage:()=>d.jp,recordAnsweredPrompt:()=>d.pG,recordWorktreeAlias:()=>d.xJ,recoverStuckSendingTimers:()=>d.Xm,registerAndFilterRepositories:()=>h.$G,removeAgentInstance:()=>d.NU,reorderMemos:()=>d.nQ,reorderWorktreeTodos:()=>d.yb,resolveAndValidatePath:()=>p,resolveRepositoryPath:()=>h.mE,resolveWorktreeIdWithAlias:()=>d.l0,restoreRepository:()=>h.RS,rollbackMigrations:()=>f.Wy,runMigrations:()=>f.vI,saveDailyReport:()=>d.tt,saveInitialBranch:()=>d.GA,setAgentInstances:()=>d.Cs,setInProgressMessageId:()=>d.OF,setRepositoryEnabled:()=>h.iQ,updateCliToolId:()=>d.WU,updateCloneJob:()=>h.k5,updateDailyReportContent:()=>d.IF,updateFavorite:()=>d.O,updateLastUserMessage:()=>d.EU,updateLastViewedAt:()=>d.HZ,updateMemo:()=>d.UY,updateMessageContent:()=>d.e8,updatePromptData:()=>d.cw,updatePushSubscriptionPreferences:()=>d.jJ,updateRepository:()=>h.Ir,updateSelectedAgents:()=>d.DC,updateSessionState:()=>d.PP,updateStatus:()=>d.yB,updateTimerStatus:()=>d.j2,updateVibeLocalContextWindow:()=>d.s,updateVibeLocalModel:()=>d.iu,updateWorktreeDescription:()=>d.hq,updateWorktreeLink:()=>d.z1,updateWorktreeTodo:()=>d.bl,upsertPushSubscription:()=>d.jA,upsertWorktree:()=>d.ZL,validateDbPath:()=>g.Sv,validateRepositoryPath:()=>h.Ux,validateSchema:()=>f.i6});var d=c(683),e=c(88807),f=c(
|
|
1
|
+
"use strict";exports.id=5354,exports.ids=[5354],exports.modules={3421:(a,b,c)=>{Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(71237),e=c(55088),f=c(17679);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},27289:(a,b,c)=>{c.d(b,{t:()=>j,z:()=>i});var d=c(10641),e=c(88807),f=c(56791),g=c(95506),h=c(66007);function i(a){if(!a)return a;try{if(!(0,h.h6)(a))return a;let b=(0,e.getDbInstance)();return(0,g.l0)(b,a)??a}catch{return a}}function j(a){if(!(0,h.h6)(a))return d.NextResponse.json({error:"Invalid worktree ID format"},{status:400});let b=(0,e.getDbInstance)(),c=(0,f.getWorktreeById)(b,i(a));return c||d.NextResponse.json({error:"Worktree not found"},{status:404})}},56791:(a,b,c)=>{c.r(b),c.d(b,{ACTIVE_FILTER:()=>d.ks,ACTIVE_TASK_STATUSES:()=>d.EL,AgentInstanceLimitError:()=>d.AC,CURRENT_SCHEMA_VERSION:()=>f.FT,DEFAULT_RUN_HISTORY_LIMIT:()=>d.Tu,InvalidAgentInstanceError:()=>d.ug,MAX_DISABLED_REPOSITORIES:()=>h.nc,MAX_RUN_HISTORY_DAYS:()=>d.eP,MAX_RUN_HISTORY_LIMIT:()=>d.mg,MemoDbError:()=>d.lm,NEW_SUBSCRIPTION_DEFAULTS:()=>d.s6,PUSH_DEFAULTS_VERSION:()=>d.VP,RepositoryDbError:()=>h.j8,TASK_STATUSES:()=>d.Hi,TERMINAL_TASK_STATUSES:()=>d.sA,VERIFICATION_GATE_SOURCES:()=>d.Dx,VERIFICATION_TRIGGERS:()=>d.af,WORKTREE_TODO_STATUSES:()=>d.KG,addAgentInstance:()=>d.Uq,cancelTimer:()=>d.Ud,cancelTimersByWorktree:()=>d.$$,cleanupOldTimers:()=>d.ul,clearInProgressMessageId:()=>d.YX,clearLastUserMessage:()=>d.cf,clearTimerHistory:()=>d.jf,closeDbInstance:()=>e.closeDbInstance,countAgentInstances:()=>d.fs,countDisabledRepositories:()=>h.QJ,countPushSubscriptionsForKind:()=>d.rC,countWorktreesByRepositoryPath:()=>h.kp,createCloneJob:()=>h.tw,createGateResult:()=>d.hl,createMemo:()=>d.To,createMessage:()=>d.oH,createRepository:()=>h.vB,createTask:()=>d.UT,createTimer:()=>d.CR,createVerificationRun:()=>d.rY,createWorktreeTodo:()=>d.yy,deleteAllMessages:()=>d.pE,deleteMemo:()=>d.cP,deleteMessageById:()=>d.DF,deleteMessagesByCliTool:()=>d.lA,deleteMessagesByInstance:()=>d.Qp,deletePushSubscriptionByEndpoint:()=>d.th,deleteRepository:()=>h.oG,deleteRepositoryWorktrees:()=>d.oZ,deleteSessionState:()=>d.ZP,deleteWorktreeTodo:()=>d.vg,deleteWorktreesByIds:()=>d.Rm,disableExistingRepository:()=>h.eP,disableRepository:()=>h.l$,ensureEnvRepositoriesRegistered:()=>h.ES,filterExcludedPaths:()=>h.Ho,findMessageByRequestId:()=>d.Ow,finishGateResult:()=>d.C8,finishVerificationRun:()=>d.u$,getActiveCloneJobByUrl:()=>h.fD,getActiveTask:()=>d.__,getActiveTaskForInstance:()=>d.MH,getAgentInstance:()=>d.BN,getAgentInstances:()=>d.m0,getAliasedWorktreeIds:()=>d.r3,getAllPushSubscriptions:()=>d.Se,getAllRepositories:()=>h.Yg,getAllRepositoriesWithWorktreeCount:()=>h._D,getAllWorktreeAliases:()=>d.fX,getAllWorktreeIds:()=>d.nO,getAllWorktreePathIds:()=>d.Sj,getCloneJob:()=>h.bM,getCloneJobsByStatus:()=>h.n_,getCurrentVersion:()=>f.Mj,getDailyReport:()=>d.ap,getDbInstance:()=>e.getDbInstance,getDefaultDbPath:()=>g.$b,getExcludedRepositories:()=>h.lS,getExcludedRepositoryPaths:()=>h.pr,getInitialBranch:()=>d.p4,getIssueDbPath:()=>g.zm,getLastAssistantMessageAt:()=>d.nP,getLastMessage:()=>d.sy,getLastUserMessage:()=>d.r8,getLegacyDbPaths:()=>q,getMemoById:()=>d.DN,getMemosByWorktreeId:()=>d.pZ,getMessageById:()=>d.kA,getMessages:()=>d.VL,getMessagesByDateRange:()=>d.lr,getMigrationHistory:()=>f.PS,getPendingTimerCountByWorktree:()=>d.GF,getPendingTimers:()=>d._O,getPushSubscriptionByEndpoint:()=>d.CF,getPushSubscriptionsForKind:()=>d.gn,getRepositories:()=>d.NV,getRepositoryById:()=>h.r,getRepositoryByNormalizedUrl:()=>h.Uj,getRepositoryByPath:()=>h.Dp,getRunningVerificationRun:()=>d.WZ,getSessionState:()=>d.y1,getTask:()=>d.gg,getTimerById:()=>d.kx,getTimersByWorktree:()=>d.DP,getTodosByWorktreeId:()=>d.fr,getVerificationRun:()=>d.J6,getWorktreeAliases:()=>d.Q2,getWorktreeById:()=>d.Ui,getWorktreeIdsByRepository:()=>d.P9,getWorktreeTodoById:()=>d.eN,getWorktrees:()=>d.vi,getWorktreesByRepository:()=>d.uJ,initDatabase:()=>d.s4,isTerminalTaskStatus:()=>d.uB,isWorktreeTodoStatus:()=>d.yT,listRunningVerificationRuns:()=>d.Fi,listTaskEvents:()=>d.HB,listTasks:()=>d.Vk,listVerificationRuns:()=>d.Mt,listVerificationRunsForPeriod:()=>d.UE,markPendingPromptsAsAnswered:()=>d.PL,migrateDbIfNeeded:()=>r,migrateWorktreeIdPreservingChildren:()=>d._h,pushSubscriptionNeedsDefaultsNotice:()=>d.Zj,recomputeLastUserMessage:()=>d.jp,recordAnsweredPrompt:()=>d.pG,recordWorktreeAlias:()=>d.xJ,recoverStuckSendingTimers:()=>d.Xm,registerAndFilterRepositories:()=>h.$G,removeAgentInstance:()=>d.NU,reorderMemos:()=>d.nQ,reorderWorktreeTodos:()=>d.yb,resolveAndValidatePath:()=>p,resolveRepositoryPath:()=>h.mE,resolveWorktreeIdWithAlias:()=>d.l0,restoreRepository:()=>h.RS,rollbackMigrations:()=>f.Wy,runMigrations:()=>f.vI,saveDailyReport:()=>d.tt,saveInitialBranch:()=>d.GA,setAgentInstances:()=>d.Cs,setInProgressMessageId:()=>d.OF,setRepositoryEnabled:()=>h.iQ,updateCliToolId:()=>d.WU,updateCloneJob:()=>h.k5,updateDailyReportContent:()=>d.IF,updateFavorite:()=>d.O,updateLastUserMessage:()=>d.EU,updateLastViewedAt:()=>d.HZ,updateMemo:()=>d.UY,updateMessageContent:()=>d.e8,updatePromptData:()=>d.cw,updatePushSubscriptionPreferences:()=>d.jJ,updateRepository:()=>h.Ir,updateSelectedAgents:()=>d.DC,updateSessionState:()=>d.PP,updateStatus:()=>d.yB,updateTimerStatus:()=>d.j2,updateVibeLocalContextWindow:()=>d.s,updateVibeLocalModel:()=>d.iu,updateWorktreeDescription:()=>d.hq,updateWorktreeLink:()=>d.z1,updateWorktreeTodo:()=>d.bl,upsertPushSubscription:()=>d.jA,upsertWorktree:()=>d.ZL,validateDbPath:()=>g.Sv,validateRepositoryPath:()=>h.Ux,validateSchema:()=>f.i6});var d=c(683),e=c(88807),f=c(55741),g=c(20416),h=c(10406),i=c(29021),j=c.n(i),k=c(33873),l=c.n(k),m=c(21820),n=c(7956);let o=(0,c(72626).h)("db-migration-path");function p(a,b){try{if(!j().existsSync(a))return null;let c=j().realpathSync(a);if((0,n.fW)(c))return o.warn(`[Security] ${b} points to system directory, skipping: ${c}`),null;return c}catch{return o.warn(`[Security] Failed to resolve ${b}: ${a}`),null}}function q(){let a=[];a.push(l().join(process.cwd(),"data","db.sqlite")),a.push(l().join(process.cwd(),"data","cm.db")),a.push(l().join((0,m.homedir)(),".commandmate","data","db.sqlite"));let b=process.env.DATABASE_PATH;if(b)try{let c=l().resolve(b);(0,n.fW)(c)?o.warn(`[Security] Skipping DATABASE_PATH in system directory: ${c}`):a.push(b)}catch{o.warn(`[Security] Invalid DATABASE_PATH: ${b}`)}return a}function r(a){let b=l().resolve(a);if((0,n.fW)(b))throw Error(`Security error: Target path cannot be in system directory: ${b}`);if(j().existsSync(a)){let b=p(a,"target path");if(b)return{migrated:!1,targetPath:b}}for(let a of q()){let c=p(a,"legacy path");if(!c)continue;let d=`${c}.bak`;j().copyFileSync(c,d),j().chmodSync(d,384);let e=l().dirname(b);return j().existsSync(e)||j().mkdirSync(e,{recursive:!0,mode:448}),j().copyFileSync(c,b),o.info(`[Migration] Database migrated from ${c} to ${b}`),o.info(`[Migration] Backup created at ${d}`),{migrated:!0,sourcePath:c,targetPath:b,backupPath:d}}return{migrated:!1,targetPath:b}}},93813:(a,b,c)=>{c.d(b,{B1:()=>m,Bx:()=>i,Nc:()=>h,b1:()=>g,ef:()=>n,gZ:()=>k,lp:()=>l});var d=c(79748),e=c(33873);let f=[".git",".env",".env.*","node_modules",".DS_Store","Thumbs.db","*.pem","*.key",".env.local",".env.development",".env.production",".env.test"],g={MAX_ITEMS_PER_DIR:500,MAX_DEPTH:10,MAX_FILE_SIZE_PREVIEW:1048576};function h(a,b){if(b===a)return!0;if(b.startsWith("*.")){let c=b.slice(1);if(a.endsWith(c))return!0}if(b.endsWith(".*")){let c=b.slice(0,-2);if(a.startsWith(c+"."))return!0}return!1}function i(a){return f.some(b=>h(a,b))}async function j(a){try{return(await (0,d.readdir)(a)).filter(a=>!i(a)).length}catch{return 0}}async function k(a,b=""){let c,f=b?(0,e.join)(a,b):a;try{c=await (0,d.stat)(f)}catch{throw Error(`Directory not found: ${b||"(root)"}`)}if(!c.isDirectory())throw Error(`Path is not a directory: ${b}`);let h=await (0,d.readdir)(f),l=[];for(let a of h){if(i(a))continue;let b=(0,e.join)(f,a);try{let c=await (0,d.lstat)(b);if(c.isSymbolicLink())continue;if(c.isDirectory()){let c=await j(b);l.push({name:a,type:"directory",itemCount:c})}else if(c.isFile()){let b=(0,e.extname)(a),d={name:a,type:"file",size:c.size,birthtime:c.birthtime.toISOString(),mtime:c.mtime.toISOString()};b&&b.length>1&&(d.extension=b.slice(1)),l.push(d)}}catch{continue}if(l.length>=g.MAX_ITEMS_PER_DIR)break}let m=[...l].sort((a,b)=>a.type!==b.type?"directory"===a.type?-1:1:a.name.toLowerCase().localeCompare(b.name.toLowerCase())),n=null;if(b){let a=(0,e.dirname)(b);n="."===a?"":a}return{path:b,name:b?(0,e.basename)(b):"",items:m,parentPath:n}}function l(a){let b=a instanceof Error?a.message:"Unknown error";return b.includes("not found")?{error:"Directory not found",status:404}:b.includes("not a directory")?{error:"Path is not a directory",status:400}:{error:"Failed to read directory",status:500}}function m(a){return{error:`Worktree '${a}' not found`,status:404}}function n(a="Invalid path"){return{error:`Access denied: ${a}`,status:403}}},95736:(a,b,c)=>{a.exports=c(44870)}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=
|
|
1
|
+
"use strict";exports.id=5630,exports.ids=[5630],exports.modules={2669:(a,b,c)=>{c.d(b,{JI:()=>n,M7:()=>d,Sr:()=>h,Zf:()=>f,c7:()=>e,lU:()=>k,mR:()=>j,qO:()=>i,su:()=>m,wQ:()=>l});let d="SESSION_STARTING",e="SESSION_START_FAILED",f="SESSION_START_UNAVAILABLE",g=[d,e];class h extends Error{constructor(a,b,c){super(`${a} did not reach its input prompt within ${Math.round(c/1e3)}s (initialization timeout). The tmux session '${b}' and its process are still running, so this is a slow start, not a failed one — the message was not delivered, but nothing needs repairing. Retry the send in a few seconds, or run \`commandmate capture <worktree-id>\` to see what it is waiting on.`),this.toolName=a,this.sessionName=b,this.timeoutMs=c,this.code=d,this.name="SessionStartTimeoutError"}}function i(a,b){return`${a} exited before reaching its input prompt: the tmux session '${b}' is back at a shell, so this is not a slow start and waiting will not help. The message was not delivered. Run \`commandmate capture <worktree-id>\` to see why it exited (for example a startup dialog answered with exit, or a missing login), fix that, then send again.`}class j extends Error{constructor(a,b,c){super(`${a} reported an error while starting in tmux session '${b}': "${c}". Retrying will not help until that is resolved; run \`commandmate capture <worktree-id>\` to see the session output.`),this.toolName=a,this.sessionName=b,this.detectedPattern=c,this.code=e,this.name="SessionStartFailedError"}}class k extends Error{constructor(a,b=`${a} is not installed. Please install it first.`){super(b),this.toolName=a,this.code=f,this.name="SessionStartUnavailableError"}}function l(a){return o(a)===d}function m(a){let b=o(a);return void 0!==b&&g.includes(b)}function n(a){return o(a)===f}function o(a){if("object"!=typeof a||null===a)return;let b=a.code;return"string"==typeof b?b:void 0}},22354:(a,b,c)=>{c.d(b,{F0:()=>j.F,K9:()=>e.K9,VM:()=>d.VM,_0:()=>f._0,c1:()=>k.c,o:()=>i.o,vm:()=>h.v,y_:()=>g.y_});var d=c(70096);c(66101);var e=c(45567);c(57510),c(38367);var f=c(25071),g=c(50474),h=c(70997),i=c(77904),j=c(76835),k=c(2734)},50474:(a,b,c)=>{c.d(b,{y_:()=>d});function d(a){var b=a.noDecision;switch(b.kind){case"proceeds":return{safe:!0,blocksForMs:0,summary:"the agent continues with its own approval flow"};case"blocks":return{safe:!1,blocksForMs:null,summary:"the agent waits indefinitely; nothing else will unblock it"};case"blocksUntil":return{safe:!1,blocksForMs:b.timeoutMs,summary:`the agent waits up to ${b.timeoutMs}ms before continuing`}}}},73495:(a,b,c)=>{c.d(b,{Me:()=>h});let d="don['’]t",e=["deny",/^No(?:,|$)/],f={claude:[["allow-once",/^Yes$/],["allow-persistent",/^Yes, and always allow\b/],["mode-change",/^Yes, allow all edits\b/],["mode-change",/^Yes, and switch to\b/],e],codex:[["allow-once",/^Yes$/],["allow-once",/^Yes, proceed\b/],["allow-once",/^Allow(?:\s{2,}|$)/],["allow-persistent",RegExp(`^Yes, and ${d} ask again\\b`)],["allow-persistent",/^Always allow\b/],["mode-change",/^Ask for approval\b/],["mode-change",/^Approve for me\b/],["mode-change",/^Full Access\b/],["deny",/^Cancel\b/],e],antigravity:[["allow-once",/^Yes$/],["allow-once",/^Yes, run command$/],["allow-once",/^Yes, allow creation$/],["allow-persistent",/^Yes, and always allow\b/],e],"command-code":[["allow-once",/^Yes$/],["allow-persistent",RegExp(`^Yes, ${d} ask again\\b`)],["mode-change",/^Yes, allow all edits\b/],e],copilot:[["allow-once",/^Yes$/],["allow-persistent",RegExp(`^Yes, and ${d} ask again\\b`)],["mode-change",/^Manual\b/],["mode-change",/^Allow all\b/],e]},g=Object.values(f).flat();function h(a,b){let c=void 0===b?g:f[b]??null;if(null===c)return{kind:"not-a-permission-dialog"};let d=a.map(a=>(function(a,b){let c=b.trim();for(let[b,d]of a)if(d.test(c))return b;return"unknown"})(c,a.label));if(!d.some(a=>"allow-once"===a||"allow-persistent"===a||"mode-change"===a))return{kind:"not-a-permission-dialog"};let e=a.filter((a,b)=>"allow-once"===d[b]);return 1===e.length?{kind:"allow-once",option:e[0]}:{kind:"unidentified",allowOnceCount:e.length}}Object.keys(f)}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=5775,exports.ids=[2839,5220,5775],exports.modules={20029:(a,b,c)=>{c.d(b,{C7:()=>r,KF:()=>n,Nq:()=>p,cu:()=>l,m4:()=>s,zE:()=>m});var d=c(55511),e=c(36925),f=c(72626),g=c(2669),h=c(7321);let i=(0,f.h)("session/send-attempt-state"),j=(0,e.v)("__sendAttemptRecords",()=>new Map);function k(a){return JSON.stringify([a.worktreeId,a.cliToolId,a.instanceId])}function l(a){return(0,d.createHash)("sha256").update(a,"utf8").digest("hex").slice(0,16)}function m(a,b,c=Date.now()){try{let d=k(a);for(j.delete(d),j.set(d,{at:Math.floor(c),state:b.state,reason:b.reason,messageDigest:l(b.content)});j.size>1024;){let a=j.keys().next().value;if(void 0===a)break;j.delete(a)}}catch(a){i.warn("send-attempt-record-failed",{error:a instanceof Error?a.message:String(a)})}}function n(a){return j.get(k(a))??null}let o=/Command failed: tmux |Failed to send (?:special )?keys? to tmux session|Failed to send special key:|Failed to paste message into tmux session/;function p(a){if("object"==typeof a&&null!==a&&a.code===g.M7)return{state:"not-sent",reason:"session-starting"};if("object"==typeof a&&null!==a&&a.code===h.Le)return{state:"not-sent",reason:"plan-review"};let b=a instanceof Error?a.message:String(a);return/Enter was not pressed, so nothing was submitted/.test(b)?{state:"indeterminate",reason:"body-not-landed"}:/replaced by a TUI autocompletion/.test(b)?{state:"indeterminate",reason:"replaced-by-completion"}:/submit could not be confirmed/i.test(b)?{state:"indeterminate",reason:"submit-unconfirmed"}:/Could not re-read session \S+ before typing \(.*\); nothing was typed \(Issue #3945\)/s.test(b)?{state:"not-sent",reason:"recheck-failed"}:o.test(b)?{state:"indeterminate",reason:"send-error"}:/prompt not ready/i.test(b)?{state:"not-sent",reason:"prompt-not-ready"}:/input lock not acquired, nothing was typed/.test(b)?/was replaced while this send waited/.test(b)?{state:"not-sent",reason:"session-replaced"}:{state:"not-sent",reason:"input-lock-timeout"}:/\(re-checked under the input lock\); nothing was typed/.test(b)?{state:"not-sent",reason:"prompt-waiting"}:/input lock lost, nothing was typed/.test(b)?{state:"not-sent",reason:"input-lock-lost"}:/still holds unsent text after \d+ clear passes/.test(b)?{state:"not-sent",reason:"composer-not-empty"}:{state:"indeterminate",reason:"send-error"}}function q(a){return a.replace(/\s+/g,"")}function r(a,b){let c=q(b.split("\n").find(a=>""!==a.trim())??"").slice(0,32);return""!==c&&q(a).includes(c)}function s(a){return"not-sent"===a.state?`[send state: not-sent (${a.reason}): the message was not typed. CommandMate does not resend it; send it again once the input prompt is back (\`commandmate prompt <worktree-id> --json\` shows the screen and lastSend).]`:"indeterminate"===a.state?`[send state: indeterminate (${a.reason}): part of the message may have been typed or submitted. CommandMate does not resend it; do not resend before checking the pane (\`commandmate capture <worktree-id> --pane\`), or it may arrive twice.]`:`[send state: sent (${a.reason})]`}},39687:(a,b,c)=>{c.d(b,{d:()=>A});var d=c(56791),e=c(8360),f=c(15194),g=c(95220),h=c(12462),i=c(43015),j=c(54325),k=c(72626),l=c(34331),m=c(40964),n=c(58707),o=c(2669),p=c(31990),q=c(20029),r=c(7321),s=c(94154),t=c(34405),u=c(49973),v=c(49319);let w=(0,k.h)("session/send-user-message");function x(a){return a instanceof Error?a.message:String(a)}async function y(a,b){let c=`${a}:${b}`,d=Date.now()+5e3;for(;(0,g.getActivePollers)().includes(c);){if(Date.now()>=d)return!1;await new Promise(a=>setTimeout(a,100))}return!0}async function z(a,b,c,d){if(!s.wn.has(b))return!1;try{let e=await (0,p.WD)(a,b,t._,c),f=(0,s.ji)(e,b);return"content"===f.state&&(0,q.C7)(f.text,d)}catch(a){return w.warn("send-composer-residue-read-failed",{error:x(a)}),!1}}async function A(a,b){let{worktreeId:c,content:k,cliToolId:p,instanceId:t,absoluteImagePath:A,copilotModel:B}=b,C=b.messageType??"normal",D=t??p,E=e.CLIToolManager.getInstance().getTool(p),F=(a,d)=>{(0,q.zE)({worktreeId:c,cliToolId:p,instanceId:D},{state:a,reason:d,content:k}),b.onAttempt?.({state:a,reason:d})},G=(0,m.mf)(p,c,t),H=await (0,l.L)(c,G,a);if(null===H||"foreign"===H.verdict)return F("not-sent","foreign-session"),w.warn("send-refused-foreign-session",{worktreeId:c,cliToolId:p,instanceId:D,sessionName:G,sessionPath:H?.sessionPath??null,reason:H?"foreign":"worktree_not_found"}),{ok:!1,stage:"foreign_session",error:H?`tmux session "${G}" belongs to another CommandMate server`:`Worktree '${c}' not found; cannot confirm tmux session "${G}" is this server's`};let I=await (0,n.a3)(c,p,t,{ignoreStructured:b.ignoreStructuredPromptGuard});if(I.waiting)return F("not-sent","prompt-waiting"),w.info("send-refused-prompt-waiting",{worktreeId:c,cliToolId:p,reason:I.reason,blockedBy:I.blockedBy}),{ok:!1,stage:"prompt_waiting",error:(0,n.br)(c,I.blockedBy)};if(B&&"copilot"===p){try{await E.sendModelCommand(c,B,t),w.info("copilot-model-command-sent",{model:B})}catch(b){w.error("failed-to-send-model-command:",{error:x(b)});let a=b?.code;if(a===r.a9)return F("not-sent","prompt-waiting"),{ok:!1,stage:"prompt_waiting",error:(0,n.br)(c)};return F("not-sent",a===r.$_?"recheck-failed":"model-switch-failed"),{ok:!1,stage:"model",error:x(b)}}await y(c,D)||w.warn("previous-turn-poller-still-running",{worktreeId:c,instanceId:D,waitedMs:5e3})}let J=new Date;try{await (0,h.o4)(a,c,p,J,t)}catch(a){w.error("failed-to-save-pending-assistant-response:",{error:x(a)})}let K=null;try{let b=(0,d.getMessages)(a,c,{limit:1,cliToolId:p,instanceId:D,matchResolvedInstance:!0});b.length>0&&"user"===b[0].role&&b[0].content===k&&(K=b[0].id)}catch(a){w.error("failed-to-detect-orphaned-messages:",{error:x(a)})}async function L(){try{let{inputStartedAt:a}=await (0,u.x1)(M,b.onInputStart,b.inputBoundary);return{sent:!0,inputStartedAt:a}}catch(b){if(w.error("failed-to-send-message-to:",{error:x(b)}),(0,u.fi)(b))return{error:b,failure:{state:"not-sent",reason:"relay-reservation-lost"}};let a=(0,q.Nq)(b);return"submit-unconfirmed"===a.reason&&await z(c,p,t,k)&&(a={state:"indeterminate",reason:"composer-residue"}),{error:b,failure:a}}}async function M(){A?(0,f._J)(E)?await E.sendMessageWithImage(c,k,A,t):await E.sendMessage(c,(0,v.TZ)(k,A),t):await E.sendMessage(c,k,t)}let N=s.wn.has(p)?await (0,u.hC)(G,()=>L()).catch(a=>({error:a,failure:(0,q.Nq)(a)})):await L();if(!("sent"in N)){let{error:a,failure:b}=N;return(F(b.state,b.reason),"prompt-waiting"===b.reason)?{ok:!1,stage:"prompt_waiting",error:(0,n.br)(c)}:(0,o.wQ)(a)?{ok:!1,stage:"send",error:a.message,code:o.M7}:{ok:!1,stage:"send",error:x(a)}}F("sent","submitted");let O=N.inputStartedAt,P=null!==O&&O.getTime()>J.getTime()?O:J,Q=(0,d.createMessage)(a,{worktreeId:c,role:"user",content:k,messageType:C,timestamp:P,cliToolId:p,instanceId:t,requestId:b.requestId});try{(0,i.broadcastMessage)("message",{worktreeId:c,message:{...Q,cliToolId:p,instanceId:D}})}catch(a){w.warn("user-message-broadcast-failed",{error:x(a)})}if(K)try{if((0,d.deleteMessageById)(a,K)){w.info("cleaned-up-orphaned-user");try{(0,i.broadcastMessage)(j.dz,{worktreeId:c,cliToolId:p,instanceId:D,reason:"orphan_cleanup"})}catch(a){w.warn("orphan-cleanup-broadcast-failed",{error:x(a)})}}}catch(a){w.error("failed-to-clean-up-orphaned-message:",{error:x(a)})}return(0,d.updateLastUserMessage)(a,c,k,P),(0,d.clearInProgressMessageId)(a,c,p,t),w.info("cleared-in-progress-message"),(0,g.startPolling)(c,p,t),{ok:!0,message:Q}}},58707:(a,b,c)=>{c.d(b,{$n:()=>k,a3:()=>l,br:()=>m});var d=c(8360),e=c(31990),f=c(95595),g=c(34405),h=c(72626),i=c(30008);let j=(0,h.h)("prompt-waiting-guard"),k="PROMPT_WAITING";async function l(a,b,c,h){try{let k=d.CLIToolManager.getInstance().getTool(b);if(!await k.isRunning(a,c))return{waiting:!1};let l=await (0,e.Wh)(a,b,g._,c),m=(0,f.WC)(l,b),n=(0,i._G)({worktreeId:a,cliToolId:b,instanceId:c,scraper:{status:m.status,reason:m.reason,hasActivePrompt:m.hasActivePrompt},ignoreStructured:h?.ignoreStructured});if(!n.blocksSend)return null!==n.structuredSendBlockSuppressed&&j.info("structured-send-guard-not-applied",{worktreeId:a,cliToolId:b,instanceId:c,suppressed:n.structuredSendBlockSuppressed,promptWaitingSince:n.structured?.at??null}),{waiting:!1};return{waiting:!0,reason:n.blockReason??void 0,blockedBy:n.blockedBy??void 0}}catch(c){return j.warn("prompt-waiting-check-failed",{worktreeId:a,cliToolId:b,error:c instanceof Error?c.message:String(c)}),{waiting:!1}}}function m(a,b){let c=`${a} is waiting on a prompt. Sending now would type into the prompt's input line instead of reaching the agent, and would leave that text in place for the next answer. Answer the prompt first: \`commandmate respond ${a} <answer>\`.`;if("structured"!==b)return c;let d=Math.round(i.j0/6e4);return`${c} This dialog was reported by the agent's own hooks and is not visible to the terminal scraper, so if the pane looks idle the record has outlived its dialog: it stops blocking sends ${d} minutes after it was reported, or immediately with \`commandmate send ${a} <message> --ignore-structured-prompt\` (server-wide: ${i.F1}=off).`}},85775:(a,b,c)=>{c.d(b,{Tm:()=>p,x4:()=>n,xJ:()=>o});var d=c(34129),e=c(8360),f=c(88807),g=c(72626),h=c(87374),i=c(39687),j=c(36925);let k=(0,g.h)("timer-manager");function l(){return(0,j.v)("__timerManagerState",()=>({timers:new Map,timerWorktrees:new Map,initialized:!1}))}async function m(a){let b=l(),c=(0,f.getDbInstance)();try{let b=(0,d.kx)(c,a);if(!b||"pending"!==b.status)return;let f=e.CLIToolManager.getInstance().getTool(b.cliToolId),g=b.instanceId,j=await f.isRunning(b.worktreeId,g),l=(0,d.kx)(c,a);if(!l||"pending"!==l.status)return;if(!j){k.warn("timer:no-session",{timerId:a,worktreeId:b.worktreeId,instanceId:g}),(0,d.j2)(c,a,h.HR.NO_SESSION);return}(0,d.j2)(c,a,"sending");let m=await (0,i.d)(c,{worktreeId:b.worktreeId,content:b.message,cliToolId:b.cliToolId,instanceId:g});if(!m.ok){let b=`[${m.stage}] ${m.error}`;(0,d.j2)(c,a,"failed",void 0,b),k.error("timer:send-failed",{timerId:a,stage:m.stage,error:m.error});return}(0,d.j2)(c,a,"sent",Date.now()),k.info("timer:sent",{timerId:a,worktreeId:b.worktreeId})}catch(e){let b=e instanceof Error?e.message:String(e);try{(0,d.j2)(c,a,"failed",void 0,b)}catch{}k.error("timer:send-failed",{timerId:a,error:b})}finally{b.timers.delete(a),b.timerWorktrees.delete(a)}}function n(a,b,c){let d=l(),e=setTimeout(()=>{m(a)},c);d.timers.set(a,e),d.timerWorktrees.set(a,b)}function o(a){let b=l(),c=b.timers.get(a);c&&(clearTimeout(c),b.timers.delete(a),b.timerWorktrees.delete(a));let e=(0,f.getDbInstance)();(0,d.Ud)(e,a)}function p(a){let b=l(),c=(0,f.getDbInstance)();for(let[c,d]of b.timerWorktrees)if(d===a){let a=b.timers.get(c);a&&clearTimeout(a),b.timers.delete(c),b.timerWorktrees.delete(c)}(0,d.$$)(c,a)}},95220:(a,b,c)=>{c.r(b),c.d(b,{accumulateTuiContent:()=>g.IZ,cleanClaudeResponse:()=>f.NN,cleanCopilotResponse:()=>f.LH,cleanGeminiResponse:()=>f.IS,cleanOpenCodeResponse:()=>f.aW,clearPromptHashCache:()=>h.iX,clearTuiAccumulator:()=>g.q1,extractCopilotContentLines:()=>g.o0,extractTuiContentLines:()=>g.K0,findOverlapIndex:()=>g.vQ,getAccumulatedContent:()=>g.Uz,getActivePollers:()=>d.KQ,initTuiAccumulator:()=>g.tb,isDuplicatePrompt:()=>h.gv,isOpenCodeComplete:()=>e.bE,migrateResponsePollerWorktreeIds:()=>d.sR,normalizeCopilotLine:()=>g.IW,normalizePromptForDedup:()=>h.zm,renamePromptHashCacheKey:()=>h.i2,resolveExtractionStartIndex:()=>e.QM,startPolling:()=>d.g8,stopAllPolling:()=>d.fq,stopPolling:()=>d.Et,truncateMessage:()=>f.Sj});var d=c(45146),e=c(60),f=c(82450),g=c(13033),h=c(72457)}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=610,exports.ids=[610,6119],exports.modules={4803:(a,b,c)=>{c.d(b,{H2:()=>i,eM:()=>f,kN:()=>e,tP:()=>l});let d=/^\[[ xX\u2714]\] /;function e(a){return a.some(a=>d.test(a.label))}function f(a){return!0===a.multiSelect||e(a.options)}let g=/^yes\b/i,h=[/^no\b/i,/\bdeny\b/i];class i extends Error{constructor(a){super(a),this.name="PromptAnswerResolutionError"}}function j(a){return h.some(b=>b.test(a))}function k(a){return g.test(a)&&!j(a)}function l(a){let{answer:b,useDefault:c,promptData:d,fallbackPromptType:e}=a;if(c){if(d?.type==="multiple_choice"){if(f(d))throw new i('Multi-select (checkbox) prompts have no default answer: the cursor marks the row a key would toggle, not a choice. Answer with the option numbers you want ticked, comma-separated (for example "1,3").');let a=function(a){let b=a.find(a=>a.isDefault)??a.find(a=>1===a.number)??a[0];if(!b)throw new i("The prompt has no options to select a default from.");return b}(d.options);return{input:String(a.number),resolved:{via:"default",optionNumber:a.number,optionLabel:a.label}}}if(d?.type==="yes_no"){if(d.defaultOption)return{input:d.defaultOption,resolved:{via:"default",optionLabel:d.defaultOption}};throw new i("The yes/no prompt declares no default option.")}throw new i("Cannot select the default option: no active prompt was detected.")}let g=b??"",h=function(a){let b=a.trim().toLowerCase();return"yes"===b||"y"===b?"yes":"no"===b||"n"===b?"no":null}(g);if(null===h)return{input:g};if(d?.type==="multiple_choice"){let a=function(a,b){let c=a.options;if(f(a))throw new i('Multi-select (checkbox) prompts cannot be answered with yes/no. Answer with the option numbers you want ticked, comma-separated (for example "1,3").');let d="yes"===b?k:j,e=c.filter(a=>d(a.label));if(0===e.length)throw new i(`No option label matches "${b}". Answer with an option number.`);return e.reduce((a,b)=>a.number<=b.number?a:b)}(d,h);return{input:String(a.number),resolved:{via:"semantic",optionNumber:a.number,optionLabel:a.label}}}if(!d&&"multiple_choice"===e)throw new i("Cannot resolve yes/no: the prompt is multiple choice but its options could not be read.");return{input:g}}},15388:(a,b,c)=>{c.d(b,{RJ:()=>f,SQ:()=>g});var d=c(24455);let e=(0,c(36925).v)("__toolInputNormalizations",()=>new Map);function f(a,b,c,g,h,i=Date.now()){e.set((0,d.v7)(a,b,c),{...g,toolName:h,at:i})}function g(a,b,c){return e.get((0,d.v7)(a,b,c))??null}},27354:(a,b,c)=>{c.d(b,{PF:()=>d,PP:()=>k,S6:()=>n,UT:()=>m,Yy:()=>l,dr:()=>e,eS:()=>i,lO:()=>h,m0:()=>g,uZ:()=>f});let d=new Set(["mode-off","deny-pattern","deny-pattern-unusable","type-not-allowed","policy-lookup-failed","allow-once-unidentified","recommended-option-unidentified"]),e="policy-lookup-failed",f="partial-answer",g="startup-trust-unhandled",h="question-confirm-page",i="question-left-to-human",j=new Set(["allow-once-unidentified","recommended-option-unidentified"]);function k(a){return j.has(a)}let l="allow-once-unidentified",m="recommended-option-unidentified",n="no-hook-receipt"},31517:(a,b,c)=>{c.d(b,{DL:()=>j,sD:()=>f});var d=c(2734);let e=(0,c(72626).h)("lib/hooks/stop-history-capture"),f=[150,500,2e3,5e3],g=new Set([d.c]);function h(a){return new Promise(b=>{setTimeout(b,a)})}async function i(a,b,c,d,f,g){let i=Date.now();try{for(let[j,k]of g.entries()){await h(k);let l={};if(await a.captureStructuredHistoryTurn(b.id,c,d,f,l))return e.info("stop-history-capture-deferred-captured",{worktreeId:b.id,cliToolId:c,instanceId:d,attempt:j+1,attempts:g.length,elapsedMs:Date.now()-i}),!0;e.debug("stop-history-capture-deferred-open",{worktreeId:b.id,cliToolId:c,instanceId:d,attempt:j+1,attempts:g.length,outcome:l.outcome??"unavailable",elapsedMs:Date.now()-i})}return e.info("stop-history-capture-deferred-exhausted",{worktreeId:b.id,cliToolId:c,instanceId:d,attempts:g.length,elapsedMs:Date.now()-i}),!1}catch(a){return e.warn("stop-history-capture-deferred-failed",{worktreeId:b.id,cliToolId:c,instanceId:d,error:a instanceof Error?a.message:String(a)}),!1}}async function j(a,b,d,k={}){try{let j=await Promise.all([c.e(1503),c.e(8791),c.e(1719),c.e(2119),c.e(2445),c.e(252),c.e(8800),c.e(7905),c.e(255),c.e(9731),c.e(8728),c.e(8918)]).then(c.bind(c,28918));if(!j.isPullTranscriptHistory(b))return{status:"unavailable"};let l={worktreePath:a.path,transcriptPathHint:null},m={};if(await j.captureStructuredHistoryTurn(a.id,b,d,l,m))return{status:"captured"};let n=()=>"not_yet_closed"===m.outcome?Promise.resolve(!0):j.hasStructuredHistoryTranscript(a.id,b,d,l);if(g.has(b)){let c=k.deferredDelaysMs??f;if(0===c.length||!await n())return{status:"unavailable"};let g=i(j,a,b,d,l,c);return e.info("stop-history-capture-deferred",{worktreeId:a.id,cliToolId:b,instanceId:d,delaysMs:c}),{status:"deferred",deferred:g}}let o=k.retryDelayMs??500;if(o<=0||!await n())return{status:"unavailable"};let p=Math.max(1,k.maxAttempts??3);for(let c=2;c<=p;c+=1){await h(o);let f={},g=await j.captureStructuredHistoryTurn(a.id,b,d,l,f);if(e.debug("stop-history-capture-retried",{worktreeId:a.id,cliToolId:b,instanceId:d,attempt:c,maxAttempts:p,captured:g,outcome:f.outcome??"unavailable"}),g)return{status:"captured"}}return{status:"unavailable"}}catch(c){return e.warn("stop-history-capture-failed",{worktreeId:a.id,cliToolId:b,instanceId:d,error:c instanceof Error?c.message:String(c)}),{status:"unavailable"}}}},48736:(a,b,c)=>{c.d(b,{cV:()=>h,Tb:()=>k,Lj:()=>l,Bz:()=>i,_1:()=>j,sD:()=>m});var d=c(2232),e=c(27354),f=c(4803),g=c(73495);let h=Object.freeze({lookupFailed:!0});function i(a){return null!=a&&"lookupFailed"in a&&!0===a.lookupFailed}function j(a){return a&&!i(a)?a.mode:null}let k=2e4;function l(a,b,c,f=!1){if(!c)return null;if(i(c))return{reason:e.dr};if("off"===c.mode)return{reason:"mode-off"};let g=function(a,b){if(0===b.length)return{outcome:"no-match"};let c=a.some(a=>a.length>k),e=a.map(a=>a.length>k?a.slice(0,k):a);for(let a of b){if(a.length>200||!(0,d.P0)(a).valid)return{outcome:"unusable",pattern:a};let b=new RegExp(a);for(let c of e){let e=(0,d.eJ)(b,c);if(null===e)return{outcome:"unusable",pattern:a};if(e)return{outcome:"match",pattern:a}}}return c?{outcome:"unusable"}:{outcome:"no-match"}}(b,c.denyPatterns);return"match"===g.outcome?{reason:"deny-pattern",pattern:g.pattern}:"unusable"===g.outcome?{reason:"deny-pattern-unusable",pattern:g.pattern}:f&&c.denyPatterns.length>0?{reason:"deny-pattern-unusable"}:"safe"===c.mode?"yes_no"===a?null:{reason:"type-not-allowed"}:"allow-listed"===c.mode?c.allowPromptTypes.includes(a)?null:{reason:"type-not-allowed"}:null}function m(a,b,c,d){let{answer:h,withheldBy:i}=function(a,b,c){if("yes_no"===a.type)return{answer:"y"};if("multiple_choice"===a.type){if(void 0!==c&&"not-a-permission-dialog"===(0,g.Me)(a.options,b).kind){let b=function(a,b,c){if(c)return{kind:"unidentified",cause:"multi-select"};if(0===a.length)return{kind:"unidentified",cause:"no-options"};if(void 0===b||b.length!==a.length||b.some(a=>"unknown"===a))return{kind:"unidentified",cause:"unknown-title"};let d=a.filter((a,c)=>!0===b[c]);if(d.length>1)return{kind:"unidentified",cause:"several-recommended"};let[e,f]=1===d.length?[d[0],"recommended"]:[a.find(a=>a.isDefault)??a[0],"default"];return e.requiresTextInput?{kind:"unidentified",cause:"typed-text"}:{kind:"chosen",option:e,basis:f}}(a.options,c.optionRecommendations,(0,f.eM)(a));return"chosen"===b.kind?{answer:b.option.number.toString()}:{answer:null,withheldBy:e.UT}}if((0,f.eM)(a))return{answer:null};let d=(0,g.Me)(a.options,b);if("unidentified"===d.kind)return{answer:null,withheldBy:e.Yy};let h="allow-once"===d.kind?d.option:a.options.find(a=>a.isDefault)??a.options[0];return!h||h.requiresTextInput?{answer:null}:{answer:h.number.toString()}}return{answer:null}}(a,c,d);if(i)return{answer:null,suppressedBy:i};if(null===h)return{answer:null,suppressedBy:null};let j=l(a.type,function(a){let b=[a.question];if(a.approvalTarget&&b.push(a.approvalTarget),"multiple_choice"===a.type)for(let c of a.options)b.push(c.label);else b.push(...a.options);return b}(a),b,void 0!==a.approvalTargetCompleteness);return j?{answer:null,suppressedBy:j.reason,pattern:j.pattern}:{answer:h,suppressedBy:null}}},52767:(a,b,c)=>{c.d(b,{r:()=>i,g:()=>h});var d=c(48524),e=c(87009),f=c(72626);let g=(0,f.h)("lib/tasks/task-transition-service");function h(a,b,c,f){let h=a.transaction(()=>{let g=(0,d.gg)(a,b);if(!g)return null;let h=g.status,i=function(a,b){switch(a){case"pending":switch(b){case"message_sent":return"running";case"send_failed":case"cancel":return"cancelled";default:return null}case"running":switch(b){case"prompt_detected":return"waiting_input";case"agent_idle":return"running";case"verify_started":return"verifying";case"send_failed":return"failed";case"cancel":return"cancelled";default:return null}case"waiting_input":switch(b){case"prompt_answered_auto":case"prompt_answered_human":case"agent_idle":return"running";case"verify_started":return"verifying";case"cancel":return"cancelled";default:return null}case"verifying":switch(b){case"verify_passed":return"succeeded";case"verify_failed":return"failed";case"verify_not_started":return"not_started";case"cancel":return"cancelled";default:return null}case"failed":case"not_started":switch(b){case"message_sent":return"running";case"verify_started":return"verifying";case"cancel":return"cancelled";default:return null}default:return null}}(h,c),j=Date.now(),k=(0,e.P)(a,{taskId:b,event:c,fromStatus:h,toStatus:i,payload:f,createdAt:j});return null===i?{task:g,fromStatus:h,toStatus:null,eventId:k}:{task:(0,d.xZ)(a,b,i,f?.runId===void 0?{}:{lastVerificationRunId:f.runId}),fromStatus:h,toStatus:i,eventId:k}})();return null===h?g.warn("task-event-unknown-task",{taskId:b,event:c}):null===h.toStatus&&g.warn("task-event-rejected",{taskId:b,event:c,fromStatus:h.fromStatus}),h}function i(a,b,c,e,f,i){try{let g=(0,d.MH)(a,b,c,e);if(!g)return null;return h(a,g.id,f,i)}catch(a){return g.warn("task-event-failed",{worktreeId:b,cliToolId:c,instanceId:e,event:f,error:a instanceof Error?a.message:String(a)}),null}}},77244:(a,b,c)=>{c.d(b,{FD:()=>i,Wo:()=>f,fA:()=>h,nB:()=>k,nh:()=>j});var d=c(24455),e=c(36925);let f=8e3,g=(0,e.v)("__antigravityPermissionReceipts",()=>new Map);function h(a,b,c,e,f=Date.now(),i=null){if(null!==e){for(let[a,b]of g)f-b.at>36e5&&g.delete(a);g.set((0,d.v7)(a,b,c),{toolName:e,at:f,callId:i})}}function i(a,b,c,e,h=Date.now()){let j=g.get((0,d.v7)(a,b,c));return!!j&&(void 0===e||j.toolName===e)&&h-j.at<=f}function j(a,b,c){return g.get((0,d.v7)(a,b,c))?.at??null}function k(a,b,c){return g.get((0,d.v7)(a,b,c))?.callId??null}(0,e.v)("__antigravityReceiptObservations",()=>new Map)},91318:(a,b,c)=>{c.d(b,{Fv:()=>o,JJ:()=>m,d8:()=>l,ie:()=>q,n:()=>k,wO:()=>n});var d=c(56791),e=c(88807),f=c(24455),g=c(72626),h=c(48736);let i=(0,g.h)("auto-yes-policy"),j=new Map;function k(a,b,c,d){return p(a,b,c,d?.fresh===!0).policy}function l(a,b,c){let{policy:d,taskId:e}=p(a,b,c);return(0,h.Bz)(d)?{policy:null,taskId:null}:{policy:d,taskId:e}}function m(a,b,c){let{policy:d,taskId:e}=p(a,b,c);return{policy:d,taskId:e}}function n(a,b,c){var d;return d=l(a,b,c).policy,d?.mode==="off"}function o(a,b,c){let{policy:d,taskId:e}=l(a,b,c);return d?{taskId:e,mode:d.mode,allowPromptTypes:d.allowPromptTypes,denyPatternCount:d.denyPatterns.length}:null}function p(a,b,c,g=!1){let k=c??b,l=(0,f.v7)(a,b,k),m=Date.now(),n=j.get(l);if(!g&&n&&n.expiresAt>m)return n;let{policy:o,taskId:q}=function(a,b,c){try{let f=(0,d.getActiveTaskForInstance)((0,e.getDbInstance)(),a,b,c);if(!f)return{policy:null,taskId:null};return{policy:f.contract.autoYes,taskId:f.id}}catch(d){return i.warn("policy-lookup-failed",{worktreeId:a,cliToolId:b,instanceId:c,error:d instanceof Error?d.message:String(d)}),{policy:h.cV,taskId:null}}}(a,b,k);if((0,h.Bz)(o))return g&&j.delete(l),{policy:o,taskId:q,expiresAt:m};j.size>=200&&function(a){for(let[b,c]of j.entries())c.expiresAt<=a&&j.delete(b)}(m);let r={policy:o,taskId:q,expiresAt:m+5e3};return j.set(l,r),r}function q(a){j.delete(a)}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=6119,exports.ids=[6119],exports.modules={4803:(a,b,c)=>{c.d(b,{H2:()=>i,eM:()=>f,kN:()=>e,tP:()=>l});let d=/^\[[ xX\u2714]\] /;function e(a){return a.some(a=>d.test(a.label))}function f(a){return!0===a.multiSelect||e(a.options)}let g=/^yes\b/i,h=[/^no\b/i,/\bdeny\b/i];class i extends Error{constructor(a){super(a),this.name="PromptAnswerResolutionError"}}function j(a){return h.some(b=>b.test(a))}function k(a){return g.test(a)&&!j(a)}function l(a){let{answer:b,useDefault:c,promptData:d,fallbackPromptType:e}=a;if(c){if(d?.type==="multiple_choice"){if(f(d))throw new i('Multi-select (checkbox) prompts have no default answer: the cursor marks the row a key would toggle, not a choice. Answer with the option numbers you want ticked, comma-separated (for example "1,3").');let a=function(a){let b=a.find(a=>a.isDefault)??a.find(a=>1===a.number)??a[0];if(!b)throw new i("The prompt has no options to select a default from.");return b}(d.options);return{input:String(a.number),resolved:{via:"default",optionNumber:a.number,optionLabel:a.label}}}if(d?.type==="yes_no"){if(d.defaultOption)return{input:d.defaultOption,resolved:{via:"default",optionLabel:d.defaultOption}};throw new i("The yes/no prompt declares no default option.")}throw new i("Cannot select the default option: no active prompt was detected.")}let g=b??"",h=function(a){let b=a.trim().toLowerCase();return"yes"===b||"y"===b?"yes":"no"===b||"n"===b?"no":null}(g);if(null===h)return{input:g};if(d?.type==="multiple_choice"){let a=function(a,b){let c=a.options;if(f(a))throw new i('Multi-select (checkbox) prompts cannot be answered with yes/no. Answer with the option numbers you want ticked, comma-separated (for example "1,3").');let d="yes"===b?k:j,e=c.filter(a=>d(a.label));if(0===e.length)throw new i(`No option label matches "${b}". Answer with an option number.`);return e.reduce((a,b)=>a.number<=b.number?a:b)}(d,h);return{input:String(a.number),resolved:{via:"semantic",optionNumber:a.number,optionLabel:a.label}}}if(!d&&"multiple_choice"===e)throw new i("Cannot resolve yes/no: the prompt is multiple choice but its options could not be read.");return{input:g}}},15388:(a,b,c)=>{c.d(b,{RJ:()=>f,SQ:()=>g});var d=c(24455);let e=(0,c(36925).v)("__toolInputNormalizations",()=>new Map);function f(a,b,c,g,h,i=Date.now()){e.set((0,d.v7)(a,b,c),{...g,toolName:h,at:i})}function g(a,b,c){return e.get((0,d.v7)(a,b,c))??null}},27354:(a,b,c)=>{c.d(b,{PF:()=>d,PP:()=>k,S6:()=>n,UT:()=>m,Yy:()=>l,dr:()=>e,eS:()=>i,lO:()=>h,m0:()=>g,uZ:()=>f});let d=new Set(["mode-off","deny-pattern","deny-pattern-unusable","type-not-allowed","policy-lookup-failed","allow-once-unidentified","recommended-option-unidentified"]),e="policy-lookup-failed",f="partial-answer",g="startup-trust-unhandled",h="question-confirm-page",i="question-left-to-human",j=new Set(["allow-once-unidentified","recommended-option-unidentified"]);function k(a){return j.has(a)}let l="allow-once-unidentified",m="recommended-option-unidentified",n="no-hook-receipt"},48736:(a,b,c)=>{c.d(b,{cV:()=>h,Tb:()=>k,Lj:()=>l,Bz:()=>i,_1:()=>j,sD:()=>m});var d=c(2232),e=c(27354),f=c(4803),g=c(73495);let h=Object.freeze({lookupFailed:!0});function i(a){return null!=a&&"lookupFailed"in a&&!0===a.lookupFailed}function j(a){return a&&!i(a)?a.mode:null}let k=2e4;function l(a,b,c,f=!1){if(!c)return null;if(i(c))return{reason:e.dr};if("off"===c.mode)return{reason:"mode-off"};let g=function(a,b){if(0===b.length)return{outcome:"no-match"};let c=a.some(a=>a.length>k),e=a.map(a=>a.length>k?a.slice(0,k):a);for(let a of b){if(a.length>200||!(0,d.P0)(a).valid)return{outcome:"unusable",pattern:a};let b=new RegExp(a);for(let c of e){let e=(0,d.eJ)(b,c);if(null===e)return{outcome:"unusable",pattern:a};if(e)return{outcome:"match",pattern:a}}}return c?{outcome:"unusable"}:{outcome:"no-match"}}(b,c.denyPatterns);return"match"===g.outcome?{reason:"deny-pattern",pattern:g.pattern}:"unusable"===g.outcome?{reason:"deny-pattern-unusable",pattern:g.pattern}:f&&c.denyPatterns.length>0?{reason:"deny-pattern-unusable"}:"safe"===c.mode?"yes_no"===a?null:{reason:"type-not-allowed"}:"allow-listed"===c.mode?c.allowPromptTypes.includes(a)?null:{reason:"type-not-allowed"}:null}function m(a,b,c,d){let{answer:h,withheldBy:i}=function(a,b,c){if("yes_no"===a.type)return{answer:"y"};if("multiple_choice"===a.type){if(void 0!==c&&"not-a-permission-dialog"===(0,g.Me)(a.options,b).kind){let b=function(a,b,c){if(c)return{kind:"unidentified",cause:"multi-select"};if(0===a.length)return{kind:"unidentified",cause:"no-options"};if(void 0===b||b.length!==a.length||b.some(a=>"unknown"===a))return{kind:"unidentified",cause:"unknown-title"};let d=a.filter((a,c)=>!0===b[c]);if(d.length>1)return{kind:"unidentified",cause:"several-recommended"};let[e,f]=1===d.length?[d[0],"recommended"]:[a.find(a=>a.isDefault)??a[0],"default"];return e.requiresTextInput?{kind:"unidentified",cause:"typed-text"}:{kind:"chosen",option:e,basis:f}}(a.options,c.optionRecommendations,(0,f.eM)(a));return"chosen"===b.kind?{answer:b.option.number.toString()}:{answer:null,withheldBy:e.UT}}if((0,f.eM)(a))return{answer:null};let d=(0,g.Me)(a.options,b);if("unidentified"===d.kind)return{answer:null,withheldBy:e.Yy};let h="allow-once"===d.kind?d.option:a.options.find(a=>a.isDefault)??a.options[0];return!h||h.requiresTextInput?{answer:null}:{answer:h.number.toString()}}return{answer:null}}(a,c,d);if(i)return{answer:null,suppressedBy:i};if(null===h)return{answer:null,suppressedBy:null};let j=l(a.type,function(a){let b=[a.question];if(a.approvalTarget&&b.push(a.approvalTarget),"multiple_choice"===a.type)for(let c of a.options)b.push(c.label);else b.push(...a.options);return b}(a),b,void 0!==a.approvalTargetCompleteness);return j?{answer:null,suppressedBy:j.reason,pattern:j.pattern}:{answer:h,suppressedBy:null}}},
|
|
1
|
+
"use strict";exports.id=6119,exports.ids=[6119],exports.modules={4803:(a,b,c)=>{c.d(b,{H2:()=>i,eM:()=>f,kN:()=>e,tP:()=>l});let d=/^\[[ xX\u2714]\] /;function e(a){return a.some(a=>d.test(a.label))}function f(a){return!0===a.multiSelect||e(a.options)}let g=/^yes\b/i,h=[/^no\b/i,/\bdeny\b/i];class i extends Error{constructor(a){super(a),this.name="PromptAnswerResolutionError"}}function j(a){return h.some(b=>b.test(a))}function k(a){return g.test(a)&&!j(a)}function l(a){let{answer:b,useDefault:c,promptData:d,fallbackPromptType:e}=a;if(c){if(d?.type==="multiple_choice"){if(f(d))throw new i('Multi-select (checkbox) prompts have no default answer: the cursor marks the row a key would toggle, not a choice. Answer with the option numbers you want ticked, comma-separated (for example "1,3").');let a=function(a){let b=a.find(a=>a.isDefault)??a.find(a=>1===a.number)??a[0];if(!b)throw new i("The prompt has no options to select a default from.");return b}(d.options);return{input:String(a.number),resolved:{via:"default",optionNumber:a.number,optionLabel:a.label}}}if(d?.type==="yes_no"){if(d.defaultOption)return{input:d.defaultOption,resolved:{via:"default",optionLabel:d.defaultOption}};throw new i("The yes/no prompt declares no default option.")}throw new i("Cannot select the default option: no active prompt was detected.")}let g=b??"",h=function(a){let b=a.trim().toLowerCase();return"yes"===b||"y"===b?"yes":"no"===b||"n"===b?"no":null}(g);if(null===h)return{input:g};if(d?.type==="multiple_choice"){let a=function(a,b){let c=a.options;if(f(a))throw new i('Multi-select (checkbox) prompts cannot be answered with yes/no. Answer with the option numbers you want ticked, comma-separated (for example "1,3").');let d="yes"===b?k:j,e=c.filter(a=>d(a.label));if(0===e.length)throw new i(`No option label matches "${b}". Answer with an option number.`);return e.reduce((a,b)=>a.number<=b.number?a:b)}(d,h);return{input:String(a.number),resolved:{via:"semantic",optionNumber:a.number,optionLabel:a.label}}}if(!d&&"multiple_choice"===e)throw new i("Cannot resolve yes/no: the prompt is multiple choice but its options could not be read.");return{input:g}}},15388:(a,b,c)=>{c.d(b,{RJ:()=>f,SQ:()=>g});var d=c(24455);let e=(0,c(36925).v)("__toolInputNormalizations",()=>new Map);function f(a,b,c,g,h,i=Date.now()){e.set((0,d.v7)(a,b,c),{...g,toolName:h,at:i})}function g(a,b,c){return e.get((0,d.v7)(a,b,c))??null}},27354:(a,b,c)=>{c.d(b,{PF:()=>d,PP:()=>k,S6:()=>n,UT:()=>m,Yy:()=>l,dr:()=>e,eS:()=>i,lO:()=>h,m0:()=>g,uZ:()=>f});let d=new Set(["mode-off","deny-pattern","deny-pattern-unusable","type-not-allowed","policy-lookup-failed","allow-once-unidentified","recommended-option-unidentified"]),e="policy-lookup-failed",f="partial-answer",g="startup-trust-unhandled",h="question-confirm-page",i="question-left-to-human",j=new Set(["allow-once-unidentified","recommended-option-unidentified"]);function k(a){return j.has(a)}let l="allow-once-unidentified",m="recommended-option-unidentified",n="no-hook-receipt"},48736:(a,b,c)=>{c.d(b,{cV:()=>h,Tb:()=>k,Lj:()=>l,Bz:()=>i,_1:()=>j,sD:()=>m});var d=c(2232),e=c(27354),f=c(4803),g=c(73495);let h=Object.freeze({lookupFailed:!0});function i(a){return null!=a&&"lookupFailed"in a&&!0===a.lookupFailed}function j(a){return a&&!i(a)?a.mode:null}let k=2e4;function l(a,b,c,f=!1){if(!c)return null;if(i(c))return{reason:e.dr};if("off"===c.mode)return{reason:"mode-off"};let g=function(a,b){if(0===b.length)return{outcome:"no-match"};let c=a.some(a=>a.length>k),e=a.map(a=>a.length>k?a.slice(0,k):a);for(let a of b){if(a.length>200||!(0,d.P0)(a).valid)return{outcome:"unusable",pattern:a};let b=new RegExp(a);for(let c of e){let e=(0,d.eJ)(b,c);if(null===e)return{outcome:"unusable",pattern:a};if(e)return{outcome:"match",pattern:a}}}return c?{outcome:"unusable"}:{outcome:"no-match"}}(b,c.denyPatterns);return"match"===g.outcome?{reason:"deny-pattern",pattern:g.pattern}:"unusable"===g.outcome?{reason:"deny-pattern-unusable",pattern:g.pattern}:f&&c.denyPatterns.length>0?{reason:"deny-pattern-unusable"}:"safe"===c.mode?"yes_no"===a?null:{reason:"type-not-allowed"}:"allow-listed"===c.mode?c.allowPromptTypes.includes(a)?null:{reason:"type-not-allowed"}:null}function m(a,b,c,d){let{answer:h,withheldBy:i}=function(a,b,c){if("yes_no"===a.type)return{answer:"y"};if("multiple_choice"===a.type){if(void 0!==c&&"not-a-permission-dialog"===(0,g.Me)(a.options,b).kind){let b=function(a,b,c){if(c)return{kind:"unidentified",cause:"multi-select"};if(0===a.length)return{kind:"unidentified",cause:"no-options"};if(void 0===b||b.length!==a.length||b.some(a=>"unknown"===a))return{kind:"unidentified",cause:"unknown-title"};let d=a.filter((a,c)=>!0===b[c]);if(d.length>1)return{kind:"unidentified",cause:"several-recommended"};let[e,f]=1===d.length?[d[0],"recommended"]:[a.find(a=>a.isDefault)??a[0],"default"];return e.requiresTextInput?{kind:"unidentified",cause:"typed-text"}:{kind:"chosen",option:e,basis:f}}(a.options,c.optionRecommendations,(0,f.eM)(a));return"chosen"===b.kind?{answer:b.option.number.toString()}:{answer:null,withheldBy:e.UT}}if((0,f.eM)(a))return{answer:null};let d=(0,g.Me)(a.options,b);if("unidentified"===d.kind)return{answer:null,withheldBy:e.Yy};let h="allow-once"===d.kind?d.option:a.options.find(a=>a.isDefault)??a.options[0];return!h||h.requiresTextInput?{answer:null}:{answer:h.number.toString()}}return{answer:null}}(a,c,d);if(i)return{answer:null,suppressedBy:i};if(null===h)return{answer:null,suppressedBy:null};let j=l(a.type,function(a){let b=[a.question];if(a.approvalTarget&&b.push(a.approvalTarget),"multiple_choice"===a.type)for(let c of a.options)b.push(c.label);else b.push(...a.options);return b}(a),b,void 0!==a.approvalTargetCompleteness);return j?{answer:null,suppressedBy:j.reason,pattern:j.pattern}:{answer:h,suppressedBy:null}}},91318:(a,b,c)=>{c.d(b,{Fv:()=>o,JJ:()=>m,d8:()=>l,ie:()=>q,n:()=>k,wO:()=>n});var d=c(56791),e=c(88807),f=c(24455),g=c(72626),h=c(48736);let i=(0,g.h)("auto-yes-policy"),j=new Map;function k(a,b,c,d){return p(a,b,c,d?.fresh===!0).policy}function l(a,b,c){let{policy:d,taskId:e}=p(a,b,c);return(0,h.Bz)(d)?{policy:null,taskId:null}:{policy:d,taskId:e}}function m(a,b,c){let{policy:d,taskId:e}=p(a,b,c);return{policy:d,taskId:e}}function n(a,b,c){var d;return d=l(a,b,c).policy,d?.mode==="off"}function o(a,b,c){let{policy:d,taskId:e}=l(a,b,c);return d?{taskId:e,mode:d.mode,allowPromptTypes:d.allowPromptTypes,denyPatternCount:d.denyPatterns.length}:null}function p(a,b,c,g=!1){let k=c??b,l=(0,f.v7)(a,b,k),m=Date.now(),n=j.get(l);if(!g&&n&&n.expiresAt>m)return n;let{policy:o,taskId:q}=function(a,b,c){try{let f=(0,d.getActiveTaskForInstance)((0,e.getDbInstance)(),a,b,c);if(!f)return{policy:null,taskId:null};return{policy:f.contract.autoYes,taskId:f.id}}catch(d){return i.warn("policy-lookup-failed",{worktreeId:a,cliToolId:b,instanceId:c,error:d instanceof Error?d.message:String(d)}),{policy:h.cV,taskId:null}}}(a,b,k);if((0,h.Bz)(o))return g&&j.delete(l),{policy:o,taskId:q,expiresAt:m};j.size>=200&&function(a){for(let[b,c]of j.entries())c.expiresAt<=a&&j.delete(b)}(m);let r={policy:o,taskId:q,expiresAt:m+5e3};return j.set(l,r),r}function q(a){j.delete(a)}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=6130,exports.ids=[6130],exports.modules={26838:(a,b,c)=>{c.d(b,{E2:()=>q,MQ:()=>m,Mj:()=>o,Sw:()=>n,lX:()=>r});var d=c(29021),e=c(33873),f=c(54325),g=c(90164),h=c(36925);let i=/^v?\d+\.\d+\.\d+$/,j=/^[a-zA-Z0-9.\-\s_v]+$/,k=[".next","required-server-files.json"],l=(0,h.v)("__versionCheckCache",()=>({result:null,fetchedAt:0,rateLimitResetAt:null}));function m(a,b){if(!i.test(a)||!i.test(b))return!1;let c=a=>a.replace(/^v/,"").split(".").map(Number),[d,e,f]=c(a),[g,h,j]=c(b);return g!==d?g>d:h!==e?h>e:j>f}function n(){return function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),"package.json"),"utf-8"),b=JSON.parse(a);if("commandmate"===b.name&&"string"==typeof b.version&&b.version.length>0)return b.version;return null}catch{return null}}()??"0.49.
|
|
1
|
+
"use strict";exports.id=6130,exports.ids=[6130],exports.modules={26838:(a,b,c)=>{c.d(b,{E2:()=>q,MQ:()=>m,Mj:()=>o,Sw:()=>n,lX:()=>r});var d=c(29021),e=c(33873),f=c(54325),g=c(90164),h=c(36925);let i=/^v?\d+\.\d+\.\d+$/,j=/^[a-zA-Z0-9.\-\s_v]+$/,k=[".next","required-server-files.json"],l=(0,h.v)("__versionCheckCache",()=>({result:null,fetchedAt:0,rateLimitResetAt:null}));function m(a,b){if(!i.test(a)||!i.test(b))return!1;let c=a=>a.replace(/^v/,"").split(".").map(Number),[d,e,f]=c(a),[g,h,j]=c(b);return g!==d?g>d:h!==e?h>e:j>f}function n(){return function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),"package.json"),"utf-8"),b=JSON.parse(a);if("commandmate"===b.name&&"string"==typeof b.version&&b.version.length>0)return b.version;return null}catch{return null}}()??"0.49.1"}function o(){return n()}let p=null;function q(a){let b=p??=function(){{let a=function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),...k),"utf-8"),b=JSON.parse(a),c=b.config?.env?.NEXT_PUBLIC_APP_VERSION;if("string"==typeof c&&c.length>0)return c;return null}catch{return null}}();if(a)return a}return"0.49.1"}();return(0,f.LE)(b,a)?{serverVersion:b,clientVersion:a}:null}async function r(){try{var a,b,c;if(null!==l.result&&Date.now()-l.fetchedAt<36e5||l.rateLimitResetAt&&(!(Date.now()>=l.rateLimitResetAt)||(l.rateLimitResetAt=null,0)))return l.result;let d=await fetch("https://api.github.com/repos/Kewton/CommandMate/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":`CommandMate/${o()}`},cache:"no-store",signal:AbortSignal.timeout(5e3)});if(403===d.status)return function(a){let b=a.headers.get("X-RateLimit-Reset");b?l.rateLimitResetAt=1e3*parseInt(b,10):l.rateLimitResetAt=Date.now()+36e5}(d),l.result;if(!d.ok)return l.result;let e=await d.json(),f=o(),h=e.tag_name.replace(/^v/,""),i={hasUpdate:m(f,e.tag_name),currentVersion:f,latestVersion:h,releaseUrl:(a=e.html_url).startsWith(g.Dk)?a:null,releaseName:(b=e.name,c=e.tag_name,j.test(b)&&b.length<=128?b:c),publishedAt:e.published_at};return l.result=i,l.fetchedAt=Date.now(),i}catch{return l.result}}},54325:(a,b,c)=>{c.d(b,{LE:()=>f,Oo:()=>e,ST:()=>d,T4:()=>k,dz:()=>j,r9:()=>h,rx:()=>i,rz:()=>g});let d="client_version",e="version_mismatch";function f(a,b){return!!a&&!!b&&"0.0.0"!==a&&"0.0.0"!==b&&a!==b}let g="chat_turn_progress",h=1e3;function i(a,b=65536){return b<=0?{body:"",truncated:a.length>0}:a.length<=b?{body:a,truncated:!1}:{body:a.slice(a.length-b),truncated:!0}}let j="messages_invalidated",k="model_changed"},88573:(a,b,c)=>{c.d(b,{Lw:()=>t});let d="https://raw.githubusercontent.com/Kewton/commandmate-skills/main/catalog/v1/catalog.json",e=[d],f=/^[A-Za-z0-9/+=_."-]{1,128}$/;var g=c(72626),h=c(13075),i=c(36925);let j=(0,g.h)("lib/skills/catalog-client"),k={FETCH_FAILED:"SKILL_CATALOG_FETCH_FAILED",RATE_LIMITED:"SKILL_CATALOG_RATE_LIMITED",OVERSIZED:"SKILL_CATALOG_OVERSIZED",MALFORMED:"SKILL_CATALOG_MALFORMED",INVALID_SCHEMA:"SKILL_CATALOG_INVALID_SCHEMA"},l=(0,i.v)("__skillCatalogCache",()=>({catalog:null,validatedAt:0,confirmedAt:0,etag:null,revision:null,rateLimitResetAt:null,inflight:null}));class m extends Error{}let n={[k.FETCH_FAILED]:"The Skill Catalog could not be retrieved.",[k.RATE_LIMITED]:"The Skill Catalog origin is rate limiting requests.",[k.OVERSIZED]:"The Skill Catalog response exceeded the allowed size.",[k.MALFORMED]:"The Skill Catalog response was not valid JSON.",[k.INVALID_SCHEMA]:"The Skill Catalog response did not match the supported Catalog schema."};function o(a){return new Date(a).toISOString()}function p(a,b,c){return{catalog:a,fetchedAt:o(l.validatedAt),revalidatedAt:o(l.confirmedAt),state:b,stale:"stale"===b,offline:"stale"===b,staleReason:c,source:{repository:"Kewton/commandmate-skills",ref:"main",revision:l.revision}}}function q(a,b=[]){return l.catalog?{ok:!0,snapshot:p(l.catalog,"stale",a)}:{ok:!1,failure:{code:a,message:n[a],errors:b}}}async function r(a,b){let c=a.headers.get("Content-Length");if(null!==c){let a=Number(c);if(!Number.isFinite(a)||a<0||a>b)throw new m("content-length out of bounds")}let d=a.body;if(!d||"function"!=typeof d.getReader){let c=await a.text();if(new TextEncoder().encode(c).length>b)throw new m("body exceeded size cap");return c}let e=d.getReader(),f=[],g=0;for(;;){let{done:a,value:c}=await e.read();if(a)break;if(c){if((g+=c.byteLength)>b)throw await e.cancel(),new m("body exceeded size cap");f.push(c)}}let h=new Uint8Array(g),i=0;for(let a of f)h.set(a,i),i+=a.byteLength;return new TextDecoder("utf-8").decode(h)}async function s(a){let b,c,g;if(!e.includes(d))return q(k.FETCH_FAILED);let i={Accept:"application/json","User-Agent":`CommandMate/${a}`};null!==l.catalog&&null!==l.etag&&(i["If-None-Match"]=l.etag);try{b=await fetch(d,{headers:i,cache:"no-store",signal:AbortSignal.timeout(5e3)})}catch{return j.warn("catalog-fetch-failed",{reason:k.FETCH_FAILED}),q(k.FETCH_FAILED)}if(304===b.status&&null!==l.catalog)return l.confirmedAt=Date.now(),{ok:!0,snapshot:p(l.catalog,"revalidated",null)};if(403===b.status||429===b.status)return!function(a){let b=Date.now(),c=b+864e5,d=a.headers.get("X-RateLimit-Reset");if(null!==d){let a=Number(d);if(Number.isFinite(a)&&a>0){l.rateLimitResetAt=Math.min(1e3*a,c);return}}let e=a.headers.get("Retry-After");if(null!==e){let a=Number(e);if(Number.isFinite(a)&&a>0){l.rateLimitResetAt=Math.min(b+1e3*a,c);return}}l.rateLimitResetAt=b+36e5}(b),j.warn("catalog-rate-limited",{status:b.status}),q(k.RATE_LIMITED);if(!b.ok)return j.warn("catalog-fetch-failed",{status:b.status}),q(k.FETCH_FAILED);try{c=await r(b,1048576)}catch(b){let a=b instanceof m?k.OVERSIZED:k.FETCH_FAILED;return j.warn("catalog-body-rejected",{reason:a}),q(a)}try{g=JSON.parse(c)}catch{return j.warn("catalog-malformed",{reason:k.MALFORMED}),q(k.MALFORMED)}let n=(0,h.JJ)(g);if(!n.ok)return j.warn("catalog-invalid-schema",{errorCount:n.errors.length}),q(k.INVALID_SCHEMA,n.errors);let o=Date.now();return l.catalog=n.value,l.validatedAt=o,l.confirmedAt=o,l.etag=b.headers.get("ETag"),l.revision=function(a){if(null===a)return null;let b=a.trim();return f.test(b)?b:null}(l.etag),{ok:!0,snapshot:p(n.value,"fresh",null)}}async function t(a={}){let{hostVersion:b="0.0.0",forceRevalidate:c=!1}=a;return!c&&null!==l.catalog&&Date.now()-l.confirmedAt<9e5&&null!==l.catalog?{ok:!0,snapshot:p(l.catalog,"cached",null)}:null!==l.rateLimitResetAt&&(!(Date.now()>=l.rateLimitResetAt)||(l.rateLimitResetAt=null,0))?q(k.RATE_LIMITED):(null===l.inflight&&(l.inflight=s(b).finally(()=>{l.inflight=null})),l.inflight)}},90164:(a,b,c)=>{c.d(b,{Dk:()=>e,kD:()=>f});let d="https://github.com/Kewton/CommandMate",e=`${d}/releases/`,f=`${d}/blob/main/docs/security-guide.md`}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
exports.id=6401,exports.ids=[6401],exports.modules={3421:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(71237),e=c(55088),f=c(17679);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},26838:(a,b,c)=>{"use strict";c.d(b,{E2:()=>q,MQ:()=>m,Mj:()=>o,Sw:()=>n,lX:()=>r});var d=c(29021),e=c(33873),f=c(54325),g=c(90164),h=c(36925);let i=/^v?\d+\.\d+\.\d+$/,j=/^[a-zA-Z0-9.\-\s_v]+$/,k=[".next","required-server-files.json"],l=(0,h.v)("__versionCheckCache",()=>({result:null,fetchedAt:0,rateLimitResetAt:null}));function m(a,b){if(!i.test(a)||!i.test(b))return!1;let c=a=>a.replace(/^v/,"").split(".").map(Number),[d,e,f]=c(a),[g,h,j]=c(b);return g!==d?g>d:h!==e?h>e:j>f}function n(){return function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),"package.json"),"utf-8"),b=JSON.parse(a);if("commandmate"===b.name&&"string"==typeof b.version&&b.version.length>0)return b.version;return null}catch{return null}}()??"0.49.
|
|
1
|
+
exports.id=6401,exports.ids=[6401],exports.modules={3421:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(71237),e=c(55088),f=c(17679);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},26838:(a,b,c)=>{"use strict";c.d(b,{E2:()=>q,MQ:()=>m,Mj:()=>o,Sw:()=>n,lX:()=>r});var d=c(29021),e=c(33873),f=c(54325),g=c(90164),h=c(36925);let i=/^v?\d+\.\d+\.\d+$/,j=/^[a-zA-Z0-9.\-\s_v]+$/,k=[".next","required-server-files.json"],l=(0,h.v)("__versionCheckCache",()=>({result:null,fetchedAt:0,rateLimitResetAt:null}));function m(a,b){if(!i.test(a)||!i.test(b))return!1;let c=a=>a.replace(/^v/,"").split(".").map(Number),[d,e,f]=c(a),[g,h,j]=c(b);return g!==d?g>d:h!==e?h>e:j>f}function n(){return function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),"package.json"),"utf-8"),b=JSON.parse(a);if("commandmate"===b.name&&"string"==typeof b.version&&b.version.length>0)return b.version;return null}catch{return null}}()??"0.49.1"}function o(){return n()}let p=null;function q(a){let b=p??=function(){{let a=function(){try{let a=(0,d.readFileSync)((0,e.join)(process.cwd(),...k),"utf-8"),b=JSON.parse(a),c=b.config?.env?.NEXT_PUBLIC_APP_VERSION;if("string"==typeof c&&c.length>0)return c;return null}catch{return null}}();if(a)return a}return"0.49.1"}();return(0,f.LE)(b,a)?{serverVersion:b,clientVersion:a}:null}async function r(){try{var a,b,c;if(null!==l.result&&Date.now()-l.fetchedAt<36e5||l.rateLimitResetAt&&(!(Date.now()>=l.rateLimitResetAt)||(l.rateLimitResetAt=null,0)))return l.result;let d=await fetch("https://api.github.com/repos/Kewton/CommandMate/releases/latest",{headers:{Accept:"application/vnd.github+json","User-Agent":`CommandMate/${o()}`},cache:"no-store",signal:AbortSignal.timeout(5e3)});if(403===d.status)return function(a){let b=a.headers.get("X-RateLimit-Reset");b?l.rateLimitResetAt=1e3*parseInt(b,10):l.rateLimitResetAt=Date.now()+36e5}(d),l.result;if(!d.ok)return l.result;let e=await d.json(),f=o(),h=e.tag_name.replace(/^v/,""),i={hasUpdate:m(f,e.tag_name),currentVersion:f,latestVersion:h,releaseUrl:(a=e.html_url).startsWith(g.Dk)?a:null,releaseName:(b=e.name,c=e.tag_name,j.test(b)&&b.length<=128?b:c),publishedAt:e.published_at};return l.result=i,l.fetchedAt=Date.now(),i}catch{return l.result}}},36925:(a,b,c)=>{"use strict";function d(a,b){return globalThis[a]??=b()}c.d(b,{v:()=>d})},48870:(a,b,c)=>{"use strict";c.d(b,{GQ:()=>j,TJ:()=>g,Tf:()=>h,WI:()=>i});var d=c(29021),e=c(33873),f=c(21820);function g(){let a=(0,e.dirname)(__dirname);return a.includes("/lib/node_modules/")||a.includes("\\node_modules\\")||a.includes("/node_modules/commandmate")}function h(){let a=(0,e.dirname)(__dirname);return a.includes("/_npx/")||a.includes("\\_npx\\")}function i(){if(g()){let a=(0,e.join)((0,f.homedir)(),".commandmate");if((0,d.existsSync)(a)){let b=(0,d.realpathSync)(a),c=(0,d.realpathSync)((0,f.homedir)());if(!b.startsWith(c))throw Error(`Security error: Config directory ${a} is outside home directory`);return b}return a}let a=process.cwd();return(0,d.realpathSync)(a)}function j(){let a=g()?(0,e.join)((0,f.homedir)(),".commandmate"):process.cwd();return(0,d.existsSync)(a)||(0,d.mkdirSync)(a,{recursive:!0,mode:448}),i()}},53515:(a,b,c)=>{"use strict";c.d(b,{n8:()=>n,KC:()=>m});var d=c(79646);function e(a){return"string"==typeof a?a.trim():""}c(29021),c(33873);var f=c(26838);let g=/^\d+\.\d+\.\d+$/,h=/^v?\d+\.\d+\.\d+$/,i=globalThis,j=i.__npmPublishCheckCache??(i.__npmPublishCheckCache={targetVersion:null,npmVersion:null,checkedAt:0,inFlight:null});async function k(){let a=await new Promise(a=>{(0,d.execFile)("npm",["view","commandmate","version"],{encoding:"utf-8",timeout:1e4},(b,c,d)=>{if(b)return"ENOENT"===b.code?void a({success:!1,error:"npm command not found. Install Node.js/npm and try again."}):void a({success:!1,error:e(d)||b.message});let f=e(c);if(!f)return void a({success:!1,error:"npm view returned no version"});a({success:!0,version:f})})});return a.success&&a.version&&g.test(a.version)?a.version:null}async function l(a,b,c){var d,e,g,h;if(j.targetVersion===a){if(null!==j.npmVersion&&(d=j.npmVersion,!(0,f.MQ)(d,a))||c()-j.checkedAt<3e5)return j.npmVersion}j.inFlight||(j.inFlight=(async()=>{try{return await b()}catch{return null}})());let i=j.inFlight,k=await i;return j.inFlight===i&&(j.inFlight=null,e=a,g=k,h=c(),j.targetVersion=e,j.npmVersion=g,j.checkedAt=h),k}async function m(a,b={}){var c;if(!a.hasUpdate)return{hasUpdate:!1,pendingVersion:null};let d=await l(a.latestVersion,b.fetchNpmLatest??k,b.now??Date.now);return null!==d&&(c=a.latestVersion,(0,f.MQ)(d,c))?{hasUpdate:!1,pendingVersion:a.latestVersion}:{hasUpdate:!0,pendingVersion:null}}async function n(a,b={}){let c;if(!h.test(a))return null;try{c=await (b.fetchNpmLatest??k)()}catch{return null}return null===c?null:(0,f.MQ)(a,c)}},54325:(a,b,c)=>{"use strict";c.d(b,{LE:()=>f,Oo:()=>e,ST:()=>d,T4:()=>k,dz:()=>j,r9:()=>h,rx:()=>i,rz:()=>g});let d="client_version",e="version_mismatch";function f(a,b){return!!a&&!!b&&"0.0.0"!==a&&"0.0.0"!==b&&a!==b}let g="chat_turn_progress",h=1e3;function i(a,b=65536){return b<=0?{body:"",truncated:a.length>0}:a.length<=b?{body:a,truncated:!1}:{body:a.slice(a.length-b),truncated:!0}}let j="messages_invalidated",k="model_changed"},78335:()=>{},90164:(a,b,c)=>{"use strict";c.d(b,{Dk:()=>e,kD:()=>f});let d="https://github.com/Kewton/CommandMate",e=`${d}/releases/`,f=`${d}/blob/main/docs/security-guide.md`},95736:(a,b,c)=>{"use strict";a.exports=c(44870)},96487:()=>{}};
|
|
@@ -15,4 +15,4 @@ ${h}`}}(a,i,j)}function as(a,b){return b?`${a}
|
|
|
15
15
|
${b}`:a}function at(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 au(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 ${U.aT}; origin/HEAD did not resolve a default branch.`,null);let g=await at(["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 at(["rev-list",`${h}..HEAD`,"--",":(top)",`:(exclude,top)${J}`],a);if(0!==i.code)return f("error",`work-evidence: 'git rev-list ${h}..HEAD' failed.`,null);let j=await Q(a,h);if("error"in j)return f("error",`work-evidence: ${j.error}`,null);let k=new Set(j.changes.filter(a=>a.fold).map(a=>a.sha)),l=i.stdout.split("\n").filter(a=>""!==a.trim()),m=l.filter(a=>k.has(a)).length,n=l.length-m,o=await at(["status","--porcelain","-z","--untracked-files=all"],a);if(0!==o.code)return f("error","work-evidence: 'git status --porcelain' failed.",null);let p=y(a),q=0,r=new Set,s=O(o.stdout).filter(a=>!!a.paths.some(a=>!L(a))&&(P(a,p)?(q+=1,!1):!C(a)||(a.paths.forEach(a=>r.add(a)),!1))).length,t=`work-evidence: baseRef=${b} commits=${n} uncommitted=${s}`+(c.required?" requireCommit=true":"")+" (contract files excluded)"+(m>0?` (${m} orchestrator fold commit(s) excluded)`:"")+(q>0?` (${q} CommandMate-installed Skill file(s) excluded)`:"")+(r.size>0?` (agent-managed state file(s) excluded: ${[...r].sort().join(", ")})`:"");if(!Number.isFinite(n)||0===n&&0===s){let a=Number.isFinite(n)?d.fileCount():null;return null===a||0===a?f("failed",`${t}
|
|
16
16
|
No commits and no uncommitted changes: nothing to verify.`,1):f("passed",`${t}
|
|
17
17
|
${d.label}: ${a} file(s) changed. git found nothing; the agent did.`,0)}return c.required&&0===n?f("failed",`${t}
|
|
18
|
-
${c.sources.join(" and ")} requires a commit: uncommitted changes are not work evidence, commit them.`,1):f("passed",t,0)}async function av(a,b){if(a.options.baseRef)return a.options.baseRef;let c=await (0,i.tR)(b);return c?`origin/${c}`:null}async function aw(a,b,c,d,f,h,i,j,k,m,o,p,r){var s,t;let{maxLogTailBytes:u,skipInPrimaryCheckout:v}=h.options,{runWorkEvidence:w,gates:x}=i,y={label:"opencode session diff",fileCount:()=>void 0!==f&&(f===W.k||(0,g.getAgentInstances)(a,c).some(a=>a.id===f&&a.cliTool===W.k))?(0,V.pw)(c,f):null},z=(0,l.fc)(k?.contract??null,h),A=null,B=()=>A??={CM_WORKTREE_ID:c,CM_WORKTREE_INDEX:String((0,q.Cr)(c))},C=(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),D=async(c,d,e,f)=>C((0,g.createGateResult)(a,b,{gateId:c,command:d,source:e}).id,await f()),E=(c,d,e,f)=>{let h={status:"skipped",exitCode:null,startedAt:Date.now(),durationMs:0,logTail:f};return C((0,g.createGateResult)(a,b,{gateId:c,command:d,source:e}).id,h)},F=[],G=(a,b)=>{for(let c of(b.scope&&E(U.le,Y,"builtin",a),b.envClean&&E(U.Q5,Z,"builtin",a),b.gates))E(c.id,c.command,c.source,a)},H=a=>(G(aj,a),"cancelled");if(w){let a=await D(U.uz,"git merge-base / rev-list / status --porcelain (excluding contract files)","builtin",()=>au(d,j,z,y));if("passed"!==a.status)return G("skipped: the work-evidence gate did not pass.",{scope:"off"!==i.scope,envClean:i.runEnvClean,gates:x}),"failed"===a.status?"not_started":"error";if(F.push(a.status),p.cancelled)return H({scope:"off"!==i.scope,envClean:i.runEnvClean,gates:x})}if("off"!==i.scope){let a=m?E(U.le,Y,"builtin",(s=m.id,t=m.status,`scope: task ${s} declares a scope for this worktree, but it is ${t} and this run was not attached to it, so its scope was NOT judged. \`wait --verify\` attaches only to an in-flight task; to re-verify a finished task, run \`commandmate verify <worktree> --task ${s}\`.`)):await D(U.le,Y,"builtin",()=>T(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)&&F.push(a.status),p.cancelled)return H({scope:!1,envClean:i.runEnvClean,gates:x})}if(i.runEnvClean){let a=await D(U.Q5,Z,"builtin",()=>(0,n.uT)({worktreeId:o.worktreeId,worktreePath:d,taskId:o.taskId,baseline:o.baseline,sources:o.decision.sources,ignoreHomeEntries:h.options.envCleanIgnoreHomeEntries}));if(F.push(a.status),p.cancelled)return H({scope:!1,envClean:!1,gates:x})}let I=v&&function(a,b){try{return(0,e.realpathSync)(a)===(0,e.realpathSync)(b)}catch{return!1}}(d,process.cwd());for(let[a,b]of x.entries()){if(p.cancelled)return H({scope:!1,envClean:!1,gates:x.slice(a)});if(I){F.push(E(b.id,b.command,b.source,"skipped: worktreePath is the server process working directory and options.skipInPrimaryCheckout is true.").status);continue}let c=await D(b.id,b.command,b.source,()=>aq(b,d,u,B(),p,r));F.push(c.status)}return p.cancelled?"cancelled":F.some(a=>"failed"===a||"timeout"===a||"error"===a)?"failed":F.some(a=>"skipped"===a)?"error":"passed"}function ax(a,b,c,d){try{(0,m.g)(a,b,c,void 0===d?void 0:{runId:d})}catch(a){X.warn("task-transition-failed",{taskId:b,event:c,error:a instanceof Error?a.message:String(a)})}}function ay(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 az(a){let b=(0,f.getDbInstance)(),c=(0,g.getRunningVerificationRun)(b,a.worktreeId);if(c)throw new ad(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,U.yR)(a.worktreePath))||(m=`${U.aT} not found in ${a.worktreePath}. Declare the repository verification gates there before running verification.`)}catch(a){m=a instanceof U.Yp?a.message:`Failed to read ${U.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 ${U.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([U.uz,U.le,U.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(U.uz)||c.workEvidence,scope:f.has(U.le)||c.scope?"explicit":"off",runEnvClean:f.has(U.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 av(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:U.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"),X.warn("verification-config-unusable",{runId:t.id,worktreeId:a.worktreeId}),ay(b,a,t.id,i,"error"),d&&(ax(b,d.id,"verify_started",t.id),ax(b,d.id,"verify_failed",t.id)),{runId:t.id}}d&&ax(b,d.id,"verify_started",t.id);let u=new ak;al.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=new ag,z=(async()=>{await y.acquire(!1,u);let c="error";try{if(u.cancelled)return c="cancelled",(0,g.finishVerificationRun)(b,t.id,"cancelled"),"cancelled";let f=await aw(b,t.id,a.worktreeId,a.worktreePath,a.instanceId,v,w,s,d,e,x,u,y);return c=f,(0,g.finishVerificationRun)(b,t.id,f),f}catch(a){X.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&&ax(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),ay(b,a,t.id,i,c),y.release(),ah.delete(t.id),al.delete(t.id)}})();return ah.set(t.id,z),{runId:t.id}}}
|
|
18
|
+
${c.sources.join(" and ")} requires a commit: uncommitted changes are not work evidence, commit them.`,1):f("passed",t,0)}async function av(a,b){if(a.options.baseRef)return a.options.baseRef;let c=await (0,i.tR)(b);return c?`origin/${c}`:null}async function aw(a,b,c,d,f,h,i,j,k,m,o,p,r){var s,t;let{maxLogTailBytes:u,skipInPrimaryCheckout:v}=h.options,{runWorkEvidence:w,gates:x}=i,y={label:"opencode session diff",fileCount:()=>void 0!==f&&(f===W.k||(0,g.getAgentInstances)(a,c).some(a=>a.id===f&&a.cliTool===W.k))?(0,V.pw)(c,f):null},z=(0,l.fc)(k?.contract??null,h),A=null,B=()=>A??={CM_WORKTREE_ID:c,CM_WORKTREE_INDEX:String((0,q.Cr)(c))},C=(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),D=async(c,d,e,f)=>C((0,g.createGateResult)(a,b,{gateId:c,command:d,source:e}).id,await f()),E=(c,d,e,f)=>{let h={status:"skipped",exitCode:null,startedAt:Date.now(),durationMs:0,logTail:f};return C((0,g.createGateResult)(a,b,{gateId:c,command:d,source:e}).id,h)},F=[],G=(a,b)=>{for(let c of(b.scope&&E(U.le,Y,"builtin",a),b.envClean&&E(U.Q5,Z,"builtin",a),b.gates))E(c.id,c.command,c.source,a)},H=a=>(G(aj,a),"cancelled");if(w){let a=await D(U.uz,"git merge-base / rev-list / status --porcelain (excluding contract files)","builtin",()=>au(d,j,z,y));if("passed"!==a.status)return G("skipped: the work-evidence gate did not pass.",{scope:"off"!==i.scope,envClean:i.runEnvClean,gates:x}),"failed"===a.status?"not_started":"error";if(F.push(a.status),p.cancelled)return H({scope:"off"!==i.scope,envClean:i.runEnvClean,gates:x})}if("off"!==i.scope){let a=m?E(U.le,Y,"builtin",(s=m.id,t=m.status,`scope: task ${s} declares a scope for this worktree, but it is ${t} and this run was not attached to it, so its scope was NOT judged. \`wait --verify\` attaches only to an in-flight task; to re-verify a finished task, run \`commandmate verify <worktree> --task ${s}\`.`)):await D(U.le,Y,"builtin",()=>T(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)&&F.push(a.status),p.cancelled)return H({scope:!1,envClean:i.runEnvClean,gates:x})}if(i.runEnvClean){let a=await D(U.Q5,Z,"builtin",()=>(0,n.uT)({worktreeId:o.worktreeId,worktreePath:d,taskId:o.taskId,baseline:o.baseline,sources:o.decision.sources,ignoreHomeEntries:h.options.envCleanIgnoreHomeEntries}));if(F.push(a.status),p.cancelled)return H({scope:!1,envClean:!1,gates:x})}let I=v&&function(a,b){try{return(0,e.realpathSync)(a)===(0,e.realpathSync)(b)}catch{return!1}}(d,process.cwd());for(let[a,b]of x.entries()){if(p.cancelled)return H({scope:!1,envClean:!1,gates:x.slice(a)});if(I){F.push(E(b.id,b.command,b.source,"skipped: worktreePath is the server process working directory and options.skipInPrimaryCheckout is true.").status);continue}let c=await D(b.id,b.command,b.source,()=>aq(b,d,u,B(),p,r));F.push(c.status)}return p.cancelled?"cancelled":F.some(a=>"failed"===a||"timeout"===a||"error"===a)?"failed":F.some(a=>"skipped"===a)?"error":"passed"}function ax(a,b,c,d){try{(0,m.g)(a,b,c,void 0===d?void 0:{runId:d})}catch(a){X.warn("task-transition-failed",{taskId:b,event:c,error:a instanceof Error?a.message:String(a)})}}function ay(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 az(a){let b=(0,f.getDbInstance)(),c=(0,g.getRunningVerificationRun)(b,a.worktreeId);if(c)throw new ad(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,U.yR)(a.worktreePath))||(m=`${U.aT} not found in ${a.worktreePath}. Declare the repository verification gates there before running verification.`)}catch(a){m=a instanceof U.Yp?a.message:`Failed to read ${U.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 ${U.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([U.uz,U.le,U.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(U.uz)||c.workEvidence,scope:f.has(U.le)||c.scope?"explicit":"off",runEnvClean:f.has(U.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 av(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:U.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"),X.warn("verification-config-unusable",{runId:t.id,worktreeId:a.worktreeId}),ay(b,a,t.id,i,"error"),d&&(ax(b,d.id,"verify_started",t.id),ax(b,d.id,"verify_failed",t.id)),{runId:t.id}}d&&ax(b,d.id,"verify_started",t.id);let u=new ak;al.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=new ag,z=(async()=>{await y.acquire(!1,u);let c="error";try{if(u.cancelled)return c="cancelled",(0,g.finishVerificationRun)(b,t.id,"cancelled"),"cancelled";let f=await aw(b,t.id,a.worktreeId,a.worktreePath,a.instanceId,v,w,s,d,e,x,u,y);return c=f,(0,g.finishVerificationRun)(b,t.id,f),f}catch(a){X.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&&ax(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),ay(b,a,t.id,i,c),y.release(),ah.delete(t.id),al.delete(t.id)}})();return ah.set(t.id,z),{runId:t.id}}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=6781,exports.ids=[6781],exports.modules={16781:(a,b,c)=>{c.r(b),c.d(b,{AGENT_EVENT_TYPES:()=>n.b0,MAX_CWD_LENGTH:()=>p,applyAgentStopEvent:()=>u,isAgentEventType:()=>n.o0,resolveWorktreeByCwd:()=>s,validateHookCwd:()=>q});var d=c(29021),e=c(33873),f=c(56791),g=c(48524),h=c(66007),i=c(52767),j=c(36486),k=c(95375),l=c(31517),m=c(72626),n=c(62887);let o=(0,m.h)("lib/hooks/agent-event-service"),p=4096;function q(a){if("string"!=typeof a||""===a.trim())return{ok:!1,reason:"empty"};if(a.length>p)return{ok:!1,reason:"too_long"};let b=a;try{b=decodeURIComponent(a)}catch{b=a}return a.includes("\0")||b.includes("\0")?{ok:!1,reason:"nul_byte"}:(0,e.isAbsolute)(a)?r(a)||r(b)?{ok:!1,reason:"traversal"}:{ok:!0,cwd:a}:{ok:!1,reason:"not_absolute"}}function r(a){return a.split("\\"===e.sep?/[\\/]/:"/").some(a=>".."===a)}function s(a,b){let c=t(b);if(null===c)return null;let d=null,e=-1;for(let b of(0,f.getWorktrees)(a)){let a=t(b.path);null!==a&&(0,h.Uc)(c,a)&&a.length>e&&(d=b,e=a.length)}return d}function t(a){try{return(0,d.realpathSync)(a)}catch{return null}}async function u(a,b,c,d){let e;(0,k.recordAgentStopEvent)(b.id,c,d);let{status:f}=await (0,l.DL)(b,c,d),h="captured"===f;try{e=(0,g.MH)(a,b.id,c,d)}catch(a){return o.warn("agent-stop-task-lookup-failed",{worktreeId:b.id,error:a instanceof Error?a.message:String(a)}),{taskId:null,taskEventApplied:!1,verificationRunId:null,structuredHistoryCaptured:h,structuredHistoryOutcome:f}}if(!e)return{taskId:null,taskEventApplied:!1,verificationRunId:null,structuredHistoryCaptured:h,structuredHistoryOutcome:f};let m=!1;try{let b=(0,i.g)(a,e.id,"agent_idle",{source:"hook"});m=null!==b&&null!==b.toStatus}catch(a){o.warn("agent-stop-event-failed",{taskId:e.id,error:a instanceof Error?a.message:String(a)})}if(!e.contract.success.autoVerifyOnStop)return{taskId:e.id,taskEventApplied:m,verificationRunId:null,structuredHistoryCaptured:h,structuredHistoryOutcome:f};let n=null;try{let{runId:a}=await (0,j.AT)({worktreeId:b.id,worktreePath:b.path,instanceId:d,taskId:e.id,trigger:"task"});n=a}catch(a){a instanceof j.Wb||o.error("agent-stop-auto-verify-failed",{taskId:e.id,error:a instanceof Error?a.message:String(a)})}return{taskId:e.id,taskEventApplied:m,verificationRunId:n,structuredHistoryCaptured:h,structuredHistoryOutcome:f}}},31517:(a,b,c)=>{c.d(b,{DL:()=>j,sD:()=>f});var d=c(2734);let e=(0,c(72626).h)("lib/hooks/stop-history-capture"),f=[150,500,2e3,5e3],g=new Set([d.c]);function h(a){return new Promise(b=>{setTimeout(b,a)})}async function i(a,b,c,d,f,g){let i=Date.now();try{for(let[j,k]of g.entries()){await h(k);let l={};if(await a.captureStructuredHistoryTurn(b.id,c,d,f,l))return e.info("stop-history-capture-deferred-captured",{worktreeId:b.id,cliToolId:c,instanceId:d,attempt:j+1,attempts:g.length,elapsedMs:Date.now()-i}),!0;e.debug("stop-history-capture-deferred-open",{worktreeId:b.id,cliToolId:c,instanceId:d,attempt:j+1,attempts:g.length,outcome:l.outcome??"unavailable",elapsedMs:Date.now()-i})}return e.info("stop-history-capture-deferred-exhausted",{worktreeId:b.id,cliToolId:c,instanceId:d,attempts:g.length,elapsedMs:Date.now()-i}),!1}catch(a){return e.warn("stop-history-capture-deferred-failed",{worktreeId:b.id,cliToolId:c,instanceId:d,error:a instanceof Error?a.message:String(a)}),!1}}async function j(a,b,d,k={}){try{let j=await Promise.all([c.e(1503),c.e(8791),c.e(1719),c.e(2119),c.e(2445),c.e(252),c.e(8800),c.e(7905),c.e(255),c.e(9731),c.e(8728),c.e(8918)
|
|
1
|
+
"use strict";exports.id=6781,exports.ids=[6781],exports.modules={16781:(a,b,c)=>{c.r(b),c.d(b,{AGENT_EVENT_TYPES:()=>n.b0,MAX_CWD_LENGTH:()=>p,applyAgentStopEvent:()=>u,isAgentEventType:()=>n.o0,resolveWorktreeByCwd:()=>s,validateHookCwd:()=>q});var d=c(29021),e=c(33873),f=c(56791),g=c(48524),h=c(66007),i=c(52767),j=c(36486),k=c(95375),l=c(31517),m=c(72626),n=c(62887);let o=(0,m.h)("lib/hooks/agent-event-service"),p=4096;function q(a){if("string"!=typeof a||""===a.trim())return{ok:!1,reason:"empty"};if(a.length>p)return{ok:!1,reason:"too_long"};let b=a;try{b=decodeURIComponent(a)}catch{b=a}return a.includes("\0")||b.includes("\0")?{ok:!1,reason:"nul_byte"}:(0,e.isAbsolute)(a)?r(a)||r(b)?{ok:!1,reason:"traversal"}:{ok:!0,cwd:a}:{ok:!1,reason:"not_absolute"}}function r(a){return a.split("\\"===e.sep?/[\\/]/:"/").some(a=>".."===a)}function s(a,b){let c=t(b);if(null===c)return null;let d=null,e=-1;for(let b of(0,f.getWorktrees)(a)){let a=t(b.path);null!==a&&(0,h.Uc)(c,a)&&a.length>e&&(d=b,e=a.length)}return d}function t(a){try{return(0,d.realpathSync)(a)}catch{return null}}async function u(a,b,c,d){let e;(0,k.recordAgentStopEvent)(b.id,c,d);let{status:f}=await (0,l.DL)(b,c,d),h="captured"===f;try{e=(0,g.MH)(a,b.id,c,d)}catch(a){return o.warn("agent-stop-task-lookup-failed",{worktreeId:b.id,error:a instanceof Error?a.message:String(a)}),{taskId:null,taskEventApplied:!1,verificationRunId:null,structuredHistoryCaptured:h,structuredHistoryOutcome:f}}if(!e)return{taskId:null,taskEventApplied:!1,verificationRunId:null,structuredHistoryCaptured:h,structuredHistoryOutcome:f};let m=!1;try{let b=(0,i.g)(a,e.id,"agent_idle",{source:"hook"});m=null!==b&&null!==b.toStatus}catch(a){o.warn("agent-stop-event-failed",{taskId:e.id,error:a instanceof Error?a.message:String(a)})}if(!e.contract.success.autoVerifyOnStop)return{taskId:e.id,taskEventApplied:m,verificationRunId:null,structuredHistoryCaptured:h,structuredHistoryOutcome:f};let n=null;try{let{runId:a}=await (0,j.AT)({worktreeId:b.id,worktreePath:b.path,instanceId:d,taskId:e.id,trigger:"task"});n=a}catch(a){a instanceof j.Wb||o.error("agent-stop-auto-verify-failed",{taskId:e.id,error:a instanceof Error?a.message:String(a)})}return{taskId:e.id,taskEventApplied:m,verificationRunId:n,structuredHistoryCaptured:h,structuredHistoryOutcome:f}}},31517:(a,b,c)=>{c.d(b,{DL:()=>j,sD:()=>f});var d=c(2734);let e=(0,c(72626).h)("lib/hooks/stop-history-capture"),f=[150,500,2e3,5e3],g=new Set([d.c]);function h(a){return new Promise(b=>{setTimeout(b,a)})}async function i(a,b,c,d,f,g){let i=Date.now();try{for(let[j,k]of g.entries()){await h(k);let l={};if(await a.captureStructuredHistoryTurn(b.id,c,d,f,l))return e.info("stop-history-capture-deferred-captured",{worktreeId:b.id,cliToolId:c,instanceId:d,attempt:j+1,attempts:g.length,elapsedMs:Date.now()-i}),!0;e.debug("stop-history-capture-deferred-open",{worktreeId:b.id,cliToolId:c,instanceId:d,attempt:j+1,attempts:g.length,outcome:l.outcome??"unavailable",elapsedMs:Date.now()-i})}return e.info("stop-history-capture-deferred-exhausted",{worktreeId:b.id,cliToolId:c,instanceId:d,attempts:g.length,elapsedMs:Date.now()-i}),!1}catch(a){return e.warn("stop-history-capture-deferred-failed",{worktreeId:b.id,cliToolId:c,instanceId:d,error:a instanceof Error?a.message:String(a)}),!1}}async function j(a,b,d,k={}){try{let j=await Promise.all([c.e(1503),c.e(8791),c.e(1719),c.e(2119),c.e(2445),c.e(252),c.e(8800),c.e(7905),c.e(255),c.e(9731),c.e(8728),c.e(8918)]).then(c.bind(c,28918));if(!j.isPullTranscriptHistory(b))return{status:"unavailable"};let l={worktreePath:a.path,transcriptPathHint:null},m={};if(await j.captureStructuredHistoryTurn(a.id,b,d,l,m))return{status:"captured"};let n=()=>"not_yet_closed"===m.outcome?Promise.resolve(!0):j.hasStructuredHistoryTranscript(a.id,b,d,l);if(g.has(b)){let c=k.deferredDelaysMs??f;if(0===c.length||!await n())return{status:"unavailable"};let g=i(j,a,b,d,l,c);return e.info("stop-history-capture-deferred",{worktreeId:a.id,cliToolId:b,instanceId:d,delaysMs:c}),{status:"deferred",deferred:g}}let o=k.retryDelayMs??500;if(o<=0||!await n())return{status:"unavailable"};let p=Math.max(1,k.maxAttempts??3);for(let c=2;c<=p;c+=1){await h(o);let f={},g=await j.captureStructuredHistoryTurn(a.id,b,d,l,f);if(e.debug("stop-history-capture-retried",{worktreeId:a.id,cliToolId:b,instanceId:d,attempt:c,maxAttempts:p,captured:g,outcome:f.outcome??"unavailable"}),g)return{status:"captured"}}return{status:"unavailable"}}catch(c){return e.warn("stop-history-capture-failed",{worktreeId:a.id,cliToolId:b,instanceId:d,error:c instanceof Error?c.message:String(c)}),{status:"unavailable"}}}},52767:(a,b,c)=>{c.d(b,{r:()=>i,g:()=>h});var d=c(48524),e=c(87009),f=c(72626);let g=(0,f.h)("lib/tasks/task-transition-service");function h(a,b,c,f){let h=a.transaction(()=>{let g=(0,d.gg)(a,b);if(!g)return null;let h=g.status,i=function(a,b){switch(a){case"pending":switch(b){case"message_sent":return"running";case"send_failed":case"cancel":return"cancelled";default:return null}case"running":switch(b){case"prompt_detected":return"waiting_input";case"agent_idle":return"running";case"verify_started":return"verifying";case"send_failed":return"failed";case"cancel":return"cancelled";default:return null}case"waiting_input":switch(b){case"prompt_answered_auto":case"prompt_answered_human":case"agent_idle":return"running";case"verify_started":return"verifying";case"cancel":return"cancelled";default:return null}case"verifying":switch(b){case"verify_passed":return"succeeded";case"verify_failed":return"failed";case"verify_not_started":return"not_started";case"cancel":return"cancelled";default:return null}case"failed":case"not_started":switch(b){case"message_sent":return"running";case"verify_started":return"verifying";case"cancel":return"cancelled";default:return null}default:return null}}(h,c),j=Date.now(),k=(0,e.P)(a,{taskId:b,event:c,fromStatus:h,toStatus:i,payload:f,createdAt:j});return null===i?{task:g,fromStatus:h,toStatus:null,eventId:k}:{task:(0,d.xZ)(a,b,i,f?.runId===void 0?{}:{lastVerificationRunId:f.runId}),fromStatus:h,toStatus:i,eventId:k}})();return null===h?g.warn("task-event-unknown-task",{taskId:b,event:c}):null===h.toStatus&&g.warn("task-event-rejected",{taskId:b,event:c,fromStatus:h.fromStatus}),h}function i(a,b,c,e,f,i){try{let g=(0,d.MH)(a,b,c,e);if(!g)return null;return h(a,g.id,f,i)}catch(a){return g.warn("task-event-failed",{worktreeId:b,cliToolId:c,instanceId:e,event:f,error:a instanceof Error?a.message:String(a)}),null}}}};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";exports.id=6808,exports.ids=[6808],exports.modules={640:(a,b,c)=>{function d(a){return`[from ${a.alias} / ${a.worktreeId}]`}function e(a,b,c=null){let f=b.trim();return null!==c?`${d(a)}
|
|
2
|
+
${c}
|
|
3
|
+
${""===f?"(no reply body)":f}`:""===f?`${d(a)} (no reply body)`:`${d(a)} ${f}`}c.d(b,{Hr:()=>j,KA:()=>l,Nl:()=>n,Py:()=>g,z0:()=>e});let f={en:"Note: this reply may have been processed in the same turn as another request (overlap={overlap}).",ja:"注意: この返答は、別の依頼と同じターンで処理された可能性があります(overlap={overlap})。"};function g(a,b){return null===b||"none"===b?null:`[CommandMate relay] ${f[a].replace("{overlap}",b)}`}function h(a,b){let c=a.replace(/\s+/g," ").trim();return c.length<=b?c:`${c.slice(0,b-1)}…`}let i={en:{waiting:"is waiting for a confirmation:",options:"Options:",more:"(+{n} more)"},ja:{waiting:"確認待ちです:",options:"選択肢:",more:"(他 {n} 件)"}};function j(a,b,c){let e=i[a],f=`${d(b)} ${e.waiting} ${h(c.question,200)}`;if(0===c.options.length)return f;let g=c.options.slice(0,9),j=c.options.length-g.length,k=g.map(a=>`${a.key}) ${h(a.label,60)}`).join(" "),l=j>0?` ${e.more.replace("{n}",String(j))}`:"";return`${f}
|
|
4
|
+
${e.options} ${k}${l}`}let k={en:"The reply you were waiting for did not arrive within {hours}h; the relay has expired.",ja:"待っていた返信が {hours} 時間以内に届かなかったため、委任は期限切れになりました。"};function l(a,b,c){let e=Math.max(1,Math.round(c/36e5));return`${d(b)} ${k[a].replace("{hours}",String(e))}`}let m={en:{requested:"Delegated to {alias}; waiting for the reply.",replied:"Reply from {alias}.",waiting:"{alias} is waiting for a confirmation.",expired:"The delegation to {alias} expired without a reply."},ja:{requested:"{alias} へ委任、返信待ち",replied:"{alias} から返信",waiting:"{alias} が確認待ち",expired:"{alias} への委任が返信のないまま期限切れ"}};function n(a,b,c,d={}){let e=m[a][b].replace("{alias}",c),f=[];return d.overlap&&f.push(`overlap=${d.overlap}`),d.holdReason&&f.push(`hold=${d.holdReason}`),0===f.length?e:`${e} (${f.join(", ")})`}},3421:(a,b,c)=>{Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(71237),e=c(55088),f=c(17679);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},7329:(a,b,c)=>{c.d(b,{Hv:()=>o,W3:()=>m,uK:()=>n});var d=c(69198),e=c(52660),f=c(18201),g=c(25539),h=c(23854),i=c(85016),j=c(49798),k=c(67164);let l=(0,c(72626).h)("relay-service");function m(a,b){for(let c of[b.from.worktreeId,b.to.worktreeId])if(!(0,j.r)(a,c))return{ok:!1,refusal:{code:"RELAY_WORKTREE_NOT_FOUND",message:`Worktree '${c}' not found`,worktreeId:c}};let c=(0,h.$G)({from:b.from,to:b.to,parentHops:function(a,b){try{let g=(0,j.S)(a,b),h=(0,e.getMessages)(a,b.worktreeId,{limit:5,limitUnit:"pairs",cliToolId:g.cliToolId,instanceId:b.instanceId,matchResolvedInstance:!0}).filter(a=>"user"===a.role),i=h.findIndex(a=>"relay"===a.messageType);if(-1===i)return null;let k=h[i];for(let a=0;a<i;a+=1){var c;if(c=h[a],c.timestamp.getTime()<k.timestamp.getTime()||(0,f.pk)(c.content)!==(0,f.pk)(k.content))return null}let l=(0,e.parseRelayRequestId)(k.requestId);if(!l)return null;return(0,d.Ip)(a,l)?.hops??null}catch(a){return l.warn("relay-parent-lookup-failed",{worktreeId:b.worktreeId,instanceId:b.instanceId,error:a instanceof Error?a.message:String(a)}),null}}(a,b.from),allowRelayChain:!0===b.allowRelayChain,openBetween:(0,d.Oz)(a,b.from,b.to)});if((0,h.Qe)(c))return{ok:!1,refusal:c};let g=b.now??Date.now(),i=(0,d.CR)(a,{from:b.from,to:b.to,hops:c.hops,expiresAt:g+(0,h.AL)(b.ttlMs),now:g,bindMode:!0===b.bind?"bound":"legacy"});return l.info("relay-opened",{relayId:i.id,from:`${i.from.worktreeId}/${i.from.instanceId}`,to:`${i.to.worktreeId}/${i.to.instanceId}`,hops:i.hops,bindMode:i.bindMode}),(0,k._)(a,i.id,"requested",(0,j.S)(a,i.from),(0,j.S)(a,i.to),g),{ok:!0,relay:i}}function n(a,b,c=Date.now()){let e=(0,d.Ip)(a,b);return e?(0,g.Lo)(e.state)&&(0,i.p5)(b)?{ok:!1,reason:"delivering",relay:e}:(0,d.m_)(a,b,c)?(l.info("relay-cancelled",{relayId:b}),{ok:!0,relay:(0,d.Ip)(a,b)??e}):{ok:!1,reason:"already_closed",relay:e}:{ok:!1,reason:"not_found",relay:null}}function o(a,b){return(0,d.M4)(a,b)}},18201:(a,b,c)=>{c.d(b,{Ce:()=>i,pk:()=>g});var d=c(72626),e=c(85038);let f=(0,d.h)("lib/history/user-turn-recorder");function g(a){return a.replace(/\r\n?/g,"\n").split("\n").map(a=>a.replace(/[ \t ]+$/u,"")).join("\n").trim()}function h(a){return{worktreeId:a.worktreeId,cliToolId:a.cliToolId,instanceId:a.instanceId??a.cliToolId}}async function i(a,b,d,j,k={}){let l=a.instanceId??a.cliToolId,m=g(d);if(0===b.length||0===m.length)return{outcome:"skipped",messageId:null,timestampMs:null};try{let[{getDbInstance:i},n,{broadcastMessage:o}]=await Promise.all([Promise.resolve().then(c.bind(c,88807)),Promise.resolve().then(c.bind(c,52660)),Promise.resolve().then(c.bind(c,43015))]),p=i(),q=n.findMessageByRequestId(p,a.worktreeId,b);if(q)return{outcome:"already-recorded",messageId:q.id,timestampMs:q.timestamp.getTime()};if(!(0,e.fp)(a))return f.info("user-turn-record-refused",{...h(a),requestId:b,generation:(0,e.Bh)()?.generation}),{outcome:"refused",messageId:null,timestampMs:null};let r=j>0?j:Date.now(),s=function(a,b,c,d,e,i,j,k){var l,m,n;let o=Math.min(j-12e4,k.adoptionFromMs??1/0),p=(l=a.findUnkeyedUserMessages(b,{worktreeId:c.worktreeId,cliToolId:c.cliToolId,instanceId:d,fromMs:o,toMs:j+12e4,includeRelayDelivered:!0}),m=i,n=j,l.filter(a=>g(a.content)===m).sort((a,b)=>Math.abs(a.timestamp.getTime()-n)-Math.abs(b.timestamp.getTime()-n)));for(let d of p)if(!d.requestId&&a.setMessageRequestId(b,d.id,e))return f.info("user-turn-adopted",{...h(c),requestId:e,messageId:d.id,driftMs:d.timestamp.getTime()-j}),{outcome:"adopted",messageId:d.id,timestampMs:d.timestamp.getTime()};let q=p.find(a=>a.requestId);return q?(f.info("user-turn-already-relayed",{...h(c),requestId:e,messageId:q.id,relayRequestId:q.requestId??null,driftMs:q.timestamp.getTime()-j}),{outcome:"already-recorded",messageId:q.id,timestampMs:q.timestamp.getTime()}):null}(n,p,a,l,b,m,r,k);if(s)return s;let t=n.createMessage(p,{worktreeId:a.worktreeId,role:"user",content:d,messageType:"normal",timestamp:new Date(r),cliToolId:a.cliToolId,instanceId:l,requestId:b});return o("message",{worktreeId:a.worktreeId,message:t}),f.info("user-turn-recorded",{...h(a),requestId:b,contentLength:d.length}),{outcome:"inserted",messageId:t.id,timestampMs:r}}catch(c){return f.error("user-turn-record-failed",{...h(a),requestId:b,error:c instanceof Error?c.message:String(c)}),{outcome:"failed",messageId:null,timestampMs:null}}}},49798:(a,b,c)=>{c.d(b,{S:()=>h,r:()=>i});var d=c(28274),e=c(73753),f=c(83530);let g=(0,c(72626).h)("relay-session-ref");function h(a,b){let c="claude",e=b.instanceId;try{c=(0,f.iK)(a,b.worktreeId,{instanceId:b.instanceId}).cliToolId;let g=(0,d.BN)(a,b.worktreeId,b.instanceId);g?.alias&&(e=g.alias)}catch(a){g.warn("relay-session-resolve-failed",{worktreeId:b.worktreeId,instanceId:b.instanceId,error:a instanceof Error?a.message:String(a)})}return{worktreeId:b.worktreeId,instanceId:b.instanceId,cliToolId:c,alias:e}}function i(a,b){try{return null!==(0,e.getWorktreeById)(a,b)}catch{return!1}}},67164:(a,b,c)=>{c.d(b,{_:()=>i});var d=c(52660),e=c(55233),f=c(43015),g=c(640);let h=(0,c(72626).h)("relay-system-line");function i(a,b,c,j,k,l=Date.now(),m={}){let n=`${d.RELAY_SYSTEM_REQUEST_ID_PREFIX}${b}:${c}`;try{if((0,d.findMessageByRequestId)(a,j.worktreeId,n))return!1;let i=(0,e.dV)(a),o=(0,d.createRelaySystemMessage)(a,{worktreeId:j.worktreeId,cliToolId:j.cliToolId,instanceId:j.instanceId,content:(0,g.Nl)(i,c,k.alias,m),relayId:b,kind:c,at:l});try{(0,f.broadcastMessage)("message",{worktreeId:j.worktreeId,message:{...o,cliToolId:j.cliToolId,instanceId:j.instanceId}})}catch(a){h.warn("relay-system-line-broadcast-failed",{relayId:b,kind:c,error:a instanceof Error?a.message:String(a)})}return!0}catch(a){return h.warn("relay-system-line-failed",{relayId:b,kind:c,error:a instanceof Error?a.message:String(a)}),!1}}},83530:(a,b,c)=>{c.d(b,{FH:()=>l,fV:()=>k,iK:()=>i,y4:()=>h});var d=c(73753),e=c(28274),f=c(15194);let g="claude",h="instance_tool_conflict";function i(a,b,c={}){let{instanceId:d,requestedCliTool:g}=c;if(!d)return g?{cliToolId:g,instanceId:g,resolvedBy:"explicit"}:j(a,b,void 0);let h=(0,e.BN)(a,b,d);if(h&&(0,f.hR)(h.cliTool)){let a={cliToolId:h.cliTool,instanceId:d,resolvedBy:"roster"};return g&&g!==h.cliTool&&(a.conflict={instanceId:d,rosterCliTool:h.cliTool,requestedCliTool:g}),a}return g?(0,f.hR)(d)&&g!==d?{cliToolId:d,instanceId:d,resolvedBy:"primary",conflict:{instanceId:d,rosterCliTool:d,requestedCliTool:g,primaryAnchor:!0}}:{cliToolId:g,instanceId:d,resolvedBy:"explicit"}:(0,f.hR)(d)?{cliToolId:d,instanceId:d,resolvedBy:"primary"}:j(a,b,d)}function j(a,b,c){let e=(0,d.getWorktreeById)(a,b),h=e?.cliToolId;return h&&(0,f.hR)(h)?{cliToolId:h,instanceId:c??h,resolvedBy:"worktree-default"}:{cliToolId:g,instanceId:c??g,resolvedBy:"fallback"}}function k(a,b,c={}){let d=i(a,b,c);return d.conflict?{ok:!1,error:h,conflict:d.conflict}:{ok:!0,target:d}}function l(a){return a.primaryAnchor?`Agent instance '${a.instanceId}' is the primary instance of ${a.rosterCliTool}, but ${a.requestedCliTool} was requested. Omit the agent, pass ${a.rosterCliTool}, or target a ${a.requestedCliTool} instance instead.`:`Agent instance '${a.instanceId}' is registered as ${a.rosterCliTool}, but ${a.requestedCliTool} was requested. Omit the agent, pass ${a.rosterCliTool}, or update the instance's roster entry.`}},85016:(a,b,c)=>{c.d(b,{dJ:()=>f,o5:()=>e,p5:()=>g});let d=(0,c(36925).v)("__relayDeliveryClaims",()=>new Set);function e(a){d.add(a)}function f(a){d.delete(a)}function g(a){return d.has(a)}},95736:(a,b,c)=>{a.exports=c(44870)}};
|