@runtypelabs/cli 2.8.1 → 2.8.3

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 +39 -24
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -175,7 +175,14 @@ var require_integration_providers = __commonJS({
175
175
  "elevenlabs"
176
176
  ]);
177
177
  function isNonAIProvider2(id) {
178
- return exports.NON_AI_PROVIDER_IDS.has(id.trim().toLowerCase());
178
+ const normalized = id.trim().toLowerCase();
179
+ if (exports.NON_AI_PROVIDER_IDS.has(normalized))
180
+ return true;
181
+ const colonIndex = normalized.indexOf(":");
182
+ if (colonIndex > 0) {
183
+ return exports.NON_AI_PROVIDER_IDS.has(normalized.slice(0, colonIndex));
184
+ }
185
+ return false;
179
186
  }
180
187
  }
181
188
  });
@@ -11727,7 +11734,6 @@ var require_generated_model_routing = __commonJS({
11727
11734
  "claude-3-opus": ["google", "vercel"],
11728
11735
  "claude-3.5-haiku": ["vercel"],
11729
11736
  "claude-3.5-sonnet": ["vercel"],
11730
- "claude-3.5-sonnet-20240620": ["vercel"],
11731
11737
  "claude-3.7-sonnet": ["vercel"],
11732
11738
  "claude-4-opus": ["vercel"],
11733
11739
  "claude-4-sonnet": ["vercel"],
@@ -12000,7 +12006,6 @@ var require_generated_model_routing = __commonJS({
12000
12006
  "llama-4-scout": ["vercel"],
12001
12007
  "Llama-4-Scout-17B-16E-Instruct": ["togetherai"],
12002
12008
  "longcat-flash-chat": ["vercel"],
12003
- "longcat-flash-thinking": ["vercel"],
12004
12009
  "longcat-flash-thinking-2601": ["vercel"],
12005
12010
  "magistral-medium": ["vercel"],
12006
12011
  "magistral-small": ["vercel"],
@@ -12451,7 +12456,6 @@ var require_generated_model_routing = __commonJS({
12451
12456
  "llama3-1-70b": ["vercel"],
12452
12457
  "llama3-1-8b": ["vercel"],
12453
12458
  "llama3-3-70b": ["vercel"],
12454
- "longcat-flash": ["vercel"],
12455
12459
  "longcat-flash-chat": ["vercel"],
12456
12460
  "longcat-flash-thinking-2601": ["vercel"],
12457
12461
  "magistral-medium": ["vercel"],
@@ -12678,7 +12682,7 @@ var require_generated_model_routing = __commonJS({
12678
12682
  "claude-3-5-sonnet": {
12679
12683
  "bedrock": "bedrock/claude-3-5-sonnet",
12680
12684
  "google": "google/claude-3-5-sonnet",
12681
- "vercel": "anthropic/claude-3.5-sonnet-20240620"
12685
+ "vercel": "anthropic/claude-3.5-sonnet"
12682
12686
  },
12683
12687
  "claude-3-7-sonnet": {
12684
12688
  "bedrock": "bedrock/claude-3-7-sonnet",
@@ -12703,9 +12707,6 @@ var require_generated_model_routing = __commonJS({
12703
12707
  "claude-3.5-sonnet": {
12704
12708
  "vercel": "anthropic/claude-3.5-sonnet"
12705
12709
  },
12706
- "claude-3.5-sonnet-20240620": {
12707
- "vercel": "anthropic/claude-3.5-sonnet-20240620"
12708
- },
12709
12710
  "claude-3.7-sonnet": {
12710
12711
  "vercel": "anthropic/claude-3.7-sonnet"
12711
12712
  },
@@ -13865,15 +13866,9 @@ var require_generated_model_routing = __commonJS({
13865
13866
  "llama3-3-70b": {
13866
13867
  "vercel": "meta/llama-3-3-70b"
13867
13868
  },
13868
- "longcat-flash": {
13869
- "vercel": "meituan/longcat-flash-thinking"
13870
- },
13871
13869
  "longcat-flash-chat": {
13872
13870
  "vercel": "meituan/longcat-flash-chat"
13873
13871
  },
13874
- "longcat-flash-thinking": {
13875
- "vercel": "meituan/longcat-flash-thinking"
13876
- },
13877
13872
  "longcat-flash-thinking-2601": {
13878
13873
  "vercel": "meituan/longcat-flash-thinking-2601"
13879
13874
  },
@@ -24178,6 +24173,8 @@ function getLatestSessionTabKey(sessionSnapshots, liveSnapshot) {
24178
24173
  return latestSnapshot ? createSessionTabKey(latestSnapshot.sessionIndex) : void 0;
24179
24174
  }
24180
24175
  function getSessionTabBaseTitle(snapshot) {
24176
+ if (snapshot.status === "error") return `Run ${snapshot.sessionIndex} \u2717`;
24177
+ if (snapshot.status === "budget_exceeded") return `Run ${snapshot.sessionIndex} $`;
24181
24178
  return `Run ${snapshot.sessionIndex}${snapshot.status === "live" ? "*" : ""}`;
24182
24179
  }
24183
24180
  function estimateRenderedTabWidth(tab) {
@@ -24315,17 +24312,19 @@ function upsertSessionSnapshots(snapshots, nextSnapshot) {
24315
24312
  return result;
24316
24313
  }
24317
24314
  function buildLiveSessionSnapshot(liveState, rawEvents, sessionIndex, model) {
24318
- const hasLiveState = liveState.phase === "thinking" || Boolean(liveState.content) || Boolean(liveState.reasoning) || liveState.tools.length > 0 || rawEvents.length > 0 || Boolean(liveState.contextCompaction?.active);
24315
+ const isError = liveState.phase === "error";
24316
+ const hasLiveState = liveState.phase === "thinking" || isError || Boolean(liveState.content) || Boolean(liveState.reasoning) || liveState.tools.length > 0 || rawEvents.length > 0 || Boolean(liveState.contextCompaction?.active);
24319
24317
  if (!hasLiveState) return void 0;
24320
24318
  return {
24321
24319
  sessionIndex,
24322
- status: "live",
24320
+ status: isError ? "error" : "live",
24323
24321
  model,
24324
24322
  cost: liveState.totalCost,
24325
24323
  content: liveState.content,
24326
24324
  reasoning: liveState.reasoning,
24327
24325
  tools: liveState.tools,
24328
- rawEvents
24326
+ rawEvents,
24327
+ ...isError && liveState.error ? { errorMessage: liveState.error.message } : {}
24329
24328
  };
24330
24329
  }
24331
24330
  function copyToClipboard(text) {
@@ -24658,6 +24657,15 @@ function MarathonApp({
24658
24657
  );
24659
24658
  }, [followLatest, liveSessionKey, liveSessionSnapshot, selectedSessionKey, sessionSnapshots]);
24660
24659
  const selectedIsLive = displayedSessionSnapshot?.status === "live";
24660
+ const displayedError = useMemo11(() => {
24661
+ if (selectedIsLive) return state.error;
24662
+ if (displayedSessionSnapshot?.status === "error") {
24663
+ return new Error(
24664
+ displayedSessionSnapshot.errorMessage || "Session ended with an error."
24665
+ );
24666
+ }
24667
+ return null;
24668
+ }, [selectedIsLive, state.error, displayedSessionSnapshot]);
24661
24669
  const displayedContent = displayedSessionSnapshot?.content ?? state.content;
24662
24670
  const displayedReasoning = displayedSessionSnapshot?.reasoning ?? state.reasoning;
24663
24671
  const displayedTools = displayedSessionSnapshot?.tools ?? state.tools;
@@ -25588,7 +25596,7 @@ function MarathonApp({
25588
25596
  thinkingStartedAt: state.thinkingStartedAt,
25589
25597
  contextCompaction: showContextCompactionIndicator ? state.contextCompaction : null,
25590
25598
  showUpgradeBrowseHint,
25591
- error: selectedIsLive && !upgradePrompt ? state.error : null
25599
+ error: upgradePrompt ? null : displayedError
25592
25600
  }
25593
25601
  )
25594
25602
  }
@@ -26825,7 +26833,8 @@ function sanitizeMarathonSessionSnapshots(snapshots) {
26825
26833
  })),
26826
26834
  ...typeof snapshot.stopReason === "string" ? { stopReason: snapshot.stopReason } : {},
26827
26835
  ...typeof snapshot.completedAt === "string" ? { completedAt: snapshot.completedAt } : {},
26828
- ...typeof snapshot.model === "string" ? { model: snapshot.model } : {}
26836
+ ...typeof snapshot.model === "string" ? { model: snapshot.model } : {},
26837
+ ...typeof snapshot.errorMessage === "string" ? { errorMessage: snapshot.errorMessage } : {}
26829
26838
  };
26830
26839
  bySessionIndex.set(sanitizedSnapshot.sessionIndex, sanitizedSnapshot);
26831
26840
  }
@@ -26850,7 +26859,7 @@ function mergeMarathonSessionSummaries(existingSessions, nextSessions, offset) {
26850
26859
  }
26851
26860
  return Array.from(byIndex.values()).sort((left, right) => left.index - right.index);
26852
26861
  }
26853
- function buildMarathonSessionSnapshot(liveState, sessionSummary, model, status = "complete") {
26862
+ function buildMarathonSessionSnapshot(liveState, sessionSummary, model, status = "complete", errorMessage) {
26854
26863
  return {
26855
26864
  sessionIndex: sessionSummary.index,
26856
26865
  status,
@@ -26868,7 +26877,8 @@ function buildMarathonSessionSnapshot(liveState, sessionSummary, model, status =
26868
26877
  rawEvents: liveState.rawEvents.map((event) => ({
26869
26878
  ...event,
26870
26879
  data: structuredClone(event.data)
26871
- }))
26880
+ })),
26881
+ ...errorMessage ? { errorMessage } : {}
26872
26882
  };
26873
26883
  }
26874
26884
  function mapRunTaskStatusToSnapshotStatus(status, fallback) {
@@ -29594,6 +29604,7 @@ Saving state... done. Session saved to ${filePath}`);
29594
29604
  const latestSessionSummary2 = persistedSessionSummaries[persistedSessionSummaries.length - 1];
29595
29605
  if (currentActions && latestSessionSummary2) {
29596
29606
  const liveState = currentActions.getState();
29607
+ const snapshotStatus = mapRunTaskStatusToSnapshotStatus(state.status, "complete");
29597
29608
  const sessionSnapshot = buildMarathonSessionSnapshot(
29598
29609
  {
29599
29610
  content: liveState.content,
@@ -29603,7 +29614,9 @@ Saving state... done. Session saved to ${filePath}`);
29603
29614
  sessionSnapshots: []
29604
29615
  },
29605
29616
  latestSessionSummary2,
29606
- options.model
29617
+ options.model,
29618
+ snapshotStatus,
29619
+ snapshotStatus === "error" ? state.lastError : void 0
29607
29620
  );
29608
29621
  persistedSessionSnapshots = upsertMarathonSessionSnapshot(
29609
29622
  persistedSessionSnapshots,
@@ -29758,14 +29771,16 @@ Saving state... done. Session saved to ${filePath}`);
29758
29771
  const completedTools = existingSnapshot.tools.map(
29759
29772
  (t) => t.status === "running" ? { ...t, status: "complete", executionTime: Date.now() - t.startedAt } : t
29760
29773
  );
29774
+ const finalStatus = mapRunTaskStatusToSnapshotStatus(result2.status, existingSnapshot.status);
29761
29775
  const updatedSnapshot = {
29762
29776
  ...existingSnapshot,
29763
- status: mapRunTaskStatusToSnapshotStatus(result2.status, existingSnapshot.status),
29777
+ status: finalStatus,
29764
29778
  stopReason: latestSessionSummary.stopReason,
29765
29779
  cost: latestSessionSummary.cost,
29766
29780
  completedAt: latestSessionSummary.completedAt,
29767
29781
  model: options.model,
29768
- tools: completedTools
29782
+ tools: completedTools,
29783
+ ...finalStatus === "error" && lastKnownState?.lastError ? { errorMessage: lastKnownState.lastError } : {}
29769
29784
  };
29770
29785
  persistedSessionSnapshots = upsertMarathonSessionSnapshot(persistedSessionSnapshots, updatedSnapshot);
29771
29786
  streamRef.current?.appendSessionSnapshot(updatedSnapshot);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/cli",
3
- "version": "2.8.1",
3
+ "version": "2.8.3",
4
4
  "description": "Command-line interface for Runtype AI platform",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -37,7 +37,7 @@
37
37
  "tsx": "^4.7.1",
38
38
  "typescript": "^5.3.3",
39
39
  "vitest": "^4.0.18",
40
- "@runtypelabs/shared": "1.1.1"
40
+ "@runtypelabs/shared": "1.3.0"
41
41
  },
42
42
  "engines": {
43
43
  "node": ">=18.0.0"