replicas-cli 0.2.786 → 0.2.788

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