@chankov/agent-fleet 2.0.20 → 2.0.21
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 +3 -2
- package/.pi/harnesses/agent-hub/index.ts +7 -5
- package/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +26 -10
- package/.pi/harnesses/agent-hub/package.json +1 -1
- package/.pi/harnesses/coms/index.ts +13 -10
- package/.pi/harnesses/coms/package.json +1 -1
- package/.pi/harnesses/damage-control-continue/package.json +1 -1
- package/.pi/harnesses/lib/coms-core-io.ts +29 -2
- package/.pi/harnesses/lib/coms-core.ts +144 -42
- package/.versions/2.0.21/.pi/agent-fleet/hermes/README.md +347 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/.versions/2.0.21/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
- package/.versions/2.0.21/.pi/agent-fleet/hooks/coms-stop-hook.mjs +84 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/coms-claude-bridge.ts +437 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/coms-cli.ts +425 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +413 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/fleet-codex-client.ts +69 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/fleet-codex-read.py +148 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/fleet.ts +217 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/flow.ts +157 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +208 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/fleet-codex-catalog.ts +63 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/fleet-codex-operations.ts +190 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/fleet-codex-session.ts +166 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/fleet-codex-transport.ts +124 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/fleet-command.ts +252 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/flow-command.ts +98 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +230 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/team-project.ts +178 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/lib/team-snapshot.ts +147 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/package-lock.json +35 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/package.json +9 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/peer-launch.ts +283 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/team-snapshot.ts +237 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/team-up.ts +378 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +179 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/env.ts +34 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/git.ts +96 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +125 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +130 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +36 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/quality.ts +64 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/run.ts +108 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/trace.ts +34 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +112 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
- package/.versions/2.0.21/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
- package/.versions/2.0.21/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/2.0.21/.pi/agents/model-profiles.yaml +134 -0
- package/.versions/2.0.21/.pi/agents/peers.yaml +147 -0
- package/.versions/2.0.21/.pi/agents/teams.yaml +41 -0
- package/.versions/2.0.21/.pi/agents/voices.yaml +13 -0
- package/.versions/2.0.21/.pi/damage-control-rules.yaml +297 -0
- package/.versions/2.0.21/.pi/extensions/btw/README.md +120 -0
- package/.versions/2.0.21/.pi/extensions/btw/index.ts +914 -0
- package/.versions/2.0.21/.pi/extensions/btw/package.json +6 -0
- package/.versions/2.0.21/.pi/extensions/btw/state.js +179 -0
- package/.versions/2.0.21/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
- package/.versions/2.0.21/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
- package/.versions/2.0.21/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/2.0.21/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/2.0.21/.pi/extensions/compact-and-continue/index.ts +136 -0
- package/.versions/2.0.21/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/2.0.21/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/2.0.21/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/2.0.21/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/2.0.21/.pi/extensions/package-lock.json +1175 -0
- package/.versions/2.0.21/.pi/extensions/package.json +9 -0
- package/.versions/2.0.21/.pi/extensions/pi-voice-stt/README.md +224 -0
- package/.versions/2.0.21/.pi/extensions/pi-voice-stt/config.ts +198 -0
- package/.versions/2.0.21/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/2.0.21/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/2.0.21/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/2.0.21/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/2.0.21/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/README.md +1517 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/acceptance.ts +199 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/access-approval.ts +141 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/action-authorization.ts +10 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/agentic-contract.ts +43 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/agentic-evidence.ts +64 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/agentic-hub.ts +54 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/agentic-runtime.ts +56 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/agentic-sources-worker.mjs +4 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/agentic-sources.ts +74 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/agentic-state.ts +23 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/approval-wait.ts +1 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/artifacts.js +146 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/assertion-ledger.js +67 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/assist-profile.ts +19 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/backend-policy.js +174 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/budget-recovery.ts +123 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/capability-packs.ts +184 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/context.ts +46 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/models.ts +10 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/recover.ts +61 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/task-triage-recover.ts +12 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/task-triage-waive.ts +12 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/config/agents.ts +178 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/config/model-profiles.ts +237 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/config/overrides.ts +165 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +221 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/context/budgets.ts +152 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/context-compaction-monitor.ts +35 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/context-compaction-preflight.ts +21 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/context-compaction-runtime.ts +69 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/context-compaction.ts +34 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/context-continuity-broker.ts +42 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/context-continuity-child.ts +83 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/context-continuity-client.ts +19 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/context-continuity-compat.ts +30 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/context-continuity-owners.ts +15 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/context-continuity-registry.ts +8 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/context-continuity.ts +82 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/context-pressure.ts +222 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/context-window.js +108 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/damage-guard-approval.ts +59 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/damage-guard-broker.ts +125 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/damage-guard-contract.ts +22 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/damage-guard-descendant.ts +76 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/damage-guard-hub.ts +249 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/damage-guard-identity.ts +12 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/damage-guard-owners.ts +54 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/damage-guard-state.ts +43 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/damage-guard-test-tsconfig.json +19 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/debate-command.ts +176 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/delegate.ts +478 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/deterministic-fs.ts +195 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/dispatch-coms.ts +253 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/dispatch-native-complete.ts +173 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +295 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +253 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/dispatch-native-types.ts +293 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/dispatch-native.ts +236 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/dispatch-triage-contract.ts +27 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +77 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/dispatch-triage-policy.ts +29 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +55 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/dispatch-triage-state.ts +33 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/docs-lane.js +123 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/drift-watchdog.js +349 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/evidence-manifest.ts +51 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/execution-evidence.ts +80 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/execution-trace.ts +241 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/external-blocker.js +85 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/file-discovery/adapters.ts +88 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/file-discovery/broker-client.ts +62 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/file-discovery/broker.ts +128 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/file-discovery/child-extension.ts +42 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/file-discovery/descendant.ts +67 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/file-discovery/discovery-worker.mjs +15 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/file-discovery/discovery.ts +126 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/file-discovery/evaluate.ts +57 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/file-discovery/hub.ts +169 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/file-discovery/native-context.ts +8 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/file-discovery/native-fixture.test-support.ts +108 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/file-discovery/owners.ts +96 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/file-discovery/results.ts +55 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/file-discovery/runtime.ts +130 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/file-discovery/semantic-profiles.ts +18 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/file-discovery/sources.ts +69 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/file-discovery/state.ts +22 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/filesystem-tool.ts +166 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/fixtures/registration-surface.json +66 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/footer.ts +30 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/helpers.ts +270 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/history-projection.ts +116 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/hub-state-audit.js +41 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/index.ts +2616 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/input/completions.ts +82 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/input/shortcuts.ts +20 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +231 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +144 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +90 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/no-progress.ts +620 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/operator-watchdog.ts +97 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/orchestration-activation.ts +109 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/orchestration-metrics.ts +78 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/orchestration-route.ts +68 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/policy/models.ts +153 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/policy/roster.ts +94 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/policy/work-mode.ts +142 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/poll-command.ts +176 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/presentation.ts +48 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/proactive-config.ts +21 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/proactive-external-git.ts +82 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/proactive-external.ts +142 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/proactive-local.ts +89 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/proactive-observer.ts +106 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/proactive-rules.ts +171 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/proactive-runtime.ts +318 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/proactive-snapshot.ts +271 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/proactive-types.ts +67 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/process-obligations.ts +159 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/prompts/context.ts +55 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/prompts/fragments.ts +86 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/prompts/system-prompt.ts +125 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/reconcile.ts +26 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/recover-policy.ts +44 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/recover-state.ts +104 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/recovery-contract.ts +151 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/rerun-policy.ts +40 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/research/controls.ts +74 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/research/runtime.ts +215 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/research/spawn-run.ts +221 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/return-contract.js +349 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/return-extract.js +77 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/review-closure.ts +43 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/review-continuity.ts +73 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/review-findings.js +96 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/review-reuse.ts +47 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/routing-observation.ts +41 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/routing-proposal.ts +46 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/run-budget.js +342 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/run-namespace.js +93 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/runtime-test-check.ts +54 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/scope-gate.js +228 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/session-audit.ts +331 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/session-start.ts +42 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/spawn.ts +639 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/specialist-result-receipt.ts +13 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/specialist-result.ts +69 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/system1-activity.ts +625 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/system1-communication-store.ts +217 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/system1-report.ts +275 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/system1-runtime.ts +265 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/task-continuation.ts +4 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/task-resume-contract.ts +70 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/task-triage-authorization.ts +151 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/task-triage-config.ts +20 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/task-triage-contract.ts +14 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/task-triage-live-stage-boundary.mjs +49 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/task-triage-obligations.ts +120 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/task-triage-policy.ts +16 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/task-triage-review-contract.mjs +43 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/task-triage-reviewer-only-contract.mjs +156 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/task-triage-reviewer-only-diagnostics.mjs +112 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/task-triage-runtime.ts +130 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +21 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/task-triage-state.ts +46 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/timeline.ts +72 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +79 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/tool-catalog-state.ts +123 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/tools/action-executors.ts +214 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/tools/ask-system1-files.ts +15 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/tools/ask-system1.ts +25 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/tools/context.ts +144 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +88 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +640 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/tools/dispatch-triage.ts +16 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/tools/fleet-tools.ts +200 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/tools/herdr-executors.ts +95 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/tools/run-flow.ts +136 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/tools/spawn-research.ts +67 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/tools/verification-contract.ts +80 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/tsconfig.json +22 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/types.ts +66 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/ui/context-budget.ts +89 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/ui/detail-panel.ts +192 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +155 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/ui/fleet-source.ts +179 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/ui/grid.ts +159 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/ui/history.ts +234 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/ui/system1-communication.ts +59 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/version.ts +42 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/work-mode.ts +186 -0
- package/.versions/2.0.21/.pi/harnesses/agent-hub/write-isolation.ts +187 -0
- package/.versions/2.0.21/.pi/harnesses/ask-user-remote/README.md +59 -0
- package/.versions/2.0.21/.pi/harnesses/ask-user-remote/index.ts +569 -0
- package/.versions/2.0.21/.pi/harnesses/ask-user-remote/questions.ts +159 -0
- package/.versions/2.0.21/.pi/harnesses/ask-user-remote/race-core.js +124 -0
- package/.versions/2.0.21/.pi/harnesses/ask-user-remote/runtime-ask.ts +83 -0
- package/.versions/2.0.21/.pi/harnesses/coms/README.md +100 -0
- package/.versions/2.0.21/.pi/harnesses/coms/index.ts +285 -0
- package/.versions/2.0.21/.pi/harnesses/coms/package.json +7 -0
- package/.versions/2.0.21/.pi/harnesses/coms/version.ts +42 -0
- package/.versions/2.0.21/.pi/harnesses/damage-control-continue/README.md +161 -0
- package/.versions/2.0.21/.pi/harnesses/damage-control-continue/index.ts +600 -0
- package/.versions/2.0.21/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/2.0.21/.pi/harnesses/damage-control-continue/result-screen.ts +98 -0
- package/.versions/2.0.21/.pi/harnesses/damage-control-continue/system1-child.ts +35 -0
- package/.versions/2.0.21/.pi/harnesses/damage-control-continue/system1-client.ts +85 -0
- package/.versions/2.0.21/.pi/harnesses/damage-control-continue/system1-guard.ts +65 -0
- package/.versions/2.0.21/.pi/harnesses/damage-control-continue/version.ts +42 -0
- package/.versions/2.0.21/.pi/harnesses/lib/approval-wait.ts +17 -0
- package/.versions/2.0.21/.pi/harnesses/lib/bash-policy-analysis.ts +155 -0
- package/.versions/2.0.21/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
- package/.versions/2.0.21/.pi/harnesses/lib/clarification-policy.ts +9 -0
- package/.versions/2.0.21/.pi/harnesses/lib/coms-core-io.ts +413 -0
- package/.versions/2.0.21/.pi/harnesses/lib/coms-core.ts +680 -0
- package/.versions/2.0.21/.pi/harnesses/lib/coms-registry-entry.ts +96 -0
- package/.versions/2.0.21/.pi/harnesses/lib/context-budget-child-prompt.ts +214 -0
- package/.versions/2.0.21/.pi/harnesses/lib/context-budget-hub-prompt.ts +121 -0
- package/.versions/2.0.21/.pi/harnesses/lib/context-budget-view.ts +112 -0
- package/.versions/2.0.21/.pi/harnesses/lib/context-budget.ts +114 -0
- package/.versions/2.0.21/.pi/harnesses/lib/context-compaction-policy.js +35 -0
- package/.versions/2.0.21/.pi/harnesses/lib/damage-action-hash.ts +28 -0
- package/.versions/2.0.21/.pi/harnesses/lib/damage-control-shared.ts +229 -0
- package/.versions/2.0.21/.pi/harnesses/lib/damage-guard-port.ts +25 -0
- package/.versions/2.0.21/.pi/harnesses/lib/damage-result-evidence.ts +25 -0
- package/.versions/2.0.21/.pi/harnesses/lib/damage-result-view.ts +16 -0
- package/.versions/2.0.21/.pi/harnesses/lib/deterministic-handle-path.ts +25 -0
- package/.versions/2.0.21/.pi/harnesses/lib/execution-trace.ts +45 -0
- package/.versions/2.0.21/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
- package/.versions/2.0.21/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
- package/.versions/2.0.21/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
- package/.versions/2.0.21/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
- package/.versions/2.0.21/.pi/harnesses/lib/fleet-dashboard-view.ts +172 -0
- package/.versions/2.0.21/.pi/harnesses/lib/fleet-detail-view.ts +339 -0
- package/.versions/2.0.21/.pi/harnesses/lib/fleet-overlay.ts +26 -0
- package/.versions/2.0.21/.pi/harnesses/lib/fleet-panel.ts +34 -0
- package/.versions/2.0.21/.pi/harnesses/lib/fleet-read-model.ts +609 -0
- package/.versions/2.0.21/.pi/harnesses/lib/fleet-selection.ts +24 -0
- package/.versions/2.0.21/.pi/harnesses/lib/fleet-strip-controller.ts +75 -0
- package/.versions/2.0.21/.pi/harnesses/lib/fleet-strip-view.ts +179 -0
- package/.versions/2.0.21/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
- package/.versions/2.0.21/.pi/harnesses/lib/herdr-client.ts +472 -0
- package/.versions/2.0.21/.pi/harnesses/lib/herdr-presence.ts +399 -0
- package/.versions/2.0.21/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.versions/2.0.21/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/2.0.21/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
- package/.versions/2.0.21/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/2.0.21/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
- package/.versions/2.0.21/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
- package/.versions/2.0.21/.pi/harnesses/lib/identical-dialog.ts +27 -0
- package/.versions/2.0.21/.pi/harnesses/lib/installation-state.js +62 -0
- package/.versions/2.0.21/.pi/harnesses/lib/policy-roots.js +106 -0
- package/.versions/2.0.21/.pi/harnesses/lib/policy-roots.ts +31 -0
- package/.versions/2.0.21/.pi/harnesses/lib/process-shared.ts +9 -0
- package/.versions/2.0.21/.pi/harnesses/lib/safe-source-read.js +29 -0
- package/.versions/2.0.21/.pi/harnesses/lib/semantic-approval.ts +80 -0
- package/.versions/2.0.21/.pi/harnesses/lib/spawned-peers.js +191 -0
- package/.versions/2.0.21/.pi/harnesses/lib/system1/config-agentic.js +15 -0
- package/.versions/2.0.21/.pi/harnesses/lib/system1/config-context-compaction.js +16 -0
- package/.versions/2.0.21/.pi/harnesses/lib/system1/config-damage-guard.js +24 -0
- package/.versions/2.0.21/.pi/harnesses/lib/system1/config-file-discovery.js +23 -0
- package/.versions/2.0.21/.pi/harnesses/lib/system1/config-json.js +37 -0
- package/.versions/2.0.21/.pi/harnesses/lib/system1/config-loader.js +44 -0
- package/.versions/2.0.21/.pi/harnesses/lib/system1/config-proactive.js +68 -0
- package/.versions/2.0.21/.pi/harnesses/lib/system1/config-triage.js +42 -0
- package/.versions/2.0.21/.pi/harnesses/lib/system1/config-v2.js +112 -0
- package/.versions/2.0.21/.pi/harnesses/lib/system1/config.js +50 -0
- package/.versions/2.0.21/.pi/harnesses/lib/system1/contracts.ts +154 -0
- package/.versions/2.0.21/.pi/harnesses/lib/system1/demo.ts +95 -0
- package/.versions/2.0.21/.pi/harnesses/lib/system1/jev.ts +503 -0
- package/.versions/2.0.21/.pi/harnesses/lib/system1/payload-screen.ts +65 -0
- package/.versions/2.0.21/.pi/harnesses/lib/system1/selection.js +11 -0
- package/.versions/2.0.21/.pi/harnesses/lib/system1/service.ts +245 -0
- package/.versions/2.0.21/.pi/harnesses/lib/update-check.ts +222 -0
- package/.versions/2.0.21/.pi/harnesses/package-lock.json +2121 -0
- package/.versions/2.0.21/.pi/harnesses/package.json +13 -0
- package/.versions/2.0.21/.pi/prompts/af-build.md +27 -0
- package/.versions/2.0.21/.pi/prompts/af-code-simplify.md +22 -0
- package/.versions/2.0.21/.pi/prompts/af-constraints.md +31 -0
- package/.versions/2.0.21/.pi/prompts/af-plan.md +17 -0
- package/.versions/2.0.21/.pi/prompts/af-review.md +16 -0
- package/.versions/2.0.21/.pi/prompts/af-set-hermes-telegram.md +15 -0
- package/.versions/2.0.21/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/2.0.21/.pi/prompts/af-setup-rules.md +20 -0
- package/.versions/2.0.21/.pi/prompts/af-ship.md +17 -0
- package/.versions/2.0.21/.pi/prompts/af-spec.md +15 -0
- package/.versions/2.0.21/.pi/prompts/af-test.md +19 -0
- package/.versions/2.0.21/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/2.0.21/.version +1 -0
- package/.versions/2.0.21/agents/architect.md +24 -0
- package/.versions/2.0.21/agents/bowser.md +28 -0
- package/.versions/2.0.21/agents/builder.md +55 -0
- package/.versions/2.0.21/agents/code-reviewer.md +209 -0
- package/.versions/2.0.21/agents/deep-researcher.md +32 -0
- package/.versions/2.0.21/agents/documenter.md +22 -0
- package/.versions/2.0.21/agents/orchestrator.md +22 -0
- package/.versions/2.0.21/agents/plan-reviewer.md +83 -0
- package/.versions/2.0.21/agents/planner.md +107 -0
- package/.versions/2.0.21/agents/releaser.md +24 -0
- package/.versions/2.0.21/agents/researcher.md +30 -0
- package/.versions/2.0.21/agents/security-auditor.md +167 -0
- package/.versions/2.0.21/agents/test-engineer.md +153 -0
- package/.versions/2.0.21/agents/web-debugger.md +44 -0
- package/.versions/2.0.21/agents/web-performance-auditor.md +194 -0
- package/.versions/2.0.21/bin/catalog/harness-runtime-closure.json +73 -0
- package/.versions/2.0.21/codex/fleet-session-client/SKILL.md +34 -0
- package/.versions/2.0.21/codex/fleet-session-client.zip +0 -0
- package/.versions/2.0.21/docs/ARCHITECTURE.md +979 -0
- package/.versions/2.0.21/docs/agent-fleet-setup.md +1103 -0
- package/.versions/2.0.21/docs/claude-code-coms-bridge.md +147 -0
- package/.versions/2.0.21/docs/codex-session-bridge.md +219 -0
- package/.versions/2.0.21/docs/coms-hermes-bridge.md +188 -0
- package/.versions/2.0.21/docs/getting-started.md +126 -0
- package/.versions/2.0.21/docs/npm-install.md +535 -0
- package/.versions/2.0.21/docs/pi-extensions.md +455 -0
- package/.versions/2.0.21/docs/pi-setup.md +92 -0
- package/.versions/2.0.21/docs/skill-anatomy.md +150 -0
- package/.versions/2.0.21/install-manifest.json +3210 -0
- package/.versions/2.0.21/justfile +247 -0
- package/.versions/2.0.21/manifest-meta.json +1088 -0
- package/.versions/2.0.21/references/accessibility-checklist.md +160 -0
- package/.versions/2.0.21/references/communication-contract.md +26 -0
- package/.versions/2.0.21/references/definition-of-done.md +67 -0
- package/.versions/2.0.21/references/fleet-coordination-patterns.md +171 -0
- package/.versions/2.0.21/references/observability-checklist.md +92 -0
- package/.versions/2.0.21/references/orchestration-patterns.md +370 -0
- package/.versions/2.0.21/references/performance-checklist.md +236 -0
- package/.versions/2.0.21/references/prompting-patterns.md +380 -0
- package/.versions/2.0.21/references/security-checklist.md +245 -0
- package/.versions/2.0.21/references/testing-patterns.md +235 -0
- package/.versions/2.0.21/references/workflow-authoring.md +304 -0
- package/.versions/2.0.21/skills/_internal/grilling.md +59 -0
- package/.versions/2.0.21/skills/browser-testing-with-devtools/SKILL.md +351 -0
- package/.versions/2.0.21/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.0.21/skills/compound-learning/SKILL.md +137 -0
- package/.versions/2.0.21/skills/constraint-driven-development/SKILL.md +338 -0
- package/.versions/2.0.21/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.0.21/skills/context-engineering/SKILL.md +341 -0
- package/.versions/2.0.21/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.0.21/skills/designing-agents/SKILL.md +394 -0
- package/.versions/2.0.21/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/2.0.21/skills/drafting-workflows/SKILL.md +143 -0
- package/.versions/2.0.21/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
- package/.versions/2.0.21/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.21/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/2.0.21/skills/idea-refine/SKILL.md +182 -0
- package/.versions/2.0.21/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.21/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.21/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.21/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.21/skills/incremental-implementation/SKILL.md +353 -0
- package/.versions/2.0.21/skills/incremental-implementation.zip +0 -0
- package/.versions/2.0.21/skills/interview-me/SKILL.md +226 -0
- package/.versions/2.0.21/skills/orchestration-verification/SKILL.md +182 -0
- package/.versions/2.0.21/skills/peer-coms/SKILL.md +90 -0
- package/.versions/2.0.21/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.0.21/skills/planning-and-task-breakdown/SKILL.md +318 -0
- package/.versions/2.0.21/skills/planning-and-task-breakdown.zip +0 -0
- package/.versions/2.0.21/skills/repository-ai-setup/SKILL.md +135 -0
- package/.versions/2.0.21/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
- package/.versions/2.0.21/skills/repository-ai-setup/references/apply-contract.md +74 -0
- package/.versions/2.0.21/skills/repository-ai-setup/references/provenance-template.md +16 -0
- package/.versions/2.0.21/skills/repository-ai-setup/references/setup-flow.md +108 -0
- package/.versions/2.0.21/skills/repository-ai-setup/references/verify-setup.md +20 -0
- package/.versions/2.0.21/skills/repository-ai-setup.zip +0 -0
- package/.versions/2.0.21/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.0.21/skills/spec-driven-development/SKILL.md +295 -0
- package/.versions/2.0.21/skills/spec-driven-development.zip +0 -0
- package/.versions/2.0.21/skills/using-agent-skills/SKILL.md +198 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/README.md +430 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
- package/.versions/2.0.21/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
- package/CHANGELOG.md +6 -0
- package/docs/ARCHITECTURE.md +4 -2
- package/install-manifest.json +1 -1
- package/package.json +1 -1
|
@@ -1034,8 +1034,9 @@ under `~/.pi/coms/projects/<project>/agents/<name>.json` and is created at runti
|
|
|
1034
1034
|
minimal diffs on the project's `rules:`/`docs:` targets per `skills/compound-learning/SKILL.md`.
|
|
1035
1035
|
Requires the `documenter` persona in the active team; run it before `/af-handoff` or session end.
|
|
1036
1036
|
- `coms_list` — discover the peers in your pool: names, models, live context usage, purpose,
|
|
1037
|
-
`pane_id`, and `status` (`idle` | `working` | `booting`).
|
|
1038
|
-
|
|
1037
|
+
`pane_id`, waiting-only `queue_depth`, and `status` (`idle` | `queued` | `working` | `booting`).
|
|
1038
|
+
Check status before sending: `working` means the peer has an active turn, `queued` means accepted
|
|
1039
|
+
work is waiting to start, and `booting` means it is not addressable yet.
|
|
1039
1040
|
This is the field whose absence drove 127 `herdr_read_pane` calls in one session. Scoped
|
|
1040
1041
|
to your project and excluding private peers; the LLM cannot widen it (see
|
|
1041
1042
|
[Pool scope is the reach boundary](#pool-scope-is-the-reach-boundary)).
|
|
@@ -164,7 +164,7 @@ import { createCompletionPresentation } from "./input/completions.ts";
|
|
|
164
164
|
import { createResearchControls } from "./research/controls.ts";
|
|
165
165
|
import { currentPiRuntimeVersion } from "./context-continuity-compat.ts";
|
|
166
166
|
import { createContextPressureLifecycle, createContextPressureRootState } from "./lifecycle/context-pressure.ts";
|
|
167
|
-
import { createTurnLifecycleHandlers, registerTurnPresence } from "./lifecycle/turn-handlers.ts";
|
|
167
|
+
import { createTurnLifecycleHandlers, registerTurnPresence, registerTurnSettlement } from "./lifecycle/turn-handlers.ts";
|
|
168
168
|
import { createMonitorSession } from "./lifecycle/monitor-session.ts";
|
|
169
169
|
import { applySessionOverrides, registerSessionOrchestration, resetHubSession } from "./lifecycle/session-orchestration.ts";
|
|
170
170
|
import { openZoom, type TimelineEntry, type Zoomable } from "./ui/zoom.ts";
|
|
@@ -2038,7 +2038,6 @@ export default function (pi: ExtensionAPI) {
|
|
|
2038
2038
|
// Root owns subscription order; lifecycle modules own handler bodies.
|
|
2039
2039
|
registerTurnPresence(pi, {
|
|
2040
2040
|
beforeAgentPresence: () => turnHandlers.beforeAgentPresence(),
|
|
2041
|
-
agentEndPresence: () => turnHandlers.agentEndPresence(),
|
|
2042
2041
|
});
|
|
2043
2042
|
|
|
2044
2043
|
// /af-handoff <peer> — hand the session off to a coms peer. Per decision G1 we do NOT
|
|
@@ -2195,7 +2194,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
2195
2194
|
},
|
|
2196
2195
|
updateModeStatus, buildPrompt: buildHubSystemPrompt, endHistoryTurn: at => executionHistory.endTurn(at),
|
|
2197
2196
|
unaddressedPeerWarning: () => unaddressedPeerSweep(Array.from(hubSpawnedPeers.values()))?.message ?? null,
|
|
2198
|
-
|
|
2197
|
+
settlePeerTurn: ctx => coms.settleTurn(ctx, { dispatchQueued: false }),
|
|
2198
|
+
settlePressure: ctx => pressureLifecycle.agentSettled(ctx),
|
|
2199
|
+
dispatchQueuedPeerTurn: () => coms.dispatchQueued(),
|
|
2199
2200
|
});
|
|
2200
2201
|
pi.on("before_agent_start", async () => {
|
|
2201
2202
|
if (taskTriageTestTransportActive && process.env.AGENT_HUB_TASK_TRIAGE_FAKE_STATE_RECORD) {
|
|
@@ -2275,7 +2276,6 @@ export default function (pi: ExtensionAPI) {
|
|
|
2275
2276
|
if (text) { proactiveHubDeliveries++; return { messages: [...projection.messages, { role: "custom" as const, customType: "agent-fleet.proactive-advisory", content: text, display: false, timestamp: Date.now() }] }; }
|
|
2276
2277
|
if(projection.projected)return {messages:projection.messages};
|
|
2277
2278
|
});
|
|
2278
|
-
pi.on("agent_settled", async (_event, ctx) => pressureLifecycle.agentSettled(ctx));
|
|
2279
2279
|
pi.on("session_compact", async (_event, ctx) => {
|
|
2280
2280
|
noProgress.compact(ctx.sessionManager.getEntries());
|
|
2281
2281
|
if (!processPersistenceBlocked) persistProcessVerdict(processState, evaluateProcessObligations(processState, { writable: true, budgetTier: taskTier ?? DEFAULT_TASK_TIER }));
|
|
@@ -2605,10 +2605,12 @@ export default function (pi: ExtensionAPI) {
|
|
|
2605
2605
|
},
|
|
2606
2606
|
});
|
|
2607
2607
|
|
|
2608
|
-
// Ordered end-turn peer response remains after session-start registration.
|
|
2609
2608
|
pi.on("agent_end", async (_event, ctx) => {
|
|
2610
2609
|
toolCatalogRuntime.endTurn();
|
|
2611
2610
|
await turnHandlers.agentEnd(ctx);
|
|
2612
2611
|
});
|
|
2612
|
+
registerTurnSettlement(pi, {
|
|
2613
|
+
agentSettled: ctx => turnHandlers.agentSettled(ctx),
|
|
2614
|
+
});
|
|
2613
2615
|
|
|
2614
2616
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
|
|
2
2
|
|
|
3
3
|
export interface TurnLifecyclePorts {
|
|
4
|
-
setTurnState(state: "working" | "idle"):
|
|
4
|
+
setTurnState(state: "working" | "idle"): void;
|
|
5
5
|
startMonitorTurn(): void;
|
|
6
6
|
finishMonitorTurn(): void;
|
|
7
7
|
startAskUser(id: string): void;
|
|
@@ -17,16 +17,18 @@ export interface TurnLifecyclePorts {
|
|
|
17
17
|
buildPrompt(): { systemPrompt: string };
|
|
18
18
|
endHistoryTurn(now: number): void;
|
|
19
19
|
unaddressedPeerWarning(): string | null;
|
|
20
|
-
|
|
20
|
+
settlePeerTurn(ctx: ExtensionContext): Promise<void>;
|
|
21
|
+
settlePressure(ctx: ExtensionContext): Promise<void>;
|
|
22
|
+
dispatchQueuedPeerTurn(): void;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
export interface TurnLifecycleHandlers {
|
|
24
|
-
beforeAgentPresence():
|
|
25
|
-
agentEndPresence(): Promise<void>;
|
|
26
|
+
beforeAgentPresence(): void;
|
|
26
27
|
toolStart(event: any): void;
|
|
27
28
|
toolEnd(event: any): void;
|
|
28
29
|
beforeAgentStart(): { systemPrompt: string };
|
|
29
30
|
agentEnd(ctx: ExtensionContext): Promise<void>;
|
|
31
|
+
agentSettled(ctx: ExtensionContext): Promise<void>;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
export function createTurnLifecycleHandlers(ports: TurnLifecyclePorts): TurnLifecycleHandlers {
|
|
@@ -40,8 +42,7 @@ export function createTurnLifecycleHandlers(ports: TurnLifecyclePorts): TurnLife
|
|
|
40
42
|
ports.updateModeStatus();
|
|
41
43
|
};
|
|
42
44
|
return {
|
|
43
|
-
|
|
44
|
-
async agentEndPresence() { await ports.setTurnState("idle"); ports.finishMonitorTurn(); },
|
|
45
|
+
beforeAgentPresence() { ports.setTurnState("working"); ports.finishMonitorTurn(); ports.startMonitorTurn(); },
|
|
45
46
|
toolStart(event) {
|
|
46
47
|
if (event.toolName !== "ask_user") return;
|
|
47
48
|
ports.startAskUser(event.toolCallId);
|
|
@@ -59,16 +60,31 @@ export function createTurnLifecycleHandlers(ports: TurnLifecyclePorts): TurnLife
|
|
|
59
60
|
ports.endHistoryTurn(endedAt);
|
|
60
61
|
const warning = ports.unaddressedPeerWarning();
|
|
61
62
|
if (warning) ctx.ui.notify(warning, "warning");
|
|
62
|
-
|
|
63
|
+
},
|
|
64
|
+
async agentSettled(ctx) {
|
|
65
|
+
ports.finishMonitorTurn();
|
|
66
|
+
await ports.settlePeerTurn(ctx);
|
|
67
|
+
try {
|
|
68
|
+
await ports.settlePressure(ctx);
|
|
69
|
+
} finally {
|
|
70
|
+
ports.dispatchQueuedPeerTurn();
|
|
71
|
+
}
|
|
63
72
|
},
|
|
64
73
|
};
|
|
65
74
|
}
|
|
66
75
|
|
|
67
76
|
/** Custom coms messages skip before_agent_start, but every run emits agent_start. */
|
|
68
77
|
export function registerTurnPresence(
|
|
69
|
-
events: {on(event:
|
|
70
|
-
handlers: Pick<TurnLifecycleHandlers, "beforeAgentPresence"
|
|
78
|
+
events: {on(event: any, handler: (...args: any[]) => unknown): unknown},
|
|
79
|
+
handlers: Pick<TurnLifecycleHandlers, "beforeAgentPresence">,
|
|
71
80
|
): void {
|
|
72
81
|
events.on("agent_start", () => handlers.beforeAgentPresence());
|
|
73
|
-
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Register after recovery handlers so queued peer work starts only after settlement work completes. */
|
|
85
|
+
export function registerTurnSettlement(
|
|
86
|
+
events: {on(event: any, handler: (...args: any[]) => unknown): unknown},
|
|
87
|
+
handlers: Pick<TurnLifecycleHandlers, "agentSettled">,
|
|
88
|
+
): void {
|
|
89
|
+
events.on("agent_settled", (_event, ctx: ExtensionContext) => handlers.agentSettled(ctx));
|
|
74
90
|
}
|
|
@@ -128,9 +128,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
128
128
|
label: "Coms List",
|
|
129
129
|
description:
|
|
130
130
|
"List the peer agents in your current coms pool — the ones shown in the pool widget. Returns " +
|
|
131
|
-
"names, models, live context-window usage, the herdr pane_id,
|
|
132
|
-
"booting). CHECK STATUS BEFORE SENDING: `working` means the peer
|
|
133
|
-
"
|
|
131
|
+
"names, models, live context-window usage, the herdr pane_id, waiting queue depth, and status " +
|
|
132
|
+
"(idle | queued | working | booting). CHECK STATUS BEFORE SENDING: `working` means the peer " +
|
|
133
|
+
"is mid-turn; `queued` means accepted work is waiting to start; `booting` means it registered " +
|
|
134
|
+
"but is not addressable yet. Use this instead " +
|
|
134
135
|
"of reading the peer's pane to guess whether it is busy. Discovery is scoped to what the human " +
|
|
135
136
|
"displays via /af-coms; you CANNOT widen it to other projects or reveal --explicit peers yourself.",
|
|
136
137
|
parameters: Type.Object({
|
|
@@ -149,8 +150,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
149
150
|
? "No peer agents in your pool."
|
|
150
151
|
: result.agents.map(agent => {
|
|
151
152
|
const context = agent.context_used_pct != null ? ` ${agent.context_used_pct}%` : " ?%";
|
|
152
|
-
const
|
|
153
|
-
|
|
153
|
+
const status = agent.status ?? (agent.alive ? "unknown" : "unreachable");
|
|
154
|
+
const state = ` [${status}${agent.pane_id ? ` pane ${agent.pane_id}` : ""}]`;
|
|
155
|
+
const marker = status === "booting" ? "◌" : agent.alive ? "●" : "✗";
|
|
156
|
+
return `${marker} ${agent.name} (${agent.model})${context}${state}${agent.purpose ? ` — ${agent.purpose}` : ""}`;
|
|
154
157
|
}).join("\n");
|
|
155
158
|
return { content: [{ type: "text" as const, text: `${result.agents.length} peer(s) in pool (project ${result.project}):\n${lines}${notice}` }], details: result };
|
|
156
159
|
},
|
|
@@ -163,10 +166,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
163
166
|
const header = theme.fg("accent", `📡 ${agents.length} peer(s)`);
|
|
164
167
|
if (!options.expanded || agents.length === 0) return new Text(header, 0, 0);
|
|
165
168
|
const rows = agents.map(agent => {
|
|
166
|
-
const
|
|
169
|
+
const state = agent.status ?? (agent.alive ? "unknown" : "unreachable");
|
|
170
|
+
const dot = state === "booting" ? theme.fg("warning", "◌") : agent.alive ? theme.fg("success", "●") : theme.fg("error", "✗");
|
|
167
171
|
const percent = agent.context_used_pct != null ? `${agent.context_used_pct}%` : "?%";
|
|
168
|
-
const
|
|
169
|
-
const stateColor = state === "idle" ? "success" : state === "working" ? "warning" : "dim";
|
|
172
|
+
const stateColor = state === "idle" ? "success" : state === "working" || state === "queued" || state === "booting" ? "warning" : "dim";
|
|
170
173
|
return `${dot} ${theme.fg("accent", agent.name)} ${theme.fg("dim", agent.model)} ${theme.fg("warning", percent)} ` +
|
|
171
174
|
`${theme.fg(stateColor as any, state)}${agent.pane_id ? theme.fg("dim", ` ${agent.pane_id}`) : ""}`;
|
|
172
175
|
}).join("\n");
|
|
@@ -274,8 +277,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
274
277
|
ctx.ui.notify(`📡 coms ready · ${identity.name}@${identity.project} · ${peer.scope.displayProject ?? identity.project} pool`, "info");
|
|
275
278
|
} catch { /* UI is optional */ }
|
|
276
279
|
});
|
|
277
|
-
pi.on("
|
|
278
|
-
pi.on("
|
|
280
|
+
pi.on("agent_start", () => { peer.setTurnState("working"); });
|
|
281
|
+
pi.on("agent_settled", async (_event, ctx) => { await peer.settleTurn(ctx); });
|
|
279
282
|
pi.on("session_shutdown", async () => { unregisterQuestions(); await peer.shutdown(); if (currentCtx?.hasUI) currentCtx.ui.setWidget("coms-pool", undefined); });
|
|
280
283
|
process.on("SIGINT", () => { void peer.shutdown(); });
|
|
281
284
|
process.on("SIGTERM", () => { void peer.shutdown(); });
|
|
@@ -20,9 +20,31 @@ const FALLBACK_PALETTE = [
|
|
|
20
20
|
];
|
|
21
21
|
|
|
22
22
|
export type RegistryEntry = ComsRegistryEntry;
|
|
23
|
-
export type
|
|
23
|
+
export type ComsTurnState = "idle" | "working";
|
|
24
|
+
export type PeerStatus = "idle" | "queued" | "working" | "booting";
|
|
24
25
|
export type EnvelopeType = "prompt" | "response" | "ping";
|
|
25
26
|
|
|
27
|
+
export function derivePeerStatus(
|
|
28
|
+
turnState: ComsTurnState,
|
|
29
|
+
waitingDepth: number,
|
|
30
|
+
hasCurrentInbound: boolean,
|
|
31
|
+
): PeerStatus {
|
|
32
|
+
if (turnState === "working") return "working";
|
|
33
|
+
return hasCurrentInbound || waitingDepth > 0 ? "queued" : "idle";
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function nextInboundForDispatch<T extends { fulfilled: boolean }>(
|
|
37
|
+
entries: Iterable<T>,
|
|
38
|
+
turnState: ComsTurnState,
|
|
39
|
+
hasCurrentInbound: boolean,
|
|
40
|
+
): T | null {
|
|
41
|
+
if (turnState !== "idle" || hasCurrentInbound) return null;
|
|
42
|
+
for (const entry of entries) {
|
|
43
|
+
if (!entry.fulfilled) return entry;
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
|
|
26
48
|
export interface Envelope {
|
|
27
49
|
type: EnvelopeType;
|
|
28
50
|
msg_id: string;
|
|
@@ -76,7 +98,9 @@ export interface PendingReply {
|
|
|
76
98
|
timer: NodeJS.Timeout | null;
|
|
77
99
|
promise: Promise<{ response?: any; error?: string | null }>;
|
|
78
100
|
result?: { response?: any; error?: string | null };
|
|
79
|
-
target_name
|
|
101
|
+
target_name: string;
|
|
102
|
+
target_session: string;
|
|
103
|
+
target_endpoint: string;
|
|
80
104
|
created_at: string;
|
|
81
105
|
}
|
|
82
106
|
|
|
@@ -85,6 +109,9 @@ export interface InboundContext {
|
|
|
85
109
|
hops: number;
|
|
86
110
|
sender_endpoint: string;
|
|
87
111
|
sender_session: string;
|
|
112
|
+
sender_name: string;
|
|
113
|
+
sender_cwd: string;
|
|
114
|
+
prompt: string;
|
|
88
115
|
response_schema?: object | null;
|
|
89
116
|
fulfilled: boolean;
|
|
90
117
|
}
|
|
@@ -20,10 +20,12 @@ import {
|
|
|
20
20
|
PING_INTERVAL_MS,
|
|
21
21
|
TIMEOUT_MS,
|
|
22
22
|
bindEndpoint,
|
|
23
|
+
derivePeerStatus,
|
|
23
24
|
fallbackColor,
|
|
24
25
|
isValidHex,
|
|
25
26
|
listProjects,
|
|
26
27
|
makeEndpoint,
|
|
28
|
+
nextInboundForDispatch,
|
|
27
29
|
nowIso,
|
|
28
30
|
projectAgentsDir,
|
|
29
31
|
pruneDeadEntries,
|
|
@@ -37,6 +39,7 @@ import {
|
|
|
37
39
|
writeRegistryAtomic,
|
|
38
40
|
type AgentCard,
|
|
39
41
|
type ComsIdentity,
|
|
42
|
+
type ComsTurnState,
|
|
40
43
|
type InboundContext,
|
|
41
44
|
type PendingReply,
|
|
42
45
|
type PeerStatus,
|
|
@@ -129,7 +132,8 @@ export function createComsPeer(deps: CreateComsPeerDeps) {
|
|
|
129
132
|
let keepaliveTimer: NodeJS.Timeout | null = null;
|
|
130
133
|
let herdrPresence: HerdrPresence | null = null;
|
|
131
134
|
let herdrWatch: HerdrAgentWatch | null = null;
|
|
132
|
-
let turnState:
|
|
135
|
+
let turnState: ComsTurnState = "idle";
|
|
136
|
+
let dispatchPaused = false;
|
|
133
137
|
let shuttingDown = false;
|
|
134
138
|
|
|
135
139
|
const changed = () => deps.onPeersChanged?.();
|
|
@@ -184,6 +188,18 @@ export function createComsPeer(deps: CreateComsPeerDeps) {
|
|
|
184
188
|
if (didChange) changed();
|
|
185
189
|
}
|
|
186
190
|
|
|
191
|
+
function waitingInboundCount(): number {
|
|
192
|
+
let count = 0;
|
|
193
|
+
for (const queued of inboundQueue.values()) {
|
|
194
|
+
if (!queued.fulfilled && queued !== currentInbound) count += 1;
|
|
195
|
+
}
|
|
196
|
+
return count;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function peerStatus(): PeerStatus {
|
|
200
|
+
return derivePeerStatus(turnState, waitingInboundCount(), currentInbound !== null);
|
|
201
|
+
}
|
|
202
|
+
|
|
187
203
|
function handlePrompt(socket: net.Socket, envelope: PromptEnvelope): void {
|
|
188
204
|
const refusal = deps.acceptInbound?.();
|
|
189
205
|
if (refusal) { nack(socket, envelope.msg_id, refusal); return; }
|
|
@@ -196,31 +212,62 @@ export function createComsPeer(deps: CreateComsPeerDeps) {
|
|
|
196
212
|
hops: envelope.hops,
|
|
197
213
|
sender_endpoint: envelope.sender_endpoint,
|
|
198
214
|
sender_session: envelope.sender_session,
|
|
215
|
+
sender_name: envelope.sender_name,
|
|
216
|
+
sender_cwd: envelope.sender_cwd,
|
|
217
|
+
prompt: envelope.prompt,
|
|
199
218
|
response_schema: envelope.response_schema ?? null,
|
|
200
219
|
fulfilled: false,
|
|
201
220
|
};
|
|
202
221
|
inboundQueue.set(envelope.msg_id, inbound);
|
|
222
|
+
ack(socket, envelope.msg_id);
|
|
223
|
+
audit({ event: "inbound_prompt", msg_id: envelope.msg_id, sender: envelope.sender_session, hops: envelope.hops });
|
|
224
|
+
dispatchNextInbound();
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function dispatchNextInbound(): void {
|
|
228
|
+
if (dispatchPaused) return;
|
|
229
|
+
const inbound = nextInboundForDispatch(inboundQueue.values(), turnState, currentInbound !== null);
|
|
230
|
+
if (!inbound) return;
|
|
203
231
|
currentInbound = inbound;
|
|
204
232
|
try {
|
|
205
233
|
pi.sendMessage({
|
|
206
234
|
customType: "coms-inbound",
|
|
207
|
-
content: `[from ${
|
|
235
|
+
content: `[from ${inbound.sender_name} @ ${inbound.sender_cwd}]\n\n${inbound.prompt}`,
|
|
208
236
|
display: true,
|
|
209
|
-
details: { msg_id:
|
|
237
|
+
details: { msg_id: inbound.msg_id, sender_session: inbound.sender_session, response_schema: inbound.response_schema ?? null },
|
|
210
238
|
}, { deliverAs: "followUp", triggerTurn: true });
|
|
211
|
-
} catch {
|
|
212
|
-
|
|
239
|
+
} catch (error: any) {
|
|
240
|
+
const reason = error?.message ?? String(error);
|
|
241
|
+
inbound.fulfilled = true;
|
|
242
|
+
inboundQueue.delete(inbound.msg_id);
|
|
213
243
|
currentInbound = null;
|
|
214
|
-
|
|
215
|
-
|
|
244
|
+
audit({ event: "inbound_delivery_failed", msg_id: inbound.msg_id, reason });
|
|
245
|
+
if (identity) {
|
|
246
|
+
void sendEnvelope(inbound.sender_endpoint, {
|
|
247
|
+
type: "response", msg_id: inbound.msg_id, sender_session: identity.session_id,
|
|
248
|
+
sender_endpoint: identity.endpoint, hops: 0, timestamp: nowIso(), response: null,
|
|
249
|
+
error: "peer agent could not start the queued turn",
|
|
250
|
+
} as ResponseEnvelope).catch((sendError: any) => {
|
|
251
|
+
audit({ event: "inbound_delivery_error_response_failed", msg_id: inbound.msg_id, reason: sendError?.message ?? String(sendError) });
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
dispatchNextInbound();
|
|
216
255
|
}
|
|
217
|
-
ack(socket, envelope.msg_id);
|
|
218
|
-
audit({ event: "inbound_prompt", msg_id: envelope.msg_id, sender: envelope.sender_session, hops: envelope.hops });
|
|
219
256
|
}
|
|
220
257
|
|
|
221
258
|
function handleResponse(socket: net.Socket, envelope: ResponseEnvelope): void {
|
|
222
259
|
const pending = pendingReplies.get(envelope.msg_id);
|
|
223
260
|
if (pending) {
|
|
261
|
+
if (envelope.sender_session !== pending.target_session || envelope.sender_endpoint !== pending.target_endpoint) {
|
|
262
|
+
audit({
|
|
263
|
+
event: "mismatched_response",
|
|
264
|
+
msg_id: envelope.msg_id,
|
|
265
|
+
expected_session: pending.target_session,
|
|
266
|
+
actual_session: envelope.sender_session,
|
|
267
|
+
});
|
|
268
|
+
nack(socket, envelope.msg_id, "response sender mismatch");
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
224
271
|
if (pending.timer) { try { clearTimeout(pending.timer); } catch { /* ignore */ } pending.timer = null; }
|
|
225
272
|
pending.result = { response: envelope.response, error: envelope.error ?? null };
|
|
226
273
|
try { pending.resolve(pending.result); } catch { /* ignore */ }
|
|
@@ -239,9 +286,9 @@ export function createComsPeer(deps: CreateComsPeerDeps) {
|
|
|
239
286
|
color: identity?.color ?? "#36F9F6",
|
|
240
287
|
context_used_pct: ctx?.getContextUsage()?.percent ?? null,
|
|
241
288
|
context_measurement: ctx?.getContextUsage()?.percent == null ? "unknown" : "measured",
|
|
242
|
-
queue_depth:
|
|
289
|
+
queue_depth: waitingInboundCount(),
|
|
243
290
|
pane_id: herdrPaneId() ?? null,
|
|
244
|
-
status:
|
|
291
|
+
status: peerStatus(),
|
|
245
292
|
};
|
|
246
293
|
try { socket.write(`${JSON.stringify({ type: "pong", msg_id: envelope.msg_id, agent_card: card })}\n`); } catch { /* ignore */ }
|
|
247
294
|
try { socket.end(); } catch { /* ignore */ }
|
|
@@ -288,7 +335,7 @@ export function createComsPeer(deps: CreateComsPeerDeps) {
|
|
|
288
335
|
try {
|
|
289
336
|
writeRegistryAtomic(buildLiveRegistryEntry(identity, {
|
|
290
337
|
now: nowIso(), pid: process.pid, model: ctx?.model?.id,
|
|
291
|
-
contextUsedPct: ctx?.getContextUsage()?.percent, queueDepth:
|
|
338
|
+
contextUsedPct: ctx?.getContextUsage()?.percent, queueDepth: waitingInboundCount(),
|
|
292
339
|
}), identity.project);
|
|
293
340
|
} catch { /* best effort */ }
|
|
294
341
|
}
|
|
@@ -411,7 +458,7 @@ export function createComsPeer(deps: CreateComsPeerDeps) {
|
|
|
411
458
|
if (herdrPresence) {
|
|
412
459
|
void herdrPresence.report(turnState, {
|
|
413
460
|
name: identity.name, project: identity.project,
|
|
414
|
-
contextUsedPct: Math.round(deps.getContext()?.getContextUsage()?.percent ?? 0), queueDepth:
|
|
461
|
+
contextUsedPct: Math.round(deps.getContext()?.getContextUsage()?.percent ?? 0), queueDepth: waitingInboundCount(),
|
|
415
462
|
});
|
|
416
463
|
}
|
|
417
464
|
if (herdrWatch) herdrSyncPeerCards(herdrWatch.current());
|
|
@@ -448,7 +495,7 @@ export function createComsPeer(deps: CreateComsPeerDeps) {
|
|
|
448
495
|
name: item.entry.name, session_id: item.entry.session_id, purpose: item.entry.purpose,
|
|
449
496
|
model: item.entry.model, cwd: item.entry.cwd, project: item.project, alive: pong !== null,
|
|
450
497
|
context_used_pct: pong?.context_used_pct ?? null, pane_id: pong?.pane_id ?? null,
|
|
451
|
-
status: pong?.status ??
|
|
498
|
+
status: pong?.status ?? "booting", queue_depth: pong?.queue_depth ?? null, color: item.entry.color,
|
|
452
499
|
};
|
|
453
500
|
});
|
|
454
501
|
return { agents, project: scopeProject, scoped: true, widenRequested: widened };
|
|
@@ -464,16 +511,30 @@ export function createComsPeer(deps: CreateComsPeerDeps) {
|
|
|
464
511
|
const hops = currentInbound ? currentInbound.hops + 1 : 0;
|
|
465
512
|
if (hops >= MAX_HOPS) throw new Error(`coms: hop limit reached (${hops} >= ${MAX_HOPS})`);
|
|
466
513
|
const msgId = ulid();
|
|
467
|
-
await sendEnvelope(target.endpoint, {
|
|
468
|
-
type: "prompt", msg_id: msgId, sender_session: identity.session_id, sender_endpoint: identity.endpoint,
|
|
469
|
-
sender_name: identity.name, sender_cwd: identity.cwd, hops, timestamp: nowIso(), prompt: params.prompt,
|
|
470
|
-
conversation_id: params.conversation_id ?? null, response_schema: params.response_schema ?? null,
|
|
471
|
-
reply_timeout_ms: params.reply_timeout_ms ?? null,
|
|
472
|
-
} as PromptEnvelope);
|
|
473
514
|
let resolve!: PendingReply["resolve"];
|
|
474
515
|
let reject!: PendingReply["reject"];
|
|
475
516
|
const promise = new Promise<{ response?: any; error?: string | null }>((res, rej) => { resolve = res; reject = rej; });
|
|
476
|
-
pendingReplies.set(msgId, {
|
|
517
|
+
pendingReplies.set(msgId, {
|
|
518
|
+
resolve,
|
|
519
|
+
reject,
|
|
520
|
+
timer: null,
|
|
521
|
+
promise,
|
|
522
|
+
target_name: target.name,
|
|
523
|
+
target_session: target.session_id,
|
|
524
|
+
target_endpoint: target.endpoint,
|
|
525
|
+
created_at: nowIso(),
|
|
526
|
+
});
|
|
527
|
+
try {
|
|
528
|
+
await sendEnvelope(target.endpoint, {
|
|
529
|
+
type: "prompt", msg_id: msgId, sender_session: identity.session_id, sender_endpoint: identity.endpoint,
|
|
530
|
+
sender_name: identity.name, sender_cwd: identity.cwd, hops, timestamp: nowIso(), prompt: params.prompt,
|
|
531
|
+
conversation_id: params.conversation_id ?? null, response_schema: params.response_schema ?? null,
|
|
532
|
+
reply_timeout_ms: params.reply_timeout_ms ?? null,
|
|
533
|
+
} as PromptEnvelope);
|
|
534
|
+
} catch (error) {
|
|
535
|
+
pendingReplies.delete(msgId);
|
|
536
|
+
throw error;
|
|
537
|
+
}
|
|
477
538
|
audit({ event: "outbound_prompt", msg_id: msgId, target: target.name, hops, ...auditExtra });
|
|
478
539
|
return { msg_id: msgId, target: target.name, target_session: target.session_id, hops, promise };
|
|
479
540
|
}
|
|
@@ -498,22 +559,45 @@ export function createComsPeer(deps: CreateComsPeerDeps) {
|
|
|
498
559
|
return { status: "complete", response: "response" in result ? result.response : undefined };
|
|
499
560
|
}
|
|
500
561
|
|
|
501
|
-
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
let
|
|
505
|
-
|
|
506
|
-
if (entry
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
: Array.isArray(message.content) ? message.content.filter((block: any) => block?.type === "text").map((block: any) => block.text).join("\n") : text;
|
|
562
|
+
function responseForInbound(ctx: ExtensionContext, inbound: InboundContext): { response: any; error: string | null } {
|
|
563
|
+
const branch = ctx.sessionManager.getBranch();
|
|
564
|
+
let markerIndex = -1;
|
|
565
|
+
for (let index = branch.length - 1; index >= 0; index -= 1) {
|
|
566
|
+
const entry = branch[index] as any;
|
|
567
|
+
if (entry?.type === "custom_message" && entry?.customType === "coms-inbound" && entry?.details?.msg_id === inbound.msg_id) {
|
|
568
|
+
markerIndex = index;
|
|
569
|
+
break;
|
|
570
|
+
}
|
|
511
571
|
}
|
|
512
|
-
|
|
513
|
-
|
|
572
|
+
if (markerIndex < 0) return { response: null, error: "peer agent ended without a successful final answer" };
|
|
573
|
+
|
|
574
|
+
let message: any = null;
|
|
575
|
+
for (let index = branch.length - 1; index > markerIndex; index -= 1) {
|
|
576
|
+
const candidate = branch[index] as any;
|
|
577
|
+
if (candidate?.type === "message" && candidate?.message?.role === "assistant") {
|
|
578
|
+
message = candidate.message;
|
|
579
|
+
break;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
if (!message || message.stopReason !== "stop") {
|
|
583
|
+
return { response: null, error: "peer agent ended without a successful final answer" };
|
|
584
|
+
}
|
|
585
|
+
const text = typeof message.content === "string"
|
|
586
|
+
? message.content
|
|
587
|
+
: Array.isArray(message.content)
|
|
588
|
+
? message.content.filter((block: any) => block?.type === "text").map((block: any) => block.text).join("\n")
|
|
589
|
+
: "";
|
|
590
|
+
if (!text.trim()) return { response: null, error: "peer agent produced an empty final answer" };
|
|
514
591
|
if (inbound.response_schema && typeof inbound.response_schema === "object") {
|
|
515
|
-
try { response
|
|
592
|
+
try { return { response: JSON.parse(text), error: null }; }
|
|
593
|
+
catch { return { response: null, error: "response not valid JSON" }; }
|
|
516
594
|
}
|
|
595
|
+
return { response: text, error: null };
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
async function respond(ctx: ExtensionContext, inbound = currentInbound): Promise<void> {
|
|
599
|
+
if (!inbound || !identity || inbound.fulfilled) return;
|
|
600
|
+
const { response, error } = responseForInbound(ctx, inbound);
|
|
517
601
|
try {
|
|
518
602
|
await sendEnvelope(inbound.sender_endpoint, {
|
|
519
603
|
type: "response", msg_id: inbound.msg_id, sender_session: identity.session_id,
|
|
@@ -525,16 +609,34 @@ export function createComsPeer(deps: CreateComsPeerDeps) {
|
|
|
525
609
|
}
|
|
526
610
|
inbound.fulfilled = true;
|
|
527
611
|
inboundQueue.delete(inbound.msg_id);
|
|
528
|
-
if (currentInbound
|
|
612
|
+
if (currentInbound === inbound) currentInbound = null;
|
|
529
613
|
}
|
|
530
614
|
|
|
531
|
-
|
|
615
|
+
function setTurnState(state: ComsTurnState): void {
|
|
532
616
|
turnState = state;
|
|
533
|
-
if (
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
617
|
+
if (herdrPresence && identity) {
|
|
618
|
+
void herdrPresence.report(state, {
|
|
619
|
+
name: identity.name, project: identity.project,
|
|
620
|
+
contextUsedPct: Math.round(deps.getContext()?.getContextUsage()?.percent ?? 0), queueDepth: waitingInboundCount(),
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
async function settleTurn(
|
|
626
|
+
ctx: ExtensionContext,
|
|
627
|
+
options: { dispatchQueued?: boolean } = {},
|
|
628
|
+
): Promise<void> {
|
|
629
|
+
const shouldDispatchQueued = options.dispatchQueued !== false;
|
|
630
|
+
dispatchPaused = !shouldDispatchQueued;
|
|
631
|
+
turnState = "idle";
|
|
632
|
+
const settledInbound = currentInbound;
|
|
633
|
+
if (settledInbound) await respond(ctx, settledInbound);
|
|
634
|
+
if (shouldDispatchQueued) dispatchNextInbound();
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
function dispatchQueued(): void {
|
|
638
|
+
dispatchPaused = false;
|
|
639
|
+
dispatchNextInbound();
|
|
538
640
|
}
|
|
539
641
|
|
|
540
642
|
async function updateScope(args: string, ctx?: ExtensionContext): Promise<void> {
|
|
@@ -567,7 +669,7 @@ export function createComsPeer(deps: CreateComsPeerDeps) {
|
|
|
567
669
|
}
|
|
568
670
|
|
|
569
671
|
return {
|
|
570
|
-
connect, send, list, get, await: awaitReply, refresh, respond, shutdown,
|
|
672
|
+
connect, send, list, get, await: awaitReply, refresh, respond, settleTurn, dispatchQueued, shutdown,
|
|
571
673
|
setTurnState, updateScope, writeLiveRegistry, ping, peersInScope, resolveTarget,
|
|
572
674
|
peerCards, pendingReplies, inboundQueue, scope,
|
|
573
675
|
get identity() { return identity; },
|