@chankov/agent-fleet 0.0.11 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.pi/extensions/agent-fleet-update-check/README.md +4 -4
- package/.pi/extensions/btw/README.md +26 -25
- package/.pi/extensions/btw/index.ts +80 -83
- package/.pi/extensions/pi-voice-stt/README.md +4 -3
- package/.pi/extensions/pi-voice-stt/config.ts +1 -1
- package/.pi/harnesses/agent-hub/README.md +106 -54
- package/.pi/harnesses/agent-hub/backend-policy.js +25 -4
- package/.pi/harnesses/agent-hub/footer.ts +4 -0
- package/.pi/harnesses/agent-hub/helpers.ts +18 -0
- package/.pi/harnesses/agent-hub/index.ts +537 -369
- package/.pi/harnesses/agent-hub/monitor-session-bridge.ts +10 -1
- package/.pi/harnesses/agent-hub/package.json +1 -1
- package/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
- package/.pi/harnesses/agent-hub/posture.ts +103 -0
- package/.pi/harnesses/ask-user-remote/README.md +37 -3
- package/.pi/harnesses/ask-user-remote/index.ts +173 -17
- package/.pi/harnesses/coms/package.json +1 -1
- package/.pi/harnesses/damage-control-continue/package.json +1 -1
- package/.pi/harnesses/lib/fleet-dashboard-ops.ts +118 -0
- package/.pi/harnesses/lib/fleet-dashboard-view.ts +140 -0
- package/.pi/harnesses/lib/fleet-detail-view.ts +43 -0
- package/.pi/harnesses/lib/fleet-overlay.ts +26 -0
- package/.pi/harnesses/lib/fleet-panel.ts +34 -0
- package/.pi/harnesses/lib/fleet-read-model.ts +131 -0
- package/.pi/harnesses/lib/fleet-selection.ts +24 -0
- package/.pi/harnesses/package-lock.json +2011 -0
- package/.pi/harnesses/package.json +1 -0
- package/.versions/0.0.11/.pi/extensions/agent-fleet-update-check/README.md +4 -4
- package/.versions/0.0.11/.pi/extensions/pi-voice-stt/README.md +4 -3
- package/.versions/0.0.11/.pi/extensions/pi-voice-stt/config.ts +1 -1
- package/.versions/0.0.11/.pi/harnesses/agent-hub/monitor-session-bridge.ts +10 -1
- package/.versions/0.0.11/.pi/harnesses/ask-user-remote/README.md +37 -3
- package/.versions/0.0.11/.pi/harnesses/ask-user-remote/index.ts +173 -17
- package/.versions/0.0.11/.pi/harnesses/package-lock.json +2011 -0
- package/.versions/0.0.11/.pi/harnesses/package.json +1 -0
- package/.versions/0.0.11/docs/ARCHITECTURE.md +6 -8
- package/.versions/0.0.11/docs/agent-fleet-setup.md +17 -43
- package/.versions/0.0.11/docs/claude-code-coms-bridge.md +20 -2
- package/.versions/0.0.11/docs/coms-hermes-bridge.md +1 -1
- package/.versions/0.0.11/docs/getting-started.md +26 -237
- package/.versions/0.0.11/docs/npm-install.md +60 -478
- package/.versions/0.0.11/docs/pi-extensions.md +4 -4
- package/.versions/0.0.11/docs/pi-setup.md +37 -551
- package/.versions/0.0.11/hermes/README.md +1 -1
- package/.versions/0.0.11/install-manifest.json +375 -1247
- package/.versions/0.0.11/justfile +13 -6
- package/.versions/0.0.11/manifest-meta.json +543 -134
- package/.versions/0.0.11/scripts/lib/fleet-command.ts +8 -0
- package/.versions/0.0.11/scripts/lib/monitor-env.ts +18 -6
- package/.versions/0.0.11/skills/designing-agents/SKILL.md +1 -1
- package/.versions/0.0.11/skills/designing-agents/pi-harness-authoring.md +1 -1
- package/.versions/1.0.0/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/1.0.0/.pi/agents/model-profiles.yaml +27 -0
- package/.versions/1.0.0/.pi/agents/peers.yaml +142 -0
- package/.versions/1.0.0/.pi/agents/teams.yaml +41 -0
- package/.versions/1.0.0/.pi/damage-control-rules.yaml +297 -0
- package/.versions/1.0.0/.pi/extensions/agent-fleet-update-check/README.md +57 -0
- package/.versions/1.0.0/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
- package/.versions/1.0.0/.pi/extensions/agent-fleet-update-check/package.json +6 -0
- package/.versions/1.0.0/.pi/extensions/btw/README.md +120 -0
- package/.versions/1.0.0/.pi/extensions/btw/index.ts +914 -0
- package/.versions/1.0.0/.pi/extensions/btw/package.json +6 -0
- package/.versions/1.0.0/.pi/extensions/btw/state.js +179 -0
- package/.versions/1.0.0/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
- package/.versions/1.0.0/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
- package/.versions/1.0.0/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/1.0.0/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/1.0.0/.pi/extensions/compact-and-continue/index.ts +120 -0
- package/.versions/1.0.0/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/1.0.0/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/1.0.0/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/1.0.0/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/1.0.0/.pi/extensions/package-lock.json +1143 -0
- package/.versions/1.0.0/.pi/extensions/package.json +9 -0
- package/.versions/1.0.0/.pi/extensions/pi-voice-stt/README.md +205 -0
- package/.versions/1.0.0/.pi/extensions/pi-voice-stt/config.ts +198 -0
- package/.versions/1.0.0/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/1.0.0/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/1.0.0/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/1.0.0/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/1.0.0/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/README.md +1056 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/access-approval.ts +135 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/artifacts.js +146 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/assertion-ledger.js +58 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/backend-policy.js +174 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/context-window.js +106 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/delegate.ts +435 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/docs-lane.js +122 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/drift-watchdog.js +211 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/external-blocker.js +85 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/footer.ts +35 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/helpers.ts +266 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/index.ts +9279 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/posture.ts +103 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/research-retention.js +34 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/return-contract.js +293 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/return-extract.js +75 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/review-findings.js +102 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/run-budget.js +479 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/run-namespace.js +87 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/scope-gate.js +103 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/spawn.ts +354 -0
- package/.versions/1.0.0/.pi/harnesses/agent-hub/version.ts +42 -0
- package/.versions/1.0.0/.pi/harnesses/ask-user-remote/README.md +53 -0
- package/.versions/1.0.0/.pi/harnesses/ask-user-remote/index.ts +477 -0
- package/.versions/1.0.0/.pi/harnesses/ask-user-remote/race-core.js +106 -0
- package/.versions/1.0.0/.pi/harnesses/coms/README.md +100 -0
- package/.versions/1.0.0/.pi/harnesses/coms/index.ts +1767 -0
- package/.versions/1.0.0/.pi/harnesses/coms/package.json +7 -0
- package/.versions/1.0.0/.pi/harnesses/coms/version.ts +42 -0
- package/.versions/1.0.0/.pi/harnesses/damage-control-continue/README.md +124 -0
- package/.versions/1.0.0/.pi/harnesses/damage-control-continue/index.ts +536 -0
- package/.versions/1.0.0/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/1.0.0/.pi/harnesses/damage-control-continue/version.ts +42 -0
- package/.versions/1.0.0/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
- package/.versions/1.0.0/.pi/harnesses/lib/damage-control-shared.ts +197 -0
- package/.versions/1.0.0/.pi/harnesses/lib/fleet-dashboard-ops.ts +118 -0
- package/.versions/1.0.0/.pi/harnesses/lib/fleet-dashboard-view.ts +140 -0
- package/.versions/1.0.0/.pi/harnesses/lib/fleet-detail-view.ts +43 -0
- package/.versions/1.0.0/.pi/harnesses/lib/fleet-overlay.ts +26 -0
- package/.versions/1.0.0/.pi/harnesses/lib/fleet-panel.ts +34 -0
- package/.versions/1.0.0/.pi/harnesses/lib/fleet-read-model.ts +131 -0
- package/.versions/1.0.0/.pi/harnesses/lib/fleet-selection.ts +24 -0
- package/.versions/1.0.0/.pi/harnesses/lib/herdr-client.ts +472 -0
- package/.versions/1.0.0/.pi/harnesses/lib/herdr-presence.ts +399 -0
- package/.versions/1.0.0/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.versions/1.0.0/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/1.0.0/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
- package/.versions/1.0.0/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/1.0.0/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
- package/.versions/1.0.0/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
- package/.versions/1.0.0/.pi/harnesses/lib/spawned-peers.js +190 -0
- package/.versions/1.0.0/.pi/harnesses/package-lock.json +2046 -0
- package/.versions/1.0.0/.pi/harnesses/package.json +10 -0
- package/.versions/1.0.0/.pi/prompts/af-build.md +24 -0
- package/{.claude/commands/code-simplify.md → .versions/1.0.0/.pi/prompts/af-code-simplify.md} +3 -3
- package/{.claude/commands/plan.md → .versions/1.0.0/.pi/prompts/af-plan.md} +1 -1
- package/.versions/{0.0.11/.claude/commands/review.md → 1.0.0/.pi/prompts/af-review.md} +3 -3
- package/.versions/1.0.0/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/1.0.0/.pi/prompts/af-ship.md +17 -0
- package/.versions/{0.0.11/.claude/commands/spec.md → 1.0.0/.pi/prompts/af-spec.md} +1 -1
- package/.versions/{0.0.11/.claude/commands/test.md → 1.0.0/.pi/prompts/af-test.md} +2 -2
- package/.versions/1.0.0/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/1.0.0/.version +1 -0
- package/.versions/1.0.0/agents/architect.md +24 -0
- package/.versions/1.0.0/agents/bowser.md +27 -0
- package/.versions/1.0.0/agents/builder.md +54 -0
- package/.versions/1.0.0/agents/code-reviewer.md +208 -0
- package/.versions/1.0.0/agents/deep-researcher.md +32 -0
- package/.versions/1.0.0/agents/documenter.md +18 -0
- package/.versions/1.0.0/agents/orchestrator.md +72 -0
- package/.versions/1.0.0/agents/plan-reviewer.md +83 -0
- package/.versions/1.0.0/agents/planner.md +70 -0
- package/.versions/1.0.0/agents/releaser.md +24 -0
- package/.versions/1.0.0/agents/researcher.md +28 -0
- package/.versions/1.0.0/agents/security-auditor.md +167 -0
- package/.versions/1.0.0/agents/test-engineer.md +153 -0
- package/.versions/1.0.0/agents/web-debugger.md +43 -0
- package/.versions/1.0.0/agents/web-performance-auditor.md +193 -0
- package/.versions/1.0.0/codex/CONDUCTOR.md +148 -0
- package/.versions/1.0.0/docs/ARCHITECTURE.md +337 -0
- package/.versions/1.0.0/docs/agent-fleet-setup.md +437 -0
- package/.versions/1.0.0/docs/claude-code-coms-bridge.md +128 -0
- package/.versions/1.0.0/docs/codex-remote-conductor.md +170 -0
- package/.versions/1.0.0/docs/coms-hermes-bridge.md +189 -0
- package/.versions/1.0.0/docs/getting-started.md +98 -0
- package/.versions/1.0.0/docs/npm-install.md +292 -0
- package/.versions/1.0.0/docs/pi-extensions.md +412 -0
- package/.versions/1.0.0/docs/pi-setup.md +74 -0
- package/.versions/1.0.0/docs/skill-anatomy.md +150 -0
- package/.versions/1.0.0/hermes/README.md +347 -0
- package/.versions/1.0.0/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/.versions/1.0.0/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/.versions/1.0.0/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/1.0.0/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/1.0.0/hermes/gates/gate-o-capability.md +8 -0
- package/.versions/1.0.0/hermes/gates/gate-o-validator-fixtures.json +1 -0
- package/.versions/1.0.0/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +770 -0
- package/.versions/1.0.0/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/.versions/1.0.0/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/.versions/1.0.0/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/.versions/1.0.0/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/.versions/1.0.0/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/.versions/1.0.0/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/.versions/1.0.0/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/.versions/1.0.0/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/.versions/1.0.0/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/.versions/1.0.0/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/.versions/1.0.0/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/1.0.0/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/1.0.0/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/1.0.0/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/1.0.0/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/.versions/1.0.0/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/.versions/1.0.0/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/.versions/1.0.0/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/.versions/1.0.0/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/.versions/1.0.0/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/.versions/1.0.0/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/.versions/1.0.0/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/.versions/1.0.0/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/.versions/1.0.0/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/.versions/1.0.0/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/.versions/1.0.0/hermes/watchdog-tests/__init__.py +0 -0
- package/.versions/1.0.0/hooks/coms-stop-hook.mjs +84 -0
- package/.versions/1.0.0/install-manifest.json +2745 -0
- package/.versions/1.0.0/justfile +272 -0
- package/.versions/1.0.0/manifest-meta.json +882 -0
- package/.versions/1.0.0/references/accessibility-checklist.md +160 -0
- package/.versions/1.0.0/references/definition-of-done.md +67 -0
- package/.versions/1.0.0/references/fleet-coordination-patterns.md +151 -0
- package/.versions/1.0.0/references/observability-checklist.md +91 -0
- package/.versions/1.0.0/references/orchestration-patterns.md +370 -0
- package/.versions/1.0.0/references/performance-checklist.md +153 -0
- package/.versions/1.0.0/references/prompting-patterns.md +380 -0
- package/.versions/1.0.0/references/security-checklist.md +179 -0
- package/.versions/1.0.0/references/testing-patterns.md +236 -0
- package/.versions/1.0.0/scripts/codex-conductor.ts +41 -0
- package/.versions/1.0.0/scripts/codex-remote-control.ts +167 -0
- package/.versions/1.0.0/scripts/coms-claude-bridge.ts +411 -0
- package/.versions/1.0.0/scripts/coms-cli.ts +484 -0
- package/.versions/1.0.0/scripts/coms-hermes-bridge.ts +413 -0
- package/.versions/1.0.0/scripts/fleet.ts +185 -0
- package/.versions/1.0.0/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/1.0.0/scripts/hermes-monitor-scenario.ts +474 -0
- package/.versions/1.0.0/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/.versions/1.0.0/scripts/install-hermes-plugin.sh +180 -0
- package/.versions/1.0.0/scripts/lib/claude-bridge-core.ts +210 -0
- package/.versions/1.0.0/scripts/lib/codex-conductor.ts +88 -0
- package/.versions/1.0.0/scripts/lib/codex-remote-control.ts +480 -0
- package/.versions/1.0.0/scripts/lib/coms-envelope.ts +582 -0
- package/.versions/1.0.0/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/1.0.0/scripts/lib/fleet-command.ts +266 -0
- package/.versions/1.0.0/scripts/lib/herdr-layout.ts +281 -0
- package/.versions/1.0.0/scripts/lib/hermes-bridge-core.ts +241 -0
- package/.versions/1.0.0/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.versions/1.0.0/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/.versions/1.0.0/scripts/lib/hermes-monitor-model.ts +3 -0
- package/.versions/1.0.0/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.versions/1.0.0/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.versions/1.0.0/scripts/lib/hermes-monitor-store.ts +2 -0
- package/.versions/1.0.0/scripts/lib/monitor-env.ts +146 -0
- package/.versions/1.0.0/scripts/lib/peer-launch.ts +318 -0
- package/.versions/1.0.0/scripts/lib/persona-banner.ts +62 -0
- package/.versions/1.0.0/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/1.0.0/scripts/lib/team-project.ts +213 -0
- package/.versions/1.0.0/scripts/lib/team-snapshot.ts +147 -0
- package/.versions/1.0.0/scripts/peer-banner.ts +40 -0
- package/.versions/1.0.0/scripts/peer-launch.ts +259 -0
- package/.versions/1.0.0/scripts/team-snapshot.ts +237 -0
- package/.versions/1.0.0/scripts/team-up.ts +406 -0
- package/.versions/1.0.0/skills/_internal/grilling.md +11 -0
- package/.versions/1.0.0/skills/browser-testing-with-devtools/SKILL.md +351 -0
- package/.versions/1.0.0/skills/code-review-and-quality/SKILL.md +381 -0
- package/.versions/1.0.0/skills/compound-learning/SKILL.md +137 -0
- package/.versions/1.0.0/skills/context-engineering/SKILL.md +291 -0
- package/.versions/1.0.0/skills/deprecation-and-migration/SKILL.md +206 -0
- package/.versions/1.0.0/skills/designing-agents/SKILL.md +394 -0
- package/.versions/1.0.0/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/1.0.0/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/1.0.0/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/1.0.0/skills/idea-refine/SKILL.md +182 -0
- package/.versions/1.0.0/skills/idea-refine/examples.md +238 -0
- package/.versions/1.0.0/skills/idea-refine/frameworks.md +99 -0
- package/.versions/1.0.0/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/1.0.0/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/1.0.0/skills/incremental-implementation/SKILL.md +287 -0
- package/.versions/1.0.0/skills/interview-me/SKILL.md +226 -0
- package/.versions/1.0.0/skills/orchestration-verification/SKILL.md +181 -0
- package/.versions/1.0.0/skills/peer-coms/SKILL.md +90 -0
- package/.versions/1.0.0/skills/performance-optimization/SKILL.md +350 -0
- package/.versions/1.0.0/skills/planning-and-task-breakdown/SKILL.md +254 -0
- package/.versions/1.0.0/skills/security-and-hardening/SKILL.md +461 -0
- package/.versions/1.0.0/skills/spec-driven-development/SKILL.md +257 -0
- package/.versions/1.0.0/skills/using-agent-skills/SKILL.md +199 -0
- package/.versions/1.0.0/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/README.md +11 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
- package/.versions/1.0.0/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
- package/CHANGELOG.md +142 -0
- package/README.md +117 -79
- package/agents/orchestrator.md +1 -1
- package/bin/cli.js +289 -359
- package/bin/force-patch-changesets.js +18 -2
- package/bin/lib/apply.js +86 -32
- package/bin/lib/desired.js +87 -0
- package/bin/lib/detect-agent.js +22 -38
- package/bin/lib/doctor.js +283 -33
- package/bin/lib/features.js +78 -0
- package/bin/lib/manifest.js +127 -48
- package/bin/lib/overrides.js +35 -0
- package/bin/lib/personas.js +37 -0
- package/bin/lib/plan.js +18 -9
- package/bin/lib/purge.js +11 -0
- package/bin/lib/reconcile.js +68 -0
- package/bin/lib/scan.js +24 -0
- package/bin/lib/state.js +25 -1
- package/bin/lib/stt-wizard.js +33 -0
- package/bin/lib/transaction.js +149 -0
- package/bin/lib/tui.js +71 -0
- package/bin/lib/verify.js +9 -26
- package/bin/snapshot-version.js +3 -6
- package/docs/ARCHITECTURE.md +55 -21
- package/docs/MIGRATION-agent-fleet.md +222 -0
- package/docs/agent-fleet-setup.md +124 -64
- package/docs/claude-code-coms-bridge.md +21 -2
- package/docs/coms-hermes-bridge.md +1 -1
- package/docs/getting-started.md +61 -217
- package/docs/npm-install.md +207 -429
- package/docs/pi-extensions.md +85 -41
- package/docs/pi-setup.md +48 -545
- package/hermes/README.md +1 -1
- package/install-manifest.json +385 -1255
- package/justfile +45 -27
- package/manifest-meta.json +544 -134
- package/node_modules/pi-ask-user/README.md +43 -5
- package/node_modules/pi-ask-user/index.ts +630 -75
- package/node_modules/pi-ask-user/package.json +1 -1
- package/package.json +5 -11
- package/scripts/coms-claude-bridge.ts +10 -0
- package/scripts/fleet.ts +107 -90
- package/scripts/lib/claude-bridge-core.ts +45 -0
- package/scripts/lib/fleet-command.ts +170 -15
- package/scripts/lib/monitor-env.ts +18 -6
- package/scripts/lib/peer-launch.ts +6 -2
- package/scripts/lib/team-project.ts +24 -4
- package/scripts/team-up.ts +57 -11
- package/skills/designing-agents/SKILL.md +1 -1
- package/skills/designing-agents/pi-harness-authoring.md +3 -3
- package/.claude/commands/build.md +0 -44
- package/.claude/commands/design-agent.md +0 -14
- package/.claude/commands/doctor-agent-fleet.md +0 -22
- package/.claude/commands/orchestrate.md +0 -112
- package/.claude/commands/prime.md +0 -22
- package/.claude/commands/review.md +0 -16
- package/.claude/commands/set-hermes-telegram.md +0 -15
- package/.claude/commands/set-hermes-watchdog.md +0 -6
- package/.claude/commands/setup-agent-fleet.md +0 -17
- package/.claude/commands/ship.md +0 -72
- package/.claude/commands/spec.md +0 -15
- package/.claude/commands/test.md +0 -19
- package/.claude/commands/webperf.md +0 -32
- package/.claude/orchestrate-teams.yaml +0 -24
- package/.opencode/commands/af-build.md +0 -17
- package/.opencode/commands/af-code-simplify.md +0 -16
- package/.opencode/commands/af-compound.md +0 -16
- package/.opencode/commands/af-design-agent.md +0 -15
- package/.opencode/commands/af-doctor-agent-fleet.md +0 -22
- package/.opencode/commands/af-orchestrate.md +0 -112
- package/.opencode/commands/af-plan.md +0 -16
- package/.opencode/commands/af-prime.md +0 -22
- package/.opencode/commands/af-review.md +0 -15
- package/.opencode/commands/af-set-hermes-watchdog.md +0 -6
- package/.opencode/commands/af-setup-agent-fleet.md +0 -17
- package/.opencode/commands/af-ship.md +0 -16
- package/.opencode/commands/af-spec.md +0 -16
- package/.opencode/commands/af-test.md +0 -21
- package/.opencode/commands/af-webperf.md +0 -32
- package/.opencode/orchestrate-teams.yaml +0 -24
- package/.pi/prompts/af-doctor-agent-fleet.md +0 -22
- package/.pi/prompts/af-setup-agent-fleet.md +0 -19
- package/.versions/0.0.1/.opencode/commands/af-doctor-agent-fleet.md +0 -15
- package/.versions/0.0.1/.opencode/commands/af-setup-agent-fleet.md +0 -15
- package/.versions/0.0.1/skills/guided-workspace-setup/SKILL.md +0 -506
- package/.versions/0.0.10/.opencode/commands/af-doctor-agent-fleet.md +0 -22
- package/.versions/0.0.10/.opencode/commands/af-setup-agent-fleet.md +0 -17
- package/.versions/0.0.10/.pi/prompts/af-doctor-agent-fleet.md +0 -22
- package/.versions/0.0.10/.pi/prompts/af-setup-agent-fleet.md +0 -19
- package/.versions/0.0.10/skills/guided-workspace-setup/SKILL.md +0 -226
- package/.versions/0.0.11/.claude/commands/build.md +0 -44
- package/.versions/0.0.11/.claude/commands/code-simplify.md +0 -22
- package/.versions/0.0.11/.claude/commands/design-agent.md +0 -14
- package/.versions/0.0.11/.claude/commands/doctor-agent-fleet.md +0 -22
- package/.versions/0.0.11/.claude/commands/orchestrate.md +0 -112
- package/.versions/0.0.11/.claude/commands/plan.md +0 -16
- package/.versions/0.0.11/.claude/commands/prime.md +0 -22
- package/.versions/0.0.11/.claude/commands/set-hermes-telegram.md +0 -15
- package/.versions/0.0.11/.claude/commands/set-hermes-watchdog.md +0 -6
- package/.versions/0.0.11/.claude/commands/setup-agent-fleet.md +0 -17
- package/.versions/0.0.11/.claude/commands/ship.md +0 -72
- package/.versions/0.0.11/.claude/commands/webperf.md +0 -32
- package/.versions/0.0.11/.claude/orchestrate-teams.yaml +0 -24
- package/.versions/0.0.11/.opencode/commands/af-build.md +0 -17
- package/.versions/0.0.11/.opencode/commands/af-code-simplify.md +0 -16
- package/.versions/0.0.11/.opencode/commands/af-compound.md +0 -16
- package/.versions/0.0.11/.opencode/commands/af-design-agent.md +0 -15
- package/.versions/0.0.11/.opencode/commands/af-doctor-agent-fleet.md +0 -22
- package/.versions/0.0.11/.opencode/commands/af-orchestrate.md +0 -112
- package/.versions/0.0.11/.opencode/commands/af-plan.md +0 -16
- package/.versions/0.0.11/.opencode/commands/af-prime.md +0 -22
- package/.versions/0.0.11/.opencode/commands/af-review.md +0 -15
- package/.versions/0.0.11/.opencode/commands/af-set-hermes-telegram.md +0 -15
- package/.versions/0.0.11/.opencode/commands/af-set-hermes-watchdog.md +0 -6
- package/.versions/0.0.11/.opencode/commands/af-setup-agent-fleet.md +0 -17
- package/.versions/0.0.11/.opencode/commands/af-ship.md +0 -16
- package/.versions/0.0.11/.opencode/commands/af-spec.md +0 -16
- package/.versions/0.0.11/.opencode/commands/af-test.md +0 -21
- package/.versions/0.0.11/.opencode/commands/af-webperf.md +0 -32
- package/.versions/0.0.11/.opencode/orchestrate-teams.yaml +0 -24
- package/.versions/0.0.11/.pi/prompts/af-doctor-agent-fleet.md +0 -22
- package/.versions/0.0.11/.pi/prompts/af-setup-agent-fleet.md +0 -19
- package/.versions/0.0.11/docs/opencode-setup.md +0 -281
- package/.versions/0.0.11/hooks/SIMPLIFY-IGNORE.md +0 -90
- package/.versions/0.0.11/hooks/hooks.json +0 -14
- package/.versions/0.0.11/hooks/session-start.sh +0 -74
- package/.versions/0.0.11/hooks/simplify-ignore.sh +0 -302
- package/.versions/0.0.11/skills/guided-workspace-setup/SKILL.md +0 -226
- package/.versions/0.0.4/.opencode/commands/af-doctor-agent-fleet.md +0 -17
- package/.versions/0.0.4/.opencode/commands/af-setup-agent-fleet.md +0 -15
- package/.versions/0.0.4/skills/guided-workspace-setup/SKILL.md +0 -535
- package/.versions/0.0.4/skills/guided-workspace-setup/companion-manifest.json +0 -33
- package/.versions/0.0.5/.opencode/commands/af-doctor-agent-fleet.md +0 -17
- package/.versions/0.0.5/.opencode/commands/af-setup-agent-fleet.md +0 -15
- package/.versions/0.0.5/skills/guided-workspace-setup/SKILL.md +0 -542
- package/.versions/0.0.5/skills/guided-workspace-setup/companion-manifest.json +0 -35
- package/.versions/0.0.6/.opencode/commands/af-doctor-agent-fleet.md +0 -17
- package/.versions/0.0.6/.opencode/commands/af-setup-agent-fleet.md +0 -15
- package/.versions/0.0.6/.pi/prompts/af-doctor-agent-fleet.md +0 -15
- package/.versions/0.0.6/.pi/prompts/af-setup-agent-fleet.md +0 -27
- package/.versions/0.0.6/skills/guided-workspace-setup/SKILL.md +0 -544
- package/.versions/0.0.6/skills/guided-workspace-setup/companion-manifest.json +0 -35
- package/.versions/0.0.7/.opencode/commands/af-doctor-agent-fleet.md +0 -17
- package/.versions/0.0.7/.opencode/commands/af-setup-agent-fleet.md +0 -15
- package/.versions/0.0.7/.pi/prompts/af-doctor-agent-fleet.md +0 -15
- package/.versions/0.0.7/.pi/prompts/af-setup-agent-fleet.md +0 -27
- package/.versions/0.0.7/skills/guided-workspace-setup/SKILL.md +0 -544
- package/.versions/0.0.7/skills/guided-workspace-setup/companion-manifest.json +0 -35
- package/.versions/0.0.8/.opencode/commands/af-doctor-agent-fleet.md +0 -17
- package/.versions/0.0.8/.opencode/commands/af-setup-agent-fleet.md +0 -15
- package/.versions/0.0.8/.pi/prompts/af-doctor-agent-fleet.md +0 -15
- package/.versions/0.0.8/.pi/prompts/af-setup-agent-fleet.md +0 -27
- package/.versions/0.0.8/skills/guided-workspace-setup/SKILL.md +0 -544
- package/.versions/0.0.8/skills/guided-workspace-setup/companion-manifest.json +0 -36
- package/.versions/0.0.9/.opencode/commands/af-doctor-agent-fleet.md +0 -17
- package/.versions/0.0.9/.opencode/commands/af-setup-agent-fleet.md +0 -15
- package/.versions/0.0.9/.pi/prompts/af-doctor-agent-fleet.md +0 -15
- package/.versions/0.0.9/.pi/prompts/af-setup-agent-fleet.md +0 -27
- package/.versions/0.0.9/skills/guided-workspace-setup/SKILL.md +0 -544
- package/bin/lib/bootstrap.js +0 -323
- package/bin/lib/transform-persona.js +0 -180
- package/docs/opencode-setup.md +0 -281
- package/hooks/SIMPLIFY-IGNORE.md +0 -90
- package/hooks/hooks.json +0 -14
- package/hooks/session-start.sh +0 -74
- package/hooks/simplify-ignore.sh +0 -302
- package/skills/guided-workspace-setup/SKILL.md +0 -226
- /package/.versions/0.0.10/{skills/guided-workspace-setup/companion-manifest.json → bin/catalog/harness-runtime-closure.json} +0 -0
- /package/.versions/0.0.11/{skills/guided-workspace-setup/companion-manifest.json → bin/catalog/harness-runtime-closure.json} +0 -0
- /package/{.opencode/commands → .versions/1.0.0/.pi/prompts}/af-set-hermes-telegram.md +0 -0
- /package/.versions/{0.0.9/skills/guided-workspace-setup/companion-manifest.json → 1.0.0/bin/catalog/harness-runtime-closure.json} +0 -0
- /package/{skills/guided-workspace-setup/companion-manifest.json → bin/catalog/harness-runtime-closure.json} +0 -0
|
@@ -97,6 +97,14 @@ export function createMonitorSessionBridge(deps: any = {}) {
|
|
|
97
97
|
throw error;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
const latestGenerationById = new Map<string, number>();
|
|
101
|
+
for (const task of records()) latestGenerationById.set(task.id, Math.max(latestGenerationById.get(task.id) ?? 0, task.generation));
|
|
102
|
+
const reserveGeneration = (id: string, requested: number) => {
|
|
103
|
+
const generation = Math.max(requested, (latestGenerationById.get(id) ?? 0) + 1);
|
|
104
|
+
latestGenerationById.set(id, generation);
|
|
105
|
+
return generation;
|
|
106
|
+
};
|
|
107
|
+
|
|
100
108
|
const persist = () => runtime?.save({
|
|
101
109
|
tasks: (store.durableSnapshot?.().tasks ?? records()).map((task: any) => ({
|
|
102
110
|
...task,
|
|
@@ -174,6 +182,7 @@ export function createMonitorSessionBridge(deps: any = {}) {
|
|
|
174
182
|
value = { ...value, generation: prior.generation + 1 };
|
|
175
183
|
ready.delete(value.key);
|
|
176
184
|
}
|
|
185
|
+
value = { ...value, generation: reserveGeneration(value.id, value.generation ?? 1) };
|
|
177
186
|
const pending = Promise.resolve().then(() => pub.publishChildForHub({ ...value, ...currentOwner, parentGeneration: value.parentGeneration ?? 1 }, env)).then((task: any) => {
|
|
178
187
|
keys.set(value.key, { id: task.id, generation: task.generation });
|
|
179
188
|
monitorKeyByTask.set(taskKey(task), value.key);
|
|
@@ -251,7 +260,7 @@ export function createMonitorSessionBridge(deps: any = {}) {
|
|
|
251
260
|
persist(); return this.snapshot();
|
|
252
261
|
},
|
|
253
262
|
snapshot() { persist(); return { tasks: records().map((task: any) => { const key = monitorKeyByTask.get(taskKey(task)); return { id: task.id, generation: task.generation, kind: task.kind, parentId: task.parentId, parentGeneration: task.parentGeneration, specialist: task.specialist, state: task.state, workspaceId: task.workspaceId, hubPaneId: task.hubPaneId, hubInstanceId: task.hubInstanceId, ownerSessionId: task.ownerSessionId, ownerLeaseExpiresAt: task.ownerLeaseExpiresAt, outputSequence: task.outputSequence, firstSequence: task.firstSequence, truncated: task.truncated, canCancel: !!key && cancellable.has(key) && !terminal(task.state) }; }) }; },
|
|
254
|
-
reset() { keys.clear(); ready.clear(); late.clear(); finalized.clear(); cancellable.clear();
|
|
263
|
+
reset() { keys.clear(); ready.clear(); late.clear(); finalized.clear(); cancellable.clear(); persist(); },
|
|
255
264
|
stop() { keys.clear(); ready.clear(); late.clear(); finalized.clear(); cancellable.clear(); monitorKeyByTask.clear(); lateByGeneration.clear(); },
|
|
256
265
|
};
|
|
257
266
|
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildPeerLaunchPlan,
|
|
3
|
+
type PeerLaunchContext,
|
|
4
|
+
type PeerLaunchPlan,
|
|
5
|
+
type PeerRunner,
|
|
6
|
+
} from "../../../scripts/lib/peer-launch.ts";
|
|
7
|
+
import { launchPeerInPane, peerReadyVerdict } from "../lib/spawned-peers.js";
|
|
8
|
+
|
|
9
|
+
export interface HubPeerSpawnRequest {
|
|
10
|
+
name: string;
|
|
11
|
+
runner?: PeerRunner;
|
|
12
|
+
persona?: string;
|
|
13
|
+
no_persona?: boolean;
|
|
14
|
+
model?: string;
|
|
15
|
+
extensions?: string;
|
|
16
|
+
browser?: boolean;
|
|
17
|
+
all_extensions?: boolean;
|
|
18
|
+
direction?: "right" | "down";
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface HubPeerSpawnContext extends PeerLaunchContext {
|
|
22
|
+
/** The current Hub/coms project. The request cannot override it. */
|
|
23
|
+
project: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Constrained Agent Hub adapter for the canonical Fleet peer resolver.
|
|
28
|
+
* Project, placement, env-file source, and raw Pi argv are not LLM-controlled:
|
|
29
|
+
* the project comes from the Hub identity and envFile can only come back from
|
|
30
|
+
* a validated peers.yaml declaration inside buildPeerLaunchPlan().
|
|
31
|
+
*/
|
|
32
|
+
export function buildHubPeerSpawnPlan(
|
|
33
|
+
request: HubPeerSpawnRequest,
|
|
34
|
+
context: HubPeerSpawnContext,
|
|
35
|
+
): PeerLaunchPlan {
|
|
36
|
+
return buildPeerLaunchPlan(
|
|
37
|
+
{
|
|
38
|
+
name: request.name,
|
|
39
|
+
...(request.runner ? { runner: request.runner } : {}),
|
|
40
|
+
...(request.persona ? { persona: request.persona } : {}),
|
|
41
|
+
...(request.no_persona ? { noPersona: true } : {}),
|
|
42
|
+
...(request.model ? { model: request.model } : {}),
|
|
43
|
+
...(request.extensions ? { extensions: request.extensions } : {}),
|
|
44
|
+
...(request.browser ? { browser: true } : {}),
|
|
45
|
+
...(request.all_extensions ? { allExtensions: true } : {}),
|
|
46
|
+
...(request.direction ? { direction: request.direction } : {}),
|
|
47
|
+
project: context.project,
|
|
48
|
+
here: false,
|
|
49
|
+
},
|
|
50
|
+
context,
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface HubPeerPaneClient {
|
|
55
|
+
paneSplit(params: {
|
|
56
|
+
target_pane_id: string;
|
|
57
|
+
direction: "right" | "down";
|
|
58
|
+
cwd: string;
|
|
59
|
+
env?: Record<string, string>;
|
|
60
|
+
focus: boolean;
|
|
61
|
+
}): Promise<{ pane: { pane_id: string } }>;
|
|
62
|
+
paneRename(paneId: string, label: string): Promise<unknown>;
|
|
63
|
+
paneRead(params: { pane_id: string; lines: number }): Promise<{ read: { text?: string } }>;
|
|
64
|
+
paneSendText(paneId: string, text: string): Promise<unknown>;
|
|
65
|
+
paneSendKeys(paneId: string, keys: string[]): Promise<unknown>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface HubPeerPaneLaunchOptions {
|
|
69
|
+
client: HubPeerPaneClient;
|
|
70
|
+
targetPaneId: string;
|
|
71
|
+
cwd: string;
|
|
72
|
+
env?: Record<string, string>;
|
|
73
|
+
waitForRegistration(name: string): Promise<{ found: boolean; waitedMs: number }>;
|
|
74
|
+
paneTail(paneId: string): Promise<string>;
|
|
75
|
+
onLaunched?(paneId: string): void;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Split next to the Hub, type the canonical argv, then return readiness proof. */
|
|
79
|
+
export async function launchHubPeerInPane(
|
|
80
|
+
plan: PeerLaunchPlan,
|
|
81
|
+
options: HubPeerPaneLaunchOptions,
|
|
82
|
+
): Promise<{
|
|
83
|
+
paneId: string;
|
|
84
|
+
promptSeen: boolean;
|
|
85
|
+
promptWaitedMs: number;
|
|
86
|
+
verdict: ReturnType<typeof peerReadyVerdict>;
|
|
87
|
+
}> {
|
|
88
|
+
const env = options.env ?? {};
|
|
89
|
+
const { pane } = await options.client.paneSplit({
|
|
90
|
+
target_pane_id: options.targetPaneId,
|
|
91
|
+
direction: plan.direction,
|
|
92
|
+
cwd: options.cwd,
|
|
93
|
+
...(Object.keys(env).length > 0 ? { env } : {}),
|
|
94
|
+
focus: false,
|
|
95
|
+
});
|
|
96
|
+
try {
|
|
97
|
+
await options.client.paneRename(pane.pane_id, plan.name);
|
|
98
|
+
} catch {
|
|
99
|
+
// A label is cosmetic; the pane id and coms identity remain authoritative.
|
|
100
|
+
}
|
|
101
|
+
const launch = await launchPeerInPane(options.client, pane.pane_id, plan.command);
|
|
102
|
+
options.onLaunched?.(pane.pane_id);
|
|
103
|
+
const readiness = await options.waitForRegistration(plan.name);
|
|
104
|
+
const tail = readiness.found ? undefined : await options.paneTail(pane.pane_id);
|
|
105
|
+
return {
|
|
106
|
+
paneId: pane.pane_id,
|
|
107
|
+
promptSeen: launch.promptSeen,
|
|
108
|
+
promptWaitedMs: launch.waitedMs,
|
|
109
|
+
verdict: peerReadyVerdict({
|
|
110
|
+
name: plan.name,
|
|
111
|
+
paneId: pane.pane_id,
|
|
112
|
+
...readiness,
|
|
113
|
+
...(tail === undefined ? {} : { paneTail: tail }),
|
|
114
|
+
}),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export const POSTURES = ["operator", "orchestrator"] as const;
|
|
2
|
+
export type Posture = (typeof POSTURES)[number];
|
|
3
|
+
|
|
4
|
+
export const ORCHESTRATION_TOOLS = [
|
|
5
|
+
"dispatch_agent",
|
|
6
|
+
"spawn_research",
|
|
7
|
+
"set_task_tier",
|
|
8
|
+
"team_adjust",
|
|
9
|
+
"set_assertions",
|
|
10
|
+
"update_assertion",
|
|
11
|
+
"get_assertions",
|
|
12
|
+
] as const;
|
|
13
|
+
|
|
14
|
+
export const COMS_TOOLS = ["coms_list", "coms_send", "coms_get", "coms_await"] as const;
|
|
15
|
+
|
|
16
|
+
export const HERDR_TOOLS = [
|
|
17
|
+
"herdr_spawn_peer",
|
|
18
|
+
"herdr_spawn_pane",
|
|
19
|
+
"herdr_read_pane",
|
|
20
|
+
"herdr_close_pane",
|
|
21
|
+
"herdr_notify",
|
|
22
|
+
] as const;
|
|
23
|
+
|
|
24
|
+
const CONDITIONAL_TOOLS = new Set<string>([...COMS_TOOLS, ...HERDR_TOOLS, "ask_user"]);
|
|
25
|
+
const HUB_OWNED_TOOLS = new Set<string>([
|
|
26
|
+
...ORCHESTRATION_TOOLS,
|
|
27
|
+
...CONDITIONAL_TOOLS,
|
|
28
|
+
]);
|
|
29
|
+
|
|
30
|
+
export function parsePosture(value: unknown): Posture | null {
|
|
31
|
+
if (typeof value !== "string") return null;
|
|
32
|
+
const normalized = value.trim();
|
|
33
|
+
return POSTURES.includes(normalized as Posture) ? normalized as Posture : null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function resolveStartupPosture(options: {
|
|
37
|
+
explicitPosture?: unknown;
|
|
38
|
+
hasExplicitRoster?: boolean;
|
|
39
|
+
}): Posture {
|
|
40
|
+
if (options.explicitPosture !== undefined) {
|
|
41
|
+
const explicit = parsePosture(options.explicitPosture);
|
|
42
|
+
if (!explicit) throw new Error(`Unknown posture "${String(options.explicitPosture)}"; expected operator|orchestrator.`);
|
|
43
|
+
return explicit;
|
|
44
|
+
}
|
|
45
|
+
return options.hasExplicitRoster ? "orchestrator" : "operator";
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function latestPersistedPosture(entries: readonly unknown[]): Posture | null {
|
|
49
|
+
for (let i = entries.length - 1; i >= 0; i--) {
|
|
50
|
+
const entry = entries[i] as { type?: unknown; customType?: unknown; data?: { posture?: unknown } } | null;
|
|
51
|
+
if (entry?.type !== "custom" || entry.customType !== "agent-hub-posture") continue;
|
|
52
|
+
const persisted = parsePosture(entry.data?.posture);
|
|
53
|
+
if (persisted) return persisted;
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function resolveSessionPosture(options: {
|
|
59
|
+
entries: readonly unknown[];
|
|
60
|
+
explicitPosture?: unknown;
|
|
61
|
+
hasExplicitRoster?: boolean;
|
|
62
|
+
}): Posture {
|
|
63
|
+
if (options.explicitPosture !== undefined) {
|
|
64
|
+
return resolveStartupPosture({ explicitPosture: options.explicitPosture });
|
|
65
|
+
}
|
|
66
|
+
return latestPersistedPosture(options.entries)
|
|
67
|
+
?? resolveStartupPosture({ hasExplicitRoster: options.hasExplicitRoster });
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function posturePrompt(posture: Posture): { intro: string; hardRules: string } {
|
|
71
|
+
if (posture === "operator") {
|
|
72
|
+
return {
|
|
73
|
+
intro: "You are the Fleet operator. You may work on the codebase directly and may also coordinate specialist agents when delegation adds value.",
|
|
74
|
+
hardRules: `- You MAY read, execute, edit, and write directly in operator posture.
|
|
75
|
+
- Use direct tools for focused work when they are the simplest path; delegate when specialization, parallelism, or independent verification adds value.
|
|
76
|
+
- Give concurrent writable agents explicit non-overlapping scopes and inspect overlap warnings before proceeding.`,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
intro: "You are a dispatcher agent — an orchestrator. You coordinate specialist agents to accomplish tasks. You do NOT have direct access to the codebase.",
|
|
81
|
+
hardRules: `- NEVER try to read, write, or execute code directly — you have no such tools.
|
|
82
|
+
- ALWAYS use \`dispatch_agent\` to get implementation work done; use \`spawn_research\` for read-only recon.
|
|
83
|
+
- \`herdr_spawn_pane\` is only for auxiliary processes such as watchers or servers; NEVER use it to bypass delegation by reading, editing, testing, or implementing code in a raw pane.`,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function resolvePostureTools(options: {
|
|
88
|
+
posture: Posture;
|
|
89
|
+
baselineTools: readonly string[];
|
|
90
|
+
comsReady: boolean;
|
|
91
|
+
herdrReady: boolean;
|
|
92
|
+
askUserAvailable: boolean;
|
|
93
|
+
}): string[] {
|
|
94
|
+
const tools = options.posture === "operator"
|
|
95
|
+
? options.baselineTools.filter(name => !HUB_OWNED_TOOLS.has(name))
|
|
96
|
+
: [];
|
|
97
|
+
|
|
98
|
+
tools.push(...ORCHESTRATION_TOOLS);
|
|
99
|
+
if (options.comsReady) tools.push(...COMS_TOOLS);
|
|
100
|
+
if (options.askUserAvailable) tools.push("ask_user");
|
|
101
|
+
if (options.herdrReady) tools.push(...HERDR_TOOLS);
|
|
102
|
+
return [...new Set(tools)];
|
|
103
|
+
}
|
|
@@ -10,10 +10,44 @@ The experimental Codex Remote-Control conductor is **not** an inbound `ask_user`
|
|
|
10
10
|
- If `user-remote` is present, the wrapper races local stock UI against the remote coms request using `race-core.js`; first answer wins and local-first emits one best-effort cancel.
|
|
11
11
|
- If another extension already registered `ask_user`, registration failure is caught and logged as a warning instead of crashing the session.
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Ownership model (exactly one `ask_user`)
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Settings presence is **not** the same as runtime availability. Pi package discovery and deterministic Fleet Core are intentionally different loading paths:
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
| Mode | Pi discovery | Who owns `ask_user` | Hermes racing |
|
|
18
|
+
| --- | --- | --- | --- |
|
|
19
|
+
| Plain `pi` (copied workspace with `npm:pi-ask-user`) | Enabled | Standalone `pi-ask-user` package | No |
|
|
20
|
+
| Default `just fleet` (`--no-extensions` / `-ne`) | Disabled | This harness (`ask-user-remote`) | Yes when `user-remote` is live |
|
|
21
|
+
| `just fleet --all-extensions` | Enabled | Standalone package if listed; harness defers | No (avoid a second registration) |
|
|
22
|
+
| Package-native `@chankov/agent-fleet` only | Enabled | Package-exposed harness using the bundled dependency | Yes when `user-remote` is live |
|
|
23
|
+
|
|
24
|
+
### Discovery-enabled sessions
|
|
25
|
+
|
|
26
|
+
When extension discovery can run and `npm:pi-ask-user` appears in project (`.pi/settings.json`) or global (`~/.pi/agent/settings.json`) `packages`, this harness **defers**: it skips the wrapper so the stock package registers alone. Remote answer racing is disabled for that session. That is the correct behavior for plain Pi and for `just fleet --all-extensions`.
|
|
27
|
+
|
|
28
|
+
### Deterministic Fleet Core (`--no-extensions` / `-ne`)
|
|
29
|
+
|
|
30
|
+
`just fleet` starts Pi with discovery disabled. A settings entry for `pi-ask-user` is then **dormant** — Pi will not load it. The harness still installs the wrapped `ask_user` so Agent Hub probes and active-tool selection see the tool at session start.
|
|
31
|
+
|
|
32
|
+
### Where stock `pi-ask-user` is resolved
|
|
33
|
+
|
|
34
|
+
Copied harnesses must not depend on an npx cache or a workspace-root `node_modules` assumption. Resolution order:
|
|
35
|
+
|
|
36
|
+
1. Bundled dependency beside the Agent Fleet package (package-native installs)
|
|
37
|
+
2. Project Pi package: `.pi/npm/node_modules/pi-ask-user`
|
|
38
|
+
3. Harness runtime deps: `.pi/harnesses/node_modules/pi-ask-user` (from `npm ci --prefix .pi/harnesses`)
|
|
39
|
+
4. Global Pi package: `~/.pi/agent/npm/node_modules/pi-ask-user`
|
|
40
|
+
|
|
41
|
+
If none exist, the harness logs one actionable message naming `npm ci --prefix .pi/harnesses` and/or `pi install -l npm:pi-ask-user`.
|
|
42
|
+
|
|
43
|
+
## Skill / prompt ownership (separate from the tool)
|
|
44
|
+
|
|
45
|
+
Pick **one** path for Agent Fleet skills and lifecycle prompts:
|
|
46
|
+
|
|
47
|
+
- **Copied** — installer writes `.pi/skills` / `.pi/prompts` and records them in `.ai/agent-fleet-state.json`. Keep standalone `npm:pi-ask-user` for plain Pi; do **not** also enable `@chankov/agent-fleet` package skills/prompts.
|
|
48
|
+
- **Package-native** — `pi install npm:@chankov/agent-fleet` exposes skills/prompts (and bundles `pi-ask-user`). Do **not** also install overlapping `skill:*` / `command:*` copies.
|
|
49
|
+
- **Harness-only composition** is safe: package-native skills/prompts **plus** copied Fleet Core harnesses (no copied skills/prompts).
|
|
50
|
+
|
|
51
|
+
`agent-fleet verify` / `doctor` emit a read-only `pi-package-ownership` advisory when both paths overlap. See [docs/pi-setup.md](../../../docs/pi-setup.md).
|
|
18
52
|
|
|
19
53
|
Tests use fakes for the stock TUI and coms peer. The abort test proves signal propagation and the stock-shaped `{cancelled:true}` result through a fake captured tool; it does not drive a live TUI overlay.
|
|
@@ -30,15 +30,22 @@ interface InstallOptions {
|
|
|
30
30
|
warn?: (message: string) => void;
|
|
31
31
|
createAbortController?: () => AbortController;
|
|
32
32
|
settingsPaths?: string[];
|
|
33
|
+
/** When true, settings-listed packages are dormant (Pi `--no-extensions`/`-ne`). */
|
|
34
|
+
extensionDiscoveryDisabled?: boolean;
|
|
33
35
|
remoteProject?: string | (() => string);
|
|
34
36
|
}
|
|
35
37
|
|
|
38
|
+
interface ResolveStockOptions {
|
|
39
|
+
moduleUrl?: string;
|
|
40
|
+
cwd?: string;
|
|
41
|
+
homeDir?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
36
44
|
// A stock `pi-ask-user` package listed in pi settings is loaded by pi core
|
|
37
|
-
// itself
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
// of load order.
|
|
45
|
+
// itself only when extension discovery is enabled. Under `--no-extensions`/
|
|
46
|
+
// `-ne` the entry is dormant, so this harness must still install the wrapper.
|
|
47
|
+
// When discovery is enabled, registering here first would make pi core
|
|
48
|
+
// hard-crash later with a tool-name conflict — the preflight skips instead.
|
|
42
49
|
const STOCK_PACKAGE_PATTERN = /(^|[/:])pi-ask-user(@[^/]*)?$/;
|
|
43
50
|
|
|
44
51
|
export function defaultSettingsPaths(): string[] {
|
|
@@ -48,7 +55,74 @@ export function defaultSettingsPaths(): string[] {
|
|
|
48
55
|
];
|
|
49
56
|
}
|
|
50
57
|
|
|
58
|
+
/** True when argv disables Pi package/extension discovery (explicit `-e` still works). */
|
|
59
|
+
export function hasDisabledExtensionDiscovery(argv: string[] = process.argv): boolean {
|
|
60
|
+
return argv.includes("--no-extensions") || argv.includes("-ne");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
interface StockPackageEntry {
|
|
64
|
+
source: string;
|
|
65
|
+
autoload?: boolean;
|
|
66
|
+
extensions?: unknown;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function parseStockPackageEntry(value: unknown): StockPackageEntry | null {
|
|
70
|
+
if (typeof value === "string") {
|
|
71
|
+
return STOCK_PACKAGE_PATTERN.test(value) ? { source: value } : null;
|
|
72
|
+
}
|
|
73
|
+
if (!value || typeof value !== "object") return null;
|
|
74
|
+
const entry = value as { source?: unknown; autoload?: unknown; extensions?: unknown };
|
|
75
|
+
if (typeof entry.source !== "string" || !STOCK_PACKAGE_PATTERN.test(entry.source)) return null;
|
|
76
|
+
return {
|
|
77
|
+
source: entry.source,
|
|
78
|
+
autoload: entry.autoload === false ? false : undefined,
|
|
79
|
+
extensions: entry.extensions,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function stockExtensionPatternMatches(rawPattern: string): boolean {
|
|
84
|
+
let pattern = rawPattern;
|
|
85
|
+
if (pattern.startsWith("!") || pattern.startsWith("+") || pattern.startsWith("-")) pattern = pattern.slice(1);
|
|
86
|
+
pattern = pattern.replace(/^\.\//, "");
|
|
87
|
+
let expression = "";
|
|
88
|
+
for (let i = 0; i < pattern.length; i++) {
|
|
89
|
+
const char = pattern[i];
|
|
90
|
+
if (char === "*") {
|
|
91
|
+
if (pattern[i + 1] === "*") {
|
|
92
|
+
expression += ".*";
|
|
93
|
+
i++;
|
|
94
|
+
} else {
|
|
95
|
+
expression += "[^/]*";
|
|
96
|
+
}
|
|
97
|
+
} else if (char === "?") {
|
|
98
|
+
expression += "[^/]";
|
|
99
|
+
} else {
|
|
100
|
+
expression += char.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return new RegExp(`^${expression}$`).test("index.ts");
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function applyStockExtensionFilter(filter: unknown, inherited: boolean): boolean {
|
|
107
|
+
if (filter === undefined || !Array.isArray(filter)) return inherited;
|
|
108
|
+
if (filter.length === 0) return false;
|
|
109
|
+
|
|
110
|
+
const patterns = filter.filter((value): value is string => typeof value === "string" && value.length > 0);
|
|
111
|
+
const selectors = patterns.filter((pattern) => !pattern.startsWith("!") && !pattern.startsWith("+") && !pattern.startsWith("-"));
|
|
112
|
+
let enabled = selectors.length > 0
|
|
113
|
+
? selectors.some(stockExtensionPatternMatches)
|
|
114
|
+
: inherited;
|
|
115
|
+
|
|
116
|
+
for (const pattern of patterns) {
|
|
117
|
+
if (!stockExtensionPatternMatches(pattern)) continue;
|
|
118
|
+
if (pattern.startsWith("!") || pattern.startsWith("-")) enabled = false;
|
|
119
|
+
else if (pattern.startsWith("+")) enabled = true;
|
|
120
|
+
}
|
|
121
|
+
return enabled;
|
|
122
|
+
}
|
|
123
|
+
|
|
51
124
|
export function findStockAskUserPackageEntry(settingsPaths: string[]): { entry: string; settingsPath: string } | null {
|
|
125
|
+
const located: Array<{ entry: StockPackageEntry; settingsPath: string }> = [];
|
|
52
126
|
for (const settingsPath of settingsPaths) {
|
|
53
127
|
let packages: unknown;
|
|
54
128
|
try {
|
|
@@ -57,10 +131,22 @@ export function findStockAskUserPackageEntry(settingsPaths: string[]): { entry:
|
|
|
57
131
|
continue;
|
|
58
132
|
}
|
|
59
133
|
if (!Array.isArray(packages)) continue;
|
|
60
|
-
const entry = packages.
|
|
61
|
-
if (entry)
|
|
134
|
+
const entry = packages.map(parseStockPackageEntry).find(Boolean);
|
|
135
|
+
if (entry) located.push({ entry, settingsPath });
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Pi resolves lower-precedence settings first. A normal project entry
|
|
139
|
+
// replaces the global entry; `autoload:false` applies only its resource
|
|
140
|
+
// filter as a delta over the inherited package state.
|
|
141
|
+
let enabled = false;
|
|
142
|
+
let owner: { entry: StockPackageEntry; settingsPath: string } | null = null;
|
|
143
|
+
for (let i = located.length - 1; i >= 0; i--) {
|
|
144
|
+
const current = located[i];
|
|
145
|
+
const inherited = current.entry.autoload === false ? enabled : true;
|
|
146
|
+
enabled = applyStockExtensionFilter(current.entry.extensions, inherited);
|
|
147
|
+
owner = enabled ? current : null;
|
|
62
148
|
}
|
|
63
|
-
return null;
|
|
149
|
+
return owner ? { entry: owner.entry.source, settingsPath: owner.settingsPath } : null;
|
|
64
150
|
}
|
|
65
151
|
|
|
66
152
|
export function captureAskUserTool(stockFactory: (pi: ExtensionLike) => void, pi: ExtensionLike): ToolRegistration {
|
|
@@ -277,10 +363,13 @@ export function wrapAskUserTool(stockTool: ToolRegistration, options: InstallOpt
|
|
|
277
363
|
}
|
|
278
364
|
|
|
279
365
|
export function installAskUserRemote(pi: ExtensionLike, options: InstallOptions = {}): { registered: boolean; tool?: ToolRegistration } {
|
|
280
|
-
|
|
366
|
+
const discoveryDisabled = options.extensionDiscoveryDisabled === true;
|
|
367
|
+
// Settings presence is not runtime availability: under --no-extensions the
|
|
368
|
+
// package entry is dormant and the wrapper must still install itself.
|
|
369
|
+
if (!discoveryDisabled && options.settingsPaths) {
|
|
281
370
|
const listed = findStockAskUserPackageEntry(options.settingsPaths);
|
|
282
371
|
if (listed) {
|
|
283
|
-
warn(pi, options, `ask-user-remote: "${listed.entry}" is listed in ${listed.settingsPath} "packages"; skipping the ask_user wrapper so the stock package registers without a tool conflict (remote answer racing disabled
|
|
372
|
+
warn(pi, options, `ask-user-remote: "${listed.entry}" is listed in ${listed.settingsPath} "packages" and extension discovery is enabled; skipping the ask_user wrapper so the stock package registers without a tool conflict (remote answer racing disabled for this session).`);
|
|
284
373
|
return { registered: false };
|
|
285
374
|
}
|
|
286
375
|
}
|
|
@@ -300,13 +389,71 @@ export function installAskUserRemote(pi: ExtensionLike, options: InstallOptions
|
|
|
300
389
|
}
|
|
301
390
|
}
|
|
302
391
|
|
|
303
|
-
|
|
392
|
+
const STOCK_ENTRY_NAMES = ["index.ts", "index.js", "index.mjs"] as const;
|
|
393
|
+
|
|
394
|
+
function stockEntriesUnder(packageDir: string): string[] {
|
|
395
|
+
return STOCK_ENTRY_NAMES.map((name) => path.join(packageDir, name));
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* Candidate filesystem paths for stock `pi-ask-user`, in priority order:
|
|
400
|
+
* 1. Package-native bundled dependency beside the Agent Fleet package
|
|
401
|
+
* 2. Project Pi package (`.pi/npm`)
|
|
402
|
+
* 3. Harness runtime dependency (`.pi/harnesses/node_modules`)
|
|
403
|
+
* 4. Global Pi package (`~/.pi/agent/npm`)
|
|
404
|
+
*
|
|
405
|
+
* Each root expands to `index.ts`, then `index.js` / `index.mjs` so plain-Node
|
|
406
|
+
* smoke fixtures can supply a JS stub while production still prefers the
|
|
407
|
+
* upstream TypeScript entry that Pi's jiti loader understands.
|
|
408
|
+
*/
|
|
409
|
+
export function stockAskUserCandidatePaths(options: ResolveStockOptions = {}): string[] {
|
|
410
|
+
const moduleUrl = options.moduleUrl ?? import.meta.url;
|
|
411
|
+
const cwd = options.cwd ?? process.cwd();
|
|
412
|
+
const homeDir = options.homeDir ?? os.homedir();
|
|
413
|
+
|
|
304
414
|
// Pi's jiti loader preserves the workspace-facing path of a symlinked
|
|
305
415
|
// harness. Canonicalize this module first so the bundled dependency is
|
|
306
416
|
// resolved beside the actual Agent Fleet package, not at workspace root.
|
|
307
417
|
const realModulePath = fs.realpathSync(fileURLToPath(moduleUrl));
|
|
308
|
-
const
|
|
309
|
-
|
|
418
|
+
const moduleDir = path.dirname(realModulePath);
|
|
419
|
+
// ask-user-remote lives at <package>/.pi/harnesses/ask-user-remote
|
|
420
|
+
const packageRoot = path.resolve(moduleDir, "../../..");
|
|
421
|
+
const harnessRoot = path.resolve(moduleDir, "..");
|
|
422
|
+
|
|
423
|
+
let isPackageNative = false;
|
|
424
|
+
try {
|
|
425
|
+
isPackageNative = JSON.parse(fs.readFileSync(path.join(packageRoot, "package.json"), "utf8"))?.name === "@chankov/agent-fleet";
|
|
426
|
+
} catch {
|
|
427
|
+
// A copied harness has no Agent Fleet package root; do not treat the
|
|
428
|
+
// downstream application's node_modules as a bundled runtime source.
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
const roots = [
|
|
432
|
+
...(isPackageNative ? [path.join(packageRoot, "node_modules", "pi-ask-user")] : []),
|
|
433
|
+
path.join(cwd, ".pi", "npm", "node_modules", "pi-ask-user"),
|
|
434
|
+
path.join(harnessRoot, "node_modules", "pi-ask-user"),
|
|
435
|
+
path.join(cwd, ".pi", "harnesses", "node_modules", "pi-ask-user"),
|
|
436
|
+
path.join(homeDir, ".pi", "agent", "npm", "node_modules", "pi-ask-user"),
|
|
437
|
+
];
|
|
438
|
+
return roots.flatMap((root) => stockEntriesUnder(root));
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export const MISSING_STOCK_ASK_USER_MESSAGE =
|
|
442
|
+
"ask-user-remote: pi-ask-user not found. Run `npm ci --prefix .pi/harnesses` and/or `pi install -l npm:pi-ask-user`.";
|
|
443
|
+
|
|
444
|
+
export function resolveStockAskUserModule(options: ResolveStockOptions | string = {}): string {
|
|
445
|
+
// Back-compat: older callers passed moduleUrl as the first positional arg.
|
|
446
|
+
const normalized: ResolveStockOptions = typeof options === "string" ? { moduleUrl: options } : options;
|
|
447
|
+
const seen = new Set<string>();
|
|
448
|
+
for (const candidate of stockAskUserCandidatePaths(normalized)) {
|
|
449
|
+
const resolved = path.resolve(candidate);
|
|
450
|
+
if (seen.has(resolved)) continue;
|
|
451
|
+
seen.add(resolved);
|
|
452
|
+
if (fs.existsSync(resolved)) {
|
|
453
|
+
return pathToFileURL(fs.realpathSync(resolved)).href;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
throw new Error(MISSING_STOCK_ASK_USER_MESSAGE);
|
|
310
457
|
}
|
|
311
458
|
|
|
312
459
|
async function loadStockFactory(): Promise<(pi: ExtensionLike) => void> {
|
|
@@ -314,8 +461,17 @@ async function loadStockFactory(): Promise<(pi: ExtensionLike) => void> {
|
|
|
314
461
|
return mod.default as (pi: ExtensionLike) => void;
|
|
315
462
|
}
|
|
316
463
|
|
|
317
|
-
export default function askUserRemote(pi: ExtensionLike): void {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
464
|
+
export default async function askUserRemote(pi: ExtensionLike): Promise<void> {
|
|
465
|
+
// Await registration so session_start probes (e.g. agent-hub getAllTools)
|
|
466
|
+
// see ask_user after extension factories finish loading.
|
|
467
|
+
try {
|
|
468
|
+
const stockFactory = await loadStockFactory();
|
|
469
|
+
installAskUserRemote(pi, {
|
|
470
|
+
stockFactory,
|
|
471
|
+
settingsPaths: defaultSettingsPaths(),
|
|
472
|
+
extensionDiscoveryDisabled: hasDisabledExtensionDiscovery(),
|
|
473
|
+
});
|
|
474
|
+
} catch (error) {
|
|
475
|
+
warn(pi, {}, `ask-user-remote: failed to load pi-ask-user (${error instanceof Error ? error.message : String(error)})`);
|
|
476
|
+
}
|
|
321
477
|
}
|