@runtypelabs/cli 2.10.8 → 2.11.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.
Files changed (2) hide show
  1. package/dist/index.js +373 -39
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -57,6 +57,7 @@ var require_default_models = __commonJS({
57
57
  // OpenAI models (routed via OpenAI direct, with Vercel fallback)
58
58
  { provider: "runtype", modelId: "gpt-5.4", isDefault: false },
59
59
  { provider: "runtype", modelId: "gpt-5.4-mini", isDefault: false },
60
+ { provider: "runtype", modelId: "gpt-5.4-nano", isDefault: false },
60
61
  // Anthropic models (routed via Anthropic direct, with Vertex/Bedrock fallback)
61
62
  { provider: "runtype", modelId: "claude-sonnet-4-6", isDefault: false },
62
63
  { provider: "runtype", modelId: "claude-haiku-4-5", isDefault: false },
@@ -69,7 +70,13 @@ var require_default_models = __commonJS({
69
70
  { provider: "runtype", modelId: "grok-4", isDefault: false },
70
71
  { provider: "runtype", modelId: "grok-4-fast", isDefault: false },
71
72
  // Inception models (routed via Vercel)
72
- { provider: "runtype", modelId: "mercury-2", isDefault: false }
73
+ { provider: "runtype", modelId: "mercury-2", isDefault: false },
74
+ // Moonshot models (routed via Cloudflare Workers AI)
75
+ { provider: "runtype", modelId: "kimi-k2.6", isDefault: false },
76
+ // NVIDIA models (routed via Cloudflare Workers AI)
77
+ { provider: "runtype", modelId: "nemotron-3-120b-a12b", isDefault: false },
78
+ // Google models (routed via Cloudflare Workers AI)
79
+ { provider: "runtype", modelId: "gemma-4-26b-a4b-it", isDefault: false }
73
80
  ];
74
81
  exports.DEFAULT_MODEL_ID = (_b = (_a = exports.DEFAULT_MODELS_FOR_NEW_ACCOUNTS.find((m) => m.isDefault)) === null || _a === void 0 ? void 0 : _a.modelId) !== null && _b !== void 0 ? _b : "qwen/qwen3.5-9b";
75
82
  exports.FALLBACK_MODEL_ID = "gpt-5.4-nano";
@@ -100,11 +107,6 @@ var require_default_models = __commonJS({
100
107
  },
101
108
  { id: "gpt-4.1-mini", name: "GPT-4.1 Mini", description: "Fast general purpose" },
102
109
  { id: "gpt-5-nano", name: "GPT-5 Nano", description: "Latest generation, very affordable" },
103
- {
104
- id: "mixlayer/nvidia/orchestrator-8b",
105
- name: "NVIDIA Orchestrator 8B",
106
- description: "Purpose-built for tool/intent routing"
107
- },
108
110
  {
109
111
  id: "mixlayer/qwen/qwen3.5-9b",
110
112
  name: "Qwen 3.5 9B",
@@ -240,6 +242,78 @@ var init_credential_store = __esm({
240
242
  }
241
243
  });
242
244
 
245
+ // ../shared/dist/dashboard-url.js
246
+ var require_dashboard_url = __commonJS({
247
+ "../shared/dist/dashboard-url.js"(exports) {
248
+ "use strict";
249
+ Object.defineProperty(exports, "__esModule", { value: true });
250
+ exports.ACCOUNT_QUERY_PARAM = void 0;
251
+ exports.buildDashboardUrl = buildDashboardUrl5;
252
+ exports.parseAccountParam = parseAccountParam;
253
+ exports.parseAccountId = parseAccountId;
254
+ exports.isValidAccountId = isValidAccountId;
255
+ exports.selectAccountId = selectAccountId3;
256
+ exports.ACCOUNT_QUERY_PARAM = "account";
257
+ function buildDashboardUrl5(opts) {
258
+ let base = opts.baseUrl;
259
+ while (base.endsWith("/")) {
260
+ base = base.slice(0, -1);
261
+ }
262
+ const path14 = opts.path.startsWith("/") ? opts.path : `/${opts.path}`;
263
+ const params = new URLSearchParams();
264
+ if (isValidAccountId(opts.account)) {
265
+ params.set(exports.ACCOUNT_QUERY_PARAM, opts.account);
266
+ }
267
+ if (opts.searchParams) {
268
+ for (const [key, value] of Object.entries(opts.searchParams)) {
269
+ if (value !== void 0) {
270
+ params.set(key, value);
271
+ }
272
+ }
273
+ }
274
+ const qs = params.toString();
275
+ return qs ? `${base}${path14}?${qs}` : `${base}${path14}`;
276
+ }
277
+ function parseAccountParam(input) {
278
+ let value;
279
+ if (input instanceof URLSearchParams) {
280
+ value = input.get(exports.ACCOUNT_QUERY_PARAM);
281
+ } else if (input instanceof URL) {
282
+ value = input.searchParams.get(exports.ACCOUNT_QUERY_PARAM);
283
+ } else {
284
+ try {
285
+ value = new URL(input).searchParams.get(exports.ACCOUNT_QUERY_PARAM);
286
+ } catch (_a) {
287
+ const qs = input.startsWith("?") ? input.slice(1) : input;
288
+ value = new URLSearchParams(qs).get(exports.ACCOUNT_QUERY_PARAM);
289
+ }
290
+ }
291
+ return parseAccountId(value);
292
+ }
293
+ function parseAccountId(value) {
294
+ if (!value)
295
+ return null;
296
+ if (value.startsWith("user_") && value.length > "user_".length) {
297
+ return { kind: "user", id: value };
298
+ }
299
+ if (value.startsWith("org_") && value.length > "org_".length) {
300
+ return { kind: "org", id: value };
301
+ }
302
+ return null;
303
+ }
304
+ function isValidAccountId(value) {
305
+ return parseAccountId(value) !== null;
306
+ }
307
+ function selectAccountId3(params) {
308
+ if (isValidAccountId(params.organizationId))
309
+ return params.organizationId;
310
+ if (isValidAccountId(params.userId))
311
+ return params.userId;
312
+ return void 0;
313
+ }
314
+ }
315
+ });
316
+
243
317
  // ../shared/dist/integration-providers.js
244
318
  var require_integration_providers = __commonJS({
245
319
  "../shared/dist/integration-providers.js"(exports) {
@@ -10987,6 +11061,7 @@ var require_builtin_tools_registry = __commonJS({
10987
11061
  exports.getBuiltInToolsByCategory = getBuiltInToolsByCategory;
10988
11062
  exports.isToolCompatibleWithModel = isToolCompatibleWithModel2;
10989
11063
  exports.getCompatibleBuiltInTools = getCompatibleBuiltInTools;
11064
+ exports.validateConfigAgainstSchema = validateConfigAgainstSchema;
10990
11065
  exports.validateToolConfig = validateToolConfig;
10991
11066
  var generated_orthogonal_tools_1 = require_generated_orthogonal_tools();
10992
11067
  exports.BuiltInToolProvider = {
@@ -11187,11 +11262,14 @@ var require_builtin_tools_registry = __commonJS({
11187
11262
  executionHint: "provider"
11188
11263
  // Anthropic executes this natively
11189
11264
  },
11190
- // xAI Live Search (native provider feature, enabled via providerOptions)
11265
+ // xAI Live Search (DEPRECATED retired by xAI on 2026-01-12; requests return 410 Gone).
11266
+ // Kept in the registry so existing flows don't throw on lookup; the xAI executor
11267
+ // auto-migrates its config into the Agent Tools API (xai_web_search / xai_x_search)
11268
+ // on the Responses endpoint. New flows should select xai_web_search or xai_x_search.
11191
11269
  {
11192
11270
  id: "xai_live_search",
11193
- name: "xAI Live Search",
11194
- description: "Search the live web, X posts, news, and RSS feeds using xAI's Live Search. Grok can cite sources with URLs.",
11271
+ name: "xAI Live Search (deprecated)",
11272
+ description: "Deprecated. xAI retired Live Search on 2026-01-12; the Chat Completions search_parameters endpoint now returns 410 Gone. Use xAI Web Search or xAI X Search (Agent Tools API) instead. Existing configs are auto-migrated at runtime.",
11195
11273
  category: exports.BuiltInToolCategory.WEB_SEARCH,
11196
11274
  providers: [exports.BuiltInToolProvider.XAI],
11197
11275
  parametersSchema: {
@@ -11286,11 +11364,13 @@ var require_builtin_tools_registry = __commonJS({
11286
11364
  models: ["grok-4", "grok-4-fast", "grok-4.1-fast"]
11287
11365
  }
11288
11366
  ],
11289
- documentationUrl: "https://docs.x.ai/docs/guides/live-search",
11367
+ documentationUrl: "https://docs.x.ai/docs/guides/tools/search-tools",
11290
11368
  requiresApiKey: true,
11291
11369
  executionHint: "provider",
11292
- // xAI executes this natively via providerOptions.xai.searchParameters
11293
- platformKeySupport: true
11370
+ // Executor auto-migrates to Responses API web_search / x_search
11371
+ platformKeySupport: true,
11372
+ deprecated: true,
11373
+ hidden: true
11294
11374
  },
11295
11375
  // xAI X Search (native Responses API server-side tool)
11296
11376
  // Unlike xai_live_search (chat API preprocessing), this is an agentic tool
@@ -11821,6 +11901,77 @@ var require_builtin_tools_registry = __commonJS({
11821
11901
  platformKeySupport: true,
11822
11902
  requiresApiKey: false
11823
11903
  },
11904
+ // Generate PDF — render HTML or Markdown to a PDF document
11905
+ {
11906
+ id: "generate_pdf",
11907
+ name: "Generate PDF",
11908
+ description: "Render HTML or Markdown to a PDF file and store it on Runtype's CDN. Returns a permanent public URL or a time-limited signed URL (default 1 hour) depending on `visibility`. Exactly one of `html` or `markdown` must be provided \u2014 markdown is rendered with GFM in an A4 print shell with sensible typography; html is passed through untouched so callers can control their own fonts and CSS. Optional `pdfOptions` (format, landscape, margin, printBackground, displayHeaderFooter, headerTemplate, footerTemplate, scale, pageRanges, preferCSSPageSize, omitBackground) are forwarded to the renderer. Source is capped at 2 MB; output is capped at 25 MB. Powered by Cloudflare Browser Rendering.",
11909
+ category: exports.BuiltInToolCategory.FILE_OPERATIONS,
11910
+ providers: [exports.BuiltInToolProvider.MULTI],
11911
+ parametersSchema: {
11912
+ type: "object",
11913
+ properties: {
11914
+ html: {
11915
+ type: "string",
11916
+ description: "Complete HTML document (or fragment) to render. Callers supply their own styling. Provide this OR `markdown`, not both."
11917
+ },
11918
+ markdown: {
11919
+ type: "string",
11920
+ description: "Markdown source. Rendered with GFM and wrapped in an A4 print shell. Inline HTML inside the markdown is escaped. Provide this OR `html`, not both."
11921
+ },
11922
+ filename: {
11923
+ type: "string",
11924
+ description: "Optional filename for the stored PDF (defaults to `document-<timestamp>.pdf`)."
11925
+ },
11926
+ visibility: {
11927
+ type: "string",
11928
+ enum: ["public", "private"],
11929
+ description: 'Access control. "public" returns a permanent URL; "private" returns a signed URL that expires (default 1 hour). Default: "public".'
11930
+ },
11931
+ pdfOptions: {
11932
+ type: "object",
11933
+ description: "Optional puppeteer `page.pdf()` options (whitelisted).",
11934
+ properties: {
11935
+ format: {
11936
+ type: "string",
11937
+ description: 'Paper format (e.g. "a4", "letter", "legal"). Overrides width/height.'
11938
+ },
11939
+ landscape: { type: "boolean" },
11940
+ printBackground: { type: "boolean" },
11941
+ displayHeaderFooter: { type: "boolean" },
11942
+ headerTemplate: {
11943
+ type: "string",
11944
+ description: "HTML template for the print header. Supports `date`, `title`, `url`, `pageNumber`, `totalPages` classes."
11945
+ },
11946
+ footerTemplate: { type: "string" },
11947
+ scale: {
11948
+ type: "number",
11949
+ description: "Rendering scale, between 0.1 and 2. Default 1."
11950
+ },
11951
+ preferCSSPageSize: { type: "boolean" },
11952
+ pageRanges: {
11953
+ type: "string",
11954
+ description: 'Page ranges to include, e.g. "1-5, 8, 11-13". Default: all pages.'
11955
+ },
11956
+ omitBackground: { type: "boolean" },
11957
+ margin: {
11958
+ type: "object",
11959
+ properties: {
11960
+ top: { type: "string" },
11961
+ right: { type: "string" },
11962
+ bottom: { type: "string" },
11963
+ left: { type: "string" }
11964
+ }
11965
+ }
11966
+ }
11967
+ }
11968
+ },
11969
+ required: []
11970
+ },
11971
+ executionHint: "platform",
11972
+ platformKeySupport: true,
11973
+ requiresApiKey: false
11974
+ },
11824
11975
  // Record Management Tools — CRUD operations on Runtype records
11825
11976
  {
11826
11977
  id: "runtype_record_upsert",
@@ -12698,13 +12849,8 @@ var require_builtin_tools_registry = __commonJS({
12698
12849
  function getCompatibleBuiltInTools(modelId, provider) {
12699
12850
  return exports.BUILTIN_TOOLS_REGISTRY.filter((tool) => !tool.hidden && isToolCompatibleWithModel2(tool.id, modelId, provider));
12700
12851
  }
12701
- function validateToolConfig(toolId, config2) {
12702
- const tool = getBuiltInToolById2(toolId);
12703
- if (!tool) {
12704
- return { valid: false, errors: ["Tool not found"] };
12705
- }
12852
+ function validateConfigAgainstSchema(schema, config2) {
12706
12853
  const errors = [];
12707
- const schema = tool.parametersSchema;
12708
12854
  if (schema.required) {
12709
12855
  for (const field of schema.required) {
12710
12856
  if (!(field in config2)) {
@@ -12720,19 +12866,23 @@ var require_builtin_tools_registry = __commonJS({
12720
12866
  continue;
12721
12867
  }
12722
12868
  const actualType = Array.isArray(value) ? "array" : typeof value;
12723
- if (propSchema.type && actualType !== propSchema.type) {
12869
+ const matchesSchemaType = !propSchema.type || actualType === propSchema.type || propSchema.type === "integer" && actualType === "number";
12870
+ if (!matchesSchemaType) {
12724
12871
  errors.push(`Field ${key} should be ${propSchema.type}, got ${actualType}`);
12725
12872
  }
12726
12873
  if (propSchema.enum && !propSchema.enum.includes(value)) {
12727
12874
  errors.push(`Field ${key} must be one of: ${propSchema.enum.join(", ")}`);
12728
12875
  }
12729
- if (propSchema.type === "number" && typeof value === "number") {
12876
+ if ((propSchema.type === "number" || propSchema.type === "integer") && typeof value === "number") {
12730
12877
  if (propSchema.minimum !== void 0 && value < propSchema.minimum) {
12731
12878
  errors.push(`Field ${key} must be >= ${propSchema.minimum}`);
12732
12879
  }
12733
12880
  if (propSchema.maximum !== void 0 && value > propSchema.maximum) {
12734
12881
  errors.push(`Field ${key} must be <= ${propSchema.maximum}`);
12735
12882
  }
12883
+ if (propSchema.type === "integer" && !Number.isInteger(value)) {
12884
+ errors.push(`Field ${key} should be integer, got non-integer number`);
12885
+ }
12736
12886
  }
12737
12887
  if (propSchema.type === "string" && typeof value === "string") {
12738
12888
  if (propSchema.minLength !== void 0 && value.length < propSchema.minLength) {
@@ -12749,6 +12899,13 @@ var require_builtin_tools_registry = __commonJS({
12749
12899
  errors: errors.length > 0 ? errors : void 0
12750
12900
  };
12751
12901
  }
12902
+ function validateToolConfig(toolId, config2) {
12903
+ const tool = getBuiltInToolById2(toolId);
12904
+ if (!tool) {
12905
+ return { valid: false, errors: ["Tool not found"] };
12906
+ }
12907
+ return validateConfigAgainstSchema(tool.parametersSchema, config2);
12908
+ }
12752
12909
  }
12753
12910
  });
12754
12911
 
@@ -12908,6 +13065,7 @@ var require_generated_model_routing = __commonJS({
12908
13065
  "kimi-k2-thinking-turbo": ["vercel"],
12909
13066
  "kimi-k2-turbo": ["vercel"],
12910
13067
  "kimi-k2.5": ["vercel"],
13068
+ "kimi-k2.6": ["vercel"],
12911
13069
  "llama-3-1-70b": ["vercel"],
12912
13070
  "llama-3-1-8b": ["vercel"],
12913
13071
  "llama-3-2-11b": ["vercel"],
@@ -12971,6 +13129,7 @@ var require_generated_model_routing = __commonJS({
12971
13129
  "qwen-3-235b": ["vercel"],
12972
13130
  "qwen-3-30b": ["vercel"],
12973
13131
  "qwen-3-32b": ["vercel"],
13132
+ "qwen-3.6-max-preview": ["vercel"],
12974
13133
  "qwen3-235b-a22b-thinking": ["vercel"],
12975
13134
  "qwen3-coder": ["vercel"],
12976
13135
  "qwen3-coder-30b-a3b": ["vercel"],
@@ -12990,6 +13149,7 @@ var require_generated_model_routing = __commonJS({
12990
13149
  "qwen3.5-27b": ["mixlayer"],
12991
13150
  "qwen3.5-35b-a3b": ["mixlayer"],
12992
13151
  "qwen3.5-397b-a17b": ["mixlayer"],
13152
+ "qwen3.5-4b-free": ["mixlayer"],
12993
13153
  "qwen3.5-9b": ["mixlayer"],
12994
13154
  "qwen3.5-flash": ["vercel"],
12995
13155
  "qwen3.5-plus": ["vercel"],
@@ -13152,6 +13312,7 @@ var require_generated_model_routing = __commonJS({
13152
13312
  "kimi-k2": ["vercel"],
13153
13313
  "kimi-k2-0905": ["vercel"],
13154
13314
  "kimi-k2-5": ["vercel"],
13315
+ "kimi-k2-6": ["vercel"],
13155
13316
  "kimi-k2-thinking-turbo": ["vercel"],
13156
13317
  "kimi-k2-turbo": ["vercel"],
13157
13318
  "llama-3-2-11b": ["vercel"],
@@ -13209,12 +13370,14 @@ var require_generated_model_routing = __commonJS({
13209
13370
  "qwen-3-14b": ["vercel"],
13210
13371
  "qwen-3-235b": ["vercel"],
13211
13372
  "qwen-3-30b": ["vercel"],
13373
+ "qwen-3-6-max": ["vercel"],
13212
13374
  "qwen3-235b-a22b": ["vercel"],
13213
13375
  "qwen3-32b": ["vercel"],
13214
13376
  "qwen3-5-122b-a10b": ["mixlayer"],
13215
13377
  "qwen3-5-27b": ["mixlayer"],
13216
13378
  "qwen3-5-35b-a3b": ["mixlayer"],
13217
13379
  "qwen3-5-397b-a17b": ["mixlayer"],
13380
+ "qwen3-5-4b-free": ["mixlayer"],
13218
13381
  "qwen3-5-9b": ["mixlayer"],
13219
13382
  "qwen3-5-flash": ["vercel"],
13220
13383
  "qwen3-5-plus": ["vercel"],
@@ -13907,6 +14070,9 @@ var require_generated_model_routing = __commonJS({
13907
14070
  "kimi-k2-5": {
13908
14071
  "vercel": "moonshotai/kimi-k2.5"
13909
14072
  },
14073
+ "kimi-k2-6": {
14074
+ "vercel": "moonshotai/kimi-k2.6"
14075
+ },
13910
14076
  "kimi-k2-thinking": {
13911
14077
  "vercel": "moonshotai/kimi-k2-thinking"
13912
14078
  },
@@ -13919,6 +14085,9 @@ var require_generated_model_routing = __commonJS({
13919
14085
  "kimi-k2.5": {
13920
14086
  "vercel": "moonshotai/kimi-k2.5"
13921
14087
  },
14088
+ "kimi-k2.6": {
14089
+ "vercel": "moonshotai/kimi-k2.6"
14090
+ },
13922
14091
  "llama-3-1-70b": {
13923
14092
  "vercel": "meta/llama-3-1-70b"
13924
14093
  },
@@ -14156,6 +14325,12 @@ var require_generated_model_routing = __commonJS({
14156
14325
  "qwen-3-32b": {
14157
14326
  "vercel": "alibaba/qwen-3-32b"
14158
14327
  },
14328
+ "qwen-3-6-max": {
14329
+ "vercel": "alibaba/qwen-3.6-max-preview"
14330
+ },
14331
+ "qwen-3.6-max-preview": {
14332
+ "vercel": "alibaba/qwen-3.6-max-preview"
14333
+ },
14159
14334
  "qwen3-235b-a22b": {
14160
14335
  "vercel": "alibaba/qwen3-235b-a22b-thinking"
14161
14336
  },
@@ -14177,6 +14352,9 @@ var require_generated_model_routing = __commonJS({
14177
14352
  "qwen3-5-397b-a17b": {
14178
14353
  "mixlayer": "qwen/qwen3.5-397b-a17b"
14179
14354
  },
14355
+ "qwen3-5-4b-free": {
14356
+ "mixlayer": "qwen/qwen3.5-4b-free"
14357
+ },
14180
14358
  "qwen3-5-9b": {
14181
14359
  "mixlayer": "qwen/qwen3.5-9b"
14182
14360
  },
@@ -14252,6 +14430,9 @@ var require_generated_model_routing = __commonJS({
14252
14430
  "qwen3.5-397b-a17b": {
14253
14431
  "mixlayer": "qwen/qwen3.5-397b-a17b"
14254
14432
  },
14433
+ "qwen3.5-4b-free": {
14434
+ "mixlayer": "qwen/qwen3.5-4b-free"
14435
+ },
14255
14436
  "qwen3.5-9b": {
14256
14437
  "mixlayer": "qwen/qwen3.5-9b"
14257
14438
  },
@@ -14410,6 +14591,7 @@ var require_generated_model_routing = __commonJS({
14410
14591
  "qwen-3-235b-a22b": { providers: [{ provider: "vercel", weight: 100 }] },
14411
14592
  "qwen-3-30b": { providers: [{ provider: "vercel", weight: 100 }] },
14412
14593
  "qwen-3-32b": { providers: [{ provider: "vercel", weight: 100 }] },
14594
+ "qwen-3-6-max": { providers: [{ provider: "vercel", weight: 100 }] },
14413
14595
  "qwen3-235b-a22b": { providers: [{ provider: "vercel", weight: 100 }] },
14414
14596
  "qwen3-32b": { providers: [{ provider: "vercel", weight: 100 }] },
14415
14597
  "qwen3-5-flash": { providers: [{ provider: "vercel", weight: 100 }] },
@@ -14448,7 +14630,7 @@ var require_provider_routing = __commonJS({
14448
14630
  "../shared/dist/provider-routing.js"(exports) {
14449
14631
  "use strict";
14450
14632
  Object.defineProperty(exports, "__esModule", { value: true });
14451
- exports.GATEWAY_PROVIDERS = exports.INFERENCE_PROVIDERS = exports.DIRECT_PROVIDERS = exports.ROUTED_MODEL_DISPLAY_NAMES = exports.BASE_MODEL_PROVIDER_MAP = exports.PROVIDER_ROUTING_CONFIG = exports.PROVIDER_API_KEY_MAP = exports.PLATFORM_KEY_PROVIDERS = void 0;
14633
+ exports.GATEWAY_PROVIDERS = exports.INFERENCE_PROVIDERS = exports.DIRECT_PROVIDERS = exports.ROUTED_MODEL_DISPLAY_NAMES = exports.BASE_MODEL_PROVIDER_MAP = exports.PROVIDER_ROUTING_CONFIG = exports.CLOUDFLARE_GATEWAY_ALLOWLIST = exports.PROVIDER_API_KEY_MAP = exports.PLATFORM_KEY_PROVIDERS = void 0;
14452
14634
  exports.isRoutedModel = isRoutedModel;
14453
14635
  exports.isDirectAccess = isDirectAccess;
14454
14636
  exports.isGatewayAccess = isGatewayAccess;
@@ -14470,8 +14652,10 @@ var require_provider_routing = __commonJS({
14470
14652
  exports.inferModelCreator = inferModelCreator2;
14471
14653
  exports.getDefaultProvider = getDefaultProvider;
14472
14654
  exports.isVercelSupported = isVercelSupported;
14655
+ exports.isCloudflareSupported = isCloudflareSupported;
14473
14656
  exports.generateVercelModelId = generateVercelModelId;
14474
14657
  exports.getDefaultRoutingConfig = getDefaultRoutingConfig;
14658
+ exports.generateCloudflareModelId = generateCloudflareModelId;
14475
14659
  exports.getDefaultProviderMapping = getDefaultProviderMapping;
14476
14660
  exports.getRoutingConfigWithDefaults = getRoutingConfigWithDefaults;
14477
14661
  exports.getProviderModelIdWithDefaults = getProviderModelIdWithDefaults;
@@ -14482,7 +14666,8 @@ var require_provider_routing = __commonJS({
14482
14666
  "anthropic",
14483
14667
  "google",
14484
14668
  "xai",
14485
- "vercel"
14669
+ "vercel",
14670
+ "cloudflare"
14486
14671
  ]);
14487
14672
  exports.PROVIDER_API_KEY_MAP = {
14488
14673
  "openai": "openaiKey",
@@ -14491,6 +14676,7 @@ var require_provider_routing = __commonJS({
14491
14676
  "xai": "xaiKey",
14492
14677
  "mixlayer": "modelsocketKey",
14493
14678
  "vercel": "vercelGatewayKey",
14679
+ "cloudflare": "cloudflareGatewayToken",
14494
14680
  "togetherai": "togetheraiKey",
14495
14681
  "bedrock": "bedrockAccessKey",
14496
14682
  // Also needs bedrockSecretKey
@@ -14507,6 +14693,9 @@ var require_provider_routing = __commonJS({
14507
14693
  "mock": null
14508
14694
  // Dev-only, no API key needed
14509
14695
  };
14696
+ exports.CLOUDFLARE_GATEWAY_ALLOWLIST = /* @__PURE__ */ new Set([
14697
+ "gpt-5.4-nano"
14698
+ ]);
14510
14699
  exports.PROVIDER_ROUTING_CONFIG = {
14511
14700
  // Claude 4.5 Sonnet - Route through Vercel AI Gateway
14512
14701
  "claude-sonnet-4-5": {
@@ -14556,6 +14745,20 @@ var require_provider_routing = __commonJS({
14556
14745
  ],
14557
14746
  fallback: ["openai"]
14558
14747
  },
14748
+ // GPT-5.3 Codex - completion model, route through Vercel + OpenAI fallback
14749
+ "gpt-5.3-codex": {
14750
+ providers: [
14751
+ { provider: "vercel", weight: 100 }
14752
+ ],
14753
+ fallback: ["openai"]
14754
+ },
14755
+ // GPT-5.4 Nano - CF Gateway primary for testing, Vercel + OpenAI as fallback
14756
+ "gpt-5.4-nano": {
14757
+ providers: [
14758
+ { provider: "cloudflare", weight: 100 }
14759
+ ],
14760
+ fallback: ["vercel", "openai"]
14761
+ },
14559
14762
  // Gemini 2.5 Pro - Route through Vercel AI Gateway
14560
14763
  "gemini-2.5-pro": {
14561
14764
  providers: [
@@ -14653,6 +14856,34 @@ var require_provider_routing = __commonJS({
14653
14856
  { provider: "vercel", weight: 100 }
14654
14857
  ],
14655
14858
  fallback: ["openai"]
14859
+ },
14860
+ // Kimi K2.5 - Route through Cloudflare Workers AI
14861
+ "kimi-k2.5": {
14862
+ providers: [
14863
+ { provider: "workers-ai", weight: 100 }
14864
+ ],
14865
+ fallback: ["vercel"]
14866
+ },
14867
+ // Kimi K2.6 - Route through Vercel AI Gateway (not available on Workers AI)
14868
+ // Kimi K2.6 - Route through Cloudflare Workers AI
14869
+ "kimi-k2.6": {
14870
+ providers: [
14871
+ { provider: "workers-ai", weight: 100 }
14872
+ ],
14873
+ fallback: ["vercel"]
14874
+ },
14875
+ // NVIDIA Nemotron-3 120B - Route through Cloudflare Workers AI (no Vercel equivalent)
14876
+ "nemotron-3-120b-a12b": {
14877
+ providers: [
14878
+ { provider: "workers-ai", weight: 100 }
14879
+ ]
14880
+ },
14881
+ // Google Gemma 4 26B - Route through Cloudflare Workers AI
14882
+ "gemma-4-26b-a4b-it": {
14883
+ providers: [
14884
+ { provider: "workers-ai", weight: 100 }
14885
+ ],
14886
+ fallback: ["vercel"]
14656
14887
  }
14657
14888
  };
14658
14889
  var MANUAL_PROVIDER_MAP_OVERRIDES = {
@@ -14677,6 +14908,18 @@ var require_provider_routing = __commonJS({
14677
14908
  },
14678
14909
  "deepseek-v3": {
14679
14910
  "togetherai": "togetherai/deepseek-ai/DeepSeek-V3"
14911
+ },
14912
+ "kimi-k2.5": {
14913
+ "workers-ai": "@cf/moonshotai/kimi-k2.5"
14914
+ },
14915
+ "kimi-k2.6": {
14916
+ "workers-ai": "@cf/moonshotai/kimi-k2.6"
14917
+ },
14918
+ "nemotron-3-120b-a12b": {
14919
+ "workers-ai": "@cf/nvidia/nemotron-3-120b-a12b"
14920
+ },
14921
+ "gemma-4-26b-a4b-it": {
14922
+ "workers-ai": "@cf/google/gemma-4-26b-a4b-it"
14680
14923
  }
14681
14924
  };
14682
14925
  exports.BASE_MODEL_PROVIDER_MAP = (() => {
@@ -14802,10 +15045,12 @@ var require_provider_routing = __commonJS({
14802
15045
  "vertex-anthropic",
14803
15046
  "tinfoil",
14804
15047
  "generic-openai",
14805
- "mock"
15048
+ "mock",
15049
+ "workers-ai"
14806
15050
  ]);
14807
15051
  exports.GATEWAY_PROVIDERS = /* @__PURE__ */ new Set([
14808
15052
  "vercel",
15053
+ "cloudflare",
14809
15054
  "openrouter",
14810
15055
  "azure"
14811
15056
  ]);
@@ -15145,6 +15390,9 @@ var require_provider_routing = __commonJS({
15145
15390
  const creator = inferModelCreator2(modelId);
15146
15391
  return !NON_VERCEL_CREATORS.has(creator);
15147
15392
  }
15393
+ function isCloudflareSupported(modelId) {
15394
+ return exports.CLOUDFLARE_GATEWAY_ALLOWLIST.has(modelId);
15395
+ }
15148
15396
  var CREATOR_TO_VERCEL_PROVIDER = {
15149
15397
  "openai": "openai",
15150
15398
  "anthropic": "anthropic",
@@ -15177,18 +15425,33 @@ var require_provider_routing = __commonJS({
15177
15425
  const config2 = {
15178
15426
  providers: [{ provider: "vercel", weight: 100 }]
15179
15427
  };
15428
+ const fallbacks = [];
15429
+ if (isCloudflareSupported(baseModel)) {
15430
+ fallbacks.push("cloudflare");
15431
+ }
15180
15432
  const fallbackProvider = getFallbackProvider(creator);
15181
15433
  if (fallbackProvider) {
15182
- config2.fallback = [fallbackProvider];
15434
+ fallbacks.push(fallbackProvider);
15435
+ }
15436
+ if (fallbacks.length > 0) {
15437
+ config2.fallback = fallbacks;
15183
15438
  }
15184
15439
  return config2;
15185
15440
  }
15441
+ function generateCloudflareModelId(modelId) {
15442
+ const creator = inferModelCreator2(modelId);
15443
+ const cfProvider = CREATOR_TO_VERCEL_PROVIDER[creator] || creator;
15444
+ return `${cfProvider}/${modelId}`;
15445
+ }
15186
15446
  function getDefaultProviderMapping(baseModel) {
15187
15447
  const creator = inferModelCreator2(baseModel);
15188
15448
  const mapping = {};
15189
15449
  if (isVercelSupported(baseModel)) {
15190
15450
  mapping["vercel"] = generateVercelModelId(baseModel);
15191
15451
  }
15452
+ if (isCloudflareSupported(baseModel)) {
15453
+ mapping["cloudflare"] = generateCloudflareModelId(baseModel);
15454
+ }
15192
15455
  const fallbackProvider = getFallbackProvider(creator);
15193
15456
  if (fallbackProvider) {
15194
15457
  mapping[fallbackProvider] = baseModel;
@@ -19545,7 +19808,8 @@ var require_fpo_schema = __commonJS({
19545
19808
  var toolAuthSchema = zod_1.z.object({
19546
19809
  type: zod_1.z.enum(["oauth", "api_key", "none", "user_provided"]),
19547
19810
  setupRequired: zod_1.z.boolean(),
19548
- secrets: zod_1.z.array(secretSchema),
19811
+ // Each secret drives a DB write via materializeSecretBindings at assembly time.
19812
+ secrets: zod_1.z.array(secretSchema).max(20),
19549
19813
  setupInstructions: setupInstructionsSchema
19550
19814
  });
19551
19815
  exports.toolSchema = zod_1.z.object({
@@ -19615,9 +19879,9 @@ var require_fpo_schema = __commonJS({
19615
19879
  icon: zod_1.z.string().optional(),
19616
19880
  metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional()
19617
19881
  }),
19618
- capabilities: zod_1.z.array(exports.capabilitySchema),
19619
- tools: zod_1.z.array(exports.toolSchema),
19620
- surfaces: zod_1.z.array(exports.surfaceSchema),
19882
+ capabilities: zod_1.z.array(exports.capabilitySchema).max(50),
19883
+ tools: zod_1.z.array(exports.toolSchema).max(100),
19884
+ surfaces: zod_1.z.array(exports.surfaceSchema).max(50),
19621
19885
  _meta: metaSchema
19622
19886
  }).superRefine((fpo, ctx) => {
19623
19887
  const capIds = /* @__PURE__ */ new Set();
@@ -22883,12 +23147,29 @@ configCommand.command("path").description("Show configuration file path").action
22883
23147
  });
22884
23148
 
22885
23149
  // src/commands/products.ts
23150
+ var import_dashboard_url2 = __toESM(require_dashboard_url(), 1);
22886
23151
  import { Command as Command7 } from "commander";
22887
23152
  import chalk9 from "chalk";
22888
23153
  import React6 from "react";
22889
23154
  import { render as render6 } from "ink";
22890
23155
  import { useState as useState7, useEffect as useEffect8 } from "react";
22891
23156
  import open2 from "open";
23157
+
23158
+ // src/lib/account-context.ts
23159
+ var import_dashboard_url = __toESM(require_dashboard_url(), 1);
23160
+ init_credential_store();
23161
+ async function getCurrentAccountId() {
23162
+ try {
23163
+ const store = new CredentialStore();
23164
+ const creds = await store.getCredentials();
23165
+ if (!creds) return void 0;
23166
+ return (0, import_dashboard_url.selectAccountId)({ userId: creds.userId, organizationId: creds.orgId });
23167
+ } catch {
23168
+ return void 0;
23169
+ }
23170
+ }
23171
+
23172
+ // src/commands/products.ts
22892
23173
  function displayAgentCard(agentCard) {
22893
23174
  console.log(chalk9.cyan("\nAgent Details:"));
22894
23175
  console.log(` Name: ${agentCard.name}`);
@@ -22929,8 +23210,13 @@ async function createProduct(apiKey, templateId, agentCard, sourceUrl, productNa
22929
23210
  }
22930
23211
  return response.json();
22931
23212
  }
22932
- function displayCreationSuccess(result, agentCard, dashboardBaseUrl, jsonOutput) {
22933
- const productUrl = `${dashboardBaseUrl}/products/${result.product.id}?launch=true`;
23213
+ function displayCreationSuccess(result, agentCard, dashboardBaseUrl, jsonOutput, account) {
23214
+ const productUrl = (0, import_dashboard_url2.buildDashboardUrl)({
23215
+ baseUrl: dashboardBaseUrl,
23216
+ path: `/products/${result.product.id}`,
23217
+ account,
23218
+ searchParams: { launch: "true" }
23219
+ });
22934
23220
  if (jsonOutput) {
22935
23221
  console.log(
22936
23222
  JSON.stringify(
@@ -23052,7 +23338,14 @@ productsCommand.command("init").description("Initialize a product from an extern
23052
23338
  }
23053
23339
  process.exit(1);
23054
23340
  }
23055
- displayCreationSuccess(createResult, result.agentCard, getDashboardUrl(), isJsonMode);
23341
+ const account = await getCurrentAccountId();
23342
+ displayCreationSuccess(
23343
+ createResult,
23344
+ result.agentCard,
23345
+ getDashboardUrl(),
23346
+ isJsonMode,
23347
+ account
23348
+ );
23056
23349
  } catch (error) {
23057
23350
  const message = error instanceof Error ? error.message : "Unknown error";
23058
23351
  console.error(chalk9.red(`Failed: ${message}`));
@@ -23118,6 +23411,7 @@ productsCommand.command("init").description("Initialize a product from an extern
23118
23411
  return;
23119
23412
  }
23120
23413
  const dashboardUrl = getDashboardUrl();
23414
+ const account = await getCurrentAccountId();
23121
23415
  setResultNode(
23122
23416
  React6.createElement(EntityCard, {
23123
23417
  fields: [
@@ -23125,7 +23419,11 @@ productsCommand.command("init").description("Initialize a product from an extern
23125
23419
  { label: "Name", value: createResult.product.name },
23126
23420
  {
23127
23421
  label: "Dashboard",
23128
- value: `${dashboardUrl}/products/${createResult.product.id}`
23422
+ value: (0, import_dashboard_url2.buildDashboardUrl)({
23423
+ baseUrl: dashboardUrl,
23424
+ path: `/products/${createResult.product.id}`,
23425
+ account
23426
+ })
23129
23427
  }
23130
23428
  ]
23131
23429
  })
@@ -23189,6 +23487,7 @@ import React7 from "react";
23189
23487
  import { render as render7 } from "ink";
23190
23488
 
23191
23489
  // src/ink/init/InitApp.tsx
23490
+ var import_dashboard_url3 = __toESM(require_dashboard_url(), 1);
23192
23491
  init_credential_store();
23193
23492
  import { useState as useState8, useEffect as useEffect9, useCallback } from "react";
23194
23493
  import { Box as Box6, Text as Text7, useApp as useApp3, useInput as useInput4 } from "ink";
@@ -23259,7 +23558,8 @@ function InitApp({ apiUrl, onComplete }) {
23259
23558
  loading: true,
23260
23559
  loadingLabel: "Checking credentials...",
23261
23560
  complete: false,
23262
- createdProductId: null
23561
+ createdProductId: null,
23562
+ account: void 0
23263
23563
  });
23264
23564
  const getSummary = useCallback(() => {
23265
23565
  const answers = [];
@@ -23293,9 +23593,14 @@ function InitApp({ apiUrl, onComplete }) {
23293
23593
  apiUrl
23294
23594
  );
23295
23595
  if (isValid) {
23596
+ const existingCreds = await store.getCredentials();
23296
23597
  setState((prev) => ({
23297
23598
  ...prev,
23298
23599
  apiKey: existingKey,
23600
+ account: (0, import_dashboard_url3.selectAccountId)({
23601
+ userId: existingCreds?.userId,
23602
+ organizationId: existingCreds?.orgId
23603
+ }),
23299
23604
  step: 2,
23300
23605
  loading: false
23301
23606
  }));
@@ -23334,6 +23639,7 @@ function InitApp({ apiUrl, onComplete }) {
23334
23639
  setState((s) => ({
23335
23640
  ...s,
23336
23641
  apiKey: key,
23642
+ account: (0, import_dashboard_url3.selectAccountId)({ userId, organizationId: orgId }),
23337
23643
  step: 2,
23338
23644
  loading: false
23339
23645
  }));
@@ -23715,6 +24021,11 @@ function InitApp({ apiUrl, onComplete }) {
23715
24021
  }
23716
24022
  if (state.step === 7) {
23717
24023
  const dashboardUrl = getDashboardUrl();
24024
+ const productDashboardUrl = state.createdProductId ? (0, import_dashboard_url3.buildDashboardUrl)({
24025
+ baseUrl: dashboardUrl,
24026
+ path: `/products/${state.createdProductId}`,
24027
+ account: state.account
24028
+ }) : "";
23718
24029
  return /* @__PURE__ */ jsxs7(Box6, { flexDirection: "column", children: [
23719
24030
  state.createdProductId ? /* @__PURE__ */ jsxs7(Box6, { flexDirection: "column", children: [
23720
24031
  /* @__PURE__ */ jsxs7(Text7, { color: theme7.success, bold: true, children: [
@@ -23730,9 +24041,7 @@ function InitApp({ apiUrl, onComplete }) {
23730
24041
  " ",
23731
24042
  "Dashboard:",
23732
24043
  " ",
23733
- dashboardUrl,
23734
- "/products/",
23735
- state.createdProductId
24044
+ productDashboardUrl
23736
24045
  ] })
23737
24046
  ] }) : /* @__PURE__ */ jsxs7(Text7, { color: theme7.success, bold: true, children: [
23738
24047
  "\u2713",
@@ -24117,6 +24426,7 @@ import { render as render9 } from "ink";
24117
24426
  import React9 from "react";
24118
24427
 
24119
24428
  // src/ink/marathon/MarathonApp.tsx
24429
+ var import_dashboard_url4 = __toESM(require_dashboard_url(), 1);
24120
24430
  import { useState as useState22, useEffect as useEffect19, useRef as useRef9, useCallback as useCallback8, useMemo as useMemo11 } from "react";
24121
24431
  import { execSync } from "child_process";
24122
24432
  import * as fs4 from "fs";
@@ -29251,13 +29561,31 @@ function MarathonApp({
29251
29561
  const [upgradeModalDismissed, setUpgradeModalDismissed] = useState22(false);
29252
29562
  const [clipboardFlash, setClipboardFlash] = useState22(null);
29253
29563
  const flashTimeout = useRef9(null);
29254
- const billingPageUrl = billingUrl || `${(dashboardUrl || "https://use.runtype.com").replace(/\/$/, "")}/settings/billing`;
29564
+ const [account, setAccount] = useState22(void 0);
29565
+ useEffect19(() => {
29566
+ let cancelled = false;
29567
+ getCurrentAccountId().then((id) => {
29568
+ if (!cancelled) setAccount(id);
29569
+ });
29570
+ return () => {
29571
+ cancelled = true;
29572
+ };
29573
+ }, []);
29574
+ const billingPageUrl = billingUrl || (0, import_dashboard_url4.buildDashboardUrl)({
29575
+ baseUrl: dashboardUrl || "https://use.runtype.com",
29576
+ path: "/settings/billing",
29577
+ account
29578
+ });
29255
29579
  function showFlash(msg) {
29256
29580
  setClipboardFlash(msg);
29257
29581
  if (flashTimeout.current) clearTimeout(flashTimeout.current);
29258
29582
  flashTimeout.current = setTimeout(() => setClipboardFlash(null), 2e3);
29259
29583
  }
29260
- const agentPageUrl = agentId && dashboardUrl ? `${dashboardUrl.replace(/\/$/, "")}/agents/${agentId}` : null;
29584
+ const agentPageUrl = agentId && dashboardUrl ? (0, import_dashboard_url4.buildDashboardUrl)({
29585
+ baseUrl: dashboardUrl,
29586
+ path: `/agents/${agentId}`,
29587
+ account
29588
+ }) : null;
29261
29589
  const handleCopySession = useCallback8(() => {
29262
29590
  setShowSessionMenu(false);
29263
29591
  try {
@@ -36831,6 +37159,7 @@ import open5 from "open";
36831
37159
  import { execFileSync } from "child_process";
36832
37160
 
36833
37161
  // src/lib/persona-init.ts
37162
+ var import_dashboard_url5 = __toESM(require_dashboard_url(), 1);
36834
37163
  init_credential_store();
36835
37164
 
36836
37165
  // src/lib/persona-snippets.ts
@@ -36994,7 +37323,12 @@ async function runPersonaInit(options) {
36994
37323
  personaFormat
36995
37324
  );
36996
37325
  const dashboardBase = getDashboardUrl();
36997
- const dashboardUrl = `${dashboardBase}/agents/${agent.id}`;
37326
+ const account = await getCurrentAccountId();
37327
+ const dashboardUrl = (0, import_dashboard_url5.buildDashboardUrl)({
37328
+ baseUrl: dashboardBase,
37329
+ path: `/agents/${agent.id}`,
37330
+ account
37331
+ });
36998
37332
  return {
36999
37333
  status: "created",
37000
37334
  agent: { id: agent.id, name: agent.name },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/cli",
3
- "version": "2.10.8",
3
+ "version": "2.11.0",
4
4
  "description": "Command-line interface for Runtype AI platform",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,7 +23,7 @@
23
23
  "micromatch": "^4.0.8",
24
24
  "yaml": "^2.8.3",
25
25
  "@runtypelabs/ink-components": "0.3.1",
26
- "@runtypelabs/sdk": "1.15.3",
26
+ "@runtypelabs/sdk": "1.17.0",
27
27
  "@runtypelabs/terminal-animations": "0.2.0"
28
28
  },
29
29
  "devDependencies": {
@@ -37,7 +37,7 @@
37
37
  "tsx": "^4.7.1",
38
38
  "typescript": "^5.3.3",
39
39
  "vitest": "^4.0.18",
40
- "@runtypelabs/shared": "1.4.2"
40
+ "@runtypelabs/shared": "1.5.0"
41
41
  },
42
42
  "engines": {
43
43
  "node": ">=18.0.0"