@runtypelabs/cli 2.22.9 → 2.22.10

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 +266 -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 stay available to later commands while you work on this task, but system-level changes outside /workspace may not. 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
  {
@@ -39979,6 +40211,25 @@ var memoryConfigSchema = external_exports.object({
39979
40211
  // Resolved via `shouldInjectMemorySummary` so the default lives in one place.
39980
40212
  injectSummary: external_exports.boolean().optional()
39981
40213
  });
40214
+ var sandboxNetworkAccessSchema = external_exports.union([
40215
+ external_exports.enum(["none", "essentials"]),
40216
+ external_exports.object({
40217
+ profile: external_exports.enum(["none", "essentials"]).optional(),
40218
+ allow: external_exports.array(external_exports.string()).optional()
40219
+ })
40220
+ ]);
40221
+ var sandboxConfigSchema = external_exports.object({
40222
+ enabled: external_exports.boolean(),
40223
+ provider: external_exports.enum(["runtype-sandbox", "daytona"]).optional(),
40224
+ persistence: external_exports.enum(["ephemeral", "conversation", "named"]).optional(),
40225
+ instanceType: external_exports.enum(["standard-1", "standard-2", "standard-3", "standard-4"]).optional(),
40226
+ networkAccess: sandboxNetworkAccessSchema.optional(),
40227
+ ttl: external_exports.enum(["5m", "1h", "24h", "unlimited"]).optional(),
40228
+ sleepAfter: external_exports.enum(["5m", "15m", "30m", "1h"]).optional(),
40229
+ // Opt-in approval gate on `bash`. Default false; wiring lands in Phase 3. The
40230
+ // approval decision is on tool name + params only — never the agent's reason.
40231
+ requireApprovalForBash: external_exports.boolean().optional()
40232
+ });
39982
40233
  var agentRuntimeConfigSchema = external_exports.object({
39983
40234
  model: external_exports.string().optional(),
39984
40235
  systemPrompt: external_exports.string().optional(),
@@ -40117,7 +40368,12 @@ var agentRuntimeConfigSchema = external_exports.object({
40117
40368
  // `memoryConfigSchema` (below) and reused by the update-agent, dispatch
40118
40369
  // inline-agent, and FPO agent schemas so the four surfaces never drift —
40119
40370
  // mirroring how `temporalConfigSchema` is shared.
40120
- memory: memoryConfigSchema.optional()
40371
+ memory: memoryConfigSchema.optional(),
40372
+ // Agent Sandbox (Linux computer). When enabled, the agent gets the sandbox
40373
+ // builtin tools + system-prompt frame at dispatch. Single-sourced as
40374
+ // `sandboxConfigSchema` (above), mirroring `memory`. The live machine is agent
40375
+ // state; this block is the operator Definition that enables it.
40376
+ sandbox: sandboxConfigSchema.optional()
40121
40377
  });
40122
40378
  function extractSecretReferences(template) {
40123
40379
  const keys = /* @__PURE__ */ new Set();
@@ -43348,7 +43604,12 @@ var AgentInputSchema = external_exports.object({
43348
43604
  model: external_exports.string(),
43349
43605
  systemPrompt: external_exports.string().optional()
43350
43606
  }).optional().nullable(),
43351
- memory: memoryConfigSchema.optional()
43607
+ memory: memoryConfigSchema.optional(),
43608
+ // Agent Sandbox (Linux computer). When enabled (and the enable-agent-sandbox
43609
+ // flag is on), dispatch injects the sandbox builtin tools + system-prompt
43610
+ // frame — mirroring the saved-agent execute route so the two hosted-agent
43611
+ // entry points stay in lockstep.
43612
+ sandbox: sandboxConfigSchema.optional()
43352
43613
  }).superRefine((val, ctx) => {
43353
43614
  if (val.agentType !== "claude_managed") {
43354
43615
  if (!val.name) {
@@ -64624,8 +64885,8 @@ import { execFileSync } from "child_process";
64624
64885
  // src/lib/persona-init.ts
64625
64886
  init_credential_store();
64626
64887
 
64627
- // ../../node_modules/.pnpm/@runtypelabs+persona@3.37.0/node_modules/@runtypelabs/persona/dist/codegen.js
64628
- var S = "3.37.0";
64888
+ // ../../node_modules/.pnpm/@runtypelabs+persona@4.0.0/node_modules/@runtypelabs/persona/dist/codegen.js
64889
+ var S = "4.0.0";
64629
64890
  var c = S;
64630
64891
  function u(e) {
64631
64892
  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.10",
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.0.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.40.0"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=22.0.0"