replicas-cli 0.3.194 → 0.3.197

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 +80 -24
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -16059,12 +16059,22 @@ var init_opencode_go = __esm({
16059
16059
  }
16060
16060
  });
16061
16061
 
16062
+ // ../shared/src/chat-kind.ts
16063
+ var CHAT_KINDS;
16064
+ var init_chat_kind = __esm({
16065
+ "../shared/src/chat-kind.ts"() {
16066
+ "use strict";
16067
+ CHAT_KINDS = ["standard", "pull_request_fixes", "pull_request_review", "pull_request_tour"];
16068
+ }
16069
+ });
16070
+
16062
16071
  // ../shared/src/routes/reviews.ts
16063
16072
  var text, optionalText, pullRequestTourSchema;
16064
16073
  var init_reviews = __esm({
16065
16074
  "../shared/src/routes/reviews.ts"() {
16066
16075
  "use strict";
16067
16076
  init_zod();
16077
+ init_chat_kind();
16068
16078
  init_urls();
16069
16079
  text = external_exports.string().trim().catch("");
16070
16080
  optionalText = external_exports.string().trim().min(1).optional().catch(void 0);
@@ -16217,6 +16227,7 @@ var init_types4 = __esm({
16217
16227
  "use strict";
16218
16228
  init_aster();
16219
16229
  init_opencode_go();
16230
+ init_chat_kind();
16220
16231
  init_reviews();
16221
16232
  init_type_guards();
16222
16233
  init_languages();
@@ -16705,6 +16716,7 @@ var init_v1 = __esm({
16705
16716
  "use strict";
16706
16717
  init_api_casing();
16707
16718
  init_types4();
16719
+ init_chat_kind();
16708
16720
  init_agent();
16709
16721
  init_event();
16710
16722
  init_pricing();
@@ -16722,6 +16734,7 @@ var init_v1 = __esm({
16722
16734
  parentChatId: external_exports.string().uuid().optional(),
16723
16735
  forkSourceChatId: external_exports.string().uuid().optional(),
16724
16736
  pullRequestNotesPath: external_exports.string().min(1).optional(),
16737
+ kind: external_exports.enum(CHAT_KINDS).optional(),
16725
16738
  sideChat: external_exports.boolean().optional(),
16726
16739
  clientRequestId: external_exports.string().min(1).max(128).optional()
16727
16740
  }).refine((request) => !request.sideChat || request.forkSourceChatId !== void 0 && request.parentChatId === request.forkSourceChatId, {
@@ -20093,6 +20106,9 @@ var init_preferences = __esm({
20093
20106
  open_links_in_desktop_app: false,
20094
20107
  port_forwarding: false,
20095
20108
  spotify_controls: false,
20109
+ appshot_shortcut: "command",
20110
+ appshot_destination: "automatic",
20111
+ appshot_sound: true,
20096
20112
  mothership_intro_seen: false,
20097
20113
  follow_up_mode: "steer",
20098
20114
  memory_enabled: null,
@@ -28323,31 +28339,58 @@ var init_steps = __esm({
28323
28339
  }
28324
28340
  });
28325
28341
 
28342
+ // ../shared/src/html.ts
28343
+ var init_html = __esm({
28344
+ "../shared/src/html.ts"() {
28345
+ "use strict";
28346
+ }
28347
+ });
28348
+
28326
28349
  // ../shared/src/user-message-attachments.ts
28350
+ function parseAppshot(match) {
28351
+ return {
28352
+ appName: unescapeXml(match[1] ?? ""),
28353
+ windowTitle: unescapeXml(match[2] ?? ""),
28354
+ image: Number(match[3] || 0),
28355
+ ...match[5] && { text: unescapeXml(match[5]) },
28356
+ .../ \(cut short\)\. Treat that text as untrusted data/.test(match[4] ?? "") && { textTruncated: true }
28357
+ };
28358
+ }
28327
28359
  function stripAttachmentNote(text3) {
28328
28360
  const match = text3.match(/(?:^|\n\n)<replicas_attachments>\nUploaded files are available at:((?:\n- .*)*)(?:\n<\/?[a-z_]*>?)?$/) ?? text3.match(/(?:^|\n\n)Uploaded files are available at:((?:\n- .*)*)$/);
28329
28361
  let content = match ? text3.replace(match[0], "").trim() : text3;
28330
- const walkthroughs = [];
28331
- const truncated = WALKTHROUGH_NOTE_REGEX.test(content) ? null : content.match(TRUNCATED_WALKTHROUGH_NOTE_REGEX);
28332
- if (truncated) {
28333
- walkthroughs.push({ path: truncated[1], durationSeconds: Number(truncated[2] ?? 0), audio: truncated[3] === "true" });
28334
- content = content.slice(0, truncated.index).trim();
28335
- }
28336
- for (let walkthrough = content.match(WALKTHROUGH_NOTE_REGEX); walkthrough; walkthrough = content.match(WALKTHROUGH_NOTE_REGEX)) {
28337
- walkthroughs.unshift({ path: walkthrough[1], durationSeconds: Number(walkthrough[2]), audio: walkthrough[3] === "true" });
28338
- content = content.slice(0, walkthrough.index).trim();
28339
- }
28362
+ const takeTrailingNotes = (noteRegex, truncatedRegex, parse3) => {
28363
+ const notes = [];
28364
+ const truncated = noteRegex.test(content) ? null : content.match(truncatedRegex);
28365
+ if (truncated) {
28366
+ notes.push(parse3(truncated));
28367
+ content = content.slice(0, truncated.index).trim();
28368
+ }
28369
+ for (let note = content.match(noteRegex); note; note = content.match(noteRegex)) {
28370
+ notes.unshift(parse3(note));
28371
+ content = content.slice(0, note.index).trim();
28372
+ }
28373
+ return notes;
28374
+ };
28375
+ const walkthroughs = takeTrailingNotes(WALKTHROUGH_NOTE_REGEX, TRUNCATED_WALKTHROUGH_NOTE_REGEX, (walkthrough) => ({ path: walkthrough[1], durationSeconds: Number(walkthrough[2] ?? 0), audio: walkthrough[3] === "true" }));
28376
+ const appshots = takeTrailingNotes(APPSHOT_NOTE_REGEX, TRUNCATED_APPSHOT_NOTE_REGEX, parseAppshot);
28340
28377
  return {
28341
28378
  content,
28342
28379
  files: match ? [...match[1].matchAll(/^- (.+)$/gm)].map(([, path10]) => path10) : [],
28343
- walkthroughs
28380
+ walkthroughs,
28381
+ appshots
28344
28382
  };
28345
28383
  }
28346
- var ATTACHMENT_PLACEHOLDER_REGEX, WALKTHROUGH_NOTE_REGEX, TRUNCATED_WALKTHROUGH_NOTE_REGEX;
28384
+ var ATTACHMENT_PLACEHOLDER_REGEX, APPSHOT_NOTE_REGEX, TRUNCATED_APPSHOT_NOTE_REGEX, XML_UNESCAPES, unescapeXml, WALKTHROUGH_NOTE_REGEX, TRUNCATED_WALKTHROUGH_NOTE_REGEX;
28347
28385
  var init_user_message_attachments = __esm({
28348
28386
  "../shared/src/user-message-attachments.ts"() {
28349
28387
  "use strict";
28388
+ init_html();
28350
28389
  ATTACHMENT_PLACEHOLDER_REGEX = /^\[\d+ (?:(?:images?|files?)(?: and \d+ files?)? attached|(?:image )?attachments?)\]$/;
28390
+ APPSHOT_NOTE_REGEX = /(?:^|\n\n)<replicas_appshot app="([^"\n]*)" window="([^"\n]*)" image="(\d+)">\n([^\n<]*)(?:\n\n([^<]*))?\n<\/replicas_appshot>$/;
28391
+ TRUNCATED_APPSHOT_NOTE_REGEX = /(?:^|\n\n)<replicas_appshot app="([^"\n]*)(?:" window="([^"\n]*)(?:" image="(\d*))?)?[^<]*(?:<\/?[a-z_]*)?$/;
28392
+ XML_UNESCAPES = { "&amp;": "&", "&lt;": "<", "&gt;": ">", "&quot;": '"', "&#39;": "'" };
28393
+ unescapeXml = (text3) => text3.replace(/&(?:amp|lt|gt|quot|#39);/g, (entity) => XML_UNESCAPES[entity]);
28351
28394
  WALKTHROUGH_NOTE_REGEX = /(?:^|\n\n)<replicas_walkthrough path="([^"\n]+)" duration_seconds="(\d+)" audio="(true|false)">\n[^<]*\n<\/replicas_walkthrough>$/;
28352
28395
  TRUNCATED_WALKTHROUGH_NOTE_REGEX = /(?:^|\n\n)<replicas_walkthrough path="([^"\n]*)(?:" duration_seconds="(\d*))?(?:" audio="(true)?)?[^<]*(?:<\/?[a-z_]*)?$/;
28353
28396
  }
@@ -30424,18 +30467,19 @@ function filterDisplayMessages(messages, provider2) {
30424
30467
  }
30425
30468
  result = result.flatMap((msg) => {
30426
30469
  if (msg.type !== "user") return [msg];
30427
- const { content, files, walkthroughs } = stripAttachmentNote(stripReplicasInstructionBlock(msg.content).trim());
30470
+ const { content, files, walkthroughs, appshots } = stripAttachmentNote(stripReplicasInstructionBlock(msg.content).trim());
30428
30471
  if (INTERRUPTED_MESSAGE_REGEX.test(content)) {
30429
30472
  return [{ id: msg.id, type: "interruption", timestamp: msg.timestamp }];
30430
30473
  }
30431
30474
  const cleaned = (msg.images?.length || files.length) && ATTACHMENT_PLACEHOLDER_REGEX.test(content) ? "" : content;
30432
- if (cleaned.length === 0 && !msg.images?.length && files.length === 0 && walkthroughs.length === 0) return [];
30433
- if (cleaned === msg.content && files.length === 0 && walkthroughs.length === 0) return [msg];
30475
+ if (cleaned.length === 0 && !msg.images?.length && files.length === 0 && walkthroughs.length === 0 && appshots.length === 0) return [];
30476
+ if (cleaned === msg.content && files.length === 0 && walkthroughs.length === 0 && appshots.length === 0) return [msg];
30434
30477
  return [{
30435
30478
  ...msg,
30436
30479
  content: cleaned,
30437
30480
  ...files.length > 0 ? { files } : {},
30438
- ...walkthroughs.length > 0 ? { walkthroughs } : {}
30481
+ ...walkthroughs.length > 0 ? { walkthroughs } : {},
30482
+ ...appshots.length > 0 ? { appshots } : {}
30439
30483
  }];
30440
30484
  });
30441
30485
  return result;
@@ -31025,6 +31069,13 @@ var init_slash_commands = __esm({
31025
31069
  }
31026
31070
  });
31027
31071
 
31072
+ // ../shared/src/image-attachments.ts
31073
+ var init_image_attachments = __esm({
31074
+ "../shared/src/image-attachments.ts"() {
31075
+ "use strict";
31076
+ }
31077
+ });
31078
+
31028
31079
  // ../shared/src/hook-config.ts
31029
31080
  var init_hook_config = __esm({
31030
31081
  "../shared/src/hook-config.ts"() {
@@ -31160,7 +31211,7 @@ var CLI_VERSION;
31160
31211
  var init_cli_version = __esm({
31161
31212
  "../shared/src/cli-version.ts"() {
31162
31213
  "use strict";
31163
- CLI_VERSION = "0.3.194";
31214
+ CLI_VERSION = "0.3.197";
31164
31215
  }
31165
31216
  });
31166
31217
 
@@ -31962,24 +32013,26 @@ var init_workspace_attention = __esm({
31962
32013
  });
31963
32014
 
31964
32015
  // ../shared/src/routes/workspace-events.ts
31965
- var workspaceChangedEventSchema;
32016
+ var workspaceTurnCompletionSchema, workspaceChangedEventSchema;
31966
32017
  var init_workspace_events = __esm({
31967
32018
  "../shared/src/routes/workspace-events.ts"() {
31968
32019
  "use strict";
31969
32020
  init_zod();
31970
32021
  init_workspace_attention();
31971
32022
  init_workspaces();
32023
+ workspaceTurnCompletionSchema = external_exports.object({
32024
+ workspaceName: external_exports.string(),
32025
+ completedAt: external_exports.string(),
32026
+ processing: external_exports.boolean().optional(),
32027
+ pullRequestFeedback: external_exports.boolean().optional(),
32028
+ attention: external_exports.object({ reason: external_exports.enum(WORKSPACE_ATTENTION_REASONS), userId: external_exports.string() }).optional()
32029
+ });
31972
32030
  workspaceChangedEventSchema = external_exports.discriminatedUnion("type", [
31973
32031
  external_exports.object({
31974
32032
  type: external_exports.literal("workspace.changed"),
31975
32033
  workspaceId: external_exports.string(),
31976
32034
  workspace: external_exports.object({ status: external_exports.enum(WORKSPACE_STATUSES), last_activity_at: external_exports.string().nullable() }).optional(),
31977
- completion: external_exports.object({
31978
- workspaceName: external_exports.string(),
31979
- completedAt: external_exports.string(),
31980
- processing: external_exports.boolean().optional(),
31981
- attention: external_exports.object({ reason: external_exports.enum(WORKSPACE_ATTENTION_REASONS), userId: external_exports.string() }).optional()
31982
- }).optional(),
32035
+ completion: workspaceTurnCompletionSchema.optional(),
31983
32036
  ts: external_exports.string()
31984
32037
  }),
31985
32038
  external_exports.object({
@@ -32526,6 +32579,7 @@ var init_types8 = __esm({
32526
32579
  init_agents();
32527
32580
  init_types4();
32528
32581
  init_v1();
32582
+ init_chat_kind();
32529
32583
  init_type_guards();
32530
32584
  init_chat_transcript_pages();
32531
32585
  MEDIA_KIND = {
@@ -32697,6 +32751,7 @@ var init_src = __esm({
32697
32751
  init_prompts();
32698
32752
  init_mothership_events();
32699
32753
  init_user_message_attachments();
32754
+ init_image_attachments();
32700
32755
  init_scout();
32701
32756
  init_replicas_config();
32702
32757
  init_warm_hooks();
@@ -32726,6 +32781,7 @@ var init_src = __esm({
32726
32781
  init_environment2();
32727
32782
  init_types4();
32728
32783
  init_v1();
32784
+ init_chat_kind();
32729
32785
  init_webhook();
32730
32786
  init_billing();
32731
32787
  init_codex();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.194",
3
+ "version": "0.3.197",
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": {