@chankov/agent-fleet 2.1.2 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.pi/agent-fleet/hooks/coms-stop-hook.mjs +53 -13
- package/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/README.md +223 -0
- package/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile-0.167.json +5627 -0
- package/.pi/agent-fleet/scripts/fleet-codex-local-mcp.ts +4 -0
- package/.pi/agent-fleet/scripts/fleet.ts +13 -17
- package/.pi/agent-fleet/scripts/flow.ts +2 -2
- package/.pi/agent-fleet/scripts/lib/codex-bootstrap-files.ts +46 -0
- package/.pi/agent-fleet/scripts/lib/codex-bootstrap-probe.ts +44 -0
- package/.pi/agent-fleet/scripts/lib/codex-bootstrap-producer.ts +131 -0
- package/.pi/agent-fleet/scripts/lib/codex-daemon-observer.ts +137 -0
- package/.pi/agent-fleet/scripts/lib/codex-desktop-discovery.ts +84 -0
- package/.pi/agent-fleet/scripts/lib/codex-desktop-preflight.ts +130 -0
- package/.pi/agent-fleet/scripts/lib/codex-desktop-queue-host.ts +20 -13
- package/.pi/agent-fleet/scripts/lib/codex-measurement.ts +218 -0
- package/.pi/agent-fleet/scripts/lib/codex-native-presence.ts +61 -0
- package/.pi/agent-fleet/scripts/lib/codex-probe-transcript.ts +135 -0
- package/.pi/agent-fleet/scripts/lib/codex-send-lineage.ts +72 -0
- package/.pi/agent-fleet/scripts/lib/codex-unix-queue-rpc.ts +23 -13
- package/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist-store.ts +100 -14
- package/.pi/agent-fleet/scripts/lib/fleet-codex-answers.ts +1 -1
- package/.pi/agent-fleet/scripts/lib/fleet-codex-bootstrap.ts +204 -0
- package/.pi/agent-fleet/scripts/lib/fleet-codex-connections.ts +9 -3
- package/.pi/agent-fleet/scripts/lib/fleet-codex-event-runtime.ts +32 -16
- package/.pi/agent-fleet/scripts/lib/fleet-codex-local-mcp.ts +41 -21
- package/.pi/agent-fleet/scripts/lib/fleet-codex-permission-transport.ts +21 -0
- package/.pi/agent-fleet/scripts/lib/fleet-command.ts +4 -8
- package/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +2 -1
- package/.pi/agent-fleet/scripts/lib/team-project.ts +0 -2
- package/.pi/agent-fleet/scripts/team-up.ts +5 -12
- package/.pi/agent-fleet/scripts/workflows/lib/git.ts +9 -0
- package/.pi/agent-fleet/scripts/workflows/lib/quality.ts +17 -4
- package/.pi/agents/model-profiles.yaml +0 -2
- package/.pi/harnesses/agent-hub/README.md +116 -67
- package/.pi/harnesses/agent-hub/capability-packs.ts +7 -4
- package/.pi/harnesses/agent-hub/codex-bootstrap.ts +117 -0
- package/.pi/harnesses/agent-hub/commands/context.ts +0 -4
- package/.pi/harnesses/agent-hub/commands/recover.ts +2 -1
- package/.pi/harnesses/agent-hub/config/agents.ts +3 -1
- package/.pi/harnesses/agent-hub/config/model-profiles.ts +3 -0
- package/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +14 -1
- package/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +17 -0
- package/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +3 -1
- package/.pi/harnesses/agent-hub/dispatch-native-types.ts +4 -0
- package/.pi/harnesses/agent-hub/dispatch-native.ts +9 -3
- package/.pi/harnesses/agent-hub/drift-watchdog.js +5 -10
- package/.pi/harnesses/agent-hub/execution-trace.ts +1 -1
- package/.pi/harnesses/agent-hub/filesystem-tool.ts +1 -1
- package/.pi/harnesses/agent-hub/footer.ts +2 -3
- package/.pi/harnesses/agent-hub/helpers.ts +4 -5
- package/.pi/harnesses/agent-hub/history-projection.ts +1 -1
- package/.pi/harnesses/agent-hub/index.ts +213 -196
- package/.pi/harnesses/agent-hub/input/shortcuts.ts +0 -7
- package/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +0 -2
- package/.pi/harnesses/agent-hub/no-progress.ts +14 -9
- package/.pi/harnesses/agent-hub/operator-current-state.ts +5 -1
- package/.pi/harnesses/agent-hub/package.json +1 -1
- package/.pi/harnesses/agent-hub/policy/roster.ts +12 -3
- package/.pi/harnesses/agent-hub/policy/work-mode.ts +10 -49
- package/.pi/harnesses/agent-hub/poll-command.ts +12 -4
- package/.pi/harnesses/agent-hub/proactive-snapshot.ts +12 -4
- package/.pi/harnesses/agent-hub/process-obligations.ts +42 -9
- package/.pi/harnesses/agent-hub/prompts/context.ts +17 -0
- package/.pi/harnesses/agent-hub/prompts/fragments.ts +9 -1
- package/.pi/harnesses/agent-hub/prompts/session-start.ts +2 -3
- package/.pi/harnesses/agent-hub/prompts/system-prompt.ts +25 -8
- package/.pi/harnesses/agent-hub/provider-semaphore.js +5 -0
- package/.pi/harnesses/agent-hub/review-continuity.ts +5 -2
- package/.pi/harnesses/agent-hub/review-reuse.ts +2 -1
- package/.pi/harnesses/agent-hub/run-budget.js +22 -2
- package/.pi/harnesses/agent-hub/scope-gate.js +38 -0
- package/.pi/harnesses/agent-hub/scope-overlap.ts +46 -0
- package/.pi/harnesses/agent-hub/task-brief.ts +98 -0
- package/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +4 -0
- package/.pi/harnesses/agent-hub/tool-catalog-state.ts +5 -3
- package/.pi/harnesses/agent-hub/tools/action-executors.ts +5 -7
- package/.pi/harnesses/agent-hub/tools/context.ts +2 -0
- package/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +2 -1
- package/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +184 -33
- package/.pi/harnesses/agent-hub/tools/poll-panel-core.ts +30 -0
- package/.pi/harnesses/agent-hub/tools/poll-panel.ts +33 -0
- package/.pi/harnesses/agent-hub/tools/run-flow.ts +41 -10
- package/.pi/harnesses/agent-hub/tools/team-adjust.ts +1 -1
- package/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +12 -2
- package/.pi/harnesses/agent-hub/work-mode.ts +44 -49
- package/.pi/harnesses/agent-hub/write-isolation.ts +53 -8
- package/.pi/harnesses/coms/package.json +1 -1
- package/.pi/harnesses/damage-control-continue/package.json +1 -1
- package/.pi/harnesses/lib/codex-compat.ts +97 -0
- package/.pi/harnesses/lib/codex-contract.ts +259 -0
- package/.pi/harnesses/lib/codex-notification-profile.ts +75 -0
- package/.pi/harnesses/lib/coms-core.ts +8 -4
- package/.pi/harnesses/lib/context-budget-child-prompt.ts +1 -1
- package/.pi/harnesses/lib/context-budget-hub-prompt.ts +6 -3
- package/.pi/harnesses/lib/fleet-bootstrap-channel.ts +148 -0
- package/.pi/harnesses/lib/fleet-codex-catalog.ts +30 -0
- package/.pi/harnesses/lib/fleet-codex-chat-view.ts +43 -0
- package/.pi/harnesses/lib/fleet-codex-namespace.ts +2 -0
- package/.pi/harnesses/lib/fleet-codex-policy-snapshot.ts +10 -0
- package/.pi/harnesses/lib/fleet-connection-control.ts +20 -3
- package/.pi/harnesses/lib/fleet-notification-admission.ts +32 -0
- package/.pi/harnesses/lib/fleet-notification-bootstrap.ts +152 -0
- package/.pi/harnesses/lib/fleet-notification-validation.ts +80 -25
- package/.pi/harnesses/lib/fleet-target-identity.ts +9 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/README.md +347 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/.versions/2.2.0/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
- package/.versions/2.2.0/.pi/agent-fleet/hooks/coms-stop-hook.mjs +124 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/coms-claude-bridge.ts +440 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/coms-cli.ts +430 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +416 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/exec-at-target.ts +10 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/0.167-shared.json +1900 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/README.md +223 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/assessment.md +83 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile-0.167.json +5627 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap-profile.md +43 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/bootstrap.md +45 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/capture-profile.ts +53 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/capture.ts +102 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/catalog.md +91 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/channel.md +21 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/measurement.md +133 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/measurements.json +74 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/notification-profile-0.167.json +2679 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/observer.md +101 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/opaque-response.md +57 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/open-sent.md +68 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/probe-reader.md +51 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/profile.md +71 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/projection.md +147 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/reconnect.md +40 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/response-unions.md +74 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/semver.md +124 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/codex-notification-contracts/surface.md +73 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/fleet-codex-allowlist-store-child.ts +31 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fixtures/response-fixture.ts +23 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fleet-codex-local-mcp.mjs +26 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fleet-codex-local-mcp.ts +63 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/fleet.ts +244 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/flow.ts +166 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +208 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-bootstrap-files.ts +46 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-bootstrap-probe.ts +44 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-bootstrap-producer.ts +131 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-daemon-observer.ts +137 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-desktop-discovery.ts +84 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-desktop-preflight.ts +130 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-desktop-queue-host.ts +113 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-measurement.ts +218 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-native-presence.ts +61 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-probe-transcript.ts +135 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-send-lineage.ts +72 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/codex-unix-queue-rpc.ts +101 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist-store.ts +453 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-allowlist.ts +175 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-answer-transport.ts +73 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-answers.ts +74 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-bootstrap.ts +204 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-connections.ts +76 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-event-reply.ts +58 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-event-runtime.ts +132 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-store.ts +428 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-instruction-transport.ts +160 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-instructions.ts +175 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-local-mcp.ts +435 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-native-history.ts +215 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-observation-store.ts +208 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-observe-transport.ts +49 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-observe.ts +93 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-overview.ts +52 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-permission-transport.ts +44 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-permissions.ts +83 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-readonly.ts +213 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-relay-latency.ts +45 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-response-read.ts +26 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-response-transport.ts +38 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-codex-resync.ts +212 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/fleet-command.ts +264 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/flow-command.ts +107 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +239 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/peer-target.ts +1 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/resource-closure.js +1 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/session-launch.ts +56 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/team-project.ts +176 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/lib/team-snapshot.ts +160 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/package-lock.json +57 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/package.json +10 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/peer-launch.ts +289 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/pi-session.ts +9 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/team-snapshot.ts +245 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/team-up.ts +378 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +181 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/env.ts +36 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/git.ts +108 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +130 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +137 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +37 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/quality.ts +78 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/run.ts +109 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/trace.ts +52 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/writer-lease-race.worker.mjs +36 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +148 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
- package/.versions/2.2.0/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
- package/.versions/2.2.0/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/2.2.0/.pi/agents/model-profiles.yaml +132 -0
- package/.versions/2.2.0/.pi/agents/peers.yaml +147 -0
- package/.versions/2.2.0/.pi/agents/teams.yaml +41 -0
- package/.versions/2.2.0/.pi/agents/voices.yaml +13 -0
- package/.versions/2.2.0/.pi/damage-control-rules.yaml +297 -0
- package/.versions/2.2.0/.pi/extensions/btw/README.md +120 -0
- package/.versions/2.2.0/.pi/extensions/btw/index.ts +916 -0
- package/.versions/2.2.0/.pi/extensions/btw/package.json +6 -0
- package/.versions/2.2.0/.pi/extensions/btw/state.js +179 -0
- package/.versions/2.2.0/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
- package/.versions/2.2.0/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
- package/.versions/2.2.0/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/2.2.0/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/2.2.0/.pi/extensions/compact-and-continue/index.ts +136 -0
- package/.versions/2.2.0/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/2.2.0/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/2.2.0/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/2.2.0/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/2.2.0/.pi/extensions/package-lock.json +1175 -0
- package/.versions/2.2.0/.pi/extensions/package.json +9 -0
- package/.versions/2.2.0/.pi/extensions/pi-voice-stt/README.md +224 -0
- package/.versions/2.2.0/.pi/extensions/pi-voice-stt/config.ts +199 -0
- package/.versions/2.2.0/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/2.2.0/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/2.2.0/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/2.2.0/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/2.2.0/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/README.md +1633 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/acceptance.ts +204 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/access-approval.ts +266 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/action-authorization.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-contract.ts +43 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-evidence.ts +64 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-hub.ts +55 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-runtime.ts +56 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-sources-worker.mjs +4 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-sources.ts +74 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/agentic-state.ts +23 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/approval-wait.ts +1 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/artifacts.js +146 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/assertion-ledger.js +68 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/assist-profile.ts +19 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/backend-policy.js +174 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/budget-recovery.ts +123 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/capability-packs.ts +187 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/codex-bootstrap.ts +117 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/config.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/context.ts +43 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/models.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/recover.ts +62 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/task-triage-recover.ts +12 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/task-triage-waive.ts +12 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/config/agents.ts +183 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/config/model-profiles.ts +240 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/config/overrides.ts +166 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +234 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context/budgets.ts +152 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-compaction-monitor.ts +35 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-compaction-preflight.ts +21 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-compaction-runtime.ts +69 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-compaction.ts +34 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-broker.ts +44 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-child.ts +83 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-client.ts +22 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-compat.ts +45 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-owners.ts +17 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity-registry.ts +8 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-continuity.ts +82 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-pressure.ts +222 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/context-window.js +108 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-approval.ts +83 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-broker.ts +125 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-contract.ts +22 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-descendant.ts +76 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-hub.ts +263 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-identity.ts +12 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-owners.ts +59 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-state.ts +43 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/damage-guard-test-tsconfig.json +19 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/debate-command.ts +176 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/delegate.ts +478 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/deterministic-fs.ts +195 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-coms.ts +258 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-native-complete.ts +176 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +318 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +264 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-native-types.ts +297 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-native.ts +242 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-triage-contract.ts +27 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +77 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-triage-policy.ts +29 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +55 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/dispatch-triage-state.ts +33 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/docs-lane.js +123 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/drift-watchdog.js +344 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/evidence-manifest.ts +51 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/execution-evidence.ts +96 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/execution-trace.ts +241 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/external-blocker.js +92 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/adapters.ts +88 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/broker-client.ts +62 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/broker.ts +128 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/child-extension.ts +42 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/descendant.ts +67 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/discovery-worker.mjs +15 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/discovery.ts +126 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/evaluate.ts +57 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/hub.ts +170 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/native-context.ts +8 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/native-fixture.test-support.ts +108 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/owners.ts +100 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/results.ts +55 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/runtime.ts +130 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/semantic-profiles.ts +18 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/sources.ts +69 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/file-discovery/state.ts +22 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/filesystem-tool.ts +166 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/fixtures/registration-surface.json +68 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/footer.ts +29 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/helpers.ts +269 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/history-projection.ts +116 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/hub-state-audit.js +41 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/index.ts +2722 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/input/completions.ts +82 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/input/shortcuts.ts +16 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +231 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +143 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +90 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/no-progress.ts +627 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/operator-current-state.ts +57 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/operator-watchdog.ts +97 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/orchestration-activation.ts +109 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/orchestration-metrics.ts +78 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/orchestration-route.ts +68 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/permission-channel.ts +87 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/permission-relay.ts +84 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/policy/models.ts +153 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/policy/roster.ts +103 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/policy/work-mode.ts +103 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/poll-command.ts +184 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/presentation.ts +54 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/private-config-current-state.ts +81 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/private-config-fixtures.ts +26 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/private-config-review.ts +100 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-config.ts +22 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-external-git.ts +82 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-external.ts +142 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-local.ts +89 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-observer.ts +106 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-rules.ts +171 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-runtime.ts +318 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-snapshot.ts +287 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/proactive-types.ts +70 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/process-obligations.ts +210 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/prompts/context.ts +72 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/prompts/fragments.ts +94 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/prompts/session-start.ts +89 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/prompts/system-prompt.ts +142 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/provider-semaphore.js +143 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/reconcile.ts +26 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/recover-policy.ts +44 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/recover-state.ts +104 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/recovery-contract.ts +151 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/rerun-policy.ts +40 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/research/controls.ts +74 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/research/runtime.ts +215 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/research/spawn-run.ts +221 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/return-contract.js +371 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/return-extract.js +77 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/review-closure.ts +43 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/review-continuity.ts +76 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/review-findings.js +96 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/review-reuse.ts +48 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/review-verdict.ts +6 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/routing-observation.ts +41 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/routing-proposal.ts +46 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/run-budget.js +362 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/run-namespace.js +93 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/runtime-receipts.ts +63 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/runtime-test-check.ts +85 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/safety-routing.ts +28 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/scope-gate.js +271 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/scope-overlap.ts +46 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/session-audit.ts +331 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/session-start.ts +42 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/spawn.ts +702 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/specialist-result-receipt.ts +13 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/specialist-result.ts +78 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/system1-activity.ts +625 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/system1-communication-store.ts +225 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/system1-report.ts +275 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/system1-runtime.ts +271 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-brief.ts +98 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-continuation.ts +4 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-resume-contract.ts +80 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-authorization.ts +170 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-config.ts +21 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-contract.ts +14 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-live-stage-boundary.mjs +49 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-obligations.ts +120 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-policy.ts +16 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-review-contract.mjs +43 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-reviewer-only-contract.mjs +156 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-reviewer-only-diagnostics.mjs +112 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-runtime.ts +130 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +21 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/task-triage-state.ts +46 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/timeline.ts +72 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +83 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tool-catalog-state.ts +125 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/action-executors.ts +214 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/ask-system1-files.ts +15 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/ask-system1.ts +25 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/context.ts +149 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +93 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +928 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/dispatch-triage.ts +16 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/fleet-tools.ts +201 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/herdr-executors.ts +100 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/poll-panel-core.ts +30 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/poll-panel.ts +33 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/run-flow.ts +177 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/spawn-research.ts +67 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tools/verification-contract.ts +81 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/tsconfig.json +22 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/types.ts +66 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/context-budget.ts +89 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/detail-panel.ts +192 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +173 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/fleet-source.ts +179 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/grid.ts +159 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/history.ts +234 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/system1-communication.ts +59 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/version.ts +42 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/work-mode.ts +183 -0
- package/.versions/2.2.0/.pi/harnesses/agent-hub/write-isolation.ts +232 -0
- package/.versions/2.2.0/.pi/harnesses/ask-user-remote/README.md +59 -0
- package/.versions/2.2.0/.pi/harnesses/ask-user-remote/index.ts +571 -0
- package/.versions/2.2.0/.pi/harnesses/ask-user-remote/questions.ts +206 -0
- package/.versions/2.2.0/.pi/harnesses/ask-user-remote/race-core.js +124 -0
- package/.versions/2.2.0/.pi/harnesses/ask-user-remote/runtime-ask.ts +90 -0
- package/.versions/2.2.0/.pi/harnesses/coms/README.md +105 -0
- package/.versions/2.2.0/.pi/harnesses/coms/index.ts +308 -0
- package/.versions/2.2.0/.pi/harnesses/coms/package.json +7 -0
- package/.versions/2.2.0/.pi/harnesses/coms/version.ts +42 -0
- package/.versions/2.2.0/.pi/harnesses/damage-control-continue/README.md +161 -0
- package/.versions/2.2.0/.pi/harnesses/damage-control-continue/index.ts +659 -0
- package/.versions/2.2.0/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/2.2.0/.pi/harnesses/damage-control-continue/result-screen.ts +98 -0
- package/.versions/2.2.0/.pi/harnesses/damage-control-continue/system1-child.ts +45 -0
- package/.versions/2.2.0/.pi/harnesses/damage-control-continue/system1-client.ts +85 -0
- package/.versions/2.2.0/.pi/harnesses/damage-control-continue/system1-guard.ts +65 -0
- package/.versions/2.2.0/.pi/harnesses/damage-control-continue/version.ts +42 -0
- package/.versions/2.2.0/.pi/harnesses/lib/approval-wait.ts +17 -0
- package/.versions/2.2.0/.pi/harnesses/lib/bash-policy-analysis.ts +185 -0
- package/.versions/2.2.0/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
- package/.versions/2.2.0/.pi/harnesses/lib/clarification-policy.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/lib/codex-compat.ts +97 -0
- package/.versions/2.2.0/.pi/harnesses/lib/codex-contract.ts +259 -0
- package/.versions/2.2.0/.pi/harnesses/lib/codex-notification-profile.ts +75 -0
- package/.versions/2.2.0/.pi/harnesses/lib/coms-core-io.ts +422 -0
- package/.versions/2.2.0/.pi/harnesses/lib/coms-core.ts +738 -0
- package/.versions/2.2.0/.pi/harnesses/lib/coms-instruction-receipts.ts +113 -0
- package/.versions/2.2.0/.pi/harnesses/lib/coms-observation.ts +74 -0
- package/.versions/2.2.0/.pi/harnesses/lib/coms-registry-entry.ts +99 -0
- package/.versions/2.2.0/.pi/harnesses/lib/coms-response-read.ts +107 -0
- package/.versions/2.2.0/.pi/harnesses/lib/context-budget-child-prompt.ts +214 -0
- package/.versions/2.2.0/.pi/harnesses/lib/context-budget-hub-prompt.ts +124 -0
- package/.versions/2.2.0/.pi/harnesses/lib/context-budget-view.ts +112 -0
- package/.versions/2.2.0/.pi/harnesses/lib/context-budget.ts +114 -0
- package/.versions/2.2.0/.pi/harnesses/lib/context-compaction-policy.js +35 -0
- package/.versions/2.2.0/.pi/harnesses/lib/damage-action-hash.ts +28 -0
- package/.versions/2.2.0/.pi/harnesses/lib/damage-auto-policy.ts +52 -0
- package/.versions/2.2.0/.pi/harnesses/lib/damage-control-presentation.ts +14 -0
- package/.versions/2.2.0/.pi/harnesses/lib/damage-control-shared.ts +276 -0
- package/.versions/2.2.0/.pi/harnesses/lib/damage-guard-port.ts +25 -0
- package/.versions/2.2.0/.pi/harnesses/lib/damage-policy.ts +35 -0
- package/.versions/2.2.0/.pi/harnesses/lib/damage-result-evidence.ts +25 -0
- package/.versions/2.2.0/.pi/harnesses/lib/damage-result-view.ts +16 -0
- package/.versions/2.2.0/.pi/harnesses/lib/deterministic-handle-path.ts +25 -0
- package/.versions/2.2.0/.pi/harnesses/lib/exact-permission-port.ts +38 -0
- package/.versions/2.2.0/.pi/harnesses/lib/execution-trace.ts +45 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-bootstrap-channel.ts +148 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-codex-catalog.ts +30 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-codex-chat-view.ts +43 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-codex-event-bridge.ts +82 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-codex-namespace.ts +2 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-codex-policy-snapshot.ts +10 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/cli-bridge.ts +111 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/mutations.ts +201 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/snapshot.ts +417 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/transition.ts +68 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/ui.ts +269 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-config/view.ts +338 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-connection-control.ts +94 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-dashboard-view.ts +174 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-detail-view.ts +339 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-event-source.ts +21 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-notification-admission.ts +32 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-notification-bootstrap.ts +152 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-notification-validation.ts +122 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-overlay.ts +26 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-panel.ts +34 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-question-reference.ts +42 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-read-model.ts +609 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-selection.ts +24 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-strip-controller.ts +75 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-strip-view.ts +179 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-target-identity.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
- package/.versions/2.2.0/.pi/harnesses/lib/herdr-client.ts +472 -0
- package/.versions/2.2.0/.pi/harnesses/lib/herdr-presence.ts +399 -0
- package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
- package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
- package/.versions/2.2.0/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
- package/.versions/2.2.0/.pi/harnesses/lib/identical-dialog.ts +27 -0
- package/.versions/2.2.0/.pi/harnesses/lib/installation-state.js +62 -0
- package/.versions/2.2.0/.pi/harnesses/lib/peer-target.ts +24 -0
- package/.versions/2.2.0/.pi/harnesses/lib/policy-roots.js +117 -0
- package/.versions/2.2.0/.pi/harnesses/lib/policy-roots.ts +32 -0
- package/.versions/2.2.0/.pi/harnesses/lib/process-shared.ts +9 -0
- package/.versions/2.2.0/.pi/harnesses/lib/resource-closure.js +26 -0
- package/.versions/2.2.0/.pi/harnesses/lib/safe-source-read.js +29 -0
- package/.versions/2.2.0/.pi/harnesses/lib/semantic-approval.ts +80 -0
- package/.versions/2.2.0/.pi/harnesses/lib/session-target.ts +62 -0
- package/.versions/2.2.0/.pi/harnesses/lib/spawned-peers.js +191 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/config-agentic.js +15 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/config-context-compaction.js +16 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/config-damage-guard.js +24 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/config-file-discovery.js +23 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/config-json.js +37 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/config-loader.js +53 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/config-proactive.js +68 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/config-triage.js +42 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/config-v2.js +112 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/config.js +50 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/contracts.ts +154 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/demo.ts +95 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/jev.ts +503 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/payload-screen.ts +65 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/selection.js +11 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/service.ts +245 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/worktree-scopes.js +110 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/worktree-scopes.ts +13 -0
- package/.versions/2.2.0/.pi/harnesses/lib/system1/worktree-service.ts +24 -0
- package/.versions/2.2.0/.pi/harnesses/lib/target-capabilities.js +7 -0
- package/.versions/2.2.0/.pi/harnesses/lib/update-check.ts +227 -0
- package/.versions/2.2.0/.pi/harnesses/lib/workspace-context.js +115 -0
- package/.versions/2.2.0/.pi/harnesses/lib/workspace-context.ts +22 -0
- package/.versions/2.2.0/.pi/harnesses/package-lock.json +2121 -0
- package/.versions/2.2.0/.pi/harnesses/package.json +13 -0
- package/.versions/2.2.0/.pi/prompts/af-build.md +27 -0
- package/.versions/2.2.0/.pi/prompts/af-code-simplify.md +22 -0
- package/.versions/2.2.0/.pi/prompts/af-constraints.md +31 -0
- package/.versions/2.2.0/.pi/prompts/af-plan.md +17 -0
- package/.versions/2.2.0/.pi/prompts/af-review.md +16 -0
- package/.versions/2.2.0/.pi/prompts/af-set-hermes-telegram.md +15 -0
- package/.versions/2.2.0/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/2.2.0/.pi/prompts/af-setup-rules.md +20 -0
- package/.versions/2.2.0/.pi/prompts/af-ship.md +17 -0
- package/.versions/2.2.0/.pi/prompts/af-spec.md +15 -0
- package/.versions/2.2.0/.pi/prompts/af-test.md +19 -0
- package/.versions/2.2.0/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/2.2.0/.version +1 -0
- package/.versions/2.2.0/agents/architect.md +24 -0
- package/.versions/2.2.0/agents/bowser.md +28 -0
- package/.versions/2.2.0/agents/builder.md +55 -0
- package/.versions/2.2.0/agents/code-reviewer.md +209 -0
- package/.versions/2.2.0/agents/deep-researcher.md +32 -0
- package/.versions/2.2.0/agents/documenter.md +22 -0
- package/.versions/2.2.0/agents/plan-reviewer.md +83 -0
- package/.versions/2.2.0/agents/planner.md +107 -0
- package/.versions/2.2.0/agents/releaser.md +24 -0
- package/.versions/2.2.0/agents/researcher.md +30 -0
- package/.versions/2.2.0/agents/security-auditor.md +167 -0
- package/.versions/2.2.0/agents/test-engineer.md +153 -0
- package/.versions/2.2.0/agents/web-debugger.md +44 -0
- package/.versions/2.2.0/agents/web-performance-auditor.md +194 -0
- package/.versions/2.2.0/bin/catalog/harness-runtime-closure.json +85 -0
- package/.versions/2.2.0/docs/ARCHITECTURE.md +1291 -0
- package/.versions/2.2.0/docs/agent-fleet-setup.md +1161 -0
- package/.versions/2.2.0/docs/claude-code-coms-bridge.md +147 -0
- package/.versions/2.2.0/docs/codex-local-mcp.md +520 -0
- package/.versions/2.2.0/docs/codex-session-bridge.md +44 -0
- package/.versions/2.2.0/docs/codex-setup.md +183 -0
- package/.versions/2.2.0/docs/coms-hermes-bridge.md +188 -0
- package/.versions/2.2.0/docs/fleet-native-voice.md +151 -0
- package/.versions/2.2.0/docs/getting-started.md +126 -0
- package/.versions/2.2.0/docs/npm-install.md +535 -0
- package/.versions/2.2.0/docs/pi-extensions.md +450 -0
- package/.versions/2.2.0/docs/pi-setup.md +92 -0
- package/.versions/2.2.0/docs/skill-anatomy.md +150 -0
- package/.versions/2.2.0/install-manifest.json +3226 -0
- package/.versions/2.2.0/justfile +246 -0
- package/.versions/2.2.0/manifest-meta.json +1098 -0
- package/.versions/2.2.0/references/accessibility-checklist.md +160 -0
- package/.versions/2.2.0/references/communication-contract.md +26 -0
- package/.versions/2.2.0/references/definition-of-done.md +67 -0
- package/.versions/2.2.0/references/fleet-coordination-patterns.md +171 -0
- package/.versions/2.2.0/references/observability-checklist.md +92 -0
- package/.versions/2.2.0/references/orchestration-patterns.md +370 -0
- package/.versions/2.2.0/references/performance-checklist.md +236 -0
- package/.versions/2.2.0/references/prompting-patterns.md +380 -0
- package/.versions/2.2.0/references/security-checklist.md +245 -0
- package/.versions/2.2.0/references/testing-patterns.md +235 -0
- package/.versions/2.2.0/references/workflow-authoring.md +304 -0
- package/.versions/2.2.0/skills/_internal/grilling.md +59 -0
- package/.versions/2.2.0/skills/browser-testing-with-devtools/SKILL.md +351 -0
- package/.versions/2.2.0/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.2.0/skills/compound-learning/SKILL.md +137 -0
- package/.versions/2.2.0/skills/constraint-driven-development/SKILL.md +338 -0
- package/.versions/2.2.0/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.2.0/skills/context-engineering/SKILL.md +341 -0
- package/.versions/2.2.0/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.2.0/skills/designing-agents/SKILL.md +394 -0
- package/.versions/2.2.0/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/2.2.0/skills/drafting-workflows/SKILL.md +143 -0
- package/.versions/2.2.0/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
- package/.versions/2.2.0/skills/fleet-connect/SKILL.md +29 -0
- package/.versions/2.2.0/skills/fleet-connect.zip +0 -0
- package/.versions/2.2.0/skills/fleet-native-voice/SKILL.md +103 -0
- package/.versions/2.2.0/skills/fleet-native-voice/agents/openai.yaml +4 -0
- package/.versions/2.2.0/skills/fleet-native-voice.zip +0 -0
- package/.versions/2.2.0/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.2.0/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/2.2.0/skills/idea-refine/SKILL.md +182 -0
- package/.versions/2.2.0/skills/idea-refine/examples.md +238 -0
- package/.versions/2.2.0/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.2.0/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.2.0/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.2.0/skills/incremental-implementation/SKILL.md +353 -0
- package/.versions/2.2.0/skills/incremental-implementation.zip +0 -0
- package/.versions/2.2.0/skills/interview-me/SKILL.md +226 -0
- package/.versions/2.2.0/skills/orchestration-verification/SKILL.md +182 -0
- package/.versions/2.2.0/skills/peer-coms/SKILL.md +90 -0
- package/.versions/2.2.0/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.2.0/skills/planning-and-task-breakdown/SKILL.md +318 -0
- package/.versions/2.2.0/skills/planning-and-task-breakdown.zip +0 -0
- package/.versions/2.2.0/skills/repository-ai-setup/SKILL.md +135 -0
- package/.versions/2.2.0/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
- package/.versions/2.2.0/skills/repository-ai-setup/references/apply-contract.md +74 -0
- package/.versions/2.2.0/skills/repository-ai-setup/references/provenance-template.md +16 -0
- package/.versions/2.2.0/skills/repository-ai-setup/references/setup-flow.md +108 -0
- package/.versions/2.2.0/skills/repository-ai-setup/references/verify-setup.md +20 -0
- package/.versions/2.2.0/skills/repository-ai-setup.zip +0 -0
- package/.versions/2.2.0/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.2.0/skills/spec-driven-development/SKILL.md +295 -0
- package/.versions/2.2.0/skills/spec-driven-development.zip +0 -0
- package/.versions/2.2.0/skills/using-agent-skills/SKILL.md +198 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/README.md +430 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
- package/.versions/2.2.0/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
- package/CHANGELOG.md +33 -0
- package/README.md +7 -10
- package/bin/lib/set-codex-mcp.js +1 -1
- package/bin/lib/validate-overrides.js +8 -1
- package/docs/ARCHITECTURE.md +122 -26
- package/docs/MIGRATION-agent-fleet.md +26 -5
- package/docs/agent-fleet-setup.md +44 -26
- package/docs/claude-code-coms-bridge.md +1 -1
- package/docs/codex-local-mcp.md +29 -12
- package/docs/codex-session-bridge.md +2 -2
- package/docs/codex-setup.md +1 -1
- package/docs/fleet-native-voice.md +10 -4
- package/docs/npm-install.md +1 -1
- package/docs/pi-extensions.md +13 -18
- package/docs/system1-agentic.md +1 -1
- package/docs/system1-file-discovery.md +2 -2
- package/docs/workflows.md +24 -1
- package/install-manifest.json +15 -28
- package/justfile +3 -4
- package/manifest-meta.json +13 -2
- package/package.json +4 -2
- package/skills/fleet-connect/SKILL.md +20 -16
- package/skills/fleet-connect.zip +0 -0
- package/skills/fleet-native-voice.zip +0 -0
- package/.pi/harnesses/agent-hub/commands/work-mode.ts +0 -29
- package/.pi/harnesses/agent-hub/work-mode-controls.ts +0 -56
- package/agents/orchestrator.md +0 -22
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* fleet-config/mutations — the pure half of phase 3: a local draft of the
|
|
3
|
+
* desired state, the exact CLI arguments it maps to, and projections of the
|
|
4
|
+
* CLI's own preview/result JSON for the confirmation overlay.
|
|
5
|
+
*
|
|
6
|
+
* Nothing here writes or spawns. Every write goes through the CLI
|
|
7
|
+
* (`setup --yes`, `configure --yes`) after the human confirms the exact plan
|
|
8
|
+
* the CLI printed for a dry run; a second dry run must produce the same plan
|
|
9
|
+
* digest or the apply is refused as "workspace changed since preview".
|
|
10
|
+
*/
|
|
11
|
+
import { createHash } from "node:crypto";
|
|
12
|
+
import type { FleetConfigSnapshot } from "./snapshot.ts";
|
|
13
|
+
|
|
14
|
+
export interface SetupDraft { preset: string; features: string[] }
|
|
15
|
+
|
|
16
|
+
const sortedUnique = (values: readonly string[]) => [...new Set(values)].sort();
|
|
17
|
+
|
|
18
|
+
/** Start from the file as written; the installer's catalogue (inspect) supplies the preset list. */
|
|
19
|
+
export function draftFromSnapshot(snapshot: FleetConfigSnapshot): SetupDraft {
|
|
20
|
+
const setup = snapshot.setup;
|
|
21
|
+
return { preset: setup?.preset ?? "default", features: sortedUnique((setup?.features ?? []).filter(feature => feature.enabled).map(feature => feature.name)) };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function draftFeatureNames(snapshot: FleetConfigSnapshot, draft: SetupDraft): string[] {
|
|
25
|
+
const catalogue = snapshot.inspect?.status === "ok" ? (snapshot.inspect.report.desired?.catalogue ?? []).map(feature => feature.name) : [];
|
|
26
|
+
return sortedUnique([...(snapshot.setup?.features ?? []).map(feature => feature.name), ...catalogue, ...draft.features]);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function toggleFeature(draft: SetupDraft, name: string): SetupDraft {
|
|
30
|
+
const enabled = new Set(draft.features);
|
|
31
|
+
enabled.has(name) ? enabled.delete(name) : enabled.add(name);
|
|
32
|
+
return { preset: draft.preset, features: sortedUnique([...enabled]) };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function cyclePreset(draft: SetupDraft, presets: readonly string[]): SetupDraft {
|
|
36
|
+
const list = presets.length ? presets : ["default", "full"];
|
|
37
|
+
const index = list.indexOf(draft.preset);
|
|
38
|
+
return { ...draft, preset: list[(index + 1) % list.length] };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function sameDraft(a: SetupDraft, b: SetupDraft): boolean {
|
|
42
|
+
return a.preset === b.preset && a.features.length === b.features.length && a.features.every((name, index) => name === b.features[index]);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface SetupArgvOptions { dryRun: boolean; taskTriageConsent?: boolean; repairConfig?: boolean }
|
|
46
|
+
|
|
47
|
+
/** Exactly what the CLI receives; `--save-desired` persists the human file, `--allow-exec` is never passed. */
|
|
48
|
+
export function setupArgv(draft: SetupDraft, { dryRun, taskTriageConsent = false, repairConfig = false }: SetupArgvOptions): string[] {
|
|
49
|
+
return [
|
|
50
|
+
"setup", "--json", "--preset", draft.preset, "--features", draft.features.length ? draft.features.join(",") : "none", "--save-desired",
|
|
51
|
+
...(dryRun ? ["--dry-run"] : ["--yes"]),
|
|
52
|
+
...(taskTriageConsent && !dryRun ? ["--task-triage-consent"] : []),
|
|
53
|
+
...(repairConfig && !dryRun ? ["--repair-config"] : []),
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function configureArgv(request: { rules?: string[]; docs?: string[] }, options: { dryRun: boolean; expectedHash?: string }): string[] {
|
|
58
|
+
return [
|
|
59
|
+
"configure",
|
|
60
|
+
...(request.rules?.length ? ["--rules", request.rules.join(",")] : []),
|
|
61
|
+
...(request.docs?.length ? ["--docs", request.docs.join(",")] : []),
|
|
62
|
+
...(options.dryRun ? ["--dry-run"] : ["--yes", "--json", ...(options.expectedHash ? ["--expect-hash", options.expectedHash] : [])]),
|
|
63
|
+
];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface PlanAction { kind: string; id: string; reason: string | null; files: Array<{ path: string; state: string }>; operatorSteps: string[] }
|
|
67
|
+
export type PlanPreview =
|
|
68
|
+
| {
|
|
69
|
+
stage: "plan"; digest: string; verb: string;
|
|
70
|
+
summary: Record<string, number>; byKind: Array<{ kind: string; count: number }>; actions: PlanAction[];
|
|
71
|
+
conflicts: Array<{ id: string; reason: string | null }>; notes: string[];
|
|
72
|
+
desired: { preset: string | null; features: string[] } | null; requestedFeatures: string[]; dependencyFeatures: string[]; resolvedItems: number | null;
|
|
73
|
+
firstMigration: boolean; migrationBlocked: boolean; migrationError: string | null;
|
|
74
|
+
stt: { write: boolean; warning: string | null; provider: string | null } | null;
|
|
75
|
+
taskTriage: { alreadyApproved: boolean } | null;
|
|
76
|
+
overridesWrite: boolean; noop: boolean;
|
|
77
|
+
}
|
|
78
|
+
| { stage: "config-repair"; path: string; removed: string[]; nextStep: string }
|
|
79
|
+
| { stage: "unknown"; detail: string };
|
|
80
|
+
|
|
81
|
+
const isRecord = (value: unknown): value is Record<string, any> => !!value && typeof value === "object" && !Array.isArray(value);
|
|
82
|
+
const text = (value: unknown): string | null => typeof value === "string" ? value : null;
|
|
83
|
+
|
|
84
|
+
/** Stable identity of what the human confirms: the CLI's actions, desired state and side writes, not timestamps. */
|
|
85
|
+
export function planDigest(json: unknown): string {
|
|
86
|
+
if (!isRecord(json)) return createHash("sha256").update("not-a-plan").digest("hex");
|
|
87
|
+
const actions = (Array.isArray(json.actions) ? json.actions : []).filter(isRecord)
|
|
88
|
+
.map(action => [text(action.kind) ?? "", text(action.id) ?? "", text(action.target) ?? "", text(action.reason) ?? "", (Array.isArray(action.files) ? action.files : []).filter(isRecord).map(file => `${text(file.state) ?? ""}:${text(file.path) ?? ""}`).sort()])
|
|
89
|
+
.sort((a, b) => JSON.stringify(a).localeCompare(JSON.stringify(b)));
|
|
90
|
+
const projection = {
|
|
91
|
+
stage: json.stage ?? null, verb: json.verb ?? null, actions,
|
|
92
|
+
conflicts: (Array.isArray(json.conflicts) ? json.conflicts : []).filter(isRecord).map(conflict => text(conflict.id) ?? "").sort(),
|
|
93
|
+
desired: isRecord(json.desired) ? json.desired : null, writeDesired: Boolean(json.writeDesired),
|
|
94
|
+
overridesWrite: Boolean(isRecord(json.overrides) && json.overrides.write), sttWrite: Boolean(isRecord(json.stt) && json.stt.write),
|
|
95
|
+
configRepair: isRecord(json.configRepair) ? json.configRepair.removed ?? null : null,
|
|
96
|
+
};
|
|
97
|
+
return createHash("sha256").update(JSON.stringify(projection)).digest("hex");
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function summarizePlan(json: unknown): PlanPreview {
|
|
101
|
+
if (!isRecord(json)) return { stage: "unknown", detail: "the CLI did not return a plan object" };
|
|
102
|
+
if (isRecord(json.configRepair)) {
|
|
103
|
+
const repair = json.configRepair;
|
|
104
|
+
return { stage: "config-repair", path: text(repair.path) ?? ".ai/agent-fleet.json", removed: (Array.isArray(repair.removed) ? repair.removed : []).map(String), nextStep: text(repair.nextStep) ?? "" };
|
|
105
|
+
}
|
|
106
|
+
if (!Array.isArray(json.actions)) return { stage: "unknown", detail: `unexpected ${text(json.stage) ?? text(json.verb) ?? "response"} without actions` };
|
|
107
|
+
const actions: PlanAction[] = json.actions.filter(isRecord).filter(action => action.kind !== "keep").map(action => ({
|
|
108
|
+
kind: text(action.kind) ?? "unknown", id: text(action.id) ?? "?", reason: text(action.reason),
|
|
109
|
+
files: (Array.isArray(action.files) ? action.files : []).filter(isRecord).map(file => ({ path: text(file.path) ?? "", state: text(file.state) ?? "" })),
|
|
110
|
+
operatorSteps: (Array.isArray(action.operatorSteps) ? action.operatorSteps : []).map(String),
|
|
111
|
+
}));
|
|
112
|
+
const counts = new Map<string, number>();
|
|
113
|
+
for (const action of json.actions.filter(isRecord)) { const kind = text(action.kind) ?? "unknown"; counts.set(kind, (counts.get(kind) ?? 0) + 1); }
|
|
114
|
+
const summary = isRecord(json.summary) ? Object.fromEntries(Object.entries(json.summary).filter(([, value]) => typeof value === "number")) as Record<string, number> : {};
|
|
115
|
+
const selection = isRecord(json.selection) && isRecord(json.selection.desired) ? json.selection.desired : null;
|
|
116
|
+
const requested: string[] = Array.isArray(selection?.requestedFeatures) ? selection!.requestedFeatures.map(String) : [];
|
|
117
|
+
const effective: string[] = Array.isArray(selection?.features) ? selection!.features.map(String) : [];
|
|
118
|
+
const desired = isRecord(json.desired) ? { preset: text(json.desired.preset), features: isRecord(json.desired.features) ? Object.entries(json.desired.features).filter(([, on]) => on === true).map(([name]) => name).sort() : [] } : null;
|
|
119
|
+
const changes = summary.changes ?? actions.filter(action => ["create", "refresh", "repair", "remove"].includes(action.kind)).length;
|
|
120
|
+
return {
|
|
121
|
+
stage: "plan", digest: planDigest(json), verb: text(json.verb) ?? "setup",
|
|
122
|
+
summary, byKind: [...counts].map(([kind, count]) => ({ kind, count })).sort((a, b) => a.kind.localeCompare(b.kind)), actions,
|
|
123
|
+
conflicts: (Array.isArray(json.conflicts) ? json.conflicts : []).filter(isRecord).map(conflict => ({ id: text(conflict.id) ?? "?", reason: text(conflict.reason) })),
|
|
124
|
+
notes: (Array.isArray(json.notes) ? json.notes : []).filter(isRecord).map(note => text(note.detail) ?? JSON.stringify(note)),
|
|
125
|
+
desired, requestedFeatures: requested, dependencyFeatures: effective.filter(name => !requested.includes(name)),
|
|
126
|
+
resolvedItems: Array.isArray(isRecord(json.selection) ? json.selection.resolved : null) ? json.selection.resolved.length : null,
|
|
127
|
+
firstMigration: Boolean(json.firstMigration), migrationBlocked: Boolean(json.migrationBlocked), migrationError: text(json.migrationError),
|
|
128
|
+
stt: isRecord(json.stt) ? { write: Boolean(json.stt.write), warning: text(json.stt.warning), provider: text(json.stt.provider) } : null,
|
|
129
|
+
taskTriage: isRecord(json.taskTriage) ? { alreadyApproved: Boolean(json.taskTriage.alreadyApproved) } : null,
|
|
130
|
+
overridesWrite: Boolean(isRecord(json.overrides) && json.overrides.write),
|
|
131
|
+
noop: changes === 0 && !Boolean(json.writeDesired) && !(isRecord(json.overrides) && json.overrides.write) && !(isRecord(json.stt) && json.stt.write),
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** The confirmation overlay's lines; the CLI's words, grouped, never re-judged. */
|
|
136
|
+
export function planPreviewLines(preview: PlanPreview, draft: SetupDraft | null): string[] {
|
|
137
|
+
if (preview.stage === "unknown") return [`Cannot preview: ${preview.detail}`];
|
|
138
|
+
if (preview.stage === "config-repair") return [
|
|
139
|
+
`The installer rejects ${preview.path} and offers to repair it first.`,
|
|
140
|
+
`Keys it would remove: ${preview.removed.join(", ") || "(none listed)"}`,
|
|
141
|
+
`CLI next step: ${preview.nextStep}`,
|
|
142
|
+
"",
|
|
143
|
+
"Confirming runs setup with --repair-config --yes: the retired keys are removed from the human file, then the plan is applied.",
|
|
144
|
+
];
|
|
145
|
+
const lines: string[] = [];
|
|
146
|
+
if (draft) lines.push(`Desired state → preset ${draft.preset} · features ${draft.features.join(", ") || "none"} (saved to .ai/agent-fleet.json)`);
|
|
147
|
+
if (preview.desired) lines.push(`CLI evaluation → preset ${preview.desired.preset ?? "—"} · requested ${preview.requestedFeatures.join(", ") || "none"} · via dependencies ${preview.dependencyFeatures.join(", ") || "none"}${preview.resolvedItems !== null ? ` · ${preview.resolvedItems} items after closure` : ""}`);
|
|
148
|
+
lines.push(`Summary → ${preview.byKind.map(entry => `${entry.kind} ${entry.count}`).join(" · ") || "no actions"}${preview.summary.changes !== undefined ? ` · changes ${preview.summary.changes}` : ""}`);
|
|
149
|
+
if (preview.migrationBlocked) lines.push(`BLOCKED: ${preview.migrationError}`);
|
|
150
|
+
if (preview.conflicts.length) { lines.push(`CONFLICTS (${preview.conflicts.length}) — a human decision is required; nothing can be applied from here:`); for (const conflict of preview.conflicts) lines.push(` ${conflict.id}${conflict.reason ? ` — ${conflict.reason}` : ""}`); }
|
|
151
|
+
if (preview.stt?.warning) lines.push(`STT warning: ${preview.stt.warning}`);
|
|
152
|
+
if (preview.stt?.write) lines.push(`STT: .ai/stt.json would be written (provider ${preview.stt.provider ?? "—"}; environment variable names only).`);
|
|
153
|
+
if (preview.overridesWrite) lines.push("Overrides: .ai/agent-fleet-overrides.md is empty and would receive the generated agent-hub section.");
|
|
154
|
+
if (preview.taskTriage && !preview.taskTriage.alreadyApproved) lines.push("Task triage: separate data consent is required before apply (asked on confirm).");
|
|
155
|
+
for (const note of preview.notes) lines.push(`Note: ${note}`);
|
|
156
|
+
if (preview.actions.length) {
|
|
157
|
+
lines.push("", "Planned actions (keep omitted):");
|
|
158
|
+
for (const action of preview.actions) {
|
|
159
|
+
lines.push(` ${action.kind.padEnd(8)} ${action.id}${action.reason ? ` — ${action.reason}` : ""}`);
|
|
160
|
+
for (const file of action.files) lines.push(` ${file.state}: ${file.path}`);
|
|
161
|
+
for (const step of action.operatorSteps) lines.push(` operator: ${step}`);
|
|
162
|
+
}
|
|
163
|
+
} else lines.push("", preview.noop ? "No changes: the workspace already matches this desired state." : "No item actions.");
|
|
164
|
+
return lines;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface ApplyOutcome { ok: boolean; exitCode: number; summary: Record<string, number>; failure: string | null; results: Array<{ id: string; status: string; detail: string | null }> }
|
|
168
|
+
|
|
169
|
+
export function summarizeResult(json: unknown, exitCode: number): ApplyOutcome {
|
|
170
|
+
if (!isRecord(json)) return { ok: false, exitCode, summary: {}, failure: "the CLI did not return a result object", results: [] };
|
|
171
|
+
const summary = isRecord(json.summary) ? Object.fromEntries(Object.entries(json.summary).filter(([, value]) => typeof value === "number")) as Record<string, number> : {};
|
|
172
|
+
const failure = isRecord(json.failure) ? text(json.failure.detail) ?? text(json.failure.message) ?? "failed" : text(json.failure);
|
|
173
|
+
return {
|
|
174
|
+
ok: exitCode === 0 && !failure, exitCode, summary, failure,
|
|
175
|
+
results: (Array.isArray(json.results) ? json.results : []).filter(isRecord).map(result => ({ id: text(result.id) ?? "?", status: text(result.status) ?? "?", detail: text(result.detail) })),
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface ConfigurePreview { expectedHash: string; write: boolean; path: string; before: string[]; after: string[] }
|
|
180
|
+
|
|
181
|
+
export function summarizeConfigurePreview(json: unknown): ConfigurePreview | null {
|
|
182
|
+
if (!isRecord(json) || json.verb !== "configure" || typeof json.expectedHash !== "string") return null;
|
|
183
|
+
return { expectedHash: json.expectedHash, write: Boolean(json.write), path: text(json.path) ?? ".ai/agent-fleet-overrides.md", before: String(json.before ?? "").split("\n"), after: String(json.after ?? "").split("\n") };
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** Minimal line diff for the overrides preview: removed lines first with "-", added with "+", unchanged with " ". */
|
|
187
|
+
export function configureDiffLines(preview: ConfigurePreview): string[] {
|
|
188
|
+
const before = new Set(preview.before), after = new Set(preview.after);
|
|
189
|
+
const lines: string[] = [];
|
|
190
|
+
for (const line of preview.before) if (!after.has(line)) lines.push(`- ${line}`);
|
|
191
|
+
for (const line of preview.after) lines.push(`${before.has(line) ? " " : "+"} ${line}`);
|
|
192
|
+
return lines;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/** Validation the CLI also performs; here only so the dialog can refuse obviously wrong input before spawning. */
|
|
196
|
+
export function parsePathList(value: string): string[] | null {
|
|
197
|
+
const paths = value.split(",").map(path => path.trim()).filter(Boolean);
|
|
198
|
+
if (!paths.length) return [];
|
|
199
|
+
for (const path of paths) if (path.startsWith("/") || /[\r\n:#]/.test(path) || path.includes("\\") || path.split("/").some(part => part === "." || part === ".." || !part)) return null;
|
|
200
|
+
return [...new Set(paths)];
|
|
201
|
+
}
|
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* fleet-config/snapshot — deterministic, side-effect-free collection of the
|
|
3
|
+
* configuration facts a live Fleet session can show without a model.
|
|
4
|
+
*
|
|
5
|
+
* Boundaries (see docs/plans/todo/PLAN-fleet-config-screen.md):
|
|
6
|
+
* - Only file facts: existence, size, parse, sha256 against a recorded hash,
|
|
7
|
+
* environment variable present/absent. Installer rules (item states,
|
|
8
|
+
* action kinds, feature availability) stay in bin/lib and arrive through
|
|
9
|
+
* the CLI in a later phase; nothing here re-derives them.
|
|
10
|
+
* - No secrets: environment values, env_file contents and key material are
|
|
11
|
+
* never read, rendered or logged. Only variable names and presence.
|
|
12
|
+
* - Symbolic links under .ai/ are refused exactly like installation-state.js.
|
|
13
|
+
*/
|
|
14
|
+
import { createHash } from "node:crypto";
|
|
15
|
+
import { existsSync, lstatSync, readFileSync, realpathSync } from "node:fs";
|
|
16
|
+
import { join, resolve } from "node:path";
|
|
17
|
+
import { parse as parseYaml } from "yaml";
|
|
18
|
+
import { readInstallationState } from "../installation-state.js";
|
|
19
|
+
import { safeSourceRead } from "../safe-source-read.js";
|
|
20
|
+
import { loadDamageAutoPolicy } from "../damage-auto-policy.ts";
|
|
21
|
+
import { loadSystem1Snapshot, readSystem1Selected } from "../system1/config-loader.js";
|
|
22
|
+
import { resolveSystem1Readiness } from "../system1/config.js";
|
|
23
|
+
import { workspaceRoot } from "../workspace-context.ts";
|
|
24
|
+
import type { CliResolution, InspectReport } from "./cli-bridge.ts";
|
|
25
|
+
|
|
26
|
+
export type SourceStatus = "present" | "missing" | "invalid" | "refused";
|
|
27
|
+
export interface SourceFile { path: string; status: SourceStatus; digest?: string; bytes?: number; problems: string[] }
|
|
28
|
+
|
|
29
|
+
export const SOURCE_IDS = [
|
|
30
|
+
"desired", "state", "setup", "transaction", "overrides", "aiState", "system1", "stt",
|
|
31
|
+
"teams", "peers", "dispatch", "voices", "damageRules", "autoPolicy",
|
|
32
|
+
] as const;
|
|
33
|
+
export type SourceId = typeof SOURCE_IDS[number];
|
|
34
|
+
export const SOURCE_PATHS: Record<SourceId, string> = {
|
|
35
|
+
desired: ".ai/agent-fleet.json",
|
|
36
|
+
state: ".ai/agent-fleet-state.json",
|
|
37
|
+
setup: ".ai/agent-fleet-setup.md",
|
|
38
|
+
transaction: ".ai/agent-fleet-transaction.json",
|
|
39
|
+
overrides: ".ai/agent-fleet-overrides.md",
|
|
40
|
+
aiState: ".ai/agent-fleet-ai-state.json",
|
|
41
|
+
system1: ".ai/system1.json",
|
|
42
|
+
stt: ".ai/stt.json",
|
|
43
|
+
teams: ".pi/agents/teams.yaml",
|
|
44
|
+
peers: ".pi/agents/peers.yaml",
|
|
45
|
+
dispatch: ".pi/agents/dispatch-policy.yaml",
|
|
46
|
+
voices: ".pi/agents/voices.yaml",
|
|
47
|
+
damageRules: ".pi/damage-control-rules.yaml",
|
|
48
|
+
autoPolicy: ".pi/damage-control-auto-policy.yaml",
|
|
49
|
+
};
|
|
50
|
+
const MAX_SOURCE_BYTES = 1024 * 1024;
|
|
51
|
+
|
|
52
|
+
/** The subset of the Hub's parsed overrides the screen renders; injected so this module stays independent of agent-hub. */
|
|
53
|
+
export interface HubOverridesLike {
|
|
54
|
+
language: string;
|
|
55
|
+
personaModels: Record<string, string>;
|
|
56
|
+
personaModelLists: Record<string, string[]>;
|
|
57
|
+
personaThinking: Record<string, string>;
|
|
58
|
+
personaDelegateDepth: Record<string, number>;
|
|
59
|
+
rulesDirs: string[];
|
|
60
|
+
docsPaths: string[];
|
|
61
|
+
reconSearchTimeoutMs: number | null;
|
|
62
|
+
budgetOverrides: { agentTurnMs?: number | null; recycleRuns?: number | null };
|
|
63
|
+
watchdogSetting: string;
|
|
64
|
+
watchdogJudgeModel: string | null;
|
|
65
|
+
runHistoryKeep: number | null;
|
|
66
|
+
pollPanel: string | null;
|
|
67
|
+
warnings: string[];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface RuntimeRow { label: string; detail: string; origin?: string }
|
|
71
|
+
|
|
72
|
+
export interface SnapshotInput {
|
|
73
|
+
cwd: string;
|
|
74
|
+
/** Only `name in env` and emptiness are consulted; values never leave this function. */
|
|
75
|
+
env?: NodeJS.ProcessEnv;
|
|
76
|
+
now?: number;
|
|
77
|
+
/** Digests recorded when the session started, keyed by source id. */
|
|
78
|
+
startDigests?: Partial<Record<SourceId, string>>;
|
|
79
|
+
/** Hub-only: the overrides parser the Hub itself uses. */
|
|
80
|
+
readHubOverrides?: (cwd: string) => HubOverridesLike;
|
|
81
|
+
/** Names of peers currently registered in the coms pool (Hub or peer supplies its own scope). */
|
|
82
|
+
livePeerNames?: () => readonly string[];
|
|
83
|
+
/** Hub-only: in-memory facts (work mode, roster, identity). */
|
|
84
|
+
runtimeRows?: () => readonly RuntimeRow[];
|
|
85
|
+
/** Cached latest published version, if the update check has one. */
|
|
86
|
+
latestKnownVersion?: string | null;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Phase 2: the installer evaluation obtained through the CLI; attached by the UI host, never collected here. */
|
|
90
|
+
export type InspectState =
|
|
91
|
+
| { status: "idle"; resolution: CliResolution }
|
|
92
|
+
| { status: "running"; startedAt: number; resolution: CliResolution }
|
|
93
|
+
| { status: "ok"; report: InspectReport; exitCode: number; resolution: CliResolution; at: number }
|
|
94
|
+
| { status: "failed"; reason: string; detail: string; resolution: CliResolution; at: number };
|
|
95
|
+
|
|
96
|
+
export type FileCheck = "unchanged" | "modified" | "missing" | "link" | "unreadable";
|
|
97
|
+
export interface StateItemView { id: string; kind: string; version?: string; method?: string; files: Array<{ path: string; check: FileCheck }> }
|
|
98
|
+
export interface OverrideSection { name: string; canonical: string; alias: boolean; keys: Array<{ key: string; value: string; line: number }> }
|
|
99
|
+
export interface AiStateEntryView { path: string; origin: string; templateId?: string; sourceVersion?: string; acceptedDecision: string; evidenceCount: number; local: "unchanged" | "local-edit" | "deleted" | "unknown" }
|
|
100
|
+
export interface EnvNameView { name: string; present: boolean }
|
|
101
|
+
|
|
102
|
+
export interface FleetConfigSnapshot {
|
|
103
|
+
workspaceRoot: string;
|
|
104
|
+
collectedAt: number;
|
|
105
|
+
sources: Record<SourceId, SourceFile>;
|
|
106
|
+
changedSinceStart: SourceId[];
|
|
107
|
+
overview: {
|
|
108
|
+
recordedVersion: string | null; latestKnownVersion: string | null; method: string | null;
|
|
109
|
+
sourceRoot: string | null; sourceRootPresent: boolean | null; installedAt: string | null; updatedAt: string | null;
|
|
110
|
+
transactionPending: boolean; installationStatus: string; installationReason?: string;
|
|
111
|
+
};
|
|
112
|
+
setup: { preset: string | null; schemaVersion: number | null; features: Array<{ name: string; enabled: boolean }> } | null;
|
|
113
|
+
state: { items: StateItemView[]; byKind: Array<{ kind: string; count: number }>; files: { total: number; unchanged: number; modified: number; missing: number; other: number } } | null;
|
|
114
|
+
overrides: { sections: OverrideSection[]; hub: HubOverridesLike | null } | null;
|
|
115
|
+
aiState: { entries: AiStateEntryView[] } | null;
|
|
116
|
+
system1: { selected: boolean; status: string; mode: string | null; provider: string | null; model: string | null; apiKeyEnv: string | null; apiKeyPresent: boolean | null; readiness: { status: string; reason?: string }; consumers: Array<{ name: string; status: string; mode: string | null }>; errors: number } | null;
|
|
117
|
+
stt: { providerType: string | null; language: string | null; envNames: EnvNameView[] } | null;
|
|
118
|
+
fleet: {
|
|
119
|
+
teams: Array<{ name: string; members: string[] }>;
|
|
120
|
+
peers: Array<{ team: string; name: string; persona: string | null; runner: string; model: string | null; extensions: string | null; envFile: string | null; envFilePresent: boolean | null; live: boolean }>;
|
|
121
|
+
dispatch: { default: string | null; graceS: number | null; substitutions: Array<{ member: string; prefer: string; fallback: string; timeoutS: number | null; live: boolean }> } | null;
|
|
122
|
+
voices: Array<{ panel: string; voices: Array<{ name: string; model: string; thinking: string | null; integrator: boolean }> }>;
|
|
123
|
+
};
|
|
124
|
+
safety: { rules: Array<{ category: string; count: number }> | null; autoPolicy: { status: string; digest: string; rules: number; expired: number } };
|
|
125
|
+
runtime: RuntimeRow[] | null;
|
|
126
|
+
inspect?: InspectState;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const sha256 = (bytes: Buffer | string) => createHash("sha256").update(bytes).digest("hex");
|
|
130
|
+
const isRecord = (value: unknown): value is Record<string, unknown> => !!value && typeof value === "object" && !Array.isArray(value);
|
|
131
|
+
const text = (value: unknown): string => typeof value === "string" ? value : value == null ? "" : typeof value === "object" ? JSON.stringify(value) : String(value);
|
|
132
|
+
|
|
133
|
+
function readSource(root: string, id: SourceId): { file: SourceFile; bytes?: Buffer } {
|
|
134
|
+
const path = SOURCE_PATHS[id];
|
|
135
|
+
const full = join(root, path);
|
|
136
|
+
let stat;
|
|
137
|
+
try { stat = lstatSync(full); } catch (error) {
|
|
138
|
+
if ((error as NodeJS.ErrnoException).code === "ENOENT") return { file: { path, status: "missing", problems: [] } };
|
|
139
|
+
return { file: { path, status: "refused", problems: ["unreadable"] } };
|
|
140
|
+
}
|
|
141
|
+
if (stat.isSymbolicLink()) return { file: { path, status: "refused", problems: ["symbolic link refused"] } };
|
|
142
|
+
if (!stat.isFile()) return { file: { path, status: "refused", problems: ["not a regular file"] } };
|
|
143
|
+
try {
|
|
144
|
+
const bytes = safeSourceRead(root, full, MAX_SOURCE_BYTES);
|
|
145
|
+
return { file: { path, status: "present", digest: sha256(bytes), bytes: bytes.length, problems: [] }, bytes };
|
|
146
|
+
} catch (error) {
|
|
147
|
+
const reason = (error as Error).message;
|
|
148
|
+
return { file: { path, status: "refused", problems: [reason === "state_too_large" ? "larger than 1 MiB" : reason === "source_denied" ? "path refused" : "changed while reading"] } };
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function parseJson(file: SourceFile, bytes: Buffer | undefined): Record<string, unknown> | undefined {
|
|
153
|
+
if (!bytes) return undefined;
|
|
154
|
+
try {
|
|
155
|
+
const value = JSON.parse(bytes.toString("utf8"));
|
|
156
|
+
if (!isRecord(value)) { file.status = "invalid"; file.problems.push("not a JSON object"); return undefined; }
|
|
157
|
+
return value;
|
|
158
|
+
} catch { file.status = "invalid"; file.problems.push("invalid JSON"); return undefined; }
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function parseYamlDoc(file: SourceFile, bytes: Buffer | undefined): unknown {
|
|
162
|
+
if (!bytes) return undefined;
|
|
163
|
+
try { return parseYaml(bytes.toString("utf8"), { uniqueKeys: true, maxAliasCount: 0 }) ?? null; }
|
|
164
|
+
catch { file.status = "invalid"; file.problems.push("invalid YAML"); return undefined; }
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function checkRecordedFile(root: string, path: string, recorded: unknown): FileCheck {
|
|
168
|
+
const full = join(root, path);
|
|
169
|
+
let stat;
|
|
170
|
+
try { stat = lstatSync(full); } catch (error) { return (error as NodeJS.ErrnoException).code === "ENOENT" ? "missing" : "unreadable"; }
|
|
171
|
+
if (stat.isSymbolicLink()) return "link";
|
|
172
|
+
if (!stat.isFile() || typeof recorded !== "string") return "unreadable";
|
|
173
|
+
try { return sha256(readFileSync(full)) === recorded ? "unchanged" : "modified"; } catch { return "unreadable"; }
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function envPresent(env: NodeJS.ProcessEnv, name: string): boolean {
|
|
177
|
+
const value = env[name];
|
|
178
|
+
return typeof value === "string" && value.trim().length > 0;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/** Collect every `*Env` key (names only) from a non-secret config tree. */
|
|
182
|
+
function envNames(value: unknown, out: string[] = []): string[] {
|
|
183
|
+
if (!isRecord(value)) return out;
|
|
184
|
+
for (const [key, item] of Object.entries(value)) {
|
|
185
|
+
if (/Env$/.test(key) && typeof item === "string" && item) out.push(item);
|
|
186
|
+
else if (isRecord(item)) envNames(item, out);
|
|
187
|
+
}
|
|
188
|
+
return out;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export function parseOverrideSections(raw: string): OverrideSection[] {
|
|
192
|
+
const sections: OverrideSection[] = [];
|
|
193
|
+
let current: OverrideSection | null = null;
|
|
194
|
+
raw.split("\n").forEach((rawLine, index) => {
|
|
195
|
+
const line = rawLine.replace(/\r$/, "");
|
|
196
|
+
const heading = line.match(/^##\s+(.+?)\s*$/);
|
|
197
|
+
if (heading) {
|
|
198
|
+
const name = heading[1].trim();
|
|
199
|
+
const lower = name.toLowerCase();
|
|
200
|
+
current = { name, canonical: lower === "agent-team" ? "agent-hub" : lower, alias: lower === "agent-team", keys: [] };
|
|
201
|
+
sections.push(current);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
if (!current) return;
|
|
205
|
+
const pair = line.match(/^\s*([a-zA-Z][\w.-]*)\s*:\s*(.+?)\s*$/);
|
|
206
|
+
if (pair) current.keys.push({ key: pair[1], value: pair[2], line: index + 1 });
|
|
207
|
+
});
|
|
208
|
+
return sections;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function collectState(root: string, sources: Record<SourceId, SourceFile>) {
|
|
212
|
+
const installation = readInstallationState(root);
|
|
213
|
+
const overview = {
|
|
214
|
+
installationStatus: installation.status, installationReason: installation.reason,
|
|
215
|
+
recordedVersion: null as string | null, method: null as string | null, sourceRoot: null as string | null,
|
|
216
|
+
sourceRootPresent: null as boolean | null, installedAt: null as string | null, updatedAt: null as string | null,
|
|
217
|
+
};
|
|
218
|
+
if (installation.status === "invalid" && sources.state.status === "present") { sources.state.status = "invalid"; sources.state.problems.push(installation.reason ?? "invalid installation evidence"); }
|
|
219
|
+
if (installation.status === "invalid" && installation.reason === "invalid_desired" && sources.desired.status === "present") { sources.desired.status = "invalid"; sources.desired.problems.push("not a JSON object"); }
|
|
220
|
+
const state = installation.state;
|
|
221
|
+
if (!state) return { overview, state: null };
|
|
222
|
+
overview.recordedVersion = typeof state.packageVersion === "string" ? state.packageVersion : null;
|
|
223
|
+
overview.method = typeof state.method === "string" ? state.method : null;
|
|
224
|
+
overview.sourceRoot = typeof state.sourceRoot === "string" ? state.sourceRoot : null;
|
|
225
|
+
overview.sourceRootPresent = overview.sourceRoot ? existsSync(resolve(overview.sourceRoot)) : null;
|
|
226
|
+
overview.installedAt = typeof state.installedAt === "string" ? state.installedAt : null;
|
|
227
|
+
overview.updatedAt = typeof state.updatedAt === "string" ? state.updatedAt : null;
|
|
228
|
+
const items: StateItemView[] = [];
|
|
229
|
+
const files = { total: 0, unchanged: 0, modified: 0, missing: 0, other: 0 };
|
|
230
|
+
const byKind = new Map<string, number>();
|
|
231
|
+
for (const [id, raw] of Object.entries(isRecord(state.items) ? state.items : {})) {
|
|
232
|
+
if (!isRecord(raw)) continue;
|
|
233
|
+
const kind = typeof raw.kind === "string" ? raw.kind : "unknown";
|
|
234
|
+
byKind.set(kind, (byKind.get(kind) ?? 0) + 1);
|
|
235
|
+
const views = (Array.isArray(raw.files) ? raw.files : []).filter(isRecord).map(file => {
|
|
236
|
+
const check = checkRecordedFile(root, text(file.path), file.sha256);
|
|
237
|
+
files.total++;
|
|
238
|
+
if (check === "unchanged") files.unchanged++; else if (check === "modified") files.modified++; else if (check === "missing") files.missing++; else files.other++;
|
|
239
|
+
return { path: text(file.path), check };
|
|
240
|
+
});
|
|
241
|
+
items.push({ id, kind, version: typeof raw.version === "string" ? raw.version : undefined, method: typeof raw.method === "string" ? raw.method : undefined, files: views });
|
|
242
|
+
}
|
|
243
|
+
items.sort((a, b) => a.kind.localeCompare(b.kind) || a.id.localeCompare(b.id));
|
|
244
|
+
return { overview, state: { items, byKind: [...byKind].map(([kind, count]) => ({ kind, count })).sort((a, b) => a.kind.localeCompare(b.kind)), files } };
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function collectAiState(root: string, file: SourceFile, bytes: Buffer | undefined) {
|
|
248
|
+
const parsed = parseJson(file, bytes);
|
|
249
|
+
if (!parsed) return null;
|
|
250
|
+
if (!isRecord(parsed.entries)) { file.status = "invalid"; file.problems.push("entries is not an object"); return null; }
|
|
251
|
+
const entries: AiStateEntryView[] = Object.entries(parsed.entries).map(([path, raw]) => {
|
|
252
|
+
const entry = isRecord(raw) ? raw : {};
|
|
253
|
+
const target = join(root, path);
|
|
254
|
+
let local: AiStateEntryView["local"] = "unknown";
|
|
255
|
+
if (typeof entry.appliedHash === "string") {
|
|
256
|
+
try {
|
|
257
|
+
const stat = lstatSync(target);
|
|
258
|
+
local = stat.isFile() ? (sha256(readFileSync(target)) === entry.appliedHash ? "unchanged" : "local-edit") : "unknown";
|
|
259
|
+
} catch (error) { local = (error as NodeJS.ErrnoException).code === "ENOENT" ? "deleted" : "unknown"; }
|
|
260
|
+
}
|
|
261
|
+
return {
|
|
262
|
+
path, origin: text(entry.origin) || "unknown",
|
|
263
|
+
templateId: typeof entry.templateId === "string" ? entry.templateId : undefined,
|
|
264
|
+
sourceVersion: typeof entry.sourceVersion === "string" ? entry.sourceVersion : undefined,
|
|
265
|
+
acceptedDecision: text(entry.acceptedDecision), evidenceCount: Array.isArray(entry.evidence) ? entry.evidence.length : 0, local,
|
|
266
|
+
};
|
|
267
|
+
}).sort((a, b) => a.path.localeCompare(b.path));
|
|
268
|
+
return { entries };
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function collectSystem1(root: string, env: NodeJS.ProcessEnv, file: SourceFile) {
|
|
272
|
+
const selected = readSystem1Selected(root) === true;
|
|
273
|
+
const snapshot: any = loadSystem1Snapshot(root);
|
|
274
|
+
if (snapshot.status === "invalid" && file.status === "present") { file.status = "invalid"; file.problems.push(...(snapshot.errors ?? []).slice(0, 5).map((e: any) => text(e.path ?? e))); }
|
|
275
|
+
const document = isRecord(snapshot.document) ? snapshot.document : isRecord(snapshot.legacyProvider) ? snapshot.legacyProvider : null;
|
|
276
|
+
const apiKeyEnv = document && typeof document.apiKeyEnv === "string" ? document.apiKeyEnv : null;
|
|
277
|
+
const readiness = resolveSystem1Readiness({ selected, config: snapshot.status === "missing" ? undefined : snapshot.document ?? null, env }) as { status: string; reason?: string };
|
|
278
|
+
const consumers = Object.entries(isRecord(snapshot.consumers) ? snapshot.consumers : {}).map(([name, raw]) => {
|
|
279
|
+
const consumer = isRecord(raw) ? raw : {};
|
|
280
|
+
const config = isRecord(consumer.config) ? consumer.config : null;
|
|
281
|
+
const declared = document && isRecord(document.consumers) && isRecord((document.consumers as any)[name]) ? (document.consumers as any)[name] : null;
|
|
282
|
+
return { name, status: text(consumer.status) || "off", mode: config && typeof config.mode === "string" ? config.mode : declared && typeof declared.mode === "string" ? declared.mode : null };
|
|
283
|
+
});
|
|
284
|
+
return {
|
|
285
|
+
selected, status: text(snapshot.status), mode: document && typeof document.mode === "string" ? document.mode : null,
|
|
286
|
+
provider: document && typeof document.provider === "string" ? document.provider : null,
|
|
287
|
+
model: document && typeof document.model === "string" ? document.model : null,
|
|
288
|
+
apiKeyEnv, apiKeyPresent: apiKeyEnv ? envPresent(env, apiKeyEnv) : null, readiness, consumers,
|
|
289
|
+
errors: Array.isArray(snapshot.errors) ? snapshot.errors.length : 0,
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
function collectStt(env: NodeJS.ProcessEnv, file: SourceFile, bytes: Buffer | undefined) {
|
|
294
|
+
const parsed = parseJson(file, bytes);
|
|
295
|
+
if (!parsed) return null;
|
|
296
|
+
const provider = parsed.provider;
|
|
297
|
+
const providerType = typeof provider === "string" ? provider : isRecord(provider) && typeof provider.type === "string" ? provider.type : null;
|
|
298
|
+
return {
|
|
299
|
+
providerType, language: typeof parsed.language === "string" ? parsed.language : null,
|
|
300
|
+
envNames: [...new Set(envNames(parsed))].map(name => ({ name, present: envPresent(env, name) })),
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function collectFleet(root: string, sources: Record<SourceId, SourceFile>, bytes: Partial<Record<SourceId, Buffer>>, live: Set<string>) {
|
|
305
|
+
const teamsDoc = parseYamlDoc(sources.teams, bytes.teams);
|
|
306
|
+
const teams = isRecord(teamsDoc) ? Object.entries(teamsDoc).map(([name, members]) => ({ name, members: Array.isArray(members) ? members.map(text) : [] })) : [];
|
|
307
|
+
if (teamsDoc !== undefined && teamsDoc !== null && !isRecord(teamsDoc)) { sources.teams.status = "invalid"; sources.teams.problems.push("not a mapping"); }
|
|
308
|
+
const peersDoc = parseYamlDoc(sources.peers, bytes.peers);
|
|
309
|
+
const peers: FleetConfigSnapshot["fleet"]["peers"] = [];
|
|
310
|
+
if (isRecord(peersDoc)) {
|
|
311
|
+
for (const [team, list] of Object.entries(peersDoc)) {
|
|
312
|
+
for (const raw of Array.isArray(list) ? list : []) {
|
|
313
|
+
if (!isRecord(raw)) continue;
|
|
314
|
+
const envFile = typeof raw.env_file === "string" ? raw.env_file : null;
|
|
315
|
+
const name = text(raw.name) || text(raw.persona);
|
|
316
|
+
peers.push({
|
|
317
|
+
team, name, persona: typeof raw.persona === "string" ? raw.persona : null, runner: typeof raw.runner === "string" ? raw.runner : "pi",
|
|
318
|
+
model: typeof raw.model === "string" ? raw.model : null, extensions: typeof raw.extensions === "string" ? raw.extensions : null,
|
|
319
|
+
envFile, envFilePresent: envFile ? existsSync(join(root, envFile)) : null, live: live.has(name),
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
} else if (peersDoc !== undefined && peersDoc !== null) { sources.peers.status = "invalid"; sources.peers.problems.push("not a mapping"); }
|
|
324
|
+
const dispatchDoc = parseYamlDoc(sources.dispatch, bytes.dispatch);
|
|
325
|
+
let dispatch: FleetConfigSnapshot["fleet"]["dispatch"] = null;
|
|
326
|
+
if (isRecord(dispatchDoc)) {
|
|
327
|
+
dispatch = {
|
|
328
|
+
default: typeof dispatchDoc.default === "string" ? dispatchDoc.default : null,
|
|
329
|
+
graceS: typeof dispatchDoc.grace_s === "number" ? dispatchDoc.grace_s : null,
|
|
330
|
+
substitutions: Object.entries(isRecord(dispatchDoc.substitutions) ? dispatchDoc.substitutions : {}).map(([member, raw]) => {
|
|
331
|
+
const sub = isRecord(raw) ? raw : {};
|
|
332
|
+
return { member, prefer: typeof sub.prefer === "string" ? sub.prefer : "coms", fallback: typeof sub.fallback === "string" ? sub.fallback : "native", timeoutS: typeof sub.timeout_s === "number" ? sub.timeout_s : null, live: live.has(member) };
|
|
333
|
+
}),
|
|
334
|
+
};
|
|
335
|
+
} else if (dispatchDoc !== undefined && dispatchDoc !== null) { sources.dispatch.status = "invalid"; sources.dispatch.problems.push("not a mapping"); }
|
|
336
|
+
const voicesDoc = parseYamlDoc(sources.voices, bytes.voices);
|
|
337
|
+
const voices = isRecord(voicesDoc) ? Object.entries(voicesDoc).map(([panel, list]) => ({
|
|
338
|
+
panel, voices: (Array.isArray(list) ? list : []).filter(isRecord).map(voice => ({ name: text(voice.name), model: text(voice.model), thinking: typeof voice.thinking === "string" ? voice.thinking : null, integrator: voice.integrator === true })),
|
|
339
|
+
})) : [];
|
|
340
|
+
if (voicesDoc !== undefined && voicesDoc !== null && !isRecord(voicesDoc)) { sources.voices.status = "invalid"; sources.voices.problems.push("not a mapping"); }
|
|
341
|
+
return { teams, peers, dispatch, voices };
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
function collectSafety(root: string, now: number, sources: Record<SourceId, SourceFile>, bytes: Partial<Record<SourceId, Buffer>>) {
|
|
345
|
+
const rulesDoc = parseYamlDoc(sources.damageRules, bytes.damageRules);
|
|
346
|
+
let rules: Array<{ category: string; count: number }> | null = null;
|
|
347
|
+
if (isRecord(rulesDoc)) rules = Object.entries(rulesDoc).map(([category, list]) => ({ category, count: Array.isArray(list) ? list.length : isRecord(list) ? Object.keys(list).length : 0 }));
|
|
348
|
+
else if (rulesDoc !== undefined && rulesDoc !== null) { sources.damageRules.status = "invalid"; sources.damageRules.problems.push("not a mapping"); }
|
|
349
|
+
const policy = loadDamageAutoPolicy(root);
|
|
350
|
+
if (policy.status === "invalid" && sources.autoPolicy.status === "present") { sources.autoPolicy.status = "invalid"; sources.autoPolicy.problems.push("refused by the auto-policy loader"); }
|
|
351
|
+
return { rules, autoPolicy: { status: policy.status, digest: policy.digest, rules: policy.rules.length, expired: policy.rules.filter(rule => Date.parse(rule.expiresAt) < now).length } };
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/** Collect the snapshot. Never throws for a broken workspace; every problem lands in `sources[*].problems`. */
|
|
355
|
+
export function collectFleetConfigSnapshot(input: SnapshotInput): FleetConfigSnapshot {
|
|
356
|
+
const env = input.env ?? process.env;
|
|
357
|
+
const now = input.now ?? Date.now();
|
|
358
|
+
// The fenced readers compare against the real path (installation-state.js does the same), so an
|
|
359
|
+
// aliased cwd (symlinked temp root, macOS /var → /private/var) must be resolved before any read.
|
|
360
|
+
const nominalRoot = workspaceRoot(input.cwd, env);
|
|
361
|
+
let root = nominalRoot;
|
|
362
|
+
try { root = realpathSync(nominalRoot); } catch { /* a missing workspace is reported per source below */ }
|
|
363
|
+
const sources = {} as Record<SourceId, SourceFile>;
|
|
364
|
+
const bytes: Partial<Record<SourceId, Buffer>> = {};
|
|
365
|
+
for (const id of SOURCE_IDS) { const read = readSource(root, id); sources[id] = read.file; if (read.bytes) bytes[id] = read.bytes; }
|
|
366
|
+
|
|
367
|
+
const { overview, state } = collectState(root, sources);
|
|
368
|
+
const desiredDoc = sources.desired.status === "present" ? parseJson(sources.desired, bytes.desired) : undefined;
|
|
369
|
+
const setup = desiredDoc ? {
|
|
370
|
+
preset: typeof desiredDoc.preset === "string" ? desiredDoc.preset : null,
|
|
371
|
+
schemaVersion: typeof desiredDoc.schemaVersion === "number" ? desiredDoc.schemaVersion : null,
|
|
372
|
+
features: Object.entries(isRecord(desiredDoc.features) ? desiredDoc.features : {}).map(([name, enabled]) => ({ name, enabled: enabled === true })).sort((a, b) => a.name.localeCompare(b.name)),
|
|
373
|
+
} : null;
|
|
374
|
+
if (desiredDoc && !isRecord(desiredDoc.features)) { sources.desired.status = "invalid"; sources.desired.problems.push("features is not an object"); }
|
|
375
|
+
|
|
376
|
+
let overrides: FleetConfigSnapshot["overrides"] = null;
|
|
377
|
+
if (bytes.overrides) {
|
|
378
|
+
let hub: HubOverridesLike | null = null;
|
|
379
|
+
try { hub = input.readHubOverrides?.(root) ?? null; } catch (error) { sources.overrides.problems.push(`hub parser: ${(error as Error).message}`); }
|
|
380
|
+
overrides = { sections: parseOverrideSections(bytes.overrides.toString("utf8")), hub };
|
|
381
|
+
} else if (input.readHubOverrides) {
|
|
382
|
+
try { overrides = { sections: [], hub: input.readHubOverrides(root) }; } catch { overrides = null; }
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
const live = new Set<string>();
|
|
386
|
+
try { for (const name of input.livePeerNames?.() ?? []) live.add(name); } catch { /* registry unavailable: no LIVE marks */ }
|
|
387
|
+
|
|
388
|
+
const snapshot: FleetConfigSnapshot = {
|
|
389
|
+
workspaceRoot: root, collectedAt: now, sources, changedSinceStart: [],
|
|
390
|
+
overview: { ...overview, latestKnownVersion: input.latestKnownVersion ?? null, transactionPending: sources.transaction.status === "present" },
|
|
391
|
+
setup, state, overrides,
|
|
392
|
+
aiState: collectAiState(root, sources.aiState, bytes.aiState),
|
|
393
|
+
system1: collectSystem1(root, env, sources.system1),
|
|
394
|
+
stt: collectStt(env, sources.stt, bytes.stt),
|
|
395
|
+
fleet: collectFleet(root, sources, bytes, live),
|
|
396
|
+
safety: collectSafety(root, now, sources, bytes),
|
|
397
|
+
runtime: null,
|
|
398
|
+
};
|
|
399
|
+
try { snapshot.runtime = input.runtimeRows ? [...input.runtimeRows()] : null; } catch { snapshot.runtime = null; }
|
|
400
|
+
for (const id of SOURCE_IDS) {
|
|
401
|
+
const start = input.startDigests?.[id];
|
|
402
|
+
if (start !== undefined && (sources[id].digest ?? "") !== start) snapshot.changedSinceStart.push(id);
|
|
403
|
+
}
|
|
404
|
+
return snapshot;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/** Digest table for recording the session-start baseline. */
|
|
408
|
+
export function sourceDigests(snapshot: FleetConfigSnapshot): Partial<Record<SourceId, string>> {
|
|
409
|
+
const out: Partial<Record<SourceId, string>> = {};
|
|
410
|
+
for (const id of SOURCE_IDS) out[id] = snapshot.sources[id].digest ?? "";
|
|
411
|
+
return out;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/** Count problems per source for the Overview tab. */
|
|
415
|
+
export function problemCount(snapshot: FleetConfigSnapshot): number {
|
|
416
|
+
return SOURCE_IDS.reduce((sum, id) => sum + snapshot.sources[id].problems.length + (snapshot.sources[id].status === "invalid" || snapshot.sources[id].status === "refused" ? 1 : 0), 0);
|
|
417
|
+
}
|