@ours.network/fleet 1.2.0-nightly.8 → 1.2.0-nightly.81
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 +280 -68
- package/dist/account-origin.d.ts +5 -0
- package/dist/account-origin.js +31 -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 +22 -0
- package/dist/agent-ours/mcp-endpoint.js +101 -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 +27 -1
- package/dist/agent-ours/service.js +107 -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 +34 -0
- package/dist/application/conversation-history.js +294 -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 +3 -3
- 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/resource-observer.d.ts +43 -0
- package/dist/application/resource-observer.js +323 -0
- package/dist/application/role-creation-service.js +3 -2
- package/dist/application/role-removal-service.js +17 -3
- package/dist/application/role-repository.d.ts +1 -1
- package/dist/application/role-repository.js +30 -7
- 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 +63 -17
- package/dist/application/session-control.js +221 -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 +261 -0
- package/dist/application/task-room-service.d.ts +101 -3
- package/dist/application/task-room-service.js +286 -33
- 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 +120 -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 +402 -38
- 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 +14 -9
- package/dist/daemon-recovery.js +124 -115
- package/dist/docs.d.ts +1 -1
- package/dist/docs.js +227 -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 +13 -0
- package/dist/fleet-command-audit.js +31 -9
- 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 +9 -34
- package/dist/monitor.js +90 -153
- package/dist/notifications/fleet-producer.d.ts +31 -0
- package/dist/notifications/fleet-producer.js +351 -0
- package/dist/notifications/outbox.d.ts +59 -0
- package/dist/notifications/outbox.js +199 -0
- package/dist/notifications/target-cleanup.d.ts +16 -0
- package/dist/notifications/target-cleanup.js +75 -0
- package/dist/notifications/task-producer.d.ts +20 -0
- package/dist/notifications/task-producer.js +100 -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 +5 -0
- package/dist/paths.js +5 -0
- package/dist/preset-migration.js +55 -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 +84 -0
- package/dist/rooms-tasks/archived-absence.d.ts +4 -0
- package/dist/rooms-tasks/archived-absence.js +11 -0
- package/dist/rooms-tasks/cli.js +182 -5
- package/dist/rooms-tasks/close.d.ts +5 -2
- package/dist/rooms-tasks/close.js +224 -36
- 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 +66 -10
- 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 +286 -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-review.d.ts +113 -0
- package/dist/rooms-tasks/task-review.js +561 -0
- 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 -5
- package/dist/rooms-tasks/task-state.js +358 -50
- package/dist/rooms-tasks/task-tools.d.ts +35 -0
- package/dist/rooms-tasks/task-tools.js +134 -0
- package/dist/rooms-tasks/types.d.ts +78 -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 +410 -62
- 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 +219 -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 +213 -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 +77 -0
- package/dist/subscriptions/login.js +215 -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 +143 -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 +130 -0
- package/dist/watchdog/query.d.ts +3 -1
- package/dist/watchdog/query.js +2 -1
- 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 +26 -0
- package/dist/web/conversation-stream.js +239 -0
- package/dist/web/events.d.ts +2 -0
- package/dist/web/events.js +9 -0
- package/dist/web/fleet-config-service.d.ts +7 -1
- package/dist/web/fleet-config-service.js +61 -16
- package/dist/web/prefix-gateway.d.ts +32 -0
- package/dist/web/prefix-gateway.js +248 -0
- package/dist/web/resource-views.d.ts +135 -0
- package/dist/web/resource-views.js +494 -0
- package/dist/web/runtime.d.ts +3 -1
- package/dist/web/runtime.js +132 -34
- package/dist/web/server.d.ts +19 -0
- package/dist/web/server.js +893 -71
- 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 +605 -0
- package/dist/workspace-replacement.d.ts +66 -0
- package/dist/workspace-replacement.js +238 -0
- package/docs/acp-files.md +146 -0
- package/docs/conversation-stream.md +216 -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-progress-review.md +143 -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 +25 -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 +6 -3
- 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 +21 -13
- package/presets/fleet/roles/Critic.yaml +24 -0
- package/presets/fleet/roles/Developer.yaml +32 -0
- package/presets/fleet/roles/Engineer.yaml +72 -0
- package/presets/fleet/roles/LocalCoordinator.yaml +17 -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
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TaskCreatedNotice } from './task-notice.js';
|
|
2
|
+
import type { PromptOrigin, SessionSnapshot, TurnCancellationSource, TurnOutcome } from './types.js';
|
|
2
3
|
/**
|
|
3
4
|
* Durable conversation domain schema for managed-session consoles.
|
|
4
5
|
*
|
|
@@ -7,11 +8,11 @@ import type { PromptOrigin, TurnCancellationSource, TurnOutcome } from './types.
|
|
|
7
8
|
* file touches the wire: transport updates are reduced into these shapes by a
|
|
8
9
|
* session adapter, and the store assigns `seq`/`eventId`/timestamps.
|
|
9
10
|
*/
|
|
10
|
-
export type ConversationEventKind = 'prompt.admitted' | 'prompt.started' | 'prompt.interrupt_requested' | 'message.chunk' | 'message.replace' | 'thought.chunk' | 'thought.replace' | 'plan.replace' | 'tool.upsert' | 'tool.content_chunk' | 'permission.requested' | 'permission.resolved' | 'monitor.delivery' | 'usage.updated' | 'turn.state' | 'turn.completed' | 'session.state' | 'session.info' | 'capabilities.updated' | 'error'
|
|
11
|
+
export type ConversationEventKind = 'prompt.admitted' | 'prompt.started' | 'prompt.interrupt_requested' | 'message.chunk' | 'message.replace' | 'thought.chunk' | 'thought.replace' | 'plan.replace' | 'tool.upsert' | 'tool.content_chunk' | 'permission.requested' | 'permission.resolved' | 'file.attached' | 'fleet.task_created' | 'monitor.delivery' | 'usage.updated' | 'turn.state' | 'turn.completed' | 'session.state' | 'session.info' | 'capabilities.updated' | 'error'
|
|
11
12
|
/** A well-formed transport update this version cannot represent. Bounded, never a crash. */
|
|
12
13
|
| 'unsupported';
|
|
13
14
|
/** Where a conversation record came from. Typed provenance, never prompt text. */
|
|
14
|
-
export type ConversationSource = 'owner_admin_console' | 'owner_channel' | 'fleet_monitor' | 'scheduled_loop' | 'startup' | 'local_console' | 'agent' | 'agent_replay';
|
|
15
|
+
export type ConversationSource = 'owner_admin_console' | 'owner_channel' | 'fleet_monitor' | 'scheduled_loop' | 'startup' | 'local_console' | 'agent' | 'agent_replay' | 'fleet_lifecycle';
|
|
15
16
|
export interface NormalizedText {
|
|
16
17
|
type: 'text';
|
|
17
18
|
text: string;
|
|
@@ -175,6 +176,12 @@ export interface PromptAdmittedPayload {
|
|
|
175
176
|
}
|
|
176
177
|
export interface PromptStartedPayload {
|
|
177
178
|
queuedBehind?: number;
|
|
179
|
+
/** Present when one adapter turn carries several admitted prompts; `turnId` is the shared turn. */
|
|
180
|
+
batch?: {
|
|
181
|
+
turnId: string;
|
|
182
|
+
index: number;
|
|
183
|
+
size: number;
|
|
184
|
+
};
|
|
178
185
|
}
|
|
179
186
|
export interface PromptInterruptRequestedPayload {
|
|
180
187
|
commandId?: string;
|
|
@@ -227,7 +234,9 @@ export interface BoundedJson {
|
|
|
227
234
|
digest?: string;
|
|
228
235
|
redacted?: true;
|
|
229
236
|
}
|
|
230
|
-
export type ConversationPayload =
|
|
237
|
+
export type ConversationPayload = {
|
|
238
|
+
attachment: import('../file-delivery/types.js').DeliveredFile;
|
|
239
|
+
} | MessageChunkPayload | ThoughtChunkPayload | PlanReplacePayload | ToolUpsertPayload | UsageUpdatedPayload | SessionStatePayload | SessionInfoPayload | CapabilitiesUpdatedPayload | UnsupportedPayload | PromptAdmittedPayload | PromptStartedPayload | PromptInterruptRequestedPayload | PermissionRequestedPayload | PermissionResolvedPayload | TurnStatePayload | TurnCompletedPayload | MonitorDeliveryPayload | SessionLifecyclePayload | ErrorPayload | TaskCreatedNotice;
|
|
231
240
|
export interface ConversationEventV1 {
|
|
232
241
|
schemaVersion: 1;
|
|
233
242
|
roleId: string;
|
|
@@ -262,6 +271,9 @@ export interface ConversationEventV1 {
|
|
|
262
271
|
adapterMeta?: AdapterMeta[];
|
|
263
272
|
}
|
|
264
273
|
export interface SubmitPromptCommand {
|
|
274
|
+
expectedSessionGeneration?: string;
|
|
275
|
+
/** Live speech must not silently queue behind an unrelated turn. */
|
|
276
|
+
requireIdle?: boolean;
|
|
265
277
|
/** Idempotency-Key / clientRequestId. Reuse with a different body is a conflict. */
|
|
266
278
|
commandId: string;
|
|
267
279
|
text: string;
|
|
@@ -270,6 +282,8 @@ export interface SubmitPromptCommand {
|
|
|
270
282
|
}
|
|
271
283
|
export interface PromptReceipt {
|
|
272
284
|
commandId: string;
|
|
285
|
+
/** Original durable admission generation; absent when historical provenance is unknown. */
|
|
286
|
+
sessionGeneration?: string;
|
|
273
287
|
promptId: string;
|
|
274
288
|
state: 'queued' | 'starting';
|
|
275
289
|
queuedBehind: number;
|
|
@@ -283,12 +297,51 @@ export interface PermissionDecisionCommand {
|
|
|
283
297
|
sessionGeneration: string;
|
|
284
298
|
optionId: string;
|
|
285
299
|
}
|
|
300
|
+
/** One admitted prompt not yet handed to the agent, as reported by the queue that owns it. */
|
|
301
|
+
export interface PendingPromptSummary {
|
|
302
|
+
promptId: string;
|
|
303
|
+
source: ConversationSource;
|
|
304
|
+
admittedAt: string;
|
|
305
|
+
bytes: number;
|
|
306
|
+
/** A bounded preview, present only for a body the ledger already holds. */
|
|
307
|
+
text?: string;
|
|
308
|
+
textTruncated?: boolean;
|
|
309
|
+
}
|
|
286
310
|
export interface ConversationSnapshot {
|
|
287
311
|
sessionGeneration: string;
|
|
288
312
|
readiness: 'starting' | 'idle' | 'running' | 'awaiting_permission' | 'failed' | 'offline';
|
|
289
313
|
queueDepth: number;
|
|
290
314
|
pendingPermissionIds: string[];
|
|
291
315
|
historyDegraded?: boolean;
|
|
316
|
+
/** Live observation is unavailable; REST may still serve canonical durable data. */
|
|
317
|
+
observationFailure?: 'capture_failed';
|
|
318
|
+
/** Every waiting prompt, in delivery order; `pendingPromptCount` equals its length. */
|
|
319
|
+
pendingPrompts?: PendingPromptSummary[];
|
|
320
|
+
pendingPromptCount?: number;
|
|
321
|
+
}
|
|
322
|
+
/** Position captured synchronously with the owning backend's complete live state. */
|
|
323
|
+
export interface ObservationPosition {
|
|
324
|
+
sessionGeneration: string;
|
|
325
|
+
stateRevision: number;
|
|
326
|
+
ledgerBarrier: number;
|
|
327
|
+
}
|
|
328
|
+
export interface ConversationObservationState extends ConversationSnapshot, ObservationPosition {
|
|
329
|
+
alive: boolean;
|
|
330
|
+
activePromptIds: string[];
|
|
331
|
+
pendingPrompts: PendingPromptSummary[];
|
|
332
|
+
pendingPromptCount: number;
|
|
333
|
+
/** Already presented and sanitized by the backend; never reconstructed from raw options. */
|
|
334
|
+
pendingPermissions: Array<PermissionRequestedPayload & {
|
|
335
|
+
permissionId: string;
|
|
336
|
+
}>;
|
|
337
|
+
commands: NonNullable<CapabilitiesUpdatedPayload['commands']>;
|
|
338
|
+
runtimeModel?: SessionSnapshot['runtimeModel'];
|
|
339
|
+
reasoningEffort?: SessionSnapshot['reasoningEffort'];
|
|
340
|
+
permissionMode?: SessionSnapshot['permissionMode'];
|
|
341
|
+
}
|
|
342
|
+
export interface ConversationObservation {
|
|
343
|
+
snapshot: ConversationObservationState;
|
|
344
|
+
unsubscribe(): void;
|
|
292
345
|
}
|
|
293
346
|
export interface ConversationPage {
|
|
294
347
|
events: ConversationEventV1[];
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { ConversationSource, PendingPromptSummary } from './conversation-types.js';
|
|
2
|
+
import type { PromptOrigin, TurnResult } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* A prompt the session has admitted and not yet handed to the adapter.
|
|
5
|
+
*
|
|
6
|
+
* Every admitted prompt keeps its own id, ledger records and completion. What
|
|
7
|
+
* changes at a turn boundary is how many of them one adapter turn carries.
|
|
8
|
+
*/
|
|
9
|
+
export interface PendingPrompt {
|
|
10
|
+
promptId: string;
|
|
11
|
+
text: string;
|
|
12
|
+
origin?: PromptOrigin;
|
|
13
|
+
source: ConversationSource;
|
|
14
|
+
/** Whether the ledger already holds this body; an external body is never copied out of the queue. */
|
|
15
|
+
persistBody: boolean;
|
|
16
|
+
admittedAt: string;
|
|
17
|
+
/** Whether the session recognised the text, at admission, as one of its own control operations. */
|
|
18
|
+
command?: boolean;
|
|
19
|
+
/** Set when a release takes this prompt; every member of that turn shares it. */
|
|
20
|
+
released?: Promise<TurnResult>;
|
|
21
|
+
/** Last-moment validity check for an internal prompt; see `refuseAtRelease`. */
|
|
22
|
+
releaseGuard?: () => boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* How a waiting prompt takes part in a release.
|
|
26
|
+
*
|
|
27
|
+
* - `message`: something a person or a peer route submitted for the agent to
|
|
28
|
+
* read — the paired console, the owner channel, the local console, a
|
|
29
|
+
* monitor wake. Every waiting message is delivered at one boundary, in
|
|
30
|
+
* admission order, whatever its route.
|
|
31
|
+
* - `command`: a control operation the session itself supports — the native
|
|
32
|
+
* `/compact`, a command the ACP adapter advertised. It must reach the
|
|
33
|
+
* adapter as the entire prompt, so it is its own turn and a boundary
|
|
34
|
+
* between the messages before and after it. The session decides this at
|
|
35
|
+
* admission; text that merely starts with a slash is an ordinary message.
|
|
36
|
+
* - `internal`: startup, scheduled-loop, self-reminder and stall-watchdog prompts. They own
|
|
37
|
+
* their turn's lifecycle (and, for a loop, the redaction of its whole
|
|
38
|
+
* transcript), run alone, and never split the messages around them.
|
|
39
|
+
*/
|
|
40
|
+
export type PromptClass = 'message' | 'command' | 'internal';
|
|
41
|
+
export declare function promptClass(prompt: Pick<PendingPrompt, 'origin' | 'command'>): PromptClass;
|
|
42
|
+
/** The command name a prompt invokes, when its whole text has the shape of one. */
|
|
43
|
+
export declare function commandName(text: string): string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Detach, in admission order, every pending prompt that is delivered with
|
|
46
|
+
* `head`. Synchronous on purpose: this is the snapshot boundary, and a prompt
|
|
47
|
+
* admitted after it returns belongs to the next release.
|
|
48
|
+
*/
|
|
49
|
+
export declare function takeBatch(pending: PendingPrompt[], head: PendingPrompt): PendingPrompt[];
|
|
50
|
+
/**
|
|
51
|
+
* The release-time fence for a guarded internal prompt. A prompt can wait in
|
|
52
|
+
* the queue long after it was admitted; whatever it was about may have been
|
|
53
|
+
* cancelled, revised or expired meanwhile, or the role may be stopping. The
|
|
54
|
+
* guard answers at the one moment that matters — the prompt is about to reach
|
|
55
|
+
* the model — and a refusal removes it unsent.
|
|
56
|
+
*
|
|
57
|
+
* The guard runs only when the session is live: an offline session fails the
|
|
58
|
+
* turn without handing it to the adapter, so consuming the guard there would
|
|
59
|
+
* record a dispatch that never happened. Returns the refused result, or
|
|
60
|
+
* undefined when the release should proceed.
|
|
61
|
+
*/
|
|
62
|
+
export declare function refuseAtRelease(pending: PendingPrompt[], entry: PendingPrompt, online: boolean): TurnResult | undefined;
|
|
63
|
+
export declare const RELEASE_GUARD_REFUSED = "release-guard-refused";
|
|
64
|
+
/** Exact, server-computed identity of one member's body inside a shared turn. */
|
|
65
|
+
export interface MemberBinding {
|
|
66
|
+
index: number;
|
|
67
|
+
of: number;
|
|
68
|
+
source: ConversationSource;
|
|
69
|
+
bytes: number;
|
|
70
|
+
sha256: string;
|
|
71
|
+
}
|
|
72
|
+
export declare function memberBindings(members: ReadonlyArray<Pick<PendingPrompt, 'text' | 'origin'>>, sourceOf: (origin: PromptOrigin | undefined) => ConversationSource): MemberBinding[];
|
|
73
|
+
/** What the server asserts about a member's route; never derived from the member's text. */
|
|
74
|
+
export declare function memberAuthority(source: ConversationSource): string;
|
|
75
|
+
/** What a client may show for prompts still waiting: all of them, in order, and never an unpersisted body. */
|
|
76
|
+
export declare function pendingInventory(pending: readonly PendingPrompt[]): {
|
|
77
|
+
pendingPrompts: PendingPromptSummary[];
|
|
78
|
+
pendingPromptCount: number;
|
|
79
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
/**
|
|
3
|
+
* The inventory names every waiting prompt — a client must be able to show the
|
|
4
|
+
* whole queue, not a count of what it could not see. What keeps a snapshot
|
|
5
|
+
* small is the body: each entry carries a short preview, not the prompt.
|
|
6
|
+
*/
|
|
7
|
+
const INVENTORY_TEXT_CHARS = 200;
|
|
8
|
+
const INTERNAL = new Set(['startup', 'scheduled-loop', 'stall-watchdog', 'self-reminder']);
|
|
9
|
+
export function promptClass(prompt) {
|
|
10
|
+
if (INTERNAL.has(prompt.origin?.kind ?? 'local-console'))
|
|
11
|
+
return 'internal';
|
|
12
|
+
return prompt.command ? 'command' : 'message';
|
|
13
|
+
}
|
|
14
|
+
/** The command name a prompt invokes, when its whole text has the shape of one. */
|
|
15
|
+
export function commandName(text) {
|
|
16
|
+
return /^\/([a-z][a-z0-9_-]*)(?:\s|$)/i.exec(text.trim())?.[1];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Detach, in admission order, every pending prompt that is delivered with
|
|
20
|
+
* `head`. Synchronous on purpose: this is the snapshot boundary, and a prompt
|
|
21
|
+
* admitted after it returns belongs to the next release.
|
|
22
|
+
*/
|
|
23
|
+
export function takeBatch(pending, head) {
|
|
24
|
+
const members = [];
|
|
25
|
+
if (promptClass(head) !== 'message')
|
|
26
|
+
members.push(head);
|
|
27
|
+
else {
|
|
28
|
+
for (const prompt of pending) {
|
|
29
|
+
const kind = promptClass(prompt);
|
|
30
|
+
if (kind === 'command')
|
|
31
|
+
break;
|
|
32
|
+
if (kind === 'message')
|
|
33
|
+
members.push(prompt);
|
|
34
|
+
}
|
|
35
|
+
if (!members.includes(head))
|
|
36
|
+
members.unshift(head);
|
|
37
|
+
}
|
|
38
|
+
for (const member of members) {
|
|
39
|
+
const at = pending.indexOf(member);
|
|
40
|
+
if (at >= 0)
|
|
41
|
+
pending.splice(at, 1);
|
|
42
|
+
}
|
|
43
|
+
return members;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The release-time fence for a guarded internal prompt. A prompt can wait in
|
|
47
|
+
* the queue long after it was admitted; whatever it was about may have been
|
|
48
|
+
* cancelled, revised or expired meanwhile, or the role may be stopping. The
|
|
49
|
+
* guard answers at the one moment that matters — the prompt is about to reach
|
|
50
|
+
* the model — and a refusal removes it unsent.
|
|
51
|
+
*
|
|
52
|
+
* The guard runs only when the session is live: an offline session fails the
|
|
53
|
+
* turn without handing it to the adapter, so consuming the guard there would
|
|
54
|
+
* record a dispatch that never happened. Returns the refused result, or
|
|
55
|
+
* undefined when the release should proceed.
|
|
56
|
+
*/
|
|
57
|
+
export function refuseAtRelease(pending, entry, online) {
|
|
58
|
+
if (!entry.releaseGuard || !online)
|
|
59
|
+
return undefined;
|
|
60
|
+
// Only an internal prompt is guaranteed to be its own release; any other
|
|
61
|
+
// class could be carried by another prompt's batch past this fence, so a
|
|
62
|
+
// guarded prompt of that kind is refused rather than sent unchecked.
|
|
63
|
+
let allowed = false;
|
|
64
|
+
if (promptClass(entry) === 'internal')
|
|
65
|
+
try {
|
|
66
|
+
allowed = entry.releaseGuard() === true;
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
allowed = false;
|
|
70
|
+
}
|
|
71
|
+
if (allowed)
|
|
72
|
+
return undefined;
|
|
73
|
+
const at = pending.indexOf(entry);
|
|
74
|
+
if (at >= 0)
|
|
75
|
+
pending.splice(at, 1);
|
|
76
|
+
return { accepted: false, outcome: 'cancelled', succeeded: false, detail: RELEASE_GUARD_REFUSED };
|
|
77
|
+
}
|
|
78
|
+
export const RELEASE_GUARD_REFUSED = 'release-guard-refused';
|
|
79
|
+
export function memberBindings(members, sourceOf) {
|
|
80
|
+
return members.map((member, at) => ({
|
|
81
|
+
index: at + 1,
|
|
82
|
+
of: members.length,
|
|
83
|
+
source: sourceOf(member.origin),
|
|
84
|
+
bytes: Buffer.byteLength(member.text),
|
|
85
|
+
sha256: createHash('sha256').update(member.text).digest('hex'),
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
/** What the server asserts about a member's route; never derived from the member's text. */
|
|
89
|
+
export function memberAuthority(source) {
|
|
90
|
+
switch (source) {
|
|
91
|
+
case 'owner_admin_console':
|
|
92
|
+
return 'direct owner input from the server-authenticated paired console';
|
|
93
|
+
case 'owner_channel':
|
|
94
|
+
return 'admitted through the authenticated Fleet owner channel';
|
|
95
|
+
case 'fleet_monitor':
|
|
96
|
+
return 'a Fleet monitor notification, not owner input';
|
|
97
|
+
default:
|
|
98
|
+
return 'local console input, not authenticated owner-console or owner-channel input';
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/** What a client may show for prompts still waiting: all of them, in order, and never an unpersisted body. */
|
|
102
|
+
export function pendingInventory(pending) {
|
|
103
|
+
return {
|
|
104
|
+
pendingPromptCount: pending.length,
|
|
105
|
+
pendingPrompts: pending.map(prompt => {
|
|
106
|
+
const display = prompt.origin?.kind === 'owner' ? prompt.origin.displayText
|
|
107
|
+
: prompt.persistBody ? prompt.text : undefined;
|
|
108
|
+
return {
|
|
109
|
+
promptId: prompt.promptId,
|
|
110
|
+
source: prompt.source,
|
|
111
|
+
admittedAt: prompt.admittedAt,
|
|
112
|
+
bytes: Buffer.byteLength(prompt.text),
|
|
113
|
+
...(display === undefined ? {} : {
|
|
114
|
+
text: display.slice(0, INVENTORY_TEXT_CHARS),
|
|
115
|
+
...(display.length > INVENTORY_TEXT_CHARS ? { textTruncated: true } : {}),
|
|
116
|
+
}),
|
|
117
|
+
};
|
|
118
|
+
}),
|
|
119
|
+
};
|
|
120
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ConversationEventStore } from './conversation-store.js';
|
|
2
|
+
export interface TaskNoticeBinding {
|
|
3
|
+
sessionGeneration: string;
|
|
4
|
+
acpSessionId: string;
|
|
5
|
+
promptId: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TaskCreatedNotice {
|
|
8
|
+
operationId: string;
|
|
9
|
+
taskId: string;
|
|
10
|
+
title: string;
|
|
11
|
+
state: string;
|
|
12
|
+
}
|
|
13
|
+
/** Only the trusted Fleet audit completion calls this, never model output. */
|
|
14
|
+
export declare function appendTaskCreated(store: ConversationEventStore, binding: TaskNoticeBinding, notice: TaskCreatedNotice): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Only the trusted Fleet audit completion calls this, never model output. */
|
|
2
|
+
export function appendTaskCreated(store, binding, notice) {
|
|
3
|
+
let after;
|
|
4
|
+
do {
|
|
5
|
+
const page = store.page({ after, limit: 1000 });
|
|
6
|
+
if (page.events.some(e => e.kind === 'fleet.task_created' && e.payload.operationId === notice.operationId))
|
|
7
|
+
return;
|
|
8
|
+
if (!page.hasMore)
|
|
9
|
+
break;
|
|
10
|
+
after = page.nextCursor;
|
|
11
|
+
} while (after);
|
|
12
|
+
store.append({ kind: 'fleet.task_created', source: 'fleet_lifecycle', ...binding, turnId: binding.promptId, payload: notice });
|
|
13
|
+
}
|
package/dist/session/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TaskCreatedNotice, TaskNoticeBinding } from './task-notice.js';
|
|
1
2
|
import type { SessionBackendId } from '../config.js';
|
|
2
3
|
import type { ConversationEventV1, ConversationSnapshot, PromptReceipt, SubmitPromptCommand } from './conversation-types.js';
|
|
3
4
|
/**
|
|
@@ -13,7 +14,9 @@ import type { ConversationEventV1, ConversationSnapshot, PromptReceipt, SubmitPr
|
|
|
13
14
|
*/
|
|
14
15
|
export type SessionReadiness = 'starting' | 'idle' | 'running' | 'awaiting_permission' | 'failed';
|
|
15
16
|
export type TurnOutcome = 'completed' | 'refused' | 'cancelled' | 'failed' | 'inconclusive';
|
|
16
|
-
export type TurnCancellationSource = 'owner' | 'local-console' | 'fleet-monitor' | 'scheduled-loop' | 'shutdown' | 'stall-watchdog'
|
|
17
|
+
export type TurnCancellationSource = 'owner' | 'local-console' | 'fleet-monitor' | 'scheduled-loop' | 'shutdown' | 'stall-watchdog'
|
|
18
|
+
/** An urgent self-reminder of the same agent asked its current turn to stop. */
|
|
19
|
+
| 'self-reminder';
|
|
17
20
|
export type PromptOrigin = {
|
|
18
21
|
kind: 'startup';
|
|
19
22
|
} | {
|
|
@@ -30,6 +33,13 @@ export type PromptOrigin = {
|
|
|
30
33
|
kind: 'scheduled-loop';
|
|
31
34
|
loop: string;
|
|
32
35
|
runId: string;
|
|
36
|
+
}
|
|
37
|
+
/** A due self-reminder wake; the agent's own stored reminder, never owner input. */
|
|
38
|
+
| {
|
|
39
|
+
kind: 'self-reminder';
|
|
40
|
+
eventId: string;
|
|
41
|
+
reminderId: string;
|
|
42
|
+
revision: number;
|
|
33
43
|
} | {
|
|
34
44
|
kind: 'owner-admin-console';
|
|
35
45
|
commandId: string;
|
|
@@ -180,11 +190,19 @@ export interface SubmitPromptOptions {
|
|
|
180
190
|
actor?: {
|
|
181
191
|
browserSession?: string;
|
|
182
192
|
};
|
|
193
|
+
/**
|
|
194
|
+
* Checked synchronously at the turn boundary, immediately before the prompt
|
|
195
|
+
* would be handed to a live model. False drops the prompt unsent. Only
|
|
196
|
+
* honoured for internal prompts, which always run alone.
|
|
197
|
+
*/
|
|
198
|
+
releaseGuard?: () => boolean;
|
|
183
199
|
}
|
|
184
200
|
export interface SessionSnapshot {
|
|
185
201
|
backend: SessionBackendId;
|
|
186
202
|
alive: boolean;
|
|
187
203
|
readiness: SessionReadiness;
|
|
204
|
+
/** Typed source of the active prompt; excludes prompt bodies and command IDs. */
|
|
205
|
+
activePromptSource?: PromptOrigin['kind'];
|
|
188
206
|
sessionId?: string;
|
|
189
207
|
lastError?: string;
|
|
190
208
|
pendingPermissionId?: string;
|
|
@@ -283,17 +301,32 @@ export interface ConversationHandlePage {
|
|
|
283
301
|
* on any concrete transport which implements it.
|
|
284
302
|
*/
|
|
285
303
|
export interface AgentSession {
|
|
304
|
+
sendFileToChat?: (input: import('../file-delivery/types.js').FileDeliveryInput, signal: AbortSignal, copy: import('../file-delivery/types.js').CopyChatFile, policy: import('../config.js').CommonPermissions) => Promise<import('../file-delivery/types.js').DeliveredFile>;
|
|
286
305
|
readonly backend: SessionBackendId;
|
|
287
306
|
readonly pid: number;
|
|
288
307
|
/** Live capabilities; optional only for source compatibility with external adapters. */
|
|
289
308
|
readonly capabilities?: AgentSessionCapabilities;
|
|
309
|
+
/**
|
|
310
|
+
* Start never-started prompts recovered from a prior generation. Sessions
|
|
311
|
+
* started with deferRecoveredPrompts hold them until the supervisor's
|
|
312
|
+
* control plane is listening, so recovered work cannot reach a stale socket.
|
|
313
|
+
*/
|
|
314
|
+
activateRecoveredPrompts?(): void;
|
|
290
315
|
isAlive(): boolean;
|
|
291
316
|
snapshot(): SessionSnapshot;
|
|
317
|
+
taskNoticeBinding?(): TaskNoticeBinding | undefined;
|
|
318
|
+
recordTaskCreated?(binding: TaskNoticeBinding, notice: TaskCreatedNotice): void;
|
|
292
319
|
conversationPage?(request: {
|
|
293
320
|
after?: string;
|
|
294
321
|
limit?: number;
|
|
295
322
|
}): ConversationHandlePage;
|
|
296
323
|
conversationSnapshot?(): ConversationSnapshot;
|
|
324
|
+
/** Side-effect-free current-generation durability eligibility; does not certify a historical range. */
|
|
325
|
+
conversationReplayAvailable?(expectedGeneration: string): boolean;
|
|
326
|
+
replayConversation?(request: import('./conversation-replay.js').ConversationReplayRequest): AsyncIterable<import('./conversation-replay.js').ConversationReplayPage>;
|
|
327
|
+
/** Passive: registering never attaches a controller or acknowledges activity. */
|
|
328
|
+
observeConversation?(listener: (state: import('./conversation-types.js').ConversationObservationState) => void): import('./conversation-types.js').ConversationObservation;
|
|
329
|
+
subscribeConversationFailure?(listener: (generation: string) => void): () => void;
|
|
297
330
|
subscribeConversation?(listener: (event: ConversationEventV1) => void): () => void;
|
|
298
331
|
/** Durably admit an idempotent browser prompt; resolves on admission. */
|
|
299
332
|
submitPromptBrowser?(command: SubmitPromptCommand): Promise<PromptReceipt>;
|
|
@@ -301,6 +334,11 @@ export interface AgentSession {
|
|
|
301
334
|
* Hand the session a prompt and return as soon as it has accepted
|
|
302
335
|
* responsibility for it. Throws `SessionControlError` if it cannot.
|
|
303
336
|
*/
|
|
337
|
+
/**
|
|
338
|
+
* The turn that carries an admitted prompt when one adapter turn delivered
|
|
339
|
+
* several; absent means the prompt's own id is its turn id.
|
|
340
|
+
*/
|
|
341
|
+
sharedTurnId?(promptId: string): string | undefined;
|
|
304
342
|
queuePrompt(text: string, options?: SubmitPromptOptions): Promise<QueuedPrompt>;
|
|
305
343
|
/** Queue a prompt and wait for its terminal result. */
|
|
306
344
|
submitPrompt(text: string, options?: SubmitPromptOptions): Promise<TurnResult>;
|
|
@@ -316,6 +354,9 @@ export interface AgentSession {
|
|
|
316
354
|
* keep compiling. Read it through `interruptOutcome`, never directly.
|
|
317
355
|
*/
|
|
318
356
|
interrupt(source?: TurnCancellationSource): Promise<InterruptResult>;
|
|
357
|
+
/** Atomically bind cancellation to one voice-owned turn. */
|
|
358
|
+
readonly liveVoiceSupported?: boolean;
|
|
359
|
+
interruptPrompt?(generation: string, promptId: string): Promise<InterruptResult>;
|
|
319
360
|
respondPermission(permissionId: string, optionId: string): boolean;
|
|
320
361
|
/** Generation-bound browser decision; stale/settled/invalid all fail closed. */
|
|
321
362
|
respondPermissionV2?(permissionId: string, optionId: string, sessionGeneration: string): 'accepted' | 'stale';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Exec } from './exec.js';
|
|
2
|
+
import type { WorkspacePayload } from './workspace-enrollment.js';
|
|
3
|
+
/**
|
|
4
|
+
* Check what the steps after the one-time root proof depend on, before that
|
|
5
|
+
* proof is sent: a failure afterwards cannot be retried with a fresh command.
|
|
6
|
+
*/
|
|
7
|
+
export declare function setupTunnelPreflight({ exec, platform, node }?: {
|
|
8
|
+
exec?: Exec;
|
|
9
|
+
platform?: NodeJS.Platform;
|
|
10
|
+
node?: string;
|
|
11
|
+
}): Promise<void>;
|
|
12
|
+
/** What the steps after the proof need, kept so they can be finished without a new command. */
|
|
13
|
+
export interface PendingTunnelSetup {
|
|
14
|
+
appOrigin: string;
|
|
15
|
+
origin: string;
|
|
16
|
+
hostWorkspaceId: string;
|
|
17
|
+
rootCid: string;
|
|
18
|
+
challenge: WorkspacePayload['challenge'];
|
|
19
|
+
/** Fleet configuration the setup started with; a resume must use the same one. */
|
|
20
|
+
configuration: string;
|
|
21
|
+
/** Every port sent to the account as the tunnel target. Without confirmedPort, the remote target may be any of these or the default. */
|
|
22
|
+
requestedPorts?: number[];
|
|
23
|
+
/** Last positively confirmed target; cleared before any new retarget request. */
|
|
24
|
+
confirmedPort?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare function savePendingTunnelSetup(pending: PendingTunnelSetup): void;
|
|
27
|
+
export declare function clearPendingTunnelSetup(): void;
|
|
28
|
+
export declare function readPendingTunnelSetup(): PendingTunnelSetup;
|
|
29
|
+
export declare const DEFAULT_TUNNEL_PORT = 49271;
|
|
30
|
+
/**
|
|
31
|
+
* The port the web service must bind when the account can no longer retarget
|
|
32
|
+
* the tunnel. Unknown when a different port was requested and never confirmed.
|
|
33
|
+
*/
|
|
34
|
+
export declare function requiredPortAfterExpiry(pending: PendingTunnelSetup): number;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { existsSync, lstatSync, readFileSync, rmSync } from 'node:fs';
|
|
2
|
+
import { userInfo } from 'node:os';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { replaceFileAtomically } from './atomic-file.js';
|
|
5
|
+
import { realExec } from './exec.js';
|
|
6
|
+
import { stateRoot } from './paths.js';
|
|
7
|
+
const UNCHANGED = 'Nothing was changed and this host was not bound.';
|
|
8
|
+
/**
|
|
9
|
+
* Check what the steps after the one-time root proof depend on, before that
|
|
10
|
+
* proof is sent: a failure afterwards cannot be retried with a fresh command.
|
|
11
|
+
*/
|
|
12
|
+
export async function setupTunnelPreflight({ exec = realExec, platform = process.platform, node = process.versions.node } = {}) {
|
|
13
|
+
const [major, minor] = node.split('.').map(Number);
|
|
14
|
+
if (major < 22 || (major === 22 && minor < 13))
|
|
15
|
+
throw Error(`Tunnel setup requires Node.js 22.13 or newer; this is ${node}. Update Node.js, then run a fresh tunnel setup command. ${UNCHANGED}`);
|
|
16
|
+
if (platform === 'linux') {
|
|
17
|
+
const manager = await exec('systemctl', ['--user', 'show-environment'], { timeout: 10_000 });
|
|
18
|
+
if (manager.code !== 0)
|
|
19
|
+
throw Error(`The user service manager is not reachable from this shell (${manager.stderr.trim().split('\n')[0] || `systemctl --user exited ${manager.code}`}). `
|
|
20
|
+
+ `Log in directly as ${userInfo().username} (not through su or sudo), or run: sudo loginctl enable-linger ${userInfo().username} && export XDG_RUNTIME_DIR=/run/user/${process.getuid?.()} `
|
|
21
|
+
+ `Then run a fresh tunnel setup command. ${UNCHANGED}`);
|
|
22
|
+
}
|
|
23
|
+
const help = await exec('cloudflared', ['tunnel', 'run', '--help'], { timeout: 10_000 });
|
|
24
|
+
if (help.code === 127)
|
|
25
|
+
throw Error(`cloudflared is not installed or not on PATH. Install it, then run a fresh tunnel setup command. ${UNCHANGED}`);
|
|
26
|
+
if (help.code !== 0 || !`${help.stdout}\n${help.stderr}`.includes('--token-file'))
|
|
27
|
+
throw Error(`This cloudflared is too old for tunnel setup (no --token-file support). Update cloudflared, then run a fresh tunnel setup command. ${UNCHANGED}`);
|
|
28
|
+
}
|
|
29
|
+
const pendingPath = () => join(stateRoot(), 'workspace', 'pending-setup.json');
|
|
30
|
+
export function savePendingTunnelSetup(pending) {
|
|
31
|
+
replaceFileAtomically(pendingPath(), JSON.stringify(pending) + '\n', 0o600);
|
|
32
|
+
}
|
|
33
|
+
export function clearPendingTunnelSetup() { rmSync(pendingPath(), { force: true }); }
|
|
34
|
+
export function readPendingTunnelSetup() {
|
|
35
|
+
const path = pendingPath();
|
|
36
|
+
if (!existsSync(path))
|
|
37
|
+
throw Error('No unfinished tunnel setup on this host. Run the tunnel setup command from the App.');
|
|
38
|
+
const stat = lstatSync(path);
|
|
39
|
+
if (!stat.isFile() || stat.isSymbolicLink() || stat.uid !== process.getuid?.() || (stat.mode & 0o077) !== 0)
|
|
40
|
+
throw Error('Unfinished tunnel setup record must be an owned private file');
|
|
41
|
+
const pending = JSON.parse(readFileSync(path, 'utf8'));
|
|
42
|
+
if (typeof pending?.appOrigin !== 'string' || typeof pending.origin !== 'string' || typeof pending.hostWorkspaceId !== 'string'
|
|
43
|
+
|| typeof pending.rootCid !== 'string' || !pending.challenge || !Number.isSafeInteger(pending.challenge.expiresAt) || typeof pending.configuration !== 'string'
|
|
44
|
+
|| (pending.requestedPorts !== undefined && (!Array.isArray(pending.requestedPorts) || !pending.requestedPorts.every(Number.isInteger))))
|
|
45
|
+
throw Error('Unfinished tunnel setup record is invalid');
|
|
46
|
+
if (pending.confirmedPort !== undefined && (!Number.isInteger(pending.confirmedPort) || pending.confirmedPort < 1024 || pending.confirmedPort > 65535))
|
|
47
|
+
throw Error('Unfinished tunnel setup record is invalid');
|
|
48
|
+
return pending;
|
|
49
|
+
}
|
|
50
|
+
export const DEFAULT_TUNNEL_PORT = 49_271;
|
|
51
|
+
/**
|
|
52
|
+
* The port the web service must bind when the account can no longer retarget
|
|
53
|
+
* the tunnel. Unknown when a different port was requested and never confirmed.
|
|
54
|
+
*/
|
|
55
|
+
export function requiredPortAfterExpiry(pending) {
|
|
56
|
+
if (pending.confirmedPort !== undefined)
|
|
57
|
+
return pending.confirmedPort;
|
|
58
|
+
const other = [...new Set(pending.requestedPorts ?? [])].filter(port => port !== DEFAULT_TUNNEL_PORT);
|
|
59
|
+
if (!other.length)
|
|
60
|
+
return DEFAULT_TUNNEL_PORT;
|
|
61
|
+
throw Error(`The setup window has expired and it is unknown whether the tunnel points at port ${[...other, DEFAULT_TUNNEL_PORT].join(' or ')}: the account's answer to a port request was not received. This setup cannot be finished automatically`);
|
|
62
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { lstatSync, mkdirSync } from 'node:fs';
|
|
3
|
+
import { isAbsolute, join, resolve } from 'node:path';
|
|
4
|
+
/** Optional private socket directory for deeply nested, isolated Fleet homes. */
|
|
5
|
+
export function socketPath(logicalPath) {
|
|
6
|
+
const root = process.env.OURS_FLEET_SOCKET_ROOT;
|
|
7
|
+
if (!root) {
|
|
8
|
+
if (Buffer.byteLength(logicalPath) > 103)
|
|
9
|
+
throw new Error('Unix socket path is too long; configure a short private OURS_FLEET_SOCKET_ROOT');
|
|
10
|
+
return logicalPath;
|
|
11
|
+
}
|
|
12
|
+
if (!isAbsolute(root) || resolve(root) !== root)
|
|
13
|
+
throw new Error('OURS_FLEET_SOCKET_ROOT must be an absolute normalized path');
|
|
14
|
+
mkdirSync(root, { recursive: true, mode: 0o700 });
|
|
15
|
+
const stat = lstatSync(root);
|
|
16
|
+
if (!stat.isDirectory() || stat.isSymbolicLink() || stat.uid !== process.getuid?.() || (stat.mode & 0o777) !== 0o700)
|
|
17
|
+
throw new Error('OURS_FLEET_SOCKET_ROOT must be an owner-only 0700 directory');
|
|
18
|
+
const path = join(root, createHash('sha256').update(resolve(logicalPath)).digest('hex').slice(0, 24) + '.sock');
|
|
19
|
+
if (Buffer.byteLength(path) > 103)
|
|
20
|
+
throw new Error('OURS_FLEET_SOCKET_ROOT is too long');
|
|
21
|
+
return path;
|
|
22
|
+
}
|
package/dist/spawn.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { type CreationDeps, type CreationProvenance } from './creation.js';
|
|
|
6
6
|
import './harness/claude-code.js';
|
|
7
7
|
import './harness/codex.js';
|
|
8
8
|
import './harness/hermes.js';
|
|
9
|
-
import { type SupervisorLauncher } from './temp-lifecycle.js';
|
|
9
|
+
import { type SupervisorLauncher, type TaskSupervisorOwner } from './temp-lifecycle.js';
|
|
10
10
|
/**
|
|
11
11
|
* The provenance record written by the most recent spawn in this process, so
|
|
12
12
|
* the CLI can print the same summary it persisted rather than rebuilding it.
|
|
@@ -15,6 +15,8 @@ export declare let lastProvenance: CreationProvenance | undefined;
|
|
|
15
15
|
export interface SpawnOpts {
|
|
16
16
|
name: string;
|
|
17
17
|
temp?: boolean;
|
|
18
|
+
/** Internal exact task-layout ownership, never a standalone manifest entry. */
|
|
19
|
+
taskOwner?: TaskSupervisorOwner;
|
|
18
20
|
brain?: AgentSelection;
|
|
19
21
|
role?: AgentSelection;
|
|
20
22
|
/** Trusted canonical definition used by room provisioning; never a second schema. */
|
|
@@ -85,3 +87,5 @@ export declare function spawnPermanent(o: SpawnOpts, deps: OpsDeps, creation?: C
|
|
|
85
87
|
export type { SupervisorLauncher } from './temp-lifecycle.js';
|
|
86
88
|
/** Temp spawn: live state under ~/.ours-fleet/tmp, independent transient supervision. */
|
|
87
89
|
export declare function spawnTemp(o: SpawnOpts, binPath: string, launch?: SupervisorLauncher, creation?: CreationDeps): Promise<string>;
|
|
90
|
+
/** Resume the exact durable task launch; no creation, invite issuance or state rotation. */
|
|
91
|
+
export declare function resumeTaskSupervisor(name: string, binPath: string): Promise<void>;
|