@chankov/agent-fleet 2.0.4 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.pi/agents/model-profiles.yaml +39 -34
- package/.pi/harnesses/agent-hub/README.md +11 -32
- package/.pi/harnesses/agent-hub/context/agent-state.ts +1 -1
- package/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +2 -0
- package/.pi/harnesses/agent-hub/dispatch-native-types.ts +1 -0
- package/.pi/harnesses/agent-hub/dispatch-native.ts +31 -19
- package/.pi/harnesses/agent-hub/dispatch-observability.ts +6 -1
- package/.pi/harnesses/agent-hub/footer.ts +2 -2
- package/.pi/harnesses/agent-hub/index.ts +69 -42
- package/.pi/harnesses/agent-hub/input/shortcuts.ts +0 -29
- package/.pi/harnesses/agent-hub/package.json +1 -1
- package/.pi/harnesses/agent-hub/policy/profile-runtime.ts +59 -3
- package/.pi/harnesses/agent-hub/research/runtime.ts +3 -1
- package/.pi/harnesses/agent-hub/research/spawn-run.ts +4 -0
- package/.pi/harnesses/agent-hub/tools/action-executors.ts +5 -4
- package/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +34 -1
- package/.pi/harnesses/agent-hub/tools/herdr-executors.ts +4 -2
- package/.pi/harnesses/agent-hub/types.ts +1 -0
- package/.pi/harnesses/agent-hub/ui/activity-dots.ts +16 -0
- package/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +4 -2
- package/.pi/harnesses/agent-hub/ui/grid.ts +16 -118
- package/.pi/harnesses/agent-hub/ui/pool.ts +1 -6
- package/.pi/harnesses/agent-hub/ui/running-strip.ts +139 -0
- package/.pi/harnesses/coms/package.json +1 -1
- package/.pi/harnesses/damage-control-continue/package.json +1 -1
- package/.pi/harnesses/lib/fleet-dashboard-ops.ts +0 -5
- package/.pi/harnesses/lib/fleet-dashboard-view.ts +8 -2
- package/.versions/2.0.5/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/2.0.5/.pi/agents/model-profiles.yaml +83 -0
- package/.versions/2.0.5/.pi/agents/peers.yaml +145 -0
- package/.versions/2.0.5/.pi/agents/teams.yaml +41 -0
- package/.versions/2.0.5/.pi/agents/voices.yaml +13 -0
- package/.versions/2.0.5/.pi/damage-control-rules.yaml +297 -0
- package/.versions/2.0.5/.pi/extensions/agent-fleet-update-check/README.md +57 -0
- package/.versions/2.0.5/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
- package/.versions/2.0.5/.pi/extensions/agent-fleet-update-check/package.json +6 -0
- package/.versions/2.0.5/.pi/extensions/btw/README.md +120 -0
- package/.versions/2.0.5/.pi/extensions/btw/index.ts +914 -0
- package/.versions/2.0.5/.pi/extensions/btw/package.json +6 -0
- package/.versions/2.0.5/.pi/extensions/btw/state.js +179 -0
- package/.versions/2.0.5/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
- package/.versions/2.0.5/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
- package/.versions/2.0.5/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/2.0.5/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/2.0.5/.pi/extensions/compact-and-continue/index.ts +120 -0
- package/.versions/2.0.5/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/2.0.5/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/2.0.5/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/2.0.5/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/2.0.5/.pi/extensions/package-lock.json +1175 -0
- package/.versions/2.0.5/.pi/extensions/package.json +9 -0
- package/.versions/2.0.5/.pi/extensions/pi-voice-stt/README.md +205 -0
- package/.versions/2.0.5/.pi/extensions/pi-voice-stt/config.ts +198 -0
- package/.versions/2.0.5/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/2.0.5/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/2.0.5/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/2.0.5/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/2.0.5/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/README.md +1139 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/access-approval.ts +135 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/artifacts.js +146 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/assertion-ledger.js +58 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/backend-policy.js +174 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/budget-continuation.ts +73 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/capability-packs.ts +180 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/context.ts +41 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/models.ts +10 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/config/agents.ts +179 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/config/model-profiles.ts +216 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/config/overrides.ts +153 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +211 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/context/budgets.ts +208 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/context-pressure.ts +191 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/context-window.js +106 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/debate-command.ts +176 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/delegate.ts +446 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-coms.ts +234 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-native-complete.ts +135 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +156 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +193 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-native-types.ts +208 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-native.ts +199 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/docs-lane.js +122 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/drift-watchdog.js +218 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/external-blocker.js +85 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/fixtures/registration-surface.json +55 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/footer.ts +30 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/helpers.ts +266 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/hub-state-audit.js +59 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/index.ts +2115 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/input/completions.ts +76 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/input/shortcuts.ts +18 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +123 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +141 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +95 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/policy/models.ts +153 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/policy/roster.ts +79 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/policy/work-mode.ts +118 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/poll-command.ts +176 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/presentation.ts +48 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/prompts/context.ts +46 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/prompts/fragments.ts +115 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/prompts/system-prompt.ts +110 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/research/controls.ts +74 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/research/runtime.ts +177 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/research/spawn-run.ts +148 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/return-contract.js +293 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/return-extract.js +75 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/review-findings.js +102 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/run-budget.js +537 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/run-namespace.js +87 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/scope-gate.js +103 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/session-start.ts +42 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/spawn.ts +404 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/timeline.ts +54 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/action-executors.ts +149 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/context.ts +132 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +79 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +232 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/fleet-tools.ts +202 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/herdr-executors.ts +86 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/set-task-tier.ts +29 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/spawn-research.ts +62 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/tools/verification-contract.ts +77 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/types.ts +62 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/activity-dots.ts +16 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/context-budget.ts +86 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/detail-panel.ts +178 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +125 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/grid.ts +42 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/history.ts +234 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/pool.ts +98 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/running-strip.ts +139 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/ui/zoom.ts +204 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/version.ts +42 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
- package/.versions/2.0.5/.pi/harnesses/agent-hub/work-mode.ts +167 -0
- package/.versions/2.0.5/.pi/harnesses/ask-user-remote/README.md +53 -0
- package/.versions/2.0.5/.pi/harnesses/ask-user-remote/index.ts +532 -0
- package/.versions/2.0.5/.pi/harnesses/ask-user-remote/race-core.js +106 -0
- package/.versions/2.0.5/.pi/harnesses/coms/README.md +100 -0
- package/.versions/2.0.5/.pi/harnesses/coms/index.ts +276 -0
- package/.versions/2.0.5/.pi/harnesses/coms/package.json +7 -0
- package/.versions/2.0.5/.pi/harnesses/coms/version.ts +42 -0
- package/.versions/2.0.5/.pi/harnesses/damage-control-continue/README.md +124 -0
- package/.versions/2.0.5/.pi/harnesses/damage-control-continue/index.ts +536 -0
- package/.versions/2.0.5/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/2.0.5/.pi/harnesses/damage-control-continue/version.ts +42 -0
- package/.versions/2.0.5/.pi/harnesses/lib/coms-core-io.ts +385 -0
- package/.versions/2.0.5/.pi/harnesses/lib/coms-core.ts +577 -0
- package/.versions/2.0.5/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
- package/.versions/2.0.5/.pi/harnesses/lib/context-budget-child-prompt.ts +179 -0
- package/.versions/2.0.5/.pi/harnesses/lib/context-budget-hub-prompt.ts +114 -0
- package/.versions/2.0.5/.pi/harnesses/lib/context-budget-view.ts +107 -0
- package/.versions/2.0.5/.pi/harnesses/lib/context-budget.ts +114 -0
- package/.versions/2.0.5/.pi/harnesses/lib/damage-control-shared.ts +197 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fleet-dashboard-ops.ts +161 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fleet-dashboard-view.ts +148 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fleet-detail-view.ts +247 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fleet-overlay.ts +26 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fleet-panel.ts +34 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fleet-read-model.ts +131 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fleet-selection.ts +24 -0
- package/.versions/2.0.5/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
- package/.versions/2.0.5/.pi/harnesses/lib/herdr-client.ts +472 -0
- package/.versions/2.0.5/.pi/harnesses/lib/herdr-presence.ts +399 -0
- package/.versions/2.0.5/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.versions/2.0.5/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/2.0.5/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
- package/.versions/2.0.5/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/2.0.5/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
- package/.versions/2.0.5/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
- package/.versions/2.0.5/.pi/harnesses/lib/spawned-peers.js +190 -0
- package/.versions/2.0.5/.pi/harnesses/package-lock.json +2039 -0
- package/.versions/2.0.5/.pi/harnesses/package.json +10 -0
- package/.versions/2.0.5/.pi/prompts/af-build.md +24 -0
- package/.versions/2.0.5/.pi/prompts/af-code-simplify.md +22 -0
- package/.versions/2.0.5/.pi/prompts/af-plan.md +17 -0
- package/.versions/2.0.5/.pi/prompts/af-review.md +16 -0
- package/.versions/2.0.5/.pi/prompts/af-set-hermes-telegram.md +15 -0
- package/.versions/2.0.5/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/2.0.5/.pi/prompts/af-ship.md +17 -0
- package/.versions/2.0.5/.pi/prompts/af-spec.md +15 -0
- package/.versions/2.0.5/.pi/prompts/af-test.md +19 -0
- package/.versions/2.0.5/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/2.0.5/.version +1 -0
- package/.versions/2.0.5/agents/architect.md +25 -0
- package/.versions/2.0.5/agents/bowser.md +28 -0
- package/.versions/2.0.5/agents/builder.md +56 -0
- package/.versions/2.0.5/agents/code-reviewer.md +210 -0
- package/.versions/2.0.5/agents/deep-researcher.md +33 -0
- package/.versions/2.0.5/agents/documenter.md +23 -0
- package/.versions/2.0.5/agents/orchestrator.md +23 -0
- package/.versions/2.0.5/agents/plan-reviewer.md +84 -0
- package/.versions/2.0.5/agents/planner.md +106 -0
- package/.versions/2.0.5/agents/releaser.md +25 -0
- package/.versions/2.0.5/agents/researcher.md +31 -0
- package/.versions/2.0.5/agents/security-auditor.md +168 -0
- package/.versions/2.0.5/agents/test-engineer.md +154 -0
- package/.versions/2.0.5/agents/web-debugger.md +44 -0
- package/.versions/2.0.5/agents/web-performance-auditor.md +194 -0
- package/.versions/2.0.5/bin/catalog/harness-runtime-closure.json +36 -0
- package/.versions/2.0.5/codex/CONDUCTOR.md +148 -0
- package/.versions/2.0.5/docs/ARCHITECTURE.md +407 -0
- package/.versions/2.0.5/docs/agent-fleet-setup.md +561 -0
- package/.versions/2.0.5/docs/claude-code-coms-bridge.md +133 -0
- package/.versions/2.0.5/docs/codex-remote-conductor.md +170 -0
- package/.versions/2.0.5/docs/coms-hermes-bridge.md +189 -0
- package/.versions/2.0.5/docs/getting-started.md +124 -0
- package/.versions/2.0.5/docs/npm-install.md +299 -0
- package/.versions/2.0.5/docs/pi-extensions.md +446 -0
- package/.versions/2.0.5/docs/pi-setup.md +74 -0
- package/.versions/2.0.5/docs/skill-anatomy.md +150 -0
- package/.versions/2.0.5/hermes/README.md +347 -0
- package/.versions/2.0.5/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/.versions/2.0.5/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/.versions/2.0.5/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/2.0.5/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/2.0.5/hermes/gates/gate-o-capability.md +8 -0
- package/.versions/2.0.5/hermes/gates/gate-o-validator-fixtures.json +1 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +770 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/2.0.5/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/2.0.5/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/2.0.5/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/.versions/2.0.5/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/.versions/2.0.5/hermes/watchdog-tests/__init__.py +0 -0
- package/.versions/2.0.5/hooks/coms-stop-hook.mjs +84 -0
- package/.versions/2.0.5/install-manifest.json +2942 -0
- package/.versions/2.0.5/justfile +289 -0
- package/.versions/2.0.5/manifest-meta.json +969 -0
- package/.versions/2.0.5/references/accessibility-checklist.md +160 -0
- package/.versions/2.0.5/references/communication-contract.md +26 -0
- package/.versions/2.0.5/references/definition-of-done.md +67 -0
- package/.versions/2.0.5/references/fleet-coordination-patterns.md +171 -0
- package/.versions/2.0.5/references/observability-checklist.md +91 -0
- package/.versions/2.0.5/references/orchestration-patterns.md +370 -0
- package/.versions/2.0.5/references/performance-checklist.md +153 -0
- package/.versions/2.0.5/references/prompting-patterns.md +380 -0
- package/.versions/2.0.5/references/security-checklist.md +179 -0
- package/.versions/2.0.5/references/testing-patterns.md +236 -0
- package/.versions/2.0.5/references/workflow-authoring.md +304 -0
- package/.versions/2.0.5/scripts/claude-code-preflight.ts +70 -0
- package/.versions/2.0.5/scripts/codex-conductor.ts +41 -0
- package/.versions/2.0.5/scripts/codex-remote-control.ts +167 -0
- package/.versions/2.0.5/scripts/coms-claude-bridge.ts +411 -0
- package/.versions/2.0.5/scripts/coms-cli.ts +484 -0
- package/.versions/2.0.5/scripts/coms-hermes-bridge.ts +413 -0
- package/.versions/2.0.5/scripts/fleet.ts +222 -0
- package/.versions/2.0.5/scripts/flow.ts +137 -0
- package/.versions/2.0.5/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/2.0.5/scripts/hermes-monitor-scenario.ts +474 -0
- package/.versions/2.0.5/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/.versions/2.0.5/scripts/install-hermes-plugin.sh +180 -0
- package/.versions/2.0.5/scripts/lib/claude-bridge-core.ts +210 -0
- package/.versions/2.0.5/scripts/lib/codex-conductor.ts +88 -0
- package/.versions/2.0.5/scripts/lib/codex-remote-control.ts +482 -0
- package/.versions/2.0.5/scripts/lib/coms-envelope.ts +582 -0
- package/.versions/2.0.5/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/2.0.5/scripts/lib/fleet-command.ts +270 -0
- package/.versions/2.0.5/scripts/lib/flow-command.ts +93 -0
- package/.versions/2.0.5/scripts/lib/flow-maintenance.ts +230 -0
- package/.versions/2.0.5/scripts/lib/herdr-layout.ts +281 -0
- package/.versions/2.0.5/scripts/lib/hermes-bridge-core.ts +241 -0
- package/.versions/2.0.5/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.versions/2.0.5/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/.versions/2.0.5/scripts/lib/hermes-monitor-model.ts +3 -0
- package/.versions/2.0.5/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.versions/2.0.5/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.versions/2.0.5/scripts/lib/hermes-monitor-store.ts +2 -0
- package/.versions/2.0.5/scripts/lib/monitor-env.ts +146 -0
- package/.versions/2.0.5/scripts/lib/peer-launch.ts +318 -0
- package/.versions/2.0.5/scripts/lib/persona-banner.ts +62 -0
- package/.versions/2.0.5/scripts/lib/runtime-dependencies.js +124 -0
- package/.versions/2.0.5/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/2.0.5/scripts/lib/team-project.ts +213 -0
- package/.versions/2.0.5/scripts/lib/team-snapshot.ts +147 -0
- package/.versions/2.0.5/scripts/package-lock.json +35 -0
- package/.versions/2.0.5/scripts/package.json +9 -0
- package/.versions/2.0.5/scripts/peer-banner.ts +40 -0
- package/.versions/2.0.5/scripts/peer-launch.ts +285 -0
- package/.versions/2.0.5/scripts/team-snapshot.ts +237 -0
- package/.versions/2.0.5/scripts/team-up.ts +406 -0
- package/.versions/2.0.5/scripts/workflows/lib/agent-phase.ts +133 -0
- package/.versions/2.0.5/scripts/workflows/lib/changes.ts +61 -0
- package/.versions/2.0.5/scripts/workflows/lib/debate.ts +149 -0
- package/.versions/2.0.5/scripts/workflows/lib/env.ts +34 -0
- package/.versions/2.0.5/scripts/workflows/lib/envelopes.ts +169 -0
- package/.versions/2.0.5/scripts/workflows/lib/gates.ts +81 -0
- package/.versions/2.0.5/scripts/workflows/lib/git.ts +96 -0
- package/.versions/2.0.5/scripts/workflows/lib/merge.ts +95 -0
- package/.versions/2.0.5/scripts/workflows/lib/model-profile.ts +22 -0
- package/.versions/2.0.5/scripts/workflows/lib/model-visibility.ts +92 -0
- package/.versions/2.0.5/scripts/workflows/lib/permissions.ts +130 -0
- package/.versions/2.0.5/scripts/workflows/lib/personas.ts +57 -0
- package/.versions/2.0.5/scripts/workflows/lib/poll.ts +86 -0
- package/.versions/2.0.5/scripts/workflows/lib/quality.ts +64 -0
- package/.versions/2.0.5/scripts/workflows/lib/run.ts +108 -0
- package/.versions/2.0.5/scripts/workflows/lib/trace.ts +34 -0
- package/.versions/2.0.5/scripts/workflows/lib/voices.ts +128 -0
- package/.versions/2.0.5/scripts/workflows/lib/writer-lease.ts +112 -0
- package/.versions/2.0.5/scripts/workflows/tsconfig.json +22 -0
- package/.versions/2.0.5/scripts/workflows/wf-build-test.ts +61 -0
- package/.versions/2.0.5/scripts/workflows/wf-debate.ts +87 -0
- package/.versions/2.0.5/scripts/workflows/wf-document.ts +50 -0
- package/.versions/2.0.5/scripts/workflows/wf-poll.ts +95 -0
- package/.versions/2.0.5/scripts/workflows/wf-quality.ts +20 -0
- package/.versions/2.0.5/scripts/workflows/wf-scout.ts +38 -0
- package/.versions/2.0.5/skills/_internal/grilling.md +59 -0
- package/.versions/2.0.5/skills/browser-testing-with-devtools/SKILL.md +351 -0
- package/.versions/2.0.5/skills/code-review-and-quality/SKILL.md +381 -0
- package/.versions/2.0.5/skills/compound-learning/SKILL.md +137 -0
- package/.versions/2.0.5/skills/context-engineering/SKILL.md +291 -0
- package/.versions/2.0.5/skills/deprecation-and-migration/SKILL.md +206 -0
- package/.versions/2.0.5/skills/designing-agents/SKILL.md +394 -0
- package/.versions/2.0.5/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/2.0.5/skills/drafting-workflows/SKILL.md +143 -0
- package/.versions/2.0.5/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
- package/.versions/2.0.5/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.5/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/2.0.5/skills/idea-refine/SKILL.md +182 -0
- package/.versions/2.0.5/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.5/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.5/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.5/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.5/skills/incremental-implementation/SKILL.md +298 -0
- package/.versions/2.0.5/skills/interview-me/SKILL.md +226 -0
- package/.versions/2.0.5/skills/orchestration-verification/SKILL.md +181 -0
- package/.versions/2.0.5/skills/peer-coms/SKILL.md +90 -0
- package/.versions/2.0.5/skills/performance-optimization/SKILL.md +350 -0
- package/.versions/2.0.5/skills/planning-and-task-breakdown/SKILL.md +265 -0
- package/.versions/2.0.5/skills/security-and-hardening/SKILL.md +461 -0
- package/.versions/2.0.5/skills/spec-driven-development/SKILL.md +256 -0
- package/.versions/2.0.5/skills/using-agent-skills/SKILL.md +197 -0
- package/.versions/2.0.5/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/README.md +11 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
- package/.versions/2.0.5/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
- package/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/agents/builder.md +2 -2
- package/agents/documenter.md +2 -1
- package/agents/planner.md +2 -1
- package/agents/releaser.md +2 -2
- package/docs/agent-fleet-setup.md +28 -14
- package/docs/pi-extensions.md +3 -4
- package/install-manifest.json +1 -1
- package/package.json +2 -2
|
@@ -57,8 +57,64 @@ export function profilePanel(name: string, active = readActiveProfile()) {
|
|
|
57
57
|
];
|
|
58
58
|
return voices.map(v => ({ thinking: active.profile.defaults.thinking ?? 'off', ...v }));
|
|
59
59
|
}
|
|
60
|
-
export
|
|
61
|
-
|
|
60
|
+
export type ProfilePeerRefusal = {
|
|
61
|
+
isError: true;
|
|
62
|
+
content: [{ type: 'text'; text: string }];
|
|
63
|
+
details: { error: 'model-profile-native' | 'model-profile-allowlist' };
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
function refusal(text: string, error: ProfilePeerRefusal['details']['error']): ProfilePeerRefusal {
|
|
67
|
+
return { isError: true, content: [{ type: 'text', text }], details: { error } };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const BLANKET_NATIVE = 'Active model profile requires native agents; peer execution is disabled. Use dispatch_agent or leave this profile.';
|
|
71
|
+
|
|
72
|
+
/** True when native routing has no allowlist: standing peers are banned outright. */
|
|
73
|
+
export function profileForcesNativePeers(active = readActiveProfile()): boolean {
|
|
74
|
+
return !!active && active.profile.routing === 'native' && !active.profile['allowed-models']?.length;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Exact allowlist hit, or a unique provider-less suffix match. Ambiguous suffixes fail. */
|
|
78
|
+
export function modelAllowedByProfile(model: string, allowed: readonly string[]): boolean {
|
|
79
|
+
const value = model.trim();
|
|
80
|
+
if (!value || value === 'unknown')
|
|
81
|
+
return false;
|
|
82
|
+
if (allowed.includes(value))
|
|
83
|
+
return true;
|
|
84
|
+
if (value.includes('/'))
|
|
85
|
+
return false;
|
|
86
|
+
return allowed.filter(entry => entry.split('/').pop() === value).length === 1;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function profilePeerGate(opts?: { peerModel?: string; targetResolved?: boolean }, active = readActiveProfile()): ProfilePeerRefusal | null {
|
|
90
|
+
if (!active || active.profile.routing !== 'native')
|
|
91
|
+
return null;
|
|
92
|
+
const allowed = active.profile['allowed-models'];
|
|
93
|
+
if (!allowed?.length)
|
|
94
|
+
return refusal(BLANKET_NATIVE, 'model-profile-native');
|
|
95
|
+
if (opts?.targetResolved === false)
|
|
62
96
|
return null;
|
|
63
|
-
|
|
97
|
+
const model = opts?.peerModel?.trim();
|
|
98
|
+
if (!model || model === 'unknown')
|
|
99
|
+
return refusal(`Active model profile "${active.name}" refuses unverified peers; advertised model is missing or unknown. Use a peer on allowed-models: ${allowed.join(', ')}, dispatch_agent native, or leave this profile.`, 'model-profile-allowlist');
|
|
100
|
+
if (modelAllowedByProfile(model, allowed))
|
|
101
|
+
return null;
|
|
102
|
+
return refusal(`Active model profile "${active.name}" refuses peer model "${model}"; allowed-models: ${allowed.join(', ')}. Use a peer on an allowed model, dispatch_agent native, or leave this profile.`, 'model-profile-allowlist');
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function profileSpawnPeerRefusal(plan: { runner: string; model?: string; persona?: string; name: string }, active = readActiveProfile()): ProfilePeerRefusal | null {
|
|
106
|
+
const early = profilePeerGate({ targetResolved: false }, active);
|
|
107
|
+
if (early)
|
|
108
|
+
return early;
|
|
109
|
+
if (!active || active.profile.routing !== 'native' || !active.profile['allowed-models']?.length)
|
|
110
|
+
return null;
|
|
111
|
+
if (plan.runner === 'claude-code')
|
|
112
|
+
return refusal(`Active model profile "${active.name}" refuses claude-code peers; allowed-models: ${active.profile['allowed-models'].join(', ')}. Spawn a pi peer on an allowed model or leave this profile.`, 'model-profile-allowlist');
|
|
113
|
+
const planned = plan.model ?? profileAgent(plan.persona ?? plan.name, active)?.model;
|
|
114
|
+
return profilePeerGate({ peerModel: planned, targetResolved: true }, active);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** @deprecated Prefer profilePeerGate with the resolved peer model. */
|
|
118
|
+
export function profilePeerRefusal() {
|
|
119
|
+
return profilePeerGate();
|
|
64
120
|
}
|
|
@@ -40,6 +40,7 @@ export interface ResearchState<TDef extends ResearchAgentDef = ResearchAgentDef>
|
|
|
40
40
|
status: "idle" | "running" | "done" | "error";
|
|
41
41
|
task: string;
|
|
42
42
|
toolCount: number;
|
|
43
|
+
messageCount: number;
|
|
43
44
|
elapsed: number;
|
|
44
45
|
lastWork: string;
|
|
45
46
|
contextPct: number;
|
|
@@ -99,6 +100,7 @@ export interface ResearchRuntimeDeps<TDef extends ResearchAgentDef> extends Rese
|
|
|
99
100
|
appendTimelineText(state: ResearchState<TDef>, kind: "text" | "thinking", content: string): void;
|
|
100
101
|
appendTimelineEvent(state: ResearchState<TDef>, event: TimelineEntry): void;
|
|
101
102
|
createTranscriptStore(path: string): FleetTranscriptStore;
|
|
103
|
+
onElapsed?(): void;
|
|
102
104
|
}
|
|
103
105
|
|
|
104
106
|
export interface ResearchRuntime<TDef extends ResearchAgentDef = ResearchAgentDef> {
|
|
@@ -161,7 +163,7 @@ export function createResearchRuntime<TDef extends ResearchAgentDef>(deps: Resea
|
|
|
161
163
|
const id = deps.getNextResearchId();
|
|
162
164
|
deps.setNextResearchId(id + 1);
|
|
163
165
|
const state: ResearchState<TDef> = {
|
|
164
|
-
id, def, persona, model, status: "running", task: "", toolCount: 0,
|
|
166
|
+
id, def, persona, model, status: "running", task: "", toolCount: 0, messageCount: 0,
|
|
165
167
|
elapsed: 0, lastWork: "", contextPct: 0, contextTokens: 0, timeline: [],
|
|
166
168
|
};
|
|
167
169
|
deps.getResearchStates().set(id, state);
|
|
@@ -5,6 +5,7 @@ import { isReadOnlyToolList, safePathWithin } from "../helpers.ts";
|
|
|
5
5
|
import { researchTerminationOutcome, researchWatchdogSpawnOptions } from "../research-watchdog.ts";
|
|
6
6
|
import type { InputArtifactPreview } from "../context/assertions-artifacts.ts";
|
|
7
7
|
import type { ResearchAgentDef, ResearchFinalizeOutcome, ResearchResult, ResearchRuntimeDeps, ResearchState } from "./runtime.ts";
|
|
8
|
+
import { bumpMessageCount } from "../ui/activity-dots.ts";
|
|
8
9
|
|
|
9
10
|
export interface ResearchSpawnPorts<TDef extends ResearchAgentDef> extends ResearchRuntimeDeps<TDef> {
|
|
10
11
|
researchTools: string;
|
|
@@ -48,6 +49,7 @@ export async function runResearchSpawn<TDef extends ResearchAgentDef>(
|
|
|
48
49
|
state.status = "running";
|
|
49
50
|
state.task = prompt;
|
|
50
51
|
state.toolCount = 0;
|
|
52
|
+
state.messageCount = 0;
|
|
51
53
|
state.elapsed = 0;
|
|
52
54
|
state.lastWork = "";
|
|
53
55
|
state.killedByOperator = false;
|
|
@@ -57,6 +59,7 @@ export async function runResearchSpawn<TDef extends ResearchAgentDef>(
|
|
|
57
59
|
|
|
58
60
|
state.timer = setInterval(() => {
|
|
59
61
|
state.elapsed = Date.now() - startTime;
|
|
62
|
+
deps.onElapsed?.();
|
|
60
63
|
}, 1000);
|
|
61
64
|
const thinkingLevel = deps.resolveThinkingLevel(deps.resolvedThinking(state.def));
|
|
62
65
|
const wantThinking = thinkingLevel !== "off";
|
|
@@ -87,6 +90,7 @@ export async function runResearchSpawn<TDef extends ResearchAgentDef>(
|
|
|
87
90
|
onTextDelta: delta => {
|
|
88
91
|
fullText += delta;
|
|
89
92
|
state.lastWork = fullText.split("\n").filter(line => line.trim()).pop() || "";
|
|
93
|
+
bumpMessageCount(state, "text");
|
|
90
94
|
deps.appendTimelineText(state, "text", delta);
|
|
91
95
|
state.zoomRender?.();
|
|
92
96
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { profilePeerGate } from '../policy/profile-runtime.ts';
|
|
2
2
|
import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
|
|
3
3
|
import { DEFAULT_TASK_TIER, applyTierChange } from "../run-budget.js";
|
|
4
4
|
import { validateAssertionBatch } from "../assertion-ledger.js";
|
|
@@ -35,7 +35,7 @@ export interface ActionExecutorDeps {
|
|
|
35
35
|
rosterDrop(agent: string): { ok: boolean; message: string };
|
|
36
36
|
getIdentity(): unknown | null;
|
|
37
37
|
getComs(): any;
|
|
38
|
-
resolveTarget(target: string): { name: string } | null;
|
|
38
|
+
resolveTarget(target: string): { name: string; model?: string } | null;
|
|
39
39
|
appendMachineHandoffSections(brief: string): string;
|
|
40
40
|
markPeerAddressed(name: string): void;
|
|
41
41
|
}
|
|
@@ -125,9 +125,10 @@ export function createActionExecutors(d: ActionExecutorDeps): ActionExecutors {
|
|
|
125
125
|
return { content: [{ type: "text", text: `${result.agents.length} peer(s) in pool (project ${result.project}):\n${lines}${notice}` }], details: result };
|
|
126
126
|
};
|
|
127
127
|
const executeComsSend: ToolExecutor<ComsSendParams> = async (_id, params) => {
|
|
128
|
-
const
|
|
128
|
+
const target = d.resolveTarget(params.target);
|
|
129
|
+
const profileRefusal = profilePeerGate({ peerModel: target?.model, targetResolved: !!target }); if (profileRefusal) return profileRefusal;
|
|
129
130
|
const refusal = d.provisionalCapabilityRefusal("peer"); if (refusal) return refusal;
|
|
130
|
-
const
|
|
131
|
+
const pending = d.hubState.getPendingHandoff();
|
|
131
132
|
const authorized = !!(target && pending && pending.target === target.name && params.handoff_token === pending.token);
|
|
132
133
|
const prompt = authorized ? d.appendMachineHandoffSections(String(params.prompt || "")) : String(params.prompt || "");
|
|
133
134
|
const sent = await d.getComs().send({ target: params.target, prompt, conversation_id: params.conversation_id ?? null, response_schema: (params.response_schema as object | undefined) ?? null, reply_timeout_ms: params.reply_timeout_ms ?? null });
|
|
@@ -70,9 +70,42 @@ function refusal(d: DispatchExecutorDeps, agent: string, task: string, status: s
|
|
|
70
70
|
return { content: [{ type: "text", text: message }], details: { agent, task, status, reason: reason ?? status, elapsed: 0, exitCode: 1, fullOutput: "" } };
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
const RESEARCH_DISPATCH_NAMES = new Set(["researcher", "deep-researcher"]);
|
|
74
|
+
|
|
75
|
+
function rosterNames(d: DispatchExecutorDeps): string[] {
|
|
76
|
+
return Array.from(d.state.getAgentStates().values()).map(s => s.def.name);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function isResearchDispatchName(d: DispatchExecutorDeps, agent: string): boolean {
|
|
80
|
+
if (RESEARCH_DISPATCH_NAMES.has(agent)) return true;
|
|
81
|
+
return d.state.getResearchPersonas().some(p => normalizeAgentInput(p.name) === agent);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function unknownAgentMessage(agent: string, available: string[], researchHint: boolean): string {
|
|
85
|
+
const roster = available.length ? available.join(", ") : "(none)";
|
|
86
|
+
const research = researchHint
|
|
87
|
+
? `\n\n"${agent}" is a research persona. Call spawn_research with persona "${agent}" instead of dispatch_agent. Do not invent a substitute dispatch.`
|
|
88
|
+
: "";
|
|
89
|
+
return `Unknown agent "${agent}". dispatch_agent only accepts the active roster. Available agents: ${roster}.${research}\n\nDo not invent a substitute dispatch. Use an available agent, or spawn_research for a research persona.`;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function validateDispatchAgent(d: DispatchExecutorDeps, agent: string, task: string): ToolExecutionResult | null {
|
|
93
|
+
const available = rosterNames(d);
|
|
94
|
+
const onRoster = d.state.getAgentStates().has(agent) || available.some(name => normalizeAgentInput(name) === agent);
|
|
95
|
+
if (isResearchDispatchName(d, agent)) {
|
|
96
|
+
return refusal(d, agent, task, "research_persona_via_dispatch", unknownAgentMessage(agent, available, true), "research_persona_via_dispatch");
|
|
97
|
+
}
|
|
98
|
+
if (!onRoster) {
|
|
99
|
+
return refusal(d, agent, task, "unknown_agent", unknownAgentMessage(agent, available, false), "unknown_agent");
|
|
100
|
+
}
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function prepareDispatch(d: DispatchExecutorDeps, params: DispatchAgentParams, ctx: ExtensionContext): PreparedDispatch | ToolExecutionResult {
|
|
74
105
|
const s = d.state; const { task, artifacts, scope, review_reason } = params; const agent = normalizeAgentInput(params.agent);
|
|
75
106
|
d.budget.ensureTaskTier();
|
|
107
|
+
const rosterRefusal = validateDispatchAgent(d, agent, task);
|
|
108
|
+
if (rosterRefusal) return rosterRefusal;
|
|
76
109
|
const preflight = preflightGate(d, agent) ?? checkReviewRoundCap(s.getTaskTier(), agent, s.getTaskReviewRounds()) ?? checkDocsLane(agent, scope || [], review_reason);
|
|
77
110
|
if (preflight) return refusal(d, agent, task, preflight.reason, preflight.message, preflight.reason);
|
|
78
111
|
const taskRefusal = checkTaskBudget("dispatch", d.budget.taskCounters(), d.budget.currentTaskBudget(), d.budget.taskActiveElapsedMs(), s.getTaskTier());
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PROFILE_ENV, profilePeerGate, profileSpawnPeerRefusal, readActiveProfile } from '../policy/profile-runtime.ts';
|
|
2
2
|
import { PANE_PROMPT_TIMEOUT_MS, launchPeerInPane } from "../../lib/spawned-peers.js";
|
|
3
3
|
import { herdrPaneId } from "../../lib/herdr-presence.ts";
|
|
4
4
|
import { buildHubPeerSpawnPlan, launchHubPeerInPane } from "../peer-spawn-plan.ts";
|
|
@@ -28,7 +28,7 @@ const noPane = (): ToolExecutionResult => ({ content: [{ type: "text", text: "no
|
|
|
28
28
|
|
|
29
29
|
export function createHerdrExecutors(d: HerdrExecutorDeps): Pick<import("./context.ts").ToolContext, "executeHerdrSpawnPeer" | "executeHerdrSpawnPane" | "executeHerdrReadPane" | "executeHerdrClosePane" | "executeHerdrNotify"> {
|
|
30
30
|
const executeHerdrSpawnPeer: ToolExecutor<HerdrSpawnPeerParams> = async (_id, params) => {
|
|
31
|
-
const
|
|
31
|
+
const earlyProfile = profilePeerGate({ targetResolved: false }); if (earlyProfile) return earlyProfile;
|
|
32
32
|
const refusal = d.provisionalCapabilityRefusal("workspace"); if (refusal) return refusal;
|
|
33
33
|
if (!d.isFleetReady()) return unavailable();
|
|
34
34
|
const ownPane = herdrPaneId(); if (!ownPane) return noPane();
|
|
@@ -37,9 +37,11 @@ export function createHerdrExecutors(d: HerdrExecutorDeps): Pick<import("./conte
|
|
|
37
37
|
try {
|
|
38
38
|
const cwd = d.getCurrentContext()?.cwd ?? process.cwd();
|
|
39
39
|
const plan = buildHubPeerSpawnPlan(params, { project: identity.project, peersYaml: peerManifest(cwd), personaExists: persona => peerPersonaExists(cwd, persona), worktreeTag: worktreeTag(cwd) });
|
|
40
|
+
const profileRefusal = profileSpawnPeerRefusal(plan); if (profileRefusal) return profileRefusal;
|
|
40
41
|
if (d.peersInScope().some(peer => peer.name.toLowerCase() === plan.name.toLowerCase())) throw new Error(`Peer "${plan.name}" is already visible in project "${identity.project}"; use coms_send instead of spawning a duplicate.`);
|
|
41
42
|
const env: Record<string, string> = {};
|
|
42
43
|
if (plan.envFile) { const envPath = resolveEnvFilePath(plan.envFile, cwd); if (!d.envFileExists(envPath)) throw new Error(`env_file not found: ${plan.envFile} (resolved: ${envPath})`); Object.assign(env, parseEnvFile(d.readEnvFile(envPath), plan.envFile)); }
|
|
44
|
+
const active = readActiveProfile(); if (active) env[PROFILE_ENV] = JSON.stringify(active);
|
|
43
45
|
const delay = plan.runner === "pi" ? spawnDelaySeconds(d.getLastPiSpawnAt()) : 0; if (delay > 0) env[STAGGER_ENV_VAR] = String(delay);
|
|
44
46
|
const launched = await launchHubPeerInPane(plan, {
|
|
45
47
|
client: d.herdr, targetPaneId: ownPane, cwd, env,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Cycle 1–5 ASCII periods from a 1-based event count. Zero events → empty. */
|
|
2
|
+
export function activityDots(eventCount: number): string {
|
|
3
|
+
if (eventCount <= 0) return "";
|
|
4
|
+
return ".".repeat(((eventCount - 1) % 5) + 1);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function eventCount(toolCount: number, messageCount: number): number {
|
|
8
|
+
return Math.max(0, toolCount) + Math.max(0, messageCount);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Call before appending a text timeline delta so each assistant message counts once. */
|
|
12
|
+
export function bumpMessageCount(target: { timeline: Array<{ kind: string }>; messageCount: number }, kind: "text" | "thinking"): void {
|
|
13
|
+
if (kind !== "text") return;
|
|
14
|
+
const last = target.timeline[target.timeline.length - 1];
|
|
15
|
+
if (!last || last.kind !== "text") target.messageCount++;
|
|
16
|
+
}
|
|
@@ -50,11 +50,13 @@ export interface FleetDashboardDeps<TDef extends DetailAgentDef, TAgent extends
|
|
|
50
50
|
modelPolicy: ModelPolicy<TDef>;
|
|
51
51
|
loadAvailableModels(ctx: DetailUiContext, current?: string): Promise<FleetModelChoice[] | null>;
|
|
52
52
|
openDetail(row: FleetRow, ctx: DetailUiContext, verbose?: boolean): Promise<boolean>;
|
|
53
|
+
openHistory(ctx: DetailUiContext): Promise<void>;
|
|
53
54
|
modelWorkBlocked(ctx: DetailUiContext): boolean;
|
|
54
55
|
restartSpecialist(state: TAgent, ctx: DetailUiContext): Promise<void>;
|
|
55
56
|
removeResearch(state: TResearch, ctx: DetailUiContext): void;
|
|
56
57
|
killSpecialistProcess(state: TAgent): void;
|
|
57
58
|
abortComs(state: TAgent): void;
|
|
59
|
+
getComsLines(width: number, theme: { fg(color: string, text: string): string }): string[];
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
type SubstitutionPicker = { stage: "source" | "target"; source?: string; choices: FleetModelChoice[]; index: number; scrollOffset: number };
|
|
@@ -110,11 +112,11 @@ export function createFleetDashboard<TDef extends DetailAgentDef, TAgent extends
|
|
|
110
112
|
const toInput = (data: string) => matchesKey(data, Key.up) ? "\u001b[A" : matchesKey(data, Key.down) ? "\u001b[B" : matchesKey(data, Key.pageUp) ? "\u001b[5~" : matchesKey(data, Key.pageDown) ? "\u001b[6~" : matchesKey(data, Key.enter) ? "\r" : matchesKey(data, Key.escape) ? "\u001b" : data;
|
|
111
113
|
try { await ctx.ui.custom((tui: any, theme: any, _kb: any, done: () => void) => {
|
|
112
114
|
attachFleetDashboardTicker(resources, () => tui.requestRender());
|
|
113
|
-
return { render: (w: number) => { const rows = fleetRows(); reconcileSelection(selection, rows); const body = bodyRows(tui.terminal?.rows, FLEET_CHROME_ROWS); if (picker) return renderFleetSubstitutionPicker(picker.stage, picker.source, picker.choices, picker, w, body, theme); scrollOffset = clampScroll(scrollOffset, rows.length, body); const summary = summarise(rows); return renderFleetDashboard({ rows, selection, scrollOffset, filterQuery: deps.getFilter(), showFinished: deps.getShowFinished(), confirmation: confirm && confirm.until > Date.now() ? `press ${confirm.action === "kill" ? "x" : "r"} again to ${confirm.action} ${rows.find(row => row.key === confirm!.key)?.name ?? "agent"}` : undefined, summary: { ...summary, wallMs: unionMs(summary.intervals) } }, w, body, theme); },
|
|
115
|
+
return { render: (w: number) => { const rows = fleetRows(); reconcileSelection(selection, rows); const comsLines = deps.getComsLines(w, theme); const body = bodyRows(tui.terminal?.rows, FLEET_CHROME_ROWS + comsLines.length); if (picker) return renderFleetSubstitutionPicker(picker.stage, picker.source, picker.choices, picker, w, body, theme); scrollOffset = clampScroll(scrollOffset, rows.length, body); const summary = summarise(rows); return renderFleetDashboard({ rows, selection, scrollOffset, filterQuery: deps.getFilter(), showFinished: deps.getShowFinished(), confirmation: confirm && confirm.until > Date.now() ? `press ${confirm.action === "kill" ? "x" : "r"} again to ${confirm.action} ${rows.find(row => row.key === confirm!.key)?.name ?? "agent"}` : undefined, summary: { ...summary, wallMs: unionMs(summary.intervals) }, comsLines }, w, body, theme); },
|
|
114
116
|
handleInput: async (data: string) => { const rows = fleetRows(); reconcileSelection(selection, rows); const body = bodyRows(tui.terminal?.rows, FLEET_CHROME_ROWS), input = toInput(data);
|
|
115
117
|
if (picker) { const action = modelPickerTransition(input, picker, picker.choices.length, body); if (action === "cancel") { if (picker.stage === "target") { const source = picker.source, choices = substitutionSourceChoices(), index = Math.max(0, choices.findIndex(choice => choice.spec === source)); picker = { stage: "source", choices, index, scrollOffset: index }; } else picker = null; } else if (action === "select") { const picked = picker.choices[picker.index]?.spec; if (picked && picker.stage === "source") { const targets = await deps.loadAvailableModels(ctx, deps.modelPolicy.getSubstitution(picked)); if (targets) { const current = deps.modelPolicy.getSubstitution(picked), index = Math.max(0, targets.findIndex(choice => choice.spec === current)); picker = { stage: "target", source: picked, choices: targets, index, scrollOffset: index }; } } else if (picked && picker.source) { await deps.modelPolicy.applySessionSubstitution(picker.source, picked, { loadAvailable: current => deps.loadAvailableModels(ctx, current), notify: (message, level) => ctx.ui.notify(message, level) }); picker = null; } } tui.requestRender(); return; }
|
|
116
118
|
const state = { selection, scrollOffset, filtering, filterQuery: deps.getFilter(), showFinished: deps.getShowFinished(), confirm }, intent = dashboardTransition(input, state, rows, body); ({ scrollOffset, filtering, confirm } = state); deps.setFilter(state.filterQuery); deps.setShowFinished(state.showFinished);
|
|
117
|
-
if (intent === "close") done(); else if (intent === "substitute") { const choices = substitutionSourceChoices(); if (!choices.length) ctx.ui.notify("No configured persona or sub-role models are available as substitution sources.", "warning"); else picker = { stage: "source", choices, index: 0, scrollOffset: 0 }; } else if (intent && typeof intent === "object" && "open" in intent) { const selected = rows.find(row => row.key === intent.open) ?? rows[selection.index]; if (selected) detailVerbose = await deps.openDetail(selected, ctx, detailVerbose); } else if (intent && typeof intent === "object" && "kill" in intent) { const selected = rows.find(row => row.key === intent.kill); if (selected) killRow(selected, ctx); else ctx.ui.notify("Selected fleet row no longer exists.", "warning"); } else if (intent && typeof intent === "object" && "restart" in intent) { const selected = rows.find(row => row.key === intent.restart); if (selected) await restartRow(selected, ctx); } tui.requestRender(); },
|
|
119
|
+
if (intent === "close") done(); else if (intent === "history") { await deps.openHistory(ctx); } else if (intent === "substitute") { const choices = substitutionSourceChoices(); if (!choices.length) ctx.ui.notify("No configured persona or sub-role models are available as substitution sources.", "warning"); else picker = { stage: "source", choices, index: 0, scrollOffset: 0 }; } else if (intent && typeof intent === "object" && "open" in intent) { const selected = rows.find(row => row.key === intent.open) ?? rows[selection.index]; if (selected) detailVerbose = await deps.openDetail(selected, ctx, detailVerbose); } else if (intent && typeof intent === "object" && "kill" in intent) { const selected = rows.find(row => row.key === intent.kill); if (selected) killRow(selected, ctx); else ctx.ui.notify("Selected fleet row no longer exists.", "warning"); } else if (intent && typeof intent === "object" && "restart" in intent) { const selected = rows.find(row => row.key === intent.restart); if (selected) await restartRow(selected, ctx); } tui.requestRender(); },
|
|
118
120
|
invalidate() {}, dispose: () => resources.dispose() };
|
|
119
121
|
}, FULLSCREEN_OVERLAY); } finally { resources.dispose(); }
|
|
120
122
|
}
|
|
@@ -1,89 +1,35 @@
|
|
|
1
|
-
import { Text
|
|
2
|
-
import {
|
|
1
|
+
import { Text } from "@mariozechner/pi-tui";
|
|
2
|
+
import { renderRunningStrip, type RunningStripItem } from "./running-strip.ts";
|
|
3
3
|
|
|
4
|
-
type RunStatus = "idle" | "running" | "done" | "error";
|
|
5
|
-
export interface GridAgentDef { name: string; description: string; thinking?: string; }
|
|
6
|
-
export interface GridAgentState { def: GridAgentDef; status: RunStatus; elapsed: number; contextPct: number; lastBackend?: "native" | "coms"; comsPeerModel?: string; }
|
|
7
4
|
export interface GridWidgetContext { ui: { setWidget(name: string, widget: unknown, options?: unknown): void } }
|
|
8
5
|
|
|
9
6
|
export interface GridUIContext {
|
|
10
7
|
getWidgetContext(): GridWidgetContext | null | undefined;
|
|
11
|
-
|
|
12
|
-
getAgentStates(): Map<string, GridAgentState>;
|
|
13
|
-
getMarkedAgent(): string | null;
|
|
14
|
-
setMarkedAgent(value: string | null): void;
|
|
15
|
-
isRunningWidgetInstalled(): boolean;
|
|
16
|
-
markRunningWidgetInstalled(): void;
|
|
17
|
-
displayName(name: string): string;
|
|
18
|
-
shortModel(model: string | undefined): string;
|
|
19
|
-
modelWithThinking(def: GridAgentDef): string;
|
|
20
|
-
contextWarnThreshold: number;
|
|
8
|
+
getRunningItems(): RunningStripItem[];
|
|
21
9
|
}
|
|
22
10
|
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function contextLabel(contextPct: number, warn = false): string {
|
|
28
|
-
return `${warn ? "⚠" : ""}${Math.ceil(contextPct)}%`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function cardStatus(status: "idle" | "running" | "done" | "error", elapsed: number): { color: string; text: string } {
|
|
32
|
-
const color = status === "idle" ? "dim"
|
|
33
|
-
: status === "running" ? "accent"
|
|
34
|
-
: status === "done" ? "success" : "error";
|
|
35
|
-
const icon = status === "idle" ? "○"
|
|
36
|
-
: status === "running" ? "●"
|
|
37
|
-
: status === "done" ? "✓" : "✗";
|
|
38
|
-
const time = status !== "idle" ? ` ${Math.round(elapsed / 1000)}s` : "";
|
|
39
|
-
return { color, text: `${icon} ${status}${time}` };
|
|
40
|
-
}
|
|
11
|
+
export function createGridUI(deps: GridUIContext) {
|
|
12
|
+
let runningWidgetInstalled = false;
|
|
41
13
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
width: number,
|
|
53
|
-
theme: any,
|
|
54
|
-
marked = false,
|
|
55
|
-
warnContext = false,
|
|
56
|
-
): string {
|
|
57
|
-
const vis = visibleWidth(nameRaw);
|
|
58
|
-
const name = vis >= nameWidth ? nameRaw : nameRaw + " ".repeat(nameWidth - vis);
|
|
59
|
-
const ctx = contextLabel(contextPct, warnContext).padStart(4);
|
|
60
|
-
// The marked row (compact-view switcher) gets a `›` lead + a full-width
|
|
61
|
-
// selectedBg highlight, mirroring ZoomUI's selected-row treatment.
|
|
62
|
-
const lead = marked ? theme.fg("accent", "›") : " ";
|
|
63
|
-
const line = lead
|
|
64
|
-
+ theme.fg("accent", theme.bold(name))
|
|
65
|
-
+ " " + theme.fg(warnContext ? "warning" : "dim", ctx)
|
|
66
|
-
+ (model ? " " + theme.fg("dim", model) : "")
|
|
67
|
-
+ " " + theme.fg(status.color, status.text);
|
|
68
|
-
const truncated = truncateToWidth(line, width);
|
|
69
|
-
if (!marked) return truncated;
|
|
70
|
-
const pad = " ".repeat(Math.max(0, width - visibleWidth(truncated)));
|
|
71
|
-
return theme.bg("selectedBg", truncated + pad);
|
|
72
|
-
}
|
|
14
|
+
function installRunningWidget() {
|
|
15
|
+
if (!deps.getWidgetContext() || runningWidgetInstalled) return;
|
|
16
|
+
runningWidgetInstalled = true;
|
|
17
|
+
deps.getWidgetContext()!.ui.setWidget("agent-running", (_tui: any, theme: any) => ({
|
|
18
|
+
invalidate() {},
|
|
19
|
+
render(width: number): string[] {
|
|
20
|
+
return renderRunningStrip(deps.getRunningItems(), width, theme);
|
|
21
|
+
},
|
|
22
|
+
}), { placement: "belowEditor" });
|
|
23
|
+
}
|
|
73
24
|
|
|
74
|
-
export function createGridUI(deps: GridUIContext) {
|
|
75
25
|
function updateWidget() {
|
|
76
26
|
if (!deps.getWidgetContext()) return;
|
|
77
27
|
installRunningWidget();
|
|
78
|
-
|
|
79
28
|
deps.getWidgetContext()!.ui.setWidget("agent-team", (_tui: any, theme: any) => {
|
|
80
29
|
const text = new Text("", 0, 1);
|
|
81
|
-
|
|
82
30
|
return {
|
|
83
31
|
render(_width: number): string[] {
|
|
84
|
-
// The full fleet list is now a separate overlay; this legacy widget is retired.
|
|
85
32
|
return [];
|
|
86
|
-
|
|
87
33
|
},
|
|
88
34
|
invalidate() {
|
|
89
35
|
text.invalidate();
|
|
@@ -92,53 +38,5 @@ export function createGridUI(deps: GridUIContext) {
|
|
|
92
38
|
});
|
|
93
39
|
}
|
|
94
40
|
|
|
95
|
-
|
|
96
|
-
// input box and the footer). Registered once; it re-renders on every frame
|
|
97
|
-
// driven by updateWidget, reading live state + viewMode each time. In
|
|
98
|
-
// dashboard mode it renders nothing. In compact mode it lists only *running*
|
|
99
|
-
// team specialists, one line each — idle/done agents and research helpers are
|
|
100
|
-
// omitted. Research helpers appear only in the Fleet Dashboard (Alt+A).
|
|
101
|
-
// Ordered list of switchable subagents for the compact-view marker: running
|
|
102
|
-
// team specialists. main is the session under the input box, so it is never
|
|
103
|
-
// listed. Each entry's `key` matches /af-zoom resolution (lowercase persona
|
|
104
|
-
// name), so Alt+\ can resolve it.
|
|
105
|
-
function switchableAgents(): { key: string; name: string; ctx: number; ctxWarn: boolean; model: string; status: { color: string; text: string } }[] {
|
|
106
|
-
return Array.from(deps.getAgentStates().values())
|
|
107
|
-
.filter(a => a.status === "running")
|
|
108
|
-
.map(a => ({
|
|
109
|
-
key: a.def.name.toLowerCase(),
|
|
110
|
-
name: deps.displayName(a.def.name),
|
|
111
|
-
ctx: a.contextPct,
|
|
112
|
-
ctxWarn: contextPressure(a.contextPct, deps),
|
|
113
|
-
model: a.lastBackend === "coms" ? `⇄coms ${deps.shortModel(a.comsPeerModel)}` : deps.modelWithThinking(a.def),
|
|
114
|
-
status: cardStatus(a.status, a.elapsed),
|
|
115
|
-
}));
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// Keep markedAgent pointing at a still-running entry: if the marked one is gone
|
|
119
|
-
// (finished/killed), clamp to the nearest surviving entry, or null when empty.
|
|
120
|
-
// Called from the cycle shortcuts and before a zoom.
|
|
121
|
-
function clampMarker() {
|
|
122
|
-
const keys = switchableAgents().map(a => a.key);
|
|
123
|
-
if (keys.length === 0) { deps.setMarkedAgent(null); return; }
|
|
124
|
-
if (deps.getMarkedAgent() && keys.includes(deps.getMarkedAgent()!)) return;
|
|
125
|
-
deps.setMarkedAgent(keys[0]);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function installRunningWidget() {
|
|
129
|
-
if (!deps.getWidgetContext() || deps.isRunningWidgetInstalled()) return;
|
|
130
|
-
deps.markRunningWidgetInstalled();
|
|
131
|
-
deps.getWidgetContext()!.ui.setWidget("agent-running", (_tui: any, theme: any) => ({
|
|
132
|
-
invalidate() {},
|
|
133
|
-
render(width: number): string[] {
|
|
134
|
-
if (!compactWidgetsEnabled(deps.getViewMode())) return [];
|
|
135
|
-
const running = switchableAgents();
|
|
136
|
-
if (running.length === 0) return [];
|
|
137
|
-
const nameWidth = Math.min(24, Math.max(...running.map(r => visibleWidth(r.name))));
|
|
138
|
-
return running.map(r => renderCompactLine(r.name, r.ctx, r.model, r.status, nameWidth, width, theme, r.key === deps.getMarkedAgent(), r.ctxWarn));
|
|
139
|
-
},
|
|
140
|
-
}), { placement: "belowEditor" });
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
return { updateWidget, switchableAgents, clampMarker };
|
|
41
|
+
return { updateWidget };
|
|
144
42
|
}
|
|
@@ -10,7 +10,6 @@ export interface PoolPresentationDeps {
|
|
|
10
10
|
getPeerCards(): ReadonlyMap<string, { name: string; model: string; purpose: string; color: string; staleCount?: number }>;
|
|
11
11
|
readProjectEntries(project: string): ComsRegistryEntry[];
|
|
12
12
|
readAllEntries(): ComsRegistryEntry[];
|
|
13
|
-
isCompact(): boolean;
|
|
14
13
|
truncate(text: string, width: number): string;
|
|
15
14
|
}
|
|
16
15
|
|
|
@@ -53,7 +52,6 @@ export function createPoolPresentation(deps: PoolPresentationDeps): PoolPresenta
|
|
|
53
52
|
};
|
|
54
53
|
|
|
55
54
|
const render = (width: number, theme: { fg(color: string, text: string): string }): string[] => {
|
|
56
|
-
if (!deps.isCompact()) return [];
|
|
57
55
|
const rows = buildFleetRows({ specialists: [], research: [], peers: peerInputs() }, { showFinished: true });
|
|
58
56
|
const safeWidth = Math.max(0, width);
|
|
59
57
|
const identity = deps.getIdentity();
|
|
@@ -95,9 +93,6 @@ export function createPoolPresentation(deps: PoolPresentationDeps): PoolPresenta
|
|
|
95
93
|
|
|
96
94
|
return {
|
|
97
95
|
peerInputs, render,
|
|
98
|
-
install(
|
|
99
|
-
if (!ctx.hasUI) return;
|
|
100
|
-
try { ctx.ui.setWidget("coms-pool", (_tui, theme) => ({ invalidate() {}, render: width => render(width, theme) }), { placement: "belowEditor" }); } catch {}
|
|
101
|
-
},
|
|
96
|
+
install(_ctx) {},
|
|
102
97
|
};
|
|
103
98
|
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { activityDots, eventCount } from "./activity-dots.ts";
|
|
2
|
+
|
|
3
|
+
function visibleWidth(text: string): number {
|
|
4
|
+
return text.replace(/\x1b\[[0-9;]*m/g, "").length;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function truncateToWidth(text: string, width: number): string {
|
|
8
|
+
if (width <= 0) return "";
|
|
9
|
+
if (visibleWidth(text) <= width) return text;
|
|
10
|
+
let out = text;
|
|
11
|
+
while (out && visibleWidth(out) > width) out = out.slice(0, -1);
|
|
12
|
+
return out;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface RunningStripItem {
|
|
16
|
+
name: string;
|
|
17
|
+
model: string;
|
|
18
|
+
elapsedMs: number;
|
|
19
|
+
eventCount: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface StripSpecialistInput {
|
|
23
|
+
name: string;
|
|
24
|
+
status: string;
|
|
25
|
+
model: string;
|
|
26
|
+
elapsed: number;
|
|
27
|
+
toolCount: number;
|
|
28
|
+
messageCount: number;
|
|
29
|
+
delegations?: readonly StripDelegateInput[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface StripDelegateInput {
|
|
33
|
+
role: string;
|
|
34
|
+
id: string;
|
|
35
|
+
status: string;
|
|
36
|
+
model: string;
|
|
37
|
+
elapsed: number;
|
|
38
|
+
startedAt: number;
|
|
39
|
+
toolCount: number;
|
|
40
|
+
messageCount: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface StripResearchInput {
|
|
44
|
+
id: number;
|
|
45
|
+
persona: boolean;
|
|
46
|
+
displayName: string;
|
|
47
|
+
status: string;
|
|
48
|
+
model: string;
|
|
49
|
+
elapsed: number;
|
|
50
|
+
toolCount: number;
|
|
51
|
+
messageCount: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface StripComsInput {
|
|
55
|
+
name: string;
|
|
56
|
+
model: string;
|
|
57
|
+
elapsed: number;
|
|
58
|
+
eventCount: number;
|
|
59
|
+
running: boolean;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const NAME_CAP = 24;
|
|
63
|
+
|
|
64
|
+
export function collectRunningStripItems(input: {
|
|
65
|
+
specialists: readonly StripSpecialistInput[];
|
|
66
|
+
research: readonly StripResearchInput[];
|
|
67
|
+
coms: readonly StripComsInput[];
|
|
68
|
+
}, now = Date.now()): RunningStripItem[] {
|
|
69
|
+
const items: RunningStripItem[] = [];
|
|
70
|
+
for (const spec of input.specialists) {
|
|
71
|
+
if (spec.status === "running") {
|
|
72
|
+
items.push({
|
|
73
|
+
name: spec.name,
|
|
74
|
+
model: spec.model,
|
|
75
|
+
elapsedMs: spec.elapsed,
|
|
76
|
+
eventCount: eventCount(spec.toolCount, spec.messageCount),
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
for (const child of spec.delegations ?? []) {
|
|
80
|
+
if (child.status !== "running") continue;
|
|
81
|
+
items.push({
|
|
82
|
+
name: `${spec.name}/${child.role || child.id}`,
|
|
83
|
+
model: child.model,
|
|
84
|
+
elapsedMs: child.status === "running" ? Math.max(0, now - child.startedAt) : child.elapsed,
|
|
85
|
+
eventCount: eventCount(child.toolCount, child.messageCount),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
for (const research of input.research) {
|
|
90
|
+
if (research.status !== "running") continue;
|
|
91
|
+
items.push({
|
|
92
|
+
name: `r${research.id} ${research.persona ? research.displayName : "research"}`,
|
|
93
|
+
model: research.model,
|
|
94
|
+
elapsedMs: research.elapsed,
|
|
95
|
+
eventCount: eventCount(research.toolCount, research.messageCount),
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
for (const peer of input.coms) {
|
|
99
|
+
if (!peer.running) continue;
|
|
100
|
+
items.push({
|
|
101
|
+
name: `${peer.name} (coms)`,
|
|
102
|
+
model: peer.model,
|
|
103
|
+
elapsedMs: peer.elapsed,
|
|
104
|
+
eventCount: peer.eventCount,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return items;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function renderRunningStripLine(
|
|
111
|
+
item: RunningStripItem,
|
|
112
|
+
nameWidth: number,
|
|
113
|
+
width: number,
|
|
114
|
+
theme: { fg(color: string, text: string): string; bold?(text: string): string },
|
|
115
|
+
): string {
|
|
116
|
+
const vis = visibleWidth(item.name);
|
|
117
|
+
const name = vis >= nameWidth ? item.name : item.name + " ".repeat(nameWidth - vis);
|
|
118
|
+
const boldName = theme.bold ? theme.bold(name) : name;
|
|
119
|
+
const secs = `${Math.round(item.elapsedMs / 1000)}s`;
|
|
120
|
+
const dots = activityDots(item.eventCount);
|
|
121
|
+
const line = " "
|
|
122
|
+
+ theme.fg("accent", boldName)
|
|
123
|
+
+ " "
|
|
124
|
+
+ theme.fg("dim", item.model)
|
|
125
|
+
+ " "
|
|
126
|
+
+ theme.fg("accent", secs)
|
|
127
|
+
+ (dots ? " " + theme.fg("dim", dots) : "");
|
|
128
|
+
return truncateToWidth(line, width);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function renderRunningStrip(
|
|
132
|
+
items: readonly RunningStripItem[],
|
|
133
|
+
width: number,
|
|
134
|
+
theme: { fg(color: string, text: string): string; bold?(text: string): string },
|
|
135
|
+
): string[] {
|
|
136
|
+
if (items.length === 0) return [];
|
|
137
|
+
const nameWidth = Math.min(NAME_CAP, Math.max(...items.map(item => visibleWidth(item.name))));
|
|
138
|
+
return items.map(item => renderRunningStripLine(item, nameWidth, width, theme));
|
|
139
|
+
}
|
|
@@ -132,11 +132,6 @@ export function renderCardGrid<T>(
|
|
|
132
132
|
return lines;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
/** Compact below-editor specialist widgets render only in compact mode. */
|
|
136
|
-
export function compactWidgetsEnabled(viewMode: "compact" | "off"): boolean {
|
|
137
|
-
return viewMode === "compact";
|
|
138
|
-
}
|
|
139
|
-
|
|
140
135
|
/** Freeze an already-open Fleet detail row when its live target leaves "running". */
|
|
141
136
|
export function snapshotFleetDetailRow<
|
|
142
137
|
T extends { status: string; startedAt?: number; elapsed: number; lastWork: string },
|