@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
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Exact new/resume session facade for headless CLI execution.
|
|
3
|
-
* Implements PRD §12A.2/§12A.5 and C-CLI-03/C-CLI-04/C-CLI-08/C-CLI-15.
|
|
3
|
+
* Implements PRD §12A.2/§12A.5 and C-CLI-03/C-CLI-04/C-CLI-08/C-CLI-15/C-CLI-28.
|
|
4
4
|
*/
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
|
-
import { codexTurnIdentity } from "../../codex/accepted-turn.js";
|
|
7
6
|
import { elwoodError } from "../../core/errors.js";
|
|
8
7
|
import { SessionBase } from "../../core/simple/session.js";
|
|
9
|
-
import { defaultBoundarySignal } from "../../core/simple/turn.js";
|
|
10
8
|
import { readPrivateSessionRecord, removeSessionIdentity } from "../../state/private-session.js";
|
|
11
9
|
import { finalizeRunRequest } from "../request/index.js";
|
|
12
10
|
import { createCliLaunch, defaultCliLaunchDependencies, } from "./launch.js";
|
|
11
|
+
import { cliTurnReaders } from "./turn-readers.js";
|
|
13
12
|
const defaults = {
|
|
14
13
|
randomId: randomUUID,
|
|
15
14
|
readRecord: readPrivateSessionRecord,
|
|
@@ -36,12 +35,13 @@ export class HeadlessCliSession extends SessionBase {
|
|
|
36
35
|
super();
|
|
37
36
|
this.request = request;
|
|
38
37
|
this.agent = request.agent;
|
|
39
|
-
this.readNativeTurn = request.agent
|
|
38
|
+
this.readNativeTurn = cliTurnReaders[request.agent].native;
|
|
39
|
+
this.readBoundarySignal = cliTurnReaders[request.agent].boundary; // C-CLI-28
|
|
40
40
|
this.id = id;
|
|
41
41
|
this.resumed = request.resume !== undefined;
|
|
42
42
|
this.launchSession = launch;
|
|
43
43
|
}
|
|
44
|
-
readBoundarySignal
|
|
44
|
+
readBoundarySignal;
|
|
45
45
|
readNativeTurn;
|
|
46
46
|
launch() {
|
|
47
47
|
const pending = this.validatedLaunch();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/session/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/session/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEjG,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAEL,eAAe,EACf,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAuB,cAAc,EAAE,MAAM,mBAAmB,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AAC,CAAC;QACpE,CAAC;QAAC,MAAM,CAAC;YACP,wFAAwF;QAC1F,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Adapter launch mapping for the headless CLI session facade.
|
|
3
|
-
* Implements PRD §12A.2/§12A.5 and C-CLI-05/C-CLI-06/C-CLI-08/C-CLI-15.
|
|
3
|
+
* Implements PRD §12A.2/§12A.5 and C-CLI-05/C-CLI-06/C-CLI-08/C-CLI-15/C-API-61.
|
|
4
4
|
*/
|
|
5
5
|
import { startClaudeWithId } from "../../claude/session/index.ts";
|
|
6
6
|
import type { ClaudeSessionApi } from "../../claude/session/interface.ts";
|
|
@@ -11,7 +11,7 @@ import type { CodexSessionApi } from "../../codex/session/types.ts";
|
|
|
11
11
|
import type { ElwoodAgentSession } from "../../core/agent-session.ts";
|
|
12
12
|
import type { EffectiveRunRequest } from "../types.ts";
|
|
13
13
|
export type CliLaunchDependencies = {
|
|
14
|
-
readonly prepareStateRoot: (stateDir: string) => void;
|
|
14
|
+
readonly prepareStateRoot: (stateDir: string, cwd: string) => void;
|
|
15
15
|
readonly startClaude: (options: Parameters<typeof startClaudeWithId>[0], id: string) => Promise<ClaudeSessionApi>;
|
|
16
16
|
readonly resumeClaude: typeof resumeClaude;
|
|
17
17
|
readonly startCodex: (options: Parameters<typeof startCodexWithId>[0], id: string) => Promise<CodexSessionApi>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../../../src/cli/session/launch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,E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E,OAAO,WAAW,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,qBAM1C,CAAC;AAEF,gFAAgF;AAChF,wBAAgB,eAAe,CAC7B,OAAO,EAAE,mBAAmB,EAC5B,EAAE,EAAE,MAAM,EACV,YAAY,EAAE,qBAAqB,GAClC,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAGnC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Adapter launch mapping for the headless CLI session facade.
|
|
3
|
-
* Implements PRD §12A.2/§12A.5 and C-CLI-05/C-CLI-06/C-CLI-08/C-CLI-15.
|
|
3
|
+
* Implements PRD §12A.2/§12A.5 and C-CLI-05/C-CLI-06/C-CLI-08/C-CLI-15/C-API-61.
|
|
4
4
|
*/
|
|
5
5
|
import { startClaudeWithId } from "../../claude/session/index.js";
|
|
6
6
|
import { resumeClaude } from "../../claude/session/resume.js";
|
|
7
7
|
import { startCodexWithId } from "../../codex/session/index.js";
|
|
8
8
|
import { resumeCodex } from "../../codex/session/resume.js";
|
|
9
|
+
import { recheckLaunchDirectoryOnFailure } from "../../runtime/session/launch-directory.js";
|
|
9
10
|
import { ensurePrivateStateRoot } from "../../state/private-session.js";
|
|
10
11
|
import { optional } from "../request/values.js";
|
|
11
12
|
export const defaultCliLaunchDependencies = {
|
|
@@ -33,7 +34,7 @@ function claudeLaunch(request, id, dependencies) {
|
|
|
33
34
|
if (request.resume !== undefined)
|
|
34
35
|
return () => dependencies.resumeClaude({ ...common, elwoodSessionId: id });
|
|
35
36
|
return async () => {
|
|
36
|
-
|
|
37
|
+
await prepareStateRoot(request, dependencies);
|
|
37
38
|
return await dependencies.startClaude({ ...common, ...(request.model === undefined ? {} : { model: request.model }) }, id);
|
|
38
39
|
};
|
|
39
40
|
}
|
|
@@ -50,8 +51,16 @@ function codexLaunch(request, id, dependencies) {
|
|
|
50
51
|
if (request.resume !== undefined)
|
|
51
52
|
return () => dependencies.resumeCodex({ ...common, elwoodSessionId: id });
|
|
52
53
|
return async () => {
|
|
53
|
-
|
|
54
|
+
await prepareStateRoot(request, dependencies);
|
|
54
55
|
return await dependencies.startCodex({ ...common, ...(request.model === undefined ? {} : { model: request.model }) }, id);
|
|
55
56
|
};
|
|
56
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Prepares a new session's state root, which is made only while its workspace exists. A
|
|
60
|
+
* workspace removed since it was validated fails the launch as the adapter's start failure
|
|
61
|
+
* (C-API-61), not as a state error.
|
|
62
|
+
*/
|
|
63
|
+
function prepareStateRoot(request, dependencies) {
|
|
64
|
+
return recheckLaunchDirectoryOnFailure(request.agent, request.cwd, async () => dependencies.prepareStateRoot(request.stateDir, request.cwd));
|
|
65
|
+
}
|
|
57
66
|
//# sourceMappingURL=launch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launch.js","sourceRoot":"","sources":["../../../src/cli/session/launch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAG5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAiBhD,MAAM,CAAC,MAAM,4BAA4B,GAA0B;IACjE,gBAAgB,EAAE,sBAAsB;IACxC,WAAW,EAAE,iBAAiB;IAC9B,YAAY;IACZ,UAAU,EAAE,gBAAgB;IAC5B,WAAW;CACZ,CAAC;AAEF,gFAAgF;AAChF,MAAM,UAAU,eAAe,CAC7B,OAA4B,EAC5B,EAAU,EACV,YAAmC;IAEnC,IAAI,OAAO,CAAC,KAAK,KAAK,QAAQ;QAAE,OAAO,YAAY,CAAC,OA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
1
|
+
/**
|
|
2
|
+
* Per-agent turn readers for the headless CLI facade: Claude's boundary reader fails a turn the
|
|
3
|
+
* agent rejected, and Codex binds its native turn identity. Implements PRD §5.8/§12A.2 and
|
|
4
|
+
* C-CLI-28.
|
|
5
|
+
*/
|
|
6
|
+
import type { NativeTurnReader } from "../../core/simple/turn-identity.ts";
|
|
7
|
+
import { type BoundarySignalReader } from "../../core/simple/turn-types.ts";
|
|
8
|
+
import type { CliAgent } from "../types.ts";
|
|
9
|
+
export type CliTurnReaders = {
|
|
10
|
+
readonly boundary: BoundarySignalReader;
|
|
11
|
+
readonly native: NativeTurnReader | undefined;
|
|
12
|
+
};
|
|
13
|
+
export declare const cliTurnReaders: Readonly<Record<CliAgent, CliTurnReaders>>;
|
|
14
|
+
//# sourceMappingURL=turn-readers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"turn-readers.d.ts","sourceRoot":"","sources":["../../../src/cli/session/turn-readers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,KAAK,oBAAoB,EAAyB,MAAM,iCAAiC,CAAC;AACnG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAC;CAC/C,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,cAAc,CAAC,CAGrE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-agent turn readers for the headless CLI facade: Claude's boundary reader fails a turn the
|
|
3
|
+
* agent rejected, and Codex binds its native turn identity. Implements PRD §5.8/§12A.2 and
|
|
4
|
+
* C-CLI-28.
|
|
5
|
+
*/
|
|
6
|
+
import { claudeBoundarySignal } from "../../claude/hooks/stop-failure.js";
|
|
7
|
+
import { codexTurnIdentity } from "../../codex/accepted-turn.js";
|
|
8
|
+
import { defaultBoundarySignal } from "../../core/simple/turn-types.js";
|
|
9
|
+
export const cliTurnReaders = {
|
|
10
|
+
claude: { boundary: claudeBoundarySignal, native: undefined },
|
|
11
|
+
codex: { boundary: defaultBoundarySignal, native: codexTurnIdentity },
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=turn-readers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"turn-readers.js","sourceRoot":"","sources":["../../../src/cli/session/turn-readers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAA6B,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAQnG,MAAM,CAAC,MAAM,cAAc,GAA+C;IACxE,MAAM,EAAE,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,EAAE,SAAS,EAAE;IAC7D,KAAK,EAAE,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,EAAE,iBAAiB,EAAE;CACtE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Marks the Codex configured default model on listed picker rows, read from config.toml,
|
|
3
|
+
* because Codex 0.164 marks only the `(current)` row and names no default on screen.
|
|
4
|
+
* Implements PRD §5.3 `isDefault` and C-API-23.
|
|
5
|
+
*/
|
|
6
|
+
import type { AgentModelOption } from "../../core/models/rows.ts";
|
|
7
|
+
/**
|
|
8
|
+
* Marks the configured default once per listing, under the lock for the session's config. A
|
|
9
|
+
* concurrent `setModel` on that file holds the lock while Codex's picker has written its selection
|
|
10
|
+
* into config.toml, so the temporary selection is never read as the default. A deadline
|
|
11
|
+
* or session close while waiting rejects without reading. `resolveConfigPath` resolves the
|
|
12
|
+
* session's own config (C-CODEX-24), waiting for its launch report if need be.
|
|
13
|
+
*/
|
|
14
|
+
export declare function withCodexDefault(options: readonly AgentModelOption[], signal: AbortSignal, resolveConfigPath: (signal: AbortSignal) => Promise<string>): Promise<readonly AgentModelOption[]>;
|
|
15
|
+
/** A rendered `(default)` marker (older Codex) wins; otherwise the configured row is it. */
|
|
16
|
+
export declare function markCodexDefault(options: readonly AgentModelOption[], configuredModel: string | undefined): readonly AgentModelOption[];
|
|
17
|
+
/**
|
|
18
|
+
* The model a plain `codex` launch with the config at `path` runs: the `model` of the profile
|
|
19
|
+
* the root `profile` key selects, else the root `model` key. TOML requires root keys to
|
|
20
|
+
* precede the first table header, so a `model` inside any other table is never read.
|
|
21
|
+
* Undefined when the config names no model and Codex falls back to its built-in default.
|
|
22
|
+
*/
|
|
23
|
+
export declare function configuredCodexModel(path: string): string | undefined;
|
|
24
|
+
//# sourceMappingURL=default-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-model.d.ts","sourceRoot":"","sources":["../../../src/codex/config/default-model.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AASlE;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,MAAM,EAAE,WAAW,EACnB,iBAAiB,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,GAC1D,OAAO,CAAC,SAAS,gBAAgB,EAAE,CAAC,CAQtC;AAED,4FAA4F;AAC5F,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,eAAe,EAAE,MAAM,GAAG,SAAS,GAClC,SAAS,gBAAgB,EAAE,CAM7B;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAcrE"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Marks the Codex configured default model on listed picker rows, read from config.toml,
|
|
3
|
+
* because Codex 0.164 marks only the `(current)` row and names no default on screen.
|
|
4
|
+
* Implements PRD §5.3 `isDefault` and C-API-23.
|
|
5
|
+
*/
|
|
6
|
+
import { elwoodError, errnoCode } from "../../core/errors.js";
|
|
7
|
+
import { withCodexConfigLock } from "./lock.js";
|
|
8
|
+
import { readCodexConfigFile } from "./read.js";
|
|
9
|
+
const tableHeader = /^\s*\[/;
|
|
10
|
+
const profileTable = /^\s*\[\s*profiles\.(?:"([^"]+)"|'([^']+)'|([\w-]+))\s*\]/;
|
|
11
|
+
const modelKey = /^\s*model\s*=\s*(?:"([^"]*)"|'([^']*)')/;
|
|
12
|
+
const profileKey = /^\s*profile\s*=\s*(?:"([^"]*)"|'([^']*)')/;
|
|
13
|
+
/**
|
|
14
|
+
* Marks the configured default once per listing, under the lock for the session's config. A
|
|
15
|
+
* concurrent `setModel` on that file holds the lock while Codex's picker has written its selection
|
|
16
|
+
* into config.toml, so the temporary selection is never read as the default. A deadline
|
|
17
|
+
* or session close while waiting rejects without reading. `resolveConfigPath` resolves the
|
|
18
|
+
* session's own config (C-CODEX-24), waiting for its launch report if need be.
|
|
19
|
+
*/
|
|
20
|
+
export async function withCodexDefault(options, signal, resolveConfigPath) {
|
|
21
|
+
// Resolved first: a report that cannot be read rejects without waiting for the lock.
|
|
22
|
+
const path = await resolveConfigPath(signal);
|
|
23
|
+
const mark = async () => markCodexDefault(options, configuredCodexModel(path));
|
|
24
|
+
return await withCodexConfigLock(path, mark, {
|
|
25
|
+
signal,
|
|
26
|
+
error: () => signal.reason,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/** A rendered `(default)` marker (older Codex) wins; otherwise the configured row is it. */
|
|
30
|
+
export function markCodexDefault(options, configuredModel) {
|
|
31
|
+
if (options.some((option) => option.isDefault))
|
|
32
|
+
return options;
|
|
33
|
+
const defaultId = configuredModel?.toLowerCase();
|
|
34
|
+
return options.map((option) => option.id === defaultId ? { ...option, isDefault: true } : option);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The model a plain `codex` launch with the config at `path` runs: the `model` of the profile
|
|
38
|
+
* the root `profile` key selects, else the root `model` key. TOML requires root keys to
|
|
39
|
+
* precede the first table header, so a `model` inside any other table is never read.
|
|
40
|
+
* Undefined when the config names no model and Codex falls back to its built-in default.
|
|
41
|
+
*/
|
|
42
|
+
export function configuredCodexModel(path) {
|
|
43
|
+
const text = readConfig(path);
|
|
44
|
+
if (text === undefined)
|
|
45
|
+
return undefined;
|
|
46
|
+
const lines = keyLines(text);
|
|
47
|
+
const root = tableBody(lines, -1);
|
|
48
|
+
const profile = stringValue(root, profileKey);
|
|
49
|
+
const selected = profile === undefined
|
|
50
|
+
? -1
|
|
51
|
+
: lines.findIndex((line) => profileNameFromTableHeader(line) === profile);
|
|
52
|
+
return ((selected < 0 ? undefined : stringValue(tableBody(lines, selected), modelKey)) ??
|
|
53
|
+
stringValue(root, modelKey));
|
|
54
|
+
}
|
|
55
|
+
/** Only a missing file means "no config"; any other failure must not pass as one. */
|
|
56
|
+
function readConfig(path) {
|
|
57
|
+
try {
|
|
58
|
+
return readCodexConfigFile(path);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
throw elwoodError("model_automation_failed", "Could not read the Codex config to find its default model.", { path, code: errnoCode(error) });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The config's lines, with every line that starts inside a multiline string blanked: that
|
|
66
|
+
* text is a value (an instruction quoting `model = "…"`, say), never a key or a header.
|
|
67
|
+
*/
|
|
68
|
+
function keyLines(text) {
|
|
69
|
+
let open;
|
|
70
|
+
return text.split("\n").map((line) => {
|
|
71
|
+
const inValue = open !== undefined;
|
|
72
|
+
open = openAtLineEnd(line, open);
|
|
73
|
+
return inValue ? "" : line;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/** The multiline-string delimiter still open after `line`, given the one open before it. */
|
|
77
|
+
function openAtLineEnd(line, openAtStart) {
|
|
78
|
+
let open = openAtStart;
|
|
79
|
+
let at = 0;
|
|
80
|
+
while (at < line.length) {
|
|
81
|
+
if (open === undefined && line[at] === "#")
|
|
82
|
+
return undefined;
|
|
83
|
+
const delimiter = open ?? stringOpening(line, at);
|
|
84
|
+
if (delimiter === undefined) {
|
|
85
|
+
at += 1;
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
const close = closingIndex(line, open === undefined ? at + delimiter.length : at, delimiter);
|
|
89
|
+
// A single-line string cannot span lines; an unterminated one just ends this line.
|
|
90
|
+
if (close < 0)
|
|
91
|
+
return delimiter.length === 3 ? delimiter : undefined;
|
|
92
|
+
open = undefined;
|
|
93
|
+
at = close + delimiter.length;
|
|
94
|
+
}
|
|
95
|
+
return open;
|
|
96
|
+
}
|
|
97
|
+
/** The delimiter of a string opening at `at`, the multiline form before the plain quote. */
|
|
98
|
+
function stringOpening(line, at) {
|
|
99
|
+
const quote = line[at];
|
|
100
|
+
if (quote !== '"' && quote !== "'")
|
|
101
|
+
return undefined;
|
|
102
|
+
return line.startsWith(quote.repeat(3), at) ? quote.repeat(3) : quote;
|
|
103
|
+
}
|
|
104
|
+
/** Where `delimiter` closes, from `from`; basic (`"`) strings skip backslash escapes. */
|
|
105
|
+
function closingIndex(line, from, delimiter) {
|
|
106
|
+
for (let at = from; at < line.length; at += 1) {
|
|
107
|
+
if (delimiter.startsWith('"') && line[at] === "\\")
|
|
108
|
+
at += 1;
|
|
109
|
+
else if (line.startsWith(delimiter, at))
|
|
110
|
+
return at;
|
|
111
|
+
}
|
|
112
|
+
return -1;
|
|
113
|
+
}
|
|
114
|
+
/** The key lines after the header at `header` (-1 for the root) up to the next header. */
|
|
115
|
+
function tableBody(lines, header) {
|
|
116
|
+
const rest = lines.slice(header + 1);
|
|
117
|
+
const end = rest.findIndex((line) => tableHeader.test(line));
|
|
118
|
+
return end < 0 ? rest : rest.slice(0, end);
|
|
119
|
+
}
|
|
120
|
+
/** The `<name>` of a `[profiles.<name>]` header line, else undefined. */
|
|
121
|
+
function profileNameFromTableHeader(line) {
|
|
122
|
+
const match = profileTable.exec(line);
|
|
123
|
+
return match?.[1] ?? match?.[2] ?? match?.[3];
|
|
124
|
+
}
|
|
125
|
+
function stringValue(lines, key) {
|
|
126
|
+
for (const line of lines) {
|
|
127
|
+
const match = key.exec(line);
|
|
128
|
+
if (match)
|
|
129
|
+
return match[1] ?? match[2];
|
|
130
|
+
}
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=default-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-model.js","sourceRoot":"","sources":["../../../src/codex/config/default-model.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD,MAAM,WAAW,GAAG,QAAQ,CAAC;AAC7B,MAAM,YAAY,GAAG,0DAA0D,CAAC;AAChF,MAAM,QAAQ,GAAG,yCAAyC,CAAC;AAC3D,MAAM,UAAU,GAAG,2CAA2C,CAAC;AAE/D;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OAAoC,EACpC,MAAmB,EACnB,iBAA2D;IAE3D,qFAAqF;IACrF,MAAM,IAAI,GAAG,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/E,OA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AC;IACrD,CAAC;IACD,OAAO,CAAC,CAAC,CAAC;AACZ,CAAC;AAED,0FAA0F;AAC1F,SAAS,SAAS,CAAC,KAAwB,EAAE,MAAc;IACzD,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrC,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7D,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC7C,CAAC;AAED,yEAAyE;AACzE,SAAS,0BAA0B,CAAC,IAAY;IAC9C,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,WAAW,CAAC,KAAwB,EAAE,GAAW;IACxD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `CODEX_HOME` a launched Codex runs with, as reported by the shell that launches it.
|
|
3
|
+
* Codex starts through the user's interactive login shell (§4.2), whose startup files can
|
|
4
|
+
* export a `CODEX_HOME` other than Elwood's own, or derive one from `$PWD`, the terminal, or
|
|
5
|
+
* the session's environment. A second shell cannot reproduce all of that, so the launch shell
|
|
6
|
+
* itself reports, just before it starts Codex, the exported values Codex inherits and the
|
|
7
|
+
* directory it starts Codex in, and the session reads its config.toml path from that report
|
|
8
|
+
* (§5.3). Implements PRD §4.2 and §5.3.
|
|
9
|
+
*/
|
|
10
|
+
/** The launch shell's exit status when it could not write the report (sysexits' EX_CANTCREAT). */
|
|
11
|
+
export declare const reportFailedStatus = 73;
|
|
12
|
+
/**
|
|
13
|
+
* The launch-script step that writes Codex's `CODEX_HOME`, `HOME`, and directory to
|
|
14
|
+
* `reportPath`, and ends the launch shell with `reportFailedStatus` if it cannot, so Codex
|
|
15
|
+
* starts only after a complete report. The values go to a file, not stdout, because startup
|
|
16
|
+
* files print to the same terminal (banners, tool notices, background jobs) and nothing would
|
|
17
|
+
* separate that from the report.
|
|
18
|
+
*/
|
|
19
|
+
export declare function reportCodexHomeCommand(reportPath: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* The config.toml of the `CODEX_HOME` in `reportPath`, by Codex's own rule
|
|
22
|
+
* (`find_codex_home`): a non-empty `CODEX_HOME`, canonicalized the way Codex does, a relative
|
|
23
|
+
* one from the directory Codex runs in; else `$HOME/.codex`, where an empty `HOME` falls back
|
|
24
|
+
* to the account's home directory, as Codex's `home_dir` lookup does, and a relative one is
|
|
25
|
+
* from the directory Codex runs in. A model operation can
|
|
26
|
+
* start before the launch shell has reached the report, so an unfinished report is waited for
|
|
27
|
+
* until `signal` aborts, which then rejects with its reason, naming the report (`waitEnded`).
|
|
28
|
+
*/
|
|
29
|
+
export declare function reportedCodexConfigPath(reportPath: string, signal: AbortSignal): Promise<string>;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the launch shell finished its report, which it does before it starts Codex. A report
|
|
32
|
+
* that cannot be read counts as unfinished.
|
|
33
|
+
*/
|
|
34
|
+
export declare function codexHomeReported(reportPath: string): boolean;
|
|
35
|
+
//# sourceMappingURL=home.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../../../src/codex/config/home.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAkBH,kGAAkG;AAClG,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAC3C,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,MAAM,CAAC,CAMjB;AAWD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAM7D"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `CODEX_HOME` a launched Codex runs with, as reported by the shell that launches it.
|
|
3
|
+
* Codex starts through the user's interactive login shell (§4.2), whose startup files can
|
|
4
|
+
* export a `CODEX_HOME` other than Elwood's own, or derive one from `$PWD`, the terminal, or
|
|
5
|
+
* the session's environment. A second shell cannot reproduce all of that, so the launch shell
|
|
6
|
+
* itself reports, just before it starts Codex, the exported values Codex inherits and the
|
|
7
|
+
* directory it starts Codex in, and the session reads its config.toml path from that report
|
|
8
|
+
* (§5.3). Implements PRD §4.2 and §5.3.
|
|
9
|
+
*/
|
|
10
|
+
import { readFileSync, realpathSync } from "node:fs";
|
|
11
|
+
import { userInfo } from "node:os";
|
|
12
|
+
import { isAbsolute, join } from "node:path";
|
|
13
|
+
import { ElwoodError, elwoodError, errnoCode } from "../../core/errors.js";
|
|
14
|
+
import { abortableDelay } from "../../core/trust/abortable.js";
|
|
15
|
+
import { shellQuote } from "../../runtime/shell.js";
|
|
16
|
+
// A child `/bin/sh` of the launch shell sees only EXPORTED variables, exactly what Codex
|
|
17
|
+
// inherits: an assignment that a startup file did not export reaches neither. It also starts
|
|
18
|
+
// in the launch shell's directory, where Codex starts, and `$PWD` names that directory.
|
|
19
|
+
const reportExported = shellQuote(`printf '%s\\0%s\\0%s\\0' "$CODEX_HOME" "$HOME" "$PWD"`);
|
|
20
|
+
const expectedReportValueCount = 3;
|
|
21
|
+
// Polled often enough that an operation waiting on a launch shell barely adds to its own
|
|
22
|
+
// latency, while each poll stays one small read. The caller's signal bounds the wait.
|
|
23
|
+
const reportPollMs = 25;
|
|
24
|
+
/** The launch shell's exit status when it could not write the report (sysexits' EX_CANTCREAT). */
|
|
25
|
+
export const reportFailedStatus = 73;
|
|
26
|
+
/**
|
|
27
|
+
* The launch-script step that writes Codex's `CODEX_HOME`, `HOME`, and directory to
|
|
28
|
+
* `reportPath`, and ends the launch shell with `reportFailedStatus` if it cannot, so Codex
|
|
29
|
+
* starts only after a complete report. The values go to a file, not stdout, because startup
|
|
30
|
+
* files print to the same terminal (banners, tool notices, background jobs) and nothing would
|
|
31
|
+
* separate that from the report.
|
|
32
|
+
*/
|
|
33
|
+
export function reportCodexHomeCommand(reportPath) {
|
|
34
|
+
return `/bin/sh -c ${reportExported} > ${shellQuote(reportPath)} || exit ${reportFailedStatus}`;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The config.toml of the `CODEX_HOME` in `reportPath`, by Codex's own rule
|
|
38
|
+
* (`find_codex_home`): a non-empty `CODEX_HOME`, canonicalized the way Codex does, a relative
|
|
39
|
+
* one from the directory Codex runs in; else `$HOME/.codex`, where an empty `HOME` falls back
|
|
40
|
+
* to the account's home directory, as Codex's `home_dir` lookup does, and a relative one is
|
|
41
|
+
* from the directory Codex runs in. A model operation can
|
|
42
|
+
* start before the launch shell has reached the report, so an unfinished report is waited for
|
|
43
|
+
* until `signal` aborts, which then rejects with its reason, naming the report (`waitEnded`).
|
|
44
|
+
*/
|
|
45
|
+
export async function reportedCodexConfigPath(reportPath, signal) {
|
|
46
|
+
for (;;) {
|
|
47
|
+
const values = readReport(reportPath);
|
|
48
|
+
if (values !== undefined)
|
|
49
|
+
return join(codexHomeDir(reportPath, values), "config.toml");
|
|
50
|
+
if (!(await abortableDelay(signal, reportPollMs)))
|
|
51
|
+
throw waitEnded(reportPath, signal.reason);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Why the wait for a report ended. A typed reason, such as the operation's deadline, names the
|
|
56
|
+
* report it was waiting for, since the picker never opened; any other passes through as is.
|
|
57
|
+
*/
|
|
58
|
+
function waitEnded(reportPath, reason) {
|
|
59
|
+
if (!(reason instanceof ElwoodError))
|
|
60
|
+
return reason;
|
|
61
|
+
return elwoodError(reason.code, reason.message, { ...reason.details, path: reportPath });
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Whether the launch shell finished its report, which it does before it starts Codex. A report
|
|
65
|
+
* that cannot be read counts as unfinished.
|
|
66
|
+
*/
|
|
67
|
+
export function codexHomeReported(reportPath) {
|
|
68
|
+
try {
|
|
69
|
+
return readReport(reportPath) !== undefined;
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** The report's values once complete; `undefined` while the launch shell is still writing it. */
|
|
76
|
+
function readReport(reportPath) {
|
|
77
|
+
let text;
|
|
78
|
+
try {
|
|
79
|
+
text = readFileSync(reportPath, "utf8");
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
const errno = errnoCode(error);
|
|
83
|
+
if (errno === "ENOENT")
|
|
84
|
+
return undefined;
|
|
85
|
+
throw unreadable(reportPath, { errno });
|
|
86
|
+
}
|
|
87
|
+
const parts = text.split("\0");
|
|
88
|
+
if (isComplete(parts)) {
|
|
89
|
+
const [codexHome, shellHomeDir, codexWorkingDirectory] = parts;
|
|
90
|
+
return [codexHome, shellHomeDir, codexWorkingDirectory];
|
|
91
|
+
}
|
|
92
|
+
// Fewer parts is a report still being written. A value cannot hold a NUL, so anything else
|
|
93
|
+
// is not a report.
|
|
94
|
+
if (parts.length <= expectedReportValueCount)
|
|
95
|
+
return undefined;
|
|
96
|
+
throw unreadable(reportPath, { cause: "The report is not three NUL-terminated values." });
|
|
97
|
+
}
|
|
98
|
+
/** Three NUL-terminated values split into four parts, the last one empty. */
|
|
99
|
+
function isComplete(parts) {
|
|
100
|
+
return parts.length === expectedReportValueCount + 1 && parts[expectedReportValueCount] === "";
|
|
101
|
+
}
|
|
102
|
+
function codexHomeDir(reportPath, values) {
|
|
103
|
+
const [codexHome, shellHomeDir, codexWorkingDirectory] = values;
|
|
104
|
+
if (!codexHome) {
|
|
105
|
+
const home = shellHomeDir || userInfo().homedir;
|
|
106
|
+
// Codex uses `HOME` as given, so a relative one names a path from where Codex runs.
|
|
107
|
+
return isAbsolute(home) ? join(home, ".codex") : `${codexWorkingDirectory}/${home}/.codex`;
|
|
108
|
+
}
|
|
109
|
+
// Joined as text, not with `resolve`, which would drop `dir/..` by name: the kernel, and so
|
|
110
|
+
// Codex's canonicalization, follows `dir` first when it is a symlink, and so does realpath.
|
|
111
|
+
const path = isAbsolute(codexHome) ? codexHome : `${codexWorkingDirectory}/${codexHome}`;
|
|
112
|
+
try {
|
|
113
|
+
return realpathSync.native(path);
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
throw unreadable(reportPath, { codexHome: path, errno: errnoCode(error) });
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function unreadable(path, details) {
|
|
120
|
+
return elwoodError("model_automation_failed", "Could not read the CODEX_HOME this Codex session runs with.", { path, ...details });
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=home.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"home.js","sourceRoot":"","sources":["../../../src/codex/config/home.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAA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
+
* per-session, so two concurrent `setModel` switches on one config file could
|
|
4
|
+
* interleave their snapshot / picker / compare-and-swap restore transactions and
|
|
5
|
+
* leave the wrong model persisted as the user's default. The lock is keyed per canonical
|
|
6
|
+
* config file: every path that names one file (a symlinked home or config, another letter
|
|
7
|
+
* case or Unicode form) shares its lock, and sessions whose configs have different keys never
|
|
8
|
+
* wait on each other. Paths that differ only in case share a key on every volume, so on a
|
|
9
|
+
* case-sensitive volume two such files share a lock. Implements PRD §5.3 setModel restore and
|
|
10
|
+
* C-CODEX-14.
|
|
9
11
|
*
|
|
10
12
|
* SCOPE: this lock is PROCESS-LOCAL. Two separate Elwood processes sharing one
|
|
11
13
|
* `config.toml` can still interleave their transactions — an accepted current
|
|
12
14
|
* limitation (the compare-and-swap still refuses to clobber an unrelated edit).
|
|
13
15
|
* Closing it needs an inter-process lock on the resolved path and is separate work.
|
|
14
16
|
*/
|
|
17
|
+
import { type MutexCancel } from "../../core/async-mutex.ts";
|
|
15
18
|
/**
|
|
16
|
-
* Runs `task` while holding the config
|
|
17
|
-
* holder to finish before starting, and the lock is released when
|
|
18
|
-
* settles (success or failure), so a failing switch never wedges the queue.
|
|
19
|
+
* Runs `task` while holding the lock for the config file at `path`: each caller on that
|
|
20
|
+
* file waits for the prior holder to finish before starting, and the lock is released when
|
|
21
|
+
* `task` settles (success or failure), so a failing switch never wedges the queue. A path
|
|
22
|
+
* that cannot be resolved rejects without running `task`.
|
|
19
23
|
*/
|
|
20
|
-
export declare
|
|
24
|
+
export declare function withCodexConfigLock<T>(path: string, task: () => Promise<T>, cancel?: MutexCancel): Promise<T>;
|
|
25
|
+
/** How many lock entries currently have a holder or waiter. */
|
|
26
|
+
export declare function codexConfigLocksForTests(): number;
|
|
21
27
|
//# sourceMappingURL=lock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../src/codex/config/lock.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../src/codex/config/lock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAAqC,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAQhG;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACtB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,CAAC,CAAC,CAiBZ;AAED,+DAA+D;AAC/D,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD"}
|