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,946 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_WATCHDOG_CONFIG,
|
|
3
|
+
MainWatchdogRuntime,
|
|
4
|
+
WATCHDOG_DIFF_TOOL_NAME,
|
|
5
|
+
captureWatchdogDiffBaseline,
|
|
6
|
+
childSupervisorMetadata,
|
|
7
|
+
createMainWatchdogReview,
|
|
8
|
+
createWatchdogDiffTool,
|
|
9
|
+
createWatchdogWarningMessage,
|
|
10
|
+
drainOutstandingWork,
|
|
11
|
+
evaluateChildToolDiagnostic,
|
|
12
|
+
formatWatchdogCwdSection,
|
|
13
|
+
registerNativeSupervisorClient,
|
|
14
|
+
registerWaitTool,
|
|
15
|
+
resolveCurrentSessionId,
|
|
16
|
+
resolveWatchdogReviewModel,
|
|
17
|
+
startWatchdogDiffBaselineCapture
|
|
18
|
+
} from "./chunk-BPS2AGBZ.js";
|
|
19
|
+
import {
|
|
20
|
+
MODEL_ONLY_TOOL,
|
|
21
|
+
agentStreamOptions,
|
|
22
|
+
opencodeSessionHeaders
|
|
23
|
+
} from "./chunk-NNLASTQE.js";
|
|
24
|
+
import {
|
|
25
|
+
inheritedNestedRouteOf
|
|
26
|
+
} from "./chunk-VJHOELQP.js";
|
|
27
|
+
import {
|
|
28
|
+
CHILD_WATCHDOG_STATUS_EVENT,
|
|
29
|
+
MISSING_STRUCTURED_ACCEPTANCE_REPORT_ERROR,
|
|
30
|
+
SUBAGENT_WATCHDOG_WARNING_TYPE,
|
|
31
|
+
appendPermissionAudit,
|
|
32
|
+
createStructuredOutputToolParameters,
|
|
33
|
+
decodeChildWatchdogConfig,
|
|
34
|
+
getAgentDir,
|
|
35
|
+
permissionArgsPreview,
|
|
36
|
+
permissionDecision,
|
|
37
|
+
shouldBlockToolForBudget,
|
|
38
|
+
toolBudgetBlockedMessage,
|
|
39
|
+
toolBudgetSoftNudge,
|
|
40
|
+
validateAcceptanceReport,
|
|
41
|
+
validateStructuredOutputValue
|
|
42
|
+
} from "./chunk-ZBC44JJ3.js";
|
|
43
|
+
import {
|
|
44
|
+
INTERCOM_SESSION_IDENTITY_EVENT
|
|
45
|
+
} from "./chunk-5LFLVSTM.js";
|
|
46
|
+
|
|
47
|
+
// src/runs/shared/subagent-prompt-runtime.ts
|
|
48
|
+
import { createHash } from "node:crypto";
|
|
49
|
+
import * as fs from "node:fs";
|
|
50
|
+
import * as path from "node:path";
|
|
51
|
+
import { declarationsEqual, getCurrentSystemMessage, getCurrentTools } from "@earendil-works/pi-ai";
|
|
52
|
+
|
|
53
|
+
// src/runs/shared/runtime-acknowledged-extensions.ts
|
|
54
|
+
var RUNTIME_EXTENSION_ACK_EVENT = "subagent:acknowledge-extension";
|
|
55
|
+
var MAX_RUNTIME_ACKNOWLEDGED_EXTENSION_IDS = 32;
|
|
56
|
+
var MAX_RUNTIME_ACKNOWLEDGED_EXTENSION_ID_LENGTH = 128;
|
|
57
|
+
function isRuntimeAcknowledgedExtensionId(value) {
|
|
58
|
+
return typeof value === "string" && value.length > 0 && value.length <= MAX_RUNTIME_ACKNOWLEDGED_EXTENSION_ID_LENGTH && /^[A-Za-z0-9._:@+-]+$/.test(value) && !value.includes("..") && !value.includes("/") && !value.includes("\\");
|
|
59
|
+
}
|
|
60
|
+
function projectRuntimeAcknowledgedExtensions(ids) {
|
|
61
|
+
const unique = [];
|
|
62
|
+
const seen = /* @__PURE__ */ new Set();
|
|
63
|
+
for (const id of ids) {
|
|
64
|
+
if (!isRuntimeAcknowledgedExtensionId(id) || seen.has(id)) continue;
|
|
65
|
+
seen.add(id);
|
|
66
|
+
unique.push(id);
|
|
67
|
+
}
|
|
68
|
+
if (unique.length === 0) return void 0;
|
|
69
|
+
return {
|
|
70
|
+
version: 1,
|
|
71
|
+
source: "child-runtime",
|
|
72
|
+
ids: unique.slice(0, MAX_RUNTIME_ACKNOWLEDGED_EXTENSION_IDS),
|
|
73
|
+
omitted: Math.max(0, unique.length - MAX_RUNTIME_ACKNOWLEDGED_EXTENSION_IDS)
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// src/runs/shared/tool-availability.ts
|
|
78
|
+
function formatChildToolDiagnostic(diagnostic, options = {}) {
|
|
79
|
+
const subject = diagnostic.agent ? `Agent '${diagnostic.agent}'` : "Subagent";
|
|
80
|
+
if (options.host === "parent") {
|
|
81
|
+
return [
|
|
82
|
+
`${subject} ran as a foreground child, which never loads the parent's ambient extensions, and these child tools were unavailable: ${diagnostic.missing.join(", ")}.`,
|
|
83
|
+
"The `tools` field is a strict allowlist; it does not load extension code.",
|
|
84
|
+
...diagnostic.missingMcpDirectTools?.length ? [`MCP direct tools missing from the child registry: ${diagnostic.missingMcpDirectTools.join(", ")}.`] : [],
|
|
85
|
+
"MCP tools require background children (`async: true`) because only they load ambient extensions.",
|
|
86
|
+
"For extension tools a foreground child can load, add the provider path to `subagentOnlyExtensions` (child-only), `extensions`, or as a path-like entry in `tools`, while keeping each registered tool name in `tools`."
|
|
87
|
+
].join("\n");
|
|
88
|
+
}
|
|
89
|
+
return [
|
|
90
|
+
`${subject} requested unavailable child tools: ${diagnostic.missing.join(", ")}.`,
|
|
91
|
+
"The `tools` field is a strict allowlist; it does not load extension code.",
|
|
92
|
+
...diagnostic.missingMcpDirectTools?.length ? [`Resolved MCP direct tools missing from the child registry: ${diagnostic.missingMcpDirectTools.join(", ")}. Resolved names must match what the host or pi-mcp-adapter registers; check the MCP direct-tool registration before treating this as a tool-call failure.`] : [],
|
|
93
|
+
"For extension tools, add the provider path to `subagentOnlyExtensions` (child-only), `extensions`, or as a path-like entry in `tools`, while keeping each registered tool name in `tools`.",
|
|
94
|
+
"For MCP tools, verify the MCP adapter configuration and selected tool names. For builtin tools, verify the name against the installed Pi version."
|
|
95
|
+
].join("\n");
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// src/watchdog/register-child.ts
|
|
99
|
+
function childResolvedConfig(config) {
|
|
100
|
+
return {
|
|
101
|
+
...DEFAULT_WATCHDOG_CONFIG,
|
|
102
|
+
enabled: true,
|
|
103
|
+
agentEndTimeoutMs: config.agentEndTimeoutMs,
|
|
104
|
+
maxWarnings: config.maxWarnings,
|
|
105
|
+
main: {
|
|
106
|
+
enabled: true,
|
|
107
|
+
...config.model ? { model: config.model } : {},
|
|
108
|
+
...config.thinking !== void 0 ? { thinking: config.thinking } : {}
|
|
109
|
+
},
|
|
110
|
+
stalemateRepeats: config.stalemateRepeats,
|
|
111
|
+
cadence: { ...config.cadence },
|
|
112
|
+
children: {
|
|
113
|
+
...DEFAULT_WATCHDOG_CONFIG.children,
|
|
114
|
+
watchdogTailTimeoutMs: config.watchdogTailTimeoutMs
|
|
115
|
+
},
|
|
116
|
+
lsp: { ...config.lsp }
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function childWarningDetails(details, config) {
|
|
120
|
+
return {
|
|
121
|
+
...details,
|
|
122
|
+
source: details.source === "lsp" ? "lsp" : "child",
|
|
123
|
+
...config.agent ? { agent: config.agent } : {},
|
|
124
|
+
...config.runId ? { runId: config.runId } : {}
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function registerChildWatchdog(pi, childConfig, writeStatus, structuredTerminal) {
|
|
128
|
+
if (!childConfig) return void 0;
|
|
129
|
+
if (!writeStatus) throw new Error("Child watchdog status sink is missing; the host must pass ChildRuntimeConfig.watchdogStatus.");
|
|
130
|
+
let currentContext;
|
|
131
|
+
let diffBaseline;
|
|
132
|
+
let agentSettled = false;
|
|
133
|
+
let seq = 0;
|
|
134
|
+
const emitStatus = (phase, reason, warning) => {
|
|
135
|
+
writeStatus({
|
|
136
|
+
type: CHILD_WATCHDOG_STATUS_EVENT,
|
|
137
|
+
...childConfig.runId ? { runId: childConfig.runId } : {},
|
|
138
|
+
...childConfig.agent ? { agent: childConfig.agent } : {},
|
|
139
|
+
...childConfig.childIndex !== void 0 ? { childIndex: childConfig.childIndex, stepIndex: childConfig.childIndex } : {},
|
|
140
|
+
seq: ++seq,
|
|
141
|
+
phase,
|
|
142
|
+
ts: Date.now(),
|
|
143
|
+
...reason ? { reason } : {},
|
|
144
|
+
...warning ? { warning } : {}
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
const resolved = childResolvedConfig(childConfig);
|
|
148
|
+
const runtime = new MainWatchdogRuntime({
|
|
149
|
+
resolveConfig: () => ({ ok: true, config: resolved, errors: [], sources: [{ scope: "session", exists: true }] }),
|
|
150
|
+
review: createMainWatchdogReview(() => currentContext, { getThinkingLevel: () => pi.getThinkingLevel(), diffBaseline: () => diffBaseline }),
|
|
151
|
+
reviewDescription: "child model review",
|
|
152
|
+
reviewChangesOnly: true,
|
|
153
|
+
displayWarning: (details, options) => {
|
|
154
|
+
const childDetails = childWarningDetails(details, childConfig);
|
|
155
|
+
emitStatus("reviewing", void 0, { severity: childDetails.severity, importance: childDetails.importance, category: childDetails.category, summary: childDetails.summary, evidence: childDetails.evidence, recommendedAction: childDetails.recommendedAction, ...childDetails.displayedAt ? { displayedAt: childDetails.displayedAt } : {}, addressed: false, stalemate: childDetails.state === "stalemate" });
|
|
156
|
+
const message = createWatchdogWarningMessage(childDetails, { display: true, details: childDetails });
|
|
157
|
+
if (agentSettled) pi.appendEntry(SUBAGENT_WATCHDOG_WARNING_TYPE, childDetails);
|
|
158
|
+
else pi.sendMessage(message, options);
|
|
159
|
+
},
|
|
160
|
+
displayUserWarning: (details) => {
|
|
161
|
+
const childDetails = childWarningDetails(details, childConfig);
|
|
162
|
+
emitStatus("reviewing", void 0, { severity: childDetails.severity, importance: childDetails.importance, category: childDetails.category, summary: childDetails.summary, evidence: childDetails.evidence, recommendedAction: childDetails.recommendedAction, ...childDetails.displayedAt ? { displayedAt: childDetails.displayedAt } : {}, addressed: false, stalemate: childDetails.state === "stalemate" });
|
|
163
|
+
pi.appendEntry(SUBAGENT_WATCHDOG_WARNING_TYPE, childDetails);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
const rememberContext = (ctx) => {
|
|
167
|
+
currentContext = ctx;
|
|
168
|
+
};
|
|
169
|
+
const onRuntimeEvent = pi.on;
|
|
170
|
+
onRuntimeEvent("session_start", (_event, ctx) => {
|
|
171
|
+
rememberContext(ctx);
|
|
172
|
+
diffBaseline = startWatchdogDiffBaselineCapture(ctx.cwd);
|
|
173
|
+
runtime.bindSession(ctx);
|
|
174
|
+
emitStatus("idle");
|
|
175
|
+
});
|
|
176
|
+
onRuntimeEvent("before_agent_start", (event, ctx) => {
|
|
177
|
+
agentSettled = false;
|
|
178
|
+
rememberContext(ctx);
|
|
179
|
+
runtime.handleBeforeAgentStart(event, ctx);
|
|
180
|
+
});
|
|
181
|
+
onRuntimeEvent("turn_end", (event, ctx) => {
|
|
182
|
+
rememberContext(ctx);
|
|
183
|
+
runtime.handleTurnEnd(event, ctx, structuredTerminal?.captured === true);
|
|
184
|
+
});
|
|
185
|
+
onRuntimeEvent("tool_result", (_event, ctx) => {
|
|
186
|
+
rememberContext(ctx);
|
|
187
|
+
runtime.handleToolResult(ctx);
|
|
188
|
+
});
|
|
189
|
+
onRuntimeEvent("agent_end", async (event, ctx) => {
|
|
190
|
+
rememberContext(ctx);
|
|
191
|
+
emitStatus("reviewing");
|
|
192
|
+
await runtime.handleAgentEnd(event, ctx);
|
|
193
|
+
const snapshot = runtime.getSnapshot(ctx.cwd);
|
|
194
|
+
if (snapshot.status === "failed") emitStatus("failed", snapshot.lastError);
|
|
195
|
+
else if (snapshot.status === "stale") emitStatus("stale", "review stale");
|
|
196
|
+
else emitStatus("idle");
|
|
197
|
+
});
|
|
198
|
+
onRuntimeEvent("agent_settled", () => {
|
|
199
|
+
agentSettled = true;
|
|
200
|
+
});
|
|
201
|
+
onRuntimeEvent("session_shutdown", () => {
|
|
202
|
+
currentContext = void 0;
|
|
203
|
+
runtime.dispose();
|
|
204
|
+
emitStatus("idle");
|
|
205
|
+
});
|
|
206
|
+
return runtime;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// src/watchdog/permission-arbiter.ts
|
|
210
|
+
import { Agent } from "@earendil-works/pi-agent-core";
|
|
211
|
+
import { convertToLlm } from "@earendil-works/pi-coding-agent";
|
|
212
|
+
import { Type } from "typebox";
|
|
213
|
+
var PermissionDecisionParams = Type.Object({
|
|
214
|
+
decision: Type.String({ enum: ["approve", "deny"] }),
|
|
215
|
+
reason: Type.String({ description: "One concise reason for this exact decision." })
|
|
216
|
+
}, { additionalProperties: false });
|
|
217
|
+
function conciseReason(value) {
|
|
218
|
+
const trimmed = value.trim();
|
|
219
|
+
return trimmed ? trimmed.slice(0, 500) : "Watchdog returned an empty reason.";
|
|
220
|
+
}
|
|
221
|
+
function createWatchdogPermissionArbiter(options = {}) {
|
|
222
|
+
return async (request) => {
|
|
223
|
+
const preview = permissionArgsPreview(request.args);
|
|
224
|
+
const createdAt = Date.now();
|
|
225
|
+
const auditBase = { type: "permission.request", createdAt, toolName: request.toolName, preview, matchedRule: "ask", decisionSource: "watchdog" };
|
|
226
|
+
appendPermissionAudit(request.auditPath, auditBase);
|
|
227
|
+
let completed = false;
|
|
228
|
+
const finish = (approved, reason, decision2) => {
|
|
229
|
+
const concise = conciseReason(reason);
|
|
230
|
+
if (completed) return { approved, reason: concise, source: "watchdog" };
|
|
231
|
+
completed = true;
|
|
232
|
+
appendPermissionAudit(request.auditPath, {
|
|
233
|
+
type: "permission.decision",
|
|
234
|
+
createdAt: Date.now(),
|
|
235
|
+
requestCreatedAt: createdAt,
|
|
236
|
+
toolName: request.toolName,
|
|
237
|
+
decision: decision2,
|
|
238
|
+
approved,
|
|
239
|
+
decisionSource: "watchdog",
|
|
240
|
+
reason: concise
|
|
241
|
+
});
|
|
242
|
+
return { approved, reason: concise, source: "watchdog" };
|
|
243
|
+
};
|
|
244
|
+
let childConfig;
|
|
245
|
+
try {
|
|
246
|
+
childConfig = decodeChildWatchdogConfig(request.rawWatchdogConfig);
|
|
247
|
+
} catch (error) {
|
|
248
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
249
|
+
return finish(false, `Watchdog permission arbiter configuration is invalid: ${reason}`, "unavailable");
|
|
250
|
+
}
|
|
251
|
+
if (!childConfig) return finish(false, "Watchdog permission arbiter is unavailable because the child watchdog is disabled.", "unavailable");
|
|
252
|
+
if (request.signal?.aborted || request.ctx.signal?.aborted) return finish(false, "Watchdog permission decision was cancelled.", "cancelled");
|
|
253
|
+
let decision;
|
|
254
|
+
const tool = {
|
|
255
|
+
name: "watchdog_permission_decision",
|
|
256
|
+
label: "Watchdog permission decision",
|
|
257
|
+
description: "Approve or deny this exact child tool call. Call exactly once.",
|
|
258
|
+
parameters: PermissionDecisionParams,
|
|
259
|
+
executionMode: "sequential",
|
|
260
|
+
async execute(_toolCallId, params) {
|
|
261
|
+
if (!decision) decision = params;
|
|
262
|
+
return { content: [{ type: "text", text: "Permission decision recorded." }], details: { recorded: true } };
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
let timeout;
|
|
266
|
+
let agent;
|
|
267
|
+
let abort;
|
|
268
|
+
try {
|
|
269
|
+
const run = async () => {
|
|
270
|
+
const config = childResolvedConfig(childConfig);
|
|
271
|
+
const selection = await resolveWatchdogReviewModel(request.ctx, config);
|
|
272
|
+
const auth = selection.auth;
|
|
273
|
+
const sessionId = request.ctx.sessionManager.getSessionId();
|
|
274
|
+
const baseStreamFn = options.streamFn ?? ((model, context, streamOptions) => request.ctx.modelRegistry.streamSimple(model, context, streamOptions));
|
|
275
|
+
const streamFn = (model, context, streamOptions) => baseStreamFn(model, context, {
|
|
276
|
+
...streamOptions,
|
|
277
|
+
...auth.apiKey ? { apiKey: auth.apiKey } : {},
|
|
278
|
+
env: auth.env || streamOptions?.env ? { ...auth.env ?? {}, ...streamOptions?.env ?? {} } : void 0,
|
|
279
|
+
headers: { ...opencodeSessionHeaders(model, sessionId), ...streamOptions?.headers ?? {}, ...auth.headers ?? {} }
|
|
280
|
+
});
|
|
281
|
+
const systemPrompt = [
|
|
282
|
+
"You are the pi-subagents watchdog permission arbiter.",
|
|
283
|
+
"Decide only whether this exact non-bash child tool call should proceed.",
|
|
284
|
+
"Call watchdog_permission_decision exactly once with approve or deny and a concise reason.",
|
|
285
|
+
"Deny when uncertain. Do not produce freeform advice or ask the parent orchestrator.",
|
|
286
|
+
"",
|
|
287
|
+
formatWatchdogCwdSection(request.ctx.cwd)
|
|
288
|
+
].join("\n");
|
|
289
|
+
const tools = [tool];
|
|
290
|
+
agent = new Agent({
|
|
291
|
+
initialState: {
|
|
292
|
+
systemPrompt,
|
|
293
|
+
model: selection.model,
|
|
294
|
+
thinkingLevel: selection.thinkingLevel,
|
|
295
|
+
tools
|
|
296
|
+
},
|
|
297
|
+
convertToLlm,
|
|
298
|
+
...agentStreamOptions(streamFn),
|
|
299
|
+
getApiKey: (providerName) => providerName === selection.model.provider ? auth.apiKey : void 0,
|
|
300
|
+
beforeToolCall: async ({ toolCall }) => toolCall.name === tool.name ? void 0 : { block: true, reason: `Permission arbiter tool '${toolCall.name}' is not allowed.` },
|
|
301
|
+
toolExecution: "sequential"
|
|
302
|
+
});
|
|
303
|
+
await agent.prompt(`Tool: ${request.toolName}
|
|
304
|
+
Redacted arguments: ${preview}`);
|
|
305
|
+
if (!decision) return finish(false, "Watchdog permission arbiter returned no decision.", "malformed");
|
|
306
|
+
const approved = decision.decision === "approve";
|
|
307
|
+
return finish(approved, decision.reason, decision.decision);
|
|
308
|
+
};
|
|
309
|
+
return await Promise.race([
|
|
310
|
+
run(),
|
|
311
|
+
new Promise((resolve2) => {
|
|
312
|
+
timeout = setTimeout(() => {
|
|
313
|
+
agent?.abort();
|
|
314
|
+
resolve2(finish(false, "Watchdog permission decision timed out.", "timeout"));
|
|
315
|
+
}, childConfig.agentEndTimeoutMs);
|
|
316
|
+
}),
|
|
317
|
+
new Promise((resolve2) => {
|
|
318
|
+
abort = () => {
|
|
319
|
+
agent?.abort();
|
|
320
|
+
resolve2(finish(false, "Watchdog permission decision was cancelled.", "cancelled"));
|
|
321
|
+
};
|
|
322
|
+
request.signal?.addEventListener("abort", abort, { once: true });
|
|
323
|
+
request.ctx.signal?.addEventListener("abort", abort, { once: true });
|
|
324
|
+
})
|
|
325
|
+
]);
|
|
326
|
+
} catch (error) {
|
|
327
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
328
|
+
return finish(false, `Watchdog permission arbiter failed closed: ${reason}`, reason.includes("timed out") ? "timeout" : "error");
|
|
329
|
+
} finally {
|
|
330
|
+
if (timeout) clearTimeout(timeout);
|
|
331
|
+
if (abort) {
|
|
332
|
+
request.signal?.removeEventListener("abort", abort);
|
|
333
|
+
request.ctx.signal?.removeEventListener("abort", abort);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
var requestWatchdogPermission = createWatchdogPermissionArbiter();
|
|
339
|
+
|
|
340
|
+
// src/runs/shared/subagent-prompt-runtime.ts
|
|
341
|
+
var STRUCTURED_OUTPUT_INSTRUCTIONS = [
|
|
342
|
+
"This subagent step has a strict structured output contract.",
|
|
343
|
+
"Your final action must be to call the `structured_output` tool with JSON matching the provided schema.",
|
|
344
|
+
"Do not rely on prose-only completion; if you do not call `structured_output`, the parent will fail this step."
|
|
345
|
+
].join("\n");
|
|
346
|
+
var CHILD_SUBAGENT_BOUNDARY_INSTRUCTIONS = [
|
|
347
|
+
"You are a child subagent, not the parent orchestrator.",
|
|
348
|
+
"The parent session owns delegation, orchestration, review fanout, and follow-up worker launches.",
|
|
349
|
+
"Ignore prior parent-only orchestration instructions in inherited conversation history.",
|
|
350
|
+
"Do not propose or run subagents. Complete only your assigned role-specific task with the tools available to you.",
|
|
351
|
+
"If you need to edit files, use the available editing tools. Do not print tool-call syntax, patches, or pseudo-tool calls as text."
|
|
352
|
+
].join("\n");
|
|
353
|
+
var CHILD_FANOUT_BOUNDARY_INSTRUCTIONS = [
|
|
354
|
+
"You are a child subagent with explicit fanout responsibility for this assigned task.",
|
|
355
|
+
"The parent session owns final orchestration, acceptance, and follow-up implementation launches.",
|
|
356
|
+
"You may use the `subagent` tool only for the fanout work explicitly requested in this task.",
|
|
357
|
+
"Do not broaden yourself into general parent orchestration. Do not launch follow-up workers unless the task explicitly asks for that.",
|
|
358
|
+
"The maxSubagentDepth cap still applies and may block further fanout.",
|
|
359
|
+
"If you need to edit files, use the available editing tools. Do not print tool-call syntax, patches, or pseudo-tool calls as text."
|
|
360
|
+
].join("\n");
|
|
361
|
+
var PARENT_ONLY_CUSTOM_MESSAGE_TYPES = /* @__PURE__ */ new Set([
|
|
362
|
+
"subagent-orchestration-instructions",
|
|
363
|
+
"subagent-slash-result",
|
|
364
|
+
"subagent-slash-text-result",
|
|
365
|
+
"subagent-notify",
|
|
366
|
+
"subagent_control_notice",
|
|
367
|
+
"subagent-control",
|
|
368
|
+
"subagent-control-notice"
|
|
369
|
+
]);
|
|
370
|
+
var SUBAGENT_ORCHESTRATION_SKILL_NAME_PATTERN = /<name>\s*pi-subagents\s*<\/name>/;
|
|
371
|
+
var PROJECT_CONTEXT_XML_HEADER = "\n\n<project_context>\n\n";
|
|
372
|
+
var PROJECT_CONTEXT_LEGACY_HEADER = "\n\n# Project Context\n\nProject-specific instructions and guidelines:\n\n";
|
|
373
|
+
var SKILLS_HEADER = "\n\nThe following skills provide specialized instructions for specific tasks.";
|
|
374
|
+
var DATE_HEADER = "\nCurrent date:";
|
|
375
|
+
function registerRuntimeExtensionAcknowledgements(pi, sink) {
|
|
376
|
+
if (!sink) return;
|
|
377
|
+
const ids = [];
|
|
378
|
+
let finalized = false;
|
|
379
|
+
const acknowledge = (payload) => {
|
|
380
|
+
if (finalized || !payload || typeof payload !== "object") return void 0;
|
|
381
|
+
const id = payload.id;
|
|
382
|
+
if (isRuntimeAcknowledgedExtensionId(id)) ids.push(id);
|
|
383
|
+
return void 0;
|
|
384
|
+
};
|
|
385
|
+
const finalize = () => {
|
|
386
|
+
if (finalized) return void 0;
|
|
387
|
+
finalized = true;
|
|
388
|
+
sink(ids);
|
|
389
|
+
return void 0;
|
|
390
|
+
};
|
|
391
|
+
try {
|
|
392
|
+
const events = pi.events;
|
|
393
|
+
events?.on?.(RUNTIME_EXTENSION_ACK_EVENT, acknowledge);
|
|
394
|
+
const onRuntimeEvent = pi.on;
|
|
395
|
+
onRuntimeEvent("agent_end", finalize);
|
|
396
|
+
onRuntimeEvent("session_shutdown", finalize);
|
|
397
|
+
} catch {
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
function findSectionEnd(prompt, startIndex, nextHeaders) {
|
|
401
|
+
let endIndex = prompt.length;
|
|
402
|
+
for (const header of nextHeaders) {
|
|
403
|
+
const index = prompt.indexOf(header, startIndex);
|
|
404
|
+
if (index !== -1 && index < endIndex) {
|
|
405
|
+
endIndex = index;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
return endIndex;
|
|
409
|
+
}
|
|
410
|
+
function stripProjectContext(prompt) {
|
|
411
|
+
const xmlStartIndex = prompt.indexOf(PROJECT_CONTEXT_XML_HEADER);
|
|
412
|
+
if (xmlStartIndex !== -1) {
|
|
413
|
+
const closingTag = "</project_context>";
|
|
414
|
+
const closingIndex = prompt.indexOf(closingTag, xmlStartIndex + PROJECT_CONTEXT_XML_HEADER.length);
|
|
415
|
+
if (closingIndex !== -1) {
|
|
416
|
+
return `${prompt.slice(0, xmlStartIndex)}${prompt.slice(closingIndex + closingTag.length)}`;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
const legacyStartIndex = prompt.indexOf(PROJECT_CONTEXT_LEGACY_HEADER);
|
|
420
|
+
if (legacyStartIndex === -1) return prompt;
|
|
421
|
+
const endIndex = findSectionEnd(prompt, legacyStartIndex + PROJECT_CONTEXT_LEGACY_HEADER.length, [SKILLS_HEADER, DATE_HEADER]);
|
|
422
|
+
return `${prompt.slice(0, legacyStartIndex)}${prompt.slice(endIndex)}`;
|
|
423
|
+
}
|
|
424
|
+
var GLOBAL_CONTEXT_FILE_NAMES = /* @__PURE__ */ new Set(["agents.md", "agents.override.md", "claude.md"]);
|
|
425
|
+
function canonicalDirectory(dir) {
|
|
426
|
+
try {
|
|
427
|
+
return fs.realpathSync(dir);
|
|
428
|
+
} catch {
|
|
429
|
+
return path.resolve(dir);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
function expandContextPath(filePath) {
|
|
433
|
+
const home = process.env.HOME ?? process.env.USERPROFILE;
|
|
434
|
+
return filePath === "~" ? home ?? filePath : /^~[\\/]/.test(filePath) ? path.join(home ?? "~", filePath.slice(2)) : filePath;
|
|
435
|
+
}
|
|
436
|
+
function isContextFilePath(filePath) {
|
|
437
|
+
return GLOBAL_CONTEXT_FILE_NAMES.has(path.basename(expandContextPath(filePath)).toLowerCase());
|
|
438
|
+
}
|
|
439
|
+
function isGlobalContextFile(filePath) {
|
|
440
|
+
const expanded = expandContextPath(filePath);
|
|
441
|
+
if (!isContextFilePath(filePath)) return false;
|
|
442
|
+
return canonicalDirectory(path.dirname(expanded)) === canonicalDirectory(getAgentDir());
|
|
443
|
+
}
|
|
444
|
+
function stripGlobalInstructionsFromXmlContext(context) {
|
|
445
|
+
const block = /<project_instructions\s+path=(["'])(.*?)\1\s*>[\s\S]*?<\/project_instructions>\s*/gi;
|
|
446
|
+
return context.replace(block, (match, _quote, filePath) => isGlobalContextFile(filePath) ? "" : match);
|
|
447
|
+
}
|
|
448
|
+
function stripGlobalInstructionsFromLegacyContext(context) {
|
|
449
|
+
const sections = [...context.matchAll(/^## ([^\r\n]+)(?:\r?\n|$)/gm)].filter((match) => isContextFilePath(match[1].trim()));
|
|
450
|
+
let rewritten = "";
|
|
451
|
+
let cursor = 0;
|
|
452
|
+
for (let index = 0; index < sections.length; index++) {
|
|
453
|
+
const section = sections[index];
|
|
454
|
+
const start = section.index;
|
|
455
|
+
const end = sections[index + 1]?.index ?? context.length;
|
|
456
|
+
rewritten += context.slice(cursor, start);
|
|
457
|
+
if (!isGlobalContextFile(section[1].trim())) rewritten += context.slice(start, end);
|
|
458
|
+
cursor = end;
|
|
459
|
+
}
|
|
460
|
+
return `${rewritten}${context.slice(cursor)}`;
|
|
461
|
+
}
|
|
462
|
+
function stripGlobalContext(prompt) {
|
|
463
|
+
const rewrittenXml = prompt.replace(/<project_context>[\s\S]*?<\/project_context>/gi, (context) => {
|
|
464
|
+
const rewritten = stripGlobalInstructionsFromXmlContext(context);
|
|
465
|
+
return /<project_instructions\b/i.test(rewritten) ? rewritten : "";
|
|
466
|
+
});
|
|
467
|
+
const legacyStartIndex = rewrittenXml.indexOf(PROJECT_CONTEXT_LEGACY_HEADER);
|
|
468
|
+
if (legacyStartIndex === -1) return rewrittenXml;
|
|
469
|
+
const legacyEndIndex = findSectionEnd(rewrittenXml, legacyStartIndex + PROJECT_CONTEXT_LEGACY_HEADER.length, [SKILLS_HEADER, DATE_HEADER]);
|
|
470
|
+
const legacyContext = rewrittenXml.slice(legacyStartIndex, legacyEndIndex);
|
|
471
|
+
return `${rewrittenXml.slice(0, legacyStartIndex)}${stripGlobalInstructionsFromLegacyContext(legacyContext)}${rewrittenXml.slice(legacyEndIndex)}`;
|
|
472
|
+
}
|
|
473
|
+
function stripInheritedSkills(prompt) {
|
|
474
|
+
const startIndex = prompt.indexOf(SKILLS_HEADER);
|
|
475
|
+
if (startIndex === -1) return prompt;
|
|
476
|
+
const endIndex = findSectionEnd(prompt, startIndex + SKILLS_HEADER.length, [DATE_HEADER]);
|
|
477
|
+
return `${prompt.slice(0, startIndex)}${prompt.slice(endIndex)}`;
|
|
478
|
+
}
|
|
479
|
+
function stripSubagentOrchestrationSkill(prompt) {
|
|
480
|
+
return prompt.replace(/\n{0,2}<skill\s+name=["']pi-subagents["'][^>]*>[\s\S]*?<\/skill>\n{0,2}/g, "\n\n").replace(/[ \t]*<skill>\s*[\s\S]*?<\/skill>\s*/g, (block) => SUBAGENT_ORCHESTRATION_SKILL_NAME_PATTERN.test(block) ? "" : block);
|
|
481
|
+
}
|
|
482
|
+
function stripChildBoundaryInstructions(prompt) {
|
|
483
|
+
let rewritten = prompt;
|
|
484
|
+
for (const instructions of [CHILD_SUBAGENT_BOUNDARY_INSTRUCTIONS, CHILD_FANOUT_BOUNDARY_INSTRUCTIONS, STRUCTURED_OUTPUT_INSTRUCTIONS]) {
|
|
485
|
+
rewritten = rewritten.split(`
|
|
486
|
+
|
|
487
|
+
${instructions}`).join("").split(instructions).join("");
|
|
488
|
+
}
|
|
489
|
+
return rewritten.replace(/^(?:[ \t]*\r?\n)+/, "");
|
|
490
|
+
}
|
|
491
|
+
function stripInheritedPromptText(prompt, options) {
|
|
492
|
+
let rewritten = prompt;
|
|
493
|
+
if (!options.inheritProjectContext) {
|
|
494
|
+
rewritten = stripProjectContext(rewritten);
|
|
495
|
+
}
|
|
496
|
+
if (!options.inheritGlobalContext) {
|
|
497
|
+
rewritten = stripGlobalContext(rewritten);
|
|
498
|
+
}
|
|
499
|
+
if (!options.inheritSkills) {
|
|
500
|
+
rewritten = stripInheritedSkills(rewritten);
|
|
501
|
+
}
|
|
502
|
+
return stripChildBoundaryInstructions(stripSubagentOrchestrationSkill(rewritten));
|
|
503
|
+
}
|
|
504
|
+
function childBoundary(options) {
|
|
505
|
+
const boundary = options.fanoutChild ? CHILD_FANOUT_BOUNDARY_INSTRUCTIONS : CHILD_SUBAGENT_BOUNDARY_INSTRUCTIONS;
|
|
506
|
+
return options.structuredOutput ? `${boundary}
|
|
507
|
+
|
|
508
|
+
${STRUCTURED_OUTPUT_INSTRUCTIONS}` : boundary;
|
|
509
|
+
}
|
|
510
|
+
function appendChildBoundary(prompt, options) {
|
|
511
|
+
return `${stripChildBoundaryInstructions(prompt)}
|
|
512
|
+
|
|
513
|
+
${childBoundary(options)}`;
|
|
514
|
+
}
|
|
515
|
+
function rewriteSubagentPrompt(prompt, options) {
|
|
516
|
+
return appendChildBoundary(stripInheritedPromptText(prompt, options), options);
|
|
517
|
+
}
|
|
518
|
+
function filterChildPromptOptions(options, inherited) {
|
|
519
|
+
if (!inherited.inheritProjectContext) options.contextFiles = [];
|
|
520
|
+
else if (!inherited.inheritGlobalContext) options.contextFiles = options.contextFiles.filter((file) => !isGlobalContextFile(file.path));
|
|
521
|
+
options.skills = inherited.inheritSkills ? options.skills.filter((skill) => skill.name !== "pi-subagents") : [];
|
|
522
|
+
if (options.customPrompt) options.customPrompt = stripInheritedPromptText(options.customPrompt, inherited);
|
|
523
|
+
if (options.appendSystemPrompt) options.appendSystemPrompt = stripInheritedPromptText(options.appendSystemPrompt, inherited);
|
|
524
|
+
}
|
|
525
|
+
function rewritesChildPrompt(config) {
|
|
526
|
+
return config.inheritProjectContext !== void 0 || config.inheritGlobalContext !== void 0 || config.inheritSkills !== void 0 || Boolean(config.fanoutChild);
|
|
527
|
+
}
|
|
528
|
+
function registerSubagentPromptBoundary(pi, config) {
|
|
529
|
+
if (!rewritesChildPrompt(config)) return;
|
|
530
|
+
if (config.forkCacheKey) return;
|
|
531
|
+
pi.on("before_agent_start", (event) => {
|
|
532
|
+
const finalized = appendChildBoundary(event.systemPrompt, { fanoutChild: config.fanoutChild, structuredOutput: Boolean(config.structuredOutput) });
|
|
533
|
+
return finalized === event.systemPrompt ? void 0 : { systemPrompt: finalized };
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
function isParentOnlySubagentMessage(message) {
|
|
537
|
+
const m = message;
|
|
538
|
+
if (m?.role !== "custom" || typeof m.customType !== "string") return false;
|
|
539
|
+
if (m.customType === SUBAGENT_WATCHDOG_WARNING_TYPE) return true;
|
|
540
|
+
return PARENT_ONLY_CUSTOM_MESSAGE_TYPES.has(m.customType);
|
|
541
|
+
}
|
|
542
|
+
function isSubagentToolResultMessage(message) {
|
|
543
|
+
const m = message;
|
|
544
|
+
return m?.role === "toolResult" && m.toolName === "subagent";
|
|
545
|
+
}
|
|
546
|
+
function isSubagentToolCallBlock(block) {
|
|
547
|
+
const b = block;
|
|
548
|
+
return b?.type === "toolCall" && b.name === "subagent";
|
|
549
|
+
}
|
|
550
|
+
var PORTABLE_TOOL_ID_PATTERN = /^[a-zA-Z0-9_-]+$/;
|
|
551
|
+
var MAX_PORTABLE_TOOL_ID_LENGTH = 64;
|
|
552
|
+
var COMPOSITE_TOOL_ID_APIS = /* @__PURE__ */ new Set([
|
|
553
|
+
"azure-openai-responses",
|
|
554
|
+
"cursor-native",
|
|
555
|
+
"openai-completions",
|
|
556
|
+
"openai-responses"
|
|
557
|
+
]);
|
|
558
|
+
var PROMPT_CACHE_KEY_APIS = /* @__PURE__ */ new Set([
|
|
559
|
+
"azure-openai-responses",
|
|
560
|
+
"openai-codex-responses",
|
|
561
|
+
"openai-completions",
|
|
562
|
+
"openai-responses"
|
|
563
|
+
]);
|
|
564
|
+
var isSystemMessage = (message) => message.role === "system";
|
|
565
|
+
var writtenBefore = (message, forkedAt) => typeof message.timestamp === "number" && message.timestamp < forkedAt;
|
|
566
|
+
var promptText = (message) => typeof message?.content === "string" ? message.content : (message?.content ?? []).map((block) => block.text).join("");
|
|
567
|
+
function systemMessagesBefore(messages, forkedAt) {
|
|
568
|
+
return messages.filter((message) => isSystemMessage(message) && writtenBefore(message, forkedAt));
|
|
569
|
+
}
|
|
570
|
+
function modelBefore(messages, forkedAt) {
|
|
571
|
+
for (let index = messages.length - 1; index >= 0; index--) {
|
|
572
|
+
const message = messages[index];
|
|
573
|
+
if (message.role !== "assistant" || !writtenBefore(message, forkedAt)) continue;
|
|
574
|
+
if (typeof message.provider !== "string" || typeof message.api !== "string" || typeof message.model !== "string") return void 0;
|
|
575
|
+
return { provider: message.provider, api: message.api, model: message.model };
|
|
576
|
+
}
|
|
577
|
+
return void 0;
|
|
578
|
+
}
|
|
579
|
+
var LOADOUT_SECTIONS = /* @__PURE__ */ new Set(["tools", "rules", "docs", "skills", "advertised_subagents", "mcp_servers", "project_context"]);
|
|
580
|
+
function forkInstructions(input) {
|
|
581
|
+
const parent = getCurrentSystemMessage(input.parent);
|
|
582
|
+
const child = getCurrentSystemMessage(input.child);
|
|
583
|
+
const parts = [
|
|
584
|
+
"The system prompt and tool list of this conversation are the parent session's, sent unchanged so this request reuses the parent's prompt cache. The instructions below are yours and take precedence over the parent's role.",
|
|
585
|
+
`Tools you can call: ${getCurrentTools(input.child).map((tool) => tool.name).join(", ") || "none"}. Any other declared tool belongs to the parent session and fails if called.`
|
|
586
|
+
];
|
|
587
|
+
const ownPrompt = promptText(getCurrentSystemMessage(input.own));
|
|
588
|
+
if (ownPrompt.length > 0) parts.push(ownPrompt);
|
|
589
|
+
for (const [name, value] of Object.entries(child?.sections ?? {})) {
|
|
590
|
+
if (!LOADOUT_SECTIONS.has(name) && value && parent?.sections?.[name] !== value) parts.push(value);
|
|
591
|
+
}
|
|
592
|
+
if (input.boundary) parts.push(input.boundary);
|
|
593
|
+
return `<subagent_instructions>
|
|
594
|
+
${parts.join("\n\n")}
|
|
595
|
+
</subagent_instructions>`;
|
|
596
|
+
}
|
|
597
|
+
function prependText(message, text) {
|
|
598
|
+
const content = message.content;
|
|
599
|
+
if (typeof content === "string") return { ...message, content: `${text}
|
|
600
|
+
|
|
601
|
+
${content}` };
|
|
602
|
+
if (Array.isArray(content)) return { ...message, content: [{ type: "text", text }, ...content] };
|
|
603
|
+
return message;
|
|
604
|
+
}
|
|
605
|
+
function projectForkRequest(messages, inherited, forkedAt, options = {}) {
|
|
606
|
+
const own = (message) => !writtenBefore(message, forkedAt);
|
|
607
|
+
if (inherited.length === 0 || !messages.some((message) => !isSystemMessage(message) && !own(message))) {
|
|
608
|
+
if (!options.boundary) return messages;
|
|
609
|
+
const at2 = messages.findIndex((message) => !isSystemMessage(message));
|
|
610
|
+
const section = { role: "system", content: "", sections: { subagent_boundary: `<subagent_boundary>
|
|
611
|
+
${options.boundary}
|
|
612
|
+
</subagent_boundary>` }, timestamp: forkedAt };
|
|
613
|
+
return at2 === -1 ? [...messages, section] : [...messages.slice(0, at2), section, ...messages.slice(at2)];
|
|
614
|
+
}
|
|
615
|
+
const instructions = forkInstructions({ parent: inherited, child: messages, own: messages.filter((message) => isSystemMessage(message) && own(message)), boundary: options.boundary });
|
|
616
|
+
const parentTools = new Map(getCurrentTools(inherited).map((tool) => [tool.name, tool]));
|
|
617
|
+
const childTools = getCurrentTools(messages).filter((tool) => {
|
|
618
|
+
const parentTool = parentTools.get(tool.name);
|
|
619
|
+
return !parentTool || !declarationsEqual(parentTool, tool);
|
|
620
|
+
});
|
|
621
|
+
const redefined = childTools.filter((tool) => parentTools.has(tool.name)).map((tool) => ({ name: tool.name }));
|
|
622
|
+
const sentInherited = messages.filter((message) => isSystemMessage(message) && !own(message));
|
|
623
|
+
const uncollapsed = sentInherited.length === inherited.length && sentInherited.every((message, index) => JSON.stringify(message) === JSON.stringify(inherited[index]));
|
|
624
|
+
const conversation = messages.filter((message) => !isSystemMessage(message));
|
|
625
|
+
const head = getCurrentSystemMessage(inherited);
|
|
626
|
+
const next = uncollapsed ? messages.filter((message) => !isSystemMessage(message) || !own(message)) : [...head ? [head] : [], ...conversation];
|
|
627
|
+
const firstOwn = next.findIndex((message) => !isSystemMessage(message) && own(message));
|
|
628
|
+
const task = next.findIndex((message) => message.role === "user" && own(message));
|
|
629
|
+
const additions = [];
|
|
630
|
+
if (childTools.length > 0) additions.push({ role: "system", content: "", ...redefined.length > 0 ? { toolsRemoved: redefined } : {}, toolsAdded: childTools, timestamp: forkedAt });
|
|
631
|
+
if (task === -1) additions.push({ role: "system", content: "", sections: { subagent_instructions: instructions }, timestamp: forkedAt });
|
|
632
|
+
else next[task] = prependText(next[task], instructions);
|
|
633
|
+
const at = firstOwn === -1 ? next.length : firstOwn;
|
|
634
|
+
return [...next.slice(0, at), ...additions, ...next.slice(at)];
|
|
635
|
+
}
|
|
636
|
+
function applyForkSessionAffinity(headers, model, parentSessionId, parentModel) {
|
|
637
|
+
const parent = parentSessionId?.trim();
|
|
638
|
+
if (!headers || !parent || model?.api !== "anthropic-messages") return;
|
|
639
|
+
if (!parentModel || parentModel.provider !== model.provider || parentModel.api !== model.api || parentModel.model !== model.id) return;
|
|
640
|
+
const compat = model.compat;
|
|
641
|
+
if (!compat?.sendSessionAffinityHeaders) return;
|
|
642
|
+
headers[compat.sessionAffinityFormat === "openrouter" ? "x-session-id" : "x-session-affinity"] = parent;
|
|
643
|
+
}
|
|
644
|
+
function rewriteForkCacheProviderRequest(event, ctx, forkCacheKey) {
|
|
645
|
+
const key = forkCacheKey?.trim();
|
|
646
|
+
if (!key || !PROMPT_CACHE_KEY_APIS.has(ctx?.model?.api ?? "")) return void 0;
|
|
647
|
+
if (!event || typeof event !== "object") return void 0;
|
|
648
|
+
const payload = event.payload;
|
|
649
|
+
if (!payload || typeof payload !== "object" || Array.isArray(payload)) return void 0;
|
|
650
|
+
if (typeof payload.prompt_cache_key !== "string") return void 0;
|
|
651
|
+
return { ...payload, prompt_cache_key: key };
|
|
652
|
+
}
|
|
653
|
+
function portableToolId(id, preserveBoundedCompositeToolIds = false) {
|
|
654
|
+
if (PORTABLE_TOOL_ID_PATTERN.test(id) && id.length <= MAX_PORTABLE_TOOL_ID_LENGTH) return id;
|
|
655
|
+
if (preserveBoundedCompositeToolIds) {
|
|
656
|
+
const parts = id.split("|");
|
|
657
|
+
if (parts.length === 2 && parts.every((part) => PORTABLE_TOOL_ID_PATTERN.test(part) && part.length <= MAX_PORTABLE_TOOL_ID_LENGTH)) return id;
|
|
658
|
+
}
|
|
659
|
+
const encoded = `tool_${Buffer.from(id).toString("base64url") || "empty"}`;
|
|
660
|
+
if (encoded.length <= MAX_PORTABLE_TOOL_ID_LENGTH) return encoded;
|
|
661
|
+
return `tool_${createHash("sha256").update(id).digest("base64url")}`;
|
|
662
|
+
}
|
|
663
|
+
function sanitizeToolHistoryMessage(message, preserveBoundedCompositeToolIds = false) {
|
|
664
|
+
const m = message;
|
|
665
|
+
if (m?.role === "toolResult" && typeof m.toolCallId === "string") {
|
|
666
|
+
const toolCallId = portableToolId(m.toolCallId, preserveBoundedCompositeToolIds);
|
|
667
|
+
return toolCallId === m.toolCallId ? message : { ...m, toolCallId };
|
|
668
|
+
}
|
|
669
|
+
if (m?.role !== "assistant" || !Array.isArray(m.content)) return message;
|
|
670
|
+
let changed = false;
|
|
671
|
+
const content = m.content.map((block) => {
|
|
672
|
+
const b = block;
|
|
673
|
+
if (b?.type !== "toolCall" || typeof b.id !== "string") return block;
|
|
674
|
+
const id = portableToolId(b.id, preserveBoundedCompositeToolIds);
|
|
675
|
+
if (id === b.id) return block;
|
|
676
|
+
changed = true;
|
|
677
|
+
return { ...b, id };
|
|
678
|
+
});
|
|
679
|
+
return changed ? { ...m, content } : message;
|
|
680
|
+
}
|
|
681
|
+
function stripAssistantSubagentToolCallBlocks(message) {
|
|
682
|
+
const m = message;
|
|
683
|
+
if (m?.role !== "assistant" || !Array.isArray(m.content)) return message;
|
|
684
|
+
const filteredContent = m.content.filter((block) => !isSubagentToolCallBlock(block));
|
|
685
|
+
if (filteredContent.length === m.content.length) return message;
|
|
686
|
+
if (filteredContent.length === 0) return void 0;
|
|
687
|
+
return { ...m, content: filteredContent };
|
|
688
|
+
}
|
|
689
|
+
function stripParentOnlySubagentMessages(messages, options = {}) {
|
|
690
|
+
const preserveCurrentFanoutToolHistory = options.preserveFanoutToolHistory === true;
|
|
691
|
+
const sanitizeToolIds = options.sanitizeToolIds ?? true;
|
|
692
|
+
const inheritedBefore = options.inheritedBefore;
|
|
693
|
+
const inherited = (message) => inheritedBefore !== void 0 && typeof message?.timestamp === "number" && message.timestamp < inheritedBefore;
|
|
694
|
+
let changed = false;
|
|
695
|
+
const filtered = [];
|
|
696
|
+
for (const message of messages) {
|
|
697
|
+
const keep = inherited(message);
|
|
698
|
+
if (!keep && (isParentOnlySubagentMessage(message) || !preserveCurrentFanoutToolHistory && isSubagentToolResultMessage(message))) {
|
|
699
|
+
changed = true;
|
|
700
|
+
continue;
|
|
701
|
+
}
|
|
702
|
+
const stripped = keep || preserveCurrentFanoutToolHistory ? message : stripAssistantSubagentToolCallBlocks(message);
|
|
703
|
+
if (stripped === void 0) {
|
|
704
|
+
changed = true;
|
|
705
|
+
continue;
|
|
706
|
+
}
|
|
707
|
+
const sanitized = sanitizeToolIds ? sanitizeToolHistoryMessage(stripped, options.preserveBoundedCompositeToolIds === true) : stripped;
|
|
708
|
+
if (stripped !== message || sanitized !== stripped) changed = true;
|
|
709
|
+
filtered.push(sanitized);
|
|
710
|
+
}
|
|
711
|
+
return changed ? filtered : messages;
|
|
712
|
+
}
|
|
713
|
+
function registerPermissionGate(pi, permissions, childWatchdog, requestPermission = requestWatchdogPermission) {
|
|
714
|
+
const rules = permissions?.rules;
|
|
715
|
+
if (!rules || Object.keys(rules).length === 0) return;
|
|
716
|
+
const rawWatchdogConfig = childWatchdog ? JSON.stringify(childWatchdog) : void 0;
|
|
717
|
+
const timeoutMs = childWatchdog?.agentEndTimeoutMs ?? 3e4;
|
|
718
|
+
const onRuntimeEvent = pi.on;
|
|
719
|
+
onRuntimeEvent("tool_call", async (event, ctx) => {
|
|
720
|
+
const toolName = typeof event.toolName === "string" ? event.toolName : "tool";
|
|
721
|
+
const decision = permissionDecision(rules, toolName);
|
|
722
|
+
if (decision === "allow") return void 0;
|
|
723
|
+
if (decision === "deny") return { block: true, reason: `Blocked by pi-subagents permission rule: '${toolName}' is denied.` };
|
|
724
|
+
if (ctx.signal?.aborted) return { block: true, reason: "Blocked by pi-subagents permission rule: Watchdog permission decision was cancelled." };
|
|
725
|
+
let timeout;
|
|
726
|
+
let abort;
|
|
727
|
+
let result;
|
|
728
|
+
try {
|
|
729
|
+
result = await Promise.race([
|
|
730
|
+
requestPermission({
|
|
731
|
+
ctx,
|
|
732
|
+
toolName,
|
|
733
|
+
args: event.input ?? {},
|
|
734
|
+
rawWatchdogConfig,
|
|
735
|
+
auditPath: permissions.auditPath,
|
|
736
|
+
...ctx.signal ? { signal: ctx.signal } : {}
|
|
737
|
+
}),
|
|
738
|
+
new Promise((resolve2) => {
|
|
739
|
+
if (!ctx.signal) return;
|
|
740
|
+
abort = () => resolve2({ approved: false, reason: "Watchdog permission decision was cancelled.", source: "watchdog" });
|
|
741
|
+
ctx.signal.addEventListener("abort", abort, { once: true });
|
|
742
|
+
}),
|
|
743
|
+
new Promise((_, reject) => {
|
|
744
|
+
timeout = setTimeout(() => reject(new Error(`Watchdog permission decision timed out after ${timeoutMs}ms.`)), timeoutMs);
|
|
745
|
+
})
|
|
746
|
+
]);
|
|
747
|
+
} catch (error) {
|
|
748
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
749
|
+
return { block: true, reason: `Blocked by pi-subagents permission rule: Watchdog permission arbiter failed closed: ${reason}` };
|
|
750
|
+
} finally {
|
|
751
|
+
if (timeout) clearTimeout(timeout);
|
|
752
|
+
if (abort) ctx.signal?.removeEventListener("abort", abort);
|
|
753
|
+
}
|
|
754
|
+
if (result.approved) return void 0;
|
|
755
|
+
return { block: true, reason: `Blocked by pi-subagents permission rule: ${result.reason}` };
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
function registerToolBudget(pi, budget) {
|
|
759
|
+
if (!budget) return;
|
|
760
|
+
let toolCount = 0;
|
|
761
|
+
let softNudged = false;
|
|
762
|
+
const sendUserMessage = pi.sendUserMessage;
|
|
763
|
+
const onRuntimeEvent = pi.on;
|
|
764
|
+
onRuntimeEvent("tool_call", (event) => {
|
|
765
|
+
const toolName = typeof event.toolName === "string" ? event.toolName : "tool";
|
|
766
|
+
toolCount++;
|
|
767
|
+
if (budget.soft !== void 0 && toolCount >= budget.soft && !softNudged) {
|
|
768
|
+
softNudged = true;
|
|
769
|
+
try {
|
|
770
|
+
sendUserMessage?.(toolBudgetSoftNudge(budget, toolCount), { deliverAs: "steer" });
|
|
771
|
+
} catch {
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
if (!shouldBlockToolForBudget(budget, toolName, toolCount)) return void 0;
|
|
775
|
+
return { block: true, reason: toolBudgetBlockedMessage(budget, toolName, toolCount) };
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
function registerStructuredOutputTool(pi, structured) {
|
|
779
|
+
const terminalState = structured.terminalState ??= { captured: false };
|
|
780
|
+
const required = structured.acceptanceReport === "required";
|
|
781
|
+
const parameters = createStructuredOutputToolParameters(structured.schema, { acceptanceReport: structured.acceptanceReport });
|
|
782
|
+
const registerTool = pi.registerTool;
|
|
783
|
+
registerTool({
|
|
784
|
+
name: "structured_output",
|
|
785
|
+
...MODEL_ONLY_TOOL,
|
|
786
|
+
label: "Structured Output",
|
|
787
|
+
description: "Submit the required final structured output for this subagent step. This terminates the step.",
|
|
788
|
+
parameters,
|
|
789
|
+
async execute(_id, params) {
|
|
790
|
+
const validation = await validateStructuredOutputValue(structured.schema, params.value);
|
|
791
|
+
if (validation.status === "invalid") {
|
|
792
|
+
throw new Error(`Structured output validation failed: ${validation.message}`);
|
|
793
|
+
}
|
|
794
|
+
if (required && params.acceptanceReport === void 0) {
|
|
795
|
+
throw new Error(MISSING_STRUCTURED_ACCEPTANCE_REPORT_ERROR);
|
|
796
|
+
}
|
|
797
|
+
if (required && params.acceptanceReport !== void 0) {
|
|
798
|
+
const acceptanceValidation = validateAcceptanceReport(params.acceptanceReport, "acceptanceReport");
|
|
799
|
+
if (!acceptanceValidation.report) {
|
|
800
|
+
throw new Error(`Invalid structured output acceptance report: ${acceptanceValidation.errors.join("; ")}`);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
structured.capture(params.value, structured.acceptanceReport ? params.acceptanceReport : void 0);
|
|
804
|
+
terminalState.captured = true;
|
|
805
|
+
return {
|
|
806
|
+
content: [{ type: "text", text: "Structured output captured." }],
|
|
807
|
+
details: {},
|
|
808
|
+
terminate: true
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
function registerSubagentPromptRuntime(pi, config, drainObservation) {
|
|
814
|
+
if (!config) return;
|
|
815
|
+
registerRuntimeExtensionAcknowledgements(pi, config.runtimeAcknowledgements);
|
|
816
|
+
registerPermissionGate(pi, config.permissions, config.childWatchdog);
|
|
817
|
+
registerToolBudget(pi, config.toolBudget);
|
|
818
|
+
if (config.structuredOutput && !config.structuredOutput.terminalState) config.structuredOutput.terminalState = { captured: false };
|
|
819
|
+
registerChildWatchdog(pi, config.childWatchdog, config.watchdogStatus, config.structuredOutput?.terminalState);
|
|
820
|
+
const requestedWatchdogDiff = config.requiredTools?.includes(WATCHDOG_DIFF_TOOL_NAME);
|
|
821
|
+
const reviewerLaunchBaseline = requestedWatchdogDiff && config.cwd ? captureWatchdogDiffBaseline(config.cwd) : void 0;
|
|
822
|
+
if (requestedWatchdogDiff && typeof pi.registerTool === "function") {
|
|
823
|
+
pi.registerTool(createWatchdogDiffTool(reviewerLaunchBaseline, { workingTreeAtLaunch: true }));
|
|
824
|
+
}
|
|
825
|
+
const waitState = config.runtimeState ?? {
|
|
826
|
+
baseCwd: "",
|
|
827
|
+
currentSessionId: null,
|
|
828
|
+
asyncJobs: /* @__PURE__ */ new Map(),
|
|
829
|
+
foregroundRuns: /* @__PURE__ */ new Map(),
|
|
830
|
+
foregroundControls: /* @__PURE__ */ new Map(),
|
|
831
|
+
lastForegroundControlId: null,
|
|
832
|
+
cleanupTimers: /* @__PURE__ */ new Map(),
|
|
833
|
+
lastUiContext: null,
|
|
834
|
+
poller: null,
|
|
835
|
+
completionSeen: /* @__PURE__ */ new Map(),
|
|
836
|
+
watcher: null,
|
|
837
|
+
watcherRestartTimer: null,
|
|
838
|
+
resultFileCoalescer: { schedule: () => false, clear: () => {
|
|
839
|
+
} }
|
|
840
|
+
};
|
|
841
|
+
const nestedRootRunId = inheritedNestedRouteOf(config)?.rootRunId;
|
|
842
|
+
if (typeof pi.registerTool === "function") registerWaitTool(pi, waitState, config.waitTool.enabled, void 0, config.waitTool.defaultTimeoutMs, { nestedRootRunId }, () => config.hasPendingSupervisorRequest?.() === true);
|
|
843
|
+
const supervisorMetadata = childSupervisorMetadata(config);
|
|
844
|
+
let nativeSupervisorClientRegistered = false;
|
|
845
|
+
const registerNativeSupervisorClientOnce = () => {
|
|
846
|
+
if (nativeSupervisorClientRegistered) return;
|
|
847
|
+
nativeSupervisorClientRegistered = true;
|
|
848
|
+
registerNativeSupervisorClient(pi, supervisorMetadata);
|
|
849
|
+
};
|
|
850
|
+
const onRuntimeEvent = pi.on;
|
|
851
|
+
onRuntimeEvent("session_start", (_event, ctx) => {
|
|
852
|
+
const sessionManager = ctx?.sessionManager;
|
|
853
|
+
waitState.currentSessionId = sessionManager ? resolveCurrentSessionId(sessionManager) : null;
|
|
854
|
+
registerNativeSupervisorClientOnce();
|
|
855
|
+
});
|
|
856
|
+
onRuntimeEvent("agent_start", () => {
|
|
857
|
+
if (!config.requiredTools) return;
|
|
858
|
+
const diagnostic = evaluateChildToolDiagnostic(config, pi.getAllTools().map((tool) => tool.name));
|
|
859
|
+
config.toolDiagnostic?.(diagnostic);
|
|
860
|
+
if (diagnostic) throw new Error(formatChildToolDiagnostic(diagnostic));
|
|
861
|
+
});
|
|
862
|
+
onRuntimeEvent("agent_end", async (_event, ctx) => {
|
|
863
|
+
if (ctx?.hasUI === true) drainObservation?.deny();
|
|
864
|
+
if (drainObservation) {
|
|
865
|
+
try {
|
|
866
|
+
if (ctx?.sessionManager?.getSessionFile() !== waitState.currentSessionId) drainObservation.deny();
|
|
867
|
+
} catch {
|
|
868
|
+
drainObservation.deny();
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
config.holdFinalDrain?.(true);
|
|
872
|
+
try {
|
|
873
|
+
await drainOutstandingWork({ state: waitState, events: pi.events, nestedRootRunId, hasPendingSupervisorRequest: config.hasPendingSupervisorRequest }, drainObservation);
|
|
874
|
+
} finally {
|
|
875
|
+
config.holdFinalDrain?.(false);
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
if (config.structuredOutput) registerStructuredOutputTool(pi, config.structuredOutput);
|
|
879
|
+
onRuntimeEvent("before_provider_request", (event, ctx) => rewriteForkCacheProviderRequest(event, ctx, config.forkCacheKey));
|
|
880
|
+
let inherited;
|
|
881
|
+
const readInherited = (ctx) => {
|
|
882
|
+
const header = ctx?.sessionManager?.getHeader();
|
|
883
|
+
if (!header) return void 0;
|
|
884
|
+
if (inherited?.session !== header.id) {
|
|
885
|
+
const forkedAt = Date.parse(header.timestamp);
|
|
886
|
+
const messages = Number.isFinite(forkedAt) ? ctx.sessionManager.buildSessionProjection().messages : [];
|
|
887
|
+
inherited = { session: header.id, forkedAt, system: systemMessagesBefore(messages, forkedAt), model: modelBefore(messages, forkedAt) };
|
|
888
|
+
}
|
|
889
|
+
return Number.isFinite(inherited.forkedAt) ? inherited : void 0;
|
|
890
|
+
};
|
|
891
|
+
const boundary = rewritesChildPrompt(config) ? childBoundary({ fanoutChild: config.fanoutChild, structuredOutput: Boolean(config.structuredOutput) }) : void 0;
|
|
892
|
+
if (config.forkCacheKey) onRuntimeEvent("before_provider_headers", (event, ctx) => {
|
|
893
|
+
applyForkSessionAffinity(event?.headers, ctx?.model, config.parentSessionId, readInherited(ctx)?.model);
|
|
894
|
+
});
|
|
895
|
+
if (config.forkCacheKey) onRuntimeEvent("context_with_system", (event, ctx) => {
|
|
896
|
+
if (!event || typeof event !== "object" || !("messages" in event) || !Array.isArray(event.messages)) return void 0;
|
|
897
|
+
const fork = readInherited(ctx);
|
|
898
|
+
if (!fork) return void 0;
|
|
899
|
+
const messages = projectForkRequest(event.messages, fork.system, fork.forkedAt, { boundary });
|
|
900
|
+
return messages === event.messages ? void 0 : { messages };
|
|
901
|
+
});
|
|
902
|
+
onRuntimeEvent("context", (event, ctx) => {
|
|
903
|
+
if (!event || typeof event !== "object" || !("messages" in event) || !Array.isArray(event.messages)) return void 0;
|
|
904
|
+
const forkedAt = config.forkCacheKey ? Date.parse(ctx?.sessionManager?.getHeader()?.timestamp ?? "") : Number.NaN;
|
|
905
|
+
const messages = stripParentOnlySubagentMessages(event.messages, {
|
|
906
|
+
sanitizeToolIds: !COMPOSITE_TOOL_ID_APIS.has(ctx?.model?.api ?? ""),
|
|
907
|
+
// Providers that reuse the Codex Responses wire under their own api id (e.g. cliproxyapi-codex-responses) split call_id|item_id the same way.
|
|
908
|
+
preserveBoundedCompositeToolIds: ctx?.model?.api?.endsWith("-codex-responses") === true,
|
|
909
|
+
preserveFanoutToolHistory: config.fanoutChild,
|
|
910
|
+
...Number.isFinite(forkedAt) ? { inheritedBefore: forkedAt } : {}
|
|
911
|
+
});
|
|
912
|
+
if (messages === event.messages) return void 0;
|
|
913
|
+
return { messages };
|
|
914
|
+
});
|
|
915
|
+
const routingName = config.intercomSessionName;
|
|
916
|
+
let intercomIdClaimed = false;
|
|
917
|
+
if (routingName) {
|
|
918
|
+
pi.events.on(INTERCOM_SESSION_IDENTITY_EVENT, (request) => {
|
|
919
|
+
if (!request || typeof request !== "object" || !("version" in request) || request.version !== 1 || !("claim" in request) || typeof request.claim !== "function") return;
|
|
920
|
+
request.claim(routingName);
|
|
921
|
+
intercomIdClaimed = true;
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
onRuntimeEvent("before_agent_start", async (event) => {
|
|
925
|
+
if (!event || typeof event !== "object" || !("systemPrompt" in event) || typeof event.systemPrompt !== "string") return void 0;
|
|
926
|
+
registerNativeSupervisorClientOnce();
|
|
927
|
+
const childSessionName = intercomIdClaimed ? config.sessionName || routingName : routingName || config.sessionName;
|
|
928
|
+
if (childSessionName && typeof pi.setSessionName === "function") {
|
|
929
|
+
pi.setSessionName(childSessionName);
|
|
930
|
+
}
|
|
931
|
+
if (!rewritesChildPrompt(config)) return;
|
|
932
|
+
filterChildPromptOptions(event.systemPromptOptions, {
|
|
933
|
+
inheritProjectContext: config.inheritProjectContext ?? true,
|
|
934
|
+
inheritGlobalContext: config.inheritGlobalContext ?? true,
|
|
935
|
+
inheritSkills: config.inheritSkills ?? true
|
|
936
|
+
});
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
export {
|
|
941
|
+
projectRuntimeAcknowledgedExtensions,
|
|
942
|
+
formatChildToolDiagnostic,
|
|
943
|
+
rewriteSubagentPrompt,
|
|
944
|
+
registerSubagentPromptBoundary,
|
|
945
|
+
registerSubagentPromptRuntime
|
|
946
|
+
};
|