replicas-cli 0.3.260 → 0.3.262

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 -8
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -20465,6 +20465,34 @@ There is no settings page: people change how you behave by telling you, and you
20465
20465
  }
20466
20466
  });
20467
20467
 
20468
+ // ../shared/src/message-origin.ts
20469
+ function parseMessageOrigin(raw) {
20470
+ const workspace = raw.match(WORKSPACE_SENDER);
20471
+ if (workspace) {
20472
+ let name;
20473
+ try {
20474
+ name = JSON.parse(workspace[1]);
20475
+ } catch {
20476
+ return null;
20477
+ }
20478
+ if (typeof name === "string") return { kind: "workspace", id: workspace[2], name, body: stripReplicasInstructionBlock(raw.slice(workspace[0].length)) };
20479
+ }
20480
+ const automation2 = raw.match(SCHEDULED_FOLLOW_UP);
20481
+ return automation2 ? { kind: "automation", id: automation2[2], name: automation2[1].trim(), body: stripReplicasInstructionBlock(raw.slice(automation2[0].length)) } : null;
20482
+ }
20483
+ var UUID, WORKSPACE_SENDER, SCHEDULED_NOTE, SCHEDULED_FOLLOW_UP;
20484
+ var init_message_origin = __esm({
20485
+ "../shared/src/message-origin.ts"() {
20486
+ "use strict";
20487
+ init_prompts();
20488
+ init_uuid();
20489
+ UUID = UUID_RE.source.slice(1, -1);
20490
+ WORKSPACE_SENDER = new RegExp(String.raw`^\s*<${REPLICAS_INSTRUCTIONS_TAG}>\nFrom the workspace ("(?:[^"\\\n]|\\.)*") \((${UUID})\)\.\n</${REPLICAS_INSTRUCTIONS_TAG}>`);
20491
+ SCHEDULED_NOTE = "This is a message you or a teammate scheduled earlier, delivered into this workspace.";
20492
+ SCHEDULED_FOLLOW_UP = new RegExp(String.raw`^\s*\*\*Scheduled follow-up: ([^\n]+)\*\*\n\nThe automation "[^\n]*" \((${UUID})\) fired at \S+\. ${SCHEDULED_NOTE.replace(/\./g, "\\.")}`);
20493
+ }
20494
+ });
20495
+
20468
20496
  // ../shared/src/mothership-events.ts
20469
20497
  function extractMothershipEvents(text3) {
20470
20498
  return [...text3.matchAll(BLOCK)].flatMap((match) => {
@@ -20497,6 +20525,7 @@ var init_mothership_events = __esm({
20497
20525
  init_zod();
20498
20526
  init_v1();
20499
20527
  init_prompts();
20528
+ init_message_origin();
20500
20529
  init_urls();
20501
20530
  MOTHERSHIP_EVENT_KINDS = ["finished", "ready", "needs_attention", "merged", "closed", "archived"];
20502
20531
  MOTHERSHIP_EVENT_TYPE = "multitask-event";
@@ -30919,10 +30948,12 @@ function filterDisplayMessages(messages, provider2) {
30919
30948
  }
30920
30949
  const cleaned = (msg.images?.length || files.length) && ATTACHMENT_PLACEHOLDER_REGEX.test(content) ? "" : content;
30921
30950
  if (cleaned.length === 0 && !msg.images?.length && files.length === 0 && walkthroughs.length === 0 && appshots.length === 0 && annotations.length === 0) return [];
30922
- if (cleaned === msg.content && files.length === 0 && walkthroughs.length === 0 && appshots.length === 0 && annotations.length === 0) return [msg];
30951
+ const origin = parseMessageOrigin(msg.content);
30952
+ if (cleaned === msg.content && !origin && files.length === 0 && walkthroughs.length === 0 && appshots.length === 0 && annotations.length === 0) return [msg];
30923
30953
  return [{
30924
30954
  ...msg,
30925
30955
  content: cleaned,
30956
+ ...origin ? { origin } : {},
30926
30957
  ...files.length > 0 ? { files } : {},
30927
30958
  ...walkthroughs.length > 0 ? { walkthroughs } : {},
30928
30959
  ...annotations.length > 0 ? { annotations } : {},
@@ -30938,6 +30969,7 @@ var init_parsers = __esm({
30938
30969
  init_event();
30939
30970
  init_mothership_events();
30940
30971
  init_prompts();
30972
+ init_message_origin();
30941
30973
  init_user_message_attachments();
30942
30974
  init_agent_event_utils();
30943
30975
  init_constants();
@@ -31123,6 +31155,7 @@ var init_metadata_pills = __esm({
31123
31155
  "use strict";
31124
31156
  init_agent();
31125
31157
  init_mothership_events();
31158
+ init_message_origin();
31126
31159
  init_prompts();
31127
31160
  init_user_message_attachments();
31128
31161
  init_parsers2();
@@ -31161,6 +31194,7 @@ var W, NOT_BEFORE, NOT_AFTER, URL_RE, PR_URL_RE, PR_NUM_RE, ERR_RE, BENIGN_RE, O
31161
31194
  var init_transcript_condense = __esm({
31162
31195
  "../shared/src/transcript-condense.ts"() {
31163
31196
  "use strict";
31197
+ init_message_origin();
31164
31198
  init_user_message_parser();
31165
31199
  W = "[\\p{L}\\p{N}_]";
31166
31200
  NOT_BEFORE = `(?<!${W})`;
@@ -31560,7 +31594,7 @@ var CLI_VERSION;
31560
31594
  var init_cli_version = __esm({
31561
31595
  "../shared/src/cli-version.ts"() {
31562
31596
  "use strict";
31563
- CLI_VERSION = "0.3.260";
31597
+ CLI_VERSION = "0.3.262";
31564
31598
  }
31565
31599
  });
31566
31600
 
@@ -42228,6 +42262,7 @@ var init_src = __esm({
42228
42262
  init_slash_commands();
42229
42263
  init_prompts();
42230
42264
  init_mothership_events();
42265
+ init_message_origin();
42231
42266
  init_user_message_attachments();
42232
42267
  init_image_attachments();
42233
42268
  init_scout();
@@ -42536,15 +42571,15 @@ async function ask(question) {
42536
42571
  if (!isInteractive()) {
42537
42572
  throw new Error(`Missing input (${String(question.message).trim()}) and no interactive terminal to ask for it. Pass it as an option; see --help.`);
42538
42573
  }
42539
- return (0, import_prompts6.default)(question);
42574
+ return (0, import_prompts7.default)(question);
42540
42575
  }
42541
- var import_chalk, import_prompts6, jsonMode, isJsonMode, isInteractive, outputSuccess;
42576
+ var import_chalk, import_prompts7, jsonMode, isJsonMode, isInteractive, outputSuccess;
42542
42577
  var init_output = __esm({
42543
42578
  "src/lib/output.ts"() {
42544
42579
  "use strict";
42545
42580
  import_chalk = __toESM(require("chalk"));
42546
42581
  init_src();
42547
- import_prompts6 = __toESM(require("prompts"));
42582
+ import_prompts7 = __toESM(require("prompts"));
42548
42583
  jsonMode = false;
42549
42584
  isJsonMode = () => jsonMode;
42550
42585
  isInteractive = () => !jsonMode && !!process.stdin.isTTY;
@@ -43341,16 +43376,16 @@ function parseKeyValuePairs(pairs) {
43341
43376
  }
43342
43377
  async function confirmAction(message2) {
43343
43378
  if (!isInteractive()) throw new Error(`${message2} Pass -f to confirm without a terminal.`);
43344
- const { confirm } = await (0, import_prompts7.default)({ type: "confirm", name: "confirm", message: message2, initial: false });
43379
+ const { confirm } = await (0, import_prompts8.default)({ type: "confirm", name: "confirm", message: message2, initial: false });
43345
43380
  if (!confirm) console.log(import_chalk7.default.yellow("\nCancelled."));
43346
43381
  return Boolean(confirm);
43347
43382
  }
43348
- var import_chalk7, import_prompts7;
43383
+ var import_chalk7, import_prompts8;
43349
43384
  var init_command_utils = __esm({
43350
43385
  "src/lib/command-utils.ts"() {
43351
43386
  "use strict";
43352
43387
  import_chalk7 = __toESM(require("chalk"));
43353
- import_prompts7 = __toESM(require("prompts"));
43388
+ import_prompts8 = __toESM(require("prompts"));
43354
43389
  init_config();
43355
43390
  init_output();
43356
43391
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.260",
3
+ "version": "0.3.262",
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": {