@wildo-ai/external-connectors-models 1.0.1 → 1.1.0
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/LICENSE +34 -0
- package/dist/esm/.builder.pid +9 -0
- package/dist/esm/companion-exports.d.ts +8 -0
- package/dist/esm/companion-exports.d.ts.map +1 -0
- package/dist/esm/companion-exports.js +8 -0
- package/dist/esm/companion-exports.js.map +1 -0
- package/dist/esm/core/commons.external-connectors-models.schemas.d.ts +66 -19
- package/dist/esm/core/commons.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/core/commons.external-connectors-models.schemas.js +51 -3
- package/dist/esm/core/commons.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/core/oauth2.enums.d.ts.map +1 -1
- package/dist/esm/core/oauth2.enums.js +1 -1
- package/dist/esm/core/oauth2.enums.js.map +1 -1
- package/dist/esm/core/operations.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/core/operations.external-connectors-models.schemas.js +1 -1
- package/dist/esm/core/operations.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/core/protocols.external-connectors-models.schemas.d.ts +35 -20
- package/dist/esm/core/protocols.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/core/protocols.external-connectors-models.schemas.js +1 -1
- package/dist/esm/core/protocols.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/core/security.external-connectors-models.schemas.d.ts +1 -1
- package/dist/esm/core/security.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/core/security.external-connectors-models.schemas.js +1 -1
- package/dist/esm/core/security.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/features/core.external-connectors-models.schemas.d.ts +4 -4
- package/dist/esm/features/core.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/features/core.external-connectors-models.schemas.js +13 -13
- package/dist/esm/features/core.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/features/email.external-connectors-models.schemas.d.ts +12 -12
- package/dist/esm/features/email.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/features/email.external-connectors-models.schemas.js +2 -2
- package/dist/esm/features/email.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/features/hooks.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/features/hooks.external-connectors-models.schemas.js +1 -1
- package/dist/esm/features/hooks.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/features/sms.external-connectors-models.schemas.d.ts +4 -4
- package/dist/esm/features/sms.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/features/sms.external-connectors-models.schemas.js +1 -1
- package/dist/esm/features/sms.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/index.d.ts +27 -27
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +5 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/protocols/a2a.external-connectors-models.schemas.d.ts +3 -3
- package/dist/esm/protocols/a2a.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/a2a.external-connectors-models.schemas.js +1 -1
- package/dist/esm/protocols/a2a.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.d.ts +526 -0
- package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.d.ts.map +1 -0
- package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.js +639 -0
- package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.js.map +1 -0
- package/dist/esm/protocols/billing.standard-interface.schemas.d.ts +67 -0
- package/dist/esm/protocols/billing.standard-interface.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/billing.standard-interface.schemas.js +1 -1
- package/dist/esm/protocols/billing.standard-interface.schemas.js.map +1 -1
- package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.d.ts +179 -0
- package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.d.ts.map +1 -0
- package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.js +217 -0
- package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.js.map +1 -0
- package/dist/esm/protocols/email.external-connectors-models.schemas.d.ts +5 -5
- package/dist/esm/protocols/email.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/email.external-connectors-models.schemas.js +1 -1
- package/dist/esm/protocols/email.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/email.standard-interface.schemas.d.ts +37 -10
- package/dist/esm/protocols/email.standard-interface.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/email.standard-interface.schemas.js +137 -4
- package/dist/esm/protocols/email.standard-interface.schemas.js.map +1 -1
- package/dist/esm/protocols/embeddings.external-connectors-models.schemas.d.ts +175 -0
- package/dist/esm/protocols/embeddings.external-connectors-models.schemas.d.ts.map +1 -0
- package/dist/esm/protocols/embeddings.external-connectors-models.schemas.js +191 -0
- package/dist/esm/protocols/embeddings.external-connectors-models.schemas.js.map +1 -0
- package/dist/esm/protocols/frontend.external-connectors-models.schemas.d.ts +4 -4
- package/dist/esm/protocols/frontend.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/frontend.external-connectors-models.schemas.js +2 -2
- package/dist/esm/protocols/frontend.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/git.external-connectors-models.schemas.d.ts +3 -3
- package/dist/esm/protocols/git.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/git.external-connectors-models.schemas.js +1 -1
- package/dist/esm/protocols/git.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/grpc.external-connectors-models.schemas.d.ts +3 -3
- package/dist/esm/protocols/grpc.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/grpc.external-connectors-models.schemas.js +1 -1
- package/dist/esm/protocols/grpc.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/hooks.external-connectors-models.schemas.d.ts +14 -6
- package/dist/esm/protocols/hooks.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/hooks.external-connectors-models.schemas.js +1 -1
- package/dist/esm/protocols/hooks.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/image.external-connectors-models.schemas.d.ts +151 -0
- package/dist/esm/protocols/image.external-connectors-models.schemas.d.ts.map +1 -0
- package/dist/esm/protocols/image.external-connectors-models.schemas.js +150 -0
- package/dist/esm/protocols/image.external-connectors-models.schemas.js.map +1 -0
- package/dist/esm/protocols/llm.external-connectors-models.schemas.d.ts +567 -67
- package/dist/esm/protocols/llm.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/llm.external-connectors-models.schemas.js +815 -36
- package/dist/esm/protocols/llm.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/mcp.external-connectors-models.schemas.d.ts +3 -3
- package/dist/esm/protocols/mcp.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/mcp.external-connectors-models.schemas.js +1 -1
- package/dist/esm/protocols/mcp.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/oauth2.external-connectors-models.schemas.d.ts +27 -28
- package/dist/esm/protocols/oauth2.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/oauth2.external-connectors-models.schemas.js +1 -3
- package/dist/esm/protocols/oauth2.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/rest-api.external-connectors-models.schemas.d.ts +3 -3
- package/dist/esm/protocols/rest-api.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/rest-api.external-connectors-models.schemas.js +1 -1
- package/dist/esm/protocols/rest-api.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/saml.external-connectors-models.schemas.d.ts +30 -30
- package/dist/esm/protocols/saml.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/saml.external-connectors-models.schemas.js +1 -1
- package/dist/esm/protocols/saml.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/sms.external-connectors-models.schemas.d.ts +2 -2
- package/dist/esm/protocols/sms.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/sms.external-connectors-models.schemas.js +1 -1
- package/dist/esm/protocols/sms.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/sms.standard-interface.schemas.d.ts +1 -1
- package/dist/esm/protocols/sms.standard-interface.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/sms.standard-interface.schemas.js +1 -1
- package/dist/esm/protocols/sms.standard-interface.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +20 -10
- package/dist/esm/core/lazy-loading.external-connectors-models.schemas.d.ts +0 -127
- package/dist/esm/core/lazy-loading.external-connectors-models.schemas.d.ts.map +0 -1
- package/dist/esm/core/lazy-loading.external-connectors-models.schemas.js +0 -22
- package/dist/esm/core/lazy-loading.external-connectors-models.schemas.js.map +0 -1
- package/dist/esm/core/providers.external-connectors-models.schemas.d.ts +0 -80
- package/dist/esm/core/providers.external-connectors-models.schemas.d.ts.map +0 -1
- package/dist/esm/core/providers.external-connectors-models.schemas.js +0 -55
- package/dist/esm/core/providers.external-connectors-models.schemas.js.map +0 -1
- package/dist/esm/protocols/cli-runtime.external-connectors-models.schemas.d.ts +0 -214
- package/dist/esm/protocols/cli-runtime.external-connectors-models.schemas.d.ts.map +0 -1
- package/dist/esm/protocols/cli-runtime.external-connectors-models.schemas.js +0 -188
- package/dist/esm/protocols/cli-runtime.external-connectors-models.schemas.js.map +0 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { ExternalProvider_ExchangeProtocol_Kind, ExternalProvider_ExchangeProtocol_Status_BaseSchema } from "../core/commons.external-connectors-models.schemas.js";
|
|
3
3
|
import { ExternalProvider_OperationContextSchema } from "../core/operations.external-connectors-models.schemas.js";
|
|
4
|
-
import { CLIRuntime_OutputParserMode, CLIRuntime_RunnerHost } from "./cli-runtime.external-connectors-models.schemas.js";
|
|
5
4
|
//===============================================================
|
|
6
5
|
// LLM Provider
|
|
7
6
|
// --------
|
|
@@ -17,24 +16,51 @@ export var LLM_Model;
|
|
|
17
16
|
LLM_Model["OPEN_AI_O3_MINI"] = "o3-mini";
|
|
18
17
|
LLM_Model["OPEN_AI_O4_MINI"] = "o4-mini";
|
|
19
18
|
// OpenAI Models - GPT Series
|
|
19
|
+
// Ids verified LIVE against `GET /v1/models` (2026-07-16). The previous
|
|
20
|
+
// "gpt-5.1-instant" / "gpt-5.1-thinking" entries were ChatGPT PRODUCT
|
|
21
|
+
// names, not API model ids — they never existed on the API (removed).
|
|
22
|
+
//
|
|
23
|
+
// GPT-5.6 (launched 2026-07-09) renames tiers: the NUMBER is the
|
|
24
|
+
// generation, Sol/Terra/Luna are durable capability tiers — Sol = frontier
|
|
25
|
+
// flagship, Terra = balanced everyday work, Luna = fast/affordable
|
|
26
|
+
// (roughly the Fable/Opus/Sonnet-tier equivalents). ALL THREE reject
|
|
27
|
+
// non-default `temperature` (only 1; verified live) — agents on them must
|
|
28
|
+
// send NO sampling params.
|
|
29
|
+
/** GPT-5.6 frontier flagship tier. */
|
|
30
|
+
LLM_Model["OPEN_AI_GPT_5_6_SOL"] = "gpt-5.6-sol";
|
|
31
|
+
/** GPT-5.6 balanced tier for everyday work. */
|
|
32
|
+
LLM_Model["OPEN_AI_GPT_5_6_TERRA"] = "gpt-5.6-terra";
|
|
33
|
+
/** GPT-5.6 fast/affordable tier. */
|
|
34
|
+
LLM_Model["OPEN_AI_GPT_5_6_LUNA"] = "gpt-5.6-luna";
|
|
35
|
+
/** Dec-2025 flagship (accepts `temperature`, unlike the 5.6 family). */
|
|
36
|
+
LLM_Model["OPEN_AI_GPT_5_2"] = "gpt-5.2";
|
|
37
|
+
/** Extended-reasoning 5.2 variant. */
|
|
38
|
+
LLM_Model["OPEN_AI_GPT_5_2_PRO"] = "gpt-5.2-pro";
|
|
39
|
+
LLM_Model["OPEN_AI_GPT_5_1"] = "gpt-5.1";
|
|
20
40
|
LLM_Model["OPEN_AI_GPT_5"] = "gpt-5";
|
|
21
|
-
LLM_Model["
|
|
22
|
-
LLM_Model["OPEN_AI_GPT_5_1_THINKING"] = "gpt-5.1-thinking";
|
|
41
|
+
LLM_Model["OPEN_AI_GPT_5_MINI"] = "gpt-5-mini";
|
|
23
42
|
LLM_Model["OPEN_AI_GPT_4O"] = "gpt-4o";
|
|
24
43
|
LLM_Model["OPEN_AI_GPT_4O_MINI"] = "gpt-4o-mini";
|
|
25
44
|
LLM_Model["OPEN_AI_GPT_4_TURBO"] = "gpt-4-turbo";
|
|
26
45
|
LLM_Model["OPEN_AI_GPT_4"] = "gpt-4";
|
|
27
46
|
LLM_Model["OPEN_AI_GPT_3_5_TURBO"] = "gpt-3.5-turbo";
|
|
28
47
|
// Anthropic Models
|
|
29
|
-
|
|
48
|
+
// Ids verified LIVE against `GET /v1/models` (2026-07-16). The previous
|
|
49
|
+
// "claude-4-opus" entry was never a real API id, and the claude-3* family
|
|
50
|
+
// is RETIRED (absent from the provider's model list) — all removed.
|
|
51
|
+
//
|
|
52
|
+
// The WHOLE Claude 5 family (fable-5 AND sonnet-5) REJECTS explicit
|
|
53
|
+
// `temperature` ("deprecated for this model", verified live 2026-07-16) —
|
|
54
|
+
// agents on them must send NO sampling params. Claude 4.5+ additionally
|
|
55
|
+
// rejects temperature+topP together.
|
|
56
|
+
/** Anthropic's most intelligent generally-available model (Claude 5 family, Mythos-class tier). */
|
|
57
|
+
LLM_Model["CLAUDE_FABLE_5"] = "claude-fable-5";
|
|
58
|
+
/** Claude 5 family workhorse. */
|
|
59
|
+
LLM_Model["CLAUDE_SONNET_5"] = "claude-sonnet-5";
|
|
60
|
+
/** Latest Opus-tier model (4.x line). */
|
|
61
|
+
LLM_Model["CLAUDE_OPUS_4_8"] = "claude-opus-4-8";
|
|
30
62
|
LLM_Model["CLAUDE_SONNET_4_5"] = "claude-sonnet-4-5";
|
|
31
63
|
LLM_Model["CLAUDE_HAIKU_4_5"] = "claude-haiku-4-5";
|
|
32
|
-
LLM_Model["CLAUDE_3_7_SONNET"] = "claude-3-7-sonnet";
|
|
33
|
-
LLM_Model["CLAUDE_3_5_SONNET"] = "claude-3-5-sonnet-20241022";
|
|
34
|
-
LLM_Model["CLAUDE_3_5_HAIKU"] = "claude-3-5-haiku-20241022";
|
|
35
|
-
LLM_Model["CLAUDE_3_OPUS"] = "claude-3-opus-20240229";
|
|
36
|
-
LLM_Model["CLAUDE_3_SONNET"] = "claude-3-sonnet-20240229";
|
|
37
|
-
LLM_Model["CLAUDE_3_HAIKU"] = "claude-3-haiku-20240307";
|
|
38
64
|
// Google Models
|
|
39
65
|
LLM_Model["GOOGLE_GEMINI_3_DEEP_THINK"] = "gemini-3-deep-think";
|
|
40
66
|
LLM_Model["GOOGLE_GEMINI_3_PRO"] = "gemini-3-pro";
|
|
@@ -75,10 +101,31 @@ export var LLM_Model_IO_Capability;
|
|
|
75
101
|
LLM_Model_IO_Capability["LONG_CONTEXT"] = "long_context";
|
|
76
102
|
LLM_Model_IO_Capability["CODE_GENERATION"] = "code_generation";
|
|
77
103
|
})(LLM_Model_IO_Capability || (LLM_Model_IO_Capability = {}));
|
|
104
|
+
/**
|
|
105
|
+
* Whether a model can think, and whether that thinking can be turned OFF.
|
|
106
|
+
*
|
|
107
|
+
* This is the MODEL-PROPERTY axis of reasoning. It answers "what is this model
|
|
108
|
+
* capable of", never "how hard should this call think" — the latter is
|
|
109
|
+
* {@link LLMProvider_ReasoningEffort}, a per-call parameter. Keeping the two
|
|
110
|
+
* apart is deliberate: a capability is a fact about the model, an effort is a
|
|
111
|
+
* choice by the author. (The six `*_THINKING` operation keys that once encoded
|
|
112
|
+
* this as a third axis were retired on 2026-07-17.)
|
|
113
|
+
*
|
|
114
|
+
* Consumed by {@link LLM_MODEL_THINKING_CAPABILITY} +
|
|
115
|
+
* {@link validateReasoningEffortForModel} to reject impossible
|
|
116
|
+
* model × effort pairs at authoring time instead of as a provider 400.
|
|
117
|
+
*/
|
|
78
118
|
export var LLM_Model_Thinking_Capability;
|
|
79
119
|
(function (LLM_Model_Thinking_Capability) {
|
|
120
|
+
/** Not a reasoning model — it cannot think, so NO `reasoningEffort` is valid. */
|
|
80
121
|
LLM_Model_Thinking_Capability["NONE"] = "none";
|
|
122
|
+
/** Thinking can be enabled AND disabled — every effort level is valid, incl. `NONE`. */
|
|
81
123
|
LLM_Model_Thinking_Capability["OPTIONAL"] = "optional";
|
|
124
|
+
/**
|
|
125
|
+
* The model ALWAYS reasons and thinking CANNOT be disabled (o-series,
|
|
126
|
+
* Claude 5). Every effort is valid EXCEPT `NONE` — asking such a model not to
|
|
127
|
+
* think is a provider error, not a preference.
|
|
128
|
+
*/
|
|
82
129
|
LLM_Model_Thinking_Capability["ALWAYS"] = "always";
|
|
83
130
|
})(LLM_Model_Thinking_Capability || (LLM_Model_Thinking_Capability = {}));
|
|
84
131
|
export var LLM_Model_Availability;
|
|
@@ -89,23 +136,128 @@ export var LLM_Model_Availability;
|
|
|
89
136
|
LLM_Model_Availability["DEPRECATED"] = "deprecated";
|
|
90
137
|
LLM_Model_Availability["DISCONTINUED"] = "discontinued";
|
|
91
138
|
})(LLM_Model_Availability || (LLM_Model_Availability = {}));
|
|
139
|
+
/**
|
|
140
|
+
* WHAT A MODEL IS CHOSEN FOR — the durable axis of model selection.
|
|
141
|
+
*
|
|
142
|
+
* Concrete model ids churn monthly; the kinds of work a model is selected for
|
|
143
|
+
* do not. This enum is therefore the surface an AUTHOR names
|
|
144
|
+
* (`config.modelApplicability`), while the concrete id is resolved by the
|
|
145
|
+
* framework from {@link LLM_MODEL_CATALOG} +
|
|
146
|
+
* {@link LLM_MODEL_APPLICABILITY_PREFERENCE}. A model launch becomes one
|
|
147
|
+
* catalog row and one preference edit, with no agent definition touched.
|
|
148
|
+
*
|
|
149
|
+
* Members name the WORK, never the model's SIZE or a vendor tier. A tier
|
|
150
|
+
* ("mini", "pro", "Sol/Terra/Luna", "Opus/Sonnet/Haiku") is a property of one
|
|
151
|
+
* vendor's line-up — it renames (GPT-5.6 already did), it differs per provider,
|
|
152
|
+
* and it still never says what to choose it FOR.
|
|
153
|
+
*
|
|
154
|
+
* Import path: `@wildo-ai/external-connectors-models`.
|
|
155
|
+
*/
|
|
156
|
+
export var LLM_Model_Applicability;
|
|
157
|
+
(function (LLM_Model_Applicability) {
|
|
158
|
+
/**
|
|
159
|
+
* High-stakes semantic judgment where being wrong is expensive and the answer
|
|
160
|
+
* is read by a human or gates a durable decision — critique, deliberation,
|
|
161
|
+
* persona derivation, acceptance judgment.
|
|
162
|
+
*
|
|
163
|
+
* Choose it when: cost and latency are worth trading for quality, the input is
|
|
164
|
+
* ambiguous, and there is no mechanical check downstream that would catch a
|
|
165
|
+
* poor answer.
|
|
166
|
+
* Do NOT choose it for: volume work, or anything a schema already constrains.
|
|
167
|
+
*/
|
|
168
|
+
LLM_Model_Applicability["DEEP_JUDGMENT"] = "deep_judgment";
|
|
169
|
+
/**
|
|
170
|
+
* Everyday generation of application artifacts against a declared schema —
|
|
171
|
+
* structured output, copy, plans, summaries.
|
|
172
|
+
*
|
|
173
|
+
* Choose it when: the shape is constrained by a schema or a template, quality
|
|
174
|
+
* matters but the task is bounded, and the call happens tens of times rather
|
|
175
|
+
* than thousands. This is the correct default when no other member obviously
|
|
176
|
+
* fits.
|
|
177
|
+
*/
|
|
178
|
+
LLM_Model_Applicability["STRUCTURED_AUTHORING"] = "structured_authoring";
|
|
179
|
+
/**
|
|
180
|
+
* High-volume, low-judgment transformation — labelling, translation,
|
|
181
|
+
* extraction, reformatting, classification against a fixed vocabulary.
|
|
182
|
+
*
|
|
183
|
+
* Choose it when: the same call runs hundreds or thousands of times, the
|
|
184
|
+
* answer is checkable, and unit cost dominates quality. The trade is
|
|
185
|
+
* deliberate: paying a judgment-tier price per label is the failure this
|
|
186
|
+
* member exists to prevent.
|
|
187
|
+
*/
|
|
188
|
+
LLM_Model_Applicability["HIGH_VOLUME_MECHANICAL"] = "high_volume_mechanical";
|
|
189
|
+
/**
|
|
190
|
+
* Work whose binding constraint is how much material must be in ONE call —
|
|
191
|
+
* whole-corpus analysis, cross-document reconciliation, large-codebase
|
|
192
|
+
* reading.
|
|
193
|
+
*
|
|
194
|
+
* Choose it when: chunking would destroy the semantics (the answer depends on
|
|
195
|
+
* relating parts that must be seen together). If the work chunks cleanly,
|
|
196
|
+
* choose by judgment level instead and let the caller chunk.
|
|
197
|
+
*/
|
|
198
|
+
LLM_Model_Applicability["LONG_CONTEXT_ANALYSIS"] = "long_context_analysis";
|
|
199
|
+
/**
|
|
200
|
+
* Judgment that requires SEEING an artifact — logo/brand assessment, rendered
|
|
201
|
+
* layout review, screenshot triage.
|
|
202
|
+
*
|
|
203
|
+
* Choose it when: the input is an image and the output is an assessment of it.
|
|
204
|
+
* Resolution refuses any model whose catalog row does not evidence
|
|
205
|
+
* {@link LLM_Model_IO_Capability.MULTIMODAL_VISION}, so an unverified model is
|
|
206
|
+
* never silently selected for vision work.
|
|
207
|
+
*/
|
|
208
|
+
LLM_Model_Applicability["VISUAL_JUDGMENT"] = "visual_judgment";
|
|
209
|
+
/**
|
|
210
|
+
* Autonomous, workspace-mutating code authoring driven through a coding-agent
|
|
211
|
+
* CLI rather than a chat API.
|
|
212
|
+
*
|
|
213
|
+
* Choose it when: the agent edits files in a trusted workspace and needs long
|
|
214
|
+
* tool-using turns. This member is transport-bound — it is only serviceable
|
|
215
|
+
* on a provider that declares an `AGENT_CLIENT_PROTOCOL` transport, so resolving it never
|
|
216
|
+
* silently downgrades workspace work to a chat call that can only describe an
|
|
217
|
+
* edit.
|
|
218
|
+
*/
|
|
219
|
+
LLM_Model_Applicability["WORKSPACE_CODING_AGENT"] = "workspace_coding_agent";
|
|
220
|
+
})(LLM_Model_Applicability || (LLM_Model_Applicability = {}));
|
|
221
|
+
/** @wildo_source:part:start saas.external-providers.llm.operation-key facet:kind:api facet:audience:app-developer
|
|
222
|
+
*
|
|
223
|
+
* The LLM operation vocabulary — WHAT a call does, never HOW HARD it thinks.
|
|
224
|
+
*
|
|
225
|
+
* This is the key you put on an agent's `config.operationKey`. It selects the
|
|
226
|
+
* executor, and with it BOTH the invocation `input` shape you must supply and
|
|
227
|
+
* the `output` shape you get back:
|
|
228
|
+
*
|
|
229
|
+
* | Operation key | `invocation.input` | `invocation.output` |
|
|
230
|
+
* |-----------------------|-------------------------------|---------------------|
|
|
231
|
+
* | `GENERATE_TEXT` | `{ prompt }` | `{ text }` |
|
|
232
|
+
* | `GENERATE_STRUCTURED` | `{ prompt, schema }` (Zod) | `{ object }` |
|
|
233
|
+
* | `CHAT_COMPLETION` | `{ messages }` or `{ prompt }`| `{ message }` |
|
|
234
|
+
* | `CHAT_MULTIMODAL` | `{ prompt, images }` | `{ message }` |
|
|
235
|
+
*
|
|
236
|
+
* `GENERATE_STRUCTURED` REQUIRES `input.schema`; omitting it is a validation
|
|
237
|
+
* error, not a silent fallback to text. The `STREAM_*` keys exist for the
|
|
238
|
+
* conversational runtime — a one-shot caller uses the buffered keys above.
|
|
239
|
+
*
|
|
240
|
+
* Import path: `@wildo-ai/external-connectors-models`.
|
|
241
|
+
*
|
|
242
|
+
* Reasoning depth is a PARAMETER ({@link LLMProvider_ReasoningEffort} on the
|
|
243
|
+
* model configuration), not an operation. The six `*_THINKING` op keys that
|
|
244
|
+
* used to live here were RETIRED (2026-07-17): they were inert at execution
|
|
245
|
+
* (each routed to the exact same executor as its non-thinking sibling) and,
|
|
246
|
+
* once `reasoningEffort` landed, they became a SECOND authority axis for the
|
|
247
|
+
* same concept — two ways to say "think harder", neither carrying its own
|
|
248
|
+
* semantic weight. A model's ability to reason is a property of the model +
|
|
249
|
+
* the effort parameter, not a parallel operation surface.
|
|
250
|
+
*/
|
|
92
251
|
export var LLMProvider_OperationKey;
|
|
93
252
|
(function (LLMProvider_OperationKey) {
|
|
94
|
-
// Base operations (thinking controlled via parameter for OPTIONAL models)
|
|
95
253
|
LLMProvider_OperationKey["GENERATE_TEXT"] = "llm.generateText";
|
|
96
254
|
LLMProvider_OperationKey["CHAT_COMPLETION"] = "llm.chatCompletion";
|
|
97
255
|
LLMProvider_OperationKey["STREAM_TEXT"] = "llm.streamText";
|
|
98
256
|
LLMProvider_OperationKey["GENERATE_STRUCTURED"] = "llm.generateStructured";
|
|
99
257
|
LLMProvider_OperationKey["CHAT_MULTIMODAL"] = "llm.chatMultimodal";
|
|
100
258
|
LLMProvider_OperationKey["STREAM_STRUCTURED"] = "llm.streamStructured";
|
|
101
|
-
// Thinking-enabled operations (for models with OPTIONAL or ALWAYS thinking)
|
|
102
|
-
LLMProvider_OperationKey["GENERATE_TEXT_THINKING"] = "llm.generateText.thinking";
|
|
103
|
-
LLMProvider_OperationKey["CHAT_COMPLETION_THINKING"] = "llm.chatCompletion.thinking";
|
|
104
|
-
LLMProvider_OperationKey["STREAM_TEXT_THINKING"] = "llm.streamText.thinking";
|
|
105
|
-
LLMProvider_OperationKey["GENERATE_STRUCTURED_THINKING"] = "llm.generateStructured.thinking";
|
|
106
|
-
LLMProvider_OperationKey["CHAT_MULTIMODAL_THINKING"] = "llm.chatMultimodal.thinking";
|
|
107
|
-
LLMProvider_OperationKey["STREAM_STRUCTURED_THINKING"] = "llm.streamStructured.thinking";
|
|
108
259
|
})(LLMProvider_OperationKey || (LLMProvider_OperationKey = {}));
|
|
260
|
+
/** @wildo_source:part:end saas.external-providers.llm.operation-key */
|
|
109
261
|
/**
|
|
110
262
|
* Prompt format preference for provider-specific rendering
|
|
111
263
|
* Used by PromptCompilerBackendService to select optimal format
|
|
@@ -131,6 +283,431 @@ export const LLMProvider_ToolChoice_Schema = z.union([
|
|
|
131
283
|
name: z.string(),
|
|
132
284
|
}),
|
|
133
285
|
]);
|
|
286
|
+
/** @wildo_source:part:start saas.external-providers.llm.model-configuration facet:kind:api facet:audience:app-developer
|
|
287
|
+
*
|
|
288
|
+
* Reasoning-effort control for reasoning-capable models (GPT-5.6 Sol/Terra/Luna,
|
|
289
|
+
* OpenAI o-series, Claude 5 thinking, Gemini reasoning, …). The values mirror
|
|
290
|
+
* the AI SDK 7 top-level `reasoning` option EXACTLY, which the SDK translates to
|
|
291
|
+
* each provider's native reasoning setting (OpenAI `reasoning_effort`, Anthropic
|
|
292
|
+
* thinking budget, …). Omit for non-reasoning models or to accept the provider
|
|
293
|
+
* default.
|
|
294
|
+
*
|
|
295
|
+
* Effort ladder (cost/latency ↑ with depth):
|
|
296
|
+
* - `NONE` — reasoning off; mechanical tasks (extraction, formatting, labelling).
|
|
297
|
+
* - `MINIMAL` / `LOW` — brief reasoning; simple structured output.
|
|
298
|
+
* - `MEDIUM` — balanced; most authored generation (market/email copy).
|
|
299
|
+
* - `HIGH` / `XHIGH` — deep reasoning; judgment work (persona derivation,
|
|
300
|
+
* deliberation, logo/quality judges).
|
|
301
|
+
* - `PROVIDER_DEFAULT` — explicitly defer to the model's own default effort.
|
|
302
|
+
*
|
|
303
|
+
* NOT EVERY MODEL SUPPORTS EVERY LEVEL — the SDK forwards the value and the
|
|
304
|
+
* provider validates it. Support matrix VERIFIED LIVE (2026-07-16/17); pick a
|
|
305
|
+
* level the target model actually supports:
|
|
306
|
+
*
|
|
307
|
+
* | Model family | Supported | Rejected |
|
|
308
|
+
* |---------------------|------------------------------------|--------------------------------|
|
|
309
|
+
* | OpenAI GPT-5.6 | none, low, medium, high, xhigh | `minimal`, `max` |
|
|
310
|
+
* | Anthropic Claude 5 | low, medium, high, xhigh | **`none`** — thinking CANNOT |
|
|
311
|
+
* | (fable-5, …) | | be disabled ("thinking.type. |
|
|
312
|
+
* | | | disabled is not supported…"; |
|
|
313
|
+
* | | | defaults to adaptive) |
|
|
314
|
+
*
|
|
315
|
+
* ⚠️ `NONE` is therefore NOT portable: it turns reasoning off on GPT-5.6 but
|
|
316
|
+
* ERRORS on Claude 5. `PROVIDER_DEFAULT` as an explicit value is also rejected
|
|
317
|
+
* by GPT-5.6 — omit the field entirely for the model's default instead.
|
|
318
|
+
*/
|
|
319
|
+
export var LLMProvider_ReasoningEffort;
|
|
320
|
+
(function (LLMProvider_ReasoningEffort) {
|
|
321
|
+
LLMProvider_ReasoningEffort["PROVIDER_DEFAULT"] = "provider-default";
|
|
322
|
+
LLMProvider_ReasoningEffort["NONE"] = "none";
|
|
323
|
+
LLMProvider_ReasoningEffort["MINIMAL"] = "minimal";
|
|
324
|
+
LLMProvider_ReasoningEffort["LOW"] = "low";
|
|
325
|
+
LLMProvider_ReasoningEffort["MEDIUM"] = "medium";
|
|
326
|
+
LLMProvider_ReasoningEffort["HIGH"] = "high";
|
|
327
|
+
LLMProvider_ReasoningEffort["XHIGH"] = "xhigh";
|
|
328
|
+
})(LLMProvider_ReasoningEffort || (LLMProvider_ReasoningEffort = {}));
|
|
329
|
+
/**
|
|
330
|
+
* THE model catalog — the single per-model fact table.
|
|
331
|
+
*
|
|
332
|
+
* It is an EXHAUSTIVE `Record`, not a `Partial`: adding a member to
|
|
333
|
+
* {@link LLM_Model} without a row here is a compile error. That exhaustiveness
|
|
334
|
+
* is the entire guarantee. Before this record existed, model knowledge lived in
|
|
335
|
+
* four parallel partial maps keyed by the same string — a thinking-capability
|
|
336
|
+
* map, an unsupported-effort map, a pricing table and a capacity registry —
|
|
337
|
+
* plus two enums ({@link LLM_Model_Availability},
|
|
338
|
+
* {@link LLM_Model_IO_Capability}) that had no per-model facts and no consumer
|
|
339
|
+
* at all. Partial maps are how a vocabulary silently stops describing the
|
|
340
|
+
* running system.
|
|
341
|
+
*
|
|
342
|
+
* Per-field burden of proof: see {@link LLM_ModelCatalogEntry}.
|
|
343
|
+
*/
|
|
344
|
+
export const LLM_MODEL_CATALOG = {
|
|
345
|
+
// ---------------------------------------------------------------
|
|
346
|
+
// OpenAI — ids verified LIVE against `GET /v1/models` (2026-07-16).
|
|
347
|
+
// ---------------------------------------------------------------
|
|
348
|
+
[LLM_Model.OPEN_AI_GPT_5_6_SOL]: {
|
|
349
|
+
providerRef: "openai",
|
|
350
|
+
availability: LLM_Model_Availability.PRODUCTION,
|
|
351
|
+
probedOn: "2026-07-16",
|
|
352
|
+
applicabilities: [LLM_Model_Applicability.DEEP_JUDGMENT, LLM_Model_Applicability.LONG_CONTEXT_ANALYSIS],
|
|
353
|
+
ioCapabilities: [
|
|
354
|
+
LLM_Model_IO_Capability.MULTIMODAL_VISION,
|
|
355
|
+
LLM_Model_IO_Capability.STRUCTURED_OUTPUTS,
|
|
356
|
+
LLM_Model_IO_Capability.TOOL_USE,
|
|
357
|
+
LLM_Model_IO_Capability.LONG_CONTEXT,
|
|
358
|
+
],
|
|
359
|
+
thinkingCapability: LLM_Model_Thinking_Capability.OPTIONAL,
|
|
360
|
+
// Live: `minimal` → 400 (the published docs claim it exists — they are wrong).
|
|
361
|
+
unsupportedReasoningEfforts: [LLMProvider_ReasoningEffort.MINIMAL, LLMProvider_ReasoningEffort.PROVIDER_DEFAULT],
|
|
362
|
+
rejectsExplicitTemperature: true,
|
|
363
|
+
},
|
|
364
|
+
[LLM_Model.OPEN_AI_GPT_5_6_TERRA]: {
|
|
365
|
+
providerRef: "openai",
|
|
366
|
+
availability: LLM_Model_Availability.PRODUCTION,
|
|
367
|
+
probedOn: "2026-07-16",
|
|
368
|
+
applicabilities: [LLM_Model_Applicability.STRUCTURED_AUTHORING, LLM_Model_Applicability.VISUAL_JUDGMENT],
|
|
369
|
+
ioCapabilities: [
|
|
370
|
+
LLM_Model_IO_Capability.MULTIMODAL_VISION,
|
|
371
|
+
LLM_Model_IO_Capability.STRUCTURED_OUTPUTS,
|
|
372
|
+
LLM_Model_IO_Capability.TOOL_USE,
|
|
373
|
+
],
|
|
374
|
+
thinkingCapability: LLM_Model_Thinking_Capability.OPTIONAL,
|
|
375
|
+
unsupportedReasoningEfforts: [LLMProvider_ReasoningEffort.MINIMAL, LLMProvider_ReasoningEffort.PROVIDER_DEFAULT],
|
|
376
|
+
rejectsExplicitTemperature: true,
|
|
377
|
+
},
|
|
378
|
+
[LLM_Model.OPEN_AI_GPT_5_6_LUNA]: {
|
|
379
|
+
providerRef: "openai",
|
|
380
|
+
availability: LLM_Model_Availability.PRODUCTION,
|
|
381
|
+
probedOn: "2026-07-16",
|
|
382
|
+
applicabilities: [LLM_Model_Applicability.HIGH_VOLUME_MECHANICAL],
|
|
383
|
+
ioCapabilities: [LLM_Model_IO_Capability.STRUCTURED_OUTPUTS, LLM_Model_IO_Capability.TOOL_USE],
|
|
384
|
+
thinkingCapability: LLM_Model_Thinking_Capability.OPTIONAL,
|
|
385
|
+
unsupportedReasoningEfforts: [LLMProvider_ReasoningEffort.MINIMAL, LLMProvider_ReasoningEffort.PROVIDER_DEFAULT],
|
|
386
|
+
rejectsExplicitTemperature: true,
|
|
387
|
+
},
|
|
388
|
+
[LLM_Model.OPEN_AI_GPT_5_2_PRO]: {
|
|
389
|
+
providerRef: "openai",
|
|
390
|
+
availability: LLM_Model_Availability.PRODUCTION,
|
|
391
|
+
probedOn: "2026-07-16",
|
|
392
|
+
applicabilities: [LLM_Model_Applicability.DEEP_JUDGMENT],
|
|
393
|
+
},
|
|
394
|
+
[LLM_Model.OPEN_AI_GPT_5_2]: {
|
|
395
|
+
providerRef: "openai",
|
|
396
|
+
availability: LLM_Model_Availability.PRODUCTION,
|
|
397
|
+
probedOn: "2026-07-16",
|
|
398
|
+
applicabilities: [],
|
|
399
|
+
},
|
|
400
|
+
[LLM_Model.OPEN_AI_GPT_5_1]: { providerRef: "openai", availability: LLM_Model_Availability.PRODUCTION, probedOn: "2026-07-16", applicabilities: [] },
|
|
401
|
+
[LLM_Model.OPEN_AI_GPT_5]: { providerRef: "openai", availability: LLM_Model_Availability.PRODUCTION, probedOn: "2026-07-16", applicabilities: [] },
|
|
402
|
+
[LLM_Model.OPEN_AI_GPT_5_MINI]: { providerRef: "openai", availability: LLM_Model_Availability.PRODUCTION, probedOn: "2026-07-16", applicabilities: [] },
|
|
403
|
+
[LLM_Model.OPEN_AI_GPT_4O]: { providerRef: "openai", availability: LLM_Model_Availability.PRODUCTION, probedOn: "2026-07-16", applicabilities: [] },
|
|
404
|
+
[LLM_Model.OPEN_AI_GPT_4O_MINI]: { providerRef: "openai", availability: LLM_Model_Availability.PRODUCTION, probedOn: "2026-07-16", applicabilities: [] },
|
|
405
|
+
[LLM_Model.OPEN_AI_GPT_4_TURBO]: { providerRef: "openai", availability: LLM_Model_Availability.PRODUCTION, probedOn: "2026-07-16", applicabilities: [] },
|
|
406
|
+
[LLM_Model.OPEN_AI_GPT_4]: { providerRef: "openai", availability: LLM_Model_Availability.PRODUCTION, probedOn: "2026-07-16", applicabilities: [] },
|
|
407
|
+
[LLM_Model.OPEN_AI_GPT_3_5_TURBO]: { providerRef: "openai", availability: LLM_Model_Availability.PRODUCTION, probedOn: "2026-07-16", applicabilities: [] },
|
|
408
|
+
[LLM_Model.OPEN_AI_O1]: { providerRef: "openai", availability: LLM_Model_Availability.PRODUCTION, probedOn: "2026-07-16", applicabilities: [] },
|
|
409
|
+
[LLM_Model.OPEN_AI_O1_MINI]: { providerRef: "openai", availability: LLM_Model_Availability.PRODUCTION, probedOn: "2026-07-16", applicabilities: [] },
|
|
410
|
+
[LLM_Model.OPEN_AI_O3_MINI]: { providerRef: "openai", availability: LLM_Model_Availability.PRODUCTION, probedOn: "2026-07-16", applicabilities: [] },
|
|
411
|
+
[LLM_Model.OPEN_AI_O4_MINI]: { providerRef: "openai", availability: LLM_Model_Availability.PRODUCTION, probedOn: "2026-07-16", applicabilities: [] },
|
|
412
|
+
// ---------------------------------------------------------------
|
|
413
|
+
// Anthropic — ids verified LIVE against `GET /v1/models` (2026-07-16).
|
|
414
|
+
// The Claude 5 family reasons ADAPTIVELY and cannot be told not to:
|
|
415
|
+
// live, `reasoning: 'none'` → 400 "thinking.type.disabled is not supported
|
|
416
|
+
// for this model; thinking defaults to adaptive".
|
|
417
|
+
// ---------------------------------------------------------------
|
|
418
|
+
[LLM_Model.CLAUDE_FABLE_5]: {
|
|
419
|
+
providerRef: "anthropic",
|
|
420
|
+
availability: LLM_Model_Availability.PRODUCTION,
|
|
421
|
+
probedOn: "2026-07-16",
|
|
422
|
+
applicabilities: [
|
|
423
|
+
LLM_Model_Applicability.DEEP_JUDGMENT,
|
|
424
|
+
LLM_Model_Applicability.LONG_CONTEXT_ANALYSIS,
|
|
425
|
+
LLM_Model_Applicability.VISUAL_JUDGMENT,
|
|
426
|
+
],
|
|
427
|
+
ioCapabilities: [
|
|
428
|
+
LLM_Model_IO_Capability.MULTIMODAL_VISION,
|
|
429
|
+
LLM_Model_IO_Capability.STRUCTURED_OUTPUTS,
|
|
430
|
+
LLM_Model_IO_Capability.TOOL_USE,
|
|
431
|
+
LLM_Model_IO_Capability.LONG_CONTEXT,
|
|
432
|
+
],
|
|
433
|
+
thinkingCapability: LLM_Model_Thinking_Capability.ALWAYS,
|
|
434
|
+
rejectsExplicitTemperature: true,
|
|
435
|
+
},
|
|
436
|
+
[LLM_Model.CLAUDE_SONNET_5]: {
|
|
437
|
+
providerRef: "anthropic",
|
|
438
|
+
availability: LLM_Model_Availability.PRODUCTION,
|
|
439
|
+
probedOn: "2026-07-16",
|
|
440
|
+
applicabilities: [
|
|
441
|
+
LLM_Model_Applicability.STRUCTURED_AUTHORING,
|
|
442
|
+
LLM_Model_Applicability.WORKSPACE_CODING_AGENT,
|
|
443
|
+
],
|
|
444
|
+
ioCapabilities: [
|
|
445
|
+
LLM_Model_IO_Capability.MULTIMODAL_VISION,
|
|
446
|
+
LLM_Model_IO_Capability.STRUCTURED_OUTPUTS,
|
|
447
|
+
LLM_Model_IO_Capability.TOOL_USE,
|
|
448
|
+
LLM_Model_IO_Capability.CODE_GENERATION,
|
|
449
|
+
],
|
|
450
|
+
thinkingCapability: LLM_Model_Thinking_Capability.ALWAYS,
|
|
451
|
+
rejectsExplicitTemperature: true,
|
|
452
|
+
},
|
|
453
|
+
[LLM_Model.CLAUDE_OPUS_4_8]: {
|
|
454
|
+
providerRef: "anthropic",
|
|
455
|
+
availability: LLM_Model_Availability.PRODUCTION,
|
|
456
|
+
probedOn: "2026-07-16",
|
|
457
|
+
applicabilities: [LLM_Model_Applicability.WORKSPACE_CODING_AGENT],
|
|
458
|
+
ioCapabilities: [LLM_Model_IO_Capability.TOOL_USE, LLM_Model_IO_Capability.CODE_GENERATION],
|
|
459
|
+
},
|
|
460
|
+
[LLM_Model.CLAUDE_SONNET_4_5]: {
|
|
461
|
+
providerRef: "anthropic",
|
|
462
|
+
availability: LLM_Model_Availability.PRODUCTION,
|
|
463
|
+
probedOn: "2026-07-16",
|
|
464
|
+
applicabilities: [LLM_Model_Applicability.WORKSPACE_CODING_AGENT],
|
|
465
|
+
ioCapabilities: [LLM_Model_IO_Capability.TOOL_USE, LLM_Model_IO_Capability.CODE_GENERATION],
|
|
466
|
+
},
|
|
467
|
+
[LLM_Model.CLAUDE_HAIKU_4_5]: {
|
|
468
|
+
providerRef: "anthropic",
|
|
469
|
+
availability: LLM_Model_Availability.PRODUCTION,
|
|
470
|
+
probedOn: "2026-07-16",
|
|
471
|
+
applicabilities: [LLM_Model_Applicability.HIGH_VOLUME_MECHANICAL],
|
|
472
|
+
ioCapabilities: [LLM_Model_IO_Capability.STRUCTURED_OUTPUTS],
|
|
473
|
+
},
|
|
474
|
+
// ---------------------------------------------------------------
|
|
475
|
+
// Google / Mistral / Perplexity / xAI — NEVER live-verified by this
|
|
476
|
+
// repository. `availability` is therefore omitted and no row is
|
|
477
|
+
// auto-selectable. Probe an id and fill its row before preferring it.
|
|
478
|
+
// ---------------------------------------------------------------
|
|
479
|
+
[LLM_Model.GOOGLE_GEMINI_3_DEEP_THINK]: { providerRef: "google", applicabilities: [] },
|
|
480
|
+
[LLM_Model.GOOGLE_GEMINI_3_PRO]: { providerRef: "google", applicabilities: [] },
|
|
481
|
+
[LLM_Model.GOOGLE_GEMINI_2_5_PRO]: { providerRef: "google", applicabilities: [] },
|
|
482
|
+
[LLM_Model.GOOGLE_GEMINI_2_5_FLASH]: { providerRef: "google", applicabilities: [] },
|
|
483
|
+
[LLM_Model.GOOGLE_GEMINI_2_0_FLASH]: { providerRef: "google", applicabilities: [] },
|
|
484
|
+
[LLM_Model.GOOGLE_GEMINI_1_5_PRO]: { providerRef: "google", applicabilities: [] },
|
|
485
|
+
[LLM_Model.GOOGLE_GEMINI_1_5_FLASH]: { providerRef: "google", applicabilities: [] },
|
|
486
|
+
[LLM_Model.GOOGLE_GEMINI_PRO]: { providerRef: "google", applicabilities: [] },
|
|
487
|
+
[LLM_Model.GOOGLE_GEMINI_PRO_VISION]: { providerRef: "google", applicabilities: [] },
|
|
488
|
+
[LLM_Model.MISTRAL_LARGE]: { providerRef: "mistral", applicabilities: [] },
|
|
489
|
+
[LLM_Model.MISTRAL_MEDIUM]: { providerRef: "mistral", applicabilities: [] },
|
|
490
|
+
[LLM_Model.MISTRAL_SMALL]: { providerRef: "mistral", applicabilities: [] },
|
|
491
|
+
[LLM_Model.PERPLEXITY_SONAR_LARGE_ONLINE]: { providerRef: "perplexity", applicabilities: [] },
|
|
492
|
+
[LLM_Model.PERPLEXITY_SONAR_MEDIUM_ONLINE]: { providerRef: "perplexity", applicabilities: [] },
|
|
493
|
+
[LLM_Model.PERPLEXITY_SONAR_SMALL_ONLINE]: { providerRef: "perplexity", applicabilities: [] },
|
|
494
|
+
[LLM_Model.PERPLEXITY_SONAR_LARGE_CHAT]: { providerRef: "perplexity", applicabilities: [] },
|
|
495
|
+
[LLM_Model.PERPLEXITY_SONAR_MEDIUM_CHAT]: { providerRef: "perplexity", applicabilities: [] },
|
|
496
|
+
[LLM_Model.PERPLEXITY_SONAR_SMALL_CHAT]: { providerRef: "perplexity", applicabilities: [] },
|
|
497
|
+
[LLM_Model.GROK_4]: { providerRef: "grok", applicabilities: [] },
|
|
498
|
+
[LLM_Model.GROK_3]: { providerRef: "grok", applicabilities: [] },
|
|
499
|
+
[LLM_Model.GROK_2_VISION]: { providerRef: "grok", applicabilities: [] },
|
|
500
|
+
[LLM_Model.GROK_2]: { providerRef: "grok", applicabilities: [] },
|
|
501
|
+
};
|
|
502
|
+
/**
|
|
503
|
+
* Availability states a model may be auto-RESOLVED in. `DEPRECATED` and
|
|
504
|
+
* `DISCONTINUED` are deliberately absent: a retired id stays nameable as an
|
|
505
|
+
* explicit pin and readable in a stored trace, but the framework will not
|
|
506
|
+
* choose it on an author's behalf.
|
|
507
|
+
*/
|
|
508
|
+
export const LLM_MODEL_RESOLVABLE_AVAILABILITIES = [
|
|
509
|
+
LLM_Model_Availability.PRODUCTION,
|
|
510
|
+
LLM_Model_Availability.BETA,
|
|
511
|
+
LLM_Model_Availability.PREVIEW,
|
|
512
|
+
];
|
|
513
|
+
/**
|
|
514
|
+
* The framework's DEFAULT answer to "which model serves this kind of work",
|
|
515
|
+
* ordered by preference, highest first.
|
|
516
|
+
*
|
|
517
|
+
* This is the one place a monthly model launch lands: add its catalog row, then
|
|
518
|
+
* put it at the head of the applicabilities it should now serve. No agent
|
|
519
|
+
* definition changes. An application may override this per applicability (see
|
|
520
|
+
* the resolution options on {@link resolveModelForApplicability}) when it wants
|
|
521
|
+
* a different cost/quality trade without forking the engine.
|
|
522
|
+
*
|
|
523
|
+
* A preference entry is only a CANDIDATE — resolution still requires the row to
|
|
524
|
+
* name the requesting provider, to be in a resolvable availability, and to
|
|
525
|
+
* declare the applicability. So an entry can never resurrect a retired model or
|
|
526
|
+
* quietly widen what a model is used for.
|
|
527
|
+
*/
|
|
528
|
+
export const LLM_MODEL_APPLICABILITY_PREFERENCE = {
|
|
529
|
+
[LLM_Model_Applicability.DEEP_JUDGMENT]: [
|
|
530
|
+
LLM_Model.CLAUDE_FABLE_5,
|
|
531
|
+
LLM_Model.OPEN_AI_GPT_5_6_SOL,
|
|
532
|
+
LLM_Model.OPEN_AI_GPT_5_2_PRO,
|
|
533
|
+
],
|
|
534
|
+
[LLM_Model_Applicability.STRUCTURED_AUTHORING]: [
|
|
535
|
+
LLM_Model.OPEN_AI_GPT_5_6_TERRA,
|
|
536
|
+
LLM_Model.CLAUDE_SONNET_5,
|
|
537
|
+
],
|
|
538
|
+
[LLM_Model_Applicability.HIGH_VOLUME_MECHANICAL]: [
|
|
539
|
+
LLM_Model.OPEN_AI_GPT_5_6_LUNA,
|
|
540
|
+
LLM_Model.CLAUDE_HAIKU_4_5,
|
|
541
|
+
],
|
|
542
|
+
[LLM_Model_Applicability.LONG_CONTEXT_ANALYSIS]: [
|
|
543
|
+
LLM_Model.CLAUDE_FABLE_5,
|
|
544
|
+
LLM_Model.OPEN_AI_GPT_5_6_SOL,
|
|
545
|
+
],
|
|
546
|
+
[LLM_Model_Applicability.VISUAL_JUDGMENT]: [
|
|
547
|
+
LLM_Model.OPEN_AI_GPT_5_6_TERRA,
|
|
548
|
+
LLM_Model.CLAUDE_FABLE_5,
|
|
549
|
+
],
|
|
550
|
+
[LLM_Model_Applicability.WORKSPACE_CODING_AGENT]: [
|
|
551
|
+
LLM_Model.CLAUDE_SONNET_5,
|
|
552
|
+
LLM_Model.CLAUDE_SONNET_4_5,
|
|
553
|
+
LLM_Model.CLAUDE_OPUS_4_8,
|
|
554
|
+
],
|
|
555
|
+
};
|
|
556
|
+
/**
|
|
557
|
+
* IO capabilities an applicability REQUIRES of any model resolved for it.
|
|
558
|
+
*
|
|
559
|
+
* Only vision is gated today, and deliberately: selecting a model that cannot
|
|
560
|
+
* see for work whose entire input is an image is a silent, expensive failure
|
|
561
|
+
* (the model answers confidently about nothing). Because `ioCapabilities` is
|
|
562
|
+
* evidence-led, an unpopulated row is simply not selected for vision work —
|
|
563
|
+
* fail-closed on the axis where a wrong answer is unrecoverable.
|
|
564
|
+
*/
|
|
565
|
+
const LLM_MODEL_APPLICABILITY_REQUIRED_IO = {
|
|
566
|
+
[LLM_Model_Applicability.VISUAL_JUDGMENT]: [LLM_Model_IO_Capability.MULTIMODAL_VISION],
|
|
567
|
+
};
|
|
568
|
+
/** Why {@link resolveModelForApplicability} could not answer — carried into a named CONFIGURATION error. */
|
|
569
|
+
export var LLM_ModelResolutionFailure;
|
|
570
|
+
(function (LLM_ModelResolutionFailure) {
|
|
571
|
+
/** The applicability has no candidate at all for this provider. */
|
|
572
|
+
LLM_ModelResolutionFailure["NO_CANDIDATE_FOR_PROVIDER"] = "no_candidate_for_provider";
|
|
573
|
+
/** Candidates exist for this provider but none is in a resolvable availability. */
|
|
574
|
+
LLM_ModelResolutionFailure["NO_RESOLVABLE_AVAILABILITY"] = "no_resolvable_availability";
|
|
575
|
+
/** Candidates exist and are available, but none evidences the required IO capability. */
|
|
576
|
+
LLM_ModelResolutionFailure["REQUIRED_IO_CAPABILITY_UNEVIDENCED"] = "required_io_capability_unevidenced";
|
|
577
|
+
})(LLM_ModelResolutionFailure || (LLM_ModelResolutionFailure = {}));
|
|
578
|
+
/**
|
|
579
|
+
* Resolve an applicability to ONE concrete model id for a given provider.
|
|
580
|
+
*
|
|
581
|
+
* Fails CLOSED and explains itself: an unresolvable applicability must surface
|
|
582
|
+
* as a named startup/configuration error naming what was considered, never as a
|
|
583
|
+
* silent fallback to some other model. A fallback here would be the exact defect
|
|
584
|
+
* this layer exists to remove — the author asked for a KIND of model, and
|
|
585
|
+
* quietly handing them a different kind is worse than refusing.
|
|
586
|
+
*
|
|
587
|
+
* Note this function answers the semantic question only. Whether the resolved
|
|
588
|
+
* model is reachable over the agent's TRANSPORT (a profile that
|
|
589
|
+
* declares it) is a separate gate owned by the backend, because the transport
|
|
590
|
+
* declaration lives on the provider registry rather than in this catalog.
|
|
591
|
+
*
|
|
592
|
+
* `catalog` is a parameter rather than a closed-over constant so each gate can
|
|
593
|
+
* be exercised INDEPENDENTLY: with the real catalog, several gates are
|
|
594
|
+
* unreachable simply because no shipped row has the shape that trips them (no
|
|
595
|
+
* model is currently both applicability-declaring and unverified), and a gate
|
|
596
|
+
* that cannot be reached is a gate nobody has tested. Production callers pass
|
|
597
|
+
* nothing.
|
|
598
|
+
*/
|
|
599
|
+
export const resolveModelForApplicability = (input, catalog = LLM_MODEL_CATALOG) => {
|
|
600
|
+
const override = input.preferenceOverride?.[input.applicability];
|
|
601
|
+
const candidates = override ?? LLM_MODEL_APPLICABILITY_PREFERENCE[input.applicability];
|
|
602
|
+
const requiredIo = LLM_MODEL_APPLICABILITY_REQUIRED_IO[input.applicability] ?? [];
|
|
603
|
+
const forProvider = candidates.filter((model) => {
|
|
604
|
+
const entry = catalog[model];
|
|
605
|
+
return entry.providerRef === input.providerRef && entry.applicabilities.includes(input.applicability);
|
|
606
|
+
});
|
|
607
|
+
if (forProvider.length === 0) {
|
|
608
|
+
return { resolved: false, failure: LLM_ModelResolutionFailure.NO_CANDIDATE_FOR_PROVIDER, consideredModels: candidates };
|
|
609
|
+
}
|
|
610
|
+
const available = forProvider.filter((model) => {
|
|
611
|
+
const availability = catalog[model].availability;
|
|
612
|
+
return availability !== undefined && LLM_MODEL_RESOLVABLE_AVAILABILITIES.includes(availability);
|
|
613
|
+
});
|
|
614
|
+
if (available.length === 0) {
|
|
615
|
+
return { resolved: false, failure: LLM_ModelResolutionFailure.NO_RESOLVABLE_AVAILABILITY, consideredModels: forProvider };
|
|
616
|
+
}
|
|
617
|
+
const capable = available.filter((model) => {
|
|
618
|
+
const evidenced = catalog[model].ioCapabilities ?? [];
|
|
619
|
+
return requiredIo.every((capability) => evidenced.includes(capability));
|
|
620
|
+
});
|
|
621
|
+
if (capable.length === 0) {
|
|
622
|
+
return { resolved: false, failure: LLM_ModelResolutionFailure.REQUIRED_IO_CAPABILITY_UNEVIDENCED, consideredModels: available };
|
|
623
|
+
}
|
|
624
|
+
const model = capable[0];
|
|
625
|
+
return { resolved: true, model, entry: catalog[model], fromOverride: override !== undefined };
|
|
626
|
+
};
|
|
627
|
+
/**
|
|
628
|
+
* Model → thinking capability, DERIVED from {@link LLM_MODEL_CATALOG}.
|
|
629
|
+
*
|
|
630
|
+
* Still partial and still evidence-only: a model appears here only when its
|
|
631
|
+
* catalog row carries a probed `thinkingCapability`. Absence means "not yet
|
|
632
|
+
* verified", NOT "no thinking". Validation FAILS OPEN on absent/unknown models
|
|
633
|
+
* — `LLMProvider_OperationModelConfiguration.model` is a free `z.string()`
|
|
634
|
+
* (fine-tuned + custom deployment ids are legitimate), so we can neither
|
|
635
|
+
* enumerate every id nor guess safely. Guessing is worse than omitting: a wrong
|
|
636
|
+
* `ALWAYS` blocks a legal config, whereas an omission leaves runtime behavior
|
|
637
|
+
* untouched.
|
|
638
|
+
*/
|
|
639
|
+
export const LLM_MODEL_THINKING_CAPABILITY = Object.fromEntries(Object.entries(LLM_MODEL_CATALOG)
|
|
640
|
+
.filter(([, entry]) => entry.thinkingCapability !== undefined)
|
|
641
|
+
.map(([model, entry]) => [model, entry.thinkingCapability]));
|
|
642
|
+
/**
|
|
643
|
+
* Effort levels a specific model REJECTS despite its thinking capability,
|
|
644
|
+
* DERIVED from {@link LLM_MODEL_CATALOG} — per-provider vocabulary quirks,
|
|
645
|
+
* distinct from the capability axis above. Evidence-only, same rule.
|
|
646
|
+
*
|
|
647
|
+
* `PROVIDER_DEFAULT` is rejected by GPT-5.6 as an explicit value: to get the
|
|
648
|
+
* model's own default, OMIT `reasoningEffort` entirely rather than naming it.
|
|
649
|
+
*/
|
|
650
|
+
export const LLM_MODEL_UNSUPPORTED_REASONING_EFFORTS = Object.fromEntries(Object.entries(LLM_MODEL_CATALOG)
|
|
651
|
+
.filter(([, entry]) => entry.unsupportedReasoningEfforts !== undefined)
|
|
652
|
+
.map(([model, entry]) => [model, entry.unsupportedReasoningEfforts]));
|
|
653
|
+
/**
|
|
654
|
+
* Resolve a model's verified thinking capability, or `undefined` when the model
|
|
655
|
+
* id is unknown/unverified (free-form ids are legitimate — see
|
|
656
|
+
* {@link LLM_MODEL_THINKING_CAPABILITY}).
|
|
657
|
+
*/
|
|
658
|
+
export const getModelThinkingCapability = (model) => LLM_MODEL_THINKING_CAPABILITY[model];
|
|
659
|
+
/** @wildo_source:part:start saas.external-providers.llm.model-configuration facet:kind:api facet:audience:app-developer
|
|
660
|
+
*
|
|
661
|
+
* Validate a `model × reasoningEffort` pair against verified capability.
|
|
662
|
+
*
|
|
663
|
+
* Returns a human-readable violation, or `null` when the pair is valid OR
|
|
664
|
+
* cannot be judged. **Fails OPEN by design** (unknown model, or omitted effort
|
|
665
|
+
* → `null`): the alternative would reject legitimate custom deployments.
|
|
666
|
+
*
|
|
667
|
+
* Call this at authoring/registration time so an impossible pair surfaces as a
|
|
668
|
+
* named startup error instead of a provider 400 in the middle of a long agent
|
|
669
|
+
* pipeline — the trap this exists to catch is `NONE`, which turns reasoning off
|
|
670
|
+
* on GPT-5.6 but hard-errors on Claude 5.
|
|
671
|
+
*
|
|
672
|
+
* @param model The configured model id (free-form; unknown ids pass).
|
|
673
|
+
* @param effort The configured effort; omit/undefined always passes.
|
|
674
|
+
* @returns A violation message, or `null` if valid/unjudgeable.
|
|
675
|
+
*/
|
|
676
|
+
export const validateReasoningEffortForModel = (model, effort) => {
|
|
677
|
+
/** @wildo_source:part:end saas.external-providers.llm.model-configuration */
|
|
678
|
+
if (effort === undefined)
|
|
679
|
+
return null;
|
|
680
|
+
const capability = getModelThinkingCapability(model);
|
|
681
|
+
if (capability === undefined)
|
|
682
|
+
return null;
|
|
683
|
+
if (capability === LLM_Model_Thinking_Capability.NONE) {
|
|
684
|
+
return `Model "${model}" is not a reasoning model, so it accepts no reasoningEffort (got "${effort}"). Remove reasoningEffort, or pick a reasoning-capable model.`;
|
|
685
|
+
}
|
|
686
|
+
if (capability === LLM_Model_Thinking_Capability.ALWAYS && effort === LLMProvider_ReasoningEffort.NONE) {
|
|
687
|
+
return `Model "${model}" always reasons — its thinking cannot be disabled, so reasoningEffort "none" is rejected by the provider. Use "low" for the cheapest reasoning, or omit reasoningEffort for the model default.`;
|
|
688
|
+
}
|
|
689
|
+
const unsupported = LLM_MODEL_UNSUPPORTED_REASONING_EFFORTS[model];
|
|
690
|
+
if (unsupported?.includes(effort)) {
|
|
691
|
+
const hint = effort === LLMProvider_ReasoningEffort.PROVIDER_DEFAULT
|
|
692
|
+
? 'Omit reasoningEffort entirely to get the model default.'
|
|
693
|
+
: `Supported levels for this model exclude "${effort}".`;
|
|
694
|
+
return `Model "${model}" rejects reasoningEffort "${effort}". ${hint}`;
|
|
695
|
+
}
|
|
696
|
+
return null;
|
|
697
|
+
};
|
|
698
|
+
/** @wildo_source:part:start saas.external-providers.llm.model-configuration facet:kind:api facet:audience:app-developer
|
|
699
|
+
*
|
|
700
|
+
* The provider/model/sampling surface every LLM agent config inherits — this is
|
|
701
|
+
* the shape behind an agent's `config` (an agent adds `operationKey` on top).
|
|
702
|
+
*
|
|
703
|
+
* `providerRef` names a provider you enabled for the `AI_LLM` capability in
|
|
704
|
+
* `defineSaaSProviders`; `model` is a free-form string so fine-tuned and custom
|
|
705
|
+
* deployment ids stay legal. Every sampling field is OPTIONAL and every one of
|
|
706
|
+
* them is forwarded to the provider verbatim — so an unsupported value is a
|
|
707
|
+
* provider 400, not a framework-side clamp. Omit a field to accept the model's
|
|
708
|
+
* own default; that is the portable choice (notably: the Claude 5 family
|
|
709
|
+
* REJECTS an explicit `temperature`).
|
|
710
|
+
*/
|
|
134
711
|
export const LLMProvider_OperationModelConfiguration_Schema = z.object({
|
|
135
712
|
model: z.string(),
|
|
136
713
|
providerRef: z.string(),
|
|
@@ -140,11 +717,26 @@ export const LLMProvider_OperationModelConfiguration_Schema = z.object({
|
|
|
140
717
|
frequencyPenalty: z.number().optional(),
|
|
141
718
|
presencePenalty: z.number().optional(),
|
|
142
719
|
stopStringSequences: z.array(z.string()).optional(),
|
|
143
|
-
|
|
720
|
+
/**
|
|
721
|
+
* Reasoning-effort for reasoning-capable models — forwarded as the AI SDK
|
|
722
|
+
* top-level `reasoning` option (see {@link LLMProvider_ReasoningEffort}).
|
|
723
|
+
* Optional + additive: an agent that omits it keeps the model's default
|
|
724
|
+
* effort (the pre-Phase-3 behavior).
|
|
725
|
+
*/
|
|
726
|
+
reasoningEffort: z.enum(LLMProvider_ReasoningEffort).optional(),
|
|
727
|
+
// NOTE: a `thinkingEnabled: boolean` field used to sit here. RETIRED
|
|
728
|
+
// (2026-07-17) — it was a THIRD authority axis on reasoning (alongside
|
|
729
|
+
// `reasoningEffort` and the `*_THINKING` op keys), it was strictly subsumed
|
|
730
|
+
// by `reasoningEffort` (which expresses on/off AND depth), and it was never
|
|
731
|
+
// read by any executor: the `THINKING_MODE` model preset and the
|
|
732
|
+
// `ThinkingModeFacet` set it, and nothing acted on it. Authors composing that
|
|
733
|
+
// facet believed they were enabling deep reasoning and got nothing. Use
|
|
734
|
+
// `reasoningEffort` — it is the single authority.
|
|
144
735
|
toolingFunctionEnabled: z.boolean().optional(),
|
|
145
736
|
mcpCompatible: z.boolean().optional(),
|
|
146
737
|
toolChoice: LLMProvider_ToolChoice_Schema.optional(),
|
|
147
738
|
});
|
|
739
|
+
/** @wildo_source:part:end saas.external-providers.llm.model-configuration */
|
|
148
740
|
// ===============================================================
|
|
149
741
|
// LLM Operations Context
|
|
150
742
|
// ===============================================================
|
|
@@ -161,6 +753,20 @@ export const LLMProvider_UsageSchema = z.object({
|
|
|
161
753
|
promptTokens: z.number().optional(),
|
|
162
754
|
completionTokens: z.number().optional(),
|
|
163
755
|
totalTokens: z.number().optional(),
|
|
756
|
+
/**
|
|
757
|
+
* False when a physical provider result omitted a token dimension THE OPERATION REQUIRES.
|
|
758
|
+
* Operation-aware by contract (RAG plan H4): a GENERATION requires prompt AND completion
|
|
759
|
+
* tokens; an EMBEDDING trace (`AgentCallTraceKind.EMBEDDING`) has no completion-token
|
|
760
|
+
* dimension, so its producer judges completeness on input tokens alone — an embedding must
|
|
761
|
+
* never be flagged incomplete for lacking tokens it structurally cannot have.
|
|
762
|
+
*/
|
|
763
|
+
tokenUsageComplete: z.boolean().optional(),
|
|
764
|
+
/** Exact AI-SDK input categories retained for provider acquisition-cost accounting. */
|
|
765
|
+
inputTokenDetails: z.object({
|
|
766
|
+
noCacheTokens: z.number().optional(),
|
|
767
|
+
cacheReadTokens: z.number().optional(),
|
|
768
|
+
cacheWriteTokens: z.number().optional(),
|
|
769
|
+
}).optional(),
|
|
164
770
|
});
|
|
165
771
|
export const LLMProvider_TrackingSchema = z.object({
|
|
166
772
|
// Tool execution tracking
|
|
@@ -200,10 +806,20 @@ export const LLMProvider_TrackingSchema = z.object({
|
|
|
200
806
|
tokensUsed: z.number().optional(),
|
|
201
807
|
})).optional(),
|
|
202
808
|
});
|
|
809
|
+
/**
|
|
810
|
+
* How an LLM operation was physically executed.
|
|
811
|
+
*
|
|
812
|
+
* One member, deliberately. A `CLI` member existed while a coding agent was
|
|
813
|
+
* mis-modelled as a text completion and reached the model through a subprocess;
|
|
814
|
+
* with coding agents moved to their own operation family and their own
|
|
815
|
+
* execution-transport metadata, an LLM call is served over HTTP and nothing
|
|
816
|
+
* else. Kept as an enum rather than collapsed away because the field is
|
|
817
|
+
* recorded on durable execution contexts, where a bare literal would carry no
|
|
818
|
+
* explanation and a second transport may yet be real.
|
|
819
|
+
*/
|
|
203
820
|
export var LLMProvider_ExecutionTransportKind;
|
|
204
821
|
(function (LLMProvider_ExecutionTransportKind) {
|
|
205
822
|
LLMProvider_ExecutionTransportKind["API"] = "api";
|
|
206
|
-
LLMProvider_ExecutionTransportKind["CLI"] = "cli";
|
|
207
823
|
})(LLMProvider_ExecutionTransportKind || (LLMProvider_ExecutionTransportKind = {}));
|
|
208
824
|
export const LLMProvider_ExecutionArtifactKindSchema = z.enum([
|
|
209
825
|
"stdout",
|
|
@@ -220,22 +836,168 @@ export const LLMProvider_ExecutionTransportMetadataSchema = z.discriminatedUnion
|
|
|
220
836
|
providerRef: z.string(),
|
|
221
837
|
model: z.string().optional(),
|
|
222
838
|
}),
|
|
223
|
-
z.object({
|
|
224
|
-
kind: z.literal(LLMProvider_ExecutionTransportKind.CLI),
|
|
225
|
-
protocolKind: z.literal(ExternalProvider_ExchangeProtocol_Kind.CLI_RUNTIME),
|
|
226
|
-
providerRef: z.string(),
|
|
227
|
-
model: z.string().optional(),
|
|
228
|
-
resolvedModel: z.string().optional(),
|
|
229
|
-
executionProfileRef: z.string(),
|
|
230
|
-
runnerHost: z.enum(CLIRuntime_RunnerHost),
|
|
231
|
-
outputParserMode: z.enum(CLIRuntime_OutputParserMode),
|
|
232
|
-
command: z.string(),
|
|
233
|
-
workingDirectory: z.string(),
|
|
234
|
-
exitCode: z.number().nullable().optional(),
|
|
235
|
-
signal: z.string().nullable().optional(),
|
|
236
|
-
artifacts: z.array(LLMProvider_ExecutionArtifactMetadataSchema).optional(),
|
|
237
|
-
}),
|
|
238
839
|
]);
|
|
840
|
+
/**
|
|
841
|
+
* Why a `GENERATE_STRUCTURED` call returned `{ object: undefined }` even though a
|
|
842
|
+
* physical provider call completed.
|
|
843
|
+
*
|
|
844
|
+
* The two members are the two distinct code paths that can produce a missing object,
|
|
845
|
+
* and they are NOT interchangeable — they differ in whether the call is billable and
|
|
846
|
+
* in whether the provider told us anything about the shape of the failure:
|
|
847
|
+
*
|
|
848
|
+
* - `INVALID_OBJECT_AFTER_COMPLETED_CALL` — the provider answered, its usage is real
|
|
849
|
+
* and metered, and the SDK rejected what came back: schema validation failed, the
|
|
850
|
+
* JSON was unparseable, or the completion was truncated. This is the member that
|
|
851
|
+
* carries `validationIssues` (the exact schema paths the model omitted) and
|
|
852
|
+
* `finishReason`.
|
|
853
|
+
* - `NO_OBJECT_GENERATED` — the SDK raised `AI_NoObjectGeneratedError` without a
|
|
854
|
+
* usage-bearing payload, so no shape metadata was recovered. Distinguished from the
|
|
855
|
+
* above precisely because a caller must NOT read the absence of `validationIssues`
|
|
856
|
+
* here as "the schema was satisfied".
|
|
857
|
+
* - `RESOLVED_WITHOUT_OBJECT` — the SDK call RESOLVED, raising nothing at all, and the
|
|
858
|
+
* object was still absent. Off-contract for the AI SDK, whose `generateObject` declares
|
|
859
|
+
* a non-optional `object` and signals absence by throwing; it is a member because the
|
|
860
|
+
* engine does not validate that contract, so without it this vocabulary would have a
|
|
861
|
+
* hole exactly where the invariant below is least defensible. A caller seeing this is
|
|
862
|
+
* looking at an SDK or provider-adapter defect, not at a model that answered badly.
|
|
863
|
+
*
|
|
864
|
+
* Deliberately NOT a member: a provider transport failure. Those still THROW a typed
|
|
865
|
+
* backend error rather than returning `{ object: undefined }`, and folding them in
|
|
866
|
+
* here would let a caller treat a network fault as a model-output problem.
|
|
867
|
+
*
|
|
868
|
+
* The invariant these three members exist to uphold: **every path that hands a caller
|
|
869
|
+
* `{ object: undefined }` attaches one of them.** That is what lets the field's absence
|
|
870
|
+
* mean "not a structured-output failure" rather than "no reason was recorded" — and it is
|
|
871
|
+
* why the third member was added rather than the third path left unattached.
|
|
872
|
+
*/
|
|
873
|
+
export var LLMProvider_StructuredGenerationFailureKind;
|
|
874
|
+
(function (LLMProvider_StructuredGenerationFailureKind) {
|
|
875
|
+
LLMProvider_StructuredGenerationFailureKind["INVALID_OBJECT_AFTER_COMPLETED_CALL"] = "invalid-object-after-completed-call";
|
|
876
|
+
LLMProvider_StructuredGenerationFailureKind["NO_OBJECT_GENERATED"] = "no-object-generated";
|
|
877
|
+
LLMProvider_StructuredGenerationFailureKind["RESOLVED_WITHOUT_OBJECT"] = "resolved-without-object";
|
|
878
|
+
})(LLMProvider_StructuredGenerationFailureKind || (LLMProvider_StructuredGenerationFailureKind = {}));
|
|
879
|
+
/**
|
|
880
|
+
* One structural validation issue recovered from the SDK/Zod cause chain.
|
|
881
|
+
*
|
|
882
|
+
* `code` + `path` ONLY, never the issue's `message`: a provider validation error
|
|
883
|
+
* retains the rejected value in its message, so carrying it would copy private model
|
|
884
|
+
* output into any log, trace or persisted failure record that receives this reason.
|
|
885
|
+
* The path is what a caller actually needs — it names the field the model omitted.
|
|
886
|
+
*/
|
|
887
|
+
export const LLMProvider_StructuredValidationIssueSchema = z.object({
|
|
888
|
+
code: z.string(),
|
|
889
|
+
path: z.array(z.union([z.string(), z.number()])),
|
|
890
|
+
});
|
|
891
|
+
/**
|
|
892
|
+
* The reason a structured generation produced no object, carried back to the CALLER.
|
|
893
|
+
*
|
|
894
|
+
* ## Why this exists
|
|
895
|
+
*
|
|
896
|
+
* `GENERATE_STRUCTURED` logs a rich failure line (error name, message, validation
|
|
897
|
+
* cause, the exact schema paths that failed, finish reason, generated-text length)
|
|
898
|
+
* and then used to return `{ object: undefined }` with nothing attached. Every caller
|
|
899
|
+
* therefore knew only "no object" and had to invent a generic message, so the only way
|
|
900
|
+
* to learn WHY a unit failed was to grep the process's own log file for the preceding
|
|
901
|
+
* line — which is not available to the operator reading a CLI summary, a persisted
|
|
902
|
+
* failure record, or a retry classifier.
|
|
903
|
+
*
|
|
904
|
+
* ## Where it is delivered
|
|
905
|
+
*
|
|
906
|
+
* On {@link LLMProvider_OperationContext_BaseSchema}, i.e. the invocation's
|
|
907
|
+
* `executionContext` — the same envelope that already carries `usage`, `finishReason`
|
|
908
|
+
* and `transport`. It is OPTIONAL and present only on a failed structured generation,
|
|
909
|
+
* so no existing caller is affected; a caller that wants the reason reads
|
|
910
|
+
* `executionContext.structuredGenerationFailure` exactly as it already reads
|
|
911
|
+
* `executionContext.usage`.
|
|
912
|
+
*
|
|
913
|
+
* Because the whole envelope is what the agent-call trace sink receives as its
|
|
914
|
+
* `context`, the reason reaches traceability for free.
|
|
915
|
+
*
|
|
916
|
+
* ## Privacy
|
|
917
|
+
*
|
|
918
|
+
* Contains NO generated text. `generatedTextLength` is a length, not a sample; it
|
|
919
|
+
* distinguishes a truncation from an empty completion without disclosing content.
|
|
920
|
+
*/
|
|
921
|
+
export const LLMProvider_StructuredGenerationFailureSchema = z.object({
|
|
922
|
+
kind: z.enum(LLMProvider_StructuredGenerationFailureKind),
|
|
923
|
+
/** Human-readable one-liner, resolved through the engine's caught-error description. */
|
|
924
|
+
message: z.string(),
|
|
925
|
+
/** The thrown value's `name` when it had one, else its `typeof`. */
|
|
926
|
+
errorName: z.string().optional(),
|
|
927
|
+
/** `name` of the nested validation cause (e.g. `AI_TypeValidationError`, `ZodError`). */
|
|
928
|
+
validationCauseName: z.string().optional(),
|
|
929
|
+
/** Structural issues only — see {@link LLMProvider_StructuredValidationIssueSchema}. */
|
|
930
|
+
validationIssues: z.array(LLMProvider_StructuredValidationIssueSchema).optional(),
|
|
931
|
+
/**
|
|
932
|
+
* The provider/SDK finish reason AS REPORTED, deliberately a raw string rather than
|
|
933
|
+
* {@link LLMProvider_FinishReason}. The SDK's spelling (`content-filter`,
|
|
934
|
+
* `tool-calls`) does not match this enum's (`content_filter`, `tool_calls`), so
|
|
935
|
+
* narrowing would either drop the value or fabricate `OTHER` — and this field exists
|
|
936
|
+
* because `length` is the single most diagnostic value a truncated call reports.
|
|
937
|
+
*/
|
|
938
|
+
finishReason: z.string().optional(),
|
|
939
|
+
/** Length of the text the provider did generate; `null` when it reported none. */
|
|
940
|
+
generatedTextLength: z.number().int().nonnegative().nullable().optional(),
|
|
941
|
+
/**
|
|
942
|
+
* TOP-LEVEL key names of the generated object, present ONLY for an `unrecognized_keys` failure.
|
|
943
|
+
*
|
|
944
|
+
* Still contains no generated content: these are the root keys of a schema-driven generation, which are
|
|
945
|
+
* schema shape and are read against a schema the consumer already holds. They exist because Zod reports
|
|
946
|
+
* that failure without naming the offending key on the code path this lane takes, leaving "an unknown key
|
|
947
|
+
* exists at the root" as the entire diagnosis while a single stray key discards the whole result.
|
|
948
|
+
*/
|
|
949
|
+
rootKeys: z.array(z.string()).optional(),
|
|
950
|
+
});
|
|
951
|
+
/**
|
|
952
|
+
* Read the structured-generation failure reason off an invocation's `executionContext`.
|
|
953
|
+
*
|
|
954
|
+
* THE supported way to reach it. Provided as a function rather than left to each caller
|
|
955
|
+
* because the alternative is the cast every `usage` reader already hand-rolls
|
|
956
|
+
* (`response.executionContext as { usage?: … }`) — N copies of one shape, each free to
|
|
957
|
+
* drift from the schema, none of them validated. Here the schema IS the reader.
|
|
958
|
+
*
|
|
959
|
+
* Returns `undefined` both when the generation succeeded and when the context predates
|
|
960
|
+
* this field, so a caller never has to distinguish "no failure" from "no reason
|
|
961
|
+
* recorded" — in either case there is nothing more specific to report than the absence
|
|
962
|
+
* of an object.
|
|
963
|
+
*/
|
|
964
|
+
/**
|
|
965
|
+
* Render a structured-generation failure as one operator-readable line.
|
|
966
|
+
*
|
|
967
|
+
* Lives here, beside the schema, rather than in each caller: the two labelling
|
|
968
|
+
* orchestrators alone would otherwise have hand-rolled the same rendering twice, and the
|
|
969
|
+
* value of `validationIssues` is entirely in how it is presented — a caller that quietly
|
|
970
|
+
* drops it reports "no object" with extra words. Keeping one renderer means a site that
|
|
971
|
+
* reports the reason at all reports the whole reason.
|
|
972
|
+
*
|
|
973
|
+
* Carries no generated text, only its length — see
|
|
974
|
+
* {@link LLMProvider_StructuredGenerationFailureSchema}.
|
|
975
|
+
*/
|
|
976
|
+
export function describeStructuredGenerationFailure(failure) {
|
|
977
|
+
const parts = [`${failure.kind}: ${failure.message}`];
|
|
978
|
+
if (failure.finishReason !== undefined) {
|
|
979
|
+
parts.push(`finishReason=${failure.finishReason}`);
|
|
980
|
+
}
|
|
981
|
+
if (failure.validationIssues !== undefined && failure.validationIssues.length > 0) {
|
|
982
|
+
const issues = failure.validationIssues
|
|
983
|
+
.map((issue) => `${issue.path.length > 0 ? issue.path.join(".") : "<root>"} (${issue.code})`)
|
|
984
|
+
.join(", ");
|
|
985
|
+
parts.push(`schema paths: ${issues}`);
|
|
986
|
+
}
|
|
987
|
+
if (failure.generatedTextLength !== undefined && failure.generatedTextLength !== null) {
|
|
988
|
+
parts.push(`generatedTextLength=${failure.generatedTextLength}`);
|
|
989
|
+
}
|
|
990
|
+
return parts.join(" \u00b7 ");
|
|
991
|
+
}
|
|
992
|
+
export function readStructuredGenerationFailure(executionContext) {
|
|
993
|
+
if (typeof executionContext !== "object" || executionContext === null)
|
|
994
|
+
return undefined;
|
|
995
|
+
const candidate = executionContext.structuredGenerationFailure;
|
|
996
|
+
if (candidate === undefined)
|
|
997
|
+
return undefined;
|
|
998
|
+
const parsed = LLMProvider_StructuredGenerationFailureSchema.safeParse(candidate);
|
|
999
|
+
return parsed.success ? parsed.data : undefined;
|
|
1000
|
+
}
|
|
239
1001
|
export const LLMProvider_OperationContext_BaseSchema = ExternalProvider_OperationContextSchema.extend({
|
|
240
1002
|
finishReason: z.enum(LLMProvider_FinishReason).optional(),
|
|
241
1003
|
usage: LLMProvider_UsageSchema.optional(),
|
|
@@ -243,6 +1005,12 @@ export const LLMProvider_OperationContext_BaseSchema = ExternalProvider_Operatio
|
|
|
243
1005
|
executionTime: z.number().optional(),
|
|
244
1006
|
finishedAt: z.string().optional(),
|
|
245
1007
|
transport: LLMProvider_ExecutionTransportMetadataSchema.optional(),
|
|
1008
|
+
/**
|
|
1009
|
+
* Present ONLY when a `GENERATE_STRUCTURED` call returned `{ object: undefined }`.
|
|
1010
|
+
* Its absence therefore means "not a structured-output failure", never "no reason
|
|
1011
|
+
* available". See {@link LLMProvider_StructuredGenerationFailureSchema}.
|
|
1012
|
+
*/
|
|
1013
|
+
structuredGenerationFailure: LLMProvider_StructuredGenerationFailureSchema.optional(),
|
|
246
1014
|
});
|
|
247
1015
|
// ===============================================================
|
|
248
1016
|
// LLM I/O Schemas
|
|
@@ -321,6 +1089,17 @@ export const LLMProvider_StreamTextOutputSchema = z.object({
|
|
|
321
1089
|
export const LLMProvider_GenerateStructuredInputSchema = z.object({
|
|
322
1090
|
prompt: z.string(),
|
|
323
1091
|
schema: z.custom(),
|
|
1092
|
+
/**
|
|
1093
|
+
* OPTIONAL image parts for VISION-grounded structured generation. When present
|
|
1094
|
+
* (and the target model has `MULTIMODAL_VISION` capability, e.g. `gpt-4o`), the
|
|
1095
|
+
* provider is driven with a multimodal user message (`prompt` text + these
|
|
1096
|
+
* image parts) instead of a bare text prompt, so the schema-constrained object
|
|
1097
|
+
* is produced FROM the pixels rather than from a text description of them. When
|
|
1098
|
+
* absent the call is a plain text-input structured generation (unchanged). Each
|
|
1099
|
+
* part follows {@link LLMProvider_ImageContentSchema} — a `data:image/...;base64,…`
|
|
1100
|
+
* data URI or an image URL. Generic across providers/models; no domain logic.
|
|
1101
|
+
*/
|
|
1102
|
+
images: z.array(LLMProvider_ImageContentSchema).optional(),
|
|
324
1103
|
});
|
|
325
1104
|
export const LLMProvider_GenerateStructuredOutputSchema = z.object({
|
|
326
1105
|
object: z.unknown(),
|
|
@@ -348,4 +1127,4 @@ export const LLMProvider_StreamStructuredOutputSchema = z.object({
|
|
|
348
1127
|
export const LLMProvider_StatusSchema = ExternalProvider_ExchangeProtocol_Status_BaseSchema.extend({
|
|
349
1128
|
protocolKind: z.literal(ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER),
|
|
350
1129
|
});
|
|
351
|
-
//# sourceMappingURL=llm.external-connectors-models.schemas.js.map
|
|
1130
|
+
//# sourceMappingURL=llm.external-connectors-models.schemas.js.map
|