replicas-cli 0.2.785 → 0.2.787

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.cjs +43 -12
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -22987,6 +22987,7 @@ var CODEX_ITEM_FIELD_CHECKS = {
22987
22987
  function isCodexAspTranscriptItem(value) {
22988
22988
  if (!isRecord(value) || typeof value.id !== "string" || typeof value.timestamp !== "string") return false;
22989
22989
  if (value.sequence !== void 0 && typeof value.sequence !== "number") return false;
22990
+ if (value.completedAt !== void 0 && typeof value.completedAt !== "string") return false;
22990
22991
  if (typeof value.type !== "string" || !Object.hasOwn(CODEX_ITEM_FIELD_CHECKS, value.type)) return false;
22991
22992
  return CODEX_ITEM_FIELD_CHECKS[value.type](value);
22992
22993
  }
@@ -23084,6 +23085,7 @@ function normalizeBackgroundTaskStatus(status) {
23084
23085
 
23085
23086
  // ../shared/src/display-message/constants.ts
23086
23087
  var USER_MESSAGE_MATCH_GRACE_PERIOD_MS = 3e4;
23088
+ var COMPACTION_CONTENT = "Context compacted";
23087
23089
 
23088
23090
  // ../shared/src/shell-commands.ts
23089
23091
  var SHELL_OPAQUE = "\0";
@@ -23543,6 +23545,15 @@ function skillNamesFromCommand(command) {
23543
23545
  })));
23544
23546
  }
23545
23547
 
23548
+ // ../shared/src/user-message-matching.ts
23549
+ function parseTimestampMs(timestamp) {
23550
+ const value = typeof timestamp === "number" ? timestamp : Date.parse(timestamp);
23551
+ return Number.isFinite(value) ? value : 0;
23552
+ }
23553
+ function areUserMessagesWithinMatchWindow(a, b) {
23554
+ return a.content === b.content && Math.abs(parseTimestampMs(a.timestamp) - parseTimestampMs(b.timestamp)) <= USER_MESSAGE_MATCH_GRACE_PERIOD_MS;
23555
+ }
23556
+
23546
23557
  // ../shared/src/uuid.ts
23547
23558
  var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
23548
23559
 
@@ -25796,15 +25807,6 @@ function stripAttachmentNote(text2) {
25796
25807
  };
25797
25808
  }
25798
25809
 
25799
- // ../shared/src/user-message-matching.ts
25800
- function parseTimestampMs(timestamp) {
25801
- const value = typeof timestamp === "number" ? timestamp : Date.parse(timestamp);
25802
- return Number.isFinite(value) ? value : 0;
25803
- }
25804
- function areUserMessagesWithinMatchWindow(a, b) {
25805
- return a.content === b.content && Math.abs(parseTimestampMs(a.timestamp) - parseTimestampMs(b.timestamp)) <= USER_MESSAGE_MATCH_GRACE_PERIOD_MS;
25806
- }
25807
-
25808
25810
  // ../shared/src/display-message/parsers/codex-asp-parser.ts
25809
25811
  function collectCodexTurns(events) {
25810
25812
  const turns = /* @__PURE__ */ new Map();
@@ -25977,9 +25979,10 @@ function messageForItem(item) {
25977
25979
  return {
25978
25980
  id: `reasoning-${item.id}`,
25979
25981
  type: "reasoning",
25980
- content: "Context compacted",
25982
+ content: COMPACTION_CONTENT,
25981
25983
  status: normalizeCodexAspTranscriptStatus(item.status),
25982
- timestamp: item.timestamp
25984
+ timestamp: item.timestamp,
25985
+ completedAt: item.completedAt
25983
25986
  };
25984
25987
  }
25985
25988
  return {
@@ -26773,6 +26776,15 @@ function parseMuseEvents(events) {
26773
26776
  status: terminal ? "completed" : "in_progress",
26774
26777
  timestamp: typeof item.recordedAt === "string" ? item.recordedAt : event.timestamp
26775
26778
  });
26779
+ } else if (item.kind === "compaction") {
26780
+ upsertDisplayMessage(messages, {
26781
+ id: `muse-compaction-${item.itemId}`,
26782
+ type: "reasoning",
26783
+ content: COMPACTION_CONTENT,
26784
+ status: item.status === "failed" ? "failed" : terminal ? "completed" : "in_progress",
26785
+ timestamp: typeof item.recordedAt === "string" ? item.recordedAt : event.timestamp,
26786
+ completedAt: terminal ? event.timestamp : void 0
26787
+ });
26776
26788
  } else if (item.kind === "toolCall") {
26777
26789
  let input = item.args;
26778
26790
  if (typeof item.args === "string") {
@@ -27108,6 +27120,7 @@ function parseClaudeEvents(events, parentToolUseId) {
27108
27120
  const completedStreamIds = /* @__PURE__ */ new Set();
27109
27121
  const supersededStreamIds = /* @__PURE__ */ new Set();
27110
27122
  let liveStreamId = null;
27123
+ let compaction;
27111
27124
  const assistantThinking = /* @__PURE__ */ new Map();
27112
27125
  const assistantTextCounts = /* @__PURE__ */ new Map();
27113
27126
  const acceptedUserMessageIndexes = /* @__PURE__ */ new Set();
@@ -27400,6 +27413,11 @@ function parseClaudeEvents(events, parentToolUseId) {
27400
27413
  }
27401
27414
  });
27402
27415
  }
27416
+ if (compaction && (event.type === "claude-result" || event.type === CHAT_INTERRUPTED_EVENT_TYPE)) {
27417
+ compaction.status = "failed";
27418
+ compaction.completedAt = event.timestamp;
27419
+ compaction = void 0;
27420
+ }
27403
27421
  if (event.type === "claude-result") {
27404
27422
  const payload = coerceClaudeResultPayload(event.payload);
27405
27423
  if (isClaudeResultError(payload)) {
@@ -27413,6 +27431,19 @@ function parseClaudeEvents(events, parentToolUseId) {
27413
27431
  }
27414
27432
  }
27415
27433
  if (event.type === "claude-system") {
27434
+ const { subtype, status, compact_result: compactResult } = event.payload;
27435
+ const compactionEnded = subtype === "compact_boundary" || compactResult === "failed";
27436
+ if (compactionEnded || subtype === "status" && status === "compacting") {
27437
+ if (!compaction) {
27438
+ compaction = { id: `compaction-${event.timestamp}`, type: "reasoning", content: COMPACTION_CONTENT, timestamp: event.timestamp };
27439
+ messages.push(compaction);
27440
+ }
27441
+ compaction.status = !compactionEnded ? "in_progress" : compactResult === "failed" ? "failed" : "completed";
27442
+ if (compactionEnded) {
27443
+ compaction.completedAt = event.timestamp;
27444
+ compaction = void 0;
27445
+ }
27446
+ }
27416
27447
  const payload = coerceBackgroundTaskPayload(event.payload);
27417
27448
  if (payload?.ambient) ambientTaskIds.add(payload.taskId);
27418
27449
  if (payload && !ambientTaskIds.has(payload.taskId)) {
@@ -27954,7 +27985,7 @@ var headlessAgentRequestSchema = external_exports.object({
27954
27985
  });
27955
27986
 
27956
27987
  // ../shared/src/cli-version.ts
27957
- var CLI_VERSION = "0.2.785";
27988
+ var CLI_VERSION = "0.2.787";
27958
27989
 
27959
27990
  // ../shared/src/version.ts
27960
27991
  function compareVersions(v1, v2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.2.785",
3
+ "version": "0.2.787",
4
4
  "description": "CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {