@ours.network/fleet 1.2.0-nightly.7 → 1.2.0-nightly.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +279 -68
- package/dist/account-origin.d.ts +2 -0
- package/dist/account-origin.js +6 -0
- package/dist/agent-ours/bridge.js +26 -9
- package/dist/agent-ours/correspondence.d.ts +10 -0
- package/dist/agent-ours/correspondence.js +1 -0
- package/dist/agent-ours/file-rpc.d.ts +12 -0
- package/dist/agent-ours/file-rpc.js +18 -4
- package/dist/agent-ours/harness.js +9 -1
- package/dist/agent-ours/mcp-endpoint.d.ts +19 -0
- package/dist/agent-ours/mcp-endpoint.js +98 -25
- package/dist/agent-ours/runtime.d.ts +9 -1
- package/dist/agent-ours/runtime.js +50 -2
- package/dist/agent-ours/service.d.ts +24 -1
- package/dist/agent-ours/service.js +97 -13
- package/dist/application/codex-models.d.ts +15 -0
- package/dist/application/codex-models.js +56 -0
- package/dist/application/conversation-history.d.ts +27 -0
- package/dist/application/conversation-history.js +215 -0
- package/dist/application/conversation-role-observer.d.ts +62 -0
- package/dist/application/conversation-role-observer.js +206 -0
- package/dist/application/fleet-query-service.d.ts +1 -1
- package/dist/application/fleet-query-service.js +2 -2
- package/dist/application/log-service.js +8 -8
- package/dist/application/model-catalog.d.ts +1 -1
- package/dist/application/model-catalog.js +5 -2
- package/dist/application/preset-provenance.d.ts +19 -0
- package/dist/application/preset-provenance.js +59 -0
- package/dist/application/role-creation-service.js +3 -2
- package/dist/application/role-removal-service.js +17 -3
- package/dist/application/role-repository.js +19 -2
- package/dist/application/room-layout-definitions.d.ts +45 -0
- package/dist/application/room-layout-definitions.js +130 -0
- package/dist/application/session-control.d.ts +61 -17
- package/dist/application/session-control.js +207 -23
- package/dist/application/supervisor-ours-tools.js +5 -11
- package/dist/application/task-layouts.d.ts +91 -0
- package/dist/application/task-layouts.js +259 -0
- package/dist/application/task-room-service.d.ts +99 -3
- package/dist/application/task-room-service.js +285 -32
- package/dist/application/types.d.ts +2 -0
- package/dist/atomic-file.d.ts +34 -1
- package/dist/atomic-file.js +161 -18
- package/dist/briefing.d.ts +3 -1
- package/dist/briefing.js +97 -31
- package/dist/build-info.json +9 -4
- package/dist/capabilities.d.ts +9 -1
- package/dist/capabilities.js +13 -0
- package/dist/cli.js +400 -37
- package/dist/client-profile.d.ts +5 -17
- package/dist/client-profile.js +4 -127
- package/dist/config.d.ts +45 -0
- package/dist/config.js +57 -6
- package/dist/creation.d.ts +1 -1
- package/dist/creation.js +4 -4
- package/dist/daemon-recovery.d.ts +1 -8
- package/dist/daemon-recovery.js +8 -113
- package/dist/docs.d.ts +1 -1
- package/dist/docs.js +207 -19
- package/dist/doctor.d.ts +4 -1
- package/dist/doctor.js +75 -60
- package/dist/erased-resources.d.ts +9 -0
- package/dist/erased-resources.js +87 -0
- package/dist/file-delivery/reader.d.ts +15 -0
- package/dist/file-delivery/reader.js +63 -0
- package/dist/file-delivery/store.d.ts +15 -0
- package/dist/file-delivery/store.js +124 -0
- package/dist/file-delivery/types.d.ts +19 -0
- package/dist/file-delivery/types.js +1 -0
- package/dist/fleet-command-audit.d.ts +7 -0
- package/dist/fleet-command-audit.js +24 -8
- package/dist/harness/agent-session.d.ts +4 -0
- package/dist/harness/claude-code-session.js +1 -1
- package/dist/harness/claude-code.js +21 -11
- package/dist/harness/claude-runtime.d.ts +12 -0
- package/dist/harness/claude-runtime.js +43 -0
- package/dist/harness/codex-app-server-proxy.d.ts +4 -1
- package/dist/harness/codex-app-server-proxy.js +41 -5
- package/dist/harness/codex-reasoning.d.ts +5 -0
- package/dist/harness/codex-reasoning.js +12 -0
- package/dist/harness/codex-runtime.d.ts +11 -1
- package/dist/harness/codex-runtime.js +31 -4
- package/dist/harness/codex-session.js +2 -2
- package/dist/harness/codex.js +24 -12
- package/dist/init-wizard.d.ts +2 -0
- package/dist/init-wizard.js +38 -19
- package/dist/isolation/policy.js +6 -1
- package/dist/isolation/types.d.ts +5 -0
- package/dist/managed-cli.d.ts +253 -0
- package/dist/managed-cli.js +923 -0
- package/dist/managed-recovery.d.ts +13 -0
- package/dist/managed-recovery.js +31 -0
- package/dist/minimal-setup.d.ts +2 -0
- package/dist/minimal-setup.js +44 -0
- package/dist/monitor.d.ts +8 -34
- package/dist/monitor.js +89 -152
- package/dist/notifications/fleet-producer.d.ts +19 -0
- package/dist/notifications/fleet-producer.js +208 -0
- package/dist/notifications/outbox.d.ts +46 -0
- package/dist/notifications/outbox.js +158 -0
- package/dist/notifications/target-cleanup.d.ts +10 -0
- package/dist/notifications/target-cleanup.js +63 -0
- package/dist/notifications/task-producer.d.ts +18 -0
- package/dist/notifications/task-producer.js +67 -0
- package/dist/ops.d.ts +2 -0
- package/dist/ops.js +20 -3
- package/dist/owner-channel/channel.js +17 -6
- package/dist/owner-channel/commands.d.ts +4 -0
- package/dist/owner-channel/commands.js +8 -0
- package/dist/owner-channel/lifecycle-outbox.js +4 -3
- package/dist/owner-channel/ours-client.js +2 -17
- package/dist/paths.d.ts +2 -0
- package/dist/paths.js +2 -0
- package/dist/preset-migration.js +43 -0
- package/dist/process-incarnation.d.ts +23 -0
- package/dist/process-incarnation.js +42 -0
- package/dist/reminders/manager.d.ts +75 -0
- package/dist/reminders/manager.js +278 -0
- package/dist/reminders/runtime.d.ts +27 -0
- package/dist/reminders/runtime.js +32 -0
- package/dist/reminders/schedule.d.ts +37 -0
- package/dist/reminders/schedule.js +104 -0
- package/dist/reminders/store.d.ts +341 -0
- package/dist/reminders/store.js +762 -0
- package/dist/reminders/tools.d.ts +20 -0
- package/dist/reminders/tools.js +114 -0
- package/dist/resolved-plan.js +1 -0
- package/dist/rooms-tasks/add-member.d.ts +48 -0
- package/dist/rooms-tasks/add-member.js +83 -0
- package/dist/rooms-tasks/archived-absence.d.ts +8 -0
- package/dist/rooms-tasks/archived-absence.js +48 -0
- package/dist/rooms-tasks/cli.js +65 -5
- package/dist/rooms-tasks/close.d.ts +6 -2
- package/dist/rooms-tasks/close.js +246 -37
- package/dist/rooms-tasks/config.d.ts +1 -1
- package/dist/rooms-tasks/config.js +11 -4
- package/dist/rooms-tasks/cowork-adapter.d.ts +12 -5
- package/dist/rooms-tasks/cowork-adapter.js +15 -121
- package/dist/rooms-tasks/cowork-http.js +56 -6
- package/dist/rooms-tasks/deletion.d.ts +1 -1
- package/dist/rooms-tasks/deletion.js +84 -5
- package/dist/rooms-tasks/erasure.d.ts +6 -0
- package/dist/rooms-tasks/erasure.js +173 -0
- package/dist/rooms-tasks/external-worker.d.ts +1 -1
- package/dist/rooms-tasks/external-worker.js +3 -4
- package/dist/rooms-tasks/layout-binding-client.d.ts +11 -0
- package/dist/rooms-tasks/layout-binding-client.js +56 -0
- package/dist/rooms-tasks/layout-binding-grants.d.ts +21 -0
- package/dist/rooms-tasks/layout-binding-grants.js +128 -0
- package/dist/rooms-tasks/layout-cli.d.ts +4 -0
- package/dist/rooms-tasks/layout-cli.js +107 -0
- package/dist/rooms-tasks/layout-config.d.ts +11 -0
- package/dist/rooms-tasks/layout-config.js +89 -0
- package/dist/rooms-tasks/layout-control.d.ts +21 -0
- package/dist/rooms-tasks/layout-control.js +52 -0
- package/dist/rooms-tasks/layout-member-retirement.d.ts +10 -0
- package/dist/rooms-tasks/layout-member-retirement.js +90 -0
- package/dist/rooms-tasks/layout-service.d.ts +43 -0
- package/dist/rooms-tasks/layout-service.js +203 -0
- package/dist/rooms-tasks/layout.d.ts +121 -0
- package/dist/rooms-tasks/layout.js +285 -0
- package/dist/rooms-tasks/legacy-task-member.d.ts +19 -0
- package/dist/rooms-tasks/legacy-task-member.js +116 -0
- package/dist/rooms-tasks/live-readiness.d.ts +18 -0
- package/dist/rooms-tasks/live-readiness.js +85 -0
- package/dist/rooms-tasks/member-ownership.d.ts +5 -0
- package/dist/rooms-tasks/member-ownership.js +40 -0
- package/dist/rooms-tasks/member-startup.d.ts +1 -0
- package/dist/rooms-tasks/member-startup.js +2 -0
- package/dist/rooms-tasks/provision.d.ts +3 -0
- package/dist/rooms-tasks/provision.js +101 -49
- package/dist/rooms-tasks/recovery.d.ts +19 -0
- package/dist/rooms-tasks/recovery.js +110 -0
- package/dist/rooms-tasks/room-state.d.ts +4 -2
- package/dist/rooms-tasks/room-state.js +47 -8
- package/dist/rooms-tasks/task-service-retirement.d.ts +11 -0
- package/dist/rooms-tasks/task-service-retirement.js +21 -0
- package/dist/rooms-tasks/task-state.d.ts +51 -8
- package/dist/rooms-tasks/task-state.js +245 -25
- package/dist/rooms-tasks/types.d.ts +40 -0
- package/dist/rooms-tasks/workspace-artifacts.d.ts +6 -0
- package/dist/rooms-tasks/workspace-artifacts.js +93 -0
- package/dist/rooms-tasks/workspace.d.ts +35 -0
- package/dist/rooms-tasks/workspace.js +325 -0
- package/dist/runner.d.ts +33 -4
- package/dist/runner.js +389 -56
- package/dist/session/acp.d.ts +75 -2
- package/dist/session/acp.js +345 -82
- package/dist/session/arbiter.d.ts +98 -0
- package/dist/session/arbiter.js +272 -3
- package/dist/session/codex-app-server.d.ts +45 -1
- package/dist/session/codex-app-server.js +225 -32
- package/dist/session/control.d.ts +17 -3
- package/dist/session/control.js +213 -23
- package/dist/session/conversation-normalizer.d.ts +2 -1
- package/dist/session/conversation-normalizer.js +1 -1
- package/dist/session/conversation-observation.d.ts +25 -0
- package/dist/session/conversation-observation.js +100 -0
- package/dist/session/conversation-replay.d.ts +50 -0
- package/dist/session/conversation-replay.js +203 -0
- package/dist/session/conversation-store.d.ts +15 -1
- package/dist/session/conversation-store.js +206 -26
- package/dist/session/conversation-types.d.ts +57 -4
- package/dist/session/prompt-batch.d.ts +79 -0
- package/dist/session/prompt-batch.js +120 -0
- package/dist/session/task-notice.d.ts +14 -0
- package/dist/session/task-notice.js +13 -0
- package/dist/session/types.d.ts +42 -1
- package/dist/setup-tunnel-preflight.d.ts +34 -0
- package/dist/setup-tunnel-preflight.js +62 -0
- package/dist/socket-path.d.ts +2 -0
- package/dist/socket-path.js +22 -0
- package/dist/spawn.d.ts +5 -1
- package/dist/spawn.js +40 -4
- package/dist/startup-prompt.d.ts +15 -0
- package/dist/startup-prompt.js +71 -0
- package/dist/startup-readiness.d.ts +32 -0
- package/dist/startup-readiness.js +101 -0
- package/dist/startup-telemetry.d.ts +16 -0
- package/dist/startup-telemetry.js +46 -0
- package/dist/subscriptions/cli.d.ts +91 -0
- package/dist/subscriptions/cli.js +223 -0
- package/dist/subscriptions/launch.d.ts +37 -0
- package/dist/subscriptions/launch.js +93 -0
- package/dist/subscriptions/login.d.ts +76 -0
- package/dist/subscriptions/login.js +207 -0
- package/dist/subscriptions/observed.d.ts +7 -0
- package/dist/subscriptions/observed.js +44 -0
- package/dist/subscriptions/probe.d.ts +10 -0
- package/dist/subscriptions/probe.js +73 -0
- package/dist/subscriptions/service.d.ts +102 -0
- package/dist/subscriptions/service.js +364 -0
- package/dist/subscriptions/store.d.ts +71 -0
- package/dist/subscriptions/store.js +140 -0
- package/dist/supervisor/adoption.d.ts +8 -0
- package/dist/supervisor/adoption.js +78 -0
- package/dist/supervisor/catalog.d.ts +62 -0
- package/dist/supervisor/catalog.js +254 -0
- package/dist/supervisor/fleet.d.ts +8 -0
- package/dist/supervisor/fleet.js +89 -0
- package/dist/supervisor/index.js +3 -6
- package/dist/supervisor/launchd.d.ts +1 -1
- package/dist/supervisor/launchd.js +26 -13
- package/dist/supervisor/legacy.d.ts +35 -0
- package/dist/supervisor/legacy.js +524 -0
- package/dist/supervisor/manager.d.ts +15 -0
- package/dist/supervisor/manager.js +270 -0
- package/dist/supervisor/registration-refresh.d.ts +45 -0
- package/dist/supervisor/registration-refresh.js +266 -0
- package/dist/supervisor/scope.d.ts +4 -0
- package/dist/supervisor/scope.js +10 -0
- package/dist/supervisor/systemd.d.ts +2 -2
- package/dist/supervisor/systemd.js +19 -33
- package/dist/task-supervision.d.ts +9 -0
- package/dist/task-supervision.js +145 -0
- package/dist/temp-idle.d.ts +17 -0
- package/dist/temp-idle.js +42 -0
- package/dist/temp-lifecycle.d.ts +23 -8
- package/dist/temp-lifecycle.js +123 -66
- package/dist/temp-supervisor-recovery.d.ts +1 -1
- package/dist/temp-supervisor-recovery.js +2 -2
- package/dist/tunnel-setup-completion.d.ts +7 -0
- package/dist/tunnel-setup-completion.js +13 -0
- package/dist/tunnel-setup-input.d.ts +19 -0
- package/dist/tunnel-setup-input.js +124 -0
- package/dist/web/agent-attachments.d.ts +29 -0
- package/dist/web/agent-attachments.js +162 -0
- package/dist/web/auth.d.ts +65 -2
- package/dist/web/auth.js +201 -11
- package/dist/web/available-port.d.ts +2 -0
- package/dist/web/available-port.js +23 -0
- package/dist/web/control.d.ts +3 -3
- package/dist/web/control.js +10 -8
- package/dist/web/conversation-stream-codec.d.ts +23 -0
- package/dist/web/conversation-stream-codec.js +110 -0
- package/dist/web/conversation-stream.d.ts +25 -0
- package/dist/web/conversation-stream.js +231 -0
- package/dist/web/fleet-config-service.d.ts +4 -1
- package/dist/web/fleet-config-service.js +46 -15
- package/dist/web/prefix-gateway.d.ts +32 -0
- package/dist/web/prefix-gateway.js +238 -0
- package/dist/web/runtime.d.ts +3 -1
- package/dist/web/runtime.js +128 -33
- package/dist/web/server.d.ts +16 -0
- package/dist/web/server.js +639 -55
- package/dist/web/service.d.ts +11 -2
- package/dist/web/service.js +30 -4
- package/dist/web/workspace-devices.d.ts +107 -0
- package/dist/web/workspace-devices.js +277 -0
- package/dist/web/workspace-tunnel.d.ts +1 -0
- package/dist/web/workspace-tunnel.js +34 -0
- package/dist/workspace-enrollment.d.ts +83 -0
- package/dist/workspace-enrollment.js +580 -0
- package/dist/workspace-replacement.d.ts +66 -0
- package/dist/workspace-replacement.js +220 -0
- package/docs/acp-files.md +146 -0
- package/docs/conversation-stream.md +190 -0
- package/docs/fleet-migration.md +54 -0
- package/docs/live-voice.md +13 -0
- package/docs/room-layouts.md +227 -0
- package/docs/self-reminders.md +374 -0
- package/docs/task-workspaces.md +225 -0
- package/docs/validation/managed-cli-permissions.md +421 -0
- package/examples/room-layouts/fresh.yaml +27 -0
- package/examples/room-layouts/scoped.yaml +21 -0
- package/examples/room-layouts/shared.yaml +19 -0
- package/package.json +24 -20
- package/presets/README.md +78 -0
- package/presets/brain-catalog.json +8 -2
- package/presets/fleet/agent_templates/Critic.yaml +1 -1
- package/presets/fleet/agent_templates/Developer.yaml +1 -1
- package/presets/fleet/agent_templates/Engineer.yaml +5 -0
- package/presets/fleet/agent_templates/LocalCoordinator.yaml +4 -2
- package/presets/fleet/agents/FleetCoordinator.yaml +1 -1
- package/presets/fleet/brains/claude-fable-5-1-high.yaml +5 -0
- package/presets/fleet/brains/claude-fable-5-1-low.yaml +5 -0
- package/presets/fleet/brains/claude-fable-5-1-max.yaml +5 -0
- package/presets/fleet/brains/claude-fable-5-1-medium.yaml +5 -0
- package/presets/fleet/brains/claude-fable-5-1-xhigh.yaml +5 -0
- package/presets/fleet/brains/claude-fable-5-high.yaml +1 -1
- package/presets/fleet/brains/claude-fable-5-low.yaml +1 -1
- package/presets/fleet/brains/claude-fable-5-max.yaml +1 -1
- package/presets/fleet/brains/claude-fable-5-medium.yaml +1 -1
- package/presets/fleet/brains/claude-fable-5-xhigh.yaml +1 -1
- package/presets/fleet/brains/claude-haiku-4-5-20251001-default.yaml +4 -0
- package/presets/fleet/brains/claude-opus-5-5-high.yaml +5 -0
- package/presets/fleet/brains/claude-opus-5-5-low.yaml +5 -0
- package/presets/fleet/brains/claude-opus-5-5-max.yaml +5 -0
- package/presets/fleet/brains/claude-opus-5-5-medium.yaml +5 -0
- package/presets/fleet/brains/claude-opus-5-5-xhigh.yaml +5 -0
- package/presets/fleet/brains/claude-opus-5-high.yaml +1 -1
- package/presets/fleet/brains/claude-opus-5-low.yaml +1 -1
- package/presets/fleet/brains/claude-opus-5-max.yaml +1 -1
- package/presets/fleet/brains/claude-opus-5-medium.yaml +1 -1
- package/presets/fleet/brains/claude-opus-5-xhigh.yaml +1 -1
- package/presets/fleet/brains/claude-sonnet-5-high.yaml +1 -1
- package/presets/fleet/brains/claude-sonnet-5-low.yaml +1 -1
- package/presets/fleet/brains/claude-sonnet-5-max.yaml +1 -1
- package/presets/fleet/brains/claude-sonnet-5-medium.yaml +1 -1
- package/presets/fleet/brains/claude-sonnet-5-xhigh.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-3-codex-spark-high.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-3-codex-spark-low.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-3-codex-spark-medium.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-3-codex-spark-xhigh.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-4-high.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-4-low.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-4-medium.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-4-mini-high.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-4-mini-low.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-4-mini-medium.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-4-mini-xhigh.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-4-xhigh.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-5-high.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-5-low.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-5-medium.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-5-xhigh.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-luna-high.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-luna-low.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-luna-max.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-luna-medium.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-luna-xhigh.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-sol-high.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-sol-low.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-sol-max.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-sol-medium.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-sol-ultra.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-sol-xhigh.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-terra-high.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-terra-low.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-terra-max.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-terra-medium.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-terra-ultra.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-5-6-terra-xhigh.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-6-1-sol-high.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-1-sol-low.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-1-sol-max.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-1-sol-medium.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-1-sol-ultra.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-1-sol-xhigh.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-astra-high.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-6-astra-low.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-6-astra-max.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-6-astra-medium.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-6-astra-ultra.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-6-astra-xhigh.yaml +1 -1
- package/presets/fleet/brains/codex-gpt-6-luna-high.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-luna-low.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-luna-max.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-luna-medium.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-luna-xhigh.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-sol-high.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-sol-low.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-sol-max.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-sol-medium.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-sol-ultra.yaml +5 -0
- package/presets/fleet/brains/codex-gpt-6-sol-xhigh.yaml +5 -0
- package/presets/fleet/roles/Coordinator.yaml +12 -11
- package/presets/fleet/roles/Critic.yaml +13 -0
- package/presets/fleet/roles/Developer.yaml +13 -0
- package/presets/fleet/roles/Engineer.yaml +53 -0
- package/presets/fleet/room_layouts/engineering.yaml +25 -0
- package/presets/fleet/room_layouts/pair.yaml +24 -0
- package/presets/fleet/room_layouts/single.yaml +17 -0
- package/presets/fleet/room_layouts/team.yaml +30 -0
- package/presets/fleet/room_templates/engineering.yaml +19 -0
- package/presets/manifest.json +2 -2
- package/dist/web-app/assets/index-59GF-gsZ.css +0 -1
- package/dist/web-app/assets/index-C0h3ALvs.js +0 -10
- package/dist/web-app/icons/ours-fleet-maskable.svg +0 -4
- package/dist/web-app/icons/ours-fleet.svg +0 -4
- package/dist/web-app/index.html +0 -17
- package/dist/web-app/manifest.webmanifest +0 -15
- package/dist/web-app/offline.html +0 -18
- package/dist/web-app/sw.js +0 -51
package/dist/spawn.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { taskSupervisorMayRun } from './task-supervision.js';
|
|
1
2
|
import { randomUUID } from 'node:crypto';
|
|
2
3
|
import { storeRoomSecret, storeTemporaryLaunch, preparePermanentAssignment } from './agent-ours/service.js';
|
|
4
|
+
import { ensureWorkspace } from './rooms-tasks/workspace.js';
|
|
3
5
|
import { spawn as spawnChild } from 'node:child_process';
|
|
4
6
|
import { closeSync, existsSync, lstatSync, mkdirSync, openSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
5
7
|
import { join } from 'node:path';
|
|
@@ -15,7 +17,8 @@ import { recordGeneratedAgentSource } from './generated-agent-source.js';
|
|
|
15
17
|
import './harness/claude-code.js';
|
|
16
18
|
import './harness/codex.js';
|
|
17
19
|
import './harness/hermes.js';
|
|
18
|
-
import {
|
|
20
|
+
import { getAdapter } from './harness/registry.js';
|
|
21
|
+
import { archiveTempState, makeTempSupervisorLauncher, prepareTempSupervisor, reclaimStaleTempState, stopTempSupervisor, secureStoppedTempArchive, readTempSupervisor, requestedTempStopReason, } from './temp-lifecycle.js';
|
|
19
22
|
/**
|
|
20
23
|
* The provenance record written by the most recent spawn in this process, so
|
|
21
24
|
* the CLI can print the same summary it persisted rather than rebuilding it.
|
|
@@ -321,6 +324,14 @@ export async function spawnTemp(o, binPath, launch = independentSupervisor, crea
|
|
|
321
324
|
if (o.isolationFile)
|
|
322
325
|
readIsolationFile(o.isolationFile); // fail before reserving
|
|
323
326
|
const prepared = resolvedSpawn(o); // canonical validation before mutation
|
|
327
|
+
if ((o.taskOwner || o.roomMemberStartup?.task_id) && !getAdapter(prepared.role.harness).supportsResume)
|
|
328
|
+
throw Error('TASK_HARNESS_RESUME_UNSUPPORTED: task agents require a resumable harness');
|
|
329
|
+
if (o.roomMemberStartup?.workspace) {
|
|
330
|
+
const workspace = o.roomMemberStartup.workspace;
|
|
331
|
+
if (prepared.role.cwd !== workspace.path)
|
|
332
|
+
throw new Error('room member cwd must equal its recorded owned workspace');
|
|
333
|
+
ensureWorkspace(workspace);
|
|
334
|
+
}
|
|
324
335
|
// Retire only supervisors whose recorded owner is definitively stopped. This
|
|
325
336
|
// bounded pass keeps the active roster clean without deleting old evidence.
|
|
326
337
|
await reclaimStaleTempState();
|
|
@@ -351,7 +362,7 @@ async function spawnTempInner(o, preparedRole, binPath, launch, tx, onStage) {
|
|
|
351
362
|
if (role.roomMemberStartup)
|
|
352
363
|
role.roomMemberStartup = { ...role.roomMemberStartup, invite: '' };
|
|
353
364
|
onStage?.('writing_role');
|
|
354
|
-
const dir = applyRole(role, { temp: true, identityGuarantee: 'unverified' });
|
|
365
|
+
const dir = applyRole(role, { temp: true, identityGuarantee: 'unverified', configPath: o.configPath });
|
|
355
366
|
const provenance = buildProvenance({
|
|
356
367
|
role: o.name, lifetime: 'temporary', fleetVersion: VERSION,
|
|
357
368
|
settings: provenanceSettings(o, cfg.defaults, preparedRole.temporaryLoops),
|
|
@@ -361,7 +372,14 @@ async function spawnTempInner(o, preparedRole, binPath, launch, tx, onStage) {
|
|
|
361
372
|
lastProvenance = provenance;
|
|
362
373
|
tx.record({
|
|
363
374
|
stage: `temp state dir ${dir}`,
|
|
364
|
-
undo: () => {
|
|
375
|
+
undo: async () => {
|
|
376
|
+
if (o.taskOwner || role.roomMemberStartup?.task_id) {
|
|
377
|
+
await stopTempSupervisor(o.name);
|
|
378
|
+
const supervisor = readTempSupervisor(dir);
|
|
379
|
+
if (supervisor)
|
|
380
|
+
await secureStoppedTempArchive(o.name, supervisor.launchId);
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
365
383
|
// A failed launch is still lifecycle evidence: briefing, provenance,
|
|
366
384
|
// metadata and supervisor output explain what happened. Remove it from
|
|
367
385
|
// the live roster by atomic archive, never recursive deletion.
|
|
@@ -374,7 +392,14 @@ async function spawnTempInner(o, preparedRole, binPath, launch, tx, onStage) {
|
|
|
374
392
|
// out; a lone temp spawn still waits zero (time-based gate).
|
|
375
393
|
if (cfg.startStaggerMs > 0)
|
|
376
394
|
writeFileSync(join(dir, START_STAGGER_FILE), String(cfg.startStaggerMs));
|
|
377
|
-
prepareTempSupervisor(dir, o.name
|
|
395
|
+
prepareTempSupervisor(dir, o.name, o.taskOwner ?? (o.roomMemberStartup?.task_id ? {
|
|
396
|
+
taskId: o.roomMemberStartup.task_id,
|
|
397
|
+
roomId: o.roomMemberStartup.room_id,
|
|
398
|
+
roomIdentityCid: o.roomMemberStartup.room_identity_cid,
|
|
399
|
+
creationActionId: o.creationActionId,
|
|
400
|
+
} : undefined));
|
|
401
|
+
if (o.taskOwner || o.roomMemberStartup?.task_id)
|
|
402
|
+
taskSupervisorMayRun(o.name);
|
|
378
403
|
// Run the supervisor independently. On a service-managed host the temp
|
|
379
404
|
// runner gets its own transient unit/job, so stopping the coordinator's unit
|
|
380
405
|
// cannot kill a live worker in the coordinator's cgroup.
|
|
@@ -382,3 +407,14 @@ async function spawnTempInner(o, preparedRole, binPath, launch, tx, onStage) {
|
|
|
382
407
|
await launch(binPath, ['_run-temp', o.name], dir);
|
|
383
408
|
return dir;
|
|
384
409
|
}
|
|
410
|
+
/** Resume the exact durable task launch; no creation, invite issuance or state rotation. */
|
|
411
|
+
export async function resumeTaskSupervisor(name, binPath) {
|
|
412
|
+
if (!taskSupervisorMayRun(name))
|
|
413
|
+
throw Error('TASK_SUPERVISOR_RETIRED');
|
|
414
|
+
const dir = agentDir(name, true);
|
|
415
|
+
if (requestedTempStopReason(dir))
|
|
416
|
+
throw Error('TASK_SUPERVISOR_STOP_REQUESTED');
|
|
417
|
+
const launcher = readTempSupervisor(dir)?.kind === 'detached'
|
|
418
|
+
? makeTempSupervisorLauncher({ spawnDetached, supervisor: 'none' }) : independentSupervisor;
|
|
419
|
+
await launcher(binPath, ['_run-temp', name], dir);
|
|
420
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True when the active worklog records anything. A restart that left no entry
|
|
3
|
+
* has no continuity to restore, so it must not turn into a worklog read.
|
|
4
|
+
*/
|
|
5
|
+
export declare function worklogRecordsPriorWork(stateDir: string): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Readiness is a separate turn after identity/profile and room admission succeed.
|
|
8
|
+
*
|
|
9
|
+
* `fresh` starts a new model conversation, which reads the briefing exactly once;
|
|
10
|
+
* `resume` restores a conversation that already holds it. `hasPriorWork` says the
|
|
11
|
+
* worklog records earlier work — the only case where it is continuity input.
|
|
12
|
+
*/
|
|
13
|
+
export declare function managedStartupPrompt(stateDir: string, mode: 'fresh' | 'resume', hasPriorWork?: boolean): string;
|
|
14
|
+
/** Configured work/continuity runs after readiness, never inside the fast turn. */
|
|
15
|
+
export declare function managedTaskPrompt(stateDir: string, mode: 'fresh' | 'resume', hasPriorWork?: boolean): string;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
/**
|
|
4
|
+
* True when the active worklog records anything. A restart that left no entry
|
|
5
|
+
* has no continuity to restore, so it must not turn into a worklog read.
|
|
6
|
+
*/
|
|
7
|
+
export function worklogRecordsPriorWork(stateDir) {
|
|
8
|
+
const worklog = join(stateDir, 'WORKLOG.md');
|
|
9
|
+
try {
|
|
10
|
+
return existsSync(worklog) && readFileSync(worklog, 'utf8').trim().length > 0;
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Readiness is a separate turn after identity/profile and room admission succeed.
|
|
18
|
+
*
|
|
19
|
+
* `fresh` starts a new model conversation, which reads the briefing exactly once;
|
|
20
|
+
* `resume` restores a conversation that already holds it. `hasPriorWork` says the
|
|
21
|
+
* worklog records earlier work — the only case where it is continuity input.
|
|
22
|
+
*/
|
|
23
|
+
export function managedStartupPrompt(stateDir, mode, hasPriorWork = false) {
|
|
24
|
+
const briefing = join(stateDir, 'briefing.md');
|
|
25
|
+
const worklog = join(stateDir, 'WORKLOG.md');
|
|
26
|
+
const context = mode === 'resume'
|
|
27
|
+
? `This restored conversation already holds ${briefing}; do not read it again unless its content is `
|
|
28
|
+
+ 'genuinely missing from your context. '
|
|
29
|
+
+ (hasPriorWork ? `Consult ${worklog} only as needed to recover your next action. ` : '')
|
|
30
|
+
: `After this readiness turn, read ${briefing} once for this session: in the supervisor's task turn, `
|
|
31
|
+
+ 'or on your first concrete task or wake when no task turn is delivered. Reuse it on every later turn, '
|
|
32
|
+
+ 'task and mail wake without reading it again. '
|
|
33
|
+
+ (hasPriorWork ? `In that same first turn, read ${worklog} once for continuity. ` : '');
|
|
34
|
+
return 'Fleet readiness check. The supervisor has verified your assigned identity, configured Role profile, '
|
|
35
|
+
+ 'and any required room admission. Reply with a short final console acknowledgement that you are ready, '
|
|
36
|
+
+ 'then end this turn. Announce readiness before any tool calls or file reads. '
|
|
37
|
+
+ 'Do not read briefing, routines, worklog, inbox, history, help or config during this readiness turn; '
|
|
38
|
+
+ 'do not perform identity/profile setup or broad tool discovery. Do not claim task work has been done. '
|
|
39
|
+
+ 'The supervisor delivers configured work separately; otherwise wait for a concrete task or supervisor wake. '
|
|
40
|
+
+ context
|
|
41
|
+
+ 'Read routines only for concrete work; an idle launch needs no detail reads. '
|
|
42
|
+
+ 'The supervisor delivers initial unread mail and later arrivals as wakes; do not poll the inbox at startup.';
|
|
43
|
+
}
|
|
44
|
+
/** Configured work/continuity runs after readiness, never inside the fast turn. */
|
|
45
|
+
export function managedTaskPrompt(stateDir, mode, hasPriorWork = false) {
|
|
46
|
+
const briefing = join(stateDir, 'briefing.md');
|
|
47
|
+
const worklog = join(stateDir, 'WORKLOG.md');
|
|
48
|
+
const opening = mode === 'resume'
|
|
49
|
+
? `Your conversation was restored and already holds ${briefing}: follow it for the assigned work `
|
|
50
|
+
+ 'without reading it again. Only if its content is genuinely missing from your context, read it once now. '
|
|
51
|
+
: `Read and follow ${briefing} for the assigned work. This is the one briefing read of this session; `
|
|
52
|
+
+ 'reuse it on later turns, tasks and mail wakes without reading it again. ';
|
|
53
|
+
const continuity = !hasPriorWork
|
|
54
|
+
? 'No previous work is recorded, so do not read a worklog for initialization. '
|
|
55
|
+
: mode === 'resume'
|
|
56
|
+
? `Continue unfinished work from the restored conversation; consult ${worklog} only as needed to `
|
|
57
|
+
+ 'recover your next action. '
|
|
58
|
+
: `Previous work is recorded: read ${worklog} once for continuity. Do not read it again later in `
|
|
59
|
+
+ 'this session, including after you append to it. ';
|
|
60
|
+
return opening
|
|
61
|
+
+ 'Readiness has already been announced; this is a separate task turn, so do not repeat the readiness '
|
|
62
|
+
+ 'acknowledgement. ' + continuity
|
|
63
|
+
+ 'Identify the concrete assignment in the briefing or unfinished work in the continuation log. '
|
|
64
|
+
+ 'A role charter or public bio alone is not a new task. If there is no concrete work, end this turn '
|
|
65
|
+
+ 'and await a task without reading routines, inbox, history, or unrelated files. '
|
|
66
|
+
+ 'For concrete work, read any existing routines once for this session, '
|
|
67
|
+
+ 'acknowledge the actual task and next action through its assigned reply route, and proceed. '
|
|
68
|
+
+ 'Use inbox/history only when a mail wake, unread pagination, or the actual task needs them. '
|
|
69
|
+
+ 'The supervisor delivers initial unread mail; no model-owned startup poll is needed. '
|
|
70
|
+
+ 'Identity/profile setup, help/config exploration and broad tool discovery are not startup rituals.';
|
|
71
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type DaemonGenerationProbe } from './daemon-recovery.js';
|
|
2
|
+
export declare const STARTUP_WAIT_MS = 240000;
|
|
3
|
+
export declare const STARTUP_RETRY_MS = 5000;
|
|
4
|
+
/** Upper bound for one read-only Cowork room probe during the startup wait. */
|
|
5
|
+
export declare const ROOM_PROBE_TIMEOUT_MS = 10000;
|
|
6
|
+
interface ReadinessDeps {
|
|
7
|
+
probe(env: NodeJS.ProcessEnv): Promise<DaemonGenerationProbe>;
|
|
8
|
+
now(): number;
|
|
9
|
+
sleep(ms: number): Promise<void>;
|
|
10
|
+
log(message: string): void;
|
|
11
|
+
env: NodeJS.ProcessEnv;
|
|
12
|
+
}
|
|
13
|
+
/** Read-only preflight: never binds identities, starts a harness or edits its ledger. */
|
|
14
|
+
export declare function waitForRoleDaemon(name: string, configPath?: string, partial?: Partial<ReadinessDeps>, temp?: boolean): Promise<void>;
|
|
15
|
+
interface RoomManagementDeps {
|
|
16
|
+
/** Read-only room observation; production uses Cowork `room.show`. */
|
|
17
|
+
showRoom(roomId: string, env: NodeJS.ProcessEnv, timeoutMs: number): Promise<unknown>;
|
|
18
|
+
now(): number;
|
|
19
|
+
sleep(ms: number): Promise<void>;
|
|
20
|
+
log(message: string): void;
|
|
21
|
+
env: NodeJS.ProcessEnv;
|
|
22
|
+
shouldStop(): boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Read-only preflight for a room member: wait while Cowork management is still
|
|
26
|
+
* starting behind the gateway. Only a retryable `CoworkUnavailableError` waits;
|
|
27
|
+
* success, any other error and the deadline all return so the real attempt
|
|
28
|
+
* decides, fails closed and counts. Never redeems invites, binds identities or
|
|
29
|
+
* judges room/seat identity — that remains the attempt's admission check.
|
|
30
|
+
*/
|
|
31
|
+
export declare function waitForTaskRoomManagement(name: string, partial?: Partial<RoomManagementDeps>): Promise<'ready' | 'not-required' | 'unavailable' | 'deferred'>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { agentDir } from './paths.js';
|
|
2
|
+
import { findRole, loadConfig } from './config.js';
|
|
3
|
+
import { resolveConfigPath, loadTempRole } from './runner.js';
|
|
4
|
+
import { probeDaemonGeneration } from './daemon-recovery.js';
|
|
5
|
+
export const STARTUP_WAIT_MS = 240_000;
|
|
6
|
+
export const STARTUP_RETRY_MS = 5_000;
|
|
7
|
+
/** Upper bound for one read-only Cowork room probe during the startup wait. */
|
|
8
|
+
export const ROOM_PROBE_TIMEOUT_MS = 10_000;
|
|
9
|
+
/** Read-only preflight: never binds identities, starts a harness or edits its ledger. */
|
|
10
|
+
export async function waitForRoleDaemon(name, configPath, partial = {}, temp = false) {
|
|
11
|
+
const deps = {
|
|
12
|
+
probe: env => probeDaemonGeneration(((url, init) => globalThis.fetch(url, {
|
|
13
|
+
...init, signal: AbortSignal.timeout(10_000),
|
|
14
|
+
})), env),
|
|
15
|
+
now: Date.now,
|
|
16
|
+
sleep: ms => new Promise(resolve => setTimeout(resolve, ms)),
|
|
17
|
+
log: message => process.stderr.write(message + '\n'),
|
|
18
|
+
env: process.env,
|
|
19
|
+
...partial,
|
|
20
|
+
};
|
|
21
|
+
const path = resolveConfigPath(agentDir(name), configPath);
|
|
22
|
+
const role = temp ? loadTempRole(name) : findRole(loadConfig(path), name);
|
|
23
|
+
const env = { ...deps.env, ...role.env };
|
|
24
|
+
const deadline = deps.now() + STARTUP_WAIT_MS;
|
|
25
|
+
let lastReason = '';
|
|
26
|
+
while (deps.now() < deadline) {
|
|
27
|
+
const result = await deps.probe(env);
|
|
28
|
+
if (result.state === 'ready') {
|
|
29
|
+
deps.log(`[${name}] daemon ready; starting supervised agent`);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
// Only structured diagnostic codes, never endpoint responses or credentials.
|
|
33
|
+
const reason = /^[A-Z][A-Z0-9_]*$/.test(result.reason) ? result.reason : 'DAEMON_UNAVAILABLE';
|
|
34
|
+
if (reason !== lastReason)
|
|
35
|
+
deps.log(`[${name}] waiting for configured daemon: ${reason}`);
|
|
36
|
+
lastReason = reason;
|
|
37
|
+
await deps.sleep(Math.min(STARTUP_RETRY_MS, Math.max(0, deadline - deps.now())));
|
|
38
|
+
}
|
|
39
|
+
throw new Error(`Daemon not ready (${lastReason}); service manager will retry startup`);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Read-only preflight for a room member: wait while Cowork management is still
|
|
43
|
+
* starting behind the gateway. Only a retryable `CoworkUnavailableError` waits;
|
|
44
|
+
* success, any other error and the deadline all return so the real attempt
|
|
45
|
+
* decides, fails closed and counts. Never redeems invites, binds identities or
|
|
46
|
+
* judges room/seat identity — that remains the attempt's admission check.
|
|
47
|
+
*/
|
|
48
|
+
export async function waitForTaskRoomManagement(name, partial = {}) {
|
|
49
|
+
let role;
|
|
50
|
+
// An unreadable snapshot is the attempt's failure to report, not this wait's.
|
|
51
|
+
try {
|
|
52
|
+
role = loadTempRole(name);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return 'deferred';
|
|
56
|
+
}
|
|
57
|
+
const startup = role.roomMemberStartup;
|
|
58
|
+
if (!startup)
|
|
59
|
+
return 'not-required';
|
|
60
|
+
const { createCoworkAdapter, CoworkUnavailableError } = await import('./rooms-tasks/cowork-adapter.js');
|
|
61
|
+
const deps = {
|
|
62
|
+
showRoom: (roomId, env, timeoutMs) => createCoworkAdapter({ env, timeoutMs }).getRoom(roomId),
|
|
63
|
+
now: Date.now,
|
|
64
|
+
sleep: ms => new Promise(resolve => setTimeout(resolve, ms)),
|
|
65
|
+
log: message => process.stderr.write(message + '\n'),
|
|
66
|
+
env: process.env,
|
|
67
|
+
shouldStop: () => false,
|
|
68
|
+
...partial,
|
|
69
|
+
};
|
|
70
|
+
const env = { ...deps.env, ...role.env };
|
|
71
|
+
const started = deps.now();
|
|
72
|
+
const deadline = started + STARTUP_WAIT_MS;
|
|
73
|
+
let waited = false;
|
|
74
|
+
for (;;) {
|
|
75
|
+
// Each probe fits in what is left of the wait, so the wait itself is bounded.
|
|
76
|
+
const timeoutMs = Math.min(ROOM_PROBE_TIMEOUT_MS, Math.max(1, deadline - deps.now()));
|
|
77
|
+
try {
|
|
78
|
+
await deps.showRoom(startup.room_id, env, timeoutMs);
|
|
79
|
+
if (waited)
|
|
80
|
+
deps.log(`[${name}] cowork room management ready after ${deps.now() - started}ms`);
|
|
81
|
+
return 'ready';
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
if (!(error instanceof CoworkUnavailableError) || !error.retryable)
|
|
85
|
+
return 'deferred';
|
|
86
|
+
if (!waited)
|
|
87
|
+
deps.log(`[${name}] waiting for cowork room management: ${error.message}`);
|
|
88
|
+
waited = true;
|
|
89
|
+
if (deps.shouldStop())
|
|
90
|
+
return 'unavailable';
|
|
91
|
+
if (deps.now() + STARTUP_RETRY_MS >= deadline) {
|
|
92
|
+
deps.log(`[${name}] cowork room management still unavailable after ${STARTUP_WAIT_MS}ms: `
|
|
93
|
+
+ `${error.message}; starting the attempt so the restart budget applies`);
|
|
94
|
+
return 'unavailable';
|
|
95
|
+
}
|
|
96
|
+
await deps.sleep(STARTUP_RETRY_MS);
|
|
97
|
+
if (deps.shouldStop())
|
|
98
|
+
return 'unavailable';
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ConversationEventV1 } from './session/conversation-types.js';
|
|
2
|
+
/** Body-free startup diagnostics. First output is an observation, not proof of useful work. */
|
|
3
|
+
export declare class StartupTelemetry {
|
|
4
|
+
private readonly now;
|
|
5
|
+
private readonly log;
|
|
6
|
+
private readonly started;
|
|
7
|
+
private promptAt?;
|
|
8
|
+
private promptId?;
|
|
9
|
+
private firstOutput;
|
|
10
|
+
private completed;
|
|
11
|
+
private readonly tools;
|
|
12
|
+
constructor(now: () => number, log: (line: string) => void);
|
|
13
|
+
mark(stage: 'supervisor_started' | 'identity_prepare_started' | 'identity_ready' | 'harness_starting' | 'harness_ready' | 'startup_submitted' | 'readiness_turn_completed'): void;
|
|
14
|
+
observe(event: ConversationEventV1): void;
|
|
15
|
+
finish(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** Body-free startup diagnostics. First output is an observation, not proof of useful work. */
|
|
2
|
+
export class StartupTelemetry {
|
|
3
|
+
now;
|
|
4
|
+
log;
|
|
5
|
+
started;
|
|
6
|
+
promptAt;
|
|
7
|
+
promptId;
|
|
8
|
+
firstOutput = false;
|
|
9
|
+
completed = false;
|
|
10
|
+
tools = new Set();
|
|
11
|
+
constructor(now, log) {
|
|
12
|
+
this.now = now;
|
|
13
|
+
this.log = log;
|
|
14
|
+
this.started = now();
|
|
15
|
+
}
|
|
16
|
+
mark(stage) {
|
|
17
|
+
const at = this.now();
|
|
18
|
+
if (stage === 'startup_submitted')
|
|
19
|
+
this.promptAt = at;
|
|
20
|
+
this.log(`startup stage=${stage} elapsed_ms=${Math.max(0, at - this.started)}`);
|
|
21
|
+
}
|
|
22
|
+
observe(event) {
|
|
23
|
+
if (this.promptAt === undefined || this.completed || event.source === 'agent_replay')
|
|
24
|
+
return;
|
|
25
|
+
if (event.kind === 'prompt.started' && event.source === 'startup')
|
|
26
|
+
this.promptId = event.promptId;
|
|
27
|
+
if (this.promptId && event.promptId && event.promptId !== this.promptId)
|
|
28
|
+
return;
|
|
29
|
+
if (event.kind === 'tool.upsert' && 'toolCallId' in event.payload && event.payload.toolCallId)
|
|
30
|
+
this.tools.add(event.payload.toolCallId);
|
|
31
|
+
if (!this.firstOutput && ['message.chunk', 'message.replace'].includes(event.kind)
|
|
32
|
+
&& 'role' in event.payload && event.payload.role === 'assistant'
|
|
33
|
+
&& 'content' in event.payload && event.payload.content.type === 'text'
|
|
34
|
+
&& event.payload.content.text.trim()) {
|
|
35
|
+
this.firstOutput = true;
|
|
36
|
+
const at = this.now();
|
|
37
|
+
this.log(`startup stage=first_assistant_output elapsed_ms=${Math.max(0, at - this.started)} model_and_tools_ms=${Math.max(0, at - this.promptAt)} tools=${this.tools.size}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
finish() {
|
|
41
|
+
if (this.completed)
|
|
42
|
+
return;
|
|
43
|
+
this.completed = true;
|
|
44
|
+
this.log(`startup stage=turn_settled elapsed_ms=${Math.max(0, this.now() - this.started)} tools=${this.tools.size} first_output=${this.firstOutput}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin adapters over the official CLIs. Nothing here reads or returns a token
|
|
3
|
+
* value: credentials stay in files the CLIs own, and secrets typed by the user
|
|
4
|
+
* (a Claude paste code) travel only over a child's stdin, never argv or logs.
|
|
5
|
+
*/
|
|
6
|
+
export interface SubscriptionBinaries {
|
|
7
|
+
claude: string;
|
|
8
|
+
codex: string;
|
|
9
|
+
/** `script(1)`, used to give `claude auth login` the terminal it expects. */
|
|
10
|
+
script: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const defaultBinaries: () => SubscriptionBinaries;
|
|
13
|
+
/**
|
|
14
|
+
* Child env for a profile helper: explicit home for added profiles, the CLI
|
|
15
|
+
* default otherwise. Every credential selector either CLI honours is removed,
|
|
16
|
+
* so a helper can only ever see the profile's own login.
|
|
17
|
+
*/
|
|
18
|
+
export declare function profileEnv(homeVar: string, profileId: string, home: string, base?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
19
|
+
export interface ClaudeStatus {
|
|
20
|
+
loggedIn: boolean;
|
|
21
|
+
email?: string;
|
|
22
|
+
plan?: string;
|
|
23
|
+
org?: string;
|
|
24
|
+
authMethod?: string;
|
|
25
|
+
}
|
|
26
|
+
/** `claude auth status --json` (documented: exit 0 when logged in, 1 otherwise). */
|
|
27
|
+
export declare function claudeAuthStatus(bin: string, env: NodeJS.ProcessEnv, timeoutMs?: number): Promise<ClaudeStatus>;
|
|
28
|
+
/**
|
|
29
|
+
* Login expiry timestamps from the Claude credentials file. Field names are
|
|
30
|
+
* observed (Claude Code 2.1.x), not a documented contract, so absence is normal.
|
|
31
|
+
* Only the two numbers are kept; the parsed object is discarded immediately.
|
|
32
|
+
*/
|
|
33
|
+
export declare function claudeLoginExpiry(home: string): {
|
|
34
|
+
accessExpiresAt?: number;
|
|
35
|
+
refreshExpiresAt?: number;
|
|
36
|
+
};
|
|
37
|
+
/** Minimal stdio JSON-RPC client for `codex app-server` (the supported transport). */
|
|
38
|
+
export declare class CodexAppServer {
|
|
39
|
+
private readonly child;
|
|
40
|
+
private id;
|
|
41
|
+
private buffer;
|
|
42
|
+
private readonly pending;
|
|
43
|
+
private readonly listeners;
|
|
44
|
+
private closed;
|
|
45
|
+
private constructor();
|
|
46
|
+
static start(bin: string, env: NodeJS.ProcessEnv, initializeTimeoutMs?: number): Promise<CodexAppServer>;
|
|
47
|
+
call<T = unknown>(method: string, params: unknown, timeoutMs?: number): Promise<T>;
|
|
48
|
+
onNotification(fn: (method: string, params: unknown) => void): () => void;
|
|
49
|
+
close(): void;
|
|
50
|
+
private onData;
|
|
51
|
+
}
|
|
52
|
+
/** One-shot use of an app-server for a profile. */
|
|
53
|
+
export declare function withCodex<T>(bin: string, env: NodeJS.ProcessEnv, fn: (s: CodexAppServer) => Promise<T>, initializeTimeoutMs?: number): Promise<T>;
|
|
54
|
+
/** What a Codex runtime offers the account it is signed in to. An empty list is an answer; unknown is not. */
|
|
55
|
+
export type OfferedModels = {
|
|
56
|
+
state: 'known';
|
|
57
|
+
models: string[];
|
|
58
|
+
} | {
|
|
59
|
+
state: 'unknown';
|
|
60
|
+
reason: string;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Ask this Codex executable, with this profile's environment, which models it offers (`model/list`,
|
|
64
|
+
* the call the ACP adapter itself uses). Nothing is inferred when it does not answer.
|
|
65
|
+
*/
|
|
66
|
+
export declare function codexOfferedModels(bin: string, env: NodeJS.ProcessEnv, budgetMs?: number): Promise<OfferedModels>;
|
|
67
|
+
export interface UsageWindow {
|
|
68
|
+
id: string;
|
|
69
|
+
label: string;
|
|
70
|
+
usedPercent: number;
|
|
71
|
+
windowMins?: number;
|
|
72
|
+
resetsAt?: string;
|
|
73
|
+
}
|
|
74
|
+
interface CodexWindow {
|
|
75
|
+
usedPercent?: number;
|
|
76
|
+
windowDurationMins?: number | null;
|
|
77
|
+
resetsAt?: number | null;
|
|
78
|
+
}
|
|
79
|
+
interface CodexSnapshot {
|
|
80
|
+
limitId?: string | null;
|
|
81
|
+
limitName?: string | null;
|
|
82
|
+
primary?: CodexWindow | null;
|
|
83
|
+
secondary?: CodexWindow | null;
|
|
84
|
+
}
|
|
85
|
+
/** Flatten `account/rateLimits/read` into display windows. */
|
|
86
|
+
export declare function codexUsageWindows(result: {
|
|
87
|
+
rateLimits?: CodexSnapshot;
|
|
88
|
+
rateLimitsByLimitId?: Record<string, CodexSnapshot | undefined> | null;
|
|
89
|
+
}): UsageWindow[];
|
|
90
|
+
export declare function windowName(mins?: number): string;
|
|
91
|
+
export {};
|