replicas-cli 0.3.79 → 0.3.80

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 +14 -13
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -26331,7 +26331,7 @@ function removeTag(text3, tag) {
26331
26331
  const regex = new RegExp(`<${tag}>[\\s\\S]*?</${tag}>`, "g");
26332
26332
  return text3.replace(regex, "").trim();
26333
26333
  }
26334
- function removeReplicasInstructions(text3) {
26334
+ function stripReplicasInstructionBlock(text3) {
26335
26335
  return removeTag(text3, REPLICAS_INSTRUCTIONS_TAG);
26336
26336
  }
26337
26337
  var MOTHERSHIP_INSTRUCTIONS_BLOCK = new RegExp(`\\s*<${MOTHERSHIP_INSTRUCTIONS_TAG}>\\n([\\s\\S]*?)\\n</${MOTHERSHIP_INSTRUCTIONS_TAG}>`);
@@ -26726,8 +26726,8 @@ function takeRecordedPrompt(prompts3, echo, turnIndex) {
26726
26726
  const distance = Math.abs(candidate.timestampMs - timestampMs);
26727
26727
  if (distance > closestDistance) continue;
26728
26728
  if (candidate.index >= turnIndex && !areUserMessagesWithinMatchWindow(
26729
- { content: candidate.message.content, timestamp: candidate.timestampMs },
26730
- { content: echo.content, timestamp: timestampMs }
26729
+ { content: stripReplicasInstructionBlock(candidate.message.content), timestamp: candidate.timestampMs },
26730
+ { content: stripReplicasInstructionBlock(echo.content), timestamp: timestampMs }
26731
26731
  )) continue;
26732
26732
  const images = candidate.message.images;
26733
26733
  if (images && echo.images && (images.length !== echo.images.length || images.some((image, index) => image.mediaType !== echo.images?.[index].mediaType || image.data !== echo.images?.[index].data))) continue;
@@ -26922,9 +26922,10 @@ function parseCodexEvents(events) {
26922
26922
  const recordedPrompts = /* @__PURE__ */ new Map();
26923
26923
  messages.forEach((message2, index) => {
26924
26924
  if (message2.type !== "user") return;
26925
- const prompts3 = recordedPrompts.get(message2.content) ?? [];
26925
+ const content = stripReplicasInstructionBlock(message2.content);
26926
+ const prompts3 = recordedPrompts.get(content) ?? [];
26926
26927
  prompts3.push({ message: message2, index, timestampMs: parseTimestampMs(message2.timestamp) });
26927
- recordedPrompts.set(message2.content, prompts3);
26928
+ recordedPrompts.set(content, prompts3);
26928
26929
  });
26929
26930
  const claimedPrompts = /* @__PURE__ */ new Set();
26930
26931
  for (const { index, turnId } of turnInsertions.reverse()) {
@@ -26936,7 +26937,7 @@ function parseCodexEvents(events) {
26936
26937
  kept.push(message2);
26937
26938
  continue;
26938
26939
  }
26939
- const prompts3 = recordedPrompts.get(message2.content);
26940
+ const prompts3 = recordedPrompts.get(stripReplicasInstructionBlock(message2.content));
26940
26941
  const recorded = prompts3 && takeRecordedPrompt(prompts3, message2, index);
26941
26942
  if (!recorded) {
26942
26943
  kept.push(message2);
@@ -28321,7 +28322,7 @@ function applyEngineNotices(messages, events) {
28321
28322
  return result;
28322
28323
  }
28323
28324
  function isCodexInitializationPrompt(message2) {
28324
- return message2.type === "user" && removeReplicasInstructions(message2.content).trim() === "Hello";
28325
+ return message2.type === "user" && stripReplicasInstructionBlock(message2.content).trim() === "Hello";
28325
28326
  }
28326
28327
  function filterDisplayMessages(messages, provider2) {
28327
28328
  let result = messages;
@@ -28333,7 +28334,7 @@ function filterDisplayMessages(messages, provider2) {
28333
28334
  }
28334
28335
  result = result.flatMap((msg) => {
28335
28336
  if (msg.type !== "user") return [msg];
28336
- const { content, files, walkthroughs } = stripAttachmentNote(removeReplicasInstructions(msg.content).trim());
28337
+ const { content, files, walkthroughs } = stripAttachmentNote(stripReplicasInstructionBlock(msg.content).trim());
28337
28338
  if (INTERRUPTED_MESSAGE_REGEX.test(content)) {
28338
28339
  return [{ id: msg.id, type: "interruption", timestamp: msg.timestamp }];
28339
28340
  }
@@ -28645,7 +28646,7 @@ var headlessAgentRequestSchema = external_exports.object({
28645
28646
  });
28646
28647
 
28647
28648
  // ../shared/src/cli-version.ts
28648
- var CLI_VERSION = "0.3.79";
28649
+ var CLI_VERSION = "0.3.80";
28649
28650
 
28650
28651
  // ../shared/src/version.ts
28651
28652
  function compareVersions(v1, v2) {
@@ -29520,7 +29521,7 @@ async function authenticatedFetch(url2, options) {
29520
29521
 
29521
29522
  // src/lib/output.ts
29522
29523
  var import_chalk = __toESM(require("chalk"));
29523
- var import_prompts5 = __toESM(require("prompts"));
29524
+ var import_prompts6 = __toESM(require("prompts"));
29524
29525
  var jsonMode = false;
29525
29526
  function enableJsonMode() {
29526
29527
  jsonMode = true;
@@ -29549,7 +29550,7 @@ async function ask(question) {
29549
29550
  if (!isInteractive()) {
29550
29551
  throw new Error(`Missing input (${String(question.message).trim()}) and no interactive terminal to ask for it. Pass it as an option; see --help.`);
29551
29552
  }
29552
- return (0, import_prompts5.default)(question);
29553
+ return (0, import_prompts6.default)(question);
29553
29554
  }
29554
29555
 
29555
29556
  // src/lib/organization.ts
@@ -30242,7 +30243,7 @@ var import_chalk9 = __toESM(require("chalk"));
30242
30243
 
30243
30244
  // src/lib/command-utils.ts
30244
30245
  var import_chalk7 = __toESM(require("chalk"));
30245
- var import_prompts6 = __toESM(require("prompts"));
30246
+ var import_prompts7 = __toESM(require("prompts"));
30246
30247
  function formatDate(dateString) {
30247
30248
  return new Date(dateString).toLocaleString();
30248
30249
  }
@@ -30263,7 +30264,7 @@ function parseKeyValuePairs(pairs) {
30263
30264
  }
30264
30265
  async function confirmAction(message2) {
30265
30266
  if (!isInteractive()) throw new Error(`${message2} Pass -f to confirm without a terminal.`);
30266
- const { confirm } = await (0, import_prompts6.default)({ type: "confirm", name: "confirm", message: message2, initial: false });
30267
+ const { confirm } = await (0, import_prompts7.default)({ type: "confirm", name: "confirm", message: message2, initial: false });
30267
30268
  if (!confirm) console.log(import_chalk7.default.yellow("\nCancelled."));
30268
30269
  return Boolean(confirm);
30269
30270
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.79",
3
+ "version": "0.3.80",
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": {