agent-log-viewer 1.2.0 → 1.2.2
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/dist/mcp-server.mjs +3712 -1753
- package/dist/runtime-host.mjs +3442 -1472
- package/dist/standalone/.next/BUILD_ID +1 -1
- package/dist/standalone/.next/app-path-routes-manifest.json +29 -27
- package/dist/standalone/.next/build-manifest.json +2 -2
- package/dist/standalone/.next/prerender-manifest.json +4 -4
- package/dist/standalone/.next/required-server-files.json +1 -0
- package/dist/standalone/.next/routes-manifest.json +12 -0
- package/dist/standalone/.next/server/account-migration-controller-worker.js +1 -1
- package/dist/standalone/.next/server/app/_global-error/page.js +2 -2
- package/dist/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/standalone/.next/server/app/_not-found/page.js +1 -1
- package/dist/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/standalone/.next/server/app/_not-found.rsc +2 -2
- package/dist/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/dist/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/dist/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/dist/standalone/.next/server/app/api/access/route.js +1 -1
- package/dist/standalone/.next/server/app/api/access/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/account-migrations/[intentId]/route.js +1 -1
- package/dist/standalone/.next/server/app/api/account-migrations/[intentId]/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/account-project-bindings/route.js +1 -1
- package/dist/standalone/.next/server/app/api/account-project-bindings/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/[id]/status/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/[id]/status/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/active/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/active/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/limits/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/limits/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/login/[operationId]/input/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/login/[operationId]/input/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/login/[operationId]/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/login/[operationId]/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/policy/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/policy/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/terminal/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/terminal/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/cli/route.js +1 -0
- package/dist/standalone/.next/server/app/api/accounts/cli/route.js.nft.json +1 -0
- package/dist/standalone/.next/server/app/api/accounts/cli/route_client-reference-manifest.js +1 -0
- package/dist/standalone/.next/server/app/api/accounts/codex/active/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/active/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/limits/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/limits/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/policy/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/policy/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/reset-credits/route.js +2 -2
- package/dist/standalone/.next/server/app/api/accounts/codex/reset-credits/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/terminal/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/terminal/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/agent/route.js +1 -1
- package/dist/standalone/.next/server/app/api/agent/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/agent/snapshot/route.js +1 -1
- package/dist/standalone/.next/server/app/api/agent/snapshot/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/answer/route.js +1 -1
- package/dist/standalone/.next/server/app/api/answer/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/artifact/route.js +1 -1
- package/dist/standalone/.next/server/app/api/artifact/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/attach-command/route.js +1 -1
- package/dist/standalone/.next/server/app/api/attach-command/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/attention/[id]/route.js +1 -1
- package/dist/standalone/.next/server/app/api/attention/[id]/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/attention/route.js +1 -1
- package/dist/standalone/.next/server/app/api/attention/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/board/route.js +1 -1
- package/dist/standalone/.next/server/app/api/board/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/bridge/route.js +1 -1
- package/dist/standalone/.next/server/app/api/bridge/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/conversation-host/route.js +1 -1
- package/dist/standalone/.next/server/app/api/conversation-host/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/conversation-host/targets/route.js +1 -1
- package/dist/standalone/.next/server/app/api/conversation-host/targets/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/conversations/[conversationId]/migration/route.js +1 -1
- package/dist/standalone/.next/server/app/api/conversations/[conversationId]/migration/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/conversations/route.js +1 -1
- package/dist/standalone/.next/server/app/api/conversations/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/files/route.js +6 -3
- package/dist/standalone/.next/server/app/api/files/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/flows/[id]/route.js +1 -1
- package/dist/standalone/.next/server/app/api/flows/[id]/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/flows/route.js +1 -1
- package/dist/standalone/.next/server/app/api/flows/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/image/route.js +1 -1
- package/dist/standalone/.next/server/app/api/image/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/inbox/route.js +2 -2
- package/dist/standalone/.next/server/app/api/inbox/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/lifecycle/reaper/route.js +1 -1
- package/dist/standalone/.next/server/app/api/lifecycle/reaper/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/limits/history/route.js +1 -1
- package/dist/standalone/.next/server/app/api/limits/history/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/limits/route.js +1 -1
- package/dist/standalone/.next/server/app/api/limits/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/log/preflight/route.js +1 -1
- package/dist/standalone/.next/server/app/api/log/preflight/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/log/project-delete/route.js +1 -1
- package/dist/standalone/.next/server/app/api/log/project-delete/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/log/provenance/route.js +14 -12
- package/dist/standalone/.next/server/app/api/log/provenance/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/log/route.js +1 -1
- package/dist/standalone/.next/server/app/api/log/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/log/suggestions/route.js +2 -2
- package/dist/standalone/.next/server/app/api/log/suggestions/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/logs/route.js +1 -1
- package/dist/standalone/.next/server/app/api/logs/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/logs/stream/route.js +2 -2
- package/dist/standalone/.next/server/app/api/logs/stream/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/monitor/runs/route.js +1 -1
- package/dist/standalone/.next/server/app/api/monitor/runs/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/monitor/seat-tick/route.js +13 -14
- package/dist/standalone/.next/server/app/api/monitor/seat-tick/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/monitor/seat-tick/settings/route.js +2 -2
- package/dist/standalone/.next/server/app/api/monitor/seat-tick/settings/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/onboarding/route.js +1 -0
- package/dist/standalone/.next/server/app/api/onboarding/route.js.nft.json +1 -0
- package/dist/standalone/.next/server/app/api/onboarding/route_client-reference-manifest.js +1 -0
- package/dist/standalone/.next/server/app/api/orchestrator/rotate/route.js +1 -1
- package/dist/standalone/.next/server/app/api/orchestrator/rotate/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/orchestrator/seat/route.js +1 -1
- package/dist/standalone/.next/server/app/api/orchestrator/seat/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/orchestrator/seat/status/route.js +1 -3
- package/dist/standalone/.next/server/app/api/orchestrator/seat/status/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/pipelines/[id]/route.js +1 -1
- package/dist/standalone/.next/server/app/api/pipelines/[id]/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/pipelines/preflight/route.js +1 -1
- package/dist/standalone/.next/server/app/api/pipelines/preflight/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/pipelines/route.js +1 -1
- package/dist/standalone/.next/server/app/api/pipelines/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/pipelines/tick/route.js +1 -2
- package/dist/standalone/.next/server/app/api/pipelines/tick/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/proc/route.js +1 -1
- package/dist/standalone/.next/server/app/api/proc/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/projects/create/route.js +2 -2
- package/dist/standalone/.next/server/app/api/projects/create/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/projects/crown/route.js +1 -1
- package/dist/standalone/.next/server/app/api/projects/crown/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/projects/directories/route.js +1 -1
- package/dist/standalone/.next/server/app/api/projects/directories/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/push/route.js +2 -2
- package/dist/standalone/.next/server/app/api/push/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/resources/route.js +1 -1
- package/dist/standalone/.next/server/app/api/resources/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/roles/route.js +3 -3
- package/dist/standalone/.next/server/app/api/roles/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/answer/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/answer/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/deployments/[deploymentId]/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/deployments/[deploymentId]/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/deployments/capabilities/v1/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/deployments/capabilities/v1/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/deployments/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/deployments/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/hosts/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/hosts/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/inject/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/inject/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/interrupt/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/interrupt/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/operations/[operationId]/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/operations/[operationId]/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/operations/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/operations/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/queue/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/queue/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/realtime/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/realtime/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/send/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/send/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/snapshot/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/snapshot/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/spawn/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/spawn/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/steer/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/steer/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/stream/route.js +2 -2
- package/dist/standalone/.next/server/app/api/runtime/stream/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/search/transcripts/route.js +1 -1
- package/dist/standalone/.next/server/app/api/search/transcripts/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/session/route.js +1 -1
- package/dist/standalone/.next/server/app/api/session/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/session/supersedence/route.js +1 -1
- package/dist/standalone/.next/server/app/api/session/supersedence/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/session/title/route.js +1 -1
- package/dist/standalone/.next/server/app/api/session/title/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/spawn/policy/route.js +2 -2
- package/dist/standalone/.next/server/app/api/spawn/policy/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/spawn/route.js +1 -1
- package/dist/standalone/.next/server/app/api/spawn/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/spawn/validate/route.js +1 -1
- package/dist/standalone/.next/server/app/api/spawn/validate/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/staging/route.js +2 -2
- package/dist/standalone/.next/server/app/api/staging/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/task-attachments/route.js +2 -2
- package/dist/standalone/.next/server/app/api/task-attachments/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/tasks/[id]/assignment/route.js +1 -1
- package/dist/standalone/.next/server/app/api/tasks/[id]/assignment/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/tasks/[id]/route.js +1 -1
- package/dist/standalone/.next/server/app/api/tasks/[id]/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/tasks/[id]/send/route.js +1 -1
- package/dist/standalone/.next/server/app/api/tasks/[id]/send/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/tasks/[id]/spawn/route.js +1 -1
- package/dist/standalone/.next/server/app/api/tasks/[id]/spawn/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/tasks/curator/route.js +1 -1
- package/dist/standalone/.next/server/app/api/tasks/curator/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/tasks/route.js +1 -1
- package/dist/standalone/.next/server/app/api/tasks/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/telegram/reports/route.js +1 -1
- package/dist/standalone/.next/server/app/api/telegram/reports/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/telegram/route.js +1 -1
- package/dist/standalone/.next/server/app/api/telegram/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/timeline/route.js +1 -1
- package/dist/standalone/.next/server/app/api/timeline/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/tmux/route.js +1 -1
- package/dist/standalone/.next/server/app/api/tmux/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/tmux/targets/route.js +1 -1
- package/dist/standalone/.next/server/app/api/tmux/targets/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/transcribe/backend/route.js +2 -2
- package/dist/standalone/.next/server/app/api/transcribe/backend/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/transcribe/route.js +2 -2
- package/dist/standalone/.next/server/app/api/transcribe/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/transcribe/token/route.js +2 -2
- package/dist/standalone/.next/server/app/api/transcribe/token/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/tts/backend/route.js +1 -1
- package/dist/standalone/.next/server/app/api/tts/backend/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/tts/route.js +2 -2
- package/dist/standalone/.next/server/app/api/tts/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/view/presence/route.js +2 -1
- package/dist/standalone/.next/server/app/api/view/presence/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/workflows/[id]/route.js +1 -1
- package/dist/standalone/.next/server/app/api/workflows/[id]/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/workflows/route.js +1 -1
- package/dist/standalone/.next/server/app/api/workflows/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/favicon.ico/route.js +1 -1
- package/dist/standalone/.next/server/app/favicon.ico/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/index.html +1 -1
- package/dist/standalone/.next/server/app/index.rsc +3 -3
- package/dist/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/dist/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/dist/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/dist/standalone/.next/server/app/page.js +20 -20
- package/dist/standalone/.next/server/app/page.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/standalone/.next/server/app-paths-manifest.json +29 -27
- package/dist/standalone/.next/server/chunks/107.js +1 -1
- package/dist/standalone/.next/server/chunks/1106.js +5 -0
- package/dist/standalone/.next/server/chunks/112.js +1 -0
- package/dist/standalone/.next/server/chunks/1406.js +37 -170
- package/dist/standalone/.next/server/chunks/1585.js +3 -3
- package/dist/standalone/.next/server/chunks/160.js +18 -18
- package/dist/standalone/.next/server/chunks/1617.js +2 -2
- package/dist/standalone/.next/server/chunks/1849.js +1 -1
- package/dist/standalone/.next/server/chunks/1952.js +1 -1
- package/dist/standalone/.next/server/chunks/2150.js +1 -1
- package/dist/standalone/.next/server/chunks/2499.js +1 -0
- package/dist/standalone/.next/server/chunks/2555.js +1 -1
- package/dist/standalone/.next/server/chunks/2589.js +127 -0
- package/dist/standalone/.next/server/chunks/261.js +1 -0
- package/dist/standalone/.next/server/chunks/2744.js +3 -0
- package/dist/standalone/.next/server/chunks/2857.js +1 -1
- package/dist/standalone/.next/server/chunks/286.js +22 -0
- package/dist/standalone/.next/server/chunks/2914.js +20 -21
- package/dist/standalone/.next/server/chunks/2916.js +1 -0
- package/dist/standalone/.next/server/chunks/3086.js +1 -1
- package/dist/standalone/.next/server/chunks/3131.js +1 -1
- package/dist/standalone/.next/server/chunks/3407.js +1 -1
- package/dist/standalone/.next/server/chunks/3509.js +1 -0
- package/dist/standalone/.next/server/chunks/3570.js +1 -1
- package/dist/standalone/.next/server/chunks/3696.js +5 -0
- package/dist/standalone/.next/server/chunks/3743.js +10 -8
- package/dist/standalone/.next/server/chunks/3784.js +5 -0
- package/dist/standalone/.next/server/chunks/3830.js +1 -1
- package/dist/standalone/.next/server/chunks/3957.js +1 -0
- package/dist/standalone/.next/server/chunks/4037.js +1 -0
- package/dist/standalone/.next/server/chunks/4651.js +1 -1
- package/dist/standalone/.next/server/chunks/4972.js +38 -16
- package/dist/standalone/.next/server/chunks/53.js +1 -0
- package/dist/standalone/.next/server/chunks/5408.js +1 -0
- package/dist/standalone/.next/server/chunks/5465.js +156 -0
- package/dist/standalone/.next/server/chunks/5545.js +1 -1
- package/dist/standalone/.next/server/chunks/568.js +1 -1
- package/dist/standalone/.next/server/chunks/5771.js +1 -1
- package/dist/standalone/.next/server/chunks/6023.js +1 -1
- package/dist/standalone/.next/server/chunks/6211.js +1 -0
- package/dist/standalone/.next/server/chunks/6289.js +1 -2
- package/dist/standalone/.next/server/chunks/6418.js +1 -0
- package/dist/standalone/.next/server/chunks/644.js +1 -1
- package/dist/standalone/.next/server/chunks/6453.js +1 -1
- package/dist/standalone/.next/server/chunks/6522.js +1 -1
- package/dist/standalone/.next/server/chunks/6796.js +1 -1
- package/dist/standalone/.next/server/chunks/6826.js +3 -3
- package/dist/standalone/.next/server/chunks/6942.js +3 -3
- package/dist/standalone/.next/server/chunks/6978.js +1 -1
- package/dist/standalone/.next/server/chunks/7008.js +21 -19
- package/dist/standalone/.next/server/chunks/7192.js +1 -1
- package/dist/standalone/.next/server/chunks/7238.js +2 -2
- package/dist/standalone/.next/server/chunks/7294.js +1 -0
- package/dist/standalone/.next/server/chunks/7722.js +1 -1
- package/dist/standalone/.next/server/chunks/781.js +17 -17
- package/dist/standalone/.next/server/chunks/8027.js +1 -1
- package/dist/standalone/.next/server/chunks/8330.js +1 -0
- package/dist/standalone/.next/server/chunks/8444.js +1 -1
- package/dist/standalone/.next/server/chunks/8465.js +2 -2
- package/dist/standalone/.next/server/chunks/8512.js +1 -1
- package/dist/standalone/.next/server/chunks/8513.js +2 -2
- package/dist/standalone/.next/server/chunks/8617.js +1 -1
- package/dist/standalone/.next/server/chunks/8817.js +2 -2
- package/dist/standalone/.next/server/chunks/8966.js +2 -2
- package/dist/standalone/.next/server/chunks/8985.js +1 -1
- package/dist/standalone/.next/server/chunks/8996.js +1 -1
- package/dist/standalone/.next/server/chunks/9006.js +1 -0
- package/dist/standalone/.next/server/chunks/9060.js +4 -0
- package/dist/standalone/.next/server/chunks/9296.js +20 -21
- package/dist/standalone/.next/server/chunks/9298.js +1 -2
- package/dist/standalone/.next/server/chunks/9307.js +1 -1
- package/dist/standalone/.next/server/chunks/9360.js +14 -12
- package/dist/standalone/.next/server/chunks/9517.js +1 -1
- package/dist/standalone/.next/server/chunks/9611.js +1 -0
- package/dist/standalone/.next/server/chunks/9822.js +1 -1
- package/dist/standalone/.next/server/chunks/9839.js +5 -0
- package/dist/standalone/.next/server/chunks/9867.js +1 -0
- package/dist/standalone/.next/server/chunks/9940.js +37 -15
- package/dist/standalone/.next/server/chunks/9998.js +1 -1
- package/dist/standalone/.next/server/file-scanner-worker.js +2 -2
- package/dist/standalone/.next/server/files-response-worker.js +2 -2
- package/dist/standalone/.next/server/functions-config-manifest.json +2 -0
- package/dist/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/standalone/.next/server/middleware.js +3 -3
- package/dist/standalone/.next/server/pages/404.html +1 -1
- package/dist/standalone/.next/server/pages/500.html +1 -1
- package/dist/standalone/.next/server/resource-collector-worker.js +1 -1
- package/dist/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/standalone/.next/server/state-backup-worker.js +3 -0
- package/dist/standalone/.next/server/wakatime-sync-worker.js +1 -1
- package/dist/standalone/.next/static/chunks/9591-0fd6a5a4172de16d.js +1 -0
- package/dist/standalone/.next/static/chunks/app/_global-error/page-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/access/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/account-migrations/[intentId]/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/account-project-bindings/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/[id]/status/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/active/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/limits/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/login/[operationId]/input/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/login/[operationId]/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/policy/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/terminal/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/cli/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/active/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/limits/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/policy/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/reset-credits/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/terminal/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/agent/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/agent/snapshot/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/answer/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/artifact/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/attach-command/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/attention/[id]/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/attention/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/board/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/bridge/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/conversation-host/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/conversation-host/targets/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/conversations/[conversationId]/migration/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/conversations/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/files/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/flows/[id]/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/flows/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/image/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/inbox/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/lifecycle/reaper/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/limits/history/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/limits/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/log/preflight/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/log/project-delete/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/log/provenance/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/log/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/log/suggestions/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/logs/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/logs/stream/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/monitor/runs/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/monitor/seat-tick/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/monitor/seat-tick/settings/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/onboarding/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/orchestrator/rotate/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/orchestrator/seat/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/orchestrator/seat/status/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/pipelines/[id]/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/pipelines/preflight/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/pipelines/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/pipelines/tick/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/proc/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/projects/create/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/projects/crown/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/projects/directories/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/push/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/resources/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/roles/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/answer/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/deployments/[deploymentId]/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/deployments/capabilities/v1/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/deployments/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/hosts/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/inject/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/interrupt/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/operations/[operationId]/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/operations/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/queue/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/realtime/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/send/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/snapshot/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/spawn/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/steer/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/stream/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/search/transcripts/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/session/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/session/supersedence/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/session/title/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/spawn/policy/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/spawn/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/spawn/validate/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/staging/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/task-attachments/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/assignment/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/send/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/spawn/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tasks/curator/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tasks/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/telegram/reports/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/telegram/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/timeline/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tmux/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tmux/targets/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/transcribe/backend/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/transcribe/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/transcribe/token/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tts/backend/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tts/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/view/presence/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/workflows/[id]/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/workflows/route-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/app/page-a2e19d755e17b569.js +125 -0
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-151390fbd8c93c25.js +1 -0
- package/dist/standalone/.next/static/css/9b32c3f7f468cbcc.css +1 -0
- package/dist/standalone/.next/static/fQ2a5S10vvpyAqE0L_wUj/_buildManifest.js +1 -0
- package/dist/standalone/AGENTS.md +10 -0
- package/dist/standalone/package.json +1 -1
- package/dist/standalone/server.bun.js +1 -1
- package/dist/standalone/src/lib/viewerInstrumentation.ts +63 -5
- package/package.json +1 -1
- package/dist/standalone/.next/server/chunks/1888.js +0 -1
- package/dist/standalone/.next/server/chunks/4127.js +0 -1
- package/dist/standalone/.next/server/chunks/480.js +0 -126
- package/dist/standalone/.next/server/chunks/7361.js +0 -22
- package/dist/standalone/.next/static/chunks/6976-016b6947195a6ed2.js +0 -1
- package/dist/standalone/.next/static/chunks/app/_global-error/page-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/access/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/account-migrations/[intentId]/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/account-project-bindings/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/[id]/status/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/active/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/limits/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/login/[operationId]/input/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/login/[operationId]/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/policy/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/terminal/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/active/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/limits/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/policy/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/reset-credits/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/terminal/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/agent/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/agent/snapshot/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/answer/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/artifact/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/attach-command/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/attention/[id]/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/attention/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/board/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/bridge/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/conversation-host/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/conversation-host/targets/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/conversations/[conversationId]/migration/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/conversations/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/files/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/flows/[id]/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/flows/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/image/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/inbox/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/lifecycle/reaper/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/limits/history/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/limits/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/log/preflight/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/log/project-delete/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/log/provenance/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/log/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/log/suggestions/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/logs/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/logs/stream/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/monitor/runs/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/monitor/seat-tick/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/monitor/seat-tick/settings/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/orchestrator/rotate/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/orchestrator/seat/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/orchestrator/seat/status/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/pipelines/[id]/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/pipelines/preflight/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/pipelines/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/pipelines/tick/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/proc/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/projects/create/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/projects/crown/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/projects/directories/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/push/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/resources/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/roles/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/answer/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/deployments/[deploymentId]/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/deployments/capabilities/v1/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/deployments/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/hosts/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/inject/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/interrupt/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/operations/[operationId]/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/operations/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/queue/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/realtime/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/send/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/snapshot/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/spawn/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/steer/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/stream/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/search/transcripts/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/session/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/session/supersedence/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/session/title/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/spawn/policy/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/spawn/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/spawn/validate/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/staging/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/task-attachments/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/assignment/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/send/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/spawn/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tasks/curator/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tasks/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/telegram/reports/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/telegram/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/timeline/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tmux/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tmux/targets/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/transcribe/backend/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/transcribe/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/transcribe/token/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tts/backend/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tts/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/view/presence/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/workflows/[id]/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/workflows/route-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/app/page-16384e540b4c0a90.js +0 -125
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-60a25d1c4cbf0128.js +0 -1
- package/dist/standalone/.next/static/css/496211a19557b7ee.css +0 -1
- package/dist/standalone/.next/static/e4qE_aCE0s0KQnnU6IWRw/_buildManifest.js +0 -1
- /package/dist/standalone/.next/static/{e4qE_aCE0s0KQnnU6IWRw → fQ2a5S10vvpyAqE0L_wUj}/_ssgManifest.js +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";exports.id=7008,exports.ids=[3302,7008],exports.modules={2798:(a,b,c)=>{c.d(b,{Ge:()=>
|
|
1
|
+
"use strict";exports.id=7008,exports.ids=[3302,7008],exports.modules={2798:(a,b,c)=>{c.d(b,{BE:()=>u,Ge:()=>g,L8:()=>f,OT:()=>t,ij:()=>n,rk:()=>r});var d=c(18797),e=c(37664);let f=20;function g(a){return"number"==typeof a&&a<f}let h=`## Initial visible status
|
|
2
2
|
Your first turn after receiving this mandate must produce a visible assistant status in this conversation. For a FRESH seat with no missions, greet in exactly two lines:
|
|
3
3
|
Ready in {project}.
|
|
4
4
|
Tell me what to ship — I open lanes, spawn implementers and reviewers, and merge on APPROVE. Nothing starts until you ask.
|
|
5
|
-
Use the actual project name in place of {project}. For a ROTATION, when work remains, inventory the mandate missions and state your plan in that status. When every rotation mission is already complete, reply exactly: "all mandate missions are complete; standing by". A generic continuation nudge never replaces or suppresses this first visible status.`,
|
|
5
|
+
Use the actual project name in place of {project}. For a ROTATION, when work remains, inventory the mandate missions and state your plan in that status. When every rotation mission is already complete, reply exactly: "all mandate missions are complete; standing by". A generic continuation nudge never replaces or suppresses this first visible status.`,i="## The Viewer's clock — you never schedule yourself",j=`${i}
|
|
6
6
|
The Viewer wakes you. A controller in the release that owns traffic checks this project's seat every few minutes and sends you a wake when something is actually owed: a stage parked, a decision waiting, a lane event landed, a board task nobody started, or the interval elapsing while work is open. It survives your session, your host dying, a Viewer restart and a rotation, because it is durable state rather than a schedule living inside a conversation.
|
|
7
7
|
So do not schedule yourself: no ScheduleWakeup, no CronCreate, no Monitor loop, for self-monitoring or for polling the board. A session schedule dies with the session and takes the monitor with it, which is how every rotation used to silently drop it, and two clocks on one seat means the outgoing one keeps acting after its authority is gone.
|
|
8
8
|
If you are holding a self-schedule right now, cancel it in this turn — the arrival of this mandate is the handover, not a later observation. Delete every recurring job you created (CronDelete on each id CronList returns) and arm no replacement. Do not wait to "see the Viewer's tick work first": while your own schedule keeps your turn open, the Viewer's tick finds you busy and drops its check every time, so the two deadlock and the wake you are waiting for can never arrive. Yours goes first.
|
|
9
|
-
Between wakes you are idle on purpose, and idle is correct: a seat with nothing owed costs nothing. When a wake arrives, act on the items it lists first, then make one bounded pass over the rest of the board — lanes, pull requests, agents, tasks — and act on what stands still, record every outcome where it belongs, and mark a task blocked with the reason when it cannot be done — that is the stop. This paragraph outranks every playbook, skill and checkpoint convention in the checkout: one that still tells you to self-pace with wakeups is out of date, and this governs.`,
|
|
9
|
+
Between wakes you are idle on purpose, and idle is correct: a seat with nothing owed costs nothing. When a wake arrives, act on the items it lists first, then make one bounded pass over the rest of the board — lanes, pull requests, agents, tasks — and act on what stands still, record every outcome where it belongs, and mark a task blocked with the reason when it cannot be done — that is the stop. This paragraph outranks every playbook, skill and checkpoint convention in the checkout: one that still tells you to self-pace with wakeups is out of date, and this governs.`,k="## The task is the unit of work — find it before you launch anything",l=`${k}
|
|
10
10
|
A board task is one PRODUCT OUTCOME. Everything done for that outcome — the diagnosis, the implementer, every reviewer, every retry, the fix round, the release — belongs to that one task. Open a second task only for genuinely separate work: an independent audit, or an investigation asked for on its own.
|
|
11
11
|
|
|
12
12
|
FIND IT BEFORE YOU LAUNCH ANYTHING. Call list_tasks for this project with NO status filter and limit: 200, so blocked and finished work can reach you beside inbox and assigned. That answer is one capped page in creation order (#1725), so a page at the cap was truncated and the NEWEST work is what it dropped: treat it as a lead, never as the whole board. Read the candidates with get_task, get_task any id the operator or a report hands you even when the page did not carry it, and run search_transcripts when their words name work you cannot place. Reuse what you find, and create a task only when nothing you can reach owns this outcome.
|
|
@@ -29,14 +29,14 @@ READ BACK WHAT YOU DID. After a create or a link, call get_pipeline and confirm
|
|
|
29
29
|
|
|
30
30
|
ONE OUTCOME NEVER SHOWS TWO LIVE CLAIMS. When you supersede work — a fresh pipeline after a failure, a fix lane after a review — retire the superseded container only once the outcome is carried by the surviving one and nothing in the old one is still running or unknown. Closing a container is unavailable as a way to hide work that is still owed: say out loud what you are dropping, and mark a task blocked with the reason when it cannot proceed. Never close containers in bulk to tidy the board.
|
|
31
31
|
|
|
32
|
-
RECEIPTS ARE THE RECORD. Every one of these calls is keyed by clientRequestId. A retry of the SAME logical operation reuses its id and replays the original receipt; a new operation gets a new id. When an outcome is unknown, replay the original id and read what the receipt says. Re-issuing it under a fresh id is how one outcome ends up with two pipelines and two cards.`,
|
|
32
|
+
RECEIPTS ARE THE RECORD. Every one of these calls is keyed by clientRequestId. A retry of the SAME logical operation reuses its id and replays the original receipt; a new operation gets a new id. When an outcome is unknown, replay the original id and read what the receipt says. Re-issuing it under a fresh id is how one outcome ends up with two pipelines and two cards.`,m=`## Deploys
|
|
33
33
|
YOU decide when to deploy, and you execute it yourself. Your authority is your designated seat, attributed server-side — a session that is not the designated orchestrator is refused, and a seat acts only for its own project. Nobody — you included — ever asks the user to confirm, approve, repeat, or say a commit hash. There is no confirmation step for the user, anywhere; deploys reach the user through your reports.
|
|
34
34
|
1. Prepare: merges landed on origin/main, gates green. Never deploy red.
|
|
35
35
|
2. Resolve origin/main to a full 40-hex commit SHA yourself and verify it contains what you shipped. The SHA is machine evidence — never route it through the user.
|
|
36
36
|
3. Call deploy_exact_sha with revision=<sha>. Deployments serialize (a busy receipt means one is already running); a retry reuses the same clientRequestId and replays the original receipt.
|
|
37
|
-
4. Report the outcome as a bridge report (completed/failed) — a statement of fact, never a question. The deployment ledger is the durable audit of what shipped and when.`,
|
|
37
|
+
4. Report the outcome as a bridge report (completed/failed) — a statement of fact, never a question. The deployment ledger is the durable audit of what shipped and when.`,n=`You are the viewer's built-in Manager (issues #182, #691) — the agent that owns the board and runs the whole conveyor through the viewer's own HTTP API and MCP tools. You never act outside them.
|
|
38
38
|
|
|
39
|
-
${
|
|
39
|
+
${h}
|
|
40
40
|
|
|
41
41
|
## Two channels to the operator
|
|
42
42
|
The operator talks to whoever they want, you included. When they write in your own conversation, answer them there — directly, plainly, helpfully, in your own voice, at whatever length the question deserves. That channel is sanctioned and first-class: what you write in it reaches them, and a question they put to you is yours to answer.
|
|
@@ -69,7 +69,7 @@ intent "show" frames and highlights the card; intent "open" also opens it. A rej
|
|
|
69
69
|
Call suggest_replies after EVERY message of yours that asks the operator something or proposes a course of action — a question, a choice between options, a plan you want a yes to, a status that ends in "shall I". Offer 2–4 short, distinct drafts, each one a message they could send as-is: the plain yes, the narrowed yes, the "hold — explain X first". Write them in the operator's own language, the one they are writing to you in.
|
|
70
70
|
They render as pills under your message and land in their composer on a tap, editable before sending — the viewer never sends one, so a draft is an offer and never a decision, and never a substitute for asking clearly in the message itself. The newest set replaces your previous one for that conversation, and their next message clears it: offer a fresh set with each new ask, and never re-offer drafts to something they already answered. A message that asks nothing needs no drafts.
|
|
71
71
|
|
|
72
|
-
${
|
|
72
|
+
${j}
|
|
73
73
|
|
|
74
74
|
## Search prior conversations before deciding
|
|
75
75
|
Much of what you will meet has been met before, and the Viewer indexes every user and assistant message of every conversation on this machine, across both engines and all accounts. At the start of any non-trivial task, and whenever a problem, failure or unknown appears, run several search_transcripts queries — 3 to 5, in different phrasings: the error text, the subsystem, the symptom, the file or tool involved — scoped to the project first, then unscoped. A snippet is only a pointer: open the hit through conversation_messages at its transcript path (its timestamp as since; the transcript path and byte offset pin the exact line) and read the turns around it before choosing an approach. Cite what you found, by conversation title and date, in the plan or spec you hand on, or state that nothing relevant existed. Check an old answer against current main before you build on it; the code has usually moved since.
|
|
@@ -80,12 +80,12 @@ Decide yourself whatever the code, the running system or one cheap observation c
|
|
|
80
80
|
- When a stage parks on such a question, bring it to the operator in chat at once, with suggested replies.
|
|
81
81
|
- After a deploy, check the operator-visible result on prod before you mark the task done.
|
|
82
82
|
|
|
83
|
-
${
|
|
83
|
+
${l}
|
|
84
84
|
|
|
85
85
|
## Conveyor rules
|
|
86
86
|
Drive every accepted piece of work through: GitHub issue -> worktree lane -> implementer agent -> review flow -> merge bar -> this project's own release step, where it has one -> cleanup.
|
|
87
87
|
- One lane (worktree + branch) per issue; one owner per file across active worktrees.
|
|
88
|
-
- Spawn implementers via POST /api/spawn with title = a semantic task name, taskId = the outcome's board task, src = YOUR transcript path (lineage draws the diagram edges), and role per the role table; workers end with "REVIEW_READY: <PR url>".
|
|
88
|
+
- Spawn implementers via POST /api/spawn with title = a semantic task name, taskId = the outcome's board task, src = YOUR transcript path (lineage draws the diagram edges), and role per the role table at the end of this mandate; workers end with "REVIEW_READY: <PR url>".
|
|
89
89
|
- Reviews run as flows (POST /api/flows) or fresh reviewer spawns (role: "reviewer", reviews: <implementer ref>, taskId) — a fresh reviewer every round, verdict contract "VERDICT: APPROVE|REQUEST_CHANGES".
|
|
90
90
|
- Merge bar: merge only on an APPROVE verdict with green gates (tsc + tests), after reading the PR body. Never merge red; a PR that calls a premise unverified, assumed or synthetic goes to the operator.
|
|
91
91
|
- Keep the outcome's ONE task card updated via /api/tasks; pipelines and spawns for it carry its id at launch. Report state changes as bridge reports.
|
|
@@ -100,25 +100,27 @@ When the operator asks for work, assess complexity, compose stages/roles, POST /
|
|
|
100
100
|
- Operate exclusively through the viewer API and MCP tools (spawn, flows, pipelines, tasks, files, agent/snapshot, conversation-host). No direct process or runtime manipulation.
|
|
101
101
|
- If this checkout carries an llv-conveyor skill, it is your playbook, subordinate to this mandate wherever the two disagree; otherwise the conveyor rules above are the playbook.
|
|
102
102
|
- Replacing manual spawns is a non-goal: the user's own agents keep working; you coordinate, you do not take over.
|
|
103
|
-
- Re-derive board state per turn from bounded snapshots rather than accumulating it in context.`,
|
|
103
|
+
- Re-derive board state per turn from bounded snapshots rather than accumulating it in context.`,o="## Role table — what a stage runs when you name no runtime";function p(a){return`${a.engine}/${a.model}/${a.effort}`}function q(a){let b=a.capabilities.includes("read-only")?"read-only":"read-write",c="builder"===a.id?` domain=frontend runs ${p(e.C)}; mode=apply-fixes runs ${p(e.i)}.`:"";return`| ${a.id} | ${a.config.engine} | ${a.config.model} | ${a.config.effort} | ${b} | ${a.description}${c} |`}function r(a){return[o,"Read from this install's role registry when this mandate was delivered. A stage or spawn that omits engine, model and effort runs exactly its role's row.","| role | engine | model | effort | access | for |","| --- | --- | --- | --- | --- | --- |",...a.map(q),"- Runtime overrides (engine, model, effort, access) go on the stage beside role, never inside it. A review-loop stage is always read-only.","- Choose effort deliberately: low or medium for routine, read-only or mechanical work; keep high and xhigh for work that needs them.","- Set the runtime at creation. override-stage binds from the NEXT attempt (pending-next-attempt): an attempt already running keeps the runtime it started with.","- create_pipeline's answer lists each stage's resolved engine, model and effort. Read it back and correct a wrong runtime before attempt 1 spends quota: create a draft, or pause, override-stage, then start."].join("\n")}let s=[{marker:k,directive:l},{marker:i,directive:j},{marker:h,directive:h}];function t(a,b=d.W){return u(a,r(b))}function u(a,b){let c=a.split(`
|
|
104
|
+
|
|
105
|
+
${m}`).join("").split(m).join(""),d=s.reduce((a,{marker:b,directive:c})=>a.includes(b)?a:`${a}
|
|
104
106
|
|
|
105
|
-
${
|
|
107
|
+
${c}`,function a(b){let c=b.indexOf(o);if(c<0)return b;let d=b.indexOf("\n\n",c),e=b.slice(0,c).replace(/\n\n$/,""),f=d<0?"":b.slice(d);return a(e?e+f:f.replace(/^\n\n/,""))}(c));return null===b?d:`${d}
|
|
106
108
|
|
|
107
|
-
${
|
|
108
|
-
${b}`]:[],[
|
|
109
|
-
${d}`]:[]].join("\n\n")].join("\n\n")}function
|
|
109
|
+
${b}`}},33302:(a,b,c)=>{c.d(b,{NZ:()=>r,OE:()=>m,Tj:()=>u,Yd:()=>t,kg:()=>s,mn:()=>n});var d=c(77598),e=c.n(d),f=c(10781),g=c(89937),h=c(4012);let i=/^[A-Za-z0-9_-]{43}$/,j="x-llv-internal-service",k=/^[a-f0-9]{64}$/,l=["monitor","mcp","orchestrator"];function m(a){let b,c=a.headers.get(h.VIEWER_SPAWN_CAPABILITY_HEADER)?.trim()??"";return c&&i.test(c)?(b=e().createHash("sha256").update(c).digest("hex"),(0,f.agentRegistry)().conversationIdForSpawnCapabilityDigest(b)):null}function n(a){return null===m(a)}let o={ok:!1,status:403,error:"this is an operator-only action; an agent may not perform it, whatever role it holds"},p={ok:!1,status:403,error:"background Viewer activity is outside direct operator activity"};function q(a){return e().createHmac("sha256",(0,g.ensureOperatorSpawnCapability)()).update(`llv-internal-service-v1\0${a}`).digest("hex")}function r(a){return{[j]:`${a}.${q(a)}`}}function s(a){return"valid"===function(a){let b=a.headers.get(j)?.trim()??"";if(!b)return"absent";let c=b.indexOf("."),d=b.slice(0,c),f=b.slice(c+1);if(!l.includes(d)||!k.test(f))return"invalid";try{let a=q(d);return e().timingSafeEqual(Buffer.from(f),Buffer.from(a))?"valid":"invalid"}catch{return"invalid"}}(a)?p:u(a)}function t(a){let b=m(a);return b?{kind:"agent",conversationId:b}:{kind:"operator",conversationId:null}}function u(a){return m(a)?o:{ok:!0}}},47008:(a,b,c)=>{c.d(b,{CX:()=>ak,eV:()=>an,reconcileActiveOrchestratorSeat:()=>ah});var d=c(73024),e=c.n(d),f=c(22962),g=c(74382),h=c(10781),i=c(89937),j=c(4837),k=c(33302),l=c(4012),m=c(10167),n=c(50201),o=c(11149),p=c(70107),q=c(89333),r=c(74127),s=c(38840),t=c(89822),u=c(41022),v=c(30795),w=c(23784),x=c(76760),y=c.n(x),z=c(91724),A=c(56809),B=c(2798);let C="## Handoff from your predecessor (rotation)",D="## Rotation history",E=" …[truncated]";function F(a){return Buffer.byteLength(a,"utf8")}function G(a,b){if(F(a)<=b)return{value:a,truncated:!1,codePoints:[...a].length};let c=F(E),d=0,e=0,f="";for(let g of a){let a=F(g);if(d+a+c>b)break;f+=g,d+=a,e+=1}return f?{value:`${f}${E}`,truncated:!0,codePoints:e}:{value:"",truncated:!0,codePoints:0}}function H(a){return a.replace(/\r\n?/g,"\n")}function I(a){return H(a).replace(/^#{1,6}[ \t]+/gm,"- ")}function J(a,b,c,d){return[a,...b?[`${D}
|
|
110
|
+
${b}`]:[],[C,...c.header,...c.tasks?[c.tasks]:[],...d?[`Notes from the caller:
|
|
111
|
+
${d}`]:[]].join("\n\n")].join("\n\n")}function K(a,b){if("existing"===a)return 0;let c=(0,s.s8)({role:"orchestrator",roleParams:b??{mode:"standard"}});return c.ok&&c.value?F(c.value.scaffold)+2:0}function L(a){return{error:`mandate is too large to deliver: ${a.bytes} bytes of mandate plus ${a.overhead} bytes of launch overhead exceeds the ${a.bound}-byte structured envelope by ${a.excess} bytes; shorten the mandate by at least ${a.excess} bytes`,code:"mandate_too_large",bytes:a.bytes,overhead:a.overhead,bound:a.bound,excess:a.excess}}let M={resolveAccount:async a=>{let{accountManager:b}=await Promise.resolve().then(c.bind(c,26926));return b.resolveHeadlessSpawn("codex",null,[],a)},run:async a=>{let{runHeadlessCodexOnce:b}=await Promise.resolve().then(c.bind(c,51906));return await b(a)},readPredecessorReport:(a,b)=>(function(a,b){let c,d=null;try{d=e().openSync(a,e().constants.O_RDONLY|e().constants.O_NOFOLLOW);let b=e().fstatSync(d);if(!b.isFile())return null;let f=e().lstatSync(a);if(!f.isFile()||f.dev!==b.dev||f.ino!==b.ino)return null;let g=Math.max(0,b.size-262144),h=Buffer.alloc(b.size-g);e().readSync(d,h,0,h.length,g),c=h.toString("utf8"),g>0&&(c=c.slice(c.indexOf("\n")+1))}catch{return null}finally{null!==d&&e().closeSync(d)}let f=c.split("\n");for(let a=f.length-1;a>=0;a-=1){let c;try{let b=JSON.parse(f[a]);if(!b||"object"!=typeof b||Array.isArray(b))continue;c=b}catch{continue}let d="claude"===b?function(a){if("assistant"!==a.type)return null;let b=a.message;if(!b||"object"!=typeof b||Array.isArray(b))return null;let c=b.content;return"string"==typeof c?c:Array.isArray(c)?c.flatMap(a=>a&&"object"==typeof a&&!Array.isArray(a)&&"text"===a.type&&"string"==typeof a.text?[a.text]:[]).join("\n"):null}(c):function(a){let b=a.payload;return!b||"object"!=typeof b||Array.isArray(b)?null:"agent_message"===b.type&&"string"==typeof b.message?b.message:null}(c);if(d?.trim())return G(d.trim(),6e3).value||null}return null})(a,b)},N=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,O=/\b((?:github|gitlab)\.com\/|bitbucket\.org\/)[A-Za-z0-9][A-Za-z0-9-]{0,38}/gi,P=/(^|[^A-Za-z0-9_@/])@[A-Za-z0-9][A-Za-z0-9._-]{1,38}/g,Q=/~\/[^\s"'`)\],;]*/g,R=/(?<![A-Za-z0-9_~:/])\/(?:home|Users|root|tmp|var|etc|opt|srv|mnt|media|app|workspace|private|data|usr|proc|dev)\/[^\s"'`)\],;]*/g,S=/(?<![A-Za-z0-9_~:/])\/[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+\/[^\s"'`)\],;]*/g,T=/\b(?:conversation|session|launch|thread|run|acct|account|agent)_(?=[A-Za-z0-9-]*\d)[A-Za-z0-9-]{6,}\b/gi,U=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;function V(a){return(0,A.j)(a).replace(N,"[redacted-email]").replace(O,"$1[redacted-handle]").replace(P,"$1[redacted-handle]").replace(Q,"[redacted-path]").replace(R,"[redacted-path]").replace(S,"[redacted-path]").replace(T,"[redacted-id]").replace(U,"[redacted-id]")}let W=`You are compacting the rotation history of a project manager agent's mandate. Write a digest of the material below for the manager's successor. Use exactly these three headings and short bullet points under each:
|
|
110
112
|
|
|
111
113
|
Decisions:
|
|
112
114
|
Blockers:
|
|
113
115
|
In flight:
|
|
114
116
|
|
|
115
|
-
Rules: at most 3500 bytes in total. Keep only what the successor needs to act: decisions already made, blockers still open, and work in flight with its current state. Never include names, account handles, email addresses, tokens, or file paths. Do not use Markdown headings starting with "#". Do not run commands or read files; everything you need is below. Output the digest only — no preamble, no closing remarks.`;async function
|
|
117
|
+
Rules: at most 3500 bytes in total. Keep only what the successor needs to act: decisions already made, blockers still open, and work in flight with its current state. Never include names, account handles, email addresses, tokens, or file paths. Do not use Markdown headings starting with "#". Do not run commands or read files; everything you need is below. Output the digest only — no preamble, no closing remarks.`;async function X(a,b=M){let c=await b.resolveAccount(a.project);if("exhausted"===c.kind)return{kind:"fallback",reason:"exhausted"};if("available"!==c.kind)return{kind:"fallback",reason:"unavailable"};let d=a.predecessor?b.readPredecessorReport(a.predecessor.path,a.predecessor.engine):null,f=(0,z.BQ)("orchestrator","handoff-digests",a.clientRequestId);try{let e=await b.run({key:`orchestrator-handoff:${a.clientRequestId}`,cwd:y().join(f,"cwd"),prompt:function(a,b){let c=a.priorHistory?V(a.priorHistory).trim():null,d=b?V(b).trim():null,e=a.priorHandoffs.map(a=>V(a).trim()).filter(Boolean),f=F(c??"")+F(d??"")+e.reduce((a,b)=>a+F(b),0),g=0;for(;g<e.length&&f>48e3;)f-=F(e[g]),g+=1;let h=e.slice(g);return[W,`=== Previous rotation history ===
|
|
116
118
|
${c??"(none)"}`,`=== Earlier handoffs, oldest first ===
|
|
117
119
|
${h.length?h.map((a,b)=>`--- handoff ${b+1} ---
|
|
118
120
|
${a}`).join("\n\n"):"(none)"}`,`=== Predecessor's last report ===
|
|
119
|
-
${d??"(unavailable)"}`].join("\n\n")}(a,d),model:j.Ze,effort:"low",account:"codex"===c.account.engine?{home:c.account.home,managed:"managed"===c.account.kind}:null,artifactDir:f,timeoutMs:75e3,sandbox:"read-only"});if("timeout"===e.status)return{kind:"fallback",reason:"timeout"};if("done"!==e.status)return{kind:"fallback",reason:"failed"};let g=T(e.finalOutput).trim();if(!g)return{kind:"fallback",reason:"empty"};if(D(g)>4096)return{kind:"fallback",reason:"over_budget"};let h=G(g).trim();return h?{kind:"digest",text:h}:{kind:"fallback",reason:"empty"}}finally{e().rmSync(f,{recursive:!0,force:!0})}}var W=c(15408);let X={spawn:async function(a){let{executeSpawnRequest:b}=await Promise.all([c.e(1849),c.e(7238),c.e(7722)]).then(c.bind(c,67722)),d={headers:new Headers({host:"127.0.0.1",...(0,k.NZ)("orchestrator"),[l.VIEWER_SPAWN_CAPABILITY_HEADER]:(0,i.ensureOperatorSpawnCapability)()}),json:async()=>a},e=await b(d);return{status:e.status,body:await e.json()}},deliver:async function(a){if((0,n.cM)()){let{enqueueStructuredMessage:b}=await Promise.resolve().then(c.bind(c,34083)),d=await b({path:a.path??"",conversationId:a.conversationId,clientMessageId:a.clientMessageId,text:a.text,images:[]});if(d)return d.ok?{ok:!0,outcome:"outcome"in d&&"string"==typeof d.outcome?d.outcome:"delivered"}:{ok:!1,error:d.error}}let b=await (0,m.Ku)({pid:null,path:a.path??"",conversationId:a.conversationId,clientMessageId:a.clientMessageId,text:a.text,images:[]});return b.ok?{ok:!0,outcome:b.outcome??"delivered"}:{ok:!1,error:b.error}},conversationTarget:a=>{let b=(0,h.agentRegistry)().conversation(a);if(!b)return null;if(b.supersededBy)return{kind:"ineligible",code:"conversation_ineligible",error:"conversation is superseded"};let c=b.generations.at(-1),d=c?.path?.trim();if(!d||!e().existsSync(d))return{kind:"ineligible",code:"missing_transcript",error:"conversation transcript is unavailable"};let f=c?.launchProfile?.cwd?.trim();if(!f||!e().existsSync(f)||!e().statSync(f).isDirectory())return{kind:"ineligible",code:"invalid_cwd",error:"conversation cwd is unavailable"};let g=b.projectOwnership?.project??(0,o.hY)(f);return g?{kind:"eligible",conversationId:b.id,path:d,cwd:f,project:(0,W.ut)(g),engine:b.engine,model:c?.launchProfile.model?.trim()||(0,j.Gh)(b.engine)}:{kind:"ineligible",code:"missing_project",error:"conversation project is unavailable"}},projectTasks:a=>(0,u.h6)().filter(b=>b.project===a&&"done"!==b.status).map(a=>({id:a.id,status:a.status,text:a.text})),summarizeHandoffs:a=>V(a),launchSettlement:({launchId:a,clientRequestId:b})=>{let c=(0,h.agentRegistry)(),d=c.spawnReceiptForClientAttempt(b);return!d||a&&d.launchId!==a?{kind:"unknown"}:d.rejection||"failed"===d.state||"conflicted"===d.state?{kind:"failed",error:d.error??d.rejection?.guidance??`spawn receipt is terminally ${d.state}`}:{kind:"settled",conversationId:d.conversationId,path:(0,h.Vt)(c.readOnlySnapshot()).allowsReceipt(d)?d.artifactPath:null,launchId:d.launchId,engine:d.engine,model:d.launchProfile.model}},resolvedConversation:a=>{if(!a)return null;let b=(0,h.agentRegistry)().conversation(a);if(!b)return null;let c=b.generations.at(-1)?.path?.trim();if(!c||!(0,p.EG)(c))return null;let d=b.generations.at(-1)?.launchProfile?.cwd?.trim();return{conversationId:b.id,path:c,holdsTurns:(0,q.x_)(c,b.engine),cwd:d&&function(a){try{return e().statSync(a).isDirectory()}catch{return!1}}(d)?d:null}},runtimeIdentity:a=>{let b=(0,h.agentRegistry)().conversation(a),c=b?b.generations.at(-1)?.launchProfile.model?.trim()||(0,j.Gh)(b.engine):null;return{engine:b?.engine??null,model:c}},stampRegistryIdentity:a=>{(0,h.agentRegistry)().stampOrchestratorSeatIdentity(a)},now:()=>new Date().toISOString()},Y=/^[A-Za-z0-9_-]{8,128}$/;function Z(a,b,c){return{status:409,body:{error:`the orchestrator seat for ${a} changed while this rotation composed its handoff (designation epoch ${b} is no longer current); rotate again to hand off from the seated orchestrator`,code:"incumbent_changed",currentSeatEpoch:c?.seatEpoch??null,currentConversationId:c?.conversationId??null}}}function $(a){return"string"==typeof a?a.trim():""}function _(a){let b=null===a.path&&null!==a.intent.launchId;return{status:200,body:{ok:!0,replayed:!0,state:a.path?"settled":b?"accepted":"starting",accepted:b,conversationId:a.conversationId,path:a.path,launchId:a.intent.launchId,seat:a}}}function aa(a){return{status:409,body:{error:"an orchestrator seat transition is already in progress for this project",code:"seat_intent_in_progress",seat:a}}}async function ab(a,b){let c=null,d=(0,f.oV)(()=>{let d=(0,W.ho)({project:a.project,clientRequestId:a.clientRequestId,conversationId:a.conversationId,path:a.path,launchId:a.launchId,engine:a.engine,model:a.model,now:b.now()});return"missing"!==d.kind&&(c=ac(d.seat,b)),d});return"missing"===d.kind?null:{seat:c??d.seat}}function ac(a,b){if(!a.conversationId)throw Error("active orchestrator seat is missing its conversation identity");let c=a.engine&&a.model?{engine:null,model:null}:b.runtimeIdentity(a.conversationId),d=(0,W.T7)({project:a.project,conversationId:a.conversationId,engine:c.engine,model:c.model})??a;return b.stampRegistryIdentity(d),d}function ad(a,b,c){return(0,f.oV)(()=>{let d=(0,W.HS)(a).active;return d&&d.intent.clientRequestId===b?ac(d,c):null})}function ae(a,b){let c=(0,W.HS)(a).active;if(!c?.conversationId||"spawn"!==c.intent.mode||null!==c.path)return null;let d=b.resolvedConversation(c.conversationId);if(d)return(0,W.x2)({project:a,clientRequestId:c.intent.clientRequestId,conversationId:c.conversationId,path:d.path}),null;let e=b.launchSettlement({launchId:c.intent.launchId,clientRequestId:c.intent.clientRequestId});if("failed"!==e.kind)return null;let f=(0,W.Ye)({project:a,clientRequestId:c.intent.clientRequestId,error:`the accepted launch failed before its conversation became readable: ${e.error}`,now:b.now(),resolvable:a=>null!==b.resolvedConversation(a),restorableSeat:a=>(function(a,b){let c=b.resolvedConversation(a.conversationId);if(!c)return null;let d=b.runtimeIdentity(a.conversationId);return{project:a.stillborn.project,seatEpoch:a.stillborn.seatEpoch,conversationId:c.conversationId,path:c.path,engine:d.engine,model:d.model,runtimeIdentityFrozen:!1,mandate:z.ij,promptVersion:z.L8,predecessorConversationId:null,triggeredBy:null,state:"active",intent:{clientRequestId:`restored-${a.stillborn.intent.clientRequestId}`.slice(0,128),mode:"existing",launchId:null,error:null},designatedAt:a.stillborn.designatedAt,activatedAt:null}})(a,b)});return f&&console.warn(`orchestrator seat for ${a} was rolled back: its accepted launch failed before the conversation became readable (${e.error})`),f}function af(a,b=X){return ae((0,W.ut)(a),b)}function ag(a,b){let c=(0,W.HS)(a).pending;if(!c||"spawn"!==c.intent.mode||null!==c.intent.error)return null;let d=b.launchSettlement({launchId:c.intent.launchId,clientRequestId:c.intent.clientRequestId});return"settled"===d.kind?ab({project:a,clientRequestId:c.intent.clientRequestId,conversationId:d.conversationId,path:d.path,launchId:d.launchId??c.intent.launchId,...d.engine?{engine:d.engine}:{},...d.model?{model:d.model}:{}},b):("failed"===d.kind&&(0,W.Cp)(a,c.intent.clientRequestId,d.error,b.now()),null)}async function ah(a,b,c){try{return await c()}catch(j){let c=j instanceof f.gB,d=j instanceof Error?j.message:String(j),e="string"==typeof a.project?(0,g.QK)(a.project):null,h=$(a.clientRequestId),i=null;if(e&&Y.test(h)){let a=(0,W.ut)(e);try{i=(0,W.Cp)(a,h,d)}catch{}}return console.error(`orchestrator seat transition failed for ${String(a.project)}: ${d}`),{status:c?503:500,body:{error:d,code:c?"seat_store_busy":b,retryable:c,seat:i?.seat??null}}}}function ai(a,b=X,c=null){return ah(a,"seat_transition_failed",()=>aj(a,b,c))}async function aj(a,b,c){let d,f,i,j="string"==typeof a.project?(0,g.QK)(a.project):null;if(!j)return{status:400,body:{error:"project must be a valid project key"}};let k=(0,W.ut)(j),l="string"==typeof a.mandate?a.mandate:"";if(!l.trim())return{status:400,body:{error:"mandate is required"}};let m=$(a.clientRequestId);if(!Y.test(m))return{status:400,body:{error:"clientRequestId must be 8-128 URL-safe characters"}};let n=$(a.conversationId);if(n&&!n.startsWith("conversation_"))return{status:400,body:{error:"conversationId is invalid"}};let o="number"==typeof a.promptVersion&&Number.isInteger(a.promptVersion)?a.promptVersion:null,p=(d=I(n?"existing":"spawn",a.roleParams),(i=(f=D((0,z.OT)(l)))+d-s.N0)>0?{ok:!1,bytes:f,overhead:d,bound:s.N0,excess:i}:{ok:!0,bytes:f,overhead:d});if(!p.ok)return{status:413,body:J(p)};ae(k,b);let q=ag(k,b);q&&await q;let u=ad(k,m,b);if(u)return _(u);let v="number"==typeof a.expectedIncumbentSeatEpoch?a.expectedIncumbentSeatEpoch:null;if(null!==v){let a=(0,W.HS)(k).active;if(!a||a.seatEpoch!==v)return Z(k,v,a)}if(n){let a=b.conversationTarget(n);if(!a)return{status:404,body:{error:"conversation is unknown to the registry"}};if("ineligible"===a.kind)return{status:409,body:{error:a.error,code:a.code}};if(a.project!==k)return{status:409,body:{error:"conversation belongs to a different project",code:"project_mismatch"}};let d=(0,W.$p)({project:k,mandate:l,clientRequestId:m,mode:"existing",conversationId:a.conversationId,engine:a.engine??null,model:a.model??null,promptVersion:o,triggeredBy:c,now:b.now()});if("completed"===d.kind){let a=ad(k,m,b);return a?_(a):{status:409,body:{error:"seat intent was superseded by a newer designation"}}}if("in_progress"===d.kind)return aa(d.seat);let e="replay"===d.kind?b.conversationTarget(d.seat.conversationId??""):a;if(!e||"ineligible"===e.kind||e.project!==k){let a="the pending adoption target is no longer eligible",c=(0,W.Cp)(k,m,a,b.now());return{status:409,body:{error:a,code:"adoption_target_unavailable",seat:c?.seat??null}}}let f=await b.deliver({conversationId:e.conversationId,path:e.path,clientMessageId:`orchmandate_${m}`,text:(0,z.OT)("replay"===d.kind?d.seat.mandate:l)});if(!f.ok){let a=f.error??"mandate delivery failed",c=(0,W.Cp)(k,m,a,b.now());return{status:502,body:{error:a,code:"mandate_delivery_failed",seat:c?.seat??null}}}let g=await ab({project:k,clientRequestId:m,conversationId:e.conversationId,path:e.path},b);return g?{status:200,body:{ok:!0,state:"settled",conversationId:e.conversationId,path:e.path,delivery:f.outcome??"delivered",seat:g.seat}}:{status:409,body:{error:"seat intent was superseded by a newer designation"}}}let w=(0,W.HS)(k).active;if(w&&w.intent.clientRequestId!==m&&!0!==a.replaceIncumbent)return{status:409,body:{error:`an orchestrator is already designated for ${k}; use rotate_orchestrator for an explicit handoff, or pass replaceIncumbent: true to replace deliberately`,code:"already_designated",incumbentSeatEpoch:w.seatEpoch}};let x=(0,r.s8)({role:"orchestrator",roleParams:a.roleParams,engine:a.engine,model:a.model,effort:a.effort});if(!x.ok||!x.value)return{status:400,body:{error:x.ok?"orchestrator runtime is unavailable":x.error}};let y=(0,W.$p)({project:k,mandate:l,clientRequestId:m,mode:"spawn",engine:x.value.config.engine,model:x.value.config.model,promptVersion:o,triggeredBy:c,now:b.now()});if("completed"===y.kind){let a=ad(k,m,b);return a?_(a):{status:409,body:{error:"seat intent was superseded by a newer designation"}}}if("in_progress"===y.kind)return aa(y.seat);if("replay"===y.kind&&!0!==y.seat.runtimeIdentityFrozen){let a="legacy pending orchestrator runtime identity is unavailable; retry the designation with a new clientRequestId",c=(0,W.Cp)(k,m,a,b.now());return{status:409,body:{error:a,code:"legacy_runtime_identity_unavailable",seat:c?.seat??null}}}let A=(0,z.OT)("replay"===y.kind?y.seat.mandate:l),B="replay"===y.kind?{...y.seat.engine?{engine:y.seat.engine}:{},...y.seat.model?{model:y.seat.model}:{}}:{engine:x.value.config.engine,model:x.value.config.model},C=function(a,b){if("string"==typeof b&&b.trim())return b.trim();let c=process.env.LLV_ORCHESTRATOR_CWD?.trim();if(c)return c;let d=a=>{if(!a)return!1;try{return e().statSync(a).isDirectory()}catch{return!1}};for(let b of Object.values((0,h.agentRegistry)().readOnlySnapshot().conversations).filter(b=>b.projectOwnership?.project===a||b.generations.some(b=>b.launchProfile?.project===a)).sort((a,b)=>(b.updatedAt??"").localeCompare(a.updatedAt??"")))for(let a=b.generations.length-1;a>=0;a-=1){let c=b.generations[a]?.launchProfile?.cwd;if(d(c))return c}return null}(k,a.cwd);if(!C){let a=(0,W.Cp)(k,m,"orchestrator cwd could not be resolved",b.now());return{status:400,body:{error:"orchestrator cwd could not be resolved — pass cwd explicitly or set LLV_ORCHESTRATOR_CWD",code:"cwd_unresolved",seat:a?.seat??null}}}let E={...Object.fromEntries(["cwd","effort","fast","accountId","images","roleParams","allowSubagents"].flatMap(b=>void 0===a[b]?[]:[[b,a[b]]])),...B,role:"orchestrator",roleParams:a.roleParams??{mode:"standard"},project:k,cwd:C,prompt:A,title:(0,t.bF)("orchestrator",A,k),clientAttemptId:m},F=await b.spawn(E),G=$(F.body.conversationId),H=F.status>=200&&F.status<300&&!1!==F.body.ok,K=$(F.body.launchId),L=H&&202===F.status&&!!G&&!!K;if(!(H&&!1!==F.body.launched&&G)&&!L){let a=$(F.body.error)||(H?G?"spawn did not report an accepted launch":"spawn response omitted conversationId":`spawn was rejected with HTTP status ${F.status}`),c=(0,W.Cp)(k,m,a,b.now());return{status:F.status,body:{...F.body,seat:c?.seat??null}}}let M=await ab({project:k,clientRequestId:m,conversationId:G,path:"string"==typeof F.body.path?F.body.path:null,launchId:K||null,engine:x.value.config.engine,model:x.value.config.model},b);return M?{status:F.status,body:{...F.body,...L?{accepted:!0,state:"accepted"}:{},seat:M.seat}}:{status:409,body:{error:"seat intent was superseded by a newer designation"}}}function ak(a){return`conversation_messages({"clientRequestId":"rotation-predecessor-recent-turns-${a}","conversationId":"${a}","roles":["user","assistant"],"limit":40})`}function al(a,b,c=X){return function(a,b=X,c=null){return ah(a,"rotation_failed",()=>am(a,b,c))}(b,c,(0,k.Yd)(a))}async function am(a,b,c){var d,e;let f,h,i=c?(h=c.conversationId?(0,W.js)().find(a=>a.conversationId===c.conversationId):void 0,{kind:c.kind,conversationId:c.conversationId,seatEpoch:h?.seatEpoch??null}):null,j="string"==typeof a.project?(0,g.QK)(a.project):null;if(!j)return{status:400,body:{error:"project must be a valid project key"}};let k=(0,W.ut)(j),l=$(a.clientRequestId);if(!Y.test(l))return{status:400,body:{error:"clientRequestId must be 8-128 URL-safe characters"}};let m=ae(k,b),n=m?{rolledBack:{conversationId:m.terminalized.seat.conversationId,seatEpoch:m.terminalized.seat.seatEpoch,error:m.terminalized.seat.intent.error,terminalizedAt:m.terminalized.terminalizedAt,restoredConversationId:m.restored?.conversationId??null}}:{},o=ag(k,b);o&&await o;let p=(0,W.HS)(k).active;if(!p?.conversationId)return{status:409,body:{error:"no orchestrator is designated for this project — use create_orchestrator instead of rotating",code:"no_incumbent",...n}};let q=b.conversationTarget(p.conversationId),r=q?.kind==="eligible"?q:null,s=function(a,b,c){let d=a=>{if(!a)return null;let b=c.resolvedConversation(a);return b?.holdsTurns?{conversationId:b.conversationId,cwd:b.cwd}:null},e=d(b.conversationId);if(e)return e;let f=(0,W.Kp)().filter(b=>b.project===a),g=new Set([b.conversationId??""]),h=b.conversationId;for(let a=0;a<8&&h;a+=1){let a=[...f].reverse().find(a=>a.successorConversationId===h),b=a?.conversationId??null;if(!b||g.has(b))break;g.add(b),h=b;let c=d(b);if(c)return c}return null}(k,p,b),t=b.projectTasks(k).slice(0,12),u=$(a.handoffNotes).slice(0,2e3),v={header:[`You are replacing orchestrator conversation ${p.conversationId} for project ${k}. Its manager authority is revoked; its session and card remain on the board, linked to yours.`,...s?[s.conversationId===p.conversationId?`Your predecessor's recent turns — decisions, blockers, in-flight work — are one call away: ${ak(s.conversationId)}. Records are newest first; pass the returned cursor with a fresh clientRequestId for each older page. Read them before acting, and never open the transcript file. If the call reports that the conversation has no transcript, reconstruct state from the board.`:`The seat you are replacing holds no readable turns, so it is not what you read. The last predecessor in this lineage that does is ${s.conversationId}: ${ak(s.conversationId)}. Records are newest first; pass the returned cursor with a fresh clientRequestId for each older page. Read them before acting, and never open the transcript file.`]:["No conversation in this seat's lineage holds readable turns — the seat you are replacing has none, and neither does any predecessor on record. There is no handover transcript to read: reconstruct state from the board tasks below and from the notes in this mandate, and do not go looking for the predecessor's transcript file."]],tasks:t.length?`Open board tasks for this project:
|
|
120
|
-
${t.map(a=>`- [${a.status}] ${a.text.slice(0,140)} (${a.id})`).join("\n")}`:"No open board tasks are recorded for this project.",notes:u||null},w
|
|
121
|
+
${d??"(unavailable)"}`].join("\n\n")}(a,d),model:j.Ze,effort:"low",account:"codex"===c.account.engine?{home:c.account.home,managed:"managed"===c.account.kind}:null,artifactDir:f,timeoutMs:75e3,sandbox:"read-only"});if("timeout"===e.status)return{kind:"fallback",reason:"timeout"};if("done"!==e.status)return{kind:"fallback",reason:"failed"};let g=V(e.finalOutput).trim();if(!g)return{kind:"fallback",reason:"empty"};if(F(g)>4096)return{kind:"fallback",reason:"over_budget"};let h=I(g).trim();return h?{kind:"digest",text:h}:{kind:"fallback",reason:"empty"}}finally{e().rmSync(f,{recursive:!0,force:!0})}}var Y=c(15408);let Z={spawn:async function(a){let{executeSpawnRequest:b}=await Promise.all([c.e(1849),c.e(7238),c.e(7722)]).then(c.bind(c,67722)),d={headers:new Headers({host:"127.0.0.1",...(0,k.NZ)("orchestrator"),[l.VIEWER_SPAWN_CAPABILITY_HEADER]:(0,i.ensureOperatorSpawnCapability)()}),json:async()=>a},e=await b(d);return{status:e.status,body:await e.json()}},deliver:async function(a){if((0,n.cM)()){let{enqueueStructuredMessage:b}=await Promise.resolve().then(c.bind(c,34083)),d=await b({path:a.path??"",conversationId:a.conversationId,clientMessageId:a.clientMessageId,text:a.text,images:[]});if(d)return d.ok?{ok:!0,outcome:"outcome"in d&&"string"==typeof d.outcome?d.outcome:"delivered"}:{ok:!1,error:d.error}}let b=await (0,m.Ku)({pid:null,path:a.path??"",conversationId:a.conversationId,clientMessageId:a.clientMessageId,text:a.text,images:[]});return b.ok?{ok:!0,outcome:b.outcome??"delivered"}:{ok:!1,error:b.error}},conversationTarget:a=>{let b=(0,h.agentRegistry)().conversation(a);if(!b)return null;if(b.supersededBy)return{kind:"ineligible",code:"conversation_ineligible",error:"conversation is superseded"};let c=b.generations.at(-1),d=c?.path?.trim();if(!d||!e().existsSync(d))return{kind:"ineligible",code:"missing_transcript",error:"conversation transcript is unavailable"};let f=c?.launchProfile?.cwd?.trim();if(!f||!e().existsSync(f)||!e().statSync(f).isDirectory())return{kind:"ineligible",code:"invalid_cwd",error:"conversation cwd is unavailable"};let g=b.projectOwnership?.project??(0,p.hY)(f);return g?{kind:"eligible",conversationId:b.id,path:d,cwd:f,project:(0,Y.canonicalOrchestratorProject)(g),engine:b.engine,model:c?.launchProfile.model?.trim()||(0,j.Gh)(b.engine)}:{kind:"ineligible",code:"missing_project",error:"conversation project is unavailable"}},projectTasks:a=>(0,w.loadTasks)().filter(b=>b.project===a&&"done"!==b.status).map(a=>({id:a.id,status:a.status,text:a.text})),summarizeHandoffs:a=>X(a),launchSettlement:({launchId:a,clientRequestId:b})=>{let c=(0,h.agentRegistry)(),d=c.spawnReceiptForClientAttempt(b);return!d||a&&d.launchId!==a?{kind:"unknown"}:d.rejection||"failed"===d.state||"conflicted"===d.state?{kind:"failed",error:d.error??d.rejection?.guidance??`spawn receipt is terminally ${d.state}`}:{kind:"settled",conversationId:d.conversationId,path:(0,h.Vt)(c.readOnlySnapshot()).allowsReceipt(d)?d.artifactPath:null,launchId:d.launchId,engine:d.engine,model:d.launchProfile.model}},resolvedConversation:a=>{if(!a)return null;let b=(0,h.agentRegistry)().conversation(a);if(!b)return null;let c=b.generations.at(-1)?.path?.trim();if(!c||!(0,q.EG)(c))return null;let d=b.generations.at(-1)?.launchProfile?.cwd?.trim();return{conversationId:b.id,path:c,holdsTurns:(0,r.x_)(c,b.engine),cwd:d&&function(a){try{return e().statSync(a).isDirectory()}catch{return!1}}(d)?d:null}},runtimeIdentity:a=>{let b=(0,h.agentRegistry)().conversation(a),c=b?b.generations.at(-1)?.launchProfile.model?.trim()||(0,j.Gh)(b.engine):null;return{engine:b?.engine??null,model:c}},stampRegistryIdentity:a=>{(0,h.agentRegistry)().stampOrchestratorSeatIdentity(a)},now:()=>new Date().toISOString()},$=/^[A-Za-z0-9_-]{8,128}$/;function _(a,b,c){return{status:409,body:{error:`the orchestrator seat for ${a} changed while this rotation composed its handoff (designation epoch ${b} is no longer current); rotate again to hand off from the seated orchestrator`,code:"incumbent_changed",currentSeatEpoch:c?.seatEpoch??null,currentConversationId:c?.conversationId??null}}}function aa(a){return"string"==typeof a?a.trim():""}function ab(a){let b=null===a.path&&null!==a.intent.launchId;return{status:200,body:{ok:!0,replayed:!0,state:a.path?"settled":b?"accepted":"starting",accepted:b,conversationId:a.conversationId,path:a.path,launchId:a.intent.launchId,seat:a}}}function ac(a){return{status:409,body:{error:"an orchestrator seat transition is already in progress for this project",code:"seat_intent_in_progress",seat:a}}}async function ad(a,b){let c=null,d=(0,f.oV)(()=>{let d=(0,Y.completeOrchestratorSeatIntent)({project:a.project,clientRequestId:a.clientRequestId,conversationId:a.conversationId,path:a.path,launchId:a.launchId,engine:a.engine,model:a.model,now:b.now()});return"missing"!==d.kind&&(c=ae(d.seat,b)),d});return"missing"===d.kind?null:{seat:c??d.seat}}function ae(a,b){if(!a.conversationId)throw Error("active orchestrator seat is missing its conversation identity");let c=a.engine&&a.model?{engine:null,model:null}:b.runtimeIdentity(a.conversationId),d=(0,Y.repairOrchestratorSeatRuntimeIdentity)({project:a.project,conversationId:a.conversationId,engine:c.engine,model:c.model})??a;return b.stampRegistryIdentity(d),d}function af(a,b,c){return(0,f.oV)(()=>{let d=(0,Y.orchestratorSeatFor)(a).active;return d&&d.intent.clientRequestId===b?ae(d,c):null})}function ag(a,b){let c=(0,Y.orchestratorSeatFor)(a).active;if(!c?.conversationId||"spawn"!==c.intent.mode||null!==c.path)return null;let d=b.resolvedConversation(c.conversationId);if(d)return(0,Y.confirmOrchestratorSeatMaterialization)({project:a,clientRequestId:c.intent.clientRequestId,conversationId:c.conversationId,path:d.path}),null;let e=b.launchSettlement({launchId:c.intent.launchId,clientRequestId:c.intent.clientRequestId});if("failed"!==e.kind)return null;let f=(0,Y.abandonStillbornOrchestratorSeat)({project:a,clientRequestId:c.intent.clientRequestId,error:`the accepted launch failed before its conversation became readable: ${e.error}`,now:b.now(),resolvable:a=>null!==b.resolvedConversation(a),restorableSeat:a=>(function(a,b){let c=b.resolvedConversation(a.conversationId);if(!c)return null;let d=b.runtimeIdentity(a.conversationId);return{project:a.stillborn.project,seatEpoch:a.stillborn.seatEpoch,conversationId:c.conversationId,path:c.path,engine:d.engine,model:d.model,runtimeIdentityFrozen:!1,mandate:B.ij,promptVersion:B.L8,predecessorConversationId:null,triggeredBy:null,state:"active",intent:{clientRequestId:`restored-${a.stillborn.intent.clientRequestId}`.slice(0,128),mode:"existing",launchId:null,error:null},designatedAt:a.stillborn.designatedAt,activatedAt:null}})(a,b)});return f&&console.warn(`orchestrator seat for ${a} was rolled back: its accepted launch failed before the conversation became readable (${e.error})`),f}function ah(a,b=Z){return ag((0,Y.canonicalOrchestratorProject)(a),b)}function ai(a,b){let c=(0,Y.orchestratorSeatFor)(a).pending;if(!c||"spawn"!==c.intent.mode||null!==c.intent.error)return null;let d=b.launchSettlement({launchId:c.intent.launchId,clientRequestId:c.intent.clientRequestId});return"settled"===d.kind?ad({project:a,clientRequestId:c.intent.clientRequestId,conversationId:d.conversationId,path:d.path,launchId:d.launchId??c.intent.launchId,...d.engine?{engine:d.engine}:{},...d.model?{model:d.model}:{}},b):("failed"===d.kind&&(0,Y.failOrchestratorSeatIntent)(a,c.intent.clientRequestId,d.error,b.now()),null)}async function aj(a,b,c){try{return await c()}catch(j){let c=j instanceof f.gB,d=j instanceof Error?j.message:String(j),e="string"==typeof a.project?(0,g.QK)(a.project):null,h=aa(a.clientRequestId),i=null;if(e&&$.test(h)){let a=(0,Y.canonicalOrchestratorProject)(e);try{i=(0,Y.failOrchestratorSeatIntent)(a,h,d)}catch{}}return console.error(`orchestrator seat transition failed for ${String(a.project)}: ${d}`),{status:c?503:500,body:{error:d,code:c?"seat_store_busy":b,retryable:c,seat:i?.seat??null}}}}function ak(a,b=Z,c=null){return aj(a,"seat_transition_failed",()=>al(a,b,c))}async function al(a,b,c){let d,f,i,j="string"==typeof a.project?(0,g.QK)(a.project):null;if(!j)return{status:400,body:{error:"project must be a valid project key"}};(0,o.n)([(0,o.M)((0,Y.canonicalOrchestratorProject)(j),aa(a.cwd))]);let k=(0,Y.canonicalOrchestratorProject)(j),l="string"==typeof a.mandate?a.mandate:"";if(!l.trim())return{status:400,body:{error:"mandate is required"}};let m=aa(a.clientRequestId);if(!$.test(m))return{status:400,body:{error:"clientRequestId must be 8-128 URL-safe characters"}};let n=aa(a.conversationId);if(n&&!n.startsWith("conversation_"))return{status:400,body:{error:"conversationId is invalid"}};let p="number"==typeof a.promptVersion&&Number.isInteger(a.promptVersion)?a.promptVersion:null,q=(d=K(n?"existing":"spawn",a.roleParams),(i=(f=F((0,B.OT)(l,(0,t.e3)())))+d-u.N0)>0?{ok:!1,bytes:f,overhead:d,bound:u.N0,excess:i}:{ok:!0,bytes:f,overhead:d});if(!q.ok)return{status:413,body:L(q)};ag(k,b);let r=ai(k,b);r&&await r;let w=af(k,m,b);if(w)return ab(w);let x="number"==typeof a.expectedIncumbentSeatEpoch?a.expectedIncumbentSeatEpoch:null;if(null!==x){let a=(0,Y.orchestratorSeatFor)(k).active;if(!a||a.seatEpoch!==x)return _(k,x,a)}if(n){let a=b.conversationTarget(n);if(!a)return{status:404,body:{error:"conversation is unknown to the registry"}};if("ineligible"===a.kind)return{status:409,body:{error:a.error,code:a.code}};if(a.project!==k)return{status:409,body:{error:"conversation belongs to a different project",code:"project_mismatch"}};let d=(0,Y.beginOrchestratorSeatIntent)({project:k,mandate:l,roleTable:(0,B.rk)((0,t.e3)()),clientRequestId:m,mode:"existing",conversationId:a.conversationId,engine:a.engine??null,model:a.model??null,promptVersion:p,triggeredBy:c,now:b.now()});if("completed"===d.kind){let a=af(k,m,b);return a?ab(a):{status:409,body:{error:"seat intent was superseded by a newer designation"}}}if("in_progress"===d.kind)return ac(d.seat);let e="replay"===d.kind?b.conversationTarget(d.seat.conversationId??""):a;if(!e||"ineligible"===e.kind||e.project!==k){let a="the pending adoption target is no longer eligible",c=(0,Y.failOrchestratorSeatIntent)(k,m,a,b.now());return{status:409,body:{error:a,code:"adoption_target_unavailable",seat:c?.seat??null}}}let f=await b.deliver({conversationId:e.conversationId,path:e.path,clientMessageId:`orchmandate_${m}`,text:(0,B.BE)(d.seat.mandate,d.seat.roleTable??null)});if(!f.ok){let a=f.error??"mandate delivery failed",c=(0,Y.failOrchestratorSeatIntent)(k,m,a,b.now());return{status:502,body:{error:a,code:"mandate_delivery_failed",seat:c?.seat??null}}}let g=await ad({project:k,clientRequestId:m,conversationId:e.conversationId,path:e.path},b);return g?{status:200,body:{ok:!0,state:"settled",conversationId:e.conversationId,path:e.path,delivery:f.outcome??"delivered",seat:g.seat}}:{status:409,body:{error:"seat intent was superseded by a newer designation"}}}let y=(0,Y.orchestratorSeatFor)(k).active;if(y&&y.intent.clientRequestId!==m&&!0!==a.replaceIncumbent)return{status:409,body:{error:`an orchestrator is already designated for ${k}; use rotate_orchestrator for an explicit handoff, or pass replaceIncumbent: true to replace deliberately`,code:"already_designated",incumbentSeatEpoch:y.seatEpoch}};let z=(0,s.s8)({role:"orchestrator",roleParams:a.roleParams,engine:a.engine,model:a.model,effort:a.effort});if(!z.ok||!z.value)return{status:400,body:{error:z.ok?"orchestrator runtime is unavailable":z.error}};let A=(0,Y.beginOrchestratorSeatIntent)({project:k,mandate:l,roleTable:(0,B.rk)((0,t.e3)()),clientRequestId:m,mode:"spawn",engine:z.value.config.engine,model:z.value.config.model,promptVersion:p,triggeredBy:c,now:b.now()});if("completed"===A.kind){let a=af(k,m,b);return a?ab(a):{status:409,body:{error:"seat intent was superseded by a newer designation"}}}if("in_progress"===A.kind)return ac(A.seat);if("replay"===A.kind&&!0!==A.seat.runtimeIdentityFrozen){let a="legacy pending orchestrator runtime identity is unavailable; retry the designation with a new clientRequestId",c=(0,Y.failOrchestratorSeatIntent)(k,m,a,b.now());return{status:409,body:{error:a,code:"legacy_runtime_identity_unavailable",seat:c?.seat??null}}}let C=(0,B.BE)(A.seat.mandate,A.seat.roleTable??null),D="replay"===A.kind?{...A.seat.engine?{engine:A.seat.engine}:{},...A.seat.model?{model:A.seat.model}:{}}:{engine:z.value.config.engine,model:z.value.config.model},E=function(a,b){if("string"==typeof b&&b.trim())return b.trim();let c=process.env.LLV_ORCHESTRATOR_CWD?.trim();if(c)return c;let d=a=>{if(!a)return!1;try{return e().statSync(a).isDirectory()}catch{return!1}};for(let b of Object.values((0,h.agentRegistry)().readOnlySnapshot().conversations).filter(b=>b.projectOwnership?.project===a||b.generations.some(b=>b.launchProfile?.project===a)).sort((a,b)=>(b.updatedAt??"").localeCompare(a.updatedAt??"")))for(let a=b.generations.length-1;a>=0;a-=1){let c=b.generations[a]?.launchProfile?.cwd;if(d(c))return c}return null}(k,a.cwd);if(!E){let a=(0,Y.failOrchestratorSeatIntent)(k,m,"orchestrator cwd could not be resolved",b.now());return{status:400,body:{error:"orchestrator cwd could not be resolved — pass cwd explicitly or set LLV_ORCHESTRATOR_CWD",code:"cwd_unresolved",seat:a?.seat??null}}}let G={...Object.fromEntries(["cwd","effort","fast","accountId","images","roleParams","allowSubagents"].flatMap(b=>void 0===a[b]?[]:[[b,a[b]]])),...D,role:"orchestrator",roleParams:a.roleParams??{mode:"standard"},project:k,cwd:E,prompt:C,title:(0,v.bF)("orchestrator",C,k),clientAttemptId:m},H=await b.spawn(G),I=aa(H.body.conversationId),J=H.status>=200&&H.status<300&&!1!==H.body.ok,M=aa(H.body.launchId),N=J&&202===H.status&&!!I&&!!M;if(!(J&&!1!==H.body.launched&&I)&&!N){let a=aa(H.body.error)||(J?I?"spawn did not report an accepted launch":"spawn response omitted conversationId":`spawn was rejected with HTTP status ${H.status}`),c=(0,Y.failOrchestratorSeatIntent)(k,m,a,b.now());return{status:H.status,body:{...H.body,seat:c?.seat??null}}}let O=await ad({project:k,clientRequestId:m,conversationId:I,path:"string"==typeof H.body.path?H.body.path:null,launchId:M||null,engine:z.value.config.engine,model:z.value.config.model},b);return O?{status:H.status,body:{...H.body,...N?{accepted:!0,state:"accepted"}:{},seat:O.seat}}:{status:409,body:{error:"seat intent was superseded by a newer designation"}}}function am(a){return`conversation_messages({"clientRequestId":"rotation-predecessor-recent-turns-${a}","conversationId":"${a}","roles":["user","assistant"],"limit":40})`}function an(a,b,c=Z){return function(a,b=Z,c=null){return aj(a,"rotation_failed",()=>ao(a,b,c))}(b,c,(0,k.Yd)(a))}async function ao(a,b,c){var d,e;let f,h,i=c?(h=c.conversationId?(0,Y.activeOrchestratorSeats)().find(a=>a.conversationId===c.conversationId):void 0,{kind:c.kind,conversationId:c.conversationId,seatEpoch:h?.seatEpoch??null}):null,j="string"==typeof a.project?(0,g.QK)(a.project):null;if(!j)return{status:400,body:{error:"project must be a valid project key"}};let k=(0,Y.canonicalOrchestratorProject)(j),l=aa(a.clientRequestId);if(!$.test(l))return{status:400,body:{error:"clientRequestId must be 8-128 URL-safe characters"}};let m=ag(k,b),n=m?{rolledBack:{conversationId:m.terminalized.seat.conversationId,seatEpoch:m.terminalized.seat.seatEpoch,error:m.terminalized.seat.intent.error,terminalizedAt:m.terminalized.terminalizedAt,restoredConversationId:m.restored?.conversationId??null}}:{},o=ai(k,b);o&&await o;let p=(0,Y.orchestratorSeatFor)(k).active;if(!p?.conversationId)return{status:409,body:{error:"no orchestrator is designated for this project — use create_orchestrator instead of rotating",code:"no_incumbent",...n}};let q=b.conversationTarget(p.conversationId),r=q?.kind==="eligible"?q:null,s=function(a,b,c){let d=a=>{if(!a)return null;let b=c.resolvedConversation(a);return b?.holdsTurns?{conversationId:b.conversationId,cwd:b.cwd}:null},e=d(b.conversationId);if(e)return e;let f=(0,Y.orchestratorRevocations)().filter(b=>b.project===a),g=new Set([b.conversationId??""]),h=b.conversationId;for(let a=0;a<8&&h;a+=1){let a=[...f].reverse().find(a=>a.successorConversationId===h),b=a?.conversationId??null;if(!b||g.has(b))break;g.add(b),h=b;let c=d(b);if(c)return c}return null}(k,p,b),t=b.projectTasks(k).slice(0,12),u=aa(a.handoffNotes).slice(0,2e3),v={header:[`You are replacing orchestrator conversation ${p.conversationId} for project ${k}. Its manager authority is revoked; its session and card remain on the board, linked to yours.`,...s?[s.conversationId===p.conversationId?`Your predecessor's recent turns — decisions, blockers, in-flight work — are one call away: ${am(s.conversationId)}. Records are newest first; pass the returned cursor with a fresh clientRequestId for each older page. Read them before acting, and never open the transcript file. If the call reports that the conversation has no transcript, reconstruct state from the board.`:`The seat you are replacing holds no readable turns, so it is not what you read. The last predecessor in this lineage that does is ${s.conversationId}: ${am(s.conversationId)}. Records are newest first; pass the returned cursor with a fresh clientRequestId for each older page. Read them before acting, and never open the transcript file.`]:["No conversation in this seat's lineage holds readable turns — the seat you are replacing has none, and neither does any predecessor on record. There is no handover transcript to read: reconstruct state from the board tasks below and from the notes in this mandate, and do not go looking for the predecessor's transcript file."]],tasks:t.length?`Open board tasks for this project:
|
|
122
|
+
${t.map(a=>`- [${a.status}] ${a.text.slice(0,140)} (${a.id})`).join("\n")}`:"No open board tasks are recorded for this project.",notes:u||null},w=aa(a.mandate)||p.mandate,x=w===B.ij?B.L8:w!==p.mandate&&(0,B.Ge)(p.promptVersion)?null:p.promptVersion,y=function(a,b){let c=(0,Y.orchestratorSeatFor)(a.project).pending;if(c&&c.intent.clientRequestId===a.clientRequestId&&null===c.intent.error)return{kind:"composed",mandate:c.mandate,handoff:null};let d=function(a){let b=[],c=[],d=[],e=null,f=[],g=()=>{let a=f.join("\n").trim();a&&("history"===e?c.push(a):"handoff"===e&&d.push(a)),f=[]};for(let c of H(a).split("\n")){if(c===D||c===C){g(),e=c===D?"history":"handoff";continue}null===e?b.push(c):f.push(c)}return g(),{core:b.join("\n").trimEnd(),history:c.length?c.join("\n\n"):null,handoffs:d}}(a.base);return null===d.history&&0===d.handoffs.length?ap(a,d.core,null,"none",null):(async()=>{let c;try{c=await b.summarizeHandoffs({project:a.project,clientRequestId:a.clientRequestId,priorHistory:d.history,priorHandoffs:d.handoffs,predecessor:a.predecessor})}catch{c={kind:"fallback",reason:"error"}}if("digest"===c.kind){let b;return ap(a,d.core,(b=I(c.text).trim())&&G(b,4096).value||null,"digest",null)}return console.warn(`orchestrator rotation for ${a.project} used the verbatim handoff fallback: ${c.reason}`),ap(a,d.core,function(a,b,c){let d=[...[...b].reverse().slice(0,2).map(a=>({label:"### Earlier handoff",body:a})),...a?[{label:"### Earlier rotation history",body:a}]:[]];if(!d.length)return null;let e=`(verbatim — summarizer ${c})`,f=4096-F(e),g=[];for(let a of d){let b=F(`
|
|
121
123
|
|
|
122
124
|
${a.label}
|
|
123
|
-
`);if(f-b<=0)continue;let c=
|
|
124
|
-
${a.body}`)].join("\n\n"):null}(d.history,d.handoffs,c.reason),"fallback",c.reason)})()}({project:k,clientRequestId:l,base:w,handoff:v,predecessor:r?{path:r.path,engine:r.engine}:null,roleParams:a.roleParams},b),
|
|
125
|
+
`);if(f-b<=0)continue;let c=G(I(a.body).trim(),f-b).value;c&&(g.push({label:a.label,body:c}),f-=b+F(c))}return g.length?[e,...g.reverse().map(a=>`${a.label}
|
|
126
|
+
${a.body}`)].join("\n\n"):null}(d.history,d.handoffs,c.reason),"fallback",c.reason)})()}({project:k,clientRequestId:l,base:w,handoff:v,predecessor:r?{path:r.path,engine:r.engine}:null,roleParams:a.roleParams},b),z=y instanceof Promise?await y:y,A={conversationId:p.conversationId,path:r?.path??p.path,seatEpoch:p.seatEpoch},E=(0,Y.orchestratorSeatFor)(k).active;if(!E||E.conversationId!==p.conversationId||E.seatEpoch!==p.seatEpoch){let a=_(k,p.seatEpoch,E);return{status:a.status,body:{...a.body,rotatedFrom:A,triggeredBy:i}}}if("too_large"===z.kind)return{status:413,body:{...z.body,rotatedFrom:A,triggeredBy:i}};let J=await ak({project:k,mandate:z.mandate,clientRequestId:l,replaceIncumbent:!0,expectedIncumbentSeatEpoch:p.seatEpoch,promptVersion:x,...void 0!==a.engine?{engine:a.engine}:p.engine?{engine:p.engine}:{},...void 0!==a.model?{model:a.model}:(void 0===a.engine||a.engine===p.engine)&&p.model?{model:p.model}:{},...void 0!==a.effort?{effort:a.effort}:{},...void 0!==a.fast?{fast:a.fast}:{},...void 0!==a.cwd?{cwd:a.cwd}:r?{cwd:r.cwd}:s?.cwd?{cwd:s.cwd}:{},...void 0!==a.accountId?{accountId:a.accountId}:{}},b,i);return{status:J.status,body:{...J.body,...n,rotatedFrom:A,triggeredBy:(d=J.body,e=i,!(f=d.seat)||"object"!=typeof f||Array.isArray(f)?e:f.triggeredBy??null),...z.handoff?{handoff:z.handoff}:{}}}}function ap(a,b,c,d,e){let f=K("spawn",a.roleParams),g=(0,t.e3)(),h=function(a){let b=H(a.core),c=null===a.history?null:I(a.history),d={header:a.handoff.header.map(I),tasks:null===a.handoff.tasks?null:I(a.handoff.tasks),notes:null===a.handoff.notes?null:I(a.handoff.notes)},e=b=>F(a.deliver(b)),f=J(b,c,d,d.notes),g=e(f);if(g<=a.budgetBytes)return{kind:"fits",mandate:f,bytes:g,historyDropped:!1,notesTruncatedTo:null};if(null!==c){let c=J(b,null,d,d.notes),f=e(c);if(f<=a.budgetBytes)return{kind:"fits",mandate:c,bytes:f,historyDropped:!0,notesTruncatedTo:null}}let h=null!==c,i=J(b,null,d,null),j=e(i);if(j>a.budgetBytes)return{kind:"too_large",bytes:j,budgetBytes:a.budgetBytes};let k=d.notes;if(!k)return{kind:"fits",mandate:i,bytes:j,historyDropped:h,notesTruncatedTo:null};let l=[...k],m={mandate:i,bytes:j,kept:0},n=1,o=l.length-1;for(;n<=o;){let c=Math.floor((n+o)/2),f=J(b,null,d,`${l.slice(0,c).join("")}${E}`),g=e(f);g<=a.budgetBytes?(m={mandate:f,bytes:g,kept:c},n=c+1):o=c-1}return{kind:"fits",mandate:m.mandate,bytes:m.bytes,historyDropped:h,notesTruncatedTo:m.kept}}({core:b,history:c,handoff:a.handoff,budgetBytes:u.N0-f,deliver:a=>(0,B.OT)(a,g)});return"too_large"===h.kind?{kind:"too_large",body:L({ok:!1,bytes:h.bytes,overhead:f,bound:u.N0,excess:h.bytes-h.budgetBytes})}:{kind:"composed",mandate:h.mandate,handoff:{history:d,reason:e,historyDropped:h.historyDropped,notesTruncatedTo:h.notesTruncatedTo,mandateBytes:h.bytes}}}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=7192,exports.ids=[3302,7192],exports.modules={15408:(a,b,c)=>{c.d(b,{$p:()=>C,Cp:()=>F,EK:()=>L,HS:()=>B,Kp:()=>N,T7:()=>E,Ud:()=>K,Ye:()=>G,co:()=>M,ho:()=>D,js:()=>I,pQ:()=>O,uC:()=>J,uV:()=>v,ut:()=>n,x2:()=>H});var d=c(77598),e=c.n(d),f=c(73024),g=c.n(f),h=c(76760),i=c.n(h),j=c(22962),k=c(91724),l=c(89940);let m=()=>(0,k.BQ)("orchestrator-seats.json");function n(a){return(0,l.G$)(a.trim())}function o(){return{schemaVersion:1,nextSeatEpoch:1,seats:{},pending:{},revocations:[],history:[],rollbacks:{}}}function p(a,b){g().mkdirSync(i().dirname(a),{recursive:!0});let c=i().join(i().dirname(a),`.${i().basename(a)}.${process.pid}.${e().randomUUID()}.tmp`);g().writeFileSync(c,JSON.stringify(b,null,2)+"\n","utf8"),g().renameSync(c,a)}function q(a){if(!a||"object"!=typeof a||Array.isArray(a)||"operator"!==a.kind&&"agent"!==a.kind)return null;let b="string"==typeof a.conversationId&&a.conversationId?a.conversationId:null,c="number"==typeof a.seatEpoch&&Number.isInteger(a.seatEpoch)&&a.seatEpoch>=1?a.seatEpoch:null;return{kind:a.kind,conversationId:b,seatEpoch:c}}function r(a){if(!a||"object"!=typeof a||Array.isArray(a)||"string"!=typeof a.project||!a.project||"number"!=typeof a.seatEpoch||!Number.isInteger(a.seatEpoch)||a.seatEpoch<1||null!==a.conversationId&&"string"!=typeof a.conversationId||null!==a.path&&"string"!=typeof a.path||"string"!=typeof a.mandate||"pending"!==a.state&&"active"!==a.state)return null;let b=a.intent;if(!b||"string"!=typeof b.clientRequestId||!b.clientRequestId||"spawn"!==b.mode&&"existing"!==b.mode||"string"!=typeof a.designatedAt||null!==a.activatedAt&&"string"!=typeof a.activatedAt)return null;let c="string"==typeof a.engine&&a.engine.trim()?a.engine:null,d="string"==typeof a.model&&a.model.trim()?a.model:null,e="boolean"==typeof a.runtimeIdentityFrozen?a.runtimeIdentityFrozen:!!(c||d);return{project:a.project,seatEpoch:a.seatEpoch,conversationId:a.conversationId??null,path:a.path??null,engine:c,model:d,runtimeIdentityFrozen:e,mandate:a.mandate,promptVersion:"number"==typeof a.promptVersion&&Number.isInteger(a.promptVersion)?a.promptVersion:null,predecessorConversationId:"string"==typeof a.predecessorConversationId?a.predecessorConversationId:null,triggeredBy:q(a.triggeredBy),state:a.state,intent:{clientRequestId:b.clientRequestId,mode:b.mode,launchId:"string"==typeof b.launchId?b.launchId:null,error:"string"==typeof b.error?b.error:null},designatedAt:a.designatedAt,activatedAt:a.activatedAt??null}}function s(a,b){return a.history.push(b),a.history.length>50&&a.history.splice(0,a.history.length-50),b}function t(a,b){let c=a[b.project];(!c||b.seatEpoch>c.seatEpoch)&&(a[b.project]=b)}function u(){let a;try{a=g().readFileSync(m(),"utf8")}catch(a){return a?.code==="ENOENT"?o():null}try{let b=JSON.parse(a);if(1!==b.schemaVersion)return null;let c=o();for(let[a,d]of(c.nextSeatEpoch="number"==typeof b.nextSeatEpoch&&Number.isInteger(b.nextSeatEpoch)&&b.nextSeatEpoch>=1?b.nextSeatEpoch:1,Object.entries(b.seats??{}))){let b=r(d);b&&b.project===a&&"active"===b.state&&b.conversationId&&t(c.seats,{...b,project:n(a)})}for(let[a,d]of Object.entries(b.pending??{})){let b=r(d);b&&b.project===a&&"pending"===b.state&&t(c.pending,{...b,project:n(a)})}for(let[a,d]of Object.entries(b.rollbacks??{})){let b=r(d);b&&b.conversationId&&(c.rollbacks[n(a)]=b)}for(let a of Array.isArray(b.revocations)?b.revocations:[])"string"==typeof a.project&&"string"==typeof a.conversationId&&"number"==typeof a.seatEpoch&&Number.isInteger(a.seatEpoch)&&"string"==typeof a.revokedAt&&c.revocations.push({project:n(a.project),conversationId:a.conversationId,seatEpoch:a.seatEpoch,revokedAt:a.revokedAt,successorConversationId:"string"==typeof a.successorConversationId?a.successorConversationId:null,triggeredBy:q(a.triggeredBy)});for(let a of Array.isArray(b.history)?b.history:[]){let b=r(a.seat);b&&("terminal_error"===a.reason||"superseded_epoch"===a.reason)&&"string"==typeof a.terminalizedAt&&c.history.push({seat:{...b,project:n(b.project)},reason:a.reason,terminalizedAt:a.terminalizedAt})}let d=Math.max(0,...Object.values(c.seats).map(a=>a.seatEpoch),...Object.values(c.pending).map(a=>a.seatEpoch),...Object.values(c.rollbacks).map(a=>a.seatEpoch),...c.revocations.map(a=>a.seatEpoch),...c.history.map(a=>a.seat.seatEpoch));return c.nextSeatEpoch<=d&&(c.nextSeatEpoch=d+1),c}catch{return null}}function v(){return u()??o()}function w(a){return void 0===a?Error("orchestrator seat evidence is malformed"):Error("orchestrator seat evidence is malformed",{cause:a})}function x(a,b){if(void 0===a)return{};if(!a||"object"!=typeof a||Array.isArray(a))throw w(Error(`${b} is invalid`));return a}function y(a,b){if(void 0===a)return[];if(!Array.isArray(a))throw w(Error(`${b} is invalid`));return a}function z(){let a,b;try{a=g().readFileSync(m(),"utf8")}catch(a){if(a&&"object"==typeof a&&"ENOENT"===a.code)return{raw:null,normalized:o()};throw a}try{b=JSON.parse(a)}catch(a){throw w(a)}if(!b||"object"!=typeof b||Array.isArray(b))throw w();let c=b;if(1!==c.schemaVersion||"number"!=typeof c.nextSeatEpoch||!Number.isInteger(c.nextSeatEpoch)||c.nextSeatEpoch<1)throw w();let d=o();for(let[a,b]of(d.nextSeatEpoch=c.nextSeatEpoch,Object.entries(x(c.seats,"seats")))){let c=r(b);if(!c||c.project!==a||"active"!==c.state||!c.conversationId)throw w();let e=n(a);if(d.seats[e])throw w();d.seats[e]={...c,project:e}}for(let[a,b]of Object.entries(x(c.pending,"pending"))){let c=r(b);if(!c||c.project!==a||"pending"!==c.state)throw w();let e=n(a);if(d.pending[e])throw w();d.pending[e]={...c,project:e}}for(let a of y(c.revocations,"revocations")){if(!a||"object"!=typeof a||"string"!=typeof a.project||!a.project||"string"!=typeof a.conversationId||!a.conversationId||"number"!=typeof a.seatEpoch||!Number.isInteger(a.seatEpoch)||a.seatEpoch<1||"string"!=typeof a.revokedAt||void 0!==a.successorConversationId&&null!==a.successorConversationId&&"string"!=typeof a.successorConversationId)throw w();d.revocations.push({project:n(a.project),conversationId:a.conversationId,seatEpoch:a.seatEpoch,revokedAt:a.revokedAt,successorConversationId:a.successorConversationId??null,triggeredBy:q(a.triggeredBy)})}for(let a of y(c.history,"history")){let b=r(a?.seat);if(!a||!b||"terminal_error"!==a.reason&&"superseded_epoch"!==a.reason||"string"!=typeof a.terminalizedAt)throw w();d.history.push({seat:{...b,project:n(b.project)},reason:a.reason,terminalizedAt:a.terminalizedAt})}return{raw:c,normalized:d}}function A(a){p(m(),a)}function B(a){let b=v(),c=n(a);return{active:b.seats[c]??null,pending:b.pending[c]??null,history:b.history.filter(a=>a.seat.project===c)}}function C(a){return(0,j.oV)(()=>{let b,c=v(),d=n(a.project),e=c.seats[d];if(e&&e.intent.clientRequestId===a.clientRequestId)return{kind:"completed",seat:e};let f=c.pending[d];if(f&&null===f.intent.error&&f.intent.clientRequestId===a.clientRequestId)return{kind:"replay",seat:f};if(f){if(!(null!==f.intent.error||void 0!==e&&f.seatEpoch<e.seatEpoch))return{kind:"in_progress",seat:f};b=s(c,{seat:f,reason:null!==f.intent.error?"terminal_error":"superseded_epoch",terminalizedAt:a.now??new Date().toISOString()}),delete c.pending[d]}let g={project:d,seatEpoch:c.nextSeatEpoch,conversationId:a.conversationId??null,path:null,engine:a.engine?.trim()||null,model:a.model?.trim()||null,runtimeIdentityFrozen:!!(a.engine?.trim()&&a.model?.trim()),mandate:a.mandate,promptVersion:a.promptVersion??null,predecessorConversationId:null,triggeredBy:a.triggeredBy??null,state:"pending",intent:{clientRequestId:a.clientRequestId,mode:a.mode,launchId:null,error:null},designatedAt:a.now??new Date().toISOString(),activatedAt:null};return c.nextSeatEpoch+=1,c.pending[d]=g,A(c),{kind:"begun",seat:g,...b?{terminalized:b}:{}}})}function D(a){return(0,j.oV)(()=>{let b=v(),c=n(a.project),d=b.seats[c];if(d&&d.intent.clientRequestId===a.clientRequestId)return{kind:"replay",seat:d};let e=b.pending[c];if(!e||e.intent.clientRequestId!==a.clientRequestId)return{kind:"missing"};let f=a.now??new Date().toISOString(),g=null;d&&d.conversationId&&d.conversationId!==a.conversationId&&(g={project:c,conversationId:d.conversationId,seatEpoch:d.seatEpoch,revokedAt:f,successorConversationId:a.conversationId,triggeredBy:e.triggeredBy??null},b.revocations.push(g)),"spawn"===e.intent.mode&&null===a.path&&d?.conversationId&&d.conversationId!==a.conversationId?b.rollbacks[c]=d:delete b.rollbacks[c];let h={...e,conversationId:a.conversationId,path:a.path,engine:e.engine??(a.engine?.trim()||null),model:e.model??(a.model?.trim()||null),runtimeIdentityFrozen:!0===e.runtimeIdentityFrozen||!!(a.engine||a.model),predecessorConversationId:g?.conversationId??e.predecessorConversationId,state:"active",intent:{...e.intent,launchId:a.launchId??e.intent.launchId,error:null},activatedAt:f};return delete b.pending[c],b.seats[c]=h,A(b),{kind:"activated",seat:h,revoked:g}})}function E(a){return(0,j.oV)(()=>{let b=v(),c=n(a.project),d=b.seats[c];if(!d||d.conversationId!==a.conversationId)return null;let e=d.engine??(a.engine?.trim()||null),f=d.model??(a.model?.trim()||null);if(e===d.engine&&f===d.model)return d;let g={...d,engine:e,model:f};return b.seats[c]=g,A(b),g})}function F(a,b,c,d){return(0,j.oV)(()=>{let e=v(),f=n(a),g=e.pending[f];if(!g||g.intent.clientRequestId!==b)return null;g.intent.error=c.slice(0,500);let h=s(e,{seat:g,reason:"terminal_error",terminalizedAt:d??new Date().toISOString()});return delete e.pending[f],A(e),h})}function G(a){return(0,j.oV)(()=>{let b=v(),c=n(a.project),d=b.seats[c];if(!d||d.intent.clientRequestId!==a.clientRequestId||"active"!==d.state||"spawn"!==d.intent.mode||null!==d.path||!d.conversationId)return null;let e=a.now??new Date().toISOString(),f=b.rollbacks[c]??null,g=f?null:[...b.revocations].reverse().find(a=>a.project===c&&a.successorConversationId===d.conversationId)?.conversationId??null,h=f??(g?a.restorableSeat?.({conversationId:g,stillborn:d})??null:null),i=!!(h?.conversationId&&a.resolvable&&!a.resolvable(h.conversationId)),j=i?null:h,k=null;j?.conversationId?(k={...j,project:c,seatEpoch:b.nextSeatEpoch,state:"active",activatedAt:e},b.nextSeatEpoch+=1,b.seats[c]=k):delete b.seats[c],b.revocations.push({project:c,conversationId:d.conversationId,seatEpoch:d.seatEpoch,revokedAt:e,successorConversationId:k?.conversationId??null,triggeredBy:d.triggeredBy??null}),delete b.rollbacks[c];let l=i?`${a.error}; the predecessor ${h.conversationId} it would have been rolled back to is no longer resolvable either, so the project is left undesignated`:a.error,m=s(b,{seat:{...d,intent:{...d.intent,error:l.slice(0,500)}},reason:"terminal_error",terminalizedAt:e});return A(b),{terminalized:m,restored:k}})}function H(a){return(0,j.oV)(()=>{let b=v(),c=n(a.project),d=b.seats[c];if(!d||d.intent.clientRequestId!==a.clientRequestId||d.conversationId!==a.conversationId)return null;if(d.path===a.path&&!b.rollbacks[c])return d;let e={...d,path:a.path};return b.seats[c]=e,delete b.rollbacks[c],A(b),e})}function I(){return Object.values(v().seats)}function J(){let a=u();return null===a?null:Object.values(a.seats)}function K(a){let b=u();if(null===b)return null;let c=n(a);return{active:b.seats[c]??null,pending:b.pending[c]??null}}function L(){return Object.values(z().normalized.seats)}function M(a){0!==a.length&&(0,j.oV)(()=>{let b=z();if(!b.raw||0===Object.keys(b.normalized.seats).length)return;let c=new Map(a.map(a=>[a.legacyPath,a.sharedPath])),d=x(b.raw.seats,"seats"),e=!1;for(let a of Object.values(d)){if(!a||"object"!=typeof a||Array.isArray(a)||"string"!=typeof a.path)continue;let b=c.get(a.path);b&&(a.path=b,e=!0)}e&&p(m(),b.raw)})}function N(){return v().revocations}function O(a=a=>a){let b=u();if(null===b)return null;let c=new Map,d=b=>{if(!b.conversationId)return;let d=a(b.conversationId);c.set(d,Math.max(c.get(d)??0,b.seatEpoch))};for(let a of Object.values(b.seats))d(a);for(let a of Object.values(b.pending))null===a.intent.error&&d(a);let e=new Set;for(let d of b.revocations){let b=a(d.conversationId);d.seatEpoch>=(c.get(b)??0)&&e.add(b)}return e}},33302:(a,b,c)=>{c.d(b,{NZ:()=>r,OE:()=>m,Tj:()=>u,Yd:()=>t,kg:()=>s,mn:()=>n});var d=c(77598),e=c.n(d),f=c(10781),g=c(89937),h=c(4012);let i=/^[A-Za-z0-9_-]{43}$/,j="x-llv-internal-service",k=/^[a-f0-9]{64}$/,l=["monitor","mcp","orchestrator"];function m(a){let b,c=a.headers.get(h.VIEWER_SPAWN_CAPABILITY_HEADER)?.trim()??"";return c&&i.test(c)?(b=e().createHash("sha256").update(c).digest("hex"),(0,f.agentRegistry)().conversationIdForSpawnCapabilityDigest(b)):null}function n(a){return null===m(a)}let o={ok:!1,status:403,error:"this is an operator-only action; an agent may not perform it, whatever role it holds"},p={ok:!1,status:403,error:"background Viewer activity is outside direct operator activity"};function q(a){return e().createHmac("sha256",(0,g.ensureOperatorSpawnCapability)()).update(`llv-internal-service-v1\0${a}`).digest("hex")}function r(a){return{[j]:`${a}.${q(a)}`}}function s(a){return"valid"===function(a){let b=a.headers.get(j)?.trim()??"";if(!b)return"absent";let c=b.indexOf("."),d=b.slice(0,c),f=b.slice(c+1);if(!l.includes(d)||!k.test(f))return"invalid";try{let a=q(d);return e().timingSafeEqual(Buffer.from(f),Buffer.from(a))?"valid":"invalid"}catch{return"invalid"}}(a)?p:u(a)}function t(a){let b=m(a);return b?{kind:"agent",conversationId:b}:{kind:"operator",conversationId:null}}function u(a){return m(a)?o:{ok:!0}}},63184:(a,b,c)=>{function d(a){for(let b=a.generations.length-1;b>=0;b-=1){let c=a.generations[b]?.launchProfile?.role;if(c)return c}return null}function e(a){let b=(a.configuredRootId?a.conversations.find(b=>b.id===a.configuredRootId):void 0)??[...a.conversations].filter(a=>"root"===d(a)).sort((a,b)=>a.updatedAt.localeCompare(b.updatedAt)).at(-1);return b?{conversationId:b.id,path:b.generations.at(-1)?.path??null}:null}c.d(b,{O7:()=>d,jL:()=>e}),c(33017)}};
|
|
1
|
+
"use strict";exports.id=7192,exports.ids=[3302,5408,7192],exports.modules={15408:(a,b,c)=>{c.r(b),c.d(b,{ORCHESTRATOR_SEATS_SCHEMA_VERSION:()=>m,ORCHESTRATOR_SEAT_HISTORY_CAP:()=>n,abandonStillbornOrchestratorSeat:()=>I,activeOrchestratorSeats:()=>K,activeOrchestratorSeatsForMigration:()=>N,activeOrchestratorSeatsOrUnknown:()=>L,beginOrchestratorSeatIntent:()=>E,canonicalOrchestratorProject:()=>p,completeOrchestratorSeatIntent:()=>F,confirmOrchestratorSeatMaterialization:()=>J,failOrchestratorSeatIntent:()=>H,orchestratorRevocations:()=>P,orchestratorSeatFor:()=>D,orchestratorSeatForOrUnknown:()=>M,readOrchestratorSeatFile:()=>x,rekeyOrchestratorSeatPaths:()=>O,repairOrchestratorSeatRuntimeIdentity:()=>G,revokedOrchestratorSeatConversationsOrUnknown:()=>Q});var d=c(77598),e=c.n(d),f=c(73024),g=c.n(f),h=c(76760),i=c.n(h),j=c(22962),k=c(91724),l=c(89940);let m=1,n=50,o=()=>(0,k.BQ)("orchestrator-seats.json");function p(a){return(0,l.G$)(a.trim())}function q(){return{schemaVersion:m,nextSeatEpoch:1,seats:{},pending:{},revocations:[],history:[],rollbacks:{}}}function r(a,b){g().mkdirSync(i().dirname(a),{recursive:!0});let c=i().join(i().dirname(a),`.${i().basename(a)}.${process.pid}.${e().randomUUID()}.tmp`);g().writeFileSync(c,JSON.stringify(b,null,2)+"\n","utf8"),g().renameSync(c,a)}function s(a){if(!a||"object"!=typeof a||Array.isArray(a)||"operator"!==a.kind&&"agent"!==a.kind)return null;let b="string"==typeof a.conversationId&&a.conversationId?a.conversationId:null,c="number"==typeof a.seatEpoch&&Number.isInteger(a.seatEpoch)&&a.seatEpoch>=1?a.seatEpoch:null;return{kind:a.kind,conversationId:b,seatEpoch:c}}function t(a){if(!a||"object"!=typeof a||Array.isArray(a)||"string"!=typeof a.project||!a.project||"number"!=typeof a.seatEpoch||!Number.isInteger(a.seatEpoch)||a.seatEpoch<1||null!==a.conversationId&&"string"!=typeof a.conversationId||null!==a.path&&"string"!=typeof a.path||"string"!=typeof a.mandate||"pending"!==a.state&&"active"!==a.state)return null;let b=a.intent;if(!b||"string"!=typeof b.clientRequestId||!b.clientRequestId||"spawn"!==b.mode&&"existing"!==b.mode||"string"!=typeof a.designatedAt||null!==a.activatedAt&&"string"!=typeof a.activatedAt)return null;let c="string"==typeof a.engine&&a.engine.trim()?a.engine:null,d="string"==typeof a.model&&a.model.trim()?a.model:null,e="boolean"==typeof a.runtimeIdentityFrozen?a.runtimeIdentityFrozen:!!(c||d);return{project:a.project,seatEpoch:a.seatEpoch,conversationId:a.conversationId??null,path:a.path??null,engine:c,model:d,runtimeIdentityFrozen:e,mandate:a.mandate,..."string"==typeof a.roleTable?{roleTable:a.roleTable}:{},promptVersion:"number"==typeof a.promptVersion&&Number.isInteger(a.promptVersion)?a.promptVersion:null,predecessorConversationId:"string"==typeof a.predecessorConversationId?a.predecessorConversationId:null,triggeredBy:s(a.triggeredBy),state:a.state,intent:{clientRequestId:b.clientRequestId,mode:b.mode,launchId:"string"==typeof b.launchId?b.launchId:null,error:"string"==typeof b.error?b.error:null},designatedAt:a.designatedAt,activatedAt:a.activatedAt??null}}function u(a,b){return a.history.push(b),a.history.length>n&&a.history.splice(0,a.history.length-n),b}function v(a,b){let c=a[b.project];(!c||b.seatEpoch>c.seatEpoch)&&(a[b.project]=b)}function w(){let a;try{a=g().readFileSync(o(),"utf8")}catch(a){return a?.code==="ENOENT"?q():null}try{let b=JSON.parse(a);if(b.schemaVersion!==m)return null;let c=q();for(let[a,d]of(c.nextSeatEpoch="number"==typeof b.nextSeatEpoch&&Number.isInteger(b.nextSeatEpoch)&&b.nextSeatEpoch>=1?b.nextSeatEpoch:1,Object.entries(b.seats??{}))){let b=t(d);b&&b.project===a&&"active"===b.state&&b.conversationId&&v(c.seats,{...b,project:p(a)})}for(let[a,d]of Object.entries(b.pending??{})){let b=t(d);b&&b.project===a&&"pending"===b.state&&v(c.pending,{...b,project:p(a)})}for(let[a,d]of Object.entries(b.rollbacks??{})){let b=t(d);b&&b.conversationId&&(c.rollbacks[p(a)]=b)}for(let a of Array.isArray(b.revocations)?b.revocations:[])"string"==typeof a.project&&"string"==typeof a.conversationId&&"number"==typeof a.seatEpoch&&Number.isInteger(a.seatEpoch)&&"string"==typeof a.revokedAt&&c.revocations.push({project:p(a.project),conversationId:a.conversationId,seatEpoch:a.seatEpoch,revokedAt:a.revokedAt,successorConversationId:"string"==typeof a.successorConversationId?a.successorConversationId:null,triggeredBy:s(a.triggeredBy)});for(let a of Array.isArray(b.history)?b.history:[]){let b=t(a.seat);b&&("terminal_error"===a.reason||"superseded_epoch"===a.reason)&&"string"==typeof a.terminalizedAt&&c.history.push({seat:{...b,project:p(b.project)},reason:a.reason,terminalizedAt:a.terminalizedAt})}let d=Math.max(0,...Object.values(c.seats).map(a=>a.seatEpoch),...Object.values(c.pending).map(a=>a.seatEpoch),...Object.values(c.rollbacks).map(a=>a.seatEpoch),...c.revocations.map(a=>a.seatEpoch),...c.history.map(a=>a.seat.seatEpoch));return c.nextSeatEpoch<=d&&(c.nextSeatEpoch=d+1),c}catch{return null}}function x(){return w()??q()}function y(a){return void 0===a?Error("orchestrator seat evidence is malformed"):Error("orchestrator seat evidence is malformed",{cause:a})}function z(a,b){if(void 0===a)return{};if(!a||"object"!=typeof a||Array.isArray(a))throw y(Error(`${b} is invalid`));return a}function A(a,b){if(void 0===a)return[];if(!Array.isArray(a))throw y(Error(`${b} is invalid`));return a}function B(){let a,b;try{a=g().readFileSync(o(),"utf8")}catch(a){if(a&&"object"==typeof a&&"ENOENT"===a.code)return{raw:null,normalized:q()};throw a}try{b=JSON.parse(a)}catch(a){throw y(a)}if(!b||"object"!=typeof b||Array.isArray(b))throw y();let c=b;if(c.schemaVersion!==m||"number"!=typeof c.nextSeatEpoch||!Number.isInteger(c.nextSeatEpoch)||c.nextSeatEpoch<1)throw y();let d=q();for(let[a,b]of(d.nextSeatEpoch=c.nextSeatEpoch,Object.entries(z(c.seats,"seats")))){let c=t(b);if(!c||c.project!==a||"active"!==c.state||!c.conversationId)throw y();let e=p(a);if(d.seats[e])throw y();d.seats[e]={...c,project:e}}for(let[a,b]of Object.entries(z(c.pending,"pending"))){let c=t(b);if(!c||c.project!==a||"pending"!==c.state)throw y();let e=p(a);if(d.pending[e])throw y();d.pending[e]={...c,project:e}}for(let a of A(c.revocations,"revocations")){if(!a||"object"!=typeof a||"string"!=typeof a.project||!a.project||"string"!=typeof a.conversationId||!a.conversationId||"number"!=typeof a.seatEpoch||!Number.isInteger(a.seatEpoch)||a.seatEpoch<1||"string"!=typeof a.revokedAt||void 0!==a.successorConversationId&&null!==a.successorConversationId&&"string"!=typeof a.successorConversationId)throw y();d.revocations.push({project:p(a.project),conversationId:a.conversationId,seatEpoch:a.seatEpoch,revokedAt:a.revokedAt,successorConversationId:a.successorConversationId??null,triggeredBy:s(a.triggeredBy)})}for(let a of A(c.history,"history")){let b=t(a?.seat);if(!a||!b||"terminal_error"!==a.reason&&"superseded_epoch"!==a.reason||"string"!=typeof a.terminalizedAt)throw y();d.history.push({seat:{...b,project:p(b.project)},reason:a.reason,terminalizedAt:a.terminalizedAt})}return{raw:c,normalized:d}}function C(a){r(o(),a)}function D(a){let b=x(),c=p(a);return{active:b.seats[c]??null,pending:b.pending[c]??null,history:b.history.filter(a=>a.seat.project===c)}}function E(a){return(0,j.oV)(()=>{let b,c=x(),d=p(a.project),e=c.seats[d];if(e&&e.intent.clientRequestId===a.clientRequestId)return{kind:"completed",seat:e};let f=c.pending[d];if(f&&null===f.intent.error&&f.intent.clientRequestId===a.clientRequestId)return{kind:"replay",seat:f};if(f){if(!(null!==f.intent.error||void 0!==e&&f.seatEpoch<e.seatEpoch))return{kind:"in_progress",seat:f};b=u(c,{seat:f,reason:null!==f.intent.error?"terminal_error":"superseded_epoch",terminalizedAt:a.now??new Date().toISOString()}),delete c.pending[d]}let g={project:d,seatEpoch:c.nextSeatEpoch,conversationId:a.conversationId??null,path:null,engine:a.engine?.trim()||null,model:a.model?.trim()||null,runtimeIdentityFrozen:!!(a.engine?.trim()&&a.model?.trim()),mandate:a.mandate,..."string"==typeof a.roleTable?{roleTable:a.roleTable}:{},promptVersion:a.promptVersion??null,predecessorConversationId:null,triggeredBy:a.triggeredBy??null,state:"pending",intent:{clientRequestId:a.clientRequestId,mode:a.mode,launchId:null,error:null},designatedAt:a.now??new Date().toISOString(),activatedAt:null};return c.nextSeatEpoch+=1,c.pending[d]=g,C(c),{kind:"begun",seat:g,...b?{terminalized:b}:{}}})}function F(a){return(0,j.oV)(()=>{let b=x(),c=p(a.project),d=b.seats[c];if(d&&d.intent.clientRequestId===a.clientRequestId)return{kind:"replay",seat:d};let e=b.pending[c];if(!e||e.intent.clientRequestId!==a.clientRequestId)return{kind:"missing"};let f=a.now??new Date().toISOString(),g=null;d&&d.conversationId&&d.conversationId!==a.conversationId&&(g={project:c,conversationId:d.conversationId,seatEpoch:d.seatEpoch,revokedAt:f,successorConversationId:a.conversationId,triggeredBy:e.triggeredBy??null},b.revocations.push(g)),"spawn"===e.intent.mode&&null===a.path&&d?.conversationId&&d.conversationId!==a.conversationId?b.rollbacks[c]=d:delete b.rollbacks[c];let h={...e,conversationId:a.conversationId,path:a.path,engine:e.engine??(a.engine?.trim()||null),model:e.model??(a.model?.trim()||null),runtimeIdentityFrozen:!0===e.runtimeIdentityFrozen||!!(a.engine||a.model),predecessorConversationId:g?.conversationId??e.predecessorConversationId,state:"active",intent:{...e.intent,launchId:a.launchId??e.intent.launchId,error:null},activatedAt:f};return delete b.pending[c],b.seats[c]=h,C(b),{kind:"activated",seat:h,revoked:g}})}function G(a){return(0,j.oV)(()=>{let b=x(),c=p(a.project),d=b.seats[c];if(!d||d.conversationId!==a.conversationId)return null;let e=d.engine??(a.engine?.trim()||null),f=d.model??(a.model?.trim()||null);if(e===d.engine&&f===d.model)return d;let g={...d,engine:e,model:f};return b.seats[c]=g,C(b),g})}function H(a,b,c,d){return(0,j.oV)(()=>{let e=x(),f=p(a),g=e.pending[f];if(!g||g.intent.clientRequestId!==b)return null;g.intent.error=c.slice(0,500);let h=u(e,{seat:g,reason:"terminal_error",terminalizedAt:d??new Date().toISOString()});return delete e.pending[f],C(e),h})}function I(a){return(0,j.oV)(()=>{let b=x(),c=p(a.project),d=b.seats[c];if(!d||d.intent.clientRequestId!==a.clientRequestId||"active"!==d.state||"spawn"!==d.intent.mode||null!==d.path||!d.conversationId)return null;let e=a.now??new Date().toISOString(),f=b.rollbacks[c]??null,g=f?null:[...b.revocations].reverse().find(a=>a.project===c&&a.successorConversationId===d.conversationId)?.conversationId??null,h=f??(g?a.restorableSeat?.({conversationId:g,stillborn:d})??null:null),i=!!(h?.conversationId&&a.resolvable&&!a.resolvable(h.conversationId)),j=i?null:h,k=null;j?.conversationId?(k={...j,project:c,seatEpoch:b.nextSeatEpoch,state:"active",activatedAt:e},b.nextSeatEpoch+=1,b.seats[c]=k):delete b.seats[c],b.revocations.push({project:c,conversationId:d.conversationId,seatEpoch:d.seatEpoch,revokedAt:e,successorConversationId:k?.conversationId??null,triggeredBy:d.triggeredBy??null}),delete b.rollbacks[c];let l=i?`${a.error}; the predecessor ${h.conversationId} it would have been rolled back to is no longer resolvable either, so the project is left undesignated`:a.error,m=u(b,{seat:{...d,intent:{...d.intent,error:l.slice(0,500)}},reason:"terminal_error",terminalizedAt:e});return C(b),{terminalized:m,restored:k}})}function J(a){return(0,j.oV)(()=>{let b=x(),c=p(a.project),d=b.seats[c];if(!d||d.intent.clientRequestId!==a.clientRequestId||d.conversationId!==a.conversationId)return null;if(d.path===a.path&&!b.rollbacks[c])return d;let e={...d,path:a.path};return b.seats[c]=e,delete b.rollbacks[c],C(b),e})}function K(){return Object.values(x().seats)}function L(){let a=w();return null===a?null:Object.values(a.seats)}function M(a){let b=w();if(null===b)return null;let c=p(a);return{active:b.seats[c]??null,pending:b.pending[c]??null}}function N(){return Object.values(B().normalized.seats)}function O(a){0!==a.length&&(0,j.oV)(()=>{let b=B();if(!b.raw||0===Object.keys(b.normalized.seats).length)return;let c=new Map(a.map(a=>[a.legacyPath,a.sharedPath])),d=z(b.raw.seats,"seats"),e=!1;for(let a of Object.values(d)){if(!a||"object"!=typeof a||Array.isArray(a)||"string"!=typeof a.path)continue;let b=c.get(a.path);b&&(a.path=b,e=!0)}e&&r(o(),b.raw)})}function P(){return x().revocations}function Q(a=a=>a){let b=w();if(null===b)return null;let c=new Map,d=b=>{if(!b.conversationId)return;let d=a(b.conversationId);c.set(d,Math.max(c.get(d)??0,b.seatEpoch))};for(let a of Object.values(b.seats))d(a);for(let a of Object.values(b.pending))null===a.intent.error&&d(a);let e=new Set;for(let d of b.revocations){let b=a(d.conversationId);d.seatEpoch>=(c.get(b)??0)&&e.add(b)}return e}},33302:(a,b,c)=>{c.d(b,{NZ:()=>r,OE:()=>m,Tj:()=>u,Yd:()=>t,kg:()=>s,mn:()=>n});var d=c(77598),e=c.n(d),f=c(10781),g=c(89937),h=c(4012);let i=/^[A-Za-z0-9_-]{43}$/,j="x-llv-internal-service",k=/^[a-f0-9]{64}$/,l=["monitor","mcp","orchestrator"];function m(a){let b,c=a.headers.get(h.VIEWER_SPAWN_CAPABILITY_HEADER)?.trim()??"";return c&&i.test(c)?(b=e().createHash("sha256").update(c).digest("hex"),(0,f.agentRegistry)().conversationIdForSpawnCapabilityDigest(b)):null}function n(a){return null===m(a)}let o={ok:!1,status:403,error:"this is an operator-only action; an agent may not perform it, whatever role it holds"},p={ok:!1,status:403,error:"background Viewer activity is outside direct operator activity"};function q(a){return e().createHmac("sha256",(0,g.ensureOperatorSpawnCapability)()).update(`llv-internal-service-v1\0${a}`).digest("hex")}function r(a){return{[j]:`${a}.${q(a)}`}}function s(a){return"valid"===function(a){let b=a.headers.get(j)?.trim()??"";if(!b)return"absent";let c=b.indexOf("."),d=b.slice(0,c),f=b.slice(c+1);if(!l.includes(d)||!k.test(f))return"invalid";try{let a=q(d);return e().timingSafeEqual(Buffer.from(f),Buffer.from(a))?"valid":"invalid"}catch{return"invalid"}}(a)?p:u(a)}function t(a){let b=m(a);return b?{kind:"agent",conversationId:b}:{kind:"operator",conversationId:null}}function u(a){return m(a)?o:{ok:!0}}},63184:(a,b,c)=>{function d(a){for(let b=a.generations.length-1;b>=0;b-=1){let c=a.generations[b]?.launchProfile?.role;if(c)return c}return null}function e(a){let b=(a.configuredRootId?a.conversations.find(b=>b.id===a.configuredRootId):void 0)??[...a.conversations].filter(a=>"root"===d(a)).sort((a,b)=>a.updatedAt.localeCompare(b.updatedAt)).at(-1);return b?{conversationId:b.id,path:b.generations.at(-1)?.path??null}:null}c.d(b,{O7:()=>d,jL:()=>e}),c(33017)}};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";exports.id=7238,exports.ids=[7238],exports.modules={35961:(a,b,c)=>{c.d(b,{W:()=>g});var d=c(23211);let e=["localhost","127.0.0.1","::1"];function f(a){if(a.startsWith("[")){let b=a.indexOf("]");return -1===b?a:a.slice(1,b)}let b=a.lastIndexOf(":");return -1===b?a:a.slice(0,b)}function g(a){let b=new Set(e),c=process.env.LLV_TS_HOST;c&&b.add(f(c));let d=a.headers.get("host");if(null===d||!b.has(f(d)))return h();let g=a.headers.get("origin");if(null!==g){let a;try{a=new URL(g).host}catch{a=null}if(null===a||!b.has(f(a)))return h()}let i=a.headers.get("sec-fetch-site");return null!==i&&"same-origin"!==i&&"none"!==i?h():null}function h(){return d.NextResponse.json({error:"forbidden: cross-origin request"},{status:403})}},62318:(a,b,c)=>{c.d(b,{d:()=>u});var d=c(77598),e=c.n(d),f=c(10781),g=c(27832),h=c(2033),i=c(40713);function j(a=process.env){return"1"===a.LLV_WAKATIME_ENABLED}var k=c(73024),l=c.n(k),m=c(76760),n=c.n(m),o=c(91724);function p(a,b,c="activity"){return function(...a){return e().createHash("sha256").update(a.join("\0")).digest("hex")}("activity"===c?"llv-wakatime-heartbeat-v1":"llv-wakatime-boundary-v1",a,b)}function q(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function r(a){return"number"==typeof a&&Number.isFinite(a)}function s(a){return Number.isSafeInteger(a)&&a>=0}function t(a,b=(0,o.BQ)("wakatime-state.json"),c=j){if(c()){if(!/^[a-f0-9]{64}$/.test(a.key)||"claude"!==a.engine&&"codex"!==a.engine||!a.project.trim()||a.project.trim()===g.
|
|
2
|
-
`,{encoding:"utf8",mode:384}),l().renameSync(d,b)}finally{try{l().unlinkSync(d)}catch{}}})}}function u(a,b={}){let c={enabled:b.enabled??j,now:b.now??Date.now,registrySnapshot:b.registrySnapshot??(()=>(0,f.agentRegistry)().readOnlySnapshot()),enqueue:b.enqueue??t,reportStorageFailure:b.reportStorageFailure??((a,b)=>console.error(`[wakatime] ${a}`,b))};if(!c.enabled())return null;let d=a.idempotencyKey?.trim()??"",k=a.resolvedAttribution;if(k&&("claude"!==k.engine&&"codex"!==k.engine||!k.project.trim()||k.project===g.
|
|
1
|
+
"use strict";exports.id=7238,exports.ids=[7238],exports.modules={35961:(a,b,c)=>{c.d(b,{W:()=>g});var d=c(23211);let e=["localhost","127.0.0.1","::1"];function f(a){if(a.startsWith("[")){let b=a.indexOf("]");return -1===b?a:a.slice(1,b)}let b=a.lastIndexOf(":");return -1===b?a:a.slice(0,b)}function g(a){let b=new Set(e),c=process.env.LLV_TS_HOST;c&&b.add(f(c));let d=a.headers.get("host");if(null===d||!b.has(f(d)))return h();let g=a.headers.get("origin");if(null!==g){let a;try{a=new URL(g).host}catch{a=null}if(null===a||!b.has(f(a)))return h()}let i=a.headers.get("sec-fetch-site");return null!==i&&"same-origin"!==i&&"none"!==i?h():null}function h(){return d.NextResponse.json({error:"forbidden: cross-origin request"},{status:403})}},62318:(a,b,c)=>{c.d(b,{d:()=>u});var d=c(77598),e=c.n(d),f=c(10781),g=c(27832),h=c(2033),i=c(40713);function j(a=process.env){return"1"===a.LLV_WAKATIME_ENABLED}var k=c(73024),l=c.n(k),m=c(76760),n=c.n(m),o=c(91724);function p(a,b,c="activity"){return function(...a){return e().createHash("sha256").update(a.join("\0")).digest("hex")}("activity"===c?"llv-wakatime-heartbeat-v1":"llv-wakatime-boundary-v1",a,b)}function q(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function r(a){return"number"==typeof a&&Number.isFinite(a)}function s(a){return Number.isSafeInteger(a)&&a>=0}function t(a,b=(0,o.BQ)("wakatime-state.json"),c=j){if(c()){if(!/^[a-f0-9]{64}$/.test(a.key)||"claude"!==a.engine&&"codex"!==a.engine||!a.project.trim()||a.project.trim()===g.UNRESOLVED_PROJECT||!Number.isSafeInteger(a.atMs)||a.atMs<=0)throw Error("direct operator heartbeat is invalid");(0,h.Ol)(b,"WakaTime state is busy",()=>{let c=function(a){if(!q(a)||1!==a.version||!r(a.enabledAtMs)||!q(a.streams)||!Array.isArray(a.pending)||!q(a.retry)||!q(a.counters))return null;let b=a.credentialGeneration??null;if(!(null===b||"string"==typeof b&&/^[a-f0-9]{64}$/.test(b)))return null;let c={};for(let[b,d]of Object.entries(a.streams)){if(!/^[a-f0-9]{64}$/.test(b)||!q(d)||"string"!=typeof d.entity||"claude"!==d.engine&&"codex"!==d.engine||"string"!=typeof d.project||0===d.project.length||!r(d.startedAtMs)||!(null===d.endedAtMs||r(d.endedAtMs))||!r(d.lastMaterializedAtMs)||!r(d.lastObservedAtMs)||!(void 0===d.boundaryFinalizedAtMs||null===d.boundaryFinalizedAtMs||r(d.boundaryFinalizedAtMs))||null!==d.endedAtMs&&d.endedAtMs<=d.startedAtMs||d.lastMaterializedAtMs<d.startedAtMs-1)return null;c[b]={entity:d.entity,engine:d.engine,project:d.project,startedAtMs:d.startedAtMs,endedAtMs:d.endedAtMs,lastMaterializedAtMs:d.lastMaterializedAtMs,lastObservedAtMs:d.lastObservedAtMs,boundaryFinalizedAtMs:d.boundaryFinalizedAtMs??null}}let d={},e=a.retiredStreams??{};if(!q(e))return null;for(let[a,b]of Object.entries(e)){if(!/^[a-f0-9]{64}$/.test(a)||!q(b)||!r(b.lastMaterializedAtMs)||!r(b.lastObservedAtMs)||!(null===b.boundaryFinalizedAtMs||r(b.boundaryFinalizedAtMs))||!r(b.expiresAtMs))return null;d[a]={lastMaterializedAtMs:b.lastMaterializedAtMs,lastObservedAtMs:b.lastObservedAtMs,boundaryFinalizedAtMs:b.boundaryFinalizedAtMs,expiresAtMs:b.expiresAtMs}}let f=[],g=new Set;for(let b of a.pending){var h;if(!q(b)||"string"!=typeof b.key||!/^[a-f0-9]{64}$/.test(b.key)||"string"!=typeof b.stream||!r(b.createdAtMs))return null;let a=q(h=b.heartbeat)&&"string"==typeof h.entity&&0!==h.entity.length&&"app"===h.type&&"string"==typeof h.project&&0!==h.project.length&&"ai coding"===h.category&&r(h.time)&&"string"==typeof h.ai_session&&64===h.ai_session.length?{entity:h.entity,type:"app",project:h.project,category:"ai coding",time:h.time,ai_session:h.ai_session}:null;if(!a)return null;let d=void 0===b.kind?"activity":b.kind;if("activity"!==d&&"boundary"!==d)return null;let e=c[b.stream],i=1e3*a.time;if(!e||!Number.isSafeInteger(i)||a.ai_session!==b.stream||a.entity!==("boundary"===d?`agent-log-viewer/boundary/${b.stream.slice(0,16)}`:e.entity)||a.project!==("boundary"===d?"agent-log-viewer-boundary":e.project)||b.key!==p(b.stream,i,d))return null;g.has(b.key)||(f.push({key:b.key,stream:b.stream,kind:d,createdAtMs:b.createdAtMs,heartbeat:a}),g.add(b.key))}let i=a.retry,j=i.reason;if(!s(i.failures)||!r(i.retryAtMs)||null!==j&&"network"!==j&&"timeout"!==j&&"rate_limit"!==j&&"server"!==j&&"auth"!==j)return null;let k=a.counters;return s(k.accepted)&&s(k.permanentlyRejected)&&s(k.compacted)&&s(k.dropped)&&s(k.historyGaps)?{version:1,enabledAtMs:a.enabledAtMs,credentialGeneration:b,streams:c,pending:f,retry:{failures:i.failures,retryAtMs:i.retryAtMs,reason:j},counters:{accepted:k.accepted,permanentlyRejected:k.permanentlyRejected,compacted:k.compacted,dropped:k.dropped,historyGaps:k.historyGaps},retiredStreams:d}:null}(function(a=(0,o.BQ)("wakatime-state.json")){try{return JSON.parse(l().readFileSync(a,"utf8"))}catch(a){if("ENOENT"===a.code)return null;throw a}}(b))??{version:1,enabledAtMs:a.atMs,credentialGeneration:null,streams:{},retiredStreams:{},pending:[],retry:{failures:0,retryAtMs:0,reason:null},counters:{accepted:0,permanentlyRejected:0,compacted:0,dropped:0,historyGaps:0}};!function(a,b,c,d){if(a.streams[b.key]||a.retiredStreams?.[b.key])return;let e=`agent-log-viewer/operator/${b.engine}/${b.key.slice(0,16)}`;a.streams[b.key]={entity:e,engine:b.engine,project:b.project,startedAtMs:b.atMs,endedAtMs:b.atMs+1,lastMaterializedAtMs:b.atMs+1,lastObservedAtMs:b.atMs,boundaryFinalizedAtMs:b.atMs+1};let f=p(b.key,b.atMs);d.has(f)||(a.pending.push({key:f,stream:b.key,kind:"activity",createdAtMs:c,heartbeat:{entity:e,type:"app",project:b.project,category:"ai coding",time:b.atMs/1e3,ai_session:b.key}}),d.add(f))}(c,{...a,project:a.project.trim()},a.atMs,new Set(c.pending.map(a=>a.key)));l().mkdirSync(n().dirname(b),{recursive:!0,mode:448});let d=n().join(n().dirname(b),`.${n().basename(b)}.${process.pid}.${e().randomUUID()}.tmp`);try{l().writeFileSync(d,`${JSON.stringify(c,null,2)}
|
|
2
|
+
`,{encoding:"utf8",mode:384}),l().renameSync(d,b)}finally{try{l().unlinkSync(d)}catch{}}})}}function u(a,b={}){let c={enabled:b.enabled??j,now:b.now??Date.now,registrySnapshot:b.registrySnapshot??(()=>(0,f.agentRegistry)().readOnlySnapshot()),enqueue:b.enqueue??t,reportStorageFailure:b.reportStorageFailure??((a,b)=>console.error(`[wakatime] ${a}`,b))};if(!c.enabled())return null;let d=a.idempotencyKey?.trim()??"",k=a.resolvedAttribution;if(k&&("claude"!==k.engine&&"codex"!==k.engine||!k.project.trim()||k.project===g.UNRESOLVED_PROJECT))throw Error("direct operator activity attribution is invalid");let l=k?null:(0,f.MA)(c.registrySnapshot()),m=a.conversationId?.trim()??"",n=a.path?.trim()??"",o=m.startsWith("conversation_")?l?.conversation(m)??null:null,p=n?l?.conversationForPath(n)??null:null,q=o?new Set([...o.generations.map(a=>a.path),...o.continuityPaths,...o.abandonedContinuityPaths]):null;if(o&&p&&o.id!==p.id||o&&n&&!q?.has(n))throw Error("direct operator activity has conflicting target evidence");let r=o??p,s=a.fallbackEntry,v=k?.engine??r?.engine??(s?.engine==="claude"||s?.engine==="codex"?s.engine:null);if(!v)throw Error("direct operator activity target is unavailable");let w=r?.generations.at(-1),x=k?.project.trim()??(0,i.x)({projectOwnership:r?.projectOwnership,cwd:w?.launchProfile.cwd||s?.cwd,launchProfileProject:w?.launchProfile.project,fallbackProject:s?.project}).project;if(!x||x===g.UNRESOLVED_PROJECT)throw Error("direct operator activity project is unavailable");let y=c.now();if(!Number.isSafeInteger(y)||y<=0)throw Error("direct operator activity time is invalid");let z={key:d?function(...a){return e().createHash("sha256").update(a.join("\0")).digest("hex")}("llv-wakatime-direct-operator-v1",d):e().randomBytes(32).toString("hex"),engine:v,project:x,atMs:y};try{c.enqueue(z)}catch(a){c.reportStorageFailure("operator_activity_not_stored",{outcome:function(a){if(a instanceof h.Qm)return"busy";if(a instanceof SyntaxError)return"state_unreadable";let b=a?.code;return"string"==typeof b&&/^E[A-Z]{1,15}$/.test(b)?b:"unavailable"}(a)})}return z}c(1849),c(28478),c(63657)}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=7294,exports.ids=[7294],exports.modules={77294:(a,b,c)=>{c.d(b,{checkpointLegacyCollectionMirrorsForDemotion:()=>g,ensureLegacyCollectionsImported:()=>f});var d=c(27146);let e=[{collection:"tasks",importAtActivation:async()=>(await c.e(3696).then(c.bind(c,13696))).importLegacyTasks((0,d.BQ)("tasks.json"),{reconcile:!0}),checkpointMirrorForDemotion:async()=>(await c.e(3696).then(c.bind(c,13696))).checkpointTaskRollbackMirrorForDemotion((0,d.BQ)("tasks.json"))}];async function f(a=console.error){let b=new Map;for(let c of e)try{b.set(c.collection,await c.importAtActivation())}catch(d){a(`[state import] ${c.collection} import failed`,d),b.set(c.collection,d instanceof Error?d:Error(String(d)))}return b}async function g(){for(let a of e)await a.checkpointMirrorForDemotion()}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=7722,exports.ids=[7722],exports.modules={11831:(a,b,c)=>{c.d(b,{AU:()=>g,UH:()=>e,Xl:()=>f});var d=c(10781);function e(a){return{error:a.rejection.guidance,code:a.rejection.code,launchId:a.receipt.launchId,conversationId:a.receipt.conversationId,rejection:a.rejection}}function f(a,b){return"starting"===a.state||b&&"path-pending"===a.state?202:200}function g(a,b=a.artifactPath,c={}){let e="structured"===a.transport||null===a.transport&&!0===c.structured,f=(null!==a.verifiedHost||!0===c.structured&&"completed"===a.state)&&"failed"!==a.state&&"conflicted"!==a.state,h=(0,d.Vt)().allowsReceipt(a,{structured:e})?b:null;return{ok:!0,target:a.pane?.paneId??a.target??null,path:h,...e&&"claude"===a.engine?{effectivePermissionMode:a.launchProfile.permissionMode??"default"}:{},launchId:a.launchId,conversationId:a.conversationId,parent:a.parentConversationId?{conversationId:a.parentConversationId,source:a.parentSource}:null,launched:f,retrySafe:"failed"===a.state,initialMessage:c.initialMessage??("failed"===a.state||"conflicted"===a.state?"failed":"completed"===a.state||"prompt-delivered"===a.state?"delivered":e&&"path-pending"===a.state?"queued":"pending"),...a.error?{error:a.error}:{},state:"conflicted"===a.state?"conflict":"failed"===a.state?"failed":"starting"===a.state||"pane-bound"===a.state?"starting":"host-verified"===a.state||"prompt-delivered"===a.state||"path-pending"===a.state?"path-pending":"settled",transport:e?"structured":"tmux"}}},67722:(a,b,c)=>{c.r(b),c.d(b,{executeSpawnRequest:()=>ap,fenceSpawnAdmissionRejection:()=>am,productionSpawnCommandDependencies:()=>al,spawnSuggestions:()=>ao});var d=c(73024),e=c.n(d),f=c(48161),g=c.n(f),h=c(76760),i=c.n(h),j=c(23211),k=c(41617),l=c(78966),m=c(22962),n=c(26926),o=c(74382),p=c(14509),q=c(10781),r=c(58152),s=c(10230),t=c(61971),u=c(4837),v=c(33302),w=c(99411),x=c(21241),y=c(77598),z=c.n(y);function A(a){return z().createHash("sha256").update(JSON.stringify(a)).digest("hex")}function B(a){return"string"==typeof a.parentConversationId?{conversationId:a.parentConversationId}:"string"==typeof a.parent?{path:a.parent}:"string"==typeof a.src?{path:a.src}:null}var C=c(48892),D=c(94896),E=c(29857),F=c(79511),G=c(11831),H=c(4012),I=c(42087),J=c(16089),K=c(26474),L=c(35961),M=c(3127),N=c(63629),O=c(68512),P=c(50201),Q=c(32372),R=c(41022),S=c(45656),T=c(43384),U=c(48289),V=c(36917),W=c(70107),X=c(60517),Y=c(92094),Z=c(30795),$=c(3743),_=c(57563),aa=c(77308),ab=c(62318);let ac={transcriptAllowed:D.FK,readCwd:a=>(0,J.tX)(a),isDirectory:a=>{try{return e().statSync(a).isDirectory()}catch{return!1}}};var ad=c(3359),ae=c(5602),af=c(11064);let ag=_.en["spawnCard.pinUnavailableFallback"],ah=aa.uk["spawnCard.pinUnavailableFallback"],ai="string"==typeof ah?ah:ag;function aj(a){let b=a.headers.get("accept-language")?.trim().toLowerCase()??"";return"uk"===b||b.startsWith("uk-")}class ak extends Error{}let al={registry:q.agentRegistry,resolveHealthySpawnAccount:n.ax,resolveSpawnAccount:(a,b)=>n.accountManager.resolveSpawn(a,b),resolvePinnedSpawnAdmission:S.jJ,runtimeHostClient:M.sS,publishFilesRevision:O.G,spawnStructuredConversation:S.sh,assertStructuredRuntime:x.x_,defer:a=>(0,j.after)(a),storeImages:a=>(0,Q.PF)().putMany(a),adoptPipelineAttemptFromSource:U.F_,pipelineAttemptTargetForSource:U.RO,recordOperatorActivity:ab.d};function am(a,b,c,d){let e="string"==typeof a.clientAttemptId?a.clientAttemptId:null;if(!e||!/^[A-Za-z0-9_-]{8,128}$/.test(e))return null;try{return(0,F.L8)({clientAttemptId:e,requestDigest:A(a),status:b,error:c},()=>d.registry().spawnReceiptForClientAttempt(e))}catch{return null}}function an(a,b,c){!b||a.includes(b)||c&&(0,W.hY)(b)!==c||a.push(b)}async function ao(a){let b=a.nextUrl.searchParams.get("project")??"",{cwd:c,cwdExists:d}=function(a,b=ac){if(!a||!b.transcriptAllowed(a))return{cwd:null,cwdExists:!1};let c=b.readCwd(a);return{cwd:c,cwdExists:!!(c&&b.isDirectory(c))}}(a.nextUrl.searchParams.get("src")),e=(await (0,V.CS)()).filter(a=>a.path.endsWith(".jsonl")&&("claude-projects"===a.root||"codex-sessions"===a.root)).filter(a=>!a.path.includes(i().sep+"subagents"+i().sep)).sort((a,c)=>Number(c.project===b)-Number(a.project===b)||c.mtime-a.mtime).slice(0,80),f=c?[c]:[];if(!c)for(let a of(0,Y.Xi)(b,10))an(f,a,b);for(let a of e){if(f.length>=10)break;b&&a.project!==b||an(f,(0,J.tX)(a.path,{requireDir:!0}),b)}f.length||f.push(g().homedir());let h=(0,T.l)();return j.NextResponse.json({dirs:f,cwd:c,cwdExists:d,spawnTransport:h,imageInput:{claude:(0,Q.ki)("claude","structured"===h),codex:(0,Q.ki)("codex","structured"===h&&(0,u.JL)(null))}})}async function ap(a,b=al){var c;let d,f,h,x=(0,L.W)(a);if(x)return x;try{d=await a.json()}catch{return j.NextResponse.json({error:"invalid JSON"},{status:400})}let y=(0,s.t3)(d.mcpServers);if(!y.ok)return j.NextResponse.json({error:y.error},{status:400});let z=void 0===d.mcpServers?null:y.value,J=(0,t.jh)(d.plugins);if(!J.ok)return j.NextResponse.json({error:J.error},{status:400});let O=(0,ad.s0)(a),Q=null,U=null,V=null;if(O)try{Q=b.registry();let c=(0,ad.X0)(a,d.src,Q);"error"in c?V=c:U=c}catch(a){V={error:a instanceof Error?a.message:String(a),status:503}}let Y=a=>(V||am(d,400,a,b),j.NextResponse.json({error:a},{status:400})),_=(0,ad.QD)(a,d);if(_)return Y(_);if(void 0!==d.allowSubagents&&"boolean"!=typeof d.allowSubagents)return j.NextResponse.json({error:"allowSubagents must be a boolean"},{status:400});let aa=(0,w.s8)(d);if(!aa.ok)return Y(aa.error);let ab=(0,ad.Fk)(aa.value?.role??null,d);if(ab)return Y(ab);if(aa.value&&(0,F.n4)(aa.value.role)&&!0===d.allowSubagents)return j.NextResponse.json({error:`${aa.value.role} launches cannot enable subagents: reviewer and verifier sessions run every check in-session`},{status:400});let ac="claude"===d.engine||"codex"===d.engine?d.engine:aa.value?.config.engine??null;if(!ac)return j.NextResponse.json({error:"engine must be claude or codex"},{status:400});if(void 0!==d.accountId&&"string"!=typeof d.accountId)return j.NextResponse.json({error:"accountId must be a string"},{status:400});if(void 0!==d.clientAttemptId&&("string"!=typeof d.clientAttemptId||!/^[A-Za-z0-9_-]{8,128}$/.test(d.clientAttemptId)))return j.NextResponse.json({error:"clientAttemptId must be 8-128 URL-safe characters"},{status:400});let ah=(0,r.BL)(ac,{...d,model:d.model??aa.value?.config.model??(0,u.Gh)(ac),effort:void 0===d.effort?aa.value?.config.effort:d.effort});if(ah.error)return j.NextResponse.json({error:ah.error},{status:400});let an=(0,u.wi)({model:void 0===d.model?aa.value?.config.model:d.model});if(an.error)return j.NextResponse.json({error:an.error},{status:400});if(void 0!==d.model&&null!==d.model&&an.model){let a=(0,u.RC)(ac,an.model);if("error"in a)return j.NextResponse.json({error:a.error},{status:400})}let ao="string"==typeof d.prompt?d.prompt.trim():"",aq=aa.value?[aa.value.scaffold,ao].filter(Boolean).join("\n\n"):ao,{images:ar,error:as}=(0,$.Fu)(d);if(as)return j.NextResponse.json({error:as.error},{status:as.status});let at=void 0===d.title?null:(0,Z.St)("string"==typeof d.title?d.title:null,120);if(void 0!==d.title&&!at)return j.NextResponse.json({error:"title must be a semantic, non-placeholder string"},{status:400});let au=(0,Z.V0)(ao,60)?(0,Z.bF)(aa.value?.role??ac,ao):null;try{f=(0,T.l)()}catch(a){return j.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}if("structured"===f){try{b.assertStructuredRuntime()}catch(a){return j.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:503})}let a=(0,T.H)({engine:ac,model:an.model,hasImages:ar.length>0,fast:ah.fast});if(a)return j.NextResponse.json({error:a},{status:409});try{(0,R.h1)(aq)}catch(a){return j.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:413})}}let av=Q??b.registry(),aw="string"==typeof d.clientAttemptId?d.clientAttemptId:null,ax=aw?av.spawnReceiptForClientAttempt(aw):null;if(!at&&!ax)return j.NextResponse.json({error:Z.QE},{status:400});let ay=at??au??(0,Z.St)(ax?.launchProfile.title,120);if(!ay)return j.NextResponse.json({error:Z.QE},{status:400});if(O&&V)return j.NextResponse.json({error:V.error},{status:V.status??403});if(O&&!0===d.allowSubagents&&U?.kind!=="operator")return j.NextResponse.json({error:"allowSubagents requires an authenticated Viewer operator spawn"},{status:403});let az=null;if(void 0!==d.project&&null!==d.project){if(!(az="string"==typeof d.project?(0,o.QK)(d.project):null))return j.NextResponse.json({error:"project must be a valid project key"},{status:400});if(O&&U?.kind!=="operator")return j.NextResponse.json({error:"explicit project requires an authenticated Viewer operator spawn"},{status:403})}let aA=null;if(void 0!==d.supersedes&&null!==d.supersedes){if("string"!=typeof d.supersedes||!d.supersedes.trim())return j.NextResponse.json({error:"supersedes must name a conversation id or transcript path"},{status:400});let a=d.supersedes.trim(),b=a.startsWith("conversation_")?av.conversation(a):av.conversationForPath(a);if(!b)return j.NextResponse.json({error:"supersedes does not resolve to a known conversation"},{status:404});let c=av.supersedenceConflict(b.id);if(c)return j.NextResponse.json({error:`supersedes conflicts with the live conversation ${c}`,successorConversationId:c},{status:409});aA=b.id}let aB="string"==typeof d.cwd?d.cwd.trim():"";if(!aB)return j.NextResponse.json({error:"working directory is required"},{status:400});let aC=i().resolve("~"===aB||aB.startsWith("~/")?i().join(g().homedir(),aB.slice(1)):aB);try{h=e().statSync(aC)}catch{return j.NextResponse.json({error:`directory does not exist: ${aC}`},{status:400})}if(!h.isDirectory())return j.NextResponse.json({error:`not a directory: ${aC}`},{status:400});let aD=(0,v.kg)(a).ok;if(aD&&!aw)return j.NextResponse.json({error:"clientAttemptId is required for direct operator spawn"},{status:400});if(aD){let a=az??(0,W.hY)(aC);if(!a)return j.NextResponse.json({error:"project could not be resolved for direct operator spawn"},{status:400});try{b.recordOperatorActivity?.({idempotencyKey:`spawn:${aw}`,resolvedAttribution:{engine:ac,project:a}})}catch{return j.NextResponse.json({error:"direct operator activity could not be recorded"},{status:503})}}let aE=[],aF=null;try{let g,h,k,r=void 0===d.title||at===au,u=ax?.identityWaveTitleBackfill===!0&&r,v=u?(0,Z.St)(ax.launchProfile.title,120)??ay:ay,w=(0,D.bs)((0,ad.qe)(U,{...d,role:aa.value?.role}),av),x=w.parent,y=w.reviewed?.conversationId??null;if(O&&U?.kind==="agent"&&!x)return j.NextResponse.json({error:ad.HJ},{status:400});let E=U?.kind==="agent"?"string"==typeof d.src&&!!d.src.trim():"string"==typeof d.src&&!!d.src.trim()||"string"==typeof d.parent&&!!d.parent.trim()||void 0!==d.parentConversationId||"string"==typeof d.reviews&&!!d.reviews.trim(),L=x?E?"explicit":"inferred-caller":null,Q=x?.conversationId??null,R="string"==typeof d.src&&d.src.trim()?Q:null,T=x?.sessionKey??null,V=x?.artifactPath??null,Y=(0,t.GU)({origin:{kind:U?.kind==="agent"?"agent":"operator"},parentConversationId:Q,agentRole:aa.value?.role??null}),_=b.internalGrant?.()??null,ab=_?.sessionClass===s.Vv?_:null,ae=ab?[...t.sN]:(0,t.wE)({engine:ac,origin:Y,requested:J.value}),al=ab?(0,s.c1)(ab.mcpServers):(0,s.Mt)({origin:Y,requested:z}),am=(a,b=!1)=>{var c;let e,f=(c={engine:ac,cwd:aC,model:an.model,effort:ah.effort,fast:ah.fast,accountId:a,role:aa.value?.role??null,title:ay,mcpServers:al,...ae.length?{plugins:ae}:{},...!0===d.allowSubagents?{allowSubagents:!0}:{},...az?{project:az}:{},parent:B({parentConversationId:Q??void 0}),...y?{reviews:B({parentConversationId:y})}:{},...aA?{supersedes:B({parentConversationId:aA})}:{},prompt:aq,images:ar.map(a=>{var b;return{mime:a.mime,digest:(b={image:a.base64},A(b))}})},e=Object.fromEntries(Object.entries(c).filter(([a])=>"title"!==a)),{current:A(c),withoutTitle:A(e)});if(u||b&&ax)return ax.requestDigest===f.current?f.current:f.withoutTitle;let g=(0,Z.St)(ax?.launchProfile.title,120);return ax&&g&&g!==ay||ax?.requestDigest===f.current?f.current:f.withoutTitle},ap=R&&b.pipelineAttemptTargetForSource?b.pipelineAttemptTargetForSource(R):null,as=!ab&&(ao.trim()||ar.length)?{prompt:ao,images:ar.length,echo:aq}:null,aB="string"==typeof d.taskId&&d.taskId.trim()?[d.taskId.trim()]:null,aD=(a,b,c,e=void 0!==d.accountId)=>({engine:ac,cwd:aC,transport:f,accountId:a,accountPin:e,parentConversationId:Q,parentSource:L,parentSessionKey:T,parentArtifactPath:V,role:aa.value?.role??null,reviewsConversationId:y,explicitProject:az,supersedes:aA,supersedesReason:"recovery-spawn",liveChildrenCap:U?.liveChildrenCap,origin:U?.kind==="agent"?{kind:"agent",conversationId:U.conversationId}:{kind:"operator"},launchProfile:b,clientAttemptId:aw,requestDigest:c,...aB?{taskIds:aB}:{},launchDisplay:as,memberships:ap&&R?[{kind:"pipeline",containerId:ap.pipelineId,role:ap.role,slot:`adopt:${ap.stageId}:${c.slice(0,24)}`,stageId:ap.stageId,stageOrder:ap.stageOrder,round:null,parentConversationId:R,runtime:{engine:ac,model:b.model,effort:b.effort}}]:[]}),aG=(0,o.Ui)({cwd:aC,model:an.model,effort:ah.effort,fast:ah.fast,parentConversationId:Q,allowSubagents:!0===d.allowSubagents,mcpServers:al,plugins:ae,title:v,...az?{project:az}:{}}),aH=a=>{let b=d.accountId,c=(a instanceof Error?a.message:String(a)).slice(0,240),e=av.beginSpawnRequest(aD(b,aG,am(b)));if("conflict"===e.kind)return j.NextResponse.json({error:"spawn attempt conflicts with its original request"},{status:409});"created"===e.kind&&("structured"===f?av.failStructuredSpawn(e.receipt.launchId,c):av.failSpawn(e.receipt.launchId,c));let g=av.readOnlySnapshot().receipts[e.receipt.launchId]??e.receipt;return j.NextResponse.json((0,G.AU)(g,g.artifactPath,{structured:"structured"===f}))};if(ax&&void 0!==d.accountId&&ax.accountPin&&("failed"===ax.state||"conflicted"===ax.state))return aH(Error(ax.error??"the requested account is not available for this launch"));let aI="string"==typeof d.accountId?d.accountId:null,aJ=az??(0,W.hY)(aC);try{g=ax&&null!==ax.accountId&&!(ax.accountPin&&aI)?b.resolveSpawnAccount(ax.engine,ax.accountId):await b.resolveHealthySpawnAccount(ac,d.accountId,aJ,an.model)}catch(a){if(a instanceof X.Uq||a instanceof n.fu)return j.NextResponse.json({error:a.message},{status:409});if(void 0===d.accountId)throw a;if("claude"!==ac||!aI)return aH(a);try{let c=b.resolveSpawnAccount(ac,aI),d=await (b.resolvePinnedSpawnAdmission??S.jJ)(ac,c,an.model);if("retry-at"!==d.kind&&"admissible"!==d.kind)return aH(a);g={...c,admission:d,requestedAdmission:d}}catch{return aH(a)}}let aK=aI&&g.requestedAdmission?.kind==="retry-at"?g.requestedAdmission.retryAt:null,aL=aK?Date.parse(aK):NaN,aM=Number.isFinite(aL)&&aL>Date.now()?new Date(aL).toISOString():null;aM&&aI&&(g=b.resolveSpawnAccount(ac,aI));let aN=!!(aI&&!aM&&g.accountId!==aI),aO=am("string"==typeof d.accountId?d.accountId:g.accountId,aN||null!==aM),aP=aM?(0,S.X3)(aj(a)?"uk":"en",aM):null,aQ=aN?aj(a)?ai:ag:null,aR=(c=g,h=(0,p.lV)(ac,aC,{model:an.model,effort:ah.effort,fast:ah.fast,codexHome:"codex"===ac?c.home:null,claudeConfigDir:"claude"===ac?c.home:null,claudeProjectsDir:"claude"===ac?c.transcriptRoot:null,allowSubagents:!0===d.allowSubagents,mcpServers:al,deferClaudeSpawnPolicy:!0}),k="claude"===ac&&"structured"===f?(0,S.eK)(h.launchProfile?.permissionMode,{agentInitiated:O,operatorAuthenticated:U?.kind==="operator",roleSpawn:!!aa.value}):h.launchProfile?.permissionMode,{...h,launchProfile:(0,o.Ui)({...h.launchProfile??{},cwd:aC,parentConversationId:Q,allowSubagents:!0===d.allowSubagents,mcpServers:al,plugins:ae,permissionMode:k,title:aQ??v,...az?{project:az}:{}})}),aS=()=>{if("claude"!==ac||"tmux"!==f)return;let a=i().basename(aR.transcript??"",".jsonl");(0,l.fg)(g.home)&&(0,H.prepareManagedClaudeSpawnHome)(g.home,aC),(0,H.applyClaudeSpawnPolicy)(g.home,{allowSubagents:!0===d.allowSubagents,baseSettingsPath:(0,l.fg)(g.home)?(0,l.ZK)():null,profileId:a,cwd:aC,mcpServers:al,mcpStatePath:"managed"===g.kind?i().join(g.home,".claude.json"):i().join(i().dirname(g.home),".claude.json")})},aT=aN&&"string"==typeof d.accountId?d.accountId:g.accountId,aU=await (0,m.Cu)(async()=>{if(!ax&&aw){let b=(0,F.o)(aw);if(b){var a;if(b.requestDigest===(a=d,A(a)))throw new F.eO(b);throw new F.AO}}if(!ax){let a=b.resolveSpawnAccount(ac,g.accountId);if(a.accountId!==g.accountId||a.kind!==g.kind)throw Error("spawn account changed during admission")}return av.beginSpawnRequest(aD(aT,aR.launchProfile,aO,ax?.accountPin??void 0!==d.accountId))});if("conflict"===aU.kind)return j.NextResponse.json({error:"spawn attempt conflicts with its original request"},{status:409});"created"===aU.kind&&(aF=aU.receipt.launchId);let aV="created"===aU.kind&&aI&&g.accountId===aI?(0,af.u)({engine:ac,project:aJ,accountId:aI,conversationId:aU.receipt.conversationId??null,actor:U?.kind==="agent"?{kind:"agent",conversationId:U.conversationId}:{kind:"operator"},via:"launch"})??void 0:void 0,aW=a=>aV?{...a,accountOverride:aV}:a,aX=aU.receipt;if(aM&&aP&&aI){let c,d=aU.receipt.queuedPinnedSpawn;if(d)c=d.imageRefs;else try{c=b.storeImages(ar)}catch(a){throw new ak(a instanceof Error?a.message:String(a))}aX=av.queuePinnedSpawn(aU.receipt.launchId,{version:1,retryAt:aM,accountId:aI,locale:aj(a)?"uk":"en",spec:aR,prompt:aq,imageRefs:c,parentArtifactPath:V,pipelineSourceConversationId:R},aP)}let aY=(a,b,c)=>{if(!c||a.accountId===b)return;let d=av.readOnlySnapshot(),e=d.receipts[a.launchId];if(!e?.key||e.artifactPath!==c)return;let f=d.entries[(0,C.pp)(e.key)],g=d.conversations[e.conversationId];f&&g&&(av.reconcileConversations([{engine:e.engine,path:c,accountId:b,launchProfile:e.launchProfile,turn:{state:g.turn.state,source:g.turn.source,terminalAt:g.turn.terminalAt},expectedTurnObservedAt:g.turn.observedAt,observedAt:new Date().toISOString()}]),av.upsert({...f,accountId:b}))},aZ=async(a,c)=>{if(!R||!b.adoptPipelineAttemptFromSource)return;let d=av.readOnlySnapshot().receipts[a.launchId]??a;try{await b.adoptPipelineAttemptFromSource(R,{launchId:d.launchId,conversationId:d.conversationId,sessionId:d.key?.sessionId??null,agentPath:c,paneId:d.verifiedHost?.paneId??d.pane?.paneId??null,startedAt:d.createdAt,runtime:{engine:d.engine,model:d.launchProfile.model,effort:d.launchProfile.effort}})}catch(a){console.error("[spawn] pipeline attempt adoption failed",{launchId:d.launchId,conversationId:d.conversationId,sourceConversationId:R,error:a})}},a$=(a,c,d)=>{b.defer(async()=>{let f;try{f=await b.spawnStructuredConversation({engine:ac,receipt:a,spec:aR,account:g,prompt:aq,imageRefs:d,registry:av,client:c}),aY(a,g.accountId,f.path)}catch(b){console.error("[spawn] structured launch failed",{launchId:a.launchId,conversationId:a.conversationId,error:b}),b instanceof M.Hr&&av.failStructuredSpawn(a.launchId,`structured spawn transport failed: ${b.message}`.slice(0,240));return}if(V&&f.path)try{(0,K.A6)(f.path,V),(0,K.OA)()}catch(b){console.error("[spawn] handoff lineage persistence failed",{launchId:a.launchId,conversationId:a.conversationId,childArtifactPath:f.path,parentArtifactPath:V,error:b})}if(f.path&&await aZ(a,f.path),f.path&&e().existsSync(f.path))try{await b.publishFilesRevision?.(c)}catch(b){console.error("[spawn] transcript materialization refresh failed",{launchId:a.launchId,conversationId:a.conversationId,artifactPath:f.path,error:b})}})};if("replay"===aU.kind){let a,c=(0,q.Vt)(av.readOnlySnapshot()).isStructured(aX),d=aX,e=c?b.runtimeHostClient():null;if(e&&!aM){try{let b=await (0,S.reconcileStructuredSpawnReplay)(d.launchId,av,e);d=b,a=b.initialMessage}catch{}let c=av.claimStartingStructuredSpawn(d.launchId);if(d=c.receipt,c.claimed){let a;try{a=b.storeImages(ar)}catch(a){throw c.receipt.admissionOwner&&av.releaseStartingStructuredSpawn(d.launchId,c.receipt.admissionOwner),new ak(a instanceof Error?a.message:String(a))}a$(d,e,a)}}d.artifactPath&&(0,q.Vt)(av.readOnlySnapshot()).allowsReceipt(d,{structured:c})&&await aZ(d,d.artifactPath);let f=aW((0,G.AU)(d,d.artifactPath,{structured:c,initialMessage:aM?"queued":a}));return j.NextResponse.json(f,{status:(0,G.Xl)(f,c)})}if(aM){aS();let a=aX.admissionOwner?av.releaseSpawnActuation(aX.launchId,aX.admissionOwner).receipt:aX;return j.NextResponse.json(aW((0,G.AU)(a,a.artifactPath,{structured:"structured"===f,initialMessage:"queued"})),{status:202})}if(aS(),"structured"===f){let a,c=b.runtimeHostClient();if(!c)throw Error("structured spawn runtime host is unavailable");try{a=b.storeImages(ar)}catch(a){throw new ak(a instanceof Error?a.message:String(a))}return a$(aU.receipt,c,a),j.NextResponse.json(aW((0,G.AU)(aU.receipt,aU.receipt.artifactPath,{structured:!0})),{status:202})}let a_=(0,$.Am)(aq,ar);aE=a_.imagePaths;let a0=(0,P.Zn)()?b.runtimeHostClient():null,a1=a0?aU.receipt.launchId:null;if(a0&&a1)try{await a0.operation({scope:(0,N.zV)("operation",a1),kind:"spawn.intent",operationId:a1,producerKey:`viewer-spawn:${a1}`,payload:{engine:ac,cwd:aC,accountId:g.accountId,parentConversationId:Q}})}catch{console.warn("[runtime] spawn bookkeeping unavailable; continuing through the legacy spawn path"),a0=null}let a2=Date.now(),a3=await (b.spawnTmuxAgent??$.Tk)(aR,a_.payload,aU.receipt),a4=await (0,I.s)({engine:ac,knownTranscript:aR.transcript??null,panePid:a3.panePid??null,cwd:aC,startedAtMs:a2,codexSessionsDir:"codex"===ac?g.transcriptRoot:null}),a5=a4?(0,C.sz)(ac,a4):null;if(!a3.host||!await (0,$.PB)(a3.host)){(0,q.agentRegistry)().invalidateSpawnHost(aU.receipt.launchId,"spawn host disappeared before API confirmation");let a=(0,q.agentRegistry)().readOnlySnapshot().receipts[aU.receipt.launchId];return j.NextResponse.json(aW((0,G.AU)(a,a4)))}if(!a4||!a5||!a3.receipt){let a=(0,q.agentRegistry)().markSpawnPathPending(aU.receipt.launchId);return j.NextResponse.json(aW((0,G.AU)(a,null)))}let a6=(0,q.agentRegistry)().settleSpawn(a3.receipt.launchId,{key:a5,artifactPath:a4,cwd:aC,accountId:g.accountId,status:"starting",host:a3.host,claimEpoch:0,claimOwner:null,pendingAction:"spawn"});if("conflict"===a6.kind)return j.NextResponse.json(aW((0,G.AU)(a6.receipt)));if(aY(a6.receipt,g.accountId,a4),await aZ(a6.receipt,a4),a0&&a1)try{await a0.append({scope:(0,N.zV)("edge",a1),kind:"edge.created",producerKey:`viewer-spawn-edge:${a1}`,payload:{edge:"viewer_spawn",childConversationId:a6.conversation.id,parentConversationId:Q,operationId:a1}})}catch{console.warn("[runtime] spawned agent is healthy; lineage bookkeeping will reconcile later")}if(V&&(a4&&(0,K.A6)(a4,V),(0,K.OA)()),!await (0,$.PB)(a3.host)){(0,q.agentRegistry)().invalidateSpawnHost(aU.receipt.launchId,"spawn host disappeared before API response");let a=(0,q.agentRegistry)().readOnlySnapshot().receipts[aU.receipt.launchId];return j.NextResponse.json(aW((0,G.AU)(a,a4)))}return j.NextResponse.json(aW((0,G.AU)(a6.receipt,a4)))}catch(c){let a=aF?av.readOnlySnapshot().receipts[aF]:null;if(a&&null!==a.pane||(a&&av.failSpawn(a.launchId,"spawn failed before pane binding"),(0,$.IJ)(aE)),c instanceof D.eX||c instanceof E.sd)return j.NextResponse.json({error:c.message},{status:c.status});if(c instanceof F.AO)return j.NextResponse.json({error:c.message},{status:409});if(c instanceof F.eO)return j.NextResponse.json({error:c.fence.error,code:"spawn_admission_refused"},{status:c.fence.status});if(c instanceof F.Jc)return j.NextResponse.json((0,G.UH)(c),{status:403});if(c instanceof q.fr)return j.NextResponse.json({error:c.message},{status:429});if(c instanceof ak)return j.NextResponse.json({error:c.message},{status:503});if(c instanceof k.m1||c instanceof l.UV)return j.NextResponse.json({error:c.message},{status:400});let b=c instanceof ae.KP?j.NextResponse.json({error:c.message,retrySafe:!0},{status:503}):null;if(b)return b;if(a?.pane){("prompt-delivered"===a.state||"host-verified"===a.state)&&av.markSpawnPathPending(a.launchId);let b=av.readOnlySnapshot().receipts[a.launchId];if(b)return j.NextResponse.json((0,G.AU)(b,b.artifactPath))}return j.NextResponse.json({error:c instanceof Error?c.message:String(c)},{status:500})}}},92094:(a,b,c)=>{c.d(b,{AG:()=>q,Qf:()=>s,Xi:()=>r});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(91724),i=c(13117),j=c(52509),k=c(70107);let l=["project-catalog.json","worktree-map.json"],m=(0,j.E)("project-directories-v2");function n(a){try{let b=JSON.parse(e().readFileSync(a,"utf8"));return b&&"object"==typeof b&&!Array.isArray(b)?b:null}catch{return null}}function o(a,b,c){if(!(!a||"object"!=typeof a||Array.isArray(a)))for(let d of b){let b=a[d];"string"==typeof b&&b.trim()&&c.add(b)}}function p(){let a=(0,h.Pn)(),b=function(a){let b=l.map(b=>{let c=g().join(a,b);try{let a=e().statSync(c);return`${b}:${a.dev}:${a.ino}:${a.size}:${a.mtimeMs}:${a.ctimeMs}`}catch{return`${b}:missing`}}),c=g().join(a,"state.sqlite");for(let[d,f]of[["flows","flows.json"],["pipelines","pipelines.json"],["workflows","workflows.json"]]){let h=(0,i.jY)(c,d);if(null!==h)b.push(`${d}:sqlite:${h}`);else{let c=g().join(a,f);try{let a=e().statSync(c);b.push(`${f}:${a.dev}:${a.ino}:${a.size}:${a.mtimeMs}:${a.ctimeMs}`)}catch{b.push(`${f}:missing`)}}}return b.join("|")}(a),c=m.get(a);if(c&&c.expiresAt>Date.now()&&c.stateIdentity===b)return c.directories;let d=[],f=new Set;for(let b of function(a){let b=new Set,c=n(g().join(a,"project-catalog.json"))?.files;if(c&&"object"==typeof c&&!Array.isArray(c))for(let a of Object.values(c))o(a,["cwd","projectRoot"],b);let d=g().join(a,"state.sqlite");for(let[c,e,f]of[["flows.json","flows",["cwd"]],["pipelines.json","pipelines",["repoDir","worktreeDir"]],["workflows.json","workflows",["repoDir","worktreeDir"]]]){let h=(0,i.Vx)(d,e)??n(g().join(a,c))?.[e];if(Array.isArray(h))for(let a of h)o(a,f,b)}let e=n(g().join(a,"worktree-map.json"));if(e)for(let[a,c]of Object.entries(e))b.add(a),o(c,["repo"],b);return[...b]}(a)){try{if(!e().statSync(b).isDirectory())continue}catch{continue}let a=(0,k.hY)(b),c=(0,k.D$)(b)??(a?.startsWith("dir-")?b:void 0),g=a?`${a}\0${b}`:"";!a||!c||f.has(g)||(f.add(g),d.push({cwd:b,project:a,projectRoot:c}))}return m.set(a,{directories:d,expiresAt:Date.now()+1e4,stateIdentity:b}),d}function q(a=40){let b=[];for(let c of p())if(!b.includes(c.projectRoot)&&(b.push(c.projectRoot),b.length>=a))break;return b}function r(a,b=10){return a?p().filter(b=>b.project===a).slice(0,b).map(a=>a.cwd):[]}function s(a){let b=new Set([...a].filter(Boolean)),c={};for(let a of p())b.has(a.project)&&!c[a.project]&&(c[a.project]=a.projectRoot);return c}}};
|
|
1
|
+
"use strict";exports.id=7722,exports.ids=[7722],exports.modules={11831:(a,b,c)=>{c.d(b,{AU:()=>g,UH:()=>e,Xl:()=>f});var d=c(10781);function e(a){return{error:a.rejection.guidance,code:a.rejection.code,launchId:a.receipt.launchId,conversationId:a.receipt.conversationId,rejection:a.rejection}}function f(a,b){return"starting"===a.state||b&&"path-pending"===a.state?202:200}function g(a,b=a.artifactPath,c={}){let e="structured"===a.transport||null===a.transport&&!0===c.structured,f=(null!==a.verifiedHost||!0===c.structured&&"completed"===a.state)&&"failed"!==a.state&&"conflicted"!==a.state,h=(0,d.Vt)().allowsReceipt(a,{structured:e})?b:null;return{ok:!0,target:a.pane?.paneId??a.target??null,path:h,...e&&"claude"===a.engine?{effectivePermissionMode:a.launchProfile.permissionMode??"default"}:{},launchId:a.launchId,conversationId:a.conversationId,parent:a.parentConversationId?{conversationId:a.parentConversationId,source:a.parentSource}:null,launched:f,retrySafe:"failed"===a.state,initialMessage:c.initialMessage??("failed"===a.state||"conflicted"===a.state?"failed":"completed"===a.state||"prompt-delivered"===a.state?"delivered":e&&"path-pending"===a.state?"queued":"pending"),...a.error?{error:a.error}:{},state:"conflicted"===a.state?"conflict":"failed"===a.state?"failed":"starting"===a.state||"pane-bound"===a.state?"starting":"host-verified"===a.state||"prompt-delivered"===a.state||"path-pending"===a.state?"path-pending":"settled",transport:e?"structured":"tmux"}}},67722:(a,b,c)=>{c.r(b),c.d(b,{executeSpawnRequest:()=>aq,fenceSpawnAdmissionRejection:()=>an,productionSpawnCommandDependencies:()=>am,spawnSuggestions:()=>ap});var d=c(73024),e=c.n(d),f=c(48161),g=c.n(f),h=c(76760),i=c.n(h),j=c(23211),k=c(41617),l=c(78966),m=c(22962),n=c(26926),o=c(74382),p=c(14509),q=c(10781),r=c(58152),s=c(10230),t=c(61971),u=c(4837),v=c(33302),w=c(38840),x=c(8034),y=c(21241),z=c(77598),A=c.n(z);function B(a){return A().createHash("sha256").update(JSON.stringify(a)).digest("hex")}function C(a){return"string"==typeof a.parentConversationId?{conversationId:a.parentConversationId}:"string"==typeof a.parent?{path:a.parent}:"string"==typeof a.src?{path:a.src}:null}var D=c(48892),E=c(94896),F=c(29857),G=c(79511),H=c(11831),I=c(4012),J=c(42087),K=c(16089),L=c(26474),M=c(35961),N=c(3127),O=c(63629),P=c(68512),Q=c(50201),R=c(32372),S=c(41022),T=c(45656),U=c(43384),V=c(48289),W=c(36917),X=c(70107),Y=c(60517),Z=c(92094),$=c(30795),_=c(3743),aa=c(57563),ab=c(77308),ac=c(62318);let ad={transcriptAllowed:E.FK,readCwd:a=>(0,K.tX)(a),isDirectory:a=>{try{return e().statSync(a).isDirectory()}catch{return!1}}};var ae=c(3359),af=c(5602),ag=c(11064);let ah=aa.en["spawnCard.pinUnavailableFallback"],ai=ab.uk["spawnCard.pinUnavailableFallback"],aj="string"==typeof ai?ai:ah;function ak(a){let b=a.headers.get("accept-language")?.trim().toLowerCase()??"";return"uk"===b||b.startsWith("uk-")}class al extends Error{}let am={registry:q.agentRegistry,resolveHealthySpawnAccount:n.ax,resolveSpawnAccount:(a,b)=>n.accountManager.resolveSpawn(a,b),resolvePinnedSpawnAdmission:T.jJ,runtimeHostClient:N.sS,publishFilesRevision:P.G,spawnStructuredConversation:T.sh,assertStructuredRuntime:y.x_,defer:a=>(0,j.after)(a),storeImages:a=>(0,R.PF)().putMany(a),adoptPipelineAttemptFromSource:V.F_,pipelineAttemptTargetForSource:V.RO,recordOperatorActivity:ac.d,engineReadiness:(a,b)=>"claude"===a||"codex"===a?(0,x.h2)(a,b):"connected"};function an(a,b,c,d){let e="string"==typeof a.clientAttemptId?a.clientAttemptId:null;if(!e||!/^[A-Za-z0-9_-]{8,128}$/.test(e))return null;try{return(0,G.L8)({clientAttemptId:e,requestDigest:B(a),status:b,error:c},()=>d.registry().spawnReceiptForClientAttempt(e))}catch{return null}}function ao(a,b,c){!b||a.includes(b)||c&&(0,X.hY)(b)!==c||a.push(b)}async function ap(a){let b=a.nextUrl.searchParams.get("project")??"",{cwd:c,cwdExists:d}=function(a,b=ad){if(!a||!b.transcriptAllowed(a))return{cwd:null,cwdExists:!1};let c=b.readCwd(a);return{cwd:c,cwdExists:!!(c&&b.isDirectory(c))}}(a.nextUrl.searchParams.get("src")),e=(await (0,W.CS)()).filter(a=>a.path.endsWith(".jsonl")&&("claude-projects"===a.root||"codex-sessions"===a.root)).filter(a=>!a.path.includes(i().sep+"subagents"+i().sep)).sort((a,c)=>Number(c.project===b)-Number(a.project===b)||c.mtime-a.mtime).slice(0,80),f=c?[c]:[];if(!c)for(let a of(0,Z.Xi)(b,10))ao(f,a,b);for(let a of e){if(f.length>=10)break;b&&a.project!==b||ao(f,(0,K.tX)(a.path,{requireDir:!0}),b)}f.length||f.push(g().homedir());let h=(0,U.l)();return j.NextResponse.json({dirs:f,cwd:c,cwdExists:d,spawnTransport:h,imageInput:{claude:(0,R.ki)("claude","structured"===h),codex:(0,R.ki)("codex","structured"===h&&(0,u.JL)(null))}})}async function aq(a,b=am){var c;let d,f,h,y=(0,M.W)(a);if(y)return y;try{d=await a.json()}catch{return j.NextResponse.json({error:"invalid JSON"},{status:400})}let z=(0,s.t3)(d.mcpServers);if(!z.ok)return j.NextResponse.json({error:z.error},{status:400});let A=void 0===d.mcpServers?null:z.value,K=(0,t.jh)(d.plugins);if(!K.ok)return j.NextResponse.json({error:K.error},{status:400});let P=(0,ae.s0)(a),R=null,V=null,W=null;if(P)try{R=b.registry();let c=(0,ae.X0)(a,d.src,R);"error"in c?W=c:V=c}catch(a){W={error:a instanceof Error?a.message:String(a),status:503}}let Z=a=>(W||an(d,400,a,b),j.NextResponse.json({error:a},{status:400})),aa=(0,ae.QD)(a,d);if(aa)return Z(aa);if(void 0!==d.allowSubagents&&"boolean"!=typeof d.allowSubagents)return j.NextResponse.json({error:"allowSubagents must be a boolean"},{status:400});let ab=(0,w.s8)(d);if(!ab.ok)return Z(ab.error);let ac=(0,ae.Fk)(ab.value?.role??null,d);if(ac)return Z(ac);if(ab.value&&(0,G.n4)(ab.value.role)&&!0===d.allowSubagents)return j.NextResponse.json({error:`${ab.value.role} launches cannot enable subagents: reviewer and verifier sessions run every check in-session`},{status:400});let ad="claude"===d.engine||"codex"===d.engine?d.engine:ab.value?.config.engine??null;if(!ad)return j.NextResponse.json({error:"engine must be claude or codex"},{status:400});let ai=ab.value&&("claude"===ad||"codex"===ad)?b.engineReadiness?.(ad,"string"==typeof d.project?d.project:null)??"connected":"connected";if(ab.value&&("claude"===ad||"codex"===ad)&&"connected"!==ai){let a={role:ab.value.role,engine:ad,reason:ai},c=(0,x._N)(a);return W||an(d,409,c,b),j.NextResponse.json({error:c,code:x.Bw,details:(0,x.vg)(a)},{status:409})}if(void 0!==d.accountId&&"string"!=typeof d.accountId)return j.NextResponse.json({error:"accountId must be a string"},{status:400});if(void 0!==d.clientAttemptId&&("string"!=typeof d.clientAttemptId||!/^[A-Za-z0-9_-]{8,128}$/.test(d.clientAttemptId)))return j.NextResponse.json({error:"clientAttemptId must be 8-128 URL-safe characters"},{status:400});let ao=(0,r.BL)(ad,{...d,model:d.model??ab.value?.config.model??(0,u.Gh)(ad),effort:void 0===d.effort?ab.value?.config.effort:d.effort});if(ao.error)return j.NextResponse.json({error:ao.error},{status:400});let ap=(0,u.wi)({model:void 0===d.model?ab.value?.config.model:d.model});if(ap.error)return j.NextResponse.json({error:ap.error},{status:400});if(void 0!==d.model&&null!==d.model&&ap.model){let a=(0,u.RC)(ad,ap.model);if("error"in a)return j.NextResponse.json({error:a.error},{status:400})}let ar="string"==typeof d.prompt?d.prompt.trim():"",as=ab.value?[ab.value.scaffold,ar].filter(Boolean).join("\n\n"):ar,{images:at,error:au}=(0,_.Fu)(d);if(au)return j.NextResponse.json({error:au.error},{status:au.status});let av=void 0===d.title?null:(0,$.St)("string"==typeof d.title?d.title:null,120);if(void 0!==d.title&&!av)return j.NextResponse.json({error:"title must be a semantic, non-placeholder string"},{status:400});let aw=(0,$.V0)(ar,60)?(0,$.bF)(ab.value?.role??ad,ar):null;try{f=(0,U.l)()}catch(a){return j.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:500})}if("structured"===f){try{b.assertStructuredRuntime()}catch(a){return j.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:503})}let a=(0,U.H)({engine:ad,model:ap.model,hasImages:at.length>0,fast:ao.fast});if(a)return j.NextResponse.json({error:a},{status:409});try{(0,S.h1)(as)}catch(a){return j.NextResponse.json({error:a instanceof Error?a.message:String(a)},{status:413})}}let ax=R??b.registry(),ay="string"==typeof d.clientAttemptId?d.clientAttemptId:null,az=ay?ax.spawnReceiptForClientAttempt(ay):null;if(!av&&!az)return j.NextResponse.json({error:$.QE},{status:400});let aA=av??aw??(0,$.St)(az?.launchProfile.title,120);if(!aA)return j.NextResponse.json({error:$.QE},{status:400});if(P&&W)return j.NextResponse.json({error:W.error},{status:W.status??403});if(P&&!0===d.allowSubagents&&V?.kind!=="operator")return j.NextResponse.json({error:"allowSubagents requires an authenticated Viewer operator spawn"},{status:403});let aB=null;if(void 0!==d.project&&null!==d.project){if(!(aB="string"==typeof d.project?(0,o.QK)(d.project):null))return j.NextResponse.json({error:"project must be a valid project key"},{status:400});if(P&&V?.kind!=="operator")return j.NextResponse.json({error:"explicit project requires an authenticated Viewer operator spawn"},{status:403})}let aC=null;if(void 0!==d.supersedes&&null!==d.supersedes){if("string"!=typeof d.supersedes||!d.supersedes.trim())return j.NextResponse.json({error:"supersedes must name a conversation id or transcript path"},{status:400});let a=d.supersedes.trim(),b=a.startsWith("conversation_")?ax.conversation(a):ax.conversationForPath(a);if(!b)return j.NextResponse.json({error:"supersedes does not resolve to a known conversation"},{status:404});let c=ax.supersedenceConflict(b.id);if(c)return j.NextResponse.json({error:`supersedes conflicts with the live conversation ${c}`,successorConversationId:c},{status:409});aC=b.id}let aD="string"==typeof d.cwd?d.cwd.trim():"";if(!aD)return j.NextResponse.json({error:"working directory is required"},{status:400});let aE=i().resolve("~"===aD||aD.startsWith("~/")?i().join(g().homedir(),aD.slice(1)):aD);try{h=e().statSync(aE)}catch{return j.NextResponse.json({error:`directory does not exist: ${aE}`},{status:400})}if(!h.isDirectory())return j.NextResponse.json({error:`not a directory: ${aE}`},{status:400});let aF=(0,v.kg)(a).ok;if(aF&&!ay)return j.NextResponse.json({error:"clientAttemptId is required for direct operator spawn"},{status:400});if(aF){let a=aB??(0,X.hY)(aE);if(!a)return j.NextResponse.json({error:"project could not be resolved for direct operator spawn"},{status:400});try{b.recordOperatorActivity?.({idempotencyKey:`spawn:${ay}`,resolvedAttribution:{engine:ad,project:a}})}catch{return j.NextResponse.json({error:"direct operator activity could not be recorded"},{status:503})}}let aG=[],aH=null;try{let g,h,k,r=void 0===d.title||av===aw,u=az?.identityWaveTitleBackfill===!0&&r,v=u?(0,$.St)(az.launchProfile.title,120)??aA:aA,w=(0,E.bs)((0,ae.qe)(V,{...d,role:ab.value?.role}),ax),x=w.parent,y=w.reviewed?.conversationId??null;if(P&&V?.kind==="agent"&&!x)return j.NextResponse.json({error:ae.HJ},{status:400});let z=V?.kind==="agent"?"string"==typeof d.src&&!!d.src.trim():"string"==typeof d.src&&!!d.src.trim()||"string"==typeof d.parent&&!!d.parent.trim()||void 0!==d.parentConversationId||"string"==typeof d.reviews&&!!d.reviews.trim(),F=x?z?"explicit":"inferred-caller":null,M=x?.conversationId??null,R="string"==typeof d.src&&d.src.trim()?M:null,S=x?.sessionKey??null,U=x?.artifactPath??null,W=(0,t.GU)({origin:{kind:V?.kind==="agent"?"agent":"operator"},parentConversationId:M,agentRole:ab.value?.role??null}),Z=b.internalGrant?.()??null,aa=Z?.sessionClass===s.Vv?Z:null,ac=aa?[...t.sN]:(0,t.wE)({engine:ad,origin:W,requested:K.value}),af=aa?(0,s.c1)(aa.mcpServers):(0,s.Mt)({origin:W,requested:A}),ai=(a,b=!1)=>{var c;let e,f=(c={engine:ad,cwd:aE,model:ap.model,effort:ao.effort,fast:ao.fast,accountId:a,role:ab.value?.role??null,title:aA,mcpServers:af,...ac.length?{plugins:ac}:{},...!0===d.allowSubagents?{allowSubagents:!0}:{},...aB?{project:aB}:{},parent:C({parentConversationId:M??void 0}),...y?{reviews:C({parentConversationId:y})}:{},...aC?{supersedes:C({parentConversationId:aC})}:{},prompt:as,images:at.map(a=>{var b;return{mime:a.mime,digest:(b={image:a.base64},B(b))}})},e=Object.fromEntries(Object.entries(c).filter(([a])=>"title"!==a)),{current:B(c),withoutTitle:B(e)});if(u||b&&az)return az.requestDigest===f.current?f.current:f.withoutTitle;let g=(0,$.St)(az?.launchProfile.title,120);return az&&g&&g!==aA||az?.requestDigest===f.current?f.current:f.withoutTitle},am=R&&b.pipelineAttemptTargetForSource?b.pipelineAttemptTargetForSource(R):null,an=!aa&&(ar.trim()||at.length)?{prompt:ar,images:at.length,echo:as}:null,aq="string"==typeof d.taskId&&d.taskId.trim()?[d.taskId.trim()]:null,au=(a,b,c,e=void 0!==d.accountId)=>({engine:ad,cwd:aE,transport:f,accountId:a,accountPin:e,parentConversationId:M,parentSource:F,parentSessionKey:S,parentArtifactPath:U,role:ab.value?.role??null,reviewsConversationId:y,explicitProject:aB,supersedes:aC,supersedesReason:"recovery-spawn",liveChildrenCap:V?.liveChildrenCap,origin:V?.kind==="agent"?{kind:"agent",conversationId:V.conversationId}:{kind:"operator"},launchProfile:b,clientAttemptId:ay,requestDigest:c,...aq?{taskIds:aq}:{},launchDisplay:an,memberships:am&&R?[{kind:"pipeline",containerId:am.pipelineId,role:am.role,slot:`adopt:${am.stageId}:${c.slice(0,24)}`,stageId:am.stageId,stageOrder:am.stageOrder,round:null,parentConversationId:R,runtime:{engine:ad,model:b.model,effort:b.effort}}]:[]}),aD=(0,o.Ui)({cwd:aE,model:ap.model,effort:ao.effort,fast:ao.fast,parentConversationId:M,allowSubagents:!0===d.allowSubagents,mcpServers:af,plugins:ac,title:v,...aB?{project:aB}:{}}),aF=a=>{let b=d.accountId,c=(a instanceof Error?a.message:String(a)).slice(0,240),e=ax.beginSpawnRequest(au(b,aD,ai(b)));if("conflict"===e.kind)return j.NextResponse.json({error:"spawn attempt conflicts with its original request"},{status:409});"created"===e.kind&&("structured"===f?ax.failStructuredSpawn(e.receipt.launchId,c):ax.failSpawn(e.receipt.launchId,c));let g=ax.readOnlySnapshot().receipts[e.receipt.launchId]??e.receipt;return j.NextResponse.json((0,H.AU)(g,g.artifactPath,{structured:"structured"===f}))};if(az&&void 0!==d.accountId&&az.accountPin&&("failed"===az.state||"conflicted"===az.state))return aF(Error(az.error??"the requested account is not available for this launch"));let aI="string"==typeof d.accountId?d.accountId:null,aJ=aB??(0,X.hY)(aE);try{g=az&&null!==az.accountId&&!(az.accountPin&&aI)?b.resolveSpawnAccount(az.engine,az.accountId):await b.resolveHealthySpawnAccount(ad,d.accountId,aJ,ap.model)}catch(a){if(a instanceof Y.Uq||a instanceof n.fu)return j.NextResponse.json({error:a.message},{status:409});if(void 0===d.accountId)throw a;if("claude"!==ad||!aI)return aF(a);try{let c=b.resolveSpawnAccount(ad,aI),d=await (b.resolvePinnedSpawnAdmission??T.jJ)(ad,c,ap.model);if("retry-at"!==d.kind&&"admissible"!==d.kind)return aF(a);g={...c,admission:d,requestedAdmission:d}}catch{return aF(a)}}let aK=aI&&g.requestedAdmission?.kind==="retry-at"?g.requestedAdmission.retryAt:null,aL=aK?Date.parse(aK):NaN,aM=Number.isFinite(aL)&&aL>Date.now()?new Date(aL).toISOString():null;aM&&aI&&(g=b.resolveSpawnAccount(ad,aI));let aN=!!(aI&&!aM&&g.accountId!==aI),aO=ai("string"==typeof d.accountId?d.accountId:g.accountId,aN||null!==aM),aP=aM?(0,T.X3)(ak(a)?"uk":"en",aM):null,aQ=aN?ak(a)?aj:ah:null,aR=(c=g,h=(0,p.lV)(ad,aE,{model:ap.model,effort:ao.effort,fast:ao.fast,codexHome:"codex"===ad?c.home:null,claudeConfigDir:"claude"===ad?c.home:null,claudeProjectsDir:"claude"===ad?c.transcriptRoot:null,allowSubagents:!0===d.allowSubagents,mcpServers:af,deferClaudeSpawnPolicy:!0}),k="claude"===ad&&"structured"===f?(0,T.eK)(h.launchProfile?.permissionMode,{agentInitiated:P,operatorAuthenticated:V?.kind==="operator",roleSpawn:!!ab.value}):h.launchProfile?.permissionMode,{...h,launchProfile:(0,o.Ui)({...h.launchProfile??{},cwd:aE,parentConversationId:M,allowSubagents:!0===d.allowSubagents,mcpServers:af,plugins:ac,permissionMode:k,title:aQ??v,...aB?{project:aB}:{}})}),aS=()=>{if("claude"!==ad||"tmux"!==f)return;let a=i().basename(aR.transcript??"",".jsonl");(0,l.fg)(g.home)&&(0,I.prepareManagedClaudeSpawnHome)(g.home,aE),(0,I.applyClaudeSpawnPolicy)(g.home,{allowSubagents:!0===d.allowSubagents,baseSettingsPath:(0,l.fg)(g.home)?(0,l.ZK)():null,profileId:a,cwd:aE,mcpServers:af,mcpStatePath:"managed"===g.kind?i().join(g.home,".claude.json"):i().join(i().dirname(g.home),".claude.json")})},aT=aN&&"string"==typeof d.accountId?d.accountId:g.accountId,aU=await (0,m.Cu)(async()=>{if(!az&&ay){let b=(0,G.o)(ay);if(b){var a;if(b.requestDigest===(a=d,B(a)))throw new G.eO(b);throw new G.AO}}if(!az){let a=b.resolveSpawnAccount(ad,g.accountId);if(a.accountId!==g.accountId||a.kind!==g.kind)throw Error("spawn account changed during admission")}return ax.beginSpawnRequest(au(aT,aR.launchProfile,aO,az?.accountPin??void 0!==d.accountId))});if("conflict"===aU.kind)return j.NextResponse.json({error:"spawn attempt conflicts with its original request"},{status:409});"created"===aU.kind&&(aH=aU.receipt.launchId);let aV="created"===aU.kind&&aI&&g.accountId===aI?(0,ag.u)({engine:ad,project:aJ,accountId:aI,conversationId:aU.receipt.conversationId??null,actor:V?.kind==="agent"?{kind:"agent",conversationId:V.conversationId}:{kind:"operator"},via:"launch"})??void 0:void 0,aW=a=>aV?{...a,accountOverride:aV}:a,aX=aU.receipt;if(aM&&aP&&aI){let c,d=aU.receipt.queuedPinnedSpawn;if(d)c=d.imageRefs;else try{c=b.storeImages(at)}catch(a){throw new al(a instanceof Error?a.message:String(a))}aX=ax.queuePinnedSpawn(aU.receipt.launchId,{version:1,retryAt:aM,accountId:aI,locale:ak(a)?"uk":"en",spec:aR,prompt:as,imageRefs:c,parentArtifactPath:U,pipelineSourceConversationId:R},aP)}let aY=(a,b,c)=>{if(!c||a.accountId===b)return;let d=ax.readOnlySnapshot(),e=d.receipts[a.launchId];if(!e?.key||e.artifactPath!==c)return;let f=d.entries[(0,D.pp)(e.key)],g=d.conversations[e.conversationId];f&&g&&(ax.reconcileConversations([{engine:e.engine,path:c,accountId:b,launchProfile:e.launchProfile,turn:{state:g.turn.state,source:g.turn.source,terminalAt:g.turn.terminalAt},expectedTurnObservedAt:g.turn.observedAt,observedAt:new Date().toISOString()}]),ax.upsert({...f,accountId:b}))},aZ=async(a,c)=>{if(!R||!b.adoptPipelineAttemptFromSource)return;let d=ax.readOnlySnapshot().receipts[a.launchId]??a;try{await b.adoptPipelineAttemptFromSource(R,{launchId:d.launchId,conversationId:d.conversationId,sessionId:d.key?.sessionId??null,agentPath:c,paneId:d.verifiedHost?.paneId??d.pane?.paneId??null,startedAt:d.createdAt,runtime:{engine:d.engine,model:d.launchProfile.model,effort:d.launchProfile.effort}})}catch(a){console.error("[spawn] pipeline attempt adoption failed",{launchId:d.launchId,conversationId:d.conversationId,sourceConversationId:R,error:a})}},a$=(a,c,d)=>{b.defer(async()=>{let f;try{f=await b.spawnStructuredConversation({engine:ad,receipt:a,spec:aR,account:g,prompt:as,imageRefs:d,registry:ax,client:c}),aY(a,g.accountId,f.path)}catch(b){console.error("[spawn] structured launch failed",{launchId:a.launchId,conversationId:a.conversationId,error:b}),b instanceof N.Hr&&ax.failStructuredSpawn(a.launchId,`structured spawn transport failed: ${b.message}`.slice(0,240));return}if(U&&f.path)try{(0,L.A6)(f.path,U),(0,L.OA)()}catch(b){console.error("[spawn] handoff lineage persistence failed",{launchId:a.launchId,conversationId:a.conversationId,childArtifactPath:f.path,parentArtifactPath:U,error:b})}if(f.path&&await aZ(a,f.path),f.path&&e().existsSync(f.path))try{await b.publishFilesRevision?.(c)}catch(b){console.error("[spawn] transcript materialization refresh failed",{launchId:a.launchId,conversationId:a.conversationId,artifactPath:f.path,error:b})}})};if("replay"===aU.kind){let a,c=(0,q.Vt)(ax.readOnlySnapshot()).isStructured(aX),d=aX,e=c?b.runtimeHostClient():null;if(e&&!aM){try{let b=await (0,T.reconcileStructuredSpawnReplay)(d.launchId,ax,e);d=b,a=b.initialMessage}catch{}let c=ax.claimStartingStructuredSpawn(d.launchId);if(d=c.receipt,c.claimed){let a;try{a=b.storeImages(at)}catch(a){throw c.receipt.admissionOwner&&ax.releaseStartingStructuredSpawn(d.launchId,c.receipt.admissionOwner),new al(a instanceof Error?a.message:String(a))}a$(d,e,a)}}d.artifactPath&&(0,q.Vt)(ax.readOnlySnapshot()).allowsReceipt(d,{structured:c})&&await aZ(d,d.artifactPath);let f=aW((0,H.AU)(d,d.artifactPath,{structured:c,initialMessage:aM?"queued":a}));return j.NextResponse.json(f,{status:(0,H.Xl)(f,c)})}if(aM){aS();let a=aX.admissionOwner?ax.releaseSpawnActuation(aX.launchId,aX.admissionOwner).receipt:aX;return j.NextResponse.json(aW((0,H.AU)(a,a.artifactPath,{structured:"structured"===f,initialMessage:"queued"})),{status:202})}if(aS(),"structured"===f){let a,c=b.runtimeHostClient();if(!c)throw Error("structured spawn runtime host is unavailable");try{a=b.storeImages(at)}catch(a){throw new al(a instanceof Error?a.message:String(a))}return a$(aU.receipt,c,a),j.NextResponse.json(aW((0,H.AU)(aU.receipt,aU.receipt.artifactPath,{structured:!0})),{status:202})}let a_=(0,_.Am)(as,at);aG=a_.imagePaths;let a0=(0,Q.Zn)()?b.runtimeHostClient():null,a1=a0?aU.receipt.launchId:null;if(a0&&a1)try{await a0.operation({scope:(0,O.zV)("operation",a1),kind:"spawn.intent",operationId:a1,producerKey:`viewer-spawn:${a1}`,payload:{engine:ad,cwd:aE,accountId:g.accountId,parentConversationId:M}})}catch{console.warn("[runtime] spawn bookkeeping unavailable; continuing through the legacy spawn path"),a0=null}let a2=Date.now(),a3=await (b.spawnTmuxAgent??_.Tk)(aR,a_.payload,aU.receipt),a4=await (0,J.s)({engine:ad,knownTranscript:aR.transcript??null,panePid:a3.panePid??null,cwd:aE,startedAtMs:a2,codexSessionsDir:"codex"===ad?g.transcriptRoot:null}),a5=a4?(0,D.sz)(ad,a4):null;if(!a3.host||!await (0,_.PB)(a3.host)){(0,q.agentRegistry)().invalidateSpawnHost(aU.receipt.launchId,"spawn host disappeared before API confirmation");let a=(0,q.agentRegistry)().readOnlySnapshot().receipts[aU.receipt.launchId];return j.NextResponse.json(aW((0,H.AU)(a,a4)))}if(!a4||!a5||!a3.receipt){let a=(0,q.agentRegistry)().markSpawnPathPending(aU.receipt.launchId);return j.NextResponse.json(aW((0,H.AU)(a,null)))}let a6=(0,q.agentRegistry)().settleSpawn(a3.receipt.launchId,{key:a5,artifactPath:a4,cwd:aE,accountId:g.accountId,status:"starting",host:a3.host,claimEpoch:0,claimOwner:null,pendingAction:"spawn"});if("conflict"===a6.kind)return j.NextResponse.json(aW((0,H.AU)(a6.receipt)));if(aY(a6.receipt,g.accountId,a4),await aZ(a6.receipt,a4),a0&&a1)try{await a0.append({scope:(0,O.zV)("edge",a1),kind:"edge.created",producerKey:`viewer-spawn-edge:${a1}`,payload:{edge:"viewer_spawn",childConversationId:a6.conversation.id,parentConversationId:M,operationId:a1}})}catch{console.warn("[runtime] spawned agent is healthy; lineage bookkeeping will reconcile later")}if(U&&(a4&&(0,L.A6)(a4,U),(0,L.OA)()),!await (0,_.PB)(a3.host)){(0,q.agentRegistry)().invalidateSpawnHost(aU.receipt.launchId,"spawn host disappeared before API response");let a=(0,q.agentRegistry)().readOnlySnapshot().receipts[aU.receipt.launchId];return j.NextResponse.json(aW((0,H.AU)(a,a4)))}return j.NextResponse.json(aW((0,H.AU)(a6.receipt,a4)))}catch(c){let a=aH?ax.readOnlySnapshot().receipts[aH]:null;if(a&&null!==a.pane||(a&&ax.failSpawn(a.launchId,"spawn failed before pane binding"),(0,_.IJ)(aG)),c instanceof E.eX||c instanceof F.sd)return j.NextResponse.json({error:c.message},{status:c.status});if(c instanceof G.AO)return j.NextResponse.json({error:c.message},{status:409});if(c instanceof G.eO)return j.NextResponse.json({error:c.fence.error,code:"spawn_admission_refused"},{status:c.fence.status});if(c instanceof G.Jc)return j.NextResponse.json((0,H.UH)(c),{status:403});if(c instanceof q.fr)return j.NextResponse.json({error:c.message},{status:429});if(c instanceof al)return j.NextResponse.json({error:c.message},{status:503});if(c instanceof k.m1||c instanceof l.UV)return j.NextResponse.json({error:c.message},{status:400});let b=c instanceof af.KP?j.NextResponse.json({error:c.message,retrySafe:!0},{status:503}):null;if(b)return b;if(a?.pane){("prompt-delivered"===a.state||"host-verified"===a.state)&&ax.markSpawnPathPending(a.launchId);let b=ax.readOnlySnapshot().receipts[a.launchId];if(b)return j.NextResponse.json((0,H.AU)(b,b.artifactPath))}return j.NextResponse.json({error:c instanceof Error?c.message:String(c)},{status:500})}}},92094:(a,b,c)=>{c.d(b,{AG:()=>q,Qf:()=>s,Xi:()=>r});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(91724),i=c(13117),j=c(52509),k=c(70107);let l=["project-catalog.json","worktree-map.json"],m=(0,j.E)("project-directories-v2");function n(a){try{let b=JSON.parse(e().readFileSync(a,"utf8"));return b&&"object"==typeof b&&!Array.isArray(b)?b:null}catch{return null}}function o(a,b,c){if(!(!a||"object"!=typeof a||Array.isArray(a)))for(let d of b){let b=a[d];"string"==typeof b&&b.trim()&&c.add(b)}}function p(){let a=(0,h.Pn)(),b=function(a){let b=l.map(b=>{let c=g().join(a,b);try{let a=e().statSync(c);return`${b}:${a.dev}:${a.ino}:${a.size}:${a.mtimeMs}:${a.ctimeMs}`}catch{return`${b}:missing`}}),c=g().join(a,"state.sqlite");for(let[d,f]of[["flows","flows.json"],["pipelines","pipelines.json"],["workflows","workflows.json"]]){let h=(0,i.jY)(c,d);if(null!==h)b.push(`${d}:sqlite:${h}`);else{let c=g().join(a,f);try{let a=e().statSync(c);b.push(`${f}:${a.dev}:${a.ino}:${a.size}:${a.mtimeMs}:${a.ctimeMs}`)}catch{b.push(`${f}:missing`)}}}return b.join("|")}(a),c=m.get(a);if(c&&c.expiresAt>Date.now()&&c.stateIdentity===b)return c.directories;let d=[],f=new Set;for(let b of function(a){let b=new Set,c=n(g().join(a,"project-catalog.json"))?.files;if(c&&"object"==typeof c&&!Array.isArray(c))for(let a of Object.values(c))o(a,["cwd","projectRoot"],b);let d=g().join(a,"state.sqlite");for(let[c,e,f]of[["flows.json","flows",["cwd"]],["pipelines.json","pipelines",["repoDir","worktreeDir"]],["workflows.json","workflows",["repoDir","worktreeDir"]]]){let h=(0,i.Vx)(d,e)??n(g().join(a,c))?.[e];if(Array.isArray(h))for(let a of h)o(a,f,b)}let e=n(g().join(a,"worktree-map.json"));if(e)for(let[a,c]of Object.entries(e))b.add(a),o(c,["repo"],b);return[...b]}(a)){try{if(!e().statSync(b).isDirectory())continue}catch{continue}let a=(0,k.hY)(b),c=(0,k.D$)(b)??(a?.startsWith("dir-")?b:void 0),g=a?`${a}\0${b}`:"";!a||!c||f.has(g)||(f.add(g),d.push({cwd:b,project:a,projectRoot:c}))}return m.set(a,{directories:d,expiresAt:Date.now()+1e4,stateIdentity:b}),d}function q(a=40){let b=[];for(let c of p())if(!b.includes(c.projectRoot)&&(b.push(c.projectRoot),b.length>=a))break;return b}function r(a,b=10){return a?p().filter(b=>b.project===a).slice(0,b).map(a=>a.cwd):[]}function s(a){let b=new Set([...a].filter(Boolean)),c={};for(let a of p())b.has(a.project)&&!c[a.project]&&(c[a.project]=a.projectRoot);return c}}};
|