@runtypelabs/cli 2.19.2 → 2.19.4

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 +41 -9
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -15164,7 +15164,7 @@ var apiRoutingDocSchema = external_exports.object({
15164
15164
  path: ["api", "activeScript"]
15165
15165
  });
15166
15166
 
15167
- // ../shared/dist/chunk-7Y2SRVP7.mjs
15167
+ // ../shared/dist/chunk-KR4LFVFE.mjs
15168
15168
  function getNestedValue(obj, path18) {
15169
15169
  let normalizedPath = path18;
15170
15170
  normalizedPath = normalizedPath.replace(/^\$\.?/, "");
@@ -15200,6 +15200,12 @@ function getNestedValue(obj, path18) {
15200
15200
  return current;
15201
15201
  }
15202
15202
  var DANGEROUS_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
15203
+ var MESSAGE_VARIABLES = /* @__PURE__ */ new Set([
15204
+ "messages",
15205
+ "userMessage",
15206
+ "lastMessage",
15207
+ "messageCount"
15208
+ ]);
15203
15209
  var SYSTEM_VARIABLES = /* @__PURE__ */ new Set([
15204
15210
  "_flow",
15205
15211
  "_user",
@@ -15215,10 +15221,7 @@ var SYSTEM_VARIABLES = /* @__PURE__ */ new Set([
15215
15221
  // it as undeclared and the executors don't report it as "unresolved" before
15216
15222
  // injection runs.
15217
15223
  "_tools",
15218
- "messages",
15219
- "userMessage",
15220
- "lastMessage",
15221
- "messageCount"
15224
+ ...MESSAGE_VARIABLES
15222
15225
  ]);
15223
15226
  var SECRET_REF_PATTERN = /\{\{secret:([A-Z][A-Z0-9_]*[A-Z0-9])\}\}/g;
15224
15227
  var RUNTIME_PREFIXES = {
@@ -15547,8 +15550,12 @@ function resolveFallback(parsed, context, tracking) {
15547
15550
  var templateEngine = new SimpleTemplateEngine();
15548
15551
 
15549
15552
  // ../shared/dist/index.mjs
15553
+ var FORMULA_TRIGGER = /^[=+\-@\t\r\n]/;
15554
+ var STRICT_NUMBER = /^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/;
15550
15555
  function neutralizeCsvFormula(value) {
15551
- return /^[=+\-@\t\r\n]/.test(value) ? `'${value}` : value;
15556
+ if (!FORMULA_TRIGGER.test(value)) return value;
15557
+ if (STRICT_NUMBER.test(value)) return value;
15558
+ return `'${value}`;
15552
15559
  }
15553
15560
  var mediaAnnotationsSchema = external_exports.object({
15554
15561
  audience: external_exports.array(external_exports.enum(["user", "assistant"])).optional()
@@ -19687,6 +19694,10 @@ function collectDeclaredFlowInputs(flowSteps, declaredFlowInputs) {
19687
19694
  }
19688
19695
  return declared;
19689
19696
  }
19697
+ var NAMESPACE_VARIABLE_REFERENCE_CODES = [
19698
+ "UNDECLARED_VARIABLE_REFERENCE",
19699
+ "UNKNOWN_VARIABLE_NAMESPACE"
19700
+ ];
19690
19701
  function validateVariableReferences(flowSteps, buckets, skipStepIndices, declaredFlowInputs) {
19691
19702
  const declaredVariables = collectDeclaredFlowInputs(flowSteps, declaredFlowInputs);
19692
19703
  for (const [stepIndex, step] of flowSteps.entries()) {
@@ -39851,7 +39862,7 @@ function mergeResults(...results) {
39851
39862
  merged.valid = merged.errors.length === 0;
39852
39863
  return merged;
39853
39864
  }
39854
- var NAMESPACE_VARIABLE_CODES = /* @__PURE__ */ new Set(["UNDECLARED_VARIABLE_REFERENCE", "UNKNOWN_VARIABLE_NAMESPACE"]);
39865
+ var NAMESPACE_VARIABLE_CODES = new Set(NAMESPACE_VARIABLE_REFERENCE_CODES);
39855
39866
  function validateFlowDefinition(flow, capIndex, context) {
39856
39867
  const result = emptyResult();
39857
39868
  const base = `capabilities[${capIndex}].flow`;
@@ -48773,6 +48784,27 @@ import chalk17 from "chalk";
48773
48784
  import React14 from "react";
48774
48785
  import { render as render14 } from "ink";
48775
48786
  import { useState as useState15, useEffect as useEffect16 } from "react";
48787
+ function renderMessageContent(content) {
48788
+ if (typeof content === "string") return content;
48789
+ if (!Array.isArray(content)) return content == null ? "" : String(content);
48790
+ return content.map((part) => {
48791
+ if (part == null || typeof part !== "object") return part == null ? "" : String(part);
48792
+ const p = part;
48793
+ switch (p.type) {
48794
+ case "text":
48795
+ case "reasoning":
48796
+ return typeof p.text === "string" ? p.text : "";
48797
+ case "image":
48798
+ return `[image${"mimeType" in p && p.mimeType ? ` ${p.mimeType}` : ""}]`;
48799
+ case "file":
48800
+ return `[file${"filename" in p && p.filename ? ` ${p.filename}` : ""}${"mimeType" in p && p.mimeType ? ` (${p.mimeType})` : ""}]`;
48801
+ case "asset_ref":
48802
+ return `[attachment${"filename" in p && p.filename ? ` ${p.filename}` : ""}${"mimeType" in p && p.mimeType ? ` ${p.mimeType}` : ""}]`;
48803
+ default:
48804
+ return typeof p.type === "string" ? `[${p.type}]` : "";
48805
+ }
48806
+ }).filter((s) => s.length > 0).join(" ");
48807
+ }
48776
48808
  var conversationsCommand = new Command15("conversations").description("Manage conversations");
48777
48809
  conversationsCommand.command("list").description("List your conversations").option("--limit <n>", "Limit results (defaults to the API page size)").option("--cursor <cursor>", "Pagination cursor for the next page").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(async (options) => {
48778
48810
  const apiKey = await ensureAuth();
@@ -48879,7 +48911,7 @@ Messages (${messages.length}):`));
48879
48911
  } else {
48880
48912
  for (const msg of messages) {
48881
48913
  const roleColor = msg.role === "user" ? chalk17.blue : msg.role === "assistant" ? chalk17.green : chalk17.gray;
48882
- console.log(` ${roleColor(msg.role)}: ${msg.content}`);
48914
+ console.log(` ${roleColor(msg.role)}: ${renderMessageContent(msg.content)}`);
48883
48915
  if (msg.createdAt) {
48884
48916
  console.log(chalk17.dim(` ${msg.createdAt}`));
48885
48917
  }
@@ -48902,7 +48934,7 @@ Messages (${messages.length}):`));
48902
48934
  try {
48903
48935
  const data = await client.get(`/conversations/${id}`);
48904
48936
  const messages = data.messages ?? [];
48905
- const messageSummary = messages.length === 0 ? "No messages" : messages.map((m2) => `${m2.role}: ${m2.content}`).join("\n");
48937
+ const messageSummary = messages.length === 0 ? "No messages" : messages.map((m2) => `${m2.role}: ${renderMessageContent(m2.content)}`).join("\n");
48906
48938
  setResultNode(
48907
48939
  React14.createElement(EntityCard, {
48908
48940
  fields: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/cli",
3
- "version": "2.19.2",
3
+ "version": "2.19.4",
4
4
  "description": "Command-line interface for Runtype AI platform",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -24,7 +24,7 @@
24
24
  "rosie-skills": "0.8.1",
25
25
  "yaml": "^2.9.0",
26
26
  "@runtypelabs/ink-components": "0.3.2",
27
- "@runtypelabs/sdk": "4.13.0",
27
+ "@runtypelabs/sdk": "4.13.1",
28
28
  "@runtypelabs/terminal-animations": "0.2.1"
29
29
  },
30
30
  "devDependencies": {
@@ -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.27.0"
42
+ "@runtypelabs/shared": "1.29.0"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=22.0.0"