@ours.network/fleet 1.2.0-nightly.9 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +31 -0
- package/dist/application/conversation-history.js +339 -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 +3 -1
- package/dist/application/role-repository.js +89 -54
- 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 +10 -5
- package/dist/capabilities.d.ts +9 -1
- package/dist/capabilities.js +13 -0
- package/dist/cli.js +391 -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 +214 -20
- 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 +23 -4
- package/dist/runner.js +409 -61
- 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 +20 -1
- package/dist/startup-readiness.js +66 -3
- 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 +18 -37
- 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 +138 -0
- package/dist/web/resource-views.js +519 -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
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
2
|
+
import { lstatSync, readFileSync, realpathSync, watch } from 'node:fs';
|
|
3
|
+
import { basename, dirname, join, resolve } from 'node:path';
|
|
4
|
+
import { parse } from 'yaml';
|
|
5
|
+
import { loadConfig, ROLE_NAME_RE, splitRootFor } from '../config.js';
|
|
6
|
+
import { agentsRoot, defaultConfigPath, tmpRoot } from '../paths.js';
|
|
7
|
+
import { controlSocketPath } from '../session/control.js';
|
|
8
|
+
function identity(path) {
|
|
9
|
+
try {
|
|
10
|
+
const s = lstatSync(path);
|
|
11
|
+
return `${s.dev}:${s.ino}:${s.birthtimeMs}`;
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
if (error.code === 'ENOENT')
|
|
15
|
+
return;
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** Native directory notifications are assumed reliable on qualified host/mount setups.
|
|
20
|
+
* No periodic reads or claim of detecting every silently dropped filesystem event.
|
|
21
|
+
*/
|
|
22
|
+
export class ConversationRoleObserver {
|
|
23
|
+
options;
|
|
24
|
+
listener;
|
|
25
|
+
state;
|
|
26
|
+
watchers = new Map();
|
|
27
|
+
detach;
|
|
28
|
+
disposed = false;
|
|
29
|
+
listeners = new Set();
|
|
30
|
+
queued = false;
|
|
31
|
+
fingerprint;
|
|
32
|
+
configPath;
|
|
33
|
+
permanent;
|
|
34
|
+
temporary;
|
|
35
|
+
constructor(options, listener) {
|
|
36
|
+
this.options = options;
|
|
37
|
+
this.listener = listener;
|
|
38
|
+
if (!ROLE_NAME_RE.test(options.roleId))
|
|
39
|
+
throw new Error('invalid role id');
|
|
40
|
+
this.configPath = resolve(options.configPath ?? defaultConfigPath());
|
|
41
|
+
this.permanent = resolve(options.permanentRoot ?? agentsRoot(), options.roleId);
|
|
42
|
+
this.temporary = resolve(options.temporaryRoot ?? tmpRoot(), options.roleId);
|
|
43
|
+
this.state = { roleId: options.roleId, roleRevision: 0, roleLifetime: randomUUID(), availability: 'missing', health: 'healthy' };
|
|
44
|
+
this.refresh();
|
|
45
|
+
if (this.state.health === 'healthy')
|
|
46
|
+
this.detach = options.subscribeMutations?.(() => this.schedule());
|
|
47
|
+
}
|
|
48
|
+
snapshot() {
|
|
49
|
+
return this.disposed ? { ...this.state, health: 'failed', failure: 'observer-disposed' } : { ...this.state };
|
|
50
|
+
}
|
|
51
|
+
subscribe(listener) {
|
|
52
|
+
if (!this.disposed)
|
|
53
|
+
this.listeners.add(listener);
|
|
54
|
+
return { snapshot: this.snapshot(), unsubscribe: () => { this.listeners.delete(listener); } };
|
|
55
|
+
}
|
|
56
|
+
publish() {
|
|
57
|
+
this.listener(this.snapshot());
|
|
58
|
+
for (const listener of this.listeners)
|
|
59
|
+
listener(this.snapshot());
|
|
60
|
+
}
|
|
61
|
+
dispose() {
|
|
62
|
+
if (this.disposed)
|
|
63
|
+
return;
|
|
64
|
+
this.disposed = true;
|
|
65
|
+
this.release();
|
|
66
|
+
this.listeners.clear();
|
|
67
|
+
}
|
|
68
|
+
release() {
|
|
69
|
+
const retired = [...this.watchers.values()];
|
|
70
|
+
// Retire before close: native close events may arrive synchronously or later.
|
|
71
|
+
this.watchers.clear();
|
|
72
|
+
for (const watcher of retired)
|
|
73
|
+
watcher.handle.close();
|
|
74
|
+
this.detach?.();
|
|
75
|
+
this.detach = undefined;
|
|
76
|
+
}
|
|
77
|
+
fail(failure) {
|
|
78
|
+
if (this.disposed || this.state.health !== 'healthy')
|
|
79
|
+
return;
|
|
80
|
+
this.state = { ...this.state, roleRevision: this.state.roleRevision + 1, health: failure === 'watch-unsupported' ? 'unsupported' : 'failed', failure };
|
|
81
|
+
this.release();
|
|
82
|
+
this.publish();
|
|
83
|
+
}
|
|
84
|
+
schedule() {
|
|
85
|
+
if (this.queued || this.disposed || this.state.health !== 'healthy')
|
|
86
|
+
return;
|
|
87
|
+
this.queued = true;
|
|
88
|
+
queueMicrotask(() => { this.queued = false; if (!this.disposed && this.state.health === 'healthy')
|
|
89
|
+
this.refresh(); });
|
|
90
|
+
}
|
|
91
|
+
refresh() {
|
|
92
|
+
try {
|
|
93
|
+
// Install parents before reading, including absent children, so atomic rename
|
|
94
|
+
// and recreation cannot strand us watching an unlinked inode.
|
|
95
|
+
this.install();
|
|
96
|
+
if (this.state.health !== 'healthy')
|
|
97
|
+
return;
|
|
98
|
+
let configured;
|
|
99
|
+
const split = splitRootFor(this.configPath);
|
|
100
|
+
if (identity(this.configPath) && identity(split) && identity(join(split, 'agents')))
|
|
101
|
+
configured = loadConfig(this.configPath).roles.find(role => role.name === this.options.roleId);
|
|
102
|
+
const permanentId = identity(this.permanent), temporaryId = identity(this.temporary);
|
|
103
|
+
const stateDir = temporaryId ? realpathSync(this.temporary) : permanentId ? realpathSync(this.permanent) : undefined;
|
|
104
|
+
let temporary;
|
|
105
|
+
if (!configured && temporaryId && identity(join(this.temporary, 'role.yaml'))) {
|
|
106
|
+
const raw = parse(readFileSync(join(this.temporary, 'role.yaml'), 'utf8'));
|
|
107
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw)
|
|
108
|
+
|| (raw.session !== undefined && raw.session !== 'acp' && raw.session !== 'codex-app-server'))
|
|
109
|
+
throw new Error('invalid temporary role snapshot');
|
|
110
|
+
temporary = { session: raw.session ?? 'acp', harness: typeof raw.harness === 'string' ? raw.harness : 'claude-code' };
|
|
111
|
+
}
|
|
112
|
+
const backend = configured?.session ?? temporary?.session;
|
|
113
|
+
const fallbackHarness = configured?.harness ?? temporary?.harness;
|
|
114
|
+
const socket = stateDir ? identity(controlSocketPath(stateDir)) : undefined;
|
|
115
|
+
const tokenPath = stateDir && join(stateDir, '.control-token');
|
|
116
|
+
const token = tokenPath && identity(tokenPath) ? createHash('sha256').update(readFileSync(tokenPath)).digest('hex') : undefined;
|
|
117
|
+
const exists = Boolean(configured || permanentId || temporaryId);
|
|
118
|
+
const availability = !exists ? 'missing' : stateDir && socket && token && backend ? 'available' : 'unavailable';
|
|
119
|
+
const fingerprint = JSON.stringify([Boolean(configured), permanentId, temporaryId, backend, socket, token]);
|
|
120
|
+
const lifetime = this.fingerprint === fingerprint ? this.state.roleLifetime : randomUUID();
|
|
121
|
+
this.fingerprint = fingerprint;
|
|
122
|
+
const next = { roleId: this.options.roleId, roleRevision: this.state.roleRevision, roleLifetime: lifetime,
|
|
123
|
+
availability, fallbackHarness, backend, stateDir, health: 'healthy' };
|
|
124
|
+
if (JSON.stringify(next) !== JSON.stringify(this.state)) {
|
|
125
|
+
this.state = { ...next, roleRevision: this.state.roleRevision + 1 };
|
|
126
|
+
this.publish();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
this.fail('role-read-failed');
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
install() {
|
|
134
|
+
const wanted = new Map();
|
|
135
|
+
const add = (dir, child) => {
|
|
136
|
+
if (child === undefined)
|
|
137
|
+
wanted.set(dir, null);
|
|
138
|
+
else if (wanted.get(dir) !== null) {
|
|
139
|
+
const names = wanted.get(dir) ?? new Set();
|
|
140
|
+
names.add(child);
|
|
141
|
+
wanted.set(dir, names);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
const parents = (path, boundary) => {
|
|
145
|
+
while (path !== boundary && dirname(path) !== path) {
|
|
146
|
+
add(dirname(path), basename(path));
|
|
147
|
+
path = dirname(path);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
const configRoot = splitRootFor(this.configPath);
|
|
151
|
+
const configBoundary = dirname(dirname(this.configPath));
|
|
152
|
+
parents(this.configPath, configBoundary);
|
|
153
|
+
for (const dir of [configRoot, ...['agents', 'brains', 'roles', 'agent_templates'].map(kind => join(configRoot, kind))]) {
|
|
154
|
+
parents(dir, configBoundary);
|
|
155
|
+
add(dir);
|
|
156
|
+
}
|
|
157
|
+
for (const dir of [this.permanent, this.temporary]) {
|
|
158
|
+
parents(dir, dirname(dirname(dirname(dir))));
|
|
159
|
+
for (const name of ['role.yaml', '.control-token', '.control.sock'])
|
|
160
|
+
add(dir, name);
|
|
161
|
+
const socket = controlSocketPath(dir);
|
|
162
|
+
parents(socket, dirname(dirname(socket)));
|
|
163
|
+
}
|
|
164
|
+
for (const [dir, current] of this.watchers) {
|
|
165
|
+
if (!wanted.has(dir) || identity(dir) !== current.identity) {
|
|
166
|
+
this.watchers.delete(dir);
|
|
167
|
+
current.handle.close();
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
for (const [dir, names] of wanted) {
|
|
171
|
+
const id = identity(dir);
|
|
172
|
+
if (!id)
|
|
173
|
+
continue;
|
|
174
|
+
const existing = this.watchers.get(dir);
|
|
175
|
+
if (existing) {
|
|
176
|
+
existing.names = names;
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
try {
|
|
180
|
+
const handle = (this.options.watch ?? ((path, listener) => watch(path, { persistent: false }, listener)))(dir, (_event, filename) => {
|
|
181
|
+
const entry = this.watchers.get(dir);
|
|
182
|
+
if (filename === null || !entry?.names || entry.names.has(String(filename)) || String(filename) === basename(dir))
|
|
183
|
+
this.schedule();
|
|
184
|
+
});
|
|
185
|
+
this.watchers.set(dir, { identity: id, names, handle });
|
|
186
|
+
handle.on('error', (error) => {
|
|
187
|
+
if (this.watchers.get(dir)?.handle === handle)
|
|
188
|
+
this.watchFailure(error);
|
|
189
|
+
});
|
|
190
|
+
handle.on('close', () => {
|
|
191
|
+
if (this.watchers.get(dir)?.handle !== handle)
|
|
192
|
+
return;
|
|
193
|
+
this.watchers.delete(dir);
|
|
194
|
+
this.fail('watch-closed');
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
this.watchFailure(error);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
watchFailure(error) {
|
|
204
|
+
this.fail(['ENOSYS', 'ENOTSUP', 'ERR_FEATURE_UNAVAILABLE_ON_PLATFORM'].includes(error.code ?? '') ? 'watch-unsupported' : 'watch-error');
|
|
205
|
+
}
|
|
206
|
+
}
|
|
@@ -24,7 +24,7 @@ export declare class FleetQueryService {
|
|
|
24
24
|
private readonly options;
|
|
25
25
|
private readonly control;
|
|
26
26
|
constructor(options: FleetQueryOptions);
|
|
27
|
-
list(): Promise<Array<{
|
|
27
|
+
list(includeTemporary?: boolean, strict?: boolean): Promise<Array<{
|
|
28
28
|
role: RoleRecord;
|
|
29
29
|
status: RoleStatus;
|
|
30
30
|
capabilities: RoleCapabilities;
|
|
@@ -75,9 +75,9 @@ export class FleetQueryService {
|
|
|
75
75
|
this.options = options;
|
|
76
76
|
this.control = options.control ?? controlRequest;
|
|
77
77
|
}
|
|
78
|
-
async list() {
|
|
79
|
-
const roles = (await this.options.repository.list())
|
|
80
|
-
.filter(role => role.configured && role.lifetime === 'permanent');
|
|
78
|
+
async list(includeTemporary = false, strict = false) {
|
|
79
|
+
const roles = (await this.options.repository.list(strict))
|
|
80
|
+
.filter(role => (role.configured && role.lifetime === 'permanent') || (includeTemporary && role.lifetime === 'temporary'));
|
|
81
81
|
return Promise.all(roles.map(async (role) => {
|
|
82
82
|
const status = await this.status(role);
|
|
83
83
|
return { role, status, capabilities: roleCapabilities(role, status, this.options.capabilityContext) };
|
|
@@ -3,7 +3,6 @@ import { createHmac, randomBytes } from 'node:crypto';
|
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { realExec } from '../exec.js';
|
|
5
5
|
import { logsRoot } from '../paths.js';
|
|
6
|
-
import { unitFor } from '../supervisor/systemd.js';
|
|
7
6
|
import { ROLE_NAME_RE } from '../config.js';
|
|
8
7
|
import { FleetError } from './errors.js';
|
|
9
8
|
const STANDARD_REDACTIONS = [
|
|
@@ -78,12 +77,13 @@ export class StructuredLogService {
|
|
|
78
77
|
}
|
|
79
78
|
async tail(roleId, requested, cursor) {
|
|
80
79
|
const limit = Math.min(Math.max(requested, 1), 1_000);
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
80
|
+
const source = this.backend.logsArgs(roleId, false);
|
|
81
|
+
const args = { cmd: source.cmd, args: [...source.args] };
|
|
82
|
+
const count = args.args.indexOf('-n');
|
|
83
|
+
if (count >= 0)
|
|
84
|
+
args.args[count + 1] = String(limit);
|
|
85
|
+
if (args.cmd === 'journalctl')
|
|
86
|
+
args.args.push('-o', 'json', '--no-pager', '-n', String(limit));
|
|
87
87
|
if (!['journalctl', 'tail', 'tmux'].includes(args.cmd))
|
|
88
88
|
throw new FleetError('capability_unavailable', 'log backend is unsupported');
|
|
89
89
|
const result = await this.exec(args.cmd, args.args);
|
|
@@ -93,7 +93,7 @@ export class StructuredLogService {
|
|
|
93
93
|
const parsed = lines.map((line, index) => {
|
|
94
94
|
let text = line;
|
|
95
95
|
let at;
|
|
96
|
-
if (
|
|
96
|
+
if (args.cmd === 'journalctl') {
|
|
97
97
|
try {
|
|
98
98
|
const json = JSON.parse(line);
|
|
99
99
|
text = typeof json.MESSAGE === 'string' ? json.MESSAGE : line;
|
|
@@ -14,7 +14,7 @@ export interface HarnessModelCatalog {
|
|
|
14
14
|
export declare function codexModelCatalog(path?: string): HarnessModelCatalog;
|
|
15
15
|
/**
|
|
16
16
|
* Claude Code 2.1 has no typed model-list endpoint. These exact IDs are the
|
|
17
|
-
* versioned adapter contract
|
|
17
|
+
* versioned adapter contract verified with CLI 2.1.281, not aliases and
|
|
18
18
|
* not a claim about account entitlement (which Claude validates at launch).
|
|
19
19
|
*/
|
|
20
20
|
export declare function claudeModelCatalog(): HarnessModelCatalog;
|
|
@@ -41,17 +41,20 @@ export function codexModelCatalog(path = join(homedir(), '.codex', 'models_cache
|
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Claude Code 2.1 has no typed model-list endpoint. These exact IDs are the
|
|
44
|
-
* versioned adapter contract
|
|
44
|
+
* versioned adapter contract verified with CLI 2.1.281, not aliases and
|
|
45
45
|
* not a claim about account entitlement (which Claude validates at launch).
|
|
46
46
|
*/
|
|
47
47
|
export function claudeModelCatalog() {
|
|
48
48
|
const reasoningEfforts = ['low', 'medium', 'high', 'xhigh', 'max'];
|
|
49
49
|
return {
|
|
50
50
|
models: [
|
|
51
|
+
{ id: 'claude-fable-5-1', label: 'Claude Fable 5.1', reasoningEfforts, source: 'claude-adapter-2.1' },
|
|
52
|
+
{ id: 'claude-opus-5-5', label: 'Claude Opus 5.5', reasoningEfforts, source: 'claude-adapter-2.1' },
|
|
53
|
+
{ id: 'claude-haiku-4-5-20251001', label: 'Claude Haiku 4.5', reasoningEfforts: [], source: 'claude-adapter-2.1' },
|
|
51
54
|
{ id: 'claude-fable-5', label: 'Claude Fable 5', reasoningEfforts, source: 'claude-adapter-2.1' },
|
|
52
55
|
{ id: 'claude-opus-5', label: 'Claude Opus 5', reasoningEfforts, source: 'claude-adapter-2.1' },
|
|
53
56
|
{ id: 'claude-sonnet-5', label: 'Claude Sonnet 5', reasoningEfforts, source: 'claude-adapter-2.1' },
|
|
54
57
|
],
|
|
55
|
-
warnings: ['Claude Code exposes no typed model-list endpoint; choices
|
|
58
|
+
warnings: ['Claude Code exposes no typed model-list endpoint; choices require a current Claude runtime (verified with 2.1.281); older bundled SDKs need CLAUDE_CODE_EXECUTABLE. Entitlement is validated at launch.'],
|
|
56
59
|
};
|
|
57
60
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const PROVENANCE_KINDS: {
|
|
2
|
+
readonly role: "roles";
|
|
3
|
+
readonly brain: "brains";
|
|
4
|
+
readonly template: "agent_templates";
|
|
5
|
+
readonly layout: "room_layouts";
|
|
6
|
+
};
|
|
7
|
+
export type ProvenanceKind = keyof typeof PROVENANCE_KINDS;
|
|
8
|
+
export type ProvenanceStatus = 'predefined' | 'changed' | 'custom';
|
|
9
|
+
export interface ProvenanceEntry {
|
|
10
|
+
status: ProvenanceStatus;
|
|
11
|
+
preset?: string;
|
|
12
|
+
}
|
|
13
|
+
export type Provenance = Record<ProvenanceKind, Record<string, ProvenanceEntry>>;
|
|
14
|
+
export declare class PresetProvenance {
|
|
15
|
+
private configPath?;
|
|
16
|
+
private presetRoot;
|
|
17
|
+
constructor(configPath?: string | undefined, presetRoot?: string);
|
|
18
|
+
read(): Provenance;
|
|
19
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** Where each configured definition came from, compared with the packaged presets.
|
|
2
|
+
* A definition is `predefined` when it has the same value as the shipped preset of
|
|
3
|
+
* the same name, `changed` when a preset of that name exists but the value differs,
|
|
4
|
+
* and `custom` otherwise. Values are compared after parsing, so the formatting the
|
|
5
|
+
* configuration editor writes does not count as a change. Preset text is returned
|
|
6
|
+
* so users can see exactly what ships; it contains no host data.
|
|
7
|
+
*/
|
|
8
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
9
|
+
import { existsSync, lstatSync, readFileSync, readdirSync } from 'node:fs';
|
|
10
|
+
import { basename, extname, join } from 'node:path';
|
|
11
|
+
import { parse } from 'yaml';
|
|
12
|
+
import { defaultConfigPath } from '../paths.js';
|
|
13
|
+
import { splitRootFor } from '../config.js';
|
|
14
|
+
import { packagedPresetRoot } from '../preset-bootstrap.js';
|
|
15
|
+
export const PROVENANCE_KINDS = { role: 'roles', brain: 'brains', template: 'agent_templates', layout: 'room_layouts' };
|
|
16
|
+
const MAX_BYTES = 256 * 1024;
|
|
17
|
+
/** Regular, bounded YAML files of one directory, by definition name. Anything else is skipped. */
|
|
18
|
+
function yamlFiles(dir) {
|
|
19
|
+
const files = new Map();
|
|
20
|
+
if (!existsSync(dir) || !lstatSync(dir).isDirectory())
|
|
21
|
+
return files;
|
|
22
|
+
for (const file of readdirSync(dir).sort()) {
|
|
23
|
+
if (!/\.ya?ml$/.test(file))
|
|
24
|
+
continue;
|
|
25
|
+
const path = join(dir, file), stat = lstatSync(path);
|
|
26
|
+
if (!stat.isFile() || stat.size > MAX_BYTES)
|
|
27
|
+
continue;
|
|
28
|
+
files.set(basename(file, extname(file)), readFileSync(path, 'utf8'));
|
|
29
|
+
}
|
|
30
|
+
return files;
|
|
31
|
+
}
|
|
32
|
+
const parsed = (text) => { try {
|
|
33
|
+
return parse(text);
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return Symbol('unparseable');
|
|
37
|
+
} };
|
|
38
|
+
export class PresetProvenance {
|
|
39
|
+
configPath;
|
|
40
|
+
presetRoot;
|
|
41
|
+
constructor(configPath, presetRoot = join(packagedPresetRoot(), 'fleet')) {
|
|
42
|
+
this.configPath = configPath;
|
|
43
|
+
this.presetRoot = presetRoot;
|
|
44
|
+
}
|
|
45
|
+
read() {
|
|
46
|
+
const split = splitRootFor(this.configPath ?? defaultConfigPath());
|
|
47
|
+
const result = {};
|
|
48
|
+
for (const [kind, dir] of Object.entries(PROVENANCE_KINDS)) {
|
|
49
|
+
const presets = yamlFiles(join(this.presetRoot, dir)), installed = yamlFiles(join(split, dir));
|
|
50
|
+
result[kind] = Object.fromEntries([...installed].map(([name, text]) => {
|
|
51
|
+
const preset = presets.get(name);
|
|
52
|
+
if (preset === undefined)
|
|
53
|
+
return [name, { status: 'custom' }];
|
|
54
|
+
return [name, { status: isDeepStrictEqual(parsed(text), parsed(preset)) ? 'predefined' : 'changed', preset }];
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type FSWatcher } from 'node:fs';
|
|
2
|
+
export interface FleetResourceState {
|
|
3
|
+
protocolVersion: 1;
|
|
4
|
+
producerGeneration: string;
|
|
5
|
+
position: number;
|
|
6
|
+
health: 'healthy' | 'failed' | 'unsupported';
|
|
7
|
+
}
|
|
8
|
+
export interface FleetResourceScope {
|
|
9
|
+
configPath?: string;
|
|
10
|
+
subscribeMutations?: (listener: () => void) => () => void;
|
|
11
|
+
/** Durable notification owners may reinstall degraded watches without idle content polling. */
|
|
12
|
+
retryWatchFailures?: boolean;
|
|
13
|
+
roots?: string[];
|
|
14
|
+
/** Overrides full Fleet discovery for narrow owners such as task delivery. */
|
|
15
|
+
paths?: string[];
|
|
16
|
+
/** Path routing precedes a coalesced committed callback. Undefined means
|
|
17
|
+
* unknown/recovered coverage and requires conservative discovery. */
|
|
18
|
+
onInvalidated?: (path: string | undefined) => void;
|
|
19
|
+
watch?: (path: string, listener: (event: string, filename: string | null) => void) => Pick<FSWatcher, 'on' | 'close'>;
|
|
20
|
+
}
|
|
21
|
+
/** Only call after durable persistence succeeds. Observers cannot fail a commit. */
|
|
22
|
+
export declare function publishFleetResourceCommit(path: string): void;
|
|
23
|
+
/** Native notifications cover supported local mounts. No idle content scan or
|
|
24
|
+
* silent claim of coverage after watch failure. Parents survive atomic rename.
|
|
25
|
+
* Discovery reads directory metadata only, never opens a controller or transcript. */
|
|
26
|
+
export declare function observeFleetResources(scope: FleetResourceScope, onCommitted: (state: FleetResourceState) => void, signal: AbortSignal): {
|
|
27
|
+
snapshot: () => {
|
|
28
|
+
health: "healthy" | "failed" | "unsupported";
|
|
29
|
+
protocolVersion: 1;
|
|
30
|
+
producerGeneration: string;
|
|
31
|
+
position: number;
|
|
32
|
+
};
|
|
33
|
+
cursor: (accepts: (path: string) => boolean, lifetime: AbortSignal) => {
|
|
34
|
+
snapshot: () => {
|
|
35
|
+
position: number;
|
|
36
|
+
health: "healthy" | "failed" | "unsupported";
|
|
37
|
+
protocolVersion: 1;
|
|
38
|
+
producerGeneration: string;
|
|
39
|
+
};
|
|
40
|
+
dispose: () => void;
|
|
41
|
+
};
|
|
42
|
+
dispose: () => void;
|
|
43
|
+
};
|