@chankov/agent-fleet 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/doctor-agent-fleet.md +1 -1
- package/.claude/commands/setup-agent-fleet.md +5 -5
- package/.opencode/commands/af-doctor-agent-fleet.md +2 -0
- package/.opencode/commands/af-setup-agent-fleet.md +1 -1
- package/.pi/agents/peers.yaml +4 -0
- package/.pi/agents/teams.yaml +2 -2
- package/.pi/harnesses/agent-hub/README.md +254 -18
- package/.pi/harnesses/agent-hub/access-approval.ts +135 -0
- package/.pi/harnesses/agent-hub/delegate.ts +32 -9
- package/.pi/harnesses/agent-hub/drift-watchdog.js +165 -0
- package/.pi/harnesses/agent-hub/footer.ts +29 -0
- package/.pi/harnesses/agent-hub/helpers.ts +49 -0
- package/.pi/harnesses/agent-hub/index.ts +1269 -322
- package/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.pi/harnesses/agent-hub/monitor-session-bridge.ts +11 -0
- package/.pi/harnesses/agent-hub/package.json +5 -4
- package/.pi/harnesses/agent-hub/research-retention.js +34 -0
- package/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.pi/harnesses/agent-hub/run-budget.js +155 -0
- package/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
- package/.pi/harnesses/agent-hub/spawn.ts +161 -94
- package/.pi/harnesses/agent-hub/version.ts +18 -0
- package/.pi/harnesses/ask-user-remote/README.md +2 -0
- package/.pi/harnesses/coms/README.md +21 -0
- package/.pi/harnesses/coms/index.ts +2 -0
- package/.pi/harnesses/coms/package.json +5 -4
- package/.pi/harnesses/coms/version.ts +18 -0
- package/.pi/harnesses/damage-control-continue/README.md +32 -31
- package/.pi/harnesses/damage-control-continue/index.ts +23 -9
- package/.pi/harnesses/damage-control-continue/package.json +5 -4
- package/.pi/harnesses/damage-control-continue/version.ts +18 -0
- package/.pi/harnesses/{damage-control/shared.ts → lib/damage-control-shared.ts} +20 -6
- package/.pi/prompts/doctor-agent-fleet.md +1 -1
- package/.pi/prompts/setup-agent-fleet.md +5 -5
- package/.versions/0.0.4/.claude/commands/build.md +44 -0
- package/.versions/0.0.4/.claude/commands/code-simplify.md +22 -0
- package/.versions/0.0.4/.claude/commands/design-agent.md +14 -0
- package/.versions/0.0.4/.claude/commands/doctor-agent-fleet.md +17 -0
- package/.versions/0.0.4/.claude/commands/orchestrate.md +112 -0
- package/.versions/0.0.4/.claude/commands/plan.md +16 -0
- package/.versions/0.0.4/.claude/commands/prime.md +22 -0
- package/.versions/0.0.4/.claude/commands/review.md +16 -0
- package/.versions/0.0.4/.claude/commands/setup-agent-fleet.md +25 -0
- package/.versions/0.0.4/.claude/commands/ship.md +72 -0
- package/.versions/0.0.4/.claude/commands/spec.md +15 -0
- package/.versions/0.0.4/.claude/commands/test.md +19 -0
- package/.versions/0.0.4/.claude/commands/webperf.md +32 -0
- package/.versions/0.0.4/.claude/orchestrate-teams.yaml +24 -0
- package/.versions/0.0.4/.opencode/commands/af-build.md +17 -0
- package/.versions/0.0.4/.opencode/commands/af-code-simplify.md +16 -0
- package/.versions/0.0.4/.opencode/commands/af-compound.md +16 -0
- package/.versions/0.0.4/.opencode/commands/af-design-agent.md +15 -0
- package/.versions/0.0.4/.opencode/commands/af-doctor-agent-fleet.md +17 -0
- package/.versions/0.0.4/.opencode/commands/af-orchestrate.md +112 -0
- package/.versions/0.0.4/.opencode/commands/af-plan.md +16 -0
- package/.versions/0.0.4/.opencode/commands/af-prime.md +22 -0
- package/.versions/0.0.4/.opencode/commands/af-review.md +15 -0
- package/.versions/0.0.4/.opencode/commands/af-setup-agent-fleet.md +15 -0
- package/.versions/0.0.4/.opencode/commands/af-ship.md +16 -0
- package/.versions/0.0.4/.opencode/commands/af-spec.md +16 -0
- package/.versions/0.0.4/.opencode/commands/af-test.md +21 -0
- package/.versions/0.0.4/.opencode/commands/af-webperf.md +32 -0
- package/.versions/0.0.4/.opencode/orchestrate-teams.yaml +24 -0
- package/.versions/0.0.4/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/0.0.4/.pi/agents/model-profiles.yaml +20 -0
- package/.versions/0.0.4/.pi/agents/peers.yaml +146 -0
- package/.versions/0.0.4/.pi/agents/teams.yaml +39 -0
- package/.versions/0.0.4/.pi/damage-control-rules.yaml +297 -0
- package/.versions/0.0.4/.pi/extensions/agent-fleet-update-check/README.md +58 -0
- package/.versions/0.0.4/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
- package/{.pi/harnesses/damage-control → .versions/0.0.4/.pi/extensions/agent-fleet-update-check}/package.json +1 -1
- package/.versions/0.0.4/.pi/extensions/btw/README.md +118 -0
- package/.versions/0.0.4/.pi/extensions/btw/index.ts +917 -0
- package/.versions/0.0.4/.pi/extensions/btw/package.json +6 -0
- package/.versions/0.0.4/.pi/extensions/btw/state.js +179 -0
- package/.versions/0.0.4/.pi/extensions/chrome-devtools-mcp/README.md +58 -0
- package/.versions/0.0.4/.pi/extensions/chrome-devtools-mcp/index.ts +92 -0
- package/.versions/0.0.4/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/0.0.4/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/0.0.4/.pi/extensions/compact-and-continue/index.ts +120 -0
- package/.versions/0.0.4/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/0.0.4/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/0.0.4/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/0.0.4/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/0.0.4/.pi/extensions/package-lock.json +1143 -0
- package/.versions/0.0.4/.pi/extensions/package.json +9 -0
- package/.versions/0.0.4/.pi/extensions/pi-voice-stt/README.md +201 -0
- package/.versions/0.0.4/.pi/extensions/pi-voice-stt/config.ts +198 -0
- package/.versions/0.0.4/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/0.0.4/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/0.0.4/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/0.0.4/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/0.0.4/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/README.md +798 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/access-approval.ts +135 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/artifacts.js +92 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/backend-policy.js +153 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/delegate.ts +386 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/drift-watchdog.js +165 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/footer.ts +29 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/helpers.ts +214 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/index.ts +8045 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/monitor-session-bridge.ts +11 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/research-retention.js +34 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/return-contract.js +215 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/run-budget.js +155 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/scope-gate.js +103 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/spawn.ts +246 -0
- package/.versions/0.0.4/.pi/harnesses/agent-hub/version.ts +18 -0
- package/.versions/0.0.4/.pi/harnesses/ask-user-remote/README.md +18 -0
- package/.versions/0.0.4/.pi/harnesses/ask-user-remote/index.ts +293 -0
- package/.versions/0.0.4/.pi/harnesses/ask-user-remote/race-core.js +106 -0
- package/.versions/0.0.4/.pi/harnesses/coms/README.md +92 -0
- package/.versions/0.0.4/.pi/harnesses/coms/index.ts +1745 -0
- package/.versions/0.0.4/.pi/harnesses/coms/package.json +7 -0
- package/.versions/0.0.4/.pi/harnesses/coms/version.ts +18 -0
- package/.versions/0.0.4/.pi/harnesses/damage-control-continue/README.md +117 -0
- package/.versions/0.0.4/.pi/harnesses/damage-control-continue/index.ts +536 -0
- package/.versions/0.0.4/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/0.0.4/.pi/harnesses/damage-control-continue/version.ts +18 -0
- package/.versions/0.0.4/.pi/harnesses/lib/damage-control-shared.ts +197 -0
- package/.versions/0.0.4/.pi/harnesses/lib/herdr-client.ts +458 -0
- package/.versions/0.0.4/.pi/harnesses/lib/herdr-presence.ts +288 -0
- package/.versions/0.0.4/.pi/harnesses/package-lock.json +35 -0
- package/.versions/0.0.4/.pi/harnesses/package.json +9 -0
- package/.versions/0.0.4/.pi/prompts/build.md +24 -0
- package/.versions/0.0.4/.pi/prompts/code-simplify.md +22 -0
- package/.versions/0.0.4/.pi/prompts/doctor-agent-fleet.md +15 -0
- package/.versions/0.0.4/.pi/prompts/plan.md +16 -0
- package/.versions/0.0.4/.pi/prompts/review.md +16 -0
- package/.versions/0.0.4/.pi/prompts/setup-agent-fleet.md +27 -0
- package/.versions/0.0.4/.pi/prompts/ship.md +17 -0
- package/.versions/0.0.4/.pi/prompts/spec.md +15 -0
- package/.versions/0.0.4/.pi/prompts/test.md +19 -0
- package/.versions/0.0.4/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/0.0.4/.version +1 -0
- package/.versions/0.0.4/agents/architect.md +23 -0
- package/.versions/0.0.4/agents/bowser.md +26 -0
- package/.versions/0.0.4/agents/builder.md +53 -0
- package/.versions/0.0.4/agents/code-reviewer.md +205 -0
- package/.versions/0.0.4/agents/deep-researcher.md +31 -0
- package/.versions/0.0.4/agents/documenter.md +18 -0
- package/.versions/0.0.4/agents/orchestrator.md +54 -0
- package/.versions/0.0.4/agents/plan-reviewer.md +60 -0
- package/.versions/0.0.4/agents/planner.md +69 -0
- package/.versions/0.0.4/agents/releaser.md +24 -0
- package/.versions/0.0.4/agents/researcher.md +28 -0
- package/.versions/0.0.4/agents/security-auditor.md +166 -0
- package/.versions/0.0.4/agents/test-engineer.md +151 -0
- package/.versions/0.0.4/agents/web-debugger.md +42 -0
- package/.versions/0.0.4/agents/web-performance-auditor.md +192 -0
- package/.versions/0.0.4/codex/CONDUCTOR.md +148 -0
- package/.versions/0.0.4/docs/ARCHITECTURE.md +210 -0
- package/.versions/0.0.4/docs/agent-fleet-setup.md +366 -0
- package/.versions/0.0.4/docs/claude-code-coms-bridge.md +103 -0
- package/.versions/0.0.4/docs/codex-remote-conductor.md +170 -0
- package/.versions/0.0.4/docs/coms-hermes-bridge.md +121 -0
- package/.versions/0.0.4/docs/getting-started.md +183 -0
- package/.versions/0.0.4/docs/npm-install.md +337 -0
- package/.versions/0.0.4/docs/opencode-setup.md +248 -0
- package/.versions/0.0.4/docs/pi-extensions.md +288 -0
- package/.versions/0.0.4/docs/pi-setup.md +463 -0
- package/.versions/0.0.4/docs/skill-anatomy.md +150 -0
- package/.versions/0.0.4/hermes/README.md +228 -0
- package/.versions/0.0.4/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/0.0.4/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-cap.test.py +15 -0
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-discovery.test.py +19 -0
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-envelope.test.py +13 -0
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-forged-owner.test.py +11 -0
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-lease-list.test.py +9 -0
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-multihub.test.py +17 -0
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter-output.test.py +34 -0
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +151 -0
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/adapter.test.py +39 -0
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/plugin-api-validation.test.py +12 -0
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/0.0.4/hermes/plugins/agent-fleet-monitor/dashboard/review-live-wiring.red.test.py +22 -0
- package/.versions/0.0.4/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/0.0.4/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/0.0.4/hooks/SIMPLIFY-IGNORE.md +90 -0
- package/.versions/0.0.4/hooks/coms-stop-hook.mjs +73 -0
- package/.versions/0.0.4/hooks/hooks.json +14 -0
- package/.versions/0.0.4/hooks/session-start.sh +74 -0
- package/.versions/0.0.4/hooks/simplify-ignore.sh +302 -0
- package/.versions/0.0.4/justfile +256 -0
- package/.versions/0.0.4/references/accessibility-checklist.md +160 -0
- package/.versions/0.0.4/references/definition-of-done.md +67 -0
- package/.versions/0.0.4/references/fleet-coordination-patterns.md +151 -0
- package/.versions/0.0.4/references/observability-checklist.md +91 -0
- package/.versions/0.0.4/references/orchestration-patterns.md +370 -0
- package/.versions/0.0.4/references/performance-checklist.md +153 -0
- package/.versions/0.0.4/references/prompting-patterns.md +380 -0
- package/.versions/0.0.4/references/security-checklist.md +179 -0
- package/.versions/0.0.4/references/testing-patterns.md +236 -0
- package/.versions/0.0.4/scripts/codex-conductor.ts +41 -0
- package/.versions/0.0.4/scripts/codex-remote-control.ts +167 -0
- package/.versions/0.0.4/scripts/coms-claude-bridge.ts +286 -0
- package/.versions/0.0.4/scripts/coms-cli.ts +484 -0
- package/.versions/0.0.4/scripts/coms-hermes-bridge.ts +403 -0
- package/.versions/0.0.4/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/0.0.4/scripts/hermes-monitor-scenario.ts +7 -0
- package/.versions/0.0.4/scripts/lib/claude-bridge-core.ts +100 -0
- package/.versions/0.0.4/scripts/lib/codex-conductor.ts +88 -0
- package/.versions/0.0.4/scripts/lib/codex-remote-control.ts +480 -0
- package/.versions/0.0.4/scripts/lib/coms-envelope.ts +539 -0
- package/.versions/0.0.4/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/0.0.4/scripts/lib/herdr-layout.ts +263 -0
- package/.versions/0.0.4/scripts/lib/hermes-bridge-core.ts +238 -0
- package/.versions/0.0.4/scripts/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/0.0.4/scripts/lib/hermes-monitor-model.ts +9 -0
- package/.versions/0.0.4/scripts/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/0.0.4/scripts/lib/hermes-monitor-socket.ts +118 -0
- package/.versions/0.0.4/scripts/lib/hermes-monitor-store.ts +31 -0
- package/.versions/0.0.4/scripts/lib/persona-banner.ts +62 -0
- package/.versions/0.0.4/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/0.0.4/scripts/lib/team-project.ts +184 -0
- package/.versions/0.0.4/scripts/lib/team-snapshot.ts +147 -0
- package/.versions/0.0.4/scripts/peer-banner.ts +40 -0
- package/.versions/0.0.4/scripts/team-snapshot.ts +238 -0
- package/.versions/0.0.4/scripts/team-up.ts +333 -0
- package/.versions/0.0.4/skills/_internal/grilling.md +11 -0
- package/.versions/0.0.4/skills/browser-testing-with-devtools/SKILL.md +352 -0
- package/.versions/0.0.4/skills/code-review-and-quality/SKILL.md +381 -0
- package/.versions/0.0.4/skills/compound-learning/SKILL.md +137 -0
- package/.versions/0.0.4/skills/context-engineering/SKILL.md +291 -0
- package/.versions/0.0.4/skills/deprecation-and-migration/SKILL.md +206 -0
- package/.versions/0.0.4/skills/designing-agents/SKILL.md +394 -0
- package/.versions/0.0.4/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/0.0.4/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/0.0.4/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/0.0.4/skills/guided-workspace-setup/SKILL.md +535 -0
- package/.versions/0.0.4/skills/guided-workspace-setup/companion-manifest.json +33 -0
- package/.versions/0.0.4/skills/idea-refine/SKILL.md +182 -0
- package/.versions/0.0.4/skills/idea-refine/examples.md +238 -0
- package/.versions/0.0.4/skills/idea-refine/frameworks.md +99 -0
- package/.versions/0.0.4/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/0.0.4/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/0.0.4/skills/incremental-implementation/SKILL.md +287 -0
- package/.versions/0.0.4/skills/interview-me/SKILL.md +226 -0
- package/.versions/0.0.4/skills/orchestration-verification/SKILL.md +181 -0
- package/.versions/0.0.4/skills/peer-coms/SKILL.md +90 -0
- package/.versions/0.0.4/skills/performance-optimization/SKILL.md +350 -0
- package/.versions/0.0.4/skills/planning-and-task-breakdown/SKILL.md +236 -0
- package/.versions/0.0.4/skills/security-and-hardening/SKILL.md +461 -0
- package/.versions/0.0.4/skills/spec-driven-development/SKILL.md +245 -0
- package/.versions/0.0.4/skills/using-agent-skills/SKILL.md +199 -0
- package/.versions/0.0.4/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/README.md +11 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
- package/.versions/0.0.4/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
- package/CHANGELOG.md +53 -0
- package/README.md +103 -541
- package/agents/architect.md +1 -1
- package/agents/builder.md +1 -1
- package/agents/code-reviewer.md +1 -1
- package/agents/deep-researcher.md +3 -3
- package/agents/orchestrator.md +20 -11
- package/agents/plan-reviewer.md +3 -3
- package/agents/planner.md +1 -1
- package/agents/security-auditor.md +1 -1
- package/agents/test-engineer.md +11 -4
- package/bin/lib/validate-overrides.js +19 -0
- package/bin/snapshot-version.js +17 -1
- package/bin/sync-harness-versions.js +94 -0
- package/codex/CONDUCTOR.md +148 -0
- package/docs/ARCHITECTURE.md +210 -0
- package/docs/agent-fleet-setup.md +11 -0
- package/docs/claude-code-coms-bridge.md +10 -0
- package/docs/codex-remote-conductor.md +170 -0
- package/docs/coms-hermes-bridge.md +121 -0
- package/docs/getting-started.md +14 -0
- package/docs/npm-install.md +2 -0
- package/docs/pi-extensions.md +49 -14
- package/docs/pi-setup.md +12 -4
- package/hermes/README.md +228 -0
- package/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/hermes/plugins/agent-fleet-monitor/dashboard/adapter-cap.test.py +15 -0
- package/hermes/plugins/agent-fleet-monitor/dashboard/adapter-discovery.test.py +19 -0
- package/hermes/plugins/agent-fleet-monitor/dashboard/adapter-envelope.test.py +13 -0
- package/hermes/plugins/agent-fleet-monitor/dashboard/adapter-forged-owner.test.py +11 -0
- package/hermes/plugins/agent-fleet-monitor/dashboard/adapter-lease-list.test.py +9 -0
- package/hermes/plugins/agent-fleet-monitor/dashboard/adapter-multihub.test.py +17 -0
- package/hermes/plugins/agent-fleet-monitor/dashboard/adapter-output.test.py +34 -0
- package/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +151 -0
- package/hermes/plugins/agent-fleet-monitor/dashboard/adapter.test.py +39 -0
- package/hermes/plugins/agent-fleet-monitor/dashboard/dist/index.js +10 -0
- package/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/hermes/plugins/agent-fleet-monitor/dashboard/plugin-api-validation.test.py +12 -0
- package/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/hermes/plugins/agent-fleet-monitor/dashboard/review-live-wiring.red.test.py +22 -0
- package/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/justfile +106 -23
- package/package.json +17 -5
- package/scripts/codex-conductor.ts +41 -0
- package/scripts/codex-remote-control.ts +167 -0
- package/scripts/coms-cli.ts +311 -199
- package/scripts/coms-hermes-bridge.ts +2 -2
- package/scripts/lib/codex-conductor.ts +88 -0
- package/scripts/lib/codex-remote-control.ts +480 -0
- package/scripts/lib/coms-envelope.ts +51 -6
- package/scripts/lib/fake-herdr-server.ts +88 -0
- package/scripts/lib/herdr-layout.ts +18 -3
- package/scripts/lib/hermes-bridge-core.ts +4 -4
- package/scripts/lib/hermes-monitor-herdr.ts +28 -0
- package/scripts/lib/hermes-monitor-model.ts +9 -0
- package/scripts/lib/hermes-monitor-registry.ts +6 -0
- package/scripts/lib/hermes-monitor-socket.ts +118 -0
- package/scripts/lib/hermes-monitor-store.ts +31 -0
- package/scripts/lib/team-project.ts +85 -1
- package/scripts/team-up.ts +77 -18
- package/skills/designing-agents/SKILL.md +2 -2
- package/skills/designing-agents/pi-harness-authoring.md +26 -13
- package/skills/guided-workspace-setup/SKILL.md +131 -102
- package/skills/guided-workspace-setup/companion-manifest.json +33 -0
- package/skills/peer-coms/SKILL.md +9 -0
- package/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
- package/.pi/harnesses/damage-control/README.md +0 -65
- package/.pi/harnesses/damage-control/index.ts +0 -250
|
@@ -35,7 +35,7 @@ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
|
35
35
|
import { Type } from "@sinclair/typebox";
|
|
36
36
|
import { appendFileSync, mkdirSync, writeFileSync } from "fs";
|
|
37
37
|
import type { ChildProcess } from "child_process";
|
|
38
|
-
import { spawnPiAgent } from "./spawn.ts";
|
|
38
|
+
import { spawnPiAgent, killPiTree } from "./spawn.ts";
|
|
39
39
|
import {
|
|
40
40
|
delegateBudgetRefusal,
|
|
41
41
|
DELEGATE_TREE_SPAWN_BUDGET,
|
|
@@ -68,6 +68,10 @@ export interface DelegateConfig {
|
|
|
68
68
|
eventDir: string;
|
|
69
69
|
damageControl?: string;
|
|
70
70
|
delegateExt: string;
|
|
71
|
+
/** Parent-side per-tool deadline inherited by every terminal child. */
|
|
72
|
+
reconSearchTimeoutMs?: number | null;
|
|
73
|
+
/** Whole-run deadline per delegate child (hub mode budget); null/absent = off. */
|
|
74
|
+
turnDeadlineMs?: number | null;
|
|
71
75
|
cwd: string;
|
|
72
76
|
}
|
|
73
77
|
|
|
@@ -139,9 +143,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
139
143
|
// signals the specialist's negative PID), but if only this process is
|
|
140
144
|
// terminated, forward the signal to any live children.
|
|
141
145
|
process.on("SIGTERM", () => {
|
|
142
|
-
for (const child of liveChildren)
|
|
143
|
-
try { child.kill("SIGTERM"); } catch {}
|
|
144
|
-
}
|
|
146
|
+
for (const child of liveChildren) killPiTree(child, "SIGTERM");
|
|
145
147
|
});
|
|
146
148
|
|
|
147
149
|
const emit = (event: Record<string, unknown>) => {
|
|
@@ -303,6 +305,16 @@ export default function (pi: ExtensionAPI) {
|
|
|
303
305
|
extensions: childExtensions,
|
|
304
306
|
env: childConfig ? { AGENT_HUB_DELEGATE_CONFIG: JSON.stringify(childConfig) } : undefined,
|
|
305
307
|
cwd: config.cwd,
|
|
308
|
+
// Each nested child owns its group. The SIGTERM trap above forwards
|
|
309
|
+
// parent cancellation so detached children cannot become orphans.
|
|
310
|
+
detached: true,
|
|
311
|
+
signal: _signal,
|
|
312
|
+
// `null` is the explicit `off` override; preserve it rather than
|
|
313
|
+
// silently restoring the default for terminal children.
|
|
314
|
+
toolWatchdog: { timeoutMs: config.reconSearchTimeoutMs === undefined ? 120_000 : config.reconSearchTimeoutMs },
|
|
315
|
+
// Whole-run bound from the hub's mode budget: a hung delegate (the
|
|
316
|
+
// 92-minute conventions scout) must not hold its parent hostage.
|
|
317
|
+
turnDeadlineMs: config.turnDeadlineMs === undefined ? null : config.turnDeadlineMs,
|
|
306
318
|
}, {
|
|
307
319
|
onProcess: (p) => { childProc = p; liveChildren.add(p); },
|
|
308
320
|
onTextDelta: (delta) => queueDelta("text", delta),
|
|
@@ -325,8 +337,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
325
337
|
|
|
326
338
|
flushTimeline();
|
|
327
339
|
const elapsed = Date.now() - startTime;
|
|
328
|
-
const code = res.spawnError ? 1 : (res.exitCode ?? 1);
|
|
329
|
-
emit({ t: "exit", id: childId, code, elapsed, ts: Date.now() });
|
|
340
|
+
const code = res.spawnError ? 1 : (res.termination ? (res.termination.reason === "cancelled" ? 130 : res.termination.reason === "drift_stop" ? 125 : 124) : (res.exitCode ?? 1));
|
|
341
|
+
emit({ t: "exit", id: childId, code, elapsed, termination: res.termination, ts: Date.now() });
|
|
330
342
|
|
|
331
343
|
if (res.spawnError) {
|
|
332
344
|
const spawnFailure = `Delegate ${childId} failed to spawn: ${res.spawnError}`;
|
|
@@ -338,7 +350,18 @@ export default function (pi: ExtensionAPI) {
|
|
|
338
350
|
}
|
|
339
351
|
|
|
340
352
|
let output = res.output;
|
|
341
|
-
if (
|
|
353
|
+
if (res.termination) {
|
|
354
|
+
const reason = res.termination.reason;
|
|
355
|
+
const tool = res.termination.tool;
|
|
356
|
+
const explanation = reason === "tool_timeout"
|
|
357
|
+
? `exceeded its per-tool watchdog on ${tool?.toolName || "tool"} (${tool?.toolCallId || "unknown"})`
|
|
358
|
+
: reason === "turn_timeout"
|
|
359
|
+
? "exceeded the per-run deadline (mode budget / agent-turn-timeout-s)"
|
|
360
|
+
: reason === "drift_stop"
|
|
361
|
+
? "was stopped by the drift watchdog"
|
|
362
|
+
: "was cancelled by its caller";
|
|
363
|
+
output = `${reason}: delegate ${childId} ${explanation}; terminationConfirmed=${res.termination.confirmed}.`;
|
|
364
|
+
} else if (code !== 0) {
|
|
342
365
|
const errTail = res.stderr.trim().slice(-1000);
|
|
343
366
|
output = output
|
|
344
367
|
? `${output}\n\n[stderr]\n${errTail}`
|
|
@@ -354,9 +377,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
354
377
|
|
|
355
378
|
return {
|
|
356
379
|
content: [{ type: "text" as const, text:
|
|
357
|
-
`[delegate ${childId} · ${roleDef.model} · ${effectiveTools}] ${code === 0 ? "done" : "error"} ` +
|
|
380
|
+
`[delegate ${childId} · ${roleDef.model} · ${effectiveTools}] ${res.termination ? res.termination.reason : code === 0 ? "done" : "error"} ` +
|
|
358
381
|
`in ${Math.round(elapsed / 1000)}s${noteBlock}\n\n${digest.text}` }],
|
|
359
|
-
details: { id: childId, role: roleKey, model: roleDef.model, status: code === 0 ? "done" : "error", elapsed, resultPath: childResultFile, digestFound: digest.hasDigest },
|
|
382
|
+
details: { id: childId, role: roleKey, model: roleDef.model, status: res.termination ? res.termination.reason : code === 0 ? "done" : "error", elapsed, resultPath: childResultFile, digestFound: digest.hasDigest, termination: res.termination },
|
|
360
383
|
};
|
|
361
384
|
},
|
|
362
385
|
});
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
// Drift watchdog — the pure policy core behind in-flight specialist
|
|
2
|
+
// observation. Layer 1 is deterministic rules over the child's tool event
|
|
3
|
+
// stream (zero tokens); a firing rule is an ESCALATION SIGNAL, not a verdict —
|
|
4
|
+
// the harness then asks a cheap LLM judge (layer 2) whether the run is still
|
|
5
|
+
// on task, and only a DRIFTING/STUCK verdict terminates it (`drift_stop`).
|
|
6
|
+
// Everything here is data + pure functions so the policy is unit-testable
|
|
7
|
+
// away from the harness.
|
|
8
|
+
|
|
9
|
+
import { checkScope } from "./scope-gate.js";
|
|
10
|
+
|
|
11
|
+
export const WATCHDOG_SETTINGS = ["on", "off", "auto"];
|
|
12
|
+
export const DEFAULT_WATCHDOG_SETTING = "auto";
|
|
13
|
+
|
|
14
|
+
/** "On", " AUTO " → canonical setting, or null when unrecognized. */
|
|
15
|
+
export function normalizeWatchdogSetting(value) {
|
|
16
|
+
const v = String(value ?? "").trim().toLowerCase();
|
|
17
|
+
return WATCHDOG_SETTINGS.includes(v) ? v : null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Is the watchdog armed for one dispatch? Precedence: the dispatch_agent
|
|
22
|
+
* `watchdog` param (boolean) > the per-agent /watchdog override ("on"/"off")
|
|
23
|
+
* > the hub-wide setting ("on"/"auto" arm, "off" disarms).
|
|
24
|
+
*/
|
|
25
|
+
export function resolveWatchdogActive(dispatchParam, agentOverride, hubSetting) {
|
|
26
|
+
if (dispatchParam === true) return true;
|
|
27
|
+
if (dispatchParam === false) return false;
|
|
28
|
+
if (agentOverride === "on") return true;
|
|
29
|
+
if (agentOverride === "off") return false;
|
|
30
|
+
return normalizeWatchdogSetting(hubSetting) !== "off";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Conservative thresholds: a false positive kills a productive run, so every
|
|
34
|
+
// rule needs sustained evidence before it fires.
|
|
35
|
+
export const DRIFT_DEFAULTS = {
|
|
36
|
+
writeTools: ["write", "edit"],
|
|
37
|
+
maxRepeats: 4,
|
|
38
|
+
maxConsecutiveFailures: 5,
|
|
39
|
+
maxToolCalls: 200,
|
|
40
|
+
trailLimit: 60,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const pathFromArgs = (argStr) => {
|
|
44
|
+
try {
|
|
45
|
+
const args = JSON.parse(argStr || "{}");
|
|
46
|
+
for (const key of ["path", "file_path", "filePath", "file", "filename"]) {
|
|
47
|
+
if (typeof args[key] === "string" && args[key].trim()) return args[key].trim();
|
|
48
|
+
}
|
|
49
|
+
} catch {}
|
|
50
|
+
return null;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Per-run monitor fed from the tool event stream. `onToolStart(tool, argStr)`
|
|
55
|
+
* and `onToolEnd(tool, isError)` return `null` while the run looks healthy, or
|
|
56
|
+
* `{ rule, detail }` when a rule crosses its threshold:
|
|
57
|
+
* scope — a write-capable tool touched a path outside the declared scope
|
|
58
|
+
* loop — the exact same (tool, args) call repeated maxRepeats times
|
|
59
|
+
* failures — maxConsecutiveFailures failed tool calls in a row
|
|
60
|
+
* toolcap — maxToolCalls total tool calls in one run
|
|
61
|
+
* Each rule instance fires once (at the crossing), so the caller escalates —
|
|
62
|
+
* it never gets spammed. `trail(n)` returns the recent tool trail for the judge.
|
|
63
|
+
*/
|
|
64
|
+
export function createDriftMonitor(cfg = {}) {
|
|
65
|
+
const scopeGlobs = (cfg.scopeGlobs || []).filter(Boolean);
|
|
66
|
+
const writeTools = new Set(cfg.writeTools || DRIFT_DEFAULTS.writeTools);
|
|
67
|
+
const maxRepeats = cfg.maxRepeats ?? DRIFT_DEFAULTS.maxRepeats;
|
|
68
|
+
const maxConsecutiveFailures = cfg.maxConsecutiveFailures ?? DRIFT_DEFAULTS.maxConsecutiveFailures;
|
|
69
|
+
const maxToolCalls = cfg.maxToolCalls ?? DRIFT_DEFAULTS.maxToolCalls;
|
|
70
|
+
const trailLimit = cfg.trailLimit ?? DRIFT_DEFAULTS.trailLimit;
|
|
71
|
+
|
|
72
|
+
const callCounts = new Map();
|
|
73
|
+
const trailLines = [];
|
|
74
|
+
let totalCalls = 0;
|
|
75
|
+
let consecutiveFailures = 0;
|
|
76
|
+
|
|
77
|
+
const pushTrail = (line) => {
|
|
78
|
+
trailLines.push(line);
|
|
79
|
+
if (trailLines.length > trailLimit) trailLines.shift();
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
onToolStart(toolName, argStr) {
|
|
84
|
+
totalCalls++;
|
|
85
|
+
pushTrail(`${toolName} ${String(argStr || "").slice(0, 120)}`.trim());
|
|
86
|
+
|
|
87
|
+
if (scopeGlobs.length > 0 && writeTools.has(toolName)) {
|
|
88
|
+
const path = pathFromArgs(argStr);
|
|
89
|
+
if (path && checkScope([path], scopeGlobs).outOfScope.length > 0) {
|
|
90
|
+
return { rule: "scope", detail: `${toolName} touched ${path} — outside the declared scope (${scopeGlobs.join(", ")})` };
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const fingerprint = `${toolName}::${argStr || ""}`;
|
|
95
|
+
const count = (callCounts.get(fingerprint) || 0) + 1;
|
|
96
|
+
callCounts.set(fingerprint, count);
|
|
97
|
+
if (count === maxRepeats) {
|
|
98
|
+
return { rule: "loop", detail: `${toolName} called ${count}× with identical arguments — likely stuck in a loop` };
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (totalCalls === maxToolCalls) {
|
|
102
|
+
return { rule: "toolcap", detail: `${totalCalls} tool calls in one run — far beyond a focused task` };
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
onToolEnd(_toolName, isError) {
|
|
108
|
+
if (isError === true) {
|
|
109
|
+
consecutiveFailures++;
|
|
110
|
+
pushTrail(" ↳ FAILED");
|
|
111
|
+
if (consecutiveFailures % maxConsecutiveFailures === 0) {
|
|
112
|
+
return { rule: "failures", detail: `${consecutiveFailures} consecutive failed tool calls — no forward progress` };
|
|
113
|
+
}
|
|
114
|
+
} else if (isError === false) {
|
|
115
|
+
consecutiveFailures = 0;
|
|
116
|
+
}
|
|
117
|
+
// isError undefined: the stream carries no error flag — rule stays inert.
|
|
118
|
+
return null;
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
trail(n = 40) {
|
|
122
|
+
return trailLines.slice(-n);
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The one-shot judge prompt: original task + declared scope + recent trail +
|
|
129
|
+
* the rule that fired. The judge answers with a single machine-parseable line.
|
|
130
|
+
*/
|
|
131
|
+
export function buildJudgePrompt({ agent, task, scopeGlobs = [], trail = [], violation }) {
|
|
132
|
+
const scopeBlock = scopeGlobs.length > 0
|
|
133
|
+
? `\n## Declared file scope\n${scopeGlobs.map(s => `- ${s}`).join("\n")}\n`
|
|
134
|
+
: "";
|
|
135
|
+
return `You are a drift watchdog judging whether a running coding agent is still on task.
|
|
136
|
+
Do not solve the task. Judge only whether the agent's recent actions serve it.
|
|
137
|
+
|
|
138
|
+
## Agent
|
|
139
|
+
${agent}
|
|
140
|
+
|
|
141
|
+
## Original task (verbatim)
|
|
142
|
+
${task}
|
|
143
|
+
${scopeBlock}
|
|
144
|
+
## Escalation signal
|
|
145
|
+
Rule "${violation?.rule || "unknown"}" fired: ${violation?.detail || "(no detail)"}
|
|
146
|
+
|
|
147
|
+
## Recent tool trail (oldest first)
|
|
148
|
+
${trail.length > 0 ? trail.join("\n") : "(no tool calls recorded)"}
|
|
149
|
+
|
|
150
|
+
## Your answer
|
|
151
|
+
Reply with EXACTLY one line, nothing else:
|
|
152
|
+
VERDICT: ON_TRACK — <why the actions still serve the task>
|
|
153
|
+
VERDICT: DRIFTING — <what the agent is doing instead of the task>
|
|
154
|
+
VERDICT: STUCK — <the loop or dead end it cannot escape>
|
|
155
|
+
Prefer ON_TRACK unless the trail clearly contradicts the task: false alarms kill
|
|
156
|
+
productive work.`;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** Parse the judge's reply. Returns { verdict, reason } or null when unparseable. */
|
|
160
|
+
export function parseJudgeVerdict(text) {
|
|
161
|
+
const matches = [...String(text ?? "").matchAll(/VERDICT:\s*(ON_TRACK|DRIFTING|STUCK)\s*(?:[—:-]\s*(.*))?/gi)];
|
|
162
|
+
if (matches.length === 0) return null;
|
|
163
|
+
const last = matches[matches.length - 1];
|
|
164
|
+
return { verdict: last[1].toLowerCase(), reason: (last[2] || "").trim() };
|
|
165
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type FooterTheme = {
|
|
2
|
+
fg(color: string, text: string): string;
|
|
3
|
+
};
|
|
4
|
+
|
|
5
|
+
export function composeHubFooterLeft(
|
|
6
|
+
version: string | null,
|
|
7
|
+
model: string,
|
|
8
|
+
thinkingSuffix: string,
|
|
9
|
+
team: string,
|
|
10
|
+
): string {
|
|
11
|
+
return [version ? `v${version}` : "", `${model}${thinkingSuffix}`, team]
|
|
12
|
+
.filter(Boolean)
|
|
13
|
+
.join(" · ");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function renderHubFooterLeft(
|
|
17
|
+
theme: FooterTheme,
|
|
18
|
+
version: string | null,
|
|
19
|
+
model: string,
|
|
20
|
+
thinkingSuffix: string,
|
|
21
|
+
team: string,
|
|
22
|
+
): string {
|
|
23
|
+
const metadata = [version ? `v${version}` : "", `${model}${thinkingSuffix}`]
|
|
24
|
+
.filter(Boolean)
|
|
25
|
+
.join(" · ");
|
|
26
|
+
const dimMetadata = theme.fg("dim", ` ${metadata}`);
|
|
27
|
+
const separator = metadata && team ? theme.fg("muted", " · ") : "";
|
|
28
|
+
return dimMetadata + separator + (team ? theme.fg("accent", team) : "");
|
|
29
|
+
}
|
|
@@ -25,6 +25,55 @@ export function parseTeamsYaml(raw: string): Record<string, string[]> {
|
|
|
25
25
|
return teams;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
// Normalize a dispatcher-supplied agent name to the persona-slug key space:
|
|
29
|
+
// display names ("Test Engineer"), underscores, and stray whitespace all resolve
|
|
30
|
+
// to the same key the hub stores states under ("test-engineer").
|
|
31
|
+
export function normalizeAgentInput(value: string): string {
|
|
32
|
+
return String(value ?? "").trim().toLowerCase().replace(/[\s_]+/g, "-");
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Duplicate-dispatch guard: one fingerprint per (agent, task) where the task
|
|
36
|
+
// text is normalized hard (case, whitespace, punctuation) so trivial rewording
|
|
37
|
+
// still collides. Genuinely different tasks differ in their words, not their
|
|
38
|
+
// commas.
|
|
39
|
+
export function taskFingerprint(agent: string, task: string): string {
|
|
40
|
+
const normalizedTask = String(task ?? "")
|
|
41
|
+
.toLowerCase()
|
|
42
|
+
.replace(/[^\p{L}\p{N}]+/gu, " ")
|
|
43
|
+
.trim()
|
|
44
|
+
.replace(/\s+/g, " ");
|
|
45
|
+
return `${normalizeAgentInput(agent)}::${normalizedTask}`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Replace one team's block in teams.yaml text (or append it) without touching
|
|
49
|
+
// comments or other teams — a full re-serialize would destroy the file's
|
|
50
|
+
// header comments. The block is `name:` plus its ` - member` lines.
|
|
51
|
+
export function upsertTeamInYaml(raw: string, name: string, members: string[]): string {
|
|
52
|
+
const block = `${name}:\n${members.map(m => ` - ${m}`).join("\n")}\n`;
|
|
53
|
+
const lines = String(raw ?? "").split("\n");
|
|
54
|
+
let start = -1;
|
|
55
|
+
let end = -1;
|
|
56
|
+
for (let i = 0; i < lines.length; i++) {
|
|
57
|
+
const teamMatch = lines[i].match(/^(\S[^:]*):\s*$/);
|
|
58
|
+
if (start === -1) {
|
|
59
|
+
if (teamMatch && teamMatch[1].trim() === name) start = i;
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
// Inside the target block: it ends at the next top-level key or a
|
|
63
|
+
// top-level comment (comments are never deleted, only members are).
|
|
64
|
+
if (teamMatch || /^#/.test(lines[i])) { end = i; break; }
|
|
65
|
+
}
|
|
66
|
+
if (start === -1) {
|
|
67
|
+
const body = String(raw ?? "");
|
|
68
|
+
const sep = body.length === 0 || body.endsWith("\n\n") ? "" : body.endsWith("\n") ? "\n" : "\n\n";
|
|
69
|
+
return body + sep + block;
|
|
70
|
+
}
|
|
71
|
+
if (end === -1) end = lines.length;
|
|
72
|
+
// Keep blank/comment lines that trail the block attached to the NEXT section.
|
|
73
|
+
while (end - 1 > start && lines[end - 1].trim() === "") end--;
|
|
74
|
+
return [...lines.slice(0, start), ...block.split("\n").slice(0, -1), ...lines.slice(end)].join("\n");
|
|
75
|
+
}
|
|
76
|
+
|
|
28
77
|
export function safeAgentKey(value: string): string {
|
|
29
78
|
if (typeof value !== "string") {
|
|
30
79
|
throw new Error("Agent key must be a string");
|