@kortix/sdk 0.13.40 → 0.13.42
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 +40 -7
- package/dist/browser/session-sync/server-transcript-mirror.d.ts +7 -4
- package/dist/browser/session-sync/server-transcript-mirror.d.ts.map +1 -1
- package/dist/browser/session-sync/server-transcript-mirror.js +18 -4
- package/dist/browser/session-sync/server-transcript-mirror.js.map +1 -1
- package/dist/browser/stores/sandbox-connection-store.d.ts +1 -10
- package/dist/browser/stores/sandbox-connection-store.d.ts.map +1 -1
- package/dist/browser/stores/sandbox-connection-store.js +11 -1
- package/dist/browser/stores/sandbox-connection-store.js.map +1 -1
- package/dist/browser/stores/sync-store/reconcile-parts.d.ts +14 -0
- package/dist/browser/stores/sync-store/reconcile-parts.d.ts.map +1 -0
- package/dist/browser/stores/sync-store/reconcile-parts.js +55 -0
- package/dist/browser/stores/sync-store/reconcile-parts.js.map +1 -0
- package/dist/browser/stores/sync-store.d.ts.map +1 -1
- package/dist/browser/stores/sync-store.js +11 -92
- package/dist/browser/stores/sync-store.js.map +1 -1
- package/dist/core/agents/composer-agents.d.ts +73 -0
- package/dist/core/agents/composer-agents.d.ts.map +1 -0
- package/dist/core/agents/composer-agents.js +100 -0
- package/dist/core/agents/composer-agents.js.map +1 -0
- package/dist/core/cache/persisted-query-cache.d.ts.map +1 -1
- package/dist/core/cache/persisted-query-cache.js +9 -0
- package/dist/core/cache/persisted-query-cache.js.map +1 -1
- package/dist/core/client/kortix.d.ts +44 -3
- package/dist/core/client/kortix.d.ts.map +1 -1
- package/dist/core/client/kortix.js +22 -1
- package/dist/core/client/kortix.js.map +1 -1
- package/dist/core/models/bedrock-invokable.d.ts +58 -0
- package/dist/core/models/bedrock-invokable.d.ts.map +1 -0
- package/dist/core/models/bedrock-invokable.js +83 -0
- package/dist/core/models/bedrock-invokable.js.map +1 -0
- package/dist/core/models/composer-model.d.ts +51 -0
- package/dist/core/models/composer-model.d.ts.map +1 -0
- package/dist/core/models/composer-model.js +88 -0
- package/dist/core/models/composer-model.js.map +1 -0
- package/dist/core/models/model-flatten.d.ts +90 -0
- package/dist/core/models/model-flatten.d.ts.map +1 -0
- package/dist/core/models/model-flatten.js +88 -0
- package/dist/core/models/model-flatten.js.map +1 -0
- package/dist/core/models/model-key.d.ts +18 -0
- package/dist/core/models/model-key.d.ts.map +1 -0
- package/dist/core/models/model-key.js +16 -0
- package/dist/core/models/model-key.js.map +1 -0
- package/dist/core/models/model-lookup.d.ts +3 -0
- package/dist/core/models/model-lookup.d.ts.map +1 -0
- package/dist/core/models/model-lookup.js +4 -0
- package/dist/core/models/model-lookup.js.map +1 -0
- package/dist/core/models/model-visibility.d.ts +85 -0
- package/dist/core/models/model-visibility.d.ts.map +1 -0
- package/dist/core/models/model-visibility.js +215 -0
- package/dist/core/models/model-visibility.js.map +1 -0
- package/dist/core/models/provider-selection.d.ts +142 -0
- package/dist/core/models/provider-selection.d.ts.map +1 -0
- package/dist/core/models/provider-selection.js +472 -0
- package/dist/core/models/provider-selection.js.map +1 -0
- package/dist/core/rest/platform-client/host-boundary.d.ts +4 -0
- package/dist/core/rest/platform-client/host-boundary.d.ts.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.js.map +1 -1
- package/dist/core/rest/projects-client/access.d.ts +6 -1
- package/dist/core/rest/projects-client/access.d.ts.map +1 -1
- package/dist/core/rest/projects-client/access.js +3 -1
- package/dist/core/rest/projects-client/access.js.map +1 -1
- package/dist/core/rest/projects-client/account-secret-resources.d.ts +7 -0
- package/dist/core/rest/projects-client/account-secret-resources.d.ts.map +1 -1
- package/dist/core/rest/projects-client/account-secret-resources.js.map +1 -1
- package/dist/core/rest/projects-client/agent-config.d.ts +4 -0
- package/dist/core/rest/projects-client/agent-config.d.ts.map +1 -1
- package/dist/core/rest/projects-client/agent-config.js.map +1 -1
- package/dist/core/rest/projects-client/connectors.d.ts +58 -2
- package/dist/core/rest/projects-client/connectors.d.ts.map +1 -1
- package/dist/core/rest/projects-client/connectors.js +27 -3
- package/dist/core/rest/projects-client/connectors.js.map +1 -1
- package/dist/core/rest/projects-client/github.d.ts +25 -0
- package/dist/core/rest/projects-client/github.d.ts.map +1 -1
- package/dist/core/rest/projects-client/github.js +19 -0
- package/dist/core/rest/projects-client/github.js.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/project-agents.d.ts +29 -0
- package/dist/core/rest/projects-client/project-agents.d.ts.map +1 -0
- package/dist/core/rest/projects-client/project-agents.js +41 -0
- package/dist/core/rest/projects-client/project-agents.js.map +1 -0
- package/dist/core/rest/projects-client/projects.d.ts +24 -4
- package/dist/core/rest/projects-client/projects.d.ts.map +1 -1
- package/dist/core/rest/projects-client/projects.js +8 -3
- package/dist/core/rest/projects-client/projects.js.map +1 -1
- package/dist/core/rest/projects-client/review-items.d.ts +3 -0
- package/dist/core/rest/projects-client/review-items.d.ts.map +1 -1
- package/dist/core/rest/projects-client/review-items.js +1 -0
- package/dist/core/rest/projects-client/review-items.js.map +1 -1
- package/dist/core/rest/projects-client/session-reminders.d.ts +63 -0
- package/dist/core/rest/projects-client/session-reminders.d.ts.map +1 -0
- package/dist/core/rest/projects-client/session-reminders.js +29 -0
- package/dist/core/rest/projects-client/session-reminders.js.map +1 -0
- package/dist/core/rest/projects-client/sessions.d.ts +35 -0
- package/dist/core/rest/projects-client/sessions.d.ts.map +1 -1
- package/dist/core/rest/projects-client/sessions.js +14 -1
- package/dist/core/rest/projects-client/sessions.js.map +1 -1
- package/dist/core/rest/projects-client/setup-links.d.ts +2 -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/tokens.d.ts +30 -0
- package/dist/core/rest/projects-client/tokens.d.ts.map +1 -1
- package/dist/core/rest/projects-client/tokens.js +11 -0
- package/dist/core/rest/projects-client/tokens.js.map +1 -1
- package/dist/core/runtime/kortix-master.d.ts +74 -5
- package/dist/core/runtime/kortix-master.d.ts.map +1 -1
- package/dist/core/runtime/kortix-master.js +78 -5
- package/dist/core/runtime/kortix-master.js.map +1 -1
- package/dist/core/session/connection.d.ts +22 -0
- package/dist/core/session/connection.d.ts.map +1 -1
- package/dist/core/session/connection.js +28 -0
- package/dist/core/session/connection.js.map +1 -1
- package/dist/core/session/status-vocabulary.d.ts +1 -1
- package/dist/core/session/status-vocabulary.js +1 -1
- package/dist/core/session/status-vocabulary.js.map +1 -1
- package/dist/core/session-sync/saved-copy-store.d.ts +5 -1
- package/dist/core/session-sync/saved-copy-store.d.ts.map +1 -1
- package/dist/core/session-sync/saved-copy-store.js +50 -2
- package/dist/core/session-sync/saved-copy-store.js.map +1 -1
- package/dist/core/session-sync/saved-transcript.d.ts +46 -2
- package/dist/core/session-sync/saved-transcript.d.ts.map +1 -1
- package/dist/core/session-sync/saved-transcript.js +40 -0
- package/dist/core/session-sync/saved-transcript.js.map +1 -1
- package/dist/core/session-sync/session-sync-controller.d.ts +2 -0
- package/dist/core/session-sync/session-sync-controller.d.ts.map +1 -1
- package/dist/core/session-sync/session-sync-controller.js +19 -2
- package/dist/core/session-sync/session-sync-controller.js.map +1 -1
- package/dist/core/stream/fetch-sse.d.ts +4 -0
- package/dist/core/stream/fetch-sse.d.ts.map +1 -1
- package/dist/core/stream/fetch-sse.js +4 -0
- package/dist/core/stream/fetch-sse.js.map +1 -1
- package/dist/core/stream/keepalive.d.ts +1 -1
- package/dist/core/stream/keepalive.js +1 -1
- package/dist/core/turns/errors.d.ts +6 -0
- package/dist/core/turns/errors.d.ts.map +1 -1
- package/dist/core/turns/errors.js +7 -1
- package/dist/core/turns/errors.js.map +1 -1
- package/dist/core/turns/parts.d.ts.map +1 -1
- package/dist/core/turns/parts.js +22 -129
- package/dist/core/turns/parts.js.map +1 -1
- package/dist/core/turns/tools/memory-helpers.d.ts +5 -0
- package/dist/core/turns/tools/memory-helpers.d.ts.map +1 -1
- package/dist/core/turns/tools/memory-helpers.js +9 -1
- package/dist/core/turns/tools/memory-helpers.js.map +1 -1
- package/dist/core/turns/tools/skill-helpers.d.ts +1 -1
- package/dist/core/turns/tools/skill-helpers.d.ts.map +1 -1
- package/dist/core/turns/tools/skill-helpers.js +7 -6
- package/dist/core/turns/tools/skill-helpers.js.map +1 -1
- package/dist/core/turns/tools/web-helpers.d.ts.map +1 -1
- package/dist/core/turns/tools/web-helpers.js +79 -139
- package/dist/core/turns/tools/web-helpers.js.map +1 -1
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -0
- 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/bedrock-invokable.d.ts +1 -57
- package/dist/react/bedrock-invokable.d.ts.map +1 -1
- package/dist/react/bedrock-invokable.js +2 -82
- package/dist/react/bedrock-invokable.js.map +1 -1
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +1 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/model-flatten.d.ts +1 -89
- package/dist/react/model-flatten.d.ts.map +1 -1
- package/dist/react/model-flatten.js +2 -85
- package/dist/react/model-flatten.js.map +1 -1
- package/dist/react/model-lookup.d.ts +1 -2
- package/dist/react/model-lookup.d.ts.map +1 -1
- package/dist/react/model-lookup.js +2 -3
- package/dist/react/model-lookup.js.map +1 -1
- package/dist/react/provider-selection.d.ts +1 -107
- package/dist/react/provider-selection.d.ts.map +1 -1
- package/dist/react/provider-selection.js +2 -437
- package/dist/react/provider-selection.js.map +1 -1
- package/dist/react/query-keys.d.ts +19 -1
- package/dist/react/query-keys.d.ts.map +1 -1
- package/dist/react/query-keys.js +25 -54
- package/dist/react/query-keys.js.map +1 -1
- package/dist/react/runtime-actions.d.ts +7 -0
- package/dist/react/runtime-actions.d.ts.map +1 -1
- package/dist/react/runtime-actions.js +7 -0
- package/dist/react/runtime-actions.js.map +1 -1
- package/dist/react/session-cache-write.d.ts +1 -1
- package/dist/react/session-cache-write.d.ts.map +1 -1
- package/dist/react/session-cache-write.js +38 -4
- package/dist/react/session-cache-write.js.map +1 -1
- package/dist/react/sign-in-with-kortix.d.ts +1 -1
- 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 +8 -4
- package/dist/react/use-feature-flag.js.map +1 -1
- package/dist/react/use-kortix-master.d.ts +81 -3
- package/dist/react/use-kortix-master.d.ts.map +1 -1
- package/dist/react/use-kortix-master.js +84 -3
- package/dist/react/use-kortix-master.js.map +1 -1
- package/dist/react/use-model-defaults.d.ts +2 -1
- package/dist/react/use-model-defaults.d.ts.map +1 -1
- package/dist/react/use-model-defaults.js +3 -7
- package/dist/react/use-model-defaults.js.map +1 -1
- package/dist/react/use-model-store.d.ts +3 -44
- package/dist/react/use-model-store.d.ts.map +1 -1
- package/dist/react/use-model-store.js +16 -182
- package/dist/react/use-model-store.js.map +1 -1
- package/dist/react/use-opencode-events/helpers.d.ts.map +1 -1
- package/dist/react/use-opencode-events/helpers.js +5 -0
- package/dist/react/use-opencode-events/helpers.js.map +1 -1
- package/dist/react/use-opencode-local.d.ts.map +1 -1
- package/dist/react/use-opencode-local.js +41 -110
- package/dist/react/use-opencode-local.js.map +1 -1
- package/dist/react/use-opencode-mcp.d.ts +6 -0
- package/dist/react/use-opencode-mcp.d.ts.map +1 -1
- package/dist/react/use-opencode-mcp.js +6 -0
- package/dist/react/use-opencode-mcp.js.map +1 -1
- package/dist/react/use-opencode-sessions/agents.d.ts +2 -7
- package/dist/react/use-opencode-sessions/agents.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/agents.js +4 -28
- package/dist/react/use-opencode-sessions/agents.js.map +1 -1
- package/dist/react/use-opencode-sessions/mcp.d.ts +1 -0
- package/dist/react/use-opencode-sessions/mcp.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/mcp.js +1 -0
- package/dist/react/use-opencode-sessions/mcp.js.map +1 -1
- package/dist/react/use-opencode-sessions/parts.d.ts +4 -0
- package/dist/react/use-opencode-sessions/parts.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/parts.js +4 -0
- package/dist/react/use-opencode-sessions/parts.js.map +1 -1
- package/dist/react/use-opencode-sessions/projects.d.ts +1 -0
- package/dist/react/use-opencode-sessions/projects.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/projects.js +1 -0
- package/dist/react/use-opencode-sessions/projects.js.map +1 -1
- package/dist/react/use-opencode-sessions/providers.d.ts +1 -1
- package/dist/react/use-opencode-sessions/providers.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/providers.js +4 -4
- package/dist/react/use-opencode-sessions/providers.js.map +1 -1
- package/dist/react/use-opencode-sessions/sessions.d.ts +1 -0
- package/dist/react/use-opencode-sessions/sessions.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/sessions.js +1 -0
- package/dist/react/use-opencode-sessions/sessions.js.map +1 -1
- package/dist/react/use-opencode-sessions/sharing.d.ts +2 -0
- package/dist/react/use-opencode-sessions/sharing.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/sharing.js +2 -0
- package/dist/react/use-opencode-sessions/sharing.js.map +1 -1
- package/dist/react/use-opencode-sessions/tools.d.ts +2 -0
- package/dist/react/use-opencode-sessions/tools.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/tools.js +2 -0
- package/dist/react/use-opencode-sessions/tools.js.map +1 -1
- package/dist/react/use-project-sessions.d.ts +221 -1
- package/dist/react/use-project-sessions.d.ts.map +1 -1
- package/dist/react/use-project-sessions.js +27 -1
- package/dist/react/use-project-sessions.js.map +1 -1
- package/dist/react/use-reminders.d.ts +465 -0
- package/dist/react/use-reminders.d.ts.map +1 -0
- package/dist/react/use-reminders.js +50 -0
- package/dist/react/use-reminders.js.map +1 -0
- package/dist/react/use-runtime-reconnect.d.ts +41 -8
- package/dist/react/use-runtime-reconnect.d.ts.map +1 -1
- package/dist/react/use-runtime-reconnect.js +93 -27
- package/dist/react/use-runtime-reconnect.js.map +1 -1
- package/dist/react/use-session-sync.d.ts +7 -0
- package/dist/react/use-session-sync.d.ts.map +1 -1
- package/dist/react/use-session-sync.js +25 -12
- package/dist/react/use-session-sync.js.map +1 -1
- package/dist/react/use-session-transcript-history.d.ts +2 -0
- package/dist/react/use-session-transcript-history.d.ts.map +1 -1
- package/dist/react/use-session-transcript-history.js +3 -0
- package/dist/react/use-session-transcript-history.js.map +1 -1
- package/dist/react/use-session.d.ts +25 -15
- package/dist/react/use-session.d.ts.map +1 -1
- package/dist/react/use-session.js +136 -21
- package/dist/react/use-session.js.map +1 -1
- package/dist/react/use-tunnel.d.ts +59 -7
- package/dist/react/use-tunnel.d.ts.map +1 -1
- package/dist/react/use-tunnel.js +82 -123
- package/dist/react/use-tunnel.js.map +1 -1
- package/dist/react/use-visible-agents.d.ts +5 -5
- package/dist/react/use-visible-agents.d.ts.map +1 -1
- package/dist/react/use-visible-agents.js +10 -28
- package/dist/react/use-visible-agents.js.map +1 -1
- package/package.json +2 -2
- package/dist/core/session-sync/durable-log.d.ts +0 -96
- package/dist/core/session-sync/durable-log.d.ts.map +0 -1
- package/dist/core/session-sync/durable-log.js +0 -94
- package/dist/core/session-sync/durable-log.js.map +0 -1
|
@@ -1,438 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Provider → Kortix-owned auth requirement, derived from the shared
|
|
4
|
-
* models.dev catalog via `providerAuthRequirement` (NOT the raw catalog
|
|
5
|
-
* `env` list — see that function's doc comment for why: models.dev lists
|
|
6
|
-
* every auth method the upstream SDK supports, not what Kortix actually
|
|
7
|
-
* reads). Mirrors the `{ id, authRequirement }` projection of the web's
|
|
8
|
-
* `LLM_PROVIDERS` (built from the same catalog + the same override table),
|
|
9
|
-
* so connection inference is identical without depending on the web-only
|
|
10
|
-
* provider-modal catalog module.
|
|
11
|
-
*
|
|
12
|
-
* Reads `CATALOG_PROVIDER_ENV` (the catalog's `{ id, env }` projection), not
|
|
13
|
-
* `CATALOG`: this module is in every browser route's graph, and `CATALOG` is
|
|
14
|
-
* the full ~7.6 MB models.dev snapshot.
|
|
15
|
-
*/
|
|
16
|
-
export const LLM_PROVIDER_CREDENTIALS = CATALOG_PROVIDER_ENV.map((provider) => ({
|
|
17
|
-
id: provider.id,
|
|
18
|
-
authRequirement: providerAuthRequirement(provider),
|
|
19
|
-
}));
|
|
20
|
-
// In gateway mode OpenCode must see Kortix as the single LLM provider. Native
|
|
21
|
-
// providers, including OpenCode Zen, belong only to native mode.
|
|
22
|
-
export const GATEWAY_PROVIDER_IDS = new Set(['kortix']);
|
|
23
|
-
const NATIVE_EXCLUDED_PROVIDER_IDS = new Set(['kortix']);
|
|
24
|
-
export function normalizeProviderList(providers) {
|
|
25
|
-
const modernAll = Array.isArray(providers.all) ? providers.all : [];
|
|
26
|
-
const modernConnected = Array.isArray(providers.connected) ? providers.connected : [];
|
|
27
|
-
if (modernAll.length > 0 || modernConnected.length > 0) {
|
|
28
|
-
return {
|
|
29
|
-
...providers,
|
|
30
|
-
all: modernAll,
|
|
31
|
-
connected: modernConnected,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
// Legacy responses carried providers under `.providers` instead of `.all` —
|
|
35
|
-
// not part of the modern `ProviderListResponse` type, so duck-type via
|
|
36
|
-
// `unknown` rather than assume that (long-gone) legacy shape is still real.
|
|
37
|
-
const maybeLegacy = providers.providers;
|
|
38
|
-
const legacyProviders = Array.isArray(maybeLegacy)
|
|
39
|
-
? maybeLegacy
|
|
40
|
-
: [];
|
|
41
|
-
if (legacyProviders.length === 0) {
|
|
42
|
-
return {
|
|
43
|
-
...providers,
|
|
44
|
-
all: [],
|
|
45
|
-
connected: [],
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
return {
|
|
49
|
-
...providers,
|
|
50
|
-
all: legacyProviders,
|
|
51
|
-
connected: legacyProviders.map((provider) => provider.id),
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* True when a provider-list response actually carries usable models — i.e. at
|
|
56
|
-
* least one CONNECTED provider that exposes >=1 model. A response failing this
|
|
57
|
-
* is a transient boot state, not a real answer.
|
|
58
|
-
*/
|
|
59
|
-
export function providerListHasModels(providers) {
|
|
60
|
-
if (!providers)
|
|
61
|
-
return false;
|
|
62
|
-
const normalized = normalizeProviderList(providers);
|
|
63
|
-
const all = Array.isArray(normalized.all) ? normalized.all : [];
|
|
64
|
-
const connected = Array.isArray(normalized.connected) ? normalized.connected : [];
|
|
65
|
-
if (connected.length === 0)
|
|
66
|
-
return false;
|
|
67
|
-
return all.some((p) => connected.includes(p.id) && p.models && Object.keys(p.models).length > 0);
|
|
68
|
-
}
|
|
69
|
-
export function providerListHasGateway(providers) {
|
|
70
|
-
if (!providers)
|
|
71
|
-
return false;
|
|
72
|
-
const normalized = normalizeProviderList(providers);
|
|
73
|
-
const all = Array.isArray(normalized.all) ? normalized.all : [];
|
|
74
|
-
const connected = Array.isArray(normalized.connected) ? normalized.connected : [];
|
|
75
|
-
return connected.includes('kortix') || all.some((p) => p.id === 'kortix');
|
|
76
|
-
}
|
|
77
|
-
export function filterToGatewayProviders(providers) {
|
|
78
|
-
const normalized = normalizeProviderList(providers);
|
|
79
|
-
const all = Array.isArray(normalized.all) ? normalized.all : [];
|
|
80
|
-
const connected = Array.isArray(normalized.connected) ? normalized.connected : [];
|
|
81
|
-
return {
|
|
82
|
-
...normalized,
|
|
83
|
-
all: all.filter((p) => GATEWAY_PROVIDER_IDS.has(p.id)),
|
|
84
|
-
connected: connected.filter((id) => GATEWAY_PROVIDER_IDS.has(id)),
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
export function mergeProviderLists(primary, secondary) {
|
|
88
|
-
const first = normalizeProviderList(primary);
|
|
89
|
-
const second = normalizeProviderList(secondary);
|
|
90
|
-
const all = new Map();
|
|
91
|
-
for (const provider of Array.isArray(first.all) ? first.all : []) {
|
|
92
|
-
all.set(provider.id, provider);
|
|
93
|
-
}
|
|
94
|
-
for (const provider of Array.isArray(second.all) ? second.all : []) {
|
|
95
|
-
all.set(provider.id, provider);
|
|
96
|
-
}
|
|
97
|
-
const connected = new Set();
|
|
98
|
-
for (const id of Array.isArray(first.connected) ? first.connected : [])
|
|
99
|
-
connected.add(id);
|
|
100
|
-
for (const id of Array.isArray(second.connected) ? second.connected : [])
|
|
101
|
-
connected.add(id);
|
|
102
|
-
return {
|
|
103
|
-
...first,
|
|
104
|
-
all: [...all.values()],
|
|
105
|
-
connected: [...connected],
|
|
106
|
-
default: { ...(first.default ?? {}), ...(second.default ?? {}) },
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
export function filterToNativeProviders(providers) {
|
|
110
|
-
const normalized = normalizeProviderList(providers);
|
|
111
|
-
const all = Array.isArray(normalized.all) ? normalized.all : [];
|
|
112
|
-
const connected = Array.isArray(normalized.connected) ? normalized.connected : [];
|
|
113
|
-
return {
|
|
114
|
-
...normalized,
|
|
115
|
-
all: all.filter((p) => !NATIVE_EXCLUDED_PROVIDER_IDS.has(p.id)),
|
|
116
|
-
connected: connected.filter((id) => !NATIVE_EXCLUDED_PROVIDER_IDS.has(id)),
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
export function mergeProjectSecretConnectedProviders(providers, secretNames, providerCredentials) {
|
|
120
|
-
const normalized = normalizeProviderList(providers);
|
|
121
|
-
const all = Array.isArray(normalized.all) ? normalized.all : [];
|
|
122
|
-
const allIds = new Set(all.map((provider) => provider.id));
|
|
123
|
-
const connected = new Set(Array.isArray(normalized.connected) ? normalized.connected : []);
|
|
124
|
-
for (const provider of providerCredentials) {
|
|
125
|
-
if (allIds.has(provider.id) &&
|
|
126
|
-
isProviderAuthSatisfied(provider.authRequirement, (envVar) => secretNames.has(envVar))) {
|
|
127
|
-
connected.add(provider.id);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
if (allIds.has('codex') &&
|
|
131
|
-
(secretNames.has('CODEX_AUTH_JSON') || secretNames.has('OPENCODE_AUTH_JSON'))) {
|
|
132
|
-
connected.add('codex');
|
|
133
|
-
}
|
|
134
|
-
return { ...normalized, connected: [...connected] };
|
|
135
|
-
}
|
|
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
|
-
/**
|
|
160
|
-
* Which model a provider should DEFAULT to when the user has picked nothing.
|
|
161
|
-
* Mirrors the API picker's table (apps/api/src/llm-gateway/models/
|
|
162
|
-
* picker-catalog.ts FLAGSHIP_CANDIDATES) — first candidate present in the
|
|
163
|
-
* catalog wins; a provider not listed (or whose candidates are absent) falls
|
|
164
|
-
* back to its most recently released model. Without this the very first
|
|
165
|
-
* message of a native project ran on whatever model happened to sort first in
|
|
166
|
-
* the models.dev file (observed live: `Hy-MT2-30B-A3B`, which OpenRouter
|
|
167
|
-
* refused with "No endpoints found that support tool use").
|
|
168
|
-
*/
|
|
169
|
-
const NATIVE_FLAGSHIP_CANDIDATES = {
|
|
170
|
-
anthropic: ['claude-opus-4-8', 'claude-sonnet-4-6'],
|
|
171
|
-
openai: ['gpt-5.5', 'gpt-5.1', 'gpt-5', 'gpt-4.1'],
|
|
172
|
-
google: ['gemini-3-pro-preview', 'gemini-2.5-pro', 'gemini-2.0-flash'],
|
|
173
|
-
'x-ai': ['grok-4', 'grok-3'],
|
|
174
|
-
xai: ['grok-4', 'grok-3'],
|
|
175
|
-
deepseek: ['deepseek-chat', 'deepseek-reasoner'],
|
|
176
|
-
mistral: ['mistral-large-latest', 'mistral-large'],
|
|
177
|
-
groq: ['llama-3.3-70b-versatile'],
|
|
178
|
-
perplexity: ['sonar-pro', 'sonar'],
|
|
179
|
-
openrouter: ['anthropic/claude-sonnet-4.6', 'anthropic/claude-sonnet-4.5', 'openai/gpt-5.2'],
|
|
180
|
-
};
|
|
181
|
-
/** Table providers first, in table order — "first connected provider" then
|
|
182
|
-
* favors a direct flagship provider over e.g. OpenRouter's 350-model sprawl. */
|
|
183
|
-
const NATIVE_PROVIDER_RANK = new Map(Object.keys(NATIVE_FLAGSHIP_CANDIDATES).map((id, index) => [id, index]));
|
|
184
|
-
/**
|
|
185
|
-
* Variant IDS for a model's thinking-mode row, mirroring how opencode itself
|
|
186
|
-
* derives variants from the same models.dev `reasoning_options`
|
|
187
|
-
* (opencode packages/opencode/src/provider/transform.ts `reasoningVariants`):
|
|
188
|
-
* an `effort` knob contributes its published values verbatim (null → 'none'),
|
|
189
|
-
* a `budget_tokens` knob contributes the synthesized high/max pair, anything
|
|
190
|
-
* else contributes nothing. IDs only — the runtime owns the actual variant
|
|
191
|
-
* SETTINGS and replaces this list wholesale the moment it loads, so a
|
|
192
|
-
* pre-runtime pick lands on a runtime variant of the same name.
|
|
193
|
-
*/
|
|
194
|
-
function nativeVariantIds(model) {
|
|
195
|
-
const options = model.reasoning_options ?? [];
|
|
196
|
-
const effort = options.find((option) => option.type === 'effort');
|
|
197
|
-
if (effort) {
|
|
198
|
-
return (effort.values ?? []).flatMap((value) => {
|
|
199
|
-
if (value === null)
|
|
200
|
-
return ['none'];
|
|
201
|
-
return typeof value === 'string' ? [value] : [];
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
if (options.some((option) => option.type === 'budget_tokens'))
|
|
205
|
-
return ['high', 'max'];
|
|
206
|
-
return [];
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* OpenCode Zen — opencode's own provider. The runtime auto-connects it with
|
|
210
|
-
* its FREE models even when no `OPENCODE_API_KEY` exists (opencode
|
|
211
|
-
* packages/opencode/src/provider/provider.ts: the `opencode` provider is
|
|
212
|
-
* always loaded, keyless it is trimmed to zero-cost models). The pre-runtime
|
|
213
|
-
* source mirrors that so a booting sandbox never adds a provider the
|
|
214
|
-
* pre-boot picker did not show.
|
|
215
|
-
*/
|
|
216
|
-
const ZEN_PROVIDER_ID = 'opencode';
|
|
217
|
-
function isFreeModel(model) {
|
|
218
|
-
return model.cost?.input === 0 && model.cost?.output === 0;
|
|
219
|
-
}
|
|
220
|
-
function providerRank(id) {
|
|
221
|
-
// Keyed table providers first (table order), then every other keyed
|
|
222
|
-
// provider, Zen's keyless free tier last — "first connected provider" is
|
|
223
|
-
// what the composer auto-picks, and a free preview model must never beat a
|
|
224
|
-
// provider the user paid to connect.
|
|
225
|
-
if (id === ZEN_PROVIDER_ID)
|
|
226
|
-
return Number.MAX_SAFE_INTEGER;
|
|
227
|
-
return NATIVE_PROVIDER_RANK.get(id) ?? Number.MAX_SAFE_INTEGER - 1;
|
|
228
|
-
}
|
|
229
|
-
export function nativeProviderListFromCatalog(catalog, secretNames) {
|
|
230
|
-
const connectedIds = connectedGatewayProviderIdsFromSecretNames(secretNames);
|
|
231
|
-
const defaults = {};
|
|
232
|
-
const all = (catalog.providers ?? [])
|
|
233
|
-
.map((provider) => {
|
|
234
|
-
// opencode hides every model models.dev marks `status: "deprecated"`
|
|
235
|
-
// (core/src/plugin/provider/opencode.ts: `enabled = status !==
|
|
236
|
-
// "deprecated"`), so the runtime never lists them. Dev 2026-08-25:
|
|
237
|
-
// 29 free Zen models in the box's models.json, 7 served.
|
|
238
|
-
const live = (provider.models ?? []).filter((model) => model.status !== 'deprecated');
|
|
239
|
-
return provider.id === ZEN_PROVIDER_ID && !connectedIds.has(ZEN_PROVIDER_ID)
|
|
240
|
-
? { ...provider, models: live.filter(isFreeModel), keyless: true }
|
|
241
|
-
: { ...provider, models: live, keyless: false };
|
|
242
|
-
})
|
|
243
|
-
.filter((provider) => (provider.keyless || connectedIds.has(provider.id)) &&
|
|
244
|
-
!NATIVE_EXCLUDED_PROVIDER_IDS.has(provider.id) &&
|
|
245
|
-
(provider.models?.length ?? 0) > 0)
|
|
246
|
-
.sort((a, b) => providerRank(a.id) - providerRank(b.id))
|
|
247
|
-
.map((provider) => {
|
|
248
|
-
// Newest first: the picker's visual order and the "first model" fallback
|
|
249
|
-
// both read insertion order. On a release-date tie a Bedrock inference
|
|
250
|
-
// profile sorts ahead of its bare in-region twin — the bare id is the
|
|
251
|
-
// one Bedrock refuses with "on-demand throughput isn't supported".
|
|
252
|
-
const models = [...provider.models].sort((a, b) => (b.released ?? '').localeCompare(a.released ?? '') ||
|
|
253
|
-
bedrockInferenceProfileRank(b.id) - bedrockInferenceProfileRank(a.id));
|
|
254
|
-
const ids = new Set(models.map((model) => model.id));
|
|
255
|
-
// `autoSeedDefaultModel` (not `models[0]`) is the data-driven fallback:
|
|
256
|
-
// it drops the bare Bedrock ids whenever the provider serves inference
|
|
257
|
-
// profiles, so a fresh Bedrock-BYOK workspace can never be auto-seeded
|
|
258
|
-
// with an id Bedrock rejects. See its doc comment for the live incident.
|
|
259
|
-
const flagship = (NATIVE_FLAGSHIP_CANDIDATES[provider.id] ?? []).find((candidate) => ids.has(candidate)) ??
|
|
260
|
-
autoSeedDefaultModel(models)?.id ??
|
|
261
|
-
models[0]?.id;
|
|
262
|
-
if (flagship)
|
|
263
|
-
defaults[provider.id] = flagship;
|
|
264
|
-
return {
|
|
265
|
-
id: provider.id,
|
|
266
|
-
name: provider.name,
|
|
267
|
-
source: provider.keyless ? 'api' : 'env',
|
|
268
|
-
models: Object.fromEntries(models.map((model) => {
|
|
269
|
-
const variantIds = nativeVariantIds(model);
|
|
270
|
-
return [
|
|
271
|
-
model.id,
|
|
272
|
-
{
|
|
273
|
-
id: model.id,
|
|
274
|
-
name: model.name,
|
|
275
|
-
...(model.released ? { release_date: model.released } : {}),
|
|
276
|
-
// Metadata parity with the runtime list: `family` +
|
|
277
|
-
// `release_date` feed the picker's newest-per-family default
|
|
278
|
-
// view (without them EVERY historical version rendered, ids
|
|
279
|
-
// sharing a display name showed as duplicates); the
|
|
280
|
-
// capability flags feed the badges; `variants` feeds the
|
|
281
|
-
// thinking-mode row. All read by flattenModels' LooseModel
|
|
282
|
-
// branch under the exact same keys the runtime serves.
|
|
283
|
-
...(model.family ? { family: model.family } : {}),
|
|
284
|
-
...(model.reasoning !== undefined ? { reasoning: model.reasoning } : {}),
|
|
285
|
-
...(model.reasoning_options ? { reasoning_options: model.reasoning_options } : {}),
|
|
286
|
-
...(model.tool_call !== undefined ? { tool_call: model.tool_call } : {}),
|
|
287
|
-
...(model.attachment !== undefined ? { attachment: model.attachment } : {}),
|
|
288
|
-
...(model.modalities ? { modalities: model.modalities } : {}),
|
|
289
|
-
...(model.limit ? { limit: model.limit } : {}),
|
|
290
|
-
...(model.cost ? { cost: model.cost } : {}),
|
|
291
|
-
...(model.description ? { description: model.description } : {}),
|
|
292
|
-
...(model.open_weights !== undefined ? { open_weights: model.open_weights } : {}),
|
|
293
|
-
...(model.last_updated ? { last_updated: model.last_updated } : {}),
|
|
294
|
-
...(variantIds.length > 0
|
|
295
|
-
? { variants: Object.fromEntries(variantIds.map((id) => [id, {}])) }
|
|
296
|
-
: {}),
|
|
297
|
-
},
|
|
298
|
-
];
|
|
299
|
-
})),
|
|
300
|
-
};
|
|
301
|
-
});
|
|
302
|
-
return {
|
|
303
|
-
all,
|
|
304
|
-
connected: all.map((provider) => provider.id),
|
|
305
|
-
default: defaults,
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* ONE native picker across sandbox states. Pre-boot the picker reads the
|
|
310
|
-
* catalog synthesis (`nativeProviderListFromCatalog`); once the runtime
|
|
311
|
-
* reports `/config/providers` it is the truth for what the box can actually
|
|
312
|
-
* serve. Swapping sources on boot changed the picker under the user (provider
|
|
313
|
-
* order, Zen appearing, the auto-picked default flipping). Merged instead:
|
|
314
|
-
*
|
|
315
|
-
* - shared provider ids take the RUNTIME object (real variant settings, the
|
|
316
|
-
* box's exact model set), in CATALOG order (flagship rank);
|
|
317
|
-
* - runtime-only providers (Zen, auth.json logins) append after;
|
|
318
|
-
* - the curated catalog default wins per provider while the runtime serves
|
|
319
|
-
* that model, else the runtime default — the auto-pick is stable across
|
|
320
|
-
* boot and never names a model the box cannot run.
|
|
321
|
-
*/
|
|
322
|
-
export function mergeNativeProviderLists(catalog, runtime) {
|
|
323
|
-
if (!catalog)
|
|
324
|
-
return runtime;
|
|
325
|
-
if (!runtime)
|
|
326
|
-
return catalog;
|
|
327
|
-
const first = normalizeProviderList(catalog);
|
|
328
|
-
const second = normalizeProviderList(runtime);
|
|
329
|
-
const runtimeById = new Map();
|
|
330
|
-
for (const provider of Array.isArray(second.all) ? second.all : []) {
|
|
331
|
-
runtimeById.set(provider.id, provider);
|
|
332
|
-
}
|
|
333
|
-
const all = [];
|
|
334
|
-
const seen = new Set();
|
|
335
|
-
for (const provider of Array.isArray(first.all) ? first.all : []) {
|
|
336
|
-
all.push(runtimeById.get(provider.id) ?? provider);
|
|
337
|
-
seen.add(provider.id);
|
|
338
|
-
}
|
|
339
|
-
for (const provider of Array.isArray(second.all) ? second.all : []) {
|
|
340
|
-
if (!seen.has(provider.id)) {
|
|
341
|
-
all.push(provider);
|
|
342
|
-
seen.add(provider.id);
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
const connected = [];
|
|
346
|
-
const connectedSeen = new Set();
|
|
347
|
-
for (const id of [
|
|
348
|
-
...(Array.isArray(first.connected) ? first.connected : []),
|
|
349
|
-
...(Array.isArray(second.connected) ? second.connected : []),
|
|
350
|
-
]) {
|
|
351
|
-
if (!connectedSeen.has(id)) {
|
|
352
|
-
connected.push(id);
|
|
353
|
-
connectedSeen.add(id);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
const defaults = { ...(second.default ?? {}) };
|
|
357
|
-
for (const [providerId, modelId] of Object.entries(first.default ?? {})) {
|
|
358
|
-
const runtimeProvider = runtimeById.get(providerId);
|
|
359
|
-
if (!runtimeProvider || (runtimeProvider.models && modelId in runtimeProvider.models)) {
|
|
360
|
-
defaults[providerId] = modelId;
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
return { ...second, all, connected, default: defaults };
|
|
364
|
-
}
|
|
365
|
-
export function connectedGatewayProviderIdsFromSecretNames(secretNames) {
|
|
366
|
-
const ids = new Set();
|
|
367
|
-
for (const provider of LLM_PROVIDER_CREDENTIALS) {
|
|
368
|
-
if (isProviderAuthSatisfied(provider.authRequirement, (envVar) => secretNames.has(envVar))) {
|
|
369
|
-
ids.add(provider.id);
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
if (secretNames.has('CODEX_AUTH_JSON') || secretNames.has('OPENCODE_AUTH_JSON')) {
|
|
373
|
-
ids.add('codex');
|
|
374
|
-
}
|
|
375
|
-
return ids;
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
|
-
* Restamp `enabled` on a gateway ProviderListResponse from an overrides map
|
|
379
|
-
* (`wireModelId -> enabled`), touching only the models the map names. Pure —
|
|
380
|
-
* returns a new list. Used to optimistically update the cached
|
|
381
|
-
* `['project-providers', :id, 'gateway']` query when "Manage models" writes an
|
|
382
|
-
* override, so the session picker (which renders from THAT cache, staleTime
|
|
383
|
-
* Infinity) reflects the toggle without waiting for the refetch.
|
|
384
|
-
*/
|
|
385
|
-
export function applyEnablementToProviderList(providers, overrides) {
|
|
386
|
-
const all = Array.isArray(providers.all) ? providers.all : [];
|
|
387
|
-
return {
|
|
388
|
-
...providers,
|
|
389
|
-
all: all.map((provider) => ({
|
|
390
|
-
...provider,
|
|
391
|
-
models: Object.fromEntries(Object.entries(provider.models ?? {}).map(([id, model]) => [
|
|
392
|
-
id,
|
|
393
|
-
overrides[id] === undefined
|
|
394
|
-
? model
|
|
395
|
-
: { ...model, enabled: overrides[id] },
|
|
396
|
-
])),
|
|
397
|
-
})),
|
|
398
|
-
};
|
|
399
|
-
}
|
|
400
|
-
export function projectLlmCatalogToProviderList(catalog) {
|
|
401
|
-
const models = Object.fromEntries(Object.entries(catalog.models ?? {})
|
|
402
|
-
.filter(([modelId]) => modelId !== 'auto' && modelId !== 'kortix/auto')
|
|
403
|
-
.map(([modelId, model]) => {
|
|
404
|
-
// The gateway picker never carried `variants`, so the composer's
|
|
405
|
-
// Thinking control (which lists `Object.keys(model.variants)`) had
|
|
406
|
-
// nothing to offer on-gateway — the ONLY effort path there was a
|
|
407
|
-
// project-level routing-policy write. Derive the ids from the same
|
|
408
|
-
// `reasoning_options` the API already serves, through the same
|
|
409
|
-
// `generationControlCapabilities` the gateway's own clamp uses, so
|
|
410
|
-
// the picker offers exactly the tiers a request may carry. An
|
|
411
|
-
// explicit `variants` map from the API (runtime truth) is kept as-is.
|
|
412
|
-
if (model.variants && Object.keys(model.variants).length > 0)
|
|
413
|
-
return [modelId, model];
|
|
414
|
-
const ids = generationControlCapabilities({
|
|
415
|
-
id: modelId,
|
|
416
|
-
name: model.name,
|
|
417
|
-
reasoning: model.reasoning,
|
|
418
|
-
reasoning_options: model.reasoning_options,
|
|
419
|
-
}).reasoningEffort?.values;
|
|
420
|
-
if (!ids?.length)
|
|
421
|
-
return [modelId, model];
|
|
422
|
-
return [modelId, { ...model, variants: Object.fromEntries(ids.map((id) => [id, {}])) }];
|
|
423
|
-
}));
|
|
424
|
-
const firstModelId = Object.keys(models)[0];
|
|
425
|
-
return {
|
|
426
|
-
default: firstModelId ? { kortix: firstModelId } : {},
|
|
427
|
-
connected: ['kortix'],
|
|
428
|
-
all: [
|
|
429
|
-
{
|
|
430
|
-
id: 'kortix',
|
|
431
|
-
name: 'Kortix',
|
|
432
|
-
source: 'gateway',
|
|
433
|
-
models,
|
|
434
|
-
},
|
|
435
|
-
],
|
|
436
|
-
};
|
|
437
|
-
}
|
|
1
|
+
// Moved to the framework-free core so the root `@kortix/sdk` entry can export it.
|
|
2
|
+
export * from '../core/models/provider-selection.js';
|
|
438
3
|
//# sourceMappingURL=provider-selection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-selection.js","sourceRoot":"","sources":["../../src/react/provider-selection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EAEpB,oBAAoB,EACpB,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,qBAAqB,CAAC;AAO7B;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAGhC,oBAAoB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC3C,EAAE,EAAE,QAAQ,CAAC,EAAE;IACf,eAAe,EAAE,uBAAuB,CAAC,QAAQ,CAAC;CACnD,CAAC,CAAC,CAAC;AAEJ,8EAA8E;AAC9E,iEAAiE;AACjE,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;AACxD,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;AAEzD,MAAM,UAAU,qBAAqB,CAAC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AAE,SAAS;gBACjB,MAAM;aACP;SACF;KACiC,CAAC;AACvC,CAAC"}
|
|
1
|
+
{"version":3,"file":"provider-selection.js","sourceRoot":"","sources":["../../src/react/provider-selection.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,cAAc,mCAAmC,CAAC"}
|
|
@@ -51,6 +51,8 @@
|
|
|
51
51
|
* prefix. `'kx'` makes the two factories disjoint at segment 0, so neither
|
|
52
52
|
* can ever prefix-match the other. Do not "tidy" this back to `'kortix'`.
|
|
53
53
|
*/
|
|
54
|
+
import type { ListProjectSessionsOptions } from '../core/rest/projects-client/sessions.js';
|
|
55
|
+
type SessionListFilters = Pick<ListProjectSessionsOptions, 'parent' | 'startedBy' | 'q'>;
|
|
54
56
|
export declare const qk: {
|
|
55
57
|
/**
|
|
56
58
|
* The account LIST — `listAccounts()`, `GET /accounts`, `KortixAccount[]`.
|
|
@@ -247,7 +249,16 @@ export declare const qk: {
|
|
|
247
249
|
* reaches the paged list too. That is the point of the shared prefix — a
|
|
248
250
|
* new slot must not need a second invalidation nobody remembers to add.
|
|
249
251
|
*/
|
|
250
|
-
readonly sessionsPaged: (id: string, scope?: "visible" | "project") => readonly ["kx", "project", string, "sessions", "list-paged", "project" | "visible"]
|
|
252
|
+
readonly sessionsPaged: (id: string, scope?: "visible" | "project", filters?: SessionListFilters) => readonly ["kx", "project", string, "sessions", "list-paged", "project" | "visible"] | readonly ["kx", "project", string, "sessions", "list-paged", "project" | "visible", {
|
|
253
|
+
parent: string | null;
|
|
254
|
+
startedBy: "me" | "others" | "automated" | null;
|
|
255
|
+
q: string | null;
|
|
256
|
+
}];
|
|
257
|
+
/**
|
|
258
|
+
* One session's children (`parent=<sessionId>`), infinite. Its own slot
|
|
259
|
+
* beside `sessionsPaged`; nests under `sessionsScope` for invalidation.
|
|
260
|
+
*/
|
|
261
|
+
readonly sessionChildren: (id: string, parentSessionId: string, q?: string) => readonly ["kx", "project", string, "sessions", "list-children", string, string];
|
|
251
262
|
/**
|
|
252
263
|
* One session, by id. Nests directly under the scope-LESS
|
|
253
264
|
* `sessionsScope` prefix, not under a specific `sessions(id, scope)`
|
|
@@ -308,6 +319,12 @@ export declare const qk: {
|
|
|
308
319
|
* and write the identical entity through `listProjectTriggers(id)`, so
|
|
309
320
|
* they must share this one key. */
|
|
310
321
|
readonly triggers: (id: string) => readonly ["kx", "project", string, "triggers"];
|
|
322
|
+
/** `listProjectReminders` — `GET /projects/:id/reminders`. Also the prefix
|
|
323
|
+
* of every `sessionReminders` key, so invalidating it refreshes the
|
|
324
|
+
* project page and every session's reminder chip together. */
|
|
325
|
+
readonly reminders: (id: string) => readonly ["kx", "project", string, "reminders"];
|
|
326
|
+
/** `listSessionReminders` — `GET /projects/:id/sessions/:sid/reminders`. */
|
|
327
|
+
readonly sessionReminders: (id: string, sessionId: string) => readonly ["kx", "project", string, "reminders", "session", string];
|
|
311
328
|
/**
|
|
312
329
|
* `readProjectFile(id, path)` — a single-file source read, used by the
|
|
313
330
|
* Customize config-entity viewer. Unrelated to the much larger Git file
|
|
@@ -354,4 +371,5 @@ export declare const qk: {
|
|
|
354
371
|
};
|
|
355
372
|
export type ProjectScopeKey = ReturnType<typeof qk.project.scope>;
|
|
356
373
|
export type ProjectsListKey = ReturnType<typeof qk.projects.list>;
|
|
374
|
+
export {};
|
|
357
375
|
//# sourceMappingURL=query-keys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-keys.d.ts","sourceRoot":"","sources":["../../src/react/query-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,eAAO,MAAM,EAAE;IACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;;QAED;;;;;;;;;;WAUG;;QAGH;;;;;;;;;;;;;;;;WAgBG;gCACY,MAAM,GAAG,IAAI,GAAG,SAAS;QAGxC;;;;;WAKG;qCACiB,MAAM,GAAG,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M;QAExC,wFAAwF;mCACtE,MAAM,MAAM,OAAO,GAAG,IAAI;kCAE3B,MAAM,SAAS,MAAM,GAAG,IAAI;sCAExB,MAAM;mCACT,MAAM;;CAElB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAClE,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC"}
|
package/dist/react/query-keys.js
CHANGED
|
@@ -1,56 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* `staleTime` is per-observer and seven call sites disagreed about it.
|
|
9
|
-
*
|
|
10
|
-
* The first version of `sessions(id)` repeated that exact mistake one level
|
|
11
|
-
* down: it dropped `listProjectSessions`'s `scope` argument, so a
|
|
12
|
-
* `scope: 'visible'` reader and a `scope: 'project'` reader (a DIFFERENT
|
|
13
|
-
* server request — see `sessions` below) shared one cache slot, and
|
|
14
|
-
* whichever fetch resolved last silently overwrote what the other scope's
|
|
15
|
-
* readers saw. Anything that changes the response MUST be part of the key —
|
|
16
|
-
* that is the rule this file exists to enforce, and it is not optional just
|
|
17
|
-
* because the argument is easy to forget.
|
|
18
|
-
*
|
|
19
|
-
* The SECOND version of `sessions(id, scope)` fixed that, then introduced a
|
|
20
|
-
* narrower version of the same class of bug: `sessions(id, scope)` and
|
|
21
|
-
* `session(id, sessionId)` were both `sessionsScope(id)` plus exactly one
|
|
22
|
-
* segment, so a session id equal to a scope literal (`'visible'`,
|
|
23
|
-
* `'project'`) would collide byte-for-byte with a scoped list. Nothing in
|
|
24
|
-
* THIS file prevented that — the only thing standing in the way was a UUID
|
|
25
|
-
* regex enforced server-side, in `apps/api`, a different package, with no
|
|
26
|
-
* link back here. `sessions` now inserts a literal `'list'` segment so it is
|
|
27
|
-
* structurally longer than `session(...)` for every possible session id —
|
|
28
|
-
* the collision is unrepresentable, not merely unlikely.
|
|
29
|
-
*
|
|
30
|
-
* Two rules make this work:
|
|
31
|
-
*
|
|
32
|
-
* 1. `scope(id)` is a PREFIX, never a query key. Everything belonging to one
|
|
33
|
-
* project sits under it, so `invalidateQueries({ queryKey: scope(id) })`
|
|
34
|
-
* provably reaches all of it.
|
|
35
|
-
* 2. Nothing derived from another query gets its own key. Skills, commands
|
|
36
|
-
* and agents are `config.*` fields of the project detail response, not
|
|
37
|
-
* separate fetches — they are `select` projections over `detail(id)`.
|
|
38
|
-
*
|
|
39
|
-
* Not to be confused with `kortixKeys` in `use-kortix-master.ts`, which
|
|
40
|
-
* addresses the multi-server Kortix Master surface and means something else.
|
|
41
|
-
*
|
|
42
|
-
* The root segment below is `'kx'`, not `'kortix'`. `'kortix'` is already
|
|
43
|
-
* `kortixKeys`'s root (`use-kortix-master.ts:276-279`):
|
|
44
|
-
* `kortixKeys.projects() = ['kortix', 'projects']` and
|
|
45
|
-
* `kortixKeys.project(id) = ['kortix', 'projects', id]`. If this factory also
|
|
46
|
-
* rooted at `'kortix'`, `kortixKeys.project(id)` and `qk.projects.list(id)`
|
|
47
|
-
* would be the identical array for a matching id — one cache entry standing
|
|
48
|
-
* in for two unrelated concepts — and `kortixKeys.projects()` (used as an
|
|
49
|
-
* `invalidateQueries` prefix at `use-kortix-master.ts:371,384`) would also
|
|
50
|
-
* match every key this factory produces, since TanStack matches query keys by
|
|
51
|
-
* prefix. `'kx'` makes the two factories disjoint at segment 0, so neither
|
|
52
|
-
* can ever prefix-match the other. Do not "tidy" this back to `'kortix'`.
|
|
53
|
-
*/
|
|
1
|
+
/** The filter fields that change the server response, or undefined when none is set. */
|
|
2
|
+
function normalizeSessionListFilters(filters) {
|
|
3
|
+
const q = filters?.q?.trim();
|
|
4
|
+
if (!filters?.parent && !filters?.startedBy && !q)
|
|
5
|
+
return undefined;
|
|
6
|
+
return { parent: filters?.parent ?? null, startedBy: filters?.startedBy ?? null, q: q ?? null };
|
|
7
|
+
}
|
|
54
8
|
export const qk = {
|
|
55
9
|
/**
|
|
56
10
|
* The account LIST — `listAccounts()`, `GET /accounts`, `KortixAccount[]`.
|
|
@@ -247,7 +201,18 @@ export const qk = {
|
|
|
247
201
|
* reaches the paged list too. That is the point of the shared prefix — a
|
|
248
202
|
* new slot must not need a second invalidation nobody remembers to add.
|
|
249
203
|
*/
|
|
250
|
-
sessionsPaged: (id, scope = 'visible') =>
|
|
204
|
+
sessionsPaged: (id, scope = 'visible', filters) => {
|
|
205
|
+
const key = [...qk.project.sessionsScope(id), 'list-paged', scope];
|
|
206
|
+
// The filter set is one extra segment, present only when a filter is
|
|
207
|
+
// set, so the unfiltered key is byte-identical to the pre-filter one.
|
|
208
|
+
const normalized = normalizeSessionListFilters(filters);
|
|
209
|
+
return normalized ? [...key, normalized] : key;
|
|
210
|
+
},
|
|
211
|
+
/**
|
|
212
|
+
* One session's children (`parent=<sessionId>`), infinite. Its own slot
|
|
213
|
+
* beside `sessionsPaged`; nests under `sessionsScope` for invalidation.
|
|
214
|
+
*/
|
|
215
|
+
sessionChildren: (id, parentSessionId, q) => [...qk.project.sessionsScope(id), 'list-children', parentSessionId, q?.trim() ?? ''],
|
|
251
216
|
/**
|
|
252
217
|
* One session, by id. Nests directly under the scope-LESS
|
|
253
218
|
* `sessionsScope` prefix, not under a specific `sessions(id, scope)`
|
|
@@ -310,6 +275,12 @@ export const qk = {
|
|
|
310
275
|
* and write the identical entity through `listProjectTriggers(id)`, so
|
|
311
276
|
* they must share this one key. */
|
|
312
277
|
triggers: (id) => [...qk.project.scope(id), 'triggers'],
|
|
278
|
+
/** `listProjectReminders` — `GET /projects/:id/reminders`. Also the prefix
|
|
279
|
+
* of every `sessionReminders` key, so invalidating it refreshes the
|
|
280
|
+
* project page and every session's reminder chip together. */
|
|
281
|
+
reminders: (id) => [...qk.project.scope(id), 'reminders'],
|
|
282
|
+
/** `listSessionReminders` — `GET /projects/:id/sessions/:sid/reminders`. */
|
|
283
|
+
sessionReminders: (id, sessionId) => [...qk.project.reminders(id), 'session', sessionId],
|
|
313
284
|
/**
|
|
314
285
|
* `readProjectFile(id, path)` — a single-file source read, used by the
|
|
315
286
|
* Customize config-entity viewer. Unrelated to the much larger Git file
|