@chankov/agent-fleet 2.0.13 → 2.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.pi/harnesses/agent-hub/README.md +9 -0
- package/.pi/harnesses/agent-hub/dispatch-triage-contract.ts +38 -0
- package/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +75 -0
- package/.pi/harnesses/agent-hub/dispatch-triage-policy.ts +29 -0
- package/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +53 -0
- package/.pi/harnesses/agent-hub/dispatch-triage-state.ts +15 -0
- package/.pi/harnesses/agent-hub/index.ts +40 -6
- package/.pi/harnesses/agent-hub/package.json +1 -1
- package/.pi/harnesses/agent-hub/prompts/context.ts +1 -0
- package/.pi/harnesses/agent-hub/prompts/system-prompt.ts +8 -1
- package/.pi/harnesses/agent-hub/system1-communication-store.ts +95 -0
- package/.pi/harnesses/agent-hub/system1-runtime.ts +5 -2
- package/.pi/harnesses/agent-hub/tools/context.ts +2 -0
- package/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +9 -3
- package/.pi/harnesses/agent-hub/tools/dispatch-triage.ts +16 -0
- package/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +29 -1
- package/.pi/harnesses/agent-hub/ui/system1-communication.ts +59 -0
- package/.pi/harnesses/agent-hub/work-mode.ts +2 -1
- package/.pi/harnesses/coms/package.json +1 -1
- package/.pi/harnesses/damage-control-continue/package.json +1 -1
- package/.pi/harnesses/lib/fleet-dashboard-view.ts +1 -1
- package/.pi/harnesses/lib/fleet-strip-controller.ts +2 -1
- package/.pi/harnesses/lib/fleet-strip-view.ts +1 -1
- package/.versions/2.0.14/.pi/agent-fleet/hermes/README.md +347 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/.versions/2.0.14/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
- package/.versions/2.0.14/.pi/agent-fleet/hooks/coms-stop-hook.mjs +84 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/coms-claude-bridge.ts +411 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/coms-cli.ts +425 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +413 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/fleet-codex-client.ts +69 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/fleet-codex-read.py +148 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/fleet.ts +216 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/flow.ts +157 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +210 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/fleet-codex-catalog.ts +63 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/fleet-codex-operations.ts +190 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/fleet-codex-session.ts +166 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/fleet-codex-transport.ts +124 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/fleet-command.ts +252 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/flow-command.ts +98 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +230 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/team-project.ts +178 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/lib/team-snapshot.ts +147 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/package-lock.json +35 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/package.json +9 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/peer-launch.ts +283 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/team-snapshot.ts +237 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/team-up.ts +378 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +179 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/env.ts +34 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/git.ts +96 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +125 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +130 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +34 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/quality.ts +64 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/run.ts +108 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/trace.ts +34 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +112 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
- package/.versions/2.0.14/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
- package/.versions/2.0.14/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/2.0.14/.pi/agents/model-profiles.yaml +134 -0
- package/.versions/2.0.14/.pi/agents/peers.yaml +147 -0
- package/.versions/2.0.14/.pi/agents/teams.yaml +41 -0
- package/.versions/2.0.14/.pi/agents/voices.yaml +13 -0
- package/.versions/2.0.14/.pi/damage-control-rules.yaml +297 -0
- package/.versions/2.0.14/.pi/extensions/btw/README.md +120 -0
- package/.versions/2.0.14/.pi/extensions/btw/index.ts +914 -0
- package/.versions/2.0.14/.pi/extensions/btw/package.json +6 -0
- package/.versions/2.0.14/.pi/extensions/btw/state.js +179 -0
- package/.versions/2.0.14/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
- package/.versions/2.0.14/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
- package/.versions/2.0.14/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/2.0.14/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/2.0.14/.pi/extensions/compact-and-continue/index.ts +120 -0
- package/.versions/2.0.14/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/2.0.14/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/2.0.14/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/2.0.14/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/2.0.14/.pi/extensions/package-lock.json +1175 -0
- package/.versions/2.0.14/.pi/extensions/package.json +9 -0
- package/.versions/2.0.14/.pi/extensions/pi-voice-stt/README.md +224 -0
- package/.versions/2.0.14/.pi/extensions/pi-voice-stt/config.ts +198 -0
- package/.versions/2.0.14/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/2.0.14/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/2.0.14/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/2.0.14/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/2.0.14/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/README.md +1369 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/acceptance.ts +199 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/access-approval.ts +135 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/artifacts.js +146 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/assertion-ledger.js +67 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/assist-profile.ts +16 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/backend-policy.js +174 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/budget-continuation.ts +13 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/budget-recovery.ts +214 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/capability-packs.ts +184 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/budget-continue.ts +10 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/context.ts +45 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/models.ts +10 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/recover.ts +52 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/config/agents.ts +178 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/config/model-profiles.ts +236 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/config/overrides.ts +160 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +221 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/context/budgets.ts +204 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/context-pressure.ts +191 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/context-window.js +108 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/debate-command.ts +176 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/delegate.ts +467 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/deterministic-fs.ts +127 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/dispatch-coms.ts +252 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/dispatch-native-complete.ts +169 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +248 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +231 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/dispatch-native-types.ts +257 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/dispatch-native.ts +226 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/dispatch-triage-contract.ts +38 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +75 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/dispatch-triage-policy.ts +29 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +53 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/dispatch-triage-state.ts +15 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/docs-lane.js +122 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/drift-watchdog.js +349 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/execution-evidence.ts +80 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/external-blocker.js +85 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/filesystem-tool.ts +73 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/fixtures/registration-surface.json +62 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/footer.ts +30 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/helpers.ts +270 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/hub-state-audit.js +65 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/index.ts +2370 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/input/completions.ts +82 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/input/shortcuts.ts +20 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +125 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +143 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +74 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/no-progress.ts +359 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/policy/models.ts +153 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/policy/roster.ts +94 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/policy/work-mode.ts +126 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/poll-command.ts +176 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/presentation.ts +48 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/proactive-config.ts +40 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/proactive-local.ts +88 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/proactive-observer.ts +105 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/proactive-rules.ts +143 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/proactive-runtime.ts +316 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/proactive-snapshot.ts +243 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/proactive-types.ts +63 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/process-obligations.ts +57 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/prompts/context.ts +54 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/prompts/fragments.ts +118 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/prompts/system-prompt.ts +122 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/reconcile.ts +26 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/recover-policy.ts +27 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/recover-state.ts +104 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/recovery-contract.ts +80 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/research/controls.ts +74 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/research/runtime.ts +195 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/research/spawn-run.ts +174 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/return-contract.js +327 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/return-extract.js +77 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/review-findings.js +104 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/run-budget.js +542 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/run-namespace.js +93 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/runtime-test-check.ts +54 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/scope-gate.js +123 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/session-audit.ts +227 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/session-start.ts +42 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/spawn.ts +526 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/system1-activity.ts +510 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/system1-communication-store.ts +95 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/system1-report.ts +225 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/system1-runtime.ts +279 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/task-resume-contract.ts +70 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/timeline.ts +72 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +68 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/tool-catalog-state.ts +123 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/tools/action-executors.ts +185 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/tools/context.ts +144 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +88 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +498 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/tools/dispatch-triage.ts +16 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/tools/fleet-tools.ts +200 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/tools/herdr-executors.ts +86 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/tools/run-flow.ts +136 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/tools/spawn-research.ts +65 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/tools/verification-contract.ts +80 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/tsconfig.json +22 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/types.ts +66 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/ui/context-budget.ts +87 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/ui/detail-panel.ts +192 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +152 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/ui/fleet-source.ts +175 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/ui/grid.ts +159 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/ui/history.ts +234 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/ui/system1-communication.ts +59 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/version.ts +42 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/work-mode.ts +174 -0
- package/.versions/2.0.14/.pi/harnesses/agent-hub/write-isolation.ts +187 -0
- package/.versions/2.0.14/.pi/harnesses/ask-user-remote/README.md +59 -0
- package/.versions/2.0.14/.pi/harnesses/ask-user-remote/index.ts +558 -0
- package/.versions/2.0.14/.pi/harnesses/ask-user-remote/questions.ts +161 -0
- package/.versions/2.0.14/.pi/harnesses/ask-user-remote/race-core.js +124 -0
- package/.versions/2.0.14/.pi/harnesses/ask-user-remote/runtime-ask.ts +68 -0
- package/.versions/2.0.14/.pi/harnesses/coms/README.md +100 -0
- package/.versions/2.0.14/.pi/harnesses/coms/index.ts +282 -0
- package/.versions/2.0.14/.pi/harnesses/coms/package.json +7 -0
- package/.versions/2.0.14/.pi/harnesses/coms/version.ts +42 -0
- package/.versions/2.0.14/.pi/harnesses/damage-control-continue/README.md +135 -0
- package/.versions/2.0.14/.pi/harnesses/damage-control-continue/index.ts +550 -0
- package/.versions/2.0.14/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/2.0.14/.pi/harnesses/damage-control-continue/version.ts +42 -0
- package/.versions/2.0.14/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
- package/.versions/2.0.14/.pi/harnesses/lib/coms-core-io.ts +385 -0
- package/.versions/2.0.14/.pi/harnesses/lib/coms-core.ts +577 -0
- package/.versions/2.0.14/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
- package/.versions/2.0.14/.pi/harnesses/lib/context-budget-child-prompt.ts +219 -0
- package/.versions/2.0.14/.pi/harnesses/lib/context-budget-hub-prompt.ts +116 -0
- package/.versions/2.0.14/.pi/harnesses/lib/context-budget-view.ts +107 -0
- package/.versions/2.0.14/.pi/harnesses/lib/context-budget.ts +114 -0
- package/.versions/2.0.14/.pi/harnesses/lib/damage-control-shared.ts +197 -0
- package/.versions/2.0.14/.pi/harnesses/lib/deterministic-handle-path.ts +23 -0
- package/.versions/2.0.14/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
- package/.versions/2.0.14/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
- package/.versions/2.0.14/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
- package/.versions/2.0.14/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
- package/.versions/2.0.14/.pi/harnesses/lib/fleet-dashboard-view.ts +147 -0
- package/.versions/2.0.14/.pi/harnesses/lib/fleet-detail-view.ts +339 -0
- package/.versions/2.0.14/.pi/harnesses/lib/fleet-overlay.ts +26 -0
- package/.versions/2.0.14/.pi/harnesses/lib/fleet-panel.ts +34 -0
- package/.versions/2.0.14/.pi/harnesses/lib/fleet-read-model.ts +536 -0
- package/.versions/2.0.14/.pi/harnesses/lib/fleet-selection.ts +24 -0
- package/.versions/2.0.14/.pi/harnesses/lib/fleet-strip-controller.ts +75 -0
- package/.versions/2.0.14/.pi/harnesses/lib/fleet-strip-view.ts +179 -0
- package/.versions/2.0.14/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
- package/.versions/2.0.14/.pi/harnesses/lib/herdr-client.ts +472 -0
- package/.versions/2.0.14/.pi/harnesses/lib/herdr-presence.ts +399 -0
- package/.versions/2.0.14/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.versions/2.0.14/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/2.0.14/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
- package/.versions/2.0.14/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/2.0.14/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
- package/.versions/2.0.14/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
- package/.versions/2.0.14/.pi/harnesses/lib/spawned-peers.js +191 -0
- package/.versions/2.0.14/.pi/harnesses/lib/system1/config.js +61 -0
- package/.versions/2.0.14/.pi/harnesses/lib/system1/contracts.ts +152 -0
- package/.versions/2.0.14/.pi/harnesses/lib/system1/demo.ts +106 -0
- package/.versions/2.0.14/.pi/harnesses/lib/system1/jev.ts +503 -0
- package/.versions/2.0.14/.pi/harnesses/lib/system1/service.ts +245 -0
- package/.versions/2.0.14/.pi/harnesses/lib/update-check.ts +222 -0
- package/.versions/2.0.14/.pi/harnesses/package-lock.json +2039 -0
- package/.versions/2.0.14/.pi/harnesses/package.json +10 -0
- package/.versions/2.0.14/.pi/prompts/af-build.md +24 -0
- package/.versions/2.0.14/.pi/prompts/af-code-simplify.md +22 -0
- package/.versions/2.0.14/.pi/prompts/af-constraints.md +31 -0
- package/.versions/2.0.14/.pi/prompts/af-plan.md +17 -0
- package/.versions/2.0.14/.pi/prompts/af-review.md +16 -0
- package/.versions/2.0.14/.pi/prompts/af-set-hermes-telegram.md +15 -0
- package/.versions/2.0.14/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/2.0.14/.pi/prompts/af-setup-rules.md +20 -0
- package/.versions/2.0.14/.pi/prompts/af-ship.md +17 -0
- package/.versions/2.0.14/.pi/prompts/af-spec.md +15 -0
- package/.versions/2.0.14/.pi/prompts/af-test.md +19 -0
- package/.versions/2.0.14/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/2.0.14/.version +1 -0
- package/.versions/2.0.14/agents/architect.md +24 -0
- package/.versions/2.0.14/agents/bowser.md +28 -0
- package/.versions/2.0.14/agents/builder.md +55 -0
- package/.versions/2.0.14/agents/code-reviewer.md +209 -0
- package/.versions/2.0.14/agents/deep-researcher.md +32 -0
- package/.versions/2.0.14/agents/documenter.md +22 -0
- package/.versions/2.0.14/agents/orchestrator.md +22 -0
- package/.versions/2.0.14/agents/plan-reviewer.md +83 -0
- package/.versions/2.0.14/agents/planner.md +105 -0
- package/.versions/2.0.14/agents/releaser.md +24 -0
- package/.versions/2.0.14/agents/researcher.md +30 -0
- package/.versions/2.0.14/agents/security-auditor.md +167 -0
- package/.versions/2.0.14/agents/test-engineer.md +153 -0
- package/.versions/2.0.14/agents/web-debugger.md +44 -0
- package/.versions/2.0.14/agents/web-performance-auditor.md +194 -0
- package/.versions/2.0.14/bin/catalog/harness-runtime-closure.json +73 -0
- package/.versions/2.0.14/codex/fleet-session-client/SKILL.md +34 -0
- package/.versions/2.0.14/codex/fleet-session-client.zip +0 -0
- package/.versions/2.0.14/docs/ARCHITECTURE.md +754 -0
- package/.versions/2.0.14/docs/agent-fleet-setup.md +917 -0
- package/.versions/2.0.14/docs/claude-code-coms-bridge.md +134 -0
- package/.versions/2.0.14/docs/codex-session-bridge.md +219 -0
- package/.versions/2.0.14/docs/coms-hermes-bridge.md +188 -0
- package/.versions/2.0.14/docs/getting-started.md +126 -0
- package/.versions/2.0.14/docs/npm-install.md +476 -0
- package/.versions/2.0.14/docs/pi-extensions.md +454 -0
- package/.versions/2.0.14/docs/pi-setup.md +92 -0
- package/.versions/2.0.14/docs/skill-anatomy.md +150 -0
- package/.versions/2.0.14/install-manifest.json +3183 -0
- package/.versions/2.0.14/justfile +247 -0
- package/.versions/2.0.14/manifest-meta.json +1065 -0
- package/.versions/2.0.14/references/accessibility-checklist.md +160 -0
- package/.versions/2.0.14/references/communication-contract.md +26 -0
- package/.versions/2.0.14/references/definition-of-done.md +67 -0
- package/.versions/2.0.14/references/fleet-coordination-patterns.md +171 -0
- package/.versions/2.0.14/references/observability-checklist.md +92 -0
- package/.versions/2.0.14/references/orchestration-patterns.md +370 -0
- package/.versions/2.0.14/references/performance-checklist.md +236 -0
- package/.versions/2.0.14/references/prompting-patterns.md +380 -0
- package/.versions/2.0.14/references/security-checklist.md +245 -0
- package/.versions/2.0.14/references/testing-patterns.md +235 -0
- package/.versions/2.0.14/references/workflow-authoring.md +304 -0
- package/.versions/2.0.14/skills/_internal/grilling.md +59 -0
- package/.versions/2.0.14/skills/browser-testing-with-devtools/SKILL.md +351 -0
- package/.versions/2.0.14/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.0.14/skills/compound-learning/SKILL.md +137 -0
- package/.versions/2.0.14/skills/constraint-driven-development/SKILL.md +338 -0
- package/.versions/2.0.14/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.0.14/skills/context-engineering/SKILL.md +341 -0
- package/.versions/2.0.14/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.0.14/skills/designing-agents/SKILL.md +394 -0
- package/.versions/2.0.14/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/2.0.14/skills/drafting-workflows/SKILL.md +143 -0
- package/.versions/2.0.14/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
- package/.versions/2.0.14/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.14/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/2.0.14/skills/idea-refine/SKILL.md +182 -0
- package/.versions/2.0.14/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.14/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.14/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.14/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.14/skills/incremental-implementation/SKILL.md +302 -0
- package/.versions/2.0.14/skills/interview-me/SKILL.md +226 -0
- package/.versions/2.0.14/skills/orchestration-verification/SKILL.md +182 -0
- package/.versions/2.0.14/skills/peer-coms/SKILL.md +90 -0
- package/.versions/2.0.14/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.0.14/skills/planning-and-task-breakdown/SKILL.md +289 -0
- package/.versions/2.0.14/skills/repository-ai-setup/SKILL.md +117 -0
- package/.versions/2.0.14/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
- package/.versions/2.0.14/skills/repository-ai-setup/references/apply-contract.md +74 -0
- package/.versions/2.0.14/skills/repository-ai-setup/references/provenance-template.md +16 -0
- package/.versions/2.0.14/skills/repository-ai-setup/references/setup-flow.md +108 -0
- package/.versions/2.0.14/skills/repository-ai-setup/references/verify-setup.md +20 -0
- package/.versions/2.0.14/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.0.14/skills/spec-driven-development/SKILL.md +295 -0
- package/.versions/2.0.14/skills/using-agent-skills/SKILL.md +198 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/README.md +430 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
- package/.versions/2.0.14/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
- package/CHANGELOG.md +6 -0
- package/docs/ARCHITECTURE.md +1 -0
- package/docs/agent-fleet-setup.md +17 -0
- package/docs/npm-install.md +8 -0
- package/install-manifest.json +9 -1
- package/manifest-meta.json +8 -0
- package/package.json +3 -2
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { runAgentPhase, type SpawnAgent } from "./agent-phase.ts";
|
|
3
|
+
import type { MergeReport } from "./envelopes.ts";
|
|
4
|
+
import type { PermissionPolicy } from "./permissions.ts";
|
|
5
|
+
import type { PersonaDefinition } from "./personas.ts";
|
|
6
|
+
import type { Run } from "./run.ts";
|
|
7
|
+
import { integratorVoice, resolvePanel, type Voice } from "./voices.ts";
|
|
8
|
+
import { POLL_PERMISSION_POLICY, POLL_TOOLS, pollArtifactDir, type PollVoiceResult } from "./poll.ts";
|
|
9
|
+
import { withWriterLease, writerLeaseFile, WriterLeaseHeldError } from "./writer-lease.ts";
|
|
10
|
+
|
|
11
|
+
export const MERGE_APPLY_TOOLS = "read,grep,find,ls,edit,write";
|
|
12
|
+
export const MERGE_APPLY_PERMISSION_POLICY: PermissionPolicy = { writes: ["**"] };
|
|
13
|
+
|
|
14
|
+
export class MergeUnavailableError extends Error {
|
|
15
|
+
constructor(panel: string) {
|
|
16
|
+
super(`Merge is unavailable: panel "${panel}" has no voice with integrator: true.`);
|
|
17
|
+
this.name = "MergeUnavailableError";
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface MergeOptions {
|
|
22
|
+
run: Run; cwd: string; persona: PersonaDefinition; panel: string; task: string; opinions: PollVoiceResult[];
|
|
23
|
+
voices?: Voice[]; spawn?: SpawnAgent; runAgent?: typeof runAgentPhase<MergeReport>;
|
|
24
|
+
apply?: boolean; command?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function mergedPath(cwd: string, runId: string): string {
|
|
28
|
+
return `${pollArtifactDir(cwd, runId)}/merged.md`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function mergeTask(question: string, opinions: PollVoiceResult[], apply = false): string {
|
|
32
|
+
const blocks = opinions.map(opinion => {
|
|
33
|
+
const body = opinion.ok ? `\`\`\`json\n${JSON.stringify(opinion.report, null, 2)}\n\`\`\`` : `FAILED: ${opinion.reason}`;
|
|
34
|
+
return `## ${opinion.voice.name} (${opinion.voice.model})\n\n${body}`;
|
|
35
|
+
});
|
|
36
|
+
return [
|
|
37
|
+
"Merge the independent poll opinions below into one attributed recommendation.",
|
|
38
|
+
"Do not invent claims that no voice made. Every consensus, divergence, minority, and rejected item must name a voice.",
|
|
39
|
+
"A minority opinion must not be dropped silently; rejecting it requires a reason.",
|
|
40
|
+
apply ? "You have write tools. Apply the recommendation to the working tree; stay inside the writes policy." : "You are read-only. Do not modify the working tree.",
|
|
41
|
+
"",
|
|
42
|
+
`Question:\n${question}`,
|
|
43
|
+
"",
|
|
44
|
+
"Opinions:",
|
|
45
|
+
...blocks,
|
|
46
|
+
].join("\n");
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function writeMerged(cwd: string, runId: string, integrator: Voice, report: MergeReport): string {
|
|
50
|
+
const directory = pollArtifactDir(cwd, runId);
|
|
51
|
+
mkdirSync(directory, { recursive: true });
|
|
52
|
+
const path = mergedPath(cwd, runId);
|
|
53
|
+
writeFileSync(path, `# Merge (${integrator.name})\n\n- model: ${integrator.model}\n\n\`\`\`json\n${JSON.stringify(report, null, 2)}\n\`\`\`\n`, "utf8");
|
|
54
|
+
return path;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export async function runMerge(options: MergeOptions): Promise<{ report: MergeReport; integrator: Voice; path: string }> {
|
|
58
|
+
const voices = options.voices ?? resolvePanel(options.panel, options.cwd);
|
|
59
|
+
const integrator = integratorVoice(voices);
|
|
60
|
+
if (!integrator) throw new MergeUnavailableError(options.panel);
|
|
61
|
+
const apply = Boolean(options.apply);
|
|
62
|
+
const agent = options.runAgent ?? runAgentPhase<MergeReport>;
|
|
63
|
+
const spawnIntegrator = () => agent({
|
|
64
|
+
run: options.run,
|
|
65
|
+
persona: {
|
|
66
|
+
...options.persona,
|
|
67
|
+
tools: apply ? MERGE_APPLY_TOOLS : POLL_TOOLS,
|
|
68
|
+
writes: apply ? MERGE_APPLY_PERMISSION_POLICY.writes : [],
|
|
69
|
+
},
|
|
70
|
+
task: mergeTask(options.task, options.opinions, apply),
|
|
71
|
+
envelope: "merge", cwd: options.cwd, spawn: options.spawn,
|
|
72
|
+
model: integrator.model, thinking: integrator.thinking,
|
|
73
|
+
sessionTag: "merge",
|
|
74
|
+
permissionPolicy: apply ? MERGE_APPLY_PERMISSION_POLICY : POLL_PERMISSION_POLICY,
|
|
75
|
+
});
|
|
76
|
+
if (!apply) {
|
|
77
|
+
const report = await spawnIntegrator();
|
|
78
|
+
return { report, integrator, path: writeMerged(options.cwd, options.run.trace.runId, integrator, report) };
|
|
79
|
+
}
|
|
80
|
+
const command = options.command ?? (options.run.command.join(" ") || "flow poll --apply");
|
|
81
|
+
try {
|
|
82
|
+
const merged = await withWriterLease({ cwd: options.cwd, owner: `merge:${integrator.name}`, command }, async lease => {
|
|
83
|
+
options.run.trace.write("log", { phase: "merge", message: "writer lease acquired", lease: lease.file, owner: lease.record.owner, ownerCommand: lease.record.command });
|
|
84
|
+
const report = await spawnIntegrator();
|
|
85
|
+
return { report, integrator, path: writeMerged(options.cwd, options.run.trace.runId, integrator, report) };
|
|
86
|
+
});
|
|
87
|
+
options.run.trace.write("log", { phase: "merge", message: "writer lease released", lease: writerLeaseFile(options.cwd) });
|
|
88
|
+
return merged;
|
|
89
|
+
} catch (error) {
|
|
90
|
+
if (error instanceof WriterLeaseHeldError) {
|
|
91
|
+
options.run.trace.write("error", { phase: "merge", message: error.message, lease: error.file, owner: error.record.owner, ownerCommand: error.record.command });
|
|
92
|
+
}
|
|
93
|
+
throw error;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// The same inherited profile governs CLI workflows spawned by the hub and their children.
|
|
2
|
+
// Dynamic loading follows agent-phase.ts so the standalone workflow TS build stays local.
|
|
3
|
+
import type { Voice } from './voices.ts';
|
|
4
|
+
const runtimePath: string = '../../../../../.pi/harnesses/agent-hub/policy/profile-runtime.ts';
|
|
5
|
+
export const { readActiveProfile, profileAgent, profileFallback, assertProfileModel, profilePanel } = await import(runtimePath) as {
|
|
6
|
+
readActiveProfile(): {
|
|
7
|
+
name: string;
|
|
8
|
+
profile: {
|
|
9
|
+
defaults: {
|
|
10
|
+
model: string;
|
|
11
|
+
thinking?: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
} | undefined;
|
|
15
|
+
profileAgent(name: string): {
|
|
16
|
+
model: string;
|
|
17
|
+
thinking?: string;
|
|
18
|
+
} | undefined;
|
|
19
|
+
profileFallback(model: string | undefined): string | undefined;
|
|
20
|
+
assertProfileModel(model: string): void;
|
|
21
|
+
profilePanel(name: string): Voice[] | undefined;
|
|
22
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
|
|
3
|
+
export type VisibilityCheckName = "registered" | "auth" | "child-visible";
|
|
4
|
+
export interface ModelCheck {
|
|
5
|
+
model: string;
|
|
6
|
+
ok: boolean;
|
|
7
|
+
failed: VisibilityCheckName[];
|
|
8
|
+
reasons: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface ChildVisibilityReport { models: ModelCheck[]; diagnostic?: string }
|
|
11
|
+
export interface ModelRegistryAuth {
|
|
12
|
+
isRegistered(model: string): boolean;
|
|
13
|
+
hasAuth(model: string): boolean;
|
|
14
|
+
}
|
|
15
|
+
export type ModelListing = { models?: string[]; diagnostic?: string };
|
|
16
|
+
export type ListModels = () => ModelListing;
|
|
17
|
+
|
|
18
|
+
let listingCache: ModelListing | undefined;
|
|
19
|
+
|
|
20
|
+
export function resetModelVisibilityCache(): void {
|
|
21
|
+
listingCache = undefined;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function parseListModelsOutput(text: string): string[] {
|
|
25
|
+
const cleaned = text.replace(/\u001B\[[0-9;]*m/g, "");
|
|
26
|
+
const lines = cleaned.split(/\r?\n/).map(line => line.trimEnd()).filter(line => line.trim());
|
|
27
|
+
if (lines.length === 0) return [];
|
|
28
|
+
const models = new Set<string>();
|
|
29
|
+
for (const line of lines.slice(1)) {
|
|
30
|
+
const parts = line.trim().split(/\s+/);
|
|
31
|
+
if (parts.length < 2 || (parts[0] === "provider" && parts[1] === "model")) continue;
|
|
32
|
+
models.add(`${parts[0]}/${parts[1]}`);
|
|
33
|
+
}
|
|
34
|
+
return [...models];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function checkChildVisibility(models: string[], listModels?: ListModels): ChildVisibilityReport {
|
|
38
|
+
const listing = loadListing(listModels);
|
|
39
|
+
if (listing.diagnostic) {
|
|
40
|
+
return {
|
|
41
|
+
diagnostic: listing.diagnostic,
|
|
42
|
+
models: models.map(model => ({
|
|
43
|
+
model, ok: false, failed: [],
|
|
44
|
+
reasons: [`${model}: child-visible check not performed — ${listing.diagnostic}`],
|
|
45
|
+
})),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const visible = new Set(listing.models ?? []);
|
|
49
|
+
return {
|
|
50
|
+
models: models.map(model => visible.has(model)
|
|
51
|
+
? { model, ok: true, failed: [], reasons: [] }
|
|
52
|
+
: {
|
|
53
|
+
model, ok: false, failed: ["child-visible"],
|
|
54
|
+
reasons: [`${model}: child-visible check failed — not listed by pi --no-extensions --list-models`],
|
|
55
|
+
}),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function checkRegistryAuth(models: string[], registry: ModelRegistryAuth): ModelCheck[] {
|
|
60
|
+
return models.map(model => {
|
|
61
|
+
if (!registry.isRegistered(model)) {
|
|
62
|
+
return {
|
|
63
|
+
model, ok: false, failed: ["registered"],
|
|
64
|
+
reasons: [`${model}: registered check failed — model is not in the pi model registry`],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
if (!registry.hasAuth(model)) {
|
|
68
|
+
return {
|
|
69
|
+
model, ok: false, failed: ["auth"],
|
|
70
|
+
reasons: [`${model}: auth check failed — no configured credentials`],
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return { model, ok: true, failed: [], reasons: [] };
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function loadListing(listModels?: ListModels): ModelListing {
|
|
78
|
+
if (listingCache) return listingCache;
|
|
79
|
+
try { listingCache = listModels ? listModels() : defaultListModels(); }
|
|
80
|
+
catch (error) { listingCache = { diagnostic: error instanceof Error ? error.message : String(error) }; }
|
|
81
|
+
return listingCache;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function defaultListModels(): ModelListing {
|
|
85
|
+
const result = spawnSync("pi", ["--no-extensions", "--list-models"], { encoding: "utf8", timeout: 15_000 });
|
|
86
|
+
if (result.error) return { diagnostic: `pi --no-extensions --list-models failed: ${result.error.message}` };
|
|
87
|
+
if (result.status !== 0) {
|
|
88
|
+
const detail = (result.stderr || result.stdout || `exit ${result.status}`).trim();
|
|
89
|
+
return { diagnostic: `pi --no-extensions --list-models failed: ${detail}` };
|
|
90
|
+
}
|
|
91
|
+
return { models: parseListModelsOutput(result.stdout) };
|
|
92
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
import { existsSync, lstatSync, mkdirSync, readFileSync, readlinkSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { dirname, relative, resolve, sep } from "node:path";
|
|
4
|
+
import { createHash } from "node:crypto";
|
|
5
|
+
|
|
6
|
+
interface PathState {
|
|
7
|
+
path: string;
|
|
8
|
+
numstat: string;
|
|
9
|
+
index?: { mode: string; object: string; stage: string };
|
|
10
|
+
worktree?: { kind: "file" | "symlink"; data: string; hash: string };
|
|
11
|
+
headTracked: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface PermissionSnapshot { cwd: string; paths: Map<string, PathState> }
|
|
14
|
+
export interface PermissionPolicy { writes?: string[]; protectedGlobs?: string[]; alwaysWritable?: string[] }
|
|
15
|
+
export interface PermissionEnforcement { changed: string[]; violations: string[]; preDirtyPreserved: string[] }
|
|
16
|
+
|
|
17
|
+
export class PermissionBreach extends Error {
|
|
18
|
+
readonly paths: string[];
|
|
19
|
+
readonly exitCode = 1;
|
|
20
|
+
readonly terminal = true;
|
|
21
|
+
constructor(paths: string[], preserved: string[] = []) {
|
|
22
|
+
super(`PermissionBreach: unauthorized repository changes: ${paths.join(", ")}${preserved.length ? `; restored pre-dirty state for: ${preserved.join(", ")}` : ""}`);
|
|
23
|
+
this.name = "PermissionBreach";
|
|
24
|
+
this.paths = paths;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function git(cwd: string, args: string[]): string {
|
|
29
|
+
return execFileSync("git", args, { cwd, encoding: "utf8" });
|
|
30
|
+
}
|
|
31
|
+
function zlist(value: string): string[] { return value.split("\0").filter(Boolean); }
|
|
32
|
+
function worktreeState(cwd: string, path: string): PathState["worktree"] {
|
|
33
|
+
const full = resolve(cwd, path);
|
|
34
|
+
if (!existsSync(full)) return undefined;
|
|
35
|
+
const stat = lstatSync(full);
|
|
36
|
+
if (stat.isDirectory()) return undefined;
|
|
37
|
+
const kind = stat.isSymbolicLink() ? "symlink" : "file";
|
|
38
|
+
const data = kind === "symlink" ? Buffer.from(readlinkSync(full)).toString("base64") : readFileSync(full).toString("base64");
|
|
39
|
+
return { kind, data, hash: createHash("sha256").update(data).digest("hex") };
|
|
40
|
+
}
|
|
41
|
+
function indexState(cwd: string, path: string): PathState["index"] {
|
|
42
|
+
const raw = git(cwd, ["ls-files", "-s", "-z", "--", path]);
|
|
43
|
+
const match = raw.match(/^(\d+) ([0-9a-f]+) (\d+)\t/);
|
|
44
|
+
return match ? { mode: match[1], object: match[2], stage: match[3] } : undefined;
|
|
45
|
+
}
|
|
46
|
+
function headTracked(cwd: string, path: string): boolean {
|
|
47
|
+
try { execFileSync("git", ["cat-file", "-e", `HEAD:${path}`], { cwd, stdio: "ignore" }); return true; } catch { return false; }
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function snapshot(cwd = process.cwd()): PermissionSnapshot {
|
|
51
|
+
const numstat = git(cwd, ["diff", "HEAD", "--no-renames", "--numstat", "-z"]);
|
|
52
|
+
const rows = zlist(numstat);
|
|
53
|
+
const stats = new Map<string, string>();
|
|
54
|
+
for (const row of rows) {
|
|
55
|
+
const match = row.match(/^([^\t]+)\t([^\t]+)\t([\s\S]+)$/);
|
|
56
|
+
if (match) stats.set(match[3], `${match[1]}\t${match[2]}`);
|
|
57
|
+
}
|
|
58
|
+
const trackedChanges = zlist(git(cwd, ["diff", "HEAD", "--no-renames", "--name-only", "-z"]));
|
|
59
|
+
const untracked = zlist(git(cwd, ["ls-files", "--others", "--exclude-standard", "-z"]));
|
|
60
|
+
const paths = new Map<string, PathState>();
|
|
61
|
+
for (const path of new Set([...trackedChanges, ...untracked])) {
|
|
62
|
+
paths.set(path, { path, numstat: stats.get(path) ?? "untracked", index: indexState(cwd, path), worktree: worktreeState(cwd, path), headTracked: headTracked(cwd, path) });
|
|
63
|
+
}
|
|
64
|
+
return { cwd: resolve(cwd), paths };
|
|
65
|
+
}
|
|
66
|
+
function signature(state?: PathState): string { return state ? JSON.stringify(state) : "clean"; }
|
|
67
|
+
export function changedPaths(before: PermissionSnapshot, after: PermissionSnapshot): string[] {
|
|
68
|
+
const paths = new Set([...before.paths.keys(), ...after.paths.keys()]);
|
|
69
|
+
return [...paths].filter(path => signature(before.paths.get(path)) !== signature(after.paths.get(path))).sort();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function globRegex(pattern: string): RegExp {
|
|
73
|
+
let input = pattern.replaceAll("\\", "/").replace(/^\.\//, "");
|
|
74
|
+
if (input.endsWith("/")) input += "**";
|
|
75
|
+
let source = "^";
|
|
76
|
+
for (let i = 0; i < input.length; i++) {
|
|
77
|
+
const char = input[i];
|
|
78
|
+
if (char === "*" && input[i + 1] === "*") {
|
|
79
|
+
i++;
|
|
80
|
+
if (input[i + 1] === "/") { i++; source += "(?:.*/)?"; } else source += ".*";
|
|
81
|
+
} else if (char === "*") source += "[^/]*";
|
|
82
|
+
else if (char === "?") source += "[^/]";
|
|
83
|
+
else source += char.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
84
|
+
}
|
|
85
|
+
return new RegExp(`${source}$`);
|
|
86
|
+
}
|
|
87
|
+
export function matchesWriteGlob(path: string, pattern: string): boolean { return globRegex(pattern).test(path.replaceAll("\\", "/")); }
|
|
88
|
+
export function permitted(path: string, policy: PermissionPolicy, cwd = process.cwd()): boolean {
|
|
89
|
+
const normalized = path.replaceAll("\\", "/").replace(/^\.\//, "");
|
|
90
|
+
for (const always of policy.alwaysWritable ?? []) {
|
|
91
|
+
const rel = relative(resolve(cwd), resolve(always)).split(sep).join("/");
|
|
92
|
+
if (normalized === rel || normalized.startsWith(`${rel}/`)) return true;
|
|
93
|
+
}
|
|
94
|
+
const explicitlyAllowed = policy.writes?.some(glob => matchesWriteGlob(normalized, glob)) ?? false;
|
|
95
|
+
if ((policy.protectedGlobs ?? []).some(glob => matchesWriteGlob(normalized, glob)) && !explicitlyAllowed) return false;
|
|
96
|
+
return policy.writes === undefined || explicitlyAllowed;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function restoreState(cwd: string, path: string, state?: PathState): void {
|
|
100
|
+
const full = resolve(cwd, path);
|
|
101
|
+
if (!state) {
|
|
102
|
+
if (headTracked(cwd, path)) execFileSync("git", ["restore", "--source=HEAD", "--staged", "--worktree", "--", path], { cwd });
|
|
103
|
+
else { rmSync(full, { recursive: true, force: true }); try { execFileSync("git", ["update-index", "--force-remove", "--", path], { cwd, stdio: "ignore" }); } catch {} }
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (state.index) execFileSync("git", ["update-index", "--add", "--cacheinfo", `${state.index.mode},${state.index.object},${path}`], { cwd });
|
|
107
|
+
else { try { execFileSync("git", ["update-index", "--force-remove", "--", path], { cwd, stdio: "ignore" }); } catch {} }
|
|
108
|
+
rmSync(full, { recursive: true, force: true });
|
|
109
|
+
if (state.worktree) {
|
|
110
|
+
mkdirSync(dirname(full), { recursive: true });
|
|
111
|
+
const data = Buffer.from(state.worktree.data, "base64");
|
|
112
|
+
if (state.worktree.kind === "symlink") symlinkSync(data.toString(), full);
|
|
113
|
+
else writeFileSync(full, data);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
export function rollBack(before: PermissionSnapshot, paths: string[]): string[] {
|
|
117
|
+
const preserved: string[] = [];
|
|
118
|
+
for (const path of paths) {
|
|
119
|
+
if (before.paths.has(path)) preserved.push(path);
|
|
120
|
+
restoreState(before.cwd, path, before.paths.get(path));
|
|
121
|
+
}
|
|
122
|
+
return preserved;
|
|
123
|
+
}
|
|
124
|
+
export function enforce(before: PermissionSnapshot, after: PermissionSnapshot, policy: PermissionPolicy): PermissionEnforcement {
|
|
125
|
+
const changed = changedPaths(before, after);
|
|
126
|
+
const violations = changed.filter(path => !permitted(path, policy, before.cwd));
|
|
127
|
+
const preDirtyPreserved = violations.length ? rollBack(before, violations) : [];
|
|
128
|
+
if (violations.length) throw new PermissionBreach(violations, preDirtyPreserved);
|
|
129
|
+
return { changed, violations, preDirtyPreserved };
|
|
130
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { profileAgent, profileFallback, assertProfileModel } from './model-profile.ts';
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { StartRefusedError } from "./git.ts";
|
|
4
|
+
|
|
5
|
+
interface ScannedPersona {
|
|
6
|
+
name: string; description: string; tools: string; model?: string; models?: string[];
|
|
7
|
+
thinking?: string; systemPrompt: string; file: string;
|
|
8
|
+
}
|
|
9
|
+
const agentsModulePath: string = "../../../../../.pi/harnesses/agent-hub/config/agents.ts";
|
|
10
|
+
const { scanAgentDirs } = await import(agentsModulePath) as { scanAgentDirs(cwd: string): ScannedPersona[] };
|
|
11
|
+
export type PersonaDefinition = ScannedPersona & { fallbackModel?: string; writes?: string[] };
|
|
12
|
+
|
|
13
|
+
function declaredWrites(file: string): string[] | undefined {
|
|
14
|
+
const frontmatter = readFileSync(file, "utf8").match(/^---\n([\s\S]*?)\n---/)?.[1] ?? "";
|
|
15
|
+
const lines = frontmatter.split("\n");
|
|
16
|
+
const index = lines.findIndex(line => /^writes\s*:/.test(line));
|
|
17
|
+
if (index < 0) return undefined;
|
|
18
|
+
const inline = lines[index].replace(/^writes\s*:\s*/, "").trim();
|
|
19
|
+
if (inline === "[]") return [];
|
|
20
|
+
if (inline) return inline.replace(/^\[|\]$/g, "").split(",").map(value => value.trim().replace(/^['\"]|['\"]$/g, "")).filter(Boolean);
|
|
21
|
+
const values: string[] = [];
|
|
22
|
+
for (let i = index + 1; i < lines.length; i++) {
|
|
23
|
+
const match = lines[i].match(/^\s+-\s+(.+)$/);
|
|
24
|
+
if (!match) break;
|
|
25
|
+
values.push(match[1].trim().replace(/^['\"]|['\"]$/g, ""));
|
|
26
|
+
}
|
|
27
|
+
return values;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function listPersonas(cwd = process.cwd()): PersonaDefinition[] {
|
|
31
|
+
return scanAgentDirs(cwd).map(def => {
|
|
32
|
+
const override = process.env[`AGENT_FLEET_MODEL_${def.name.toUpperCase().replace(/-/g, "_")}`];
|
|
33
|
+
const selected=profileAgent(def.name);
|
|
34
|
+
const model = selected?.model || override || def.model || def.models?.[0];
|
|
35
|
+
const fallbackModel = profileFallback([def.model, ...(def.models ?? [])].find(candidate => candidate && candidate !== model));
|
|
36
|
+
const writes = declaredWrites(def.file);
|
|
37
|
+
return { ...def, ...(selected?.thinking?{thinking:selected.thinking}:{}), model, fallbackModel, ...(writes === undefined ? {} : { writes }) };
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function resolvePersona(name: string, cwd = process.cwd()): PersonaDefinition {
|
|
42
|
+
const persona = listPersonas(cwd).find(def => def.name.toLowerCase() === name.toLowerCase());
|
|
43
|
+
if (!persona) throw new StartRefusedError(`Flow start refused: persona "${name}" was not found in agents/, .claude/agents/, .pi/agents/personas/, or .pi/agents/.`);
|
|
44
|
+
if (!persona.model) throw new StartRefusedError(`Flow start refused: persona "${name}" declares no model.`);
|
|
45
|
+
return persona;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function resolvePhaseModel(persona: PersonaDefinition, override?: string): string {
|
|
49
|
+
const model = override || persona.model;
|
|
50
|
+
if (!model) throw new StartRefusedError(`Flow start refused: persona "${persona.name}" declares no model.`);
|
|
51
|
+
assertProfileModel(model);
|
|
52
|
+
return model;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function resolvePhaseThinking(persona: PersonaDefinition, override?: string): string {
|
|
56
|
+
return override ?? persona.thinking ?? "medium";
|
|
57
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { runAgentPhase, type SpawnAgent } from "./agent-phase.ts";
|
|
4
|
+
import type { PollReport } from "./envelopes.ts";
|
|
5
|
+
import type { PermissionPolicy } from "./permissions.ts";
|
|
6
|
+
import type { PersonaDefinition } from "./personas.ts";
|
|
7
|
+
import type { Run } from "./run.ts";
|
|
8
|
+
import { resolvePanel, type Voice } from "./voices.ts";
|
|
9
|
+
|
|
10
|
+
export const POLL_TOOLS = "read,grep,find,ls";
|
|
11
|
+
export const POLL_PERMISSION_POLICY: PermissionPolicy = { writes: [] };
|
|
12
|
+
export const POLL_ARTIFACTS_REL = ".pi/agent-sessions/artifacts/polls";
|
|
13
|
+
|
|
14
|
+
export interface PollVoiceSuccess { ok: true; voice: Voice; report: PollReport; path: string }
|
|
15
|
+
export interface PollVoiceFailure { ok: false; voice: Voice; reason: string; path: string }
|
|
16
|
+
export type PollVoiceResult = PollVoiceSuccess | PollVoiceFailure;
|
|
17
|
+
export interface PollResult { panel: string; directory: string; results: PollVoiceResult[] }
|
|
18
|
+
export interface PollVoiceOptions {
|
|
19
|
+
run: Run; cwd: string; persona: PersonaDefinition; voice: Voice; task: string; panel: string;
|
|
20
|
+
spawn?: SpawnAgent; runAgent?: typeof runAgentPhase<PollReport>;
|
|
21
|
+
}
|
|
22
|
+
export interface PollOptions {
|
|
23
|
+
run: Run; cwd: string; persona: PersonaDefinition; panel: string; task: string; voices?: Voice[];
|
|
24
|
+
spawn?: SpawnAgent; runAgent?: typeof runAgentPhase<PollReport>;
|
|
25
|
+
onVoice?: (result: PollVoiceResult) => void | Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function pollArtifactDir(cwd: string, runId: string): string {
|
|
29
|
+
return resolve(cwd, POLL_ARTIFACTS_REL, runId);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function pollVoicePath(cwd: string, runId: string, voiceName: string): string {
|
|
33
|
+
return resolve(pollArtifactDir(cwd, runId), `${voiceName}.md`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function formatVoiceArtifact(result: PollVoiceResult): string {
|
|
37
|
+
const header = [`# ${result.voice.name}`, "", `- model: ${result.voice.model}`, `- thinking: ${result.voice.thinking ?? "medium"}`];
|
|
38
|
+
if (!result.ok) return `${header.join("\n")}\n- status: failed\n- reason: ${result.reason}\n`;
|
|
39
|
+
return `${header.join("\n")}\n- status: success\n\n## Report\n\n\`\`\`json\n${JSON.stringify(result.report, null, 2)}\n\`\`\`\n`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function writeVoiceArtifact(cwd: string, runId: string, result: PollVoiceResult): string {
|
|
43
|
+
const directory = pollArtifactDir(cwd, runId);
|
|
44
|
+
mkdirSync(directory, { recursive: true });
|
|
45
|
+
const path = pollVoicePath(cwd, runId, result.voice.name);
|
|
46
|
+
writeFileSync(path, formatVoiceArtifact(result), "utf8");
|
|
47
|
+
return path;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function readOnlyPersona(persona: PersonaDefinition): PersonaDefinition {
|
|
51
|
+
return { ...persona, tools: POLL_TOOLS, writes: [] };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export async function pollVoice(options: PollVoiceOptions): Promise<PollVoiceResult> {
|
|
55
|
+
const path = pollVoicePath(options.cwd, options.run.trace.runId, options.voice.name);
|
|
56
|
+
const agent = options.runAgent ?? runAgentPhase<PollReport>;
|
|
57
|
+
try {
|
|
58
|
+
const report = await agent({
|
|
59
|
+
run: options.run, persona: readOnlyPersona(options.persona), task: options.task, envelope: "poll",
|
|
60
|
+
cwd: options.cwd, spawn: options.spawn, model: options.voice.model, thinking: options.voice.thinking,
|
|
61
|
+
sessionTag: options.voice.name, permissionPolicy: POLL_PERMISSION_POLICY,
|
|
62
|
+
});
|
|
63
|
+
const result: PollVoiceSuccess = { ok: true, voice: options.voice, report, path };
|
|
64
|
+
result.path = writeVoiceArtifact(options.cwd, options.run.trace.runId, result);
|
|
65
|
+
return result;
|
|
66
|
+
} catch (error) {
|
|
67
|
+
const result: PollVoiceFailure = { ok: false, voice: options.voice, reason: error instanceof Error ? error.message : String(error), path };
|
|
68
|
+
result.path = writeVoiceArtifact(options.cwd, options.run.trace.runId, result);
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export async function runPoll(options: PollOptions): Promise<PollResult> {
|
|
74
|
+
const voices = options.voices ?? resolvePanel(options.panel, options.cwd);
|
|
75
|
+
const results = await Promise.all(voices.map(async voice => {
|
|
76
|
+
const result = await pollVoice({ ...options, voice });
|
|
77
|
+
try { await options.onVoice?.(result); } catch { /* progress is best-effort */ }
|
|
78
|
+
return result;
|
|
79
|
+
}));
|
|
80
|
+
const succeeded = results.filter(result => result.ok);
|
|
81
|
+
if (succeeded.length < 2) {
|
|
82
|
+
const failures = results.filter(result => !result.ok).map(result => `${result.voice.name}: ${result.reason}`).join("; ");
|
|
83
|
+
throw new Error(`Poll failed: ${succeeded.length} of ${voices.length} voices succeeded${failures ? ` (${failures})` : ""}`);
|
|
84
|
+
}
|
|
85
|
+
return { panel: options.panel, directory: pollArtifactDir(options.cwd, options.run.trace.runId), results };
|
|
86
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
|
|
4
|
+
/** Workflow-side reader of the Hub's `## agent-hub` / `## agent-team` rules and docs contract. */
|
|
5
|
+
export function readProjectPolicy(cwd: string): { rulesPaths: string[]; docsPaths: string[] } {
|
|
6
|
+
const file = join(cwd, ".ai", "agent-fleet-overrides.md");
|
|
7
|
+
if (!existsSync(file)) return { rulesPaths: [], docsPaths: [] };
|
|
8
|
+
let raw: string;
|
|
9
|
+
try { raw = readFileSync(file, "utf8"); } catch { return { rulesPaths: [], docsPaths: [] }; }
|
|
10
|
+
const result = { rulesPaths: [] as string[], docsPaths: [] as string[] };
|
|
11
|
+
let inSection = false;
|
|
12
|
+
for (const rawLine of raw.split("\n")) {
|
|
13
|
+
const line = rawLine.replace(/\r$/, "");
|
|
14
|
+
const heading = line.match(/^##\s+(.+?)\s*$/);
|
|
15
|
+
if (heading) { const name = heading[1].trim().toLowerCase(); inSection = name === "agent-hub" || name === "agent-team"; continue; }
|
|
16
|
+
if (!inSection) continue;
|
|
17
|
+
const pair = line.match(/^\s*([a-zA-Z][\w.-]*)\s*:\s*(.+?)\s*$/);
|
|
18
|
+
if (!pair) continue;
|
|
19
|
+
const key = pair[1].toLowerCase();
|
|
20
|
+
const value = pair[2].trim();
|
|
21
|
+
if (key === "rules" && value) result.rulesPaths = value.split(",").map(s => s.trim()).filter(Boolean);
|
|
22
|
+
if (key === "docs" && value) result.docsPaths = value.split(",").map(s => s.trim()).filter(Boolean);
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function resolveProjectPolicy(cwd: string, options: { rulesPaths?: string[]; docsPaths?: string[] } = {}, warn: (message: string) => void = console.warn): { rulesPaths: string[]; docsPaths: string[] } {
|
|
28
|
+
const configured = readProjectPolicy(cwd);
|
|
29
|
+
const rulesPaths = [...new Set([...configured.rulesPaths, ...(options.rulesPaths ?? [])])];
|
|
30
|
+
const docsPaths = [...new Set([...configured.docsPaths, ...(options.docsPaths ?? [])])];
|
|
31
|
+
for (const path of rulesPaths) if (!existsSync(join(cwd, path))) warn(`agent-fleet-overrides: rules folder "${path}" not found in ${cwd}`);
|
|
32
|
+
for (const path of docsPaths) if (!existsSync(join(cwd, path))) warn(`agent-fleet-overrides: docs entry point "${path}" not found in ${cwd}`);
|
|
33
|
+
return { rulesPaths, docsPaths };
|
|
34
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import type { Run } from "./run.ts";
|
|
5
|
+
|
|
6
|
+
export interface QualityResult { argv: string[]; exitCode: number; stdout: string; stderr: string; logPath: string; passed: boolean }
|
|
7
|
+
export interface VerifyEnvelope { status: "success" | "fail"; summary: string; artifacts: string[]; notes_for_next_agent: string; tests_run: string[] }
|
|
8
|
+
|
|
9
|
+
function splitArgv(value: string): string[] {
|
|
10
|
+
const matches = value.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g) ?? [];
|
|
11
|
+
return matches.map(part => part.replace(/^("|')|("|')$/g, ""));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function qualityCommand(cwd = process.cwd()): string[] {
|
|
15
|
+
const override = resolve(cwd, ".ai", "agent-fleet-overrides.md");
|
|
16
|
+
if (!existsSync(override)) throw Object.assign(new Error("Flow start refused: configure `quality:` under `## workflows` in .ai/agent-fleet-overrides.md."), { exitCode: 3 });
|
|
17
|
+
const text = readFileSync(override, "utf8");
|
|
18
|
+
const heading = text.match(/^## workflows\s*$/m);
|
|
19
|
+
const sectionStart = heading == null ? -1 : heading.index! + heading[0].length;
|
|
20
|
+
const tail = sectionStart < 0 ? "" : text.slice(sectionStart);
|
|
21
|
+
const nextHeading = tail.search(/^##\s/m);
|
|
22
|
+
const section = nextHeading < 0 ? tail : tail.slice(0, nextHeading);
|
|
23
|
+
const configured = section.match(/^quality\s*:\s*(.+)$/m)?.[1]?.trim();
|
|
24
|
+
const argv = configured ? splitArgv(configured) : [];
|
|
25
|
+
if (!argv.length) throw Object.assign(new Error("Flow start refused: configure a non-empty `quality:` argv under `## workflows` in .ai/agent-fleet-overrides.md."), { exitCode: 3 });
|
|
26
|
+
return argv;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export async function executeQuality(argv: string[], options: { cwd?: string; logPath: string; timeoutSeconds?: number; signal?: AbortSignal }): Promise<QualityResult> {
|
|
30
|
+
const cwd = options.cwd ?? process.cwd();
|
|
31
|
+
const timeoutMs = (options.timeoutSeconds ?? 1800) * 1000;
|
|
32
|
+
if (!argv.length || !argv[0]) throw new Error("Quality command requires a non-empty argv list");
|
|
33
|
+
const result = await new Promise<{ code: number; stdout: string; stderr: string }>(resolveResult => {
|
|
34
|
+
const child = spawn(argv[0], argv.slice(1), { cwd, env: process.env, shell: false, stdio: ["ignore", "pipe", "pipe"] });
|
|
35
|
+
let stdout = "", stderr = "", settled = false;
|
|
36
|
+
let timer: NodeJS.Timeout;
|
|
37
|
+
const onAbort = () => { stderr += "\nCancelled by flow signal"; child.kill("SIGTERM"); };
|
|
38
|
+
const finish = (code: number) => { if (!settled) { settled = true; clearTimeout(timer); options.signal?.removeEventListener("abort", onAbort); resolveResult({ code, stdout, stderr }); } };
|
|
39
|
+
if (options.signal?.aborted) onAbort(); else options.signal?.addEventListener("abort", onAbort, { once: true });
|
|
40
|
+
child.stdout?.on("data", chunk => { stdout += chunk; });
|
|
41
|
+
child.stderr?.on("data", chunk => { stderr += chunk; });
|
|
42
|
+
child.on("error", error => { stderr += error.message; finish((error as NodeJS.ErrnoException).code === "ENOENT" ? 127 : 1); });
|
|
43
|
+
child.on("close", code => finish(code ?? 1));
|
|
44
|
+
timer = setTimeout(() => { stderr += `\nTimed out after ${timeoutMs}ms`; child.kill("SIGTERM"); finish(1); }, timeoutMs);
|
|
45
|
+
});
|
|
46
|
+
const body = [`$ ${argv.join(" ")}`, result.stdout, result.stderr, `exit ${result.code}`].filter(Boolean).join("\n");
|
|
47
|
+
writeFileSync(options.logPath, body, "utf8");
|
|
48
|
+
return { argv, exitCode: result.code, stdout: result.stdout, stderr: result.stderr, logPath: options.logPath, passed: result.code === 0 };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export async function runTests(run: Run, options: { cwd?: string; argv?: string[]; timeoutSeconds?: number } = {}): Promise<QualityResult> {
|
|
52
|
+
const cwd = options.cwd ?? process.cwd();
|
|
53
|
+
return executeQuality(options.argv ?? qualityCommand(cwd), { cwd, timeoutSeconds: options.timeoutSeconds, signal: run.signal, logPath: resolve(run.trace.directory, "command.log") });
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function asEnvelope(result: QualityResult, what: string): VerifyEnvelope {
|
|
57
|
+
return {
|
|
58
|
+
status: result.passed ? "success" : "fail",
|
|
59
|
+
summary: result.passed ? `${what} passed` : `${what} failed with exit ${result.exitCode}`,
|
|
60
|
+
artifacts: [result.logPath],
|
|
61
|
+
notes_for_next_agent: result.passed ? "" : (result.stderr || result.stdout).slice(-4000),
|
|
62
|
+
tests_run: [`${result.argv.join(" ")} → ${result.exitCode}`],
|
|
63
|
+
};
|
|
64
|
+
}
|