@chankov/agent-fleet 2.0.8 → 2.0.9
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/harnesses/agent-hub/README.md +20 -6
- package/.pi/harnesses/agent-hub/footer.ts +1 -1
- package/.pi/harnesses/agent-hub/index.ts +47 -66
- package/.pi/harnesses/agent-hub/input/shortcuts.ts +2 -0
- package/.pi/harnesses/agent-hub/package.json +1 -1
- package/.pi/harnesses/agent-hub/ui/fleet-actions.ts +76 -0
- package/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +16 -42
- package/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
- package/.pi/harnesses/agent-hub/ui/fleet-source.ts +157 -0
- package/.pi/harnesses/agent-hub/ui/grid.ts +145 -33
- package/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -139
- 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 +17 -0
- package/.pi/harnesses/lib/fleet-dashboard-view.ts +22 -36
- package/.pi/harnesses/lib/fleet-read-model.ts +109 -27
- package/.pi/harnesses/lib/fleet-strip-controller.ts +74 -0
- package/.pi/harnesses/lib/fleet-strip-view.ts +132 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/README.md +347 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/.versions/2.0.9/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
- package/.versions/2.0.9/.pi/agent-fleet/hooks/coms-stop-hook.mjs +84 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/coms-claude-bridge.ts +411 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/coms-cli.ts +425 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +413 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/fleet-codex-client.ts +69 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/fleet-codex-read.py +148 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/fleet.ts +216 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/flow.ts +137 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +210 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/fleet-codex-catalog.ts +63 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/fleet-codex-operations.ts +190 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/fleet-codex-session.ts +166 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/fleet-codex-transport.ts +124 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/fleet-command.ts +252 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/flow-command.ts +93 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +230 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/team-project.ts +178 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/lib/team-snapshot.ts +147 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/package-lock.json +35 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/package.json +9 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/peer-launch.ts +283 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/team-snapshot.ts +237 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/team-up.ts +378 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +133 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/env.ts +34 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/git.ts +96 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +130 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/quality.ts +64 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/run.ts +108 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/trace.ts +34 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +112 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
- package/.versions/2.0.9/.pi/agent-fleet/scripts/workflows/wf-scout.ts +38 -0
- package/.versions/2.0.9/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/2.0.9/.pi/agents/model-profiles.yaml +83 -0
- package/.versions/2.0.9/.pi/agents/peers.yaml +147 -0
- package/.versions/2.0.9/.pi/agents/teams.yaml +41 -0
- package/.versions/2.0.9/.pi/agents/voices.yaml +13 -0
- package/.versions/2.0.9/.pi/damage-control-rules.yaml +297 -0
- package/.versions/2.0.9/.pi/extensions/btw/README.md +120 -0
- package/.versions/2.0.9/.pi/extensions/btw/index.ts +914 -0
- package/.versions/2.0.9/.pi/extensions/btw/package.json +6 -0
- package/.versions/2.0.9/.pi/extensions/btw/state.js +179 -0
- package/.versions/2.0.9/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
- package/.versions/2.0.9/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
- package/.versions/2.0.9/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/2.0.9/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/2.0.9/.pi/extensions/compact-and-continue/index.ts +120 -0
- package/.versions/2.0.9/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/2.0.9/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/2.0.9/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/2.0.9/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/2.0.9/.pi/extensions/package-lock.json +1175 -0
- package/.versions/2.0.9/.pi/extensions/package.json +9 -0
- package/.versions/2.0.9/.pi/extensions/pi-voice-stt/README.md +205 -0
- package/.versions/2.0.9/.pi/extensions/pi-voice-stt/config.ts +198 -0
- package/.versions/2.0.9/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/2.0.9/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/2.0.9/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/2.0.9/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/2.0.9/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/README.md +1217 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/acceptance.ts +62 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/access-approval.ts +135 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/artifacts.js +146 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/assertion-ledger.js +58 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/backend-policy.js +174 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/budget-continuation.ts +13 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/budget-recovery.ts +97 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/capability-packs.ts +180 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/budget-continue.ts +10 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/context.ts +43 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/models.ts +10 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/config/agents.ts +177 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/config/model-profiles.ts +216 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/config/overrides.ts +153 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +213 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/context/budgets.ts +202 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/context-pressure.ts +191 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/context-window.js +106 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/debate-command.ts +176 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/delegate.ts +446 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/dispatch-coms.ts +237 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/dispatch-native-complete.ts +154 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +156 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +193 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/dispatch-native-types.ts +230 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/dispatch-native.ts +213 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/docs-lane.js +122 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/drift-watchdog.js +218 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/execution-evidence.ts +80 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/external-blocker.js +85 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/fixtures/registration-surface.json +57 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/footer.ts +30 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/helpers.ts +266 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/hub-state-audit.js +64 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/index.ts +2132 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/input/completions.ts +76 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/input/shortcuts.ts +20 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +123 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +143 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +74 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/no-progress.ts +76 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/policy/models.ts +153 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/policy/roster.ts +94 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/policy/work-mode.ts +119 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/poll-command.ts +176 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/presentation.ts +48 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/prompts/context.ts +47 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/prompts/fragments.ts +115 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/prompts/system-prompt.ts +112 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/research/controls.ts +74 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/research/runtime.ts +192 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/research/spawn-run.ts +156 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/return-contract.js +293 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/return-extract.js +75 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/review-findings.js +102 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/run-budget.js +537 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/run-namespace.js +87 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/scope-gate.js +123 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/session-start.ts +42 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/spawn.ts +404 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/timeline.ts +54 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/action-executors.ts +149 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/context.ts +134 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +82 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +273 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/fleet-tools.ts +200 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/herdr-executors.ts +86 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/set-task-tier.ts +29 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/spawn-research.ts +62 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/tools/verification-contract.ts +77 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/types.ts +63 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/activity-dots.ts +16 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/context-budget.ts +86 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/detail-panel.ts +178 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/fleet-actions.ts +76 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +99 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/fleet-source.ts +157 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/grid.ts +154 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/history.ts +234 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/ui/zoom.ts +204 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/version.ts +42 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
- package/.versions/2.0.9/.pi/harnesses/agent-hub/work-mode.ts +167 -0
- package/.versions/2.0.9/.pi/harnesses/ask-user-remote/README.md +59 -0
- package/.versions/2.0.9/.pi/harnesses/ask-user-remote/index.ts +558 -0
- package/.versions/2.0.9/.pi/harnesses/ask-user-remote/questions.ts +161 -0
- package/.versions/2.0.9/.pi/harnesses/ask-user-remote/race-core.js +124 -0
- package/.versions/2.0.9/.pi/harnesses/ask-user-remote/runtime-ask.ts +43 -0
- package/.versions/2.0.9/.pi/harnesses/coms/README.md +100 -0
- package/.versions/2.0.9/.pi/harnesses/coms/index.ts +282 -0
- package/.versions/2.0.9/.pi/harnesses/coms/package.json +7 -0
- package/.versions/2.0.9/.pi/harnesses/coms/version.ts +42 -0
- package/.versions/2.0.9/.pi/harnesses/damage-control-continue/README.md +135 -0
- package/.versions/2.0.9/.pi/harnesses/damage-control-continue/index.ts +541 -0
- package/.versions/2.0.9/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/2.0.9/.pi/harnesses/damage-control-continue/version.ts +42 -0
- package/.versions/2.0.9/.pi/harnesses/lib/coms-core-io.ts +385 -0
- package/.versions/2.0.9/.pi/harnesses/lib/coms-core.ts +577 -0
- package/.versions/2.0.9/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
- package/.versions/2.0.9/.pi/harnesses/lib/context-budget-child-prompt.ts +180 -0
- package/.versions/2.0.9/.pi/harnesses/lib/context-budget-hub-prompt.ts +114 -0
- package/.versions/2.0.9/.pi/harnesses/lib/context-budget-view.ts +107 -0
- package/.versions/2.0.9/.pi/harnesses/lib/context-budget.ts +114 -0
- package/.versions/2.0.9/.pi/harnesses/lib/damage-control-shared.ts +197 -0
- package/.versions/2.0.9/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
- package/.versions/2.0.9/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
- package/.versions/2.0.9/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
- package/.versions/2.0.9/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
- package/.versions/2.0.9/.pi/harnesses/lib/fleet-dashboard-view.ts +134 -0
- package/.versions/2.0.9/.pi/harnesses/lib/fleet-detail-view.ts +247 -0
- package/.versions/2.0.9/.pi/harnesses/lib/fleet-overlay.ts +26 -0
- package/.versions/2.0.9/.pi/harnesses/lib/fleet-panel.ts +34 -0
- package/.versions/2.0.9/.pi/harnesses/lib/fleet-read-model.ts +213 -0
- package/.versions/2.0.9/.pi/harnesses/lib/fleet-selection.ts +24 -0
- package/.versions/2.0.9/.pi/harnesses/lib/fleet-strip-controller.ts +74 -0
- package/.versions/2.0.9/.pi/harnesses/lib/fleet-strip-view.ts +132 -0
- package/.versions/2.0.9/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
- package/.versions/2.0.9/.pi/harnesses/lib/herdr-client.ts +472 -0
- package/.versions/2.0.9/.pi/harnesses/lib/herdr-presence.ts +399 -0
- package/.versions/2.0.9/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.versions/2.0.9/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/2.0.9/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
- package/.versions/2.0.9/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/2.0.9/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
- package/.versions/2.0.9/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
- package/.versions/2.0.9/.pi/harnesses/lib/spawned-peers.js +190 -0
- package/.versions/2.0.9/.pi/harnesses/lib/update-check.ts +222 -0
- package/.versions/2.0.9/.pi/harnesses/package-lock.json +2039 -0
- package/.versions/2.0.9/.pi/harnesses/package.json +10 -0
- package/.versions/2.0.9/.pi/prompts/af-build.md +24 -0
- package/.versions/2.0.9/.pi/prompts/af-code-simplify.md +22 -0
- package/.versions/2.0.9/.pi/prompts/af-constraints.md +31 -0
- package/.versions/2.0.9/.pi/prompts/af-plan.md +17 -0
- package/.versions/2.0.9/.pi/prompts/af-review.md +16 -0
- package/.versions/2.0.9/.pi/prompts/af-set-hermes-telegram.md +15 -0
- package/.versions/2.0.9/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/2.0.9/.pi/prompts/af-ship.md +17 -0
- package/.versions/2.0.9/.pi/prompts/af-spec.md +15 -0
- package/.versions/2.0.9/.pi/prompts/af-test.md +19 -0
- package/.versions/2.0.9/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/2.0.9/.version +1 -0
- package/.versions/2.0.9/agents/architect.md +25 -0
- package/.versions/2.0.9/agents/bowser.md +28 -0
- package/.versions/2.0.9/agents/builder.md +56 -0
- package/.versions/2.0.9/agents/code-reviewer.md +210 -0
- package/.versions/2.0.9/agents/deep-researcher.md +33 -0
- package/.versions/2.0.9/agents/documenter.md +23 -0
- package/.versions/2.0.9/agents/orchestrator.md +23 -0
- package/.versions/2.0.9/agents/plan-reviewer.md +84 -0
- package/.versions/2.0.9/agents/planner.md +106 -0
- package/.versions/2.0.9/agents/releaser.md +25 -0
- package/.versions/2.0.9/agents/researcher.md +31 -0
- package/.versions/2.0.9/agents/security-auditor.md +168 -0
- package/.versions/2.0.9/agents/test-engineer.md +154 -0
- package/.versions/2.0.9/agents/web-debugger.md +44 -0
- package/.versions/2.0.9/agents/web-performance-auditor.md +194 -0
- package/.versions/2.0.9/bin/catalog/harness-runtime-closure.json +32 -0
- package/.versions/2.0.9/codex/fleet-session-client/SKILL.md +34 -0
- package/.versions/2.0.9/codex/fleet-session-client.zip +0 -0
- package/.versions/2.0.9/docs/ARCHITECTURE.md +416 -0
- package/.versions/2.0.9/docs/agent-fleet-setup.md +568 -0
- package/.versions/2.0.9/docs/claude-code-coms-bridge.md +134 -0
- package/.versions/2.0.9/docs/codex-session-bridge.md +219 -0
- package/.versions/2.0.9/docs/coms-hermes-bridge.md +188 -0
- package/.versions/2.0.9/docs/getting-started.md +126 -0
- package/.versions/2.0.9/docs/npm-install.md +356 -0
- package/.versions/2.0.9/docs/pi-extensions.md +449 -0
- package/.versions/2.0.9/docs/pi-setup.md +76 -0
- package/.versions/2.0.9/docs/skill-anatomy.md +150 -0
- package/.versions/2.0.9/install-manifest.json +2991 -0
- package/.versions/2.0.9/justfile +247 -0
- package/.versions/2.0.9/manifest-meta.json +970 -0
- package/.versions/2.0.9/references/accessibility-checklist.md +160 -0
- package/.versions/2.0.9/references/communication-contract.md +26 -0
- package/.versions/2.0.9/references/definition-of-done.md +67 -0
- package/.versions/2.0.9/references/fleet-coordination-patterns.md +171 -0
- package/.versions/2.0.9/references/observability-checklist.md +92 -0
- package/.versions/2.0.9/references/orchestration-patterns.md +370 -0
- package/.versions/2.0.9/references/performance-checklist.md +236 -0
- package/.versions/2.0.9/references/prompting-patterns.md +380 -0
- package/.versions/2.0.9/references/security-checklist.md +245 -0
- package/.versions/2.0.9/references/testing-patterns.md +235 -0
- package/.versions/2.0.9/references/workflow-authoring.md +304 -0
- package/.versions/2.0.9/skills/_internal/grilling.md +59 -0
- package/.versions/2.0.9/skills/browser-testing-with-devtools/SKILL.md +351 -0
- package/.versions/2.0.9/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.0.9/skills/compound-learning/SKILL.md +137 -0
- package/.versions/2.0.9/skills/constraint-driven-development/SKILL.md +338 -0
- package/.versions/2.0.9/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.0.9/skills/context-engineering/SKILL.md +341 -0
- package/.versions/2.0.9/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.0.9/skills/designing-agents/SKILL.md +394 -0
- package/.versions/2.0.9/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/2.0.9/skills/drafting-workflows/SKILL.md +143 -0
- package/.versions/2.0.9/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
- package/.versions/2.0.9/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.9/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/2.0.9/skills/idea-refine/SKILL.md +182 -0
- package/.versions/2.0.9/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.9/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.9/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.9/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.9/skills/incremental-implementation/SKILL.md +302 -0
- package/.versions/2.0.9/skills/interview-me/SKILL.md +226 -0
- package/.versions/2.0.9/skills/orchestration-verification/SKILL.md +181 -0
- package/.versions/2.0.9/skills/peer-coms/SKILL.md +90 -0
- package/.versions/2.0.9/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.0.9/skills/planning-and-task-breakdown/SKILL.md +289 -0
- package/.versions/2.0.9/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.0.9/skills/spec-driven-development/SKILL.md +295 -0
- package/.versions/2.0.9/skills/using-agent-skills/SKILL.md +198 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/README.md +430 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
- package/.versions/2.0.9/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
- package/CHANGELOG.md +24 -0
- package/docs/pi-extensions.md +3 -0
- package/install-manifest.json +1 -1
- package/package.json +34 -12
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { buildFleetRows, fleetTiming, type DelegateInput, type FleetFilter, type FleetRow, type FleetSource, type PeerInput, type ResearchInput, type SpecialistInput } from "../../lib/fleet-read-model.ts";
|
|
2
|
+
|
|
3
|
+
export interface FleetSourceAgent {
|
|
4
|
+
def: { name: string; description?: string };
|
|
5
|
+
status: FleetRow["status"];
|
|
6
|
+
task?: string;
|
|
7
|
+
toolCount: number;
|
|
8
|
+
elapsed: number;
|
|
9
|
+
lastWork: string;
|
|
10
|
+
contextPct: number;
|
|
11
|
+
contextTokens: number;
|
|
12
|
+
histEntry?: { startedAt: number; endedAt: number | null };
|
|
13
|
+
delegations?: ReadonlyMap<string, FleetSourceDelegate>;
|
|
14
|
+
lastBackend?: "native" | "coms";
|
|
15
|
+
comsPeerModel?: string;
|
|
16
|
+
runCount: number;
|
|
17
|
+
dispatchId?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface FleetSourceDelegate {
|
|
20
|
+
id: string;
|
|
21
|
+
parent: string;
|
|
22
|
+
role: string;
|
|
23
|
+
model: string;
|
|
24
|
+
status: "running" | "done" | "error";
|
|
25
|
+
toolCount: number;
|
|
26
|
+
tokens: number;
|
|
27
|
+
lastWork: string;
|
|
28
|
+
startedAt: number;
|
|
29
|
+
elapsed: number;
|
|
30
|
+
histEntry?: { startedAt: number; endedAt: number | null };
|
|
31
|
+
}
|
|
32
|
+
export interface FleetSourceResearch {
|
|
33
|
+
id: number;
|
|
34
|
+
persona: boolean;
|
|
35
|
+
def: { name: string };
|
|
36
|
+
status: FleetRow["status"];
|
|
37
|
+
model: string;
|
|
38
|
+
toolCount: number;
|
|
39
|
+
elapsed: number;
|
|
40
|
+
lastWork: string;
|
|
41
|
+
contextPct: number;
|
|
42
|
+
histEntry?: { startedAt: number; endedAt: number | null };
|
|
43
|
+
}
|
|
44
|
+
export interface PendingReplyLike { target_name?: string; created_at?: string; result?: unknown; }
|
|
45
|
+
export interface PeerCardLike { name: string; model: string; purpose: string; color: string; staleCount?: number; status?: string; queue_depth?: number; }
|
|
46
|
+
|
|
47
|
+
export interface FleetSourceDeps<TAgent extends FleetSourceAgent = FleetSourceAgent, TResearch extends FleetSourceResearch = FleetSourceResearch> {
|
|
48
|
+
getAgents(): ReadonlyMap<string, TAgent>;
|
|
49
|
+
getResearch(): ReadonlyMap<number, TResearch>;
|
|
50
|
+
getPeerInputs(formatModel?: (model: string) => string): PeerInput[];
|
|
51
|
+
getPeerCards(): ReadonlyMap<string, PeerCardLike>;
|
|
52
|
+
getPendingReplies(): Iterable<PendingReplyLike>;
|
|
53
|
+
displayName(name: string): string;
|
|
54
|
+
modelForAgent(state: TAgent): string;
|
|
55
|
+
modelForResearch(state: TResearch): string;
|
|
56
|
+
modelForPeer(model: string): string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function delegateForest(children: readonly FleetSourceDelegate[], now: number, model: (value: string) => string): DelegateInput[] {
|
|
60
|
+
const byId = new Map(children.map(child => [child.id, child]));
|
|
61
|
+
const invalid = new Set<string>();
|
|
62
|
+
for (const child of children) {
|
|
63
|
+
if (child.parent === child.id) { invalid.add(child.id); continue; }
|
|
64
|
+
let cursor: FleetSourceDelegate | undefined = child;
|
|
65
|
+
const path = new Set<string>();
|
|
66
|
+
while (cursor && cursor.parent !== "root" && byId.has(cursor.parent)) {
|
|
67
|
+
if (path.has(cursor.id)) { for (const id of path) invalid.add(id); break; }
|
|
68
|
+
path.add(cursor.id); cursor = byId.get(cursor.parent);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const nested = new Map<string, FleetSourceDelegate[]>();
|
|
72
|
+
const roots: FleetSourceDelegate[] = [];
|
|
73
|
+
for (const child of children) {
|
|
74
|
+
if (!invalid.has(child.id) && child.parent !== "root" && byId.has(child.parent)) {
|
|
75
|
+
const list = nested.get(child.parent) ?? []; list.push(child); nested.set(child.parent, list);
|
|
76
|
+
} else roots.push(child);
|
|
77
|
+
}
|
|
78
|
+
const make = (child: FleetSourceDelegate, ancestry = new Set<string>()): DelegateInput => {
|
|
79
|
+
const safeChildren = ancestry.has(child.id) ? [] : (nested.get(child.id) ?? []);
|
|
80
|
+
const next = new Set(ancestry); next.add(child.id);
|
|
81
|
+
const timing = child.histEntry ? fleetTiming(child.histEntry, now) : {
|
|
82
|
+
startedAt: child.startedAt,
|
|
83
|
+
endedAt: child.status === "running" ? undefined : child.startedAt + Math.max(0, child.elapsed),
|
|
84
|
+
elapsed: child.status === "running" ? Math.max(0, now - child.startedAt) : child.elapsed,
|
|
85
|
+
timingKind: "run" as const,
|
|
86
|
+
};
|
|
87
|
+
return { key: child.id, name: child.role || child.id, status: child.status, model: model(child.model), contextPct: null, contextTokens: null, ...timing, runToken: `${child.id}:${child.startedAt}`, toolCount: child.toolCount, lastWork: child.lastWork, children: safeChildren.map(item => make(item, next)) };
|
|
88
|
+
};
|
|
89
|
+
return roots.map(child => make(child));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** One production adapter for dashboard and below-editor widget data. */
|
|
93
|
+
export function createFleetSource<TAgent extends FleetSourceAgent, TResearch extends FleetSourceResearch>(deps: FleetSourceDeps<TAgent, TResearch>) {
|
|
94
|
+
function snapshot(now: number): FleetSource {
|
|
95
|
+
const specialists: SpecialistInput[] = Array.from(deps.getAgents().entries()).map(([key, state]) => ({
|
|
96
|
+
key,
|
|
97
|
+
name: deps.displayName(state.def.name),
|
|
98
|
+
status: state.status,
|
|
99
|
+
model: deps.modelForAgent(state),
|
|
100
|
+
backend: state.lastBackend ?? "native",
|
|
101
|
+
contextPct: state.contextPct,
|
|
102
|
+
contextTokens: state.contextTokens,
|
|
103
|
+
...fleetTiming(state.histEntry, now),
|
|
104
|
+
runToken: `${key}:${state.dispatchId ?? state.runCount}`,
|
|
105
|
+
toolCount: state.toolCount,
|
|
106
|
+
lastWork: state.lastWork || state.task || state.def.description || "",
|
|
107
|
+
hasTimeline: true,
|
|
108
|
+
delegates: delegateForest(Array.from(state.delegations?.values() ?? []), now, deps.modelForPeer),
|
|
109
|
+
}));
|
|
110
|
+
const research: ResearchInput[] = Array.from(deps.getResearch().values()).map(state => ({
|
|
111
|
+
key: `r${state.id}`, name: `r${state.id} ${state.persona ? deps.displayName(state.def.name) : "research"}`, status: state.status,
|
|
112
|
+
model: deps.modelForResearch(state), backend: "native", contextPct: state.contextPct, contextTokens: null,
|
|
113
|
+
...fleetTiming(state.histEntry, now), runToken: `r${state.id}:${state.histEntry?.startedAt ?? 0}`, toolCount: state.toolCount,
|
|
114
|
+
lastWork: state.lastWork, hasTimeline: true,
|
|
115
|
+
}));
|
|
116
|
+
|
|
117
|
+
const peers = deps.getPeerInputs(deps.modelForPeer).map(peer => ({ ...peer }));
|
|
118
|
+
const peerBySession = new Map(peers.map(peer => [peer.key, peer]));
|
|
119
|
+
const peersByName = new Map<string, PeerInput[]>();
|
|
120
|
+
for (const peer of peers) { const list = peersByName.get(peer.name) ?? []; list.push(peer); peersByName.set(peer.name, list); }
|
|
121
|
+
for (const [sessionId, card] of deps.getPeerCards()) {
|
|
122
|
+
const key = `peer:${sessionId}`;
|
|
123
|
+
let peer = peerBySession.get(key);
|
|
124
|
+
if (!peer) {
|
|
125
|
+
peer = { key, name: card.name, model: deps.modelForPeer(card.model), lastWork: card.purpose, colorHex: card.color, staleCount: card.staleCount };
|
|
126
|
+
peers.push(peer); peerBySession.set(key, peer);
|
|
127
|
+
const list = peersByName.get(peer.name) ?? []; list.push(peer); peersByName.set(peer.name, list);
|
|
128
|
+
}
|
|
129
|
+
if (card.status === "working" || (card.queue_depth ?? 0) > 0) peer.status = "running";
|
|
130
|
+
}
|
|
131
|
+
const pendingByName = new Map<string, { count: number; oldest?: number }>();
|
|
132
|
+
for (const pending of deps.getPendingReplies()) {
|
|
133
|
+
if (pending.result || !pending.target_name) continue;
|
|
134
|
+
const parsed = pending.created_at ? Date.parse(pending.created_at) : Number.NaN;
|
|
135
|
+
const previous = pendingByName.get(pending.target_name) ?? { count: 0 };
|
|
136
|
+
previous.count++;
|
|
137
|
+
if (Number.isFinite(parsed)) previous.oldest = previous.oldest == null ? parsed : Math.min(previous.oldest, parsed);
|
|
138
|
+
pendingByName.set(pending.target_name, previous);
|
|
139
|
+
}
|
|
140
|
+
for (const [name, pending] of pendingByName) {
|
|
141
|
+
const candidates = peersByName.get(name) ?? [];
|
|
142
|
+
if (candidates.length === 1) {
|
|
143
|
+
const peer = candidates[0];
|
|
144
|
+
peer.status = "running"; peer.timingKind = pending.oldest == null ? "unknown" : "wait";
|
|
145
|
+
peer.startedAt = pending.oldest; peer.elapsed = pending.oldest == null ? 0 : Math.max(0, now - pending.oldest);
|
|
146
|
+
peer.aliasKeys = [`peer-pending:${encodeURIComponent(name)}`];
|
|
147
|
+
} else {
|
|
148
|
+
peers.push({ key: `peer-pending:${encodeURIComponent(name)}`, name, model: "", lastWork: `${pending.count} pending ${pending.count === 1 ? "reply" : "replies"}`, status: "running", timingKind: pending.oldest == null ? "unknown" : "wait", startedAt: pending.oldest, elapsed: pending.oldest == null ? 0 : Math.max(0, now - pending.oldest) });
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return { specialists, research, peers };
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
snapshot,
|
|
155
|
+
rows(now: number, filter: FleetFilter): FleetRow[] { return buildFleetRows(snapshot(now), filter); },
|
|
156
|
+
};
|
|
157
|
+
}
|
|
@@ -1,42 +1,154 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { CustomEditor } from "@mariozechner/pi-coding-agent";
|
|
2
|
+
import { isKeyRelease, Key, matchesKey, truncateToWidth, visibleWidth } from "@mariozechner/pi-tui";
|
|
3
|
+
import { fleetStripTransition, initialFleetStripState, reconcileStripState, type FleetStripIntent, type FleetStripState } from "../../lib/fleet-strip-controller.ts";
|
|
4
|
+
import { selectWidgetRows, summariseWidget, type FleetRow } from "../../lib/fleet-read-model.ts";
|
|
5
|
+
import { renderFleetStrip, visibleWindow } from "../../lib/fleet-strip-view.ts";
|
|
6
|
+
import { installFleetEditor, type FleetEditorFactory, type FleetEditorWrapper } from "./fleet-editor.ts";
|
|
7
|
+
export interface GridWidgetContext {
|
|
8
|
+
mode?: string;
|
|
9
|
+
ui: {
|
|
10
|
+
setWidget(name: string, widget: unknown, options?: unknown): void;
|
|
11
|
+
getEditorText?(): string;
|
|
12
|
+
getEditorComponent?(): FleetEditorFactory | undefined;
|
|
13
|
+
setEditorComponent?(factory: FleetEditorFactory | undefined): void;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
6
16
|
export interface GridUIContext {
|
|
7
17
|
getWidgetContext(): GridWidgetContext | null | undefined;
|
|
8
|
-
|
|
18
|
+
getRows(now: number): FleetRow[];
|
|
19
|
+
handleIntent?(intent: FleetStripIntent): void | Promise<void>;
|
|
20
|
+
now?(): number;
|
|
21
|
+
setTimeout?(callback: () => void, ms: number): ReturnType<typeof setTimeout>;
|
|
22
|
+
clearTimeout?(timer: ReturnType<typeof setTimeout>): void;
|
|
9
23
|
}
|
|
10
24
|
|
|
11
25
|
export function createGridUI(deps: GridUIContext) {
|
|
12
|
-
|
|
26
|
+
const clock = deps.now ?? Date.now;
|
|
27
|
+
const schedule = deps.setTimeout ?? setTimeout;
|
|
28
|
+
const cancel = deps.clearTimeout ?? clearTimeout;
|
|
29
|
+
let owner: GridWidgetContext | null = null, widgetInstalled = false, editorInstallation: ReturnType<typeof installFleetEditor> | undefined;
|
|
30
|
+
let tui: any, state: FleetStripState = initialFleetStripState(), suspended = 0, timer: ReturnType<typeof setTimeout> | undefined, disposed = false, lastDisplayKey = "", lastRows: FleetRow[] = [], snapshotNow = 0, epoch = 0;
|
|
13
31
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return renderRunningStrip(deps.getRunningItems(), width, theme);
|
|
21
|
-
},
|
|
22
|
-
}), { placement: "belowEditor" });
|
|
32
|
+
const maxRows = () => Number.isFinite(tui?.terminal?.rows) ? Math.max(0, Math.floor(tui.terminal.rows / 3)) : 0;
|
|
33
|
+
const bodyRows = () => Math.max(0, maxRows() - 3);
|
|
34
|
+
function editorGate() {
|
|
35
|
+
const editor = currentEditor();
|
|
36
|
+
const compatible = !!editor && typeof editor.isShowingAutocomplete === "function" && typeof editor.focused === "boolean";
|
|
37
|
+
return { compatible, open: compatible && suspended === 0 && editor.focused === true && editor.getText() === "" && !editor.isShowingAutocomplete() };
|
|
23
38
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
text.invalidate();
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
+
function snapshot(now: number) {
|
|
40
|
+
snapshotNow = now;
|
|
41
|
+
if (state.confirmation && state.confirmation.until <= now) state = { ...state, confirmation: null };
|
|
42
|
+
const gate = editorGate();
|
|
43
|
+
if (!gate.open && (state.active || state.confirmation)) state = { ...state, active: false, confirmation: null };
|
|
44
|
+
const all = deps.getRows(now);
|
|
45
|
+
const selected = all.find(row => row.key === state.selectedKey);
|
|
46
|
+
const pin = state.active && selected ? { key: selected.key, runToken: selected.runToken } : undefined;
|
|
47
|
+
lastRows = selectWidgetRows(all, now, pin);
|
|
48
|
+
state = reconcileStripState(state, lastRows, bodyRows());
|
|
49
|
+
return lastRows;
|
|
39
50
|
}
|
|
40
|
-
|
|
41
|
-
|
|
51
|
+
function needsTimer(rows: readonly FleetRow[], now: number): boolean {
|
|
52
|
+
return state.active || !!state.confirmation || rows.some(row => row.status === "running" || ((row.status === "done" || row.status === "error") && row.endedAt != null && now < row.endedAt + 10_000));
|
|
53
|
+
}
|
|
54
|
+
function arm() {
|
|
55
|
+
if (timer || disposed) return;
|
|
56
|
+
const now = clock(), rows = snapshot(now);
|
|
57
|
+
if (!needsTimer(rows, now)) return;
|
|
58
|
+
timer = schedule(() => { timer = undefined; const before = lastDisplayKey; refresh(false); if (before !== lastDisplayKey) tui?.requestRender?.(); arm(); }, 500);
|
|
59
|
+
}
|
|
60
|
+
function displayKey(rows: readonly FleetRow[], now: number): string {
|
|
61
|
+
return JSON.stringify([Math.floor(now / 1000), rows.map(row => [row.key, row.runToken, row.status, Math.floor(row.elapsed / 1000), row.lastWork]), state, maxRows(), tui?.terminal?.columns ?? null, suspended, editorGate().open]);
|
|
62
|
+
}
|
|
63
|
+
function refresh(request = true) {
|
|
64
|
+
if (disposed) return;
|
|
65
|
+
install();
|
|
66
|
+
const now = clock(), rows = snapshot(now), next = displayKey(rows, now), changed = next !== lastDisplayKey;
|
|
67
|
+
lastDisplayKey = next;
|
|
68
|
+
if (request && changed) tui?.requestRender?.();
|
|
69
|
+
arm();
|
|
70
|
+
}
|
|
71
|
+
function input(data: string, meta: { paste: boolean; keyRelease: boolean }): boolean {
|
|
72
|
+
// The production registrar owns Alt+I. Passing it to the host callback avoids
|
|
73
|
+
// collapsing here and reopening when that callback invokes toggle().
|
|
74
|
+
if (!meta.paste && !meta.keyRelease && matchesKey(data, "alt+i")) return false;
|
|
75
|
+
const now = clock(), rows = snapshot(now), editor = currentEditor(), gate = editorGate();
|
|
76
|
+
const normalized = meta.paste || meta.keyRelease ? data
|
|
77
|
+
: matchesKey(data, Key.enter) ? "\r"
|
|
78
|
+
: data === "\u001b" ? "\u001b"
|
|
79
|
+
: data;
|
|
80
|
+
const transition = fleetStripTransition({ data: normalized, paste: meta.paste, keyRelease: meta.keyRelease }, state, rows, {
|
|
81
|
+
interactiveAvailable: gate.compatible && suspended === 0,
|
|
82
|
+
focused: gate.compatible && editor?.focused === true,
|
|
83
|
+
editorEmpty: editor?.getText?.() === "",
|
|
84
|
+
autocomplete: gate.compatible ? editor!.isShowingAutocomplete() : true,
|
|
85
|
+
modal: suspended > 0,
|
|
86
|
+
bodyRows: bodyRows(),
|
|
87
|
+
}, now);
|
|
88
|
+
state = transition.state;
|
|
89
|
+
if (transition.intent) {
|
|
90
|
+
const intentEpoch = epoch;
|
|
91
|
+
void Promise.resolve(deps.handleIntent?.(transition.intent)).finally(() => {
|
|
92
|
+
if (disposed || epoch !== intentEpoch) return;
|
|
93
|
+
state = { ...state, pendingAction: false, active: false, confirmation: null }; refresh();
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
refresh();
|
|
97
|
+
return transition.consume;
|
|
98
|
+
}
|
|
99
|
+
function currentEditor(): FleetEditorWrapper | undefined { return editorInstallation?.current(); }
|
|
100
|
+
function installEditor(ctx: GridWidgetContext) {
|
|
101
|
+
if (ctx.mode !== "tui" || !ctx.ui.getEditorComponent || !ctx.ui.setEditorComponent) return;
|
|
102
|
+
editorInstallation = installFleetEditor(ctx.ui as any, (editorTui, theme, keybindings) => new CustomEditor(editorTui, theme, keybindings) as any, isKeyRelease, input);
|
|
103
|
+
}
|
|
104
|
+
function install() {
|
|
105
|
+
const ctx = deps.getWidgetContext() ?? null;
|
|
106
|
+
if (!ctx || disposed) return;
|
|
107
|
+
if (owner !== ctx) { disposeOwned(); owner = ctx; widgetInstalled = false; installEditor(ctx); }
|
|
108
|
+
if (widgetInstalled) return;
|
|
109
|
+
widgetInstalled = true;
|
|
110
|
+
ctx.ui.setWidget("agent-running", (widgetTui: any, theme: any) => {
|
|
111
|
+
tui = widgetTui;
|
|
112
|
+
refresh(false);
|
|
113
|
+
return { invalidate() { lastDisplayKey = ""; refresh(); }, render(width: number): string[] {
|
|
114
|
+
const body = bodyRows(), window = visibleWindow(lastRows, state.index, state.offset, body), gate = editorGate();
|
|
115
|
+
const selected = lastRows.find(row => row.key === state.confirmation?.key && row.runToken === state.confirmation?.runToken);
|
|
116
|
+
const action = state.confirmation?.action;
|
|
117
|
+
const confirmation = state.confirmation && state.confirmation.until > snapshotNow
|
|
118
|
+
? selected?.backend === "coms" && action === "kill" ? "press x again to abort request (peer pane keeps running)" : `press ${action === "kill" ? "x" : "r"} again to ${action}`
|
|
119
|
+
: undefined;
|
|
120
|
+
return renderFleetStrip({ active: state.active && gate.open, interactiveAvailable: gate.compatible && suspended === 0, selectedKey: state.selectedKey, summary: summariseWidget(lastRows), window, maxRows: maxRows(), confirmation: gate.open ? confirmation : undefined }, width, theme, { visibleWidth, truncateToWidth });
|
|
121
|
+
} };
|
|
122
|
+
}, { placement: "belowEditor" });
|
|
123
|
+
}
|
|
124
|
+
function toggle() {
|
|
125
|
+
if (disposed) return;
|
|
126
|
+
install();
|
|
127
|
+
const now = clock(), rows = snapshot(now), editor = currentEditor(), gate = editorGate();
|
|
128
|
+
const transition = fleetStripTransition({ data: "toggle" }, state, rows, {
|
|
129
|
+
interactiveAvailable: gate.compatible && suspended === 0,
|
|
130
|
+
focused: gate.compatible && editor?.focused === true,
|
|
131
|
+
editorEmpty: editor?.getText?.() === "",
|
|
132
|
+
autocomplete: gate.compatible ? editor!.isShowingAutocomplete() : true,
|
|
133
|
+
modal: suspended > 0,
|
|
134
|
+
bodyRows: bodyRows(),
|
|
135
|
+
}, now);
|
|
136
|
+
state = transition.state;
|
|
137
|
+
refresh();
|
|
138
|
+
}
|
|
139
|
+
function disposeOwned() {
|
|
140
|
+
epoch++;
|
|
141
|
+
if (!owner) return;
|
|
142
|
+
if (timer) { cancel(timer); timer = undefined; }
|
|
143
|
+
try { owner.ui.setWidget("agent-running", undefined); } catch {}
|
|
144
|
+
editorInstallation?.dispose(); editorInstallation = undefined; widgetInstalled = false; tui = undefined;
|
|
145
|
+
state = initialFleetStripState(); lastRows = []; lastDisplayKey = "";
|
|
146
|
+
}
|
|
147
|
+
function reset() { disposeOwned(); owner = null; disposed = false; install(); }
|
|
148
|
+
function dispose() { disposed = true; disposeOwned(); owner = null; }
|
|
149
|
+
async function withSuspended<T>(work: () => Promise<T>): Promise<T> {
|
|
150
|
+
suspended++; state = { ...state, active: false, confirmation: null }; refresh();
|
|
151
|
+
try { return await work(); } finally { suspended = Math.max(0, suspended - 1); state = { ...state, active: false, confirmation: null }; refresh(); }
|
|
152
|
+
}
|
|
153
|
+
return { updateWidget: refresh, toggle, reset, dispose, withSuspended };
|
|
42
154
|
}
|
|
@@ -1,139 +1,2 @@
|
|
|
1
|
-
|
|
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
|
-
}
|
|
1
|
+
/** Legacy running-strip implementation removed; fleet widget rendering lives in fleet-strip-view.ts. */
|
|
2
|
+
export {};
|
|
@@ -4,6 +4,23 @@
|
|
|
4
4
|
* without booting the full agent-hub extension.
|
|
5
5
|
*/
|
|
6
6
|
import type { FleetKind } from "./fleet-read-model.ts";
|
|
7
|
+
|
|
8
|
+
export type FleetAction = "kill" | "restart";
|
|
9
|
+
export type FleetConfirmation = { action: FleetAction; key: string; runToken: string; until: number } | null;
|
|
10
|
+
|
|
11
|
+
/** Two-press confirmation bound to both stable row identity and the current run. */
|
|
12
|
+
export function confirmFleetAction(
|
|
13
|
+
current: FleetConfirmation,
|
|
14
|
+
action: FleetAction,
|
|
15
|
+
row: { key: string; runToken?: string },
|
|
16
|
+
now: number,
|
|
17
|
+
): { confirmation: FleetConfirmation; confirmed: boolean } {
|
|
18
|
+
if (!row.runToken) return { confirmation: null, confirmed: false };
|
|
19
|
+
if (current?.action === action && current.key === row.key && current.runToken === row.runToken && current.until > now) {
|
|
20
|
+
return { confirmation: null, confirmed: true };
|
|
21
|
+
}
|
|
22
|
+
return { confirmation: { action, key: row.key, runToken: row.runToken, until: now + 2000 }, confirmed: false };
|
|
23
|
+
}
|
|
7
24
|
import type { createPanelResources } from "./fleet-panel.ts";
|
|
8
25
|
|
|
9
26
|
export type KillHandles = {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { FleetRow } from "./fleet-read-model.ts";
|
|
2
2
|
import { moveSelection, type Selection } from "./fleet-selection.ts";
|
|
3
|
+
import { confirmFleetAction, type FleetConfirmation } from "./fleet-dashboard-ops.ts";
|
|
4
|
+
import { safeTerminalText, treePrefix, type TextMetrics } from "./fleet-strip-view.ts";
|
|
3
5
|
|
|
4
6
|
export interface ThemeLike { fg(color: string, text: string): string; bold(text: string): string; bg?(color: string, text: string): string; }
|
|
5
7
|
export const FLEET_CHROME_ROWS = 4;
|
|
@@ -14,61 +16,46 @@ export interface FleetViewModel {
|
|
|
14
16
|
comsLines?: readonly string[];
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
/** Truncate terminal-styled text without cutting an ANSI sequence; close SGR styling when clipped. */
|
|
20
|
-
const ellipsis = (text: string, width: number) => {
|
|
21
|
-
if (visibleWidth(text) <= width) return text;
|
|
22
|
-
if (width <= 0) return "";
|
|
23
|
-
let out = "", visible = 0, i = 0, styled = false;
|
|
24
|
-
const limit = Math.max(0, width - 1);
|
|
25
|
-
while (i < text.length && visible < limit) {
|
|
26
|
-
if (text[i] === "\x1b") {
|
|
27
|
-
const match = text.slice(i).match(/^\x1b\[[0-?]*[ -/]*[@-~]/);
|
|
28
|
-
if (match) { out += match[0]; styled = match[0] !== "\x1b[0m"; i += match[0].length; continue; }
|
|
29
|
-
}
|
|
30
|
-
const char = String.fromCodePoint(text.codePointAt(i)!);
|
|
31
|
-
out += char; visible++; i += char.length;
|
|
32
|
-
}
|
|
33
|
-
return `${out}${width > 1 ? "…" : ""}${styled ? "\x1b[0m" : ""}`;
|
|
34
|
-
};
|
|
19
|
+
const fit = (text: string, width: number, metrics: TextMetrics) => metrics.truncateToWidth(text, Math.max(0, width));
|
|
20
|
+
const padCells = (text: string, width: number, metrics: TextMetrics) => text + " ".repeat(Math.max(0, width - metrics.visibleWidth(text)));
|
|
35
21
|
const duration = (ms: number) => ms < 60_000 ? `${Math.round(ms / 1000)}s` : `${Math.floor(ms / 60_000)}:${String(Math.round(ms / 1000) % 60).padStart(2, "0")}`;
|
|
36
22
|
const tokens = (n: number | null) => n == null ? "—" : n >= 1000 ? `${Math.round(n / 1000)}k` : String(n);
|
|
37
23
|
const glyph = (row: FleetRow) => row.status === "running" ? "●" : row.status === "done" ? "✓" : row.status === "error" ? "✗" : row.status === "pending" ? "◌" : row.status === "stale" ? "○" : "▪";
|
|
38
24
|
const context = (pct: number | null) => pct == null ? "[automatic] —" : `[${"#".repeat(Math.max(0, Math.min(10, Math.round(pct / 10))))}${"·".repeat(Math.max(0, 10 - Math.round(pct / 10)))}] ${Math.round(pct)}%`;
|
|
39
25
|
|
|
40
26
|
/** Render a constant-height, width-bounded fleet list without pi runtime dependencies. */
|
|
41
|
-
export function renderFleetDashboard(vm: FleetViewModel, width: number, bodyHeight: number, theme: ThemeLike): string[] {
|
|
27
|
+
export function renderFleetDashboard(vm: FleetViewModel, width: number, bodyHeight: number, theme: ThemeLike, metrics: TextMetrics): string[] {
|
|
42
28
|
const w = Math.max(1, width), body = Math.max(0, bodyHeight);
|
|
43
29
|
const summary = `${vm.summary.running} running · ${vm.summary.done} done${vm.summary.failed ? ` · ${vm.summary.failed} failed` : ""} · ${duration(vm.summary.wallMs)} · ${tokens(vm.summary.totalTokens)} tok`;
|
|
44
|
-
const
|
|
45
|
-
const
|
|
30
|
+
const title = ` Fleet ${vm.filterQuery ? `· filter: ${safeTerminalText(vm.filterQuery)}` : ""}`;
|
|
31
|
+
const header = fit(title, Math.max(1, w - metrics.visibleWidth(summary) - 1), metrics);
|
|
32
|
+
const lines: string[] = [fit(theme.bold(header) + " " + theme.fg("dim", summary), w, metrics), theme.fg("dim", "╭" + "─".repeat(Math.max(0, w - 2)) + "╮")];
|
|
46
33
|
if (vm.rows.length === 0) {
|
|
47
34
|
const message = "no agents dispatched yet";
|
|
48
|
-
lines.push(...Array.from({ length: body }, (_, i) => i === Math.floor(body / 2) ?
|
|
35
|
+
lines.push(...Array.from({ length: body }, (_, i) => i === Math.floor(body / 2) ? fit(theme.fg("dim", " ".repeat(Math.max(0, Math.floor((w - metrics.visibleWidth(message)) / 2))) + message), w, metrics) : ""));
|
|
49
36
|
} else {
|
|
50
37
|
const offset = Math.max(0, Math.min(vm.scrollOffset ?? 0, Math.max(0, vm.rows.length - body)));
|
|
51
38
|
for (let i = 0; i < body; i++) {
|
|
52
39
|
const row = vm.rows[offset + i];
|
|
53
40
|
if (!row) { lines.push(""); continue; }
|
|
54
41
|
const selected = offset + i === vm.selection.index;
|
|
55
|
-
const indent = row.
|
|
56
|
-
const name = `${selected ? "❯" : " "} ${glyph(row)} ${
|
|
57
|
-
const parts = [name, row.kind, row.model
|
|
42
|
+
const indent = treePrefix(row.lastAtDepth, row.depth);
|
|
43
|
+
const name = `${selected ? "❯" : " "} ${indent}${glyph(row)} ${safeTerminalText(row.name)}`;
|
|
44
|
+
const parts = [name, row.kind, `${row.backend === "coms" ? "⇄ " : ""}${safeTerminalText(row.model)}`, context(row.contextPct), tokens(row.contextTokens), duration(row.elapsed), row.toolCount == null ? "—" : String(row.toolCount), safeTerminalText(row.lastWork)];
|
|
58
45
|
const count = w < 80 ? 4 : w < 105 ? 6 : 8;
|
|
59
|
-
const line =
|
|
60
|
-
lines.push(selected && theme.bg ? theme.bg("selectedBg", line
|
|
46
|
+
const line = fit(parts.slice(0, count).join(" "), w, metrics);
|
|
47
|
+
lines.push(selected && theme.bg ? theme.bg("selectedBg", padCells(line, w, metrics)) : line);
|
|
61
48
|
}
|
|
62
49
|
}
|
|
63
50
|
lines.push(theme.fg("dim", "╰" + "─".repeat(Math.max(0, w - 2)) + "╯"));
|
|
64
|
-
lines.push(
|
|
51
|
+
lines.push(fit(theme.fg("dim", vm.confirmation ?? "↑↓ select · Enter open · h history · m substitute · x kill · r restart · f filter · a all · q close"), w, metrics));
|
|
65
52
|
const coms = vm.comsLines ?? [];
|
|
66
53
|
lines.push(...coms);
|
|
67
54
|
const total = body + FLEET_CHROME_ROWS + coms.length;
|
|
68
55
|
return lines.slice(0, total).concat(Array(Math.max(0, total - lines.length)).fill(""));
|
|
69
56
|
}
|
|
70
57
|
|
|
71
|
-
export type DashboardConfirm =
|
|
58
|
+
export type DashboardConfirm = FleetConfirmation;
|
|
72
59
|
export interface DashboardControllerState {
|
|
73
60
|
selection: Selection;
|
|
74
61
|
scrollOffset: number;
|
|
@@ -90,7 +77,7 @@ export type DashboardIntent =
|
|
|
90
77
|
export function dashboardTransition(
|
|
91
78
|
input: string,
|
|
92
79
|
state: DashboardControllerState,
|
|
93
|
-
rows: readonly { key: string }[],
|
|
80
|
+
rows: readonly { key: string; runToken?: string }[],
|
|
94
81
|
bodyHeight: number,
|
|
95
82
|
now = Date.now(),
|
|
96
83
|
): DashboardIntent {
|
|
@@ -108,6 +95,7 @@ export function dashboardTransition(
|
|
|
108
95
|
return null;
|
|
109
96
|
}
|
|
110
97
|
const selected = rows[state.selection.index];
|
|
98
|
+
if (input !== "x" && input !== "r") state.confirm = null;
|
|
111
99
|
if (input === "\u001b[A" || input === "k" || input === "\u001b[B" || input === "j") {
|
|
112
100
|
moveSelection(state.selection, rows, input === "\u001b[A" || input === "k" ? -1 : 1);
|
|
113
101
|
const viewport = Math.max(1, bodyHeight);
|
|
@@ -136,12 +124,10 @@ export function dashboardTransition(
|
|
|
136
124
|
if (input === "x" || input === "r") {
|
|
137
125
|
if (!selected) return null;
|
|
138
126
|
const action = input === "x" ? "kill" : "restart";
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
state.confirm = { action, key: selected.key, until: now + 2000 };
|
|
144
|
-
return null;
|
|
127
|
+
const result = confirmFleetAction(state.confirm, action, selected, now);
|
|
128
|
+
state.confirm = result.confirmation;
|
|
129
|
+
if (!result.confirmed) return null;
|
|
130
|
+
return action === "kill" ? { kill: selected.key } : { restart: selected.key };
|
|
145
131
|
}
|
|
146
132
|
if (input === "\u001b" || input === "q") return "close";
|
|
147
133
|
return null;
|