agent-log-viewer 1.0.2 → 1.0.3
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/README.md +18 -0
- package/dist/mcp-server.mjs +2458 -392
- package/dist/runtime-host.mjs +1613 -244
- package/dist/standalone/.next/BUILD_ID +1 -1
- package/dist/standalone/.next/app-path-routes-manifest.json +28 -25
- package/dist/standalone/.next/build-manifest.json +2 -2
- package/dist/standalone/.next/prerender-manifest.json +3 -3
- package/dist/standalone/.next/routes-manifest.json +18 -0
- package/dist/standalone/.next/server/account-migration-controller-worker.js +1 -1
- package/dist/standalone/.next/server/app/_global-error/page.js +3 -3
- 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/_global-error.segment.rsc +1 -1
- package/dist/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/standalone/.next/server/app/_global-error.segments/_index.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 +2 -2
- 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/_head.segment.rsc +1 -1
- package/dist/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/dist/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- 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/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/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/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/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/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 +2 -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 +2 -2
- package/dist/standalone/.next/server/app/api/bridge/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 +2 -2
- 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 +67 -1
- 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 +3 -0
- package/dist/standalone/.next/server/app/api/log/suggestions/route.js.nft.json +1 -0
- package/dist/standalone/.next/server/app/api/log/suggestions/route_client-reference-manifest.js +1 -0
- 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/lock/route.js +1 -3
- package/dist/standalone/.next/server/app/api/monitor/lock/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/monitor/runs/route.js +1 -3
- package/dist/standalone/.next/server/app/api/monitor/runs/route.js.nft.json +1 -1
- 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 +2 -2
- 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 +2 -2
- 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 +2 -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 -0
- package/dist/standalone/.next/server/app/api/projects/directories/route.js.nft.json +1 -0
- package/dist/standalone/.next/server/app/api/projects/directories/route_client-reference-manifest.js +1 -0
- 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 +2 -2
- 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 +2 -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 -0
- package/dist/standalone/.next/server/app/api/runtime/hosts/route.js.nft.json +1 -0
- package/dist/standalone/.next/server/app/api/runtime/hosts/route_client-reference-manifest.js +1 -0
- package/dist/standalone/.next/server/app/api/runtime/interrupt/route.js +2 -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 +2 -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/realtime/route.js +2 -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 +2 -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 +2 -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 +2 -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 +2 -2
- 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 +3 -3
- 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 +2 -2
- package/dist/standalone/.next/server/app/api/spawn/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 +2 -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 +2 -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 +2 -2
- 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 +2 -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 +1 -1
- 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 +1 -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 +2 -2
- package/dist/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/dist/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/standalone/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/dist/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/dist/standalone/.next/server/app/page.js +17 -13
- 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 +28 -25
- package/dist/standalone/.next/server/chunks/107.js +1 -0
- package/dist/standalone/.next/server/chunks/{1858.js → 1100.js} +2 -2
- package/dist/standalone/.next/server/chunks/1872.js +42 -0
- package/dist/standalone/.next/server/chunks/1952.js +3 -0
- package/dist/standalone/.next/server/chunks/2243.js +1 -0
- package/dist/standalone/.next/server/chunks/2260.js +104 -0
- package/dist/standalone/.next/server/chunks/2318.js +2 -2
- package/dist/standalone/.next/server/chunks/2324.js +1 -1
- package/dist/standalone/.next/server/chunks/2549.js +81 -0
- package/dist/standalone/.next/server/chunks/2682.js +85 -0
- package/dist/standalone/.next/server/chunks/3086.js +1 -1
- package/dist/standalone/.next/server/chunks/3214.js +1 -1
- package/dist/standalone/.next/server/chunks/3302.js +2 -0
- package/dist/standalone/.next/server/chunks/3336.js +1 -1
- package/dist/standalone/.next/server/chunks/3386.js +2 -0
- package/dist/standalone/.next/server/chunks/3558.js +1 -1
- package/dist/standalone/.next/server/chunks/3587.js +1 -1
- package/dist/standalone/.next/server/chunks/3740.js +20 -20
- package/dist/standalone/.next/server/chunks/3830.js +1 -0
- package/dist/standalone/.next/server/chunks/4191.js +1 -1
- package/dist/standalone/.next/server/chunks/4310.js +1 -0
- package/dist/standalone/.next/server/chunks/4509.js +1 -1
- package/dist/standalone/.next/server/chunks/4565.js +1 -0
- package/dist/standalone/.next/server/chunks/4651.js +2 -0
- package/dist/standalone/.next/server/chunks/4756.js +13 -0
- package/dist/standalone/.next/server/chunks/4972.js +1 -1
- package/dist/standalone/.next/server/chunks/5103.js +10 -0
- package/dist/standalone/.next/server/chunks/5408.js +1 -0
- package/dist/standalone/.next/server/chunks/5545.js +1 -0
- package/dist/standalone/.next/server/chunks/5689.js +1 -1
- package/dist/standalone/.next/server/chunks/6333.js +3 -3
- package/dist/standalone/.next/server/chunks/6487.js +10 -0
- package/dist/standalone/.next/server/chunks/6796.js +1 -1
- package/dist/standalone/.next/server/chunks/6820.js +99 -0
- package/dist/standalone/.next/server/chunks/6826.js +1 -1
- package/dist/standalone/.next/server/chunks/6839.js +81 -0
- package/dist/standalone/.next/server/chunks/6850.js +1 -1
- package/dist/standalone/.next/server/chunks/6909.js +1 -1
- package/dist/standalone/.next/server/chunks/6942.js +27 -0
- package/dist/standalone/.next/server/chunks/7139.js +82 -0
- package/dist/standalone/.next/server/chunks/7471.js +13 -13
- package/dist/standalone/.next/server/chunks/7644.js +2 -2
- package/dist/standalone/.next/server/chunks/7722.js +1 -1
- package/dist/standalone/.next/server/chunks/773.js +47 -0
- package/dist/standalone/.next/server/chunks/8263.js +81 -0
- package/dist/standalone/.next/server/chunks/8326.js +1 -0
- package/dist/standalone/.next/server/chunks/8444.js +1 -1
- package/dist/standalone/.next/server/chunks/8617.js +1 -1
- package/dist/standalone/.next/server/chunks/8817.js +1 -1
- package/dist/standalone/.next/server/chunks/8996.js +1 -1
- package/dist/standalone/.next/server/chunks/9307.js +1 -0
- package/dist/standalone/.next/server/chunks/9364.js +58 -58
- package/dist/standalone/.next/server/chunks/9381.js +42 -0
- package/dist/standalone/.next/server/chunks/9403.js +1 -0
- package/dist/standalone/.next/server/chunks/9434.js +3 -3
- package/dist/standalone/.next/server/chunks/9488.js +1 -0
- package/dist/standalone/.next/server/chunks/9750.js +1 -0
- package/dist/standalone/.next/server/chunks/9777.js +1 -0
- package/dist/standalone/.next/server/chunks/9937.js +1 -1
- package/dist/standalone/.next/server/chunks/9940.js +1 -1
- package/dist/standalone/.next/server/chunks/9998.js +1 -1
- package/dist/standalone/.next/server/files-response-worker.js +3 -3
- package/dist/standalone/.next/server/functions-config-manifest.json +3 -0
- package/dist/standalone/.next/server/instrumentation.js +1 -1
- package/dist/standalone/.next/server/middleware-build-manifest.js +1 -1
- 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/wakatime-sync-worker.js +2 -2
- package/dist/standalone/.next/static/94yAMfjyhUPRgarycP9y4/_buildManifest.js +1 -0
- package/dist/standalone/.next/static/chunks/app/_global-error/page-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/access/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/account-migrations/[intentId]/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/[id]/status/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/active/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/login/[operationId]/input/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/login/[operationId]/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/policy/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/terminal/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/active/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/policy/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/terminal/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/agent/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/agent/snapshot/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/answer/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/artifact/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/attach-command/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/attention/[id]/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/attention/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/board/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/bridge/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/conversations/[conversationId]/migration/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/conversations/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/files/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/flows/[id]/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/flows/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/image/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/inbox/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/lifecycle/reaper/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/limits/history/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/limits/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/log/preflight/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/log/project-delete/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/log/provenance/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/log/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/log/suggestions/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/logs/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/logs/stream/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/monitor/lock/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/monitor/runs/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/orchestrator/rotate/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/orchestrator/seat/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/orchestrator/seat/status/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/pipelines/[id]/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/pipelines/preflight/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/pipelines/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/pipelines/tick/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/proc/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/projects/create/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/projects/crown/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/projects/directories/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/push/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/resources/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/roles/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/answer/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/deployments/[deploymentId]/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/deployments/capabilities/v1/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/deployments/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/hosts/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/interrupt/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/operations/[operationId]/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/operations/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/realtime/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/send/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/snapshot/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/spawn/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/steer/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/stream/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/search/transcripts/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/session/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/session/supersedence/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/session/title/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/spawn/policy/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/spawn/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/staging/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/task-attachments/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/assignment/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/send/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/spawn/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tasks/curator/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tasks/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/telegram/reports/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/telegram/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/timeline/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tmux/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tmux/targets/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/transcribe/backend/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/transcribe/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/transcribe/token/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tts/backend/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tts/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/view/presence/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/workflows/[id]/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/workflows/route-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/app/page-1a141ae4aa9d31a9.js +85 -0
- package/dist/standalone/.next/static/chunks/{framework-d1de002210ddaaef.js → framework-04bc8c1a646a0097.js} +1 -1
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-ae02882983617748.js +1 -0
- package/dist/standalone/.next/static/css/dc96fb2edbd8742e.css +1 -0
- package/dist/standalone/node_modules/{nanoid → next/node_modules/postcss/node_modules/nanoid}/non-secure/index.cjs +2 -2
- package/dist/standalone/node_modules/{nanoid → next/node_modules/postcss/node_modules/nanoid}/package.json +1 -1
- package/dist/standalone/node_modules/react/cjs/react.development.js +1 -1
- package/dist/standalone/node_modules/react/cjs/react.production.js +1 -1
- package/dist/standalone/node_modules/react/package.json +3 -3
- package/dist/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +1 -1
- package/dist/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.js +1 -1
- package/dist/standalone/node_modules/react-dom/cjs/react-dom-server.browser.production.js +3 -3
- package/dist/standalone/node_modules/react-dom/cjs/react-dom-server.edge.production.js +3 -3
- package/dist/standalone/node_modules/react-dom/cjs/react-dom-server.node.production.js +3 -3
- package/dist/standalone/node_modules/react-dom/cjs/react-dom.production.js +1 -1
- package/dist/standalone/node_modules/react-dom/package.json +4 -4
- package/dist/standalone/package.json +9 -8
- package/dist/standalone/src/lib/inboxFiles.ts +203 -0
- package/package.json +9 -8
- package/dist/standalone/.next/server/chunks/156.js +0 -2
- package/dist/standalone/.next/server/chunks/1920.js +0 -27
- package/dist/standalone/.next/server/chunks/2338.js +0 -12
- package/dist/standalone/.next/server/chunks/2904.js +0 -42
- package/dist/standalone/.next/server/chunks/2977.js +0 -1
- package/dist/standalone/.next/server/chunks/3139.js +0 -10
- package/dist/standalone/.next/server/chunks/3598.js +0 -81
- package/dist/standalone/.next/server/chunks/4968.js +0 -1
- package/dist/standalone/.next/server/chunks/6977.js +0 -1
- package/dist/standalone/.next/server/chunks/7295.js +0 -10
- package/dist/standalone/.next/server/chunks/7868.js +0 -1
- package/dist/standalone/.next/server/chunks/8026.js +0 -1
- package/dist/standalone/.next/server/chunks/8600.js +0 -12
- package/dist/standalone/.next/server/chunks/9246.js +0 -47
- package/dist/standalone/.next/server/chunks/9733.js +0 -42
- package/dist/standalone/.next/static/2ybXlxpylgBaGz43zp2fM/_buildManifest.js +0 -1
- package/dist/standalone/.next/static/chunks/app/_global-error/page-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/access/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/account-migrations/[intentId]/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/[id]/status/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/active/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/login/[operationId]/input/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/login/[operationId]/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/policy/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/terminal/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/active/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/policy/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/terminal/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/agent/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/agent/snapshot/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/answer/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/artifact/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/attach-command/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/attention/[id]/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/attention/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/board/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/bridge/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/conversations/[conversationId]/migration/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/conversations/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/files/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/flows/[id]/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/flows/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/image/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/inbox/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/lifecycle/reaper/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/limits/history/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/limits/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/log/preflight/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/log/project-delete/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/log/provenance/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/log/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/logs/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/logs/stream/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/monitor/lock/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/monitor/runs/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/orchestrator/rotate/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/orchestrator/seat/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/orchestrator/seat/status/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/pipelines/[id]/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/pipelines/preflight/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/pipelines/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/pipelines/tick/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/proc/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/projects/create/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/projects/crown/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/push/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/resources/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/roles/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/answer/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/deployments/[deploymentId]/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/deployments/capabilities/v1/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/deployments/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/interrupt/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/operations/[operationId]/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/operations/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/realtime/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/send/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/snapshot/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/spawn/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/steer/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/stream/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/search/transcripts/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/session/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/session/supersedence/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/session/title/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/spawn/policy/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/spawn/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/staging/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/task-attachments/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/assignment/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/send/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/spawn/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tasks/curator/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tasks/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/telegram/reports/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/telegram/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/timeline/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tmux/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tmux/targets/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/transcribe/backend/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/transcribe/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/transcribe/token/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tts/backend/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tts/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/view/presence/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/workflows/[id]/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/workflows/route-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/page-7ba2538fa87e3d62.js +0 -80
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-c132c5ba005ff29e.js +0 -1
- package/dist/standalone/.next/static/css/498f12ddef7ecb0e.css +0 -1
- /package/dist/standalone/.next/static/{2ybXlxpylgBaGz43zp2fM → 94yAMfjyhUPRgarycP9y4}/_ssgManifest.js +0 -0
- /package/dist/standalone/node_modules/{nanoid → next/node_modules/postcss/node_modules/nanoid}/non-secure/package.json +0 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import crypto from "node:crypto";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
attachmentMegabytes,
|
|
7
|
+
inboxAttachmentName,
|
|
8
|
+
MAX_INBOX_FILE_BYTES,
|
|
9
|
+
MAX_INBOX_FILES,
|
|
10
|
+
MAX_INBOX_FILES_TOTAL_BYTES,
|
|
11
|
+
} from "@/lib/filePolicy";
|
|
12
|
+
import { inboxDir } from "@/lib/configDir";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* General (non-image) composer attachments on their way to an agent (issue
|
|
16
|
+
* #1224). They take the road images already take — the bytes land in the viewer
|
|
17
|
+
* inbox and the delivered message names them by path — minus the base64-into-
|
|
18
|
+
* the-turn half, which needs an engine image capability an ordinary file
|
|
19
|
+
* neither has nor wants. An agent opens a file with the tools it already has.
|
|
20
|
+
*
|
|
21
|
+
* Each send owns one batch directory, so the operator's own filename survives
|
|
22
|
+
* as the basename: `…/inbox/files/<batch>/quarterly-notes.pdf` is a path the
|
|
23
|
+
* agent can act on and the operator recognises. The directory is nested, so an
|
|
24
|
+
* inbox name never matches `inboxImageRef` and none of this is servable over
|
|
25
|
+
* /api/inbox.
|
|
26
|
+
*/
|
|
27
|
+
export function inboxFilesDir(): string {
|
|
28
|
+
return path.join(inboxDir(), "files");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface InboxFileUpload {
|
|
32
|
+
name: string;
|
|
33
|
+
/** Decoded once, at admission, and carried from there: the request already
|
|
34
|
+
holds the base64, so decoding it a second time at write time (and
|
|
35
|
+
re-encoding it to compare strings) tripled the peak footprint of a batch
|
|
36
|
+
this process has no spare memory for. */
|
|
37
|
+
data: Buffer;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface InboxFileAdmissionFailure {
|
|
41
|
+
error: string;
|
|
42
|
+
status: 400 | 413;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface InboxFileAdmissionResult {
|
|
46
|
+
files: InboxFileUpload[];
|
|
47
|
+
error: InboxFileAdmissionFailure | null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface InboxFilePayloadBundle {
|
|
51
|
+
payload: string;
|
|
52
|
+
filePaths: string[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function failure(error: string, status: 400 | 413): InboxFileAdmissionResult {
|
|
56
|
+
return { files: [], error: { error, status } };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Raw byte count a base64 string decodes to, without decoding it. */
|
|
60
|
+
function rawBytesFromBase64(value: string): number {
|
|
61
|
+
const padding = value.endsWith("==") ? 2 : value.endsWith("=") ? 1 : 0;
|
|
62
|
+
return Math.max(0, Math.floor(value.length * 3 / 4) - padding);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Decodes an attachment payload, or null when it is not base64 this can write.
|
|
66
|
+
The charset/length regex bounds the input before `Buffer.from` sees it, so
|
|
67
|
+
what comes back is either real bytes or nothing. */
|
|
68
|
+
function decodeAttachment(value: string): Buffer | null {
|
|
69
|
+
if (!value || value.length % 4 !== 0 || !/^[A-Za-z0-9+/]+={0,2}$/.test(value)) return null;
|
|
70
|
+
const data = Buffer.from(value, "base64");
|
|
71
|
+
return data.length > 0 ? data : null;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Validates a request's `files` field against the shared policy. Every refusal
|
|
76
|
+
* is a message the caller hands back to the operator — an attachment that is
|
|
77
|
+
* not admitted is never quietly dropped from the batch (the defect #1224
|
|
78
|
+
* fixes), so one bad file refuses the whole send with its reason.
|
|
79
|
+
*
|
|
80
|
+
* Size is checked against the ENCODED length first, so an over-budget upload is
|
|
81
|
+
* refused without ever being decoded into memory.
|
|
82
|
+
*/
|
|
83
|
+
export function admitInboxFilePayload(body: { files?: unknown }): InboxFileAdmissionResult {
|
|
84
|
+
if (body.files === undefined || body.files === null) return { files: [], error: null };
|
|
85
|
+
if (!Array.isArray(body.files)) return failure("files must be an array", 400);
|
|
86
|
+
if (body.files.length > MAX_INBOX_FILES) {
|
|
87
|
+
return failure(`too many files (${MAX_INBOX_FILES} limit)`, 413);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const files: InboxFileUpload[] = [];
|
|
91
|
+
let totalBytes = 0;
|
|
92
|
+
for (const value of body.files) {
|
|
93
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return failure("invalid file", 400);
|
|
94
|
+
const candidate = value as Record<string, unknown>;
|
|
95
|
+
if (typeof candidate.base64 !== "string" || typeof candidate.name !== "string") {
|
|
96
|
+
return failure("invalid file", 400);
|
|
97
|
+
}
|
|
98
|
+
const name = inboxAttachmentName(candidate.name);
|
|
99
|
+
if (rawBytesFromBase64(candidate.base64) > MAX_INBOX_FILE_BYTES) {
|
|
100
|
+
return failure(`${name} is too large (${attachmentMegabytes(MAX_INBOX_FILE_BYTES)} MB limit)`, 413);
|
|
101
|
+
}
|
|
102
|
+
const data = decodeAttachment(candidate.base64);
|
|
103
|
+
if (!data) return failure(`${name} could not be read`, 400);
|
|
104
|
+
totalBytes += data.byteLength;
|
|
105
|
+
if (totalBytes > MAX_INBOX_FILES_TOTAL_BYTES) {
|
|
106
|
+
return failure(`attachments exceed the ${attachmentMegabytes(MAX_INBOX_FILES_TOTAL_BYTES)} MB request limit`, 413);
|
|
107
|
+
}
|
|
108
|
+
files.push({ name, data });
|
|
109
|
+
}
|
|
110
|
+
return { files, error: null };
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The directory name one send's attachments share. Derived from the caller's
|
|
115
|
+
* own message id, so a retried delivery rewrites the SAME paths rather than
|
|
116
|
+
* orphaning a second copy beside the first — the same reasoning that makes the
|
|
117
|
+
* legacy image path replay its recorded artifacts on retry.
|
|
118
|
+
*/
|
|
119
|
+
export function inboxFileBatchToken(clientMessageId: string | null | undefined): string {
|
|
120
|
+
const seed = clientMessageId?.trim();
|
|
121
|
+
if (!seed) return crypto.randomUUID().slice(0, 12);
|
|
122
|
+
return crypto.createHash("sha256").update(seed).digest("hex").slice(0, 12);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function batchDir(token: string): string {
|
|
126
|
+
const root = inboxFilesDir();
|
|
127
|
+
const dir = path.resolve(root, inboxAttachmentName(token));
|
|
128
|
+
if (dir !== root && !dir.startsWith(root + path.sep)) {
|
|
129
|
+
throw new Error("inbox batch directory escapes the inbox");
|
|
130
|
+
}
|
|
131
|
+
return dir;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/** Writes one admitted batch and returns the paths, in the order sent. A write
|
|
135
|
+
that throws mid-batch deletes what it already wrote, so no caller can orphan
|
|
136
|
+
a partial batch (`buildImagePayload`'s contract). */
|
|
137
|
+
export function saveInboxFiles(files: readonly InboxFileUpload[], token: string): string[] {
|
|
138
|
+
if (!files.length) return [];
|
|
139
|
+
const dir = batchDir(token);
|
|
140
|
+
const written: string[] = [];
|
|
141
|
+
try {
|
|
142
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
143
|
+
const used = new Set<string>();
|
|
144
|
+
for (const file of files) {
|
|
145
|
+
const name = inboxAttachmentName(file.name);
|
|
146
|
+
/* Two attachments named the same in ONE send must stay two files, or the
|
|
147
|
+
second silently replaces the first and the message names it twice. */
|
|
148
|
+
let unique = name;
|
|
149
|
+
for (let index = 2; used.has(unique); index += 1) {
|
|
150
|
+
const dot = name.lastIndexOf(".");
|
|
151
|
+
unique = dot > 0 ? `${name.slice(0, dot)}-${index}${name.slice(dot)}` : `${name}-${index}`;
|
|
152
|
+
}
|
|
153
|
+
used.add(unique);
|
|
154
|
+
const filePath = path.resolve(dir, unique);
|
|
155
|
+
if (!filePath.startsWith(dir + path.sep)) throw new Error("inbox attachment escapes the inbox");
|
|
156
|
+
fs.writeFileSync(filePath, file.data);
|
|
157
|
+
written.push(filePath);
|
|
158
|
+
}
|
|
159
|
+
} catch (error) {
|
|
160
|
+
deleteInboxFiles(written);
|
|
161
|
+
throw error;
|
|
162
|
+
}
|
|
163
|
+
return written;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Removes attachments written for a delivery that failed before reaching the
|
|
168
|
+
* agent, and the batch directory once it holds nothing — best effort, exactly
|
|
169
|
+
* like `deleteInboxImages`, since a delivery that already succeeded never calls
|
|
170
|
+
* this (the agent still has to open the path it was given).
|
|
171
|
+
*/
|
|
172
|
+
export function deleteInboxFiles(paths: readonly string[]): void {
|
|
173
|
+
const root = inboxFilesDir();
|
|
174
|
+
const dirs = new Set<string>();
|
|
175
|
+
for (const filePath of paths) {
|
|
176
|
+
try {
|
|
177
|
+
fs.unlinkSync(filePath);
|
|
178
|
+
} catch {
|
|
179
|
+
/* already gone or unwritable: nothing more to clean up */
|
|
180
|
+
}
|
|
181
|
+
dirs.add(path.dirname(filePath));
|
|
182
|
+
}
|
|
183
|
+
for (const dir of dirs) {
|
|
184
|
+
if (dir === root || !dir.startsWith(root + path.sep)) continue;
|
|
185
|
+
try {
|
|
186
|
+
fs.rmdirSync(dir);
|
|
187
|
+
} catch {
|
|
188
|
+
/* the batch still holds something, or is already gone */
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** Saves an admitted batch and folds the resulting paths into the delivered
|
|
194
|
+
text, one per line after it — the same shape `buildImagePayload` gives an
|
|
195
|
+
agent for a pasted image. */
|
|
196
|
+
export function buildFilePayload(
|
|
197
|
+
text: string,
|
|
198
|
+
files: readonly InboxFileUpload[],
|
|
199
|
+
token: string,
|
|
200
|
+
): InboxFilePayloadBundle {
|
|
201
|
+
const filePaths = saveInboxFiles(files, token);
|
|
202
|
+
return { payload: [text, ...filePaths].filter(Boolean).join("\n"), filePaths };
|
|
203
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-log-viewer",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"bin": {
|
|
5
5
|
"agent-log-viewer": "bin/cli.mjs",
|
|
6
6
|
"agent-log-viewer-mcp": "bin/mcp-server.mjs"
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"build:mcp": "bun scripts/build-mcp.ts",
|
|
29
29
|
"demo:capture": "bun scripts/demo-capture.ts",
|
|
30
30
|
"deploy:staging": "bun scripts/deploy-staging.ts",
|
|
31
|
+
"bootstrap:runtime-host": "bun scripts/bootstrap-runtime-host.ts",
|
|
31
32
|
"demo:motion": "bun scripts/demo-motion.ts",
|
|
32
33
|
"start": "bun --bun node_modules/.bin/next start",
|
|
33
34
|
"lint": "eslint",
|
|
@@ -40,29 +41,29 @@
|
|
|
40
41
|
"test": "bun test"
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {
|
|
43
|
-
"@modelcontextprotocol/sdk": "1.
|
|
44
|
-
"entities": "^
|
|
44
|
+
"@modelcontextprotocol/sdk": "1.30.0",
|
|
45
|
+
"entities": "^8.0.0",
|
|
45
46
|
"highlight.js": "^11.11.1",
|
|
46
47
|
"lucide-react": "^1.23.0",
|
|
47
48
|
"next": "16.2.10",
|
|
48
49
|
"pdfjs-dist": "^6.2.108",
|
|
49
50
|
"qrcode": "^1.5.4",
|
|
50
51
|
"qrcode-terminal": "^0.12.0",
|
|
51
|
-
"react": "19.2.
|
|
52
|
-
"react-dom": "19.2.
|
|
52
|
+
"react": "19.2.8",
|
|
53
|
+
"react-dom": "19.2.8",
|
|
53
54
|
"zod": "4.4.3"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"@tailwindcss/postcss": "^4",
|
|
57
58
|
"@types/bun": "^1.3.14",
|
|
58
|
-
"@types/node": "^
|
|
59
|
+
"@types/node": "^26",
|
|
59
60
|
"@types/qrcode": "^1.5.6",
|
|
60
61
|
"@types/react": "^19",
|
|
61
62
|
"@types/react-dom": "^19",
|
|
62
|
-
"eslint": "^
|
|
63
|
+
"eslint": "^10",
|
|
63
64
|
"eslint-config-next": "16.2.10",
|
|
64
65
|
"happy-dom": "^20.10.6",
|
|
65
|
-
"playwright-core": "1.
|
|
66
|
+
"playwright-core": "1.62.1",
|
|
66
67
|
"tailwindcss": "^4",
|
|
67
68
|
"typescript": "^5"
|
|
68
69
|
},
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=156,exports.ids=[156],exports.modules={60156:(a,b,c)=>{c.r(b),c.d(b,{FLOW_PIPELINE_WATCHDOG_MS:()=>p,FlowPipelineController:()=>s,controllerFileScan:()=>r,flowPipelineController:()=>v,startFlowPipelineController:()=>w,startFlowPipelineControllerRuntime:()=>t,writeFlowPipelineControllerHeartbeat:()=>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(27146),k=c(19190),l=c(58444),m=c(20576),n=c(68846),o=c(3916);let p=3e4;function q(a,b=(0,j.BQ)("flow-pipeline-controller-heartbeat.json")){g().mkdirSync(i().dirname(b),{recursive:!0,mode:448});let c=i().join(i().dirname(b),`.${i().basename(b)}.${process.pid}.${e().randomUUID()}.tmp`);g().writeFileSync(c,`${JSON.stringify(a,null,2)}
|
|
2
|
-
`,{encoding:"utf8",mode:384}),g().renameSync(c,b)}async function r(){let a=await (0,l.Nm)();return{files:a.snapshot.files,complete:a.snapshot.complete}}class s{constructor(a,b={}){this.running=null,this.trailingCycleRequested=!1,this.trailingTrigger="signal",this.cycle=0,this.lastArchiveSweepAt=0,this.activePhases=new Map,this.ports={...a,scan:a.scan??(async()=>({files:[],complete:!0})),now:a.now??Date.now,scheduleTimeout:a.scheduleTimeout??((a,b)=>setTimeout(a,b)),clearTimeout:a.clearTimeout??(a=>clearTimeout(a)),publishHeartbeat:a.publishHeartbeat??(()=>void 0),log:a.log??((a,b)=>{void 0===b?console.error(a):console.error(a,b)})},this.phaseDeadlineMs=b.phaseDeadlineMs??15e3,this.maxPasses=b.maxPasses??8}tick(a="signal"){return this.running?(this.trailingCycleRequested=!0,this.trailingTrigger=a):this.running=this.runRequestedCycles(a).finally(()=>{if(this.running=null,this.trailingCycleRequested)return this.tick(this.trailingTrigger)}),this.running}poll(){return this.running??this.tick("watchdog")}recover(){return this.tick("startup")}async runRequestedCycles(a){let b=a;do this.trailingCycleRequested=!1,await this.runCycle(b),b=this.trailingTrigger;while(this.trailingCycleRequested)}async runCycle(a){let b=++this.cycle,c=0,d=[],e=!1;for(let f=1;f<=this.maxPasses;f+=1){c=f;let g=await this.runPhase("pipelines",b,f,a,()=>this.ports.tickPipelines(d)),h=1===f?await this.runPhase("scan",b,f,a,this.ports.scan):null;if(h?.state==="failed")throw h.error;h?.state==="completed"&&h.value.complete&&(d=h.value.files,e=!0);let i=e?await this.runPhase("flows",b,f,a,()=>this.ports.tickFlows(d)):null,j="failed"===g.state?g.error:i?.state==="failed"?i.error:null;if(null!==j)throw j;if(!("completed"===g.state&&g.value.changed||i?.state==="completed"&&i.value.changed||h?.state==="completed"&&h.value.complete))break}this.sweepSettledArchive();let f=[...this.activePhases.entries()].sort((a,b)=>a[1].startedAt-b[1].startedAt)[0];f?this.publish({cycle:b,pass:c,trigger:a,phase:f[0],state:"blocked",startedAt:f[1].startedAt}):this.publish({cycle:b,pass:c,trigger:a,phase:"idle",state:"idle",startedAt:this.ports.now()})}sweepSettledArchive(){let a=this.ports.now();a-this.lastArchiveSweepAt<36e5||(this.lastArchiveSweepAt=a,(0,o.archiveSettledPipelines)(a).then(a=>{a>0&&this.ports.log(`[flow pipeline controller] archived ${a} settled pipeline record(s)`)}).catch(a=>{this.ports.log("[flow pipeline controller] settled pipeline archive sweep failed",a)}))}async runPhase(a,b,c,d,e){let f=this.activePhases.get(a);if(f)return this.publish({cycle:b,pass:c,trigger:d,phase:a,state:"blocked",startedAt:f.startedAt}),{state:"blocked"};let g=this.ports.now();this.publish({cycle:b,pass:c,trigger:d,phase:a,state:"running",startedAt:g});let h=Promise.resolve().then(e),i={startedAt:g,promise:h};this.activePhases.set(a,i),h.then(()=>{this.activePhases.get(a)===i&&this.activePhases.delete(a)},()=>{this.activePhases.get(a)===i&&this.activePhases.delete(a)});let j=()=>{},k=new Promise(a=>{j=()=>a({state:"timed-out"})}),l=this.ports.scheduleTimeout(j,this.phaseDeadlineMs),m=await Promise.race([h.then(a=>({state:"completed",value:a}),a=>({state:"failed",error:a})),k]);return this.ports.clearTimeout(l),this.publish({cycle:b,pass:c,trigger:d,phase:a,state:m.state,startedAt:g}),"failed"===m.state?this.ports.log(`[flow pipeline controller] ${a} phase failed`,m.error):"timed-out"===m.state&&this.ports.log(`[flow pipeline controller] ${a} phase exceeded its deadline`),m}publish(a){let b=this.ports.now();try{this.ports.publishHeartbeat({schemaVersion:1,controller:"flow-pipeline",cycle:a.cycle,pass:a.pass,trigger:a.trigger,phase:a.phase,state:a.state,phaseStartedAt:new Date(a.startedAt).toISOString(),updatedAt:new Date(b).toISOString(),ageMs:Math.max(0,b-a.startedAt),deadlineMs:this.phaseDeadlineMs})}catch(a){this.ports.log("[flow pipeline controller] durable heartbeat publication failed",a)}}}function t(a,b,c){b.__llvFlowPipelineUnregister?.(),b.__llvFlowPipelineUnregister=c.registerTick(()=>a.tick("signal")),b.__llvFlowPipelineWatchdog||(b.__llvFlowPipelineWatchdog=c.scheduleInterval(()=>void a.poll().catch(a=>{c.log("[flow pipeline controller] watchdog reconciliation failed",a)}),p),b.__llvFlowPipelineWatchdog.unref?.()),a.recover().catch(a=>{c.log("[flow pipeline controller] startup reconciliation failed",a)})}let u=globalThis;function v(){return u.__llvFlowPipelineController??=new s({scan:r,tickPipelines:n.n6,tickFlows:k.zn,publishHeartbeat:q})}function w(){t(v(),u,{registerTick:m.n_,scheduleInterval:(a,b)=>setInterval(a,b),log:(a,b)=>console.error(a,b)})}}};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=1920,exports.ids=[1920],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})}},66942:(a,b,c)=>{c.d(b,{CP:()=>H,A9:()=>I,hA:()=>ae,PU:()=>x});var d=c(59683),e=c(77598),f=c.n(e),g=c(73024),h=c(31421),i=c(76760),j=c.n(i),k=c(46193),l=c(24191);function m(a){if(a&&"object"==typeof a&&!Object.isFrozen(a))for(let b of(Object.freeze(a),Object.values(a)))m(b);return a}function n(a){let b=/(^|[^A-Z0-9_.-])((?:\\+)?["']?)([A-Z0-9_.-]*(?:TOKEN|SECRET|PASSWORD|PASSWD|API[_-]?KEY|AUTHORIZATION|COOKIE)[A-Z0-9_.-]*)\2\s*[:=]\s*(?!<redacted>(?:$|[\s,}\]]))(?:((?:\\+)?["'])|(?=[^"'\\\s]))/i.exec(a),c=/\b(Bearer)\s+(?:((?:\\+)?["'])|(?=\S))/i.exec(a),d=/\b(?:(?:sk|ghp|github_pat|xox[baprs])[-_A-Za-z0-9]{16,}|[A-Za-z0-9+/_=-]{48,})/i.exec(a),e=[];if(b){let a=b[4]??"",c=a.at(-1);e.push({index:b.index+b[1].length,length:b[0].length-b[1].length,replacement:`${b[3]}=<redacted>`,quote:'"'===c||"'"===c?c:null,quoteEscapeDepth:Math.max(0,a.length-1),quotedKey:b[2].endsWith('"')||b[2].endsWith("'"),authorization:/AUTHORIZATION/i.test(b[3]),bearer:!1})}if(c){let a=c[2]??"",b=a.at(-1);e.push({index:c.index,length:c[0].length,replacement:`${c[1]} <redacted>`,quote:'"'===b||"'"===b?b:null,quoteEscapeDepth:Math.max(0,a.length-1),quotedKey:!1,authorization:!1,bearer:!0})}return d&&e.push({index:d.index,length:d[0].length,replacement:"<redacted>",quote:null,quoteEscapeDepth:0,quotedKey:!1,authorization:!1,bearer:!1}),e.sort((a,b)=>a.index-b.index)[0]??null}function o(a,b,c=!1){return function(a,b,c=!1){let d=Buffer.from(a);if(d.length<=b)return a;if(c){let a=d.length-Math.max(0,b-Buffer.byteLength("..."));for(;a<d.length&&(192&d[a])==128;)a+=1;return"...".slice(0,b)+d.subarray(a).toString("utf8")}let e=b;for(;e>0&&(192&d[e])==128;)e-=1;return d.subarray(0,e).toString("utf8")}(function(a){let b="",c=a;for(;c;){let a=n(c);if(!a){b+=c;break}if(b+=c.slice(0,a.index)+a.replacement,c=c.slice(a.index+a.length),a.authorization&&!(a.quotedKey&&a.quote)){let a=c.search(/[\r\n]/);c=a<0?"":c.slice(a);continue}if(a.quote){let b=function(a,b,c,d=0){let e=0;for(let f=d;f<a.length;f+=1){let d=a[f];if("\\"===d){e+=1;continue}if(d===b&&e===c)return f+1;e=0}return -1}(c,a.quote,a.quoteEscapeDepth);c=b<0?"":c.slice(b);continue}if(a.bearer){let a=c.search(/[\r\n]/);c=a<0?"":c.slice(a);continue}if(!a.authorization){let a=c.search(/\s/);c=a<0?"":c.slice(a)}}return b.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g,"").trim()}(a),b,c)}function p(a,b,c,d={}){let e=void 0===d.stderr?void 0:o(d.stderr,2048,!0);return m({reason:a,diagnostic:{cause:b,message:o(c,512),causes:function(a,b=[]){let c=[];for(let d of[a,...b])for(let a of function(a){let b=[],c=a;for(let a=0;a<4&&void 0!==c;a+=1){if(c instanceof Error){let a=o(c.message,512);a&&b.push(a),c=c.cause;continue}let a=o(String(c),512);a&&b.push(a);break}return b}(d))if(c.push(a),4===c.length)return c;return c}(d.cause,d.secondaryCauses),...e?{stderr:e}:{}}})}class q extends Error{constructor(a,b,c,d={}){super(c,void 0===d.cause?void 0:{cause:d.cause}),this.name="ResourceCollectorFailureError",this.failure=p(a,b,c,d)}}var r=c(70547),s=c(36177),t=c(64487),u=c(27471),v=c(91724),w=c(92806);function x(a){let b=JSON.stringify(a);if(void 0===b)throw TypeError("resource diagnostic cannot be serialized");return b.replace(/[\u007f-\uffff]/g,a=>`\\u${a.charCodeAt(0).toString(16).padStart(4,"0")}`)}function y(){return{systemMemory:0,readFiles:0,readHosts:0,ppidMap:0,processMemory:0,attach:0,serialization:0}}function z(a,b,c){let d=performance.now();try{return c()}finally{a[b]+=performance.now()-d}}async function A(a,b,c){let d=performance.now();try{return await c()}finally{a[b]+=performance.now()-d}}function B(a){return"number"==typeof a&&Number.isFinite(a)&&a>=0}function C(a=d.B){let b=a.systemMemory();return b?{...b,capturedAt:new Date().toISOString()}:null}let D=globalThis;function E(){let a=D.__llvLastResourceBuild;return a?{...a,phases:{...a.phases}}:null}function F(a){let b=new Map;for(let{target:c,ref:d}of a)b.set(c,d);D.__llvResourceTargets=b,G([...b].map(([a,b])=>({target:a,ref:b})))}function G(a){D.__llvLastResourceTargets=[...a].map(({target:a,ref:b})=>({target:a,ref:b}))}function H(a){return""===a?null:D.__llvResourceTargets?.get(a)??null}function I(a){D.__llvResourceTargets?.delete(a)&&(D.__llvResourceTargetEpoch=(D.__llvResourceTargetEpoch??0)+1)}let J={readFiles:async a=>{let b=await K(a);return(0,s.iD)(b),b},readHosts:(a,b,c)=>(0,t.oe)(a,b,c),proc:d.B,captureAttachReferences:u.yq};async function K(a){var b,c;return b=(a?await (0,l.vx)():await (0,l.Nm)({revalidate:!1})).snapshot.files,c=()=>null,b.map(a=>({path:a.path,parent:a.parent,title:a.title,project:a.project,activity:a.activity,mtime:a.mtime,engine:a.engine,pid:a.pid,proc:a.proc,conversationId:c(a.path)??a.conversationId??null}))}async function L(a,b=J){let c=performance.now(),d=y();try{let e=z(d,"systemMemory",()=>C(b.proc)),f=await A(d,"readFiles",()=>b.readFiles(a)),g=z(d,"ppidMap",()=>b.proc.ppidMap()),h=await A(d,"readHosts",()=>b.readHosts(a,f,g)),i=[];if(h.hosts.length>0){let a=new Map(f.map(a=>[a.path,a])),c=new Map;for(let a of h.hosts){let b=c.get(a.paneId);b?b.push(a):c.set(a.paneId,[a])}let e=[],j=new Set;for(let a of c.values()){let b=a[0],c=(0,r.mO)(b.panePid,g);for(let d of(e.push({host:b,tree:c,paneHosts:a}),c))j.add(d)}let k=z(d,"processMemory",()=>b.proc.processMemory(j)),l=[];z(d,"attach",()=>{let c=b.captureAttachReferences(e.map(({host:a})=>({tmuxServerPid:a.tmuxServerPid,panePid:a.panePid,paneId:a.paneId})));for(let{host:b,tree:f,paneHosts:g}of e){var d;let e=0,j=0;for(let a of f){let b=k.get(a);b&&(e+=b.rssBytes,j+=b.swapBytes)}let m=function(a,b,c){for(let d of b){if(!d.primaryPath)continue;let b=a.canonicalFor(d.primaryPath);if(b?.paneId===d.paneId&&b.agentPid===d.agentPid)return c.get(d.primaryPath)??null}return null}(h,g,a);i.push({target:b.display,panePid:b.panePid,path:m?.path??null,engine:b.engine,hostConflict:function(a,b){return a.conflicts?.some(a=>a.paneIds.includes(b.paneId))??!1}(h,b),title:m?.title??null,project:m?.project||null,activity:m?.activity??null,lastActiveAt:m?(d=m.mtime,new Date(1e3*d).toISOString()):null,cwd:b.cwd,rssBytes:e,swapBytes:j,procCount:f.length});let n=c.get(b.paneId);n&&l.push({target:b.display,ref:n})}}),i.sort((a,b)=>b.rssBytes+b.swapBytes-(a.rssBytes+a.swapBytes)),G(l)}else G([]);return D.__llvLastResourceBuild={fresh:a,status:"complete",durationMs:performance.now()-c,phases:d},{system:e,sessions:i}}catch(b){throw D.__llvLastResourceBuild={fresh:a,status:"failed",durationMs:performance.now()-c,phases:d},b}}let M="resources-observation.json",N=`
|
|
2
|
-
const { spawn } = require("node:child_process");
|
|
3
|
-
const child = spawn(process.argv[1], process.argv.slice(2), { stdio: "inherit" });
|
|
4
|
-
let finished = false;
|
|
5
|
-
let terminationRequested = false;
|
|
6
|
-
const finish = (code, signal) => {
|
|
7
|
-
if (finished) return;
|
|
8
|
-
finished = true;
|
|
9
|
-
setTimeout(() => {
|
|
10
|
-
if (signal) process.kill(process.pid, signal);
|
|
11
|
-
else process.exit(code ?? 1);
|
|
12
|
-
}, terminationRequested
|
|
13
|
-
? 50
|
|
14
|
-
: ${Math.ceil(25)});
|
|
15
|
-
};
|
|
16
|
-
child.once("error", () => finish(127, null));
|
|
17
|
-
child.once("exit", finish);
|
|
18
|
-
process.on("SIGTERM", () => { terminationRequested = true; });
|
|
19
|
-
process.on("SIGINT", () => { terminationRequested = true; });
|
|
20
|
-
`,O=`
|
|
21
|
-
token="$1"
|
|
22
|
-
shift
|
|
23
|
-
read host_pid _ < /proc/self/stat
|
|
24
|
-
printf '%s %s %s
|
|
25
|
-
' "$token" "$host_pid" "$(readlink /proc/self/ns/pid)"
|
|
26
|
-
exec "$@"
|
|
27
|
-
`;function P(a){try{let b=(0,g.statSync)(a);return b.isFile()&&(73&b.mode)!=0}catch{return!1}}function Q(a){try{let b=(0,g.readFileSync)(`/proc/${a}/stat`,"utf8"),c=b.lastIndexOf(")");if(c<0)return null;let d=Number(b.slice(c+2).trim().split(/\s+/)[2]);return Number.isInteger(d)&&d>0?d:null}catch{return null}}let R="LLV_RESOURCE_COLLECTOR_OWNER",S={pidAlive:a=>d.B.pidAlive(a),processIdentity:a=>d.B.processIdentity(a),processExited:a=>"linux"===d.B.name&&function(a){try{let b=(0,g.readFileSync)(`/proc/${a}/stat`,"utf8"),c=b.slice(b.lastIndexOf(")")+2).trim().split(/\s+/,1)[0];return"Z"===c||"X"===c||"x"===c}catch{return!1}}(a),descendants:function(a){return"linux"===d.B.name?function(a){let b=[],c=new Set([a]),d=[a];for(;d.length>0;){let a,e=d.pop();b.push(e);try{a=(0,g.readFileSync)(`/proc/${e}/task/${e}/children`,"utf8")}catch{continue}for(let b of a.trim().split(/\s+/)){let a=Number(b);!Number.isInteger(a)||a<=0||c.has(a)||(c.add(a),d.push(a))}}return b}(a):(0,r.mO)(a,d.B.ppidMap())},processGroupId:a=>{let b,c;return"linux"===d.B.name?Q(a):Number.isInteger(c=Number(0===(b=(0,h.spawnSync)("ps",["-p",String(a),"-o","pgid="],{encoding:"utf8",timeout:1e3,windowsHide:!0})).status?b.stdout.trim():""))&&c>0?c:null},processGroupMembers:a=>"linux"===d.B.name?function(a){let b,c=[];try{b=(0,g.readdirSync)("/proc")}catch{return c}for(let d of b){let b=Number(d);Number.isInteger(b)&&!(b<=0)&&Q(b)===a&&c.push(b)}return c}(a):function(a){let b=(0,h.spawnSync)("ps",["-axo","pid=,pgid="],{encoding:"utf8",timeout:1e3,windowsHide:!0});if(0!==b.status)return[];let c=[];for(let d of b.stdout.split("\n")){let b=/^\s*(\d+)\s+(\d+)\s*$/.exec(d);b&&Number(b[2])===a&&c.push(Number(b[1]))}return c}(a),namespaceMembers:a=>"linux"===d.B.name?function(a){let b;try{b=(0,g.readdirSync)("/proc")}catch{return null}let c=`${R}=${a}`,e=[];for(let a of b){let b,f=Number(a);if(!Number.isInteger(f)||f<=0)continue;try{b=(0,g.readFileSync)(`/proc/${f}/environ`,"utf8")}catch{continue}if(!b.split("\0").includes(c))continue;let h=d.B.processIdentity(f);if(null!==h){try{b=(0,g.readFileSync)(`/proc/${f}/environ`,"utf8")}catch{continue}b.split("\0").includes(c)&&d.B.processIdentity(f)===h&&e.push(f)}}return e}(a):function(a){let b=`${R}=${a}`,c=(0,h.spawnSync)("ps",["eww","-axo","pid=,command="],{encoding:"utf8",timeout:1e3,windowsHide:!0,maxBuffer:0x1000000});if(0!==c.status)return null;let d=[];for(let a of c.stdout.split("\n")){let c=/^\s*(\d+)\s+/.exec(a);c&&a.includes(b)&&d.push(Number(c[1]))}return d}(a),processNamespaceId:a=>"linux"===d.B.name?function(a){try{let b=(0,g.readlinkSync)(`/proc/${a}/ns/pid`);return/^pid:\[\d+\]$/.test(b)?b:null}catch{return null}}(a):null,processNamespacePid:a=>"linux"===d.B.name?function(a){try{let b=(0,g.readFileSync)(`/proc/${a}/status`,"utf8").split("\n").find(a=>a.startsWith("NSpid:")),c=Number(b?.trim().split(/\s+/).at(-1));return Number.isInteger(c)&&c>0?c:null}catch{return null}}(a):null,openNamespaceReference:(a,b)=>"linux"===d.B.name?function(a,b){let c;try{c=(0,g.openSync)(`/proc/${a}/ns/pid`,"r")}catch{return null}try{if((0,g.readlinkSync)(`/proc/self/fd/${c}`)!==b)return(0,g.closeSync)(c),null;let a=(0,g.fstatSync)(c,{bigint:!0}),d=!1;return{members:()=>{let b;try{b=(0,g.readdirSync)("/proc")}catch{return null}let c=[];for(let d of b){let b=Number(d);if(Number.isInteger(b)&&!(b<=0))try{let d=(0,g.statSync)(`/proc/${b}/ns/pid`,{bigint:!0});d.dev===a.dev&&d.ino===a.ino&&c.push(b)}catch{}}return c},close:()=>{d||(d=!0,(0,g.closeSync)(c))}}}catch{return(0,g.closeSync)(c),null}}(a,b):null,signal:(a,b)=>process.kill(a,b)};function T(a,b,c=[],d=D.__llvResourceTargetEpoch??0){return{payload:a,diagnostic:b,hostCount:a.sessions.length,treeCount:a.sessions.reduce((a,b)=>a+b.procCount,0),targets:c,targetEpoch:d}}function U(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function V(a,b,c=[]){let d=new Set([...b,...c]);return b.every(b=>Object.hasOwn(a,b))&&Object.keys(a).every(a=>d.has(a))}function W(a){return null===a||"string"==typeof a}function X(a){return!!U(a)&&!!V(a,["target","panePid","path","engine","title","project","activity","lastActiveAt","cwd","rssBytes","swapBytes","procCount"],["hostConflict"])&&"string"==typeof a.target&&a.target.length>0&&Number.isSafeInteger(a.panePid)&&a.panePid>0&&W(a.path)&&("claude"===a.engine||"codex"===a.engine||null===a.engine)&&W(a.title)&&W(a.project)&&("live"===a.activity||"recent"===a.activity||"stalled"===a.activity||"idle"===a.activity||null===a.activity)&&W(a.lastActiveAt)&&(null===a.lastActiveAt||Number.isFinite(Date.parse(a.lastActiveAt)))&&W(a.cwd)&&B(a.rssBytes)&&B(a.swapBytes)&&Number.isSafeInteger(a.procCount)&&a.procCount>=0&&(void 0===a.hostConflict||"boolean"==typeof a.hostConflict)}function Y(a){var b;return!!U(a)&&!!V(a,["system","sessions"])&&!!(null===(b=a.system)||U(b)&&V(b,["ramTotal","ramAvailable","swapTotal","swapUsed","capturedAt"])&&B(b.ramTotal)&&B(b.ramAvailable)&&B(b.swapTotal)&&B(b.swapUsed)&&"string"==typeof b.capturedAt&&Number.isFinite(Date.parse(b.capturedAt)))&&!!Array.isArray(a.sessions)&&a.sessions.length<=1e4&&a.sessions.every(X)}function Z(a){if(!U(a)||!V(a,["fresh","status","durationMs","phases"])||!U(a.phases))return!1;let b=a.phases,c=["systemMemory","readFiles","readHosts","ppidMap","processMemory","attach","serialization"];return"boolean"==typeof a.fresh&&("complete"===a.status||"failed"===a.status)&&B(a.durationMs)&&V(b,c)&&c.every(a=>B(b[a]))}function $(a){var b;return U(a)&&V(a,["target","ref"])&&"string"==typeof a.target&&a.target.length>0&&!!U(b=a.ref)&&!!V(b,["tmuxServerPid","tmuxServerStartIdentity","paneId","panePid","paneStartIdentity"])&&Number.isSafeInteger(b.tmuxServerPid)&&b.tmuxServerPid>0&&W(b.tmuxServerStartIdentity)&&"string"==typeof b.paneId&&/^%\d+$/.test(b.paneId)&&Number.isSafeInteger(b.panePid)&&b.panePid>0&&W(b.paneStartIdentity)}function _(a,b){let c=new Map;for(let b of a.sessions){if(c.has(b.target))return!1;c.set(b.target,b)}let d=new Set;return b.every(({target:a,ref:b})=>!d.has(a)&&(d.add(a),c.get(a)?.panePid===b.panePid))}function aa(a){let b,c=(0,v.BQ)(M);try{(0,g.mkdirSync)(j().dirname(c),{recursive:!0,mode:448}),b=j().join(j().dirname(c),`.${j().basename(c)}.${process.pid}.${f().randomUUID()}.tmp`);let d=JSON.stringify({version:1,observation:a})+"\n";if(Buffer.byteLength(d)>0x1000000)throw Error("resource observation exceeded durable size limit");return(0,g.writeFileSync)(b,d,{mode:384}),(0,g.renameSync)(b,c),(0,g.chmodSync)(c,384),!0}catch(a){if(b)try{(0,g.unlinkSync)(b)}catch{}return console.error(`[resources] observation persistence failed: ${a instanceof Error?a.message:String(a)}`),!1}}function ab(a){let b=JSON.stringify({version:1,observation:a})+"\n";if(Buffer.byteLength(b)>0x1000000)throw new q("collector-crash","observation-limit","resource observation exceeded durable size limit")}async function ac(a,b=K,c={},d=D.__llvResourceTargetEpoch??0,e=S){let i,l=function(a={}){let b=a.cwd??process.cwd(),c=a.env??process.env,d=a.exists??g.existsSync,e=a.execPath??process.execPath,f=a.versions??process.versions,h=j().join(b,"src/lib/resourceCollector.worker.ts"),i=j().join(b,".next/server/resource-collector-worker.js"),k=d(h),l=d(i),m=k||!l?h:i;if(c.LLV_RESOURCE_COLLECTOR_EXECUTABLE)return{executable:c.LLV_RESOURCE_COLLECTOR_EXECUTABLE,workerPath:l?i:m};let n="/usr/local/bin/bun-container";return k&&d(n)?{executable:n,workerPath:h}:l?{executable:f.bun?e:c.LLV_BUN_EXECUTABLE||"bun",workerPath:i}:{executable:"bun",workerPath:h}}(),m=c.observeTimeoutMs??3e4,p=c.inputTimeoutMs??5e3,r=c.closeTimeoutMs??1e3,s=Math.max(0,Math.min(100,Math.floor(.75*r))),t=c.headroomMs??500,u=Math.min(25,Math.max(5,r)),v=Math.max(r+u+5,c.cleanupTimeoutMs??r+Math.floor(t/2)),x=Math.max(v,r+u+50),y=Math.max(Math.min(250,Math.ceil(.2*m)),50+u+Math.max(0,t-Math.max(0,x-r))),z=Math.max(0,m-p-x-y),A=Math.min(c.timeoutMs??23500,z),B=b(a),C=JSON.stringify({type:"collect",fresh:a,files:await Promise.race([B,new Promise((a,b)=>{i=setTimeout(()=>b(new q("timeout","file-handoff-timeout","resource collector file handoff timed out")),p)})]).finally(()=>{i&&clearTimeout(i)})})+"\n",E=c.outputMaxBytes??0x1010000;if(Buffer.byteLength(C)>0x1010000)throw new q("collector-crash","worker-input","resource collector input exceeded transport limit");let F=e===S&&P(l.executable),G=f().randomUUID(),H=F?process.execPath:l.executable,I=F?["-e",N,l.executable,l.workerPath]:[l.workerPath],J=["/usr/bin/unshare","/bin/unshare"].find(g.existsSync),L=l.executable.includes(j().sep)&&!P(l.executable),M=e===S&&"linux"===process.platform&&void 0!==J&&!L,Q=f().randomUUID(),W=(0,h.spawn)(M?J:H,M?["--user","--map-root-user","--pid","--fork","/bin/sh","-c",O,"llv-resource-worker",Q,H,...I]:I,{cwd:process.cwd(),detached:!0,stdio:["pipe","pipe","pipe"],env:{...(0,w.Fd)(process.env),[R]:G}});return new Promise((b,c)=>{let f,g,h,i,j,l=W.pid,m="number"==typeof l?e.processIdentity(l):null,p="number"==typeof l&&null!==m&&e.processGroupId(l)===l&&e.processIdentity(l)===m,t=null,w=null,y=0,z=function(a=2048){let b="",c="",d=null,e=0,f=0,g=null,h=c=>{let d=(b+=c).length-2*a;if(d<=0)return;let e=b.charCodeAt(d);e>=56320&&e<=57343&&(d+=1),b=b.slice(d)};return{append(a){c+=a,(()=>{let a=(a=!1)=>{let b=/^((?:\\+)?["'])/.exec(c)?.[1]??"",h=b.at(-1);'"'===h||"'"===h?(c=c.slice(b.length),d=h,e=b.length-1,f=0):d=a?"line":"unquoted",g=null};for(;c;){if("authorization"===g){d="line",g=null;continue}if("bearer"===g){let b=c.search(/\S/);if(b<0){c="";return}c=c.slice(b),a(!0);continue}if("value"===g){let b=c.search(/\S/);if(b<0){c="";return}c=c.slice(b),a(),g=null;continue}if("key"===g||"authorization-key"===g){let a="authorization-key"===g,b=/^[A-Z0-9_.-]*\s*[:=]\s*(?:((?:\\+)?["'])|(?=[^"'\\\s]))/i.exec(c);if(b){h("<redacted>"),c=c.slice(b[0].length);let i=b[1]??"",j=i.at(-1);d='"'===j||"'"===j?j:a?"line":"unquoted",e=i.length>0?i.length-1:0,f=0,g=null;continue}if(/^[A-Z0-9_.-]*\s*[:=]\s*$/i.exec(c)){h("<redacted>"),c="",g=a?"authorization":"value";return}if(/^[A-Z0-9_.-]*\s*$/i.test(c)){c=c.slice(-256);return}g=null}if(d){let a;if("line"===d)a=c.search(/[\r\n]/);else if("unquoted"===d)a=c.search(/\s/);else{a=-1;let b=f;for(let f=0;f<c.length;f+=1){let g=c[f];if("\\"===g){b+=1;continue}if(g===d&&b===e){a=f;break}b=0}f=b}if(a<0){c="";return}c=c.slice(a+ +("unquoted"!==d&&"line"!==d)),d=null,e=0,f=0;continue}let b=n(c);if(b){if(h(c.slice(0,b.index)+b.replacement),c=c.slice(b.index+b.length),b.authorization){d=b.quotedKey&&b.quote?b.quote:"line",e=b.quoteEscapeDepth;continue}if(b.bearer){d=b.quote??"line",e=b.quoteEscapeDepth;continue}d=b.quote??"unquoted",e=b.quoteEscapeDepth;continue}if(c.length<=256)return;let i=/(?:^|[^A-Z0-9_])(Bearer)(\s+)$/i.exec(c);if(i){let a=i.index+i[0].length-i[1].length-i[2].length;if(a<c.length-256){h(c.slice(0,a)+`${i[1]} <redacted>`),c="",g="bearer";return}}let j=/(^|[^A-Z0-9_.-])((?:\\+)?["']?)([A-Z0-9_.-]*(?:TOKEN|SECRET|PASSWORD|PASSWD|API[_-]?KEY|AUTHORIZATION|COOKIE)[A-Z0-9_.-]*)\2(\s*)(?:([:=])(\s*))?$/i.exec(c);if(j){let a=j.index+j[1].length;if(a<c.length-256){h(c.slice(0,a)),j[5]?(h("<redacted>"),c="",g=/AUTHORIZATION/i.test(j[3])?"authorization":"value"):(c=(j[3]+j[4]).slice(-256),g=/AUTHORIZATION/i.test(j[3])?"authorization-key":"key");return}}h(c.slice(0,-256)),c=c.slice(-256);return}})()},value:()=>o(b+(d?"":c),a,!0)}}(),B=new k.StringDecoder("utf8"),D=new Map;"number"==typeof l&&null!==m&&D.set(l,m);let F=[],H=null,I=!1,J=!1,K=null,L=!1,N=void 0===e.namespaceMembers,O=null,P=null,R=null,X=null,aa=!1,ab=e!==S&&"unavailable"!==e.kernelContainment,ac=ab,ad=ab,ae=ab,af=!1,ag=!1,ah=!1,ai=!1,aj=!1,ak=!1,al=!1,am=(a,b,c,d)=>new q(a,b,c,{cause:d,stderr:z.value(),secondaryCauses:K?[K]:[]}),an=a=>{j??=a},ao=a=>{L=!0,an(Error(a))},ap=(a,b)=>{let c=e.processIdentity(a);if(null===c)return!e.pidAlive(a);if(c!==b||!e.processExited?.(a))return!1;let d=e.processIdentity(a);return d===c||null===d&&!e.pidAlive(a)},aq=()=>{ak||(ak=!0,z.append(B.end()))},ar=()=>{for(let a of F)clearTimeout(a);F.length=0},as=()=>{let a;if(!ae||null===O||null===X)return!1;try{if(!aa&&null!==P&&null!==R){let a=e.processIdentity(P);if(a===R)if(ap(P,R))aa=!0;else{let b=e.processNamespaceId?.(P),c=e.processNamespacePid?.(P);e.processIdentity(P)!==a?aa=!0:(b!==O||1!==c)&&ao("resource collector PID namespace root identity changed")}else null!==a?(aa=!0,ao("resource collector PID namespace root identity was recycled")):e.pidAlive(P)||(aa=!0)}a=X.members()}catch(a){return ac=!1,ad=!1,an(a),!1}if(ac=null!==a,ad=a?.length===0,null===a)return an(Error("resource collector PID namespace could not be inspected")),!1;let b=!1;for(let c of a){let a=e.processIdentity(c);if(null===a||e.processNamespaceId?.(c)!==O||e.processIdentity(c)!==a)continue;let d=D.get(c);if(void 0!==d&&d!==a){ao("resource collector PID namespace member identity was recycled");continue}void 0===d&&(D.set(c,a),b=!0)}return b},at=(a=!0)=>{let b=!1,c=[...D.keys()],d=new Set;for(;c.length>0;){let a,f=c.pop();if(d.has(f))continue;d.add(f);let g=D.get(f);if(void 0!==g&&e.processIdentity(f)===g){try{a=e.descendants(f)}catch(a){an(a);continue}if(e.processIdentity(f)===g)for(let d of a){if(d===f)continue;let a=e.processIdentity(d);if(null===a||e.processIdentity(f)!==g||e.processIdentity(d)!==a)continue;let h=D.get(d);if(void 0!==h&&h!==a){ao("resource collector descendant identity was recycled");continue}void 0===h&&(D.set(d,a),b=!0),c.push(d)}}}(()=>{let a;if(null!==O||!p||af||ag||ah||"number"!=typeof l||null===m)return;if(e.processIdentity(l)!==m){af=!0,ao("resource collector worker group leader identity changed");return}try{a=e.processGroupMembers(l)}catch(a){af=!0,ao("resource collector worker group membership could not be inspected"),an(a);return}if(!a.includes(l)){af=!0,ao("resource collector worker group continuity was lost");return}let b=[];for(let c of a){let a=e.processIdentity(c);null!==a&&e.processGroupId(c)===l&&e.processIdentity(c)===a&&b.push([c,a])}if(e.processIdentity(l)!==m){af=!0,ao("resource collector worker group leader identity changed");return}for(let[a,c]of b){let b=D.get(a);if(void 0!==b&&b!==c){af=!0,ao("resource collector worker group member identity changed");return}D.set(a,c)}})();let f=as();return!!a&&null===O&&(()=>{let a;if(!e.namespaceMembers)return!1;try{a=e.namespaceMembers(G)}catch(a){return N=!1,an(a),!1}if(N=null!==a,null===a)return an(Error("resource collector worker namespace could not be inspected")),!1;let b=!1;for(let c of a){let a=e.processIdentity(c);if(null===a||e.processIdentity(c)!==a)continue;let d=D.get(c);if(void 0!==d&&d!==a){ao("resource collector namespace member identity was recycled");continue}void 0===d&&(D.set(c,a),b=!0)}return b})()||f||b},au=()=>{let a=[],b=!1;for(let[c,d]of D){let f=e.processIdentity(c);if(f===d){if(ap(c,d))continue;let f=e.processIdentity(c);f===d?a.push(c):null===f&&e.pidAlive(c)?b=!0:null!==f&&null!==O&&ao("resource collector contained process identity was recycled");continue}null===f&&e.pidAlive(c)?b=!0:null!==f&&null!==O&&ao("resource collector contained process identity was recycled")}return{active:a,uncertain:b}},av=()=>{if("number"!=typeof l)return"absent";try{return e.signal(-l,0),"present"}catch(b){let a=b.code;if("ESRCH"===a)return ag||(af=!0),"absent";if("EPERM"===a)return"denied";return an(b),"unknown"}},aw=(a,b=!0,c="all")=>{if(at(b),null!==O&&null!==P&&null!==R){let b=au().active.filter(a=>a!==P&&e.processNamespaceId?.(a)===O),d=new Set(b),f="SIGTERM"===a?b:[];for(let g of("SIGTERM"===a&&"members"===c&&(f=b.filter(a=>{let b,c=D.get(a);if(void 0===c||e.processIdentity(a)!==c)return!1;try{b=e.descendants(a)}catch(a){return an(a),!1}return e.processIdentity(a)===c&&!b.some(b=>b!==a&&d.has(b))})),f)){let b=D.get(g);if(void 0===b)continue;let c=e.processIdentity(g);if(null!==c){if(c!==b||e.processNamespaceId?.(g)!==O||e.processIdentity(g)!==c){ao("resource collector PID namespace member identity changed before cleanup");continue}try{e.signal(g,a)}catch(a){"ESRCH"!==a.code&&an(a)}}}if("members"===c)return;let g=()=>{if("number"!=typeof l||null===m||l===P)return;let b=e.processIdentity(l);if(null!==b){if(b!==m||e.processIdentity(l)!==b)return void ao("resource collector worker wrapper identity changed before cleanup");if(!ap(l,m))try{e.signal(l,a)}catch(a){"ESRCH"!==a.code&&an(a)}}};if(aa)return void g();let h=e.processIdentity(P);if(null===h){e.pidAlive(P)||(aa=!0),g();return}if(ap(P,R)){aa=!0,g();return}if(h!==R){aa=!0,ao("resource collector PID namespace root identity changed before cleanup"),g();return}if(e.processNamespaceId?.(P)!==O||e.processNamespacePid?.(P)!==1||e.processIdentity(P)!==h){ao("resource collector PID namespace root identity changed before cleanup"),g();return}try{e.signal(P,a)}catch(a){"ESRCH"!==a.code&&an(a)}return void g()}let d=au();if("present"===av())if((()=>{if(!p||af||"number"!=typeof l||null===m)return!1;for(let[a,b]of D)if(e.processIdentity(a)===b&&e.processGroupId(a)===l&&e.processIdentity(a)===b)return!0;return!1})())try{e.signal(-l,a),ag=!0}catch(a){"ESRCH"!==a.code&&an(a)}else ag?an(Error("resource collector worker group ownership could not be verified")):ao("resource collector worker group ownership could not be verified");for(let b of d.active){let c=D.get(b);if(void 0===c||e.processIdentity(b)!==c){ag||ao("resource collector worker identity changed before individual cleanup");continue}try{e.signal(b,a)}catch(a){"ESRCH"!==a.code&&an(a)}}},ax=()=>{let a=au(),b="number"==typeof l&&null!==m&&ap(l,m),c=av();null!==O&&ad&&b&&"present"===c&&(c="absent");let d=N&&"absent"===c&&0===a.active.length&&!a.uncertain,e=d&&ac&&ad;return d&&!ae&&null===K?(L=!0,K=Error("resource collector kernel containment could not be established"),!0):(e&&L&&null===K&&(K=Error("resource collector worker cleanup ownership verification failed",void 0===j?void 0:{cause:j})),e)},ay=()=>{if(!aj){aj=!0;try{X?.close()}catch(a){an(a),K??=Error("resource collector PID namespace reference could not be closed",{cause:a})}for(let a of(X=null,aq(),W.removeAllListeners(),[W.stdin,W.stdout,W.stderr]))a.removeAllListeners(),a.destroy(),a.unref?.();W.unref()}},az=a=>{if(!M||!a.startsWith(`${Q} `))return!1;let[b,c,d,...f]=a.split(" "),g=Number(c);if(a.length>512||b!==Q||!Number.isInteger(g)||g<=0||!/^pid:\[\d+\]$/.test(d)||f.length>0||!e.openNamespaceReference||!e.processNamespaceId||!e.processNamespacePid)return ao("resource collector PID namespace handshake was invalid"),!0;let h=e.processIdentity(g),i=null!==h&&e.processNamespaceId(g)===d&&1===e.processNamespacePid(g)&&e.processIdentity(g)===h?e.openNamespaceReference(g,d):null;return null===i||e.processIdentity(g)!==h||e.processNamespaceId(g)!==d||1!==e.processNamespacePid(g)||e.processIdentity(g)!==h?(i?.close(),ao("resource collector PID namespace root could not be verified")):(O=d,P=g,R=h,X=i,ae=!0,ac=!1,ad=!1,N=!0,as()),!0};M||ae||ao("resource collector kernel containment is unavailable");let aA=()=>{if(al||!t||!ai&&!aj||!J)return;al=!0;let a=t;(clearTimeout(aE),f&&clearTimeout(f),g&&clearTimeout(g),h&&clearTimeout(h),i&&clearTimeout(i),ar(),ay(),K)?"success"===a.type?c(am("collector-crash","worker-cleanup","resource collector worker cleanup failed")):c(am(a.reason,a.cause,a.message,a.error)):"success"===a.type?b(a.value):c(am(a.reason,a.cause,a.message,a.error))},aB=()=>{if(!I||J)return;at()&&(H=null);let a=ax();if(a?null===H&&(H=Date.now()):H=null,a&&Date.now()-H>=u){J=!0,g&&clearTimeout(g),i&&clearTimeout(i),aA();return}(i=setTimeout(aB,5)).unref()},aC=()=>{I||(I=!0,ar(),(h=setTimeout(()=>{if(at(),ax()&&void 0===j){J=!0,ay(),aA();return}!t&&w&&(t=w),K=Error("resource collector worker cleanup deadline expired",void 0===j?void 0:{cause:j}),J=!0,ay(),aA()},t?.type==="success"?x:v)).unref(),null===O?aw("SIGTERM",!1):(aw("SIGTERM",!1,"members"),(f=setTimeout(()=>{J||(aw("SIGTERM",!1,"root"),aB())},s)).unref()),(g=setTimeout(()=>{aw("SIGKILL"),aB()},r)).unref(),aB())},aD=a=>{if(t){"success"===t.type&&"failure"===a.type&&"worker-output-limit"===a.cause&&(t=a);return}t=a,clearTimeout(aE),aC()};for(let a of(at(),[0,5,20,40])){let b=setTimeout(()=>{I||ah||at()},a);b.unref(),F.push(b)}let aE=setTimeout(()=>aD({type:"failure",reason:"timeout",cause:"worker-timeout",message:"resource collector worker timed out"}),A);W.once("error",a=>{"number"!=typeof l&&(ae=!0,ac=!0,ad=!0,N=!0),aD({type:"failure",reason:"collector-crash",cause:"worker-spawn",message:"resource collector worker failed to start",error:a})}),W.once("exit",(a,b)=>{ah=!0,ar(),clearTimeout(aE),w={type:"failure",reason:"collector-crash",cause:"worker-exit",message:`resource collector worker exited before observation (${b??a??"unknown"})`},aC()}),W.once("close",(a,b)=>{clearTimeout(aE),aq(),ai=!0,t||(t=w??{type:"failure",reason:"collector-crash",cause:"worker-exit",message:`resource collector worker closed before observation (${b??a??"unknown"})`},aC()),aB(),aA()});let aF="";W.stdout.setEncoding("utf8"),W.stdout.on("data",b=>{if((y+=Buffer.byteLength(b))>E+(M&&!ae?512:0))return void aD({type:"failure",reason:"collector-crash",cause:"worker-output-limit",message:"resource collector worker exceeded stdout limit"});if(!t)for(aF+=b;!t;){var c;let b,e=aF.indexOf("\n");if(e<0)return;let f=aF.slice(0,e);if(aF=aF.slice(e+1),az(f)){(y-=Buffer.byteLength(f)+1)>E&&aD({type:"failure",reason:"collector-crash",cause:"worker-output-limit",message:"resource collector worker exceeded stdout limit"});continue}if(y>E)return void aD({type:"failure",reason:"collector-crash",cause:"worker-output-limit",message:"resource collector worker exceeded stdout limit"});try{b=JSON.parse(f)}catch{aD({type:"failure",reason:"collector-crash",cause:"worker-output-invalid",message:"resource collector worker emitted invalid JSON"});return}let g=U(c=b)?"failure"===c.type?V(c,["type","error"])&&"string"==typeof c.error&&c.error.length<=4096?c:null:"observation"===c.type&&V(c,["type","payload","diagnostic","targets"])&&Y(c.payload)&&Z(c.diagnostic)&&Array.isArray(c.targets)&&!(c.targets.length>1e4)&&c.targets.every($)&&"complete"===c.diagnostic.status&&_(c.payload,c.targets)?c:null:null;if(!g)return void aD({type:"failure",reason:"collector-crash",cause:"worker-output-invalid",message:"resource collector worker emitted an invalid message"});if("observation"===g.type&&g.diagnostic.fresh!==a)return void aD({type:"failure",reason:"collector-crash",cause:"worker-output-invalid",message:"resource collector worker returned mismatched freshness"});if("failure"===g.type)return void aD({type:"failure",reason:"collector-crash",cause:"worker-failure",message:"resource collector worker reported a failure",error:Error(g.error)});aD({type:"success",value:T(g.payload,g.diagnostic,g.targets,d)}),aF=""}}),W.stderr.on("data",a=>{y+=a.length,z.append(B.write(a)),y>E+(M&&!ae?512:0)&&aD({type:"failure",reason:"collector-crash",cause:"worker-output-limit",message:"resource collector worker exceeded output limit"})}),W.stdin.once("error",a=>aD({type:"failure",reason:"collector-crash",cause:"worker-input",message:"resource collector worker input failed",error:a})),W.stdin.end(C)})}function ad(a,b,c,d=!1){var e,f;let{observation:g,failure:h}=a,i=(e=a.collectorId,f=d||void 0!==h,g&&f?{status:g.collectorId===e?"memory":"durable",collectorId:g.collectorId,generation:g.generation}:{status:"miss"});if(!g){if(!h)throw Error("resource collector returned no observation or failure");return{payload:{system:b(),sessions:[]},diagnostic:{fresh:c,status:"failed",durationMs:Math.max(0,a.completedAt-a.startedAt),phases:y(),generation:a.generation,startedAt:new Date(a.startedAt).toISOString(),completedAt:new Date(a.completedAt).toISOString(),collectorId:a.collectorId,cache:i,degradedReason:h.reason,failure:h.diagnostic}}}let{payload:j,diagnostic:k}=g.value;return(h||g.collectorId!==a.collectorId||void 0===g.value.targetEpoch||function(a,b,c=D.__llvResourceTargetEpoch??0){c!==(D.__llvResourceTargetEpoch??0)||a<=(D.__llvResourceTargetsGeneration??0)||(F(b),D.__llvResourceTargetsGeneration=a)}(g.generation,g.value.targets,g.value.targetEpoch),h)?{payload:c?j:{...j,system:b()},diagnostic:{fresh:c,status:"failed",durationMs:Math.max(0,a.completedAt-a.startedAt),phases:y(),generation:a.generation,startedAt:new Date(a.startedAt).toISOString(),completedAt:new Date(a.completedAt).toISOString(),collectorId:a.collectorId,cache:i,degradedReason:h.reason,failure:h.diagnostic}}:{payload:c?j:{...j,system:b()},diagnostic:{...k,fresh:c,generation:g.generation,startedAt:new Date(g.startedAt).toISOString(),completedAt:new Date(g.completedAt).toISOString(),collectorId:a.collectorId,cache:i}}}async function ae(a=!1){let b,c=process.env.LLV_RESOURCES_FIXTURE;if(c){var d;let b;return F([]),d=function(a){let b;try{b=JSON.parse(a)}catch{throw Error("invalid resources fixture: expected JSON")}let c=b,d=c?.system,e=null===d||"object"==typeof d&&B(d.ramTotal)&&B(d.ramAvailable)&&B(d.swapTotal)&&B(d.swapUsed)&&"string"==typeof d.capturedAt&&Number.isFinite(Date.parse(d.capturedAt));if(!c||!e||!Array.isArray(c.sessions)||0!==c.sessions.length)throw Error("invalid resources fixture: expected system metrics and an empty sessions list");return{system:d??null,sessions:[]}}((0,g.readFileSync)(c,"utf8")),b=Date.now(),{payload:d,diagnostic:{fresh:a,status:"complete",durationMs:0,phases:y(),generation:0,startedAt:new Date(b).toISOString(),completedAt:new Date(b).toISOString(),collectorId:"fixture",cache:{status:"miss"}}}}return(b=D.__llvResourcesReader,(3!==D.__llvResourcesReaderVersion||!b)&&(D.__llvResourcesReaderVersion=3,b=function(a,b,c=Date.now,d=E,e={}){var g;let h,i,j,k,l,n=e.inProcess??"1"===process.env.LLV_RESOURCE_COLLECTOR_IN_PROCESS,o=e.collectorId??(n?`in-process:${process.pid}:${f().randomUUID()}`:`worker:${process.pid}:${f().randomUUID()}`),r=(h=(g={collectorId:o,now:c,initial:e.initial,validateObservation:ab,collect:n?async(b=!1)=>{let c=D.__llvResourceTargetEpoch??0,e=await a(b),f=d();if(!f)throw Error("resource build completed without diagnostics");return T(e,f,D.__llvLastResourceTargets?.map(({target:a,ref:b})=>({target:a,ref:{...b}}))??[],c)}:(a=!1)=>ac(a,e.readFiles,e.workerLimits,D.__llvResourceTargetEpoch??0,e.workerProcessRuntime)}).now??Date.now,i=g.initial?.generation??0,j=g.initial??null,k=null,l=a=>{let b=++i,c=h(),d=Promise.resolve().then(()=>g.collect(a)).then(a=>{let d={generation:b,startedAt:c,completedAt:h(),collectorId:g.collectorId,value:m(a)};return g.validateObservation?.(d),m(d)}),e={generation:b,promise:d};return k=e,d.then(a=>{k===e&&(k=null),(!j||a.generation>j.generation)&&(j=a)},()=>{k===e&&(k=null)}),d},{latest:()=>j,fence:()=>i,async observe(a,b,c){let d,e,f=h(),n=(e=k)?e.generation>a?e.promise:e.promise.catch(()=>void 0).then(()=>{let b=k;return b&&b.generation>a?b.promise:l(c)}):l(c),o=(a,b)=>m({observation:a,generation:b?Math.max(i,a?.generation??0):a?.generation??i,startedAt:f,completedAt:h(),collectorId:g.collectorId,...b?{failure:b}:{}}),r=Math.max(0,b);if(0===r)return n.catch(()=>void 0),o(j,p("collector-busy","collection-active","resource collection is still active"));let s=Symbol("resource-observation-timeout");try{let a=await Promise.race([n,new Promise(a=>{d=setTimeout(()=>a(s),r)})]);if(a===s)return o(j,p("timeout","observation-timeout","resource collection observation timed out"));return o(a)}catch(a){return o(j,a instanceof q?a.failure:p("collector-crash","collector-error","resource collection failed",{cause:a}))}finally{d&&clearTimeout(d)}}}),s=e.initial?.generation??0,t=a=>{a.degradedReason||a.generation<=s||(e.persist?.(a)??!0)&&(s=a.generation)},u=null,v=null,w=null,x=e.workerLimits?.observeTimeoutMs??3e4,y=a=>{w&&a.generation>=w.generation&&(w=null)},z=async a=>{let d=r.latest();if(!a&&d)return(c()-d.completedAt>=6e5&&(a=>{if(v)return;let b=r.observe(a.generation,x,!1).then(a=>{if(a.failure){w=a;return}a.observation&&y(a.observation)}).finally(()=>{v===b&&(v=null)});v=b})(d),t(d),w)?ad(w,b,!1,!0):ad({observation:d,generation:d.generation,startedAt:d.startedAt,completedAt:d.completedAt,collectorId:o},b,!1,!0);let e=a?r.fence():-1,f=await r.observe(e,x,a);return f.observation&&!f.failure&&(t(f.observation),y(f.observation)),ad(f,b,a)};return{async read(a=!1){if(!a)return z(!1);if(u)return u;let b=z(!0);u=b;try{return await b}finally{u===b&&(u=null)}}}}(L,()=>C(),Date.now,E,{initial:function(){try{let a=(0,v.BQ)(M),b=(0,g.statSync)(a).size;if(b<=0||b>0x1000000)return null;return function(a){if(0>=Buffer.byteLength(a)||Buffer.byteLength(a)>0x1000000)return null;try{var b;let c=JSON.parse(a);if(!U(c)||!V(c,["version","observation"])||1!==c.version||!U(c.observation))return null;let d=c.observation;if(!V(d,["generation","startedAt","completedAt","collectorId","value"],["degradedReason"])||!Number.isSafeInteger(d.generation)||d.generation<0||!B(d.startedAt)||!B(d.completedAt)||d.completedAt<d.startedAt||"string"!=typeof d.collectorId||0===d.collectorId.length||d.collectorId.length>256||void 0!==d.degradedReason&&"collector-busy"!==d.degradedReason&&"timeout"!==d.degradedReason&&"collector-crash"!==d.degradedReason||(b=d.value,!(U(b)&&V(b,["payload","diagnostic","hostCount","treeCount","targets"],["targetEpoch"])&&Y(b.payload)&&Z(b.diagnostic)&&Number.isSafeInteger(b.hostCount)&&!(b.hostCount<0)&&Number.isSafeInteger(b.treeCount)&&!(b.treeCount<0)&&(void 0===b.targetEpoch||Number.isSafeInteger(b.targetEpoch)&&!(b.targetEpoch<0))&&Array.isArray(b.targets)&&!(b.targets.length>1e4)&&b.targets.every($)&&"complete"===b.diagnostic.status&&_(b.payload,b.targets)&&b.hostCount===b.payload.sessions.length&&b.treeCount===b.payload.sessions.reduce((a,b)=>a+b.procCount,0))))return null;return d}catch{return null}}((0,g.readFileSync)(a,"utf8"))}catch{return null}}(),persist:aa}),D.__llvResourcesReader=b),b).read(a)}}};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=2338,exports.ids=[2318,2338,9937],exports.modules={72338:(a,b,c)=>{c.d(b,{ip:()=>A,CX:()=>z});var d=c(73024),e=c.n(d),f=c(74382),g=c(29733),h=c(4837),i=c(89937),j=c(4012),k=c(10167),l=c(50201),m=c(70107),n=c(99411),o=c(21153);let p=`## Initial visible status
|
|
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
|
-
Ready in {project}.
|
|
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.`;function q(a){return a.includes(p)?a:`${a}
|
|
6
|
-
|
|
7
|
-
${p}`}var r=c(15408);let s={spawn:async function(a){let{executeSpawnRequest:b}=await c.e(7722).then(c.bind(c,67722)),d={headers:new Headers({host:"127.0.0.1",[j.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,l.cM)()){let{enqueueStructuredMessage:b}=await Promise.resolve().then(c.bind(c,2592)),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,k.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,g.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 h=b.projectOwnership?.project??(0,m.hY)(f);return h?{kind:"eligible",conversationId:b.id,path:d,cwd:f,project:(0,r.ut)(h)}:{kind:"ineligible",code:"missing_project",error:"conversation project is unavailable"}},projectTasks:a=>(0,o.h6)().filter(b=>b.project===a&&"done"!==b.status).map(a=>({id:a.id,status:a.status,text:a.text})),launchSettlement:({launchId:a,clientRequestId:b})=>{let c=(0,g.agentRegistry)().spawnReceiptForClientAttempt(b);return!c||a&&c.launchId!==a?{kind:"unknown"}:c.rejection||"failed"===c.state||"conflicted"===c.state?{kind:"failed",error:c.error??c.rejection?.guidance??`spawn receipt is terminally ${c.state}`}:{kind:"settled",conversationId:c.conversationId,path:"materialized"===c.artifactLifecycle?c.artifactPath:null,launchId:c.launchId}},now:()=>new Date().toISOString()},t=/^[A-Za-z0-9_-]{8,128}$/;function u(a){return"string"==typeof a?a.trim():""}function v(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 w(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 x(a,b){let c=(0,r.ho)({project:a.project,clientRequestId:a.clientRequestId,conversationId:a.conversationId,path:a.path,launchId:a.launchId,now:b.now()});return"missing"===c.kind?null:{seat:c.seat}}function y(a,b){let c=(0,r.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?x({project:a,clientRequestId:c.intent.clientRequestId,conversationId:d.conversationId,path:d.path,launchId:d.launchId??c.intent.launchId},b):("failed"===d.kind&&(0,r.Cp)(a,c.intent.clientRequestId,d.error),null)}async function z(a,b=s){let c="string"==typeof a.project?(0,f.QK)(a.project):null;if(!c)return{status:400,body:{error:"project must be a valid project key"}};let d=(0,r.ut)(c),i="string"==typeof a.mandate?a.mandate:"";if(!i.trim())return{status:400,body:{error:"mandate is required"}};if(Buffer.byteLength(i,"utf8")>64e3)return{status:413,body:{error:"mandate is too large"}};let j=u(a.clientRequestId);if(!t.test(j))return{status:400,body:{error:"clientRequestId must be 8-128 URL-safe characters"}};let k=u(a.conversationId);if(k&&!k.startsWith("conversation_"))return{status:400,body:{error:"conversationId is invalid"}};let l="number"==typeof a.promptVersion&&Number.isInteger(a.promptVersion)?a.promptVersion:null,m=y(d,b);if(m&&await m,k){let a=b.conversationTarget(k);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!==d)return{status:409,body:{error:"conversation belongs to a different project",code:"project_mismatch"}};let c=(0,r.$p)({project:d,mandate:i,clientRequestId:j,mode:"existing",conversationId:a.conversationId,promptVersion:l,now:b.now()});if("completed"===c.kind)return v(c.seat);if("in_progress"===c.kind)return w(c.seat);let e="replay"===c.kind?b.conversationTarget(c.seat.conversationId??""):a;if(!e||"ineligible"===e.kind||e.project!==d){let a="the pending adoption target is no longer eligible";return(0,r.Cp)(d,j,a),{status:409,body:{error:a,code:"adoption_target_unavailable",seat:(0,r.HS)(d).pending}}}let f=await b.deliver({conversationId:e.conversationId,path:e.path,clientMessageId:`orchmandate_${j}`,text:q("replay"===c.kind?c.seat.mandate:i)});if(!f.ok){let a=f.error??"mandate delivery failed";return(0,r.Cp)(d,j,a),{status:502,body:{error:a,code:"mandate_delivery_failed",seat:(0,r.HS)(d).pending}}}let g=await x({project:d,clientRequestId:j,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 o=(0,r.HS)(d).active;if(o&&o.intent.clientRequestId!==j&&!0!==a.replaceIncumbent)return{status:409,body:{error:`an orchestrator is already designated for ${d}; use rotate_orchestrator for an explicit handoff, or pass replaceIncumbent: true to replace deliberately`,code:"already_designated",incumbentSeatEpoch:o.seatEpoch}};let p=function(a){let b=u(a.model);if(!b)return null;let c=(0,n.s8)({role:"orchestrator",roleParams:a.roleParams??{mode:"standard"}}),d=null;if("claude"===a.engine||"codex"===a.engine?d=a.engine:c.ok&&c.value&&(d=c.value.config.engine),!d)return null;let e=(0,h.RC)(d,b);return"error"in e?e.error:null}(a);if(p)return{status:400,body:{error:p}};let A=(0,r.$p)({project:d,mandate:i,clientRequestId:j,mode:"spawn",promptVersion:l,now:b.now()});if("completed"===A.kind)return v(A.seat);if("in_progress"===A.kind)return w(A.seat);let B=q("replay"===A.kind?A.seat.mandate:i),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,g.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}(d,a.cwd);if(!C)return(0,r.Cp)(d,j,"orchestrator cwd could not be resolved"),{status:400,body:{error:"orchestrator cwd could not be resolved — pass cwd explicitly or set LLV_ORCHESTRATOR_CWD",code:"cwd_unresolved",seat:(0,r.HS)(d).pending}};let D={...Object.fromEntries(["engine","model","cwd","effort","fast","accountId","images","roleParams","allowSubagents"].flatMap(b=>void 0===a[b]?[]:[[b,a[b]]])),role:"orchestrator",roleParams:a.roleParams??{mode:"standard"},project:d,cwd:C,prompt:B,clientAttemptId:j},E=await b.spawn(D),F=u(E.body.conversationId),G=E.status>=200&&E.status<300&&!1!==E.body.ok,H=u(E.body.launchId),I=G&&202===E.status&&!!F&&!!H;if(!(G&&!1!==E.body.launched&&F)&&!I){let a=u(E.body.error)||(G?F?"spawn did not report an accepted launch":"spawn response omitted conversationId":`spawn was rejected with HTTP status ${E.status}`);return(0,r.Cp)(d,j,a),{status:E.status,body:{...E.body,seat:(0,r.HS)(d).pending}}}let J=await x({project:d,clientRequestId:j,conversationId:F,path:"string"==typeof E.body.path?E.body.path:null,launchId:H||null},b);return J?{status:E.status,body:{...E.body,...I?{accepted:!0,state:"accepted"}:{},seat:J.seat}}:{status:409,body:{error:"seat intent was superseded by a newer designation"}}}async function A(a,b=s){let c="string"==typeof a.project?(0,f.QK)(a.project):null;if(!c)return{status:400,body:{error:"project must be a valid project key"}};let d=(0,r.ut)(c),e=u(a.clientRequestId);if(!t.test(e))return{status:400,body:{error:"clientRequestId must be 8-128 URL-safe characters"}};let g=y(d,b);g&&await g;let h=(0,r.HS)(d).active;if(!h?.conversationId)return{status:409,body:{error:"no orchestrator is designated for this project — use create_orchestrator instead of rotating",code:"no_incumbent"}};let i=b.conversationTarget(h.conversationId),j=i?.kind==="eligible"?i:null,k=b.projectTasks(d).slice(0,12),l=u(a.handoffNotes).slice(0,2e3),m=["## Handoff from your predecessor (rotation)",`You are replacing orchestrator conversation ${h.conversationId} for project ${d}. Its manager authority is revoked; its session and card remain on the board, linked to yours.`,j?.path??h.path?`Your predecessor's full transcript — decisions, blockers, in-flight work — is at: ${j?.path??h.path}. Review its recent turns before acting.`:"Your predecessor's transcript path is not recorded; reconstruct state from the board before acting.",k.length?`Open board tasks for this project:
|
|
8
|
-
${k.map(a=>`- [${a.status}] ${a.text.slice(0,140)} (${a.id})`).join("\n")}`:"No open board tasks are recorded for this project.",...l?[`Notes from the caller:
|
|
9
|
-
${l}`]:[]].join("\n\n"),n=u(a.mandate)||h.mandate,o=await z({project:d,mandate:`${n}
|
|
10
|
-
|
|
11
|
-
${m}`,clientRequestId:e,replaceIncumbent:!0,promptVersion:h.promptVersion,...void 0!==a.engine?{engine:a.engine}:{},...void 0!==a.model?{model:a.model}:{},...void 0!==a.effort?{effort:a.effort}:{},...void 0!==a.fast?{fast:a.fast}:{},...void 0!==a.cwd?{cwd:a.cwd}:j?{cwd:j.cwd}:{},...void 0!==a.accountId?{accountId:a.accountId}:{}},b);return{status:o.status,body:{...o.body,rotatedFrom:{conversationId:h.conversationId,path:j?.path??h.path,seatEpoch:h.seatEpoch}}}}},89937:(a,b,c)=>{c.r(b),c.d(b,{OperatorSpawnCapabilityError:()=>l,ensureOperatorSpawnCapability:()=>p,matchesOperatorSpawnCapability:()=>q,operatorSpawnCapabilityPath:()=>m,rotateOperatorSpawnCapability:()=>o});var d=c(77598),e=c.n(d),f=c(73024),g=c.n(f),h=c(76760),i=c.n(h),j=c(91724);let k=/^[A-Za-z0-9_-]{43}$/;class l extends Error{constructor(a,b,c){const d="object"==typeof c&&null!==c&&"code"in c&&"string"==typeof c.code?` (${c.code})`:"";super(`Viewer operator spawn capability ${a} failed at ${b}${d}`),this.name="OperatorSpawnCapabilityError"}}function m(){return(0,j.BQ)("operator-spawn-capability")}function n(){let a=m();try{let b=g().lstatSync(a);if(!b.isFile()||b.isSymbolicLink())return null;let c=g().readFileSync(a,"utf8").trim();if(!k.test(c))return null;return(511&b.mode)!=384&&g().chmodSync(a,384),c}catch(b){if("object"==typeof b&&null!==b&&"code"in b&&"ENOENT"===b.code)return null;throw new l("read",a,b)}}function o(){let a=e().randomBytes(32).toString("base64url"),b=m(),c=i().dirname(b),d=null;try{g().mkdirSync(c,{recursive:!0,mode:448}),d=i().join(c,`.${i().basename(b)}.${process.pid}.${e().randomUUID()}.tmp`),g().writeFileSync(d,`${a}
|
|
12
|
-
`,{encoding:"utf8",flag:"wx",mode:384}),g().chmodSync(d,384),g().renameSync(d,b)}catch(a){throw new l("write",b,a)}finally{if(d)try{g().rmSync(d,{force:!0})}catch(a){throw new l("write",b,a)}}return a}function p(){return n()??o()}function q(a){if(!k.test(a))return!1;let b=n();return!!b&&e().timingSafeEqual(Buffer.from(a),Buffer.from(b))}}};
|