pi-subagents 0.79.2 → 0.81.0
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/CHANGELOG.md +56 -0
- package/README.md +1 -1
- package/bundle/agents.js +18 -0
- package/bundle/background-work.js +16 -0
- package/bundle/capability-ceiling.js +22 -0
- package/bundle/child-tool-plan.js +11 -0
- package/bundle/chunk-26C3WLYQ.js +8388 -0
- package/bundle/chunk-2XYWN7QJ.js +128 -0
- package/bundle/chunk-2ZSNH26H.js +4164 -0
- package/bundle/chunk-3DC5KBVP.js +235 -0
- package/bundle/chunk-3IF2PGW7.js +380 -0
- package/bundle/chunk-4QFZZV3O.js +57 -0
- package/bundle/chunk-563BHAZ5.js +1365 -0
- package/bundle/chunk-5LFLVSTM.js +260 -0
- package/bundle/chunk-62OCY2S4.js +14 -0
- package/bundle/chunk-74RT5YQE.js +326 -0
- package/bundle/chunk-7F6RKT6W.js +132 -0
- package/bundle/chunk-7J4ZXMY7.js +18 -0
- package/bundle/chunk-ARRKBB2B.js +179 -0
- package/bundle/chunk-BJN5LUQY.js +458 -0
- package/bundle/chunk-BPS2AGBZ.js +5421 -0
- package/bundle/chunk-CEKS3TFO.js +1337 -0
- package/bundle/chunk-CTPAE36Y.js +94 -0
- package/bundle/chunk-D4EHT5SJ.js +14 -0
- package/bundle/chunk-EYNJ6VL6.js +526 -0
- package/bundle/chunk-G5DKFLLI.js +1185 -0
- package/bundle/chunk-KSWQVGDW.js +1027 -0
- package/bundle/chunk-L5ZHE4L4.js +946 -0
- package/bundle/chunk-LSRUTHT7.js +57 -0
- package/bundle/chunk-N2BN7BF5.js +159 -0
- package/bundle/chunk-NF7IEKBH.js +490 -0
- package/bundle/chunk-NIXWDZZV.js +9 -0
- package/bundle/chunk-NNLASTQE.js +4082 -0
- package/bundle/chunk-TUWLXTAM.js +935 -0
- package/bundle/chunk-UKG4V45O.js +228 -0
- package/bundle/chunk-V2JWDB5U.js +753 -0
- package/bundle/chunk-V3BIUPLU.js +9163 -0
- package/bundle/chunk-V6MR5TOQ.js +270 -0
- package/bundle/chunk-VJHOELQP.js +8245 -0
- package/bundle/chunk-WSBNENFS.js +732 -0
- package/bundle/chunk-XMFLCKMQ.js +16664 -0
- package/bundle/chunk-YFCK7H2S.js +129 -0
- package/bundle/chunk-YYREO77V.js +137 -0
- package/bundle/chunk-Z7KVHQHL.js +173 -0
- package/bundle/chunk-ZBC44JJ3.js +8606 -0
- package/bundle/chunk-ZP3HODFH.js +175 -0
- package/bundle/control-channel.js +11 -0
- package/bundle/delegation.js +14 -0
- package/bundle/external-job-provider.js +20 -0
- package/bundle/external-runs.js +21 -0
- package/bundle/index.js +30 -0
- package/bundle/inspectors.js +8 -0
- package/bundle/intercom-bridge.js +11 -0
- package/bundle/preflight.js +425 -0
- package/bundle/project-panes.js +28 -0
- package/bundle/required-child-extensions.js +6 -0
- package/bundle/shared-types.js +8 -0
- package/bundle/workflow-resources.js +7 -0
- package/docs/agents.md +1 -1
- package/docs/configuration.md +15 -5
- package/docs/extension-api.md +29 -2
- package/docs/observability.md +6 -2
- package/docs/standalone-background.md +3 -3
- package/docs/workflows.md +1 -1
- package/index.d.ts +0 -1
- package/index.js +0 -1
- package/package.json +19 -19
- package/src/agents/advertised-agent-prompt.d.ts +0 -1
- package/src/agents/advertised-agent-prompt.js +0 -1
- package/src/agents/agent-management.d.ts +0 -1
- package/src/agents/agent-management.js +0 -1
- package/src/agents/agent-memory.d.ts +0 -1
- package/src/agents/agent-memory.js +0 -1
- package/src/agents/agent-refinements.d.ts +0 -1
- package/src/agents/agent-refinements.js +0 -1
- package/src/agents/agent-scope.d.ts +0 -1
- package/src/agents/agent-scope.js +0 -1
- package/src/agents/agent-selection.d.ts +0 -1
- package/src/agents/agent-selection.js +0 -1
- package/src/agents/agent-serializer.d.ts +0 -1
- package/src/agents/agent-serializer.js +0 -1
- package/src/agents/agents.d.ts +0 -1
- package/src/agents/agents.js +0 -1
- package/src/agents/builtin-names.d.ts +0 -1
- package/src/agents/builtin-names.js +0 -1
- package/src/agents/chain-serializer.d.ts +0 -1
- package/src/agents/chain-serializer.js +0 -1
- package/src/agents/frontmatter.d.ts +2 -1
- package/src/agents/frontmatter.js +9 -3
- package/src/agents/global-npm-root.d.ts +0 -1
- package/src/agents/global-npm-root.js +0 -1
- package/src/agents/identity.d.ts +0 -1
- package/src/agents/identity.js +0 -1
- package/src/agents/proactive-skills.d.ts +0 -1
- package/src/agents/proactive-skills.js +0 -1
- package/src/agents/runtime-agent-events.d.ts +0 -1
- package/src/agents/runtime-agent-events.js +0 -1
- package/src/agents/runtime-agent-registry.d.ts +0 -1
- package/src/agents/runtime-agent-registry.js +0 -1
- package/src/agents/skills.d.ts +0 -1
- package/src/agents/skills.js +0 -1
- package/src/api/agents.d.ts +0 -1
- package/src/api/agents.js +0 -1
- package/src/api/background-work.d.ts +0 -1
- package/src/api/background-work.js +0 -1
- package/src/api/capability-ceiling.d.ts +0 -1
- package/src/api/capability-ceiling.js +0 -1
- package/src/api/child-tool-plan.d.ts +0 -1
- package/src/api/child-tool-plan.js +0 -1
- package/src/api/control-channel.d.ts +0 -1
- package/src/api/control-channel.js +0 -1
- package/src/api/delegation.d.ts +20 -1
- package/src/api/delegation.js +0 -1
- package/src/api/external-job-provider.d.ts +0 -1
- package/src/api/external-job-provider.js +0 -1
- package/src/api/external-runs.d.ts +0 -1
- package/src/api/external-runs.js +0 -1
- package/src/api/inspectors.d.ts +0 -1
- package/src/api/inspectors.js +0 -1
- package/src/api/intercom-bridge.d.ts +0 -1
- package/src/api/intercom-bridge.js +0 -1
- package/src/api/preflight.d.ts +0 -1
- package/src/api/preflight.js +0 -1
- package/src/api/project-panes.d.ts +0 -1
- package/src/api/project-panes.js +0 -1
- package/src/api/required-child-extensions.d.ts +0 -1
- package/src/api/required-child-extensions.js +0 -1
- package/src/api/shared-types.d.ts +0 -1
- package/src/api/shared-types.js +0 -1
- package/src/api/workflow-resources.d.ts +0 -1
- package/src/api/workflow-resources.js +0 -1
- package/src/extension/active-runs-prompt.d.ts +0 -1
- package/src/extension/active-runs-prompt.js +0 -1
- package/src/extension/config.d.ts +0 -1
- package/src/extension/config.js +3 -1
- package/src/extension/control-notices.d.ts +0 -1
- package/src/extension/control-notices.js +0 -1
- package/src/extension/declaration-pinning.d.ts +0 -1
- package/src/extension/declaration-pinning.js +0 -1
- package/src/extension/doctor.d.ts +0 -1
- package/src/extension/doctor.js +0 -1
- package/src/extension/fanout-child.d.ts +0 -1
- package/src/extension/fanout-child.js +0 -1
- package/src/extension/herdr-pi-bridge.d.ts +0 -1
- package/src/extension/herdr-pi-bridge.js +0 -1
- package/src/extension/index.d.ts +0 -1
- package/src/extension/index.js +40 -18
- package/src/extension/public-execution.d.ts +0 -1
- package/src/extension/public-execution.js +0 -1
- package/src/extension/reply-workflow-script.d.ts +0 -1
- package/src/extension/reply-workflow-script.js +0 -1
- package/src/extension/rpc.d.ts +0 -1
- package/src/extension/rpc.js +0 -1
- package/src/extension/schemas.d.ts +0 -1
- package/src/extension/schemas.js +3 -4
- package/src/extension/steering-notices.d.ts +0 -1
- package/src/extension/steering-notices.js +0 -1
- package/src/extension/subagent-guide.d.ts +0 -1
- package/src/extension/subagent-guide.js +0 -1
- package/src/extension/subagent-options.d.ts +0 -1
- package/src/extension/subagent-options.js +0 -1
- package/src/extension/tool-activation.d.ts +0 -1
- package/src/extension/tool-activation.js +0 -9
- package/src/extension/tool-description.d.ts +0 -1
- package/src/extension/tool-description.js +2 -3
- package/src/extension/tool-result.d.ts +0 -1
- package/src/extension/tool-result.js +0 -1
- package/src/extension/upgrade-notice.d.ts +0 -1
- package/src/extension/upgrade-notice.js +0 -1
- package/src/inspectors/actions.d.ts +0 -1
- package/src/inspectors/actions.js +0 -1
- package/src/inspectors/ghostty/actions.d.ts +0 -1
- package/src/inspectors/ghostty/actions.js +0 -1
- package/src/inspectors/ghostty/plugin.d.ts +0 -1
- package/src/inspectors/ghostty/plugin.js +0 -1
- package/src/inspectors/herdr/actions.d.ts +0 -1
- package/src/inspectors/herdr/actions.js +0 -1
- package/src/inspectors/herdr/client.d.ts +0 -1
- package/src/inspectors/herdr/client.js +0 -1
- package/src/inspectors/herdr/focus.d.ts +0 -1
- package/src/inspectors/herdr/focus.js +0 -1
- package/src/inspectors/herdr/plugin.d.ts +0 -1
- package/src/inspectors/herdr/plugin.js +0 -1
- package/src/inspectors/herdr/project-panes.d.ts +0 -1
- package/src/inspectors/herdr/project-panes.js +0 -1
- package/src/inspectors/inspector-runner.d.ts +0 -1
- package/src/inspectors/inspector-runner.js +0 -1
- package/src/inspectors/plugins.d.ts +0 -1
- package/src/inspectors/plugins.js +0 -1
- package/src/inspectors/session-roots-codec.d.ts +0 -1
- package/src/inspectors/session-roots-codec.js +0 -1
- package/src/inspectors/shell-command.d.ts +0 -1
- package/src/inspectors/shell-command.js +0 -1
- package/src/inspectors/tmux/actions.d.ts +0 -1
- package/src/inspectors/tmux/actions.js +0 -1
- package/src/inspectors/tmux/client.d.ts +0 -1
- package/src/inspectors/tmux/client.js +0 -1
- package/src/inspectors/tmux/plugin.d.ts +0 -1
- package/src/inspectors/tmux/plugin.js +0 -1
- package/src/inspectors/types.d.ts +0 -1
- package/src/inspectors/types.js +0 -1
- package/src/integrations/herdr-status.d.ts +0 -1
- package/src/integrations/herdr-status.js +0 -1
- package/src/integrations/pi-web-session-liveness.d.ts +0 -1
- package/src/integrations/pi-web-session-liveness.js +0 -1
- package/src/integrations/program-status.d.ts +0 -1
- package/src/integrations/program-status.js +0 -1
- package/src/intercom/intercom-bridge.d.ts +0 -1
- package/src/intercom/intercom-bridge.js +0 -1
- package/src/intercom/native-supervisor-channel.d.ts +0 -1
- package/src/intercom/native-supervisor-channel.js +1 -2
- package/src/intercom/result-intercom.d.ts +0 -1
- package/src/intercom/result-intercom.js +0 -1
- package/src/intercom/supervisor-ui.d.ts +0 -1
- package/src/intercom/supervisor-ui.js +0 -1
- package/src/missions/actions.d.ts +0 -1
- package/src/missions/actions.js +0 -1
- package/src/missions/goal-driver.d.ts +0 -1
- package/src/missions/goal-driver.js +0 -1
- package/src/missions/lifecycle.d.ts +0 -1
- package/src/missions/lifecycle.js +0 -1
- package/src/missions/store.d.ts +0 -1
- package/src/missions/store.js +0 -1
- package/src/missions/types.d.ts +0 -1
- package/src/missions/types.js +0 -1
- package/src/missions/workflow-state.d.ts +0 -1
- package/src/missions/workflow-state.js +0 -1
- package/src/policy/authority.d.ts +0 -1
- package/src/policy/authority.js +0 -1
- package/src/profiles/profiles.d.ts +0 -1
- package/src/profiles/profiles.js +0 -1
- package/src/runs/background/active-async-capacity.d.ts +0 -1
- package/src/runs/background/active-async-capacity.js +0 -1
- package/src/runs/background/active-run-index.d.ts +0 -1
- package/src/runs/background/active-run-index.js +0 -1
- package/src/runs/background/async-execution.d.ts +0 -1
- package/src/runs/background/async-execution.js +0 -1
- package/src/runs/background/async-job-tracker.d.ts +0 -1
- package/src/runs/background/async-job-tracker.js +0 -1
- package/src/runs/background/async-resume.d.ts +0 -1
- package/src/runs/background/async-resume.js +0 -1
- package/src/runs/background/async-retention.d.ts +0 -1
- package/src/runs/background/async-retention.js +0 -1
- package/src/runs/background/async-status-snapshot.d.ts +0 -1
- package/src/runs/background/async-status-snapshot.js +0 -1
- package/src/runs/background/async-status.d.ts +0 -1
- package/src/runs/background/async-status.js +0 -1
- package/src/runs/background/auto-drain.d.ts +0 -1
- package/src/runs/background/auto-drain.js +0 -1
- package/src/runs/background/await-async-run.d.ts +0 -1
- package/src/runs/background/await-async-run.js +0 -1
- package/src/runs/background/binary-bootstrap.d.ts +0 -1
- package/src/runs/background/binary-bootstrap.js +0 -1
- package/src/runs/background/calendar-schedule.d.ts +0 -1
- package/src/runs/background/calendar-schedule.js +0 -1
- package/src/runs/background/chain-append.d.ts +0 -1
- package/src/runs/background/chain-append.js +0 -1
- package/src/runs/background/chain-root-attachment.d.ts +0 -1
- package/src/runs/background/chain-root-attachment.js +0 -1
- package/src/runs/background/completion-batcher.d.ts +0 -1
- package/src/runs/background/completion-batcher.js +0 -1
- package/src/runs/background/completion-dedupe.d.ts +0 -1
- package/src/runs/background/completion-dedupe.js +0 -1
- package/src/runs/background/completion-replay.d.ts +0 -1
- package/src/runs/background/completion-replay.js +0 -1
- package/src/runs/background/control-channel.d.ts +0 -1
- package/src/runs/background/control-channel.js +0 -1
- package/src/runs/background/fleet-view.d.ts +0 -1
- package/src/runs/background/fleet-view.js +0 -1
- package/src/runs/background/index-segment.d.ts +0 -1
- package/src/runs/background/index-segment.js +0 -1
- package/src/runs/background/inspect-rpc.d.ts +0 -1
- package/src/runs/background/inspect-rpc.js +0 -1
- package/src/runs/background/notify.d.ts +1 -2
- package/src/runs/background/notify.js +3 -4
- package/src/runs/background/owned-process-tree.d.ts +0 -1
- package/src/runs/background/owned-process-tree.js +0 -1
- package/src/runs/background/parallel-groups.d.ts +0 -1
- package/src/runs/background/parallel-groups.js +0 -1
- package/src/runs/background/pid-namespace.d.ts +0 -1
- package/src/runs/background/pid-namespace.js +0 -1
- package/src/runs/background/process-terminal-candidate.d.ts +0 -1
- package/src/runs/background/process-terminal-candidate.js +0 -1
- package/src/runs/background/process-terminal.d.ts +0 -1
- package/src/runs/background/process-terminal.js +0 -1
- package/src/runs/background/result-delivery-ownership.d.ts +0 -1
- package/src/runs/background/result-delivery-ownership.js +0 -1
- package/src/runs/background/result-files.d.ts +0 -1
- package/src/runs/background/result-files.js +0 -1
- package/src/runs/background/result-watcher.d.ts +0 -1
- package/src/runs/background/result-watcher.js +0 -1
- package/src/runs/background/resume-guidance.d.ts +0 -1
- package/src/runs/background/resume-guidance.js +0 -1
- package/src/runs/background/retained-children.d.ts +0 -1
- package/src/runs/background/retained-children.js +0 -1
- package/src/runs/background/retained-nested-route-tracker.d.ts +0 -1
- package/src/runs/background/retained-nested-route-tracker.js +0 -1
- package/src/runs/background/run-child-session.d.ts +0 -1
- package/src/runs/background/run-child-session.js +18 -1
- package/src/runs/background/run-id-query.d.ts +0 -1
- package/src/runs/background/run-id-query.js +0 -1
- package/src/runs/background/run-id-resolver.d.ts +0 -1
- package/src/runs/background/run-id-resolver.js +0 -1
- package/src/runs/background/run-status.d.ts +0 -1
- package/src/runs/background/run-status.js +0 -1
- package/src/runs/background/runner-aliases.d.ts +0 -1
- package/src/runs/background/runner-aliases.js +0 -1
- package/src/runs/background/runner-child-launch.d.ts +0 -1
- package/src/runs/background/runner-child-launch.js +0 -1
- package/src/runs/background/runner-child-sessions.d.ts +0 -1
- package/src/runs/background/runner-child-sessions.js +0 -1
- package/src/runs/background/runner-http-dispatcher.d.ts +0 -1
- package/src/runs/background/runner-http-dispatcher.js +0 -1
- package/src/runs/background/runner-startup-failure.d.ts +0 -1
- package/src/runs/background/runner-startup-failure.js +0 -1
- package/src/runs/background/scheduled-runs.d.ts +0 -1
- package/src/runs/background/scheduled-runs.js +0 -1
- package/src/runs/background/stale-run-reconciler.d.ts +0 -1
- package/src/runs/background/stale-run-reconciler.js +2 -1
- package/src/runs/background/steering.d.ts +0 -1
- package/src/runs/background/steering.js +0 -1
- package/src/runs/background/subagent-runner-bootstrap.d.ts +0 -1
- package/src/runs/background/subagent-runner-bootstrap.js +0 -1
- package/src/runs/background/subagent-runner.d.ts +0 -1
- package/src/runs/background/subagent-runner.js +0 -1
- package/src/runs/background/subagent-wait.d.ts +0 -1
- package/src/runs/background/subagent-wait.js +0 -1
- package/src/runs/background/terminal-run-index.d.ts +0 -1
- package/src/runs/background/terminal-run-index.js +0 -1
- package/src/runs/background/top-level-async.d.ts +0 -1
- package/src/runs/background/top-level-async.js +0 -1
- package/src/runs/background/wait-completions.d.ts +0 -1
- package/src/runs/background/wait-completions.js +0 -1
- package/src/runs/background/wait-config.d.ts +0 -1
- package/src/runs/background/wait-config.js +0 -1
- package/src/runs/background/wait-subscriptions.d.ts +0 -1
- package/src/runs/background/wait-subscriptions.js +4 -2
- package/src/runs/background/wait-tool.d.ts +0 -1
- package/src/runs/background/wait-tool.js +0 -1
- package/src/runs/background/workflow-terminal-proof.d.ts +0 -1
- package/src/runs/background/workflow-terminal-proof.js +0 -1
- package/src/runs/foreground/async-dismiss-action.d.ts +0 -1
- package/src/runs/foreground/async-dismiss-action.js +0 -1
- package/src/runs/foreground/async-steering-action.d.ts +0 -1
- package/src/runs/foreground/async-steering-action.js +0 -1
- package/src/runs/foreground/async-stop-action.d.ts +0 -1
- package/src/runs/foreground/async-stop-action.js +0 -1
- package/src/runs/foreground/command-action.d.ts +0 -1
- package/src/runs/foreground/command-action.js +0 -1
- package/src/runs/foreground/execution.d.ts +0 -1
- package/src/runs/foreground/execution.js +39 -3
- package/src/runs/foreground/foreground-control.d.ts +0 -1
- package/src/runs/foreground/foreground-control.js +0 -1
- package/src/runs/foreground/foreground-history.d.ts +0 -1
- package/src/runs/foreground/foreground-history.js +0 -1
- package/src/runs/foreground/prompt-audit.d.ts +0 -1
- package/src/runs/foreground/prompt-audit.js +0 -1
- package/src/runs/foreground/subagent-executor.d.ts +0 -1
- package/src/runs/foreground/subagent-executor.js +6 -4
- package/src/runs/foreground/workflow-detach-reconcile.d.ts +0 -1
- package/src/runs/foreground/workflow-detach-reconcile.js +0 -1
- package/src/runs/foreground/workflow-foreground-steering.d.ts +0 -1
- package/src/runs/foreground/workflow-foreground-steering.js +0 -1
- package/src/runs/shared/abort-recovery.d.ts +0 -1
- package/src/runs/shared/abort-recovery.js +0 -1
- package/src/runs/shared/acceptance.d.ts +0 -1
- package/src/runs/shared/acceptance.js +0 -1
- package/src/runs/shared/agent-contract.d.ts +0 -1
- package/src/runs/shared/agent-contract.js +0 -1
- package/src/runs/shared/async-status-projection.d.ts +0 -1
- package/src/runs/shared/async-status-projection.js +0 -1
- package/src/runs/shared/background-process-options.d.ts +0 -1
- package/src/runs/shared/background-process-options.js +0 -1
- package/src/runs/shared/capability-ceiling.d.ts +0 -1
- package/src/runs/shared/capability-ceiling.js +0 -1
- package/src/runs/shared/chain-outputs.d.ts +0 -1
- package/src/runs/shared/chain-outputs.js +0 -1
- package/src/runs/shared/child-commands.d.ts +0 -1
- package/src/runs/shared/child-commands.js +2 -2
- package/src/runs/shared/child-hooks.d.ts +0 -1
- package/src/runs/shared/child-hooks.js +0 -1
- package/src/runs/shared/child-identity.d.ts +0 -1
- package/src/runs/shared/child-identity.js +0 -1
- package/src/runs/shared/child-launch-plan.d.ts +0 -1
- package/src/runs/shared/child-launch-plan.js +0 -1
- package/src/runs/shared/child-launch.d.ts +0 -1
- package/src/runs/shared/child-launch.js +0 -1
- package/src/runs/shared/child-lifecycle.d.ts +0 -1
- package/src/runs/shared/child-lifecycle.js +0 -1
- package/src/runs/shared/child-runtime-config.d.ts +0 -1
- package/src/runs/shared/child-runtime-config.js +0 -1
- package/src/runs/shared/child-session.d.ts +0 -1
- package/src/runs/shared/child-session.js +2 -3
- package/src/runs/shared/child-tool-plan.d.ts +0 -1
- package/src/runs/shared/child-tool-plan.js +0 -1
- package/src/runs/shared/claude-code-adapter.d.ts +0 -1
- package/src/runs/shared/claude-code-adapter.js +0 -1
- package/src/runs/shared/codex-exec-adapter.d.ts +0 -1
- package/src/runs/shared/codex-exec-adapter.js +0 -1
- package/src/runs/shared/context-mode.d.ts +0 -1
- package/src/runs/shared/context-mode.js +0 -1
- package/src/runs/shared/cursor-agent-adapter.d.ts +0 -1
- package/src/runs/shared/cursor-agent-adapter.js +0 -1
- package/src/runs/shared/dynamic-fanout.d.ts +0 -1
- package/src/runs/shared/dynamic-fanout.js +0 -1
- package/src/runs/shared/effective-system-prompt.d.ts +0 -1
- package/src/runs/shared/effective-system-prompt.js +0 -1
- package/src/runs/shared/extension-bindings.d.ts +0 -1
- package/src/runs/shared/extension-bindings.js +0 -1
- package/src/runs/shared/external-cli-contract.d.ts +0 -1
- package/src/runs/shared/external-cli-contract.js +0 -1
- package/src/runs/shared/external-cli-preflight.d.ts +0 -1
- package/src/runs/shared/external-cli-preflight.js +0 -1
- package/src/runs/shared/external-cli-runner.d.ts +0 -1
- package/src/runs/shared/external-cli-runner.js +0 -1
- package/src/runs/shared/external-job-bridge.d.ts +0 -1
- package/src/runs/shared/external-job-bridge.js +0 -1
- package/src/runs/shared/external-job-runner.d.ts +0 -1
- package/src/runs/shared/external-job-runner.js +0 -1
- package/src/runs/shared/fast-mode-extension.d.ts +0 -1
- package/src/runs/shared/fast-mode-extension.js +0 -1
- package/src/runs/shared/git-environment.d.ts +0 -1
- package/src/runs/shared/git-environment.js +0 -1
- package/src/runs/shared/herdr-connection.d.ts +0 -1
- package/src/runs/shared/herdr-connection.js +0 -1
- package/src/runs/shared/herdr-external-adapters.d.ts +0 -1
- package/src/runs/shared/herdr-external-adapters.js +0 -1
- package/src/runs/shared/herdr-machine.d.ts +0 -1
- package/src/runs/shared/herdr-machine.js +0 -1
- package/src/runs/shared/herdr-pi-protocol.d.ts +0 -1
- package/src/runs/shared/herdr-pi-protocol.js +0 -1
- package/src/runs/shared/herdr-placed-run.d.ts +0 -1
- package/src/runs/shared/herdr-placed-run.js +0 -1
- package/src/runs/shared/host-step-status.d.ts +0 -1
- package/src/runs/shared/host-step-status.js +0 -1
- package/src/runs/shared/lane-metadata.d.ts +0 -1
- package/src/runs/shared/lane-metadata.js +0 -1
- package/src/runs/shared/launch-cwd.d.ts +0 -1
- package/src/runs/shared/launch-cwd.js +0 -1
- package/src/runs/shared/long-running-guard.d.ts +0 -1
- package/src/runs/shared/long-running-guard.js +0 -1
- package/src/runs/shared/mcp-config-sources.d.ts +0 -1
- package/src/runs/shared/mcp-config-sources.js +0 -1
- package/src/runs/shared/mcp-direct-tool-allowlist.d.ts +0 -1
- package/src/runs/shared/mcp-direct-tool-allowlist.js +0 -1
- package/src/runs/shared/mcp-direct-tool-grant.d.ts +0 -1
- package/src/runs/shared/mcp-direct-tool-grant.js +0 -1
- package/src/runs/shared/model-resolution-diagnostic.d.ts +0 -1
- package/src/runs/shared/model-resolution-diagnostic.js +0 -1
- package/src/runs/shared/model-resolution.d.ts +0 -1
- package/src/runs/shared/model-resolution.js +0 -1
- package/src/runs/shared/model-scope.d.ts +0 -1
- package/src/runs/shared/model-scope.js +0 -1
- package/src/runs/shared/mutation-evidence.d.ts +0 -1
- package/src/runs/shared/mutation-evidence.js +0 -1
- package/src/runs/shared/nested-events.d.ts +0 -1
- package/src/runs/shared/nested-events.js +0 -1
- package/src/runs/shared/nested-path.d.ts +0 -1
- package/src/runs/shared/nested-path.js +0 -1
- package/src/runs/shared/nested-render.d.ts +0 -1
- package/src/runs/shared/nested-render.js +0 -1
- package/src/runs/shared/orca-progress-tabs.d.ts +0 -1
- package/src/runs/shared/orca-progress-tabs.js +0 -1
- package/src/runs/shared/parallel-handoff.d.ts +0 -1
- package/src/runs/shared/parallel-handoff.js +0 -1
- package/src/runs/shared/parallel-utils.d.ts +0 -1
- package/src/runs/shared/parallel-utils.js +0 -1
- package/src/runs/shared/partial-output.d.ts +0 -1
- package/src/runs/shared/partial-output.js +0 -1
- package/src/runs/shared/permissions.d.ts +0 -1
- package/src/runs/shared/permissions.js +0 -1
- package/src/runs/shared/pi-spawn.d.ts +0 -1
- package/src/runs/shared/pi-spawn.js +0 -1
- package/src/runs/shared/process-signal.d.ts +0 -1
- package/src/runs/shared/process-signal.js +0 -1
- package/src/runs/shared/readonly-drain-observation.d.ts +0 -1
- package/src/runs/shared/readonly-drain-observation.js +0 -1
- package/src/runs/shared/run-fanout-budget.d.ts +0 -1
- package/src/runs/shared/run-fanout-budget.js +0 -1
- package/src/runs/shared/run-ownership.d.ts +0 -1
- package/src/runs/shared/run-ownership.js +0 -1
- package/src/runs/shared/runner-launcher.d.ts +0 -1
- package/src/runs/shared/runner-launcher.js +0 -1
- package/src/runs/shared/runtime-acknowledged-extensions.d.ts +0 -1
- package/src/runs/shared/runtime-acknowledged-extensions.js +0 -1
- package/src/runs/shared/session-lease.d.ts +0 -1
- package/src/runs/shared/session-lease.js +0 -1
- package/src/runs/shared/single-output.d.ts +0 -1
- package/src/runs/shared/single-output.js +0 -1
- package/src/runs/shared/spawn-budget.d.ts +0 -1
- package/src/runs/shared/spawn-budget.js +0 -1
- package/src/runs/shared/structured-output.d.ts +1 -1
- package/src/runs/shared/structured-output.js +1 -1
- package/src/runs/shared/subagent-control.d.ts +0 -1
- package/src/runs/shared/subagent-control.js +0 -1
- package/src/runs/shared/subagent-prompt-runtime.d.ts +0 -1
- package/src/runs/shared/subagent-prompt-runtime.js +2 -2
- package/src/runs/shared/tool-availability.d.ts +0 -1
- package/src/runs/shared/tool-availability.js +0 -1
- package/src/runs/shared/tool-budget.d.ts +0 -1
- package/src/runs/shared/tool-budget.js +0 -1
- package/src/runs/shared/tool-timeout.d.ts +0 -1
- package/src/runs/shared/tool-timeout.js +0 -1
- package/src/runs/shared/usage-budget.d.ts +0 -1
- package/src/runs/shared/usage-budget.js +0 -1
- package/src/runs/shared/usage-reconciliation.d.ts +0 -1
- package/src/runs/shared/usage-reconciliation.js +0 -1
- package/src/runs/shared/workflow-async-child-guidance.d.ts +0 -1
- package/src/runs/shared/workflow-async-child-guidance.js +0 -1
- package/src/runs/shared/workflow-graph.d.ts +0 -1
- package/src/runs/shared/workflow-graph.js +0 -1
- package/src/runs/shared/worktree-cleanup-apply.d.ts +0 -1
- package/src/runs/shared/worktree-cleanup-apply.js +0 -1
- package/src/runs/shared/worktree-cleanup-plan.d.ts +0 -1
- package/src/runs/shared/worktree-cleanup-plan.js +0 -1
- package/src/runs/shared/worktree-lock.d.ts +0 -1
- package/src/runs/shared/worktree-lock.js +0 -1
- package/src/runs/shared/worktree-setup-command.d.ts +0 -1
- package/src/runs/shared/worktree-setup-command.js +0 -1
- package/src/runs/shared/worktree.d.ts +0 -1
- package/src/runs/shared/worktree.js +0 -1
- package/src/shared/accessible-dir.d.ts +0 -1
- package/src/shared/accessible-dir.js +4 -2
- package/src/shared/agent-stream-options.d.ts +0 -1
- package/src/shared/agent-stream-options.js +0 -1
- package/src/shared/artifacts.d.ts +0 -1
- package/src/shared/artifacts.js +0 -1
- package/src/shared/atomic-json.d.ts +0 -1
- package/src/shared/atomic-json.js +0 -1
- package/src/shared/capacity-resilient-json.d.ts +0 -1
- package/src/shared/capacity-resilient-json.js +0 -1
- package/src/shared/child-cache-retention.d.ts +0 -1
- package/src/shared/child-cache-retention.js +0 -1
- package/src/shared/child-session-name.d.ts +0 -1
- package/src/shared/child-session-name.js +0 -1
- package/src/shared/child-transcript.d.ts +0 -1
- package/src/shared/child-transcript.js +0 -1
- package/src/shared/completion-owner.d.ts +0 -1
- package/src/shared/completion-owner.js +0 -1
- package/src/shared/disabled-features.d.ts +0 -1
- package/src/shared/disabled-features.js +0 -1
- package/src/shared/display-text.d.ts +0 -1
- package/src/shared/display-text.js +0 -1
- package/src/shared/edit-distance.d.ts +0 -1
- package/src/shared/edit-distance.js +0 -1
- package/src/shared/extension-context.d.ts +0 -1
- package/src/shared/extension-context.js +0 -1
- package/src/shared/file-coalescer.d.ts +0 -1
- package/src/shared/file-coalescer.js +0 -1
- package/src/shared/file-lease.d.ts +0 -1
- package/src/shared/file-lease.js +0 -1
- package/src/shared/file-system-retry.d.ts +0 -1
- package/src/shared/file-system-retry.js +0 -1
- package/src/shared/fork-context.d.ts +0 -1
- package/src/shared/fork-context.js +0 -1
- package/src/shared/fork-session-cwd.d.ts +0 -1
- package/src/shared/fork-session-cwd.js +0 -1
- package/src/shared/formatters.d.ts +0 -1
- package/src/shared/formatters.js +0 -1
- package/src/shared/jsonl-writer.d.ts +0 -1
- package/src/shared/jsonl-writer.js +0 -1
- package/src/shared/launch-contract.d.ts +0 -1
- package/src/shared/launch-contract.js +0 -1
- package/src/shared/model-info.d.ts +0 -1
- package/src/shared/model-info.js +0 -1
- package/src/shared/model-response-aliases.d.ts +0 -1
- package/src/shared/model-response-aliases.js +0 -1
- package/src/shared/node-executable.d.ts +0 -1
- package/src/shared/node-executable.js +0 -1
- package/src/shared/opencode-session-headers.d.ts +0 -1
- package/src/shared/opencode-session-headers.js +0 -1
- package/src/shared/package-version.d.ts +0 -1
- package/src/shared/package-version.js +0 -1
- package/src/shared/parent-wake.d.ts +9 -7
- package/src/shared/parent-wake.js +12 -15
- package/src/shared/prompt-resources.d.ts +0 -1
- package/src/shared/prompt-resources.js +0 -1
- package/src/shared/provider-diagnostics.d.ts +9 -0
- package/src/shared/provider-diagnostics.js +75 -0
- package/src/shared/pruned-fork.d.ts +0 -1
- package/src/shared/pruned-fork.js +0 -1
- package/src/shared/required-child-extensions.d.ts +0 -1
- package/src/shared/required-child-extensions.js +0 -1
- package/src/shared/runtime-module-path.d.ts +0 -1
- package/src/shared/runtime-module-path.js +0 -1
- package/src/shared/session-file-trust.d.ts +0 -1
- package/src/shared/session-file-trust.js +0 -1
- package/src/shared/session-identity.d.ts +0 -1
- package/src/shared/session-identity.js +0 -1
- package/src/shared/session-succession.d.ts +0 -1
- package/src/shared/session-succession.js +0 -1
- package/src/shared/session-tokens.d.ts +0 -1
- package/src/shared/session-tokens.js +0 -1
- package/src/shared/settings-file-lease.d.ts +0 -1
- package/src/shared/settings-file-lease.js +0 -1
- package/src/shared/settings.d.ts +0 -1
- package/src/shared/settings.js +0 -1
- package/src/shared/shortcuts.d.ts +0 -1
- package/src/shared/shortcuts.js +0 -1
- package/src/shared/status-format.d.ts +0 -1
- package/src/shared/status-format.js +0 -1
- package/src/shared/thinking-ceiling.d.ts +0 -1
- package/src/shared/thinking-ceiling.js +0 -1
- package/src/shared/types.d.ts +5 -1
- package/src/shared/types.js +0 -1
- package/src/shared/utf8.d.ts +0 -1
- package/src/shared/utf8.js +0 -1
- package/src/shared/utils.d.ts +0 -1
- package/src/shared/utils.js +0 -1
- package/src/shared/watch-strategy.d.ts +0 -1
- package/src/shared/watch-strategy.js +0 -1
- package/src/shared/workflow-child-permit.d.ts +0 -1
- package/src/shared/workflow-child-permit.js +0 -1
- package/src/slash/delegation-adapters.d.ts +3 -2
- package/src/slash/delegation-adapters.js +7 -1
- package/src/slash/delegation-json.d.ts +0 -1
- package/src/slash/delegation-json.js +0 -1
- package/src/slash/delegation-request.d.ts +0 -1
- package/src/slash/delegation-request.js +0 -1
- package/src/slash/prompt-template-bridge.d.ts +0 -1
- package/src/slash/prompt-template-bridge.js +3 -2
- package/src/slash/prompt-workflows.d.ts +0 -1
- package/src/slash/prompt-workflows.js +0 -1
- package/src/slash/selector.d.ts +0 -1
- package/src/slash/selector.js +0 -1
- package/src/slash/slash-bridge.d.ts +0 -1
- package/src/slash/slash-bridge.js +0 -1
- package/src/slash/slash-commands.d.ts +0 -1
- package/src/slash/slash-commands.js +1 -2
- package/src/slash/slash-live-state.d.ts +0 -1
- package/src/slash/slash-live-state.js +0 -1
- package/src/slash/subagent-cost.d.ts +0 -1
- package/src/slash/subagent-cost.js +0 -1
- package/src/slash/subagents-admin.d.ts +1 -1
- package/src/slash/subagents-admin.js +1 -2
- package/src/tui/fleet-layout.d.ts +20 -0
- package/src/tui/fleet-layout.js +17 -0
- package/src/tui/fleet-status.d.ts +0 -1
- package/src/tui/fleet-status.js +0 -1
- package/src/tui/fleet-transcript.d.ts +0 -1
- package/src/tui/fleet-transcript.js +0 -1
- package/src/tui/fleet-viewport.d.ts +12 -0
- package/src/tui/fleet-viewport.js +35 -0
- package/src/tui/fleet.d.ts +5 -7
- package/src/tui/fleet.js +69 -52
- package/src/tui/render-helpers.d.ts +0 -1
- package/src/tui/render-helpers.js +0 -1
- package/src/tui/render.d.ts +0 -1
- package/src/tui/render.js +48 -18
- package/src/tui/running-tone.d.ts +0 -1
- package/src/tui/running-tone.js +0 -1
- package/src/tui/subagent-messages.d.ts +0 -1
- package/src/tui/subagent-messages.js +0 -1
- package/src/watchdog/change-signature.d.ts +0 -1
- package/src/watchdog/change-signature.js +0 -1
- package/src/watchdog/child-status.d.ts +0 -1
- package/src/watchdog/child-status.js +0 -1
- package/src/watchdog/diff-tool.d.ts +0 -1
- package/src/watchdog/diff-tool.js +9 -4
- package/src/watchdog/emission-guard.d.ts +0 -1
- package/src/watchdog/emission-guard.js +0 -1
- package/src/watchdog/guidance.d.ts +0 -1
- package/src/watchdog/guidance.js +0 -1
- package/src/watchdog/lsp-diagnostics.d.ts +0 -1
- package/src/watchdog/lsp-diagnostics.js +0 -1
- package/src/watchdog/model-selection.d.ts +0 -1
- package/src/watchdog/model-selection.js +0 -1
- package/src/watchdog/permission-arbiter.d.ts +0 -1
- package/src/watchdog/permission-arbiter.js +0 -1
- package/src/watchdog/register-child.d.ts +0 -1
- package/src/watchdog/register-child.js +0 -1
- package/src/watchdog/register-main.d.ts +2 -1
- package/src/watchdog/register-main.js +8 -8
- package/src/watchdog/render.d.ts +0 -1
- package/src/watchdog/render.js +0 -1
- package/src/watchdog/review.d.ts +0 -1
- package/src/watchdog/review.js +0 -1
- package/src/watchdog/rules.d.ts +0 -1
- package/src/watchdog/rules.js +0 -1
- package/src/watchdog/runtime.d.ts +0 -1
- package/src/watchdog/runtime.js +0 -1
- package/src/watchdog/scope.d.ts +0 -1
- package/src/watchdog/scope.js +0 -1
- package/src/watchdog/settings.d.ts +0 -1
- package/src/watchdog/settings.js +0 -1
- package/src/watchdog/tool-actions.d.ts +0 -1
- package/src/watchdog/tool-actions.js +0 -1
- package/src/watchdog/turn-delta.d.ts +0 -1
- package/src/watchdog/turn-delta.js +0 -1
- package/src/watchdog/types.d.ts +0 -1
- package/src/watchdog/types.js +0 -1
- package/src/watchdog/warning-format.d.ts +0 -1
- package/src/watchdog/warning-format.js +0 -1
- package/src/workflows/chat-progress.d.ts +0 -1
- package/src/workflows/chat-progress.js +0 -1
- package/src/workflows/host-command.d.ts +0 -1
- package/src/workflows/host-command.js +0 -1
- package/src/workflows/scripted-workflow.d.ts +0 -1
- package/src/workflows/scripted-workflow.js +0 -1
- package/src/workflows/structured-workflow-scripts.d.ts +1 -1
- package/src/workflows/structured-workflow-scripts.js +22 -9
- package/src/workflows/workflow-checklist.d.ts +0 -1
- package/src/workflows/workflow-checklist.js +0 -1
- package/src/workflows/workflow-child-summary.d.ts +0 -1
- package/src/workflows/workflow-child-summary.js +0 -1
- package/src/workflows/workflow-preflight.d.ts +0 -1
- package/src/workflows/workflow-preflight.js +0 -1
- package/src/workflows/workflow-receipt.d.ts +0 -1
- package/src/workflows/workflow-receipt.js +0 -1
- package/src/workflows/workflow-resources.d.ts +0 -1
- package/src/workflows/workflow-resources.js +2 -3
- package/src/workflows/workflow-reuse.d.ts +0 -1
- package/src/workflows/workflow-reuse.js +0 -1
- package/src/workflows/workflow-revival.d.ts +0 -1
- package/src/workflows/workflow-revival.js +0 -1
- package/src/workflows/workflow-settlement.d.ts +0 -1
- package/src/workflows/workflow-settlement.js +0 -1
- package/index.d.ts.map +0 -1
- package/index.js.map +0 -1
- package/src/agents/advertised-agent-prompt.d.ts.map +0 -1
- package/src/agents/advertised-agent-prompt.js.map +0 -1
- package/src/agents/agent-management.d.ts.map +0 -1
- package/src/agents/agent-management.js.map +0 -1
- package/src/agents/agent-memory.d.ts.map +0 -1
- package/src/agents/agent-memory.js.map +0 -1
- package/src/agents/agent-refinements.d.ts.map +0 -1
- package/src/agents/agent-refinements.js.map +0 -1
- package/src/agents/agent-scope.d.ts.map +0 -1
- package/src/agents/agent-scope.js.map +0 -1
- package/src/agents/agent-selection.d.ts.map +0 -1
- package/src/agents/agent-selection.js.map +0 -1
- package/src/agents/agent-serializer.d.ts.map +0 -1
- package/src/agents/agent-serializer.js.map +0 -1
- package/src/agents/agents.d.ts.map +0 -1
- package/src/agents/agents.js.map +0 -1
- package/src/agents/builtin-names.d.ts.map +0 -1
- package/src/agents/builtin-names.js.map +0 -1
- package/src/agents/chain-serializer.d.ts.map +0 -1
- package/src/agents/chain-serializer.js.map +0 -1
- package/src/agents/frontmatter.d.ts.map +0 -1
- package/src/agents/frontmatter.js.map +0 -1
- package/src/agents/global-npm-root.d.ts.map +0 -1
- package/src/agents/global-npm-root.js.map +0 -1
- package/src/agents/identity.d.ts.map +0 -1
- package/src/agents/identity.js.map +0 -1
- package/src/agents/proactive-skills.d.ts.map +0 -1
- package/src/agents/proactive-skills.js.map +0 -1
- package/src/agents/runtime-agent-events.d.ts.map +0 -1
- package/src/agents/runtime-agent-events.js.map +0 -1
- package/src/agents/runtime-agent-registry.d.ts.map +0 -1
- package/src/agents/runtime-agent-registry.js.map +0 -1
- package/src/agents/skills.d.ts.map +0 -1
- package/src/agents/skills.js.map +0 -1
- package/src/api/agents.d.ts.map +0 -1
- package/src/api/agents.js.map +0 -1
- package/src/api/background-work.d.ts.map +0 -1
- package/src/api/background-work.js.map +0 -1
- package/src/api/capability-ceiling.d.ts.map +0 -1
- package/src/api/capability-ceiling.js.map +0 -1
- package/src/api/child-tool-plan.d.ts.map +0 -1
- package/src/api/child-tool-plan.js.map +0 -1
- package/src/api/control-channel.d.ts.map +0 -1
- package/src/api/control-channel.js.map +0 -1
- package/src/api/delegation.d.ts.map +0 -1
- package/src/api/delegation.js.map +0 -1
- package/src/api/external-job-provider.d.ts.map +0 -1
- package/src/api/external-job-provider.js.map +0 -1
- package/src/api/external-runs.d.ts.map +0 -1
- package/src/api/external-runs.js.map +0 -1
- package/src/api/inspectors.d.ts.map +0 -1
- package/src/api/inspectors.js.map +0 -1
- package/src/api/intercom-bridge.d.ts.map +0 -1
- package/src/api/intercom-bridge.js.map +0 -1
- package/src/api/preflight.d.ts.map +0 -1
- package/src/api/preflight.js.map +0 -1
- package/src/api/project-panes.d.ts.map +0 -1
- package/src/api/project-panes.js.map +0 -1
- package/src/api/required-child-extensions.d.ts.map +0 -1
- package/src/api/required-child-extensions.js.map +0 -1
- package/src/api/shared-types.d.ts.map +0 -1
- package/src/api/shared-types.js.map +0 -1
- package/src/api/workflow-resources.d.ts.map +0 -1
- package/src/api/workflow-resources.js.map +0 -1
- package/src/extension/active-runs-prompt.d.ts.map +0 -1
- package/src/extension/active-runs-prompt.js.map +0 -1
- package/src/extension/config.d.ts.map +0 -1
- package/src/extension/config.js.map +0 -1
- package/src/extension/control-notices.d.ts.map +0 -1
- package/src/extension/control-notices.js.map +0 -1
- package/src/extension/declaration-pinning.d.ts.map +0 -1
- package/src/extension/declaration-pinning.js.map +0 -1
- package/src/extension/doctor.d.ts.map +0 -1
- package/src/extension/doctor.js.map +0 -1
- package/src/extension/fanout-child.d.ts.map +0 -1
- package/src/extension/fanout-child.js.map +0 -1
- package/src/extension/herdr-pi-bridge.d.ts.map +0 -1
- package/src/extension/herdr-pi-bridge.js.map +0 -1
- package/src/extension/index.d.ts.map +0 -1
- package/src/extension/index.js.map +0 -1
- package/src/extension/public-execution.d.ts.map +0 -1
- package/src/extension/public-execution.js.map +0 -1
- package/src/extension/reply-workflow-script.d.ts.map +0 -1
- package/src/extension/reply-workflow-script.js.map +0 -1
- package/src/extension/rpc.d.ts.map +0 -1
- package/src/extension/rpc.js.map +0 -1
- package/src/extension/schemas.d.ts.map +0 -1
- package/src/extension/schemas.js.map +0 -1
- package/src/extension/steering-notices.d.ts.map +0 -1
- package/src/extension/steering-notices.js.map +0 -1
- package/src/extension/subagent-guide.d.ts.map +0 -1
- package/src/extension/subagent-guide.js.map +0 -1
- package/src/extension/subagent-options.d.ts.map +0 -1
- package/src/extension/subagent-options.js.map +0 -1
- package/src/extension/tool-activation.d.ts.map +0 -1
- package/src/extension/tool-activation.js.map +0 -1
- package/src/extension/tool-description.d.ts.map +0 -1
- package/src/extension/tool-description.js.map +0 -1
- package/src/extension/tool-result.d.ts.map +0 -1
- package/src/extension/tool-result.js.map +0 -1
- package/src/extension/upgrade-notice.d.ts.map +0 -1
- package/src/extension/upgrade-notice.js.map +0 -1
- package/src/inspectors/actions.d.ts.map +0 -1
- package/src/inspectors/actions.js.map +0 -1
- package/src/inspectors/ghostty/actions.d.ts.map +0 -1
- package/src/inspectors/ghostty/actions.js.map +0 -1
- package/src/inspectors/ghostty/plugin.d.ts.map +0 -1
- package/src/inspectors/ghostty/plugin.js.map +0 -1
- package/src/inspectors/herdr/actions.d.ts.map +0 -1
- package/src/inspectors/herdr/actions.js.map +0 -1
- package/src/inspectors/herdr/client.d.ts.map +0 -1
- package/src/inspectors/herdr/client.js.map +0 -1
- package/src/inspectors/herdr/focus.d.ts.map +0 -1
- package/src/inspectors/herdr/focus.js.map +0 -1
- package/src/inspectors/herdr/plugin.d.ts.map +0 -1
- package/src/inspectors/herdr/plugin.js.map +0 -1
- package/src/inspectors/herdr/project-panes.d.ts.map +0 -1
- package/src/inspectors/herdr/project-panes.js.map +0 -1
- package/src/inspectors/inspector-runner.d.ts.map +0 -1
- package/src/inspectors/inspector-runner.js.map +0 -1
- package/src/inspectors/plugins.d.ts.map +0 -1
- package/src/inspectors/plugins.js.map +0 -1
- package/src/inspectors/session-roots-codec.d.ts.map +0 -1
- package/src/inspectors/session-roots-codec.js.map +0 -1
- package/src/inspectors/shell-command.d.ts.map +0 -1
- package/src/inspectors/shell-command.js.map +0 -1
- package/src/inspectors/tmux/actions.d.ts.map +0 -1
- package/src/inspectors/tmux/actions.js.map +0 -1
- package/src/inspectors/tmux/client.d.ts.map +0 -1
- package/src/inspectors/tmux/client.js.map +0 -1
- package/src/inspectors/tmux/plugin.d.ts.map +0 -1
- package/src/inspectors/tmux/plugin.js.map +0 -1
- package/src/inspectors/types.d.ts.map +0 -1
- package/src/inspectors/types.js.map +0 -1
- package/src/integrations/herdr-status.d.ts.map +0 -1
- package/src/integrations/herdr-status.js.map +0 -1
- package/src/integrations/pi-web-session-liveness.d.ts.map +0 -1
- package/src/integrations/pi-web-session-liveness.js.map +0 -1
- package/src/integrations/program-status.d.ts.map +0 -1
- package/src/integrations/program-status.js.map +0 -1
- package/src/intercom/intercom-bridge.d.ts.map +0 -1
- package/src/intercom/intercom-bridge.js.map +0 -1
- package/src/intercom/native-supervisor-channel.d.ts.map +0 -1
- package/src/intercom/native-supervisor-channel.js.map +0 -1
- package/src/intercom/result-intercom.d.ts.map +0 -1
- package/src/intercom/result-intercom.js.map +0 -1
- package/src/intercom/supervisor-ui.d.ts.map +0 -1
- package/src/intercom/supervisor-ui.js.map +0 -1
- package/src/missions/actions.d.ts.map +0 -1
- package/src/missions/actions.js.map +0 -1
- package/src/missions/goal-driver.d.ts.map +0 -1
- package/src/missions/goal-driver.js.map +0 -1
- package/src/missions/lifecycle.d.ts.map +0 -1
- package/src/missions/lifecycle.js.map +0 -1
- package/src/missions/store.d.ts.map +0 -1
- package/src/missions/store.js.map +0 -1
- package/src/missions/types.d.ts.map +0 -1
- package/src/missions/types.js.map +0 -1
- package/src/missions/workflow-state.d.ts.map +0 -1
- package/src/missions/workflow-state.js.map +0 -1
- package/src/policy/authority.d.ts.map +0 -1
- package/src/policy/authority.js.map +0 -1
- package/src/profiles/profiles.d.ts.map +0 -1
- package/src/profiles/profiles.js.map +0 -1
- package/src/runs/background/active-async-capacity.d.ts.map +0 -1
- package/src/runs/background/active-async-capacity.js.map +0 -1
- package/src/runs/background/active-run-index.d.ts.map +0 -1
- package/src/runs/background/active-run-index.js.map +0 -1
- package/src/runs/background/async-execution.d.ts.map +0 -1
- package/src/runs/background/async-execution.js.map +0 -1
- package/src/runs/background/async-job-tracker.d.ts.map +0 -1
- package/src/runs/background/async-job-tracker.js.map +0 -1
- package/src/runs/background/async-resume.d.ts.map +0 -1
- package/src/runs/background/async-resume.js.map +0 -1
- package/src/runs/background/async-retention.d.ts.map +0 -1
- package/src/runs/background/async-retention.js.map +0 -1
- package/src/runs/background/async-status-snapshot.d.ts.map +0 -1
- package/src/runs/background/async-status-snapshot.js.map +0 -1
- package/src/runs/background/async-status.d.ts.map +0 -1
- package/src/runs/background/async-status.js.map +0 -1
- package/src/runs/background/auto-drain.d.ts.map +0 -1
- package/src/runs/background/auto-drain.js.map +0 -1
- package/src/runs/background/await-async-run.d.ts.map +0 -1
- package/src/runs/background/await-async-run.js.map +0 -1
- package/src/runs/background/binary-bootstrap.d.ts.map +0 -1
- package/src/runs/background/binary-bootstrap.js.map +0 -1
- package/src/runs/background/calendar-schedule.d.ts.map +0 -1
- package/src/runs/background/calendar-schedule.js.map +0 -1
- package/src/runs/background/chain-append.d.ts.map +0 -1
- package/src/runs/background/chain-append.js.map +0 -1
- package/src/runs/background/chain-root-attachment.d.ts.map +0 -1
- package/src/runs/background/chain-root-attachment.js.map +0 -1
- package/src/runs/background/completion-batcher.d.ts.map +0 -1
- package/src/runs/background/completion-batcher.js.map +0 -1
- package/src/runs/background/completion-dedupe.d.ts.map +0 -1
- package/src/runs/background/completion-dedupe.js.map +0 -1
- package/src/runs/background/completion-replay.d.ts.map +0 -1
- package/src/runs/background/completion-replay.js.map +0 -1
- package/src/runs/background/control-channel.d.ts.map +0 -1
- package/src/runs/background/control-channel.js.map +0 -1
- package/src/runs/background/fleet-view.d.ts.map +0 -1
- package/src/runs/background/fleet-view.js.map +0 -1
- package/src/runs/background/index-segment.d.ts.map +0 -1
- package/src/runs/background/index-segment.js.map +0 -1
- package/src/runs/background/inspect-rpc.d.ts.map +0 -1
- package/src/runs/background/inspect-rpc.js.map +0 -1
- package/src/runs/background/notify.d.ts.map +0 -1
- package/src/runs/background/notify.js.map +0 -1
- package/src/runs/background/owned-process-tree.d.ts.map +0 -1
- package/src/runs/background/owned-process-tree.js.map +0 -1
- package/src/runs/background/parallel-groups.d.ts.map +0 -1
- package/src/runs/background/parallel-groups.js.map +0 -1
- package/src/runs/background/pid-namespace.d.ts.map +0 -1
- package/src/runs/background/pid-namespace.js.map +0 -1
- package/src/runs/background/process-terminal-candidate.d.ts.map +0 -1
- package/src/runs/background/process-terminal-candidate.js.map +0 -1
- package/src/runs/background/process-terminal.d.ts.map +0 -1
- package/src/runs/background/process-terminal.js.map +0 -1
- package/src/runs/background/result-delivery-ownership.d.ts.map +0 -1
- package/src/runs/background/result-delivery-ownership.js.map +0 -1
- package/src/runs/background/result-files.d.ts.map +0 -1
- package/src/runs/background/result-files.js.map +0 -1
- package/src/runs/background/result-watcher.d.ts.map +0 -1
- package/src/runs/background/result-watcher.js.map +0 -1
- package/src/runs/background/resume-guidance.d.ts.map +0 -1
- package/src/runs/background/resume-guidance.js.map +0 -1
- package/src/runs/background/retained-children.d.ts.map +0 -1
- package/src/runs/background/retained-children.js.map +0 -1
- package/src/runs/background/retained-nested-route-tracker.d.ts.map +0 -1
- package/src/runs/background/retained-nested-route-tracker.js.map +0 -1
- package/src/runs/background/run-child-session.d.ts.map +0 -1
- package/src/runs/background/run-child-session.js.map +0 -1
- package/src/runs/background/run-id-query.d.ts.map +0 -1
- package/src/runs/background/run-id-query.js.map +0 -1
- package/src/runs/background/run-id-resolver.d.ts.map +0 -1
- package/src/runs/background/run-id-resolver.js.map +0 -1
- package/src/runs/background/run-status.d.ts.map +0 -1
- package/src/runs/background/run-status.js.map +0 -1
- package/src/runs/background/runner-aliases.d.ts.map +0 -1
- package/src/runs/background/runner-aliases.js.map +0 -1
- package/src/runs/background/runner-child-launch.d.ts.map +0 -1
- package/src/runs/background/runner-child-launch.js.map +0 -1
- package/src/runs/background/runner-child-sessions.d.ts.map +0 -1
- package/src/runs/background/runner-child-sessions.js.map +0 -1
- package/src/runs/background/runner-http-dispatcher.d.ts.map +0 -1
- package/src/runs/background/runner-http-dispatcher.js.map +0 -1
- package/src/runs/background/runner-startup-failure.d.ts.map +0 -1
- package/src/runs/background/runner-startup-failure.js.map +0 -1
- package/src/runs/background/scheduled-runs.d.ts.map +0 -1
- package/src/runs/background/scheduled-runs.js.map +0 -1
- package/src/runs/background/stale-run-reconciler.d.ts.map +0 -1
- package/src/runs/background/stale-run-reconciler.js.map +0 -1
- package/src/runs/background/steering.d.ts.map +0 -1
- package/src/runs/background/steering.js.map +0 -1
- package/src/runs/background/subagent-runner-bootstrap.d.ts.map +0 -1
- package/src/runs/background/subagent-runner-bootstrap.js.map +0 -1
- package/src/runs/background/subagent-runner.d.ts.map +0 -1
- package/src/runs/background/subagent-runner.js.map +0 -1
- package/src/runs/background/subagent-wait.d.ts.map +0 -1
- package/src/runs/background/subagent-wait.js.map +0 -1
- package/src/runs/background/terminal-run-index.d.ts.map +0 -1
- package/src/runs/background/terminal-run-index.js.map +0 -1
- package/src/runs/background/top-level-async.d.ts.map +0 -1
- package/src/runs/background/top-level-async.js.map +0 -1
- package/src/runs/background/wait-completions.d.ts.map +0 -1
- package/src/runs/background/wait-completions.js.map +0 -1
- package/src/runs/background/wait-config.d.ts.map +0 -1
- package/src/runs/background/wait-config.js.map +0 -1
- package/src/runs/background/wait-subscriptions.d.ts.map +0 -1
- package/src/runs/background/wait-subscriptions.js.map +0 -1
- package/src/runs/background/wait-tool.d.ts.map +0 -1
- package/src/runs/background/wait-tool.js.map +0 -1
- package/src/runs/background/workflow-terminal-proof.d.ts.map +0 -1
- package/src/runs/background/workflow-terminal-proof.js.map +0 -1
- package/src/runs/foreground/async-dismiss-action.d.ts.map +0 -1
- package/src/runs/foreground/async-dismiss-action.js.map +0 -1
- package/src/runs/foreground/async-steering-action.d.ts.map +0 -1
- package/src/runs/foreground/async-steering-action.js.map +0 -1
- package/src/runs/foreground/async-stop-action.d.ts.map +0 -1
- package/src/runs/foreground/async-stop-action.js.map +0 -1
- package/src/runs/foreground/command-action.d.ts.map +0 -1
- package/src/runs/foreground/command-action.js.map +0 -1
- package/src/runs/foreground/execution.d.ts.map +0 -1
- package/src/runs/foreground/execution.js.map +0 -1
- package/src/runs/foreground/foreground-control.d.ts.map +0 -1
- package/src/runs/foreground/foreground-control.js.map +0 -1
- package/src/runs/foreground/foreground-history.d.ts.map +0 -1
- package/src/runs/foreground/foreground-history.js.map +0 -1
- package/src/runs/foreground/prompt-audit.d.ts.map +0 -1
- package/src/runs/foreground/prompt-audit.js.map +0 -1
- package/src/runs/foreground/subagent-executor.d.ts.map +0 -1
- package/src/runs/foreground/subagent-executor.js.map +0 -1
- package/src/runs/foreground/workflow-detach-reconcile.d.ts.map +0 -1
- package/src/runs/foreground/workflow-detach-reconcile.js.map +0 -1
- package/src/runs/foreground/workflow-foreground-steering.d.ts.map +0 -1
- package/src/runs/foreground/workflow-foreground-steering.js.map +0 -1
- package/src/runs/shared/abort-recovery.d.ts.map +0 -1
- package/src/runs/shared/abort-recovery.js.map +0 -1
- package/src/runs/shared/acceptance.d.ts.map +0 -1
- package/src/runs/shared/acceptance.js.map +0 -1
- package/src/runs/shared/agent-contract.d.ts.map +0 -1
- package/src/runs/shared/agent-contract.js.map +0 -1
- package/src/runs/shared/async-status-projection.d.ts.map +0 -1
- package/src/runs/shared/async-status-projection.js.map +0 -1
- package/src/runs/shared/background-process-options.d.ts.map +0 -1
- package/src/runs/shared/background-process-options.js.map +0 -1
- package/src/runs/shared/capability-ceiling.d.ts.map +0 -1
- package/src/runs/shared/capability-ceiling.js.map +0 -1
- package/src/runs/shared/chain-outputs.d.ts.map +0 -1
- package/src/runs/shared/chain-outputs.js.map +0 -1
- package/src/runs/shared/child-commands.d.ts.map +0 -1
- package/src/runs/shared/child-commands.js.map +0 -1
- package/src/runs/shared/child-hooks.d.ts.map +0 -1
- package/src/runs/shared/child-hooks.js.map +0 -1
- package/src/runs/shared/child-identity.d.ts.map +0 -1
- package/src/runs/shared/child-identity.js.map +0 -1
- package/src/runs/shared/child-launch-plan.d.ts.map +0 -1
- package/src/runs/shared/child-launch-plan.js.map +0 -1
- package/src/runs/shared/child-launch.d.ts.map +0 -1
- package/src/runs/shared/child-launch.js.map +0 -1
- package/src/runs/shared/child-lifecycle.d.ts.map +0 -1
- package/src/runs/shared/child-lifecycle.js.map +0 -1
- package/src/runs/shared/child-runtime-config.d.ts.map +0 -1
- package/src/runs/shared/child-runtime-config.js.map +0 -1
- package/src/runs/shared/child-session.d.ts.map +0 -1
- package/src/runs/shared/child-session.js.map +0 -1
- package/src/runs/shared/child-tool-plan.d.ts.map +0 -1
- package/src/runs/shared/child-tool-plan.js.map +0 -1
- package/src/runs/shared/claude-code-adapter.d.ts.map +0 -1
- package/src/runs/shared/claude-code-adapter.js.map +0 -1
- package/src/runs/shared/codex-exec-adapter.d.ts.map +0 -1
- package/src/runs/shared/codex-exec-adapter.js.map +0 -1
- package/src/runs/shared/context-mode.d.ts.map +0 -1
- package/src/runs/shared/context-mode.js.map +0 -1
- package/src/runs/shared/cursor-agent-adapter.d.ts.map +0 -1
- package/src/runs/shared/cursor-agent-adapter.js.map +0 -1
- package/src/runs/shared/dynamic-fanout.d.ts.map +0 -1
- package/src/runs/shared/dynamic-fanout.js.map +0 -1
- package/src/runs/shared/effective-system-prompt.d.ts.map +0 -1
- package/src/runs/shared/effective-system-prompt.js.map +0 -1
- package/src/runs/shared/extension-bindings.d.ts.map +0 -1
- package/src/runs/shared/extension-bindings.js.map +0 -1
- package/src/runs/shared/external-cli-contract.d.ts.map +0 -1
- package/src/runs/shared/external-cli-contract.js.map +0 -1
- package/src/runs/shared/external-cli-preflight.d.ts.map +0 -1
- package/src/runs/shared/external-cli-preflight.js.map +0 -1
- package/src/runs/shared/external-cli-runner.d.ts.map +0 -1
- package/src/runs/shared/external-cli-runner.js.map +0 -1
- package/src/runs/shared/external-job-bridge.d.ts.map +0 -1
- package/src/runs/shared/external-job-bridge.js.map +0 -1
- package/src/runs/shared/external-job-runner.d.ts.map +0 -1
- package/src/runs/shared/external-job-runner.js.map +0 -1
- package/src/runs/shared/fast-mode-extension.d.ts.map +0 -1
- package/src/runs/shared/fast-mode-extension.js.map +0 -1
- package/src/runs/shared/git-environment.d.ts.map +0 -1
- package/src/runs/shared/git-environment.js.map +0 -1
- package/src/runs/shared/herdr-connection.d.ts.map +0 -1
- package/src/runs/shared/herdr-connection.js.map +0 -1
- package/src/runs/shared/herdr-external-adapters.d.ts.map +0 -1
- package/src/runs/shared/herdr-external-adapters.js.map +0 -1
- package/src/runs/shared/herdr-machine.d.ts.map +0 -1
- package/src/runs/shared/herdr-machine.js.map +0 -1
- package/src/runs/shared/herdr-pi-protocol.d.ts.map +0 -1
- package/src/runs/shared/herdr-pi-protocol.js.map +0 -1
- package/src/runs/shared/herdr-placed-run.d.ts.map +0 -1
- package/src/runs/shared/herdr-placed-run.js.map +0 -1
- package/src/runs/shared/host-step-status.d.ts.map +0 -1
- package/src/runs/shared/host-step-status.js.map +0 -1
- package/src/runs/shared/lane-metadata.d.ts.map +0 -1
- package/src/runs/shared/lane-metadata.js.map +0 -1
- package/src/runs/shared/launch-cwd.d.ts.map +0 -1
- package/src/runs/shared/launch-cwd.js.map +0 -1
- package/src/runs/shared/long-running-guard.d.ts.map +0 -1
- package/src/runs/shared/long-running-guard.js.map +0 -1
- package/src/runs/shared/mcp-config-sources.d.ts.map +0 -1
- package/src/runs/shared/mcp-config-sources.js.map +0 -1
- package/src/runs/shared/mcp-direct-tool-allowlist.d.ts.map +0 -1
- package/src/runs/shared/mcp-direct-tool-allowlist.js.map +0 -1
- package/src/runs/shared/mcp-direct-tool-grant.d.ts.map +0 -1
- package/src/runs/shared/mcp-direct-tool-grant.js.map +0 -1
- package/src/runs/shared/model-resolution-diagnostic.d.ts.map +0 -1
- package/src/runs/shared/model-resolution-diagnostic.js.map +0 -1
- package/src/runs/shared/model-resolution.d.ts.map +0 -1
- package/src/runs/shared/model-resolution.js.map +0 -1
- package/src/runs/shared/model-scope.d.ts.map +0 -1
- package/src/runs/shared/model-scope.js.map +0 -1
- package/src/runs/shared/mutation-evidence.d.ts.map +0 -1
- package/src/runs/shared/mutation-evidence.js.map +0 -1
- package/src/runs/shared/nested-events.d.ts.map +0 -1
- package/src/runs/shared/nested-events.js.map +0 -1
- package/src/runs/shared/nested-path.d.ts.map +0 -1
- package/src/runs/shared/nested-path.js.map +0 -1
- package/src/runs/shared/nested-render.d.ts.map +0 -1
- package/src/runs/shared/nested-render.js.map +0 -1
- package/src/runs/shared/orca-progress-tabs.d.ts.map +0 -1
- package/src/runs/shared/orca-progress-tabs.js.map +0 -1
- package/src/runs/shared/parallel-handoff.d.ts.map +0 -1
- package/src/runs/shared/parallel-handoff.js.map +0 -1
- package/src/runs/shared/parallel-utils.d.ts.map +0 -1
- package/src/runs/shared/parallel-utils.js.map +0 -1
- package/src/runs/shared/partial-output.d.ts.map +0 -1
- package/src/runs/shared/partial-output.js.map +0 -1
- package/src/runs/shared/permissions.d.ts.map +0 -1
- package/src/runs/shared/permissions.js.map +0 -1
- package/src/runs/shared/pi-spawn.d.ts.map +0 -1
- package/src/runs/shared/pi-spawn.js.map +0 -1
- package/src/runs/shared/process-signal.d.ts.map +0 -1
- package/src/runs/shared/process-signal.js.map +0 -1
- package/src/runs/shared/readonly-drain-observation.d.ts.map +0 -1
- package/src/runs/shared/readonly-drain-observation.js.map +0 -1
- package/src/runs/shared/run-fanout-budget.d.ts.map +0 -1
- package/src/runs/shared/run-fanout-budget.js.map +0 -1
- package/src/runs/shared/run-ownership.d.ts.map +0 -1
- package/src/runs/shared/run-ownership.js.map +0 -1
- package/src/runs/shared/runner-launcher.d.ts.map +0 -1
- package/src/runs/shared/runner-launcher.js.map +0 -1
- package/src/runs/shared/runtime-acknowledged-extensions.d.ts.map +0 -1
- package/src/runs/shared/runtime-acknowledged-extensions.js.map +0 -1
- package/src/runs/shared/session-lease.d.ts.map +0 -1
- package/src/runs/shared/session-lease.js.map +0 -1
- package/src/runs/shared/single-output.d.ts.map +0 -1
- package/src/runs/shared/single-output.js.map +0 -1
- package/src/runs/shared/spawn-budget.d.ts.map +0 -1
- package/src/runs/shared/spawn-budget.js.map +0 -1
- package/src/runs/shared/structured-output.d.ts.map +0 -1
- package/src/runs/shared/structured-output.js.map +0 -1
- package/src/runs/shared/subagent-control.d.ts.map +0 -1
- package/src/runs/shared/subagent-control.js.map +0 -1
- package/src/runs/shared/subagent-prompt-runtime.d.ts.map +0 -1
- package/src/runs/shared/subagent-prompt-runtime.js.map +0 -1
- package/src/runs/shared/tool-availability.d.ts.map +0 -1
- package/src/runs/shared/tool-availability.js.map +0 -1
- package/src/runs/shared/tool-budget.d.ts.map +0 -1
- package/src/runs/shared/tool-budget.js.map +0 -1
- package/src/runs/shared/tool-timeout.d.ts.map +0 -1
- package/src/runs/shared/tool-timeout.js.map +0 -1
- package/src/runs/shared/usage-budget.d.ts.map +0 -1
- package/src/runs/shared/usage-budget.js.map +0 -1
- package/src/runs/shared/usage-reconciliation.d.ts.map +0 -1
- package/src/runs/shared/usage-reconciliation.js.map +0 -1
- package/src/runs/shared/workflow-async-child-guidance.d.ts.map +0 -1
- package/src/runs/shared/workflow-async-child-guidance.js.map +0 -1
- package/src/runs/shared/workflow-graph.d.ts.map +0 -1
- package/src/runs/shared/workflow-graph.js.map +0 -1
- package/src/runs/shared/worktree-cleanup-apply.d.ts.map +0 -1
- package/src/runs/shared/worktree-cleanup-apply.js.map +0 -1
- package/src/runs/shared/worktree-cleanup-plan.d.ts.map +0 -1
- package/src/runs/shared/worktree-cleanup-plan.js.map +0 -1
- package/src/runs/shared/worktree-lock.d.ts.map +0 -1
- package/src/runs/shared/worktree-lock.js.map +0 -1
- package/src/runs/shared/worktree-setup-command.d.ts.map +0 -1
- package/src/runs/shared/worktree-setup-command.js.map +0 -1
- package/src/runs/shared/worktree.d.ts.map +0 -1
- package/src/runs/shared/worktree.js.map +0 -1
- package/src/shared/accessible-dir.d.ts.map +0 -1
- package/src/shared/accessible-dir.js.map +0 -1
- package/src/shared/agent-stream-options.d.ts.map +0 -1
- package/src/shared/agent-stream-options.js.map +0 -1
- package/src/shared/artifacts.d.ts.map +0 -1
- package/src/shared/artifacts.js.map +0 -1
- package/src/shared/atomic-json.d.ts.map +0 -1
- package/src/shared/atomic-json.js.map +0 -1
- package/src/shared/capacity-resilient-json.d.ts.map +0 -1
- package/src/shared/capacity-resilient-json.js.map +0 -1
- package/src/shared/child-cache-retention.d.ts.map +0 -1
- package/src/shared/child-cache-retention.js.map +0 -1
- package/src/shared/child-session-name.d.ts.map +0 -1
- package/src/shared/child-session-name.js.map +0 -1
- package/src/shared/child-transcript.d.ts.map +0 -1
- package/src/shared/child-transcript.js.map +0 -1
- package/src/shared/completion-owner.d.ts.map +0 -1
- package/src/shared/completion-owner.js.map +0 -1
- package/src/shared/disabled-features.d.ts.map +0 -1
- package/src/shared/disabled-features.js.map +0 -1
- package/src/shared/display-text.d.ts.map +0 -1
- package/src/shared/display-text.js.map +0 -1
- package/src/shared/edit-distance.d.ts.map +0 -1
- package/src/shared/edit-distance.js.map +0 -1
- package/src/shared/extension-context.d.ts.map +0 -1
- package/src/shared/extension-context.js.map +0 -1
- package/src/shared/file-coalescer.d.ts.map +0 -1
- package/src/shared/file-coalescer.js.map +0 -1
- package/src/shared/file-lease.d.ts.map +0 -1
- package/src/shared/file-lease.js.map +0 -1
- package/src/shared/file-system-retry.d.ts.map +0 -1
- package/src/shared/file-system-retry.js.map +0 -1
- package/src/shared/fork-context.d.ts.map +0 -1
- package/src/shared/fork-context.js.map +0 -1
- package/src/shared/fork-session-cwd.d.ts.map +0 -1
- package/src/shared/fork-session-cwd.js.map +0 -1
- package/src/shared/formatters.d.ts.map +0 -1
- package/src/shared/formatters.js.map +0 -1
- package/src/shared/jsonl-writer.d.ts.map +0 -1
- package/src/shared/jsonl-writer.js.map +0 -1
- package/src/shared/launch-contract.d.ts.map +0 -1
- package/src/shared/launch-contract.js.map +0 -1
- package/src/shared/model-info.d.ts.map +0 -1
- package/src/shared/model-info.js.map +0 -1
- package/src/shared/model-response-aliases.d.ts.map +0 -1
- package/src/shared/model-response-aliases.js.map +0 -1
- package/src/shared/node-executable.d.ts.map +0 -1
- package/src/shared/node-executable.js.map +0 -1
- package/src/shared/opencode-session-headers.d.ts.map +0 -1
- package/src/shared/opencode-session-headers.js.map +0 -1
- package/src/shared/package-version.d.ts.map +0 -1
- package/src/shared/package-version.js.map +0 -1
- package/src/shared/parent-wake.d.ts.map +0 -1
- package/src/shared/parent-wake.js.map +0 -1
- package/src/shared/prompt-resources.d.ts.map +0 -1
- package/src/shared/prompt-resources.js.map +0 -1
- package/src/shared/pruned-fork.d.ts.map +0 -1
- package/src/shared/pruned-fork.js.map +0 -1
- package/src/shared/required-child-extensions.d.ts.map +0 -1
- package/src/shared/required-child-extensions.js.map +0 -1
- package/src/shared/runtime-module-path.d.ts.map +0 -1
- package/src/shared/runtime-module-path.js.map +0 -1
- package/src/shared/session-file-trust.d.ts.map +0 -1
- package/src/shared/session-file-trust.js.map +0 -1
- package/src/shared/session-identity.d.ts.map +0 -1
- package/src/shared/session-identity.js.map +0 -1
- package/src/shared/session-succession.d.ts.map +0 -1
- package/src/shared/session-succession.js.map +0 -1
- package/src/shared/session-tokens.d.ts.map +0 -1
- package/src/shared/session-tokens.js.map +0 -1
- package/src/shared/settings-file-lease.d.ts.map +0 -1
- package/src/shared/settings-file-lease.js.map +0 -1
- package/src/shared/settings.d.ts.map +0 -1
- package/src/shared/settings.js.map +0 -1
- package/src/shared/shortcuts.d.ts.map +0 -1
- package/src/shared/shortcuts.js.map +0 -1
- package/src/shared/status-format.d.ts.map +0 -1
- package/src/shared/status-format.js.map +0 -1
- package/src/shared/thinking-ceiling.d.ts.map +0 -1
- package/src/shared/thinking-ceiling.js.map +0 -1
- package/src/shared/types.d.ts.map +0 -1
- package/src/shared/types.js.map +0 -1
- package/src/shared/utf8.d.ts.map +0 -1
- package/src/shared/utf8.js.map +0 -1
- package/src/shared/utils.d.ts.map +0 -1
- package/src/shared/utils.js.map +0 -1
- package/src/shared/watch-strategy.d.ts.map +0 -1
- package/src/shared/watch-strategy.js.map +0 -1
- package/src/shared/workflow-child-permit.d.ts.map +0 -1
- package/src/shared/workflow-child-permit.js.map +0 -1
- package/src/slash/delegation-adapters.d.ts.map +0 -1
- package/src/slash/delegation-adapters.js.map +0 -1
- package/src/slash/delegation-json.d.ts.map +0 -1
- package/src/slash/delegation-json.js.map +0 -1
- package/src/slash/delegation-request.d.ts.map +0 -1
- package/src/slash/delegation-request.js.map +0 -1
- package/src/slash/prompt-template-bridge.d.ts.map +0 -1
- package/src/slash/prompt-template-bridge.js.map +0 -1
- package/src/slash/prompt-workflows.d.ts.map +0 -1
- package/src/slash/prompt-workflows.js.map +0 -1
- package/src/slash/selector.d.ts.map +0 -1
- package/src/slash/selector.js.map +0 -1
- package/src/slash/slash-bridge.d.ts.map +0 -1
- package/src/slash/slash-bridge.js.map +0 -1
- package/src/slash/slash-commands.d.ts.map +0 -1
- package/src/slash/slash-commands.js.map +0 -1
- package/src/slash/slash-live-state.d.ts.map +0 -1
- package/src/slash/slash-live-state.js.map +0 -1
- package/src/slash/subagent-cost.d.ts.map +0 -1
- package/src/slash/subagent-cost.js.map +0 -1
- package/src/slash/subagents-admin.d.ts.map +0 -1
- package/src/slash/subagents-admin.js.map +0 -1
- package/src/tui/fleet-status.d.ts.map +0 -1
- package/src/tui/fleet-status.js.map +0 -1
- package/src/tui/fleet-transcript.d.ts.map +0 -1
- package/src/tui/fleet-transcript.js.map +0 -1
- package/src/tui/fleet.d.ts.map +0 -1
- package/src/tui/fleet.js.map +0 -1
- package/src/tui/render-helpers.d.ts.map +0 -1
- package/src/tui/render-helpers.js.map +0 -1
- package/src/tui/render.d.ts.map +0 -1
- package/src/tui/render.js.map +0 -1
- package/src/tui/running-tone.d.ts.map +0 -1
- package/src/tui/running-tone.js.map +0 -1
- package/src/tui/subagent-messages.d.ts.map +0 -1
- package/src/tui/subagent-messages.js.map +0 -1
- package/src/watchdog/change-signature.d.ts.map +0 -1
- package/src/watchdog/change-signature.js.map +0 -1
- package/src/watchdog/child-status.d.ts.map +0 -1
- package/src/watchdog/child-status.js.map +0 -1
- package/src/watchdog/diff-tool.d.ts.map +0 -1
- package/src/watchdog/diff-tool.js.map +0 -1
- package/src/watchdog/emission-guard.d.ts.map +0 -1
- package/src/watchdog/emission-guard.js.map +0 -1
- package/src/watchdog/guidance.d.ts.map +0 -1
- package/src/watchdog/guidance.js.map +0 -1
- package/src/watchdog/lsp-diagnostics.d.ts.map +0 -1
- package/src/watchdog/lsp-diagnostics.js.map +0 -1
- package/src/watchdog/model-selection.d.ts.map +0 -1
- package/src/watchdog/model-selection.js.map +0 -1
- package/src/watchdog/permission-arbiter.d.ts.map +0 -1
- package/src/watchdog/permission-arbiter.js.map +0 -1
- package/src/watchdog/register-child.d.ts.map +0 -1
- package/src/watchdog/register-child.js.map +0 -1
- package/src/watchdog/register-main.d.ts.map +0 -1
- package/src/watchdog/register-main.js.map +0 -1
- package/src/watchdog/render.d.ts.map +0 -1
- package/src/watchdog/render.js.map +0 -1
- package/src/watchdog/review.d.ts.map +0 -1
- package/src/watchdog/review.js.map +0 -1
- package/src/watchdog/rules.d.ts.map +0 -1
- package/src/watchdog/rules.js.map +0 -1
- package/src/watchdog/runtime.d.ts.map +0 -1
- package/src/watchdog/runtime.js.map +0 -1
- package/src/watchdog/scope.d.ts.map +0 -1
- package/src/watchdog/scope.js.map +0 -1
- package/src/watchdog/settings.d.ts.map +0 -1
- package/src/watchdog/settings.js.map +0 -1
- package/src/watchdog/tool-actions.d.ts.map +0 -1
- package/src/watchdog/tool-actions.js.map +0 -1
- package/src/watchdog/turn-delta.d.ts.map +0 -1
- package/src/watchdog/turn-delta.js.map +0 -1
- package/src/watchdog/types.d.ts.map +0 -1
- package/src/watchdog/types.js.map +0 -1
- package/src/watchdog/warning-format.d.ts.map +0 -1
- package/src/watchdog/warning-format.js.map +0 -1
- package/src/workflows/chat-progress.d.ts.map +0 -1
- package/src/workflows/chat-progress.js.map +0 -1
- package/src/workflows/host-command.d.ts.map +0 -1
- package/src/workflows/host-command.js.map +0 -1
- package/src/workflows/scripted-workflow.d.ts.map +0 -1
- package/src/workflows/scripted-workflow.js.map +0 -1
- package/src/workflows/structured-workflow-scripts.d.ts.map +0 -1
- package/src/workflows/structured-workflow-scripts.js.map +0 -1
- package/src/workflows/workflow-checklist.d.ts.map +0 -1
- package/src/workflows/workflow-checklist.js.map +0 -1
- package/src/workflows/workflow-child-summary.d.ts.map +0 -1
- package/src/workflows/workflow-child-summary.js.map +0 -1
- package/src/workflows/workflow-preflight.d.ts.map +0 -1
- package/src/workflows/workflow-preflight.js.map +0 -1
- package/src/workflows/workflow-receipt.d.ts.map +0 -1
- package/src/workflows/workflow-receipt.js.map +0 -1
- package/src/workflows/workflow-resources.d.ts.map +0 -1
- package/src/workflows/workflow-resources.js.map +0 -1
- package/src/workflows/workflow-reuse.d.ts.map +0 -1
- package/src/workflows/workflow-reuse.js.map +0 -1
- package/src/workflows/workflow-revival.d.ts.map +0 -1
- package/src/workflows/workflow-revival.js.map +0 -1
- package/src/workflows/workflow-settlement.d.ts.map +0 -1
- package/src/workflows/workflow-settlement.js.map +0 -1
|
@@ -0,0 +1,935 @@
|
|
|
1
|
+
import {
|
|
2
|
+
connectHerdrMachine,
|
|
3
|
+
remoteShellCommand,
|
|
4
|
+
runHerdrRemoteCommand,
|
|
5
|
+
runHerdrRemoteCommandAsync
|
|
6
|
+
} from "./chunk-74RT5YQE.js";
|
|
7
|
+
import {
|
|
8
|
+
package_default
|
|
9
|
+
} from "./chunk-2XYWN7QJ.js";
|
|
10
|
+
import {
|
|
11
|
+
HERDR_PI_MODE_ENV,
|
|
12
|
+
HERDR_PI_PROTOCOL,
|
|
13
|
+
HERDR_PI_RUNTIME_DIR_ENV,
|
|
14
|
+
HERDR_PI_RUN_ENV,
|
|
15
|
+
HerdrPiFrameDecoder,
|
|
16
|
+
encodeHerdrPiFrame,
|
|
17
|
+
validateHerdrPiRunId
|
|
18
|
+
} from "./chunk-4QFZZV3O.js";
|
|
19
|
+
import {
|
|
20
|
+
getAgentDir
|
|
21
|
+
} from "./chunk-ZBC44JJ3.js";
|
|
22
|
+
import "./chunk-5LFLVSTM.js";
|
|
23
|
+
import "./chunk-YFCK7H2S.js";
|
|
24
|
+
import "./chunk-Z7KVHQHL.js";
|
|
25
|
+
|
|
26
|
+
// src/runs/shared/herdr-placed-run.ts
|
|
27
|
+
import { createHash, randomBytes } from "node:crypto";
|
|
28
|
+
import * as fs from "node:fs";
|
|
29
|
+
import * as net from "node:net";
|
|
30
|
+
import * as path from "node:path";
|
|
31
|
+
function herdrRunState(status, fallback = "unknown") {
|
|
32
|
+
return status === "working" ? "working" : status === "blocked" ? "blocked" : status === "idle" || status === "done" ? "settled" : status === "unknown" ? "unknown" : fallback;
|
|
33
|
+
}
|
|
34
|
+
function herdrStatusSubscriptions(paneId) {
|
|
35
|
+
return [{ type: "pane.agent_status_changed", pane_id: paneId }, { type: "pane.closed" }, { type: "pane.moved" }];
|
|
36
|
+
}
|
|
37
|
+
function reconcileHerdrPlacedRun(identity, candidate, proveEvidence) {
|
|
38
|
+
if (candidate.endpoint.session !== identity.session) return { ok: false, reason: "Herdr session changed during reconnect." };
|
|
39
|
+
const matches = candidate.agents.filter((agent) => agent.terminal_id === identity.terminalId);
|
|
40
|
+
if (matches.length !== 1 || typeof matches[0].pane_id !== "string") return { ok: false, reason: matches.length ? "Terminal identity is ambiguous." : "Owned terminal is missing." };
|
|
41
|
+
const proof = proveEvidence();
|
|
42
|
+
if (!proof.ok) return proof;
|
|
43
|
+
return { ok: true, state: herdrRunState(matches[0].agent_status), paneId: matches[0].pane_id, cursor: proof.cursor };
|
|
44
|
+
}
|
|
45
|
+
function reconcileHerdrReconnect(identity, candidate, lastEvidenceCursor) {
|
|
46
|
+
return reconcileHerdrPlacedRun(identity, candidate, () => {
|
|
47
|
+
const bridge = candidate.bridge;
|
|
48
|
+
if (bridge.runId !== identity.runId || bridge.nativeSessionId !== identity.nativeSessionId || bridge.packageVersion !== package_default.version || bridge.protocol !== HERDR_PI_PROTOCOL) return { ok: false, reason: "Bridge run, package, protocol, or native session identity changed." };
|
|
49
|
+
if (typeof bridge.evidenceCursor !== "number" || typeof bridge.evidenceFloor !== "number" || bridge.evidenceCursor < lastEvidenceCursor || bridge.evidenceFloor > lastEvidenceCursor + 1) return { ok: false, reason: "Bridge evidence has a gap after reconnect." };
|
|
50
|
+
return { ok: true, cursor: bridge.evidenceCursor };
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
async function boundedHerdrReconnect(identity, lastEvidenceCursor, attempt, options = {}) {
|
|
54
|
+
const deadline = Date.now() + (options.deadlineMs ?? 15e3);
|
|
55
|
+
let last = "Reconnect did not run.";
|
|
56
|
+
for (let number = 1; number <= (options.attempts ?? 3) && Date.now() < deadline; number++) {
|
|
57
|
+
if (options.disposed?.()) return { ok: false, reason: "Reconnect was disposed." };
|
|
58
|
+
try {
|
|
59
|
+
const result = reconcileHerdrReconnect(identity, await attempt(number), lastEvidenceCursor);
|
|
60
|
+
if (result.ok) return result;
|
|
61
|
+
last = result.reason;
|
|
62
|
+
} catch (error) {
|
|
63
|
+
last = error instanceof Error ? error.message : String(error);
|
|
64
|
+
}
|
|
65
|
+
await new Promise((resolve) => setTimeout(resolve, Math.min(number * 100, Math.max(0, deadline - Date.now()))));
|
|
66
|
+
}
|
|
67
|
+
return { ok: false, reason: last };
|
|
68
|
+
}
|
|
69
|
+
function safeRunId(value) {
|
|
70
|
+
const prefix = value?.replace(/[^A-Za-z0-9_-]/gu, "_").slice(0, 48) ?? "run";
|
|
71
|
+
return validateHerdrPiRunId(`${prefix}_${randomBytes(8).toString("hex")}`);
|
|
72
|
+
}
|
|
73
|
+
function idOf(value, key) {
|
|
74
|
+
const found = value && typeof value === "object" ? value[key] : void 0;
|
|
75
|
+
if (typeof found !== "string" || !found) throw new Error(`Herdr did not return ${key}.`);
|
|
76
|
+
return found;
|
|
77
|
+
}
|
|
78
|
+
function list(value, key) {
|
|
79
|
+
if (Array.isArray(value)) return value;
|
|
80
|
+
const found = value && typeof value === "object" ? value[key] : void 0;
|
|
81
|
+
return Array.isArray(found) ? found : [];
|
|
82
|
+
}
|
|
83
|
+
function tagged(value, type, key) {
|
|
84
|
+
if (!value || typeof value !== "object" || value.type !== type || !(key in value) || typeof value[key] !== "object") throw new Error(`Herdr returned an invalid ${type} envelope.`);
|
|
85
|
+
return value[key];
|
|
86
|
+
}
|
|
87
|
+
function parseHerdrCreated(value, type) {
|
|
88
|
+
const envelope = value;
|
|
89
|
+
if (envelope?.type !== type) throw new Error(`Herdr returned an invalid ${type} envelope.`);
|
|
90
|
+
const tab = envelope.tab;
|
|
91
|
+
const pane = envelope.root_pane;
|
|
92
|
+
return { ...type === "workspace_created" ? { workspaceId: idOf(envelope.workspace, "workspace_id") } : {}, tabId: idOf(tab, "tab_id"), paneId: idOf(pane, "pane_id") };
|
|
93
|
+
}
|
|
94
|
+
function parseHerdrAgent(value, type) {
|
|
95
|
+
return tagged(value, type, "agent");
|
|
96
|
+
}
|
|
97
|
+
function parseHerdrSessionSnapshot(value) {
|
|
98
|
+
return tagged(value, "session_snapshot", "snapshot");
|
|
99
|
+
}
|
|
100
|
+
function ownsHerdrPane(agent, terminalId, paneId) {
|
|
101
|
+
return agent.terminal_id === terminalId && agent.pane_id === paneId;
|
|
102
|
+
}
|
|
103
|
+
function snapshotAgents(snapshot) {
|
|
104
|
+
return list(snapshot, "agents").filter((agent) => Boolean(agent && typeof agent === "object")).map((agent) => ({ terminal_id: typeof agent.terminal_id === "string" ? agent.terminal_id : void 0, pane_id: typeof agent.pane_id === "string" ? agent.pane_id : void 0, agent_status: typeof agent.agent_status === "string" ? agent.agent_status : void 0 }));
|
|
105
|
+
}
|
|
106
|
+
var HERDR_MAX_OWNED_PANES = 20;
|
|
107
|
+
var HERDR_ALLOCATION_LOCK_TIMEOUT_MS = 1e4;
|
|
108
|
+
var HERDR_ALLOCATION_LOCK_POLL_MS = 25;
|
|
109
|
+
function herdrPaneAllocationKey(target, session, cwd) {
|
|
110
|
+
return JSON.stringify([target, session, cwd]);
|
|
111
|
+
}
|
|
112
|
+
function assertPrivateDir(directory) {
|
|
113
|
+
const stat = fs.lstatSync(directory);
|
|
114
|
+
if (!stat.isDirectory() || stat.isSymbolicLink() || (stat.mode & 511) !== 448 || typeof process.getuid === "function" && stat.uid !== process.getuid()) throw new Error("Herdr allocation path is not a mode-0700 agent-private owned directory.");
|
|
115
|
+
}
|
|
116
|
+
function ensurePrivateChild(parent, name) {
|
|
117
|
+
const directory = path.join(parent, name);
|
|
118
|
+
try {
|
|
119
|
+
fs.mkdirSync(directory, { mode: 448 });
|
|
120
|
+
} catch (error) {
|
|
121
|
+
if (error.code !== "EEXIST") throw error;
|
|
122
|
+
}
|
|
123
|
+
assertPrivateDir(directory);
|
|
124
|
+
return directory;
|
|
125
|
+
}
|
|
126
|
+
function allocationLockRoot() {
|
|
127
|
+
const agentDir = getAgentDir();
|
|
128
|
+
fs.mkdirSync(agentDir, { recursive: true, mode: 448 });
|
|
129
|
+
assertPrivateDir(agentDir);
|
|
130
|
+
const packageDir = ensurePrivateChild(agentDir, "pi-subagents");
|
|
131
|
+
return ensurePrivateChild(packageDir, "herdr-allocation-locks");
|
|
132
|
+
}
|
|
133
|
+
function livePid(pid) {
|
|
134
|
+
try {
|
|
135
|
+
process.kill(pid, 0);
|
|
136
|
+
return true;
|
|
137
|
+
} catch (error) {
|
|
138
|
+
return error.code === "EPERM";
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
function readAllocationOwner(ownerPath) {
|
|
142
|
+
const descriptor = fs.openSync(ownerPath, fs.constants.O_RDONLY | (fs.constants.O_NOFOLLOW ?? 0));
|
|
143
|
+
try {
|
|
144
|
+
const stat = fs.fstatSync(descriptor);
|
|
145
|
+
if (!stat.isFile() || (stat.mode & 511) !== 384 || typeof process.getuid === "function" && stat.uid !== process.getuid()) throw new Error("Herdr allocation lock owner record is unsafe.");
|
|
146
|
+
const value = JSON.parse(fs.readFileSync(descriptor, "utf8"));
|
|
147
|
+
if (typeof value.pid !== "number" || !Number.isSafeInteger(value.pid) || value.pid <= 0 || typeof value.token !== "string" || !/^[a-f0-9]{32}$/u.test(value.token)) throw new Error("Herdr allocation lock owner record is malformed.");
|
|
148
|
+
return { pid: value.pid, token: value.token, dev: stat.dev, ino: stat.ino };
|
|
149
|
+
} finally {
|
|
150
|
+
fs.closeSync(descriptor);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function sameOwner(left, right) {
|
|
154
|
+
return left.token === right.token && left.dev === right.dev && left.ino === right.ino;
|
|
155
|
+
}
|
|
156
|
+
async function withHerdrPaneAllocationLock(key, action, options = {}) {
|
|
157
|
+
const root = allocationLockRoot(), digest = createHash("sha256").update(key).digest("hex"), lockPath = path.join(root, `${digest}.lock`), recoveryPath = path.join(root, `${digest}.recovery`), token = randomBytes(16).toString("hex"), tempPath = path.join(root, `.${digest}.${token}.tmp`), deadline = Date.now() + (options.timeoutMs ?? HERDR_ALLOCATION_LOCK_TIMEOUT_MS);
|
|
158
|
+
let published;
|
|
159
|
+
try {
|
|
160
|
+
fs.writeFileSync(tempPath, JSON.stringify({ pid: process.pid, token, createdAt: Date.now() }), { mode: 384, flag: "wx" });
|
|
161
|
+
const tempOwner = readAllocationOwner(tempPath);
|
|
162
|
+
for (; ; ) {
|
|
163
|
+
let recovering = false;
|
|
164
|
+
try {
|
|
165
|
+
readAllocationOwner(recoveryPath);
|
|
166
|
+
recovering = true;
|
|
167
|
+
} catch (error) {
|
|
168
|
+
if (error.code !== "ENOENT") throw error;
|
|
169
|
+
}
|
|
170
|
+
if (!recovering) {
|
|
171
|
+
let linked = false;
|
|
172
|
+
try {
|
|
173
|
+
fs.linkSync(tempPath, lockPath);
|
|
174
|
+
linked = true;
|
|
175
|
+
try {
|
|
176
|
+
readAllocationOwner(recoveryPath);
|
|
177
|
+
const current = readAllocationOwner(lockPath);
|
|
178
|
+
if (!sameOwner(current, tempOwner)) throw new Error("Herdr allocation lock changed during publication.");
|
|
179
|
+
fs.unlinkSync(lockPath);
|
|
180
|
+
} catch (recoveryError) {
|
|
181
|
+
if (recoveryError.code !== "ENOENT") throw recoveryError;
|
|
182
|
+
published = readAllocationOwner(lockPath);
|
|
183
|
+
if (!sameOwner(published, tempOwner)) throw new Error("Herdr allocation lock publication identity changed.");
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
} catch (publishError) {
|
|
187
|
+
if (linked) {
|
|
188
|
+
try {
|
|
189
|
+
const current = readAllocationOwner(lockPath);
|
|
190
|
+
if (sameOwner(current, tempOwner)) fs.unlinkSync(lockPath);
|
|
191
|
+
} catch {
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (publishError.code !== "EEXIST" && publishError.code !== "ENOENT") throw publishError;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (published) break;
|
|
198
|
+
try {
|
|
199
|
+
const current = readAllocationOwner(lockPath);
|
|
200
|
+
if (!livePid(current.pid)) {
|
|
201
|
+
let claimed = false;
|
|
202
|
+
try {
|
|
203
|
+
fs.linkSync(lockPath, recoveryPath);
|
|
204
|
+
claimed = true;
|
|
205
|
+
const recovery = readAllocationOwner(recoveryPath), latest = readAllocationOwner(lockPath);
|
|
206
|
+
if (!sameOwner(recovery, current) || !sameOwner(latest, current)) throw new Error("Herdr stale lock identity changed during recovery.");
|
|
207
|
+
fs.unlinkSync(lockPath);
|
|
208
|
+
} catch (error) {
|
|
209
|
+
if (error.code !== "EEXIST" && error.code !== "ENOENT") throw error;
|
|
210
|
+
} finally {
|
|
211
|
+
if (claimed) fs.unlinkSync(recoveryPath);
|
|
212
|
+
}
|
|
213
|
+
if (claimed) continue;
|
|
214
|
+
}
|
|
215
|
+
} catch (error) {
|
|
216
|
+
if (error.code !== "ENOENT") throw error;
|
|
217
|
+
}
|
|
218
|
+
if (Date.now() >= deadline) throw new Error("Timed out waiting for the Herdr pane allocation lock.");
|
|
219
|
+
await new Promise((resolve) => setTimeout(resolve, options.pollMs ?? HERDR_ALLOCATION_LOCK_POLL_MS));
|
|
220
|
+
}
|
|
221
|
+
fs.unlinkSync(tempPath);
|
|
222
|
+
let value, actionError, releaseError, actionFailed = false, releaseFailed = false;
|
|
223
|
+
try {
|
|
224
|
+
value = await action();
|
|
225
|
+
} catch (error) {
|
|
226
|
+
actionFailed = true;
|
|
227
|
+
actionError = error;
|
|
228
|
+
}
|
|
229
|
+
try {
|
|
230
|
+
const current = readAllocationOwner(lockPath);
|
|
231
|
+
if (!published || !sameOwner(current, published)) throw new Error("Herdr pane allocation lock ownership changed before release.");
|
|
232
|
+
fs.unlinkSync(lockPath);
|
|
233
|
+
} catch (error) {
|
|
234
|
+
releaseFailed = true;
|
|
235
|
+
releaseError = error;
|
|
236
|
+
}
|
|
237
|
+
if (actionFailed && releaseFailed) throw new AggregateError([actionError, releaseError], "Herdr pane allocation action and release both failed.", { cause: actionError });
|
|
238
|
+
if (actionFailed) throw actionError;
|
|
239
|
+
if (releaseFailed) throw releaseError;
|
|
240
|
+
return value;
|
|
241
|
+
} finally {
|
|
242
|
+
try {
|
|
243
|
+
fs.unlinkSync(tempPath);
|
|
244
|
+
} catch (error) {
|
|
245
|
+
if (error.code !== "ENOENT") throw error;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
function serializeHerdrPiLaunch(launch) {
|
|
250
|
+
if (launch.storage.kind === "file") throw new Error("Pane-native remote Pi does not support fork, resume, or revival; use fresh context.");
|
|
251
|
+
if (launch.extensionPaths.length || launch.requiredExtensions?.length) throw new Error("Pane-native remote Pi cannot transfer local extension paths; install/configure pi-subagents on the remote machine.");
|
|
252
|
+
if (launch.processEnv && Object.values(launch.processEnv).some((value) => value !== void 0 && value !== "__none__")) throw new Error("Pane-native remote Pi cannot transfer local bindings, MCP selections, or process environment.");
|
|
253
|
+
if (launch.runtime.nestedRoute || launch.runtime.fanoutChild || launch.runtime.depth > 1) throw new Error("Nested delegation from a pane-native remote Pi is not supported.");
|
|
254
|
+
if (launch.excludeTools?.length || launch.runtime.permissions || launch.runtime.toolBudget || launch.runtime.requiredExtensions || launch.runtime.requiredTools?.length || launch.runtime.mcpDirectTools?.length) throw new Error("Pane-native remote Pi cannot yet represent exclusions, permission rules, tool budgets, MCP direct tools, or required-tool/extension contracts; remove machine placement.");
|
|
255
|
+
const resources = launch.remoteResources;
|
|
256
|
+
if (!resources || !/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u.test(resources.agent) || resources.skills?.some((name) => !/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u.test(name)) || resources.toolCeiling?.some((name) => !/^[A-Za-z0-9_-]{1,64}$/u.test(name)) || resources.reads !== void 0 && resources.reads !== false && resources.reads.some((read) => typeof read !== "string" || Buffer.byteLength(read) > 4096)) throw new Error("Pane-native remote resources require bounded logical agent, skill, tool, and read names.");
|
|
257
|
+
const args = [];
|
|
258
|
+
if (launch.noSkills) args.push("--no-skills", "--no-prompt-templates");
|
|
259
|
+
if (launch.noContextFiles) args.push("--no-context-files");
|
|
260
|
+
if (launch.model) args.push("--model", launch.model);
|
|
261
|
+
return { args, resources: { agent: resources.agent, ...resources.skills ? { skills: [...resources.skills] } : {}, ...resources.toolCeiling ? { toolCeiling: [...resources.toolCeiling] } : {}, ...resources.reads !== void 0 ? { reads: resources.reads === false ? false : [...resources.reads] } : {} } };
|
|
262
|
+
}
|
|
263
|
+
async function provisionHerdrPane(client, cwd, runId, runtimeDir, environment, allocationKey = cwd) {
|
|
264
|
+
return withHerdrPaneAllocationLock(allocationKey, async () => {
|
|
265
|
+
const snapshot = parseHerdrSessionSnapshot(await client.call("session.snapshot"));
|
|
266
|
+
const panes = list(snapshot, "panes").filter((item) => Boolean(item && typeof item === "object")), workspaces = list(snapshot, "workspaces").filter((item) => Boolean(item && typeof item === "object"));
|
|
267
|
+
const ownedLabel = `pi-subagents-${createHash("sha256").update(cwd).digest("hex").slice(0, 10)}`, owned = workspaces.filter((item) => item.label === ownedLabel);
|
|
268
|
+
if (owned.length > 1) throw new Error("Herdr deterministic owned workspace identity is ambiguous.");
|
|
269
|
+
const cwdWorkspaceIds = new Set(panes.filter((item) => item.cwd === cwd || item.foreground_cwd === cwd).map((item) => item.workspace_id).filter((id) => typeof id === "string")), cwdWorkspaces = workspaces.filter((item) => typeof item.workspace_id === "string" && cwdWorkspaceIds.has(item.workspace_id));
|
|
270
|
+
const selected = owned[0] ?? (cwdWorkspaces.length === 1 ? cwdWorkspaces[0] : void 0), selectedId = selected ? idOf(selected, "workspace_id") : void 0, actual = selectedId ? panes.filter((pane) => pane.workspace_id === selectedId).length : 0;
|
|
271
|
+
if (actual >= HERDR_MAX_OWNED_PANES) throw new Error(`Herdr workspace pane limit of ${HERDR_MAX_OWNED_PANES} is reached; close an existing pane before launching another placed run.`);
|
|
272
|
+
const env = environment ?? { [HERDR_PI_MODE_ENV]: "1", [HERDR_PI_RUN_ENV]: runId, [HERDR_PI_RUNTIME_DIR_ENV]: runtimeDir };
|
|
273
|
+
if (selectedId) {
|
|
274
|
+
const tab = parseHerdrCreated(await client.call("tab.create", { workspace_id: selectedId, cwd, label: `subagent-${runId.slice(-8)}`, env, focus: false }), "tab_created");
|
|
275
|
+
return { workspaceId: selectedId, tabId: tab.tabId, paneId: tab.paneId };
|
|
276
|
+
}
|
|
277
|
+
const workspace = parseHerdrCreated(await client.call("workspace.create", { cwd, label: ownedLabel, env, focus: false }), "workspace_created");
|
|
278
|
+
return { workspaceId: workspace.workspaceId, tabId: workspace.tabId, paneId: workspace.paneId };
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
async function discoverBridgeManifest(machine, runId, runtimeDir, options = {}) {
|
|
282
|
+
const script = `p="$1/manifest.json"; test -f "$p" && test ! -L "$p" && cat "$p"`;
|
|
283
|
+
for (let attempt = 0; attempt < 100; attempt++) {
|
|
284
|
+
const result = await runHerdrRemoteCommandAsync(machine, remoteShellCommand(script, [runtimeDir]), { ...options, timeout: 5e3, maxBuffer: 64 * 1024 });
|
|
285
|
+
if (result.error) throw new Error(`Remote bridge manifest discovery failed: ${result.error.message}`, { cause: result.error });
|
|
286
|
+
if (result.status === 0 && result.stdout.trim()) {
|
|
287
|
+
let value;
|
|
288
|
+
try {
|
|
289
|
+
value = JSON.parse(result.stdout);
|
|
290
|
+
} catch {
|
|
291
|
+
throw new Error("Remote bridge manifest is malformed.");
|
|
292
|
+
}
|
|
293
|
+
const p = value;
|
|
294
|
+
if (p.runId !== runId || typeof p.socketPath !== "string" || path.posix.dirname(p.socketPath) !== runtimeDir || typeof p.nativeSessionId !== "string" || typeof p.packageVersion !== "string" || typeof p.protocol !== "number") throw new Error("Remote bridge manifest identity is incomplete or outside its owned runtime directory.");
|
|
295
|
+
return p;
|
|
296
|
+
}
|
|
297
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
298
|
+
}
|
|
299
|
+
throw new Error("The remote Pi did not expose the packaged pi-subagents bridge. Install/configure the same package version as an ambient Pi extension on the saved machine.");
|
|
300
|
+
}
|
|
301
|
+
async function createRemoteRuntimeDir(machine, runId, options = {}) {
|
|
302
|
+
const result = await runHerdrRemoteCommandAsync(machine, remoteShellCommand('umask 077; mktemp -d "${TMPDIR:-/tmp}/pi-subagents-herdr-$1-XXXXXXXX"', [runId]), { ...options, timeout: 1e4, maxBuffer: 4096 });
|
|
303
|
+
if (result.error) throw new Error(`Could not provision a run-private remote bridge runtime directory: ${result.error.message}`, { cause: result.error });
|
|
304
|
+
const value = result.stdout.trim();
|
|
305
|
+
if (result.status !== 0 || !path.posix.isAbsolute(value) || value.includes("\n")) throw new Error("Could not provision a run-private remote bridge runtime directory.");
|
|
306
|
+
return value;
|
|
307
|
+
}
|
|
308
|
+
function removeRemoteRuntimeDir(machine, runtimeDir, options = {}) {
|
|
309
|
+
const result = runHerdrRemoteCommand(machine, remoteShellCommand('p=$1; case "${p##*/}" in pi-subagents-herdr-*) test -d "$p" && test ! -L "$p" && rm -rf -- "$p";; *) exit 64;; esac', [runtimeDir]), { ...options, timeout: 1e4, maxBuffer: 4096 });
|
|
310
|
+
if (result.status !== 0 || result.stdout) throw new Error(`Could not remove the exact owned remote runtime directory: ${String(result.stderr).slice(0, 512)}`);
|
|
311
|
+
}
|
|
312
|
+
var HerdrPlacedRunOwner = class _HerdrPlacedRunOwner {
|
|
313
|
+
machine;
|
|
314
|
+
runId;
|
|
315
|
+
runtimeDir;
|
|
316
|
+
connection;
|
|
317
|
+
owned;
|
|
318
|
+
terminalId;
|
|
319
|
+
agentName;
|
|
320
|
+
startedArgv;
|
|
321
|
+
identity;
|
|
322
|
+
#unsubscribe = () => {
|
|
323
|
+
};
|
|
324
|
+
#snapshot = { connection: "connected", state: "ready", revision: 0 };
|
|
325
|
+
#cleanupPromise;
|
|
326
|
+
#removeRuntime;
|
|
327
|
+
constructor(machine, runId, runtimeDir, connection, removeRuntime = () => removeRemoteRuntimeDir(machine, runtimeDir)) {
|
|
328
|
+
this.machine = machine;
|
|
329
|
+
this.runId = runId;
|
|
330
|
+
this.runtimeDir = runtimeDir;
|
|
331
|
+
this.connection = connection;
|
|
332
|
+
this.#removeRuntime = removeRuntime;
|
|
333
|
+
}
|
|
334
|
+
static async create(machine, runId, beforePane) {
|
|
335
|
+
const runtimeDir = await createRemoteRuntimeDir(machine, runId);
|
|
336
|
+
let connection;
|
|
337
|
+
try {
|
|
338
|
+
connection = await connectHerdrMachine(machine);
|
|
339
|
+
const owner = new _HerdrPlacedRunOwner(machine, runId, runtimeDir, connection);
|
|
340
|
+
await beforePane?.(owner);
|
|
341
|
+
return owner;
|
|
342
|
+
} catch (error) {
|
|
343
|
+
const cleanupErrors = [];
|
|
344
|
+
try {
|
|
345
|
+
await connection?.close();
|
|
346
|
+
} catch (cleanupError) {
|
|
347
|
+
cleanupErrors.push(cleanupError);
|
|
348
|
+
}
|
|
349
|
+
try {
|
|
350
|
+
removeRemoteRuntimeDir(machine, runtimeDir);
|
|
351
|
+
} catch (cleanupError) {
|
|
352
|
+
cleanupErrors.push(cleanupError);
|
|
353
|
+
}
|
|
354
|
+
if (cleanupErrors.length) throw new AggregateError([error, ...cleanupErrors], "Herdr owner creation failed and cleanup also failed.", { cause: error });
|
|
355
|
+
throw error;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
observeEvent(event) {
|
|
359
|
+
const data = event && typeof event === "object" ? event.data : void 0;
|
|
360
|
+
if (data && (!this.terminalId || data.terminal_id === this.terminalId || data.pane_id === this.owned?.paneId)) this.#snapshot = { ...this.#snapshot, revision: this.#snapshot.revision + 1, state: herdrRunState(data.agent_status, this.#snapshot.state) };
|
|
361
|
+
}
|
|
362
|
+
markConnectionUnknown(observed) {
|
|
363
|
+
if (this.connection !== observed) return false;
|
|
364
|
+
this.#snapshot = { ...this.#snapshot, connection: "unknown", state: "unknown", revision: this.#snapshot.revision + 1 };
|
|
365
|
+
return true;
|
|
366
|
+
}
|
|
367
|
+
statusSubscriptions(paneId = this.owned?.paneId) {
|
|
368
|
+
if (!paneId) throw new Error("Herdr status subscription requires a provisioned pane.");
|
|
369
|
+
return herdrStatusSubscriptions(paneId);
|
|
370
|
+
}
|
|
371
|
+
async subscribe(listener, disconnected) {
|
|
372
|
+
const observed = this.connection;
|
|
373
|
+
let adopted = false, candidateLost;
|
|
374
|
+
const unsubscribe = await observed.client.subscribe(this.statusSubscriptions(), (event) => {
|
|
375
|
+
this.observeEvent(event);
|
|
376
|
+
listener(event);
|
|
377
|
+
}, (error) => {
|
|
378
|
+
if (!adopted) {
|
|
379
|
+
candidateLost ??= error;
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
if (!this.markConnectionUnknown(observed)) return;
|
|
383
|
+
disconnected(error);
|
|
384
|
+
});
|
|
385
|
+
if (candidateLost) {
|
|
386
|
+
unsubscribe();
|
|
387
|
+
throw candidateLost;
|
|
388
|
+
}
|
|
389
|
+
this.#unsubscribe = unsubscribe;
|
|
390
|
+
adopted = true;
|
|
391
|
+
}
|
|
392
|
+
async provision(environment) {
|
|
393
|
+
this.owned = await provisionHerdrPane(this.connection.client, this.machine.cwd, this.runId, this.runtimeDir, environment, herdrPaneAllocationKey(this.machine.target, this.connection.endpoint.session, this.machine.cwd));
|
|
394
|
+
return this.owned;
|
|
395
|
+
}
|
|
396
|
+
async start(kind, name, args, options = {}) {
|
|
397
|
+
if (!this.owned) throw new Error("Herdr placement owner has not provisioned its pane.");
|
|
398
|
+
const clock = options.clock ?? { now: () => Date.now(), wait: (ms) => new Promise((resolve) => setTimeout(resolve, ms)) }, deadline = clock.now() + (options.timeoutMs ?? 5e3), pollMs = options.pollMs ?? 50;
|
|
399
|
+
let response;
|
|
400
|
+
for (; ; ) {
|
|
401
|
+
try {
|
|
402
|
+
response = await this.connection.client.call("agent.start", { name, kind, pane_id: this.owned.paneId, args, timeout_ms: 45e3 }, 6e4);
|
|
403
|
+
break;
|
|
404
|
+
} catch (error) {
|
|
405
|
+
if (!(error instanceof Error) || !error.message.includes("is not an available shell")) throw error;
|
|
406
|
+
const pane = tagged(await this.connection.client.call("pane.get", { pane_id: this.owned.paneId }), "pane_info", "pane");
|
|
407
|
+
if (pane.pane_id !== this.owned.paneId || pane.workspace_id !== this.owned.workspaceId || pane.tab_id !== this.owned.tabId) throw new Error("Herdr startup pane identity changed after a transient start rejection.", { cause: error });
|
|
408
|
+
if (pane.agent != null || pane.agent_session != null) throw new Error("Herdr startup pane became occupied after a transient start rejection.", { cause: error });
|
|
409
|
+
if (clock.now() >= deadline) throw new Error("Herdr owned pane remained unavailable until the startup deadline.", { cause: error });
|
|
410
|
+
await clock.wait(Math.min(pollMs, deadline - clock.now()));
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
const started = parseHerdrAgent(response, "agent_started"), argv = [kind, ...args], terminalId = idOf(started, "terminal_id"), paneId = idOf(started, "pane_id");
|
|
414
|
+
if (paneId !== this.owned.paneId) throw new Error("Herdr started the native agent in an unexpected pane.");
|
|
415
|
+
this.agentName = name;
|
|
416
|
+
this.terminalId = terminalId;
|
|
417
|
+
this.startedArgv = argv;
|
|
418
|
+
return { terminalId, paneId, argv };
|
|
419
|
+
}
|
|
420
|
+
journal(identity) {
|
|
421
|
+
this.identity = identity;
|
|
422
|
+
this.#snapshot = { ...this.#snapshot, identity };
|
|
423
|
+
const journalDir = path.join(getAgentDir(), "pi-subagents", "herdr-run-journal");
|
|
424
|
+
fs.mkdirSync(journalDir, { recursive: true, mode: 448 });
|
|
425
|
+
fs.writeFileSync(path.join(journalDir, `${this.runId}.json`), JSON.stringify({ version: 1, identity, state: "ready", updatedAt: Date.now() }), { mode: 384, flag: "wx" });
|
|
426
|
+
}
|
|
427
|
+
get snapshot() {
|
|
428
|
+
return this.#snapshot;
|
|
429
|
+
}
|
|
430
|
+
runRemote(command, options = {}) {
|
|
431
|
+
return runHerdrRemoteCommand(this.machine, command, options);
|
|
432
|
+
}
|
|
433
|
+
async replaceConnection(input) {
|
|
434
|
+
const oldConnection = this.connection, oldUnsubscribe = this.#unsubscribe;
|
|
435
|
+
this.connection = input.connection;
|
|
436
|
+
this.#unsubscribe = input.unsubscribe;
|
|
437
|
+
if (this.identity) this.identity = { ...this.identity, paneId: input.paneId };
|
|
438
|
+
this.#snapshot = { connection: "connected", state: input.state, identity: this.identity, revision: this.#snapshot.revision + 1 };
|
|
439
|
+
oldUnsubscribe();
|
|
440
|
+
await oldConnection.close();
|
|
441
|
+
}
|
|
442
|
+
cleanup(closeStartedPane = true) {
|
|
443
|
+
return this.#cleanupPromise ??= this.#performCleanup(closeStartedPane);
|
|
444
|
+
}
|
|
445
|
+
async #performCleanup(closeStartedPane) {
|
|
446
|
+
let failure;
|
|
447
|
+
try {
|
|
448
|
+
if (closeStartedPane && this.owned) {
|
|
449
|
+
let closed = false;
|
|
450
|
+
if (this.terminalId && this.agentName) {
|
|
451
|
+
const current = parseHerdrAgent(await this.connection.client.call("agent.get", { target: this.agentName }), "agent_info");
|
|
452
|
+
if (ownsHerdrPane(current, this.terminalId, this.owned.paneId)) {
|
|
453
|
+
await this.connection.client.call("pane.close", { pane_id: this.owned.paneId });
|
|
454
|
+
closed = true;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
if (!closed) {
|
|
458
|
+
const snapshot = parseHerdrSessionSnapshot(await this.connection.client.call("session.snapshot"));
|
|
459
|
+
const occupants = snapshotAgents(snapshot).filter((agent) => agent.pane_id === this.owned.paneId);
|
|
460
|
+
if (occupants.length !== 0) throw new Error("Refusing cleanup because startup pane ownership is uncertain.");
|
|
461
|
+
await this.connection.client.call("pane.close", { pane_id: this.owned.paneId });
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
} catch (error) {
|
|
465
|
+
failure = error;
|
|
466
|
+
}
|
|
467
|
+
try {
|
|
468
|
+
this.#unsubscribe();
|
|
469
|
+
await this.connection.close();
|
|
470
|
+
this.#removeRuntime();
|
|
471
|
+
} catch (error) {
|
|
472
|
+
failure ??= error;
|
|
473
|
+
}
|
|
474
|
+
this.#snapshot = { ...this.#snapshot, connection: "closed", revision: this.#snapshot.revision + 1 };
|
|
475
|
+
if (failure) throw failure;
|
|
476
|
+
}
|
|
477
|
+
};
|
|
478
|
+
var BridgeChannel = class {
|
|
479
|
+
socket;
|
|
480
|
+
decoder = new HerdrPiFrameDecoder();
|
|
481
|
+
listeners = /* @__PURE__ */ new Set();
|
|
482
|
+
waiters = /* @__PURE__ */ new Map();
|
|
483
|
+
runId;
|
|
484
|
+
frames = [];
|
|
485
|
+
failure;
|
|
486
|
+
#rejectFailure;
|
|
487
|
+
#failed = false;
|
|
488
|
+
#adopted = false;
|
|
489
|
+
constructor(socketPath, runId) {
|
|
490
|
+
this.runId = runId;
|
|
491
|
+
this.failure = new Promise((_resolve, reject) => {
|
|
492
|
+
this.#rejectFailure = reject;
|
|
493
|
+
});
|
|
494
|
+
this.failure.catch(() => {
|
|
495
|
+
});
|
|
496
|
+
this.socket = net.createConnection(socketPath);
|
|
497
|
+
this.socket.on("data", (chunk) => {
|
|
498
|
+
try {
|
|
499
|
+
for (const frame of this.decoder.push(chunk)) {
|
|
500
|
+
if (frame.runId !== runId) throw new Error("Bridge run identity mismatch.");
|
|
501
|
+
if (!this.#adopted) {
|
|
502
|
+
this.frames.push(frame);
|
|
503
|
+
if (this.frames.length > 1024) throw new Error("Bridge replay queue exceeded its bound.");
|
|
504
|
+
}
|
|
505
|
+
const key = typeof frame.requestId === "string" ? `${frame.type}:${frame.requestId}` : "";
|
|
506
|
+
const waiter = this.waiters.get(key);
|
|
507
|
+
if (waiter) {
|
|
508
|
+
this.waiters.delete(key);
|
|
509
|
+
waiter.resolve(frame);
|
|
510
|
+
}
|
|
511
|
+
for (const listener of this.listeners) listener(frame);
|
|
512
|
+
}
|
|
513
|
+
} catch (error) {
|
|
514
|
+
this.fail(error);
|
|
515
|
+
}
|
|
516
|
+
});
|
|
517
|
+
this.socket.on("error", (error) => this.fail(error));
|
|
518
|
+
this.socket.on("close", () => {
|
|
519
|
+
if (!this.#failed) this.fail(new Error("Remote Pi bridge connection was lost; task state is unknown."));
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
fail(error) {
|
|
523
|
+
if (this.#failed) return;
|
|
524
|
+
this.#failed = true;
|
|
525
|
+
this.#rejectFailure(error);
|
|
526
|
+
for (const waiter of this.waiters.values()) waiter.reject(error);
|
|
527
|
+
this.waiters.clear();
|
|
528
|
+
}
|
|
529
|
+
get failed() {
|
|
530
|
+
return this.#failed;
|
|
531
|
+
}
|
|
532
|
+
adopt(listener) {
|
|
533
|
+
this.#adopted = true;
|
|
534
|
+
this.listeners.add(listener);
|
|
535
|
+
return this.frames.splice(0);
|
|
536
|
+
}
|
|
537
|
+
wait(type, requestId) {
|
|
538
|
+
return new Promise((resolve, reject) => this.waiters.set(`${type}:${requestId}`, { resolve, reject }));
|
|
539
|
+
}
|
|
540
|
+
configure(resources) {
|
|
541
|
+
const requestId = `cfg_${randomBytes(6).toString("hex")}`;
|
|
542
|
+
const waiting = this.wait("configured", requestId);
|
|
543
|
+
this.socket.write(encodeHerdrPiFrame({ protocol: HERDR_PI_PROTOCOL, runId: this.runId, type: "configure", requestId, resources }));
|
|
544
|
+
return waiting;
|
|
545
|
+
}
|
|
546
|
+
supervisorDelivered(requestId) {
|
|
547
|
+
this.socket.write(encodeHerdrPiFrame({ protocol: HERDR_PI_PROTOCOL, runId: this.runId, type: "supervisor-delivered", requestId }));
|
|
548
|
+
}
|
|
549
|
+
prepare(requestId, operation, text, supervisorId) {
|
|
550
|
+
const waiting = this.wait("prepared", requestId);
|
|
551
|
+
this.socket.write(encodeHerdrPiFrame({ protocol: HERDR_PI_PROTOCOL, runId: this.runId, type: "prepare", requestId, operation, ...text !== void 0 ? { text } : {}, ...supervisorId ? { supervisorId } : {} }));
|
|
552
|
+
return waiting;
|
|
553
|
+
}
|
|
554
|
+
close() {
|
|
555
|
+
this.socket.destroy();
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
function waitForReadyBridgeFrame(bridge, timeoutMs, timeoutMessage, configured = false) {
|
|
559
|
+
return new Promise((resolve, reject) => {
|
|
560
|
+
const timer = setTimeout(() => reject(new Error(timeoutMessage)), timeoutMs);
|
|
561
|
+
const listener = (frame) => {
|
|
562
|
+
if (frame.type !== "ready" || configured && frame.configured !== true) return;
|
|
563
|
+
clearTimeout(timer);
|
|
564
|
+
bridge.listeners.delete(listener);
|
|
565
|
+
resolve(frame);
|
|
566
|
+
};
|
|
567
|
+
bridge.listeners.add(listener);
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
var HerdrPiSession = class {
|
|
571
|
+
#listeners = /* @__PURE__ */ new Set();
|
|
572
|
+
#messages = [];
|
|
573
|
+
#sequence = 0;
|
|
574
|
+
#disposed = false;
|
|
575
|
+
#aborted = false;
|
|
576
|
+
#initialGit;
|
|
577
|
+
#finalGit;
|
|
578
|
+
#operations = /* @__PURE__ */ new Map();
|
|
579
|
+
#snapshot;
|
|
580
|
+
bridgeForward;
|
|
581
|
+
bridge;
|
|
582
|
+
requestedTools;
|
|
583
|
+
model;
|
|
584
|
+
#evidenceCursor = 0;
|
|
585
|
+
#reconnecting;
|
|
586
|
+
#reconnectFactory;
|
|
587
|
+
#reconnectFailure;
|
|
588
|
+
#replyTimer;
|
|
589
|
+
supervisorDir;
|
|
590
|
+
runtime;
|
|
591
|
+
owner;
|
|
592
|
+
constructor(owner, bridgeForward, bridge, requestedTools, model, runtime, initialGit) {
|
|
593
|
+
this.owner = owner;
|
|
594
|
+
this.bridgeForward = bridgeForward;
|
|
595
|
+
this.bridge = bridge;
|
|
596
|
+
this.requestedTools = requestedTools;
|
|
597
|
+
this.model = model;
|
|
598
|
+
this.runtime = runtime;
|
|
599
|
+
this.supervisorDir = runtime.supervisorChannelDir;
|
|
600
|
+
this.#snapshot = { connection: "connected", state: "ready", identity: owner.identity, revision: 0 };
|
|
601
|
+
this.#initialGit = initialGit;
|
|
602
|
+
bridge.adopt((frame) => this.#frame(frame));
|
|
603
|
+
if (this.supervisorDir) {
|
|
604
|
+
this.#replyTimer = setInterval(() => {
|
|
605
|
+
const replies = path.join(this.supervisorDir, "replies");
|
|
606
|
+
for (const name of fs.existsSync(replies) ? fs.readdirSync(replies) : []) {
|
|
607
|
+
const file = path.join(replies, name);
|
|
608
|
+
try {
|
|
609
|
+
const value = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
610
|
+
if (typeof value.message === "string" && typeof value.requestId === "string") void this.#operation("supervisor-reply", value.message, value.requestId).then(() => fs.rmSync(file, { force: true }));
|
|
611
|
+
} catch {
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
}, 50);
|
|
615
|
+
this.#replyTimer.unref?.();
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
get identity() {
|
|
619
|
+
return this.owner.identity;
|
|
620
|
+
}
|
|
621
|
+
set identity(value) {
|
|
622
|
+
this.owner.identity = value;
|
|
623
|
+
}
|
|
624
|
+
get connection() {
|
|
625
|
+
return this.owner.connection;
|
|
626
|
+
}
|
|
627
|
+
set connection(value) {
|
|
628
|
+
this.owner.connection = value;
|
|
629
|
+
}
|
|
630
|
+
armReconnect(factory) {
|
|
631
|
+
this.#reconnectFactory = factory;
|
|
632
|
+
const observed = this.bridge;
|
|
633
|
+
observed.failure.catch(() => {
|
|
634
|
+
if (this.bridge === observed) void this.reconnect();
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
get evidenceCursor() {
|
|
638
|
+
return this.#evidenceCursor;
|
|
639
|
+
}
|
|
640
|
+
async reconnect() {
|
|
641
|
+
if (this.#disposed || !this.#reconnectFactory || this.#reconnectFailure) return;
|
|
642
|
+
this.#snapshot = { ...this.#snapshot, connection: "unknown", state: "unknown", revision: this.#snapshot.revision + 1 };
|
|
643
|
+
this.#reconnecting ??= this.#reconnectFactory().catch((error) => {
|
|
644
|
+
const unknown = this.#reconnectFailure = new Error(`Remote Pi reconciliation failed; task state is unknown: ${error instanceof Error ? error.message : String(error)}`);
|
|
645
|
+
for (const operation of this.#operations.values()) if (!operation.settled) {
|
|
646
|
+
operation.settled = true;
|
|
647
|
+
operation.reject(unknown);
|
|
648
|
+
}
|
|
649
|
+
}).finally(() => {
|
|
650
|
+
this.#reconnecting = void 0;
|
|
651
|
+
});
|
|
652
|
+
await this.#reconnecting;
|
|
653
|
+
}
|
|
654
|
+
async replaceTransport(input) {
|
|
655
|
+
if (this.#disposed) {
|
|
656
|
+
input.unsubscribe();
|
|
657
|
+
input.bridge.close();
|
|
658
|
+
await input.bridgeForward.close();
|
|
659
|
+
await input.connection.close();
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
const old = { bridgeForward: this.bridgeForward, bridge: this.bridge };
|
|
663
|
+
this.bridgeForward = input.bridgeForward;
|
|
664
|
+
this.bridge = input.bridge;
|
|
665
|
+
this.identity = { ...this.identity, paneId: input.paneId };
|
|
666
|
+
this.#reconnectFailure = void 0;
|
|
667
|
+
for (const frame of input.bridge.adopt((frame2) => this.#frame(frame2))) if (typeof frame.cursor === "number" && frame.cursor > this.#evidenceCursor) this.#frame(frame);
|
|
668
|
+
for (const operation of this.#operations.values()) if (!operation.accepted && !operation.settled) {
|
|
669
|
+
operation.settled = true;
|
|
670
|
+
operation.reject(new Error("Remote operation was not accepted before transport loss; task state is unknown."));
|
|
671
|
+
}
|
|
672
|
+
this.#evidenceCursor = Math.max(this.#evidenceCursor, input.cursor);
|
|
673
|
+
this.#snapshot = { connection: "connected", state: input.state, identity: this.identity, revision: this.#snapshot.revision + 1 };
|
|
674
|
+
const ownerReplacement = this.owner.replaceConnection({ connection: input.connection, unsubscribe: input.unsubscribe, paneId: input.paneId, state: input.state });
|
|
675
|
+
old.bridge.close();
|
|
676
|
+
await old.bridgeForward.close();
|
|
677
|
+
await ownerReplacement;
|
|
678
|
+
if (this.#disposed) {
|
|
679
|
+
await this.owner.cleanup(this.#aborted);
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
this.armReconnect(this.#reconnectFactory);
|
|
683
|
+
}
|
|
684
|
+
observeHerdr(value) {
|
|
685
|
+
const data = value && typeof value === "object" ? value.data : void 0;
|
|
686
|
+
if (!data || data.terminal_id !== this.identity.terminalId && data.pane_id !== this.identity.paneId) return;
|
|
687
|
+
this.#snapshot = { ...this.#snapshot, revision: this.#snapshot.revision + 1, state: herdrRunState(data.agent_status, this.#snapshot.state) };
|
|
688
|
+
}
|
|
689
|
+
#frame(frame) {
|
|
690
|
+
if (typeof frame.cursor === "number") {
|
|
691
|
+
if (frame.cursor <= this.#evidenceCursor) return;
|
|
692
|
+
this.#evidenceCursor = frame.cursor;
|
|
693
|
+
}
|
|
694
|
+
if (frame.nativeSessionId !== this.identity.nativeSessionId) {
|
|
695
|
+
this.bridge.fail(new Error("Remote Pi native session identity changed."));
|
|
696
|
+
void this.connection.close();
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
if (frame.type === "accepted" && typeof frame.requestId === "string") {
|
|
700
|
+
const operation = this.#operations.get(frame.requestId);
|
|
701
|
+
if (operation) operation.accepted = true;
|
|
702
|
+
}
|
|
703
|
+
if (frame.type === "supervisor-request" && this.supervisorDir && typeof frame.requestId === "string") this.#relaySupervisor(frame);
|
|
704
|
+
if (frame.type === "event" && frame.event && typeof frame.event === "object") {
|
|
705
|
+
const event = frame.event;
|
|
706
|
+
const message = event.message;
|
|
707
|
+
if (event.type === "message_end" && message) this.#messages.push(message);
|
|
708
|
+
for (const listener of this.#listeners) listener(event);
|
|
709
|
+
}
|
|
710
|
+
if (frame.type === "settled" && typeof frame.requestId === "string") {
|
|
711
|
+
if (frame.finalAssistant && typeof frame.finalAssistant === "object") {
|
|
712
|
+
const message = frame.finalAssistant;
|
|
713
|
+
if (!this.#messages.includes(message)) this.#messages.push(message);
|
|
714
|
+
}
|
|
715
|
+
if (frame.finalGit && typeof frame.finalGit === "object") this.#finalGit = frame.finalGit;
|
|
716
|
+
const operation = this.#operations.get(frame.requestId);
|
|
717
|
+
if (operation && !operation.settled) {
|
|
718
|
+
operation.accepted = true;
|
|
719
|
+
operation.settled = true;
|
|
720
|
+
frame.idle === true && frame.pending === false ? operation.resolve() : operation.reject(new Error("Remote Pi did not settle with an empty native queue."));
|
|
721
|
+
}
|
|
722
|
+
for (const listener of this.#listeners) listener({ type: "agent_settled" });
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
#relaySupervisor(frame) {
|
|
726
|
+
if (!this.supervisorDir || typeof frame.requestId !== "string") return;
|
|
727
|
+
const reason = frame.reason;
|
|
728
|
+
if (reason !== "need_decision" && reason !== "interview_request" && reason !== "progress_update") return;
|
|
729
|
+
const createdAt = Date.now();
|
|
730
|
+
const file = path.join(this.supervisorDir, "requests", `${path.basename(frame.requestId)}.json`);
|
|
731
|
+
const request = { type: "subagent.supervisor.request", id: frame.requestId, createdAt, ...reason !== "progress_update" ? { expiresAt: createdAt + 10 * 6e4 } : {}, reason, message: typeof frame.message === "string" ? frame.message : "", ...frame.interview && typeof frame.interview === "object" ? { interview: frame.interview } : {}, expectsReply: reason !== "progress_update", runId: this.runtime.runId ?? this.identity.runId, agent: this.runtime.agent ?? "remote", childIndex: this.runtime.childIndex ?? 0, orchestratorSessionId: this.runtime.orchestratorSessionId };
|
|
732
|
+
try {
|
|
733
|
+
fs.writeFileSync(file, JSON.stringify(request), { mode: 384, flag: "wx" });
|
|
734
|
+
} catch (error) {
|
|
735
|
+
if (error.code !== "EEXIST") throw error;
|
|
736
|
+
const existing = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
737
|
+
if (existing.id !== frame.requestId || existing.reason !== reason) throw new Error("Supervisor relay identity changed during replay.");
|
|
738
|
+
}
|
|
739
|
+
if (reason === "progress_update") this.bridge.supervisorDelivered(frame.requestId);
|
|
740
|
+
}
|
|
741
|
+
async #operation(operation, text, supervisorId) {
|
|
742
|
+
const requestId = `${++this.#sequence}_${randomBytes(5).toString("hex")}`;
|
|
743
|
+
let completion = Promise.resolve();
|
|
744
|
+
if (operation === "prompt") completion = new Promise((resolve, reject) => this.#operations.set(requestId, { resolve, reject, accepted: false, settled: false }));
|
|
745
|
+
try {
|
|
746
|
+
await Promise.race([this.bridge.prepare(requestId, operation, text, supervisorId), this.bridge.failure]);
|
|
747
|
+
await this.connection.client.call("agent.prompt", { target: this.identity.agentName, text: `/pi-subagents-bridge ${requestId}` });
|
|
748
|
+
await completion;
|
|
749
|
+
} catch (error) {
|
|
750
|
+
if (operation === "prompt" && this.bridge.failed) {
|
|
751
|
+
await this.reconnect();
|
|
752
|
+
await completion;
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
755
|
+
const pending = this.#operations.get(requestId);
|
|
756
|
+
if (pending) pending.settled = true;
|
|
757
|
+
throw error;
|
|
758
|
+
} finally {
|
|
759
|
+
if (operation === "prompt") this.#operations.delete(requestId);
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
subscribe(listener) {
|
|
763
|
+
this.#listeners.add(listener);
|
|
764
|
+
return () => this.#listeners.delete(listener);
|
|
765
|
+
}
|
|
766
|
+
prompt(text) {
|
|
767
|
+
return this.#operation("prompt", text);
|
|
768
|
+
}
|
|
769
|
+
steer(text) {
|
|
770
|
+
return this.#operation("steer", text);
|
|
771
|
+
}
|
|
772
|
+
followUp(text) {
|
|
773
|
+
return this.#operation("follow-up", text);
|
|
774
|
+
}
|
|
775
|
+
async abort() {
|
|
776
|
+
this.#aborted = true;
|
|
777
|
+
await this.#operation("abort");
|
|
778
|
+
}
|
|
779
|
+
async dispose() {
|
|
780
|
+
if (this.#disposed) return;
|
|
781
|
+
this.#disposed = true;
|
|
782
|
+
if (this.#replyTimer) clearInterval(this.#replyTimer);
|
|
783
|
+
this.bridge.close();
|
|
784
|
+
await this.bridgeForward.close();
|
|
785
|
+
await this.owner.cleanup(this.#aborted);
|
|
786
|
+
this.#snapshot = { ...this.#snapshot, connection: "closed" };
|
|
787
|
+
}
|
|
788
|
+
get messages() {
|
|
789
|
+
return this.#messages;
|
|
790
|
+
}
|
|
791
|
+
get sessionFile() {
|
|
792
|
+
return void 0;
|
|
793
|
+
}
|
|
794
|
+
get sessionId() {
|
|
795
|
+
return this.identity.nativeSessionId;
|
|
796
|
+
}
|
|
797
|
+
get modelId() {
|
|
798
|
+
return this.model;
|
|
799
|
+
}
|
|
800
|
+
get machineEvidence() {
|
|
801
|
+
return { machineId: this.identity.machineId, ...this.#initialGit ? { initial: this.#initialGit } : {}, ...this.#finalGit ? { final: this.#finalGit } : {} };
|
|
802
|
+
}
|
|
803
|
+
get placementSnapshot() {
|
|
804
|
+
return this.owner.snapshot;
|
|
805
|
+
}
|
|
806
|
+
};
|
|
807
|
+
async function reconnectHerdrPiSession(session, launch, dependencies = {}) {
|
|
808
|
+
const connect = dependencies.connect ?? connectHerdrMachine, discoverManifest = dependencies.discoverManifest ?? discoverBridgeManifest, createBridge = dependencies.createBridge ?? ((socketPath, runId) => new BridgeChannel(socketPath, runId));
|
|
809
|
+
let validated;
|
|
810
|
+
const result = await boundedHerdrReconnect(session.identity, session.evidenceCursor, async () => {
|
|
811
|
+
const connection = await connect(launch.machine);
|
|
812
|
+
let unsubscribe = () => {
|
|
813
|
+
};
|
|
814
|
+
let bridgeForward;
|
|
815
|
+
let bridge;
|
|
816
|
+
const generation = { adopted: false };
|
|
817
|
+
try {
|
|
818
|
+
const snapshot = parseHerdrSessionSnapshot(await connection.client.call("session.snapshot"));
|
|
819
|
+
const agents = snapshotAgents(snapshot);
|
|
820
|
+
const manifest = await discoverManifest(launch.machine, session.identity.runId, session.identity.runtimeDir);
|
|
821
|
+
bridgeForward = await connection.forwardRemoteSocket(manifest.socketPath, "bridge-reconnect");
|
|
822
|
+
bridge = createBridge(bridgeForward.socketPath, session.identity.runId);
|
|
823
|
+
const ready = await waitForReadyBridgeFrame(bridge, 8e3, "Reconnected bridge handshake timed out.", true);
|
|
824
|
+
const candidate = { endpoint: connection.endpoint, agents, bridge: { runId: ready.runId, nativeSessionId: ready.nativeSessionId, packageVersion: ready.packageVersion, protocol: ready.protocol, evidenceCursor: ready.evidenceCursor, evidenceFloor: ready.evidenceFloor } };
|
|
825
|
+
const check = reconcileHerdrReconnect(session.identity, candidate, session.evidenceCursor);
|
|
826
|
+
if (!check.ok) throw new Error(check.reason);
|
|
827
|
+
unsubscribe = await connection.client.subscribe(herdrStatusSubscriptions(check.paneId), (event) => {
|
|
828
|
+
session.owner.observeEvent(event);
|
|
829
|
+
session.observeHerdr(event);
|
|
830
|
+
}, (error) => {
|
|
831
|
+
if (!generation.adopted) {
|
|
832
|
+
generation.lost ??= error;
|
|
833
|
+
return;
|
|
834
|
+
}
|
|
835
|
+
session.owner.markConnectionUnknown(connection);
|
|
836
|
+
void session.reconnect();
|
|
837
|
+
});
|
|
838
|
+
if (generation.lost) throw generation.lost;
|
|
839
|
+
validated = { connection, unsubscribe, bridgeForward, bridge, candidate: generation };
|
|
840
|
+
return candidate;
|
|
841
|
+
} catch (error) {
|
|
842
|
+
unsubscribe();
|
|
843
|
+
bridge?.close();
|
|
844
|
+
await bridgeForward?.close();
|
|
845
|
+
await connection.close();
|
|
846
|
+
throw error;
|
|
847
|
+
}
|
|
848
|
+
}, { attempts: 3, deadlineMs: 15e3, disposed: () => session.placementSnapshot.connection === "closed" });
|
|
849
|
+
if (!result.ok) throw new Error(`Pane-native reconnect remains unknown: ${result.reason}`);
|
|
850
|
+
if (!validated) throw new Error("Pane-native reconnect produced no validated transport.");
|
|
851
|
+
if (validated.candidate.lost) {
|
|
852
|
+
validated.unsubscribe();
|
|
853
|
+
validated.bridge.close();
|
|
854
|
+
await validated.bridgeForward.close();
|
|
855
|
+
await validated.connection.close();
|
|
856
|
+
throw validated.candidate.lost;
|
|
857
|
+
}
|
|
858
|
+
validated.candidate.adopted = true;
|
|
859
|
+
await session.replaceTransport({ ...validated, paneId: result.paneId, cursor: result.cursor, state: result.state });
|
|
860
|
+
}
|
|
861
|
+
async function createHerdrPiSession(launch) {
|
|
862
|
+
if (!launch.machine) throw new Error("Pane-native Pi launch requires a saved machine.");
|
|
863
|
+
const policy = serializeHerdrPiLaunch(launch);
|
|
864
|
+
const runId = safeRunId(launch.runtime.runId);
|
|
865
|
+
const owner = await HerdrPlacedRunOwner.create(launch.machine, runId);
|
|
866
|
+
const runtimeDir = owner.runtimeDir, connection = owner.connection;
|
|
867
|
+
let owned;
|
|
868
|
+
let agentName;
|
|
869
|
+
let observeHerdr;
|
|
870
|
+
try {
|
|
871
|
+
let reconnectSession;
|
|
872
|
+
owned = await owner.provision();
|
|
873
|
+
await owner.subscribe((event) => observeHerdr?.(event), () => void reconnectSession?.reconnect());
|
|
874
|
+
agentName = `pi-${runId.slice(-20)}`;
|
|
875
|
+
const { terminalId } = await owner.start("pi", agentName, policy.args);
|
|
876
|
+
const manifest = await discoverBridgeManifest(launch.machine, runId, runtimeDir);
|
|
877
|
+
if (manifest.protocol !== HERDR_PI_PROTOCOL || manifest.packageVersion !== package_default.version) throw new Error(`Remote pi-subagents bridge version mismatch (remote ${manifest.packageVersion}, local ${package_default.version}).`);
|
|
878
|
+
const bridgeForward = await connection.forwardRemoteSocket(manifest.socketPath, "bridge");
|
|
879
|
+
const bridge = new BridgeChannel(bridgeForward.socketPath, runId);
|
|
880
|
+
const ready = await waitForReadyBridgeFrame(bridge, 15e3, "Remote Pi bridge handshake timed out.");
|
|
881
|
+
if (ready.packageVersion !== package_default.version || ready.nativeSessionId !== manifest.nativeSessionId || ready.cwd !== launch.machine.cwd) throw new Error("Remote Pi bridge handshake identity mismatch.");
|
|
882
|
+
const configured = await Promise.race([bridge.configure(policy.resources), bridge.failure]);
|
|
883
|
+
if (configured.nativeSessionId !== manifest.nativeSessionId || configured.agent !== policy.resources.agent) throw new Error("Remote Pi resource resolution identity mismatch.");
|
|
884
|
+
if (!Array.isArray(configured.tools) || policy.resources.toolCeiling && configured.tools.some((tool) => !policy.resources.toolCeiling.includes(String(tool)))) throw new Error("Remote Pi active-tool ceiling acknowledgement mismatch.");
|
|
885
|
+
if (launch.model && configured.model !== launch.model.split(":")[0]) throw new Error(`Remote Pi model '${launch.model}' did not resolve to the requested provider/model.`);
|
|
886
|
+
const identity = { runId, machineId: launch.machine.id, target: launch.machine.target, session: connection.endpoint.session, workspaceId: owned.workspaceId, tabId: owned.tabId, paneId: owned.paneId, terminalId, agentName, nativeSessionId: manifest.nativeSessionId, cwd: launch.machine.cwd, runtimeDir };
|
|
887
|
+
owner.journal(identity);
|
|
888
|
+
const session = new HerdrPiSession(owner, bridgeForward, bridge, configured.tools, typeof ready.model === "string" ? ready.model : void 0, launch.runtime, ready.initialGit);
|
|
889
|
+
reconnectSession = session;
|
|
890
|
+
observeHerdr = (event) => session.observeHerdr(event);
|
|
891
|
+
session.armReconnect(() => reconnectHerdrPiSession(session, launch));
|
|
892
|
+
return session;
|
|
893
|
+
} catch (error) {
|
|
894
|
+
await owner.cleanup();
|
|
895
|
+
throw error;
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
function createPlacementAwareChildSessionFactory(local, createRemote = createHerdrPiSession) {
|
|
899
|
+
const remote = /* @__PURE__ */ new Set();
|
|
900
|
+
return { async create(launch) {
|
|
901
|
+
if (!launch.machine) return local.create(launch);
|
|
902
|
+
serializeHerdrPiLaunch(launch);
|
|
903
|
+
const child = await createRemote(launch);
|
|
904
|
+
remote.add(child);
|
|
905
|
+
return child;
|
|
906
|
+
}, async dispose() {
|
|
907
|
+
await Promise.allSettled([...remote].map((child) => child.dispose()));
|
|
908
|
+
remote.clear();
|
|
909
|
+
await local.dispose();
|
|
910
|
+
} };
|
|
911
|
+
}
|
|
912
|
+
export {
|
|
913
|
+
BridgeChannel,
|
|
914
|
+
HERDR_MAX_OWNED_PANES,
|
|
915
|
+
HerdrPiSession,
|
|
916
|
+
HerdrPlacedRunOwner,
|
|
917
|
+
boundedHerdrReconnect,
|
|
918
|
+
createHerdrPiSession,
|
|
919
|
+
createPlacementAwareChildSessionFactory,
|
|
920
|
+
createRemoteRuntimeDir,
|
|
921
|
+
discoverBridgeManifest,
|
|
922
|
+
herdrPaneAllocationKey,
|
|
923
|
+
herdrStatusSubscriptions,
|
|
924
|
+
ownsHerdrPane,
|
|
925
|
+
parseHerdrAgent,
|
|
926
|
+
parseHerdrCreated,
|
|
927
|
+
parseHerdrSessionSnapshot,
|
|
928
|
+
provisionHerdrPane,
|
|
929
|
+
reconcileHerdrPlacedRun,
|
|
930
|
+
reconcileHerdrReconnect,
|
|
931
|
+
reconnectHerdrPiSession,
|
|
932
|
+
removeRemoteRuntimeDir,
|
|
933
|
+
serializeHerdrPiLaunch,
|
|
934
|
+
withHerdrPaneAllocationLock
|
|
935
|
+
};
|