@chankov/agent-fleet 2.0.7 → 2.0.8
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/{hermes → .pi/agent-fleet/hermes}/README.md +7 -7
- package/{hermes → .pi/agent-fleet/hermes}/plugins/agent-fleet-herdr/dashboard/activity.py +2 -2
- package/{hermes → .pi/agent-fleet/hermes}/plugins/agent-fleet-herdr/dashboard/coms_registry.py +2 -2
- package/{hermes → .pi/agent-fleet/hermes}/plugins/agent-fleet-herdr/dashboard/coms_send.py +1 -1
- package/{hermes → .pi/agent-fleet/hermes}/plugins/agent-fleet-herdr/dashboard/watch.py +2 -2
- package/{hermes → .pi/agent-fleet/hermes}/skills/hub-conductor/SKILL.md +1 -1
- package/{hermes → .pi/agent-fleet/hermes}/skills/hub-watchdog/SKILL.md +3 -3
- package/{hooks → .pi/agent-fleet/hooks}/coms-stop-hook.mjs +2 -2
- package/{scripts → .pi/agent-fleet/scripts}/claude-code-preflight.ts +1 -1
- package/{scripts → .pi/agent-fleet/scripts}/coms-claude-bridge.ts +6 -6
- package/{scripts → .pi/agent-fleet/scripts}/coms-cli.ts +1 -1
- package/{scripts → .pi/agent-fleet/scripts}/coms-hermes-bridge.ts +1 -1
- package/{scripts → .pi/agent-fleet/scripts}/fleet-codex-read.py +5 -3
- package/{scripts → .pi/agent-fleet/scripts}/fleet.ts +1 -1
- package/{scripts → .pi/agent-fleet/scripts}/flow.ts +1 -1
- package/{scripts → .pi/agent-fleet/scripts}/lib/claude-bridge-core.ts +2 -2
- package/{scripts → .pi/agent-fleet/scripts}/lib/coms-envelope.ts +1 -1
- package/{scripts → .pi/agent-fleet/scripts}/lib/fleet-codex-transport.ts +1 -1
- package/{scripts → .pi/agent-fleet/scripts}/lib/herdr-layout.ts +3 -3
- package/{scripts → .pi/agent-fleet/scripts}/lib/hermes-bridge-core.ts +1 -1
- package/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/{scripts → .pi/agent-fleet/scripts}/lib/hermes-monitor-model.ts +1 -1
- package/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
- package/{scripts → .pi/agent-fleet/scripts}/lib/monitor-env.ts +1 -1
- package/{scripts → .pi/agent-fleet/scripts}/lib/peer-launch.ts +3 -3
- package/{scripts → .pi/agent-fleet/scripts}/lib/persona-banner.ts +1 -1
- package/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
- package/{scripts → .pi/agent-fleet/scripts}/lib/runtime-dependencies.js +1 -1
- package/{scripts → .pi/agent-fleet/scripts}/lib/spawn-stagger.ts +1 -1
- package/{scripts → .pi/agent-fleet/scripts}/lib/team-project.ts +1 -1
- package/{scripts → .pi/agent-fleet/scripts}/lib/team-snapshot.ts +2 -2
- package/{scripts → .pi/agent-fleet/scripts}/peer-banner.ts +5 -4
- package/{scripts → .pi/agent-fleet/scripts}/peer-launch.ts +7 -9
- package/{scripts → .pi/agent-fleet/scripts}/team-snapshot.ts +5 -5
- package/{scripts → .pi/agent-fleet/scripts}/team-up.ts +6 -6
- package/{scripts → .pi/agent-fleet/scripts}/workflows/lib/agent-phase.ts +3 -3
- package/{scripts → .pi/agent-fleet/scripts}/workflows/lib/envelopes.ts +1 -1
- package/{scripts → .pi/agent-fleet/scripts}/workflows/lib/model-profile.ts +1 -1
- package/{scripts → .pi/agent-fleet/scripts}/workflows/lib/personas.ts +2 -2
- package/{scripts → .pi/agent-fleet/scripts}/workflows/lib/trace.ts +1 -1
- package/.pi/agents/peers.yaml +3 -1
- package/.pi/harnesses/agent-hub/README.md +1 -1
- package/.pi/harnesses/agent-hub/config/agents.ts +5 -1
- package/.pi/harnesses/agent-hub/debate-command.ts +1 -1
- package/.pi/harnesses/agent-hub/index.ts +19 -19
- package/.pi/harnesses/agent-hub/package.json +1 -1
- package/.pi/harnesses/agent-hub/peer-spawn-plan.ts +1 -1
- package/.pi/harnesses/agent-hub/tools/fleet-tools.ts +3 -5
- package/.pi/harnesses/agent-hub/tools/herdr-executors.ts +2 -2
- package/.pi/harnesses/ask-user-remote/index.ts +2 -2
- package/.pi/harnesses/coms/package.json +1 -1
- package/.pi/harnesses/damage-control-continue/package.json +1 -1
- package/.pi/harnesses/lib/spawned-peers.js +1 -1
- package/.pi/prompts/af-constraints.md +31 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/README.md +347 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/.versions/2.0.8/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
- package/.versions/2.0.8/.pi/agent-fleet/hooks/coms-stop-hook.mjs +84 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/coms-claude-bridge.ts +411 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/coms-cli.ts +425 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +413 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/fleet-codex-client.ts +69 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/fleet-codex-read.py +148 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/fleet.ts +216 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/flow.ts +137 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +210 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/fleet-codex-catalog.ts +63 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/fleet-codex-operations.ts +190 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/fleet-codex-session.ts +166 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/fleet-codex-transport.ts +124 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/fleet-command.ts +252 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/flow-command.ts +93 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +230 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/team-project.ts +178 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/lib/team-snapshot.ts +147 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/package-lock.json +35 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/package.json +9 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/peer-launch.ts +283 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/team-snapshot.ts +237 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/team-up.ts +378 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +133 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/lib/env.ts +34 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/lib/git.ts +96 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +130 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/lib/quality.ts +64 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/lib/run.ts +108 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/lib/trace.ts +34 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +112 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
- package/.versions/2.0.8/.pi/agent-fleet/scripts/workflows/wf-scout.ts +38 -0
- package/.versions/2.0.8/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/2.0.8/.pi/agents/model-profiles.yaml +83 -0
- package/.versions/2.0.8/.pi/agents/peers.yaml +147 -0
- package/.versions/2.0.8/.pi/agents/teams.yaml +41 -0
- package/.versions/2.0.8/.pi/agents/voices.yaml +13 -0
- package/.versions/2.0.8/.pi/damage-control-rules.yaml +297 -0
- package/.versions/2.0.8/.pi/extensions/btw/README.md +120 -0
- package/.versions/2.0.8/.pi/extensions/btw/index.ts +914 -0
- package/.versions/2.0.8/.pi/extensions/btw/package.json +6 -0
- package/.versions/2.0.8/.pi/extensions/btw/state.js +179 -0
- package/.versions/2.0.8/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
- package/.versions/2.0.8/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
- package/.versions/2.0.8/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/2.0.8/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/2.0.8/.pi/extensions/compact-and-continue/index.ts +120 -0
- package/.versions/2.0.8/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/2.0.8/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/2.0.8/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/2.0.8/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/2.0.8/.pi/extensions/package-lock.json +1175 -0
- package/.versions/2.0.8/.pi/extensions/package.json +9 -0
- package/.versions/2.0.8/.pi/extensions/pi-voice-stt/README.md +205 -0
- package/.versions/2.0.8/.pi/extensions/pi-voice-stt/config.ts +198 -0
- package/.versions/2.0.8/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/2.0.8/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/2.0.8/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/2.0.8/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/2.0.8/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/README.md +1203 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/acceptance.ts +62 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/access-approval.ts +135 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/artifacts.js +146 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/assertion-ledger.js +58 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/backend-policy.js +174 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/budget-continuation.ts +13 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/budget-recovery.ts +97 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/capability-packs.ts +180 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/budget-continue.ts +10 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/context.ts +43 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/models.ts +10 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/config/agents.ts +177 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/config/model-profiles.ts +216 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/config/overrides.ts +153 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +213 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/context/budgets.ts +202 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/context-pressure.ts +191 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/context-window.js +106 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/debate-command.ts +176 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/delegate.ts +446 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/dispatch-coms.ts +237 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/dispatch-native-complete.ts +154 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +156 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +193 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/dispatch-native-types.ts +230 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/dispatch-native.ts +213 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/docs-lane.js +122 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/drift-watchdog.js +218 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/execution-evidence.ts +80 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/external-blocker.js +85 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/fixtures/registration-surface.json +57 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/footer.ts +30 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/helpers.ts +266 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/hub-state-audit.js +64 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/index.ts +2151 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/input/completions.ts +76 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/input/shortcuts.ts +18 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +123 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +143 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +74 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/no-progress.ts +76 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/policy/models.ts +153 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/policy/roster.ts +94 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/policy/work-mode.ts +119 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/poll-command.ts +176 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/presentation.ts +48 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/prompts/context.ts +47 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/prompts/fragments.ts +115 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/prompts/system-prompt.ts +112 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/research/controls.ts +74 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/research/runtime.ts +192 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/research/spawn-run.ts +156 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/return-contract.js +293 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/return-extract.js +75 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/review-findings.js +102 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/run-budget.js +537 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/run-namespace.js +87 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/scope-gate.js +123 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/session-start.ts +42 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/spawn.ts +404 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/timeline.ts +54 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/tools/action-executors.ts +149 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/tools/context.ts +134 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +82 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +273 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/tools/fleet-tools.ts +200 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/tools/herdr-executors.ts +86 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/tools/set-task-tier.ts +29 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/tools/spawn-research.ts +62 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/tools/verification-contract.ts +77 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/types.ts +63 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/ui/activity-dots.ts +16 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/ui/context-budget.ts +86 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/ui/detail-panel.ts +178 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +125 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/ui/grid.ts +42 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/ui/history.ts +234 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/ui/running-strip.ts +139 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/ui/zoom.ts +204 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/version.ts +42 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
- package/.versions/2.0.8/.pi/harnesses/agent-hub/work-mode.ts +167 -0
- package/.versions/2.0.8/.pi/harnesses/ask-user-remote/README.md +59 -0
- package/.versions/2.0.8/.pi/harnesses/ask-user-remote/index.ts +558 -0
- package/.versions/2.0.8/.pi/harnesses/ask-user-remote/questions.ts +161 -0
- package/.versions/2.0.8/.pi/harnesses/ask-user-remote/race-core.js +124 -0
- package/.versions/2.0.8/.pi/harnesses/ask-user-remote/runtime-ask.ts +43 -0
- package/.versions/2.0.8/.pi/harnesses/coms/README.md +100 -0
- package/.versions/2.0.8/.pi/harnesses/coms/index.ts +282 -0
- package/.versions/2.0.8/.pi/harnesses/coms/package.json +7 -0
- package/.versions/2.0.8/.pi/harnesses/coms/version.ts +42 -0
- package/.versions/2.0.8/.pi/harnesses/damage-control-continue/README.md +135 -0
- package/.versions/2.0.8/.pi/harnesses/damage-control-continue/index.ts +541 -0
- package/.versions/2.0.8/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/2.0.8/.pi/harnesses/damage-control-continue/version.ts +42 -0
- package/.versions/2.0.8/.pi/harnesses/lib/coms-core-io.ts +385 -0
- package/.versions/2.0.8/.pi/harnesses/lib/coms-core.ts +577 -0
- package/.versions/2.0.8/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
- package/.versions/2.0.8/.pi/harnesses/lib/context-budget-child-prompt.ts +180 -0
- package/.versions/2.0.8/.pi/harnesses/lib/context-budget-hub-prompt.ts +114 -0
- package/.versions/2.0.8/.pi/harnesses/lib/context-budget-view.ts +107 -0
- package/.versions/2.0.8/.pi/harnesses/lib/context-budget.ts +114 -0
- package/.versions/2.0.8/.pi/harnesses/lib/damage-control-shared.ts +197 -0
- package/.versions/2.0.8/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
- package/.versions/2.0.8/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
- package/.versions/2.0.8/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
- package/.versions/2.0.8/.pi/harnesses/lib/fleet-dashboard-ops.ts +161 -0
- package/.versions/2.0.8/.pi/harnesses/lib/fleet-dashboard-view.ts +148 -0
- package/.versions/2.0.8/.pi/harnesses/lib/fleet-detail-view.ts +247 -0
- package/.versions/2.0.8/.pi/harnesses/lib/fleet-overlay.ts +26 -0
- package/.versions/2.0.8/.pi/harnesses/lib/fleet-panel.ts +34 -0
- package/.versions/2.0.8/.pi/harnesses/lib/fleet-read-model.ts +131 -0
- package/.versions/2.0.8/.pi/harnesses/lib/fleet-selection.ts +24 -0
- package/.versions/2.0.8/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
- package/.versions/2.0.8/.pi/harnesses/lib/herdr-client.ts +472 -0
- package/.versions/2.0.8/.pi/harnesses/lib/herdr-presence.ts +399 -0
- package/.versions/2.0.8/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.versions/2.0.8/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/2.0.8/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
- package/.versions/2.0.8/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/2.0.8/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
- package/.versions/2.0.8/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
- package/.versions/2.0.8/.pi/harnesses/lib/spawned-peers.js +190 -0
- package/.versions/2.0.8/.pi/harnesses/lib/update-check.ts +222 -0
- package/.versions/2.0.8/.pi/harnesses/package-lock.json +2039 -0
- package/.versions/2.0.8/.pi/harnesses/package.json +10 -0
- package/.versions/2.0.8/.pi/prompts/af-build.md +24 -0
- package/.versions/2.0.8/.pi/prompts/af-code-simplify.md +22 -0
- package/.versions/2.0.8/.pi/prompts/af-constraints.md +31 -0
- package/.versions/2.0.8/.pi/prompts/af-plan.md +17 -0
- package/.versions/2.0.8/.pi/prompts/af-review.md +16 -0
- package/.versions/2.0.8/.pi/prompts/af-set-hermes-telegram.md +15 -0
- package/.versions/2.0.8/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/2.0.8/.pi/prompts/af-ship.md +17 -0
- package/.versions/2.0.8/.pi/prompts/af-spec.md +15 -0
- package/.versions/2.0.8/.pi/prompts/af-test.md +19 -0
- package/.versions/2.0.8/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/2.0.8/.version +1 -0
- package/.versions/2.0.8/agents/architect.md +25 -0
- package/.versions/2.0.8/agents/bowser.md +28 -0
- package/.versions/2.0.8/agents/builder.md +56 -0
- package/.versions/2.0.8/agents/code-reviewer.md +210 -0
- package/.versions/2.0.8/agents/deep-researcher.md +33 -0
- package/.versions/2.0.8/agents/documenter.md +23 -0
- package/.versions/2.0.8/agents/orchestrator.md +23 -0
- package/.versions/2.0.8/agents/plan-reviewer.md +84 -0
- package/.versions/2.0.8/agents/planner.md +106 -0
- package/.versions/2.0.8/agents/releaser.md +25 -0
- package/.versions/2.0.8/agents/researcher.md +31 -0
- package/.versions/2.0.8/agents/security-auditor.md +168 -0
- package/.versions/2.0.8/agents/test-engineer.md +154 -0
- package/.versions/2.0.8/agents/web-debugger.md +44 -0
- package/.versions/2.0.8/agents/web-performance-auditor.md +194 -0
- package/.versions/2.0.8/bin/catalog/harness-runtime-closure.json +32 -0
- package/.versions/2.0.8/codex/fleet-session-client/SKILL.md +34 -0
- package/.versions/2.0.8/codex/fleet-session-client.zip +0 -0
- package/.versions/2.0.8/docs/ARCHITECTURE.md +416 -0
- package/.versions/2.0.8/docs/agent-fleet-setup.md +568 -0
- package/.versions/2.0.8/docs/claude-code-coms-bridge.md +134 -0
- package/.versions/2.0.8/docs/codex-session-bridge.md +219 -0
- package/.versions/2.0.8/docs/coms-hermes-bridge.md +188 -0
- package/.versions/2.0.8/docs/getting-started.md +126 -0
- package/.versions/2.0.8/docs/npm-install.md +356 -0
- package/.versions/2.0.8/docs/pi-extensions.md +446 -0
- package/.versions/2.0.8/docs/pi-setup.md +76 -0
- package/.versions/2.0.8/docs/skill-anatomy.md +150 -0
- package/.versions/2.0.8/install-manifest.json +2991 -0
- package/.versions/2.0.8/justfile +247 -0
- package/.versions/2.0.8/manifest-meta.json +970 -0
- package/.versions/2.0.8/references/accessibility-checklist.md +160 -0
- package/.versions/2.0.8/references/communication-contract.md +26 -0
- package/.versions/2.0.8/references/definition-of-done.md +67 -0
- package/.versions/2.0.8/references/fleet-coordination-patterns.md +171 -0
- package/.versions/2.0.8/references/observability-checklist.md +92 -0
- package/.versions/2.0.8/references/orchestration-patterns.md +370 -0
- package/.versions/2.0.8/references/performance-checklist.md +236 -0
- package/.versions/2.0.8/references/prompting-patterns.md +380 -0
- package/.versions/2.0.8/references/security-checklist.md +245 -0
- package/.versions/2.0.8/references/testing-patterns.md +235 -0
- package/.versions/2.0.8/references/workflow-authoring.md +304 -0
- package/.versions/2.0.8/skills/_internal/grilling.md +59 -0
- package/.versions/2.0.8/skills/browser-testing-with-devtools/SKILL.md +351 -0
- package/.versions/2.0.8/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.0.8/skills/compound-learning/SKILL.md +137 -0
- package/.versions/2.0.8/skills/constraint-driven-development/SKILL.md +338 -0
- package/.versions/2.0.8/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.0.8/skills/context-engineering/SKILL.md +341 -0
- package/.versions/2.0.8/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.0.8/skills/designing-agents/SKILL.md +394 -0
- package/.versions/2.0.8/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/2.0.8/skills/drafting-workflows/SKILL.md +143 -0
- package/.versions/2.0.8/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
- package/.versions/2.0.8/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.8/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/2.0.8/skills/idea-refine/SKILL.md +182 -0
- package/.versions/2.0.8/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.8/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.8/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.8/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.8/skills/incremental-implementation/SKILL.md +302 -0
- package/.versions/2.0.8/skills/interview-me/SKILL.md +226 -0
- package/.versions/2.0.8/skills/orchestration-verification/SKILL.md +181 -0
- package/.versions/2.0.8/skills/peer-coms/SKILL.md +90 -0
- package/.versions/2.0.8/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.0.8/skills/planning-and-task-breakdown/SKILL.md +289 -0
- package/.versions/2.0.8/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.0.8/skills/spec-driven-development/SKILL.md +295 -0
- package/.versions/2.0.8/skills/using-agent-skills/SKILL.md +198 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/README.md +430 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
- package/.versions/2.0.8/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
- package/CHANGELOG.md +39 -0
- package/README.md +10 -9
- package/bin/catalog/harness-runtime-closure.json +23 -22
- package/bin/cli.js +24 -1
- package/bin/lib/apply.js +6 -2
- package/bin/lib/detect-agent.js +1 -1
- package/bin/lib/doctor.js +3 -3
- package/bin/lib/manifest.js +23 -16
- package/bin/lib/path-boundaries.js +96 -0
- package/bin/lib/personas.js +15 -2
- package/bin/lib/set-hermes-telegram.js +2 -2
- package/bin/lib/set-hermes-watchdog.js +1 -1
- package/bin/lib/state.js +5 -1
- package/bin/lib/verify.js +43 -5
- package/bin/snapshot-version.js +6 -6
- package/codex/fleet-session-client/SKILL.md +3 -3
- package/docs/ARCHITECTURE.md +29 -20
- package/docs/MIGRATION-agent-fleet.md +11 -7
- package/docs/agent-fleet-setup.md +9 -2
- package/docs/claude-code-coms-bridge.md +10 -9
- package/docs/codex-session-bridge.md +18 -18
- package/docs/coms-hermes-bridge.md +6 -6
- package/docs/hermes-watchdog-supervisor.md +1 -1
- package/docs/npm-install.md +30 -1
- package/docs/pi-extensions.md +6 -6
- package/docs/workflows.md +9 -5
- package/install-manifest.json +202 -97
- package/justfile +19 -19
- package/manifest-meta.json +50 -38
- package/package.json +26 -26
- package/references/observability-checklist.md +1 -0
- package/references/performance-checklist.md +83 -0
- package/references/prompting-patterns.md +1 -1
- package/references/security-checklist.md +85 -19
- package/references/testing-patterns.md +12 -13
- package/references/workflow-authoring.md +5 -5
- package/skills/code-review-and-quality/SKILL.md +17 -2
- package/skills/constraint-driven-development/SKILL.md +338 -0
- package/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/skills/context-engineering/SKILL.md +52 -2
- package/skills/deprecation-and-migration/SKILL.md +42 -1
- package/skills/designing-agents/SKILL.md +12 -12
- package/skills/drafting-workflows/SKILL.md +6 -6
- package/skills/drafting-workflows/scripts/make-workflow.ts +3 -3
- package/skills/frontend-ui-engineering/SKILL.md +2 -2
- package/skills/git-workflow-and-versioning/SKILL.md +1 -1
- package/skills/incremental-implementation/SKILL.md +13 -9
- package/skills/peer-coms/SKILL.md +4 -4
- package/skills/performance-optimization/SKILL.md +152 -6
- package/skills/planning-and-task-breakdown/SKILL.md +32 -8
- package/skills/security-and-hardening/SKILL.md +84 -21
- package/skills/spec-driven-development/SKILL.md +41 -2
- package/skills/using-agent-skills/SKILL.md +3 -2
- package/vendor/agent-skills-upstream/README.md +427 -8
- package/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +73 -0
- package/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +2 -2
- package/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
- package/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +49 -1
- package/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +4 -4
- package/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +1 -1
- package/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +12 -2
- package/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +3 -3
- package/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +1 -1
- package/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +1 -1
- package/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +9 -9
- package/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +36 -1
- package/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +151 -5
- package/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +32 -9
- package/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +64 -7
- package/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +26 -6
- package/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +23 -1
- package/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +42 -3
- package/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +18 -3
- package/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +3 -2
- package/scripts/lib/hermes-monitor-events.ts +0 -1
- package/scripts/lib/hermes-monitor-herdr.ts +0 -2
- package/scripts/lib/hermes-monitor-registry.ts +0 -2
- package/scripts/lib/hermes-monitor-socket.ts +0 -2
- package/scripts/lib/hermes-monitor-store.ts +0 -2
- /package/{hermes → .pi/agent-fleet/hermes}/desktop-plugins/agent-fleet-herdr/plugin.js +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/desktop-plugins/agent-fleet-herdr/presentation.js +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/desktop-plugins/agent-fleet-monitor/plugin.js +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/desktop-plugins/agent-fleet-monitor/state.js +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/plugins/agent-fleet-herdr/dashboard/herdr_source.py +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/plugins/agent-fleet-herdr/dashboard/manifest.json +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/plugins/agent-fleet-herdr/dashboard/plugin_api.py +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/plugins/agent-fleet-herdr/dashboard/sessions.py +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/plugins/agent-fleet-herdr/dashboard/tasks.py +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/plugins/agent-fleet-herdr/plugin.yaml +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/plugins/agent-fleet-monitor/dashboard/adapter.py +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/plugins/agent-fleet-monitor/dashboard/dist/index.js +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/plugins/agent-fleet-monitor/dashboard/manifest.json +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/plugins/agent-fleet-monitor/dashboard/plugin_api.py +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/skills/hub-liaison/SKILL.md +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/skills/hub-watchdog/manifest.json +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/skills/hub-watchdog/scripts/watchdog.py +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/skills/hub-watchdog/scripts/watchdog_actions.py +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/skills/hub-watchdog/scripts/watchdog_contract.py +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/skills/hub-watchdog/scripts/watchdog_delivery.py +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/skills/hub-watchdog/scripts/watchdog_engine.py +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/skills/hub-watchdog/scripts/watchdog_judgment.py +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/skills/hub-watchdog/scripts/watchdog_recovery.py +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/skills/hub-watchdog/scripts/watchdog_state.py +0 -0
- /package/{hermes → .pi/agent-fleet/hermes}/skills/hub-watchdog/scripts/watchdog_transport.py +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/fleet-codex-client.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/hermes-watchdog-capability-probe.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/lib/fake-herdr-server.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/lib/fleet-codex-catalog.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/lib/fleet-codex-operations.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/lib/fleet-codex-session.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/lib/fleet-command.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/lib/flow-command.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/lib/flow-maintenance.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/package-lock.json +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/package.json +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/workflows/lib/changes.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/workflows/lib/debate.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/workflows/lib/env.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/workflows/lib/gates.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/workflows/lib/git.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/workflows/lib/merge.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/workflows/lib/model-visibility.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/workflows/lib/permissions.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/workflows/lib/poll.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/workflows/lib/quality.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/workflows/lib/run.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/workflows/lib/voices.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/workflows/lib/writer-lease.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/workflows/tsconfig.json +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/workflows/wf-build-test.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/workflows/wf-debate.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/workflows/wf-document.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/workflows/wf-poll.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/workflows/wf-quality.ts +0 -0
- /package/{scripts → .pi/agent-fleet/scripts}/workflows/wf-scout.ts +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Phase 4 dispatch facade. The composition root supplies explicit stateful deps;
|
|
2
|
+
// native, coms, and observability implementations remain internal modules.
|
|
3
|
+
export {
|
|
4
|
+
createDispatchComs,
|
|
5
|
+
type ComsDispatchResult,
|
|
6
|
+
type ComsDispatchState,
|
|
7
|
+
type DispatchComsDeps,
|
|
8
|
+
type DispatchInputArtifactPreview,
|
|
9
|
+
type DriftJudgeInput,
|
|
10
|
+
} from "./dispatch-coms.ts";
|
|
11
|
+
export {
|
|
12
|
+
createDispatchNative,
|
|
13
|
+
} from "./dispatch-native.ts";
|
|
14
|
+
export type {
|
|
15
|
+
NativeAgentDefinition,
|
|
16
|
+
NativeBackend,
|
|
17
|
+
NativeDispatchDeps,
|
|
18
|
+
NativeDispatchResult,
|
|
19
|
+
NativeDispatchState,
|
|
20
|
+
} from "./dispatch-native-types.ts";
|
|
21
|
+
export {
|
|
22
|
+
createDispatchObservability,
|
|
23
|
+
type DelegationChild,
|
|
24
|
+
type DelegationEvent,
|
|
25
|
+
type DelegationObservableState,
|
|
26
|
+
type DispatchObservabilityDeps,
|
|
27
|
+
} from "./dispatch-observability.ts";
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { NativeDispatchResult, NativeExecutionDiagnostics, NativeSpawnOutcome, PreparedNativeRun } from "./dispatch-native-types.ts";
|
|
2
|
+
|
|
3
|
+
export async function completeNativeRun(run: PreparedNativeRun, outcome: NativeSpawnOutcome): Promise<NativeDispatchResult> {
|
|
4
|
+
const { deps, state, ctx, histEntry, monitorStart, startTime, key, agentKey } = run;
|
|
5
|
+
const { res, runBilled, runOut, sessionRecycled, sessionReset, driftStop, driftAdvisories } = outcome;
|
|
6
|
+
clearInterval(state.timer);
|
|
7
|
+
state.elapsed = Date.now() - startTime;
|
|
8
|
+
state.proc = undefined;
|
|
9
|
+
state.delegationsWatcher?.close();
|
|
10
|
+
state.delegationsWatcher = undefined;
|
|
11
|
+
const diagnostics: NativeExecutionDiagnostics = {
|
|
12
|
+
reason: res.spawnError ? "spawn_error" : res.termination?.reason ?? (state.killedByOperator ? "operator_cancelled" : res.assistantError ? "assistant_error" : res.exitCode !== 0 ? "exit_code" : null),
|
|
13
|
+
processExitCode: res.exitCode,
|
|
14
|
+
assistantError: res.assistantError ?? null, stderr: res.stderr, spawnError: res.spawnError ?? null,
|
|
15
|
+
modelUsed: res.modelUsed ?? null, toolCallsStarted: res.toolCallsStarted ?? null,
|
|
16
|
+
termination: res.termination ?? null, modelFallback: res.modelFallback ?? null,
|
|
17
|
+
};
|
|
18
|
+
const diagnosticText = diagnostics.reason ? formatDiagnostics(diagnostics) : "";
|
|
19
|
+
const finish = (result: NativeDispatchResult): NativeDispatchResult => ({
|
|
20
|
+
...result, dispatchId: run.dispatchId, transcriptPath: run.transcriptPath, diagnostics, sessionReset,
|
|
21
|
+
output: result.output + diagnosticText,
|
|
22
|
+
});
|
|
23
|
+
if (diagnosticText) deps.appendTimelineText(state, "text", diagnosticText);
|
|
24
|
+
deps.flushTimelineStore(state);
|
|
25
|
+
|
|
26
|
+
if (res.spawnError) {
|
|
27
|
+
await monitorStart?.then(task => deps.finalizeMonitorChild(task, `Error spawning agent: ${res.spawnError}${diagnosticText}`, "failed"));
|
|
28
|
+
state.status = "error";
|
|
29
|
+
state.lastWork = `Error: ${res.spawnError}`;
|
|
30
|
+
state.killedByOperator = false;
|
|
31
|
+
state.restarting = false;
|
|
32
|
+
deps.updateWidget();
|
|
33
|
+
state.zoomRender?.(true);
|
|
34
|
+
deps.executionHistory.end(histEntry, "error");
|
|
35
|
+
const onTerminate = state.onTerminate;
|
|
36
|
+
state.onTerminate = undefined;
|
|
37
|
+
onTerminate?.();
|
|
38
|
+
return finish({ output: `Error spawning agent: ${res.spawnError}`, exitCode: 1, elapsed: state.elapsed, billed: runBilled, out: runOut });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const full = res.output;
|
|
42
|
+
const code = res.exitCode;
|
|
43
|
+
if (res.termination) {
|
|
44
|
+
const reason = res.termination.reason;
|
|
45
|
+
const tool = res.termination.tool;
|
|
46
|
+
state.status = "error";
|
|
47
|
+
state.lastWork = reason === "tool_timeout"
|
|
48
|
+
? `tool_timeout: ${tool?.toolName || "tool"} (${tool?.toolCallId || "unknown"})`
|
|
49
|
+
: reason === "turn_timeout"
|
|
50
|
+
? `turn_timeout after ${Math.round(state.elapsed / 1000)}s`
|
|
51
|
+
: reason === "drift_stop"
|
|
52
|
+
? `drift_stop: ${driftStop?.verdict || "watchdog"} (${driftStop?.rule || "rule"})`
|
|
53
|
+
: "cancelled by caller";
|
|
54
|
+
deps.updateWidget();
|
|
55
|
+
state.zoomRender?.(true);
|
|
56
|
+
deps.executionHistory.end(histEntry, "error");
|
|
57
|
+
const onTerminate = state.onTerminate;
|
|
58
|
+
state.onTerminate = undefined;
|
|
59
|
+
onTerminate?.();
|
|
60
|
+
if (reason === "drift_stop") {
|
|
61
|
+
deps.bumpDriftStop();
|
|
62
|
+
ctx.ui.notify(`${deps.displayName(state.def.name)} stopped by the drift watchdog (${driftStop?.verdict || "verdict"}: ${driftStop?.reason || driftStop?.detail || "no reason"})`, "warning");
|
|
63
|
+
}
|
|
64
|
+
const explanation = reason === "tool_timeout"
|
|
65
|
+
? `exceeded its per-tool watchdog on ${tool?.toolName || "tool"} (${tool?.toolCallId || "unknown"})`
|
|
66
|
+
: reason === "turn_timeout"
|
|
67
|
+
? `exceeded the per-run deadline (${Math.round(state.elapsed / 1000)}s; agent-turn-timeout-s / mode budget). ` +
|
|
68
|
+
`Do NOT re-dispatch the same task unchanged — split it into smaller pieces, or ask the user to raise the deadline`
|
|
69
|
+
: reason === "drift_stop"
|
|
70
|
+
? `was stopped by the drift watchdog. Rule "${driftStop?.rule || "unknown"}" fired (${driftStop?.detail || "no detail"}); ` +
|
|
71
|
+
`judge verdict ${(driftStop?.verdict || "drifting").toUpperCase()}: ${driftStop?.reason || "(no reason given)"}. ` +
|
|
72
|
+
`Re-dispatch ONCE with a corrected, NARROWED task that addresses this verdict — never repeat the same task unchanged. ` +
|
|
73
|
+
`If you believe the watchdog is wrong, tell the user; they can disable it with /af-watchdog ${key} off`
|
|
74
|
+
: "was cancelled by its caller";
|
|
75
|
+
return finish({
|
|
76
|
+
output: `${reason}: agent ${deps.displayName(state.def.name)} ${explanation}; terminationConfirmed=${res.termination.confirmed}.` +
|
|
77
|
+
(full.trim() ? `\n\nPartial output before termination:\n${full.slice(-2000)}` : ""),
|
|
78
|
+
exitCode: reason === "cancelled" ? 130 : reason === "drift_stop" ? 125 : 124,
|
|
79
|
+
elapsed: state.elapsed,
|
|
80
|
+
billed: runBilled,
|
|
81
|
+
out: runOut,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (state.killedByOperator) {
|
|
86
|
+
await monitorStart?.then(task => deps.finalizeMonitorChild(task, "operator killed run", "cancelled"));
|
|
87
|
+
const wasRestart = !!state.restarting;
|
|
88
|
+
state.killedByOperator = false;
|
|
89
|
+
state.restarting = false;
|
|
90
|
+
state.status = "idle";
|
|
91
|
+
state.lastWork = wasRestart ? "(killed for restart)" : "(killed by operator)";
|
|
92
|
+
deps.updateWidget();
|
|
93
|
+
state.zoomRender?.(true);
|
|
94
|
+
deps.executionHistory.end(histEntry, "idle");
|
|
95
|
+
ctx.ui.notify(`${deps.displayName(state.def.name)} killed by operator`, "info");
|
|
96
|
+
const onTerminate = state.onTerminate;
|
|
97
|
+
state.onTerminate = undefined;
|
|
98
|
+
onTerminate?.();
|
|
99
|
+
return finish({
|
|
100
|
+
output: wasRestart
|
|
101
|
+
? `Agent "${deps.displayName(state.def.name)}" was killed by the operator for a restart. A fresh run is starting now; WAIT for the follow-up result before acting — do not re-dispatch this agent yourself.`
|
|
102
|
+
: `Agent "${deps.displayName(state.def.name)}" was killed by the operator. Do NOT auto-retry or re-dispatch; wait for the operator's instruction.`,
|
|
103
|
+
exitCode: code == null || code === 0 ? 143 : code,
|
|
104
|
+
elapsed: state.elapsed,
|
|
105
|
+
billed: runBilled, out: runOut,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
await monitorStart?.then(task => deps.finalizeMonitorChild(task, full + diagnosticText, code === 0 ? "completed" : "failed"));
|
|
110
|
+
state.status = code === 0 ? "done" : "error";
|
|
111
|
+
if (code === 0) {
|
|
112
|
+
state.sessionFile = run.agentSessionFile;
|
|
113
|
+
state.runsSinceFresh++;
|
|
114
|
+
}
|
|
115
|
+
state.lastWork = (full || res.assistantError || res.stderr).split("\n").filter(line => line.trim()).pop() || "";
|
|
116
|
+
deps.updateWidget();
|
|
117
|
+
state.zoomRender?.(true);
|
|
118
|
+
deps.executionHistory.end(histEntry, state.status);
|
|
119
|
+
ctx.ui.notify(
|
|
120
|
+
`${deps.displayName(state.def.name)} ${state.status} in ${Math.round(state.elapsed / 1000)}s`,
|
|
121
|
+
state.status === "done" ? "success" : "error",
|
|
122
|
+
);
|
|
123
|
+
const onTerminate = state.onTerminate;
|
|
124
|
+
state.onTerminate = undefined;
|
|
125
|
+
onTerminate?.();
|
|
126
|
+
|
|
127
|
+
let output = full || (code !== 0 ? `Agent "${deps.displayName(state.def.name)}" exited with code ${code} and produced no output.` : "");
|
|
128
|
+
if (res.modelFallback) output = `(ℹ model fallback: ${res.modelFallback.from} failed before work began; retried once with original persona model ${res.modelFallback.to}.)\n\n${output}`;
|
|
129
|
+
if (sessionRecycled) output = `(ℹ ${deps.displayName(state.def.name)}'s session was recycled before this run — it has no memory of earlier dispatches; state must travel via task text/artifacts.)\n\n${output}`;
|
|
130
|
+
if (driftAdvisories.length > 0) {
|
|
131
|
+
output += `\n\n⚠ Drift advisory (run NOT stopped): ` +
|
|
132
|
+
driftAdvisories.map(advisory => `rule "${advisory.rule}" — ${advisory.detail}; judge said ${advisory.verdict.toUpperCase()}: ${advisory.reason || "(no reason)"}`).join(" | ") +
|
|
133
|
+
`\nReview whether the work still serves the task; nothing was reverted and nothing was killed.`;
|
|
134
|
+
}
|
|
135
|
+
if (sessionReset) {
|
|
136
|
+
const resetSummary = sessionReset.retried
|
|
137
|
+
? `was unusable and was quarantined${sessionReset.quarantined ? ` to ${sessionReset.quarantined}` : ""} (${sessionReset.reason}). This run started from a clean session after one automatic retry — the agent has no memory of earlier dispatches, and this is NOT a reason to drop it from the team.`
|
|
138
|
+
: sessionReset.quarantined
|
|
139
|
+
? `was unusable and was quarantined to ${sessionReset.quarantined} (${sessionReset.reason}) before the run. This run started from a clean session — the agent has no memory of earlier dispatches.`
|
|
140
|
+
: `was rejected by pi but could not be quarantined (${sessionReset.reason}). No clean retry was attempted; fix the file permissions/path before retrying.`;
|
|
141
|
+
output = `(⚠ ${deps.displayName(state.def.name)}'s session file ${resetSummary})\n\n${output}`;
|
|
142
|
+
}
|
|
143
|
+
return finish({ output, exitCode: code ?? 1, elapsed: state.elapsed, billed: runBilled, out: runOut, sessionReset });
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** Bounded human-facing excerpts; full diagnostics travel separately to the artifact. */
|
|
147
|
+
function formatDiagnostics(diagnostics: NativeExecutionDiagnostics): string {
|
|
148
|
+
const fields = ["assistantError", "stderr", "spawnError"] as const;
|
|
149
|
+
return `\n\n[execution: ${diagnostics.reason}; model=${diagnostics.modelUsed ?? "unknown"}; toolCallsStarted=${diagnostics.toolCallsStarted ?? "unknown"}]` +
|
|
150
|
+
fields.filter(field => diagnostics[field]).map(field => {
|
|
151
|
+
const text = diagnostics[field]!;
|
|
152
|
+
return `\n\n[${field}]\n${text.length > 1500 ? "...\n" + text.slice(-1500) : text}`;
|
|
153
|
+
}).join("");
|
|
154
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { profileFallback, profileChild } from './policy/profile-runtime.ts';
|
|
2
|
+
import { chmodSync, mkdirSync, existsSync, copyFileSync, unlinkSync } from "node:fs";
|
|
3
|
+
import { applyModelOverride, clampDelegateDepth, DELEGATE_TREE_SPAWN_BUDGET, fallbackModelFor, MAX_DELEGATE_DEPTH, safePathWithin } from "./helpers.ts";
|
|
4
|
+
import { contextOverflowDiagnostic, shouldRecycleSession } from "./run-budget.js";
|
|
5
|
+
import { estimatePromptTokens, resolveContextWindow, shouldRecycleBeforeSpawn } from "./context-window.js";
|
|
6
|
+
import { quarantineIfUnusable } from "./session-health.js";
|
|
7
|
+
import { requireSafetyHarness } from "./safety-routing.ts";
|
|
8
|
+
import { buildSpecialistContextManifest, nativeSpecialistSystemPrompt } from "../lib/context-budget-child-prompt.ts";
|
|
9
|
+
import { extractAssertionIds } from "./return-contract.js";
|
|
10
|
+
import type { NativeDispatchResult, NativeRunBase, PreparedNativeRun } from "./dispatch-native-types.ts";
|
|
11
|
+
|
|
12
|
+
export async function prepareNativeRun(base: NativeRunBase, preserveManifest: boolean): Promise<PreparedNativeRun | NativeDispatchResult> {
|
|
13
|
+
const { deps, state, ctx, task, inputArtifacts, scopeGlobs, personaKey, agentKey, runNumber } = base;
|
|
14
|
+
const model = deps.resolvedModel(state.def)
|
|
15
|
+
?? (ctx.model ? `${ctx.model.provider}/${ctx.model.id}` : "openrouter/google/gemini-3-flash-preview");
|
|
16
|
+
const fallbackCandidate = profileFallback(deps.substitutedModel(fallbackModelFor(state.def, model)));
|
|
17
|
+
const originalModelFallback = fallbackCandidate === model ? undefined : fallbackCandidate;
|
|
18
|
+
const agentWindow = resolveContextWindow(model, { lookup: deps.modelWindowLookup(ctx), fallbackWindow: deps.getContextWindow() });
|
|
19
|
+
const agentSessionFile = safePathWithin(base.evidenceDir, "session.json");
|
|
20
|
+
if (state.sessionFile && existsSync(state.sessionFile)) copyFileSync(state.sessionFile, agentSessionFile);
|
|
21
|
+
const turnBudget = deps.currentBudget();
|
|
22
|
+
let sessionRecycled = false;
|
|
23
|
+
|
|
24
|
+
if (state.sessionFile && shouldRecycleSession(state.runsSinceFresh, state.contextPct, turnBudget)) {
|
|
25
|
+
try { unlinkSync(agentSessionFile); } catch {}
|
|
26
|
+
state.sessionFile = null;
|
|
27
|
+
state.runsSinceFresh = 0;
|
|
28
|
+
state.contextPct = 0;
|
|
29
|
+
state.contextTokens = 0;
|
|
30
|
+
sessionRecycled = true;
|
|
31
|
+
deps.bumpRecycle();
|
|
32
|
+
ctx.ui.notify(`${deps.displayName(state.def.name)}: session recycled (stale context) — starting fresh`, "info");
|
|
33
|
+
} else {
|
|
34
|
+
const overflow = contextOverflowDiagnostic(state.runsSinceFresh, state.contextPct, {
|
|
35
|
+
agent: deps.displayName(state.def.name),
|
|
36
|
+
model: deps.resolvedModel(state.def) ?? (ctx.model ? `${ctx.model.provider}/${ctx.model.id}` : "unknown model"),
|
|
37
|
+
});
|
|
38
|
+
if (overflow) ctx.ui.notify(overflow, "warning");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
let sessionReset = null;
|
|
42
|
+
const health = quarantineIfUnusable(agentSessionFile, deps.getSessionHealthIo());
|
|
43
|
+
if (!health.usable && health.reason) {
|
|
44
|
+
sessionReset = { reason: health.reason, quarantined: health.quarantined, retried: false };
|
|
45
|
+
state.sessionFile = null;
|
|
46
|
+
state.runsSinceFresh = 0;
|
|
47
|
+
state.contextPct = 0;
|
|
48
|
+
state.contextTokens = 0;
|
|
49
|
+
ctx.ui.notify(`${deps.displayName(state.def.name)}: unusable session file quarantined (${health.reason}) — starting fresh`, "warning");
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const subagentRoles = state.def.subagents && Object.keys(state.def.subagents).length > 0
|
|
53
|
+
? Object.fromEntries(Object.entries(state.def.subagents).map(([role, value]) => {
|
|
54
|
+
const effective = deps.resolvedSubagentModel(personaKey, role, value.model);
|
|
55
|
+
const configured = { ...(effective !== value.model ? applyModelOverride(value, effective) : value) };
|
|
56
|
+
const fallback = profileFallback(deps.substitutedModel(configured.fallbackModel));
|
|
57
|
+
const thinking=profileChild(personaKey,role)?.thinking;
|
|
58
|
+
if(thinking!==undefined) configured.thinking=thinking;
|
|
59
|
+
return [role, fallback === configured.model ? { ...configured, fallbackModel: undefined } : { ...configured, fallbackModel: fallback }];
|
|
60
|
+
}))
|
|
61
|
+
: null;
|
|
62
|
+
const delegateExtPath = deps.getDelegateExtensionPath();
|
|
63
|
+
const delegationActive = turnBudget.delegation && !!subagentRoles && !!delegateExtPath;
|
|
64
|
+
const safetyHarnessPath = deps.getSafetyHarnessPath();
|
|
65
|
+
const safety = requireSafetyHarness(safetyHarnessPath);
|
|
66
|
+
if (!safety.ok) return base.finishRun(safety.error, 1);
|
|
67
|
+
const extensions = [...safety.extensions];
|
|
68
|
+
let effectiveTools = state.def.tools;
|
|
69
|
+
let delegateEnv: Record<string, string> | undefined;
|
|
70
|
+
if (delegationActive) {
|
|
71
|
+
const delegationDir = safePathWithin(base.evidenceDir, "delegations");
|
|
72
|
+
mkdirSync(delegationDir, { recursive: true, mode: 0o700 });
|
|
73
|
+
try { chmodSync(delegationDir, 0o700); } catch {}
|
|
74
|
+
extensions.push(delegateExtPath!);
|
|
75
|
+
effectiveTools = `${state.def.tools},delegate`;
|
|
76
|
+
delegateEnv = {
|
|
77
|
+
AGENT_HUB_DELEGATE_CONFIG: JSON.stringify({
|
|
78
|
+
persona: state.def.name,
|
|
79
|
+
tag: "root",
|
|
80
|
+
roles: subagentRoles,
|
|
81
|
+
depth: clampDelegateDepth(state.def.delegateDepth ?? MAX_DELEGATE_DEPTH),
|
|
82
|
+
callBudget: DELEGATE_TREE_SPAWN_BUDGET,
|
|
83
|
+
remainingSpawns: DELEGATE_TREE_SPAWN_BUDGET,
|
|
84
|
+
parentTools: state.def.tools,
|
|
85
|
+
personaPrompt: state.def.systemPrompt,
|
|
86
|
+
eventDir: delegationDir,
|
|
87
|
+
damageControl: safetyHarnessPath || undefined,
|
|
88
|
+
delegateExt: delegateExtPath,
|
|
89
|
+
reconSearchTimeoutMs: deps.getReconSearchTimeoutMs(),
|
|
90
|
+
turnDeadlineMs: turnBudget.agentTurnMs,
|
|
91
|
+
cwd: ctx.cwd || process.cwd(),
|
|
92
|
+
}),
|
|
93
|
+
};
|
|
94
|
+
deps.startDelegationWatch(state, delegationDir);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const manifest = preserveManifest && state.specialistManifest
|
|
98
|
+
? state.specialistManifest
|
|
99
|
+
: buildSpecialistContextManifest({
|
|
100
|
+
personaName: state.def.name,
|
|
101
|
+
personaPath: state.def.file,
|
|
102
|
+
personaPrompt: state.def.systemPrompt,
|
|
103
|
+
task,
|
|
104
|
+
rulesPaths: deps.specialistProjectPolicyPaths(ctx.cwd || process.cwd()),
|
|
105
|
+
docsPaths: deps.getProjectDocsPaths(),
|
|
106
|
+
hasAssertions: extractAssertionIds(task).length > 0,
|
|
107
|
+
hasScope: scopeGlobs.length > 0,
|
|
108
|
+
hasArtifacts: inputArtifacts.length > 0,
|
|
109
|
+
delegateRoles: delegationActive ? Object.keys(subagentRoles!) : [],
|
|
110
|
+
});
|
|
111
|
+
state.specialistManifest = manifest;
|
|
112
|
+
const replacementSystemPrompt = nativeSpecialistSystemPrompt({ manifest, userLanguage: deps.getUserLanguage(), agentKey, runNumber, artifactRoot: safePathWithin(base.sessionDir, "artifacts"), dispatchId: base.dispatchId });
|
|
113
|
+
const thinkingLevel = deps.resolveThinkingLevel(deps.resolvedThinking(state.def));
|
|
114
|
+
const wantThinking = thinkingLevel !== "off";
|
|
115
|
+
const runPrompt = deps.appendDeclaredScope(deps.appendInputArtifacts(task, inputArtifacts), scopeGlobs);
|
|
116
|
+
|
|
117
|
+
if (state.sessionFile && !sessionRecycled) {
|
|
118
|
+
const overflow = shouldRecycleBeforeSpawn({
|
|
119
|
+
priorTokens: state.contextTokens,
|
|
120
|
+
promptTokens: estimatePromptTokens(runPrompt) + estimatePromptTokens(replacementSystemPrompt),
|
|
121
|
+
window: agentWindow.window,
|
|
122
|
+
});
|
|
123
|
+
if (overflow) {
|
|
124
|
+
try { unlinkSync(agentSessionFile); } catch {}
|
|
125
|
+
state.sessionFile = null;
|
|
126
|
+
state.runsSinceFresh = 0;
|
|
127
|
+
state.contextPct = 0;
|
|
128
|
+
state.contextTokens = 0;
|
|
129
|
+
sessionRecycled = true;
|
|
130
|
+
deps.bumpRecycle();
|
|
131
|
+
ctx.ui.notify(
|
|
132
|
+
`${deps.displayName(state.def.name)}: session recycled before spawn — ${overflow.message}. ` +
|
|
133
|
+
"Resuming would have overflowed the window mid-run; the task text and artifact paths carry the state.",
|
|
134
|
+
"info",
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return {
|
|
140
|
+
...base,
|
|
141
|
+
model,
|
|
142
|
+
originalModelFallback,
|
|
143
|
+
agentWindow,
|
|
144
|
+
agentSessionFile,
|
|
145
|
+
turnBudget,
|
|
146
|
+
sessionRecycled,
|
|
147
|
+
sessionReset,
|
|
148
|
+
effectiveTools,
|
|
149
|
+
extensions,
|
|
150
|
+
delegateEnv,
|
|
151
|
+
thinkingLevel,
|
|
152
|
+
wantThinking,
|
|
153
|
+
replacementSystemPrompt,
|
|
154
|
+
runPrompt,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { relative } from "node:path";
|
|
2
|
+
import { contextPct, overWindowDiagnostic } from "./context-window.js";
|
|
3
|
+
import { createDriftMonitor, hubOwnedScopeGlobs, resolveWatchdogActive } from "./drift-watchdog.js";
|
|
4
|
+
import { forceQuarantineSession, isCorruptSessionExit } from "./session-health.js";
|
|
5
|
+
import type { NativeSpawnOutcome, PiRunControl, PreparedNativeRun, SpawnPiAgentCallbacks, SpawnPiAgentOptions } from "./dispatch-native-types.ts";
|
|
6
|
+
import { bumpMessageCount } from "./ui/activity-dots.ts";
|
|
7
|
+
|
|
8
|
+
const RESEARCHER_PERSONAS = new Set(["researcher", "deep-researcher"]);
|
|
9
|
+
|
|
10
|
+
interface DriftRuntime {
|
|
11
|
+
monitor: any;
|
|
12
|
+
stop: { rule: string; detail: string; verdict: string; reason: string } | null;
|
|
13
|
+
advisories: Array<{ rule: string; detail: string; verdict: string; reason: string }>;
|
|
14
|
+
control?: PiRunControl;
|
|
15
|
+
escalate(violation: { rule: string; terminal?: boolean; detail: string }): void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function createDriftRuntime(run: PreparedNativeRun): DriftRuntime {
|
|
19
|
+
const { deps, state, ctx, watchdogParam, key, scopeGlobs, task, agentKey } = run;
|
|
20
|
+
const watchdogArmed = resolveWatchdogActive(
|
|
21
|
+
watchdogParam,
|
|
22
|
+
deps.getWatchdogAgentOverride(key),
|
|
23
|
+
deps.getWatchdogSetting(),
|
|
24
|
+
deps.getWorkMode(),
|
|
25
|
+
);
|
|
26
|
+
const sessionDir = deps.getSessionDir();
|
|
27
|
+
const hubOwnedGlobs = hubOwnedScopeGlobs(sessionDir, relative(ctx.cwd || process.cwd(), sessionDir));
|
|
28
|
+
const runtime: DriftRuntime = {
|
|
29
|
+
monitor: watchdogArmed ? createDriftMonitor({ scopeGlobs, allowGlobs: hubOwnedGlobs }) : null,
|
|
30
|
+
stop: null,
|
|
31
|
+
advisories: [],
|
|
32
|
+
escalate: () => {},
|
|
33
|
+
};
|
|
34
|
+
let judgeBusy = false;
|
|
35
|
+
let judgeCooldownUntil = 0;
|
|
36
|
+
runtime.escalate = violation => {
|
|
37
|
+
if (!runtime.monitor || judgeBusy || runtime.stop || Date.now() < judgeCooldownUntil) return;
|
|
38
|
+
judgeBusy = true;
|
|
39
|
+
void deps.runDriftJudge(
|
|
40
|
+
{ agentLabel: deps.displayName(state.def.name), agentKey, task, scopeGlobs, hubOwnedGlobs, trail: runtime.monitor.trail(), violation },
|
|
41
|
+
ctx,
|
|
42
|
+
).then(verdict => {
|
|
43
|
+
judgeBusy = false;
|
|
44
|
+
judgeCooldownUntil = Date.now() + 90_000;
|
|
45
|
+
if (!verdict || (verdict.verdict !== "drifting" && verdict.verdict !== "stuck")) return;
|
|
46
|
+
if (violation.terminal === false) {
|
|
47
|
+
runtime.advisories.push({ rule: violation.rule, detail: violation.detail, verdict: verdict.verdict, reason: verdict.reason });
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
runtime.stop = { rule: violation.rule, detail: violation.detail, verdict: verdict.verdict, reason: verdict.reason };
|
|
51
|
+
runtime.control?.terminate("drift_stop");
|
|
52
|
+
}).catch(() => { judgeBusy = false; });
|
|
53
|
+
};
|
|
54
|
+
return runtime;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function createSpawnCallbacks(run: PreparedNativeRun, drift: DriftRuntime, usageTotals: { billed: number; out: number }): SpawnPiAgentCallbacks {
|
|
58
|
+
const { deps, state, ctx, monitorStart, agentWindow, model, wantThinking } = run;
|
|
59
|
+
let fullText = "";
|
|
60
|
+
let overWindowWarned = false;
|
|
61
|
+
return {
|
|
62
|
+
onProcess: proc => {
|
|
63
|
+
state.proc = proc;
|
|
64
|
+
void monitorStart?.then(task => deps.registerMonitorProcess(task, proc));
|
|
65
|
+
},
|
|
66
|
+
onModelFallback: ({ from, to, reason }) => {
|
|
67
|
+
state.lastWork = `model fallback: ${deps.shortModel(from)} → ${deps.shortModel(to)}`;
|
|
68
|
+
ctx.ui.notify(`${deps.displayName(state.def.name)}: overridden model ${from} failed before work began; retrying with persona model ${to} (${reason})`, "warning");
|
|
69
|
+
deps.updateWidget();
|
|
70
|
+
},
|
|
71
|
+
...(drift.monitor ? { onControl: (control: PiRunControl) => { drift.control = control; } } : {}),
|
|
72
|
+
onTextDelta: delta => {
|
|
73
|
+
void monitorStart?.then(task => deps.appendMonitorOutput(task, delta));
|
|
74
|
+
fullText += delta;
|
|
75
|
+
state.lastWork = fullText.split("\n").filter(line => line.trim()).pop() || "";
|
|
76
|
+
bumpMessageCount(state, "text");
|
|
77
|
+
deps.appendTimelineText(state, "text", delta);
|
|
78
|
+
deps.updateWidget();
|
|
79
|
+
state.zoomRender?.();
|
|
80
|
+
},
|
|
81
|
+
onThinkingDelta: delta => {
|
|
82
|
+
if (!wantThinking) return;
|
|
83
|
+
deps.appendTimelineText(state, "thinking", delta);
|
|
84
|
+
state.zoomRender?.();
|
|
85
|
+
},
|
|
86
|
+
onToolStart: (toolName, argStr, callId) => {
|
|
87
|
+
state.toolCount++;
|
|
88
|
+
deps.appendTimelineEvent(state, {
|
|
89
|
+
kind: "tool-start",
|
|
90
|
+
title: `Tool: ${toolName}`,
|
|
91
|
+
content: argStr,
|
|
92
|
+
timestamp: Date.now(),
|
|
93
|
+
...(callId ? { callId } : {}),
|
|
94
|
+
});
|
|
95
|
+
deps.updateWidget();
|
|
96
|
+
state.zoomRender?.();
|
|
97
|
+
const violation = drift.monitor?.onToolStart(toolName, argStr);
|
|
98
|
+
if (violation) drift.escalate(violation);
|
|
99
|
+
},
|
|
100
|
+
onToolEnd: (toolName, callId, isError, resultText, durationMs) => {
|
|
101
|
+
deps.appendTimelineEvent(state, {
|
|
102
|
+
kind: "tool-result",
|
|
103
|
+
title: `Result: ${toolName}`,
|
|
104
|
+
content: resultText ?? "",
|
|
105
|
+
timestamp: Date.now(),
|
|
106
|
+
...(callId ? { callId } : {}),
|
|
107
|
+
status: isError ? "error" : "success",
|
|
108
|
+
...(durationMs == null ? {} : { durationMs }),
|
|
109
|
+
});
|
|
110
|
+
state.zoomRender?.();
|
|
111
|
+
const violation = drift.monitor?.onToolEnd(toolName, isError);
|
|
112
|
+
if (violation) drift.escalate(violation);
|
|
113
|
+
},
|
|
114
|
+
onUsage: (usage, source) => {
|
|
115
|
+
if (source === "message_end" || (usageTotals.billed === 0 && usageTotals.out === 0)) {
|
|
116
|
+
usageTotals.billed += (usage.input || 0) + (usage.cacheRead || 0) + (usage.cacheWrite || 0);
|
|
117
|
+
usageTotals.out += usage.output || 0;
|
|
118
|
+
}
|
|
119
|
+
if (agentWindow.window > 0) {
|
|
120
|
+
state.contextTokens = (usage.input || 0) + (usage.cacheRead || 0) + (usage.cacheWrite || 0);
|
|
121
|
+
state.contextPct = contextPct(usage, agentWindow.window);
|
|
122
|
+
if (state.contextPct >= 100 && !overWindowWarned) {
|
|
123
|
+
overWindowWarned = true;
|
|
124
|
+
ctx.ui.notify(overWindowDiagnostic({
|
|
125
|
+
agent: deps.displayName(state.def.name),
|
|
126
|
+
model,
|
|
127
|
+
pct: state.contextPct,
|
|
128
|
+
window: agentWindow.window,
|
|
129
|
+
source: agentWindow.source,
|
|
130
|
+
}), "warning");
|
|
131
|
+
}
|
|
132
|
+
deps.updateWidget();
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export async function runPreparedNative(run: PreparedNativeRun): Promise<NativeSpawnOutcome> {
|
|
139
|
+
const { deps, state, ctx, model, effectiveTools, thinkingLevel, replacementSystemPrompt, agentSessionFile, runPrompt, extensions, delegateEnv, turnBudget, personaKey, originalModelFallback } = run;
|
|
140
|
+
const spawnOptions: SpawnPiAgentOptions = {
|
|
141
|
+
model,
|
|
142
|
+
tools: effectiveTools,
|
|
143
|
+
thinking: thinkingLevel,
|
|
144
|
+
systemPrompt: replacementSystemPrompt,
|
|
145
|
+
noSkills: true,
|
|
146
|
+
noContextFiles: true,
|
|
147
|
+
sessionFile: agentSessionFile,
|
|
148
|
+
resume: !!state.sessionFile,
|
|
149
|
+
prompt: runPrompt,
|
|
150
|
+
cwd: ctx.cwd || process.cwd(),
|
|
151
|
+
extensions,
|
|
152
|
+
env: { ...deps.guardrailEnv(run.agentKey), ...(delegateEnv || {}) },
|
|
153
|
+
detached: true,
|
|
154
|
+
...(RESEARCHER_PERSONAS.has(personaKey) ? { toolWatchdog: { timeoutMs: deps.getReconSearchTimeoutMs() } } : {}),
|
|
155
|
+
turnDeadlineMs: turnBudget.agentTurnMs,
|
|
156
|
+
};
|
|
157
|
+
const drift = createDriftRuntime(run);
|
|
158
|
+
const usageTotals = { billed: 0, out: 0 };
|
|
159
|
+
const callbacks = createSpawnCallbacks(run, drift, usageTotals);
|
|
160
|
+
deps.notifyProviderQueue(model, deps.displayName(state.def.name), ctx);
|
|
161
|
+
let sessionReset = run.sessionReset;
|
|
162
|
+
const res = await deps.providerSemaphore.run(model, async () => {
|
|
163
|
+
let result = await deps.spawnPiAgentWithModelFallback(spawnOptions, originalModelFallback, callbacks);
|
|
164
|
+
if (!result.spawnError && isCorruptSessionExit({ code: result.exitCode, output: result.output, stderr: result.stderr })) {
|
|
165
|
+
const quarantine = forceQuarantineSession(agentSessionFile, deps.getSessionHealthIo());
|
|
166
|
+
state.sessionFile = null;
|
|
167
|
+
state.runsSinceFresh = 0;
|
|
168
|
+
state.contextPct = 0;
|
|
169
|
+
state.contextTokens = 0;
|
|
170
|
+
sessionReset = {
|
|
171
|
+
reason: quarantine.ok ? "pi rejected the session file" : quarantine.error!,
|
|
172
|
+
quarantined: quarantine.quarantined,
|
|
173
|
+
retried: quarantine.ok,
|
|
174
|
+
};
|
|
175
|
+
if (quarantine.ok) {
|
|
176
|
+
ctx.ui.notify(`${deps.displayName(state.def.name)}: pi rejected the session file — quarantined, retrying once from a clean session`, "warning");
|
|
177
|
+
result = await deps.spawnPiAgentWithModelFallback({ ...spawnOptions, resume: false }, originalModelFallback, callbacks);
|
|
178
|
+
} else {
|
|
179
|
+
ctx.ui.notify(`${deps.displayName(state.def.name)}: pi rejected the session file, but it could not be quarantined — clean retry refused (${quarantine.error})`, "error");
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return result;
|
|
183
|
+
});
|
|
184
|
+
return {
|
|
185
|
+
res,
|
|
186
|
+
runBilled: usageTotals.billed,
|
|
187
|
+
runOut: usageTotals.out,
|
|
188
|
+
sessionRecycled: run.sessionRecycled,
|
|
189
|
+
sessionReset,
|
|
190
|
+
driftStop: drift.stop,
|
|
191
|
+
driftAdvisories: drift.advisories,
|
|
192
|
+
};
|
|
193
|
+
}
|