@with-logic/elwood 0.2.1 → 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 +565 -1
- package/CONTRIBUTING.md +3 -0
- package/README.md +4 -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 +6 -5
- package/dist/runtime/session/base.js.map +1 -1
- package/dist/runtime/session/commands.d.ts +5 -3
- 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 +13 -11
- package/dist/runtime/session/picker.d.ts.map +1 -1
- package/dist/runtime/session/picker.js +46 -24
- 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/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/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
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A directory made for one probe's output, mode 0700 under the system temp directory, and its
|
|
3
|
+
* removal however the probe ends (PRD §9.2, C-PERF-05).
|
|
4
|
+
*/
|
|
5
|
+
import { mkdtempSync, rmdirSync, rmSync } from "node:fs";
|
|
6
|
+
import { chmod, readdir, rm } from "node:fs/promises";
|
|
7
|
+
import { tmpdir } from "node:os";
|
|
8
|
+
import { join } from "node:path";
|
|
9
|
+
/** Makes a probe's private directory; `mkdtemp` makes it mode 0700. */
|
|
10
|
+
export function makePrivateDirectory() {
|
|
11
|
+
return mkdtempSync(join(tmpdir(), "elwood-probe-"));
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Removes a probe's private directory, which holds at most `entries`, as the probe settles: an
|
|
15
|
+
* unlink each and an `rmdir`, done at once. A directory the command changed, by what it made, locked,
|
|
16
|
+
* or removed there, is removed off the event loop instead, however large a tree it left. Never
|
|
17
|
+
* throws.
|
|
18
|
+
*/
|
|
19
|
+
export function removePrivateDirectory(dir, entries) {
|
|
20
|
+
try {
|
|
21
|
+
// `force`: setup that failed may not have made them.
|
|
22
|
+
for (const entry of entries)
|
|
23
|
+
rmSync(join(dir, entry), { force: true });
|
|
24
|
+
rmdirSync(dir);
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
void removeTree(dir);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async function removeTree(dir) {
|
|
31
|
+
try {
|
|
32
|
+
// The command may have made the directory, or one it made inside it, unreadable. Elwood
|
|
33
|
+
// owns them, so it can open them again.
|
|
34
|
+
await unlock(dir);
|
|
35
|
+
await rm(dir, { recursive: true, force: true });
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
// Mostly, the command removed the directory itself. Any other failure leaves it behind,
|
|
39
|
+
// unreported: the probe has settled, and nothing reads a removal's outcome yet.
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/** Gives `dir` and every directory under it back their owner's access. */
|
|
43
|
+
async function unlock(dir) {
|
|
44
|
+
await chmod(dir, 0o700);
|
|
45
|
+
for (const entry of await readdir(dir, { withFileTypes: true })) {
|
|
46
|
+
if (entry.isDirectory())
|
|
47
|
+
await unlock(join(dir, entry.name));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=private-directory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"private-directory.js","sourceRoot":"","sources":["../../../src/runtime/probe/private-directory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,uEAAuE;AACvE,MAAM,UAAU,oBAAoB;IAClC,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC;AACtD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,GAAW,EAAE,OAA0B;IAC5E,IAAI,CAAC;QACH,qDAAqD;QACrD,KAAK,MAAM,KAAK,IAAI,OAAO;YAAE,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACvE,SAAS,CAAC,GAAG,CAAC,CAAC;IACjB,CAAC;IAAC,MAAM,CAAC;QACP,KAAK,UAAU,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,GAAW;IACnC,IAAI,CAAC;QACH,wFAAwF;QACxF,wCAAwC;QACxC,MAAM,MAAM,CAAC,GAAG,CAAC,CAAC;QAClB,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,CAAC;IAAC,MAAM,CAAC;QACP,wFAAwF;QACxF,gFAAgF;IAClF,CAAC;AACH,CAAC;AAED,0EAA0E;AAC1E,KAAK,UAAU,MAAM,CAAC,GAAW;IAC/B,MAAM,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACxB,KAAK,MAAM,KAAK,IAAI,MAAM,OAAO,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QAChE,IAAI,KAAK,CAAC,WAAW,EAAE;YAAE,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The results a probe settles with when its command did not simply exit: a spawn error, a
|
|
3
|
+
* bound, an overflow, a login shell that never started the command, or the e2e home guard
|
|
4
|
+
* (PRD §9.2, C-PERF-03, C-PERF-05, C-E2E-24; native spawn diagnostics, C-ERR-08).
|
|
5
|
+
*/
|
|
6
|
+
import type { CommandResult } from "../seams.ts";
|
|
7
|
+
export declare function mapError(error: NodeJS.ErrnoException): NonNullable<CommandResult["error"]>;
|
|
8
|
+
export declare function commandTimedOut(ms: number, stdout: string, stderr: string): CommandResult;
|
|
9
|
+
export declare function launchTimedOut(ms: number, stdout: string, stderr: string): CommandResult;
|
|
10
|
+
export declare function shellExited(status: number | null, stdout: string, stderr: string): CommandResult;
|
|
11
|
+
/** A probe the e2e home guard stopped: the login shell's failure, with only the fixed reason. */
|
|
12
|
+
export declare function guardStopped(stdout: string, stderr: string): CommandResult;
|
|
13
|
+
export declare function overflow(stdout: string, stderr: string): CommandResult;
|
|
14
|
+
//# sourceMappingURL=results.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../../../src/runtime/probe/results.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,cAAc,GAAG,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAE1F;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAGzF;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAIxF;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAIhG;AAED,iGAAiG;AACjG,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAO1E;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAGtE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The results a probe settles with when its command did not simply exit: a spawn error, a
|
|
3
|
+
* bound, an overflow, a login shell that never started the command, or the e2e home guard
|
|
4
|
+
* (PRD §9.2, C-PERF-03, C-PERF-05, C-E2E-24; native spawn diagnostics, C-ERR-08).
|
|
5
|
+
*/
|
|
6
|
+
import { homeGuardExitCode, homeGuardStoppedReason } from "../home-guard/index.js";
|
|
7
|
+
import { maxProbeStreamOutputBytes } from "./capped-buffer.js";
|
|
8
|
+
export function mapError(error) {
|
|
9
|
+
return { code: error.code, syscall: error.syscall, path: error.path, message: error.message };
|
|
10
|
+
}
|
|
11
|
+
export function commandTimedOut(ms, stdout, stderr) {
|
|
12
|
+
const message = `probe timed out after ${ms} ms`;
|
|
13
|
+
return { status: null, stdout, stderr, error: { code: "ETIMEDOUT", message } };
|
|
14
|
+
}
|
|
15
|
+
export function launchTimedOut(ms, stdout, stderr) {
|
|
16
|
+
const message = `login shell did not start the probe command within ${ms} ms`;
|
|
17
|
+
const error = { code: "ETIMEDOUT", message, phase: "login_shell" };
|
|
18
|
+
return { status: null, stdout, stderr, error };
|
|
19
|
+
}
|
|
20
|
+
export function shellExited(status, stdout, stderr) {
|
|
21
|
+
const message = `login shell exited with status ${status} before starting the probe command`;
|
|
22
|
+
const error = { message, phase: "login_shell", shellStatus: status };
|
|
23
|
+
return { status: null, stdout, stderr, error };
|
|
24
|
+
}
|
|
25
|
+
/** A probe the e2e home guard stopped: the login shell's failure, with only the fixed reason. */
|
|
26
|
+
export function guardStopped(stdout, stderr) {
|
|
27
|
+
const error = {
|
|
28
|
+
message: homeGuardStoppedReason,
|
|
29
|
+
phase: "login_shell",
|
|
30
|
+
shellStatus: homeGuardExitCode,
|
|
31
|
+
};
|
|
32
|
+
return { status: null, stdout, stderr, error };
|
|
33
|
+
}
|
|
34
|
+
export function overflow(stdout, stderr) {
|
|
35
|
+
const message = `a probe output stream exceeded ${maxProbeStreamOutputBytes} bytes`;
|
|
36
|
+
return { status: null, stdout, stderr, error: { code: "E2BIG", message } };
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=results.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"results.js","sourceRoot":"","sources":["../../../src/runtime/probe/results.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,UAAU,QAAQ,CAAC,KAA4B;IACnD,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;AAChG,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,EAAU,EAAE,MAAc,EAAE,MAAc;IACxE,MAAM,OAAO,GAAG,yBAAyB,EAAE,KAAK,CAAC;IACjD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,CAAC;AACjF,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,EAAU,EAAE,MAAc,EAAE,MAAc;IACvE,MAAM,OAAO,GAAG,sDAAsD,EAAE,KAAK,CAAC;IAC9E,MAAM,KAAK,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAW,CAAC;IAC5E,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,MAAqB,EAAE,MAAc,EAAE,MAAc;IAC/E,MAAM,OAAO,GAAG,kCAAkC,MAAM,oCAAoC,CAAC;IAC7F,MAAM,KAAK,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,EAAW,CAAC;IAC9E,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AACjD,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,MAAc;IACzD,MAAM,KAAK,GAAG;QACZ,OAAO,EAAE,sBAAsB;QAC/B,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,iBAAiB;KACtB,CAAC;IACX,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,MAAc,EAAE,MAAc;IACrD,MAAM,OAAO,GAAG,kCAAkC,yBAAyB,QAAQ,CAAC;IACpF,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC;AAC7E,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Caps how many probe shells run at once in this process. Each probe starts an interactive
|
|
3
|
+
* login shell, and a heavy profile is CPU-bound: one took about 2 s at 4 concurrent shells and
|
|
4
|
+
* 7-19 s at 16 on a loaded host. Without a cap, a fleet starting in many directories would start
|
|
5
|
+
* a shell for every probe at once and slow all of them. Implements PRD §9.2 and C-PERF-07.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* At most this many probes run at once; the rest wait their turn in arrival order. Eight keeps a
|
|
9
|
+
* heavy profile near 5 s per probe on a loaded 16-CPU host, against about 2 s at four and 7-19 s
|
|
10
|
+
* at sixteen, so a cold fleet still starts eight sessions at a time while each stays well inside
|
|
11
|
+
* its 60 s launch bound (C-PERF-05). The measurements are in docs/cli-behavior.md, "Probe shell
|
|
12
|
+
* startup under concurrency".
|
|
13
|
+
*/
|
|
14
|
+
export declare const maxConcurrentProbes = 8;
|
|
15
|
+
/** Runs `probe` once a slot is free, and frees the slot when it settles either way. */
|
|
16
|
+
export declare function withProbeSlot<T>(probe: () => Promise<T>): Promise<T>;
|
|
17
|
+
//# sourceMappingURL=slots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../../src/runtime/probe/slots.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAKrC,uFAAuF;AACvF,wBAAsB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAW1E"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Caps how many probe shells run at once in this process. Each probe starts an interactive
|
|
3
|
+
* login shell, and a heavy profile is CPU-bound: one took about 2 s at 4 concurrent shells and
|
|
4
|
+
* 7-19 s at 16 on a loaded host. Without a cap, a fleet starting in many directories would start
|
|
5
|
+
* a shell for every probe at once and slow all of them. Implements PRD §9.2 and C-PERF-07.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* At most this many probes run at once; the rest wait their turn in arrival order. Eight keeps a
|
|
9
|
+
* heavy profile near 5 s per probe on a loaded 16-CPU host, against about 2 s at four and 7-19 s
|
|
10
|
+
* at sixteen, so a cold fleet still starts eight sessions at a time while each stays well inside
|
|
11
|
+
* its 60 s launch bound (C-PERF-05). The measurements are in docs/cli-behavior.md, "Probe shell
|
|
12
|
+
* startup under concurrency".
|
|
13
|
+
*/
|
|
14
|
+
export const maxConcurrentProbes = 8;
|
|
15
|
+
let running = 0;
|
|
16
|
+
const waiting = [];
|
|
17
|
+
/** Runs `probe` once a slot is free, and frees the slot when it settles either way. */
|
|
18
|
+
export async function withProbeSlot(probe) {
|
|
19
|
+
if (running < maxConcurrentProbes)
|
|
20
|
+
running += 1;
|
|
21
|
+
else
|
|
22
|
+
await new Promise((resolve) => waiting.push(resolve));
|
|
23
|
+
try {
|
|
24
|
+
return await probe();
|
|
25
|
+
}
|
|
26
|
+
finally {
|
|
27
|
+
// Hand the slot straight to the longest waiter, so a newcomer cannot take it first.
|
|
28
|
+
const next = waiting.shift();
|
|
29
|
+
if (next)
|
|
30
|
+
next();
|
|
31
|
+
else
|
|
32
|
+
running -= 1;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=slots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slots.js","sourceRoot":"","sources":["../../../src/runtime/probe/slots.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAErC,IAAI,OAAO,GAAG,CAAC,CAAC;AAChB,MAAM,OAAO,GAAmB,EAAE,CAAC;AAEnC,uFAAuF;AACvF,MAAM,CAAC,KAAK,UAAU,aAAa,CAAI,KAAuB;IAC5D,IAAI,OAAO,GAAG,mBAAmB;QAAE,OAAO,IAAI,CAAC,CAAC;;QAC3C,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IACjE,IAAI,CAAC;QACH,OAAO,MAAM,KAAK,EAAE,CAAC;IACvB,CAAC;YAAS,CAAC;QACT,oFAAoF;QACpF,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;QAC7B,IAAI,IAAI;YAAE,IAAI,EAAE,CAAC;;YACZ,OAAO,IAAI,CAAC,CAAC;IACpB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recognizes the probe shell's start line, which ends the login shell's launch phase and starts
|
|
3
|
+
* the probe command's own bound: on the runner's private control descriptor, or on stdout from a
|
|
4
|
+
* shell that closed that descriptor at startup. Implements PRD §9.2 and C-PERF-05.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The line a probe shell writes once the user's startup files have loaded, before the probe
|
|
8
|
+
* command runs. It separates the profile's launch time from the command's own bound, which
|
|
9
|
+
* covers everything after the line: the not-found handlers' removal, then the command
|
|
10
|
+
* (PRD §9.2, C-PERF-05). Owned here, by the reader, so the runner never loads the shell
|
|
11
|
+
* helpers that the writer, `probeShellCommand`, lives in. It ends in a token drawn once per
|
|
12
|
+
* parent process: stdout, which the runner also watches, carries the profile's own output,
|
|
13
|
+
* and no profile can print a line it cannot predict.
|
|
14
|
+
*/
|
|
15
|
+
export declare const probeCommandStartLine: string;
|
|
16
|
+
/**
|
|
17
|
+
* The start line's primary channel: a fourth pipe the runner opens for every probe. Not stdout
|
|
18
|
+
* or stderr, so a profile that redirects those (`exec 2>&1`, `exec 2>/dev/null`) cannot hide
|
|
19
|
+
* the line, and captured output stays exactly the profile's and the command's. A shell that
|
|
20
|
+
* closed it at startup writes the line on stdout instead (`probeStartScript`).
|
|
21
|
+
*/
|
|
22
|
+
export declare const probeControlFd = 3;
|
|
23
|
+
/**
|
|
24
|
+
* The probe shell's script prefix: it writes the start line on the control descriptor. macOS's
|
|
25
|
+
* bash 3.2 started with both `-l` and `-i` closes every inherited descriptor above stderr before
|
|
26
|
+
* running the script, so there the write fails, silently, and the line goes to stdout. Not
|
|
27
|
+
* stderr: a profile may send that to `/dev/null` or into stdout, while a profile that hid stdout
|
|
28
|
+
* would hide the line, and so fail the probe as the login shell's. The runner removes the line
|
|
29
|
+
* from captured stdout. The descriptor stays open for the e2e home guard, which writes its stop
|
|
30
|
+
* line where the start line went (PRD §12), until `probeControlClose`.
|
|
31
|
+
*/
|
|
32
|
+
export declare const probeStartScript: string;
|
|
33
|
+
/** Closes the control descriptor before the probe command, so the command does not inherit it. */
|
|
34
|
+
export declare const probeControlClose = "exec 3>&-; ";
|
|
35
|
+
/**
|
|
36
|
+
* The redirection a probe script gives the command it `exec`s: a placeholder that a named-pipe
|
|
37
|
+
* capture replaces with its two pipes' quoted paths once it has made them (`named-pipes.ts`).
|
|
38
|
+
* The paths are never in the login shell's environment, so nothing its startup files run is
|
|
39
|
+
* told where the probe's output goes.
|
|
40
|
+
*/
|
|
41
|
+
export declare const probeOutputRedirect = ">%elwood-probe-stdout% 2>%elwood-probe-stderr%";
|
|
42
|
+
/**
|
|
43
|
+
* Removes the user's not-found handlers before the probe command runs: zsh's
|
|
44
|
+
* `command_not_found_handler` and bash's `command_not_found_handle`. A shell that finds no
|
|
45
|
+
* command runs its handler, so its output would be captured as the command's, and the status
|
|
46
|
+
* the handler returns would replace the 127 that tells preflight the CLI is missing. Each
|
|
47
|
+
* shell ignores the other's name, and a failed `unset` cannot end the shell under `errexit`.
|
|
48
|
+
*/
|
|
49
|
+
export declare const probeNotFoundHandlerReset = "unset -f command_not_found_handler command_not_found_handle 2>/dev/null || :; ";
|
|
50
|
+
/** Whether a probe runs a script that announces its command with the start line. */
|
|
51
|
+
export declare function announcesStart(args: readonly string[]): boolean;
|
|
52
|
+
/** The two streams a probe's start line can arrive on. */
|
|
53
|
+
export type ProbeStartChannel = "control" | "stdout";
|
|
54
|
+
/** Watches both channels; the first to carry the start line starts the command. */
|
|
55
|
+
export declare class ProbeStart {
|
|
56
|
+
private readonly watchers;
|
|
57
|
+
/** Whether any channel has carried the start line. */
|
|
58
|
+
get started(): boolean;
|
|
59
|
+
/** True exactly once across both channels: for the chunk that completes the start line. */
|
|
60
|
+
feed(channel: ProbeStartChannel, chunk: Buffer): boolean;
|
|
61
|
+
/** Removes the start line from captured stdout if the shell wrote it there (C-PERF-05). */
|
|
62
|
+
stripFromStdout(captured: string): string;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=start.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/runtime/probe/start.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,QAAiE,CAAC;AAEpG;;;;;GAKG;AACH,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,QAA0G,CAAC;AAExI,kGAAkG;AAClG,eAAO,MAAM,iBAAiB,gBAAgC,CAAC;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,mDAAmD,CAAC;AAEpF;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,mFAC4C,CAAC;AAEnF,oFAAoF;AACpF,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAE/D;AAKD,0DAA0D;AAC1D,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAErD,mFAAmF;AACnF,qBAAa,UAAU;IAErB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAGvB;IAEF,sDAAsD;IACtD,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,2FAA2F;IAC3F,IAAI,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAKxD,2FAA2F;IAC3F,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;CAG1C"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recognizes the probe shell's start line, which ends the login shell's launch phase and starts
|
|
3
|
+
* the probe command's own bound: on the runner's private control descriptor, or on stdout from a
|
|
4
|
+
* shell that closed that descriptor at startup. Implements PRD §9.2 and C-PERF-05.
|
|
5
|
+
*/
|
|
6
|
+
import { randomBytes } from "node:crypto";
|
|
7
|
+
import { StreamMarkerWatcher } from "../stream-marker.js";
|
|
8
|
+
/**
|
|
9
|
+
* The line a probe shell writes once the user's startup files have loaded, before the probe
|
|
10
|
+
* command runs. It separates the profile's launch time from the command's own bound, which
|
|
11
|
+
* covers everything after the line: the not-found handlers' removal, then the command
|
|
12
|
+
* (PRD §9.2, C-PERF-05). Owned here, by the reader, so the runner never loads the shell
|
|
13
|
+
* helpers that the writer, `probeShellCommand`, lives in. It ends in a token drawn once per
|
|
14
|
+
* parent process: stdout, which the runner also watches, carries the profile's own output,
|
|
15
|
+
* and no profile can print a line it cannot predict.
|
|
16
|
+
*/
|
|
17
|
+
export const probeCommandStartLine = `elwood-probe-command-start-${randomBytes(8).toString("hex")}`;
|
|
18
|
+
/**
|
|
19
|
+
* The start line's primary channel: a fourth pipe the runner opens for every probe. Not stdout
|
|
20
|
+
* or stderr, so a profile that redirects those (`exec 2>&1`, `exec 2>/dev/null`) cannot hide
|
|
21
|
+
* the line, and captured output stays exactly the profile's and the command's. A shell that
|
|
22
|
+
* closed it at startup writes the line on stdout instead (`probeStartScript`).
|
|
23
|
+
*/
|
|
24
|
+
export const probeControlFd = 3;
|
|
25
|
+
/**
|
|
26
|
+
* The probe shell's script prefix: it writes the start line on the control descriptor. macOS's
|
|
27
|
+
* bash 3.2 started with both `-l` and `-i` closes every inherited descriptor above stderr before
|
|
28
|
+
* running the script, so there the write fails, silently, and the line goes to stdout. Not
|
|
29
|
+
* stderr: a profile may send that to `/dev/null` or into stdout, while a profile that hid stdout
|
|
30
|
+
* would hide the line, and so fail the probe as the login shell's. The runner removes the line
|
|
31
|
+
* from captured stdout. The descriptor stays open for the e2e home guard, which writes its stop
|
|
32
|
+
* line where the start line went (PRD §12), until `probeControlClose`.
|
|
33
|
+
*/
|
|
34
|
+
export const probeStartScript = `{ echo ${probeCommandStartLine} >&${probeControlFd}; } 2>/dev/null || echo ${probeCommandStartLine}; `;
|
|
35
|
+
/** Closes the control descriptor before the probe command, so the command does not inherit it. */
|
|
36
|
+
export const probeControlClose = `exec ${probeControlFd}>&-; `;
|
|
37
|
+
/**
|
|
38
|
+
* The redirection a probe script gives the command it `exec`s: a placeholder that a named-pipe
|
|
39
|
+
* capture replaces with its two pipes' quoted paths once it has made them (`named-pipes.ts`).
|
|
40
|
+
* The paths are never in the login shell's environment, so nothing its startup files run is
|
|
41
|
+
* told where the probe's output goes.
|
|
42
|
+
*/
|
|
43
|
+
export const probeOutputRedirect = ">%elwood-probe-stdout% 2>%elwood-probe-stderr%";
|
|
44
|
+
/**
|
|
45
|
+
* Removes the user's not-found handlers before the probe command runs: zsh's
|
|
46
|
+
* `command_not_found_handler` and bash's `command_not_found_handle`. A shell that finds no
|
|
47
|
+
* command runs its handler, so its output would be captured as the command's, and the status
|
|
48
|
+
* the handler returns would replace the 127 that tells preflight the CLI is missing. Each
|
|
49
|
+
* shell ignores the other's name, and a failed `unset` cannot end the shell under `errexit`.
|
|
50
|
+
*/
|
|
51
|
+
export const probeNotFoundHandlerReset = "unset -f command_not_found_handler command_not_found_handle 2>/dev/null || :; ";
|
|
52
|
+
/** Whether a probe runs a script that announces its command with the start line. */
|
|
53
|
+
export function announcesStart(args) {
|
|
54
|
+
return args.at(-1)?.startsWith(probeStartScript) ?? false;
|
|
55
|
+
}
|
|
56
|
+
const startText = `${probeCommandStartLine}\n`;
|
|
57
|
+
const startBytes = Buffer.from(startText);
|
|
58
|
+
/** Watches both channels; the first to carry the start line starts the command. */
|
|
59
|
+
export class ProbeStart {
|
|
60
|
+
// One watcher per channel: a channel added to `ProbeStartChannel` must be given its own.
|
|
61
|
+
watchers = {
|
|
62
|
+
control: new StreamMarkerWatcher(startBytes),
|
|
63
|
+
stdout: new StreamMarkerWatcher(startBytes),
|
|
64
|
+
};
|
|
65
|
+
/** Whether any channel has carried the start line. */
|
|
66
|
+
get started() {
|
|
67
|
+
return Object.values(this.watchers).some((watcher) => watcher.seen);
|
|
68
|
+
}
|
|
69
|
+
/** True exactly once across both channels: for the chunk that completes the start line. */
|
|
70
|
+
feed(channel, chunk) {
|
|
71
|
+
if (this.started)
|
|
72
|
+
return false; // later copies are the command's own output
|
|
73
|
+
return this.watchers[channel].feed(chunk);
|
|
74
|
+
}
|
|
75
|
+
/** Removes the start line from captured stdout if the shell wrote it there (C-PERF-05). */
|
|
76
|
+
stripFromStdout(captured) {
|
|
77
|
+
return this.watchers.stdout.seen ? captured.replace(startText, "") : captured;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=start.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../../src/runtime/probe/start.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,8BAA8B,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;AAEpG;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAEhC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,qBAAqB,MAAM,cAAc,2BAA2B,qBAAqB,IAAI,CAAC;AAExI,kGAAkG;AAClG,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,cAAc,OAAO,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,gDAAgD,CAAC;AAEpF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GACpC,gFAAgF,CAAC;AAEnF,oFAAoF;AACpF,MAAM,UAAU,cAAc,CAAC,IAAuB;IACpD,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,IAAI,KAAK,CAAC;AAC5D,CAAC;AAED,MAAM,SAAS,GAAG,GAAG,qBAAqB,IAAI,CAAC;AAC/C,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAK1C,mFAAmF;AACnF,MAAM,OAAO,UAAU;IACrB,yFAAyF;IACxE,QAAQ,GAA6D;QACpF,OAAO,EAAE,IAAI,mBAAmB,CAAC,UAAU,CAAC;QAC5C,MAAM,EAAE,IAAI,mBAAmB,CAAC,UAAU,CAAC;KAC5C,CAAC;IAEF,sDAAsD;IACtD,IAAI,OAAO;QACT,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,CAAC;IAED,2FAA2F;IAC3F,IAAI,CAAC,OAA0B,EAAE,KAAa;QAC5C,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO,KAAK,CAAC,CAAC,4CAA4C;QAC5E,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,2FAA2F;IAC3F,eAAe,CAAC,QAAgB;QAC9B,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAChF,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A keyed cache for probe results that stays bounded for a long-lived host. Implements the
|
|
3
|
+
* per-process version and capability caches of PRD §9.2 (C-PERF-02) and the
|
|
4
|
+
* never-cache-a-rejection rule of C-LIFE-11.
|
|
5
|
+
*/
|
|
6
|
+
export type ProbeCache<T> = {
|
|
7
|
+
/** The cached or in-flight result for `key`, else the result of a new `run()`. */
|
|
8
|
+
readonly get: (key: string, run: () => Promise<T>) => Promise<T>;
|
|
9
|
+
readonly clear: () => void;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Concurrent callers for one key share its single in-flight run, which is never evicted. Only
|
|
13
|
+
* the `maxSettledSuccesses` most recently used SUCCESSES are kept once settled; the least
|
|
14
|
+
* recently used goes first. In-flight runs do not count toward that bound. A rejection, or a value `succeeded` refuses (a probe that resolves with its failure),
|
|
15
|
+
* is never kept, so a failure cannot poison later callers. A run that settles after `clear()`
|
|
16
|
+
* is dropped rather than cached.
|
|
17
|
+
*/
|
|
18
|
+
export declare function createProbeCache<T>(maxSettledSuccesses: number, succeeded?: (value: T) => boolean): ProbeCache<T>;
|
|
19
|
+
//# sourceMappingURL=probe-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe-cache.d.ts","sourceRoot":"","sources":["../../src/runtime/probe-cache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI;IAC1B,kFAAkF;IAClF,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IACjE,QAAQ,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,mBAAmB,EAAE,MAAM,EAC3B,SAAS,GAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAoB,GAC5C,UAAU,CAAC,CAAC,CAAC,CAwCf"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A keyed cache for probe results that stays bounded for a long-lived host. Implements the
|
|
3
|
+
* per-process version and capability caches of PRD §9.2 (C-PERF-02) and the
|
|
4
|
+
* never-cache-a-rejection rule of C-LIFE-11.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Concurrent callers for one key share its single in-flight run, which is never evicted. Only
|
|
8
|
+
* the `maxSettledSuccesses` most recently used SUCCESSES are kept once settled; the least
|
|
9
|
+
* recently used goes first. In-flight runs do not count toward that bound. A rejection, or a value `succeeded` refuses (a probe that resolves with its failure),
|
|
10
|
+
* is never kept, so a failure cannot poison later callers. A run that settles after `clear()`
|
|
11
|
+
* is dropped rather than cached.
|
|
12
|
+
*/
|
|
13
|
+
export function createProbeCache(maxSettledSuccesses, succeeded = () => true) {
|
|
14
|
+
const running = new Map();
|
|
15
|
+
// Map order is recency order: a hit is re-inserted at the end, eviction takes the front.
|
|
16
|
+
const settled = new Map();
|
|
17
|
+
const get = (key, run) => {
|
|
18
|
+
const hit = settled.get(key);
|
|
19
|
+
if (hit) {
|
|
20
|
+
settled.delete(key);
|
|
21
|
+
settled.set(key, hit);
|
|
22
|
+
return Promise.resolve(hit.value);
|
|
23
|
+
}
|
|
24
|
+
const existing = running.get(key);
|
|
25
|
+
if (existing)
|
|
26
|
+
return existing;
|
|
27
|
+
const pending = run();
|
|
28
|
+
running.set(key, pending);
|
|
29
|
+
const current = () => running.get(key) === pending;
|
|
30
|
+
pending.then((value) => {
|
|
31
|
+
if (!current())
|
|
32
|
+
return;
|
|
33
|
+
running.delete(key);
|
|
34
|
+
if (!succeeded(value))
|
|
35
|
+
return;
|
|
36
|
+
settled.set(key, { value });
|
|
37
|
+
for (const oldest of settled.keys()) {
|
|
38
|
+
if (settled.size <= maxSettledSuccesses)
|
|
39
|
+
break;
|
|
40
|
+
settled.delete(oldest);
|
|
41
|
+
}
|
|
42
|
+
}, () => {
|
|
43
|
+
if (current())
|
|
44
|
+
running.delete(key);
|
|
45
|
+
});
|
|
46
|
+
return pending;
|
|
47
|
+
};
|
|
48
|
+
return {
|
|
49
|
+
get,
|
|
50
|
+
clear: () => {
|
|
51
|
+
running.clear();
|
|
52
|
+
settled.clear();
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=probe-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe-cache.js","sourceRoot":"","sources":["../../src/runtime/probe-cache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAC9B,mBAA2B,EAC3B,YAAmC,GAAG,EAAE,CAAC,IAAI;IAE7C,MAAM,OAAO,GAAG,IAAI,GAAG,EAAsB,CAAC;IAC9C,yFAAyF;IACzF,MAAM,OAAO,GAAG,IAAI,GAAG,EAAiC,CAAC;IACzD,MAAM,GAAG,GAAG,CAAC,GAAW,EAAE,GAAqB,EAAc,EAAE;QAC7D,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,GAAG,EAAE,CAAC;YACR,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACpB,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YACtB,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;QACD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,QAAQ;YAAE,OAAO,QAAQ,CAAC;QAC9B,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC1B,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC;QACnD,OAAO,CAAC,IAAI,CACV,CAAC,KAAK,EAAE,EAAE;YACR,IAAI,CAAC,OAAO,EAAE;gBAAE,OAAO;YACvB,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACpB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;gBAAE,OAAO;YAC9B,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;YAC5B,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;gBACpC,IAAI,OAAO,CAAC,IAAI,IAAI,mBAAmB;oBAAE,MAAM;gBAC/C,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACzB,CAAC;QACH,CAAC,EACD,GAAG,EAAE;YACH,IAAI,OAAO,EAAE;gBAAE,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACrC,CAAC,CACF,CAAC;QACF,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;IACF,OAAO;QACL,GAAG;QACH,KAAK,EAAE,GAAG,EAAE;YACV,OAAO,CAAC,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared hook-backed initial-readiness marker with a starvation deadline.
|
|
2
|
+
* Shared hook-backed initial-readiness marker with a two-stage starvation deadline.
|
|
3
3
|
* Implements PRD §5.3/§9.4, C-API-19, and C-API-28.
|
|
4
4
|
*
|
|
5
5
|
* On a COLD start both adapters gate the first queued message on a pre-input
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
* Claude's `InstructionsLoaded` DOES re-fire — so a resumed Claude is a hook/composer
|
|
16
16
|
* race, whichever arrives first (readiness is idempotent). `armDeadline` is the ultimate
|
|
17
17
|
* fallback for both start and resume so a missing readiness signal never starves the
|
|
18
|
-
* queue forever
|
|
18
|
+
* queue forever: its deadline marks onto a configured composer, and its backstop marks
|
|
19
|
+
* regardless.
|
|
19
20
|
*/
|
|
20
21
|
export type InitialReady = {
|
|
21
22
|
/** Permanently cancel readiness, including frames drained after process exit. */
|
|
@@ -25,8 +26,9 @@ export type InitialReady = {
|
|
|
25
26
|
/** Fire readiness now (one-shot) — the pre-input readiness hook path. */
|
|
26
27
|
readonly mark: () => void;
|
|
27
28
|
/**
|
|
28
|
-
*
|
|
29
|
-
* releases
|
|
29
|
+
* Per rendered frame: re-attempt a hook/deadline mark the composite readiness hold
|
|
30
|
+
* deferred, once it releases (a dialog must clear to a nonblocking idle composer), or
|
|
31
|
+
* a deadline mark still waiting for a configured composer (C-API-28).
|
|
30
32
|
*/
|
|
31
33
|
readonly retryWhenReleased: (readinessHeld: boolean) => void;
|
|
32
34
|
};
|
|
@@ -47,5 +49,29 @@ export type ComposerReadyFacts = {
|
|
|
47
49
|
* composer stays an unsafe signal there (C-API-28).
|
|
48
50
|
*/
|
|
49
51
|
export declare function markReadyOnResumeComposer(ready: Pick<InitialReady, "mark">, resumed: boolean, facts: ComposerReadyFacts, readinessHeld?: boolean): void;
|
|
50
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Twice the longest measured Codex 0.164 trust-gate delay (30.6 s after first output,
|
|
54
|
+
* docs/cli-behavior.md): readiness without a configured composer this long after the
|
|
55
|
+
* first frame is no longer racing a late gate (C-API-28).
|
|
56
|
+
*/
|
|
57
|
+
export declare const initialBackstopMs = 60000;
|
|
58
|
+
/** An adapter's evidence that a rendered composer belongs to a configured session. */
|
|
59
|
+
export type ConfiguredComposerEvidence = {
|
|
60
|
+
/** The latest frame shows a configured session's composer outside any blocking dialog. */
|
|
61
|
+
readonly shown: () => boolean;
|
|
62
|
+
/** Readiness was released after the backstop without that composer on screen. */
|
|
63
|
+
readonly onBackstopRelease: () => void;
|
|
64
|
+
readonly backstopMs?: number;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* With `composer` evidence, the initial deadline marks only onto a frame showing a
|
|
68
|
+
* configured session's composer: a CLI that has not configured its session is still
|
|
69
|
+
* booting, and under load can paint a trust gate after the deadline, so an earlier mark
|
|
70
|
+
* would drain the queue into the boot screen or that gate. A deadline that expires first
|
|
71
|
+
* waits for that frame, and the backstop after the first frame marks anyway, so an
|
|
72
|
+
* unrecognized composer delays readiness but never starves it. A release after the
|
|
73
|
+
* backstop without that composer is reported once through `onBackstopRelease`, so a host
|
|
74
|
+
* can tell it from ordinary readiness (C-API-28).
|
|
75
|
+
*/
|
|
76
|
+
export declare function initialReady(callback: () => void, initialDeadlineMs?: number, isReadinessHeld?: () => boolean, composer?: ConfiguredComposerEvidence): InitialReady;
|
|
51
77
|
//# sourceMappingURL=initial-ready.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initial-ready.d.ts","sourceRoot":"","sources":["../../../src/runtime/readiness/initial-ready.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"initial-ready.d.ts","sourceRoot":"","sources":["../../../src/runtime/readiness/initial-ready.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,MAAM,YAAY,GAAG;IACzB,iFAAiF;IACjF,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC;IACjC,yEAAyE;IACzE,QAAQ,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,EAAE,CAAC,aAAa,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9D,CAAC;AAEF,4EAA4E;AAC5E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,sFAAsF;IACtF,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;CAC3C,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,EACjC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,kBAAkB,EACzB,aAAa,UAAQ,GACpB,IAAI,CAGN;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAAS,CAAC;AAExC,sFAAsF;AACtF,MAAM,MAAM,0BAA0B,GAAG;IACvC,0FAA0F;IAC1F,QAAQ,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC;IAC9B,iFAAiF;IACjF,QAAQ,CAAC,iBAAiB,EAAE,MAAM,IAAI,CAAC;IACvC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,IAAI,EACpB,iBAAiB,SAAS,EAC1B,eAAe,GAAE,MAAM,OAAqB,EAC5C,QAAQ,CAAC,EAAE,0BAA0B,GACpC,YAAY,CAyEd"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared hook-backed initial-readiness marker with a starvation deadline.
|
|
2
|
+
* Shared hook-backed initial-readiness marker with a two-stage starvation deadline.
|
|
3
3
|
* Implements PRD §5.3/§9.4, C-API-19, and C-API-28.
|
|
4
4
|
*
|
|
5
5
|
* On a COLD start both adapters gate the first queued message on a pre-input
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
* Claude's `InstructionsLoaded` DOES re-fire — so a resumed Claude is a hook/composer
|
|
16
16
|
* race, whichever arrives first (readiness is idempotent). `armDeadline` is the ultimate
|
|
17
17
|
* fallback for both start and resume so a missing readiness signal never starves the
|
|
18
|
-
* queue forever
|
|
18
|
+
* queue forever: its deadline marks onto a configured composer, and its backstop marks
|
|
19
|
+
* regardless.
|
|
19
20
|
*/
|
|
20
21
|
/**
|
|
21
22
|
* On RESUME, mark readiness on the first genuine composer frame: the composer is
|
|
@@ -30,11 +31,45 @@ export function markReadyOnResumeComposer(ready, resumed, facts, readinessHeld =
|
|
|
30
31
|
if (resumed && facts.composer_visible && !facts.blocking_prompt_visible && !readinessHeld)
|
|
31
32
|
ready.mark();
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Twice the longest measured Codex 0.164 trust-gate delay (30.6 s after first output,
|
|
36
|
+
* docs/cli-behavior.md): readiness without a configured composer this long after the
|
|
37
|
+
* first frame is no longer racing a late gate (C-API-28).
|
|
38
|
+
*/
|
|
39
|
+
export const initialBackstopMs = 60_000;
|
|
40
|
+
/**
|
|
41
|
+
* With `composer` evidence, the initial deadline marks only onto a frame showing a
|
|
42
|
+
* configured session's composer: a CLI that has not configured its session is still
|
|
43
|
+
* booting, and under load can paint a trust gate after the deadline, so an earlier mark
|
|
44
|
+
* would drain the queue into the boot screen or that gate. A deadline that expires first
|
|
45
|
+
* waits for that frame, and the backstop after the first frame marks anyway, so an
|
|
46
|
+
* unrecognized composer delays readiness but never starves it. A release after the
|
|
47
|
+
* backstop without that composer is reported once through `onBackstopRelease`, so a host
|
|
48
|
+
* can tell it from ordinary readiness (C-API-28).
|
|
49
|
+
*/
|
|
50
|
+
export function initialReady(callback, initialDeadlineMs = 10_000, isReadinessHeld = () => false, composer) {
|
|
51
|
+
const isComposerConfigured = () => composer === undefined || composer.shown();
|
|
34
52
|
let ready = false;
|
|
35
53
|
let cancelled = false;
|
|
36
54
|
let deferredByHold = false;
|
|
55
|
+
let awaitingComposer = false;
|
|
56
|
+
let backstopFired = false;
|
|
37
57
|
let deadline;
|
|
58
|
+
let backstop;
|
|
59
|
+
/**
|
|
60
|
+
* Timer marks are contained. A mark whose callback throws leaves `ready` false; a later
|
|
61
|
+
* readiness hook, or for the deadline the backstop, retries it.
|
|
62
|
+
*/
|
|
63
|
+
const markFromTimer = (composerRequired) => {
|
|
64
|
+
try {
|
|
65
|
+
awaitingComposer = composerRequired && !isComposerConfigured();
|
|
66
|
+
if (!awaitingComposer)
|
|
67
|
+
mark();
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
// Retried by a later readiness hook or timer, as above.
|
|
71
|
+
}
|
|
72
|
+
};
|
|
38
73
|
const mark = () => {
|
|
39
74
|
if (ready || cancelled)
|
|
40
75
|
return;
|
|
@@ -47,39 +82,50 @@ export function initialReady(callback, maxWaitMs = 10_000, isReadinessHeld = ()
|
|
|
47
82
|
return;
|
|
48
83
|
}
|
|
49
84
|
deferredByHold = false;
|
|
85
|
+
const withoutComposer = composer !== undefined && backstopFired && !composer.shown();
|
|
50
86
|
// Latch AFTER the callback returns, so if it throws (a throwing status/activity
|
|
51
87
|
// listener) readiness is NOT consumed and a later hook/deadline/frame retries —
|
|
52
88
|
// a failed transition must never permanently starve the queue (C-API-28).
|
|
53
89
|
callback();
|
|
54
90
|
ready = true;
|
|
91
|
+
clearTimeout(deadline);
|
|
92
|
+
clearTimeout(backstop);
|
|
93
|
+
try {
|
|
94
|
+
if (withoutComposer)
|
|
95
|
+
composer.onBackstopRelease();
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
// A failing warning sink must not undo or block the readiness just released.
|
|
99
|
+
}
|
|
55
100
|
};
|
|
56
101
|
return {
|
|
57
102
|
cancel: () => {
|
|
58
103
|
cancelled = true;
|
|
59
|
-
|
|
60
|
-
|
|
104
|
+
clearTimeout(deadline);
|
|
105
|
+
clearTimeout(backstop);
|
|
61
106
|
},
|
|
62
107
|
mark,
|
|
63
108
|
retryWhenReleased: (readinessHeld) => {
|
|
64
|
-
if (
|
|
109
|
+
if (ready || readinessHeld)
|
|
110
|
+
return;
|
|
111
|
+
// A hold-deferred mark retries once the hold releases; a deadline that expired
|
|
112
|
+
// before the configured composer retries on the first frame showing it, even
|
|
113
|
+
// while work is on screen.
|
|
114
|
+
if (deferredByHold || (awaitingComposer && isComposerConfigured()))
|
|
65
115
|
mark();
|
|
66
116
|
},
|
|
67
117
|
replay: () => void (!cancelled && ready && callback()),
|
|
68
118
|
// Arms on the first frame regardless of hook arrival, so a missing or failed
|
|
69
|
-
// readiness hook cannot starve readiness forever.
|
|
70
|
-
//
|
|
71
|
-
// fails, `ready` stays false so a later hook or composer frame still retries.
|
|
119
|
+
// readiness hook cannot starve readiness forever. Timer marks are contained (a
|
|
120
|
+
// throwing callback on a timer would otherwise be an uncaught exception).
|
|
72
121
|
armDeadline: () => {
|
|
73
|
-
if (cancelled)
|
|
122
|
+
if (cancelled || ready)
|
|
74
123
|
return;
|
|
75
|
-
deadline ??= setTimeout(() =>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
// Retried by a subsequent readiness hook or rendered composer frame.
|
|
81
|
-
}
|
|
82
|
-
}, maxWaitMs);
|
|
124
|
+
deadline ??= setTimeout(() => markFromTimer(true), initialDeadlineMs);
|
|
125
|
+
backstop ??= setTimeout(() => {
|
|
126
|
+
backstopFired = true;
|
|
127
|
+
markFromTimer(false);
|
|
128
|
+
}, composer?.backstopMs ?? initialBackstopMs);
|
|
83
129
|
},
|
|
84
130
|
};
|
|
85
131
|
}
|