@with-logic/elwood 0.2.0 → 0.2.2
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 +571 -1
- package/CONTRIBUTING.md +3 -0
- package/README.md +6 -2
- package/dist/bridge/socket-release.d.ts +15 -0
- package/dist/bridge/socket-release.d.ts.map +1 -0
- package/dist/bridge/socket-release.js +22 -0
- package/dist/bridge/socket-release.js.map +1 -0
- package/dist/claude/composer/border.d.ts +12 -0
- package/dist/claude/composer/border.d.ts.map +1 -0
- package/dist/claude/composer/border.js +12 -0
- package/dist/claude/composer/border.js.map +1 -0
- package/dist/claude/composer/empty-input.d.ts +15 -0
- package/dist/claude/composer/empty-input.d.ts.map +1 -1
- package/dist/claude/composer/empty-input.js +30 -11
- package/dist/claude/composer/empty-input.js.map +1 -1
- package/dist/claude/composer/footer.d.ts +26 -2
- package/dist/claude/composer/footer.d.ts.map +1 -1
- package/dist/claude/composer/footer.js +29 -2
- package/dist/claude/composer/footer.js.map +1 -1
- package/dist/claude/composer/idle.d.ts +14 -0
- package/dist/claude/composer/idle.d.ts.map +1 -0
- package/dist/claude/composer/idle.js +17 -0
- package/dist/claude/composer/idle.js.map +1 -0
- package/dist/claude/composer/last.d.ts +2 -0
- package/dist/claude/composer/last.d.ts.map +1 -0
- package/dist/claude/composer/last.js +15 -0
- package/dist/claude/composer/last.js.map +1 -0
- package/dist/claude/composer/staged-input.d.ts.map +1 -1
- package/dist/claude/composer/staged-input.js +2 -1
- package/dist/claude/composer/staged-input.js.map +1 -1
- package/dist/claude/hooks/stop-failure.d.ts +15 -2
- package/dist/claude/hooks/stop-failure.d.ts.map +1 -1
- package/dist/claude/hooks/stop-failure.js +32 -9
- package/dist/claude/hooks/stop-failure.js.map +1 -1
- package/dist/claude/login/stages.d.ts.map +1 -1
- package/dist/claude/login/stages.js +2 -2
- package/dist/claude/login/stages.js.map +1 -1
- package/dist/claude/model-picker.d.ts +1 -1
- package/dist/claude/model-picker.d.ts.map +1 -1
- package/dist/claude/model-picker.js +27 -10
- package/dist/claude/model-picker.js.map +1 -1
- package/dist/claude/preflight.d.ts +1 -1
- package/dist/claude/preflight.d.ts.map +1 -1
- package/dist/claude/preflight.js +18 -12
- package/dist/claude/preflight.js.map +1 -1
- package/dist/claude/questions/navigation.d.ts.map +1 -1
- package/dist/claude/questions/navigation.js +1 -2
- package/dist/claude/questions/navigation.js.map +1 -1
- package/dist/claude/questions/screen.d.ts.map +1 -1
- package/dist/claude/questions/screen.js +10 -2
- package/dist/claude/questions/screen.js.map +1 -1
- package/dist/claude/screen-table.d.ts +8 -5
- package/dist/claude/screen-table.d.ts.map +1 -1
- package/dist/claude/screen-table.js +20 -12
- package/dist/claude/screen-table.js.map +1 -1
- package/dist/claude/session/bridge.d.ts +2 -1
- package/dist/claude/session/bridge.d.ts.map +1 -1
- package/dist/claude/session/bridge.js +3 -1
- package/dist/claude/session/bridge.js.map +1 -1
- package/dist/claude/session/build.d.ts.map +1 -1
- package/dist/claude/session/build.js +13 -11
- package/dist/claude/session/build.js.map +1 -1
- package/dist/claude/session/cleanup.d.ts +18 -0
- package/dist/claude/session/cleanup.d.ts.map +1 -0
- package/dist/claude/session/cleanup.js +10 -0
- package/dist/claude/session/cleanup.js.map +1 -0
- package/dist/claude/session/index.d.ts.map +1 -1
- package/dist/claude/session/index.js +27 -13
- package/dist/claude/session/index.js.map +1 -1
- package/dist/claude/session/instance.d.ts +7 -8
- package/dist/claude/session/instance.d.ts.map +1 -1
- package/dist/claude/session/instance.js +9 -13
- package/dist/claude/session/instance.js.map +1 -1
- package/dist/claude/session/resume.d.ts.map +1 -1
- package/dist/claude/session/resume.js +14 -5
- package/dist/claude/session/resume.js.map +1 -1
- package/dist/claude/session/transcript.js +2 -2
- package/dist/claude/session/transcript.js.map +1 -1
- package/dist/claude/simple.d.ts +1 -1
- package/dist/claude/simple.d.ts.map +1 -1
- package/dist/claude/simple.js +3 -3
- package/dist/claude/simple.js.map +1 -1
- package/dist/claude/startup-prompts.d.ts +2 -0
- package/dist/claude/startup-prompts.d.ts.map +1 -1
- package/dist/claude/startup-prompts.js +5 -1
- package/dist/claude/startup-prompts.js.map +1 -1
- package/dist/claude/transcript/cursor-io.d.ts +1 -1
- package/dist/claude/transcript/cursor-io.d.ts.map +1 -1
- package/dist/claude/transcript/cursor-io.js +1 -1
- package/dist/claude/transcript/cursor-io.js.map +1 -1
- package/dist/claude/transcript/cursor.d.ts +5 -3
- package/dist/claude/transcript/cursor.d.ts.map +1 -1
- package/dist/claude/transcript/cursor.js +18 -8
- package/dist/claude/transcript/cursor.js.map +1 -1
- package/dist/claude/transcript/drain-context.d.ts +4 -3
- package/dist/claude/transcript/drain-context.d.ts.map +1 -1
- package/dist/claude/transcript/drain-context.js.map +1 -1
- package/dist/claude/transcript/emit.d.ts +2 -1
- package/dist/claude/transcript/emit.d.ts.map +1 -1
- package/dist/claude/transcript/emit.js +1 -0
- package/dist/claude/transcript/emit.js.map +1 -1
- package/dist/claude/transcript/index.d.ts.map +1 -1
- package/dist/claude/transcript/index.js +2 -2
- package/dist/claude/transcript/index.js.map +1 -1
- package/dist/claude/transcript/warnings.d.ts +2 -1
- package/dist/claude/transcript/warnings.d.ts.map +1 -1
- package/dist/claude/transcript/warnings.js +3 -2
- package/dist/claude/transcript/warnings.js.map +1 -1
- package/dist/cli/config/effective.d.ts +2 -2
- package/dist/cli/config/effective.d.ts.map +1 -1
- package/dist/cli/config/effective.js +0 -2
- package/dist/cli/config/effective.js.map +1 -1
- package/dist/cli/interactive/spawn.d.ts +0 -2
- package/dist/cli/interactive/spawn.d.ts.map +1 -1
- package/dist/cli/interactive/spawn.js +27 -24
- package/dist/cli/interactive/spawn.js.map +1 -1
- package/dist/cli/lifecycle/index.d.ts.map +1 -1
- package/dist/cli/lifecycle/index.js +5 -3
- package/dist/cli/lifecycle/index.js.map +1 -1
- package/dist/cli/main-failure.d.ts.map +1 -1
- package/dist/cli/main-failure.js +5 -2
- package/dist/cli/main-failure.js.map +1 -1
- package/dist/cli/models/combined.d.ts.map +1 -1
- package/dist/cli/models/combined.js +3 -2
- package/dist/cli/models/combined.js.map +1 -1
- package/dist/cli/models/render.d.ts.map +1 -1
- package/dist/cli/models/render.js +2 -1
- package/dist/cli/models/render.js.map +1 -1
- package/dist/cli/output/cleanup-error.d.ts +22 -0
- package/dist/cli/output/cleanup-error.d.ts.map +1 -0
- package/dist/cli/output/cleanup-error.js +67 -0
- package/dist/cli/output/cleanup-error.js.map +1 -0
- package/dist/cli/output/types.d.ts +6 -2
- package/dist/cli/output/types.d.ts.map +1 -1
- package/dist/cli/request/agent-detect.d.ts +6 -2
- package/dist/cli/request/agent-detect.d.ts.map +1 -1
- package/dist/cli/request/agent-detect.js +14 -6
- package/dist/cli/request/agent-detect.js.map +1 -1
- package/dist/cli/request/finalize.d.ts +1 -1
- package/dist/cli/request/finalize.d.ts.map +1 -1
- package/dist/cli/request/finalize.js +4 -25
- package/dist/cli/request/finalize.js.map +1 -1
- package/dist/cli/request/index.d.ts.map +1 -1
- package/dist/cli/request/index.js +11 -5
- package/dist/cli/request/index.js.map +1 -1
- package/dist/cli/request/path-replacement.d.ts +27 -0
- package/dist/cli/request/path-replacement.d.ts.map +1 -0
- package/dist/cli/request/path-replacement.js +79 -0
- package/dist/cli/request/path-replacement.js.map +1 -0
- package/dist/cli/request/workspace.d.ts +8 -0
- package/dist/cli/request/workspace.d.ts.map +1 -0
- package/dist/cli/request/workspace.js +50 -0
- package/dist/cli/request/workspace.js.map +1 -0
- package/dist/cli/run/output.d.ts.map +1 -1
- package/dist/cli/run/output.js +2 -1
- package/dist/cli/run/output.js.map +1 -1
- package/dist/cli/run/subscribe.d.ts.map +1 -1
- package/dist/cli/run/subscribe.js +1 -1
- package/dist/cli/run/subscribe.js.map +1 -1
- package/dist/cli/session/index.d.ts +4 -4
- package/dist/cli/session/index.d.ts.map +1 -1
- package/dist/cli/session/index.js +5 -5
- package/dist/cli/session/index.js.map +1 -1
- package/dist/cli/session/launch.d.ts +2 -2
- package/dist/cli/session/launch.d.ts.map +1 -1
- package/dist/cli/session/launch.js +12 -3
- package/dist/cli/session/launch.js.map +1 -1
- package/dist/cli/session/turn-readers.d.ts +14 -0
- package/dist/cli/session/turn-readers.d.ts.map +1 -0
- package/dist/cli/session/turn-readers.js +13 -0
- package/dist/cli/session/turn-readers.js.map +1 -0
- package/dist/codex/config/default-model.d.ts +24 -0
- package/dist/codex/config/default-model.d.ts.map +1 -0
- package/dist/codex/config/default-model.js +133 -0
- package/dist/codex/config/default-model.js.map +1 -0
- package/dist/codex/config/home.d.ts +35 -0
- package/dist/codex/config/home.d.ts.map +1 -0
- package/dist/codex/config/home.js +122 -0
- package/dist/codex/config/home.js.map +1 -0
- package/dist/codex/config/lock.d.ts +17 -11
- package/dist/codex/config/lock.d.ts.map +1 -1
- package/dist/codex/config/lock.js +102 -11
- package/dist/codex/config/lock.js.map +1 -1
- package/dist/codex/config/read.d.ts +16 -0
- package/dist/codex/config/read.d.ts.map +1 -0
- package/dist/codex/config/read.js +75 -0
- package/dist/codex/config/read.js.map +1 -0
- package/dist/codex/config/restore.d.ts +17 -7
- package/dist/codex/config/restore.d.ts.map +1 -1
- package/dist/codex/config/restore.js +33 -20
- package/dist/codex/config/restore.js.map +1 -1
- package/dist/codex/config/transaction.d.ts +6 -4
- package/dist/codex/config/transaction.d.ts.map +1 -1
- package/dist/codex/config/transaction.js +4 -3
- package/dist/codex/config/transaction.js.map +1 -1
- package/dist/codex/images/clipboard-copies.d.ts +39 -0
- package/dist/codex/images/clipboard-copies.d.ts.map +1 -0
- package/dist/codex/images/clipboard-copies.js +91 -0
- package/dist/codex/images/clipboard-copies.js.map +1 -0
- package/dist/codex/model-picker.d.ts +1 -1
- package/dist/codex/model-picker.d.ts.map +1 -1
- package/dist/codex/model-picker.js +16 -6
- package/dist/codex/model-picker.js.map +1 -1
- package/dist/codex/preflight.d.ts +2 -2
- package/dist/codex/preflight.d.ts.map +1 -1
- package/dist/codex/preflight.js +28 -21
- package/dist/codex/preflight.js.map +1 -1
- package/dist/codex/pty.d.ts +25 -3
- package/dist/codex/pty.d.ts.map +1 -1
- package/dist/codex/pty.js +53 -7
- package/dist/codex/pty.js.map +1 -1
- package/dist/codex/questions/candidates.d.ts.map +1 -1
- package/dist/codex/questions/candidates.js +4 -5
- package/dist/codex/questions/candidates.js.map +1 -1
- package/dist/codex/questions/driver.js +2 -2
- package/dist/codex/questions/driver.js.map +1 -1
- package/dist/codex/questions/records.d.ts +1 -1
- package/dist/codex/questions/records.d.ts.map +1 -1
- package/dist/codex/questions/records.js +1 -3
- package/dist/codex/questions/records.js.map +1 -1
- package/dist/codex/screen/clearance.d.ts +6 -0
- package/dist/codex/screen/clearance.d.ts.map +1 -1
- package/dist/codex/screen/clearance.js +10 -0
- package/dist/codex/screen/clearance.js.map +1 -1
- package/dist/codex/screen-table.d.ts.map +1 -1
- package/dist/codex/screen-table.js +6 -2
- package/dist/codex/screen-table.js.map +1 -1
- package/dist/codex/session/bridge.d.ts +1 -0
- package/dist/codex/session/bridge.d.ts.map +1 -1
- package/dist/codex/session/bridge.js +3 -1
- package/dist/codex/session/bridge.js.map +1 -1
- package/dist/codex/session/build.d.ts.map +1 -1
- package/dist/codex/session/build.js +14 -12
- package/dist/codex/session/build.js.map +1 -1
- package/dist/codex/session/cleanup.d.ts +2 -2
- package/dist/codex/session/cleanup.d.ts.map +1 -1
- package/dist/codex/session/cleanup.js +8 -11
- package/dist/codex/session/cleanup.js.map +1 -1
- package/dist/codex/session/config-switch.d.ts +20 -0
- package/dist/codex/session/config-switch.d.ts.map +1 -0
- package/dist/codex/session/config-switch.js +42 -0
- package/dist/codex/session/config-switch.js.map +1 -0
- package/dist/codex/session/hooks.d.ts.map +1 -1
- package/dist/codex/session/hooks.js +7 -0
- package/dist/codex/session/hooks.js.map +1 -1
- package/dist/codex/session/index.d.ts.map +1 -1
- package/dist/codex/session/index.js +34 -16
- package/dist/codex/session/index.js.map +1 -1
- package/dist/codex/session/instance.d.ts +10 -12
- package/dist/codex/session/instance.d.ts.map +1 -1
- package/dist/codex/session/instance.js +42 -37
- package/dist/codex/session/instance.js.map +1 -1
- package/dist/codex/session/readiness.d.ts +11 -0
- package/dist/codex/session/readiness.d.ts.map +1 -0
- package/dist/codex/session/readiness.js +22 -0
- package/dist/codex/session/readiness.js.map +1 -0
- package/dist/codex/session/resume.d.ts.map +1 -1
- package/dist/codex/session/resume.js +9 -4
- package/dist/codex/session/resume.js.map +1 -1
- package/dist/codex/session/transcript.d.ts.map +1 -1
- package/dist/codex/session/transcript.js +12 -1
- package/dist/codex/session/transcript.js.map +1 -1
- package/dist/codex/session/turn-commit.d.ts +58 -0
- package/dist/codex/session/turn-commit.d.ts.map +1 -0
- package/dist/codex/session/turn-commit.js +97 -0
- package/dist/codex/session/turn-commit.js.map +1 -0
- package/dist/codex/session/warnings.d.ts +13 -6
- package/dist/codex/session/warnings.d.ts.map +1 -1
- package/dist/codex/session/warnings.js +36 -9
- package/dist/codex/session/warnings.js.map +1 -1
- package/dist/codex/startup-prompts.d.ts +3 -0
- package/dist/codex/startup-prompts.d.ts.map +1 -1
- package/dist/codex/startup-prompts.js +20 -13
- package/dist/codex/startup-prompts.js.map +1 -1
- package/dist/codex/startup-warnings.d.ts +2 -0
- package/dist/codex/startup-warnings.d.ts.map +1 -1
- package/dist/codex/startup-warnings.js +6 -0
- package/dist/codex/startup-warnings.js.map +1 -1
- package/dist/codex/transcript/payload.d.ts +8 -0
- package/dist/codex/transcript/payload.d.ts.map +1 -0
- package/dist/codex/transcript/payload.js +11 -0
- package/dist/codex/transcript/payload.js.map +1 -0
- package/dist/codex/transcript/rejection.d.ts +15 -0
- package/dist/codex/transcript/rejection.d.ts.map +1 -0
- package/dist/codex/transcript/rejection.js +44 -0
- package/dist/codex/transcript/rejection.js.map +1 -0
- package/dist/codex/transcript/turn-end.d.ts +8 -0
- package/dist/codex/transcript/turn-end.d.ts.map +1 -0
- package/dist/codex/transcript/turn-end.js +17 -0
- package/dist/codex/transcript/turn-end.js.map +1 -0
- package/dist/codex/transcript/watcher.d.ts +5 -2
- package/dist/codex/transcript/watcher.d.ts.map +1 -1
- package/dist/codex/transcript/watcher.js +11 -6
- package/dist/codex/transcript/watcher.js.map +1 -1
- package/dist/codex/trust-retry.d.ts +12 -0
- package/dist/codex/trust-retry.d.ts.map +1 -0
- package/dist/codex/trust-retry.js +12 -0
- package/dist/codex/trust-retry.js.map +1 -0
- package/dist/codex/update/skip-attempt.d.ts +2 -0
- package/dist/codex/update/skip-attempt.d.ts.map +1 -1
- package/dist/codex/update/skip-attempt.js +4 -0
- package/dist/codex/update/skip-attempt.js.map +1 -1
- package/dist/codex/update/tracker.d.ts +2 -0
- package/dist/codex/update/tracker.d.ts.map +1 -1
- package/dist/codex/update/tracker.js +4 -0
- package/dist/codex/update/tracker.js.map +1 -1
- package/dist/core/delay.d.ts +3 -2
- package/dist/core/delay.d.ts.map +1 -1
- package/dist/core/delay.js +3 -2
- package/dist/core/delay.js.map +1 -1
- package/dist/core/errors.d.ts +33 -4
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +51 -7
- package/dist/core/errors.js.map +1 -1
- package/dist/core/images/materialize.d.ts +13 -4
- package/dist/core/images/materialize.d.ts.map +1 -1
- package/dist/core/images/materialize.js +48 -11
- package/dist/core/images/materialize.js.map +1 -1
- package/dist/core/input/abort.d.ts +15 -0
- package/dist/core/input/abort.d.ts.map +1 -1
- package/dist/core/input/abort.js +18 -2
- package/dist/core/input/abort.js.map +1 -1
- package/dist/core/input/constants.d.ts +4 -1
- package/dist/core/input/constants.d.ts.map +1 -1
- package/dist/core/input/constants.js +4 -1
- package/dist/core/input/constants.js.map +1 -1
- package/dist/core/input/index.d.ts +1 -1
- package/dist/core/input/index.d.ts.map +1 -1
- package/dist/core/input/index.js +1 -1
- package/dist/core/input/index.js.map +1 -1
- package/dist/core/models/clearance.d.ts +38 -0
- package/dist/core/models/clearance.d.ts.map +1 -0
- package/dist/core/models/clearance.js +38 -0
- package/dist/core/models/clearance.js.map +1 -0
- package/dist/core/models/close-wait.d.ts +17 -0
- package/dist/core/models/close-wait.d.ts.map +1 -0
- package/dist/core/models/close-wait.js +44 -0
- package/dist/core/models/close-wait.js.map +1 -0
- package/dist/core/models/dialog-region.d.ts +18 -3
- package/dist/core/models/dialog-region.d.ts.map +1 -1
- package/dist/core/models/dialog-region.js +29 -40
- package/dist/core/models/dialog-region.js.map +1 -1
- package/dist/core/models/input.d.ts +10 -1
- package/dist/core/models/input.d.ts.map +1 -1
- package/dist/core/models/input.js +15 -2
- package/dist/core/models/input.js.map +1 -1
- package/dist/core/models/intervention.d.ts +2 -2
- package/dist/core/models/intervention.d.ts.map +1 -1
- package/dist/core/models/intervention.js +6 -3
- package/dist/core/models/intervention.js.map +1 -1
- package/dist/core/models/own-picker.d.ts +21 -0
- package/dist/core/models/own-picker.d.ts.map +1 -0
- package/dist/core/models/own-picker.js +21 -0
- package/dist/core/models/own-picker.js.map +1 -0
- package/dist/core/models/picker.d.ts +34 -4
- package/dist/core/models/picker.d.ts.map +1 -1
- package/dist/core/models/picker.js +50 -44
- package/dist/core/models/picker.js.map +1 -1
- package/dist/core/models/row-block.d.ts +66 -0
- package/dist/core/models/row-block.d.ts.map +1 -0
- package/dist/core/models/row-block.js +87 -0
- package/dist/core/models/row-block.js.map +1 -0
- package/dist/core/models/rows.d.ts +32 -3
- package/dist/core/models/rows.d.ts.map +1 -1
- package/dist/core/models/rows.js +48 -20
- package/dist/core/models/rows.js.map +1 -1
- package/dist/core/models/tui-screen.d.ts +6 -1
- package/dist/core/models/tui-screen.d.ts.map +1 -1
- package/dist/core/models/tui-screen.js +25 -10
- package/dist/core/models/tui-screen.js.map +1 -1
- package/dist/core/models/window.d.ts +49 -0
- package/dist/core/models/window.d.ts.map +1 -0
- package/dist/core/models/window.js +105 -0
- package/dist/core/models/window.js.map +1 -0
- package/dist/core/path-trust.d.ts +11 -0
- package/dist/core/path-trust.d.ts.map +1 -0
- package/dist/core/path-trust.js +21 -0
- package/dist/core/path-trust.js.map +1 -0
- package/dist/core/screen-facts.d.ts +3 -1
- package/dist/core/screen-facts.d.ts.map +1 -1
- package/dist/core/screen-facts.js +1 -0
- package/dist/core/screen-facts.js.map +1 -1
- package/dist/core/simple/boundary-signal.d.ts +41 -6
- package/dist/core/simple/boundary-signal.d.ts.map +1 -1
- package/dist/core/simple/boundary-signal.js +43 -3
- package/dist/core/simple/boundary-signal.js.map +1 -1
- package/dist/core/simple/close.d.ts +2 -1
- package/dist/core/simple/close.d.ts.map +1 -1
- package/dist/core/simple/close.js +10 -2
- package/dist/core/simple/close.js.map +1 -1
- package/dist/core/simple/turn-boundary.d.ts +2 -0
- package/dist/core/simple/turn-boundary.d.ts.map +1 -1
- package/dist/core/simple/turn-boundary.js +1 -1
- package/dist/core/simple/turn-boundary.js.map +1 -1
- package/dist/core/simple/turn-types.d.ts +9 -3
- package/dist/core/simple/turn-types.d.ts.map +1 -1
- package/dist/core/simple/turn-types.js +10 -2
- package/dist/core/simple/turn-types.js.map +1 -1
- package/dist/core/simple/turn.d.ts +2 -0
- package/dist/core/simple/turn.d.ts.map +1 -1
- package/dist/core/simple/turn.js +11 -5
- package/dist/core/simple/turn.js.map +1 -1
- package/dist/core/terminal-options.d.ts +17 -1
- package/dist/core/terminal-options.d.ts.map +1 -1
- package/dist/core/terminal-options.js +20 -8
- package/dist/core/terminal-options.js.map +1 -1
- package/dist/core/transcript/cursor-io.d.ts +8 -0
- package/dist/core/transcript/cursor-io.d.ts.map +1 -1
- package/dist/core/transcript/cursor-io.js +11 -5
- package/dist/core/transcript/cursor-io.js.map +1 -1
- package/dist/core/transcript/cursor.d.ts +28 -4
- package/dist/core/transcript/cursor.d.ts.map +1 -1
- package/dist/core/transcript/cursor.js +53 -7
- package/dist/core/transcript/cursor.js.map +1 -1
- package/dist/core/transcript/drain.d.ts +43 -0
- package/dist/core/transcript/drain.d.ts.map +1 -0
- package/dist/core/transcript/drain.js +67 -0
- package/dist/core/transcript/drain.js.map +1 -0
- package/dist/core/trust/abortable.d.ts +12 -0
- package/dist/core/trust/abortable.d.ts.map +1 -0
- package/dist/core/trust/abortable.js +48 -0
- package/dist/core/trust/abortable.js.map +1 -0
- package/dist/core/trust/allowlist.d.ts +2 -0
- package/dist/core/trust/allowlist.d.ts.map +1 -1
- package/dist/core/trust/allowlist.js +4 -1
- package/dist/core/trust/allowlist.js.map +1 -1
- package/dist/core/trust/blocking.d.ts +11 -0
- package/dist/core/trust/blocking.d.ts.map +1 -1
- package/dist/core/trust/blocking.js +5 -4
- package/dist/core/trust/blocking.js.map +1 -1
- package/dist/core/trust/copy.d.ts.map +1 -1
- package/dist/core/trust/copy.js +7 -1
- package/dist/core/trust/copy.js.map +1 -1
- package/dist/core/trust/deadline.d.ts +24 -0
- package/dist/core/trust/deadline.d.ts.map +1 -0
- package/dist/core/trust/deadline.js +56 -0
- package/dist/core/trust/deadline.js.map +1 -0
- package/dist/core/trust/dialog.d.ts +11 -2
- package/dist/core/trust/dialog.d.ts.map +1 -1
- package/dist/core/trust/dialog.js +12 -3
- package/dist/core/trust/dialog.js.map +1 -1
- package/dist/core/trust/options.d.ts +5 -1
- package/dist/core/trust/options.d.ts.map +1 -1
- package/dist/core/trust/options.js +8 -2
- package/dist/core/trust/options.js.map +1 -1
- package/dist/core/trust/prompts.d.ts +3 -0
- package/dist/core/trust/prompts.d.ts.map +1 -1
- package/dist/core/trust/prompts.js +2 -1
- package/dist/core/trust/prompts.js.map +1 -1
- package/dist/core/trust/responder.d.ts +10 -5
- package/dist/core/trust/responder.d.ts.map +1 -1
- package/dist/core/trust/responder.js +37 -33
- package/dist/core/trust/responder.js.map +1 -1
- package/dist/core/trust/step.d.ts +67 -0
- package/dist/core/trust/step.d.ts.map +1 -0
- package/dist/core/trust/step.js +45 -0
- package/dist/core/trust/step.js.map +1 -0
- package/dist/core/trust/types.d.ts +21 -1
- package/dist/core/trust/types.d.ts.map +1 -1
- package/dist/core/trust/types.js +25 -1
- package/dist/core/trust/types.js.map +1 -1
- package/dist/core/trust/view.d.ts +2 -0
- package/dist/core/trust/view.d.ts.map +1 -1
- package/dist/core/trust/view.js +3 -0
- package/dist/core/trust/view.js.map +1 -1
- package/dist/core/trust/write.d.ts +31 -6
- package/dist/core/trust/write.d.ts.map +1 -1
- package/dist/core/trust/write.js +95 -80
- package/dist/core/trust/write.js.map +1 -1
- package/dist/core/turn-state.d.ts +18 -4
- package/dist/core/turn-state.d.ts.map +1 -1
- package/dist/core/turn-state.js +47 -25
- package/dist/core/turn-state.js.map +1 -1
- package/dist/core/warnings/images.d.ts +22 -0
- package/dist/core/warnings/images.d.ts.map +1 -0
- package/dist/core/warnings/images.js +3 -0
- package/dist/core/warnings/images.js.map +1 -0
- package/dist/core/warnings/index.d.ts +3 -2
- package/dist/core/warnings/index.d.ts.map +1 -1
- package/dist/core/warnings/lifecycle.d.ts +35 -4
- package/dist/core/warnings/lifecycle.d.ts.map +1 -1
- package/dist/core/warnings/lifecycle.js +1 -1
- package/dist/core/warnings/update.d.ts +8 -4
- package/dist/core/warnings/update.d.ts.map +1 -1
- package/dist/core/warnings/update.js +21 -6
- package/dist/core/warnings/update.js.map +1 -1
- package/dist/pty/exit-latch.d.ts +28 -0
- package/dist/pty/exit-latch.d.ts.map +1 -0
- package/dist/pty/exit-latch.js +50 -0
- package/dist/pty/exit-latch.js.map +1 -0
- package/dist/runtime/exit-status.d.ts +7 -0
- package/dist/runtime/exit-status.d.ts.map +1 -0
- package/dist/runtime/exit-status.js +13 -0
- package/dist/runtime/exit-status.js.map +1 -0
- package/dist/runtime/home-guard/index.d.ts +45 -0
- package/dist/runtime/home-guard/index.d.ts.map +1 -0
- package/dist/runtime/home-guard/index.js +69 -0
- package/dist/runtime/home-guard/index.js.map +1 -0
- package/dist/runtime/loop-restore.d.ts +9 -9
- package/dist/runtime/loop-restore.d.ts.map +1 -1
- package/dist/runtime/loop-restore.js +10 -10
- package/dist/runtime/loop-restore.js.map +1 -1
- package/dist/runtime/probe/capped-buffer.d.ts +16 -0
- package/dist/runtime/probe/capped-buffer.d.ts.map +1 -0
- package/dist/runtime/probe/capped-buffer.js +38 -0
- package/dist/runtime/probe/capped-buffer.js.map +1 -0
- package/dist/runtime/probe/capture.d.ts +55 -0
- package/dist/runtime/probe/capture.d.ts.map +1 -0
- package/dist/runtime/probe/capture.js +71 -0
- package/dist/runtime/probe/capture.js.map +1 -0
- package/dist/runtime/{probe-cleanup.d.ts → probe/cleanup.d.ts} +2 -2
- package/dist/runtime/probe/cleanup.d.ts.map +1 -0
- package/dist/runtime/{probe-cleanup.js → probe/cleanup.js} +3 -3
- package/dist/runtime/probe/cleanup.js.map +1 -0
- package/dist/runtime/probe/directory-key.d.ts +26 -0
- package/dist/runtime/probe/directory-key.d.ts.map +1 -0
- package/dist/runtime/probe/directory-key.js +46 -0
- package/dist/runtime/probe/directory-key.js.map +1 -0
- package/dist/runtime/probe/index.d.ts +25 -0
- package/dist/runtime/probe/index.d.ts.map +1 -0
- package/dist/runtime/probe/index.js +153 -0
- package/dist/runtime/probe/index.js.map +1 -0
- package/dist/runtime/probe/lookup.d.ts +12 -0
- package/dist/runtime/probe/lookup.d.ts.map +1 -0
- package/dist/runtime/probe/lookup.js +29 -0
- package/dist/runtime/probe/lookup.js.map +1 -0
- package/dist/runtime/probe/named-pipes.d.ts +35 -0
- package/dist/runtime/probe/named-pipes.d.ts.map +1 -0
- package/dist/runtime/probe/named-pipes.js +167 -0
- package/dist/runtime/probe/named-pipes.js.map +1 -0
- package/dist/runtime/probe/private-directory.d.ts +14 -0
- package/dist/runtime/probe/private-directory.d.ts.map +1 -0
- package/dist/runtime/probe/private-directory.js +50 -0
- package/dist/runtime/probe/private-directory.js.map +1 -0
- package/dist/runtime/probe/results.d.ts +14 -0
- package/dist/runtime/probe/results.d.ts.map +1 -0
- package/dist/runtime/probe/results.js +38 -0
- package/dist/runtime/probe/results.js.map +1 -0
- package/dist/runtime/probe/slots.d.ts +17 -0
- package/dist/runtime/probe/slots.d.ts.map +1 -0
- package/dist/runtime/probe/slots.js +35 -0
- package/dist/runtime/probe/slots.js.map +1 -0
- package/dist/runtime/probe/start.d.ts +64 -0
- package/dist/runtime/probe/start.d.ts.map +1 -0
- package/dist/runtime/probe/start.js +80 -0
- package/dist/runtime/probe/start.js.map +1 -0
- package/dist/runtime/probe-cache.d.ts +19 -0
- package/dist/runtime/probe-cache.d.ts.map +1 -0
- package/dist/runtime/probe-cache.js +56 -0
- package/dist/runtime/probe-cache.js.map +1 -0
- package/dist/runtime/readiness/initial-ready.d.ts +31 -5
- package/dist/runtime/readiness/initial-ready.d.ts.map +1 -1
- package/dist/runtime/readiness/initial-ready.js +64 -18
- package/dist/runtime/readiness/initial-ready.js.map +1 -1
- package/dist/runtime/seams.d.ts +14 -2
- package/dist/runtime/seams.d.ts.map +1 -1
- package/dist/runtime/seams.js +2 -2
- package/dist/runtime/seams.js.map +1 -1
- package/dist/runtime/session/base.d.ts.map +1 -1
- package/dist/runtime/session/base.js +9 -6
- package/dist/runtime/session/base.js.map +1 -1
- package/dist/runtime/session/commands.d.ts +6 -4
- package/dist/runtime/session/commands.d.ts.map +1 -1
- package/dist/runtime/session/commands.js +5 -2
- package/dist/runtime/session/commands.js.map +1 -1
- package/dist/runtime/session/frames.d.ts +12 -2
- package/dist/runtime/session/frames.d.ts.map +1 -1
- package/dist/runtime/session/frames.js +10 -3
- package/dist/runtime/session/frames.js.map +1 -1
- package/dist/runtime/session/image-attach.js +7 -2
- package/dist/runtime/session/image-attach.js.map +1 -1
- package/dist/runtime/session/launch-directory.d.ts +33 -0
- package/dist/runtime/session/launch-directory.d.ts.map +1 -0
- package/dist/runtime/session/launch-directory.js +84 -0
- package/dist/runtime/session/launch-directory.js.map +1 -0
- package/dist/runtime/session/lifecycle.d.ts +3 -3
- package/dist/runtime/session/lifecycle.d.ts.map +1 -1
- package/dist/runtime/session/lifecycle.js +1 -5
- package/dist/runtime/session/lifecycle.js.map +1 -1
- package/dist/runtime/session/loops.d.ts +1 -1
- package/dist/runtime/session/loops.d.ts.map +1 -1
- package/dist/runtime/session/loops.js +6 -3
- package/dist/runtime/session/loops.js.map +1 -1
- package/dist/runtime/session/picker-cleanup.d.ts +6 -21
- package/dist/runtime/session/picker-cleanup.d.ts.map +1 -1
- package/dist/runtime/session/picker-cleanup.js +19 -31
- package/dist/runtime/session/picker-cleanup.js.map +1 -1
- package/dist/runtime/session/picker-hold.d.ts +24 -0
- package/dist/runtime/session/picker-hold.d.ts.map +1 -0
- package/dist/runtime/session/picker-hold.js +42 -0
- package/dist/runtime/session/picker-hold.js.map +1 -0
- package/dist/runtime/session/picker.d.ts +15 -13
- package/dist/runtime/session/picker.d.ts.map +1 -1
- package/dist/runtime/session/picker.js +49 -27
- package/dist/runtime/session/picker.js.map +1 -1
- package/dist/runtime/session/prepare-state.d.ts +6 -0
- package/dist/runtime/session/prepare-state.d.ts.map +1 -0
- package/dist/runtime/session/prepare-state.js +14 -0
- package/dist/runtime/session/prepare-state.js.map +1 -0
- package/dist/runtime/session/questions.d.ts +2 -2
- package/dist/runtime/session/questions.d.ts.map +1 -1
- package/dist/runtime/session/questions.js.map +1 -1
- package/dist/runtime/session/readiness.d.ts +14 -5
- package/dist/runtime/session/readiness.d.ts.map +1 -1
- package/dist/runtime/session/readiness.js +22 -6
- package/dist/runtime/session/readiness.js.map +1 -1
- package/dist/runtime/session/reap.d.ts +11 -7
- package/dist/runtime/session/reap.d.ts.map +1 -1
- package/dist/runtime/session/reap.js +16 -10
- package/dist/runtime/session/reap.js.map +1 -1
- package/dist/runtime/session/runtime-cleanup.d.ts +18 -0
- package/dist/runtime/session/runtime-cleanup.d.ts.map +1 -0
- package/dist/runtime/session/runtime-cleanup.js +18 -0
- package/dist/runtime/session/runtime-cleanup.js.map +1 -0
- package/dist/runtime/session/session-input.d.ts +32 -0
- package/dist/runtime/session/session-input.d.ts.map +1 -0
- package/dist/runtime/session/{picker-input.js → session-input.js} +35 -7
- package/dist/runtime/session/session-input.js.map +1 -0
- package/dist/runtime/session/shutdown-binding.d.ts +12 -1
- package/dist/runtime/session/shutdown-binding.d.ts.map +1 -1
- package/dist/runtime/session/shutdown-binding.js +33 -1
- package/dist/runtime/session/shutdown-binding.js.map +1 -1
- package/dist/runtime/session/shutdown-cleanup.d.ts +17 -0
- package/dist/runtime/session/shutdown-cleanup.d.ts.map +1 -0
- package/dist/runtime/session/shutdown-cleanup.js +49 -0
- package/dist/runtime/session/shutdown-cleanup.js.map +1 -0
- package/dist/runtime/session/shutdown.d.ts +3 -2
- package/dist/runtime/session/shutdown.d.ts.map +1 -1
- package/dist/runtime/session/shutdown.js +13 -24
- package/dist/runtime/session/shutdown.js.map +1 -1
- package/dist/runtime/shell-quote.d.ts +8 -0
- package/dist/runtime/shell-quote.d.ts.map +1 -0
- package/dist/runtime/shell-quote.js +10 -0
- package/dist/runtime/shell-quote.js.map +1 -0
- package/dist/runtime/shell.d.ts +36 -12
- package/dist/runtime/shell.d.ts.map +1 -1
- package/dist/runtime/shell.js +90 -14
- package/dist/runtime/shell.js.map +1 -1
- package/dist/runtime/shutdown/coalesce.d.ts +15 -0
- package/dist/runtime/shutdown/coalesce.d.ts.map +1 -0
- package/dist/runtime/shutdown/coalesce.js +42 -0
- package/dist/runtime/shutdown/coalesce.js.map +1 -0
- package/dist/runtime/shutdown/detached-sweep/failures.d.ts +24 -0
- package/dist/runtime/shutdown/detached-sweep/failures.d.ts.map +1 -0
- package/dist/runtime/shutdown/detached-sweep/failures.js +32 -0
- package/dist/runtime/shutdown/detached-sweep/failures.js.map +1 -0
- package/dist/runtime/shutdown/detached-sweep/index.d.ts +55 -0
- package/dist/runtime/shutdown/detached-sweep/index.d.ts.map +1 -0
- package/dist/runtime/shutdown/detached-sweep/index.js +129 -0
- package/dist/runtime/shutdown/detached-sweep/index.js.map +1 -0
- package/dist/runtime/shutdown/detached-sweep/kill.d.ts +37 -0
- package/dist/runtime/shutdown/detached-sweep/kill.d.ts.map +1 -0
- package/dist/runtime/shutdown/detached-sweep/kill.js +87 -0
- package/dist/runtime/shutdown/detached-sweep/kill.js.map +1 -0
- package/dist/runtime/shutdown/detached-sweep/record.d.ts +67 -0
- package/dist/runtime/shutdown/detached-sweep/record.d.ts.map +1 -0
- package/dist/runtime/shutdown/detached-sweep/record.js +111 -0
- package/dist/runtime/shutdown/detached-sweep/record.js.map +1 -0
- package/dist/runtime/shutdown/detached-sweep/rounds.d.ts +78 -0
- package/dist/runtime/shutdown/detached-sweep/rounds.d.ts.map +1 -0
- package/dist/runtime/shutdown/detached-sweep/rounds.js +116 -0
- package/dist/runtime/shutdown/detached-sweep/rounds.js.map +1 -0
- package/dist/runtime/shutdown/detached-sweep/survivors.d.ts +40 -0
- package/dist/runtime/shutdown/detached-sweep/survivors.d.ts.map +1 -0
- package/dist/runtime/shutdown/detached-sweep/survivors.js +112 -0
- package/dist/runtime/shutdown/detached-sweep/survivors.js.map +1 -0
- package/dist/runtime/shutdown/leader-group.d.ts +29 -0
- package/dist/runtime/shutdown/leader-group.d.ts.map +1 -0
- package/dist/runtime/shutdown/leader-group.js +35 -0
- package/dist/runtime/shutdown/leader-group.js.map +1 -0
- package/dist/runtime/shutdown/native-read-admission.d.ts +13 -0
- package/dist/runtime/shutdown/native-read-admission.d.ts.map +1 -0
- package/dist/runtime/shutdown/native-read-admission.js +64 -0
- package/dist/runtime/shutdown/native-read-admission.js.map +1 -0
- package/dist/runtime/shutdown/process-table.d.ts +80 -0
- package/dist/runtime/shutdown/process-table.d.ts.map +1 -0
- package/dist/runtime/shutdown/process-table.js +147 -0
- package/dist/runtime/shutdown/process-table.js.map +1 -0
- package/dist/runtime/shutdown/process-tree-ops.d.ts +39 -0
- package/dist/runtime/shutdown/process-tree-ops.d.ts.map +1 -0
- package/dist/runtime/shutdown/process-tree-ops.js +73 -0
- package/dist/runtime/shutdown/process-tree-ops.js.map +1 -0
- package/dist/runtime/shutdown/read-timeout.d.ts +4 -0
- package/dist/runtime/shutdown/read-timeout.d.ts.map +1 -0
- package/dist/runtime/shutdown/read-timeout.js +6 -0
- package/dist/runtime/shutdown/read-timeout.js.map +1 -0
- package/dist/runtime/shutdown/reap-queue.d.ts +10 -0
- package/dist/runtime/shutdown/reap-queue.d.ts.map +1 -0
- package/dist/runtime/shutdown/reap-queue.js +29 -0
- package/dist/runtime/shutdown/reap-queue.js.map +1 -0
- package/dist/runtime/shutdown/reap-tree.d.ts +42 -32
- package/dist/runtime/shutdown/reap-tree.d.ts.map +1 -1
- package/dist/runtime/shutdown/reap-tree.js +78 -71
- package/dist/runtime/shutdown/reap-tree.js.map +1 -1
- package/dist/runtime/shutdown/shared-daemon.d.ts +59 -0
- package/dist/runtime/shutdown/shared-daemon.d.ts.map +1 -0
- package/dist/runtime/shutdown/shared-daemon.js +139 -0
- package/dist/runtime/shutdown/shared-daemon.js.map +1 -0
- package/dist/runtime/shutdown/teardown.d.ts +15 -0
- package/dist/runtime/shutdown/teardown.d.ts.map +1 -1
- package/dist/runtime/shutdown/teardown.js +19 -6
- package/dist/runtime/shutdown/teardown.js.map +1 -1
- package/dist/runtime/shutdown/terminate.d.ts +21 -1
- package/dist/runtime/shutdown/terminate.d.ts.map +1 -1
- package/dist/runtime/shutdown/terminate.js +83 -56
- package/dist/runtime/shutdown/terminate.js.map +1 -1
- package/dist/runtime/startup/buffer.d.ts +26 -7
- package/dist/runtime/startup/buffer.d.ts.map +1 -1
- package/dist/runtime/startup/buffer.js +42 -19
- package/dist/runtime/startup/buffer.js.map +1 -1
- package/dist/runtime/startup/cleanup.d.ts +37 -11
- package/dist/runtime/startup/cleanup.d.ts.map +1 -1
- package/dist/runtime/startup/cleanup.js +55 -25
- package/dist/runtime/startup/cleanup.js.map +1 -1
- package/dist/runtime/startup/index.d.ts +13 -1
- package/dist/runtime/startup/index.d.ts.map +1 -1
- package/dist/runtime/startup/index.js +38 -6
- package/dist/runtime/startup/index.js.map +1 -1
- package/dist/runtime/stream-marker.d.ts +17 -0
- package/dist/runtime/stream-marker.d.ts.map +1 -0
- package/dist/runtime/stream-marker.js +35 -0
- package/dist/runtime/stream-marker.js.map +1 -0
- package/dist/runtime/update/acquire.d.ts +16 -0
- package/dist/runtime/update/acquire.d.ts.map +1 -0
- package/dist/runtime/update/acquire.js +62 -0
- package/dist/runtime/update/acquire.js.map +1 -0
- package/dist/runtime/update/completion.d.ts +12 -0
- package/dist/runtime/update/completion.d.ts.map +1 -0
- package/dist/runtime/update/completion.js +50 -0
- package/dist/runtime/update/completion.js.map +1 -0
- package/dist/runtime/update/lock.d.ts +1 -1
- package/dist/runtime/update/lock.d.ts.map +1 -1
- package/dist/runtime/update/lock.js +21 -38
- package/dist/runtime/update/lock.js.map +1 -1
- package/dist/runtime/update/once.d.ts +16 -13
- package/dist/runtime/update/once.d.ts.map +1 -1
- package/dist/runtime/update/once.js +41 -31
- package/dist/runtime/update/once.js.map +1 -1
- package/dist/runtime/update/owner.js +1 -1
- package/dist/runtime/update/retained-lease.js +1 -1
- package/dist/runtime/update/waiting.d.ts +14 -1
- package/dist/runtime/update/waiting.d.ts.map +1 -1
- package/dist/runtime/update/waiting.js +20 -12
- package/dist/runtime/update/waiting.js.map +1 -1
- package/dist/state/canonical-path.d.ts +5 -0
- package/dist/state/canonical-path.d.ts.map +1 -1
- package/dist/state/canonical-path.js +11 -5
- package/dist/state/canonical-path.js.map +1 -1
- package/dist/state/directories.d.ts +31 -1
- package/dist/state/directories.d.ts.map +1 -1
- package/dist/state/directories.js +75 -13
- package/dist/state/directories.js.map +1 -1
- package/dist/state/files.d.ts +3 -3
- package/dist/state/files.d.ts.map +1 -1
- package/dist/state/files.js +4 -10
- package/dist/state/files.js.map +1 -1
- package/dist/state/launch-ownership.d.ts +4 -2
- package/dist/state/launch-ownership.d.ts.map +1 -1
- package/dist/state/launch-ownership.js +18 -10
- package/dist/state/launch-ownership.js.map +1 -1
- package/dist/state/launch-publication.d.ts +7 -1
- package/dist/state/launch-publication.d.ts.map +1 -1
- package/dist/state/launch-publication.js +14 -2
- package/dist/state/launch-publication.js.map +1 -1
- package/dist/state/loop-store.d.ts +15 -4
- package/dist/state/loop-store.d.ts.map +1 -1
- package/dist/state/loop-store.js +13 -7
- package/dist/state/loop-store.js.map +1 -1
- package/dist/state/preparation/created-directories.d.ts +13 -0
- package/dist/state/preparation/created-directories.d.ts.map +1 -0
- package/dist/state/preparation/created-directories.js +45 -0
- package/dist/state/preparation/created-directories.js.map +1 -0
- package/dist/state/preparation/ignore-sync.d.ts +9 -0
- package/dist/state/preparation/ignore-sync.d.ts.map +1 -0
- package/dist/state/preparation/ignore-sync.js +47 -0
- package/dist/state/preparation/ignore-sync.js.map +1 -0
- package/dist/state/preparation/index.d.ts +25 -0
- package/dist/state/preparation/index.d.ts.map +1 -0
- package/dist/state/preparation/index.js +31 -0
- package/dist/state/preparation/index.js.map +1 -0
- package/dist/state/preparation/install-ignore.d.ts +6 -0
- package/dist/state/preparation/install-ignore.d.ts.map +1 -0
- package/dist/state/preparation/install-ignore.js +87 -0
- package/dist/state/preparation/install-ignore.js.map +1 -0
- package/dist/state/preparation/rollback-parent.d.ts +3 -0
- package/dist/state/preparation/rollback-parent.d.ts.map +1 -0
- package/dist/state/preparation/rollback-parent.js +18 -0
- package/dist/state/preparation/rollback-parent.js.map +1 -0
- package/dist/state/preparation/root-trust.d.ts +3 -0
- package/dist/state/preparation/root-trust.d.ts.map +1 -0
- package/dist/state/preparation/root-trust.js +70 -0
- package/dist/state/preparation/root-trust.js.map +1 -0
- package/dist/state/private-session.d.ts +5 -2
- package/dist/state/private-session.d.ts.map +1 -1
- package/dist/state/private-session.js +21 -9
- package/dist/state/private-session.js.map +1 -1
- package/dist/state/root.d.ts +25 -0
- package/dist/state/root.d.ts.map +1 -0
- package/dist/state/root.js +84 -0
- package/dist/state/root.js.map +1 -0
- package/dist/state/runtime-paths.d.ts +5 -4
- package/dist/state/runtime-paths.d.ts.map +1 -1
- package/dist/state/runtime-paths.js +5 -4
- package/dist/state/runtime-paths.js.map +1 -1
- package/dist/state/setup-failure.d.ts +3 -0
- package/dist/state/setup-failure.d.ts.map +1 -0
- package/dist/state/setup-failure.js +13 -0
- package/dist/state/setup-failure.js.map +1 -0
- package/dist/state/socket-home.d.ts +17 -12
- package/dist/state/socket-home.d.ts.map +1 -1
- package/dist/state/socket-home.js +31 -14
- package/dist/state/socket-home.js.map +1 -1
- package/dist/state/store.d.ts +1 -3
- package/dist/state/store.d.ts.map +1 -1
- package/dist/state/store.js +3 -18
- package/dist/state/store.js.map +1 -1
- package/dist/terminal/cursor.d.ts +1 -1
- package/dist/terminal/cursor.d.ts.map +1 -1
- package/dist/terminal/cursor.js +36 -1
- package/dist/terminal/cursor.js.map +1 -1
- package/dist/terminal/headless.d.ts +1 -1
- package/dist/terminal/headless.d.ts.map +1 -1
- package/dist/terminal/headless.js +1 -3
- package/dist/terminal/headless.js.map +1 -1
- package/docs/cli-behavior.md +1218 -28
- package/docs/cli.md +2 -0
- package/docs/codex/cli.md +4 -2
- package/docs/embedding.md +7 -0
- package/docs/performance/terminal-engines.md +88 -0
- package/docs/performance.md +120 -0
- package/package.json +4 -4
- package/prd/04-architecture.md +32 -0
- package/prd/05-api/5.1-starting-claude.md +17 -1
- package/prd/05-api/5.2-resuming-claude.md +5 -0
- package/prd/05-api/5.3-claude-session-api.md +267 -40
- package/prd/05-api/5.4-events.md +77 -10
- package/prd/05-api/5.5-starting-codex.md +3 -1
- package/prd/05-api/5.6-resuming-codex.md +4 -1
- package/prd/05-api/5.7-codex-session-api.md +87 -5
- package/prd/05-api/5.8-session-api.md +32 -1
- package/prd/06-claude-hook-bridge.md +2 -0
- package/prd/07a-codex-hook-bridge.md +5 -0
- package/prd/08-state.md +63 -7
- package/prd/09-lifecycle.md +126 -35
- package/prd/10-errors.md +11 -4
- package/prd/12-e2e.md +81 -0
- package/prd/12a-cli.md +63 -9
- package/prd/14-conformance.md +52 -35
- package/prd/16-maintainer-review.md +11 -0
- package/dist/claude/model-composer.d.ts +0 -2
- package/dist/claude/model-composer.d.ts.map +0 -1
- package/dist/claude/model-composer.js +0 -12
- package/dist/claude/model-composer.js.map +0 -1
- package/dist/claude/transcript/drain.d.ts +0 -33
- package/dist/claude/transcript/drain.d.ts.map +0 -1
- package/dist/claude/transcript/drain.js +0 -56
- package/dist/claude/transcript/drain.js.map +0 -1
- package/dist/codex/session/cli-exit.d.ts +0 -24
- package/dist/codex/session/cli-exit.d.ts.map +0 -1
- package/dist/codex/session/cli-exit.js +0 -43
- package/dist/codex/session/cli-exit.js.map +0 -1
- package/dist/codex/transcript/drain.d.ts +0 -30
- package/dist/codex/transcript/drain.d.ts.map +0 -1
- package/dist/codex/transcript/drain.js +0 -48
- package/dist/codex/transcript/drain.js.map +0 -1
- package/dist/runtime/probe-cleanup.d.ts.map +0 -1
- package/dist/runtime/probe-cleanup.js.map +0 -1
- package/dist/runtime/probe.d.ts +0 -11
- package/dist/runtime/probe.d.ts.map +0 -1
- package/dist/runtime/probe.js +0 -113
- package/dist/runtime/probe.js.map +0 -1
- package/dist/runtime/session/foreign-picker.d.ts +0 -8
- package/dist/runtime/session/foreign-picker.d.ts.map +0 -1
- package/dist/runtime/session/foreign-picker.js +0 -18
- package/dist/runtime/session/foreign-picker.js.map +0 -1
- package/dist/runtime/session/picker-input.d.ts +0 -17
- package/dist/runtime/session/picker-input.d.ts.map +0 -1
- package/dist/runtime/session/picker-input.js.map +0 -1
|
@@ -14,7 +14,7 @@ import type { SessionReapPolicy } from "./reap.ts";
|
|
|
14
14
|
export type ShutdownEvidence = "stop_completed" | "kill_completed" | "teardown_completed";
|
|
15
15
|
/** The reap surface shutdown drives: the typed-throw reap plus the retryable one-shot. */
|
|
16
16
|
export type ShutdownReapPolicy = Pick<SessionReapPolicy, "orThrow"> & {
|
|
17
|
-
readonly reaper: Pick<SessionReapPolicy["reaper"], "reap">;
|
|
17
|
+
readonly reaper: Pick<SessionReapPolicy["reaper"], "reap" | "reapAndThrowOnDetachedSweepFailure" | "sweepDetached" | "signalLeaderPty">;
|
|
18
18
|
};
|
|
19
19
|
/** The session surface the shutdown/teardown orchestration drives. */
|
|
20
20
|
export type ShutdownHost = {
|
|
@@ -43,7 +43,8 @@ export declare function managedShutdown(coordinator: ShutdownCoordinator, host:
|
|
|
43
43
|
* may be recycled. In that case it performs a one-shot survivor reap that rejects with
|
|
44
44
|
* a typed error on failure and leaves the reap retryable; a first, live shutdown marks
|
|
45
45
|
* signal ownership, terminates the PTY (which reaps on every path), and records
|
|
46
|
-
* shutdown evidence (C-LIFE-10).
|
|
46
|
+
* shutdown evidence (C-LIFE-10). Either way runtime cleanup follows, even after a
|
|
47
|
+
* failed termination or reap (see `shutdownAttemptThenCleanUp`).
|
|
47
48
|
*/
|
|
48
49
|
export declare function runShutdown(host: ShutdownHost, signal: "SIGTERM" | "SIGKILL", evidence: ShutdownEvidence, ctx: ShutdownContext): Promise<void>;
|
|
49
50
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shutdown.d.ts","sourceRoot":"","sources":["../../../src/runtime/session/shutdown.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"shutdown.d.ts","sourceRoot":"","sources":["../../../src/runtime/session/shutdown.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGvF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAGnD,kFAAkF;AAClF,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,oBAAoB,CAAC;AAE1F,0FAA0F;AAC1F,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,iBAAiB,EAAE,S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AC/B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,SAAS,GAAG,SAAS,EAC7B,QAAQ,EAAE,gBAAgB,EAC1B,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBzF"}
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* as a typed error (never swallows it), while an already-terminal session is never
|
|
6
6
|
* re-signaled — node-pty does not replay the exit and the pid may be recycled.
|
|
7
7
|
*/
|
|
8
|
-
import { elwoodError } from "../../core/errors.js";
|
|
9
8
|
import { terminalStatuses } from "../../core/status-categories.js";
|
|
10
9
|
import { runTeardownSteps } from "../shutdown/teardown.js";
|
|
11
10
|
import { terminatePty } from "../shutdown/terminate.js";
|
|
11
|
+
import { shutdownAttemptThenCleanUp } from "./shutdown-cleanup.js";
|
|
12
12
|
/** Binds `stop`/`kill`/`teardown` to one coordinator + lazily-built host (C-LIFE-10). */
|
|
13
13
|
export function managedShutdown(coordinator, host) {
|
|
14
14
|
return {
|
|
@@ -53,36 +53,21 @@ function mustNotSignal(host, ctx) {
|
|
|
53
53
|
* may be recycled. In that case it performs a one-shot survivor reap that rejects with
|
|
54
54
|
* a typed error on failure and leaves the reap retryable; a first, live shutdown marks
|
|
55
55
|
* signal ownership, terminates the PTY (which reaps on every path), and records
|
|
56
|
-
* shutdown evidence (C-LIFE-10).
|
|
56
|
+
* shutdown evidence (C-LIFE-10). Either way runtime cleanup follows, even after a
|
|
57
|
+
* failed termination or reap (see `shutdownAttemptThenCleanUp`).
|
|
57
58
|
*/
|
|
58
59
|
export async function runShutdown(host, signal, evidence, ctx) {
|
|
59
60
|
host.claimShutdown(evidence); // Claim the exit before signaling.
|
|
61
|
+
const cleanupRuntime = () => host.cleanupRuntime();
|
|
60
62
|
if (mustNotSignal(host, ctx)) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return; // Already signaled / terminal: no new signal, no evidence to submit.
|
|
63
|
+
// Already signaled / terminal: no new signal, no evidence to submit.
|
|
64
|
+
return shutdownAttemptThenCleanUp(() => host.reapPolicy.orThrow(), cleanupRuntime);
|
|
64
65
|
}
|
|
65
66
|
ctx.markSignaled();
|
|
66
|
-
|
|
67
|
-
await
|
|
67
|
+
const terminate = () => terminatePty(host.pty, signal, host.reapPolicy.reaper);
|
|
68
|
+
await shutdownAttemptThenCleanUp(terminate, cleanupRuntime);
|
|
68
69
|
host.submitEvidence(evidence);
|
|
69
70
|
}
|
|
70
|
-
/**
|
|
71
|
-
* Runs runtime cleanup, folding its raw aggregate failure into the stable public
|
|
72
|
-
* `termination_failed` error. `runCleanupSteps` rejects with a bare `Error` on the
|
|
73
|
-
* assumption that its caller wraps it; `stop()`/`kill()` are that caller, so without
|
|
74
|
-
* this an untyped Error would escape the public shutdown boundary (PRD §10).
|
|
75
|
-
*/
|
|
76
|
-
async function cleanupOrThrowTermination(host) {
|
|
77
|
-
try {
|
|
78
|
-
await host.cleanupRuntime();
|
|
79
|
-
}
|
|
80
|
-
catch (error) {
|
|
81
|
-
throw elwoodError("termination_failed", "Could not clean up the Elwood runtime.", {
|
|
82
|
-
cause: error instanceof Error ? error.message : String(error),
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
71
|
/**
|
|
87
72
|
* Teardown: terminate a still-live PTY (unless it was already signaled), reap
|
|
88
73
|
* (retrying a prior failed reap), stop the runtime, record teardown evidence, and
|
|
@@ -100,7 +85,11 @@ export async function runTeardown(host, ctx) {
|
|
|
100
85
|
ctx.markSignaled();
|
|
101
86
|
return terminatePty(host.pty, "SIGKILL", host.reapPolicy.reaper);
|
|
102
87
|
},
|
|
103
|
-
|
|
88
|
+
// No-op once latched; retries a failed reap, and keeps failing while a detached
|
|
89
|
+
// sweep is unresolved, so a retry never reports a possibly running hook as reaped.
|
|
90
|
+
// Typed, so `teardown_failed` keeps its errno, the leader's process-group id, and
|
|
91
|
+
// any unconfirmed process-group ids (§10).
|
|
92
|
+
() => host.reapPolicy.orThrow(),
|
|
104
93
|
() => host.cleanupRuntime(),
|
|
105
94
|
() => host.submitEvidence("teardown_completed"),
|
|
106
95
|
host.removeFiles,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shutdown.js","sourceRoot":"","sources":["../../../src/runtime/session/shutdown.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"shutdown.js","sourceRoot":"","sources":["../../../src/runtime/session/shutdown.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAInE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAiCnE,yFAAyF;AACzF,MAAM,UAAU,eAAe,CAC7B,WAAgC,EAChC,IAAwB;IAExB,OAAO;QACL,IAAI,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC;QACzD,IAAI,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC;QACzD,QAAQ,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,WAAW,EAAE,UAAU,EAAE,IAAI,CAAC;KAClE,CAAC;AACJ,CAAC;AAED,sFAAsF;AACtF,uFAAuF;AACvF,MAAM,aAAa,GAAG;IACpB,IAAI,EAAE,CAAC,IAAkB,EAAE,GAAoB,EAAE,EAAE;QACjD,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,OAAO,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAG,CAAC,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IAAI,EAAE;QAC3B,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACvC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,WAAW,GAAG,KAAK,CAAC;QACtB,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;IACL,IAAI,CAAC;QACH,MAAM,OAAO,EAAE,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,cAAc,GAAG,KAAK,CAAC;IACzB,CAAC;IACD,MAAM,QAAQ,CAAC;IACf,IAAI,WAAW,KAAK,SAAS;QAAE,MAAM,WAAW,CAAC;IACjD,IAAI,cAAc,KAAK,SAAS;QAAE,MAAM,cAAc,CAAC;AACzD,CAAC;AAED,8FAA8F;AAC9F,KAAK,UAAU,eAAe,CAAC,IAAkB,EAAE,OAA4B;IAC7E,IAAI,CAAC,UAAU,EAAE,CAAC;IAClB,MAAM,OAAO,EAAE,CAAC;IAChB,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quoting for the POSIX login shells both adapters launch through (PRD §4.2), kept apart from
|
|
3
|
+
* `shell.ts` so a probe module can quote a path without loading the shell helpers that build
|
|
4
|
+
* probe scripts (§9.2).
|
|
5
|
+
*/
|
|
6
|
+
/** Quotes one argument: wraps it in single quotes, escaping embedded single quotes as '\''. */
|
|
7
|
+
export declare function shellQuote(value: string): string;
|
|
8
|
+
//# sourceMappingURL=shell-quote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-quote.d.ts","sourceRoot":"","sources":["../../src/runtime/shell-quote.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,+FAA+F;AAC/F,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quoting for the POSIX login shells both adapters launch through (PRD §4.2), kept apart from
|
|
3
|
+
* `shell.ts` so a probe module can quote a path without loading the shell helpers that build
|
|
4
|
+
* probe scripts (§9.2).
|
|
5
|
+
*/
|
|
6
|
+
/** Quotes one argument: wraps it in single quotes, escaping embedded single quotes as '\''. */
|
|
7
|
+
export function shellQuote(value) {
|
|
8
|
+
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=shell-quote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell-quote.js","sourceRoot":"","sources":["../../src/runtime/shell-quote.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,+FAA+F;AAC/F,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC;AAC/C,CAAC"}
|
package/dist/runtime/shell.d.ts
CHANGED
|
@@ -1,21 +1,45 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* User shell helpers shared by preflight and PTY launch.
|
|
3
|
-
* Implements PRD §4.2.
|
|
3
|
+
* Implements PRD §4.2, the probe start line of §9.2 (C-PTY-08, C-PERF-05), and the e2e
|
|
4
|
+
* home guard of §12 (C-E2E-24).
|
|
4
5
|
*/
|
|
6
|
+
import { shellQuote } from "./shell-quote.ts";
|
|
5
7
|
export declare function userShell(): string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
export declare function shellQuote(value: string): string;
|
|
8
|
+
export { shellQuote };
|
|
9
|
+
/** The login shell's arguments; the script to run is always the fourth. */
|
|
10
|
+
export type LoginShellArgs = readonly ["-l", "-i", "-c", string];
|
|
11
11
|
/** Interactive login shell for the agent PTY — matches Terminal.app (§4.2). */
|
|
12
|
-
export declare function loginShellCommand(command: string):
|
|
12
|
+
export declare function loginShellCommand(command: string): LoginShellArgs;
|
|
13
13
|
/**
|
|
14
14
|
* Interactive login shell for the non-PTY probes (`--version`, `update`, `--help`).
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
15
|
+
* The same shell and flags as `loginShellCommand` (C-PTY-08): the probes and the agent
|
|
16
|
+
* PTY must resolve the same CLI installation, so a probe loads the same user PATH the
|
|
17
|
+
* PTY launch does. Before the command run, in order: the start line, written on the
|
|
18
|
+
* runner's private control descriptor or, from a shell that closed it, on stdout, so the
|
|
19
|
+
* probe runner can bound the user's profile and the CLI separately; in the e2e suite, the
|
|
20
|
+
* home guard; and the removal of the user's not-found handlers, so a missing CLI reads as
|
|
21
|
+
* missing (C-PERF-05). The command's bound starts at the start line, so it covers what runs
|
|
22
|
+
* between the line and the CLI too: a few builtins.
|
|
23
|
+
*/
|
|
24
|
+
export declare function probeShellCommand(command: string, lookupCommand?: string): LoginShellArgs;
|
|
25
|
+
/**
|
|
26
|
+
* The same login shell, for a lookup answered by its exit status alone (`command -v`). The
|
|
27
|
+
* command's output goes to `/dev/null`, so the probe captures none of it.
|
|
28
|
+
*/
|
|
29
|
+
export declare function probeShellStatus(command: string): LoginShellArgs;
|
|
30
|
+
/** The launch a guard script stops: a session, in its PTY, or a probe, which has no terminal. */
|
|
31
|
+
type GuardedLaunch = "session" | "probe";
|
|
32
|
+
/**
|
|
33
|
+
* The e2e suite's CLI home guard (PRD §12, C-E2E-24). The suite points `CLAUDE_CONFIG_DIR`
|
|
34
|
+
* and `CODEX_HOME`, plus `CLAUDE_CODE_TMPDIR`, at private roots listed in
|
|
35
|
+
* `ELWOOD_E2E_PRIVATE_HOMES`, but
|
|
36
|
+
* each CLI starts through the user's login shell, whose startup files run after Elwood hands
|
|
37
|
+
* over its environment and could replace, unset, or unexport them. Each variable that
|
|
38
|
+
* Elwood's own environment sets to a listed home is guarded: the login shell, after its
|
|
39
|
+
* startup files, exits `homeGuardExitCode` before the agent or probe command unless the
|
|
40
|
+
* variable is still exported and its real path is a listed home. A list that cannot be read
|
|
41
|
+
* stops every launch. With no list, as outside the suite, the script is empty. `launch` picks
|
|
42
|
+
* where the guard reports a stop (`refuse`).
|
|
19
43
|
*/
|
|
20
|
-
export declare function
|
|
44
|
+
export declare function homeGuardScript(launch: GuardedLaunch): string;
|
|
21
45
|
//# sourceMappingURL=shell.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../src/runtime/shell.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../src/runtime/shell.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,2EAA2E;AAC3E,MAAM,MAAM,cAAc,GAAG,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAOjE,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,CAEjE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,cAAc,CAOzF;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,CAEhE;AAmBD,iGAAiG;AACjG,KAAK,aAAa,GAAG,SAAS,GAAG,OAAO,CAAC;AA0BzC;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAe7D"}
|
package/dist/runtime/shell.js
CHANGED
|
@@ -1,30 +1,106 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* User shell helpers shared by preflight and PTY launch.
|
|
3
|
-
* Implements PRD §4.2.
|
|
3
|
+
* Implements PRD §4.2, the probe start line of §9.2 (C-PTY-08, C-PERF-05), and the e2e
|
|
4
|
+
* home guard of §12 (C-E2E-24).
|
|
4
5
|
*/
|
|
5
6
|
import { userInfo } from "node:os";
|
|
7
|
+
import { guardedVariables, homeGuardExitCode, homeGuardHomesKey, homeGuardStopMarker, privateHomes, } from "./home-guard/index.js";
|
|
8
|
+
import { commandLookupScript } from "./probe/lookup.js";
|
|
9
|
+
import { probeControlClose, probeControlFd, probeNotFoundHandlerReset, probeStartScript, } from "./probe/start.js";
|
|
10
|
+
import { shellQuote } from "./shell-quote.js";
|
|
6
11
|
export function userShell() {
|
|
7
12
|
return userInfo().shell || "/bin/zsh";
|
|
8
13
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export function shellQuote(value) {
|
|
14
|
-
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
14
|
+
export { shellQuote };
|
|
15
|
+
/** The interactive login shell's arguments for `script`, shared by the PTY and the probes. */
|
|
16
|
+
function loginShellArgs(script) {
|
|
17
|
+
return ["-l", "-i", "-c", script];
|
|
15
18
|
}
|
|
16
19
|
/** Interactive login shell for the agent PTY — matches Terminal.app (§4.2). */
|
|
17
20
|
export function loginShellCommand(command) {
|
|
18
|
-
return
|
|
21
|
+
return loginShellArgs(`${homeGuardScript("session")}${command}`);
|
|
19
22
|
}
|
|
20
23
|
/**
|
|
21
24
|
* Interactive login shell for the non-PTY probes (`--version`, `update`, `--help`).
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
25
|
+
* The same shell and flags as `loginShellCommand` (C-PTY-08): the probes and the agent
|
|
26
|
+
* PTY must resolve the same CLI installation, so a probe loads the same user PATH the
|
|
27
|
+
* PTY launch does. Before the command run, in order: the start line, written on the
|
|
28
|
+
* runner's private control descriptor or, from a shell that closed it, on stdout, so the
|
|
29
|
+
* probe runner can bound the user's profile and the CLI separately; in the e2e suite, the
|
|
30
|
+
* home guard; and the removal of the user's not-found handlers, so a missing CLI reads as
|
|
31
|
+
* missing (C-PERF-05). The command's bound starts at the start line, so it covers what runs
|
|
32
|
+
* between the line and the CLI too: a few builtins.
|
|
33
|
+
*/
|
|
34
|
+
export function probeShellCommand(command, lookupCommand) {
|
|
35
|
+
// The start line comes first, so the runner still tells a shell that never started the
|
|
36
|
+
// probe from one the e2e home guard stopped after it (`homeGuardStopped`).
|
|
37
|
+
const guard = homeGuardScript("probe");
|
|
38
|
+
const lookup = lookupCommand === undefined ? "" : commandLookupScript(lookupCommand);
|
|
39
|
+
const script = `${probeStartScript}${guard}${probeNotFoundHandlerReset}${lookup}${probeControlClose}${command}`;
|
|
40
|
+
return loginShellArgs(script);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The same login shell, for a lookup answered by its exit status alone (`command -v`). The
|
|
44
|
+
* command's output goes to `/dev/null`, so the probe captures none of it.
|
|
45
|
+
*/
|
|
46
|
+
export function probeShellStatus(command) {
|
|
47
|
+
return probeShellCommand(`${command} >/dev/null 2>&1`);
|
|
48
|
+
}
|
|
49
|
+
function refusalReason(refusal) {
|
|
50
|
+
switch (refusal.kind) {
|
|
51
|
+
case "unreadable_list":
|
|
52
|
+
return `${homeGuardHomesKey} is not a JSON array of absolute paths`;
|
|
53
|
+
case "invalid_home":
|
|
54
|
+
return `the login shell left ${refusal.variable} unexported or not one of the suite's private homes`;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Shell code that writes the stop marker with why the guard stopped the launch, and exits
|
|
59
|
+
* `homeGuardExitCode`. Not on stderr, nor first on stdout, which a startup file can redirect. A
|
|
60
|
+
* session's shell writes to its terminal, `/dev/tty`, which its PTY captures however the
|
|
61
|
+
* startup files redirected stdin, stdout, or stderr. A probe runs in a session of its own, with
|
|
62
|
+
* no terminal (`runProbe`), so it writes on the runner's control descriptor, where its start
|
|
63
|
+
* line went. Either falls back to stdout only if it cannot write there: a probe shell that
|
|
64
|
+
* closed the descriptor wrote its start line on stdout too.
|
|
65
|
+
*/
|
|
66
|
+
function refuse(refusal, launch) {
|
|
67
|
+
const line = shellQuote(`${homeGuardStopMarker}: ${refusalReason(refusal)}`);
|
|
68
|
+
const write = `printf '%s\\n' ${line}`;
|
|
69
|
+
const channel = launch === "session" ? "/dev/tty" : `&${probeControlFd}`;
|
|
70
|
+
return `{ { ${write} >${channel}; } 2>/dev/null || ${write}; exit ${homeGuardExitCode}; }; `;
|
|
71
|
+
}
|
|
72
|
+
// The real path of `$elwood_home`, resolved as the CLI will, against the shell's cwd. `builtin`
|
|
73
|
+
// skips a user's `cd` function or alias, an empty `CDPATH` keeps a relative name relative,
|
|
74
|
+
// zsh's `-q` skips `chpwd` hooks, and only `pwd` may print: a zsh `cd` can print the
|
|
75
|
+
// directory it changed to.
|
|
76
|
+
const realHome = `elwood_home=$(CDPATH=; if [ -n "\${ZSH_VERSION-}" ]; then builtin cd -q -P -- "$elwood_home"; ` +
|
|
77
|
+
'else builtin cd -P -- "$elwood_home"; fi >/dev/null 2>&1 && builtin pwd -P)';
|
|
78
|
+
/**
|
|
79
|
+
* The e2e suite's CLI home guard (PRD §12, C-E2E-24). The suite points `CLAUDE_CONFIG_DIR`
|
|
80
|
+
* and `CODEX_HOME`, plus `CLAUDE_CODE_TMPDIR`, at private roots listed in
|
|
81
|
+
* `ELWOOD_E2E_PRIVATE_HOMES`, but
|
|
82
|
+
* each CLI starts through the user's login shell, whose startup files run after Elwood hands
|
|
83
|
+
* over its environment and could replace, unset, or unexport them. Each variable that
|
|
84
|
+
* Elwood's own environment sets to a listed home is guarded: the login shell, after its
|
|
85
|
+
* startup files, exits `homeGuardExitCode` before the agent or probe command unless the
|
|
86
|
+
* variable is still exported and its real path is a listed home. A list that cannot be read
|
|
87
|
+
* stops every launch. With no list, as outside the suite, the script is empty. `launch` picks
|
|
88
|
+
* where the guard reports a stop (`refuse`).
|
|
26
89
|
*/
|
|
27
|
-
export function
|
|
28
|
-
|
|
90
|
+
export function homeGuardScript(launch) {
|
|
91
|
+
const raw = process.env[homeGuardHomesKey] ?? "";
|
|
92
|
+
if (raw === "")
|
|
93
|
+
return "";
|
|
94
|
+
const homes = privateHomes(raw);
|
|
95
|
+
if (homes === undefined)
|
|
96
|
+
return refuse({ kind: "unreadable_list" }, launch);
|
|
97
|
+
const listed = homes.map(shellQuote).join("|");
|
|
98
|
+
return guardedVariables(homes)
|
|
99
|
+
.map(
|
|
100
|
+
// `printenv` sees only what the shell exports, which is what the CLI inherits.
|
|
101
|
+
(name) => `elwood_home=$(command printenv ${name}) && ${realHome} && ` +
|
|
102
|
+
`case "$elwood_home" in ${listed}) true;; *) false;; esac || ` +
|
|
103
|
+
refuse({ kind: "invalid_home", variable: name }, launch))
|
|
104
|
+
.join("");
|
|
29
105
|
}
|
|
30
106
|
//# sourceMappingURL=shell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../../src/runtime/shell.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../../src/runtime/shell.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EACL,gBAAgB,EAEhB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,GACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,UAAU,SAAS;IACvB,OAAO,QAAQ,EAAE,CAAC,KAAK,IAAI,UAAU,CAAC;AACxC,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,CA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essions shutting down
|
|
3
|
+
* together (PRD §5.3 and §9.4, C-LIFE-10). Each still gets its own timeout.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Joins every request made before a listing starts into that one listing, so a fleet
|
|
7
|
+
* shutting down together runs one `ps` instead of one per session. A request never
|
|
8
|
+
* joins a listing that has already started: each sweep needs a table read after its
|
|
9
|
+
* own leader was frozen. The listing starts on the next turn of the event loop and may
|
|
10
|
+
* run for the largest timeout any of its requests asked for, while each request still
|
|
11
|
+
* rejects with `ETIMEDOUT` at its own timeout: one session's nearly spent deadline never
|
|
12
|
+
* cuts short another's read.
|
|
13
|
+
*/
|
|
14
|
+
export declare function coalesceUnstarted<T>(run: (timeoutMs: number) => Promise<T>): (timeoutMs: number) => Promise<T>;
|
|
15
|
+
//# sourceMappingURL=coalesce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coalesce.d.ts","sourceRoot":"","sources":["../../../src/runtime/shutdown/coalesce.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,GAAG,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GACrC,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAiBnC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Joins concurrent process-table reads into one, for a fleet of sessions shutting down
|
|
3
|
+
* together (PRD §5.3 and §9.4, C-LIFE-10). Each still gets its own timeout.
|
|
4
|
+
*/
|
|
5
|
+
import { processReadTimeout } from "./read-timeout.js";
|
|
6
|
+
/**
|
|
7
|
+
* Joins every request made before a listing starts into that one listing, so a fleet
|
|
8
|
+
* shutting down together runs one `ps` instead of one per session. A request never
|
|
9
|
+
* joins a listing that has already started: each sweep needs a table read after its
|
|
10
|
+
* own leader was frozen. The listing starts on the next turn of the event loop and may
|
|
11
|
+
* run for the largest timeout any of its requests asked for, while each request still
|
|
12
|
+
* rejects with `ETIMEDOUT` at its own timeout: one session's nearly spent deadline never
|
|
13
|
+
* cuts short another's read.
|
|
14
|
+
*/
|
|
15
|
+
export function coalesceUnstarted(run) {
|
|
16
|
+
let open;
|
|
17
|
+
const startBatch = (timeoutMs) => {
|
|
18
|
+
const { promise: started, resolve: start } = Promise.withResolvers();
|
|
19
|
+
const batch = { timeoutMs, result: started.then(() => run(batch.timeoutMs)) };
|
|
20
|
+
setImmediate(() => {
|
|
21
|
+
open = undefined;
|
|
22
|
+
start();
|
|
23
|
+
});
|
|
24
|
+
return batch;
|
|
25
|
+
};
|
|
26
|
+
return (timeoutMs) => {
|
|
27
|
+
open ??= startBatch(timeoutMs);
|
|
28
|
+
open.timeoutMs = Math.max(open.timeoutMs, timeoutMs);
|
|
29
|
+
return withinOwnTimeout(open.result, timeoutMs);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** `result`, or an `ETIMEDOUT` rejection once `timeoutMs` passes first. */
|
|
33
|
+
function withinOwnTimeout(result, timeoutMs) {
|
|
34
|
+
let timer;
|
|
35
|
+
const timedOut = new Promise((_resolve, reject) => {
|
|
36
|
+
timer = setTimeout(() => {
|
|
37
|
+
reject(processReadTimeout("process table read timed out"));
|
|
38
|
+
}, timeoutMs);
|
|
39
|
+
});
|
|
40
|
+
return Promise.race([result, timedOut]).finally(() => clearTimeout(timer));
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=coalesce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coalesce.js","sourceRoot":"","sources":["../../../src/runtime/shutdown/coalesce.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAC/B,GAAsC;IAGtC,IAAI,IAAuB,CAAC;IAC5B,MAAM,U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
|
|
|
1
|
+
/**
|
|
2
|
+
* Failure accounting for the detached-descendant sweep (PRD §5.3 and §9.4, C-LIFE-10):
|
|
3
|
+
* fixed reason phrases, an errno-shaped token when one applies, and a bounded list of
|
|
4
|
+
* the process-group ids involved, so a failure never carries raw process or `ps` output.
|
|
5
|
+
*/
|
|
6
|
+
/** A sweep that could not confirm every group reaped, naming (some of) those groups. */
|
|
7
|
+
export type SweepFailure = Error & {
|
|
8
|
+
readonly processGroupIds: readonly number[];
|
|
9
|
+
/** The first errno token among the failures, when one applies. */
|
|
10
|
+
readonly code?: string;
|
|
11
|
+
};
|
|
12
|
+
/** At most this many process-group ids travel with a failure: enough to inspect, bounded. */
|
|
13
|
+
export declare const MAX_REPORTED_GROUPS = 16;
|
|
14
|
+
export type FailureReason = "process table unreadable" | "process groups not confirmed stopped by the deadline" | "the leader exited before every group was confirmed stopped" | "could not stop the leader's group" | "could not stop a live descendant group" | "could not kill a signaled descendant group" | "could not resume a group spared for Codex's shared daemon" | "no read showed the leader's tree";
|
|
15
|
+
/** Collects one sweep's failures: each reason once, the first errno token, the group ids. */
|
|
16
|
+
export declare class SweepFailures {
|
|
17
|
+
private readonly reasons;
|
|
18
|
+
private readonly processGroupIds;
|
|
19
|
+
private code;
|
|
20
|
+
record(reason: FailureReason, error: unknown, processGroupIds: readonly number[]): void;
|
|
21
|
+
/** The combined failure, or `undefined` when nothing was recorded. */
|
|
22
|
+
result(): SweepFailure | undefined;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=failures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failures.d.ts","sourceRoot":"","sources":["../../../../src/runtime/shutdown/detached-sweep/failures.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,wFAAwF;AACxF,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG;IACjC,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,kEAAkE;IAClE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,6FAA6F;AAC7F,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,MAAM,MAAM,aAAa,GACrB,0BAA0B,GAC1B,sDAAsD,GACtD,4DAA4D,GAC5D,mCAAmC,GACnC,wCAAwC,GACxC,4CAA4C,GAC5C,2DAA2D,GAC3D,kCAAkC,CAAC;AAEvC,6FAA6F;AAC7F,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAC7C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;IACrD,OAAO,CAAC,IAAI,CAAqB;IAEjC,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI;IAQvF,sEAAsE;IACtE,MAAM,IAAI,YAAY,GAAG,SAAS;CAOnC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Failure accounting for the detached-descendant sweep (PRD §5.3 and §9.4, C-LIFE-10):
|
|
3
|
+
* fixed reason phrases, an errno-shaped token when one applies, and a bounded list of
|
|
4
|
+
* the process-group ids involved, so a failure never carries raw process or `ps` output.
|
|
5
|
+
*/
|
|
6
|
+
import { errnoCode, isErrnoToken } from "../../../core/errors.js";
|
|
7
|
+
/** At most this many process-group ids travel with a failure: enough to inspect, bounded. */
|
|
8
|
+
export const MAX_REPORTED_GROUPS = 16;
|
|
9
|
+
/** Collects one sweep's failures: each reason once, the first errno token, the group ids. */
|
|
10
|
+
export class SweepFailures {
|
|
11
|
+
reasons = new Set();
|
|
12
|
+
processGroupIds = new Set();
|
|
13
|
+
code;
|
|
14
|
+
record(reason, error, processGroupIds) {
|
|
15
|
+
const code = errnoCode(error);
|
|
16
|
+
const token = isErrnoToken(code) ? code : undefined;
|
|
17
|
+
this.reasons.add(token === undefined ? reason : `${reason} (${token})`);
|
|
18
|
+
this.code ??= token;
|
|
19
|
+
for (const id of processGroupIds)
|
|
20
|
+
this.processGroupIds.add(id);
|
|
21
|
+
}
|
|
22
|
+
/** The combined failure, or `undefined` when nothing was recorded. */
|
|
23
|
+
result() {
|
|
24
|
+
if (this.reasons.size === 0)
|
|
25
|
+
return undefined;
|
|
26
|
+
const message = `Could not reap detached descendants: ${[...this.reasons].join("; ")}`;
|
|
27
|
+
const processGroupIds = [...this.processGroupIds].slice(0, MAX_REPORTED_GROUPS);
|
|
28
|
+
const code = this.code === undefined ? {} : { code: this.code };
|
|
29
|
+
return Object.assign(new Error(message), { processGroupIds, ...code });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=failures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failures.js","sourceRoot":"","sources":["../../../../src/runtime/shutdown/detached-sweep/failures.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AASlE,6FAA6F;AAC7F,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAYtC,6FAA6F;AAC7F,MAAM,OAAO,aAAa;IACP,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAC5B,eAAe,GAAG,IAAI,GAAG,EAAU,CAAC;IAC7C,IAAI,CAAqB;IAEjC,MAAM,CAAC,MAAqB,EAAE,KAAc,EAAE,eAAkC;QAC9E,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;QAC9B,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;QACpD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,KAAK,KAAK,GAAG,CAAC,CAAC;QACxE,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC;QACpB,KAAK,MAAM,EAAE,IAAI,eAAe;YAAE,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,sEAAsE;IACtE,MAAM;QACJ,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC;YAAE,OAAO,SAAS,CAAC;QAC9C,MAAM,OAAO,GAAG,wCAAwC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACvF,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC;QAChF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;QAChE,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,eAAe,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IACzE,CAAC;CACF"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stops and SIGKILLs every process group a LIVE PTY leader's linked descendants have
|
|
3
|
+
* moved into, before Elwood kills the leader, but Codex's shared daemon, its updater,
|
|
4
|
+
* and what they started (below). Implements PRD §5.3 and §9.4 (C-LIFE-10).
|
|
5
|
+
* Claude and Codex start each hook command with `setsid()`, so a hook in flight at
|
|
6
|
+
* teardown sits in its own session and process group: the leader-group SIGKILL misses
|
|
7
|
+
* it, and once the leader dies the hook is reparented to PID 1 and nothing links it to
|
|
8
|
+
* the session any more. The walk therefore has to happen first. It finds only what is
|
|
9
|
+
* still linked by parent pid (see `detachedDescendantGroups`).
|
|
10
|
+
*
|
|
11
|
+
* A group id read from the table is a snapshot, free for reuse once the group is gone,
|
|
12
|
+
* and a `kill()` that returns has only sent the SIGSTOP. So the sweep acts only on what
|
|
13
|
+
* two consecutive reads show (see `rounds.ts`): a group is sent SIGSTOP once a parent of
|
|
14
|
+
* one of its members is held, read stopped in this read and the one before inside a
|
|
15
|
+
* group the sweep signaled. The walk succeeds only on a read that converges: it shows
|
|
16
|
+
* the leader live, leaves no live group unreached, and holds every live member of every
|
|
17
|
+
* signaled group, the leader's included. A read that shows a signaled group's member
|
|
18
|
+
* running stops that group again. With no hook in flight that takes two reads; each
|
|
19
|
+
* level of nesting adds two more. Then the signaled groups are SIGKILLed deepest first
|
|
20
|
+
* (`kill.ts`). Codex's app-server daemon and its updater loop are shared by every Codex
|
|
21
|
+
* on the same `CODEX_HOME`, the user's own included, so the walk never descends into
|
|
22
|
+
* either: neither one nor anything it started is killed (`shared-daemon.ts`). A group it
|
|
23
|
+
* stopped as its process became one is resumed with SIGCONT, never SIGKILLed, even once
|
|
24
|
+
* the leader's exit left it under PID 1. (A parent that ignores SIGCHLD would have its
|
|
25
|
+
* exited children reaped while stopped; the CLIs and hook shells don't.)
|
|
26
|
+
*/
|
|
27
|
+
import { type SweepFailure } from "./failures.ts";
|
|
28
|
+
import { type SweepOps } from "./rounds.ts";
|
|
29
|
+
export type { SweepOps } from "./rounds.ts";
|
|
30
|
+
/**
|
|
31
|
+
* The whole sweep's deadline. A hook that started a setsid child of its own takes six
|
|
32
|
+
* reads, and on a loaded host one read can take over half a second (docs/cli-behavior.md).
|
|
33
|
+
*/
|
|
34
|
+
export declare const DETACHED_SWEEP_BUDGET_MS = 10000;
|
|
35
|
+
/**
|
|
36
|
+
* Sweeps `leaderPid`'s detached descendant groups and resolves to the unresolved
|
|
37
|
+
* failure, or `undefined` once a read converged and every group it signaled was killed,
|
|
38
|
+
* or resumed as holding Codex's daemon.
|
|
39
|
+
* The leader's own group is left to the group reap. A leader whose exit was observed
|
|
40
|
+
* before the sweep, or whose group refuses its SIGSTOP because it already exited (see
|
|
41
|
+
* `leaderStopFailure`), exited before Elwood signaled it: nothing more is sent and nothing
|
|
42
|
+
* fails. Otherwise `leaderExited` is read after each table read that does not converge;
|
|
43
|
+
* a read that converges ends the walk before that check. Once the leader has exited its
|
|
44
|
+
* pid may be reused, so the sweep stops no further group and never signals the leader's
|
|
45
|
+
* group again, though it still SIGKILLs the groups it already signaled (resuming any
|
|
46
|
+
* that hold Codex's daemon).
|
|
47
|
+
* `onLeaderGroupGone` publishes only whole-group ESRCH or fresh empty-group evidence,
|
|
48
|
+
* never merely a leader exit notification. These are
|
|
49
|
+
* failures: a leader's group that refuses its stop, so no descendant group is signaled;
|
|
50
|
+
* an unreadable table; the deadline passing, or the leader exiting, before a read
|
|
51
|
+
* converged; a live group that could not be stopped or killed; and a group spared for
|
|
52
|
+
* Codex's daemon that could not be resumed (a SIGCONT refused but for its being gone).
|
|
53
|
+
*/
|
|
54
|
+
export declare function sweepDetachedGroups(leaderPid: number, ops: SweepOps, leaderExited: () => boolean, budgetMs?: number, onLeaderGroupGone?: () => void): Promise<SweepFailure | undefined>;
|
|
55
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/runtime/shutdown/detached-sweep/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAKH,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,eAAe,CAAC;AAOjE,OAAO,EAIL,KAAK,QAAQ,EAMd,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAE/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,QAAQ,EACb,YAAY,EAAE,MAAM,OAAO,EAC3B,QAAQ,GAAE,MAAiC,EAC3C,iBAAiB,GAAE,MAAM,IAAsB,GAC9C,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAcnC"}
|