replicas-cli 0.3.48 → 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.
- package/dist/index.cjs +221 -95
- 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(
|
|
1002
|
+
function foldFlowLines(text3, indent, mode = "flow", { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {
|
|
1003
1003
|
if (!lineWidth || lineWidth < 0)
|
|
1004
|
-
return
|
|
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 (
|
|
1009
|
-
return
|
|
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(
|
|
1026
|
+
i = consumeMoreIndentedLines(text3, i, indent.length);
|
|
1027
1027
|
if (i !== -1)
|
|
1028
1028
|
end = i + endStep;
|
|
1029
1029
|
}
|
|
1030
|
-
for (let ch; ch =
|
|
1030
|
+
for (let ch; ch = text3[i += 1]; ) {
|
|
1031
1031
|
if (mode === FOLD_QUOTED && ch === "\\") {
|
|
1032
1032
|
escStart = i;
|
|
1033
|
-
switch (
|
|
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(
|
|
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 =
|
|
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 =
|
|
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
|
|
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
|
|
1087
|
+
return text3;
|
|
1088
1088
|
if (onFold)
|
|
1089
1089
|
onFold();
|
|
1090
|
-
let res =
|
|
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] ||
|
|
1093
|
+
const end2 = folds[i2 + 1] || text3.length;
|
|
1094
1094
|
if (fold === 0)
|
|
1095
1095
|
res = `
|
|
1096
|
-
${indent}${
|
|
1096
|
+
${indent}${text3.slice(0, end2)}`;
|
|
1097
1097
|
else {
|
|
1098
1098
|
if (mode === FOLD_QUOTED && escapedFolds[fold])
|
|
1099
|
-
res += `${
|
|
1099
|
+
res += `${text3[fold]}\\`;
|
|
1100
1100
|
res += `
|
|
1101
|
-
${indent}${
|
|
1101
|
+
${indent}${text3.slice(fold + 1, end2)}`;
|
|
1102
1102
|
}
|
|
1103
1103
|
}
|
|
1104
1104
|
return res;
|
|
1105
1105
|
}
|
|
1106
|
-
function consumeMoreIndentedLines(
|
|
1106
|
+
function consumeMoreIndentedLines(text3, i, indent) {
|
|
1107
1107
|
let end = i;
|
|
1108
1108
|
let start = i + 1;
|
|
1109
|
-
let ch =
|
|
1109
|
+
let ch = text3[start];
|
|
1110
1110
|
while (ch === " " || ch === " ") {
|
|
1111
1111
|
if (i < start + indent) {
|
|
1112
|
-
ch =
|
|
1112
|
+
ch = text3[++i];
|
|
1113
1113
|
} else {
|
|
1114
1114
|
do {
|
|
1115
|
-
ch =
|
|
1115
|
+
ch = text3[++i];
|
|
1116
1116
|
} while (ch && ch !== "\n");
|
|
1117
1117
|
end = i;
|
|
1118
1118
|
start = i + 1;
|
|
1119
|
-
ch =
|
|
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 = (
|
|
15452
|
-
return
|
|
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,113 @@ 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
|
+
|
|
22525
|
+
// ../shared/src/languages.ts
|
|
22526
|
+
var EXT_TO_LANGUAGE = {
|
|
22527
|
+
".ts": "typescript",
|
|
22528
|
+
".tsx": "tsx",
|
|
22529
|
+
".mts": "typescript",
|
|
22530
|
+
".cts": "typescript",
|
|
22531
|
+
".js": "javascript",
|
|
22532
|
+
".jsx": "jsx",
|
|
22533
|
+
".mjs": "javascript",
|
|
22534
|
+
".cjs": "javascript",
|
|
22535
|
+
".py": "python",
|
|
22536
|
+
".pyw": "python",
|
|
22537
|
+
".pyi": "python",
|
|
22538
|
+
".rs": "rust",
|
|
22539
|
+
".go": "go",
|
|
22540
|
+
".rb": "ruby",
|
|
22541
|
+
".rake": "ruby",
|
|
22542
|
+
".java": "java",
|
|
22543
|
+
".kt": "kotlin",
|
|
22544
|
+
".kts": "kotlin",
|
|
22545
|
+
".scala": "scala",
|
|
22546
|
+
".swift": "swift",
|
|
22547
|
+
".m": "objectivec",
|
|
22548
|
+
".mm": "objectivec",
|
|
22549
|
+
".c": "c",
|
|
22550
|
+
".cpp": "cpp",
|
|
22551
|
+
".cc": "cpp",
|
|
22552
|
+
".cxx": "cpp",
|
|
22553
|
+
".h": "c",
|
|
22554
|
+
".hpp": "cpp",
|
|
22555
|
+
".hh": "cpp",
|
|
22556
|
+
".hxx": "cpp",
|
|
22557
|
+
".cs": "csharp",
|
|
22558
|
+
".vb": "vbnet",
|
|
22559
|
+
".fs": "fsharp",
|
|
22560
|
+
".php": "php",
|
|
22561
|
+
".phtml": "php",
|
|
22562
|
+
".css": "css",
|
|
22563
|
+
".scss": "scss",
|
|
22564
|
+
".sass": "sass",
|
|
22565
|
+
".less": "less",
|
|
22566
|
+
".html": "html",
|
|
22567
|
+
".htm": "html",
|
|
22568
|
+
".vue": "vue",
|
|
22569
|
+
".svelte": "svelte",
|
|
22570
|
+
".xml": "xml",
|
|
22571
|
+
".svg": "xml",
|
|
22572
|
+
".json": "json",
|
|
22573
|
+
".json5": "json5",
|
|
22574
|
+
".yaml": "yaml",
|
|
22575
|
+
".yml": "yaml",
|
|
22576
|
+
".toml": "toml",
|
|
22577
|
+
".ini": "ini",
|
|
22578
|
+
".md": "markdown",
|
|
22579
|
+
".markdown": "markdown",
|
|
22580
|
+
".mmd": "mermaid",
|
|
22581
|
+
".mermaid": "mermaid",
|
|
22582
|
+
".sql": "sql",
|
|
22583
|
+
".sh": "bash",
|
|
22584
|
+
".bash": "bash",
|
|
22585
|
+
".zsh": "bash",
|
|
22586
|
+
".fish": "bash",
|
|
22587
|
+
".dockerfile": "dockerfile",
|
|
22588
|
+
".graphql": "graphql",
|
|
22589
|
+
".proto": "protobuf",
|
|
22590
|
+
".r": "r",
|
|
22591
|
+
".lua": "lua",
|
|
22592
|
+
".dart": "dart",
|
|
22593
|
+
".zig": "zig",
|
|
22594
|
+
".ex": "elixir",
|
|
22595
|
+
".exs": "elixir",
|
|
22596
|
+
".erl": "erlang",
|
|
22597
|
+
".hs": "haskell",
|
|
22598
|
+
".ml": "ocaml",
|
|
22599
|
+
".clj": "clojure",
|
|
22600
|
+
".cljs": "clojure",
|
|
22601
|
+
".pl": "perl",
|
|
22602
|
+
".perl": "perl",
|
|
22603
|
+
".elm": "elm",
|
|
22604
|
+
".lisp": "lisp"
|
|
22605
|
+
};
|
|
22606
|
+
function detectLanguageByPath(filePath) {
|
|
22607
|
+
const dot = filePath.lastIndexOf(".");
|
|
22608
|
+
if (dot === -1) {
|
|
22609
|
+
const basename = filePath.split("/").pop() ?? "";
|
|
22610
|
+
if (basename === "Dockerfile") return "dockerfile";
|
|
22611
|
+
if (basename === "Makefile") return "makefile";
|
|
22612
|
+
return null;
|
|
22613
|
+
}
|
|
22614
|
+
const ext = filePath.slice(dot).toLowerCase();
|
|
22615
|
+
return EXT_TO_LANGUAGE[ext] ?? null;
|
|
22616
|
+
}
|
|
22617
|
+
|
|
22510
22618
|
// ../shared/src/engine/types.ts
|
|
22511
22619
|
var CLAUDE_OPUS_1M_MODEL = "opus[1m]";
|
|
22512
22620
|
var LEGACY_CLAUDE_OPUS_1M_MODEL = "opus-1m";
|
|
@@ -22816,7 +22924,7 @@ var CANVAS_KIND_BY_EXTENSION = {
|
|
|
22816
22924
|
function classifyCanvasFilename(filename) {
|
|
22817
22925
|
const idx = filename.lastIndexOf(".");
|
|
22818
22926
|
const ext = idx === -1 ? "" : filename.slice(idx).toLowerCase();
|
|
22819
|
-
return CANVAS_KIND_BY_EXTENSION[ext] ?? { kind: "other", mimeType: "application/octet-stream" };
|
|
22927
|
+
return CANVAS_KIND_BY_EXTENSION[ext] ?? (detectLanguageByPath(filename) ? { kind: "text", mimeType: "text/plain; charset=utf-8" } : { kind: "other", mimeType: "application/octet-stream" });
|
|
22820
22928
|
}
|
|
22821
22929
|
|
|
22822
22930
|
// ../shared/src/chat-fork.ts
|
|
@@ -22868,14 +22976,14 @@ function coerceClaudePartialMessagePayload(payload) {
|
|
|
22868
22976
|
const streamId = payload.streamId;
|
|
22869
22977
|
if (typeof streamId !== "string" || !streamId) return null;
|
|
22870
22978
|
const parentToolUseId = payload.parent_tool_use_id;
|
|
22871
|
-
const
|
|
22979
|
+
const text3 = typeof payload.text === "string" && payload.text ? payload.text : void 0;
|
|
22872
22980
|
const thinking = typeof payload.thinking === "string" && payload.thinking ? payload.thinking : void 0;
|
|
22873
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;
|
|
22874
|
-
if (!
|
|
22982
|
+
if (!text3 && !thinking && !tool) return null;
|
|
22875
22983
|
return {
|
|
22876
22984
|
streamId,
|
|
22877
22985
|
parent_tool_use_id: typeof parentToolUseId === "string" ? parentToolUseId : null,
|
|
22878
|
-
...
|
|
22986
|
+
...text3 ? { text: text3 } : {},
|
|
22879
22987
|
...thinking ? { thinking } : {},
|
|
22880
22988
|
...tool ? { tool } : {},
|
|
22881
22989
|
status: payload.status === "completed" ? "completed" : "in_progress"
|
|
@@ -23200,8 +23308,8 @@ function indexOrEnd(src, search, from) {
|
|
|
23200
23308
|
const index = src.indexOf(search, from);
|
|
23201
23309
|
return index < 0 ? src.length : index;
|
|
23202
23310
|
}
|
|
23203
|
-
function decodeAnsiC(
|
|
23204
|
-
return
|
|
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) => {
|
|
23205
23313
|
if (escape[0] === "x" || escape[0] === "u") return String.fromCharCode(parseInt(escape.slice(1), 16));
|
|
23206
23314
|
if (/^[0-7]/.test(escape)) return String.fromCharCode(parseInt(escape, 8));
|
|
23207
23315
|
return ANSI_C_ESCAPES[escape] ?? escape;
|
|
@@ -23218,8 +23326,8 @@ function staticOutput(argv, stdin) {
|
|
|
23218
23326
|
if (flags.includes("n")) newline = false;
|
|
23219
23327
|
if (flags.includes("e")) escapes = true;
|
|
23220
23328
|
}
|
|
23221
|
-
const
|
|
23222
|
-
return (escapes ? decodeAnsiC(
|
|
23329
|
+
const text3 = args.join(" ");
|
|
23330
|
+
return (escapes ? decodeAnsiC(text3) : text3) + (newline ? "\n" : "");
|
|
23223
23331
|
}
|
|
23224
23332
|
if (name === "printf" && args.length > 0) {
|
|
23225
23333
|
const format = decodeAnsiC(args[0]);
|
|
@@ -23379,8 +23487,8 @@ function parseUntil(scope, start, closeParen) {
|
|
|
23379
23487
|
let quoted = false;
|
|
23380
23488
|
let redirect = null;
|
|
23381
23489
|
let parens = 0;
|
|
23382
|
-
const append = (
|
|
23383
|
-
word = (word ?? "") +
|
|
23490
|
+
const append = (text3, isQuoted = false) => {
|
|
23491
|
+
word = (word ?? "") + text3;
|
|
23384
23492
|
quoted || (quoted = isQuoted);
|
|
23385
23493
|
};
|
|
23386
23494
|
const endWord = () => {
|
|
@@ -24133,10 +24241,10 @@ var ENVIRONMENT_SETUP_LIMITS = {
|
|
|
24133
24241
|
};
|
|
24134
24242
|
var ENVIRONMENT_SETUP_VARIABLE_WAIT = { defaultMs: 5 * 6e4, maxMs: 15 * 6e4, pollMs: 5e3 };
|
|
24135
24243
|
var VARIABLE_KEY_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
24136
|
-
var
|
|
24137
|
-
var requiredText = (max) =>
|
|
24138
|
-
var
|
|
24139
|
-
var clearableText = (max) =>
|
|
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);
|
|
24140
24248
|
var list = (item, max) => max === void 0 ? external_exports.array(item) : external_exports.array(item).max(max);
|
|
24141
24249
|
var ENVIRONMENT_SETUP_AUTHORED_TRIGGER_TYPES = ["cron", "github", "gitlab"];
|
|
24142
24250
|
function isEnvironmentSetupAuthoredTriggerType(type) {
|
|
@@ -24152,9 +24260,9 @@ var carriedTriggerSchema = existingTriggerSchema.refine(
|
|
|
24152
24260
|
);
|
|
24153
24261
|
function automationSchema(limits) {
|
|
24154
24262
|
const authored = external_exports.object({
|
|
24155
|
-
name:
|
|
24156
|
-
description:
|
|
24157
|
-
prompt:
|
|
24263
|
+
name: text2(limits.nameChars),
|
|
24264
|
+
description: text2(limits.descriptionChars),
|
|
24265
|
+
prompt: text2(limits.automationPromptChars),
|
|
24158
24266
|
triggers: list(proposalTriggerSchema, limits.automationTriggers)
|
|
24159
24267
|
});
|
|
24160
24268
|
const updated = authored.extend({ triggers: list(external_exports.union([proposalTriggerSchema, carriedTriggerSchema]), limits.automationTriggers) });
|
|
@@ -24162,11 +24270,11 @@ function automationSchema(limits) {
|
|
|
24162
24270
|
key: requiredText(limits.automationKeyChars),
|
|
24163
24271
|
action: external_exports.enum(ENVIRONMENT_SETUP_AUTOMATION_ACTIONS).default("create"),
|
|
24164
24272
|
automation_id: external_exports.string().regex(UUID_RE, "must be an automation id").nullable().default(null),
|
|
24165
|
-
name:
|
|
24166
|
-
description:
|
|
24167
|
-
prompt:
|
|
24273
|
+
name: text2().default(""),
|
|
24274
|
+
description: optionalText2().transform((value) => value ?? ""),
|
|
24275
|
+
prompt: text2().default(""),
|
|
24168
24276
|
triggers: list(existingTriggerSchema).default([]),
|
|
24169
|
-
note:
|
|
24277
|
+
note: optionalText2(limits.automationNoteChars)
|
|
24170
24278
|
}).superRefine((automation2, ctx) => {
|
|
24171
24279
|
if (automation2.action === "create" && automation2.automation_id) {
|
|
24172
24280
|
ctx.addIssue({ code: "custom", path: ["automation_id"], message: "belongs on an update, keep, or disable entry" });
|
|
@@ -24203,7 +24311,7 @@ function automationListSchema(limits) {
|
|
|
24203
24311
|
}
|
|
24204
24312
|
function environmentSchema(limits) {
|
|
24205
24313
|
return external_exports.object({
|
|
24206
|
-
name:
|
|
24314
|
+
name: optionalText2(limits.nameChars).transform((value) => value ?? void 0),
|
|
24207
24315
|
description: clearableText(limits.descriptionChars),
|
|
24208
24316
|
system_prompt: clearableText(limits.systemPromptChars),
|
|
24209
24317
|
start_hook: clearableText(limits.hookChars),
|
|
@@ -24213,21 +24321,21 @@ function environmentSchema(limits) {
|
|
|
24213
24321
|
function variableSchema(limits, requiredDefault) {
|
|
24214
24322
|
return external_exports.object({
|
|
24215
24323
|
key: external_exports.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(limits.variableKeyChars ?? Number.POSITIVE_INFINITY),
|
|
24216
|
-
description:
|
|
24324
|
+
description: optionalText2(limits.variableDescriptionChars).transform((value) => value ?? ""),
|
|
24217
24325
|
required: external_exports.boolean().default(requiredDefault)
|
|
24218
24326
|
});
|
|
24219
24327
|
}
|
|
24220
24328
|
function proposalSchema(limits) {
|
|
24221
24329
|
return external_exports.object({
|
|
24222
24330
|
summary: requiredText(limits.summaryChars),
|
|
24223
|
-
stack: list(
|
|
24331
|
+
stack: list(text2(), limits.stackItems).default([]).transform((items) => items.filter(Boolean)),
|
|
24224
24332
|
environment: environmentSchema(limits),
|
|
24225
24333
|
variables: list(variableSchema(limits, false), limits.variables).default([]),
|
|
24226
24334
|
automations: automationListSchema(limits),
|
|
24227
24335
|
verification: list(external_exports.object({
|
|
24228
24336
|
label: requiredText(limits.nameChars),
|
|
24229
24337
|
status: external_exports.enum(ENVIRONMENT_SETUP_VERIFICATION_STATUSES),
|
|
24230
|
-
detail:
|
|
24338
|
+
detail: optionalText2(limits.verificationDetailChars).transform((value) => value ?? void 0)
|
|
24231
24339
|
}), limits.verificationItems).default([]),
|
|
24232
24340
|
media: list(external_exports.object({
|
|
24233
24341
|
media_id: external_exports.string().regex(UUID_RE, "must be a media id"),
|
|
@@ -26150,12 +26258,12 @@ var DEFAULT_DEFAULT_SKILLS = {
|
|
|
26150
26258
|
// ../shared/src/prompts.ts
|
|
26151
26259
|
var REPLICAS_INSTRUCTIONS_TAG = "replicas_instructions";
|
|
26152
26260
|
var MULTITASK_INSTRUCTIONS_TAG = "multitask_instructions";
|
|
26153
|
-
function removeTag(
|
|
26261
|
+
function removeTag(text3, tag) {
|
|
26154
26262
|
const regex = new RegExp(`<${tag}>[\\s\\S]*?</${tag}>`, "g");
|
|
26155
|
-
return
|
|
26263
|
+
return text3.replace(regex, "").trim();
|
|
26156
26264
|
}
|
|
26157
|
-
function removeReplicasInstructions(
|
|
26158
|
-
return removeTag(
|
|
26265
|
+
function removeReplicasInstructions(text3) {
|
|
26266
|
+
return removeTag(text3, REPLICAS_INSTRUCTIONS_TAG);
|
|
26159
26267
|
}
|
|
26160
26268
|
var MULTITASK_INSTRUCTIONS_BLOCK = new RegExp(`\\s*<${MULTITASK_INSTRUCTIONS_TAG}>\\n([\\s\\S]*?)\\n</${MULTITASK_INSTRUCTIONS_TAG}>`);
|
|
26161
26269
|
|
|
@@ -26177,8 +26285,8 @@ var TAG = "multitask_event";
|
|
|
26177
26285
|
var BLOCK = new RegExp(`<${TAG}((?:\\s+\\w+="[^"]*")*)>\\n?([\\s\\S]*?)\\n?</${TAG}>`, "g");
|
|
26178
26286
|
var ATTRIBUTE = /(\w+)="([^"]*)"/g;
|
|
26179
26287
|
var unescapeAttribute = (value) => value.replace(/</g, "<").replace(/"/g, '"').replace(/&/g, "&");
|
|
26180
|
-
function extractMultitaskEvents(
|
|
26181
|
-
return [...
|
|
26288
|
+
function extractMultitaskEvents(text3) {
|
|
26289
|
+
return [...text3.matchAll(BLOCK)].flatMap((match) => {
|
|
26182
26290
|
const attributes = Object.fromEntries([...match[1].matchAll(ATTRIBUTE)].map(([, key, value]) => [key, unescapeAttribute(value)]));
|
|
26183
26291
|
const kind = MULTITASK_EVENT_KINDS.find((candidate) => candidate === attributes.kind);
|
|
26184
26292
|
if (!kind || !attributes.id || !attributes.agent_id) return [];
|
|
@@ -26196,9 +26304,9 @@ function extractMultitaskEvents(text2) {
|
|
|
26196
26304
|
}];
|
|
26197
26305
|
});
|
|
26198
26306
|
}
|
|
26199
|
-
function parseMultitaskEvents(
|
|
26200
|
-
const events = extractMultitaskEvents(
|
|
26201
|
-
return events.length > 0 &&
|
|
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;
|
|
26202
26310
|
}
|
|
26203
26311
|
|
|
26204
26312
|
// ../shared/src/frontmatter.ts
|
|
@@ -26252,9 +26360,9 @@ var MULTITASK_TOOL_ACTIONS = {
|
|
|
26252
26360
|
var ATTACHMENT_PLACEHOLDER_REGEX = /^\[\d+ (?:(?:images?|files?)(?: and \d+ files?)? attached|(?:image )?attachments?)\]$/;
|
|
26253
26361
|
var WALKTHROUGH_NOTE_REGEX = /(?:^|\n\n)<replicas_walkthrough path="([^"\n]+)" duration_seconds="(\d+)" audio="(true|false)">\n[^<]*\n<\/replicas_walkthrough>$/;
|
|
26254
26362
|
var TRUNCATED_WALKTHROUGH_NOTE_REGEX = /(?:^|\n\n)<replicas_walkthrough path="([^"\n]*)(?:" duration_seconds="(\d*))?(?:" audio="(true)?)?[^<]*(?:<\/?[a-z_]*)?$/;
|
|
26255
|
-
function stripAttachmentNote(
|
|
26256
|
-
const match =
|
|
26257
|
-
let content = match ?
|
|
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;
|
|
26258
26366
|
const walkthroughs = [];
|
|
26259
26367
|
const truncated = WALKTHROUGH_NOTE_REGEX.test(content) ? null : content.match(TRUNCATED_WALKTHROUGH_NOTE_REGEX);
|
|
26260
26368
|
if (truncated) {
|
|
@@ -26313,7 +26421,7 @@ function messagesForCodexTurn(turn) {
|
|
|
26313
26421
|
return [{
|
|
26314
26422
|
type: "reasoning",
|
|
26315
26423
|
id: turn.id,
|
|
26316
|
-
text: reasoning.map(({ text:
|
|
26424
|
+
text: reasoning.map(({ text: text3 }) => text3.trim()).join("\n\n"),
|
|
26317
26425
|
timestamp: reasoning[0].timestamp,
|
|
26318
26426
|
status: reasoning.at(-1)?.status ?? "completed"
|
|
26319
26427
|
}];
|
|
@@ -26790,8 +26898,8 @@ function getCursorAssistantText(event) {
|
|
|
26790
26898
|
return getTextContent(message2?.content);
|
|
26791
26899
|
}
|
|
26792
26900
|
function getCursorThinkingText(event) {
|
|
26793
|
-
const
|
|
26794
|
-
if (typeof
|
|
26901
|
+
const text3 = event.payload.text;
|
|
26902
|
+
if (typeof text3 === "string") return text3;
|
|
26795
26903
|
const message2 = isRecord(event.payload.message) ? event.payload.message : null;
|
|
26796
26904
|
return typeof message2?.text === "string" ? message2.text : "";
|
|
26797
26905
|
}
|
|
@@ -26842,8 +26950,8 @@ function parseCursorEvents(events) {
|
|
|
26842
26950
|
continue;
|
|
26843
26951
|
}
|
|
26844
26952
|
if (event.type === "cursor-assistant") {
|
|
26845
|
-
const
|
|
26846
|
-
if (
|
|
26953
|
+
const text3 = getCursorAssistantText(event);
|
|
26954
|
+
if (text3) {
|
|
26847
26955
|
const runId = cursorRunId(event);
|
|
26848
26956
|
if (!activeAssistant || activeAssistant.runId !== runId) {
|
|
26849
26957
|
const segment = runAssistantSegments.get(runId) ?? 0;
|
|
@@ -26862,15 +26970,15 @@ function parseCursorEvents(events) {
|
|
|
26862
26970
|
if (message2?.type === "agent") {
|
|
26863
26971
|
messages[activeAssistant.index] = {
|
|
26864
26972
|
...message2,
|
|
26865
|
-
content: `${message2.content}${
|
|
26973
|
+
content: `${message2.content}${text3}`
|
|
26866
26974
|
};
|
|
26867
26975
|
}
|
|
26868
26976
|
}
|
|
26869
26977
|
continue;
|
|
26870
26978
|
}
|
|
26871
26979
|
if (event.type === "cursor-thinking") {
|
|
26872
|
-
const
|
|
26873
|
-
if (
|
|
26980
|
+
const text3 = getCursorThinkingText(event);
|
|
26981
|
+
if (text3.trim()) {
|
|
26874
26982
|
const runId = cursorRunId(event);
|
|
26875
26983
|
if (!activeThinking || activeThinking.runId !== runId) {
|
|
26876
26984
|
const segment = runThinkingSegments.get(runId) ?? 0;
|
|
@@ -26890,7 +26998,7 @@ function parseCursorEvents(events) {
|
|
|
26890
26998
|
if (message2?.type === "reasoning") {
|
|
26891
26999
|
messages[activeThinking.index] = {
|
|
26892
27000
|
...message2,
|
|
26893
|
-
content: `${message2.content}${
|
|
27001
|
+
content: `${message2.content}${text3}`,
|
|
26894
27002
|
status: "in_progress"
|
|
26895
27003
|
};
|
|
26896
27004
|
}
|
|
@@ -26922,12 +27030,12 @@ function parseCursorEvents(events) {
|
|
|
26922
27030
|
}
|
|
26923
27031
|
if (event.type === "cursor-task") {
|
|
26924
27032
|
activeAssistant = null;
|
|
26925
|
-
const
|
|
26926
|
-
if (typeof
|
|
27033
|
+
const text3 = event.payload.text;
|
|
27034
|
+
if (typeof text3 === "string" && text3.trim()) {
|
|
26927
27035
|
messages.push({
|
|
26928
27036
|
id: `cursor-task-${event.timestamp}-${messages.length}`,
|
|
26929
27037
|
type: "agent",
|
|
26930
|
-
content:
|
|
27038
|
+
content: text3,
|
|
26931
27039
|
timestamp: event.timestamp
|
|
26932
27040
|
});
|
|
26933
27041
|
}
|
|
@@ -26982,8 +27090,8 @@ var TRANSIENT_NETWORK_ERROR_PATTERNS = [
|
|
|
26982
27090
|
];
|
|
26983
27091
|
var HTTP_CONTEXT_PATTERN = /(api error|request|response|status|http)/;
|
|
26984
27092
|
var HTTP_STATUS_PATTERN = /(^|[^0-9])([1-5][0-9]{2})(?=$|[^0-9])/g;
|
|
26985
|
-
function isTransientErrorText(
|
|
26986
|
-
const normalized =
|
|
27093
|
+
function isTransientErrorText(text3, options = {}) {
|
|
27094
|
+
const normalized = text3.toLowerCase();
|
|
26987
27095
|
if (!normalized) return false;
|
|
26988
27096
|
if (TRANSIENT_NETWORK_ERROR_PATTERNS.some((pattern) => pattern.test(normalized))) return true;
|
|
26989
27097
|
if (options.includeRateLimit && /rate limit/.test(normalized)) return true;
|
|
@@ -27106,24 +27214,24 @@ function parseOpencodeEvents(events) {
|
|
|
27106
27214
|
const time3 = isRecord(part.time) ? part.time : null;
|
|
27107
27215
|
const timestamp = timestampFromMs(time3?.start, event.timestamp);
|
|
27108
27216
|
if (part.type === "text") {
|
|
27109
|
-
const
|
|
27110
|
-
if (
|
|
27217
|
+
const text3 = typeof part.text === "string" ? part.text : "";
|
|
27218
|
+
if (text3.trim()) {
|
|
27111
27219
|
upsertDisplayMessage(messages, {
|
|
27112
27220
|
id,
|
|
27113
27221
|
type: "agent",
|
|
27114
|
-
content:
|
|
27222
|
+
content: text3,
|
|
27115
27223
|
timestamp
|
|
27116
27224
|
});
|
|
27117
27225
|
}
|
|
27118
27226
|
continue;
|
|
27119
27227
|
}
|
|
27120
27228
|
if (part.type === "reasoning") {
|
|
27121
|
-
const
|
|
27122
|
-
if (
|
|
27229
|
+
const text3 = typeof part.text === "string" ? part.text : "";
|
|
27230
|
+
if (text3.trim()) {
|
|
27123
27231
|
upsertDisplayMessage(messages, {
|
|
27124
27232
|
id,
|
|
27125
27233
|
type: "reasoning",
|
|
27126
|
-
content:
|
|
27234
|
+
content: text3,
|
|
27127
27235
|
status: time3?.end ? "completed" : "in_progress",
|
|
27128
27236
|
timestamp
|
|
27129
27237
|
});
|
|
@@ -27291,7 +27399,7 @@ function assistantErrorMessage(value) {
|
|
|
27291
27399
|
}
|
|
27292
27400
|
function parsePiEvents(events) {
|
|
27293
27401
|
const messages = [];
|
|
27294
|
-
const
|
|
27402
|
+
const text3 = /* @__PURE__ */ new Map();
|
|
27295
27403
|
const thinking = /* @__PURE__ */ new Map();
|
|
27296
27404
|
let activeMessageId = "assistant";
|
|
27297
27405
|
for (const event of events) {
|
|
@@ -27322,9 +27430,9 @@ function parsePiEvents(events) {
|
|
|
27322
27430
|
if (event.type === "pi-message_update") {
|
|
27323
27431
|
const payload = nestedPayload(event);
|
|
27324
27432
|
const id = typeof payload.id === "string" ? payload.id : activeMessageId;
|
|
27325
|
-
if (payload.type === "text_delta" && typeof payload.delta === "string")
|
|
27433
|
+
if (payload.type === "text_delta" && typeof payload.delta === "string") text3.set(id, `${text3.get(id) ?? ""}${payload.delta}`);
|
|
27326
27434
|
if (payload.type === "thinking_delta" && typeof payload.delta === "string") thinking.set(id, `${thinking.get(id) ?? ""}${payload.delta}`);
|
|
27327
|
-
const textContent =
|
|
27435
|
+
const textContent = text3.get(id);
|
|
27328
27436
|
const thinkingContent = thinking.get(id);
|
|
27329
27437
|
if (textContent !== void 0) upsertDisplayMessage(messages, { id: `pi-${id}`, type: "agent", content: textContent, timestamp: event.timestamp });
|
|
27330
27438
|
if (thinkingContent !== void 0) upsertDisplayMessage(messages, { id: `pi-thinking-${id}`, type: "reasoning", content: thinkingContent, status: "in_progress", timestamp: event.timestamp });
|
|
@@ -28474,7 +28582,7 @@ var headlessAgentRequestSchema = external_exports.object({
|
|
|
28474
28582
|
});
|
|
28475
28583
|
|
|
28476
28584
|
// ../shared/src/cli-version.ts
|
|
28477
|
-
var CLI_VERSION = "0.3.
|
|
28585
|
+
var CLI_VERSION = "0.3.50";
|
|
28478
28586
|
|
|
28479
28587
|
// ../shared/src/version.ts
|
|
28480
28588
|
function compareVersions(v1, v2) {
|
|
@@ -28999,6 +29107,24 @@ var updatePresenceRequestSchema = external_exports.object({
|
|
|
28999
29107
|
location: presenceLocationSchema.optional()
|
|
29000
29108
|
});
|
|
29001
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
|
+
|
|
29002
29128
|
// ../shared/src/audit-log.ts
|
|
29003
29129
|
var AUDIT_LOG_ACTION = {
|
|
29004
29130
|
CREATE: "create",
|
|
@@ -29600,8 +29726,8 @@ function renderAuthFlowStep(step, total, title2) {
|
|
|
29600
29726
|
console.log(import_chalk2.default.bold(`
|
|
29601
29727
|
${step}/${total} ${title2}`));
|
|
29602
29728
|
}
|
|
29603
|
-
function renderAuthFlowDetail(
|
|
29604
|
-
console.log(import_chalk2.default.gray(` ${
|
|
29729
|
+
function renderAuthFlowDetail(text3) {
|
|
29730
|
+
console.log(import_chalk2.default.gray(` ${text3}`));
|
|
29605
29731
|
}
|
|
29606
29732
|
function renderAuthFlowSuccess(providerLabel, summary, target) {
|
|
29607
29733
|
console.log(brand.bold(`
|
|
@@ -30874,8 +31000,8 @@ async function exchangeCodeForTokens2(code, state, expectedState, codeVerifier)
|
|
|
30874
31000
|
body: JSON.stringify(payload)
|
|
30875
31001
|
});
|
|
30876
31002
|
if (!response.ok) {
|
|
30877
|
-
const
|
|
30878
|
-
throw new Error(`Failed to exchange authorization code: ${response.status} ${
|
|
31003
|
+
const text3 = await response.text();
|
|
31004
|
+
throw new Error(`Failed to exchange authorization code: ${response.status} ${text3}`);
|
|
30879
31005
|
}
|
|
30880
31006
|
const data = await response.json();
|
|
30881
31007
|
return {
|
|
@@ -31739,9 +31865,9 @@ function formatStatus(status) {
|
|
|
31739
31865
|
if (isWorkspaceSuspendedStatus(status)) return import_chalk20.default.gray(status);
|
|
31740
31866
|
return status;
|
|
31741
31867
|
}
|
|
31742
|
-
function truncate(
|
|
31743
|
-
if (
|
|
31744
|
-
return
|
|
31868
|
+
function truncate(text3, maxLength) {
|
|
31869
|
+
if (text3.length <= maxLength) return text3;
|
|
31870
|
+
return text3.substring(0, maxLength) + "...";
|
|
31745
31871
|
}
|
|
31746
31872
|
function formatDisplayMessage(message2) {
|
|
31747
31873
|
const time3 = new Date(message2.timestamp).toLocaleTimeString();
|
|
@@ -32904,9 +33030,9 @@ function buildTriggersFromOptions(options, runAt, repositories) {
|
|
|
32904
33030
|
}
|
|
32905
33031
|
return triggers;
|
|
32906
33032
|
}
|
|
32907
|
-
function truncate2(
|
|
32908
|
-
if (
|
|
32909
|
-
return
|
|
33033
|
+
function truncate2(text3, maxLength) {
|
|
33034
|
+
if (text3.length <= maxLength) return text3;
|
|
33035
|
+
return text3.substring(0, maxLength) + "...";
|
|
32910
33036
|
}
|
|
32911
33037
|
function formatAgentSummary(automation2) {
|
|
32912
33038
|
const parts = [];
|