@ours.network/fleet 1.2.0-nightly.6 → 1.2.0-nightly.60
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 +287 -65
- package/dist/account-origin.d.ts +2 -0
- package/dist/account-origin.js +6 -0
- package/dist/agent-ours/bridge.js +35 -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 +4 -0
- package/dist/agent-ours/mcp-endpoint.js +5 -0
- package/dist/agent-ours/runtime.d.ts +9 -1
- package/dist/agent-ours/runtime.js +50 -2
- package/dist/agent-ours/service.d.ts +21 -1
- package/dist/agent-ours/service.js +94 -14
- 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 +212 -0
- package/dist/application/fleet-query-service.d.ts +1 -1
- package/dist/application/fleet-query-service.js +2 -2
- package/dist/application/legacy-supervisor-identity.d.ts +7 -0
- package/dist/application/legacy-supervisor-identity.js +43 -0
- 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 +9 -1
- 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 +30 -0
- package/dist/application/session-control.js +72 -3
- package/dist/application/supervisor-ours-tools.d.ts +159 -0
- package/dist/application/supervisor-ours-tools.js +115 -0
- 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 +5 -0
- package/dist/atomic-file.js +62 -1
- package/dist/briefing.d.ts +3 -1
- package/dist/briefing.js +70 -30
- package/dist/build-info.json +7 -4
- package/dist/capabilities.d.ts +6 -1
- package/dist/capabilities.js +8 -0
- package/dist/cli.js +407 -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 +123 -19
- package/dist/doctor.d.ts +1 -1
- package/dist/doctor.js +55 -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 +26 -9
- package/dist/harness/agent-session.d.ts +2 -0
- package/dist/harness/claude-code-session.js +1 -1
- package/dist/harness/claude-code.js +20 -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 +23 -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 +8 -0
- package/dist/notifications/target-cleanup.js +41 -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 +25 -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 +2 -4
- package/dist/rooms-tasks/cowork-adapter.js +7 -121
- package/dist/rooms-tasks/cowork-http.js +29 -1
- 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 +25 -3
- package/dist/runner.js +291 -49
- package/dist/session/acp.d.ts +53 -1
- package/dist/session/acp.js +216 -40
- package/dist/session/arbiter.d.ts +11 -0
- package/dist/session/arbiter.js +43 -2
- package/dist/session/codex-app-server.d.ts +32 -0
- package/dist/session/codex-app-server.js +137 -23
- package/dist/session/control.d.ts +12 -1
- package/dist/session/control.js +68 -3
- package/dist/session/conversation-normalizer.d.ts +2 -1
- package/dist/session/conversation-normalizer.js +1 -1
- package/dist/session/conversation-store.d.ts +1 -1
- package/dist/session/conversation-store.js +7 -11
- package/dist/session/conversation-types.d.ts +28 -3
- package/dist/session/prompt-batch.d.ts +63 -0
- package/dist/session/prompt-batch.js +86 -0
- package/dist/session/task-notice.d.ts +14 -0
- package/dist/session/task-notice.js +13 -0
- package/dist/session/types.d.ts +14 -0
- 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 +4 -0
- package/dist/startup-prompt.js +36 -0
- package/dist/startup-readiness.d.ts +13 -0
- package/dist/startup-readiness.js +38 -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 +75 -0
- package/dist/subscriptions/login.js +182 -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/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 +113 -65
- 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 +63 -2
- package/dist/web/auth.js +191 -10
- 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/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 +116 -31
- package/dist/web/server.d.ts +16 -0
- package/dist/web/server.js +654 -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 +82 -0
- package/dist/workspace-enrollment.js +566 -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/fleet-migration.md +54 -0
- package/docs/live-voice.md +13 -0
- package/docs/room-layouts.md +227 -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 +20 -19
- 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 +1 -1
- 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 +34 -11
- package/presets/fleet/roles/Engineer.yaml +40 -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/web/runtime.js
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { replaceFileAtomically } from '../atomic-file.js';
|
|
2
|
+
import { validateAccountOrigin } from '../account-origin.js';
|
|
3
|
+
import { startWorkspaceTunnel } from './workspace-tunnel.js';
|
|
4
|
+
import { createPrefixGateway } from './prefix-gateway.js';
|
|
5
|
+
import { readClientProfile } from '../client-profile.js';
|
|
6
|
+
import { readPrivateFile } from '@ours.network/sdk/connector';
|
|
7
|
+
import { LayoutBindingGrants } from '../rooms-tasks/layout-binding-grants.js';
|
|
8
|
+
import { RoomLayoutService } from '../rooms-tasks/layout-service.js';
|
|
9
|
+
import { FleetNotificationProducer } from '../notifications/fleet-producer.js';
|
|
10
|
+
import { producerConfig } from '../notifications/outbox.js';
|
|
11
|
+
import { SubscriptionService } from '../subscriptions/service.js';
|
|
12
|
+
import { createCodexModelDiscovery } from '../application/codex-models.js';
|
|
13
|
+
import { existsSync, mkdirSync, realpathSync, readFileSync } from 'node:fs';
|
|
3
14
|
import { resolve } from 'node:path';
|
|
4
15
|
import { loadConfig } from '../config.js';
|
|
5
16
|
import { RoleRepository } from '../application/role-repository.js';
|
|
@@ -13,7 +24,8 @@ import { FleetError } from '../application/errors.js';
|
|
|
13
24
|
import { controlRequest, controlSocketPath } from '../session/control.js';
|
|
14
25
|
import { pickBackend } from '../supervisor/index.js';
|
|
15
26
|
import { realExec } from '../exec.js';
|
|
16
|
-
import { home, stateRoot } from '../paths.js';
|
|
27
|
+
import { home, stateRoot, agentsRoot, tmpRoot, logsRoot } from '../paths.js';
|
|
28
|
+
import { executeInitAnswers, publishSetup } from '../init-wizard.js';
|
|
17
29
|
import { AuditSink } from './audit.js';
|
|
18
30
|
import { FleetEventBus } from './events.js';
|
|
19
31
|
import { buildWebServer } from './server.js';
|
|
@@ -21,8 +33,11 @@ import { FleetConfigService } from './fleet-config-service.js';
|
|
|
21
33
|
import { mergeTopology } from './topology-model.js';
|
|
22
34
|
import { TopologyDraftStore } from './topology-draft-store.js';
|
|
23
35
|
import { TopologyPromoteService } from './topology-promote.js';
|
|
36
|
+
import { RoomLayoutDefinitions } from '../application/room-layout-definitions.js';
|
|
37
|
+
import { PresetProvenance } from '../application/preset-provenance.js';
|
|
24
38
|
import { doctor } from '../doctor.js';
|
|
25
39
|
import { acquireWebServerLock } from './lock.js';
|
|
40
|
+
import { WorkspaceDeviceStore } from './workspace-devices.js';
|
|
26
41
|
import { TrustedDeviceStore } from './device-store.js';
|
|
27
42
|
import { WebAuth } from './auth.js';
|
|
28
43
|
import { startWebControlServer } from './control.js';
|
|
@@ -47,19 +62,31 @@ function cachedConfigProvider(configPath) {
|
|
|
47
62
|
};
|
|
48
63
|
}
|
|
49
64
|
export async function startWebConsole(options) {
|
|
50
|
-
const
|
|
65
|
+
const notificationConfig = producerConfig(process.env, undefined, options.log);
|
|
66
|
+
let requestedPort = options.port ?? 49_271;
|
|
51
67
|
if (!Number.isInteger(requestedPort) || requestedPort < 0 || requestedPort > 65_535)
|
|
52
68
|
throw new FleetError('invalid_request', 'port must be between 0 and 65535');
|
|
53
|
-
const
|
|
54
|
-
const
|
|
69
|
+
const webDir = options.webStateDir ?? resolve(stateRoot(), 'web');
|
|
70
|
+
const lock = acquireWebServerLock(webDir);
|
|
55
71
|
const bind = options.bind ?? '127.0.0.1';
|
|
56
72
|
const publicOrigin = options.publicOrigin ? validatePublicOrigin(options.publicOrigin) : undefined;
|
|
73
|
+
const workspaceGateway = Boolean(publicOrigin && existsSync(resolve(stateRoot(), 'workspace', 'binding.json')));
|
|
57
74
|
if (!isLoopback(bind) && !publicOrigin) {
|
|
58
75
|
lock.release();
|
|
59
76
|
throw new FleetError('forbidden', 'a non-loopback bind requires an explicit --public-origin');
|
|
60
77
|
}
|
|
61
78
|
const access = options.access ?? new WebAccessStore(webDir).read();
|
|
62
|
-
const
|
|
79
|
+
const bindingFile = resolve(stateRoot(), 'workspace', 'binding.json');
|
|
80
|
+
let appOrigin = 'https://app.ours.network';
|
|
81
|
+
try {
|
|
82
|
+
if (existsSync(bindingFile))
|
|
83
|
+
appOrigin = validateAccountOrigin(JSON.parse(readFileSync(bindingFile, 'utf8')).appOrigin ?? appOrigin);
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
lock.release();
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
const auth = new WebAuth(publicOrigin?.origin ?? `http://127.0.0.1:${requestedPort}`, publicOrigin?.host ?? `127.0.0.1:${requestedPort}`, Date.now, new TrustedDeviceStore(webDir), access, new WorkspaceDeviceStore(webDir), appOrigin);
|
|
63
90
|
const backend = pickBackend();
|
|
64
91
|
const repository = new RoleRepository({
|
|
65
92
|
configPath: options.configPath,
|
|
@@ -159,8 +186,29 @@ export async function startWebConsole(options) {
|
|
|
159
186
|
try {
|
|
160
187
|
server = await buildWebServer({
|
|
161
188
|
query, repository, logs, commands, creation, removal, audit, events, watchdogs, configuration,
|
|
162
|
-
taskRooms: new TaskRoomApplicationService(options.configPath),
|
|
189
|
+
taskRooms: new TaskRoomApplicationService(options.configPath, { binPath: () => options.binPath }),
|
|
190
|
+
roomLayouts: new RoomLayoutDefinitions(options.configPath),
|
|
191
|
+
layoutBindings: new LayoutBindingGrants(new RoomLayoutService(options.configPath).supervisor()),
|
|
192
|
+
presetProvenance: new PresetProvenance(options.configPath),
|
|
163
193
|
topology: readTopology, topologyDrafts, topologyPromote,
|
|
194
|
+
// Same boundary as `ours-fleet init --settings`: existing files are preserved, missing defaults are added.
|
|
195
|
+
onboardingSetup: async (answers) => {
|
|
196
|
+
await executeInitAnswers(answers, configuration.path, {
|
|
197
|
+
async hostSetup() {
|
|
198
|
+
for (const directory of [agentsRoot(), tmpRoot(), logsRoot()])
|
|
199
|
+
mkdirSync(directory, { recursive: true });
|
|
200
|
+
await pickBackend().init(options.binPath);
|
|
201
|
+
},
|
|
202
|
+
publish: publishSetup,
|
|
203
|
+
});
|
|
204
|
+
},
|
|
205
|
+
codexModels: createCodexModelDiscovery(),
|
|
206
|
+
subscriptions: new SubscriptionService({
|
|
207
|
+
agents: async () => (await query.list(true)).map(({ role, status }) => ({
|
|
208
|
+
roleId: role.id, stateDir: repository.stateDir(role), running: status.supervisor.liveness === 'running',
|
|
209
|
+
})),
|
|
210
|
+
onChange: () => events.publish('subscription.changed', {}),
|
|
211
|
+
}),
|
|
164
212
|
async session(roleId) {
|
|
165
213
|
const role = await repository.get(roleId);
|
|
166
214
|
if (!role)
|
|
@@ -182,7 +230,7 @@ export async function startWebConsole(options) {
|
|
|
182
230
|
}
|
|
183
231
|
let address;
|
|
184
232
|
try {
|
|
185
|
-
address = await server.app.listen({ host: bind, port: requestedPort });
|
|
233
|
+
address = await server.app.listen({ host: workspaceGateway ? '127.0.0.1' : bind, port: workspaceGateway ? 0 : requestedPort });
|
|
186
234
|
}
|
|
187
235
|
catch (error) {
|
|
188
236
|
await server.close();
|
|
@@ -193,39 +241,84 @@ export async function startWebConsole(options) {
|
|
|
193
241
|
const localHost = `127.0.0.1:${actual.port}`;
|
|
194
242
|
const browserOrigin = publicOrigin?.origin ?? `http://${localHost}`;
|
|
195
243
|
const browserHost = publicOrigin?.host ?? localHost;
|
|
244
|
+
let gateway;
|
|
245
|
+
if (workspaceGateway)
|
|
246
|
+
try {
|
|
247
|
+
const profile = readClientProfile(), provider = new URL(profile.serverUrl), credential = readPrivateFile(profile.credentialPath, 4096).toString('utf8').trim();
|
|
248
|
+
const basePath = provider.pathname.replace(/\/$/, '');
|
|
249
|
+
const services = ['daemon', 'cowork', 'messenger', 'notifications'].map(name => ({ prefix: '/' + name, origin: provider.origin, upstreamPrefix: basePath + '/' + name, stripBrowserContext: true, headers: { 'X-Ours-Api-Token': credential, ...(name === 'messenger' ? { Origin: provider.origin, 'X-Ours-Messenger-CSRF': '1' } : name === 'cowork' ? { Origin: provider.origin } : {}) },
|
|
250
|
+
// The App reports a visible page to the notification service, so an open app is not sent a push.
|
|
251
|
+
...(name === 'notifications' ? { deviceSocketPaths: ['/api/v1/presence'] } : {}) }));
|
|
252
|
+
gateway = createPrefixGateway({ auth: server.auth, fleetOrigin: address, services, audit });
|
|
253
|
+
const listen = (port) => new Promise((resolve, reject) => { gateway.server.once('error', reject); gateway.server.listen(port, bind, () => { gateway.server.off('error', reject); resolve(); }); });
|
|
254
|
+
try {
|
|
255
|
+
await listen(requestedPort);
|
|
256
|
+
}
|
|
257
|
+
catch (error) {
|
|
258
|
+
const selection = resolve(webDir, 'port-selection.json');
|
|
259
|
+
if (error.code !== 'EADDRINUSE' || !existsSync(selection) || JSON.parse(readPrivateFile(selection, 4096).toString()).expiresAt <= Date.now())
|
|
260
|
+
throw error;
|
|
261
|
+
await listen(0);
|
|
262
|
+
}
|
|
263
|
+
const bound = gateway.server.address();
|
|
264
|
+
if (!bound || typeof bound === 'string')
|
|
265
|
+
throw Error('Workspace listener did not bind');
|
|
266
|
+
requestedPort = bound.port;
|
|
267
|
+
replaceFileAtomically(resolve(webDir, 'workspace-port.json'), JSON.stringify({ port: requestedPort }) + '\n', 0o600);
|
|
268
|
+
}
|
|
269
|
+
catch (error) {
|
|
270
|
+
await gateway?.close().catch(() => { });
|
|
271
|
+
await server.close();
|
|
272
|
+
lock.release();
|
|
273
|
+
throw error;
|
|
274
|
+
}
|
|
196
275
|
server.auth.setBoundary(browserOrigin, browserHost, publicOrigin ? {
|
|
197
276
|
// nginx's safe default uses the loopback upstream as Host. The declared
|
|
198
277
|
// browser Origin remains mandatory for auth/mutations and WebSocket hello,
|
|
199
278
|
// so operators do not need a fragile Host-rewrite incantation.
|
|
200
|
-
hosts: [localHost, `localhost:${actual.port}`],
|
|
279
|
+
hosts: [localHost, `localhost:${actual.port}`, ...(workspaceGateway ? [`127.0.0.1:${requestedPort}`, `localhost:${requestedPort}`] : [])],
|
|
201
280
|
} : {
|
|
202
281
|
hosts: [`localhost:${actual.port}`], origins: [`http://localhost:${actual.port}`],
|
|
203
282
|
});
|
|
204
283
|
let control;
|
|
205
284
|
try {
|
|
206
|
-
control
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
},
|
|
213
|
-
onRevokeAll() { server.auth.revokeAllTrustedDevices(); },
|
|
214
|
-
});
|
|
285
|
+
if (options.control !== false)
|
|
286
|
+
control = await startWebControlServer({
|
|
287
|
+
dir: webDir,
|
|
288
|
+
onLinkDevice() { return { version: 1, origin: browserOrigin, ...server.auth.workspaceEnrollment() }; },
|
|
289
|
+
onRevokeAll() { server.auth.revokeAllTrustedDevices(); },
|
|
290
|
+
});
|
|
215
291
|
}
|
|
216
292
|
catch (error) {
|
|
293
|
+
await gateway?.close();
|
|
217
294
|
await server.close();
|
|
218
295
|
lock.release();
|
|
219
296
|
throw error;
|
|
220
297
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
298
|
+
let stopTunnel;
|
|
299
|
+
try {
|
|
300
|
+
stopTunnel = startWorkspaceTunnel(browserOrigin);
|
|
301
|
+
}
|
|
302
|
+
catch (error) {
|
|
303
|
+
try {
|
|
304
|
+
await control?.close();
|
|
305
|
+
await gateway?.close();
|
|
306
|
+
await server.close();
|
|
307
|
+
}
|
|
308
|
+
finally {
|
|
309
|
+
lock.release();
|
|
310
|
+
}
|
|
311
|
+
throw error;
|
|
312
|
+
}
|
|
313
|
+
const notifications = notificationConfig ? new FleetNotificationProducer([agentsRoot(), tmpRoot()], resolve(webDir, 'notification-outboxes'), notificationConfig, options.log) : undefined;
|
|
224
314
|
return {
|
|
225
315
|
...server, address: browserOrigin,
|
|
226
316
|
async close() {
|
|
227
317
|
try {
|
|
228
|
-
await
|
|
318
|
+
await stopTunnel();
|
|
319
|
+
await notifications?.close();
|
|
320
|
+
await control?.close();
|
|
321
|
+
await gateway?.close();
|
|
229
322
|
await server.close();
|
|
230
323
|
}
|
|
231
324
|
finally {
|
|
@@ -237,11 +330,3 @@ export async function startWebConsole(options) {
|
|
|
237
330
|
function isLoopback(host) {
|
|
238
331
|
return ['127.0.0.1', 'localhost', '::1'].includes(host);
|
|
239
332
|
}
|
|
240
|
-
function openBrowser(url) {
|
|
241
|
-
const command = process.platform === 'darwin' ? 'open'
|
|
242
|
-
: process.platform === 'win32' ? 'cmd' : 'xdg-open';
|
|
243
|
-
const args = process.platform === 'win32' ? ['/c', 'start', '', url] : [url];
|
|
244
|
-
const child = spawn(command, args, { stdio: 'ignore', detached: true, shell: false });
|
|
245
|
-
child.on('error', () => undefined);
|
|
246
|
-
child.unref();
|
|
247
|
-
}
|
package/dist/web/server.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type InitAnswers } from '../init-wizard.js';
|
|
2
|
+
import { SupervisorOursTools } from '../application/supervisor-ours-tools.js';
|
|
1
3
|
import { type FastifyInstance } from 'fastify';
|
|
2
4
|
import type { FleetQueryService } from '../application/fleet-query-service.js';
|
|
3
5
|
import type { RoleRepository } from '../application/role-repository.js';
|
|
@@ -15,7 +17,13 @@ import type { TopologyDraftStore } from './topology-draft-store.js';
|
|
|
15
17
|
import type { TopologyPromoteService } from './topology-promote.js';
|
|
16
18
|
import type { RoleRemovalService } from '../application/role-removal-service.js';
|
|
17
19
|
import type { TaskRoomApplicationService } from '../application/task-room-service.js';
|
|
20
|
+
import type { RoomLayoutDefinitions } from '../application/room-layout-definitions.js';
|
|
21
|
+
import type { PresetProvenance } from '../application/preset-provenance.js';
|
|
22
|
+
import type { OfferedModels } from '../subscriptions/cli.js';
|
|
23
|
+
import type { SubscriptionService } from '../subscriptions/service.js';
|
|
24
|
+
import type { LayoutBindingGrants } from '../rooms-tasks/layout-binding-grants.js';
|
|
18
25
|
export interface WebServices {
|
|
26
|
+
layoutBindings?: Pick<LayoutBindingGrants, 'control'>;
|
|
19
27
|
query: FleetQueryService;
|
|
20
28
|
repository: RoleRepository;
|
|
21
29
|
session(roleId: string): Promise<RoleSessionControl>;
|
|
@@ -31,6 +39,14 @@ export interface WebServices {
|
|
|
31
39
|
topologyPromote?: TopologyPromoteService;
|
|
32
40
|
removal?: RoleRemovalService;
|
|
33
41
|
taskRooms?: TaskRoomApplicationService;
|
|
42
|
+
roomLayouts?: RoomLayoutDefinitions;
|
|
43
|
+
presetProvenance?: PresetProvenance;
|
|
44
|
+
oursTools?: Pick<SupervisorOursTools, 'list' | 'call'>;
|
|
45
|
+
subscriptions?: SubscriptionService;
|
|
46
|
+
/** First-time setup from the packaged presets; the account App supplies only the model choices. */
|
|
47
|
+
onboardingSetup?(answers: InitAnswers): Promise<void>;
|
|
48
|
+
/** The Codex models the runtime that sessions will use offers the active account. Absent: this server cannot tell, and filters nothing. */
|
|
49
|
+
codexModels?(): Promise<OfferedModels>;
|
|
34
50
|
}
|
|
35
51
|
export interface WebServer {
|
|
36
52
|
app: FastifyInstance;
|