@chankov/agent-fleet 2.0.17 → 2.0.18
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/scripts/coms-claude-bridge.ts +75 -49
- package/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +18 -20
- package/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +3 -1
- package/.pi/agents/model-profiles.yaml +5 -5
- package/.pi/agents/peers.yaml +3 -3
- package/.pi/agents/voices.yaml +1 -1
- package/.pi/harnesses/agent-hub/README.md +35 -8
- package/.pi/harnesses/agent-hub/agentic-sources.ts +29 -5
- package/.pi/harnesses/agent-hub/config/overrides.ts +13 -3
- package/.pi/harnesses/agent-hub/delegate.ts +16 -5
- package/.pi/harnesses/agent-hub/deterministic-fs.ts +7 -4
- package/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +13 -2
- package/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +2 -0
- package/.pi/harnesses/agent-hub/dispatch-native-types.ts +7 -0
- package/.pi/harnesses/agent-hub/dispatch-native.ts +1 -1
- package/.pi/harnesses/agent-hub/file-discovery/adapters.ts +82 -0
- package/.pi/harnesses/agent-hub/file-discovery/broker-client.ts +56 -0
- package/.pi/harnesses/agent-hub/file-discovery/broker.ts +125 -0
- package/.pi/harnesses/agent-hub/file-discovery/child-extension.ts +33 -0
- package/.pi/harnesses/agent-hub/file-discovery/descendant.ts +63 -0
- package/.pi/harnesses/agent-hub/file-discovery/discovery-worker.mjs +15 -0
- package/.pi/harnesses/agent-hub/file-discovery/discovery.ts +126 -0
- package/.pi/harnesses/agent-hub/file-discovery/evaluate.ts +48 -0
- package/.pi/harnesses/agent-hub/file-discovery/hub.ts +152 -0
- package/.pi/harnesses/agent-hub/file-discovery/native-context.ts +8 -0
- package/.pi/harnesses/agent-hub/file-discovery/owners.ts +96 -0
- package/.pi/harnesses/agent-hub/file-discovery/results.ts +54 -0
- package/.pi/harnesses/agent-hub/file-discovery/runtime.ts +120 -0
- package/.pi/harnesses/agent-hub/file-discovery/sources.ts +69 -0
- package/.pi/harnesses/agent-hub/file-discovery/state.ts +22 -0
- package/.pi/harnesses/agent-hub/filesystem-tool.ts +74 -26
- package/.pi/harnesses/agent-hub/index.ts +23 -5
- package/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +3 -2
- package/.pi/harnesses/agent-hub/no-progress.ts +45 -15
- package/.pi/harnesses/agent-hub/package.json +1 -1
- package/.pi/harnesses/agent-hub/policy/work-mode.ts +2 -1
- package/.pi/harnesses/agent-hub/proactive-config.ts +8 -3
- package/.pi/harnesses/agent-hub/proactive-external-git.ts +59 -0
- package/.pi/harnesses/agent-hub/proactive-external.ts +77 -0
- package/.pi/harnesses/agent-hub/proactive-local.ts +25 -7
- package/.pi/harnesses/agent-hub/proactive-observer.ts +2 -1
- package/.pi/harnesses/agent-hub/proactive-rules.ts +39 -11
- package/.pi/harnesses/agent-hub/proactive-runtime.ts +8 -6
- package/.pi/harnesses/agent-hub/proactive-snapshot.ts +32 -2
- package/.pi/harnesses/agent-hub/proactive-types.ts +5 -1
- package/.pi/harnesses/agent-hub/prompts/fragments.ts +21 -49
- package/.pi/harnesses/agent-hub/prompts/system-prompt.ts +2 -1
- package/.pi/harnesses/agent-hub/research/runtime.ts +7 -3
- package/.pi/harnesses/agent-hub/research/spawn-run.ts +17 -6
- package/.pi/harnesses/agent-hub/spawn.ts +38 -9
- package/.pi/harnesses/agent-hub/system1-communication-store.ts +39 -0
- package/.pi/harnesses/agent-hub/tools/action-executors.ts +6 -1
- package/.pi/harnesses/agent-hub/tools/ask-system1-files.ts +15 -0
- package/.pi/harnesses/agent-hub/tools/ask-system1.ts +1 -1
- package/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +4 -4
- package/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +4 -2
- package/.pi/harnesses/agent-hub/tools/set-task-tier.ts +3 -3
- package/.pi/harnesses/agent-hub/tools/spawn-research.ts +3 -1
- package/.pi/harnesses/agent-hub/ui/system1-communication.ts +1 -1
- package/.pi/harnesses/agent-hub/work-mode.ts +3 -0
- package/.pi/harnesses/coms/package.json +1 -1
- package/.pi/harnesses/damage-control-continue/package.json +1 -1
- package/.pi/harnesses/lib/context-budget-child-prompt.ts +3 -2
- package/.pi/harnesses/lib/deterministic-handle-path.ts +2 -0
- package/.pi/harnesses/lib/policy-roots.ts +142 -0
- package/.pi/harnesses/lib/system1/config-agentic.js +2 -1
- package/.pi/harnesses/lib/system1/config-file-discovery.js +21 -0
- package/.pi/harnesses/lib/system1/config-proactive.js +13 -2
- package/.pi/harnesses/lib/system1/config-v2.js +8 -5
- package/.versions/2.0.18/.pi/agent-fleet/hermes/README.md +347 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/.versions/2.0.18/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
- package/.versions/2.0.18/.pi/agent-fleet/hooks/coms-stop-hook.mjs +84 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/coms-claude-bridge.ts +437 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/coms-cli.ts +425 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +413 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/fleet-codex-client.ts +69 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/fleet-codex-read.py +148 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/fleet.ts +217 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/flow.ts +157 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +208 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/fleet-codex-catalog.ts +63 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/fleet-codex-operations.ts +190 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/fleet-codex-session.ts +166 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/fleet-codex-transport.ts +124 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/fleet-command.ts +252 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/flow-command.ts +98 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +230 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/team-project.ts +178 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/lib/team-snapshot.ts +147 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/package-lock.json +35 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/package.json +9 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/peer-launch.ts +283 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/team-snapshot.ts +237 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/team-up.ts +378 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +179 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/env.ts +34 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/git.ts +96 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +125 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +130 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +36 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/quality.ts +64 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/run.ts +108 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/trace.ts +34 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +112 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
- package/.versions/2.0.18/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
- package/.versions/2.0.18/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/2.0.18/.pi/agents/model-profiles.yaml +134 -0
- package/.versions/2.0.18/.pi/agents/peers.yaml +147 -0
- package/.versions/2.0.18/.pi/agents/teams.yaml +41 -0
- package/.versions/2.0.18/.pi/agents/voices.yaml +13 -0
- package/.versions/2.0.18/.pi/damage-control-rules.yaml +297 -0
- package/.versions/2.0.18/.pi/extensions/btw/README.md +120 -0
- package/.versions/2.0.18/.pi/extensions/btw/index.ts +914 -0
- package/.versions/2.0.18/.pi/extensions/btw/package.json +6 -0
- package/.versions/2.0.18/.pi/extensions/btw/state.js +179 -0
- package/.versions/2.0.18/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
- package/.versions/2.0.18/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
- package/.versions/2.0.18/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/2.0.18/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/2.0.18/.pi/extensions/compact-and-continue/index.ts +120 -0
- package/.versions/2.0.18/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/2.0.18/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/2.0.18/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/2.0.18/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/2.0.18/.pi/extensions/package-lock.json +1175 -0
- package/.versions/2.0.18/.pi/extensions/package.json +9 -0
- package/.versions/2.0.18/.pi/extensions/pi-voice-stt/README.md +224 -0
- package/.versions/2.0.18/.pi/extensions/pi-voice-stt/config.ts +198 -0
- package/.versions/2.0.18/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/2.0.18/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/2.0.18/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/2.0.18/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/2.0.18/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/README.md +1483 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/acceptance.ts +199 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/access-approval.ts +135 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/agentic-contract.ts +43 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/agentic-evidence.ts +64 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/agentic-hub.ts +54 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/agentic-runtime.ts +56 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/agentic-sources-worker.mjs +4 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/agentic-sources.ts +74 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/agentic-state.ts +23 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/artifacts.js +146 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/assertion-ledger.js +67 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/assist-profile.ts +16 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/backend-policy.js +174 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/budget-continuation.ts +13 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/budget-recovery.ts +214 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/capability-packs.ts +184 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/budget-continue.ts +10 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/context.ts +47 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/models.ts +10 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/recover.ts +61 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/task-triage-recover.ts +12 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/task-triage-waive.ts +12 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/config/agents.ts +178 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/config/model-profiles.ts +236 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/config/overrides.ts +165 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +221 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/context/budgets.ts +206 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/context-pressure.ts +191 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/context-window.js +108 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/debate-command.ts +176 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/delegate.ts +478 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/deterministic-fs.ts +169 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/dispatch-coms.ts +252 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/dispatch-native-complete.ts +173 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +270 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +233 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/dispatch-native-types.ts +267 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/dispatch-native.ts +234 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/dispatch-triage-contract.ts +27 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +77 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/dispatch-triage-policy.ts +29 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +55 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/dispatch-triage-state.ts +33 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/docs-lane.js +123 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/drift-watchdog.js +349 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/evidence-manifest.ts +51 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/execution-evidence.ts +80 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/external-blocker.js +85 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/file-discovery/adapters.ts +82 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/file-discovery/broker-client.ts +56 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/file-discovery/broker.ts +125 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/file-discovery/child-extension.ts +33 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/file-discovery/descendant.ts +63 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/file-discovery/discovery-worker.mjs +15 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/file-discovery/discovery.ts +126 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/file-discovery/evaluate.ts +48 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/file-discovery/hub.ts +152 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/file-discovery/native-context.ts +8 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/file-discovery/native-fixture.test-support.ts +99 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/file-discovery/owners.ts +96 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/file-discovery/results.ts +54 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/file-discovery/runtime.ts +120 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/file-discovery/sources.ts +69 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/file-discovery/state.ts +22 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/filesystem-tool.ts +185 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/fixtures/registration-surface.json +65 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/footer.ts +30 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/helpers.ts +270 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/hub-state-audit.js +65 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/index.ts +2625 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/input/completions.ts +82 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/input/shortcuts.ts +20 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +133 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +144 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +74 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/no-progress.ts +593 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/orchestration-activation.ts +112 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/orchestration-metrics.ts +78 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/orchestration-route.ts +76 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/policy/models.ts +153 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/policy/roster.ts +94 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/policy/work-mode.ts +137 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/poll-command.ts +176 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/presentation.ts +48 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/proactive-config.ts +21 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/proactive-external-git.ts +59 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/proactive-external.ts +77 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/proactive-local.ts +89 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/proactive-observer.ts +106 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/proactive-rules.ts +171 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/proactive-runtime.ts +318 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/proactive-snapshot.ts +258 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/proactive-types.ts +67 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/process-obligations.ts +158 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/prompts/context.ts +56 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/prompts/fragments.ts +95 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/prompts/system-prompt.ts +125 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/reconcile.ts +26 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/recover-policy.ts +44 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/recover-state.ts +104 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/recovery-contract.ts +150 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/rerun-policy.ts +40 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/research/controls.ts +74 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/research/runtime.ts +201 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/research/spawn-run.ts +194 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/return-contract.js +349 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/return-extract.js +77 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/review-closure.ts +43 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/review-findings.js +104 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/routing-observation.ts +41 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/routing-proposal.ts +46 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/run-budget.js +554 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/run-namespace.js +93 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/runtime-test-check.ts +54 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/scope-gate.js +144 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/session-audit.ts +313 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/session-start.ts +42 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/spawn.ts +563 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/system1-activity.ts +625 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/system1-communication-store.ts +190 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/system1-report.ts +275 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/system1-runtime.ts +258 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/task-resume-contract.ts +70 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/task-triage-authorization.ts +122 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/task-triage-config.ts +29 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/task-triage-contract.ts +14 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/task-triage-live-stage-boundary.mjs +49 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/task-triage-obligations.ts +104 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/task-triage-policy.ts +16 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/task-triage-review-contract.mjs +43 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/task-triage-reviewer-only-contract.mjs +156 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/task-triage-reviewer-only-diagnostics.mjs +112 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/task-triage-runtime.ts +125 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +21 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/task-triage-state.ts +46 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/timeline.ts +72 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +68 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/tool-catalog-state.ts +123 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/tools/action-executors.ts +213 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/tools/ask-system1-files.ts +15 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/tools/ask-system1.ts +25 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/tools/context.ts +144 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +88 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +560 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/tools/dispatch-triage.ts +16 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/tools/fleet-tools.ts +200 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/tools/herdr-executors.ts +95 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/tools/run-flow.ts +136 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/tools/spawn-research.ts +67 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/tools/verification-contract.ts +80 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/tsconfig.json +22 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/types.ts +66 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/ui/context-budget.ts +87 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/ui/detail-panel.ts +192 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +155 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/ui/fleet-source.ts +179 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/ui/grid.ts +159 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/ui/history.ts +234 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/ui/system1-communication.ts +59 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/version.ts +42 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/work-mode.ts +187 -0
- package/.versions/2.0.18/.pi/harnesses/agent-hub/write-isolation.ts +187 -0
- package/.versions/2.0.18/.pi/harnesses/ask-user-remote/README.md +59 -0
- package/.versions/2.0.18/.pi/harnesses/ask-user-remote/index.ts +558 -0
- package/.versions/2.0.18/.pi/harnesses/ask-user-remote/questions.ts +161 -0
- package/.versions/2.0.18/.pi/harnesses/ask-user-remote/race-core.js +124 -0
- package/.versions/2.0.18/.pi/harnesses/ask-user-remote/runtime-ask.ts +68 -0
- package/.versions/2.0.18/.pi/harnesses/coms/README.md +100 -0
- package/.versions/2.0.18/.pi/harnesses/coms/index.ts +282 -0
- package/.versions/2.0.18/.pi/harnesses/coms/package.json +7 -0
- package/.versions/2.0.18/.pi/harnesses/coms/version.ts +42 -0
- package/.versions/2.0.18/.pi/harnesses/damage-control-continue/README.md +135 -0
- package/.versions/2.0.18/.pi/harnesses/damage-control-continue/index.ts +533 -0
- package/.versions/2.0.18/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/2.0.18/.pi/harnesses/damage-control-continue/version.ts +42 -0
- package/.versions/2.0.18/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
- package/.versions/2.0.18/.pi/harnesses/lib/coms-core-io.ts +385 -0
- package/.versions/2.0.18/.pi/harnesses/lib/coms-core.ts +577 -0
- package/.versions/2.0.18/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
- package/.versions/2.0.18/.pi/harnesses/lib/context-budget-child-prompt.ts +220 -0
- package/.versions/2.0.18/.pi/harnesses/lib/context-budget-hub-prompt.ts +121 -0
- package/.versions/2.0.18/.pi/harnesses/lib/context-budget-view.ts +107 -0
- package/.versions/2.0.18/.pi/harnesses/lib/context-budget.ts +114 -0
- package/.versions/2.0.18/.pi/harnesses/lib/damage-control-shared.ts +226 -0
- package/.versions/2.0.18/.pi/harnesses/lib/deterministic-handle-path.ts +25 -0
- package/.versions/2.0.18/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
- package/.versions/2.0.18/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
- package/.versions/2.0.18/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
- package/.versions/2.0.18/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
- package/.versions/2.0.18/.pi/harnesses/lib/fleet-dashboard-view.ts +172 -0
- package/.versions/2.0.18/.pi/harnesses/lib/fleet-detail-view.ts +339 -0
- package/.versions/2.0.18/.pi/harnesses/lib/fleet-overlay.ts +26 -0
- package/.versions/2.0.18/.pi/harnesses/lib/fleet-panel.ts +34 -0
- package/.versions/2.0.18/.pi/harnesses/lib/fleet-read-model.ts +609 -0
- package/.versions/2.0.18/.pi/harnesses/lib/fleet-selection.ts +24 -0
- package/.versions/2.0.18/.pi/harnesses/lib/fleet-strip-controller.ts +75 -0
- package/.versions/2.0.18/.pi/harnesses/lib/fleet-strip-view.ts +179 -0
- package/.versions/2.0.18/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
- package/.versions/2.0.18/.pi/harnesses/lib/herdr-client.ts +472 -0
- package/.versions/2.0.18/.pi/harnesses/lib/herdr-presence.ts +399 -0
- package/.versions/2.0.18/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.versions/2.0.18/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/2.0.18/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
- package/.versions/2.0.18/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/2.0.18/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
- package/.versions/2.0.18/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
- package/.versions/2.0.18/.pi/harnesses/lib/policy-roots.ts +142 -0
- package/.versions/2.0.18/.pi/harnesses/lib/safe-source-read.js +29 -0
- package/.versions/2.0.18/.pi/harnesses/lib/spawned-peers.js +191 -0
- package/.versions/2.0.18/.pi/harnesses/lib/system1/config-agentic.js +15 -0
- package/.versions/2.0.18/.pi/harnesses/lib/system1/config-file-discovery.js +21 -0
- package/.versions/2.0.18/.pi/harnesses/lib/system1/config-json.js +37 -0
- package/.versions/2.0.18/.pi/harnesses/lib/system1/config-loader.js +44 -0
- package/.versions/2.0.18/.pi/harnesses/lib/system1/config-proactive.js +68 -0
- package/.versions/2.0.18/.pi/harnesses/lib/system1/config-triage.js +42 -0
- package/.versions/2.0.18/.pi/harnesses/lib/system1/config-v2.js +106 -0
- package/.versions/2.0.18/.pi/harnesses/lib/system1/config.js +50 -0
- package/.versions/2.0.18/.pi/harnesses/lib/system1/contracts.ts +154 -0
- package/.versions/2.0.18/.pi/harnesses/lib/system1/demo.ts +95 -0
- package/.versions/2.0.18/.pi/harnesses/lib/system1/jev.ts +503 -0
- package/.versions/2.0.18/.pi/harnesses/lib/system1/selection.js +11 -0
- package/.versions/2.0.18/.pi/harnesses/lib/system1/service.ts +245 -0
- package/.versions/2.0.18/.pi/harnesses/lib/update-check.ts +222 -0
- package/.versions/2.0.18/.pi/harnesses/package-lock.json +2039 -0
- package/.versions/2.0.18/.pi/harnesses/package.json +10 -0
- package/.versions/2.0.18/.pi/prompts/af-build.md +27 -0
- package/.versions/2.0.18/.pi/prompts/af-code-simplify.md +22 -0
- package/.versions/2.0.18/.pi/prompts/af-constraints.md +31 -0
- package/.versions/2.0.18/.pi/prompts/af-plan.md +17 -0
- package/.versions/2.0.18/.pi/prompts/af-review.md +16 -0
- package/.versions/2.0.18/.pi/prompts/af-set-hermes-telegram.md +15 -0
- package/.versions/2.0.18/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/2.0.18/.pi/prompts/af-setup-rules.md +20 -0
- package/.versions/2.0.18/.pi/prompts/af-ship.md +17 -0
- package/.versions/2.0.18/.pi/prompts/af-spec.md +15 -0
- package/.versions/2.0.18/.pi/prompts/af-test.md +19 -0
- package/.versions/2.0.18/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/2.0.18/.version +1 -0
- package/.versions/2.0.18/agents/architect.md +24 -0
- package/.versions/2.0.18/agents/bowser.md +28 -0
- package/.versions/2.0.18/agents/builder.md +55 -0
- package/.versions/2.0.18/agents/code-reviewer.md +209 -0
- package/.versions/2.0.18/agents/deep-researcher.md +32 -0
- package/.versions/2.0.18/agents/documenter.md +22 -0
- package/.versions/2.0.18/agents/orchestrator.md +22 -0
- package/.versions/2.0.18/agents/plan-reviewer.md +83 -0
- package/.versions/2.0.18/agents/planner.md +105 -0
- package/.versions/2.0.18/agents/releaser.md +24 -0
- package/.versions/2.0.18/agents/researcher.md +30 -0
- package/.versions/2.0.18/agents/security-auditor.md +167 -0
- package/.versions/2.0.18/agents/test-engineer.md +153 -0
- package/.versions/2.0.18/agents/web-debugger.md +44 -0
- package/.versions/2.0.18/agents/web-performance-auditor.md +194 -0
- package/.versions/2.0.18/bin/catalog/harness-runtime-closure.json +73 -0
- package/.versions/2.0.18/codex/fleet-session-client/SKILL.md +34 -0
- package/.versions/2.0.18/codex/fleet-session-client.zip +0 -0
- package/.versions/2.0.18/docs/ARCHITECTURE.md +874 -0
- package/.versions/2.0.18/docs/agent-fleet-setup.md +1101 -0
- package/.versions/2.0.18/docs/claude-code-coms-bridge.md +147 -0
- package/.versions/2.0.18/docs/codex-session-bridge.md +219 -0
- package/.versions/2.0.18/docs/coms-hermes-bridge.md +188 -0
- package/.versions/2.0.18/docs/getting-started.md +126 -0
- package/.versions/2.0.18/docs/npm-install.md +535 -0
- package/.versions/2.0.18/docs/pi-extensions.md +454 -0
- package/.versions/2.0.18/docs/pi-setup.md +92 -0
- package/.versions/2.0.18/docs/skill-anatomy.md +150 -0
- package/.versions/2.0.18/install-manifest.json +3193 -0
- package/.versions/2.0.18/justfile +247 -0
- package/.versions/2.0.18/manifest-meta.json +1071 -0
- package/.versions/2.0.18/references/accessibility-checklist.md +160 -0
- package/.versions/2.0.18/references/communication-contract.md +26 -0
- package/.versions/2.0.18/references/definition-of-done.md +67 -0
- package/.versions/2.0.18/references/fleet-coordination-patterns.md +171 -0
- package/.versions/2.0.18/references/observability-checklist.md +92 -0
- package/.versions/2.0.18/references/orchestration-patterns.md +370 -0
- package/.versions/2.0.18/references/performance-checklist.md +236 -0
- package/.versions/2.0.18/references/prompting-patterns.md +380 -0
- package/.versions/2.0.18/references/security-checklist.md +245 -0
- package/.versions/2.0.18/references/testing-patterns.md +235 -0
- package/.versions/2.0.18/references/workflow-authoring.md +304 -0
- package/.versions/2.0.18/skills/_internal/grilling.md +59 -0
- package/.versions/2.0.18/skills/browser-testing-with-devtools/SKILL.md +351 -0
- package/.versions/2.0.18/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.0.18/skills/compound-learning/SKILL.md +137 -0
- package/.versions/2.0.18/skills/constraint-driven-development/SKILL.md +338 -0
- package/.versions/2.0.18/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.0.18/skills/context-engineering/SKILL.md +341 -0
- package/.versions/2.0.18/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.0.18/skills/designing-agents/SKILL.md +394 -0
- package/.versions/2.0.18/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/2.0.18/skills/drafting-workflows/SKILL.md +143 -0
- package/.versions/2.0.18/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
- package/.versions/2.0.18/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.18/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/2.0.18/skills/idea-refine/SKILL.md +182 -0
- package/.versions/2.0.18/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.18/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.18/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.18/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.18/skills/incremental-implementation/SKILL.md +353 -0
- package/.versions/2.0.18/skills/interview-me/SKILL.md +226 -0
- package/.versions/2.0.18/skills/orchestration-verification/SKILL.md +182 -0
- package/.versions/2.0.18/skills/peer-coms/SKILL.md +90 -0
- package/.versions/2.0.18/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.0.18/skills/planning-and-task-breakdown/SKILL.md +318 -0
- package/.versions/2.0.18/skills/repository-ai-setup/SKILL.md +135 -0
- package/.versions/2.0.18/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
- package/.versions/2.0.18/skills/repository-ai-setup/references/apply-contract.md +74 -0
- package/.versions/2.0.18/skills/repository-ai-setup/references/provenance-template.md +16 -0
- package/.versions/2.0.18/skills/repository-ai-setup/references/setup-flow.md +108 -0
- package/.versions/2.0.18/skills/repository-ai-setup/references/verify-setup.md +20 -0
- package/.versions/2.0.18/skills/repository-ai-setup.zip +0 -0
- package/.versions/2.0.18/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.0.18/skills/spec-driven-development/SKILL.md +295 -0
- package/.versions/2.0.18/skills/using-agent-skills/SKILL.md +198 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/README.md +430 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
- package/.versions/2.0.18/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
- package/CHANGELOG.md +6 -0
- package/README.md +2 -2
- package/agents/architect.md +2 -2
- package/agents/bowser.md +1 -1
- package/agents/builder.md +5 -5
- package/agents/code-reviewer.md +2 -2
- package/agents/deep-researcher.md +2 -2
- package/agents/documenter.md +3 -3
- package/agents/orchestrator.md +2 -2
- package/agents/plan-reviewer.md +2 -2
- package/agents/planner.md +4 -4
- package/agents/releaser.md +2 -2
- package/agents/researcher.md +2 -2
- package/agents/security-auditor.md +2 -2
- package/agents/test-engineer.md +4 -4
- package/agents/web-debugger.md +2 -2
- package/agents/web-performance-auditor.md +2 -2
- package/bin/cli.js +2 -2
- package/bin/lib/external-content.js +33 -0
- package/bin/lib/project-provenance.js +19 -13
- package/bin/lib/transaction.js +32 -1
- package/docs/ARCHITECTURE.md +42 -2
- package/docs/agent-fleet-setup.md +4 -4
- package/docs/claude-code-coms-bridge.md +17 -4
- package/docs/external-project-ai-content.md +48 -0
- package/docs/npm-install.md +5 -0
- package/docs/system1-agentic.md +27 -0
- package/docs/system1-config.md +23 -1
- package/docs/system1-file-discovery.md +220 -0
- package/install-manifest.json +1 -1
- package/package.json +15 -6
- package/skills/repository-ai-setup/SKILL.md +18 -0
- package/skills/repository-ai-setup.zip +0 -0
|
@@ -282,21 +282,7 @@ async function main(): Promise<void> {
|
|
|
282
282
|
if (!item) return;
|
|
283
283
|
const env = item.envelope;
|
|
284
284
|
try {
|
|
285
|
-
|
|
286
|
-
await sendEnvelope(env.sender_endpoint, makeResponseEnvelope(id, env.msg_id, reply));
|
|
287
|
-
} catch (err) {
|
|
288
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
289
|
-
if (isReplyPendingError(err)) {
|
|
290
|
-
// No response envelope: the sender's wait expires as `pending`, and may
|
|
291
|
-
// await/get again without treating unfinished work as a failed result.
|
|
292
|
-
console.error(`coms-claude-bridge: ${env.msg_id} remains pending: ${message}`);
|
|
293
|
-
} else {
|
|
294
|
-
try {
|
|
295
|
-
await sendEnvelope(env.sender_endpoint, makeResponseEnvelope(id, env.msg_id, null, message));
|
|
296
|
-
} catch {
|
|
297
|
-
console.error(`coms-claude-bridge: could not deliver error for ${env.msg_id}: ${message}`);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
285
|
+
await respondToClaudePrompt(env, id, () => driveClaude(env, drivePorts), sendEnvelope);
|
|
300
286
|
} finally {
|
|
301
287
|
queue.done();
|
|
302
288
|
void reportPresence();
|
|
@@ -315,14 +301,65 @@ async function main(): Promise<void> {
|
|
|
315
301
|
}
|
|
316
302
|
}
|
|
317
303
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
304
|
+
const drivePorts: ClaudeDrivePorts = {
|
|
305
|
+
paneId, replyTimeoutMs, paneStatus,
|
|
306
|
+
hookSeen: () => hookSeen, markHookSeen: () => { hookSeen = true; },
|
|
307
|
+
readHook: () => {
|
|
308
|
+
try { return { mtime: fs.statSync(hookFile).mtimeMs, raw: fs.readFileSync(hookFile, "utf-8") }; }
|
|
309
|
+
catch { return null; }
|
|
310
|
+
},
|
|
311
|
+
readPane: async () => (await herdr.paneRead({ pane_id: paneId, source: "recent", lines: 200 })).read.text,
|
|
312
|
+
sendText: text => herdr.paneSendText(paneId, text),
|
|
313
|
+
sendEnter: () => herdr.paneSendKeys(paneId, ["enter"]), log: console.error,
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
// ── shutdown ──
|
|
317
|
+
let shuttingDown = false;
|
|
318
|
+
function shutdown(): void {
|
|
319
|
+
if (shuttingDown) return;
|
|
320
|
+
shuttingDown = true;
|
|
321
|
+
clearInterval(keepalive);
|
|
322
|
+
try { server.close(); } catch { /* ignore */ }
|
|
323
|
+
try { fs.unlinkSync(id.endpoint); } catch { /* ignore */ }
|
|
324
|
+
removeRegistryEntry(project, uniqueName);
|
|
325
|
+
process.exit(0);
|
|
326
|
+
}
|
|
327
|
+
process.on("SIGTERM", shutdown);
|
|
328
|
+
process.on("SIGINT", shutdown);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export interface ClaudeDrivePorts {
|
|
332
|
+
paneId: string; replyTimeoutMs: number;
|
|
333
|
+
hookSeen(): boolean; markHookSeen(): void;
|
|
334
|
+
readHook(): { mtime: number; raw: string } | null;
|
|
335
|
+
paneStatus(): Promise<string>; readPane(): Promise<string>;
|
|
336
|
+
sendText(text: string): Promise<unknown>; sendEnter(): Promise<unknown>;
|
|
337
|
+
now?(): number; sleep?(ms: number): Promise<void>; log?(text: string): void;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// The same emission path is used by the serial production pump and local tests.
|
|
341
|
+
export async function respondToClaudePrompt(env: PromptEnvelope, identity: SenderIdentity,
|
|
342
|
+
drive: () => Promise<string>, send: typeof sendEnvelope, log: (text: string) => void = console.error): Promise<void> {
|
|
343
|
+
try { await send(env.sender_endpoint, makeResponseEnvelope(identity, env.msg_id, await drive())); }
|
|
344
|
+
catch (err) {
|
|
345
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
346
|
+
if (isReplyPendingError(err)) log(`coms-claude-bridge: ${env.msg_id} remains pending: ${message}`);
|
|
347
|
+
else { try { await send(env.sender_endpoint, makeResponseEnvelope(identity, env.msg_id, null, message)); }
|
|
348
|
+
catch { log(`coms-claude-bridge: could not deliver error for ${env.msg_id}: ${message}`); } }
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export async function driveClaude(env: PromptEnvelope, d: ClaudeDrivePorts): Promise<string> {
|
|
353
|
+
const { paneId, replyTimeoutMs, paneStatus } = d;
|
|
354
|
+
const now = d.now ?? Date.now;
|
|
355
|
+
const sleep = d.sleep ?? (async (ms: number) => { await new Promise(r => setTimeout(r, ms)); });
|
|
356
|
+
const requestBoundary = `<<COMS_REQUEST:${env.msg_id}:${ulid()}>>`;
|
|
357
|
+
const sentinelMode = !d.hookSeen();
|
|
321
358
|
// The caller's declared deadline wins over the bridge default (clamped).
|
|
322
359
|
// One absolute deadline covers BOTH idle waiting and the reply; otherwise a
|
|
323
360
|
// two-minute busy wait silently extends the caller's budget.
|
|
324
361
|
const effectiveTimeoutMs = resolveReplyTimeoutMs(env.reply_timeout_ms, replyTimeoutMs);
|
|
325
|
-
const startedAt =
|
|
362
|
+
const startedAt = now();
|
|
326
363
|
const replyDeadline = replyDeadlineAt(startedAt, effectiveTimeoutMs);
|
|
327
364
|
|
|
328
365
|
// Claude Code must be idle-ish before we type into its input box — but a busy
|
|
@@ -332,19 +369,21 @@ async function main(): Promise<void> {
|
|
|
332
369
|
const waitStarted = startedAt;
|
|
333
370
|
for (let attempt = 0; ; attempt++) {
|
|
334
371
|
if (await paneStatus() !== "working") break;
|
|
335
|
-
const remaining = waitDeadline -
|
|
372
|
+
const remaining = waitDeadline - now();
|
|
336
373
|
if (remaining <= 0) {
|
|
337
374
|
throw new Error(
|
|
338
375
|
`Claude Code in pane ${paneId} is still mid-turn after waiting ` +
|
|
339
|
-
`${Math.round((
|
|
376
|
+
`${Math.round((now() - waitStarted) / 1000)}s — try again shortly`,
|
|
340
377
|
);
|
|
341
378
|
}
|
|
342
|
-
await
|
|
379
|
+
await sleep(Math.min(idleWaitDelayMs(attempt), remaining));
|
|
343
380
|
}
|
|
344
381
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
await
|
|
382
|
+
// Snapshot immediately before submission, not before a potentially long busy wait.
|
|
383
|
+
const hookMtimeBefore = d.readHook()?.mtime ?? 0;
|
|
384
|
+
await d.sendText(formatPanePrompt(env, sentinelMode, requestBoundary));
|
|
385
|
+
await sleep(ENTER_DELAY_MS);
|
|
386
|
+
await d.sendEnter();
|
|
348
387
|
|
|
349
388
|
// The sender's local await returns `pending` at replyDeadline, but the
|
|
350
389
|
// bridge keeps watching the already-running turn up to the hard cap so a
|
|
@@ -352,20 +391,21 @@ async function main(): Promise<void> {
|
|
|
352
391
|
const monitorDeadline = replyDeadlineAt(startedAt, REPLY_TIMEOUT_HARD_CAP_MS);
|
|
353
392
|
let pendingLogged = false;
|
|
354
393
|
let sawWorking = false;
|
|
355
|
-
while (
|
|
356
|
-
await
|
|
357
|
-
if (!pendingLogged &&
|
|
394
|
+
while (now() < monitorDeadline) {
|
|
395
|
+
await sleep(POLL_MS);
|
|
396
|
+
if (!pendingLogged && now() >= replyDeadline) {
|
|
358
397
|
pendingLogged = true;
|
|
359
|
-
|
|
398
|
+
d.log?.(`coms-claude-bridge: ${env.msg_id} exceeded its reply budget and remains pending`);
|
|
360
399
|
}
|
|
361
400
|
|
|
362
401
|
// primary: Stop hook wrote a new record
|
|
363
|
-
|
|
364
|
-
|
|
402
|
+
const hook = d.readHook();
|
|
403
|
+
if (hook) {
|
|
404
|
+
const mtime = hook.mtime;
|
|
365
405
|
if (mtime > hookMtimeBefore) {
|
|
366
|
-
const rec = parseHookRecord(
|
|
406
|
+
const rec = parseHookRecord(hook.raw);
|
|
367
407
|
if (rec) {
|
|
368
|
-
|
|
408
|
+
d.markHookSeen();
|
|
369
409
|
return rec.text;
|
|
370
410
|
}
|
|
371
411
|
}
|
|
@@ -380,8 +420,8 @@ async function main(): Promise<void> {
|
|
|
380
420
|
}
|
|
381
421
|
// fallback: turn ended without a hook record → scrape the sentinel
|
|
382
422
|
if (sentinelMode && sawWorking && (status === "done" || status === "idle")) {
|
|
383
|
-
const
|
|
384
|
-
const reply = extractSentinelReply(
|
|
423
|
+
const text = await d.readPane();
|
|
424
|
+
const reply = extractSentinelReply(text, env.msg_id, requestBoundary);
|
|
385
425
|
if (reply) return reply;
|
|
386
426
|
// sentinel not visible yet — keep polling until deadline
|
|
387
427
|
}
|
|
@@ -392,20 +432,6 @@ async function main(): Promise<void> {
|
|
|
392
432
|
);
|
|
393
433
|
}
|
|
394
434
|
|
|
395
|
-
// ── shutdown ──
|
|
396
|
-
let shuttingDown = false;
|
|
397
|
-
function shutdown(): void {
|
|
398
|
-
if (shuttingDown) return;
|
|
399
|
-
shuttingDown = true;
|
|
400
|
-
clearInterval(keepalive);
|
|
401
|
-
try { server.close(); } catch { /* ignore */ }
|
|
402
|
-
try { fs.unlinkSync(id.endpoint); } catch { /* ignore */ }
|
|
403
|
-
removeRegistryEntry(project, uniqueName);
|
|
404
|
-
process.exit(0);
|
|
405
|
-
}
|
|
406
|
-
process.on("SIGTERM", shutdown);
|
|
407
|
-
process.on("SIGINT", shutdown);
|
|
408
|
-
}
|
|
409
435
|
|
|
410
436
|
const isEntry = process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url);
|
|
411
437
|
if (isEntry) void main();
|
|
@@ -127,10 +127,11 @@ export function completionSentinel(msgId: string): string {
|
|
|
127
127
|
export function formatPanePrompt(
|
|
128
128
|
env: { prompt: string; sender_name: string; sender_cwd: string; msg_id: string },
|
|
129
129
|
sentinelMode: boolean,
|
|
130
|
+
requestBoundary?: string,
|
|
130
131
|
): string {
|
|
131
132
|
const header = `[coms message from ${env.sender_name} @ ${env.sender_cwd}] `;
|
|
132
133
|
const sentinelNote = sentinelMode
|
|
133
|
-
? `\n\nEnd your reply with this exact line so the bridge can capture it: ${completionSentinel(env.msg_id)}`
|
|
134
|
+
? `\n\nEnd your reply with this exact line so the bridge can capture it: ${completionSentinel(env.msg_id)}${requestBoundary ? ` ${requestBoundary}` : ""}`
|
|
134
135
|
: "";
|
|
135
136
|
return `${header}${env.prompt}${sentinelNote}`;
|
|
136
137
|
}
|
|
@@ -152,25 +153,22 @@ export function parseHookRecord(raw: string): HookRecord | null {
|
|
|
152
153
|
}
|
|
153
154
|
}
|
|
154
155
|
|
|
155
|
-
//
|
|
156
|
-
//
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
.map((l) => l.replace(/^[●❯>\s]+/, "").trimEnd())
|
|
172
|
-
.filter((l) => l.trim() !== "" && !/^[─━┏┗┃│]+/.test(l));
|
|
173
|
-
return lines.join("\n").trim() || null;
|
|
156
|
+
// Completion requires the unique boundary submitted for this request, not merely
|
|
157
|
+
// a matching marker in scrollback. Missing/truncated provenance stays pending.
|
|
158
|
+
export function extractSentinelReply(paneText: string, msgId: string, requestBoundary?: string): string | null {
|
|
159
|
+
if (!requestBoundary) return null;
|
|
160
|
+
const clean = paneText.replace(/\x1b\[[0-9;]*m/g, "");
|
|
161
|
+
const boundaryAt = clean.indexOf(requestBoundary);
|
|
162
|
+
if (boundaryAt < 0 || clean.indexOf(requestBoundary, boundaryAt + requestBoundary.length) >= 0) return null;
|
|
163
|
+
const region = clean.slice(boundaryAt + requestBoundary.length);
|
|
164
|
+
// Strip known Claude TUI prefixes, but preserve Markdown quote text (`>`).
|
|
165
|
+
const lines = region.split("\n").map(l => l.replace(/^[●❯\s]+/, "").trimEnd());
|
|
166
|
+
const sentinel = completionSentinel(msgId);
|
|
167
|
+
const end = lines.findIndex(l => l === sentinel);
|
|
168
|
+
if (end < 0 || lines.slice(end + 1).some(l => l.trim() && !/^[─━┏┗┃│]+/.test(l))) return null;
|
|
169
|
+
const reply = lines.slice(0, end).filter(l => l.trim() && !/^[─━┏┗┃│]+/.test(l));
|
|
170
|
+
if (reply.some(l => /<<COMS_(?:DONE|REQUEST):/.test(l)) || !reply.length) return null;
|
|
171
|
+
return reply.join("\n").trim() || null;
|
|
174
172
|
}
|
|
175
173
|
|
|
176
174
|
// ━━ Serial prompt queue ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
+
import { resolvePolicyReferences, resolvePolicyRoots } from "../../../../harnesses/lib/policy-roots.ts";
|
|
3
4
|
|
|
4
5
|
/** Workflow-side reader of the Hub's `## agent-hub` / `## agent-team` rules and docs contract. */
|
|
5
6
|
export function readProjectPolicy(cwd: string): { rulesPaths: string[]; docsPaths: string[] } {
|
|
@@ -30,5 +31,6 @@ export function resolveProjectPolicy(cwd: string, options: { rulesPaths?: string
|
|
|
30
31
|
const docsPaths = [...new Set([...configured.docsPaths, ...(options.docsPaths ?? [])])];
|
|
31
32
|
for (const path of rulesPaths) if (!existsSync(join(cwd, path))) warn(`agent-fleet-overrides: rules folder "${path}" not found in ${cwd}`);
|
|
32
33
|
for (const path of docsPaths) if (!existsSync(join(cwd, path))) warn(`agent-fleet-overrides: docs entry point "${path}" not found in ${cwd}`);
|
|
33
|
-
|
|
34
|
+
const roots=resolvePolicyRoots(cwd,{rulesDirs:rulesPaths,docsPaths});
|
|
35
|
+
return { rulesPaths:resolvePolicyReferences(roots,rulesPaths,"rules"), docsPaths:resolvePolicyReferences(roots,docsPaths,"docs") };
|
|
34
36
|
}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
# See docs/agent-fleet-setup.md for defaults, child roles, services and policies.
|
|
3
3
|
mix-max:
|
|
4
4
|
code-reviewer: xai/grok-4.7
|
|
5
|
-
builder: openai-codex/gpt-6-sol
|
|
5
|
+
builder: openai-codex/gpt-6.1-sol
|
|
6
6
|
planner: openai-codex/gpt-6-astra
|
|
7
7
|
plan-reviewer: xai/grok-4.7
|
|
8
|
-
security-auditor: openai-codex/gpt-6-sol
|
|
8
|
+
security-auditor: openai-codex/gpt-6.1-sol
|
|
9
9
|
test-engineer: xai/grok-4.7
|
|
10
10
|
local-workers:
|
|
11
11
|
version: 2
|
|
12
12
|
defaults:
|
|
13
|
-
model: &qwenWorkers
|
|
13
|
+
model: &qwenWorkers incoai/Qwen3.8-27B-Splash
|
|
14
14
|
thinking: off
|
|
15
15
|
allowed-models:
|
|
16
16
|
- *qwenWorkers
|
|
@@ -69,11 +69,11 @@ local-workers:
|
|
|
69
69
|
model: *qwenWorkers
|
|
70
70
|
integrator: true
|
|
71
71
|
|
|
72
|
-
# Single-model local profile. Every role and service uses
|
|
72
|
+
# Single-model local profile. Every role and service uses incoai/Qwen3.8-27B-Splash.
|
|
73
73
|
local-full:
|
|
74
74
|
version: 2
|
|
75
75
|
defaults:
|
|
76
|
-
model: &qwen36
|
|
76
|
+
model: &qwen36 incoai/Qwen3.8-27B-Splash
|
|
77
77
|
thinking: off
|
|
78
78
|
allowed-models:
|
|
79
79
|
- *qwen36
|
package/.pi/agents/peers.yaml
CHANGED
|
@@ -89,7 +89,7 @@ debug:
|
|
|
89
89
|
frontend:
|
|
90
90
|
- name: planner
|
|
91
91
|
persona: planner
|
|
92
|
-
model: openai-codex/gpt-6-sol
|
|
92
|
+
model: openai-codex/gpt-6.1-sol
|
|
93
93
|
- name: builder
|
|
94
94
|
persona: builder
|
|
95
95
|
model: openai-codex/gpt-6-luna
|
|
@@ -102,7 +102,7 @@ frontend:
|
|
|
102
102
|
security:
|
|
103
103
|
- name: security-auditor
|
|
104
104
|
persona: security-auditor
|
|
105
|
-
model: openai-codex/gpt-6-sol
|
|
105
|
+
model: openai-codex/gpt-6.1-sol
|
|
106
106
|
- name: builder
|
|
107
107
|
persona: builder
|
|
108
108
|
model: openai-codex/gpt-6-luna
|
|
@@ -130,7 +130,7 @@ release:
|
|
|
130
130
|
info:
|
|
131
131
|
- name: documenter
|
|
132
132
|
persona: documenter
|
|
133
|
-
model: openai-codex/gpt-
|
|
133
|
+
model: openai-codex/gpt-6-luna
|
|
134
134
|
- name: code-reviewer
|
|
135
135
|
runner: claude-code
|
|
136
136
|
|
package/.pi/agents/voices.yaml
CHANGED
|
@@ -435,26 +435,26 @@ Every borrowed idea from another harness passes one test before it lands: *does
|
|
|
435
435
|
`.ai/agent-fleet-overrides.md` replace individual sub-roles / the depth budget. An overridden
|
|
436
436
|
role retains its frontmatter model as a one-shot fallback under the same pre-work-only safety
|
|
437
437
|
rule; delegate cards and results show the model that ultimately ran. Six personas ship with
|
|
438
|
-
declared sub-roles, on a three-tier OpenAI model ladder — `gpt-
|
|
438
|
+
declared sub-roles, on a three-tier OpenAI model ladder — `gpt-6-luna` for
|
|
439
439
|
recon/grep sweeps, `gpt-5.4` for analysis sweeps, the `gpt-5.5` (or opus) parent reserved for
|
|
440
440
|
synthesis and verdicts:
|
|
441
|
-
- `code-reviewer` — `preflight`+`docs` (
|
|
441
|
+
- `code-reviewer` — `preflight`+`docs` (gpt-6-luna), `quality`+`perf` (gpt-5.4); its first delegate
|
|
442
442
|
call is always `preflight`, which studies the project rules and the files under review and
|
|
443
443
|
returns a summary that drives the rest of the fan-out. Deep security review is not a
|
|
444
444
|
sub-role — it belongs to the separate `security-auditor` persona, which the reviewer
|
|
445
445
|
recommends dispatching when it spots deeper risk.
|
|
446
|
-
- `planner` — `scout`+`rules` (
|
|
446
|
+
- `planner` — `scout`+`rules` (gpt-6-luna) fan out before the plan is drafted; `risk` (gpt-5.4)
|
|
447
447
|
optionally challenges the draft breakdown.
|
|
448
448
|
- `plan-reviewer` — `feasibility` (gpt-5.4) checks plan claims against the actual codebase;
|
|
449
|
-
`deps` (
|
|
449
|
+
`deps` (gpt-6-luna) verifies dependency ordering and file overlap. No preflight — the plan is
|
|
450
450
|
the map.
|
|
451
|
-
- `security-auditor` — solo `recon` (
|
|
452
|
-
`input-sweep` (gpt-5.4) and `secrets-sweep` (
|
|
451
|
+
- `security-auditor` — solo `recon` (gpt-6-luna) maps the attack surface first, then
|
|
452
|
+
`input-sweep` (gpt-5.4) and `secrets-sweep` (gpt-6-luna) fan out; exploit reasoning stays with
|
|
453
453
|
the parent.
|
|
454
|
-
- `builder` — `recon` (
|
|
454
|
+
- `builder` — `recon` (gpt-6-luna) maps call sites before edits; `verifier` (gpt-6-luna, the one
|
|
455
455
|
`allow_write: true` child) runs the test suite after them. Implementation is never
|
|
456
456
|
delegated.
|
|
457
|
-
- `test-engineer` — `coverage-scout`+`conventions` (
|
|
457
|
+
- `test-engineer` — `coverage-scout`+`conventions` (gpt-6-luna) inventory gaps and test patterns;
|
|
458
458
|
test writing is never delegated.
|
|
459
459
|
- **Default damage-control guardrails** — `just fleet` and `just fleet --no-coms` load the
|
|
460
460
|
`damage-control-continue` harness before `agent-hub`, so dispatcher tool calls are checked against
|
|
@@ -1166,6 +1166,29 @@ Semantics:
|
|
|
1166
1166
|
Missing file = everything native. HOW a peer runs (persona, model, `runner: claude-code`, env) stays
|
|
1167
1167
|
in `peers.yaml`; this file only decides WHEN the hub prefers a peer over a native spawn.
|
|
1168
1168
|
|
|
1169
|
+
### Planner recovery and completion evidence
|
|
1170
|
+
|
|
1171
|
+
An open plan obligation requires `dispatch_agent` with the planner persona, declared
|
|
1172
|
+
scope/deliverable and the applicable backend policy. Direct `coms_send` has no planner
|
|
1173
|
+
dispatch contract: a peer named planner, prompt claims, work-mode changes or repeated
|
|
1174
|
+
attempts do not bypass the gate. The refusal occurs before target resolution/send and
|
|
1175
|
+
preserves handoff tokens. If planner is absent, the human can use `/af-agents-add planner`
|
|
1176
|
+
or `/af-agents-team`; do not reset the task, downgrade its tier or invent an alternate lane.
|
|
1177
|
+
Read-only `coms_list`, `coms_get` and `coms_await` can inspect an existing pending message
|
|
1178
|
+
without resending it.
|
|
1179
|
+
|
|
1180
|
+
A current declared plan artifact readback proves plan occurrence only. Exit 0, echoed
|
|
1181
|
+
instructions, `PLAN_FILE` text without the declared file, or a pending reply do not close
|
|
1182
|
+
that deliverable contract. Plan, acceptance and review remain independent; verification
|
|
1183
|
+
and review must cover the current revision. Coms transport cannot produce trusted native
|
|
1184
|
+
runtime checks, even when a valid peer reply and declared deliverable are available.
|
|
1185
|
+
|
|
1186
|
+
Malformed `dispatch_agent`/`spawn_research` input returns `invalid_invocation_shape` with
|
|
1187
|
+
bounded safe field/type diagnostics, separately from `invocation_persistence_failed`
|
|
1188
|
+
for valid input whose durable contract could not be stored. Neither launches the executor;
|
|
1189
|
+
correct the reported input or storage prerequisite and re-invoke explicitly under existing
|
|
1190
|
+
gates. Diagnostics omit raw values/private payloads and redact unsafe unknown-key locations.
|
|
1191
|
+
|
|
1169
1192
|
### Handoff
|
|
1170
1193
|
|
|
1171
1194
|
`/af-handoff <peer>` transfers the session to another **main** agent. Following the plan's
|
|
@@ -1451,6 +1474,10 @@ privacy boundaries, evaluation commands and outstanding live acceptance.
|
|
|
1451
1474
|
|
|
1452
1475
|
The runtime source is `.ai/system1.json` version 2 with independent consumer sections, one immutable session snapshot and a shared service. Installation selection remains separate. See [the unified configuration contract](../../../docs/system1-config.md) for setup, explicit migration, retained backups, diagnostics and remote/local off semantics. Legacy JSON files and `watchdog-system1` in Markdown are not runtime sources. v1 requires explicit migration and cannot start inference. Persisted Task Triage obligations remain enforced when inference is off or unavailable. D10 is not activated by this change.
|
|
1453
1476
|
|
|
1477
|
+
## Automatic System 1 file discovery
|
|
1478
|
+
|
|
1479
|
+
D9 `consumers.fileDiscovery` is separately consented and off by default. In both work modes/all tiers it ranks eligible parent inventory/find/ls/grep before delivery, plus initial/current native research/worker and registered nested delegate discoveries. Every display-permitted candidate remains (low/unscored included); large lists use bounded pages and normal read budgets, never top-K. Scope is a hint, not permission; mandatory policy, original failures and launch/acceptance gates survive. Fleet `1` opt-in diagnostics show only hashed identity, trigger/counts/coverage/elapsed and actual-or-unknown usage, not queries/bodies/paths/tokens. Start a new session after config changes. See [D9 scope, full-list/status/privacy limits and source/local-tarball activation instructions](../../../docs/system1-file-discovery.md); published latest is not assumed to contain this checkout's D9.
|
|
1480
|
+
|
|
1454
1481
|
## Agentic System 1 advisory tool
|
|
1455
1482
|
|
|
1456
1483
|
`ask_system1` is an opt-in parent-only Hub consumer configured by `consumers.agenticAsk` in the shared `.ai/system1.json`. It batches typed questions over minimal state, selected files/ranges and opted-in recorded bash refs, without executing shell or changing process gates. `recommended` makes it the first route for suitable semantic judgments across all task tiers; `advisory` keeps optional consultation. Default installs remain off. Start a new Hub session after changing the mode. See [configuration, examples, bounds and safe readback](../../../docs/system1-agentic.md).
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import {createHash} from 'node:crypto';
|
|
2
|
+
import {execFile} from 'node:child_process';
|
|
3
|
+
import {promisify} from 'node:util';
|
|
4
|
+
import {GIT_TRACKED_INCLUDE} from '../lib/system1/config-agentic.js';
|
|
2
5
|
import {Worker} from 'node:worker_threads';
|
|
3
6
|
import {resolve} from 'node:path';
|
|
4
7
|
import {realpathSync} from 'node:fs';
|
|
@@ -8,11 +11,26 @@ import type {AgenticConfig,AgenticInput,SourceSummary} from './agentic-contract.
|
|
|
8
11
|
import type {AgenticSources} from './agentic-runtime.ts';
|
|
9
12
|
export const sourceHash=(v:string|Buffer)=>createHash('sha256').update(v).digest('hex');
|
|
10
13
|
const forbidden=/^(?:\.env(?:\..*)?|\.git|\.ssh|\.aws|\.npmrc|\.netrc|credentials?(?:\..*)?|secrets?(?:\..*)?|id_(?:rsa|ed25519)|.*\.(?:pem|key|p12|pfx|sqlite|db))$/i;
|
|
11
|
-
|
|
14
|
+
// Git membership is supplied only by agenticAsk's guarded collector. Other consumers
|
|
15
|
+
// retain prefix-only behavior and cannot turn this selector into blanket approval.
|
|
16
|
+
export function exportPathAllowed(path:string,include:readonly string[],gitTracked=false):boolean {
|
|
12
17
|
if(!path||path.startsWith('/')||/[\\\0*?]/.test(path)||path.split('/').some(p=>!p||p==='.'||p==='..'||forbidden.test(p)))return false;
|
|
13
18
|
if(/(?:^|\/)(?:agent-sessions|sessions?|transcripts?|artifacts|node_modules|\.cache)(?:\/|$)/i.test(path))return false;
|
|
14
19
|
if(path.startsWith('.ai/')||/^\.pi\/(?:coms|logs|state|runtime|agent-fleet-state)(?:\/|$)/.test(path))return false;
|
|
15
|
-
return include.some(p=>{const prefix=p.replace(/\/$/,'');return path===prefix||path.startsWith(prefix+'/');});
|
|
20
|
+
return include.some(p=>{if(p===GIT_TRACKED_INCLUDE)return gitTracked;const prefix=p.replace(/\/$/,'');return path===prefix||path.startsWith(prefix+'/');});
|
|
21
|
+
}
|
|
22
|
+
const runGit=promisify(execFile);
|
|
23
|
+
async function trackedPaths(root:string,paths:string[],signal:AbortSignal,deadlineMs:number):Promise<Set<string>> {
|
|
24
|
+
// Never inherit Git repository/index overrides from the Hub process. Literal
|
|
25
|
+
// pathspecs avoid treating file names as options or wildcard/magic expressions.
|
|
26
|
+
const env=Object.fromEntries(Object.entries(process.env).filter(([key])=>!key.startsWith('GIT_')));
|
|
27
|
+
const options={cwd:root,env:{...env,GIT_OPTIONAL_LOCKS:'0',GIT_TERMINAL_PROMPT:'0'},encoding:'utf8' as const,signal,timeout:deadlineMs,maxBuffer:65536};
|
|
28
|
+
try {
|
|
29
|
+
const prefix=await runGit('git',['rev-parse','--show-prefix'],options);
|
|
30
|
+
if(prefix.stdout!=='\n')throw Error('source_denied'); // Scope is this repo root, not an enclosing repo.
|
|
31
|
+
const result=await runGit('git',['--literal-pathspecs','ls-files','--cached','--full-name','-z','--',...paths],options);
|
|
32
|
+
return new Set(result.stdout.split('\0').filter(Boolean));
|
|
33
|
+
}catch{throw Error(signal.aborted?'cancelled':'source_denied');}
|
|
16
34
|
}
|
|
17
35
|
export function readSourcesWorker(root:string,paths:string[],maxBytes:number,signal:AbortSignal,deadlineMs:number):Promise<Buffer[]> {
|
|
18
36
|
if(signal.aborted)return Promise.reject(Error('cancelled'));
|
|
@@ -29,9 +47,15 @@ export function readSourcesWorker(root:string,paths:string[],maxBytes:number,sig
|
|
|
29
47
|
}
|
|
30
48
|
export function createAgenticSources(options:{root:string;config:AgenticConfig;canRead(path:string):boolean;read?:typeof readSourcesWorker;resolveEvidence?(refs:string[],signal:AbortSignal):Promise<AgenticSources>}) {
|
|
31
49
|
const root=realpathSync(options.root),read=options.read??readSourcesWorker;
|
|
32
|
-
const approved=(
|
|
50
|
+
const approved=async(selections:NonNullable<AgenticInput['paths']>,signal:AbortSignal)=>{
|
|
51
|
+
const gitScope=options.config.include.includes(GIT_TRACKED_INCLUDE);
|
|
52
|
+
const paths=selections.map(({path})=>{if(!exportPathAllowed(path,options.config.include,gitScope))throw Error('source_denied');const full=resolve(root,path);if(!options.canRead(full))throw Error('source_denied');checkedSourcePath(root,full);return full;});
|
|
53
|
+
const requireGit=selections.filter(p=>!exportPathAllowed(p.path,options.config.include)).map(p=>p.path);
|
|
54
|
+
if(requireGit.length){const tracked=await trackedPaths(root,requireGit,signal,options.config.limits.collectionMs);if(requireGit.some(path=>!tracked.has(path)))throw Error('source_denied');}
|
|
55
|
+
return paths;
|
|
56
|
+
};
|
|
33
57
|
return async(input:AgenticInput,signal:AbortSignal):Promise<AgenticSources>=>{
|
|
34
|
-
const selections=input.paths??[],paths=
|
|
58
|
+
const selections=input.paths??[],paths=await approved(selections,signal);
|
|
35
59
|
const bytes=paths.length?await read(root,paths,options.config.limits.maxSourceBytes,signal,options.config.limits.collectionMs):[];
|
|
36
60
|
const sources=bytes.map((b,index)=>{
|
|
37
61
|
if(containsCommunicationSecret(b.toString('utf8')))throw Error('source_denied');
|
|
@@ -44,7 +68,7 @@ export function createAgenticSources(options:{root:string;config:AgenticConfig;c
|
|
|
44
68
|
});
|
|
45
69
|
const evidence=input.evidenceRefs?.length?options.resolveEvidence?await options.resolveEvidence(input.evidenceRefs,signal):(()=>{throw Error('evidence_unavailable');})():{sources:[],current:async()=>true};
|
|
46
70
|
return {sources:[...sources,...evidence.sources],async current(){
|
|
47
|
-
try{const currentPaths=
|
|
71
|
+
try{const currentPaths=await approved(selections,signal);const current=currentPaths.length?await read(root,currentPaths,options.config.limits.maxSourceBytes,signal,options.config.limits.collectionMs):[];return current.every((b,i)=>sourceHash(b)===sources[i].summary.hash)&&await evidence.current();}catch{return false;}
|
|
48
72
|
}};
|
|
49
73
|
};
|
|
50
74
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
+
import { resolvePolicyRoots, type PolicyRootTable } from "../../lib/policy-roots.ts";
|
|
3
4
|
import { clampDelegateDepth, MAX_DELEGATE_DEPTH } from "../helpers.ts";
|
|
4
5
|
import { DEFAULT_RUN_HISTORY_KEEP, normalizeRunHistoryKeep } from "../run-namespace.js";
|
|
5
6
|
import { DEFAULT_WATCHDOG_SETTING, WATCHDOG_SETTINGS, normalizeWatchdogSetting } from "../drift-watchdog.js";
|
|
@@ -25,6 +26,7 @@ export interface AgentTeamOverrides {
|
|
|
25
26
|
personaDelegateDepth: Record<string, number>;
|
|
26
27
|
rulesDirs: string[];
|
|
27
28
|
docsPaths: string[];
|
|
29
|
+
policyRoots?: PolicyRootTable;
|
|
28
30
|
reconSearchTimeoutMs: number | null;
|
|
29
31
|
budgetOverrides: { maxDispatches?: number | null; maxResearch?: number | null; wallMs?: number | null; agentTurnMs?: number | null; recycleRuns?: number | null };
|
|
30
32
|
watchdogSetting: string;
|
|
@@ -64,11 +66,19 @@ function parseSubagentOverride(value: string): { model: string; tools?: string;
|
|
|
64
66
|
return result;
|
|
65
67
|
}
|
|
66
68
|
|
|
69
|
+
function resolveOverridesPolicy(cwd: string, overrides: AgentTeamOverrides): AgentTeamOverrides {
|
|
70
|
+
overrides.policyRoots = resolvePolicyRoots(cwd, overrides);
|
|
71
|
+
for (const diagnostic of overrides.policyRoots.diagnostics) {
|
|
72
|
+
overrides.warnings.push(`policy roots: ${diagnostic.message} — check rules/docs paths relative to the checkout; grants do not authorize writes or remote capture`);
|
|
73
|
+
}
|
|
74
|
+
return overrides;
|
|
75
|
+
}
|
|
76
|
+
|
|
67
77
|
export function parseAgentTeamOverrides(cwd: string): AgentTeamOverrides {
|
|
68
78
|
const file = join(cwd, ".ai", "agent-fleet-overrides.md");
|
|
69
|
-
if (!existsSync(file)) return freshOverrides();
|
|
79
|
+
if (!existsSync(file)) return resolveOverridesPolicy(cwd, freshOverrides());
|
|
70
80
|
let raw: string;
|
|
71
|
-
try { raw = readFileSync(file, "utf-8"); } catch { return freshOverrides(); }
|
|
81
|
+
try { raw = readFileSync(file, "utf-8"); } catch { return resolveOverridesPolicy(cwd, freshOverrides()); }
|
|
72
82
|
const result = freshOverrides();
|
|
73
83
|
let inSection = false;
|
|
74
84
|
for (const rawLine of raw.split("\n")) {
|
|
@@ -151,5 +161,5 @@ export function parseAgentTeamOverrides(cwd: string): AgentTeamOverrides {
|
|
|
151
161
|
}
|
|
152
162
|
}
|
|
153
163
|
}
|
|
154
|
-
return result;
|
|
164
|
+
return resolveOverridesPolicy(cwd, result);
|
|
155
165
|
}
|
|
@@ -38,7 +38,8 @@ import { FILESYSTEM_SESSION_DIR_ENV } from "./filesystem-tool.ts";
|
|
|
38
38
|
import { Type } from "@sinclair/typebox";
|
|
39
39
|
import { appendFileSync, mkdirSync, writeFileSync } from "fs";
|
|
40
40
|
import type { ChildProcess } from "child_process";
|
|
41
|
-
import {
|
|
41
|
+
import { killPiTree } from "./spawn.ts";
|
|
42
|
+
import { spawnDiscoveryDescendant } from "./file-discovery/descendant.ts";
|
|
42
43
|
import { redactSecrets } from "../lib/fleet-transcript-store.ts";
|
|
43
44
|
import { buildProjectDocsProtocol, buildProjectRulesProtocol } from "../lib/context-budget-child-prompt.ts";
|
|
44
45
|
import { DEFAULT_PROVIDER_LIMITS, createProviderSemaphore, parseProviderLimits } from "./provider-semaphore.js";
|
|
@@ -163,9 +164,14 @@ export default function (pi: ExtensionAPI) {
|
|
|
163
164
|
// Fallback cascade: the primary kill path is the process group (the hub
|
|
164
165
|
// signals the specialist's negative PID), but if only this process is
|
|
165
166
|
// terminated, forward the signal to any live children.
|
|
166
|
-
|
|
167
|
+
const treeController = new AbortController();
|
|
168
|
+
const cancelTree = () => {
|
|
169
|
+
treeController.abort();
|
|
167
170
|
for (const child of liveChildren) killPiTree(child, "SIGTERM");
|
|
168
|
-
}
|
|
171
|
+
};
|
|
172
|
+
process.on("SIGTERM", cancelTree);
|
|
173
|
+
pi.on?.("session_shutdown", cancelTree);
|
|
174
|
+
pi.on?.("session_before_switch", cancelTree);
|
|
169
175
|
|
|
170
176
|
const redactValue = (value: unknown): unknown => {
|
|
171
177
|
if (typeof value === "string") return redactSecrets(value);
|
|
@@ -250,6 +256,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
250
256
|
details: { status: "refused", reason: "tools_unavailable" },
|
|
251
257
|
};
|
|
252
258
|
}
|
|
259
|
+
const signal = _signal ? AbortSignal.any([_signal, treeController.signal]) : treeController.signal;
|
|
260
|
+
if (signal.aborted) return { content: [{ type: "text" as const, text: "Delegation cancelled before launch." }], details: { status: "cancelled" } };
|
|
253
261
|
const effectiveTools = tools.effectiveTools;
|
|
254
262
|
const writeDowngraded = tools.writeDowngraded;
|
|
255
263
|
|
|
@@ -344,7 +352,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
344
352
|
}
|
|
345
353
|
res = await providerSemaphore.run(roleDef.model, () => {
|
|
346
354
|
queuedMs = Date.now() - startTime;
|
|
347
|
-
return
|
|
355
|
+
return spawnDiscoveryDescendant({
|
|
348
356
|
model: roleDef.model,
|
|
349
357
|
tools: childTools,
|
|
350
358
|
thinking: roleDef.thinking ?? "off",
|
|
@@ -362,7 +370,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
362
370
|
// Each nested child owns its group. The SIGTERM trap above forwards
|
|
363
371
|
// parent cancellation so detached children cannot become orphans.
|
|
364
372
|
detached: true,
|
|
365
|
-
signal
|
|
373
|
+
signal,
|
|
366
374
|
// `null` is the explicit `off` override; preserve it rather than
|
|
367
375
|
// silently restoring the default for terminal children.
|
|
368
376
|
toolWatchdog: { timeoutMs: config.reconSearchTimeoutMs === undefined ? 120_000 : config.reconSearchTimeoutMs },
|
|
@@ -405,6 +413,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
405
413
|
// carries `delegate` in its tool list and so reads as non-read-only
|
|
406
414
|
// here — deliberately: retrying it would re-spawn its grandchildren.
|
|
407
415
|
midRun: isReadOnlyToolList(childTools),
|
|
416
|
+
}, {
|
|
417
|
+
childId, task: instruction, query: JSON.stringify([instruction, brief ?? ""]),
|
|
418
|
+
admit: () => !signal.aborted && config.roles[roleKey] === roleDef && config.depth > childDepth,
|
|
408
419
|
});
|
|
409
420
|
});
|
|
410
421
|
} finally {
|
|
@@ -70,11 +70,14 @@ function fileState(path: string, allowedRoot?: string) {
|
|
|
70
70
|
if (!existsSync(checked) || !statSync(checked).isFile()) throw new Error(`Not a regular file: ${path}`);
|
|
71
71
|
return { path: checked, ...hashAndSize(checked) };
|
|
72
72
|
}
|
|
73
|
-
function directoryState(root: string) {
|
|
73
|
+
function directoryState(root: string, authorizePath?: (path: string) => void) {
|
|
74
74
|
const checked = checkedExisting(root, root);
|
|
75
75
|
if (!statSync(checked).isDirectory()) throw new Error(`Not a directory: ${root}`);
|
|
76
76
|
const rootReal = realpathSync(checked);
|
|
77
|
-
const entries = readdirSync(checked, { withFileTypes: true }).
|
|
77
|
+
const entries = readdirSync(checked, { withFileTypes: true }).filter(entry => {
|
|
78
|
+
if (!authorizePath) return true;
|
|
79
|
+
try { authorizePath(join(checked, entry.name)); return true; } catch { return false; }
|
|
80
|
+
}).sort((a, b) => a.name.localeCompare(b.name)).map(entry => {
|
|
78
81
|
const path = join(checked, entry.name), lst = lstatSync(path);
|
|
79
82
|
if (lst.isSymbolicLink()) {
|
|
80
83
|
try {
|
|
@@ -90,9 +93,9 @@ function directoryState(root: string) {
|
|
|
90
93
|
function utf8Preview(bytes: Buffer, chars = PREVIEW_CHARS): string {
|
|
91
94
|
return [...bytes.toString("utf8")].slice(0, chars).join("");
|
|
92
95
|
}
|
|
93
|
-
export function inventory(input: { root: string; handle?: string; pageSize?: number; boundedOutput?: boolean; followSymlinkEscape?: boolean }) {
|
|
96
|
+
export function inventory(input: { root: string; handle?: string; pageSize?: number; boundedOutput?: boolean; followSymlinkEscape?: boolean; authorizePath?: (path: string) => void }) {
|
|
94
97
|
if (input.followSymlinkEscape) throw new Error("Symlink escape following is forbidden");
|
|
95
|
-
const state = directoryState(input.root);
|
|
98
|
+
const state = directoryState(input.root, input.authorizePath);
|
|
96
99
|
let offset = 0;
|
|
97
100
|
if (input.handle) {
|
|
98
101
|
const handle = decode(input.handle);
|