agent-log-viewer 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.mjs +4 -0
- package/bin/server-runtime.test.ts +63 -12
- package/dist/mcp-server.mjs +31365 -26173
- package/dist/runtime-host.mjs +15618 -7081
- package/dist/standalone/.next/BUILD_ID +1 -1
- package/dist/standalone/.next/app-path-routes-manifest.json +21 -16
- package/dist/standalone/.next/build-manifest.json +3 -3
- package/dist/standalone/.next/prerender-manifest.json +4 -4
- package/dist/standalone/.next/react-loadable-manifest.json +1 -1
- package/dist/standalone/.next/required-server-files.json +1 -1
- package/dist/standalone/.next/routes-manifest.json +30 -0
- package/dist/standalone/.next/server/account-migration-controller-worker.js +1 -1
- package/dist/standalone/.next/server/app/_global-error/page.js +2 -2
- package/dist/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dist/standalone/.next/server/app/_global-error.html +1 -1
- package/dist/standalone/.next/server/app/_global-error.rsc +1 -1
- package/dist/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/dist/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/standalone/.next/server/app/_not-found/page.js +1 -1
- package/dist/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/standalone/.next/server/app/_not-found.html +1 -1
- package/dist/standalone/.next/server/app/_not-found.rsc +2 -2
- package/dist/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/dist/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/dist/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/dist/standalone/.next/server/app/api/access/route.js +1 -1
- package/dist/standalone/.next/server/app/api/access/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/account-migrations/[intentId]/route.js +1 -1
- package/dist/standalone/.next/server/app/api/account-migrations/[intentId]/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/account-project-bindings/route.js +1 -1
- package/dist/standalone/.next/server/app/api/account-project-bindings/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/[id]/status/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/[id]/status/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/active/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/active/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/limits/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/limits/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/login/[operationId]/input/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/login/[operationId]/input/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/login/[operationId]/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/login/[operationId]/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/policy/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/policy/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/terminal/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/claude/terminal/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/active/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/active/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/limits/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/limits/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/policy/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/policy/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/reset-credits/route.js +2 -2
- package/dist/standalone/.next/server/app/api/accounts/codex/reset-credits/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/terminal/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/codex/terminal/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/accounts/route.js +1 -1
- package/dist/standalone/.next/server/app/api/accounts/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/agent/route.js +1 -1
- package/dist/standalone/.next/server/app/api/agent/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/agent/snapshot/route.js +1 -1
- package/dist/standalone/.next/server/app/api/agent/snapshot/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/answer/route.js +1 -2
- package/dist/standalone/.next/server/app/api/answer/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/artifact/route.js +1 -1
- package/dist/standalone/.next/server/app/api/artifact/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/attach-command/route.js +1 -1
- package/dist/standalone/.next/server/app/api/attach-command/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/attention/[id]/route.js +1 -1
- package/dist/standalone/.next/server/app/api/attention/[id]/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/attention/route.js +1 -1
- package/dist/standalone/.next/server/app/api/attention/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/board/route.js +1 -1
- package/dist/standalone/.next/server/app/api/board/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/bridge/route.js +1 -2
- package/dist/standalone/.next/server/app/api/bridge/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/conversation-host/route.js +1 -1
- package/dist/standalone/.next/server/app/api/conversation-host/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/conversation-host/targets/route.js +1 -1
- package/dist/standalone/.next/server/app/api/conversation-host/targets/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/conversations/[conversationId]/migration/route.js +1 -1
- package/dist/standalone/.next/server/app/api/conversations/[conversationId]/migration/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/conversations/route.js +1 -1
- package/dist/standalone/.next/server/app/api/conversations/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/files/route.js +3 -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 +107 -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 +2 -4
- package/dist/standalone/.next/server/app/api/log/suggestions/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/logs/route.js +1 -1
- package/dist/standalone/.next/server/app/api/logs/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/logs/stream/route.js +2 -2
- package/dist/standalone/.next/server/app/api/logs/stream/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/monitor/runs/route.js +3 -3
- package/dist/standalone/.next/server/app/api/monitor/runs/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/monitor/seat-tick/route.js +25 -0
- package/dist/standalone/.next/server/app/api/monitor/seat-tick/route.js.nft.json +1 -0
- package/dist/standalone/.next/server/app/api/monitor/seat-tick/route_client-reference-manifest.js +1 -0
- package/dist/standalone/.next/server/app/api/monitor/seat-tick/settings/route.js +2 -0
- package/dist/standalone/.next/server/app/api/monitor/seat-tick/settings/route.js.nft.json +1 -0
- package/dist/standalone/.next/server/app/api/monitor/seat-tick/settings/route_client-reference-manifest.js +1 -0
- package/dist/standalone/.next/server/app/api/orchestrator/rotate/route.js +1 -1
- package/dist/standalone/.next/server/app/api/orchestrator/rotate/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/orchestrator/seat/route.js +1 -1
- package/dist/standalone/.next/server/app/api/orchestrator/seat/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/orchestrator/seat/status/route.js +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 +1 -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 -1
- package/dist/standalone/.next/server/app/api/projects/directories/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/push/route.js +2 -2
- package/dist/standalone/.next/server/app/api/push/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/resources/route.js +1 -1
- package/dist/standalone/.next/server/app/api/resources/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/roles/route.js +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 +1 -1
- package/dist/standalone/.next/server/app/api/runtime/answer/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/deployments/[deploymentId]/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/deployments/[deploymentId]/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/deployments/capabilities/v1/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/deployments/capabilities/v1/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/deployments/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/deployments/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/hosts/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/hosts/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/inject/route.js +1 -0
- package/dist/standalone/.next/server/app/api/runtime/inject/route.js.nft.json +1 -0
- package/dist/standalone/.next/server/app/api/runtime/inject/route_client-reference-manifest.js +1 -0
- package/dist/standalone/.next/server/app/api/runtime/interrupt/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/interrupt/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/operations/[operationId]/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/operations/[operationId]/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/operations/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/operations/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/queue/route.js +1 -0
- package/dist/standalone/.next/server/app/api/runtime/queue/route.js.nft.json +1 -0
- package/dist/standalone/.next/server/app/api/runtime/queue/route_client-reference-manifest.js +1 -0
- package/dist/standalone/.next/server/app/api/runtime/realtime/route.js +1 -2
- package/dist/standalone/.next/server/app/api/runtime/realtime/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/send/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/send/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/snapshot/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/snapshot/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/spawn/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/spawn/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/steer/route.js +1 -1
- package/dist/standalone/.next/server/app/api/runtime/steer/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/runtime/stream/route.js +2 -2
- package/dist/standalone/.next/server/app/api/runtime/stream/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/search/transcripts/route.js +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 +1 -2
- package/dist/standalone/.next/server/app/api/spawn/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/spawn/validate/route.js +1 -0
- package/dist/standalone/.next/server/app/api/spawn/validate/route.js.nft.json +1 -0
- package/dist/standalone/.next/server/app/api/spawn/validate/route_client-reference-manifest.js +1 -0
- package/dist/standalone/.next/server/app/api/staging/route.js +2 -2
- package/dist/standalone/.next/server/app/api/staging/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/task-attachments/route.js +2 -2
- package/dist/standalone/.next/server/app/api/task-attachments/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/tasks/[id]/assignment/route.js +1 -1
- package/dist/standalone/.next/server/app/api/tasks/[id]/assignment/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/tasks/[id]/route.js +1 -1
- package/dist/standalone/.next/server/app/api/tasks/[id]/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/tasks/[id]/send/route.js +1 -2
- package/dist/standalone/.next/server/app/api/tasks/[id]/send/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/tasks/[id]/spawn/route.js +1 -2
- package/dist/standalone/.next/server/app/api/tasks/[id]/spawn/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/tasks/curator/route.js +1 -1
- package/dist/standalone/.next/server/app/api/tasks/curator/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/tasks/route.js +1 -1
- package/dist/standalone/.next/server/app/api/tasks/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/telegram/reports/route.js +1 -1
- package/dist/standalone/.next/server/app/api/telegram/reports/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/telegram/route.js +1 -1
- package/dist/standalone/.next/server/app/api/telegram/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/timeline/route.js +1 -1
- package/dist/standalone/.next/server/app/api/timeline/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/tmux/route.js +1 -1
- package/dist/standalone/.next/server/app/api/tmux/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/tmux/targets/route.js +1 -1
- package/dist/standalone/.next/server/app/api/tmux/targets/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/transcribe/backend/route.js +2 -2
- package/dist/standalone/.next/server/app/api/transcribe/backend/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/transcribe/route.js +2 -2
- package/dist/standalone/.next/server/app/api/transcribe/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/transcribe/token/route.js +2 -2
- package/dist/standalone/.next/server/app/api/transcribe/token/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/tts/backend/route.js +1 -1
- package/dist/standalone/.next/server/app/api/tts/backend/route.js.nft.json +1 -1
- package/dist/standalone/.next/server/app/api/tts/route.js +3 -3
- 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 +3 -3
- package/dist/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/dist/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/dist/standalone/.next/server/app/page.js +59 -30
- 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 +21 -16
- package/dist/standalone/.next/server/chunks/107.js +1 -1
- package/dist/standalone/.next/server/chunks/1100.js +29 -10
- package/dist/standalone/.next/server/chunks/1406.js +399 -0
- package/dist/standalone/.next/server/chunks/1585.js +108 -0
- package/dist/standalone/.next/server/chunks/160.js +4 -4
- package/dist/standalone/.next/server/chunks/1617.js +2 -2
- package/dist/standalone/.next/server/chunks/1849.js +1 -0
- package/dist/standalone/.next/server/chunks/1888.js +1 -1
- package/dist/standalone/.next/server/chunks/193.js +1 -0
- package/dist/standalone/.next/server/chunks/1952.js +1 -0
- package/dist/standalone/.next/server/chunks/2549.js +1 -1
- package/dist/standalone/.next/server/chunks/2555.js +1 -0
- package/dist/standalone/.next/server/chunks/2647.js +1 -1
- package/dist/standalone/.next/server/chunks/2857.js +1 -0
- package/dist/standalone/.next/server/chunks/2914.js +24 -0
- package/dist/standalone/.next/server/chunks/3034.js +1 -0
- package/dist/standalone/.next/server/chunks/3086.js +1 -1
- package/dist/standalone/.next/server/chunks/3131.js +1 -0
- package/dist/standalone/.next/server/chunks/3214.js +1 -1
- package/dist/standalone/.next/server/chunks/3302.js +1 -2
- package/dist/standalone/.next/server/chunks/3407.js +1 -0
- package/dist/standalone/.next/server/chunks/3422.js +1 -0
- package/dist/standalone/.next/server/chunks/3558.js +1 -0
- package/dist/standalone/.next/server/chunks/3570.js +81 -0
- package/dist/standalone/.next/server/chunks/3587.js +1 -1
- package/dist/standalone/.next/server/chunks/3743.js +74 -24
- package/dist/standalone/.next/server/chunks/3830.js +1 -1
- package/dist/standalone/.next/server/chunks/3896.js +1 -0
- package/dist/standalone/.next/server/chunks/4127.js +1 -1
- package/dist/standalone/.next/server/chunks/4509.js +1 -1
- package/dist/standalone/.next/server/chunks/4637.js +62 -0
- package/dist/standalone/.next/server/chunks/4651.js +1 -1
- package/dist/standalone/.next/server/chunks/4783.js +1 -0
- package/dist/standalone/.next/server/chunks/480.js +126 -0
- package/dist/standalone/.next/server/chunks/4972.js +3 -3
- package/dist/standalone/.next/server/chunks/{4756.js → 4995.js} +3 -5
- package/dist/standalone/.next/server/chunks/5480.js +1 -1
- package/dist/standalone/.next/server/chunks/5545.js +1 -1
- package/dist/standalone/.next/server/chunks/568.js +1 -2
- package/dist/standalone/.next/server/chunks/5682.js +1 -0
- package/dist/standalone/.next/server/chunks/5771.js +1 -0
- package/dist/standalone/.next/server/chunks/5847.js +1 -0
- package/dist/standalone/.next/server/chunks/6023.js +1 -0
- package/dist/standalone/.next/server/chunks/6277.js +81 -0
- package/dist/standalone/.next/server/chunks/6289.js +2 -0
- package/dist/standalone/.next/server/chunks/644.js +81 -0
- package/dist/standalone/.next/server/chunks/6453.js +1 -0
- package/dist/standalone/.next/server/chunks/6522.js +1 -0
- package/dist/standalone/.next/server/chunks/6665.js +1 -1
- package/dist/standalone/.next/server/chunks/6809.js +3 -0
- package/dist/standalone/.next/server/chunks/6826.js +1 -1
- package/dist/standalone/.next/server/chunks/6926.js +1 -1
- package/dist/standalone/.next/server/chunks/{1920.js → 6942.js} +1 -1
- package/dist/standalone/.next/server/chunks/6978.js +1 -0
- package/dist/standalone/.next/server/chunks/7008.js +114 -9
- package/dist/standalone/.next/server/chunks/7192.js +1 -0
- package/dist/standalone/.next/server/chunks/7238.js +2 -0
- package/dist/standalone/.next/server/chunks/7361.js +22 -0
- package/dist/standalone/.next/server/chunks/7644.js +3 -3
- package/dist/standalone/.next/server/chunks/7722.js +1 -1
- package/dist/standalone/.next/server/chunks/781.js +55 -0
- package/dist/standalone/.next/server/chunks/7826.js +62 -0
- package/dist/standalone/.next/server/chunks/8027.js +11 -1
- package/dist/standalone/.next/server/chunks/8444.js +1 -1
- package/dist/standalone/.next/server/chunks/8512.js +1 -0
- package/dist/standalone/.next/server/chunks/8513.js +2 -0
- 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/8991.js +1 -1
- package/dist/standalone/.next/server/chunks/8996.js +1 -1
- package/dist/standalone/.next/server/chunks/9296.js +104 -0
- package/dist/standalone/.next/server/chunks/{7139.js → 9298.js} +2 -2
- package/dist/standalone/.next/server/chunks/9307.js +1 -1
- package/dist/standalone/.next/server/chunks/9360.js +197 -0
- package/dist/standalone/.next/server/chunks/9403.js +1 -1
- package/dist/standalone/.next/server/chunks/9517.js +1 -1
- package/dist/standalone/.next/server/chunks/9554.js +47 -0
- package/dist/standalone/.next/server/chunks/9676.js +1 -62
- package/dist/standalone/.next/server/chunks/9822.js +11 -1
- package/dist/standalone/.next/server/chunks/9901.js +1 -62
- package/dist/standalone/.next/server/chunks/9940.js +3 -3
- package/dist/standalone/.next/server/chunks/9998.js +1 -1
- package/dist/standalone/.next/server/file-scanner-worker.js +3 -3
- package/dist/standalone/.next/server/files-response-worker.js +6 -6
- package/dist/standalone/.next/server/functions-config-manifest.json +5 -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/middleware-react-loadable-manifest.js +1 -1
- package/dist/standalone/.next/server/middleware.js +4 -4
- 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/chunks/{3794-d1854fdd0e41dc44.js → 3794-0ef35fddac53cd9a.js} +1 -1
- package/dist/standalone/.next/static/chunks/6976-016b6947195a6ed2.js +1 -0
- package/dist/standalone/.next/static/chunks/app/_global-error/page-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/access/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/account-migrations/[intentId]/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/account-project-bindings/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/[id]/status/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/active/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/limits/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/login/[operationId]/input/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/login/[operationId]/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/policy/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/terminal/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/active/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/limits/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/policy/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/reset-credits/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/terminal/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/accounts/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/agent/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/agent/snapshot/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/answer/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/artifact/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/attach-command/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/attention/[id]/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/attention/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/board/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/bridge/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/conversation-host/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/conversation-host/targets/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/conversations/[conversationId]/migration/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/conversations/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/files/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/flows/[id]/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/flows/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/image/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/inbox/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/lifecycle/reaper/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/limits/history/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/limits/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/log/preflight/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/log/project-delete/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/log/provenance/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/log/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/log/suggestions/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/logs/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/logs/stream/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/monitor/runs/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/monitor/seat-tick/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/monitor/seat-tick/settings/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/orchestrator/rotate/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/orchestrator/seat/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/orchestrator/seat/status/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/pipelines/[id]/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/pipelines/preflight/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/pipelines/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/pipelines/tick/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/proc/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/projects/create/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/projects/crown/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/projects/directories/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/push/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/resources/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/roles/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/answer/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/deployments/[deploymentId]/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/deployments/capabilities/v1/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/deployments/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/hosts/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/inject/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/interrupt/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/operations/[operationId]/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/operations/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/queue/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/realtime/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/send/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/snapshot/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/spawn/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/steer/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/runtime/stream/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/search/transcripts/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/session/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/session/supersedence/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/session/title/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/spawn/policy/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/spawn/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/spawn/validate/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/staging/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/task-attachments/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/assignment/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/send/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/spawn/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tasks/curator/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tasks/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/telegram/reports/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/telegram/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/timeline/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tmux/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tmux/targets/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/transcribe/backend/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/transcribe/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/transcribe/token/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tts/backend/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/tts/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/view/presence/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/workflows/[id]/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/api/workflows/route-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/app/page-16384e540b4c0a90.js +125 -0
- package/dist/standalone/.next/static/chunks/{main-8691b7dc3557ef3f.js → main-7e65147ff5ce0866.js} +1 -1
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-60a25d1c4cbf0128.js +1 -0
- package/dist/standalone/.next/static/css/496211a19557b7ee.css +1 -0
- package/dist/standalone/.next/static/e4qE_aCE0s0KQnnU6IWRw/_buildManifest.js +1 -0
- package/dist/standalone/AGENTS.md +20 -0
- package/dist/standalone/node_modules/@next/env/package.json +1 -1
- package/dist/standalone/node_modules/next/dist/build/swc/index.js +1 -1
- package/dist/standalone/node_modules/next/dist/build/webpack-config.js +3 -3
- package/dist/standalone/node_modules/next/dist/compiled/next-server/app-page-experimental.runtime.prod.js +1 -1
- package/dist/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +1 -1
- package/dist/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +1 -1
- package/dist/standalone/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js +1 -1
- package/dist/standalone/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js +1 -1
- package/dist/standalone/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +5 -5
- package/dist/standalone/node_modules/next/dist/compiled/next-server/pages.runtime.prod.js +5 -5
- package/dist/standalone/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
- package/dist/standalone/node_modules/next/dist/server/config.js +1 -1
- package/dist/standalone/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +2 -2
- package/dist/standalone/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/standalone/node_modules/next/dist/server/image-optimizer.js +2 -2
- package/dist/standalone/node_modules/next/dist/server/lib/app-info-log.js +1 -1
- package/dist/standalone/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js +17 -4
- package/dist/standalone/node_modules/next/dist/server/lib/start-server.js +1 -1
- package/dist/standalone/node_modules/next/dist/shared/lib/router/utils/escape-path-delimiters.js +1 -1
- package/dist/standalone/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/standalone/node_modules/next/dist/telemetry/events/swc-load-failure.js +1 -1
- package/dist/standalone/node_modules/next/dist/telemetry/events/version.js +2 -2
- package/dist/standalone/node_modules/next/package.json +10 -10
- package/dist/standalone/package.json +5 -5
- package/dist/standalone/server.bun.js +1 -1
- package/dist/standalone/src/lib/viewerInstrumentation.ts +809 -0
- package/package.json +5 -5
- package/dist/standalone/.next/server/chunks/112.js +0 -1
- package/dist/standalone/.next/server/chunks/2190.js +0 -1
- package/dist/standalone/.next/server/chunks/2318.js +0 -2
- package/dist/standalone/.next/server/chunks/2371.js +0 -1
- package/dist/standalone/.next/server/chunks/2500.js +0 -55
- package/dist/standalone/.next/server/chunks/2799.js +0 -1
- package/dist/standalone/.next/server/chunks/2870.js +0 -104
- package/dist/standalone/.next/server/chunks/3598.js +0 -81
- package/dist/standalone/.next/server/chunks/3740.js +0 -126
- package/dist/standalone/.next/server/chunks/3953.js +0 -1
- package/dist/standalone/.next/server/chunks/411.js +0 -1
- package/dist/standalone/.next/server/chunks/4191.js +0 -1
- package/dist/standalone/.next/server/chunks/461.js +0 -1
- package/dist/standalone/.next/server/chunks/4968.js +0 -2
- package/dist/standalone/.next/server/chunks/5408.js +0 -1
- package/dist/standalone/.next/server/chunks/6333.js +0 -47
- package/dist/standalone/.next/server/chunks/6839.js +0 -81
- package/dist/standalone/.next/server/chunks/7045.js +0 -319
- package/dist/standalone/.next/server/chunks/7159.js +0 -1
- package/dist/standalone/.next/server/chunks/8176.js +0 -1
- package/dist/standalone/.next/server/chunks/8263.js +0 -81
- package/dist/standalone/.next/server/chunks/8392.js +0 -126
- package/dist/standalone/.next/server/chunks/9120.js +0 -78
- package/dist/standalone/.next/server/chunks/9507.js +0 -1
- package/dist/standalone/.next/static/6jhPk8sOUI3wRf_j1l5vY/_buildManifest.js +0 -1
- package/dist/standalone/.next/static/chunks/3021-9ced2d55bf2cbf77.js +0 -1
- package/dist/standalone/.next/static/chunks/app/_global-error/page-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/access/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/account-migrations/[intentId]/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/account-project-bindings/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/[id]/status/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/active/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/limits/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/login/[operationId]/input/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/login/[operationId]/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/policy/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/claude/terminal/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/active/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/limits/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/policy/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/reset-credits/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/codex/terminal/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/accounts/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/agent/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/agent/snapshot/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/answer/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/artifact/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/attach-command/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/attention/[id]/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/attention/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/board/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/bridge/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/conversation-host/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/conversation-host/targets/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/conversations/[conversationId]/migration/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/conversations/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/files/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/flows/[id]/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/flows/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/image/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/inbox/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/lifecycle/reaper/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/limits/history/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/limits/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/log/preflight/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/log/project-delete/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/log/provenance/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/log/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/log/suggestions/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/logs/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/logs/stream/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/monitor/runs/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/orchestrator/rotate/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/orchestrator/seat/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/orchestrator/seat/status/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/pipelines/[id]/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/pipelines/preflight/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/pipelines/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/pipelines/tick/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/proc/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/projects/create/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/projects/crown/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/projects/directories/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/push/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/resources/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/roles/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/answer/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/deployments/[deploymentId]/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/deployments/capabilities/v1/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/deployments/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/hosts/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/interrupt/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/operations/[operationId]/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/operations/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/realtime/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/send/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/snapshot/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/spawn/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/steer/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/runtime/stream/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/search/transcripts/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/session/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/session/supersedence/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/session/title/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/spawn/policy/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/spawn/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/staging/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/task-attachments/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/assignment/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/send/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tasks/[id]/spawn/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tasks/curator/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tasks/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/telegram/reports/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/telegram/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/timeline/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tmux/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tmux/targets/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/transcribe/backend/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/transcribe/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/transcribe/token/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tts/backend/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/tts/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/view/presence/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/workflows/[id]/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/api/workflows/route-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/app/page-dbe7cb010b4941d6.js +0 -96
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-3e358516d279299e.js +0 -1
- package/dist/standalone/.next/static/css/282596e2aaee1aa4.css +0 -1
- package/dist/standalone/src/lib/inboxFiles.ts +0 -203
- /package/dist/standalone/.next/static/{6jhPk8sOUI3wRf_j1l5vY → e4qE_aCE0s0KQnnU6IWRw}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=7159,exports.ids=[1888,7159,9507],exports.modules={25682:(a,b,c)=>{c.d(b,{hotStateMigrationApplied:()=>j,hotStateMigrationDryRun:()=>k});var d=c(27146),e=c(98817),f=c(18027),g=c(14928),h=c(96796);function i(a,b){let c=new Set;for(let d of b.keys){if(!d||c.has(d))throw Error(`duplicate or empty ${a} migration key: ${d}`);c.add(d)}return b}function j(){return(0,g.bG)((0,d.BQ)("state.sqlite"),[(0,e.flowStateCollectionSeed)(),...(0,f.pipelineStateCollectionSeeds)(),(0,h.workflowStateCollectionSeed)()])}function k(){let a=(0,f.planPipelineStateMigration)();return{flows:i("flows",(0,e.planFlowStateMigration)()),pipelines:i("pipelines",a.pipelines),pipelinesArchive:i("pipelines_archive",a.archive),workflows:i("workflows",(0,h.planWorkflowStateMigration)())}}},51888:(a,b,c)=>{c.d(b,{Gh:()=>l,JL:()=>i,OV:()=>n,RC:()=>k,c7:()=>d,cC:()=>j,fC:()=>f,g9:()=>q,ll:()=>p,wi:()=>r});let d="gpt-6-astra",e="gpt-5.6-sol",f="gpt-5.6-terra",g="gpt-5.6-luna",h=new Set([d,e,f,g,"gpt-5.5","gpt-5.4","gpt-5.4-mini"]);function i(a){return!a?.trim()||h.has(a.trim())}let j={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-6-Astra",shortLabel:"6-Astra",use:"review"},{id:e,label:"GPT-5.6-Sol",shortLabel:"5.6-Sol",use:"review"},{id:f,label:"GPT-5.6-Terra",shortLabel:"5.6-Terra",use:"implement"},{id:g,label:"GPT-5.6-Luna",shortLabel:"5.6-Luna",use:"general"}]};function k(a,b){let c=b.trim(),d=j[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(", ")}`}}function l(a){return"codex"===a?d:"opus"}let m=["fable","opus","sonnet","haiku"];function n(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 m)if(b===a||RegExp(`(?:^|[-_.])${a}(?:[-_.]|$)`).test(b))return a;return null}let o=new Set(["fable","opus"]);function p(a){let b=n(a);return null===b||o.has(b)}function q(a){if("string"!=typeof a)return!1;let b=a.trim();return b.startsWith("gpt-")&&b.length<=128&&!/[\u0000-\u001f\u007f]/.test(b)}function r(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}}}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=8176,exports.ids=[8176],exports.modules={21153:(a,b,c)=>{c.d(b,{Pf:()=>z,h6:()=>w,z4:()=>y});var d=c(77598),e=c.n(d),f=c(73024),g=c.n(f),h=c(76760),i=c.n(h),j=c(91724),k=c(89940),l=c(2033),m=c(64859),n=c(49729);let o=(0,j.BQ)("tasks.json"),p=new WeakMap;function q(a,b,c){for(let b of a)b.project=(0,k.G$)(b.project);return(0,m.lw)(a,b,c),a.map(a=>{let c=b.get(a.id);return c&&(0,m.d4)(a)===c.revision&&p.has(c.ref)?p.get(c.ref):a})}function r(a,b){g().mkdirSync(i().dirname(a),{recursive:!0});let c=i().join(i().dirname(a),`.${i().basename(a)}.${process.pid}.${e().randomUUID()}.tmp`);g().writeFileSync(c,JSON.stringify(b,null,2)+"\n","utf8"),g().renameSync(c,a)}function s(a){return!(!a||"object"!=typeof a||Array.isArray(a))&&"number"==typeof a.x&&Number.isFinite(a.x)&&"number"==typeof a.y&&Number.isFinite(a.y)}function t(a){var b;return!(!a||"object"!=typeof a||Array.isArray(a))&&("string"==typeof a.path||null===a.path)&&(void 0===a.launchId||"string"==typeof a.launchId||null===a.launchId)&&(void 0===a.clientAttemptId||"string"==typeof a.clientAttemptId||null===a.clientAttemptId)&&(void 0===a.conversationId||"string"==typeof a.conversationId||null===a.conversationId)&&("number"==typeof a.panePid||null===a.panePid)&&(null===a.panePid||Number.isInteger(a.panePid)&&a.panePid>0)&&("delivered"===(b=a.state)||"failed"===b||"spawning"===b||"handoff"===b)&&("string"==typeof a.error||null===a.error)&&"string"==typeof a.at}function u(a){return"pinned"===a||"unplaced"===a||"auto"===a}function v(a){return!(!a||"object"!=typeof a||Array.isArray(a))&&"string"==typeof a.clientRequestId&&"string"==typeof a.taskId}function w(a=o){return x(a).tasks}function x(a=o){let b=function(a){try{return JSON.parse(g().readFileSync(a,"utf8"))}catch(a){if("ENOENT"===a.code)return;throw a}}(a);if(void 0===b)return{tasks:[],recentCreates:[]};if(!b||!Array.isArray(b.tasks))throw Error("invalid persisted task state");let c=b.tasks.map(a=>{let b=function(a){var b,c,d;let e,f;if(!a||"object"!=typeof a||Array.isArray(a)||!("string"==typeof a.id&&"string"==typeof a.project&&("inbox"===(b=a.status)||"assigned"===b||"blocked"===b||"done"===b)&&"string"==typeof a.text&&(void 0===a.placement||u(a.placement))&&(void 0===a.pos||s(a.pos))&&(e=void 0!==a.dueAt,f=void 0!==a.dueTz,!e&&!f||"string"==typeof a.dueAt&&"string"==typeof a.dueTz)&&(void 0===(c=a.attachments)||Array.isArray(c)&&c.every(n.tK))&&Array.isArray(a.assignments)&&a.assignments.every(t)&&(void 0===a.source||!(!(d=a.source)||"object"!=typeof d||Array.isArray(d))&&"string"==typeof d.path&&("string"==typeof d.ts||null===d.ts)&&"string"==typeof d.text&&"string"==typeof d.fingerprint&&("claude"===d.engine||"codex"===d.engine))&&"string"==typeof a.createdAt&&"string"==typeof a.updatedAt))return null;let g=s(a.pos),h=u(a.placement)?a.placement:g?"pinned":"unplaced",i="pinned"===h&&g,j={...a,id:a.id,project:(0,k.G$)(a.project),status:a.status,text:a.text,placement:"pinned"!==h||g?h:"unplaced",...i?{pos:a.pos}:{},...void 0!==a.dueAt?{dueAt:a.dueAt,dueTz:a.dueTz}:{},...void 0!==a.attachments?{attachments:a.attachments}:{},assignments:a.assignments,...void 0!==a.source?{source:a.source}:{},createdAt:a.createdAt,updatedAt:a.updatedAt};i||delete j.pos;try{Object.assign(j,{revision:(0,m.d4)(j)})}catch{return null}return j}(a);if(!b)throw Error("invalid persisted task row");return p.set(b,a),b});if(new Set(c.map(a=>a.id)).size!==c.length)throw Error("duplicate persisted task id");if(void 0!==b.recentCreates&&(!Array.isArray(b.recentCreates)||!b.recentCreates.every(v)))throw Error("invalid persisted task receipts");return{tasks:c,recentCreates:b.recentCreates??[]}}function y(a,b=o){return(0,l.Ol)(b,"task state is busy",()=>{let c=x(b),d=(0,m.lU)(c.tasks),e=a(c.tasks);if(e.tasks){let a=q(e.tasks,d,!0);r(b,c.recentCreates.length?{tasks:a,recentCreates:c.recentCreates}:{tasks:a})}return e.result})}function z(a,b=o){return(0,l.Ol)(b,"task state is busy",()=>{let c=x(b),d=(0,m.lU)(c.tasks),e=a(c);if(e.state){let a=q(e.state.tasks,d,!0);r(b,e.state.recentCreates.length?{tasks:a,recentCreates:e.state.recentCreates}:{tasks:a})}return e.result})}},49729:(a,b,c)=>{c.d(b,{L0:()=>p,tK:()=>n,Gm:()=>q,nw:()=>r,Bx:()=>s});var d=c(77598),e=c.n(d),f=c(73024),g=c.n(f),h=c(76760),i=c.n(h),j=c(91724),k=c(99410);let l=new Set(["png","jpg","gif","webp"]),m={png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp"};function n(a){return!(!a||"object"!=typeof a||Array.isArray(a))&&"string"==typeof a.id&&a.id.length>0&&"string"==typeof a.sha256&&/^[0-9a-f]{64}$/.test(a.sha256)&&"string"==typeof a.ext&&l.has(a.ext)&&"string"==typeof a.mime&&null!==(0,k.PG)(a.mime)&&"number"==typeof a.bytes&&Number.isFinite(a.bytes)&&a.bytes>0&&"string"==typeof a.createdAt}function o(){return(0,j.BQ)("attachments","tasks")}function p(a){return i().join(o(),`${a.sha256}.${a.ext}`)}function q(a,b){if(!/^[0-9a-f]{64}$/.test(a)||!l.has(b))return null;let c=p({sha256:a,ext:b});try{return{data:g().readFileSync(c),mime:m[b]}}catch{return null}}function r(a,b,c,d=e().randomUUID()){let f=(0,k.PG)(b);if(null===f||!l.has(f))return{ok:!1,error:"unsupported image type",status:400};if(0===a.length)return{ok:!1,error:"empty image",status:400};if(a.length>k.YP)return{ok:!1,error:"image is too large",status:413};let h={id:d,sha256:e().createHash("sha256").update(a).digest("hex"),ext:f,mime:b,bytes:a.length,createdAt:c},j=p(h);if(!g().existsSync(j)){g().mkdirSync(i().dirname(j),{recursive:!0});let b=`${j}.${process.pid}.${e().randomUUID()}.tmp`;g().writeFileSync(b,a),g().renameSync(b,j)}return{ok:!0,attachment:h}}function s(a,b,c=o()){try{let d=function(a){let b=new Set;for(let c of a)for(let a of c.attachments??[])b.add(a.sha256);return b}(a);for(let a of g().readdirSync(c)){let e=a.replace(/\.[^.]+$/,"");if(d.has(e))continue;let f=i().join(c,a);try{let a=g().statSync(f);if(b-a.mtimeMs<6048e5)continue;g().unlinkSync(f)}catch{}}}catch{}}},60641:(a,b,c)=>{function d(){return new Date().toISOString()}function e(a){return(a.split(/\r?\n/,1)[0]?.trim()??"")||"Untitled"}function f(a,b){return`Task #${a.slice(0,8)}: ${b}`}c.d(b,{Ec:()=>d,F7:()=>f,bO:()=>e})},64859:(a,b,c)=>{c.d(b,{d4:()=>f,lU:()=>g,lw:()=>h});var d=c(77598);function e(a){let{revision:b,...c}=a;return(0,d.createHash)("sha256").update(JSON.stringify(function a(b){return Array.isArray(b)?b.map(a):b&&"object"==typeof b?Object.fromEntries(Object.entries(b).sort(([a],[b])=>a.localeCompare(b)).map(([b,c])=>[b,a(c)])):b}(c))).digest("hex")}function f(a){let b=a.revision;if(void 0===b)return`task-legacy:${e(a)}`;if("string"!=typeof b||!/^(task-v1:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|task-legacy:[0-9a-f]{64})$/.test(b))throw Error("invalid persisted task revision");return b}function g(a){return new Map(a.map(a=>[a.id,{ref:a,fingerprint:e(a),revision:f(a)}]))}function h(a,b,c){for(let f of a){let a=b.get(f.id),g=!a||a.fingerprint!==e(f)||c&&a.ref!==f;f.revision=g?`task-v1:${(0,d.randomUUID)()}`:a.revision}}},90748:(a,b,c)=>{c.d(b,{O6:()=>u,UT:()=>o,Xb:()=>r,fW:()=>t,mQ:()=>p,vq:()=>q,yy:()=>s});var d=c(77598),e=c.n(d),f=c(49729),g=c(64859),h=c(60641);function i(a){return"string"!=typeof a?null:a.trim()||null}function j(a){let b=a&&"object"==typeof a&&!Array.isArray(a)?a:null,c=b?"number"==typeof b.x&&Number.isFinite(b.x)?"pos.y":"pos.x":"pos";return{ok:!1,error:`${c} must be ${"pos"===c?"an object with finite x and y":"a finite number"}`,status:400,code:"TASK_INVALID_FIELD",field:c}}function k(a){return!a||"object"!=typeof a||Array.isArray(a)?null:"number"==typeof a.x&&Number.isFinite(a.x)&&"number"==typeof a.y&&Number.isFinite(a.y)?{x:a.x,y:a.y}:null}function l(a){return"pinned"===a||"unplaced"===a?a:null}function m(a,b){let c=null!=a,d=null!=b;if(!c&&!d)return{ok:!0};if(c!==d)return{ok:!1,error:"dueAt and dueTz must be set together"};if("string"!=typeof a||"string"!=typeof b)return{ok:!1,error:"invalid deadline"};let e=Date.parse(a);return Number.isFinite(e)?!function(a){try{return new Intl.DateTimeFormat(void 0,{timeZone:a}),!0}catch{return!1}}(b)?{ok:!1,error:"invalid dueTz"}:{ok:!0,dueAt:new Date(e).toISOString(),dueTz:b}:{ok:!1,error:"invalid dueAt"}}function n(){return{ok:!1,error:"Task text must be no longer than 6000 characters",status:400}}function o(a,b,c=[],d={}){var g,p;let q="string"!=typeof(p=b.project)?null:p.trim()||null;if(!q)return{ok:!1,error:"project is required",status:400};let r=i(b.text);if(!r)return{ok:!1,error:"task text is required",status:400};if(r.length>6e3)return n();let s="string"==typeof b.clientRequestId&&b.clientRequestId.trim()?b.clientRequestId.trim():null;if(s){let b=c.find(a=>a.clientRequestId===s);if(b){let d=a.find(a=>a.id===b.taskId);if(d)return{ok:!0,tasks:a,task:d,recentCreates:c,replay:!0}}}let t=k(b.pos);if(Object.hasOwn(b,"pos")&&!t)return j(b.pos);let u=l(b.placement)??(t?"pinned":null);if(void 0!==b.placement&&null===u)return{ok:!1,error:"invalid placement",status:400};if("pinned"===u&&!t)return{ok:!1,error:"task position is required",status:400,code:"TASK_INVALID_FIELD",field:"pos"};if("unplaced"===u&&t)return{ok:!1,error:"unplaced task must not carry a position",status:400,code:"TASK_INVALID_FIELD",field:"pos"};if(null===u)return{ok:!1,error:"task position is required",status:400,code:"TASK_INVALID_FIELD",field:"pos"};let v=m(b.dueAt,b.dueTz);if(!v.ok)return{ok:!1,error:v.error,status:400};let w=function(a,b){if(null==a)return{ok:!0};if(!Array.isArray(a))return{ok:!1,error:"invalid attachments",status:400};if(0===a.length)return{ok:!0};let c=[];for(let d of a){if(!(0,f.tK)(d))return{ok:!1,error:"invalid attachment ref",status:400};if(!b(d))return{ok:!1,error:"attachment not found in store",status:400};c.push(d)}return{ok:!0,attachments:c}}(b.attachments,d.attachmentExists??(()=>!0));if(!w.ok)return w;let x=void 0===(g=b.source)?void 0:!g||"object"!=typeof g||Array.isArray(g)?null:"string"==typeof g.path&&g.path.trim()&&(null===g.ts||"string"==typeof g.ts)&&"string"==typeof g.text&&g.text.trim()&&"string"==typeof g.fingerprint&&g.fingerprint.trim()&&("claude"===g.engine||"codex"===g.engine)?{path:g.path,ts:g.ts,text:g.text,fingerprint:g.fingerprint,engine:g.engine}:null;if(null===x)return{ok:!1,error:"invalid task source",status:400};if(a.filter(a=>a.project===q).length>=300)return{ok:!1,error:"The project already has 300 tasks. Close or delete extra tasks.",status:409};let y=d.now?.()??(0,h.Ec)(),z=d.id?.()??e().randomUUID(),A={id:z,project:q,status:"inbox",text:r,placement:u,..."pinned"===u&&t?{pos:t}:{},...v.dueAt?{dueAt:v.dueAt,dueTz:v.dueTz}:{},...w.attachments?{attachments:w.attachments}:{},...x?{source:x}:{},assignments:[],createdAt:y,updatedAt:y};return{ok:!0,tasks:[...a,A],task:A,recentCreates:s?[...c,{clientRequestId:s,taskId:z}].slice(-100):c,replay:!1}}function p(a,b,c,d=(0,h.Ec)(),e={}){let f=a.findIndex(a=>a.id===b);if(f<0)return{ok:!1,error:"task not found",status:404};let o=a[f];if(e.requirePlacementGuards&&(Object.hasOwn(c,"pos")||Object.hasOwn(c,"placement"))||Object.hasOwn(c,"expectedProject")||Object.hasOwn(c,"expectedRevision")){for(let a of["expectedProject","expectedRevision"])if("string"!=typeof c[a]||!c[a].trim())return{ok:!1,status:400,code:"TASK_INVALID_FIELD",field:a,error:`${a} must be a non-empty string copied from the current task`};if(c.expectedProject!==o.project)return{ok:!1,status:409,code:"TASK_PROJECT_MISMATCH",field:"expectedProject",error:"expectedProject does not match the current task project; read the task and reconsider the request"};if(c.expectedRevision!==(0,g.d4)(o))return{ok:!1,status:409,code:"TASK_REVISION_MISMATCH",field:"expectedRevision",error:"expectedRevision is stale; read the task and reconsider the request"}}let q={};if(Object.hasOwn(c,"text")){let a=i(c.text);if(!a)return{ok:!1,error:"task text is required",status:400};if(a.length>6e3)return n();q.text=a}if(Object.hasOwn(c,"status")){var r;let a="inbox"===(r=c.status)||"assigned"===r||"blocked"===r||"done"===r?r:null;if(!a)return{ok:!1,error:"invalid task status",status:400};q.status=a}if(Object.hasOwn(c,"pos")){let a=k(c.pos);if(!a)return j(c.pos);q.pos=a,q.placement="pinned"}if(Object.hasOwn(c,"placement")){let a=l(c.placement);if(!a)return{ok:!1,error:"invalid placement",status:400};if("pinned"===a&&!q.pos&&!o.pos)return{ok:!1,error:"task position is required",status:400,code:"TASK_INVALID_FIELD",field:"pos"};q.placement=a}if(Object.hasOwn(c,"dueAt")||Object.hasOwn(c,"dueTz"))if(null===c.dueAt&&void 0===c.dueTz)q.dueAt=void 0,q.dueTz=void 0;else{let a=m(c.dueAt,c.dueTz);if(!a.ok)return{ok:!1,error:a.error,status:400};q.dueAt=a.dueAt,q.dueTz=a.dueTz}let s={...o,...q,updatedAt:d};Object.hasOwn(q,"dueAt")&&void 0===q.dueAt&&(delete s.dueAt,delete s.dueTz),"unplaced"===s.placement&&delete s.pos;let t=a.slice();return t[f]=s,{ok:!0,tasks:t,task:s}}function q(a,b){let c=a.filter(a=>a.id!==b);return c.length===a.length?{ok:!1,error:"task not found",status:404}:{ok:!0,tasks:c}}function r(a){if(!a||"object"!=typeof a||Array.isArray(a))return null;let b={};return"string"==typeof a.launchId&&a.launchId.trim()&&(b.launchId=a.launchId.trim()),"string"==typeof a.path&&a.path.trim()&&(b.path=a.path.trim()),"string"==typeof a.conversationId&&a.conversationId.trim()&&(b.conversationId=a.conversationId.trim()),"number"==typeof a.panePid&&Number.isInteger(a.panePid)&&a.panePid>0&&(b.panePid=a.panePid),null!=b.launchId||null!=b.conversationId||null!=b.path||null!=b.panePid?b:null}function s(a,b,c,d=(0,h.Ec)()){let e=a.findIndex(a=>a.id===b);if(e<0)return{ok:!1,error:"task not found",status:404};let f="string"==typeof c?{path:c}:c,g=a[e],i=g.assignments.filter(a=>null!=f.launchId?a.launchId!==f.launchId:null!=f.conversationId?a.conversationId!==f.conversationId:null!=f.path?a.path!==f.path:null==f.panePid||a.panePid!==f.panePid);if(i.length===g.assignments.length)return{ok:!0,tasks:a,task:g};let j={...g,assignments:i,updatedAt:d},k=a.slice();return k[e]=j,{ok:!0,tasks:k,task:j}}function t(a,b){return a.find(a=>a.engine===b&&"string"==typeof a.accountId)?.accountId??null}function u(a,b,c,d=(0,h.Ec)()){let e=a.findIndex(a=>a.id===b);if(e<0)return{ok:!1,error:"task not found",status:404};let f=a[e],g=function(a,b){let c=a.slice();for(let a of b){let b=c.findIndex(b=>a.launchId&&b.launchId?b.launchId===a.launchId:null!==a.path&&b.path===a.path||null===a.path&&null!==a.panePid&&null===b.path&&b.panePid===a.panePid),d=b>=0?c[b]:void 0,e=void 0!==a.launchId?a.launchId:d?.launchId,f=void 0!==a.clientAttemptId?a.clientAttemptId:d?.clientAttemptId,g=void 0!==a.conversationId?a.conversationId:d?.conversationId,h={...void 0!==e?{launchId:e}:{},...void 0!==f?{clientAttemptId:f}:{},path:a.path,...void 0!==g?{conversationId:g}:{},panePid:a.panePid,state:a.state,error:a.error,at:a.at,...void 0!==a.accountId?{accountId:a.accountId}:{},...void 0!==a.engine?{engine:a.engine}:{}};c=b>=0?[...c.slice(0,b),h,...c.slice(b+1)]:[...c,h]}return c}(f.assignments,c),i=g.some(a=>"delivered"===a.state||"spawning"===a.state||"handoff"===a.state),j=f.status;("inbox"===j||"assigned"===j)&&(j=i?"assigned":"inbox");let k={...f,status:j,assignments:g,updatedAt:d},l=a.slice();return l[e]=k,{ok:!0,tasks:l,task:k}}},99410:(a,b,c)=>{c.d(b,{PG:()=>f,YP:()=>e});let d={"image/png":"png","image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp"},e=0xa00000;function f(a){return d[a]??null}}};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=8263,exports.ids=[1888,3598,8263,9507],exports.modules={23886:(a,b,c)=>{c.d(b,{adoptStructuredHostsAtStartup:()=>$,releaseUnpublishedStartupHostsForDemotion:()=>ac});var d=c(77598),e=c.n(d),f=c(76760),g=c.n(f),h=c(65236),i=c(68465),j=c(66812),k=c(58577),l=c(70160),m=c(22993),n=c(88623),o=c(29307),p=c(76385),q=c(21420),r=c(842),s=c(65281),t=c(18027),u=c(62490),v=c(93994),w=c(28637),x=c(5242),y=c(66052),z=c(75211),A=c(83968),B=c(61532);let C=[],D=[],E=!1,F=null;function G(a,b){let c=new Map(a.map(a=>[(0,n.pp)(a.key),a]));for(let a of b){let b=(0,n.pp)(a.key);c.has(b)||c.set(b,a)}return[...c.values()]}async function H(a,b,c=a.readOnlySnapshot(),d=new Set){let e=[];for(let a of b)!function(a,b,c=new Set){let d=(0,n.pp)(b.key),e=a.entries[d];if(!e?.structuredHost||"dead"===e.status||"unhosted"===e.status)return!1;let f=Object.values(a.conversations).find(a=>a.engine===b.key.engine&&a.generations.at(-1)?.id===b.key.sessionId);return!!(f&&!f.supersededBy&&("terminal"!==f.turn.state||c.has(d)))}(c,a,d)?await a.host.release():e.push(a);return e}let I=["runtime.send","runtime.steer","runtime.interrupt","runtime.answer","runtime.spawn","runtime.reconfigure","runtime.compact"],J="recovery-continuation",K=e().randomUUID(),L=[];function M(a,b){D=a;let c=new Set(a.map(a=>(0,n.pp)(a.key)));L=b.filter(a=>c.has(a.hostKey))}async function N(a,b=(0,o.js)(),c=a.readOnlySnapshot(),d={}){let e=[];for(let f of b){if(!f.conversationId?.startsWith("conversation_"))continue;let b=a.canonicalConversationId(f.conversationId),g=c.conversations[b],h=g?.generations.at(-1);if(!g||!h||g.supersededBy)continue;let i=(0,n.pp)({engine:g.engine,sessionId:h.id}),j=c.entries[i];if(!j?.structuredHost||null!==j.host)continue;let k=await (0,A.kT)(a,b,{...d,snapshot:c});k?.state==="severed"&&"busy"===k.turn&&(console.error("[structured hosts] resuming an orchestrator seat whose turn was severed",{project:f.project,conversationId:b,evidence:k.reason}),e.push({project:f.project,conversationId:b,path:h.path,seatEpoch:f.seatEpoch,hostKey:i,severed:{kind:k.lastEvent.kind,at:k.lastEvent.at,reason:k.reason}}))}return e}function O(a,b,c,d=a.readOnlySnapshot()){let e=c.find(a=>a.project===b.project);if(!e||"active"!==e.state||e.seatEpoch!==b.seatEpoch||!e.conversationId?.startsWith("conversation_")||a.canonicalConversationId(e.conversationId)!==b.conversationId)return!1;let f=d.conversations[b.conversationId],g=f?.generations.at(-1);if(!f||!g||f.supersededBy||g.path!==b.path||(0,n.pp)({engine:f.engine,sessionId:g.id})!==b.hostKey)return!1;let h=d.entries[b.hostKey];return!!(h?.structuredHost&&null===h.host&&("live"===h.status||"idle"===h.status))}function P(a,b,c,d=a.readOnlySnapshot()){return new Set(b.filter(b=>O(a,b,c,d)).map(a=>a.hostKey))}async function Q(a,b,c,d,e){for(let f of c){if(!d.has(f.hostKey)||!O(a,f,e()))continue;let c=`orchestrator-restart-recovery-${K}-${f.seatEpoch}`,g=await (0,y.enqueueStructuredMessage)({path:f.path,conversationId:f.conversationId,clientMessageId:c,text:function(a){let b=null===a.at?"an unrecorded time":new Date(a.at).toISOString();return`Viewer restarted and severed your structured host mid-turn. The severed turn is the one whose last transcript event is ${a.kind??"a record"} at ${b}, which nothing answered. You were re-hosted automatically; resume that turn.`}(f.severed),images:[]},{enabled:()=>!0,client:()=>b,registry:()=>a});if(!g?.ok)throw console.error("[structured hosts] orchestrator restart recovery delivery failed",{conversationId:f.conversationId,status:g?.status??503,error:g?.error??"structured delivery unavailable"}),new v.Hr(g?.error??"orchestrator restart recovery delivery admission failed")}}function R(a,b){return`${J}-${a}-${b}`}async function S(a,b,c,d,e,f){for(let g of c){let c=(0,n.pp)(g.key),h=d.get(c);if(!h||f.has(h))continue;let i=a.readOnlySnapshot().entries[c];if(!i)throw Error(`adopted Codex registry row disappeared: ${c}`);let j=R(g.key.sessionId,i.claimEpoch),k=e.get(c);if(k){if("failed"===k.receipt.status||"rejected"===k.receipt.status){k.receipt.retryOfOperationId||await b.retryOperation(k.operationId,`${k.receipt.idempotencyKey}-retry-1`,{requireHostedConversationId:h});continue}if(k.operationId===j||"delivered"!==k.receipt.status||k.receipt.retryOfOperationId)continue}await b.command({kind:"send",operationId:j,idempotencyKey:j,conversationId:h,text:"Continue the interrupted turn from the transcript.",policy:"queue",turnId:null})}}async function T(a,b,c){let d=new Map;for(let e of c){let c=(0,n.pp)(e.key),f=a.readOnlySnapshot().entries[c];if(!f)continue;let g=await b.operationStatus(R(e.key.sessionId,f.claimEpoch),{currentRetryLeaf:!0});if(g){d.set(c,g);continue}if(f.claimEpoch<=0)continue;let h=await b.operationStatus(R(e.key.sessionId,f.claimEpoch-1),{currentRetryLeaf:!0});h&&d.set(c,h)}return d}async function U(a,b=()=>{}){let c=a.readOnlySnapshot(),d=new Date().toISOString(),e=Object.values(c.conversations).flatMap(a=>{let b=a.generations.at(-1);if(!b)return[];let d=(0,n.pp)({engine:a.engine,sessionId:b.id}),e=c.entries[d];return e?.structuredHost&&"live"===e.status&&!a.supersededBy?[{conversation:a,generation:b,hostKey:d}]:[]}),f=[],g=new Set,h=0,i=Array.from({length:Math.min(16,e.length)},async()=>{for(;h<e.length;){let a=e[h++];if(!a)continue;let{conversation:b,generation:c,hostKey:i}=a,k=await (0,r.mR)(c.path);if("complete"!==k.integrity){g.add(i);continue}let l=function(a,b,c){if("claude"===b)return(0,j.j)(a,"claude");if(!c)return(0,j.j)(a,"codex",!0);let d=a.findLastIndex(a=>{let b=a.payload;if(!b||"object"!=typeof b||Array.isArray(b))return!1;let c=b.type;return"task_started"===c||"turn_started"===c||"user_message"===c});if(d<0){let b=(0,j.j)(a,"codex",!0);return"terminal"===b.state?{state:"unknown",source:"empty",terminalAt:null}:b}return(0,j.j)(a.slice(d),"codex",!0)}(k.records,b.engine,k.prefixTruncated);("busy"===l.state||"terminal"===l.state)&&f.push({engine:b.engine,path:c.path,accountId:c.accountId,launchProfile:c.launchProfile,turn:l,expectedTurnObservedAt:b.turn.observedAt,observedAt:d})}});return await Promise.all(i),b(),f.length>0&&a.reconcileConversations(f),g}function V(a,b){return b.startsWith("conversation_")?a.canonicalConversationId(b):b}async function W(a,b){if(!b)return{hostedRunningConversationIds:new Set,pendingOperationConversationIds:new Set,pendingCodexContinuationConversationIds:new Set};let c=await b.snapshot(),d=new Set(c.sessions.filter(a=>"hosted"===a.host&&("running"===a.turn||"interrupt_requested"===a.turn)).map(b=>V(a,b.conversationId))),e=new Set(c.recentOperations.filter(a=>"pending"===a.status||"queued"===a.status||"delivering"===a.status||"applying"===a.status).filter(a=>"kill"!==a.kind).map(b=>V(a,b.conversationId))),f=new Set,g=0;for(;;){let c=await b.effectBatch(I,g);for(let b of c){let c=b.payload.conversationId;if("string"==typeof c){let d=V(a,c);e.add(d),"runtime.send"===b.kind&&"string"==typeof b.payload.operationId&&b.payload.operationId.startsWith(`${J}-`)&&f.add(d)}}if(c.length<100)break;let d=Math.max(...c.map(a=>a.eventSeq));if(!Number.isSafeInteger(d)||d<=g)throw Error("structured startup operation page did not advance");g=d}return{hostedRunningConversationIds:d,pendingOperationConversationIds:e,pendingCodexContinuationConversationIds:f}}function X(a,b,c=a.readOnlySnapshot(),d=new Map,e=o.js,f=new Set,g=new Set,h=new Set){let i=new Map(Object.values(c.conversations).flatMap(a=>{let b=a.generations.at(-1);return b?[[(0,n.pp)({engine:a.engine,sessionId:b.id}),a]]:[]})),j=new Set(Object.values(c.heldDeliveries).filter(a=>"held"===a.state||"assigned"===a.state||"delivery-uncertain"===a.state).map(b=>a.canonicalConversationId(b.conversationId)));return c=>{let k=i.get((0,n.pp)(c.key));if(!k||k.supersededBy||h.has(a.canonicalConversationId(k.id)))return!1;let l=d.get((0,n.pp)(c.key));if(l?.some(b=>O(a,b,e())))return!0;let m=a.canonicalConversationId(k.id);if(j.has(m)||b.pendingOperationConversationIds.has(m)||"handoff"===c.pendingAction)return!0;if("terminal"===k.turn.state||g.has(m)||f.has((0,n.pp)(c.key)))return!1;let o=b.hostedRunningConversationIds.has(m),p="busy"===k.turn.state||!!c.structuredHost?.activeTurnRef||"live"===c.status&&o;return"live"===c.status&&p}}let Y=new Set(["passed","failed","needs_decision","skipped"]);function Z(a,b=!0){let c,d=new Set,e=new Set;try{if(!b)throw Error("pipeline admission authority is unavailable");c=(0,t.loadPipelinesForStartup)()}catch(b){for(let[c,d]of(console.error("[structured hosts] pipeline registry unreadable; deferring pipeline adoption",{error:b instanceof Error?b.message:String(b)}),Object.entries(a.readOnlySnapshot().memberships)))d.some(a=>"pipeline"===a.kind)&&e.add(a.canonicalConversationId(c));return{settled:d,deferred:e}}let f=a.readOnlySnapshot().memberships;for(let b of c){let c=b.runs.flatMap(a=>a.attempts).some(a=>a.unresolvedTermination?.survivors.some(a=>"dead"!==(0,p.Ue)(a)));if(c)for(let[c,d]of Object.entries(f))d.some(a=>"pipeline"===a.kind&&a.containerId===b.id)&&e.add(a.canonicalConversationId(c));for(let f of b.runs)for(let b of f.attempts){if(!b.conversationId?.startsWith("conversation_"))continue;let f=a.canonicalConversationId(b.conversationId);Y.has(b.state)&&d.add(f),c&&e.add(f)}}return{settled:d,deferred:e}}async function $(a={}){let b=a.assertActive??(()=>{});b(),(0,q.x_)();let c=a.registry??(0,l.agentRegistry)(),d=void 0===a.client?(0,v.sS)():a.client,e=a.orchestratorSeats??o.js,f=function(a,b){let c=new Map;for(let d of[...a,...b]){let a=`${d.project}\0${d.seatEpoch}\0${d.hostKey}`,b=c.get(a);c.set(a,b?{...d,severed:b.severed}:d)}return[...c.values()]}(L,await N(c,e(),c.readOnlySnapshot(),a.liveness??{})),j=function(a){let b=new Map;for(let c of a){let a=b.get(c.hostKey)??[];a.push(c),b.set(c.hostKey,a)}return b}(f),r=null!==d;d&&!(0,w.SW)(c)&&await (0,w.S8)([],{registry:c,client:d,deferStartupWork:!0}),(0,B.lk)({phase:"refreshing transcripts",completedHosts:0,totalHosts:null});let y=await (a.refreshTranscriptState?a.refreshTranscriptState(c):U(c,b))??new Set;return b(),(0,t.withPipelineStartupAdmission)(async l=>{var o,q,t,A,I;let J,K,N,O,R;b();let U=l?(a.pipelineEvidence??Z)(c):Z(c,!1),V=new Set(Object.values(c.readOnlySnapshot().conversations).filter(a=>U.deferred.has(c.canonicalConversationId(a.id))).flatMap(a=>a.generations.map(b=>(0,n.pp)({engine:a.engine,sessionId:b.id})))),Y=P(c,f,e()),$=await H(c,D,c.readOnlySnapshot(),Y);M($,f),c.drainDeadSupersededHeldDeliveries(),(0,u.cf)(c,a=>Y.has((0,n.pp)(a.key))||V.has((0,n.pp)(a.key)));let ab=await W(c,d),ac=X(c,ab,c.readOnlySnapshot(),j,e,y,U.settled,U.deferred),ad=a=>{try{b()}catch{return!1}return ac(a)},ae=Object.values(c.readOnlySnapshot().entries).filter(a=>a.structuredHost&&ad(a));if(!r&&ae.length>0){D=$,L=[...f];let a=ae.map(a=>(0,n.pp)(a.key));throw E||(E=!0,console.error("[structured hosts] deferring adoption until a delivery controller can claim it",{keys:a})),new v.Hr(`structured delivery controller is unavailable; deferred adoption of ${a.length} host(s): ${a.join(", ")}`)}let af=ae.filter(a=>"codex"===a.key.engine).length,ag=ae.length-af,ah=ae.length,ai=0,aj=a=>{b(),(0,B.lk)({phase:a,completedHosts:ai,totalHosts:ah})};aj("adopting Codex hosts");let ak=a.resolveCodexOwner??(a=>h.lD.resolveTranscriptOwner("codex",a.artifactPath)),al=a.resolveClaudeOwner??(a=>h.lD.resolveTranscriptOwner("claude",a.artifactPath)),am=(0,s.Fd)(process.env),an=await (a.adopt??u.Gd)(c,a=>{let b=ak(a),d=c.rotateSpawnCapabilityForPath(a.artifactPath),e=(0,z.bf)((0,z.oL)(a.launchProfile),am,d);return{cwd:a.cwd,codexHome:b?.home,fileAuthCredentials:b?.kind==="managed",model:a.launchProfile?.model??void 0,effort:a.launchProfile?.effort??void 0,allowSubagents:a.launchProfile?.allowSubagents??!1,mcpServers:a.launchProfile?.mcpServers??["viewer"],plugins:a.launchProfile?.plugins??[],...e.codex,...e.host,env:e.env}},am,ad,()=>{ai+=1,ah=Math.max(ah,ai),(0,B.lk)({phase:"adopting Codex hosts",completedHosts:ai,totalHosts:ah})});ai=Math.max(ai,af),M($=G($,an),f),aj("adopting Claude hosts");let ao=await (a.adoptClaude??u.Fn)(c,a=>{let b=al(a),d=c.rotateSpawnCapabilityForPath(a.artifactPath),e=(0,s.Fd)(b?.env??am),f=(0,z.bf)((0,z.oL)(a.launchProfile),e,d);return{cwd:a.cwd,claudeConfigDir:b?.kind==="managed"?b.home:void 0,claudeProjectsDir:b?.transcriptRoot,spawnPolicyBaseSettingsPath:b?.kind==="managed"?(0,i.ZK)():null,allowSubagents:a.launchProfile?.allowSubagents??!1,mcpServers:a.launchProfile?.mcpServers??["viewer"],mcpStatePath:b?.kind==="managed"?g().join(b.home,".claude.json"):b?g().join(g().dirname(b.home),".claude.json"):void 0,readOnly:(0,k.lV)(a.launchProfile),restricted:a.launchProfile?.sandbox==="restricted",env:f.env,...f.host,model:a.launchProfile?.model??void 0,effort:a.launchProfile?.effort??void 0,permissionMode:(0,m.A5)(a.launchProfile??{})}},am,ad,()=>{ai+=1,ah=Math.max(ah,ai),(0,B.lk)({phase:"adopting Claude hosts",completedHosts:ai,totalHosts:ah})});ai=Math.max(ai,af+ag),M($=G($,ao),f),function(a,b,c,d,e=w.sy,f=p.$k){let g=new Set(c.map(a=>(0,n.pp)(a.key))),h=Object.values(a.readOnlySnapshot().entries).filter(a=>a.structuredHost&&d(a.key)&&b(a)&&!g.has((0,n.pp)(a.key))&&!e(a.key));if(0===h.length)return;let i=h.filter(a=>{let b=a.structuredHost?.process;return!!(b&&f(b))}),j=h.filter(a=>!i.includes(a));if(j.length>0&&console.error("[structured hosts] eligible hosts have no live engine process to hand over; leaving them to on-demand hosting",{keys:j.map(a=>(0,n.pp)(a.key))}),0===i.length)return;let k=i.map(a=>(0,n.pp)(a.key));throw console.error("[structured hosts] eligible hosts remain owned by the incumbent Viewer; retrying startup",{keys:k}),new v.Hr(`structured startup left ${k.length} eligible host(s) owned by the incumbent Viewer: ${k.join(", ")}`)}(c,ad,$,b=>"codex"===b.engine?void 0===a.adopt:void 0===a.adoptClaude,a.hostClaimed),aj("reconciling structured hosts"),Y=P(c,f,e()),M($=await H(c,$,c.readOnlySnapshot(),Y),f);let ap=new Set($.map(a=>(0,n.pp)(a.key))),aq=$.filter(a=>"codex"===a.key.engine&&!Y.has((0,n.pp)(a.key))),ar=d?await T(c,d,aq):new Map;await (0,u.K$)(c,a=>ap.has((0,n.pp)(a.key))||V.has((0,n.pp)(a.key))||y.has((0,n.pp)(a.key))||ad(a));let as=c.readOnlySnapshot();Y=P(c,f,e(),as),M($=await H(c,$,as,Y),f);let at=X(c,ab,as,j,e,y,U.settled,U.deferred),au=new Set($.map(a=>(0,n.pp)(a.key))),av=function(a,b,c,d,e=a.readOnlySnapshot()){return new Map(Object.values(e.conversations).flatMap(f=>{let g=f.generations.at(-1);if("codex"!==f.engine||!g)return[];let h={engine:"codex",sessionId:g.id},i=e.entries[(0,n.pp)(h)];return d.has((0,n.pp)(h))?[]:("busy"===f.turn.state||"unknown"===f.turn.state&&(i?.structuredHost?.activeTurnRef||c.has(a.canonicalConversationId(f.id))))&&i?.structuredHost&&b(i)?[[(0,n.pp)(h),f.id]]:[]}))}(c,a=>au.has((0,n.pp)(a.key))||at(a),ab.hostedRunningConversationIds,y,as),aw=$.filter(a=>"codex"===a.key.engine&&!Y.has((0,n.pp)(a.key)));aj("finalizing structured delivery"),r&&(await (0,w.le)($,aj,b),function(a,b=w.sy){let c=a.filter(a=>!b(a.key));if(0===c.length)return;let d=c.map(a=>(0,n.pp)(a.key));throw console.error("[structured hosts] adopted hosts were left unclaimed by the delivery controller",{keys:d}),new v.Hr(`structured delivery controller did not claim ${c.length} adopted host(s): ${d.join(", ")}`)}($,a.hostClaimed)),aj("recovering orchestrator deliveries"),await Q(c,d,f.filter(a=>!V.has(a.hostKey)),au,e),d&&(aj("recovering interrupted deliveries"),await S(c,d,aw,av,ar,ab.pendingCodexContinuationConversationIds),aj("kicking recovered deliveries"),await (0,x.l)());let ax=_(c,U.deferred);return(d&&0===ax.length&&(aj("recovering pending spawns"),await (0,z.Z4)(c,d,{assertActive:b})),b(),C=$,V.size>0||ax.length>0)?(D=$,L=[...f],o=a,q=c,t=[...V],A=U.deferred,I=ax.length,J=`pipeline startup evidence is unresolved; deferred ${t.length} host(s)`+(I>0?` and ${I} pending launch receipt(s)`:""),O=(N=null!==(K=F)&&K.conversationIds.size===A.size&&[...A].every(a=>K.conversationIds.has(a))&&K.fencedReceipts===I)?Math.min(2*K.delayMs,3e4):1e3,F=R={hostKeys:t,conversationIds:new Set(A),fencedReceipts:I,message:J,delayMs:O},N||console.error(`[structured hosts] ${J}; re-probing the evidence`,{hosts:t,nextProbeMs:O}),aa(o,q,R)):(D=[],L=[],F&&(console.error("[structured hosts] deferred pipeline rows admitted",{hosts:F.hostKeys}),F=null)),C})}function _(a,b){return 0===b.size?[]:Object.values(a.readOnlySnapshot().receipts).filter(c=>"completed"!==c.state&&"failed"!==c.state&&"conflicted"!==c.state&&b.has(a.canonicalConversationId(c.conversationId)))}function aa(a,b,c){let d=a.schedule??((a,b)=>setTimeout(a,b));d(()=>{if(F===c){try{a.assertActive?.()}catch{return}ab(a,b,c)}},c.delayMs).unref?.()}async function ab(a,b,c){let d=!0;try{let e=(a.pipelineEvidence??Z)(b);d=[...c.conversationIds].every(a=>e.deferred.has(a))&&_(b,e.deferred).length>=c.fencedReceipts}catch(a){console.error("[structured hosts] deferred pipeline evidence probe failed",{error:a instanceof Error?a.message:String(a)})}if(d){c.delayMs=Math.min(2*c.delayMs,3e4),aa(a,b,c);return}try{await $(a)}catch(d){console.error("[structured hosts] deferred pipeline adoption pass failed; re-probing",{error:d instanceof Error?d.message:String(d)}),F===c&&(c.delayMs=Math.min(2*c.delayMs,3e4),aa(a,b,c))}}async function ac(){let a=(0,l.agentRegistry)(),b=G(C,D).filter(a=>!(0,w.sy)(a.key)),c=(await Promise.allSettled(b.map(async({key:b,host:c})=>{let d=await c.health();if("active"!==d.status&&"attention"!==d.status||null===d.pid||null===d.processStartIdentity)return;let e=(0,p.y6)(d.pid,void 0,d.processStartIdentity);if(!a.markStructuredHostHandoff(b,e))throw Error("unpublished startup host changed before release handover");await c.release()}))).flatMap(a=>"rejected"===a.status?[a.reason]:[]);if(c.length)throw AggregateError(c,"unpublished startup hosts did not quiesce")}},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,{Gh:()=>l,JL:()=>i,OV:()=>n,RC:()=>k,c7:()=>d,cC:()=>j,fC:()=>f,g9:()=>q,ll:()=>p,wi:()=>r});let d="gpt-6-astra",e="gpt-5.6-sol",f="gpt-5.6-terra",g="gpt-5.6-luna",h=new Set([d,e,f,g,"gpt-5.5","gpt-5.4","gpt-5.4-mini"]);function i(a){return!a?.trim()||h.has(a.trim())}let j={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-6-Astra",shortLabel:"6-Astra",use:"review"},{id:e,label:"GPT-5.6-Sol",shortLabel:"5.6-Sol",use:"review"},{id:f,label:"GPT-5.6-Terra",shortLabel:"5.6-Terra",use:"implement"},{id:g,label:"GPT-5.6-Luna",shortLabel:"5.6-Luna",use:"general"}]};function k(a,b){let c=b.trim(),d=j[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(", ")}`}}function l(a){return"codex"===a?d:"opus"}let m=["fable","opus","sonnet","haiku"];function n(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 m)if(b===a||RegExp(`(?:^|[-_.])${a}(?:[-_.]|$)`).test(b))return a;return null}let o=new Set(["fable","opus"]);function p(a){let b=n(a);return null===b||o.has(b)}function q(a){if("string"!=typeof a)return!1;let b=a.trim();return b.startsWith("gpt-")&&b.length<=128&&!/[\u0000-\u001f\u007f]/.test(b)}function r(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)}}}};
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=8392,exports.ids=[1888,3598,8392,9507],exports.modules={21123:(a,b,c)=>{c.r(b),c.d(b,{SEAT_TICK_WAKE_UNRESOLVED_REF:()=>bG,reconcileSeatTick:()=>bP,runSeatTickCheck:()=>bL,startSeatTick:()=>bR,stopSeatTick:()=>bS,wakeReached:()=>bI});var d=c(77598),e=c.n(d),f=c(73024),g=c.n(f),h=c(14928);c(66212);let i=["starting","running","waiting","stalled","completed","failed","blocked","gone"],j=["stage_started","stage_resumed","stage_paused","stage_completed","stage_failed","stage_blocked","review_verdict","repair_ready","deploy_ready","deploy_succeeded","deploy_failed","delivery_held","delivery_delivered","delivery_expired","agent_stalled","agent_gone","agent_resumed"],k={stage_started:"running",stage_resumed:"running",stage_paused:"waiting",stage_completed:"completed",stage_failed:"failed",stage_blocked:"blocked",review_verdict:"completed",repair_ready:"waiting",deploy_ready:"waiting",deploy_succeeded:"completed",deploy_failed:"failed",delivery_held:"waiting",delivery_delivered:"completed",delivery_expired:"failed",agent_stalled:"stalled",agent_gone:"gone",agent_resumed:"running"},l=new Set(["stage_completed","stage_failed","stage_blocked","review_verdict","deploy_succeeded","deploy_failed","delivery_held","delivery_expired"]);var m=c(43318);let n="monitor-ref:",o="orchestrator-unresolved";function p(a){let b=a.match(/^monitor-ref:\s*([A-Za-z0-9_-]{4,64})\s*$/m);return b?b[1]:null}let q=a=>`seat-tick-stuck-${a}`,r="seat-tick-settings",s=a=>`seat-tick-source-${a}`,t=["lane-event","unmerged-pr","stalled","unstarted-task","interval","child-terminal"],u=["registry-unreadable","children-unindexed","migration-blocked","migration-pending","discovery-incomplete","ledger-gap","child-departed","child-unplaced","ledger-pending"];function v(){return{seatEpoch:null,lastCheckAt:null,lastWakeAt:null,lastWakeReasons:[],wakesWithoutChange:{},quietSince:null,idleSince:null,lastProposalAt:null,stalledSeen:[],lastWakeFingerprint:null,eventsThrough:null,outstandingWake:null,pullRequestGap:null,childrenGap:null,harvestedChildren:[]}}let w=3e5,x=24e5,y=864e5,z=5,A=2,B=2592e5;function C(a,b,c){let d=Number(a?.trim());return Number.isFinite(d)&&d>0?d*c:b}function D(a=process.env){let b=a.LLV_SEAT_TICK_CHECK_MINUTES?.trim();return b&&0===Number(b)?null:{checkIntervalMs:C(b,w,6e4),stallAfterMs:C(a.LLV_SEAT_TICK_STALL_MINUTES,x,6e4),proposalIntervalMs:C(a.LLV_SEAT_TICK_PROPOSAL_HOURS,y,36e5),itemsPerWake:Math.floor(C(a.LLV_SEAT_TICK_ITEMS,z,1)),retryGuard:Math.floor(C(a.LLV_SEAT_TICK_RETRY_GUARD,A,1)),backlogAfterMs:C(a.LLV_SEAT_TICK_BACKLOG_DAYS,B,864e5)}}function E(a){return"terminal"!==a.state}function F(a){return"running"===a.status}function G(a){return"terminal"===a.status}function H(a){return`child:${a.conversationId}`}function I(a){var b;return b=a.type,l.has(b)&&!a.pipelineTerminal}function J(a){if("busy"!==a.turn)return!1;let b=a.activity;return!!b&&("waiting"===b.lifecycle?"busy"===b.turnState:"running"===b.lifecycle||"starting"===b.lifecycle)}function K(a,b,c){if(!a)return!0;let d=Date.parse(a);return!Number.isFinite(d)||b-d>=c}function L(a,b,c){if(!a)return!1;let d=Date.parse(a.since);return Number.isFinite(d)&&b-d>=c}function M(a,b,c){if(!a||!L(a,b,c))return!0;let d=Date.parse(a.lastAttemptAt);return!Number.isFinite(d)||b-d>=c}function N(a,b,c){return a?{...a,gap:b,lastAttemptAt:c,attempts:a.attempts+1}:{gap:b,since:c,lastAttemptAt:c,attempts:1,reported:!1}}let O="unread";function P(a,b){if(null===a)return!0;let c=Q(a),d=Q(b);return c&&d?c.board!==d.board||c.pullRequests!==O&&d.pullRequests!==O&&c.pullRequests!==d.pullRequests:a!==b}function Q(a){let b=a.indexOf(".");return b<=0||b===a.length-1?null:{board:a.slice(0,b),pullRequests:a.slice(b+1)}}function R(a){switch(a){case"registry-unreadable":return"the registry read failed";case"children-unindexed":return"the registry backend has no indexed lineage projection, so children cannot be paged";case"migration-pending":return"the SQLite accounting has not finished importing the legacy tick state";case"migration-blocked":return"the legacy tick state at state/seat-tick.json cannot be imported and blocks every wake until it is fixed or removed";case"discovery-incomplete":return"an owner's lineage page or the seat file's revocations could not be read to the end";case"ledger-gap":return"a child's event ledger was replaced, torn, malformed or skipped a sequence";case"ledger-pending":return"a child left its running state and its ledger has not been read yet";case"child-departed":return"a tracked child no longer projects under this seat and project";case"child-unplaced":return"a child has no conversation record or an unobserved turn with no host behind it"}}function S(a,b){let c="pull-requests"===b?a.state.pullRequestGap:a.state.childrenGap;if(!("pull-requests"===b?a.pullRequestsUnavailable:a.childrenUnavailable)||!c||c.reported||!L(c,a.now,a.settings.wakeIntervalMs))return null;let d=`${c.since.slice(0,16).replace("T"," ")} UTC (${c.gap}, ${c.attempts} attempt(s))`;return{card:{ref:s(b),kind:"source-unreadable",instance:c.since,detail:"pull-requests"===b?`The open pull requests of this project's finished lanes have not been readable since ${d}`:`The seat's spawned children have not been fully accountable since ${d}: `+R(c.gap)},gap:{...c,reported:!0}}}function T(a,b){return{...a,quietSince:a.quietSince??b}}function U(a,b,c){var d,e;let f=new Date(c).toISOString(),g=Math.max(a.eventsThrough??0,b.eventsThrough);if(b.proposal)return{...a,lastWakeAt:f,lastProposalAt:f,lastWakeReasons:[],lastWakeFingerprint:b.fingerprint,quietSince:null,eventsThrough:g,outstandingWake:null};let h=b.reasons,i=!P(a.lastWakeFingerprint,b.fingerprint),j={};for(let b of t)h.includes(b)&&(j[b]=i?(a.wakesWithoutChange[b]??0)+1:0);return{...a,lastWakeAt:f,lastWakeReasons:h,lastWakeFingerprint:b.fingerprint,wakesWithoutChange:j,quietSince:null,idleSince:null,eventsThrough:g,outstandingWake:null,harvestedChildren:(d=a.harvestedChildren,e=b.children,[...new Set([...d.filter(a=>!e.includes(a)),...e])])}}let V=()=>({offset:0,identity:null,seq:0,activeTurn:null,settledThrough:0,atEnd:!1,initialSize:0,gap:null}),W=Buffer.from('"turn-'),X=new Set(["completed","interrupted","error"]);function Y(a){let b;try{b=JSON.parse(a.toString("utf8"))}catch{return null}if(!b||"object"!=typeof b||Array.isArray(b))return null;let c=b;return"string"!=typeof c.kind||!Number.isSafeInteger(c.seq)||c.seq<=0?null:{kind:c.kind,seq:c.seq,turnId:c.turnId,status:c.status}}let Z="seat-tick-v3",$=new Map,_=a=>{let b=g().statSync(a);return`${b.dev}:${b.ino}`},aa=a=>e().createHash("sha256").update(JSON.stringify(a)).digest("hex"),ab=(a,b,c="")=>`${a}/${encodeURIComponent(b)}/${encodeURIComponent(c)}`;function ac(a){if(!a||"object"!=typeof a)return null;let b=a=>"string"==typeof a&&a.length>0,c=a=>Number.isSafeInteger(a)&&Number(a)>=0,d=a=>null===a||"string"==typeof a,e=a=>a&&b(a.conversationId)&&"string"==typeof a.title&&["running","terminal","unknown"].includes(a.status)&&(null===a.outcome||["finished","failed"].includes(a.outcome));if(1!==a.schemaVersion||!b(a.key)||"string"!=typeof a.project||"string"!=typeof a.kind||!a.key.startsWith(ab(a.kind,a.project)))return null;switch(a.kind){case"project":{let e=a.state;if(!c(a.revision)||!c(a.sequence)||!["ready","pending","unknown"].includes(a.migration)||!e||"object"!=typeof e||!d(a.gap)||null!==e.seatEpoch&&!c(e.seatEpoch))return null;for(let a of["lastCheckAt","lastWakeAt","quietSince","idleSince","lastProposalAt"]){let b=e[a];if(null!==b&&("string"!=typeof b||!Number.isFinite(Date.parse(b))))return null}if(null!==e.eventsThrough&&!c(e.eventsThrough)||!Array.isArray(e.harvestedChildren)||0!==e.harvestedChildren.length||!Array.isArray(e.lastWakeReasons)||!Array.isArray(e.stalledSeen)||!e.wakesWithoutChange||"object"!=typeof e.wakesWithoutChange)return null;let f=e.outstandingWake;if(null!==f&&(!f||!b(f.clientMessageId)||!b(f.conversationId)||!c(f.seatEpoch)||!d(f.operationId)||!f.commit||"boolean"!=typeof f.commit.proposal||!b(f.commit.fingerprint)||!c(f.commit.eventsThrough)||!Array.isArray(f.commit.reasons)||!Array.isArray(f.commit.children)||!f.commit.children.every(b)||void 0!==f.preparedAt&&!b(f.preparedAt))||f?.dispatch!==void 0&&(!f.dispatch||!b(f.dispatch.token)||!["active","refused","returned"].includes(f.dispatch.state))||void 0!==a.ownerScan&&(!a.ownerScan||!b(a.ownerScan.identity)||"boolean"!=typeof a.ownerScan.gap))return null;return a}case"owner":{if(!b(a.conversationId)||!c(a.epoch))return null;if("string"==typeof a.after&&void 0===a.pollKey)return{...a,after:null,pollKey:""};let d=a=>null===a||!!a&&"object"==typeof a&&Number.isSafeInteger(a.order)&&b(a.key);return"string"==typeof a.pollKey&&d(a.after)&&(void 0===a.bootstrap||a.bootstrap&&d(a.bootstrap.after))?a:null}case"child":return b(a.identity)&&b(a.rowKey)&&b(a.owner)&&b(a.launchId)&&e(a.input)&&c(a.generationIndex)&&d(a.runningKey)&&(void 0===a.pollKey||d(a.pollKey))?{...a,pollKey:a.pollKey??null}:null;case"source":return b(a.identity)&&b(a.child)&&b(a.engine)&&b(a.generation)&&a.cursor&&c(a.cursor.offset)&&c(a.cursor.seq)&&c(a.cursor.settledThrough)&&c(a.cursor.initialSize)&&d(a.cursor.identity)&&d(a.cursor.activeTurn)&&d(a.cursor.gap)&&"boolean"==typeof a.cursor.atEnd?a:null;case"outcome":return Array.isArray(a.tuple)&&[2,3].includes(a.tuple.length)&&a.tuple.every(b)&&a.identity===aa(a.tuple)&&a.key===ab("outcome",a.project,a.identity)&&e(a.input)&&a.input.outcomeId===a.identity&&"terminal"===a.input.status&&["owed","acknowledged"].includes(a.status)&&b(a.child)&&b(a.readyKey)?a:null;case"poll":case"ready":case"owner-poll":case"running":return b(a.target)?a:null;case"legacy":return b(a.conversationId)&&"boolean"==typeof a.reconciled?a:null;default:return null}}function ad(a,b){let c;try{c=g().openSync(a,g().constants.O_RDONLY|g().constants.O_NOFOLLOW);let d=g().fstatSync(c);if(!d.isFile())return{kind:"gap",gap:"not-a-file"};if(d.size>b)return{kind:"gap",gap:"oversized"};let e=Buffer.allocUnsafe(d.size),f=0;for(;f<d.size;){let a=g().readSync(c,e,f,d.size-f,f);if(!a)break;f+=a}try{return{kind:"parsed",value:JSON.parse(e.subarray(0,f).toString("utf8"))}}catch{return{kind:"gap",gap:"malformed"}}}catch(a){return"ENOENT"===a.code?{kind:"absent"}:{kind:"gap",gap:"unreadable"}}finally{void 0!==c&&g().closeSync(c)}}class ae{constructor(a,b){this.filename=a,this.project=b;const c=$.get(a);if(c){if(_(a)!==c.identity)throw Error("seat accounting database was replaced");this.collection=c.collection;return}(0,h.t0)(a,[{collection:Z,schemaVersion:1,migrationId:"monitor-v3",key:a=>a.key,loadRecords:()=>[]}]),this.collection=new h.UY(a,{collection:Z,schemaVersion:1,busyMessage:"seat outcome accounting is busy",key:a=>a.key,decode:ac,clone:structuredClone,strictDecode:!0}),$.set(a,{identity:_(a),collection:this.collection})}base(a,b=""){return{key:ab(a,this.project,b),project:this.project,schemaVersion:1}}get(a){return this.collection.get(a)}row(){let a=this.get(ab("project",this.project));if(a&&"project"!==a.kind)throw Error("invalid project accounting row");return a}page(a,b){let c=ab(a,this.project);return this.collection.keyRange(c,`${c}~`,b)}pollPage(a){let b=this.collection.keyRange(`${ab("poll",this.project)}0`,`${ab("poll",this.project)}~`,8),c=this.page("poll",a),d=new Set(b.map(a=>a.key));return[...b,...c.filter(a=>!d.has(a.key))].slice(0,a)}ticket(a,b,c,d,e="tail"){if(!Number.isSafeInteger(++b.sequence))throw Error("accounting sequence exhausted");let f={...this.base(c,`${"head"===e?"!":""}${String(b.sequence).padStart(16,"0")}`),kind:c,target:d};return a.put(f),f.key}atHead(a,b){return a.startsWith(ab(b,this.project,"!"))}trackRunning(a,b,c){"running"===c.input.status?c.runningKey||(c.runningKey=this.ticket(a,b,"running",c.key)):c.runningKey&&(a.delete(c.runningKey),c.runningKey=null)}mutate(a){return this.collection.boundedPatch(4096,b=>{let c=b.get(ab("project",this.project));if(!c||"project"!==c.kind)throw Error("accounting migration has not completed");let d=a(b,c);return c.revision++,b.put(c),d})}initialize(a,b){this.collection.boundedPatch(4096,c=>{if(!c.get(ab("project",this.project))){for(let b of a.harvestedChildren)c.put({...this.base("legacy",b),kind:"legacy",conversationId:b,reconciled:!1});c.put({...this.base("project"),kind:"project",revision:0,sequence:0,state:{...a,harvestedChildren:[]},migration:b?"unknown":"ready",gap:b})}})}migrateLegacy(a,b){if(this.row()?.migration==="ready")return;this.row()||this.collection.boundedPatch(2,a=>{a.get(ab("project",this.project))||a.put({...this.base("project"),kind:"project",revision:0,sequence:0,state:v(),migration:"pending",gap:null})});let c=this.row(),d=ad(a,4194304),e=null,f=v(),g=[];if("gap"===d.kind)e="malformed"===d.gap?"legacy-json-malformed":"oversized"===d.gap?"legacy-state-oversized":"legacy-state-unreadable";else if("parsed"===d.kind){let a=d.value,c=a&&"object"==typeof a&&!Array.isArray(a)?a.projects:void 0;if(!c||"object"!=typeof c||Array.isArray(c))e="legacy-projects-unreadable";else{let d="number"==typeof a.version?a.version:null,h=c[this.project];if(void 0!==h){let a=h&&"object"==typeof h&&!Array.isArray(h)?h:{};f=b(a,d);let c=a.harvestedChildren;if(void 0!==c)if(Array.isArray(c))for(let a of c){if("string"!=typeof a||!a||a.length>200){e="legacy-acknowledgments-unreadable";break}g.push(a)}else e="legacy-acknowledgments-unreadable";Object.hasOwn(a,"outstandingWake")&&null!==a.outstandingWake&&!f.outstandingWake&&(e="legacy-outstanding-unreadable")}}}let h=e?[]:[...new Set(g)];for(let a=0;a<h.length;a+=1e3){let b=h.slice(a,a+1e3);this.collection.boundedPatch(1002,a=>{let d=a.get(c.key);if(d&&"project"===d.kind&&d.revision===c.revision)for(let c of b)a.put({...this.base("legacy",c),kind:"legacy",conversationId:c,reconciled:!1})})}this.collection.boundedPatch(2,a=>{let b=a.get(c.key);if(!b||"project"!==b.kind||b.revision!==c.revision)return;let d=e?"unknown":"ready";b.migration===d&&b.gap===e&&e||a.put({...b,revision:b.revision+1,state:e?b.state:{...f,harvestedChildren:[]},migration:d,gap:e})})}readState(){let a=this.row();if(!a)throw Error("missing project accounting");return{...a.state,accounting:{filename:this.filename,revision:a.revision,gap:"ready"===a.migration?a.gap:a.gap??"legacy-migration-pending"}}}writeState(a){this.mutate((b,c)=>{if(a.accounting?.revision!==c.revision)throw Error("stale seat tick state");c.state={...a,accounting:void 0,harvestedChildren:[]}})}owner(a,b){let c=ab("owner",this.project,String(b)),d=this.get(c);if(d?.kind==="owner"&&d.conversationId===a&&d.pollKey)return d;this.mutate((d,e)=>{let f=d.get(c);if(f){if("owner"!==f.kind||f.conversationId!==a)throw Error("contradictory seat ownership");f.pollKey||d.put({...f,pollKey:this.ticket(d,e,"owner-poll",c)});return}let g={...this.base("owner",String(b)),kind:"owner",conversationId:a,epoch:b,after:null,pollKey:""};g.pollKey=this.ticket(d,e,"owner-poll",c),d.put(g)});let e=this.get(c);if(!e||"owner"!==e.kind)throw Error("missing owner provenance");return e}discoverRevokedOwners(a,b){let c,d=this.row();try{let b=g().statSync(a);c=`${b.dev}:${b.ino}:${b.size}:${b.mtimeMs}`}catch(a){return"ENOENT"!==a.code}if(d.ownerScan?.identity===c)return d.ownerScan.gap;let e=ad(a,0x1000000);if("absent"===e.kind)return!1;let f="gap"===e.kind,h=[];if("parsed"===e.kind){let a=e.value,c=a&&"object"==typeof a&&!Array.isArray(a)&&1===a.schemaVersion&&Array.isArray(a.revocations)?a.revocations:null;if(c)for(let a of c){let c=a??{};"string"==typeof c.project&&b(c.project)&&"string"==typeof c.conversationId&&c.conversationId.startsWith("conversation_")&&Number.isSafeInteger(c.seatEpoch)&&Number(c.seatEpoch)>=1&&"string"==typeof c.revokedAt&&Number.isFinite(Date.parse(c.revokedAt))&&h.push({conversationId:c.conversationId,epoch:Number(c.seatEpoch)})}else f=!0}let i=h.slice(0,200),j=h.length>i.length,k=!1;return this.mutate((a,b)=>{if(b.revision!==d.revision){k=!0;return}for(let c of i){let d=ab("owner",this.project,String(c.epoch)),e=a.get(d);if(e){if("owner"!==e.kind||e.conversationId!==c.conversationId)throw Error("contradictory predecessor ownership");continue}let f={...this.base("owner",String(c.epoch)),kind:"owner",conversationId:c.conversationId,epoch:c.epoch,after:null,pollKey:""};f.pollKey=this.ticket(a,b,"owner-poll",d),a.put(f)}j||(b.ownerScan={identity:c,gap:f})}),f||j||k}discovery(a,b){this.mutate((c,d)=>{if(c.get(a.pollKey)){for(let{child:a,position:e}of b){let b=c.get(a.key);if(b){if("child"!==b.kind)throw Error("invalid child provenance");b.pollKey||c.put({...b,pollKey:this.ticket(c,d,"poll",a.key,e)});continue}a.pollKey=this.ticket(c,d,"poll",a.key,e),this.trackRunning(c,d,a),c.put(a)}c.delete(a.pollKey),c.put({...a,pollKey:this.ticket(c,d,"owner-poll",a.key)})}})}adoptPoll(a,b){return a.pollKey?a:(this.mutate(c=>{let d=c.get(a.key),e=c.get(b);d?.kind!=="child"||d.pollKey||e?.kind!=="poll"||e.target!==a.key||c.put({...d,pollKey:b})}),this.get(a.key))}child(a,b,c,d){let e=aa([b,a,c]);return{...this.base("child",e),kind:"child",identity:e,rowKey:a,owner:b,launchId:c,input:d,generationIndex:0,runningKey:null,pollKey:null}}source(a,b,c){let d=aa([b,c]),e=this.get(ab("source",this.project,d));if(e){if("source"!==e.kind||e.child!==a.key||e.engine!==b||e.generation!==c)throw Error("source identity collision");return e}return{...this.base("source",d),kind:"source",identity:d,child:a.key,engine:b,generation:c,cursor:V()}}ingest(a,b,c,d=!1,e="tail"){this.mutate((f,g)=>{a.pollKey&&f.get(a.pollKey)&&(b?.cursor.identity&&b.legacyBoundary?.identity!==b.cursor.identity&&(b.legacyBoundary={identity:b.cursor.identity,bytes:b.cursor.initialSize}),(d?[[a.launchId,"pre-execution-failure"]]:c.map(a=>[b.engine,b.generation,a.turnId])).forEach((e,h)=>{let i=aa(e),j=ab("outcome",this.project,i),k=d||"completed"!==c[h].status?"failed":"finished",l=f.get(j);if(l){if("outcome"!==l.kind||JSON.stringify(l.tuple)!==JSON.stringify(e))throw Error("outcome identity collision");l.input.outcome!==k&&f.put({...l,gap:"conflicting-terminal"});return}let m=f.get(ab("legacy",this.project,a.input.conversationId)),n={...a.input,status:"terminal",outcome:k,outcomeId:i},o=ab("ready",this.project,String(g.sequence+1).padStart(16,"0"));this.ticket(f,g,"ready",j),f.put({...this.base("outcome",i),kind:"outcome",identity:i,child:a.key,tuple:e,input:n,status:"owed",landingKey:null,readyKey:o,gap:m&&(d||!b?.legacyBoundary||c[h].endOffset<=b.legacyBoundary.bytes)?"legacy-delivery-ambiguous":null})}),b&&f.put(b),this.trackRunning(f,g,a),f.delete(a.pollKey),a.pollKey=this.ticket(f,g,"poll",a.key,e),f.put(a))})}promote(a){!a.pollKey||this.atHead(a.pollKey,"poll")||this.mutate((b,c)=>{b.get(a.pollKey)&&(b.delete(a.pollKey),a.pollKey=this.ticket(b,c,"poll",a.key,"head"),b.put(a))})}rotateCold(a){a.length&&this.mutate((b,c)=>{for(let d of a){let a=b.get(d.key);a?.kind==="child"&&d.pollKey&&a.pollKey===d.pollKey&&b.get(d.pollKey)&&(b.delete(d.pollKey),b.put({...a,pollKey:this.ticket(b,c,"poll",d.key)}))}})}drop(a){this.mutate(b=>{b.get(a.key)&&b.delete(a.key)})}rotateRunning(a){0!==a.length&&this.mutate((b,c)=>{for(let d of a){if("running"!==d.kind||!b.get(d.key))continue;b.delete(d.key);let a=b.get(d.target);a&&"child"===a.kind&&a.runningKey===d.key&&(a.runningKey="running"===a.input.status?this.ticket(b,c,"running",a.key):null,b.put(a))}})}ready(a){return this.page("ready",a).flatMap(a=>{if("ready"!==a.kind)throw Error("invalid ready ticket");let b=this.get(a.target);if(!b||"outcome"!==b.kind)throw Error("missing outcome");return"owed"===b.status&&b.gap&&this.defer(b),"owed"!==b.status||b.gap?[]:[b]})}defer(a){this.mutate((b,c)=>{let d=b.get(a.key);d&&"outcome"===d.kind&&"owed"===d.status&&d.readyKey===a.readyKey&&(b.delete(d.readyKey),d.readyKey=ab("ready",this.project,String(c.sequence+1).padStart(16,"0")),this.ticket(b,c,"ready",d.key),b.put(d))})}prepare(a,b){return this.collection.boundedPatch(4096,c=>{let d=c.get(ab("project",this.project));if(!d||"project"!==d.kind)throw Error("accounting migration has not completed");if(d.revision!==a.accounting?.revision||d.state.outstandingWake||"ready"!==d.migration)return!1;for(let a of b.commit.children){let b=c.get(ab("outcome",this.project,a));if(!b||"outcome"!==b.kind||"owed"!==b.status||b.gap)return!1}return d.state={...a,accounting:void 0,harvestedChildren:[],outstandingWake:b},d.revision++,c.put(d),!0})}beginDispatch(a){return this.mutate((b,c)=>{let d=c.state.outstandingWake;if(!d||d.clientMessageId!==a.clientMessageId||d.dispatch&&"refused"!==d.dispatch.state||d.dispatch?.token!==a.dispatch?.token)return null;let f=e().randomUUID();return c.state.outstandingWake={...d,dispatch:{token:f,state:"active"}},f})}returnedDispatch(a,b,c){this.mutate((d,e)=>{let f=e.state.outstandingWake;f?.clientMessageId===a&&f.dispatch?.token===b&&"active"===f.dispatch.state&&(e.state.outstandingWake={...f,dispatch:{token:b,state:c?"refused":"returned"}})})}cancelUndispatched(a){return this.mutate((b,c)=>{let d=c.state.outstandingWake;return!!d&&d.clientMessageId===a.clientMessageId&&!d.dispatch&&(c.state.outstandingWake=null,!0)})}settleAbsent(a){return this.mutate((b,c)=>{let d=c.state.outstandingWake;return!!d&&d.clientMessageId===a.clientMessageId&&!d.operationId&&!!d.text&&d.dispatch?.state==="refused"&&d.dispatch.token===a.dispatch?.token&&(c.state.outstandingWake=null,!0)})}settle(a,b,c){return this.mutate((d,e)=>{let f=e.state.outstandingWake;if(!f||f.clientMessageId!==a||"unsent"===c&&f.dispatch?.state==="active")return!1;if("landed"===c)for(let b of f.commit.children){let c=d.get(ab("outcome",this.project,b));if(!c){if(!b.startsWith("conversation_"))throw Error("missing frozen outcome");d.put({...this.base("legacy",b),kind:"legacy",conversationId:b,reconciled:!0});continue}if("outcome"!==c.kind)throw Error("invalid frozen outcome");d.put({...c,status:"acknowledged",landingKey:a}),d.delete(c.readyKey)}let g="landed"===c?U(e.state,f.commit,Date.parse(b.lastWakeAt)):e.state;return e.state={...g,accounting:void 0,harvestedChildren:[],outstandingWake:null},!0})}}var af=c(27146),ag=c(25052),ah=c(29307),ai=c(89319),aj=c(10988),ak=c(31421);let al=(0,c(57975).promisify)(ak.execFile);function am(a,b){return async c=>{let{stdout:d}=await al("gh",c,{cwd:a,timeout:b,maxBuffer:4194304});return d}}async function an(a){let b,c=a.run??am(a.cwd,a.timeoutMs??2e4);try{b=await c(["pr","list","--state","open","--limit",String(a.limit??60),"--json","number,title,headRefName,updatedAt"])}catch(a){return{ok:!1,unavailable:a?.killed===!0||a?.code==="ETIMEDOUT"||a?.name==="TimeoutError"?"timed-out":"command-failed"}}let d=function(a){let b;try{b=JSON.parse(a)}catch{return null}if(!Array.isArray(b))return null;let c=[];for(let a of b){if(!a||"object"!=typeof a||Array.isArray(a)||"number"!=typeof a.number||!Number.isSafeInteger(a.number)||"string"!=typeof a.headRefName||!a.headRefName)return null;c.push({number:a.number,title:"string"==typeof a.title?a.title.slice(0,200):"",headRefName:a.headRefName,updatedAt:"string"==typeof a.updatedAt?a.updatedAt:null})}return c}(b);return d?{ok:!0,pullRequests:d}:{ok:!1,unavailable:"malformed-output"}}async function ao(a){let b=a.run??am(a.cwd,a.timeoutMs??2e4);try{let d;var c=await b(["issue","list","--state","open","--limit",String(a.limit??40),"--json","number,title,labels,updatedAt"]);try{d=JSON.parse(c)}catch{return[]}if(!Array.isArray(d))return[];let e=[];for(let a of d)!(!a||"object"!=typeof a||Array.isArray(a))&&"number"==typeof a.number&&Number.isSafeInteger(a.number)&&e.push({number:a.number,title:"string"==typeof a.title?a.title.slice(0,200):"",labels:(Array.isArray(a.labels)?a.labels:[]).flatMap(a=>{let b=a?.name;return"string"==typeof b?[b.slice(0,60)]:[]}),updatedAt:"string"==typeof a.updatedAt?a.updatedAt:null});return e}catch{return[]}}var ap=c(76760),aq=c.n(ap),ar=c(89204);function as(a,b=process.env.LLV_SEAT_TICK_AUDIT_FILE?.trim()||(0,af.BQ)(aq().join("seat-tick","runs.ndjson"))){var c;c={filePath:b,retention:500,busyMessage:"the seat tick journal is busy"},g().mkdirSync(aq().dirname(c.filePath),{recursive:!0,mode:448}),(0,ar.Ol)(c.filePath,c.busyMessage,()=>{g().appendFileSync(c.filePath,`${JSON.stringify(a)}
|
|
2
|
-
`,{encoding:"utf8",mode:384}),function(a,b){let c;try{c=g().readFileSync(a,"utf8").split("\n").filter(a=>a.trim())}catch{return}if(c.length<=b)return;let d=`${a}.${process.pid}.${e().randomUUID()}.tmp`;g().writeFileSync(d,`${c.slice(-b).join("\n")}
|
|
3
|
-
`,{encoding:"utf8",mode:384}),g().renameSync(d,a)}(c.filePath,c.retention)})}function at(a,b){let c=`
|
|
4
|
-
${(0,m.l)(b.join("\n")).trimEnd()}`,d=Math.max(4e3-c.length,1e3),e=(0,m.l)(a.join("\n")).trimStart();return e.length<=d?`${e}${c}`:`${e.slice(0,d-1).trimEnd()}…${c}`}c(40898);let au=["Act on the listed items only, and nothing else this turn.","Record every outcome where it belongs — on the board card or on the pipeline — not only in this conversation.","If an item cannot be done, mark its task blocked with the reason. That is the stop, and it is the only one.","Do not schedule yourself. The Viewer ticks this seat; a self-scheduled monitor is refused practice.","This tick is yours to govern: seat_tick_settings turns it off, changes how often it wakes you, or turns it back on, per project, with a reason that shows on the board.","Do not wait on the operator inside this turn."];function av(a){return`- [${a.kind}] ${a.id} — ${a.label}`}function aw(a){var b;return a?["","Standing monitor note for this project, in the seat's own words (seat_tick_settings sets, replaces and clears it). It shapes what you look at; the contract below still governs what you do:",(b=a).length<=1e3?b:`${b.slice(0,1e3).trimEnd()}… [preview, ${b.length} chars; seat_tick_settings returns the full note]`]:[]}var ax=c(44405);function ay(){return process.env.LLV_SEAT_TICK_SETTINGS_FILE?.trim()||(0,af.BQ)("seat-tick-settings.json")}function az(a){return{project:a,enabled:!0,wakeIntervalMinutes:null,reason:null,monitorPrompt:null,until:null,updatedAt:null,setBy:null}}function aA(a){return a.enabled&&null===a.wakeIntervalMinutes}function aB(a){return"string"==typeof a&&Number.isFinite(Date.parse(a))?a:null}function aC(a){try{let b=JSON.parse(g().readFileSync(a,"utf8"));if(!b||"object"!=typeof b||Array.isArray(b))return{version:1,projects:{}};let c=b.projects??{};return{version:1,projects:Object.fromEntries(Object.entries(c).map(([a,b])=>{var c,d,e;let f;return[a,(c=a,d=b,f=az(c),!d||"object"!=typeof d||Array.isArray(d)?f:{project:c,enabled:!1!==d.enabled,wakeIntervalMinutes:"number"!=typeof(e=d.wakeIntervalMinutes)||!Number.isFinite(e)||e<=0?null:Math.min(525600,e),reason:"string"==typeof d.reason&&d.reason.trim()?d.reason.slice(0,500):null,monitorPrompt:"string"==typeof d.monitorPrompt&&d.monitorPrompt.trim()?d.monitorPrompt.slice(0,16e3):null,until:aB(d.until),updatedAt:aB(d.updatedAt),setBy:function(a){if(!a||"object"!=typeof a||Array.isArray(a))return null;let b=a.kind;return"manager"!==b&&"agent"!==b&&"gateway"!==b&&"unidentified"!==b?null:{kind:b,conversationId:"string"==typeof a.conversationId&&a.conversationId?a.conversationId.slice(0,200):null,project:"string"==typeof a.project&&a.project?a.project.slice(0,200):null,seatEpoch:"number"==typeof a.seatEpoch&&Number.isSafeInteger(a.seatEpoch)?a.seatEpoch:null}}(d.setBy)})]}))}}catch{return{version:1,projects:{}}}}function aD(a,b,c){let d=a.until?Date.parse(a.until):NaN,e=Number.isFinite(d)&&d<=b&&!aA(a),f=null!==a.updatedAt;return e||aA(a)?{enabled:!0,wakeIntervalMs:c,reason:null,monitorPrompt:a.monitorPrompt,until:null,updatedAt:a.updatedAt,isDefault:!0,configured:f,lapsed:e,setBy:e?a.setBy:null}:{enabled:a.enabled,wakeIntervalMs:null===a.wakeIntervalMinutes?c:Math.round(6e4*a.wakeIntervalMinutes),reason:a.reason,monitorPrompt:a.monitorPrompt,until:a.until,updatedAt:a.updatedAt,isDefault:!1,configured:f,lapsed:!1,setBy:a.setBy}}function aE(){return process.env.LLV_SEAT_TICK_STATE_FILE?.trim()||(0,af.BQ)("seat-tick.json")}function aF(a){return"string"==typeof a&&Number.isFinite(Date.parse(a))?a:null}function aG(a){return(Array.isArray(a)?a:[]).filter(a=>"string"==typeof a&&a.length>0&&a.length<=200)}let aH=["timed-out","command-failed","malformed-output","lanes-unreadable"];function aI(a,b){return a.seatEpoch===b?a:{...v(),seatEpoch:b,eventsThrough:a.eventsThrough,lastWakeAt:a.lastWakeAt,lastProposalAt:a.lastProposalAt,outstandingWake:a.outstandingWake,pullRequestGap:a.pullRequestGap,childrenGap:a.childrenGap,harvestedChildren:a.harvestedChildren,accounting:a.accounting}}function aJ(a,b){let c=new ae(b===aE()?aq().join(aq().dirname(b),"state.sqlite"):`${b}.sqlite`,a);return c.migrateLegacy(b,(a,b)=>(function(a,b){let c,d=v();if(!a||"object"!=typeof a||Array.isArray(a))return d;let e={},f=a.wakesWithoutChange??{};for(let a of t){let b=f[a];"number"==typeof b&&Number.isInteger(b)&&b>=0&&(e[a]=b)}return{seatEpoch:"number"==typeof a.seatEpoch&&Number.isSafeInteger(a.seatEpoch)?a.seatEpoch:null,lastCheckAt:aF(a.lastCheckAt),lastWakeAt:aF(a.lastWakeAt),lastWakeReasons:(Array.isArray(a.lastWakeReasons)?a.lastWakeReasons:[]).filter(a=>t.includes(a)),wakesWithoutChange:e,quietSince:aF(a.quietSince),idleSince:aF(a.idleSince),lastProposalAt:aF(a.lastProposalAt),stalledSeen:(Array.isArray(a.stalledSeen)?a.stalledSeen:[]).filter(a=>"string"==typeof a&&a.length>0&&a.length<=100).slice(0,200),lastWakeFingerprint:"string"==typeof a.lastWakeFingerprint?a.lastWakeFingerprint.slice(0,200):null,eventsThrough:"number"!=typeof(c=a.eventsThrough)||!Number.isInteger(c)||c<0||b&&0===c&&!aF(a.lastWakeAt)?null:c,outstandingWake:function(a){var b;if(!a||"object"!=typeof a||Array.isArray(a))return null;let c="string"==typeof a.clientMessageId?a.clientMessageId:"",d="string"==typeof a.conversationId?a.conversationId:"",e=a.seatEpoch,f=!(b=a.commit)||"object"!=typeof b||Array.isArray(b)?null:"string"==typeof b.fingerprint&&b.fingerprint&&"number"==typeof b.eventsThrough&&Number.isInteger(b.eventsThrough)&&!(b.eventsThrough<0)?{proposal:!0===b.proposal,reasons:(Array.isArray(b.reasons)?b.reasons:[]).filter(a=>t.includes(a)),fingerprint:b.fingerprint.slice(0,200),eventsThrough:b.eventsThrough,children:aG(b.children)}:null;return c&&d&&f&&"number"==typeof e&&Number.isSafeInteger(e)?{clientMessageId:c,conversationId:d,seatEpoch:e,operationId:"string"==typeof a.operationId&&a.operationId?a.operationId:null,commit:f,..."string"==typeof a.text?{text:a.text}:{},...aF(a.preparedAt)?{preparedAt:a.preparedAt}:{}}:null}(a.outstandingWake),pullRequestGap:function(a){if(!a||"object"!=typeof a||Array.isArray(a))return null;let b=aH.find(b=>b===a.gap),c=aF(a.since),d=aF(a.lastAttemptAt),e=a.attempts;return b&&c&&d&&"number"==typeof e&&Number.isInteger(e)&&!(e<1)?{gap:b,since:c,lastAttemptAt:d,attempts:e,reported:!0===a.reported}:null}(a.pullRequestGap),childrenGap:null,harvestedChildren:aG(a.harvestedChildren)}})(a,2!==b)),c}function aK(a,b=aE()){return aJ(a,b).readState()}function aL(a,b,c=aE()){let d=aJ(a,c);d.writeState(b.accounting?b:{...b,accounting:d.readState().accounting})}var aM=c(70160),aN=c(88623);class aO extends Error{constructor(a,b){super(`the lifecycle journal at ${a} is unreadable (${b}); move it aside to start a new one`),this.name="LifecycleJournalCorruptError",this.journalPath=a}}function aP(){let a,b,c=(0,af.BQ)("lifecycle-journal.json");try{a=g().readFileSync(c,"utf8")}catch(a){if("ENOENT"===a.code)return{version:1,lastSeq:0,events:[],retired:[]};throw new aO(c,`it could not be read: ${a.message}`)}try{b=JSON.parse(a)}catch{throw new aO(c,"it is not valid JSON — the last write was truncated")}return function(a,b){if(!a||"object"!=typeof a||Array.isArray(a))throw new aO(b,"its contents are not a journal object");if(void 0!==a.events&&!Array.isArray(a.events))throw new aO(b,"its events field is not an array");let c=a.events??[],d=[];for(let[a,e]of c.entries()){let f=function(a){var b,c;if(!a||"object"!=typeof a||Array.isArray(a)||"string"!=typeof a.id||!a.id||!Number.isInteger(a.seq)||a.seq<1||"string"!=typeof a.at||!a.at||!("string"==typeof(b=a.type)&&j.includes(b)))return null;let d="string"==typeof(c=a.state)&&i.includes(c)?a.state:k[a.type],e=a=>"string"==typeof a?a:null;return{id:a.id,seq:a.seq,at:a.at,type:a.type,state:d,project:e(a.project),pipelineId:e(a.pipelineId),stageId:e(a.stageId),attempt:Number.isInteger(a.attempt)?a.attempt:null,conversationId:e(a.conversationId),role:e(a.role),summary:"string"==typeof a.summary?a.summary:""}}(e);if(!f)throw new aO(b,`recorded event ${a+1} of ${c.length} is malformed`);d.push(f)}d.sort((a,b)=>a.seq-b.seq);let e=Array.isArray(a.retired)?a.retired.filter(a=>"string"==typeof a):[],f=d.at(-1)?.seq??0;return{version:1,lastSeq:Number.isInteger(a.lastSeq)?Math.max(a.lastSeq,f):f,events:d,retired:e}}(b,c)}var aQ=c(65972),aR=c(12136),aS=c(57624),aT=c(30816),aU=c(17665),aV=c(58444);function aW(a){return a instanceof Error&&"AbortError"===a.name?a:new DOMException("catalog selection cancelled","AbortError")}function aX(a,b){let c=Math.max(0,Math.floor(b.limit)),d=b.query?b.query.toLocaleLowerCase():"",e=[],f=new Set,g=0,h=0;for(let i of a){if("claude"===i.engine||"codex"===i.engine)h+=1,b.hostedPaths?.has(i.path)&&f.add(i.path),(!b.project||i.project===b.project)&&(!b.liveOnly||"live"===i.activity||"stalled"===i.activity||b.hostedPaths?.has(i.path))&&(!d||`${i.title}
|
|
5
|
-
${i.project}
|
|
6
|
-
${i.path}`.toLocaleLowerCase().includes(d))&&(g+=1,e.length<c&&e.push(i))}return{entries:e,matched:g,scanned:h,hostedSeen:f}}async function aY(a,b={completedFileScan:aV.Nm}){let c=performance.now();if(b.signal?.aborted)throw aW(b.signal.reason);let d=await b.completedFileScan({signal:b.signal??null});if(b.signal?.aborted)throw aW(b.signal.reason);return{...aX(d.snapshot.files,a),generation:d.generation,cacheStatus:d.cacheStatus,freshScan:!1,selectionMs:performance.now()-c}}async function aZ(a,b,c,d){let e=d.now??Date.now,f=d.signal??null,g=new Map,h=0,i=0,j="complete";if(f?.aborted)throw aW(f.reason);let k=async()=>{for(;;){if(f?.aborted)throw aW(f.reason);if("complete"!==j||h>=a.length)return;if(null!==d.deadlineAt&&e()>=d.deadlineAt){j="deadline";return}let k=h,l=a[k],m=Math.max(0,b(l));if(i+m>d.maxBytes){j="byte_budget";return}h=k+1,i+=m,g.set(k,await c(l,f))}},l=(await Promise.allSettled(Array.from({length:Number.isFinite(d.concurrency)?Math.max(1,Math.min(Math.floor(d.concurrency),a.length||1)):1},()=>k()))).find(a=>"rejected"===a.status);if(l?.status==="rejected")throw l.reason;return{results:g,hydrated:g.size,skipped:a.length-g.size,bytes:i,stopped:j}}var a$=c(66812),a_=c(842),a0=c(14310),a1=c(43872);async function a2(a,b){let c=await (0,a_.mR)(b);if("complete"!==c.integrity)return null;let d=(0,a$.j)(c.records,a);return{turn:"terminal"===d.state?"idle":"busy"===d.state?"busy":"unknown",lastRecordTs:function(a){let b=null;for(let c of a){let a=c.timestamp;if("string"!=typeof a)continue;let d=Date.parse(a);Number.isFinite(d)&&(null===b||d>b)&&(b=d)}return b}(c.records)}}async function a3(a){let b,c=function(a){let b=null;for(let[c,d]of(0,a1.s9)())(a===d||a.startsWith(d.endsWith(aq().sep)?d:d+aq().sep))&&(!b||d.length>b[1].length)&&(b=[c,d]);return b}(a);if(!c)return null;try{b=await g().promises.stat(a)}catch{return null}if(!b.isFile())return null;let d=(0,a0.q0)(c[0],c[1],a,b);return{path:a,project:d.project,title:d.title,engine:d.engine,mtimeMs:b.mtimeMs,sizeBytes:b.size,conversationId:null,activity:null,activityReason:null}}function a4(a){return{path:a.path,project:a.project,title:a.title,engine:a.engine,mtimeMs:Number.isFinite(a.mtime)?1e3*a.mtime:NaN,sizeBytes:Number.isFinite(a.size)?a.size:void 0,conversationId:a.conversationId??null,activity:a.activity??null,activityReason:a.activityReason??null}}async function a5(a,b,c,d){let e=[];for(let c of a)b.has(c)||e.push(c);if(0===e.length)return{entries:[],truncated:!1};let f=e.length>64,g=f?e.slice(-64):e;return{entries:(await Promise.all(g.map(async a=>{try{return await d(a)}catch{return null}}))).filter(a=>null!==a&&("claude"===a.engine||"codex"===a.engine)&&(!c||a.project===c)),truncated:f}}function a6(a,b){let c=a=>Number.isFinite(a.mtimeMs)?a.mtimeMs:-1/0;return c(b)-c(a)}function a7(a){return a instanceof Error&&"AbortError"===a.name?a:new DOMException("liveness snapshot cancelled","AbortError")}function a8(a){return Math.round(100*Math.max(0,a))/100}async function a9(a,b){let c,d,e=performance.now(),f=b.now(),g=a.signal??null;if(g?.aborted)throw a7(g.reason);let h=Number.isFinite(a.stallAfterMs)&&a.stallAfterMs>0?Math.floor(a.stallAfterMs):6e5,i=Math.max(1,Math.min(200,Number.isInteger(a.limit)?a.limit:100)),j=performance.now(),k=b.registrySnapshot(),l=function(a){let b=new Map,c=new Map;for(let d of a)for(let a of d.runs)for(let e of a.attempts){if(e.historical)continue;let f={pipelineId:d.id,stageId:a.stageId,attempt:e.n,reportedState:e.state,reportedPipelineState:d.state,paneId:e.paneId};e.conversationId&&b.set(e.conversationId,f),e.agentPath&&c.set(e.agentPath,f)}return{byConversation:b,byPath:c}}(b.pipelines()),m=function(a){let b=new Set;for(let c of Object.values(a.entries))("starting"===c.status||"live"===c.status||"idle"===c.status||"handoff"===c.status)&&c.artifactPath&&b.add(c.artifactPath);return b}(k),n=performance.now()-j,o=new Set,p=!!(a.transcriptPath||a.conversationId);if(a.transcriptPath&&o.add(a.transcriptPath),a.conversationId){let b=k.conversations[a.conversationId],c=b?.generations.at(-1)?.path;c&&o.add(c)}let q=performance.now();if(p)c=o.size>0?(await Promise.all([...o].slice(0,i).map(a=>b.describeTranscript(a)))).filter(a=>null!==a):[],d={scope:"targeted",scanned:o.size,matched:c.length,selected:c.length,recovered:0,recoveryTruncated:!1,generation:null,cacheStatus:null,freshScan:!1};else{let e,f={project:a.project,liveOnly:a.liveOnly,limit:i,hostedPaths:m};if(b.selectInventory){let h=await b.selectInventory(f,{signal:g});c=h.entries.map(a4),e=h.hostedSeen??new Set(h.entries.map(a=>a.path)),d={scope:a.project?"project":"corpus",scanned:h.scanned,matched:h.matched,selected:h.entries.length,recovered:0,recoveryTruncated:!1,generation:h.generation,cacheStatus:h.cacheStatus,freshScan:h.freshScan}}else if(b.listFiles){let g=aX(await b.listFiles(),f);c=g.entries.map(a4),e=g.hostedSeen,d={scope:a.project?"project":"corpus",scanned:g.scanned,matched:g.matched,selected:g.entries.length,recovered:0,recoveryTruncated:!1,generation:null,cacheStatus:null,freshScan:!0}}else throw Error("liveness needs an inventory source: install selectInventory");let h=await a5(m,e,a.project,b.describeTranscript),j=new Set(c.map(a=>a.path)),k=h.entries.filter(a=>!j.has(a.path));(k.length>0||h.truncated)&&(k.length>0&&(c=[...c,...k].sort(a6).slice(0,i)),d={...d,matched:d.matched+k.length,selected:c.length,recovered:k.length,recoveryTruncated:h.truncated})}let r=performance.now()-q;if(g?.aborted)throw a7(g.reason);let s=c.filter(a=>"claude"===a.engine||"codex"===a.engine),t=performance.now(),u=Number.isFinite(a.evidenceDeadlineMs)&&a.evidenceDeadlineMs>0?Math.floor(a.evidenceDeadlineMs):2e3,v=await aZ(s,a=>Math.min(Number.isFinite(a.sizeBytes)?a.sizeBytes:131072,131072),async(a,c)=>{try{return await b.transcriptEvidence(a.engine,a.path,{signal:c})}catch(a){if(c?.aborted||(0,aR.zf)(a))throw a;return null}},{concurrency:Number.isFinite(a.evidenceConcurrency)?Math.max(1,Math.floor(a.evidenceConcurrency)):4,maxBytes:Number.isFinite(a.evidenceByteBudget)?Math.max(0,Math.floor(a.evidenceByteBudget)):131072*Math.max(1,i),deadlineAt:b.now()+u,signal:g,now:b.now}),w=performance.now()-t;if(g?.aborted)throw a7(g.reason);let x=performance.now(),y=0,z={claude:new Map,codex:new Map},A=s.map((a,c)=>{var d,e;let g,i=v.results.has(c),j=v.results.get(c)??null;i&&null===j&&(y+=1);let m=j?j.turn:"jsonl_turn_open"===a.activityReason?"busy":"jsonl_turn_completed"===a.activityReason?"idle":"unknown",n=j?.lastRecordTs??(Number.isFinite(a.mtimeMs)?a.mtimeMs:null),o=null!==n?Math.max(0,f-n):null,p=function(a,b){for(let c of Object.values(a.entries))if(c.artifactPath===b)return c;return null}(k,a.path),q=function(a,b){if(!a)return{state:"unknown",kind:"none",pid:null};let c="starting"===a.status||"live"===a.status||"idle"===a.status||"handoff"===a.status,d=a.structuredHost?.process??null,e=a.host?{state:(0,aQ.eW)(a.host.agent,b)||(0,aQ.eW)(a.host.panePid,b)?"alive":"gone",kind:"tmux",pid:a.host.agent.pid}:null,f=d?{state:(0,aQ.eW)(d,b)?"alive":"gone",kind:"structured",pid:d.pid}:null;if(!c){let a=e??f;return a?{...a,state:"gone"}:{state:"gone",kind:"none",pid:null}}if(e?.state==="alive")return e;if(f?.state==="alive")return f;if(e)return e;if(f)return f;let g=Date.parse(a.updatedAt);return{state:Number.isFinite(g)&&b.now()-g<3e5?"unknown":"gone",kind:"none",pid:null}}(p,b.probe),r="busy"===m&&"alive"===q.state&&p?.accountId?(d=a.engine,e=p.accountId,(g=z[d]).has(e)||g.set(e,(0,aT.p5)(b.limitsProvenance?.(d,e),f,aT.Lm)),g.get(e)??null):null,s=a.conversationId??function(a,b){for(let c of Object.values(a.conversations))if(c.generations.some(a=>a.path===b)||c.continuityPaths?.includes(b))return c.id;return null}(k,a.path);return{entry:a,conversationId:s,turnState:m,lastRecordMs:n,silentForMs:o,host:q,...function(a){let b=null!==a.silentForMs&&a.silentForMs>=a.stallAfterMs;if("gone"===a.host.state)return"busy"===a.turnState?{lifecycle:"stalled",reason:"host_gone_turn_open"}:{lifecycle:"gone",reason:"host_gone_turn_settled"};if("unknown"===a.host.state){let b=a.startingGraceMs??3e5;return null===a.silentForMs||a.silentForMs<b?{lifecycle:"starting",reason:"launch_unproven"}:"busy"===a.turnState?{lifecycle:"stalled",reason:"launch_unproven_expired"}:{lifecycle:"gone",reason:"launch_unproven_expired"}}return"busy"===a.turnState&&a.providerRetryAt?{lifecycle:"waiting",reason:"provider_throttled",retryAt:a.providerRetryAt}:b?{lifecycle:"stalled",reason:"host_alive_transcript_silent"}:"idle"===a.turnState?{lifecycle:"waiting",reason:"host_alive_turn_idle"}:{lifecycle:"running",reason:"host_alive_turn_active"}}({host:q,turnState:m,silentForMs:o,stallAfterMs:h,providerRetryAt:r}),pipeline:(s?l.byConversation.get(s):void 0)??l.byPath.get(a.path)??null,evidenceSource:i?null!==j?"transcript":"unreadable":"projection"}}),B=n+(performance.now()-x),C=performance.now(),D=A.map(a=>{var b;return{conversationId:a.conversationId,transcriptPath:a.entry.path,project:a.entry.project,engine:a.entry.engine,title:a.entry.title,lastRecordAt:null!==(b=a.lastRecordMs)&&Number.isFinite(b)?new Date(b).toISOString():null,turnState:a.turnState,host:a.host,lifecycle:a.lifecycle,reason:a.reason,retryAt:a.retryAt??null,silentForMs:a.silentForMs,stalledForMs:"stalled"===a.lifecycle||"gone"===a.lifecycle?a.silentForMs:null,pipeline:a.pipeline,evidenceSource:a.evidenceSource}}),E=performance.now()-C;return{observedAt:new Date(f).toISOString(),stallAfterMs:h,count:D.length,stalledCount:D.filter(a=>"stalled"===a.lifecycle).length,stalledConfirmedCount:D.filter(a=>"stalled"===a.lifecycle&&"transcript"===a.evidenceSource).length,conversations:D,selection:{...d,hydrated:v.hydrated,unreadable:y,projected:s.length-v.hydrated,evidenceBytes:v.bytes,budget:v.stopped},timings:{inventorySelectionMs:a8(r),journalProjectionMs:a8(B),evidenceReadMs:a8(w),serializationMs:a8(E),totalMs:a8(performance.now()-e)}}}var ba=c(18027),bb=c(93994),bc=c(81787);function bd(){return{state:"unreadable",error:"deployment ledger is unreadable"}}let be=`
|
|
7
|
-
ORDER BY COALESCE(
|
|
8
|
-
julianday(json_extract(state_json, '$.createdAt')),
|
|
9
|
-
julianday(json_extract(state_json, '$.updatedAt'))
|
|
10
|
-
) DESC,
|
|
11
|
-
COALESCE(updated_at, 0) DESC,
|
|
12
|
-
id DESC
|
|
13
|
-
`;function bf(a=process.env){let b=function(a=process.env){try{return new bc.Database(function(a=process.env){return a.LLV_RUNTIME_JOURNAL?.trim()||(0,af.BQ)("runtime-events.sqlite")}(a),{readonly:!0,create:!1})}catch{return null}}(a);if(!b)return bd();try{let a=b.query(`SELECT id, state_json FROM entities WHERE kind = ?${be} LIMIT 1`).get("deployment");if(!a)return{state:"ok",value:null};let c=function(a,b){try{let c=JSON.parse(a);if(!c||"object"!=typeof c||Array.isArray(c)||c.deploymentId!==b||"string"!=typeof c.revision||"string"!=typeof c.phase)return null;return c}catch{return null}}(a.state_json,a.id);return c?{state:"ok",value:c}:bd()}catch{return bd()}finally{b.close()}}var bg=c(91972),bh=c(80588);function bi(a,b=200){let c=a.split("\n").find(a=>a.trim())??"";return(0,m.t)(c,b)}function bj(a){let b=new Set;for(let c of a.matchAll(/(?<![\w#])#(\d{1,6})\b/g)){let a=Number(c[1]);Number.isSafeInteger(a)&&a>0&&b.add(a)}return[...b]}let bk=new Set(["pending","queued"]),bl=new Set(["delivering","applying"]),bm=new Set(["delivered","applied","answered"]);async function bn(a,b){let c=await b.operationStatus(a,{currentRetryLeaf:!0});if(!c)return"unknown";let d=c.receipt.status;return bk.has(d)||bl.has(d)?"retained":bm.has(d)?"landed":"failed"===d||"rejected"===d?"dropped":"uncertain"}async function bo(a,b){let c=await b.lookup({conversationId:a.conversationId,clientMessageId:a.clientMessageId});if("absent"===c.kind)return a.operationId?b.runtime(a.operationId):"absent";if("found"!==c.kind||!c.current.readable)return"unknown";let d=c.current.value;if("in-flight"!==d.state)return bp(d);let e=await b.settle(c.operationId);return e?"in-flight"===e.state?"retained":bp(e):"unknown"}function bp(a){return"delivered"===a.state?"landed":"in-flight"===a.state?"retained":"safe"===a.resend?"dropped":"uncertain"}async function bq(a,b,c){let d=await c.operationStatus(a,{currentRetryLeaf:!0});if(!d)return"unknown";let e=d.receipt.status;if(bm.has(e)||bl.has(e))return"too-late";if("failed"===e||"rejected"===e)return"withdrawn";if(!bk.has(e))return"unknown";try{let a=await c.transitionOperation(d.operationId,"failed",{reason:b});return"failed"===a.receipt.status?"withdrawn":"too-late"}catch{let a=await c.operationStatus(d.operationId,{currentRetryLeaf:!0});return a&&bm.has(a.receipt.status)?"too-late":"unknown"}}function br(){return{seatFor:ah.HS,activeSeats:()=>(0,ah.js)().map(a=>a.project),pipelines:()=>(0,ba.loadPipelinesForList)(),archivedPipelines:()=>(0,ba.loadArchivedPipelines)(),tasks:()=>(0,aj.h6)(),registry:()=>(0,aM.agentRegistry)(),liveness:async a=>(await a9({...a.conversationId?{conversationId:a.conversationId}:{},...a.project?{project:a.project,liveOnly:!0}:{},stallAfterMs:a.stallAfterMs,limit:a.limit},function(a={}){let b=a.completedFileScan??aV.Nm;return{now:()=>Date.now(),selectInventory:(a,c)=>aY(a,{completedFileScan:b,signal:c?.signal??null}),describeTranscript:a3,registrySnapshot:()=>(0,aM.agentRegistry)().readOnlySnapshot(),pipelines:()=>(0,aU.Cz)().pipelines,transcriptEvidence:a2,limitsProvenance:aS.io,probe:(0,aQ.AM)()}}())).conversations,lifecycleJournal:aP,latestDeployment:bf,retirementReport:()=>{try{return JSON.parse(g().readFileSync((0,af.BQ)("host-retirement-report.json"),"utf8"))}catch{return null}},settings:a=>(function(a,b=ay()){return aC(b).projects[a]??az(a)})(a),openPullRequests:a=>an(a),wakeState:async a=>bo(a,{lookup:a=>(0,bg.Mc)(a),settle:a=>(0,bg.V$)(a),runtime:async a=>{let b=(0,bb.sS)();return b?bn(a,b):"unknown"}}),originalSend:a=>(0,bg.Mc)(a),withdrawWake:async(a,b)=>{let c;if(a.operationId){let c=(0,bb.sS)();return c?bq(a.operationId,b,c):"unknown"}let d=(c=Object.values((0,aM.agentRegistry)().readOnlySnapshot().heldDeliveries).find(b=>b.clientMessageId===a.clientMessageId))?{id:c.id,state:c.state}:null;return d?"delivered"===d.state?"too-late":"held"!==d.state?"unknown":((0,aM.agentRegistry)().terminalizeHeldDelivery(d.id,b),"withdrawn"):"unknown"},now:()=>Date.now()}}function bs(a){return!a.closedAt&&!a.hiddenAt&&"completed"!==a.state&&"closed"!==a.state}function bt(a){let b=[a.pausedAt,a.resumedAt,...a.runs.flatMap(a=>a.attempts.flatMap(a=>[a.startedAt,a.completedAt]))].filter(a=>"string"==typeof a&&Number.isFinite(Date.parse(a)));return{id:a.id,task:a.task,project:a.project,state:a.state,createdAt:a.createdAt,closedAt:a.closedAt,...a.spec?{spec:a.spec}:{},activityAt:b}}function bu(a){return{id:a.id,project:a.project,status:a.status,text:a.text,updatedAt:a.updatedAt,assignments:a.assignments?.map(a=>({state:a.state,path:a.path,conversationId:a.conversationId??null}))??[],pipelineIds:a.pipelineIds}}function bv(a){return a?{lifecycle:a.lifecycle,reason:a.reason,turnState:a.turnState}:null}async function bw(a,b,c){let d,e=new Map;try{d=await c.liveness({project:a,stallAfterMs:b.stallAfterMs,limit:60})}catch{return e}for(let a of d){let b=a.pipeline?.pipelineId;if(!b||e.has(b))continue;let c=bv(a);c&&e.set(b,c)}return e}async function bx(a,b,c){let d=c.seatFor(a).active;if(!d?.conversationId)return null;let e=c.registry().seatTickConversation(d.conversationId),f=e?.turn.state??"unknown",g=null;if("busy"===f)try{let a=await c.liveness({conversationId:d.conversationId,stallAfterMs:b.stallAfterMs,limit:1});g=bv(a[0])}catch{g=null}return{conversationId:d.conversationId,seatEpoch:d.seatEpoch,path:d.path,turn:f,activity:g}}function by(a,b,c=[]){let d=(0,ah.ut)(a),e=[...b.pipelines(),...c].filter(a=>a.repoDir&&(0,ah.ut)(a.project)===d).sort((a,b)=>Date.parse(b.createdAt)-Date.parse(a.createdAt));return e[0]?.repoDir??null}function bz(a){return e().createHash("sha256").update(a.join("\n")).digest("hex").slice(0,32)}async function bA(a){let b,c,d={pullRequests:[],unavailable:null,gap:a.gap};if(!a.wakeDue||!a.enabled||!a.seat||J(a.seat))return d;let e=new Date(a.now).toISOString(),f=b=>({pullRequests:[],unavailable:b,gap:N(a.gap,b,e)}),g=a.gap;if(g?.gap==="lanes-unreadable"&&!M(g,a.now,a.wakeIntervalMs))return{pullRequests:[],unavailable:g.gap,gap:g};try{b=a.sources.archivedPipelines()}catch{return f("lanes-unreadable")}let h=[...a.sources.pipelines(),...b].filter(b=>{var c;return(0,ah.ut)(b.project)===a.project&&!(c=b).hiddenAt&&(!!c.closedAt||"completed"===c.state||"closed"===c.state)});if(0===h.length)return d;let i=by(a.project,a.sources,b);if(!i)return d;if(a.gap&&!M(a.gap,a.now,a.wakeIntervalMs))return{pullRequests:[],unavailable:a.gap.gap,gap:a.gap};try{c=await a.sources.openPullRequests({cwd:i,limit:60})}catch{c={ok:!1,unavailable:"command-failed"}}if(!c.ok)return f(c.unavailable);let j=c.pullRequests,k=new Map;for(let a of h){if(!a.branch)continue;let b=k.get(a.branch);(!b||Date.parse(a.createdAt)>Date.parse(b.createdAt))&&k.set(a.branch,a)}let l=[];for(let a of j){let b=k.get(a.headRefName);b&&l.push({number:a.number,title:(0,m.t)(a.title,120),pipelineId:b.id,pipelineTitle:(0,m.t)(b.task.split("\n")[0]??"",120),updatedAt:a.updatedAt})}return{pullRequests:l.sort((a,b)=>a.number-b.number),unavailable:null,gap:null}}let bB=new Set(["starting","pane-bound","host-verified","prompt-delivered","path-pending"]),bC=new Set(["starting","live","idle","handoff"]),bD=new Set(["pipeline","flow","orchestrator"]);async function bE(a,b,c,d,e){var f;if(!b)return{children:[],unavailable:null};if(!c.accounting)return{children:[],unavailable:"registry-unreadable"};let h=new ae(c.accounting.filename,a),i=e.registry(),j=e.now(),k=new Set,l=null===(f=c.accounting.gap)?null:"legacy-migration-pending"===f?"migration-pending":"migration-blocked";l&&k.add(l);let n=[],o=(b,c)=>{let d=b.file.lineageEdges[c];return d?function(a,b,c,d,e){if("viewer-spawn"!==c.source)return null;let f=b.canonicalConversationId(c.childConversationId);if((a.memberships[f]??[]).some(a=>bD.has(a.kind)))return null;let g=c.evidence.launchId?a.receipts[c.evidence.launchId]??null:null,h=b.conversation(f),i=h?.generations.at(-1)??null,j=h&&i?(0,aN.sz)(h.engine,i.path):null,k=[...new Set([g?.key,c.childSessionKey,j].filter(a=>!!a).map(aN.pp))].flatMap(b=>a.entries[b]?[a.entries[b]]:[]),l=(0,bh.x)({projectOwnership:h?.projectOwnership??null,cwd:g?.cwd??k[0]?.cwd??null,launchProfileProject:g?.launchProfile.project??i?.launchProfile.project??null}).project;if(!l||(0,ah.ut)(l)!==d)return null;let n=(0,m.t)(g?.launchProfile.title??i?.launchProfile.title??c.role??"spawned child",120),o=function(a,b,c){if(b.some(a=>bC.has(a.status)))return!0;if(!a||!bB.has(a.state))return!1;if("starting"!==a.state)return!0;let d=Date.parse(a.createdAt);return Number.isFinite(d)&&c-d<=aM.rK}(g,k,e),p=h?.turn.state??"unknown",q={conversationId:f,title:n,activity:null},r=c.createdAt;return g&&(g.rejection||"failed"===g.state||"conflicted"===g.state)?{input:{...q,status:"terminal",outcome:"failed",terminalAt:g.rejection?.rejectedAt??g.createdAt},turn:p,hosted:o,createdAt:r}:h?"terminal"===p?{input:{...q,status:"terminal",outcome:"finished",terminalAt:h.turn.terminalAt??h.turn.observedAt??h.updatedAt},turn:p,hosted:o,createdAt:r}:o?{input:{...q,status:"running",outcome:null,terminalAt:null},turn:p,hosted:o,createdAt:r}:"idle"===p?{input:{...q,status:"terminal",outcome:"finished",terminalAt:h.turn.observedAt??h.updatedAt},turn:p,hosted:o,createdAt:r}:"busy"===p?{input:{...q,status:"running",outcome:null,terminalAt:null,activity:{lifecycle:"gone",reason:"host_gone_turn_open",turnState:"busy"}},turn:p,hosted:o,createdAt:r}:{input:{...q,status:"unknown",outcome:null,terminalAt:null},turn:p,hosted:o,createdAt:r}:{input:{...q,status:"unknown",outcome:null,terminalAt:null},turn:p,hosted:o,createdAt:r}}(b.file,(0,aM.MA)(b.file),d,a,j):null},p=new Map,q=0,r=(...a)=>{let[b,,c,d]=a,e=d?.length===1?p.get(`${b}/${d[0]}`):null;if(e)return e;if(q+c>60)return k.add("ledger-pending"),null;let f=i.pageSeatChildren(...a);for(let a of(q+=f?.keys.length??0,f?.keys??[]))p.set(`${b}/${a}`,f);return f||(k.add("children-unindexed"),null)},s=0x2000000,t=[],v=a=>{let b=r(a.conversationId,a.after,20);if(!b)return!1;let c=[b],d=a.bootstrap,e=b.after;if(a.after||a.bootstrap||b.complete){if(d&&q<=20){let b=r(a.conversationId,d.after,20);b&&(c.push(b),d=b.complete?void 0:{after:b.after})}}else d={after:b.after},e=b.latest??b.after;let f=[];for(let b of c)for(let c of b.keys){let d=b.file.lineageEdges[c],e=o(b,c);e&&d?.evidence.launchId&&f.push({child:h.child(c,a.conversationId,d.evidence.launchId,e.input),position:"terminal"===e.input.status?"head":"tail"})}return h.discovery({...a,after:b.evidenceGap?a.after:e,bootstrap:d},f),(d||c.some(a=>a.evidenceGap||!a.complete))&&k.add("discovery-incomplete"),!0},w=(a,b,c)=>{let d=a.input,e=a.generationIndex,f=b.file.lineageEdges[a.rowKey];if(!c||!f||f.parentConversationId!==a.owner||f.evidence.launchId!==a.launchId){h.ingest({...a,input:{...a.input,status:"unknown",outcome:null}},null,[]),k.add("child-departed");return}a.input=c.input,"unknown"===a.input.status&&(n.push(a.input),k.add("child-unplaced"));let i=(0,aM.MA)(b.file).conversation(f.childConversationId),j=i?.generations??[],l=j[a.generationIndex%Math.max(1,j.length)],m=b.file.receipts[a.launchId],o=m?.state==="failed"&&null===m.key&&null===m.artifactPath&&0===j.length;if(!l)return void h.ingest(a,null,[],o);let p=h.source(a,i.engine,l.id),q=p.cursor,r=Math.min(s,0x1000000),u=function(a,b,c,d=256){let e;if(!Number.isSafeInteger(c)||c<1||c>0x4000000)throw Error("invalid ledger budget");if(!Number.isSafeInteger(d)||d<1||d>256)throw Error("invalid ledger outcome budget");let f={...b},h=[],i=0,j=0;try{e=g().openSync(a,g().constants.O_RDONLY|g().constants.O_NOFOLLOW);let k=g().fstatSync(e);if(!k.isFile())throw Error("ledger is not a regular file");let l=`${k.dev}:${k.ino}`;(f.identity!==l||k.size<f.offset)&&(f={...V(),identity:l,initialSize:k.size,gap:b.identity?"ledger-replaced":b.gap}),"ledger-unreadable"===f.gap&&(f.gap=null);let m=Buffer.allocUnsafe(Math.min(262144,Math.max(c,1))),n=[],o=0,p=!1,q=f.offset,r=!1;for(;!r&&q<k.size&&(!(i>=c)||!(j>0)&&(0!==o||p));){let a=g().readSync(e,m,0,m.length,q);if(!a)break;i+=a,q+=a;let b=0;for(;b<a;){let c=m.indexOf(10,b);if(c<0){let c=m.subarray(b,a);p||((o+=c.length)>0x1000000?(p=!0,n=[],o=0):n.push(Buffer.from(c)));break}let e=q-a+c+1;if(p)f.gap="malformed-record",f.resync=!0,p=!1;else{let a=m.subarray(b,c),d=n.length?Buffer.concat([...n,a]):a;d.length>0x1000000?f.gap="malformed-record":function(a,b,c,d){let e;if(b.indexOf(W)>=0)e=Y(b);else{let a,c,d=(a=b.subarray(Math.max(0,b.length-48)).toString("latin1").trimEnd(),(c=/"seq":(\d{1,15})\}$/.exec(a))?Number(c[1]):null);e=null!==d?{kind:"",seq:d}:Y(b)}if(!e){a.gap="malformed-record",a.resync=!0;return}a.resync?delete a.resync:e.seq!==a.seq+1&&(a.gap="sequence-gap"),a.seq=e.seq,"turn-started"===e.kind?"string"==typeof e.turnId&&e.turnId?a.activeTurn=e.turnId:a.gap="invalid-turn-start":"turn-ended"===e.kind&&("string"==typeof e.turnId&&e.turnId.length>0&&X.has(String(e.status))?((null===a.activeTurn||a.activeTurn===e.turnId)&&(a.activeTurn=null,a.settledThrough=e.seq),d.push({turnId:e.turnId,status:e.status,seq:e.seq,endOffset:c})):a.gap="invalid-terminal")}(f,d,e,h)}if(n=[],o=0,f.offset=e,j++,b=c+1,h.length>=d){r=!0;break}}}f.atEnd=f.offset===k.size}catch(b){let a="ENOENT"===b.code;f.gap=a?f.identity?"ledger-missing":f.gap:"ledger-unreadable",f.atEnd=!1}finally{void 0!==e&&g().closeSync(e)}return{cursor:f,outcomes:h,bytes:i,records:j}}(aq().join((0,af.BQ)("structured-host-events"),`${encodeURIComponent(l.id)}.jsonl`),p.cursor,r);p.cursor=u.cursor,u.cursor.atEnd&&null===u.cursor.activeTurn&&u.cursor.settledThrough>0&&("idle"===c.turn||"terminal"===c.turn)&&(a.input={...a.input,status:"terminal",outcome:"finished"}),s-=u.bytes,null!==p.cursor.gap&&k.add("ledger-gap"),a.generationIndex=(a.generationIndex+1)%j.length;let v=!u.cursor.atEnd&&(u.bytes>=r||u.outcomes.length>=256);"terminal"===a.input.status&&0===u.bytes&&0===u.outcomes.length&&u.cursor.atEnd&&a.generationIndex===e&&JSON.stringify(q)===JSON.stringify(u.cursor)&&JSON.stringify(d)===JSON.stringify(a.input)?t.push(a):h.ingest(a,p,u.outcomes,!1,v?"head":"tail"),v&&"busy"!==c.turn&&k.add("ledger-pending")};try{let c=h.owner(b.conversationId,b.seatEpoch);if(h.discoverRevokedOwners((0,af.BQ)("orchestrator-seats.json"),b=>(0,ah.ut)(b)===a)&&k.add("discovery-incomplete"),v(c)){let a=h.page("owner-poll",1)[0];if(q<=20&&a?.kind==="owner-poll"){let b=h.get(a.target);if(!b||"owner"!==b.kind)throw Error("missing owner provenance");let d=b.pollKey?b:h.owner(b.conversationId,b.epoch);d.pollKey!==a.key?h.drop(a):d.key!==c.key&&v(d)}}let f=new Set,g=h.page("running",8);for(let a of g){if("running"!==a.kind)continue;let b=h.get(a.target);if(!b||"child"!==b.kind)throw Error("missing running child");let c=r(b.owner,null,1,[b.rowKey]);if(!c)break;let g=o(c,b.rowKey);if((!g||"running"!==g.input.status||"idle"===g.turn||"terminal"===g.turn)&&(s>0?w(b,c,g):(h.promote(b),k.add("ledger-pending")),!g||"running"!==g.input.status||"running"!==b.input.status))continue;let i=g.input;if("busy"===g.turn&&g.hosted)try{i={...i,activity:bv((await e.liveness({conversationId:i.conversationId,stallAfterMs:d.stallAfterMs,limit:1}))[0])}}catch{i={...i,activity:null}}n.push(i),f.add(b.key)}for(let a of(h.rotateRunning(g.slice(0,4)),h.pollPage(40))){if(s<=0)break;if("poll"!==a.kind)throw Error("invalid poll ticket");let b=h.get(a.target);if(!b||"child"!==b.kind)throw Error("missing child provenance");if((b=h.adoptPoll(b,a.key)).pollKey!==a.key){h.drop(a);continue}if(q>=40&&!p.has(`${b.owner}/${b.rowKey}`))break;let c=r(b.owner,null,1,[b.rowKey]);if(!c)break;let d=o(c,b.rowKey);w(b,c,d),"running"!==b.input.status||f.has(b.key)||(n.push(b.input),f.add(b.key))}for(let a of(h.rotateCold(t),h.ready(20))){let b=h.get(a.child);if(!b||"child"!==b.kind)throw Error("missing ready child");let c=r(b.owner,null,1,[b.rowKey]);if(!c)break;if(!o(c,b.rowKey)||c.file.lineageEdges[b.rowKey]?.parentConversationId!==b.owner){h.defer(a),k.add("child-departed");continue}n.push(a.input)}}catch{k.add("registry-unreadable")}return{children:n,unavailable:u.find(a=>k.has(a))??null}}async function bF(a,b,c,d){var e,f,g,h;let i,j,k,l,m,n,o,q,r,s,t=d.now(),u=(0,ah.ut)(a),v=aD(d.settings(u),t,36e5),w=await bx(u,c,d),x=d.pipelines().filter(a=>bs(a)&&(0,ah.ut)(a.project)===u),y=x.map(bt).map(a=>{var b,c;let d;return{kind:"pipeline",id:a.id,title:bi(`${a.task}
|
|
14
|
-
${a.spec??""}`),project:a.project||null,state:"completed"===(b=a.state)||"closed"===b?"terminal":"needs_decision"===b||"paused"===b||"draft"===b?"inert":"active",owner:`pipeline ${a.id}`,updatedAt:0===(d=[...a.activityAt??[],...(c=a.closedAt)?[c]:[]].filter(a=>Number.isFinite(Date.parse(a)))).length?null:d.reduce((a,b)=>Date.parse(b)>Date.parse(a)?b:a),references:bj(`${a.task} ${a.spec??""}`),monitorRef:null}}),z=x.length>0?await bw(u,c,d):new Map,A=x.map((a,b)=>({id:a.id,title:y[b].title,state:y[b].state,updatedAt:y[b].updatedAt,stageActivity:z.get(a.id)??null,stageId:a.cursor?.stageId??null})),B=(e=d.tasks(),f=[...d.pipelines()],e.map(a=>({...a,pipelineIds:f.filter(b=>b.taskIds.includes(a.id)).map(a=>a.id)}))).filter(a=>(0,ah.ut)(a.project)===u),C=B.map(bu).map(a=>{var b;let c;return{kind:"task",id:a.id,title:bi(a.text),project:a.project||null,state:"done"===(b=a.status)?"terminal":"blocked"===b?"inert":"active",owner:(c=a.pipelineIds?.[0])?`pipeline ${c}`:a.assignments?.find(a=>"delivered"===a.state||"spawning"===a.state||"handoff"===a.state)?"an assigned agent":null,updatedAt:a.updatedAt||null,references:bj(a.text),monitorRef:p(a.text)}}),D=B.map((a,b)=>({id:a.id,title:C[b].title,status:a.status,owned:null!==C[b].owner,updatedAt:a.updatedAt??null})),E=new Set(d.pipelines().filter(bs).map(a=>a.id)),{events:F,cursor:G}=(g=b.eventsThrough,j=Math.max((i=d.lifecycleJournal()).lastSeq,i.events.at(-1)?.seq??0),null===g?{events:[],cursor:j}:{events:(function(a,b={}){let c=Math.max(1,Math.min(200,Number.isInteger(b.limit)?b.limit:50)),d=Number.isInteger(b.afterSeq)?b.afterSeq:0,e=a.events.filter(a=>!(a.seq<=d)&&(!b.project||a.project===b.project)&&(!b.pipelineId||a.pipelineId===b.pipelineId)&&(!b.conversationId||a.conversationId===b.conversationId)&&(!b.stageId||a.stageId===b.stageId)&&(!b.type||a.type===b.type)&&!0),f=e.slice(0,c);return{count:f.length,events:f,cursor:a.lastSeq,remaining:e.length-f.length}})(i,{project:u,afterSeq:g,limit:200}).events.map(a=>({seq:a.seq,at:a.at,type:a.type,summary:a.summary,pipelineId:a.pipelineId,pipelineTerminal:null!==a.pipelineId&&!E.has(a.pipelineId)})),cursor:g}),{children:H,unavailable:I}=await bE(u,w,b,c,d),J=w?I?N(b.childrenGap,I,new Date(t).toISOString()):null:b.childrenGap,L=b.harvestedChildren,{pullRequests:M,unavailable:P,gap:Q}=await bA({project:u,seat:w,wakeDue:K(b.lastWakeAt,t,v.wakeIntervalMs),enabled:v.enabled,now:t,wakeIntervalMs:v.wakeIntervalMs,gap:b.pullRequestGap,sources:d});return{project:u,now:t,seat:w,pipelines:A,tasks:D,events:F,pullRequests:M,pullRequestsUnavailable:P,signals:(k=[],(m="ok"===(l=d.latestDeployment()).state?l.value:null)&&m.terminal&&"succeeded"!==m.phase&&k.push({id:"deploy",label:`the last deployment ended ${m.phase}`}),n=d.retirementReport(),o=n?.refused.filter(a=>a.undetermined).length??0,n&&(n.failed.length>0||o>0)&&k.push({id:"host-retirement",label:`host retirement: ${n.failed.length} failed, ${o} undetermined`}),q=w?.activity,w&&"busy"===w.turn&&q&&("gone"===(h=q).lifecycle||"stalled"===h.lifecycle&&"busy"===h.turnState)&&k.push({id:"seat-host",label:`the seat's own turn is ${q.lifecycle} in ${u} (${q.reason})`}),k),children:H,childrenUnavailable:I,changeFingerprint:(r=[...A.map(a=>`p:${a.id}:${a.state}:${a.updatedAt??""}`),...D.map(a=>`t:${a.id}:${a.status}:${a.owned}:${a.updatedAt??""}`),...H.map(a=>`c:${a.conversationId}:${a.outcomeId??""}:${a.status}:${a.terminalAt??""}`)].sort(),s=M.map(a=>`pr:${a.number}:${a.pipelineId}`).sort(),`${bz(r)}.${P?O:bz(s)}`),state:{...b,eventsThrough:G,pullRequestGap:Q,childrenGap:J,harvestedChildren:L,accounting:b.accounting?new ae(b.accounting.filename,u).readState().accounting:void 0},policy:c,settings:v}}let bG="seat-tick-wake-unresolved";function bH(a,b,c){return(0,aj.Pf)(d=>{let e,f=d.tasks.find(c=>(0,ah.ut)(c.project)===a&&"done"!==c.status&&p(c.text)===b.ref);if("resolved"===b.state){if(!f)return{state:void 0,result:!0};let a=(0,ai.mQ)(d.tasks,f.id,{status:"done"});return a.ok?{state:{tasks:a.tasks,recentCreates:d.recentCreates},result:!0}:{state:void 0,result:!1}}let g=function(a,b,c){var d,e,f,g,h,i,j,k,l,p;if("no-seat"===b.kind)return d=b.detail,(0,m.t)(`Conversation monitor cannot resolve a live orchestrator
|
|
15
|
-
|
|
16
|
-
The monitor resolves the orchestrator through the durable record, never a transcript path. ${d}.
|
|
17
|
-
Until a live orchestrator is adopted, monitor runs report their findings on the board only — nothing is delivered in chat.
|
|
18
|
-
Observed ${c.slice(0,16).replace("T"," ")} UTC.
|
|
19
|
-
|
|
20
|
-
${n} ${o}`,5e3);if("source-unreadable"===b.kind)return b.ref===s("children")?(e=b.detail,f=b.ref,(0,m.t)(`Seat tick cannot fully account for the seat's spawned children
|
|
21
|
-
|
|
22
|
-
${e}.
|
|
23
|
-
Wakes continue on every reason that does not depend on it, and each one names the missing evidence; a finished worker whose outcome is owed, or a stalled one, is what cannot be named while this stands.
|
|
24
|
-
The tick keeps asking on every check and reports nothing further until every child is accounted for — this card is raised once per outage.
|
|
25
|
-
Project ${a}. Observed ${c.slice(0,16).replace("T"," ")} UTC.
|
|
26
|
-
|
|
27
|
-
${n} ${f}`,5e3)):(g=b.detail,h=b.ref,(0,m.t)(`Seat tick cannot read one of its evidence sources
|
|
28
|
-
|
|
29
|
-
${g}.
|
|
30
|
-
Wakes continue on every reason that does not depend on it, and each one names the missing evidence; an unmerged pull request left by a finished lane is what cannot be seen while this stands.
|
|
31
|
-
The tick keeps asking, at this project's wake interval, and reports nothing further until the source answers — this card is raised once per outage.
|
|
32
|
-
Project ${a}. Observed ${c.slice(0,16).replace("T"," ")} UTC.
|
|
33
|
-
|
|
34
|
-
${n} ${h}`,5e3));if("wake-unresolved"===b.kind)return i=b.detail,j=b.ref,(0,m.t)(`Seat tick wake unresolved under its original key
|
|
35
|
-
|
|
36
|
-
${i}.
|
|
37
|
-
Nothing the wake carried is acknowledged: every outcome and lane event it named stays owed until a wake that lands names it.
|
|
38
|
-
Project ${a}. Observed ${c.slice(0,16).replace("T"," ")} UTC.
|
|
39
|
-
|
|
40
|
-
${n} ${j}`,5e3);if("tick-settings"===b.kind){let c,d;return k={project:a,detail:b.detail,reason:b.settings?.reason??null,until:b.settings?.until??null,setBy:b.settings?.setBy??null,updatedAt:b.settings?.updatedAt??null},c=k.setBy?.project&&k.setBy.project!==k.project,d=k.setBy?`Set by ${"manager"===k.setBy.kind?"the designated seat":"gateway"===k.setBy.kind?"the operator's own session":"agent"===k.setBy.kind?"an agent session":"a caller nothing identified"}${k.setBy.conversationId?` (${k.setBy.conversationId})`:""}${c?`, whose own project is ${k.setBy.project}`:""}.`:"Set by nobody the record names.",(0,m.t)(["This project's seat tick is not on its default settings\n",`${k.detail}.`,`Reason given: ${k.reason??"none recorded"}.`,k.until?`It returns to the default at ${k.until.slice(0,16).replace("T"," ")} UTC.`:"It stands until someone changes it back.",d,`Project ${k.project}. Recorded ${k.updatedAt?`${k.updatedAt.slice(0,16).replace("T"," ")} UTC`:"at an unrecorded time"}.`,"Change it with the seat tick settings tool; this card clears itself once the project is back on the defaults.\n",`${n} ${r}`].join("\n"),5e3)}return l=b.detail,p=b.ref,(0,m.t)(`Seat tick stopped re-sending a wake reason
|
|
41
|
-
|
|
42
|
-
${l}.
|
|
43
|
-
Project ${a}. Observed ${c.slice(0,16).replace("T"," ")} UTC.
|
|
44
|
-
The tick resumes this reason on its own once the board or a pipeline moves.
|
|
45
|
-
|
|
46
|
-
${n} ${p}`,5e3)}(a,b,c);if(f){if("open"!==b.state||f.text===g)return{state:void 0,result:!0};let a=(0,ai.mQ)(d.tasks,f.id,{text:g});return a.ok?{state:{tasks:a.tasks,recentCreates:d.recentCreates},result:!0}:{state:void 0,result:!0}}let h=(0,ai.UT)(d.tasks,{project:a,text:g,placement:"unplaced",clientRequestId:(e=b.instance?`${b.ref}:${b.instance}`:b.ref,`monitor-741:${e}`)},d.recentCreates);return h.ok?h.replay?{state:void 0,result:!0}:{state:{tasks:h.tasks,recentCreates:h.recentCreates},result:!0}:{state:void 0,result:!1}},(0,af.BQ)("tasks.json"))}function bI(a){if(!a.ok)return!1;switch(a.outcome){case"held":case"queued":case"delivering":case"pending":return!1;default:return!0}}function bJ(a){return a.ok?a.outcome??"delivered":"failed"}async function bK(a){let b,c=a.state.outstandingWake;if(!c)return a.state;let d=a.state,e=b=>{if(b.accounting){let c=new ae(b.accounting.filename,a.project);return c.writeState(b),c.readState()}return a.writeState(a.project,b),b};c.preparedAt||(d=e({...d,outstandingWake:{...c,preparedAt:a.at}}));let f=d.outstandingWake,g=Date.parse(f.preparedAt),h=Number.isFinite(g)&&a.now-g>=a.wakeIntervalMs,i=!a.seat||a.seat.conversationId!==f.conversationId||a.seat.seatEpoch!==f.seatEpoch,j="";try{b=await a.sources.wakeState(f)}catch(a){b="unreadable",j=(0,m.l)(a instanceof Error?a.message:"unknown error")}let k=null,l=null;if("landed"===b)k={verdict:"landed",outcome:"landed",row:"commit",detail:"a wake the delivery layer had kept reached the seat; the wake stamp and the event cursor move now, on the plan the check that raised it wrote down"};else if("dropped"===b)k={verdict:"dropped",outcome:"dropped",row:"clear",detail:"the layer holding the wake settled it without delivering it, so no stamp moves and the next check may raise it again"};else if(i)if("retained"===b){let b;try{b=await a.sources.withdrawWake(f,"the seat tick revoked a wake raised for a seat that has since been replaced")}catch(a){b="unknown",j=(0,m.l)(a instanceof Error?a.message:"unknown error")}k="withdrawn"===b?{verdict:"revoked",outcome:"withdrawn",row:"clear",detail:"a wake the delivery layer had accepted but not landed was taken out of its queue before it could reach the replaced seat"}:"too-late"===b?{verdict:"revoked",outcome:"too-late",row:"keep",detail:"the wake raised for the replaced seat could not be taken back: the layer holding it had already let it go, so the replaced seat may have received it; the attempt is kept under its original key until the holder settles it"}:{verdict:"revoked",outcome:"unknown",row:"keep",detail:`the wake raised for the replaced seat could not be revoked: the layer holding it did not answer${j?` (${j})`:""}; it is asked again at the next check`}}else if("uncertain"===b)k={verdict:"uncertain",outcome:"uncertain",row:"keep",detail:"the layer holding the wake raised for the replaced seat ended it without proving arrival; the original key and all obligations remain outstanding, and no wake replaces it"};else if("absent"===b&&!f.operationId&&f.text&&f.dispatch?.state==="refused"&&d.accounting){let b=new ae(d.accounting.filename,a.project);if(!b.settleAbsent(f))return b.readState();d=b.readState(),k={verdict:"revoked",outcome:"unsent",row:"clear",detail:"the wake raised for the replaced seat was refused by the delivery layer before it reserved anything, and the record holds nothing under its key and the returned dispatch token was fenced atomically: the attempt is released unsent with nothing it named acknowledged, and the successor's next check raises its own wake"}}else k={verdict:"revoked",outcome:"unknown",row:"keep",detail:`the wake raised for the replaced seat could not be revoked: no holder could account for it${j?` (${j})`:""}; it is asked again at the next check`};else if("uncertain"===b)k={verdict:"uncertain",outcome:"uncertain",row:"keep",detail:"the layer holding the wake ended it without proving arrival; the original key and all obligations remain outstanding, and no wake replaces it"};else if("absent"===b&&!f.operationId&&f.text&&(!f.dispatch||"refused"===f.dispatch.state)&&a.deliver){let b=d.accounting?new ae(d.accounting.filename,a.project).readState():d,c=a.sources.seatFor(a.project).active;if(b.outstandingWake?.clientMessageId!==f.clientMessageId)return b;if(!c||c.conversationId!==f.conversationId||c.seatEpoch!==f.seatEpoch)return d;let g=d.accounting?new ae(d.accounting.filename,a.project):null;if(!g)return d;let h=g.beginDispatch(f);if(d=g.readState(),!h)return d;f=d.outstandingWake;let i=null;try{i=await a.deliver({pid:null,path:c.path??a.seat?.path??"",conversationId:f.conversationId,clientMessageId:f.clientMessageId,text:f.text,images:[],origin:{kind:"agent",role:"seat-tick"}}),l=bJ(i)}catch{l="unreturned"}if(i){if(g.returnedDispatch(f.clientMessageId,h,!i.ok&&!i.operationId&&"started"!==i.actuation&&"verify-first"!==i.resend),d=g.readState(),d.outstandingWake?.clientMessageId!==f.clientMessageId)return d;f=d.outstandingWake}i&&bI(i)?k={verdict:"landed",outcome:"landed",row:"commit",detail:"a wake the delivery layer had refused without keeping a record was re-dispatched under its original key and reached the seat; the wake stamp and the event cursor move now, on the plan the check that raised it wrote down"}:i?.operationId&&(f=(d=e({...d,outstandingWake:{...f,operationId:i.operationId}})).outstandingWake)}if(k?.row==="clear"&&f.dispatch?.state==="active"&&(k={...k,row:"keep",outcome:"unknown",detail:"the delivery record was fenced, but its admitted transport call has not returned; the original attempt remains outstanding until that call is accounted for"}),(!k||"keep"===k.row)&&(h||"uncertain"===b)){let c="unreadable"===b?`could not be read${j?` (${j})`:""}`:`answered "${b}"`,d=`A wake prepared ${f.preparedAt.slice(0,16).replace("T"," ")} UTC for ${i?"a seat that has since been replaced":"this seat"} is still unresolved under its original key; the layer holding it last ${c}${l?`, and a re-dispatch under the same key answered "${l}"`:""}. The tick keeps the attempt and dispatches no replacement wake for this project until it lands or the delivery record proves it never actuated. Check the seat's conversation for the wake and the delivery record under its client message id`;try{a.ensureCard(a.project,{ref:bG,kind:"wake-unresolved",instance:f.clientMessageId,detail:d},a.at)}catch(a){console.error("[seat tick] card write failed",a instanceof Error?a.name:"unknown")}}if(!k)return d;let n="commit"===k.row?U(d,f.commit,a.now):"clear"===k.row?{...d,outstandingWake:null}:d;if(a.appendRecord({schemaVersion:1,at:a.at,project:a.project,seatEpoch:f.seatEpoch,verdict:k.verdict,reasons:[],items:0,deferred:0,eventsThrough:n.eventsThrough??0,delivery:{clientMessageId:f.clientMessageId,outcome:k.outcome},detail:k.detail}),"keep"===k.row)return n;if(d.accounting){let b=new ae(d.accounting.filename,a.project);return b.settle(f.clientMessageId,n,"commit"===k.row?"landed":"unsent"),b.readState()}return a.writeState(a.project,n),n}async function bL(a,b={}){let c=void 0===b.policy?D():b.policy;if(!c)return null;let d=b.appendRecord??as,e=(0,ah.ut)(a);try{return await bM(e,c,b,d)}catch(b){let a={schemaVersion:1,at:new Date().toISOString(),project:e,seatEpoch:null,verdict:"error",reasons:[],items:0,deferred:0,eventsThrough:0,delivery:null,detail:`the check failed: ${(0,m.l)(b instanceof Error?b.message:"unknown error")}`};return d(a),a}}async function bM(a,b,c,d){var f,g,h,i,j,k,l,m;let p,t=c.sources??br(),u=c.readState??aK,v=c.writeState??aL,w=c.deliver??ag.Ku,x=c.ensureCard??bH,y=t.now(),z=t.seatFor(a).active??null,A=await bK({project:a,state:aI(u(a),z?.seatEpoch??null),seat:z,sources:t,appendRecord:d,writeState:v,ensureCard:x,deliver:w,at:new Date(y).toISOString(),now:y,wakeIntervalMs:function(a,b,c){try{return aD(c.settings(a),b,36e5).wakeIntervalMs}catch{return 36e5}}(a,y,t)}),B=await bF(a,A,b,t),C=new Date(B.now).toISOString(),D={...B,state:aI(B.state,B.seat?.seatEpoch??null)},L={...p=function(a){var b,c,d,e;let f,g,h=new Date(a.now).toISOString(),i={...a.state,lastCheckAt:h};if(!a.seat)return{verdict:{kind:"no-seat",detail:"the project has open work and no active orchestrator seat"},state:{...i,seatEpoch:null},cards:[{ref:o,kind:"no-seat",detail:"No active orchestrator seat holds this project, so the tick has nothing to wake"}]};if(J(a.seat))return{verdict:{kind:"skipped",reason:"seat-busy"},state:i,cards:[]};let j={...i,seatEpoch:a.seat.seatEpoch,eventsThrough:function(a,b){let c=b;for(let b of a){if(I(b))break;c=Math.max(c??b.seq,b.seq)}return c}(a.events,i.eventsThrough)},k=function(a){let b={now:new Date(a.now),stallAfterMs:null},c=[];for(let d of a.pipelines){if(!E(d))continue;let a=function(a,b){if("terminal"===a.state)return null;if("inert"===a.state)return`${a.kind} ${a.id} is parked`;if(null===b.stallAfterMs)return null;let c=b.stallAfterMs??1728e5,d=a.updatedAt?Date.parse(a.updatedAt):NaN;return Number.isFinite(d)&&b.now.getTime()-d>c?`${a.kind} ${a.id} is live but shows no movement past the stall threshold`:null}({kind:"pipeline",id:d.id,state:d.state,updatedAt:d.updatedAt},b);if(a){c.push({pipeline:d,reason:a});continue}let e=d.stageActivity;if(e&&("stalled"===e.lifecycle||"gone"===e.lifecycle)){let a=d.stageId?` stage ${d.stageId}`:"";c.push({pipeline:d,reason:`pipeline ${d.id}${a} runs a turn the registry reports ${e.lifecycle} (${e.reason})`})}}return c}(a),l=function(a){let b=[];for(let c of a.children){if(!F(c))continue;let a=c.activity;a&&("stalled"===a.lifecycle||"gone"===a.lifecycle)&&b.push({child:c,reason:`child ${c.conversationId} runs a turn the registry reports ${a.lifecycle} (${a.reason})`})}return b}(a),m=[...k.map(a=>a.pipeline.id),...l.map(a=>H(a.child))],n=k.filter(b=>a.state.stalledSeen.includes(b.pipeline.id)),p=l.filter(b=>a.state.stalledSeen.includes(H(b.child))),r=a.children.filter(G).sort((a,b)=>{let c=a=>{let b=a.terminalAt?Date.parse(a.terminalAt):NaN;return Number.isFinite(b)?b:1/0};return c(a)-c(b)||a.conversationId.localeCompare(b.conversationId)}),s=a.children.filter(a=>"unknown"===a.status).length,t=a.tasks.filter(b=>(function(a,b,c){if("assigned"!==a.status||a.owned)return!1;let d=a.updatedAt?Date.parse(a.updatedAt):NaN;return Number.isFinite(d)&&b-d<c})(b,a.now,a.policy.backlogAfterMs)),u=a.tasks.filter(a=>"assigned"===a.status&&!a.owned).length-t.length,v=a.pipelines.some(E)||a.tasks.some(a=>"inbox"===a.status||"assigned"===a.status)||a.pullRequests.length>0||a.children.some(F)||a.children.some(G),w=(b=a.state.lastWakeAt,K(b,a.now,a.settings.wakeIntervalMs)),x={...j,stalledSeen:m};if(!a.settings.enabled)return{verdict:{kind:"quiet",detail:a.settings.reason?`ticking is off for this project: ${a.settings.reason}`:"ticking is off for this project"},state:T(x,h),cards:[]};let y=a.events.filter(I),z=[];if(w){if(y.length>0){let a=y[0],b=y.length>1?` and ${y.length-1} more`:"";z.push({kind:"lane-event",detail:`${a.type} since the last delivered wake${b}`})}if(r.length>0){let a=r[0],b=r.length>1?` and ${r.length-1} more`:"";z.push({kind:"child-terminal",detail:`a spawned child ${a.outcome??"finished"} and its outcome is unharvested${b}`})}if(a.pullRequests.length>0){let b=a.pullRequests[0],c=a.pullRequests.length>1?` and ${a.pullRequests.length-1} more`:"";z.push({kind:"unmerged-pr",detail:`pull request #${b.number}${c} left open by a lane that finished`})}if((n.length>0||p.length>0)&&z.push({kind:"stalled",detail:(n[0]??p[0]).reason}),t.length>0){let a=u>0?`, and ${u} older than the backlog bound the wake no longer names`:"";z.push({kind:"unstarted-task",detail:`${t.length} assigned board task(s) nothing has started${a}`})}let b=a.pipelines.some(E)||a.children.some(F)||a.signals.length>0;v&&b&&0===z.length&&z.push({kind:"interval",detail:"the wake interval elapsed while work is open"})}let A=[],B=[],C=0;for(let b of z){if(c=a.state,d=b.kind,e=a.changeFingerprint,(P(c.lastWakeFingerprint,e)?0:c.wakesWithoutChange[d]??0)>=a.policy.retryGuard){C+=1,A.push({ref:q(b.kind),kind:"retry-guard",detail:`Wakes for "${b.kind}" stopped producing any board or pipeline change; the tick has stopped re-sending it until state moves`});continue}B.push(b)}let D=(f=[],(g=a.pullRequestsUnavailable)&&f.push({source:"pull-requests",gap:g,detail:`the open pull requests of this project's finished lanes could not be read (${g}), so a pull request a finished lane left unmerged cannot be named in this wake`}),a.childrenUnavailable&&f.push({source:"children",gap:a.childrenUnavailable,detail:`the seat's spawned children could not be read (${a.childrenUnavailable}): ${R(a.childrenUnavailable)}, so a running or finished worker cannot be named in this wake`}),f),L=S(a,"pull-requests");L&&A.push(L.card);let M=S(a,"children");M&&A.push(M.card);let N=L?.gap??null,O=M?.gap??null;if(B.length>0){let b=function(a){let{input:b}=a,c=[];for(let b of a.laneEvents)c.push({kind:"event",id:b.pipelineId??b.type,label:`${b.type}: ${b.summary}`});for(let b of a.harvest)c.push({kind:"child",id:b.conversationId,outcomeId:b.outcomeId,label:`${b.title} — spawned child ${b.outcome??"finished"}, outcome unharvested`});for(let a of b.pullRequests)c.push({kind:"pull-request",id:`#${a.number}`,label:`${a.title} — open pull request from ${a.pipelineTitle}, unmerged since that lane finished`});for(let b of a.stalled)c.push({kind:"pipeline",id:b.pipeline.id,label:`${b.pipeline.title} — ${b.reason}`});for(let b of a.stalledChildren)c.push({kind:"child",id:b.child.conversationId,label:`${b.child.title} — ${b.reason}`});for(let b of a.unstarted)c.push({kind:"task",id:b.id,label:`${b.title} — assigned, nothing started it`});for(let a of b.pipelines)E(a)&&(c.some(b=>b.id===a.id)||c.push({kind:"pipeline",id:a.id,label:`${a.title} — open`}));for(let a of b.children)F(a)&&(c.some(b=>b.id===a.conversationId)||c.push({kind:"child",id:a.outcomeId??a.conversationId,label:`${a.title} — spawned child running`}));for(let a of b.signals)c.push({kind:"signal",id:a.id,label:a.label});return c}({input:a,stalled:n,stalledChildren:p,harvest:r,laneEvents:y,unstarted:t});return{verdict:{kind:"wake",reasons:B,items:b.slice(0,a.policy.itemsPerWake),deferred:Math.max(0,b.length-a.policy.itemsPerWake),gaps:D},state:x,cards:A,reportedSourceGap:N,reportedChildrenGap:O}}if(D.length>0){let a=D[0],b="children"===a.source?"the seat's spawned children":"the open pull requests of this project's finished lanes",c="children"===a.source?`: ${R(a.gap)}`:"";return{verdict:{kind:"error",detail:`${b} could not be read (${a.gap})${c}, so nothing owed is not established`},state:x,cards:A,reportedSourceGap:N,reportedChildrenGap:O}}if(C>0)return{verdict:{kind:"quiet",detail:"every wake reason is held by the retry guard"},state:T(x,h),cards:A};let Q=s>0?`; ${s} spawned child(ren) in an unknown state`:"";if(!v){let b={...T(x,h),idleSince:a.state.idleSince??h};return w&&K(a.state.lastProposalAt,a.now,a.policy.proposalIntervalMs)?{verdict:{kind:"proactive",detail:`no open lane, no unblocked task, and the proposal slot is due${Q}`},state:b,cards:[]}:{verdict:{kind:"quiet",detail:`the board is done and the proposal slot is not due${Q}`},state:b,cards:[]}}return{verdict:{kind:"quiet",detail:`nothing owed${Q}`},state:{...T(x,h),idleSince:null},cards:[]}}(D),cards:[...p.cards,...function(a){let b=a.settings;if(!b.configured)return[];let c={reason:b.reason,until:b.until,setBy:b.setBy,updatedAt:b.updatedAt};return b.isDefault?[{ref:r,kind:"tick-settings",state:"resolved",settings:c,detail:b.lapsed?"the recorded tick setting reached its expiry, so this project is back on the default wake interval":"this project is on the default tick settings"}]:[{ref:r,kind:"tick-settings",state:"open",settings:c,detail:b.enabled?`wakes for this project are set to one every ${Math.round(b.wakeIntervalMs/6e4)} minute(s)`:"ticking is off for this project: no wake will be sent until it is turned back on"}]}(D)]};if(D.settings.lapsed)try{let a;(c.writeSettings??function(a,b,c=ay()){(0,ar.Ol)(c,"seat tick settings are busy",()=>{let d=aC(c);(0,ax.f)(c,{version:1,projects:{...d.projects,[a]:{...b,project:a}}})})})(D.project,(f=D.project,g=D.settings,a=az(f),g.monitorPrompt?{...a,monitorPrompt:g.monitorPrompt,updatedAt:g.updatedAt,setBy:g.setBy}:a))}catch(a){console.error("[seat tick] lapsed settings could not be persisted",a instanceof Error?a.name:"unknown")}let M=L.state;for(let a of L.cards){let b=!1;try{b=x(D.project,a,C)}catch(a){console.error("[seat tick] card write failed",a instanceof Error?a.name:"unknown")}b&&"source-unreadable"===a.kind&&(a.ref===s("pull-requests")&&L.reportedSourceGap&&(M={...M,pullRequestGap:L.reportedSourceGap}),a.ref===s("children")&&L.reportedChildrenGap&&(M={...M,childrenGap:L.reportedChildrenGap}))}let N=null,O=L.verdict,Q=D.children.filter(a=>"terminal"===a.status).map(a=>a.outcomeId??a.conversationId);if(("wake"===O.kind||"proactive"===O.kind)&&D.seat){let a,f,g,o,p=(h=D.project,i=D.seat.seatEpoch,j={fingerprint:D.changeFingerprint,lastWakeAt:D.state.lastWakeAt,monitorPrompt:D.settings.monitorPrompt},a="wake"===O.kind?O.reasons.map(a=>a.kind).sort().join(","):"proposal",`seat-tick:${h}:${i}:${j.lastWakeAt??"first"}:${a}:${j.fingerprint}`+((m=j.monitorPrompt)?`:prompt-${e().createHash("sha256").update(m).digest("hex").slice(0,16)}`:"")),q="wake"===O.kind?(k={project:D.project,reasons:O.reasons,items:O.items,deferred:O.deferred,signals:D.signals,gaps:O.gaps,monitorPrompt:D.settings.monitorPrompt},f=[`Seat tick — ${k.project}.`,"","Why you were woken:",...k.reasons.map(a=>`- ${a.kind}: ${a.detail}`)],k.gaps&&k.gaps.length>0&&f.push("","Evidence unavailable:",...k.gaps.map(a=>`- ${a.source}: ${a.detail}.`)),f.push("","Items:",...k.items.map(av)),k.deferred>0&&f.push(`(${k.deferred} more item(s) held back for the next wake.)`),k.signals.length>0&&f.push("","Signals:",...k.signals.map(a=>`- ${a.label}`)),at(f,[...aw(k.monitorPrompt),"","Contract:",...au.map(a=>`- ${a}`)])):(l={project:D.project,issues:await (c.proposalIssues??bN)(D.project,t),signals:D.signals,items:b.itemsPerWake,slot:String(Math.floor(D.now/b.proposalIntervalMs)),monitorPrompt:D.settings.monitorPrompt},g=[`Seat tick — ${l.project}. No lane is open and no board task is waiting, and the proposal slot is due.`,"","Open issues:",...l.issues.length>0?l.issues.map(a=>`- #${a.number} ${a.title}${a.labels.length>0?` [${a.labels.join(", ")}]`:""}`):["- (none readable; rank from the board and the signals below)"]],l.signals.length>0&&g.push("","Signals:",...l.signals.map(a=>`- ${a.label}`)),at(g,["",`Produce ONE ranked list of at most ${l.items} actions, each with the evidence behind it, and post it as a single board card in inbox for this project.`,"Rank by what actually matters now: what is blocking, what is cheap and finishes something, what has been waiting longest.",`Put this exact line at the foot of the card so the next tick recognizes it: ${n} ${(o=l.slot,`seat-tick-proposal-${o}`)}`,"Open no GitHub issue and start no pipeline from this — the operator moves a card to assigned when they want it, and the next tick starts it.",...aw(l.monitorPrompt),"","Contract:",...au.map(a=>`- ${a}`)])),r=t.seatFor(D.project).active,s=!r||r.seatEpoch!==D.seat.seatEpoch||r.conversationId!==D.seat.conversationId,u=M.outstandingWake,y=function(a,b){let{fingerprint:c,eventsThrough:d}=b;if("proactive"===a.kind)return{proposal:!0,reasons:[],fingerprint:c,eventsThrough:d,children:[]};if("wake"!==a.kind)return null;let e=new Set(b.terminalChildren??[]),f=a.items.filter(a=>"child"===a.kind&&e.has(a.outcomeId??a.id)).map(a=>a.outcomeId??a.id);return{proposal:!1,reasons:a.reasons.map(a=>a.kind),fingerprint:c,eventsThrough:d,children:f}}(O,{fingerprint:D.changeFingerprint,eventsThrough:D.events.at(-1)?.seq??M.eventsThrough??0,terminalChildren:Q});if(s)N={clientMessageId:p,outcome:"seat-rotated"};else if(null!==u)N={clientMessageId:p,outcome:"deferred-outstanding"};else if(y){let a={clientMessageId:p,conversationId:D.seat.conversationId,seatEpoch:D.seat.seatEpoch,operationId:null,commit:y,text:q,preparedAt:C},b=M.accounting?new ae(M.accounting.filename,D.project):null;if(!b||b.prepare(M,a)){M=b?b.readState():{...M,outstandingWake:a},b||v(D.project,M);let c=t.seatFor(D.project).active;if(c&&c.seatEpoch===a.seatEpoch&&c.conversationId===a.conversationId){let e=b?.beginDispatch(a);b&&(M=b.readState());let f=null;try{if(b&&!e)throw Error("wake dispatch already claimed");f=await w({pid:null,path:c.path??D.seat.path??"",conversationId:c.conversationId,clientMessageId:p,text:q,images:[],origin:{kind:"agent",role:"seat-tick"}}),N={clientMessageId:p,outcome:bJ(f)}}catch{N={clientMessageId:p,outcome:"unreturned"}}if(b&&e&&f&&(b.returnedDispatch(p,e,!f.ok&&!f.operationId&&"started"!==f.actuation&&"verify-first"!==f.resend),M=b.readState()),f&&bI(f)){let a=U(M,y,D.now);b?(b.settle(p,a,"landed"),M=b.readState()):M=a}else f?.operationId&&M.outstandingWake&&(M={...M,outstandingWake:{...M.outstandingWake,operationId:f.operationId}},b?(b.writeState(M),M=b.readState()):v(D.project,M)),M=await bK({project:D.project,state:M,seat:t.seatFor(D.project).active??null,sources:t,appendRecord:d,writeState:v,ensureCard:x,at:C,now:D.now,wakeIntervalMs:D.settings.wakeIntervalMs})}else N={clientMessageId:p,outcome:"seat-rotated"},b?(b.cancelUndispatched(a),M=b.readState()):M={...M,outstandingWake:null}}else{let a=b.readState();a.accounting?.revision!==M.accounting?.revision&&(M=a),N={clientMessageId:p,outcome:a.accounting?.gap?"accounting-blocked":"deferred-outstanding"}}}}v(D.project,M);let V={schemaVersion:1,at:C,project:D.project,seatEpoch:D.seat?.seatEpoch??null,verdict:O.kind,reasons:"wake"===O.kind?O.reasons.map(a=>a.kind):[],items:"wake"===O.kind?O.items.length:0,deferred:"wake"===O.kind?O.deferred:0,eventsThrough:M.eventsThrough??0,delivery:N,detail:"skipped"===O.kind?"the seat's turn is progressing; the tick is dropped, never queued":"wake"===O.kind?[...O.reasons.map(a=>a.detail),...O.gaps.map(a=>a.detail)].join("; "):O.detail};return d(V),V}async function bN(a,b){let c=by(a,b);return c?ao({cwd:c}):[]}async function bO(){try{let{viewerReleaseOwnsTraffic:a}=await Promise.resolve().then(c.bind(c,94972));return a()}catch(a){return console.error("[seat tick] traffic authority is unreadable",a instanceof Error?a.name:"unknown"),!0}}async function bP(a={}){let b=a.sources??br(),c=a.appendRecord??as;if(!await (a.ownsTraffic??bO)()){let a="this release no longer owns viewer traffic, so the seats belong to the promoted one";console.error(`[seat tick] refused: ${a}`);try{c({schemaVersion:1,at:new Date().toISOString(),project:"",seatEpoch:null,verdict:"refused",reasons:[],items:0,deferred:0,eventsThrough:0,delivery:null,detail:`the seat tick sweep was refused and this process's clock stopped: ${a}`})}catch{}return bS(),[]}let d=[];for(let c of function(a){let b=new Set(a.activeSeats().map(ah.ut));for(let c of a.pipelines())bs(c)&&c.project&&b.add((0,ah.ut)(c.project));for(let c of a.tasks())("inbox"===c.status||"assigned"===c.status)&&c.project&&b.add((0,ah.ut)(c.project));return[...b].sort()}(b))try{let e=await bL(c,{...a,sources:b});e&&d.push(e)}catch(a){console.error("[seat tick] check could not be journaled",a instanceof Error?a.name:"unknown")}return d}let bQ=globalThis;function bR(a={}){let b=a.log??(a=>console.error(a));if(bQ.__llvSeatTickTimer){let c="this process already holds the seat tick — exactly one ticker per seat";b(`[seat tick] refused: ${c}`);try{(a.appendRecord??as)({schemaVersion:1,at:new Date().toISOString(),project:"",seatEpoch:null,verdict:"refused",reasons:[],items:0,deferred:0,eventsThrough:0,delivery:null,detail:`a second seat tick start was refused: ${c}`})}catch{}return!1}let c=void 0===a.policy?D():a.policy;if(!c)return b("[seat tick] not started: LLV_SEAT_TICK_CHECK_MINUTES=0 turns the tick off"),!1;let d=a.scheduleInterval??((a,b)=>setInterval(a,b)),e=a.sweep??(()=>bP()),f=d(()=>{bQ.__llvSeatTickRunning||(bQ.__llvSeatTickRunning=!0,Promise.resolve(e()).catch(a=>console.error("[seat tick] sweep failed",a instanceof Error?a.name:"unknown")).finally(()=>{bQ.__llvSeatTickRunning=!1}))},c.checkIntervalMs);return f.unref?.(),bQ.__llvSeatTickTimer=f,!0}function bS(){let a=bQ.__llvSeatTickTimer;a&&clearInterval(a),bQ.__llvSeatTickTimer=void 0,bQ.__llvSeatTickRunning=!1}},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,{Gh:()=>l,JL:()=>i,OV:()=>n,RC:()=>k,c7:()=>d,cC:()=>j,fC:()=>f,g9:()=>q,ll:()=>p,wi:()=>r});let d="gpt-6-astra",e="gpt-5.6-sol",f="gpt-5.6-terra",g="gpt-5.6-luna",h=new Set([d,e,f,g,"gpt-5.5","gpt-5.4","gpt-5.4-mini"]);function i(a){return!a?.trim()||h.has(a.trim())}let j={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-6-Astra",shortLabel:"6-Astra",use:"review"},{id:e,label:"GPT-5.6-Sol",shortLabel:"5.6-Sol",use:"review"},{id:f,label:"GPT-5.6-Terra",shortLabel:"5.6-Terra",use:"implement"},{id:g,label:"GPT-5.6-Luna",shortLabel:"5.6-Luna",use:"general"}]};function k(a,b){let c=b.trim(),d=j[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(", ")}`}}function l(a){return"codex"===a?d:"opus"}let m=["fable","opus","sonnet","haiku"];function n(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 m)if(b===a||RegExp(`(?:^|[-_.])${a}(?:[-_.]|$)`).test(b))return a;return null}let o=new Set(["fable","opus"]);function p(a){let b=n(a);return null===b||o.has(b)}function q(a){if("string"!=typeof a)return!1;let b=a.trim();return b.startsWith("gpt-")&&b.length<=128&&!/[\u0000-\u001f\u007f]/.test(b)}function r(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
|
|
47
|
-
import io
|
|
48
|
-
import os
|
|
49
|
-
import stat
|
|
50
|
-
import sys
|
|
51
|
-
import threading
|
|
52
|
-
|
|
53
|
-
try:
|
|
54
|
-
_path = os.environ["LLV_TELEGRAM_CONNECTOR_LOG"]
|
|
55
|
-
_limit = int(os.environ["LLV_TELEGRAM_CONNECTOR_LOG_MAX_BYTES"])
|
|
56
|
-
if _limit <= 0:
|
|
57
|
-
raise ValueError("invalid log limit")
|
|
58
|
-
_flags = os.O_RDWR | os.O_CREAT | os.O_APPEND
|
|
59
|
-
if hasattr(os, "O_NOFOLLOW"):
|
|
60
|
-
_flags |= os.O_NOFOLLOW
|
|
61
|
-
_fd = os.open(_path, _flags, 0o600)
|
|
62
|
-
_info = os.fstat(_fd)
|
|
63
|
-
if not stat.S_ISREG(_info.st_mode) or (_info.st_mode & 0o077):
|
|
64
|
-
raise PermissionError("unsafe connector log")
|
|
65
|
-
if hasattr(os, "getuid") and _info.st_uid != os.getuid():
|
|
66
|
-
raise PermissionError("connector log owner mismatch")
|
|
67
|
-
except Exception as _error:
|
|
68
|
-
raise SystemExit("connector log sink unavailable") from _error
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
def _write_all(data):
|
|
72
|
-
view = memoryview(data)
|
|
73
|
-
while view:
|
|
74
|
-
written = os.write(_fd, view)
|
|
75
|
-
view = view[written:]
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
class _BoundedConnectorLog(io.TextIOBase):
|
|
79
|
-
encoding = "utf-8"
|
|
80
|
-
errors = "backslashreplace"
|
|
81
|
-
|
|
82
|
-
def __init__(self):
|
|
83
|
-
self._lock = threading.Lock()
|
|
84
|
-
|
|
85
|
-
def writable(self):
|
|
86
|
-
return True
|
|
87
|
-
|
|
88
|
-
def isatty(self):
|
|
89
|
-
return False
|
|
90
|
-
|
|
91
|
-
def fileno(self):
|
|
92
|
-
return _fd
|
|
93
|
-
|
|
94
|
-
def flush(self):
|
|
95
|
-
return None
|
|
96
|
-
|
|
97
|
-
def write(self, value):
|
|
98
|
-
if not isinstance(value, str):
|
|
99
|
-
value = str(value)
|
|
100
|
-
data = value.encode(self.encoding, self.errors)
|
|
101
|
-
if not data:
|
|
102
|
-
return len(value)
|
|
103
|
-
with self._lock:
|
|
104
|
-
fcntl.flock(_fd, fcntl.LOCK_EX)
|
|
105
|
-
try:
|
|
106
|
-
size = os.fstat(_fd).st_size
|
|
107
|
-
if len(data) >= _limit:
|
|
108
|
-
tail = data[-_limit:]
|
|
109
|
-
os.ftruncate(_fd, 0)
|
|
110
|
-
_write_all(tail)
|
|
111
|
-
elif size + len(data) > _limit:
|
|
112
|
-
keep = _limit - len(data)
|
|
113
|
-
prior = os.pread(_fd, keep, max(0, size - keep))
|
|
114
|
-
os.ftruncate(_fd, 0)
|
|
115
|
-
_write_all(prior[-keep:] + data)
|
|
116
|
-
else:
|
|
117
|
-
_write_all(data)
|
|
118
|
-
finally:
|
|
119
|
-
fcntl.flock(_fd, fcntl.LOCK_UN)
|
|
120
|
-
return len(value)
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
_sink = _BoundedConnectorLog()
|
|
124
|
-
sys.stdout = _sink
|
|
125
|
-
sys.stderr = _sink
|
|
126
|
-
`;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)}}}};
|