replicas-cli 0.3.49 → 0.3.50

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 +127 -94
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -999,14 +999,14 @@ var require_foldFlowLines = __commonJS({
999
999
  var FOLD_FLOW = "flow";
1000
1000
  var FOLD_BLOCK = "block";
1001
1001
  var FOLD_QUOTED = "quoted";
1002
- function foldFlowLines(text2, indent, mode = "flow", { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {
1002
+ function foldFlowLines(text3, indent, mode = "flow", { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {
1003
1003
  if (!lineWidth || lineWidth < 0)
1004
- return text2;
1004
+ return text3;
1005
1005
  if (lineWidth < minContentWidth)
1006
1006
  minContentWidth = 0;
1007
1007
  const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);
1008
- if (text2.length <= endStep)
1009
- return text2;
1008
+ if (text3.length <= endStep)
1009
+ return text3;
1010
1010
  const folds = [];
1011
1011
  const escapedFolds = {};
1012
1012
  let end = lineWidth - indent.length;
@@ -1023,14 +1023,14 @@ var require_foldFlowLines = __commonJS({
1023
1023
  let escStart = -1;
1024
1024
  let escEnd = -1;
1025
1025
  if (mode === FOLD_BLOCK) {
1026
- i = consumeMoreIndentedLines(text2, i, indent.length);
1026
+ i = consumeMoreIndentedLines(text3, i, indent.length);
1027
1027
  if (i !== -1)
1028
1028
  end = i + endStep;
1029
1029
  }
1030
- for (let ch; ch = text2[i += 1]; ) {
1030
+ for (let ch; ch = text3[i += 1]; ) {
1031
1031
  if (mode === FOLD_QUOTED && ch === "\\") {
1032
1032
  escStart = i;
1033
- switch (text2[i + 1]) {
1033
+ switch (text3[i + 1]) {
1034
1034
  case "x":
1035
1035
  i += 3;
1036
1036
  break;
@@ -1047,12 +1047,12 @@ var require_foldFlowLines = __commonJS({
1047
1047
  }
1048
1048
  if (ch === "\n") {
1049
1049
  if (mode === FOLD_BLOCK)
1050
- i = consumeMoreIndentedLines(text2, i, indent.length);
1050
+ i = consumeMoreIndentedLines(text3, i, indent.length);
1051
1051
  end = i + indent.length + endStep;
1052
1052
  split = void 0;
1053
1053
  } else {
1054
1054
  if (ch === " " && prev && prev !== " " && prev !== "\n" && prev !== " ") {
1055
- const next = text2[i + 1];
1055
+ const next = text3[i + 1];
1056
1056
  if (next && next !== " " && next !== "\n" && next !== " ")
1057
1057
  split = i;
1058
1058
  }
@@ -1064,12 +1064,12 @@ var require_foldFlowLines = __commonJS({
1064
1064
  } else if (mode === FOLD_QUOTED) {
1065
1065
  while (prev === " " || prev === " ") {
1066
1066
  prev = ch;
1067
- ch = text2[i += 1];
1067
+ ch = text3[i += 1];
1068
1068
  overflow = true;
1069
1069
  }
1070
1070
  const j = i > escEnd + 1 ? i - 2 : escStart - 1;
1071
1071
  if (escapedFolds[j])
1072
- return text2;
1072
+ return text3;
1073
1073
  folds.push(j);
1074
1074
  escapedFolds[j] = true;
1075
1075
  end = j + endStep;
@@ -1084,39 +1084,39 @@ var require_foldFlowLines = __commonJS({
1084
1084
  if (overflow && onOverflow)
1085
1085
  onOverflow();
1086
1086
  if (folds.length === 0)
1087
- return text2;
1087
+ return text3;
1088
1088
  if (onFold)
1089
1089
  onFold();
1090
- let res = text2.slice(0, folds[0]);
1090
+ let res = text3.slice(0, folds[0]);
1091
1091
  for (let i2 = 0; i2 < folds.length; ++i2) {
1092
1092
  const fold = folds[i2];
1093
- const end2 = folds[i2 + 1] || text2.length;
1093
+ const end2 = folds[i2 + 1] || text3.length;
1094
1094
  if (fold === 0)
1095
1095
  res = `
1096
- ${indent}${text2.slice(0, end2)}`;
1096
+ ${indent}${text3.slice(0, end2)}`;
1097
1097
  else {
1098
1098
  if (mode === FOLD_QUOTED && escapedFolds[fold])
1099
- res += `${text2[fold]}\\`;
1099
+ res += `${text3[fold]}\\`;
1100
1100
  res += `
1101
- ${indent}${text2.slice(fold + 1, end2)}`;
1101
+ ${indent}${text3.slice(fold + 1, end2)}`;
1102
1102
  }
1103
1103
  }
1104
1104
  return res;
1105
1105
  }
1106
- function consumeMoreIndentedLines(text2, i, indent) {
1106
+ function consumeMoreIndentedLines(text3, i, indent) {
1107
1107
  let end = i;
1108
1108
  let start = i + 1;
1109
- let ch = text2[start];
1109
+ let ch = text3[start];
1110
1110
  while (ch === " " || ch === " ") {
1111
1111
  if (i < start + indent) {
1112
- ch = text2[++i];
1112
+ ch = text3[++i];
1113
1113
  } else {
1114
1114
  do {
1115
- ch = text2[++i];
1115
+ ch = text3[++i];
1116
1116
  } while (ch && ch !== "\n");
1117
1117
  end = i;
1118
1118
  start = i + 1;
1119
- ch = text2[start];
1119
+ ch = text3[start];
1120
1120
  }
1121
1121
  }
1122
1122
  return end;
@@ -7380,6 +7380,7 @@ var WEB_APP_PATHS = {
7380
7380
  automations: "/automations",
7381
7381
  environment: "/environment",
7382
7382
  analytics: "/analytics",
7383
+ review: "/review",
7383
7384
  dashboard: DASHBOARD_PATH,
7384
7385
  agents: `${DASHBOARD_PATH}/agents`,
7385
7386
  integrations: `${DASHBOARD_PATH}/integrations`,
@@ -15448,8 +15449,8 @@ function ko_default() {
15448
15449
  }
15449
15450
 
15450
15451
  // ../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/locales/lt.js
15451
- var capitalizeFirstCharacter = (text2) => {
15452
- return text2.charAt(0).toUpperCase() + text2.slice(1);
15452
+ var capitalizeFirstCharacter = (text3) => {
15453
+ return text3.charAt(0).toUpperCase() + text3.slice(1);
15453
15454
  };
15454
15455
  function getUnitTypeFromNumber(number4) {
15455
15456
  const abs = Math.abs(number4);
@@ -22507,6 +22508,20 @@ var modelsDevCatalogSchema = external_exports.record(external_exports.string(),
22507
22508
  }))
22508
22509
  }));
22509
22510
 
22511
+ // ../shared/src/routes/reviews.ts
22512
+ var text = external_exports.string().trim().catch("");
22513
+ var optionalText = external_exports.string().trim().min(1).optional().catch(void 0);
22514
+ var pullRequestTourSchema = external_exports.object({
22515
+ /** The tour chat that wrote this file, so a rerun doesn't show the previous run's tour as in progress. */
22516
+ runId: optionalText,
22517
+ headSha: optionalText,
22518
+ status: external_exports.enum(["writing", "done"]).catch("writing"),
22519
+ summary: text,
22520
+ diagram: optionalText,
22521
+ files: external_exports.array(external_exports.object({ path: text, explanation: text })).catch([]),
22522
+ skip: external_exports.array(external_exports.object({ path: text, note: text })).catch([])
22523
+ });
22524
+
22510
22525
  // ../shared/src/languages.ts
22511
22526
  var EXT_TO_LANGUAGE = {
22512
22527
  ".ts": "typescript",
@@ -22961,14 +22976,14 @@ function coerceClaudePartialMessagePayload(payload) {
22961
22976
  const streamId = payload.streamId;
22962
22977
  if (typeof streamId !== "string" || !streamId) return null;
22963
22978
  const parentToolUseId = payload.parent_tool_use_id;
22964
- const text2 = typeof payload.text === "string" && payload.text ? payload.text : void 0;
22979
+ const text3 = typeof payload.text === "string" && payload.text ? payload.text : void 0;
22965
22980
  const thinking = typeof payload.thinking === "string" && payload.thinking ? payload.thinking : void 0;
22966
22981
  const tool = isRecord(payload.tool) && typeof payload.tool.id === "string" && typeof payload.tool.name === "string" ? typeof payload.tool.filePath === "string" ? { id: payload.tool.id, name: payload.tool.name, filePath: payload.tool.filePath } : typeof payload.tool.command === "string" ? { id: payload.tool.id, name: payload.tool.name, command: payload.tool.command } : void 0 : void 0;
22967
- if (!text2 && !thinking && !tool) return null;
22982
+ if (!text3 && !thinking && !tool) return null;
22968
22983
  return {
22969
22984
  streamId,
22970
22985
  parent_tool_use_id: typeof parentToolUseId === "string" ? parentToolUseId : null,
22971
- ...text2 ? { text: text2 } : {},
22986
+ ...text3 ? { text: text3 } : {},
22972
22987
  ...thinking ? { thinking } : {},
22973
22988
  ...tool ? { tool } : {},
22974
22989
  status: payload.status === "completed" ? "completed" : "in_progress"
@@ -23293,8 +23308,8 @@ function indexOrEnd(src, search, from) {
23293
23308
  const index = src.indexOf(search, from);
23294
23309
  return index < 0 ? src.length : index;
23295
23310
  }
23296
- function decodeAnsiC(text2) {
23297
- return text2.replace(/\\(x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{1,4}|[0-7]{1,3}|[\s\S])/g, (_match, escape) => {
23311
+ function decodeAnsiC(text3) {
23312
+ return text3.replace(/\\(x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{1,4}|[0-7]{1,3}|[\s\S])/g, (_match, escape) => {
23298
23313
  if (escape[0] === "x" || escape[0] === "u") return String.fromCharCode(parseInt(escape.slice(1), 16));
23299
23314
  if (/^[0-7]/.test(escape)) return String.fromCharCode(parseInt(escape, 8));
23300
23315
  return ANSI_C_ESCAPES[escape] ?? escape;
@@ -23311,8 +23326,8 @@ function staticOutput(argv, stdin) {
23311
23326
  if (flags.includes("n")) newline = false;
23312
23327
  if (flags.includes("e")) escapes = true;
23313
23328
  }
23314
- const text2 = args.join(" ");
23315
- return (escapes ? decodeAnsiC(text2) : text2) + (newline ? "\n" : "");
23329
+ const text3 = args.join(" ");
23330
+ return (escapes ? decodeAnsiC(text3) : text3) + (newline ? "\n" : "");
23316
23331
  }
23317
23332
  if (name === "printf" && args.length > 0) {
23318
23333
  const format = decodeAnsiC(args[0]);
@@ -23472,8 +23487,8 @@ function parseUntil(scope, start, closeParen) {
23472
23487
  let quoted = false;
23473
23488
  let redirect = null;
23474
23489
  let parens = 0;
23475
- const append = (text2, isQuoted = false) => {
23476
- word = (word ?? "") + text2;
23490
+ const append = (text3, isQuoted = false) => {
23491
+ word = (word ?? "") + text3;
23477
23492
  quoted || (quoted = isQuoted);
23478
23493
  };
23479
23494
  const endWord = () => {
@@ -24226,10 +24241,10 @@ var ENVIRONMENT_SETUP_LIMITS = {
24226
24241
  };
24227
24242
  var ENVIRONMENT_SETUP_VARIABLE_WAIT = { defaultMs: 5 * 6e4, maxMs: 15 * 6e4, pollMs: 5e3 };
24228
24243
  var VARIABLE_KEY_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
24229
- var text = (max) => max === void 0 ? external_exports.string().trim() : external_exports.string().trim().max(max);
24230
- var requiredText = (max) => text(max).min(1, "must not be empty");
24231
- var optionalText = (max) => text(max).nullish().transform((value) => value || null);
24232
- var clearableText = (max) => text(max).nullish().transform((value) => value === void 0 ? void 0 : value || null);
24244
+ var text2 = (max) => max === void 0 ? external_exports.string().trim() : external_exports.string().trim().max(max);
24245
+ var requiredText = (max) => text2(max).min(1, "must not be empty");
24246
+ var optionalText2 = (max) => text2(max).nullish().transform((value) => value || null);
24247
+ var clearableText = (max) => text2(max).nullish().transform((value) => value === void 0 ? void 0 : value || null);
24233
24248
  var list = (item, max) => max === void 0 ? external_exports.array(item) : external_exports.array(item).max(max);
24234
24249
  var ENVIRONMENT_SETUP_AUTHORED_TRIGGER_TYPES = ["cron", "github", "gitlab"];
24235
24250
  function isEnvironmentSetupAuthoredTriggerType(type) {
@@ -24245,9 +24260,9 @@ var carriedTriggerSchema = existingTriggerSchema.refine(
24245
24260
  );
24246
24261
  function automationSchema(limits) {
24247
24262
  const authored = external_exports.object({
24248
- name: text(limits.nameChars),
24249
- description: text(limits.descriptionChars),
24250
- prompt: text(limits.automationPromptChars),
24263
+ name: text2(limits.nameChars),
24264
+ description: text2(limits.descriptionChars),
24265
+ prompt: text2(limits.automationPromptChars),
24251
24266
  triggers: list(proposalTriggerSchema, limits.automationTriggers)
24252
24267
  });
24253
24268
  const updated = authored.extend({ triggers: list(external_exports.union([proposalTriggerSchema, carriedTriggerSchema]), limits.automationTriggers) });
@@ -24255,11 +24270,11 @@ function automationSchema(limits) {
24255
24270
  key: requiredText(limits.automationKeyChars),
24256
24271
  action: external_exports.enum(ENVIRONMENT_SETUP_AUTOMATION_ACTIONS).default("create"),
24257
24272
  automation_id: external_exports.string().regex(UUID_RE, "must be an automation id").nullable().default(null),
24258
- name: text().default(""),
24259
- description: optionalText().transform((value) => value ?? ""),
24260
- prompt: text().default(""),
24273
+ name: text2().default(""),
24274
+ description: optionalText2().transform((value) => value ?? ""),
24275
+ prompt: text2().default(""),
24261
24276
  triggers: list(existingTriggerSchema).default([]),
24262
- note: optionalText(limits.automationNoteChars)
24277
+ note: optionalText2(limits.automationNoteChars)
24263
24278
  }).superRefine((automation2, ctx) => {
24264
24279
  if (automation2.action === "create" && automation2.automation_id) {
24265
24280
  ctx.addIssue({ code: "custom", path: ["automation_id"], message: "belongs on an update, keep, or disable entry" });
@@ -24296,7 +24311,7 @@ function automationListSchema(limits) {
24296
24311
  }
24297
24312
  function environmentSchema(limits) {
24298
24313
  return external_exports.object({
24299
- name: optionalText(limits.nameChars).transform((value) => value ?? void 0),
24314
+ name: optionalText2(limits.nameChars).transform((value) => value ?? void 0),
24300
24315
  description: clearableText(limits.descriptionChars),
24301
24316
  system_prompt: clearableText(limits.systemPromptChars),
24302
24317
  start_hook: clearableText(limits.hookChars),
@@ -24306,21 +24321,21 @@ function environmentSchema(limits) {
24306
24321
  function variableSchema(limits, requiredDefault) {
24307
24322
  return external_exports.object({
24308
24323
  key: external_exports.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(limits.variableKeyChars ?? Number.POSITIVE_INFINITY),
24309
- description: optionalText(limits.variableDescriptionChars).transform((value) => value ?? ""),
24324
+ description: optionalText2(limits.variableDescriptionChars).transform((value) => value ?? ""),
24310
24325
  required: external_exports.boolean().default(requiredDefault)
24311
24326
  });
24312
24327
  }
24313
24328
  function proposalSchema(limits) {
24314
24329
  return external_exports.object({
24315
24330
  summary: requiredText(limits.summaryChars),
24316
- stack: list(text(), limits.stackItems).default([]).transform((items) => items.filter(Boolean)),
24331
+ stack: list(text2(), limits.stackItems).default([]).transform((items) => items.filter(Boolean)),
24317
24332
  environment: environmentSchema(limits),
24318
24333
  variables: list(variableSchema(limits, false), limits.variables).default([]),
24319
24334
  automations: automationListSchema(limits),
24320
24335
  verification: list(external_exports.object({
24321
24336
  label: requiredText(limits.nameChars),
24322
24337
  status: external_exports.enum(ENVIRONMENT_SETUP_VERIFICATION_STATUSES),
24323
- detail: optionalText(limits.verificationDetailChars).transform((value) => value ?? void 0)
24338
+ detail: optionalText2(limits.verificationDetailChars).transform((value) => value ?? void 0)
24324
24339
  }), limits.verificationItems).default([]),
24325
24340
  media: list(external_exports.object({
24326
24341
  media_id: external_exports.string().regex(UUID_RE, "must be a media id"),
@@ -26243,12 +26258,12 @@ var DEFAULT_DEFAULT_SKILLS = {
26243
26258
  // ../shared/src/prompts.ts
26244
26259
  var REPLICAS_INSTRUCTIONS_TAG = "replicas_instructions";
26245
26260
  var MULTITASK_INSTRUCTIONS_TAG = "multitask_instructions";
26246
- function removeTag(text2, tag) {
26261
+ function removeTag(text3, tag) {
26247
26262
  const regex = new RegExp(`<${tag}>[\\s\\S]*?</${tag}>`, "g");
26248
- return text2.replace(regex, "").trim();
26263
+ return text3.replace(regex, "").trim();
26249
26264
  }
26250
- function removeReplicasInstructions(text2) {
26251
- return removeTag(text2, REPLICAS_INSTRUCTIONS_TAG);
26265
+ function removeReplicasInstructions(text3) {
26266
+ return removeTag(text3, REPLICAS_INSTRUCTIONS_TAG);
26252
26267
  }
26253
26268
  var MULTITASK_INSTRUCTIONS_BLOCK = new RegExp(`\\s*<${MULTITASK_INSTRUCTIONS_TAG}>\\n([\\s\\S]*?)\\n</${MULTITASK_INSTRUCTIONS_TAG}>`);
26254
26269
 
@@ -26270,8 +26285,8 @@ var TAG = "multitask_event";
26270
26285
  var BLOCK = new RegExp(`<${TAG}((?:\\s+\\w+="[^"]*")*)>\\n?([\\s\\S]*?)\\n?</${TAG}>`, "g");
26271
26286
  var ATTRIBUTE = /(\w+)="([^"]*)"/g;
26272
26287
  var unescapeAttribute = (value) => value.replace(/&lt;/g, "<").replace(/&quot;/g, '"').replace(/&amp;/g, "&");
26273
- function extractMultitaskEvents(text2) {
26274
- return [...text2.matchAll(BLOCK)].flatMap((match) => {
26288
+ function extractMultitaskEvents(text3) {
26289
+ return [...text3.matchAll(BLOCK)].flatMap((match) => {
26275
26290
  const attributes = Object.fromEntries([...match[1].matchAll(ATTRIBUTE)].map(([, key, value]) => [key, unescapeAttribute(value)]));
26276
26291
  const kind = MULTITASK_EVENT_KINDS.find((candidate) => candidate === attributes.kind);
26277
26292
  if (!kind || !attributes.id || !attributes.agent_id) return [];
@@ -26289,9 +26304,9 @@ function extractMultitaskEvents(text2) {
26289
26304
  }];
26290
26305
  });
26291
26306
  }
26292
- function parseMultitaskEvents(text2) {
26293
- const events = extractMultitaskEvents(text2);
26294
- return events.length > 0 && text2.replace(BLOCK, "").replaceAll(MERGED_MESSAGE_SEPARATOR.trim(), "").trim() === "" ? events : null;
26307
+ function parseMultitaskEvents(text3) {
26308
+ const events = extractMultitaskEvents(text3);
26309
+ return events.length > 0 && text3.replace(BLOCK, "").replaceAll(MERGED_MESSAGE_SEPARATOR.trim(), "").trim() === "" ? events : null;
26295
26310
  }
26296
26311
 
26297
26312
  // ../shared/src/frontmatter.ts
@@ -26345,9 +26360,9 @@ var MULTITASK_TOOL_ACTIONS = {
26345
26360
  var ATTACHMENT_PLACEHOLDER_REGEX = /^\[\d+ (?:(?:images?|files?)(?: and \d+ files?)? attached|(?:image )?attachments?)\]$/;
26346
26361
  var WALKTHROUGH_NOTE_REGEX = /(?:^|\n\n)<replicas_walkthrough path="([^"\n]+)" duration_seconds="(\d+)" audio="(true|false)">\n[^<]*\n<\/replicas_walkthrough>$/;
26347
26362
  var TRUNCATED_WALKTHROUGH_NOTE_REGEX = /(?:^|\n\n)<replicas_walkthrough path="([^"\n]*)(?:" duration_seconds="(\d*))?(?:" audio="(true)?)?[^<]*(?:<\/?[a-z_]*)?$/;
26348
- function stripAttachmentNote(text2) {
26349
- const match = text2.match(/(?:^|\n\n)<replicas_attachments>\nUploaded files are available at:((?:\n- .*)*)(?:\n<\/?[a-z_]*>?)?$/) ?? text2.match(/(?:^|\n\n)Uploaded files are available at:((?:\n- .*)*)$/);
26350
- let content = match ? text2.replace(match[0], "").trim() : text2;
26363
+ function stripAttachmentNote(text3) {
26364
+ 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- .*)*)$/);
26365
+ let content = match ? text3.replace(match[0], "").trim() : text3;
26351
26366
  const walkthroughs = [];
26352
26367
  const truncated = WALKTHROUGH_NOTE_REGEX.test(content) ? null : content.match(TRUNCATED_WALKTHROUGH_NOTE_REGEX);
26353
26368
  if (truncated) {
@@ -26406,7 +26421,7 @@ function messagesForCodexTurn(turn) {
26406
26421
  return [{
26407
26422
  type: "reasoning",
26408
26423
  id: turn.id,
26409
- text: reasoning.map(({ text: text2 }) => text2.trim()).join("\n\n"),
26424
+ text: reasoning.map(({ text: text3 }) => text3.trim()).join("\n\n"),
26410
26425
  timestamp: reasoning[0].timestamp,
26411
26426
  status: reasoning.at(-1)?.status ?? "completed"
26412
26427
  }];
@@ -26883,8 +26898,8 @@ function getCursorAssistantText(event) {
26883
26898
  return getTextContent(message2?.content);
26884
26899
  }
26885
26900
  function getCursorThinkingText(event) {
26886
- const text2 = event.payload.text;
26887
- if (typeof text2 === "string") return text2;
26901
+ const text3 = event.payload.text;
26902
+ if (typeof text3 === "string") return text3;
26888
26903
  const message2 = isRecord(event.payload.message) ? event.payload.message : null;
26889
26904
  return typeof message2?.text === "string" ? message2.text : "";
26890
26905
  }
@@ -26935,8 +26950,8 @@ function parseCursorEvents(events) {
26935
26950
  continue;
26936
26951
  }
26937
26952
  if (event.type === "cursor-assistant") {
26938
- const text2 = getCursorAssistantText(event);
26939
- if (text2) {
26953
+ const text3 = getCursorAssistantText(event);
26954
+ if (text3) {
26940
26955
  const runId = cursorRunId(event);
26941
26956
  if (!activeAssistant || activeAssistant.runId !== runId) {
26942
26957
  const segment = runAssistantSegments.get(runId) ?? 0;
@@ -26955,15 +26970,15 @@ function parseCursorEvents(events) {
26955
26970
  if (message2?.type === "agent") {
26956
26971
  messages[activeAssistant.index] = {
26957
26972
  ...message2,
26958
- content: `${message2.content}${text2}`
26973
+ content: `${message2.content}${text3}`
26959
26974
  };
26960
26975
  }
26961
26976
  }
26962
26977
  continue;
26963
26978
  }
26964
26979
  if (event.type === "cursor-thinking") {
26965
- const text2 = getCursorThinkingText(event);
26966
- if (text2.trim()) {
26980
+ const text3 = getCursorThinkingText(event);
26981
+ if (text3.trim()) {
26967
26982
  const runId = cursorRunId(event);
26968
26983
  if (!activeThinking || activeThinking.runId !== runId) {
26969
26984
  const segment = runThinkingSegments.get(runId) ?? 0;
@@ -26983,7 +26998,7 @@ function parseCursorEvents(events) {
26983
26998
  if (message2?.type === "reasoning") {
26984
26999
  messages[activeThinking.index] = {
26985
27000
  ...message2,
26986
- content: `${message2.content}${text2}`,
27001
+ content: `${message2.content}${text3}`,
26987
27002
  status: "in_progress"
26988
27003
  };
26989
27004
  }
@@ -27015,12 +27030,12 @@ function parseCursorEvents(events) {
27015
27030
  }
27016
27031
  if (event.type === "cursor-task") {
27017
27032
  activeAssistant = null;
27018
- const text2 = event.payload.text;
27019
- if (typeof text2 === "string" && text2.trim()) {
27033
+ const text3 = event.payload.text;
27034
+ if (typeof text3 === "string" && text3.trim()) {
27020
27035
  messages.push({
27021
27036
  id: `cursor-task-${event.timestamp}-${messages.length}`,
27022
27037
  type: "agent",
27023
- content: text2,
27038
+ content: text3,
27024
27039
  timestamp: event.timestamp
27025
27040
  });
27026
27041
  }
@@ -27075,8 +27090,8 @@ var TRANSIENT_NETWORK_ERROR_PATTERNS = [
27075
27090
  ];
27076
27091
  var HTTP_CONTEXT_PATTERN = /(api error|request|response|status|http)/;
27077
27092
  var HTTP_STATUS_PATTERN = /(^|[^0-9])([1-5][0-9]{2})(?=$|[^0-9])/g;
27078
- function isTransientErrorText(text2, options = {}) {
27079
- const normalized = text2.toLowerCase();
27093
+ function isTransientErrorText(text3, options = {}) {
27094
+ const normalized = text3.toLowerCase();
27080
27095
  if (!normalized) return false;
27081
27096
  if (TRANSIENT_NETWORK_ERROR_PATTERNS.some((pattern) => pattern.test(normalized))) return true;
27082
27097
  if (options.includeRateLimit && /rate limit/.test(normalized)) return true;
@@ -27199,24 +27214,24 @@ function parseOpencodeEvents(events) {
27199
27214
  const time3 = isRecord(part.time) ? part.time : null;
27200
27215
  const timestamp = timestampFromMs(time3?.start, event.timestamp);
27201
27216
  if (part.type === "text") {
27202
- const text2 = typeof part.text === "string" ? part.text : "";
27203
- if (text2.trim()) {
27217
+ const text3 = typeof part.text === "string" ? part.text : "";
27218
+ if (text3.trim()) {
27204
27219
  upsertDisplayMessage(messages, {
27205
27220
  id,
27206
27221
  type: "agent",
27207
- content: text2,
27222
+ content: text3,
27208
27223
  timestamp
27209
27224
  });
27210
27225
  }
27211
27226
  continue;
27212
27227
  }
27213
27228
  if (part.type === "reasoning") {
27214
- const text2 = typeof part.text === "string" ? part.text : "";
27215
- if (text2.trim()) {
27229
+ const text3 = typeof part.text === "string" ? part.text : "";
27230
+ if (text3.trim()) {
27216
27231
  upsertDisplayMessage(messages, {
27217
27232
  id,
27218
27233
  type: "reasoning",
27219
- content: text2,
27234
+ content: text3,
27220
27235
  status: time3?.end ? "completed" : "in_progress",
27221
27236
  timestamp
27222
27237
  });
@@ -27384,7 +27399,7 @@ function assistantErrorMessage(value) {
27384
27399
  }
27385
27400
  function parsePiEvents(events) {
27386
27401
  const messages = [];
27387
- const text2 = /* @__PURE__ */ new Map();
27402
+ const text3 = /* @__PURE__ */ new Map();
27388
27403
  const thinking = /* @__PURE__ */ new Map();
27389
27404
  let activeMessageId = "assistant";
27390
27405
  for (const event of events) {
@@ -27415,9 +27430,9 @@ function parsePiEvents(events) {
27415
27430
  if (event.type === "pi-message_update") {
27416
27431
  const payload = nestedPayload(event);
27417
27432
  const id = typeof payload.id === "string" ? payload.id : activeMessageId;
27418
- if (payload.type === "text_delta" && typeof payload.delta === "string") text2.set(id, `${text2.get(id) ?? ""}${payload.delta}`);
27433
+ if (payload.type === "text_delta" && typeof payload.delta === "string") text3.set(id, `${text3.get(id) ?? ""}${payload.delta}`);
27419
27434
  if (payload.type === "thinking_delta" && typeof payload.delta === "string") thinking.set(id, `${thinking.get(id) ?? ""}${payload.delta}`);
27420
- const textContent = text2.get(id);
27435
+ const textContent = text3.get(id);
27421
27436
  const thinkingContent = thinking.get(id);
27422
27437
  if (textContent !== void 0) upsertDisplayMessage(messages, { id: `pi-${id}`, type: "agent", content: textContent, timestamp: event.timestamp });
27423
27438
  if (thinkingContent !== void 0) upsertDisplayMessage(messages, { id: `pi-thinking-${id}`, type: "reasoning", content: thinkingContent, status: "in_progress", timestamp: event.timestamp });
@@ -28567,7 +28582,7 @@ var headlessAgentRequestSchema = external_exports.object({
28567
28582
  });
28568
28583
 
28569
28584
  // ../shared/src/cli-version.ts
28570
- var CLI_VERSION = "0.3.49";
28585
+ var CLI_VERSION = "0.3.50";
28571
28586
 
28572
28587
  // ../shared/src/version.ts
28573
28588
  function compareVersions(v1, v2) {
@@ -29092,6 +29107,24 @@ var updatePresenceRequestSchema = external_exports.object({
29092
29107
  location: presenceLocationSchema.optional()
29093
29108
  });
29094
29109
 
29110
+ // ../shared/src/routes/review-messages.ts
29111
+ var sendPullRequestReviewMessageRequestSchema = external_exports.object({
29112
+ ...sendChatMessageRequestSchema.pick({
29113
+ message: true,
29114
+ messageId: true,
29115
+ submittedAt: true,
29116
+ model: true,
29117
+ images: true,
29118
+ canvasUploadIds: true,
29119
+ thinkingLevel: true,
29120
+ fastMode: true,
29121
+ ultrafastMode: true
29122
+ }).shape,
29123
+ /** Starts a new chat instead of continuing the PR's review chat. The provider only applies to a new chat. */
29124
+ newChat: external_exports.boolean().optional(),
29125
+ provider: external_exports.enum(VALID_AGENT_PROVIDERS).optional()
29126
+ });
29127
+
29095
29128
  // ../shared/src/audit-log.ts
29096
29129
  var AUDIT_LOG_ACTION = {
29097
29130
  CREATE: "create",
@@ -29693,8 +29726,8 @@ function renderAuthFlowStep(step, total, title2) {
29693
29726
  console.log(import_chalk2.default.bold(`
29694
29727
  ${step}/${total} ${title2}`));
29695
29728
  }
29696
- function renderAuthFlowDetail(text2) {
29697
- console.log(import_chalk2.default.gray(` ${text2}`));
29729
+ function renderAuthFlowDetail(text3) {
29730
+ console.log(import_chalk2.default.gray(` ${text3}`));
29698
29731
  }
29699
29732
  function renderAuthFlowSuccess(providerLabel, summary, target) {
29700
29733
  console.log(brand.bold(`
@@ -30967,8 +31000,8 @@ async function exchangeCodeForTokens2(code, state, expectedState, codeVerifier)
30967
31000
  body: JSON.stringify(payload)
30968
31001
  });
30969
31002
  if (!response.ok) {
30970
- const text2 = await response.text();
30971
- throw new Error(`Failed to exchange authorization code: ${response.status} ${text2}`);
31003
+ const text3 = await response.text();
31004
+ throw new Error(`Failed to exchange authorization code: ${response.status} ${text3}`);
30972
31005
  }
30973
31006
  const data = await response.json();
30974
31007
  return {
@@ -31832,9 +31865,9 @@ function formatStatus(status) {
31832
31865
  if (isWorkspaceSuspendedStatus(status)) return import_chalk20.default.gray(status);
31833
31866
  return status;
31834
31867
  }
31835
- function truncate(text2, maxLength) {
31836
- if (text2.length <= maxLength) return text2;
31837
- return text2.substring(0, maxLength) + "...";
31868
+ function truncate(text3, maxLength) {
31869
+ if (text3.length <= maxLength) return text3;
31870
+ return text3.substring(0, maxLength) + "...";
31838
31871
  }
31839
31872
  function formatDisplayMessage(message2) {
31840
31873
  const time3 = new Date(message2.timestamp).toLocaleTimeString();
@@ -32997,9 +33030,9 @@ function buildTriggersFromOptions(options, runAt, repositories) {
32997
33030
  }
32998
33031
  return triggers;
32999
33032
  }
33000
- function truncate2(text2, maxLength) {
33001
- if (text2.length <= maxLength) return text2;
33002
- return text2.substring(0, maxLength) + "...";
33033
+ function truncate2(text3, maxLength) {
33034
+ if (text3.length <= maxLength) return text3;
33035
+ return text3.substring(0, maxLength) + "...";
33003
33036
  }
33004
33037
  function formatAgentSummary(automation2) {
33005
33038
  const parts = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.49",
3
+ "version": "0.3.50",
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": {