@bastani/atomic 0.9.40 → 0.9.41-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +75 -0
- package/README.md +1 -1
- package/dist/builtin/intercom/CHANGELOG.md +12 -0
- package/dist/builtin/intercom/README.md +1 -1
- package/dist/builtin/intercom/broker/broker.ts +24 -21
- package/dist/builtin/intercom/broker/client.ts +97 -6
- package/dist/builtin/intercom/broker/list-reply.ts +53 -0
- package/dist/builtin/intercom/index.bundle.mjs +278 -46
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/intercom/recoverable-disconnect.ts +27 -1
- package/dist/builtin/intercom/types.ts +8 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +14 -0
- package/dist/builtin/subagents/README.md +14 -0
- package/dist/builtin/subagents/package.json +3 -3
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +99 -19
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +33 -0
- package/dist/builtin/workflows/README.md +2 -0
- package/dist/builtin/workflows/builtin/adversarial-verification.js +2 -2
- package/dist/builtin/workflows/builtin/{chunk-qjqn389g.js → chunk-2jfst7e4.js} +72 -10
- package/dist/builtin/workflows/builtin/{chunk-4bwtzyjq.js → chunk-49kkbdpr.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-qdd897wm.js → chunk-apagcs4r.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-454hz1qt.js → chunk-dcxscfnb.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-bjva9j5k.js → chunk-hx8v4p97.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-85mx6wcf.js → chunk-k5q3t7je.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-8kkv04hz.js → chunk-n2gkzkty.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-y45tkftg.js → chunk-txbc93t6.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-x0vvjyzg.js → chunk-w4xp1w1f.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-5eh0brtd.js → chunk-z3pajrfs.js} +1 -1
- package/dist/builtin/workflows/builtin/classify-and-act.js +2 -2
- package/dist/builtin/workflows/builtin/fan-out-and-synthesize.js +2 -2
- package/dist/builtin/workflows/builtin/generate-and-filter.js +2 -2
- package/dist/builtin/workflows/builtin/goal.js +2 -2
- package/dist/builtin/workflows/builtin/index.js +10 -10
- package/dist/builtin/workflows/builtin/loop-until-done.js +2 -2
- package/dist/builtin/workflows/builtin/open-claude-design.js +2 -2
- package/dist/builtin/workflows/builtin/ralph.js +2 -2
- package/dist/builtin/workflows/builtin/tournament.js +2 -2
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/src/authoring.d.ts +1 -1
- package/dist/builtin/workflows/src/durable/journal/internal.d.ts +16 -0
- package/dist/builtin/workflows/src/durable/journal/legacy-journal-tables.d.ts +9 -0
- package/dist/builtin/workflows/src/durable/journal/sql-run-journal.d.ts +6 -0
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +950 -116
- package/dist/builtin/workflows/src/index.js +806 -131
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +17 -1
- package/dist/cli/credential-print.d.ts.map +1 -1
- package/dist/cli/credential-print.js +1 -1
- package/dist/cli/credential-print.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts +2 -1
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +33 -18
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +2 -1
- package/dist/core/agent-session-methods.d.ts.map +1 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +114 -21
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +6 -0
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-state.d.ts +19 -1
- package/dist/core/agent-session-state.d.ts.map +1 -1
- package/dist/core/agent-session-state.js +41 -6
- package/dist/core/agent-session-state.js.map +1 -1
- package/dist/core/auth-storage-backends.d.ts +3 -1
- package/dist/core/auth-storage-backends.d.ts.map +1 -1
- package/dist/core/auth-storage-backends.js +79 -12
- package/dist/core/auth-storage-backends.js.map +1 -1
- package/dist/core/client-identity.d.ts +8 -0
- package/dist/core/client-identity.d.ts.map +1 -0
- package/dist/core/client-identity.js +16 -0
- package/dist/core/client-identity.js.map +1 -0
- package/dist/core/compaction/planner-outcome.d.ts.map +1 -1
- package/dist/core/compaction/planner-outcome.js +2 -1
- package/dist/core/compaction/planner-outcome.js.map +1 -1
- package/dist/core/execution-model-router.d.ts +18 -0
- package/dist/core/execution-model-router.d.ts.map +1 -1
- package/dist/core/execution-model-router.js +14 -8
- package/dist/core/execution-model-router.js.map +1 -1
- package/dist/core/extension-oauth-refresh-rejection.d.ts +12 -0
- package/dist/core/extension-oauth-refresh-rejection.d.ts.map +1 -0
- package/dist/core/extension-oauth-refresh-rejection.js +70 -0
- package/dist/core/extension-oauth-refresh-rejection.js.map +1 -0
- package/dist/core/extension-startup-failure.d.ts +30 -0
- package/dist/core/extension-startup-failure.d.ts.map +1 -0
- package/dist/core/extension-startup-failure.js +62 -0
- package/dist/core/extension-startup-failure.js.map +1 -0
- package/dist/core/extensions/context-types.d.ts +2 -0
- package/dist/core/extensions/context-types.d.ts.map +1 -1
- package/dist/core/extensions/context-types.js.map +1 -1
- package/dist/core/extensions/provider-types.d.ts +2 -0
- package/dist/core/extensions/provider-types.d.ts.map +1 -1
- package/dist/core/extensions/provider-types.js.map +1 -1
- package/dist/core/extensions/runner-context.d.ts +1 -0
- package/dist/core/extensions/runner-context.d.ts.map +1 -1
- package/dist/core/extensions/runner-context.js +8 -0
- package/dist/core/extensions/runner-context.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +3 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/runtime-types.d.ts +1 -0
- package/dist/core/extensions/runtime-types.d.ts.map +1 -1
- package/dist/core/extensions/runtime-types.js.map +1 -1
- package/dist/core/extensions/workflow-run-control-hub.d.ts +1 -0
- package/dist/core/extensions/workflow-run-control-hub.d.ts.map +1 -1
- package/dist/core/extensions/workflow-run-control-hub.js +3 -0
- package/dist/core/extensions/workflow-run-control-hub.js.map +1 -1
- package/dist/core/extensions/workflow-run-control.d.ts +8 -0
- package/dist/core/extensions/workflow-run-control.d.ts.map +1 -1
- package/dist/core/extensions/workflow-run-control.js.map +1 -1
- package/dist/core/model-config.d.ts +28 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-fallback-failures.d.ts.map +1 -1
- package/dist/core/model-fallback-failures.js +12 -0
- package/dist/core/model-fallback-failures.js.map +1 -1
- package/dist/core/model-resolver-defaults.js +1 -1
- package/dist/core/model-resolver-defaults.js.map +1 -1
- package/dist/core/model-runtime-streaming.d.ts.map +1 -1
- package/dist/core/model-runtime-streaming.js +9 -3
- package/dist/core/model-runtime-streaming.js.map +1 -1
- package/dist/core/model-runtime.d.ts +5 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +6 -0
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/provider-composer-internal.d.ts +8 -6
- package/dist/core/provider-composer-internal.d.ts.map +1 -1
- package/dist/core/provider-composer-internal.js +21 -8
- package/dist/core/provider-composer-internal.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +12 -4
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/storage/session/sql-session-store.d.ts +35 -0
- package/dist/core/storage/session/sql-session-store.d.ts.map +1 -1
- package/dist/core/storage/session/sql-session-store.js +158 -42
- package/dist/core/storage/session/sql-session-store.js.map +1 -1
- package/dist/core/structured-output/deadline.d.ts +40 -0
- package/dist/core/structured-output/deadline.d.ts.map +1 -0
- package/dist/core/structured-output/deadline.js +110 -0
- package/dist/core/structured-output/deadline.js.map +1 -0
- package/dist/core/structured-output/index.d.ts.map +1 -1
- package/dist/core/structured-output/index.js +103 -47
- package/dist/core/structured-output/index.js.map +1 -1
- package/dist/core/structured-output/rejection-detail.d.ts +9 -0
- package/dist/core/structured-output/rejection-detail.d.ts.map +1 -0
- package/dist/core/structured-output/rejection-detail.js +129 -0
- package/dist/core/structured-output/rejection-detail.js.map +1 -0
- package/dist/core/structured-output/types.d.ts +8 -1
- package/dist/core/structured-output/types.d.ts.map +1 -1
- package/dist/core/structured-output/types.js.map +1 -1
- package/dist/core/tasks/completion.d.ts +7 -1
- package/dist/core/tasks/completion.d.ts.map +1 -1
- package/dist/core/tasks/completion.js +28 -6
- package/dist/core/tasks/completion.js.map +1 -1
- package/dist/core/tasks/contracts.d.ts +6 -1
- package/dist/core/tasks/contracts.d.ts.map +1 -1
- package/dist/core/tasks/contracts.js.map +1 -1
- package/dist/core/tasks/pause.d.ts +2 -1
- package/dist/core/tasks/pause.d.ts.map +1 -1
- package/dist/core/tasks/pause.js +3 -2
- package/dist/core/tasks/pause.js.map +1 -1
- package/dist/core/tools/bash-pty-native.d.ts.map +1 -1
- package/dist/core/tools/bash-pty-native.js +10 -5
- package/dist/core/tools/bash-pty-native.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +16 -32
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/grep.js +1 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/kill.d.ts.map +1 -1
- package/dist/core/tools/kill.js +17 -3
- package/dist/core/tools/kill.js.map +1 -1
- package/dist/core/tools/shell-task-render.d.ts +55 -0
- package/dist/core/tools/shell-task-render.d.ts.map +1 -0
- package/dist/core/tools/shell-task-render.js +123 -0
- package/dist/core/tools/shell-task-render.js.map +1 -0
- package/dist/core/tools/shell-task-status.d.ts +52 -0
- package/dist/core/tools/shell-task-status.d.ts.map +1 -0
- package/dist/core/tools/shell-task-status.js +184 -0
- package/dist/core/tools/shell-task-status.js.map +1 -0
- package/dist/core/tools/structured-output.d.ts +5 -0
- package/dist/core/tools/structured-output.d.ts.map +1 -1
- package/dist/core/tools/structured-output.js +3 -0
- package/dist/core/tools/structured-output.js.map +1 -1
- package/dist/extensions/codemode/execute.d.ts.map +1 -1
- package/dist/extensions/codemode/execute.js +134 -57
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/mcp/config.d.ts.map +1 -1
- package/dist/extensions/mcp/config.js +3 -2
- package/dist/extensions/mcp/config.js.map +1 -1
- package/dist/index-extensions.d.ts +1 -0
- package/dist/index-extensions.d.ts.map +1 -1
- package/dist/index-extensions.js +3 -0
- package/dist/index-extensions.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +19 -6
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/task-row.d.ts.map +1 -1
- package/dist/modes/interactive/components/task-row.js +11 -1
- package/dist/modes/interactive/components/task-row.js.map +1 -1
- package/dist/modes/interactive/interactive-auth-routing.js +12 -10
- package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-custom-ui.js +20 -30
- package/dist/modes/interactive/interactive-extension-custom-ui.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-dialogs.js +23 -96
- package/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js +7 -8
- package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +27 -4
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts +20 -10
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +40 -5
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.js +1 -1
- package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +2 -4
- package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-types.d.ts +4 -1
- package/dist/modes/interactive/interactive-mode-types.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-types.js.map +1 -1
- package/dist/modes/interactive/interactive-prompt-restore.d.ts +3 -0
- package/dist/modes/interactive/interactive-prompt-restore.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-prompt-restore.js +9 -1
- package/dist/modes/interactive/interactive-prompt-restore.js.map +1 -1
- package/dist/modes/interactive/interactive-prompt-turn.js +30 -2
- package/dist/modes/interactive/interactive-prompt-turn.js.map +1 -1
- package/dist/modes/interactive/interactive-queueing.js +43 -8
- package/dist/modes/interactive/interactive-queueing.js.map +1 -1
- package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +12 -3
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive/theme/color-utils.d.ts +6 -1
- package/dist/modes/interactive/theme/color-utils.d.ts.map +1 -1
- package/dist/modes/interactive/theme/color-utils.js +39 -17
- package/dist/modes/interactive/theme/color-utils.js.map +1 -1
- package/dist/modes/interactive/theme/theme-class.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-class.js +2 -2
- package/dist/modes/interactive/theme/theme-class.js.map +1 -1
- package/dist/modes/interactive/theme/theme-tokens.d.ts +6 -0
- package/dist/modes/interactive/theme/theme-tokens.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-tokens.js +7 -3
- package/dist/modes/interactive/theme/theme-tokens.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-auth.d.ts +3 -0
- package/dist/modes/interactive-engine/isolated-auth.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-auth.js +13 -1
- package/dist/modes/interactive-engine/isolated-auth.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +11 -2
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/remote-model-catalog.d.ts +8 -0
- package/dist/modes/interactive-engine/remote-model-catalog.d.ts.map +1 -1
- package/dist/modes/interactive-engine/remote-model-catalog.js +54 -0
- package/dist/modes/interactive-engine/remote-model-catalog.js.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.js +4 -13
- package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-model-catalog.d.ts +9 -0
- package/dist/modes/rpc/rpc-model-catalog.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-model-catalog.js +19 -0
- package/dist/modes/rpc/rpc-model-catalog.js.map +1 -0
- package/dist/modes/rpc/rpc-provider-auth.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-provider-auth.js +2 -6
- package/dist/modes/rpc/rpc-provider-auth.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +6 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/utils/changelog.d.ts +6 -0
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js +11 -0
- package/dist/utils/changelog.js.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +4 -0
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +3 -2
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/background-tasks.md +5 -3
- package/docs/codemode.md +2 -2
- package/docs/custom-provider/oauth.md +42 -1
- package/docs/custom-provider/registration.md +2 -0
- package/docs/environment-variables.md +1 -0
- package/docs/extensions/api-reference.md +3 -4
- package/docs/extensions/authoring.md +1 -1
- package/docs/extensions/events.md +1 -1
- package/docs/models-configuration.md +9 -0
- package/docs/models.md +3 -1
- package/docs/providers.md +4 -4
- package/docs/rpc/protocol.md +4 -2
- package/docs/sdk/reference.md +2 -0
- package/docs/sdk/structured-decisions.md +7 -5
- package/docs/sdk.md +5 -2
- package/docs/settings.md +4 -2
- package/docs/subagents/reference.md +1 -1
- package/docs/subagents.md +15 -1
- package/docs/themes/reference.md +3 -1
- package/docs/usage.md +3 -1
- package/docs/workflows/api-reference.md +28 -0
- package/docs/workflows/authoring.md +1 -1
- package/docs/workflows/operations.md +2 -2
- package/npm-shrinkwrap.json +67 -54
- package/package.json +6 -6
- package/schemas/models.schema.json +21 -0
- package/dist/core/provider-attribution.d.ts +0 -4
- package/dist/core/provider-attribution.d.ts.map +0 -1
- package/dist/core/provider-attribution.js +0 -87
- package/dist/core/provider-attribution.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-tokens.js","sourceRoot":"","sources":["../../../../src/modes/interactive/theme/theme-tokens.ts"],"names":[],"mappings":"AASA,SAAS,iBAAiB,CAAwC,MAAS;IAC1E,KAAK,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CA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C;QAClE,IAAI,CAAC,CAAC,UAAU,IAAI,UAAU,CAAC;YAAE,SAAS;QAC1C,MAAM,IAAI,GAAG,OAAqB,CAAC;QACnC,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,SAAS;YAAE,SAAS;QAC3C,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAsB,CAAC;QACnD,MAAM,aAAa,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACzC,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,eAAe,OAAO,4BAA4B,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC1F,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC;IAChC,CAAC;IACD,OAAO,QAA2C,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAiD;IAIjF,MAAM,QAAQ,GAAG,EAAyC,CAAC;IAC3D,MAAM,QAAQ,GAAG,EAAsC,CAAC;IACxD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACnD,MAAM,KAAK,GAAqC,YAAY,CAAC,GAAiB,CAAC,CAAC;QAChF,IAAI,KAAK,KAAK,SAAS;YAAE,SAAS;QAClC,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YACjC,QAAQ,CAAC,GAAc,CAAC,GAAG,KAAK,CAAC;QAClC,CAAC;aAAM,CAAC;YACP,QAAQ,CAAC,GAAiB,CAAC,GAAG,KAAK,CAAC;QACrC,CAAC;IACF,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AAC/B,CAAC","sourcesContent":["export interface ThemeTokenDescriptor {\n\tslot: \"foreground\" | \"background\";\n\tdescription: string;\n\t/** Token in the same slot that supplies this token's color when a theme omits it. */\n\tfallback?: string;\n}\n\nexport type ThemeTokenDescriptors = Readonly<Record<string, ThemeTokenDescriptor>>;\n\nfunction defineThemeTokens<const T extends ThemeTokenDescriptors>(tokens: T): T {\n\tfor (const [name, descriptor] of Object.entries(tokens)) {\n\t\tif (descriptor.fallback === undefined) continue;\n\t\tconst fallback = tokens[descriptor.fallback];\n\t\tif (fallback === undefined) {\n\t\t\tthrow new Error(`Theme token ${name} has unknown fallback ${descriptor.fallback}`);\n\t\t}\n\t\tif (fallback.slot !== descriptor.slot) {\n\t\t\tthrow new Error(`Theme token ${name} has fallback ${descriptor.fallback} in a different color slot`);\n\t\t}\n\t}\n\treturn tokens;\n}\n\n/**\n * Theme token metadata in the same order used by theme files and the published JSON Schema.\n * A token with a `fallback` is optional: a theme written before the token existed keeps validating and\n * keeps rendering with the fallback token's color.\n */\nexport const THEME_TOKENS = defineThemeTokens({\n\taccent: { slot: \"foreground\", description: \"Primary accent color (logo, selected items, cursor)\" },\n\tborder: { slot: \"foreground\", description: \"Normal borders\" },\n\tborderAccent: { slot: \"foreground\", description: \"Highlighted borders\" },\n\tborderMuted: { slot: \"foreground\", description: \"Subtle borders\" },\n\tsuccess: { slot: \"foreground\", description: \"Success states\" },\n\terror: { slot: \"foreground\", description: \"Error states\" },\n\twarning: { slot: \"foreground\", description: \"Warning states\" },\n\tmuted: { slot: \"foreground\", description: \"Secondary/dimmed text\" },\n\tdim: { slot: \"foreground\", description: \"Very dimmed text (more subtle than muted)\" },\n\ttext: { slot: \"foreground\", description: \"Default text color (usually empty string)\" },\n\tthinkingText: { slot: \"foreground\", description: \"Thinking block text color\" },\n\tselectedBg: { slot: \"background\", description: \"Selected item background\" },\n\tscrollbarThumb: {\n\t\tslot: \"background\",\n\t\tdescription: \"Fullscreen scrollbar thumb background (falls back to selectedBg when omitted)\",\n\t\tfallback: \"selectedBg\",\n\t},\n\tsearchMatchBg: {\n\t\tslot: \"background\",\n\t\tdescription: \"Transcript search match background and current-match text (falls back to selectedBg when omitted)\",\n\t\tfallback: \"selectedBg\",\n\t},\n\tsearchMatchText: {\n\t\tslot: \"foreground\",\n\t\tdescription: \"Transcript search match text and current-match background (falls back to text when omitted)\",\n\t\tfallback: \"text\",\n\t},\n\tuserMessageBg: { slot: \"background\", description: \"User message background\" },\n\tuserMessageText: { slot: \"foreground\", description: \"User message text color\" },\n\tcustomMessageBg: { slot: \"background\", description: \"Custom message background (hook-injected messages)\" },\n\tcustomMessageText: { slot: \"foreground\", description: \"Custom message text color\" },\n\tcustomMessageLabel: { slot: \"foreground\", description: \"Custom message type label color\" },\n\ttoolPendingBg: { slot: \"background\", description: \"Tool execution box (pending state)\" },\n\ttoolSuccessBg: { slot: \"background\", description: \"Tool execution box (success state)\" },\n\ttoolErrorBg: { slot: \"background\", description: \"Tool execution box (error state)\" },\n\ttoolTitle: { slot: \"foreground\", description: \"Tool execution box title color\" },\n\ttoolOutput: { slot: \"foreground\", description: \"Tool execution box output text color\" },\n\tmdHeading: { slot: \"foreground\", description: \"Markdown heading text\" },\n\tmdLink: { slot: \"foreground\", description: \"Markdown link text\" },\n\tmdLinkUrl: { slot: \"foreground\", description: \"Markdown link URL\" },\n\tmdCode: { slot: \"foreground\", description: \"Markdown inline code\" },\n\tmdCodeBlock: { slot: \"foreground\", description: \"Markdown code block content\" },\n\tmdCodeBlockBorder: { slot: \"foreground\", description: \"Markdown code block fences\" },\n\tmdQuote: { slot: \"foreground\", description: \"Markdown blockquote text\" },\n\tmdQuoteBorder: { slot: \"foreground\", description: \"Markdown blockquote border\" },\n\tmdHr: { slot: \"foreground\", description: \"Markdown horizontal rule\" },\n\tmdListBullet: { slot: \"foreground\", description: \"Markdown list bullets/numbers\" },\n\ttoolDiffAdded: { slot: \"foreground\", description: \"Added lines in tool diffs\" },\n\ttoolDiffRemoved: { slot: \"foreground\", description: \"Removed lines in tool diffs\" },\n\ttoolDiffContext: { slot: \"foreground\", description: \"Context lines in tool diffs\" },\n\tsyntaxComment: { slot: \"foreground\", description: \"Syntax highlighting: comments\" },\n\tsyntaxKeyword: { slot: \"foreground\", description: \"Syntax highlighting: keywords\" },\n\tsyntaxFunction: { slot: \"foreground\", description: \"Syntax highlighting: function names\" },\n\tsyntaxVariable: { slot: \"foreground\", description: \"Syntax highlighting: variable names\" },\n\tsyntaxString: { slot: \"foreground\", description: \"Syntax highlighting: string literals\" },\n\tsyntaxNumber: { slot: \"foreground\", description: \"Syntax highlighting: number literals\" },\n\tsyntaxType: { slot: \"foreground\", description: \"Syntax highlighting: type names\" },\n\tsyntaxOperator: { slot: \"foreground\", description: \"Syntax highlighting: operators\" },\n\tsyntaxPunctuation: { slot: \"foreground\", description: \"Syntax highlighting: punctuation\" },\n\tthinkingOff: { slot: \"foreground\", description: \"Thinking level border: off\" },\n\tthinkingMinimal: { slot: \"foreground\", description: \"Thinking level border: minimal\" },\n\tthinkingLow: { slot: \"foreground\", description: \"Thinking level border: low\" },\n\tthinkingMedium: { slot: \"foreground\", description: \"Thinking level border: medium\" },\n\tthinkingHigh: { slot: \"foreground\", description: \"Thinking level border: high\" },\n\tthinkingXhigh: { slot: \"foreground\", description: \"Thinking level border: xhigh (OpenAI codex-max only)\" },\n\tbashMode: { slot: \"foreground\", description: \"Editor border color in bash mode\" },\n});\n\nexport type ThemeToken = keyof typeof THEME_TOKENS;\nexport type ThemeColor = {\n\t[K in ThemeToken]: (typeof THEME_TOKENS)[K][\"slot\"] extends \"foreground\" ? K : never;\n}[ThemeToken];\nexport type ThemeBg = Exclude<ThemeToken, ThemeColor>;\n\ntype OptionalToken = {\n\t[K in ThemeToken]: (typeof THEME_TOKENS)[K] extends { fallback: string } ? K : never;\n}[ThemeToken];\n\ntype RequiredToken = Exclude<ThemeToken, OptionalToken>;\n\nexport type ThemeColorValues<Value> = {\n\t[K in RequiredToken]: Value;\n} & {\n\t[K in OptionalToken]?: Value;\n};\n\nexport type ResolvedThemeColorValues<Value> = Record<ThemeToken, Value>;\n\n/** Fill omitted optional tokens from their fallback tokens. */\nexport function withThemeTokenFallbacks<Value>(values: ThemeColorValues<Value>): ResolvedThemeColorValues<Value> {\n\tconst resolved = { ...values } as Partial<ResolvedThemeColorValues<Value>>;\n\tfor (const [rawName, descriptor] of Object.entries(THEME_TOKENS)) {\n\t\tif (!(\"fallback\" in descriptor)) continue;\n\t\tconst name = rawName as ThemeToken;\n\t\tif (resolved[name] !== undefined) continue;\n\t\tconst fallback = descriptor.fallback as ThemeToken;\n\t\tconst fallbackValue = resolved[fallback];\n\t\tif (fallbackValue === undefined) {\n\t\t\tthrow new Error(`Theme token ${rawName} has unresolved fallback ${descriptor.fallback}`);\n\t\t}\n\t\tresolved[name] = fallbackValue;\n\t}\n\treturn resolved as ResolvedThemeColorValues<Value>;\n}\n\n/**\n * Split resolved token values into the foreground and background slots. Generated system themes also carry\n * palette entries that theme files cannot set; those are not tokens and are left out.\n */\nexport function splitThemeColors(colors: ResolvedThemeColorValues<string | number>): {\n\tfgColors: Record<ThemeColor, string | number>;\n\tbgColors: Record<ThemeBg, string | number>;\n} {\n\tconst fgColors = {} as Record<ThemeColor, string | number>;\n\tconst bgColors = {} as Record<ThemeBg, string | number>;\n\tfor (const [key, value] of Object.entries(colors)) {\n\t\tconst token: ThemeTokenDescriptor | undefined = THEME_TOKENS[key as ThemeToken];\n\t\tif (token === undefined) continue;\n\t\tif (token.slot === \"background\") {\n\t\t\tbgColors[key as ThemeBg] = value;\n\t\t} else {\n\t\t\tfgColors[key as ThemeColor] = value;\n\t\t}\n\t}\n\treturn { fgColors, bgColors };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"theme-tokens.js","sourceRoot":"","sources":["../../../../src/modes/interactive/theme/theme-tokens.ts"],"names":[],"mappings":"AAWA,SAAS,iBAAiB,CAAwC,MAAS;IAC1E,KAAK,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACzD,IAAI,UAAU,CAAC,QAAQ,KAAK,SAAS;YAAE,SAAS;QAChD,MAAM,QAAQ,GAAG,MAA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ourcesContent":["export interface ThemeTokenDescriptor {\n\tslot: \"foreground\" | \"background\";\n\tdescription: string;\n\t/** Token in the same slot that supplies this token's color when a theme omits it. */\n\tfallback?: string;\n\t/** A status color: in 256-color mode it keeps its hue instead of collapsing to the nearest gray. */\n\tstatus?: true;\n}\n\nexport type ThemeTokenDescriptors = Readonly<Record<string, ThemeTokenDescriptor>>;\n\nfunction defineThemeTokens<const T extends ThemeTokenDescriptors>(tokens: T): T {\n\tfor (const [name, descriptor] of Object.entries(tokens)) {\n\t\tif (descriptor.fallback === undefined) continue;\n\t\tconst fallback = tokens[descriptor.fallback];\n\t\tif (fallback === undefined) {\n\t\t\tthrow new Error(`Theme token ${name} has unknown fallback ${descriptor.fallback}`);\n\t\t}\n\t\tif (fallback.slot !== descriptor.slot) {\n\t\t\tthrow new Error(`Theme token ${name} has fallback ${descriptor.fallback} in a different color slot`);\n\t\t}\n\t}\n\treturn tokens;\n}\n\n/**\n * Theme token metadata in the same order used by theme files and the published JSON Schema.\n * A token with a `fallback` is optional: a theme written before the token existed keeps validating and\n * keeps rendering with the fallback token's color.\n */\nexport const THEME_TOKENS = defineThemeTokens({\n\taccent: { slot: \"foreground\", description: \"Primary accent color (logo, selected items, cursor)\" },\n\tborder: { slot: \"foreground\", description: \"Normal borders\" },\n\tborderAccent: { slot: \"foreground\", description: \"Highlighted borders\" },\n\tborderMuted: { slot: \"foreground\", description: \"Subtle borders\" },\n\tsuccess: { slot: \"foreground\", description: \"Success states\" },\n\terror: { slot: \"foreground\", description: \"Error states\" },\n\twarning: { slot: \"foreground\", description: \"Warning states\" },\n\tmuted: { slot: \"foreground\", description: \"Secondary/dimmed text\" },\n\tdim: { slot: \"foreground\", description: \"Very dimmed text (more subtle than muted)\" },\n\ttext: { slot: \"foreground\", description: \"Default text color (usually empty string)\" },\n\tthinkingText: { slot: \"foreground\", description: \"Thinking block text color\" },\n\tselectedBg: { slot: \"background\", description: \"Selected item background\" },\n\tscrollbarThumb: {\n\t\tslot: \"background\",\n\t\tdescription: \"Fullscreen scrollbar thumb background (falls back to selectedBg when omitted)\",\n\t\tfallback: \"selectedBg\",\n\t},\n\tsearchMatchBg: {\n\t\tslot: \"background\",\n\t\tdescription: \"Transcript search match background and current-match text (falls back to selectedBg when omitted)\",\n\t\tfallback: \"selectedBg\",\n\t},\n\tsearchMatchText: {\n\t\tslot: \"foreground\",\n\t\tdescription: \"Transcript search match text and current-match background (falls back to text when omitted)\",\n\t\tfallback: \"text\",\n\t},\n\tuserMessageBg: { slot: \"background\", description: \"User message background\" },\n\tuserMessageText: { slot: \"foreground\", description: \"User message text color\" },\n\tcustomMessageBg: { slot: \"background\", description: \"Custom message background (hook-injected messages)\" },\n\tcustomMessageText: { slot: \"foreground\", description: \"Custom message text color\" },\n\tcustomMessageLabel: { slot: \"foreground\", description: \"Custom message type label color\" },\n\ttoolPendingBg: { slot: \"background\", description: \"Tool execution box (pending state)\", status: true },\n\ttoolSuccessBg: { slot: \"background\", description: \"Tool execution box (success state)\", status: true },\n\ttoolErrorBg: { slot: \"background\", description: \"Tool execution box (error state)\", status: true },\n\ttoolTitle: { slot: \"foreground\", description: \"Tool execution box title color\" },\n\ttoolOutput: { slot: \"foreground\", description: \"Tool execution box output text color\" },\n\tmdHeading: { slot: \"foreground\", description: \"Markdown heading text\" },\n\tmdLink: { slot: \"foreground\", description: \"Markdown link text\" },\n\tmdLinkUrl: { slot: \"foreground\", description: \"Markdown link URL\" },\n\tmdCode: { slot: \"foreground\", description: \"Markdown inline code\" },\n\tmdCodeBlock: { slot: \"foreground\", description: \"Markdown code block content\" },\n\tmdCodeBlockBorder: { slot: \"foreground\", description: \"Markdown code block fences\" },\n\tmdQuote: { slot: \"foreground\", description: \"Markdown blockquote text\" },\n\tmdQuoteBorder: { slot: \"foreground\", description: \"Markdown blockquote border\" },\n\tmdHr: { slot: \"foreground\", description: \"Markdown horizontal rule\" },\n\tmdListBullet: { slot: \"foreground\", description: \"Markdown list bullets/numbers\" },\n\ttoolDiffAdded: { slot: \"foreground\", description: \"Added lines in tool diffs\" },\n\ttoolDiffRemoved: { slot: \"foreground\", description: \"Removed lines in tool diffs\" },\n\ttoolDiffContext: { slot: \"foreground\", description: \"Context lines in tool diffs\" },\n\tsyntaxComment: { slot: \"foreground\", description: \"Syntax highlighting: comments\" },\n\tsyntaxKeyword: { slot: \"foreground\", description: \"Syntax highlighting: keywords\" },\n\tsyntaxFunction: { slot: \"foreground\", description: \"Syntax highlighting: function names\" },\n\tsyntaxVariable: { slot: \"foreground\", description: \"Syntax highlighting: variable names\" },\n\tsyntaxString: { slot: \"foreground\", description: \"Syntax highlighting: string literals\" },\n\tsyntaxNumber: { slot: \"foreground\", description: \"Syntax highlighting: number literals\" },\n\tsyntaxType: { slot: \"foreground\", description: \"Syntax highlighting: type names\" },\n\tsyntaxOperator: { slot: \"foreground\", description: \"Syntax highlighting: operators\" },\n\tsyntaxPunctuation: { slot: \"foreground\", description: \"Syntax highlighting: punctuation\" },\n\tthinkingOff: { slot: \"foreground\", description: \"Thinking level border: off\" },\n\tthinkingMinimal: { slot: \"foreground\", description: \"Thinking level border: minimal\" },\n\tthinkingLow: { slot: \"foreground\", description: \"Thinking level border: low\" },\n\tthinkingMedium: { slot: \"foreground\", description: \"Thinking level border: medium\" },\n\tthinkingHigh: { slot: \"foreground\", description: \"Thinking level border: high\" },\n\tthinkingXhigh: { slot: \"foreground\", description: \"Thinking level border: xhigh (OpenAI codex-max only)\" },\n\tbashMode: { slot: \"foreground\", description: \"Editor border color in bash mode\" },\n});\n\nexport type ThemeToken = keyof typeof THEME_TOKENS;\nexport type ThemeColor = {\n\t[K in ThemeToken]: (typeof THEME_TOKENS)[K][\"slot\"] extends \"foreground\" ? K : never;\n}[ThemeToken];\nexport type ThemeBg = Exclude<ThemeToken, ThemeColor>;\n\ntype OptionalToken = {\n\t[K in ThemeToken]: (typeof THEME_TOKENS)[K] extends { fallback: string } ? K : never;\n}[ThemeToken];\n\ntype RequiredToken = Exclude<ThemeToken, OptionalToken>;\n\nexport type ThemeColorValues<Value> = {\n\t[K in RequiredToken]: Value;\n} & {\n\t[K in OptionalToken]?: Value;\n};\n\nexport type ResolvedThemeColorValues<Value> = Record<ThemeToken, Value>;\n\n/** Fill omitted optional tokens from their fallback tokens. */\nexport function withThemeTokenFallbacks<Value>(values: ThemeColorValues<Value>): ResolvedThemeColorValues<Value> {\n\tconst resolved = { ...values } as Partial<ResolvedThemeColorValues<Value>>;\n\tfor (const [rawName, descriptor] of Object.entries(THEME_TOKENS)) {\n\t\tif (!(\"fallback\" in descriptor)) continue;\n\t\tconst name = rawName as ThemeToken;\n\t\tif (resolved[name] !== undefined) continue;\n\t\tconst fallback = descriptor.fallback as ThemeToken;\n\t\tconst fallbackValue = resolved[fallback];\n\t\tif (fallbackValue === undefined) {\n\t\t\tthrow new Error(`Theme token ${rawName} has unresolved fallback ${descriptor.fallback}`);\n\t\t}\n\t\tresolved[name] = fallbackValue;\n\t}\n\treturn resolved as ResolvedThemeColorValues<Value>;\n}\n\n/**\n * Split resolved token values into the foreground and background slots. Generated system themes also carry\n * palette entries that theme files cannot set; those are not tokens and are left out.\n */\nexport function splitThemeColors(colors: ResolvedThemeColorValues<string | number>): {\n\tfgColors: Record<ThemeColor, string | number>;\n\tbgColors: Record<ThemeBg, string | number>;\n} {\n\tconst fgColors = {} as Record<ThemeColor, string | number>;\n\tconst bgColors = {} as Record<ThemeBg, string | number>;\n\tfor (const [key, value] of Object.entries(colors)) {\n\t\tconst token: ThemeTokenDescriptor | undefined = THEME_TOKENS[key as ThemeToken];\n\t\tif (token === undefined) continue;\n\t\tif (token.slot === \"background\") {\n\t\t\tbgColors[key as ThemeBg] = value;\n\t\t} else {\n\t\t\tfgColors[key as ThemeColor] = value;\n\t\t}\n\t}\n\treturn { fgColors, bgColors };\n}\n\nexport function isStatusToken(token: ThemeToken): boolean {\n\tconst descriptor: ThemeTokenDescriptor = THEME_TOKENS[token];\n\treturn descriptor.status === true;\n}\n"]}
|
|
@@ -19,6 +19,9 @@ export declare function loginIsolatedOAuthProvider(session: AgentSession, client
|
|
|
19
19
|
* deliberately skips the remote catalog refresh: catalog freshness belongs to
|
|
20
20
|
* /model's bounded background refresh, and a failed fetch would otherwise leave the
|
|
21
21
|
* key persisted in the engine while the frontend took the error branch.
|
|
22
|
+
*
|
|
23
|
+
* An extension provider is registered only in the engine, so its own login runs there and asks
|
|
24
|
+
* for the key through the engine's input form.
|
|
22
25
|
*/
|
|
23
26
|
export declare function loginIsolatedApiKeyProvider(session: AgentSession, client: RpcClient, catalog: RemoteModelCatalog, provider: string, interaction: AuthInteraction): Promise<{
|
|
24
27
|
modelsRefreshed: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isolated-auth.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive-engine/isolated-auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,KAAK,yBAAyB,EAA4B,MAAM,2BAA2B,CAAC;AAErG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,YAAY,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAE3E,6GAA6G;AAC7G,wBAAsB,0BAA0B,CAC/C,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,yBAAyB,GAClC,OAAO,CAAC;IAAE,eAAe,EAAE,IAAI,CAAA;CAAE,CAAC,CAUpC;AAED
|
|
1
|
+
{"version":3,"file":"isolated-auth.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive-engine/isolated-auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,KAAK,yBAAyB,EAA4B,MAAM,2BAA2B,CAAC;AAErG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,YAAY,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAE3E,6GAA6G;AAC7G,wBAAsB,0BAA0B,CAC/C,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,yBAAyB,GAClC,OAAO,CAAC;IAAE,eAAe,EAAE,IAAI,CAAA;CAAE,CAAC,CAUpC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,2BAA2B,CAChD,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,eAAe,GAC1B,OAAO,CAAC;IAAE,eAAe,EAAE,IAAI,CAAA;CAAE,CAAC,CAoBpC"}
|
|
@@ -24,13 +24,25 @@ export async function loginIsolatedOAuthProvider(session, client, catalog, provi
|
|
|
24
24
|
* deliberately skips the remote catalog refresh: catalog freshness belongs to
|
|
25
25
|
* /model's bounded background refresh, and a failed fetch would otherwise leave the
|
|
26
26
|
* key persisted in the engine while the frontend took the error branch.
|
|
27
|
+
*
|
|
28
|
+
* An extension provider is registered only in the engine, so its own login runs there and asks
|
|
29
|
+
* for the key through the engine's input form.
|
|
27
30
|
*/
|
|
28
31
|
export async function loginIsolatedApiKeyProvider(session, client, catalog, provider, interaction) {
|
|
29
32
|
const apiKeyAuth = session.modelRuntime.getProvider(provider)?.auth.apiKey;
|
|
30
|
-
if (!apiKeyAuth?.login)
|
|
33
|
+
if (!apiKeyAuth?.login && !catalog.hasEngineApiKeyLogin(provider)) {
|
|
31
34
|
throw new Error(`Provider does not support api_key login: ${provider}`);
|
|
35
|
+
}
|
|
32
36
|
const signal = operationSignal(interaction.signal);
|
|
33
37
|
signal.throwIfAborted();
|
|
38
|
+
if (!apiKeyAuth?.login) {
|
|
39
|
+
const result = await client.loginProvider(provider, signal);
|
|
40
|
+
if (result.cancelled)
|
|
41
|
+
throw normalizeOAuthLoginError(signal.reason ?? new Error("Login cancelled"), signal);
|
|
42
|
+
catalog.apply(result);
|
|
43
|
+
await session.modelRuntime.reloadCredentials({ refreshAvailability: false });
|
|
44
|
+
return { modelsRefreshed: true };
|
|
45
|
+
}
|
|
34
46
|
const credential = await raceWithAbortSignal(apiKeyAuth.login({ ...interaction, signal }), signal);
|
|
35
47
|
if (signal.aborted)
|
|
36
48
|
throw normalizeOAuthLoginError(signal.reason ?? new Error("Login cancelled"), signal);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isolated-auth.js","sourceRoot":"","sources":["../../../src/modes/interactive-engine/isolated-auth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkC,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrG,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAKnE,6GAA6G;AAC7G,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC/C,OAAqB,EACrB,MAAiB,EACjB,OAA2B,EAC3B,QAAgB,EAChB,SAAoC;IAEpC,MAAM,aAAa,GAAG,MAAM,qBAAqB,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC/E,IAAI,aAAa,CAAC,SAAS,EAAE,CAAC;QAC7B,MAAM,wBAAwB,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,IAAI,IAAI,KAAK,CAAC,iBAAiB,CAAC,EA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M,aAAa,GAAG,MAAM,MAAM,CAAC,sBAAsB,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3G,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAC7B,MAAM,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,EAAE,mBAAmB,EAAE,KAAK,EAAE,CAAC,CAAC;IAC7E,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC;AAClC,CAAC","sourcesContent":["import type { AuthInteraction } from \"@bastani/pi-ai\";\nimport type { AgentSession } from \"../../core/agent-session.js\";\nimport { type AtomicOAuthLoginCallbacks, normalizeOAuthLoginError } from \"../../core/oauth-login.ts\";\nimport { operationSignal, raceWithAbortSignal } from \"../../utils/abort.js\";\nimport type { RpcClient } from \"../rpc/rpc-client.ts\";\nimport { loginRpcOAuthProvider } from \"../rpc/rpc-oauth-client.ts\";\nimport type { RemoteModelCatalog } from \"./remote-model-catalog.ts\";\n\nexport type { AtomicOAuthLoginCallbacks } from \"../../core/oauth-login.ts\";\n\n/** Acquire and persist OAuth entirely in the engine, transporting only UI callbacks and catalog metadata. */\nexport async function loginIsolatedOAuthProvider(\n\tsession: AgentSession,\n\tclient: RpcClient,\n\tcatalog: RemoteModelCatalog,\n\tprovider: string,\n\tcallbacks: AtomicOAuthLoginCallbacks,\n): Promise<{ modelsRefreshed: true }> {\n\tconst remoteCatalog = await loginRpcOAuthProvider(client, provider, callbacks);\n\tif (remoteCatalog.cancelled) {\n\t\tthrow normalizeOAuthLoginError(callbacks.signal?.reason ?? new Error(\"Login cancelled\"), callbacks.signal);\n\t}\n\tcatalog.apply(remoteCatalog);\n\t// The engine owns persistence. Refresh the frontend snapshot only after its\n\t// credential transaction and catalog refresh both complete successfully.\n\tawait session.modelRuntime.reloadCredentials({ refreshAvailability: false });\n\treturn { modelsRefreshed: true };\n}\n\n/**\n * Acquire an API key with the frontend's login dialog, then persist it in the engine.\n *\n * The engine owns credential storage for the isolated runtime, so the frontend\n * only collects the key and adopts the engine's catalog and credential snapshot\n * afterwards. A dialog cancelled before the engine save is sent persists nothing on\n * either side; once the save is in flight it completes and the login is reported, the\n * same commit point the local credential store uses. The engine save\n * deliberately skips the remote catalog refresh: catalog freshness belongs to\n * /model's bounded background refresh, and a failed fetch would otherwise leave the\n * key persisted in the engine while the frontend took the error branch.\n *\n * An extension provider is registered only in the engine, so its own login runs there and asks\n * for the key through the engine's input form.\n */\nexport async function loginIsolatedApiKeyProvider(\n\tsession: AgentSession,\n\tclient: RpcClient,\n\tcatalog: RemoteModelCatalog,\n\tprovider: string,\n\tinteraction: AuthInteraction,\n): Promise<{ modelsRefreshed: true }> {\n\tconst apiKeyAuth = session.modelRuntime.getProvider(provider)?.auth.apiKey;\n\tif (!apiKeyAuth?.login && !catalog.hasEngineApiKeyLogin(provider)) {\n\t\tthrow new Error(`Provider does not support api_key login: ${provider}`);\n\t}\n\tconst signal = operationSignal(interaction.signal);\n\tsignal.throwIfAborted();\n\tif (!apiKeyAuth?.login) {\n\t\tconst result = await client.loginProvider(provider, signal);\n\t\tif (result.cancelled) throw normalizeOAuthLoginError(signal.reason ?? new Error(\"Login cancelled\"), signal);\n\t\tcatalog.apply(result);\n\t\tawait session.modelRuntime.reloadCredentials({ refreshAvailability: false });\n\t\treturn { modelsRefreshed: true };\n\t}\n\tconst credential = await raceWithAbortSignal(apiKeyAuth.login({ ...interaction, signal }), signal);\n\tif (signal.aborted) throw normalizeOAuthLoginError(signal.reason ?? new Error(\"Login cancelled\"), signal);\n\tconst remoteCatalog = await client.saveProviderCredential(provider, credential, { refreshCatalog: false });\n\tcatalog.apply(remoteCatalog);\n\tawait session.modelRuntime.reloadCredentials({ refreshAvailability: false });\n\treturn { modelsRefreshed: true };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isolated-runtime.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive-engine/isolated-runtime.ts"],"names":[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AAO,CAAC,IAAI,CAAC,CAAG;IAEtE,OAAO,CAAC,OAAO,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBlE;IAED,OAAO,CAAC,YAAY;IAyPpB;;;;;OAKG;YACW,eAAe;IAY7B,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,gBAAgB;YAcV,2BAA2B;IAWzC,OAAO,CAAC,mBAAmB;YAiBb,yBAAyB;YAazB,kBAAkB;IAahC,OAAO,CAAC,YAAY;CAyCpB"}
|
|
@@ -7,7 +7,7 @@ import { captureHerdrEnvironment } from "../../extensions/herdr/environment.js";
|
|
|
7
7
|
import { releaseUnownedPaneRegistration } from "../../extensions/herdr/pane-owner.js";
|
|
8
8
|
import { canonicalizePath } from "../../utils/paths.js";
|
|
9
9
|
import { sleep } from "../../utils/sleep.js";
|
|
10
|
-
import { isRpcTransportFailure, markRpcTransportFailure, rpcTransportError } from "../rpc/rpc-transport-error.js";
|
|
10
|
+
import { isRpcRequestAcceptedFailure, isRpcTransportFailure, markRpcTransportFailure, rpcTransportError, } from "../rpc/rpc-transport-error.js";
|
|
11
11
|
import { EngineHealthController } from "./engine-health.js";
|
|
12
12
|
import { EngineSessionStats } from "./engine-session-stats.js";
|
|
13
13
|
import { loginIsolatedApiKeyProvider, loginIsolatedOAuthProvider, } from "./isolated-auth.js";
|
|
@@ -246,6 +246,7 @@ export class IsolatedInteractiveRuntime extends AgentSessionRuntime {
|
|
|
246
246
|
this.remoteModelCatalog.applyModels({ models: result.models, scopedModels: result.scopedModels ?? [] });
|
|
247
247
|
await super.session.modelRuntime.reloadCredentials({ refreshAvailability: false });
|
|
248
248
|
super.session.modelRuntime.applyExternalProviderAuthStatus(provider, result.authStatus);
|
|
249
|
+
this.remoteModelCatalog.applyProviderAuthStatus(provider, result.authStatus);
|
|
249
250
|
await super.session.refreshCurrentModelFromRegistry();
|
|
250
251
|
return result;
|
|
251
252
|
}
|
|
@@ -617,7 +618,15 @@ export class IsolatedInteractiveRuntime extends AgentSessionRuntime {
|
|
|
617
618
|
await this.waitUntilResourcesReady();
|
|
618
619
|
if (cancellationEpoch !== this.promptCancellationEpoch)
|
|
619
620
|
return;
|
|
620
|
-
|
|
621
|
+
let disposition;
|
|
622
|
+
try {
|
|
623
|
+
disposition = await this.client.prompt(text, options?.images, options?.streamingBehavior);
|
|
624
|
+
}
|
|
625
|
+
catch (error) {
|
|
626
|
+
if (!isRpcRequestAcceptedFailure(error))
|
|
627
|
+
options?.preflightResult?.(false);
|
|
628
|
+
throw error;
|
|
629
|
+
}
|
|
621
630
|
options?.preflightResult?.(true, disposition);
|
|
622
631
|
},
|
|
623
632
|
},
|