commandmate 0.42.1 → 0.43.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 +144 -144
- package/.next/app-path-routes-manifest.json +23 -23
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +9 -9
- package/.next/required-server-files.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/release-notes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/update-check/route.js +1 -1
- package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/capabilities/route.js +1 -1
- package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/daily-summary/route.js +1 -1
- package/.next/server/app/api/daily-summary/route.js.nft.json +1 -1
- package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/daily-summary/status/route.js +1 -1
- package/.next/server/app/api/daily-summary/status/route.js.nft.json +1 -1
- package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/[id]/health/route_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 +103 -1
- package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/claude-done/route.js +2 -2
- package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/permission-request/route.js +1 -1
- package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/metrics/vibe/route_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.js +1 -1
- package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/route.js +1 -1
- package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/slash-commands/route.js +1 -1
- package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/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.js +3 -1
- package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/direct-input/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/direct-input/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/direct-input/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/route.js +3 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/session/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/session/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/share/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/share/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/route.js +1 -103
- package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +3 -1
- package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/active/route.js +3 -1
- package/.next/server/app/api/worktrees/[id]/schedules/active/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/route.js +3 -1
- package/.next/server/app/api/worktrees/[id]/schedules/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route.js +1 -103
- package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +104 -2
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/slash-commands/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tasks/route.js +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/route.js +1 -1
- package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
- package/.next/server/app/more/page_client-reference-manifest.js +1 -1
- package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
- package/.next/server/app/review/page_client-reference-manifest.js +1 -1
- package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/page.js +9 -9
- package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +23 -23
- package/.next/server/chunks/1068.js +1 -1
- package/.next/server/chunks/1210.js +1 -1
- package/.next/server/chunks/1501.js +4 -4
- package/.next/server/chunks/1990.js +1 -1
- package/.next/server/chunks/2119.js +1 -1
- package/.next/server/chunks/22.js +1 -1
- package/.next/server/chunks/2328.js +1 -1
- package/.next/server/chunks/2404.js +4 -3
- package/.next/server/chunks/2445.js +1 -1
- package/.next/server/chunks/252.js +1 -1
- package/.next/server/chunks/2816.js +1 -1
- package/.next/server/chunks/3543.js +1 -1
- package/.next/server/chunks/3730.js +1 -1
- package/.next/server/chunks/3945.js +1 -1
- package/.next/server/chunks/4207.js +3 -3
- package/.next/server/chunks/434.js +1 -1
- package/.next/server/chunks/5064.js +1 -1
- package/.next/server/chunks/5571.js +1 -1
- package/.next/server/chunks/5742.js +1 -1
- package/.next/server/chunks/5775.js +1 -1
- package/.next/server/chunks/611.js +1 -1
- package/.next/server/chunks/6130.js +1 -1
- package/.next/server/chunks/6285.js +1 -1
- package/.next/server/chunks/6491.js +103 -0
- package/.next/server/chunks/6661.js +1 -1
- package/.next/server/chunks/6781.js +1 -1
- package/.next/server/chunks/6793.js +1 -1
- package/.next/server/chunks/7491.js +3 -0
- package/.next/server/chunks/7685.js +1 -1
- package/.next/server/chunks/7905.js +1 -1
- package/.next/server/chunks/8581.js +2 -2
- package/.next/server/chunks/8583.js +1 -1
- package/.next/server/chunks/8673.js +6 -6
- package/.next/server/chunks/8728.js +2 -2
- package/.next/server/chunks/8791.js +1 -1
- package/.next/server/chunks/8800.js +4 -3
- package/.next/server/chunks/8918.js +5 -5
- package/.next/server/chunks/9130.js +3 -3
- package/.next/server/chunks/{8052.js → 9353.js} +4 -2
- package/.next/server/chunks/9390.js +3 -0
- package/.next/server/chunks/9627.js +4 -4
- package/.next/server/chunks/964.js +1 -1
- package/.next/server/chunks/967.js +1 -0
- package/.next/server/chunks/9731.js +3 -3
- package/.next/server/chunks/9882.js +3 -3
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{1642-fb2e176aaadbd137.js → 1642-767aed8e7c61ef7f.js} +1 -1
- package/.next/static/chunks/{2407-21fbf12d753b8d4d.js → 2407-940df9b11fadafc6.js} +1 -1
- package/.next/static/chunks/{2619-04bc32f026a0d946.js → 2619-a305ad4810f1393a.js} +1 -1
- package/.next/static/chunks/5449-6cb80bab2bd06b79.js +1 -0
- package/.next/static/chunks/7705-1f58d4c03d991fcf.js +1 -0
- package/.next/static/chunks/8165-3525fb42f1b4976e.js +1 -0
- package/.next/static/chunks/app/{layout-8ff4c7c08ef1f621.js → layout-057c850cd0df978e.js} +1 -1
- package/.next/static/chunks/app/review/page-ff9efae3f86eb840.js +1 -0
- package/.next/static/chunks/app/skills/[skillId]/page-74aac15286504ef4.js +1 -0
- package/.next/static/chunks/app/skills/page-182e16168b2fc098.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/page-eab0bf7564d3f9e2.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/terminal/{page-373ea37b16d930c7.js → page-c601f3b3ece6557e.js} +1 -1
- package/.next/trace +13 -13
- package/README.md +3 -3
- package/dist/cli/commands/ask.d.ts.map +1 -1
- package/dist/cli/commands/ask.js +23 -149
- package/dist/cli/commands/reply.d.ts +40 -0
- package/dist/cli/commands/reply.d.ts.map +1 -0
- package/dist/cli/commands/reply.js +133 -0
- package/dist/cli/commands/verify.d.ts.map +1 -1
- package/dist/cli/commands/verify.js +9 -0
- package/dist/cli/commands/wait.d.ts +5 -0
- package/dist/cli/commands/wait.d.ts.map +1 -1
- package/dist/cli/commands/wait.js +10 -1
- package/dist/cli/docs/agent-operations.d.ts +2 -2
- package/dist/cli/docs/agent-operations.d.ts.map +1 -1
- package/dist/cli/docs/agent-operations.js +13 -0
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +4 -0
- package/dist/cli/types/index.d.ts +2 -0
- package/dist/cli/types/index.d.ts.map +1 -1
- package/dist/cli/utils/reply-ledger.d.ts +95 -0
- package/dist/cli/utils/reply-ledger.d.ts.map +1 -0
- package/dist/cli/utils/reply-ledger.js +187 -0
- package/dist/lib/cli-tools/copilot-executable.d.ts +9 -0
- package/dist/lib/cli-tools/copilot-executable.d.ts.map +1 -1
- package/dist/lib/cli-tools/copilot-executable.js +21 -5
- package/dist/lib/cli-tools/opencode-executable.d.ts +103 -0
- package/dist/lib/cli-tools/opencode-executable.d.ts.map +1 -0
- package/dist/lib/cli-tools/opencode-executable.js +179 -0
- package/dist/lib/cli-tools/types.d.ts +1 -1
- package/dist/lib/cli-tools/types.d.ts.map +1 -1
- package/dist/lib/cli-tools/types.js +5 -1
- package/dist/lib/detection/tools/verified-against.d.ts +15 -0
- package/dist/lib/detection/tools/verified-against.d.ts.map +1 -1
- package/dist/lib/detection/tools/verified-against.js +17 -1
- package/dist/lib/detection/version-probes.d.ts.map +1 -1
- package/dist/lib/detection/version-probes.js +14 -1
- package/dist/lib/session/tmux-session-surface.d.ts.map +1 -1
- package/dist/lib/session/tmux-session-surface.js +1 -1
- package/dist/server/locales/en/worktree.json +44 -14
- package/dist/server/locales/ja/worktree.json +44 -14
- package/dist/server/server.js +23 -0
- package/dist/server/src/config/cli-tool-timing-config.js +19 -1
- package/dist/server/src/config/detection-evidence-config.js +3 -0
- package/dist/server/src/config/schedule-config.js +55 -1
- package/dist/server/src/lib/auto-yes-poller.js +47 -4
- package/dist/server/src/lib/cli-tools/agent-mode-spec.js +54 -2
- package/dist/server/src/lib/cli-tools/base.js +6 -2
- package/dist/server/src/lib/cli-tools/command-code.js +55 -1
- package/dist/server/src/lib/cli-tools/composer-spec.js +10 -0
- package/dist/server/src/lib/cli-tools/copilot-executable.js +21 -5
- package/dist/server/src/lib/cli-tools/graceful-exit.js +15 -1
- package/dist/server/src/lib/cli-tools/index.js +3 -1
- package/dist/server/src/lib/cli-tools/install-hints.js +9 -3
- package/dist/server/src/lib/cli-tools/liveness-spec.js +19 -0
- package/dist/server/src/lib/cli-tools/manager.js +2 -0
- package/dist/server/src/lib/cli-tools/opencode-executable.js +179 -0
- package/dist/server/src/lib/cli-tools/opencode-v2.js +369 -0
- package/dist/server/src/lib/cli-tools/opencode.js +29 -5
- package/dist/server/src/lib/cli-tools/types.js +5 -1
- package/dist/server/src/lib/cmate-cli-tool-parser.js +65 -7
- package/dist/server/src/lib/cmate-parser.js +12 -0
- package/dist/server/src/lib/cmate-validator.js +13 -1
- package/dist/server/src/lib/db/worktree-db.js +1 -1
- package/dist/server/src/lib/detection/cli-patterns.js +78 -2
- package/dist/server/src/lib/detection/model-info-extractor.js +79 -7
- package/dist/server/src/lib/detection/status-detector.js +10 -1
- package/dist/server/src/lib/detection/tools/codex/cli-patterns.js +2 -1
- package/dist/server/src/lib/detection/tools/opencode-v2/detect.js +253 -0
- package/dist/server/src/lib/detection/tools/opencode-v2/dialog-title.js +48 -0
- package/dist/server/src/lib/detection/tools/registry.js +2 -0
- package/dist/server/src/lib/detection/tools/run-detection.js +9 -0
- package/dist/server/src/lib/detection/tools/verified-against.js +17 -1
- package/dist/server/src/lib/detection/upstream-faults.js +8 -0
- package/dist/server/src/lib/detection/version-probes.js +14 -1
- package/dist/server/src/lib/hooks/agent-session-telemetry.js +36 -1
- package/dist/server/src/lib/hooks/sources/opencode/log-diagnosis.js +105 -0
- package/dist/server/src/lib/hooks/sources/opencode/source.js +7 -1
- package/dist/server/src/lib/hooks/sources/opencode-v2/client.js +422 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/decision-labels.js +24 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/history.js +421 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/ingest.js +271 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/mappers.js +165 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/payloads.js +351 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/ports.js +230 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/reattach.js +149 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/runtime.js +180 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/secrets.js +182 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/source.js +295 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/subscription.js +455 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/tool-id.js +18 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/usage.js +214 -0
- package/dist/server/src/lib/hooks/sources/registry.js +2 -0
- package/dist/server/src/lib/hooks/structured-decision-response.js +14 -5
- package/dist/server/src/lib/job-executor.js +2 -1
- package/dist/server/src/lib/polling/auto-yes-dialog-gate.js +15 -1
- package/dist/server/src/lib/polling/structured-history-gate.js +19 -5
- package/dist/server/src/lib/relay/relay-delivery.js +4 -1
- package/dist/server/src/lib/session/agent-event-state.js +24 -0
- package/dist/server/src/lib/session/claude-executor.js +184 -10
- package/dist/server/src/lib/session/current-output-builder.js +27 -3
- package/dist/server/src/lib/session/send-user-message.js +4 -0
- package/dist/server/src/lib/session/structured-prompt.js +54 -0
- package/dist/server/src/lib/session/tmux-session-surface.js +1 -1
- package/dist/server/src/lib/skills/compatibility-matrix.js +65 -0
- package/dist/server/src/lib/tmux/tmux.js +48 -2
- package/dist/server/src/lib/verification/env-clean-gate.js +228 -9
- package/dist/server/src/lib/verification/env-snapshot.js +65 -1
- package/dist/server/src/types/cli-tool-contracts.js +10 -2
- package/dist/types/cli-tool-contracts.d.ts +16 -5
- package/dist/types/cli-tool-contracts.d.ts.map +1 -1
- package/dist/types/cli-tool-contracts.js +10 -2
- package/package.json +2 -1
- package/release-notes/0.42.2.json +20 -0
- package/release-notes/0.43.0.json +130 -0
- package/scripts/hooks/cmate-agent-event.sh +14 -0
- package/scripts/opencode-v2/launch.sh +226 -0
- package/.next/server/chunks/4443.js +0 -3
- package/.next/server/chunks/5164.js +0 -1
- package/.next/server/chunks/650.js +0 -1
- package/.next/static/chunks/5449-550bd273dccc3ae4.js +0 -1
- package/.next/static/chunks/7705-2a2936551b0cf9a3.js +0 -1
- package/.next/static/chunks/8165-934ee7ff3b4ddfd4.js +0 -1
- package/.next/static/chunks/app/review/page-30616daa1dc595c2.js +0 -1
- package/.next/static/chunks/app/skills/[skillId]/page-ab7e432b69fccb3b.js +0 -1
- package/.next/static/chunks/app/skills/page-56b4fa11223e0cbd.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/page-3c946bd2875391fd.js +0 -1
- /package/.next/static/{3M_S0B7dhEDdVE2XSJz1Y → BVkBYdceLRvMROqQIqeBx}/_buildManifest.js +0 -0
- /package/.next/static/{3M_S0B7dhEDdVE2XSJz1Y → BVkBYdceLRvMROqQIqeBx}/_ssgManifest.js +0 -0
|
@@ -41,6 +41,7 @@ const source_4 = require("./antigravity/source");
|
|
|
41
41
|
const source_5 = require("./codex/source");
|
|
42
42
|
const source_6 = require("./opencode/source");
|
|
43
43
|
const source_7 = require("./command-code/source");
|
|
44
|
+
const source_8 = require("./opencode-v2/source");
|
|
44
45
|
const registered = (globalThis.__agentEventSources ??= new Map());
|
|
45
46
|
/** Memoised compatibility sources, so repeated lookups return one object. */
|
|
46
47
|
const legacy = (globalThis.__agentEventLegacySources ??= new Map());
|
|
@@ -113,3 +114,4 @@ registerAgentEventSource(source_6.opencodeAgentEventSource);
|
|
|
113
114
|
// Issue #2251, Epic #2249 Phase B. The seventh, and the last line of "adding a
|
|
114
115
|
// tool" — its own directory plus this.
|
|
115
116
|
registerAgentEventSource(source_7.commandCodeAgentEventSource);
|
|
117
|
+
registerAgentEventSource(source_8.opencodeV2AgentEventSource);
|
|
@@ -157,13 +157,22 @@ function verdictFor(optionNumber) {
|
|
|
157
157
|
/**
|
|
158
158
|
* Resolve an answer against the option list.
|
|
159
159
|
*
|
|
160
|
+
* Issue #2951: with `cliToolId`, the labels matched are the tool's own
|
|
161
|
+
* (`structuredDecisionOptionsFor`) — OpenCode V2's `Always allow` — and the
|
|
162
|
+
* option returned carries that label. The shared spelling (`Allow always`) is
|
|
163
|
+
* still accepted there as an alias of the same number, so nothing that
|
|
164
|
+
* resolved before stops resolving.
|
|
165
|
+
*
|
|
166
|
+
* @param answer - An option number, a label, a `reply` word or an alias
|
|
167
|
+
* @param cliToolId - The tool the approval belongs to; omitted = the shared list
|
|
160
168
|
* @returns The option, or null when nothing matched
|
|
161
169
|
*/
|
|
162
|
-
function resolveStructuredDecisionOption(answer) {
|
|
170
|
+
function resolveStructuredDecisionOption(answer, cliToolId) {
|
|
163
171
|
const normalized = answer.trim().toLowerCase();
|
|
164
172
|
if (normalized === '')
|
|
165
173
|
return null;
|
|
166
|
-
|
|
174
|
+
const options = cliToolId === undefined ? structured_prompt_1.STRUCTURED_DECISION_OPTIONS : (0, structured_prompt_1.structuredDecisionOptionsFor)(cliToolId);
|
|
175
|
+
for (const option of options) {
|
|
167
176
|
if (normalized === String(option.number))
|
|
168
177
|
return option;
|
|
169
178
|
if (normalized === option.label.toLowerCase())
|
|
@@ -407,16 +416,16 @@ async function answerStructuredDecision({ worktreeId, cliToolId, instanceId, ans
|
|
|
407
416
|
kind: 'refused',
|
|
408
417
|
reason: 'unresolvable_answer',
|
|
409
418
|
message: '--default cannot answer a structured approval: the agent publishes no default verdict. ' +
|
|
410
|
-
`Send a number instead — ${structured_prompt_1.
|
|
419
|
+
`Send a number instead — ${(0, structured_prompt_1.structuredDecisionOptionsFor)(cliToolId).map((option) => `${option.number} = ${option.label}`).join(', ')}.`,
|
|
411
420
|
};
|
|
412
421
|
}
|
|
413
|
-
const option = answer === undefined ? null : resolveStructuredDecisionOption(answer);
|
|
422
|
+
const option = answer === undefined ? null : resolveStructuredDecisionOption(answer, cliToolId);
|
|
414
423
|
if (!option) {
|
|
415
424
|
return {
|
|
416
425
|
kind: 'refused',
|
|
417
426
|
reason: 'answer_out_of_range',
|
|
418
427
|
message: `'${answer ?? ''}' is not one of the verdicts this approval accepts. ` +
|
|
419
|
-
structured_prompt_1.
|
|
428
|
+
(0, structured_prompt_1.structuredDecisionOptionsFor)(cliToolId).map((each) => `${each.number} = ${each.label} (${each.reply})`).join(', ') +
|
|
420
429
|
'.',
|
|
421
430
|
};
|
|
422
431
|
}
|
|
@@ -116,7 +116,8 @@ function recoverRunningLogs() {
|
|
|
116
116
|
* - **the CMATE.md CLI Tool column**, read by
|
|
117
117
|
* {@link resolveScheduleCommandOptions} — `--model` for every tool in
|
|
118
118
|
* `TOOLS_WITH_MODEL_SUPPORT`, plus opencode's `--agent` / `--variant` /
|
|
119
|
-
* `--continue` / `--title` for the ids in `TOOLS_WITH_RUN_OPTIONS
|
|
119
|
+
* `--continue` / `--title` for the ids in `TOOLS_WITH_RUN_OPTIONS`
|
|
120
|
+
* (opencode and, since Issue #2982, opencode-v2);
|
|
120
121
|
* - **the DB** (`worktree.vibe_local_model`), for vibe-local, whose model is
|
|
121
122
|
* chosen in the worktree's Agent settings rather than written in the file.
|
|
122
123
|
*
|
|
@@ -71,7 +71,7 @@ exports.AUTO_YES_DIALOG_GATE_MODES = ['enforce', 'legacy'];
|
|
|
71
71
|
/**
|
|
72
72
|
* The rollout state each tool ships in.
|
|
73
73
|
*
|
|
74
|
-
* `enforce` is set only for the
|
|
74
|
+
* `enforce` is set only for the five tools with a dialog rule measured from
|
|
75
75
|
* their own live captures, each with a positive fixture and a mutation fixture
|
|
76
76
|
* (`tests/unit/detection/tools/dialogs.test.ts`):
|
|
77
77
|
*
|
|
@@ -81,6 +81,7 @@ exports.AUTO_YES_DIALOG_GATE_MODES = ['enforce', 'legacy'];
|
|
|
81
81
|
* | codex | `Press enter to confirm …` under the options, above the status bar, not stale | #1628 / #1160 |
|
|
82
82
|
* | copilot | the bottom status bar is GONE and the option run carries a picker footer | #1885 / #1895 |
|
|
83
83
|
* | opencode | the `Allow once / Allow always / Reject` strip, or a picker header | #1893 / #1896 |
|
|
84
|
+
* | opencode-v2 | the `Allow once / Always allow / Reject` strip, the question form's key hints, or a dialog title row | #2984 |
|
|
84
85
|
*
|
|
85
86
|
* The rest are `legacy` because nobody has measured them:
|
|
86
87
|
*
|
|
@@ -125,6 +126,19 @@ exports.AUTO_YES_DIALOG_GATE_DEFAULT_MODE = {
|
|
|
125
126
|
// Promote only once both dialogs are recognised on both spellings, with a
|
|
126
127
|
// `/prompt-response` test pinning that the question is still answered.
|
|
127
128
|
'command-code': 'legacy',
|
|
129
|
+
// Issue #2984: enforced. The screen path DOES run for OpenCode V2 — nothing
|
|
130
|
+
// in `startAutoYesPolling` / `pollAutoYes` (`auto-yes-poller.ts`) excludes a
|
|
131
|
+
// tool, and `buildDetectPromptOptions` gives v2 the default options
|
|
132
|
+
// (`cli-patterns.ts`), so any `❯ 1.`-shaped rows in the last 50 read as
|
|
133
|
+
// `multiple_choice`. Measured on 2.0.18 (`tests/fixtures/opencode-v2-dialogs-2984/`):
|
|
134
|
+
// a reply that quotes a Claude dialog (`❯ 1. Yes / 2. No`) is exactly such a
|
|
135
|
+
// candidate, and under `legacy` Auto-Yes would have typed `1` + Enter into
|
|
136
|
+
// the composer — #1896 again. v2's own dialogs never are: the approval strip
|
|
137
|
+
// and the question form draw no `❯`, so the generic parser finds nothing on
|
|
138
|
+
// them, and they are answered over the API (#2945 / #2951,
|
|
139
|
+
// `sources/opencode-v2/ingest`) as before. Enforcing therefore takes nothing
|
|
140
|
+
// away from Auto-Yes and refuses the quoted list.
|
|
141
|
+
'opencode-v2': 'enforce',
|
|
128
142
|
};
|
|
129
143
|
/**
|
|
130
144
|
* The kill switch (§13.1 DR3-016).
|
|
@@ -72,6 +72,7 @@ exports.captureStructuredHistoryTurn = captureStructuredHistoryTurn;
|
|
|
72
72
|
exports.hasStructuredHistoryTranscript = hasStructuredHistoryTranscript;
|
|
73
73
|
const logger_1 = require("../../lib/logger");
|
|
74
74
|
const subscription_1 = require("../../lib/hooks/sources/opencode/subscription");
|
|
75
|
+
const subscription_2 = require("../../lib/hooks/sources/opencode-v2/subscription");
|
|
75
76
|
const history_1 = require("../../lib/hooks/sources/claude/history");
|
|
76
77
|
const history_2 = require("../../lib/hooks/sources/codex/history");
|
|
77
78
|
const history_3 = require("../../lib/hooks/sources/antigravity/history");
|
|
@@ -239,11 +240,24 @@ function transcriptHistoryModeOf(cliToolId) {
|
|
|
239
240
|
function isPullTranscriptHistory(cliToolId) {
|
|
240
241
|
return transcriptHistoryModeOf(cliToolId) === 'pull';
|
|
241
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* The push-mode writers' liveness probes, by tool (Issue #2940).
|
|
245
|
+
*
|
|
246
|
+
* The counterpart of {@link PULL_TRANSCRIPT_READERS}: a push source declares
|
|
247
|
+
* `transcriptHistory: 'push'` in its own `source.ts` and adds its probe here.
|
|
248
|
+
* A push source with no row of its own is asked opencode's probe, which is
|
|
249
|
+
* what every push declaration was asked before this table existed — the
|
|
250
|
+
* branch follows the declaration, not the tool name (#2197).
|
|
251
|
+
*/
|
|
252
|
+
const PUSH_TRANSCRIPT_WRITERS = {
|
|
253
|
+
opencode: (target) => (0, subscription_1.isOpencodeStructuredHistoryLive)(target),
|
|
254
|
+
'opencode-v2': (target) => (0, subscription_2.isOpencodeV2StructuredHistoryLive)(target),
|
|
255
|
+
};
|
|
242
256
|
/**
|
|
243
257
|
* Whether the agent's own server is recording this instance's replies.
|
|
244
258
|
*
|
|
245
259
|
* False for every tool whose source does not declare `transcriptHistory: 'push'`
|
|
246
|
-
* — today that is all of them but opencode — and false for an
|
|
260
|
+
* — today that is all of them but opencode and opencode-v2 — and false for an instance
|
|
247
261
|
* whose subscription is anything other than `live`; see
|
|
248
262
|
* {@link isOpencodeStructuredHistoryLive} for why `lost` counts as "nobody is
|
|
249
263
|
* writing this down" rather than as "somebody will". The fallback direction is
|
|
@@ -259,10 +273,10 @@ function isStructuredHistoryWriterLive(worktreeId, cliToolId, instanceId) {
|
|
|
259
273
|
if (transcriptHistoryModeOf(cliToolId) !== 'push')
|
|
260
274
|
return false;
|
|
261
275
|
try {
|
|
262
|
-
//
|
|
263
|
-
//
|
|
264
|
-
|
|
265
|
-
return (
|
|
276
|
+
// Issue #2940 added the second push source, and with it the table the
|
|
277
|
+
// single probe used to stand in for.
|
|
278
|
+
const probe = PUSH_TRANSCRIPT_WRITERS[cliToolId] ?? subscription_1.isOpencodeStructuredHistoryLive;
|
|
279
|
+
return probe({
|
|
266
280
|
worktreeId,
|
|
267
281
|
cliToolId,
|
|
268
282
|
instanceId: instanceId ?? cliToolId,
|
|
@@ -103,7 +103,7 @@ const SYSTEM_ROW_REQUEST_ID_PREFIXES = [
|
|
|
103
103
|
/**
|
|
104
104
|
* Whether this tool's reply is read out of a transcript rather than off a screen.
|
|
105
105
|
*
|
|
106
|
-
* For the
|
|
106
|
+
* For the six that answer `true` the ledger is authoritative: a row with no
|
|
107
107
|
* turn marker was written by the SCRAPER, and for these tools a scraped row is
|
|
108
108
|
* never the answer — it is a footer line, a half-drawn frame or the ANSI dump
|
|
109
109
|
* the send path flushes (Issues #2398 / #2400). The relay may therefore hold
|
|
@@ -130,6 +130,9 @@ const TRANSCRIPT_READER_TOOLS = {
|
|
|
130
130
|
copilot: false,
|
|
131
131
|
gemini: false,
|
|
132
132
|
'vibe-local': false,
|
|
133
|
+
// Issue #2940: OpenCode V2's replies are written from its server
|
|
134
|
+
// (`GET /api/session/{id}/message`) under `oc-turn:`, like opencode's.
|
|
135
|
+
'opencode-v2': true,
|
|
133
136
|
};
|
|
134
137
|
/**
|
|
135
138
|
* How long the scrape path holds out for the transcript row.
|
|
@@ -56,6 +56,7 @@ exports.getAwaitingInstruction = getAwaitingInstruction;
|
|
|
56
56
|
exports.isAwaitingInstruction = isAwaitingInstruction;
|
|
57
57
|
exports.getLastAgentEvent = getLastAgentEvent;
|
|
58
58
|
exports.getLastKnownAgentModel = getLastKnownAgentModel;
|
|
59
|
+
exports.recordAgentReportedModel = recordAgentReportedModel;
|
|
59
60
|
exports.recordCapturedModelInfo = recordCapturedModelInfo;
|
|
60
61
|
exports.getLastCapturedModelInfo = getLastCapturedModelInfo;
|
|
61
62
|
exports.getResolvedAgentModelInfo = getResolvedAgentModelInfo;
|
|
@@ -1348,6 +1349,29 @@ function getLastAgentEvent(worktreeId, cliToolId, instanceId) {
|
|
|
1348
1349
|
function getLastKnownAgentModel(worktreeId, cliToolId, instanceId) {
|
|
1349
1350
|
return lastAgentModel.get((0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId)) ?? null;
|
|
1350
1351
|
}
|
|
1352
|
+
/**
|
|
1353
|
+
* Latch the model the agent named for itself outside an agent event
|
|
1354
|
+
* (Issue #2964).
|
|
1355
|
+
*
|
|
1356
|
+
* The hook channel's latch — the one {@link recordAgentEvent} writes from
|
|
1357
|
+
* `record.model` — for a source whose model arrives on something that is not
|
|
1358
|
+
* one of the seven event words. OpenCode V2 is that source: its `session.*`
|
|
1359
|
+
* frames carry no model, and the model it actually answered with is read off
|
|
1360
|
+
* the assistant messages of `GET /api/session/{id}/message` after the turn.
|
|
1361
|
+
*
|
|
1362
|
+
* Latch, never clear ({@link latchAgentModel}'s rule), and judged for a change
|
|
1363
|
+
* exactly as a hook-borne model is, so #2357's broadcast and push fire for it.
|
|
1364
|
+
*
|
|
1365
|
+
* @param model - The model name, or null/empty to leave the latch alone
|
|
1366
|
+
*/
|
|
1367
|
+
function recordAgentReportedModel(worktreeId, cliToolId, instanceId, model, at = Date.now()) {
|
|
1368
|
+
if (typeof model !== 'string' || model === '')
|
|
1369
|
+
return;
|
|
1370
|
+
const key = (0, auto_yes_state_1.buildCompositeKey)(worktreeId, cliToolId, instanceId);
|
|
1371
|
+
lastAgentModel.set(key, model.slice(0, agent_event_types_1.MAX_EVENT_DETAIL_LENGTH));
|
|
1372
|
+
lastAgentModelAt.set(key, at);
|
|
1373
|
+
observeAgentModel(worktreeId, cliToolId, instanceId, 'hook', at);
|
|
1374
|
+
}
|
|
1351
1375
|
/**
|
|
1352
1376
|
* Latch what a terminal capture showed for this instance (Issue #1784).
|
|
1353
1377
|
*
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
* CLI Command Executor (non-interactive mode)
|
|
4
4
|
* Issue #294: Executes CLI tool commands for scheduled executions
|
|
5
5
|
* Issue #379: Added OpenCode support (opencode run)
|
|
6
|
+
* Issue #2974: Added OpenCode V2 support (opencode2 run --standalone)
|
|
6
7
|
*
|
|
7
|
-
* Supported tools: claude, codex, gemini, vibe-local, opencode, copilot, antigravity, command-code
|
|
8
|
+
* Supported tools: claude, codex, gemini, vibe-local, opencode, copilot, antigravity, command-code,
|
|
9
|
+
* opencode-v2
|
|
8
10
|
*
|
|
9
11
|
* Security:
|
|
10
12
|
* - Uses execFile (not exec) to prevent shell injection
|
|
@@ -19,6 +21,8 @@ exports.getCommandForTool = getCommandForTool;
|
|
|
19
21
|
exports.truncateOutput = truncateOutput;
|
|
20
22
|
exports.buildCliArgs = buildCliArgs;
|
|
21
23
|
exports.extractOpencodeFinalText = extractOpencodeFinalText;
|
|
24
|
+
exports.findOpencodeTrailingError = findOpencodeTrailingError;
|
|
25
|
+
exports.describeOpencodeV2Failure = describeOpencodeV2Failure;
|
|
22
26
|
exports.extractCommandCodeResult = extractCommandCodeResult;
|
|
23
27
|
exports.readCommandCodeStream = readCommandCodeStream;
|
|
24
28
|
exports.describeCommandCodeBlockedToolCalls = describeCommandCodeBlockedToolCalls;
|
|
@@ -31,6 +35,7 @@ const env_sanitizer_1 = require("../../lib/security/env-sanitizer");
|
|
|
31
35
|
const cli_patterns_1 = require("../../lib/detection/cli-patterns");
|
|
32
36
|
const types_1 = require("../../lib/cli-tools/types");
|
|
33
37
|
const schedule_config_1 = require("../../config/schedule-config");
|
|
38
|
+
const opencode_executable_1 = require("../../lib/cli-tools/opencode-executable");
|
|
34
39
|
// =============================================================================
|
|
35
40
|
// Constants
|
|
36
41
|
// =============================================================================
|
|
@@ -77,6 +82,11 @@ function getCommandForTool(cliToolId) {
|
|
|
77
82
|
// cannot drift.
|
|
78
83
|
case 'command-code':
|
|
79
84
|
return 'commandcode';
|
|
85
|
+
// Issue #2974: the name only. `executeClaudeCommand` runs the path
|
|
86
|
+
// `resolveOpencodeV2Executable` answers, which also accepts an `opencode`
|
|
87
|
+
// that reports `opencode v2.x`.
|
|
88
|
+
case 'opencode-v2':
|
|
89
|
+
return opencode_executable_1.OPENCODE_V2_BINARY_NAME;
|
|
80
90
|
default:
|
|
81
91
|
return cliToolId;
|
|
82
92
|
}
|
|
@@ -108,6 +118,7 @@ function truncateOutput(output) {
|
|
|
108
118
|
* - gemini: -p <message>
|
|
109
119
|
* - vibe-local: [-p <message> -y] or [--model <model> -p <message> -y]
|
|
110
120
|
* - opencode: run --format json [-m <model>] [--agent <a>] [--variant <v>] [-c] [--title <t>] <message>
|
|
121
|
+
* - opencode-v2: run --standalone --format json [--auto] [-m <model>[#<variant>]] [--agent <a>] [-c] [--title <t>] -- <message>
|
|
111
122
|
* - antigravity: -p <message> --dangerously-skip-permissions
|
|
112
123
|
* - command-code: -p <message> --output-format json [--yolo | --permission-mode <permission>] --no-auto-update
|
|
113
124
|
* - others: -p <message> (fallback)
|
|
@@ -175,6 +186,63 @@ function buildCliArgs(message, cliToolId, permission, options) {
|
|
|
175
186
|
args.push(message);
|
|
176
187
|
return args;
|
|
177
188
|
}
|
|
189
|
+
case 'opencode-v2': {
|
|
190
|
+
// Issue #2974 (Epic #2370 Phase 4). Measured on OpenCode V2 2.0.18 in an
|
|
191
|
+
// isolated `HOME` / `XDG_*` (`tests/fixtures/opencode-v2-schedule-2974/`).
|
|
192
|
+
//
|
|
193
|
+
// ## `--standalone` is unconditional
|
|
194
|
+
//
|
|
195
|
+
// Without it `opencode2 run` connects to the *background service* — a
|
|
196
|
+
// shared `opencode serve --service` recorded in
|
|
197
|
+
// `~/.local/state/opencode/service.json`, starting one when there is
|
|
198
|
+
// none. That service is the operator's (their own TUI talks to it), it is
|
|
199
|
+
// not the schedule's child, and it outlives the run: in the isolated
|
|
200
|
+
// measurement the run spawned a detached `serve --service` (PPID 1) and
|
|
201
|
+
// then failed with "Timed out waiting for the background service to
|
|
202
|
+
// start" (exit 1). `--standalone` runs a private server for this one run;
|
|
203
|
+
// after it no `opencode2` process was left.
|
|
204
|
+
//
|
|
205
|
+
// ## `--format json` is unconditional
|
|
206
|
+
//
|
|
207
|
+
// For v1's reason (see the `opencode` case): the stream is the same NDJSON
|
|
208
|
+
// shape, so {@link extractOpencodeFinalText} reads both.
|
|
209
|
+
//
|
|
210
|
+
// ## `--auto`
|
|
211
|
+
//
|
|
212
|
+
// `auto` is the only Permission value that adds a flag. Without it an
|
|
213
|
+
// `ask` rule is auto-rejected and the run exits 1 (so the schedule is
|
|
214
|
+
// recorded as failed); with it the rule is approved. See
|
|
215
|
+
// OPENCODE_V2_PERMISSIONS for why the flag-less run is the default.
|
|
216
|
+
//
|
|
217
|
+
// ## Options, and `--` before the message
|
|
218
|
+
//
|
|
219
|
+
// `-m`, `--agent`, `-c` and `--title` exist with v1's meaning. There is
|
|
220
|
+
// no `--variant`: `opencode2 run --help` documents `-m` as
|
|
221
|
+
// `provider/model#variant` and `--variant` is "Unrecognized flag" (exit
|
|
222
|
+
// 1), so a variant rides on the model. A variant without a model has
|
|
223
|
+
// nothing to ride on and is not sent. Since Issue #2982 the CMATE.md
|
|
224
|
+
// column carries these options for opencode-v2 too, and the column parser
|
|
225
|
+
// and `cmate-writer` refuse a variant without a model before it gets here
|
|
226
|
+
// (`validateVariantHasModel`); the guard below stays for direct callers.
|
|
227
|
+
//
|
|
228
|
+
// Unlike v1, a message that begins with `-` is read as a flag ("-x reply"
|
|
229
|
+
// printed the usage; "--- list" was "Unrecognized flag"), so the message
|
|
230
|
+
// follows `--`, which v2 accepts.
|
|
231
|
+
const args = ['run', '--standalone', '--format', 'json'];
|
|
232
|
+
if (permission === schedule_config_1.OPENCODE_V2_AUTO_PERMISSION)
|
|
233
|
+
args.push('--auto');
|
|
234
|
+
if (options?.model) {
|
|
235
|
+
args.push('-m', options.variant ? `${options.model}#${options.variant}` : options.model);
|
|
236
|
+
}
|
|
237
|
+
if (options?.agent)
|
|
238
|
+
args.push('--agent', options.agent);
|
|
239
|
+
if (options?.continueSession)
|
|
240
|
+
args.push('-c');
|
|
241
|
+
if (options?.title)
|
|
242
|
+
args.push('--title', options.title);
|
|
243
|
+
args.push('--', message);
|
|
244
|
+
return args;
|
|
245
|
+
}
|
|
178
246
|
case 'command-code': {
|
|
179
247
|
// Issue #2253 (Epic #2249 Phase D): `commandcode -p <message>` runs one
|
|
180
248
|
// prompt non-interactively. `--output-format json` is unconditional for
|
|
@@ -316,6 +384,12 @@ function buildCliArgs(message, cliToolId, permission, options) {
|
|
|
316
384
|
* whole extraction, because `--print-logs` and a plugin's stray `console.log`
|
|
317
385
|
* both land on the same stdout.
|
|
318
386
|
*
|
|
387
|
+
* ## OpenCode V2 (Issue #2974)
|
|
388
|
+
*
|
|
389
|
+
* `opencode2 run --format json` (2.0.18) writes the same frames with the same
|
|
390
|
+
* `part.messageID` / `part.text`, so this reads it unchanged. Only the `error`
|
|
391
|
+
* frame differs — see {@link renderOpencodeErrorFrame}.
|
|
392
|
+
*
|
|
319
393
|
* @param stdout - Raw stdout from `opencode run --format json`
|
|
320
394
|
* @returns The assistant's final text, a one-line rendering of an `error`
|
|
321
395
|
* frame, or null when the stream carried neither
|
|
@@ -363,22 +437,76 @@ function extractOpencodeFinalText(stdout) {
|
|
|
363
437
|
/**
|
|
364
438
|
* One line describing an `{"type":"error"}` frame.
|
|
365
439
|
*
|
|
366
|
-
* The measured shape is `error: { name, data: { message, ref } }`;
|
|
367
|
-
*
|
|
368
|
-
*
|
|
369
|
-
*
|
|
440
|
+
* The measured v1 shape is `error: { name, data: { message, ref } }`; OpenCode
|
|
441
|
+
* V2 2.0.18 writes `error: { type, message }` (`{"type":"aborted","message":
|
|
442
|
+
* "Step interrupted"}` after an auto-rejected `ask`, `{"type":"unknown",
|
|
443
|
+
* "message":"Agent not found: …"}`, `{"type":"provider.no-route",…}`). Both are
|
|
444
|
+
* read; v1's fields win when present. Every field is treated as optional
|
|
445
|
+
* because the only thing this layer knows for certain is the `type`. Rendered
|
|
446
|
+
* rather than dropped so a failed opencode run says something in the execution
|
|
447
|
+
* log instead of nothing.
|
|
370
448
|
*/
|
|
371
449
|
function renderOpencodeErrorFrame(record) {
|
|
372
450
|
const error = typeof record.error === 'object' && record.error !== null
|
|
373
451
|
? record.error
|
|
374
452
|
: {};
|
|
375
|
-
const name = typeof error.name === 'string' ? error.name
|
|
453
|
+
const name = typeof error.name === 'string' ? error.name
|
|
454
|
+
: typeof error.type === 'string' ? error.type
|
|
455
|
+
: 'error';
|
|
376
456
|
const data = typeof error.data === 'object' && error.data !== null
|
|
377
457
|
? error.data
|
|
378
458
|
: {};
|
|
379
|
-
const message = typeof data.message === 'string' ? data.message
|
|
459
|
+
const message = typeof data.message === 'string' ? data.message
|
|
460
|
+
: typeof error.message === 'string' ? error.message
|
|
461
|
+
: '';
|
|
380
462
|
return message ? `opencode error: ${name}: ${message}` : `opencode error: ${name}`;
|
|
381
463
|
}
|
|
464
|
+
/**
|
|
465
|
+
* The `error` frame an opencode stream *ends* with, rendered, or null.
|
|
466
|
+
*
|
|
467
|
+
* Issue #2974: the measured OpenCode V2 failures (an auto-rejected `ask`, an
|
|
468
|
+
* unknown agent, an unavailable model) all end the stream in an `error` frame
|
|
469
|
+
* and exit 1. The exit code is what fails the schedule; this is the second
|
|
470
|
+
* half, so a run that ever exits 0 after an `error` frame is not recorded as
|
|
471
|
+
* completed either. "Ends with" rather than "contains": a stream whose last
|
|
472
|
+
* word is the assistant's answer did finish.
|
|
473
|
+
*
|
|
474
|
+
* @param stdout - Raw stdout from `opencode2 run --format json`
|
|
475
|
+
* @returns The rendered error, or null when the last frame is not an error
|
|
476
|
+
*/
|
|
477
|
+
function findOpencodeTrailingError(stdout) {
|
|
478
|
+
let last = null;
|
|
479
|
+
for (const line of stdout.split('\n')) {
|
|
480
|
+
const trimmed = line.trim();
|
|
481
|
+
if (!trimmed.startsWith('{'))
|
|
482
|
+
continue;
|
|
483
|
+
try {
|
|
484
|
+
const frame = JSON.parse(trimmed);
|
|
485
|
+
if (typeof frame === 'object' && frame !== null)
|
|
486
|
+
last = frame;
|
|
487
|
+
}
|
|
488
|
+
catch {
|
|
489
|
+
continue;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
return last && last.type === 'error' ? renderOpencodeErrorFrame(last) : null;
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* The `Reason:` line for a failed OpenCode V2 run, or null.
|
|
496
|
+
*
|
|
497
|
+
* Measured on 2.0.18: an `ask` rule without `--auto` prints
|
|
498
|
+
* `! permission requested: <permission> (<target>); auto-rejecting` on stderr
|
|
499
|
+
* and exits 1. That line is the one that says what to change, so it is named;
|
|
500
|
+
* any other failure is described by its trailing `error` frame.
|
|
501
|
+
*/
|
|
502
|
+
function describeOpencodeV2Failure(stdout, stderr) {
|
|
503
|
+
if (/permission requested: .*auto-rejecting/.test((0, cli_patterns_1.stripAnsi)(stderr))) {
|
|
504
|
+
return 'Reason: opencode-v2 auto-rejected a permission request (an `ask` rule);'
|
|
505
|
+
+ ' set the schedule\'s Permission to `auto` to approve it unattended';
|
|
506
|
+
}
|
|
507
|
+
const trailing = findOpencodeTrailingError(stdout);
|
|
508
|
+
return trailing ? `Reason: ${trailing}` : null;
|
|
509
|
+
}
|
|
382
510
|
// =============================================================================
|
|
383
511
|
// command-code `--output-format json` extraction (Issue #2253)
|
|
384
512
|
// =============================================================================
|
|
@@ -679,11 +807,35 @@ async function executeClaudeCommand(message, cwd, cliToolId = 'claude', permissi
|
|
|
679
807
|
? message.substring(0, exports.MAX_MESSAGE_LENGTH)
|
|
680
808
|
: message;
|
|
681
809
|
const args = buildCliArgs(truncatedMessage, cliToolId, permission, options);
|
|
810
|
+
// Issue #2974: OpenCode V2 runs the binary `resolveOpencodeV2Executable`
|
|
811
|
+
// answers for (`opencode2`, or an `opencode` that reports v2) — the same
|
|
812
|
+
// resolution the interactive launch uses, so a v1 `opencode` is never handed
|
|
813
|
+
// v2's flags.
|
|
814
|
+
let command = getCommandForTool(cliToolId);
|
|
815
|
+
if (cliToolId === 'opencode-v2') {
|
|
816
|
+
const resolution = await (0, opencode_executable_1.resolveOpencodeV2Executable)();
|
|
817
|
+
if (!resolution.executable) {
|
|
818
|
+
const error = 'OpenCode V2 not found: no `opencode2` (or `opencode` reporting v2) on PATH';
|
|
819
|
+
return { output: error, exitCode: null, status: 'failed', error };
|
|
820
|
+
}
|
|
821
|
+
command = resolution.executable.path;
|
|
822
|
+
}
|
|
823
|
+
// Issue #2979: `execFile`'s `cwd` does not touch `PWD`, so the child inherits
|
|
824
|
+
// the server's (the main checkout it was started from). OpenCode V2 takes its
|
|
825
|
+
// project directory from `PWD`, not `process.cwd()`: measured on 2.0.18 in a
|
|
826
|
+
// throwaway repo + `git worktree`, the write landed wherever `PWD` pointed
|
|
827
|
+
// (cwd=worktree / PWD=main → main; cwd=main / PWD=worktree → worktree;
|
|
828
|
+
// PWD unset → cwd), for a plain repo and a worktree alike, and the
|
|
829
|
+
// `opencode.json` read was the one under `PWD`. `opencode2 run` has no `--dir`
|
|
830
|
+
// (v1 has), so the child's `PWD` is set to `cwd`. Other tools keep the
|
|
831
|
+
// environment they had.
|
|
832
|
+
const env = cliToolId === 'opencode-v2'
|
|
833
|
+
? { ...(0, env_sanitizer_1.sanitizeEnvForChildProcess)(), PWD: cwd }
|
|
834
|
+
: (0, env_sanitizer_1.sanitizeEnvForChildProcess)();
|
|
682
835
|
return new Promise((resolve) => {
|
|
683
|
-
const command = getCommandForTool(cliToolId);
|
|
684
836
|
const child = (0, child_process_1.execFile)(command, args, {
|
|
685
837
|
cwd,
|
|
686
|
-
env
|
|
838
|
+
env,
|
|
687
839
|
maxBuffer: exports.MAX_OUTPUT_SIZE,
|
|
688
840
|
timeout: options?.timeoutMs ?? exports.EXECUTION_TIMEOUT_MS,
|
|
689
841
|
}, (error, stdout, stderr) => {
|
|
@@ -713,6 +865,7 @@ async function executeClaudeCommand(message, cwd, cliToolId = 'claude', permissi
|
|
|
713
865
|
? describeCommandCodeBlockedToolCalls(commandCodeStream)
|
|
714
866
|
: null;
|
|
715
867
|
const exitCodeNumber = typeof errCode === 'number' ? errCode : null;
|
|
868
|
+
const isOpencodeV2 = cliToolId === 'opencode-v2';
|
|
716
869
|
const errorSummary = [
|
|
717
870
|
...(blockedWarning ?? []),
|
|
718
871
|
`Error: ${error.message}`,
|
|
@@ -722,6 +875,7 @@ async function executeClaudeCommand(message, cwd, cliToolId = 'claude', permissi
|
|
|
722
875
|
cliToolId === 'command-code'
|
|
723
876
|
? describeCommandCodeFailure(exitCodeNumber, commandCodeResult)
|
|
724
877
|
: null,
|
|
878
|
+
isOpencodeV2 ? describeOpencodeV2Failure(stdout || '', stderr || '') : null,
|
|
725
879
|
]
|
|
726
880
|
.filter((line) => line !== null)
|
|
727
881
|
.join('\n');
|
|
@@ -729,9 +883,14 @@ async function executeClaudeCommand(message, cwd, cliToolId = 'claude', permissi
|
|
|
729
883
|
// before it could write a result line (an unknown `--model` exits 1
|
|
730
884
|
// with empty stdout and the message on stderr) reports what it did
|
|
731
885
|
// write rather than an empty body.
|
|
886
|
+
//
|
|
887
|
+
// Issue #2974: OpenCode V2 likewise decodes its NDJSON, so the body is
|
|
888
|
+
// the answer (or the rendered `error` frame), not the event dump.
|
|
732
889
|
const decodedStdout = commandCodeResult
|
|
733
890
|
? commandCodeResult.finalText
|
|
734
|
-
:
|
|
891
|
+
: isOpencodeV2
|
|
892
|
+
? extractOpencodeFinalText(stdout || '') ?? (stdout || '')
|
|
893
|
+
: (stdout || '');
|
|
735
894
|
const rawOutput = (0, cli_patterns_1.stripAnsi)([
|
|
736
895
|
errorSummary,
|
|
737
896
|
decodedStdout ? `\n--- stdout ---\n${decodedStdout}` : '',
|
|
@@ -781,6 +940,21 @@ async function executeClaudeCommand(message, cwd, cliToolId = 'claude', permissi
|
|
|
781
940
|
});
|
|
782
941
|
return;
|
|
783
942
|
}
|
|
943
|
+
// Issue #2974: exit 0 is not the whole verdict for OpenCode V2 — a
|
|
944
|
+
// stream that ends in an `error` frame did not finish, whatever the
|
|
945
|
+
// exit code says (see findOpencodeTrailingError).
|
|
946
|
+
if (cliToolId === 'opencode-v2') {
|
|
947
|
+
const trailingError = findOpencodeTrailingError(stdout || '');
|
|
948
|
+
const body = extractOpencodeFinalText(stdout || '') ?? (stdout || '');
|
|
949
|
+
const head = trailingError ? [`Reason: ${trailingError}`] : [];
|
|
950
|
+
resolve({
|
|
951
|
+
output: truncateOutput((0, cli_patterns_1.stripAnsi)([...head, body].join('\n'))),
|
|
952
|
+
exitCode: 0,
|
|
953
|
+
status: trailingError ? 'failed' : 'completed',
|
|
954
|
+
...(trailingError ? { error: trailingError } : {}),
|
|
955
|
+
});
|
|
956
|
+
return;
|
|
957
|
+
}
|
|
784
958
|
const decoded = cliToolId === 'opencode'
|
|
785
959
|
? extractOpencodeFinalText(stdout || '') ?? stdout ?? ''
|
|
786
960
|
: stdout || '';
|
|
@@ -301,6 +301,9 @@ function summarizeAskUserQuestion(episode) {
|
|
|
301
301
|
question: first.question,
|
|
302
302
|
labels: first.choices.map((choice) => choice.label),
|
|
303
303
|
questionCount: episode.spec.questions.length,
|
|
304
|
+
// Issue #2951: a question that takes a typed answer, so the panel and the
|
|
305
|
+
// phone sheet can offer an input for it.
|
|
306
|
+
...(first.custom ? { custom: true } : {}),
|
|
304
307
|
};
|
|
305
308
|
}
|
|
306
309
|
/**
|
|
@@ -999,7 +1002,10 @@ async function buildPayload(db, worktreeId, cliToolId, instanceId) {
|
|
|
999
1002
|
// same way `structuredEvents.pendingDecisions[].kind` is, through the one
|
|
1000
1003
|
// reader in `pending-decision-kind`.
|
|
1001
1004
|
const addressesQuestion = promptWaiting !== null && (0, pending_decision_kind_1.pendingDecisionKind)(promptWaiting.toolName) === 'question';
|
|
1002
|
-
const decisionOptions = addressableDecisionId !== null && !addressesQuestion
|
|
1005
|
+
const decisionOptions = addressableDecisionId !== null && !addressesQuestion
|
|
1006
|
+
? // Issue #2951: in the tool's own words (OpenCode V2: `Always allow`).
|
|
1007
|
+
(0, structured_prompt_1.structuredDecisionOptionsFor)(cliToolId)
|
|
1008
|
+
: null;
|
|
1003
1009
|
const structuredFacts = promptWaiting === null
|
|
1004
1010
|
? null
|
|
1005
1011
|
: {
|
|
@@ -1096,7 +1102,16 @@ async function buildPayload(db, worktreeId, cliToolId, instanceId) {
|
|
|
1096
1102
|
// an unclassified frame, and writing a "detection failed" row for a turn the
|
|
1097
1103
|
// agent itself told us had ended would put a false stall into the audit trail
|
|
1098
1104
|
// `capture --prompts` prints.
|
|
1099
|
-
|
|
1105
|
+
//
|
|
1106
|
+
// Issue #2965: not while the agent holds a decision this server can answer by
|
|
1107
|
+
// id (OpenCode V2 / opencode approvals and questions). The frame may still be
|
|
1108
|
+
// one the scraper cannot read, but "nothing could answer it" is false then,
|
|
1109
|
+
// and the row landed in the chat as a meaningless assistant line. Fed to the
|
|
1110
|
+
// tracker as "not unclassified" rather than merely not written, so the run —
|
|
1111
|
+
// and the 60 seconds — start afresh if the frame is still unreadable once the
|
|
1112
|
+
// decision is gone (answered, expired, or the source dropped).
|
|
1113
|
+
const answerableOverAgentApi = (0, structured_prompt_1.hasApiAnswerableDecision)(eventSource.capabilities.eventIdentity, structuredEvents.pendingDecisions ?? []);
|
|
1114
|
+
const unclassifiedVerdict = (0, unclassified_frame_tracker_1.observeUnclassifiedFrame)(compositeKey, merged.isUnclassifiedActive && !answerableOverAgentApi);
|
|
1100
1115
|
if (unclassifiedVerdict.shouldRecord) {
|
|
1101
1116
|
recordUnclassifiedFrame(db, {
|
|
1102
1117
|
worktreeId,
|
|
@@ -1136,7 +1151,16 @@ async function buildPayload(db, worktreeId, cliToolId, instanceId) {
|
|
|
1136
1151
|
}
|
|
1137
1152
|
// Issue #1725: the structured layer saw a dialog the scraper did not. That
|
|
1138
1153
|
// gap is the fact worth keeping — see recordStructuredPrompt.
|
|
1139
|
-
|
|
1154
|
+
//
|
|
1155
|
+
// Issue #2965: except while that dialog can be answered over the agent's API
|
|
1156
|
+
// — the live payload already carries its id and replies, so the row says
|
|
1157
|
+
// nothing true. Not marked recorded either: should the decision expire with
|
|
1158
|
+
// the dialog still open, the row is written then (the safe side).
|
|
1159
|
+
if (promptWaiting !== null &&
|
|
1160
|
+
structuredFacts !== null &&
|
|
1161
|
+
!scraperPromptWaiting &&
|
|
1162
|
+
!promptWaiting.recorded &&
|
|
1163
|
+
!answerableOverAgentApi) {
|
|
1140
1164
|
(0, agent_event_state_1.markStructuredPromptRecorded)(worktreeId, cliToolId, instanceId);
|
|
1141
1165
|
recordStructuredPrompt(db, {
|
|
1142
1166
|
worktreeId,
|
|
@@ -47,6 +47,7 @@ const logger_1 = require("../../lib/logger");
|
|
|
47
47
|
const worktree_session_ownership_1 = require("../../lib/cli-tools/worktree-session-ownership");
|
|
48
48
|
const session_name_1 = require("../../lib/cli-tools/session-name");
|
|
49
49
|
const prompt_waiting_guard_1 = require("../../lib/session/prompt-waiting-guard");
|
|
50
|
+
const session_start_error_1 = require("../../lib/session/session-start-error");
|
|
50
51
|
const opencode_1 = require("../../lib/cli-tools/opencode");
|
|
51
52
|
const logger = (0, logger_1.createLogger)('session/send-user-message');
|
|
52
53
|
function getErrorMessage(error) {
|
|
@@ -313,6 +314,9 @@ async function sendUserMessage(db, params) {
|
|
|
313
314
|
}
|
|
314
315
|
catch (error) {
|
|
315
316
|
logger.error('failed-to-send-message-to:', { error: getErrorMessage(error) });
|
|
317
|
+
if ((0, session_start_error_1.isSessionStartTimeoutError)(error)) {
|
|
318
|
+
return { ok: false, stage: 'send', error: error.message, code: session_start_error_1.SESSION_STARTING_CODE };
|
|
319
|
+
}
|
|
316
320
|
return { ok: false, stage: 'send', error: getErrorMessage(error) };
|
|
317
321
|
}
|
|
318
322
|
// 5. Create user message in database (History source: chat_messages).
|