@runtypelabs/cli 2.10.7 → 2.10.9

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 +89 -11
  2. package/package.json +4 -4
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.5", 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";
@@ -14448,7 +14455,7 @@ var require_provider_routing = __commonJS({
14448
14455
  "../shared/dist/provider-routing.js"(exports) {
14449
14456
  "use strict";
14450
14457
  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;
14458
+ 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
14459
  exports.isRoutedModel = isRoutedModel;
14453
14460
  exports.isDirectAccess = isDirectAccess;
14454
14461
  exports.isGatewayAccess = isGatewayAccess;
@@ -14470,8 +14477,10 @@ var require_provider_routing = __commonJS({
14470
14477
  exports.inferModelCreator = inferModelCreator2;
14471
14478
  exports.getDefaultProvider = getDefaultProvider;
14472
14479
  exports.isVercelSupported = isVercelSupported;
14480
+ exports.isCloudflareSupported = isCloudflareSupported;
14473
14481
  exports.generateVercelModelId = generateVercelModelId;
14474
14482
  exports.getDefaultRoutingConfig = getDefaultRoutingConfig;
14483
+ exports.generateCloudflareModelId = generateCloudflareModelId;
14475
14484
  exports.getDefaultProviderMapping = getDefaultProviderMapping;
14476
14485
  exports.getRoutingConfigWithDefaults = getRoutingConfigWithDefaults;
14477
14486
  exports.getProviderModelIdWithDefaults = getProviderModelIdWithDefaults;
@@ -14482,7 +14491,8 @@ var require_provider_routing = __commonJS({
14482
14491
  "anthropic",
14483
14492
  "google",
14484
14493
  "xai",
14485
- "vercel"
14494
+ "vercel",
14495
+ "cloudflare"
14486
14496
  ]);
14487
14497
  exports.PROVIDER_API_KEY_MAP = {
14488
14498
  "openai": "openaiKey",
@@ -14491,6 +14501,7 @@ var require_provider_routing = __commonJS({
14491
14501
  "xai": "xaiKey",
14492
14502
  "mixlayer": "modelsocketKey",
14493
14503
  "vercel": "vercelGatewayKey",
14504
+ "cloudflare": "cloudflareGatewayToken",
14494
14505
  "togetherai": "togetheraiKey",
14495
14506
  "bedrock": "bedrockAccessKey",
14496
14507
  // Also needs bedrockSecretKey
@@ -14507,6 +14518,9 @@ var require_provider_routing = __commonJS({
14507
14518
  "mock": null
14508
14519
  // Dev-only, no API key needed
14509
14520
  };
14521
+ exports.CLOUDFLARE_GATEWAY_ALLOWLIST = /* @__PURE__ */ new Set([
14522
+ "gpt-5.4-nano"
14523
+ ]);
14510
14524
  exports.PROVIDER_ROUTING_CONFIG = {
14511
14525
  // Claude 4.5 Sonnet - Route through Vercel AI Gateway
14512
14526
  "claude-sonnet-4-5": {
@@ -14556,6 +14570,20 @@ var require_provider_routing = __commonJS({
14556
14570
  ],
14557
14571
  fallback: ["openai"]
14558
14572
  },
14573
+ // GPT-5.3 Codex - completion model, route through Vercel + OpenAI fallback
14574
+ "gpt-5.3-codex": {
14575
+ providers: [
14576
+ { provider: "vercel", weight: 100 }
14577
+ ],
14578
+ fallback: ["openai"]
14579
+ },
14580
+ // GPT-5.4 Nano - CF Gateway primary for testing, Vercel + OpenAI as fallback
14581
+ "gpt-5.4-nano": {
14582
+ providers: [
14583
+ { provider: "cloudflare", weight: 100 }
14584
+ ],
14585
+ fallback: ["vercel", "openai"]
14586
+ },
14559
14587
  // Gemini 2.5 Pro - Route through Vercel AI Gateway
14560
14588
  "gemini-2.5-pro": {
14561
14589
  providers: [
@@ -14653,6 +14681,26 @@ var require_provider_routing = __commonJS({
14653
14681
  { provider: "vercel", weight: 100 }
14654
14682
  ],
14655
14683
  fallback: ["openai"]
14684
+ },
14685
+ // Kimi K2.5 - Route through Cloudflare Workers AI
14686
+ "kimi-k2.5": {
14687
+ providers: [
14688
+ { provider: "workers-ai", weight: 100 }
14689
+ ],
14690
+ fallback: ["vercel"]
14691
+ },
14692
+ // NVIDIA Nemotron-3 120B - Route through Cloudflare Workers AI (no Vercel equivalent)
14693
+ "nemotron-3-120b-a12b": {
14694
+ providers: [
14695
+ { provider: "workers-ai", weight: 100 }
14696
+ ]
14697
+ },
14698
+ // Google Gemma 4 26B - Route through Cloudflare Workers AI
14699
+ "gemma-4-26b-a4b-it": {
14700
+ providers: [
14701
+ { provider: "workers-ai", weight: 100 }
14702
+ ],
14703
+ fallback: ["vercel"]
14656
14704
  }
14657
14705
  };
14658
14706
  var MANUAL_PROVIDER_MAP_OVERRIDES = {
@@ -14677,6 +14725,15 @@ var require_provider_routing = __commonJS({
14677
14725
  },
14678
14726
  "deepseek-v3": {
14679
14727
  "togetherai": "togetherai/deepseek-ai/DeepSeek-V3"
14728
+ },
14729
+ "kimi-k2.5": {
14730
+ "workers-ai": "@cf/moonshotai/kimi-k2.5"
14731
+ },
14732
+ "nemotron-3-120b-a12b": {
14733
+ "workers-ai": "@cf/nvidia/nemotron-3-120b-a12b"
14734
+ },
14735
+ "gemma-4-26b-a4b-it": {
14736
+ "workers-ai": "@cf/google/gemma-4-26b-a4b-it"
14680
14737
  }
14681
14738
  };
14682
14739
  exports.BASE_MODEL_PROVIDER_MAP = (() => {
@@ -14802,10 +14859,12 @@ var require_provider_routing = __commonJS({
14802
14859
  "vertex-anthropic",
14803
14860
  "tinfoil",
14804
14861
  "generic-openai",
14805
- "mock"
14862
+ "mock",
14863
+ "workers-ai"
14806
14864
  ]);
14807
14865
  exports.GATEWAY_PROVIDERS = /* @__PURE__ */ new Set([
14808
14866
  "vercel",
14867
+ "cloudflare",
14809
14868
  "openrouter",
14810
14869
  "azure"
14811
14870
  ]);
@@ -15145,6 +15204,9 @@ var require_provider_routing = __commonJS({
15145
15204
  const creator = inferModelCreator2(modelId);
15146
15205
  return !NON_VERCEL_CREATORS.has(creator);
15147
15206
  }
15207
+ function isCloudflareSupported(modelId) {
15208
+ return exports.CLOUDFLARE_GATEWAY_ALLOWLIST.has(modelId);
15209
+ }
15148
15210
  var CREATOR_TO_VERCEL_PROVIDER = {
15149
15211
  "openai": "openai",
15150
15212
  "anthropic": "anthropic",
@@ -15177,18 +15239,33 @@ var require_provider_routing = __commonJS({
15177
15239
  const config2 = {
15178
15240
  providers: [{ provider: "vercel", weight: 100 }]
15179
15241
  };
15242
+ const fallbacks = [];
15243
+ if (isCloudflareSupported(baseModel)) {
15244
+ fallbacks.push("cloudflare");
15245
+ }
15180
15246
  const fallbackProvider = getFallbackProvider(creator);
15181
15247
  if (fallbackProvider) {
15182
- config2.fallback = [fallbackProvider];
15248
+ fallbacks.push(fallbackProvider);
15249
+ }
15250
+ if (fallbacks.length > 0) {
15251
+ config2.fallback = fallbacks;
15183
15252
  }
15184
15253
  return config2;
15185
15254
  }
15255
+ function generateCloudflareModelId(modelId) {
15256
+ const creator = inferModelCreator2(modelId);
15257
+ const cfProvider = CREATOR_TO_VERCEL_PROVIDER[creator] || creator;
15258
+ return `${cfProvider}/${modelId}`;
15259
+ }
15186
15260
  function getDefaultProviderMapping(baseModel) {
15187
15261
  const creator = inferModelCreator2(baseModel);
15188
15262
  const mapping = {};
15189
15263
  if (isVercelSupported(baseModel)) {
15190
15264
  mapping["vercel"] = generateVercelModelId(baseModel);
15191
15265
  }
15266
+ if (isCloudflareSupported(baseModel)) {
15267
+ mapping["cloudflare"] = generateCloudflareModelId(baseModel);
15268
+ }
15192
15269
  const fallbackProvider = getFallbackProvider(creator);
15193
15270
  if (fallbackProvider) {
15194
15271
  mapping[fallbackProvider] = baseModel;
@@ -26620,16 +26697,17 @@ function createSandboxInstructions(provider) {
26620
26697
  "--- Deploy with Preview (Cloudflare Sandbox) ---",
26621
26698
  "You also have `deploy_sandbox` to deploy a persistent web server and get a live preview URL.",
26622
26699
  "Call shape:",
26623
- '{ "code": "...", "files": { "public/index.html": "..." }, "packageJson": "{\\"dependencies\\": {\\"hono\\": \\"^4.0.0\\"}}", "language": "typescript", "port": 3000 }',
26700
+ '{ "code": "...", "files": { "public/index.html": "..." }, "packageJson": "{\\"dependencies\\": {\\"hono\\": \\"^4.0.0\\"}}", "language": "typescript", "port": 8080 }',
26624
26701
  "Deploy rules:",
26625
26702
  "1. Use this when you need to run a web server (Hono, Express, FastAPI, etc.) that the user can visit in their browser.",
26626
26703
  "2. The `code` is the main entry point file. The `packageJson` string provides npm dependencies.",
26627
- "3. The `files` parameter writes additional files (path \u2192 content). Keys must be plain file paths.",
26628
- "4. Bind the server to the specified `port` (default 3000).",
26704
+ '3. The `files` parameter writes additional files (path \u2192 content). Keys must be plain relative file paths. Parent directories are created automatically, so `{ "public/index.html": "..." }` just works.',
26705
+ "4. Bind the server to the specified `port` (default 8080). Port 3000 is reserved by the sandbox API control plane \u2014 pick 8080, 8000, 5173, or any other non-3000 port.",
26629
26706
  "5. Each sandbox is a persistent container with snapshot-backed warm starts.",
26630
26707
  "6. The returned `previewUrl` is a REAL live URL the user can open in their browser.",
26631
26708
  "7. The sandbox persists for 2 hours after the last activity, then auto-cleans up (state survives via snapshot).",
26632
- "8. Prefer this over `run_sandbox_code` when building web apps, APIs, or anything with a UI."
26709
+ "8. Prefer this over `run_sandbox_code` when building web apps, APIs, or anything with a UI.",
26710
+ '9. On failure the response includes a `stage` field (e.g. "npm_install", "start_process") and captured stdout/stderr in `output` \u2014 use these to diagnose without re-running.'
26633
26711
  ].join("\n");
26634
26712
  }
26635
26713
  return [
@@ -26885,7 +26963,7 @@ function createDeployCfSandboxLocalTool(client, debugMode) {
26885
26963
  },
26886
26964
  port: {
26887
26965
  type: "number",
26888
- description: "Port the server listens on (default: 3000)"
26966
+ description: "Port the server listens on (default: 8080). Port 3000 is reserved by the sandbox API control plane and will be rejected \u2014 use 8080, 8000, 5173, or any other non-3000 port."
26889
26967
  },
26890
26968
  startCommand: {
26891
26969
  type: "string",
@@ -26893,7 +26971,7 @@ function createDeployCfSandboxLocalTool(client, debugMode) {
26893
26971
  },
26894
26972
  files: {
26895
26973
  type: "object",
26896
- description: 'Additional files to write (path \u2192 content), e.g. { "public/index.html": "<html>..." }. Keys must be plain file paths. Use this for multi-file projects.',
26974
+ description: 'Additional files to write (path \u2192 content), e.g. { "public/index.html": "<html>..." }. Keys must be plain relative file paths; parent directories are created automatically. Use this for multi-file projects.',
26897
26975
  additionalProperties: { type: "string" }
26898
26976
  }
26899
26977
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/cli",
3
- "version": "2.10.7",
3
+ "version": "2.10.9",
4
4
  "description": "Command-line interface for Runtype AI platform",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,8 +23,8 @@
23
23
  "micromatch": "^4.0.8",
24
24
  "yaml": "^2.8.3",
25
25
  "@runtypelabs/ink-components": "0.3.1",
26
- "@runtypelabs/terminal-animations": "0.2.0",
27
- "@runtypelabs/sdk": "1.15.2"
26
+ "@runtypelabs/sdk": "1.16.0",
27
+ "@runtypelabs/terminal-animations": "0.2.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/micromatch": "^4.0.9",
@@ -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.4.3"
41
41
  },
42
42
  "engines": {
43
43
  "node": ">=18.0.0"