@kortix/sdk 0.14.3 → 0.14.5
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 +39 -18
- package/dist/browser/session-sync/server-transcript-mirror.d.ts.map +1 -1
- package/dist/browser/session-sync/server-transcript-mirror.js +8 -1
- package/dist/browser/session-sync/server-transcript-mirror.js.map +1 -1
- package/dist/browser/stores/sync-store.d.ts.map +1 -1
- package/dist/browser/stores/sync-store.js +20 -7
- package/dist/browser/stores/sync-store.js.map +1 -1
- package/dist/core/agents/composer-agents.js +1 -1
- package/dist/core/agents/composer-agents.js.map +1 -1
- package/dist/core/client/capture.d.ts +50 -0
- package/dist/core/client/capture.d.ts.map +1 -1
- package/dist/core/client/capture.js +5 -0
- package/dist/core/client/capture.js.map +1 -1
- package/dist/core/client/facade-catalog.d.ts +3 -0
- package/dist/core/client/facade-catalog.d.ts.map +1 -1
- package/dist/core/client/facade-catalog.js +3 -0
- package/dist/core/client/facade-catalog.js.map +1 -1
- package/dist/core/client/kortix.d.ts +83 -0
- package/dist/core/client/kortix.d.ts.map +1 -1
- package/dist/core/client/project-core.d.ts +14 -0
- package/dist/core/client/project-core.d.ts.map +1 -1
- package/dist/core/client/project-core.js +6 -0
- package/dist/core/client/project-core.js.map +1 -1
- package/dist/core/client/project-operations-admin.d.ts +45 -0
- package/dist/core/client/project-operations-admin.d.ts.map +1 -1
- package/dist/core/client/project-operations-admin.js +15 -0
- package/dist/core/client/project-operations-admin.js.map +1 -1
- package/dist/core/client/project-operations-review.d.ts +5 -0
- package/dist/core/client/project-operations-review.d.ts.map +1 -1
- package/dist/core/client/project-operations-workspace.d.ts +5 -0
- package/dist/core/client/project-operations-workspace.d.ts.map +1 -1
- package/dist/core/client/project-operations.d.ts +44 -0
- package/dist/core/client/project-operations.d.ts.map +1 -1
- package/dist/core/files/client.d.ts +1 -1
- package/dist/core/files/client.js +1 -1
- package/dist/core/http/api/errors.d.ts +26 -0
- package/dist/core/http/api/errors.d.ts.map +1 -1
- package/dist/core/http/api/errors.js +36 -0
- package/dist/core/http/api/errors.js.map +1 -1
- package/dist/core/http/response-error.d.ts.map +1 -1
- package/dist/core/http/response-error.js +6 -2
- package/dist/core/http/response-error.js.map +1 -1
- package/dist/core/http/session-stopped.d.ts +8 -0
- package/dist/core/http/session-stopped.d.ts.map +1 -1
- package/dist/core/http/session-stopped.js +23 -0
- package/dist/core/http/session-stopped.js.map +1 -1
- package/dist/core/models/composer-model.d.ts +40 -7
- package/dist/core/models/composer-model.d.ts.map +1 -1
- package/dist/core/models/composer-model.js +51 -19
- package/dist/core/models/composer-model.js.map +1 -1
- package/dist/core/models/model-flatten.d.ts +21 -16
- package/dist/core/models/model-flatten.d.ts.map +1 -1
- package/dist/core/models/model-flatten.js +10 -9
- package/dist/core/models/model-flatten.js.map +1 -1
- package/dist/core/models/model-key.d.ts +6 -7
- package/dist/core/models/model-key.d.ts.map +1 -1
- package/dist/core/models/model-key.js +7 -15
- package/dist/core/models/model-key.js.map +1 -1
- package/dist/core/models/model-visibility.d.ts +1 -0
- package/dist/core/models/model-visibility.d.ts.map +1 -1
- package/dist/core/models/model-visibility.js +10 -13
- package/dist/core/models/model-visibility.js.map +1 -1
- package/dist/core/models/provider-selection.d.ts +13 -79
- package/dist/core/models/provider-selection.d.ts.map +1 -1
- package/dist/core/models/provider-selection.js +13 -240
- package/dist/core/models/provider-selection.js.map +1 -1
- package/dist/core/rest/platform-client/capture.d.ts +76 -1
- package/dist/core/rest/platform-client/capture.d.ts.map +1 -1
- package/dist/core/rest/platform-client/capture.js +14 -0
- package/dist/core/rest/platform-client/capture.js.map +1 -1
- package/dist/core/rest/projects-client/access.d.ts +2 -0
- package/dist/core/rest/projects-client/access.d.ts.map +1 -1
- package/dist/core/rest/projects-client/access.js.map +1 -1
- package/dist/core/rest/projects-client/audit.d.ts +2 -2
- package/dist/core/rest/projects-client/audit.d.ts.map +1 -1
- package/dist/core/rest/projects-client/billing.d.ts +7 -0
- package/dist/core/rest/projects-client/billing.d.ts.map +1 -1
- package/dist/core/rest/projects-client/billing.js.map +1 -1
- package/dist/core/rest/projects-client/custom-llm-providers.d.ts +40 -0
- package/dist/core/rest/projects-client/custom-llm-providers.d.ts.map +1 -0
- package/dist/core/rest/projects-client/custom-llm-providers.js +31 -0
- package/dist/core/rest/projects-client/custom-llm-providers.js.map +1 -0
- package/dist/core/rest/projects-client/drives.d.ts +5 -1
- package/dist/core/rest/projects-client/drives.d.ts.map +1 -1
- package/dist/core/rest/projects-client/drives.js +15 -5
- package/dist/core/rest/projects-client/drives.js.map +1 -1
- package/dist/core/rest/projects-client/github.d.ts +16 -0
- package/dist/core/rest/projects-client/github.d.ts.map +1 -1
- package/dist/core/rest/projects-client/github.js +4 -0
- package/dist/core/rest/projects-client/github.js.map +1 -1
- package/dist/core/rest/projects-client/iam-actions.d.ts +4 -0
- package/dist/core/rest/projects-client/iam-actions.d.ts.map +1 -1
- package/dist/core/rest/projects-client/iam-actions.js +4 -0
- package/dist/core/rest/projects-client/iam-actions.js.map +1 -1
- package/dist/core/rest/projects-client/iam-audit.d.ts +2 -2
- package/dist/core/rest/projects-client/iam-audit.d.ts.map +1 -1
- package/dist/core/rest/projects-client/index.d.ts +2 -0
- package/dist/core/rest/projects-client/index.d.ts.map +1 -1
- package/dist/core/rest/projects-client/index.js +2 -0
- package/dist/core/rest/projects-client/index.js.map +1 -1
- package/dist/core/rest/projects-client/model-access.d.ts +1 -1
- package/dist/core/rest/projects-client/model-access.d.ts.map +1 -1
- package/dist/core/rest/projects-client/notifications.d.ts +7 -2
- package/dist/core/rest/projects-client/notifications.d.ts.map +1 -1
- package/dist/core/rest/projects-client/notifications.js +2 -0
- package/dist/core/rest/projects-client/notifications.js.map +1 -1
- package/dist/core/rest/projects-client/projects.d.ts +19 -10
- package/dist/core/rest/projects-client/projects.d.ts.map +1 -1
- package/dist/core/rest/projects-client/projects.js +4 -4
- package/dist/core/rest/projects-client/projects.js.map +1 -1
- package/dist/core/rest/projects-client/review-items.d.ts +12 -0
- package/dist/core/rest/projects-client/review-items.d.ts.map +1 -1
- package/dist/core/rest/projects-client/review-items.js +7 -0
- package/dist/core/rest/projects-client/review-items.js.map +1 -1
- package/dist/core/rest/projects-client/review.d.ts +13 -1
- package/dist/core/rest/projects-client/review.d.ts.map +1 -1
- package/dist/core/rest/projects-client/review.js.map +1 -1
- package/dist/core/rest/projects-client/rooms.d.ts +144 -0
- package/dist/core/rest/projects-client/rooms.d.ts.map +1 -0
- package/dist/core/rest/projects-client/rooms.js +59 -0
- package/dist/core/rest/projects-client/rooms.js.map +1 -0
- package/dist/core/rest/projects-client/secrets.d.ts +2 -0
- package/dist/core/rest/projects-client/secrets.d.ts.map +1 -1
- package/dist/core/rest/projects-client/secrets.js.map +1 -1
- package/dist/core/rest/projects-client/sessions.d.ts +17 -4
- package/dist/core/rest/projects-client/sessions.d.ts.map +1 -1
- package/dist/core/rest/projects-client/sessions.js +5 -4
- package/dist/core/rest/projects-client/sessions.js.map +1 -1
- package/dist/core/rest/projects-client/setup-links.d.ts +5 -0
- package/dist/core/rest/projects-client/setup-links.d.ts.map +1 -1
- package/dist/core/rest/projects-client/setup-links.js.map +1 -1
- package/dist/core/rest/projects-client/skills.d.ts +11 -0
- package/dist/core/rest/projects-client/skills.d.ts.map +1 -1
- package/dist/core/rest/projects-client/skills.js +4 -0
- package/dist/core/rest/projects-client/skills.js.map +1 -1
- package/dist/core/rest/projects-client/triggers.d.ts +21 -0
- package/dist/core/rest/projects-client/triggers.d.ts.map +1 -1
- package/dist/core/rest/projects-client/triggers.js.map +1 -1
- package/dist/core/session/control-stream.d.ts.map +1 -1
- package/dist/core/session/control-stream.js +2 -1
- package/dist/core/session/control-stream.js.map +1 -1
- package/dist/core/session/preview-auth.d.ts +2 -2
- package/dist/core/session/preview-auth.d.ts.map +1 -1
- package/dist/core/session/preview-auth.js +15 -4
- package/dist/core/session/preview-auth.js.map +1 -1
- package/dist/core/session/runtime-sessions.js +1 -1
- package/dist/core/session/runtime-sessions.js.map +1 -1
- package/dist/core/session/runtime-verbs.d.ts.map +1 -1
- package/dist/core/session/runtime-verbs.js +8 -0
- package/dist/core/session/runtime-verbs.js.map +1 -1
- package/dist/core/session/static-file-preview.d.ts.map +1 -1
- package/dist/core/session/static-file-preview.js +2 -1
- package/dist/core/session/static-file-preview.js.map +1 -1
- package/dist/core/session/status-vocabulary.d.ts +3 -2
- package/dist/core/session/status-vocabulary.d.ts.map +1 -1
- package/dist/core/session/status-vocabulary.js +3 -2
- package/dist/core/session/status-vocabulary.js.map +1 -1
- package/dist/core/session/turn-end-watch.d.ts +1 -1
- package/dist/core/session/turn-end-watch.js +1 -1
- package/dist/core/session-log/store.d.ts +5 -1
- package/dist/core/session-log/store.d.ts.map +1 -1
- package/dist/core/session-log/store.js +16 -2
- package/dist/core/session-log/store.js.map +1 -1
- package/dist/core/session-log/turns/turn.d.ts +2 -0
- package/dist/core/session-log/turns/turn.d.ts.map +1 -1
- package/dist/core/session-log/turns/turn.js +26 -2
- package/dist/core/session-log/turns/turn.js.map +1 -1
- package/dist/core/session-log/v1-view.d.ts.map +1 -1
- package/dist/core/session-log/v1-view.js +50 -5
- package/dist/core/session-log/v1-view.js.map +1 -1
- package/dist/core/stream/event-attempt.d.ts.map +1 -1
- package/dist/core/stream/event-attempt.js +21 -8
- package/dist/core/stream/event-attempt.js.map +1 -1
- package/dist/core/stream/event-stream.d.ts +2 -1
- package/dist/core/stream/event-stream.d.ts.map +1 -1
- package/dist/core/stream/event-stream.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/kortix.esm.min.js +37 -37
- package/dist/kortix.global.js +37 -37
- package/dist/react/connector-setup.d.ts.map +1 -1
- package/dist/react/connector-setup.js +5 -4
- package/dist/react/connector-setup.js.map +1 -1
- package/dist/react/index.d.ts +3 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +3 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/opencode.js +1 -1
- package/dist/react/opencode.js.map +1 -1
- package/dist/react/prefetch-session-open.d.ts +6 -6
- package/dist/react/prefetch-session-open.d.ts.map +1 -1
- package/dist/react/prefetch-session-open.js +21 -12
- package/dist/react/prefetch-session-open.js.map +1 -1
- package/dist/react/query-contracts.d.ts +1 -0
- package/dist/react/query-contracts.d.ts.map +1 -1
- package/dist/react/query-contracts.js +1 -0
- package/dist/react/query-contracts.js.map +1 -1
- package/dist/react/query-keys.d.ts +18 -0
- package/dist/react/query-keys.d.ts.map +1 -1
- package/dist/react/query-keys.js +18 -0
- package/dist/react/query-keys.js.map +1 -1
- package/dist/react/session-start-stash.d.ts +1 -1
- package/dist/react/session-start-stash.js +1 -1
- package/dist/react/use-accounts.d.ts.map +1 -1
- package/dist/react/use-accounts.js +1 -1
- package/dist/react/use-admin-accounts.d.ts +1 -0
- package/dist/react/use-admin-accounts.d.ts.map +1 -1
- package/dist/react/use-admin-accounts.js.map +1 -1
- package/dist/react/use-authenticated-preview-url.d.ts.map +1 -1
- package/dist/react/use-authenticated-preview-url.js +6 -9
- package/dist/react/use-authenticated-preview-url.js.map +1 -1
- package/dist/react/use-can.d.ts +1 -1
- package/dist/react/use-can.js +1 -1
- package/dist/react/use-canonical-opencode-session.d.ts +6 -0
- package/dist/react/use-canonical-opencode-session.d.ts.map +1 -1
- package/dist/react/use-canonical-opencode-session.js +3 -1
- package/dist/react/use-canonical-opencode-session.js.map +1 -1
- package/dist/react/use-capture.d.ts +25 -1
- package/dist/react/use-capture.d.ts.map +1 -1
- package/dist/react/use-capture.js +19 -1
- package/dist/react/use-capture.js.map +1 -1
- package/dist/react/use-custom-llm-providers.d.ts +16 -0
- package/dist/react/use-custom-llm-providers.d.ts.map +1 -0
- package/dist/react/use-custom-llm-providers.js +49 -0
- package/dist/react/use-custom-llm-providers.js.map +1 -0
- package/dist/react/use-feature-flag.d.ts +3 -3
- package/dist/react/use-feature-flag.d.ts.map +1 -1
- package/dist/react/use-feature-flag.js +4 -3
- package/dist/react/use-feature-flag.js.map +1 -1
- package/dist/react/use-gateway-routing-policy.d.ts +1 -0
- package/dist/react/use-gateway-routing-policy.d.ts.map +1 -1
- package/dist/react/use-gateway-routing-policy.js +3 -12
- package/dist/react/use-gateway-routing-policy.js.map +1 -1
- package/dist/react/use-kortix-master.js +1 -1
- package/dist/react/use-model-defaults.d.ts +2 -4
- package/dist/react/use-model-defaults.d.ts.map +1 -1
- package/dist/react/use-model-defaults.js +2 -7
- package/dist/react/use-model-defaults.js.map +1 -1
- package/dist/react/use-model-enablement.d.ts.map +1 -1
- package/dist/react/use-model-enablement.js +1 -5
- package/dist/react/use-model-enablement.js.map +1 -1
- package/dist/react/use-model-store.d.ts +4 -1
- package/dist/react/use-model-store.d.ts.map +1 -1
- package/dist/react/use-model-store.js +16 -6
- package/dist/react/use-model-store.js.map +1 -1
- package/dist/react/use-opencode-local.d.ts +13 -1
- package/dist/react/use-opencode-local.d.ts.map +1 -1
- package/dist/react/use-opencode-local.js +41 -28
- package/dist/react/use-opencode-local.js.map +1 -1
- package/dist/react/use-opencode-sessions/no-compaction-model-error.d.ts +1 -1
- package/dist/react/use-opencode-sessions/no-compaction-model-error.js +1 -1
- package/dist/react/use-opencode-sessions/providers.d.ts +6 -0
- package/dist/react/use-opencode-sessions/providers.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/providers.js +15 -77
- package/dist/react/use-opencode-sessions/providers.js.map +1 -1
- package/dist/react/use-opencode-sessions/sessions.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/sessions.js +5 -1
- package/dist/react/use-opencode-sessions/sessions.js.map +1 -1
- package/dist/react/use-project-models.d.ts.map +1 -1
- package/dist/react/use-project-models.js +2 -8
- package/dist/react/use-project-models.js.map +1 -1
- package/dist/react/use-rooms.d.ts +382 -0
- package/dist/react/use-rooms.d.ts.map +1 -0
- package/dist/react/use-rooms.js +83 -0
- package/dist/react/use-rooms.js.map +1 -0
- package/dist/react/use-session-audit.js +1 -1
- package/dist/react/use-session-messages.d.ts.map +1 -1
- package/dist/react/use-session-messages.js +6 -7
- package/dist/react/use-session-messages.js.map +1 -1
- package/dist/react/use-session-stream.d.ts +1 -0
- package/dist/react/use-session-stream.d.ts.map +1 -1
- package/dist/react/use-session-stream.js +8 -0
- package/dist/react/use-session-stream.js.map +1 -1
- package/dist/react/use-session.d.ts +3 -0
- package/dist/react/use-session.d.ts.map +1 -1
- package/dist/react/use-session.js +23 -4
- package/dist/react/use-session.js.map +1 -1
- package/package.json +2 -17
- package/dist/core/models/bedrock-invokable.d.ts +0 -58
- package/dist/core/models/bedrock-invokable.d.ts.map +0 -1
- package/dist/core/models/bedrock-invokable.js +0 -83
- package/dist/core/models/bedrock-invokable.js.map +0 -1
- package/dist/react/bedrock-invokable.d.ts +0 -2
- package/dist/react/bedrock-invokable.d.ts.map +0 -1
- package/dist/react/bedrock-invokable.js +0 -3
- package/dist/react/bedrock-invokable.js.map +0 -1
- package/dist/react/use-opencode-sessions/provider-load-plan.d.ts +0 -6
- package/dist/react/use-opencode-sessions/provider-load-plan.d.ts.map +0 -1
- package/dist/react/use-opencode-sessions/provider-load-plan.js +0 -4
- package/dist/react/use-opencode-sessions/provider-load-plan.js.map +0 -1
- package/dist/react/use-project-llm-gateway.d.ts +0 -27
- package/dist/react/use-project-llm-gateway.d.ts.map +0 -1
- package/dist/react/use-project-llm-gateway.js +0 -41
- package/dist/react/use-project-llm-gateway.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-key.d.ts","sourceRoot":"","sources":["../../../src/core/models/model-key.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,MAAM,MAAM,QAAQ,GAAG;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAOF,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAGtD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAIrD;AAED
|
|
1
|
+
{"version":3,"file":"model-key.d.ts","sourceRoot":"","sources":["../../../src/core/models/model-key.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,MAAM,MAAM,QAAQ,GAAG;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAOF,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAGtD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAIrD;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,OAAO,GAAG,QAAQ,CAE9E"}
|
|
@@ -15,22 +15,14 @@ export function wireToModelKey(wire) {
|
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* A STORED model ref (a session pin, a channel binding, a trigger, an agent's
|
|
18
|
-
* `model`) as the picker's `ModelKey
|
|
18
|
+
* `model`) as the picker's `ModelKey`. The ref is a gateway wire id;
|
|
19
|
+
* `kortix/<wire>` (the form a session pin keeps) and `<wire>` name the same
|
|
20
|
+
* model under `kortix`.
|
|
19
21
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* • Gateway off — the ref is the native `provider/model`, split on the FIRST
|
|
23
|
-
* slash (`openrouter/z-ai/glm-4.7-flash`). A ref with no provider falls
|
|
24
|
-
* back to the gateway shape, which fails the catalog lookup (renders unset).
|
|
22
|
+
* @param _gatewayEnabled Deprecated and ignored: the LLM gateway is the only
|
|
23
|
+
* model path for every project. Removed in the next major.
|
|
25
24
|
*/
|
|
26
|
-
export function modelRefToKey(ref,
|
|
27
|
-
|
|
28
|
-
if (!gatewayEnabled) {
|
|
29
|
-
const slash = wire.indexOf('/');
|
|
30
|
-
if (slash > 0 && slash < wire.length - 1) {
|
|
31
|
-
return { providerID: wire.slice(0, slash), modelID: wire.slice(slash + 1) };
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return wireToModelKey(wire);
|
|
25
|
+
export function modelRefToKey(ref, _gatewayEnabled) {
|
|
26
|
+
return wireToModelKey(ref.startsWith('kortix/') ? ref.slice('kortix/'.length) : ref);
|
|
35
27
|
}
|
|
36
28
|
//# sourceMappingURL=model-key.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-key.js","sourceRoot":"","sources":["../../../src/core/models/model-key.ts"],"names":[],"mappings":"AAgBA,8EAA8E;AAC9E,+EAA+E;AAC/E,8EAA8E;AAC9E,iFAAiF;AACjF,wCAAwC;AACxC,MAAM,UAAU,cAAc,CAAC,KAAe;IAC5C,IAAI,KAAK,CAAC,UAAU,KAAK,QAAQ,IAAI,KAAK,CAAC,UAAU,KAAK,UAAU;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC;IAC3F,OAAO,GAAG,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,wEAAwE;IACxE,6EAA6E;IAC7E,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACjD,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"model-key.js","sourceRoot":"","sources":["../../../src/core/models/model-key.ts"],"names":[],"mappings":"AAgBA,8EAA8E;AAC9E,+EAA+E;AAC/E,8EAA8E;AAC9E,iFAAiF;AACjF,wCAAwC;AACxC,MAAM,UAAU,cAAc,CAAC,KAAe;IAC5C,IAAI,KAAK,CAAC,UAAU,KAAK,QAAQ,IAAI,KAAK,CAAC,UAAU,KAAK,UAAU;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC;IAC3F,OAAO,GAAG,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,wEAAwE;IACxE,6EAA6E;IAC7E,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACjD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,GAAW,EAAE,eAAyB;IAClE,OAAO,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AACvF,CAAC"}
|
|
@@ -17,6 +17,7 @@ export declare function hasUsableModel(allModels: FlatModel[], opts: {
|
|
|
17
17
|
connectedProviderIds?: Set<string>;
|
|
18
18
|
freeTier?: boolean;
|
|
19
19
|
}): boolean;
|
|
20
|
+
/** Shown out of the box with no release metadata: the Kortix managed models. */
|
|
20
21
|
export declare function isDefaultVisible(model: ModelKey): boolean;
|
|
21
22
|
/**
|
|
22
23
|
* "Latest" models, keyed `providerID:modelID` for the store's lookup maps.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-visibility.d.ts","sourceRoot":"","sources":["../../../src/core/models/model-visibility.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"model-visibility.d.ts","sourceRoot":"","sources":["../../../src/core/models/model-visibility.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AA0C5C;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,SAAS,EAAE,EACtB,IAAI,EAAE;IAAE,oBAAoB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAC/D,OAAO,CAmBT;AAED,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAEzD;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAajE;AAED,0EAA0E;AAC1E,MAAM,WAAW,kBAAmB,SAAQ,QAAQ;IAClD,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,aAAa,EAAE,SAAS,EAAE,CAAC;IAC3B,IAAI,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACzC,oBAAoB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,CAAC,KAAK,EAAE,QAAQ,KAAK,OAAO,CA8D/B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE;IACL,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,CAAC,KAAK,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC;IAC5E,QAAQ,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAC1D,GACA,OAAO,CAWT"}
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defaultEnabledModelIds } from '@kortix/llm-catalog/lite';
|
|
2
2
|
import { createModelLookup } from './model-lookup.js';
|
|
3
3
|
/**
|
|
4
4
|
* Which models a composer's model picker shows out of the box. Framework-free:
|
|
5
5
|
* `useModelStore` (web) wraps it with persisted pins, and any other host calls
|
|
6
6
|
* it with its own.
|
|
7
7
|
*/
|
|
8
|
-
/**
|
|
9
|
-
* Fallback allowlist for the rare non-gateway model that carries no release-date
|
|
10
|
-
* metadata: only the flagship shows out of the box, everything else is opt-in via
|
|
11
|
-
* "Manage models".
|
|
12
|
-
*/
|
|
13
|
-
const DEFAULT_VISIBLE_MODEL_IDS = new Set([MANAGED_FLAGSHIP_MODEL_ID]);
|
|
14
8
|
/**
|
|
15
9
|
* Provider id of the managed Kortix LLM gateway (see the sandbox's
|
|
16
10
|
* `opencode.ts` provider config). It's a small, hand-picked catalog we control,
|
|
@@ -25,9 +19,11 @@ const SUBSCRIPTION_PROVIDER_ID = 'codex';
|
|
|
25
19
|
// session restart. The picker must therefore NOT show all of it by default: a
|
|
26
20
|
// `kortix` model is on out-of-the-box only when it's a platform-managed default
|
|
27
21
|
// or its underlying provider is connected (live, from project secrets). The
|
|
28
|
-
// rest stay one search away.
|
|
29
|
-
//
|
|
30
|
-
|
|
22
|
+
// rest stay one search away. A Kortix managed model is a bare id under the
|
|
23
|
+
// gateway provider: whatever Platinum Inference offers, so no list lives here.
|
|
24
|
+
function isManagedModel(model) {
|
|
25
|
+
return model.providerID === MANAGED_GATEWAY_PROVIDER_ID && !model.modelID.includes('/');
|
|
26
|
+
}
|
|
31
27
|
// `explicitProvider` (a model's `FlatModel.provider` / `ModelKey.provider`) is
|
|
32
28
|
// the robust path — the gateway now serves it directly, so grouping/gating
|
|
33
29
|
// never has to guess the real provider from string-splitting `modelID`.
|
|
@@ -61,7 +57,7 @@ export function hasUsableModel(allModels, opts) {
|
|
|
61
57
|
// from CONNECTED providers, so presence here already means usable.
|
|
62
58
|
return true;
|
|
63
59
|
}
|
|
64
|
-
if (
|
|
60
|
+
if (isManagedModel(m)) {
|
|
65
61
|
// The gateway serves no managed model to an account without the
|
|
66
62
|
// managed-models entitlement (`freeTier`), the platform default included.
|
|
67
63
|
return !freeTier;
|
|
@@ -72,8 +68,9 @@ export function hasUsableModel(allModels, opts) {
|
|
|
72
68
|
: (connectedProviderIds?.has(sub) ?? false);
|
|
73
69
|
});
|
|
74
70
|
}
|
|
71
|
+
/** Shown out of the box with no release metadata: the Kortix managed models. */
|
|
75
72
|
export function isDefaultVisible(model) {
|
|
76
|
-
return
|
|
73
|
+
return isManagedModel(model);
|
|
77
74
|
}
|
|
78
75
|
/**
|
|
79
76
|
* "Latest" models, keyed `providerID:modelID` for the store's lookup maps.
|
|
@@ -139,7 +136,7 @@ export function createModelVisibility(input) {
|
|
|
139
136
|
const connected = sub === SUBSCRIPTION_PROVIDER_ID
|
|
140
137
|
? (connectedProviderIds?.has(SUBSCRIPTION_PROVIDER_ID) ?? false)
|
|
141
138
|
: (connectedProviderIds?.has(sub) ?? false);
|
|
142
|
-
if (
|
|
139
|
+
if (isManagedModel(model)) {
|
|
143
140
|
// Same rule as `hasUsableModel` above.
|
|
144
141
|
return !freeTier;
|
|
145
142
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-visibility.js","sourceRoot":"","sources":["../../../src/core/models/model-visibility.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"model-visibility.js","sourceRoot":"","sources":["../../../src/core/models/model-visibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAIlE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;GAIG;AAEH;;;;;;GAMG;AACH,MAAM,2BAA2B,GAAG,QAAQ,CAAC;AAE7C,MAAM,wBAAwB,GAAG,OAAO,CAAC;AAEzC,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,gFAAgF;AAChF,4EAA4E;AAC5E,2EAA2E;AAC3E,+EAA+E;AAC/E,SAAS,cAAc,CAAC,KAAe;IACrC,OAAO,KAAK,CAAC,UAAU,KAAK,2B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AC9C,KAAK,CAAC,QAAQ,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,EACxC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC,cAAc,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;AACxF,CAAC"}
|
|
@@ -31,68 +31,15 @@ export declare function providerListHasModels(providers: ProviderListResponse |
|
|
|
31
31
|
export declare function providerListHasGateway(providers: ProviderListResponse | undefined): boolean;
|
|
32
32
|
export declare function filterToGatewayProviders(providers: ProviderListResponse): ProviderListResponse;
|
|
33
33
|
export declare function mergeProviderLists(primary: ProviderListResponse, secondary: ProviderListResponse): ProviderListResponse;
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated The LLM gateway is the only model path, so no picker shows a
|
|
36
|
+
* native provider list. Drops the `kortix` provider. Removed in the next major.
|
|
37
|
+
*/
|
|
34
38
|
export declare function filterToNativeProviders(providers: ProviderListResponse): ProviderListResponse;
|
|
35
39
|
export declare function mergeProjectSecretConnectedProviders(providers: ProviderListResponse, secretNames: Set<string>, providerCredentials: Array<{
|
|
36
40
|
id: string;
|
|
37
41
|
authRequirement: ProviderAuthRequirement;
|
|
38
42
|
}>): ProviderListResponse;
|
|
39
|
-
/** The catalog fields the pre-runtime picker source reads per model — a
|
|
40
|
-
* structural subset of `@kortix/llm-catalog`'s `CatalogModel` (the wire
|
|
41
|
-
* shape), typed loose so both the shared type and test fixtures satisfy it. */
|
|
42
|
-
interface NativeCatalogModel {
|
|
43
|
-
id: string;
|
|
44
|
-
name: string;
|
|
45
|
-
released?: string | null;
|
|
46
|
-
status?: string;
|
|
47
|
-
description?: string;
|
|
48
|
-
family?: string;
|
|
49
|
-
reasoning?: boolean;
|
|
50
|
-
reasoning_options?: Array<{
|
|
51
|
-
type: string;
|
|
52
|
-
values?: Array<string | null>;
|
|
53
|
-
min?: number;
|
|
54
|
-
max?: number;
|
|
55
|
-
}>;
|
|
56
|
-
tool_call?: boolean;
|
|
57
|
-
attachment?: boolean;
|
|
58
|
-
open_weights?: boolean;
|
|
59
|
-
last_updated?: string;
|
|
60
|
-
modalities?: {
|
|
61
|
-
input?: string[];
|
|
62
|
-
output?: string[];
|
|
63
|
-
};
|
|
64
|
-
limit?: {
|
|
65
|
-
context?: number;
|
|
66
|
-
input?: number;
|
|
67
|
-
output?: number;
|
|
68
|
-
};
|
|
69
|
-
cost?: {
|
|
70
|
-
input?: number;
|
|
71
|
-
output?: number;
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
export declare function nativeProviderListFromCatalog(catalog: {
|
|
75
|
-
providers: Array<{
|
|
76
|
-
id: string;
|
|
77
|
-
name: string;
|
|
78
|
-
models: Array<NativeCatalogModel>;
|
|
79
|
-
}>;
|
|
80
|
-
}, secretNames: Set<string>): ProviderListResponse;
|
|
81
|
-
/**
|
|
82
|
-
* ONE native picker across sandbox states. Pre-boot the picker reads the
|
|
83
|
-
* catalog synthesis (`nativeProviderListFromCatalog`); once the runtime
|
|
84
|
-
* reports `/config/providers` it is the truth for what the box can actually
|
|
85
|
-
* serve. Swapping sources on boot changed the picker under the user (provider
|
|
86
|
-
* order, Zen appearing, the auto-picked default flipping). Merged instead:
|
|
87
|
-
*
|
|
88
|
-
* - shared provider ids take the RUNTIME object (real variant settings, the
|
|
89
|
-
* box's exact model set), in CATALOG order (flagship rank);
|
|
90
|
-
* - runtime-only providers (Zen, auth.json logins) append after;
|
|
91
|
-
* - the curated catalog default wins per provider while the runtime serves
|
|
92
|
-
* that model, else the runtime default — the auto-pick is stable across
|
|
93
|
-
* boot and never names a model the box cannot run.
|
|
94
|
-
*/
|
|
95
|
-
export declare function mergeNativeProviderLists(catalog: ProviderListResponse | undefined, runtime: ProviderListResponse | undefined): ProviderListResponse | undefined;
|
|
96
43
|
export declare function connectedGatewayProviderIdsFromSecretNames(secretNames: Set<string>): Set<string>;
|
|
97
44
|
/**
|
|
98
45
|
* Restamp `enabled` on a gateway ProviderListResponse from an overrides map
|
|
@@ -104,39 +51,26 @@ export declare function connectedGatewayProviderIdsFromSecretNames(secretNames:
|
|
|
104
51
|
*/
|
|
105
52
|
export declare function applyEnablementToProviderList(providers: ProviderListResponse, overrides: Record<string, boolean>): ProviderListResponse;
|
|
106
53
|
export declare function projectLlmCatalogToProviderList(catalog: ProjectLlmCatalogResponse): ProviderListResponse;
|
|
107
|
-
/**
|
|
108
|
-
* A project session runtime's `/provider` answer, as the native picker reads
|
|
109
|
-
* it: normalized, providers the project's secrets connect marked connected,
|
|
110
|
-
* and the gateway's `kortix` provider removed.
|
|
111
|
-
*/
|
|
112
|
-
export declare function nativeRuntimeProviderList(runtime: ProviderListResponse, secretNames: Set<string>): ProviderListResponse;
|
|
113
54
|
/** The raw sources a project composer's model picker is built from. */
|
|
114
55
|
export interface PickerProviderListInput {
|
|
115
|
-
/**
|
|
116
|
-
gatewayEnabled
|
|
117
|
-
/**
|
|
56
|
+
/** @deprecated Ignored: the LLM gateway is the only model path. Removed in the next major. */
|
|
57
|
+
gatewayEnabled?: boolean;
|
|
58
|
+
/** `GET /projects/:id/model-picker`. */
|
|
118
59
|
modelPicker?: ProjectLlmCatalogResponse;
|
|
119
|
-
/**
|
|
60
|
+
/** @deprecated Ignored: the native picker source is gone. Removed in the next major. */
|
|
120
61
|
runtimeProviders?: ProviderListResponse;
|
|
121
|
-
/**
|
|
62
|
+
/** @deprecated Ignored: the native picker source is gone. Removed in the next major. */
|
|
122
63
|
llmCatalogProviders?: ProjectLlmCatalogProvidersResponse;
|
|
123
|
-
/**
|
|
64
|
+
/** @deprecated Ignored: the native picker source is gone. Removed in the next major. */
|
|
124
65
|
secretNames?: Set<string>;
|
|
125
66
|
}
|
|
126
67
|
/**
|
|
127
68
|
* The provider list a project composer's model picker renders — the same
|
|
128
|
-
*
|
|
129
|
-
* `
|
|
130
|
-
*
|
|
131
|
-
* - Gateway: the `/model-picker` catalog as the single `kortix` provider
|
|
132
|
-
* (`auto` dropped, per-model `enabled` kept).
|
|
133
|
-
* - Native: the catalog synthesis (connected by secret names) merged with the
|
|
134
|
-
* runtime list — runtime objects win, catalog order and curated defaults
|
|
135
|
-
* stay. A model-less runtime answer is a sandbox still wiring its providers
|
|
136
|
-
* and is ignored.
|
|
69
|
+
* source `useRuntimeProviders` reads: the `/model-picker` catalog as the
|
|
70
|
+
* single `kortix` provider (`auto` dropped, per-model `enabled` kept). Feed
|
|
71
|
+
* the result to `flattenModels(list)`.
|
|
137
72
|
*
|
|
138
73
|
* `undefined` = nothing loaded yet.
|
|
139
74
|
*/
|
|
140
75
|
export declare function pickerProviderList(input: PickerProviderListInput): ProviderListResponse | undefined;
|
|
141
|
-
export {};
|
|
142
76
|
//# sourceMappingURL=provider-selection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-selection.d.ts","sourceRoot":"","sources":["../../../src/core/models/provider-selection.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,uBAAuB,
|
|
1
|
+
{"version":3,"file":"provider-selection.d.ts","sourceRoot":"","sources":["../../../src/core/models/provider-selection.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,uBAAuB,EAI7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,oBAAoB,IAAI,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEhG,OAAO,KAAK,EACV,kCAAkC,EAClC,yBAAyB,EAC1B,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAE3D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,eAAe,EAAE,uBAAuB,CAAC;CAC1C,CAGE,CAAC;AAIJ,eAAO,MAAM,oBAAoB,aAAsB,CAAC;AAExD,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,oBAAoB,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AAkC,CAAC;IACzD,wFAAwF;IACxF,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,oBAAoB,GAAG,SAAS,CAEnG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CATALOG_PROVIDER_ENV,
|
|
1
|
+
import { CATALOG_PROVIDER_ENV, isProviderAuthSatisfied, providerAuthRequirement, generationControlCapabilities, } from '@kortix/llm-catalog/lite';
|
|
2
2
|
/**
|
|
3
3
|
* Provider → Kortix-owned auth requirement, derived from the shared
|
|
4
4
|
* models.dev catalog via `providerAuthRequirement` (NOT the raw catalog
|
|
@@ -17,10 +17,9 @@ export const LLM_PROVIDER_CREDENTIALS = CATALOG_PROVIDER_ENV.map((provider) => (
|
|
|
17
17
|
id: provider.id,
|
|
18
18
|
authRequirement: providerAuthRequirement(provider),
|
|
19
19
|
}));
|
|
20
|
-
//
|
|
21
|
-
//
|
|
20
|
+
// OpenCode must see Kortix as the single LLM provider: the LLM gateway is the
|
|
21
|
+
// only model path.
|
|
22
22
|
export const GATEWAY_PROVIDER_IDS = new Set(['kortix']);
|
|
23
|
-
const NATIVE_EXCLUDED_PROVIDER_IDS = new Set(['kortix']);
|
|
24
23
|
export function normalizeProviderList(providers) {
|
|
25
24
|
const modernAll = Array.isArray(providers.all) ? providers.all : [];
|
|
26
25
|
const modernConnected = Array.isArray(providers.connected) ? providers.connected : [];
|
|
@@ -106,14 +105,18 @@ export function mergeProviderLists(primary, secondary) {
|
|
|
106
105
|
default: { ...(first.default ?? {}), ...(second.default ?? {}) },
|
|
107
106
|
};
|
|
108
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* @deprecated The LLM gateway is the only model path, so no picker shows a
|
|
110
|
+
* native provider list. Drops the `kortix` provider. Removed in the next major.
|
|
111
|
+
*/
|
|
109
112
|
export function filterToNativeProviders(providers) {
|
|
110
113
|
const normalized = normalizeProviderList(providers);
|
|
111
114
|
const all = Array.isArray(normalized.all) ? normalized.all : [];
|
|
112
115
|
const connected = Array.isArray(normalized.connected) ? normalized.connected : [];
|
|
113
116
|
return {
|
|
114
117
|
...normalized,
|
|
115
|
-
all: all.filter((p) => !
|
|
116
|
-
connected: connected.filter((id) => !
|
|
118
|
+
all: all.filter((p) => !GATEWAY_PROVIDER_IDS.has(p.id)),
|
|
119
|
+
connected: connected.filter((id) => !GATEWAY_PROVIDER_IDS.has(id)),
|
|
117
120
|
};
|
|
118
121
|
}
|
|
119
122
|
export function mergeProjectSecretConnectedProviders(providers, secretNames, providerCredentials) {
|
|
@@ -133,213 +136,6 @@ export function mergeProjectSecretConnectedProviders(providers, secretNames, pro
|
|
|
133
136
|
}
|
|
134
137
|
return { ...normalized, connected: [...connected] };
|
|
135
138
|
}
|
|
136
|
-
/**
|
|
137
|
-
* Native mode, BEFORE any sandbox runtime exists: synthesize the picker's
|
|
138
|
-
* provider list from the ungated `/llm-catalog/providers` route plus the
|
|
139
|
-
* project's secret NAMES.
|
|
140
|
-
*
|
|
141
|
-
* OpenCode in the box is the native catalog's source of truth — but on the
|
|
142
|
-
* project home and on a cold session there IS no box yet, and without a
|
|
143
|
-
* pre-runtime source the composer showed "No models available" on every
|
|
144
|
-
* native project until one booted (connecting a key changed nothing). This is
|
|
145
|
-
* the native twin of gateway mode's `/model-picker`, and it deliberately:
|
|
146
|
-
*
|
|
147
|
-
* • includes ONLY providers whose auth the project's secrets satisfy — the
|
|
148
|
-
* 195-provider catalog would be dead weight `flattenModels` filters out,
|
|
149
|
-
* and an unconnected provider's models must not be pickable;
|
|
150
|
-
* • maps the catalog's `released` onto `release_date` (what the flatten and
|
|
151
|
-
* the picker sort read);
|
|
152
|
-
* • never emits the synthetic `kortix` provider;
|
|
153
|
-
* • returns an EMPTY list with no keys, so the connect-provider call to
|
|
154
|
-
* action stays honest.
|
|
155
|
-
*
|
|
156
|
-
* Once the runtime is up, the live `/provider` list replaces this (it knows
|
|
157
|
-
* auth.json, autoloaded providers like OpenCode Zen, and real capabilities).
|
|
158
|
-
*/
|
|
159
|
-
/** Direct flagship providers first, in this order, so "first connected
|
|
160
|
-
* provider" favors them over e.g. OpenRouter's 350-model sprawl. Provider
|
|
161
|
-
* order only: which MODEL is the default is always data-driven (newest
|
|
162
|
-
* auto-selectable release, `autoSeedDefaultModel`), never a curated id list —
|
|
163
|
-
* one pinned gpt-5.5 / claude-opus-4-8 for weeks after newer releases. */
|
|
164
|
-
const NATIVE_PROVIDER_RANK = new Map(['anthropic', 'openai', 'google', 'x-ai', 'xai', 'deepseek', 'mistral', 'groq', 'perplexity', 'openrouter'].map((id, index) => [id, index]));
|
|
165
|
-
/**
|
|
166
|
-
* Variant IDS for a model's thinking-mode row, mirroring how opencode itself
|
|
167
|
-
* derives variants from the same models.dev `reasoning_options`
|
|
168
|
-
* (opencode packages/opencode/src/provider/transform.ts `reasoningVariants`):
|
|
169
|
-
* an `effort` knob contributes its published values verbatim (null → 'none'),
|
|
170
|
-
* a `budget_tokens` knob contributes the synthesized high/max pair, anything
|
|
171
|
-
* else contributes nothing. IDs only — the runtime owns the actual variant
|
|
172
|
-
* SETTINGS and replaces this list wholesale the moment it loads, so a
|
|
173
|
-
* pre-runtime pick lands on a runtime variant of the same name.
|
|
174
|
-
*/
|
|
175
|
-
function nativeVariantIds(model) {
|
|
176
|
-
const options = model.reasoning_options ?? [];
|
|
177
|
-
const effort = options.find((option) => option.type === 'effort');
|
|
178
|
-
if (effort) {
|
|
179
|
-
return (effort.values ?? []).flatMap((value) => {
|
|
180
|
-
if (value === null)
|
|
181
|
-
return ['none'];
|
|
182
|
-
return typeof value === 'string' ? [value] : [];
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
if (options.some((option) => option.type === 'budget_tokens'))
|
|
186
|
-
return ['high', 'max'];
|
|
187
|
-
return [];
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* OpenCode Zen — opencode's own provider. The runtime auto-connects it with
|
|
191
|
-
* its FREE models even when no `OPENCODE_API_KEY` exists (opencode
|
|
192
|
-
* packages/opencode/src/provider/provider.ts: the `opencode` provider is
|
|
193
|
-
* always loaded, keyless it is trimmed to zero-cost models). The pre-runtime
|
|
194
|
-
* source mirrors that so a booting sandbox never adds a provider the
|
|
195
|
-
* pre-boot picker did not show.
|
|
196
|
-
*/
|
|
197
|
-
const ZEN_PROVIDER_ID = 'opencode';
|
|
198
|
-
function isFreeModel(model) {
|
|
199
|
-
return model.cost?.input === 0 && model.cost?.output === 0;
|
|
200
|
-
}
|
|
201
|
-
function providerRank(id) {
|
|
202
|
-
// Keyed table providers first (table order), then every other keyed
|
|
203
|
-
// provider, Zen's keyless free tier last — "first connected provider" is
|
|
204
|
-
// what the composer auto-picks, and a free preview model must never beat a
|
|
205
|
-
// provider the user paid to connect.
|
|
206
|
-
if (id === ZEN_PROVIDER_ID)
|
|
207
|
-
return Number.MAX_SAFE_INTEGER;
|
|
208
|
-
return NATIVE_PROVIDER_RANK.get(id) ?? Number.MAX_SAFE_INTEGER - 1;
|
|
209
|
-
}
|
|
210
|
-
export function nativeProviderListFromCatalog(catalog, secretNames) {
|
|
211
|
-
const connectedIds = connectedGatewayProviderIdsFromSecretNames(secretNames);
|
|
212
|
-
const defaults = {};
|
|
213
|
-
const all = (catalog.providers ?? [])
|
|
214
|
-
.map((provider) => {
|
|
215
|
-
// opencode hides every model models.dev marks `status: "deprecated"`
|
|
216
|
-
// (core/src/plugin/provider/opencode.ts: `enabled = status !==
|
|
217
|
-
// "deprecated"`), so the runtime never lists them. Dev 2026-08-25:
|
|
218
|
-
// 29 free Zen models in the box's models.json, 7 served.
|
|
219
|
-
const live = (provider.models ?? []).filter((model) => model.status !== 'deprecated');
|
|
220
|
-
return provider.id === ZEN_PROVIDER_ID && !connectedIds.has(ZEN_PROVIDER_ID)
|
|
221
|
-
? { ...provider, models: live.filter(isFreeModel), keyless: true }
|
|
222
|
-
: { ...provider, models: live, keyless: false };
|
|
223
|
-
})
|
|
224
|
-
.filter((provider) => (provider.keyless || connectedIds.has(provider.id)) &&
|
|
225
|
-
!NATIVE_EXCLUDED_PROVIDER_IDS.has(provider.id) &&
|
|
226
|
-
(provider.models?.length ?? 0) > 0)
|
|
227
|
-
.sort((a, b) => providerRank(a.id) - providerRank(b.id))
|
|
228
|
-
.map((provider) => {
|
|
229
|
-
// Newest first: the picker's visual order and the "first model" fallback
|
|
230
|
-
// both read insertion order. On a release-date tie a Bedrock inference
|
|
231
|
-
// profile sorts ahead of its bare in-region twin — the bare id is the
|
|
232
|
-
// one Bedrock refuses with "on-demand throughput isn't supported".
|
|
233
|
-
const models = [...provider.models].sort((a, b) => (b.released ?? '').localeCompare(a.released ?? '') ||
|
|
234
|
-
bedrockInferenceProfileRank(b.id) - bedrockInferenceProfileRank(a.id));
|
|
235
|
-
// `autoSeedDefaultModel` (not `models[0]`): newest stable, tool-capable
|
|
236
|
-
// release, and never a bare Bedrock id when the provider serves
|
|
237
|
-
// inference profiles (a fresh Bedrock-BYOK workspace was once seeded
|
|
238
|
-
// with an id Bedrock rejects). See its doc comment.
|
|
239
|
-
const flagship = autoSeedDefaultModel(models)?.id ?? models[0]?.id;
|
|
240
|
-
if (flagship)
|
|
241
|
-
defaults[provider.id] = flagship;
|
|
242
|
-
return {
|
|
243
|
-
id: provider.id,
|
|
244
|
-
name: provider.name,
|
|
245
|
-
source: provider.keyless ? 'api' : 'env',
|
|
246
|
-
models: Object.fromEntries(models.map((model) => {
|
|
247
|
-
const variantIds = nativeVariantIds(model);
|
|
248
|
-
return [
|
|
249
|
-
model.id,
|
|
250
|
-
{
|
|
251
|
-
id: model.id,
|
|
252
|
-
name: model.name,
|
|
253
|
-
...(model.released ? { release_date: model.released } : {}),
|
|
254
|
-
// Metadata parity with the runtime list: `family` +
|
|
255
|
-
// `release_date` feed the picker's newest-per-family default
|
|
256
|
-
// view (without them EVERY historical version rendered, ids
|
|
257
|
-
// sharing a display name showed as duplicates); the
|
|
258
|
-
// capability flags feed the badges; `variants` feeds the
|
|
259
|
-
// thinking-mode row. All read by flattenModels' LooseModel
|
|
260
|
-
// branch under the exact same keys the runtime serves.
|
|
261
|
-
...(model.family ? { family: model.family } : {}),
|
|
262
|
-
...(model.reasoning !== undefined ? { reasoning: model.reasoning } : {}),
|
|
263
|
-
...(model.reasoning_options ? { reasoning_options: model.reasoning_options } : {}),
|
|
264
|
-
...(model.tool_call !== undefined ? { tool_call: model.tool_call } : {}),
|
|
265
|
-
...(model.attachment !== undefined ? { attachment: model.attachment } : {}),
|
|
266
|
-
...(model.modalities ? { modalities: model.modalities } : {}),
|
|
267
|
-
...(model.limit ? { limit: model.limit } : {}),
|
|
268
|
-
...(model.cost ? { cost: model.cost } : {}),
|
|
269
|
-
...(model.description ? { description: model.description } : {}),
|
|
270
|
-
...(model.open_weights !== undefined ? { open_weights: model.open_weights } : {}),
|
|
271
|
-
...(model.last_updated ? { last_updated: model.last_updated } : {}),
|
|
272
|
-
...(variantIds.length > 0
|
|
273
|
-
? { variants: Object.fromEntries(variantIds.map((id) => [id, {}])) }
|
|
274
|
-
: {}),
|
|
275
|
-
},
|
|
276
|
-
];
|
|
277
|
-
})),
|
|
278
|
-
};
|
|
279
|
-
});
|
|
280
|
-
return {
|
|
281
|
-
all,
|
|
282
|
-
connected: all.map((provider) => provider.id),
|
|
283
|
-
default: defaults,
|
|
284
|
-
};
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* ONE native picker across sandbox states. Pre-boot the picker reads the
|
|
288
|
-
* catalog synthesis (`nativeProviderListFromCatalog`); once the runtime
|
|
289
|
-
* reports `/config/providers` it is the truth for what the box can actually
|
|
290
|
-
* serve. Swapping sources on boot changed the picker under the user (provider
|
|
291
|
-
* order, Zen appearing, the auto-picked default flipping). Merged instead:
|
|
292
|
-
*
|
|
293
|
-
* - shared provider ids take the RUNTIME object (real variant settings, the
|
|
294
|
-
* box's exact model set), in CATALOG order (flagship rank);
|
|
295
|
-
* - runtime-only providers (Zen, auth.json logins) append after;
|
|
296
|
-
* - the curated catalog default wins per provider while the runtime serves
|
|
297
|
-
* that model, else the runtime default — the auto-pick is stable across
|
|
298
|
-
* boot and never names a model the box cannot run.
|
|
299
|
-
*/
|
|
300
|
-
export function mergeNativeProviderLists(catalog, runtime) {
|
|
301
|
-
if (!catalog)
|
|
302
|
-
return runtime;
|
|
303
|
-
if (!runtime)
|
|
304
|
-
return catalog;
|
|
305
|
-
const first = normalizeProviderList(catalog);
|
|
306
|
-
const second = normalizeProviderList(runtime);
|
|
307
|
-
const runtimeById = new Map();
|
|
308
|
-
for (const provider of Array.isArray(second.all) ? second.all : []) {
|
|
309
|
-
runtimeById.set(provider.id, provider);
|
|
310
|
-
}
|
|
311
|
-
const all = [];
|
|
312
|
-
const seen = new Set();
|
|
313
|
-
for (const provider of Array.isArray(first.all) ? first.all : []) {
|
|
314
|
-
all.push(runtimeById.get(provider.id) ?? provider);
|
|
315
|
-
seen.add(provider.id);
|
|
316
|
-
}
|
|
317
|
-
for (const provider of Array.isArray(second.all) ? second.all : []) {
|
|
318
|
-
if (!seen.has(provider.id)) {
|
|
319
|
-
all.push(provider);
|
|
320
|
-
seen.add(provider.id);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
const connected = [];
|
|
324
|
-
const connectedSeen = new Set();
|
|
325
|
-
for (const id of [
|
|
326
|
-
...(Array.isArray(first.connected) ? first.connected : []),
|
|
327
|
-
...(Array.isArray(second.connected) ? second.connected : []),
|
|
328
|
-
]) {
|
|
329
|
-
if (!connectedSeen.has(id)) {
|
|
330
|
-
connected.push(id);
|
|
331
|
-
connectedSeen.add(id);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
const defaults = { ...(second.default ?? {}) };
|
|
335
|
-
for (const [providerId, modelId] of Object.entries(first.default ?? {})) {
|
|
336
|
-
const runtimeProvider = runtimeById.get(providerId);
|
|
337
|
-
if (!runtimeProvider || (runtimeProvider.models && modelId in runtimeProvider.models)) {
|
|
338
|
-
defaults[providerId] = modelId;
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
return { ...second, all, connected, default: defaults };
|
|
342
|
-
}
|
|
343
139
|
export function connectedGatewayProviderIdsFromSecretNames(secretNames) {
|
|
344
140
|
const ids = new Set();
|
|
345
141
|
for (const provider of LLM_PROVIDER_CREDENTIALS) {
|
|
@@ -413,38 +209,15 @@ export function projectLlmCatalogToProviderList(catalog) {
|
|
|
413
209
|
],
|
|
414
210
|
};
|
|
415
211
|
}
|
|
416
|
-
/**
|
|
417
|
-
* A project session runtime's `/provider` answer, as the native picker reads
|
|
418
|
-
* it: normalized, providers the project's secrets connect marked connected,
|
|
419
|
-
* and the gateway's `kortix` provider removed.
|
|
420
|
-
*/
|
|
421
|
-
export function nativeRuntimeProviderList(runtime, secretNames) {
|
|
422
|
-
return filterToNativeProviders(mergeProjectSecretConnectedProviders(normalizeProviderList(runtime), secretNames, LLM_PROVIDER_CREDENTIALS));
|
|
423
|
-
}
|
|
424
212
|
/**
|
|
425
213
|
* The provider list a project composer's model picker renders — the same
|
|
426
|
-
*
|
|
427
|
-
* `
|
|
428
|
-
*
|
|
429
|
-
* - Gateway: the `/model-picker` catalog as the single `kortix` provider
|
|
430
|
-
* (`auto` dropped, per-model `enabled` kept).
|
|
431
|
-
* - Native: the catalog synthesis (connected by secret names) merged with the
|
|
432
|
-
* runtime list — runtime objects win, catalog order and curated defaults
|
|
433
|
-
* stay. A model-less runtime answer is a sandbox still wiring its providers
|
|
434
|
-
* and is ignored.
|
|
214
|
+
* source `useRuntimeProviders` reads: the `/model-picker` catalog as the
|
|
215
|
+
* single `kortix` provider (`auto` dropped, per-model `enabled` kept). Feed
|
|
216
|
+
* the result to `flattenModels(list)`.
|
|
435
217
|
*
|
|
436
218
|
* `undefined` = nothing loaded yet.
|
|
437
219
|
*/
|
|
438
220
|
export function pickerProviderList(input) {
|
|
439
|
-
|
|
440
|
-
return input.modelPicker ? projectLlmCatalogToProviderList(input.modelPicker) : undefined;
|
|
441
|
-
}
|
|
442
|
-
const secretNames = input.secretNames ?? new Set();
|
|
443
|
-
const runtime = input.runtimeProviders
|
|
444
|
-
? nativeRuntimeProviderList(input.runtimeProviders, secretNames)
|
|
445
|
-
: undefined;
|
|
446
|
-
return mergeNativeProviderLists(input.llmCatalogProviders
|
|
447
|
-
? nativeProviderListFromCatalog(input.llmCatalogProviders, secretNames)
|
|
448
|
-
: undefined, providerListHasModels(runtime) ? runtime : undefined);
|
|
221
|
+
return input.modelPicker ? projectLlmCatalogToProviderList(input.modelPicker) : undefined;
|
|
449
222
|
}
|
|
450
223
|
//# sourceMappingURL=provider-selection.js.map
|