@deepseek-harness-tui/dsh-tui 0.13.0 → 0.14.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/README.md +85 -5
- package/assets/claude-girl/claude-girl-happy.png +0 -0
- package/assets/claude-girl/claude-girl.png +0 -0
- package/assets/codex-girl/codex-girl-happy.png +0 -0
- package/assets/codex-girl/codex-girl.png +0 -0
- package/bin/dsh-tui.js +104 -18
- package/cordis.patch.yml +2 -0
- package/cordis.yml +2 -0
- package/guide/dsh-tui-guide/SKILL.md +4 -2
- package/guide/dsh-tui-guide/claude-backend.en.md +203 -0
- package/guide/dsh-tui-guide/claude-backend.md +161 -0
- package/guide/dsh-tui-guide/codex-backend.en.md +297 -0
- package/guide/dsh-tui-guide/codex-backend.md +257 -0
- package/guide/dsh-tui-guide/configuration.en.md +9 -2
- package/guide/dsh-tui-guide/configuration.md +9 -2
- package/guide/dsh-tui-guide/interaction.en.md +169 -27
- package/guide/dsh-tui-guide/interaction.md +115 -17
- package/guide/dsh-tui-guide/themes.en.md +24 -2
- package/guide/dsh-tui-guide/themes.md +21 -2
- package/guide/dsh-tui-guide/user-guide.en.md +38 -23
- package/guide/dsh-tui-guide/user-guide.md +22 -11
- package/guide/dsh-tui-guide/vscode.en.md +1 -0
- package/guide/dsh-tui-guide/vscode.md +1 -0
- package/lib/settings.json +139 -6
- package/lib/types/adapter/channel/state.d.ts.map +1 -1
- package/lib/types/adapter/channel/state.js +1 -0
- package/lib/types/adapter/channel/ui-policy.d.ts +17 -2
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +29 -0
- package/lib/types/adapter/channel/ui.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui.js +45 -5
- package/lib/types/adapter/ports/channel-catalog.d.ts +7 -0
- package/lib/types/adapter/ports/channel-catalog.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-display.d.ts +7 -1
- package/lib/types/adapter/ports/channel-display.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-session.d.ts +5 -0
- package/lib/types/adapter/ports/channel-session.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-settings.d.ts +20 -0
- package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-ui.d.ts +183 -6
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +477 -13
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/agent/backend.d.ts +168 -0
- package/lib/types/agent/backend.d.ts.map +1 -0
- package/lib/types/agent/backend.js +1 -0
- package/lib/types/agent/capabilities.d.ts +461 -0
- package/lib/types/agent/capabilities.d.ts.map +1 -0
- package/lib/types/agent/capabilities.js +1 -0
- package/lib/types/agent/events.d.ts +733 -0
- package/lib/types/agent/events.d.ts.map +1 -0
- package/lib/types/agent/events.js +2 -0
- package/lib/types/agent/index.d.ts +8 -0
- package/lib/types/agent/index.d.ts.map +1 -0
- package/lib/types/agent/index.js +7 -0
- package/lib/types/agent/messages.d.ts +52 -0
- package/lib/types/agent/messages.d.ts.map +1 -0
- package/lib/types/agent/messages.js +91 -0
- package/lib/types/agent/presentation.d.ts +29 -0
- package/lib/types/agent/presentation.d.ts.map +1 -0
- package/lib/types/agent/presentation.js +4 -0
- package/lib/types/agent/refs.d.ts +30 -0
- package/lib/types/agent/refs.d.ts.map +1 -0
- package/lib/types/agent/refs.js +39 -0
- package/lib/types/agent/session.d.ts +78 -0
- package/lib/types/agent/session.d.ts.map +1 -0
- package/lib/types/agent/session.js +1 -0
- package/lib/types/backends/claude/activity.d.ts +53 -0
- package/lib/types/backends/claude/activity.d.ts.map +1 -0
- package/lib/types/backends/claude/activity.js +103 -0
- package/lib/types/backends/claude/auth.d.ts +245 -0
- package/lib/types/backends/claude/auth.d.ts.map +1 -0
- package/lib/types/backends/claude/auth.js +503 -0
- package/lib/types/backends/claude/backend.d.ts +32 -0
- package/lib/types/backends/claude/backend.d.ts.map +1 -0
- package/lib/types/backends/claude/backend.js +296 -0
- package/lib/types/backends/claude/catalog.d.ts +17 -0
- package/lib/types/backends/claude/catalog.d.ts.map +1 -0
- package/lib/types/backends/claude/catalog.js +94 -0
- package/lib/types/backends/claude/channels.d.ts +63 -0
- package/lib/types/backends/claude/channels.d.ts.map +1 -0
- package/lib/types/backends/claude/channels.js +275 -0
- package/lib/types/backends/claude/contract.d.ts +37 -0
- package/lib/types/backends/claude/contract.d.ts.map +1 -0
- package/lib/types/backends/claude/contract.js +46 -0
- package/lib/types/backends/claude/controls.d.ts +134 -0
- package/lib/types/backends/claude/controls.d.ts.map +1 -0
- package/lib/types/backends/claude/controls.js +425 -0
- package/lib/types/backends/claude/dialogs.d.ts +62 -0
- package/lib/types/backends/claude/dialogs.d.ts.map +1 -0
- package/lib/types/backends/claude/dialogs.js +253 -0
- package/lib/types/backends/claude/flag-settings.d.ts +12 -0
- package/lib/types/backends/claude/flag-settings.d.ts.map +1 -0
- package/lib/types/backends/claude/flag-settings.js +49 -0
- package/lib/types/backends/claude/images.d.ts +49 -0
- package/lib/types/backends/claude/images.d.ts.map +1 -0
- package/lib/types/backends/claude/images.js +94 -0
- package/lib/types/backends/claude/index.d.ts +5 -0
- package/lib/types/backends/claude/index.d.ts.map +1 -0
- package/lib/types/backends/claude/index.js +4 -0
- package/lib/types/backends/claude/install.d.ts +15 -0
- package/lib/types/backends/claude/install.d.ts.map +1 -0
- package/lib/types/backends/claude/install.js +91 -0
- package/lib/types/backends/claude/modelEnv.d.ts +64 -0
- package/lib/types/backends/claude/modelEnv.d.ts.map +1 -0
- package/lib/types/backends/claude/modelEnv.js +199 -0
- package/lib/types/backends/claude/narrow.d.ts +10 -0
- package/lib/types/backends/claude/narrow.d.ts.map +1 -0
- package/lib/types/backends/claude/narrow.js +8 -0
- package/lib/types/backends/claude/older-history.d.ts +16 -0
- package/lib/types/backends/claude/older-history.d.ts.map +1 -0
- package/lib/types/backends/claude/older-history.js +101 -0
- package/lib/types/backends/claude/options.d.ts +181 -0
- package/lib/types/backends/claude/options.d.ts.map +1 -0
- package/lib/types/backends/claude/options.js +208 -0
- package/lib/types/backends/claude/permissions.d.ts +83 -0
- package/lib/types/backends/claude/permissions.d.ts.map +1 -0
- package/lib/types/backends/claude/permissions.js +331 -0
- package/lib/types/backends/claude/prefs.d.ts +55 -0
- package/lib/types/backends/claude/prefs.d.ts.map +1 -0
- package/lib/types/backends/claude/prefs.js +150 -0
- package/lib/types/backends/claude/process.d.ts +19 -0
- package/lib/types/backends/claude/process.d.ts.map +1 -0
- package/lib/types/backends/claude/process.js +156 -0
- package/lib/types/backends/claude/replay.d.ts +129 -0
- package/lib/types/backends/claude/replay.d.ts.map +1 -0
- package/lib/types/backends/claude/replay.js +505 -0
- package/lib/types/backends/claude/sdk-warnings.d.ts +23 -0
- package/lib/types/backends/claude/sdk-warnings.d.ts.map +1 -0
- package/lib/types/backends/claude/sdk-warnings.js +55 -0
- package/lib/types/backends/claude/sdk.d.ts +12 -0
- package/lib/types/backends/claude/sdk.d.ts.map +1 -0
- package/lib/types/backends/claude/sdk.js +34 -0
- package/lib/types/backends/claude/send-message.d.ts +54 -0
- package/lib/types/backends/claude/send-message.d.ts.map +1 -0
- package/lib/types/backends/claude/send-message.js +65 -0
- package/lib/types/backends/claude/session/auth.d.ts +47 -0
- package/lib/types/backends/claude/session/auth.d.ts.map +1 -0
- package/lib/types/backends/claude/session/auth.js +226 -0
- package/lib/types/backends/claude/session/channels.d.ts +82 -0
- package/lib/types/backends/claude/session/channels.d.ts.map +1 -0
- package/lib/types/backends/claude/session/channels.js +45 -0
- package/lib/types/backends/claude/session/input.d.ts +16 -0
- package/lib/types/backends/claude/session/input.d.ts.map +1 -0
- package/lib/types/backends/claude/session/input.js +64 -0
- package/lib/types/backends/claude/session/lifecycle.d.ts +6 -0
- package/lib/types/backends/claude/session/lifecycle.d.ts.map +1 -0
- package/lib/types/backends/claude/session/lifecycle.js +852 -0
- package/lib/types/backends/claude/session/store.d.ts +17 -0
- package/lib/types/backends/claude/session/store.d.ts.map +1 -0
- package/lib/types/backends/claude/session/store.js +122 -0
- package/lib/types/backends/claude/session/subagents.d.ts +13 -0
- package/lib/types/backends/claude/session/subagents.d.ts.map +1 -0
- package/lib/types/backends/claude/session/subagents.js +77 -0
- package/lib/types/backends/claude/session/types.d.ts +89 -0
- package/lib/types/backends/claude/session/types.d.ts.map +1 -0
- package/lib/types/backends/claude/session/types.js +1 -0
- package/lib/types/backends/claude/session.d.ts +4 -0
- package/lib/types/backends/claude/session.d.ts.map +1 -0
- package/lib/types/backends/claude/session.js +2 -0
- package/lib/types/backends/claude/side-query.d.ts +34 -0
- package/lib/types/backends/claude/side-query.d.ts.map +1 -0
- package/lib/types/backends/claude/side-query.js +116 -0
- package/lib/types/backends/claude/task-output.d.ts +13 -0
- package/lib/types/backends/claude/task-output.d.ts.map +1 -0
- package/lib/types/backends/claude/task-output.js +101 -0
- package/lib/types/backends/claude/tools.d.ts +45 -0
- package/lib/types/backends/claude/tools.d.ts.map +1 -0
- package/lib/types/backends/claude/tools.js +231 -0
- package/lib/types/backends/claude/transcript-file.d.ts +41 -0
- package/lib/types/backends/claude/transcript-file.d.ts.map +1 -0
- package/lib/types/backends/claude/transcript-file.js +195 -0
- package/lib/types/backends/claude/translate/attempts.d.ts +33 -0
- package/lib/types/backends/claude/translate/attempts.d.ts.map +1 -0
- package/lib/types/backends/claude/translate/attempts.js +243 -0
- package/lib/types/backends/claude/translate/content.d.ts +33 -0
- package/lib/types/backends/claude/translate/content.d.ts.map +1 -0
- package/lib/types/backends/claude/translate/content.js +91 -0
- package/lib/types/backends/claude/translate/core.d.ts +76 -0
- package/lib/types/backends/claude/translate/core.d.ts.map +1 -0
- package/lib/types/backends/claude/translate/core.js +447 -0
- package/lib/types/backends/claude/translate/events.d.ts +9 -0
- package/lib/types/backends/claude/translate/events.d.ts.map +1 -0
- package/lib/types/backends/claude/translate/events.js +77 -0
- package/lib/types/backends/claude/translate/lanes.d.ts +31 -0
- package/lib/types/backends/claude/translate/lanes.d.ts.map +1 -0
- package/lib/types/backends/claude/translate/lanes.js +177 -0
- package/lib/types/backends/claude/translate/messages.d.ts +36 -0
- package/lib/types/backends/claude/translate/messages.d.ts.map +1 -0
- package/lib/types/backends/claude/translate/messages.js +202 -0
- package/lib/types/backends/claude/translate/system.d.ts +40 -0
- package/lib/types/backends/claude/translate/system.d.ts.map +1 -0
- package/lib/types/backends/claude/translate/system.js +399 -0
- package/lib/types/backends/claude/translate/tasks.d.ts +19 -0
- package/lib/types/backends/claude/translate/tasks.d.ts.map +1 -0
- package/lib/types/backends/claude/translate/tasks.js +159 -0
- package/lib/types/backends/claude/translate/types.d.ts +114 -0
- package/lib/types/backends/claude/translate/types.d.ts.map +1 -0
- package/lib/types/backends/claude/translate/types.js +1 -0
- package/lib/types/backends/claude/translate.d.ts +9 -0
- package/lib/types/backends/claude/translate.d.ts.map +1 -0
- package/lib/types/backends/claude/translate.js +6 -0
- package/lib/types/backends/codex/auth/external-tokens.d.ts +66 -0
- package/lib/types/backends/codex/auth/external-tokens.d.ts.map +1 -0
- package/lib/types/backends/codex/auth/external-tokens.js +325 -0
- package/lib/types/backends/codex/auth/route.d.ts +14 -0
- package/lib/types/backends/codex/auth/route.d.ts.map +1 -0
- package/lib/types/backends/codex/auth/route.js +52 -0
- package/lib/types/backends/codex/auth/status.d.ts +16 -0
- package/lib/types/backends/codex/auth/status.d.ts.map +1 -0
- package/lib/types/backends/codex/auth/status.js +115 -0
- package/lib/types/backends/codex/backend.d.ts +58 -0
- package/lib/types/backends/codex/backend.d.ts.map +1 -0
- package/lib/types/backends/codex/backend.js +201 -0
- package/lib/types/backends/codex/catalog.d.ts +17 -0
- package/lib/types/backends/codex/catalog.d.ts.map +1 -0
- package/lib/types/backends/codex/catalog.js +128 -0
- package/lib/types/backends/codex/channels.d.ts +59 -0
- package/lib/types/backends/codex/channels.d.ts.map +1 -0
- package/lib/types/backends/codex/channels.js +274 -0
- package/lib/types/backends/codex/contract.d.ts +46 -0
- package/lib/types/backends/codex/contract.d.ts.map +1 -0
- package/lib/types/backends/codex/contract.js +80 -0
- package/lib/types/backends/codex/detect.d.ts +14 -0
- package/lib/types/backends/codex/detect.d.ts.map +1 -0
- package/lib/types/backends/codex/detect.js +90 -0
- package/lib/types/backends/codex/index.d.ts +6 -0
- package/lib/types/backends/codex/index.d.ts.map +1 -0
- package/lib/types/backends/codex/index.js +5 -0
- package/lib/types/backends/codex/modes.d.ts +16 -0
- package/lib/types/backends/codex/modes.d.ts.map +1 -0
- package/lib/types/backends/codex/modes.js +49 -0
- package/lib/types/backends/codex/narrow.d.ts +20 -0
- package/lib/types/backends/codex/narrow.d.ts.map +1 -0
- package/lib/types/backends/codex/narrow.js +18 -0
- package/lib/types/backends/codex/prefs.d.ts +42 -0
- package/lib/types/backends/codex/prefs.d.ts.map +1 -0
- package/lib/types/backends/codex/prefs.js +124 -0
- package/lib/types/backends/codex/protocol/index.d.ts +149 -0
- package/lib/types/backends/codex/protocol/index.d.ts.map +1 -0
- package/lib/types/backends/codex/protocol/index.js +130 -0
- package/lib/types/backends/codex/rpc/binary.d.ts +35 -0
- package/lib/types/backends/codex/rpc/binary.d.ts.map +1 -0
- package/lib/types/backends/codex/rpc/binary.js +174 -0
- package/lib/types/backends/codex/rpc/client.d.ts +72 -0
- package/lib/types/backends/codex/rpc/client.d.ts.map +1 -0
- package/lib/types/backends/codex/rpc/client.js +214 -0
- package/lib/types/backends/codex/rpc/hub.d.ts +105 -0
- package/lib/types/backends/codex/rpc/hub.d.ts.map +1 -0
- package/lib/types/backends/codex/rpc/hub.js +532 -0
- package/lib/types/backends/codex/rpc/transport.d.ts +39 -0
- package/lib/types/backends/codex/rpc/transport.d.ts.map +1 -0
- package/lib/types/backends/codex/rpc/transport.js +212 -0
- package/lib/types/backends/codex/session/activity.d.ts +18 -0
- package/lib/types/backends/codex/session/activity.d.ts.map +1 -0
- package/lib/types/backends/codex/session/activity.js +108 -0
- package/lib/types/backends/codex/session/approvals.d.ts +39 -0
- package/lib/types/backends/codex/session/approvals.d.ts.map +1 -0
- package/lib/types/backends/codex/session/approvals.js +477 -0
- package/lib/types/backends/codex/session/commands.d.ts +37 -0
- package/lib/types/backends/codex/session/commands.d.ts.map +1 -0
- package/lib/types/backends/codex/session/commands.js +141 -0
- package/lib/types/backends/codex/session/controls.d.ts +37 -0
- package/lib/types/backends/codex/session/controls.d.ts.map +1 -0
- package/lib/types/backends/codex/session/controls.js +303 -0
- package/lib/types/backends/codex/session/goals.d.ts +25 -0
- package/lib/types/backends/codex/session/goals.d.ts.map +1 -0
- package/lib/types/backends/codex/session/goals.js +97 -0
- package/lib/types/backends/codex/session/history.d.ts +52 -0
- package/lib/types/backends/codex/session/history.d.ts.map +1 -0
- package/lib/types/backends/codex/session/history.js +196 -0
- package/lib/types/backends/codex/session/images.d.ts +17 -0
- package/lib/types/backends/codex/session/images.d.ts.map +1 -0
- package/lib/types/backends/codex/session/images.js +138 -0
- package/lib/types/backends/codex/session/input.d.ts +75 -0
- package/lib/types/backends/codex/session/input.d.ts.map +1 -0
- package/lib/types/backends/codex/session/input.js +294 -0
- package/lib/types/backends/codex/session/plan-review.d.ts +19 -0
- package/lib/types/backends/codex/session/plan-review.d.ts.map +1 -0
- package/lib/types/backends/codex/session/plan-review.js +48 -0
- package/lib/types/backends/codex/session/prompts.d.ts +7 -0
- package/lib/types/backends/codex/session/prompts.d.ts.map +1 -0
- package/lib/types/backends/codex/session/prompts.js +47 -0
- package/lib/types/backends/codex/session/session.d.ts +12 -0
- package/lib/types/backends/codex/session/session.d.ts.map +1 -0
- package/lib/types/backends/codex/session/session.js +871 -0
- package/lib/types/backends/codex/session/side-query.d.ts +25 -0
- package/lib/types/backends/codex/session/side-query.d.ts.map +1 -0
- package/lib/types/backends/codex/session/side-query.js +121 -0
- package/lib/types/backends/codex/session/state.d.ts +57 -0
- package/lib/types/backends/codex/session/state.d.ts.map +1 -0
- package/lib/types/backends/codex/session/state.js +1 -0
- package/lib/types/backends/codex/session/subagents.d.ts +28 -0
- package/lib/types/backends/codex/session/subagents.d.ts.map +1 -0
- package/lib/types/backends/codex/session/subagents.js +286 -0
- package/lib/types/backends/codex/session/tasks.d.ts +25 -0
- package/lib/types/backends/codex/session/tasks.d.ts.map +1 -0
- package/lib/types/backends/codex/session/tasks.js +207 -0
- package/lib/types/backends/codex/session/tool-output.d.ts +9 -0
- package/lib/types/backends/codex/session/tool-output.d.ts.map +1 -0
- package/lib/types/backends/codex/session/tool-output.js +29 -0
- package/lib/types/backends/codex/translate/commands.d.ts +30 -0
- package/lib/types/backends/codex/translate/commands.d.ts.map +1 -0
- package/lib/types/backends/codex/translate/commands.js +103 -0
- package/lib/types/backends/codex/translate/events.d.ts +9 -0
- package/lib/types/backends/codex/translate/events.d.ts.map +1 -0
- package/lib/types/backends/codex/translate/events.js +71 -0
- package/lib/types/backends/codex/translate/items.d.ts +112 -0
- package/lib/types/backends/codex/translate/items.d.ts.map +1 -0
- package/lib/types/backends/codex/translate/items.js +375 -0
- package/lib/types/backends/codex/translate/live.d.ts +39 -0
- package/lib/types/backends/codex/translate/live.d.ts.map +1 -0
- package/lib/types/backends/codex/translate/live.js +315 -0
- package/lib/types/backends/codex/translate/notices.d.ts +27 -0
- package/lib/types/backends/codex/translate/notices.d.ts.map +1 -0
- package/lib/types/backends/codex/translate/notices.js +99 -0
- package/lib/types/backends/codex/translate/presentation.d.ts +49 -0
- package/lib/types/backends/codex/translate/presentation.d.ts.map +1 -0
- package/lib/types/backends/codex/translate/presentation.js +237 -0
- package/lib/types/backends/codex/translate/replay.d.ts +18 -0
- package/lib/types/backends/codex/translate/replay.d.ts.map +1 -0
- package/lib/types/backends/codex/translate/replay.js +33 -0
- package/lib/types/backends/codex/translate/usage.d.ts +29 -0
- package/lib/types/backends/codex/translate/usage.d.ts.map +1 -0
- package/lib/types/backends/codex/translate/usage.js +65 -0
- package/lib/types/backends/shared/atomic-file.d.ts +4 -0
- package/lib/types/backends/shared/atomic-file.d.ts.map +1 -0
- package/lib/types/backends/shared/atomic-file.js +52 -0
- package/lib/types/backends/shared/channel-tokens.d.ts +29 -0
- package/lib/types/backends/shared/channel-tokens.d.ts.map +1 -0
- package/lib/types/backends/shared/channel-tokens.js +161 -0
- package/lib/types/backends/shared/display-path.d.ts +3 -0
- package/lib/types/backends/shared/display-path.d.ts.map +1 -0
- package/lib/types/backends/shared/display-path.js +12 -0
- package/lib/types/branding.d.ts +92 -0
- package/lib/types/branding.d.ts.map +1 -0
- package/lib/types/branding.js +117 -0
- package/lib/types/channel/activity.d.ts +53 -0
- package/lib/types/channel/activity.d.ts.map +1 -0
- package/lib/types/channel/activity.js +955 -0
- package/lib/types/channel/capabilities.d.ts +24 -0
- package/lib/types/channel/capabilities.d.ts.map +1 -0
- package/lib/types/channel/capabilities.js +57 -0
- package/lib/types/channel/channel-slug.d.ts +9 -0
- package/lib/types/channel/channel-slug.d.ts.map +1 -0
- package/lib/types/channel/channel-slug.js +15 -0
- package/lib/types/channel/channel-wizard.d.ts +30 -0
- package/lib/types/channel/channel-wizard.d.ts.map +1 -0
- package/lib/types/channel/channel-wizard.js +226 -0
- package/lib/types/channel/elicitation.d.ts +135 -0
- package/lib/types/channel/elicitation.d.ts.map +1 -0
- package/lib/types/channel/elicitation.js +360 -0
- package/lib/types/channel/goal-command.d.ts +49 -0
- package/lib/types/channel/goal-command.d.ts.map +1 -0
- package/lib/types/channel/goal-command.js +72 -0
- package/lib/types/channel/history-restore.d.ts +16 -0
- package/lib/types/channel/history-restore.d.ts.map +1 -0
- package/lib/types/channel/history-restore.js +214 -0
- package/lib/types/channel/interaction.d.ts +38 -0
- package/lib/types/channel/interaction.d.ts.map +1 -0
- package/lib/types/channel/interaction.js +110 -0
- package/lib/types/channel/job-format.d.ts +6 -0
- package/lib/types/channel/job-format.d.ts.map +1 -0
- package/lib/types/channel/job-format.js +12 -0
- package/lib/types/channel/live-output.d.ts +35 -0
- package/lib/types/channel/live-output.d.ts.map +1 -0
- package/lib/types/channel/live-output.js +74 -0
- package/lib/types/channel/model-capabilities.d.ts +10 -0
- package/lib/types/channel/model-capabilities.d.ts.map +1 -0
- package/lib/types/channel/model-capabilities.js +51 -0
- package/lib/types/channel/permissions.d.ts +155 -0
- package/lib/types/channel/permissions.d.ts.map +1 -0
- package/lib/types/channel/permissions.js +188 -0
- package/lib/types/channel/projection.d.ts +110 -0
- package/lib/types/channel/projection.d.ts.map +1 -0
- package/lib/types/channel/projection.js +1521 -0
- package/lib/types/channel/question-record.d.ts +76 -0
- package/lib/types/channel/question-record.d.ts.map +1 -0
- package/lib/types/channel/question-record.js +109 -0
- package/lib/types/channel/questions.d.ts +204 -0
- package/lib/types/channel/questions.d.ts.map +1 -0
- package/lib/types/channel/questions.js +286 -0
- package/lib/types/channel/sanitize.d.ts +49 -0
- package/lib/types/channel/sanitize.d.ts.map +1 -0
- package/lib/types/channel/sanitize.js +88 -0
- package/lib/types/channel/selection-record.d.ts +18 -0
- package/lib/types/channel/selection-record.d.ts.map +1 -0
- package/lib/types/channel/selection-record.js +45 -0
- package/lib/types/channel/side-prompts.d.ts +59 -0
- package/lib/types/channel/side-prompts.d.ts.map +1 -0
- package/lib/types/channel/side-prompts.js +127 -0
- package/lib/types/channel/transcript.d.ts +17 -0
- package/lib/types/channel/transcript.d.ts.map +1 -0
- package/lib/types/channel/transcript.js +19 -0
- package/lib/types/channel/usage.d.ts +48 -0
- package/lib/types/channel/usage.d.ts.map +1 -0
- package/lib/types/channel/usage.js +143 -0
- package/lib/types/commands.d.ts +147 -0
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +196 -2
- package/lib/types/components/AgentMessageComposer.d.ts +50 -0
- package/lib/types/components/AgentMessageComposer.d.ts.map +1 -0
- package/lib/types/components/AgentMessageComposer.js +159 -0
- package/lib/types/components/BtwPanel.d.ts +13 -12
- package/lib/types/components/BtwPanel.d.ts.map +1 -1
- package/lib/types/components/BtwPanel.js +35 -24
- package/lib/types/components/ChannelPicker.d.ts +40 -0
- package/lib/types/components/ChannelPicker.d.ts.map +1 -0
- package/lib/types/components/ChannelPicker.js +26 -0
- package/lib/types/components/Chat/JobCard.d.ts +29 -31
- package/lib/types/components/Chat/JobCard.d.ts.map +1 -1
- package/lib/types/components/Chat/JobCard.js +31 -112
- package/lib/types/components/Chat/SubagentMessage.d.ts +4 -1
- package/lib/types/components/Chat/SubagentMessage.d.ts.map +1 -1
- package/lib/types/components/Chat/SubagentMessage.js +10 -3
- package/lib/types/components/ClaudeGirl.d.ts +27 -0
- package/lib/types/components/ClaudeGirl.d.ts.map +1 -0
- package/lib/types/components/ClaudeGirl.js +30 -0
- package/lib/types/components/CodeBlockFrame.d.ts +19 -0
- package/lib/types/components/CodeBlockFrame.d.ts.map +1 -0
- package/lib/types/components/CodeBlockFrame.js +138 -0
- package/lib/types/components/CommandSuggestions.d.ts +10 -1
- package/lib/types/components/CommandSuggestions.d.ts.map +1 -1
- package/lib/types/components/CommandSuggestions.js +20 -3
- package/lib/types/components/ContextBarView.d.ts +2 -2
- package/lib/types/components/ContextBarView.d.ts.map +1 -1
- package/lib/types/components/ContextBarView.js +18 -8
- package/lib/types/components/EffortChargeGlyph.d.ts +1 -1
- package/lib/types/components/EffortChargeGlyph.d.ts.map +1 -1
- package/lib/types/components/EffortChargeGlyph.js +3 -4
- package/lib/types/components/EffortInputBorder.d.ts +1 -2
- package/lib/types/components/EffortInputBorder.d.ts.map +1 -1
- package/lib/types/components/EffortInputBorder.js +7 -4
- package/lib/types/components/EffortSlider.d.ts +5 -1
- package/lib/types/components/EffortSlider.d.ts.map +1 -1
- package/lib/types/components/EffortSlider.js +2 -2
- package/lib/types/components/EffortTierBadge.d.ts +1 -2
- package/lib/types/components/EffortTierBadge.d.ts.map +1 -1
- package/lib/types/components/EffortTierBadge.js +8 -5
- package/lib/types/components/GoalTodoPanel.d.ts +2 -1
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/GoalTodoPanel.js +11 -5
- package/lib/types/components/InlineMathParagraph.js +1 -1
- package/lib/types/components/JobsPanel.d.ts +8 -9
- package/lib/types/components/JobsPanel.d.ts.map +1 -1
- package/lib/types/components/JobsPanel.js +72 -13
- package/lib/types/components/KernelPicker.d.ts +28 -0
- package/lib/types/components/KernelPicker.d.ts.map +1 -0
- package/lib/types/components/KernelPicker.js +37 -0
- package/lib/types/components/LogoV2.d.ts +7 -1
- package/lib/types/components/LogoV2.d.ts.map +1 -1
- package/lib/types/components/LogoV2.js +120 -24
- package/lib/types/components/Markdown.d.ts +2 -1
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Markdown.js +37 -8
- package/lib/types/components/MathBlock.d.ts.map +1 -1
- package/lib/types/components/MathBlock.js +3 -1
- package/lib/types/components/MermaidDiagram.d.ts.map +1 -1
- package/lib/types/components/MermaidDiagram.js +7 -5
- package/lib/types/components/MessageList.d.ts +21 -3
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +62 -42
- package/lib/types/components/ModePicker.d.ts +20 -0
- package/lib/types/components/ModePicker.d.ts.map +1 -0
- package/lib/types/components/ModePicker.js +17 -0
- package/lib/types/components/PromptInput.d.ts +2 -2
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +308 -55
- package/lib/types/components/SdkInstallWizard.d.ts +44 -0
- package/lib/types/components/SdkInstallWizard.d.ts.map +1 -0
- package/lib/types/components/SdkInstallWizard.js +18 -0
- package/lib/types/components/SearchBox.d.ts +7 -8
- package/lib/types/components/SearchBox.d.ts.map +1 -1
- package/lib/types/components/SearchBox.js +18 -9
- package/lib/types/components/SplitDiffView.d.ts.map +1 -1
- package/lib/types/components/SplitDiffView.js +113 -6
- package/lib/types/components/StarPrompt.d.ts.map +1 -1
- package/lib/types/components/StarPrompt.js +5 -3
- package/lib/types/components/StreamingMarkdown.d.ts.map +1 -1
- package/lib/types/components/StreamingMarkdown.js +6 -4
- package/lib/types/components/SubagentCard.d.ts +2 -1
- package/lib/types/components/SubagentCard.d.ts.map +1 -1
- package/lib/types/components/SubagentCard.js +25 -18
- package/lib/types/components/SubagentDashboard.d.ts +10 -6
- package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
- package/lib/types/components/SubagentDashboard.js +32 -21
- package/lib/types/components/SubagentDetailScene.d.ts +16 -1
- package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
- package/lib/types/components/SubagentDetailScene.js +196 -45
- package/lib/types/components/SyntaxText.d.ts.map +1 -1
- package/lib/types/components/SyntaxText.js +4 -1
- package/lib/types/components/TurnInterruptedRow.d.ts +3 -1
- package/lib/types/components/TurnInterruptedRow.d.ts.map +1 -1
- package/lib/types/components/TurnInterruptedRow.js +6 -3
- package/lib/types/components/TurnUsageRow.d.ts +24 -0
- package/lib/types/components/TurnUsageRow.d.ts.map +1 -0
- package/lib/types/components/TurnUsageRow.js +46 -0
- package/lib/types/components/WorkingSpinner.d.ts +2 -1
- package/lib/types/components/WorkingSpinner.d.ts.map +1 -1
- package/lib/types/components/WorkingSpinner.js +21 -4
- package/lib/types/components/approvals/ApprovalPanel.d.ts +36 -13
- package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -1
- package/lib/types/components/approvals/ApprovalPanel.js +173 -25
- package/lib/types/components/claudeGirlSprite.d.ts +18 -0
- package/lib/types/components/claudeGirlSprite.d.ts.map +1 -0
- package/lib/types/components/claudeGirlSprite.js +48 -0
- package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -1
- package/lib/types/components/design-system/ThemeProvider.js +46 -13
- package/lib/types/components/design-system/ThemedText.d.ts +3 -1
- package/lib/types/components/design-system/ThemedText.d.ts.map +1 -1
- package/lib/types/components/design-system/ThemedText.js +2 -2
- package/lib/types/components/diffPatch.d.ts +55 -0
- package/lib/types/components/diffPatch.d.ts.map +1 -0
- package/lib/types/components/diffPatch.js +142 -0
- package/lib/types/components/kernelCatalog.d.ts +48 -0
- package/lib/types/components/kernelCatalog.d.ts.map +1 -0
- package/lib/types/components/kernelCatalog.js +53 -0
- package/lib/types/components/launchpadActions.d.ts +13 -6
- package/lib/types/components/launchpadActions.d.ts.map +1 -1
- package/lib/types/components/launchpadActions.js +26 -4
- package/lib/types/components/launchpadParams.d.ts +101 -0
- package/lib/types/components/launchpadParams.d.ts.map +1 -0
- package/lib/types/components/launchpadParams.js +171 -0
- package/lib/types/components/maidPortrait.d.ts +37 -5
- package/lib/types/components/maidPortrait.d.ts.map +1 -1
- package/lib/types/components/maidPortrait.js +73 -54
- package/lib/types/components/messages/AgentMessageFlow.d.ts +20 -0
- package/lib/types/components/messages/AgentMessageFlow.d.ts.map +1 -0
- package/lib/types/components/messages/AgentMessageFlow.js +37 -0
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts +6 -1
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantThinkingMessage.js +29 -5
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +11 -2
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +289 -36
- package/lib/types/components/messages/TranscriptLeaves.d.ts +85 -0
- package/lib/types/components/messages/TranscriptLeaves.d.ts.map +1 -0
- package/lib/types/components/messages/TranscriptLeaves.js +74 -0
- package/lib/types/components/messages/agentTeam.d.ts +69 -0
- package/lib/types/components/messages/agentTeam.d.ts.map +1 -0
- package/lib/types/components/messages/agentTeam.js +53 -0
- package/lib/types/components/messages/liveOutputLines.d.ts +33 -0
- package/lib/types/components/messages/liveOutputLines.d.ts.map +1 -0
- package/lib/types/components/messages/liveOutputLines.js +100 -0
- package/lib/types/components/messages/subagentTranscript.d.ts +146 -0
- package/lib/types/components/messages/subagentTranscript.d.ts.map +1 -0
- package/lib/types/components/messages/subagentTranscript.js +304 -0
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts +16 -1
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +76 -6
- package/lib/types/components/questions/PlanReviewPanel.d.ts +8 -3
- package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
- package/lib/types/components/questions/PlanReviewPanel.js +11 -6
- package/lib/types/components/questions/ProviderModelEditor.d.ts +12 -0
- package/lib/types/components/questions/ProviderModelEditor.d.ts.map +1 -0
- package/lib/types/components/questions/ProviderModelEditor.js +266 -0
- package/lib/types/components/shimmer.d.ts +26 -0
- package/lib/types/components/shimmer.d.ts.map +1 -1
- package/lib/types/components/shimmer.js +26 -0
- package/lib/types/components/sidePanel/InfoPanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/InfoPanel.js +13 -8
- package/lib/types/components/sidePanel/PanelBar.d.ts +0 -24
- package/lib/types/components/sidePanel/PanelBar.d.ts.map +1 -1
- package/lib/types/components/sidePanel/PanelBar.js +55 -77
- package/lib/types/components/sidePanel/PanelStore.d.ts +3 -1
- package/lib/types/components/sidePanel/PanelStore.d.ts.map +1 -1
- package/lib/types/components/sidePanel/PanelStore.js +8 -4
- package/lib/types/components/sidePanel/SidePanelColumn.d.ts +3 -10
- package/lib/types/components/sidePanel/SidePanelColumn.d.ts.map +1 -1
- package/lib/types/components/sidePanel/SidePanelColumn.js +9 -12
- package/lib/types/components/sidePanel/TrajectoryPanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/TrajectoryPanel.js +78 -14
- package/lib/types/components/sidePanel/agentViewStore.d.ts +20 -0
- package/lib/types/components/sidePanel/agentViewStore.d.ts.map +1 -0
- package/lib/types/components/sidePanel/agentViewStore.js +26 -0
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +50 -0
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -0
- package/lib/types/components/sidePanel/btw/BtwComposer.js +45 -0
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts +13 -0
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -0
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +147 -0
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts +14 -0
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -0
- package/lib/types/components/sidePanel/btw/BtwThreadScene.js +131 -0
- package/lib/types/components/sidePanel/btw/BtwThreadView.d.ts +30 -0
- package/lib/types/components/sidePanel/btw/BtwThreadView.d.ts.map +1 -0
- package/lib/types/components/sidePanel/btw/BtwThreadView.js +87 -0
- package/lib/types/components/sidePanel/btw/threads.d.ts +111 -0
- package/lib/types/components/sidePanel/btw/threads.d.ts.map +1 -0
- package/lib/types/components/sidePanel/btw/threads.js +302 -0
- package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
- package/lib/types/components/sidePanel/builtinPanels.js +70 -30
- package/lib/types/components/sidePanel/companion/CompanionPanel.d.ts +4 -46
- package/lib/types/components/sidePanel/companion/CompanionPanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/companion/CompanionPanel.js +19 -55
- package/lib/types/components/sidePanel/companion/mood.d.ts +32 -0
- package/lib/types/components/sidePanel/companion/mood.d.ts.map +1 -1
- package/lib/types/components/sidePanel/companion/mood.js +44 -0
- package/lib/types/components/sidePanel/companion/skins.d.ts +34 -0
- package/lib/types/components/sidePanel/companion/skins.d.ts.map +1 -1
- package/lib/types/components/sidePanel/companion/skins.js +203 -29
- package/lib/types/components/splashFonts.d.ts +17 -9
- package/lib/types/components/splashFonts.d.ts.map +1 -1
- package/lib/types/components/splashFonts.js +119 -15
- package/lib/types/components/splashLayout.d.ts.map +1 -1
- package/lib/types/components/splashLayout.js +3 -1
- package/lib/types/components/subagentDetailMemory.d.ts +17 -0
- package/lib/types/components/subagentDetailMemory.d.ts.map +1 -0
- package/lib/types/components/subagentDetailMemory.js +28 -0
- package/lib/types/components/trajectory/Inspector.d.ts.map +1 -1
- package/lib/types/components/trajectory/Inspector.js +9 -0
- package/lib/types/components/trajectory/Ledger.d.ts.map +1 -1
- package/lib/types/components/trajectory/Ledger.js +7 -1
- package/lib/types/components/trajectory/scope.d.ts +64 -0
- package/lib/types/components/trajectory/scope.d.ts.map +1 -0
- package/lib/types/components/trajectory/scope.js +88 -0
- package/lib/types/components/trajectory/useTrajectoryScope.d.ts +42 -0
- package/lib/types/components/trajectory/useTrajectoryScope.d.ts.map +1 -0
- package/lib/types/components/trajectory/useTrajectoryScope.js +86 -0
- package/lib/types/customTheme.d.ts +4 -6
- package/lib/types/customTheme.d.ts.map +1 -1
- package/lib/types/customTheme.js +6 -8
- package/lib/types/dsh-adapter/approvals.d.ts +18 -5
- package/lib/types/dsh-adapter/approvals.d.ts.map +1 -1
- package/lib/types/dsh-adapter/approvals.js +17 -4
- package/lib/types/dsh-adapter/backend/session.d.ts +64 -0
- package/lib/types/dsh-adapter/backend/session.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backend/session.js +291 -0
- package/lib/types/dsh-adapter/backend/translate.d.ts +58 -0
- package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backend/translate.js +467 -0
- package/lib/types/dsh-adapter/backends.d.ts +49 -0
- package/lib/types/dsh-adapter/backends.d.ts.map +1 -0
- package/lib/types/dsh-adapter/backends.js +124 -0
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts +16 -0
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/action-readiness.js +109 -0
- package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts +2 -2
- package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/background-action.d.ts +2 -2
- package/lib/types/dsh-adapter/channel/background-action.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/background-action.js +7 -5
- package/lib/types/dsh-adapter/channel/binding-events.d.ts +19 -9
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +58 -135
- package/lib/types/dsh-adapter/channel/binding.d.ts +61 -14
- package/lib/types/dsh-adapter/channel/binding.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding.js +102 -35
- package/lib/types/dsh-adapter/channel/command-completions.d.ts +3 -0
- package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/command-completions.js +33 -4
- package/lib/types/dsh-adapter/channel/compaction.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/compaction.js +3 -2
- package/lib/types/dsh-adapter/channel/composer-images.d.ts +5 -0
- package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-images.js +4 -3
- package/lib/types/dsh-adapter/channel/core/actions.d.ts +39 -0
- package/lib/types/dsh-adapter/channel/core/actions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/actions.js +152 -0
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +145 -0
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/binding-feed.js +289 -0
- package/lib/types/dsh-adapter/channel/core/compose.d.ts +217 -0
- package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/compose.js +938 -0
- package/lib/types/dsh-adapter/channel/core/files.d.ts +57 -0
- package/lib/types/dsh-adapter/channel/core/files.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/files.js +45 -0
- package/lib/types/dsh-adapter/channel/core/host.d.ts +55 -0
- package/lib/types/dsh-adapter/channel/core/host.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/host.js +116 -0
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts +46 -0
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/local-actions.js +117 -0
- package/lib/types/dsh-adapter/channel/core/local-images.d.ts +20 -0
- package/lib/types/dsh-adapter/channel/core/local-images.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/local-images.js +147 -0
- package/lib/types/dsh-adapter/channel/core/reports.d.ts +12 -0
- package/lib/types/dsh-adapter/channel/core/reports.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/reports.js +77 -0
- package/lib/types/dsh-adapter/channel/core/session-controls.d.ts +39 -0
- package/lib/types/dsh-adapter/channel/core/session-controls.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/session-controls.js +219 -0
- package/lib/types/dsh-adapter/channel/core/session-switch.d.ts +174 -0
- package/lib/types/dsh-adapter/channel/core/session-switch.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/session-switch.js +390 -0
- package/lib/types/dsh-adapter/channel/core/sessions.d.ts +40 -0
- package/lib/types/dsh-adapter/channel/core/sessions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/core/sessions.js +268 -0
- package/lib/types/dsh-adapter/channel/decisions.d.ts +4 -3
- package/lib/types/dsh-adapter/channel/decisions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/decisions.js +4 -4
- package/lib/types/dsh-adapter/channel/emitter.d.ts +15 -2
- package/lib/types/dsh-adapter/channel/emitter.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/emitter.js +5 -3
- package/lib/types/dsh-adapter/channel/extensions.d.ts +36 -0
- package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/extensions.js +714 -0
- package/lib/types/dsh-adapter/channel/ide-selection.d.ts +1 -10
- package/lib/types/dsh-adapter/channel/ide-selection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/ide-selection.js +4 -46
- package/lib/types/dsh-adapter/channel/input-actions.d.ts +27 -4
- package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-actions.js +240 -21
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts +21 -5
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-delivery.js +65 -27
- package/lib/types/dsh-adapter/channel/local-actions.d.ts +10 -32
- package/lib/types/dsh-adapter/channel/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/local-actions.js +10 -78
- package/lib/types/dsh-adapter/channel/local-fs.d.ts +3 -0
- package/lib/types/dsh-adapter/channel/local-fs.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/local-fs.js +46 -0
- package/lib/types/dsh-adapter/channel/mode-actions.d.ts +3 -3
- package/lib/types/dsh-adapter/channel/mode-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts +2 -2
- package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.d.ts +3 -3
- package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.js +38 -5
- package/lib/types/dsh-adapter/channel/model-switch.d.ts +2 -2
- package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-switch.js +9 -6
- package/lib/types/dsh-adapter/channel/preferences.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/preferences.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/preferences.js +16 -0
- package/lib/types/dsh-adapter/channel/projection.d.ts +16 -13
- package/lib/types/dsh-adapter/channel/projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/projection.js +38 -1143
- package/lib/types/dsh-adapter/channel/question-record.d.ts +3 -75
- package/lib/types/dsh-adapter/channel/question-record.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/question-record.js +3 -107
- package/lib/types/dsh-adapter/channel/session-activity.d.ts +9 -0
- package/lib/types/dsh-adapter/channel/session-activity.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/session-activity.js +42 -0
- package/lib/types/dsh-adapter/channel/session-adoption.d.ts +4 -4
- package/lib/types/dsh-adapter/channel/session-adoption.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-adoption.js +3 -1
- package/lib/types/dsh-adapter/channel/session-fork.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-fork.js +2 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +7 -3
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.js +1 -1
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts +2 -9
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-reset.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-reset.js +4 -0
- package/lib/types/dsh-adapter/channel/session-resume.d.ts +5 -10
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +74 -113
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts +4 -4
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-rewind.js +7 -6
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts +4 -4
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.js +8 -7
- package/lib/types/dsh-adapter/channel/settings-host.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +8 -0
- package/lib/types/dsh-adapter/channel/skill-catalog.d.ts +5 -1
- package/lib/types/dsh-adapter/channel/skill-catalog.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/skill-catalog.js +2 -2
- package/lib/types/dsh-adapter/channel/state.d.ts +72 -1
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/state.js +7 -3
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts +58 -3
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.js +153 -9
- package/lib/types/dsh-adapter/channel/subagent-transcript.d.ts +114 -0
- package/lib/types/dsh-adapter/channel/subagent-transcript.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/subagent-transcript.js +279 -0
- package/lib/types/dsh-adapter/channel/transcript.d.ts +7 -15
- package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/transcript.js +17 -21
- package/lib/types/dsh-adapter/channel/types.d.ts +16 -7
- package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/usage.d.ts +3 -23
- package/lib/types/dsh-adapter/channel/usage.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/usage.js +5 -111
- package/lib/types/dsh-adapter/channel/workspace-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/workspace-actions.js +2 -1
- package/lib/types/dsh-adapter/channel.d.ts +17 -8
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +24 -1059
- package/lib/types/dsh-adapter/context-occupancy.d.ts +6 -1
- package/lib/types/dsh-adapter/context-occupancy.d.ts.map +1 -1
- package/lib/types/dsh-adapter/context-occupancy.js +6 -1
- package/lib/types/dsh-adapter/decision-guard.d.ts +24 -0
- package/lib/types/dsh-adapter/decision-guard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/decision-guard.js +44 -0
- package/lib/types/dsh-adapter/extension-events.d.ts +4 -1
- package/lib/types/dsh-adapter/extension-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/extension-events.js +22 -10
- package/lib/types/dsh-adapter/index.d.ts +41 -3
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +28 -1
- package/lib/types/dsh-adapter/jobs.d.ts +5 -3
- package/lib/types/dsh-adapter/jobs.d.ts.map +1 -1
- package/lib/types/dsh-adapter/jobs.js +53 -14
- package/lib/types/dsh-adapter/migrate/parse/jsonl.d.ts +1 -16
- package/lib/types/dsh-adapter/migrate/parse/jsonl.d.ts.map +1 -1
- package/lib/types/dsh-adapter/migrate/parse/jsonl.js +3 -29
- package/lib/types/dsh-adapter/oauth-credential-source.d.ts +34 -0
- package/lib/types/dsh-adapter/oauth-credential-source.d.ts.map +1 -0
- package/lib/types/dsh-adapter/oauth-credential-source.js +66 -0
- package/lib/types/dsh-adapter/plugin.d.ts +38 -2
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +546 -110
- package/lib/types/dsh-adapter/provider-model-capabilities.d.ts +10 -0
- package/lib/types/dsh-adapter/provider-model-capabilities.d.ts.map +1 -0
- package/lib/types/dsh-adapter/provider-model-capabilities.js +80 -0
- package/lib/types/dsh-adapter/providerWizard.d.ts +8 -2
- package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/providerWizard.js +118 -52
- package/lib/types/dsh-adapter/questions.d.ts +29 -124
- package/lib/types/dsh-adapter/questions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/questions.js +33 -267
- package/lib/types/dsh-adapter/recap.d.ts +3 -15
- package/lib/types/dsh-adapter/recap.d.ts.map +1 -1
- package/lib/types/dsh-adapter/recap.js +3 -46
- package/lib/types/dsh-adapter/sanitize.d.ts +4 -44
- package/lib/types/dsh-adapter/sanitize.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sanitize.js +4 -84
- package/lib/types/dsh-adapter/session-mount-heartbeat.d.ts +3 -1
- package/lib/types/dsh-adapter/session-mount-heartbeat.d.ts.map +1 -1
- package/lib/types/dsh-adapter/session-mount-heartbeat.js +4 -2
- package/lib/types/dsh-adapter/sessions/digest.d.ts +18 -3
- package/lib/types/dsh-adapter/sessions/digest.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/digest.js +60 -27
- package/lib/types/dsh-adapter/sessions/list.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/list.js +6 -4
- package/lib/types/dsh-adapter/sessions/recovery.d.ts +2 -2
- package/lib/types/dsh-adapter/sessions/recovery.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/recovery.js +23 -14
- package/lib/types/dsh-adapter/sessions/store.d.ts +2 -0
- package/lib/types/dsh-adapter/sessions/store.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/store.js +1 -0
- package/lib/types/dsh-adapter/sessions/types.d.ts +2 -0
- package/lib/types/dsh-adapter/sessions/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sideQuestion.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sideQuestion.js +3 -13
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +7 -0
- package/lib/types/dsh-adapter/themes.d.ts +1 -1
- package/lib/types/dsh-adapter/themes.d.ts.map +1 -1
- package/lib/types/dsh-adapter/trajectory/agent-source.d.ts +84 -0
- package/lib/types/dsh-adapter/trajectory/agent-source.d.ts.map +1 -0
- package/lib/types/dsh-adapter/trajectory/agent-source.js +601 -0
- package/lib/types/dsh-adapter/trajectory/guards.d.ts +31 -1
- package/lib/types/dsh-adapter/trajectory/guards.d.ts.map +1 -1
- package/lib/types/dsh-adapter/trajectory/guards.js +28 -0
- package/lib/types/dsh-adapter/trajectory/index.d.ts +3 -1
- package/lib/types/dsh-adapter/trajectory/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/trajectory/index.js +1 -0
- package/lib/types/dsh-adapter/trajectory/inspect.d.ts +7 -0
- package/lib/types/dsh-adapter/trajectory/inspect.d.ts.map +1 -1
- package/lib/types/dsh-adapter/trajectory/inspect.js +70 -2
- package/lib/types/dsh-adapter/trajectory/projection.d.ts +4 -0
- package/lib/types/dsh-adapter/trajectory/projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/trajectory/projection.js +36 -0
- package/lib/types/dsh-adapter/trajectory/types.d.ts +13 -0
- package/lib/types/dsh-adapter/trajectory/types.d.ts.map +1 -1
- package/lib/types/effortPrefs.d.ts +7 -0
- package/lib/types/effortPrefs.d.ts.map +1 -1
- package/lib/types/effortPrefs.js +11 -2
- package/lib/types/handoffAck.d.ts +57 -0
- package/lib/types/handoffAck.d.ts.map +1 -0
- package/lib/types/handoffAck.js +154 -0
- package/lib/types/handoffEvents.d.ts +52 -0
- package/lib/types/handoffEvents.d.ts.map +1 -0
- package/lib/types/handoffEvents.js +128 -0
- package/lib/types/i18n.d.ts +3189 -68
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +855 -9
- package/lib/types/ink/colorize.d.ts.map +1 -1
- package/lib/types/ink/colorize.js +8 -2
- package/lib/types/ink/components/AlternateScreen.d.ts +12 -1
- package/lib/types/ink/components/AlternateScreen.d.ts.map +1 -1
- package/lib/types/ink/components/AlternateScreen.js +25 -4
- package/lib/types/ink/components/App.d.ts +5 -1
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +52 -5
- package/lib/types/ink/components/Image.d.ts +8 -1
- package/lib/types/ink/components/Image.d.ts.map +1 -1
- package/lib/types/ink/components/Image.js +2 -2
- package/lib/types/ink/components/Text.d.ts +8 -1
- package/lib/types/ink/components/Text.d.ts.map +1 -1
- package/lib/types/ink/components/Text.js +11 -1
- package/lib/types/ink/dom.d.ts.map +1 -1
- package/lib/types/ink/dom.js +75 -3
- package/lib/types/ink/hooks/use-input.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-input.js +9 -4
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +8 -2
- package/lib/types/ink/kitty-graphics.d.ts +7 -2
- package/lib/types/ink/kitty-graphics.d.ts.map +1 -1
- package/lib/types/ink/kitty-graphics.js +15 -7
- package/lib/types/ink/node-cache.d.ts +15 -1
- package/lib/types/ink/node-cache.d.ts.map +1 -1
- package/lib/types/ink/node-cache.js +4 -1
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +2 -0
- package/lib/types/ink/parse-keypress.d.ts +13 -0
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +438 -19
- package/lib/types/ink/reconciler.d.ts.map +1 -1
- package/lib/types/ink/reconciler.js +9 -0
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +200 -4
- package/lib/types/ink/render-stats.d.ts +35 -0
- package/lib/types/ink/render-stats.d.ts.map +1 -0
- package/lib/types/ink/render-stats.js +53 -0
- package/lib/types/ink/sixel-codec.d.ts +11 -1
- package/lib/types/ink/sixel-codec.d.ts.map +1 -1
- package/lib/types/ink/sixel-codec.js +10 -3
- package/lib/types/ink/sixel-graphics.js +2 -2
- package/lib/types/ink/styles.d.ts +46 -0
- package/lib/types/ink/styles.d.ts.map +1 -1
- package/lib/types/ink/terminal-image.d.ts +7 -0
- package/lib/types/ink/terminal-image.d.ts.map +1 -1
- package/lib/types/ink/terminal-querier.d.ts +1 -1
- package/lib/types/ink/terminal-querier.js +4 -4
- package/lib/types/ink/text-decoration.d.ts +49 -0
- package/lib/types/ink/text-decoration.d.ts.map +1 -0
- package/lib/types/ink/text-decoration.js +235 -0
- package/lib/types/ink/update-overflow-guard.d.ts +9 -0
- package/lib/types/ink/update-overflow-guard.d.ts.map +1 -1
- package/lib/types/ink/update-overflow-guard.js +41 -0
- package/lib/types/ink/wrap-text.d.ts.map +1 -1
- package/lib/types/ink/wrap-text.js +5 -1
- package/lib/types/kernelPrefs.d.ts +51 -0
- package/lib/types/kernelPrefs.d.ts.map +1 -0
- package/lib/types/kernelPrefs.js +126 -0
- package/lib/types/modelRecents.d.ts +10 -2
- package/lib/types/modelRecents.d.ts.map +1 -1
- package/lib/types/modelRecents.js +20 -7
- package/lib/types/screens/AgentTranscriptScene.d.ts +42 -0
- package/lib/types/screens/AgentTranscriptScene.d.ts.map +1 -0
- package/lib/types/screens/AgentTranscriptScene.js +269 -0
- package/lib/types/screens/Chat.d.ts +45 -7
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +625 -113
- package/lib/types/screens/Launchpad.d.ts +24 -7
- package/lib/types/screens/Launchpad.d.ts.map +1 -1
- package/lib/types/screens/Launchpad.js +147 -28
- package/lib/types/screens/SessionSupervisor.d.ts +3 -3
- package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/SessionSupervisor.js +69 -5
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/Settings.js +211 -7
- package/lib/types/screens/StatusLine.d.ts +40 -1
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +131 -19
- package/lib/types/screens/StatusMetrics.d.ts +53 -17
- package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
- package/lib/types/screens/StatusMetrics.js +141 -30
- package/lib/types/screens/TrajectoryScene.d.ts.map +1 -1
- package/lib/types/screens/TrajectoryScene.js +74 -12
- package/lib/types/screens/chat/backendCommands.d.ts +37 -0
- package/lib/types/screens/chat/backendCommands.d.ts.map +1 -0
- package/lib/types/screens/chat/backendCommands.js +51 -0
- package/lib/types/screens/chat/useBackendChannels.d.ts +20 -0
- package/lib/types/screens/chat/useBackendChannels.d.ts.map +1 -0
- package/lib/types/screens/chat/useBackendChannels.js +117 -0
- package/lib/types/screens/chat/useKernelPicker.d.ts +23 -0
- package/lib/types/screens/chat/useKernelPicker.d.ts.map +1 -0
- package/lib/types/screens/chat/useKernelPicker.js +72 -0
- package/lib/types/screens/chatOverlay.d.ts +32 -2
- package/lib/types/screens/chatOverlay.d.ts.map +1 -1
- package/lib/types/screens/chatOverlay.js +9 -0
- package/lib/types/screens/sessionSupervisor/useForeignSessions.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/useForeignSessions.js +5 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +14 -0
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +97 -22
- package/lib/types/sessionHistory.d.ts +18 -1
- package/lib/types/sessionHistory.d.ts.map +1 -1
- package/lib/types/sessionHistory.js +46 -4
- package/lib/types/sessionPins.d.ts +7 -0
- package/lib/types/sessionPins.d.ts.map +1 -1
- package/lib/types/sessionPins.js +9 -0
- package/lib/types/sessions/resumeFailure.d.ts.map +1 -1
- package/lib/types/sessions/resumeFailure.js +2 -1
- package/lib/types/settings/definitions.d.ts +74 -0
- package/lib/types/settings/definitions.d.ts.map +1 -1
- package/lib/types/settings/definitions.js +50 -4
- package/lib/types/terminal-utils/hyperlink.d.ts +2 -2
- package/lib/types/terminal-utils/hyperlink.d.ts.map +1 -1
- package/lib/types/terminal-utils/hyperlink.js +21 -4
- package/lib/types/terminal-utils/markdown.d.ts +34 -6
- package/lib/types/terminal-utils/markdown.d.ts.map +1 -1
- package/lib/types/terminal-utils/markdown.js +257 -66
- package/lib/types/theme.d.ts +49 -8
- package/lib/types/theme.d.ts.map +1 -1
- package/lib/types/theme.js +514 -18
- package/lib/types/tips.js +2 -2
- package/lib/types/trajectory/effortIgnition.d.ts +25 -7
- package/lib/types/trajectory/effortIgnition.d.ts.map +1 -1
- package/lib/types/trajectory/effortIgnition.js +106 -34
- package/lib/types/trajectory/window.d.ts +26 -0
- package/lib/types/trajectory/window.d.ts.map +1 -0
- package/lib/types/trajectory/window.js +27 -0
- package/lib/types/tuiDisplayPrefs.d.ts +38 -1
- package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
- package/lib/types/tuiDisplayPrefs.js +45 -1
- package/lib/types/update.d.ts +88 -3
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +285 -18
- package/lib/types/utils/crashDetail.d.ts +56 -0
- package/lib/types/utils/crashDetail.d.ts.map +1 -0
- package/lib/types/utils/crashDetail.js +175 -0
- package/lib/types/utils/imageResize.d.ts +9 -23
- package/lib/types/utils/imageResize.d.ts.map +1 -1
- package/lib/types/utils/imageResize.js +24 -20
- package/lib/types/utils/inputPaste.d.ts +9 -8
- package/lib/types/utils/inputPaste.d.ts.map +1 -1
- package/lib/types/utils/inputPaste.js +53 -16
- package/lib/types/utils/jsonl.d.ts +24 -0
- package/lib/types/utils/jsonl.d.ts.map +1 -0
- package/lib/types/utils/jsonl.js +36 -0
- package/package.json +18 -2
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/** Codex Responses-API channels. Only token refs persist here; token I/O
|
|
2
|
+
* comes from BackendHost.tokenStore and the backend-neutral shared seam.
|
|
3
|
+
* Provider overrides stay in argv (§5.11): hosts are process-list-visible. */
|
|
4
|
+
import { createHash } from 'node:crypto';
|
|
5
|
+
import { readFileSync, renameSync } from 'node:fs';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { channelProfileSlug } from '../../channel/channel-slug.js';
|
|
8
|
+
import { t } from '../../i18n.js';
|
|
9
|
+
import { DATA_DIR } from '../../utils/paths.js';
|
|
10
|
+
import { writeFileAtomic } from '../shared/atomic-file.js';
|
|
11
|
+
import { channelTokenRef } from '../shared/channel-tokens.js';
|
|
12
|
+
import { rec, str } from './narrow.js';
|
|
13
|
+
export const channelSlug = channelProfileSlug;
|
|
14
|
+
export const CODEX_CHANNEL_TOKEN_ENV = 'DSH_TUI_CODEX_CHANNEL_TOKEN';
|
|
15
|
+
const FILE = 'channels.json';
|
|
16
|
+
const derivedRef = (id) => channelTokenRef('codex-' + id);
|
|
17
|
+
const credentialEnv = /(?:API[_-]?KEY|TOKEN|SECRET|PASSWORD|AUTHORIZATION)/iu;
|
|
18
|
+
/** Reject credential-bearing URLs before either persistence or spawn. */
|
|
19
|
+
export function validateCodexBaseUrl(value) {
|
|
20
|
+
const fail = () => { throw new Error(t('codex-channel-url-invalid')); };
|
|
21
|
+
const input = value.trim();
|
|
22
|
+
if (input === '' || /[\s\\]/u.test(input) || input.includes('?') || input.includes('#'))
|
|
23
|
+
return fail();
|
|
24
|
+
let url;
|
|
25
|
+
try {
|
|
26
|
+
url = new URL(input);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return fail();
|
|
30
|
+
}
|
|
31
|
+
if ((url.protocol !== 'https:' && !(url.protocol === 'http:' && (url.hostname === 'localhost' || url.hostname === '127.0.0.1')))
|
|
32
|
+
|| url.username !== '' || url.password !== '')
|
|
33
|
+
return fail();
|
|
34
|
+
for (const encoded of url.pathname.split('/')) {
|
|
35
|
+
let segment;
|
|
36
|
+
try {
|
|
37
|
+
segment = decodeURIComponent(encoded);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return fail();
|
|
41
|
+
}
|
|
42
|
+
if (/^(?:sk-|(?:api[_-]?key|key|token|secret)=)/iu.test(segment)
|
|
43
|
+
|| /^[A-Za-z0-9_]{24,}$/u.test(segment)
|
|
44
|
+
|| (/^[A-Za-z0-9_-]{24,}$/u.test(segment) && /[0-9A-Z_]/u.test(segment))
|
|
45
|
+
|| /^[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}$/u.test(segment))
|
|
46
|
+
return fail();
|
|
47
|
+
}
|
|
48
|
+
return url.href;
|
|
49
|
+
}
|
|
50
|
+
function stringMap(value) {
|
|
51
|
+
const entries = rec(value);
|
|
52
|
+
if (entries === undefined)
|
|
53
|
+
return undefined;
|
|
54
|
+
const out = {};
|
|
55
|
+
for (const [key, value] of Object.entries(entries))
|
|
56
|
+
if (key.trim() !== '' && typeof value === 'string' && value.trim() !== '')
|
|
57
|
+
out[key.trim()] = value.trim();
|
|
58
|
+
return Object.keys(out).length === 0 ? undefined : out;
|
|
59
|
+
}
|
|
60
|
+
/** Invalid endpoint rows remain selected so launch refuses, never silently
|
|
61
|
+
* switching a hand-edited active connection to ambient OAuth credentials. */
|
|
62
|
+
export function parseCodexChannels(value) {
|
|
63
|
+
const data = rec(value);
|
|
64
|
+
const channels = [];
|
|
65
|
+
for (const raw of Array.isArray(data?.channels) ? data.channels : []) {
|
|
66
|
+
const row = rec(raw);
|
|
67
|
+
const id = str(row?.id)?.trim();
|
|
68
|
+
if (id === undefined || !/^[a-z0-9][a-z0-9_-]*$/iu.test(id) || channels.some(profile => profile.id === id))
|
|
69
|
+
continue;
|
|
70
|
+
channels.push({
|
|
71
|
+
id, name: str(row?.name)?.trim() || id,
|
|
72
|
+
...(typeof row?.baseUrl === 'string' && row.baseUrl !== '' ? { baseUrl: row.baseUrl.trim() } : {}),
|
|
73
|
+
...(typeof row?.tokenRef === 'string' && row.tokenRef !== '' ? { tokenRef: row.tokenRef } : {}),
|
|
74
|
+
wireApi: str(row?.wireApi) ?? 'responses',
|
|
75
|
+
...(stringMap(row?.env) === undefined ? {} : { env: stringMap(row?.env) }),
|
|
76
|
+
...(stringMap(row?.models) === undefined ? {} : { models: stringMap(row?.models) }),
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
const active = str(data?.active);
|
|
80
|
+
return { channels, ...(channels.some(profile => profile.id === active) ? { active } : {}) };
|
|
81
|
+
}
|
|
82
|
+
function checked(profile) {
|
|
83
|
+
if (!/^[a-z0-9][a-z0-9_-]*$/iu.test(profile.id))
|
|
84
|
+
throw new Error(t('codex-channel-id-invalid'));
|
|
85
|
+
if (profile.wireApi !== undefined && profile.wireApi !== 'responses')
|
|
86
|
+
throw new Error(t('codex-channel-wire-api-invalid'));
|
|
87
|
+
for (const key of Object.keys(profile.env ?? {})) {
|
|
88
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/u.test(key) || credentialEnv.test(key))
|
|
89
|
+
throw new Error(t('codex-channel-env-invalid'));
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
id: profile.id, name: profile.name.trim() || profile.id, wireApi: 'responses',
|
|
93
|
+
...(profile.baseUrl === undefined ? {} : { baseUrl: validateCodexBaseUrl(profile.baseUrl) }),
|
|
94
|
+
...(profile.tokenRef === undefined ? {} : { tokenRef: profile.tokenRef }),
|
|
95
|
+
...(profile.env === undefined ? {} : { env: { ...profile.env } }),
|
|
96
|
+
...(profile.models === undefined ? {} : { models: { ...profile.models } }),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
const upsert = (data, profile) => ({
|
|
100
|
+
...data, channels: data.channels.some(row => row.id === profile.id) ? data.channels.map(row => row.id === profile.id ? profile : row) : [...data.channels, profile],
|
|
101
|
+
});
|
|
102
|
+
const without = (data, id) => ({
|
|
103
|
+
channels: data.channels.filter(row => row.id !== id), ...(data.active === undefined || data.active === id ? {} : { active: data.active }),
|
|
104
|
+
});
|
|
105
|
+
export const activeProfileOf = (data) => data.channels.find(row => row.id === data.active);
|
|
106
|
+
export const hasChannelConnection = (profile) => profile !== undefined && (profile.baseUrl !== undefined || profile.tokenRef !== undefined || Object.keys(profile.env ?? {}).length > 0);
|
|
107
|
+
/** Same atomic/upsert/damaged-file semantics as the mature Claude store. */
|
|
108
|
+
export function fileCodexChannels(dir = join(DATA_DIR, 'backends', 'codex'), debug = () => undefined) {
|
|
109
|
+
const path = join(dir, FILE);
|
|
110
|
+
const load = () => {
|
|
111
|
+
try {
|
|
112
|
+
return { data: parseCodexChannels(JSON.parse(readFileSync(path, 'utf8'))), damaged: false };
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
return { data: { channels: [] }, damaged: !['ENOENT', 'ENOTDIR'].includes(error.code ?? '') };
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
const commit = (data) => {
|
|
119
|
+
try {
|
|
120
|
+
writeFileAtomic(dir, FILE, JSON.stringify(data, null, 2) + '\n');
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
debug('codex: channels write failed');
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
return {
|
|
127
|
+
read: () => load().data,
|
|
128
|
+
setActive: id => { const data = load().data; if (data.active !== id && data.channels.some(row => row.id === id))
|
|
129
|
+
commit({ ...data, active: id }); },
|
|
130
|
+
save: profile => {
|
|
131
|
+
const valid = checked(profile);
|
|
132
|
+
const current = load();
|
|
133
|
+
if (current.damaged) {
|
|
134
|
+
try {
|
|
135
|
+
renameSync(path, path + '.damaged-' + Date.now());
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
debug('codex: damaged channels file could not be moved aside; not saving');
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
commit(upsert(current.data, valid));
|
|
143
|
+
},
|
|
144
|
+
remove: id => { const data = load().data; if (data.channels.some(row => row.id === id))
|
|
145
|
+
commit(without(data, id)); },
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
export function memoryCodexChannels(initial = { channels: [] }) {
|
|
149
|
+
let data = parseCodexChannels(initial);
|
|
150
|
+
return {
|
|
151
|
+
read: () => data,
|
|
152
|
+
setActive: id => { if (data.channels.some(row => row.id === id))
|
|
153
|
+
data = { ...data, active: id }; },
|
|
154
|
+
save: profile => { data = upsert(data, checked(profile)); },
|
|
155
|
+
remove: id => { data = without(data, id); },
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
/** The token only goes into the child environment, never an argv override. */
|
|
159
|
+
export function codexChannelLaunch(profile, tokens) {
|
|
160
|
+
if (!hasChannelConnection(profile) || profile === undefined)
|
|
161
|
+
return { args: [], env: {}, injectedEnvKeys: [] };
|
|
162
|
+
if (profile.baseUrl === undefined)
|
|
163
|
+
throw new Error(t('codex-channel-url-required'));
|
|
164
|
+
const valid = checked(profile);
|
|
165
|
+
const token = valid.tokenRef === undefined ? undefined : tokens?.read(valid.tokenRef);
|
|
166
|
+
if (token === undefined && new URL(valid.baseUrl).protocol !== 'http:')
|
|
167
|
+
throw new Error(t('codex-channel-token-missing', { name: valid.name }));
|
|
168
|
+
const provider = 'dshtui-' + valid.id;
|
|
169
|
+
const overrides = {
|
|
170
|
+
model_provider: provider,
|
|
171
|
+
['model_providers.' + provider + '.name']: valid.name,
|
|
172
|
+
['model_providers.' + provider + '.base_url']: valid.baseUrl,
|
|
173
|
+
['model_providers.' + provider + '.wire_api']: 'responses',
|
|
174
|
+
['model_providers.' + provider + '.requires_openai_auth']: false,
|
|
175
|
+
...(token === undefined ? {} : { ['model_providers.' + provider + '.env_key']: CODEX_CHANNEL_TOKEN_ENV }),
|
|
176
|
+
};
|
|
177
|
+
const env = { ...valid.env, ...(token === undefined ? {} : { [CODEX_CHANNEL_TOKEN_ENV]: token }) };
|
|
178
|
+
return { args: Object.entries(overrides).flatMap(([key, value]) => ['-c', key + '=' + JSON.stringify(value)]), env, injectedEnvKeys: Object.keys(env), provider };
|
|
179
|
+
}
|
|
180
|
+
function settingsImport(config, env) {
|
|
181
|
+
const provider = str(config?.model_provider);
|
|
182
|
+
if (provider === undefined || provider === 'openai' || provider.startsWith('dshtui-'))
|
|
183
|
+
return undefined;
|
|
184
|
+
const row = rec(rec(config?.model_providers)?.[provider]);
|
|
185
|
+
if (typeof row?.base_url !== 'string' || (row.wire_api != null && row.wire_api !== 'responses'))
|
|
186
|
+
return undefined;
|
|
187
|
+
let baseUrl;
|
|
188
|
+
try {
|
|
189
|
+
baseUrl = validateCodexBaseUrl(row.base_url);
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
return undefined;
|
|
193
|
+
}
|
|
194
|
+
const name = new URL(baseUrl).host;
|
|
195
|
+
const key = str(row.env_key);
|
|
196
|
+
const token = key === undefined ? undefined : Object.entries(env).find(([name, value]) => name.toUpperCase() === key.toUpperCase() && value !== undefined && value !== '')?.[1];
|
|
197
|
+
return { profile: { id: channelSlug(name), name, baseUrl, wireApi: 'responses' }, ...(token === undefined ? {} : { token }) };
|
|
198
|
+
}
|
|
199
|
+
/** Synchronous channel capability over a config/read snapshot. The TUI's
|
|
200
|
+
* own dshtui-* provider is not re-imported as if it were user settings. */
|
|
201
|
+
export function createCodexChannelsRuntime(deps) {
|
|
202
|
+
let config = deps.config;
|
|
203
|
+
const { store, tokens } = deps;
|
|
204
|
+
const view = (profile) => {
|
|
205
|
+
let baseUrl;
|
|
206
|
+
try {
|
|
207
|
+
if (profile.baseUrl !== undefined)
|
|
208
|
+
baseUrl = validateCodexBaseUrl(profile.baseUrl);
|
|
209
|
+
}
|
|
210
|
+
catch { /* unsafe URL never reaches a view */ }
|
|
211
|
+
const token = profile.tokenRef === undefined ? undefined : tokens?.read(profile.tokenRef);
|
|
212
|
+
const env = Object.entries(profile.env ?? {}).sort(([a], [b]) => a.localeCompare(b));
|
|
213
|
+
return {
|
|
214
|
+
id: profile.id, name: profile.name, models: Object.entries(profile.models ?? {}).map(([from, to]) => ({ from, to })), tiers: [],
|
|
215
|
+
...(!hasChannelConnection(profile) ? {} : { connection: { ...(baseUrl === undefined ? {} : { baseUrl }), hasToken: profile.tokenRef !== undefined && (tokens?.declared(profile.tokenRef) ?? false), envKeys: Object.keys(profile.env ?? {}), fingerprint: createHash('sha256').update(JSON.stringify([profile.baseUrl, token, env])).digest('hex').slice(0, 16) } }),
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
const shared = (ref, except) => store.read().channels.some(row => row.id !== except && row.tokenRef === ref);
|
|
219
|
+
const capability = {
|
|
220
|
+
list: () => store.read().channels.map(view),
|
|
221
|
+
activeId: () => store.read().active,
|
|
222
|
+
setActive: id => store.setActive(id),
|
|
223
|
+
save: input => {
|
|
224
|
+
const current = store.read().channels.find(row => row.id === input.id);
|
|
225
|
+
const profile = checked({
|
|
226
|
+
id: input.id, name: input.name,
|
|
227
|
+
...(input.baseUrl === undefined ? (current?.baseUrl === undefined ? {} : { baseUrl: current.baseUrl }) : input.baseUrl === '' ? {} : { baseUrl: input.baseUrl }),
|
|
228
|
+
...(current?.tokenRef === undefined ? {} : { tokenRef: current.tokenRef }),
|
|
229
|
+
...(input.env === undefined ? (current?.env === undefined ? {} : { env: current.env }) : { env: input.env }),
|
|
230
|
+
...(input.models === undefined ? (current?.models === undefined ? {} : { models: current.models }) : { models: input.models }),
|
|
231
|
+
});
|
|
232
|
+
let tokenRef = profile.tokenRef;
|
|
233
|
+
if (input.token !== undefined) {
|
|
234
|
+
if (tokens === undefined)
|
|
235
|
+
throw new Error(t('codex-channel-store-unavailable'));
|
|
236
|
+
if (input.token === '') {
|
|
237
|
+
if (tokenRef !== undefined && !shared(tokenRef, input.id) && tokenRef === derivedRef(input.id))
|
|
238
|
+
tokens.erase(tokenRef);
|
|
239
|
+
tokenRef = undefined;
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
tokenRef ??= derivedRef(input.id);
|
|
243
|
+
tokens.write(tokenRef, input.token);
|
|
244
|
+
if (tokens.read(tokenRef) !== input.token)
|
|
245
|
+
throw new Error(t('codex-channel-token-write-failed'));
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
const { tokenRef: _oldRef, ...rest } = profile;
|
|
249
|
+
const saved = { ...rest, ...(tokenRef === undefined ? {} : { tokenRef }) };
|
|
250
|
+
store.save(saved);
|
|
251
|
+
return view(saved);
|
|
252
|
+
},
|
|
253
|
+
remove: id => {
|
|
254
|
+
const current = store.read().channels.find(row => row.id === id);
|
|
255
|
+
if (current === undefined)
|
|
256
|
+
return false;
|
|
257
|
+
if (current.tokenRef === derivedRef(id) && !shared(current.tokenRef, id))
|
|
258
|
+
tokens?.erase(current.tokenRef);
|
|
259
|
+
store.remove(id);
|
|
260
|
+
return true;
|
|
261
|
+
},
|
|
262
|
+
importFromSettings: () => {
|
|
263
|
+
const draft = settingsImport(config, deps.env ?? {});
|
|
264
|
+
if (draft === undefined || draft.token === undefined || tokens === undefined)
|
|
265
|
+
return undefined;
|
|
266
|
+
return capability.save({ ...draft.profile, token: draft.token });
|
|
267
|
+
},
|
|
268
|
+
peekSettingsImport: () => {
|
|
269
|
+
const draft = settingsImport(config, deps.env ?? {});
|
|
270
|
+
return draft === undefined ? undefined : { baseUrl: draft.profile.baseUrl, tiers: {} };
|
|
271
|
+
},
|
|
272
|
+
};
|
|
273
|
+
return { capability, active: () => activeProfileOf(store.read()), refreshConfig: value => { config = value; }, launch: () => codexChannelLaunch(activeProfileOf(store.read()), tokens) };
|
|
274
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version contract of the Codex backend (docs/codex-backend-design.md D3).
|
|
3
|
+
* There is no npm dependency: the backend drives the user's own `codex`
|
|
4
|
+
* binary over `codex app-server`, and the protocol types under
|
|
5
|
+
* `protocol/generated/` are that binary's generator output, vendored by
|
|
6
|
+
* `scripts/codex-protocol-sync.mjs`. `verify:codex-contract` checks the
|
|
7
|
+
* digest below against the tree and every protocol name the backend handles
|
|
8
|
+
* against the generated unions.
|
|
9
|
+
*
|
|
10
|
+
* Version policy: a binary on the same minor line as a validated version and
|
|
11
|
+
* not older than it is compatible (`0.160.x` ≥ `0.160.1`); anything else on
|
|
12
|
+
* or above {@link MIN_CODEX_VERSION} runs with a drift notice; below it the
|
|
13
|
+
* backend reports itself not installed, with an upgrade hint.
|
|
14
|
+
*/
|
|
15
|
+
/** Backend id of the Codex backend (`AgentSessionRef.backendId`). */
|
|
16
|
+
export declare const CODEX_BACKEND_ID = "codex";
|
|
17
|
+
/** User-facing backend name. */
|
|
18
|
+
export declare const CODEX_BACKEND_LABEL = "Codex";
|
|
19
|
+
/** How a user re-enters a Codex thread from a shell. */
|
|
20
|
+
export declare function codexResumeCommand(threadId: string): string;
|
|
21
|
+
/** The `codex-cli` versions the backend is validated against. */
|
|
22
|
+
export declare const VALIDATED_CODEX_VERSIONS: readonly string[];
|
|
23
|
+
/**
|
|
24
|
+
* The oldest `codex-cli` the backend starts on (C0 V16): 0.144.0's generated
|
|
25
|
+
* protocol carries every method, notification, server request and item type
|
|
26
|
+
* this backend uses, and its handshake / thread start / model list were
|
|
27
|
+
* observed working. Anything below the validated line still runs with a
|
|
28
|
+
* drift notice.
|
|
29
|
+
*/
|
|
30
|
+
export declare const MIN_CODEX_VERSION = "0.144.0";
|
|
31
|
+
/** The `codex-cli` version `protocol/generated/` was generated from. */
|
|
32
|
+
export declare const PROTOCOL_VERSION = "0.160.1";
|
|
33
|
+
/** Digest of `protocol/generated/` (scripts/lib/codex-protocol-digest.mjs). */
|
|
34
|
+
export declare const PROTOCOL_DIGEST = "sha256:3843848c108242f7364b986c80fefd6cd37aec4ab2863b0e2b6fb7bc86feb6f7";
|
|
35
|
+
/** `X.Y.Z` (with an optional pre-release tail) from `codex --version`
|
|
36
|
+
* output (`codex-cli 0.160.1`), else undefined. */
|
|
37
|
+
export declare function parseCodexVersion(text: string): string | undefined;
|
|
38
|
+
/** Compare two versions by their numeric triple (pre-release tails ignored);
|
|
39
|
+
* undefined when either does not parse. */
|
|
40
|
+
export declare function compareCodexVersions(a: string, b: string): number | undefined;
|
|
41
|
+
/** Whether a version is at least {@link MIN_CODEX_VERSION} (an unreadable
|
|
42
|
+
* version is given the benefit of the doubt: drift, never a refusal). */
|
|
43
|
+
export declare function codexVersionSupported(version: string | undefined): boolean;
|
|
44
|
+
/** The version when it is outside the validated range, else undefined. */
|
|
45
|
+
export declare function codexVersionDrift(version: string | undefined): string | undefined;
|
|
46
|
+
//# sourceMappingURL=contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../../src/backends/codex/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,qEAAqE;AACrE,eAAO,MAAM,gBAAgB,UAAU,CAAA;AAEvC,gCAAgC;AAChC,eAAO,MAAM,mBAAmB,UAAU,CAAA;AAE1C,wDAAwD;AACxD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,iEAAiE;AACjE,eAAO,MAAM,wBAAwB,EAAE,SAAS,MAAM,EAAgB,CAAA;AAEtE;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,YAAY,CAAA;AAE1C,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,YAAY,CAAA;AAEzC,+EAA+E;AAC/E,eAAO,MAAM,eAAe,4EAA4E,CAAA;AAExG;oDACoD;AACpD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAElE;AAQD;4CAC4C;AAC5C,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQ7E;AAED;0EAC0E;AAC1E,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAI1E;AAED,0EAA0E;AAC1E,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CASjF"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version contract of the Codex backend (docs/codex-backend-design.md D3).
|
|
3
|
+
* There is no npm dependency: the backend drives the user's own `codex`
|
|
4
|
+
* binary over `codex app-server`, and the protocol types under
|
|
5
|
+
* `protocol/generated/` are that binary's generator output, vendored by
|
|
6
|
+
* `scripts/codex-protocol-sync.mjs`. `verify:codex-contract` checks the
|
|
7
|
+
* digest below against the tree and every protocol name the backend handles
|
|
8
|
+
* against the generated unions.
|
|
9
|
+
*
|
|
10
|
+
* Version policy: a binary on the same minor line as a validated version and
|
|
11
|
+
* not older than it is compatible (`0.160.x` ≥ `0.160.1`); anything else on
|
|
12
|
+
* or above {@link MIN_CODEX_VERSION} runs with a drift notice; below it the
|
|
13
|
+
* backend reports itself not installed, with an upgrade hint.
|
|
14
|
+
*/
|
|
15
|
+
/** Backend id of the Codex backend (`AgentSessionRef.backendId`). */
|
|
16
|
+
export const CODEX_BACKEND_ID = 'codex';
|
|
17
|
+
/** User-facing backend name. */
|
|
18
|
+
export const CODEX_BACKEND_LABEL = 'Codex';
|
|
19
|
+
/** How a user re-enters a Codex thread from a shell. */
|
|
20
|
+
export function codexResumeCommand(threadId) {
|
|
21
|
+
return `dsh-tui --backend codex --resume ${threadId}`;
|
|
22
|
+
}
|
|
23
|
+
/** The `codex-cli` versions the backend is validated against. */
|
|
24
|
+
export const VALIDATED_CODEX_VERSIONS = ['0.160.1'];
|
|
25
|
+
/**
|
|
26
|
+
* The oldest `codex-cli` the backend starts on (C0 V16): 0.144.0's generated
|
|
27
|
+
* protocol carries every method, notification, server request and item type
|
|
28
|
+
* this backend uses, and its handshake / thread start / model list were
|
|
29
|
+
* observed working. Anything below the validated line still runs with a
|
|
30
|
+
* drift notice.
|
|
31
|
+
*/
|
|
32
|
+
export const MIN_CODEX_VERSION = '0.144.0';
|
|
33
|
+
/** The `codex-cli` version `protocol/generated/` was generated from. */
|
|
34
|
+
export const PROTOCOL_VERSION = '0.160.1';
|
|
35
|
+
/** Digest of `protocol/generated/` (scripts/lib/codex-protocol-digest.mjs). */
|
|
36
|
+
export const PROTOCOL_DIGEST = 'sha256:3843848c108242f7364b986c80fefd6cd37aec4ab2863b0e2b6fb7bc86feb6f7';
|
|
37
|
+
/** `X.Y.Z` (with an optional pre-release tail) from `codex --version`
|
|
38
|
+
* output (`codex-cli 0.160.1`), else undefined. */
|
|
39
|
+
export function parseCodexVersion(text) {
|
|
40
|
+
return /(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?)/u.exec(text)?.[1];
|
|
41
|
+
}
|
|
42
|
+
/** Numeric `[major, minor, patch]` of a version, else undefined. */
|
|
43
|
+
function triple(version) {
|
|
44
|
+
const match = /^(\d+)\.(\d+)\.(\d+)/u.exec(version);
|
|
45
|
+
return match === null ? undefined : [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
46
|
+
}
|
|
47
|
+
/** Compare two versions by their numeric triple (pre-release tails ignored);
|
|
48
|
+
* undefined when either does not parse. */
|
|
49
|
+
export function compareCodexVersions(a, b) {
|
|
50
|
+
const left = triple(a);
|
|
51
|
+
const right = triple(b);
|
|
52
|
+
if (left === undefined || right === undefined)
|
|
53
|
+
return undefined;
|
|
54
|
+
for (let index = 0; index < 3; index++) {
|
|
55
|
+
if (left[index] !== right[index])
|
|
56
|
+
return left[index] - right[index];
|
|
57
|
+
}
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
60
|
+
/** Whether a version is at least {@link MIN_CODEX_VERSION} (an unreadable
|
|
61
|
+
* version is given the benefit of the doubt: drift, never a refusal). */
|
|
62
|
+
export function codexVersionSupported(version) {
|
|
63
|
+
if (version === undefined)
|
|
64
|
+
return true;
|
|
65
|
+
const order = compareCodexVersions(version, MIN_CODEX_VERSION);
|
|
66
|
+
return order === undefined || order >= 0;
|
|
67
|
+
}
|
|
68
|
+
/** The version when it is outside the validated range, else undefined. */
|
|
69
|
+
export function codexVersionDrift(version) {
|
|
70
|
+
if (version === undefined || version === '')
|
|
71
|
+
return undefined;
|
|
72
|
+
const own = triple(version);
|
|
73
|
+
if (own === undefined)
|
|
74
|
+
return version;
|
|
75
|
+
const compatible = VALIDATED_CODEX_VERSIONS.some(validated => {
|
|
76
|
+
const line = triple(validated);
|
|
77
|
+
return line !== undefined && line[0] === own[0] && line[1] === own[1] && own[2] >= line[2];
|
|
78
|
+
});
|
|
79
|
+
return compatible ? undefined : version;
|
|
80
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BackendDetection, BackendHost } from '../../agent/backend.js';
|
|
2
|
+
import { type CodexChannelProfile } from './channels.js';
|
|
3
|
+
import type { ChannelTokenStore } from '../shared/channel-tokens.js';
|
|
4
|
+
/** The Codex home the app-server will use (`CODEX_HOME`, else `~/.codex`). */
|
|
5
|
+
export declare function codexHomeDir(env?: NodeJS.ProcessEnv): string;
|
|
6
|
+
/** Whether a credential is visible without a network call. */
|
|
7
|
+
export declare function detectCodexAuth(env?: NodeJS.ProcessEnv, options?: {
|
|
8
|
+
readonly channel?: CodexChannelProfile;
|
|
9
|
+
readonly tokens?: ChannelTokenStore;
|
|
10
|
+
}): 'ok' | 'missing' | 'unknown';
|
|
11
|
+
export declare function detectCodex(host: BackendHost & {
|
|
12
|
+
readonly tokenStore?: ChannelTokenStore;
|
|
13
|
+
}, env?: NodeJS.ProcessEnv): Promise<BackendDetection>;
|
|
14
|
+
//# sourceMappingURL=detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../../../src/backends/codex/detect.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAG3E,OAAO,EAAgF,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACtI,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAKpE,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAGzE;AAED,8DAA8D;AAC9D,wBAAgB,eAAe,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,EAAE,OAAO,GAAE;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAAO,GAAG,IAAI,GAAG,SAAS,GAAG,SAAS,CAkBjM;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG;IAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,iBAAiB,CAAA;CAAE,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA2BlK"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex backend detection (docs/codex-backend-design.md §5.4): is a usable
|
|
3
|
+
* `codex` installed, is it a supported version, and is there a credential
|
|
4
|
+
* it could use — all without starting the app-server or touching the
|
|
5
|
+
* network. Never throws.
|
|
6
|
+
*
|
|
7
|
+
* The credential check is cheap and conservative: an API key in the
|
|
8
|
+
* environment, a `$CODEX_HOME/auth.json`, or a config that routes to a
|
|
9
|
+
* provider of its own count as present; a keychain store is `unknown`.
|
|
10
|
+
*/
|
|
11
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
12
|
+
import { homedir } from 'node:os';
|
|
13
|
+
import { join } from 'node:path';
|
|
14
|
+
import { t } from '../../i18n.js';
|
|
15
|
+
import { CODEX_OAUTH_PROVIDER } from './auth/external-tokens.js';
|
|
16
|
+
import { activeProfileOf, codexChannelLaunch, fileCodexChannels, hasChannelConnection } from './channels.js';
|
|
17
|
+
import { codexVersionDrift, codexVersionSupported, MIN_CODEX_VERSION } from './contract.js';
|
|
18
|
+
import { errorText } from './narrow.js';
|
|
19
|
+
import { resolveCodexExecutable } from './rpc/binary.js';
|
|
20
|
+
/** The Codex home the app-server will use (`CODEX_HOME`, else `~/.codex`). */
|
|
21
|
+
export function codexHomeDir(env = process.env) {
|
|
22
|
+
const configured = env.CODEX_HOME;
|
|
23
|
+
return configured !== undefined && configured !== '' ? configured : join(homedir(), '.codex');
|
|
24
|
+
}
|
|
25
|
+
/** Whether a credential is visible without a network call. */
|
|
26
|
+
export function detectCodexAuth(env = process.env, options = {}) {
|
|
27
|
+
if (hasChannelConnection(options.channel)) {
|
|
28
|
+
try {
|
|
29
|
+
codexChannelLaunch(options.channel, options.tokens);
|
|
30
|
+
return 'ok';
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return 'missing';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if ((env.OPENAI_API_KEY ?? '') !== '' || (env.CODEX_API_KEY ?? '') !== '')
|
|
37
|
+
return 'ok';
|
|
38
|
+
const home = codexHomeDir(env);
|
|
39
|
+
if (existsSync(join(home, 'auth.json')))
|
|
40
|
+
return 'ok';
|
|
41
|
+
let config = '';
|
|
42
|
+
try {
|
|
43
|
+
config = readFileSync(join(home, 'config.toml'), 'utf8');
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
config = '';
|
|
47
|
+
}
|
|
48
|
+
// A provider of its own (a relay, a local model) needs no OpenAI login.
|
|
49
|
+
const provider = /^\s*model_provider\s*=\s*["']([^"']+)["']/mu.exec(config)?.[1];
|
|
50
|
+
if (provider !== undefined && provider !== 'openai')
|
|
51
|
+
return 'ok';
|
|
52
|
+
if (/^\s*cli_auth_credentials_store\s*=\s*["'](?:keyring|auto)["']/mu.test(config))
|
|
53
|
+
return 'unknown';
|
|
54
|
+
return 'missing';
|
|
55
|
+
}
|
|
56
|
+
export async function detectCodex(host, env = process.env) {
|
|
57
|
+
try {
|
|
58
|
+
const executable = await resolveCodexExecutable(env);
|
|
59
|
+
if (executable === undefined)
|
|
60
|
+
return { installed: false, hint: t('codex-not-installed') };
|
|
61
|
+
const version = executable.version;
|
|
62
|
+
if (!codexVersionSupported(version)) {
|
|
63
|
+
return { installed: false, ...(version === undefined ? {} : { version }), hint: t('codex-too-old', { version: version ?? '', min: MIN_CODEX_VERSION }) };
|
|
64
|
+
}
|
|
65
|
+
const channel = activeProfileOf(fileCodexChannels(undefined, host.debug).read());
|
|
66
|
+
let auth = detectCodexAuth(env, { channel, tokens: host.tokenStore });
|
|
67
|
+
if (!hasChannelConnection(channel)) {
|
|
68
|
+
try {
|
|
69
|
+
if (await host.oauthCredential?.(CODEX_OAUTH_PROVIDER)?.stored() === true)
|
|
70
|
+
auth = 'ok';
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
host.debug('codex: stored OAuth detection failed');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const drift = codexVersionDrift(version);
|
|
77
|
+
return {
|
|
78
|
+
installed: true,
|
|
79
|
+
loginInSession: true,
|
|
80
|
+
auth,
|
|
81
|
+
...(version === undefined ? {} : { version }),
|
|
82
|
+
...(drift === undefined ? {} : { drift }),
|
|
83
|
+
...(auth === 'missing' ? { hint: t('codex-auth-missing-hint') } : {}),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
host.debug(`codex: detection failed (${errorText(error)})`);
|
|
88
|
+
return { installed: false };
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** The Codex backend (docs/codex-backend-design.md): its one entry point. */
|
|
2
|
+
export { codexBackend } from './backend.js';
|
|
3
|
+
export { CODEX_BACKEND_ID, CODEX_BACKEND_LABEL, codexResumeCommand, MIN_CODEX_VERSION, VALIDATED_CODEX_VERSIONS } from './contract.js';
|
|
4
|
+
export { fileCodexPrefs } from './prefs.js';
|
|
5
|
+
export { closeAllCodexHubs } from './rpc/hub.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/backends/codex/index.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAA;AACtI,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** The Codex backend (docs/codex-backend-design.md): its one entry point. */
|
|
2
|
+
export { codexBackend } from './backend.js';
|
|
3
|
+
export { CODEX_BACKEND_ID, CODEX_BACKEND_LABEL, codexResumeCommand, MIN_CODEX_VERSION, VALIDATED_CODEX_VERSIONS } from './contract.js';
|
|
4
|
+
export { fileCodexPrefs } from './prefs.js';
|
|
5
|
+
export { closeAllCodexHubs } from './rpc/hub.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** The permission modes (Plan mode is C2). */
|
|
2
|
+
export declare const CODEX_MODE_IDS: readonly ["read-only", "auto", "full-access"];
|
|
3
|
+
export type CodexModeId = typeof CODEX_MODE_IDS[number];
|
|
4
|
+
/** The mode a session starts in when nothing is remembered. */
|
|
5
|
+
export declare const DEFAULT_CODEX_MODE: CodexModeId;
|
|
6
|
+
/** What each mode sends: `thread/start`/`thread/resume` take a sandbox
|
|
7
|
+
* mode; `turn/start` and `thread/settings/update` a sandbox policy. */
|
|
8
|
+
export declare const CODEX_MODE_PARAMS: Readonly<Record<CodexModeId, {
|
|
9
|
+
readonly approvalPolicy: 'on-request' | 'never';
|
|
10
|
+
readonly sandbox: 'read-only' | 'workspace-write' | 'danger-full-access';
|
|
11
|
+
}>>;
|
|
12
|
+
export declare function isCodexModeId(value: unknown): value is CodexModeId;
|
|
13
|
+
/** The mode a thread's reported settings correspond to; `custom` when they
|
|
14
|
+
* match no preset (a user config the presets do not cover). */
|
|
15
|
+
export declare function modeIdOf(approvalPolicy: unknown, sandbox: unknown): CodexModeId | 'custom';
|
|
16
|
+
//# sourceMappingURL=modes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modes.d.ts","sourceRoot":"","sources":["../../../../src/backends/codex/modes.ts"],"names":[],"mappings":"AAYA,8CAA8C;AAC9C,eAAO,MAAM,cAAc,+CAAgD,CAAA;AAC3E,MAAM,MAAM,WAAW,GAAG,OAAO,cAAc,CAAC,MAAM,CAAC,CAAA;AAEvD,+DAA+D;AAC/D,eAAO,MAAM,kBAAkB,EAAE,WAAoB,CAAA;AAErD;wEACwE;AACxE,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE;IAAE,QAAQ,CAAC,cAAc,EAAE,YAAY,GAAG,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,iBAAiB,GAAG,oBAAoB,CAAA;CAAE,CAAC,CAI1L,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE;AAcD;gEACgE;AAChE,wBAAgB,QAAQ,CAAC,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,WAAW,GAAG,QAAQ,CAQ1F"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Codex permission presets as the backend's modes
|
|
3
|
+
* (docs/codex-backend-design.md §5.9; C0 V8: the official `/permissions`
|
|
4
|
+
* presets `read-only` "Read Only", `auto` "Default", `full-access` "Full
|
|
5
|
+
* Access", plus Plan mode, which C2 adds as a collaboration mode).
|
|
6
|
+
*
|
|
7
|
+
* `auto` is the base mode a session starts in unless the user picked
|
|
8
|
+
* another: on-request approvals inside a workspace-write sandbox, so every
|
|
9
|
+
* command or edit outside the workspace asks first.
|
|
10
|
+
*/
|
|
11
|
+
import { rec, str } from './narrow.js';
|
|
12
|
+
/** The permission modes (Plan mode is C2). */
|
|
13
|
+
export const CODEX_MODE_IDS = ['read-only', 'auto', 'full-access'];
|
|
14
|
+
/** The mode a session starts in when nothing is remembered. */
|
|
15
|
+
export const DEFAULT_CODEX_MODE = 'auto';
|
|
16
|
+
/** What each mode sends: `thread/start`/`thread/resume` take a sandbox
|
|
17
|
+
* mode; `turn/start` and `thread/settings/update` a sandbox policy. */
|
|
18
|
+
export const CODEX_MODE_PARAMS = {
|
|
19
|
+
'read-only': { approvalPolicy: 'on-request', sandbox: 'read-only' },
|
|
20
|
+
auto: { approvalPolicy: 'on-request', sandbox: 'workspace-write' },
|
|
21
|
+
'full-access': { approvalPolicy: 'never', sandbox: 'danger-full-access' },
|
|
22
|
+
};
|
|
23
|
+
export function isCodexModeId(value) {
|
|
24
|
+
return typeof value === 'string' && CODEX_MODE_IDS.includes(value);
|
|
25
|
+
}
|
|
26
|
+
/** The sandbox mode a `SandboxPolicy` object (or mode string) names. */
|
|
27
|
+
function sandboxModeOf(sandbox) {
|
|
28
|
+
const text = str(sandbox);
|
|
29
|
+
if (text !== undefined)
|
|
30
|
+
return text;
|
|
31
|
+
switch (str(rec(sandbox)?.type)) {
|
|
32
|
+
case 'readOnly': return 'read-only';
|
|
33
|
+
case 'workspaceWrite': return 'workspace-write';
|
|
34
|
+
case 'dangerFullAccess': return 'danger-full-access';
|
|
35
|
+
default: return undefined;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/** The mode a thread's reported settings correspond to; `custom` when they
|
|
39
|
+
* match no preset (a user config the presets do not cover). */
|
|
40
|
+
export function modeIdOf(approvalPolicy, sandbox) {
|
|
41
|
+
const approval = str(approvalPolicy);
|
|
42
|
+
const mode = sandboxModeOf(sandbox);
|
|
43
|
+
for (const id of CODEX_MODE_IDS) {
|
|
44
|
+
const params = CODEX_MODE_PARAMS[id];
|
|
45
|
+
if (params.approvalPolicy === approval && params.sandbox === mode)
|
|
46
|
+
return id;
|
|
47
|
+
}
|
|
48
|
+
return 'custom';
|
|
49
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Narrowing helpers for the untyped app-server JSON (the counterpart of
|
|
3
|
+
* `claude/narrow.ts`). The generated protocol types only annotate call
|
|
4
|
+
* sites; every value read at run time goes through these (a `bigint` field
|
|
5
|
+
* of a generated type is a plain JSON number on the wire).
|
|
6
|
+
*/
|
|
7
|
+
export type Rec = Readonly<Record<string, unknown>>;
|
|
8
|
+
/** A plain object (not an array), else undefined. */
|
|
9
|
+
export declare const rec: (value: unknown) => Rec | undefined;
|
|
10
|
+
export declare const str: (value: unknown) => string | undefined;
|
|
11
|
+
/** A non-empty string, else undefined. */
|
|
12
|
+
export declare const text: (value: unknown) => string | undefined;
|
|
13
|
+
/** A finite number, else undefined. */
|
|
14
|
+
export declare const num: (value: unknown) => number | undefined;
|
|
15
|
+
export declare const bool: (value: unknown) => boolean | undefined;
|
|
16
|
+
export declare const arr: (value: unknown) => readonly unknown[];
|
|
17
|
+
/** The string members of an array value. */
|
|
18
|
+
export declare const strings: (value: unknown) => readonly string[];
|
|
19
|
+
export declare const errorText: (error: unknown) => string;
|
|
20
|
+
//# sourceMappingURL=narrow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"narrow.d.ts","sourceRoot":"","sources":["../../../../src/backends/codex/narrow.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;AAEnD,qDAAqD;AACrD,eAAO,MAAM,GAAG,GAAI,OAAO,OAAO,KAAG,GAAG,GAAG,SACsD,CAAA;AAEjG,eAAO,MAAM,GAAG,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,SAA0D,CAAA;AAExG,0CAA0C;AAC1C,eAAO,MAAM,IAAI,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,SAA0E,CAAA;AAEzH,uCAAuC;AACvC,eAAO,MAAM,GAAG,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,SAAoF,CAAA;AAElI,eAAO,MAAM,IAAI,GAAI,OAAO,OAAO,KAAG,OAAO,GAAG,SAA2D,CAAA;AAE3G,eAAO,MAAM,GAAG,GAAI,OAAO,OAAO,KAAG,SAAS,OAAO,EAAuC,CAAA;AAE5F,4CAA4C;AAC5C,eAAO,MAAM,OAAO,GAAI,OAAO,OAAO,KAAG,SAAS,MAAM,EAA2E,CAAA;AAEnI,eAAO,MAAM,SAAS,GAAI,OAAO,OAAO,KAAG,MAAgE,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Narrowing helpers for the untyped app-server JSON (the counterpart of
|
|
3
|
+
* `claude/narrow.ts`). The generated protocol types only annotate call
|
|
4
|
+
* sites; every value read at run time goes through these (a `bigint` field
|
|
5
|
+
* of a generated type is a plain JSON number on the wire).
|
|
6
|
+
*/
|
|
7
|
+
/** A plain object (not an array), else undefined. */
|
|
8
|
+
export const rec = (value) => typeof value === 'object' && value !== null && !Array.isArray(value) ? value : undefined;
|
|
9
|
+
export const str = (value) => typeof value === 'string' ? value : undefined;
|
|
10
|
+
/** A non-empty string, else undefined. */
|
|
11
|
+
export const text = (value) => typeof value === 'string' && value !== '' ? value : undefined;
|
|
12
|
+
/** A finite number, else undefined. */
|
|
13
|
+
export const num = (value) => typeof value === 'number' && Number.isFinite(value) ? value : undefined;
|
|
14
|
+
export const bool = (value) => typeof value === 'boolean' ? value : undefined;
|
|
15
|
+
export const arr = (value) => Array.isArray(value) ? value : [];
|
|
16
|
+
/** The string members of an array value. */
|
|
17
|
+
export const strings = (value) => arr(value).filter((item) => typeof item === 'string');
|
|
18
|
+
export const errorText = (error) => error instanceof Error ? error.message : String(error);
|