@chankov/agent-fleet 2.0.3 → 2.0.5
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/agents/model-profiles.yaml +69 -13
- package/.pi/agents/peers.yaml +11 -8
- package/.pi/harnesses/agent-hub/README.md +15 -34
- package/.pi/harnesses/agent-hub/config/agents.ts +13 -14
- package/.pi/harnesses/agent-hub/config/model-profiles.ts +216 -0
- package/.pi/harnesses/agent-hub/context/agent-state.ts +1 -1
- package/.pi/harnesses/agent-hub/dispatch-coms.ts +6 -4
- package/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +6 -3
- package/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +2 -0
- package/.pi/harnesses/agent-hub/dispatch-native-types.ts +1 -0
- package/.pi/harnesses/agent-hub/dispatch-native.ts +31 -16
- package/.pi/harnesses/agent-hub/dispatch-observability.ts +6 -1
- package/.pi/harnesses/agent-hub/footer.ts +2 -2
- package/.pi/harnesses/agent-hub/index.ts +128 -49
- package/.pi/harnesses/agent-hub/input/shortcuts.ts +0 -29
- package/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +7 -7
- package/.pi/harnesses/agent-hub/package.json +1 -1
- package/.pi/harnesses/agent-hub/policy/models.ts +35 -8
- package/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
- package/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
- package/.pi/harnesses/agent-hub/provider-semaphore.js +1 -1
- package/.pi/harnesses/agent-hub/research/runtime.ts +3 -1
- package/.pi/harnesses/agent-hub/research/spawn-run.ts +6 -1
- package/.pi/harnesses/agent-hub/spawn.ts +17 -1
- package/.pi/harnesses/agent-hub/tools/action-executors.ts +5 -2
- package/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +34 -1
- package/.pi/harnesses/agent-hub/tools/herdr-executors.ts +4 -0
- package/.pi/harnesses/agent-hub/types.ts +1 -0
- package/.pi/harnesses/agent-hub/ui/activity-dots.ts +16 -0
- package/.pi/harnesses/agent-hub/ui/detail-panel.ts +4 -1
- package/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +4 -2
- package/.pi/harnesses/agent-hub/ui/grid.ts +16 -118
- package/.pi/harnesses/agent-hub/ui/pool.ts +1 -6
- package/.pi/harnesses/agent-hub/ui/running-strip.ts +139 -0
- package/.pi/harnesses/coms/package.json +1 -1
- package/.pi/harnesses/damage-control-continue/package.json +1 -1
- package/.pi/harnesses/lib/fleet-dashboard-ops.ts +0 -5
- package/.pi/harnesses/lib/fleet-dashboard-view.ts +8 -2
- package/.versions/2.0.4/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/2.0.4/.pi/agents/model-profiles.yaml +78 -0
- package/.versions/2.0.4/.pi/agents/peers.yaml +145 -0
- package/.versions/2.0.4/.pi/agents/teams.yaml +41 -0
- package/.versions/2.0.4/.pi/agents/voices.yaml +13 -0
- package/.versions/2.0.4/.pi/damage-control-rules.yaml +297 -0
- package/.versions/2.0.4/.pi/extensions/agent-fleet-update-check/README.md +57 -0
- package/.versions/2.0.4/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
- package/.versions/2.0.4/.pi/extensions/agent-fleet-update-check/package.json +6 -0
- package/.versions/2.0.4/.pi/extensions/btw/README.md +120 -0
- package/.versions/2.0.4/.pi/extensions/btw/index.ts +914 -0
- package/.versions/2.0.4/.pi/extensions/btw/package.json +6 -0
- package/.versions/2.0.4/.pi/extensions/btw/state.js +179 -0
- package/.versions/2.0.4/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
- package/.versions/2.0.4/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
- package/.versions/2.0.4/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/2.0.4/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/2.0.4/.pi/extensions/compact-and-continue/index.ts +120 -0
- package/.versions/2.0.4/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/2.0.4/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/2.0.4/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/2.0.4/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/2.0.4/.pi/extensions/package-lock.json +1175 -0
- package/.versions/2.0.4/.pi/extensions/package.json +9 -0
- package/.versions/2.0.4/.pi/extensions/pi-voice-stt/README.md +205 -0
- package/.versions/2.0.4/.pi/extensions/pi-voice-stt/config.ts +198 -0
- package/.versions/2.0.4/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/2.0.4/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/2.0.4/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/2.0.4/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/2.0.4/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/README.md +1160 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/access-approval.ts +135 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/artifacts.js +146 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/assertion-ledger.js +58 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/backend-policy.js +174 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/budget-continuation.ts +73 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/capability-packs.ts +180 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/context.ts +41 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/models.ts +10 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/config/agents.ts +179 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/config/model-profiles.ts +216 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/config/overrides.ts +153 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +211 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/context/budgets.ts +208 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/context-pressure.ts +191 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/context-window.js +106 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/debate-command.ts +176 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/delegate.ts +446 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/dispatch-coms.ts +234 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/dispatch-native-complete.ts +135 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +156 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +191 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/dispatch-native-types.ts +207 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/dispatch-native.ts +187 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/dispatch-observability.ts +220 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/docs-lane.js +122 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/drift-watchdog.js +218 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/external-blocker.js +85 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/fixtures/registration-surface.json +55 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/footer.ts +30 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/helpers.ts +266 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/hub-state-audit.js +59 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/index.ts +2088 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/input/completions.ts +76 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/input/shortcuts.ts +47 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +123 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +141 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +95 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/policy/models.ts +153 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/policy/profile-runtime.ts +64 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/policy/roster.ts +79 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/policy/work-mode.ts +118 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/poll-command.ts +176 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/presentation.ts +48 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/prompts/context.ts +46 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/prompts/fragments.ts +115 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/prompts/system-prompt.ts +110 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/research/controls.ts +74 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/research/runtime.ts +175 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/research/spawn-run.ts +144 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/return-contract.js +293 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/return-extract.js +75 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/review-findings.js +102 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/run-budget.js +537 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/run-namespace.js +87 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/scope-gate.js +103 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/session-start.ts +42 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/spawn.ts +404 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/timeline.ts +54 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/tools/action-executors.ts +148 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/tools/context.ts +132 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +79 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +199 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/tools/fleet-tools.ts +202 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/tools/herdr-executors.ts +84 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/tools/set-task-tier.ts +29 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/tools/spawn-research.ts +62 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/tools/verification-contract.ts +77 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/types.ts +61 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/ui/context-budget.ts +86 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/ui/detail-panel.ts +178 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +123 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/ui/grid.ts +144 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/ui/history.ts +234 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/ui/zoom.ts +204 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/version.ts +42 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
- package/.versions/2.0.4/.pi/harnesses/agent-hub/work-mode.ts +167 -0
- package/.versions/2.0.4/.pi/harnesses/ask-user-remote/README.md +53 -0
- package/.versions/2.0.4/.pi/harnesses/ask-user-remote/index.ts +532 -0
- package/.versions/2.0.4/.pi/harnesses/ask-user-remote/race-core.js +106 -0
- package/.versions/2.0.4/.pi/harnesses/coms/README.md +100 -0
- package/.versions/2.0.4/.pi/harnesses/coms/index.ts +276 -0
- package/.versions/2.0.4/.pi/harnesses/coms/package.json +7 -0
- package/.versions/2.0.4/.pi/harnesses/coms/version.ts +42 -0
- package/.versions/2.0.4/.pi/harnesses/damage-control-continue/README.md +124 -0
- package/.versions/2.0.4/.pi/harnesses/damage-control-continue/index.ts +536 -0
- package/.versions/2.0.4/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/2.0.4/.pi/harnesses/damage-control-continue/version.ts +42 -0
- package/.versions/2.0.4/.pi/harnesses/lib/coms-core-io.ts +385 -0
- package/.versions/2.0.4/.pi/harnesses/lib/coms-core.ts +577 -0
- package/.versions/2.0.4/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
- package/.versions/2.0.4/.pi/harnesses/lib/context-budget-child-prompt.ts +179 -0
- package/.versions/2.0.4/.pi/harnesses/lib/context-budget-hub-prompt.ts +114 -0
- package/.versions/2.0.4/.pi/harnesses/lib/context-budget-view.ts +107 -0
- package/.versions/2.0.4/.pi/harnesses/lib/context-budget.ts +114 -0
- package/.versions/2.0.4/.pi/harnesses/lib/damage-control-shared.ts +197 -0
- package/.versions/2.0.4/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
- package/.versions/2.0.4/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
- package/.versions/2.0.4/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
- package/.versions/2.0.4/.pi/harnesses/lib/fleet-dashboard-ops.ts +166 -0
- package/.versions/2.0.4/.pi/harnesses/lib/fleet-dashboard-view.ts +142 -0
- package/.versions/2.0.4/.pi/harnesses/lib/fleet-detail-view.ts +247 -0
- package/.versions/2.0.4/.pi/harnesses/lib/fleet-overlay.ts +26 -0
- package/.versions/2.0.4/.pi/harnesses/lib/fleet-panel.ts +34 -0
- package/.versions/2.0.4/.pi/harnesses/lib/fleet-read-model.ts +131 -0
- package/.versions/2.0.4/.pi/harnesses/lib/fleet-selection.ts +24 -0
- package/.versions/2.0.4/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
- package/.versions/2.0.4/.pi/harnesses/lib/herdr-client.ts +472 -0
- package/.versions/2.0.4/.pi/harnesses/lib/herdr-presence.ts +399 -0
- package/.versions/2.0.4/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.versions/2.0.4/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/2.0.4/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
- package/.versions/2.0.4/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/2.0.4/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
- package/.versions/2.0.4/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
- package/.versions/2.0.4/.pi/harnesses/lib/spawned-peers.js +190 -0
- package/.versions/2.0.4/.pi/harnesses/package-lock.json +2039 -0
- package/.versions/2.0.4/.pi/harnesses/package.json +10 -0
- package/.versions/2.0.4/.pi/prompts/af-build.md +24 -0
- package/.versions/2.0.4/.pi/prompts/af-code-simplify.md +22 -0
- package/.versions/2.0.4/.pi/prompts/af-plan.md +17 -0
- package/.versions/2.0.4/.pi/prompts/af-review.md +16 -0
- package/.versions/2.0.4/.pi/prompts/af-set-hermes-telegram.md +15 -0
- package/.versions/2.0.4/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/2.0.4/.pi/prompts/af-ship.md +17 -0
- package/.versions/2.0.4/.pi/prompts/af-spec.md +15 -0
- package/.versions/2.0.4/.pi/prompts/af-test.md +19 -0
- package/.versions/2.0.4/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/2.0.4/.version +1 -0
- package/.versions/2.0.4/agents/architect.md +25 -0
- package/.versions/2.0.4/agents/bowser.md +28 -0
- package/.versions/2.0.4/agents/builder.md +56 -0
- package/.versions/2.0.4/agents/code-reviewer.md +210 -0
- package/.versions/2.0.4/agents/deep-researcher.md +33 -0
- package/.versions/2.0.4/agents/documenter.md +22 -0
- package/.versions/2.0.4/agents/orchestrator.md +23 -0
- package/.versions/2.0.4/agents/plan-reviewer.md +84 -0
- package/.versions/2.0.4/agents/planner.md +105 -0
- package/.versions/2.0.4/agents/releaser.md +25 -0
- package/.versions/2.0.4/agents/researcher.md +31 -0
- package/.versions/2.0.4/agents/security-auditor.md +168 -0
- package/.versions/2.0.4/agents/test-engineer.md +154 -0
- package/.versions/2.0.4/agents/web-debugger.md +44 -0
- package/.versions/2.0.4/agents/web-performance-auditor.md +194 -0
- package/.versions/2.0.4/bin/catalog/harness-runtime-closure.json +36 -0
- package/.versions/2.0.4/codex/CONDUCTOR.md +148 -0
- package/.versions/2.0.4/docs/ARCHITECTURE.md +407 -0
- package/.versions/2.0.4/docs/agent-fleet-setup.md +547 -0
- package/.versions/2.0.4/docs/claude-code-coms-bridge.md +133 -0
- package/.versions/2.0.4/docs/codex-remote-conductor.md +170 -0
- package/.versions/2.0.4/docs/coms-hermes-bridge.md +189 -0
- package/.versions/2.0.4/docs/getting-started.md +124 -0
- package/.versions/2.0.4/docs/npm-install.md +299 -0
- package/.versions/2.0.4/docs/pi-extensions.md +447 -0
- package/.versions/2.0.4/docs/pi-setup.md +74 -0
- package/.versions/2.0.4/docs/skill-anatomy.md +150 -0
- package/.versions/2.0.4/hermes/README.md +347 -0
- package/.versions/2.0.4/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/.versions/2.0.4/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/.versions/2.0.4/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/2.0.4/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/2.0.4/hermes/gates/gate-o-capability.md +8 -0
- package/.versions/2.0.4/hermes/gates/gate-o-validator-fixtures.json +1 -0
- package/.versions/2.0.4/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +770 -0
- package/.versions/2.0.4/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/.versions/2.0.4/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/.versions/2.0.4/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/.versions/2.0.4/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/.versions/2.0.4/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/.versions/2.0.4/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/.versions/2.0.4/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/.versions/2.0.4/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/.versions/2.0.4/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/.versions/2.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/.versions/2.0.4/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/2.0.4/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/2.0.4/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/2.0.4/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/2.0.4/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/.versions/2.0.4/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/.versions/2.0.4/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/.versions/2.0.4/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/.versions/2.0.4/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/.versions/2.0.4/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/.versions/2.0.4/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/.versions/2.0.4/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/.versions/2.0.4/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/.versions/2.0.4/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/.versions/2.0.4/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/.versions/2.0.4/hermes/watchdog-tests/__init__.py +0 -0
- package/.versions/2.0.4/hooks/coms-stop-hook.mjs +84 -0
- package/.versions/2.0.4/install-manifest.json +2942 -0
- package/.versions/2.0.4/justfile +289 -0
- package/.versions/2.0.4/manifest-meta.json +969 -0
- package/.versions/2.0.4/references/accessibility-checklist.md +160 -0
- package/.versions/2.0.4/references/communication-contract.md +26 -0
- package/.versions/2.0.4/references/definition-of-done.md +67 -0
- package/.versions/2.0.4/references/fleet-coordination-patterns.md +171 -0
- package/.versions/2.0.4/references/observability-checklist.md +91 -0
- package/.versions/2.0.4/references/orchestration-patterns.md +370 -0
- package/.versions/2.0.4/references/performance-checklist.md +153 -0
- package/.versions/2.0.4/references/prompting-patterns.md +380 -0
- package/.versions/2.0.4/references/security-checklist.md +179 -0
- package/.versions/2.0.4/references/testing-patterns.md +236 -0
- package/.versions/2.0.4/references/workflow-authoring.md +304 -0
- package/.versions/2.0.4/scripts/claude-code-preflight.ts +70 -0
- package/.versions/2.0.4/scripts/codex-conductor.ts +41 -0
- package/.versions/2.0.4/scripts/codex-remote-control.ts +167 -0
- package/.versions/2.0.4/scripts/coms-claude-bridge.ts +411 -0
- package/.versions/2.0.4/scripts/coms-cli.ts +484 -0
- package/.versions/2.0.4/scripts/coms-hermes-bridge.ts +413 -0
- package/.versions/2.0.4/scripts/fleet.ts +222 -0
- package/.versions/2.0.4/scripts/flow.ts +137 -0
- package/.versions/2.0.4/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/2.0.4/scripts/hermes-monitor-scenario.ts +474 -0
- package/.versions/2.0.4/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/.versions/2.0.4/scripts/install-hermes-plugin.sh +180 -0
- package/.versions/2.0.4/scripts/lib/claude-bridge-core.ts +210 -0
- package/.versions/2.0.4/scripts/lib/codex-conductor.ts +88 -0
- package/.versions/2.0.4/scripts/lib/codex-remote-control.ts +482 -0
- package/.versions/2.0.4/scripts/lib/coms-envelope.ts +582 -0
- package/.versions/2.0.4/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/2.0.4/scripts/lib/fleet-command.ts +270 -0
- package/.versions/2.0.4/scripts/lib/flow-command.ts +93 -0
- package/.versions/2.0.4/scripts/lib/flow-maintenance.ts +230 -0
- package/.versions/2.0.4/scripts/lib/herdr-layout.ts +281 -0
- package/.versions/2.0.4/scripts/lib/hermes-bridge-core.ts +241 -0
- package/.versions/2.0.4/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.versions/2.0.4/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/.versions/2.0.4/scripts/lib/hermes-monitor-model.ts +3 -0
- package/.versions/2.0.4/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.versions/2.0.4/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.versions/2.0.4/scripts/lib/hermes-monitor-store.ts +2 -0
- package/.versions/2.0.4/scripts/lib/monitor-env.ts +146 -0
- package/.versions/2.0.4/scripts/lib/peer-launch.ts +318 -0
- package/.versions/2.0.4/scripts/lib/persona-banner.ts +62 -0
- package/.versions/2.0.4/scripts/lib/runtime-dependencies.js +124 -0
- package/.versions/2.0.4/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/2.0.4/scripts/lib/team-project.ts +213 -0
- package/.versions/2.0.4/scripts/lib/team-snapshot.ts +147 -0
- package/.versions/2.0.4/scripts/package-lock.json +35 -0
- package/.versions/2.0.4/scripts/package.json +9 -0
- package/.versions/2.0.4/scripts/peer-banner.ts +40 -0
- package/.versions/2.0.4/scripts/peer-launch.ts +285 -0
- package/.versions/2.0.4/scripts/team-snapshot.ts +237 -0
- package/.versions/2.0.4/scripts/team-up.ts +406 -0
- package/.versions/2.0.4/scripts/workflows/lib/agent-phase.ts +133 -0
- package/.versions/2.0.4/scripts/workflows/lib/changes.ts +61 -0
- package/.versions/2.0.4/scripts/workflows/lib/debate.ts +149 -0
- package/.versions/2.0.4/scripts/workflows/lib/env.ts +34 -0
- package/.versions/2.0.4/scripts/workflows/lib/envelopes.ts +169 -0
- package/.versions/2.0.4/scripts/workflows/lib/gates.ts +81 -0
- package/.versions/2.0.4/scripts/workflows/lib/git.ts +96 -0
- package/.versions/2.0.4/scripts/workflows/lib/merge.ts +95 -0
- package/.versions/2.0.4/scripts/workflows/lib/model-profile.ts +22 -0
- package/.versions/2.0.4/scripts/workflows/lib/model-visibility.ts +92 -0
- package/.versions/2.0.4/scripts/workflows/lib/permissions.ts +130 -0
- package/.versions/2.0.4/scripts/workflows/lib/personas.ts +57 -0
- package/.versions/2.0.4/scripts/workflows/lib/poll.ts +86 -0
- package/.versions/2.0.4/scripts/workflows/lib/quality.ts +64 -0
- package/.versions/2.0.4/scripts/workflows/lib/run.ts +108 -0
- package/.versions/2.0.4/scripts/workflows/lib/trace.ts +34 -0
- package/.versions/2.0.4/scripts/workflows/lib/voices.ts +128 -0
- package/.versions/2.0.4/scripts/workflows/lib/writer-lease.ts +112 -0
- package/.versions/2.0.4/scripts/workflows/tsconfig.json +22 -0
- package/.versions/2.0.4/scripts/workflows/wf-build-test.ts +61 -0
- package/.versions/2.0.4/scripts/workflows/wf-debate.ts +87 -0
- package/.versions/2.0.4/scripts/workflows/wf-document.ts +50 -0
- package/.versions/2.0.4/scripts/workflows/wf-poll.ts +95 -0
- package/.versions/2.0.4/scripts/workflows/wf-quality.ts +20 -0
- package/.versions/2.0.4/scripts/workflows/wf-scout.ts +38 -0
- package/.versions/2.0.4/skills/_internal/grilling.md +59 -0
- package/.versions/2.0.4/skills/browser-testing-with-devtools/SKILL.md +351 -0
- package/.versions/2.0.4/skills/code-review-and-quality/SKILL.md +381 -0
- package/.versions/2.0.4/skills/compound-learning/SKILL.md +137 -0
- package/.versions/2.0.4/skills/context-engineering/SKILL.md +291 -0
- package/.versions/2.0.4/skills/deprecation-and-migration/SKILL.md +206 -0
- package/.versions/2.0.4/skills/designing-agents/SKILL.md +394 -0
- package/.versions/2.0.4/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/2.0.4/skills/drafting-workflows/SKILL.md +143 -0
- package/.versions/2.0.4/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
- package/.versions/2.0.4/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.4/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/2.0.4/skills/idea-refine/SKILL.md +182 -0
- package/.versions/2.0.4/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.4/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.4/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.4/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.4/skills/incremental-implementation/SKILL.md +298 -0
- package/.versions/2.0.4/skills/interview-me/SKILL.md +226 -0
- package/.versions/2.0.4/skills/orchestration-verification/SKILL.md +181 -0
- package/.versions/2.0.4/skills/peer-coms/SKILL.md +90 -0
- package/.versions/2.0.4/skills/performance-optimization/SKILL.md +350 -0
- package/.versions/2.0.4/skills/planning-and-task-breakdown/SKILL.md +265 -0
- package/.versions/2.0.4/skills/security-and-hardening/SKILL.md +461 -0
- package/.versions/2.0.4/skills/spec-driven-development/SKILL.md +256 -0
- package/.versions/2.0.4/skills/using-agent-skills/SKILL.md +197 -0
- package/.versions/2.0.4/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/README.md +11 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
- package/.versions/2.0.4/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
- package/.versions/2.0.5/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/2.0.5/.pi/agents/model-profiles.yaml +83 -0
- package/.versions/2.0.5/.pi/agents/peers.yaml +145 -0
- package/.versions/2.0.5/.pi/agents/teams.yaml +41 -0
- package/.versions/2.0.5/.pi/agents/voices.yaml +13 -0
- package/.versions/2.0.5/.pi/damage-control-rules.yaml +297 -0
- package/.versions/2.0.5/.pi/extensions/agent-fleet-update-check/README.md +57 -0
- package/.versions/2.0.5/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
- package/.versions/2.0.5/.pi/extensions/agent-fleet-update-check/package.json +6 -0
- package/.versions/2.0.5/.pi/extensions/btw/README.md +120 -0
- package/.versions/2.0.5/.pi/extensions/btw/index.ts +914 -0
- package/.versions/2.0.5/.pi/extensions/btw/package.json +6 -0
- package/.versions/2.0.5/.pi/extensions/btw/state.js +179 -0
- package/.versions/2.0.5/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
- package/.versions/2.0.5/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
- package/.versions/2.0.5/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/2.0.5/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/2.0.5/.pi/extensions/compact-and-continue/index.ts +120 -0
- package/.versions/2.0.5/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/2.0.5/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/2.0.5/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/2.0.5/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/2.0.5/.pi/extensions/package-lock.json +1175 -0
- package/.versions/2.0.5/.pi/extensions/package.json +9 -0
- package/.versions/2.0.5/.pi/extensions/pi-voice-stt/README.md +205 -0
- package/.versions/2.0.5/.pi/extensions/pi-voice-stt/config.ts +198 -0
- package/.versions/2.0.5/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/2.0.5/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/2.0.5/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/2.0.5/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/2.0.5/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/README.md +1139 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/access-approval.ts +135 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/artifacts.js +146 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/assertion-ledger.js +58 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/backend-policy.js +174 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/budget-continuation.ts +73 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/capability-packs.ts +180 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/context.ts +41 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/models.ts +10 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/config/agents.ts +179 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/config/model-profiles.ts +216 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/config/overrides.ts +153 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +211 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/context/budgets.ts +208 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/context-pressure.ts +191 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/context-window.js +106 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/debate-command.ts +176 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/delegate.ts +446 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-coms.ts +234 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-native-complete.ts +135 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +156 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +193 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-native-types.ts +208 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-native.ts +199 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/docs-lane.js +122 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/drift-watchdog.js +218 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/external-blocker.js +85 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/fixtures/registration-surface.json +55 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/footer.ts +30 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/helpers.ts +266 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/hub-state-audit.js +59 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/index.ts +2115 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/input/completions.ts +76 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/input/shortcuts.ts +18 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +123 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +141 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +95 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/policy/models.ts +153 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/policy/roster.ts +79 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/policy/work-mode.ts +118 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/poll-command.ts +176 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/presentation.ts +48 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/prompts/context.ts +46 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/prompts/fragments.ts +115 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/prompts/system-prompt.ts +110 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/research/controls.ts +74 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/research/runtime.ts +177 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/research/spawn-run.ts +148 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/return-contract.js +293 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/return-extract.js +75 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/review-findings.js +102 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/run-budget.js +537 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/run-namespace.js +87 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/scope-gate.js +103 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/session-start.ts +42 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/spawn.ts +404 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/timeline.ts +54 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/action-executors.ts +149 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/context.ts +132 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +79 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +232 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/fleet-tools.ts +202 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/herdr-executors.ts +86 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/set-task-tier.ts +29 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/spawn-research.ts +62 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/verification-contract.ts +77 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/types.ts +62 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/activity-dots.ts +16 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/context-budget.ts +86 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/detail-panel.ts +178 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +125 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/grid.ts +42 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/history.ts +234 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/pool.ts +98 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/running-strip.ts +139 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/zoom.ts +204 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/version.ts +42 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/work-mode.ts +167 -0
- package/.versions/2.0.5/.pi/harnesses/ask-user-remote/README.md +53 -0
- package/.versions/2.0.5/.pi/harnesses/ask-user-remote/index.ts +532 -0
- package/.versions/2.0.5/.pi/harnesses/ask-user-remote/race-core.js +106 -0
- package/.versions/2.0.5/.pi/harnesses/coms/README.md +100 -0
- package/.versions/2.0.5/.pi/harnesses/coms/index.ts +276 -0
- package/.versions/2.0.5/.pi/harnesses/coms/package.json +7 -0
- package/.versions/2.0.5/.pi/harnesses/coms/version.ts +42 -0
- package/.versions/2.0.5/.pi/harnesses/damage-control-continue/README.md +124 -0
- package/.versions/2.0.5/.pi/harnesses/damage-control-continue/index.ts +536 -0
- package/.versions/2.0.5/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/2.0.5/.pi/harnesses/damage-control-continue/version.ts +42 -0
- package/.versions/2.0.5/.pi/harnesses/lib/coms-core-io.ts +385 -0
- package/.versions/2.0.5/.pi/harnesses/lib/coms-core.ts +577 -0
- package/.versions/2.0.5/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
- package/.versions/2.0.5/.pi/harnesses/lib/context-budget-child-prompt.ts +179 -0
- package/.versions/2.0.5/.pi/harnesses/lib/context-budget-hub-prompt.ts +114 -0
- package/.versions/2.0.5/.pi/harnesses/lib/context-budget-view.ts +107 -0
- package/.versions/2.0.5/.pi/harnesses/lib/context-budget.ts +114 -0
- package/.versions/2.0.5/.pi/harnesses/lib/damage-control-shared.ts +197 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fleet-dashboard-ops.ts +161 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fleet-dashboard-view.ts +148 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fleet-detail-view.ts +247 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fleet-overlay.ts +26 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fleet-panel.ts +34 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fleet-read-model.ts +131 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fleet-selection.ts +24 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
- package/.versions/2.0.5/.pi/harnesses/lib/herdr-client.ts +472 -0
- package/.versions/2.0.5/.pi/harnesses/lib/herdr-presence.ts +399 -0
- package/.versions/2.0.5/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.versions/2.0.5/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/2.0.5/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
- package/.versions/2.0.5/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/2.0.5/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
- package/.versions/2.0.5/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
- package/.versions/2.0.5/.pi/harnesses/lib/spawned-peers.js +190 -0
- package/.versions/2.0.5/.pi/harnesses/package-lock.json +2039 -0
- package/.versions/2.0.5/.pi/harnesses/package.json +10 -0
- package/.versions/2.0.5/.pi/prompts/af-build.md +24 -0
- package/.versions/2.0.5/.pi/prompts/af-code-simplify.md +22 -0
- package/.versions/2.0.5/.pi/prompts/af-plan.md +17 -0
- package/.versions/2.0.5/.pi/prompts/af-review.md +16 -0
- package/.versions/2.0.5/.pi/prompts/af-set-hermes-telegram.md +15 -0
- package/.versions/2.0.5/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/2.0.5/.pi/prompts/af-ship.md +17 -0
- package/.versions/2.0.5/.pi/prompts/af-spec.md +15 -0
- package/.versions/2.0.5/.pi/prompts/af-test.md +19 -0
- package/.versions/2.0.5/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/2.0.5/.version +1 -0
- package/.versions/2.0.5/agents/architect.md +25 -0
- package/.versions/2.0.5/agents/bowser.md +28 -0
- package/.versions/2.0.5/agents/builder.md +56 -0
- package/.versions/2.0.5/agents/code-reviewer.md +210 -0
- package/.versions/2.0.5/agents/deep-researcher.md +33 -0
- package/.versions/2.0.5/agents/documenter.md +23 -0
- package/.versions/2.0.5/agents/orchestrator.md +23 -0
- package/.versions/2.0.5/agents/plan-reviewer.md +84 -0
- package/.versions/2.0.5/agents/planner.md +106 -0
- package/.versions/2.0.5/agents/releaser.md +25 -0
- package/.versions/2.0.5/agents/researcher.md +31 -0
- package/.versions/2.0.5/agents/security-auditor.md +168 -0
- package/.versions/2.0.5/agents/test-engineer.md +154 -0
- package/.versions/2.0.5/agents/web-debugger.md +44 -0
- package/.versions/2.0.5/agents/web-performance-auditor.md +194 -0
- package/.versions/2.0.5/bin/catalog/harness-runtime-closure.json +36 -0
- package/.versions/2.0.5/codex/CONDUCTOR.md +148 -0
- package/.versions/2.0.5/docs/ARCHITECTURE.md +407 -0
- package/.versions/2.0.5/docs/agent-fleet-setup.md +561 -0
- package/.versions/2.0.5/docs/claude-code-coms-bridge.md +133 -0
- package/.versions/2.0.5/docs/codex-remote-conductor.md +170 -0
- package/.versions/2.0.5/docs/coms-hermes-bridge.md +189 -0
- package/.versions/2.0.5/docs/getting-started.md +124 -0
- package/.versions/2.0.5/docs/npm-install.md +299 -0
- package/.versions/2.0.5/docs/pi-extensions.md +446 -0
- package/.versions/2.0.5/docs/pi-setup.md +74 -0
- package/.versions/2.0.5/docs/skill-anatomy.md +150 -0
- package/.versions/2.0.5/hermes/README.md +347 -0
- package/.versions/2.0.5/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/.versions/2.0.5/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/.versions/2.0.5/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/2.0.5/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/2.0.5/hermes/gates/gate-o-capability.md +8 -0
- package/.versions/2.0.5/hermes/gates/gate-o-validator-fixtures.json +1 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +770 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/2.0.5/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/2.0.5/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/.versions/2.0.5/hermes/watchdog-tests/__init__.py +0 -0
- package/.versions/2.0.5/hooks/coms-stop-hook.mjs +84 -0
- package/.versions/2.0.5/install-manifest.json +2942 -0
- package/.versions/2.0.5/justfile +289 -0
- package/.versions/2.0.5/manifest-meta.json +969 -0
- package/.versions/2.0.5/references/accessibility-checklist.md +160 -0
- package/.versions/2.0.5/references/communication-contract.md +26 -0
- package/.versions/2.0.5/references/definition-of-done.md +67 -0
- package/.versions/2.0.5/references/fleet-coordination-patterns.md +171 -0
- package/.versions/2.0.5/references/observability-checklist.md +91 -0
- package/.versions/2.0.5/references/orchestration-patterns.md +370 -0
- package/.versions/2.0.5/references/performance-checklist.md +153 -0
- package/.versions/2.0.5/references/prompting-patterns.md +380 -0
- package/.versions/2.0.5/references/security-checklist.md +179 -0
- package/.versions/2.0.5/references/testing-patterns.md +236 -0
- package/.versions/2.0.5/references/workflow-authoring.md +304 -0
- package/.versions/2.0.5/scripts/claude-code-preflight.ts +70 -0
- package/.versions/2.0.5/scripts/codex-conductor.ts +41 -0
- package/.versions/2.0.5/scripts/codex-remote-control.ts +167 -0
- package/.versions/2.0.5/scripts/coms-claude-bridge.ts +411 -0
- package/.versions/2.0.5/scripts/coms-cli.ts +484 -0
- package/.versions/2.0.5/scripts/coms-hermes-bridge.ts +413 -0
- package/.versions/2.0.5/scripts/fleet.ts +222 -0
- package/.versions/2.0.5/scripts/flow.ts +137 -0
- package/.versions/2.0.5/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/2.0.5/scripts/hermes-monitor-scenario.ts +474 -0
- package/.versions/2.0.5/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/.versions/2.0.5/scripts/install-hermes-plugin.sh +180 -0
- package/.versions/2.0.5/scripts/lib/claude-bridge-core.ts +210 -0
- package/.versions/2.0.5/scripts/lib/codex-conductor.ts +88 -0
- package/.versions/2.0.5/scripts/lib/codex-remote-control.ts +482 -0
- package/.versions/2.0.5/scripts/lib/coms-envelope.ts +582 -0
- package/.versions/2.0.5/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/2.0.5/scripts/lib/fleet-command.ts +270 -0
- package/.versions/2.0.5/scripts/lib/flow-command.ts +93 -0
- package/.versions/2.0.5/scripts/lib/flow-maintenance.ts +230 -0
- package/.versions/2.0.5/scripts/lib/herdr-layout.ts +281 -0
- package/.versions/2.0.5/scripts/lib/hermes-bridge-core.ts +241 -0
- package/.versions/2.0.5/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.versions/2.0.5/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/.versions/2.0.5/scripts/lib/hermes-monitor-model.ts +3 -0
- package/.versions/2.0.5/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.versions/2.0.5/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.versions/2.0.5/scripts/lib/hermes-monitor-store.ts +2 -0
- package/.versions/2.0.5/scripts/lib/monitor-env.ts +146 -0
- package/.versions/2.0.5/scripts/lib/peer-launch.ts +318 -0
- package/.versions/2.0.5/scripts/lib/persona-banner.ts +62 -0
- package/.versions/2.0.5/scripts/lib/runtime-dependencies.js +124 -0
- package/.versions/2.0.5/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/2.0.5/scripts/lib/team-project.ts +213 -0
- package/.versions/2.0.5/scripts/lib/team-snapshot.ts +147 -0
- package/.versions/2.0.5/scripts/package-lock.json +35 -0
- package/.versions/2.0.5/scripts/package.json +9 -0
- package/.versions/2.0.5/scripts/peer-banner.ts +40 -0
- package/.versions/2.0.5/scripts/peer-launch.ts +285 -0
- package/.versions/2.0.5/scripts/team-snapshot.ts +237 -0
- package/.versions/2.0.5/scripts/team-up.ts +406 -0
- package/.versions/2.0.5/scripts/workflows/lib/agent-phase.ts +133 -0
- package/.versions/2.0.5/scripts/workflows/lib/changes.ts +61 -0
- package/.versions/2.0.5/scripts/workflows/lib/debate.ts +149 -0
- package/.versions/2.0.5/scripts/workflows/lib/env.ts +34 -0
- package/.versions/2.0.5/scripts/workflows/lib/envelopes.ts +169 -0
- package/.versions/2.0.5/scripts/workflows/lib/gates.ts +81 -0
- package/.versions/2.0.5/scripts/workflows/lib/git.ts +96 -0
- package/.versions/2.0.5/scripts/workflows/lib/merge.ts +95 -0
- package/.versions/2.0.5/scripts/workflows/lib/model-profile.ts +22 -0
- package/.versions/2.0.5/scripts/workflows/lib/model-visibility.ts +92 -0
- package/.versions/2.0.5/scripts/workflows/lib/permissions.ts +130 -0
- package/.versions/2.0.5/scripts/workflows/lib/personas.ts +57 -0
- package/.versions/2.0.5/scripts/workflows/lib/poll.ts +86 -0
- package/.versions/2.0.5/scripts/workflows/lib/quality.ts +64 -0
- package/.versions/2.0.5/scripts/workflows/lib/run.ts +108 -0
- package/.versions/2.0.5/scripts/workflows/lib/trace.ts +34 -0
- package/.versions/2.0.5/scripts/workflows/lib/voices.ts +128 -0
- package/.versions/2.0.5/scripts/workflows/lib/writer-lease.ts +112 -0
- package/.versions/2.0.5/scripts/workflows/tsconfig.json +22 -0
- package/.versions/2.0.5/scripts/workflows/wf-build-test.ts +61 -0
- package/.versions/2.0.5/scripts/workflows/wf-debate.ts +87 -0
- package/.versions/2.0.5/scripts/workflows/wf-document.ts +50 -0
- package/.versions/2.0.5/scripts/workflows/wf-poll.ts +95 -0
- package/.versions/2.0.5/scripts/workflows/wf-quality.ts +20 -0
- package/.versions/2.0.5/scripts/workflows/wf-scout.ts +38 -0
- package/.versions/2.0.5/skills/_internal/grilling.md +59 -0
- package/.versions/2.0.5/skills/browser-testing-with-devtools/SKILL.md +351 -0
- package/.versions/2.0.5/skills/code-review-and-quality/SKILL.md +381 -0
- package/.versions/2.0.5/skills/compound-learning/SKILL.md +137 -0
- package/.versions/2.0.5/skills/context-engineering/SKILL.md +291 -0
- package/.versions/2.0.5/skills/deprecation-and-migration/SKILL.md +206 -0
- package/.versions/2.0.5/skills/designing-agents/SKILL.md +394 -0
- package/.versions/2.0.5/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/2.0.5/skills/drafting-workflows/SKILL.md +143 -0
- package/.versions/2.0.5/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
- package/.versions/2.0.5/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.5/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/2.0.5/skills/idea-refine/SKILL.md +182 -0
- package/.versions/2.0.5/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.5/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.5/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.5/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.5/skills/incremental-implementation/SKILL.md +298 -0
- package/.versions/2.0.5/skills/interview-me/SKILL.md +226 -0
- package/.versions/2.0.5/skills/orchestration-verification/SKILL.md +181 -0
- package/.versions/2.0.5/skills/peer-coms/SKILL.md +90 -0
- package/.versions/2.0.5/skills/performance-optimization/SKILL.md +350 -0
- package/.versions/2.0.5/skills/planning-and-task-breakdown/SKILL.md +265 -0
- package/.versions/2.0.5/skills/security-and-hardening/SKILL.md +461 -0
- package/.versions/2.0.5/skills/spec-driven-development/SKILL.md +256 -0
- package/.versions/2.0.5/skills/using-agent-skills/SKILL.md +197 -0
- package/.versions/2.0.5/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/README.md +11 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
- package/CHANGELOG.md +13 -0
- package/README.md +1 -1
- package/agents/builder.md +2 -2
- package/agents/documenter.md +2 -1
- package/agents/planner.md +2 -1
- package/agents/releaser.md +2 -2
- package/bin/catalog/harness-runtime-closure.json +2 -0
- package/bin/cli.js +47 -9
- package/bin/lib/doctor.js +35 -2
- package/bin/lib/reconcile.js +3 -2
- package/docs/agent-fleet-setup.md +88 -0
- package/docs/claude-code-coms-bridge.md +5 -0
- package/docs/getting-started.md +5 -0
- package/docs/npm-install.md +12 -5
- package/docs/pi-extensions.md +3 -4
- package/install-manifest.json +3 -1
- package/justfile +1 -1
- package/package.json +5 -3
- package/scripts/claude-code-preflight.ts +70 -0
- package/scripts/fleet.ts +23 -0
- package/scripts/lib/runtime-dependencies.js +124 -0
- package/scripts/peer-launch.ts +27 -1
- package/scripts/workflows/lib/agent-phase.ts +2 -1
- package/scripts/workflows/lib/model-profile.ts +22 -0
- package/scripts/workflows/lib/personas.ts +6 -3
- package/scripts/workflows/lib/voices.ts +3 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { AutocompleteItem } from "@mariozechner/pi-tui";
|
|
2
|
+
|
|
3
|
+
interface CompletionDef { name: string; subagents?: Record<string, { model?: string }> }
|
|
4
|
+
interface CompletionState<TDef extends CompletionDef> { def: TDef; status: string; delegations?: Map<string, { id: string; status: string }> }
|
|
5
|
+
interface CompletionResearch<TDef extends CompletionDef> { id: number; def: TDef; persona: boolean; status: string }
|
|
6
|
+
interface CompletionPeer { name: string; purpose?: string; model: string }
|
|
7
|
+
|
|
8
|
+
export interface CompletionDeps<TDef extends CompletionDef> {
|
|
9
|
+
getAgents(): Iterable<CompletionState<TDef>>;
|
|
10
|
+
getResearch(): Iterable<CompletionResearch<TDef>>;
|
|
11
|
+
getResearchPersonas(): TDef[];
|
|
12
|
+
getModelProfiles(): Record<string, Record<string, string>>;
|
|
13
|
+
getPeers(): CompletionPeer[];
|
|
14
|
+
displayName(name: string): string;
|
|
15
|
+
shortModel(model: string | undefined): string;
|
|
16
|
+
resolvedModel(def: TDef): string | undefined;
|
|
17
|
+
resolvedThinking(def: TDef): string | undefined;
|
|
18
|
+
resolveThinkingLevel(value: string | undefined): string;
|
|
19
|
+
resolvedSubagentModel(persona: string, role: string, fallback?: string): string;
|
|
20
|
+
getSubagentOverride(persona: string, role: string): string | undefined;
|
|
21
|
+
getSubstitutionSources(): Array<{ spec: string; label: string }>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface CompletionPresentation {
|
|
25
|
+
agentNames(prefix: string): AutocompleteItem[] | null;
|
|
26
|
+
zoom(prefix: string): AutocompleteItem[] | null;
|
|
27
|
+
agentModels(prefix: string): AutocompleteItem[] | null;
|
|
28
|
+
agentThinking(prefix: string): AutocompleteItem[] | null;
|
|
29
|
+
modelProfiles(prefix: string): AutocompleteItem[] | null;
|
|
30
|
+
substitutions(prefix: string): AutocompleteItem[] | null;
|
|
31
|
+
researchHandles(prefix: string): AutocompleteItem[] | null;
|
|
32
|
+
subagentTargets(prefix: string): AutocompleteItem[] | null;
|
|
33
|
+
agentsKill(prefix: string): AutocompleteItem[] | null;
|
|
34
|
+
comsPeers(prefix: string): AutocompleteItem[] | null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function filter(items: AutocompleteItem[], prefix: string): AutocompleteItem[] | null {
|
|
38
|
+
if (items.length === 0) return null;
|
|
39
|
+
const matched = items.filter(item => item.value.toLowerCase().startsWith(prefix.toLowerCase()));
|
|
40
|
+
return matched.length > 0 ? matched : items;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function createCompletionPresentation<TDef extends CompletionDef>(deps: CompletionDeps<TDef>): CompletionPresentation {
|
|
44
|
+
const agents = () => Array.from(deps.getAgents());
|
|
45
|
+
const research = () => Array.from(deps.getResearch());
|
|
46
|
+
const agentNames = (prefix: string) => filter(agents().map(state => ({ value: state.def.name, label: `${deps.displayName(state.def.name)} (${state.status})` })), prefix);
|
|
47
|
+
const researchHandles = (prefix: string) => filter(research().map(state => ({ value: `r${state.id}`, label: `r${state.id} ${state.persona ? deps.displayName(state.def.name) : "research"} (${state.status})` })), prefix);
|
|
48
|
+
const subagentTargets = agentNames;
|
|
49
|
+
return {
|
|
50
|
+
agentNames,
|
|
51
|
+
zoom: prefix => filter([
|
|
52
|
+
...agents().map(state => ({ value: state.def.name, label: `${deps.displayName(state.def.name)} (${state.status})` })),
|
|
53
|
+
...research().map(state => ({ value: `r${state.id}`, label: `r${state.id} ${state.persona ? deps.displayName(state.def.name) : "research"} (${state.status})` })),
|
|
54
|
+
...agents().flatMap(state => Array.from(state.delegations?.values() ?? []).map(child => ({ value: child.id, label: `${child.id} — delegate of ${deps.displayName(state.def.name)} (${child.status})` }))),
|
|
55
|
+
], prefix),
|
|
56
|
+
agentModels: prefix => filter([
|
|
57
|
+
...agents().map(state => ({ value: state.def.name, label: `${deps.displayName(state.def.name)} (${state.status})` })),
|
|
58
|
+
...deps.getResearchPersonas().map(def => ({ value: def.name, label: `${deps.displayName(def.name)} (research — ${deps.shortModel(deps.resolvedModel(def))})` })),
|
|
59
|
+
...agents().flatMap(state => Object.entries(state.def.subagents ?? {}).map(([role, spec]) => {
|
|
60
|
+
const override = deps.getSubagentOverride(state.def.name, role);
|
|
61
|
+
const effective = deps.resolvedSubagentModel(state.def.name, role, spec.model);
|
|
62
|
+
return { value: `${state.def.name}.${role}`, label: `${state.def.name}.${role} — ${deps.shortModel(effective)}${override || effective !== spec.model ? " (switched)" : ""}` };
|
|
63
|
+
})),
|
|
64
|
+
], prefix),
|
|
65
|
+
agentThinking: prefix => filter([
|
|
66
|
+
...agents().map(state => ({ value: state.def.name, label: `${deps.displayName(state.def.name)} — ${deps.resolveThinkingLevel(deps.resolvedThinking(state.def))}` })),
|
|
67
|
+
...deps.getResearchPersonas().map(def => ({ value: def.name, label: `${deps.displayName(def.name)} (research) — ${deps.resolveThinkingLevel(deps.resolvedThinking(def))}` })),
|
|
68
|
+
], prefix),
|
|
69
|
+
modelProfiles: prefix => filter(Object.entries(deps.getModelProfiles()).map(([name, entries]) => ({ value: name, label: `${name} — ${Object.entries(entries).map(([persona, model]) => `${persona}: ${deps.shortModel(model)}`).join(", ")}` })), prefix),
|
|
70
|
+
substitutions: prefix => filter(deps.getSubstitutionSources().map(choice => ({ value: choice.spec, label: choice.label })), prefix),
|
|
71
|
+
researchHandles,
|
|
72
|
+
subagentTargets,
|
|
73
|
+
agentsKill: prefix => filter(research().length > 0 ? [...(agentNames("") ?? []), ...(researchHandles("") ?? []), { value: "all", label: "all — kill & remove every live research helper" }] : agentNames("") ?? [], prefix),
|
|
74
|
+
comsPeers: prefix => filter(deps.getPeers().map(peer => ({ value: peer.name, label: `${peer.name} — ${peer.purpose || peer.model}` })), prefix),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-agent";
|
|
2
|
+
|
|
3
|
+
export interface ShortcutPorts {
|
|
4
|
+
setWidgetContext(ctx: ExtensionContext): void;
|
|
5
|
+
openFleetDashboard(ctx: ExtensionContext): Promise<void>;
|
|
6
|
+
workModeStatusText(): string;
|
|
7
|
+
openWorkModePicker(ctx: ExtensionContext): Promise<void>;
|
|
8
|
+
isCompact(): boolean;
|
|
9
|
+
toggleCompact(): string;
|
|
10
|
+
refreshWidgets(): void;
|
|
11
|
+
getSwitchableKeys(): string[];
|
|
12
|
+
getMarkedAgent(): string | null;
|
|
13
|
+
setMarkedAgent(key: string | null): void;
|
|
14
|
+
clampMarker(): void;
|
|
15
|
+
openMarkedAgent(ctx: ExtensionContext, key: string): Promise<boolean>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function registerInputShortcuts(pi: ExtensionAPI, ports: ShortcutPorts): void {
|
|
19
|
+
const withContext = (ctx: ExtensionContext) => ports.setWidgetContext(ctx);
|
|
20
|
+
const cycleMarker = (delta: number, ctx: ExtensionContext) => {
|
|
21
|
+
withContext(ctx);
|
|
22
|
+
if (!ports.isCompact()) { ctx.ui.notify("Agent switching is a compact-view feature — press Alt+A first", "info"); return; }
|
|
23
|
+
const keys = ports.getSwitchableKeys();
|
|
24
|
+
if (keys.length === 0) { ctx.ui.notify("No running subagents to switch between", "info"); return; }
|
|
25
|
+
const current = ports.getMarkedAgent();
|
|
26
|
+
const index = current ? keys.indexOf(current) : -1;
|
|
27
|
+
ports.setMarkedAgent(index === -1 ? (delta > 0 ? keys[0] : keys[keys.length - 1]) : keys[(index + delta + keys.length) % keys.length]);
|
|
28
|
+
ports.refreshWidgets();
|
|
29
|
+
};
|
|
30
|
+
pi.registerShortcut("alt+a", { description: "Open Fleet Dashboard", handler: ctx => { withContext(ctx); void ports.openFleetDashboard(ctx); } });
|
|
31
|
+
pi.registerShortcut("alt+m", { description: "Open work mode picker", handler: ctx => {
|
|
32
|
+
withContext(ctx);
|
|
33
|
+
if (!ctx.hasUI || typeof ctx.ui.select !== "function") { ctx.ui.notify(`${ports.workModeStatusText()}\nSwitch with /af-work-mode operator|orchestrator`, "info"); return; }
|
|
34
|
+
void ports.openWorkModePicker(ctx);
|
|
35
|
+
} });
|
|
36
|
+
pi.registerShortcut("alt+shift+a", { description: "Toggle compact agent widget", handler: ctx => { withContext(ctx); const mode = ports.toggleCompact(); ports.refreshWidgets(); ctx.ui.notify(`Compact agent widget: ${mode}`, "info"); } });
|
|
37
|
+
pi.registerShortcut("alt+]", { description: "Compact view: mark next subagent", handler: ctx => cycleMarker(1, ctx) });
|
|
38
|
+
pi.registerShortcut("alt+[", { description: "Compact view: mark previous subagent", handler: ctx => cycleMarker(-1, ctx) });
|
|
39
|
+
pi.registerShortcut("alt+\\", { description: "Compact view: zoom the marked subagent", handler: async ctx => {
|
|
40
|
+
withContext(ctx);
|
|
41
|
+
if (!ports.isCompact()) { ctx.ui.notify("Agent zoom from the marker is a compact-view feature — press Alt+A first", "info"); return; }
|
|
42
|
+
ports.clampMarker();
|
|
43
|
+
const marked = ports.getMarkedAgent();
|
|
44
|
+
if (!marked) { ctx.ui.notify("No running subagent marked to zoom", "info"); return; }
|
|
45
|
+
if (!await ports.openMarkedAgent(ctx, marked)) ctx.ui.notify(`Marked agent ${marked} is no longer available`, "warning");
|
|
46
|
+
} });
|
|
47
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { ExtensionContext, ImageContent } from "@mariozechner/pi-coding-agent";
|
|
2
|
+
import { contextPressureDiagnostic, createContextPressureState, transitionContextPressure, type ContextPressureState } from "../context-pressure.ts";
|
|
3
|
+
import { estimatePromptTokens } from "../context-window.js";
|
|
4
|
+
|
|
5
|
+
export type PressureSource = "message_end" | "turn_end" | "context" | "input" | "agent_settled" | "session_start" | "session_compact" | "compaction_callback";
|
|
6
|
+
export interface DeferredRecoveryInput { text: string; images?: ImageContent[]; streamingBehavior?: "steer" | "followUp" }
|
|
7
|
+
export interface ContextPressureRootState {
|
|
8
|
+
pressure: ContextPressureState;
|
|
9
|
+
automaticPending: boolean;
|
|
10
|
+
automaticRunning: boolean;
|
|
11
|
+
deferredReplayAllowance: number;
|
|
12
|
+
deferredInputs: DeferredRecoveryInput[];
|
|
13
|
+
}
|
|
14
|
+
export const createContextPressureRootState = (): ContextPressureRootState => ({ pressure: createContextPressureState(), automaticPending: false, automaticRunning: false, deferredReplayAllowance: 0, deferredInputs: [] });
|
|
15
|
+
|
|
16
|
+
export interface ContextPressurePorts {
|
|
17
|
+
getState(): ContextPressureRootState;
|
|
18
|
+
setPressure(value: ContextPressureState): void;
|
|
19
|
+
getCurrentContext(): ExtensionContext | null;
|
|
20
|
+
appendEntry(type: string, data: unknown): void;
|
|
21
|
+
sendUserMessage(content: string | Array<{ type: "text"; text: string } | ImageContent>, options: { deliverAs?: "steer" | "followUp" }): void;
|
|
22
|
+
resolveCapabilities(input: string): void;
|
|
23
|
+
applyWorkMode(): void;
|
|
24
|
+
modelWorkBlocked(ctx: ExtensionContext): boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface ContextPressureLifecycle {
|
|
28
|
+
reset(ctx: ExtensionContext): void;
|
|
29
|
+
status(ctx: ExtensionContext): void;
|
|
30
|
+
observe(ctx: ExtensionContext, source: "message_end" | "turn_end" | "input" | "session_start", additionalTokens?: number): "none" | "expose-compaction" | "compact-now";
|
|
31
|
+
runCompaction(ctx: ExtensionContext, source: "input" | "agent_settled" | "session_start"): void;
|
|
32
|
+
messageEnd(event: any, ctx: ExtensionContext): void;
|
|
33
|
+
turnEnd(ctx: ExtensionContext): void;
|
|
34
|
+
context(ctx: ExtensionContext): void;
|
|
35
|
+
agentSettled(ctx: ExtensionContext): void;
|
|
36
|
+
sessionCompact(): void;
|
|
37
|
+
input(event: any, ctx: ExtensionContext): { action: "handled" | "continue" };
|
|
38
|
+
replayDeferred(): void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const INSTRUCTIONS = "Preserve the current goal, completed and open assertions, decisions, modified/read files, pending child or peer operations, blockers, and the concrete next step.";
|
|
42
|
+
const incomingText = (event: unknown): string => {
|
|
43
|
+
const value = event as { text?: unknown; message?: unknown; input?: unknown } | null;
|
|
44
|
+
if (typeof value?.text === "string") return value.text;
|
|
45
|
+
if (typeof value?.message === "string") return value.message;
|
|
46
|
+
if (typeof value?.input === "string") return value.input;
|
|
47
|
+
const message = value?.message as { content?: unknown } | undefined;
|
|
48
|
+
return typeof message?.content === "string" ? message.content : "";
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export function createContextPressureLifecycle(ports: ContextPressurePorts): ContextPressureLifecycle {
|
|
52
|
+
const state = () => ports.getState();
|
|
53
|
+
const status = (ctx: ExtensionContext) => {
|
|
54
|
+
const diagnostic = contextPressureDiagnostic(state().pressure);
|
|
55
|
+
const percent = diagnostic.percent === null ? "unknown" : `${diagnostic.percent.toFixed(1)}%`;
|
|
56
|
+
ctx.ui.setStatus("context-pressure", `Context: ${state().pressure.phase} · ${percent} · auto ${diagnostic.automaticPercent}% · last ${diagnostic.lastRecoveryOutcome}`);
|
|
57
|
+
};
|
|
58
|
+
const record = (source: PressureSource, action: string, reason: string) => {
|
|
59
|
+
const diagnostic = contextPressureDiagnostic(state().pressure);
|
|
60
|
+
try { ports.appendEntry("agent-hub-context-pressure", { version: 1, source, phase: diagnostic.phase, pressure: diagnostic.pressure, episode: diagnostic.episode, tokens: diagnostic.tokens, context_window: diagnostic.contextWindow, percent: diagnostic.percent, warning_percent: diagnostic.warningPercent, automatic_percent: diagnostic.automaticPercent, last_recovery_outcome: diagnostic.lastRecoveryOutcome, action, reason }); } catch {}
|
|
61
|
+
};
|
|
62
|
+
const syncPolicy = () => { ports.resolveCapabilities(""); ports.applyWorkMode(); };
|
|
63
|
+
const observe: ContextPressureLifecycle["observe"] = (ctx, source, additionalTokens = 0) => {
|
|
64
|
+
const usage = ctx.getContextUsage();
|
|
65
|
+
const contextWindow = usage?.contextWindow ?? ctx.model?.contextWindow ?? null;
|
|
66
|
+
const tokens = usage?.tokens == null ? null : usage.tokens + Math.max(0, additionalTokens);
|
|
67
|
+
const percent = tokens != null && contextWindow != null && contextWindow > 0 ? tokens / contextWindow * 100 : usage?.percent ?? null;
|
|
68
|
+
const previous = state().pressure.phase;
|
|
69
|
+
const decision = transitionContextPressure(state().pressure, { type: "usage", usage: { tokens, contextWindow, percent } });
|
|
70
|
+
ports.setPressure(decision.state); status(ctx); syncPolicy();
|
|
71
|
+
if (decision.action !== "none" || previous !== decision.state.phase) record(source, decision.action, decision.reason);
|
|
72
|
+
if (decision.action === "compact-now") { state().automaticPending = true; if (ctx.hasUI) ctx.ui.notify("Context reached 90%; pausing the tool loop for automatic compaction.", "warning"); }
|
|
73
|
+
return decision.action;
|
|
74
|
+
};
|
|
75
|
+
const markSucceeded = () => {
|
|
76
|
+
state().automaticPending = false;
|
|
77
|
+
if (state().pressure.phase === "recovered") return;
|
|
78
|
+
const decision = transitionContextPressure(state().pressure, { type: "compaction-succeeded" });
|
|
79
|
+
ports.setPressure(decision.state);
|
|
80
|
+
const ctx = ports.getCurrentContext(); if (ctx) status(ctx);
|
|
81
|
+
syncPolicy(); record("session_compact", decision.action, decision.reason);
|
|
82
|
+
};
|
|
83
|
+
const replayDeferred = () => {
|
|
84
|
+
if (state().automaticPending || state().automaticRunning || state().deferredInputs.length === 0) return;
|
|
85
|
+
const queued = state().deferredInputs.splice(0); state().deferredReplayAllowance += queued.length;
|
|
86
|
+
queued.forEach((input, index) => ports.sendUserMessage(input.images?.length ? [{ type: "text", text: input.text }, ...input.images] : input.text, { deliverAs: index === 0 ? input.streamingBehavior : "followUp" }));
|
|
87
|
+
};
|
|
88
|
+
const runCompaction: ContextPressureLifecycle["runCompaction"] = (ctx, source) => {
|
|
89
|
+
if (!state().automaticPending || state().automaticRunning) return;
|
|
90
|
+
state().automaticPending = false; state().automaticRunning = true; record(source, "compact-now", "automatic-threshold");
|
|
91
|
+
if (ctx.hasUI) ctx.ui.notify("Automatic context compaction started.", "warning");
|
|
92
|
+
ctx.compact({ customInstructions: INSTRUCTIONS, onComplete: () => { state().automaticRunning = false; markSucceeded(); if (ctx.hasUI) ctx.ui.notify("Automatic context compaction completed.", "success"); replayDeferred(); }, onError: error => {
|
|
93
|
+
state().automaticRunning = false;
|
|
94
|
+
const failed = transitionContextPressure(state().pressure, { type: "compaction-failed", error: "automatic compaction failed" });
|
|
95
|
+
ports.setPressure(failed.state); status(ctx); syncPolicy(); record("compaction_callback", failed.action, failed.reason);
|
|
96
|
+
if (ctx.hasUI) ctx.ui.notify(`Automatic compaction failed: ${error.message}. Deferred input is retained; run /compact or switch to a larger-context model.`, "error");
|
|
97
|
+
} });
|
|
98
|
+
};
|
|
99
|
+
return {
|
|
100
|
+
reset(ctx) { const fresh = createContextPressureRootState(); ports.setPressure(fresh.pressure); Object.assign(state(), fresh); status(ctx); }, status, observe, runCompaction, replayDeferred,
|
|
101
|
+
messageEnd(event, ctx) { if (event.message.role !== "toolResult") return; const projected = estimatePromptTokens(JSON.stringify(event.message.content ?? [])); if (observe(ctx, "message_end", projected) === "compact-now") ctx.abort(); },
|
|
102
|
+
turnEnd(ctx) { observe(ctx, "turn_end"); },
|
|
103
|
+
context(ctx) { if (!state().automaticPending) return; record("context", "compact-now", "single-flight"); ctx.abort(); },
|
|
104
|
+
agentSettled(ctx) { runCompaction(ctx, "agent_settled"); },
|
|
105
|
+
sessionCompact() { markSucceeded(); if (!state().automaticRunning) setTimeout(replayDeferred, 0); },
|
|
106
|
+
input(event, ctx) {
|
|
107
|
+
const replaying = event.source === "extension" && state().deferredReplayAllowance > 0;
|
|
108
|
+
if (replaying) state().deferredReplayAllowance--;
|
|
109
|
+
else {
|
|
110
|
+
if (state().pressure.phase === "normal") observe(ctx, "input");
|
|
111
|
+
if (state().automaticPending || state().automaticRunning || state().pressure.phase === "failed") {
|
|
112
|
+
state().deferredInputs.push({ text: event.text, images: event.images ? [...event.images] : undefined, streamingBehavior: event.streamingBehavior });
|
|
113
|
+
if (state().automaticPending && ctx.isIdle()) setTimeout(() => runCompaction(ctx, "input"), 0);
|
|
114
|
+
ctx.ui.notify(state().pressure.phase === "failed" ? "Context recovery failed; input is retained. Run /compact or switch to a larger-context model." : "Input retained until automatic context recovery completes.", "warning");
|
|
115
|
+
return { action: "handled" };
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (replaying && ports.modelWorkBlocked(ctx)) { state().deferredInputs.push({ text: event.text, images: event.images ? [...event.images] : undefined, streamingBehavior: event.streamingBehavior }); return { action: "handled" }; }
|
|
119
|
+
if (ports.modelWorkBlocked(ctx)) return { action: "handled" };
|
|
120
|
+
ports.resolveCapabilities(incomingText(event)); ports.applyWorkMode(); return { action: "continue" };
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { ChildProcess } from "child_process";
|
|
2
|
+
import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-agent";
|
|
3
|
+
import * as fs from "node:fs";
|
|
4
|
+
import * as path from "node:path";
|
|
5
|
+
import { killPiTree } from "../spawn.ts";
|
|
6
|
+
import { createMonitorLifecycle, monitorLifecycleConfig } from "../monitor-lifecycle.ts";
|
|
7
|
+
import { createMonitorSessionBridge } from "../monitor-session-bridge.ts";
|
|
8
|
+
import { MonitorRuntime } from "../monitor-runtime.ts";
|
|
9
|
+
import { MonitorInvokeJournal } from "../monitor-invoke-journal.ts";
|
|
10
|
+
import { createMonitorInvokeAdmission, createWatchdogFollowUpEnqueue } from "../monitor-invoke.ts";
|
|
11
|
+
import { monitorReconcileEvidence, stableMonitorHubId } from "../monitor-recovery.ts";
|
|
12
|
+
import { MonitorRegistry } from "../../lib/hermes-monitor-registry.ts";
|
|
13
|
+
import { MonitorStore } from "../../lib/hermes-monitor-store.ts";
|
|
14
|
+
import { MonitorEventJournal } from "../../lib/hermes-monitor-events.ts";
|
|
15
|
+
import { herdr as herdrApi } from "../../lib/herdr-client.ts";
|
|
16
|
+
|
|
17
|
+
export interface MonitorSessionPorts {
|
|
18
|
+
pi: ExtensionAPI;
|
|
19
|
+
getBridge(): any;
|
|
20
|
+
setBridge(value: any): void;
|
|
21
|
+
getLifecycle(): any;
|
|
22
|
+
setLifecycle(value: any): void;
|
|
23
|
+
setHubId(value: string): void;
|
|
24
|
+
getOwnerId(): string | undefined;
|
|
25
|
+
setOwnerId(value: string | undefined): void;
|
|
26
|
+
queueDepth(): number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async function herdrEvidence(hubId: string, currentHubId: string) {
|
|
30
|
+
return monitorReconcileEvidence({
|
|
31
|
+
hubId, currentHubId, paneId: process.env.HERDR_PANE_ID, workspaceId: process.env.HERDR_WORKSPACE_ID,
|
|
32
|
+
herdr: {
|
|
33
|
+
pane: { get: async (id: string) => (await herdrApi.paneGet(id)).pane },
|
|
34
|
+
workspace: { get: async (id: string) => {
|
|
35
|
+
const panes = await herdrApi.paneList({ workspace_id: id });
|
|
36
|
+
return panes.panes.length ? { id } : null;
|
|
37
|
+
} },
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function createMonitorSession(ports: MonitorSessionPorts) {
|
|
43
|
+
return {
|
|
44
|
+
async restart(ctx: ExtensionContext): Promise<void> {
|
|
45
|
+
const config = monitorLifecycleConfig(process.env);
|
|
46
|
+
if (ports.getBridge() || ports.getLifecycle()) {
|
|
47
|
+
try { await ports.getBridge()?.cancelAllWaitOnly(); await ports.getLifecycle()?.stop(); }
|
|
48
|
+
finally { ports.setBridge(null); ports.setLifecycle(null); }
|
|
49
|
+
}
|
|
50
|
+
if (!config) return;
|
|
51
|
+
try {
|
|
52
|
+
fs.mkdirSync(config.profilePath, { recursive: true, mode: 0o700 });
|
|
53
|
+
const hubId = stableMonitorHubId({ profileId: config.profileId, checkout: ctx.cwd || process.cwd(), workspaceId: process.env.HERDR_WORKSPACE_ID, paneId: process.env.HERDR_PANE_ID });
|
|
54
|
+
ports.setHubId(hubId);
|
|
55
|
+
new MonitorStore();
|
|
56
|
+
const registry = new MonitorRegistry({ runtimeDir: config.runtimeDir });
|
|
57
|
+
const lifecycle = createMonitorLifecycle({
|
|
58
|
+
registry, treeKill: killPiTree,
|
|
59
|
+
wait: (proc: ChildProcess) => new Promise<boolean>(resolve => proc.once("close", () => resolve(true))),
|
|
60
|
+
getRecoveryEvidence: async (task: any) => {
|
|
61
|
+
if (!task?.ownerSessionId) return herdrEvidence(hubId, hubId);
|
|
62
|
+
const evidence = registry.evidenceForOwner(task.ownerSessionId, task.hubInstanceId ?? hubId);
|
|
63
|
+
if (evidence.transient) return { transient: true };
|
|
64
|
+
const reconciled = await herdrEvidence(task.hubInstanceId ?? hubId, hubId);
|
|
65
|
+
return { oldOwner: evidence.owner, oldSocket: evidence.socket, oldSession: evidence.session, oldHerdr: reconciled.herdr, transient: reconciled.transient };
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
ports.setLifecycle(lifecycle);
|
|
69
|
+
const events = new MonitorEventJournal({ file: path.join(config.runtimeDir, `monitor-events-${hubId}.ndjson`) });
|
|
70
|
+
const journal = new MonitorInvokeJournal(path.join(config.runtimeDir, `monitor-invokes-${hubId}.ndjson`));
|
|
71
|
+
const bridge = createMonitorSessionBridge({
|
|
72
|
+
events, hubInstanceId: hubId,
|
|
73
|
+
onEventJournalError: (error: unknown) => ctx.ui.notify(`Agent Fleet monitor event journal unavailable: ${error instanceof Error ? error.message : String(error)}`, "warning"),
|
|
74
|
+
runtime: new MonitorRuntime({ runtimeDir: config.runtimeDir, profileId: config.profileId, hubInstanceId: hubId }),
|
|
75
|
+
registerOwnedProcess: (_key: string, process: ChildProcess, task: any) => lifecycle.registerOwnedGeneration({ taskId: task.id, generation: task.generation, process }),
|
|
76
|
+
cancelOwnedProcess: (request: any) => lifecycle.lowLevelCancelOwnedGeneration(request),
|
|
77
|
+
});
|
|
78
|
+
ports.setBridge(bridge);
|
|
79
|
+
const invoke = createMonitorInvokeAdmission({
|
|
80
|
+
journal, task: (id: string, generation: number) => bridge.snapshot().tasks.find((task: any) => task.id === id && task.generation === generation),
|
|
81
|
+
owner: ports.getOwnerId, queueDepth: ports.queueDepth, queueLimit: 64,
|
|
82
|
+
enqueue: createWatchdogFollowUpEnqueue((message, options) => ports.pi.sendMessage(message, options)),
|
|
83
|
+
publish: (kind: any, task: any, extra?: any) => bridge.publishEvent(kind, task, extra),
|
|
84
|
+
});
|
|
85
|
+
const registration = await lifecycle.startBridge(bridge, {
|
|
86
|
+
profilePath: config.profilePath, profileId: config.profileId, hubInstanceId: hubId,
|
|
87
|
+
events: (request: any) => events.replay(request.afterSequence, request.limit, request.waitMs, request.signal), invoke,
|
|
88
|
+
});
|
|
89
|
+
ports.setOwnerId(registration?.ownerId);
|
|
90
|
+
} catch (error) {
|
|
91
|
+
ports.setLifecycle(null);
|
|
92
|
+
ctx.ui.notify(`Agent Fleet monitor disabled: ${error instanceof Error ? error.message : String(error)}`, "warning");
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
async shutdown(): Promise<void> {
|
|
96
|
+
const bridge = ports.getBridge();
|
|
97
|
+
if (bridge) try { await bridge.cancelAllWaitOnly(); } catch {}
|
|
98
|
+
const lifecycle = ports.getLifecycle();
|
|
99
|
+
if (lifecycle) try { await lifecycle.stop(); } catch {}
|
|
100
|
+
ports.setLifecycle(null);
|
|
101
|
+
bridge?.reset(); bridge?.stop(); ports.setBridge(null);
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { validateProfile, type ModelProfiles } from '../config/model-profiles.ts';
|
|
2
|
+
import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-agent";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { applyModelOverride } from "../helpers.ts";
|
|
6
|
+
import type { AgentTeamOverrides } from "../config/overrides.ts";
|
|
7
|
+
import type { AgentDef } from "../types.ts";
|
|
8
|
+
import { registerSessionStart, type SessionStartDependencies } from "../session-start.ts";
|
|
9
|
+
|
|
10
|
+
export interface SessionResetPorts {
|
|
11
|
+
registerVersion(ctx: ExtensionContext): void;
|
|
12
|
+
resetPressure(ctx: ExtensionContext): void;
|
|
13
|
+
clearRosterRecovery(): void;
|
|
14
|
+
captureBaselineTools(): void;
|
|
15
|
+
resetAccessApproval(): void;
|
|
16
|
+
terminateResearch(): void;
|
|
17
|
+
resetResearch(): void;
|
|
18
|
+
resetHistory(): void;
|
|
19
|
+
resetBudgets(): void;
|
|
20
|
+
clearWidgets(ctx: ExtensionContext): void;
|
|
21
|
+
closeDelegationWatchers(): void;
|
|
22
|
+
resetSessionState(ctx: ExtensionContext): void;
|
|
23
|
+
resolveSafety(cwd: string): boolean;
|
|
24
|
+
resolveDelegate(cwd: string): void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function resetHubSession(ctx: ExtensionContext, ports: SessionResetPorts): void {
|
|
28
|
+
ports.registerVersion(ctx);
|
|
29
|
+
ports.resetPressure(ctx);
|
|
30
|
+
ports.clearRosterRecovery();
|
|
31
|
+
ports.captureBaselineTools();
|
|
32
|
+
ports.resetAccessApproval();
|
|
33
|
+
ports.terminateResearch();
|
|
34
|
+
ports.resetResearch();
|
|
35
|
+
ports.resetHistory();
|
|
36
|
+
ports.resetBudgets();
|
|
37
|
+
ports.clearWidgets(ctx);
|
|
38
|
+
ports.closeDelegationWatchers();
|
|
39
|
+
ports.resetSessionState(ctx);
|
|
40
|
+
if (!ports.resolveSafety(ctx.cwd)) ctx.ui.notify("damage-control-continue harness not found — native child dispatches will be refused. Install .pi/harnesses/damage-control-continue/.", "error");
|
|
41
|
+
ports.resolveDelegate(ctx.cwd);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface SessionOverridePorts<TDef extends AgentDef> {
|
|
45
|
+
setLanguage(value: string): void;
|
|
46
|
+
setReconTimeout(value: number | null): void;
|
|
47
|
+
setBudgetOverrides(value: AgentTeamOverrides["budgetOverrides"]): void;
|
|
48
|
+
setWatchdog(setting: string, judgeModel: string | null): void;
|
|
49
|
+
resetTurnCounts(): void;
|
|
50
|
+
resetTaskWindow(): void;
|
|
51
|
+
updateModeStatus(): void;
|
|
52
|
+
setProjectRules(value: string[]): void;
|
|
53
|
+
setProjectDocs(value: string[]): void;
|
|
54
|
+
resetModelPolicy(): void;
|
|
55
|
+
getAgentDefs(): TDef[];
|
|
56
|
+
getModelProfiles(): ModelProfiles;
|
|
57
|
+
getModelProfileErrors?(): string[];
|
|
58
|
+
deleteModelProfile(name: string): void;
|
|
59
|
+
allowedModels(def: TDef): string[];
|
|
60
|
+
getDispatchPolicyWarnings(): string[];
|
|
61
|
+
setResearchPersonas(value: TDef[]): void;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function applySessionOverrides<TDef extends AgentDef>(ctx: ExtensionContext, overrides: AgentTeamOverrides, ports: SessionOverridePorts<TDef>): void {
|
|
65
|
+
ports.setLanguage(overrides.language);
|
|
66
|
+
ports.setReconTimeout(overrides.reconSearchTimeoutMs);
|
|
67
|
+
ports.setBudgetOverrides(overrides.budgetOverrides);
|
|
68
|
+
ports.setWatchdog(overrides.watchdogSetting, overrides.watchdogJudgeModel);
|
|
69
|
+
ports.resetTurnCounts();
|
|
70
|
+
ports.resetTaskWindow();
|
|
71
|
+
ports.updateModeStatus();
|
|
72
|
+
if (overrides.warnings.length) ctx.ui.notify(`agent-fleet-overrides warnings:\n${overrides.warnings.join("\n")}`, "warning");
|
|
73
|
+
ports.setProjectRules(overrides.rulesDirs);
|
|
74
|
+
for (const dir of overrides.rulesDirs) if (!existsSync(join(ctx.cwd, dir))) ctx.ui.notify(`agent-fleet-overrides: rules folder "${dir}" not found in ${ctx.cwd}`, "warning");
|
|
75
|
+
ports.setProjectDocs(overrides.docsPaths);
|
|
76
|
+
for (const entry of overrides.docsPaths) if (!existsSync(join(ctx.cwd, entry))) ctx.ui.notify(`agent-fleet-overrides: docs entry point "${entry}" not found in ${ctx.cwd}`, "warning");
|
|
77
|
+
|
|
78
|
+
ports.resetModelPolicy();
|
|
79
|
+
const defs = ports.getAgentDefs();
|
|
80
|
+
for (const def of defs) {
|
|
81
|
+
const lower = def.name.toLowerCase();
|
|
82
|
+
if (overrides.personaModels[lower]) Object.assign(def, applyModelOverride(def, overrides.personaModels[lower]));
|
|
83
|
+
if (overrides.personaModelLists[lower]) def.models = overrides.personaModelLists[lower];
|
|
84
|
+
if (overrides.personaThinking[lower]) def.thinking = overrides.personaThinking[lower];
|
|
85
|
+
const substitutions = overrides.personaSubagents[lower];
|
|
86
|
+
if (substitutions) {
|
|
87
|
+
def.subagents = { ...(def.subagents || {}) };
|
|
88
|
+
for (const [role, replacement] of Object.entries(substitutions)) {
|
|
89
|
+
const declared = def.subagents[role];
|
|
90
|
+
def.subagents[role] = declared
|
|
91
|
+
? applyModelOverride({
|
|
92
|
+
...declared,
|
|
93
|
+
...(replacement.tools ? { tools: replacement.tools } : {}),
|
|
94
|
+
...(replacement.thinking ? { thinking: replacement.thinking } : {}),
|
|
95
|
+
}, replacement.model)
|
|
96
|
+
: replacement;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (overrides.personaDelegateDepth[lower] !== undefined) def.delegateDepth = overrides.personaDelegateDepth[lower];
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const parseErrors=ports.getModelProfileErrors?.()??[];
|
|
103
|
+
if(parseErrors.length) ctx.ui.notify(`model-profiles.yaml: ${parseErrors.join('\n')}`, 'error');
|
|
104
|
+
const profileErrors: string[] = [];
|
|
105
|
+
for (const [profileName, profile] of Object.entries(ports.getModelProfiles())) {
|
|
106
|
+
for(const error of validateProfile(profile,defs)) profileErrors.push(`profile "${profileName}": ${error}`);
|
|
107
|
+
}
|
|
108
|
+
if (profileErrors.length) {
|
|
109
|
+
const dropped = new Set(profileErrors.map(error => error.match(/^profile "([^"]+)"/)![1]));
|
|
110
|
+
for (const name of dropped) ports.deleteModelProfile(name);
|
|
111
|
+
ctx.ui.notify(`model-profiles.yaml: dropped ${Array.from(dropped).map(name => `"${name}"`).join(", ")}:\n${profileErrors.join("\n")}`, "error");
|
|
112
|
+
}
|
|
113
|
+
const policyWarnings = ports.getDispatchPolicyWarnings();
|
|
114
|
+
if (policyWarnings.length) ctx.ui.notify(`dispatch-policy.yaml: ${policyWarnings.length} construct(s) dropped:\n${policyWarnings.join("\n")}`, "warning");
|
|
115
|
+
ports.setResearchPersonas(defs.filter(def => (def.kind || "").toLowerCase() === "research"));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface ShutdownPorts {
|
|
119
|
+
shutdownComs(): Promise<void>;
|
|
120
|
+
shutdownMonitor(): Promise<void>;
|
|
121
|
+
removeExemptions(): void;
|
|
122
|
+
terminateChildren(): void;
|
|
123
|
+
clearPoolWidget(): void;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function registerSessionOrchestration(pi: ExtensionAPI, steps: SessionStartDependencies, shutdown: ShutdownPorts): void {
|
|
127
|
+
registerSessionStart(pi, steps);
|
|
128
|
+
let shuttingDown = false;
|
|
129
|
+
const cleanShutdown = async () => {
|
|
130
|
+
if (shuttingDown) return;
|
|
131
|
+
shuttingDown = true;
|
|
132
|
+
await shutdown.shutdownComs();
|
|
133
|
+
await shutdown.shutdownMonitor();
|
|
134
|
+
shutdown.removeExemptions();
|
|
135
|
+
shutdown.terminateChildren();
|
|
136
|
+
shutdown.clearPoolWidget();
|
|
137
|
+
};
|
|
138
|
+
pi.on("session_shutdown", cleanShutdown);
|
|
139
|
+
process.on("SIGINT", () => { void cleanShutdown(); });
|
|
140
|
+
process.on("SIGTERM", () => { void cleanShutdown(); });
|
|
141
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
|
|
2
|
+
|
|
3
|
+
export interface AskContinuation {
|
|
4
|
+
kind: "task" | "turn";
|
|
5
|
+
reason: string;
|
|
6
|
+
params: any;
|
|
7
|
+
}
|
|
8
|
+
export interface TurnLifecyclePorts {
|
|
9
|
+
setTurnState(state: "working" | "idle"): Promise<void>;
|
|
10
|
+
startMonitorTurn(): void;
|
|
11
|
+
finishMonitorTurn(): void;
|
|
12
|
+
startAskUser(id: string): void;
|
|
13
|
+
endAskUser(id: string, endedAt: number): number;
|
|
14
|
+
continuationKind(context: unknown): "task" | "turn" | null;
|
|
15
|
+
getPendingContinuation(): { kind: "task" | "turn"; reason: string } | null;
|
|
16
|
+
setPendingContinuation(value: { kind: "task" | "turn"; reason: string } | null): void;
|
|
17
|
+
getContinuationAsk(id: string): AskContinuation | undefined;
|
|
18
|
+
setContinuationAsk(id: string, value: AskContinuation): void;
|
|
19
|
+
deleteContinuationAsk(id: string): void;
|
|
20
|
+
acknowledgeExternalBlocker(): void;
|
|
21
|
+
addAskUserWait(waitMs: number): void;
|
|
22
|
+
continuationOutcome(params: any, result: unknown): "continue" | "stop" | null;
|
|
23
|
+
continuationSnapshot(kind: "task" | "turn", endedAt: number): unknown;
|
|
24
|
+
continueBudget(kind: "task" | "turn", endedAt: number): void;
|
|
25
|
+
appendContinuation(kind: "task" | "turn", reason: string, prior: unknown, ctx?: ExtensionContext): void;
|
|
26
|
+
getCurrentContext(): ExtensionContext | null;
|
|
27
|
+
getWidgetContext(): ExtensionContext | null;
|
|
28
|
+
applyWorkMode(): void;
|
|
29
|
+
closeTurnActiveTime(now: number): void;
|
|
30
|
+
openTaskClock(now: number): void;
|
|
31
|
+
startHistoryTurn(now: number): void;
|
|
32
|
+
resetTurnBudgetState(): void;
|
|
33
|
+
updateModeStatus(): void;
|
|
34
|
+
buildPrompt(): { systemPrompt: string };
|
|
35
|
+
endHistoryTurn(now: number): void;
|
|
36
|
+
unaddressedPeerWarning(): string | null;
|
|
37
|
+
respondToPeer(ctx: ExtensionContext): Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface TurnLifecycleHandlers {
|
|
41
|
+
beforeAgentPresence(): Promise<void>;
|
|
42
|
+
agentEndPresence(): Promise<void>;
|
|
43
|
+
toolStart(event: any): void;
|
|
44
|
+
toolEnd(event: any): void;
|
|
45
|
+
beforeAgentStart(): { systemPrompt: string };
|
|
46
|
+
agentEnd(ctx: ExtensionContext): Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function createTurnLifecycleHandlers(ports: TurnLifecyclePorts): TurnLifecycleHandlers {
|
|
50
|
+
const resetTurn = () => {
|
|
51
|
+
ports.applyWorkMode();
|
|
52
|
+
const startedAt = Date.now();
|
|
53
|
+
ports.closeTurnActiveTime(startedAt);
|
|
54
|
+
ports.openTaskClock(startedAt);
|
|
55
|
+
ports.startHistoryTurn(startedAt);
|
|
56
|
+
ports.resetTurnBudgetState();
|
|
57
|
+
ports.updateModeStatus();
|
|
58
|
+
};
|
|
59
|
+
return {
|
|
60
|
+
async beforeAgentPresence() { await ports.setTurnState("working"); ports.finishMonitorTurn(); ports.startMonitorTurn(); },
|
|
61
|
+
async agentEndPresence() { await ports.setTurnState("idle"); ports.finishMonitorTurn(); },
|
|
62
|
+
toolStart(event) {
|
|
63
|
+
if (event.toolName !== "ask_user") return;
|
|
64
|
+
ports.startAskUser(event.toolCallId);
|
|
65
|
+
const kind = ports.continuationKind(event.args?.context);
|
|
66
|
+
const pending = ports.getPendingContinuation();
|
|
67
|
+
if (kind && pending?.kind === kind) ports.setContinuationAsk(event.toolCallId, { kind, reason: pending.reason, params: event.args });
|
|
68
|
+
ports.acknowledgeExternalBlocker();
|
|
69
|
+
},
|
|
70
|
+
toolEnd(event) {
|
|
71
|
+
if (event.toolName !== "ask_user") return;
|
|
72
|
+
const endedAt = Date.now();
|
|
73
|
+
ports.addAskUserWait(ports.endAskUser(event.toolCallId, endedAt));
|
|
74
|
+
const confirmation = ports.getContinuationAsk(event.toolCallId);
|
|
75
|
+
ports.deleteContinuationAsk(event.toolCallId);
|
|
76
|
+
if (!confirmation) return;
|
|
77
|
+
const outcome = ports.continuationOutcome(confirmation.params, event.result);
|
|
78
|
+
if (outcome) ports.setPendingContinuation(null);
|
|
79
|
+
if (outcome !== "continue") return;
|
|
80
|
+
const prior = ports.continuationSnapshot(confirmation.kind, endedAt);
|
|
81
|
+
ports.continueBudget(confirmation.kind, endedAt);
|
|
82
|
+
ports.appendContinuation(confirmation.kind, confirmation.reason, prior, ports.getCurrentContext() ?? undefined);
|
|
83
|
+
ports.getWidgetContext()?.ui?.notify(confirmation.kind === "task" ? "Task budget continued; task tier, assertions, capabilities, and progress were preserved." : "Turn budget continued; continuing without another message.", "success");
|
|
84
|
+
},
|
|
85
|
+
beforeAgentStart() { resetTurn(); return ports.buildPrompt(); },
|
|
86
|
+
async agentEnd(ctx) {
|
|
87
|
+
const endedAt = Date.now();
|
|
88
|
+
ports.closeTurnActiveTime(endedAt);
|
|
89
|
+
ports.endHistoryTurn(endedAt);
|
|
90
|
+
const warning = ports.unaddressedPeerWarning();
|
|
91
|
+
if (warning) ctx.ui.notify(warning, "warning");
|
|
92
|
+
await ports.respondToPeer(ctx);
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import { safeAgentKey } from "./helpers.ts";
|
|
3
|
+
|
|
4
|
+
export function monitorKeyForAgent(name:string,runCount:number){return`${safeAgentKey(name)}:${runCount}`;}
|
|
5
|
+
export function cancelLocalOwnedProcess(input:any){try{void Promise.resolve(input.monitorBridge?.markCancelling(input.monitorKey)).catch(()=>{});}catch{}input.treeKill(input.process);}
|
|
6
|
+
export async function cancelLocalWaitOnly(input:any){input.abort?.();try{await input.monitorBridge?.cancelWaitOnly(input.monitorKey,input.event);}catch{}}
|
|
7
|
+
export function linuxProcessIdentity(proc:any){try{if(!Number.isInteger(proc?.pid)||proc.pid<=0)return null;const stat=fs.readFileSync(`/proc/${proc.pid}/stat`,"utf8");const close=stat.lastIndexOf(")");const fields=stat.slice(close+2).trim().split(/\s+/);const starttime=fields[19];return starttime?{pid:proc.pid,starttime}:null;}catch{return null;}}
|
|
8
|
+
export function createOwnedHandleRegistry(deps:any={}) { const handles=new Map<string,any>(); const treeKill=deps.treeKill??((proc:any,signal:string)=>deps.signal?.(proc.pid,signal)), wait=deps.wait??(async()=>false), identity=deps.identity??linuxProcessIdentity; const graceMs=deps.graceMs??5000,setTimer=deps.setTimeout??setTimeout,clearTimer=deps.clearTimeout??clearTimeout;const observe=(p:any,exit:any)=>new Promise<boolean>(resolve=>{let done=false;let timer:any;const finish=(value:boolean)=>{if(done)return;done=true;if(timer!==undefined)clearTimer(timer);resolve(value);};timer=setTimer(()=>finish(false),graceMs);Promise.resolve(wait(p,exit)).then(value=>finish(!!value)).catch(()=>finish(false));});const same=(p:any,expected:any)=>{const current=identity(p);return !!current&¤t.pid===expected.pid&¤t.starttime===expected.starttime;}; return {register(v:any){const processIdentity=identity(v.process);const handle=`${v.profileKey}:${v.taskId}:${v.generation}`;handles.set(handle,{...v,processIdentity,cancelPromise:null});return handle},cancel(r:any){const v=handles.get(r.handle);if(!v)return Promise.resolve({cancelled:false,reason:"unauthorized"});if(v.profileKey!==r.profileKey||v.token!==r.token||v.taskId!==r.taskId)return Promise.resolve({cancelled:false,reason:"unauthorized"});if(v.generation!==r.generation)return Promise.resolve({cancelled:false,reason:"stale_generation"});if(v.cancelPromise)return v.cancelPromise;v.cancelPromise=(async()=>{const proc=v.process;if(!v.processIdentity||!same(proc,v.processIdentity))return{cancelled:false,reason:"stale_identity"};treeKill(proc,"SIGTERM");if(await observe(proc,v.exitPromise)){handles.delete(r.handle);return{cancelled:true,state:"cancelled"};}if(!same(proc,v.processIdentity))return{cancelled:false,reason:"stale_identity"};treeKill(proc,"SIGKILL");if(!(await observe(proc,v.exitPromise)))return{cancelled:false,reason:"exit_not_observed"};handles.delete(r.handle);return{cancelled:true,state:"cancelled"};})();return v.cancelPromise;}} }
|
|
9
|
+
export function recordWaitOnlyCancellation(r:any){return{state:"cancelled",history:r.lateEvent?[r.lateEvent]:[]}}
|