replicas-cli 0.2.380 → 0.2.381

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 +12 -1
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -24360,7 +24360,7 @@ var HOOK_EXEC_MAX_BUFFER_BYTES = 10 * 1024 * 1024;
24360
24360
  var REPLICAS_CONFIG_FILENAMES = ["replicas.json", "replicas.yaml", "replicas.yml"];
24361
24361
 
24362
24362
  // ../shared/src/cli-version.ts
24363
- var CLI_VERSION = "0.2.380";
24363
+ var CLI_VERSION = "0.2.381";
24364
24364
 
24365
24365
  // ../shared/src/version.ts
24366
24366
  function compareVersions(v1, v2) {
@@ -25200,6 +25200,10 @@ function setById2(messages, id, message) {
25200
25200
  function toolStatus2(value) {
25201
25201
  return value === "completed" || value === "success" ? "completed" : value === "error" ? "failed" : "in_progress";
25202
25202
  }
25203
+ function assistantErrorMessage(value) {
25204
+ if (!isRecord(value) || value.role !== "assistant" || value.stopReason !== "error") return null;
25205
+ return typeof value.errorMessage === "string" && value.errorMessage ? value.errorMessage : "Pi run failed";
25206
+ }
25203
25207
  function parsePiEvents(events) {
25204
25208
  const messages = [];
25205
25209
  const text = /* @__PURE__ */ new Map();
@@ -25214,6 +25218,13 @@ function parsePiEvents(events) {
25214
25218
  messages.push({ id: `pi-error-${event.timestamp}-${messages.length}`, type: "error", message: String(event.payload.message ?? "Pi run failed"), timestamp: event.timestamp });
25215
25219
  continue;
25216
25220
  }
25221
+ if (event.type === "pi-message_end") {
25222
+ const error51 = assistantErrorMessage(event.payload.message);
25223
+ if (error51) {
25224
+ messages.push({ id: `pi-error-${event.timestamp}-${messages.length}`, type: "error", message: error51, timestamp: event.timestamp });
25225
+ }
25226
+ continue;
25227
+ }
25217
25228
  if (event.type === "pi-message_update") {
25218
25229
  const payload = nestedPayload(event);
25219
25230
  const id = typeof payload.id === "string" ? payload.id : activeMessageId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.2.380",
3
+ "version": "0.2.381",
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": {