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,1185 @@
|
|
|
1
|
+
import {
|
|
2
|
+
snapshotRequiredChildExtensions
|
|
3
|
+
} from "./chunk-CTPAE36Y.js";
|
|
4
|
+
import {
|
|
5
|
+
THINKING_LEVELS,
|
|
6
|
+
findConfiguredProjectRoot,
|
|
7
|
+
getAgentDir,
|
|
8
|
+
getConfigDirName,
|
|
9
|
+
getProjectConfigDir
|
|
10
|
+
} from "./chunk-ZBC44JJ3.js";
|
|
11
|
+
import {
|
|
12
|
+
TEMP_ROOT_DIR
|
|
13
|
+
} from "./chunk-5LFLVSTM.js";
|
|
14
|
+
import {
|
|
15
|
+
capabilityCeilingAgentRestrictionSources,
|
|
16
|
+
intersectSubagentCapabilityCeilings,
|
|
17
|
+
isAgentAllowedByCapabilityCeiling
|
|
18
|
+
} from "./chunk-Z7KVHQHL.js";
|
|
19
|
+
|
|
20
|
+
// src/runs/shared/child-tool-plan.ts
|
|
21
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
22
|
+
import * as fs4 from "node:fs";
|
|
23
|
+
import * as path4 from "node:path";
|
|
24
|
+
import { fileURLToPath } from "node:url";
|
|
25
|
+
|
|
26
|
+
// src/runs/shared/mcp-direct-tool-allowlist.ts
|
|
27
|
+
import { createHash } from "node:crypto";
|
|
28
|
+
import * as fs2 from "node:fs";
|
|
29
|
+
import * as os2 from "node:os";
|
|
30
|
+
import * as path2 from "node:path";
|
|
31
|
+
|
|
32
|
+
// src/runs/shared/mcp-config-sources.ts
|
|
33
|
+
import * as fs from "node:fs";
|
|
34
|
+
import * as os from "node:os";
|
|
35
|
+
import * as path from "node:path";
|
|
36
|
+
var PACKAGE_CONFIG_ROOT = "npm";
|
|
37
|
+
var PACKAGE_GIT_ROOT = "git";
|
|
38
|
+
var PLUGIN_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
|
|
39
|
+
var PLUGIN_MCP_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json";
|
|
40
|
+
var PLUGIN_NAME_PATTERN = /^(?!.*(?:--|\.\.))[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/;
|
|
41
|
+
var PLUGIN_STDIO_FIELDS = /* @__PURE__ */ new Set(["type", "command", "args", "env", "cwd"]);
|
|
42
|
+
var PLUGIN_HTTP_FIELDS = /* @__PURE__ */ new Set(["type", "url", "headers"]);
|
|
43
|
+
function isMcpServerDefinition(value) {
|
|
44
|
+
if (!isRecord(value)) return false;
|
|
45
|
+
for (const field of ["command", "socket", "cwd", "url", "bearerToken", "bearerTokenEnv", "protocolVersion", "httpTransport", "pluginDataDir"]) {
|
|
46
|
+
if (value[field] !== void 0 && typeof value[field] !== "string") return false;
|
|
47
|
+
}
|
|
48
|
+
for (const field of ["args", "includeTools", "excludeTools"]) {
|
|
49
|
+
if (value[field] !== void 0 && !isStringArray(value[field])) return false;
|
|
50
|
+
}
|
|
51
|
+
for (const field of ["env", "headers"]) {
|
|
52
|
+
if (value[field] !== void 0 && !isStringRecord(value[field])) return false;
|
|
53
|
+
}
|
|
54
|
+
for (const field of ["exposeResources", "literalEnv", "inheritEnv"]) {
|
|
55
|
+
if (value[field] !== void 0 && typeof value[field] !== "boolean") return false;
|
|
56
|
+
}
|
|
57
|
+
if (value.requestHeadersCommand !== void 0 && !isRequestHeadersCommand(value.requestHeadersCommand)) return false;
|
|
58
|
+
if (value.auth !== void 0 && value.auth !== "oauth" && value.auth !== "bearer" && value.auth !== false) return false;
|
|
59
|
+
return value.directTools === void 0 || typeof value.directTools === "boolean" || isStringArray(value.directTools);
|
|
60
|
+
}
|
|
61
|
+
function isRecord(value) {
|
|
62
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
63
|
+
}
|
|
64
|
+
function isStringArray(value) {
|
|
65
|
+
return Array.isArray(value) && value.every((entry) => typeof entry === "string");
|
|
66
|
+
}
|
|
67
|
+
function isStringRecord(value) {
|
|
68
|
+
return isRecord(value) && Object.values(value).every((entry) => typeof entry === "string");
|
|
69
|
+
}
|
|
70
|
+
function isRequestHeadersCommand(value) {
|
|
71
|
+
if (!isRecord(value) || typeof value.command !== "string") return false;
|
|
72
|
+
if (value.args !== void 0 && !isStringArray(value.args)) return false;
|
|
73
|
+
if (value.env !== void 0 && !isStringRecord(value.env)) return false;
|
|
74
|
+
return value.timeoutMs === void 0 || typeof value.timeoutMs === "number" && Number.isFinite(value.timeoutMs);
|
|
75
|
+
}
|
|
76
|
+
function loadPackageMcpServers(cwd) {
|
|
77
|
+
const servers = {};
|
|
78
|
+
const seen = /* @__PURE__ */ new Set();
|
|
79
|
+
for (const packageRoot of getConfiguredPackageRoots(cwd)) {
|
|
80
|
+
const manifest = readJson(path.join(packageRoot, "package.json"));
|
|
81
|
+
if (!manifest || typeof manifest !== "object" || Array.isArray(manifest)) continue;
|
|
82
|
+
const packageName = manifest.name;
|
|
83
|
+
if (typeof packageName !== "string" || !packageName) continue;
|
|
84
|
+
const mcpValue = manifest.pi?.mcp;
|
|
85
|
+
const configPaths = typeof mcpValue === "string" ? [mcpValue] : Array.isArray(mcpValue) && mcpValue.every((value) => typeof value === "string") ? mcpValue : [];
|
|
86
|
+
const packagePrefix = formatName(packageName, "package");
|
|
87
|
+
for (const configPath of configPaths) {
|
|
88
|
+
const resolvedPath = resolvePackageConfigPath(packageRoot, configPath);
|
|
89
|
+
if (!resolvedPath) continue;
|
|
90
|
+
const config = readJson(resolvedPath);
|
|
91
|
+
if (!config || typeof config !== "object" || Array.isArray(config)) continue;
|
|
92
|
+
const rawServers = config.mcpServers;
|
|
93
|
+
if (!rawServers || typeof rawServers !== "object" || Array.isArray(rawServers)) continue;
|
|
94
|
+
for (const [serverName, definition] of Object.entries(rawServers)) {
|
|
95
|
+
if (!isMcpServerDefinition(definition)) continue;
|
|
96
|
+
const normalizedName = `${packagePrefix}__${formatName(serverName, "server")}`;
|
|
97
|
+
if (seen.has(normalizedName)) continue;
|
|
98
|
+
seen.add(normalizedName);
|
|
99
|
+
servers[normalizedName] = definition;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return servers;
|
|
104
|
+
}
|
|
105
|
+
function loadAgentPluginMcpServers(paths, cwd) {
|
|
106
|
+
const servers = {};
|
|
107
|
+
if (!Array.isArray(paths)) return servers;
|
|
108
|
+
for (const configuredPath of paths) {
|
|
109
|
+
if (typeof configuredPath !== "string") continue;
|
|
110
|
+
const pluginRoot = resolvePluginPath(configuredPath, cwd);
|
|
111
|
+
const manifest = readJson(path.join(pluginRoot, "plugin.json"));
|
|
112
|
+
if (!isValidPluginManifest(manifest)) continue;
|
|
113
|
+
const config = readJson(path.join(pluginRoot, "mcp.json"));
|
|
114
|
+
if (!isValidPluginConfig(config)) continue;
|
|
115
|
+
const rawServers = config.mcpServers;
|
|
116
|
+
for (const [serverName, rawDefinition] of Object.entries(rawServers)) {
|
|
117
|
+
const definition = translatePluginServer(manifest.name, pluginRoot, rawDefinition);
|
|
118
|
+
if (!definition) continue;
|
|
119
|
+
const normalizedName = `${formatName(manifest.name, "plugin")}__${formatName(serverName, "server")}`;
|
|
120
|
+
if (Object.hasOwn(servers, normalizedName)) continue;
|
|
121
|
+
servers[normalizedName] = definition;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return servers;
|
|
125
|
+
}
|
|
126
|
+
function getConfiguredPackageRoots(cwd) {
|
|
127
|
+
const roots = [];
|
|
128
|
+
const projectConfigDir = findProjectConfigDir(cwd);
|
|
129
|
+
const sources = [
|
|
130
|
+
{ path: path.join(projectConfigDir, "settings.json"), baseDir: projectConfigDir },
|
|
131
|
+
{ path: path.join(getAgentDir(), "settings.json"), baseDir: getAgentDir() }
|
|
132
|
+
];
|
|
133
|
+
for (const source of sources) {
|
|
134
|
+
const settings = readJson(source.path);
|
|
135
|
+
if (!settings || typeof settings !== "object" || Array.isArray(settings)) continue;
|
|
136
|
+
const packages = settings.packages;
|
|
137
|
+
if (!Array.isArray(packages)) continue;
|
|
138
|
+
for (const entry of packages) {
|
|
139
|
+
const packageSource = typeof entry === "string" ? entry : entry && typeof entry === "object" && !Array.isArray(entry) && typeof entry.source === "string" ? entry.source : void 0;
|
|
140
|
+
if (!packageSource) continue;
|
|
141
|
+
const root = resolvePackageRoot(packageSource, source.baseDir);
|
|
142
|
+
if (root && !roots.includes(root)) roots.push(root);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return roots;
|
|
146
|
+
}
|
|
147
|
+
function findProjectConfigDir(cwd) {
|
|
148
|
+
const projectRoot = findConfiguredProjectRoot(path.resolve(cwd));
|
|
149
|
+
return projectRoot ? getProjectConfigDir(projectRoot) : path.join(path.resolve(cwd), getConfigDirName());
|
|
150
|
+
}
|
|
151
|
+
function resolvePackageRoot(source, baseDir) {
|
|
152
|
+
const trimmed = source.trim();
|
|
153
|
+
if (!trimmed) return void 0;
|
|
154
|
+
if (trimmed.startsWith("npm:")) {
|
|
155
|
+
const packageName = parseNpmPackageName(trimmed);
|
|
156
|
+
return packageName ? resolveContainedPath(path.join(baseDir, PACKAGE_CONFIG_ROOT, "node_modules"), packageName) ?? void 0 : void 0;
|
|
157
|
+
}
|
|
158
|
+
if (trimmed.startsWith("git:") || /^(?:https?:\/\/|ssh:\/\/|git@[^:]+:)/.test(trimmed)) {
|
|
159
|
+
const parsed = parseGitPackagePath(trimmed.startsWith("git:") ? trimmed : `git:${trimmed}`);
|
|
160
|
+
return parsed ? path.join(baseDir, PACKAGE_GIT_ROOT, parsed.host, parsed.repoPath) : void 0;
|
|
161
|
+
}
|
|
162
|
+
const localPath = trimmed.startsWith("file:") ? trimmed.slice(5) : trimmed;
|
|
163
|
+
if (localPath === "~") return os.homedir();
|
|
164
|
+
if (localPath.startsWith("~/")) return path.join(os.homedir(), localPath.slice(2));
|
|
165
|
+
return path.isAbsolute(localPath) ? path.resolve(localPath) : path.resolve(baseDir, localPath);
|
|
166
|
+
}
|
|
167
|
+
function parseNpmPackageName(source) {
|
|
168
|
+
const spec = source.slice(4).trim();
|
|
169
|
+
if (!spec) return void 0;
|
|
170
|
+
const match = spec.match(/^(@?[^@]+(?:\/[^@]+)?)(?:@(.+))?$/);
|
|
171
|
+
const packageName = match?.[1] ?? spec;
|
|
172
|
+
return resolveContainedPath("/", packageName) ? packageName : void 0;
|
|
173
|
+
}
|
|
174
|
+
function parseGitPackagePath(source) {
|
|
175
|
+
const spec = source.slice(4).trim();
|
|
176
|
+
if (!spec) return void 0;
|
|
177
|
+
let host = "";
|
|
178
|
+
let repoPath = "";
|
|
179
|
+
const scpLike = spec.match(/^git@([^:]+):(.+)$/);
|
|
180
|
+
if (scpLike) {
|
|
181
|
+
host = scpLike[1] ?? "";
|
|
182
|
+
repoPath = scpLike[2] ?? "";
|
|
183
|
+
} else if (/^[a-z][a-z0-9+.-]*:\/\//i.test(spec)) {
|
|
184
|
+
try {
|
|
185
|
+
const url = new URL(spec);
|
|
186
|
+
host = url.hostname;
|
|
187
|
+
repoPath = url.pathname.replace(/^\/+/, "");
|
|
188
|
+
} catch {
|
|
189
|
+
return void 0;
|
|
190
|
+
}
|
|
191
|
+
} else {
|
|
192
|
+
const slashIndex = spec.indexOf("/");
|
|
193
|
+
if (slashIndex < 0) return void 0;
|
|
194
|
+
host = spec.slice(0, slashIndex);
|
|
195
|
+
repoPath = spec.slice(slashIndex + 1);
|
|
196
|
+
}
|
|
197
|
+
const normalizedPath = stripGitRef(repoPath).replace(/\.git$/, "").replace(/^\/+/, "");
|
|
198
|
+
if (!host || !isSafePackagePath(host) || !isSafePackagePath(normalizedPath) || normalizedPath.split(/[\\/]/).length < 2) {
|
|
199
|
+
return void 0;
|
|
200
|
+
}
|
|
201
|
+
return { host, repoPath: normalizedPath };
|
|
202
|
+
}
|
|
203
|
+
function stripGitRef(repoPath) {
|
|
204
|
+
const atIndex = repoPath.indexOf("@");
|
|
205
|
+
const hashIndex = repoPath.indexOf("#");
|
|
206
|
+
const refIndex = [atIndex, hashIndex].filter((index) => index >= 0).sort((a, b) => a - b)[0];
|
|
207
|
+
return refIndex === void 0 ? repoPath : repoPath.slice(0, refIndex);
|
|
208
|
+
}
|
|
209
|
+
function isSafePackagePath(value) {
|
|
210
|
+
return value.length > 0 && !path.isAbsolute(value) && value.split(/[\\/]/).every((part) => part.length > 0 && part !== "." && part !== "..");
|
|
211
|
+
}
|
|
212
|
+
function resolvePackageConfigPath(packageRoot, configuredPath) {
|
|
213
|
+
const lexicalPath = resolveContainedPath(packageRoot, configuredPath);
|
|
214
|
+
if (!lexicalPath || !fs.existsSync(lexicalPath)) return void 0;
|
|
215
|
+
try {
|
|
216
|
+
if (!fs.statSync(lexicalPath).isFile()) return void 0;
|
|
217
|
+
const packageRealPath = fs.realpathSync(packageRoot);
|
|
218
|
+
const configRealPath = fs.realpathSync(lexicalPath);
|
|
219
|
+
return resolveContainedPath(packageRealPath, configRealPath) ?? void 0;
|
|
220
|
+
} catch {
|
|
221
|
+
return void 0;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
function resolveContainedPath(root, value) {
|
|
225
|
+
const resolved = path.resolve(root, value);
|
|
226
|
+
const relative2 = path.relative(root, resolved);
|
|
227
|
+
return relative2 === "" || !relative2.startsWith("..") && !relative2.startsWith(path.sep) && !path.isAbsolute(relative2) ? resolved : void 0;
|
|
228
|
+
}
|
|
229
|
+
function resolvePluginPath(configuredPath, cwd) {
|
|
230
|
+
if (configuredPath === "~") return path.resolve(process.env.HOME ?? "", ".");
|
|
231
|
+
if (configuredPath.startsWith("~/")) return path.resolve(process.env.HOME ?? "", configuredPath.slice(2));
|
|
232
|
+
return path.isAbsolute(configuredPath) ? path.resolve(configuredPath) : path.resolve(cwd, configuredPath);
|
|
233
|
+
}
|
|
234
|
+
function isValidPluginManifest(value) {
|
|
235
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
236
|
+
const manifest = value;
|
|
237
|
+
return manifest.$schema === PLUGIN_SCHEMA && typeof manifest.name === "string" && manifest.name.length >= 1 && manifest.name.length <= 64 && PLUGIN_NAME_PATTERN.test(manifest.name);
|
|
238
|
+
}
|
|
239
|
+
function isValidPluginConfig(value) {
|
|
240
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
241
|
+
const config = value;
|
|
242
|
+
return config.$schema === PLUGIN_MCP_SCHEMA && Object.keys(config).every((key) => key === "$schema" || key === "mcpServers") && !!config.mcpServers && typeof config.mcpServers === "object" && !Array.isArray(config.mcpServers);
|
|
243
|
+
}
|
|
244
|
+
function translatePluginServer(pluginName, pluginRoot, value) {
|
|
245
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
246
|
+
const raw = value;
|
|
247
|
+
if (raw.type === "stdio") return translatePluginStdioServer(pluginName, pluginRoot, raw);
|
|
248
|
+
if (raw.type === "streamable-http" || raw.type === "sse") return translatePluginHttpServer(raw);
|
|
249
|
+
return void 0;
|
|
250
|
+
}
|
|
251
|
+
function translatePluginStdioServer(pluginName, pluginRoot, raw) {
|
|
252
|
+
if ([...Object.keys(raw)].some((key) => !PLUGIN_STDIO_FIELDS.has(key))) return void 0;
|
|
253
|
+
if (typeof raw.command !== "string" || !raw.command) return void 0;
|
|
254
|
+
if (!isBareCommand(raw.command) && !raw.command.startsWith("./")) return void 0;
|
|
255
|
+
const args = stringArray(raw.args);
|
|
256
|
+
if (raw.args !== void 0 && !args) return void 0;
|
|
257
|
+
const env = stringRecord(raw.env);
|
|
258
|
+
if (raw.env !== void 0 && !env) return void 0;
|
|
259
|
+
if (env && (Object.hasOwn(env, "PLUGIN_ROOT") || Object.hasOwn(env, "PLUGIN_DATA"))) return void 0;
|
|
260
|
+
const pluginDataDir = path.join(getAgentDir(), "agent-plugin-data", pluginName);
|
|
261
|
+
const command = raw.command.startsWith("./") ? resolveContainedPath(pluginRoot, raw.command) : raw.command;
|
|
262
|
+
if (!command) return void 0;
|
|
263
|
+
const cwd = resolvePluginCwd(raw.cwd, pluginRoot, pluginDataDir);
|
|
264
|
+
if (!cwd) return void 0;
|
|
265
|
+
return {
|
|
266
|
+
command,
|
|
267
|
+
args: (args ?? []).map((value) => expandPluginPlaceholders(value, pluginRoot, pluginDataDir)),
|
|
268
|
+
env: {
|
|
269
|
+
...Object.fromEntries(Object.entries(env ?? {}).map(([key, value]) => [key, expandPluginPlaceholders(value, pluginRoot, pluginDataDir)])),
|
|
270
|
+
PLUGIN_ROOT: pluginRoot,
|
|
271
|
+
PLUGIN_DATA: pluginDataDir
|
|
272
|
+
},
|
|
273
|
+
cwd,
|
|
274
|
+
pluginDataDir,
|
|
275
|
+
literalEnv: true
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
function translatePluginHttpServer(raw) {
|
|
279
|
+
if ([...Object.keys(raw)].some((key) => !PLUGIN_HTTP_FIELDS.has(key))) return void 0;
|
|
280
|
+
if (typeof raw.url !== "string" || !isValidPluginUrl(raw.url)) return void 0;
|
|
281
|
+
const headers = stringRecord(raw.headers);
|
|
282
|
+
if (raw.headers !== void 0 && !headers) return void 0;
|
|
283
|
+
if (headers) {
|
|
284
|
+
const normalized = /* @__PURE__ */ new Set();
|
|
285
|
+
for (const key of Object.keys(headers)) {
|
|
286
|
+
const lower = key.toLowerCase();
|
|
287
|
+
if (normalized.has(lower)) return void 0;
|
|
288
|
+
normalized.add(lower);
|
|
289
|
+
}
|
|
290
|
+
try {
|
|
291
|
+
new Headers(headers);
|
|
292
|
+
} catch {
|
|
293
|
+
return void 0;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
return { url: raw.url, ...headers ? { headers } : {}, httpTransport: raw.type };
|
|
297
|
+
}
|
|
298
|
+
function resolvePluginCwd(value, pluginRoot, pluginDataDir) {
|
|
299
|
+
if (value === void 0) return pluginRoot;
|
|
300
|
+
if (typeof value !== "string") return void 0;
|
|
301
|
+
if (value.startsWith("./")) return resolveContainedPath(pluginRoot, value);
|
|
302
|
+
if (value === "${PLUGIN_ROOT}" || value.startsWith("${PLUGIN_ROOT}/")) return resolveContainedPath(pluginRoot, value.replace("${PLUGIN_ROOT}", "."));
|
|
303
|
+
if (value === "${PLUGIN_DATA}" || value.startsWith("${PLUGIN_DATA}/")) return resolveContainedPath(pluginDataDir, value.replace("${PLUGIN_DATA}", "."));
|
|
304
|
+
return void 0;
|
|
305
|
+
}
|
|
306
|
+
function expandPluginPlaceholders(value, pluginRoot, pluginDataDir) {
|
|
307
|
+
return value.replaceAll("${PLUGIN_ROOT}", pluginRoot).replaceAll("${PLUGIN_DATA}", pluginDataDir);
|
|
308
|
+
}
|
|
309
|
+
function isBareCommand(command) {
|
|
310
|
+
return !command.includes("/") && !command.includes("\\") && !command.includes("${PLUGIN_ROOT}") && !command.includes("${PLUGIN_DATA}");
|
|
311
|
+
}
|
|
312
|
+
function isValidPluginUrl(value) {
|
|
313
|
+
if (value.includes("${") || value.includes("$env:") || value.includes("{env:")) return false;
|
|
314
|
+
let url;
|
|
315
|
+
try {
|
|
316
|
+
url = new URL(value);
|
|
317
|
+
} catch {
|
|
318
|
+
return false;
|
|
319
|
+
}
|
|
320
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") return false;
|
|
321
|
+
if (url.username || url.password || url.hash) return false;
|
|
322
|
+
if (url.protocol === "https:") return true;
|
|
323
|
+
const host = url.hostname.toLowerCase();
|
|
324
|
+
return host === "localhost" || host === "127.0.0.1" || host === "::1" || host === "[::1]" || /^127(?:\.\d{1,3}){3}$/.test(host);
|
|
325
|
+
}
|
|
326
|
+
function stringArray(value) {
|
|
327
|
+
return Array.isArray(value) && value.every((entry) => typeof entry === "string") ? value : void 0;
|
|
328
|
+
}
|
|
329
|
+
function stringRecord(value) {
|
|
330
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
331
|
+
const entries = Object.entries(value);
|
|
332
|
+
if (entries.some(([, entry]) => typeof entry !== "string")) return void 0;
|
|
333
|
+
return Object.fromEntries(entries);
|
|
334
|
+
}
|
|
335
|
+
function formatName(value, fallback) {
|
|
336
|
+
return value.replace(/[^A-Za-z0-9_-]+/g, "_").replace(/^[_-]+|[_-]+$/g, "") || fallback;
|
|
337
|
+
}
|
|
338
|
+
function readJson(filePath) {
|
|
339
|
+
let content;
|
|
340
|
+
try {
|
|
341
|
+
content = fs.readFileSync(filePath, "utf-8");
|
|
342
|
+
} catch (error) {
|
|
343
|
+
if (error.code === "ENOENT") return void 0;
|
|
344
|
+
throw new Error(`Failed to read JSON file '${filePath}': ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
345
|
+
}
|
|
346
|
+
try {
|
|
347
|
+
return JSON.parse(content);
|
|
348
|
+
} catch (error) {
|
|
349
|
+
throw new Error(`Invalid JSON in '${filePath}': ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// src/runs/shared/mcp-direct-tool-grant.ts
|
|
354
|
+
var BUILTIN_TOOL_NAMES = /* @__PURE__ */ new Set(["read", "bash", "edit", "write", "grep", "find", "ls", "mcp"]);
|
|
355
|
+
function normalizeMcpDirectToolSelectors(selectors) {
|
|
356
|
+
return [...new Set((selectors ?? []).map((selector) => selector.replace(/\/+$/, "")).filter(Boolean))];
|
|
357
|
+
}
|
|
358
|
+
function parseMcpDirectToolSelectors(selectors) {
|
|
359
|
+
const servers = /* @__PURE__ */ new Set();
|
|
360
|
+
const tools = /* @__PURE__ */ new Map();
|
|
361
|
+
for (const item of selectors) {
|
|
362
|
+
if (item.includes("/")) {
|
|
363
|
+
const [server, tool] = item.split("/", 2);
|
|
364
|
+
if (server && tool) {
|
|
365
|
+
if (!tools.has(server)) tools.set(server, /* @__PURE__ */ new Set());
|
|
366
|
+
tools.get(server).add(tool);
|
|
367
|
+
} else if (server) {
|
|
368
|
+
servers.add(server);
|
|
369
|
+
}
|
|
370
|
+
} else if (item) {
|
|
371
|
+
servers.add(item);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
return { servers, tools };
|
|
375
|
+
}
|
|
376
|
+
function planMcpDirectToolGrant(input) {
|
|
377
|
+
const selectors = normalizeMcpDirectToolSelectors(input.selectors);
|
|
378
|
+
if (selectors.length === 0) return { selections: [], unresolvedSelectors: [] };
|
|
379
|
+
const { servers: selectedServers, tools: selectedTools } = parseMcpDirectToolSelectors(selectors);
|
|
380
|
+
const selections = [];
|
|
381
|
+
const seenNames = /* @__PURE__ */ new Set();
|
|
382
|
+
for (const [serverName, server] of Object.entries(input.servers)) {
|
|
383
|
+
const metadata = input.metadata[serverName];
|
|
384
|
+
if (!metadata) continue;
|
|
385
|
+
const toolFilter = selectedServers.has(serverName) ? true : selectedTools.get(serverName);
|
|
386
|
+
if (!toolFilter) continue;
|
|
387
|
+
const prefix = normalizeMcpToolPrefix(server.toolPrefix ?? input.toolPrefix);
|
|
388
|
+
for (const tool of Array.isArray(metadata.tools) ? metadata.tools : []) {
|
|
389
|
+
if (typeof tool?.name !== "string" || !tool.name) continue;
|
|
390
|
+
if (toolFilter !== true && !toolFilter.has(tool.name)) continue;
|
|
391
|
+
if (!isToolAllowed(tool.name, serverName, prefix, server.includeTools, server.excludeTools)) continue;
|
|
392
|
+
const name = formatToolName(tool.name, serverName, prefix);
|
|
393
|
+
if (BUILTIN_TOOL_NAMES.has(name) || seenNames.has(name)) continue;
|
|
394
|
+
seenNames.add(name);
|
|
395
|
+
selections.push({ name, selector: `${serverName}/${tool.name}` });
|
|
396
|
+
}
|
|
397
|
+
if (server.exposeResources === false) continue;
|
|
398
|
+
for (const resource of Array.isArray(metadata.resources) ? metadata.resources : []) {
|
|
399
|
+
if (typeof resource?.name !== "string" || !resource.name || typeof resource.uri !== "string" || !resource.uri) continue;
|
|
400
|
+
const baseName = `get_${resourceNameToToolName(resource.name)}`;
|
|
401
|
+
if (toolFilter !== true && !toolFilter.has(baseName)) continue;
|
|
402
|
+
if (!isToolAllowed(baseName, serverName, prefix, server.includeTools, server.excludeTools)) continue;
|
|
403
|
+
const name = formatToolName(baseName, serverName, prefix);
|
|
404
|
+
if (BUILTIN_TOOL_NAMES.has(name) || seenNames.has(name)) continue;
|
|
405
|
+
seenNames.add(name);
|
|
406
|
+
selections.push({ name, selector: `${serverName}/${baseName}` });
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
const unresolvedSelectors = selectors.filter(
|
|
410
|
+
(selector) => selector.includes("/") ? !selections.some((selection) => selection.selector === selector) : !selections.some((selection) => selection.selector.startsWith(`${selector}/`))
|
|
411
|
+
);
|
|
412
|
+
return { selections, unresolvedSelectors };
|
|
413
|
+
}
|
|
414
|
+
function normalizeMcpToolPrefix(value) {
|
|
415
|
+
return value === "none" || value === "short" || value === "mcp" || value === "server" ? value : "server";
|
|
416
|
+
}
|
|
417
|
+
function formatUnresolvedMcpDirectToolSelectors(selectors) {
|
|
418
|
+
return `Unresolved MCP direct-tool selectors: ${selectors.join(", ")}. Direct MCP tools require a matching configured server and fresh metadata cache; runtime-registered servers require a host/pi-mcp-adapter handoff before child launch.`;
|
|
419
|
+
}
|
|
420
|
+
function getServerPrefix(serverName, mode) {
|
|
421
|
+
if (mode === "none") return "";
|
|
422
|
+
if (mode === "short") return sanitizeServerPrefix(serverName.replace(/-?mcp$/i, "")) || "mcp";
|
|
423
|
+
if (mode === "mcp") return `mcp__${sanitizeServerPrefix(serverName)}`;
|
|
424
|
+
return sanitizeServerPrefix(serverName);
|
|
425
|
+
}
|
|
426
|
+
function sanitizeServerPrefix(serverName) {
|
|
427
|
+
return Array.from(serverName, (char) => /^[A-Za-z0-9_-]$/.test(char) ? char : `_${char.codePointAt(0).toString(16)}_`).join("");
|
|
428
|
+
}
|
|
429
|
+
function formatToolName(toolName, serverName, prefix) {
|
|
430
|
+
const serverPrefix = getServerPrefix(serverName, prefix);
|
|
431
|
+
const sanitized = toolName.replace(/\./g, "_");
|
|
432
|
+
if (serverPrefix && sanitized.startsWith(`${serverPrefix}_`) && sanitized.length > serverPrefix.length + 1) {
|
|
433
|
+
return sanitized;
|
|
434
|
+
}
|
|
435
|
+
return serverPrefix ? `${serverPrefix}_${sanitized}` : sanitized;
|
|
436
|
+
}
|
|
437
|
+
function isToolAllowed(toolName, serverName, prefix, includeTools, excludeTools) {
|
|
438
|
+
const candidates = toolNameCandidates(toolName, serverName, prefix);
|
|
439
|
+
return (!Array.isArray(includeTools) || includeTools.length === 0 || matchesToolPatterns(candidates, includeTools)) && !matchesToolPatterns(candidates, excludeTools);
|
|
440
|
+
}
|
|
441
|
+
function toolNameCandidates(toolName, serverName, prefix) {
|
|
442
|
+
return /* @__PURE__ */ new Set([
|
|
443
|
+
toolName,
|
|
444
|
+
`mcp_${toolName}`,
|
|
445
|
+
formatToolName(toolName, serverName, prefix),
|
|
446
|
+
formatToolName(toolName, serverName, "server"),
|
|
447
|
+
formatToolName(toolName, serverName, "short"),
|
|
448
|
+
formatToolName(toolName, serverName, "mcp"),
|
|
449
|
+
formatToolName(toolName, serverName, "none")
|
|
450
|
+
]);
|
|
451
|
+
}
|
|
452
|
+
function matchesToolPatterns(candidates, patterns) {
|
|
453
|
+
if (!Array.isArray(patterns) || patterns.length === 0) return false;
|
|
454
|
+
for (const pattern of patterns) {
|
|
455
|
+
if (typeof pattern !== "string") continue;
|
|
456
|
+
const normalizedPattern = normalizeToolName(pattern);
|
|
457
|
+
const matcher = normalizedPattern.includes("*") || normalizedPattern.includes("?") ? globToRegExp(normalizedPattern) : void 0;
|
|
458
|
+
for (const candidate of candidates) {
|
|
459
|
+
const normalizedCandidate = normalizeToolName(candidate);
|
|
460
|
+
if (matcher ? matcher.test(normalizedCandidate) : normalizedCandidate === normalizedPattern) return true;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
return false;
|
|
464
|
+
}
|
|
465
|
+
function globToRegExp(pattern) {
|
|
466
|
+
const escaped = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*").replace(/\?/g, ".");
|
|
467
|
+
return new RegExp(`^${escaped}$`);
|
|
468
|
+
}
|
|
469
|
+
function normalizeToolName(value) {
|
|
470
|
+
return value.replace(/-/g, "_");
|
|
471
|
+
}
|
|
472
|
+
function resourceNameToToolName(name) {
|
|
473
|
+
let result = name.replace(/[^a-zA-Z0-9]/g, "_").replace(/_+/g, "_").replace(/^_+/, "").replace(/_+$/, "").toLowerCase();
|
|
474
|
+
if (!result || /^\d/.test(result)) result = `resource${result ? `_${result}` : ""}`;
|
|
475
|
+
return result;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// src/runs/shared/mcp-direct-tool-allowlist.ts
|
|
479
|
+
var CACHE_VERSION = 1;
|
|
480
|
+
var CACHE_MAX_AGE_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
481
|
+
var GENERIC_GLOBAL_CONFIG_PATH = path2.join(os2.homedir(), ".config", "mcp", "mcp.json");
|
|
482
|
+
var IMPORT_PATHS = {
|
|
483
|
+
cursor: [path2.join(os2.homedir(), ".cursor", "mcp.json")],
|
|
484
|
+
"claude-code": [
|
|
485
|
+
path2.join(os2.homedir(), ".claude", "mcp.json"),
|
|
486
|
+
path2.join(os2.homedir(), ".claude.json"),
|
|
487
|
+
path2.join(os2.homedir(), ".claude", "claude_desktop_config.json")
|
|
488
|
+
],
|
|
489
|
+
"claude-desktop": [path2.join(os2.homedir(), "Library", "Application Support", "Claude", "claude_desktop_config.json")],
|
|
490
|
+
codex: [path2.join(os2.homedir(), ".codex", "config.json")],
|
|
491
|
+
windsurf: [path2.join(os2.homedir(), ".windsurf", "mcp.json")],
|
|
492
|
+
vscode: [".vscode/mcp.json"]
|
|
493
|
+
};
|
|
494
|
+
var MCP_RUNTIME_SNAPSHOT_EVENT = "pi-mcp-adapter:runtime-snapshot:v1";
|
|
495
|
+
var MCP_RUNTIME_SNAPSHOT_VERSION = 1;
|
|
496
|
+
function resolveMcpDirectToolResolution(mcpDirectTools, cwd = process.cwd(), runtimeSnapshotHost, configOverride) {
|
|
497
|
+
const selectors = normalizeMcpDirectToolSelectors(mcpDirectTools);
|
|
498
|
+
if (selectors.length === 0) return { selections: [], unresolvedSelectors: [] };
|
|
499
|
+
if (usesBuiltinMcp(runtimeSnapshotHost)) {
|
|
500
|
+
return resolveBuiltinMcpSelections(selectors, runtimeSnapshotHost.getAllTools?.() ?? []);
|
|
501
|
+
}
|
|
502
|
+
const config = configOverride ?? loadMcpConfig(cwd);
|
|
503
|
+
const { servers: selectedServers, tools: selectedTools } = parseMcpDirectToolSelectors(selectors);
|
|
504
|
+
const runtimeSelectionServers = /* @__PURE__ */ new Set([...selectedServers, ...selectedTools.keys()]);
|
|
505
|
+
const runtimeServers = resolveRuntimeMcpServers(config, runtimeSelectionServers, runtimeSnapshotHost);
|
|
506
|
+
const resolvedConfig = Object.keys(runtimeServers).length > 0 ? mergeConfigs(config, { mcpServers: runtimeServers }) : config;
|
|
507
|
+
validateSelectedServerDefinitions(resolvedConfig, selectors);
|
|
508
|
+
const runtime = Object.keys(runtimeServers).length > 0 ? { mcpConfig: resolvedConfig, runtimeServerNames: Object.keys(runtimeServers) } : {};
|
|
509
|
+
const cache = loadMetadataCache();
|
|
510
|
+
if (!cache) return { selections: [], unresolvedSelectors: selectors, ...runtime };
|
|
511
|
+
const validMetadata = {};
|
|
512
|
+
for (const [serverName, definition] of Object.entries(resolvedConfig.mcpServers)) {
|
|
513
|
+
const serverCache = cache.servers[serverName];
|
|
514
|
+
if (isServerCacheValid(serverCache, definition)) validMetadata[serverName] = serverCache;
|
|
515
|
+
}
|
|
516
|
+
const grant = planMcpDirectToolGrant({
|
|
517
|
+
selectors,
|
|
518
|
+
servers: resolvedConfig.mcpServers,
|
|
519
|
+
metadata: validMetadata,
|
|
520
|
+
toolPrefix: resolvedConfig.settings?.toolPrefix
|
|
521
|
+
});
|
|
522
|
+
return {
|
|
523
|
+
selections: grant.selections,
|
|
524
|
+
unresolvedSelectors: grant.unresolvedSelectors,
|
|
525
|
+
...runtime
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
function usesBuiltinMcp(host) {
|
|
529
|
+
const commands = host?.getCommands?.() ?? [];
|
|
530
|
+
return commands.find((command) => command.name === "mcp")?.sourceInfo.path === "builtin:mcp" && !commands.some((command) => /^mcp-adapter(?::\d+)?$/.test(command.name));
|
|
531
|
+
}
|
|
532
|
+
function resolveBuiltinMcpSelections(selectors, tools) {
|
|
533
|
+
const selections = [];
|
|
534
|
+
const unresolvedSelectors = [];
|
|
535
|
+
for (const selector of selectors) {
|
|
536
|
+
const slash = selector.indexOf("/");
|
|
537
|
+
const server = slash === -1 ? selector : selector.slice(0, slash);
|
|
538
|
+
const inServer = tools.filter((tool) => tool.namespace?.name === `mcp__${server.replace(/-/g, "_")}`);
|
|
539
|
+
const toolName = slash === -1 ? void 0 : builtinMcpToolNames(server, selector.slice(slash + 1)).find((name) => inServer.some((tool) => tool.name === name));
|
|
540
|
+
const matches = inServer.filter((tool) => tool.exposure !== "hidden" && (slash === -1 || tool.name === toolName));
|
|
541
|
+
if (matches.length === 0) unresolvedSelectors.push(selector);
|
|
542
|
+
for (const tool of matches) {
|
|
543
|
+
if (!selections.some((selection) => selection.name === tool.name)) selections.push({ name: tool.name, selector });
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
return { selections, unresolvedSelectors, builtin: true };
|
|
547
|
+
}
|
|
548
|
+
function builtinMcpToolNames(server, tool) {
|
|
549
|
+
const name = `mcp__${server}__${tool}`.replace(/[^A-Za-z0-9_]/g, "_");
|
|
550
|
+
const hash = createHash("sha256").update(`${server}\0${tool}`).digest("hex").slice(0, 8);
|
|
551
|
+
const suffixed = `${name.slice(0, 64 - hash.length - 1)}_${hash}`;
|
|
552
|
+
return name.length <= 64 ? [suffixed, name] : [suffixed];
|
|
553
|
+
}
|
|
554
|
+
function formatUnresolvedBuiltinMcpSelectors(agentName, selectors) {
|
|
555
|
+
const subject = agentName ? `Agent '${agentName}'` : "Subagent";
|
|
556
|
+
return `${subject} selects MCP tools that Pi's built-in MCP does not offer: ${selectors.map((selector) => `mcp:${selector}`).join(", ")}. The server may be missing, disconnected, still connecting, or its tools hidden; check /mcp.`;
|
|
557
|
+
}
|
|
558
|
+
function extensionOnlyMcpServers(selections, host, cwd, projectTrusted) {
|
|
559
|
+
const registered = new Set(host.getMcpServers?.().map(({ name }) => name));
|
|
560
|
+
const servers = [...new Set(selections.map(({ selector }) => selector.split("/")[0]))].filter((server) => registered.has(server));
|
|
561
|
+
if (servers.length === 0) return [];
|
|
562
|
+
const files = [path2.join(getAgentDir(), "mcp.json"), ...projectTrusted ? [path2.join(cwd, ".pi", "mcp.json")] : []];
|
|
563
|
+
const configured = new Set(files.flatMap((file) => {
|
|
564
|
+
let parsed;
|
|
565
|
+
try {
|
|
566
|
+
parsed = JSON.parse(fs2.readFileSync(file, "utf-8"));
|
|
567
|
+
} catch {
|
|
568
|
+
return [];
|
|
569
|
+
}
|
|
570
|
+
return isRecord2(parsed) && isRecord2(parsed.mcpServers) ? Object.keys(parsed.mcpServers) : [];
|
|
571
|
+
}));
|
|
572
|
+
return servers.filter((server) => !configured.has(server));
|
|
573
|
+
}
|
|
574
|
+
function loadMetadataCache() {
|
|
575
|
+
const cachePath = path2.join(getAgentDir(), "mcp-cache.json");
|
|
576
|
+
let parsed;
|
|
577
|
+
try {
|
|
578
|
+
parsed = JSON.parse(fs2.readFileSync(cachePath, "utf-8"));
|
|
579
|
+
} catch {
|
|
580
|
+
return null;
|
|
581
|
+
}
|
|
582
|
+
if (!isRecord2(parsed) || parsed.version !== CACHE_VERSION || !isRecord2(parsed.servers)) return null;
|
|
583
|
+
const servers = {};
|
|
584
|
+
for (const [name, value] of Object.entries(parsed.servers)) {
|
|
585
|
+
const entry = parseServerCacheEntry(value);
|
|
586
|
+
if (entry) servers[name] = entry;
|
|
587
|
+
}
|
|
588
|
+
return { version: CACHE_VERSION, servers };
|
|
589
|
+
}
|
|
590
|
+
function parseServerCacheEntry(value) {
|
|
591
|
+
if (!isRecord2(value)) return void 0;
|
|
592
|
+
if (value.configHash !== void 0 && typeof value.configHash !== "string") return void 0;
|
|
593
|
+
if (value.cachedAt !== void 0 && (typeof value.cachedAt !== "number" || !Number.isFinite(value.cachedAt))) return void 0;
|
|
594
|
+
if (value.tools !== void 0 && !Array.isArray(value.tools)) return void 0;
|
|
595
|
+
if (value.resources !== void 0 && !Array.isArray(value.resources)) return void 0;
|
|
596
|
+
const tools = value.tools?.map(parseCachedTool);
|
|
597
|
+
const resources = value.resources?.map(parseCachedResource);
|
|
598
|
+
if (tools && !tools.every((entry) => entry !== void 0)) return void 0;
|
|
599
|
+
if (resources && !resources.every((entry) => entry !== void 0)) return void 0;
|
|
600
|
+
return {
|
|
601
|
+
...value.configHash !== void 0 ? { configHash: value.configHash } : {},
|
|
602
|
+
...value.cachedAt !== void 0 ? { cachedAt: value.cachedAt } : {},
|
|
603
|
+
...tools ? { tools } : {},
|
|
604
|
+
...resources ? { resources } : {}
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
function parseCachedTool(value) {
|
|
608
|
+
if (!isRecord2(value) || value.name !== void 0 && typeof value.name !== "string") return void 0;
|
|
609
|
+
return value.name === void 0 ? {} : { name: value.name };
|
|
610
|
+
}
|
|
611
|
+
function parseCachedResource(value) {
|
|
612
|
+
if (!isRecord2(value)) return void 0;
|
|
613
|
+
if (value.uri !== void 0 && typeof value.uri !== "string") return void 0;
|
|
614
|
+
if (value.name !== void 0 && typeof value.name !== "string") return void 0;
|
|
615
|
+
return {
|
|
616
|
+
...value.uri !== void 0 ? { uri: value.uri } : {},
|
|
617
|
+
...value.name !== void 0 ? { name: value.name } : {}
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
function resolveRuntimeMcpServers(config, selectedServers, runtimeSnapshotHost) {
|
|
621
|
+
if (!runtimeSnapshotHost) return {};
|
|
622
|
+
const runtimeServers = {};
|
|
623
|
+
for (const serverName of selectedServers) {
|
|
624
|
+
if (Object.hasOwn(config.mcpServers, serverName)) continue;
|
|
625
|
+
try {
|
|
626
|
+
const snapshot = getRuntimeMcpServerSnapshot(runtimeSnapshotHost, serverName);
|
|
627
|
+
runtimeServers[serverName] = snapshot.definition;
|
|
628
|
+
} catch {
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
return runtimeServers;
|
|
632
|
+
}
|
|
633
|
+
function getRuntimeMcpServerSnapshot(host, name) {
|
|
634
|
+
const request = {
|
|
635
|
+
version: MCP_RUNTIME_SNAPSHOT_VERSION,
|
|
636
|
+
name
|
|
637
|
+
};
|
|
638
|
+
host.events.emit(MCP_RUNTIME_SNAPSHOT_EVENT, request);
|
|
639
|
+
if (!request.result) throw new Error("pi-mcp-adapter is not installed for this Pi instance");
|
|
640
|
+
if (!request.result.ok) throw request.result.error;
|
|
641
|
+
const snapshot = request.result.snapshot;
|
|
642
|
+
if (!snapshot || snapshot.name !== name || snapshot.runtime !== true || snapshot.persisted !== false || !isMcpServerDefinition(snapshot.definition)) {
|
|
643
|
+
throw new Error(`Invalid MCP runtime snapshot for server "${name}"`);
|
|
644
|
+
}
|
|
645
|
+
return snapshot;
|
|
646
|
+
}
|
|
647
|
+
function loadMcpConfig(cwd) {
|
|
648
|
+
const resolvedCwd = path2.resolve(cwd);
|
|
649
|
+
const projectRoot = findConfiguredProjectRoot(resolvedCwd) ?? resolvedCwd;
|
|
650
|
+
let config = { mcpServers: {} };
|
|
651
|
+
for (const sourcePath of getConfigPaths(projectRoot)) {
|
|
652
|
+
const loaded = readConfig(sourcePath);
|
|
653
|
+
if (!loaded) continue;
|
|
654
|
+
config = mergeConfigs(config, expandImports(loaded, projectRoot));
|
|
655
|
+
}
|
|
656
|
+
const packageServers = loadPackageMcpServers(projectRoot);
|
|
657
|
+
const pluginServers = loadAgentPluginMcpServers(config.settings?.agentPluginPaths, projectRoot);
|
|
658
|
+
const packageOnlyServers = Object.fromEntries(
|
|
659
|
+
Object.entries(packageServers).filter(([name]) => !Object.hasOwn(pluginServers, name))
|
|
660
|
+
);
|
|
661
|
+
return mergeConfigs(
|
|
662
|
+
{ mcpServers: packageOnlyServers },
|
|
663
|
+
mergeConfigs({ mcpServers: pluginServers }, config)
|
|
664
|
+
);
|
|
665
|
+
}
|
|
666
|
+
function getConfigPaths(projectRoot) {
|
|
667
|
+
const agentDir = getAgentDir();
|
|
668
|
+
const projectDir = getProjectConfigDir(projectRoot);
|
|
669
|
+
const candidates = [
|
|
670
|
+
GENERIC_GLOBAL_CONFIG_PATH,
|
|
671
|
+
path2.join(agentDir, "mcp-adapter.json"),
|
|
672
|
+
path2.resolve(projectRoot, ".mcp.json"),
|
|
673
|
+
path2.join(projectDir, "mcp-adapter.json")
|
|
674
|
+
];
|
|
675
|
+
return [...new Set(candidates)];
|
|
676
|
+
}
|
|
677
|
+
function readConfig(configPath) {
|
|
678
|
+
let parsed;
|
|
679
|
+
try {
|
|
680
|
+
parsed = JSON.parse(fs2.readFileSync(configPath, "utf-8"));
|
|
681
|
+
} catch {
|
|
682
|
+
return null;
|
|
683
|
+
}
|
|
684
|
+
return validateConfig(parsed);
|
|
685
|
+
}
|
|
686
|
+
function validateConfig(raw) {
|
|
687
|
+
if (!isRecord2(raw)) return { mcpServers: {} };
|
|
688
|
+
const obj = raw;
|
|
689
|
+
const servers = obj.mcpServers ?? obj["mcp-servers"] ?? {};
|
|
690
|
+
return {
|
|
691
|
+
mcpServers: parseServerEntries(servers),
|
|
692
|
+
imports: Array.isArray(obj.imports) ? obj.imports.filter((value) => isImportKind(value)) : void 0,
|
|
693
|
+
settings: parseSettings(obj.settings)
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
function parseServerEntries(value) {
|
|
697
|
+
if (!isRecord2(value)) return {};
|
|
698
|
+
return Object.fromEntries(Object.entries(value).filter((entry) => isMcpServerDefinition(entry[1])));
|
|
699
|
+
}
|
|
700
|
+
function parseSettings(value) {
|
|
701
|
+
if (!isRecord2(value)) return void 0;
|
|
702
|
+
const toolPrefix = value.toolPrefix === "server" || value.toolPrefix === "short" || value.toolPrefix === "none" || value.toolPrefix === "mcp" ? value.toolPrefix : void 0;
|
|
703
|
+
const directTools = typeof value.directTools === "boolean" ? value.directTools : void 0;
|
|
704
|
+
const settings = {
|
|
705
|
+
...toolPrefix ? { toolPrefix } : {},
|
|
706
|
+
...directTools !== void 0 ? { directTools } : {},
|
|
707
|
+
...value.agentPluginPaths !== void 0 ? { agentPluginPaths: value.agentPluginPaths } : {}
|
|
708
|
+
};
|
|
709
|
+
return Object.keys(settings).length ? settings : void 0;
|
|
710
|
+
}
|
|
711
|
+
function mergeConfigs(base, next) {
|
|
712
|
+
const imports = [...base.imports ?? [], ...next.imports ?? []];
|
|
713
|
+
return {
|
|
714
|
+
mcpServers: { ...base.mcpServers, ...next.mcpServers },
|
|
715
|
+
imports: imports.length ? [...new Set(imports)] : void 0,
|
|
716
|
+
settings: next.settings ? { ...base.settings, ...next.settings } : base.settings
|
|
717
|
+
};
|
|
718
|
+
}
|
|
719
|
+
function expandImports(config, cwd) {
|
|
720
|
+
if (!config.imports?.length) return config;
|
|
721
|
+
const importedServers = {};
|
|
722
|
+
for (const importKind of config.imports) {
|
|
723
|
+
const importPath = resolveImportPath(importKind, cwd);
|
|
724
|
+
if (!importPath) continue;
|
|
725
|
+
let imported;
|
|
726
|
+
try {
|
|
727
|
+
imported = JSON.parse(fs2.readFileSync(importPath, "utf-8"));
|
|
728
|
+
} catch {
|
|
729
|
+
continue;
|
|
730
|
+
}
|
|
731
|
+
for (const [name, definition] of Object.entries(extractServers(imported, importKind))) {
|
|
732
|
+
if (!importedServers[name]) importedServers[name] = definition;
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
return {
|
|
736
|
+
imports: config.imports,
|
|
737
|
+
settings: config.settings,
|
|
738
|
+
mcpServers: { ...importedServers, ...config.mcpServers }
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
function resolveImportPath(importKind, cwd) {
|
|
742
|
+
for (const candidate of IMPORT_PATHS[importKind]) {
|
|
743
|
+
const fullPath = candidate.startsWith(".") ? path2.resolve(cwd, candidate) : candidate;
|
|
744
|
+
if (fs2.existsSync(fullPath)) return fullPath;
|
|
745
|
+
}
|
|
746
|
+
return null;
|
|
747
|
+
}
|
|
748
|
+
function extractServers(config, kind) {
|
|
749
|
+
if (!isRecord2(config)) return {};
|
|
750
|
+
const obj = config;
|
|
751
|
+
const servers = kind === "cursor" || kind === "windsurf" || kind === "vscode" ? obj.mcpServers ?? obj["mcp-servers"] : obj.mcpServers;
|
|
752
|
+
return parseServerEntries(servers);
|
|
753
|
+
}
|
|
754
|
+
function validateSelectedServerDefinitions(config, selectors) {
|
|
755
|
+
const { servers, tools } = parseMcpDirectToolSelectors(selectors);
|
|
756
|
+
for (const serverName of /* @__PURE__ */ new Set([...servers, ...tools.keys()])) {
|
|
757
|
+
const definition = config.mcpServers[serverName];
|
|
758
|
+
if (definition) computeMcpServerHash(definition);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
function isServerCacheValid(entry, definition) {
|
|
762
|
+
if (!entry || entry.configHash !== computeMcpServerHash(definition)) return false;
|
|
763
|
+
if (!entry.cachedAt || typeof entry.cachedAt !== "number") return false;
|
|
764
|
+
return Date.now() - entry.cachedAt <= CACHE_MAX_AGE_MS;
|
|
765
|
+
}
|
|
766
|
+
function computeMcpServerHash(definition) {
|
|
767
|
+
const isStdio = definition.command !== void 0;
|
|
768
|
+
const literalEnv = isStdio && definition.literalEnv === true;
|
|
769
|
+
const identity = {
|
|
770
|
+
command: resolveConfigPath(definition.command),
|
|
771
|
+
args: definition.args,
|
|
772
|
+
socket: resolveConfigPath(definition.socket),
|
|
773
|
+
env: literalEnv ? definition.env : interpolateEnvRecord(definition.env),
|
|
774
|
+
...isStdio ? { inheritEnv: definition.inheritEnv !== false, literalEnv } : {},
|
|
775
|
+
cwd: resolveConfigPath(definition.cwd),
|
|
776
|
+
url: resolveServerUrl(definition),
|
|
777
|
+
headers: interpolateEnvRecord(definition.headers),
|
|
778
|
+
requestHeadersCommand: definition.requestHeadersCommand ? {
|
|
779
|
+
command: interpolateEnvVars(definition.requestHeadersCommand.command),
|
|
780
|
+
args: definition.requestHeadersCommand.args?.map(interpolateEnvVars),
|
|
781
|
+
env: interpolateEnvRecord(definition.requestHeadersCommand.env),
|
|
782
|
+
timeoutMs: definition.requestHeadersCommand.timeoutMs
|
|
783
|
+
} : void 0,
|
|
784
|
+
auth: definition.auth,
|
|
785
|
+
bearerToken: resolveBearerToken(definition),
|
|
786
|
+
bearerTokenEnv: definition.bearerTokenEnv,
|
|
787
|
+
exposeResources: definition.exposeResources,
|
|
788
|
+
includeTools: definition.includeTools,
|
|
789
|
+
excludeTools: definition.excludeTools,
|
|
790
|
+
protocolVersion: definition.protocolVersion
|
|
791
|
+
};
|
|
792
|
+
return createHash("sha256").update(stableStringify(identity)).digest("hex");
|
|
793
|
+
}
|
|
794
|
+
function isImportKind(value) {
|
|
795
|
+
return typeof value === "string" && Object.hasOwn(IMPORT_PATHS, value);
|
|
796
|
+
}
|
|
797
|
+
function isRecord2(value) {
|
|
798
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
799
|
+
}
|
|
800
|
+
function interpolateEnvRecord(values) {
|
|
801
|
+
if (!values) return void 0;
|
|
802
|
+
return Object.fromEntries(Object.entries(values).map(([key, value]) => [key, interpolateSecretExpression(value)]));
|
|
803
|
+
}
|
|
804
|
+
function interpolateEnvVars(value) {
|
|
805
|
+
return value.replace(/\$\{(\w+)\}/g, (_, name) => process.env[name] ?? "").replace(/\$env:(\w+)/g, (_, name) => process.env[name] ?? "").replace(/\{env:(\w+)\}/g, (_, name) => process.env[name] ?? "");
|
|
806
|
+
}
|
|
807
|
+
function interpolateSecretExpression(value) {
|
|
808
|
+
if (value.startsWith("!!")) return interpolateEnvVars(value.slice(1));
|
|
809
|
+
return value.startsWith("!") ? value : interpolateEnvVars(value);
|
|
810
|
+
}
|
|
811
|
+
function getMissingEnvVars(value) {
|
|
812
|
+
const missing = /* @__PURE__ */ new Set();
|
|
813
|
+
for (const match of value.matchAll(/\$\{(\w+)\}|\$env:(\w+)|\{env:(\w+)\}/g)) {
|
|
814
|
+
const name = match[1] ?? match[2] ?? match[3];
|
|
815
|
+
if (name && process.env[name] === void 0) missing.add(name);
|
|
816
|
+
}
|
|
817
|
+
return [...missing];
|
|
818
|
+
}
|
|
819
|
+
function resolveServerUrl(definition) {
|
|
820
|
+
if (definition.url == null) return void 0;
|
|
821
|
+
if (typeof definition.url !== "string") throw new Error("MCP server URL must be a string");
|
|
822
|
+
const missing = getMissingEnvVars(definition.url);
|
|
823
|
+
if (missing.length > 0) {
|
|
824
|
+
throw new Error(`Missing environment variable${missing.length === 1 ? "" : "s"} in MCP server URL: ${missing.join(", ")}`);
|
|
825
|
+
}
|
|
826
|
+
const resolved = interpolateEnvVars(definition.url);
|
|
827
|
+
try {
|
|
828
|
+
new URL(resolved);
|
|
829
|
+
} catch (error) {
|
|
830
|
+
throw new Error(`Invalid MCP server URL after environment interpolation: ${resolved}`, { cause: error });
|
|
831
|
+
}
|
|
832
|
+
return resolved;
|
|
833
|
+
}
|
|
834
|
+
function resolveConfigPath(value) {
|
|
835
|
+
if (value === void 0) return void 0;
|
|
836
|
+
const resolved = interpolateEnvVars(value);
|
|
837
|
+
if (resolved === "~") return os2.homedir();
|
|
838
|
+
if (resolved.startsWith("~/") || resolved.startsWith("~\\")) return path2.join(os2.homedir(), resolved.slice(2));
|
|
839
|
+
return resolved;
|
|
840
|
+
}
|
|
841
|
+
function resolveBearerToken(definition) {
|
|
842
|
+
if (definition.bearerToken !== void 0) return interpolateSecretExpression(definition.bearerToken);
|
|
843
|
+
return definition.bearerTokenEnv ? process.env[definition.bearerTokenEnv] : void 0;
|
|
844
|
+
}
|
|
845
|
+
function stableStringify(value) {
|
|
846
|
+
if (value === null || value === void 0 || typeof value !== "object") {
|
|
847
|
+
const serialized = JSON.stringify(value);
|
|
848
|
+
return serialized === void 0 ? "undefined" : serialized;
|
|
849
|
+
}
|
|
850
|
+
if (Array.isArray(value)) return `[${value.map((entry) => stableStringify(entry)).join(",")}]`;
|
|
851
|
+
const obj = value;
|
|
852
|
+
return `{${Object.keys(obj).sort().map((key) => `${JSON.stringify(key)}:${stableStringify(obj[key])}`).join(",")}}`;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
// src/shared/runtime-module-path.ts
|
|
856
|
+
import * as fs3 from "node:fs";
|
|
857
|
+
import * as path3 from "node:path";
|
|
858
|
+
var RUNTIME_MODULE_EXTENSIONS = [".js", ".ts"];
|
|
859
|
+
function resolveRuntimeModuleExtension(dir, basename) {
|
|
860
|
+
return RUNTIME_MODULE_EXTENSIONS.find((extension) => fs3.existsSync(path3.join(dir, `${basename}${extension}`))) ?? ".js";
|
|
861
|
+
}
|
|
862
|
+
function resolveRuntimeModulePath(dir, basename) {
|
|
863
|
+
return path3.normalize(path3.join(dir, `${basename}${resolveRuntimeModuleExtension(dir, basename)}`));
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
// src/runs/shared/child-tool-plan.ts
|
|
867
|
+
var MAX_LAUNCH_RESOLVED_EXTENSION_IDS = 32;
|
|
868
|
+
var RUNTIME_EXTENSION_DIR = path4.dirname(fileURLToPath(new URL("../src/runs/shared/child-tool-plan.js", import.meta.url).href));
|
|
869
|
+
var FANOUT_CHILD_EXTENSION_DIR = path4.join(RUNTIME_EXTENSION_DIR, "..", "..", "extension");
|
|
870
|
+
var SUBAGENT_RUNTIME_EXTENSION_PATHS = new Set([
|
|
871
|
+
path4.join(RUNTIME_EXTENSION_DIR, "subagent-prompt-runtime"),
|
|
872
|
+
path4.join(RUNTIME_EXTENSION_DIR, "fast-mode-extension"),
|
|
873
|
+
path4.join(FANOUT_CHILD_EXTENSION_DIR, "fanout-child")
|
|
874
|
+
].flatMap((base) => RUNTIME_MODULE_EXTENSIONS.map((extension) => path4.normalize(`${base}${extension}`))));
|
|
875
|
+
function isSubagentRuntimeExtensionPath(extensionPath) {
|
|
876
|
+
return SUBAGENT_RUNTIME_EXTENSION_PATHS.has(path4.normalize(extensionPath));
|
|
877
|
+
}
|
|
878
|
+
var FAST_MODE_PROVIDER_PREFIX = "openai-codex/";
|
|
879
|
+
var OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH = 64;
|
|
880
|
+
function deriveForkPromptCacheKey(parentSessionId) {
|
|
881
|
+
const parent = parentSessionId?.trim();
|
|
882
|
+
if (!parent) return void 0;
|
|
883
|
+
const digest = createHash2("sha256").update(parent).digest("hex").slice(0, OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH - "pi-fork:".length);
|
|
884
|
+
return `pi-fork:${digest}`;
|
|
885
|
+
}
|
|
886
|
+
function sanitizeSupervisorChannelSegment(value) {
|
|
887
|
+
return value.trim().replace(/[^A-Za-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "unknown";
|
|
888
|
+
}
|
|
889
|
+
function supervisorChannelDir(runId, agent, childIndex) {
|
|
890
|
+
return path4.join(
|
|
891
|
+
TEMP_ROOT_DIR,
|
|
892
|
+
"supervisor-channels",
|
|
893
|
+
`${sanitizeSupervisorChannelSegment(runId)}-${sanitizeSupervisorChannelSegment(agent)}-${childIndex}`
|
|
894
|
+
);
|
|
895
|
+
}
|
|
896
|
+
function applyThinkingSuffix(model, thinking, replaceExisting = false) {
|
|
897
|
+
if (!model || !thinking) return model;
|
|
898
|
+
const colonIdx = model.lastIndexOf(":");
|
|
899
|
+
if (colonIdx !== -1 && THINKING_LEVELS.some((level) => level === model.substring(colonIdx + 1))) {
|
|
900
|
+
return replaceExisting ? `${model.slice(0, colonIdx)}:${thinking}` : model;
|
|
901
|
+
}
|
|
902
|
+
return `${model}:${thinking}`;
|
|
903
|
+
}
|
|
904
|
+
function stripThinkingSuffix(model) {
|
|
905
|
+
const colonIdx = model.lastIndexOf(":");
|
|
906
|
+
if (colonIdx === -1) return model;
|
|
907
|
+
return THINKING_LEVELS.some((level) => level === model.substring(colonIdx + 1)) ? model.slice(0, colonIdx) : model;
|
|
908
|
+
}
|
|
909
|
+
function resolveFastModeExtension(input) {
|
|
910
|
+
if (!input.fast) return [];
|
|
911
|
+
const candidates = (input.model ? [input.model] : []).map(stripThinkingSuffix);
|
|
912
|
+
if (candidates.length === 0) {
|
|
913
|
+
throw new Error(`fast mode requires an explicit supported native OpenAI-Codex model${input.agentName ? ` for agent '${input.agentName}'` : ""}.`);
|
|
914
|
+
}
|
|
915
|
+
const unsupported = candidates.filter((model) => !model.startsWith(FAST_MODE_PROVIDER_PREFIX));
|
|
916
|
+
if (unsupported.length > 0) {
|
|
917
|
+
throw new Error(`fast mode supports only native ${FAST_MODE_PROVIDER_PREFIX}* models; unsupported model${unsupported.length === 1 ? "" : "s"}: ${unsupported.join(", ")}.`);
|
|
918
|
+
}
|
|
919
|
+
return [resolveRuntimeModulePath(RUNTIME_EXTENSION_DIR, "fast-mode-extension")];
|
|
920
|
+
}
|
|
921
|
+
function extensionIdentifier(value) {
|
|
922
|
+
return `sha256:${createHash2("sha256").update(path4.normalize(value.trim())).digest("hex").slice(0, 16)}`;
|
|
923
|
+
}
|
|
924
|
+
function boundedExtensionIdentifiers(values) {
|
|
925
|
+
const ids = [...new Set(values.map(extensionIdentifier))];
|
|
926
|
+
return {
|
|
927
|
+
ids: ids.slice(0, MAX_LAUNCH_RESOLVED_EXTENSION_IDS),
|
|
928
|
+
omitted: Math.max(0, ids.length - MAX_LAUNCH_RESOLVED_EXTENSION_IDS)
|
|
929
|
+
};
|
|
930
|
+
}
|
|
931
|
+
function hasPermissionRules(rules) {
|
|
932
|
+
return rules !== void 0 && Object.keys(rules).length > 0;
|
|
933
|
+
}
|
|
934
|
+
function formatRuntimeSnapshotMcpServersError(agentName, serverNames) {
|
|
935
|
+
const subject = agentName ? `Agent '${agentName}'` : "Subagent";
|
|
936
|
+
return `${subject} selects MCP tools from servers that exist only in pi-mcp-adapter's runtime snapshot (${serverNames.join(", ")}). MCP servers from the runtime snapshot cannot be provided to in-process children; MCP tools must come from an ambient adapter extension in a background child (\`async: true\`), so add the server to the adapter's configuration file instead.`;
|
|
937
|
+
}
|
|
938
|
+
function projectLaunchResolvedChildExtensions(toolPlan) {
|
|
939
|
+
const runtime = boundedExtensionIdentifiers(toolPlan.runtimeExtensions);
|
|
940
|
+
const configured = boundedExtensionIdentifiers(toolPlan.configuredExtensions);
|
|
941
|
+
const effective = boundedExtensionIdentifiers(toolPlan.extensionArgs);
|
|
942
|
+
return {
|
|
943
|
+
version: 1,
|
|
944
|
+
source: "launch-resolved",
|
|
945
|
+
disableAmbientExtensions: toolPlan.disableAmbientExtensions,
|
|
946
|
+
runtime: runtime.ids,
|
|
947
|
+
configured: configured.ids,
|
|
948
|
+
required: toolPlan.requiredExtensions.map(({ id }) => id),
|
|
949
|
+
effective: effective.ids,
|
|
950
|
+
omitted: {
|
|
951
|
+
runtime: runtime.omitted,
|
|
952
|
+
configured: configured.omitted,
|
|
953
|
+
required: 0,
|
|
954
|
+
effective: effective.omitted
|
|
955
|
+
}
|
|
956
|
+
};
|
|
957
|
+
}
|
|
958
|
+
function resolvePermissionSystemExtension() {
|
|
959
|
+
const agentDir = getAgentDir();
|
|
960
|
+
const candidates = [
|
|
961
|
+
// npm-scoped package (most common)
|
|
962
|
+
path4.join(
|
|
963
|
+
agentDir,
|
|
964
|
+
"npm",
|
|
965
|
+
"node_modules",
|
|
966
|
+
"@gotgenes",
|
|
967
|
+
"pi-permission-system"
|
|
968
|
+
),
|
|
969
|
+
// direct extension directory (some layouts)
|
|
970
|
+
path4.join(agentDir, "extensions", "pi-permission-system")
|
|
971
|
+
];
|
|
972
|
+
const errors = [];
|
|
973
|
+
for (const extDir of candidates) {
|
|
974
|
+
if (!fs4.existsSync(extDir)) continue;
|
|
975
|
+
const pkgPath = path4.join(extDir, "package.json");
|
|
976
|
+
if (!fs4.existsSync(pkgPath)) {
|
|
977
|
+
errors.push(new Error(`Permission-system package manifest is missing at ${pkgPath}.`));
|
|
978
|
+
continue;
|
|
979
|
+
}
|
|
980
|
+
try {
|
|
981
|
+
let pkg;
|
|
982
|
+
const parsed = JSON.parse(fs4.readFileSync(pkgPath, "utf-8"));
|
|
983
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
984
|
+
throw new Error("manifest root must be an object");
|
|
985
|
+
}
|
|
986
|
+
pkg = parsed;
|
|
987
|
+
const extensions = pkg.pi?.extensions;
|
|
988
|
+
const entry = Array.isArray(extensions) ? extensions[0] : void 0;
|
|
989
|
+
if (typeof entry !== "string" || !entry.trim()) {
|
|
990
|
+
throw new Error(
|
|
991
|
+
`Permission-system package manifest at ${pkgPath} must declare pi.extensions[0] as a non-empty string.`
|
|
992
|
+
);
|
|
993
|
+
}
|
|
994
|
+
const resolved = path4.resolve(extDir, entry);
|
|
995
|
+
if (fs4.existsSync(resolved)) return resolved;
|
|
996
|
+
throw new Error(
|
|
997
|
+
`Permission-system extension entry ${JSON.stringify(entry)} in ${pkgPath} does not exist at ${resolved}.`
|
|
998
|
+
);
|
|
999
|
+
} catch (error) {
|
|
1000
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1001
|
+
errors.push(message.startsWith("Permission-system") ? new Error(message) : new Error(`Cannot read permission-system package manifest at ${pkgPath}: ${message}`));
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
if (errors.length > 0) throw errors[0];
|
|
1005
|
+
return void 0;
|
|
1006
|
+
}
|
|
1007
|
+
function resolvePiLaunchToolPlan(input) {
|
|
1008
|
+
const capabilityCeiling = intersectSubagentCapabilityCeilings(
|
|
1009
|
+
input.capabilityCeiling,
|
|
1010
|
+
input.inheritedCapabilityCeiling
|
|
1011
|
+
);
|
|
1012
|
+
const requiredExtensions = snapshotRequiredChildExtensions(input.requiredExtensions ?? []);
|
|
1013
|
+
if (requiredExtensions.length > 0 && capabilityCeiling?.denyExtensions) {
|
|
1014
|
+
throw new Error(`Capability ceiling from ${capabilityCeiling.sources.join(", ") || "unknown source"} denies extensions but this host requires: ${requiredExtensions.map(({ id }) => id).join(", ")}.`);
|
|
1015
|
+
}
|
|
1016
|
+
const allowedToolSet = capabilityCeiling?.allowedTools === void 0 ? void 0 : new Set(capabilityCeiling.allowedTools);
|
|
1017
|
+
const requestedBuiltinTools = input.tools?.filter(
|
|
1018
|
+
(tool) => !(tool.includes("/") || tool.endsWith(".ts") || tool.endsWith(".js"))
|
|
1019
|
+
) ?? [];
|
|
1020
|
+
if (input.requireReadTool && allowedToolSet && !allowedToolSet.has("read")) {
|
|
1021
|
+
throw new Error(
|
|
1022
|
+
`Capability ceiling from ${capabilityCeiling?.sources.join(", ") || "unknown source"} excludes required tool 'read' for lazy skill loading.`
|
|
1023
|
+
);
|
|
1024
|
+
}
|
|
1025
|
+
const ceilingFilteredBuiltinTools = input.tools === void 0 ? allowedToolSet ? [...allowedToolSet].filter((tool) => tool !== "subagent_command") : [] : (input.requireReadTool && requestedBuiltinTools.length > 0 && !requestedBuiltinTools.includes("read") && !allowedToolSet ? ["read", ...requestedBuiltinTools] : requestedBuiltinTools).filter((tool) => !allowedToolSet || allowedToolSet.has(tool));
|
|
1026
|
+
const declaredBuiltinTools = ceilingFilteredBuiltinTools;
|
|
1027
|
+
const excludeTools = [...new Set((input.excludeTools ?? []).map((tool) => tool.trim()).filter(Boolean))];
|
|
1028
|
+
const excludedToolSet = new Set(excludeTools);
|
|
1029
|
+
const effectiveDeclaredBuiltinTools = declaredBuiltinTools.filter((tool) => !excludedToolSet.has(tool));
|
|
1030
|
+
const fanoutAuthorized = effectiveDeclaredBuiltinTools.includes("subagent") || input.allowNestedSubagents === true && !excludedToolSet.has("subagent") && (!allowedToolSet || allowedToolSet.has("subagent"));
|
|
1031
|
+
if (effectiveDeclaredBuiltinTools.includes("subagent_supervisor") && !fanoutAuthorized) {
|
|
1032
|
+
throw new Error("Tool 'subagent_supervisor' requires fanout authorization: include 'subagent' in the effective tools allowlist or enable allowNestedSubagents.");
|
|
1033
|
+
}
|
|
1034
|
+
const toolExtensionPaths = capabilityCeiling?.denyExtensions ? [] : (input.tools ?? []).filter(
|
|
1035
|
+
(tool) => !requestedBuiltinTools.includes(tool) && (tool.includes("/") || tool.endsWith(".ts") || tool.endsWith(".js"))
|
|
1036
|
+
);
|
|
1037
|
+
const mcpResolution = capabilityCeiling?.denyExtensions ? { selections: [], unresolvedSelectors: [] } : input.builtinMcpTools ? { selections: input.builtinMcpTools, unresolvedSelectors: [], builtin: true } : resolveMcpDirectToolResolution(input.mcpDirectTools, input.cwd, input.runtimeSnapshotHost);
|
|
1038
|
+
if (mcpResolution.runtimeServerNames?.length) {
|
|
1039
|
+
throw new Error(formatRuntimeSnapshotMcpServersError(input.agentName, mcpResolution.runtimeServerNames));
|
|
1040
|
+
}
|
|
1041
|
+
if (mcpResolution.unresolvedSelectors.length > 0) {
|
|
1042
|
+
throw new Error(mcpResolution.builtin ? formatUnresolvedBuiltinMcpSelectors(input.agentName, mcpResolution.unresolvedSelectors) : formatUnresolvedMcpDirectToolSelectors(mcpResolution.unresolvedSelectors));
|
|
1043
|
+
}
|
|
1044
|
+
const resolvedMcpSelections = mcpResolution.selections;
|
|
1045
|
+
const resolvedMcpNames = new Set(resolvedMcpSelections.map((selection) => selection.name));
|
|
1046
|
+
const legacyMcpNameCounts = mcpResolution.builtin ? /* @__PURE__ */ new Map() : countLegacyUnderscoreMcpToolNames(resolvedMcpSelections);
|
|
1047
|
+
const effectiveMcpSelections = resolvedMcpSelections.filter(
|
|
1048
|
+
(selection) => !allowedToolSet || allowedToolSet.has(selection.name) || isLegacyUnderscoreMcpToolAllowed(selection, allowedToolSet, resolvedMcpNames, legacyMcpNameCounts)
|
|
1049
|
+
).filter((selection) => !excludedToolSet.has(selection.name));
|
|
1050
|
+
const effectiveMcpTools = effectiveMcpSelections.map(
|
|
1051
|
+
(selection) => selection.name
|
|
1052
|
+
);
|
|
1053
|
+
const builtinMcpTools = mcpResolution.builtin ? effectiveMcpSelections : void 0;
|
|
1054
|
+
const explicitToolAllowlist = input.tools !== void 0 || (input.mcpDirectTools?.length ?? 0) > 0 || allowedToolSet !== void 0;
|
|
1055
|
+
const internalTools = (input.structuredOutput ? ["structured_output"] : []).filter((tool) => !excludedToolSet.has(tool));
|
|
1056
|
+
const effectiveToolAllowlist = [
|
|
1057
|
+
.../* @__PURE__ */ new Set([
|
|
1058
|
+
...effectiveDeclaredBuiltinTools,
|
|
1059
|
+
...effectiveMcpTools,
|
|
1060
|
+
...internalTools
|
|
1061
|
+
])
|
|
1062
|
+
];
|
|
1063
|
+
const legacySupervisorPairing = effectiveDeclaredBuiltinTools.includes("contact_supervisor");
|
|
1064
|
+
const requiredChildTools = explicitToolAllowlist ? [
|
|
1065
|
+
...new Set([
|
|
1066
|
+
...input.tools !== void 0 ? effectiveDeclaredBuiltinTools : [],
|
|
1067
|
+
...input.mcpDirectTools?.length ? effectiveMcpTools : [],
|
|
1068
|
+
...internalTools
|
|
1069
|
+
].filter((tool) => tool !== "contact_supervisor" && (!legacySupervisorPairing || tool !== "intercom")))
|
|
1070
|
+
] : [];
|
|
1071
|
+
const permSystemExt = capabilityCeiling?.denyExtensions ? void 0 : hasPermissionRules(input.permissionRules) ? resolvePermissionSystemExtension() : void 0;
|
|
1072
|
+
if (input.fast && capabilityCeiling?.denyExtensions) throw new Error("fast mode requires a child runtime extension, but this launch denies extensions.");
|
|
1073
|
+
const fastModeExtensions = resolveFastModeExtension({ fast: input.fast, model: input.model, agentName: input.agentName });
|
|
1074
|
+
const runtimeExtensions = [
|
|
1075
|
+
resolveRuntimeModulePath(RUNTIME_EXTENSION_DIR, "subagent-prompt-runtime"),
|
|
1076
|
+
...fastModeExtensions,
|
|
1077
|
+
...fanoutAuthorized ? [resolveRuntimeModulePath(FANOUT_CHILD_EXTENSION_DIR, "fanout-child")] : [],
|
|
1078
|
+
...permSystemExt ? [permSystemExt] : []
|
|
1079
|
+
];
|
|
1080
|
+
const disableAmbientExtensions = capabilityCeiling?.denyExtensions === true || input.extensions !== void 0;
|
|
1081
|
+
const warnings = [];
|
|
1082
|
+
if (capabilityCeiling?.denyExtensions !== true && Array.isArray(input.extensions) && input.extensions.length === 0) {
|
|
1083
|
+
const agentLabel = input.agentName ? ` for agent '${input.agentName}'` : "";
|
|
1084
|
+
warnings.push(
|
|
1085
|
+
`extensions: [] override${agentLabel} disables ALL ambient extensions for this child (not just "adds nothing"), including any model-provider extension needed to resolve a provider-qualified model. List the extensions this child actually needs instead of an empty array.`
|
|
1086
|
+
);
|
|
1087
|
+
}
|
|
1088
|
+
const configuredExtensions = capabilityCeiling?.denyExtensions ? [] : [
|
|
1089
|
+
...toolExtensionPaths,
|
|
1090
|
+
...input.extensions ?? [],
|
|
1091
|
+
...input.subagentOnlyExtensions ?? []
|
|
1092
|
+
];
|
|
1093
|
+
const ordinaryExtensionArgs = disableAmbientExtensions ? [.../* @__PURE__ */ new Set([...runtimeExtensions, ...configuredExtensions])] : [
|
|
1094
|
+
.../* @__PURE__ */ new Set([
|
|
1095
|
+
...runtimeExtensions,
|
|
1096
|
+
...toolExtensionPaths,
|
|
1097
|
+
...input.subagentOnlyExtensions ?? []
|
|
1098
|
+
])
|
|
1099
|
+
];
|
|
1100
|
+
const extensionArgs = [.../* @__PURE__ */ new Set([...ordinaryExtensionArgs, ...requiredExtensions.map(({ path: path5 }) => path5)])];
|
|
1101
|
+
const requestedToolNames = input.tools !== void 0 ? [
|
|
1102
|
+
.../* @__PURE__ */ new Set([
|
|
1103
|
+
...requestedBuiltinTools,
|
|
1104
|
+
...resolvedMcpSelections.map((selection) => selection.name)
|
|
1105
|
+
])
|
|
1106
|
+
] : void 0;
|
|
1107
|
+
const capabilityAudit = capabilityCeiling ? {
|
|
1108
|
+
ceiling: capabilityCeiling,
|
|
1109
|
+
...requestedToolNames ? { requestedTools: requestedToolNames } : {},
|
|
1110
|
+
effectiveTools: effectiveToolAllowlist,
|
|
1111
|
+
...excludeTools.length > 0 ? { excludeTools } : {},
|
|
1112
|
+
removedTools: requestedToolNames?.filter(
|
|
1113
|
+
(tool) => !effectiveToolAllowlist.includes(tool)
|
|
1114
|
+
) ?? [],
|
|
1115
|
+
internalTools,
|
|
1116
|
+
extensionsDenied: capabilityCeiling.denyExtensions,
|
|
1117
|
+
removedExtensionCount: capabilityCeiling.denyExtensions ? (input.extensions?.length ?? 0) + (input.subagentOnlyExtensions?.length ?? 0) + (input.tools ?? []).filter(
|
|
1118
|
+
(tool) => tool.includes("/") || tool.endsWith(".ts") || tool.endsWith(".js")
|
|
1119
|
+
).length : 0,
|
|
1120
|
+
requestedMcpToolCount: input.mcpDirectTools?.length ?? 0,
|
|
1121
|
+
effectiveMcpTools,
|
|
1122
|
+
agentAllowed: input.agentName === void 0 ? true : isAgentAllowedByCapabilityCeiling(
|
|
1123
|
+
input.agentName,
|
|
1124
|
+
capabilityCeiling
|
|
1125
|
+
),
|
|
1126
|
+
...capabilityCeilingAgentRestrictionSources(capabilityCeiling) ? {
|
|
1127
|
+
agentRestrictionSources: capabilityCeilingAgentRestrictionSources(capabilityCeiling)
|
|
1128
|
+
} : {}
|
|
1129
|
+
} : void 0;
|
|
1130
|
+
return {
|
|
1131
|
+
...capabilityCeiling ? { capabilityCeiling } : {},
|
|
1132
|
+
requestedBuiltinTools,
|
|
1133
|
+
declaredBuiltinTools,
|
|
1134
|
+
excludeTools,
|
|
1135
|
+
toolExtensionPaths,
|
|
1136
|
+
resolvedMcpSelections,
|
|
1137
|
+
effectiveMcpSelections,
|
|
1138
|
+
effectiveMcpTools,
|
|
1139
|
+
builtinMcpTools,
|
|
1140
|
+
explicitToolAllowlist,
|
|
1141
|
+
internalTools,
|
|
1142
|
+
effectiveToolAllowlist,
|
|
1143
|
+
requiredChildTools,
|
|
1144
|
+
fanoutAuthorized,
|
|
1145
|
+
runtimeExtensions,
|
|
1146
|
+
configuredExtensions,
|
|
1147
|
+
requiredExtensions,
|
|
1148
|
+
extensionArgs,
|
|
1149
|
+
disableAmbientExtensions,
|
|
1150
|
+
warnings,
|
|
1151
|
+
...capabilityAudit ? { capabilityAudit } : {}
|
|
1152
|
+
};
|
|
1153
|
+
}
|
|
1154
|
+
function countLegacyUnderscoreMcpToolNames(selections) {
|
|
1155
|
+
const counts = /* @__PURE__ */ new Map();
|
|
1156
|
+
for (const selection of selections) {
|
|
1157
|
+
const legacyName = legacyUnderscoreMcpToolName(selection);
|
|
1158
|
+
if (legacyName !== selection.name) counts.set(legacyName, (counts.get(legacyName) ?? 0) + 1);
|
|
1159
|
+
}
|
|
1160
|
+
return counts;
|
|
1161
|
+
}
|
|
1162
|
+
function isLegacyUnderscoreMcpToolAllowed(selection, allowedToolSet, resolvedMcpNames, legacyMcpNameCounts) {
|
|
1163
|
+
const legacyName = legacyUnderscoreMcpToolName(selection);
|
|
1164
|
+
return legacyMcpNameCounts.get(legacyName) === 1 && !resolvedMcpNames.has(legacyName) && allowedToolSet.has(legacyName);
|
|
1165
|
+
}
|
|
1166
|
+
function legacyUnderscoreMcpToolName(selection) {
|
|
1167
|
+
const slash = selection.selector.indexOf("/");
|
|
1168
|
+
if (slash < 1) return selection.name;
|
|
1169
|
+
const toolName = selection.selector.slice(slash + 1);
|
|
1170
|
+
const suffix = `_${toolName}`;
|
|
1171
|
+
if (!selection.name.endsWith(suffix)) return selection.name;
|
|
1172
|
+
const prefix = selection.name.slice(0, -suffix.length);
|
|
1173
|
+
return `${prefix.replace(/-/g, "_")}${suffix}`;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
export {
|
|
1177
|
+
extensionOnlyMcpServers,
|
|
1178
|
+
resolveRuntimeModulePath,
|
|
1179
|
+
isSubagentRuntimeExtensionPath,
|
|
1180
|
+
deriveForkPromptCacheKey,
|
|
1181
|
+
supervisorChannelDir,
|
|
1182
|
+
applyThinkingSuffix,
|
|
1183
|
+
projectLaunchResolvedChildExtensions,
|
|
1184
|
+
resolvePiLaunchToolPlan
|
|
1185
|
+
};
|