replicas-cli 0.2.418 → 0.2.419

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.mjs +11 -20
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -24478,7 +24478,7 @@ function formatTurnElapsed(ms) {
24478
24478
  }
24479
24479
 
24480
24480
  // ../shared/src/cli-version.ts
24481
- var CLI_VERSION = "0.2.418";
24481
+ var CLI_VERSION = "0.2.419";
24482
24482
 
24483
24483
  // ../shared/src/version.ts
24484
24484
  function compareVersions(v1, v2) {
@@ -25623,14 +25623,21 @@ function parseMcpToolName(name) {
25623
25623
  }
25624
25624
 
25625
25625
  // ../shared/src/display-message/parsers/claude-parser.ts
25626
+ var ABORTED_TERMINAL_REASONS = /* @__PURE__ */ new Set(["aborted_streaming", "aborted_tools"]);
25626
25627
  function coerceClaudeResultPayload(payload) {
25627
25628
  return {
25628
25629
  is_error: typeof payload.is_error === "boolean" ? payload.is_error : void 0,
25629
25630
  subtype: typeof payload.subtype === "string" ? payload.subtype : void 0,
25630
- errors: Array.isArray(payload.errors) ? payload.errors.filter((e) => typeof e === "string") : void 0
25631
+ errors: Array.isArray(payload.errors) ? payload.errors.filter((e) => typeof e === "string") : void 0,
25632
+ terminal_reason: typeof payload.terminal_reason === "string" ? payload.terminal_reason : void 0
25631
25633
  };
25632
25634
  }
25635
+ function stripAgentDiagnosticErrors(errors) {
25636
+ return errors.filter((error51) => !error51.startsWith("[ede_diagnostic]"));
25637
+ }
25633
25638
  function isClaudeResultError(payload) {
25639
+ if (payload.terminal_reason && ABORTED_TERMINAL_REASONS.has(payload.terminal_reason)) return false;
25640
+ if (payload.errors?.length && stripAgentDiagnosticErrors(payload.errors).length === 0) return false;
25634
25641
  return Boolean(payload.is_error) || payload.subtype !== "success";
25635
25642
  }
25636
25643
  function upsertDisplayMessage(messages, message) {
@@ -25665,7 +25672,6 @@ function parseClaudeEvents(events, parentToolUseId) {
25665
25672
  return message?.type === "user" && areUserMessagesWithinMatchWindow(message, { content, timestamp });
25666
25673
  });
25667
25674
  };
25668
- let turnWasInterrupted = false;
25669
25675
  const taskAccumulator = new TaskAccumulator();
25670
25676
  const taskSnapshot = () => taskAccumulator.getTasks().map((task) => ({
25671
25677
  text: task.subject,
@@ -25744,7 +25750,6 @@ function parseClaudeEvents(events, parentToolUseId) {
25744
25750
  if (LOCAL_COMMAND_ECHO_REGEX.test(textContent.trim())) {
25745
25751
  return;
25746
25752
  }
25747
- turnWasInterrupted = INTERRUPTED_MESSAGE_REGEX.test(textContent.trim());
25748
25753
  const images = content.filter((c) => c.type === "image" && c.source).map((c) => {
25749
25754
  const source = c.source;
25750
25755
  return {
@@ -25993,26 +25998,12 @@ function parseClaudeEvents(events, parentToolUseId) {
25993
25998
  }
25994
25999
  if (event.type === "claude-result") {
25995
26000
  const payload = coerceClaudeResultPayload(event.payload);
25996
- const errorList = payload.errors || [];
25997
- if (turnWasInterrupted) {
25998
- turnWasInterrupted = false;
25999
- const genuineErrors = errorList.filter((e) => !e.includes("[ede_diagnostic]"));
26000
- if (genuineErrors.length > 0) {
26001
- messages.push({
26002
- id: `error-${event.timestamp}`,
26003
- type: "error",
26004
- message: genuineErrors.join("\n"),
26005
- timestamp: event.timestamp
26006
- });
26007
- }
26008
- return;
26009
- }
26010
26001
  if (isClaudeResultError(payload)) {
26011
- const errorMessage = errorList.length > 0 ? errorList.join("\n") : "Claude session encountered an unexpected error.";
26002
+ const genuineErrors = stripAgentDiagnosticErrors(payload.errors ?? []);
26012
26003
  messages.push({
26013
26004
  id: `error-${event.timestamp}`,
26014
26005
  type: "error",
26015
- message: errorMessage,
26006
+ message: genuineErrors.length > 0 ? genuineErrors.join("\n") : "Claude session encountered an unexpected error.",
26016
26007
  timestamp: event.timestamp
26017
26008
  });
26018
26009
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.2.418",
3
+ "version": "0.2.419",
4
4
  "description": "CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding",
5
5
  "main": "dist/index.mjs",
6
6
  "bin": {