@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,135 @@
|
|
|
1
|
+
import {constants,type BigIntStats} from 'node:fs';
|
|
2
|
+
import {lstat,open,type FileHandle} from 'node:fs/promises';
|
|
3
|
+
import {isAbsolute,normalize,resolve,join,dirname,basename,sep} from 'node:path';
|
|
4
|
+
import {createHash} from 'node:crypto';
|
|
5
|
+
|
|
6
|
+
export const codexProbeReaderVersion='codex-local-rollout-ack/v1';
|
|
7
|
+
export type ProbeCheckpoint=Readonly<{kind:typeof codexProbeReaderVersion}>;
|
|
8
|
+
export type LocalProbeAck=Readonly<{source:'local_codex_rollout_jsonl';readerVersion:typeof codexProbeReaderVersion;threadId:string;probeId:string;receiptId:string}>;
|
|
9
|
+
type Parent={path:string;identity:string};
|
|
10
|
+
type Entry={allowGroupWrite:boolean;file:FileHandle;path:string;threadId:string;identity:string;parents:Parent[];offset:number;skip:boolean;pending:Buffer;bytes:number;records:number;used:boolean;closed:boolean;signal:AbortSignal;cancel:AbortController;abandon?:()=>void;closing?:Promise<void>};
|
|
11
|
+
function fail(code:string):never{throw Error(code);}
|
|
12
|
+
const uuid=(v:unknown):v is string=>typeof v==='string'&&/^[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$/.test(v);
|
|
13
|
+
const identity=(s:BigIntStats)=>[s.dev,s.ino,s.uid,s.mode,s.nlink].join(':');
|
|
14
|
+
const parentIdentity=(s:BigIntStats)=>[s.dev,s.ino,s.uid,s.mode].join(':');
|
|
15
|
+
const object=(v:unknown):v is Record<string,any>=>!!v&&typeof v==='object'&&!Array.isArray(v);
|
|
16
|
+
const decoder=new TextDecoder('utf-8',{fatal:true});
|
|
17
|
+
|
|
18
|
+
/** Bounded local O_RDONLY reader, not a daemon/thread API or Desktop attestor.
|
|
19
|
+
* Never exposes transcript text. Caller obtains path from the exact metadata
|
|
20
|
+
* thread, separately checks notLoaded/versions/identity, and uses a fresh nonce.
|
|
21
|
+
* Only trusted server code constructs this reader; no model/tool path arguments.
|
|
22
|
+
* Filesystem/proc calls are not forcibly interruptible, but overdue evidence is
|
|
23
|
+
* never published. Strict ACK reads never repair permissions. Separate post-consent securing only removes group-write bits; no traversal fallback, content writes or watcher. */
|
|
24
|
+
export class CodexProbeTranscript {
|
|
25
|
+
readonly #home:string;readonly #sessions:string;readonly #uid:bigint;readonly #timeout:number;readonly #poll:number;
|
|
26
|
+
readonly #entries=new WeakMap<ProbeCheckpoint,Entry>();readonly #active=new Set<ProbeCheckpoint>();readonly #stop=new AbortController();
|
|
27
|
+
readonly #openingTasks=new Set<Promise<ProbeCheckpoint>>();readonly #closing=new Set<Promise<void>>();#opening=0;
|
|
28
|
+
constructor(options:{codexHome:string;timeoutMs?:number;pollMs?:number}){
|
|
29
|
+
if(typeof options?.codexHome!=='string'||options.codexHome.length>4096||/[\u0000-\u001f\u007f]/.test(options.codexHome)||!isAbsolute(options.codexHome)||resolve(options.codexHome)!==options.codexHome||options.codexHome===sep||typeof process.getuid!=='function')fail('probe_reader_options_invalid');
|
|
30
|
+
this.#home=options.codexHome;this.#sessions=join(this.#home,'sessions');this.#uid=BigInt(process.getuid());this.#timeout=options.timeoutMs??30000;this.#poll=options.pollMs??100;
|
|
31
|
+
if(!Number.isInteger(this.#timeout)||this.#timeout<1||this.#timeout>30000||!Number.isInteger(this.#poll)||this.#poll<1||this.#poll>1000)fail('probe_reader_options_invalid');
|
|
32
|
+
}
|
|
33
|
+
#check(signal:AbortSignal,deadline:number){if(signal.aborted||this.#stop.signal.aborted)fail('probe_reader_cancelled');if(performance.now()>=deadline)fail('probe_reader_timeout');}
|
|
34
|
+
#signal(signal:AbortSignal,extra?:AbortSignal){if(!(signal instanceof AbortSignal))fail('probe_reader_options_invalid');try{return AbortSignal.any([signal,this.#stop.signal,...(extra?[extra]:[])]);}catch{fail('probe_reader_options_invalid');}}
|
|
35
|
+
async #io<T>(signal:AbortSignal,deadline:number,fn:()=>Promise<T>){this.#check(signal,deadline);const value=await fn();this.#check(signal,deadline);return value;}
|
|
36
|
+
#directory(s:BigIntStats,owned:boolean,allowGroupWrite=false){if(!s.isDirectory()||s.isSymbolicLink()||(owned&&(s.uid!==this.#uid||(s.mode&(allowGroupWrite?0o002n:0o022n))!==0n)))fail('probe_reader_unsafe_path');}
|
|
37
|
+
#file(s:BigIntStats,allowGroupWrite=false){if(!s.isFile()||s.uid!==this.#uid||s.nlink!==1n||(s.mode&(allowGroupWrite?0o002n:0o022n))!==0n||s.size<1n||s.size>2n*1024n*1024n*1024n)fail('probe_reader_unsafe_file');}
|
|
38
|
+
async #parents(path:string,signal:AbortSignal,deadline:number,allowGroupWrite=false){
|
|
39
|
+
const parents:Parent[]=[];
|
|
40
|
+
for(let p=dirname(path);;p=dirname(p)){
|
|
41
|
+
if(parents.length>=64)fail('probe_reader_unsafe_path');const s=await this.#io(signal,deadline,()=>lstat(p,{bigint:true}));this.#directory(s,p===this.#home||p.startsWith(this.#home+sep),allowGroupWrite&&(p===this.#sessions||p.startsWith(this.#sessions+sep)));parents.push({path:p,identity:parentIdentity(s)});if(p===dirname(p))break;
|
|
42
|
+
}
|
|
43
|
+
return parents;
|
|
44
|
+
}
|
|
45
|
+
async #verify(e:Entry,signal:AbortSignal,deadline:number){
|
|
46
|
+
if(e.closed)fail('probe_reader_closed');
|
|
47
|
+
for(const parent of e.parents){const s=await this.#io(signal,deadline,()=>lstat(parent.path,{bigint:true}));this.#directory(s,parent.path===this.#home||parent.path.startsWith(this.#home+sep),e.allowGroupWrite&&(parent.path===this.#sessions||parent.path.startsWith(this.#sessions+sep)));if(parentIdentity(s)!==parent.identity)fail('probe_reader_changed');}
|
|
48
|
+
const at=await this.#io(signal,deadline,()=>lstat(e.path,{bigint:true})),held=await this.#io(signal,deadline,()=>e.file.stat({bigint:true}));this.#file(at,e.allowGroupWrite);this.#file(held,e.allowGroupWrite);
|
|
49
|
+
if(identity(at)!==e.identity||identity(held)!==e.identity||held.size<BigInt(e.offset))fail('probe_reader_changed');return Number(held.size);
|
|
50
|
+
}
|
|
51
|
+
checkpoint(path:string,threadId:string,signal:AbortSignal):Promise<ProbeCheckpoint>{
|
|
52
|
+
return this.#acquire(path,threadId,signal,false);
|
|
53
|
+
}
|
|
54
|
+
#acquire(path:string,threadId:string,signal:AbortSignal,allowGroupWrite:boolean){
|
|
55
|
+
const work=this.#checkpoint(path,threadId,signal,allowGroupWrite);this.#openingTasks.add(work);void work.then(()=>this.#openingTasks.delete(work),()=>this.#openingTasks.delete(work));return work;
|
|
56
|
+
}
|
|
57
|
+
async #checkpoint(path:string,threadId:string,signal:AbortSignal,allowGroupWrite=false):Promise<ProbeCheckpoint>{
|
|
58
|
+
if(typeof path!=='string'||path.length>4096||/[\u0000-\u001f\u007f]/.test(path)||!isAbsolute(path)||normalize(path)!==path||!path.startsWith(this.#sessions+sep)||!uuid(threadId)||!basename(path).startsWith('rollout-')||!basename(path).endsWith('-'+threadId+'.jsonl')||this.#active.size+this.#closing.size+this.#opening>=16)fail('probe_reader_unsafe_path');
|
|
59
|
+
const scoped=this.#signal(signal),deadline=performance.now()+this.#timeout;this.#check(scoped,deadline);this.#opening++;
|
|
60
|
+
let file:FileHandle|undefined;
|
|
61
|
+
try{
|
|
62
|
+
const parents=await this.#parents(path,scoped,deadline,allowGroupWrite),before=await this.#io(scoped,deadline,()=>lstat(path,{bigint:true}));this.#file(before,allowGroupWrite);
|
|
63
|
+
// Acquisition assigns the handle before checking an overdue/cancelled result.
|
|
64
|
+
this.#check(scoped,deadline);file=await open(path,constants.O_RDONLY|constants.O_NOFOLLOW|constants.O_NONBLOCK);this.#check(scoped,deadline);
|
|
65
|
+
const held=await this.#io(scoped,deadline,()=>file!.stat({bigint:true}));this.#file(held,allowGroupWrite);if(identity(held)!==identity(before))fail('probe_reader_changed');
|
|
66
|
+
const cancel=new AbortController();
|
|
67
|
+
const e:Entry={allowGroupWrite,file,path,threadId,identity:identity(held),parents,offset:Number(held.size),skip:false,pending:Buffer.alloc(0),bytes:0,records:0,used:false,closed:false,signal:scoped,cancel};
|
|
68
|
+
await this.#verify(e,scoped,deadline);
|
|
69
|
+
const head=Buffer.alloc(Math.min(Number(held.size),256*1024));const result=await this.#io(scoped,deadline,()=>file!.read(head,0,head.length,0));const first=head.subarray(0,result.bytesRead),end=first.indexOf(10);if(end<0)fail('probe_reader_invalid_header');
|
|
70
|
+
let metadata:unknown;try{metadata=JSON.parse(decoder.decode(first.subarray(0,end)));}catch{fail('probe_reader_invalid_header');}
|
|
71
|
+
if(!object(metadata)||metadata.type!=='session_meta'||!object(metadata.payload)||metadata.payload.id!==threadId)fail('probe_reader_thread_mismatch');
|
|
72
|
+
const last=Buffer.alloc(1);await this.#io(scoped,deadline,()=>file!.read(last,0,1,e.offset-1));e.skip=last[0]!==10;
|
|
73
|
+
await this.#verify(e,scoped,deadline);this.#check(scoped,deadline);
|
|
74
|
+
const token:ProbeCheckpoint=Object.freeze({kind:codexProbeReaderVersion});this.#entries.set(token,e);this.#active.add(token);e.abandon=()=>{void this.close(token);};e.signal.addEventListener('abort',e.abandon,{once:true});file=undefined;return token;
|
|
75
|
+
}catch(error){if(error instanceof Error&&/^probe_reader_[a-z_]+$/.test(error.message))throw error;return fail('probe_reader_io_failed');}
|
|
76
|
+
finally{if(file)await file.close().catch(()=>{});this.#opening--;}
|
|
77
|
+
}
|
|
78
|
+
/** Read-only preparation accepts repairable group-write bits, never ACK evidence. */
|
|
79
|
+
async checkCapability(path:string,threadId:string,signal:AbortSignal){
|
|
80
|
+
const token=await this.#acquire(path,threadId,signal,true);await this.close(token);
|
|
81
|
+
}
|
|
82
|
+
/** Called only after native Pi consent. Tightens exact owned session ancestors
|
|
83
|
+
* and file via no-follow pinned handles; never recursive and never adds a bit.
|
|
84
|
+
* A partial failure is not rolled back by widening permissions. */
|
|
85
|
+
async securePermissions(path:string,threadId:string,signal:AbortSignal,guard:()=>void){
|
|
86
|
+
guard();const token=await this.#acquire(path,threadId,signal,true),e=this.#entries.get(token)!,deadline=performance.now()+this.#timeout;
|
|
87
|
+
try{
|
|
88
|
+
for(const parent of [...e.parents].reverse()){
|
|
89
|
+
if(parent.path!==this.#sessions&&!parent.path.startsWith(this.#sessions+sep))continue;
|
|
90
|
+
guard();await this.#verify(e,signal,deadline);
|
|
91
|
+
const handle=await open(parent.path,constants.O_RDONLY|constants.O_NOFOLLOW|constants.O_DIRECTORY);
|
|
92
|
+
try{
|
|
93
|
+
const before=await handle.stat({bigint:true});if(parentIdentity(before)!==parent.identity)fail('probe_reader_changed');
|
|
94
|
+
guard();this.#check(signal,deadline);
|
|
95
|
+
if(before.mode&0o020n)await handle.chmod(Number(before.mode&0o7777n&~0o020n));
|
|
96
|
+
parent.identity=parentIdentity(await handle.stat({bigint:true}));
|
|
97
|
+
}finally{await handle.close();}
|
|
98
|
+
guard();await this.#verify(e,signal,deadline);
|
|
99
|
+
}
|
|
100
|
+
guard();await this.#verify(e,signal,deadline);const before=await e.file.stat({bigint:true});
|
|
101
|
+
guard();this.#check(signal,deadline);if(before.mode&0o020n)await e.file.chmod(Number(before.mode&0o7777n&~0o020n));
|
|
102
|
+
e.identity=identity(await e.file.stat({bigint:true}));e.allowGroupWrite=false;
|
|
103
|
+
guard();await this.#verify(e,signal,deadline);
|
|
104
|
+
}finally{await this.close(token);}
|
|
105
|
+
}
|
|
106
|
+
#match(e:Entry,line:Buffer,probeId:string):LocalProbeAck|undefined{
|
|
107
|
+
if(++e.records>4096||line.length>65536)fail('probe_reader_limit');if(!line.length)return;
|
|
108
|
+
let record:unknown;try{record=JSON.parse(decoder.decode(line));}catch{fail('probe_reader_invalid_record');}
|
|
109
|
+
if(!object(record)||record.type!=='response_item'||!object(record.payload))return;
|
|
110
|
+
const p=record.payload;if(p.type!=='message'||p.role!=='assistant'||p.phase!=='final_answer'||!Array.isArray(p.content)||p.content.length!==1)return;
|
|
111
|
+
const part=p.content[0];if(!object(part)||part.type!=='output_text'||part.text!=='FLEET_PROBE_ACK '+probeId)return;
|
|
112
|
+
return {source:'local_codex_rollout_jsonl',readerVersion:codexProbeReaderVersion,threadId:e.threadId,probeId,receiptId:'rollout:'+createHash('sha256').update(line).digest('hex')};
|
|
113
|
+
}
|
|
114
|
+
async #sleep(signal:AbortSignal,ms:number){await new Promise<void>((resolve,reject)=>{const abort=()=>{clearTimeout(timer);signal.removeEventListener('abort',abort);reject(Error('probe_reader_cancelled'));};const timer=setTimeout(()=>{signal.removeEventListener('abort',abort);resolve();},ms);signal.addEventListener('abort',abort,{once:true});if(signal.aborted)abort();});}
|
|
115
|
+
async waitForAck(token:ProbeCheckpoint,probeId:string,signal:AbortSignal):Promise<LocalProbeAck>{
|
|
116
|
+
const e=this.#entries.get(token);if(!e||e.closed||e.used||!uuid(probeId))fail('probe_reader_checkpoint_invalid');e.used=true;
|
|
117
|
+
try{
|
|
118
|
+
const scoped=AbortSignal.any([this.#signal(signal,e.cancel.signal),e.signal]),deadline=performance.now()+this.#timeout;
|
|
119
|
+
while(true){
|
|
120
|
+
this.#check(scoped,deadline);const size=await this.#verify(e,scoped,deadline);
|
|
121
|
+
if(size>e.offset){
|
|
122
|
+
if(e.bytes>=2*1024*1024)fail('probe_reader_limit');const chunk=Buffer.alloc(Math.min(65536,size-e.offset,2*1024*1024-e.bytes));
|
|
123
|
+
const got=await this.#io(scoped,deadline,()=>e.file.read(chunk,0,chunk.length,e.offset));if(!got.bytesRead)fail('probe_reader_changed');e.offset+=got.bytesRead;e.bytes+=got.bytesRead;
|
|
124
|
+
let bytes=Buffer.concat([e.pending,chunk.subarray(0,got.bytesRead)]),end:number;
|
|
125
|
+
while((end=bytes.indexOf(10))>=0){this.#check(scoped,deadline);const line=bytes.subarray(0,end);bytes=bytes.subarray(end+1);if(e.skip){e.skip=false;continue;}const ack=this.#match(e,line,probeId);if(ack){await this.#verify(e,scoped,deadline);this.#check(scoped,deadline);return ack;}}
|
|
126
|
+
if(bytes.length>65536)fail('probe_reader_limit');e.pending=Buffer.from(bytes);continue;
|
|
127
|
+
}
|
|
128
|
+
await this.#sleep(scoped,Math.max(1,Math.min(this.#poll,deadline-performance.now())));
|
|
129
|
+
}
|
|
130
|
+
}catch(error){if(error instanceof Error&&/^probe_reader_[a-z_]+$/.test(error.message))throw error;fail('probe_reader_io_failed');}
|
|
131
|
+
finally{await this.close(token);}
|
|
132
|
+
}
|
|
133
|
+
async close(token:ProbeCheckpoint){const e=this.#entries.get(token);if(!e)return;if(e.closing)return e.closing;e.closed=true;if(e.abandon)e.signal.removeEventListener('abort',e.abandon);e.cancel.abort();this.#active.delete(token);let work!:Promise<void>;work=e.file.close().catch(()=>{}).finally(()=>{this.#entries.delete(token);this.#closing.delete(work);});e.closing=work;this.#closing.add(work);return work;}
|
|
134
|
+
async stop(){this.#stop.abort();await Promise.allSettled([...this.#openingTasks]);await Promise.all([...this.#active].map(token=>this.close(token)));await Promise.all([...this.#closing]);}
|
|
135
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {constants,lstatSync,openSync,fstatSync,readSync,closeSync,type Stats} from 'node:fs';
|
|
2
|
+
import {dirname} from 'node:path';
|
|
3
|
+
import {readPrivateJson,writePrivateJson,privateFileIdentity} from './codex-bootstrap-files.ts';
|
|
4
|
+
import type {ConversationKey,TargetEpoch,Right} from './fleet-codex-allowlist.ts';
|
|
5
|
+
import {targetKey} from '../../../harnesses/lib/fleet-target-identity.ts';
|
|
6
|
+
|
|
7
|
+
export type SendState={storeId:string;namespace:ConversationKey;revision:number;bindings:{alias:string;target:TargetEpoch;rights:Right[];status:string;expiresAt?:number}[]};
|
|
8
|
+
type Step={from:number;to:number;alias:string;send:boolean;before:string;after:string};
|
|
9
|
+
type Lineage={schema:'fleet-send-lineage/v1';storeId:string;namespace:ConversationKey;steps:Step[]};
|
|
10
|
+
const limit=64,maxBytes=32768,same=(a:unknown,b:unknown)=>JSON.stringify(a)===JSON.stringify(b);
|
|
11
|
+
const keys=(v:any,names:string[])=>v&&typeof v==='object'&&!Array.isArray(v)&&same(Object.keys(v).sort(),[...names].sort());
|
|
12
|
+
const digest=(v:unknown)=>typeof v==='string'&&/^[a-f0-9]{64}$/.test(v);
|
|
13
|
+
function decode(value:unknown,state:SendState):Lineage{
|
|
14
|
+
const v=value as Lineage;
|
|
15
|
+
if(!keys(v,['schema','storeId','namespace','steps'])||v.schema!=='fleet-send-lineage/v1'||v.storeId!==state.storeId||!same(v.namespace,state.namespace)||!Array.isArray(v.steps)||v.steps.length>limit)throw Error('send_lineage_invalid');
|
|
16
|
+
let previous=-1;
|
|
17
|
+
for(const s of v.steps){if(!keys(s,['from','to','alias','send','before','after'])||!Number.isSafeInteger(s.from)||s.from<0||s.from>=Number.MAX_SAFE_INTEGER||s.to!==s.from+1||s.from<=previous||typeof s.alias!=='string'||s.alias.length<1||s.alias.length>1024||typeof s.send!=='boolean'||!digest(s.before)||!digest(s.after))throw Error('send_lineage_invalid');previous=s.from;}
|
|
18
|
+
return v;
|
|
19
|
+
}
|
|
20
|
+
function changed<T extends SendState>(before:T,alias:string,send:boolean):T{
|
|
21
|
+
const next=structuredClone(before),b=next.bindings.find(b=>b.alias===alias);
|
|
22
|
+
if(!b||b.status!=='active'||b.rights[0]!=='read'||next.revision>=Number.MAX_SAFE_INTEGER)throw Error('send_lineage_invalid');
|
|
23
|
+
b.rights=['read',...(send?['send' as const]:[]),...(b.rights.includes('approve')?['approve' as const]:[])];next.revision++;return next;
|
|
24
|
+
}
|
|
25
|
+
/** Prepare the exact send-only proof before policy rename, under its existing
|
|
26
|
+
* lock. A future/failed write proves nothing until that after-state is current. */
|
|
27
|
+
export async function prepareSendLineage<T extends SendState>(path:string,before:T,after:T,alias:string,send:boolean,hash:(s:T)=>string,signal?:AbortSignal){
|
|
28
|
+
const next=changed(before,alias,send);if(!same(next,after))return;
|
|
29
|
+
const prior=await readPrivateJson(path,maxBytes,signal);
|
|
30
|
+
const lineage:Lineage=prior?decode(prior.value,before):{schema:'fleet-send-lineage/v1',storeId:before.storeId,namespace:structuredClone(before.namespace),steps:[]};
|
|
31
|
+
// Supersede an uncommitted future proof. Past gaps remain gaps, never authority.
|
|
32
|
+
lineage.steps=lineage.steps.filter(s=>s.from<before.revision);
|
|
33
|
+
lineage.steps.push({from:before.revision,to:after.revision,alias,send,before:hash(before),after:hash(after)});lineage.steps=lineage.steps.slice(-limit);
|
|
34
|
+
while(Buffer.byteLength(JSON.stringify(lineage)+'\n')>maxBytes&&lineage.steps.length>1)lineage.steps.shift();
|
|
35
|
+
await writePrivateJson(path,lineage,{signal,expected:prior?.identity??null});
|
|
36
|
+
}
|
|
37
|
+
/** A failed explicit write can leave a future proof. An equivalent generic
|
|
38
|
+
* reconnect/no-op must retire it before publication, including before a later
|
|
39
|
+
* explicit send can extend the chain. Real read/approve revocations cannot
|
|
40
|
+
* match a send-only state and never depend on optional continuity metadata. */
|
|
41
|
+
export async function retireFutureSendLineage<T extends SendState>(path:string,before:T,after:T,signal?:AbortSignal){
|
|
42
|
+
const couldMatch=before.bindings.some(b=>b.status==='active'&&b.rights[0]==='read'&&[false,true].some(send=>same(changed(before,b.alias,send),after)));
|
|
43
|
+
if(!couldMatch)return;
|
|
44
|
+
const prior=await readPrivateJson(path,maxBytes,signal);if(!prior)return;
|
|
45
|
+
const lineage=decode(prior.value,before),steps=lineage.steps.filter(s=>s.from<before.revision);if(steps.length===lineage.steps.length)return;
|
|
46
|
+
lineage.steps=steps;await writePrivateJson(path,lineage,{signal,expected:prior.identity});
|
|
47
|
+
}
|
|
48
|
+
function readNow(path:string):unknown{
|
|
49
|
+
const uid=process.getuid?.();if(uid===undefined)throw Error('send_lineage_unsafe');
|
|
50
|
+
for(let p=dirname(path);;p=dirname(p)){const s=lstatSync(p);if(!s.isDirectory()||s.isSymbolicLink()||(s.uid!==uid&&s.uid!==0)||((s.mode&0o022)!==0&&!(s.uid===0&&(s.mode&0o1000)!==0))||(p===dirname(path)&&(s.uid!==uid||(s.mode&0o077)!==0)))throw Error('send_lineage_unsafe');if(p===dirname(p))break;}
|
|
51
|
+
const parentStamp=(s:Stats)=>[s.dev,s.ino,s.uid,s.mode].join(':');
|
|
52
|
+
const parent=parentStamp(lstatSync(dirname(path))),before=lstatSync(path);
|
|
53
|
+
const safe=(s:Stats)=>{if(!s.isFile()||s.isSymbolicLink()||s.uid!==uid||(s.mode&0o077)!==0||s.nlink!==1||s.size<1||s.size>maxBytes)throw Error('send_lineage_unsafe');};safe(before);
|
|
54
|
+
const fd=openSync(path,constants.O_RDONLY|constants.O_NOFOLLOW|constants.O_NONBLOCK);
|
|
55
|
+
try{const held=fstatSync(fd);safe(held);if(privateFileIdentity(held)!==privateFileIdentity(before))throw Error('send_lineage_changed');const bytes=Buffer.alloc(held.size+1);let count=0;
|
|
56
|
+
while(count<bytes.length){const n=readSync(fd,bytes,count,bytes.length-count,null);if(!n)break;count+=n;}
|
|
57
|
+
if(count!==held.size||privateFileIdentity(fstatSync(fd))!==privateFileIdentity(held)||privateFileIdentity(lstatSync(path))!==privateFileIdentity(held)||parentStamp(lstatSync(dirname(path)))!==parent)throw Error('send_lineage_changed');
|
|
58
|
+
return JSON.parse(new TextDecoder('utf-8',{fatal:true}).decode(bytes.subarray(0,count)));
|
|
59
|
+
}finally{closeSync(fd);}
|
|
60
|
+
}
|
|
61
|
+
/** Caller pins both policy reads and an issued starting state. Every intermediate
|
|
62
|
+
* state is reconstructed; endpoint equality cannot hide revoke/re-enroll ABA. */
|
|
63
|
+
export function verifySendLineage<T extends SendState>(path:string,before:T,after:T,owner:TargetEpoch,hash:(s:T)=>string):boolean{
|
|
64
|
+
try{const anchor=before.bindings.find(b=>targetKey(b.target)===targetKey(owner));if(!anchor||anchor.status!=='active'||anchor.rights[0]!=='read'||after.revision<=before.revision)return false;
|
|
65
|
+
const lineage=decode(readNow(path),before);let state=structuredClone(before);
|
|
66
|
+
for(const step of lineage.steps){if(step.from<state.revision)continue;if(state.revision===after.revision)break;
|
|
67
|
+
if(step.from!==state.revision||step.alias!==anchor.alias||step.before!==hash(state))return false;
|
|
68
|
+
state=changed(state,step.alias,step.send);if(step.to!==state.revision||step.after!==hash(state))return false;
|
|
69
|
+
}
|
|
70
|
+
return same(state,after);
|
|
71
|
+
}catch{return false;}
|
|
72
|
+
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import {createRequire} from 'node:module';
|
|
2
1
|
import {createConnection} from 'node:net';
|
|
3
2
|
import {lstatSync,realpathSync,readlinkSync} from 'node:fs';
|
|
4
3
|
import {dirname,isAbsolute,resolve} from 'node:path';
|
|
5
|
-
import type {EventEmitter} from 'node:events';
|
|
6
4
|
import {randomUUID} from 'node:crypto';
|
|
5
|
+
import {CodexDaemonObserver,webSocket,type WsConnection} from './codex-daemon-observer.ts';
|
|
6
|
+
import {compareCodexVersions,codexDaemonVersionFromUserAgent} from '../../../harnesses/lib/codex-compat.ts';
|
|
7
7
|
|
|
8
|
-
interface WsConnection extends EventEmitter {send(data:string):void;terminate():void;}
|
|
9
|
-
const require=createRequire(import.meta.url);
|
|
10
|
-
const WebSocket=require('ws') as new(url:string,options:Record<string,unknown>)=>WsConnection;
|
|
11
8
|
export type QueueMethod='thread/read'|'thread/loaded/list'|'thread/queue/list'|'thread/queue/add';
|
|
12
9
|
export class QueueRpcError extends Error {
|
|
13
10
|
readonly code:string;readonly attempted:boolean;
|
|
@@ -40,7 +37,14 @@ export class CodexUnixQueueRpc {
|
|
|
40
37
|
if(!socket.isSocket()||socket.isSymbolicLink()||socket.uid!==uid||(socket.mode&0o022)!==0||realpathSync(path)!==path)throw new QueueRpcError('UNSAFE_SOCKET');
|
|
41
38
|
return {path,epoch:`${alias.dev}:${alias.ino}:${path}:${socket.dev}:${socket.ino}`};
|
|
42
39
|
}
|
|
43
|
-
request(method:QueueMethod,params:unknown,options:{signal?:AbortSignal;beforeWrite?:()=>void}={}):Promise<unknown>{
|
|
40
|
+
request(method:QueueMethod,params:unknown,options:{signal?:AbortSignal;beforeWrite?:()=>void;pin?:{daemonVersion:string;socketEpoch:string}}={}):Promise<unknown>{
|
|
41
|
+
// Opt-in probe/bootstrap pin. Does not admit a new tuple or attest Desktop.
|
|
42
|
+
options={...options,...(options.pin?{pin:{...options.pin}}:{})};const pin=options.pin,deadline=performance.now()+this.timeout;
|
|
43
|
+
if(pin&&(compareCodexVersions(pin.daemonVersion,pin.daemonVersion)!==0||typeof pin.socketEpoch!=='string'||!/^codex-initialize\/v1:[a-f0-9]{64}$/.test(pin.socketEpoch)))return Promise.reject(new QueueRpcError('INVALID_PIN'));
|
|
44
|
+
const epochObserver=pin?new CodexDaemonObserver({socketPath:this.path}):undefined;
|
|
45
|
+
const pinError=()=>{if(!pin)return undefined;if(options.signal?.aborted)return 'CANCELLED';if(performance.now()>=deadline)return 'TIMEOUT';try{if(epochObserver!.socketEpoch(options.signal??new AbortController().signal)!==pin.socketEpoch)return 'SOCKET_CHANGED';}catch{return 'SOCKET_CHANGED';}return performance.now()>=deadline?'TIMEOUT':undefined;};
|
|
46
|
+
if(pin)try{params=structuredClone(params);}catch{return Promise.reject(new QueueRpcError('REQUEST_LIMIT'));}
|
|
47
|
+
const initialPinError=pinError();if(initialPinError)return Promise.reject(new QueueRpcError(initialPinError));
|
|
44
48
|
if(!['thread/read','thread/loaded/list','thread/queue/list','thread/queue/add'].includes(method))return Promise.reject(new QueueRpcError('METHOD_NOT_ALLOWED'));
|
|
45
49
|
let endpoint:ReturnType<CodexUnixQueueRpc['endpoint']>;
|
|
46
50
|
try{endpoint=this.endpoint();}catch{return Promise.reject(new QueueRpcError('DAEMON_UNAVAILABLE'));}
|
|
@@ -57,18 +61,22 @@ export class CodexUnixQueueRpc {
|
|
|
57
61
|
const abort=()=>finish('CANCELLED');
|
|
58
62
|
options.signal?.addEventListener('abort',abort,{once:true});
|
|
59
63
|
try{
|
|
60
|
-
ws=new
|
|
64
|
+
ws=new (webSocket())('ws+unix://'+endpoint.path+':/',{createConnection:()=>createConnection(endpoint.path),maxPayload:32768,perMessageDeflate:false,followRedirects:false,handshakeTimeout:this.timeout});
|
|
61
65
|
timer=setTimeout(()=>finish('TIMEOUT'),this.timeout);
|
|
62
66
|
ws.on('open',()=>{
|
|
63
|
-
try{if(this.endpoint().epoch!==endpoint.epoch||options.signal?.aborted){finish('SOCKET_CHANGED');return;}
|
|
67
|
+
try{const error=pinError();if(error){finish(error);return;}if(this.endpoint().epoch!==endpoint.epoch||options.signal?.aborted){finish('SOCKET_CHANGED');return;}
|
|
64
68
|
ws!.send(JSON.stringify({id:initializeId,method:'initialize',params:{clientInfo:{name:'agent_fleet_queue_bridge',title:'Fleet queue bridge',version:'1'},capabilities:{experimentalApi:true}}}));
|
|
65
69
|
}catch{finish('INITIALIZE_FAILED');}
|
|
66
70
|
});
|
|
67
|
-
ws.on('message',(data:Buffer)=>{
|
|
68
|
-
if(done)return;if(++messages>256||data.length>32768){finish('RESPONSE_LIMIT');return;}
|
|
69
|
-
|
|
71
|
+
ws.on('message',(data:Buffer,isBinary:boolean)=>{
|
|
72
|
+
if(done)return;if(++messages>256||!Buffer.isBuffer(data)||data.length>32768){finish('RESPONSE_LIMIT');return;}
|
|
73
|
+
if(isBinary){finish('INVALID_RESPONSE');return;}
|
|
74
|
+
let response:any;try{response=JSON.parse(new TextDecoder('utf-8',{fatal:true}).decode(data));}catch{finish('INVALID_JSON');return;}
|
|
75
|
+
if(!response||typeof response!=='object'||Array.isArray(response)){finish('INVALID_RESPONSE');return;}
|
|
76
|
+
if(Object.hasOwn(response,'method'))return;
|
|
70
77
|
if(!initialized&&response.id===initializeId){
|
|
71
|
-
if(response
|
|
78
|
+
if(Object.hasOwn(response,'error')||!response.result||typeof response.result.userAgent!=='string'){finish('INITIALIZE_REJECTED');return;}
|
|
79
|
+
if(pin){if(codexDaemonVersionFromUserAgent(response.result.userAgent)!==pin.daemonVersion){finish('VERSION_CHANGED');return;}const error=pinError();if(error){finish(error);return;}}
|
|
72
80
|
initialized=true;
|
|
73
81
|
try{
|
|
74
82
|
ws!.send(JSON.stringify({method:'initialized',params:{}}));
|
|
@@ -77,10 +85,12 @@ export class CodexUnixQueueRpc {
|
|
|
77
85
|
options.beforeWrite?.();
|
|
78
86
|
if(options.signal?.aborted){finish('CANCELLED');return;}
|
|
79
87
|
if(this.endpoint().epoch!==endpoint.epoch){finish('SOCKET_CHANGED');return;}
|
|
88
|
+
const error=pinError();if(error){finish(error);return;}
|
|
80
89
|
attempted=true;ws!.send(packet);
|
|
81
90
|
}catch{finish('PREWRITE_OR_SEND_FAILED');}
|
|
82
91
|
}else if(initialized&&response.id===requestId){
|
|
83
|
-
|
|
92
|
+
const error=pinError();if(error){finish(error);return;}
|
|
93
|
+
if(Object.hasOwn(response,'error'))finish('RPC_REJECTED');else if(!Object.hasOwn(response,'result'))finish('INVALID_RESPONSE');else finish(undefined,response.result);
|
|
84
94
|
}
|
|
85
95
|
// Notifications/server requests are never answered with automatic approvals.
|
|
86
96
|
});
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// S2: local POSIX persistence for D2-L cooperative-agent policy. No Fleet transport.
|
|
2
|
-
import { constants, type Stats } from 'node:fs';
|
|
2
|
+
import { constants, lstatSync, openSync, fstatSync, readSync, closeSync, type Stats } from 'node:fs';
|
|
3
3
|
import { mkdir, lstat, open, rename, unlink, rmdir } from 'node:fs/promises';
|
|
4
4
|
import { isAbsolute, join, resolve } from 'node:path';
|
|
5
5
|
import { createHash, randomUUID } from 'node:crypto';
|
|
6
6
|
import { setTimeout as delay } from 'node:timers/promises';
|
|
7
7
|
import { AllowedSessionsPolicy, AllowlistError, type BindingHandle, type ConversationKey, type TargetEpoch, type Right } from './fleet-codex-allowlist.ts';
|
|
8
|
+
import {prepareSendLineage,verifySendLineage,retireFutureSendLineage} from './codex-send-lineage.ts';
|
|
8
9
|
|
|
9
10
|
export type StoreCode = 'STATE_MISSING' | 'STATE_EXISTS' | 'STATE_INVALID' | 'STATE_VERSION_UNSUPPORTED'
|
|
10
11
|
| 'NAMESPACE_MISMATCH' | 'STATE_CHANGED' | 'STATE_REGRESSED' | 'STORE_BUSY' | 'UNSAFE_PATH'
|
|
@@ -88,6 +89,7 @@ export class AllowedSessionsStore {
|
|
|
88
89
|
readonly #now: () => number;
|
|
89
90
|
readonly #checkpoint: NonNullable<StoreOptions['checkpoint']>;
|
|
90
91
|
#seen?: { storeId: string; revision: number };
|
|
92
|
+
readonly #snapshots=new WeakMap<StoreSnapshot,State>();
|
|
91
93
|
#issued = new WeakMap<object, Issued>();
|
|
92
94
|
constructor(baseDir: string, context: ConversationKey, options: StoreOptions = {}) {
|
|
93
95
|
if (process.platform === 'win32' || !process.getuid || !isAbsolute(baseDir) || resolve(baseDir) !== baseDir) fail('UNSAFE_PATH');
|
|
@@ -166,15 +168,17 @@ export class AllowedSessionsStore {
|
|
|
166
168
|
} catch (e) { if (missing(e)) fail('STATE_MISSING'); throw e; }
|
|
167
169
|
finally { await file?.close(); }
|
|
168
170
|
}
|
|
169
|
-
|
|
171
|
+
#notCancelled(signal?: AbortSignal): void { if (signal?.aborted) fail('STATE_CHANGED'); }
|
|
172
|
+
async #write(state: State, initial = false, signal?: AbortSignal): Promise<void> {
|
|
170
173
|
const bytes = Buffer.from(canonical(state));
|
|
171
174
|
decode(bytes, this.#context); // Same limits/invariants on outbound state, before any disk mutation.
|
|
172
175
|
const temp = this.#path+'.'+randomUUID()+'.tmp';
|
|
173
176
|
let file, owned: Stats | undefined, renamed = false;
|
|
174
177
|
try {
|
|
178
|
+
this.#notCancelled(signal);
|
|
175
179
|
file = await open(temp, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | constants.O_NOFOLLOW, 0o600);
|
|
176
180
|
owned = await file.stat(); this.#safe(owned, false);
|
|
177
|
-
await this.#checkpoint('beforeWrite'); await file.writeFile(bytes);
|
|
181
|
+
await this.#checkpoint('beforeWrite'); this.#notCancelled(signal); await file.writeFile(bytes);
|
|
178
182
|
await this.#checkpoint('beforeFileSync'); await file.sync(); await file.close(); file = undefined;
|
|
179
183
|
await this.#checkpoint('beforeRename'); await this.#rootReady(false);
|
|
180
184
|
let dest: Stats | undefined;
|
|
@@ -182,10 +186,12 @@ export class AllowedSessionsStore {
|
|
|
182
186
|
if (initial && dest) fail('STATE_EXISTS');
|
|
183
187
|
if (!initial && !dest) fail('STATE_MISSING');
|
|
184
188
|
if (dest) this.#safe(dest, false);
|
|
189
|
+
this.#notCancelled(signal);
|
|
185
190
|
await rename(temp, this.#path); renamed = true;
|
|
186
191
|
await this.#checkpoint('afterRename'); await this.#checkpoint('beforeDirectorySync');
|
|
187
192
|
const directory = await open(this.#root, constants.O_RDONLY | constants.O_DIRECTORY | constants.O_NOFOLLOW);
|
|
188
193
|
try { this.#safe(await directory.stat(), true); await directory.sync(); } finally { await directory.close(); }
|
|
194
|
+
this.#notCancelled(signal);
|
|
189
195
|
this.#seen = { storeId: state.storeId, revision: state.revision };
|
|
190
196
|
} catch (e) { if (renamed) fail('COMMIT_UNCERTAIN'); throw normalize(e); }
|
|
191
197
|
finally {
|
|
@@ -199,7 +205,7 @@ export class AllowedSessionsStore {
|
|
|
199
205
|
}
|
|
200
206
|
}
|
|
201
207
|
}
|
|
202
|
-
#snapshot(s: State): StoreSnapshot {
|
|
208
|
+
#snapshot(s: State): StoreSnapshot { const result=structuredClone({revision:s.revision,bindings:s.bindings});this.#snapshots.set(result,structuredClone(s));return result; }
|
|
203
209
|
#issue(s: State, alias: string): StoreHandle {
|
|
204
210
|
const h = Object.freeze({ alias, revision: s.revision });
|
|
205
211
|
this.#issued.set(h, { alias, revision: s.revision, storeId: s.storeId }); return h;
|
|
@@ -241,9 +247,11 @@ export class AllowedSessionsStore {
|
|
|
241
247
|
return h;
|
|
242
248
|
}
|
|
243
249
|
async #run<T>(current: readonly TargetEpoch[] | undefined,
|
|
244
|
-
action: (s: State, p: Policy) => (committed: State) => T, mutation = false): Promise<T> {
|
|
250
|
+
action: (s: State, p: Policy) => (committed: State) => T, mutation = false, signal?: AbortSignal, send?:{alias:string;enabled:boolean}): Promise<T> {
|
|
251
|
+
this.#notCancelled(signal);
|
|
245
252
|
return this.#withLock(false, async () => {
|
|
246
253
|
const original = await this.#read(), baseline = structuredClone(original);
|
|
254
|
+
this.#notCancelled(signal);
|
|
247
255
|
const p: Policy = current === undefined ? { policy: new AllowedSessionsPolicy(), handles: new Map<string, BindingHandle>(), blocked: new Map() }
|
|
248
256
|
: this.#hydrate(baseline, current);
|
|
249
257
|
const work = structuredClone(baseline);
|
|
@@ -251,16 +259,24 @@ export class AllowedSessionsStore {
|
|
|
251
259
|
try { result = action(work, p); }
|
|
252
260
|
catch (e) {
|
|
253
261
|
// Persist positively observed staleness even when access/transition refuses.
|
|
254
|
-
if (canonical(baseline) !== canonical(original)) await this.#commit(baseline);
|
|
262
|
+
if (canonical(baseline) !== canonical(original)) await this.#commit(baseline,original);
|
|
255
263
|
throw e;
|
|
256
264
|
}
|
|
257
|
-
if (mutation || canonical(work) !== canonical(original)) await this.#commit(work);
|
|
265
|
+
if (mutation || canonical(work) !== canonical(original)) await this.#commit(work,original,signal,send);
|
|
258
266
|
return result(work);
|
|
259
267
|
});
|
|
260
268
|
}
|
|
261
|
-
async #commit(s: State): Promise<void> {
|
|
269
|
+
async #commit(s: State,before:State,signal?:AbortSignal,send?:{alias:string;enabled:boolean}): Promise<void> {
|
|
262
270
|
if (s.revision === Number.MAX_SAFE_INTEGER) fail('REVISION_EXHAUSTED');
|
|
263
|
-
|
|
271
|
+
this.#notCancelled(signal);
|
|
272
|
+
s.revision++;
|
|
273
|
+
if(send){
|
|
274
|
+
// Continuity is optional; its failure must never prevent explicit revoke.
|
|
275
|
+
// The exact read guard rejects any missing/untrusted proof afterwards.
|
|
276
|
+
try{await prepareSendLineage(this.#path+'.send-lineage',before,s,send.alias,send.enabled,state=>createHash('sha256').update(canonical(state)).digest('hex'),signal);}catch{/* Policy authority remains independent of its continuity witness. */}
|
|
277
|
+
}else await retireFutureSendLineage(this.#path+'.send-lineage',before,s,signal);
|
|
278
|
+
this.#notCancelled(signal);
|
|
279
|
+
await this.#write(s, false, signal);
|
|
264
280
|
}
|
|
265
281
|
async initialize(): Promise<StoreSnapshot> {
|
|
266
282
|
return this.#withLock(true, async () => {
|
|
@@ -269,6 +285,44 @@ export class AllowedSessionsStore {
|
|
|
269
285
|
await this.#write(s, true); return this.#snapshot(s);
|
|
270
286
|
});
|
|
271
287
|
}
|
|
288
|
+
/** Bounded read-only pre-byte CAS check; never repairs state, locks, grants
|
|
289
|
+
* or treats an absent file as authority. Only snapshots issued by this store
|
|
290
|
+
* instance are current; caller separately checks rights/lease/current owner. */
|
|
291
|
+
snapshotCurrent(expected: StoreSnapshot | null): boolean {
|
|
292
|
+
let fd: number | undefined;
|
|
293
|
+
try {
|
|
294
|
+
if (expected === null) { if (this.#seen) return false; try { const root = lstatSync(this.#root); this.#safe(root, true); } catch (e) { if (!missing(e)) return false; } try { lstatSync(this.#path); return false; } catch (e) { return missing(e); } }
|
|
295
|
+
if (!this.#seen) return false;
|
|
296
|
+
const root = lstatSync(this.#root); this.#safe(root, true);
|
|
297
|
+
const before = lstatSync(this.#path); this.#safe(before, false);
|
|
298
|
+
fd = openSync(this.#path, constants.O_RDONLY | constants.O_NOFOLLOW); const held = fstatSync(fd); this.#safe(held, false);
|
|
299
|
+
if (held.dev !== before.dev || held.ino !== before.ino) return false;
|
|
300
|
+
const buffer = Buffer.alloc(MAX_BYTES + 1), count = readSync(fd, buffer, 0, buffer.length, 0); if (count > MAX_BYTES || count !== held.size) return false;
|
|
301
|
+
const state = decode(buffer.subarray(0, count), this.#context), after = fstatSync(fd), at = lstatSync(this.#path), parent = lstatSync(this.#root);
|
|
302
|
+
if (after.dev !== held.dev || after.ino !== held.ino || after.mtimeMs !== held.mtimeMs || after.ctimeMs !== held.ctimeMs || after.size !== held.size || at.dev !== held.dev || at.ino !== held.ino || parent.dev !== root.dev || parent.ino !== root.ino) return false;
|
|
303
|
+
this.#safe(after, false); this.#safe(at, false); this.#safe(parent, true);
|
|
304
|
+
return state.storeId === this.#seen.storeId && state.revision === this.#seen.revision && JSON.stringify(this.#snapshot(state)) === JSON.stringify(expected);
|
|
305
|
+
} catch { return false; } finally { if (fd !== undefined) closeSync(fd); }
|
|
306
|
+
}
|
|
307
|
+
/** Read-only advancement of an issued snapshot through explicit send writes.
|
|
308
|
+
* Exact snapshots stay the default; unproved/gapped/other mutations fail closed. */
|
|
309
|
+
advanceSendSnapshot(expected:StoreSnapshot|null,owner:TargetEpoch):StoreSnapshot|null{
|
|
310
|
+
if(!expected)return null;const before=this.#snapshots.get(expected);
|
|
311
|
+
if(!before||!this.#seen||this.#seen.storeId!==before.storeId||this.#seen.revision!==before.revision||JSON.stringify(expected)!==JSON.stringify({revision:before.revision,bindings:before.bindings}))return null;
|
|
312
|
+
let fd:number|undefined;
|
|
313
|
+
try{
|
|
314
|
+
const root=lstatSync(this.#root);this.#safe(root,true);const at=lstatSync(this.#path);this.#safe(at,false);
|
|
315
|
+
fd=openSync(this.#path,constants.O_RDONLY|constants.O_NOFOLLOW|constants.O_NONBLOCK);const held=fstatSync(fd);this.#safe(held,false);
|
|
316
|
+
if(held.dev!==at.dev||held.ino!==at.ino||held.size>MAX_BYTES)return null;
|
|
317
|
+
const bytes=Buffer.alloc(MAX_BYTES+1);let count=0;while(count<bytes.length){const n=readSync(fd,bytes,count,bytes.length-count,null);if(!n)break;count+=n;}
|
|
318
|
+
if(count!==held.size)return null;const state=decode(bytes.subarray(0,count),this.#context);
|
|
319
|
+
if(!verifySendLineage(this.#path+'.send-lineage',before,state,owner,s=>createHash('sha256').update(canonical(s)).digest('hex')))return null;
|
|
320
|
+
const after=fstatSync(fd),linked=lstatSync(this.#path),parent=lstatSync(this.#root);this.#safe(after,false);this.#safe(linked,false);this.#safe(parent,true);
|
|
321
|
+
const stamp=(s:Stats)=>[s.dev,s.ino,s.mode,s.uid,s.nlink,s.size,s.mtimeMs,s.ctimeMs].join(':');
|
|
322
|
+
if(stamp(after)!==stamp(held)||stamp(linked)!==stamp(held)||parent.dev!==root.dev||parent.ino!==root.ino)return null;
|
|
323
|
+
this.#seen={storeId:state.storeId,revision:state.revision};return this.#snapshot(state);
|
|
324
|
+
}catch{return null;}finally{if(fd!==undefined)closeSync(fd);}
|
|
325
|
+
}
|
|
272
326
|
async open(): Promise<StoreSnapshot> { return this.#run(undefined, () => committed => this.#snapshot(committed)); }
|
|
273
327
|
async list(current: readonly TargetEpoch[]): Promise<StoreSnapshot> { return this.#run(current, () => committed => this.#snapshot(committed)); }
|
|
274
328
|
async enroll(proposal: Readonly<{ alias: string; target: TargetEpoch }>, current: readonly TargetEpoch[], expectedRevision?: number): Promise<StoreHandle> {
|
|
@@ -285,8 +339,10 @@ export class AllowedSessionsStore {
|
|
|
285
339
|
}, true);
|
|
286
340
|
}
|
|
287
341
|
/** Create-only atomic reviewed lease; existing bindings never change implicitly. */
|
|
288
|
-
async connect(proposal: { alias: string; target: TargetEpoch; rights: readonly Right[]; expiresAt: number }, current: readonly TargetEpoch[], expectedRevision: number): Promise<StoreSnapshot> {
|
|
289
|
-
|
|
342
|
+
async connect(proposal: { alias: string; target: TargetEpoch; rights: readonly Right[]; expiresAt: number }, current: readonly TargetEpoch[], expectedRevision: number, signal?: AbortSignal): Promise<StoreSnapshot> {
|
|
343
|
+
if (signal !== undefined && !(signal instanceof AbortSignal)) fail('STATE_INVALID');
|
|
344
|
+
proposal = structuredClone(proposal); current = Array.from(current, v => epoch(v));
|
|
345
|
+
const result = await this.#run(current, (s, p) => {
|
|
290
346
|
this.#expected(s, expectedRevision);
|
|
291
347
|
if (!keys(proposal, ['alias','target','rights','expiresAt']) || !text(proposal.alias) || !Number.isSafeInteger(proposal.expiresAt) || proposal.expiresAt <= this.#now()
|
|
292
348
|
|| !Array.isArray(proposal.rights) || JSON.stringify(proposal.rights) !== JSON.stringify(['read', ...(proposal.rights.includes('send') ? ['send'] : []), ...(proposal.rights.includes('approve') ? ['approve'] : [])])) fail('STATE_INVALID');
|
|
@@ -295,7 +351,37 @@ export class AllowedSessionsStore {
|
|
|
295
351
|
s.version = 3;
|
|
296
352
|
s.bindings.push({ alias: proposal.alias, target: epoch(proposal.target), rights: [...proposal.rights], status: 'active', expiresAt: proposal.expiresAt });
|
|
297
353
|
return committed => this.#snapshot(committed);
|
|
298
|
-
}, true);
|
|
354
|
+
}, true, signal);
|
|
355
|
+
if (signal?.aborted) fail('COMMIT_UNCERTAIN');
|
|
356
|
+
return result;
|
|
357
|
+
}
|
|
358
|
+
/** Explicit reviewed replacement/renewal, never alias-based discovery or consent.
|
|
359
|
+
* Codex writer only: caller owns human authorization, fresh owner/presence and
|
|
360
|
+
* quiescent-writer checks. Old target and namespace revision are both CAS pins.
|
|
361
|
+
* Cancellation before rename leaves the old lease; after rename is uncertain. */
|
|
362
|
+
async reconnect(proposal: { alias: string; previousTarget: TargetEpoch; target: TargetEpoch; rights: readonly Right[]; expiresAt: number }, current: readonly TargetEpoch[], expectedRevision: number, signal: AbortSignal): Promise<StoreSnapshot> {
|
|
363
|
+
if (!(signal instanceof AbortSignal) || !keys(proposal, ['alias','previousTarget','target','rights','expiresAt']) || !text(proposal.alias)
|
|
364
|
+
|| !Number.isSafeInteger(proposal.expiresAt) || !Array.isArray(proposal.rights) || proposal.rights.length > 3
|
|
365
|
+
|| JSON.stringify(proposal.rights) !== JSON.stringify(['read', ...(proposal.rights.includes('send') ? ['send'] : []), ...(proposal.rights.includes('approve') ? ['approve'] : [])])
|
|
366
|
+
|| !Array.isArray(current) || current.length > 128) fail('STATE_INVALID');
|
|
367
|
+
const owned = { alias: proposal.alias, previousTarget: epoch(proposal.previousTarget), target: epoch(proposal.target), rights: Array.from(proposal.rights), expiresAt: proposal.expiresAt };
|
|
368
|
+
const snapshots = Array.from(current, v => epoch(v));
|
|
369
|
+
const result = await this.#run(snapshots, s => {
|
|
370
|
+
this.#expected(s, expectedRevision);
|
|
371
|
+
const now = this.#now();
|
|
372
|
+
if (!Number.isSafeInteger(now) || now < 0 || owned.expiresAt <= now) fail('STATE_INVALID');
|
|
373
|
+
const binding = s.bindings.find(b => b.alias === owned.alias);
|
|
374
|
+
if (!binding) throw new AllowlistError('NOT_ALLOWED');
|
|
375
|
+
if (!same(binding.target, owned.previousTarget) || s.bindings.some(b => b !== binding && same(b.target, owned.target))) fail('STATE_CHANGED');
|
|
376
|
+
// A new policy validates the exact live replacement even if the old lease
|
|
377
|
+
// is expired or has already been marked needsRebind. No old rights migrate.
|
|
378
|
+
new AllowedSessionsPolicy().enroll(this.#context, { alias: owned.alias, target: owned.target }, snapshots);
|
|
379
|
+
s.version = 3;
|
|
380
|
+
binding.target = owned.target; binding.rights = owned.rights; binding.expiresAt = owned.expiresAt; binding.status = 'active';
|
|
381
|
+
return committed => this.#snapshot(committed);
|
|
382
|
+
}, true, signal);
|
|
383
|
+
if (signal.aborted) fail('COMMIT_UNCERTAIN');
|
|
384
|
+
return result;
|
|
299
385
|
}
|
|
300
386
|
async resolve(selector: string, current: readonly TargetEpoch[]): Promise<StoreHandle> {
|
|
301
387
|
return this.#run(current, (s, p) => {
|
|
@@ -319,7 +405,7 @@ export class AllowedSessionsStore {
|
|
|
319
405
|
const b = this.#entry(s, handle);
|
|
320
406
|
p.policy.grantSend(this.#context, this.#active(b, p), current); b.rights = ['read', 'send', ...(b.rights.includes('approve') ? ['approve' as const] : [])];
|
|
321
407
|
return committed => this.#issue(committed, b.alias);
|
|
322
|
-
}, true);
|
|
408
|
+
}, true,undefined,{alias:handle.alias,enabled:true});
|
|
323
409
|
}
|
|
324
410
|
/** Explicit upgrade-on-grant: v1 rights are preserved; old writers fail closed on v2. */
|
|
325
411
|
async grantApprove(handle: StoreHandle, current: readonly TargetEpoch[]): Promise<StoreHandle> {
|
|
@@ -344,7 +430,7 @@ export class AllowedSessionsStore {
|
|
|
344
430
|
this.#expected(s, expectedRevision);
|
|
345
431
|
const b = s.bindings.find(b => b.alias === alias); if (!b) throw new AllowlistError('NOT_ALLOWED');
|
|
346
432
|
b.rights = b.rights.filter(r => r !== 'send'); return committed => this.#snapshot(committed);
|
|
347
|
-
}, true);
|
|
433
|
+
}, true,undefined,{alias,enabled:false});
|
|
348
434
|
}
|
|
349
435
|
async revoke(alias: string, expectedRevision: number): Promise<StoreSnapshot> {
|
|
350
436
|
return this.#run(undefined, s => {
|
|
@@ -45,7 +45,7 @@ export class AnswerBridge {
|
|
|
45
45
|
this.#prune();const budget=this.#options.pendingBudget?.(key(c))??{total:0,context:0};if(this.#pending.size+budget.total>=64||this.pendingCount(key(c))+budget.context>=16)fail('BUSY');
|
|
46
46
|
const proposalId=randomUUID(),qd=questionDigest(q),digest=answerDigest(args.operation,args.target,args.questionId,args.toolCallId,qd,args.response);
|
|
47
47
|
this.#pending.set(proposalId,{context:key(c),expires:this.#time()+300000,args,access,questionDigest:qd,digest});
|
|
48
|
-
return {status:'prepared',source:'local_human_action_proposal',proposalId,expiresInSeconds:300,...args,question:structuredClone(q),questionDigest:qd,digest,expectedRevision:access.handle.revision,requiresHumanConfirmation:true,humanProvenance:'unknown',effect:args.operation==='refusal'?'one question-scoped human refusal; not Pi turn cancel':'one addressed human answer to this exact pending question; not an LLM instruction'};
|
|
48
|
+
return {status:'prepared',source:'local_human_action_proposal',proposalId,expiresInSeconds:300,...args,question:structuredClone(q),questionDigest:qd,digest,expectedRevision:access.handle.revision,requiresHumanConfirmation:false,requiresActualHumanResponse:true,humanProvenance:'unknown',effect:args.operation==='refusal'?'one question-scoped human refusal; not Pi turn cancel':'one addressed human answer to this exact pending question; not an LLM instruction'};
|
|
49
49
|
}
|
|
50
50
|
async commit(c:ConversationKey,id:string,signal?:AbortSignal):Promise<Record<string,unknown>>{
|
|
51
51
|
this.#context(c);this.#prune();const p=this.#pending.get(id);if(!p||p.context!==key(c)||p.expires<=this.#time())fail('PROPOSAL_UNAVAILABLE');
|