commandmate 0.44.3 → 0.45.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 +266 -266
- package/.next/app-path-routes-manifest.json +18 -18
- package/.next/build-manifest.json +5 -5
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +3 -3
- package/.next/react-loadable-manifest.json +26 -26
- package/.next/required-server-files.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/release-notes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/capabilities/route.js +1 -1
- package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/agent-event/route.js +2 -2
- package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/claude-done/route.js +2 -2
- package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/permission-request/route.js +1 -1
- package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/relays/[relayId]/cancel/route.js +1 -1
- package/.next/server/app/api/relays/[relayId]/cancel/route.js.nft.json +1 -1
- package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/relays/route.js +1 -1
- package/.next/server/app/api/relays/route.js.nft.json +1 -1
- package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/clone/route.js +1 -1
- package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/restore/route.js +1 -1
- package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/route.js +1 -1
- package/.next/server/app/api/repositories/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/scan/route.js +1 -1
- package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/sync/route.js +1 -1
- package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/default-agents/route.js +1 -1
- package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/direct-input/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/direct-input/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/direct-input/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/checkout/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/reset/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/marp-render/route.js +3 -3
- package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +2 -2
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/route.js +1 -1
- package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
- package/.next/server/app/more/page_client-reference-manifest.js +1 -1
- package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
- package/.next/server/app/review/page_client-reference-manifest.js +1 -1
- package/.next/server/app/sessions/page_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 +4 -4
- 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 +18 -18
- package/.next/server/chunks/1503.js +2 -2
- package/.next/server/chunks/1559.js +2 -2
- package/.next/server/chunks/1944.js +1 -1
- package/.next/server/chunks/2119.js +1 -1
- package/.next/server/chunks/22.js +1 -1
- package/.next/server/chunks/2404.js +1 -1
- package/.next/server/chunks/2445.js +1 -1
- package/.next/server/chunks/2460.js +1 -1
- package/.next/server/chunks/2710.js +2 -2
- package/.next/server/chunks/2908.js +1 -1
- package/.next/server/chunks/3241.js +1 -1
- package/.next/server/chunks/4802.js +1 -1
- package/.next/server/chunks/5048.js +1 -1
- package/.next/server/chunks/5064.js +1 -1
- package/.next/server/chunks/5292.js +7 -0
- package/.next/server/chunks/5625.js +2 -2
- package/.next/server/chunks/5737.js +1 -1
- package/.next/server/chunks/6065.js +1 -1
- package/.next/server/chunks/6130.js +1 -1
- package/.next/server/chunks/6401.js +1 -1
- package/.next/server/chunks/850.js +1 -1
- package/.next/server/chunks/8728.js +2 -2
- package/.next/server/chunks/8918.js +4 -6
- package/.next/server/chunks/9051.js +1 -1
- package/.next/server/chunks/9130.js +1 -1
- package/.next/server/chunks/9390.js +1 -1
- package/.next/server/chunks/9584.js +1 -1
- package/.next/server/chunks/9731.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/1464.09cd37fee202ec4b.js +1 -0
- package/.next/static/chunks/2053-390e77fce43b555c.js +1 -0
- package/.next/static/chunks/{2407-06d35bb1aa02de80.js → 2407-dd4a0f04f1349221.js} +1 -1
- package/.next/static/chunks/{2751-9ef0f4b450bd4ef0.js → 2751-5f0b2702accd164d.js} +1 -1
- package/.next/static/chunks/{282.6b6f2e31a96674dd.js → 282.a1013532fd9a61b4.js} +1 -1
- package/.next/static/chunks/3237.94c29281d9ec122e.js +1 -0
- package/.next/static/chunks/3480.2e21f62e5e9d3ba5.js +1 -0
- package/.next/static/chunks/4290.c06dbe243819fea0.js +66 -0
- package/.next/static/chunks/{5222.305dc0ebba9c0784.js → 5222.39e2034d3fce233c.js} +1 -1
- package/.next/static/chunks/{7095.8c869e553133a40e.js → 7095.87323a4fdf426341.js} +1 -1
- package/.next/static/chunks/{7485.442b21101fca7257.js → 7485.8a2a9d7c5396aa26.js} +3 -3
- package/.next/static/chunks/app/{layout-0d1750b833f5cc3e.js → layout-07d040cb3d3ea657.js} +1 -1
- package/.next/static/chunks/app/worktrees/[id]/page-35f0e31a725d1c89.js +1 -0
- package/.next/static/chunks/{webpack-021f0741f22dd16a.js → webpack-165d8df9acd1c5d4.js} +1 -1
- package/.next/trace +13 -13
- package/dist/cli/commands/skill-format.d.ts +8 -0
- package/dist/cli/commands/skill-format.d.ts.map +1 -1
- package/dist/cli/commands/skill-format.js +13 -3
- package/dist/cli/commands/wait.d.ts.map +1 -1
- package/dist/cli/commands/wait.js +71 -3
- package/dist/cli/types/api-responses.d.ts +7 -10
- package/dist/cli/types/api-responses.d.ts.map +1 -1
- package/dist/cli/utils/verify-runner.d.ts +21 -0
- package/dist/cli/utils/verify-runner.d.ts.map +1 -1
- package/dist/cli/utils/verify-runner.js +38 -1
- package/dist/server/locales/en/worktree.json +5 -1
- package/dist/server/locales/ja/worktree.json +5 -1
- package/dist/server/src/lib/detection/model-info-extractor.js +57 -3
- package/dist/server/src/lib/detection/status-detector.js +1 -1
- package/dist/server/src/lib/git/git-exec.js +23 -5
- package/dist/server/src/lib/hooks/sources/claude/self-resume.js +213 -0
- package/dist/server/src/lib/hooks/sources/claude/source.js +24 -7
- package/dist/server/src/lib/session/agent-event-dedup.js +2 -2
- package/dist/server/src/lib/session/agent-event-state.js +2 -1
- package/dist/server/src/lib/session/agent-event-turn.js +51 -0
- package/dist/server/src/lib/session/current-output-builder.js +0 -5
- package/dist/server/src/lib/skills/install-plan.js +1 -0
- package/dist/server/src/lib/skills/preview-diff.js +24 -3
- package/dist/server/src/lib/skills/uninstall-plan.js +1 -0
- package/dist/server/src/lib/verification/env-clean-gate.js +6 -5
- package/docs/en/user-guide/commands-guide.md +0 -1
- package/package.json +3 -2
- package/release-notes/0.45.0.json +41 -0
- package/scripts/hooks/cmate-agent-event.sh +20 -0
- package/.next/server/chunks/4672.js +0 -5
- package/.next/static/chunks/2053-85a974ddfe7498fe.js +0 -1
- package/.next/static/chunks/4290.6cf86f68d73b6e77.js +0 -82
- package/.next/static/chunks/4459.a94b52985a76509a.js +0 -1
- package/.next/static/chunks/5951.616956b6aa5df63f.js +0 -1
- package/.next/static/chunks/9856.15463dd58437e2ac.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/page-e36898c3a80e7302.js +0 -1
- /package/.next/static/{tWwHQzmvc-rv9KKUtDWfQ → TPWbZB3zBp3Zv_eFEOlmt}/_buildManifest.js +0 -0
- /package/.next/static/{tWwHQzmvc-rv9KKUtDWfQ → TPWbZB3zBp3Zv_eFEOlmt}/_ssgManifest.js +0 -0
|
@@ -192,11 +192,12 @@ const readLivePidCwd = (pid) => {
|
|
|
192
192
|
};
|
|
193
193
|
exports.readLivePidCwd = readLivePidCwd;
|
|
194
194
|
/**
|
|
195
|
-
* `tests/unit/skills/demo-video/env-scripts.test.ts`
|
|
196
|
-
* `~/.commandmate-demo-vitest-<pid>` for the length of its run
|
|
197
|
-
* `$HOME
|
|
198
|
-
*
|
|
199
|
-
* entry whose owner can be
|
|
195
|
+
* `tests/unit/skills/demo-video/env-scripts.test.ts` created
|
|
196
|
+
* `~/.commandmate-demo-vitest-<pid>` for the length of its run, in the real
|
|
197
|
+
* `$HOME` (#2954). Since #3479 it makes the dir under the OS temp dir instead;
|
|
198
|
+
* this stays for checkouts that predate that. The name carries the pid of the
|
|
199
|
+
* test process that made it, which is the one `$HOME` entry whose owner can be
|
|
200
|
+
* established.
|
|
200
201
|
*/
|
|
201
202
|
const DEMO_VITEST_HOME_ENTRY = /^\.commandmate-demo-vitest-([1-9]\d*)$/;
|
|
202
203
|
const isLivePid = (pid) => {
|
|
@@ -49,7 +49,6 @@ Every command in `.claude/commands/`. Follow the link for the full definition of
|
|
|
49
49
|
| [`/pm-auto-design2dev`](../../../.claude/commands/pm-auto-design2dev.md) | Automate design review through implementation (design review, work plan, TDD implementation) |
|
|
50
50
|
| [`/pm-auto-dev`](../../../.claude/commands/pm-auto-dev.md) | Automate Issue development end to end (TDD, tests, report) |
|
|
51
51
|
| [`/pm-auto-issue2dev`](../../../.claude/commands/pm-auto-issue2dev.md) | Automate Issue review through implementation (Issue review, design review, work plan, TDD implementation) |
|
|
52
|
-
| [`/pr-merge-pipeline`](../../../.claude/commands/pr-merge-pipeline.md) | Automate PR creation, CI, sequential merges, and integration verification across several Issues |
|
|
53
52
|
| [`/progress-report`](../../../.claude/commands/progress-report.md) | Produce a development progress summary and report blockers |
|
|
54
53
|
| [`/refactoring`](../../../.claude/commands/refactoring.md) | Improve code quality, apply design patterns, and pay down technical debt |
|
|
55
54
|
| [`/tdd-impl`](../../../.claude/commands/tdd-impl.md) | Implement to a high standard using test-driven development |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "commandmate",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.0",
|
|
4
4
|
"description": "No long blocks of time? Run an AI team from your phone. Git worktree sessions, task contracts and verification gates for Claude Code, Codex, Gemini CLI, Copilot, OpenCode, Antigravity and Command Code.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agents",
|
|
@@ -151,6 +151,7 @@
|
|
|
151
151
|
"vitest": "^4.1.2"
|
|
152
152
|
},
|
|
153
153
|
"overrides": {
|
|
154
|
-
"@xmldom/xmldom": "^0.9.12"
|
|
154
|
+
"@xmldom/xmldom": "^0.9.12",
|
|
155
|
+
"postcss": "$postcss"
|
|
155
156
|
}
|
|
156
157
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.45.0",
|
|
3
|
+
"date": "2026-10-09",
|
|
4
|
+
"highlight": {
|
|
5
|
+
"ja": "capture --json の読まれていない 3 つの欄を予告どおり削除しました。Claude がバックグラウンドの作業を残したときに wait が完了と読む問題も直しました。",
|
|
6
|
+
"en": "Three unused fields of capture --json were removed as announced. wait no longer treats a turn as finished while Claude still has background work."
|
|
7
|
+
},
|
|
8
|
+
"added": [],
|
|
9
|
+
"improved": [
|
|
10
|
+
{
|
|
11
|
+
"ja": "capture --json の isComplete・isGenerating・thinkingMessage を廃止しました。isPromptWaiting と thinking を使ってください。",
|
|
12
|
+
"en": "Removed isComplete, isGenerating and thinkingMessage from capture --json. Use isPromptWaiting and thinking instead."
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"fixed": [
|
|
16
|
+
{
|
|
17
|
+
"ja": "Claude がバックグラウンドの作業を残してターンを閉じたとき、wait が完了と読む問題を直しました。",
|
|
18
|
+
"en": "Fixed wait treating a turn as finished when Claude closed it with background work still running."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"ja": "終わりの合図が届かないターンで、wait がタイムアウトまで待ち続ける問題を直しました。",
|
|
22
|
+
"en": "Fixed wait spinning until its timeout on a turn whose end was never reported."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"ja": "git の状態を読めなかった worktree を「変更なし」と表示しないようにし、その状態ではブランチの切り替えを止めるようにしました。",
|
|
26
|
+
"en": "A worktree whose git status could not be read is no longer shown as unchanged, and branch switching stops in that case."
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"ja": "スキルの画面と CLI が、git の状態を読めなかったときに「変更あり」ではなく「不明」と表示するようにしました。",
|
|
30
|
+
"en": "The skills view and CLI now show unknown instead of changed when git status could not be read."
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"ja": "OpenCode V2 の画面から使っているモデル名を読めるようにしました。",
|
|
34
|
+
"en": "The model in use is now read from the OpenCode V2 screen."
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"ja": "依存パッケージを更新し、既知の脆弱性を解消しました。",
|
|
38
|
+
"en": "Updated dependencies to fix known vulnerabilities."
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
@@ -297,6 +297,26 @@ if [ "$EVENT" = "user_prompt_submit" ] && [ "$TOOL" = "claude" ] && [ -n "$HOOK_
|
|
|
297
297
|
BODY="$BODY,\"queuedNotice\":true"
|
|
298
298
|
fi
|
|
299
299
|
fi
|
|
300
|
+
# Issue #3450. On a Claude `Stop` the receiver reads the session's transcript
|
|
301
|
+
# for background work that has not been notified yet (#3430), and it finds the
|
|
302
|
+
# transcript by the payload's `transcript_path`. An injected `type: "http"` Stop
|
|
303
|
+
# hook posts the payload verbatim, but a hand-configured Stop hook (§3 of
|
|
304
|
+
# docs/user-guide/agent-event-hooks.md, Issue #1549) comes through here, so the
|
|
305
|
+
# field is forwarded under its own name — the one field, never the rest of the
|
|
306
|
+
# payload. Claude's `stop` only, so codex (whose shared relay is a copy of this
|
|
307
|
+
# script) and every other tool keep the body they had.
|
|
308
|
+
#
|
|
309
|
+
# Only a path the receiver could accept is sent: absolute, under a
|
|
310
|
+
# `.claude/projects` directory and ending in `.jsonl`. The receiver checks it
|
|
311
|
+
# again against its own home; anything else would be ignored there anyway.
|
|
312
|
+
if [ "$EVENT" = "stop" ] && [ "$TOOL" = "claude" ] && [ -n "$HOOK_JSON" ]; then
|
|
313
|
+
TRANSCRIPT_PATH="$(json_string_field "$HOOK_JSON" 'transcript_path')"
|
|
314
|
+
case "$TRANSCRIPT_PATH" in
|
|
315
|
+
/*/.claude/projects/*.jsonl)
|
|
316
|
+
BODY="$BODY,\"transcript_path\":\"$(json_escape "$TRANSCRIPT_PATH")\""
|
|
317
|
+
;;
|
|
318
|
+
esac
|
|
319
|
+
fi
|
|
300
320
|
BODY="$BODY}"
|
|
301
321
|
|
|
302
322
|
# Token via --header rather than the command line of a subprocess: argv is world
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=4672,exports.ids=[4672],exports.modules={2734:(a,b,c)=>{c.d(b,{c:()=>d});let d="codex"},15608:(a,b,c)=>{c.d(b,{mc:()=>f,y:()=>g});var d=c(36925);function e(){return(0,d.v)("__cmLegacySessionAliases",()=>new Map)}function f(a){return e().get(a)}function g(a){let b=e(),c=!1;for(let[d,e]of b)e===a&&(b.delete(d),c=!0);return c}},16100:(a,b,c)=>{c.d(b,{Wp:()=>w});var d=c(29021),e=c(33873),f=c(43252),g=c(72626),h=c(66101),i=c(57510),j=c(25071),k=c(34114),l=c(51719),m=c(83738),n=c(26945),o=c(38892),p=c(32301),q=c(71193);let r=(0,g.h)("lib/hooks/sources/opencode-v2/source"),s=["scripts","opencode-v2","launch.sh"];function t(a){let b=(0,n.bH)(a);if(null===b)return{reason:"no-port"};let c=(0,o.X3)(a);return null===c?{reason:"no-password"}:{port:b,password:c}}async function u(a,b,c){let d=a.instanceId??a.cliToolId,e=e=>{r.info("opencode-v2-verdict-undelivered",{worktreeId:a.worktreeId,instanceId:d,decisionId:b.id,verdict:c.kind,reason:e}),(0,j.oy)(a,b.id,{delivered:!1,reason:e})};if("abstain"===c.kind)return e("abstained");let f=b.conversationId;if(!f)return e("no-session");let g=t(a);if("reason"in g)return e(g.reason);if("question"===b.kind){if("answer"!==c.kind)return e("question-needs-answer-verdict");let h=(0,m.oC)(b.raw,c.answers);if(null===h)return e("form-answer-does-not-fit");let i=await (0,k.yk)(g.port,g.password,f,b.id,h);return r.info("opencode-v2-form-replied",{worktreeId:a.worktreeId,instanceId:d,decisionId:b.id,delivered:i}),void(0,j.oy)(a,b.id,{delivered:i,reason:i?"form-reply":"form-reply-failed"})}let h=function(a){switch(a.kind){case"allowOnce":return"once";case"allowAlways":return"always";case"deny":return"reject";case"answer":case"abstain":return null}}(c);if(null===h)return e("no-wire-value");let i=await (0,k.Pf)(g.port,g.password,f,b.id,h,"deny"===c.kind?c.message:void 0);r.info("opencode-v2-permission-replied",{worktreeId:a.worktreeId,instanceId:d,decisionId:b.id,reply:h,delivered:i}),(0,j.oy)(a,b.id,{delivered:i,reason:i?`permission-reply:${h}`:"permission-reply-failed"})}async function v(a){let b=t(a);if("reason"in b)return[];let c=Date.now(),[d,e]=await Promise.all([(0,k.LO)(b.port,b.password),(0,k.CI)(b.port,b.password)]),f=[];for(let a of d??[]){if(!(0,i.Qd)(a))continue;let b=(0,m.hl)(a,c);b&&f.push(b)}for(let a of e??[]){if(!(0,i.Qd)(a))continue;let b=(0,m.gx)(a,c);b&&f.push(b)}return f}let w=(0,h.kS)({cliToolId:q.B,noDecision:{kind:"blocks"},capabilities:{supportedEvents:["user_prompt_submit","stop","notification"],configScope:"none",decisionTimeoutSeconds:null,permissionHookPredictsDialog:!1,sessionStartMayArriveLate:!1,permissionReplyReleasesPrompt:!0,eventIdentity:"permission-id",resync:"pending-list",transcriptHistory:"push",stopReportsSelfResume:!1},mappers:l.y8,nativeEventNameFields:["type"],conversationIdFields:[],extractModel:()=>null,extractEventIdentity:l.IQ,extractDetail:()=>null,parsePermissionRequest:m.RN,parseQuestion:m.rk,subscribe:async(a,b)=>{let c=(0,n.bH)(a);return null===c?{close:async()=>{},liveness:{state:"unknown"}}:(0,p.tc)(a,c,b,a=>w.normalizeEvent(a))},decide:u,listPending:v,probeActivity:async()=>null,liveness:a=>(0,p.RH)(a),prepareLaunch:function({target:a,executablePath:b,worktreePath:c}){let g={command:`${(0,f.ZL)(b)} --standalone ${(0,f.ZL)(c)}`,settingsPath:null,env:{}},h=(0,n.bH)(a);if(null===h)return g;let i=(0,o.ar)(a),j=function(){let a=(0,e.resolve)(process.cwd(),...s);return(0,d.existsSync)(a)?a:null}(),k=null===j?"launch-script-missing":(0,d.existsSync)(i)?null:"password-file-missing";return null===j||null!==k?(r.warn("opencode-v2-launch-degraded-to-standalone",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,reason:k}),g):{command:["bash",(0,f.ZL)(j),"--port",String(h),"--password-file",(0,f.ZL)(i),"--directory",(0,f.ZL)(c),...b===q.V?[]:["--executable",(0,f.ZL)(b)]].join(" "),settingsPath:null,env:{}}}})},21758:(a,b,c)=>{c.d(b,{Rv:()=>T,TV:()=>s,cN:()=>x,nL:()=>q});var d=c(29021),e=c(21820),f=c(33873),g=c(8004),h=c(67548),i=c(15194),j=c(87447),k=c(43252),l=c(66007),m=c(72626),n=c(45567),o=c(54633);let p=(0,m.h)("lib/hooks/sources/copilot/hook-settings"),q="gh copilot",r="cmate-copilot-agent-hooks",s=10,t="CM_AGENT_WORKTREE_ID",u="CM_AGENT_INSTANCE_ID",v="CM_AUTH_TOKEN",w=n.wS,x="PreToolUse",y=[["SessionStart","session_start"],["UserPromptSubmit","user_prompt_submit"],["PostToolUse","post_tool_use"],["Stop","stop"],["SessionEnd","session_end"]];function z(){return(0,f.join)(function(){let a=(0,f.join)((0,e.homedir)(),".copilot");return(0,g.T)(process.env.COPILOT_HOME,a,"COPILOT_HOME")}(),"settings.json")}function A(a=""){return`: ${r}; if [ -z "\${${t}:-}" ]; then cat >/dev/null; ${a}exit 0; fi; case "$${w}" in ''|*[!0-9]*) cat >/dev/null; ${a}exit 0;; esac; `}let B=`"\${${u}:-${o.V}}"`,C=`"$${t}"`;function D(){return`set -- -fsS -m 4 -X POST -H 'Content-Type: application/json'; if [ -n "\${${v}:-}" ]; then set -- "$@" -H "Authorization: Bearer $${v}"; fi; `}function E(a){return`${(0,k.ZL)("http://127.0.0.1:")}"$${w}"${(0,k.ZL)(a)}`}function F(a){return`${E(`${a}?tool=${o.V}&worktreeId=`)}${C}'&instanceId='${B}`}function G(a){return`rc=$?; printf '%s\\n' "${r}: ${a} rc=$rc" >&2`}function H(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function I(a){return H(a)&&"string"==typeof a.command&&a.command.includes(r)}function J(a,b){return`${JSON.stringify(function(a,b){let c=a.hooks;if(void 0!==c&&!H(c))throw Error('copilot settings.json has a non-object "hooks" key');let d={...c??{}};for(let[a,c]of Object.entries(b.hooks)){let b=d[a];if(void 0!==b&&!Array.isArray(b)){p.warn("copilot-hook-event-not-an-array",{event:a});continue}d[a]=[...function(a){let b=[];for(let c of a)if(!I(c)){if(H(c)&&Array.isArray(c.hooks)){let a=c.hooks.filter(a=>!I(a));if(0===a.length&&c.hooks.length>0)continue;b.push({...c,hooks:a});continue}b.push(c)}return b}(b??[]),...c]}return{...a,hooks:d}}(a,function(a={}){let b={};for(let[c,d]of y)b[c]=[{hooks:[{type:"command",command:function(a,b={}){let c=void 0===b.relayScriptPath?(0,k.Os)():b.relayScriptPath,d=D()+`curl "$@" --data-binary @- ${F(k.jx)} >/dev/null 2>&1 || `+`{ ${G("agent_event_post_failed")}; }`;return c?A()+`if [ -x ${(0,k.ZL)(c)} ]; then `+[(0,k.ZL)(c),"--tool",(0,k.ZL)(o.V),"--event",(0,k.ZL)(a),"--worktree-id",C,"--instance-id",B,"--url",E(k.jx),"--stdin-json"].join(" ")+"; exit 0; fi; "+d:A()+d}(d,a)}]}];return b[x]=[{hooks:[{type:"command",command:function(a={}){return A("printf '{}'; ")+D()+`out=$(curl "$@" --data-binary @- ${F(k.WZ)} `+`2>/dev/null) || { ${G("permission_request_failed")}; out=''; }; `+"[ -n \"$out\" ] || out='{}'; printf '%s' \"$out\""}(a)}]}],{hooks:b}}(b)),null,2)}
|
|
2
|
-
`}function K(a){try{return(0,d.readFileSync)(a,"utf8")}catch(a){if("ENOENT"===a.code)return"";throw a}}function L(a){if(""===a.trim())return{};let b=JSON.parse(a);if(!H(b))throw Error("copilot settings.json is not a JSON object");return b}function M(a){let b,c=K(a);if(""===c.trim())return"absent";try{b=JSON.parse(function(a){let b="",c=!1,d=!1;for(let e=0;e<a.length;e+=1){let f=a[e];if(c){b+=f,d?d=!1:"\\"===f?d=!0:'"'===f&&(c=!1);continue}if('"'===f){c=!0,b+=f;continue}if("/"===f&&"/"===a[e+1]){for(;e<a.length&&"\n"!==a[e];)e+=1;b+="\n";continue}if("/"===f&&"*"===a[e+1]){for(e+=2;e<a.length&&("*"!==a[e]||"/"!==a[e+1]);)e+=1;e+=1;continue}b+=f}return b}(c))}catch{return"unreadable"}if(!H(b))return"unreadable";let d=b.hooks;return null==d||H(d)&&0===Object.keys(d).length||Array.isArray(d)&&0===d.length?"absent":"present"}class N extends Error{constructor(a){super(`copilot config.json still has a "hooks" key (${a}); copilot migrates it over settings.json at startup, so CommandMate is not writing hooks this launch`),this.configPath=a,this.name="CopilotConfigHooksShadowError"}}let O=".cmate.lock",P=".cmate-backup";function Q(a){return`${a}.${process.pid}.tmp`}function R(a,b){return b.configPath??(0,f.join)((0,f.dirname)(a),"config.json")}function S(){return"0"!==process.env.CM_AGENT_HOOKS_INJECT}function T(a,b,c={}){let e={command:a,settingsPath:null,env:{}},g=(a,b)=>{if((0,h.WM)())throw new h.ci(o.V,a,b);return e};if(!S())return g("CM_AGENT_HOOKS_INJECT=0","Do not combine CM_AGENT_HOOKS_INJECT=0 with UAT isolation.");let k=b.instanceId??o.V;if(!(0,i.n6)(k)||!(0,l.h6)(b.worktreeId))return p.warn("copilot-hook-invalid-correlation-key",{worktreeId:b.worktreeId}),g("the worktree or instance id is not a valid correlation key","Use a valid worktree and instance id.");try{let e=function(a={}){let b=a.settingsPath??z();if("read-only"===(0,h.ox)(o.V,[(0,f.dirname)(b),b,`${b}${P}`,Q(b),(0,f.join)((0,f.dirname)(b),O)])){let b=function(a={}){let b=a.settingsPath??z(),c=R(b,a);if(!S())return{usable:!1,reason:"CM_AGENT_HOOKS_INJECT=0",fix:"Do not combine CM_AGENT_HOOKS_INJECT=0 with UAT isolation."};try{let d=M(c);if("absent"!==d)return p.info("copilot-hook-config-json-readonly",{configPath:c,configHooks:d}),{usable:!1,reason:"present"===d?`${c} has a "hooks" key, which copilot migrates over settings.json at startup`:`${c} could not be parsed, so it may hold hooks copilot migrates over settings.json`,fix:"Skip copilot scenarios in this UAT, or run it where copilot's config.json holds no hooks."};let e=K(b);if(""===e)return p.info("copilot-hook-settings-absent-readonly",{settingsPath:b}),{usable:!1,reason:`${b} does not exist or is empty`,fix:h.f0};if(e===J({},a))return{usable:!0,settingsPath:b};if(e===J(L(e),a))return p.info("copilot-hook-settings-foreign-readonly",{settingsPath:b}),{usable:!1,reason:`${b} also holds hooks (or keys) CommandMate did not write, which would run in the UAT session`,fix:"Skip copilot scenarios in this UAT, or run it where the shared settings file holds only the hooks CommandMate writes."};return p.info("copilot-hook-settings-differs-readonly",{settingsPath:b}),{usable:!1,reason:`${b} differs from what this build writes`,fix:h.f0}}catch(a){return p.warn("copilot-hook-settings-unreadable",{settingsPath:b,error:a instanceof Error?a.message:String(a)}),{usable:!1,reason:`${b} could not be read`,fix:h.f0}}}(a);if(b.usable)return b.settingsPath;throw new h.ci(o.V,b.reason,b.fix)}let c=R(b,a),e=M(c);if("present"===e)throw new N(c);return"unreadable"===e&&p.warn("copilot-config-json-unreadable",{configPath:c}),(0,d.mkdirSync)((0,f.dirname)(b),{recursive:!0,mode:448}),function(a,b){let c,e=(0,f.join)(a,O);try{c=(0,d.openSync)(e,"wx",384)}catch(b){if("EEXIST"!==b.code)throw b;let a=Date.now()-(0,d.statSync)(e).mtimeMs;if(a<1e4)throw Error(`copilot settings.json is locked by another CommandMate server (${e})`);p.warn("copilot-hook-settings-lock-stale",{lockPath:e,heldForMs:a}),(0,d.unlinkSync)(e),c=(0,d.openSync)(e,"wx",384)}try{(0,d.writeSync)(c,`${process.pid}
|
|
3
|
-
`)}finally{(0,d.closeSync)(c)}try{return b()}finally{try{(0,d.unlinkSync)(e)}catch{}}}((0,f.dirname)(b),()=>{let c=K(b),e=J(L(c),a);if(c===e)return b;""!==c&&(0,d.copyFileSync)(b,`${b}${P}`);let f=Q(b);try{try{(0,d.unlinkSync)(f)}catch{}(0,d.writeFileSync)(f,e,{mode:384,flag:"wx"}),(0,d.renameSync)(f,b)}catch(a){try{(0,d.unlinkSync)(f)}catch{}throw a}return b})}(c);return{command:a,settingsPath:e,env:function(a,b,c={}){return{[t]:a,[u]:b,[w]:String(c.port??(0,j.D0)())}}(b.worktreeId,k,c)}}catch(a){if(a instanceof h.ci)throw a;if(a instanceof N)return p.warn("copilot-hook-config-json-shadows-settings",{worktreeId:b.worktreeId,configPath:a.configPath}),g(`${a.configPath} has a "hooks" key, which copilot migrates over settings.json at startup`,"Move the hooks out of copilot's config.json.");return p.warn("copilot-hook-settings-write-failed",{worktreeId:b.worktreeId,error:a instanceof Error?a.message:String(a)}),g("~/.copilot/settings.json could not be prepared",h.f0)}}},25071:(a,b,c)=>{c.d(b,{GW:()=>n,_0:()=>m,o4:()=>l,oy:()=>k,qK:()=>j});var d=c(24455),e=c(72626),f=c(36925);let g=(0,e.h)("lib/hooks/sources/pending-decisions"),h=(0,f.v)("__agentSourcePendingDecisions",()=>new Map);function i(a){return(0,d.v7)(a.worktreeId,a.cliToolId,a.instanceId)}function j(a){return(h.get(i(a))??[]).map(a=>a.decision)}function k(a,b,c){let d=h.get(i(a));if(!d)return!1;let e=d.find(a=>a.decision.id===b);return!!e&&(e.delivery=c,!0)}function l(a,b,c){let d=h.get(i(a));if(!d)return!1;let e=d.find(a=>a.decision.id===b);return!!e&&(e.body=c,!0)}async function m(a,b,c,d){return(await n(a,b,c,d)).body}async function n(a,b,c,d){let e=function(a,b){let c=i(a),d={key:c,ref:a,decision:b,body:null,delivery:null},e=h.get(c)??[];for(e.push(d);e.length>16;)e.shift();return h.set(c,e),d}(b,c);try{await a.decide(b,c,d)}catch(a){g.warn("agent-source-decide-failed",{worktreeId:b.worktreeId,cliToolId:b.cliToolId,instanceId:b.instanceId??b.cliToolId,decisionId:c.id,error:a instanceof Error?a.message:String(a)}),e.delivery={delivered:!1,reason:a instanceof Error?`decide-threw:${a.message}`:"decide-threw"}}let f=e.delivery;return{body:function(a){let b=h.get(a.key);if(b){let c=b.indexOf(a);c>=0&&b.splice(c,1),0===b.length&&h.delete(a.key)}return a.body??{}}(e),delivery:f}}},28862:(a,b,c)=>{c.d(b,{k:()=>d});let d="command-code"},32301:(a,b,c)=>{c.d(b,{VV:()=>J,RH:()=>F,rE:()=>G,yw:()=>E,tc:()=>I});var d=c(36925),e=c(3161),f=c(72626),g=c(57510),h=c(34114),i=c(33294),j=c(86594),k=c(98322),l=c(38892),m=c(71193);let n=(0,f.h)("lib/hooks/sources/opencode-v2/history"),o=["session.execution.succeeded","session.execution.failed","session.execution.interrupted"];function p(a){return null!==a&&o.includes(a)}function q(a){return"number"==typeof a&&Number.isFinite(a)?a:null}function r(a){let b=(0,g.Qd)(a.time)?a.time:null;return q(b?.created)??0}let s=(0,d.v)("__opencodeV2HistoryQueue",()=>new Map);async function t(a,b,c){let d=[],e=null;for(let f=0;f<5;f+=1){let i=await (0,h.VW)(a,b,c,e);if(null===i)return 0===f?null:d;if(d.push(...i.data),i.data.some(a=>(0,g.Qd)(a)&&"user"===(0,g.O2)(a,"type"))||null===i.next||0===i.data.length)break;e=i.next}return d}async function u(a,b,d){let e=a.instanceId??a.cliToolId;if(0===b.body.length)return n.info("opencode-v2-history-turn-empty",{worktreeId:a.worktreeId,instanceId:e,sessionId:b.sessionId}),!1;b.unknownPartTypes.length>0&&n.info("opencode-v2-history-unknown-parts",{worktreeId:a.worktreeId,instanceId:e,sessionId:b.sessionId,partTypes:b.unknownPartTypes});let f=(0,j.jT)(b.userMessageId),[{getDbInstance:g},{createMessage:h,findMessageByRequestId:i},{broadcastMessage:k}]=await Promise.all([Promise.resolve().then(c.bind(c,88807)),Promise.resolve().then(c.bind(c,56791)),Promise.all([c.e(1356),c.e(1503),c.e(1191),c.e(8791),c.e(1719),c.e(2119),c.e(2445),c.e(8728)]).then(c.bind(c,43015))]),l=g();if(i(l,a.worktreeId,f))return!1;let m=h(l,{worktreeId:a.worktreeId,role:"assistant",content:b.body,messageType:"normal",timestamp:new Date(d>0?d:Date.now()),cliToolId:a.cliToolId,instanceId:e,requestId:f});return k("message",{worktreeId:a.worktreeId,message:m}),n.info("opencode-v2-history-turn-saved",{worktreeId:a.worktreeId,instanceId:e,sessionId:b.sessionId,requestId:f,bodyLength:b.body.length,textParts:b.textParts,toolParts:b.toolParts}),!0}var v=c(51719);let w=(0,f.h)("lib/hooks/sources/opencode-v2/usage");function x(a,b){let c=a[b];return"number"==typeof c&&Number.isFinite(c)&&c>0?c:0}async function y(a,b,c,d=()=>!0){try{let f=(0,l.X3)(a);if(null===f)return null;let i=await (0,h.u7)(b,f,c),j=(0,e.Yv)(i,Date.now());if(!j||!j.id)return null;let k=j.provider,m=j.model,[n,o]=await Promise.all([(0,h.nR)(b,f,j.id),k&&m?(0,h.am)(b,f):Promise.resolve(null)]),p=n?function(a){let b=null;for(let c of a){if(!(0,g.Qd)(c)||"assistant"!==(0,g.O2)(c,"type"))continue;let a=(0,g.Qd)(c.tokens)?c.tokens:null;if(!a)continue;let d=x(a,"output");if(d<=0)continue;let e=(0,g.Qd)(a.cache)?a.cache:{},f=x(a,"input")+d+x(a,"reasoning")+x(e,"read")+x(e,"write"),h=function(a){let b=(0,g.Qd)(a.time)?a.time:null,c=b?.created;return"number"==typeof c&&Number.isFinite(c)?c:0}(c),i=(0,g.O2)(c,"id")??"";(null===b||h>b.at||h===b.at&&i>b.id)&&(b={at:h,id:i,total:f})}return b?.total??null}(n):null,q=o&&k&&m?function(a,b,c){for(let d of a){if(!(0,g.Qd)(d)||d.providerID!==b||d.id!==c)continue;let a=(0,g.Qd)(d.limit)?d.limit:null,e=a?.context;if("number"!=typeof e||!Number.isFinite(e)||e<=0)break;return e}return null}(o,k,m):null;if(!d())return null;return(0,e.G1)(a,j),(0,e.T9)(a,{tokens:p,limit:q,percent:(0,e.sI)(p,q),sessionAt:j.at,at:Date.now()}),j}catch(c){return w.warn("opencode-v2-usage-refresh-failed",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,port:b,error:c instanceof Error?c.message:String(c)}),null}}let z=(0,d.v)("__opencodeV2UsageRefreshes",()=>new Map),A=(0,f.h)("lib/hooks/sources/opencode-v2/subscription"),B=[500,1e3,2e3,4e3,8e3,15e3,3e4],C=(0,d.v)("__opencodeV2Subscriptions",()=>new Map),D=(0,d.v)("__opencodeV2EndedLiveness",()=>new Map);function E(a){return C.has((0,l.Y_)(a))}function F(a){let b=(0,l.Y_)(a);return C.get(b)?.liveness??D.get(b)??{state:"unknown"}}function G(a){return"live"===F(a).state}function H(a){return{close:async()=>{await J(a.target)},get liveness(){return a.liveness}}}function I(a,b,c,d){let e=(0,l.Y_)(a),f=C.get(e);if(f)return H(f);D.delete(e);let g={key:e,target:a,port:b,onEvent:c,normalize:d,streamController:new AbortController,lifetimeController:new AbortController,liveness:{state:"unknown"},closed:!1,watchdog:null};return C.set(e,g),A.info("opencode-v2-subscription-opened",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,port:b}),O(g),H(g)}async function J(a){let b=(0,l.Y_)(a);D.delete(b);let c=C.get(b);c&&(K(c),C.delete(b),(0,e.cI)(a),A.info("opencode-v2-subscription-closed",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,port:c.port}))}function K(a){a.closed=!0,M(a),a.streamController.abort(),a.lifetimeController.abort()}function L(a,b){K(a),a.liveness={state:"lost",since:Date.now(),reason:b},C.get(a.key)===a&&C.delete(a.key),D.set(a.key,a.liveness),(0,e.cI)(a.target),A.warn("opencode-v2-subscription-ended",{worktreeId:a.target.worktreeId,instanceId:a.target.instanceId??a.target.cliToolId,port:a.port,reason:b})}function M(a){null!==a.watchdog&&(clearTimeout(a.watchdog),a.watchdog=null)}function N(a){a.liveness={state:"live",lastHeartbeatAt:Date.now()},M(a);let b=setTimeout(()=>{a.closed||(A.warn("opencode-v2-subscription-heartbeat-lost",{worktreeId:a.target.worktreeId,instanceId:a.target.instanceId??a.target.cliToolId,port:a.port,afterMs:6e4}),a.streamController.abort())},6e4);b.unref?.(),a.watchdog=b}async function O(a){let b=0,c=0;for(;!a.closed;){a.streamController=new AbortController;let d="stream-ended";try{let e=(0,l.X3)(a.target);if(null===e)return void L(a,"password-file-missing");let f=await (0,h.tJ)(a.port,e);if(a.closed)return;if("rejected"===f.kind){if(c+=1,d=`server-rejected-${f.status}`,c>=3)return void L(a,"port-identity-changed")}else if("unreachable"===f.kind)d="server-unreachable";else{c=0;let d=await (0,h.MT)(a.port,e,a.streamController.signal);for await(let c of(N(a),b=0,await P(a.target,a.port,e,b=>Q(a,b)),d)){if(a.closed)break;N(a),"frame"===c.kind&&Q(a,c.frame)}}}catch(a){d=a instanceof Error?a.message:String(a)}finally{M(a)}if(a.closed)return;a.liveness={state:"lost",since:Date.now(),reason:d},A.info("opencode-v2-subscription-disconnected",{worktreeId:a.target.worktreeId,instanceId:a.target.instanceId??a.target.cliToolId,port:a.port,reason:d,attempt:b}),await function(a,b){return new Promise(c=>{if(b.aborted)return void c();let d=()=>{clearTimeout(e),c()};b.addEventListener("abort",d,{once:!0});let e=setTimeout(()=>{b.removeEventListener("abort",d),c()},a);e.unref?.()})}(B[Math.min(b,B.length-1)],a.lifetimeController.signal),b+=1}}async function P(a,b,c,d){let e=0;try{let[f,i]=await Promise.all([(0,h.LO)(b,c),(0,h.CI)(b,c)]),j=(b,c,f)=>{let h=(b??[]).filter(g.Qd),i=h.slice(0,50);for(let b of(h.length>i.length&&A.warn("opencode-v2-resync-truncated",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,type:c,examined:i.length,skipped:h.length-i.length,limit:50}),i)){let a="string"==typeof b.id&&""!==b.id?b.id:null;null!==a&&(d({id:`resync_${a}`,type:c,data:f(b)}),e+=1)}};j(f,"permission.asked",a=>a),j(i,"form.created",a=>({form:a}))}catch(b){A.warn("opencode-v2-resync-failed",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,error:b instanceof Error?b.message:String(b)})}return e>0&&A.info("opencode-v2-resync",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,replayed:e}),e}function Q(a,b){try{!function(a,b,c,d=Date.now()){if(!(0,v.cT)((0,v.Cr)(a)))return;let e=b({payload:a,receivedAt:d});e&&c(e)}(b,a.normalize,a.onEvent)}catch(c){A.warn("opencode-v2-frame-delivery-failed",{worktreeId:a.target.worktreeId,instanceId:a.target.instanceId??a.target.cliToolId,type:(0,v.Cr)(b),error:c instanceof Error?c.message:String(c)})}(function(a,b,c){try{if(!p((0,v.Cr)(c)))return null;let d=(0,v.lx)(c);if(null===d)return null;(function(a,b){let c=(s.get(a)??Promise.resolve()).then(b,b).then(()=>void 0,()=>void 0);s.set(a,c),c.then(()=>{s.get(a)===c&&s.delete(a)})})((0,l.Y_)(a),async()=>{let c=a.instanceId??a.cliToolId;try{let e=(0,l.X3)(a);if(null===e)return n.info("opencode-v2-history-unavailable",{worktreeId:a.worktreeId,instanceId:c,reason:"password-file-missing"}),0;let f=await t(b,e,d);if(null===f)return n.warn("opencode-v2-history-unavailable",{worktreeId:a.worktreeId,instanceId:c,port:b,sessionId:d,reason:"messages-unreadable"}),0;(0,i.recordAgentReportedModel)(a.worktreeId,m.B,a.instanceId??m.B,function(a){let b=null;for(let c of a){if(!(0,g.Qd)(c)||"assistant"!==(0,g.O2)(c,"type"))continue;let a=(0,g.NZ)(c,["model","id"]);if(null===a)continue;let d=r(c),e=(0,g.O2)(c,"id")??"";(null===b||d>b.at||d===b.at&&e>b.id)&&(b={at:d,id:e,model:a})}return b?.model??null}(f));let h=(function(a,b){let c=a.filter(g.Qd).filter(a=>null!==(0,g.O2)(a,"id")).map((a,b)=>({message:a,index:b})).sort((a,b)=>{let c=r(a.message)-r(b.message);if(0!==c)return c;let d=(0,g.O2)(a.message,"id")??"",e=(0,g.O2)(b.message,"id")??"";return d<e?-1:d>e?1:a.index-b.index}).map(({message:a})=>a),d=[],e=null,f=a=>{e&&d.push({...e,closed:a}),e=null};for(let a of c){let c=(0,g.O2)(a,"id"),d=(0,g.O2)(a,"type");if("user"===d){f(!0),e={accumulator:(0,k.lp)(b,c,r(a)),completedAt:null};continue}if(!e)continue;let h=e;if("idle"===d){f(!0);continue}if("assistant"!==d)continue;h.accumulator.assistantMessageIds.add(c),(Array.isArray(a.content)?a.content:[]).forEach((a,b)=>{let d=function(a,b,c){if(!(0,g.Qd)(c))return null;let d=(0,g.O2)(c,"type");if(!d)return null;let e=(0,g.Qd)(c.state)?c.state:null;return{id:`${a}#${b}`,messageId:a,type:d,text:"string"==typeof c.text?c.text:null,tool:"tool"===d?(0,g.O2)(c,"name"):null,status:e?(0,g.O2)(e,"status"):null,title:e?(0,g.O2)(e,"title"):null,error:e?(0,g.O2)(e,"error")??(0,g.NZ)(e,["error","message"]):null}}(c,b,a);d&&(0,k.yG)(h.accumulator,d)});let i=(0,g.Qd)(a.time)?a.time:null,j=q(i?.completed)??q(i?.created);null!==j&&j>(h.completedAt??0)&&(h.completedAt=j)}return f(!1),d})(f,d).filter(a=>a.closed).slice(-50),j=0;for(let b of h){let c=(0,k.JZ)(b.accumulator),d=Math.max(b.accumulator.startedAt,b.completedAt??0);await u(a,c,d)&&(j+=1)}return j}catch(e){return n.error("opencode-v2-history-sync-failed",{worktreeId:a.worktreeId,instanceId:c,port:b,sessionId:d,error:e instanceof Error?e.message:String(e)}),0}})}catch(b){return A.warn("opencode-v2-history-trigger-failed",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,error:b instanceof Error?b.message:String(b)}),null}})(a.target,a.port,b),function(a,b,c,d=()=>!0){try{var e;if(!("session.usage.updated"===(e=(0,v.Cr)(c))||p(e)))return null;let f=(0,v.lx)(c);if(null===f)return null;!function(a,b,c,d=()=>!0){let e=(0,l.Y_)(a),f=z.get(e);if(f)return f.queued={port:b,sessionId:c,isCurrent:d},f.running;let g={running:Promise.resolve(),queued:null};g.running=(async()=>{let f={port:b,sessionId:c,isCurrent:d};for(;null!==f;){let b=f;g.queued=null,await y(a,b.port,b.sessionId,b.isCurrent),f=g.queued}z.get(e)===g&&z.delete(e)})(),z.set(e,g),g.running}(a,b,f,d)}catch(b){return A.warn("opencode-v2-usage-trigger-failed",{worktreeId:a.worktreeId,instanceId:a.instanceId??a.cliToolId,error:b instanceof Error?b.message:String(b)}),null}}(a.target,a.port,b,()=>{var b;return!(b=a).closed&&C.get(b.key)===b})}},38367:(a,b,c)=>{c.d(b,{Jp:()=>h,WK:()=>e,lb:()=>f,ue:()=>g});var d=c(57510);let e={Stop:"stop",SubagentStop:"stop",Notification:"notification",SessionStart:"session_start",SessionEnd:"session_end",UserPromptSubmit:"user_prompt_submit",PreToolUse:"pre_tool_use",PostToolUse:"post_tool_use"},f=["session_id","conversationId"],g=["tool_use_id"];function h(a,b){let c="notification"===a?"notification_type":"session_end"===a?"reason":"session_start"===a?"source":"pre_tool_use"===a||"post_tool_use"===a?"tool_name":null;return null===c?null:(0,d.Wv)((0,d.O2)(b,c))}},40964:(a,b,c)=>{c.d(b,{s4:()=>k,NN:()=>n,Ze:()=>l,mf:()=>m});var d=c(15194);let e=/^[a-zA-Z0-9_-]+$/;function f(a){if(!e.test(a))throw Error(`Invalid session name format: ${a}`)}var g=c(15608);let h="mcbd-",i=/^[0-9a-f]{8}$/,j=[...d.XH].sort((a,b)=>b.length-a.length);function k(){return globalThis.__cmTmuxSessionNamespace??null}function l(a,b,c,e){var g=null===a?h:`${h}${a}-`;let i=`${g}${b}-${c}`;if(!e||e===b)return f(i),i;let j=(0,d.pL)(e,b),k=j?`${i}-${j}`:i;return f(k),k}function m(a,b,c){let d=k(),e=l(d,a,b,c);return null===d?e:(0,g.mc)(e)??e}function n(a){if(!a.startsWith(h))return null;let b=a.slice(h.length),c=null,d=b.indexOf("-");d>0&&i.test(b.slice(0,d))&&(c=b.slice(0,d),b=b.slice(d+1));let e=j.find(a=>b.startsWith(`${a}-`));if(!e)return null;let f=b.slice(e.length+1);return""===f?null:{namespace:c,cliToolId:e,rest:f}}},45567:(a,b,c)=>{c.d(b,{K9:()=>i,ZM:()=>f,wS:()=>g});var d=c(87447),e=c(43252);let f="CM_HOOK_URL",g="CM_HOOK_PORT",h="CM_PORT";function i(a){let b=Object.entries(h in a.env?a.env:{...a.env,[h]:String((0,d.D0)())}).map(([a,b])=>`${a}=${(0,e.ZL)(b)}`);return 0===b.length?a.command:`${b.join(" ")} ${a.command}`}},51719:(a,b,c)=>{c.d(b,{Ai:()=>g,Cr:()=>l,DH:()=>o,Dg:()=>q,IQ:()=>p,ZL:()=>r,cT:()=>k,dA:()=>i,er:()=>h,lx:()=>n,xz:()=>f,y8:()=>s});var d=c(62887),e=c(57510);let f="permission_prompt",g="question_prompt",h=d.KC,i="error",j=["session.execution.started","session.execution.succeeded","session.execution.failed","session.execution.interrupted","permission.asked","permission.replied","form.created","form.replied","form.cancelled"];function k(a){return null!==a&&j.includes(a)}function l(a){return(0,e.NZ)(a,["type"])}function m(a){return(0,e.Qd)(a.data)?a.data:{}}function n(a){return(0,e.NZ)(m(a),["sessionID"])??(0,e.NZ)(m(a),["form","sessionID"])??(0,e.NZ)(a,["durable","aggregateID"])}function o(a){let b=m(a);switch(l(a)){case"permission.asked":return(0,e.NZ)(b,["id"]);case"form.created":return(0,e.NZ)(b,["form","id"])??(0,e.NZ)(b,["id"]);case"permission.replied":return(0,e.NZ)(b,["requestID"])??(0,e.NZ)(b,["id"]);case"form.replied":case"form.cancelled":return(0,e.NZ)(b,["formID"])??(0,e.NZ)(b,["id"])??(0,e.NZ)(b,["requestID"]);default:return null}}function p(a){return(0,e.hY)(o(a))}function q(a){return(0,e.NZ)(m(a),["action"])}function r(a){let b=m(a);return(0,e.NZ)(b,["error","message"])??(0,e.NZ)(b,["error","data","message"])??(0,e.NZ)(b,["error","name"])??(0,e.NZ)(b,["message"])}let s=[(0,e.KR)("session.execution.started","user_prompt_submit"),(0,e.KR)("session.execution.succeeded","stop"),(0,e.KR)("session.execution.interrupted","stop"),(0,e.KR)("session.execution.failed","stop",i),(0,e.KR)("permission.asked","notification",f),(0,e.KR)("permission.replied","notification",h),(0,e.KR)("form.created","notification",g),(0,e.KR)("form.replied","notification",h),(0,e.KR)("form.cancelled","notification",h)].map(a=>(b,c)=>{let d=a(b,c);return d?{...d,conversationId:d.conversationId??n(c)}:null})},54633:(a,b,c)=>{c.d(b,{V:()=>d});let d="copilot"},56365:(a,b,c)=>{c.d(b,{VM:()=>an});var d=c(2466),e=c(13287),f=c(67548),g=c(62887),h=c(43252),i=c(66101),j=c(57510),k=c(38367),l=c(34257),m=c(70997);let n={};function o(a){return"allowOnce"!==a.kind?n:{hookSpecificOutput:{hookEventName:e.l9,decision:{behavior:"allow"}}}}let p=(0,i.UB)({cliToolId:m.v,noDecision:{kind:"proceeds"},capabilities:{supportedEvents:g.b0,configScope:"per-instance",decisionTimeoutSeconds:h.sI,permissionHookPredictsDialog:!0,sessionStartMayArriveLate:!1,permissionReplyReleasesPrompt:!1,eventIdentity:null,resync:"none",transcriptHistory:"pull",stopReportsSelfResume:!1},mappers:[...(0,j.mJ)(k.WK),l.Bo],nativeEventNameFields:["hook_event_name"],conversationIdFields:k.lb,toolCallIdFields:k.ue,modelFields:["model"],extractModel:l._P,promptJoinsOpenTurn:function(a){if(!0===a.queuedNotice)return!0;let b=a.prompt;return"string"==typeof b&&b.trimStart().startsWith("<task-notification>")},extractDetail:k.Jp,parsePermissionRequest:a=>(0,e.ss)(a),parseQuestion:a=>(0,d.ek)(a),encodeVerdict:o,prepareLaunch:({target:a,executablePath:b})=>{let c="own-home"===(0,f.y3)(),d={worktreeId:a.worktreeId,instanceId:a.instanceId,cliToolId:a.cliToolId};(0,h.q)()&&(0,f.Hx)(m.v,[(0,h.K6)(),(0,h.iR)(d)]);let e=(0,h.D2)(b,d);if(c&&e===b)throw new f.ci(m.v,(0,h.q)()?"the hook settings file could not be written":"CM_AGENT_HOOKS_INJECT=0",(0,h.q)()?"Make CM_AGENT_HOOKS_DIR writable by the dedicated user.":"Do not combine CM_AGENT_HOOKS_INJECT=0 with own-home.");let g=(0,h.q)()&&e!==b?(0,h.iR)({worktreeId:a.worktreeId,instanceId:a.instanceId,cliToolId:a.cliToolId}):null;return{command:(0,f.WM)()?`${e} --setting-sources ${f.mc}`:e,settingsPath:g,env:{}}}});var q=c(92196),r=c(21758),s=c(54633);let t={},u=(0,i.UB)({cliToolId:s.V,noDecision:{kind:"proceeds"},capabilities:{supportedEvents:["stop","session_start","session_end","user_prompt_submit","post_tool_use"],configScope:"global-singleton",decisionTimeoutSeconds:r.TV,permissionHookPredictsDialog:!1,sessionStartMayArriveLate:!0,permissionReplyReleasesPrompt:!1,eventIdentity:null,resync:"none",transcriptHistory:null,stopReportsSelfResume:!1},mappers:(0,j.mJ)(k.WK),nativeEventNameFields:["hook_event_name"],conversationIdFields:k.lb,toolCallIdFields:k.ue,extractDetail:k.Jp,parsePermissionRequest:function(a){if(!(0,j.Qd)(a)||a.hook_event_name!==r.cN)return null;let b=(0,j.O2)(a,"tool_name");if(!b||b.length>e.vy)return null;let c=(0,q.mw)(a.tool_input);return c?{toolName:b,toolInput:c.toolInput,toolInputNormalization:c.normalization,promptId:null,sessionId:(0,j.O2)(a,"session_id"),permissionMode:null,permissionSuggestions:null}:null},parseQuestion:()=>null,encodeVerdict:function(a){return"allowOnce"===a.kind?{hookSpecificOutput:{hookEventName:r.cN,permissionDecision:"allow"}}:"deny"===a.kind?{hookSpecificOutput:{hookEventName:r.cN,permissionDecision:"deny",permissionDecisionReason:a.message??"denied by CommandMate"}}:t},prepareLaunch:({target:a,executablePath:b})=>(0,r.Rv)(b,a)});var v=c(15194);let w={ToolPermission:"permission_prompt"};var x=c(33873),y=c(72626),z=c(45567),A=c(29021),B=c(7956);function C(a){if(!(0,A.existsSync)(a))return null;try{let b=JSON.parse((0,A.readFileSync)(a,"utf8"));return(0,j.Qd)(b)?b:null}catch{return null}}function D(a,b){if((0,B.Mb)(a))throw Error(`Refusing to write inside a virtual filesystem: ${a} (a recursive mkdir under /proc, /sys or /dev never returns on Linux; Issue #1774)`);(0,A.mkdirSync)((0,x.dirname)(a),{recursive:!0,mode:448}),(0,A.writeFileSync)(a,`${JSON.stringify(b,null,2)}
|
|
4
|
-
`,{mode:384})}var E=c(77904);let F=(0,y.h)("lib/hooks/sources/gemini/settings-generator"),G=1e3*h.W6,H=[["SessionStart","session_start"],["BeforeAgent","user_prompt_submit"],["AfterAgent","stop"],["Notification","notification"],["SessionEnd","session_end"]];function I(a,b){return a.includes("cmate-agent-event.sh")&&a.includes(`--tool ${E.o}`)&&a.includes(`--worktree-id ${(0,h.ZL)(b)}`)}let J=(0,i.UB)({cliToolId:E.o,noDecision:{kind:"proceeds"},capabilities:{supportedEvents:["session_start","user_prompt_submit","stop","notification","session_end"],configScope:"per-worktree",decisionTimeoutSeconds:0,permissionHookPredictsDialog:!1,sessionStartMayArriveLate:!1,permissionReplyReleasesPrompt:!1,eventIdentity:null,resync:"none",transcriptHistory:null,stopReportsSelfResume:!1},mappers:(0,j.mJ)({SessionStart:"session_start",SessionEnd:"session_end",BeforeAgent:"user_prompt_submit",AfterAgent:"stop",BeforeTool:"pre_tool_use",AfterTool:"post_tool_use",Notification:"notification"}),nativeEventNameFields:["hook_event_name"],conversationIdFields:k.lb,toolCallIdFields:[],extractDetail:function(a,b){if("notification"!==a)return(0,k.Jp)(a,b);let c=(0,j.O2)(b,"notification_type");return null===c?null:(0,j.Wv)(w[c]??c)},parsePermissionRequest:()=>null,parseQuestion:()=>null,encodeVerdict:()=>({}),prepareLaunch:function({target:a,executablePath:b,worktreePath:c}){let d={worktreeId:a.worktreeId,instanceId:a.instanceId,cliToolId:E.o},e=(0,v.n6)(a.instanceId??E.o)?function(a,b){if(!(0,h.q)())return null;let c=(0,h.Os)();if(!c)return F.warn("gemini-hook-relay-missing",{worktreeId:b.worktreeId}),null;let d=(0,x.join)(a,".gemini","settings.json");try{let a=C(d),e=function(a,b){let c={};for(let[e,f]of H){var d;c[e]=[{hooks:[{type:"command",command:(d=b.worktreeId,[(0,h.ZL)(a),"--tool",E.o,"--event",f,"--worktree-id",(0,h.ZL)(d),"--stdin-json"].join(" ")),timeout:G}]}]}return c}(c,b);return D(d,function(a,b,c){let d=(0,j.Qd)(a?.hooks)?a.hooks:{},e={};for(let[a,b]of Object.entries(d)){if(!Array.isArray(b)){e[a]=b;continue}let d=b.filter(a=>!function(a,b){if(!(0,j.Qd)(a))return!1;let c=a.hooks;return Array.isArray(c)?c.length>0&&c.every(a=>(0,j.Qd)(a)&&"string"==typeof a.command&&I(a.command,b)):"string"==typeof a.command&&I(a.command,b)}(a,c));e[a]=d.length===b.length?b:d}for(let[a,c]of Object.entries(b)){let b=e[a];e[a]=Array.isArray(b)?[...b,...c]:[...c]}return{...a,hooks:e}}(a,e,b.worktreeId)),d}catch(a){return F.warn("gemini-hook-settings-write-failed",{worktreeId:b.worktreeId,error:a instanceof Error?a.message:String(a)}),null}}(c,d):null,{command:f,env:g}=function(a,b,c={}){if(!(0,h.q)())return{command:a,env:{}};if(!(0,v.n6)((0,h.g5)(b)))return F.warn("gemini-hook-invalid-instance-id",{worktreeId:b.worktreeId}),{command:a,env:{}};let d=(0,h.xM)({...b,cliToolId:E.o},c);return{command:(0,h.ZL)(a),env:{[z.ZM]:d}}}(b,d);return{command:f,settingsPath:e,env:g}}});var K=c(21820),L=c(76835);let M=(0,y.h)("lib/hooks/sources/antigravity/hooks-config"),N="commandmate",O=[["SessionStart","session_start"],["PostToolUse","post_tool_use"],["Stop","stop"]],P="CM_PERMISSION_HOOK_URL",Q=h.sI,R=new Set(["PreToolUse","PostToolUse"]);function S(a={}){return a.path??(0,x.join)((0,K.homedir)(),".gemini","config","hooks.json")}function T(a,b){return[(0,h.ZL)(a),"--tool",L.F,"--event",b,"--stdin-json"].join(" ")}let U="fullyIdle";function V(a){let b={};for(let[c,d]of O){let e={type:"command",command:"stop"===d?function(a){let b=`'"${U}":false'`;return`p=$(cat); set --; case "$(printf '%s' "$p" | tr -d ' \\t\\r\\n')" in *${b}*) set -- --detail ${g.HV} ;; esac; printf '%s' "$p" | ${T(a,"stop")} "$@"`}(a):T(a,d),timeout:h.W6};b[c]=R.has(c)?[{matcher:"*",hooks:[e]}]:[e]}return b.PreToolUse=[{matcher:"*",hooks:[{type:"command",command:function(){let a=`"$${P}"`,b=`printf '%s' ${(0,h.ZL)('{"decision":"ask"}')}`;return`if [ -z "\${${P}:-}" ]; then cat >/dev/null; ${b}; exit 0; fi; set -- -sS -f -m 4 -X POST -H 'Content-Type: application/json'; if [ -n "\${${h.XE}:-}" ]; then set -- "$@" -H "Authorization: Bearer $${h.XE}"; fi; out=$(curl "$@" --data-binary @- ${a} 2>/dev/null); case "$out" in '{'*'"decision"'*) printf '%s' "$out" ;; *) ${b} ;; esac`}(),timeout:h.sI}]}],b}function W(a={}){var b;let c=S(a);if(!(0,h.q)())return{usable:!1,reason:"CM_AGENT_HOOKS_INJECT=0",fix:"Do not combine CM_AGENT_HOOKS_INJECT=0 with UAT isolation."};let d=(0,h.Os)();if(!d)return{usable:!1,reason:"this build ships no relay script",fix:f.f0};let e=C(c);if(null===e)return M.info("antigravity-hooks-config-absent-readonly",{configPath:c}),{usable:!1,reason:`${c} does not exist or cannot be read`,fix:f.f0};if(Object.keys(e).some(a=>a!==N))return M.info("antigravity-hooks-config-foreign-readonly",{configPath:c}),{usable:!1,reason:`${c} also holds hooks (or keys) CommandMate did not write, which would run in the UAT session`,fix:"Skip antigravity scenarios in this UAT, or run it where the shared hooks file holds only the hook CommandMate writes."};let g=(b=V(d),{...null,[N]:b});return JSON.stringify(e)!==JSON.stringify(g)?(M.info("antigravity-hooks-config-differs-readonly",{configPath:c}),{usable:!1,reason:`${c} differs from what this build writes`,fix:f.f0}):{usable:!0,configPath:c}}let X={decision:"ask"},Y=(0,i.UB)({cliToolId:L.F,noDecision:{kind:"proceeds"},capabilities:{supportedEvents:["session_start","post_tool_use","stop"],configScope:"global-singleton",decisionTimeoutSeconds:Q,permissionHookPredictsDialog:!1,sessionStartMayArriveLate:!1,permissionReplyReleasesPrompt:!1,eventIdentity:null,resync:"none",transcriptHistory:"pull",stopReportsSelfResume:!0},mappers:[],nativeEventNameFields:[],conversationIdFields:["conversationId"],toolCallIdFields:[],modelFields:["modelName"],extractDetail:function(a,b){return"pre_tool_use"===a||"post_tool_use"===a?(0,j.Wv)((0,j.NZ)(b,["toolCall","name"])):"stop"===a&&!1===b[U]?g.HV:null},parsePermissionRequest:function(a){if(!(0,j.Qd)(a))return null;let b=a.toolCall;if(!(0,j.Qd)(b))return null;let c=(0,j.O2)(b,"name");return c&&!(c.length>e.vy)&&(0,j.Qd)(b.args)?{toolName:c,toolInput:b.args,promptId:null,sessionId:(0,j.O2)(a,"conversationId"),permissionMode:null,permissionSuggestions:null}:null},parseQuestion:()=>null,encodeVerdict:function(a){return"allowOnce"===a.kind?{decision:"allow"}:"deny"===a.kind?{decision:"deny",reason:a.message??""}:{...X}},prepareLaunch:({target:a,executablePath:b})=>{let c=function(a={}){if(!(0,h.q)())return null;let b=(0,h.Os)();if(!b)return M.warn("antigravity-hook-relay-missing"),null;let c=S(a),d=(0,f.ox)("antigravity",[c]);try{var e,g;if("read-only"===d){let b=W(a);return b.usable?b.configPath:null}let f=(e=C(c),g=V(b),{...e,[N]:g});return D(c,f),c}catch(a){return M.warn("antigravity-hooks-config-write-failed",{error:a instanceof Error?a.message:String(a)}),null}}();if(null===c&&(0,f.WM)()){if("own-home"===(0,f.y3)())throw new f.ci("antigravity","~/.gemini/config/hooks.json could not be prepared",f.f0);let a=W();throw a.usable?new f.ci("antigravity","~/.gemini/config/hooks.json could not be prepared",f.f0):new f.ci("antigravity",a.reason,a.fix)}let{command:d,env:e}=function(a,b,c={}){if(!(0,h.q)())return{command:a,env:{}};if(!(0,v.n6)((0,h.g5)(b)))return M.warn("antigravity-hook-invalid-instance-id",{worktreeId:b.worktreeId}),{command:a,env:{}};let d={...b,cliToolId:L.F};return{command:(0,h.ZL)(a),env:{[z.ZM]:(0,h.xM)(d,c),[P]:(0,h.O$)(d,c)}}}(b,{worktreeId:a.worktreeId,instanceId:a.instanceId,cliToolId:L.F});return{command:d,settingsPath:c,env:e}}});var Z=c(99432),$=c(2734);let _={},aa=(0,i.UB)({cliToolId:$.c,noDecision:{kind:"proceeds"},capabilities:{supportedEvents:Z.JD,configScope:"global-singleton",decisionTimeoutSeconds:5,permissionHookPredictsDialog:!0,sessionStartMayArriveLate:!1,permissionReplyReleasesPrompt:!1,eventIdentity:null,resync:"none",transcriptHistory:"pull",stopReportsSelfResume:!1},mappers:(0,j.mJ)(k.WK),nativeEventNameFields:["hook_event_name"],conversationIdFields:k.lb,toolCallIdFields:k.ue,modelFields:["model"],extractDetail:k.Jp,parsePermissionRequest:a=>(0,e.ss)(a),parseQuestion:()=>null,encodeVerdict:function(a){return"allowOnce"===a.kind?{hookSpecificOutput:{hookEventName:Z.l1,decision:{behavior:"allow"}}}:"deny"===a.kind?{hookSpecificOutput:{hookEventName:Z.l1,decision:{behavior:"deny",message:a.message??""}}}:_},prepareLaunch:({target:a,executablePath:b})=>(0,Z.S9)(b,a)});var ab=c(85965),ac=c(28862);let ad=(0,y.h)("lib/hooks/sources/command-code/hooks-config"),ae=[["SessionStart","session_start"],["PreToolUse","pre_tool_use"],["PostToolUse","post_tool_use"],["Stop","stop"]],af=h.W6;function ag(a,b){return a.includes("cmate-agent-event.sh")&&a.includes(`--tool ${ac.k}`)&&a.includes(`--worktree-id ${(0,h.ZL)(b)}`)}let ah=(0,i.UB)({cliToolId:ac.k,noDecision:{kind:"proceeds"},capabilities:{supportedEvents:["session_start","pre_tool_use","post_tool_use","stop"],configScope:"per-worktree",decisionTimeoutSeconds:null,permissionHookPredictsDialog:!1,sessionStartMayArriveLate:!1,permissionReplyReleasesPrompt:!1,eventIdentity:null,resync:"none",transcriptHistory:"pull",stopReportsSelfResume:!1},mappers:(0,j.mJ)({SessionStart:"session_start",PreToolUse:"pre_tool_use",PostToolUse:"post_tool_use",Stop:"stop"}),nativeEventNameFields:["hook_event_name"],conversationIdFields:["session_id"],toolCallIdFields:k.ue,extractDetail:k.Jp,parsePermissionRequest:()=>null,parseQuestion:()=>null,encodeVerdict:function(a){return{}},prepareLaunch:({target:a,executablePath:b,worktreePath:c})=>{let d={worktreeId:a.worktreeId,instanceId:a.instanceId,cliToolId:ac.k},e=function(a,b){if(!(0,h.q)())return null;let c=(0,h.Os)();if(!c)return ad.warn("command-code-hook-relay-missing",{worktreeId:b.worktreeId}),null;let d=(0,x.join)(a,".commandcode","settings.local.json");try{let a=C(d),e=function(a,b){let c={};for(let[e,f]of ae){var d;c[e]=[{matcher:"",hooks:[{type:"command",command:(d=b.worktreeId,[(0,h.ZL)(a),"--tool",ac.k,"--event",f,"--worktree-id",(0,h.ZL)(d),"--stdin-json"].join(" ")),timeout:af}]}]}return c}(c,b);return D(d,function(a,b,c){let d=(0,j.Qd)(a?.hooks)?a.hooks:{},e={};for(let[a,b]of Object.entries(d)){if(!Array.isArray(b)){e[a]=b;continue}let d=b.filter(a=>!function(a,b){if(!(0,j.Qd)(a))return!1;let c=a.hooks;return Array.isArray(c)?c.length>0&&c.every(a=>(0,j.Qd)(a)&&"string"==typeof a.command&&ag(a.command,b)):"string"==typeof a.command&&ag(a.command,b)}(a,c));e[a]=d.length===b.length?b:d}for(let[a,c]of Object.entries(b)){let b=e[a];e[a]=Array.isArray(b)?[...b,...c]:[...c]}return{...a,hooks:e}}(a,e,b.worktreeId)),d}catch(a){return ad.warn("command-code-hook-settings-write-failed",{worktreeId:b.worktreeId,error:a instanceof Error?a.message:String(a)}),null}}(c,d),{command:f,env:g}=function(a,b,c={}){if(!(0,h.q)())return{command:a,env:{}};if(!(0,v.n6)((0,h.g5)(b)))return ad.warn("command-code-hook-invalid-instance-id",{worktreeId:b.worktreeId}),{command:a,env:{}};let d=(0,h.xM)({...b,cliToolId:ac.k},c);return{command:(0,h.ZL)(a),env:{[z.ZM]:d}}}(b,d);return{command:f,settingsPath:e,env:g}}});var ai=c(16100),aj=c(36925);let ak=(0,aj.v)("__agentEventSources",()=>new Map),al=(0,aj.v)("__agentEventLegacySources",()=>new Map);function am(a){ak.set(a.cliToolId,a),al.delete(a.cliToolId)}function an(a){let b=ak.get(a);if(b)return b;let c=al.get(a);if(c)return c;let f=(0,i.UB)({cliToolId:a,noDecision:{kind:"proceeds"},capabilities:{supportedEvents:[],configScope:"none",decisionTimeoutSeconds:null,permissionHookPredictsDialog:!1,sessionStartMayArriveLate:!1,permissionReplyReleasesPrompt:!1,eventIdentity:null,resync:"none",transcriptHistory:null,stopReportsSelfResume:!1},mappers:(0,j.mJ)(k.WK),nativeEventNameFields:["hook_event_name"],conversationIdFields:k.lb,toolCallIdFields:k.ue,extractDetail:k.Jp,parsePermissionRequest:a=>(0,e.ss)(a),parseQuestion:a=>(0,d.ek)(a),encodeVerdict:o,prepareLaunch:({executablePath:a})=>({command:a,settingsPath:null,env:{}})});return al.set(a,f),f}am(p),am(u),am(J),am(Y),am(aa),am(ab.cC),am(ah),am(ai.Wp)},66101:(a,b,c)=>{c.d(b,{Kf:()=>k,UB:()=>i,kS:()=>j});var d=c(62887),e=c(57510),f=c(25071);let g={close:async()=>{},liveness:{state:"unknown"}};function h(a,b,c){let f=c.receivedAt??Date.now(),g=b.length>0?(0,e.oJ)(c.payload,b):null;if(null!=c.event&&(0,d.o0)(c.event))return(0,e.Uq)({event:c.event},c.payload,f,{detail:a.extractDetail,conversationId:a.conversationIdFields,toolCallId:a.toolCallIdFields,modelFields:a.modelFields,extractModel:a.extractModel});let h=(0,e.qU)(a.mappers,g,c.payload);return h?(0,e.Uq)(h,c.payload,f,{detail:a.extractDetail,conversationId:a.conversationIdFields,toolCallId:a.toolCallIdFields,modelFields:a.modelFields,extractModel:a.extractModel}):((0,e.ex)(a.cliToolId,g),null)}function i(a){let b=a.nativeEventNameFields??["hook_event_name"];return{cliToolId:a.cliToolId,transport:"push",noDecision:a.noDecision,capabilities:a.capabilities,normalizeEvent:c=>h(a,b,c),eventIdentityOf:b=>a.extractEventIdentity?.(b)??null,promptJoinsOpenTurn:b=>a.promptJoinsOpenTurn?.(b)??!1,parsePermissionRequest:a.parsePermissionRequest,parseQuestion:a.parseQuestion,encodeVerdict:b=>({kind:"responseBody",body:a.encodeVerdict(b)}),prepareLaunch:a.prepareLaunch,subscribe:async()=>g,async decide(b,c,d){let e=(0,f.o4)(b,c.id,a.encodeVerdict(d));(0,f.oy)(b,c.id,{delivered:e,reason:e?"response-body":"slot-closed"})},listPending:async a=>(0,f.qK)(a),probeActivity:async()=>null,liveness:()=>({state:"unknown"})}}function j(a){let b=a.nativeEventNameFields??["type"];return{cliToolId:a.cliToolId,transport:"pull",noDecision:a.noDecision,capabilities:a.capabilities,normalizeEvent:c=>h(a,b,c),eventIdentityOf:b=>a.extractEventIdentity?.(b)??null,parsePermissionRequest:a.parsePermissionRequest,parseQuestion:a.parseQuestion,encodeVerdict:()=>({kind:"outOfBand"}),prepareLaunch:a.prepareLaunch??(a=>({command:a.executablePath,settingsPath:null,env:{}})),subscribe:a.subscribe,decide:a.decide,listPending:a.listPending,probeActivity:a.probeActivity,liveness:a.liveness}}function k(a,b,c){let d="pull"===a.transport?"sse":0===a.capabilities.supportedEvents.length?"scraper":"hooks";if("sse"!==d)return{kind:d};switch(b.state){case"live":return c-b.lastHeartbeatAt>=3e4?{kind:"sse",liveness:"stale",degradedReason:"heartbeat_stale"}:{kind:"sse",liveness:"live"};case"lost":return{kind:"scraper",liveness:"stale",degradedReason:b.reason};case"unknown":return{kind:"scraper",degradedReason:"not_subscribed"}}}},67548:(a,b,c)=>{c.d(b,{Hx:()=>s,WM:()=>o,ci:()=>p,f0:()=>q,mc:()=>m,ox:()=>t,y3:()=>n});var d=c(29021),e=c.n(d),f=c(21820),g=c.n(f),h=c(33873),i=c.n(h);let j="CM_UAT_ISOLATION",k="own-home",l="CM_UAT_DEDICATED_USER",m="project,local";function n(a=process.env){let b=a[j];return"1"===b?"shared-read-only":b===k?"own-home":"off"}function o(a=process.env){return"off"!==n(a)}class p extends Error{constructor(a,b,c){super("own-home"===n()?`${j}=${k}: refusing to start ${a}: ${b}. This server writes the hook config only inside the dedicated user's own HOME, and ${a} would otherwise start with hooks this server did not prepare. ${c}`:`${j}=1: refusing to start ${a}: ${b}. This server does not write the shared hook config in UAT isolation, and ${a} would read it anyway and run the production hooks. ${c}`),this.name="UatIsolationLaunchRefusedError"}}let q="Run the UAT with the same CommandMate build as the production server, so the shared file already matches what this build writes.",r=`Run ${j}=${k} as the user named by ${l}, with HOME set to that user's home and every hook config path (CODEX_HOME, CM_AGENT_HOOKS_DIR, ...) inside it.`;function s(a,b,c=process.env){if("own-home"!==n(c))return;let d=function(a,b=process.env,c=function(){let a=g().userInfo();return{username:a.username,uid:a.uid,homedir:a.homedir}}()){let d,f,h=b[l];if(!h)return`${l} is not set`;if(c.username!==h)return`this process runs as ${c.username}, not as the dedicated user ${h}`;let j=b.HOME;if(!j||!i().isAbsolute(j))return"HOME is not set to an absolute path";try{d=e().realpathSync(j),f=e().realpathSync(c.homedir)}catch{return`HOME (${j}) or ${h}'s home directory (${c.homedir}) does not exist`}if(d!==f)return`HOME (${j}) is not ${h}'s home directory (${c.homedir})`;if(e().statSync(d).uid!==c.uid)return`HOME (${j}) is not owned by ${h}`;for(let b of a){let a=function(a){let b,c=i().resolve(a),d=[];for(;;){let b=!1;try{e().lstatSync(c),b=!0}catch{b=!1}if(b)break;let f=i().dirname(c);if(f===c)return`${a} has no existing ancestor`;d.unshift(i().basename(c)),c=f}try{b=e().realpathSync(c)}catch{return`${c} is a symlink that points nowhere`}return{real:i().join(b,...d),owner:e().statSync(b).uid}}(b);if("string"==typeof a)return a;if(a.real!==d&&!a.real.startsWith(`${d}${i().sep}`))return`${b} resolves to ${a.real}, outside ${h}'s HOME (${d})`;if(a.owner!==c.uid)return`${b} (${a.real}) is not owned by ${h}`}return null}(b,c);if(d)throw new p(a,d,r)}function t(a,b,c=process.env){return"shared-read-only"===n(c)?"read-only":(s(a,b,c),"write")}},76835:(a,b,c)=>{c.d(b,{F:()=>d});let d="antigravity"},77904:(a,b,c)=>{c.d(b,{o:()=>d});let d="gemini"},83738:(a,b,c)=>{c.d(b,{RN:()=>h,gx:()=>q,hl:()=>i,oC:()=>r,rk:()=>p,s8:()=>l,vF:()=>j});var d=c(2466),e=c(57510);function f(a){return"string"==typeof a.type&&(0,e.Qd)(a.data)?(0,e.Qd)(a.data.form)?a.data.form:a.data:a}function g(a){return Array.isArray(a)?a.filter(a=>"string"==typeof a):[]}function h(a){let b=f(a),c=(0,e.O2)(b,"id"),d=(0,e.O2)(b,"sessionID");if(!c||!d||Array.isArray(b.fields))return null;let h=(0,e.O2)(b,"action"),i=(0,e.Qd)(b.metadata)?b.metadata:{};return{toolName:h??"permission",toolInput:{action:h,resources:g(b.resources),...i},promptId:c,sessionId:d,permissionMode:null,permissionSuggestions:Array.isArray(b.save)?b.save:null}}function i(a,b){let c=h(a);return c&&c.promptId?{kind:"permission",id:c.promptId,conversationId:c.sessionId,subject:{kind:"permission",toolName:c.toolName,toolInput:c.toolInput},raw:a,askedAt:b}:null}function j(a){let b=h(a);return b?{toolName:b.toolName,patterns:g(b.permissionSuggestions)}:null}let k=/^(Index: |={3,}$|--- |\+\+\+ )/;function l(a){let b=h(a);if(!b)return null;let c=b.toolInput,d="string"==typeof c.command&&""!==c.command?c.command:g(c.resources).join(", "),f=[""===d?b.toolName:`${b.toolName} ${d}`],i=Array.isArray(c.files)?c.files.filter(e.Qd):[];for(let a of i){let b="string"==typeof a.patch?a.patch.split("\n").filter(a=>!k.test(a)).join("\n").replace(/\n+$/,""):"";""!==b&&(i.length>1&&"string"==typeof a.file&&f.push(a.file),f.push(b))}return f.join("\n")}let m=[{label:"Yes",description:null,value:!0},{label:"No",description:null,value:!1}];function n(a){return a.trim().slice(0,d.Gb)}function o(a){if(!Array.isArray(a.fields))return null;let b=(0,e.O2)(a,"title"),c=[];for(let d of a.fields){if(!(0,e.Qd)(d))return null;if(!0===d.hidden)continue;let a=(0,e.O2)(d,"key");if(null===a)return null;let f=(0,e.O2)(d,"type"),g="boolean"===f?[...m]:"string"===f||"multiselect"===f?function(a){if(!Array.isArray(a)||0===a.length)return null;let b=[];for(let c of a){if(!(0,e.Qd)(c))return null;let a=(0,e.O2)(c,"value"),d=(0,e.O2)(c,"label")??a;if(null===a||null===d)return null;b.push({label:d,description:(0,e.O2)(c,"description"),value:a})}return b}(d.options):null;if(null===g)return null;let h=(0,e.O2)(d,"description")??(0,e.O2)(d,"title")??b;if(null===h)return null;c.push({key:a,question:h,header:(0,e.O2)(d,"title")??b,multiSelect:"multiselect"===f,custom:!0===d.custom&&"boolean"!==f,choices:g})}return c.length>0?c:null}function p(a){let b=f(a),c=(0,e.O2)(b,"id");if(!c)return null;let g=o(b);if(null===g)return null;let h=(0,d.u_)({questions:g.map(a=>({question:a.question,header:a.header,multiSelect:a.multiSelect,options:a.choices.map(a=>({label:a.label,...a.description?{description:a.description}:{}}))}))});return null===h?null:{questions:h.map((a,b)=>g[b]?.custom?{...a,custom:!0}:a),promptId:c}}function q(a,b){let c=f(a),d=p(c);return d&&d.promptId?{kind:"question",id:d.promptId,conversationId:(0,e.O2)(c,"sessionID"),subject:{kind:"question",spec:d},raw:c,askedAt:b}:null}function r(a,b){let c=o(f(a));if(null===c||b.length!==c.length)return null;let d={};for(let[a,e]of c.entries()){let c=[];for(let d of b[a]){let a=n(d),b=e.choices.find(b=>n(b.label)===a)??e.choices.find(a=>a.value===d);if(b)c.push(b.value);else{if(!e.custom||""===d.trim())return null;c.push(d.trim())}}if(e.multiSelect)d[e.key]=c.map(String);else{if(1!==c.length)return null;d[e.key]=c[0]}}return d}},85965:(a,b,c)=>{c.d(b,{cC:()=>u});var d=c(62887),e=c(43252),f=c(72626),g=c(66101),h=c(25071),i=c(49791),j=c(75356),k=c(98211),l=c(18529),m=c(84574),n=c(33198),o=c(85322);let p=(0,f.h)("lib/hooks/sources/opencode/source"),q=d.b0;async function r(a,b,c){let d=a.instanceId??a.cliToolId;if("abstain"===c.kind){p.warn("opencode-verdict-abstained",{worktreeId:a.worktreeId,instanceId:d,decisionId:b.id,consequence:"the agent waits indefinitely; nothing else will unblock it"}),(0,h.oy)(a,b.id,{delivered:!1,reason:"abstained"});return}let e=(0,m.hC)(a);if(null===e){p.warn("opencode-verdict-undeliverable-no-port",{worktreeId:a.worktreeId,instanceId:d,decisionId:b.id}),(0,h.oy)(a,b.id,{delivered:!1,reason:"no-port"});return}if("question"===b.kind){if("answer"!==c.kind){p.info("opencode-question-not-answerable",{worktreeId:a.worktreeId,instanceId:d,decisionId:b.id,verdict:c.kind}),(0,h.oy)(a,b.id,{delivered:!1,reason:"question-needs-answer-verdict"});return}let f=await (0,i.Ei)(e,b.id,c.answers);p.info("opencode-question-replied",{worktreeId:a.worktreeId,instanceId:d,decisionId:b.id,delivered:f}),(0,h.oy)(a,b.id,{delivered:f,reason:f?"question-reply":"question-reply-failed"});return}let f=function(a){switch(a.kind){case"allowOnce":return"once";case"allowAlways":return"always";case"deny":return"reject";case"answer":case"abstain":return null}}(c);if(null===f)return void(0,h.oy)(a,b.id,{delivered:!1,reason:"no-wire-value"});let g=await (0,i.LV)(e,b.id,f,"deny"===c.kind?c.message:void 0);p.info("opencode-permission-replied",{worktreeId:a.worktreeId,instanceId:d,decisionId:b.id,reply:f,delivered:g}),(0,h.oy)(a,b.id,{delivered:g,reason:g?`permission-reply:${f}`:"permission-reply-failed"})}async function s(a){let b=(0,m.hC)(a);if(null===b)return[];let c=Date.now(),[d,e]=await Promise.all([(0,i.Li)(b),(0,i.er)(b)]),f=[];for(let a of d){let b=(0,k.Lu)(a,c);b&&f.push(b)}for(let a of e){let b=(0,k.AB)(a,c);b&&f.push(b)}return f}async function t(a){let b=(0,m.hC)(a);return null===b?null:(0,i.xR)(b)}let u=(0,g.kS)({cliToolId:o.k,noDecision:{kind:"blocks"},capabilities:{supportedEvents:q,configScope:"none",decisionTimeoutSeconds:null,permissionHookPredictsDialog:!1,sessionStartMayArriveLate:!1,permissionReplyReleasesPrompt:!0,eventIdentity:"permission-id",resync:"session-status-poll",transcriptHistory:"push",stopReportsSelfResume:!1},mappers:j.lu,nativeEventNameFields:["type"],conversationIdFields:[],extractModel:j.pV,extractEventIdentity:j.oG,parsePermissionRequest:k.FZ,parseQuestion:k.v1,subscribe:(a,b)=>(0,n.bP)(a,b,a=>u.normalizeEvent(a),{resync:u.capabilities.resync}),decide:r,listPending:s,probeActivity:t,liveness:a=>(0,n.lf)(a),prepareLaunch:function({target:a,executablePath:b}){let c={command:/^[A-Za-z0-9_./-]+$/.test(b)?b:(0,e.ZL)(b),settingsPath:null,env:{}};if(!(0,e.q)())return c;let d=(0,m.hC)(a);if(null===d)return c;let f=(0,l.Lj)((0,l.Q1)(a));return{command:`${(0,e.ZL)(b)} --port ${d} --hostname ${i.Vc}`+f,settingsPath:null,env:{}}}})},99432:(a,b,c)=>{c.d(b,{l1:()=>H,JD:()=>I,S9:()=>Q,dO:()=>K});var d=c(79646),e=c(29021),f=c(21820),g=c(33873),h=c(8004),i=c(67548),j=c(15194),k=c(87447),l=c(43252),m=c(72626),n=c(73434),o=c(66007),p=c(57510);let q=(0,m.h)("lib/hooks/sources/codex/relay-install");function r(a){return(0,g.join)(a,"commandmate","cmate-agent-event.sh")}function s(a,b){var c;let d=(0,e.readFileSync)(a,"utf8");if(((0,e.existsSync)(b)?(0,e.readFileSync)(b,"utf8"):null)===d)return;(0,e.mkdirSync)((0,g.dirname)(b),{recursive:!0,mode:448});let f=(c=b,`${c}.tmp`);try{t(f),(0,e.writeFileSync)(f,d,{mode:448,flag:"wx"}),(0,e.renameSync)(f,b)}catch(a){throw t(f),a}q.info("codex-relay-installed",{target:b})}function t(a){try{(0,e.unlinkSync)(a)}catch{}}var u=c(2734);let v=(0,m.h)("lib/hooks/sources/codex/hooks-config"),w="127.0.0.1",x="commandmate:agent-hooks",y="CODEX_HOME",z="CM_AGENT_WORKTREE_ID",A="CM_AGENT_INSTANCE_ID",B="CM_HOOK_URL",C="CM_PERMISSION_HOOK_URL",D="--no-daemon",E=RegExp(`${D}(?![\\w-])`),F=new Map,G={SessionStart:"session_start",UserPromptSubmit:"user_prompt_submit",Stop:"stop",SessionEnd:"session_end"},H="PermissionRequest",I=Object.values(G);function J(){let a=process.env.CM_CODEX_HOOK_TRUST;return"bypass"===a||"never"===a||"auto"===a?a:"auto"}function K(a){if("never"===J()||"shared-read-only"===(0,i.y3)())return!1;try{if((0,e.existsSync)((0,g.join)(a,".codex","hooks.json")))return v.info("codex-hooks-trust-withheld-repo-hooks",{worktreePath:a}),!1}catch{return!1}return!0}function L(a={}){let b=(0,g.join)((0,f.homedir)(),".codex");return a.codexHome?(0,h.T)(a.codexHome,b,"CodexHookOptions.codexHome"):(0,h.T)(process.env[y],b,y)}function M(a={}){return(0,g.join)(L(a),"hooks.json")}function N(a,b){return`http://${w}:\${CM_PORT:-3000}${a}${b}`}function O(a,b){return`${JSON.stringify(function(a,b){let c=(0,p.Qd)(a)?{...a}:{},d=(0,p.Qd)(c.hooks)?c.hooks:{},e={};for(let[a,b]of Object.entries(d))e[a]=Array.isArray(b)?b.map(a=>{if(!(0,p.Qd)(a)||!Array.isArray(a.hooks))return a;let b=a.hooks.filter(a=>!((0,p.Qd)(a)&&"string"==typeof a.command&&a.command.includes(x)));return b.length===a.hooks.length?a:{...a,hooks:b}}).filter(a=>!((0,p.Qd)(a)&&Array.isArray(a.hooks))||a.hooks.length>0):b;for(let[a,c]of Object.entries(b.hooks)){let b=e[a];(void 0===b||Array.isArray(b))&&(e[a]=[...b??[],...c])}return c.hooks=e,c}(a,function(a={}){let b=(b,c)=>({hooks:[{type:"command",command:function(a,b={}){let c=` # ${x}`,d=function(a={}){if(void 0!==a.relayScriptPath)return a.relayScriptPath;let b=r(L(a));return(0,e.existsSync)(b)?b:null}(b);if(d)return[(0,l.ZL)(d),"--tool",u.c,"--event",a,"--worktree-id",`"$${z}"`,"--instance-id",`"$${A}"`,"--stdin-json"].join(" ")+c;let f=b.withAuthHeader??(0,l.yc)()?` -H "Authorization: Bearer $${l.XE}"`:"",g=`"\${${B}:-${N(l.jx,"")}}?tool=${u.c}\${${z}:+&worktreeId=$${z}}\${${A}:+&instanceId=$${A}}"`;return`curl -sS -f -m ${l.W6} -X POST -H 'Content-Type: application/json'${f} --data-binary @- ${g} >/dev/null 2>&1 || true${c}`}(b,a),timeout:c}]}),c={};for(let[a,d]of Object.entries(G)){let e="SessionEnd"===a?3:l.W6;c[a]=[b(d,e)]}return c[H]=[{hooks:[{type:"command",command:function(a={}){let b=a.withAuthHeader??(0,l.yc)()?` -H "Authorization: Bearer $${l.XE}"`:"",c=`"\${${C}:-${N(l.WZ,`?tool=${u.c}`)}}"`;return`curl -sS -f -m ${l.sI} -X POST -H 'Content-Type: application/json'${b} --data-binary @- ${c} 2>/dev/null || true # ${x}`}(a),timeout:l.sI}]}],{hooks:c}}(b)),null,2)}
|
|
5
|
-
`}function P(a={}){let b=M(a);if(void 0===a.relayScriptPath){let b=(0,l.Os)(),c=r(L(a));try{if(b&&(0,e.existsSync)(c)&&(0,e.readFileSync)(b,"utf8")!==(0,e.readFileSync)(c,"utf8"))return v.info("codex-hooks-shared-relay-differs-readonly",{installed:c}),{usable:!1,reason:`the installed relay ${c} differs from the one this build ships`,fix:i.f0}}catch{return{usable:!1,reason:`the installed relay ${c} could not be read`,fix:i.f0}}}try{if(!(0,e.existsSync)(b))return v.info("codex-hooks-shared-absent-readonly",{settingsPath:b}),{usable:!1,reason:`${b} does not exist`,fix:i.f0};let c=(0,e.readFileSync)(b,"utf8");if(c===O(null,a))return{usable:!0,settingsPath:b};if(c===O(JSON.parse(c),a))return v.info("codex-hooks-shared-foreign-readonly",{settingsPath:b}),{usable:!1,reason:`${b} also holds hooks (or keys) CommandMate did not write, which would run in the UAT session`,fix:"Skip codex scenarios in this UAT, or run it where the shared hooks file holds only the hooks CommandMate writes."};return v.info("codex-hooks-shared-differs-readonly",{settingsPath:b}),{usable:!1,reason:`${b} differs from what this build writes`,fix:i.f0}}catch(a){return v.warn("codex-hooks-config-unreadable",{settingsPath:b,error:a instanceof Error?a.message:String(a)}),{usable:!1,reason:`${b} could not be read`,fix:i.f0}}}function Q(a,b,c={}){let f={command:a,settingsPath:null,env:{}},h=(a,b)=>{if((0,i.WM)())throw new i.ci("codex",a,b);return f};if(!(0,l.q)())return h("CM_AGENT_HOOKS_INJECT=0","Do not combine CM_AGENT_HOOKS_INJECT=0 with UAT isolation.");let m=b.instanceId??u.c;if(!(0,o.h6)(b.worktreeId)||!(0,j.n6)(m))return v.warn("codex-hooks-invalid-correlation-key",{worktreeId:b.worktreeId}),h("the worktree or instance id is not a valid correlation key","Use a valid worktree and instance id.");try{let f=function(a={}){let b=M(a),c=L(a),d=r(c);if("read-only"===(0,i.ox)("codex",[c,b,d,`${d}.tmp`,(0,g.join)(c,"config.toml")]))return function(a={}){let b=P(a);return b.usable?b.settingsPath:null}(a);void 0===a.relayScriptPath&&("own-home"===(0,i.y3)()?function(a,b){if(!b)throw Error("this build ships no relay script");let c=r(a);if(b!==c&&s(b,c),!(0,e.existsSync)(c)||(0,e.readFileSync)(c,"utf8")!==(0,e.readFileSync)(b,"utf8"))throw Error(`the installed relay ${c} differs from the one this build ships`)}(c,(0,l.Os)()):function(a,b){let c=r(a);if(b&&b!==c)try{s(b,c)}catch(a){q.warn("codex-relay-install-failed",{target:c,error:a instanceof Error?a.message:String(a)})}(0,e.existsSync)(c)}(c,(0,l.Os)()));let f=null,h=null;if((0,e.existsSync)(b))try{h=(0,e.readFileSync)(b,"utf8"),f=JSON.parse(h)}catch(a){return v.warn("codex-hooks-config-unreadable",{settingsPath:b,error:a instanceof Error?a.message:String(a)}),null}let j=O(f,a);return h===j||((0,e.mkdirSync)((0,g.dirname)(b),{recursive:!0,mode:448}),(0,e.writeFileSync)(b,j,{mode:384})),b}(c);if(!f){let a="shared-read-only"===(0,i.y3)()?P(c):null;if(a&&!a.usable)return h(a.reason,a.fix);return h(`${M(c)} or its relay is missing or differs from what this build writes`,i.f0)}let j=c.port??(0,k.D0)(),o=new URLSearchParams({tool:u.c,worktreeId:b.worktreeId,instanceId:m}),p={[y]:L(c),CM_AGENT_TOOL:u.c,[z]:b.worktreeId,[A]:m,[B]:`http://${w}:${j}${l.jx}`,[C]:`http://${w}:${j}${l.WZ}?${o.toString()}`},t=c.supportsNoDaemon??function(a){let b=F.get(a);if(void 0!==b)return b;let c=!1;try{let b=(0,d.spawnSync)(a,["--help"],{encoding:"utf8",timeout:5e3,env:(0,n.hh)()});c=!b.error&&0===b.status&&E.test(String(b.stdout??""))}catch{c=!1}return F.set(a,c),c}(a)?` ${D}`:"",x="bypass"===J()?" --dangerously-bypass-hook-trust":"";return{command:`${(0,l.ZL)(a)} -c features.daemon_auto_start=false${t}${x}`,settingsPath:f,env:p}}catch(a){if(a instanceof i.ci)throw a;return v.warn("codex-hooks-config-write-failed",{worktreeId:b.worktreeId,error:a instanceof Error?a.message:String(a)}),h(`the hook config could not be prepared (${a instanceof Error?a.message:String(a)})`,i.f0)}}}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2053],{24027:(e,t,s)=>{s.d(t,{Uc:()=>A,G8:()=>v,OJ:()=>C,RF:()=>R});var l=s(95155),a=s(12115),n=s(18955),r=s(51238),i=s(89451),d=s(10934),o=s(92254),c=s(5225);s(1226);var u=s(89715),x=s(57828),m=s(52056),p=s(65229),g=s(67909),h=s(3005);let k=(0,g.default)(()=>Promise.all([s.e(221),s.e(7485),s.e(953)]).then(s.bind(s,90953)).then(e=>({default:e.MermaidDiagram})),{loadableGenerated:{webpack:()=>[90953]},ssr:!1,loading:function(){let e=(0,n.c)("worktree");return(0,l.jsxs)("div",{className:"mermaid-loading flex items-center gap-2 text-muted-foreground p-4",children:[(0,l.jsx)(h.y,{size:"sm"}),(0,l.jsx)("span",{children:e("mermaid.loading")})]})}});function f(e){let{className:t,children:s}=e;if(t&&t.split(" ").includes("language-mermaid")){let e=null==s?"":"string"==typeof s?s:Array.isArray(s)?s.map(e=>"string"==typeof e?e:"").join(""):String(s);return(0,l.jsx)(k,{code:e})}return(0,l.jsx)("code",{className:t,children:s})}var j=s(50666),b=s(38021),y=s(69352),N=s(76246),w=s(99112);let v=(0,a.memo)(function(e){let{content:t,onOpenFile:s,currentFilePath:n,worktreeId:u}=e,x=(0,a.useRef)(s);x.current=s;let m=(0,a.useRef)(n);m.current=n;let p=(0,a.useRef)(u);p.current=u;let g=(0,a.useCallback)((e,t)=>{let s=(0,y.d3)(t);if(s)switch((0,y.dj)(s)){case"anchor":break;case"external":e.preventDefault(),window.open(s,"_blank","noopener,noreferrer");break;case"relative":{e.preventDefault();let t=m.current,l=x.current;if(t&&l){let e=(0,y.WU)(t,s);e&&l(e)}}}},[]),h=(0,a.useMemo)(()=>({code:f,pre:e=>{let{children:t}=e;return!function(e){let t=a.Children.toArray(e)[0];if(!a.isValidElement(t))return!1;let s=t.props.className;return"string"==typeof s&&s.split(" ").includes("language-mermaid")}(t)?(0,l.jsx)(j.Ck,{children:(0,l.jsx)("pre",{className:"overflow-x-auto",children:t})}):(0,l.jsx)("pre",{children:t})},img:e=>{var t,s,a,n;let{src:r,alt:i,width:d,height:o,...c}=e,u=null!=d?d:null==(s=c.node)||null==(t=s.properties)?void 0:t.width,x=null!=o?o:null==(n=c.node)||null==(a=n.properties)?void 0:a.height;if("string"==typeof r&&!r.startsWith("http://")&&!r.startsWith("https://")&&!r.startsWith("data:")){let e=m.current,t=p.current;if(e&&t){let s=(0,y.WU)(e,r);if(s){let e="/api/worktrees/".concat(t,"/files/").concat((0,N.o)(s));return(0,l.jsx)(b.n,{apiUrl:e,alt:null!=i?i:"",width:u,height:x})}}}return(0,l.jsx)("img",{src:r,alt:null!=i?i:"",width:u,height:x,style:{maxWidth:u||"100%"}})},a:e=>{let{href:t,children:s,...a}=e;return t?(0,l.jsx)("a",{...a,href:t,onClick:e=>g(e,t),children:s}):(0,l.jsx)("a",{...a,children:s})}}),[g]),k=(0,a.useMemo)(()=>[i.A,[d.A,y.uO],o.A,c.A],[]);return(0,l.jsx)(r.oz,{remarkPlugins:w.eT,rehypePlugins:k,components:h,children:t})}),R=(0,a.memo)(function(e){let{mobileTab:t,onTabChange:s}=e,a=(0,n.c)("worktree");return(0,l.jsxs)("div",{className:"flex border-b border-border",children:[(0,l.jsxs)("button",{"data-testid":"mobile-tab-editor",onClick:()=>s("editor"),className:"flex-1 py-2 text-sm font-medium ".concat("editor"===t?"text-accent-600 dark:text-accent-400 border-b-2 border-accent-600 dark:border-accent-400":"text-muted-foreground"),children:[(0,l.jsx)(u.A,{className:"h-4 w-4 inline-block mr-1"}),a("markdownPreview.editor")]}),(0,l.jsxs)("button",{"data-testid":"mobile-tab-preview",onClick:()=>s("preview"),className:"flex-1 py-2 text-sm font-medium ".concat("preview"===t?"text-accent-600 dark:text-accent-400 border-b-2 border-accent-600 dark:border-accent-400":"text-muted-foreground"),children:[(0,l.jsx)(x.A,{className:"h-4 w-4 inline-block mr-1"}),a("markdownPreview.preview")]})]})}),C=(0,a.memo)(function(e){let{isMobile:t}=e,s=(0,n.c)("worktree");return(0,l.jsxs)("div",{"data-testid":"maximize-hint",className:"flex items-center justify-center px-4 py-1 bg-muted text-muted-foreground text-xs",children:[s("markdownPreview.exitFullscreenHint")," ",t&&s("markdownPreview.exitFullscreenHintSwipe")]})}),A=(0,a.memo)(function(e){let{onDismiss:t}=e,s=(0,n.c)("worktree");return(0,l.jsxs)("div",{"data-testid":"large-file-warning",className:"flex items-center gap-2 px-4 py-2 bg-warning-subtle border-b border-warning-border text-warning-foreground text-sm",children:[(0,l.jsx)(m.A,{className:"h-4 w-4"}),s("markdownPreview.largeFileWarning"),(0,l.jsx)("button",{onClick:t,className:"ml-auto text-warning hover:text-warning",children:(0,l.jsx)(p.A,{className:"h-4 w-4"})})]})})},34380:(e,t,s)=>{s.d(t,{B:()=>K});var l=s(95155),a=s(12115),n=s(18955),r=s(48407),i=s(54014),d=s(74385),o=s(50825),c=s(37381);function u(e){var t,s,l,a,n;let r=e.agentInstances&&e.agentInstances.length>0?e.agentInstances.map(e=>e.alias||e.cliTool):null!=(s=e.selectedAgents)?s:e.cliToolId?[e.cliToolId]:[];return{id:e.id,name:e.name,repositoryName:null!=(l=e.repositoryDisplayName)?l:e.repositoryName,syncedBranch:null!=(a=e.branch)?a:null,liveBranch:null!=(n=null==(t=e.gitStatus)?void 0:t.currentBranch)?n:null,dirty:e.gitStatus?e.gitStatus.isDirty:null,agents:[...new Set(r)],sessionRunning:!0===e.isSessionRunning}}let x={status:"loading",options:[]};async function m(e){let t=await fetch("/api/worktrees",{signal:e,headers:{Accept:"application/json"}});if(!t.ok)throw Error("HTTP ".concat(t.status));let s=await t.json(),l=null==s?void 0:s.worktrees;if(!Array.isArray(l))throw Error("Malformed worktree list");return l.map(u)}function p(e){let{selectedWorktreeId:t,onSelect:s,disabled:i=!1}=e,d=(0,n.c)("skills"),[o,u]=(0,a.useState)(x),[p,h]=(0,a.useState)(0);(0,a.useEffect)(()=>{let e=new AbortController;return u(x),m(e.signal).then(t=>{e.signal.aborted||u({status:"loaded",options:t})}).catch(()=>{e.signal.aborted||u({status:"error",options:[]})}),()=>e.abort()},[p]);let k=(0,a.useCallback)(()=>h(e=>e+1),[]);return"loading"===o.status?(0,l.jsxs)("div",{className:"space-y-2","data-testid":"skill-target-loading",children:[(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:d("target.loading")}),(0,l.jsx)(r.EA,{className:"h-24 w-full rounded-lg"})]}):"error"===o.status?(0,l.jsxs)(r.Zp,{className:"space-y-3","data-testid":"skill-target-error",children:[(0,l.jsx)(c.u,{tone:"danger",children:d("target.errorNotice")}),(0,l.jsx)(r.$n,{variant:"secondary",size:"sm",onClick:k,"data-testid":"skill-target-retry",children:d("target.retry")})]}):0===o.options.length?(0,l.jsx)(r.Zp,{"data-testid":"skill-target-empty",children:(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:d("target.empty")})}):(0,l.jsxs)("div",{className:"space-y-3","data-testid":"skill-target-selector",children:[(0,l.jsx)("div",{role:"radiogroup","aria-label":d("target.heading"),className:"space-y-2",children:o.options.map(e=>(0,l.jsx)(g,{option:e,selected:e.id===t,disabled:i,onSelect:s},e.id))}),(0,l.jsx)(c.u,{tone:"neutral","data-testid":"skill-target-branch-notice",children:d("target.branchFreshnessNotice")})]})}function g(e){var t;let{option:s,selected:a,disabled:i,onSelect:d}=e,o=(0,n.c)("skills"),c=null!=(t=s.liveBranch)?t:s.syncedBranch;return(0,l.jsxs)("button",{type:"button",role:"radio","aria-checked":a,disabled:i,onClick:()=>d(s.id),"data-testid":"skill-target-option-".concat(s.id),className:"w-full rounded-lg border px-3 py-2.5 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-60 ".concat(a?"border-accent-500 bg-accent-50 dark:bg-accent-950/40":"border-border bg-card hover:bg-muted"),children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("span",{className:"text-sm font-semibold text-foreground break-all",children:s.name}),a&&(0,l.jsx)(r.Ex,{variant:"info",children:o("target.selected")})]}),(0,l.jsxs)("dl",{className:"mt-1.5 grid grid-cols-1 gap-x-4 gap-y-1 sm:grid-cols-2",children:[(0,l.jsx)(h,{label:o("target.repository"),children:s.repositoryName}),(0,l.jsx)(h,{label:o("target.branch"),children:null!=c?c:o("target.branchUnknown")}),(0,l.jsx)(h,{label:o("target.agents"),children:s.agents.length>0?s.agents.join(", "):o("target.agentsNone")}),(0,l.jsx)(h,{label:o("target.workingTree"),children:o(null===s.dirty?"target.workingTreeUnknown":s.dirty?"target.workingTreeDirty":"target.workingTreeClean")})]}),s.sessionRunning&&(0,l.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground","data-testid":"skill-target-session-".concat(s.id),children:o("target.sessionRunning")})]})}function h(e){let{label:t,children:s}=e;return(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("dt",{className:"text-xs font-medium text-muted-foreground",children:t}),(0,l.jsx)("dd",{className:"text-xs text-foreground break-words",children:s})]})}var k=s(95584);function f(e){let{label:t,children:s}=e;return(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("dt",{className:"text-xs font-medium text-muted-foreground",children:t}),(0,l.jsx)("dd",{className:"mt-0.5 break-words text-sm text-foreground",children:s})]})}function j(e){let{level:t,kind:s,label:a}=e,i=(0,n.c)("skills");return(0,l.jsxs)(r.Ex,{variant:k.eK[t],"data-testid":"skill-plan-risk-".concat(s,"-").concat(t),children:[a,": ",i(k.pP[t])]})}function b(e){let{entry:t}=e,s=(0,n.c)("skills"),a=k.KL[t.reason];return(0,l.jsxs)("li",{className:"space-y-1.5 rounded-md border border-border px-3 py-2","data-testid":"skill-plan-file-".concat(t.path),children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)(r.Ex,{variant:k.tC[t.change],children:s(k.AS[t.change])}),(0,l.jsx)("span",{className:"break-all font-mono text-xs text-foreground",children:t.path}),t.generated&&(0,l.jsx)(r.Ex,{variant:"gray",children:s("plan.fileGenerated")})]}),a&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:s(a)}),t.gitIgnored&&(0,l.jsx)("p",{className:"text-xs text-warning-foreground",children:s("plan.gitIgnored")}),t.binary?(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:s("plan.diffBinary")}):t.diff?(0,l.jsxs)("details",{children:[(0,l.jsx)("summary",{className:"cursor-pointer text-xs text-accent-600 dark:text-accent-400",children:s("plan.diffToggle",{additions:t.additions,deletions:t.deletions})}),(0,l.jsx)("pre",{className:"mt-1 overflow-x-auto rounded bg-muted p-2 font-mono text-[11px] leading-snug text-foreground",children:t.diff}),t.diffTruncated&&(0,l.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:s("plan.diffTruncated")})]}):null]})}function y(e){var t,s,a;let{plan:i}=e,d=(0,n.c)("skills"),{target:o,skill:u}=i,x=u.compatibility.commandmate;return(0,l.jsxs)(r.Zp,{className:"space-y-4","data-testid":"skill-install-plan",children:[(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:d("plan.heading")}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:d("plan.expiresAt",{timestamp:i.expiresAt})})]}),(0,l.jsxs)("section",{className:"space-y-2",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("plan.targetHeading")}),(0,l.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,l.jsx)(f,{label:d("target.repository"),children:o.repositoryName}),(0,l.jsx)(f,{label:d("target.heading"),children:o.worktreeName}),(0,l.jsx)(f,{label:d("target.branch"),children:null!=(t=o.branch)?t:d("target.branchUnknown")}),(0,l.jsx)(f,{label:d("plan.headStateLabel"),children:d(null!=(s=k.kF[o.headState])?s:"plan.headState.unknown")}),(0,l.jsx)(f,{label:d("target.workingTree"),children:o.workingTreeDirty?d("target.workingTreeDirty"):d("target.workingTreeClean")}),(0,l.jsx)(f,{label:d("plan.installRoot"),children:(0,l.jsx)("span",{className:"break-all font-mono text-xs",children:(o.installRoots&&o.installRoots.length>0?o.installRoots:[o.installRoot]).map(e=>(0,l.jsx)("span",{className:"block",children:e},e))})}),(0,l.jsx)(f,{label:d("plan.existingInstall"),children:o.existingInstall?d("plan.existingInstallVersion",{version:o.existingInstall.version}):d("plan.existingInstallNone")}),(0,l.jsx)(f,{label:d("detail.recommendedVersion"),children:(0,l.jsx)("span",{className:"font-mono text-xs",children:u.version})})]})]}),(0,l.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-risk-section",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("plan.riskHeading")}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,l.jsx)(j,{level:u.declaredRisk,kind:"declared",label:d("plan.riskDeclared")}),(0,l.jsx)(j,{level:u.computedRisk,kind:"computed",label:d("plan.riskComputed")}),(0,l.jsx)(j,{level:u.effectiveRisk,kind:"effective",label:d("plan.riskEffective")})]}),(0,l.jsx)("p",{className:"break-words text-sm text-foreground",children:u.riskRationale}),(0,l.jsx)(c.u,{tone:"neutral",children:d("plan.riskNotice")})]}),(0,l.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-permissions",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("permissions.heading")}),u.declaredPermissions.length>0?(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5",children:u.declaredPermissions.map(e=>(0,l.jsx)(r.Ex,{variant:"warning",children:k.z2[e]?d(k.z2[e]):e},e))}):(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:d("plan.permissionsNone")}),(0,l.jsx)(c.u,{tone:"warning",children:d("permissions.declarationOnlyNotice")})]}),(0,l.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-requirements",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("requirements.heading")}),0===u.requirements.commands.length&&0===u.requirements.networkHosts.length?(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:d("plan.requirementsNone")}):(0,l.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[u.requirements.commands.length>0&&(0,l.jsx)(f,{label:d("plan.requirementsCommands"),children:u.requirements.commands.map(e=>{var t;return"".concat(e.name," ").concat(null!=(t=e.versionRange)?t:d("plan.commandAnyVersion"))}).join(", ")}),u.requirements.networkHosts.length>0&&(0,l.jsx)(f,{label:d("plan.requirementsHosts"),children:u.requirements.networkHosts.join(", ")})]})]}),(0,l.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-scripts",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("plan.scriptsHeading")}),0===u.executablePaths.length&&0===u.scriptPaths.length?(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:d("plan.scriptsNone")}):(0,l.jsx)("ul",{className:"space-y-1",children:[...new Set([...u.scriptPaths,...u.executablePaths])].map(e=>(0,l.jsx)("li",{className:"break-all font-mono text-xs text-foreground",children:e},e))})]}),"compatible"!==x.status&&(0,l.jsx)(c.u,{tone:"warning","data-testid":"skill-plan-compatibility-notice",children:d((0,k.e5)(x.messageKey),{range:x.requiredRange,currentVersion:null!=(a=x.currentVersion)?a:""})}),i.warnings.length>0&&(0,l.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-warnings",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("plan.warningsHeading")}),(0,l.jsx)("ul",{className:"space-y-1",children:i.warnings.map(e=>(0,l.jsx)("li",{className:"text-xs text-warning-foreground",children:k.RO[e]?d(k.RO[e]):e},e))})]}),(0,l.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-files",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("plan.filesHeading")}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-plan-stats",children:d("plan.stats",{added:i.stats.added,modified:i.stats.modified,unchanged:i.stats.unchanged,conflicted:i.stats.conflicted,unmanaged:i.stats.unmanaged})}),0===i.files.length?(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:d("plan.filesEmpty")}):(0,l.jsx)("ul",{className:"space-y-2",children:i.files.map(e=>(0,l.jsx)(b,{entry:e},e.path))})]}),i.blockers.length>0&&(0,l.jsxs)("section",{className:"space-y-2","data-testid":"skill-install-blockers",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-danger-foreground",children:d("plan.blockersHeading")}),(0,l.jsx)("ul",{className:"space-y-1",children:i.blockers.map(e=>{var t,s;return(0,l.jsxs)("li",{className:"text-xs text-danger-foreground",children:[e.path&&(0,l.jsx)("span",{className:"mr-1 break-all font-mono",children:e.path}),e.code.startsWith("skills.")?d((0,k.e5)(e.code),{range:x.requiredRange,currentVersion:null!=(t=x.currentVersion)?t:""}):k.KL[e.code]?d(k.KL[e.code]):e.code]},"".concat(e.code,":").concat(null!=(s=e.path)?s:""))})}),(0,l.jsx)(c.u,{tone:"danger",children:d("plan.blockedNotice")})]})]})}function N(e){let{entry:t}=e,s=(0,n.c)("skills"),a=k.Mj[t.disposition],i=k.hJ[t.reason];return(0,l.jsxs)("li",{className:"flex flex-wrap items-center gap-2","data-testid":"skill-uninstall-file-".concat(t.path),children:[(0,l.jsx)(r.Ex,{variant:"remove"===t.disposition?"info":"warning",children:a?s(a):t.disposition}),(0,l.jsx)("span",{className:"break-all font-mono text-xs text-foreground",children:t.path}),i&&(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:s(i)})]})}function w(e){var t;let{plan:s}=e,a=(0,n.c)("skills"),{target:d,skill:o}=s;return(0,l.jsxs)(r.Zp,{className:"space-y-4","data-testid":"skill-uninstall-plan",children:[(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:a("uninstall.heading")}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:a("uninstall.expiresAt",{timestamp:s.expiresAt})})]}),(0,l.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,l.jsx)(f,{label:a("target.repository"),children:d.repositoryName}),(0,l.jsx)(f,{label:a("target.heading"),children:d.worktreeName}),(0,l.jsx)(f,{label:a("target.branch"),children:null!=(t=d.branch)?t:a("target.branchUnknown")}),(0,l.jsx)(f,{label:a("uninstall.installedVersion"),children:(0,l.jsx)("span",{className:"font-mono text-xs",children:o.version||a("uninstall.versionUnknown")})}),(0,l.jsx)(f,{label:a("plan.installRoot"),children:(0,l.jsx)("span",{className:"break-all font-mono text-xs",children:d.installRoot})}),(0,l.jsx)(f,{label:a("target.workingTree"),children:d.workingTreeDirty?a("target.workingTreeDirty"):a("target.workingTreeClean")})]}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-uninstall-stats",children:a("uninstall.stats",{removable:s.stats.removable,modified:s.stats.modified,missing:s.stats.missing,unknown:s.stats.unknown,irregular:s.stats.irregular})}),(0,l.jsxs)("section",{className:"space-y-2",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:a("uninstall.removalsHeading")}),0===s.removals.length?(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:a("uninstall.removalsEmpty")}):(0,l.jsx)("ul",{className:"space-y-1.5",children:s.removals.map(e=>(0,l.jsx)(N,{entry:e},e.path))})]}),(0,l.jsxs)("section",{className:"space-y-2",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:a("uninstall.retainedHeading")}),0===s.retained.length?(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:a("uninstall.retainedEmpty")}):(0,l.jsx)("ul",{className:"space-y-1.5",children:s.retained.map(e=>(0,l.jsx)(N,{entry:e},e.path))})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[s.skill.agents.length>0&&(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5","data-testid":"skill-uninstall-agents",children:s.skill.agents.map(e=>(0,l.jsx)(r.Ex,{variant:"gray",children:(0,i.f_)(e.agent)},e.agent))}),(0,l.jsx)(c.u,{tone:"neutral",children:a((0,k.e5)(s.nextActionKey))})]}),s.blockers.length>0&&(0,l.jsxs)("section",{className:"space-y-2","data-testid":"skill-uninstall-blockers",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-danger-foreground",children:a("uninstall.blockersHeading")}),(0,l.jsx)("ul",{className:"space-y-1",children:s.blockers.map(e=>{var t;return(0,l.jsxs)("li",{className:"text-xs text-danger-foreground",children:[e.path&&(0,l.jsx)("span",{className:"mr-1 break-all font-mono",children:e.path}),a((0,k.e5)(e.messageKey))]},"".concat(e.code,":").concat(null!=(t=e.path)?t:""))})})]})]})}var v=s(80130);let R={worktreeId:null,busy:null,installPlan:null,uninstallPlan:null,installResult:null,uninstallResult:null,riskAcknowledged:!1,failure:null};function C(e){return{...e,installPlan:null,uninstallPlan:null,installResult:null,uninstallResult:null,riskAcknowledged:!1,failure:null}}function A(e,t){return"".concat(e,"-").concat(t)}function I(e){let{failure:t}=e,s=(0,n.c)("skills");return(0,l.jsxs)("div",{className:"space-y-2","data-testid":"skill-operation-error",children:[(0,l.jsxs)(c.u,{tone:"danger",children:[(0,l.jsx)("p",{className:"font-medium",children:s("operation.errorHeading")}),(0,l.jsx)("p",{className:"mt-1",children:s((0,k.FW)(t.code))}),(0,l.jsx)("p",{className:"mt-1 break-words",children:s("state.errorCode",{code:t.code})})]}),t.nextActionKey&&(0,l.jsx)(c.u,{tone:"warning",children:s((0,k.e5)(t.nextActionKey))}),t.blockers&&t.blockers.length>0&&(0,l.jsx)("ul",{className:"space-y-1","data-testid":"skill-operation-error-blockers",children:t.blockers.map(e=>{var t;return(0,l.jsxs)("li",{className:"text-xs text-danger-foreground",children:[e.path&&(0,l.jsx)("span",{className:"mr-1 break-all font-mono",children:e.path}),s((0,k.e5)(e.messageKey))]},"".concat(e.code,":").concat(null!=(t=e.path)?t:""))})})]})}function P(e){let{agents:t,skillId:s,version:a}=e,r=(0,n.c)("skills");return 0===t.length?null:(0,l.jsxs)("div",{className:"space-y-1","data-testid":"skill-operation-reload",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:r("operation.reloadHeading")}),(0,l.jsx)("ul",{className:"space-y-1",children:t.map(e=>(0,l.jsx)("li",{className:"text-xs text-muted-foreground",children:r((0,k.e5)(e.messageKey),{agent:(0,i.f_)(e.agent),skillId:s,version:a})},e.agent))})]})}function K(e){var t;let{skillId:s,version:i,blockedReason:u,worktreeId:x,agents:m=[]}=e,g=(0,n.c)("skills"),[h,f]=(0,a.useState)(()=>x?{...R,worktreeId:x}:R),j=(0,a.useCallback)(e=>{f(t=>t.worktreeId===e?t:C({...t,worktreeId:e,busy:null}))},[]);(0,a.useEffect)(()=>{x&&j(x)},[x,j]);let b=(0,a.useCallback)(async()=>{let e=h.worktreeId;if(!e)return;f(e=>({...C(e),busy:"install-plan"}));let t=await (0,v.Q6)(e,s,{version:null!=i?i:void 0});f(e=>({...e,busy:null,installPlan:t.ok?t.data.plan:null,failure:t.ok?null:t.failure}))},[s,h.worktreeId,i]),N=(0,a.useCallback)(async()=>{let e=h.worktreeId,t=h.installPlan;if(!e||!t||t.requiresRiskAcknowledgement&&!h.riskAcknowledged)return;f(e=>({...e,busy:"install-apply",failure:null}));let l=await (0,v.Xi)(e,s,{planToken:t.token,version:t.skill.version,acknowledgeRisk:!!t.requiresRiskAcknowledgement||void 0,idempotencyKey:A("skill-install",t.token)});l.ok&&(0,d.k)(e),f(e=>({...e,busy:null,installPlan:l.ok?null:e.installPlan,installResult:l.ok?l.data:null,failure:l.ok?null:l.failure}))},[s,h.installPlan,h.riskAcknowledged,h.worktreeId]),K=(0,a.useCallback)(async()=>{let e=h.worktreeId;if(!e)return;f(e=>({...C(e),busy:"uninstall-plan"}));let t=await (0,v.hN)(e,s);f(e=>({...e,busy:null,uninstallPlan:t.ok?t.data.plan:null,failure:t.ok?null:t.failure}))},[s,h.worktreeId]),E=(0,a.useCallback)(async()=>{let e=h.worktreeId,t=h.uninstallPlan;if(!e||!t)return;f(e=>({...e,busy:"uninstall-apply",failure:null}));let l=await (0,v.E)(e,s,{planToken:t.token,idempotencyKey:A("skill-uninstall",t.token)});f(e=>({...e,busy:null,uninstallPlan:l.ok?null:e.uninstallPlan,uninstallResult:l.ok?l.data:null,failure:l.ok?null:l.failure}))},[s,h.uninstallPlan,h.worktreeId]),T=(0,a.useCallback)(()=>{f(e=>C(e))},[]),H=null!==h.busy,S=h.installPlan,q=h.uninstallPlan,D=null!=u?u:g(h.worktreeId?"plan.ready":"plan.chooseTarget"),V=null!==S&&S.requiresRiskAcknowledgement&&!h.riskAcknowledged;return(0,l.jsxs)("div",{className:"space-y-3","data-testid":"skill-install-panel",children:[!x&&(0,l.jsx)(p,{selectedWorktreeId:h.worktreeId,onSelect:j,disabled:H}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,l.jsx)(r.$n,{variant:"primary",disabled:H||null!==u||!h.worktreeId,onClick:b,"data-testid":"skill-install-action","aria-describedby":"skill-install-reason",children:g("install-plan"===h.busy?"plan.building":"plan.build")}),(0,l.jsx)(r.$n,{variant:"secondary",disabled:H||!h.worktreeId,onClick:K,"data-testid":"skill-uninstall-action",children:g("uninstall-plan"===h.busy?"uninstall.building":"uninstall.build")})]}),(0,l.jsx)("p",{id:"skill-install-reason",className:"text-sm text-muted-foreground","data-testid":"skill-install-reason",children:D}),m.length>0&&(0,l.jsxs)("div",{className:"space-y-1","data-testid":"skill-install-reload-preview",children:[(0,l.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:g("operation.reloadHeading")}),(0,l.jsx)("ul",{className:"space-y-1",children:m.map(e=>(0,l.jsx)(o.m,{agent:e,variant:"reload"},e.agent))})]}),h.failure&&(0,l.jsx)(I,{failure:h.failure}),S&&(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsx)(y,{plan:S}),S.requiresRiskAcknowledgement&&(0,l.jsxs)(r.Zp,{className:"space-y-3","data-testid":"skill-install-risk-acknowledgement",children:[(0,l.jsx)(c.u,{tone:"danger",children:g((0,k.e5)(null!=(t=S.riskAcknowledgementMessageKey)?t:"skills.plan.highRiskAcknowledgement"))}),(0,l.jsxs)("label",{className:"flex items-start gap-2 text-sm text-foreground",children:[(0,l.jsx)(r.Sc,{checked:h.riskAcknowledged,onCheckedChange:e=>f(t=>({...t,riskAcknowledged:!0===e})),disabled:H,"data-testid":"skill-install-risk-checkbox",className:"mt-0.5"}),(0,l.jsx)("span",{children:g("plan.acknowledgeLabel")})]})]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,l.jsx)(r.$n,{variant:S.requiresRiskAcknowledgement?"danger":"primary",disabled:H||!S.installable||V,onClick:N,"data-testid":"skill-install-confirm",children:g("install-apply"===h.busy?"plan.confirming":"plan.confirm")}),(0,l.jsx)(r.$n,{variant:"ghost",disabled:H,onClick:T,"data-testid":"skill-install-discard",children:g("plan.discard")})]})]}),q&&(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsx)(w,{plan:q}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,l.jsx)(r.$n,{variant:"danger",disabled:H||!q.removable,onClick:E,"data-testid":"skill-uninstall-confirm",children:g("uninstall-apply"===h.busy?"uninstall.confirming":"uninstall.confirm")}),(0,l.jsx)(r.$n,{variant:"ghost",disabled:H,onClick:T,"data-testid":"skill-uninstall-discard",children:g("plan.discard")})]})]}),h.installResult&&(0,l.jsxs)(r.Zp,{className:"space-y-3","data-testid":"skill-install-result",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:g("operation.installedHeading")}),(0,l.jsx)(c.u,{tone:"info",children:g((0,k.e5)(h.installResult.operation.nextActionKey))}),h.installResult.operation.replayed&&(0,l.jsx)(c.u,{tone:"neutral","data-testid":"skill-operation-replayed",children:g("operation.replayNotice")}),h.installResult.install&&"files"in h.installResult.install&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:g("operation.filesWritten",{count:h.installResult.install.files.length})}),"reload"in h.installResult&&(0,l.jsx)(P,{agents:h.installResult.reload.agents,skillId:h.installResult.reload.skillId,version:h.installResult.reload.version}),(0,l.jsx)(r.$n,{variant:"secondary",size:"sm",onClick:T,"data-testid":"skill-operation-reset",children:g("operation.startOver")})]}),h.uninstallResult&&(0,l.jsxs)(r.Zp,{className:"space-y-3","data-testid":"skill-uninstall-result",children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:g("operation.uninstalledHeading")}),(0,l.jsx)(c.u,{tone:"info",children:g((0,k.e5)(h.uninstallResult.operation.nextActionKey))}),h.uninstallResult.operation.replayed&&(0,l.jsx)(c.u,{tone:"neutral","data-testid":"skill-operation-replayed",children:g("operation.replayNotice")}),h.uninstallResult.uninstall&&"removedFiles"in h.uninstallResult.uninstall&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:g("operation.filesRemoved",{count:h.uninstallResult.uninstall.removedFiles.length})}),"reload"in h.uninstallResult&&(0,l.jsx)(P,{agents:h.uninstallResult.reload.agents,skillId:h.uninstallResult.reload.skillId,version:h.uninstallResult.reload.version}),(0,l.jsx)(r.$n,{variant:"secondary",size:"sm",onClick:T,"data-testid":"skill-operation-reset",children:g("operation.startOver")})]})]})}},50666:(e,t,s)=>{s.d(t,{Ck:()=>r});var l=s(95155),a=s(12115),n=s(53482);function r(e){let{children:t,as:s="div",className:r=""}=e,i=function e(t){return null==t||"boolean"==typeof t?"":"string"==typeof t?t:"number"==typeof t?String(t):Array.isArray(t)?t.map(e).join(""):a.isValidElement(t)?e(t.props.children):""}(t);if(!i||0===i.trim().length)return(0,l.jsx)(s,{className:r||void 0,children:t});let d="relative group ".concat("span"===s?"block ":"").concat(r).trim();return(0,l.jsxs)(s,{className:d,"data-testid":"code-block-with-copy",children:[t,(0,l.jsx)(n.i,{text:i,className:"absolute right-2 top-2 z-10 opacity-100 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100 focus:opacity-100"})]})}},50825:(e,t,s)=>{s.d(t,{m:()=>o});var l=s(95155);s(12115);var a=s(18955),n=s(54014),r=s(37381),i=s(95584);function d(e){let{axis:t,agentName:s}=e,n=(0,a.c)("skills");return(0,l.jsxs)("li",{className:"text-xs text-muted-foreground","data-testid":"skill-agent-axis-".concat(t.axis),children:[(0,l.jsx)("span",{className:"font-medium text-foreground",children:n((0,i.e5)(t.axisKey))}),": ",(0,l.jsx)("span",{"data-testid":"skill-agent-axis-".concat(t.axis,"-").concat(t.outcome),children:n((0,i.e5)(t.outcomeKey))})," — ",n((0,i.e5)(t.evidenceKindKey)),t.limitationKey&&(0,l.jsx)("span",{className:"mt-0.5 block","data-testid":"skill-agent-axis-".concat(t.axis,"-limitation"),children:n((0,i.e5)(t.limitationKey),{agent:s})})]})}function o(e){var t;let{agent:s,variant:o="full"}=e,c=(0,a.c)("skills"),u=(0,n.f_)(s.agent),x=s.measured;return"reload"===o?(0,l.jsx)("li",{className:"text-xs text-muted-foreground","data-testid":"skill-agent-reload-".concat(s.agent),children:c((0,i.e5)(s.reloadKey),{agent:u})}):(0,l.jsxs)("div",{className:"space-y-1","data-testid":"skill-agent-evidence-".concat(s.agent),children:[(0,l.jsx)("p",{className:"text-xs font-medium text-foreground",children:u}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground break-words",children:c("compatibility.declaredLabel",{support:c((0,i.e5)(s.declaredLabelKey))})}),(0,l.jsxs)("p",{className:"text-xs text-muted-foreground break-words",children:[c("compatibility.evidence"),": ",s.evidence]}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground break-words","data-testid":"skill-agent-verification-".concat(s.agent),children:c((0,i.e5)(s.verificationKey))}),x?(0,l.jsxs)("div",{className:"space-y-0.5 border-l-2 border-border pl-2",children:[(0,l.jsx)("p",{className:"text-xs font-medium text-foreground",children:c("compatibility.measuredHeading")}),(0,l.jsxs)("ul",{className:"space-y-0.5",children:[(0,l.jsx)(d,{axis:x.discovery,agentName:u}),(0,l.jsx)(d,{axis:x.invocation,agentName:u})]}),x.testedVersion&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:c("compatibility.testedVersion",{agent:u,version:x.testedVersion})}),x.testedDate&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:c("compatibility.testedDate",{date:x.testedDate})}),x.discoveryRoots.length>0&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground break-all",children:c("compatibility.discoveryRoots",{roots:x.discoveryRoots.join(", ")})}),x.evidenceSource&&(0,l.jsxs)("p",{className:"text-xs text-muted-foreground break-all",children:[c("compatibility.evidenceSource"),": ",x.evidenceSource]}),x.stale&&(0,l.jsx)(r.u,{tone:"warning","data-testid":"skill-agent-evidence-stale-".concat(s.agent),children:c("compatibility.evidenceStale",{days:null!=(t=x.ageDays)?t:0})})]}):s.skipReasonKey&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground break-words","data-testid":"skill-agent-skip-reason-".concat(s.agent),children:c((0,i.e5)(s.skipReasonKey))}),(0,l.jsxs)("p",{className:"text-xs text-muted-foreground break-words",children:[(0,l.jsx)("span",{className:"font-medium text-foreground",children:c("compatibility.reloadHeading",{agent:u})}),": ",c((0,i.e5)(s.reloadKey),{agent:u})]})]})}},53482:(e,t,s)=>{s.d(t,{i:()=>o});var l=s(95155),a=s(12115),n=s(60322),r=s(9900);function i(){return(0,l.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}function d(){return(0,l.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function o(e){let{text:t,className:s="",label:o="Copy"}=e,[c,u]=(0,a.useState)(!1),x=(0,a.useRef)(null);(0,a.useEffect)(()=>()=>{x.current&&clearTimeout(x.current)},[]);let m=(0,a.useCallback)(async()=>{try{await (0,n.l)(t),u(!0),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>u(!1),r.s7)}catch(e){}},[t]);return(0,l.jsxs)("button",{type:"button",onClick:m,className:"inline-flex items-center gap-1 rounded border border-border bg-surface px-2 py-0.5 text-[11px] font-medium text-foreground transition-colors hover:bg-muted ".concat(s),"aria-label":c?"Copied":o,title:c?"Copied!":o,children:[c?(0,l.jsx)(d,{}):(0,l.jsx)(i,{}),(0,l.jsx)("span",{children:c?"Copied":o})]})}},75333:(e,t,s)=>{s.d(t,{Xz:()=>o,qW:()=>c,uE:()=>u});var l=s(95155);s(12115);var a=s(18955),n=s(77801),r=s(48407),i=s(54014),d=s(95584);function o(e){let{status:t,className:s}=e,n=(0,a.c)("skills");return(0,l.jsx)(r.Ex,{variant:d.H$[t],className:s,"data-testid":"skill-compatibility-".concat(t),children:n(d.OV[t])})}function c(e){let{risk:t,className:s}=e,i=(0,a.c)("skills");return(0,l.jsxs)(r.Ex,{variant:d.eK[t],className:s,"data-testid":"skill-declared-risk-".concat(t),children:["high"===t&&(0,l.jsx)(n.A,{size:12,"aria-hidden":"true",className:"mr-1 shrink-0"}),i("risk.declaredLabel",{level:i(d.pP[t])})]})}function u(e){let{agent:t}=e,s=(0,a.c)("skills");return(0,l.jsxs)(r.Ex,{variant:d.Et[t.support],"data-testid":"skill-agent-".concat(t.agent,"-").concat(t.support),children:[(0,i.f_)(t.agent),": ",s((0,d.e5)(t.labelKey))]})}},99648:(e,t,s)=>{s.d(t,{Co:()=>l,Ms:()=>n,td:()=>a});let l=".agents/skills",a=".claude/skills",n="skills.permissions.declarationOnlyNotice"}}]);
|