@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
package/dist/core/simple/turn.js
CHANGED
|
@@ -4,19 +4,21 @@
|
|
|
4
4
|
* or terminal status. Codex acceptance and Stop identity come from private adapter evidence;
|
|
5
5
|
* public running/ready alone cannot bind or finish its turn. Untagged adapters retain the
|
|
6
6
|
* serialized passive oracle. The Stop oracle checks completeness; it never supplies output.
|
|
7
|
+
* Adapter rejection evidence of the turn's own submission fails it as `turn_failed`: Claude's
|
|
8
|
+
* `StopFailure` (C-API-59) or Codex's failed `task_complete` (C-API-60).
|
|
7
9
|
* Whole-turn deadlines start after physical submission; catch-up deadlines start after idle.
|
|
8
10
|
*/
|
|
9
11
|
import { toError } from "../errors.js";
|
|
10
12
|
import { cancellableSubmission } from "../input/submission-cancel.js";
|
|
11
13
|
import { terminalStatuses } from "../status-categories.js";
|
|
12
|
-
import {
|
|
14
|
+
import { settleHookBoundary, settleNativeBoundary } from "./boundary-signal.js";
|
|
13
15
|
import { toTurnEvent } from "./events.js";
|
|
14
16
|
import { withSubmissionAttempt } from "./submission-context.js";
|
|
15
17
|
import { armTurnTimeout, FALLBACK_QUIET_MS, gateForTurn } from "./turn/defaults.js";
|
|
16
18
|
import { TurnAcceptance } from "./turn-acceptance.js";
|
|
17
19
|
import { TurnBoundary } from "./turn-boundary.js";
|
|
18
20
|
import { TurnIdentity } from "./turn-identity.js";
|
|
19
|
-
import { defaultAcceptanceSignal, defaultBoundarySignal, } from "./turn-types.js";
|
|
21
|
+
import { defaultAcceptanceSignal, defaultBoundarySignal, submitIdentity, } from "./turn-types.js";
|
|
20
22
|
export { defaultAcceptanceSignal, defaultBoundarySignal } from "./turn-types.js";
|
|
21
23
|
/** Attach before owned submission; retain the native boundary after consumer failure. */
|
|
22
24
|
export function runTurn(session, prompt, options = {}) {
|
|
@@ -45,6 +47,7 @@ export function runTurn(session, prompt, options = {}) {
|
|
|
45
47
|
let turnId;
|
|
46
48
|
let started = false;
|
|
47
49
|
let sawReady = false; // a `ready` after the turn started was observed (agent turn is idle/done)
|
|
50
|
+
let acceptedBy; // this turn's own matching submit hook
|
|
48
51
|
let consumerSettled = false;
|
|
49
52
|
// Listeners are removed only once BOTH the consumer has settled AND the real boundary is
|
|
50
53
|
// reached: the boundary observer must outlive a consumer failure (a timed-out turn whose agent
|
|
@@ -91,7 +94,7 @@ export function runTurn(session, prompt, options = {}) {
|
|
|
91
94
|
boundary.armDrain();
|
|
92
95
|
};
|
|
93
96
|
const offNativeBoundary = identity?.observeBoundary((signal) => {
|
|
94
|
-
gate
|
|
97
|
+
settleNativeBoundary(gate, signal);
|
|
95
98
|
nativeIdle();
|
|
96
99
|
}, nativeIdle) ?? (() => undefined);
|
|
97
100
|
const readBoundarySignal = options.readBoundarySignal ?? defaultBoundarySignal;
|
|
@@ -105,9 +108,12 @@ export function runTurn(session, prompt, options = {}) {
|
|
|
105
108
|
acceptance.accept();
|
|
106
109
|
return; // Public Stop precedes its callback outcome; only private confirmation owns the oracle.
|
|
107
110
|
}
|
|
108
|
-
if (defaultAcceptanceSignal(event, prompt))
|
|
111
|
+
if (defaultAcceptanceSignal(event, prompt)) {
|
|
109
112
|
acceptance.accept();
|
|
110
|
-
|
|
113
|
+
if (event.hook_event_name === "UserPromptSubmit")
|
|
114
|
+
acceptedBy = submitIdentity(event);
|
|
115
|
+
}
|
|
116
|
+
settleHookBoundary(gate, readBoundarySignal(event), acceptedBy);
|
|
111
117
|
});
|
|
112
118
|
const offStatus = session.on("status", ({ status }) => {
|
|
113
119
|
if (status === "running") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turn.js","sourceRoot":"","sources":["../../../src/core/simple/turn.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"turn.js","sourceRoot":"","sources":["../../../src/core/simple/turn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EAGrB,cAAc,GAGf,MAAM,iBAAiB,CAAC;AAYzB,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;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15
15
|
readonly style: "numbered";
|
|
16
16
|
readonly label: string;
|
|
17
17
|
readonly number: string;
|
|
18
|
+
/** The row carries the list's caret: Enter alone would confirm this option. */
|
|
19
|
+
readonly selected?: true;
|
|
18
20
|
} | {
|
|
19
21
|
readonly style: "cursor";
|
|
20
22
|
readonly label: string;
|
|
23
|
+
/** Rows from the rendered cursor to this option (negative above it). */
|
|
21
24
|
readonly offset: number;
|
|
25
|
+
/** Absolute row within the cursor block; Home lands on index 0. */
|
|
26
|
+
readonly index: number;
|
|
22
27
|
};
|
|
23
28
|
/** Extracts `N. label` / `N) label` options from `text`, tolerating `›`/`>` prefixes. */
|
|
24
29
|
export declare function numberedOptions(text: string): readonly NumberedOption[];
|
|
@@ -26,7 +31,18 @@ export declare function numberedOptions(text: string): readonly NumberedOption[]
|
|
|
26
31
|
export declare function selectableOptions(text: string): readonly SelectableOption[];
|
|
27
32
|
/** Bounded, printable selection description used in startup-prompt activity. */
|
|
28
33
|
export declare function optionInput(option: SelectableOption): string;
|
|
29
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Absolute cursor selection: Home, then one Down per row above the option. Unlike a
|
|
36
|
+
* relative arrow, it lands on the same row however often it repeats and whatever the
|
|
37
|
+
* cursor was on, so a delayed or duplicated write cannot move past the option.
|
|
38
|
+
*/
|
|
39
|
+
export declare function cursorSelection(option: Extract<SelectableOption, {
|
|
40
|
+
style: "cursor";
|
|
41
|
+
}>): string;
|
|
42
|
+
/**
|
|
43
|
+
* Raw PTY writes that answer `option` from the rendered frame: the number, or (when the
|
|
44
|
+
* cursor is elsewhere) the bare selection followed by selection+Enter as ONE write.
|
|
45
|
+
*/
|
|
30
46
|
export declare function optionKeystrokes(option: SelectableOption): readonly string[];
|
|
31
47
|
/**
|
|
32
48
|
* The frame's HEADER text: everything strictly before the first numbered option
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-options.d.ts","sourceRoot":"","sources":["../../src/core/terminal-options.ts"],"names":[],"mappings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;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMnD;AAwBD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,QAAQ,SAAI,GACX;IAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAGrE"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* consumers consistent across CLI layout changes. `nonOptionText` is shared by the
|
|
7
7
|
* responder and screen-fact blocking rules, so option text cannot spoof a header.
|
|
8
8
|
*/
|
|
9
|
+
import { arrowDown } from "./input/constants.js";
|
|
9
10
|
/** Extracts `N. label` / `N) label` options from `text`, tolerating `›`/`>` prefixes. */
|
|
10
11
|
export function numberedOptions(text) {
|
|
11
12
|
return positionedNumberedOptions(text.split("\n")).map(({ number, label }) => ({
|
|
@@ -24,17 +25,25 @@ export function selectableOptions(text) {
|
|
|
24
25
|
export function optionInput(option) {
|
|
25
26
|
if (option.style === "numbered")
|
|
26
27
|
return option.number;
|
|
27
|
-
|
|
28
|
-
return "enter";
|
|
29
|
-
const direction = option.offset < 0 ? "up" : "down";
|
|
30
|
-
return `${`${direction}+`.repeat(Math.abs(option.offset))}enter`;
|
|
28
|
+
return ["home", ...new Array(option.index).fill("down"), "enter"].join("+");
|
|
31
29
|
}
|
|
32
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Absolute cursor selection: Home, then one Down per row above the option. Unlike a
|
|
32
|
+
* relative arrow, it lands on the same row however often it repeats and whatever the
|
|
33
|
+
* cursor was on, so a delayed or duplicated write cannot move past the option.
|
|
34
|
+
*/
|
|
35
|
+
export function cursorSelection(option) {
|
|
36
|
+
return `\u001b[H${arrowDown.repeat(option.index)}`;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Raw PTY writes that answer `option` from the rendered frame: the number, or (when the
|
|
40
|
+
* cursor is elsewhere) the bare selection followed by selection+Enter as ONE write.
|
|
41
|
+
*/
|
|
33
42
|
export function optionKeystrokes(option) {
|
|
34
43
|
if (option.style === "numbered")
|
|
35
44
|
return [`${option.number}\r`];
|
|
36
|
-
const
|
|
37
|
-
return
|
|
45
|
+
const select = cursorSelection(option);
|
|
46
|
+
return option.offset === 0 ? [`${select}\r`] : [select, `${select}\r`];
|
|
38
47
|
}
|
|
39
48
|
/**
|
|
40
49
|
* The frame's HEADER text: everything strictly before the first numbered option
|
|
@@ -53,12 +62,14 @@ export function nonOptionText(frame) {
|
|
|
53
62
|
function positionedNumberedOptions(lines) {
|
|
54
63
|
return lines.flatMap((line, row) => {
|
|
55
64
|
const matches = line.matchAll(/(?:^|[\s›>])(\d+)[.)]\s*(.+?)(?=\s*\d+[.)]\s*|$)/g);
|
|
56
|
-
|
|
65
|
+
const caret = /^\s*[❯›>]\s*\d+[.)]/.test(line);
|
|
66
|
+
return [...matches].map((match, index) => {
|
|
57
67
|
return {
|
|
58
68
|
row,
|
|
59
69
|
style: "numbered",
|
|
60
70
|
label: match[2].trim(),
|
|
61
71
|
number: match[1],
|
|
72
|
+
...(caret && index === 0 ? { selected: true } : {}),
|
|
62
73
|
};
|
|
63
74
|
});
|
|
64
75
|
});
|
|
@@ -90,6 +101,7 @@ function positionedCursorOptions(lines) {
|
|
|
90
101
|
style: "cursor",
|
|
91
102
|
label: row === selectedRow ? selected[3].trim() : line.trim(),
|
|
92
103
|
offset: row - selectedRow,
|
|
104
|
+
index,
|
|
93
105
|
};
|
|
94
106
|
});
|
|
95
107
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-options.js","sourceRoot":"","sources":["../../src/core/terminal-options.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"terminal-options.js","sourceRoot":"","sources":["../../src/core/terminal-options.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,E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kBAAkB,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAW,EAAE,WAAW,CAAC;QAE7D,OAAO,EAAE,CAAC;IACZ,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AACnE,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAY,EAAE,WAAmB;IAC3D,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,OAAO,KAAK,KAAK,IAAI,IAAK,KAAK,CAAC,CAAC,CAAY,CAAC,MAAM,KAAK,WAAW,CAAC;AACvE,CAAC"}
|
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export declare function byteLen(text: string): number;
|
|
10
10
|
export declare function fileSize(path: string): number;
|
|
11
|
+
/**
|
|
12
|
+
* The file's size from one stat, or `undefined` when it does not exist. One stat, no
|
|
13
|
+
* exists-then-stat TOCTOU window: any other error propagates to the caller's fs guard.
|
|
14
|
+
* The errno is read via `errnoCode` (object-ness narrowed first) so a thrown
|
|
15
|
+
* null/non-Error is preserved and rethrown, never replaced by a secondary TypeError
|
|
16
|
+
* (C-ERR-01).
|
|
17
|
+
*/
|
|
18
|
+
export declare function observedSize(path: string): number | undefined;
|
|
11
19
|
export type RangeRead = {
|
|
12
20
|
readonly text: string;
|
|
13
21
|
readonly bytes: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor-io.d.ts","sourceRoot":"","sources":["../../../src/core/transcript/cursor-io.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"cursor-io.d.ts","sourceRoot":"","sources":["../../../src/core/transcript/cursor-io.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAO7D;AAED,MAAM,MAAM,SAAS,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1E,uFAAuF;AACvF,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;AAiBjF,eAAO,MAAM,SAAS,EAAE,UAAgD,CAAC;AAMzE,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CAIhF;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAE9D;AACD,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C"}
|
|
@@ -13,16 +13,22 @@ export function byteLen(text) {
|
|
|
13
13
|
return Buffer.byteLength(text, "utf8");
|
|
14
14
|
}
|
|
15
15
|
export function fileSize(path) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
return observedSize(path) ?? 0;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The file's size from one stat, or `undefined` when it does not exist. One stat, no
|
|
20
|
+
* exists-then-stat TOCTOU window: any other error propagates to the caller's fs guard.
|
|
21
|
+
* The errno is read via `errnoCode` (object-ness narrowed first) so a thrown
|
|
22
|
+
* null/non-Error is preserved and rethrown, never replaced by a secondary TypeError
|
|
23
|
+
* (C-ERR-01).
|
|
24
|
+
*/
|
|
25
|
+
export function observedSize(path) {
|
|
20
26
|
try {
|
|
21
27
|
return statSync(path).size;
|
|
22
28
|
}
|
|
23
29
|
catch (error) {
|
|
24
30
|
if (errnoCode(error) === "ENOENT")
|
|
25
|
-
return
|
|
31
|
+
return undefined;
|
|
26
32
|
throw error;
|
|
27
33
|
}
|
|
28
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor-io.js","sourceRoot":"","sources":["../../../src/core/transcript/cursor-io.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,
|
|
1
|
+
{"version":3,"file":"cursor-io.js","sourceRoot":"","sources":["../../../src/core/transcript/cursor-io.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,I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AC,MAAM,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACxE,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,MAAkB;IACtD,aAAa,GAAG,MAAM,CAAC;AACzB,CAAC;AACD,MAAM,UAAU,uBAAuB;IACrC,aAAa,GAAG,aAAa,CAAC;AAChC,CAAC"}
|
|
@@ -6,8 +6,11 @@
|
|
|
6
6
|
* buffered only up to a bounded ceiling; a record past it is discarded through its
|
|
7
7
|
* next newline so a no-newline giant line can't OOM or re-concatenate quadratically.
|
|
8
8
|
*
|
|
9
|
-
* Both adapters share these forward-read semantics verbatim
|
|
10
|
-
*
|
|
9
|
+
* Both adapters share these forward-read semantics verbatim, and every read goes through
|
|
10
|
+
* `readLiveChunk()`'s existence policy (§5.7, C-CLAUDE-24, C-CODEX-23): until a stat has
|
|
11
|
+
* seen the file, ENOENT means "not created yet"; after that it is a removal that throws for
|
|
12
|
+
* the caller's fs guard. Claude extends the base with a backward baseline-tail scan and an
|
|
13
|
+
* async `needsScan`.
|
|
11
14
|
*/
|
|
12
15
|
/** Outcome of a bounded read: the decoded text plus whether an immediate next read
|
|
13
16
|
* can make progress (canContinueNow). An incomplete UTF-8 tail leaves unread bytes
|
|
@@ -38,9 +41,30 @@ export declare class BoundedTranscriptCursor {
|
|
|
38
41
|
protected offset: number;
|
|
39
42
|
private pending;
|
|
40
43
|
private discarding;
|
|
44
|
+
private created;
|
|
45
|
+
/** Starts at the file's current end. One stat gives both that offset and whether the
|
|
46
|
+
* file exists, so the two never disagree about a file removed in between. */
|
|
41
47
|
constructor(path: string);
|
|
42
|
-
/**
|
|
43
|
-
|
|
48
|
+
/**
|
|
49
|
+
* One bounded chunk under the existence policy; callers loop on `canContinueNow`. A
|
|
50
|
+
* file not created yet reads nothing. The chunk is sized by this read's own stat, so a
|
|
51
|
+
* removal can never read as a truncation and reset the cursor.
|
|
52
|
+
*/
|
|
53
|
+
readLiveChunk(): ChunkRead;
|
|
54
|
+
/**
|
|
55
|
+
* The file's size from one stat under the existence policy: `undefined` while it has
|
|
56
|
+
* never existed. ENOENT after it existed, and any other failure, throws for the fs guard.
|
|
57
|
+
*/
|
|
58
|
+
protected liveSize(): number | undefined;
|
|
59
|
+
/** Record a stat that saw the file, returning its size. */
|
|
60
|
+
protected sawSize(size: number): number;
|
|
61
|
+
/** A stat failure is only "not created yet" for ENOENT before any stat saw the file. */
|
|
62
|
+
protected rethrowUnlessUncreated(error: unknown): void;
|
|
63
|
+
/**
|
|
64
|
+
* Read up to `maxChunkBytes` of new content, advancing the cursor by bytes consumed.
|
|
65
|
+
* `size` comes from the policy-aware stat that sized this read.
|
|
66
|
+
*/
|
|
67
|
+
private readChunk;
|
|
44
68
|
takeLines(text: string): TakenLines;
|
|
45
69
|
/** The final buffered partial line (flushed once at teardown), then cleared. */
|
|
46
70
|
drainPending(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../../src/core/transcript/cursor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../../src/core/transcript/cursor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAWH;;wFAEwF;AACxF,MAAM,MAAM,SAAS,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpF;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;CACxC,CAAC;AAEF;;;;GAIG;AACH,qBAAa,uBAAuB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,OAAO,CAAM;IAGrB,OAAO,CAAC,UAAU,CAAS;IAG3B,OAAO,CAAC,OAAO,CAAU;IAEzB;kFAC8E;gBAClE,IAAI,EAAE,MAAM;IAOxB;;;;OAIG;IACH,aAAa,IAAI,SAAS;IAK1B;;;OAGG;IACH,SAAS,CAAC,QAAQ,IAAI,MAAM,GAAG,SAAS;IASxC,2DAA2D;IAC3D,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAKvC,wFAAwF;IACxF,SAAS,CAAC,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAItD;;;OAGG;IACH,OAAO,CAAC,SAAS;IAgCjB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU;IAoBnC,gFAAgF;IAChF,YAAY,IAAI,MAAM;IAStB,cAAc,IAAI,MAAM;CAIzB"}
|
|
@@ -6,10 +6,15 @@
|
|
|
6
6
|
* buffered only up to a bounded ceiling; a record past it is discarded through its
|
|
7
7
|
* next newline so a no-newline giant line can't OOM or re-concatenate quadratically.
|
|
8
8
|
*
|
|
9
|
-
* Both adapters share these forward-read semantics verbatim
|
|
10
|
-
*
|
|
9
|
+
* Both adapters share these forward-read semantics verbatim, and every read goes through
|
|
10
|
+
* `readLiveChunk()`'s existence policy (§5.7, C-CLAUDE-24, C-CODEX-23): until a stat has
|
|
11
|
+
* seen the file, ENOENT means "not created yet"; after that it is a removal that throws for
|
|
12
|
+
* the caller's fs guard. Claude extends the base with a backward baseline-tail scan and an
|
|
13
|
+
* async `needsScan`.
|
|
11
14
|
*/
|
|
12
|
-
import {
|
|
15
|
+
import { statSync } from "node:fs";
|
|
16
|
+
import { errnoCode } from "../errors.js";
|
|
17
|
+
import { byteLen, fileSize, observedSize, readRange } from "./cursor-io.js";
|
|
13
18
|
const maxChunkBytes = 256 * 1024; // bytes read per scan pass (a large delta streams)
|
|
14
19
|
// Max bytes a single un-terminated record may buffer before it is discarded through
|
|
15
20
|
// its next newline (a no-newline giant line can't OOM or re-concat quadratically).
|
|
@@ -26,13 +31,54 @@ export class BoundedTranscriptCursor {
|
|
|
26
31
|
// When the current un-terminated line overflowed, discard incoming bytes up to
|
|
27
32
|
// (and including) the next newline instead of buffering them.
|
|
28
33
|
discarding = false;
|
|
34
|
+
// A CLI can name its transcript before writing it, so until a stat has seen the file,
|
|
35
|
+
// ENOENT means "not created yet" rather than a removal or rotation (§5.7).
|
|
36
|
+
created;
|
|
37
|
+
/** Starts at the file's current end. One stat gives both that offset and whether the
|
|
38
|
+
* file exists, so the two never disagree about a file removed in between. */
|
|
29
39
|
constructor(path) {
|
|
40
|
+
const size = observedSize(path);
|
|
30
41
|
this.path = path;
|
|
31
|
-
this.offset =
|
|
42
|
+
this.offset = size ?? 0;
|
|
43
|
+
this.created = size !== undefined;
|
|
32
44
|
}
|
|
33
|
-
/**
|
|
34
|
-
|
|
35
|
-
|
|
45
|
+
/**
|
|
46
|
+
* One bounded chunk under the existence policy; callers loop on `canContinueNow`. A
|
|
47
|
+
* file not created yet reads nothing. The chunk is sized by this read's own stat, so a
|
|
48
|
+
* removal can never read as a truncation and reset the cursor.
|
|
49
|
+
*/
|
|
50
|
+
readLiveChunk() {
|
|
51
|
+
const size = this.liveSize();
|
|
52
|
+
return size === undefined ? { text: "", canContinueNow: false } : this.readChunk(size);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The file's size from one stat under the existence policy: `undefined` while it has
|
|
56
|
+
* never existed. ENOENT after it existed, and any other failure, throws for the fs guard.
|
|
57
|
+
*/
|
|
58
|
+
liveSize() {
|
|
59
|
+
try {
|
|
60
|
+
return this.sawSize(statSync(this.path).size);
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
this.rethrowUnlessUncreated(error);
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/** Record a stat that saw the file, returning its size. */
|
|
68
|
+
sawSize(size) {
|
|
69
|
+
this.created = true;
|
|
70
|
+
return size;
|
|
71
|
+
}
|
|
72
|
+
/** A stat failure is only "not created yet" for ENOENT before any stat saw the file. */
|
|
73
|
+
rethrowUnlessUncreated(error) {
|
|
74
|
+
if (this.created || errnoCode(error) !== "ENOENT")
|
|
75
|
+
throw error;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Read up to `maxChunkBytes` of new content, advancing the cursor by bytes consumed.
|
|
79
|
+
* `size` comes from the policy-aware stat that sized this read.
|
|
80
|
+
*/
|
|
81
|
+
readChunk(size) {
|
|
36
82
|
// Truncation restarts from 0, but the offset is COMMITTED only after the read
|
|
37
83
|
// succeeds, so a truncate-then-read throw doesn't replay already-emitted data.
|
|
38
84
|
// The buffered partial line and any in-progress oversized discard belonged to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../src/core/transcript/cursor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../src/core/transcript/cursor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE5E,MAAM,aAAa,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC,mDAAmD;AACrF,oFAAoF;AACpF,mFAAmF;AACnF,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,CAAC;AAoBpC;;;;GAIG;AACH,MAAM,OAAO,uBAAuB;IACzB,IAAI,CAAS;IACZ,MAAM,CAAS;IACjB,OAAO,GAAG,EAAE,CAAC;IACrB,+EAA+E;IAC/E,8DAA8D;IACtD,UAAU,GAAG,KAAK,CAAC;IAC3B,sFAAsF;IACtF,2EAA2E;IACnE,OAAO,CAAU;IAEzB;kFAC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E,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;YACxB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QAC5B,CAAC;QACD,MAAM,KAAK,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtD,yEAAyE;QACzE,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,GAAG,EAAY,CAAC;QACrC,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,eAAe,CAAC;QAC3D,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC,+CAA+C;YAClE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACzB,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,CAAC;IACrD,CAAC;IAED,gFAAgF;IAChF,YAAY;QACV,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gFAAgF;IAChF,iFAAiF;IACjF,2EAA2E;IAC3E,cAAc;QACZ,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjC,OAAO,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,CAAC;CACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bounded terminal drain both transcript watchers share: Claude's retire of a stopped
|
|
3
|
+
* subagent and finish, and Codex's flush at PTY exit. Implements PRD §5.4, §5.7 and §9.2
|
|
4
|
+
* (C-CLAUDE-15, C-CODEX-20).
|
|
5
|
+
*
|
|
6
|
+
* One chunk budget lives for a watcher's whole terminal life, so a retire never gets a fresh
|
|
7
|
+
* full budget, and each call also stops at a small wall-clock slice, so no call runs a
|
|
8
|
+
* hundreds-of-MiB synchronous loop. The slice can stop a transcript only after its first
|
|
9
|
+
* unread chunk, for up to `lateReadsPerDrain` transcripts a call: a host too loaded to begin a
|
|
10
|
+
* call within its slice still delivers what each transcript committed since the last poll, and
|
|
11
|
+
* a call reads no more past its slice than one live scan reads. Whatever is still unread is a
|
|
12
|
+
* content-free `unread_backlog` drop, and the partial record it cut off goes with it instead of
|
|
13
|
+
* being parsed as an unparseable line. A drained transcript removed after it existed warns like
|
|
14
|
+
* a live read (§5.7, C-CLAUDE-24, C-CODEX-23).
|
|
15
|
+
*/
|
|
16
|
+
import type { BoundedTranscriptCursor } from "./cursor.ts";
|
|
17
|
+
import type { DropReporter } from "./drops.ts";
|
|
18
|
+
/** A mutable chunk budget shared across every drain call across a watcher's life. */
|
|
19
|
+
export type ChunkBudget = {
|
|
20
|
+
chunks: number;
|
|
21
|
+
};
|
|
22
|
+
/** One shared budget for a watcher's whole terminal-drain life. */
|
|
23
|
+
export declare function newTerminalBudget(): ChunkBudget;
|
|
24
|
+
/** The emitter calls a drain makes for a cursor of type `C`. */
|
|
25
|
+
export type DrainLines<C extends BoundedTranscriptCursor> = {
|
|
26
|
+
/** Emits a chunk's complete lines; the cursor keeps the trailing partial. */
|
|
27
|
+
emitLines(path: string, text: string, cursor: C): void;
|
|
28
|
+
/** Emits one line taken as complete: a transcript's last, un-terminated record at its end. */
|
|
29
|
+
emitLine(path: string, line: string): void;
|
|
30
|
+
};
|
|
31
|
+
/** The watcher collaborators a drain needs: the fs guard, emitter, and drop sink. */
|
|
32
|
+
export type DrainContext<C extends BoundedTranscriptCursor> = {
|
|
33
|
+
readFs<T>(path: string, read: () => T): T | undefined;
|
|
34
|
+
readonly lines: DrainLines<C>;
|
|
35
|
+
readonly drops: DropReporter;
|
|
36
|
+
/** Per-call wall-clock ms cap (defaults to `drainSliceMs`); tests may override. */
|
|
37
|
+
readonly sliceMs?: number;
|
|
38
|
+
/** Monotonic clock (injectable for tests); defaults to `Date.now`. */
|
|
39
|
+
readonly now?: () => number;
|
|
40
|
+
};
|
|
41
|
+
/** Drains `cursors` toward their ends within the shared `budget` and this call's slice. */
|
|
42
|
+
export declare function drainToBudget<C extends BoundedTranscriptCursor>(context: DrainContext<C>, cursors: readonly C[], budget: ChunkBudget): void;
|
|
43
|
+
//# sourceMappingURL=drain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drain.d.ts","sourceRoot":"","sources":["../../../src/core/transcript/drain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,qFAAqF;AACrF,MAAM,MAAM,WAAW,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAY7C,mEAAmE;AACnE,wBAAgB,iBAAiB,IAAI,WAAW,CAE/C;AAED,gEAAgE;AAChE,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,uBAAuB,IAAI;IAC1D,6EAA6E;IAC7E,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC;IACvD,8FAA8F;IAC9F,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5C,CAAC;AAEF,qFAAqF;AACrF,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,uBAAuB,IAAI;IAC5D,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IACtD,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,mFAAmF;IACnF,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,sEAAsE;IACtE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CAC7B,CAAC;AAKF,2FAA2F;AAC3F,wBAAgB,aAAa,CAAC,CAAC,SAAS,uBAAuB,EAC7D,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EACxB,OAAO,EAAE,SAAS,CAAC,EAAE,EACrB,MAAM,EAAE,WAAW,GAClB,IAAI,CAcN"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bounded terminal drain both transcript watchers share: Claude's retire of a stopped
|
|
3
|
+
* subagent and finish, and Codex's flush at PTY exit. Implements PRD §5.4, §5.7 and §9.2
|
|
4
|
+
* (C-CLAUDE-15, C-CODEX-20).
|
|
5
|
+
*
|
|
6
|
+
* One chunk budget lives for a watcher's whole terminal life, so a retire never gets a fresh
|
|
7
|
+
* full budget, and each call also stops at a small wall-clock slice, so no call runs a
|
|
8
|
+
* hundreds-of-MiB synchronous loop. The slice can stop a transcript only after its first
|
|
9
|
+
* unread chunk, for up to `lateReadsPerDrain` transcripts a call: a host too loaded to begin a
|
|
10
|
+
* call within its slice still delivers what each transcript committed since the last poll, and
|
|
11
|
+
* a call reads no more past its slice than one live scan reads. Whatever is still unread is a
|
|
12
|
+
* content-free `unread_backlog` drop, and the partial record it cut off goes with it instead of
|
|
13
|
+
* being parsed as an unparseable line. A drained transcript removed after it existed warns like
|
|
14
|
+
* a live read (§5.7, C-CLAUDE-24, C-CODEX-23).
|
|
15
|
+
*/
|
|
16
|
+
/** Terminal-drain chunk budget, shared ONCE per watcher across every retire and flush. */
|
|
17
|
+
const drainChunkBudget = 256;
|
|
18
|
+
/** Wall-clock ms a single drain call may run before the leftover backlog is dropped. */
|
|
19
|
+
const drainSliceMs = 50;
|
|
20
|
+
/**
|
|
21
|
+
* The transcripts a call may still read a first chunk of once its slice is spent: 16 chunks
|
|
22
|
+
* (4 MiB), what one live scan reads, so a late call blocks the loop no longer than a scan.
|
|
23
|
+
*/
|
|
24
|
+
const lateReadsPerDrain = 16;
|
|
25
|
+
/** One shared budget for a watcher's whole terminal-drain life. */
|
|
26
|
+
export function newTerminalBudget() {
|
|
27
|
+
return { chunks: drainChunkBudget };
|
|
28
|
+
}
|
|
29
|
+
/** Drains `cursors` toward their ends within the shared `budget` and this call's slice. */
|
|
30
|
+
export function drainToBudget(context, cursors, budget) {
|
|
31
|
+
const now = context.now ?? Date.now;
|
|
32
|
+
const deadline = now() + (context.sliceMs ?? drainSliceMs);
|
|
33
|
+
const slice = { deadline, now, lateReads: lateReadsPerDrain };
|
|
34
|
+
for (const cursor of cursors) {
|
|
35
|
+
const hasBacklog = readCursor(context, cursor, budget, slice);
|
|
36
|
+
// The buffered partial is a whole record only at the transcript's end. With bytes still
|
|
37
|
+
// unread, its rest is in the backlog, so it is lost with the backlog's own drop rather than
|
|
38
|
+
// misreported as an unparseable record.
|
|
39
|
+
const partial = cursor.drainPending();
|
|
40
|
+
if (hasBacklog)
|
|
41
|
+
context.drops.drop(cursor.path, "unread_backlog");
|
|
42
|
+
else
|
|
43
|
+
context.lines.emitLine(cursor.path, partial);
|
|
44
|
+
}
|
|
45
|
+
context.drops.flushPass(); // deliver this drain's coalesced drops (bounded fan-out)
|
|
46
|
+
}
|
|
47
|
+
// Reads one cursor toward its end within the budget and the slice. Returns whether bytes
|
|
48
|
+
// remained unread when either was spent (false once drained or on a contained fs failure).
|
|
49
|
+
function readCursor(context, cursor, budget, slice) {
|
|
50
|
+
for (let first = true; budget.chunks > 0; first = false) {
|
|
51
|
+
if (slice.now() >= slice.deadline) {
|
|
52
|
+
if (!first || slice.lateReads === 0)
|
|
53
|
+
break;
|
|
54
|
+
slice.lateReads -= 1;
|
|
55
|
+
}
|
|
56
|
+
budget.chunks -= 1;
|
|
57
|
+
const chunk = context.readFs(cursor.path, () => cursor.readLiveChunk());
|
|
58
|
+
if (chunk === undefined)
|
|
59
|
+
return false; // contained FS failure; nothing to account
|
|
60
|
+
if (chunk.text.length > 0)
|
|
61
|
+
context.lines.emitLines(cursor.path, chunk.text, cursor);
|
|
62
|
+
if (!chunk.canContinueNow)
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
return (context.readFs(cursor.path, () => cursor.remainingBytes()) ?? 0) > 0;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=drain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drain.js","sourceRoot":"","sources":["../../../src/core/transcript/drain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH,0FAA0F;AAC1F,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,wFAAwF;AACxF,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB;;;GAGG;AACH,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B,mEAAmE;AACnE,MAAM,UAAU,iBAAiB;IAC/B,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;AACtC,CAAC;AAwBD,2FAA2F;AAC3F,MAAM,UAAU,aAAa,CAC3B,OAAwB,EACxB,OAAqB,EACrB,MAAmB;IAEnB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC;IACpC,MAAM,QAAQ,GAAG,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,YAAY,CAAC,CAAC;IAC3D,MAAM,KAAK,GAAe,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC1E,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QAC9D,wFAAwF;QACxF,4FAA4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ACD,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Abortable waits that end with their trust attempt (PRD §5.4, C-TRUST-01): each resolves
|
|
3
|
+
* false once the attempt's signal aborts, so no write or timer outlives the attempt.
|
|
4
|
+
*/
|
|
5
|
+
import type { TrustWriteResult } from "./types.ts";
|
|
6
|
+
/** Race disposal against an in-flight write while retaining a rejection handler for it. */
|
|
7
|
+
export declare function ownWrite(signal: AbortSignal, write: TrustWriteResult): Promise<boolean>;
|
|
8
|
+
/** Resolves true after `ms`. */
|
|
9
|
+
export declare function abortableDelay(signal: AbortSignal, ms: number): Promise<boolean>;
|
|
10
|
+
/** Resolves true when the `wake` handed to `arm` runs; holds no timer while it waits. */
|
|
11
|
+
export declare function untilWoken(signal: AbortSignal, arm: (wake: () => void) => void): Promise<boolean>;
|
|
12
|
+
//# sourceMappingURL=abortable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abortable.d.ts","sourceRoot":"","sources":["../../../src/core/trust/abortable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,2FAA2F;AAC3F,wBAAgB,QAAQ,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAgBvF;AAED,gCAAgC;AAChC,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAchF;AAED,yFAAyF;AACzF,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,IAAI,KAAK,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAUjG"}
|