@runtypelabs/cli 2.22.9 → 2.22.11

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 +285 -5
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -16692,7 +16692,8 @@ var AGENT_CONTENT_CONFIG_KEYS = {
16692
16692
  artifacts: true,
16693
16693
  loggingPolicy: true,
16694
16694
  temporal: true,
16695
- memory: true
16695
+ memory: true,
16696
+ sandbox: true
16696
16697
  };
16697
16698
  var AGENT_CONTENT_CONFIG_KEY_LIST = Object.keys(AGENT_CONTENT_CONFIG_KEYS).sort();
16698
16699
  var configurationStatusSchema = external_exports.enum([
@@ -20163,6 +20164,15 @@ function collectCodeModeToolNameCheck(toolsConfig, stepIndex, stepRef, pendingCh
20163
20164
  }
20164
20165
  var SINGLE_BRACE_VARIABLE_PATTERN = /(?<!\{)\{([a-zA-Z_][a-zA-Z0-9_.]*)\}(?!\})/g;
20165
20166
  var DOUBLE_BRACE_VARIABLE_PATTERN = TEMPLATE_EXPRESSION_PATTERN;
20167
+ var STRING_LITERAL_OPERAND = /(?:'[^']*'|"[^"]*"|`[^`]*`)/.source;
20168
+ var EQUALITY_OPERATOR = /(?:===|!==|==|!=)/.source;
20169
+ var UNQUOTED_TEMPLATE = /(?<!['"`])\{\{[^{}]+\}\}(?!['"`])/.source;
20170
+ var UNQUOTED_TEMPLATE_BEFORE_OP = new RegExp(
20171
+ `${UNQUOTED_TEMPLATE}\\s*${EQUALITY_OPERATOR}\\s*${STRING_LITERAL_OPERAND}`
20172
+ );
20173
+ var UNQUOTED_TEMPLATE_AFTER_OP = new RegExp(
20174
+ `${STRING_LITERAL_OPERAND}\\s*${EQUALITY_OPERATOR}\\s*${UNQUOTED_TEMPLATE}`
20175
+ );
20166
20176
  var TEMPLATE_STRING_FIELDS = /* @__PURE__ */ new Set([
20167
20177
  "text",
20168
20178
  "userPrompt",
@@ -20393,6 +20403,82 @@ function validateUpsertRecordSourceShape(flowSteps, buckets) {
20393
20403
  }
20394
20404
  }
20395
20405
  }
20406
+ function checkConditionExpression(expr, path18, stepRef, buckets) {
20407
+ if (typeof expr !== "string" || !expr.includes("{{")) return;
20408
+ const match = UNQUOTED_TEMPLATE_BEFORE_OP.exec(expr) || UNQUOTED_TEMPLATE_AFTER_OP.exec(expr);
20409
+ if (!match) return;
20410
+ const snippet = match[0].trim();
20411
+ addIssue(
20412
+ "warning",
20413
+ {
20414
+ code: "CONDITION_UNQUOTED_TEMPLATE_COMPARISON",
20415
+ message: `Expression compares an unquoted {{...}} placeholder against a string literal (\`${snippet}\`). \`condition\` / \`when\` predicates are JavaScript evaluated after template substitution, so a non-numeric value substitutes in as a bare identifier (e.g. \`healthy === 'watch'\`) and throws "ReferenceError: <value> is not defined" at runtime. Quote the placeholder \u2014 e.g. '{{var}}' === '...' \u2014 or compare numerically.`,
20416
+ path: path18,
20417
+ step: stepRef,
20418
+ details: { snippet }
20419
+ },
20420
+ buckets
20421
+ );
20422
+ }
20423
+ var CONDITIONAL_BRANCH_STEP_KEYS = [
20424
+ "trueSteps",
20425
+ "falseSteps",
20426
+ "true_steps",
20427
+ "false_steps",
20428
+ "otherwiseSteps"
20429
+ ];
20430
+ function walkStepConditionExpressions(node, basePath, stepRef, buckets, depth) {
20431
+ if (!isObjectRecord(node)) return;
20432
+ if (node.enabled === false) return;
20433
+ checkConditionExpression(node.when, `${basePath}.when`, stepRef, buckets);
20434
+ if (node.type !== "conditional" || !isObjectRecord(node.config)) return;
20435
+ const config3 = node.config;
20436
+ checkConditionExpression(config3.condition, `${basePath}.config.condition`, stepRef, buckets);
20437
+ if (depth >= MAX_CONDITIONAL_NESTING_DEPTH) return;
20438
+ if (Array.isArray(config3.branches)) {
20439
+ config3.branches.forEach((branch, branchIndex) => {
20440
+ if (!isObjectRecord(branch)) return;
20441
+ checkConditionExpression(
20442
+ branch.condition,
20443
+ `${basePath}.config.branches[${branchIndex}].condition`,
20444
+ stepRef,
20445
+ buckets
20446
+ );
20447
+ if (Array.isArray(branch.steps)) {
20448
+ branch.steps.forEach(
20449
+ (nested, nestedIndex) => walkStepConditionExpressions(
20450
+ nested,
20451
+ `${basePath}.config.branches[${branchIndex}].steps[${nestedIndex}]`,
20452
+ stepRef,
20453
+ buckets,
20454
+ depth + 1
20455
+ )
20456
+ );
20457
+ }
20458
+ });
20459
+ }
20460
+ for (const key of CONDITIONAL_BRANCH_STEP_KEYS) {
20461
+ const arr = config3[key];
20462
+ if (!Array.isArray(arr)) continue;
20463
+ arr.forEach(
20464
+ (nested, nestedIndex) => walkStepConditionExpressions(
20465
+ nested,
20466
+ `${basePath}.config.${key}[${nestedIndex}]`,
20467
+ stepRef,
20468
+ buckets,
20469
+ depth + 1
20470
+ )
20471
+ );
20472
+ }
20473
+ }
20474
+ function validateConditionExpressions(flowSteps, buckets, conditionalStepsExceedingDepth) {
20475
+ for (const [stepIndex, step] of flowSteps.entries()) {
20476
+ if (step.enabled === false) continue;
20477
+ if (conditionalStepsExceedingDepth.has(stepIndex)) continue;
20478
+ const stepRef = { index: stepIndex, name: step.name, type: step.type };
20479
+ walkStepConditionExpressions(step, `flowSteps[${stepIndex}]`, stepRef, buckets, 1);
20480
+ }
20481
+ }
20396
20482
  function collectAccountScopedReferences(step, stepIndex, pendingChecks) {
20397
20483
  const stepRef = {
20398
20484
  index: stepIndex,
@@ -20974,6 +21060,7 @@ function collectFlowStructureIssues(flowData, deps, buckets) {
20974
21060
  deps.declaredFlowInputs
20975
21061
  );
20976
21062
  validateUpsertRecordSourceShape(flowData.flowSteps, buckets);
21063
+ validateConditionExpressions(flowData.flowSteps, buckets, conditionalStepsExceedingDepth);
20977
21064
  return { pendingChecks };
20978
21065
  }
20979
21066
  function validateFlowStructure(flowData, deps = {}) {
@@ -32553,6 +32640,7 @@ var BuiltInToolGroup = {
32553
32640
  UCP_COMMERCE: "ucp_commerce",
32554
32641
  SANDBOX_USE: "sandbox_use",
32555
32642
  SANDBOX_SESSION: "sandbox_session",
32643
+ SANDBOX_AGENT: "sandbox_agent",
32556
32644
  TEMPORAL: "temporal"
32557
32645
  };
32558
32646
  var BROWSER_RUN_DOCUMENTATION_URL = "https://developers.cloudflare.com/browser-run/quick-actions/";
@@ -35651,6 +35739,150 @@ var CORE_BUILTIN_TOOLS_REGISTRY = [
35651
35739
  requiresApiKey: false,
35652
35740
  platformKeySupport: true
35653
35741
  },
35742
+ // -----------------------------------------------------------------------
35743
+ // Agent Sandbox tools — the implicit-computer surface.
35744
+ //
35745
+ // Injected (not catalog-selected) when an agent has `config.sandbox.enabled`,
35746
+ // so they are `hidden` from tool discovery. The agent believes it is already
35747
+ // inside a Linux machine: it runs `bash`, reads/edits files, and exposes
35748
+ // ports — it never provisions, names, or tears down infrastructure. The
35749
+ // machine is created lazily on the first call. See ADR 0010 and
35750
+ // `.planning/agent-sandbox-bash/PLAN.md`.
35751
+ // -----------------------------------------------------------------------
35752
+ {
35753
+ id: "bash",
35754
+ name: "Bash",
35755
+ description: "Run a shell command on your Linux computer (Node 22, Python 3.12, git, pnpm, uv preinstalled). Commands run in /workspace; files you write there are available to later commands, but system-level changes outside /workspace may not persist. Combined stdout/stderr is returned. Long output is truncated (head + tail) with the full output spilled to a file. Pass slow_ok=true for commands that take a while (installs, builds, test suites).",
35756
+ category: BuiltInToolCategory.SANDBOX,
35757
+ toolGroup: BuiltInToolGroup.SANDBOX_AGENT,
35758
+ providers: [BuiltInToolProvider.MULTI],
35759
+ parametersSchema: {
35760
+ type: "object",
35761
+ properties: {
35762
+ command: {
35763
+ type: "string",
35764
+ description: "Shell command to execute (runs in bash, cwd is /workspace).",
35765
+ minLength: 1
35766
+ },
35767
+ slow_ok: {
35768
+ type: "boolean",
35769
+ description: "Allow a longer timeout for commands expected to take a while (installs, builds, tests). Defaults to false (short timeout)."
35770
+ }
35771
+ },
35772
+ required: ["command"]
35773
+ },
35774
+ executionHint: "platform",
35775
+ requiresApiKey: false,
35776
+ platformKeySupport: true,
35777
+ hidden: true
35778
+ },
35779
+ {
35780
+ id: "read_file",
35781
+ name: "Read File",
35782
+ description: "Read a file from your computer. Returns the file contents as a string.",
35783
+ category: BuiltInToolCategory.SANDBOX,
35784
+ toolGroup: BuiltInToolGroup.SANDBOX_AGENT,
35785
+ providers: [BuiltInToolProvider.MULTI],
35786
+ parametersSchema: {
35787
+ type: "object",
35788
+ properties: {
35789
+ path: {
35790
+ type: "string",
35791
+ description: "File path to read (relative paths resolve against /workspace).",
35792
+ minLength: 1
35793
+ }
35794
+ },
35795
+ required: ["path"]
35796
+ },
35797
+ executionHint: "platform",
35798
+ requiresApiKey: false,
35799
+ platformKeySupport: true,
35800
+ hidden: true
35801
+ },
35802
+ {
35803
+ id: "write_file",
35804
+ name: "Write File",
35805
+ description: "Write a file on your computer, creating parent directories as needed. Overwrites any existing file at the path. More reliable than shell heredocs for multi-line content.",
35806
+ category: BuiltInToolCategory.SANDBOX,
35807
+ toolGroup: BuiltInToolGroup.SANDBOX_AGENT,
35808
+ providers: [BuiltInToolProvider.MULTI],
35809
+ parametersSchema: {
35810
+ type: "object",
35811
+ properties: {
35812
+ path: {
35813
+ type: "string",
35814
+ description: "File path to write (relative paths resolve against /workspace).",
35815
+ minLength: 1
35816
+ },
35817
+ contents: {
35818
+ type: "string",
35819
+ description: "Full file contents to write."
35820
+ }
35821
+ },
35822
+ required: ["path", "contents"]
35823
+ },
35824
+ executionHint: "platform",
35825
+ requiresApiKey: false,
35826
+ platformKeySupport: true,
35827
+ hidden: true
35828
+ },
35829
+ {
35830
+ id: "edit_file",
35831
+ name: "Edit File",
35832
+ description: 'Replace an exact substring in a file with new text. The "old" text must appear exactly once in the file. Use this for surgical edits instead of rewriting the whole file.',
35833
+ category: BuiltInToolCategory.SANDBOX,
35834
+ toolGroup: BuiltInToolGroup.SANDBOX_AGENT,
35835
+ providers: [BuiltInToolProvider.MULTI],
35836
+ parametersSchema: {
35837
+ type: "object",
35838
+ properties: {
35839
+ path: {
35840
+ type: "string",
35841
+ description: "File path to edit (relative paths resolve against /workspace).",
35842
+ minLength: 1
35843
+ },
35844
+ old: {
35845
+ type: "string",
35846
+ description: "The exact text to find. Must occur exactly once in the file."
35847
+ },
35848
+ new: {
35849
+ type: "string",
35850
+ description: "The replacement text."
35851
+ }
35852
+ },
35853
+ required: ["path", "old", "new"]
35854
+ },
35855
+ executionHint: "platform",
35856
+ requiresApiKey: false,
35857
+ platformKeySupport: true,
35858
+ hidden: true
35859
+ },
35860
+ {
35861
+ id: "expose_port",
35862
+ name: "Expose Port",
35863
+ description: 'Get a public preview URL for a server you started on your computer. Start the server first (e.g. bash("node server.js &")), then expose its port.',
35864
+ category: BuiltInToolCategory.SANDBOX,
35865
+ toolGroup: BuiltInToolGroup.SANDBOX_AGENT,
35866
+ providers: [BuiltInToolProvider.MULTI],
35867
+ parametersSchema: {
35868
+ type: "object",
35869
+ properties: {
35870
+ port: {
35871
+ type: "number",
35872
+ description: "Port your server listens on (must not be 3000, which is reserved)."
35873
+ },
35874
+ name: {
35875
+ type: "string",
35876
+ description: "Optional label for the preview URL."
35877
+ }
35878
+ },
35879
+ required: ["port"]
35880
+ },
35881
+ executionHint: "platform",
35882
+ requiresApiKey: false,
35883
+ platformKeySupport: true,
35884
+ hidden: true
35885
+ },
35654
35886
  // Send email via Resend. Mirrors the send-email context step so agents can
35655
35887
  // dispatch transactional email without wrapping it in a flow.
35656
35888
  {
@@ -39103,6 +39335,17 @@ var MANUAL_PROVIDER_MAP_OVERRIDES = {
39103
39335
  "glm-5.2": {
39104
39336
  "workers-ai": "@cf/zai-org/glm-5.2"
39105
39337
  },
39338
+ // Alias + gateway/catalog id forms share the same provider-specific ids so
39339
+ // every form routes Workers-AI-primary (`@cf/zai-org/glm-5.2`) with the Vercel
39340
+ // gateway listing (`zai/glm-5.2`) as fallback.
39341
+ "glm-5-2": {
39342
+ "workers-ai": "@cf/zai-org/glm-5.2",
39343
+ "vercel": "zai/glm-5.2"
39344
+ },
39345
+ "zai/glm-5.2": {
39346
+ "workers-ai": "@cf/zai-org/glm-5.2",
39347
+ "vercel": "zai/glm-5.2"
39348
+ },
39106
39349
  // MiniMax M2.7: explicit provider IDs for the GC-primary / Vercel-fallback route.
39107
39350
  // `general-compute` is NOT in PROVIDERS_WITHOUT_PREFIX, so resolveRoutedFamily
39108
39351
  // prepends `general-compute/` itself — store the BARE id here to avoid a double
@@ -39979,6 +40222,25 @@ var memoryConfigSchema = external_exports.object({
39979
40222
  // Resolved via `shouldInjectMemorySummary` so the default lives in one place.
39980
40223
  injectSummary: external_exports.boolean().optional()
39981
40224
  });
40225
+ var sandboxNetworkAccessSchema = external_exports.union([
40226
+ external_exports.enum(["none", "essentials"]),
40227
+ external_exports.object({
40228
+ profile: external_exports.enum(["none", "essentials"]).optional(),
40229
+ allow: external_exports.array(external_exports.string()).optional()
40230
+ })
40231
+ ]);
40232
+ var sandboxConfigSchema = external_exports.object({
40233
+ enabled: external_exports.boolean(),
40234
+ provider: external_exports.enum(["runtype-sandbox", "daytona"]).optional(),
40235
+ persistence: external_exports.enum(["ephemeral", "conversation", "named"]).optional(),
40236
+ instanceType: external_exports.enum(["standard-1", "standard-2", "standard-3", "standard-4"]).optional(),
40237
+ networkAccess: sandboxNetworkAccessSchema.optional(),
40238
+ ttl: external_exports.enum(["5m", "1h", "24h", "unlimited"]).optional(),
40239
+ sleepAfter: external_exports.enum(["5m", "15m", "30m", "1h"]).optional(),
40240
+ // Opt-in approval gate on `bash`. Default false; wiring lands in Phase 3. The
40241
+ // approval decision is on tool name + params only — never the agent's reason.
40242
+ requireApprovalForBash: external_exports.boolean().optional()
40243
+ });
39982
40244
  var agentRuntimeConfigSchema = external_exports.object({
39983
40245
  model: external_exports.string().optional(),
39984
40246
  systemPrompt: external_exports.string().optional(),
@@ -40117,7 +40379,12 @@ var agentRuntimeConfigSchema = external_exports.object({
40117
40379
  // `memoryConfigSchema` (below) and reused by the update-agent, dispatch
40118
40380
  // inline-agent, and FPO agent schemas so the four surfaces never drift —
40119
40381
  // mirroring how `temporalConfigSchema` is shared.
40120
- memory: memoryConfigSchema.optional()
40382
+ memory: memoryConfigSchema.optional(),
40383
+ // Agent Sandbox (Linux computer). When enabled, the agent gets the sandbox
40384
+ // builtin tools + system-prompt frame at dispatch. Single-sourced as
40385
+ // `sandboxConfigSchema` (above), mirroring `memory`. The live machine is agent
40386
+ // state; this block is the operator Definition that enables it.
40387
+ sandbox: sandboxConfigSchema.optional()
40121
40388
  });
40122
40389
  function extractSecretReferences(template) {
40123
40390
  const keys = /* @__PURE__ */ new Set();
@@ -43348,7 +43615,12 @@ var AgentInputSchema = external_exports.object({
43348
43615
  model: external_exports.string(),
43349
43616
  systemPrompt: external_exports.string().optional()
43350
43617
  }).optional().nullable(),
43351
- memory: memoryConfigSchema.optional()
43618
+ memory: memoryConfigSchema.optional(),
43619
+ // Agent Sandbox (Linux computer). When enabled (and the enable-agent-sandbox
43620
+ // flag is on), dispatch injects the sandbox builtin tools + system-prompt
43621
+ // frame — mirroring the saved-agent execute route so the two hosted-agent
43622
+ // entry points stay in lockstep.
43623
+ sandbox: sandboxConfigSchema.optional()
43352
43624
  }).superRefine((val, ctx) => {
43353
43625
  if (val.agentType !== "claude_managed") {
43354
43626
  if (!val.name) {
@@ -43426,6 +43698,12 @@ var DispatchRequestSchema = external_exports.object({
43426
43698
  content: MessageContentSchema
43427
43699
  })
43428
43700
  ).optional(),
43701
+ /**
43702
+ * Stable caller-provided conversation/session id. Used to scope
43703
+ * conversation-persistent agent sandbox workspaces and other per-turn caches
43704
+ * across separate dispatch requests without leaking across unrelated chats.
43705
+ */
43706
+ conversationId: external_exports.string().min(1).optional(),
43429
43707
  /**
43430
43708
  * Per-dispatch client tools. The page (or any SDK caller) snapshots its
43431
43709
  * locally-executable tools at the start of every user turn and ships
@@ -43576,6 +43854,8 @@ var SANDBOX_TTL_OPTIONS = [
43576
43854
  { label: "2 hours", value: 2 * 60 * 60 },
43577
43855
  { label: "Unlimited", value: null }
43578
43856
  ];
43857
+ var SANDBOX_RETENTION_DEFAULT_SECONDS = 60 * 60;
43858
+ var SANDBOX_BACKUP_UNLIMITED_TTL_SECONDS = 365 * 24 * 60 * 60;
43579
43859
  var APP_MANIFEST_LIMITS = {
43580
43860
  nameMaxLength: 255,
43581
43861
  maxFlows: 20,
@@ -64624,8 +64904,8 @@ import { execFileSync } from "child_process";
64624
64904
  // src/lib/persona-init.ts
64625
64905
  init_credential_store();
64626
64906
 
64627
- // ../../node_modules/.pnpm/@runtypelabs+persona@3.37.0/node_modules/@runtypelabs/persona/dist/codegen.js
64628
- var S = "3.37.0";
64907
+ // ../../node_modules/.pnpm/@runtypelabs+persona@4.2.0/node_modules/@runtypelabs/persona/dist/codegen.js
64908
+ var S = "4.2.0";
64629
64909
  var c = S;
64630
64910
  function u(e) {
64631
64911
  if (e !== void 0) return typeof e == "string" ? e : Array.isArray(e) ? `[${e.map((r) => r.toString()).join(", ")}]` : e.toString();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/cli",
3
- "version": "2.22.9",
3
+ "version": "2.22.11",
4
4
  "description": "Command-line interface for Runtype AI platform",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -24,11 +24,11 @@
24
24
  "rosie-skills": "0.8.1",
25
25
  "yaml": "^2.9.0",
26
26
  "@runtypelabs/ink-components": "0.3.2",
27
- "@runtypelabs/terminal-animations": "0.2.1",
28
- "@runtypelabs/sdk": "5.2.1"
27
+ "@runtypelabs/sdk": "5.2.2",
28
+ "@runtypelabs/terminal-animations": "0.2.1"
29
29
  },
30
30
  "devDependencies": {
31
- "@runtypelabs/persona": "3.37.0",
31
+ "@runtypelabs/persona": "4.2.0",
32
32
  "@types/express": "^5.0.6",
33
33
  "@types/micromatch": "^4.0.9",
34
34
  "@types/node": "^25.3.3",
@@ -39,7 +39,7 @@
39
39
  "tsx": "^4.7.1",
40
40
  "typescript": "^5.3.3",
41
41
  "vitest": "^4.1.0",
42
- "@runtypelabs/shared": "1.39.0"
42
+ "@runtypelabs/shared": "1.41.2"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=22.0.0"