@with-logic/elwood 0.1.0 → 0.1.1
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 +166 -1
- package/LICENSE +1 -1
- package/README.md +276 -13
- package/dist/claude/command.d.ts +9 -2
- package/dist/claude/command.d.ts.map +1 -1
- package/dist/claude/command.js +23 -16
- package/dist/claude/command.js.map +1 -1
- package/dist/claude/session/index.d.ts.map +1 -1
- package/dist/claude/session/index.js +5 -2
- package/dist/claude/session/index.js.map +1 -1
- package/dist/claude/session/resume.d.ts +1 -1
- package/dist/claude/session/resume.d.ts.map +1 -1
- package/dist/claude/session/resume.js +5 -1
- package/dist/claude/session/resume.js.map +1 -1
- package/dist/claude/simple.d.ts.map +1 -1
- package/dist/claude/simple.js +4 -0
- package/dist/claude/simple.js.map +1 -1
- package/dist/cli/args/index.d.ts +3 -1
- package/dist/cli/args/index.d.ts.map +1 -1
- package/dist/cli/args/index.js +10 -2
- package/dist/cli/args/index.js.map +1 -1
- package/dist/cli/args/options.d.ts.map +1 -1
- package/dist/cli/args/options.js +2 -0
- package/dist/cli/args/options.js.map +1 -1
- package/dist/cli/args-commands.d.ts +10 -0
- package/dist/cli/args-commands.d.ts.map +1 -0
- package/dist/cli/args-commands.js +113 -0
- package/dist/cli/args-commands.js.map +1 -0
- package/dist/cli/command-types.d.ts +26 -0
- package/dist/cli/command-types.d.ts.map +1 -0
- package/dist/cli/command-types.js +9 -0
- package/dist/cli/command-types.js.map +1 -0
- package/dist/cli/config/codec-primitives.d.ts +20 -0
- package/dist/cli/config/codec-primitives.d.ts.map +1 -0
- package/dist/cli/config/codec-primitives.js +51 -0
- package/dist/cli/config/codec-primitives.js.map +1 -0
- package/dist/cli/config/codec.d.ts.map +1 -1
- package/dist/cli/config/codec.js +4 -46
- package/dist/cli/config/codec.js.map +1 -1
- package/dist/cli/config/effective.d.ts.map +1 -1
- package/dist/cli/config/effective.js +1 -0
- package/dist/cli/config/effective.js.map +1 -1
- package/dist/cli/config/keys.d.ts +1 -1
- package/dist/cli/config/keys.d.ts.map +1 -1
- package/dist/cli/config/keys.js +1 -0
- package/dist/cli/config/keys.js.map +1 -1
- package/dist/cli/entry.d.ts +4 -2
- package/dist/cli/entry.d.ts.map +1 -1
- package/dist/cli/entry.js +2 -1
- package/dist/cli/entry.js.map +1 -1
- package/dist/cli/help.d.ts +2 -2
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +40 -1
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/interactive/index.d.ts +26 -0
- package/dist/cli/interactive/index.d.ts.map +1 -0
- package/dist/cli/interactive/index.js +33 -0
- package/dist/cli/interactive/index.js.map +1 -0
- package/dist/cli/interactive/launch.d.ts +14 -0
- package/dist/cli/interactive/launch.d.ts.map +1 -0
- package/dist/cli/interactive/launch.js +66 -0
- package/dist/cli/interactive/launch.js.map +1 -0
- package/dist/cli/interactive/spawn.d.ts +18 -0
- package/dist/cli/interactive/spawn.d.ts.map +1 -0
- package/dist/cli/interactive/spawn.js +32 -0
- package/dist/cli/interactive/spawn.js.map +1 -0
- package/dist/cli/main-failure.d.ts +28 -0
- package/dist/cli/main-failure.d.ts.map +1 -0
- package/dist/cli/main-failure.js +78 -0
- package/dist/cli/main-failure.js.map +1 -0
- package/dist/cli/main.d.ts +12 -4
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +27 -73
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/models/index.d.ts +20 -0
- package/dist/cli/models/index.d.ts.map +1 -0
- package/dist/cli/models/index.js +60 -0
- package/dist/cli/models/index.js.map +1 -0
- package/dist/cli/models/render.d.ts +9 -0
- package/dist/cli/models/render.d.ts.map +1 -0
- package/dist/cli/models/render.js +33 -0
- package/dist/cli/models/render.js.map +1 -0
- package/dist/cli/request/index.d.ts.map +1 -1
- package/dist/cli/request/index.js +8 -2
- package/dist/cli/request/index.js.map +1 -1
- package/dist/cli/request/posture.d.ts +28 -0
- package/dist/cli/request/posture.d.ts.map +1 -0
- package/dist/cli/request/posture.js +70 -0
- package/dist/cli/request/posture.js.map +1 -0
- package/dist/cli/request/resolution-types.d.ts +1 -0
- package/dist/cli/request/resolution-types.d.ts.map +1 -1
- package/dist/cli/request/settings.d.ts +2 -12
- package/dist/cli/request/settings.d.ts.map +1 -1
- package/dist/cli/request/settings.js +2 -25
- package/dist/cli/request/settings.js.map +1 -1
- package/dist/cli/request/validation.d.ts +12 -0
- package/dist/cli/request/validation.d.ts.map +1 -1
- package/dist/cli/request/validation.js +30 -10
- package/dist/cli/request/validation.js.map +1 -1
- package/dist/cli/request/values.d.ts +1 -0
- package/dist/cli/request/values.d.ts.map +1 -1
- package/dist/cli/request/values.js +1 -0
- package/dist/cli/request/values.js.map +1 -1
- package/dist/cli/run/index.d.ts.map +1 -1
- package/dist/cli/run/index.js +5 -41
- package/dist/cli/run/index.js.map +1 -1
- package/dist/cli/run/subscribe.d.ts +19 -0
- package/dist/cli/run/subscribe.d.ts.map +1 -0
- package/dist/cli/run/subscribe.js +47 -0
- package/dist/cli/run/subscribe.js.map +1 -0
- package/dist/cli/session/launch.d.ts +3 -0
- package/dist/cli/session/launch.d.ts.map +1 -1
- package/dist/cli/session/launch.js +11 -0
- package/dist/cli/session/launch.js.map +1 -1
- package/dist/cli/sessions/index.d.ts +23 -0
- package/dist/cli/sessions/index.d.ts.map +1 -0
- package/dist/cli/sessions/index.js +65 -0
- package/dist/cli/sessions/index.js.map +1 -0
- package/dist/cli/sessions/list.d.ts +28 -0
- package/dist/cli/sessions/list.d.ts.map +1 -0
- package/dist/cli/sessions/list.js +63 -0
- package/dist/cli/sessions/list.js.map +1 -0
- package/dist/cli/table.d.ts +7 -0
- package/dist/cli/table.d.ts.map +1 -0
- package/dist/cli/table.js +14 -0
- package/dist/cli/table.js.map +1 -0
- package/dist/cli/types.d.ts +5 -1
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/cli/types.js.map +1 -1
- package/dist/codex/command.d.ts +18 -2
- package/dist/codex/command.d.ts.map +1 -1
- package/dist/codex/command.js +39 -24
- package/dist/codex/command.js.map +1 -1
- package/dist/codex/session/index.d.ts.map +1 -1
- package/dist/codex/session/index.js +5 -2
- package/dist/codex/session/index.js.map +1 -1
- package/dist/codex/session/resume.d.ts +1 -1
- package/dist/codex/session/resume.d.ts.map +1 -1
- package/dist/codex/session/resume.js +5 -1
- package/dist/codex/session/resume.js.map +1 -1
- package/dist/codex/session/types.d.ts +3 -0
- package/dist/codex/session/types.d.ts.map +1 -1
- package/dist/codex/simple.d.ts.map +1 -1
- package/dist/codex/simple.js +4 -0
- package/dist/codex/simple.js.map +1 -1
- package/dist/core/errors.d.ts +1 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js.map +1 -1
- package/dist/core/high-trust.d.ts +41 -0
- package/dist/core/high-trust.d.ts.map +1 -0
- package/dist/core/high-trust.js +50 -0
- package/dist/core/high-trust.js.map +1 -0
- package/dist/core/trust/allowlist.d.ts +56 -0
- package/dist/core/trust/allowlist.d.ts.map +1 -0
- package/dist/core/{trust-prompts.js → trust/allowlist.js} +21 -38
- package/dist/core/trust/allowlist.js.map +1 -0
- package/dist/core/trust/prompts.d.ts +4 -46
- package/dist/core/trust/prompts.d.ts.map +1 -1
- package/dist/core/trust/prompts.js +2 -73
- package/dist/core/trust/prompts.js.map +1 -1
- package/dist/core/trust/responder.d.ts +2 -0
- package/dist/core/trust/responder.d.ts.map +1 -1
- package/dist/core/trust/responder.js +4 -0
- package/dist/core/trust/responder.js.map +1 -1
- package/dist/core/types.d.ts +3 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/runtime/launch-arguments.d.ts +12 -0
- package/dist/runtime/launch-arguments.d.ts.map +1 -0
- package/dist/runtime/launch-arguments.js +15 -0
- package/dist/runtime/launch-arguments.js.map +1 -0
- package/docs/cli-behavior.md +88 -0
- package/docs/cli-output.md +60 -0
- package/docs/cli.md +10 -2
- package/package.json +8 -6
- package/dist/claude/hook-dispatch.d.ts +0 -9
- package/dist/claude/hook-dispatch.d.ts.map +0 -1
- package/dist/claude/hook-dispatch.js +0 -12
- package/dist/claude/hook-dispatch.js.map +0 -1
- package/dist/claude/hook-events-extra.d.ts +0 -81
- package/dist/claude/hook-events-extra.d.ts.map +0 -1
- package/dist/claude/hook-events-extra.js +0 -6
- package/dist/claude/hook-events-extra.js.map +0 -1
- package/dist/claude/hook-events.d.ts +0 -101
- package/dist/claude/hook-events.d.ts.map +0 -1
- package/dist/claude/hook-events.js +0 -6
- package/dist/claude/hook-events.js.map +0 -1
- package/dist/claude/hook-names.d.ts +0 -24
- package/dist/claude/hook-names.d.ts.map +0 -1
- package/dist/claude/hook-names.js +0 -45
- package/dist/claude/hook-names.js.map +0 -1
- package/dist/claude/hooks.d.ts +0 -78
- package/dist/claude/hooks.d.ts.map +0 -1
- package/dist/claude/hooks.js +0 -6
- package/dist/claude/hooks.js.map +0 -1
- package/dist/claude/session-bridge.d.ts +0 -11
- package/dist/claude/session-bridge.d.ts.map +0 -1
- package/dist/claude/session-bridge.js +0 -18
- package/dist/claude/session-bridge.js.map +0 -1
- package/dist/claude/session-build.d.ts +0 -15
- package/dist/claude/session-build.d.ts.map +0 -1
- package/dist/claude/session-build.js +0 -147
- package/dist/claude/session-build.js.map +0 -1
- package/dist/claude/session-hook-handler.d.ts +0 -34
- package/dist/claude/session-hook-handler.d.ts.map +0 -1
- package/dist/claude/session-hook-handler.js +0 -42
- package/dist/claude/session-hook-handler.js.map +0 -1
- package/dist/claude/session-instance.d.ts +0 -42
- package/dist/claude/session-instance.d.ts.map +0 -1
- package/dist/claude/session-instance.js +0 -146
- package/dist/claude/session-instance.js.map +0 -1
- package/dist/claude/session-interface.d.ts +0 -49
- package/dist/claude/session-interface.d.ts.map +0 -1
- package/dist/claude/session-interface.js +0 -10
- package/dist/claude/session-interface.js.map +0 -1
- package/dist/claude/session-resume.d.ts +0 -8
- package/dist/claude/session-resume.d.ts.map +0 -1
- package/dist/claude/session-resume.js +0 -47
- package/dist/claude/session-resume.js.map +0 -1
- package/dist/claude/session-runtime.d.ts +0 -43
- package/dist/claude/session-runtime.d.ts.map +0 -1
- package/dist/claude/session-runtime.js +0 -105
- package/dist/claude/session-runtime.js.map +0 -1
- package/dist/claude/session-transcript.d.ts +0 -62
- package/dist/claude/session-transcript.d.ts.map +0 -1
- package/dist/claude/session-transcript.js +0 -88
- package/dist/claude/session-transcript.js.map +0 -1
- package/dist/claude/session.d.ts +0 -18
- package/dist/claude/session.d.ts.map +0 -1
- package/dist/claude/session.js +0 -58
- package/dist/claude/session.js.map +0 -1
- package/dist/claude/start-or-resume.d.ts +0 -12
- package/dist/claude/start-or-resume.d.ts.map +0 -1
- package/dist/claude/start-or-resume.js +0 -32
- package/dist/claude/start-or-resume.js.map +0 -1
- package/dist/claude/tool-hook-events.d.ts +0 -10
- package/dist/claude/tool-hook-events.d.ts.map +0 -1
- package/dist/claude/tool-hook-events.js +0 -18
- package/dist/claude/tool-hook-events.js.map +0 -1
- package/dist/claude/tool-types.d.ts +0 -158
- package/dist/claude/tool-types.d.ts.map +0 -1
- package/dist/claude/tool-types.js +0 -6
- package/dist/claude/tool-types.js.map +0 -1
- package/dist/claude/validate-input.d.ts +0 -8
- package/dist/claude/validate-input.d.ts.map +0 -1
- package/dist/claude/validate-input.js +0 -137
- package/dist/claude/validate-input.js.map +0 -1
- package/dist/claude/validate-permission-update.d.ts +0 -10
- package/dist/claude/validate-permission-update.d.ts.map +0 -1
- package/dist/claude/validate-permission-update.js +0 -72
- package/dist/claude/validate-permission-update.js.map +0 -1
- package/dist/claude/validate-result.d.ts +0 -7
- package/dist/claude/validate-result.d.ts.map +0 -1
- package/dist/claude/validate-result.js +0 -118
- package/dist/claude/validate-result.js.map +0 -1
- package/dist/claude/validate-shapes.d.ts +0 -22
- package/dist/claude/validate-shapes.d.ts.map +0 -1
- package/dist/claude/validate-shapes.js +0 -15
- package/dist/claude/validate-shapes.js.map +0 -1
- package/dist/claude/validate-tool-update.d.ts +0 -15
- package/dist/claude/validate-tool-update.d.ts.map +0 -1
- package/dist/claude/validate-tool-update.js +0 -122
- package/dist/claude/validate-tool-update.js.map +0 -1
- package/dist/cli/agent-detect.d.ts +0 -44
- package/dist/cli/agent-detect.d.ts.map +0 -1
- package/dist/cli/agent-detect.js +0 -66
- package/dist/cli/agent-detect.js.map +0 -1
- package/dist/cli/arg-errors.d.ts +0 -6
- package/dist/cli/arg-errors.d.ts.map +0 -1
- package/dist/cli/arg-errors.js +0 -44
- package/dist/cli/arg-errors.js.map +0 -1
- package/dist/cli/arg-options.d.ts +0 -26
- package/dist/cli/arg-options.d.ts.map +0 -1
- package/dist/cli/arg-options.js +0 -50
- package/dist/cli/arg-options.js.map +0 -1
- package/dist/cli/args.d.ts +0 -7
- package/dist/cli/args.d.ts.map +0 -1
- package/dist/cli/args.js +0 -70
- package/dist/cli/args.js.map +0 -1
- package/dist/cli/lifecycle-outcome.d.ts +0 -13
- package/dist/cli/lifecycle-outcome.d.ts.map +0 -1
- package/dist/cli/lifecycle-outcome.js +0 -20
- package/dist/cli/lifecycle-outcome.js.map +0 -1
- package/dist/cli/lifecycle.d.ts +0 -61
- package/dist/cli/lifecycle.d.ts.map +0 -1
- package/dist/cli/lifecycle.js +0 -152
- package/dist/cli/lifecycle.js.map +0 -1
- package/dist/cli/request-finalize.d.ts +0 -10
- package/dist/cli/request-finalize.d.ts.map +0 -1
- package/dist/cli/request-finalize.js +0 -135
- package/dist/cli/request-finalize.js.map +0 -1
- package/dist/cli/request-layers.d.ts +0 -30
- package/dist/cli/request-layers.d.ts.map +0 -1
- package/dist/cli/request-layers.js +0 -44
- package/dist/cli/request-layers.js.map +0 -1
- package/dist/cli/request-settings.d.ts +0 -34
- package/dist/cli/request-settings.d.ts.map +0 -1
- package/dist/cli/request-settings.js +0 -66
- package/dist/cli/request-settings.js.map +0 -1
- package/dist/cli/request-sources.d.ts +0 -13
- package/dist/cli/request-sources.d.ts.map +0 -1
- package/dist/cli/request-sources.js +0 -23
- package/dist/cli/request-sources.js.map +0 -1
- package/dist/cli/request-validation.d.ts +0 -18
- package/dist/cli/request-validation.d.ts.map +0 -1
- package/dist/cli/request-validation.js +0 -84
- package/dist/cli/request-validation.js.map +0 -1
- package/dist/cli/request-values.d.ts +0 -33
- package/dist/cli/request-values.d.ts.map +0 -1
- package/dist/cli/request-values.js +0 -73
- package/dist/cli/request-values.js.map +0 -1
- package/dist/cli/request.d.ts +0 -12
- package/dist/cli/request.d.ts.map +0 -1
- package/dist/cli/request.js +0 -103
- package/dist/cli/request.js.map +0 -1
- package/dist/cli/resolution-types.d.ts +0 -35
- package/dist/cli/resolution-types.d.ts.map +0 -1
- package/dist/cli/resolution-types.js +0 -6
- package/dist/cli/resolution-types.js.map +0 -1
- package/dist/cli/run-output-lines.d.ts +0 -14
- package/dist/cli/run-output-lines.d.ts.map +0 -1
- package/dist/cli/run-output-lines.js +0 -42
- package/dist/cli/run-output-lines.js.map +0 -1
- package/dist/cli/run-output.d.ts +0 -48
- package/dist/cli/run-output.d.ts.map +0 -1
- package/dist/cli/run-output.js +0 -150
- package/dist/cli/run-output.js.map +0 -1
- package/dist/cli/run.d.ts +0 -20
- package/dist/cli/run.d.ts.map +0 -1
- package/dist/cli/run.js +0 -126
- package/dist/cli/run.js.map +0 -1
- package/dist/cli/session-launch.d.ts +0 -23
- package/dist/cli/session-launch.d.ts.map +0 -1
- package/dist/cli/session-launch.js +0 -57
- package/dist/cli/session-launch.js.map +0 -1
- package/dist/cli/session.d.ts +0 -68
- package/dist/cli/session.d.ts.map +0 -1
- package/dist/cli/session.js +0 -124
- package/dist/cli/session.js.map +0 -1
- package/dist/codex/attach-images.d.ts +0 -20
- package/dist/codex/attach-images.d.ts.map +0 -1
- package/dist/codex/attach-images.js +0 -66
- package/dist/codex/attach-images.js.map +0 -1
- package/dist/codex/clipboard-lock.d.ts +0 -15
- package/dist/codex/clipboard-lock.d.ts.map +0 -1
- package/dist/codex/clipboard-lock.js +0 -16
- package/dist/codex/clipboard-lock.js.map +0 -1
- package/dist/codex/clipboard.d.ts +0 -32
- package/dist/codex/clipboard.d.ts.map +0 -1
- package/dist/codex/clipboard.js +0 -92
- package/dist/codex/clipboard.js.map +0 -1
- package/dist/codex/config-lock.d.ts +0 -21
- package/dist/codex/config-lock.d.ts.map +0 -1
- package/dist/codex/config-lock.js +0 -22
- package/dist/codex/config-lock.js.map +0 -1
- package/dist/codex/config-restore.d.ts +0 -33
- package/dist/codex/config-restore.d.ts.map +0 -1
- package/dist/codex/config-restore.js +0 -90
- package/dist/codex/config-restore.js.map +0 -1
- package/dist/codex/config-transaction.d.ts +0 -26
- package/dist/codex/config-transaction.d.ts.map +0 -1
- package/dist/codex/config-transaction.js +0 -47
- package/dist/codex/config-transaction.js.map +0 -1
- package/dist/codex/hook-dispatch.d.ts +0 -9
- package/dist/codex/hook-dispatch.d.ts.map +0 -1
- package/dist/codex/hook-dispatch.js +0 -14
- package/dist/codex/hook-dispatch.js.map +0 -1
- package/dist/codex/hook-names.d.ts +0 -19
- package/dist/codex/hook-names.d.ts.map +0 -1
- package/dist/codex/hook-names.js +0 -17
- package/dist/codex/hook-names.js.map +0 -1
- package/dist/codex/hooks.d.ts +0 -99
- package/dist/codex/hooks.d.ts.map +0 -1
- package/dist/codex/hooks.js +0 -6
- package/dist/codex/hooks.js.map +0 -1
- package/dist/codex/initial-ready.d.ts +0 -19
- package/dist/codex/initial-ready.d.ts.map +0 -1
- package/dist/codex/initial-ready.js +0 -19
- package/dist/codex/initial-ready.js.map +0 -1
- package/dist/codex/serialize.d.ts +0 -8
- package/dist/codex/serialize.d.ts.map +0 -1
- package/dist/codex/serialize.js +0 -48
- package/dist/codex/serialize.js.map +0 -1
- package/dist/codex/session-bridge.d.ts +0 -14
- package/dist/codex/session-bridge.d.ts.map +0 -1
- package/dist/codex/session-bridge.js +0 -20
- package/dist/codex/session-bridge.js.map +0 -1
- package/dist/codex/session-build.d.ts +0 -15
- package/dist/codex/session-build.d.ts.map +0 -1
- package/dist/codex/session-build.js +0 -144
- package/dist/codex/session-build.js.map +0 -1
- package/dist/codex/session-cleanup.d.ts +0 -12
- package/dist/codex/session-cleanup.d.ts.map +0 -1
- package/dist/codex/session-cleanup.js +0 -15
- package/dist/codex/session-cleanup.js.map +0 -1
- package/dist/codex/session-hooks.d.ts +0 -13
- package/dist/codex/session-hooks.d.ts.map +0 -1
- package/dist/codex/session-hooks.js +0 -54
- package/dist/codex/session-hooks.js.map +0 -1
- package/dist/codex/session-instance.d.ts +0 -50
- package/dist/codex/session-instance.d.ts.map +0 -1
- package/dist/codex/session-instance.js +0 -117
- package/dist/codex/session-instance.js.map +0 -1
- package/dist/codex/session-resume.d.ts +0 -7
- package/dist/codex/session-resume.d.ts.map +0 -1
- package/dist/codex/session-resume.js +0 -44
- package/dist/codex/session-resume.js.map +0 -1
- package/dist/codex/session-runtime.d.ts +0 -7
- package/dist/codex/session-runtime.d.ts.map +0 -1
- package/dist/codex/session-runtime.js +0 -10
- package/dist/codex/session-runtime.js.map +0 -1
- package/dist/codex/session-transcript.d.ts +0 -30
- package/dist/codex/session-transcript.d.ts.map +0 -1
- package/dist/codex/session-transcript.js +0 -53
- package/dist/codex/session-transcript.js.map +0 -1
- package/dist/codex/session-types.d.ts +0 -87
- package/dist/codex/session-types.d.ts.map +0 -1
- package/dist/codex/session-types.js +0 -6
- package/dist/codex/session-types.js.map +0 -1
- package/dist/codex/session-warnings.d.ts +0 -27
- package/dist/codex/session-warnings.d.ts.map +0 -1
- package/dist/codex/session-warnings.js +0 -54
- package/dist/codex/session-warnings.js.map +0 -1
- package/dist/codex/session.d.ts +0 -16
- package/dist/codex/session.d.ts.map +0 -1
- package/dist/codex/session.js +0 -61
- package/dist/codex/session.js.map +0 -1
- package/dist/codex/start-or-resume.d.ts +0 -12
- package/dist/codex/start-or-resume.d.ts.map +0 -1
- package/dist/codex/start-or-resume.js +0 -31
- package/dist/codex/start-or-resume.js.map +0 -1
- package/dist/codex/transcript/cursor-io.d.ts +0 -7
- package/dist/codex/transcript/cursor-io.d.ts.map +0 -1
- package/dist/codex/transcript/cursor-io.js +0 -7
- package/dist/codex/transcript/cursor-io.js.map +0 -1
- package/dist/codex/transcript/cursor.d.ts +0 -8
- package/dist/codex/transcript/cursor.d.ts.map +0 -1
- package/dist/codex/transcript/cursor.js +0 -8
- package/dist/codex/transcript/cursor.js.map +0 -1
- package/dist/codex/transcript/drops.d.ts +0 -9
- package/dist/codex/transcript/drops.d.ts.map +0 -1
- package/dist/codex/transcript/drops.js +0 -9
- package/dist/codex/transcript/drops.js.map +0 -1
- package/dist/codex/transcript.d.ts +0 -12
- package/dist/codex/transcript.d.ts.map +0 -1
- package/dist/codex/transcript.js +0 -10
- package/dist/codex/transcript.js.map +0 -1
- package/dist/codex/validate-result.d.ts +0 -7
- package/dist/codex/validate-result.d.ts.map +0 -1
- package/dist/codex/validate-result.js +0 -84
- package/dist/codex/validate-result.js.map +0 -1
- package/dist/codex/validate.d.ts +0 -11
- package/dist/codex/validate.d.ts.map +0 -1
- package/dist/codex/validate.js +0 -88
- package/dist/codex/validate.js.map +0 -1
- package/dist/core/activity-lifecycle.d.ts +0 -21
- package/dist/core/activity-lifecycle.d.ts.map +0 -1
- package/dist/core/activity-lifecycle.js +0 -45
- package/dist/core/activity-lifecycle.js.map +0 -1
- package/dist/core/activity-meta.d.ts +0 -13
- package/dist/core/activity-meta.d.ts.map +0 -1
- package/dist/core/activity-meta.js +0 -67
- package/dist/core/activity-meta.js.map +0 -1
- package/dist/core/activity-transcript.d.ts +0 -19
- package/dist/core/activity-transcript.d.ts.map +0 -1
- package/dist/core/activity-transcript.js +0 -60
- package/dist/core/activity-transcript.js.map +0 -1
- package/dist/core/activity.d.ts +0 -51
- package/dist/core/activity.d.ts.map +0 -1
- package/dist/core/activity.js +0 -81
- package/dist/core/activity.js.map +0 -1
- package/dist/core/control-queue-state.d.ts +0 -29
- package/dist/core/control-queue-state.d.ts.map +0 -1
- package/dist/core/control-queue-state.js +0 -95
- package/dist/core/control-queue-state.js.map +0 -1
- package/dist/core/control-queue-traits.d.ts +0 -54
- package/dist/core/control-queue-traits.d.ts.map +0 -1
- package/dist/core/control-queue-traits.js +0 -118
- package/dist/core/control-queue-traits.js.map +0 -1
- package/dist/core/control-queue-types.d.ts +0 -45
- package/dist/core/control-queue-types.d.ts.map +0 -1
- package/dist/core/control-queue-types.js +0 -7
- package/dist/core/control-queue-types.js.map +0 -1
- package/dist/core/control-queue.d.ts +0 -21
- package/dist/core/control-queue.d.ts.map +0 -1
- package/dist/core/control-queue.js +0 -98
- package/dist/core/control-queue.js.map +0 -1
- package/dist/core/list-models.d.ts +0 -44
- package/dist/core/list-models.d.ts.map +0 -1
- package/dist/core/list-models.js +0 -73
- package/dist/core/list-models.js.map +0 -1
- package/dist/core/model-picker.d.ts +0 -22
- package/dist/core/model-picker.d.ts.map +0 -1
- package/dist/core/model-picker.js +0 -58
- package/dist/core/model-picker.js.map +0 -1
- package/dist/core/model-rows.d.ts +0 -21
- package/dist/core/model-rows.d.ts.map +0 -1
- package/dist/core/model-rows.js +0 -57
- package/dist/core/model-rows.js.map +0 -1
- package/dist/core/probe-state.d.ts +0 -21
- package/dist/core/probe-state.d.ts.map +0 -1
- package/dist/core/probe-state.js +0 -39
- package/dist/core/probe-state.js.map +0 -1
- package/dist/core/session-input-abort.d.ts +0 -10
- package/dist/core/session-input-abort.d.ts.map +0 -1
- package/dist/core/session-input-abort.js +0 -44
- package/dist/core/session-input-abort.js.map +0 -1
- package/dist/core/session-input.d.ts +0 -37
- package/dist/core/session-input.d.ts.map +0 -1
- package/dist/core/session-input.js +0 -154
- package/dist/core/session-input.js.map +0 -1
- package/dist/core/session-warnings.d.ts +0 -20
- package/dist/core/session-warnings.d.ts.map +0 -1
- package/dist/core/session-warnings.js +0 -32
- package/dist/core/session-warnings.js.map +0 -1
- package/dist/core/simple/loop-controls.d.ts +0 -7
- package/dist/core/simple/loop-controls.d.ts.map +0 -1
- package/dist/core/simple/loop-controls.js +0 -7
- package/dist/core/simple/loop-controls.js.map +0 -1
- package/dist/core/startup-automation.d.ts +0 -54
- package/dist/core/startup-automation.d.ts.map +0 -1
- package/dist/core/startup-automation.js +0 -40
- package/dist/core/startup-automation.js.map +0 -1
- package/dist/core/startup-frame.d.ts +0 -39
- package/dist/core/startup-frame.d.ts.map +0 -1
- package/dist/core/startup-frame.js +0 -60
- package/dist/core/startup-frame.js.map +0 -1
- package/dist/core/startup-write.d.ts +0 -47
- package/dist/core/startup-write.d.ts.map +0 -1
- package/dist/core/startup-write.js +0 -73
- package/dist/core/startup-write.js.map +0 -1
- package/dist/core/trust-blocking.d.ts +0 -22
- package/dist/core/trust-blocking.d.ts.map +0 -1
- package/dist/core/trust-blocking.js +0 -38
- package/dist/core/trust-blocking.js.map +0 -1
- package/dist/core/trust-prompts.d.ts +0 -135
- package/dist/core/trust-prompts.d.ts.map +0 -1
- package/dist/core/trust-prompts.js.map +0 -1
- package/dist/core/trust-responder.d.ts +0 -48
- package/dist/core/trust-responder.d.ts.map +0 -1
- package/dist/core/trust-responder.js +0 -119
- package/dist/core/trust-responder.js.map +0 -1
- package/dist/core/tui-screen.d.ts +0 -21
- package/dist/core/tui-screen.d.ts.map +0 -1
- package/dist/core/tui-screen.js +0 -56
- package/dist/core/tui-screen.js.map +0 -1
- package/dist/core/update-warning.d.ts +0 -25
- package/dist/core/update-warning.d.ts.map +0 -1
- package/dist/core/update-warning.js +0 -33
- package/dist/core/update-warning.js.map +0 -1
- package/dist/core/warning-lifecycle.d.ts +0 -23
- package/dist/core/warning-lifecycle.d.ts.map +0 -1
- package/dist/core/warning-lifecycle.js +0 -6
- package/dist/core/warning-lifecycle.js.map +0 -1
- package/dist/core/warning-reasons.d.ts +0 -62
- package/dist/core/warning-reasons.d.ts.map +0 -1
- package/dist/core/warning-reasons.js +0 -121
- package/dist/core/warning-reasons.js.map +0 -1
- package/dist/core/warnings.d.ts +0 -145
- package/dist/core/warnings.d.ts.map +0 -1
- package/dist/core/warnings.js +0 -12
- package/dist/core/warnings.js.map +0 -1
- package/dist/runtime/cleanup-latch.d.ts +0 -27
- package/dist/runtime/cleanup-latch.d.ts.map +0 -1
- package/dist/runtime/cleanup-latch.js +0 -43
- package/dist/runtime/cleanup-latch.js.map +0 -1
- package/dist/runtime/initial-ready-advance.d.ts +0 -22
- package/dist/runtime/initial-ready-advance.d.ts.map +0 -1
- package/dist/runtime/initial-ready-advance.js +0 -39
- package/dist/runtime/initial-ready-advance.js.map +0 -1
- package/dist/runtime/initial-ready-fallback.d.ts +0 -12
- package/dist/runtime/initial-ready-fallback.d.ts.map +0 -1
- package/dist/runtime/initial-ready-fallback.js +0 -20
- package/dist/runtime/initial-ready-fallback.js.map +0 -1
- package/dist/runtime/initial-ready.d.ts +0 -49
- package/dist/runtime/initial-ready.d.ts.map +0 -1
- package/dist/runtime/initial-ready.js +0 -81
- package/dist/runtime/initial-ready.js.map +0 -1
- package/dist/runtime/reap-tree.d.ts +0 -62
- package/dist/runtime/reap-tree.d.ts.map +0 -1
- package/dist/runtime/reap-tree.js +0 -108
- package/dist/runtime/reap-tree.js.map +0 -1
- package/dist/runtime/session-base-types.d.ts +0 -36
- package/dist/runtime/session-base-types.d.ts.map +0 -1
- package/dist/runtime/session-base-types.js +0 -14
- package/dist/runtime/session-base-types.js.map +0 -1
- package/dist/runtime/session-base.d.ts +0 -48
- package/dist/runtime/session-base.d.ts.map +0 -1
- package/dist/runtime/session-base.js +0 -76
- package/dist/runtime/session-base.js.map +0 -1
- package/dist/runtime/session-commands.d.ts +0 -43
- package/dist/runtime/session-commands.d.ts.map +0 -1
- package/dist/runtime/session-commands.js +0 -52
- package/dist/runtime/session-commands.js.map +0 -1
- package/dist/runtime/session-exit.d.ts +0 -16
- package/dist/runtime/session-exit.d.ts.map +0 -1
- package/dist/runtime/session-exit.js +0 -32
- package/dist/runtime/session-exit.js.map +0 -1
- package/dist/runtime/session-image-attach.d.ts +0 -45
- package/dist/runtime/session-image-attach.d.ts.map +0 -1
- package/dist/runtime/session-image-attach.js +0 -82
- package/dist/runtime/session-image-attach.js.map +0 -1
- package/dist/runtime/session-lifecycle.d.ts +0 -61
- package/dist/runtime/session-lifecycle.d.ts.map +0 -1
- package/dist/runtime/session-lifecycle.js +0 -164
- package/dist/runtime/session-lifecycle.js.map +0 -1
- package/dist/runtime/session-loops.d.ts +0 -32
- package/dist/runtime/session-loops.d.ts.map +0 -1
- package/dist/runtime/session-loops.js +0 -62
- package/dist/runtime/session-loops.js.map +0 -1
- package/dist/runtime/session-readiness.d.ts +0 -18
- package/dist/runtime/session-readiness.d.ts.map +0 -1
- package/dist/runtime/session-readiness.js +0 -22
- package/dist/runtime/session-readiness.js.map +0 -1
- package/dist/runtime/session-reap.d.ts +0 -28
- package/dist/runtime/session-reap.d.ts.map +0 -1
- package/dist/runtime/session-reap.js +0 -51
- package/dist/runtime/session-reap.js.map +0 -1
- package/dist/runtime/session-resize.d.ts +0 -20
- package/dist/runtime/session-resize.d.ts.map +0 -1
- package/dist/runtime/session-resize.js +0 -26
- package/dist/runtime/session-resize.js.map +0 -1
- package/dist/runtime/session-shutdown-binding.d.ts +0 -30
- package/dist/runtime/session-shutdown-binding.d.ts.map +0 -1
- package/dist/runtime/session-shutdown-binding.js +0 -37
- package/dist/runtime/session-shutdown-binding.js.map +0 -1
- package/dist/runtime/session-shutdown.d.ts +0 -60
- package/dist/runtime/session-shutdown.d.ts.map +0 -1
- package/dist/runtime/session-shutdown.js +0 -140
- package/dist/runtime/session-shutdown.js.map +0 -1
- package/dist/runtime/session-status-wiring.d.ts +0 -38
- package/dist/runtime/session-status-wiring.d.ts.map +0 -1
- package/dist/runtime/session-status-wiring.js +0 -41
- package/dist/runtime/session-status-wiring.js.map +0 -1
- package/dist/runtime/session-status.d.ts +0 -7
- package/dist/runtime/session-status.d.ts.map +0 -1
- package/dist/runtime/session-status.js +0 -22
- package/dist/runtime/session-status.js.map +0 -1
- package/dist/runtime/shutdown-coordinator.d.ts +0 -57
- package/dist/runtime/shutdown-coordinator.d.ts.map +0 -1
- package/dist/runtime/shutdown-coordinator.js +0 -77
- package/dist/runtime/shutdown-coordinator.js.map +0 -1
- package/dist/runtime/startup-buffer.d.ts +0 -33
- package/dist/runtime/startup-buffer.d.ts.map +0 -1
- package/dist/runtime/startup-buffer.js +0 -53
- package/dist/runtime/startup-buffer.js.map +0 -1
- package/dist/runtime/startup-cleanup.d.ts +0 -43
- package/dist/runtime/startup-cleanup.d.ts.map +0 -1
- package/dist/runtime/startup-cleanup.js +0 -89
- package/dist/runtime/startup-cleanup.js.map +0 -1
- package/dist/runtime/startup.d.ts +0 -17
- package/dist/runtime/startup.d.ts.map +0 -1
- package/dist/runtime/startup.js +0 -47
- package/dist/runtime/startup.js.map +0 -1
- package/dist/runtime/status-emit.d.ts +0 -14
- package/dist/runtime/status-emit.d.ts.map +0 -1
- package/dist/runtime/status-emit.js +0 -15
- package/dist/runtime/status-emit.js.map +0 -1
- package/dist/runtime/teardown.d.ts +0 -15
- package/dist/runtime/teardown.d.ts.map +0 -1
- package/dist/runtime/teardown.js +0 -40
- package/dist/runtime/teardown.js.map +0 -1
- package/dist/runtime/terminate.d.ts +0 -22
- package/dist/runtime/terminate.d.ts.map +0 -1
- package/dist/runtime/terminate.js +0 -129
- package/dist/runtime/terminate.js.map +0 -1
- package/dist/runtime/update-lock.d.ts +0 -19
- package/dist/runtime/update-lock.d.ts.map +0 -1
- package/dist/runtime/update-lock.js +0 -183
- package/dist/runtime/update-lock.js.map +0 -1
- package/dist/runtime/update-once.d.ts +0 -40
- package/dist/runtime/update-once.d.ts.map +0 -1
- package/dist/runtime/update-once.js +0 -88
- package/dist/runtime/update-once.js.map +0 -1
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared builder for the per-agent trust blocking screen-fact rules.
|
|
3
|
-
* Implements PRD §5.1/§5.5 (C-ATTN-03): a trust prompt that stays UNANSWERED
|
|
4
|
-
* under the policy classifies as a blocking prompt. Both adapters build these
|
|
5
|
-
* rules identically, so the construction — option-aware header recognition,
|
|
6
|
-
* stable semantic ids, base-table append — lives here once instead of diverging
|
|
7
|
-
* across `claude/screen-table.ts` and `codex/screen-table.ts`.
|
|
8
|
-
*/
|
|
9
|
-
import { nonOptionText } from "./terminal-options.js";
|
|
10
|
-
import { blockingTrustSpecs, trustHeaderMatches } from "./trust-prompts.js";
|
|
11
|
-
/**
|
|
12
|
-
* `base` plus one `blocking_prompt_visible` rule per trust prompt that stays
|
|
13
|
-
* unanswered under `autotrust`. Each rule recognizes the prompt only by its
|
|
14
|
-
* HEADER outside the option region (`trustHeaderMatches`, the same recognizer
|
|
15
|
-
* the responder uses; the non-option text is computed once per frame and cached
|
|
16
|
-
* across the rules), so an unrelated numbered/cursor option containing a trust
|
|
17
|
-
* phrase is NOT mistaken for a blocking trust prompt (PRD §5.1). Returns `base`
|
|
18
|
-
* unchanged when no trust prompt blocks (e.g. every allowlisted prompt is
|
|
19
|
-
* auto-answered).
|
|
20
|
-
*/
|
|
21
|
-
export function withTrustBlockingRules(base, agent, autotrust) {
|
|
22
|
-
let cachedFrame;
|
|
23
|
-
let cachedHeader = "";
|
|
24
|
-
const headerFor = (text) => {
|
|
25
|
-
if (text !== cachedFrame) {
|
|
26
|
-
cachedFrame = text;
|
|
27
|
-
cachedHeader = nonOptionText(text);
|
|
28
|
-
}
|
|
29
|
-
return cachedHeader;
|
|
30
|
-
};
|
|
31
|
-
const rules = blockingTrustSpecs(agent, autotrust).map((spec) => ({
|
|
32
|
-
id: `${agent}-${spec.id}-prompt`,
|
|
33
|
-
fact: "blocking_prompt_visible",
|
|
34
|
-
match: (text) => trustHeaderMatches(headerFor(text), spec),
|
|
35
|
-
}));
|
|
36
|
-
return rules.length === 0 ? base : { ...base, rules: [...base.rules, ...rules] };
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=trust-blocking.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trust-blocking.js","sourceRoot":"","sources":["../../src/core/trust-blocking.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE5E;;;;;;;;;GASG;AACH,MAAM,UAAU,sBAAsB,CACpC,IAAqB,EACrB,KAAsB,EACtB,SAAkB;IAElB,IAAI,WAA+B,CAAC;IACpC,IAAI,YAAY,GAAG,EAAE,CAAC;IACtB,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,EAAE;QACjC,IAAI,IAAI,KAAK,WAAW,EAAE,CAAC;YACzB,WAAW,GAAG,IAAI,CAAC;YACnB,YAAY,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;QACrC,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC,CAAC;IACF,MAAM,KAAK,GAAqB,kBAAkB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAClF,EAAE,EAAE,GAAG,KAAK,IAAI,IAAI,CAAC,EAAE,SAAS;QAChC,IAAI,EAAE,yBAAyB;QAC/B,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;KAC3D,CAAC,CAAC,CAAC;IACJ,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;AACnF,CAAC"}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Allowlist of known adapter startup trust prompts and how to answer them.
|
|
3
|
-
* Implements PRD §5.1 and §5.5 (C-CLAUDE-10, C-CODEX-11, C-CLAUDE-14, C-CODEX-15).
|
|
4
|
-
*
|
|
5
|
-
* This is an EXPLICIT allowlist, not an open-ended matcher: each entry names one
|
|
6
|
-
* concrete prompt by its on-screen text and a fixed affirmative outcome. A new
|
|
7
|
-
* CLI prompt is trusted only by adding a deliberate entry here — Elwood never
|
|
8
|
-
* blanket-answers "any first-run confirmation", which would silently bypass a
|
|
9
|
-
* future CLI security gate for third-party code or config.
|
|
10
|
-
*/
|
|
11
|
-
import type { ElwoodAgentKind } from "./activity.ts";
|
|
12
|
-
/**
|
|
13
|
-
* The fields common to every allowlisted trust prompt. The prompt and its answer
|
|
14
|
-
* are BOTH matched within the same current frame: `headerPattern` identifies the
|
|
15
|
-
* prompt by its HEADER wording, and `accept` matches the exact affirmative option
|
|
16
|
-
* label in that same prompt. This prevents a stale phrase from one frame pairing
|
|
17
|
-
* with a "Yes" from a different, current dialog (which could auto-confirm an
|
|
18
|
-
* unrelated security gate). `headerPattern` is a HEADER matcher, not a
|
|
19
|
-
* whole-frame matcher: it is only safe when tested against the frame's non-option
|
|
20
|
-
* lines (via `trustHeaderMatches`), never applied raw to the full frame.
|
|
21
|
-
*/
|
|
22
|
-
type TrustPromptBase = {
|
|
23
|
-
/**
|
|
24
|
-
* Identifies the prompt by its HEADER wording. MUST be tested only against the
|
|
25
|
-
* frame's non-option lines (see `trustHeaderMatches`) — applying it raw to the
|
|
26
|
-
* full frame would let an option-only trust phrase spoof recognition.
|
|
27
|
-
* Verified against the CLI versions below.
|
|
28
|
-
*/
|
|
29
|
-
readonly headerPattern: RegExp;
|
|
30
|
-
/** Matches the exact affirmative option label for THIS prompt (per-prompt, not generic). */
|
|
31
|
-
readonly accept: RegExp;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* When an allowlisted prompt is answered. `"autotrust"` prompts are answered ONLY
|
|
35
|
-
* under the caller's full-trust posture; `"always"` prompts are answered
|
|
36
|
-
* regardless of it (Elwood's own hook bridge, never third-party code).
|
|
37
|
-
*/
|
|
38
|
-
export type TrustAnswerPolicy = "always" | "autotrust";
|
|
39
|
-
/**
|
|
40
|
-
* One allowlisted trust prompt, as an agent+id-DISCRIMINATED union so that (a) a
|
|
41
|
-
* typo in `id` cannot compile into a public startup label, and (b)
|
|
42
|
-
* `answerPolicy: "always"` — answered regardless of `autotrust` — is permitted
|
|
43
|
-
* ONLY on Codex `hook_trust`, Elwood's OWN integration (the hook bridge) that the
|
|
44
|
-
* session requires to work. Every third-party trust prompt (skills, plugins, MCP
|
|
45
|
-
* servers, folder trust) is `answerPolicy: "autotrust"`, staying gated on the
|
|
46
|
-
* caller's full-trust posture, so the invalid "third-party prompt answered
|
|
47
|
-
* always" state is unrepresentable.
|
|
48
|
-
*/
|
|
49
|
-
export type TrustPromptSpec = ({
|
|
50
|
-
readonly agent: "claude";
|
|
51
|
-
readonly id: ClaudeTrustPromptId;
|
|
52
|
-
readonly answerPolicy: "autotrust";
|
|
53
|
-
} & TrustPromptBase) | ({
|
|
54
|
-
readonly agent: "codex";
|
|
55
|
-
readonly id: "workspace_trust";
|
|
56
|
-
readonly answerPolicy: "autotrust";
|
|
57
|
-
} & TrustPromptBase) | ({
|
|
58
|
-
readonly agent: "codex";
|
|
59
|
-
readonly id: "hook_trust";
|
|
60
|
-
/** Answered regardless of `autotrust`: Elwood's own hook bridge (never third-party code). */
|
|
61
|
-
readonly answerPolicy: "always";
|
|
62
|
-
} & TrustPromptBase);
|
|
63
|
-
/** The Claude trust-prompt ids: folder trust plus the CLI's first-run skill/plugin/MCP gates. */
|
|
64
|
-
type ClaudeTrustPromptId = "workspace_trust" | "skill_trust" | "plugin_trust" | "mcp_trust";
|
|
65
|
-
/**
|
|
66
|
-
* The allowlist. Wording verified against claude 2.1.205–2.1.252 and codex-cli 0.142.5.
|
|
67
|
-
* `workspace`/`directory` trust are the folder-trust gates; `skill`, `plugin`,
|
|
68
|
-
* and `mcp` cover the CLI's first-run trust prompts for loading third-party
|
|
69
|
-
* skills, plugins, and MCP servers under a full-trust launch.
|
|
70
|
-
*/
|
|
71
|
-
export declare const trustPromptAllowlist: readonly [{
|
|
72
|
-
readonly id: "workspace_trust";
|
|
73
|
-
readonly agent: "claude";
|
|
74
|
-
readonly headerPattern: RegExp;
|
|
75
|
-
readonly accept: RegExp;
|
|
76
|
-
readonly answerPolicy: "autotrust";
|
|
77
|
-
}, {
|
|
78
|
-
readonly id: "skill_trust";
|
|
79
|
-
readonly agent: "claude";
|
|
80
|
-
readonly headerPattern: RegExp;
|
|
81
|
-
readonly accept: RegExp;
|
|
82
|
-
readonly answerPolicy: "autotrust";
|
|
83
|
-
}, {
|
|
84
|
-
readonly id: "plugin_trust";
|
|
85
|
-
readonly agent: "claude";
|
|
86
|
-
readonly headerPattern: RegExp;
|
|
87
|
-
readonly accept: RegExp;
|
|
88
|
-
readonly answerPolicy: "autotrust";
|
|
89
|
-
}, {
|
|
90
|
-
readonly id: "mcp_trust";
|
|
91
|
-
readonly agent: "claude";
|
|
92
|
-
readonly headerPattern: RegExp;
|
|
93
|
-
readonly accept: RegExp;
|
|
94
|
-
readonly answerPolicy: "autotrust";
|
|
95
|
-
}, {
|
|
96
|
-
readonly id: "workspace_trust";
|
|
97
|
-
readonly agent: "codex";
|
|
98
|
-
readonly headerPattern: RegExp;
|
|
99
|
-
readonly accept: RegExp;
|
|
100
|
-
readonly answerPolicy: "autotrust";
|
|
101
|
-
}, {
|
|
102
|
-
readonly id: "hook_trust";
|
|
103
|
-
readonly agent: "codex";
|
|
104
|
-
readonly headerPattern: RegExp;
|
|
105
|
-
readonly accept: RegExp;
|
|
106
|
-
readonly answerPolicy: "always";
|
|
107
|
-
}];
|
|
108
|
-
/**
|
|
109
|
-
* True when `spec`'s HEADER wording appears in `header` — the frame's NON-option
|
|
110
|
-
* text as produced by `nonOptionText`. This is the ONE shared, option-aware
|
|
111
|
-
* recognizer: the responder, the cursor navigator, and the screen-fact blocking
|
|
112
|
-
* rules all go through it (each computes `nonOptionText` once per frame and
|
|
113
|
-
* tests every spec against that), so a numbered or cursor-selectable option whose
|
|
114
|
-
* label merely contains a trust phrase is never recognized as a prompt. Matching
|
|
115
|
-
* joined non-option lines also keeps wrapped headers matchable (§5.1).
|
|
116
|
-
*/
|
|
117
|
-
export declare function trustHeaderMatches(header: string, spec: TrustPromptBase): boolean;
|
|
118
|
-
/** `trustHeaderMatches` over a raw frame, for callers that test a single spec. */
|
|
119
|
-
export declare function trustPromptHeaderVisible(frame: string, spec: TrustPromptBase): boolean;
|
|
120
|
-
/**
|
|
121
|
-
* The stable public `startup_prompt` trust labels (§5.4), derived from the
|
|
122
|
-
* allowlist so the two can never drift: deleting, adding, or renaming an entry
|
|
123
|
-
* updates this union automatically. Because `TrustPromptSpec` fixes each agent's
|
|
124
|
-
* ids to a closed literal union, a typo in an entry's `id` fails to compile
|
|
125
|
-
* against `satisfies` rather than silently widening this derived label union.
|
|
126
|
-
*/
|
|
127
|
-
export type TrustPromptId = (typeof trustPromptAllowlist)[number]["id"];
|
|
128
|
-
/** The trust label ids for one specific agent (e.g. Codex automation cannot use a Claude-only id). */
|
|
129
|
-
export type TrustPromptIdFor<A extends ElwoodAgentKind> = Extract<(typeof trustPromptAllowlist)[number], {
|
|
130
|
-
readonly agent: A;
|
|
131
|
-
}>["id"];
|
|
132
|
-
/** Specs for one agent that stay UNANSWERED under the effective policy (block on the human). */
|
|
133
|
-
export declare function blockingTrustSpecs(agent: ElwoodAgentKind, autotrust: boolean): readonly TrustPromptSpec[];
|
|
134
|
-
export {};
|
|
135
|
-
//# sourceMappingURL=trust-prompts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trust-prompts.d.ts","sourceRoot":"","sources":["../../src/core/trust-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD;;;;;;;;;GASG;AACH,KAAK,eAAe,GAAG;IACrB;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IA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AC,KAAK,KAAK,KAAK,IAAI,IAAI,CAAC,YAAY,KAAK,QAAQ,IAAI,CAAC,SAAS,CAC/E,CAAC;AACJ,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Detects and answers the allowlisted family of adapter startup trust prompts.
|
|
3
|
-
* Implements PRD §5.1 and §9.1 (C-CLAUDE-10, C-CODEX-11, C-CLAUDE-14, C-CODEX-15).
|
|
4
|
-
*
|
|
5
|
-
* Policy (PRD §5.1): an agent must NEVER be left waiting on a trust gate.
|
|
6
|
-
* Under the caller's full-trust posture, when an allowlisted trust prompt is
|
|
7
|
-
* visible in the current frame, Elwood selects its affirmative option and sends
|
|
8
|
-
* it — always say yes. Elwood only auto-answers ALLOWLISTED prompts (an
|
|
9
|
-
* off-allowlist confirmation is left to the human), and never re-answers the same
|
|
10
|
-
* prompt; those are the only limits.
|
|
11
|
-
*/
|
|
12
|
-
import type { ElwoodAgentKind } from "./activity.ts";
|
|
13
|
-
import { type TrustPromptIdFor } from "./trust-prompts.ts";
|
|
14
|
-
/** An answered trust prompt; `prompt` is narrowed to the responder's agent. */
|
|
15
|
-
export type TrustPromptAutomation<A extends ElwoodAgentKind = ElwoodAgentKind> = {
|
|
16
|
-
readonly prompt: TrustPromptIdFor<A>;
|
|
17
|
-
readonly input: string;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* The completion of an answered trust write: a `void | Promise<void>` write is
|
|
21
|
-
* normalized to a promise that resolves on success and rejects once the prompt
|
|
22
|
-
* has been un-settled (kept retryable) on a rejected write.
|
|
23
|
-
*/
|
|
24
|
-
export type TrustWriteResult = void | Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* The outcome of handling a frame: an answered prompt, a recognized prompt whose
|
|
27
|
-
* affirmative option has not rendered yet (a TRANSIENT render delay — under the
|
|
28
|
-
* say-yes policy a later frame carrying the option is still answered, so this is
|
|
29
|
-
* never a terminal wedge), or nothing.
|
|
30
|
-
*/
|
|
31
|
-
export type TrustPromptResult<A extends ElwoodAgentKind = ElwoodAgentKind> = {
|
|
32
|
-
readonly kind: "answered";
|
|
33
|
-
readonly automation: TrustPromptAutomation<A>;
|
|
34
|
-
readonly settled: Promise<void>;
|
|
35
|
-
} | {
|
|
36
|
-
readonly kind: "option_pending";
|
|
37
|
-
readonly prompt: TrustPromptIdFor<A>;
|
|
38
|
-
} | undefined;
|
|
39
|
-
export declare class TrustPromptResponder<A extends ElwoodAgentKind> {
|
|
40
|
-
private readonly autotrust;
|
|
41
|
-
private readonly specs;
|
|
42
|
-
private readonly settled;
|
|
43
|
-
private readonly reportedPending;
|
|
44
|
-
constructor(agent: A, autotrust?: boolean);
|
|
45
|
-
/** `frame` MUST be the CURRENT rendered screen, not an accumulated buffer. */
|
|
46
|
-
handle(frame: string, write: (input: string) => TrustWriteResult, readFrame?: () => string): TrustPromptResult<A>;
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=trust-responder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trust-responder.d.ts","sourceRoot":"","sources":["../../src/core/trust-responder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAQrD,OAAO,EACL,KAAK,gBAAgB,EAItB,MAAM,oBAAoB,CAAC;AAQ5B,+EAA+E;AAC/E,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,IAAI;IAC/E,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,IACrE;IACE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAG9C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAA;CAAE,GACzE,SAAS,CAAC;AAEd,qBAAa,oBAAoB,CAAC,CAAC,SAAS,eAAe;IAGzD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAU;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA8B;IACpD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkC;IAI1D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAkC;gBAEtD,KAAK,EAAE,CAAC,EAAE,SAAS,UAAQ;IAKvC,8EAA8E;IAC9E,MAAM,CACJ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,gBAAgB,EAC1C,SAAS,CAAC,EAAE,MAAM,MAAM,GACvB,iBAAiB,CAAC,CAAC,CAAC;CA0CxB"}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Detects and answers the allowlisted family of adapter startup trust prompts.
|
|
3
|
-
* Implements PRD §5.1 and §9.1 (C-CLAUDE-10, C-CODEX-11, C-CLAUDE-14, C-CODEX-15).
|
|
4
|
-
*
|
|
5
|
-
* Policy (PRD §5.1): an agent must NEVER be left waiting on a trust gate.
|
|
6
|
-
* Under the caller's full-trust posture, when an allowlisted trust prompt is
|
|
7
|
-
* visible in the current frame, Elwood selects its affirmative option and sends
|
|
8
|
-
* it — always say yes. Elwood only auto-answers ALLOWLISTED prompts (an
|
|
9
|
-
* off-allowlist confirmation is left to the human), and never re-answers the same
|
|
10
|
-
* prompt; those are the only limits.
|
|
11
|
-
*/
|
|
12
|
-
import { delay } from "./delay.js";
|
|
13
|
-
import { nonOptionText, optionInput, optionKeystrokes, selectableOptions, } from "./terminal-options.js";
|
|
14
|
-
import { trustHeaderMatches, trustPromptAllowlist, trustPromptHeaderVisible, } from "./trust-prompts.js";
|
|
15
|
-
const cursorRetryMs = 250;
|
|
16
|
-
const cursorNavigationTimeoutMs = 5_000;
|
|
17
|
-
export class TrustPromptResponder {
|
|
18
|
-
// Whether the caller launched under full trust (`autotrust`). `answerPolicy:
|
|
19
|
-
// "always"` prompts (hook trust) are answered even when this is false.
|
|
20
|
-
autotrust;
|
|
21
|
-
specs;
|
|
22
|
-
settled = new Set();
|
|
23
|
-
// A prompt whose "option not rendered yet" state was reported once, kept
|
|
24
|
-
// SEPARATE from `settled` so a later frame with the real option can still be
|
|
25
|
-
// answered — the pending state is transient, not terminal.
|
|
26
|
-
reportedPending = new Set();
|
|
27
|
-
constructor(agent, autotrust = false) {
|
|
28
|
-
this.autotrust = autotrust;
|
|
29
|
-
this.specs = trustPromptAllowlist.filter((spec) => spec.agent === agent);
|
|
30
|
-
}
|
|
31
|
-
/** `frame` MUST be the CURRENT rendered screen, not an accumulated buffer. */
|
|
32
|
-
handle(frame, write, readFrame) {
|
|
33
|
-
const header = nonOptionText(frame);
|
|
34
|
-
for (const spec of this.specs) {
|
|
35
|
-
const id = spec.id;
|
|
36
|
-
// `answerPolicy: "always"` prompts (Elwood's own hook bridge) answer
|
|
37
|
-
// regardless of autotrust; every other trust prompt requires the caller's
|
|
38
|
-
// full-trust posture.
|
|
39
|
-
if (!(this.autotrust || spec.answerPolicy === "always"))
|
|
40
|
-
continue;
|
|
41
|
-
// Recognized when the prompt's HEADER wording appears on a NON-OPTION line
|
|
42
|
-
// (via the shared `trustHeaderMatches`), so a phrase living only inside an
|
|
43
|
-
// option label can't spoof a prompt. That is the ONLY guard — recognition
|
|
44
|
-
// means "say yes".
|
|
45
|
-
if (this.settled.has(id) || !trustHeaderMatches(header, spec))
|
|
46
|
-
continue;
|
|
47
|
-
const options = selectableOptions(frame);
|
|
48
|
-
const option = options.find((candidate) => spec.accept.test(candidate.label));
|
|
49
|
-
if (option === undefined) {
|
|
50
|
-
// Affirmative not rendered yet (partial frame). Report once, but DON'T
|
|
51
|
-
// settle — a later frame with the option can still be answered.
|
|
52
|
-
if (this.reportedPending.has(id))
|
|
53
|
-
continue;
|
|
54
|
-
this.reportedPending.add(id);
|
|
55
|
-
return { kind: "option_pending", prompt: id };
|
|
56
|
-
}
|
|
57
|
-
// Settle OPTIMISTICALLY so a second frame in the same tick does not re-answer,
|
|
58
|
-
// but keep the settle contingent on the write: if the write is rejected we
|
|
59
|
-
// un-settle here so a later frame re-attempts it, and the returned `settled`
|
|
60
|
-
// promise rejects so the caller emits a warning instead of a false "answered".
|
|
61
|
-
this.settled.add(id);
|
|
62
|
-
const input = optionInput(option);
|
|
63
|
-
const operation = option.style === "cursor"
|
|
64
|
-
? readFrame === undefined
|
|
65
|
-
? Promise.reject(new Error("Cursor trust navigation requires live screen reads."))
|
|
66
|
-
: navigateCursorOption(spec, input, write, readFrame)
|
|
67
|
-
: writeOptionKeys(optionKeystrokes(option), write);
|
|
68
|
-
const settled = operation.catch((error) => {
|
|
69
|
-
this.settled.delete(id);
|
|
70
|
-
throw error;
|
|
71
|
-
});
|
|
72
|
-
return { kind: "answered", automation: { prompt: id, input }, settled };
|
|
73
|
-
}
|
|
74
|
-
return undefined;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
/** Writes one option's keys in order (numbered prompts and parser-only tests). */
|
|
78
|
-
async function writeOptionKeys(keys, write) {
|
|
79
|
-
for (const key of keys)
|
|
80
|
-
await write(key);
|
|
81
|
-
}
|
|
82
|
-
/** Navigates a cursor prompt one observed frame at a time, retrying swallowed startup input. */
|
|
83
|
-
async function navigateCursorOption(spec, originalInput, write, readFrame) {
|
|
84
|
-
const deadline = Date.now() + cursorNavigationTimeoutMs;
|
|
85
|
-
while (Date.now() < deadline) {
|
|
86
|
-
const before = readFrame();
|
|
87
|
-
if (!trustPromptHeaderVisible(before, spec)) {
|
|
88
|
-
throw new Error("Cursor trust prompt disappeared before confirmation.");
|
|
89
|
-
}
|
|
90
|
-
const target = selectableOptions(before).find((option) => spec.accept.test(option.label));
|
|
91
|
-
if (target?.style !== "cursor") {
|
|
92
|
-
await delay(cursorRetryMs);
|
|
93
|
-
continue;
|
|
94
|
-
}
|
|
95
|
-
const key = target.offset === 0 ? "\r" : target.offset < 0 ? "\u001b[A" : "\u001b[B";
|
|
96
|
-
await write(key);
|
|
97
|
-
const progress = await waitForCursorProgress(spec, target.offset, readFrame);
|
|
98
|
-
if (progress === "cleared")
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
throw new Error(`Cursor trust navigation timed out (${originalInput}).`);
|
|
102
|
-
}
|
|
103
|
-
async function waitForCursorProgress(spec, priorOffset, readFrame) {
|
|
104
|
-
const deadline = Date.now() + cursorRetryMs;
|
|
105
|
-
while (Date.now() < deadline) {
|
|
106
|
-
await delay(20);
|
|
107
|
-
const frame = readFrame();
|
|
108
|
-
if (!trustPromptHeaderVisible(frame, spec)) {
|
|
109
|
-
if (priorOffset === 0)
|
|
110
|
-
return "cleared";
|
|
111
|
-
throw new Error("Cursor trust prompt disappeared before confirmation.");
|
|
112
|
-
}
|
|
113
|
-
const target = selectableOptions(frame).find((option) => spec.accept.test(option.label));
|
|
114
|
-
if (target?.style === "cursor" && target.offset !== priorOffset)
|
|
115
|
-
return "retry";
|
|
116
|
-
}
|
|
117
|
-
return "retry";
|
|
118
|
-
}
|
|
119
|
-
//# sourceMappingURL=trust-responder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trust-responder.js","sourceRoot":"","sources":["../../src/core/trust-responder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EACL,aAAa,EACb,WAAW,EACX,gBAAgB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,MAAM,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAC7E,IAAI,QAAQ,KAAK,SAAS;YAAE,OAAO;IACrC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,sCAAsC,aAAa,IAAI,CAAC,CAAC;AAC3E,CAAC;AAED,KAAK,UAAU,qBAAqB,CAClC,IAAsB,EACtB,WAAmB,EACnB,SAAuB;IAEvB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,aAAa,CAAC;IAC5C,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,EAAE,CAAC;QAC7B,MAAM,KAAK,CAAC,EAAE,CAAC,CAAC;QAChB,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC;QAC1B,IAAI,CAAC,wBAAwB,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;YAC3C,IAAI,WAAW,KAAK,CAAC;gBAAE,OAAO,SAAS,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;QAC1E,CAAC;QACD,MAAM,MAAM,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACzF,IAAI,MAAM,EAAE,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,WAAW;YAAE,OAAO,OAAO,CAAC;IAClF,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Screen-state polling primitives for TUI automation flows.
|
|
3
|
-
* Implements PRD §5.3 model picker automation.
|
|
4
|
-
*/
|
|
5
|
-
export type ScreenTerminal = {
|
|
6
|
-
sendInput(data: string | Uint8Array): void | Promise<void>;
|
|
7
|
-
snapshot(): {
|
|
8
|
-
readonly text: string;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export declare const defaultModelTimeoutMs = 20000;
|
|
12
|
-
export declare function waitForScreen(terminal: ScreenTerminal, test: (text: string) => boolean, timeoutMs: number, label: string): Promise<string>;
|
|
13
|
-
export declare function openCommandScreen(input: {
|
|
14
|
-
readonly terminal: ScreenTerminal;
|
|
15
|
-
readonly submit: () => Promise<void>;
|
|
16
|
-
readonly isOpen: (text: string) => boolean;
|
|
17
|
-
readonly timeoutMs: number;
|
|
18
|
-
readonly label: string;
|
|
19
|
-
readonly nudgeDelayMs?: number;
|
|
20
|
-
}): Promise<string>;
|
|
21
|
-
//# sourceMappingURL=tui-screen.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tui-screen.d.ts","sourceRoot":"","sources":["../../src/core/tui-screen.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D,QAAQ,IAAI;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACvC,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAI5C,wBAAsB,aAAa,CACjC,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,EAC/B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,CAAC,CAQjB;AAED,wBAAsB,iBAAiB,CAAC,KAAK,EAAE;IAC7C,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAC3C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC,GAAG,OAAO,CAAC,MAAM,CAAC,CAiClB"}
|
package/dist/core/tui-screen.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Screen-state polling primitives for TUI automation flows.
|
|
3
|
-
* Implements PRD §5.3 model picker automation.
|
|
4
|
-
*/
|
|
5
|
-
import { delay } from "./delay.js";
|
|
6
|
-
import { elwoodError } from "./errors.js";
|
|
7
|
-
export const defaultModelTimeoutMs = 20_000;
|
|
8
|
-
const pollMs = 100;
|
|
9
|
-
const openNudgeDelayMs = 2_000;
|
|
10
|
-
export async function waitForScreen(terminal, test, timeoutMs, label) {
|
|
11
|
-
const started = Date.now();
|
|
12
|
-
while (Date.now() - started < timeoutMs) {
|
|
13
|
-
const text = terminal.snapshot().text;
|
|
14
|
-
if (test(text))
|
|
15
|
-
return text;
|
|
16
|
-
await delay(pollMs);
|
|
17
|
-
}
|
|
18
|
-
throw elwoodError("model_automation_failed", `Timed out waiting for ${label}.`);
|
|
19
|
-
}
|
|
20
|
-
export async function openCommandScreen(input) {
|
|
21
|
-
await input.submit();
|
|
22
|
-
// The command text or its Enter can be dropped when the TUI is redrawing
|
|
23
|
-
// (e.g. an MCP-server boot streaming into the composer at startup). A bare
|
|
24
|
-
// Enter nudge cannot recover a lost command line, so re-submit the whole
|
|
25
|
-
// command on each nudge interval until the picker opens or the timeout
|
|
26
|
-
// fires. Re-typing an idempotent slash command on an empty composer, and a
|
|
27
|
-
// surplus Enter, are both no-ops once the picker is already open.
|
|
28
|
-
const nudgeDelayMs = input.nudgeDelayMs ?? openNudgeDelayMs;
|
|
29
|
-
let resubmitting = false;
|
|
30
|
-
let nudgeTimer;
|
|
31
|
-
// A re-submit that rejects (e.g. the session closed while polling) must
|
|
32
|
-
// settle this call with that error immediately, not be dropped as an
|
|
33
|
-
// unhandled rejection while the caller waits out the picker timeout.
|
|
34
|
-
const submitFailed = new Promise((_resolve, reject) => {
|
|
35
|
-
nudgeTimer = setInterval(() => {
|
|
36
|
-
if (resubmitting || input.isOpen(input.terminal.snapshot().text))
|
|
37
|
-
return;
|
|
38
|
-
resubmitting = true;
|
|
39
|
-
// A rejected re-submit (e.g. the session closed while polling) is
|
|
40
|
-
// propagated unchanged so the caller settles with the real error.
|
|
41
|
-
input.submit().then(() => {
|
|
42
|
-
resubmitting = false;
|
|
43
|
-
}, reject);
|
|
44
|
-
}, nudgeDelayMs);
|
|
45
|
-
});
|
|
46
|
-
try {
|
|
47
|
-
return await Promise.race([
|
|
48
|
-
waitForScreen(input.terminal, input.isOpen, input.timeoutMs, input.label),
|
|
49
|
-
submitFailed,
|
|
50
|
-
]);
|
|
51
|
-
}
|
|
52
|
-
finally {
|
|
53
|
-
clearInterval(nudgeTimer);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=tui-screen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tui-screen.js","sourceRoot":"","sources":["../../src/core/tui-screen.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAO1C,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAC5C,MAAM,MAAM,GAAG,GAAG,CAAC;AACnB,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAE/B,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,QAAwB,EACxB,IAA+B,EAC/B,SAAiB,EACjB,KAAa;IAEb,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3B,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,GAAG,SAAS,EAAE,CAAC;QACxC,MA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,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC;YACzE,YAAY;SACb,CAAC,CAAC;IACL,CAAC;YAAS,CAAC;QACT,aAAa,CAAC,UAAU,CAAC,CAAC;IAC5B,CAAC;AACH,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Builds the best-effort `agent_update_failed` warning (PRD §9.2, C-LIFE-11) shared by both
|
|
3
|
-
* adapter preflights. A `claude update` / `codex update` that fails is contained (never fatal
|
|
4
|
-
* when the installed CLI is compatible) and surfaced as this live warning with the diagnostics
|
|
5
|
-
* the PRD allows — the installed version in use, the update probe's errno, and the updater's own
|
|
6
|
-
* stderr capped at 2 KB in `raw` (the CLI updater's output, never session transcripts or
|
|
7
|
-
* prompts).
|
|
8
|
-
*/
|
|
9
|
-
import type { ElwoodAgentKind } from "./activity.ts";
|
|
10
|
-
import type { AgentUpdateFailedWarning } from "./warning-lifecycle.ts";
|
|
11
|
-
/**
|
|
12
|
-
* `Omit` that DISTRIBUTES over a union (`W extends unknown` triggers distribution), unlike the
|
|
13
|
-
* built-in `Omit`, which collapses `A | B` into a single merged object and loses the discriminant.
|
|
14
|
-
* Preflight warning types are unions, so they must use this to stay discriminable after `omit`.
|
|
15
|
-
*/
|
|
16
|
-
export type DistributiveOmit<W, K extends PropertyKey> = W extends unknown ? Omit<W, K> : never;
|
|
17
|
-
/** The `agent_update_failed` warning without `elwoodSessionId` (attached when emitted). */
|
|
18
|
-
export type UpdateFailedWarning = Omit<AgentUpdateFailedWarning, "elwoodSessionId">;
|
|
19
|
-
/**
|
|
20
|
-
* Build the warning from the contained update error. `installedVersion` is the parsed version the
|
|
21
|
-
* session will actually run (the preflight re-read it after the failed update). `errorCode` is the
|
|
22
|
-
* update probe's allowlisted `errno` (e.g. `ETIMEDOUT`) when present, else a generic token.
|
|
23
|
-
*/
|
|
24
|
-
export declare function updateFailedWarning(agent: ElwoodAgentKind, installedVersion: string, error: unknown): UpdateFailedWarning;
|
|
25
|
-
//# sourceMappingURL=update-warning.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-warning.d.ts","sourceRoot":"","sources":["../../src/core/update-warning.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAEvE;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,EAAE,CAAC,SAAS,WAAW,IAAI,CAAC,SAAS,OAAO,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC;AAEhG,2FAA2F;AAC3F,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,wBAAwB,EAAE,iBAAiB,CAAC,CAAC;AAMpF;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,eAAe,EACtB,gBAAgB,EAAE,MAAM,EACxB,KAAK,EAAE,OAAO,GACb,mBAAmB,CAcrB"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Builds the best-effort `agent_update_failed` warning (PRD §9.2, C-LIFE-11) shared by both
|
|
3
|
-
* adapter preflights. A `claude update` / `codex update` that fails is contained (never fatal
|
|
4
|
-
* when the installed CLI is compatible) and surfaced as this live warning with the diagnostics
|
|
5
|
-
* the PRD allows — the installed version in use, the update probe's errno, and the updater's own
|
|
6
|
-
* stderr capped at 2 KB in `raw` (the CLI updater's output, never session transcripts or
|
|
7
|
-
* prompts).
|
|
8
|
-
*/
|
|
9
|
-
import { ElwoodError } from "./errors.js";
|
|
10
|
-
// Cap on the stderr carried in the warning's `raw`, so a hostile/verbose updater cannot flood a
|
|
11
|
-
// warning payload. The probe layer already bounds captured output; this is a second, tighter cap.
|
|
12
|
-
const maxStderr = 2_000;
|
|
13
|
-
/**
|
|
14
|
-
* Build the warning from the contained update error. `installedVersion` is the parsed version the
|
|
15
|
-
* session will actually run (the preflight re-read it after the failed update). `errorCode` is the
|
|
16
|
-
* update probe's allowlisted `errno` (e.g. `ETIMEDOUT`) when present, else a generic token.
|
|
17
|
-
*/
|
|
18
|
-
export function updateFailedWarning(agent, installedVersion, error) {
|
|
19
|
-
const details = error instanceof ElwoodError ? error.details : {};
|
|
20
|
-
const errno = typeof details["errno"] === "string" ? details["errno"] : undefined;
|
|
21
|
-
const stderr = typeof details["stderr"] === "string" ? details["stderr"] : "";
|
|
22
|
-
return {
|
|
23
|
-
agent,
|
|
24
|
-
source: "lifecycle",
|
|
25
|
-
code: "agent_update_failed",
|
|
26
|
-
severity: "warning",
|
|
27
|
-
message: `\`${agent} update\` failed; continuing with the installed CLI ${installedVersion}.`,
|
|
28
|
-
installedVersion,
|
|
29
|
-
errorCode: errno ?? "update_failed",
|
|
30
|
-
raw: stderr.slice(0, maxStderr),
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=update-warning.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-warning.js","sourceRoot":"","sources":["../../src/core/update-warning.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAa1C,gGAAgG;AAChG,kGAAkG;AAClG,MAAM,SAAS,GAAG,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAsB,EACtB,gBAAwB,EACxB,KAAc;IAEd,MAAM,OAAO,GAAG,KAAK,YAAY,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IAClE,MAAM,KAAK,GAAG,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAClF,MAAM,MAAM,GAAG,OAAO,OAAO,CAAC,QAAQ,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9E,OAAO;QACL,KAAK;QACL,MAAM,EAAE,WAAW;QACnB,IAAI,EAAE,qBAAqB;QAC3B,QAAQ,EAAE,SAAS;QACnB,OAAO,EAAE,KAAK,KAAK,uDAAuD,gBAAgB,GAAG;QAC7F,gBAAgB;QAChB,SAAS,EAAE,KAAK,IAAI,eAAe;QACnC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC;KAChC,CAAC;AACJ,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lifecycle preflight warning shapes split out of the main warning union (§9.2, C-LIFE-11) to
|
|
3
|
-
* keep `warnings.ts` under the file-size cap. These are ordinary `ElwoodWarningEvent` members.
|
|
4
|
-
*/
|
|
5
|
-
import type { ElwoodAgentKind } from "./activity.ts";
|
|
6
|
-
/**
|
|
7
|
-
* Best-effort `claude update` / `codex update` failed but the INSTALLED CLI still meets the
|
|
8
|
-
* minimum, so the session started from it. Safe diagnostics only: the installed version in use,
|
|
9
|
-
* an allowlisted `errorCode` (a probe timeout/`errno`), and bounded `raw` stderr — never terminal
|
|
10
|
-
* transcripts, prompts, tokens, or environment secrets.
|
|
11
|
-
*/
|
|
12
|
-
export type AgentUpdateFailedWarning = {
|
|
13
|
-
readonly elwoodSessionId: string;
|
|
14
|
-
readonly agent: ElwoodAgentKind;
|
|
15
|
-
readonly source: "lifecycle";
|
|
16
|
-
readonly code: "agent_update_failed";
|
|
17
|
-
readonly severity: "warning";
|
|
18
|
-
readonly message: string;
|
|
19
|
-
readonly installedVersion: string;
|
|
20
|
-
readonly errorCode: string;
|
|
21
|
-
readonly raw: string;
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=warning-lifecycle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"warning-lifecycle.d.ts","sourceRoot":"","sources":["../../src/core/warning-lifecycle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"warning-lifecycle.js","sourceRoot":"","sources":["../../src/core/warning-lifecycle.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The fixed allowlists of bounded reason/error-code tokens carried by content-free
|
|
3
|
-
* warnings, and their derived types + guards.
|
|
4
|
-
* Implements PRD §5.7 (C-CLAUDE-15, C-LIFE-10): the `reason` field of a
|
|
5
|
-
* `transcript_poll_stopped` warning and the `errorCode` field of a `reap_failed`
|
|
6
|
-
* warning may carry ONLY a value from a fixed allowlist — never a raw system
|
|
7
|
-
* message or a caller-controlled string that could leak content into a live
|
|
8
|
-
* warning. This module is the single source of truth the unions and their
|
|
9
|
-
* producers derive from, so a producer and its type can never drift apart.
|
|
10
|
-
*/
|
|
11
|
-
/** The fixed fallback token every bounded error-token allowlist collapses to. */
|
|
12
|
-
export declare const unknownErrorToken = "UnknownError";
|
|
13
|
-
/**
|
|
14
|
-
* Maps an arbitrary thrown value to a bounded, ALLOWLISTED token, shared by every
|
|
15
|
-
* content-free warning that carries a normalized error code (reap, transcript
|
|
16
|
-
* poll, resize restore). An error's `.code` (errno), `Error.name`, and message are
|
|
17
|
-
* all system/caller-controlled and can embed an env path or conversation text, so
|
|
18
|
-
* only a value the caller's `allow` guard accepts passes through; anything else —
|
|
19
|
-
* including a raw system message — collapses to `UnknownError`. This is the single
|
|
20
|
-
* place the sanitizing rule lives, so no producer can weaken it (§5.7).
|
|
21
|
-
*/
|
|
22
|
-
export declare function boundedErrorToken<T extends string>(error: unknown, allow: (value: unknown) => value is T): T | typeof unknownErrorToken;
|
|
23
|
-
/**
|
|
24
|
-
* The allowlisted tokens for `transcript_poll_stopped.reason`: standard JS error
|
|
25
|
-
* constructor names + common Node filesystem/stream errnos, plus the fixed
|
|
26
|
-
* `UnknownError` fallback that any unrecognized value collapses to.
|
|
27
|
-
*/
|
|
28
|
-
export declare const pollErrorReasons: readonly ["UnknownError", "Error", "TypeError", "RangeError", "ReferenceError", "SyntaxError", "EvalError", "URIError", "AggregateError", "ENOENT", "EACCES", "EPERM", "EISDIR", "ENOTDIR", "EBADF", "EMFILE", "ENFILE", "ELOOP", "ENAMETOOLONG", "EBUSY", "EAGAIN", "EIO"];
|
|
29
|
-
/** A bounded, allowlisted `transcript_poll_stopped.reason` token. */
|
|
30
|
-
export type PollErrorReason = (typeof pollErrorReasons)[number];
|
|
31
|
-
export declare function isPollErrorReason(value: unknown): value is PollErrorReason;
|
|
32
|
-
/**
|
|
33
|
-
* The allowlisted tokens for `reap_failed.errorCode`: standard JS error
|
|
34
|
-
* constructor names + the process-signalling errnos a group SIGKILL can surface,
|
|
35
|
-
* plus the fixed `UnknownError` fallback any unrecognized value collapses to. A
|
|
36
|
-
* reap failure's error `name`/`.code`/message are caller/system-controlled, so
|
|
37
|
-
* only a value on this allowlist may reach the live warning.
|
|
38
|
-
*/
|
|
39
|
-
export declare const reapErrorCodes: readonly ["UnknownError", "Error", "TypeError", "RangeError", "ReferenceError", "EPERM", "ESRCH", "EINVAL", "EACCES", "EAGAIN"];
|
|
40
|
-
/** A bounded, allowlisted `reap_failed.errorCode` token. */
|
|
41
|
-
export type ReapErrorCode = (typeof reapErrorCodes)[number];
|
|
42
|
-
export declare function isReapErrorCode(value: unknown): value is ReapErrorCode;
|
|
43
|
-
/** Why transcript data was lost, so cause is never mislabeled. */
|
|
44
|
-
export declare const dropCauses: readonly ["unparseable", "oversized", "unread_backlog"];
|
|
45
|
-
/** A bounded `transcript_records_dropped.cause` token. */
|
|
46
|
-
export type DropCause = (typeof dropCauses)[number];
|
|
47
|
-
/**
|
|
48
|
-
* The allowlisted tokens for `resize_restore_failed.errorCode`: standard JS error
|
|
49
|
-
* constructor names + the errnos a native PTY resize can surface, plus the fixed
|
|
50
|
-
* `UnknownError` fallback any unrecognized value collapses to. A resize failure's
|
|
51
|
-
* error `name`/`.code`/message are system-controlled, so only a value on this
|
|
52
|
-
* allowlist may reach the live warning (§5.7).
|
|
53
|
-
*/
|
|
54
|
-
export declare const resizeErrorCodes: readonly ["UnknownError", "Error", "TypeError", "RangeError", "ReferenceError", "EBADF", "EINVAL", "EIO", "ENXIO", "EPERM", "EACCES"];
|
|
55
|
-
/** A bounded, allowlisted `resize_restore_failed.errorCode` token. */
|
|
56
|
-
export type ResizeErrorCode = (typeof resizeErrorCodes)[number];
|
|
57
|
-
export declare function isResizeErrorCode(value: unknown): value is ResizeErrorCode;
|
|
58
|
-
/** Which lifecycle phase a transcript failure occurred in. */
|
|
59
|
-
export declare const pollPhases: readonly ["poll", "final_flush"];
|
|
60
|
-
/** A bounded `transcript_poll_stopped.phase` token. */
|
|
61
|
-
export type PollPhase = (typeof pollPhases)[number];
|
|
62
|
-
//# sourceMappingURL=warning-reasons.d.ts.map
|