@chankov/agent-fleet 0.0.8 → 0.0.10
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/.claude/commands/doctor-agent-fleet.md +12 -7
- package/.claude/commands/setup-agent-fleet.md +7 -15
- package/.opencode/commands/af-doctor-agent-fleet.md +12 -7
- package/.opencode/commands/af-setup-agent-fleet.md +8 -6
- package/.pi/agents/model-profiles.yaml +9 -2
- package/.pi/agents/peers.yaml +12 -16
- package/.pi/agents/teams.yaml +4 -2
- package/.pi/extensions/agent-fleet-update-check/README.md +2 -3
- package/.pi/extensions/btw/README.md +2 -2
- package/.pi/extensions/chrome-devtools-mcp/README.md +3 -6
- package/.pi/extensions/compact-and-continue/README.md +3 -3
- package/.pi/extensions/mcp-bridge/README.md +1 -1
- package/.pi/harnesses/agent-hub/README.md +159 -15
- package/.pi/harnesses/agent-hub/docs-lane.js +122 -0
- package/.pi/harnesses/agent-hub/external-blocker.js +85 -0
- package/.pi/harnesses/agent-hub/footer.ts +4 -2
- package/.pi/harnesses/agent-hub/index.ts +552 -50
- package/.pi/harnesses/agent-hub/package.json +1 -1
- package/.pi/harnesses/agent-hub/review-findings.js +102 -0
- package/.pi/harnesses/agent-hub/run-budget.js +302 -4
- package/.pi/harnesses/agent-hub/run-namespace.js +87 -0
- package/.pi/harnesses/agent-hub/version.ts +25 -1
- package/.pi/harnesses/coms/README.md +8 -1
- package/.pi/harnesses/coms/package.json +1 -1
- package/.pi/harnesses/coms/version.ts +25 -1
- package/.pi/harnesses/damage-control-continue/README.md +8 -1
- package/.pi/harnesses/damage-control-continue/package.json +1 -1
- package/.pi/harnesses/damage-control-continue/version.ts +25 -1
- package/.pi/harnesses/lib/herdr-client.ts +10 -1
- package/.pi/harnesses/lib/spawned-peers.js +190 -0
- package/.pi/prompts/af-doctor-agent-fleet.md +13 -6
- package/.pi/prompts/af-setup-agent-fleet.md +7 -15
- package/.versions/0.0.10/.claude/commands/build.md +44 -0
- package/.versions/0.0.10/.claude/commands/code-simplify.md +22 -0
- package/.versions/0.0.10/.claude/commands/design-agent.md +14 -0
- package/.versions/0.0.10/.claude/commands/doctor-agent-fleet.md +22 -0
- package/.versions/0.0.10/.claude/commands/orchestrate.md +112 -0
- package/.versions/0.0.10/.claude/commands/plan.md +16 -0
- package/.versions/0.0.10/.claude/commands/prime.md +22 -0
- package/.versions/0.0.10/.claude/commands/review.md +16 -0
- package/.versions/0.0.10/.claude/commands/set-hermes-telegram.md +15 -0
- package/.versions/0.0.10/.claude/commands/set-hermes-watchdog.md +6 -0
- package/.versions/0.0.10/.claude/commands/setup-agent-fleet.md +17 -0
- package/.versions/0.0.10/.claude/commands/ship.md +72 -0
- package/.versions/0.0.10/.claude/commands/spec.md +15 -0
- package/.versions/0.0.10/.claude/commands/test.md +19 -0
- package/.versions/0.0.10/.claude/commands/webperf.md +32 -0
- package/.versions/0.0.10/.claude/orchestrate-teams.yaml +24 -0
- package/.versions/0.0.10/.opencode/commands/af-build.md +17 -0
- package/.versions/0.0.10/.opencode/commands/af-code-simplify.md +16 -0
- package/.versions/0.0.10/.opencode/commands/af-compound.md +16 -0
- package/.versions/0.0.10/.opencode/commands/af-design-agent.md +15 -0
- package/.versions/0.0.10/.opencode/commands/af-doctor-agent-fleet.md +22 -0
- package/.versions/0.0.10/.opencode/commands/af-orchestrate.md +112 -0
- package/.versions/0.0.10/.opencode/commands/af-plan.md +16 -0
- package/.versions/0.0.10/.opencode/commands/af-prime.md +22 -0
- package/.versions/0.0.10/.opencode/commands/af-review.md +15 -0
- package/.versions/0.0.10/.opencode/commands/af-set-hermes-telegram.md +15 -0
- package/.versions/0.0.10/.opencode/commands/af-set-hermes-watchdog.md +6 -0
- package/.versions/0.0.10/.opencode/commands/af-setup-agent-fleet.md +17 -0
- package/.versions/0.0.10/.opencode/commands/af-ship.md +16 -0
- package/.versions/0.0.10/.opencode/commands/af-spec.md +16 -0
- package/.versions/0.0.10/.opencode/commands/af-test.md +21 -0
- package/.versions/0.0.10/.opencode/commands/af-webperf.md +32 -0
- package/.versions/0.0.10/.opencode/orchestrate-teams.yaml +24 -0
- package/.versions/0.0.10/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/0.0.10/.pi/agents/model-profiles.yaml +27 -0
- package/.versions/0.0.10/.pi/agents/peers.yaml +142 -0
- package/.versions/0.0.10/.pi/agents/teams.yaml +41 -0
- package/.versions/0.0.10/.pi/damage-control-rules.yaml +297 -0
- package/.versions/0.0.10/.pi/extensions/agent-fleet-update-check/README.md +57 -0
- package/.versions/0.0.10/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
- package/.versions/0.0.10/.pi/extensions/agent-fleet-update-check/package.json +6 -0
- package/.versions/0.0.10/.pi/extensions/btw/README.md +118 -0
- package/.versions/0.0.10/.pi/extensions/btw/index.ts +917 -0
- package/.versions/0.0.10/.pi/extensions/btw/package.json +6 -0
- package/.versions/0.0.10/.pi/extensions/btw/state.js +179 -0
- package/.versions/0.0.10/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
- package/.versions/0.0.10/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
- package/.versions/0.0.10/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/0.0.10/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/0.0.10/.pi/extensions/compact-and-continue/index.ts +120 -0
- package/.versions/0.0.10/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/0.0.10/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/0.0.10/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/0.0.10/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/0.0.10/.pi/extensions/package-lock.json +1143 -0
- package/.versions/0.0.10/.pi/extensions/package.json +9 -0
- package/.versions/0.0.10/.pi/extensions/pi-voice-stt/README.md +201 -0
- package/.versions/0.0.10/.pi/extensions/pi-voice-stt/config.ts +198 -0
- package/.versions/0.0.10/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/0.0.10/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/0.0.10/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/0.0.10/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/0.0.10/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/README.md +1001 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/access-approval.ts +135 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/artifacts.js +146 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/assertion-ledger.js +58 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/backend-policy.js +153 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/context-window.js +106 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/delegate.ts +435 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/docs-lane.js +122 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/drift-watchdog.js +211 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/external-blocker.js +85 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/footer.ts +31 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/helpers.ts +248 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/index.ts +9111 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-session-bridge.ts +257 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/research-retention.js +34 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/return-contract.js +293 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/return-extract.js +75 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/review-findings.js +102 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/run-budget.js +479 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/run-namespace.js +87 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/scope-gate.js +103 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/spawn.ts +354 -0
- package/.versions/0.0.10/.pi/harnesses/agent-hub/version.ts +42 -0
- package/.versions/0.0.10/.pi/harnesses/ask-user-remote/README.md +19 -0
- package/.versions/0.0.10/.pi/harnesses/ask-user-remote/index.ts +321 -0
- package/.versions/0.0.10/.pi/harnesses/ask-user-remote/race-core.js +106 -0
- package/.versions/0.0.10/.pi/harnesses/coms/README.md +100 -0
- package/.versions/0.0.10/.pi/harnesses/coms/index.ts +1767 -0
- package/.versions/0.0.10/.pi/harnesses/coms/package.json +7 -0
- package/.versions/0.0.10/.pi/harnesses/coms/version.ts +42 -0
- package/.versions/0.0.10/.pi/harnesses/damage-control-continue/README.md +124 -0
- package/.versions/0.0.10/.pi/harnesses/damage-control-continue/index.ts +536 -0
- package/.versions/0.0.10/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/0.0.10/.pi/harnesses/damage-control-continue/version.ts +42 -0
- package/.versions/0.0.10/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
- package/.versions/0.0.10/.pi/harnesses/lib/damage-control-shared.ts +197 -0
- package/.versions/0.0.10/.pi/harnesses/lib/herdr-client.ts +472 -0
- package/.versions/0.0.10/.pi/harnesses/lib/herdr-presence.ts +399 -0
- package/.versions/0.0.10/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.versions/0.0.10/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/0.0.10/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
- package/.versions/0.0.10/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/0.0.10/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
- package/.versions/0.0.10/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
- package/.versions/0.0.10/.pi/harnesses/lib/spawned-peers.js +190 -0
- package/.versions/0.0.10/.pi/harnesses/package-lock.json +35 -0
- package/.versions/0.0.10/.pi/harnesses/package.json +9 -0
- package/.versions/0.0.10/.pi/prompts/af-build.md +24 -0
- package/.versions/0.0.10/.pi/prompts/af-code-simplify.md +22 -0
- package/.versions/0.0.10/.pi/prompts/af-doctor-agent-fleet.md +22 -0
- package/.versions/0.0.10/.pi/prompts/af-plan.md +16 -0
- package/.versions/0.0.10/.pi/prompts/af-review.md +16 -0
- package/.versions/0.0.10/.pi/prompts/af-set-hermes-telegram.md +15 -0
- package/.versions/0.0.10/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/0.0.10/.pi/prompts/af-setup-agent-fleet.md +19 -0
- package/.versions/0.0.10/.pi/prompts/af-ship.md +17 -0
- package/.versions/0.0.10/.pi/prompts/af-spec.md +15 -0
- package/.versions/0.0.10/.pi/prompts/af-test.md +19 -0
- package/.versions/0.0.10/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/0.0.10/.version +1 -0
- package/.versions/0.0.10/agents/architect.md +24 -0
- package/.versions/0.0.10/agents/bowser.md +27 -0
- package/.versions/0.0.10/agents/builder.md +54 -0
- package/.versions/0.0.10/agents/code-reviewer.md +208 -0
- package/.versions/0.0.10/agents/deep-researcher.md +32 -0
- package/.versions/0.0.10/agents/documenter.md +18 -0
- package/.versions/0.0.10/agents/orchestrator.md +72 -0
- package/.versions/0.0.10/agents/plan-reviewer.md +83 -0
- package/.versions/0.0.10/agents/planner.md +70 -0
- package/.versions/0.0.10/agents/releaser.md +24 -0
- package/.versions/0.0.10/agents/researcher.md +28 -0
- package/.versions/0.0.10/agents/security-auditor.md +167 -0
- package/.versions/0.0.10/agents/test-engineer.md +153 -0
- package/.versions/0.0.10/agents/web-debugger.md +43 -0
- package/.versions/0.0.10/agents/web-performance-auditor.md +193 -0
- package/.versions/0.0.10/codex/CONDUCTOR.md +148 -0
- package/.versions/0.0.10/docs/ARCHITECTURE.md +303 -0
- package/.versions/0.0.10/docs/agent-fleet-setup.md +377 -0
- package/.versions/0.0.10/docs/claude-code-coms-bridge.md +109 -0
- package/.versions/0.0.10/docs/codex-remote-conductor.md +170 -0
- package/.versions/0.0.10/docs/coms-hermes-bridge.md +189 -0
- package/.versions/0.0.10/docs/getting-started.md +254 -0
- package/.versions/0.0.10/docs/npm-install.md +514 -0
- package/.versions/0.0.10/docs/opencode-setup.md +281 -0
- package/.versions/0.0.10/docs/pi-extensions.md +363 -0
- package/.versions/0.0.10/docs/pi-setup.md +571 -0
- package/.versions/0.0.10/docs/skill-anatomy.md +150 -0
- package/.versions/0.0.10/hermes/README.md +347 -0
- package/.versions/0.0.10/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/.versions/0.0.10/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/.versions/0.0.10/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/0.0.10/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/0.0.10/hermes/gates/gate-o-capability.md +8 -0
- package/.versions/0.0.10/hermes/gates/gate-o-validator-fixtures.json +1 -0
- package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +770 -0
- package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/.versions/0.0.10/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/.versions/0.0.10/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/0.0.10/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/0.0.10/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/0.0.10/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/0.0.10/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/.versions/0.0.10/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/.versions/0.0.10/hermes/watchdog-tests/__init__.py +0 -0
- package/.versions/0.0.10/hooks/SIMPLIFY-IGNORE.md +90 -0
- package/.versions/0.0.10/hooks/coms-stop-hook.mjs +84 -0
- package/.versions/0.0.10/hooks/hooks.json +14 -0
- package/.versions/0.0.10/hooks/session-start.sh +74 -0
- package/.versions/0.0.10/hooks/simplify-ignore.sh +302 -0
- package/.versions/0.0.10/install-manifest.json +3615 -0
- package/.versions/0.0.10/justfile +254 -0
- package/.versions/0.0.10/manifest-meta.json +472 -0
- package/.versions/0.0.10/references/accessibility-checklist.md +160 -0
- package/.versions/0.0.10/references/definition-of-done.md +67 -0
- package/.versions/0.0.10/references/fleet-coordination-patterns.md +151 -0
- package/.versions/0.0.10/references/observability-checklist.md +91 -0
- package/.versions/0.0.10/references/orchestration-patterns.md +370 -0
- package/.versions/0.0.10/references/performance-checklist.md +153 -0
- package/.versions/0.0.10/references/prompting-patterns.md +380 -0
- package/.versions/0.0.10/references/security-checklist.md +179 -0
- package/.versions/0.0.10/references/testing-patterns.md +236 -0
- package/.versions/0.0.10/scripts/codex-conductor.ts +41 -0
- package/.versions/0.0.10/scripts/codex-remote-control.ts +167 -0
- package/.versions/0.0.10/scripts/coms-claude-bridge.ts +401 -0
- package/.versions/0.0.10/scripts/coms-cli.ts +484 -0
- package/.versions/0.0.10/scripts/coms-hermes-bridge.ts +413 -0
- package/.versions/0.0.10/scripts/fleet.ts +168 -0
- package/.versions/0.0.10/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/0.0.10/scripts/hermes-monitor-scenario.ts +474 -0
- package/.versions/0.0.10/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/.versions/0.0.10/scripts/install-hermes-plugin.sh +180 -0
- package/.versions/0.0.10/scripts/lib/claude-bridge-core.ts +165 -0
- package/.versions/0.0.10/scripts/lib/codex-conductor.ts +88 -0
- package/.versions/0.0.10/scripts/lib/codex-remote-control.ts +480 -0
- package/.versions/0.0.10/scripts/lib/coms-envelope.ts +582 -0
- package/.versions/0.0.10/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/0.0.10/scripts/lib/fleet-command.ts +111 -0
- package/.versions/0.0.10/scripts/lib/herdr-layout.ts +281 -0
- package/.versions/0.0.10/scripts/lib/hermes-bridge-core.ts +241 -0
- package/.versions/0.0.10/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.versions/0.0.10/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/.versions/0.0.10/scripts/lib/hermes-monitor-model.ts +3 -0
- package/.versions/0.0.10/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.versions/0.0.10/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.versions/0.0.10/scripts/lib/hermes-monitor-store.ts +2 -0
- package/.versions/0.0.10/scripts/lib/monitor-env.ts +120 -0
- package/.versions/0.0.10/scripts/lib/peer-launch.ts +314 -0
- package/.versions/0.0.10/scripts/lib/persona-banner.ts +62 -0
- package/.versions/0.0.10/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/0.0.10/scripts/lib/team-project.ts +193 -0
- package/.versions/0.0.10/scripts/lib/team-snapshot.ts +147 -0
- package/.versions/0.0.10/scripts/peer-banner.ts +40 -0
- package/.versions/0.0.10/scripts/peer-launch.ts +259 -0
- package/.versions/0.0.10/scripts/team-snapshot.ts +237 -0
- package/.versions/0.0.10/scripts/team-up.ts +360 -0
- package/.versions/0.0.10/skills/_internal/grilling.md +11 -0
- package/.versions/0.0.10/skills/browser-testing-with-devtools/SKILL.md +351 -0
- package/.versions/0.0.10/skills/code-review-and-quality/SKILL.md +381 -0
- package/.versions/0.0.10/skills/compound-learning/SKILL.md +137 -0
- package/.versions/0.0.10/skills/context-engineering/SKILL.md +291 -0
- package/.versions/0.0.10/skills/deprecation-and-migration/SKILL.md +206 -0
- package/.versions/0.0.10/skills/designing-agents/SKILL.md +394 -0
- package/.versions/0.0.10/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/0.0.10/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/0.0.10/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/0.0.10/skills/guided-workspace-setup/SKILL.md +226 -0
- package/.versions/0.0.10/skills/guided-workspace-setup/companion-manifest.json +38 -0
- package/.versions/0.0.10/skills/idea-refine/SKILL.md +182 -0
- package/.versions/0.0.10/skills/idea-refine/examples.md +238 -0
- package/.versions/0.0.10/skills/idea-refine/frameworks.md +99 -0
- package/.versions/0.0.10/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/0.0.10/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/0.0.10/skills/incremental-implementation/SKILL.md +287 -0
- package/.versions/0.0.10/skills/interview-me/SKILL.md +226 -0
- package/.versions/0.0.10/skills/orchestration-verification/SKILL.md +181 -0
- package/.versions/0.0.10/skills/peer-coms/SKILL.md +90 -0
- package/.versions/0.0.10/skills/performance-optimization/SKILL.md +350 -0
- package/.versions/0.0.10/skills/planning-and-task-breakdown/SKILL.md +254 -0
- package/.versions/0.0.10/skills/security-and-hardening/SKILL.md +461 -0
- package/.versions/0.0.10/skills/spec-driven-development/SKILL.md +257 -0
- package/.versions/0.0.10/skills/using-agent-skills/SKILL.md +199 -0
- package/.versions/0.0.10/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/README.md +11 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
- package/.versions/0.0.10/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
- package/.versions/0.0.9/.claude/commands/build.md +44 -0
- package/.versions/0.0.9/.claude/commands/code-simplify.md +22 -0
- package/.versions/0.0.9/.claude/commands/design-agent.md +14 -0
- package/.versions/0.0.9/.claude/commands/doctor-agent-fleet.md +17 -0
- package/.versions/0.0.9/.claude/commands/orchestrate.md +112 -0
- package/.versions/0.0.9/.claude/commands/plan.md +16 -0
- package/.versions/0.0.9/.claude/commands/prime.md +22 -0
- package/.versions/0.0.9/.claude/commands/review.md +16 -0
- package/.versions/0.0.9/.claude/commands/set-hermes-telegram.md +15 -0
- package/.versions/0.0.9/.claude/commands/set-hermes-watchdog.md +6 -0
- package/.versions/0.0.9/.claude/commands/setup-agent-fleet.md +25 -0
- package/.versions/0.0.9/.claude/commands/ship.md +72 -0
- package/.versions/0.0.9/.claude/commands/spec.md +15 -0
- package/.versions/0.0.9/.claude/commands/test.md +19 -0
- package/.versions/0.0.9/.claude/commands/webperf.md +32 -0
- package/.versions/0.0.9/.claude/orchestrate-teams.yaml +24 -0
- package/.versions/0.0.9/.opencode/commands/af-build.md +17 -0
- package/.versions/0.0.9/.opencode/commands/af-code-simplify.md +16 -0
- package/.versions/0.0.9/.opencode/commands/af-compound.md +16 -0
- package/.versions/0.0.9/.opencode/commands/af-design-agent.md +15 -0
- package/.versions/0.0.9/.opencode/commands/af-doctor-agent-fleet.md +17 -0
- package/.versions/0.0.9/.opencode/commands/af-orchestrate.md +112 -0
- package/.versions/0.0.9/.opencode/commands/af-plan.md +16 -0
- package/.versions/0.0.9/.opencode/commands/af-prime.md +22 -0
- package/.versions/0.0.9/.opencode/commands/af-review.md +15 -0
- package/.versions/0.0.9/.opencode/commands/af-set-hermes-telegram.md +15 -0
- package/.versions/0.0.9/.opencode/commands/af-set-hermes-watchdog.md +6 -0
- package/.versions/0.0.9/.opencode/commands/af-setup-agent-fleet.md +15 -0
- package/.versions/0.0.9/.opencode/commands/af-ship.md +16 -0
- package/.versions/0.0.9/.opencode/commands/af-spec.md +16 -0
- package/.versions/0.0.9/.opencode/commands/af-test.md +21 -0
- package/.versions/0.0.9/.opencode/commands/af-webperf.md +32 -0
- package/.versions/0.0.9/.opencode/orchestrate-teams.yaml +24 -0
- package/.versions/0.0.9/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/0.0.9/.pi/agents/model-profiles.yaml +27 -0
- package/.versions/0.0.9/.pi/agents/peers.yaml +142 -0
- package/.versions/0.0.9/.pi/agents/teams.yaml +41 -0
- package/.versions/0.0.9/.pi/damage-control-rules.yaml +297 -0
- package/.versions/0.0.9/.pi/extensions/agent-fleet-update-check/README.md +58 -0
- package/.versions/0.0.9/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
- package/.versions/0.0.9/.pi/extensions/agent-fleet-update-check/package.json +6 -0
- package/.versions/0.0.9/.pi/extensions/btw/README.md +118 -0
- package/.versions/0.0.9/.pi/extensions/btw/index.ts +917 -0
- package/.versions/0.0.9/.pi/extensions/btw/package.json +6 -0
- package/.versions/0.0.9/.pi/extensions/btw/state.js +179 -0
- package/.versions/0.0.9/.pi/extensions/chrome-devtools-mcp/README.md +58 -0
- package/.versions/0.0.9/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
- package/.versions/0.0.9/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/0.0.9/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/0.0.9/.pi/extensions/compact-and-continue/index.ts +120 -0
- package/.versions/0.0.9/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/0.0.9/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/0.0.9/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/0.0.9/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/0.0.9/.pi/extensions/package-lock.json +1143 -0
- package/.versions/0.0.9/.pi/extensions/package.json +9 -0
- package/.versions/0.0.9/.pi/extensions/pi-voice-stt/README.md +201 -0
- package/.versions/0.0.9/.pi/extensions/pi-voice-stt/config.ts +198 -0
- package/.versions/0.0.9/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/0.0.9/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/0.0.9/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/0.0.9/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/0.0.9/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/README.md +872 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/access-approval.ts +135 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/artifacts.js +146 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/assertion-ledger.js +58 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/backend-policy.js +153 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/context-window.js +106 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/delegate.ts +435 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/drift-watchdog.js +211 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/footer.ts +31 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/helpers.ts +248 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/index.ts +8702 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/monitor-session-bridge.ts +257 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/research-retention.js +34 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/return-contract.js +293 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/return-extract.js +75 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/run-budget.js +181 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/scope-gate.js +103 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/spawn.ts +354 -0
- package/.versions/0.0.9/.pi/harnesses/agent-hub/version.ts +42 -0
- package/.versions/0.0.9/.pi/harnesses/ask-user-remote/README.md +19 -0
- package/.versions/0.0.9/.pi/harnesses/ask-user-remote/index.ts +321 -0
- package/.versions/0.0.9/.pi/harnesses/ask-user-remote/race-core.js +106 -0
- package/.versions/0.0.9/.pi/harnesses/coms/README.md +100 -0
- package/.versions/0.0.9/.pi/harnesses/coms/index.ts +1767 -0
- package/.versions/0.0.9/.pi/harnesses/coms/package.json +7 -0
- package/.versions/0.0.9/.pi/harnesses/coms/version.ts +42 -0
- package/.versions/0.0.9/.pi/harnesses/damage-control-continue/README.md +124 -0
- package/.versions/0.0.9/.pi/harnesses/damage-control-continue/index.ts +536 -0
- package/.versions/0.0.9/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/0.0.9/.pi/harnesses/damage-control-continue/version.ts +42 -0
- package/.versions/0.0.9/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
- package/.versions/0.0.9/.pi/harnesses/lib/damage-control-shared.ts +197 -0
- package/.versions/0.0.9/.pi/harnesses/lib/herdr-client.ts +472 -0
- package/.versions/0.0.9/.pi/harnesses/lib/herdr-presence.ts +399 -0
- package/.versions/0.0.9/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.versions/0.0.9/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/0.0.9/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
- package/.versions/0.0.9/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/0.0.9/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
- package/.versions/0.0.9/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
- package/.versions/0.0.9/.pi/harnesses/lib/spawned-peers.js +190 -0
- package/.versions/0.0.9/.pi/harnesses/package-lock.json +35 -0
- package/.versions/0.0.9/.pi/harnesses/package.json +9 -0
- package/.versions/0.0.9/.pi/prompts/af-build.md +24 -0
- package/.versions/0.0.9/.pi/prompts/af-code-simplify.md +22 -0
- package/.versions/0.0.9/.pi/prompts/af-doctor-agent-fleet.md +15 -0
- package/.versions/0.0.9/.pi/prompts/af-plan.md +16 -0
- package/.versions/0.0.9/.pi/prompts/af-review.md +16 -0
- package/.versions/0.0.9/.pi/prompts/af-set-hermes-telegram.md +15 -0
- package/.versions/0.0.9/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/0.0.9/.pi/prompts/af-setup-agent-fleet.md +27 -0
- package/.versions/0.0.9/.pi/prompts/af-ship.md +17 -0
- package/.versions/0.0.9/.pi/prompts/af-spec.md +15 -0
- package/.versions/0.0.9/.pi/prompts/af-test.md +19 -0
- package/.versions/0.0.9/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/0.0.9/.version +1 -0
- package/.versions/0.0.9/agents/architect.md +24 -0
- package/.versions/0.0.9/agents/bowser.md +27 -0
- package/.versions/0.0.9/agents/builder.md +54 -0
- package/.versions/0.0.9/agents/code-reviewer.md +204 -0
- package/.versions/0.0.9/agents/deep-researcher.md +32 -0
- package/.versions/0.0.9/agents/documenter.md +18 -0
- package/.versions/0.0.9/agents/orchestrator.md +66 -0
- package/.versions/0.0.9/agents/plan-reviewer.md +62 -0
- package/.versions/0.0.9/agents/planner.md +70 -0
- package/.versions/0.0.9/agents/releaser.md +24 -0
- package/.versions/0.0.9/agents/researcher.md +28 -0
- package/.versions/0.0.9/agents/security-auditor.md +167 -0
- package/.versions/0.0.9/agents/test-engineer.md +153 -0
- package/.versions/0.0.9/agents/web-debugger.md +43 -0
- package/.versions/0.0.9/agents/web-performance-auditor.md +193 -0
- package/.versions/0.0.9/codex/CONDUCTOR.md +148 -0
- package/.versions/0.0.9/docs/ARCHITECTURE.md +262 -0
- package/.versions/0.0.9/docs/agent-fleet-setup.md +366 -0
- package/.versions/0.0.9/docs/claude-code-coms-bridge.md +109 -0
- package/.versions/0.0.9/docs/codex-remote-conductor.md +170 -0
- package/.versions/0.0.9/docs/coms-hermes-bridge.md +189 -0
- package/.versions/0.0.9/docs/getting-started.md +231 -0
- package/.versions/0.0.9/docs/npm-install.md +337 -0
- package/.versions/0.0.9/docs/opencode-setup.md +249 -0
- package/.versions/0.0.9/docs/pi-extensions.md +356 -0
- package/.versions/0.0.9/docs/pi-setup.md +476 -0
- package/.versions/0.0.9/docs/skill-anatomy.md +150 -0
- package/.versions/0.0.9/hermes/README.md +347 -0
- package/.versions/0.0.9/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/.versions/0.0.9/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/.versions/0.0.9/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/0.0.9/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/0.0.9/hermes/gates/gate-o-capability.md +8 -0
- package/.versions/0.0.9/hermes/gates/gate-o-validator-fixtures.json +1 -0
- package/.versions/0.0.9/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +770 -0
- package/.versions/0.0.9/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/.versions/0.0.9/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/.versions/0.0.9/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/.versions/0.0.9/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/.versions/0.0.9/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/.versions/0.0.9/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/.versions/0.0.9/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/.versions/0.0.9/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/.versions/0.0.9/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/.versions/0.0.9/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/.versions/0.0.9/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/0.0.9/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/0.0.9/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/0.0.9/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/0.0.9/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/.versions/0.0.9/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/.versions/0.0.9/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/.versions/0.0.9/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/.versions/0.0.9/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/.versions/0.0.9/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/.versions/0.0.9/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/.versions/0.0.9/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/.versions/0.0.9/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/.versions/0.0.9/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/.versions/0.0.9/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/.versions/0.0.9/hermes/watchdog-tests/__init__.py +0 -0
- package/.versions/0.0.9/hooks/SIMPLIFY-IGNORE.md +90 -0
- package/.versions/0.0.9/hooks/coms-stop-hook.mjs +84 -0
- package/.versions/0.0.9/hooks/hooks.json +14 -0
- package/.versions/0.0.9/hooks/session-start.sh +74 -0
- package/.versions/0.0.9/hooks/simplify-ignore.sh +302 -0
- package/.versions/0.0.9/justfile +254 -0
- package/.versions/0.0.9/references/accessibility-checklist.md +160 -0
- package/.versions/0.0.9/references/definition-of-done.md +67 -0
- package/.versions/0.0.9/references/fleet-coordination-patterns.md +151 -0
- package/.versions/0.0.9/references/observability-checklist.md +91 -0
- package/.versions/0.0.9/references/orchestration-patterns.md +370 -0
- package/.versions/0.0.9/references/performance-checklist.md +153 -0
- package/.versions/0.0.9/references/prompting-patterns.md +380 -0
- package/.versions/0.0.9/references/security-checklist.md +179 -0
- package/.versions/0.0.9/references/testing-patterns.md +236 -0
- package/.versions/0.0.9/scripts/codex-conductor.ts +41 -0
- package/.versions/0.0.9/scripts/codex-remote-control.ts +167 -0
- package/.versions/0.0.9/scripts/coms-claude-bridge.ts +401 -0
- package/.versions/0.0.9/scripts/coms-cli.ts +484 -0
- package/.versions/0.0.9/scripts/coms-hermes-bridge.ts +413 -0
- package/.versions/0.0.9/scripts/fleet.ts +168 -0
- package/.versions/0.0.9/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/0.0.9/scripts/hermes-monitor-scenario.ts +474 -0
- package/.versions/0.0.9/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/.versions/0.0.9/scripts/install-hermes-plugin.sh +180 -0
- package/.versions/0.0.9/scripts/lib/claude-bridge-core.ts +165 -0
- package/.versions/0.0.9/scripts/lib/codex-conductor.ts +88 -0
- package/.versions/0.0.9/scripts/lib/codex-remote-control.ts +480 -0
- package/.versions/0.0.9/scripts/lib/coms-envelope.ts +582 -0
- package/.versions/0.0.9/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/0.0.9/scripts/lib/fleet-command.ts +111 -0
- package/.versions/0.0.9/scripts/lib/herdr-layout.ts +281 -0
- package/.versions/0.0.9/scripts/lib/hermes-bridge-core.ts +241 -0
- package/.versions/0.0.9/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.versions/0.0.9/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/.versions/0.0.9/scripts/lib/hermes-monitor-model.ts +3 -0
- package/.versions/0.0.9/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.versions/0.0.9/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.versions/0.0.9/scripts/lib/hermes-monitor-store.ts +2 -0
- package/.versions/0.0.9/scripts/lib/monitor-env.ts +120 -0
- package/.versions/0.0.9/scripts/lib/peer-launch.ts +314 -0
- package/.versions/0.0.9/scripts/lib/persona-banner.ts +62 -0
- package/.versions/0.0.9/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/0.0.9/scripts/lib/team-project.ts +193 -0
- package/.versions/0.0.9/scripts/lib/team-snapshot.ts +147 -0
- package/.versions/0.0.9/scripts/peer-banner.ts +40 -0
- package/.versions/0.0.9/scripts/peer-launch.ts +259 -0
- package/.versions/0.0.9/scripts/team-snapshot.ts +237 -0
- package/.versions/0.0.9/scripts/team-up.ts +360 -0
- package/.versions/0.0.9/skills/_internal/grilling.md +11 -0
- package/.versions/0.0.9/skills/browser-testing-with-devtools/SKILL.md +352 -0
- package/.versions/0.0.9/skills/code-review-and-quality/SKILL.md +381 -0
- package/.versions/0.0.9/skills/compound-learning/SKILL.md +137 -0
- package/.versions/0.0.9/skills/context-engineering/SKILL.md +291 -0
- package/.versions/0.0.9/skills/deprecation-and-migration/SKILL.md +206 -0
- package/.versions/0.0.9/skills/designing-agents/SKILL.md +394 -0
- package/.versions/0.0.9/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/0.0.9/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/0.0.9/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/0.0.9/skills/guided-workspace-setup/SKILL.md +544 -0
- package/.versions/0.0.9/skills/guided-workspace-setup/companion-manifest.json +38 -0
- package/.versions/0.0.9/skills/idea-refine/SKILL.md +182 -0
- package/.versions/0.0.9/skills/idea-refine/examples.md +238 -0
- package/.versions/0.0.9/skills/idea-refine/frameworks.md +99 -0
- package/.versions/0.0.9/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/0.0.9/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/0.0.9/skills/incremental-implementation/SKILL.md +287 -0
- package/.versions/0.0.9/skills/interview-me/SKILL.md +226 -0
- package/.versions/0.0.9/skills/orchestration-verification/SKILL.md +181 -0
- package/.versions/0.0.9/skills/peer-coms/SKILL.md +90 -0
- package/.versions/0.0.9/skills/performance-optimization/SKILL.md +350 -0
- package/.versions/0.0.9/skills/planning-and-task-breakdown/SKILL.md +236 -0
- package/.versions/0.0.9/skills/security-and-hardening/SKILL.md +461 -0
- package/.versions/0.0.9/skills/spec-driven-development/SKILL.md +245 -0
- package/.versions/0.0.9/skills/using-agent-skills/SKILL.md +199 -0
- package/.versions/0.0.9/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/README.md +11 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
- package/.versions/0.0.9/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
- package/CHANGELOG.md +141 -0
- package/README.md +22 -5
- package/agents/architect.md +1 -0
- package/agents/bowser.md +1 -0
- package/agents/builder.md +1 -0
- package/agents/code-reviewer.md +8 -5
- package/agents/deep-researcher.md +2 -1
- package/agents/orchestrator.md +8 -1
- package/agents/plan-reviewer.md +25 -2
- package/agents/planner.md +3 -2
- package/agents/security-auditor.md +1 -0
- package/agents/test-engineer.md +3 -1
- package/agents/web-debugger.md +1 -0
- package/agents/web-performance-auditor.md +1 -0
- package/bin/build-manifest.js +68 -0
- package/bin/cli.js +679 -49
- package/bin/lib/apply.js +641 -0
- package/bin/lib/manifest.js +731 -0
- package/bin/lib/merge-forms.js +106 -0
- package/bin/lib/plan.js +569 -0
- package/bin/lib/state.js +213 -0
- package/bin/lib/verify.js +576 -0
- package/bin/snapshot-version.js +5 -0
- package/docs/ARCHITECTURE.md +53 -12
- package/docs/agent-fleet-setup.md +59 -48
- package/docs/getting-started.md +29 -6
- package/docs/npm-install.md +208 -31
- package/docs/opencode-setup.md +32 -0
- package/docs/pi-extensions.md +83 -13
- package/docs/pi-setup.md +164 -69
- package/install-manifest.json +3615 -0
- package/justfile +10 -1
- package/manifest-meta.json +472 -0
- package/package.json +8 -3
- package/scripts/fleet.ts +22 -3
- package/scripts/lib/fleet-command.ts +5 -3
- package/scripts/lib/herdr-layout.ts +18 -0
- package/scripts/lib/peer-launch.ts +314 -0
- package/scripts/lib/team-project.ts +3 -1
- package/scripts/peer-launch.ts +259 -0
- package/skills/browser-testing-with-devtools/SKILL.md +3 -4
- package/skills/guided-workspace-setup/SKILL.md +172 -490
- package/skills/guided-workspace-setup/companion-manifest.json +2 -0
- package/skills/planning-and-task-breakdown/SKILL.md +18 -0
- package/skills/spec-driven-development/SKILL.md +12 -0
- package/.pi/harnesses/agent-hub/spawned-peers.js +0 -74
|
@@ -89,10 +89,22 @@ import {
|
|
|
89
89
|
exemptionsFilePath, type AccessRequest,
|
|
90
90
|
} from "../lib/damage-control-shared.ts";
|
|
91
91
|
import { applyModelOverride, clampDelegateDepth, DELEGATE_TREE_SPAWN_BUDGET, fallbackModelFor, isReadOnlyToolList, MAX_DELEGATE_DEPTH, normalizeAgentInput, parseTeamsYaml, safeAgentKey, safePathWithin, taskFingerprint, upsertTeamInYaml } from "./helpers.ts";
|
|
92
|
-
import { DEFAULT_HUB_MODE, DEFAULT_TASK_TIER, HUB_MODES,
|
|
92
|
+
import { DEFAULT_HUB_MODE, DEFAULT_TASK_TIER, HUB_MODES, TASK_BUDGET_MULTIPLIER, applyTierChange, blockingFindingCap, budgetStatusLine, checkReviewRoundCap, checkTaskBudget, checkTierPersonaGate, checkTurnBudget, contextOverflowDiagnostic, isReviewPersona, normalizeHubMode, remainingTaskResearch, resolveTaskBudget, resolveTurnBudget, reviewBudgetClause, reviewRoundCap, shouldRecycleSession, turnActiveMs } from "./run-budget.js";
|
|
93
|
+
import { countReviewFindings, findingBudgetNotice } from "./review-findings.js";
|
|
94
|
+
import { checkDocsLane, docsLaneNotice } from "./docs-lane.js";
|
|
95
|
+
import { checkExternalBlockerGate, externalBlockedProtocol, extractExternalBlockers } from "./external-blocker.js";
|
|
96
|
+
import { DEFAULT_RUN_HISTORY_KEEP, appendRunIndex, buildRunMeta, makeRunId, normalizeRunHistoryKeep, pruneRunDirs, RUN_INDEX_FILENAME, RUNS_DIRNAME } from "./run-namespace.js";
|
|
93
97
|
import { MAX_OPEN_ASSERTIONS, validateAssertionBatch } from "./assertion-ledger.js";
|
|
94
98
|
import { DEFAULT_PROVIDER_LIMITS, createProviderSemaphore, parseProviderLimits } from "./provider-semaphore.js";
|
|
95
|
-
import {
|
|
99
|
+
import {
|
|
100
|
+
PANE_PROMPT_TIMEOUT_MS,
|
|
101
|
+
PEER_READY_TIMEOUT_MS,
|
|
102
|
+
launchPeerInPane,
|
|
103
|
+
peerReadyDelayMs,
|
|
104
|
+
peerReadyVerdict,
|
|
105
|
+
spawnStaggerSeconds,
|
|
106
|
+
unaddressedPeerSweep,
|
|
107
|
+
} from "../lib/spawned-peers.js";
|
|
96
108
|
import { contextPct, estimatePromptTokens, overWindowDiagnostic, resolveContextWindow, shouldRecycleBeforeSpawn } from "./context-window.js";
|
|
97
109
|
import { DEFAULT_WATCHDOG_SETTING, WATCHDOG_SETTINGS, buildJudgePrompt, createDriftMonitor, hubOwnedScopeGlobs, normalizeWatchdogSetting, parseJudgeVerdict, resolveWatchdogActive } from "./drift-watchdog.js";
|
|
98
110
|
import { forceQuarantineSession, isCorruptSessionExit, quarantineIfUnusable } from "./session-health.js";
|
|
@@ -105,7 +117,7 @@ import { comsRequiredRefusal, parseDispatchPolicy, resolveDispatchBackend } from
|
|
|
105
117
|
import { DEFAULT_RESEARCH_KEEP, parseResearchKeep, selectResearchPrunable } from "./research-retention.js";
|
|
106
118
|
import { requireSafetyHarness, resolveSafetyHarness } from "./safety-routing.ts";
|
|
107
119
|
import { createAccessApprovalRouter } from "./access-approval.ts";
|
|
108
|
-
import { readdirSync, readFileSync, existsSync, mkdirSync, renameSync, unlinkSync, writeFileSync, rmSync } from "fs";
|
|
120
|
+
import { chmodSync, readdirSync, readFileSync, existsSync, mkdirSync, renameSync, unlinkSync, writeFileSync, rmSync } from "fs";
|
|
109
121
|
import {
|
|
110
122
|
HerdrAgentWatch,
|
|
111
123
|
HerdrPresence,
|
|
@@ -116,7 +128,9 @@ import {
|
|
|
116
128
|
} from "../lib/herdr-presence.ts";
|
|
117
129
|
import { herdr as herdrApi, herdrAvailable } from "../lib/herdr-client.ts";
|
|
118
130
|
import { buildLiveRegistryEntry, type ComsRegistryEntry } from "../lib/coms-registry-entry.ts";
|
|
119
|
-
import { peerCommand } from "../../../scripts/lib/herdr-layout.ts";
|
|
131
|
+
import { findPeerByName, parseEnvFile, parsePeersYaml, peerCommand, resolveEnvFilePath } from "../../../scripts/lib/herdr-layout.ts";
|
|
132
|
+
import { DEFAULT_PROJECT } from "../../../scripts/lib/team-project.ts";
|
|
133
|
+
import { STAGGER_ENV_VAR, WARMUP_SECONDS, oauthNeedsWarmup } from "../../../scripts/lib/spawn-stagger.ts";
|
|
120
134
|
import { join, resolve } from "path";
|
|
121
135
|
import * as net from "node:net";
|
|
122
136
|
import * as fs from "node:fs";
|
|
@@ -439,6 +453,11 @@ function extractNeedsResearch(output: string): string[] {
|
|
|
439
453
|
// watchdog-judge-model: <model spec> — model for the drift judge (default:
|
|
440
454
|
// the researcher persona's model, else the
|
|
441
455
|
// dispatcher's).
|
|
456
|
+
// run-history-keep: <n>|off — how many previous sessions' artifact archives to
|
|
457
|
+
// retain under .pi/agent-sessions/runs/ (default 10).
|
|
458
|
+
// Each session archives the previous one's artifacts
|
|
459
|
+
// into an immutable runs/<runId>/ namespace instead of
|
|
460
|
+
// deleting them; "off" retains every run.
|
|
442
461
|
|
|
443
462
|
interface AgentTeamOverrides {
|
|
444
463
|
language: string;
|
|
@@ -464,6 +483,9 @@ interface AgentTeamOverrides {
|
|
|
464
483
|
};
|
|
465
484
|
watchdogSetting: string;
|
|
466
485
|
watchdogJudgeModel: string | null;
|
|
486
|
+
// How many previous sessions' artifact archives to keep under
|
|
487
|
+
// .pi/agent-sessions/runs/ (run-namespace.js). null = keep everything.
|
|
488
|
+
runHistoryKeep: number | null;
|
|
467
489
|
warnings: string[];
|
|
468
490
|
}
|
|
469
491
|
|
|
@@ -483,6 +505,7 @@ const DEFAULT_OVERRIDES: AgentTeamOverrides = {
|
|
|
483
505
|
budgetOverrides: {},
|
|
484
506
|
watchdogSetting: DEFAULT_WATCHDOG_SETTING,
|
|
485
507
|
watchdogJudgeModel: null,
|
|
508
|
+
runHistoryKeep: DEFAULT_RUN_HISTORY_KEEP,
|
|
486
509
|
warnings: [],
|
|
487
510
|
};
|
|
488
511
|
|
|
@@ -535,6 +558,14 @@ function parseAgentTeamOverrides(cwd: string): AgentTeamOverrides {
|
|
|
535
558
|
if (key === "docs" && value) {
|
|
536
559
|
result.docsPaths = value.split(",").map(s => s.trim()).filter(Boolean);
|
|
537
560
|
}
|
|
561
|
+
if (key === "run-history-keep" && value) {
|
|
562
|
+
const keep = normalizeRunHistoryKeep(value);
|
|
563
|
+
if (keep === undefined) {
|
|
564
|
+
result.warnings.push(`run-history-keep "${value}" is not a positive integer or "off" — using the default (${DEFAULT_RUN_HISTORY_KEEP})`);
|
|
565
|
+
} else {
|
|
566
|
+
result.runHistoryKeep = keep;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
538
569
|
if (key === "research-keep" && value) {
|
|
539
570
|
const keep = parseResearchKeep(value);
|
|
540
571
|
if (keep != null) {
|
|
@@ -2055,14 +2086,48 @@ APIs, commands, structure), say so in your final response so the docs can be upd
|
|
|
2055
2086
|
let budgetOverrides: AgentTeamOverrides["budgetOverrides"] = {};
|
|
2056
2087
|
let turnDispatchCount = 0;
|
|
2057
2088
|
let turnResearchCount = 0;
|
|
2058
|
-
// Task tier (
|
|
2059
|
-
//
|
|
2060
|
-
//
|
|
2061
|
-
|
|
2089
|
+
// ── Task-scoped budget & tier (run-budget.js) ──
|
|
2090
|
+
// A per-message allowance cannot bound a task: every steering message opened a
|
|
2091
|
+
// fresh turn window, so a run could spend 8 dispatches and 60 minutes again and
|
|
2092
|
+
// again without any counter ever binding. These counters span the whole TASK
|
|
2093
|
+
// and are cleared only by an explicit new task (/af-new-task or
|
|
2094
|
+
// set_task_tier `new_task: true`) — not by a user message.
|
|
2095
|
+
let taskDispatchCount = 0;
|
|
2096
|
+
let taskResearchCount = 0;
|
|
2097
|
+
let taskLabel: string | null = null;
|
|
2098
|
+
// The task clock charges ACTIVE time only — turns that ran, minus the time the
|
|
2099
|
+
// dispatcher spent blocked on ask_user. Raw wall clock would bill the human's
|
|
2100
|
+
// lunch break, an overnight pause, and every long answer against the task, and
|
|
2101
|
+
// at fast mode's 45-minute envelope that hard-stops a task with two dispatches
|
|
2102
|
+
// spent. A false stop is worse than no stop: it teaches people to reset the
|
|
2103
|
+
// task window reflexively, which is the one thing that must stay deliberate.
|
|
2104
|
+
// `taskActiveMs` accumulates finished turns; the open turn is added at check time.
|
|
2105
|
+
let taskActiveMs = 0;
|
|
2106
|
+
let turnAskUserWaitMs = 0;
|
|
2107
|
+
// Review dispatches spent on this task (review-round cap).
|
|
2108
|
+
let taskReviewRounds = 0;
|
|
2109
|
+
// Task tier (complexity triage): declared by the dispatcher via set_task_tier.
|
|
2110
|
+
// TASK-scoped, not turn-scoped, and it moves by ratchet — down freely, up only
|
|
2111
|
+
// with a stated reason (applyTierChange). Null until declared; the first
|
|
2112
|
+
// dispatch assumes DEFAULT_TASK_TIER outside strict mode. Caps = min(mode, tier).
|
|
2113
|
+
let taskTier: string | null = null;
|
|
2114
|
+
// Was the tier ASSUMED by the hub rather than declared by the dispatcher? The
|
|
2115
|
+
// distinction matters to the ratchet: an assumed tier must not turn the
|
|
2116
|
+
// dispatcher's own first triage call into an "escalation" that needs a reason.
|
|
2117
|
+
let taskTierAssumed = false;
|
|
2062
2118
|
// Duplicate-dispatch guard: fingerprints of (agent, task) already dispatched
|
|
2063
2119
|
// THIS turn. Auto-research resumes and /af-agents-restart call dispatchAgent
|
|
2064
2120
|
// directly, so only real dispatcher tool calls are guarded.
|
|
2065
2121
|
const turnDispatchFingerprints = new Set<string>();
|
|
2122
|
+
// ── External-blocker circuit breaker (external-blocker.js) ──
|
|
2123
|
+
// Set when a specialist reports it needs something outside the fleet's reach;
|
|
2124
|
+
// gates the next dispatch until the human has been addressed. Cleared by an
|
|
2125
|
+
// ask_user call, by a new user turn (the human spoke), and by a new task.
|
|
2126
|
+
let externalBlockers: { agent: string; what: string }[] = [];
|
|
2127
|
+
let externalBlockerAcknowledged = false;
|
|
2128
|
+
let externalBlockerRefusedOnce = false;
|
|
2129
|
+
// Per-run artifact archive retention (run-namespace.js).
|
|
2130
|
+
let runHistoryKeep: number | null = DEFAULT_RUN_HISTORY_KEEP;
|
|
2066
2131
|
// ── Drift watchdog (drift-watchdog.js) ──
|
|
2067
2132
|
// Hub-wide setting from the overrides file, live-switchable via /af-watchdog;
|
|
2068
2133
|
// per-agent overrides ("on"/"off") win over it; a dispatch_agent `watchdog`
|
|
@@ -2071,13 +2136,81 @@ APIs, commands, structure), say so in your final response so the docs can be upd
|
|
|
2071
2136
|
let watchdogJudgeModel: string | null = null;
|
|
2072
2137
|
const watchdogAgentOverrides = new Map<string, "on" | "off">();
|
|
2073
2138
|
function currentBudget() {
|
|
2074
|
-
return resolveTurnBudget(hubMode, budgetOverrides,
|
|
2139
|
+
return resolveTurnBudget(hubMode, budgetOverrides, taskTier);
|
|
2140
|
+
}
|
|
2141
|
+
function currentTaskBudget() {
|
|
2142
|
+
return resolveTaskBudget(currentBudget());
|
|
2143
|
+
}
|
|
2144
|
+
function taskCounters() {
|
|
2145
|
+
return { dispatches: taskDispatchCount, research: taskResearchCount };
|
|
2146
|
+
}
|
|
2147
|
+
/**
|
|
2148
|
+
* Active time spent on this task: finished turns plus the open turn, each
|
|
2149
|
+
* minus its ask_user waits. An ask_user still in flight is subtracted too, so
|
|
2150
|
+
* the clock does not tick while the dispatcher sits at a question.
|
|
2151
|
+
*/
|
|
2152
|
+
function taskActiveElapsedMs(): number {
|
|
2153
|
+
let openWait = 0;
|
|
2154
|
+
const now = Date.now();
|
|
2155
|
+
for (const startedAt of askUserStarts.values()) openWait += Math.max(0, now - startedAt);
|
|
2156
|
+
return taskActiveMs + turnActiveMs(currentTurnStartedAt, now, turnAskUserWaitMs + openWait);
|
|
2157
|
+
}
|
|
2158
|
+
/** Fold the turn that is ending into the task's active-time accumulator. */
|
|
2159
|
+
function closeTurnActiveTime() {
|
|
2160
|
+
if (!currentTurnStartedAt) return;
|
|
2161
|
+
taskActiveMs += turnActiveMs(currentTurnStartedAt, Date.now(), turnAskUserWaitMs);
|
|
2162
|
+
turnAskUserWaitMs = 0;
|
|
2163
|
+
}
|
|
2164
|
+
/** Clear the task window: counters, tier, clock, review rounds, blocker breaker. */
|
|
2165
|
+
function resetTaskWindow(label: string | null = null) {
|
|
2166
|
+
taskDispatchCount = 0;
|
|
2167
|
+
taskResearchCount = 0;
|
|
2168
|
+
taskActiveMs = 0;
|
|
2169
|
+
turnAskUserWaitMs = 0;
|
|
2170
|
+
taskReviewRounds = 0;
|
|
2171
|
+
taskLabel = label;
|
|
2172
|
+
taskTier = null;
|
|
2173
|
+
taskTierAssumed = false;
|
|
2174
|
+
externalBlockers = [];
|
|
2175
|
+
externalBlockerAcknowledged = false;
|
|
2176
|
+
externalBlockerRefusedOnce = false;
|
|
2177
|
+
turnDispatchFingerprints.clear();
|
|
2178
|
+
updateModeStatus();
|
|
2075
2179
|
}
|
|
2076
2180
|
function updateModeStatus() {
|
|
2077
2181
|
try {
|
|
2078
|
-
widgetCtx?.ui?.setStatus(
|
|
2182
|
+
widgetCtx?.ui?.setStatus(
|
|
2183
|
+
"hub-mode",
|
|
2184
|
+
budgetStatusLine(
|
|
2185
|
+
hubMode,
|
|
2186
|
+
{ dispatches: turnDispatchCount, research: turnResearchCount },
|
|
2187
|
+
currentBudget(),
|
|
2188
|
+
// A trailing "?" marks a tier the hub assumed rather than one the
|
|
2189
|
+
// dispatcher declared — the human can see that triage was skipped.
|
|
2190
|
+
taskTier && taskTierAssumed ? `${taskTier}?` : taskTier,
|
|
2191
|
+
{ counters: taskCounters(), budget: currentTaskBudget() },
|
|
2192
|
+
),
|
|
2193
|
+
);
|
|
2079
2194
|
} catch {}
|
|
2080
2195
|
}
|
|
2196
|
+
/**
|
|
2197
|
+
* The two gates that must run BEFORE any budget is charged, in severity
|
|
2198
|
+
* order: an unacknowledged external blocker, then the tier's persona gate.
|
|
2199
|
+
* Returns the refusal text, or null when the call may proceed.
|
|
2200
|
+
*/
|
|
2201
|
+
function preflightGate(persona: string): { reason: string; message: string } | null {
|
|
2202
|
+
const blocked = checkExternalBlockerGate({
|
|
2203
|
+
blockers: externalBlockers,
|
|
2204
|
+
acknowledged: externalBlockerAcknowledged,
|
|
2205
|
+
askUserAvailable,
|
|
2206
|
+
refusedOnce: externalBlockerRefusedOnce,
|
|
2207
|
+
});
|
|
2208
|
+
if (blocked) {
|
|
2209
|
+
externalBlockerRefusedOnce = true;
|
|
2210
|
+
return blocked;
|
|
2211
|
+
}
|
|
2212
|
+
return checkTierPersonaGate(taskTier, persona);
|
|
2213
|
+
}
|
|
2081
2214
|
// ── Per-turn cost report (/af-hub-report) ──
|
|
2082
2215
|
interface TurnReport {
|
|
2083
2216
|
startedAt: number;
|
|
@@ -2213,6 +2346,68 @@ APIs, commands, structure), say so in your final response so the docs can be upd
|
|
|
2213
2346
|
return root;
|
|
2214
2347
|
}
|
|
2215
2348
|
|
|
2349
|
+
/**
|
|
2350
|
+
* Move the PREVIOUS session's artifacts into `runs/<runId>/artifacts/` — a
|
|
2351
|
+
* namespace written once and never reused — record it in `runs/index.json`,
|
|
2352
|
+
* and prune to `run-history-keep` archives. Best-effort throughout: failing to
|
|
2353
|
+
* archive must never stop a session from starting, but it must also never
|
|
2354
|
+
* silently fall back to deleting the artifacts.
|
|
2355
|
+
*/
|
|
2356
|
+
function archivePreviousRun(): string | null {
|
|
2357
|
+
const root = artifactsRoot();
|
|
2358
|
+
if (!existsSync(root)) return null;
|
|
2359
|
+
let counts: Record<string, number> = {};
|
|
2360
|
+
let total = 0;
|
|
2361
|
+
try {
|
|
2362
|
+
for (const kind of ARTIFACT_KINDS) {
|
|
2363
|
+
const dir = safePathWithin(root, kind);
|
|
2364
|
+
if (!existsSync(dir)) continue;
|
|
2365
|
+
const n = readdirSync(dir).length;
|
|
2366
|
+
if (n > 0) counts[kind] = n;
|
|
2367
|
+
total += n;
|
|
2368
|
+
}
|
|
2369
|
+
} catch { /* unreadable tree — fall through and try the move anyway */ }
|
|
2370
|
+
if (total === 0) {
|
|
2371
|
+
// Nothing worth keeping: an empty layout is not history.
|
|
2372
|
+
try { rmSync(root, { recursive: true, force: true }); } catch {}
|
|
2373
|
+
return null;
|
|
2374
|
+
}
|
|
2375
|
+
const runId = makeRunId();
|
|
2376
|
+
try {
|
|
2377
|
+
const runsDir = safePathWithin(sessionDir, RUNS_DIRNAME);
|
|
2378
|
+
const runDir = safePathWithin(runsDir, runId);
|
|
2379
|
+
mkdirSync(runDir, { recursive: true });
|
|
2380
|
+
renameSync(root, safePathWithin(runDir, "artifacts"));
|
|
2381
|
+
const meta = buildRunMeta({
|
|
2382
|
+
runId,
|
|
2383
|
+
archivedAt: Date.now(),
|
|
2384
|
+
cwd: sessionDir,
|
|
2385
|
+
project: process.env.PI_COMS_PROJECT || null,
|
|
2386
|
+
workspace: process.env.HERDR_WORKSPACE_ID || null,
|
|
2387
|
+
artifactCounts: counts,
|
|
2388
|
+
});
|
|
2389
|
+
const metaPath = safePathWithin(runDir, "meta.json");
|
|
2390
|
+
writeFileSync(metaPath, JSON.stringify(meta, null, 2));
|
|
2391
|
+
// Written once, never rewritten: make that a file mode, not a promise.
|
|
2392
|
+
try { chmodSync(metaPath, 0o444); } catch {}
|
|
2393
|
+
|
|
2394
|
+
const indexPath = safePathWithin(runsDir, RUN_INDEX_FILENAME);
|
|
2395
|
+
let existing: any = null;
|
|
2396
|
+
try { existing = JSON.parse(readFileSync(indexPath, "utf-8")); } catch {}
|
|
2397
|
+
const index = appendRunIndex(existing, { runId, archivedAt: meta.archivedAt, artifactCounts: counts, project: meta.project, workspace: meta.workspace }, runHistoryKeep);
|
|
2398
|
+
writeFileSync(indexPath, JSON.stringify(index, null, 2));
|
|
2399
|
+
|
|
2400
|
+
for (const stale of pruneRunDirs(readdirSync(runsDir), runHistoryKeep)) {
|
|
2401
|
+
try { rmSync(safePathWithin(runsDir, stale), { recursive: true, force: true }); } catch {}
|
|
2402
|
+
}
|
|
2403
|
+
return runId;
|
|
2404
|
+
} catch {
|
|
2405
|
+
// The archive failed. Leave the artifacts exactly where they are rather
|
|
2406
|
+
// than deleting them — a stale tree is recoverable, a deleted one is not.
|
|
2407
|
+
return null;
|
|
2408
|
+
}
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2216
2411
|
function loadInputArtifacts(paths: string[] | undefined, ctx: any): InputArtifactPreview[] {
|
|
2217
2412
|
if (!paths || paths.length === 0) return [];
|
|
2218
2413
|
const root = ensureArtifactsLayout();
|
|
@@ -2371,7 +2566,13 @@ APIs, commands, structure), say so in your final response so the docs can be upd
|
|
|
2371
2566
|
// dirs (delegate children's events + sessions).
|
|
2372
2567
|
try { rmSync(safePathWithin(sessionDir, "findings"), { recursive: true, force: true }); } catch {}
|
|
2373
2568
|
try { rmSync(safePathWithin(sessionDir, "delegations"), { recursive: true, force: true }); } catch {}
|
|
2374
|
-
|
|
2569
|
+
// Artifacts are NOT ephemeral, and deleting them here is what made a
|
|
2570
|
+
// post-mortem record eleven specialist returns and two reviews as NOT
|
|
2571
|
+
// RECOVERABLE: the next session's `builder-run1.md` reused the same path as
|
|
2572
|
+
// the previous session's, and the wipe removed the originals first. Archive
|
|
2573
|
+
// the previous session's artifacts into an immutable per-run namespace
|
|
2574
|
+
// instead, then start this session with an empty tree.
|
|
2575
|
+
archivePreviousRun();
|
|
2375
2576
|
ensureArtifactsLayout();
|
|
2376
2577
|
// The assertion ledger is per-task and as ephemeral as the session that owns
|
|
2377
2578
|
// it — wipe on session start like findings/, then start with an empty ledger.
|
|
@@ -3138,6 +3339,7 @@ APIs, commands, structure), say so in your final response so the docs can be upd
|
|
|
3138
3339
|
## Dispatch protocol (agent-hub)
|
|
3139
3340
|
You are serving a dispatched task as a standing peer; the dispatcher only receives this reply, so make it your complete final answer.
|
|
3140
3341
|
- Clarification: if you need a HUMAN decision (ambiguity, missing input, contradiction, or a destructive/irreversible next step), do NOT guess — include line(s) of the form \`ASK_USER: <one clear English question>\`; you will be re-dispatched with the answers.
|
|
3342
|
+
${externalBlockedProtocol()}
|
|
3141
3343
|
- Deliverable-to-file: when your deliverable is a document (plan, review, critique, inventory, report) and your tools allow writing, write the full document to .pi/agent-sessions/artifacts/<kind>/${agentKey}-run${runNumber}.md (kinds: plans, reviews, inventories, evidence) — never repo-root ./artifacts/... — and finish with the artifact-relative path (artifacts/<kind>/${agentKey}-run${runNumber}.md) plus a digest of at most 10 lines.
|
|
3142
3344
|
- If the task includes acceptance assertions (A1, A2, ...), include the structured return from skills/orchestration-verification/SKILL.md.` +
|
|
3143
3345
|
buildRulesProtocol() + buildDocsProtocol();
|
|
@@ -3538,6 +3740,9 @@ You may emit multiple ASK_USER lines if you have several questions. The dispatch
|
|
|
3538
3740
|
will surface each to the human user in ${userLanguage} and re-dispatch you with the
|
|
3539
3741
|
answers. Do not invent values, do not pick "reasonable defaults" silently — ask.
|
|
3540
3742
|
|
|
3743
|
+
## External-blocker protocol
|
|
3744
|
+
${externalBlockedProtocol()}
|
|
3745
|
+
|
|
3541
3746
|
## Research protocol
|
|
3542
3747
|
If you need reconnaissance you cannot perform with your own tools (broad code search,
|
|
3543
3748
|
reading unfamiliar areas of the codebase, summarizing docs), DO NOT guess and DO NOT
|
|
@@ -4825,21 +5030,56 @@ Finish with the artifact-relative path plus a digest of no more than 10 lines. I
|
|
|
4825
5030
|
artifacts: Type.Optional(Type.Array(Type.String({ description: "Optional repo-relative or session-artifact-relative input artifact path. The hub injects only path + one-line preview; the specialist must read the file itself." }))),
|
|
4826
5031
|
scope: Type.Optional(Type.Array(Type.String({ description: "Optional advisory file scope globs for writable agents. Changes outside are reported in details.scopeViolations; nothing is auto-reverted. Also arms the drift watchdog's live out-of-scope rule." }))),
|
|
4827
5032
|
watchdog: Type.Optional(Type.Boolean({ description: "Force the drift watchdog on/off for THIS dispatch (default: per-agent /af-watchdog override, then the hub-wide setting)." })),
|
|
5033
|
+
review_reason: Type.Optional(Type.String({ description: "Why a documentation-only change needs a review gate (e.g. it publishes a credential, or states a contract other systems rely on). Only needed when dispatching a review persona with a docs-only `scope`." })),
|
|
4828
5034
|
}),
|
|
4829
5035
|
|
|
4830
5036
|
async execute(_toolCallId, params, _signal, onUpdate, ctx) {
|
|
4831
|
-
const { task, artifacts, scope, watchdog } = params as { agent: string; task: string; artifacts?: string[]; scope?: string[]; watchdog?: boolean };
|
|
5037
|
+
const { task, artifacts, scope, watchdog, review_reason } = params as { agent: string; task: string; artifacts?: string[]; scope?: string[]; watchdog?: boolean; review_reason?: string };
|
|
4832
5038
|
// Display names / underscores resolve to the persona slug key space, so
|
|
4833
5039
|
// `agent: "Test Engineer"` never burns a dispatch on a lookup error.
|
|
4834
5040
|
const agent = normalizeAgentInput((params as { agent: string }).agent);
|
|
4835
|
-
// Unclassified
|
|
5041
|
+
// Unclassified task: assume the default tier (outside strict, whose full
|
|
4836
5042
|
// contract runs uncapped by tiers). The prompt asks for set_task_tier
|
|
4837
5043
|
// FIRST; this is the fail-safe, not the intended path.
|
|
4838
|
-
if (
|
|
4839
|
-
|
|
4840
|
-
|
|
5044
|
+
if (taskTier === null && hubMode !== "strict") {
|
|
5045
|
+
taskTier = DEFAULT_TASK_TIER;
|
|
5046
|
+
taskTierAssumed = true;
|
|
5047
|
+
turnReport.tier = taskTier;
|
|
4841
5048
|
updateModeStatus();
|
|
4842
5049
|
}
|
|
5050
|
+
// Pre-flight refusals, in severity order, BEFORE anything is charged: an
|
|
5051
|
+
// unacknowledged external blocker, the tier's persona gate, the review-round
|
|
5052
|
+
// cap, then the docs-only lane. None of these reached a specialist, so none
|
|
5053
|
+
// of them costs a budget slot.
|
|
5054
|
+
const preflight = preflightGate(agent)
|
|
5055
|
+
?? checkReviewRoundCap(taskTier, agent, taskReviewRounds)
|
|
5056
|
+
?? checkDocsLane(agent, scope || [], review_reason);
|
|
5057
|
+
if (preflight) {
|
|
5058
|
+
turnReport.refusals++;
|
|
5059
|
+
sessionTotals.refusals++;
|
|
5060
|
+
return {
|
|
5061
|
+
content: [{ type: "text", text: preflight.message }],
|
|
5062
|
+
details: { agent, task, status: preflight.reason, reason: preflight.reason, elapsed: 0, exitCode: 1, fullOutput: "" },
|
|
5063
|
+
};
|
|
5064
|
+
}
|
|
5065
|
+
// Task-budget gate: the outer bound a turn window never provided. Checked
|
|
5066
|
+
// BEFORE the turn budget because it is the more severe stop — a new user
|
|
5067
|
+
// message reopens the turn window but not the task window.
|
|
5068
|
+
const taskRefusal = checkTaskBudget(
|
|
5069
|
+
"dispatch",
|
|
5070
|
+
taskCounters(),
|
|
5071
|
+
currentTaskBudget(),
|
|
5072
|
+
taskActiveElapsedMs(),
|
|
5073
|
+
taskTier,
|
|
5074
|
+
);
|
|
5075
|
+
if (taskRefusal) {
|
|
5076
|
+
turnReport.refusals++;
|
|
5077
|
+
sessionTotals.refusals++;
|
|
5078
|
+
return {
|
|
5079
|
+
content: [{ type: "text", text: taskRefusal.message }],
|
|
5080
|
+
details: { agent, task, status: "task_budget_refused", reason: taskRefusal.reason, elapsed: 0, exitCode: 1, fullOutput: "" },
|
|
5081
|
+
};
|
|
5082
|
+
}
|
|
4843
5083
|
// Turn-budget gate: refuse BEFORE any spawn. The dispatcher must stop,
|
|
4844
5084
|
// summarize, and ask the user; a new user turn opens a fresh window.
|
|
4845
5085
|
const budgetRefusal = checkTurnBudget(
|
|
@@ -4887,6 +5127,8 @@ Finish with the artifact-relative path plus a digest of no more than 10 lines. I
|
|
|
4887
5127
|
};
|
|
4888
5128
|
}
|
|
4889
5129
|
turnDispatchCount++;
|
|
5130
|
+
taskDispatchCount++;
|
|
5131
|
+
if (isReviewPersona(agent)) taskReviewRounds++;
|
|
4890
5132
|
sessionTotals.dispatches++;
|
|
4891
5133
|
updateModeStatus();
|
|
4892
5134
|
let writableTracked = false;
|
|
@@ -4917,7 +5159,14 @@ Finish with the artifact-relative path plus a digest of no more than 10 lines. I
|
|
|
4917
5159
|
scopeSnapshot = snapshotWorktree(ctx.cwd || process.cwd());
|
|
4918
5160
|
}
|
|
4919
5161
|
|
|
4920
|
-
|
|
5162
|
+
// A review is a gate, and a gate has a size. Unbounded review authority
|
|
5163
|
+
// ratchets: each round's findings become plan invariants, and the larger
|
|
5164
|
+
// plan justifies another round. The cap binds BLOCKING findings only —
|
|
5165
|
+
// everything else is still reported, just not as a gate.
|
|
5166
|
+
const findingClause = reviewBudgetClause(taskTier, agent);
|
|
5167
|
+
const dispatchedTask = findingClause ? `${task}\n\n${findingClause}` : task;
|
|
5168
|
+
|
|
5169
|
+
let result = await dispatchAgent(agent, dispatchedTask, ctx, inputArtifacts, scopeGlobs, watchdog);
|
|
4921
5170
|
let dispatchBilled = result.billed ?? 0;
|
|
4922
5171
|
let dispatchOut = result.out ?? 0;
|
|
4923
5172
|
|
|
@@ -4927,9 +5176,25 @@ Finish with the artifact-relative path plus a digest of no more than 10 lines. I
|
|
|
4927
5176
|
// session with the paths. The dispatcher only ever sees a short notice,
|
|
4928
5177
|
// keeping its context clean of raw findings.
|
|
4929
5178
|
const researchRounds: { questions: string[]; files: string[] }[] = [];
|
|
5179
|
+
let autoResearchTaskCapped = false;
|
|
4930
5180
|
while (result.exitCode === 0 && researchRounds.length < MAX_AUTO_RESEARCH_ROUNDS) {
|
|
4931
|
-
|
|
5181
|
+
// The auto-pipe is exempt from the TURN budget (it is hub mechanics,
|
|
5182
|
+
// not a dispatcher decision, and must not steal the dispatcher's
|
|
5183
|
+
// slots) but NOT from the TASK envelope. At 2 rounds x 4 questions per
|
|
5184
|
+
// dispatch and 18 dispatches per task, leaving it uncounted would put
|
|
5185
|
+
// 144 research runs inside the bound that is meant to be the outer one.
|
|
5186
|
+
const researchLeft = remainingTaskResearch(currentTaskBudget(), taskCounters());
|
|
5187
|
+
if (researchLeft === 0) {
|
|
5188
|
+
autoResearchTaskCapped = true;
|
|
5189
|
+
break;
|
|
5190
|
+
}
|
|
5191
|
+
const questionCap = researchLeft == null
|
|
5192
|
+
? MAX_AUTO_RESEARCH_QUESTIONS
|
|
5193
|
+
: Math.min(MAX_AUTO_RESEARCH_QUESTIONS, researchLeft);
|
|
5194
|
+
const researchQs = extractNeedsResearch(result.output).slice(0, questionCap);
|
|
4932
5195
|
if (researchQs.length === 0) break;
|
|
5196
|
+
taskResearchCount += researchQs.length;
|
|
5197
|
+
updateModeStatus();
|
|
4933
5198
|
|
|
4934
5199
|
if (onUpdate) {
|
|
4935
5200
|
onUpdate({
|
|
@@ -5053,6 +5318,12 @@ Finish with the artifact-relative path plus a digest of no more than 10 lines. I
|
|
|
5053
5318
|
? `\n\n⚠ ${agent} still requests research (${unresolved.length} question(s)) but the auto-research budget is exhausted. ` +
|
|
5054
5319
|
`Run spawn_research yourself and re-dispatch with the findings, or simplify the task.`
|
|
5055
5320
|
: "";
|
|
5321
|
+
const autoResearchTaskNotice = autoResearchTaskCapped
|
|
5322
|
+
? `\n\n⚠ ${agent} paused for research, but the TASK research envelope is spent ` +
|
|
5323
|
+
`(${taskResearchCount}/${currentTaskBudget().maxResearch}) — no helper was spawned and the specialist ` +
|
|
5324
|
+
`was not resumed. Its questions are unanswered. Narrow the task so it can proceed on what it has, ` +
|
|
5325
|
+
`or open a new task window with /af-new-task if this is genuinely different work.`
|
|
5326
|
+
: "";
|
|
5056
5327
|
|
|
5057
5328
|
const returnPathNotice = returnPath ? `\n\nFull specialist output: ${returnPath}` : "";
|
|
5058
5329
|
// Named as a delivery failure, not a result: the run did not answer.
|
|
@@ -5079,6 +5350,42 @@ Finish with the artifact-relative path plus a digest of no more than 10 lines. I
|
|
|
5079
5350
|
: "";
|
|
5080
5351
|
const scopeNotice = scopeNoticeText(scopeViolations);
|
|
5081
5352
|
const contractNotice = contractNoticeText(contractNotices);
|
|
5353
|
+
// External blockers arm the circuit breaker: the NEXT dispatch is refused
|
|
5354
|
+
// until the human has been addressed. Recording it here (not in the
|
|
5355
|
+
// dispatcher's reading of the prose) is the point — a blocker that only
|
|
5356
|
+
// exists in a summary gets routed around.
|
|
5357
|
+
const reportedBlockers = extractExternalBlockers(result.output);
|
|
5358
|
+
let externalBlockerNotice = "";
|
|
5359
|
+
if (reportedBlockers.length > 0) {
|
|
5360
|
+
for (const what of reportedBlockers) {
|
|
5361
|
+
if (!externalBlockers.some(b => b.what === what)) externalBlockers.push({ agent, what });
|
|
5362
|
+
}
|
|
5363
|
+
externalBlockerAcknowledged = false;
|
|
5364
|
+
externalBlockerRefusedOnce = false;
|
|
5365
|
+
externalBlockerNotice = `\n\n⛔ ${agent} reported an EXTERNAL BLOCKER — something outside the fleet's reach is missing:\n` +
|
|
5366
|
+
reportedBlockers.map((w, i) => ` ${i + 1}. ${w}`).join("\n") +
|
|
5367
|
+
`\nThe next dispatch/research call is refused until you escalate this to the human. ` +
|
|
5368
|
+
`Do not build a substitute for the missing fact.`;
|
|
5369
|
+
}
|
|
5370
|
+
// Review accounting: count what came back and say so when it exceeds the
|
|
5371
|
+
// tier's cap. The hub does NOT reclassify findings — no rule it can
|
|
5372
|
+
// evaluate tells "invents a manifest" from "this leaks a credential",
|
|
5373
|
+
// and demoting the second by position is worse than tolerating the
|
|
5374
|
+
// first. The enforcement is the review-ROUND cap above, which needs no
|
|
5375
|
+
// judgement about content.
|
|
5376
|
+
let findingNotice = "";
|
|
5377
|
+
if (isReviewPersona(agent)) {
|
|
5378
|
+
findingNotice = findingBudgetNotice(
|
|
5379
|
+
agent,
|
|
5380
|
+
blockingFindingCap(taskTier),
|
|
5381
|
+
countReviewFindings(result.output),
|
|
5382
|
+
taskReviewRounds,
|
|
5383
|
+
reviewRoundCap(taskTier),
|
|
5384
|
+
) || "";
|
|
5385
|
+
}
|
|
5386
|
+
// A documentation-only dispatch closes on the writer's own verification.
|
|
5387
|
+
const docsNotice = docsLaneNotice(agent, scopeGlobs);
|
|
5388
|
+
const docsLaneText = docsNotice ? `\n\n${docsNotice}` : "";
|
|
5082
5389
|
// An extracted block is labelled every time it is shown: it was restated
|
|
5083
5390
|
// by a cheap pass, not declared by the specialist, and it must never be
|
|
5084
5391
|
// mistaken for first-hand evidence when gating on it.
|
|
@@ -5091,7 +5398,7 @@ Finish with the artifact-relative path plus a digest of no more than 10 lines. I
|
|
|
5091
5398
|
: truncated;
|
|
5092
5399
|
|
|
5093
5400
|
return {
|
|
5094
|
-
content: [{ type: "text", text: `${summary}${questionsNotice}${researchNotice}${budgetNotice}${returnPathNotice}${pendingNotice}${failurePathNotice}${artifactKindNotice}${contextNotice}${scopeNotice}\n\n${digest}` }],
|
|
5401
|
+
content: [{ type: "text", text: `${summary}${externalBlockerNotice}${questionsNotice}${researchNotice}${budgetNotice}${autoResearchTaskNotice}${returnPathNotice}${pendingNotice}${failurePathNotice}${artifactKindNotice}${contextNotice}${scopeNotice}${findingNotice}${docsLaneText}\n\n${digest}` }],
|
|
5095
5402
|
details: {
|
|
5096
5403
|
agent,
|
|
5097
5404
|
task,
|
|
@@ -5193,6 +5500,34 @@ Finish with the artifact-relative path plus a digest of no more than 10 lines. I
|
|
|
5193
5500
|
async execute(_toolCallId, params, _signal, onUpdate, ctx) {
|
|
5194
5501
|
const { task, persona, model, artifacts } = params as { task: string; persona?: string; model?: string; artifacts?: string[] };
|
|
5195
5502
|
|
|
5503
|
+
// Pre-flight refusals before anything is charged: an unacknowledged
|
|
5504
|
+
// external blocker, then the tier's persona gate (deep-researcher is the
|
|
5505
|
+
// most expensive helper in the system and is not a trivial-tier tool).
|
|
5506
|
+
const preflight = preflightGate(persona || "");
|
|
5507
|
+
if (preflight) {
|
|
5508
|
+
turnReport.refusals++;
|
|
5509
|
+
sessionTotals.refusals++;
|
|
5510
|
+
return {
|
|
5511
|
+
content: [{ type: "text", text: preflight.message }],
|
|
5512
|
+
details: { status: preflight.reason, reason: preflight.reason },
|
|
5513
|
+
};
|
|
5514
|
+
}
|
|
5515
|
+
// Task-budget gate: checked before the turn budget (the more severe stop).
|
|
5516
|
+
const taskRefusal = checkTaskBudget(
|
|
5517
|
+
"research",
|
|
5518
|
+
taskCounters(),
|
|
5519
|
+
currentTaskBudget(),
|
|
5520
|
+
taskActiveElapsedMs(),
|
|
5521
|
+
taskTier,
|
|
5522
|
+
);
|
|
5523
|
+
if (taskRefusal) {
|
|
5524
|
+
turnReport.refusals++;
|
|
5525
|
+
sessionTotals.refusals++;
|
|
5526
|
+
return {
|
|
5527
|
+
content: [{ type: "text", text: taskRefusal.message }],
|
|
5528
|
+
details: { status: "task_budget_refused", reason: taskRefusal.reason },
|
|
5529
|
+
};
|
|
5530
|
+
}
|
|
5196
5531
|
// Turn-budget gate (dispatcher-initiated research only — the auto-research
|
|
5197
5532
|
// pipe and the /af-research command are exempt).
|
|
5198
5533
|
const budgetRefusal = checkTurnBudget(
|
|
@@ -5246,6 +5581,7 @@ Finish with the artifact-relative path plus a digest of no more than 10 lines. I
|
|
|
5246
5581
|
}
|
|
5247
5582
|
|
|
5248
5583
|
turnResearchCount++;
|
|
5584
|
+
taskResearchCount++;
|
|
5249
5585
|
turnReport.research++;
|
|
5250
5586
|
sessionTotals.research++;
|
|
5251
5587
|
updateModeStatus();
|
|
@@ -5342,28 +5678,42 @@ Finish with the artifact-relative path plus a digest of no more than 10 lines. I
|
|
|
5342
5678
|
name: "set_task_tier",
|
|
5343
5679
|
label: "Set Task Tier",
|
|
5344
5680
|
description:
|
|
5345
|
-
"Classify
|
|
5681
|
+
"Classify the CURRENT TASK before your first dispatch: trivial (one obvious, low-risk change — 1 dispatch), small (a contained change, no planning pipeline — 2 dispatches), feature (a normal multi-step feature — 6 dispatches), project (a large effort — mode budget applies). The tier persists across user messages and moves by ratchet: LOWERING it is always free, RAISING it requires `reason` naming what the ask turned out to contain. Pass `new_task: true` only when the human has moved on to a genuinely different piece of work — it also resets the task budget.",
|
|
5346
5682
|
parameters: Type.Object({
|
|
5347
5683
|
tier: Type.String({ description: "One of: trivial | small | feature | project" }),
|
|
5348
|
-
reason: Type.Optional(Type.String({ description: "One line on why this tier fits the ask." })),
|
|
5684
|
+
reason: Type.Optional(Type.String({ description: "One line on why this tier fits the ask. REQUIRED when raising the tier above the current one." })),
|
|
5685
|
+
new_task: Type.Optional(Type.Boolean({ description: "The human moved on to a different piece of work: clears the task budget, the tier, and the duplicate guard. Not for a correction or a follow-up on the same work." })),
|
|
5349
5686
|
}),
|
|
5350
5687
|
async execute(_callId, params, _signal, _onUpdate, _ctx) {
|
|
5351
|
-
const { tier, reason } = params as { tier: string; reason?: string };
|
|
5352
|
-
|
|
5353
|
-
|
|
5688
|
+
const { tier, reason, new_task } = params as { tier: string; reason?: string; new_task?: boolean };
|
|
5689
|
+
if (new_task) resetTaskWindow(null);
|
|
5690
|
+
// An ASSUMED tier is the hub's fail-safe, not a declaration to ratchet
|
|
5691
|
+
// against: the dispatcher's own first triage must not be refused as an
|
|
5692
|
+
// "escalation" for lacking a reason it had no way to know it needed.
|
|
5693
|
+
const change = applyTierChange(taskTierAssumed ? null : taskTier, tier, reason);
|
|
5694
|
+
if (!change.ok) {
|
|
5354
5695
|
return {
|
|
5355
|
-
content: [{ type: "text" as const, text:
|
|
5356
|
-
details: { status: "error", tier:
|
|
5696
|
+
content: [{ type: "text" as const, text: change.message }],
|
|
5697
|
+
details: { status: "error", reason: change.reason, tier: change.tier },
|
|
5357
5698
|
};
|
|
5358
5699
|
}
|
|
5359
|
-
|
|
5360
|
-
|
|
5700
|
+
taskTier = change.tier;
|
|
5701
|
+
taskTierAssumed = false;
|
|
5702
|
+
turnReport.tier = change.tier;
|
|
5361
5703
|
updateModeStatus();
|
|
5362
5704
|
const b = currentBudget();
|
|
5705
|
+
const tb = currentTaskBudget();
|
|
5363
5706
|
const cap = (n: number | null) => (n == null ? "unlimited" : String(n));
|
|
5707
|
+
const spent = `${taskDispatchCount}/${cap(tb.maxDispatches)} dispatches, ${taskResearchCount}/${cap(tb.maxResearch)} research`;
|
|
5364
5708
|
return {
|
|
5365
|
-
content: [{
|
|
5366
|
-
|
|
5709
|
+
content: [{
|
|
5710
|
+
type: "text" as const,
|
|
5711
|
+
text: `${change.message}${new_task ? " (new task window opened)" : ""}\n` +
|
|
5712
|
+
`Per turn: ${cap(b.maxDispatches)} dispatches, ${cap(b.maxResearch)} research. ` +
|
|
5713
|
+
`Whole task: ${spent} spent. ` +
|
|
5714
|
+
`Size the apparatus accordingly — do not spend a cap just because it exists.`,
|
|
5715
|
+
}],
|
|
5716
|
+
details: { status: "ok", tier: change.tier, escalated: change.escalated, newTask: !!new_task },
|
|
5367
5717
|
};
|
|
5368
5718
|
},
|
|
5369
5719
|
renderCall(args, theme) {
|
|
@@ -5963,11 +6313,56 @@ Finish with the artifact-relative path plus a digest of no more than 10 lines. I
|
|
|
5963
6313
|
}
|
|
5964
6314
|
}
|
|
5965
6315
|
|
|
6316
|
+
/** When the last hub-spawned pi peer was launched — input to the stale-token stagger. */
|
|
6317
|
+
let lastHubPiSpawnAt: number | null = null;
|
|
6318
|
+
|
|
6319
|
+
/** Last lines of a pane, for reporting why a spawn failed. Never throws. */
|
|
6320
|
+
async function paneTail(paneId: string, lines = 12): Promise<string> {
|
|
6321
|
+
try {
|
|
6322
|
+
const { read } = await herdrApi.paneRead({ pane_id: paneId, lines });
|
|
6323
|
+
return read?.text ?? "";
|
|
6324
|
+
} catch {
|
|
6325
|
+
return "";
|
|
6326
|
+
}
|
|
6327
|
+
}
|
|
6328
|
+
|
|
6329
|
+
/**
|
|
6330
|
+
* The peers.yaml declaration for a peer name, when the repo has one. A hub
|
|
6331
|
+
* spawn is handed a bare name, but the fleet may define that name as a
|
|
6332
|
+
* `runner: claude-code` peer or one that needs extra extensions — launching
|
|
6333
|
+
* a plain pi peer instead would silently produce a different agent.
|
|
6334
|
+
*/
|
|
6335
|
+
function declaredPeer(name: string): ReturnType<typeof findPeerByName> {
|
|
6336
|
+
const cwd = currentCtx?.cwd ?? process.cwd();
|
|
6337
|
+
try {
|
|
6338
|
+
const raw = fs.readFileSync(path.join(cwd, ".pi", "agents", "peers.yaml"), "utf-8");
|
|
6339
|
+
return findPeerByName(parsePeersYaml(raw), name);
|
|
6340
|
+
} catch {
|
|
6341
|
+
return undefined;
|
|
6342
|
+
}
|
|
6343
|
+
}
|
|
6344
|
+
|
|
6345
|
+
/** Seconds this spawn should sleep before launching pi (stale-OAuth lock race). */
|
|
6346
|
+
function spawnDelaySeconds(): number {
|
|
6347
|
+
let authRaw: string | undefined;
|
|
6348
|
+
try {
|
|
6349
|
+
authRaw = fs.readFileSync(path.join(os.homedir(), ".pi", "agent", "auth.json"), "utf-8");
|
|
6350
|
+
} catch {
|
|
6351
|
+
authRaw = undefined;
|
|
6352
|
+
}
|
|
6353
|
+
return spawnStaggerSeconds({
|
|
6354
|
+
needed: oauthNeedsWarmup(authRaw),
|
|
6355
|
+
lastSpawnAt: lastHubPiSpawnAt,
|
|
6356
|
+
now: Date.now(),
|
|
6357
|
+
warmupSeconds: WARMUP_SECONDS,
|
|
6358
|
+
});
|
|
6359
|
+
}
|
|
6360
|
+
|
|
5966
6361
|
pi.registerTool({
|
|
5967
6362
|
name: "herdr_spawn_peer",
|
|
5968
6363
|
label: "Herdr Spawn Peer",
|
|
5969
6364
|
description:
|
|
5970
|
-
"Spawn a pane in the CURRENT herdr workspace: either a peers.yaml-style coms peer (persona [+ name/model], launched via `just _peer`) or a raw command pane. A persona peer boots IDLE and does nothing until you coms_send to it — spawning delivers no work. The call waits (bounded) for the peer to register and returns `peer_ready` plus its coms name, or `peer_ready: false` with the
|
|
6365
|
+
"Spawn a pane in the CURRENT herdr workspace: either a peers.yaml-style coms peer (persona [+ name/model], launched via `just _peer`) or a raw command pane. The peer joins THIS session's coms project pool, and a name declared in .pi/agents/peers.yaml keeps its declared runner/extensions. A persona peer boots IDLE and does nothing until you coms_send to it — spawning delivers no work. The call waits (bounded) for the peer to register and returns `peer_ready` plus its coms name, or `peer_ready: false` with the pane's last output — treat that as a failed start, not a slow one. Spawn one only immediately before the first message you will send it; a peer that receives no work is named in the session digest.",
|
|
5971
6366
|
parameters: Type.Object({
|
|
5972
6367
|
persona: Type.Optional(Type.String({ description: "Persona under agents/ (e.g. researcher). Omit for a raw command pane." })),
|
|
5973
6368
|
name: Type.String({ description: "Pane label; for persona peers also the coms peer name." }),
|
|
@@ -5984,37 +6379,72 @@ Finish with the artifact-relative path plus a digest of no more than 10 lines. I
|
|
|
5984
6379
|
return { content: [{ type: "text" as const, text: "not inside a herdr pane." }], details: { error: "no pane" } };
|
|
5985
6380
|
}
|
|
5986
6381
|
try {
|
|
6382
|
+
const cwd = currentCtx?.cwd ?? process.cwd();
|
|
6383
|
+
const env: Record<string, string> = {};
|
|
5987
6384
|
let argv: string[];
|
|
5988
6385
|
if (params.persona) {
|
|
5989
|
-
|
|
6386
|
+
// The peer joins THIS hub's coms pool. Defaulting to "default"
|
|
6387
|
+
// (as this once did) puts it in a pool the hub cannot see, so it
|
|
6388
|
+
// never registers no matter how long the readiness wait runs.
|
|
6389
|
+
const declared = declaredPeer(params.name);
|
|
6390
|
+
argv = peerCommand(
|
|
6391
|
+
{
|
|
6392
|
+
persona: params.persona,
|
|
6393
|
+
name: params.name,
|
|
6394
|
+
model: params.model ?? declared?.model,
|
|
6395
|
+
extensions: declared?.extensions,
|
|
6396
|
+
runner: declared?.runner,
|
|
6397
|
+
},
|
|
6398
|
+
"hub-spawned",
|
|
6399
|
+
undefined,
|
|
6400
|
+
identity?.project ?? DEFAULT_PROJECT,
|
|
6401
|
+
);
|
|
6402
|
+
if (declared?.env_file) {
|
|
6403
|
+
Object.assign(env, parseEnvFile(fs.readFileSync(resolveEnvFilePath(declared.env_file, cwd), "utf-8"), declared.env_file));
|
|
6404
|
+
}
|
|
6405
|
+
const delay = declared?.runner === "claude-code" ? 0 : spawnDelaySeconds();
|
|
6406
|
+
if (delay > 0) env[STAGGER_ENV_VAR] = String(delay);
|
|
5990
6407
|
} else if (params.command) {
|
|
5991
6408
|
argv = ["bash", "-lc", params.command];
|
|
5992
6409
|
} else {
|
|
5993
6410
|
return { content: [{ type: "text" as const, text: "pass persona (peer) or command (raw pane)." }], details: { error: "bad args" } };
|
|
5994
6411
|
}
|
|
6412
|
+
// pane.split takes no command — it opens a shell in `cwd`.
|
|
5995
6413
|
const { pane } = await herdrApi.paneSplit({
|
|
5996
6414
|
target_pane_id: ownPane,
|
|
5997
6415
|
direction: params.direction ?? "right",
|
|
5998
|
-
|
|
5999
|
-
|
|
6416
|
+
cwd,
|
|
6417
|
+
...(Object.keys(env).length > 0 ? { env } : {}),
|
|
6000
6418
|
focus: false,
|
|
6001
6419
|
});
|
|
6002
6420
|
try { await herdrApi.paneRename(pane.pane_id, params.name); } catch { /* cosmetic */ }
|
|
6421
|
+
// …so the argv is typed into that shell once it shows a prompt.
|
|
6422
|
+
const launch = await launchPeerInPane(herdrApi, pane.pane_id, argv);
|
|
6423
|
+
if (params.persona) lastHubPiSpawnAt = Date.now();
|
|
6424
|
+
const promptNote = launch.promptSeen
|
|
6425
|
+
? ""
|
|
6426
|
+
: `\n⚠ pane ${pane.pane_id} showed no shell prompt within ${Math.round(PANE_PROMPT_TIMEOUT_MS / 1000)}s; the command was sent anyway.`;
|
|
6003
6427
|
// A raw command pane is not a coms peer — nothing to wait for and
|
|
6004
6428
|
// nothing to sweep. A persona peer is only useful once addressable,
|
|
6005
6429
|
// so report that verdict instead of a bare pane id.
|
|
6006
6430
|
if (!params.persona) {
|
|
6007
6431
|
return {
|
|
6008
|
-
content: [{ type: "text" as const, text: `spawned pane ${pane.pane_id} (${params.name}): ${argv.join(" ")}` }],
|
|
6009
|
-
details: { pane_id: pane.pane_id, name: params.name },
|
|
6432
|
+
content: [{ type: "text" as const, text: `spawned pane ${pane.pane_id} (${params.name}): ${argv.join(" ")}${promptNote}` }],
|
|
6433
|
+
details: { pane_id: pane.pane_id, name: params.name, prompt_seen: launch.promptSeen },
|
|
6010
6434
|
};
|
|
6011
6435
|
}
|
|
6012
6436
|
hubSpawnedPeers.set(params.name.toLowerCase(), { name: params.name, paneId: pane.pane_id, addressed: false });
|
|
6013
6437
|
const { found, waitedMs } = await waitForPeerRegistration(params.name);
|
|
6014
|
-
const verdict = peerReadyVerdict({
|
|
6438
|
+
const verdict = peerReadyVerdict({
|
|
6439
|
+
name: params.name,
|
|
6440
|
+
paneId: pane.pane_id,
|
|
6441
|
+
found,
|
|
6442
|
+
waitedMs,
|
|
6443
|
+
paneTail: found ? undefined : await paneTail(pane.pane_id),
|
|
6444
|
+
});
|
|
6015
6445
|
return {
|
|
6016
|
-
content: [{ type: "text" as const, text: `spawned pane ${pane.pane_id} (${params.name}): ${argv.join(" ")}\n\n${verdict.message}` }],
|
|
6017
|
-
details: { pane_id: pane.pane_id, name: params.name, ...verdict },
|
|
6446
|
+
content: [{ type: "text" as const, text: `spawned pane ${pane.pane_id} (${params.name}): ${argv.join(" ")}${promptNote}\n\n${verdict.message}` }],
|
|
6447
|
+
details: { pane_id: pane.pane_id, name: params.name, prompt_seen: launch.promptSeen, ...verdict },
|
|
6018
6448
|
};
|
|
6019
6449
|
} catch (err) {
|
|
6020
6450
|
const m = err instanceof Error ? err.message : String(err);
|
|
@@ -6304,6 +6734,32 @@ Finish with the artifact-relative path plus a digest of no more than 10 lines. I
|
|
|
6304
6734
|
},
|
|
6305
6735
|
});
|
|
6306
6736
|
|
|
6737
|
+
// ── /af-new-task: open a fresh TASK window ──
|
|
6738
|
+
// The task budget is deliberately immune to a user message — a steering
|
|
6739
|
+
// message is a correction, not a new ask, and resetting on it is what let a
|
|
6740
|
+
// run spend a fresh envelope per correction. Opening a new window is
|
|
6741
|
+
// therefore an explicit, human decision, and this is where it is made.
|
|
6742
|
+
pi.registerCommand("af-new-task", {
|
|
6743
|
+
description: "Open a fresh task window: clears the task budget, the task tier, the duplicate guard, and any external-blocker stop. Use when moving on to different work — not for a correction to the current work.",
|
|
6744
|
+
handler: async (args, ctx) => {
|
|
6745
|
+
widgetCtx = ctx;
|
|
6746
|
+
const label = (args || "").trim() || null;
|
|
6747
|
+
const spentDispatches = taskDispatchCount;
|
|
6748
|
+
const spentResearch = taskResearchCount;
|
|
6749
|
+
const spentReviews = taskReviewRounds;
|
|
6750
|
+
const spentMin = Math.round(taskActiveElapsedMs() / 60_000);
|
|
6751
|
+
const priorTier = taskTier;
|
|
6752
|
+
resetTaskWindow(label);
|
|
6753
|
+
ctx.ui.notify(
|
|
6754
|
+
`New task window${label ? `: ${label}` : ""}\n` +
|
|
6755
|
+
`Previous task${priorTier ? ` (tier ${priorTier})` : ""} spent ${spentDispatches} dispatches, ` +
|
|
6756
|
+
`${spentResearch} research, ${spentReviews} review round(s), ${spentMin} min active.\n` +
|
|
6757
|
+
`Tier is unset — the dispatcher re-triages on its next dispatch.`,
|
|
6758
|
+
"success",
|
|
6759
|
+
);
|
|
6760
|
+
},
|
|
6761
|
+
});
|
|
6762
|
+
|
|
6307
6763
|
pi.registerCommand("af-watchdog", {
|
|
6308
6764
|
description: "Drift watchdog: /af-watchdog [on|off|auto] hub-wide, /af-watchdog <agent> [on|off|clear] per agent, no args to show",
|
|
6309
6765
|
handler: async (args, ctx) => {
|
|
@@ -7560,12 +8016,20 @@ Finish with the artifact-relative path plus a digest of no more than 10 lines. I
|
|
|
7560
8016
|
// ask_user call with its tool_execution start/end so /af-agents-history can subtract
|
|
7561
8017
|
// that "away from keyboard" time from the dispatcher's real work.
|
|
7562
8018
|
pi.on("tool_execution_start", async (event) => {
|
|
7563
|
-
if (event.toolName
|
|
8019
|
+
if (event.toolName !== "ask_user") return;
|
|
8020
|
+
askUserStarts.set(event.toolCallId, Date.now());
|
|
8021
|
+
// Asking the human IS the escalation the external-blocker breaker demands:
|
|
8022
|
+
// once it is under way, the gate opens.
|
|
8023
|
+
externalBlockerAcknowledged = true;
|
|
8024
|
+
externalBlockerRefusedOnce = false;
|
|
7564
8025
|
});
|
|
7565
8026
|
pi.on("tool_execution_end", async (event) => {
|
|
7566
8027
|
if (event.toolName !== "ask_user") return;
|
|
7567
8028
|
const startedAt = askUserStarts.get(event.toolCallId);
|
|
7568
8029
|
askUserStarts.delete(event.toolCallId);
|
|
8030
|
+
// The task clock bills active time only — the human's answer is not the
|
|
8031
|
+
// fleet's work, and billing it is what would false-stop a steered session.
|
|
8032
|
+
if (startedAt) turnAskUserWaitMs += Math.max(0, Date.now() - startedAt);
|
|
7569
8033
|
if (startedAt == null) return;
|
|
7570
8034
|
const interval: [number, number] = [startedAt, Date.now()];
|
|
7571
8035
|
// Attach to the live dispatcher entry, or buffer until one is created this turn.
|
|
@@ -7585,18 +8049,28 @@ Finish with the artifact-relative path plus a digest of no more than 10 lines. I
|
|
|
7585
8049
|
currentOrchestratorEntry.endedAt = Date.now();
|
|
7586
8050
|
if (currentOrchestratorEntry.status === "running") currentOrchestratorEntry.status = "done";
|
|
7587
8051
|
}
|
|
8052
|
+
// Fold the turn that just ended into the task's active-time accumulator
|
|
8053
|
+
// before the clock is re-based; inter-turn idle is never charged because
|
|
8054
|
+
// no turn is open across it.
|
|
8055
|
+
closeTurnActiveTime();
|
|
7588
8056
|
turnActive = true;
|
|
7589
8057
|
currentTurnStartedAt = Date.now();
|
|
7590
8058
|
currentOrchestratorEntry = null;
|
|
7591
8059
|
askUserStarts.clear();
|
|
7592
8060
|
turnAskUserIntervals.length = 0;
|
|
7593
|
-
// Fresh turn → fresh budget window (mode
|
|
7594
|
-
//
|
|
7595
|
-
//
|
|
8061
|
+
// Fresh turn → fresh TURN budget window (mode persists across turns). The
|
|
8062
|
+
// TASK budget, the tier, and the external-blocker breaker deliberately do
|
|
8063
|
+
// NOT reset here: a steering message is a correction to the same work, not
|
|
8064
|
+
// a new ask, and resetting on it is precisely how a run spent eight fresh
|
|
8065
|
+
// dispatches per correction and never hit a bound. Only /af-new-task (or
|
|
8066
|
+
// set_task_tier `new_task: true`) opens a new task window.
|
|
7596
8067
|
turnDispatchCount = 0;
|
|
7597
8068
|
turnResearchCount = 0;
|
|
7598
|
-
turnTaskTier = null;
|
|
7599
8069
|
turnDispatchFingerprints.clear();
|
|
8070
|
+
// The human sent a message, so an external blocker has been surfaced to them
|
|
8071
|
+
// by definition — the breaker opens and re-arms on the next report.
|
|
8072
|
+
externalBlockerAcknowledged = true;
|
|
8073
|
+
externalBlockerRefusedOnce = false;
|
|
7600
8074
|
// Snapshot the previous turn's cost report before opening a fresh one.
|
|
7601
8075
|
if (turnReport.dispatches.length > 0 || turnReport.research > 0 || turnReport.refusals > 0) {
|
|
7602
8076
|
lastTurnReport = turnReport;
|
|
@@ -7701,6 +8175,7 @@ ask the human. You MUST instead:
|
|
|
7701
8175
|
// budgets in code (dispatch_agent/spawn_research refuse past them); the
|
|
7702
8176
|
// prompt teaches the dispatcher to plan within them instead of hitting them.
|
|
7703
8177
|
const budget = currentBudget();
|
|
8178
|
+
const taskBudget = currentTaskBudget();
|
|
7704
8179
|
const cap = (n: number | null) => (n == null ? "unlimited" : String(n));
|
|
7705
8180
|
const capMin = (ms: number | null) => (ms == null ? "unlimited" : `${Math.round(ms / 60_000)} min`);
|
|
7706
8181
|
const modeSection = `## Task triage (FIRST, before any dispatch)
|
|
@@ -7717,14 +8192,31 @@ to how interesting the work is.
|
|
|
7717
8192
|
file, a numbered breakdown), do NOT re-plan or re-spec it. Skip planner and
|
|
7718
8193
|
plan-reviewer; batch the plan's tasks straight to the builder and use the plan's own
|
|
7719
8194
|
acceptance criteria as the assertions.
|
|
8195
|
+
- A plan is a spec, NOT a mandate to execute all of it. When the plan is larger than what
|
|
8196
|
+
the user actually asked for, do the asked-for part and say which parts you left — the
|
|
8197
|
+
plan's existence is not consent to run its every gate. If a plan for a small ask has
|
|
8198
|
+
grown gates, manifests, or provenance machinery nobody requested, name that to the user
|
|
8199
|
+
instead of executing it.
|
|
7720
8200
|
- Using every persona is a smell, not a virtue: each dispatch must change the outcome.
|
|
7721
8201
|
If a dispatch's absence would change nothing, don't make it.
|
|
7722
|
-
|
|
7723
|
-
|
|
8202
|
+
- THE TIER IS THE TASK'S, NOT THE TURN'S. It survives the user's next message and moves by
|
|
8203
|
+
ratchet: lowering it is always free, raising it needs a \`reason\` naming what the ask
|
|
8204
|
+
turned out to contain. A correction or follow-up ("no, only the one line") is the SAME
|
|
8205
|
+
task — do not re-triage it upward, and do not pass \`new_task\` for it. At trivial/small
|
|
8206
|
+
tiers the hub refuses planner, plan-reviewer, architect, security-auditor and
|
|
8207
|
+
deep-researcher in code; that refusal is a signal to do the work, not to raise the tier.
|
|
8208
|
+
|
|
8209
|
+
## Execution mode: ${hubMode}${taskTier ? ` · tier: ${taskTier}` : ""}
|
|
7724
8210
|
Budgets for THIS user turn (enforced by the hub — exhausted budgets make dispatch_agent/
|
|
7725
8211
|
spawn_research refuse; a new user message opens a fresh window; /af-hub-mode switches mode):
|
|
7726
8212
|
- dispatch_agent calls: ${cap(budget.maxDispatches)} · spawn_research calls: ${cap(budget.maxResearch)}
|
|
7727
8213
|
- turn wall clock: ${capMin(budget.wallMs)} · per-run deadline: ${capMin(budget.agentTurnMs)}
|
|
8214
|
+
Budgets for the WHOLE TASK (${TASK_BUDGET_MULTIPLIER}× the turn envelope; NOT reset by a user message —
|
|
8215
|
+
only by /af-new-task or set_task_tier \`new_task: true\`). Spent so far:
|
|
8216
|
+
- dispatches ${taskDispatchCount}/${cap(taskBudget.maxDispatches)} · research ${taskResearchCount}/${cap(taskBudget.maxResearch)} · active time ${Math.round(taskActiveElapsedMs() / 60_000)}/${capMin(taskBudget.wallMs)} min
|
|
8217
|
+
- review rounds ${taskReviewRounds}/${cap(reviewRoundCap(taskTier))} (a review is a gate, not a loop)
|
|
8218
|
+
Exhausting the TASK budget is a hard stop: it means the work outgrew its envelope three
|
|
8219
|
+
times over, which is a re-scoping decision for the human, not something to spend through.
|
|
7728
8220
|
Plan within the budget: batch related work into ONE dispatch (a coherent slice of 4–6
|
|
7729
8221
|
plan tasks, not one dispatch per micro-task), and when a budget refusal comes back, STOP —
|
|
7730
8222
|
summarize progress and ask the user; never retry the refused call in the same turn.
|
|
@@ -7882,6 +8374,9 @@ This session runs inside a herdr workspace and can drive panes:
|
|
|
7882
8374
|
ready" and never addressed is an empty pane named like a worker. If you sent it no work
|
|
7883
8375
|
by the end of the turn, say so and offer to close it; the hub names unaddressed
|
|
7884
8376
|
hub-spawned peers in the session digest.
|
|
8377
|
+
- \`peer_ready: false\` is a FAILED start, not a slow one. The result carries the pane's last
|
|
8378
|
+
output — read it, then fix the cause or close the pane and spawn again. Never \`coms_send\`
|
|
8379
|
+
to a name that never registered, and never spawn a second peer to route around the first.
|
|
7885
8380
|
- \`herdr_read_pane\` is read-to-decide: peek at a worker/tool pane's recent output before
|
|
7886
8381
|
acting on it. It is NOT a messaging channel and NOT a status poll — \`coms_list\` already
|
|
7887
8382
|
reports each peer's \`pane_id\` and \`status\` (idle | working | booting), so check that
|
|
@@ -8207,6 +8702,13 @@ ${researchCatalog}`;
|
|
|
8207
8702
|
}
|
|
8208
8703
|
}
|
|
8209
8704
|
|
|
8705
|
+
// Per-project overrides are parsed BEFORE loadAgents: loadAgents archives the
|
|
8706
|
+
// previous session's artifacts, and that archive has to honor this project's
|
|
8707
|
+
// `run-history-keep` — reading it afterwards would apply the retention one
|
|
8708
|
+
// session late. Everything else the overrides drive is assigned below.
|
|
8709
|
+
const overrides = parseAgentTeamOverrides(_ctx.cwd);
|
|
8710
|
+
runHistoryKeep = overrides.runHistoryKeep;
|
|
8711
|
+
|
|
8210
8712
|
loadAgents(_ctx.cwd);
|
|
8211
8713
|
|
|
8212
8714
|
// Surface non-fatal persona frontmatter warnings (skipped subagents roles,
|
|
@@ -8222,8 +8724,8 @@ ${researchCatalog}`;
|
|
|
8222
8724
|
);
|
|
8223
8725
|
}
|
|
8224
8726
|
|
|
8225
|
-
//
|
|
8226
|
-
|
|
8727
|
+
// Apply the rest of the per-project overrides (user-facing language, persona
|
|
8728
|
+
// gate, models) — parsed above, before loadAgents.
|
|
8227
8729
|
userLanguage = overrides.language;
|
|
8228
8730
|
researchKeep = overrides.researchKeep;
|
|
8229
8731
|
reconSearchTimeoutMs = overrides.reconSearchTimeoutMs;
|
|
@@ -8233,8 +8735,8 @@ ${researchCatalog}`;
|
|
|
8233
8735
|
watchdogJudgeModel = overrides.watchdogJudgeModel;
|
|
8234
8736
|
turnDispatchCount = 0;
|
|
8235
8737
|
turnResearchCount = 0;
|
|
8236
|
-
|
|
8237
|
-
|
|
8738
|
+
// A new session is a new task by definition.
|
|
8739
|
+
resetTaskWindow(null);
|
|
8238
8740
|
updateModeStatus();
|
|
8239
8741
|
if (overrides.warnings.length > 0) {
|
|
8240
8742
|
_ctx.ui.notify(`agent-fleet-overrides warnings:\n${overrides.warnings.join("\n")}`, "warning");
|