@agent-native/core 0.237.1 → 0.237.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/actions/describe-models.js +22 -2
- package/dist/agent/actions/get-provider-models.js +7 -4
- package/dist/agent/actions/manage-provider-models.js +4 -2
- package/dist/agent/builder-gateway-models.d.ts +52 -0
- package/dist/agent/builder-gateway-models.js +180 -0
- package/dist/agent/engine/anthropic-engine.d.ts +1 -1
- package/dist/agent/engine/builder-engine.d.ts +1 -1
- package/dist/agent/engine/builder-engine.js +4 -1
- package/dist/agent/engine/builtin.js +5 -2
- package/dist/agent/model-catalog.d.ts +1 -1
- package/dist/agent/model-catalog.js +33 -9
- package/dist/agent/model-config.d.ts +10 -10
- package/dist/agent/model-config.js +29 -12
- package/dist/agent/production-agent.js +7 -0
- package/dist/agent/provider-model-selection.d.ts +6 -0
- package/dist/agent/provider-model-selection.js +28 -13
- package/dist/cli/workspace-dev.js +1 -0
- package/dist/framework-package-versions.json +13 -13
- package/dist/provider-api/actions/provider-api.d.ts +2 -2
- package/dist/scripts/agent-engines/list-agent-engines.js +26 -10
- package/dist/scripts/agent-engines/manage-agent-engine.js +1 -1
- package/dist/scripts/agent-engines/set-agent-engine.js +4 -0
- package/dist/server/agent-chat-plugin.js +7 -0
- package/dist/server/agent-engine-api-key-route.d.ts +2 -2
- package/dist/server/first-touch-route.d.ts +1 -1
- package/dist/shared/workspace-links.d.ts +64 -0
- package/dist/shared/workspace-links.js +217 -0
- package/dist/templates/builder-code-starter/actions/navigate.ts.patch +6 -7
- package/dist/templates/chat/actions/navigate.ts +4 -2
- package/dist/usage/store.js +32 -0
- package/docs/content/actions-package-servers.mdx +58 -0
- package/package.json +5 -4
- package/src/templates/builder-code-starter/actions/navigate.ts.patch +6 -7
- package/src/templates/chat/actions/navigate.ts +4 -2
|
@@ -238,13 +238,20 @@ export const BUILDER_MODEL_ALIASES = {
|
|
|
238
238
|
"claude-opus-4-7": "claude-opus-5-5",
|
|
239
239
|
"claude-opus-4-8": "claude-opus-5-5",
|
|
240
240
|
"claude-opus-5": "claude-opus-5-5",
|
|
241
|
-
"gpt-5-6-sol": "gpt-6-
|
|
241
|
+
"gpt-5-6-sol": "gpt-6-2-sol",
|
|
242
242
|
"gpt-5-6-luna": "gpt-6-luna",
|
|
243
|
-
"gpt-6-sol": "gpt-6-
|
|
244
|
-
"gpt-6
|
|
245
|
-
"
|
|
246
|
-
"
|
|
247
|
-
"
|
|
243
|
+
"gpt-6-sol": "gpt-6-2-sol",
|
|
244
|
+
"gpt-6-1-sol": "gpt-6-2-sol",
|
|
245
|
+
"gpt-6.1-sol": "gpt-6-2-sol",
|
|
246
|
+
"gpt-6.2-sol": "gpt-6-2-sol",
|
|
247
|
+
"gpt-5-6-terra": "gpt-6-1-terra",
|
|
248
|
+
"gpt-6.1-terra": "gpt-6-1-terra",
|
|
249
|
+
"gpt-5-1-codex-mini": "gpt-5-4-mini",
|
|
250
|
+
"gemini-3-1-pro": "gemini-4-argon",
|
|
251
|
+
"gemini-3-5-flash": "gemini-4-hydrogen",
|
|
252
|
+
"gemini-3-6-flash": "gemini-4-hydrogen",
|
|
253
|
+
"gemini-3-7-flash": "gemini-4-hydrogen",
|
|
254
|
+
"gemini-3-8-flash": "gemini-4-hydrogen",
|
|
248
255
|
};
|
|
249
256
|
const ANTHROPIC_DEFAULT_MODEL_ID = CLAUDE_SONNET_MODEL_ID;
|
|
250
257
|
function openRouterModelId(provider, model) {
|
|
@@ -264,14 +271,13 @@ export const AGENT_MODEL_CONFIG = {
|
|
|
264
271
|
"gpt-5-4",
|
|
265
272
|
"gpt-5-5",
|
|
266
273
|
"gpt-5-4-mini",
|
|
267
|
-
"gpt-
|
|
268
|
-
"gpt-6-1-sol",
|
|
269
|
-
"gpt-6-sol",
|
|
274
|
+
"gpt-6-2-sol",
|
|
270
275
|
"gpt-6-1-terra",
|
|
271
|
-
"gpt-5-6-terra",
|
|
272
276
|
"gpt-6-luna",
|
|
273
|
-
"gemini-
|
|
274
|
-
"gemini-
|
|
277
|
+
"gemini-4-hydrogen",
|
|
278
|
+
"gemini-4-neon",
|
|
279
|
+
"gemini-4-argon",
|
|
280
|
+
"gemini-4-carbon",
|
|
275
281
|
"gemini-3-5-flash-lite",
|
|
276
282
|
"gemini-3-1-flash-lite",
|
|
277
283
|
"grok-code-fast",
|
|
@@ -293,6 +299,7 @@ export const AGENT_MODEL_CONFIG = {
|
|
|
293
299
|
CLAUDE_SONNET_MODEL_ID,
|
|
294
300
|
"claude-opus-5-5",
|
|
295
301
|
"claude-opus-4-8",
|
|
302
|
+
"claude-fable-5-2",
|
|
296
303
|
"claude-fable-5-1",
|
|
297
304
|
"claude-fable-5",
|
|
298
305
|
],
|
|
@@ -306,6 +313,7 @@ export const AGENT_MODEL_CONFIG = {
|
|
|
306
313
|
CLAUDE_SONNET_MODEL_ID,
|
|
307
314
|
"claude-opus-5-5",
|
|
308
315
|
"claude-opus-4-8",
|
|
316
|
+
"claude-fable-5-2",
|
|
309
317
|
"claude-fable-5-1",
|
|
310
318
|
"claude-fable-5",
|
|
311
319
|
],
|
|
@@ -314,6 +322,8 @@ export const AGENT_MODEL_CONFIG = {
|
|
|
314
322
|
defaultModel: FRAMEWORK_DEFAULT_OPENAI_MODEL,
|
|
315
323
|
supportedModels: [
|
|
316
324
|
"gpt-6-luna",
|
|
325
|
+
"gpt-6.2-sol",
|
|
326
|
+
"gpt-6.2-astra",
|
|
317
327
|
"gpt-6.1-sol",
|
|
318
328
|
"gpt-6-sol",
|
|
319
329
|
"gpt-6.1-terra",
|
|
@@ -329,6 +339,8 @@ export const AGENT_MODEL_CONFIG = {
|
|
|
329
339
|
supportedModels: [
|
|
330
340
|
"openai/gpt-6-luna",
|
|
331
341
|
"openai/gpt-5.6-terra",
|
|
342
|
+
"openai/gpt-6.2-sol",
|
|
343
|
+
"openai/gpt-6.2-astra",
|
|
332
344
|
"openai/gpt-6.1-sol",
|
|
333
345
|
"openai/gpt-6-sol",
|
|
334
346
|
"openai/gpt-6.1-terra",
|
|
@@ -344,6 +356,11 @@ export const AGENT_MODEL_CONFIG = {
|
|
|
344
356
|
"anthropic/claude-opus-4.8",
|
|
345
357
|
"anthropic/claude-fable-5",
|
|
346
358
|
"anthropic/claude-fable-5.1",
|
|
359
|
+
"anthropic/claude-fable-5.2",
|
|
360
|
+
"google/gemini-4-carbon",
|
|
361
|
+
"google/gemini-4-neon",
|
|
362
|
+
"google/gemini-4-argon",
|
|
363
|
+
"google/gemini-4-hydrogen",
|
|
347
364
|
"google/gemini-3.8-flash",
|
|
348
365
|
"google/gemini-3.5-flash-lite",
|
|
349
366
|
"google/gemini-3.1-flash-lite",
|
|
@@ -72,6 +72,7 @@ import { agentErrorDetails } from "./action-error-details.js";
|
|
|
72
72
|
import { drainAgentWarnings, formatAgentWarningsForToolResult, } from "./action-warnings.js";
|
|
73
73
|
import { approvalKeyForPrivateHistory, approvalKeyWithArguments, } from "./approval-key.js";
|
|
74
74
|
import { CONTINUE_UNAVAILABLE_CODE, } from "./auto-continue.js";
|
|
75
|
+
import { ensureBuilderModelKnown } from "./builder-gateway-models.js";
|
|
75
76
|
import { clipHead } from "./clip-text.js";
|
|
76
77
|
import { connectionRequiredMessage, priorConnectionContextNote, resolvePriorConnectionNote, } from "./connection-required-note.js";
|
|
77
78
|
import { buildSystemManifestSections, readContextXraySystemSections, } from "./context-xray/manifest.js";
|
|
@@ -5171,6 +5172,9 @@ async function runAgentLoopInternal(opts) {
|
|
|
5171
5172
|
};
|
|
5172
5173
|
if (followUpRunId)
|
|
5173
5174
|
send({ type: "suggestions", suggestions: [] });
|
|
5175
|
+
if (engine.name === "builder") {
|
|
5176
|
+
await ensureBuilderModelKnown(opts.model);
|
|
5177
|
+
}
|
|
5174
5178
|
let model = normalizeModelForEngine(engine, opts.model);
|
|
5175
5179
|
let settlementCandidate = false;
|
|
5176
5180
|
let settledEmptyFinal = false;
|
|
@@ -12068,6 +12072,9 @@ export function createProductionAgentHandler(options) {
|
|
|
12068
12072
|
defaultModel: engine.defaultModel,
|
|
12069
12073
|
}));
|
|
12070
12074
|
workerStep("model_done");
|
|
12075
|
+
if (engine.name === "builder") {
|
|
12076
|
+
await ensureBuilderModelKnown(modelSelection.model);
|
|
12077
|
+
}
|
|
12071
12078
|
const model = normalizeModelForEngine(engine, modelSelection.model);
|
|
12072
12079
|
let effectiveModel = model;
|
|
12073
12080
|
let modelSelectionSource = modelSelection.source;
|
|
@@ -65,6 +65,11 @@ export declare function providerModelSelectionSettingsKey(provider: ProviderMode
|
|
|
65
65
|
export declare function providerForEngineName(engineName: string): ProviderModelSelectionProvider | null;
|
|
66
66
|
/** What an unset selection shows. */
|
|
67
67
|
export declare function recommendedProviderModels(provider: ProviderModelSelectionProvider): readonly string[];
|
|
68
|
+
/**
|
|
69
|
+
* Live-aware version of `recommendedProviderModels`: for Builder.io, refreshes
|
|
70
|
+
* the cached gateway `/discover` catalog (falling back to the bundled list).
|
|
71
|
+
*/
|
|
72
|
+
export declare function recommendedProviderModelsAsync(provider: ProviderModelSelectionProvider): Promise<readonly string[]>;
|
|
68
73
|
/**
|
|
69
74
|
* Trim, drop empties, and de-duplicate, keeping the caller's order. Builder
|
|
70
75
|
* only routes its own catalog, so ids outside it are refused rather than
|
|
@@ -72,6 +77,7 @@ export declare function recommendedProviderModels(provider: ProviderModelSelecti
|
|
|
72
77
|
*/
|
|
73
78
|
export declare function normalizeSelectedModels(provider: ProviderModelSelectionProvider, models: readonly unknown[], options?: {
|
|
74
79
|
preserveCustomModels?: boolean;
|
|
80
|
+
supportedModels?: readonly string[];
|
|
75
81
|
}): string[];
|
|
76
82
|
/** Read one scope's row. Throws when the store can't be read. */
|
|
77
83
|
export declare function readProviderModelSelection(ctx: ProviderModelSelectionContext, provider: ProviderModelSelectionProvider, scope: ProviderModelSelectionScope): Promise<ProviderModelSelectionRow>;
|
|
@@ -17,9 +17,9 @@ import { readAppSecret } from "../secrets/storage.js";
|
|
|
17
17
|
import { canUseDeployCredentialFallbackForRequest, resolveBuilderCredentialsDetailed, resolveSecretDetailed, readDeployCredentialEnv, } from "../server/credential-provider.js";
|
|
18
18
|
import { getRequestOrgId, getRequestUserEmail, } from "../server/request-context.js";
|
|
19
19
|
import { deleteOrgSetting, deleteUserSetting, getOrgSetting, getUserSetting, putOrgSetting, putUserSetting, } from "../settings/index.js";
|
|
20
|
+
import { getCachedBuilderSupportedModels, resolveBuilderSupportedModels, } from "./builder-gateway-models.js";
|
|
20
21
|
import { isCustomOpenAiBaseUrl, OLLAMA_BASE_URL_ENV_VAR, OPENAI_BASE_URL_ENV_VAR, } from "./engine/openai-compatible-endpoint.js";
|
|
21
22
|
import { PROVIDER_ENV_META } from "./engine/provider-env-vars.js";
|
|
22
|
-
import { BUILDER_MODEL_CONFIG } from "./model-config.js";
|
|
23
23
|
import { upgradeModelForProvider } from "./model-version.js";
|
|
24
24
|
export const PROVIDER_MODEL_SELECTION_KEY_PREFIX = "agent-provider-models";
|
|
25
25
|
/** Audit target type for selection changes and refused attempts. */
|
|
@@ -61,10 +61,19 @@ export function providerForEngineName(engineName) {
|
|
|
61
61
|
/** What an unset selection shows. */
|
|
62
62
|
export function recommendedProviderModels(provider) {
|
|
63
63
|
if (provider === "builder")
|
|
64
|
-
return
|
|
64
|
+
return getCachedBuilderSupportedModels();
|
|
65
65
|
return (AGENT_PROVIDER_CATALOG.find((option) => option.id === provider)
|
|
66
66
|
?.supportedModels ?? []);
|
|
67
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Live-aware version of `recommendedProviderModels`: for Builder.io, refreshes
|
|
70
|
+
* the cached gateway `/discover` catalog (falling back to the bundled list).
|
|
71
|
+
*/
|
|
72
|
+
export async function recommendedProviderModelsAsync(provider) {
|
|
73
|
+
if (provider === "builder")
|
|
74
|
+
return resolveBuilderSupportedModels();
|
|
75
|
+
return recommendedProviderModels(provider);
|
|
76
|
+
}
|
|
68
77
|
function providerCredentialEnvVar(provider) {
|
|
69
78
|
if (provider === "ollama")
|
|
70
79
|
return OLLAMA_BASE_URL_ENV_VAR;
|
|
@@ -92,14 +101,14 @@ export function normalizeSelectedModels(provider, models, options = {}) {
|
|
|
92
101
|
}
|
|
93
102
|
seen.add(id);
|
|
94
103
|
}
|
|
95
|
-
const supportedModels = recommendedProviderModels(provider);
|
|
104
|
+
const supportedModels = options.supportedModels ?? recommendedProviderModels(provider);
|
|
96
105
|
const normalized = [
|
|
97
106
|
...new Set([...seen].map((id) => options.preserveCustomModels
|
|
98
107
|
? id
|
|
99
108
|
: (upgradeModelForProvider(id, supportedModels, provider) ?? id))),
|
|
100
109
|
];
|
|
101
110
|
if (provider === "builder") {
|
|
102
|
-
const catalog = new Set(
|
|
111
|
+
const catalog = new Set(supportedModels);
|
|
103
112
|
const unknown = normalized.filter((id) => !catalog.has(id));
|
|
104
113
|
if (unknown.length > 0) {
|
|
105
114
|
throw new ProviderModelSelectionError(`Builder.io doesn't offer ${unknown.join(", ")}.`, 400);
|
|
@@ -188,7 +197,7 @@ async function preserveCustomModelsForScope(provider, scope, ctx) {
|
|
|
188
197
|
throw error;
|
|
189
198
|
}
|
|
190
199
|
}
|
|
191
|
-
function parseRow(provider, scope, stored, preserveCustomModels = false) {
|
|
200
|
+
function parseRow(provider, scope, stored, preserveCustomModels = false, supportedModels = recommendedProviderModels(provider)) {
|
|
192
201
|
const customModelMetadata = provider === "openai" && preserveCustomModels
|
|
193
202
|
? { preserveCustomModels: true }
|
|
194
203
|
: {};
|
|
@@ -196,7 +205,6 @@ function parseRow(provider, scope, stored, preserveCustomModels = false) {
|
|
|
196
205
|
return { provider, scope, models: null, ...customModelMetadata };
|
|
197
206
|
}
|
|
198
207
|
const models = stored.models.filter((model) => typeof model === "string" && !!model.trim());
|
|
199
|
-
const supportedModels = recommendedProviderModels(provider);
|
|
200
208
|
const currentModels = [
|
|
201
209
|
...new Set(models.map((model) => preserveCustomModels
|
|
202
210
|
? model
|
|
@@ -208,7 +216,7 @@ function parseRow(provider, scope, stored, preserveCustomModels = false) {
|
|
|
208
216
|
scope,
|
|
209
217
|
...customModelMetadata,
|
|
210
218
|
models: provider === "builder"
|
|
211
|
-
? currentModels.filter((model) =>
|
|
219
|
+
? currentModels.filter((model) => supportedModels.includes(model))
|
|
212
220
|
: currentModels,
|
|
213
221
|
...(typeof stored.updatedAt === "number" &&
|
|
214
222
|
Number.isFinite(stored.updatedAt)
|
|
@@ -235,11 +243,14 @@ function scopeIdFor(ctx, scope) {
|
|
|
235
243
|
export async function readProviderModelSelection(ctx, provider, scope) {
|
|
236
244
|
const scopeId = scopeIdFor(ctx, scope);
|
|
237
245
|
const key = providerModelSelectionSettingsKey(provider);
|
|
238
|
-
const stored =
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
246
|
+
const [stored, preserveCustomModels, supportedModels] = await Promise.all([
|
|
247
|
+
scope === "org"
|
|
248
|
+
? getOrgSetting(scopeId, key)
|
|
249
|
+
: getUserSetting(scopeId, key),
|
|
250
|
+
preserveCustomModelsForScope(provider, scope, ctx),
|
|
251
|
+
recommendedProviderModelsAsync(provider),
|
|
252
|
+
]);
|
|
253
|
+
return parseRow(provider, scope, stored, preserveCustomModels, supportedModels);
|
|
243
254
|
}
|
|
244
255
|
/**
|
|
245
256
|
* Whether the caller may change `scope`'s selection. Personal selections are
|
|
@@ -258,9 +269,13 @@ export async function assertMayWriteProviderModelSelection(ctx, scope) {
|
|
|
258
269
|
}
|
|
259
270
|
export async function writeProviderModelSelection(ctx, provider, scope, models) {
|
|
260
271
|
await assertMayWriteProviderModelSelection(ctx, scope);
|
|
261
|
-
const preserveCustomModels = await
|
|
272
|
+
const [preserveCustomModels, supportedModels] = await Promise.all([
|
|
273
|
+
preserveCustomModelsForScope(provider, scope, ctx),
|
|
274
|
+
recommendedProviderModelsAsync(provider),
|
|
275
|
+
]);
|
|
262
276
|
const normalized = normalizeSelectedModels(provider, models, {
|
|
263
277
|
preserveCustomModels,
|
|
278
|
+
supportedModels,
|
|
264
279
|
});
|
|
265
280
|
const scopeId = scopeIdFor(ctx, scope);
|
|
266
281
|
const key = providerModelSelectionSettingsKey(provider);
|
|
@@ -1263,6 +1263,7 @@ export async function runWorkspaceDev(options = {}) {
|
|
|
1263
1263
|
name: app.name,
|
|
1264
1264
|
description: app.description,
|
|
1265
1265
|
path: `/${app.id}`,
|
|
1266
|
+
url: `${gatewayUrl}/${app.id}`,
|
|
1266
1267
|
audience: app.audience,
|
|
1267
1268
|
publicPaths: app.publicPaths,
|
|
1268
1269
|
protectedPaths: app.protectedPaths,
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
|
-
"@agent-native/actions": "0.1.
|
|
3
|
-
"@agent-native/agentkit": "0.237.
|
|
2
|
+
"@agent-native/actions": "0.1.4",
|
|
3
|
+
"@agent-native/agentkit": "0.237.2",
|
|
4
4
|
"@agent-native/code-agents-ui": "0.1.75",
|
|
5
|
-
"@agent-native/core": "0.237.
|
|
6
|
-
"@agent-native/core-corpus": "0.237.
|
|
7
|
-
"@agent-native/creative-context": "0.8.
|
|
8
|
-
"@agent-native/design-system": "0.237.
|
|
9
|
-
"@agent-native/dispatch": "0.43.
|
|
5
|
+
"@agent-native/core": "0.237.2",
|
|
6
|
+
"@agent-native/core-corpus": "0.237.2",
|
|
7
|
+
"@agent-native/creative-context": "0.8.84",
|
|
8
|
+
"@agent-native/design-system": "0.237.2",
|
|
9
|
+
"@agent-native/dispatch": "0.43.8",
|
|
10
10
|
"@agent-native/embedding": "0.2.0",
|
|
11
11
|
"@agent-native/migrate": "0.0.7",
|
|
12
|
-
"@agent-native/otel": "0.1.
|
|
13
|
-
"@agent-native/pinpoint": "0.1.
|
|
14
|
-
"@agent-native/recap-cli": "0.5.
|
|
15
|
-
"@agent-native/scheduling": "0.4.
|
|
12
|
+
"@agent-native/otel": "0.1.51",
|
|
13
|
+
"@agent-native/pinpoint": "0.1.127",
|
|
14
|
+
"@agent-native/recap-cli": "0.5.115",
|
|
15
|
+
"@agent-native/scheduling": "0.4.8",
|
|
16
16
|
"@agent-native/shared-app-config": "0.1.2",
|
|
17
|
-
"@agent-native/skills": "0.4.
|
|
18
|
-
"@agent-native/toolkit": "0.237.
|
|
17
|
+
"@agent-native/skills": "0.4.19",
|
|
18
|
+
"@agent-native/toolkit": "0.237.2"
|
|
19
19
|
}
|
|
@@ -320,8 +320,8 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
320
320
|
notes?: string | undefined;
|
|
321
321
|
scope?: "org" | "user" | undefined;
|
|
322
322
|
}, {
|
|
323
|
-
deleted?: undefined;
|
|
324
323
|
id?: undefined;
|
|
324
|
+
deleted?: undefined;
|
|
325
325
|
providers: {
|
|
326
326
|
id: string;
|
|
327
327
|
label: string;
|
|
@@ -338,8 +338,8 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
338
338
|
label?: undefined;
|
|
339
339
|
message?: undefined;
|
|
340
340
|
} | {
|
|
341
|
-
deleted?: undefined;
|
|
342
341
|
id?: undefined;
|
|
342
|
+
deleted?: undefined;
|
|
343
343
|
count?: undefined;
|
|
344
344
|
providers?: undefined;
|
|
345
345
|
found: boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getAgentAppModelDefaultForCurrentRequest } from "../../agent/app-model-defaults.js";
|
|
2
|
+
import { readBuilderGatewayModels, } from "../../agent/builder-gateway-models.js";
|
|
2
3
|
import { CHATGPT_SUBSCRIPTION_ENGINE_NAME } from "../../agent/chatgpt-subscription-contract.js";
|
|
3
4
|
import { isDefaultAgentEngineScopeResolved, readDefaultAgentEngineSettingDetailed, resolveDefaultAgentEngineAuthority, } from "../../agent/default-agent-engine.js";
|
|
4
5
|
import { resolveDefaultAgentEngineModel } from "../../agent/engine-status.js";
|
|
@@ -56,6 +57,9 @@ export async function run(args = {}) {
|
|
|
56
57
|
? await getUserLabEnabled(requestEmail, CHATGPT_SUBSCRIPTION_LAB)
|
|
57
58
|
: false;
|
|
58
59
|
const registeredEngines = availableEngines.filter((entry) => entry.name !== CHATGPT_SUBSCRIPTION_ENGINE_NAME || chatGPTLabEnabled);
|
|
60
|
+
const builderCatalogPromise = registeredEngines.some((entry) => entry.name === "builder")
|
|
61
|
+
? readBuilderGatewayModels()
|
|
62
|
+
: Promise.resolve(undefined);
|
|
59
63
|
const chatGPTEntry = registeredEngines.find((entry) => entry.name === CHATGPT_SUBSCRIPTION_ENGINE_NAME);
|
|
60
64
|
let chatGPTCatalog;
|
|
61
65
|
let chatGPTCatalogError;
|
|
@@ -70,19 +74,29 @@ export async function run(args = {}) {
|
|
|
70
74
|
error instanceof Error ? error.message : String(error);
|
|
71
75
|
}
|
|
72
76
|
}
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
const builderCatalog = await builderCatalogPromise;
|
|
78
|
+
const withDynamicModels = (entry) => {
|
|
79
|
+
if (entry.name === CHATGPT_SUBSCRIPTION_ENGINE_NAME && chatGPTCatalog) {
|
|
80
|
+
return {
|
|
81
|
+
...entry,
|
|
82
|
+
defaultModel: chatGPTCatalog.models[0] ?? "",
|
|
83
|
+
supportedModels: chatGPTCatalog.models,
|
|
84
|
+
modelDisplayNames: chatGPTCatalog.modelDisplayNames,
|
|
85
|
+
};
|
|
79
86
|
}
|
|
80
|
-
|
|
81
|
-
|
|
87
|
+
if (entry.name === "builder" && builderCatalog?.state === "available") {
|
|
88
|
+
return {
|
|
89
|
+
...entry,
|
|
90
|
+
supportedModels: builderCatalog.modelIds,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
return entry;
|
|
94
|
+
};
|
|
95
|
+
const engines = registeredEngines.map(withDynamicModels);
|
|
82
96
|
const engineFor = (name) => {
|
|
83
97
|
const entry = engines.find((candidate) => candidate.name === name) ??
|
|
84
98
|
getAgentEngineEntry(name);
|
|
85
|
-
return entry ?
|
|
99
|
+
return entry ? withDynamicModels(entry) : undefined;
|
|
86
100
|
};
|
|
87
101
|
const providerKeys = [
|
|
88
102
|
...new Set(engines
|
|
@@ -211,7 +225,9 @@ export async function run(args = {}) {
|
|
|
211
225
|
: applyProviderModelSelection(e.supportedModels, modelSelection),
|
|
212
226
|
...(e.name === CHATGPT_SUBSCRIPTION_ENGINE_NAME && chatGPTCatalog
|
|
213
227
|
? { modelDisplayNames: chatGPTCatalog.modelDisplayNames }
|
|
214
|
-
:
|
|
228
|
+
: e.name === "builder" && builderCatalog?.state === "available"
|
|
229
|
+
? { modelDisplayNames: builderCatalog.displayNames }
|
|
230
|
+
: {}),
|
|
215
231
|
recommendedModels: e.name === CHATGPT_SUBSCRIPTION_ENGINE_NAME
|
|
216
232
|
? (chatGPTCatalog?.models ?? [])
|
|
217
233
|
: e.supportedModels,
|
|
@@ -30,7 +30,7 @@ export const tool = {
|
|
|
30
30
|
},
|
|
31
31
|
model: {
|
|
32
32
|
type: "string",
|
|
33
|
-
description: "Model ID (e.g. 'gpt-6.
|
|
33
|
+
description: "Model ID (e.g. 'gpt-6.2-sol', 'claude-sonnet-5-5', 'gemini-4-argon'). Required for \"set-app-default\"; optional for \"set\" and \"test\" where it defaults to the engine's default model.",
|
|
34
34
|
},
|
|
35
35
|
baseUrl: {
|
|
36
36
|
type: "string",
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { ActionContractError } from "../../action.js";
|
|
6
6
|
import { normalizeAgentAppModelDefaultAppId, readAgentAppModelDefaultSettings, } from "../../agent/app-model-defaults.js";
|
|
7
|
+
import { ensureBuilderModelKnown } from "../../agent/builder-gateway-models.js";
|
|
7
8
|
import { CHATGPT_SUBSCRIPTION_ENGINE_NAME } from "../../agent/chatgpt-subscription-contract.js";
|
|
8
9
|
import { recordDefaultAgentEngineRefusal, readDefaultAgentEngineSettingDetailed, resolveDefaultAgentEngineAuthority, writeDefaultAgentEngineSelection, } from "../../agent/default-agent-engine.js";
|
|
9
10
|
import { resolveAgentEngineStatus, } from "../../agent/engine-status.js";
|
|
@@ -192,6 +193,9 @@ export async function selectDefaultAgentEngine(input, meta, ctx = {
|
|
|
192
193
|
};
|
|
193
194
|
}
|
|
194
195
|
}
|
|
196
|
+
if (engineName === "builder" && requestedModel) {
|
|
197
|
+
await ensureBuilderModelKnown(requestedModel);
|
|
198
|
+
}
|
|
195
199
|
const acceptsCustomModels = await resolveEngineAcceptsCustomModels(entry);
|
|
196
200
|
const preserveCustomModels = await resolveEnginePreservesCustomModels(entry);
|
|
197
201
|
const resolvedModel = normalizeModelForEngine(entry, requestedModel, {
|
|
@@ -12,6 +12,7 @@ import { ActionDefinitionError, isActionDefinitionError } from "../action.js";
|
|
|
12
12
|
import { clientAbortReason, EXECUTION_LEASE_LOST_ABORT_REASON, } from "../agent/abort-reasons.js";
|
|
13
13
|
import { canUpdateAgentAppModelDefaultSettings, normalizeAgentAppModelDefaultAppId, readAgentAppModelDefaultSettings, resetAgentAppModelDefaultSettings, writeAgentAppModelDefaultSettings, } from "../agent/app-model-defaults.js";
|
|
14
14
|
import { approvalKeyWithArguments } from "../agent/approval-key.js";
|
|
15
|
+
import { ensureBuilderModelKnown } from "../agent/builder-gateway-models.js";
|
|
15
16
|
import { CHATGPT_SUBSCRIPTION_ENGINE_NAME } from "../agent/chatgpt-subscription-contract.js";
|
|
16
17
|
import { readDefaultAgentEngineSetting } from "../agent/default-agent-engine.js";
|
|
17
18
|
import { DEFAULT_ANTHROPIC_MODEL } from "../agent/default-model.js";
|
|
@@ -4614,6 +4615,9 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
|
|
|
4614
4615
|
})) ??
|
|
4615
4616
|
engine.defaultModel ??
|
|
4616
4617
|
resolvedModel;
|
|
4618
|
+
if (engine.name === "builder") {
|
|
4619
|
+
await ensureBuilderModelKnown(modelCandidate);
|
|
4620
|
+
}
|
|
4617
4621
|
const model = normalizeModelForEngine(engine, modelCandidate);
|
|
4618
4622
|
// Intentionally NOT setting `initialToolNames` here (unlike
|
|
4619
4623
|
// schedulerDeps/dispatcher above). `AgentTeamRunConfig.actions`
|
|
@@ -4878,6 +4882,9 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
|
|
|
4878
4882
|
};
|
|
4879
4883
|
}
|
|
4880
4884
|
}
|
|
4885
|
+
if (entry.name === "builder") {
|
|
4886
|
+
await ensureBuilderModelKnown(model);
|
|
4887
|
+
}
|
|
4881
4888
|
if (entry.name === "builder" &&
|
|
4882
4889
|
normalizeModelForEngine(entry, model) !== model) {
|
|
4883
4890
|
setResponseStatus(event, 400);
|
|
@@ -54,9 +54,9 @@ export declare function resolveAgentEngineApiKeyWriteTarget(event: H3Event, scop
|
|
|
54
54
|
error: string;
|
|
55
55
|
}>;
|
|
56
56
|
export declare function createAgentEngineApiKeyHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
57
|
-
errorCode?: undefined;
|
|
58
57
|
code?: undefined;
|
|
59
58
|
error: string;
|
|
59
|
+
errorCode?: undefined;
|
|
60
60
|
} | {
|
|
61
61
|
code?: undefined;
|
|
62
62
|
error: string;
|
|
@@ -66,9 +66,9 @@ export declare function createAgentEngineApiKeyHandler(): import("h3").EventHand
|
|
|
66
66
|
error: string;
|
|
67
67
|
code: ProviderKeyCheckCode;
|
|
68
68
|
} | {
|
|
69
|
-
errorCode?: undefined;
|
|
70
69
|
error?: undefined;
|
|
71
70
|
code?: undefined;
|
|
71
|
+
errorCode?: undefined;
|
|
72
72
|
ok: boolean;
|
|
73
73
|
key: string;
|
|
74
74
|
baseUrlKey?: string | undefined;
|
|
@@ -32,8 +32,8 @@ export declare function createFirstTouchHandler(): import("h3").EventHandlerWith
|
|
|
32
32
|
reason: "expired";
|
|
33
33
|
firstTouch?: undefined;
|
|
34
34
|
} | {
|
|
35
|
-
reason?: undefined;
|
|
36
35
|
error?: undefined;
|
|
36
|
+
reason?: undefined;
|
|
37
37
|
stored: true;
|
|
38
38
|
firstTouch: FirstTouchAttribution;
|
|
39
39
|
}>>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds every cross-app workspace link from registry facts.
|
|
3
|
+
*
|
|
4
|
+
* Registry contract: `url` is the app's address (absolute, its own mount,
|
|
5
|
+
* never a Dispatch page) or absent, and `path` is its mount on the workspace
|
|
6
|
+
* origin. Routes such as Dispatch's `/apps/<id>` are derived here, never
|
|
7
|
+
* stored. Callers pass every input explicitly; nothing here reads the
|
|
8
|
+
* environment, so a missing input is a typed failure, never a guessed URL.
|
|
9
|
+
*/
|
|
10
|
+
export declare const DISPATCH_PAGES: readonly ["overview", "apps", "vault", "workspace", "settings/integrations", "settings/api-keys"];
|
|
11
|
+
export type DispatchPage = (typeof DISPATCH_PAGES)[number];
|
|
12
|
+
export declare const WORKSPACE_APP_CHILD_PATH_PARAM = "__workspace_app_path";
|
|
13
|
+
export interface WorkspaceLinkApp {
|
|
14
|
+
id: string;
|
|
15
|
+
path?: string | null;
|
|
16
|
+
url?: string | null;
|
|
17
|
+
homePath?: string | null;
|
|
18
|
+
isDispatch?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface WorkspaceLinkContext {
|
|
21
|
+
apps: readonly WorkspaceLinkApp[];
|
|
22
|
+
/**
|
|
23
|
+
* Where apps without a `url` are mounted: an absolute origin, or
|
|
24
|
+
* `"same-origin"` for root-relative links. Absent means such apps fail
|
|
25
|
+
* with `no-address`.
|
|
26
|
+
*/
|
|
27
|
+
fallbackOrigin?: string | null;
|
|
28
|
+
}
|
|
29
|
+
export type WorkspaceLink = {
|
|
30
|
+
kind: "app-base";
|
|
31
|
+
appId: string;
|
|
32
|
+
} | {
|
|
33
|
+
kind: "app-home";
|
|
34
|
+
appId: string;
|
|
35
|
+
} | {
|
|
36
|
+
kind: "app-mcp";
|
|
37
|
+
appId: string;
|
|
38
|
+
} | {
|
|
39
|
+
kind: "app-path";
|
|
40
|
+
appId: string;
|
|
41
|
+
path: string;
|
|
42
|
+
} | {
|
|
43
|
+
kind: "dispatch-page";
|
|
44
|
+
page: DispatchPage;
|
|
45
|
+
} | {
|
|
46
|
+
kind: "dispatch-app-page";
|
|
47
|
+
appId: string;
|
|
48
|
+
childPath?: string;
|
|
49
|
+
};
|
|
50
|
+
export type WorkspaceLinkFailureReason = "unknown-app" | "no-dispatch" | "no-address" | "invalid-address" | "invalid-child-path";
|
|
51
|
+
export type WorkspaceLinkResult = {
|
|
52
|
+
ok: true;
|
|
53
|
+
url: string;
|
|
54
|
+
} | {
|
|
55
|
+
ok: false;
|
|
56
|
+
reason: WorkspaceLinkFailureReason;
|
|
57
|
+
appId?: string;
|
|
58
|
+
};
|
|
59
|
+
/** Why a registry entry's `url` breaks the address contract, or null when it holds (absent is allowed). */
|
|
60
|
+
export declare function workspaceAppAddressProblem(app: Pick<WorkspaceLinkApp, "id" | "url">): string | null;
|
|
61
|
+
/** Reads registry entries from a `{ apps }` payload or a bare array, skipping malformed rows. */
|
|
62
|
+
export declare function parseWorkspaceLinkApps(payload: unknown): WorkspaceLinkApp[];
|
|
63
|
+
export declare function findDispatchApp(apps: readonly WorkspaceLinkApp[]): WorkspaceLinkApp | undefined;
|
|
64
|
+
export declare function resolveWorkspaceLink(context: WorkspaceLinkContext, link: WorkspaceLink): WorkspaceLinkResult;
|