@runtypelabs/cli 2.19.3 → 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 +23 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -48784,6 +48784,27 @@ import chalk17 from "chalk";
48784
48784
  import React14 from "react";
48785
48785
  import { render as render14 } from "ink";
48786
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
+ }
48787
48808
  var conversationsCommand = new Command15("conversations").description("Manage conversations");
48788
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) => {
48789
48810
  const apiKey = await ensureAuth();
@@ -48890,7 +48911,7 @@ Messages (${messages.length}):`));
48890
48911
  } else {
48891
48912
  for (const msg of messages) {
48892
48913
  const roleColor = msg.role === "user" ? chalk17.blue : msg.role === "assistant" ? chalk17.green : chalk17.gray;
48893
- console.log(` ${roleColor(msg.role)}: ${msg.content}`);
48914
+ console.log(` ${roleColor(msg.role)}: ${renderMessageContent(msg.content)}`);
48894
48915
  if (msg.createdAt) {
48895
48916
  console.log(chalk17.dim(` ${msg.createdAt}`));
48896
48917
  }
@@ -48913,7 +48934,7 @@ Messages (${messages.length}):`));
48913
48934
  try {
48914
48935
  const data = await client.get(`/conversations/${id}`);
48915
48936
  const messages = data.messages ?? [];
48916
- 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");
48917
48938
  setResultNode(
48918
48939
  React14.createElement(EntityCard, {
48919
48940
  fields: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/cli",
3
- "version": "2.19.3",
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",
@@ -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.28.1"
42
+ "@runtypelabs/shared": "1.29.0"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=22.0.0"