@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
package/docs/pi-extensions.md
CHANGED
|
@@ -57,13 +57,13 @@ all of them. If the harnesses lived there, a plain `pi` run would load them all
|
|
|
57
57
|
same CLI flags would abort startup with duplicate registrations. So the harnesses live in
|
|
58
58
|
`.pi/harnesses/` instead, and you load the desired recipe explicitly:
|
|
59
59
|
|
|
60
|
-
- through the `justfile` — `just hub`, `just ext-damage-control`, `just safe-coms`, …
|
|
60
|
+
- through the `justfile` — `just hub`, `just ext-damage-control-continue`, `just safe-coms`, …
|
|
61
61
|
- or directly — `pi -e .pi/harnesses/<name>/index.ts`
|
|
62
62
|
|
|
63
63
|
When you consume this repo from another project, point `pi -e` at the harness file you
|
|
64
64
|
want, or symlink that one directory into *its* `.pi/harnesses/` — never drop the harnesses
|
|
65
65
|
into `.pi/extensions/`, and never load all of them at once. The supported multi-harness
|
|
66
|
-
exception is loading
|
|
66
|
+
exception is loading `damage-control-continue` and `ask-user-remote` before `agent-hub` for a guarded hub session (see
|
|
67
67
|
[pi-setup.md](pi-setup.md#optional-pi-extensions)).
|
|
68
68
|
|
|
69
69
|
---
|
|
@@ -87,15 +87,44 @@ runtime itself.
|
|
|
87
87
|
|
|
88
88
|
| Extension | Category | What it does | Run |
|
|
89
89
|
|-----------|----------|--------------|-----|
|
|
90
|
-
| [agent-hub](../.pi/harnesses/agent-hub/README.md) | Orchestration | Supported multi-agent hub: damage-control guardrails by default via `just hub`, dispatcher grid, specialist delegation, research helpers, persona gate, embedded coms, `/handoff`, peer-as-subagent — plus, inside a [herdr](https://herdr.dev) pane, fleet tools (`herdr_spawn_peer` / `herdr_read_pane` / `herdr_close_pane` with human confirmation / `herdr_notify`) | `just hub` |
|
|
90
|
+
| [agent-hub](../.pi/harnesses/agent-hub/README.md) | Orchestration | Supported multi-agent hub: damage-control guardrails by default via `just hub`, dispatcher grid, specialist delegation, research helpers, persona gate, embedded coms, `/handoff`, peer-as-subagent, and footer `v<version> · <model><thinking> · <team>` — plus, inside a [herdr](https://herdr.dev) pane, fleet tools (`herdr_spawn_peer` / `herdr_read_pane` / `herdr_close_pane` with human confirmation / `herdr_notify`) | `just hub` |
|
|
91
91
|
| [ask-user-remote](../.pi/harnesses/ask-user-remote/README.md) | Orchestration | Captures stock `pi-ask-user` and registers the default `ask_user`; with `user-remote` live it races local UI against the Hermes bridge, otherwise it is stock local behavior | loaded by `just hub` / `hub-solo` |
|
|
92
|
-
| [damage-control](../.pi/harnesses/damage-control/README.md) | Safety |
|
|
93
|
-
| [damage-control-continue](../.pi/harnesses/damage-control-continue/README.md) | Safety | Same rules, but blocks deliver feedback so the agent adapts and keeps working (no abort); default guardrail for the `just hub` main session + research helpers. Supports path exemptions: `/allow`/`/allowed`/`/revoke`, a block-time approval dialog, and escalation from headless children to the hub dispatcher | `just ext-damage-control-continue` |
|
|
92
|
+
| [damage-control-continue](../.pi/harnesses/damage-control-continue/README.md) | Safety | Only supported safety harness; guards the hub plus every native specialist, researcher, and delegate. Blocks feed back without aborting the turn; protected paths support explicit approval, while dangerous command patterns remain non-exemptible | `just ext-damage-control-continue` |
|
|
94
93
|
| [coms](../.pi/harnesses/coms/README.md) | Messaging | Peer-to-peer messaging between pi agents on one machine; launches damage-control-continue-guarded under a chosen name | `just safe-coms <name>` |
|
|
94
|
+
| [Hermes local monitor transport](../hermes/README.md#local-agent-hub-monitor-integration) | Optional local companion | Owner-only discovery + Unix socket for agent-hub snapshots, cursor output, and exact-generation cancellation; consumed by a separate local Hermes client | Set the two monitor environment variables, then run `just hub-team <team>` |
|
|
95
95
|
|
|
96
96
|
Each extension directory has its own `README.md` with the full description, command/tool
|
|
97
97
|
surface, requirements, and per-extension upstream changes.
|
|
98
98
|
|
|
99
|
+
### Migration: retired hard-stop harness
|
|
100
|
+
|
|
101
|
+
The former `.pi/harnesses/damage-control/` hard-stop harness and `just ext-damage-control`
|
|
102
|
+
recipe are retired. Refresh pi harnesses with guided setup: it removes only an unchanged,
|
|
103
|
+
setup-recorded copy (or an agent-fleet source symlink), preserves user-modified/unowned copies,
|
|
104
|
+
and refreshes the managed `justfile` region. Use `damage-control-continue` for standalone and
|
|
105
|
+
Agent Hub safety; missing child safety now fails closed instead of falling back or spawning
|
|
106
|
+
unguarded.
|
|
107
|
+
|
|
108
|
+
### Harness version footer and provenance
|
|
109
|
+
|
|
110
|
+
The three persistent-UI harnesses — `agent-hub`, `coms`, and
|
|
111
|
+
`damage-control-continue` — each register `v<version>` on one shared status key. In pi's
|
|
112
|
+
default status footer, that shared key gives a supported stack exactly one version instead of one
|
|
113
|
+
copy per harness. `agent-hub` replaces the default footer: it does **not** consume that status
|
|
114
|
+
key. Its custom footer reads its own adjacent stamped manifest and renders one local version
|
|
115
|
+
first — `v<version> · <model><thinking> · <team>` — so an agent-hub stack also displays the
|
|
116
|
+
version exactly once.
|
|
117
|
+
|
|
118
|
+
The shared version status is independent of mutable owner status: for example, a
|
|
119
|
+
Damage-Control violation can replace its own safety message without overwriting the version
|
|
120
|
+
entry. The canonical value is the root `package.json` version. During a release,
|
|
121
|
+
`bin/sync-harness-versions.js` stamps that value into each adjacent persistent-harness
|
|
122
|
+
`package.json` after the root bump and before lockfile finalization and snapshotting. Each
|
|
123
|
+
harness keeps a local `version.ts` provenance reader so copied or symlinked harness directories
|
|
124
|
+
resolve their adjacent stamp rather than the launch directory. That local provenance does not
|
|
125
|
+
make a harness self-contained: copied target harnesses still require the existing full
|
|
126
|
+
`.pi/harnesses/` dependency installation described in [Setup](#setup).
|
|
127
|
+
|
|
99
128
|
### `agent-hub` components
|
|
100
129
|
|
|
101
130
|
`agent-hub` is the consolidated orchestration harness. It replaces the retired standalone
|
|
@@ -123,18 +152,24 @@ harnesses:
|
|
|
123
152
|
`damage-control-continue` safety harness and `ask-user-remote` before `agent-hub`, so the
|
|
124
153
|
dispatcher's tool calls are checked against the rules file and the `askUserAvailable` probe sees
|
|
125
154
|
`ask_user`. A blocked call feeds back and the turn keeps going rather than aborting. `agent-hub` also
|
|
126
|
-
re-loads
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
decides — deny / once / this agent / all agents. Destructive bash patterns are never exemptible.
|
|
155
|
+
re-loads `damage-control-continue` into every native specialist, research helper, and nested
|
|
156
|
+
delegate (via an explicit `-e` that survives `--no-extensions`). Protected-path access can be
|
|
157
|
+
granted at runtime: `/allow <pattern> [turn|session]` in the hub pre-authorizes, a parent-session
|
|
158
|
+
block opens an approval dialog, and a headless child escalates to the hub. Protected deletion
|
|
159
|
+
offers only deny/once; other protected paths may be scoped to an agent or session. Denial and
|
|
160
|
+
timeout fail closed without aborting the child turn. Destructive bash patterns are never exemptible,
|
|
161
|
+
and a missing continue harness refuses child dispatch.
|
|
134
162
|
- **Embedded coms** — peer discovery, `coms_list` / `coms_send` / `coms_get` / `coms_await`,
|
|
135
163
|
`/handoff`, and peer-as-subagent flows.
|
|
136
164
|
- **Solo mode** — `just hub-solo` keeps the dispatcher grid, delegation, research helpers, persona
|
|
137
165
|
gate, and controls, but starts without the embedded coms layer.
|
|
166
|
+
- **Optional Hermes local monitor transport** — uses `AGENT_FLEET_PROFILE_ID`, the absolute
|
|
167
|
+
`AGENT_FLEET_MONITOR_RUNTIME_DIR`, and the Herdr `HERDR_WORKSPACE_ID` and `HERDR_PANE_ID`
|
|
168
|
+
required to establish its stable hub identity. It is a source-owned, local-only transport—not a
|
|
169
|
+
Hermes SDK task/lifecycle RPC or a bundled plugin—and fails closed without validated owner-only
|
|
170
|
+
discovery, lease, token, and socket state. Follow the
|
|
171
|
+
[Hermes integration guide](../hermes/README.md#local-agent-hub-monitor-integration) for startup,
|
|
172
|
+
wire examples, cancellation semantics, and reconnect behavior.
|
|
138
173
|
|
|
139
174
|
---
|
|
140
175
|
|
|
@@ -209,7 +244,7 @@ These ported files are runtime dependencies of the extensions above:
|
|
|
209
244
|
extensions load into the peer process. The `web-debugger` peer uses this to get
|
|
210
245
|
`chrome-devtools-mcp`'s `chrome_devtools__*` tools (see the two-browser-stacks section above).
|
|
211
246
|
- **`.pi/damage-control-rules.yaml`** — the destructive-command / protected-path rule set
|
|
212
|
-
for `damage-control`.
|
|
247
|
+
for `damage-control-continue`.
|
|
213
248
|
- **`.pi/skills/bowser/`** — a pi-runtime skill for headless Playwright browser
|
|
214
249
|
automation, used by the `bowser` agent persona. Kept separate from the core
|
|
215
250
|
engineering `skills/`. It drives the external **Playwright Agent CLI**
|
package/docs/pi-setup.md
CHANGED
|
@@ -27,6 +27,8 @@ No plugin, wrapper, or custom system prompt is required for the core workflow.
|
|
|
27
27
|
|
|
28
28
|
**Recommended companion packages:** [`pi-ask-user`](https://github.com/edlsh/pi-ask-user) adds an interactive `ask_user` tool and bundles an `ask-user` skill. It is bundled automatically when you install `@chankov/agent-fleet` as a pi package; clone/symlink setups should install it separately. `pi-codex-image-gen` is an optional suggested npm/pi extension for image generation; guided setup can offer it when package installation is available, but it is not bundled or required.
|
|
29
29
|
|
|
30
|
+
**Experimental phone conductor:** Linux users may pair Codex CLI `0.144.x` with ChatGPT Android to perform human-confirmed outbound delegation to live coms peers. Guided setup installs the repository assets when pi harnesses are selected, but deliberately never changes systemd, Codex auth/config, pairing, or service state. Host setup remains an explicit operator flow; see [Codex Remote-Control Conductor](codex-remote-conductor.md).
|
|
31
|
+
|
|
30
32
|
---
|
|
31
33
|
|
|
32
34
|
## Installation
|
|
@@ -175,13 +177,13 @@ Verify by starting `pi` and running `/chrome_devtools-status` — expect `Chrome
|
|
|
175
177
|
|
|
176
178
|
#### Extension harnesses — orchestration, safety, messaging
|
|
177
179
|
|
|
178
|
-
This repo ships **
|
|
180
|
+
This repo ships **3 supported session harnesses** ported or consolidated from [disler](https://github.com/disler)'s [`pi-vs-claude-code`](https://github.com/disler/pi-vs-claude-code) project (MIT):
|
|
179
181
|
|
|
180
182
|
- **Orchestration** — `agent-hub` (dispatcher grid, specialist delegation, research helpers, persona gate, embedded coms)
|
|
181
|
-
- **Safety** — `damage-control` (
|
|
183
|
+
- **Safety** — `damage-control-continue` (fail-closed blocks feed back so the agent can report or safely adapt)
|
|
182
184
|
- **Pi-to-Pi messaging** — `coms` (launched guarded via `just safe-coms <name>`, and embedded in `agent-hub`)
|
|
183
185
|
|
|
184
|
-
Unlike the utilities above, each harness reshapes the entire pi session, and most are loaded one per session rather than all at once. The supported stack
|
|
186
|
+
Unlike the utilities above, each harness reshapes the entire pi session, and most are loaded one per session rather than all at once. The supported stack loads `damage-control-continue` and `ask-user-remote` before `agent-hub`; the hub then re-loads continue into every native specialist, research helper, and nested delegate. Protected-path blocks can escalate for explicit approval, while dangerous command patterns remain non-exemptible. Missing child safety refuses dispatch. pi auto-discovers and loads *everything* under `.pi/extensions/`, so the harnesses deliberately live in a separate directory — **`.pi/harnesses/`** — which pi does *not* auto-discover. **Never copy or symlink a harness into `.pi/extensions/`**: that would load it on every plain `pi` run, and stacking all harnesses aborts startup (harnesses that register the same CLI flags clash). Load a harness recipe explicitly instead — there is nothing to symlink:
|
|
185
187
|
|
|
186
188
|
```bash
|
|
187
189
|
# from the agent-fleet clone, via the bundled justfile
|
|
@@ -189,9 +191,15 @@ just --list # list every harness recipe
|
|
|
189
191
|
just hub # launch the guarded consolidated multi-agent hub
|
|
190
192
|
|
|
191
193
|
# or directly, from anywhere — point pi -e at the guarded harness stack
|
|
192
|
-
pi -e /path/to/agent-fleet/.pi/harnesses/damage-control-continue/index.ts -e /path/to/agent-fleet/.pi/harnesses/agent-hub/index.ts
|
|
194
|
+
pi -e /path/to/agent-fleet/.pi/harnesses/damage-control-continue/index.ts -e /path/to/agent-fleet/.pi/harnesses/ask-user-remote/index.ts -e /path/to/agent-fleet/.pi/harnesses/agent-hub/index.ts
|
|
193
195
|
```
|
|
194
196
|
|
|
197
|
+
**Upgrading from the retired hard-stop harness:** `.pi/harnesses/damage-control/` and
|
|
198
|
+
`just ext-damage-control` are no longer shipped. Re-run guided setup to remove only an
|
|
199
|
+
unchanged setup-owned copy (or source symlink) and refresh the managed `justfile` region;
|
|
200
|
+
user-modified and unowned copies are preserved. Use `just ext-damage-control-continue` for
|
|
201
|
+
a standalone safety session.
|
|
202
|
+
|
|
195
203
|
The harnesses have their own runtime dependencies (`yaml`, `@sinclair/typebox`) declared in `.pi/harnesses/package.json` — separate from the extension deps above. Install both at once with `just install` from the clone, or run `npm ci` in `.pi/harnesses/` as well. The [pi extension catalog](pi-extensions.md) has the full list, per-extension `README.md` pointers, required environment variables (for `chrome-devtools-mcp`), and what changed from upstream.
|
|
196
204
|
|
|
197
205
|
Each extension — utility or harness — has its own `README.md` describing what it provides.
|
package/hermes/README.md
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# Hermes artifacts
|
|
2
|
+
|
|
3
|
+
This directory contains in-repository Hermes skills for the coms Hermes bridge plan. They are source artifacts only; this pass does not modify `~/.hermes`.
|
|
4
|
+
|
|
5
|
+
## Skills
|
|
6
|
+
|
|
7
|
+
- `skills/hub-liaison/` — gateway-side Telegram liaison. It writes `~/.pi/coms/hermes-bridge/questions/<qid>.answer.json` answer files for `[HUB-Q:<qid>]` questions consumed by `scripts/coms-hermes-bridge.ts`.
|
|
8
|
+
- `skills/hub-conductor/` — dev-profile conductor. It uses `scripts/coms-cli.ts list` and `scripts/coms-cli.ts send --await --timeout` to delegate to live pi hub-team peers, while preserving the no-herdr damage-control boundary.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
Install a skill into the desired Hermes profile with either option supported by your Hermes setup:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
hermes skills install hermes/skills/hub-liaison
|
|
16
|
+
hermes skills install hermes/skills/hub-conductor
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or copy the skill directories into the profile's skills directory:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
cp -R hermes/skills/hub-liaison ~/.hermes/<profile>/skills/
|
|
23
|
+
cp -R hermes/skills/hub-conductor ~/.hermes/<profile>/skills/
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Use `hub-liaison` in the gateway-owning Telegram profile and `hub-conductor` in the human's dev/conductor profile. Verify availability with your normal Hermes skill listing command before relying on them.
|
|
27
|
+
|
|
28
|
+
## Local agent-hub monitor integration
|
|
29
|
+
|
|
30
|
+
Agent Fleet exposes an optional **local monitor transport** for Hermes-facing tools. This is
|
|
31
|
+
separate from the Telegram/coms bridge:
|
|
32
|
+
|
|
33
|
+
- `hub-liaison` and `hub-conductor` handle human questions and delegation through coms.
|
|
34
|
+
- The monitor transport exposes dispatcher and specialist state through owner-only discovery,
|
|
35
|
+
a token file, and a Unix domain socket (UDS).
|
|
36
|
+
|
|
37
|
+
The repository does **not** ship or install a Hermes backend or Desktop plugin. A Hermes UI,
|
|
38
|
+
operator tool, or other local client may consume the transport contract described below, but it
|
|
39
|
+
owns its own presentation and lifecycle. The hub remains the source of truth for task state,
|
|
40
|
+
output cursors, leases, and generation-safe cancellation.
|
|
41
|
+
|
|
42
|
+
### Integration in action
|
|
43
|
+
|
|
44
|
+
The hub can surface an `ask_user` decision in Hermes Desktop while the specialist workflow keeps
|
|
45
|
+
running. The prompt preserves the question and its choices instead of flattening them into an
|
|
46
|
+
unstructured message:
|
|
47
|
+
|
|
48
|
+

|
|
49
|
+
|
|
50
|
+
The side-by-side view shows the same live question in the Pi hub and Hermes Desktop. This is the
|
|
51
|
+
question-piping path used for remote human input; task monitoring remains the separate local
|
|
52
|
+
transport described below.
|
|
53
|
+
|
|
54
|
+

|
|
55
|
+
|
|
56
|
+
### Start a monitored hub
|
|
57
|
+
|
|
58
|
+
Choose a stable Hermes profile ID and an absolute, owner-only runtime directory. A Herdr-backed
|
|
59
|
+
hub is required because the stable hub identity includes `HERDR_WORKSPACE_ID` and
|
|
60
|
+
`HERDR_PANE_ID`; the normal `hub-team` recipe supplies the Herdr environment.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
monitor_runtime="${XDG_RUNTIME_DIR:?XDG_RUNTIME_DIR must be set}/agent-fleet-monitor"
|
|
64
|
+
install -d -m 700 "$monitor_runtime"
|
|
65
|
+
|
|
66
|
+
export AGENT_FLEET_PROFILE_ID="dev"
|
|
67
|
+
export AGENT_FLEET_MONITOR_RUNTIME_DIR="$monitor_runtime"
|
|
68
|
+
|
|
69
|
+
just hub-team default
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
If either monitor variable is missing or invalid, or if the hub lacks stable Herdr identity, the
|
|
73
|
+
monitor stays disabled while normal agent-hub orchestration continues. The profile ID must start
|
|
74
|
+
with an alphanumeric character and may contain only alphanumerics, `.`, `_`, or `-`; `..` is
|
|
75
|
+
rejected.
|
|
76
|
+
|
|
77
|
+
### Discover the local endpoint
|
|
78
|
+
|
|
79
|
+
The hub creates mode `0700` namespaces under the runtime root. Each active registration contains
|
|
80
|
+
one mode `0600` discovery file and token file, plus a mode `0600` socket:
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
<runtime>/<profile-sha256>/<hub-sha256>/discovery-<owner-id>.json
|
|
84
|
+
<runtime>/<profile-sha256>/<hub-sha256>/token-<owner-id>
|
|
85
|
+
<runtime>/s/<registration-sha256>/s
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
You can list discovery paths without reading or printing their tokens:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
find "$AGENT_FLEET_MONITOR_RUNTIME_DIR" -type f -name 'discovery-*.json' -print
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
A discovery record has this shape:
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"owner": "9db4478e-ef6e-4d5d-930b-6d637f5de4d1",
|
|
99
|
+
"socket": "@runtime/s/0123456789abcdef0123456789abcdef/s",
|
|
100
|
+
"token": "token-9db4478e-ef6e-4d5d-930b-6d637f5de4d1",
|
|
101
|
+
"lease": {
|
|
102
|
+
"hub": "<stable-hub-id>",
|
|
103
|
+
"pid": 12345,
|
|
104
|
+
"startedAt": "2026-07-21T09:00:00.000Z",
|
|
105
|
+
"expiresAt": "2026-07-21T09:00:30.000Z"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
A consumer must reject expired or malformed discovery, paths outside the configured runtime root,
|
|
111
|
+
symlinks, unsafe modes, and socket/token names that do not match the discovery schema. It should
|
|
112
|
+
re-discover after reconnect instead of caching a token or absolute socket path. Never put the token
|
|
113
|
+
in a URL, log, Desktop storage, or command-line argument.
|
|
114
|
+
|
|
115
|
+
### Request snapshot, output, and cancellation
|
|
116
|
+
|
|
117
|
+
The UDS protocol is newline-delimited JSON with one request per connection. Read the token from the
|
|
118
|
+
discovery record's sibling token file, use it only in memory, and terminate every request with
|
|
119
|
+
`\n`.
|
|
120
|
+
|
|
121
|
+
```js
|
|
122
|
+
import net from "node:net";
|
|
123
|
+
|
|
124
|
+
export function monitorRequest(socketPath, request) {
|
|
125
|
+
return new Promise((resolve, reject) => {
|
|
126
|
+
const client = net.createConnection(socketPath);
|
|
127
|
+
let body = "";
|
|
128
|
+
client.setTimeout(1_000, () => client.destroy(new Error("monitor timeout")));
|
|
129
|
+
client.on("connect", () => client.end(`${JSON.stringify(request)}\n`));
|
|
130
|
+
client.on("data", chunk => { body += chunk; });
|
|
131
|
+
client.on("error", reject);
|
|
132
|
+
client.on("close", () => resolve(body ? JSON.parse(body) : null));
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// `token` and `socketPath` were resolved and validated from live discovery.
|
|
137
|
+
const current = await monitorRequest(socketPath, { type: "snapshot", token });
|
|
138
|
+
const delta = await monitorRequest(socketPath, {
|
|
139
|
+
type: "output",
|
|
140
|
+
token,
|
|
141
|
+
taskId: "builder:1",
|
|
142
|
+
generation: 1,
|
|
143
|
+
afterSequence: 0
|
|
144
|
+
});
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Example snapshot response:
|
|
148
|
+
|
|
149
|
+
```json
|
|
150
|
+
{
|
|
151
|
+
"ok": true,
|
|
152
|
+
"snapshot": {
|
|
153
|
+
"tasks": [
|
|
154
|
+
{
|
|
155
|
+
"id": "builder:1",
|
|
156
|
+
"generation": 1,
|
|
157
|
+
"kind": "child",
|
|
158
|
+
"state": "running",
|
|
159
|
+
"outputLatestSequence": 4
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Continue incremental output from the returned sequence to avoid duplicates:
|
|
167
|
+
|
|
168
|
+
```js
|
|
169
|
+
const next = await monitorRequest(socketPath, {
|
|
170
|
+
type: "output",
|
|
171
|
+
token,
|
|
172
|
+
taskId: "builder:1",
|
|
173
|
+
generation: 1,
|
|
174
|
+
afterSequence: delta.output.sequence
|
|
175
|
+
});
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Cancellation is an explicit operator action and must use the exact displayed task ID and
|
|
179
|
+
generation:
|
|
180
|
+
|
|
181
|
+
```js
|
|
182
|
+
const cancelled = await monitorRequest(socketPath, {
|
|
183
|
+
type: "cancel",
|
|
184
|
+
token,
|
|
185
|
+
taskId: "builder:1",
|
|
186
|
+
generation: 1
|
|
187
|
+
});
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
A native specialist cancellation targets only the hub-owned process generation and validates its
|
|
191
|
+
process identity before signalling it. Cancelling a coms-backed run abandons the hub's local wait;
|
|
192
|
+
the remote peer may continue. Neither operation creates, focuses, closes, or otherwise controls a
|
|
193
|
+
Herdr pane or workspace.
|
|
194
|
+
|
|
195
|
+
### Failure and reconnect behavior
|
|
196
|
+
|
|
197
|
+
- `{"ok":false,"error":"unauthorized"}` means the token does not match current ownership.
|
|
198
|
+
- `monitor_unavailable` means the hub-side snapshot/output/cancel handler failed closed.
|
|
199
|
+
- `response_too_large` means the consumer must fall back to a fresh bounded snapshot or cursor.
|
|
200
|
+
- An empty response indicates malformed or out-of-contract input; do not retry it unchanged.
|
|
201
|
+
- When the lease expires, the socket closes, or ownership changes, discard the token and repeat
|
|
202
|
+
discovery. Never fall back to public TCP, a gateway endpoint, or Herdr pane control.
|
|
203
|
+
|
|
204
|
+
Stopping the hub removes its owned discovery, token, and socket. Historical monitor journals under
|
|
205
|
+
the configured runtime root are separate from this live registration and should be removed only by
|
|
206
|
+
an operator who has identified the exact profile/runtime scope.
|
|
207
|
+
|
|
208
|
+
## Usage notes
|
|
209
|
+
|
|
210
|
+
For `hub-liaison`, ensure the Telegram-capable profile has terminal/file-write tools enabled so it can create exactly `~/.pi/coms/hermes-bridge/questions/<qid>.answer.json` and nothing outside that questions directory.
|
|
211
|
+
|
|
212
|
+
For `hub-conductor`, either start the pi team/pool outside Hermes first, or use the repo recipe to create a visible conductor workspace:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
just conductor docs # conductor pane (`hermes -p dev`) + docs team panes
|
|
216
|
+
just conductor-dry docs # dry-run layout, no herdr calls
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Inside Hermes, discover and delegate only through coms:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
node --experimental-strip-types /home/nchankov/repos/agent-fleet/scripts/coms-cli.ts list
|
|
223
|
+
node --experimental-strip-types /home/nchankov/repos/agent-fleet/scripts/coms-cli.ts send <peer> "<task>" --await --timeout 300000
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Hermes must not drive herdr panes or workspaces; the `just conductor` recipe creates the pane before Hermes starts. The no-herdr boundary is documented in `docs/coms-hermes-bridge.md` and governed by `.pi/damage-control-rules.yaml`.
|
|
227
|
+
|
|
228
|
+
Hermes/Telegram remains the inbound `ask_user` path beside the experimental Codex remote-control conductor. Codex is outbound-initiated, approval-gated, and serialized through the validated wrapper; both Hermes and Codex contracts remain advisory outside Pi damage-control, and neither external process has an OS command allowlist. See the [Codex operator runbook](../docs/codex-remote-conductor.md).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
// Self-contained dashboard bundle: Hermes loads this file without relative-module resolution.
|
|
3
|
+
const present=value=>{if(value?.error)return{kind:'error',message:value.error};if(value?.loading)return{kind:'loading'};return value?.tasks?.length?{kind:'tasks',tasks:value.tasks}:{kind:'empty'};};
|
|
4
|
+
|
|
5
|
+
const bounded=(text='')=>String(text).slice(-8192);
|
|
6
|
+
function hierarchy(tasks){const roots=[], parents=new Map();for(const task of tasks){if(task.kind==='parent'){const row={...task,children:[]};parents.set(`${task.hubInstanceId}:${task.id}:${task.generation}`,row);roots.push(row)}}for(const task of tasks.filter(t=>t.kind!=='parent')){const parent=parents.get(`${task.hubInstanceId}:${task.parentId}:${task.parentGeneration}`);if(parent)parent.children.push(task);else roots.push({...task,children:[]})}return roots}
|
|
7
|
+
function Pane({ctx}) {
|
|
8
|
+
const [value,setValue]=useState({loading:true});
|
|
9
|
+
useEffect(()=>{const documentRef=globalThis.document;let live=true, visible=!!documentRef&&documentRef.visibilityState!=='hidden', timer=null, inFlight=false, epoch=0;const cursors=new Map();
|
|
10
|
+
const output=async(row,cursor,pollEpoch)=>{const result=await ctx.rest(`/output?task_id=${encodeURIComponent(row.id)}&generation=${encodeURIComponent(row.generation)}&after_sequence=${encodeURIComponent(cursor)}${row.hubInstanceId?`&hub_instance_id=${encodeURIComponent(row.hubInstanceId)}`:''}`);if(!live||!visible||pollEpoch!==epoch)return; cursors.set(`${row.hubInstanceId}:${row.id}:${row.generation}`,result.sequence??cursor);setValue(old=>({tasks:(old.tasks??[]).map(t=>t.hubInstanceId===row.hubInstanceId&&t.id===row.id&&t.generation===row.generation?{...t,output:bounded(`${t.output??''}${result.text??''}`),outputSequence:result.sequence??t.outputSequence,outputFirstSequence:result.firstSequence,truncated:!!result.truncated}:t)}));};
|
|
11
|
+
const poll=async()=>{if(!visible||inFlight)return;inFlight=true;const pollEpoch=++epoch;try{const snapshot=await ctx.rest('/snapshot');if(!live||!visible||pollEpoch!==epoch)return;const tasks=snapshot.tasks??[];setValue(old=>{const cached=new Map((old.tasks??[]).map(t=>[`${t.hubInstanceId}:${t.id}:${t.generation}`,t]));return{tasks:tasks.map(t=>{const prior=cached.get(`${t.hubInstanceId}:${t.id}:${t.generation}`);return prior&&prior.outputSequence===t.outputSequence?{...t,output:prior.output,outputFirstSequence:prior.outputFirstSequence}:t;})}});for(const row of tasks){const key=`${row.id}:${row.generation}`,cursor=cursors.get(`${row.hubInstanceId}:${key}`)??0;if((row.outputSequence??0)>cursor)await output(row,cursor,pollEpoch)}}catch(error){live&&visible&&setValue({error:String(error)})}finally{inFlight=false}};
|
|
12
|
+
const start=()=>{if(!timer)timer=setInterval(()=>void poll(),1000)}; const change=()=>{visible=documentRef?.visibilityState==='visible';epoch++;if(visible)start();else if(timer){clearInterval(timer);timer=null}};if(visible)start();void poll();documentRef?.addEventListener('visibilitychange',change);return()=>{live=false;if(timer)clearInterval(timer);documentRef?.removeEventListener('visibilitychange',change)};
|
|
13
|
+
},[ctx]);
|
|
14
|
+
const view=present(value);if(view.kind!=='tasks')return React.createElement('div',{role:view.kind==='error'?'alert':'status'},view.message??view.kind);
|
|
15
|
+
const cancel=(task)=>ctx.rest(`/cancel?task_id=${encodeURIComponent(task.id)}&generation=${encodeURIComponent(task.generation)}${task.hubInstanceId?`&hub_instance_id=${encodeURIComponent(task.hubInstanceId)}`:''}`,{method:'POST'});
|
|
16
|
+
const row=(task)=>React.createElement('li',{role:'treeitem',key:`${task.hubInstanceId}:${task.id}:${task.generation}`},`${task.id} · ${task.generation??''} · ${task.state}${task.state==='recovering'?' · Recovering connection':task.state==='orphaned'?' · Task orphaned':''} ${task.output??''}${task.truncated?' [output truncated]':''}`,task.canCancel&&task.state!=='orphaned'?React.createElement('button',{'aria-label':`Cancel ${task.id} generation ${task.generation}`,onClick:()=>cancel(task),onKeyDown:e=>{if(e.key==='Enter'||e.key===' '){e.preventDefault();cancel(task)}}},'Cancel'):null,task.children?.length?React.createElement('ul',{role:'group'},...task.children.map(row)):null);
|
|
17
|
+
return React.createElement('ul',{role:'tree','aria-label':'Agent Fleet tasks'},...hierarchy(view.tasks).map(row));
|
|
18
|
+
}
|
|
19
|
+
export default {id:'agent-fleet-monitor',register(ctx){ctx.register({id:'pane',area:'panes',title:'Agent Fleet Monitor',render:()=>React.createElement(Pane,{ctx})})}};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function present(value) { if (value.error) return { kind: 'error', message: value.error }; if (value.loading) return { kind: 'loading' }; if (!value.tasks?.length) return { kind: 'empty' }; return { kind: 'tasks', tasks: value.tasks }; }
|
|
2
|
+
|
|
3
|
+
// The controller owns the cursor map: output is requested only for bytes newer
|
|
4
|
+
// than the cursor advertised by the same snapshot task generation.
|
|
5
|
+
export function createActiveViewController({ pollMetadata, fetchOutput, onOutput = () => {} }) {
|
|
6
|
+
const cursors=new Map(); let timer=null, visible=false, inFlight=null, epoch=0;
|
|
7
|
+
const poll=()=>{if(!visible||inFlight)return inFlight;const requestEpoch=epoch;const request=(async()=>{const result=await pollMetadata();if(!visible||requestEpoch!==epoch)return;const rows=Array.isArray(result)?result:(result.tasks??[]);for(const row of rows){const key=`${row.hubInstanceId}:${row.id}:${row.generation}`,cursor=cursors.get(key)??0;if((row.outputSequence??0)>cursor){const output=await fetchOutput(row.hubInstanceId,row.id,row.generation,cursor);if(!visible||requestEpoch!==epoch)return;cursors.set(key,output.sequence??cursor);onOutput(row,output);}}})().finally(()=>{if(inFlight===request)inFlight=null;});inFlight=request;return request;};
|
|
8
|
+
return { poll, setVisible(next){if(!next){visible=false;epoch++;if(timer){clearInterval(timer);timer=null}return;}visible=true;if(!timer)timer=setInterval(()=>void poll(),1000);}, dispose(){visible=false;epoch++;if(timer)clearInterval(timer);timer=null} };
|
|
9
|
+
}
|
|
10
|
+
export function aggregateTaskHierarchy(tasks){const parents=tasks.filter(t=>t.kind==='parent').map(parent=>({id:parent.id,state:parent.state,children:[]}));const byId=new Map(tasks.filter(t=>t.kind==='parent').map((parent,i)=>[`${parent.hubInstanceId}:${parent.id}:${parent.generation}`,parents[i]]));for(const child of tasks.filter(t=>t.kind!=='parent')){const item={id:child.id,generation:child.generation,state:child.state};const parent=byId.get(`${child.hubInstanceId}:${child.parentId}:${child.parentGeneration}`);if(parent)parent.children.push(item);else parents.push({...item,children:[]});}return parents;}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import json,socket,tempfile,threading,unittest
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from adapter import MonitorAdapter,MonitorUnavailable,MAX_SNAPSHOT_RESPONSE_BYTES
|
|
4
|
+
class CapTest(unittest.TestCase):
|
|
5
|
+
def request(self, frame):
|
|
6
|
+
with tempfile.TemporaryDirectory() as d:
|
|
7
|
+
p=str(Path(d)/'s');s=socket.socket(socket.AF_UNIX,socket.SOCK_STREAM);s.bind(p);s.listen(1)
|
|
8
|
+
def serve(): c,_=s.accept();c.recv(4096);c.sendall(frame);c.close();s.close()
|
|
9
|
+
t=threading.Thread(target=serve);t.start()
|
|
10
|
+
try:return MonitorAdapter(p,'t')._request({'type':'snapshot'})
|
|
11
|
+
finally:t.join()
|
|
12
|
+
def test_cap_excludes_one_ndjson_delimiter(self):
|
|
13
|
+
base=json.dumps({'x':''},separators=(',',':')).encode();frame=json.dumps({'x':'a'*(MAX_SNAPSHOT_RESPONSE_BYTES-len(base))},separators=(',',':')).encode();self.assertEqual(len(frame),MAX_SNAPSHOT_RESPONSE_BYTES);self.assertIsInstance(self.request(frame+b'\n'),dict)
|
|
14
|
+
with self.assertRaises(MonitorUnavailable):self.request(frame+b'a\n')
|
|
15
|
+
if __name__=='__main__':unittest.main()
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
import tempfile
|
|
4
|
+
import unittest
|
|
5
|
+
from datetime import datetime, timedelta, timezone
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from adapter import MonitorAdapter
|
|
8
|
+
|
|
9
|
+
class AdapterDiscoveryTest(unittest.TestCase):
|
|
10
|
+
def test_discovers_local_socket_and_token_from_explicit_profile_runtime_environment(self):
|
|
11
|
+
with tempfile.TemporaryDirectory() as directory:
|
|
12
|
+
root=Path(directory)/"runtime"; root.mkdir(mode=0o700)
|
|
13
|
+
profile="a"*64; namespace=root/MonitorAdapter.canonical_profile_id(profile)/("b"*64); namespace.mkdir(parents=True, mode=0o700)
|
|
14
|
+
owner="00000000-0000-0000-0000-000000000000"; socket_id=__import__('hashlib').sha256(f"{MonitorAdapter.canonical_profile_id(profile)}:{__import__('hashlib').sha256(b'hub').hexdigest()}:{owner}".encode()).hexdigest()[:32]; token=namespace/f"token-{owner}"; token.write_text("secret"); os.chmod(token,0o600)
|
|
15
|
+
discovery=namespace/f"discovery-{owner}.json"; discovery.write_text(json.dumps({"owner":owner,"socket":f"@runtime/s/{socket_id}/s","token":f"token-{owner}","lease":{"hub":"hub","pid":1,"startedAt":"2020-01-01T00:00:00Z","expiresAt":(datetime.now(timezone.utc)+timedelta(minutes=1)).isoformat()}})); os.chmod(discovery,0o600)
|
|
16
|
+
adapter=MonitorAdapter.from_profile_environment({"AGENT_FLEET_PROFILE_ID":profile,"AGENT_FLEET_MONITOR_RUNTIME_DIR":str(root)})
|
|
17
|
+
self.assertEqual(adapter._socket_path,str(root/f"s/{socket_id}/s")); self.assertEqual(adapter._token,"secret")
|
|
18
|
+
|
|
19
|
+
if __name__ == "__main__": unittest.main()
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import socket,tempfile,threading,unittest
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from adapter import MonitorAdapter,MonitorUnavailable
|
|
4
|
+
class EnvelopeTest(unittest.TestCase):
|
|
5
|
+
def test_rejects_non_object_json_envelope(self):
|
|
6
|
+
with tempfile.TemporaryDirectory() as d:
|
|
7
|
+
p=str(Path(d)/'s'); server=socket.socket(socket.AF_UNIX,socket.SOCK_STREAM);server.bind(p);server.listen(1)
|
|
8
|
+
def serve():
|
|
9
|
+
c,_=server.accept();c.recv(4096);c.sendall(b'[]\n');c.close();server.close()
|
|
10
|
+
t=threading.Thread(target=serve);t.start()
|
|
11
|
+
with self.assertRaises(MonitorUnavailable): MonitorAdapter(p,'secret').snapshot()
|
|
12
|
+
t.join()
|
|
13
|
+
if __name__=='__main__':unittest.main()
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import json,os,tempfile,unittest
|
|
2
|
+
from datetime import datetime,timedelta,timezone
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from adapter import MonitorAdapter,MonitorUnavailable
|
|
5
|
+
class ForgedOwnerTest(unittest.TestCase):
|
|
6
|
+
def test_forged_cross_owner_expired_record_is_not_cleaned(self):
|
|
7
|
+
with tempfile.TemporaryDirectory() as d:
|
|
8
|
+
root=Path(d)/'r';root.mkdir(mode=0o700);p='p';ns=root/MonitorAdapter.canonical_profile_id(p)/('a'*64);ns.mkdir(parents=True,mode=0o700);owner='00000000-0000-0000-0000-000000000000';f=ns/f'discovery-{owner}.json';f.write_text(json.dumps({'owner':owner,'token':'token-11111111-1111-1111-1111-111111111111','socket':'@runtime/s/'+'a'*32+'/s','lease':{'hub':'hub','pid':1,'startedAt':'2020-01-01T00:00:00Z','expiresAt':'2020-01-01T00:00:01Z'}}));os.chmod(f,0o600)
|
|
9
|
+
with self.assertRaises(MonitorUnavailable):MonitorAdapter.from_profile_environment({'AGENT_FLEET_PROFILE_ID':p,'AGENT_FLEET_MONITOR_RUNTIME_DIR':str(root)})
|
|
10
|
+
self.assertTrue(f.exists())
|
|
11
|
+
if __name__=='__main__':unittest.main()
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import json,os,tempfile,unittest
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from adapter import MonitorAdapter,MonitorUnavailable
|
|
4
|
+
class LeaseListTest(unittest.TestCase):
|
|
5
|
+
def test_lease_list_is_unavailable(self):
|
|
6
|
+
with tempfile.TemporaryDirectory() as d:
|
|
7
|
+
root=Path(d)/'r';root.mkdir(mode=0o700); profile='p';ns=root/MonitorAdapter.canonical_profile_id(profile)/('a'*64);ns.mkdir(parents=True,mode=0o700);p=ns/'discovery-00000000-0000-0000-0000-000000000000.json';p.write_text(json.dumps({'lease':[]}));os.chmod(p,0o600)
|
|
8
|
+
with self.assertRaises(MonitorUnavailable):MonitorAdapter.from_profile_environment({'AGENT_FLEET_PROFILE_ID':profile,'AGENT_FLEET_MONITOR_RUNTIME_DIR':str(root)})
|
|
9
|
+
if __name__=='__main__':unittest.main()
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
from adapter import FleetMonitorAdapter, MonitorUnavailable
|
|
3
|
+
class Hub:
|
|
4
|
+
def __init__(self,name,fail=False): self.name=name;self.fail=fail;self.calls=[]
|
|
5
|
+
def snapshot(self):
|
|
6
|
+
if self.fail: raise MonitorUnavailable('down')
|
|
7
|
+
return {'tasks':[{'id':'same','generation':1}]}
|
|
8
|
+
def output(self,*v): self.calls.append(('output',v));return {'text':self.name}
|
|
9
|
+
def cancel(self,*v): self.calls.append(('cancel',v));return {'cancelled':True}
|
|
10
|
+
class MultiHubTest(unittest.TestCase):
|
|
11
|
+
def test_colliding_ids_are_annotated_and_route_to_owner(self):
|
|
12
|
+
a,b=Hub('a'),Hub('b'); f=FleetMonitorAdapter([('a',a),('b',b)])
|
|
13
|
+
self.assertEqual({x['hubInstanceId'] for x in f.snapshot()['tasks']},{'a','b'})
|
|
14
|
+
self.assertEqual(f.output('same',1,0,'b'),{'text':'b'}); self.assertEqual(b.calls,[('output',('same',1,0))]);self.assertEqual(a.calls,[])
|
|
15
|
+
def test_failed_hub_does_not_drop_healthy_tasks(self):
|
|
16
|
+
result=FleetMonitorAdapter([('a',Hub('a')),('b',Hub('b',True))]).snapshot();self.assertEqual(len(result['tasks']),1);self.assertEqual(result['hubs'][0]['hubInstanceId'],'b')
|
|
17
|
+
if __name__=='__main__': unittest.main()
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import socket
|
|
3
|
+
import tempfile
|
|
4
|
+
import threading
|
|
5
|
+
import unittest
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
from adapter import MonitorAdapter
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AdapterOutputTest(unittest.TestCase):
|
|
12
|
+
def test_maps_typed_output_route_to_authenticated_uds_cursor_request(self):
|
|
13
|
+
with tempfile.TemporaryDirectory() as directory:
|
|
14
|
+
socket_path = str(Path(directory) / "monitor.sock")
|
|
15
|
+
server = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
|
16
|
+
server.bind(socket_path)
|
|
17
|
+
server.listen(1)
|
|
18
|
+
|
|
19
|
+
def serve():
|
|
20
|
+
client, _ = server.accept()
|
|
21
|
+
request = json.loads(client.recv(4096).decode())
|
|
22
|
+
self.assertEqual(request, {"type": "output", "token": "secret", "taskId": "task", "generation": 2, "afterSequence": 7})
|
|
23
|
+
client.sendall(b'{"ok":true,"output":{"text":"new","sequence":8,"firstSequence":8,"truncated":false}}\n')
|
|
24
|
+
client.close()
|
|
25
|
+
server.close()
|
|
26
|
+
|
|
27
|
+
thread = threading.Thread(target=serve)
|
|
28
|
+
thread.start()
|
|
29
|
+
self.assertEqual(MonitorAdapter(socket_path, "secret").output("task", 2, 7), {"text": "new", "sequence": 8, "firstSequence": 8, "truncated": False})
|
|
30
|
+
thread.join()
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
if __name__ == "__main__":
|
|
34
|
+
unittest.main()
|