@runtypelabs/cli 2.4.0 → 2.5.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/dist/index.js +166 -5
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -11636,6 +11636,7 @@ var require_generated_model_routing = __commonJS({
|
|
|
11636
11636
|
"gemini-3.1-flash-lite-preview": ["vercel"],
|
|
11637
11637
|
"gemini-3.1-pro-preview": ["vercel"],
|
|
11638
11638
|
"gemini-embedding-001": ["vercel"],
|
|
11639
|
+
"gemini-embedding-2": ["vercel"],
|
|
11639
11640
|
"gemini-flash-1.5-8b": ["google"],
|
|
11640
11641
|
"gemini-pro": ["google"],
|
|
11641
11642
|
"gemma-2-9b": ["vercel"],
|
|
@@ -11785,8 +11786,11 @@ var require_generated_model_routing = __commonJS({
|
|
|
11785
11786
|
"grok-4-fast-reasoning": ["vercel"],
|
|
11786
11787
|
"grok-4.1-fast-non-reasoning": ["vercel"],
|
|
11787
11788
|
"grok-4.1-fast-reasoning": ["vercel"],
|
|
11789
|
+
"grok-4.20-multi-agent": ["vercel"],
|
|
11788
11790
|
"grok-4.20-multi-agent-beta": ["vercel"],
|
|
11791
|
+
"grok-4.20-non-reasoning": ["vercel"],
|
|
11789
11792
|
"grok-4.20-non-reasoning-beta": ["vercel"],
|
|
11793
|
+
"grok-4.20-reasoning": ["vercel"],
|
|
11790
11794
|
"grok-4.20-reasoning-beta": ["vercel"],
|
|
11791
11795
|
"grok-beta": ["xai"],
|
|
11792
11796
|
"grok-code-fast-1": ["vercel", "xai"],
|
|
@@ -11843,6 +11847,7 @@ var require_generated_model_routing = __commonJS({
|
|
|
11843
11847
|
"Meta-Llama-3.3-70B-Instruct-Turbo": ["togetherai"],
|
|
11844
11848
|
"meta.llama3-8b-instruct-v1%3A0": ["bedrock"],
|
|
11845
11849
|
"mimo-v2-flash": ["vercel"],
|
|
11850
|
+
"mimo-v2-pro": ["vercel"],
|
|
11846
11851
|
"minimax-m2": ["vercel"],
|
|
11847
11852
|
"minimax-m2.1": ["vercel"],
|
|
11848
11853
|
"minimax-m2.1-lightning": ["vercel"],
|
|
@@ -12091,6 +12096,7 @@ var require_generated_model_routing = __commonJS({
|
|
|
12091
12096
|
"gemini-3-flash": ["google", "vercel"],
|
|
12092
12097
|
"gemini-3-pro-image": ["vercel"],
|
|
12093
12098
|
"gemini-embedding-001": ["vercel"],
|
|
12099
|
+
"gemini-embedding-2": ["vercel"],
|
|
12094
12100
|
"gemini-flash-1-5-8b": ["google"],
|
|
12095
12101
|
"gemini-pro": ["google"],
|
|
12096
12102
|
"gemma-2-9b": ["vercel"],
|
|
@@ -12231,8 +12237,11 @@ var require_generated_model_routing = __commonJS({
|
|
|
12231
12237
|
"grok-4": ["vercel", "xai"],
|
|
12232
12238
|
"grok-4-1-fast-non-reasoning": ["vercel"],
|
|
12233
12239
|
"grok-4-1-fast-reasoning": ["vercel"],
|
|
12240
|
+
"grok-4-20-multi-agent": ["vercel"],
|
|
12234
12241
|
"grok-4-20-multi-agent-beta": ["vercel"],
|
|
12242
|
+
"grok-4-20-non-reasoning": ["vercel"],
|
|
12235
12243
|
"grok-4-20-non-reasoning-beta": ["vercel"],
|
|
12244
|
+
"grok-4-20-reasoning": ["vercel"],
|
|
12236
12245
|
"grok-4-20-reasoning-beta": ["vercel"],
|
|
12237
12246
|
"grok-4-fast": ["xai"],
|
|
12238
12247
|
"grok-4-fast-non-reasoning": ["vercel"],
|
|
@@ -12284,6 +12293,7 @@ var require_generated_model_routing = __commonJS({
|
|
|
12284
12293
|
"meta-llama-3-8b-instruct-turbo": ["togetherai"],
|
|
12285
12294
|
"meta.llama3-8b-instruct-v1%3a0": ["bedrock"],
|
|
12286
12295
|
"mimo-v2-flash": ["vercel"],
|
|
12296
|
+
"mimo-v2-pro": ["vercel"],
|
|
12287
12297
|
"minimax-m2": ["vercel"],
|
|
12288
12298
|
"minimax-m2-1": ["vercel"],
|
|
12289
12299
|
"minimax-m2-1-lightning": ["vercel"],
|
|
@@ -12817,6 +12827,9 @@ var require_generated_model_routing = __commonJS({
|
|
|
12817
12827
|
"gemini-embedding-001": {
|
|
12818
12828
|
"vercel": "google/gemini-embedding-001"
|
|
12819
12829
|
},
|
|
12830
|
+
"gemini-embedding-2": {
|
|
12831
|
+
"vercel": "google/gemini-embedding-2"
|
|
12832
|
+
},
|
|
12820
12833
|
"gemini-flash-1-5-8b": {
|
|
12821
12834
|
"google": "gemini-flash-1.5-8b"
|
|
12822
12835
|
},
|
|
@@ -13455,12 +13468,21 @@ var require_generated_model_routing = __commonJS({
|
|
|
13455
13468
|
"grok-4-1-fast-reasoning": {
|
|
13456
13469
|
"vercel": "xai/grok-4.1-fast-reasoning"
|
|
13457
13470
|
},
|
|
13471
|
+
"grok-4-20-multi-agent": {
|
|
13472
|
+
"vercel": "xai/grok-4.20-multi-agent"
|
|
13473
|
+
},
|
|
13458
13474
|
"grok-4-20-multi-agent-beta": {
|
|
13459
13475
|
"vercel": "xai/grok-4.20-multi-agent-beta"
|
|
13460
13476
|
},
|
|
13477
|
+
"grok-4-20-non-reasoning": {
|
|
13478
|
+
"vercel": "xai/grok-4.20-non-reasoning"
|
|
13479
|
+
},
|
|
13461
13480
|
"grok-4-20-non-reasoning-beta": {
|
|
13462
13481
|
"vercel": "xai/grok-4.20-non-reasoning-beta"
|
|
13463
13482
|
},
|
|
13483
|
+
"grok-4-20-reasoning": {
|
|
13484
|
+
"vercel": "xai/grok-4.20-reasoning"
|
|
13485
|
+
},
|
|
13464
13486
|
"grok-4-20-reasoning-beta": {
|
|
13465
13487
|
"vercel": "xai/grok-4.20-reasoning-beta"
|
|
13466
13488
|
},
|
|
@@ -13479,12 +13501,21 @@ var require_generated_model_routing = __commonJS({
|
|
|
13479
13501
|
"grok-4.1-fast-reasoning": {
|
|
13480
13502
|
"vercel": "xai/grok-4.1-fast-reasoning"
|
|
13481
13503
|
},
|
|
13504
|
+
"grok-4.20-multi-agent": {
|
|
13505
|
+
"vercel": "xai/grok-4.20-multi-agent"
|
|
13506
|
+
},
|
|
13482
13507
|
"grok-4.20-multi-agent-beta": {
|
|
13483
13508
|
"vercel": "xai/grok-4.20-multi-agent-beta"
|
|
13484
13509
|
},
|
|
13510
|
+
"grok-4.20-non-reasoning": {
|
|
13511
|
+
"vercel": "xai/grok-4.20-non-reasoning"
|
|
13512
|
+
},
|
|
13485
13513
|
"grok-4.20-non-reasoning-beta": {
|
|
13486
13514
|
"vercel": "xai/grok-4.20-non-reasoning-beta"
|
|
13487
13515
|
},
|
|
13516
|
+
"grok-4.20-reasoning": {
|
|
13517
|
+
"vercel": "xai/grok-4.20-reasoning"
|
|
13518
|
+
},
|
|
13488
13519
|
"grok-4.20-reasoning-beta": {
|
|
13489
13520
|
"vercel": "xai/grok-4.20-reasoning-beta"
|
|
13490
13521
|
},
|
|
@@ -13726,6 +13757,9 @@ var require_generated_model_routing = __commonJS({
|
|
|
13726
13757
|
"mimo-v2-flash": {
|
|
13727
13758
|
"vercel": "xiaomi/mimo-v2-flash"
|
|
13728
13759
|
},
|
|
13760
|
+
"mimo-v2-pro": {
|
|
13761
|
+
"vercel": "xiaomi/mimo-v2-pro"
|
|
13762
|
+
},
|
|
13729
13763
|
"minimax-m2": {
|
|
13730
13764
|
"vercel": "minimax/minimax-m2"
|
|
13731
13765
|
},
|
|
@@ -21552,12 +21586,21 @@ function isRecord(value) {
|
|
|
21552
21586
|
function parseSandboxProvider(value) {
|
|
21553
21587
|
if (!value) return void 0;
|
|
21554
21588
|
const normalized = value.trim().toLowerCase();
|
|
21555
|
-
if (normalized === "quickjs" || normalized === "daytona" || normalized === "cloudflare-worker")
|
|
21589
|
+
if (normalized === "quickjs" || normalized === "daytona" || normalized === "cloudflare-worker" || normalized === "cloudflare-shell")
|
|
21556
21590
|
return normalized;
|
|
21557
21591
|
return void 0;
|
|
21558
21592
|
}
|
|
21559
21593
|
function parseSandboxLanguage(provider, value) {
|
|
21560
21594
|
if (provider === "quickjs" || provider === "cloudflare-worker") return "javascript";
|
|
21595
|
+
if (provider === "cloudflare-shell") {
|
|
21596
|
+
if (typeof value === "string") {
|
|
21597
|
+
const normalized = value.trim().toLowerCase();
|
|
21598
|
+
if (normalized === "javascript" || normalized === "typescript") {
|
|
21599
|
+
return normalized;
|
|
21600
|
+
}
|
|
21601
|
+
}
|
|
21602
|
+
return "javascript";
|
|
21603
|
+
}
|
|
21561
21604
|
if (typeof value === "string") {
|
|
21562
21605
|
const normalized = value.trim().toLowerCase();
|
|
21563
21606
|
if (normalized === "javascript" || normalized === "typescript" || normalized === "python") {
|
|
@@ -21637,6 +21680,44 @@ function createSandboxInstructions(provider) {
|
|
|
21637
21680
|
"return { sum, count: nums.length }"
|
|
21638
21681
|
].join("\n");
|
|
21639
21682
|
}
|
|
21683
|
+
if (provider === "cloudflare-shell") {
|
|
21684
|
+
return [
|
|
21685
|
+
"--- Sandbox Tooling (Cloudflare Shell) ---",
|
|
21686
|
+
"You can execute JavaScript/TypeScript code with the local tool `run_sandbox_code`.",
|
|
21687
|
+
"Call shape:",
|
|
21688
|
+
'{ "code": "...", "parameters": { ... }, "language": "javascript|typescript", "timeoutMs": 30000 }',
|
|
21689
|
+
"Cloudflare Shell rules:",
|
|
21690
|
+
"1. Choose one language: javascript or typescript.",
|
|
21691
|
+
"2. TypeScript is fully supported with runtime compilation and npm dependency resolution.",
|
|
21692
|
+
"3. Inputs are passed via the `parameters` object (for example: `const x = parameters.x`).",
|
|
21693
|
+
"4. async/await and Promises are fully supported.",
|
|
21694
|
+
"5. The snippet is wrapped in an async function. Use top-level `return ...` to produce the result.",
|
|
21695
|
+
"6. Return JSON-serializable values (object, array, string, number, boolean, null).",
|
|
21696
|
+
"7. Helper functions are available under `helpers.*` namespace (e.g., `helpers.extractEmails(text)`).",
|
|
21697
|
+
"8. Persistent filesystem: `state.writeFile()`, `state.readFile()`, `state.glob()` are available for working with files.",
|
|
21698
|
+
"9. Files persist across multiple `run_sandbox_code` calls within the same sandbox.",
|
|
21699
|
+
"10. No Python support \u2014 use Daytona for Python workloads.",
|
|
21700
|
+
"11. No network access (fetch calls are blocked by default).",
|
|
21701
|
+
"Example:",
|
|
21702
|
+
"const nums = parameters.nums || []",
|
|
21703
|
+
"const sum = nums.reduce((acc: number, n: number) => acc + n, 0)",
|
|
21704
|
+
"return { sum, count: nums.length }",
|
|
21705
|
+
"",
|
|
21706
|
+
"--- Deploy with Preview (Cloudflare Shell) ---",
|
|
21707
|
+
"You also have `deploy_sandbox` to deploy a persistent web server and get a live preview URL.",
|
|
21708
|
+
"Call shape:",
|
|
21709
|
+
'{ "code": "...", "files": { "public/index.html": "..." }, "packageJson": "{\\"dependencies\\": {\\"hono\\": \\"^4.0.0\\"}}", "language": "typescript", "port": 3000 }',
|
|
21710
|
+
"Deploy rules:",
|
|
21711
|
+
"1. Use this when you need to run a web server (Hono, etc.) that the user can visit in their browser.",
|
|
21712
|
+
"2. The `code` is the main entry point file. The `packageJson` string provides npm dependencies.",
|
|
21713
|
+
"3. The `files` parameter writes additional files (path \u2192 content). Keys must be plain file paths.",
|
|
21714
|
+
"4. The code must export a fetch handler (Cloudflare Workers format): `export default { fetch(req) { ... } }`",
|
|
21715
|
+
"5. The sandbox is persistent \u2014 each sandbox has its own Durable Object with isolated state.",
|
|
21716
|
+
"6. The returned `previewUrl` is a REAL live URL (e.g., https://api.runtype.com/preview/{sandboxId}/) that the user can open in their browser.",
|
|
21717
|
+
"7. The sandbox persists for 2 hours after the last activity, then auto-cleans up.",
|
|
21718
|
+
"8. Prefer this over `run_sandbox_code` when building web apps, APIs, or anything with a UI."
|
|
21719
|
+
].join("\n");
|
|
21720
|
+
}
|
|
21640
21721
|
return [
|
|
21641
21722
|
"--- Sandbox Tooling (Daytona) ---",
|
|
21642
21723
|
"You can execute code snippets with the local tool `run_sandbox_code`.",
|
|
@@ -21666,7 +21747,7 @@ function createSandboxInstructions(provider) {
|
|
|
21666
21747
|
}
|
|
21667
21748
|
function createSandboxLocalTool(client, provider, debugMode) {
|
|
21668
21749
|
return {
|
|
21669
|
-
description: provider === "cloudflare-worker" ? "Execute JavaScript code in Cloudflare Worker sandbox. Async/await supported. Inputs are passed via parameters object." : provider === "quickjs" ? "Execute JavaScript code in QuickJS sandbox (legacy). Inputs are passed via parameters object." : "Execute JavaScript/TypeScript/Python code in Daytona sandbox. Inputs are injected as top-level variables.",
|
|
21750
|
+
description: provider === "cloudflare-worker" ? "Execute JavaScript code in Cloudflare Worker sandbox. Async/await supported. Inputs are passed via parameters object." : provider === "quickjs" ? "Execute JavaScript code in QuickJS sandbox (legacy). Inputs are passed via parameters object." : provider === "cloudflare-shell" ? "Execute JavaScript/TypeScript code in Cloudflare Shell sandbox. TypeScript and npm dependencies supported. Inputs are passed via parameters object." : "Execute JavaScript/TypeScript/Python code in Daytona sandbox. Inputs are injected as top-level variables.",
|
|
21670
21751
|
parametersSchema: {
|
|
21671
21752
|
type: "object",
|
|
21672
21753
|
properties: {
|
|
@@ -21677,8 +21758,8 @@ function createSandboxLocalTool(client, provider, debugMode) {
|
|
|
21677
21758
|
},
|
|
21678
21759
|
language: {
|
|
21679
21760
|
type: "string",
|
|
21680
|
-
enum: provider === "quickjs" || provider === "cloudflare-worker" ? ["javascript"] : ["javascript", "typescript", "python"],
|
|
21681
|
-
description: provider === "quickjs" ? "QuickJS only accepts javascript" : provider === "cloudflare-worker" ? "Cloudflare Worker only accepts javascript" : "Daytona code language"
|
|
21761
|
+
enum: provider === "quickjs" || provider === "cloudflare-worker" ? ["javascript"] : provider === "cloudflare-shell" ? ["javascript", "typescript"] : ["javascript", "typescript", "python"],
|
|
21762
|
+
description: provider === "quickjs" ? "QuickJS only accepts javascript" : provider === "cloudflare-worker" ? "Cloudflare Worker only accepts javascript" : provider === "cloudflare-shell" ? "Cloudflare Shell accepts javascript or typescript" : "Daytona code language"
|
|
21682
21763
|
},
|
|
21683
21764
|
timeoutMs: { type: "number", description: "Execution timeout in ms (max 30000)" }
|
|
21684
21765
|
},
|
|
@@ -21709,7 +21790,7 @@ function createSandboxLocalTool(client, provider, debugMode) {
|
|
|
21709
21790
|
{
|
|
21710
21791
|
allowedToolTypes: ["custom"],
|
|
21711
21792
|
allowedSandboxProviders: [provider],
|
|
21712
|
-
allowedLanguages: provider === "quickjs" || provider === "cloudflare-worker" ? ["javascript"] : ["javascript", "typescript", "python"],
|
|
21793
|
+
allowedLanguages: provider === "quickjs" || provider === "cloudflare-worker" ? ["javascript"] : provider === "cloudflare-shell" ? ["javascript", "typescript"] : ["javascript", "typescript", "python"],
|
|
21713
21794
|
maxTimeoutMs: 3e4,
|
|
21714
21795
|
maxCodeLength: 12e3
|
|
21715
21796
|
}
|
|
@@ -21871,6 +21952,84 @@ function createDeploySandboxLocalTool(client, debugMode) {
|
|
|
21871
21952
|
}
|
|
21872
21953
|
};
|
|
21873
21954
|
}
|
|
21955
|
+
var activeCfShellWorkerId;
|
|
21956
|
+
function createDeployCfShellLocalTool(client, debugMode) {
|
|
21957
|
+
return {
|
|
21958
|
+
description: "Deploy code to a persistent Cloudflare Shell Dynamic Worker and get a live preview URL. Use this to run web servers, APIs, or UIs that the user can visit in their browser. Supports JavaScript and TypeScript with npm dependencies.",
|
|
21959
|
+
parametersSchema: {
|
|
21960
|
+
type: "object",
|
|
21961
|
+
properties: {
|
|
21962
|
+
code: { type: "string", description: "Code to deploy (main entry point file)" },
|
|
21963
|
+
packageJson: {
|
|
21964
|
+
type: "object",
|
|
21965
|
+
description: 'package.json content as a JSON object, e.g. { "dependencies": { "hono": "^4.0.0" } }'
|
|
21966
|
+
},
|
|
21967
|
+
language: {
|
|
21968
|
+
type: "string",
|
|
21969
|
+
enum: ["javascript", "typescript"],
|
|
21970
|
+
description: "Language of the code (default: typescript)"
|
|
21971
|
+
},
|
|
21972
|
+
port: {
|
|
21973
|
+
type: "number",
|
|
21974
|
+
description: "Port the server listens on (default: 3000)"
|
|
21975
|
+
},
|
|
21976
|
+
files: {
|
|
21977
|
+
type: "object",
|
|
21978
|
+
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.',
|
|
21979
|
+
additionalProperties: { type: "string" }
|
|
21980
|
+
}
|
|
21981
|
+
},
|
|
21982
|
+
required: ["code"]
|
|
21983
|
+
},
|
|
21984
|
+
execute: async (args) => {
|
|
21985
|
+
const code = typeof args.code === "string" ? args.code : "";
|
|
21986
|
+
if (!code.trim()) {
|
|
21987
|
+
return { success: false, error: "code is required" };
|
|
21988
|
+
}
|
|
21989
|
+
const request = {
|
|
21990
|
+
code,
|
|
21991
|
+
...args.packageJson && typeof args.packageJson === "object" ? { packageJson: JSON.stringify(args.packageJson) } : typeof args.packageJson === "string" ? { packageJson: args.packageJson } : {},
|
|
21992
|
+
...typeof args.language === "string" ? { language: args.language } : {},
|
|
21993
|
+
...typeof args.port === "number" ? { port: args.port } : {},
|
|
21994
|
+
...args.files && typeof args.files === "object" && !Array.isArray(args.files) ? { files: args.files } : {},
|
|
21995
|
+
// Reuse existing worker if one was created
|
|
21996
|
+
...activeCfShellWorkerId ? { workerId: activeCfShellWorkerId } : {}
|
|
21997
|
+
};
|
|
21998
|
+
try {
|
|
21999
|
+
const result = await client.tools.deployCfShell(request);
|
|
22000
|
+
if (result.workerId) {
|
|
22001
|
+
activeCfShellWorkerId = result.workerId;
|
|
22002
|
+
}
|
|
22003
|
+
if (result.previewUrl) {
|
|
22004
|
+
activeDeploySandboxPreviewUrl = result.previewUrl;
|
|
22005
|
+
}
|
|
22006
|
+
if (debugMode) {
|
|
22007
|
+
console.log(
|
|
22008
|
+
chalk11.gray(
|
|
22009
|
+
` [deploy_cf_shell] ${result.status} \u2014 ${result.previewUrl || "no preview URL"}`
|
|
22010
|
+
)
|
|
22011
|
+
);
|
|
22012
|
+
}
|
|
22013
|
+
return {
|
|
22014
|
+
success: result.status === "running",
|
|
22015
|
+
workerId: result.workerId,
|
|
22016
|
+
previewUrl: result.previewUrl,
|
|
22017
|
+
output: result.output,
|
|
22018
|
+
...result.error ? { error: result.error } : {}
|
|
22019
|
+
};
|
|
22020
|
+
} catch (error) {
|
|
22021
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
22022
|
+
if (debugMode) {
|
|
22023
|
+
console.log(chalk11.gray(` [deploy_cf_shell] error: ${message}`));
|
|
22024
|
+
}
|
|
22025
|
+
return {
|
|
22026
|
+
success: false,
|
|
22027
|
+
error: message
|
|
22028
|
+
};
|
|
22029
|
+
}
|
|
22030
|
+
}
|
|
22031
|
+
};
|
|
22032
|
+
}
|
|
21874
22033
|
|
|
21875
22034
|
// src/marathon/event-log.ts
|
|
21876
22035
|
import * as fs3 from "fs";
|
|
@@ -27364,6 +27523,8 @@ function buildLocalTools(client, sandboxProvider, options, context) {
|
|
|
27364
27523
|
enabledTools.run_sandbox_code = createSandboxLocalTool(client, sandboxProvider, options.debug);
|
|
27365
27524
|
if (sandboxProvider === "daytona") {
|
|
27366
27525
|
enabledTools.deploy_sandbox = createDeploySandboxLocalTool(client, options.debug);
|
|
27526
|
+
} else if (sandboxProvider === "cloudflare-shell") {
|
|
27527
|
+
enabledTools.deploy_sandbox = createDeployCfShellLocalTool(client, options.debug);
|
|
27367
27528
|
}
|
|
27368
27529
|
}
|
|
27369
27530
|
return Object.keys(enabledTools).length > 0 ? enabledTools : void 0;
|