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
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=6850,exports.ids=[6850],exports.modules={5602:(a,b,c)=>{c.d(b,{KP:()=>C,Kw:()=>D,dJ:()=>H});var d=c(76760),e=c.n(d),f=c(25617),g=c(58996),h=c(30096),i=c(77598),j=c.n(i),k=c(73024),l=c.n(k);let m=new Set(["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"]),n=["user:profile","user:inference","user:sessions:claude_code","user:mcp_servers","user:file_upload"],o=new Set(["user:projects:read","user:projects:write"]);function p(a){return e().join(a.home,".credentials.json")}function q(a){if(!a.authPresent)return null;try{let b=JSON.parse(l().readFileSync(p(a),"utf8"));return b&&"object"==typeof b&&!Array.isArray(b)?b:null}catch{return null}}function r(a){let b=q(a)?.claudeAiOauth;return"string"==typeof b?.accessToken&&b.accessToken.length>0&&"number"==typeof b.expiresAt&&Number.isFinite(b.expiresAt)?{expiresAt:b.expiresAt,refreshable:"string"==typeof b.refreshToken&&b.refreshToken.length>0}:null}let s={now:Date.now,fetch:globalThis.fetch};function t(a,b,c){let d=q(a)?.claudeAiOauth;if(!d||d.accessToken===b)return!1;let e=r(a);return null!==e&&e.expiresAt>c}async function u(a,b,c){for(;;)try{l().mkdirSync(a,{mode:448});let b=l().openSync(a,"r"),c=l().fstatSync(b);return()=>{try{let b=l().statSync(a);b.dev===c.dev&&b.ino===c.ino&&l().rmdirSync(a)}catch{}finally{l().closeSync(b)}}}catch(d){if("EEXIST"!==d.code)return null;let a=c-(Date.now()-b);if(a<=0)return null;await new Promise(b=>setTimeout(b,Math.min(25,a)))}}async function v(a,b){let c,d=Date.now(),f=await u(e().join(a.home,".oauth_refresh.lock"),d,b);if(!f)return null;try{c=l().realpathSync(a.home)}catch{c=a.home}let g=await u(`${c}.lock`,d,b);return g?()=>{g(),f()}:(f(),null)}async function w(a){try{let b=await a.json();return b?.error==="invalid_grant"?"invalid":"unknown"}catch{return"unknown"}}async function x(a){if(400!==a.status)return!1;try{let b=await a.clone().json();return b?.error==="invalid_scope"}catch{return!1}}async function y(a,b=s){let c=await v(a,b.lockWaitMs??8e3);if(!c)return"unknown";try{return await z(a,b)}finally{c()}}async function z(a,b){let c,d,f=q(a),g=f?.claudeAiOauth;if(!f||!g||"string"!=typeof g.accessToken||0===g.accessToken.length||"string"!=typeof g.refreshToken||0===g.refreshToken.length)return"invalid";if("number"==typeof g.expiresAt&&Number.isFinite(g.expiresAt)&&g.expiresAt>b.now())return"refreshed";let h=g.accessToken,i=Array.isArray(g.scopes)&&g.scopes.every(a=>"string"==typeof a)?g.scopes:[],k="string"==typeof g.clientId&&g.clientId.length>0,r=k?g.clientId:process.env.CLAUDE_CODE_OAUTH_CLIENT_ID||"9d1c250a-e61b-44d9-88ed-5944d1962f5e",s=!k&&(i.includes("user:inference")||!!g.subscriptionType),u=i.length>0?i:n;s&&(u=[...new Set([...n,...i.filter(a=>o.has(a))])]);let v=function(){let a=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(!a)return"https://platform.claude.com/v1/oauth/token";let b=a.replace(/\/+$/,"");return m.has(b)?`${b}/v1/oauth/token`:null}();if(!v)return"unknown";let y=AbortSignal.timeout(8e3),z=a=>b.fetch(v,{method:"POST",redirect:"manual",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:g.refreshToken,client_id:r,scope:a.join(" ")}),signal:y});try{c=await z(u),s&&i.length>0&&i.includes("user:inference")&&await x(c)&&(c=await z(i))}catch{return"unknown"}if(400===c.status||401===c.status)return t(a,h,b.now())?"refreshed":await w(c);if(!c.ok)return"unknown";try{let a=await c.json();if(!a||"object"!=typeof a||Array.isArray(a))return"unknown";d=a}catch{return"unknown"}if("string"!=typeof d.access_token||0===d.access_token.length||"number"!=typeof d.expires_in||!Number.isFinite(d.expires_in)||d.expires_in<=0)return"unknown";let A=q(a),B=A?.claudeAiOauth;if(!A||!B)return"unknown";if(B.accessToken!==h)return t(a,h,b.now())?"refreshed":"unknown";let C={...B,accessToken:d.access_token,refreshToken:"string"==typeof d.refresh_token&&d.refresh_token.length>0?d.refresh_token:g.refreshToken,expiresAt:b.now()+1e3*d.expires_in};"string"==typeof d.scope&&d.scope.trim()&&(C.scopes=d.scope.trim().split(/\s+/)),"number"==typeof d.refresh_token_expires_in&&Number.isFinite(d.refresh_token_expires_in)&&(C.refreshTokenExpiresAt=b.now()+1e3*d.refresh_token_expires_in);try{return!function(a,b){let c=p(a),d=e().join(a.home,`.${e().basename(c)}.${process.pid}.${j().randomUUID()}.tmp`);try{let e=l().openSync(d,"wx",384);try{l().writeFileSync(e,JSON.stringify(b),"utf8"),l().fsyncSync(e)}finally{l().closeSync(e)}l().renameSync(d,c);let f=l().openSync(a.home,"r");try{l().fsyncSync(f)}finally{l().closeSync(f)}}finally{l().rmSync(d,{force:!0})}}(a,{...A,claudeAiOauth:C}),"refreshed"}catch{return"unknown"}}let A=globalThis;function B(a,b){let c=A.__llvClaudeRefreshInflight??=new Map,d=`${a.id}\0${e().resolve(a.home)}`,g=c.get(d);if(g)return g;let h=Promise.resolve().then(()=>b(a)).catch(()=>(0,f.Oh)({enabled:!0,authentication:"unknown",limits:"unknown",stale:!0,retryAt:null})).finally(()=>{c.get(d)===h&&c.delete(d)});return c.set(d,h),h}class C extends Error{constructor(a){const b=[...new Set(a)].sort(),c=1===b.length?`account ${b[0]}`:b.length>1?`accounts ${b.join(", ")}`:"a Claude account";super(`No healthy Claude account is available. Re-login ${c} in Accounts and retry.`),this.name="NoHealthyClaudeAccountError",this.accountIds=b}}function D(a,b=Date.now()){let c=a.reason===h.e4||"credentials missing access token"===a.reason||a.reason?.startsWith("credentials unreadable:")?"failed":"live"===a.source?"authenticated":"unknown",d=a.data?[a.data.session,a.data.weekly].filter(a=>null!==a):[],e=d.filter(a=>Number.isFinite(a.usedPercent)&&a.usedPercent>=100),g=e.length>0?"exhausted":d.length>0?"available":"unknown",i=null;return e.length>0&&e.every(a=>Number.isSafeInteger(a.resetsAt)&&1e3*a.resetsAt>b)?i=new Date(1e3*Math.max(...e.map(a=>a.resetsAt))).toISOString():"number"==typeof a.retryAt&&Number.isFinite(a.retryAt)?i=new Date(a.retryAt).toISOString():"string"==typeof a.retryAt&&(i=a.retryAt),(0,f.Oh)({enabled:!0,authentication:c,limits:g,stale:"live"!==a.source,retryAt:i},b)}async function E(a){return D(await (0,g.nn)(e().join(a.home,".credentials.json"),Date.now,600))}async function F(a){let b=await y(a);return"invalid"===b?(0,f.Oh)({enabled:!0,authentication:"failed",limits:"unknown",stale:!1,retryAt:null}):"unknown"===b?(0,f.Oh)({enabled:!0,authentication:"unknown",limits:"unknown",stale:!0,retryAt:null}):await E(a)}let G={now:Date.now,probe:E,refresh:F};async function H(a,b,c=G,d=!0,e=b){let f=c.now(),g=a.map(a=>{let b=r(a);return{account:a,oauth:b}}),h=a=>"admissible"===a.kind?"current"===a.basis?2:1:0,i=a=>a.filter(a=>h(a.admission)>0).sort((a,b)=>h(b.admission)-h(a.admission)||Number(b.account.id===e)-Number(a.account.id===e)||a.account.id.localeCompare(b.account.id))[0],j=(a,c)=>({account:a.account,admission:a.admission,...d&&b&&c?{requestedAdmission:c.admission}:{}}),k=await Promise.all(g.filter(a=>a.oauth&&a.oauth.expiresAt>f).map(async({account:a})=>({account:a,admission:await c.probe(a)}))),l=b?k.find(a=>a.account.id===b)??null:null;if(d&&l?.admission.kind==="admissible")return j(l,l);let m=d&&b?g.find(a=>a.account.id===b&&a.oauth?.expiresAt&&a.oauth.expiresAt<=f&&a.oauth.refreshable):null;if(m&&"admissible"===(l={account:m.account,admission:await B(m.account,c.refresh)}).admission.kind)return j(l,l);let n=i(k);if(n)return j(n,l);let o=i([...k,...l?[l]:[],...await Promise.all(g.filter(a=>a.oauth?.expiresAt&&a.oauth.expiresAt<=f&&a.oauth.refreshable).filter(a=>a.account.id!==m?.account.id).map(async({account:a})=>({account:a,admission:await B(a,c.refresh)})))]);if(o)return j(o,l);throw new C(a.map(a=>a.id))}},86850:(a,b,c)=>{c.d(b,{$7:()=>p,oA:()=>q,lD:()=>s,ax:()=>n});var d=c(41617),e=c(78966),f=c(32977),g=c(68797),h=c(22962),i=c(29733),j=c(5602),k=c(92806),l=c(25617);function m(a,b){if("claude"===a){let c=(0,e.ob)(b);return{engine:a,accountId:c.id,kind:c.kind,home:c.home,transcriptRoot:c.projectsDir,env:"managed"===c.kind?(0,e.x0)(c.home):(0,k.Fd)(process.env)}}let c=(0,d.O$)(b);return{engine:a,accountId:c.id,kind:c.kind,home:c.home,transcriptRoot:c.sessionsDir,env:{...(0,k.Fd)(process.env),CODEX_HOME:c.home}}}async function n(a,b){let c=(0,i.agentRegistry)().engineRouting(a).activeAccountId??void 0,f=b??c,g=(0,l.Oh)({enabled:!1,authentication:"unknown",limits:"unknown",stale:!1,retryAt:null});if("codex"===a)try{return m(a,f)}catch(e){if(null==b||!(e instanceof d.m1))throw e;return{...m(a,c),requestedAdmission:g}}let h=(0,e.Fn)(),k=null==b||h.some(a=>a.id===b),n=await (0,j.dJ)(h,k?f:c,void 0,null!=b&&k,c);return{...m(a,n.account.id),admission:n.admission,...null!=b&&!k?{requestedAdmission:g}:n.requestedAdmission?{requestedAdmission:n.requestedAdmission}:{}}}function o(a,b){let c=("claude"===a?(0,e.Fn)():(0,d.Sq)()).find(a=>a.id===b);if(!c)throw Error(`unknown ${a} account: ${b}`);return{id:c.id,label:c.label,kind:c.kind,active:("claude"===a?(0,e.No)():(0,d.O)())===b,auth:{state:c.authPresent?"authenticated":"signed_out",method:null,email:null,plan:null,checkedAt:null},limits:{state:"unavailable",session:null,weekly:null,checkedAt:null},login:null}}class p extends Error{constructor(a,b){super(`${a} account requires authentication`),this.engine=a,this.accountId=b,this.name="AccountAuthenticationRequiredError"}}class q extends Error{constructor(a,b){super(`${a} account login is in progress`),this.engine=a,this.accountId=b,this.name="AccountLoginPendingError"}}async function r(a,b,c=(0,i.agentRegistry)()){return await (0,h.Cu)(async()=>(function(a,b,c){let h;if("claude"===a?(0,e.kK)():(0,d.J0)()){if("claude"===a)throw new e.OL;throw new d.NE}let i=("claude"===a?(0,e.Fn)():(0,d.Sq)()).find(a=>a.id===b);if(!i){if("claude"===a)throw new e.UV(b);throw new d.m1(b)}if("claude"===a?null!==(h=f.s4.forAccount(b))&&f.VO.has(h.phase):null!==i.loginPane||"pending"===(0,g.VD)().peekLogin(i).attemptState)throw new q(a,b);if(!i.authPresent)throw new p(a,b);let j="claude"===a?(0,e.No)():(0,d.O)(),k=c.engineRouting(a).activeAccountId;"claude"===a?(0,e.ss)(b):(0,d.b0)(b);try{c.setEngineRouting(a,b)}catch(f){let b=[];try{c.engineRouting(a).activeAccountId!==k&&c.setEngineRouting(a,k??j)}catch(a){b.push(a)}try{"claude"===a?(0,e.ss)(j):(0,d.b0)(j)}catch(a){b.push(a)}if(b.length>0)throw AggregateError([f,...b],"account selection rollback failed");throw f}return o(a,b)})(a,b,c))}let s={list:async()=>({claude:{active:(0,e.No)(),accounts:(0,e.Fn)().map(a=>o("claude",a.id))},codex:{active:(0,d.O)(),accounts:(0,d.Sq)().map(a=>o("codex",a.id))}}),add:async(a,b)=>await (0,h.Cu)(async()=>{let c="claude"===a?(0,e.fM)(b):(0,d.Ut)(b);return o(a,c.id)}),select:async(a,b)=>r(a,b),status:async(a,b)=>o(a,b),async submitLoginInput(){throw Error("login input is Claude-operation specific")},async cancelLogin(){throw Error("login cancellation is Claude-operation specific")},resolveSpawn:(a,b)=>m(a,b??(0,i.agentRegistry)().engineRouting(a).activeAccountId??void 0),resolveHeadlessSpawn(a,b,c=[]){let f=function(a,b,c,d,e=Date.now()){let f=new Map(b.map(a=>[a.accountId,a])),g=new Set(d),h=a.filter(a=>a.authPresent).map(a=>({account:a,capacity:function(a,b){if(!a||"live"!==a.provenance.source)return{kind:"unknown"};let c=Date.parse(a.observedAt),d=Date.parse(a.authCheckedAt);if(!Number.isFinite(c)||!Number.isFinite(d)||b<c||b<d||b-c>3e5||b-d>3e5)return{kind:"unknown"};if(!a.authenticated)return{kind:"unavailable"};if(!a.limits)return{kind:"unknown"};let e=[a.limits.session,a.limits.weekly].filter(a=>null!==a);if(!e.length||e.some(a=>!Number.isFinite(a.usedPercent)||a.usedPercent<0||a.usedPercent>100||null!==a.resetsAt&&(!Number.isSafeInteger(a.resetsAt)||a.resetsAt<0)))return{kind:"unknown"};let f=Math.min(...e.map(a=>100-a.usedPercent));if(f>0)return{kind:"available",remaining:f};let g=e.filter(a=>a.usedPercent>=100),h=Math.floor(b/1e3);return g.some(a=>null===a.resetsAt||a.resetsAt<=h)?{kind:"exhausted",resetsAt:null}:{kind:"exhausted",resetsAt:Math.max(...g.map(a=>a.resetsAt))}}(f.get(a.id),e)})).filter(a=>"unavailable"!==a.capacity.kind);if(!h.length)return{kind:"unavailable"};for(let a of[!1,!0]){let b=h.filter(b=>g.has(b.account.id)===a),d=b.flatMap(a=>"available"===a.capacity.kind?[{...a,remaining:a.capacity.remaining}]:[]).sort((a,b)=>b.remaining-a.remaining||Number(b.account.id===c)-Number(a.account.id===c)||a.account.id.localeCompare(b.account.id));if(d[0])return{kind:"available",accountId:d[0].account.id};let e=b.filter(a=>"unknown"===a.capacity.kind).sort((a,b)=>Number(b.account.id===c)-Number(a.account.id===c)||a.account.id.localeCompare(b.account.id));if(e[0])return{kind:"available",accountId:e[0].account.id}}let i=h.flatMap(a=>"exhausted"===a.capacity.kind&&null!==a.capacity.resetsAt?[a.capacity.resetsAt]:[]);return{kind:"exhausted",resetsAt:i.length?Math.min(...i):null}}("claude"===a?(0,e.Fn)():(0,d.Sq)(),(0,i.agentRegistry)().quotaObservations(a),b??(0,i.agentRegistry)().engineRouting(a).activeAccountId,c);return"available"===f.kind?{kind:"available",account:m(a,f.accountId)}:f},resolveTranscriptOwner(a,b){let c=(0,i.agentRegistry)().transcriptAccountId(a,b);if(c)if("claude"===a){let b=(0,e.Fn)().find(a=>a.id===c);if(b)return{engine:a,accountId:b.id,kind:b.kind,home:b.home,transcriptRoot:b.projectsDir,env:"managed"===b.kind?(0,e.x0)(b.home):(0,k.Fd)(process.env)}}else{let b=(0,d.Sq)().find(a=>a.id===c);if(b)return{engine:a,accountId:b.id,kind:b.kind,home:b.home,transcriptRoot:b.sessionsDir,env:{...(0,k.Fd)(process.env),CODEX_HOME:b.home}}}if("claude"===a){let c=(0,e.y3)(b);if(!c)return null;let d=(0,e.Fn)().find(a=>a.home===c);return d?{engine:a,accountId:d.id,kind:d.kind,home:c,transcriptRoot:d.projectsDir,env:"managed"===d.kind?(0,e.x0)(c):(0,k.Fd)(process.env)}:null}let f=(0,d.yN)(b);if(!f)return null;let g=(0,d.Sq)().find(a=>a.home===f);return g?{engine:a,accountId:g.id,kind:g.kind,home:f,transcriptRoot:g.sessionsDir,env:{...(0,k.Fd)(process.env),CODEX_HOME:f}}:null}}}};
|
|
1
|
+
"use strict";exports.id=6850,exports.ids=[6850],exports.modules={5602:(a,b,c)=>{c.d(b,{KP:()=>C,Kw:()=>D,dJ:()=>H});var d=c(76760),e=c.n(d),f=c(25617),g=c(58996),h=c(30096),i=c(77598),j=c.n(i),k=c(73024),l=c.n(k);let m=new Set(["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"]),n=["user:profile","user:inference","user:sessions:claude_code","user:mcp_servers","user:file_upload"],o=new Set(["user:projects:read","user:projects:write"]);function p(a){return e().join(a.home,".credentials.json")}function q(a){if(!a.authPresent)return null;try{let b=JSON.parse(l().readFileSync(p(a),"utf8"));return b&&"object"==typeof b&&!Array.isArray(b)?b:null}catch{return null}}function r(a){let b=q(a)?.claudeAiOauth;return"string"==typeof b?.accessToken&&b.accessToken.length>0&&"number"==typeof b.expiresAt&&Number.isFinite(b.expiresAt)?{expiresAt:b.expiresAt,refreshable:"string"==typeof b.refreshToken&&b.refreshToken.length>0}:null}let s={now:Date.now,fetch:globalThis.fetch};function t(a,b,c){let d=q(a)?.claudeAiOauth;if(!d||d.accessToken===b)return!1;let e=r(a);return null!==e&&e.expiresAt>c}async function u(a,b,c){for(;;)try{l().mkdirSync(a,{mode:448});let b=l().openSync(a,"r"),c=l().fstatSync(b);return()=>{try{let b=l().statSync(a);b.dev===c.dev&&b.ino===c.ino&&l().rmdirSync(a)}catch{}finally{l().closeSync(b)}}}catch(d){if("EEXIST"!==d.code)return null;let a=c-(Date.now()-b);if(a<=0)return null;await new Promise(b=>setTimeout(b,Math.min(25,a)))}}async function v(a,b){let c,d=Date.now(),f=await u(e().join(a.home,".oauth_refresh.lock"),d,b);if(!f)return null;try{c=l().realpathSync(a.home)}catch{c=a.home}let g=await u(`${c}.lock`,d,b);return g?()=>{g(),f()}:(f(),null)}async function w(a){try{let b=await a.json();return b?.error==="invalid_grant"?"invalid":"unknown"}catch{return"unknown"}}async function x(a){if(400!==a.status)return!1;try{let b=await a.clone().json();return b?.error==="invalid_scope"}catch{return!1}}async function y(a,b=s){let c=await v(a,b.lockWaitMs??8e3);if(!c)return"unknown";try{return await z(a,b)}finally{c()}}async function z(a,b){let c,d,f=q(a),g=f?.claudeAiOauth;if(!f||!g||"string"!=typeof g.accessToken||0===g.accessToken.length||"string"!=typeof g.refreshToken||0===g.refreshToken.length)return"invalid";if("number"==typeof g.expiresAt&&Number.isFinite(g.expiresAt)&&g.expiresAt>b.now())return"refreshed";let h=g.accessToken,i=Array.isArray(g.scopes)&&g.scopes.every(a=>"string"==typeof a)?g.scopes:[],k="string"==typeof g.clientId&&g.clientId.length>0,r=k?g.clientId:process.env.CLAUDE_CODE_OAUTH_CLIENT_ID||"9d1c250a-e61b-44d9-88ed-5944d1962f5e",s=!k&&(i.includes("user:inference")||!!g.subscriptionType),u=i.length>0?i:n;s&&(u=[...new Set([...n,...i.filter(a=>o.has(a))])]);let v=function(){let a=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(!a)return"https://platform.claude.com/v1/oauth/token";let b=a.replace(/\/+$/,"");return m.has(b)?`${b}/v1/oauth/token`:null}();if(!v)return"unknown";let y=AbortSignal.timeout(8e3),z=a=>b.fetch(v,{method:"POST",redirect:"manual",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:g.refreshToken,client_id:r,scope:a.join(" ")}),signal:y});try{c=await z(u),s&&i.length>0&&i.includes("user:inference")&&await x(c)&&(c=await z(i))}catch{return"unknown"}if(400===c.status||401===c.status)return t(a,h,b.now())?"refreshed":await w(c);if(!c.ok)return"unknown";try{let a=await c.json();if(!a||"object"!=typeof a||Array.isArray(a))return"unknown";d=a}catch{return"unknown"}if("string"!=typeof d.access_token||0===d.access_token.length||"number"!=typeof d.expires_in||!Number.isFinite(d.expires_in)||d.expires_in<=0)return"unknown";let A=q(a),B=A?.claudeAiOauth;if(!A||!B)return"unknown";if(B.accessToken!==h)return t(a,h,b.now())?"refreshed":"unknown";let C={...B,accessToken:d.access_token,refreshToken:"string"==typeof d.refresh_token&&d.refresh_token.length>0?d.refresh_token:g.refreshToken,expiresAt:b.now()+1e3*d.expires_in};"string"==typeof d.scope&&d.scope.trim()&&(C.scopes=d.scope.trim().split(/\s+/)),"number"==typeof d.refresh_token_expires_in&&Number.isFinite(d.refresh_token_expires_in)&&(C.refreshTokenExpiresAt=b.now()+1e3*d.refresh_token_expires_in);try{return!function(a,b){let c=p(a),d=e().join(a.home,`.${e().basename(c)}.${process.pid}.${j().randomUUID()}.tmp`);try{let e=l().openSync(d,"wx",384);try{l().writeFileSync(e,JSON.stringify(b),"utf8"),l().fsyncSync(e)}finally{l().closeSync(e)}l().renameSync(d,c);let f=l().openSync(a.home,"r");try{l().fsyncSync(f)}finally{l().closeSync(f)}}finally{l().rmSync(d,{force:!0})}}(a,{...A,claudeAiOauth:C}),"refreshed"}catch{return"unknown"}}let A=globalThis;function B(a,b){let c=A.__llvClaudeRefreshInflight??=new Map,d=`${a.id}\0${e().resolve(a.home)}`,g=c.get(d);if(g)return g;let h=Promise.resolve().then(()=>b(a)).catch(()=>(0,f.Oh)({enabled:!0,authentication:"unknown",limits:"unknown",stale:!0,retryAt:null})).finally(()=>{c.get(d)===h&&c.delete(d)});return c.set(d,h),h}class C extends Error{constructor(a){const b=[...new Set(a)].sort(),c=1===b.length?`account ${b[0]}`:b.length>1?`accounts ${b.join(", ")}`:"a Claude account";super(`No healthy Claude account is available. Re-login ${c} in Accounts and retry.`),this.name="NoHealthyClaudeAccountError",this.accountIds=b}}function D(a,b=Date.now()){let c=a.reason===h.e4||"credentials missing access token"===a.reason||a.reason?.startsWith("credentials unreadable:")?"failed":"live"===a.source?"authenticated":"unknown",d=a.data?[a.data.session,a.data.weekly].filter(a=>null!==a):[],e=d.filter(a=>Number.isFinite(a.usedPercent)&&a.usedPercent>=100),g=e.length>0?"exhausted":d.length>0?"available":"unknown",i=null;return e.length>0&&e.every(a=>Number.isSafeInteger(a.resetsAt)&&1e3*a.resetsAt>b)?i=new Date(1e3*Math.max(...e.map(a=>a.resetsAt))).toISOString():"number"==typeof a.retryAt&&Number.isFinite(a.retryAt)?i=new Date(a.retryAt).toISOString():"string"==typeof a.retryAt&&(i=a.retryAt),(0,f.Oh)({enabled:!0,authentication:c,limits:g,stale:"live"!==a.source,retryAt:i},b)}async function E(a){return D(await (0,g.nn)(e().join(a.home,".credentials.json"),Date.now,600))}async function F(a){let b=await y(a);return"invalid"===b?(0,f.Oh)({enabled:!0,authentication:"failed",limits:"unknown",stale:!1,retryAt:null}):"unknown"===b?(0,f.Oh)({enabled:!0,authentication:"unknown",limits:"unknown",stale:!0,retryAt:null}):await E(a)}let G={now:Date.now,probe:E,refresh:F};async function H(a,b,c=G,d=!0,e=b){let f=c.now(),g=a.map(a=>{let b=r(a);return{account:a,oauth:b}}),h=a=>"admissible"===a.kind?"current"===a.basis?2:1:0,i=a=>a.filter(a=>h(a.admission)>0).sort((a,b)=>h(b.admission)-h(a.admission)||Number(b.account.id===e)-Number(a.account.id===e)||a.account.id.localeCompare(b.account.id))[0],j=(a,c)=>({account:a.account,admission:a.admission,...d&&b&&c?{requestedAdmission:c.admission}:{}}),k=await Promise.all(g.filter(a=>a.oauth&&a.oauth.expiresAt>f).map(async({account:a})=>({account:a,admission:await c.probe(a)}))),l=b?k.find(a=>a.account.id===b)??null:null;if(d&&l?.admission.kind==="admissible")return j(l,l);let m=d&&b?g.find(a=>a.account.id===b&&a.oauth?.expiresAt&&a.oauth.expiresAt<=f&&a.oauth.refreshable):null;if(m&&"admissible"===(l={account:m.account,admission:await B(m.account,c.refresh)}).admission.kind)return j(l,l);let n=i(k);if(n)return j(n,l);let o=i([...k,...l?[l]:[],...await Promise.all(g.filter(a=>a.oauth?.expiresAt&&a.oauth.expiresAt<=f&&a.oauth.refreshable).filter(a=>a.account.id!==m?.account.id).map(async({account:a})=>({account:a,admission:await B(a,c.refresh)})))]);if(o)return j(o,l);throw new C(a.map(a=>a.id))}},86850:(a,b,c)=>{c.d(b,{$7:()=>p,oA:()=>q,accountManager:()=>s,ax:()=>n});var d=c(41617),e=c(78966),f=c(14565),g=c(68797),h=c(22962),i=c(21872),j=c(5602),k=c(92806),l=c(25617);function m(a,b){if("claude"===a){let c=(0,e.ob)(b);return{engine:a,accountId:c.id,kind:c.kind,home:c.home,transcriptRoot:c.projectsDir,env:"managed"===c.kind?(0,e.x0)(c.home):(0,k.Fd)(process.env)}}let c=(0,d.O$)(b);return{engine:a,accountId:c.id,kind:c.kind,home:c.home,transcriptRoot:c.sessionsDir,env:{...(0,k.Fd)(process.env),CODEX_HOME:c.home}}}async function n(a,b){let c=(0,i.agentRegistry)().engineRouting(a).activeAccountId??void 0,f=b??c,g=(0,l.Oh)({enabled:!1,authentication:"unknown",limits:"unknown",stale:!1,retryAt:null});if("codex"===a)try{return m(a,f)}catch(e){if(null==b||!(e instanceof d.m1))throw e;return{...m(a,c),requestedAdmission:g}}let h=(0,e.Fn)(),k=null==b||h.some(a=>a.id===b),n=await (0,j.dJ)(h,k?f:c,void 0,null!=b&&k,c);return{...m(a,n.account.id),admission:n.admission,...null!=b&&!k?{requestedAdmission:g}:n.requestedAdmission?{requestedAdmission:n.requestedAdmission}:{}}}function o(a,b){let c=("claude"===a?(0,e.Fn)():(0,d.Sq)()).find(a=>a.id===b);if(!c)throw Error(`unknown ${a} account: ${b}`);return{id:c.id,label:c.label,kind:c.kind,active:("claude"===a?(0,e.No)():(0,d.O)())===b,auth:{state:c.authPresent?"authenticated":"signed_out",method:null,email:null,plan:null,checkedAt:null},limits:{state:"unavailable",session:null,weekly:null,checkedAt:null},login:null}}class p extends Error{constructor(a,b){super(`${a} account requires authentication`),this.engine=a,this.accountId=b,this.name="AccountAuthenticationRequiredError"}}class q extends Error{constructor(a,b){super(`${a} account login is in progress`),this.engine=a,this.accountId=b,this.name="AccountLoginPendingError"}}async function r(a,b,c=(0,i.agentRegistry)()){return await (0,h.Cu)(async()=>(function(a,b,c){let h;if("claude"===a?(0,e.kK)():(0,d.J0)()){if("claude"===a)throw new e.OL;throw new d.NE}let i=("claude"===a?(0,e.Fn)():(0,d.Sq)()).find(a=>a.id===b);if(!i){if("claude"===a)throw new e.UV(b);throw new d.m1(b)}if("claude"===a?null!==(h=f.s4.forAccount(b))&&f.VO.has(h.phase):null!==i.loginPane||"pending"===(0,g.VD)().peekLogin(i).attemptState)throw new q(a,b);if(!i.authPresent)throw new p(a,b);let j="claude"===a?(0,e.No)():(0,d.O)(),k=c.engineRouting(a).activeAccountId;"claude"===a?(0,e.ss)(b):(0,d.b0)(b);try{c.setEngineRouting(a,b)}catch(f){let b=[];try{c.engineRouting(a).activeAccountId!==k&&c.setEngineRouting(a,k??j)}catch(a){b.push(a)}try{"claude"===a?(0,e.ss)(j):(0,d.b0)(j)}catch(a){b.push(a)}if(b.length>0)throw AggregateError([f,...b],"account selection rollback failed");throw f}return o(a,b)})(a,b,c))}let s={list:async()=>({claude:{active:(0,e.No)(),accounts:(0,e.Fn)().map(a=>o("claude",a.id))},codex:{active:(0,d.O)(),accounts:(0,d.Sq)().map(a=>o("codex",a.id))}}),add:async(a,b)=>await (0,h.Cu)(async()=>{let c="claude"===a?(0,e.fM)(b):(0,d.Ut)(b);return o(a,c.id)}),select:async(a,b)=>r(a,b),status:async(a,b)=>o(a,b),async submitLoginInput(){throw Error("login input is Claude-operation specific")},async cancelLogin(){throw Error("login cancellation is Claude-operation specific")},resolveSpawn:(a,b)=>m(a,b??(0,i.agentRegistry)().engineRouting(a).activeAccountId??void 0),resolveHeadlessSpawn(a,b,c=[]){let f=function(a,b,c,d,e=Date.now()){let f=new Map(b.map(a=>[a.accountId,a])),g=new Set(d),h=a.filter(a=>a.authPresent).map(a=>({account:a,capacity:function(a,b){if(!a||"live"!==a.provenance.source)return{kind:"unknown"};let c=Date.parse(a.observedAt),d=Date.parse(a.authCheckedAt);if(!Number.isFinite(c)||!Number.isFinite(d)||b<c||b<d||b-c>3e5||b-d>3e5)return{kind:"unknown"};if(!a.authenticated)return{kind:"unavailable"};if(!a.limits)return{kind:"unknown"};let e=[a.limits.session,a.limits.weekly].filter(a=>null!==a);if(!e.length||e.some(a=>!Number.isFinite(a.usedPercent)||a.usedPercent<0||a.usedPercent>100||null!==a.resetsAt&&(!Number.isSafeInteger(a.resetsAt)||a.resetsAt<0)))return{kind:"unknown"};let f=Math.min(...e.map(a=>100-a.usedPercent));if(f>0)return{kind:"available",remaining:f};let g=e.filter(a=>a.usedPercent>=100),h=Math.floor(b/1e3);return g.some(a=>null===a.resetsAt||a.resetsAt<=h)?{kind:"exhausted",resetsAt:null}:{kind:"exhausted",resetsAt:Math.max(...g.map(a=>a.resetsAt))}}(f.get(a.id),e)})).filter(a=>"unavailable"!==a.capacity.kind);if(!h.length)return{kind:"unavailable"};for(let a of[!1,!0]){let b=h.filter(b=>g.has(b.account.id)===a),d=b.flatMap(a=>"available"===a.capacity.kind?[{...a,remaining:a.capacity.remaining}]:[]).sort((a,b)=>b.remaining-a.remaining||Number(b.account.id===c)-Number(a.account.id===c)||a.account.id.localeCompare(b.account.id));if(d[0])return{kind:"available",accountId:d[0].account.id};let e=b.filter(a=>"unknown"===a.capacity.kind).sort((a,b)=>Number(b.account.id===c)-Number(a.account.id===c)||a.account.id.localeCompare(b.account.id));if(e[0])return{kind:"available",accountId:e[0].account.id}}let i=h.flatMap(a=>"exhausted"===a.capacity.kind&&null!==a.capacity.resetsAt?[a.capacity.resetsAt]:[]);return{kind:"exhausted",resetsAt:i.length?Math.min(...i):null}}("claude"===a?(0,e.Fn)():(0,d.Sq)(),(0,i.agentRegistry)().quotaObservations(a),b??(0,i.agentRegistry)().engineRouting(a).activeAccountId,c);return"available"===f.kind?{kind:"available",account:m(a,f.accountId)}:f},resolveTranscriptOwner(a,b){let c=(0,i.agentRegistry)().transcriptAccountId(a,b);if(c)if("claude"===a){let b=(0,e.Fn)().find(a=>a.id===c);if(b)return{engine:a,accountId:b.id,kind:b.kind,home:b.home,transcriptRoot:b.projectsDir,env:"managed"===b.kind?(0,e.x0)(b.home):(0,k.Fd)(process.env)}}else{let b=(0,d.Sq)().find(a=>a.id===c);if(b)return{engine:a,accountId:b.id,kind:b.kind,home:b.home,transcriptRoot:b.sessionsDir,env:{...(0,k.Fd)(process.env),CODEX_HOME:b.home}}}if("claude"===a){let c=(0,e.y3)(b);if(!c)return null;let d=(0,e.Fn)().find(a=>a.home===c);return d?{engine:a,accountId:d.id,kind:d.kind,home:c,transcriptRoot:d.projectsDir,env:"managed"===d.kind?(0,e.x0)(c):(0,k.Fd)(process.env)}:null}let f=(0,d.yN)(b);if(!f)return null;let g=(0,d.Sq)().find(a=>a.home===f);return g?{engine:a,accountId:g.id,kind:g.kind,home:f,transcriptRoot:g.sessionsDir,env:{...(0,k.Fd)(process.env),CODEX_HOME:f}}:null}}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=6909,exports.ids=[6909],exports.modules={56909:(a,b,c)=>{c.d(b,{applyConversationAction:()=>w});var d=c(
|
|
1
|
+
"use strict";exports.id=6909,exports.ids=[6909],exports.modules={56909:(a,b,c)=>{c.d(b,{applyConversationAction:()=>w});var d=c(4116),e=c(50887),f=c(29966),g=c(61899),h=c(2208),i=c(53133),j=c(10456),k=c(31973),l=c(88602),m=c(65862),n=c(873),o=c(96694),p=c(36493);let q=new Set(["interrupt","kill","reconfigure","compact"]);async function r(a,b={}){if(!a.action||!(b.enabled??(()=>(0,f.cM)()))())return null;let c=b.registry??(0,d.tk)(),e=a.path?c.conversationForPath(a.path):a.conversationId.startsWith("conversation_")?c.conversation(a.conversationId):null,s=e?.generations.at(-1);if(!e||!s)return null;let t=c.readOnlySnapshot(),u=t.entries[(0,k.pp)({engine:e.engine,sessionId:s.id})];if(!u)return null;let v="kill"===a.action&&!u.host,w="reconfigure"===a.action&&!u.host&&Object.values(t.receipts).some(a=>"structured"===a.transport&&"completed"===a.state&&c.canonicalConversationId(a.conversationId)===e.id),x="reconfigure"===a.action&&!u.host&&(e.reconfigure?.status==="applying"||w);if(!u.structuredHost&&!v&&!x)return null;if(!q.has(a.action)){if("resume"===a.action){if("dead"===u.status||"unhosted"===u.status)return null;try{if((b.hostProcessAlive??p.structuredHostProcessAlive)(u.structuredHost?.process??null)){if(!await (b.republish??n.A)({engine:e.engine,sessionId:s.id}))return{status:503,body:{error:"structured recovery ownership is unavailable"}};return{status:200,body:{ok:!0,structured:!0,target:e.id,outcome:"resumed",spawned:!1}}}let d=await (b.recover??p.recoverDeadStructuredConversation)({path:a.path||s.path,conversationId:e.id},{registry:c});if(!d)return{status:503,body:{error:"structured recovery ownership is unavailable"}};return{status:200,body:{ok:!0,structured:!0,target:e.id,outcome:"resumed",spawned:d.spawned}}}catch(a){return{status:503,body:{error:a instanceof Error?a.message:String(a)}}}}let d=["dialog-key","kill","reconfigure"].includes(a.action)?a.action:"requested";return{status:409,body:{error:`structured host does not support the ${d} control`}}}if("compact"===a.action){let a=(0,m.s_)(e.engine),b=u.structuredHost?.kind;if(!a.supported||"codex-app-server"!==b&&"claude-broker"!==b)return{status:409,body:{error:a.reason??`the ${e.engine} structured host does not expose a compact control`,code:"unsupported-capability",capability:a}}}if(v&&!u.structuredHost?.process&&("dead"===u.status||"unhosted"===u.status))return{status:200,body:{ok:!0,structured:!0,target:e.id,outcome:"delivered"}};let y=void 0===b.client?(0,l.sS)():b.client;if(!y)return{status:503,body:{error:"structured runtime host is unavailable"}};let z=a.operationId??(b.operationId??m.Lu)();try{let c="reconfigure"===a.action?function(a,b){let c="string"==typeof b.model?b.model.trim():"",d="claude"===a?(0,h.OV)(c):(0,h.g9)(c)?c:null,e=h.cC[a].some(a=>a.id===d);if(!d||!e)return{error:`model is not supported by ${a}`};let f="string"==typeof b.effort?b.effort.trim():"";if(!(0,g.ve)(a,d)?.includes(f))return{error:`effort is not supported by ${a} model ${d}`};if("claude"===a&&void 0!==b.fast&&null!==b.fast)return{error:"speed is only supported by codex"};if("codex"===a&&"boolean"!=typeof b.fast)return{error:"speed must be selected for codex"};let i=void 0===b.accountId||null===b.accountId||""===b.accountId?void 0:"string"==typeof b.accountId?b.accountId.trim():"";return void 0===i||/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(i)?{value:{model:d,effort:f,fast:"codex"===a?b.fast:null,...i?{accountId:i}:{}}}:{error:"account is invalid"}}(e.engine,a.reconfiguration??{}):null;if(c&&!c.value)return{status:400,body:{error:c.error??"invalid configuration"}};if(c?.value?.accountId&&!(b.accountExists??((a,b)=>("claude"===a?(0,i.Fn)():(0,j.Sq)()).some(a=>a.id===b)))(e.engine,c.value.accountId))return{status:400,body:{error:`account is not available for ${e.engine}`}};let d={engine:e.engine,sessionId:s.id},f="kill"===a.action?{kind:"kill",operationId:z,idempotencyKey:z,conversationId:e.id,sessionKey:d}:"compact"===a.action?{kind:"compact",operationId:z,idempotencyKey:z,conversationId:e.id,sessionKey:d}:"reconfigure"===a.action?{kind:"reconfigure",operationId:z,idempotencyKey:z,conversationId:e.id,sessionKey:d,...c.value,previousProfile:{model:s.launchProfile.model,effort:s.launchProfile.effort,fast:s.launchProfile.fast}}:{kind:"interrupt",operationId:z,idempotencyKey:z,conversationId:e.id,turnId:u.structuredHost?.activeTurnRef??null},k=await y.command(f);return(b.kick??o.l)(),{status:"delivered"===k.receipt.status?200:202,body:{ok:!0,structured:!0,target:e.id,operationId:z,receipt:k.receipt}}}catch(c){if(("kill"===a.action||"reconfigure"===a.action||"compact"===a.action)&&(0,l.o7)(c)){let a=await y.operationStatus(z).catch(()=>null);if(a)return(b.kick??o.l)(),{status:"delivered"===a.receipt.status?200:202,body:{ok:!0,structured:!0,target:e.id,operationId:a.operationId,receipt:a.receipt}}}return{status:503,body:{error:c instanceof Error?c.message:String(c)}}}}let s=["interrupt","kill","resume","compact","dialog-key"],t={registry:d.tk,structuredEnabled:()=>(0,f.cM)(),dispatchStructuredControl:r,interruptConversation:e.F5,killConversation:e.yv,resumeConversation:e.X$,compactConversation:e.LJ,answerDialogKey:e.m3};function u(a,b){return{status:b,body:{error:a}}}function v(a){if(a.ok)return{status:200,body:a};let{status:b,...c}=a;return{status:b,body:c}}async function w(a,b=t){if(!s.includes(a.action))return u("unsupported conversation action",400);if(a.conversationId&&!a.conversationId.startsWith("conversation_"))return u("invalid conversation id",400);let c=b.registry(),d=a.conversationId?c.conversation(a.conversationId):null,e=a.transcriptPath?c.conversationForPath(a.transcriptPath):null;if(a.conversationId&&!d)return u("viewer conversation is unknown",404);if(d&&a.transcriptPath&&(!new Set([...d.generations.map(a=>a.path),...d.continuityPaths]).has(a.transcriptPath)||e?.id!==d.id))return u("conversation identity does not own transcript path",409);let f=d??e,g=d?.generations.at(-1)?.path??a.transcriptPath;if(b.structuredEnabled()){let c=await b.dispatchStructuredControl({path:g,conversationId:f?.id??a.conversationId,action:a.action,operationId:a.operationId});if(c)return c}if(!g)return u("conversationId or transcriptPath is required",400);if("interrupt"===a.action)return v(await b.interruptConversation(g));if("kill"===a.action){let a=await b.killConversation(g);return a.ok&&!a.target?v({ok:!1,outcome:"failed",error:"kill resolved no registered pane",status:409}):v(a)}return"resume"===a.action?v(await b.resumeConversation(g)):"compact"===a.action?v(await b.compactConversation(g)):v(await b.answerDialogKey(g,a.key??"",a.label,a.question))}}};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";exports.id=6942,exports.ids=[6942],exports.modules={66942:(a,b,c)=>{c.d(b,{CP:()=>K,H2:()=>M,A9:()=>L,hA:()=>am,PU:()=>z});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(23921),t=c(36177),u=c(64487),v=c(27471),w=c(91724),x=c(92806),y=c(30096);function z(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 A(){return{systemMemory:0,readFiles:0,readHosts:0,ppidMap:0,processMemory:0,attach:0,serialization:0}}function B(a,b,c){let d=performance.now();try{return c()}finally{a[b]+=performance.now()-d}}async function C(a,b,c){let d=performance.now();try{return await c()}finally{a[b]+=performance.now()-d}}function D(a){return"number"==typeof a&&Number.isFinite(a)&&a>=0}function E(a=d.B){let b=a.systemMemory();return b?{...b,capturedAt:new Date().toISOString()}:null}function F(a){return"structured"===a.kind}let G=globalThis;function H(){let a=G.__llvLastResourceBuild;return a?{...a,phases:{...a.phases}}:null}function I(a){let b=new Map;for(let{target:c,ref:d}of a)b.set(c,d);G.__llvResourceTargets=b,J([...b].map(([a,b])=>({target:a,ref:b})))}function J(a){G.__llvLastResourceTargets=[...a].map(({target:a,ref:b})=>({target:a,ref:b}))}function K(a){if(""===a)return null;let b=G.__llvResourceTargets?.get(a)??null;return null===b||F(b)?null:b}function L(a){G.__llvResourceTargets?.delete(a)&&(G.__llvResourceTargetEpoch=(G.__llvResourceTargetEpoch??0)+1)}function M(a){if(""===a)return null;let b=G.__llvResourceTargets?.get(a)??null;return null!==b&&F(b)?b:null}function N(a){return new Date(1e3*a).toISOString()}async function O(){return(await c.e(9488).then(c.bind(c,9488))).readStructuredHostRecords()}let P={readFiles:async a=>{let b=await Q(a);return(0,t.iD)(b),b},readHosts:(a,b,c)=>(0,u.oe)(a,b,c),proc:d.B,captureAttachReferences:v.yq,readStructuredHosts:O,listAgentProcesses:s.Bj,directoryExists:a=>(0,g.existsSync)(a),processIdentity:a=>d.B.processIdentity(a),hostStamp:s.Tu};async function Q(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 R(a,b,c){let e=await c.readStructuredHosts?.(a)??[],f=c.processIdentity??(a=>d.B.processIdentity(a)),g=c.hostStamp??s.Tu,h=(0,s.TK)(),i=[],j=new Set;for(let a of e){if(!Number.isSafeInteger(a.pid)||a.pid<=1||j.has(a.pid))continue;let b=f(a.pid);if(null!==b&&(null===a.startIdentity||a.startIdentity===b)&&(j.add(a.pid),i.push({...a,startIdentity:b}),i.length>=y.sb))break}for(let d of c.listAgentProcesses?.(a)??[]){if(i.length>=y.sb)break;if(j.has(d.pid)||(0,s.qM)(d.argv))continue;let a=(0,s.qP)(d.argv);if(null===a||g(d.pid)!==h)continue;let c=function(a,b,c,d){let e=a,f=new Set([a]);for(;;){let a=b.get(e);if(void 0===a||a<=1||f.has(a)||c(a)!==d)return e;f.add(a),e=a}}(d.pid,b,g,h);if(j.has(c))continue;let e=f(c);null!==e&&(j.add(d.pid),j.add(c),i.push({id:`pid:${c}`,engine:a,sessionId:null,pid:c,startIdentity:e,cwd:d.cwd,path:null,conversationId:null,title:null,role:null,model:null,stage:null,seat:null,turnBusy:null,owned:!1}))}return i.map(a=>({record:a,tree:(0,r.mO)(a.pid,b)}))}async function S(a,b=P){let c=performance.now(),d=A();try{let e=B(d,"systemMemory",()=>E(b.proc)),f=await C(d,"readFiles",()=>b.readFiles(a)),g=B(d,"ppidMap",()=>b.proc.ppidMap()),h=await C(d,"readHosts",()=>b.readHosts(a,f,g)),i=await C(d,"readHosts",()=>R(a,g,b)),j=[],k=new Map(f.map(a=>[a.path,a])),l=new Map;for(let a of h.hosts){let b=l.get(a.paneId);b?b.push(a):l.set(a.paneId,[a])}let m=[],n=new Set;for(let a of l.values()){let b=a[0],c=(0,r.mO)(b.panePid,g);for(let d of(m.push({host:b,tree:c,paneHosts:a}),c))n.add(d)}let o=[];for(let a of i)if(!n.has(a.record.pid))for(let b of(o.push(a),a.tree))n.add(b);let p=B(d,"processMemory",()=>b.proc.processMemory(n)),q=a=>{let b=0,c=0;for(let d of a){let a=p.get(d);a&&(b+=a.rssBytes,c+=a.swapBytes)}return{rssBytes:b,swapBytes:c}},s=[];for(let{record:a,tree:c}of(B(d,"attach",()=>{let a=b.captureAttachReferences(m.map(({host:a})=>({tmuxServerPid:a.tmuxServerPid,panePid:a.panePid,paneId:a.paneId})));for(let{host:b,tree:c,paneHosts:d}of m){let e=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,d,k);j.push({target:b.display,panePid:b.panePid,path:e?.path??null,engine:b.engine,hostConflict:function(a,b){return a.conflicts?.some(a=>a.paneIds.includes(b.paneId))??!1}(h,b),title:e?.title??null,project:e?.project||null,activity:e?.activity??null,lastActiveAt:e?N(e.mtime):null,cwd:b.cwd,...q(c),procCount:c.length});let f=a.get(b.paneId);f&&s.push({target:b.display,ref:f})}}),o)){let d=a.path?k.get(a.path)??null:null,e=d?N(d.mtime):null,f="structured:"+a.id;j.push({target:f,panePid:a.pid,kind:"structured",path:a.path,engine:a.engine,title:a.title??d?.title??null,project:d?.project||null,activity:d?.activity??null,lastActiveAt:e,cwd:a.cwd||null,...q(c),procCount:c.length,model:a.model,role:a.role,conversationId:a.conversationId,stage:a.stage,ownership:null===a.sessionId||a.cwd.length>0&&b.directoryExists?.(a.cwd)===!1?"orphaned":a.owned?"owned":"released",seat:a.seat,turnBusy:a.turnBusy}),s.push({target:f,ref:{kind:"structured",pid:a.pid,startIdentity:a.startIdentity,engine:a.engine,sessionId:a.sessionId,conversationId:a.conversationId,seat:a.seat,turnBusy:a.turnBusy,owned:a.owned,lastActiveAt:e}})}return j.sort((a,b)=>b.rssBytes+b.swapBytes-(a.rssBytes+a.swapBytes)),J(s),G.__llvLastResourceBuild={fresh:a,status:"complete",durationMs:performance.now()-c,phases:d},{system:e,sessions:j}}catch(b){throw G.__llvLastResourceBuild={fresh:a,status:"failed",durationMs:performance.now()-c,phases:d},b}}let T="resources-observation.json",U=`
|
|
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
|
+
`,V=`
|
|
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 W(a){try{let b=(0,g.statSync)(a);return b.isFile()&&(73&b.mode)!=0}catch{return!1}}function X(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 Y="LLV_RESOURCE_COLLECTOR_OWNER",Z={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?X(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)&&X(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=`${Y}=${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=`${Y}=${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 $(a,b,c=[],d=G.__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 _(a){return"object"==typeof a&&null!==a&&!Array.isArray(a)}function aa(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 ab(a){return null===a||"string"==typeof a}function ac(a){return null===a||"boolean"==typeof a}function ad(a){return!!_(a)&&!!aa(a,["target","panePid","path","engine","title","project","activity","lastActiveAt","cwd","rssBytes","swapBytes","procCount"],["hostConflict","kind","model","role","conversationId","stage","ownership","seat","turnBusy"])&&(void 0===a.kind||"tmux"===a.kind||"structured"===a.kind)&&(void 0===a.ownership||"owned"===a.ownership||"released"===a.ownership||"orphaned"===a.ownership)&&(void 0===a.model||!!ab(a.model))&&(void 0===a.role||!!ab(a.role))&&(void 0===a.conversationId||!!ab(a.conversationId))&&(void 0===a.stage||!!ab(a.stage))&&(void 0===a.seat||!!ac(a.seat))&&(void 0===a.turnBusy||!!ac(a.turnBusy))&&"string"==typeof a.target&&a.target.length>0&&Number.isSafeInteger(a.panePid)&&a.panePid>0&&ab(a.path)&&("claude"===a.engine||"codex"===a.engine||null===a.engine)&&ab(a.title)&&ab(a.project)&&("live"===a.activity||"recent"===a.activity||"stalled"===a.activity||"idle"===a.activity||null===a.activity)&&ab(a.lastActiveAt)&&(null===a.lastActiveAt||Number.isFinite(Date.parse(a.lastActiveAt)))&&ab(a.cwd)&&D(a.rssBytes)&&D(a.swapBytes)&&Number.isSafeInteger(a.procCount)&&a.procCount>=0&&(void 0===a.hostConflict||"boolean"==typeof a.hostConflict)}function ae(a){var b;return!!_(a)&&!!aa(a,["system","sessions"])&&!!(null===(b=a.system)||_(b)&&aa(b,["ramTotal","ramAvailable","swapTotal","swapUsed","capturedAt"])&&D(b.ramTotal)&&D(b.ramAvailable)&&D(b.swapTotal)&&D(b.swapUsed)&&"string"==typeof b.capturedAt&&Number.isFinite(Date.parse(b.capturedAt)))&&!!Array.isArray(a.sessions)&&a.sessions.length<=1e4&&a.sessions.every(ad)}function af(a){if(!_(a)||!aa(a,["fresh","status","durationMs","phases"])||!_(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)&&D(a.durationMs)&&aa(b,c)&&c.every(a=>D(b[a]))}function ag(a){var b,c;return _(a)&&aa(a,["target","ref"])&&"string"==typeof a.target&&a.target.length>0&&!!_(b=a.ref)&&(void 0!==b.kind?!!_(c=b)&&!!aa(c,["kind","pid","startIdentity","engine","sessionId","conversationId","seat","turnBusy","owned","lastActiveAt"])&&"structured"===c.kind&&Number.isSafeInteger(c.pid)&&c.pid>1&&"string"==typeof c.startIdentity&&c.startIdentity.length>0&&("claude"===c.engine||"codex"===c.engine)&&ab(c.sessionId)&&ab(c.conversationId)&&ac(c.seat)&&ac(c.turnBusy)&&"boolean"==typeof c.owned&&ab(c.lastActiveAt)&&(null===c.lastActiveAt||Number.isFinite(Date.parse(c.lastActiveAt))):!!aa(b,["tmuxServerPid","tmuxServerStartIdentity","paneId","panePid","paneStartIdentity"])&&Number.isSafeInteger(b.tmuxServerPid)&&b.tmuxServerPid>0&&ab(b.tmuxServerStartIdentity)&&"string"==typeof b.paneId&&/^%\d+$/.test(b.paneId)&&Number.isSafeInteger(b.panePid)&&b.panePid>0&&ab(b.paneStartIdentity))}function ah(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})=>{if(d.has(a))return!1;d.add(a);let e=c.get(a);return!!e&&(F(b)?"structured"===e.kind&&e.panePid===b.pid:"structured"!==e.kind&&e.panePid===b.panePid)})}function ai(a){let b,c=(0,w.BQ)(T);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 aj(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 ak(a,b=Q,c={},d=G.__llvResourceTargetEpoch??0,e=Z,i=O){let l,m,p=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}}(),r=c.observeTimeoutMs??3e4,s=c.inputTimeoutMs??5e3,t=c.closeTimeoutMs??1e3,u=Math.max(0,Math.min(100,Math.floor(.75*t))),v=c.headroomMs??500,w=Math.min(25,Math.max(5,t)),y=Math.max(t+w+5,c.cleanupTimeoutMs??t+Math.floor(v/2)),z=Math.max(y,t+w+50),A=Math.max(Math.min(250,Math.ceil(.2*r)),50+w+Math.max(0,v-Math.max(0,z-t))),B=Math.max(0,r-s-z-A),C=Math.min(c.timeoutMs??23500,B),D=b(a),E=Promise.race([i(),new Promise(a=>{l=setTimeout(()=>a([]),s)})]).catch(a=>(console.error(`[resources] structured host inventory failed: ${a instanceof Error?a.message:String(a)}`),[])).finally(()=>{l&&clearTimeout(l)}),F=JSON.stringify({type:"collect",fresh:a,files:await Promise.race([D,new Promise((a,b)=>{m=setTimeout(()=>b(new q("timeout","file-handoff-timeout","resource collector file handoff timed out")),s)})]).finally(()=>{m&&clearTimeout(m)}),hosts:await E})+"\n",H=c.outputMaxBytes??0x1010000;if(Buffer.byteLength(F)>0x1010000)throw new q("collector-crash","worker-input","resource collector input exceeded transport limit");let I=e===Z&&W(p.executable),J=f().randomUUID(),K=I?process.execPath:p.executable,L=I?["-e",U,p.executable,p.workerPath]:[p.workerPath],M=["/usr/bin/unshare","/bin/unshare"].find(g.existsSync),N=p.executable.includes(j().sep)&&!W(p.executable),P=e===Z&&"linux"===process.platform&&void 0!==M&&!N,R=f().randomUUID(),S=(0,h.spawn)(P?M:K,P?["--user","--map-root-user","--pid","--fork","/bin/sh","-c",V,"llv-resource-worker",R,K,...L]:L,{cwd:process.cwd(),detached:!0,stdio:["pipe","pipe","pipe"],env:{...(0,x.Fd)(process.env),[Y]:J}});return new Promise((b,c)=>{let f,g,h,i,j,l=S.pid,m="number"==typeof l?e.processIdentity(l):null,p="number"==typeof l&&null!==m&&e.processGroupId(l)===l&&e.processIdentity(l)===m,r=null,s=null,v=0,x=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)}}(),A=new k.StringDecoder("utf8"),B=new Map;"number"==typeof l&&null!==m&&B.set(l,m);let D=[],E=null,G=!1,I=!1,K=null,L=!1,M=void 0===e.namespaceMembers,N=null,O=null,Q=null,T=null,U=!1,V=e!==Z&&"unavailable"!==e.kernelContainment,W=V,X=V,Y=V,ab=!1,ac=!1,ad=!1,ai=!1,aj=!1,ak=!1,al=!1,am=(a,b,c,d)=>new q(a,b,c,{cause:d,stderr:x.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,x.append(A.end()))},ar=()=>{for(let a of D)clearTimeout(a);D.length=0},as=()=>{let a;if(!Y||null===N||null===T)return!1;try{if(!U&&null!==O&&null!==Q){let a=e.processIdentity(O);if(a===Q)if(ap(O,Q))U=!0;else{let b=e.processNamespaceId?.(O),c=e.processNamespacePid?.(O);e.processIdentity(O)!==a?U=!0:(b!==N||1!==c)&&ao("resource collector PID namespace root identity changed")}else null!==a?(U=!0,ao("resource collector PID namespace root identity was recycled")):e.pidAlive(O)||(U=!0)}a=T.members()}catch(a){return W=!1,X=!1,an(a),!1}if(W=null!==a,X=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)!==N||e.processIdentity(c)!==a)continue;let d=B.get(c);if(void 0!==d&&d!==a){ao("resource collector PID namespace member identity was recycled");continue}void 0===d&&(B.set(c,a),b=!0)}return b},at=(a=!0)=>{let b=!1,c=[...B.keys()],d=new Set;for(;c.length>0;){let a,f=c.pop();if(d.has(f))continue;d.add(f);let g=B.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=B.get(d);if(void 0!==h&&h!==a){ao("resource collector descendant identity was recycled");continue}void 0===h&&(B.set(d,a),b=!0),c.push(d)}}}(()=>{let a;if(null!==N||!p||ab||ac||ad||"number"!=typeof l||null===m)return;if(e.processIdentity(l)!==m){ab=!0,ao("resource collector worker group leader identity changed");return}try{a=e.processGroupMembers(l)}catch(a){ab=!0,ao("resource collector worker group membership could not be inspected"),an(a);return}if(!a.includes(l)){ab=!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){ab=!0,ao("resource collector worker group leader identity changed");return}for(let[a,c]of b){let b=B.get(a);if(void 0!==b&&b!==c){ab=!0,ao("resource collector worker group member identity changed");return}B.set(a,c)}})();let f=as();return!!a&&null===N&&(()=>{let a;if(!e.namespaceMembers)return!1;try{a=e.namespaceMembers(J)}catch(a){return M=!1,an(a),!1}if(M=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=B.get(c);if(void 0!==d&&d!==a){ao("resource collector namespace member identity was recycled");continue}void 0===d&&(B.set(c,a),b=!0)}return b})()||f||b},au=()=>{let a=[],b=!1;for(let[c,d]of B){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!==N&&ao("resource collector contained process identity was recycled");continue}null===f&&e.pidAlive(c)?b=!0:null!==f&&null!==N&&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 ac||(ab=!0),"absent";if("EPERM"===a)return"denied";return an(b),"unknown"}},aw=(a,b=!0,c="all")=>{if(at(b),null!==N&&null!==O&&null!==Q){let b=au().active.filter(a=>a!==O&&e.processNamespaceId?.(a)===N),d=new Set(b),f="SIGTERM"===a?b:[];for(let g of("SIGTERM"===a&&"members"===c&&(f=b.filter(a=>{let b,c=B.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=B.get(g);if(void 0===b)continue;let c=e.processIdentity(g);if(null!==c){if(c!==b||e.processNamespaceId?.(g)!==N||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===O)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(U)return void g();let h=e.processIdentity(O);if(null===h){e.pidAlive(O)||(U=!0),g();return}if(ap(O,Q)){U=!0,g();return}if(h!==Q){U=!0,ao("resource collector PID namespace root identity changed before cleanup"),g();return}if(e.processNamespaceId?.(O)!==N||e.processNamespacePid?.(O)!==1||e.processIdentity(O)!==h){ao("resource collector PID namespace root identity changed before cleanup"),g();return}try{e.signal(O,a)}catch(a){"ESRCH"!==a.code&&an(a)}return void g()}let d=au();if("present"===av())if((()=>{if(!p||ab||"number"!=typeof l||null===m)return!1;for(let[a,b]of B)if(e.processIdentity(a)===b&&e.processGroupId(a)===l&&e.processIdentity(a)===b)return!0;return!1})())try{e.signal(-l,a),ac=!0}catch(a){"ESRCH"!==a.code&&an(a)}else ac?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=B.get(b);if(void 0===c||e.processIdentity(b)!==c){ac||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!==N&&X&&b&&"present"===c&&(c="absent");let d=M&&"absent"===c&&0===a.active.length&&!a.uncertain,e=d&&W&&X;return d&&!Y&&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{T?.close()}catch(a){an(a),K??=Error("resource collector PID namespace reference could not be closed",{cause:a})}for(let a of(T=null,aq(),S.removeAllListeners(),[S.stdin,S.stdout,S.stderr]))a.removeAllListeners(),a.destroy(),a.unref?.();S.unref()}},az=a=>{if(!P||!a.startsWith(`${R} `))return!1;let[b,c,d,...f]=a.split(" "),g=Number(c);if(a.length>512||b!==R||!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")):(N=d,O=g,Q=h,T=i,Y=!0,W=!1,X=!1,M=!0,as()),!0};P||Y||ao("resource collector kernel containment is unavailable");let aA=()=>{if(al||!r||!ai&&!aj||!I)return;al=!0;let a=r;(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(!G||I)return;at()&&(E=null);let a=ax();if(a?null===E&&(E=Date.now()):E=null,a&&Date.now()-E>=w){I=!0,g&&clearTimeout(g),i&&clearTimeout(i),aA();return}(i=setTimeout(aB,5)).unref()},aC=()=>{G||(G=!0,ar(),(h=setTimeout(()=>{if(at(),ax()&&void 0===j){I=!0,ay(),aA();return}!r&&s&&(r=s),K=Error("resource collector worker cleanup deadline expired",void 0===j?void 0:{cause:j}),I=!0,ay(),aA()},r?.type==="success"?z:y)).unref(),null===N?aw("SIGTERM",!1):(aw("SIGTERM",!1,"members"),(f=setTimeout(()=>{I||(aw("SIGTERM",!1,"root"),aB())},u)).unref()),(g=setTimeout(()=>{aw("SIGKILL"),aB()},t)).unref(),aB())},aD=a=>{if(r){"success"===r.type&&"failure"===a.type&&"worker-output-limit"===a.cause&&(r=a);return}r=a,clearTimeout(aE),aC()};for(let a of(at(),[0,5,20,40])){let b=setTimeout(()=>{G||ad||at()},a);b.unref(),D.push(b)}let aE=setTimeout(()=>aD({type:"failure",reason:"timeout",cause:"worker-timeout",message:"resource collector worker timed out"}),C);S.once("error",a=>{"number"!=typeof l&&(Y=!0,W=!0,X=!0,M=!0),aD({type:"failure",reason:"collector-crash",cause:"worker-spawn",message:"resource collector worker failed to start",error:a})}),S.once("exit",(a,b)=>{ad=!0,ar(),clearTimeout(aE),s={type:"failure",reason:"collector-crash",cause:"worker-exit",message:`resource collector worker exited before observation (${b??a??"unknown"})`},aC()}),S.once("close",(a,b)=>{clearTimeout(aE),aq(),ai=!0,r||(r=s??{type:"failure",reason:"collector-crash",cause:"worker-exit",message:`resource collector worker closed before observation (${b??a??"unknown"})`},aC()),aB(),aA()});let aF="";S.stdout.setEncoding("utf8"),S.stdout.on("data",b=>{if((v+=Buffer.byteLength(b))>H+(P&&!Y?512:0))return void aD({type:"failure",reason:"collector-crash",cause:"worker-output-limit",message:"resource collector worker exceeded stdout limit"});if(!r)for(aF+=b;!r;){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)){(v-=Buffer.byteLength(f)+1)>H&&aD({type:"failure",reason:"collector-crash",cause:"worker-output-limit",message:"resource collector worker exceeded stdout limit"});continue}if(v>H)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=_(c=b)?"failure"===c.type?aa(c,["type","error"])&&"string"==typeof c.error&&c.error.length<=4096?c:null:"observation"===c.type&&aa(c,["type","payload","diagnostic","targets"])&&ae(c.payload)&&af(c.diagnostic)&&Array.isArray(c.targets)&&!(c.targets.length>1e4)&&c.targets.every(ag)&&"complete"===c.diagnostic.status&&ah(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:$(g.payload,g.diagnostic,g.targets,d)}),aF=""}}),S.stderr.on("data",a=>{v+=a.length,x.append(A.write(a)),v>H+(P&&!Y?512:0)&&aD({type:"failure",reason:"collector-crash",cause:"worker-output-limit",message:"resource collector worker exceeded output limit"})}),S.stdin.once("error",a=>aD({type:"failure",reason:"collector-crash",cause:"worker-input",message:"resource collector worker input failed",error:a})),S.stdin.end(F)})}function al(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:A(),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=G.__llvResourceTargetEpoch??0){c!==(G.__llvResourceTargetEpoch??0)||a<=(G.__llvResourceTargetsGeneration??0)||(I(b),G.__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:A(),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 am(a=!1){let b,c=process.env.LLV_RESOURCES_FIXTURE;if(c){var d;let b;return I([]),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&&D(d.ramTotal)&&D(d.ramAvailable)&&D(d.swapTotal)&&D(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:A(),generation:0,startedAt:new Date(b).toISOString(),completedAt:new Date(b).toISOString(),collectorId:"fixture",cache:{status:"miss"}}}}return(b=G.__llvResourcesReader,(3!==G.__llvResourcesReaderVersion||!b)&&(G.__llvResourcesReaderVersion=3,b=function(a,b,c=Date.now,d=H,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:aj,collect:n?async(b=!1)=>{let c=G.__llvResourceTargetEpoch??0,e=await a(b),f=d();if(!f)throw Error("resource build completed without diagnostics");return $(e,f,G.__llvLastResourceTargets?.map(({target:a,ref:b})=>({target:a,ref:{...b}}))??[],c)}:(a=!1)=>ak(a,e.readFiles,e.workerLimits,G.__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)?al(w,b,!1,!0):al({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)),al(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)}}}}(S,()=>E(),Date.now,H,{initial:function(){try{let a=(0,w.BQ)(T),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(!_(c)||!aa(c,["version","observation"])||1!==c.version||!_(c.observation))return null;let d=c.observation;if(!aa(d,["generation","startedAt","completedAt","collectorId","value"],["degradedReason"])||!Number.isSafeInteger(d.generation)||d.generation<0||!D(d.startedAt)||!D(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,!(_(b)&&aa(b,["payload","diagnostic","hostCount","treeCount","targets"],["targetEpoch"])&&ae(b.payload)&&af(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(ag)&&"complete"===b.diagnostic.status&&ah(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:ai}),G.__llvResourcesReader=b),b).read(a)}}};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";exports.id=7139,exports.ids=[1888,7126,7139,9507],exports.modules={26277:(a,b,c)=>{c.d(b,{Gs:()=>C,Kn:()=>w,gY:()=>x,h3:()=>q,jd:()=>v,kt:()=>E,ue:()=>D,vx:()=>y,w5:()=>z});var d=c(31421);c(77598);var e=c(73024),f=c.n(e),g=c(48161),h=c.n(g),i=c(76760),j=c.n(i),k=c(27146),l=c(89204),m=c(55541),n=c(19777);Object.freeze({repo:"https://github.com/chigwell/telegram-mcp",release:"v3.2.22",commit:"a61294362226bd93052f5a40b4a1b1269a99ce69",license:"Apache-2.0"});let o="127.0.0.1";function p(){let a=Number(process.env.LLV_TELEGRAM_MCP_PORT);return Number.isInteger(a)&&a>0&&a<65536?a:8809}function q(){return`http://${o}:${p()}/mcp`}function r(a,...b){if(a)return a;let c=j().join(process.cwd(),...b);if(f().existsSync(c))return c;let d=j().join(process.cwd(),"..","..",...b);return f().existsSync(d)?d:c}function s(){return r(process.env.LLV_TELEGRAM_VENDOR_DIR,"vendor","telegram-mcp")}function t(){return(0,k.BQ)("telegram","venv")}function u(){return(0,k.BQ)("telegram","vendor-src")}function v(){return process.env.LLV_TELEGRAM_PYTHON||j().join(t(),"bin","python")}function w(){return r(process.env.LLV_TELEGRAM_SERVER_BRIDGE,"bin","telegram-mcp-server.py")}function x(){return r(process.env.LLV_TELEGRAM_SESSION_READER,"bin","telegram-session-reader.mjs")}let y=Object.freeze(["wait_for_settled_message"]);function z(){let a=process.env.LLV_TELEGRAM_API_ID,b=process.env.LLV_TELEGRAM_API_HASH;if(a&&b)return{apiId:a,apiHash:b};try{let a=JSON.parse(f().readFileSync((0,k.ks)("telegram.json"),"utf8"));if("string"==typeof a.apiId&&a.apiId&&"string"==typeof a.apiHash&&a.apiHash)return{apiId:a.apiId,apiHash:a.apiHash}}catch{}return null}function A(){return f().existsSync(j().join(t(),".llv-provisioned"))&&f().existsSync(v())&&f().existsSync(j().join(u(),"pyproject.toml"))}let B=null;function C(){return A()?Promise.resolve(!0):B||(B=(async()=>((0,n._q)(!0),await (0,l.pM)((0,k.BQ)("telegram","connector-provision"),"Telegram connector provisioning is busy",async()=>{var a;return!!A()||await (a={command:process.execPath,args:[r(process.env.LLV_TELEGRAM_PROVISIONER,"bin","provision-telegram-connector.mjs")],cwd:s(),env:{...F(),LLV_STATE_DIR:(0,k.Pn)(),LLV_TELEGRAM_VENDOR_DIR:s(),LLV_TELEGRAM_PYTHON:v()}},new Promise(b=>{let c;try{c=(0,d.spawn)(a.command,a.args,{cwd:a.cwd,env:a.env,stdio:"ignore"})}catch{b(!1);return}c.once("error",()=>b(!1)),c.once("exit",a=>b(0===a))}))&&A()})))().catch(()=>!1).finally(()=>{B=null}))}function D(a){let b=u(),c=(0,m.WG)();return{command:v(),args:[w()],cwd:b,env:{...F(),...c,TELEGRAM_API_ID:a.credentials.apiId,TELEGRAM_API_HASH:a.credentials.apiHash,TELEGRAM_SESSION_STRING:a.sessionString,TELEGRAM_EXPOSED_TOOLS:"read-only",TELEGRAM_EVENT_FEED:"1",TELEGRAM_EVENT_FEED_FILE:(0,n.ZI)(a.credentialRef),LLV_TELEGRAM_EXCLUDED_TOOLS:y.join(","),LLV_TELEGRAM_MCP_TOKEN:a.connectorToken,LLV_TELEGRAM_VENDOR_DIR:b,MCP_TRANSPORT:"http",MCP_HOST:o,MCP_PORT:String(p())}}}function E(a,b){return{command:v(),args:[r(process.env.LLV_TELEGRAM_BRIDGE,"bin","telegram-login-bridge.py"),a],cwd:h().homedir(),env:{...F(),TELEGRAM_API_ID:b.apiId,TELEGRAM_API_HASH:b.apiHash}}}function F(){let a={};for(let b of["PATH","HOME","LANG","LC_ALL","TMPDIR"])void 0!==process.env[b]&&(a[b]=process.env[b]);return a}},51888:(a,b,c)=>{c.d(b,{JL:()=>h,OV:()=>l,RC:()=>j,cC:()=>i,fC:()=>e,g9:()=>m,je:()=>d,wi:()=>n});let d="gpt-5.6-sol",e="gpt-5.6-terra",f="gpt-5.6-luna",g=new Set([d,e,f,"gpt-5.5","gpt-5.4","gpt-5.4-mini"]);function h(a){return!a?.trim()||g.has(a.trim())}let i={claude:[{id:"opus",label:"Opus 5",shortLabel:"Opus 5",use:"review"},{id:"fable",label:"Fable",shortLabel:"Fable",use:"general"},{id:"sonnet",label:"Sonnet",shortLabel:"Sonnet",use:"implement"},{id:"haiku",label:"Haiku",shortLabel:"Haiku",use:"general"}],codex:[{id:d,label:"GPT-5.6-Sol",shortLabel:"5.6-Sol",use:"review"},{id:e,label:"GPT-5.6-Terra",shortLabel:"5.6-Terra",use:"implement"},{id:f,label:"GPT-5.6-Luna",shortLabel:"5.6-Luna",use:"general"}]};function j(a,b){let c=b.trim(),d=i[a].map(a=>a.id);return d.includes(c)?{model:c}:{error:`invalid ${a} model id ${JSON.stringify(c)}; valid ${a} model ids: ${d.join(", ")}`}}let k=["fable","opus","sonnet","haiku"];function l(a){if("string"!=typeof a)return null;let b=a.trim().toLowerCase();if(!b||b.length>128||/[\u0000-\u001f\u007f]/.test(b))return null;for(let a of k)if(b===a||RegExp(`(?:^|[-_.])${a}(?:[-_.]|$)`).test(b))return a;return null}function m(a){if("string"!=typeof a)return!1;let b=a.trim();return b.startsWith("gpt-")&&b.length<=128&&!/[\u0000-\u001f\u007f]/.test(b)}function n(a){if(void 0===a.model||null===a.model||""===a.model)return{model:null};if("string"!=typeof a.model)return{model:null,error:"model must be a string"};let b=a.model.trim();return b?b.length>128||/[\u0000-\u001f\u007f]/.test(b)?{model:null,error:"model must be a printable id up to 128 characters"}:{model:b}:{model:null}}},55541:(a,b,c)=>{c.d(b,{WG:()=>o,cO:()=>n,yb:()=>l});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(19777);let l=262144,m=String.raw`import fcntl
|
|
2
|
+
import io
|
|
3
|
+
import os
|
|
4
|
+
import stat
|
|
5
|
+
import sys
|
|
6
|
+
import threading
|
|
7
|
+
|
|
8
|
+
try:
|
|
9
|
+
_path = os.environ["LLV_TELEGRAM_CONNECTOR_LOG"]
|
|
10
|
+
_limit = int(os.environ["LLV_TELEGRAM_CONNECTOR_LOG_MAX_BYTES"])
|
|
11
|
+
if _limit <= 0:
|
|
12
|
+
raise ValueError("invalid log limit")
|
|
13
|
+
_flags = os.O_RDWR | os.O_CREAT | os.O_APPEND
|
|
14
|
+
if hasattr(os, "O_NOFOLLOW"):
|
|
15
|
+
_flags |= os.O_NOFOLLOW
|
|
16
|
+
_fd = os.open(_path, _flags, 0o600)
|
|
17
|
+
_info = os.fstat(_fd)
|
|
18
|
+
if not stat.S_ISREG(_info.st_mode) or (_info.st_mode & 0o077):
|
|
19
|
+
raise PermissionError("unsafe connector log")
|
|
20
|
+
if hasattr(os, "getuid") and _info.st_uid != os.getuid():
|
|
21
|
+
raise PermissionError("connector log owner mismatch")
|
|
22
|
+
except Exception as _error:
|
|
23
|
+
raise SystemExit("connector log sink unavailable") from _error
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _write_all(data):
|
|
27
|
+
view = memoryview(data)
|
|
28
|
+
while view:
|
|
29
|
+
written = os.write(_fd, view)
|
|
30
|
+
view = view[written:]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class _BoundedConnectorLog(io.TextIOBase):
|
|
34
|
+
encoding = "utf-8"
|
|
35
|
+
errors = "backslashreplace"
|
|
36
|
+
|
|
37
|
+
def __init__(self):
|
|
38
|
+
self._lock = threading.Lock()
|
|
39
|
+
|
|
40
|
+
def writable(self):
|
|
41
|
+
return True
|
|
42
|
+
|
|
43
|
+
def isatty(self):
|
|
44
|
+
return False
|
|
45
|
+
|
|
46
|
+
def fileno(self):
|
|
47
|
+
return _fd
|
|
48
|
+
|
|
49
|
+
def flush(self):
|
|
50
|
+
return None
|
|
51
|
+
|
|
52
|
+
def write(self, value):
|
|
53
|
+
if not isinstance(value, str):
|
|
54
|
+
value = str(value)
|
|
55
|
+
data = value.encode(self.encoding, self.errors)
|
|
56
|
+
if not data:
|
|
57
|
+
return len(value)
|
|
58
|
+
with self._lock:
|
|
59
|
+
fcntl.flock(_fd, fcntl.LOCK_EX)
|
|
60
|
+
try:
|
|
61
|
+
size = os.fstat(_fd).st_size
|
|
62
|
+
if len(data) >= _limit:
|
|
63
|
+
tail = data[-_limit:]
|
|
64
|
+
os.ftruncate(_fd, 0)
|
|
65
|
+
_write_all(tail)
|
|
66
|
+
elif size + len(data) > _limit:
|
|
67
|
+
keep = _limit - len(data)
|
|
68
|
+
prior = os.pread(_fd, keep, max(0, size - keep))
|
|
69
|
+
os.ftruncate(_fd, 0)
|
|
70
|
+
_write_all(prior[-keep:] + data)
|
|
71
|
+
else:
|
|
72
|
+
_write_all(data)
|
|
73
|
+
finally:
|
|
74
|
+
fcntl.flock(_fd, fcntl.LOCK_UN)
|
|
75
|
+
return len(value)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
_sink = _BoundedConnectorLog()
|
|
79
|
+
sys.stdout = _sink
|
|
80
|
+
sys.stderr = _sink
|
|
81
|
+
`;function n(){return(0,j.BQ)("telegram","connector.log")}function o(){(0,k._q)(!0);let a=(0,j.BQ)("telegram","connector-log-sink");g().mkdirSync(a,{recursive:!0,mode:448});let b=g().lstatSync(a);if(!b.isDirectory()||b.isSymbolicLink()||(63&b.mode)!=0||"function"==typeof process.getuid&&b.uid!==process.getuid())throw Error("unsafe connector log sink directory");let c=i().join(a,"sitecustomize.py"),d=`${c}.${process.pid}.${e().randomUUID()}.tmp`;try{g().writeFileSync(d,m,{flag:"wx",mode:384}),g().renameSync(d,c),g().chmodSync(c,384)}finally{g().rmSync(d,{force:!0})}return!function(){let a="O_NOFOLLOW"in g().constants?g().constants.O_NOFOLLOW:0,b=g().openSync(n(),g().constants.O_RDWR|g().constants.O_CREAT|a,384);try{let a=g().fstatSync(b);if(!a.isFile()||(63&a.mode)!=0||"function"==typeof process.getuid&&a.uid!==process.getuid())throw Error("unsafe connector log");if(a.size<=l)return;let c=Buffer.alloc(l);g().readSync(b,c,0,c.length,a.size-c.length),g().ftruncateSync(b,0),g().writeSync(b,c,0,c.length,0)}finally{g().closeSync(b)}}(),{PYTHONPATH:a,LLV_TELEGRAM_CONNECTOR_LOG:n(),LLV_TELEGRAM_CONNECTOR_LOG_MAX_BYTES:String(l)}}},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(24597),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)}
|
|
82
|
+
`,{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)})}}};
|