commandmate 0.41.1 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +118 -118
- package/.next/app-path-routes-manifest.json +25 -25
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/update/route.js +1 -1
- package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/versions/route.js +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.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 +1 -1
- package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/claude-done/route.js +2 -2
- package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/permission-request/route.js +1 -1
- package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/relays/[relayId]/cancel/route.js +1 -1
- package/.next/server/app/api/relays/[relayId]/cancel/route.js.nft.json +1 -1
- package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/relays/route.js +1 -1
- package/.next/server/app/api/relays/route.js.nft.json +1 -1
- package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/clone/route.js +1 -1
- package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/restore/route.js +1 -1
- package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/route.js +1 -1
- package/.next/server/app/api/repositories/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/scan/route.js +1 -1
- package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/sync/route.js +1 -1
- package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/default-agents/route.js +1 -1
- package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/slash-commands/route.js.nft.json +1 -1
- package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/direct-input/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/direct-input/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/direct-input/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/route.js +103 -1
- package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route.js +103 -1
- package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +1 -103
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/slash-commands/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tasks/route.js +2 -2
- package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -103
- package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/config/route.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_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/route.js +1 -1
- package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
- package/.next/server/app/more/page_client-reference-manifest.js +1 -1
- package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
- package/.next/server/app/review/page_client-reference-manifest.js +1 -1
- package/.next/server/app/sessions/page_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 +9 -9
- 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 +25 -25
- package/.next/server/chunks/1068.js +1 -0
- package/.next/server/chunks/1210.js +1 -1
- package/.next/server/chunks/1501.js +5 -5
- package/.next/server/chunks/1990.js +103 -0
- package/.next/server/chunks/2119.js +1 -1
- package/.next/server/chunks/2445.js +1 -1
- package/.next/server/chunks/3241.js +1 -1
- package/.next/server/chunks/3707.js +1 -1
- package/.next/server/chunks/3718.js +1 -0
- package/.next/server/chunks/434.js +1 -1
- package/.next/server/chunks/4443.js +1 -1
- package/.next/server/chunks/5164.js +1 -1
- package/.next/server/chunks/5775.js +1 -0
- package/.next/server/chunks/611.js +1 -0
- package/.next/server/chunks/6130.js +1 -1
- package/.next/server/chunks/650.js +1 -1
- package/.next/server/chunks/6781.js +1 -1
- package/.next/server/chunks/7905.js +1 -1
- package/.next/server/chunks/8581.js +1 -1
- package/.next/server/chunks/8583.js +1 -1
- package/.next/server/chunks/8673.js +2 -2
- package/.next/server/chunks/8728.js +3 -3
- package/.next/server/chunks/8791.js +1 -0
- package/.next/server/chunks/8800.js +1 -1
- package/.next/server/chunks/8918.js +1 -103
- package/.next/server/chunks/9130.js +2 -2
- package/.next/server/chunks/964.js +1 -1
- package/.next/server/chunks/9731.js +3 -3
- package/.next/server/chunks/9882.js +3 -3
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{1642-fb2e176aaadbd137.js → 1642-767aed8e7c61ef7f.js} +1 -1
- package/.next/static/chunks/{2407-7bd75de2f6be3692.js → 2407-faae66d204748f7b.js} +1 -1
- package/.next/static/chunks/{2619-04bc32f026a0d946.js → 2619-a305ad4810f1393a.js} +1 -1
- package/.next/static/chunks/7705-2a2936551b0cf9a3.js +1 -0
- package/.next/static/chunks/8165-235859c6930f01b1.js +1 -0
- package/.next/static/chunks/app/{layout-51fa91ea833c97fc.js → layout-9a715043610e4e27.js} +1 -1
- package/.next/static/chunks/app/worktrees/[id]/page-61dd928d635db590.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/terminal/{page-373ea37b16d930c7.js → page-c601f3b3ece6557e.js} +1 -1
- package/.next/static/css/{974314e796232f53.css → b3f433d52b8ed5c8.css} +1 -1
- package/.next/trace +13 -13
- package/dist/cli/commands/attach.d.ts +6 -4
- package/dist/cli/commands/attach.d.ts.map +1 -1
- package/dist/cli/commands/attach.js +36 -5
- package/dist/cli/commands/instances.d.ts.map +1 -1
- package/dist/cli/commands/instances.js +5 -0
- package/dist/cli/commands/ls.d.ts.map +1 -1
- package/dist/cli/commands/ls.js +19 -9
- package/dist/cli/commands/whoami.d.ts +9 -25
- package/dist/cli/commands/whoami.d.ts.map +1 -1
- package/dist/cli/commands/whoami.js +18 -42
- package/dist/cli/types/api-responses.d.ts +37 -0
- package/dist/cli/types/api-responses.d.ts.map +1 -1
- package/dist/lib/cli-tools/session-name.d.ts +72 -4
- package/dist/lib/cli-tools/session-name.d.ts.map +1 -1
- package/dist/lib/cli-tools/session-name.js +115 -12
- package/dist/lib/detection/tools/verified-against.d.ts +11 -2
- package/dist/lib/detection/tools/verified-against.d.ts.map +1 -1
- package/dist/lib/detection/tools/verified-against.js +11 -2
- package/dist/lib/session/tmux-session-surface.d.ts +9 -7
- package/dist/lib/session/tmux-session-surface.d.ts.map +1 -1
- package/dist/lib/session/tmux-session-surface.js +15 -8
- package/dist/lib/tmux/legacy-session-alias.d.ts +43 -0
- package/dist/lib/tmux/legacy-session-alias.d.ts.map +1 -0
- package/dist/lib/tmux/legacy-session-alias.js +64 -0
- package/dist/lib/verification/verify-config.d.ts +21 -0
- package/dist/lib/verification/verify-config.d.ts.map +1 -1
- package/dist/lib/verification/verify-config.js +54 -1
- package/dist/server/locales/en/worktree.json +4 -1
- package/dist/server/locales/ja/worktree.json +4 -1
- package/dist/server/server.js +29 -0
- package/dist/server/src/lib/auto-yes-poller.js +15 -0
- package/dist/server/src/lib/cli-tools/antigravity.js +1 -1
- package/dist/server/src/lib/cli-tools/base.js +10 -1
- package/dist/server/src/lib/cli-tools/codex.js +1 -1
- package/dist/server/src/lib/cli-tools/command-code.js +1 -1
- package/dist/server/src/lib/cli-tools/copilot.js +1 -1
- package/dist/server/src/lib/cli-tools/gemini.js +1 -1
- package/dist/server/src/lib/cli-tools/legacy-session-adoption.js +19 -0
- package/dist/server/src/lib/cli-tools/opencode.js +1 -1
- package/dist/server/src/lib/cli-tools/session-name.js +115 -12
- package/dist/server/src/lib/cli-tools/session-namespace.js +55 -0
- package/dist/server/src/lib/cli-tools/session-ownership.js +21 -0
- package/dist/server/src/lib/cli-tools/vibe-local.js +1 -1
- package/dist/server/src/lib/cli-tools/worktree-session-ownership.js +28 -0
- package/dist/server/src/lib/db/app-settings-db.js +29 -0
- package/dist/server/src/lib/detection/cli-patterns.js +46 -8
- package/dist/server/src/lib/detection/tools/codex/cli-patterns.js +8 -2
- package/dist/server/src/lib/detection/tools/codex/detect.js +8 -1
- package/dist/server/src/lib/detection/tools/codex/prompt.js +6 -2
- package/dist/server/src/lib/detection/tools/verified-against.js +11 -2
- package/dist/server/src/lib/hooks/sources/codex/hooks-config.js +77 -2
- package/dist/server/src/lib/polling/auto-yes-dialog-gate.js +77 -1
- package/dist/server/src/lib/realtime/terminal-broadcast.js +11 -0
- package/dist/server/src/lib/session/adopt-legacy-sessions.js +89 -0
- package/dist/server/src/lib/session/claude-session.js +13 -10
- package/dist/server/src/lib/session/current-output-builder.js +18 -0
- package/dist/server/src/lib/session/send-user-message.js +26 -0
- package/dist/server/src/lib/session/session-instance-targets.js +53 -0
- package/dist/server/src/lib/session/tmux-session-surface.js +15 -8
- package/dist/server/src/lib/session/worktree-session-reconcile.js +101 -56
- package/dist/server/src/lib/session-cleanup.js +33 -3
- package/dist/server/src/lib/tmux/legacy-session-alias.js +64 -0
- package/dist/server/src/lib/tmux/session-hook-scripts.js +12 -4
- package/dist/server/src/lib/tmux/session-ownership.js +174 -0
- package/dist/server/src/lib/tmux/tmux.js +13 -3
- package/dist/server/src/lib/verification/env-clean-gate.js +46 -14
- package/dist/server/src/lib/verification/gate-runner.js +1 -0
- package/dist/server/src/lib/verification/verify-config.js +54 -1
- package/dist/server/src/lib/ws-server.js +11 -0
- package/package.json +1 -1
- package/release-notes/0.42.0.json +62 -0
- package/.next/server/chunks/3323.js +0 -1
- package/.next/server/chunks/7075.js +0 -1
- package/.next/server/chunks/9080.js +0 -1
- package/.next/static/chunks/7705-25076b57224da370.js +0 -1
- package/.next/static/chunks/8165-d3b7c8a7aa776bc7.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/page-1e6300dd50cd9a4d.js +0 -1
- /package/.next/static/{_fBjTkjoWfOqdjl2SeMIN → EbTDBXcXRpFNH4eom-HVv}/_buildManifest.js +0 -0
- /package/.next/static/{_fBjTkjoWfOqdjl2SeMIN → EbTDBXcXRpFNH4eom-HVv}/_ssgManifest.js +0 -0
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## タスク
|
|
4
4
|
${a.goal}`}},49987:(a,b,c)=>{c.d(b,{H:()=>l,Iq:()=>i,M:()=>k,xL:()=>o});var d=c(29021),e=c(21820),f=c(33873),g=c(55511);let h=(0,c(72626).h)("lib/verification/machine-lock"),i="locks",j="owner";function k(a,b){return(0,f.join)(b,`${a}.lock`)}function l(a=process.env){let b=a.CM_VERIFY_LOCK_ROOT;return b&&""!==b.trim()?b:(0,f.join)((0,e.homedir)(),".commandmate",i)}function m(a){try{let b=JSON.parse((0,d.readFileSync)((0,f.join)(a,j),"utf8"));if("number"!=typeof b.pid||"string"!=typeof b.token)return null;return{pid:b.pid,host:"string"==typeof b.host?b.host:"",token:b.token,acquiredAt:"number"==typeof b.acquiredAt?b.acquiredAt:0}}catch{return null}}function n(a){return a?`pid ${a.pid} on ${a.host||"unknown host"}`:null}async function o(a,b){let c=b.root??l(),i=b.pollIntervalMs??250,o=k(a,c),p=Date.now(),q=p+Math.max(0,b.timeoutMs),r=(0,g.randomUUID)();(0,d.mkdirSync)(c,{recursive:!0});let s=new Set;for(;;){if(b.shouldAbandon?.())return{acquired:!1,waitedMs:Date.now()-p,heldBy:n(m(o)),abandoned:!0};if(function(a,b){try{(0,d.mkdirSync)(a)}catch(a){if("EEXIST"===a.code)return!1;throw a}return(0,d.writeFileSync)((0,f.join)(a,j),JSON.stringify(b),{encoding:"utf8"}),!0}(o,{pid:process.pid,host:(0,e.hostname)(),token:r,acquiredAt:Date.now()}))return{acquired:!0,waitedMs:Date.now()-p,handle:{name:a,path:o,release:()=>{let a=m(o);if(!a||a.token===r)try{(0,d.rmSync)(o,{recursive:!0,force:!0})}catch(a){h.warn("machine-lock-release-failed",{lockPath:o,error:a instanceof Error?a.message:String(a)})}}}};let c=m(o);if(c&&!s.has(c.token)&&function(a){if(a.host!==(0,e.hostname)())return!1;try{return process.kill(a.pid,0),!1}catch(a){return"ESRCH"===a.code}}(c)){s.add(c.token);let a=m(o);if(a&&a.token===c.token)try{(0,d.rmSync)(o,{recursive:!0,force:!0}),h.warn("machine-lock-broken-stale",{lockPath:o,pid:c.pid})}catch{}continue}let g=Date.now();if(g>=q)return{acquired:!1,waitedMs:g-p,heldBy:n(c)};await function(a){return new Promise(b=>setTimeout(b,a))}(Math.min(i,q-g))}}},53604:(a,b,c)=>{c.d(b,{Cr:()=>k,L8:()=>i});var d=c(55511),e=c(29021),f=c(21820),g=c(33873);let h=(0,c(72626).h)("lib/verification/worktree-index"),i="worktree-index";function j(a,b){try{return(0,e.readFileSync)((0,g.join)(a,b),"utf8").trim()}catch{return null}}function k(a,b={}){let c=b.root??function(a=process.env){let b=a.CM_VERIFY_WORKTREE_INDEX_ROOT;return b&&""!==b.trim()?b:(0,g.join)((0,f.homedir)(),".commandmate",i)}();try{(0,e.mkdirSync)(c,{recursive:!0});let b=new Set;for(let d of(0,e.readdirSync)(c))if(/^\d+$/.test(d)){if(j(c,d)===a)return Number(d);b.add(Number(d))}for(let d=0;d<1024;d++)if(!b.has(d)&&function(a,b,c){try{return(0,e.writeFileSync)((0,g.join)(a,String(b)),`${c}
|
|
5
|
-
`,{encoding:"utf8",flag:"wx"}),!0}catch(d){if("EEXIST"!==d.code)throw d;return j(a,String(b))===c}}(c,d,a))return d;h.warn("worktree-index-exhausted",{worktreeId:a,root:c})}catch(b){h.warn("worktree-index-unavailable",{worktreeId:a,root:c,error:b instanceof Error?b.message:String(b)})}return Number.parseInt((0,d.createHash)("sha256").update(a).digest("hex").slice(0,8),16)%1024}},74985:(a,b,c)=>{c.d(b,{Uq:()=>j,uT:()=>q,vQ:()=>
|
|
6
|
-
${function(a){let b=[];for(let c of a.probes){let a=g.J6[c.probeId];if("unknown"===c.status){b.push(` ${c.probeId} UNKNOWN (${a}): ${c.reason??"no reason recorded"}`);continue}if("clean"===c.status){let d=c.ignoredAdded.length>0?` (${c.ignoredAdded.length} addition(s) attributed to another worktree)`:"";b.push(` ${c.probeId} clean (${a})${d}`),b.push(...
|
|
7
|
-
UNKNOWN is not a pass: at least one probe could not be compared, so the environment was not measured.`,null):e("failed",`${
|
|
8
|
-
Anything listed under "+" was started or created during this task and left behind — stop it by PID and remove it. The one exception is a "+" line marked "task session, excused": that is the agent session this delegation itself started, it is not counted, and it must be left running. Anything under "-" existed when the task started and is now gone — it was killed or deleted; restart or restore it. Never stop a process by pattern (\`pkill -f\`): it takes every process whose command line matches, which is how the production server was stopped in #1739.`,1)}},77142:(a,b,c)=>{c.d(b,{
|
|
9
|
-
${a.map(a=>` - ${a}`).join("\n")}`),this.name="VerifyConfigError",this.issues=a}}function t(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function u(a){return"number"==typeof a?Number.isInteger(a)?a:null:"string"==typeof a&&/^-?\d+$/.test(a)?Number(a):null}function v(a){return"boolean"==typeof a?a:"true"===a||"false"!==a&&null}function w(a){return void 0===a?"nothing":null===a?"null":"string"==typeof a?JSON.stringify(a):Array.isArray(a)?"a list":"object"==typeof a?"a mapping":String(a)}function x(a,b,c,d){for(let e of Object.keys(a))b.includes(e)||d.push(`${c}: unknown key "${e}" (v1 is a closed set)`)}function y(a,b,c){if(!Array.isArray(a))return c.push(`${b}: must be a list (got ${w(a)})`),[];let d=[],e=new Set;return a.forEach((a,f)=>{!function(a,b,c,d,e){let f,g,h,i=e.length;if(!t(a))return e.push(`${b}: must be a mapping (got ${w(a)})`);x(a,q,b,e),"string"!=typeof a.id||""===a.id?e.push(`${b}.id: required, must be a non-empty string (got ${w(a.id)})`):n.test(a.id)?j.includes(a.id)?e.push(`${b}.id: "${a.id}" is reserved for a built-in gate`):c.has(a.id)?e.push(`${b}.id: duplicate gate id "${a.id}"`):c.add(a.id):e.push(`${b}.id: "${a.id}" must match ${n.source}`),("string"!=typeof a.command||""===a.command.trim())&&e.push(`${b}.command: required, must be a non-empty string (got ${w(a.command)})`);let k=m;if(void 0!==a.timeoutSec){let c=u(a.timeoutSec);null===c?e.push(`${b}.timeoutSec: must be an integer (got ${w(a.timeoutSec)})`):c<1||c>7200?e.push(`${b}.timeoutSec: must be 1..7200 (got ${c})`):k=c}if(void 0!==a.mutex&&("string"!=typeof a.mutex||""===a.mutex?e.push(`${b}.mutex: must be a non-empty string (got ${w(a.mutex)})`):a.mutex.length>64?e.push(`${b}.mutex: must be at most 64 characters (got ${a.mutex.length})`):o.test(a.mutex)?f=a.mutex:e.push(`${b}.mutex: "${a.mutex}" must match ${o.source}`)),void 0!==a.retryOnFail){let c=u(a.retryOnFail);null===c?e.push(`${b}.retryOnFail: must be an integer (got ${w(a.retryOnFail)})`):c<0||c>1?e.push(`${b}.retryOnFail: must be 0 or 1 (got ${c})`):g=c}if(void 0!==a.flakyIsPass){let c=v(a.flakyIsPass);null===c?e.push(`${b}.flakyIsPass: must be true or false (got ${w(a.flakyIsPass)})`):c&&1!==g?e.push(`${b}.flakyIsPass: true requires retryOnFail: 1 (without a retry a gate can never be FLAKY)`):h=c}if(e.length===i){let b={id:a.id,command:a.command,timeoutSec:k};void 0!==f&&(b.mutex=f),void 0!==g&&(b.retryOnFail=g),void 0!==h&&(b.flakyIsPass=h),d.push(b)}}(a,`${b}[${f}]`,e,d,c)}),d}function z(a){let b,c=(0,e.join)(a,k);try{b=(0,d.readFileSync)(c,"utf8")}catch(a){if("ENOENT"===a.code)return null;throw new s([`${c}: ${a.message}`])}return function(a,b){var c;let d;try{d=(0,f.qg)(a)}catch(a){throw new s([`${b}: YAML parse error: ${a.message}`])}if(!t(d))throw new s([`${b}: expected a YAML mapping at the top level (got ${w(d)})`]);let e=[];x(d,p,"top level",e),"version"in d?1!==u(d.version)&&e.push(`version: must be 1 (got ${w(d.version)})`):e.push('version: required, v1 configs must declare "version: 1"');let g=(c=d.gates,null==c?(e.push("gates: required, at least one gate must be defined"),[]):Array.isArray(c)&&0===c.length?(e.push("gates: at least one gate must be defined"),[]):y(c,"gates",e)),h=function(a,b){let c={baseRef:null,skipInPrimaryCheckout:!0,maxLogTailBytes:8192,requireCommit:!1,requireEnvClean:!1};if(null==a)return c;if(!t(a))return b.push(`options: must be a mapping (got ${w(a)})`),c;if(x(a,r,"options",b),void 0!==a.baseRef&&("string"!=typeof a.baseRef||""===a.baseRef.trim()?b.push(`options.baseRef: must be a non-empty string (got ${w(a.baseRef)})`):c.baseRef=a.baseRef),void 0!==a.skipInPrimaryCheckout){let d=v(a.skipInPrimaryCheckout);null===d?b.push(`options.skipInPrimaryCheckout: must be true or false (got ${w(a.skipInPrimaryCheckout)})`):c.skipInPrimaryCheckout=d}if(void 0!==a.requireCommit){let d=v(a.requireCommit);null===d?b.push(`options.requireCommit: must be true or false (got ${w(a.requireCommit)})`):c.requireCommit=d}if(void 0!==a.requireEnvClean){let d=v(a.requireEnvClean);null===d?b.push(`options.requireEnvClean: must be true or false (got ${w(a.requireEnvClean)})`):c.requireEnvClean=d}if(void 0!==a.maxLogTailBytes){let d=u(a.maxLogTailBytes);null===d?b.push(`options.maxLogTailBytes: must be an integer (got ${w(a.maxLogTailBytes)})`):d<0||d>1048576?b.push(`options.maxLogTailBytes: must be 0..1048576 (got ${d})`):c.maxLogTailBytes=d}return c}(d.options,e);if(e.length>0)throw new s(e);return{version:1,gates:g,options:h}}(b,c)}}};
|
|
5
|
+
`,{encoding:"utf8",flag:"wx"}),!0}catch(d){if("EEXIST"!==d.code)throw d;return j(a,String(b))===c}}(c,d,a))return d;h.warn("worktree-index-exhausted",{worktreeId:a,root:c})}catch(b){h.warn("worktree-index-unavailable",{worktreeId:a,root:c,error:b instanceof Error?b.message:String(b)})}return Number.parseInt((0,d.createHash)("sha256").update(a).digest("hex").slice(0,8),16)%1024}},74985:(a,b,c)=>{c.d(b,{Uq:()=>j,uT:()=>q,vQ:()=>l});var d=c(33873),e=c(40964),f=c(15194),g=c(77142),h=c(90384);let i=`options.requireEnvClean (${h.aT})`;function j(a,b){let c=[];return b?.options.requireEnvClean&&c.push(i),a&&!0===a.success.requireEnvClean&&c.push("success.requireEnvClean (task contract)"),{required:c.length>0,sources:c}}function k(a,b,c){switch(a){case"tmux-sessions":return function(a,b){let c=(0,e.NN)(a);if(!c)return"unattributed";let d=c.rest;return d===b||d.startsWith(`${b}-`)?"self":"other"}(b.key,c.worktreeId);case"listeners":return function(a,b){if(!a)return"unattributed";let c=(0,d.resolve)(b),e=(0,d.resolve)(a);if(e===c||e.startsWith(c+d.sep))return"self";let f=(0,d.dirname)(c);return e!==f&&e.startsWith(f+d.sep)?"other":"unattributed"}(b.anchor,c.worktreePath);default:return"unattributed"}}function l(a,b){return{...a,taskSession:function(a){if(!(0,f.hR)(a.cliToolId))return null;try{return(0,e.mf)(a.cliToolId,a.worktreeId,a.instanceId??void 0)}catch{return null}}(b)}}function m(a,b){return{key:a.key,detail:a.detail,owner:b}}function n(a,b){let c=b.slice(0,25),d=b.length-c.length,e=c.map(b=>{let c=b.detail?` ${b.detail}`:"";return` ${a} ${b.key}${c} [${b.owner}]`});return d>0&&e.push(` ... and ${d} more`),e}function o(a){return a.map(a=>{let b=a.detail?` ${a.detail}`:"";return` + ${a.key}${b} [task session, excused]`})}function p(a){if(0===a.length)return[];let b=a.map(a=>a.key).join(", ");return[` ignored (options.envCleanIgnoreHomeEntries): ${b}`]}async function q(a){var b;let c,d=Date.now(),e=(a,b,c)=>({status:a,exitCode:c,startedAt:d,durationMs:Date.now()-d,logTail:b});if(!a.baseline)return e("error",function(a,b){let c=a?`task ${a}`:"this run",d=b.length>0?b.join(" and "):"nothing";return`${h.Q5}: UNKNOWN — no baseline snapshot exists for ${c}, so nothing can be compared. This is NOT "the environment is unchanged": no measurement was taken. A baseline is recorded when the task is created (\`send --contract\`) and only while the gate is switched on (currently: ${d}). Switch it on, then re-send the task.`}(a.taskId,a.sources),null);let f=a.capture??(()=>(0,g._8)({worktreeId:a.worktreeId}));try{c=await f()}catch(a){return e("error",`${h.Q5}: UNKNOWN — the current snapshot could not be taken: ${a instanceof Error?a.message:String(a)}`,null)}let i=function(a,b,c,d={}){let e=function(a){if(!("taskSession"in a))return;let b=a.taskSession;return"string"==typeof b&&""!==b?b:null}(a),f=new Set(d.ignoreHomeEntries??[]),h=g.I1.map(d=>{let g=a.probes[d],h=b.probes[d];if(!g||"ok"!==g.status)return{probeId:d,status:"unknown",reason:`baseline probe unavailable: ${g?.reason??"not recorded"}`,added:[],ignoredAdded:[],taskSessionAdded:[],removed:[],ignoredByConfig:[]};if(!h||"ok"!==h.status)return{probeId:d,status:"unknown",reason:`current probe unavailable: ${h?.reason??"not recorded"}`,added:[],ignoredAdded:[],taskSessionAdded:[],removed:[],ignoredByConfig:[]};let i=new Set(g.entries.map(a=>a.key)),j=new Set(h.entries.map(a=>a.key)),l=a=>"home-entries"===d&&f.has(a.key),n=[],o=[],p=[],q=[];for(let a of h.entries){if(i.has(a.key))continue;let b=k(d,a,c);if(l(a)){q.push(m(a,b));continue}if("tmux-sessions"===d&&e&&a.key===e){p.push(m(a,b));continue}("other"===b?o:n).push(m(a,b))}let r=[];for(let a of g.entries){if(j.has(a.key))continue;let b=m(a,k(d,a,c));(l(a)?q:r).push(b)}return{probeId:d,status:n.length+r.length>0?"violated":"clean",reason:null,added:n,ignoredAdded:o,taskSessionAdded:p,removed:r,ignoredByConfig:q}});return{status:h.some(a=>"violated"===a.status)?"violated":h.some(a=>"unknown"===a.status)?"unknown":"clean",taskSession:e,probes:h}}(a.baseline,c,a,{ignoreHomeEntries:a.ignoreHomeEntries}),j=`${h.Q5}: baseline=${new Date(a.baseline.capturedAt).toISOString()} status=${i.status} task-session=${void 0===(b=i.taskSession)?"unrecorded (baseline predates #2472; nothing excused)":null===b?"unresolved (nothing excused)":b}`,l=`${j}
|
|
6
|
+
${function(a){let b=[];for(let c of a.probes){let a=g.J6[c.probeId];if("unknown"===c.status){b.push(` ${c.probeId} UNKNOWN (${a}): ${c.reason??"no reason recorded"}`);continue}if("clean"===c.status){let d=c.ignoredAdded.length>0?` (${c.ignoredAdded.length} addition(s) attributed to another worktree)`:"";b.push(` ${c.probeId} clean (${a})${d}`),b.push(...o(c.taskSessionAdded)),b.push(...p(c.ignoredByConfig));continue}for(let d of(b.push(` ${c.probeId} VIOLATED (${a}): +${c.added.length} -${c.removed.length}`),b.push(...n("+",c.added)),b.push(...n("-",c.removed)),b.push(...o(c.taskSessionAdded)),b.push(...p(c.ignoredByConfig)),c.ignoredAdded))b.push(` \xb7 ${d.key} (ignored: belongs to another worktree)`)}return b.join("\n")}(i)}`;return"clean"===i.status?e("passed",l,0):"unknown"===i.status?e("error",`${l}
|
|
7
|
+
UNKNOWN is not a pass: at least one probe could not be compared, so the environment was not measured.`,null):e("failed",`${l}
|
|
8
|
+
Anything listed under "+" was started or created during this task and left behind — stop it by PID and remove it. The one exception is a "+" line marked "task session, excused": that is the agent session this delegation itself started, it is not counted, and it must be left running. Anything under "-" existed when the task started and is now gone — it was killed or deleted; restart or restore it. Never stop a process by pattern (\`pkill -f\`): it takes every process whose command line matches, which is how the production server was stopped in #1739.`,1)}},77142:(a,b,c)=>{c.d(b,{I1:()=>m,J6:()=>n,_8:()=>z,dV:()=>D,g9:()=>E});var d=c(79646),e=c(29021),f=c(21820),g=c(33873),h=c(87447),i=c(72626),j=c(49987),k=c(53604);let l=(0,i.h)("lib/verification/env-snapshot"),m=["listeners","tmux-sessions","home-entries","commandmate-entries"],n={listeners:"CommandMate TCP listeners","tmux-sessions":"mcbd-* tmux sessions","home-entries":"$HOME entries","commandmate-entries":"~/.commandmate entries"},o={run:function(a,b){return new Promise(c=>{(0,d.execFile)(a,b,{timeout:5e3,maxBuffer:4194304,encoding:"utf8"},(b,d,e)=>b?"number"!=typeof b.code||b.killed?void c({code:null,stdout:d,stderr:e,failure:b.killed?`${a} exceeded 5000ms and was terminated`:`${a} could not be run: ${b.message}`}):void c({code:b.code,stdout:d,stderr:e,failure:null}):void c({code:0,stdout:d,stderr:e,failure:null}))})},readDir:a=>(0,e.readdirSync)(a),homeDir:()=>(0,f.homedir)()},p=/commandmate|dist\/server\/server\.js|next-server|next (dev|start)|server\.ts/i;function q(a){let b=[],c=null;for(let d of a.split("\n")){if(""===d)continue;let a=d[0],e=d.slice(1);if("p"===a){let a=Number(e);if(!Number.isInteger(a)){c=null;continue}c={pid:a,fields:new Map},b.push(c);continue}if(!c)continue;let f=c.fields.get(a);f?f.push(e):c.fields.set(a,[e])}return b}function r(a){return{status:"unavailable",entries:[],reason:a}}function s(a){let b=new Map;for(let c of a)b.has(c.key)||b.set(c.key,c);return{status:"ok",entries:[...b.values()].sort((a,b)=>a.key<b.key?-1:+(a.key>b.key)),reason:null}}async function t(a){let b=await a.run("lsof",["-nP","-iTCP","-sTCP:LISTEN","-F","pcn"]);if(null!==b.failure)return r(b.failure);if(0!==b.code&&1!==b.code)return r(`lsof exited ${b.code}: ${b.stderr.trim()||"no diagnostic output"}`);let c=q(b.stdout);if(0===c.length)return s([]);let d=await a.run("ps",["-A","-o","pid=,command="]);if(null!==d.failure||0!==d.code)return r(d.failure??`ps exited ${d.code}: ${d.stderr.trim()||"no diagnostic output"}`);let e=function(a){let b=new Map;for(let c of a.split("\n")){let a=/^\s*(\d+)\s+(.*)$/.exec(c);a&&b.set(Number(a[1]),a[2].trim())}return b}(d.stdout),f=c.filter(a=>{let b=e.get(a.pid);return void 0!==b&&p.test(b)});if(0===f.length)return s([]);let g=new Map,h=f.map(a=>String(a.pid)),i=await a.run("lsof",["-a","-d","cwd","-p",h.join(","),"-F","pn"]);if(null===i.failure&&(0===i.code||1===i.code))for(let a of q(i.stdout)){let[b]=a.fields.get("n")??[];b&&g.set(a.pid,b)}let j=[];for(let a of f){let b=a.fields.get("c")?.[0]??"unknown";for(let c of a.fields.get("n")??[]){let d=function(a){let b=a.lastIndexOf(":");if(b<0)return null;let c=a.slice(b+1);return/^\d+$/.test(c)?c:null}(c);d&&j.push({key:`tcp/${d}`,detail:`${b} pid=${a.pid}`,anchor:g.get(a.pid)??null})}}return s(j)}async function u(a){let b=await a.run("tmux",["list-sessions","-F","#{session_name}"]);return null!==b.failure?r(b.failure):0!==b.code?/no server running|error connecting to|no sessions/i.test(b.stderr)?s([]):r(`tmux list-sessions exited ${b.code}: ${b.stderr.trim()||"no diagnostic output"}`):s(b.stdout.split("\n").map(a=>a.trim()).filter(a=>a.startsWith("mcbd-")).map(a=>({key:a,detail:null,anchor:null})))}let v=[/-wal$/,/-shm$/,/-journal$/,/^\.DS_Store$/],w="env-snapshots",x=[j.Iq,k.L8];function y(a,b,{missingIsEmpty:c,alsoIgnored:d=[]}){let e;try{e=a.readDir(b)}catch(d){let a=d.code;if(c&&"ENOENT"===a)return s([]);return r(`could not list ${b}: ${d.message}`)}return s(e.filter(a=>!(a===w||v.some(b=>b.test(a)))&&!d.includes(a)).map(a=>({key:a,detail:null,anchor:null})))}async function z(a){let b=a.deps??o,[c,d]=await Promise.all([t(b).catch(a=>r(`listeners probe threw: ${a.message}`)),u(b).catch(a=>r(`tmux probe threw: ${a.message}`))]);return{version:1,capturedAt:a.now??Date.now(),worktreeId:a.worktreeId,probes:{listeners:c,"tmux-sessions":d,"home-entries":y(b,b.homeDir(),{missingIsEmpty:!1}),"commandmate-entries":y(b,(0,g.join)(b.homeDir(),".commandmate"),{missingIsEmpty:!0,alsoIgnored:x})}}}function A(){return(0,g.join)((0,g.dirname)((0,h._$)().CM_DB_PATH),w)}let B=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function C(a,b){return B.test(b)?(0,g.join)(a,`${b}.json`):null}function D(a,b,c=A()){let d=C(c,a);if(!d)return l.warn("env-snapshot-rejected-task-id",{taskId:a}),!1;try{return(0,e.mkdirSync)(c,{recursive:!0,mode:448}),(0,e.writeFileSync)(d,JSON.stringify(b),{encoding:"utf8",mode:384}),!function(a,b){let c;try{c=(0,e.readdirSync)(a)}catch{return}for(let d of c){if(!d.endsWith(".json"))continue;let c=(0,g.join)(a,d);try{b-(0,e.statSync)(c).mtimeMs>2592e6&&(0,e.rmSync)(c,{force:!0})}catch{}}}(c,b.capturedAt),!0}catch(b){return l.warn("env-snapshot-write-failed",{taskId:a,error:b instanceof Error?b.message:String(b)}),!1}}function E(a,b=A()){let c=C(b,a);if(!c)return null;try{let a=JSON.parse((0,e.readFileSync)(c,"utf8"));if(!function(a){if("object"!=typeof a||null===a||1!==a.version||"number"!=typeof a.capturedAt)return!1;let b=a.probes;return"object"==typeof b&&null!==b&&m.every(a=>{var c;return"object"==typeof(c=b[a])&&null!==c&&("ok"===c.status||"unavailable"===c.status)&&Array.isArray(c.entries)})}(a))return null;return a}catch{return null}}},90384:(a,b,c)=>{c.d(b,{D:()=>n,Q5:()=>i,Tc:()=>l,UL:()=>y,Yp:()=>s,aT:()=>k,iE:()=>j,le:()=>h,sN:()=>m,uz:()=>g,yR:()=>z});var d=c(29021),e=c(33873),f=c(4689);let g="work-evidence",h="scope",i="env-clean",j=[g,h,i],k=".commandmate/verify.yaml";function l(a,b=[]){return[g,h,...a.options.requireEnvClean?[i]:[],...a.gates.map(a=>a.id),...b.map(a=>a.id)]}let m=600,n=/^[a-z0-9][a-z0-9-]{0,31}$/,o=/^[A-Za-z0-9_.-]+$/,p=["version","gates","options"],q=["id","command","timeoutSec","mutex","retryOnFail","flakyIsPass"],r=["baseRef","skipInPrimaryCheckout","maxLogTailBytes","requireCommit","requireEnvClean","envCleanIgnoreHomeEntries"];class s extends Error{constructor(a){super(`invalid verify config:
|
|
9
|
+
${a.map(a=>` - ${a}`).join("\n")}`),this.name="VerifyConfigError",this.issues=a}}function t(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function u(a){return"number"==typeof a?Number.isInteger(a)?a:null:"string"==typeof a&&/^-?\d+$/.test(a)?Number(a):null}function v(a){return"boolean"==typeof a?a:"true"===a||"false"!==a&&null}function w(a){return void 0===a?"nothing":null===a?"null":"string"==typeof a?JSON.stringify(a):Array.isArray(a)?"a list":"object"==typeof a?"a mapping":String(a)}function x(a,b,c,d){for(let e of Object.keys(a))b.includes(e)||d.push(`${c}: unknown key "${e}" (v1 is a closed set)`)}function y(a,b,c){if(!Array.isArray(a))return c.push(`${b}: must be a list (got ${w(a)})`),[];let d=[],e=new Set;return a.forEach((a,f)=>{!function(a,b,c,d,e){let f,g,h,i=e.length;if(!t(a))return e.push(`${b}: must be a mapping (got ${w(a)})`);x(a,q,b,e),"string"!=typeof a.id||""===a.id?e.push(`${b}.id: required, must be a non-empty string (got ${w(a.id)})`):n.test(a.id)?j.includes(a.id)?e.push(`${b}.id: "${a.id}" is reserved for a built-in gate`):c.has(a.id)?e.push(`${b}.id: duplicate gate id "${a.id}"`):c.add(a.id):e.push(`${b}.id: "${a.id}" must match ${n.source}`),("string"!=typeof a.command||""===a.command.trim())&&e.push(`${b}.command: required, must be a non-empty string (got ${w(a.command)})`);let k=m;if(void 0!==a.timeoutSec){let c=u(a.timeoutSec);null===c?e.push(`${b}.timeoutSec: must be an integer (got ${w(a.timeoutSec)})`):c<1||c>7200?e.push(`${b}.timeoutSec: must be 1..7200 (got ${c})`):k=c}if(void 0!==a.mutex&&("string"!=typeof a.mutex||""===a.mutex?e.push(`${b}.mutex: must be a non-empty string (got ${w(a.mutex)})`):a.mutex.length>64?e.push(`${b}.mutex: must be at most 64 characters (got ${a.mutex.length})`):o.test(a.mutex)?f=a.mutex:e.push(`${b}.mutex: "${a.mutex}" must match ${o.source}`)),void 0!==a.retryOnFail){let c=u(a.retryOnFail);null===c?e.push(`${b}.retryOnFail: must be an integer (got ${w(a.retryOnFail)})`):c<0||c>1?e.push(`${b}.retryOnFail: must be 0 or 1 (got ${c})`):g=c}if(void 0!==a.flakyIsPass){let c=v(a.flakyIsPass);null===c?e.push(`${b}.flakyIsPass: must be true or false (got ${w(a.flakyIsPass)})`):c&&1!==g?e.push(`${b}.flakyIsPass: true requires retryOnFail: 1 (without a retry a gate can never be FLAKY)`):h=c}if(e.length===i){let b={id:a.id,command:a.command,timeoutSec:k};void 0!==f&&(b.mutex=f),void 0!==g&&(b.retryOnFail=g),void 0!==h&&(b.flakyIsPass=h),d.push(b)}}(a,`${b}[${f}]`,e,d,c)}),d}function z(a){let b,c=(0,e.join)(a,k);try{b=(0,d.readFileSync)(c,"utf8")}catch(a){if("ENOENT"===a.code)return null;throw new s([`${c}: ${a.message}`])}return function(a,b){var c;let d;try{d=(0,f.qg)(a)}catch(a){throw new s([`${b}: YAML parse error: ${a.message}`])}if(!t(d))throw new s([`${b}: expected a YAML mapping at the top level (got ${w(d)})`]);let e=[];x(d,p,"top level",e),"version"in d?1!==u(d.version)&&e.push(`version: must be 1 (got ${w(d.version)})`):e.push('version: required, v1 configs must declare "version: 1"');let g=(c=d.gates,null==c?(e.push("gates: required, at least one gate must be defined"),[]):Array.isArray(c)&&0===c.length?(e.push("gates: at least one gate must be defined"),[]):y(c,"gates",e)),h=function(a,b){let c={baseRef:null,skipInPrimaryCheckout:!0,maxLogTailBytes:8192,requireCommit:!1,requireEnvClean:!1,envCleanIgnoreHomeEntries:[]};if(null==a)return c;if(!t(a))return b.push(`options: must be a mapping (got ${w(a)})`),c;if(x(a,r,"options",b),void 0!==a.baseRef&&("string"!=typeof a.baseRef||""===a.baseRef.trim()?b.push(`options.baseRef: must be a non-empty string (got ${w(a.baseRef)})`):c.baseRef=a.baseRef),void 0!==a.skipInPrimaryCheckout){let d=v(a.skipInPrimaryCheckout);null===d?b.push(`options.skipInPrimaryCheckout: must be true or false (got ${w(a.skipInPrimaryCheckout)})`):c.skipInPrimaryCheckout=d}if(void 0!==a.requireCommit){let d=v(a.requireCommit);null===d?b.push(`options.requireCommit: must be true or false (got ${w(a.requireCommit)})`):c.requireCommit=d}if(void 0!==a.requireEnvClean){let d=v(a.requireEnvClean);null===d?b.push(`options.requireEnvClean: must be true or false (got ${w(a.requireEnvClean)})`):c.requireEnvClean=d}if(void 0!==a.envCleanIgnoreHomeEntries){let d=function(a,b){let c="options.envCleanIgnoreHomeEntries";if(!Array.isArray(a))return b.push(`${c}: must be a list of $HOME entry names (got ${w(a)})`),null;let d=b.length;a.length>32&&b.push(`${c}: at most 32 entries (got ${a.length})`);let e=[];return a.forEach((a,d)=>{let f=`${c}[${d}]`;"string"!=typeof a?b.push(`${f}: must be a string (got ${w(a)})`):""===a?b.push(`${f}: must not be empty`):"."===a||".."===a?b.push(`${f}: must be an entry name, not ${JSON.stringify(a)}`):a.includes("/")||a.includes("\0")?b.push(`${f}: must be a single $HOME entry name without "/" or NUL (got ${w(a)})`):e.push(a)}),b.length===d?e:null}(a.envCleanIgnoreHomeEntries,b);d&&(c.envCleanIgnoreHomeEntries=d)}if(void 0!==a.maxLogTailBytes){let d=u(a.maxLogTailBytes);null===d?b.push(`options.maxLogTailBytes: must be an integer (got ${w(a.maxLogTailBytes)})`):d<0||d>1048576?b.push(`options.maxLogTailBytes: must be 0..1048576 (got ${d})`):c.maxLogTailBytes=d}return c}(d.options,e);if(e.length>0)throw new s(e);return{version:1,gates:g,options:h}}(b,c)}}};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";exports.id=1990,exports.ids=[1990],exports.modules={31990:(a,b,c)=>{c.d(b,{Wh:()=>R,WD:()=>S,Lw:()=>U,K1:()=>Q,N5:()=>T});var d=c(43234),e=c(72626),f=c(79892);let g={streamingOutput:!1,explicitResize:!1,snapshotFallback:!0};class h{async unsubscribe(){}}class i{async ensureSession(a,b){await (0,f.N)(a)||await (0,f.jw)(a,b)}async sessionExists(a){return(0,f.N)(a)}async sendInput(a,b){await (0,f.V1)(a,b)}async sendSpecialKey(a,b){if("Escape"!==b&&"C-c"!==b&&"C-d"!==b&&"C-m"!==b&&"Enter"!==b)throw Error(`Unsupported special key for PollingTmuxTransport: ${b}`);await (0,f.ds)(a,b)}async resize(){throw Error("PollingTmuxTransport does not support explicit resize")}async captureSnapshot(a,b){return(0,f.Xg)(a,b)}async subscribe(){return new h}getCapabilities(){return g}async killSession(a){return(0,f.fY)(a)}}let j=null;var k=c(93997),l=c(79646),m=c(28354),n=c(31442),o=c(29021),p=c(21820),q=c(33873),r=c(16983);let s="cm-live-restore.sh",t="cm-live-delegate.sh",u="cm-auto-popup.sh",v=`#!/bin/sh
|
|
2
|
+
# CommandMate live-attach restore (Issue #2317) — generated file, edits are overwritten.
|
|
3
|
+
#
|
|
4
|
+
# sh ~/.commandmate/bin/${s} <session> [control_mode] [width] [height]
|
|
5
|
+
#
|
|
6
|
+
# Pins the session's window back to CommandMate's canvas once no human client is
|
|
7
|
+
# attached to it any more. Safe to run when nothing is delegated: it then simply
|
|
8
|
+
# re-applies the geometry the session already has.
|
|
9
|
+
set -u
|
|
10
|
+
|
|
11
|
+
SESSION="\${1:-}"
|
|
12
|
+
CONTROL_MODE="\${2:-0}"
|
|
13
|
+
WIDTH="\${3:-${r.Jn}}"
|
|
14
|
+
HEIGHT="\${4:-${r.sO}}"
|
|
15
|
+
|
|
16
|
+
case "$SESSION" in
|
|
17
|
+
${n.HL}*) ;;
|
|
18
|
+
*) exit 0 ;;
|
|
19
|
+
esac
|
|
20
|
+
|
|
21
|
+
# A control-mode client detaching is CommandMate's own transport reconnecting,
|
|
22
|
+
# not the human leaving. Doing the restore here would fight the human's attach.
|
|
23
|
+
if [ "$CONTROL_MODE" = "1" ]; then
|
|
24
|
+
exit 0
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
# Anyone left who is NOT a control client? Then the geometry is still theirs.
|
|
28
|
+
HUMANS=$(tmux list-clients -t "=$SESSION:" -F '#{client_control_mode}' 2>/dev/null \\
|
|
29
|
+
| grep -c -v '^1$') || HUMANS=0
|
|
30
|
+
if [ "\${HUMANS:-0}" -gt 0 ]; then
|
|
31
|
+
exit 0
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
tmux set-window-option -t "=$SESSION:" window-size manual 2>/dev/null || exit 0
|
|
35
|
+
tmux resize-window -t "=$SESSION:" -x "$WIDTH" -y "$HEIGHT" 2>/dev/null || true
|
|
36
|
+
tmux set-option -u -t "=$SESSION:" @cm_delegated 2>/dev/null || true
|
|
37
|
+
`,w="[0-9a-f]".repeat(8),x=`#!/bin/sh
|
|
38
|
+
# CommandMate live-attach delegate (Issue #2317) — generated file, edits are overwritten.
|
|
39
|
+
#
|
|
40
|
+
# sh ~/.commandmate/bin/${t} <session> <control_mode> [client]
|
|
41
|
+
#
|
|
42
|
+
# Hands the session's window from CommandMate's pinned canvas to the terminal
|
|
43
|
+
# that just attached, so an alternate-screen agent re-lays-out and its transcript
|
|
44
|
+
# becomes readable. Installed as a session-scoped \`client-attached[0]\` hook only
|
|
45
|
+
# when CM_LIVE_ATTACH_HOOK=on; \`commandmate attach --live\` does the same two
|
|
46
|
+
# writes itself and needs no hook.
|
|
47
|
+
#
|
|
48
|
+
# The window is put back by whoever notices the human is gone first: the CLI on
|
|
49
|
+
# return from attach-session, or the server's status poll. This script never
|
|
50
|
+
# restores — the attach edge is the only edge tmux 3.5a lets a session-scoped
|
|
51
|
+
# hook see.
|
|
52
|
+
set -u
|
|
53
|
+
|
|
54
|
+
SESSION="\${1:-}"
|
|
55
|
+
CONTROL_MODE="\${2:-0}"
|
|
56
|
+
|
|
57
|
+
case "$SESSION" in
|
|
58
|
+
${n.HL}claude-*|${n.HL}${w}-claude-*) ;;
|
|
59
|
+
*) exit 0 ;;
|
|
60
|
+
esac
|
|
61
|
+
|
|
62
|
+
# A control-mode client is CommandMate's own transport. Handing it the geometry
|
|
63
|
+
# would resize the canvas to whatever that connection negotiated, which is the
|
|
64
|
+
# #1163 regression this whole feature is built to avoid.
|
|
65
|
+
if [ "$CONTROL_MODE" = "1" ]; then
|
|
66
|
+
exit 0
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
# Raised BEFORE the size change, so a status poll landing between the two sees
|
|
70
|
+
# "delegated, still pinned" rather than "not delegated, 44 rows".
|
|
71
|
+
tmux set-option -t "=$SESSION:" @cm_delegated 1 2>/dev/null || exit 0
|
|
72
|
+
tmux set-window-option -t "=$SESSION:" window-size latest 2>/dev/null || true
|
|
73
|
+
`,y=`#!/bin/sh
|
|
74
|
+
# CommandMate auto read popup (Issue #2317) — generated file, edits are overwritten.
|
|
75
|
+
#
|
|
76
|
+
# sh ~/.commandmate/bin/${u} <session> <control_mode> <client>
|
|
77
|
+
#
|
|
78
|
+
# Opens the following transcript popup for a human client attaching to a
|
|
79
|
+
# CommandMate session. Never opens for a control-mode client.
|
|
80
|
+
set -u
|
|
81
|
+
|
|
82
|
+
SESSION="\${1:-}"
|
|
83
|
+
CONTROL_MODE="\${2:-0}"
|
|
84
|
+
CLIENT="\${3:-}"
|
|
85
|
+
|
|
86
|
+
case "$SESSION" in
|
|
87
|
+
${n.HL}*) ;;
|
|
88
|
+
*) exit 0 ;;
|
|
89
|
+
esac
|
|
90
|
+
|
|
91
|
+
if [ "$CONTROL_MODE" = "1" ]; then
|
|
92
|
+
exit 0
|
|
93
|
+
fi
|
|
94
|
+
|
|
95
|
+
PAGER_SCRIPT="$HOME/.commandmate/bin/cm-read-pane.sh"
|
|
96
|
+
[ -x "$PAGER_SCRIPT" ] || exit 0
|
|
97
|
+
|
|
98
|
+
if [ -n "$CLIENT" ]; then
|
|
99
|
+
tmux display-popup -c "$CLIENT" -w 90% -h 85% -E "sh \\"$PAGER_SCRIPT\\" --follow \\"$SESSION\\"" 2>/dev/null || true
|
|
100
|
+
else
|
|
101
|
+
tmux display-popup -w 90% -h 85% -E "sh \\"$PAGER_SCRIPT\\" --follow \\"$SESSION\\"" 2>/dev/null || true
|
|
102
|
+
fi
|
|
103
|
+
`;function z(a,b){let c,d=(0,q.join)((0,q.join)((0,p.homedir)(),".commandmate","bin"),a);if((0,o.mkdirSync)((0,q.dirname)(d),{recursive:!0}),(0,o.existsSync)(d))try{c=(0,o.readFileSync)(d,"utf-8")}catch{c=void 0}return c!==b&&(0,o.writeFileSync)(d,b,{mode:493}),(0,o.chmodSync)(d,493),d}var A=c(83598);let B=(0,m.promisify)(l.execFile),C=(0,e.h)("tmux-session-hooks"),D=globalThis.__cmEnsuredSessionHooks??(globalThis.__cmEnsuredSessionHooks=new Set);async function E(a){if((0,n.N_)(a)&&!D.has(a)){D.add(a);try{if((0,n.gM)()&&(0,n.n9)(a)){z(s,v);let b=(0,n.Rr)(a,z(t,x));b&&await B("tmux",b,{timeout:5e3})}else await B("tmux",(0,n.g4)(a),{timeout:5e3});if((0,n.jx)()){let b=(0,n.Ls)(a,z(u,y));b&&await B("tmux",b,{timeout:5e3})}else await B("tmux",(0,n.sL)(a),{timeout:5e3})}catch(b){C.debug("session-hooks:reconcile-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)})}}}async function F(a){try{if(!await (0,A.Us)(a)||await (0,A.Fh)(a))return!1;for(let b of(0,n.RS)(a))await B("tmux",b,{timeout:5e3});return C.info("session-hooks:geometry-restored",{sessionName:a}),!0}catch(b){return C.debug("session-hooks:geometry-restore-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)}),!1}}let G=(0,m.promisify)(l.execFile),H=(0,e.h)("tmux-session-status"),I=globalThis.__cmPublishedTmuxStatus??(globalThis.__cmPublishedTmuxStatus=new Map),J=globalThis.__cmClearedTmuxStatus??(globalThis.__cmClearedTmuxStatus=new Set);async function K(a){let{sessionName:b,worktreeId:c,cliToolId:d,instanceId:e,status:f}=a;if(!(0,n.om)())return J.has(b)||(J.add(b),await M(b)),"disabled";let g=I.get(b);if(g&&g.status===f&&g.worktreeId===c&&g.cliToolId===d&&g.instanceId===e)return"unchanged";let h=(a.now??new Date).toISOString(),i=[[n.eC,f],[n.jp,c],[n.wv,d],[n.L0,e],[n.tx,h]];try{for(let[a,c]of i)await G("tmux",(0,n.ND)(b,a,c),{timeout:5e3});return I.set(b,{status:f,worktreeId:c,cliToolId:d,instanceId:e}),await L(b),"written"}catch(a){return I.delete(b),H.debug("session-status:write-failed",{sessionName:b,error:a instanceof Error?a.message:String(a)}),"error"}}async function L(a){try{let{stdout:b}=await G("tmux",(0,n.Ys)(a,"status-right"),{timeout:5e3}),c=b.trim();if(""!==c&&!c.includes(n.lY))return H.debug("session-status:status-right-user-owned",{sessionName:a,existing:c}),!1;return""===c&&await G("tmux",(0,n.KB)(a,n.lY),{timeout:5e3}),!0}catch(b){return H.debug("session-status:status-right-failed",{sessionName:a,error:b instanceof Error?b.message:String(b)}),!1}}async function M(a){for(let b of(I.delete(a),n.bq))try{await G("tmux",(0,n.cD)(a,b),{timeout:5e3})}catch{}try{let{stdout:b}=await G("tmux",(0,n.Ys)(a,"status-right"),{timeout:5e3});b.includes(n.lY)&&await G("tmux",(0,n.$D)(a),{timeout:5e3})}catch{}}let N=(0,e.h)("cli-session");function O(){return j||(j=new i),j}function P(a,b,c){let e=d.CLIToolManager.getInstance().getTool(b),f=e.getSessionName(a,c);return{cliTool:e,sessionName:f}}async function Q(a,b,c){let{sessionName:d}=P(a,b,c);return O().sessionExists(d)}async function R(a,b,c=1e3,d){let e=N.withContext({worktreeId:a,cliToolId:b});e.debug("captureSessionOutput:start",{requestedLines:c});let{cliTool:f,sessionName:g}=P(a,b,d),h=O();try{let a=await (0,k.aq)(g,c,async()=>{if(!await h.sessionExists(g))throw Error(`${f.name} session ${g} does not exist`);return await h.captureSnapshot(g,{startLine:-k.xE})});return e.debug("captureSessionOutput:success",{actualLines:a.split("\n").length,lastFewLines:a.split("\n").slice(-3).join(" | ")}),a}catch(b){let a=b instanceof Error?b.message:String(b);if(a.includes("does not exist"))throw e.debug("captureSessionOutput:sessionNotFound",{sessionName:g}),b;throw e.error("captureSessionOutput:failed",{error:a}),Error(`Failed to capture ${f.name} output: ${a}`)}}async function S(a,b,c=5e3,d){let e=N.withContext({worktreeId:a,cliToolId:b});e.debug("captureSessionOutputFresh:start",{requestedLines:c});let{cliTool:f,sessionName:g}=P(a,b,d),h=O();try{let a=await h.captureSnapshot(g,{startLine:-c});return a.length>0?(0,k.vF)(g,a,c):(0,k.gm)(g),(0,k.wd)(a,c)}catch(b){(0,k.gm)(g);let a=b instanceof Error?b.message:String(b);throw e.error("captureSessionOutputFresh:failed",{error:a}),Error(`Failed to capture ${f.name} output: ${a}`)}}async function T(a){await E(a.sessionName),(0,n.n9)(a.sessionName)&&await F(a.sessionName),await K(a)}function U(a){I.delete(a),J.delete(a),D.delete(a),(0,A.G9)(a)}}};
|