replicas-cli 0.3.581 → 0.3.584
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 +173 -320
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9464,8 +9464,8 @@ var init_lt = __esm({
|
|
|
9464
9464
|
"../node_modules/.bun/zod@4.6.6/node_modules/zod/v4/locales/lt.js"() {
|
|
9465
9465
|
"use strict";
|
|
9466
9466
|
init_util();
|
|
9467
|
-
capitalizeFirstCharacter = (
|
|
9468
|
-
return
|
|
9467
|
+
capitalizeFirstCharacter = (text3) => {
|
|
9468
|
+
return text3.charAt(0).toUpperCase() + text3.slice(1);
|
|
9469
9469
|
};
|
|
9470
9470
|
error33 = () => {
|
|
9471
9471
|
const Sizable = {
|
|
@@ -21463,7 +21463,7 @@ function customPalette(custom2) {
|
|
|
21463
21463
|
};
|
|
21464
21464
|
}
|
|
21465
21465
|
function readableText(color, { background, selected }) {
|
|
21466
|
-
const score = (
|
|
21466
|
+
const score = (text3) => Math.min(contrast(text3, background), contrast(text3, selected));
|
|
21467
21467
|
let best = color;
|
|
21468
21468
|
for (let step = 0; step <= 20 && score(best) < 4.5; step++) {
|
|
21469
21469
|
best = ["#ffffff", "#000000"].map((toward) => mix(color, toward, step / 20)).reduce((a, b) => score(b) > score(a) ? b : a);
|
|
@@ -22772,14 +22772,14 @@ function coerceClaudePartialMessagePayload(payload) {
|
|
|
22772
22772
|
const streamId = payload.streamId;
|
|
22773
22773
|
if (typeof streamId !== "string" || !streamId) return null;
|
|
22774
22774
|
const parentToolUseId = payload.parent_tool_use_id;
|
|
22775
|
-
const
|
|
22775
|
+
const text3 = typeof payload.text === "string" && payload.text ? payload.text : void 0;
|
|
22776
22776
|
const thinking = typeof payload.thinking === "string" && payload.thinking ? payload.thinking : void 0;
|
|
22777
22777
|
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;
|
|
22778
|
-
if (!
|
|
22778
|
+
if (!text3 && !thinking && !tool) return null;
|
|
22779
22779
|
return {
|
|
22780
22780
|
streamId,
|
|
22781
22781
|
parent_tool_use_id: typeof parentToolUseId === "string" ? parentToolUseId : null,
|
|
22782
|
-
...
|
|
22782
|
+
...text3 ? { text: text3 } : {},
|
|
22783
22783
|
...thinking ? { thinking } : {},
|
|
22784
22784
|
...tool ? { tool } : {},
|
|
22785
22785
|
status: payload.status === "completed" ? "completed" : "in_progress"
|
|
@@ -27055,7 +27055,6 @@ var init_preferences = __esm({
|
|
|
27055
27055
|
keyboard_shortcuts: {},
|
|
27056
27056
|
manager_tour_seen: false,
|
|
27057
27057
|
slack_settings_moved_notice: false,
|
|
27058
|
-
manager_board_opened: false,
|
|
27059
27058
|
follow_up_mode: "steer",
|
|
27060
27059
|
send_key: "enter",
|
|
27061
27060
|
memory_enabled: null,
|
|
@@ -27657,10 +27656,6 @@ var init_replicas_mcp = __esm({
|
|
|
27657
27656
|
archiveSubagent: "archive_subagent",
|
|
27658
27657
|
mergeWhenReady: "merge_when_ready",
|
|
27659
27658
|
waitForSubagents: "wait_for_subagents",
|
|
27660
|
-
getBoard: "get_board",
|
|
27661
|
-
updateBoard: "update_board",
|
|
27662
|
-
updateTicket: "update_ticket",
|
|
27663
|
-
replyOnTicket: "reply_on_ticket",
|
|
27664
27659
|
sendToChat: "send_to_chat",
|
|
27665
27660
|
setStatus: "set_status",
|
|
27666
27661
|
getLinearRouting: "get_linear_routing",
|
|
@@ -27857,36 +27852,36 @@ var init_replicas_agent = __esm({
|
|
|
27857
27852
|
});
|
|
27858
27853
|
|
|
27859
27854
|
// ../shared/src/prompts.ts
|
|
27860
|
-
function removeTag(
|
|
27855
|
+
function removeTag(text3, tag) {
|
|
27861
27856
|
const regex = new RegExp(`<${tag}>[\\s\\S]*?</${tag}>`, "g");
|
|
27862
|
-
return
|
|
27857
|
+
return text3.replace(regex, "").trim();
|
|
27863
27858
|
}
|
|
27864
|
-
function stripReplicasInstructionBlock(
|
|
27865
|
-
return removeTag(
|
|
27859
|
+
function stripReplicasInstructionBlock(text3) {
|
|
27860
|
+
return removeTag(text3, REPLICAS_INSTRUCTIONS_TAG);
|
|
27866
27861
|
}
|
|
27867
|
-
function stripInstructionBlocksOutside(
|
|
27862
|
+
function stripInstructionBlocksOutside(text3, ranges) {
|
|
27868
27863
|
const outside = (index) => !ranges.some(([start, end]) => index >= start && index < end);
|
|
27869
27864
|
let kept = "";
|
|
27870
27865
|
let from = 0;
|
|
27871
|
-
for (let open4 =
|
|
27866
|
+
for (let open4 = text3.indexOf(INSTRUCTIONS_OPEN); open4 !== -1; open4 = text3.indexOf(INSTRUCTIONS_OPEN, Math.max(from, open4 + 1))) {
|
|
27872
27867
|
if (!outside(open4)) continue;
|
|
27873
|
-
let close =
|
|
27874
|
-
while (close !== -1 && !outside(close)) close =
|
|
27868
|
+
let close = text3.indexOf(INSTRUCTIONS_CLOSE, open4);
|
|
27869
|
+
while (close !== -1 && !outside(close)) close = text3.indexOf(INSTRUCTIONS_CLOSE, close + 1);
|
|
27875
27870
|
if (close === -1) break;
|
|
27876
|
-
kept +=
|
|
27871
|
+
kept += text3.slice(from, open4);
|
|
27877
27872
|
from = close + INSTRUCTIONS_CLOSE.length;
|
|
27878
27873
|
}
|
|
27879
|
-
return (kept +
|
|
27874
|
+
return (kept + text3.slice(from)).trim();
|
|
27880
27875
|
}
|
|
27881
|
-
function stripAgentInstructionBlocks(
|
|
27882
|
-
if (!
|
|
27876
|
+
function stripAgentInstructionBlocks(text3) {
|
|
27877
|
+
if (!text3.includes(INSTRUCTIONS_OPEN)) return text3.trim();
|
|
27883
27878
|
const quoted = [];
|
|
27884
27879
|
const pair = (start, end) => {
|
|
27885
27880
|
const at2 = [];
|
|
27886
27881
|
const length = [];
|
|
27887
27882
|
const run2 = /`+/g;
|
|
27888
27883
|
run2.lastIndex = start;
|
|
27889
|
-
for (let found = run2.exec(
|
|
27884
|
+
for (let found = run2.exec(text3); found && found.index < end; found = run2.exec(text3)) {
|
|
27890
27885
|
at2.push(found.index);
|
|
27891
27886
|
length.push(found[0].length);
|
|
27892
27887
|
}
|
|
@@ -27900,28 +27895,28 @@ function stripAgentInstructionBlocks(text4) {
|
|
|
27900
27895
|
if (next[i] !== -1) quoted.push([at2[i], at2[next[i]] + length[next[i]]]);
|
|
27901
27896
|
}
|
|
27902
27897
|
};
|
|
27903
|
-
const tags = [...
|
|
27898
|
+
const tags = [...text3.matchAll(new RegExp(`</?${REPLICAS_INSTRUCTIONS_TAG}>`, "g"))].map((tag) => tag.index ?? 0);
|
|
27904
27899
|
const paragraphs = /* @__PURE__ */ new Set();
|
|
27905
27900
|
const spans = (from, to) => {
|
|
27906
27901
|
for (const tag of tags) {
|
|
27907
27902
|
if (tag < from || tag >= to) continue;
|
|
27908
|
-
let start =
|
|
27909
|
-
for (let previous =
|
|
27903
|
+
let start = text3.lastIndexOf("\n", tag - 1) + 1;
|
|
27904
|
+
for (let previous = text3.lastIndexOf("\n", start - 2) + 1; start > from && text3.slice(previous, start - 1).trim(); previous = text3.lastIndexOf("\n", start - 2) + 1) start = previous;
|
|
27910
27905
|
start = Math.max(start, from);
|
|
27911
27906
|
if (paragraphs.has(start)) continue;
|
|
27912
27907
|
paragraphs.add(start);
|
|
27913
27908
|
const blank = /\n[ \t]*\n/g;
|
|
27914
27909
|
blank.lastIndex = tag;
|
|
27915
|
-
const end = Math.min(to, blank.exec(
|
|
27910
|
+
const end = Math.min(to, blank.exec(text3)?.index ?? to);
|
|
27916
27911
|
pair(start, end);
|
|
27917
27912
|
}
|
|
27918
27913
|
};
|
|
27919
27914
|
let fence = null;
|
|
27920
27915
|
let prose = 0;
|
|
27921
27916
|
let at = 0;
|
|
27922
|
-
for (let end = 0; at <
|
|
27923
|
-
end =
|
|
27924
|
-
const line =
|
|
27917
|
+
for (let end = 0; at < text3.length; at = end) {
|
|
27918
|
+
end = text3.indexOf("\n", at) + 1 || text3.length;
|
|
27919
|
+
const line = text3.slice(at, end);
|
|
27925
27920
|
const prefix = new RegExp(`^(?: {0,3}>[ \\t]?)${fence ? `{0,${fence.depth}}` : "*"}`).exec(line)?.[0] ?? "";
|
|
27926
27921
|
const quote = line.slice(prefix.length);
|
|
27927
27922
|
const opener = fence ? quote : quote.replace(/^\s*(?:[-*+]|\d+[.)])\s+/, "");
|
|
@@ -27938,9 +27933,9 @@ function stripAgentInstructionBlocks(text4) {
|
|
|
27938
27933
|
fence = { marker, start: at, depth: (prefix.match(/>/g) ?? []).length };
|
|
27939
27934
|
} else if (line[0] === " " || line.startsWith(" ")) quoted.push([at, end]);
|
|
27940
27935
|
}
|
|
27941
|
-
if (fence) quoted.push([fence.start,
|
|
27942
|
-
else spans(prose,
|
|
27943
|
-
return stripInstructionBlocksOutside(
|
|
27936
|
+
if (fence) quoted.push([fence.start, text3.length]);
|
|
27937
|
+
else spans(prose, text3.length);
|
|
27938
|
+
return stripInstructionBlocksOutside(text3, quoted);
|
|
27944
27939
|
}
|
|
27945
27940
|
var REPLICAS_INSTRUCTIONS_TAG, fenceMarker, INSTRUCTIONS_OPEN, INSTRUCTIONS_CLOSE, T, SCOUT_LINEAR_RULES, SCOUT_MUTED_RULES, SCOUT_PRIOR_UNTAGGED_RULES, SCOUT_JOINED_RULES, SCOUT_REACTION_RULES;
|
|
27946
27941
|
var init_prompts = __esm({
|
|
@@ -27978,42 +27973,6 @@ Check every mutation and tool call succeeded. Never put routing metadata in visi
|
|
|
27978
27973
|
}
|
|
27979
27974
|
});
|
|
27980
27975
|
|
|
27981
|
-
// ../shared/src/manager-prompts-common.ts
|
|
27982
|
-
var managerEventChatNote, managerChatRule;
|
|
27983
|
-
var init_manager_prompts_common = __esm({
|
|
27984
|
-
"../shared/src/manager-prompts-common.ts"() {
|
|
27985
|
-
"use strict";
|
|
27986
|
-
init_replicas_mcp();
|
|
27987
|
-
init_prompts();
|
|
27988
|
-
managerEventChatNote = (then) => `If a message the user typed in this turn is still unanswered, your final reply answers it and they see it. Otherwise they don't see text you write in this turn: if it brings something they asked for, or a blocker that needs them, send it with ${REPLICAS_MCP_TOOLS.sendToChat}; then ${then}end with a one-line note.`;
|
|
27989
|
-
managerChatRule = (view, news) => `- The chat is like texting an assistant. In a turn the user typed, they see the text you write between tool calls as it streams, your final reply, what you send with \`${REPLICAS_MCP_TOOLS.sendToChat}\`, and your \`${REPLICAS_MCP_TOOLS.setStatus}\` line, never your tool calls. Unless you can answer right away, open with one line on what you'll do first and roughly how long it takes. Then call \`${REPLICAS_MCP_TOOLS.setStatus}\` with a few words on your current step, such as "Reading the billing webhook", and again each time you move to a new step. Before your final reply, write only what they'd want to know now: ${news}. Never narrate tool calls or say you're still working. When they message you mid-turn, reply in one line before anything else, then fold it into your work. Write in a line or two with links and any media inline, and never restate ${view} in chat.`;
|
|
27990
|
-
}
|
|
27991
|
-
});
|
|
27992
|
-
|
|
27993
|
-
// ../shared/src/manager-prompts-legacy.ts
|
|
27994
|
-
var MANAGER_EVENT_CHAT_NOTE, BOARD_ANSWER_NOTE, MERGE_RULE, BOARD_RULES, MANAGER_TICKET_MESSAGE_NOTE, MANAGER_TICKET_REPLY_NUDGE;
|
|
27995
|
-
var init_manager_prompts_legacy = __esm({
|
|
27996
|
-
"../shared/src/manager-prompts-legacy.ts"() {
|
|
27997
|
-
"use strict";
|
|
27998
|
-
init_replicas_mcp();
|
|
27999
|
-
init_manager_prompts_common();
|
|
28000
|
-
init_prompts();
|
|
28001
|
-
MANAGER_EVENT_CHAT_NOTE = managerEventChatNote("update the board if its order, notes or overview changed, and ");
|
|
28002
|
-
BOARD_ANSWER_NOTE = "The user answered on the board.";
|
|
28003
|
-
MERGE_RULE = `- When a pull request should merge once it's approved and CI passes, call \`${REPLICAS_MCP_TOOLS.mergeWhenReady}\`: Replicas merges it and sends \`merged\`, or \`needs_attention\` saying why it can't. Never watch CI or pull requests with \`gh\`, sleep loops or wait scripts, and merge one yourself only when the user wants it merged right away.`;
|
|
28004
|
-
BOARD_RULES = `- The board in the Ships pane beside this chat is the user's one view of the work: one ticket per task they ask for, holding only that task's pull requests. Replicas fills in each ticket's title, summaries, section and pull requests from the task, the ship's reports and its pull requests, so never restate what a ticket shows, and correct one with \`${REPLICAS_MCP_TOOLS.updateBoard}\` only when it's wrong.
|
|
28005
|
-
- Keep the board organized with \`${REPLICAS_MCP_TOOLS.updateBoard}\`: tickets in order, most important first; one short note per ticket only when it adds something, such as "Merge after #12"; and one overview line on where the work as a whole stands. Archive tickets the user no longer needs.
|
|
28006
|
-
- Ask the user only for decisions you truly can't make. Make routine calls yourself, such as retries, small scope choices or test cleanup. For a question of your own, create a ticket with it; the user's answer comes to you here, marked "${BOARD_ANSWER_NOTE}". Answers to a ship's questions go straight to that ship.
|
|
28007
|
-
- A ship with open pull requests is not done when it sends \`finished\`: Replicas fixes their CI failures and review comments automatically, then sends \`ready\` or \`needs_attention\`. On \`needs_attention\`, direct the ship, or ask the user only if you can't decide.
|
|
28008
|
-
${MERGE_RULE}
|
|
28009
|
-
- On every ship event and board answer, act with tools on whatever it unblocks, such as starting the next task once a pull request merges, and update the board if it changed. The user sees nothing you write in these turns unless a message they typed is still unanswered; otherwise reach them only with \`${REPLICAS_MCP_TOOLS.sendToChat}\`, and only for what they'd want right now: a deliverable they asked for, with its media, links or answer; a blocker that needs them, also on the board; or a request of theirs being done. Never for status, such as "PR #12 merged" or "I asked the ship to\u2026". End the turn with a one-line note of what you did.
|
|
28010
|
-
${managerChatRule("the board", "a finding that changes the answer, a ship you started, or a decision you need")}
|
|
28011
|
-
`;
|
|
28012
|
-
MANAGER_TICKET_MESSAGE_NOTE = `The user sent this from your ticket on the Manager's board and reads your answer there, not in this chat. Answer them with \`${REPLICAS_MCP_TOOLS.replyOnTicket}\`: briefly, with a link or screenshot if it helps, and a follow-up question only if you need one. Keep longer work and detail in this chat.`;
|
|
28013
|
-
MANAGER_TICKET_REPLY_NUDGE = `The user is still waiting for your answer on your ticket, and they only read the ticket. Answer them now with \`${REPLICAS_MCP_TOOLS.replyOnTicket}\`, briefly.`;
|
|
28014
|
-
}
|
|
28015
|
-
});
|
|
28016
|
-
|
|
28017
27976
|
// ../shared/src/message-origin.ts
|
|
28018
27977
|
function parseAutomationRun(raw) {
|
|
28019
27978
|
const match = raw.match(AUTOMATION_RUN);
|
|
@@ -28047,14 +28006,14 @@ function parseMessageOrigin(raw) {
|
|
|
28047
28006
|
const automation2 = raw.match(SCHEDULED_FOLLOW_UP);
|
|
28048
28007
|
return automation2 ? { kind: "automation", id: automation2[2], name: automation2[1].trim(), body: stripReplicasInstructionBlock(raw.slice(automation2[0].length)) } : null;
|
|
28049
28008
|
}
|
|
28050
|
-
var UUID, WORKSPACE_SENDER_LINE, WORKSPACE_SENDER, BOARD_ANSWER, AUTOMATION_RUN_PREFIX, AUTOMATION_RUN, SCHEDULED_NOTE, SCHEDULED_FOLLOW_UP;
|
|
28009
|
+
var BOARD_ANSWER_NOTE, UUID, WORKSPACE_SENDER_LINE, WORKSPACE_SENDER, BOARD_ANSWER, AUTOMATION_RUN_PREFIX, AUTOMATION_RUN, SCHEDULED_NOTE, SCHEDULED_FOLLOW_UP;
|
|
28051
28010
|
var init_message_origin = __esm({
|
|
28052
28011
|
"../shared/src/message-origin.ts"() {
|
|
28053
28012
|
"use strict";
|
|
28054
28013
|
init_prompts();
|
|
28055
|
-
init_manager_prompts_legacy();
|
|
28056
28014
|
init_type_guards();
|
|
28057
28015
|
init_uuid();
|
|
28016
|
+
BOARD_ANSWER_NOTE = "The user answered on the board.";
|
|
28058
28017
|
UUID = UUID_RE.source.slice(1, -1);
|
|
28059
28018
|
WORKSPACE_SENDER_LINE = String.raw`<${REPLICAS_INSTRUCTIONS_TAG}>\nFrom the workspace ("(?:[^"\\\n]|\\.)*") \((${UUID})\)\.\n</${REPLICAS_INSTRUCTIONS_TAG}>`;
|
|
28060
28019
|
WORKSPACE_SENDER = new RegExp(String.raw`^\s*${WORKSPACE_SENDER_LINE}`);
|
|
@@ -28085,12 +28044,12 @@ function parseChange(line, quote) {
|
|
|
28085
28044
|
const [, field2, from, to] = rest.match(TRANSITION) ?? [];
|
|
28086
28045
|
const transition = transitionSchema.safeParse({ field: field2, from, to }).data;
|
|
28087
28046
|
const labels = !transition ? [] : transition.field === "status" ? [ISSUE_STATUS_LABELS[transition.from], ISSUE_STATUS_LABELS[transition.to]] : [ISSUE_PRIORITY_LABELS[transition.from], ISSUE_PRIORITY_LABELS[transition.to]];
|
|
28088
|
-
const
|
|
28047
|
+
const text3 = transition ? `changed the ${transition.field}: ${labels.join(" \u2192 ")}` : rest;
|
|
28089
28048
|
const excerpt = quote.split("\n").map((quoted) => quoted.trim()).find(Boolean);
|
|
28090
|
-
return { actor: match?.[1] ?? "", agent: Boolean(match?.[2]), text: excerpt ? `${
|
|
28049
|
+
return { actor: match?.[1] ?? "", agent: Boolean(match?.[2]), text: excerpt ? `${text3}: ${excerpt}` : text3, ...quote ? { quote } : {}, ...transition ? { transition } : {} };
|
|
28091
28050
|
}
|
|
28092
|
-
function extractIssueEvents(
|
|
28093
|
-
return [...
|
|
28051
|
+
function extractIssueEvents(text3) {
|
|
28052
|
+
return [...text3.matchAll(tagBlockPattern(ISSUE_EVENT_TAG))].flatMap((match) => {
|
|
28094
28053
|
const attributes = parseTagAttributes(match[1]);
|
|
28095
28054
|
if (!attributes.issue) return [];
|
|
28096
28055
|
const detail = match[2].replaceAll(`<\\/${ISSUE_EVENT_TAG}`, `</${ISSUE_EVENT_TAG}`).trim();
|
|
@@ -28131,8 +28090,8 @@ var init_issue_events = __esm({
|
|
|
28131
28090
|
});
|
|
28132
28091
|
|
|
28133
28092
|
// ../shared/src/manager-events.ts
|
|
28134
|
-
function extractManagerEvents(
|
|
28135
|
-
return [...
|
|
28093
|
+
function extractManagerEvents(text3) {
|
|
28094
|
+
return [...text3.matchAll(BLOCK)].flatMap((match) => {
|
|
28136
28095
|
const attributes = parseTagAttributes(match[1]);
|
|
28137
28096
|
if (!attributes.kind || !attributes.id || !attributes.agent_id) return [];
|
|
28138
28097
|
const kind = MANAGER_EVENT_KINDS.find((candidate) => candidate === attributes.kind) ?? UNKNOWN_EVENT_KIND;
|
|
@@ -28147,14 +28106,13 @@ function extractManagerEvents(text4) {
|
|
|
28147
28106
|
summary: summary.trim(),
|
|
28148
28107
|
...detail ? { detail } : {},
|
|
28149
28108
|
...attributes.chat_id ? { chatId: attributes.chat_id } : {},
|
|
28150
|
-
...attributes.ticket_id ? { ticket: { id: attributes.ticket_id, title: attributes.ticket ?? "" } } : {},
|
|
28151
28109
|
...attributes.noticed === "true" ? { noticed: true } : {}
|
|
28152
28110
|
}];
|
|
28153
28111
|
});
|
|
28154
28112
|
}
|
|
28155
|
-
function parseManagerEvents(
|
|
28156
|
-
const events = [...extractManagerEvents(
|
|
28157
|
-
return events.length > 0 &&
|
|
28113
|
+
function parseManagerEvents(text3) {
|
|
28114
|
+
const events = [...extractManagerEvents(text3), ...extractIssueEvents(text3)];
|
|
28115
|
+
return events.length > 0 && text3.replace(BLOCK, "").replace(ISSUE_BLOCK, "").replaceAll(MERGED_MESSAGE_SEPARATOR.trim(), "").trim() === "" ? events : null;
|
|
28158
28116
|
}
|
|
28159
28117
|
function stripManagerEventNotes(content) {
|
|
28160
28118
|
return stripInstructionBlocksOutside(content, [...content.matchAll(BLOCK), ...content.matchAll(ISSUE_BLOCK)].map((block) => [block.index, block.index + block[0].length]));
|
|
@@ -28183,7 +28141,6 @@ var init_manager_events = __esm({
|
|
|
28183
28141
|
detail: external_exports.string().optional(),
|
|
28184
28142
|
// Set when the subagent is a chat in this workspace rather than a ship; agentId is then that chat's id.
|
|
28185
28143
|
chatId: external_exports.string().optional(),
|
|
28186
|
-
ticket: external_exports.object({ id: external_exports.string(), title: external_exports.string() }).optional(),
|
|
28187
28144
|
issue: external_exports.object({ title: external_exports.string(), url: external_exports.string(), changes: external_exports.array(issueEventChangeSchema) }).optional(),
|
|
28188
28145
|
// Set on events recorded before every kind woke the orchestrator, which were shown as a row when they happened.
|
|
28189
28146
|
noticed: external_exports.boolean().optional()
|
|
@@ -28406,8 +28363,8 @@ function indexOrEnd(src, search, from) {
|
|
|
28406
28363
|
const index = src.indexOf(search, from);
|
|
28407
28364
|
return index < 0 ? src.length : index;
|
|
28408
28365
|
}
|
|
28409
|
-
function decodeAnsiC(
|
|
28410
|
-
return
|
|
28366
|
+
function decodeAnsiC(text3) {
|
|
28367
|
+
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) => {
|
|
28411
28368
|
if (escape[0] === "x" || escape[0] === "u") return String.fromCharCode(parseInt(escape.slice(1), 16));
|
|
28412
28369
|
if (/^[0-7]/.test(escape)) return String.fromCharCode(parseInt(escape, 8));
|
|
28413
28370
|
return ANSI_C_ESCAPES[escape] ?? escape;
|
|
@@ -28424,8 +28381,8 @@ function staticOutput(argv, stdin) {
|
|
|
28424
28381
|
if (flags.includes("n")) newline = false;
|
|
28425
28382
|
if (flags.includes("e")) escapes = true;
|
|
28426
28383
|
}
|
|
28427
|
-
const
|
|
28428
|
-
return (escapes ? decodeAnsiC(
|
|
28384
|
+
const text3 = args.join(" ");
|
|
28385
|
+
return (escapes ? decodeAnsiC(text3) : text3) + (newline ? "\n" : "");
|
|
28429
28386
|
}
|
|
28430
28387
|
if (name === "printf" && args.length > 0) {
|
|
28431
28388
|
const format = decodeAnsiC(args[0]);
|
|
@@ -28586,8 +28543,8 @@ function parseUntil(scope, start, closeParen, untilDone = false) {
|
|
|
28586
28543
|
let afterOr = false;
|
|
28587
28544
|
const conditional = /* @__PURE__ */ new Set();
|
|
28588
28545
|
const scoped = /* @__PURE__ */ new Set();
|
|
28589
|
-
const append = (
|
|
28590
|
-
word = (word ?? "") +
|
|
28546
|
+
const append = (text3, isQuoted = false) => {
|
|
28547
|
+
word = (word ?? "") + text3;
|
|
28591
28548
|
quoted || (quoted = isQuoted);
|
|
28592
28549
|
};
|
|
28593
28550
|
const endWord = () => {
|
|
@@ -30004,14 +29961,14 @@ var require_foldFlowLines = __commonJS({
|
|
|
30004
29961
|
var FOLD_FLOW = "flow";
|
|
30005
29962
|
var FOLD_BLOCK = "block";
|
|
30006
29963
|
var FOLD_QUOTED = "quoted";
|
|
30007
|
-
function foldFlowLines(
|
|
29964
|
+
function foldFlowLines(text3, indent, mode = "flow", { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {
|
|
30008
29965
|
if (!lineWidth || lineWidth < 0)
|
|
30009
|
-
return
|
|
29966
|
+
return text3;
|
|
30010
29967
|
if (lineWidth < minContentWidth)
|
|
30011
29968
|
minContentWidth = 0;
|
|
30012
29969
|
const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);
|
|
30013
|
-
if (
|
|
30014
|
-
return
|
|
29970
|
+
if (text3.length <= endStep)
|
|
29971
|
+
return text3;
|
|
30015
29972
|
const folds = [];
|
|
30016
29973
|
const escapedFolds = {};
|
|
30017
29974
|
let end = lineWidth - indent.length;
|
|
@@ -30028,14 +29985,14 @@ var require_foldFlowLines = __commonJS({
|
|
|
30028
29985
|
let escStart = -1;
|
|
30029
29986
|
let escEnd = -1;
|
|
30030
29987
|
if (mode === FOLD_BLOCK) {
|
|
30031
|
-
i = consumeMoreIndentedLines(
|
|
29988
|
+
i = consumeMoreIndentedLines(text3, i, indent.length);
|
|
30032
29989
|
if (i !== -1)
|
|
30033
29990
|
end = i + endStep;
|
|
30034
29991
|
}
|
|
30035
|
-
for (let ch; ch =
|
|
29992
|
+
for (let ch; ch = text3[i += 1]; ) {
|
|
30036
29993
|
if (mode === FOLD_QUOTED && ch === "\\") {
|
|
30037
29994
|
escStart = i;
|
|
30038
|
-
switch (
|
|
29995
|
+
switch (text3[i + 1]) {
|
|
30039
29996
|
case "x":
|
|
30040
29997
|
i += 3;
|
|
30041
29998
|
break;
|
|
@@ -30052,12 +30009,12 @@ var require_foldFlowLines = __commonJS({
|
|
|
30052
30009
|
}
|
|
30053
30010
|
if (ch === "\n") {
|
|
30054
30011
|
if (mode === FOLD_BLOCK)
|
|
30055
|
-
i = consumeMoreIndentedLines(
|
|
30012
|
+
i = consumeMoreIndentedLines(text3, i, indent.length);
|
|
30056
30013
|
end = i + indent.length + endStep;
|
|
30057
30014
|
split = void 0;
|
|
30058
30015
|
} else {
|
|
30059
30016
|
if (ch === " " && prev && prev !== " " && prev !== "\n" && prev !== " ") {
|
|
30060
|
-
const next =
|
|
30017
|
+
const next = text3[i + 1];
|
|
30061
30018
|
if (next && next !== " " && next !== "\n" && next !== " ")
|
|
30062
30019
|
split = i;
|
|
30063
30020
|
}
|
|
@@ -30069,12 +30026,12 @@ var require_foldFlowLines = __commonJS({
|
|
|
30069
30026
|
} else if (mode === FOLD_QUOTED) {
|
|
30070
30027
|
while (prev === " " || prev === " ") {
|
|
30071
30028
|
prev = ch;
|
|
30072
|
-
ch =
|
|
30029
|
+
ch = text3[i += 1];
|
|
30073
30030
|
overflow = true;
|
|
30074
30031
|
}
|
|
30075
30032
|
const j = i > escEnd + 1 ? i - 2 : escStart - 1;
|
|
30076
30033
|
if (escapedFolds[j])
|
|
30077
|
-
return
|
|
30034
|
+
return text3;
|
|
30078
30035
|
folds.push(j);
|
|
30079
30036
|
escapedFolds[j] = true;
|
|
30080
30037
|
end = j + endStep;
|
|
@@ -30089,39 +30046,39 @@ var require_foldFlowLines = __commonJS({
|
|
|
30089
30046
|
if (overflow && onOverflow)
|
|
30090
30047
|
onOverflow();
|
|
30091
30048
|
if (folds.length === 0)
|
|
30092
|
-
return
|
|
30049
|
+
return text3;
|
|
30093
30050
|
if (onFold)
|
|
30094
30051
|
onFold();
|
|
30095
|
-
let res =
|
|
30052
|
+
let res = text3.slice(0, folds[0]);
|
|
30096
30053
|
for (let i2 = 0; i2 < folds.length; ++i2) {
|
|
30097
30054
|
const fold = folds[i2];
|
|
30098
|
-
const end2 = folds[i2 + 1] ||
|
|
30055
|
+
const end2 = folds[i2 + 1] || text3.length;
|
|
30099
30056
|
if (fold === 0)
|
|
30100
30057
|
res = `
|
|
30101
|
-
${indent}${
|
|
30058
|
+
${indent}${text3.slice(0, end2)}`;
|
|
30102
30059
|
else {
|
|
30103
30060
|
if (mode === FOLD_QUOTED && escapedFolds[fold])
|
|
30104
|
-
res += `${
|
|
30061
|
+
res += `${text3[fold]}\\`;
|
|
30105
30062
|
res += `
|
|
30106
|
-
${indent}${
|
|
30063
|
+
${indent}${text3.slice(fold + 1, end2)}`;
|
|
30107
30064
|
}
|
|
30108
30065
|
}
|
|
30109
30066
|
return res;
|
|
30110
30067
|
}
|
|
30111
|
-
function consumeMoreIndentedLines(
|
|
30068
|
+
function consumeMoreIndentedLines(text3, i, indent) {
|
|
30112
30069
|
let end = i;
|
|
30113
30070
|
let start = i + 1;
|
|
30114
|
-
let ch =
|
|
30071
|
+
let ch = text3[start];
|
|
30115
30072
|
while (ch === " " || ch === " ") {
|
|
30116
30073
|
if (i < start + indent) {
|
|
30117
|
-
ch =
|
|
30074
|
+
ch = text3[++i];
|
|
30118
30075
|
} else {
|
|
30119
30076
|
do {
|
|
30120
|
-
ch =
|
|
30077
|
+
ch = text3[++i];
|
|
30121
30078
|
} while (ch && ch !== "\n");
|
|
30122
30079
|
end = i;
|
|
30123
30080
|
start = i + 1;
|
|
30124
|
-
ch =
|
|
30081
|
+
ch = text3[start];
|
|
30125
30082
|
}
|
|
30126
30083
|
}
|
|
30127
30084
|
return end;
|
|
@@ -36420,110 +36377,6 @@ var init_workspace_target = __esm({
|
|
|
36420
36377
|
}
|
|
36421
36378
|
});
|
|
36422
36379
|
|
|
36423
|
-
// ../shared/src/manager-board.ts
|
|
36424
|
-
var MANAGER_TICKET_LIMITS, L, tooLong, text3, clearable, httpsUrl, inlineMarkdown, markdown, linearIdentifier, mediaSchema, questionSchema, managerTicketTitleSchema, managerTicketTaskSchema, managerTicketMediaSchema, managerTicketQuestionsSchema, issueSchema2, fixSchema, updateManagerTicketRequestSchema, updateManagerBoardRequestSchema, answerManagerTicketRequestSchema, managerTicketAnswerRefSchema, replyOnManagerTicketRequestSchema, managerTicketReplyRefSchema, managerTicketThreadSchema, LINEAR_ISSUE_SUMMARIES_MAX, linearIssueSummariesRequestSchema;
|
|
36425
|
-
var init_manager_board = __esm({
|
|
36426
|
-
"../shared/src/manager-board.ts"() {
|
|
36427
|
-
"use strict";
|
|
36428
|
-
init_zod();
|
|
36429
|
-
init_manager();
|
|
36430
|
-
init_manager_events();
|
|
36431
|
-
init_urls();
|
|
36432
|
-
init_format();
|
|
36433
|
-
MANAGER_TICKET_LIMITS = {
|
|
36434
|
-
title: 80,
|
|
36435
|
-
task: 1e3,
|
|
36436
|
-
issue: 1e3,
|
|
36437
|
-
fix: 800,
|
|
36438
|
-
note: 100,
|
|
36439
|
-
overview: 160,
|
|
36440
|
-
question: 300,
|
|
36441
|
-
option: 60,
|
|
36442
|
-
options: 3,
|
|
36443
|
-
questions: 2,
|
|
36444
|
-
blocked: 200,
|
|
36445
|
-
media: 6,
|
|
36446
|
-
caption: 80,
|
|
36447
|
-
answer: 2e3,
|
|
36448
|
-
reply: 600
|
|
36449
|
-
};
|
|
36450
|
-
L = MANAGER_TICKET_LIMITS;
|
|
36451
|
-
tooLong = (max) => `At most ${max} characters. Keep it short; the user should take it in at a glance`;
|
|
36452
|
-
text3 = (max) => external_exports.string().trim().min(1).max(max, tooLong(max));
|
|
36453
|
-
clearable = (schema) => external_exports.union([schema, external_exports.literal("")]).optional();
|
|
36454
|
-
httpsUrl = external_exports.url({ protocol: /^https$/, error: "Must be an https URL" });
|
|
36455
|
-
inlineMarkdown = "Markdown: **bold**, *italics*, `code`, [links](https://... or an absolute file path)";
|
|
36456
|
-
markdown = `${inlineMarkdown} and line breaks.`;
|
|
36457
|
-
linearIdentifier = external_exports.string().regex(/^[A-Za-z][A-Za-z0-9]{0,9}-\d{1,7}$/, "Use a Linear identifier such as REP-123");
|
|
36458
|
-
mediaSchema = external_exports.object({
|
|
36459
|
-
url: httpsUrl.describe("The URL `replicas media upload` printed."),
|
|
36460
|
-
caption: text3(L.caption).describe('What it shows, such as "After: the list stays pinned".'),
|
|
36461
|
-
kind: external_exports.enum(["image", "video"]).describe("video for recordings, image for screenshots and GIFs.")
|
|
36462
|
-
});
|
|
36463
|
-
questionSchema = external_exports.object({
|
|
36464
|
-
question: text3(L.question).describe("One question, with the context needed to answer it."),
|
|
36465
|
-
options: external_exports.array(text3(L.option)).max(L.options).optional().describe("Up to three answers to pick from, recommended first. The user can always write their own.")
|
|
36466
|
-
});
|
|
36467
|
-
managerTicketTitleSchema = text3(L.title).describe(`What the task is about, in a few plain words, such as "Slack replies in Manager channels get dropped" or "Add CSV export to Analytics". Never a ship, branch or pull request name. At most ${L.title} characters.`);
|
|
36468
|
-
managerTicketTaskSchema = text3(L.task);
|
|
36469
|
-
managerTicketMediaSchema = external_exports.array(mediaSchema);
|
|
36470
|
-
managerTicketQuestionsSchema = external_exports.array(questionSchema.extend({ id: external_exports.string() }));
|
|
36471
|
-
issueSchema2 = clearable(text3(L.issue)).describe(`What was wrong or what was asked, in a few plain sentences a busy reader understands: the problem, not the fix. Carry the evidence: Slack and Linear threads as links, customer quotes in quotation marks, and screenshots in \`media\`. ${markdown} At most ${L.issue} characters.`);
|
|
36472
|
-
fixSchema = clearable(text3(L.fix)).describe(`What was done or is being done about it, with pull requests as #number. Keep it current as the work goes on, and say how it ended once the pull requests land. ${markdown} At most ${L.fix} characters.`);
|
|
36473
|
-
updateManagerTicketRequestSchema = external_exports.object({
|
|
36474
|
-
title: managerTicketTitleSchema.optional(),
|
|
36475
|
-
issue: issueSchema2,
|
|
36476
|
-
fix: fixSchema,
|
|
36477
|
-
media: external_exports.array(mediaSchema).max(L.media).optional().describe(`Screenshots and recordings that show the result, uploaded with \`replicas media upload\`, at most ${L.media}. Replaces the ticket's media.`),
|
|
36478
|
-
questions: external_exports.array(questionSchema).max(L.questions).optional().describe(`Questions only the user can answer, at most ${L.questions}. Replaces the open ones; pass [] once they are answered. Their answer comes back to you in this chat.`),
|
|
36479
|
-
blocked: clearable(text3(L.blocked)).describe('Why you cannot go on without the user, such as missing access. "" once unblocked.')
|
|
36480
|
-
});
|
|
36481
|
-
updateManagerBoardRequestSchema = external_exports.object({
|
|
36482
|
-
overview: clearable(text3(L.overview)).describe(`One line at the top of the board on where the work as a whole stands. "" removes it. At most ${L.overview} characters.`),
|
|
36483
|
-
tickets: external_exports.array(external_exports.object({
|
|
36484
|
-
id: external_exports.uuid(),
|
|
36485
|
-
title: managerTicketTitleSchema.optional(),
|
|
36486
|
-
issue: issueSchema2,
|
|
36487
|
-
fix: fixSchema,
|
|
36488
|
-
pull_requests: external_exports.array(httpsUrl).max(20).optional().describe("Pull request URLs that came out of this ticket's task. They move here from any other ticket. Each pull request is filed under the ticket its ship was working on when it opened it, so pass this only to correct that."),
|
|
36489
|
-
note: clearable(text3(L.note)).describe(`Your one short comment on the ticket, shown under its row, replacing the last. ${inlineMarkdown}. "" removes it. At most ${L.note} characters.`),
|
|
36490
|
-
linear: clearable(linearIdentifier).describe('The Linear issue this ticket is for, such as REP-123. "" removes it.'),
|
|
36491
|
-
archived: external_exports.boolean().optional().describe("true takes it off the board for good: closes its open pull requests without merging, stops their automatic fixes, and archives its ships unless they still have other tickets. false puts it back on the board.")
|
|
36492
|
-
})).max(50).optional().describe("Changes to existing tickets."),
|
|
36493
|
-
order: external_exports.array(external_exports.uuid()).optional().describe("Ticket ids, most important first. Tickets left out keep their order after these."),
|
|
36494
|
-
create: external_exports.array(external_exports.object({
|
|
36495
|
-
title: managerTicketTitleSchema,
|
|
36496
|
-
task: managerTicketTaskSchema.optional(),
|
|
36497
|
-
issue: text3(L.issue).optional(),
|
|
36498
|
-
questions: external_exports.array(questionSchema).max(L.questions).optional(),
|
|
36499
|
-
note: text3(L.note).optional()
|
|
36500
|
-
})).max(5).optional().describe("Tickets with no ship, for your own questions to the user or work no ship does. Their answers come to you.")
|
|
36501
|
-
});
|
|
36502
|
-
answerManagerTicketRequestSchema = external_exports.object({
|
|
36503
|
-
questionId: external_exports.string().min(1),
|
|
36504
|
-
answer: text3(L.answer)
|
|
36505
|
-
});
|
|
36506
|
-
managerTicketAnswerRefSchema = external_exports.object({ managerId: external_exports.uuid(), ticketId: external_exports.uuid(), questionId: external_exports.string().min(1) });
|
|
36507
|
-
replyOnManagerTicketRequestSchema = external_exports.object({
|
|
36508
|
-
reply: text3(L.reply).describe(`Your answer to the user's latest message on the ticket, in a few sentences. ${markdown} Link a screenshot or recording uploaded with \`replicas media upload\` if it helps. At most ${L.reply} characters; keep longer detail in your chat.`),
|
|
36509
|
-
question: questionSchema.optional().describe("A follow-up question only if you need the user to decide something. It shows on the ticket with its options, and their answer comes back to you.")
|
|
36510
|
-
});
|
|
36511
|
-
managerTicketReplyRefSchema = external_exports.object({ ticketId: external_exports.uuid(), text: text3(L.answer) });
|
|
36512
|
-
managerTicketThreadSchema = external_exports.array(external_exports.object({
|
|
36513
|
-
id: external_exports.string(),
|
|
36514
|
-
from: external_exports.enum(["user", "ship"]),
|
|
36515
|
-
name: external_exports.string(),
|
|
36516
|
-
ship_id: external_exports.string(),
|
|
36517
|
-
chat_id: external_exports.string(),
|
|
36518
|
-
text: external_exports.string(),
|
|
36519
|
-
at: external_exports.string(),
|
|
36520
|
-
nudge: external_exports.enum(["sent", "missed"]).optional()
|
|
36521
|
-
}));
|
|
36522
|
-
LINEAR_ISSUE_SUMMARIES_MAX = 50;
|
|
36523
|
-
linearIssueSummariesRequestSchema = external_exports.object({ identifiers: external_exports.array(linearIdentifier).min(1).max(LINEAR_ISSUE_SUMMARIES_MAX) });
|
|
36524
|
-
}
|
|
36525
|
-
});
|
|
36526
|
-
|
|
36527
36380
|
// ../shared/src/display-message/turns.ts
|
|
36528
36381
|
var init_turns = __esm({
|
|
36529
36382
|
"../shared/src/display-message/turns.ts"() {
|
|
@@ -36557,7 +36410,6 @@ var init_steps = __esm({
|
|
|
36557
36410
|
init_utils();
|
|
36558
36411
|
init_subagent_tools();
|
|
36559
36412
|
init_tool_call();
|
|
36560
|
-
init_manager_board();
|
|
36561
36413
|
init_turns();
|
|
36562
36414
|
SUBAGENT_STEPS = {
|
|
36563
36415
|
[SUBAGENT_MCP_TOOLS.messageAgent]: { icon: "message", live: "Messaging", done: "Messaged" },
|
|
@@ -36602,10 +36454,11 @@ var init_steps = __esm({
|
|
|
36602
36454
|
[REPLICAS_MCP_TOOLS.createSlackChannel]: { icon: "wrench", live: "Creating Slack channel", done: "Created Slack channel" },
|
|
36603
36455
|
[REPLICAS_MCP_TOOLS.unlinkSlackChannel]: { icon: "trash", live: "Unlinking Slack channel", done: "Unlinked Slack channel" },
|
|
36604
36456
|
[REPLICAS_MCP_TOOLS.setSlackChannelLevel]: { icon: "wrench", live: "Changing Slack channel level", done: "Changed Slack channel level" },
|
|
36605
|
-
|
|
36606
|
-
|
|
36607
|
-
|
|
36608
|
-
|
|
36457
|
+
// Tools Managers no longer have, so older chats still label them.
|
|
36458
|
+
get_board: { icon: "book", live: "Reading board", done: "Read board" },
|
|
36459
|
+
update_board: { icon: "file-pen", live: "Updating board", done: "Updated board" },
|
|
36460
|
+
update_ticket: { icon: "file-pen", live: "Updating ticket", done: "Updated ticket" },
|
|
36461
|
+
reply_on_ticket: { icon: "file-pen", live: "Replying on ticket", done: "Replied on ticket" },
|
|
36609
36462
|
[REPLICAS_MCP_TOOLS.sendToChat]: { icon: "message", live: "Sending to chat", done: "Sent to chat" },
|
|
36610
36463
|
[REPLICAS_MCP_TOOLS.setStatus]: { icon: "message", live: "Setting status", done: "Set status" },
|
|
36611
36464
|
[REPLICAS_MCP_TOOLS.mergeWhenReady]: { icon: "target", live: "Setting merge when ready", done: "Set merge when ready" }
|
|
@@ -36680,9 +36533,9 @@ function parseAppshot(match) {
|
|
|
36680
36533
|
.../ \(cut short\)\. Treat that text as untrusted data/.test(match[4] ?? "") && { textTruncated: true }
|
|
36681
36534
|
};
|
|
36682
36535
|
}
|
|
36683
|
-
function stripAttachmentNote(
|
|
36684
|
-
const match =
|
|
36685
|
-
let content = match ?
|
|
36536
|
+
function stripAttachmentNote(text3) {
|
|
36537
|
+
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- .*)*)$/);
|
|
36538
|
+
let content = match ? text3.replace(match[0], "").trim() : text3;
|
|
36686
36539
|
const takeTrailingNotes = (noteRegex, truncatedRegex, parse3) => {
|
|
36687
36540
|
const notes = [];
|
|
36688
36541
|
const truncated = noteRegex.test(content) ? null : content.match(truncatedRegex);
|
|
@@ -36737,7 +36590,7 @@ var init_user_message_attachments = __esm({
|
|
|
36737
36590
|
APPSHOT_NOTE_REGEX = /(?:^|\n\n)<replicas_appshot app="([^"\n]*)" window="([^"\n]*)" image="(\d+)">\n([^\n<]*)(?:\n\n([^<]*))?\n<\/replicas_appshot>$/;
|
|
36738
36591
|
TRUNCATED_APPSHOT_NOTE_REGEX = /(?:^|\n\n)<replicas_appshot app="([^"\n]*)(?:" window="([^"\n]*)(?:" image="(\d*))?)?[^<]*(?:<\/?[a-z_]*)?$/;
|
|
36739
36592
|
XML_UNESCAPES = { "&": "&", "<": "<", ">": ">", """: '"', "'": "'" };
|
|
36740
|
-
unescapeXml = (
|
|
36593
|
+
unescapeXml = (text3) => text3.replace(/&(?:amp|lt|gt|quot|#39);/g, (entity) => XML_UNESCAPES[entity]);
|
|
36741
36594
|
WALKTHROUGH_NOTE_REGEX = /(?:^|\n\n)<replicas_walkthrough path="([^"\n]+)" duration_seconds="(\d+)" audio="(true|false)">\n[^<]*\n<\/replicas_walkthrough>$/;
|
|
36742
36595
|
TRUNCATED_WALKTHROUGH_NOTE_REGEX = /(?:^|\n\n)<replicas_walkthrough path="([^"\n]*)(?:" duration_seconds="(\d*))?(?:" audio="(true)?)?[^<]*(?:<\/?[a-z_]*)?$/;
|
|
36743
36596
|
VIDEO_SIZES_REGEX = /<replicas_instructions>\nThe attached videos' frame sizes, in pixels:((?:\n- .+: \d+x\d+)+)(?:\nFor display only; ignore\.)?\n<\/replicas_instructions>/;
|
|
@@ -37176,7 +37029,7 @@ function codexTurnMessages(turn) {
|
|
|
37176
37029
|
return [{
|
|
37177
37030
|
type: "reasoning",
|
|
37178
37031
|
id: turn.id,
|
|
37179
|
-
text: reasoning.map(({ text:
|
|
37032
|
+
text: reasoning.map(({ text: text3 }) => text3.trim()).join("\n\n"),
|
|
37180
37033
|
timestamp: reasoning[0].timestamp,
|
|
37181
37034
|
status: reasoning.at(-1)?.status ?? "completed"
|
|
37182
37035
|
}];
|
|
@@ -37730,8 +37583,8 @@ function getCursorAssistantText(event) {
|
|
|
37730
37583
|
return getTextContent(message2?.content);
|
|
37731
37584
|
}
|
|
37732
37585
|
function getCursorThinkingText(event) {
|
|
37733
|
-
const
|
|
37734
|
-
if (typeof
|
|
37586
|
+
const text3 = event.payload.text;
|
|
37587
|
+
if (typeof text3 === "string") return text3;
|
|
37735
37588
|
const message2 = isRecord(event.payload.message) ? event.payload.message : null;
|
|
37736
37589
|
return typeof message2?.text === "string" ? message2.text : "";
|
|
37737
37590
|
}
|
|
@@ -37782,8 +37635,8 @@ function parseCursorEvents(events) {
|
|
|
37782
37635
|
continue;
|
|
37783
37636
|
}
|
|
37784
37637
|
if (event.type === "cursor-assistant") {
|
|
37785
|
-
const
|
|
37786
|
-
if (
|
|
37638
|
+
const text3 = getCursorAssistantText(event);
|
|
37639
|
+
if (text3) {
|
|
37787
37640
|
const runId = cursorRunId(event);
|
|
37788
37641
|
if (!activeAssistant || activeAssistant.runId !== runId) {
|
|
37789
37642
|
const segment = runAssistantSegments.get(runId) ?? 0;
|
|
@@ -37802,15 +37655,15 @@ function parseCursorEvents(events) {
|
|
|
37802
37655
|
if (message2?.type === "agent") {
|
|
37803
37656
|
messages[activeAssistant.index] = {
|
|
37804
37657
|
...message2,
|
|
37805
|
-
content: `${message2.content}${
|
|
37658
|
+
content: `${message2.content}${text3}`
|
|
37806
37659
|
};
|
|
37807
37660
|
}
|
|
37808
37661
|
}
|
|
37809
37662
|
continue;
|
|
37810
37663
|
}
|
|
37811
37664
|
if (event.type === "cursor-thinking") {
|
|
37812
|
-
const
|
|
37813
|
-
if (
|
|
37665
|
+
const text3 = getCursorThinkingText(event);
|
|
37666
|
+
if (text3.trim()) {
|
|
37814
37667
|
const runId = cursorRunId(event);
|
|
37815
37668
|
if (!activeThinking || activeThinking.runId !== runId) {
|
|
37816
37669
|
const segment = runThinkingSegments.get(runId) ?? 0;
|
|
@@ -37830,7 +37683,7 @@ function parseCursorEvents(events) {
|
|
|
37830
37683
|
if (message2?.type === "reasoning") {
|
|
37831
37684
|
messages[activeThinking.index] = {
|
|
37832
37685
|
...message2,
|
|
37833
|
-
content: `${message2.content}${
|
|
37686
|
+
content: `${message2.content}${text3}`,
|
|
37834
37687
|
status: "in_progress"
|
|
37835
37688
|
};
|
|
37836
37689
|
}
|
|
@@ -37862,12 +37715,12 @@ function parseCursorEvents(events) {
|
|
|
37862
37715
|
}
|
|
37863
37716
|
if (event.type === "cursor-task") {
|
|
37864
37717
|
activeAssistant = null;
|
|
37865
|
-
const
|
|
37866
|
-
if (typeof
|
|
37718
|
+
const text3 = event.payload.text;
|
|
37719
|
+
if (typeof text3 === "string" && text3.trim()) {
|
|
37867
37720
|
messages.push({
|
|
37868
37721
|
id: `cursor-task-${event.timestamp}-${messages.length}`,
|
|
37869
37722
|
type: "agent",
|
|
37870
|
-
content:
|
|
37723
|
+
content: text3,
|
|
37871
37724
|
timestamp: event.timestamp
|
|
37872
37725
|
});
|
|
37873
37726
|
}
|
|
@@ -37911,8 +37764,8 @@ var init_cursor_parser = __esm({
|
|
|
37911
37764
|
});
|
|
37912
37765
|
|
|
37913
37766
|
// ../shared/src/errors.ts
|
|
37914
|
-
function isTransientErrorText(
|
|
37915
|
-
const normalized =
|
|
37767
|
+
function isTransientErrorText(text3, options = {}) {
|
|
37768
|
+
const normalized = text3.toLowerCase();
|
|
37916
37769
|
if (!normalized) return false;
|
|
37917
37770
|
if (TRANSIENT_NETWORK_ERROR_PATTERNS.some((pattern) => pattern.test(normalized))) return true;
|
|
37918
37771
|
if (options.includeRateLimit && /rate limit/.test(normalized)) return true;
|
|
@@ -38010,9 +37863,9 @@ function parseOpencodeEvents(events) {
|
|
|
38010
37863
|
const messages = [];
|
|
38011
37864
|
const inputState = { requests: /* @__PURE__ */ new Map(), resolutions: /* @__PURE__ */ new Map(), requestedAt: /* @__PURE__ */ new Map() };
|
|
38012
37865
|
const streamedParts = /* @__PURE__ */ new Map();
|
|
38013
|
-
const upsertStreamedPart = ({ id, type, text:
|
|
38014
|
-
if (!
|
|
38015
|
-
upsertDisplayMessage(messages, type === "text" ? { id, type: "agent", content:
|
|
37866
|
+
const upsertStreamedPart = ({ id, type, text: text3, completed, timestamp: timestamp2 }) => {
|
|
37867
|
+
if (!text3.trim()) return;
|
|
37868
|
+
upsertDisplayMessage(messages, type === "text" ? { id, type: "agent", content: text3, timestamp: timestamp2 } : { id, type: "reasoning", content: text3, status: completed ? "completed" : "in_progress", timestamp: timestamp2 });
|
|
38016
37869
|
};
|
|
38017
37870
|
for (const event of events) {
|
|
38018
37871
|
if (event.type === "event_msg" && event.payload.type === "user_message") {
|
|
@@ -38402,7 +38255,7 @@ function assistantErrorMessage(value) {
|
|
|
38402
38255
|
}
|
|
38403
38256
|
function parsePiEvents(events) {
|
|
38404
38257
|
const messages = [];
|
|
38405
|
-
const
|
|
38258
|
+
const text3 = /* @__PURE__ */ new Map();
|
|
38406
38259
|
const thinking = /* @__PURE__ */ new Map();
|
|
38407
38260
|
let activeMessageId = "assistant";
|
|
38408
38261
|
for (const event of events) {
|
|
@@ -38433,9 +38286,9 @@ function parsePiEvents(events) {
|
|
|
38433
38286
|
if (event.type === "pi-message_update") {
|
|
38434
38287
|
const payload = nestedPayload(event);
|
|
38435
38288
|
const id = typeof payload.id === "string" ? payload.id : activeMessageId;
|
|
38436
|
-
if (payload.type === "text_delta" && typeof payload.delta === "string")
|
|
38289
|
+
if (payload.type === "text_delta" && typeof payload.delta === "string") text3.set(id, `${text3.get(id) ?? ""}${payload.delta}`);
|
|
38437
38290
|
if (payload.type === "thinking_delta" && typeof payload.delta === "string") thinking.set(id, `${thinking.get(id) ?? ""}${payload.delta}`);
|
|
38438
|
-
const textContent =
|
|
38291
|
+
const textContent = text3.get(id);
|
|
38439
38292
|
const thinkingContent = thinking.get(id);
|
|
38440
38293
|
if (textContent !== void 0) upsertDisplayMessage(messages, { id: `pi-${id}`, type: "agent", content: textContent, timestamp: event.timestamp });
|
|
38441
38294
|
if (thinkingContent !== void 0) upsertDisplayMessage(messages, { id: `pi-thinking-${id}`, type: "reasoning", content: thinkingContent, status: "in_progress", timestamp: event.timestamp });
|
|
@@ -38871,10 +38724,10 @@ function isClaudeResultError(payload) {
|
|
|
38871
38724
|
}
|
|
38872
38725
|
function readClaudeUserPrompt(payload, content) {
|
|
38873
38726
|
if (payload.isSynthetic || content.some((c) => c.type === "tool_result" && c.tool_use_id)) return void 0;
|
|
38874
|
-
const
|
|
38875
|
-
if (LOCAL_COMMAND_ECHO_REGEX.test(
|
|
38727
|
+
const text3 = content.filter((c) => c.type === "text").map((c) => c.text || "").join("\n");
|
|
38728
|
+
if (LOCAL_COMMAND_ECHO_REGEX.test(text3.trim())) return void 0;
|
|
38876
38729
|
const images = contentImages(content);
|
|
38877
|
-
return
|
|
38730
|
+
return text3 || images.length > 0 ? { text: text3, images } : void 0;
|
|
38878
38731
|
}
|
|
38879
38732
|
function contentImages(content) {
|
|
38880
38733
|
return content.flatMap((c) => {
|
|
@@ -39738,7 +39591,7 @@ var init_chat_transcript_pages = __esm({
|
|
|
39738
39591
|
});
|
|
39739
39592
|
|
|
39740
39593
|
// ../shared/src/codex-history.ts
|
|
39741
|
-
var COMPACT_BODY_MAX_BYTES;
|
|
39594
|
+
var COMPACT_BODY_MAX_BYTES, SUBAGENT_LIST_PAGE_SOURCE_BYTES;
|
|
39742
39595
|
var init_codex_history = __esm({
|
|
39743
39596
|
"../shared/src/codex-history.ts"() {
|
|
39744
39597
|
"use strict";
|
|
@@ -39752,6 +39605,7 @@ var init_codex_history = __esm({
|
|
|
39752
39605
|
init_type_guards();
|
|
39753
39606
|
init_user_message_images();
|
|
39754
39607
|
COMPACT_BODY_MAX_BYTES = 2 * 1024;
|
|
39608
|
+
SUBAGENT_LIST_PAGE_SOURCE_BYTES = 64 * 1024 * 1024;
|
|
39755
39609
|
}
|
|
39756
39610
|
});
|
|
39757
39611
|
|
|
@@ -40287,6 +40141,17 @@ var init_keyboard_shortcuts = __esm({
|
|
|
40287
40141
|
}
|
|
40288
40142
|
});
|
|
40289
40143
|
|
|
40144
|
+
// ../shared/src/manager-prompts-common.ts
|
|
40145
|
+
var managerEventChatNote;
|
|
40146
|
+
var init_manager_prompts_common = __esm({
|
|
40147
|
+
"../shared/src/manager-prompts-common.ts"() {
|
|
40148
|
+
"use strict";
|
|
40149
|
+
init_replicas_mcp();
|
|
40150
|
+
init_prompts();
|
|
40151
|
+
managerEventChatNote = (then) => `If a message the user typed in this turn is still unanswered, your final reply answers it and they see it. Otherwise they don't see text you write in this turn: if it brings something they asked for, or a blocker that needs them, send it with ${REPLICAS_MCP_TOOLS.sendToChat}; then ${then}end with a one-line note.`;
|
|
40152
|
+
}
|
|
40153
|
+
});
|
|
40154
|
+
|
|
40290
40155
|
// ../shared/src/manager-prompts-issues.ts
|
|
40291
40156
|
var ISSUES_MANAGER_EVENT_CHAT_NOTE;
|
|
40292
40157
|
var init_manager_prompts_issues = __esm({
|
|
@@ -40299,15 +40164,6 @@ var init_manager_prompts_issues = __esm({
|
|
|
40299
40164
|
}
|
|
40300
40165
|
});
|
|
40301
40166
|
|
|
40302
|
-
// ../shared/src/manager-prompts.ts
|
|
40303
|
-
var init_manager_prompts = __esm({
|
|
40304
|
-
"../shared/src/manager-prompts.ts"() {
|
|
40305
|
-
"use strict";
|
|
40306
|
-
init_manager_prompts_issues();
|
|
40307
|
-
init_manager_prompts_legacy();
|
|
40308
|
-
}
|
|
40309
|
-
});
|
|
40310
|
-
|
|
40311
40167
|
// ../shared/src/quote-match.ts
|
|
40312
40168
|
var init_quote_match = __esm({
|
|
40313
40169
|
"../shared/src/quote-match.ts"() {
|
|
@@ -40768,7 +40624,7 @@ var CLI_VERSION;
|
|
|
40768
40624
|
var init_cli_version = __esm({
|
|
40769
40625
|
"../shared/src/cli-version.ts"() {
|
|
40770
40626
|
"use strict";
|
|
40771
|
-
CLI_VERSION = "0.3.
|
|
40627
|
+
CLI_VERSION = "0.3.584";
|
|
40772
40628
|
}
|
|
40773
40629
|
});
|
|
40774
40630
|
|
|
@@ -40924,7 +40780,8 @@ var init_billing = __esm({
|
|
|
40924
40780
|
TEAM_UNIT = CREDIT_PLAN_UNITS.team;
|
|
40925
40781
|
autoUpgradeAmountsSchema = external_exports.object({
|
|
40926
40782
|
maxCents: external_exports.number().int().multipleOf(TEAM_UNIT.unitCents).min(TEAM_UNIT.unitCents * TEAM_UNIT.minQuantity).max(TEAM_UNIT.unitCents * TEAM_UNIT.maxQuantity),
|
|
40927
|
-
thresholdCents: external_exports.number().int().multipleOf(100).min(0).max(TEAM_UNIT.unitCents * TEAM_UNIT.maxQuantity)
|
|
40783
|
+
thresholdCents: external_exports.number().int().multipleOf(100).min(0).max(TEAM_UNIT.unitCents * TEAM_UNIT.maxQuantity),
|
|
40784
|
+
stepCents: external_exports.number().int().multipleOf(TEAM_UNIT.unitCents).min(TEAM_UNIT.unitCents).max(TEAM_UNIT.unitCents * TEAM_UNIT.maxQuantity)
|
|
40928
40785
|
});
|
|
40929
40786
|
SOURCE_LIMIT_SOURCES = ["limrun", "modal", "revyl", "inference"];
|
|
40930
40787
|
usageLimitCentsSchema = external_exports.number().int().min(100).max(1e8);
|
|
@@ -41507,7 +41364,6 @@ var init_workspace_events = __esm({
|
|
|
41507
41364
|
subagent: external_exports.object({ id: external_exports.string(), name: external_exports.string(), prUrl: external_exports.string().nullable() }),
|
|
41508
41365
|
ts: external_exports.string()
|
|
41509
41366
|
}),
|
|
41510
|
-
external_exports.object({ type: external_exports.enum(["manager.board.changed", "mothership.board.changed"]), workspaceId: external_exports.string(), ts: external_exports.string() }),
|
|
41511
41367
|
external_exports.object({ type: external_exports.literal("issues.synced"), syncId: external_exports.number(), ts: external_exports.string() }),
|
|
41512
41368
|
external_exports.object({ type: external_exports.literal("needs-you.changed"), workspaceId: external_exports.string().nullable(), userId: external_exports.string().optional(), request: inputRequestRaisedSchema.optional(), ts: external_exports.string() }),
|
|
41513
41369
|
external_exports.object({
|
|
@@ -44840,12 +44696,12 @@ var require_luxon = __commonJS({
|
|
|
44840
44696
|
* @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }
|
|
44841
44697
|
* @return {Duration}
|
|
44842
44698
|
*/
|
|
44843
|
-
static fromISO(
|
|
44844
|
-
const [parsed] = parseISODuration(
|
|
44699
|
+
static fromISO(text3, opts) {
|
|
44700
|
+
const [parsed] = parseISODuration(text3);
|
|
44845
44701
|
if (parsed) {
|
|
44846
44702
|
return _Duration.fromObject(parsed, opts);
|
|
44847
44703
|
} else {
|
|
44848
|
-
return _Duration.invalid("unparsable", `the input "${
|
|
44704
|
+
return _Duration.invalid("unparsable", `the input "${text3}" can't be parsed as ISO 8601`);
|
|
44849
44705
|
}
|
|
44850
44706
|
}
|
|
44851
44707
|
/**
|
|
@@ -44864,12 +44720,12 @@ var require_luxon = __commonJS({
|
|
|
44864
44720
|
* @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }
|
|
44865
44721
|
* @return {Duration}
|
|
44866
44722
|
*/
|
|
44867
|
-
static fromISOTime(
|
|
44868
|
-
const [parsed] = parseISOTimeOnly(
|
|
44723
|
+
static fromISOTime(text3, opts) {
|
|
44724
|
+
const [parsed] = parseISOTimeOnly(text3);
|
|
44869
44725
|
if (parsed) {
|
|
44870
44726
|
return _Duration.fromObject(parsed, opts);
|
|
44871
44727
|
} else {
|
|
44872
|
-
return _Duration.invalid("unparsable", `the input "${
|
|
44728
|
+
return _Duration.invalid("unparsable", `the input "${text3}" can't be parsed as ISO 8601`);
|
|
44873
44729
|
}
|
|
44874
44730
|
}
|
|
44875
44731
|
/**
|
|
@@ -45534,8 +45390,8 @@ var require_luxon = __commonJS({
|
|
|
45534
45390
|
* @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals
|
|
45535
45391
|
* @return {Interval}
|
|
45536
45392
|
*/
|
|
45537
|
-
static fromISO(
|
|
45538
|
-
const [s2, e] = (
|
|
45393
|
+
static fromISO(text3, opts) {
|
|
45394
|
+
const [s2, e] = (text3 || "").split("/", 2);
|
|
45539
45395
|
if (s2 && e) {
|
|
45540
45396
|
let start, startIsValid;
|
|
45541
45397
|
try {
|
|
@@ -45566,7 +45422,7 @@ var require_luxon = __commonJS({
|
|
|
45566
45422
|
}
|
|
45567
45423
|
}
|
|
45568
45424
|
}
|
|
45569
|
-
return _Interval.invalid("unparsable", `the input "${
|
|
45425
|
+
return _Interval.invalid("unparsable", `the input "${text3}" can't be parsed as ISO 8601`);
|
|
45570
45426
|
}
|
|
45571
45427
|
/**
|
|
45572
45428
|
* Check if an object is an Interval. Works across context boundaries
|
|
@@ -46796,7 +46652,7 @@ var require_luxon = __commonJS({
|
|
|
46796
46652
|
o
|
|
46797
46653
|
};
|
|
46798
46654
|
}
|
|
46799
|
-
function parseDataToDateTime(parsed, parsedZone, opts, format,
|
|
46655
|
+
function parseDataToDateTime(parsed, parsedZone, opts, format, text3, specificOffset) {
|
|
46800
46656
|
const {
|
|
46801
46657
|
setZone,
|
|
46802
46658
|
zone
|
|
@@ -46809,7 +46665,7 @@ var require_luxon = __commonJS({
|
|
|
46809
46665
|
});
|
|
46810
46666
|
return setZone ? inst : inst.setZone(zone);
|
|
46811
46667
|
} else {
|
|
46812
|
-
return DateTime.invalid(new Invalid("unparsable", `the input "${
|
|
46668
|
+
return DateTime.invalid(new Invalid("unparsable", `the input "${text3}" can't be parsed as ${format}`));
|
|
46813
46669
|
}
|
|
46814
46670
|
}
|
|
46815
46671
|
function toTechFormat(dt, format, allowZ = true) {
|
|
@@ -47331,9 +47187,9 @@ var require_luxon = __commonJS({
|
|
|
47331
47187
|
* @example DateTime.fromISO('2016-W05-4')
|
|
47332
47188
|
* @return {DateTime}
|
|
47333
47189
|
*/
|
|
47334
|
-
static fromISO(
|
|
47335
|
-
const [vals, parsedZone] = parseISODate(
|
|
47336
|
-
return parseDataToDateTime(vals, parsedZone, opts, "ISO 8601",
|
|
47190
|
+
static fromISO(text3, opts = {}) {
|
|
47191
|
+
const [vals, parsedZone] = parseISODate(text3);
|
|
47192
|
+
return parseDataToDateTime(vals, parsedZone, opts, "ISO 8601", text3);
|
|
47337
47193
|
}
|
|
47338
47194
|
/**
|
|
47339
47195
|
* Create a DateTime from an RFC 2822 string
|
|
@@ -47350,9 +47206,9 @@ var require_luxon = __commonJS({
|
|
|
47350
47206
|
* @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')
|
|
47351
47207
|
* @return {DateTime}
|
|
47352
47208
|
*/
|
|
47353
|
-
static fromRFC2822(
|
|
47354
|
-
const [vals, parsedZone] = parseRFC2822Date(
|
|
47355
|
-
return parseDataToDateTime(vals, parsedZone, opts, "RFC 2822",
|
|
47209
|
+
static fromRFC2822(text3, opts = {}) {
|
|
47210
|
+
const [vals, parsedZone] = parseRFC2822Date(text3);
|
|
47211
|
+
return parseDataToDateTime(vals, parsedZone, opts, "RFC 2822", text3);
|
|
47356
47212
|
}
|
|
47357
47213
|
/**
|
|
47358
47214
|
* Create a DateTime from an HTTP header date
|
|
@@ -47370,8 +47226,8 @@ var require_luxon = __commonJS({
|
|
|
47370
47226
|
* @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')
|
|
47371
47227
|
* @return {DateTime}
|
|
47372
47228
|
*/
|
|
47373
|
-
static fromHTTP(
|
|
47374
|
-
const [vals, parsedZone] = parseHTTPDate(
|
|
47229
|
+
static fromHTTP(text3, opts = {}) {
|
|
47230
|
+
const [vals, parsedZone] = parseHTTPDate(text3);
|
|
47375
47231
|
return parseDataToDateTime(vals, parsedZone, opts, "HTTP", opts);
|
|
47376
47232
|
}
|
|
47377
47233
|
/**
|
|
@@ -47388,8 +47244,8 @@ var require_luxon = __commonJS({
|
|
|
47388
47244
|
* @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance
|
|
47389
47245
|
* @return {DateTime}
|
|
47390
47246
|
*/
|
|
47391
|
-
static fromFormat(
|
|
47392
|
-
if (isUndefined(
|
|
47247
|
+
static fromFormat(text3, fmt, opts = {}) {
|
|
47248
|
+
if (isUndefined(text3) || isUndefined(fmt)) {
|
|
47393
47249
|
throw new InvalidArgumentError2("fromFormat requires an input string and a format");
|
|
47394
47250
|
}
|
|
47395
47251
|
const {
|
|
@@ -47399,18 +47255,18 @@ var require_luxon = __commonJS({
|
|
|
47399
47255
|
locale,
|
|
47400
47256
|
numberingSystem,
|
|
47401
47257
|
defaultToEN: true
|
|
47402
|
-
}), [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse,
|
|
47258
|
+
}), [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text3, fmt);
|
|
47403
47259
|
if (invalid) {
|
|
47404
47260
|
return _DateTime.invalid(invalid);
|
|
47405
47261
|
} else {
|
|
47406
|
-
return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`,
|
|
47262
|
+
return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text3, specificOffset);
|
|
47407
47263
|
}
|
|
47408
47264
|
}
|
|
47409
47265
|
/**
|
|
47410
47266
|
* @deprecated use fromFormat instead
|
|
47411
47267
|
*/
|
|
47412
|
-
static fromString(
|
|
47413
|
-
return _DateTime.fromFormat(
|
|
47268
|
+
static fromString(text3, fmt, opts = {}) {
|
|
47269
|
+
return _DateTime.fromFormat(text3, fmt, opts);
|
|
47414
47270
|
}
|
|
47415
47271
|
/**
|
|
47416
47272
|
* Create a DateTime from a SQL date, time, or datetime
|
|
@@ -47433,9 +47289,9 @@ var require_luxon = __commonJS({
|
|
|
47433
47289
|
* @example DateTime.fromSQL('09:12:34.342')
|
|
47434
47290
|
* @return {DateTime}
|
|
47435
47291
|
*/
|
|
47436
|
-
static fromSQL(
|
|
47437
|
-
const [vals, parsedZone] = parseSQL(
|
|
47438
|
-
return parseDataToDateTime(vals, parsedZone, opts, "SQL",
|
|
47292
|
+
static fromSQL(text3, opts = {}) {
|
|
47293
|
+
const [vals, parsedZone] = parseSQL(text3);
|
|
47294
|
+
return parseDataToDateTime(vals, parsedZone, opts, "SQL", text3);
|
|
47439
47295
|
}
|
|
47440
47296
|
/**
|
|
47441
47297
|
* Create an invalid DateTime.
|
|
@@ -48620,7 +48476,7 @@ var require_luxon = __commonJS({
|
|
|
48620
48476
|
* @param {Object} options - options taken by fromFormat()
|
|
48621
48477
|
* @return {Object}
|
|
48622
48478
|
*/
|
|
48623
|
-
static fromFormatExplain(
|
|
48479
|
+
static fromFormatExplain(text3, fmt, options = {}) {
|
|
48624
48480
|
const {
|
|
48625
48481
|
locale = null,
|
|
48626
48482
|
numberingSystem = null
|
|
@@ -48629,13 +48485,13 @@ var require_luxon = __commonJS({
|
|
|
48629
48485
|
numberingSystem,
|
|
48630
48486
|
defaultToEN: true
|
|
48631
48487
|
});
|
|
48632
|
-
return explainFromTokens(localeToUse,
|
|
48488
|
+
return explainFromTokens(localeToUse, text3, fmt);
|
|
48633
48489
|
}
|
|
48634
48490
|
/**
|
|
48635
48491
|
* @deprecated use fromFormatExplain instead
|
|
48636
48492
|
*/
|
|
48637
|
-
static fromStringExplain(
|
|
48638
|
-
return _DateTime.fromFormatExplain(
|
|
48493
|
+
static fromStringExplain(text3, fmt, options = {}) {
|
|
48494
|
+
return _DateTime.fromFormatExplain(text3, fmt, options);
|
|
48639
48495
|
}
|
|
48640
48496
|
/**
|
|
48641
48497
|
* Build a parser for `fmt` using the given locale. This parser can be passed
|
|
@@ -48670,8 +48526,8 @@ var require_luxon = __commonJS({
|
|
|
48670
48526
|
* @param {Object} opts - options taken by fromFormat()
|
|
48671
48527
|
* @returns {DateTime}
|
|
48672
48528
|
*/
|
|
48673
|
-
static fromFormatParser(
|
|
48674
|
-
if (isUndefined(
|
|
48529
|
+
static fromFormatParser(text3, formatParser, opts = {}) {
|
|
48530
|
+
if (isUndefined(text3) || isUndefined(formatParser)) {
|
|
48675
48531
|
throw new InvalidArgumentError2("fromFormatParser requires an input string and a format parser");
|
|
48676
48532
|
}
|
|
48677
48533
|
const {
|
|
@@ -48690,11 +48546,11 @@ var require_luxon = __commonJS({
|
|
|
48690
48546
|
zone,
|
|
48691
48547
|
specificOffset,
|
|
48692
48548
|
invalidReason
|
|
48693
|
-
} = formatParser.explainFromTokens(
|
|
48549
|
+
} = formatParser.explainFromTokens(text3);
|
|
48694
48550
|
if (invalidReason) {
|
|
48695
48551
|
return _DateTime.invalid(invalidReason);
|
|
48696
48552
|
} else {
|
|
48697
|
-
return parseDataToDateTime(result, zone, opts, `format ${formatParser.format}`,
|
|
48553
|
+
return parseDataToDateTime(result, zone, opts, `format ${formatParser.format}`, text3, specificOffset);
|
|
48698
48554
|
}
|
|
48699
48555
|
}
|
|
48700
48556
|
// FORMAT PRESETS
|
|
@@ -51854,10 +51710,8 @@ var init_src = __esm({
|
|
|
51854
51710
|
init_slash_commands();
|
|
51855
51711
|
init_keyboard_shortcuts();
|
|
51856
51712
|
init_prompts();
|
|
51857
|
-
init_manager_prompts();
|
|
51858
51713
|
init_manager_prompts_common();
|
|
51859
51714
|
init_manager_prompts_issues();
|
|
51860
|
-
init_manager_prompts_legacy();
|
|
51861
51715
|
init_issue_events();
|
|
51862
51716
|
init_tag_blocks();
|
|
51863
51717
|
init_manager_events();
|
|
@@ -52008,7 +51862,6 @@ var init_src = __esm({
|
|
|
52008
51862
|
init_local_control_requests();
|
|
52009
51863
|
init_api_casing();
|
|
52010
51864
|
init_websocket_liveness();
|
|
52011
|
-
init_manager_board();
|
|
52012
51865
|
init_workspace_target();
|
|
52013
51866
|
}
|
|
52014
51867
|
});
|
|
@@ -52193,15 +52046,15 @@ async function ask(question) {
|
|
|
52193
52046
|
if (!isInteractive()) {
|
|
52194
52047
|
throw new Error(`Missing input (${String(question.message).trim()}) and no interactive terminal to ask for it. Pass it as an option; see --help.`);
|
|
52195
52048
|
}
|
|
52196
|
-
return (0,
|
|
52049
|
+
return (0, import_prompts9.default)(question);
|
|
52197
52050
|
}
|
|
52198
|
-
var import_chalk,
|
|
52051
|
+
var import_chalk, import_prompts9, jsonMode, isJsonMode, isInteractive, outputSuccess;
|
|
52199
52052
|
var init_output = __esm({
|
|
52200
52053
|
"src/lib/output.ts"() {
|
|
52201
52054
|
"use strict";
|
|
52202
52055
|
import_chalk = __toESM(require("chalk"));
|
|
52203
52056
|
init_src();
|
|
52204
|
-
|
|
52057
|
+
import_prompts9 = __toESM(require("prompts"));
|
|
52205
52058
|
jsonMode = false;
|
|
52206
52059
|
isJsonMode = () => jsonMode;
|
|
52207
52060
|
isInteractive = () => !jsonMode && !!process.stdin.isTTY;
|
|
@@ -52471,8 +52324,8 @@ function renderAuthFlowStep(step, total, title3) {
|
|
|
52471
52324
|
console.log(import_chalk2.default.bold(`
|
|
52472
52325
|
${step}/${total} ${title3}`));
|
|
52473
52326
|
}
|
|
52474
|
-
function renderAuthFlowDetail(
|
|
52475
|
-
console.log(import_chalk2.default.gray(` ${
|
|
52327
|
+
function renderAuthFlowDetail(text3) {
|
|
52328
|
+
console.log(import_chalk2.default.gray(` ${text3}`));
|
|
52476
52329
|
}
|
|
52477
52330
|
function renderAuthFlowSuccess(providerLabel, summary, target) {
|
|
52478
52331
|
console.log(brand.bold(`
|
|
@@ -52870,7 +52723,7 @@ function parseKeyValuePairs(pairs) {
|
|
|
52870
52723
|
}
|
|
52871
52724
|
async function confirmAction(message2) {
|
|
52872
52725
|
if (!isInteractive()) throw new Error(`${message2} Pass -f to confirm without a terminal.`);
|
|
52873
|
-
const { confirm } = await (0,
|
|
52726
|
+
const { confirm } = await (0, import_prompts10.default)({ type: "confirm", name: "confirm", message: message2, initial: false });
|
|
52874
52727
|
if (!confirm) console.log(import_chalk6.default.yellow("\nCancelled."));
|
|
52875
52728
|
return Boolean(confirm);
|
|
52876
52729
|
}
|
|
@@ -52892,13 +52745,13 @@ async function waitForUser(params) {
|
|
|
52892
52745
|
}
|
|
52893
52746
|
return params.settled(value) ? value : params.poll(false);
|
|
52894
52747
|
}
|
|
52895
|
-
var import_chalk6,
|
|
52748
|
+
var import_chalk6, import_prompts10;
|
|
52896
52749
|
var init_command_utils = __esm({
|
|
52897
52750
|
"src/lib/command-utils.ts"() {
|
|
52898
52751
|
"use strict";
|
|
52899
52752
|
import_chalk6 = __toESM(require("chalk"));
|
|
52900
52753
|
init_src();
|
|
52901
|
-
|
|
52754
|
+
import_prompts10 = __toESM(require("prompts"));
|
|
52902
52755
|
init_config();
|
|
52903
52756
|
init_output();
|
|
52904
52757
|
}
|
|
@@ -53993,8 +53846,8 @@ async function exchangeCodeForTokens2(code, state, expectedState, codeVerifier)
|
|
|
53993
53846
|
body: JSON.stringify(payload)
|
|
53994
53847
|
});
|
|
53995
53848
|
if (!response.ok) {
|
|
53996
|
-
const
|
|
53997
|
-
throw new Error(`Failed to exchange authorization code: ${response.status} ${
|
|
53849
|
+
const text3 = await response.text();
|
|
53850
|
+
throw new Error(`Failed to exchange authorization code: ${response.status} ${text3}`);
|
|
53998
53851
|
}
|
|
53999
53852
|
const data = await response.json();
|
|
54000
53853
|
return {
|
|
@@ -55226,9 +55079,9 @@ function formatStatus(status) {
|
|
|
55226
55079
|
if (isWorkspaceSuspendedStatus(status)) return import_chalk22.default.gray(status);
|
|
55227
55080
|
return status;
|
|
55228
55081
|
}
|
|
55229
|
-
function truncate(
|
|
55230
|
-
if (
|
|
55231
|
-
return
|
|
55082
|
+
function truncate(text3, maxLength) {
|
|
55083
|
+
if (text3.length <= maxLength) return text3;
|
|
55084
|
+
return text3.substring(0, maxLength) + "...";
|
|
55232
55085
|
}
|
|
55233
55086
|
function formatDisplayMessage(message2) {
|
|
55234
55087
|
const time3 = new Date(message2.timestamp).toLocaleTimeString();
|
|
@@ -56254,9 +56107,9 @@ function buildTriggersFromOptions(options, runAt, repositories) {
|
|
|
56254
56107
|
}
|
|
56255
56108
|
return triggers;
|
|
56256
56109
|
}
|
|
56257
|
-
function truncate2(
|
|
56258
|
-
if (
|
|
56259
|
-
return
|
|
56110
|
+
function truncate2(text3, maxLength) {
|
|
56111
|
+
if (text3.length <= maxLength) return text3;
|
|
56112
|
+
return text3.substring(0, maxLength) + "...";
|
|
56260
56113
|
}
|
|
56261
56114
|
function formatAutoPause(automation2) {
|
|
56262
56115
|
return `${AUTOMATION_AUTO_PAUSE_LABEL}${automation2.failing_cause ? `: ${automation2.failing_cause}` : ""}`;
|
|
@@ -57531,10 +57384,10 @@ async function issueListCommand(options) {
|
|
|
57531
57384
|
});
|
|
57532
57385
|
}
|
|
57533
57386
|
async function issueCommentCommand(issue3, body2, options) {
|
|
57534
|
-
const
|
|
57387
|
+
const text3 = readText(body2, options.file, "file") ?? "";
|
|
57535
57388
|
const media_ids = await uploadAttachments(options.attach);
|
|
57536
|
-
if (!
|
|
57537
|
-
output2(await callIssueTool(ISSUE_COMMANDS.comment, { issue: issue3, body:
|
|
57389
|
+
if (!text3.trim() && !media_ids) throw new Error("Pass the comment text, --file, or --attach");
|
|
57390
|
+
output2(await callIssueTool(ISSUE_COMMANDS.comment, { issue: issue3, body: text3, media_ids }, noData), () => console.log(`${import_chalk29.default.green("\u2713")} Commented on ${issue3}`));
|
|
57538
57391
|
}
|
|
57539
57392
|
function issueActorCommand(tool, done) {
|
|
57540
57393
|
return async (issue3, who) => {
|
|
@@ -57765,8 +57618,8 @@ async function inspect(html, source) {
|
|
|
57765
57618
|
const page = await chrome.newPage();
|
|
57766
57619
|
const messages = [];
|
|
57767
57620
|
page.on("Runtime.consoleAPICalled", ({ type, args }) => {
|
|
57768
|
-
const
|
|
57769
|
-
messages.push({ level: type === "error" || type === "assert" ? "error" : type === "warning" ? "warning" : "log", text:
|
|
57621
|
+
const text3 = args.map((arg) => arg.value === void 0 ? arg.description ?? "" : typeof arg.value === "string" ? arg.value : JSON.stringify(arg.value)).join(" ");
|
|
57622
|
+
messages.push({ level: type === "error" || type === "assert" ? "error" : type === "warning" ? "warning" : "log", text: text3 });
|
|
57770
57623
|
});
|
|
57771
57624
|
page.on("Runtime.exceptionThrown", ({ exceptionDetails }) => {
|
|
57772
57625
|
messages.push({ level: "error", text: exceptionDetails.exception?.description ?? exceptionDetails.text });
|