replicas-cli 0.2.210 → 0.2.212

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 +38 -4
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -8932,7 +8932,7 @@ var HOOK_EXEC_MAX_BUFFER_BYTES = 10 * 1024 * 1024;
8932
8932
  var REPLICAS_CONFIG_FILENAMES = ["replicas.json", "replicas.yaml", "replicas.yml"];
8933
8933
 
8934
8934
  // ../shared/src/cli-version.ts
8935
- var CLI_VERSION = "0.2.210";
8935
+ var CLI_VERSION = "0.2.212";
8936
8936
 
8937
8937
  // ../shared/src/engine/environment.ts
8938
8938
  var DESKTOP_NOVNC_PORT = 6080;
@@ -9112,7 +9112,13 @@ function coerceBackgroundTaskPayload(payload) {
9112
9112
  const patch = isRecord(payload.patch) ? {
9113
9113
  status: optionalString(payload.patch.status),
9114
9114
  description: optionalString(payload.patch.description),
9115
- error: optionalString(payload.patch.error)
9115
+ error: optionalString(payload.patch.error),
9116
+ isBackgrounded: optionalBoolean(payload.patch.is_backgrounded)
9117
+ } : void 0;
9118
+ const usage = isRecord(payload.usage) ? {
9119
+ totalTokens: optionalNumber(payload.usage.total_tokens),
9120
+ toolUses: optionalNumber(payload.usage.tool_uses),
9121
+ durationMs: optionalNumber(payload.usage.duration_ms)
9116
9122
  } : void 0;
9117
9123
  return {
9118
9124
  subtype,
@@ -9121,9 +9127,20 @@ function coerceBackgroundTaskPayload(payload) {
9121
9127
  summary: optionalString(payload.summary),
9122
9128
  outputFile: optionalString(payload.output_file),
9123
9129
  status: optionalString(payload.status),
9130
+ taskType: optionalString(payload.task_type),
9131
+ workflowName: optionalString(payload.workflow_name),
9132
+ prompt: optionalString(payload.prompt),
9133
+ lastToolName: optionalString(payload.last_tool_name),
9134
+ usage,
9124
9135
  patch
9125
9136
  };
9126
9137
  }
9138
+ function optionalNumber(value) {
9139
+ return typeof value === "number" && Number.isFinite(value) ? value : void 0;
9140
+ }
9141
+ function optionalBoolean(value) {
9142
+ return typeof value === "boolean" ? value : void 0;
9143
+ }
9127
9144
  function normalizeBackgroundTaskStatus(status) {
9128
9145
  if (status === "completed" || status === "failed" || status === "stopped") {
9129
9146
  return status;
@@ -9155,6 +9172,14 @@ function displayId(event, eventIndex, prefix) {
9155
9172
  const stableId = getPayloadString(event, USER_MESSAGE_ID_PAYLOAD_KEY) ?? getPayloadString(event, CODEX_ASP_ITEM_ID_PAYLOAD_KEY);
9156
9173
  return stableId ? `${prefix}-${stableId}` : `${prefix}-${event.timestamp}-${eventIndex}`;
9157
9174
  }
9175
+ function userMessageImages(value) {
9176
+ if (!Array.isArray(value)) return void 0;
9177
+ const images = value.filter((item) => {
9178
+ if (!isRecord(item)) return false;
9179
+ return item.type === "image" && typeof item.mediaType === "string" && typeof item.data === "string";
9180
+ });
9181
+ return images.length > 0 ? images : void 0;
9182
+ }
9158
9183
  function parseShellOutput(raw) {
9159
9184
  const exitCodeMatch = raw.match(/^Exit code: (\d+)/m) || raw.match(/Process exited with code (\d+)/);
9160
9185
  const exitCode = exitCodeMatch ? parseInt(exitCodeMatch[1], 10) : 0;
@@ -9238,10 +9263,12 @@ function parseCodexEvents(events) {
9238
9263
  return;
9239
9264
  }
9240
9265
  if (event.type === "event_msg" && event.payload?.type === "user_message") {
9266
+ const message = getPayloadString(event, "message");
9241
9267
  messages.push({
9242
9268
  id: displayId(event, eventIndex, "user"),
9243
9269
  type: "user",
9244
- content: event.payload.message || "",
9270
+ content: message ?? "",
9271
+ images: userMessageImages(event.payload.images),
9245
9272
  timestamp: event.timestamp
9246
9273
  });
9247
9274
  }
@@ -9753,8 +9780,15 @@ function parseClaudeEvents(events, parentToolUseId) {
9753
9780
  taskId: payload.taskId,
9754
9781
  status: nextStatus,
9755
9782
  description: payload.description ?? payload.patch?.description ?? existing?.description,
9756
- summary: payload.summary ?? payload.patch?.error ?? existing?.summary,
9783
+ summary: payload.summary ?? existing?.summary,
9757
9784
  outputFile: payload.outputFile ?? existing?.outputFile,
9785
+ taskType: payload.taskType ?? existing?.taskType,
9786
+ workflowName: payload.workflowName ?? existing?.workflowName,
9787
+ prompt: payload.prompt ?? existing?.prompt,
9788
+ lastToolName: payload.lastToolName ?? existing?.lastToolName,
9789
+ usage: payload.usage ?? existing?.usage,
9790
+ error: payload.patch?.error ?? existing?.error,
9791
+ isBackgrounded: payload.patch?.isBackgrounded ?? existing?.isBackgrounded,
9758
9792
  timestamp: existing?.timestamp ?? event.timestamp
9759
9793
  };
9760
9794
  if (existing) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.2.210",
3
+ "version": "0.2.212",
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": {