@chankov/agent-fleet 2.0.22 → 2.0.23
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/agent-fleet/scripts/coms-claude-bridge.ts +5 -2
- package/.pi/agent-fleet/scripts/coms-cli.ts +9 -4
- package/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +5 -2
- package/.pi/agent-fleet/scripts/exec-at-target.ts +10 -0
- package/.pi/agent-fleet/scripts/fleet.ts +32 -4
- package/.pi/agent-fleet/scripts/flow.ts +10 -1
- package/.pi/agent-fleet/scripts/lib/fleet-codex-session.ts +1 -1
- package/.pi/agent-fleet/scripts/lib/fleet-command.ts +14 -0
- package/.pi/agent-fleet/scripts/lib/flow-command.ts +9 -0
- package/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +14 -6
- package/.pi/agent-fleet/scripts/lib/peer-target.ts +1 -0
- package/.pi/agent-fleet/scripts/lib/resource-closure.js +1 -0
- package/.pi/agent-fleet/scripts/lib/session-launch.ts +56 -0
- package/.pi/agent-fleet/scripts/lib/team-snapshot.ts +13 -0
- package/.pi/agent-fleet/scripts/peer-launch.ts +17 -11
- package/.pi/agent-fleet/scripts/pi-session.ts +9 -0
- package/.pi/agent-fleet/scripts/team-snapshot.ts +14 -6
- package/.pi/agent-fleet/scripts/team-up.ts +16 -9
- package/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +5 -3
- package/.pi/agent-fleet/scripts/workflows/lib/env.ts +3 -1
- package/.pi/agent-fleet/scripts/workflows/lib/git.ts +4 -1
- package/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +10 -5
- package/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +15 -8
- package/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +5 -4
- package/.pi/agent-fleet/scripts/workflows/lib/quality.ts +3 -2
- package/.pi/agent-fleet/scripts/workflows/lib/run.ts +1 -0
- package/.pi/agent-fleet/scripts/workflows/lib/trace.ts +23 -5
- package/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +59 -23
- package/.pi/agents/model-profiles.yaml +3 -3
- package/.pi/extensions/btw/index.ts +2 -0
- package/.pi/extensions/pi-voice-stt/config.ts +5 -4
- package/.pi/harnesses/agent-hub/agentic-hub.ts +2 -1
- package/.pi/harnesses/agent-hub/config/agents.ts +3 -0
- package/.pi/harnesses/agent-hub/config/overrides.ts +4 -3
- package/.pi/harnesses/agent-hub/context-continuity-broker.ts +7 -5
- package/.pi/harnesses/agent-hub/context-continuity-client.ts +6 -3
- package/.pi/harnesses/agent-hub/context-continuity-owners.ts +5 -3
- package/.pi/harnesses/agent-hub/damage-guard-hub.ts +4 -2
- package/.pi/harnesses/agent-hub/damage-guard-owners.ts +5 -0
- package/.pi/harnesses/agent-hub/dispatch-coms.ts +7 -2
- package/.pi/harnesses/agent-hub/execution-evidence.ts +20 -4
- package/.pi/harnesses/agent-hub/file-discovery/hub.ts +2 -1
- package/.pi/harnesses/agent-hub/file-discovery/owners.ts +7 -3
- package/.pi/harnesses/agent-hub/index.ts +4 -3
- package/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +3 -2
- package/.pi/harnesses/agent-hub/package.json +1 -1
- package/.pi/harnesses/agent-hub/presentation.ts +7 -1
- package/.pi/harnesses/agent-hub/proactive-config.ts +2 -1
- package/.pi/harnesses/agent-hub/proactive-rules.ts +1 -1
- package/.pi/harnesses/agent-hub/proactive-snapshot.ts +12 -4
- package/.pi/harnesses/agent-hub/proactive-types.ts +3 -0
- package/.pi/harnesses/agent-hub/safety-routing.ts +7 -1
- package/.pi/harnesses/agent-hub/scope-gate.js +10 -5
- package/.pi/harnesses/agent-hub/spawn.ts +30 -4
- package/.pi/harnesses/agent-hub/system1-runtime.ts +9 -3
- package/.pi/harnesses/agent-hub/task-triage-config.ts +2 -1
- package/.pi/harnesses/agent-hub/tools/fleet-tools.ts +3 -2
- package/.pi/harnesses/agent-hub/tools/herdr-executors.ts +11 -6
- package/.pi/harnesses/agent-hub/tools/run-flow.ts +21 -11
- package/.pi/harnesses/ask-user-remote/index.ts +4 -2
- package/.pi/harnesses/coms/package.json +1 -1
- package/.pi/harnesses/damage-control-continue/index.ts +23 -2
- package/.pi/harnesses/damage-control-continue/package.json +1 -1
- package/.pi/harnesses/lib/coms-core-io.ts +2 -0
- package/.pi/harnesses/lib/coms-core.ts +7 -1
- package/.pi/harnesses/lib/coms-registry-entry.ts +3 -0
- package/.pi/harnesses/lib/damage-control-shared.ts +17 -1
- package/.pi/harnesses/lib/damage-policy.ts +35 -0
- package/.pi/harnesses/lib/peer-target.ts +24 -0
- package/.pi/harnesses/lib/policy-roots.js +20 -9
- package/.pi/harnesses/lib/policy-roots.ts +2 -1
- package/.pi/harnesses/lib/resource-closure.js +26 -0
- package/.pi/harnesses/lib/session-target.ts +62 -0
- package/.pi/harnesses/lib/system1/config-loader.js +12 -3
- package/.pi/harnesses/lib/system1/worktree-scopes.js +110 -0
- package/.pi/harnesses/lib/system1/worktree-scopes.ts +13 -0
- package/.pi/harnesses/lib/system1/worktree-service.ts +24 -0
- package/.pi/harnesses/lib/target-capabilities.js +7 -0
- package/.pi/harnesses/lib/workspace-context.js +115 -0
- package/.pi/harnesses/lib/workspace-context.ts +22 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/README.md +347 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/gates/gate-o-capability.md +8 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/gates/gate-o-validator-fixtures.json +1 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +773 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-conductor/SKILL.md +84 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-liaison/SKILL.md +84 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/SKILL.md +76 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/manifest.json +1 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
- package/.versions/2.0.23/.pi/agent-fleet/hermes/watchdog-tests/__init__.py +0 -0
- package/.versions/2.0.23/.pi/agent-fleet/hooks/coms-stop-hook.mjs +84 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/claude-code-preflight.ts +70 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/coms-claude-bridge.ts +440 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/coms-cli.ts +430 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/coms-hermes-bridge.ts +416 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/exec-at-target.ts +10 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/fleet-codex-client.ts +69 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/fleet-codex-read.py +148 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/fleet.ts +245 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/flow.ts +166 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/hermes-monitor-capability-runner.ts +25 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/hermes-monitor-scenario.ts +474 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/hermes-watchdog-capability-probe.ts +45 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/install-hermes-plugin.sh +180 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/claude-bridge-core.ts +208 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/coms-envelope.ts +582 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/fake-herdr-server.ts +88 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/fleet-codex-catalog.ts +63 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/fleet-codex-operations.ts +190 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/fleet-codex-session.ts +166 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/fleet-codex-transport.ts +124 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/fleet-command.ts +266 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/flow-command.ts +107 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/flow-maintenance.ts +238 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/herdr-layout.ts +281 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/hermes-bridge-core.ts +241 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/hermes-monitor-events.ts +1 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/hermes-monitor-herdr.ts +2 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/hermes-monitor-model.ts +3 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/hermes-monitor-registry.ts +2 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/hermes-monitor-socket.ts +2 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/hermes-monitor-store.ts +2 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/monitor-env.ts +146 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/peer-launch.ts +318 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/peer-target.ts +1 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/persona-banner.ts +62 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/persona-dirs.ts +25 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/resource-closure.js +1 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/runtime-dependencies.js +124 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/session-launch.ts +56 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/spawn-stagger.ts +101 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/team-project.ts +178 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/lib/team-snapshot.ts +160 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/package-lock.json +35 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/package.json +9 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/peer-banner.ts +41 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/peer-launch.ts +289 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/pi-session.ts +9 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/team-snapshot.ts +245 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/team-up.ts +385 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/agent-phase.ts +181 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/changes.ts +61 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/debate.ts +149 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/env.ts +36 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/envelopes.ts +169 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/gates.ts +81 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/git.ts +99 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/isolated-snapshot.ts +130 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/merge.ts +95 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/model-profile.ts +22 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/model-visibility.ts +92 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/permissions.ts +137 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/personas.ts +57 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/poll.ts +86 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/project-policy.ts +37 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/quality.ts +65 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/run.ts +109 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts +55 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/trace.ts +52 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/voices.ts +128 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/writer-lease-race.worker.mjs +36 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/lib/writer-lease.ts +148 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/tsconfig.json +22 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/wf-build-test.ts +61 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/wf-debate.ts +87 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/wf-document.ts +50 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/wf-poll.ts +95 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/wf-quality.ts +20 -0
- package/.versions/2.0.23/.pi/agent-fleet/scripts/workflows/wf-scout.ts +40 -0
- package/.versions/2.0.23/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/2.0.23/.pi/agents/model-profiles.yaml +134 -0
- package/.versions/2.0.23/.pi/agents/peers.yaml +147 -0
- package/.versions/2.0.23/.pi/agents/teams.yaml +41 -0
- package/.versions/2.0.23/.pi/agents/voices.yaml +13 -0
- package/.versions/2.0.23/.pi/damage-control-rules.yaml +297 -0
- package/.versions/2.0.23/.pi/extensions/btw/README.md +120 -0
- package/.versions/2.0.23/.pi/extensions/btw/index.ts +916 -0
- package/.versions/2.0.23/.pi/extensions/btw/package.json +6 -0
- package/.versions/2.0.23/.pi/extensions/btw/state.js +179 -0
- package/.versions/2.0.23/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
- package/.versions/2.0.23/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
- package/.versions/2.0.23/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/2.0.23/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/2.0.23/.pi/extensions/compact-and-continue/index.ts +136 -0
- package/.versions/2.0.23/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/2.0.23/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/2.0.23/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/2.0.23/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/2.0.23/.pi/extensions/package-lock.json +1175 -0
- package/.versions/2.0.23/.pi/extensions/package.json +9 -0
- package/.versions/2.0.23/.pi/extensions/pi-voice-stt/README.md +224 -0
- package/.versions/2.0.23/.pi/extensions/pi-voice-stt/config.ts +199 -0
- package/.versions/2.0.23/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/2.0.23/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/2.0.23/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/2.0.23/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/2.0.23/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/README.md +1527 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/acceptance.ts +200 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/access-approval.ts +141 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/action-authorization.ts +10 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/agentic-contract.ts +43 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/agentic-evidence.ts +64 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/agentic-hub.ts +55 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/agentic-runtime.ts +56 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/agentic-sources-worker.mjs +4 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/agentic-sources.ts +74 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/agentic-state.ts +23 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/approval-wait.ts +1 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/artifacts.js +146 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/assertion-ledger.js +67 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/assist-profile.ts +19 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/backend-policy.js +174 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/bounded-output.ts +26 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/budget-recovery.ts +123 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/capability-confirmation.ts +47 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/capability-packs.ts +184 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agent-model-thinking.ts +10 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agent-model.ts +10 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agent-models-substitute.ts +10 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agents-add.ts +9 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agents-drop.ts +9 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agents-history.ts +9 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agents-kill.ts +10 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agents-list.ts +9 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agents-restart.ts +10 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agents-save.ts +9 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/agents-team.ts +9 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/audit.ts +9 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/compound.ts +9 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/coms.ts +9 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/context-command.ts +9 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/context.ts +46 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/debate.ts +9 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/dispatch-policy.ts +9 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/handoff.ts +10 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/hub-report.ts +9 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/models.ts +10 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/poll.ts +9 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/recover.ts +61 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/retry.ts +10 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/task-triage-recover.ts +12 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/task-triage-waive.ts +12 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/watchdog.ts +9 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/work-mode.ts +29 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/commands/zoom.ts +10 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/config/agents.ts +181 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/config/model-profiles.ts +237 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/config/overrides.ts +166 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/context/agent-state.ts +30 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/context/assertions-artifacts.ts +221 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/context/budgets.ts +152 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/context/hub-state.ts +40 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/context-budget-snapshot.ts +105 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/context-compaction-monitor.ts +35 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/context-compaction-preflight.ts +21 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/context-compaction-runtime.ts +69 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/context-compaction.ts +34 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/context-continuity-broker.ts +44 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/context-continuity-child.ts +83 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/context-continuity-client.ts +22 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/context-continuity-compat.ts +30 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/context-continuity-owners.ts +17 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/context-continuity-registry.ts +8 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/context-continuity.ts +82 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/context-pressure.ts +222 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/context-window.js +108 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/damage-guard-approval.ts +59 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/damage-guard-broker.ts +125 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/damage-guard-contract.ts +22 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/damage-guard-descendant.ts +76 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/damage-guard-hub.ts +256 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/damage-guard-identity.ts +12 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/damage-guard-owners.ts +59 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/damage-guard-state.ts +43 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/damage-guard-test-tsconfig.json +19 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/debate-command.ts +176 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/delegate.ts +478 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/deterministic-fs.ts +195 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/diagnostic-probe-extension.ts +26 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/diagnostic-series-budget.ts +178 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-coms.ts +258 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-core.ts +27 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-native-complete.ts +173 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-native-prepare.ts +295 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-native-spawn.ts +255 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-native-types.ts +293 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-native.ts +236 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-observability.ts +225 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-triage-contract.ts +27 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-triage-eval.ts +77 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-triage-policy.ts +29 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-triage-runtime.ts +55 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/dispatch-triage-state.ts +33 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/docs-lane.js +123 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/drift-judge.ts +352 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/drift-runtime.ts +480 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/drift-system1-policy.ts +39 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/drift-system1.ts +469 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/drift-watchdog.js +349 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/evidence-manifest.ts +51 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/execution-evidence.ts +96 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/execution-trace.ts +241 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/external-blocker.js +92 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/adapters.ts +88 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/broker-client.ts +62 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/broker.ts +128 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/child-extension.ts +42 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/descendant.ts +67 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/discovery-worker.mjs +15 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/discovery.ts +126 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/evaluate.ts +57 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/hub.ts +170 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/native-context.ts +8 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/native-fixture.test-support.ts +108 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/owners.ts +100 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/results.ts +55 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/runtime.ts +130 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/semantic-profiles.ts +18 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/sources.ts +69 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/file-discovery/state.ts +22 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/filesystem-tool.ts +166 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/fixtures/registration-surface.json +66 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/fixtures/t0a-synthetic/catalog.ts +189 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/footer.ts +30 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/helpers.ts +270 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/history-projection.ts +116 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/hub-state-audit.js +41 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/index.ts +2617 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/input/completions.ts +82 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/input/shortcuts.ts +20 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/lifecycle/context-pressure.ts +231 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/lifecycle/monitor-session.ts +104 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/lifecycle/session-orchestration.ts +145 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/lifecycle/turn-handlers.ts +90 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/monitor-session-bridge.ts +266 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/no-progress.ts +622 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/operator-watchdog.ts +97 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/orchestration-activation.ts +109 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/orchestration-metrics.ts +78 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/orchestration-route.ts +68 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/package.json +7 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/peer-spawn-plan.ts +116 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/policy/models.ts +153 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/policy/profile-activation.ts +62 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/policy/profile-runtime.ts +120 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/policy/roster.ts +94 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/policy/work-mode.ts +142 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/poll-command.ts +176 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/presentation.ts +54 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-config.ts +22 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-evaluate.ts +138 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-external-git.ts +82 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-external.ts +142 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-feedback.ts +104 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-findings.ts +115 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-local.ts +89 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-observer.ts +106 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-rules.ts +171 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-runtime.ts +318 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-selection.ts +68 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-snapshot-worker.mjs +12 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-snapshot.ts +279 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/proactive-types.ts +70 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/process-obligations.ts +159 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/prompts/context.ts +55 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/prompts/fragments.ts +86 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/prompts/session-start.ts +90 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/prompts/system-prompt.ts +125 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/reconcile.ts +26 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/recover-policy.ts +44 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/recover-state.ts +104 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/recovery-contract.ts +151 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/rerun-policy.ts +40 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/research/controls.ts +74 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/research/runtime.ts +215 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/research/spawn-run.ts +221 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/return-contract.js +349 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/return-extract.js +77 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/review-closure.ts +43 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/review-continuity.ts +73 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/review-findings.js +96 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/review-reuse.ts +47 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/routing-observation.ts +41 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/routing-proposal.ts +46 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/run-budget.js +342 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/run-namespace.js +93 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/runtime-test-check.ts +68 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/safety-routing.ts +28 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/scope-gate.js +233 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/session-audit.ts +331 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/session-health.js +110 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/session-start.ts +42 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/spawn.ts +665 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/specialist-result-receipt.ts +13 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/specialist-result.ts +69 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/system1-activity.ts +625 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/system1-communication-store.ts +217 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/system1-report.ts +275 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/system1-runtime.ts +271 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/task-continuation.ts +4 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/task-resume-contract.ts +70 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-authorization.ts +151 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-config.ts +21 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-contract.ts +14 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-live-stage-boundary.mjs +49 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-obligations.ts +120 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-policy.ts +16 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-review-contract.mjs +43 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-reviewer-only-contract.mjs +156 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-reviewer-only-diagnostics.mjs +112 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-runtime.ts +130 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-stage-guard.ts +21 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/task-triage-state.ts +46 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/timeline.ts +72 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/tool-catalog-runtime.ts +79 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/tool-catalog-state.ts +123 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/tool-protocol.ts +134 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/action-executors.ts +214 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/ask-system1-files.ts +15 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/ask-system1.ts +25 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/coms-tools.ts +139 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/context.ts +144 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/dispatch-agent.ts +88 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/dispatch-execution.ts +641 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/dispatch-triage.ts +16 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/execution-orchestration.ts +22 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/fleet-tools.ts +201 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/herdr-executors.ts +100 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/run-flow.ts +146 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/set-task-tier.ts +31 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/spawn-research.ts +67 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/team-adjust.ts +29 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/tools/verification-contract.ts +80 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/tsconfig.json +22 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/types.ts +66 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/activity-dots.ts +25 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/context-budget.ts +89 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/detail-panel.ts +192 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/fleet-actions.ts +78 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/fleet-dashboard.ts +155 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/fleet-editor.ts +44 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/fleet-source.ts +179 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/grid.ts +159 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/history-store.ts +137 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/history.ts +234 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/pool.ts +103 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/running-strip.ts +2 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/system1-communication.ts +59 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/ui/zoom.ts +206 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/unknown-tool-counter.ts +116 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/version.ts +42 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/watchdog-evaluation.ts +110 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/work-mode-controls.ts +56 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/work-mode.ts +186 -0
- package/.versions/2.0.23/.pi/harnesses/agent-hub/write-isolation.ts +187 -0
- package/.versions/2.0.23/.pi/harnesses/ask-user-remote/README.md +59 -0
- package/.versions/2.0.23/.pi/harnesses/ask-user-remote/index.ts +571 -0
- package/.versions/2.0.23/.pi/harnesses/ask-user-remote/questions.ts +159 -0
- package/.versions/2.0.23/.pi/harnesses/ask-user-remote/race-core.js +124 -0
- package/.versions/2.0.23/.pi/harnesses/ask-user-remote/runtime-ask.ts +83 -0
- package/.versions/2.0.23/.pi/harnesses/coms/README.md +100 -0
- package/.versions/2.0.23/.pi/harnesses/coms/index.ts +285 -0
- package/.versions/2.0.23/.pi/harnesses/coms/package.json +7 -0
- package/.versions/2.0.23/.pi/harnesses/coms/version.ts +42 -0
- package/.versions/2.0.23/.pi/harnesses/damage-control-continue/README.md +161 -0
- package/.versions/2.0.23/.pi/harnesses/damage-control-continue/index.ts +621 -0
- package/.versions/2.0.23/.pi/harnesses/damage-control-continue/package.json +7 -0
- package/.versions/2.0.23/.pi/harnesses/damage-control-continue/result-screen.ts +98 -0
- package/.versions/2.0.23/.pi/harnesses/damage-control-continue/system1-child.ts +45 -0
- package/.versions/2.0.23/.pi/harnesses/damage-control-continue/system1-client.ts +85 -0
- package/.versions/2.0.23/.pi/harnesses/damage-control-continue/system1-guard.ts +65 -0
- package/.versions/2.0.23/.pi/harnesses/damage-control-continue/version.ts +42 -0
- package/.versions/2.0.23/.pi/harnesses/lib/approval-wait.ts +17 -0
- package/.versions/2.0.23/.pi/harnesses/lib/bash-policy-analysis.ts +185 -0
- package/.versions/2.0.23/.pi/harnesses/lib/changed-file-diagnostics.ts +642 -0
- package/.versions/2.0.23/.pi/harnesses/lib/clarification-policy.ts +9 -0
- package/.versions/2.0.23/.pi/harnesses/lib/coms-core-io.ts +415 -0
- package/.versions/2.0.23/.pi/harnesses/lib/coms-core.ts +686 -0
- package/.versions/2.0.23/.pi/harnesses/lib/coms-registry-entry.ts +99 -0
- package/.versions/2.0.23/.pi/harnesses/lib/context-budget-child-prompt.ts +214 -0
- package/.versions/2.0.23/.pi/harnesses/lib/context-budget-hub-prompt.ts +121 -0
- package/.versions/2.0.23/.pi/harnesses/lib/context-budget-view.ts +112 -0
- package/.versions/2.0.23/.pi/harnesses/lib/context-budget.ts +114 -0
- package/.versions/2.0.23/.pi/harnesses/lib/context-compaction-policy.js +35 -0
- package/.versions/2.0.23/.pi/harnesses/lib/damage-action-hash.ts +28 -0
- package/.versions/2.0.23/.pi/harnesses/lib/damage-control-shared.ts +245 -0
- package/.versions/2.0.23/.pi/harnesses/lib/damage-guard-port.ts +25 -0
- package/.versions/2.0.23/.pi/harnesses/lib/damage-policy.ts +35 -0
- package/.versions/2.0.23/.pi/harnesses/lib/damage-result-evidence.ts +25 -0
- package/.versions/2.0.23/.pi/harnesses/lib/damage-result-view.ts +16 -0
- package/.versions/2.0.23/.pi/harnesses/lib/deterministic-handle-path.ts +25 -0
- package/.versions/2.0.23/.pi/harnesses/lib/execution-trace.ts +45 -0
- package/.versions/2.0.23/.pi/harnesses/lib/fixtures/context-budget-profiles.json +11 -0
- package/.versions/2.0.23/.pi/harnesses/lib/fixtures/hub-prompt-operator.legacy.txt +73 -0
- package/.versions/2.0.23/.pi/harnesses/lib/fixtures/hub-prompt-orchestrator.legacy.txt +73 -0
- package/.versions/2.0.23/.pi/harnesses/lib/fleet-dashboard-ops.ts +178 -0
- package/.versions/2.0.23/.pi/harnesses/lib/fleet-dashboard-view.ts +172 -0
- package/.versions/2.0.23/.pi/harnesses/lib/fleet-detail-view.ts +339 -0
- package/.versions/2.0.23/.pi/harnesses/lib/fleet-overlay.ts +26 -0
- package/.versions/2.0.23/.pi/harnesses/lib/fleet-panel.ts +34 -0
- package/.versions/2.0.23/.pi/harnesses/lib/fleet-read-model.ts +609 -0
- package/.versions/2.0.23/.pi/harnesses/lib/fleet-selection.ts +24 -0
- package/.versions/2.0.23/.pi/harnesses/lib/fleet-strip-controller.ts +75 -0
- package/.versions/2.0.23/.pi/harnesses/lib/fleet-strip-view.ts +179 -0
- package/.versions/2.0.23/.pi/harnesses/lib/fleet-transcript-store.ts +244 -0
- package/.versions/2.0.23/.pi/harnesses/lib/herdr-client.ts +472 -0
- package/.versions/2.0.23/.pi/harnesses/lib/herdr-presence.ts +399 -0
- package/.versions/2.0.23/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
- package/.versions/2.0.23/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
- package/.versions/2.0.23/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
- package/.versions/2.0.23/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
- package/.versions/2.0.23/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
- package/.versions/2.0.23/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
- package/.versions/2.0.23/.pi/harnesses/lib/identical-dialog.ts +27 -0
- package/.versions/2.0.23/.pi/harnesses/lib/installation-state.js +62 -0
- package/.versions/2.0.23/.pi/harnesses/lib/peer-target.ts +24 -0
- package/.versions/2.0.23/.pi/harnesses/lib/policy-roots.js +117 -0
- package/.versions/2.0.23/.pi/harnesses/lib/policy-roots.ts +32 -0
- package/.versions/2.0.23/.pi/harnesses/lib/process-shared.ts +9 -0
- package/.versions/2.0.23/.pi/harnesses/lib/resource-closure.js +26 -0
- package/.versions/2.0.23/.pi/harnesses/lib/safe-source-read.js +29 -0
- package/.versions/2.0.23/.pi/harnesses/lib/semantic-approval.ts +80 -0
- package/.versions/2.0.23/.pi/harnesses/lib/session-target.ts +62 -0
- package/.versions/2.0.23/.pi/harnesses/lib/spawned-peers.js +191 -0
- package/.versions/2.0.23/.pi/harnesses/lib/system1/config-agentic.js +15 -0
- package/.versions/2.0.23/.pi/harnesses/lib/system1/config-context-compaction.js +16 -0
- package/.versions/2.0.23/.pi/harnesses/lib/system1/config-damage-guard.js +24 -0
- package/.versions/2.0.23/.pi/harnesses/lib/system1/config-file-discovery.js +23 -0
- package/.versions/2.0.23/.pi/harnesses/lib/system1/config-json.js +37 -0
- package/.versions/2.0.23/.pi/harnesses/lib/system1/config-loader.js +53 -0
- package/.versions/2.0.23/.pi/harnesses/lib/system1/config-proactive.js +68 -0
- package/.versions/2.0.23/.pi/harnesses/lib/system1/config-triage.js +42 -0
- package/.versions/2.0.23/.pi/harnesses/lib/system1/config-v2.js +112 -0
- package/.versions/2.0.23/.pi/harnesses/lib/system1/config.js +50 -0
- package/.versions/2.0.23/.pi/harnesses/lib/system1/contracts.ts +154 -0
- package/.versions/2.0.23/.pi/harnesses/lib/system1/demo.ts +95 -0
- package/.versions/2.0.23/.pi/harnesses/lib/system1/jev.ts +503 -0
- package/.versions/2.0.23/.pi/harnesses/lib/system1/payload-screen.ts +65 -0
- package/.versions/2.0.23/.pi/harnesses/lib/system1/selection.js +11 -0
- package/.versions/2.0.23/.pi/harnesses/lib/system1/service.ts +245 -0
- package/.versions/2.0.23/.pi/harnesses/lib/system1/worktree-scopes.js +110 -0
- package/.versions/2.0.23/.pi/harnesses/lib/system1/worktree-scopes.ts +13 -0
- package/.versions/2.0.23/.pi/harnesses/lib/system1/worktree-service.ts +24 -0
- package/.versions/2.0.23/.pi/harnesses/lib/target-capabilities.js +7 -0
- package/.versions/2.0.23/.pi/harnesses/lib/update-check.ts +222 -0
- package/.versions/2.0.23/.pi/harnesses/lib/workspace-context.js +115 -0
- package/.versions/2.0.23/.pi/harnesses/lib/workspace-context.ts +22 -0
- package/.versions/2.0.23/.pi/harnesses/package-lock.json +2121 -0
- package/.versions/2.0.23/.pi/harnesses/package.json +13 -0
- package/.versions/2.0.23/.pi/prompts/af-build.md +27 -0
- package/.versions/2.0.23/.pi/prompts/af-code-simplify.md +22 -0
- package/.versions/2.0.23/.pi/prompts/af-constraints.md +31 -0
- package/.versions/2.0.23/.pi/prompts/af-plan.md +17 -0
- package/.versions/2.0.23/.pi/prompts/af-review.md +16 -0
- package/.versions/2.0.23/.pi/prompts/af-set-hermes-telegram.md +15 -0
- package/.versions/2.0.23/.pi/prompts/af-set-hermes-watchdog.md +6 -0
- package/.versions/2.0.23/.pi/prompts/af-setup-rules.md +20 -0
- package/.versions/2.0.23/.pi/prompts/af-ship.md +17 -0
- package/.versions/2.0.23/.pi/prompts/af-spec.md +15 -0
- package/.versions/2.0.23/.pi/prompts/af-test.md +19 -0
- package/.versions/2.0.23/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/2.0.23/.version +1 -0
- package/.versions/2.0.23/agents/architect.md +24 -0
- package/.versions/2.0.23/agents/bowser.md +28 -0
- package/.versions/2.0.23/agents/builder.md +55 -0
- package/.versions/2.0.23/agents/code-reviewer.md +209 -0
- package/.versions/2.0.23/agents/deep-researcher.md +32 -0
- package/.versions/2.0.23/agents/documenter.md +22 -0
- package/.versions/2.0.23/agents/orchestrator.md +22 -0
- package/.versions/2.0.23/agents/plan-reviewer.md +83 -0
- package/.versions/2.0.23/agents/planner.md +107 -0
- package/.versions/2.0.23/agents/releaser.md +24 -0
- package/.versions/2.0.23/agents/researcher.md +30 -0
- package/.versions/2.0.23/agents/security-auditor.md +167 -0
- package/.versions/2.0.23/agents/test-engineer.md +153 -0
- package/.versions/2.0.23/agents/web-debugger.md +44 -0
- package/.versions/2.0.23/agents/web-performance-auditor.md +194 -0
- package/.versions/2.0.23/bin/catalog/harness-runtime-closure.json +85 -0
- package/.versions/2.0.23/codex/fleet-session-client/SKILL.md +34 -0
- package/.versions/2.0.23/codex/fleet-session-client.zip +0 -0
- package/.versions/2.0.23/docs/ARCHITECTURE.md +1023 -0
- package/.versions/2.0.23/docs/agent-fleet-setup.md +1106 -0
- package/.versions/2.0.23/docs/claude-code-coms-bridge.md +147 -0
- package/.versions/2.0.23/docs/codex-session-bridge.md +219 -0
- package/.versions/2.0.23/docs/coms-hermes-bridge.md +188 -0
- package/.versions/2.0.23/docs/getting-started.md +126 -0
- package/.versions/2.0.23/docs/npm-install.md +535 -0
- package/.versions/2.0.23/docs/pi-extensions.md +455 -0
- package/.versions/2.0.23/docs/pi-setup.md +92 -0
- package/.versions/2.0.23/docs/skill-anatomy.md +150 -0
- package/.versions/2.0.23/install-manifest.json +3251 -0
- package/.versions/2.0.23/justfile +247 -0
- package/.versions/2.0.23/manifest-meta.json +1096 -0
- package/.versions/2.0.23/references/accessibility-checklist.md +160 -0
- package/.versions/2.0.23/references/communication-contract.md +26 -0
- package/.versions/2.0.23/references/definition-of-done.md +67 -0
- package/.versions/2.0.23/references/fleet-coordination-patterns.md +171 -0
- package/.versions/2.0.23/references/observability-checklist.md +92 -0
- package/.versions/2.0.23/references/orchestration-patterns.md +370 -0
- package/.versions/2.0.23/references/performance-checklist.md +236 -0
- package/.versions/2.0.23/references/prompting-patterns.md +380 -0
- package/.versions/2.0.23/references/security-checklist.md +245 -0
- package/.versions/2.0.23/references/testing-patterns.md +235 -0
- package/.versions/2.0.23/references/workflow-authoring.md +304 -0
- package/.versions/2.0.23/skills/_internal/grilling.md +59 -0
- package/.versions/2.0.23/skills/browser-testing-with-devtools/SKILL.md +351 -0
- package/.versions/2.0.23/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.0.23/skills/compound-learning/SKILL.md +137 -0
- package/.versions/2.0.23/skills/constraint-driven-development/SKILL.md +338 -0
- package/.versions/2.0.23/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.0.23/skills/context-engineering/SKILL.md +341 -0
- package/.versions/2.0.23/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.0.23/skills/designing-agents/SKILL.md +394 -0
- package/.versions/2.0.23/skills/designing-agents/pi-harness-authoring.md +222 -0
- package/.versions/2.0.23/skills/drafting-workflows/SKILL.md +143 -0
- package/.versions/2.0.23/skills/drafting-workflows/scripts/make-workflow.ts +177 -0
- package/.versions/2.0.23/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.23/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/2.0.23/skills/idea-refine/SKILL.md +182 -0
- package/.versions/2.0.23/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.23/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.23/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.23/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.23/skills/incremental-implementation/SKILL.md +353 -0
- package/.versions/2.0.23/skills/incremental-implementation.zip +0 -0
- package/.versions/2.0.23/skills/interview-me/SKILL.md +226 -0
- package/.versions/2.0.23/skills/orchestration-verification/SKILL.md +182 -0
- package/.versions/2.0.23/skills/peer-coms/SKILL.md +90 -0
- package/.versions/2.0.23/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.0.23/skills/planning-and-task-breakdown/SKILL.md +318 -0
- package/.versions/2.0.23/skills/planning-and-task-breakdown.zip +0 -0
- package/.versions/2.0.23/skills/repository-ai-setup/SKILL.md +135 -0
- package/.versions/2.0.23/skills/repository-ai-setup/references/agent-fleet-ai-state.template.json +4 -0
- package/.versions/2.0.23/skills/repository-ai-setup/references/apply-contract.md +74 -0
- package/.versions/2.0.23/skills/repository-ai-setup/references/provenance-template.md +16 -0
- package/.versions/2.0.23/skills/repository-ai-setup/references/setup-flow.md +108 -0
- package/.versions/2.0.23/skills/repository-ai-setup/references/verify-setup.md +20 -0
- package/.versions/2.0.23/skills/repository-ai-setup.zip +0 -0
- package/.versions/2.0.23/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.0.23/skills/spec-driven-development/SKILL.md +295 -0
- package/.versions/2.0.23/skills/spec-driven-development.zip +0 -0
- package/.versions/2.0.23/skills/using-agent-skills/SKILL.md +198 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/README.md +430 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +367 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/constraint-driven-development/SKILL.md +311 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +337 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +288 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +238 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +496 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +257 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +524 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +330 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +216 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +245 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +398 -0
- package/.versions/2.0.23/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +192 -0
- package/CHANGELOG.md +15 -0
- package/README.md +4 -1
- package/agents/architect.md +1 -1
- package/agents/bowser.md +1 -1
- package/agents/builder.md +1 -1
- package/agents/code-reviewer.md +1 -1
- package/agents/deep-researcher.md +1 -1
- package/agents/documenter.md +1 -1
- package/agents/orchestrator.md +1 -1
- package/agents/plan-reviewer.md +1 -1
- package/agents/planner.md +1 -1
- package/agents/releaser.md +1 -1
- package/agents/researcher.md +1 -1
- package/agents/security-auditor.md +1 -1
- package/agents/test-engineer.md +1 -1
- package/agents/web-debugger.md +1 -1
- package/agents/web-performance-auditor.md +1 -1
- package/bin/catalog/harness-runtime-closure.json +12 -0
- package/docs/ARCHITECTURE.md +41 -0
- package/docs/agent-fleet-setup.md +5 -2
- package/docs/session-worktree-targeting.md +99 -0
- package/docs/workflows.md +4 -0
- package/install-manifest.json +43 -2
- package/justfile +6 -6
- package/manifest-meta.json +8 -0
- package/package.json +3 -2
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {workspaceRoot,executionRoot,sessionRootsFromEnv} from "../../harnesses/lib/workspace-context.ts";
|
|
2
|
+
import {peerTarget,bindTargetLayout} from "./lib/peer-target.ts";
|
|
1
3
|
// .pi/agent-fleet/scripts/team-snapshot.ts
|
|
2
4
|
//
|
|
3
5
|
// Fleet resume (B5): snapshot / tear down / rebuild a running peer team.
|
|
@@ -26,6 +28,7 @@ import { planSpawnDelays } from "./lib/spawn-stagger.ts";
|
|
|
26
28
|
import { DEFAULT_PROJECT, hubCommand, parseProjectFlag, teamSnapshotPath, teamWorkspaceLabel, validateTeamName, worktreeTag } from "./lib/team-project.ts";
|
|
27
29
|
import {
|
|
28
30
|
assertSnapshotProject,
|
|
31
|
+
assertSnapshotTarget,
|
|
29
32
|
buildSnapshot,
|
|
30
33
|
parseSnapshot,
|
|
31
34
|
resumeRefForPeer,
|
|
@@ -34,11 +37,13 @@ import {
|
|
|
34
37
|
} from "./lib/team-snapshot.ts";
|
|
35
38
|
|
|
36
39
|
const SCRIPT_DIR = path.dirname(fileURLToPath(import.meta.url));
|
|
37
|
-
const REPO_ROOT = path.resolve(SCRIPT_DIR, "..", "..", "..");
|
|
40
|
+
const REPO_ROOT = workspaceRoot(path.resolve(SCRIPT_DIR, "..", "..", ".."));
|
|
41
|
+
const ROOTS=sessionRootsFromEnv();
|
|
42
|
+
let runtimeTarget:ReturnType<typeof peerTarget>;
|
|
38
43
|
// Must match team-up's tag so down/resume target the workspace it created.
|
|
39
|
-
const WORKTREE_TAG = worktreeTag(REPO_ROOT);
|
|
44
|
+
const WORKTREE_TAG = worktreeTag(executionRoot(REPO_ROOT));
|
|
40
45
|
const PEERS_YAML = path.join(REPO_ROOT, ".pi", "agents", "peers.yaml");
|
|
41
|
-
const SNAPSHOT_DIR = path.join(os.homedir(), ".pi", "team-snapshots");
|
|
46
|
+
const SNAPSHOT_DIR = ROOTS?.mode==="targeted"?path.join(ROOTS.workspaceRoot,".pi/agent-sessions/team-snapshots",ROOTS.targetId):path.join(os.homedir(), ".pi", "team-snapshots");
|
|
42
47
|
|
|
43
48
|
function die(msg: string): never {
|
|
44
49
|
console.error(msg);
|
|
@@ -107,6 +112,7 @@ async function captureSnapshot(client: Client, team: string, project = DEFAULT_P
|
|
|
107
112
|
panes,
|
|
108
113
|
agents: inWorkspace as Parameters<typeof buildSnapshot>[0]["agents"],
|
|
109
114
|
tag: WORKTREE_TAG,
|
|
115
|
+
...(runtimeTarget?{sessionRoots:runtimeTarget.roots,baseProject:runtimeTarget.baseProject}:{}),
|
|
110
116
|
});
|
|
111
117
|
const file = snapshotPath(team, project);
|
|
112
118
|
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
@@ -140,6 +146,7 @@ async function cmdResume(team: string, project = DEFAULT_PROJECT): Promise<void>
|
|
|
140
146
|
}
|
|
141
147
|
const snap = parseSnapshot(fs.readFileSync(file, "utf-8"));
|
|
142
148
|
try {
|
|
149
|
+
assertSnapshotTarget(snap,ROOTS);
|
|
143
150
|
assertSnapshotProject(snap, project);
|
|
144
151
|
if (snap.team !== team) throw new Error(`Snapshot team mismatch: snapshot is ${JSON.stringify(snap.team)}, requested ${JSON.stringify(team)}.`);
|
|
145
152
|
} catch (err) {
|
|
@@ -181,7 +188,7 @@ async function cmdResume(team: string, project = DEFAULT_PROJECT): Promise<void>
|
|
|
181
188
|
if (staggerNeeded) {
|
|
182
189
|
console.log("Stale pi OAuth token detected — staggering pane starts so one pane can refresh it first.");
|
|
183
190
|
}
|
|
184
|
-
const layout = buildTeamLayout({
|
|
191
|
+
const layout = bindTargetLayout(buildTeamLayout({
|
|
185
192
|
team: snap.team,
|
|
186
193
|
peers: snap.peers,
|
|
187
194
|
repoRoot: REPO_ROOT,
|
|
@@ -189,11 +196,11 @@ async function cmdResume(team: string, project = DEFAULT_PROJECT): Promise<void>
|
|
|
189
196
|
delayForPeer,
|
|
190
197
|
project,
|
|
191
198
|
...(snap.hub ? { hub: { command: hubCommand(project), label: "hub", ratio: 0.4 } } : {}),
|
|
192
|
-
});
|
|
199
|
+
}),runtimeTarget);
|
|
193
200
|
|
|
194
201
|
const created = await client.herdr.workspaceCreate({
|
|
195
202
|
label: workspaceLabel,
|
|
196
|
-
cwd: REPO_ROOT,
|
|
203
|
+
cwd: ROOTS?.executionRoot??REPO_ROOT,
|
|
197
204
|
focus: false,
|
|
198
205
|
});
|
|
199
206
|
const wsId = created.workspace.workspace_id;
|
|
@@ -224,6 +231,7 @@ async function main(): Promise<void> {
|
|
|
224
231
|
try {
|
|
225
232
|
validateTeamName(team);
|
|
226
233
|
project = parseProjectFlag(argv.slice(2));
|
|
234
|
+
runtimeTarget=peerTarget(project);if(runtimeTarget)project=runtimeTarget.project;
|
|
227
235
|
} catch (err) {
|
|
228
236
|
die(err instanceof Error ? err.message : String(err));
|
|
229
237
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {workspaceRoot} from "../../harnesses/lib/workspace-context.ts";
|
|
2
|
+
import {peerTarget,bindTargetLayout} from "./lib/peer-target.ts";
|
|
1
3
|
// .pi/agent-fleet/scripts/team-up.ts
|
|
2
4
|
//
|
|
3
5
|
// Spawn a team of reusable coms peers (from .pi/agents/peers.yaml) into a
|
|
@@ -51,7 +53,7 @@ import {
|
|
|
51
53
|
} from "./lib/team-project.ts";
|
|
52
54
|
|
|
53
55
|
const SCRIPT_DIR = path.dirname(fileURLToPath(import.meta.url));
|
|
54
|
-
const REPO_ROOT = fs.realpathSync(path.resolve(SCRIPT_DIR, "..", "..", ".."));
|
|
56
|
+
const REPO_ROOT = workspaceRoot(fs.realpathSync(path.resolve(SCRIPT_DIR, "..", "..", "..")));
|
|
55
57
|
// Scopes the workspace label to this checkout so the same team from another
|
|
56
58
|
// repo/worktree gets its own workspace instead of colliding (see worktreeTag).
|
|
57
59
|
const WORKTREE_TAG = worktreeTag(REPO_ROOT);
|
|
@@ -165,9 +167,10 @@ function buildLayoutOrDie(
|
|
|
165
167
|
project: string,
|
|
166
168
|
rootPane?: { command: string[]; label: string; ratio: number; cwd?: string; env?: Record<string, string> },
|
|
167
169
|
delayForPeer?: (p: Peer) => number | undefined,
|
|
170
|
+
target?:ReturnType<typeof peerTarget>,
|
|
168
171
|
): LayoutNode {
|
|
169
172
|
try {
|
|
170
|
-
return buildTeamLayout({
|
|
173
|
+
return bindTargetLayout(buildTeamLayout({
|
|
171
174
|
team,
|
|
172
175
|
peers,
|
|
173
176
|
repoRoot: REPO_ROOT,
|
|
@@ -175,7 +178,7 @@ function buildLayoutOrDie(
|
|
|
175
178
|
project,
|
|
176
179
|
...(delayForPeer ? { delayForPeer } : {}),
|
|
177
180
|
...(rootPane ? { hub: rootPane } : {}),
|
|
178
|
-
});
|
|
181
|
+
}),target);
|
|
179
182
|
} catch (err) {
|
|
180
183
|
die(err instanceof Error ? err.message : String(err));
|
|
181
184
|
}
|
|
@@ -186,9 +189,11 @@ async function main(): Promise<void> {
|
|
|
186
189
|
let team: string | null = null;
|
|
187
190
|
let peersYaml = DEFAULT_PEERS_YAML;
|
|
188
191
|
let project = DEFAULT_PROJECT;
|
|
192
|
+
let target:ReturnType<typeof peerTarget>;
|
|
189
193
|
try {
|
|
190
194
|
team = flagValue(argv, "--team");
|
|
191
195
|
project = parseProjectFlag(argv);
|
|
196
|
+
target=peerTarget(project);if(target)project=target.project;
|
|
192
197
|
// --peers: alternate manifest path (tests use it; defaults to the repo's).
|
|
193
198
|
peersYaml = flagValue(argv, "--peers") ?? DEFAULT_PEERS_YAML;
|
|
194
199
|
} catch (err) {
|
|
@@ -206,6 +211,7 @@ async function main(): Promise<void> {
|
|
|
206
211
|
hub = booleanFlag(argv, "--hub");
|
|
207
212
|
hubBrowser = booleanFlag(argv, "--browser");
|
|
208
213
|
hubAllExtensions = booleanFlag(argv, "--all-extensions");
|
|
214
|
+
if(target&&hubAllExtensions)throw Error("Targeted teams refuse --all-extensions; select explicit workspace resources");
|
|
209
215
|
hubNoComs = booleanFlag(argv, "--no-coms");
|
|
210
216
|
const workMode = flagValue(argv, "--work-mode");
|
|
211
217
|
if (workMode && workMode !== "operator" && workMode !== "orchestrator") {
|
|
@@ -236,7 +242,8 @@ async function main(): Promise<void> {
|
|
|
236
242
|
} catch (err) {
|
|
237
243
|
die(err instanceof Error ? err.message : String(err));
|
|
238
244
|
}
|
|
239
|
-
if
|
|
245
|
+
if(conductor&&target)die('Targeted Hermes conductor is unsupported: external profile split-root contract is unverified; use --hub or a targeted Pi peer');
|
|
246
|
+
if (hub && conductor) die("--hub and --conductor are mutually exclusive");
|
|
240
247
|
const mode: "peers" | "hub" | "conductor" = hub ? "hub" : conductor ? "conductor" : "peers";
|
|
241
248
|
|
|
242
249
|
if (!team) {
|
|
@@ -261,7 +268,7 @@ async function main(): Promise<void> {
|
|
|
261
268
|
team,
|
|
262
269
|
project,
|
|
263
270
|
}) : undefined;
|
|
264
|
-
label = teamWorkspaceLabel(spec?.workspaceMode ?? (hub ? "hub" : "peers"), team, project, WORKTREE_TAG);
|
|
271
|
+
label = teamWorkspaceLabel(spec?.workspaceMode ?? (hub ? "hub" : "peers"), team, project, target?worktreeTag(target.roots.executionRoot):WORKTREE_TAG);
|
|
265
272
|
} catch (err) {
|
|
266
273
|
die(err instanceof Error ? err.message : String(err));
|
|
267
274
|
}
|
|
@@ -293,7 +300,7 @@ async function main(): Promise<void> {
|
|
|
293
300
|
if (dryRun) {
|
|
294
301
|
// No herdr calls and no env_file reads on this path — must work with no
|
|
295
302
|
// herdr installed, and secrets never reach the output.
|
|
296
|
-
const layout = buildLayoutOrDie(team, peers, makeEnvLoader(peers, true), project, rootPane);
|
|
303
|
+
const layout = buildLayoutOrDie(team, peers, makeEnvLoader(peers, true), project, rootPane, undefined, target);
|
|
297
304
|
const projectNote = project === DEFAULT_PROJECT ? "" : `, project "${project}"`;
|
|
298
305
|
const extra = mode === "hub" ? " + hub" : spec ? " + Hermes conductor" : "";
|
|
299
306
|
console.log(
|
|
@@ -304,11 +311,11 @@ async function main(): Promise<void> {
|
|
|
304
311
|
const envNote = p.env_file ? ` [env_file: ${p.env_file} — values redacted]` : "";
|
|
305
312
|
console.log(`${p.name}\t${cmd.join(" ")}${envNote}`);
|
|
306
313
|
}
|
|
307
|
-
console.log(JSON.stringify({ label, layout }, null, 2));
|
|
314
|
+
console.log(JSON.stringify({ label, layout,...(target?{workspaceRoot:target.roots.workspaceRoot,executionRoot:target.roots.executionRoot,targetId:target.roots.targetId,baseProject:target.baseProject,project:target.project}:{}) }, null, 2));
|
|
308
315
|
return;
|
|
309
316
|
}
|
|
310
317
|
|
|
311
|
-
const layout = buildLayoutOrDie(team, peers, makeEnvLoader(peers, false), project, rootPane, makeDelayLoader(peers, mode));
|
|
318
|
+
const layout = buildLayoutOrDie(team, peers, makeEnvLoader(peers, false), project, rootPane, makeDelayLoader(peers, mode), target);
|
|
312
319
|
|
|
313
320
|
// Import lazily so --dry-run never touches the client (or the socket).
|
|
314
321
|
const { herdr, requireHerdr, HerdrUnavailableError } = await import(
|
|
@@ -341,7 +348,7 @@ async function main(): Promise<void> {
|
|
|
341
348
|
process.exit(1);
|
|
342
349
|
}
|
|
343
350
|
|
|
344
|
-
const created = await herdr.workspaceCreate({ label, cwd: REPO_ROOT, focus: false });
|
|
351
|
+
const created = await herdr.workspaceCreate({ label, cwd: target?.roots.executionRoot??REPO_ROOT, focus: false });
|
|
345
352
|
const wsId = created.workspace.workspace_id;
|
|
346
353
|
const initialTab = created.workspace.active_tab_id ?? created.tab?.tab_id;
|
|
347
354
|
await herdr.layoutApply({ workspace_id: wsId, root: layout });
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {sessionRootsFromEnv,executionRoot} from "../../../../harnesses/lib/workspace-context.ts";
|
|
1
2
|
import { profileFallback } from './model-profile.ts';
|
|
2
3
|
import type { ChildProcess } from "node:child_process";
|
|
3
4
|
import { existsSync, mkdtempSync, mkdirSync, readFileSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
|
|
@@ -64,7 +65,8 @@ function readMeta(path: string): SessionMeta {
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
export async function runAgentPhase<T = unknown>(options: AgentPhaseOptions<T>): Promise<T> {
|
|
67
|
-
const cwd = options.cwd ?? process.cwd();
|
|
68
|
+
const cwd = options.cwd ?? executionRoot(process.cwd());
|
|
69
|
+
const binding=sessionRootsFromEnv();
|
|
68
70
|
const agentKey = options.persona.name.toLowerCase();
|
|
69
71
|
const model = resolvePhaseModel(options.persona, options.model);
|
|
70
72
|
const thinking = resolvePhaseThinking(options.persona, options.thinking);
|
|
@@ -104,7 +106,7 @@ export async function runAgentPhase<T = unknown>(options: AgentPhaseOptions<T>):
|
|
|
104
106
|
options.run.trace.write("log", { phase: options.persona.name, message: `session recycled before spawn — ${overflow.message}` });
|
|
105
107
|
}
|
|
106
108
|
let measuredTokens = meta.contextTokens;
|
|
107
|
-
const scoutBoundary = options.dataReadRoot ? fileURLToPath(new URL("./scout-data-boundary.ts", import.meta.url)) : null;
|
|
109
|
+
const scoutBoundary = options.dataReadRoot ? binding?.mode==="targeted"?resolve(binding.resourceRoot,".pi/agent-fleet/scripts/workflows/lib/scout-data-boundary.ts"):fileURLToPath(new URL("./scout-data-boundary.ts", import.meta.url)) : null;
|
|
108
110
|
// Pi needs writable trust/auth locks even during read-only reconnaissance.
|
|
109
111
|
// Copy only runtime configuration, never the user's extensions or sessions.
|
|
110
112
|
const runtime = options.dataReadRoot ? mkdtempSync(resolve(directory, "pi-runtime-")) : null;
|
|
@@ -135,7 +137,7 @@ export async function runAgentPhase<T = unknown>(options: AgentPhaseOptions<T>):
|
|
|
135
137
|
model, tools: options.persona.tools, thinking,
|
|
136
138
|
systemPrompt: replacement, noSkills: true, noContextFiles: true, sessionFile, resume, prompt, cwd,
|
|
137
139
|
extensions: scoutBoundary
|
|
138
|
-
? [fileURLToPath(new URL("../../../../../.pi/harnesses/damage-control-continue/index.ts", import.meta.url)), scoutBoundary]
|
|
140
|
+
? [binding?.mode==="targeted"?resolve(binding.resourceRoot,".pi/harnesses/damage-control-continue/index.ts"):fileURLToPath(new URL("../../../../../.pi/harnesses/damage-control-continue/index.ts", import.meta.url)), scoutBoundary]
|
|
139
141
|
: [".pi/harnesses/damage-control-continue/index.ts"], detached: true, signal: options.run.signal,
|
|
140
142
|
...(options.dataReadRoot ? {
|
|
141
143
|
env: { [SCOUT_DATA_ROOT_ENV]: resolve(options.dataReadRoot), PI_CODING_AGENT_DIR: runtime!, TMPDIR: resolve(runtime!, "tmp") },
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {workspaceRoot,sessionRootsFromEnv} from "../../../../harnesses/lib/workspace-context.ts";
|
|
1
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
3
|
import { resolve } from "node:path";
|
|
3
4
|
|
|
@@ -22,10 +23,11 @@ export function parseEnv(text: string): Record<string, string> {
|
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
export function loadEnv(cwd = process.cwd(), env: NodeJS.ProcessEnv = process.env): Record<string, string> {
|
|
25
|
-
const file = resolve(cwd, ".env");
|
|
26
|
+
const file = resolve(workspaceRoot(cwd), ".env");
|
|
26
27
|
if (!existsSync(file)) return {};
|
|
27
28
|
const loaded: Record<string, string> = {};
|
|
28
29
|
for (const [key, value] of Object.entries(parseEnv(readFileSync(file, "utf8")))) {
|
|
30
|
+
if(sessionRootsFromEnv()?.mode==="targeted"&&(key.startsWith("GIT_")||key.startsWith("AF_SESSION_")||key.startsWith("AF_TARGET_")))throw Error(`workflow_environment_context_override:${key}`);
|
|
29
31
|
if (env[key] !== undefined) continue;
|
|
30
32
|
env[key] = value;
|
|
31
33
|
loaded[key] = value;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {sessionRootsFromEnv,sessionGitEnv,validateSessionRoots} from "../../../../harnesses/lib/workspace-context.ts";
|
|
2
|
+
import {realpathSync} from "node:fs";
|
|
1
3
|
import { spawnSync } from "node:child_process";
|
|
2
4
|
import { changedPaths, permitted, rollBack, snapshot, type PermissionPolicy, type PermissionSnapshot } from "./permissions.ts";
|
|
3
5
|
|
|
@@ -16,7 +18,8 @@ export interface FlowBranchMetadata {
|
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
function git(cwd: string, args: string[]): string {
|
|
19
|
-
const
|
|
21
|
+
const roots=sessionRootsFromEnv();if(roots){validateSessionRoots(roots);if(roots.mode==="targeted"&&realpathSync(cwd)!==roots.executionRoot)throw new GitOperationError("flow_git_target_mismatch");}
|
|
22
|
+
const result = spawnSync("git", args, { cwd,env:roots?.mode==="targeted"?sessionGitEnv():process.env, encoding: "utf8" });
|
|
20
23
|
if (result.status !== 0) throw new GitOperationError((result.stderr || result.stdout || `git ${args.join(" ")} failed`).trim());
|
|
21
24
|
return result.stdout.trim();
|
|
22
25
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {sessionRootsFromEnv,sessionGitEnv,validateSessionRoots} from "../../../../harnesses/lib/workspace-context.ts";
|
|
2
|
+
import {realpathSync} from 'node:fs';
|
|
1
3
|
import { createHash } from "node:crypto";
|
|
2
4
|
import { execFileSync } from "node:child_process";
|
|
3
5
|
import { chmodSync, closeSync, fstatSync, lstatSync, mkdirSync, openSync, readFileSync, rmSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
|
|
@@ -11,7 +13,7 @@ export interface IsolatedSnapshotManifest {
|
|
|
11
13
|
createdAt: string; entries: SnapshotEntry[]; excluded: string[]; workspace: string;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
function git(cwd: string, args: string[]): string { return execFileSync("git", args, { cwd, encoding: "utf8", maxBuffer: 64 * 1024 * 1024 }); }
|
|
16
|
+
function git(cwd: string, args: string[]): string { return execFileSync("git", args, { cwd,env:sessionRootsFromEnv()?.mode==="targeted"?sessionGitEnv():process.env, encoding: "utf8", maxBuffer: 64 * 1024 * 1024 }); }
|
|
15
17
|
function safeRelative(path: string): string {
|
|
16
18
|
const value = path.replaceAll("\\", "/").replace(/^\.\//, "");
|
|
17
19
|
if (!value || isAbsolute(value) || value.split("/").includes("..") || value.includes("\0")) throw new Error(`Unsafe snapshot path: ${JSON.stringify(path)}`);
|
|
@@ -96,15 +98,17 @@ function writeOwnedFile(root: string, entry: SnapshotEntry, data: Buffer): void
|
|
|
96
98
|
|
|
97
99
|
/** Create a detached local clone plus a stable overlay of the current working tree. Never mutates sourceRoot. */
|
|
98
100
|
export function createIsolatedWorkingTreeSnapshot(sourceRoot: string, workspace: string, manifestPath: string): IsolatedSnapshotManifest {
|
|
99
|
-
const
|
|
101
|
+
const binding=sessionRootsFromEnv();if(binding)validateSessionRoots(binding);
|
|
102
|
+
const root = binding?.mode==='targeted'?realpathSync(sourceRoot):resolve(sourceRoot), target = resolve(workspace);
|
|
103
|
+
if(binding?.mode==='targeted'&&root!==binding.executionRoot)throw Error('snapshot_source_target_mismatch');
|
|
100
104
|
if (target === root || !relative(root, target).startsWith("..")) throw new Error("Snapshot destination must be outside the source tree");
|
|
101
105
|
if (pathExists(target)) throw new Error("Snapshot destination must be newly owned and absent");
|
|
102
106
|
const sourceRevision = git(root, ["rev-parse", "HEAD"]).trim();
|
|
103
107
|
const { included, excluded } = listedPaths(root);
|
|
104
108
|
const first = included.map(path => inspect(root, path));
|
|
105
109
|
mkdirSync(dirname(target), { recursive: true, mode: 0o700 });
|
|
106
|
-
execFileSync("git", ["clone", "--quiet", "--no-hardlinks", "--no-checkout", root, target]);
|
|
107
|
-
execFileSync("git", ["checkout", "--quiet", "--detach", sourceRevision], { cwd: target });
|
|
110
|
+
execFileSync("git", ["clone", "--quiet", "--no-hardlinks", "--no-checkout", root, target],{env:binding?.mode==="targeted"?sessionGitEnv():process.env});
|
|
111
|
+
execFileSync("git", ["checkout", "--quiet", "--detach", sourceRevision], { cwd: target,env:binding?.mode==="targeted"?sessionGitEnv():process.env });
|
|
108
112
|
for (const path of excluded) removeOwnedLeaf(target, path);
|
|
109
113
|
for (const entry of first) {
|
|
110
114
|
if (entry.state === "deleted") removeOwnedLeaf(target, entry.path);
|
|
@@ -119,7 +123,8 @@ export function createIsolatedWorkingTreeSnapshot(sourceRoot: string, workspace:
|
|
|
119
123
|
}
|
|
120
124
|
const second = included.map(path => inspect(root, path));
|
|
121
125
|
if (stateHash(first) !== stateHash(second)) { rmSync(target, { recursive: true, force: true }); throw new Error("Source working tree changed while isolated snapshot was created"); }
|
|
122
|
-
|
|
126
|
+
if(binding)validateSessionRoots(binding);
|
|
127
|
+
const manifest: IsolatedSnapshotManifest = { schema: ISOLATED_SNAPSHOT_SCHEMA, sourceRoot: root, sourceRevision, sourceStateHash: stateHash(second), createdAt: new Date().toISOString(), entries: second, excluded, workspace: target };
|
|
123
128
|
mkdirSync(dirname(manifestPath), { recursive: true, mode: 0o700 }); writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`, { mode: 0o400 });
|
|
124
129
|
return manifest;
|
|
125
130
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {sessionRootsFromEnv,sessionGitEnv,validateSessionRoots,type SessionRoots} from "../../../../harnesses/lib/workspace-context.ts";
|
|
2
|
+
import {realpathSync} from "node:fs";
|
|
1
3
|
import { execFileSync } from "node:child_process";
|
|
2
4
|
import { existsSync, lstatSync, mkdirSync, readFileSync, readlinkSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
|
|
3
5
|
import { dirname, relative, resolve, sep } from "node:path";
|
|
@@ -10,7 +12,7 @@ interface PathState {
|
|
|
10
12
|
worktree?: { kind: "file" | "symlink"; data: string; hash: string };
|
|
11
13
|
headTracked: boolean;
|
|
12
14
|
}
|
|
13
|
-
export interface PermissionSnapshot { cwd: string; paths: Map<string, PathState> }
|
|
15
|
+
export interface PermissionSnapshot { sessionRoots?:SessionRoots;cwd: string; paths: Map<string, PathState> }
|
|
14
16
|
export interface PermissionPolicy { writes?: string[]; protectedGlobs?: string[]; alwaysWritable?: string[] }
|
|
15
17
|
export interface PermissionEnforcement { changed: string[]; violations: string[]; preDirtyPreserved: string[] }
|
|
16
18
|
|
|
@@ -25,8 +27,9 @@ export class PermissionBreach extends Error {
|
|
|
25
27
|
}
|
|
26
28
|
}
|
|
27
29
|
|
|
30
|
+
function checkedEnvironment(cwd:string){const roots=sessionRootsFromEnv();if(roots){validateSessionRoots(roots);if(roots.mode==="targeted"&&realpathSync(cwd)!==roots.executionRoot)throw new PermissionBreach(["target_mismatch"]);}return roots?.mode==="targeted"?sessionGitEnv():process.env;}
|
|
28
31
|
function git(cwd: string, args: string[]): string {
|
|
29
|
-
return execFileSync("git", args, { cwd, encoding: "utf8" });
|
|
32
|
+
return execFileSync("git", args, { cwd,env:checkedEnvironment(cwd), encoding: "utf8" });
|
|
30
33
|
}
|
|
31
34
|
function zlist(value: string): string[] { return value.split("\0").filter(Boolean); }
|
|
32
35
|
function worktreeState(cwd: string, path: string): PathState["worktree"] {
|
|
@@ -44,7 +47,7 @@ function indexState(cwd: string, path: string): PathState["index"] {
|
|
|
44
47
|
return match ? { mode: match[1], object: match[2], stage: match[3] } : undefined;
|
|
45
48
|
}
|
|
46
49
|
function headTracked(cwd: string, path: string): boolean {
|
|
47
|
-
try { execFileSync("git", ["cat-file", "-e", `HEAD:${path}`], { cwd, stdio: "ignore" }); return true; } catch { return false; }
|
|
50
|
+
try { execFileSync("git", ["cat-file", "-e", `HEAD:${path}`], { cwd,env:checkedEnvironment(cwd), stdio: "ignore" }); return true; } catch { return false; }
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
export function snapshot(cwd = process.cwd()): PermissionSnapshot {
|
|
@@ -61,10 +64,12 @@ export function snapshot(cwd = process.cwd()): PermissionSnapshot {
|
|
|
61
64
|
for (const path of new Set([...trackedChanges, ...untracked])) {
|
|
62
65
|
paths.set(path, { path, numstat: stats.get(path) ?? "untracked", index: indexState(cwd, path), worktree: worktreeState(cwd, path), headTracked: headTracked(cwd, path) });
|
|
63
66
|
}
|
|
64
|
-
|
|
67
|
+
const roots=sessionRootsFromEnv();if(roots)validateSessionRoots(roots);
|
|
68
|
+
return { cwd: resolve(cwd), paths,...(roots?{sessionRoots:roots}:{}) };
|
|
65
69
|
}
|
|
66
70
|
function signature(state?: PathState): string { return state ? JSON.stringify(state) : "clean"; }
|
|
67
71
|
export function changedPaths(before: PermissionSnapshot, after: PermissionSnapshot): string[] {
|
|
72
|
+
if(before.sessionRoots?.targetId!==after.sessionRoots?.targetId)throw new PermissionBreach(["target_changed"]);
|
|
68
73
|
const paths = new Set([...before.paths.keys(), ...after.paths.keys()]);
|
|
69
74
|
return [...paths].filter(path => signature(before.paths.get(path)) !== signature(after.paths.get(path))).sort();
|
|
70
75
|
}
|
|
@@ -97,14 +102,15 @@ export function permitted(path: string, policy: PermissionPolicy, cwd = process.
|
|
|
97
102
|
}
|
|
98
103
|
|
|
99
104
|
function restoreState(cwd: string, path: string, state?: PathState): void {
|
|
105
|
+
checkedEnvironment(cwd);
|
|
100
106
|
const full = resolve(cwd, path);
|
|
101
107
|
if (!state) {
|
|
102
|
-
if (headTracked(cwd, path)) execFileSync("git", ["restore", "--source=HEAD", "--staged", "--worktree", "--", path], { cwd });
|
|
103
|
-
else { rmSync(full, { recursive: true, force: true }); try { execFileSync("git", ["update-index", "--force-remove", "--", path], { cwd, stdio: "ignore" }); } catch {} }
|
|
108
|
+
if (headTracked(cwd, path)) execFileSync("git", ["restore", "--source=HEAD", "--staged", "--worktree", "--", path], { cwd,env:checkedEnvironment(cwd) });
|
|
109
|
+
else { rmSync(full, { recursive: true, force: true }); try { execFileSync("git", ["update-index", "--force-remove", "--", path], { cwd,env:checkedEnvironment(cwd), stdio: "ignore" }); } catch {} }
|
|
104
110
|
return;
|
|
105
111
|
}
|
|
106
|
-
if (state.index) execFileSync("git", ["update-index", "--add", "--cacheinfo", `${state.index.mode},${state.index.object},${path}`], { cwd });
|
|
107
|
-
else { try { execFileSync("git", ["update-index", "--force-remove", "--", path], { cwd, stdio: "ignore" }); } catch {} }
|
|
112
|
+
if (state.index) execFileSync("git", ["update-index", "--add", "--cacheinfo", `${state.index.mode},${state.index.object},${path}`], { cwd,env:checkedEnvironment(cwd) });
|
|
113
|
+
else { try { execFileSync("git", ["update-index", "--force-remove", "--", path], { cwd,env:checkedEnvironment(cwd), stdio: "ignore" }); } catch {} }
|
|
108
114
|
rmSync(full, { recursive: true, force: true });
|
|
109
115
|
if (state.worktree) {
|
|
110
116
|
mkdirSync(dirname(full), { recursive: true });
|
|
@@ -114,6 +120,7 @@ function restoreState(cwd: string, path: string, state?: PathState): void {
|
|
|
114
120
|
}
|
|
115
121
|
}
|
|
116
122
|
export function rollBack(before: PermissionSnapshot, paths: string[]): string[] {
|
|
123
|
+
if(before.sessionRoots){validateSessionRoots(before.sessionRoots);if(sessionRootsFromEnv()?.targetId!==before.sessionRoots.targetId)throw new PermissionBreach(['target_changed']);}
|
|
117
124
|
const preserved: string[] = [];
|
|
118
125
|
for (const path of paths) {
|
|
119
126
|
if (before.paths.has(path)) preserved.push(path);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import {workspaceRoot} from "../../../../harnesses/lib/workspace-context.ts";
|
|
1
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
3
|
import { join } from "node:path";
|
|
3
4
|
import { resolvePolicyReferences, resolvePolicyRoots } from "../../../../harnesses/lib/policy-roots.ts";
|
|
4
5
|
|
|
5
6
|
/** Workflow-side reader of the Hub's `## agent-hub` / `## agent-team` rules and docs contract. */
|
|
6
7
|
export function readProjectPolicy(cwd: string): { rulesPaths: string[]; docsPaths: string[] } {
|
|
7
|
-
const file = join(cwd, ".ai", "agent-fleet-overrides.md");
|
|
8
|
+
const file = join(workspaceRoot(cwd), ".ai", "agent-fleet-overrides.md");
|
|
8
9
|
if (!existsSync(file)) return { rulesPaths: [], docsPaths: [] };
|
|
9
10
|
let raw: string;
|
|
10
11
|
try { raw = readFileSync(file, "utf8"); } catch { return { rulesPaths: [], docsPaths: [] }; }
|
|
@@ -29,8 +30,8 @@ export function resolveProjectPolicy(cwd: string, options: { rulesPaths?: string
|
|
|
29
30
|
const configured = readProjectPolicy(cwd);
|
|
30
31
|
const rulesPaths = [...new Set([...configured.rulesPaths, ...(options.rulesPaths ?? [])])];
|
|
31
32
|
const docsPaths = [...new Set([...configured.docsPaths, ...(options.docsPaths ?? [])])];
|
|
32
|
-
for (const path of rulesPaths) if (!existsSync(join(cwd, path))) warn(`agent-fleet-overrides: rules folder "${path}" not found in ${cwd}`);
|
|
33
|
-
for (const path of docsPaths) if (!existsSync(join(cwd, path))) warn(`agent-fleet-overrides: docs entry point "${path}" not found in ${cwd}`);
|
|
34
|
-
const roots=resolvePolicyRoots(cwd,{rulesDirs:rulesPaths,docsPaths});
|
|
33
|
+
for (const path of rulesPaths) if (!existsSync(join(workspaceRoot(cwd), path))) warn(`agent-fleet-overrides: rules folder "${path}" not found in ${cwd}`);
|
|
34
|
+
for (const path of docsPaths) if (!existsSync(join(workspaceRoot(cwd), path))) warn(`agent-fleet-overrides: docs entry point "${path}" not found in ${cwd}`);
|
|
35
|
+
const roots=resolvePolicyRoots(cwd,{rulesDirs:rulesPaths,docsPaths},workspaceRoot(cwd));
|
|
35
36
|
return { rulesPaths:resolvePolicyReferences(roots,rulesPaths,"rules"), docsPaths:resolvePolicyReferences(roots,docsPaths,"docs") };
|
|
36
37
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {workspaceRoot,sessionRootsFromEnv,sessionGitEnv} from "../../../../harnesses/lib/workspace-context.ts";
|
|
1
2
|
import { spawn } from "node:child_process";
|
|
2
3
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
4
|
import { resolve } from "node:path";
|
|
@@ -12,7 +13,7 @@ function splitArgv(value: string): string[] {
|
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
export function qualityCommand(cwd = process.cwd()): string[] {
|
|
15
|
-
const override = resolve(cwd, ".ai", "agent-fleet-overrides.md");
|
|
16
|
+
const override = resolve(workspaceRoot(cwd), ".ai", "agent-fleet-overrides.md");
|
|
16
17
|
if (!existsSync(override)) throw Object.assign(new Error("Flow start refused: configure `quality:` under `## workflows` in .ai/agent-fleet-overrides.md."), { exitCode: 3 });
|
|
17
18
|
const text = readFileSync(override, "utf8");
|
|
18
19
|
const heading = text.match(/^## workflows\s*$/m);
|
|
@@ -31,7 +32,7 @@ export async function executeQuality(argv: string[], options: { cwd?: string; lo
|
|
|
31
32
|
const timeoutMs = (options.timeoutSeconds ?? 1800) * 1000;
|
|
32
33
|
if (!argv.length || !argv[0]) throw new Error("Quality command requires a non-empty argv list");
|
|
33
34
|
const result = await new Promise<{ code: number; stdout: string; stderr: string }>(resolveResult => {
|
|
34
|
-
const child = spawn(argv[0], argv.slice(1), { cwd, env: process.env, shell: false, stdio: ["ignore", "pipe", "pipe"] });
|
|
35
|
+
const child = spawn(argv[0], argv.slice(1), { cwd, env: sessionRootsFromEnv()?.mode==="targeted"?sessionGitEnv():process.env, shell: false, stdio: ["ignore", "pipe", "pipe"] });
|
|
35
36
|
let stdout = "", stderr = "", settled = false;
|
|
36
37
|
let timer: NodeJS.Timeout;
|
|
37
38
|
const onAbort = () => { stderr += "\nCancelled by flow signal"; child.kill("SIGTERM"); };
|
|
@@ -99,6 +99,7 @@ export class Run {
|
|
|
99
99
|
|
|
100
100
|
private finalize(accepted: boolean, reason?: string, exitCode = accepted ? 0 : 1, signal?: NodeJS.Signals): FinishResult {
|
|
101
101
|
this.finished = true;
|
|
102
|
+
if(accepted&&this.trace.currentTarget?.()===false){accepted=false;reason='flow_target_changed';exitCode=1;}
|
|
102
103
|
const status = accepted ? "accepted" : "rejected";
|
|
103
104
|
const banner = accepted ? `FLOW ACCEPTED (${this.trace.runId})` : `FLOW REJECTED (${this.trace.runId})${reason ? `: ${reason}` : ""}`;
|
|
104
105
|
this.lastResult = { accepted, reason, exitCode, status, banner, ...(signal ? { signal } : {}) };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {sessionRootsFromEnv,validateSessionRoots,type SessionRoots} from '../../../../harnesses/lib/workspace-context.ts';
|
|
2
|
+
import { appendFileSync, mkdirSync, readFileSync, realpathSync, existsSync } from "node:fs";
|
|
3
|
+
import { resolve, dirname, relative } from "node:path";
|
|
3
4
|
const runNamespacePath: string = "../../../../../.pi/harnesses/agent-hub/run-namespace.js";
|
|
4
5
|
const { makeRunId } = await import(runNamespacePath) as { makeRunId(): string };
|
|
5
6
|
|
|
@@ -11,14 +12,31 @@ export class FlowTrace {
|
|
|
11
12
|
readonly directory: string;
|
|
12
13
|
readonly file: string;
|
|
13
14
|
private ended = false;
|
|
15
|
+
private readonly roots?:SessionRoots;
|
|
16
|
+
currentTarget():boolean{try{return sessionRootsFromEnv()?.targetId===this.roots?.targetId&&(!this.roots||validateSessionRoots(this.roots).targetId===this.roots.targetId);}catch{return false;}}
|
|
14
17
|
|
|
15
18
|
constructor(options: { cwd?: string; runId?: string; command?: string[]; pid?: number; directory?: string } = {}) {
|
|
16
19
|
this.runId = options.runId ?? makeRunId();
|
|
17
20
|
this.cwd = resolve(options.cwd ?? process.cwd());
|
|
18
|
-
this.
|
|
21
|
+
this.roots=sessionRootsFromEnv();
|
|
22
|
+
if(this.roots?.mode==='targeted'&&realpathSync(this.cwd)!==this.roots.executionRoot)throw Error('flow_trace_target_mismatch');
|
|
23
|
+
const requestedDirectory=options.directory ? resolve(options.directory) : this.roots?.mode==='targeted'?resolve(this.roots.workspaceRoot,'.pi/flow-sessions/targets',this.roots.targetId,this.runId):resolve(this.cwd, ".pi", "flow-sessions", this.runId);
|
|
24
|
+
// Normalize existing ancestors before containment checks (macOS /var aliases
|
|
25
|
+
// and caller-provided session directories can name the same physical root).
|
|
26
|
+
let canonicalDirectory=requestedDirectory;
|
|
27
|
+
if(this.roots?.mode==='targeted'){
|
|
28
|
+
let ancestor=requestedDirectory;
|
|
29
|
+
while(!existsSync(ancestor)){const parent=dirname(ancestor);if(parent===ancestor)throw Error('flow_trace_storage_denied');ancestor=parent;}
|
|
30
|
+
canonicalDirectory=resolve(realpathSync(ancestor),relative(ancestor,requestedDirectory));
|
|
31
|
+
}
|
|
32
|
+
this.directory=canonicalDirectory;
|
|
33
|
+
if(this.roots?.mode==='targeted'){
|
|
34
|
+
if(!this.directory.startsWith(resolve(this.roots.workspaceRoot,'.pi')+'/'))throw Error('flow_trace_outside_workspace');
|
|
35
|
+
let parent=this.directory;while(!existsSync(parent))parent=dirname(parent);const canonical=realpathSync(parent);if(canonical!==this.roots.workspaceRoot&&!canonical.startsWith(this.roots.workspaceRoot+'/'))throw Error('flow_trace_storage_denied');
|
|
36
|
+
}
|
|
19
37
|
this.file = resolve(this.directory, "trace.jsonl");
|
|
20
|
-
mkdirSync(this.directory, { recursive: true });
|
|
21
|
-
this.write("run_start", { pid: options.pid ?? process.pid, command: options.command ?? process.argv });
|
|
38
|
+
mkdirSync(this.directory, { recursive: true, mode:0o700 });
|
|
39
|
+
this.write("run_start", { ...(this.roots?.mode==='targeted'?{sessionTarget:{targetId:this.roots.targetId,workspaceRoot:this.roots.workspaceRoot,executionRoot:this.roots.executionRoot,repositoryRoot:this.roots.repositoryRoot}}:{}), pid: options.pid ?? process.pid, command: options.command ?? process.argv });
|
|
22
40
|
}
|
|
23
41
|
|
|
24
42
|
write(type: string, data: Record<string, unknown> = {}): void {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mkdirSync, readFileSync, realpathSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
1
|
+
import { mkdirSync, readFileSync, realpathSync, rmdirSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { dirname, resolve } from "node:path";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
|
|
@@ -60,6 +60,38 @@ function writeExclusive(file: string, record: WriterLeaseRecord): void {
|
|
|
60
60
|
writeFileSync(file, `${JSON.stringify(record)}\n`, { flag: "wx", mode: 0o600 });
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
// Serialize both reclaim and release. Atomic wx on the final lease file is not
|
|
64
|
+
// enough: two stale readers can each unlink the other's newly acquired lease.
|
|
65
|
+
// An abandoned guard fails closed rather than allowing a second owner.
|
|
66
|
+
const RECOVERY_WAIT_MS = 20;
|
|
67
|
+
const RECOVERY_TIMEOUT_MS = 2000;
|
|
68
|
+
const recoveryWait = new Int32Array(new SharedArrayBuffer(4));
|
|
69
|
+
|
|
70
|
+
function withLeaseTransaction<T>(file: string, callback: () => T): T {
|
|
71
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
72
|
+
const guard = file + ".recovery";
|
|
73
|
+
const deadline = Date.now() + RECOVERY_TIMEOUT_MS;
|
|
74
|
+
while (true) {
|
|
75
|
+
try {
|
|
76
|
+
mkdirSync(guard);
|
|
77
|
+
break;
|
|
78
|
+
} catch (error) {
|
|
79
|
+
if ((error as NodeJS.ErrnoException).code !== "EEXIST") throw error;
|
|
80
|
+
if (Date.now() >= deadline) {
|
|
81
|
+
const blocked = new Error("Writer lease recovery guard is busy or abandoned; inspect before retry") as Error & { code: string };
|
|
82
|
+
blocked.code = "WRITER_LEASE_RECOVERY_BUSY";
|
|
83
|
+
throw blocked;
|
|
84
|
+
}
|
|
85
|
+
Atomics.wait(recoveryWait, 0, 0, RECOVERY_WAIT_MS);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
try {
|
|
89
|
+
return callback();
|
|
90
|
+
} finally {
|
|
91
|
+
rmdirSync(guard);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
63
95
|
export function acquireWriterLease(options: { cwd: string; owner: string; command: string; pid?: number }): WriterLeaseHandle {
|
|
64
96
|
const path = realpathSync(options.cwd);
|
|
65
97
|
const file = writerLeaseFile(options.cwd);
|
|
@@ -70,32 +102,36 @@ export function acquireWriterLease(options: { cwd: string; owner: string; comman
|
|
|
70
102
|
path,
|
|
71
103
|
createdAt: new Date().toISOString(),
|
|
72
104
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const existing = readRecord(file);
|
|
80
|
-
if (existing && pidAlive(existing.pid)) throw new WriterLeaseHeldError(existing, file);
|
|
81
|
-
try { unlinkSync(file); } catch { /* stolen or already gone */ }
|
|
82
|
-
try {
|
|
83
|
-
writeExclusive(file, record);
|
|
84
|
-
return { file, record };
|
|
85
|
-
} catch (error) {
|
|
86
|
-
if ((error as NodeJS.ErrnoException).code === "EEXIST") {
|
|
87
|
-
const raced = readRecord(file);
|
|
88
|
-
if (raced) throw new WriterLeaseHeldError(raced, file);
|
|
105
|
+
return withLeaseTransaction(file, () => {
|
|
106
|
+
try {
|
|
107
|
+
writeExclusive(file, record);
|
|
108
|
+
return { file, record };
|
|
109
|
+
} catch (error) {
|
|
110
|
+
if ((error as NodeJS.ErrnoException).code !== "EEXIST") throw error;
|
|
89
111
|
}
|
|
90
|
-
|
|
91
|
-
|
|
112
|
+
const existing = readRecord(file);
|
|
113
|
+
if (existing && pidAlive(existing.pid)) throw new WriterLeaseHeldError(existing, file);
|
|
114
|
+
try { unlinkSync(file); } catch { /* stale or already gone */ }
|
|
115
|
+
try {
|
|
116
|
+
writeExclusive(file, record);
|
|
117
|
+
return { file, record };
|
|
118
|
+
} catch (error) {
|
|
119
|
+
if ((error as NodeJS.ErrnoException).code === "EEXIST") {
|
|
120
|
+
const raced = readRecord(file);
|
|
121
|
+
if (raced) throw new WriterLeaseHeldError(raced, file);
|
|
122
|
+
}
|
|
123
|
+
throw error;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
92
126
|
}
|
|
93
127
|
|
|
94
128
|
export function releaseWriterLease(handle: WriterLeaseHandle): void {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
129
|
+
withLeaseTransaction(handle.file, () => {
|
|
130
|
+
const existing = readRecord(handle.file);
|
|
131
|
+
if (!existing) return;
|
|
132
|
+
if (existing.pid !== handle.record.pid || existing.owner !== handle.record.owner) return;
|
|
133
|
+
try { unlinkSync(handle.file); } catch { /* already gone */ }
|
|
134
|
+
});
|
|
99
135
|
}
|
|
100
136
|
|
|
101
137
|
export function writerLeaseMode(file: string): number {
|
|
@@ -10,7 +10,7 @@ mix-max:
|
|
|
10
10
|
local-workers:
|
|
11
11
|
version: 2
|
|
12
12
|
defaults:
|
|
13
|
-
model: &qwenWorkers
|
|
13
|
+
model: &qwenWorkers omlx/Qwen3.8-Flash-Next-GSQ-RCO-Q2_0
|
|
14
14
|
thinking: off
|
|
15
15
|
allowed-models:
|
|
16
16
|
- *qwenWorkers
|
|
@@ -69,11 +69,11 @@ local-workers:
|
|
|
69
69
|
model: *qwenWorkers
|
|
70
70
|
integrator: true
|
|
71
71
|
|
|
72
|
-
# Single-model local profile. Every role and service uses
|
|
72
|
+
# Single-model local profile. Every role and service uses omlx/Qwen3.8-Flash-Next-GSQ-RCO-Q2_0.
|
|
73
73
|
local-full:
|
|
74
74
|
version: 2
|
|
75
75
|
defaults:
|
|
76
|
-
model: &qwen36
|
|
76
|
+
model: &qwen36 omlx/Qwen3.8-Flash-Next-GSQ-RCO-Q2_0
|
|
77
77
|
thinking: off
|
|
78
78
|
allowed-models:
|
|
79
79
|
- *qwen36
|
|
@@ -34,6 +34,7 @@ import type {
|
|
|
34
34
|
AgentSession,
|
|
35
35
|
AgentSessionEvent,
|
|
36
36
|
} from "@mariozechner/pi-coding-agent";
|
|
37
|
+
import {sessionRootsFromEnv} from '../../harnesses/lib/workspace-context.ts';
|
|
37
38
|
import {
|
|
38
39
|
getMarkdownTheme,
|
|
39
40
|
copyToClipboard,
|
|
@@ -449,6 +450,7 @@ export default function btwExtension(pi: ExtensionAPI) {
|
|
|
449
450
|
}
|
|
450
451
|
|
|
451
452
|
async function launch(ctx: ExtensionCommandContext, note: string): Promise<void> {
|
|
453
|
+
if(sessionRootsFromEnv()?.mode==='targeted'){ctx.ui.notify('btw is unavailable for --worktree: its in-process fork does not carry Fleet guard registrations. Use dispatch_agent for a guarded side task.','error');return;}
|
|
452
454
|
const mainSession = ctx.sessionManager.getSessionFile();
|
|
453
455
|
if (!mainSession || !existsSync(mainSession)) {
|
|
454
456
|
ctx.ui.notify("btw: no session file to fork yet — send a message first.", "error");
|