@drisp/cli 0.7.12 → 0.7.13
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.
|
@@ -1566,8 +1566,8 @@ function createStreamJsonToolParser(onToolResult, onToolUse, onMessageDelta, onM
|
|
|
1566
1566
|
}
|
|
1567
1567
|
const record = parsed.type === "stream_event" && parsed.event ? parsed.event : parsed;
|
|
1568
1568
|
if (record.type === "message_start") {
|
|
1569
|
-
const
|
|
1570
|
-
if (typeof
|
|
1569
|
+
const id3 = record.message?.["id"];
|
|
1570
|
+
if (typeof id3 === "string") currentMessageId = id3;
|
|
1571
1571
|
}
|
|
1572
1572
|
if (record.type === "content_block_delta") {
|
|
1573
1573
|
const delta = record["delta"];
|
|
@@ -1597,12 +1597,12 @@ function createStreamJsonToolParser(onToolResult, onToolUse, onMessageDelta, onM
|
|
|
1597
1597
|
}
|
|
1598
1598
|
if (record.type === "tool_result") {
|
|
1599
1599
|
const toolUseId = typeof record.tool_use_id === "string" ? record.tool_use_id : void 0;
|
|
1600
|
-
const
|
|
1601
|
-
if (
|
|
1600
|
+
const text2 = extractResultText(record.content);
|
|
1601
|
+
if (text2) {
|
|
1602
1602
|
onToolResult({
|
|
1603
1603
|
tool_use_id: toolUseId,
|
|
1604
1604
|
tool_name: toolUseId ? toolNameById.get(toolUseId) : void 0,
|
|
1605
|
-
content:
|
|
1605
|
+
content: text2
|
|
1606
1606
|
});
|
|
1607
1607
|
}
|
|
1608
1608
|
}
|
|
@@ -2805,8 +2805,8 @@ ${result.stderrTail}`;
|
|
|
2805
2805
|
}
|
|
2806
2806
|
return { title: rawLine || "Unknown failure", rawLine };
|
|
2807
2807
|
}
|
|
2808
|
-
function pickMeaningfulLine(
|
|
2809
|
-
const lines =
|
|
2808
|
+
function pickMeaningfulLine(text2) {
|
|
2809
|
+
const lines = text2.split("\n").map((line) => line.trim()).filter((line) => line.length > 0).filter((line) => !line.startsWith("Command failed:"));
|
|
2810
2810
|
const lastLine = lines.at(-1) ?? "";
|
|
2811
2811
|
if (lastLine.startsWith("{")) {
|
|
2812
2812
|
try {
|
|
@@ -4880,16 +4880,16 @@ var AppServerManager = class extends EventEmitter {
|
|
|
4880
4880
|
reject(new Error("Process not running"));
|
|
4881
4881
|
return;
|
|
4882
4882
|
}
|
|
4883
|
-
const
|
|
4884
|
-
const msg = { method, id:
|
|
4883
|
+
const id3 = this.nextId++;
|
|
4884
|
+
const msg = { method, id: id3, params: params ?? {} };
|
|
4885
4885
|
const timer = setTimeout(() => {
|
|
4886
|
-
const p = this.pending.get(
|
|
4886
|
+
const p = this.pending.get(id3);
|
|
4887
4887
|
if (p) {
|
|
4888
|
-
this.pending.delete(
|
|
4889
|
-
p.reject(new Error(`Request ${method} (id=${
|
|
4888
|
+
this.pending.delete(id3);
|
|
4889
|
+
p.reject(new Error(`Request ${method} (id=${id3}) timed out`));
|
|
4890
4890
|
}
|
|
4891
4891
|
}, REQUEST_TIMEOUT_MS);
|
|
4892
|
-
this.pending.set(
|
|
4892
|
+
this.pending.set(id3, { resolve: resolve7, reject, timer });
|
|
4893
4893
|
this.process.stdin.write(JSON.stringify(msg) + "\n");
|
|
4894
4894
|
});
|
|
4895
4895
|
}
|
|
@@ -4898,14 +4898,14 @@ var AppServerManager = class extends EventEmitter {
|
|
|
4898
4898
|
const msg = { method, params: params ?? {} };
|
|
4899
4899
|
this.process.stdin.write(JSON.stringify(msg) + "\n");
|
|
4900
4900
|
}
|
|
4901
|
-
respondToServerRequest(
|
|
4901
|
+
respondToServerRequest(id3, result) {
|
|
4902
4902
|
if (!this.process?.stdin?.writable) return;
|
|
4903
|
-
const msg = { id:
|
|
4903
|
+
const msg = { id: id3, result };
|
|
4904
4904
|
this.process.stdin.write(JSON.stringify(msg) + "\n");
|
|
4905
4905
|
}
|
|
4906
|
-
respondToServerRequestError(
|
|
4906
|
+
respondToServerRequestError(id3, code, message) {
|
|
4907
4907
|
if (!this.process?.stdin?.writable) return;
|
|
4908
|
-
const msg = { id:
|
|
4908
|
+
const msg = { id: id3, error: { code, message } };
|
|
4909
4909
|
this.process.stdin.write(JSON.stringify(msg) + "\n");
|
|
4910
4910
|
}
|
|
4911
4911
|
buildInitializeParams() {
|
|
@@ -6384,8 +6384,8 @@ function mapDecisionToCodexResult(event, decision) {
|
|
|
6384
6384
|
}
|
|
6385
6385
|
return {
|
|
6386
6386
|
answers: Object.fromEntries(
|
|
6387
|
-
Object.entries(decision.intent.answers).map(([
|
|
6388
|
-
|
|
6387
|
+
Object.entries(decision.intent.answers).map(([id3, answer]) => [
|
|
6388
|
+
id3,
|
|
6389
6389
|
{ answers: [answer] }
|
|
6390
6390
|
])
|
|
6391
6391
|
)
|
|
@@ -10073,18 +10073,18 @@ var WIDTH_CACHE_MAX_TEXT_LENGTH = 512;
|
|
|
10073
10073
|
var SPACE_CACHE_MAX = 128;
|
|
10074
10074
|
var widthCache = /* @__PURE__ */ new Map();
|
|
10075
10075
|
var spaceCache = [""];
|
|
10076
|
-
function cachedStringWidth(
|
|
10077
|
-
if (
|
|
10078
|
-
return (0, import_string_width.default)(
|
|
10076
|
+
function cachedStringWidth(text2) {
|
|
10077
|
+
if (text2.length > WIDTH_CACHE_MAX_TEXT_LENGTH) {
|
|
10078
|
+
return (0, import_string_width.default)(text2);
|
|
10079
10079
|
}
|
|
10080
|
-
const cached = widthCache.get(
|
|
10080
|
+
const cached = widthCache.get(text2);
|
|
10081
10081
|
if (cached !== void 0) {
|
|
10082
|
-
widthCache.delete(
|
|
10083
|
-
widthCache.set(
|
|
10082
|
+
widthCache.delete(text2);
|
|
10083
|
+
widthCache.set(text2, cached);
|
|
10084
10084
|
return cached;
|
|
10085
10085
|
}
|
|
10086
|
-
const measured = (0, import_string_width.default)(
|
|
10087
|
-
widthCache.set(
|
|
10086
|
+
const measured = (0, import_string_width.default)(text2);
|
|
10087
|
+
widthCache.set(text2, measured);
|
|
10088
10088
|
if (widthCache.size > WIDTH_CACHE_MAX) {
|
|
10089
10089
|
const oldest = widthCache.keys().next().value;
|
|
10090
10090
|
if (oldest !== void 0) {
|
|
@@ -10105,18 +10105,18 @@ function spaces(count2) {
|
|
|
10105
10105
|
}
|
|
10106
10106
|
return " ".repeat(count2);
|
|
10107
10107
|
}
|
|
10108
|
-
function isSimpleAscii(
|
|
10109
|
-
return SIMPLE_ASCII_RE.test(
|
|
10108
|
+
function isSimpleAscii(text2) {
|
|
10109
|
+
return SIMPLE_ASCII_RE.test(text2);
|
|
10110
10110
|
}
|
|
10111
|
-
function fitAscii(
|
|
10111
|
+
function fitAscii(text2, width) {
|
|
10112
10112
|
if (width <= 0) return "";
|
|
10113
|
-
const len =
|
|
10113
|
+
const len = text2.length;
|
|
10114
10114
|
if (len <= width) {
|
|
10115
10115
|
const pad = width - len;
|
|
10116
|
-
return pad > 0 ?
|
|
10116
|
+
return pad > 0 ? text2 + spaces(pad) : text2;
|
|
10117
10117
|
}
|
|
10118
|
-
if (width <= 3) return
|
|
10119
|
-
return
|
|
10118
|
+
if (width <= 3) return text2.slice(0, width);
|
|
10119
|
+
return text2.slice(0, width - 3) + "...";
|
|
10120
10120
|
}
|
|
10121
10121
|
function compactText(value, max) {
|
|
10122
10122
|
const clean = value.replace(/\s+/g, " ").trim();
|
|
@@ -10131,39 +10131,39 @@ function compactText(value, max) {
|
|
|
10131
10131
|
if (max <= 3) return sliceAnsi(clean, 0, max);
|
|
10132
10132
|
return sliceAnsi(clean, 0, max - 3) + "...";
|
|
10133
10133
|
}
|
|
10134
|
-
function fit(
|
|
10135
|
-
if (isSimpleAscii(
|
|
10136
|
-
return fitAscii(
|
|
10134
|
+
function fit(text2, width) {
|
|
10135
|
+
if (isSimpleAscii(text2)) {
|
|
10136
|
+
return fitAscii(text2, width);
|
|
10137
10137
|
}
|
|
10138
10138
|
if (width <= 0) return "";
|
|
10139
|
-
const w = cachedStringWidth(
|
|
10139
|
+
const w = cachedStringWidth(text2);
|
|
10140
10140
|
if (w <= width) {
|
|
10141
10141
|
const pad = width - w;
|
|
10142
|
-
return pad > 0 ?
|
|
10142
|
+
return pad > 0 ? text2 + spaces(pad) : text2;
|
|
10143
10143
|
}
|
|
10144
|
-
if (width <= 3) return sliceAnsi(
|
|
10145
|
-
return sliceAnsi(
|
|
10144
|
+
if (width <= 3) return sliceAnsi(text2, 0, width);
|
|
10145
|
+
return sliceAnsi(text2, 0, width - 3) + "...";
|
|
10146
10146
|
}
|
|
10147
|
-
function fitAnsi(
|
|
10148
|
-
if (isSimpleAscii(
|
|
10149
|
-
return fitAscii(
|
|
10147
|
+
function fitAnsi(text2, width) {
|
|
10148
|
+
if (isSimpleAscii(text2)) {
|
|
10149
|
+
return fitAscii(text2, width);
|
|
10150
10150
|
}
|
|
10151
10151
|
if (width <= 0) return "";
|
|
10152
|
-
const visualWidth = cachedStringWidth(
|
|
10152
|
+
const visualWidth = cachedStringWidth(text2);
|
|
10153
10153
|
if (visualWidth <= width) {
|
|
10154
10154
|
const pad = width - visualWidth;
|
|
10155
|
-
return pad > 0 ?
|
|
10155
|
+
return pad > 0 ? text2 + spaces(pad) : text2;
|
|
10156
10156
|
}
|
|
10157
|
-
if (width <= 3) return sliceAnsi(
|
|
10158
|
-
return sliceAnsi(
|
|
10157
|
+
if (width <= 3) return sliceAnsi(text2, 0, width);
|
|
10158
|
+
return sliceAnsi(text2, 0, width - 3) + "...";
|
|
10159
10159
|
}
|
|
10160
|
-
function centerAnsi(
|
|
10160
|
+
function centerAnsi(text2, width) {
|
|
10161
10161
|
if (width <= 0) return "";
|
|
10162
|
-
const visualWidth = cachedStringWidth(
|
|
10163
|
-
if (visualWidth >= width) return sliceAnsi(
|
|
10162
|
+
const visualWidth = cachedStringWidth(text2);
|
|
10163
|
+
if (visualWidth >= width) return sliceAnsi(text2, 0, width);
|
|
10164
10164
|
const left = Math.floor((width - visualWidth) / 2);
|
|
10165
10165
|
const right = width - left - visualWidth;
|
|
10166
|
-
return spaces(left) +
|
|
10166
|
+
return spaces(left) + text2 + spaces(right);
|
|
10167
10167
|
}
|
|
10168
10168
|
function formatClock(timestamp2) {
|
|
10169
10169
|
const d = new Date(timestamp2);
|
|
@@ -10280,9 +10280,9 @@ var MCP_INPUT_EXTRACTORS = {
|
|
|
10280
10280
|
get_element_details: eidExtractor,
|
|
10281
10281
|
click: eidExtractor,
|
|
10282
10282
|
type: (input) => {
|
|
10283
|
-
const
|
|
10283
|
+
const text2 = String(input.text ?? "");
|
|
10284
10284
|
const eid = input.eid ? String(input.eid).slice(0, 5) + "\u2026" : "";
|
|
10285
|
-
const quoted = `"${compactText(
|
|
10285
|
+
const quoted = `"${compactText(text2, 72)}"`;
|
|
10286
10286
|
return eid ? `${quoted} \u2192 ${eid}` : quoted;
|
|
10287
10287
|
},
|
|
10288
10288
|
hover: eidExtractor,
|
|
@@ -10429,10 +10429,10 @@ function wrapSegmentPieces(segment, width) {
|
|
|
10429
10429
|
pieces.push({ text: segment.slice(pieceStart), start: pieceStart });
|
|
10430
10430
|
return pieces;
|
|
10431
10431
|
}
|
|
10432
|
-
function wrapText(
|
|
10433
|
-
if (width <= 0) return [
|
|
10432
|
+
function wrapText(text2, width) {
|
|
10433
|
+
if (width <= 0) return [text2];
|
|
10434
10434
|
const lines = [];
|
|
10435
|
-
for (const segment of
|
|
10435
|
+
for (const segment of text2.split("\n")) {
|
|
10436
10436
|
for (const piece of wrapSegmentPieces(segment, width)) {
|
|
10437
10437
|
lines.push(piece.text);
|
|
10438
10438
|
}
|
|
@@ -10525,8 +10525,8 @@ function extractFileContent(response) {
|
|
|
10525
10525
|
for (const block of response) {
|
|
10526
10526
|
const fc = prop(prop(block, "file"), "content");
|
|
10527
10527
|
if (typeof fc === "string") return fc;
|
|
10528
|
-
const
|
|
10529
|
-
if (typeof
|
|
10528
|
+
const text2 = prop(block, "text");
|
|
10529
|
+
if (typeof text2 === "string") return text2;
|
|
10530
10530
|
}
|
|
10531
10531
|
}
|
|
10532
10532
|
return void 0;
|
|
@@ -10686,16 +10686,16 @@ function resolveVerb(toolName, parsed) {
|
|
|
10686
10686
|
}
|
|
10687
10687
|
|
|
10688
10688
|
// src/core/feed/timeline.ts
|
|
10689
|
-
function stripMarkdownInline(
|
|
10690
|
-
return
|
|
10689
|
+
function stripMarkdownInline(text2) {
|
|
10690
|
+
return text2.replace(/#{1,6}\s+/g, "").replace(/\*\*(.+?)\*\*/g, "$1").replace(/__(.+?)__/g, "$1").replace(/\*(.+?)\*/g, "$1").replace(/`(.+?)`/g, "$1").replace(/~~(.+?)~~/g, "$1");
|
|
10691
10691
|
}
|
|
10692
|
-
function firstSentence(
|
|
10693
|
-
const nlIdx =
|
|
10694
|
-
const sentIdx =
|
|
10692
|
+
function firstSentence(text2) {
|
|
10693
|
+
const nlIdx = text2.indexOf("\n");
|
|
10694
|
+
const sentIdx = text2.indexOf(". ");
|
|
10695
10695
|
const nlEnd = nlIdx === -1 ? Infinity : nlIdx;
|
|
10696
10696
|
const sentEnd = sentIdx === -1 ? Infinity : sentIdx + 1;
|
|
10697
|
-
const end = Math.min(nlEnd, sentEnd,
|
|
10698
|
-
return
|
|
10697
|
+
const end = Math.min(nlEnd, sentEnd, text2.length);
|
|
10698
|
+
return text2.slice(0, end).trim();
|
|
10699
10699
|
}
|
|
10700
10700
|
function resolveDisplayName(toolName) {
|
|
10701
10701
|
const parsed = parseToolName(toolName);
|
|
@@ -10721,12 +10721,12 @@ function formatToolSummary(toolName, toolInput, errorSuffix) {
|
|
|
10721
10721
|
);
|
|
10722
10722
|
const secondary = [primaryInput, errorSuffix].filter(Boolean).join(" ");
|
|
10723
10723
|
if (!secondary) {
|
|
10724
|
-
const
|
|
10725
|
-
return { text:
|
|
10724
|
+
const text3 = compactText(verb, 200);
|
|
10725
|
+
return { text: text3, segments: [{ text: text3, role: "verb" }] };
|
|
10726
10726
|
}
|
|
10727
10727
|
const full = `${verb} ${secondary}`;
|
|
10728
|
-
const
|
|
10729
|
-
const rest =
|
|
10728
|
+
const text2 = compactText(full, 200);
|
|
10729
|
+
const rest = text2.slice(verb.length);
|
|
10730
10730
|
const baseName = toolName;
|
|
10731
10731
|
const filePath = toolInput.file_path ?? toolInput.pattern ?? toolInput.path;
|
|
10732
10732
|
if (PATH_TOOLS.has(baseName) && typeof filePath === "string") {
|
|
@@ -10737,7 +10737,7 @@ function formatToolSummary(toolName, toolInput, errorSuffix) {
|
|
|
10737
10737
|
const beforeFilename = rest.slice(0, idx + prefix.length);
|
|
10738
10738
|
const afterFilename = rest.slice(idx + prefix.length + filename.length);
|
|
10739
10739
|
return {
|
|
10740
|
-
text,
|
|
10740
|
+
text: text2,
|
|
10741
10741
|
segments: [
|
|
10742
10742
|
{ text: verb, role: "verb" },
|
|
10743
10743
|
{ text: beforeFilename, role: "target" },
|
|
@@ -10749,7 +10749,7 @@ function formatToolSummary(toolName, toolInput, errorSuffix) {
|
|
|
10749
10749
|
}
|
|
10750
10750
|
}
|
|
10751
10751
|
return {
|
|
10752
|
-
text,
|
|
10752
|
+
text: text2,
|
|
10753
10753
|
segments: [
|
|
10754
10754
|
{ text: verb, role: "verb" },
|
|
10755
10755
|
{ text: rest, role: "target" }
|
|
@@ -10764,9 +10764,9 @@ function formatPermissionSummary(event) {
|
|
|
10764
10764
|
}
|
|
10765
10765
|
const protocol = event.data.network_context?.protocol;
|
|
10766
10766
|
const suffix = ` \u2192 ${protocol ? `${protocol} ` : ""}${host}`;
|
|
10767
|
-
const
|
|
10767
|
+
const text2 = compactText(`${base.text}${suffix}`, 200);
|
|
10768
10768
|
return {
|
|
10769
|
-
text,
|
|
10769
|
+
text: text2,
|
|
10770
10770
|
segments: [...base.segments, { text: suffix, role: "target" }]
|
|
10771
10771
|
};
|
|
10772
10772
|
}
|
|
@@ -10781,8 +10781,8 @@ function formatRunEndSummary(event) {
|
|
|
10781
10781
|
function harnessSummary(event) {
|
|
10782
10782
|
const title = event.display?.title?.trim();
|
|
10783
10783
|
if (!title) return void 0;
|
|
10784
|
-
const
|
|
10785
|
-
return { text, segments: [{ text, role: "target" }] };
|
|
10784
|
+
const text2 = compactText(title, 200);
|
|
10785
|
+
return { text: text2, segments: [{ text: text2, role: "target" }] };
|
|
10786
10786
|
}
|
|
10787
10787
|
function postOutcome(postEvent) {
|
|
10788
10788
|
if (postEvent.kind === "tool.failure") {
|
|
@@ -10802,8 +10802,8 @@ function postOutcome(postEvent) {
|
|
|
10802
10802
|
}
|
|
10803
10803
|
return void 0;
|
|
10804
10804
|
}
|
|
10805
|
-
function plainSummary(
|
|
10806
|
-
const compact = compactText(
|
|
10805
|
+
function plainSummary(text2) {
|
|
10806
|
+
const compact = compactText(text2, 200);
|
|
10807
10807
|
return { text: compact, segments: [{ text: compact, role: "target" }] };
|
|
10808
10808
|
}
|
|
10809
10809
|
function dataExpansion(event) {
|
|
@@ -11037,11 +11037,11 @@ var subagentStart = {
|
|
|
11037
11037
|
label: () => "Sub Start",
|
|
11038
11038
|
detail: (event) => event.data.agent_type,
|
|
11039
11039
|
summary: (event) => {
|
|
11040
|
-
const
|
|
11040
|
+
const text2 = compactText(
|
|
11041
11041
|
event.data.description?.trim() || `id:${event.data.agent_id}`,
|
|
11042
11042
|
200
|
|
11043
11043
|
);
|
|
11044
|
-
return { text, segments: [{ text, role: "target" }] };
|
|
11044
|
+
return { text: text2, segments: [{ text: text2, role: "target" }] };
|
|
11045
11045
|
},
|
|
11046
11046
|
expansion: rawOrDataExpansion
|
|
11047
11047
|
};
|
|
@@ -11050,11 +11050,11 @@ var subagentStop = {
|
|
|
11050
11050
|
label: () => "Sub Stop",
|
|
11051
11051
|
detail: (event) => event.data.agent_type,
|
|
11052
11052
|
summary: (event) => {
|
|
11053
|
-
const
|
|
11053
|
+
const text2 = compactText(
|
|
11054
11054
|
event.data.description?.trim() || `id:${event.data.agent_id}`,
|
|
11055
11055
|
200
|
|
11056
11056
|
);
|
|
11057
|
-
return { text, segments: [{ text, role: "target" }] };
|
|
11057
|
+
return { text: text2, segments: [{ text: text2, role: "target" }] };
|
|
11058
11058
|
},
|
|
11059
11059
|
expansion: dataExpansion
|
|
11060
11060
|
};
|
|
@@ -11204,11 +11204,11 @@ var agentMessage = {
|
|
|
11204
11204
|
label: () => "Agent Msg",
|
|
11205
11205
|
detail: () => "\u2500",
|
|
11206
11206
|
summary: (event) => {
|
|
11207
|
-
const
|
|
11207
|
+
const text2 = compactText(
|
|
11208
11208
|
firstSentence(stripMarkdownInline(event.data.message)),
|
|
11209
11209
|
200
|
|
11210
11210
|
);
|
|
11211
|
-
return { text, segments: [{ text, role: "plain" }] };
|
|
11211
|
+
return { text: text2, segments: [{ text: text2, role: "plain" }] };
|
|
11212
11212
|
},
|
|
11213
11213
|
expansion: rawOrDataExpansion
|
|
11214
11214
|
};
|
|
@@ -11520,10 +11520,10 @@ function prop2(obj, key) {
|
|
|
11520
11520
|
}
|
|
11521
11521
|
return void 0;
|
|
11522
11522
|
}
|
|
11523
|
-
function truncate(
|
|
11524
|
-
if (
|
|
11525
|
-
if (max <= 3) return
|
|
11526
|
-
return
|
|
11523
|
+
function truncate(text2, max) {
|
|
11524
|
+
if (text2.length <= max) return text2;
|
|
11525
|
+
if (max <= 3) return text2.slice(0, max);
|
|
11526
|
+
return text2.slice(0, max - 1) + "\u2026";
|
|
11527
11527
|
}
|
|
11528
11528
|
function extractDomain(url) {
|
|
11529
11529
|
if (typeof url !== "string") return "";
|
|
@@ -11645,9 +11645,9 @@ function findDetailsExtractor(input) {
|
|
|
11645
11645
|
return parts.length > 0 ? [{ text: parts.join(" "), role: "target" }] : [{ text: "elements", role: "target" }];
|
|
11646
11646
|
}
|
|
11647
11647
|
function typeDetailsExtractor(input) {
|
|
11648
|
-
const
|
|
11648
|
+
const text2 = String(prop2(input, "text") ?? "");
|
|
11649
11649
|
const eid = prop2(input, "eid");
|
|
11650
|
-
const quoted = `"${truncate(
|
|
11650
|
+
const quoted = `"${truncate(text2, 30)}"`;
|
|
11651
11651
|
if (eid) {
|
|
11652
11652
|
return [{ text: `${quoted} \u2192 ${String(eid).slice(0, 5)}\u2026`, role: "target" }];
|
|
11653
11653
|
}
|
|
@@ -11656,8 +11656,8 @@ function typeDetailsExtractor(input) {
|
|
|
11656
11656
|
function scrollDetailsExtractor(input) {
|
|
11657
11657
|
const dir = String(prop2(input, "direction") ?? "");
|
|
11658
11658
|
const amount = prop2(input, "amount");
|
|
11659
|
-
const
|
|
11660
|
-
return
|
|
11659
|
+
const text2 = amount ? `${dir} ${amount}px` : dir;
|
|
11660
|
+
return text2 ? [{ text: text2, role: "target" }] : [];
|
|
11661
11661
|
}
|
|
11662
11662
|
function tabRefExtractor(input) {
|
|
11663
11663
|
const pageId = prop2(input, "page_id");
|
|
@@ -11917,8 +11917,8 @@ var KNOWN_TOOL_DISPLAY = new Map([
|
|
|
11917
11917
|
extractDetails: (input) => {
|
|
11918
11918
|
const action = String(prop2(input, "action") ?? "");
|
|
11919
11919
|
const triggerId = prop2(input, "trigger_id");
|
|
11920
|
-
const
|
|
11921
|
-
return [{ text, role: "target" }];
|
|
11920
|
+
const text2 = triggerId ? `${action} ${String(triggerId)}` : action;
|
|
11921
|
+
return [{ text: text2, role: "target" }];
|
|
11922
11922
|
},
|
|
11923
11923
|
extractOutcome: () => void 0
|
|
11924
11924
|
}
|
|
@@ -13109,6 +13109,163 @@ function forecastOfClass(sizeClass, calibration) {
|
|
|
13109
13109
|
return calibration?.[sizeClass]?.forecast ?? SIZE_CLASS_FORECASTS[sizeClass];
|
|
13110
13110
|
}
|
|
13111
13111
|
|
|
13112
|
+
// ../../packages/protocol/src/tracker.ts
|
|
13113
|
+
var id = external_exports.string().min(1).max(160);
|
|
13114
|
+
var text = external_exports.string().max(1e5);
|
|
13115
|
+
var deliveryEvidenceKindSchema = external_exports.enum(["pr_opened", "merged", "staging", "qa_started", "qa_passed", "released"]);
|
|
13116
|
+
var deliveryStageSchema = external_exports.strictObject({
|
|
13117
|
+
id,
|
|
13118
|
+
name: external_exports.string().trim().min(1).max(100),
|
|
13119
|
+
category: external_exports.enum(["backlog", "unstarted", "started", "completed", "canceled"]),
|
|
13120
|
+
behavior: external_exports.enum(["manual", "agent_start", ...deliveryEvidenceKindSchema.options]).default("manual")
|
|
13121
|
+
});
|
|
13122
|
+
var deliveryTransitionSchema = external_exports.strictObject({
|
|
13123
|
+
from: id,
|
|
13124
|
+
to: id,
|
|
13125
|
+
requires: external_exports.array(deliveryEvidenceKindSchema).default([])
|
|
13126
|
+
});
|
|
13127
|
+
var deliveryWorkflowSchema = external_exports.strictObject({
|
|
13128
|
+
revision: external_exports.number().int().nonnegative(),
|
|
13129
|
+
stages: external_exports.array(deliveryStageSchema).min(1).max(100),
|
|
13130
|
+
transitions: external_exports.array(deliveryTransitionSchema).max(1e4),
|
|
13131
|
+
attentionColumn: external_exports.boolean().default(true)
|
|
13132
|
+
}).superRefine((workflow, ctx) => {
|
|
13133
|
+
const ids = new Set(workflow.stages.map((s) => s.id));
|
|
13134
|
+
if (ids.size !== workflow.stages.length) ctx.addIssue({ code: "custom", message: "Duplicate stage ID" });
|
|
13135
|
+
const edges = /* @__PURE__ */ new Set();
|
|
13136
|
+
for (const edge of workflow.transitions) {
|
|
13137
|
+
const key = JSON.stringify([edge.from, edge.to]);
|
|
13138
|
+
if (!ids.has(edge.from) || !ids.has(edge.to) || edge.from === edge.to || edges.has(key))
|
|
13139
|
+
ctx.addIssue({ code: "custom", message: "Invalid or duplicate transition" });
|
|
13140
|
+
edges.add(key);
|
|
13141
|
+
}
|
|
13142
|
+
});
|
|
13143
|
+
var trackerSourceSchema = external_exports.strictObject({ workspace: id, id, identifier: id, url: external_exports.string().url() });
|
|
13144
|
+
var trackerPlanSchema = external_exports.strictObject({ id, name: external_exports.string().trim().min(1).max(200), description: text.default(""), source: trackerSourceSchema.optional() });
|
|
13145
|
+
var trackerCommentSchema = external_exports.strictObject({ id, body: text, author: id, createdAt: external_exports.number(), sourceId: id.optional() });
|
|
13146
|
+
var trackerEvidenceSchema = external_exports.strictObject({
|
|
13147
|
+
id,
|
|
13148
|
+
kind: deliveryEvidenceKindSchema,
|
|
13149
|
+
revision: id,
|
|
13150
|
+
reference: external_exports.string().min(1).max(2e3),
|
|
13151
|
+
deploymentId: id.optional(),
|
|
13152
|
+
runId: id.optional(),
|
|
13153
|
+
createdAt: external_exports.number(),
|
|
13154
|
+
author: id
|
|
13155
|
+
});
|
|
13156
|
+
var trackerIssueSchema = external_exports.strictObject({
|
|
13157
|
+
id,
|
|
13158
|
+
identifier: id,
|
|
13159
|
+
title: external_exports.string().trim().min(1).max(500),
|
|
13160
|
+
description: text,
|
|
13161
|
+
stageId: id,
|
|
13162
|
+
planId: id.nullable(),
|
|
13163
|
+
parentId: id.nullable(),
|
|
13164
|
+
assignee: id.nullable(),
|
|
13165
|
+
priority: external_exports.number().int().min(0).max(4),
|
|
13166
|
+
labels: external_exports.array(external_exports.string().max(100)).max(100),
|
|
13167
|
+
blockedBy: external_exports.array(id).max(100),
|
|
13168
|
+
externalBlockers: external_exports.array(external_exports.string().max(2e3)).max(100),
|
|
13169
|
+
agentEligible: external_exports.boolean(),
|
|
13170
|
+
automationHeld: external_exports.boolean(),
|
|
13171
|
+
revision: id.nullable(),
|
|
13172
|
+
attention: external_exports.strictObject({
|
|
13173
|
+
id,
|
|
13174
|
+
message: external_exports.string().trim().min(1).max(1e4),
|
|
13175
|
+
runId: id.optional(),
|
|
13176
|
+
origin: external_exports.enum(["manual", "run"]).default("manual")
|
|
13177
|
+
}).nullable(),
|
|
13178
|
+
threadId: id,
|
|
13179
|
+
runIds: external_exports.array(id),
|
|
13180
|
+
comments: external_exports.array(trackerCommentSchema),
|
|
13181
|
+
evidence: external_exports.array(trackerEvidenceSchema),
|
|
13182
|
+
history: external_exports.array(external_exports.strictObject({ at: external_exports.number(), actor: id, action: external_exports.string(), from: id.optional(), to: id.optional() })),
|
|
13183
|
+
source: trackerSourceSchema.optional(),
|
|
13184
|
+
sourceAssignee: external_exports.string().optional(),
|
|
13185
|
+
createdAt: external_exports.number(),
|
|
13186
|
+
updatedAt: external_exports.number(),
|
|
13187
|
+
version: external_exports.number().int().nonnegative()
|
|
13188
|
+
});
|
|
13189
|
+
var trackerSnapshotSchema = external_exports.strictObject({
|
|
13190
|
+
workflow: deliveryWorkflowSchema,
|
|
13191
|
+
issues: external_exports.array(trackerIssueSchema),
|
|
13192
|
+
plans: external_exports.array(trackerPlanSchema),
|
|
13193
|
+
members: external_exports.array(id)
|
|
13194
|
+
});
|
|
13195
|
+
var issueFields = {
|
|
13196
|
+
title: external_exports.string().trim().min(1).max(500),
|
|
13197
|
+
description: text.default(""),
|
|
13198
|
+
planId: id.nullable().default(null),
|
|
13199
|
+
parentId: id.nullable().default(null),
|
|
13200
|
+
assignee: id.nullable().default(null),
|
|
13201
|
+
priority: external_exports.number().int().min(0).max(4).default(0),
|
|
13202
|
+
labels: external_exports.array(external_exports.string().max(100)).max(100).default([]),
|
|
13203
|
+
blockedBy: external_exports.array(id).max(100).default([]),
|
|
13204
|
+
externalBlockers: external_exports.array(external_exports.string().max(2e3)).max(100).default([]),
|
|
13205
|
+
agentEligible: external_exports.boolean().default(false),
|
|
13206
|
+
revision: id.nullable().default(null)
|
|
13207
|
+
};
|
|
13208
|
+
var trackerImportSchema = external_exports.strictObject({
|
|
13209
|
+
workspace: id,
|
|
13210
|
+
teamId: id,
|
|
13211
|
+
stages: external_exports.array(deliveryStageSchema).min(1).max(100),
|
|
13212
|
+
stageMapping: external_exports.record(external_exports.string(), id),
|
|
13213
|
+
adoptWorkflow: external_exports.boolean(),
|
|
13214
|
+
plans: external_exports.array(external_exports.strictObject({ source: trackerSourceSchema, name: external_exports.string().min(1).max(200), description: text })).max(500),
|
|
13215
|
+
issues: external_exports.array(external_exports.strictObject({
|
|
13216
|
+
source: trackerSourceSchema,
|
|
13217
|
+
title: issueFields.title,
|
|
13218
|
+
description: text,
|
|
13219
|
+
stageId: id,
|
|
13220
|
+
planId: id.nullable(),
|
|
13221
|
+
parentId: id.nullable(),
|
|
13222
|
+
assignee: id.nullable(),
|
|
13223
|
+
sourceAssignee: external_exports.string().optional(),
|
|
13224
|
+
priority: issueFields.priority,
|
|
13225
|
+
labels: issueFields.labels,
|
|
13226
|
+
blockedBy: external_exports.array(id).max(100),
|
|
13227
|
+
externalBlockers: external_exports.array(external_exports.string().max(2e3)).max(100).default([]),
|
|
13228
|
+
comments: external_exports.array(trackerCommentSchema).max(1e3),
|
|
13229
|
+
createdAt: external_exports.number()
|
|
13230
|
+
})).max(2e3),
|
|
13231
|
+
omissions: external_exports.array(external_exports.string().max(2e3)).max(500).default([])
|
|
13232
|
+
});
|
|
13233
|
+
var trackerOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
13234
|
+
external_exports.strictObject({ kind: external_exports.literal("tracker.sync") }),
|
|
13235
|
+
external_exports.strictObject({ kind: external_exports.literal("issue.create"), id: id.max(147), stageId: id.optional(), ...issueFields }),
|
|
13236
|
+
external_exports.strictObject({ kind: external_exports.literal("issue.update"), id, version: external_exports.number().int(), changes: trackerIssueSchema.pick({
|
|
13237
|
+
title: true,
|
|
13238
|
+
description: true,
|
|
13239
|
+
planId: true,
|
|
13240
|
+
parentId: true,
|
|
13241
|
+
assignee: true,
|
|
13242
|
+
priority: true,
|
|
13243
|
+
labels: true,
|
|
13244
|
+
blockedBy: true,
|
|
13245
|
+
externalBlockers: true,
|
|
13246
|
+
agentEligible: true,
|
|
13247
|
+
revision: true
|
|
13248
|
+
}).partial() }),
|
|
13249
|
+
external_exports.strictObject({ kind: external_exports.literal("plan.save"), ...trackerPlanSchema.shape }),
|
|
13250
|
+
external_exports.strictObject({ kind: external_exports.literal("workflow.save"), workflow: deliveryWorkflowSchema, replacements: external_exports.record(external_exports.string(), id).default({}) }),
|
|
13251
|
+
external_exports.strictObject({ kind: external_exports.literal("issue.transition"), id, version: external_exports.number().int(), stageId: id }),
|
|
13252
|
+
external_exports.strictObject({ kind: external_exports.literal("issue.attention"), id, version: external_exports.number().int(), message: external_exports.string().trim().min(1).max(1e4), runId: id.optional() }),
|
|
13253
|
+
external_exports.strictObject({ kind: external_exports.literal("issue.resolve"), id, version: external_exports.number().int(), attentionId: id }),
|
|
13254
|
+
external_exports.strictObject({ kind: external_exports.literal("issue.resume"), id, version: external_exports.number().int() }),
|
|
13255
|
+
external_exports.strictObject({ kind: external_exports.literal("issue.revision"), id, version: external_exports.number().int(), revision: id, runId: id }),
|
|
13256
|
+
external_exports.strictObject({ kind: external_exports.literal("issue.comment"), id, commentId: id, body: text }),
|
|
13257
|
+
external_exports.strictObject({ kind: external_exports.literal("issue.evidence"), id, evidenceId: id, evidence: trackerEvidenceSchema.omit({ id: true, author: true, createdAt: true }) }),
|
|
13258
|
+
external_exports.strictObject({ kind: external_exports.literal("import.preview"), input: trackerImportSchema }),
|
|
13259
|
+
external_exports.strictObject({ kind: external_exports.literal("import.commit"), previewId: id })
|
|
13260
|
+
]);
|
|
13261
|
+
var trackerImportPreviewSchema = external_exports.strictObject({
|
|
13262
|
+
previewId: id,
|
|
13263
|
+
creates: external_exports.number().int(),
|
|
13264
|
+
skips: external_exports.number().int(),
|
|
13265
|
+
plans: external_exports.number().int(),
|
|
13266
|
+
omissions: external_exports.array(external_exports.string())
|
|
13267
|
+
});
|
|
13268
|
+
|
|
13112
13269
|
// ../../packages/protocol/src/v2.ts
|
|
13113
13270
|
var protocolVersion = { major: 2, minor: 3 };
|
|
13114
13271
|
var conversationContinuationCapability = "conversation_continuation";
|
|
@@ -13129,13 +13286,13 @@ var permissionAnswerSchema = external_exports.strictObject({
|
|
|
13129
13286
|
decision: external_exports.enum(["allow", "deny"]),
|
|
13130
13287
|
reason: external_exports.string().max(4096).optional()
|
|
13131
13288
|
});
|
|
13132
|
-
var
|
|
13289
|
+
var id2 = external_exports.string().min(1).max(160);
|
|
13133
13290
|
var sequence = external_exports.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
13134
13291
|
var positive = sequence.refine((n) => n > 0);
|
|
13135
13292
|
var timestamp = external_exports.iso.datetime();
|
|
13136
13293
|
var scopeSchema = external_exports.discriminatedUnion("visibility", [
|
|
13137
13294
|
external_exports.strictObject({ visibility: external_exports.literal("organization") }),
|
|
13138
|
-
external_exports.strictObject({ visibility: external_exports.literal("private"), ownerUserId:
|
|
13295
|
+
external_exports.strictObject({ visibility: external_exports.literal("private"), ownerUserId: id2 })
|
|
13139
13296
|
]);
|
|
13140
13297
|
var installedWorkflowsSchema = external_exports.array(InstalledWorkflowSchema).max(256);
|
|
13141
13298
|
var harnessSchema = external_exports.enum(["claude-code", "codex"]);
|
|
@@ -13145,14 +13302,14 @@ var runnerReadinessSchema = external_exports.strictObject({
|
|
|
13145
13302
|
codex: harnessReadinessSchema.optional()
|
|
13146
13303
|
});
|
|
13147
13304
|
var interruptionSchema = external_exports.strictObject({
|
|
13148
|
-
interruptionId:
|
|
13305
|
+
interruptionId: id2,
|
|
13149
13306
|
revision: positive,
|
|
13150
13307
|
/** `waiting` (root ADR-0008) is non-human: a Run parked until one of its children closes or parks. */
|
|
13151
13308
|
kind: external_exports.enum(["permission", "question", "guidance", "recovery", "waiting"]),
|
|
13152
13309
|
message: external_exports.string().max(16384),
|
|
13153
13310
|
/** Explicit technical question for a parent; absent always reserves the answer to a member. */
|
|
13154
13311
|
respondent: external_exports.enum(["orchestrator"]).optional(),
|
|
13155
|
-
requestId:
|
|
13312
|
+
requestId: id2.optional()
|
|
13156
13313
|
});
|
|
13157
13314
|
var workflowIdentitySchema = external_exports.strictObject({
|
|
13158
13315
|
name: external_exports.string().min(1).max(128),
|
|
@@ -13182,8 +13339,8 @@ var runCloseReasonSchema = external_exports.enum([
|
|
|
13182
13339
|
...buildCloseReasonSchema.options
|
|
13183
13340
|
]);
|
|
13184
13341
|
var factIdentity = {
|
|
13185
|
-
runId:
|
|
13186
|
-
attemptId:
|
|
13342
|
+
runId: id2,
|
|
13343
|
+
attemptId: id2,
|
|
13187
13344
|
executionRevision: positive,
|
|
13188
13345
|
emittedAt: timestamp
|
|
13189
13346
|
};
|
|
@@ -13194,11 +13351,11 @@ var controlRecordSchema = external_exports.discriminatedUnion("kind", [
|
|
|
13194
13351
|
external_exports.strictObject({ kind: external_exports.literal("workflows.changed"), workflows: installedWorkflowsSchema }),
|
|
13195
13352
|
/** Instance-scoped, not tied to a Run: the Runner's full Readiness, sent when it changes after hello. */
|
|
13196
13353
|
external_exports.strictObject({ kind: external_exports.literal("readiness.changed"), readiness: runnerReadinessSchema }),
|
|
13197
|
-
external_exports.strictObject({ kind: external_exports.literal("assignment.accepted"), runId:
|
|
13354
|
+
external_exports.strictObject({ kind: external_exports.literal("assignment.accepted"), runId: id2, attemptId: id2 }),
|
|
13198
13355
|
external_exports.strictObject({
|
|
13199
13356
|
kind: external_exports.literal("assignment.rejected"),
|
|
13200
|
-
runId:
|
|
13201
|
-
attemptId:
|
|
13357
|
+
runId: id2,
|
|
13358
|
+
attemptId: id2,
|
|
13202
13359
|
reason: external_exports.string().max(1024)
|
|
13203
13360
|
}),
|
|
13204
13361
|
external_exports.strictObject({
|
|
@@ -13216,8 +13373,8 @@ var controlRecordSchema = external_exports.discriminatedUnion("kind", [
|
|
|
13216
13373
|
historyThrough: sequence,
|
|
13217
13374
|
continuation: external_exports.discriminatedUnion("kind", [
|
|
13218
13375
|
external_exports.strictObject({ kind: external_exports.literal("live_request") }),
|
|
13219
|
-
external_exports.strictObject({ kind: external_exports.literal("local_checkpoint"), checkpointId:
|
|
13220
|
-
external_exports.strictObject({ kind: external_exports.literal("portable_checkpoint"), checkpointId:
|
|
13376
|
+
external_exports.strictObject({ kind: external_exports.literal("local_checkpoint"), checkpointId: id2 }),
|
|
13377
|
+
external_exports.strictObject({ kind: external_exports.literal("portable_checkpoint"), checkpointId: id2 }),
|
|
13221
13378
|
external_exports.strictObject({ kind: external_exports.literal("repair_required"), detail: external_exports.string().max(4096) })
|
|
13222
13379
|
]),
|
|
13223
13380
|
...reportedUsage
|
|
@@ -13240,16 +13397,16 @@ var controlRecordSchema = external_exports.discriminatedUnion("kind", [
|
|
|
13240
13397
|
* The usage of a Run while it executes, for a grant marked `reportUsage`. Not an execution fact: it carries no
|
|
13241
13398
|
* execution revision, so it never advances, parks or closes the Run, and never wakes its parent.
|
|
13242
13399
|
*/
|
|
13243
|
-
external_exports.strictObject({ kind: external_exports.literal("run.usage"), runId:
|
|
13244
|
-
external_exports.strictObject({ kind: external_exports.literal("command.applied"), runId:
|
|
13400
|
+
external_exports.strictObject({ kind: external_exports.literal("run.usage"), runId: id2, attemptId: id2, ...runUsageSchema.shape }),
|
|
13401
|
+
external_exports.strictObject({ kind: external_exports.literal("command.applied"), runId: id2, attemptId: id2, commandId: id2 }),
|
|
13245
13402
|
external_exports.strictObject({
|
|
13246
13403
|
kind: external_exports.literal("command.rejected"),
|
|
13247
|
-
runId:
|
|
13248
|
-
attemptId:
|
|
13249
|
-
commandId:
|
|
13404
|
+
runId: id2,
|
|
13405
|
+
attemptId: id2,
|
|
13406
|
+
commandId: id2,
|
|
13250
13407
|
reason: external_exports.string().max(1024)
|
|
13251
13408
|
}),
|
|
13252
|
-
external_exports.strictObject({ kind: external_exports.literal("revoked_not_started"), runId:
|
|
13409
|
+
external_exports.strictObject({ kind: external_exports.literal("revoked_not_started"), runId: id2, attemptId: id2 })
|
|
13253
13410
|
]);
|
|
13254
13411
|
var repositoryRefSchema = external_exports.string().min(1).max(512).regex(
|
|
13255
13412
|
/^(?![-/])(?!.*\.\.)(?!.*@\{)(?!.*(?:^|\/)\.)(?!.*\.lock(?:\/|$))(?!.*\/\/)[^\x00-\x20\x7f~^:?*\[\\]+(?<![/.])$/
|
|
@@ -13264,7 +13421,7 @@ var repositoryIdentity = {
|
|
|
13264
13421
|
name: external_exports.string().min(1).max(100).regex(/^(?!\.{1,2}$)[a-zA-Z0-9_.-]+$/)
|
|
13265
13422
|
};
|
|
13266
13423
|
var repositoryBindingSchema = external_exports.strictObject({
|
|
13267
|
-
id,
|
|
13424
|
+
id: id2,
|
|
13268
13425
|
label: external_exports.string().min(1).max(160),
|
|
13269
13426
|
...repositoryIdentity,
|
|
13270
13427
|
defaultRef: repositoryRefSchema,
|
|
@@ -13274,7 +13431,7 @@ var repositoryBindingSchema = external_exports.strictObject({
|
|
|
13274
13431
|
enabled: external_exports.boolean()
|
|
13275
13432
|
});
|
|
13276
13433
|
var repositorySourceSchema = external_exports.strictObject({
|
|
13277
|
-
bindingId:
|
|
13434
|
+
bindingId: id2,
|
|
13278
13435
|
...repositoryIdentity,
|
|
13279
13436
|
ref: repositoryRefSchema,
|
|
13280
13437
|
commitSha: external_exports.string().regex(/^[0-9a-f]{40}$/),
|
|
@@ -13310,23 +13467,23 @@ var delegationSchema = external_exports.strictObject({
|
|
|
13310
13467
|
tokenBudget: external_exports.number().int().positive().max(Number.MAX_SAFE_INTEGER)
|
|
13311
13468
|
});
|
|
13312
13469
|
var tokenCapSchema = external_exports.number().int().positive().max(Number.MAX_SAFE_INTEGER);
|
|
13313
|
-
var runParentIntentSchema = external_exports.strictObject({ runId:
|
|
13314
|
-
var runParentSchema = external_exports.strictObject({ runId:
|
|
13470
|
+
var runParentIntentSchema = external_exports.strictObject({ runId: id2, tokenCap: tokenCapSchema.optional() });
|
|
13471
|
+
var runParentSchema = external_exports.strictObject({ runId: id2, tokenCap: tokenCapSchema });
|
|
13315
13472
|
var commandSchema = external_exports.strictObject({
|
|
13316
|
-
commandId:
|
|
13317
|
-
hubEpoch:
|
|
13318
|
-
runId:
|
|
13473
|
+
commandId: id2,
|
|
13474
|
+
hubEpoch: id2,
|
|
13475
|
+
runId: id2,
|
|
13319
13476
|
expectedRecordRevision: sequence.optional(),
|
|
13320
13477
|
intent: external_exports.discriminatedUnion("kind", [
|
|
13321
13478
|
external_exports.strictObject({
|
|
13322
13479
|
kind: external_exports.literal("start"),
|
|
13323
|
-
sessionId:
|
|
13480
|
+
sessionId: id2,
|
|
13324
13481
|
/**
|
|
13325
13482
|
* Absent: the Hub resolves the Runner member-first (root ADR-0005): the Session's conversation Runner, else
|
|
13326
13483
|
* the starting member's own ready Personal Runner, else the Team default, else the start is refused.
|
|
13327
13484
|
*/
|
|
13328
|
-
runnerId:
|
|
13329
|
-
computeProfileId:
|
|
13485
|
+
runnerId: id2.optional(),
|
|
13486
|
+
computeProfileId: id2.optional(),
|
|
13330
13487
|
scope: scopeSchema,
|
|
13331
13488
|
spec: runSpecSchema,
|
|
13332
13489
|
key: runKeySchema.optional(),
|
|
@@ -13340,14 +13497,14 @@ var commandSchema = external_exports.strictObject({
|
|
|
13340
13497
|
external_exports.strictObject({ kind: external_exports.literal("steer"), text: external_exports.string().min(1).max(131072) }),
|
|
13341
13498
|
external_exports.strictObject({
|
|
13342
13499
|
kind: external_exports.literal("answer"),
|
|
13343
|
-
interruptionId:
|
|
13500
|
+
interruptionId: id2,
|
|
13344
13501
|
expectedInterruptionRevision: positive,
|
|
13345
|
-
requestId:
|
|
13502
|
+
requestId: id2.optional(),
|
|
13346
13503
|
answer: external_exports.json()
|
|
13347
13504
|
}),
|
|
13348
13505
|
external_exports.strictObject({
|
|
13349
13506
|
kind: external_exports.literal("resume"),
|
|
13350
|
-
interruptionId:
|
|
13507
|
+
interruptionId: id2,
|
|
13351
13508
|
guidance: external_exports.string().max(131072).optional()
|
|
13352
13509
|
}),
|
|
13353
13510
|
/**
|
|
@@ -13362,15 +13519,15 @@ var commandSchema = external_exports.strictObject({
|
|
|
13362
13519
|
})
|
|
13363
13520
|
])
|
|
13364
13521
|
});
|
|
13365
|
-
var deliveredCommandSchema = commandSchema.extend({ orchestratorRunId:
|
|
13522
|
+
var deliveredCommandSchema = commandSchema.extend({ orchestratorRunId: id2.optional() });
|
|
13366
13523
|
var grantSchema = external_exports.strictObject({
|
|
13367
|
-
commandId:
|
|
13368
|
-
hubEpoch:
|
|
13369
|
-
runId:
|
|
13370
|
-
sessionId:
|
|
13371
|
-
runnerId:
|
|
13372
|
-
installationId:
|
|
13373
|
-
attemptId:
|
|
13524
|
+
commandId: id2,
|
|
13525
|
+
hubEpoch: id2,
|
|
13526
|
+
runId: id2,
|
|
13527
|
+
sessionId: id2,
|
|
13528
|
+
runnerId: id2,
|
|
13529
|
+
installationId: id2,
|
|
13530
|
+
attemptId: id2,
|
|
13374
13531
|
generation: positive,
|
|
13375
13532
|
baseExecutionRevision: sequence,
|
|
13376
13533
|
baseHistorySeq: sequence,
|
|
@@ -13379,17 +13536,17 @@ var grantSchema = external_exports.strictObject({
|
|
|
13379
13536
|
spec: runSpecSchema,
|
|
13380
13537
|
continuation: external_exports.json().optional(),
|
|
13381
13538
|
/** Authenticated source of a delegated continuation; absence retains member semantics. */
|
|
13382
|
-
orchestratorRunId:
|
|
13539
|
+
orchestratorRunId: id2.optional(),
|
|
13383
13540
|
/** A new Run in a durable conversation; never resumes the predecessor's lifecycle. */
|
|
13384
13541
|
previousRun: external_exports.strictObject({
|
|
13385
|
-
runId:
|
|
13542
|
+
runId: id2,
|
|
13386
13543
|
executionRevision: sequence,
|
|
13387
13544
|
historyProduced: sequence,
|
|
13388
13545
|
/** Hub-confirmed administrative closure; allows an exact parked predecessor snapshot. */
|
|
13389
13546
|
closeReason: external_exports.literal("abandoned").optional(),
|
|
13390
|
-
checkpoint: external_exports.strictObject({ checkpointId:
|
|
13547
|
+
checkpoint: external_exports.strictObject({ checkpointId: id2, checksum: external_exports.string().regex(/^[a-f0-9]{64}$/) }).optional()
|
|
13391
13548
|
}).optional(),
|
|
13392
|
-
checkpoint: external_exports.strictObject({ checkpointId:
|
|
13549
|
+
checkpoint: external_exports.strictObject({ checkpointId: id2, checksum: external_exports.string().regex(/^[a-f0-9]{64}$/) }).optional(),
|
|
13393
13550
|
/** This attempt's delegation token: only for a Run started with `delegation`, only to a `run_delegation_v1` Runner. */
|
|
13394
13551
|
delegationToken: external_exports.string().min(32).max(256).optional(),
|
|
13395
13552
|
/** Copied from the start intent of a delegated child. */
|
|
@@ -13398,8 +13555,8 @@ var grantSchema = external_exports.strictObject({
|
|
|
13398
13555
|
reportUsage: external_exports.literal(true).optional()
|
|
13399
13556
|
});
|
|
13400
13557
|
var historyRecordSchema = external_exports.strictObject({
|
|
13401
|
-
eventId:
|
|
13402
|
-
attemptId:
|
|
13558
|
+
eventId: id2,
|
|
13559
|
+
attemptId: id2,
|
|
13403
13560
|
emittedAt: timestamp,
|
|
13404
13561
|
kind: external_exports.string().min(1).max(128),
|
|
13405
13562
|
data: external_exports.json()
|
|
@@ -13409,8 +13566,8 @@ var runnerFrameSchema = external_exports.discriminatedUnion("type", [
|
|
|
13409
13566
|
type: external_exports.literal("hello"),
|
|
13410
13567
|
role: external_exports.literal("runner"),
|
|
13411
13568
|
protocol: external_exports.strictObject({ major: external_exports.literal(2), minor: sequence }),
|
|
13412
|
-
runnerId:
|
|
13413
|
-
installationId:
|
|
13569
|
+
runnerId: id2,
|
|
13570
|
+
installationId: id2,
|
|
13414
13571
|
softwareVersion: external_exports.string().max(128),
|
|
13415
13572
|
capabilities: external_exports.array(external_exports.string().max(128)).max(64),
|
|
13416
13573
|
/** Absent from older runners: the Hub treats the inventory as unknown, never as empty. */
|
|
@@ -13426,20 +13583,20 @@ var runnerFrameSchema = external_exports.discriminatedUnion("type", [
|
|
|
13426
13583
|
}),
|
|
13427
13584
|
external_exports.strictObject({
|
|
13428
13585
|
type: external_exports.literal("history.batch"),
|
|
13429
|
-
runId:
|
|
13586
|
+
runId: id2,
|
|
13430
13587
|
firstSeq: positive,
|
|
13431
13588
|
records: external_exports.array(historyRecordSchema).min(1).max(128)
|
|
13432
13589
|
}),
|
|
13433
|
-
external_exports.strictObject({ type: external_exports.literal("ping"), nonce:
|
|
13590
|
+
external_exports.strictObject({ type: external_exports.literal("ping"), nonce: id2 }),
|
|
13434
13591
|
external_exports.strictObject({
|
|
13435
13592
|
type: external_exports.literal("reconcile.page"),
|
|
13436
|
-
inventoryId:
|
|
13593
|
+
inventoryId: id2.default("single-page"),
|
|
13437
13594
|
page: sequence.default(0),
|
|
13438
13595
|
complete: external_exports.boolean(),
|
|
13439
13596
|
runs: external_exports.array(
|
|
13440
13597
|
external_exports.strictObject({
|
|
13441
|
-
runId:
|
|
13442
|
-
attemptId:
|
|
13598
|
+
runId: id2,
|
|
13599
|
+
attemptId: id2,
|
|
13443
13600
|
executionRevision: sequence,
|
|
13444
13601
|
phase: external_exports.enum(["admitted", "prepared", "executing", "parked", "terminal", "recovery"])
|
|
13445
13602
|
})
|
|
@@ -13447,10 +13604,10 @@ var runnerFrameSchema = external_exports.discriminatedUnion("type", [
|
|
|
13447
13604
|
})
|
|
13448
13605
|
]);
|
|
13449
13606
|
var runViewSchema = external_exports.object({
|
|
13450
|
-
runId:
|
|
13451
|
-
sessionId:
|
|
13452
|
-
runnerId:
|
|
13453
|
-
computeProfileId:
|
|
13607
|
+
runId: id2,
|
|
13608
|
+
sessionId: id2,
|
|
13609
|
+
runnerId: id2,
|
|
13610
|
+
computeProfileId: id2.optional(),
|
|
13454
13611
|
scope: scopeSchema,
|
|
13455
13612
|
recordRevision: positive,
|
|
13456
13613
|
label: external_exports.string().max(160).optional(),
|
|
@@ -13472,7 +13629,7 @@ var runViewSchema = external_exports.object({
|
|
|
13472
13629
|
execution: external_exports.object({
|
|
13473
13630
|
status: external_exports.enum(["running", "awaiting_attention", "completed", "failed", "cancelled"]),
|
|
13474
13631
|
revision: positive,
|
|
13475
|
-
attemptId:
|
|
13632
|
+
attemptId: id2,
|
|
13476
13633
|
occupancy: external_exports.enum(["held", "released"]),
|
|
13477
13634
|
startedAt: timestamp.optional(),
|
|
13478
13635
|
endedAt: timestamp.optional(),
|
|
@@ -13481,7 +13638,7 @@ var runViewSchema = external_exports.object({
|
|
|
13481
13638
|
scheduling: external_exports.enum(["queued", "dispatching", "admitted", "idle"]),
|
|
13482
13639
|
closed: external_exports.boolean(),
|
|
13483
13640
|
closeReason: external_exports.string().optional(),
|
|
13484
|
-
cancellation:
|
|
13641
|
+
cancellation: id2.optional(),
|
|
13485
13642
|
pendingResume: commandSchema.shape.intent.optional(),
|
|
13486
13643
|
/** Derived per viewer; absent on older Hubs. Never grants execution authority. */
|
|
13487
13644
|
runnerStopped: external_exports.boolean().optional(),
|
|
@@ -13489,13 +13646,13 @@ var runViewSchema = external_exports.object({
|
|
|
13489
13646
|
historyThrough: sequence,
|
|
13490
13647
|
expectedHistoryThrough: sequence.optional(),
|
|
13491
13648
|
createdAt: sequence,
|
|
13492
|
-
checkpoint: external_exports.object({ id, state: external_exports.enum(["pending", "ready"]), checksum: external_exports.string().optional() }).optional()
|
|
13649
|
+
checkpoint: external_exports.object({ id: id2, state: external_exports.enum(["pending", "ready"]), checksum: external_exports.string().optional() }).optional()
|
|
13493
13650
|
});
|
|
13494
13651
|
var clientFrameSchema = external_exports.discriminatedUnion("type", [
|
|
13495
|
-
external_exports.strictObject({ type: external_exports.literal("watch"), hubEpoch:
|
|
13496
|
-
external_exports.strictObject({ type: external_exports.literal("watch.ack"), subscriptionId:
|
|
13652
|
+
external_exports.strictObject({ type: external_exports.literal("watch"), hubEpoch: id2, runIds: external_exports.array(id2).max(100) }),
|
|
13653
|
+
external_exports.strictObject({ type: external_exports.literal("watch.ack"), subscriptionId: id2, through: sequence }),
|
|
13497
13654
|
external_exports.strictObject({ type: external_exports.literal("command.submit"), command: commandSchema }),
|
|
13498
|
-
external_exports.strictObject({ type: external_exports.literal("ping"), nonce:
|
|
13655
|
+
external_exports.strictObject({ type: external_exports.literal("ping"), nonce: id2 })
|
|
13499
13656
|
]);
|
|
13500
13657
|
function canonicalJson(value) {
|
|
13501
13658
|
if (value === null || typeof value !== "object") {
|
|
@@ -13542,30 +13699,30 @@ var connectCodeResponseSchema = external_exports.strictObject({
|
|
|
13542
13699
|
});
|
|
13543
13700
|
var connectRedeemRequestSchema = external_exports.strictObject({
|
|
13544
13701
|
code: external_exports.string().min(8).max(16),
|
|
13545
|
-
installationId:
|
|
13702
|
+
installationId: id2,
|
|
13546
13703
|
hostname: external_exports.string().min(1).max(255),
|
|
13547
13704
|
os: external_exports.string().min(1).max(64),
|
|
13548
13705
|
softwareVersion: external_exports.string().min(1).max(128)
|
|
13549
13706
|
});
|
|
13550
13707
|
var connectRedeemResponseSchema = external_exports.strictObject({
|
|
13551
|
-
orgId:
|
|
13708
|
+
orgId: id2,
|
|
13552
13709
|
hubEpoch: external_exports.string(),
|
|
13553
|
-
runnerId:
|
|
13554
|
-
installationId:
|
|
13710
|
+
runnerId: id2,
|
|
13711
|
+
installationId: id2,
|
|
13555
13712
|
name: external_exports.string(),
|
|
13556
13713
|
token: external_exports.string().min(32),
|
|
13557
|
-
credentialId:
|
|
13714
|
+
credentialId: id2,
|
|
13558
13715
|
expiresAt: sequence
|
|
13559
13716
|
});
|
|
13560
13717
|
var connectAlreadyConnectedSchema = external_exports.strictObject({
|
|
13561
13718
|
error: external_exports.literal("runner_already_connected"),
|
|
13562
|
-
orgId:
|
|
13563
|
-
runnerId:
|
|
13719
|
+
orgId: id2,
|
|
13720
|
+
runnerId: id2,
|
|
13564
13721
|
name: external_exports.string()
|
|
13565
13722
|
});
|
|
13566
13723
|
var audienceSchema = external_exports.enum(["personal", "team"]);
|
|
13567
13724
|
var runnerListEntrySchema = external_exports.object({
|
|
13568
|
-
id,
|
|
13725
|
+
id: id2,
|
|
13569
13726
|
online: external_exports.number(),
|
|
13570
13727
|
capacity: external_exports.number(),
|
|
13571
13728
|
managed: external_exports.number(),
|
|
@@ -13599,8 +13756,8 @@ var runnerListEntrySchema = external_exports.object({
|
|
|
13599
13756
|
needsOwner: external_exports.boolean().optional()
|
|
13600
13757
|
});
|
|
13601
13758
|
var teamDefaultSchema = external_exports.discriminatedUnion("kind", [
|
|
13602
|
-
external_exports.strictObject({ kind: external_exports.literal("runner"), runnerId:
|
|
13603
|
-
external_exports.strictObject({ kind: external_exports.literal("profile"), profileId:
|
|
13759
|
+
external_exports.strictObject({ kind: external_exports.literal("runner"), runnerId: id2 }),
|
|
13760
|
+
external_exports.strictObject({ kind: external_exports.literal("profile"), profileId: id2 })
|
|
13604
13761
|
]);
|
|
13605
13762
|
var teamDefaultRequestSchema = external_exports.strictObject({
|
|
13606
13763
|
hubEpoch: external_exports.string(),
|
|
@@ -13617,9 +13774,9 @@ var runnerUpdateRequestSchema = external_exports.strictObject({
|
|
|
13617
13774
|
);
|
|
13618
13775
|
var runsGoToSchema = external_exports.union([
|
|
13619
13776
|
/** The viewer's own Runner: Personal, or one they connected that was widened to Team (DRI-42). */
|
|
13620
|
-
external_exports.strictObject({ via: external_exports.literal("personal"), runnerId:
|
|
13621
|
-
external_exports.strictObject({ via: external_exports.literal("team_default"), runnerId:
|
|
13622
|
-
external_exports.strictObject({ via: external_exports.literal("team_default"), profileId:
|
|
13777
|
+
external_exports.strictObject({ via: external_exports.literal("personal"), runnerId: id2 }),
|
|
13778
|
+
external_exports.strictObject({ via: external_exports.literal("team_default"), runnerId: id2 }),
|
|
13779
|
+
external_exports.strictObject({ via: external_exports.literal("team_default"), profileId: id2 }),
|
|
13623
13780
|
/** `runner_needs_owner`: the Team default is a Runner paused because the member who connected it left. */
|
|
13624
13781
|
external_exports.strictObject({ via: external_exports.literal("none"), reason: external_exports.enum(["no_runner_available", "runner_needs_owner"]) })
|
|
13625
13782
|
]);
|
|
@@ -13646,10 +13803,10 @@ var runnerListSchema = external_exports.object({
|
|
|
13646
13803
|
var runnerDisconnectRequestSchema = external_exports.strictObject({ hubEpoch: external_exports.string() });
|
|
13647
13804
|
var hubEpochRequestSchema = runnerDisconnectRequestSchema;
|
|
13648
13805
|
var runnerDisconnectPreviewSchema = external_exports.object({
|
|
13649
|
-
runnerId:
|
|
13806
|
+
runnerId: id2,
|
|
13650
13807
|
name: external_exports.string().nullable(),
|
|
13651
13808
|
runs: external_exports.array(external_exports.object({
|
|
13652
|
-
runId:
|
|
13809
|
+
runId: id2,
|
|
13653
13810
|
label: external_exports.string().optional(),
|
|
13654
13811
|
/** Working: executing now. Parked: waiting for a person, Runner released. Queued: not started yet. */
|
|
13655
13812
|
state: external_exports.enum(["working", "parked", "queued"])
|
|
@@ -13761,8 +13918,8 @@ var ExecutionStore = class {
|
|
|
13761
13918
|
runs() {
|
|
13762
13919
|
return this.sql.query("SELECT payload FROM local_runs").map((r) => JSON.parse(r.payload));
|
|
13763
13920
|
}
|
|
13764
|
-
run(
|
|
13765
|
-
const row = this.sql.query("SELECT payload FROM local_runs WHERE id=?",
|
|
13921
|
+
run(id3) {
|
|
13922
|
+
const row = this.sql.query("SELECT payload FROM local_runs WHERE id=?", id3)[0];
|
|
13766
13923
|
if (!row) throw new Error("not_found");
|
|
13767
13924
|
return JSON.parse(row.payload);
|
|
13768
13925
|
}
|
|
@@ -14011,13 +14168,13 @@ var ExecutionStore = class {
|
|
|
14011
14168
|
this.queueCheckpoint(runId, record.continuation.checkpointId);
|
|
14012
14169
|
});
|
|
14013
14170
|
}
|
|
14014
|
-
queueCheckpoint(runId,
|
|
14171
|
+
queueCheckpoint(runId, id3) {
|
|
14015
14172
|
const run = this.run(runId);
|
|
14016
14173
|
if (run.phase !== "parked" && run.phase !== "terminal")
|
|
14017
14174
|
throw new Error("checkpoint_requires_quiescence");
|
|
14018
14175
|
this.sql.query(
|
|
14019
14176
|
"INSERT OR IGNORE INTO checkpoint_jobs (id,run,revision) VALUES (?,?,?)",
|
|
14020
|
-
|
|
14177
|
+
id3,
|
|
14021
14178
|
runId,
|
|
14022
14179
|
run.executionRevision
|
|
14023
14180
|
);
|
|
@@ -14028,23 +14185,23 @@ var ExecutionStore = class {
|
|
|
14028
14185
|
Date.now()
|
|
14029
14186
|
)[0];
|
|
14030
14187
|
}
|
|
14031
|
-
checkpointPrepared(
|
|
14188
|
+
checkpointPrepared(id3, bytes, checksum) {
|
|
14032
14189
|
this.sql.query(
|
|
14033
14190
|
"UPDATE checkpoint_jobs SET bytes=?,checksum=? WHERE id=? AND done=0",
|
|
14034
14191
|
bytes,
|
|
14035
14192
|
checksum,
|
|
14036
|
-
|
|
14193
|
+
id3
|
|
14037
14194
|
);
|
|
14038
14195
|
}
|
|
14039
|
-
checkpointUploaded(
|
|
14040
|
-
this.sql.query("UPDATE checkpoint_jobs SET done=1,bytes=NULL WHERE id=?",
|
|
14196
|
+
checkpointUploaded(id3) {
|
|
14197
|
+
this.sql.query("UPDATE checkpoint_jobs SET done=1,bytes=NULL WHERE id=?", id3);
|
|
14041
14198
|
}
|
|
14042
|
-
checkpointRetry(
|
|
14199
|
+
checkpointRetry(id3, attempts) {
|
|
14043
14200
|
this.sql.query(
|
|
14044
14201
|
"UPDATE checkpoint_jobs SET attempts=?,due=? WHERE id=?",
|
|
14045
14202
|
attempts,
|
|
14046
14203
|
Date.now() + Math.min(3e5, 1e3 * 2 ** Math.min(attempts, 8)),
|
|
14047
|
-
|
|
14204
|
+
id3
|
|
14048
14205
|
);
|
|
14049
14206
|
}
|
|
14050
14207
|
appendControl(record) {
|
|
@@ -14206,12 +14363,12 @@ var ExecutionStore = class {
|
|
|
14206
14363
|
this.save(run);
|
|
14207
14364
|
});
|
|
14208
14365
|
}
|
|
14209
|
-
putSession(session, kind,
|
|
14366
|
+
putSession(session, kind, id3, value) {
|
|
14210
14367
|
this.sql.query(
|
|
14211
14368
|
"INSERT INTO session_data VALUES (?,?,?,?) ON CONFLICT(session,kind,id) DO UPDATE SET payload=excluded.payload",
|
|
14212
14369
|
session,
|
|
14213
14370
|
kind,
|
|
14214
|
-
|
|
14371
|
+
id3,
|
|
14215
14372
|
canonicalJson(value)
|
|
14216
14373
|
);
|
|
14217
14374
|
}
|
|
@@ -14574,8 +14731,8 @@ var ExecutionHost = class {
|
|
|
14574
14731
|
kind: "repository.preparation_failed",
|
|
14575
14732
|
data: { code: error instanceof WorkspacePreparationError ? error.message : "workspace_preparation_failed" }
|
|
14576
14733
|
});
|
|
14577
|
-
this.store.fact(runId, (
|
|
14578
|
-
...
|
|
14734
|
+
this.store.fact(runId, (id3) => ({
|
|
14735
|
+
...id3,
|
|
14579
14736
|
kind: "run.finished",
|
|
14580
14737
|
status,
|
|
14581
14738
|
historyThrough: this.store.run(runId).historyProduced,
|
|
@@ -14662,8 +14819,8 @@ var ExecutionHost = class {
|
|
|
14662
14819
|
this.store.commandResult(pending2, false, "superseded_by_cancel");
|
|
14663
14820
|
if (run.phase === "parked" || run.phase === "admitted") {
|
|
14664
14821
|
this.store.transaction(() => {
|
|
14665
|
-
this.store.fact(command.runId, (
|
|
14666
|
-
...
|
|
14822
|
+
this.store.fact(command.runId, (id3) => ({
|
|
14823
|
+
...id3,
|
|
14667
14824
|
kind: "run.finished",
|
|
14668
14825
|
status: "cancelled",
|
|
14669
14826
|
historyThrough: run.historyProduced
|
|
@@ -14959,7 +15116,7 @@ async function restoreCheckpoint(store, input) {
|
|
|
14959
15116
|
|
|
14960
15117
|
// ../../modules/runtime/src/software-version.ts
|
|
14961
15118
|
import "fs";
|
|
14962
|
-
var runnerSoftwareVersion = true ? "0.7.
|
|
15119
|
+
var runnerSoftwareVersion = true ? "0.7.13" : JSON.parse(readFileSync2(new URL("../../../apps/cli/package.json", import.meta.url), "utf8")).version;
|
|
14963
15120
|
|
|
14964
15121
|
// ../../modules/runtime/src/connection.ts
|
|
14965
15122
|
var runnerCapabilities = [
|
|
@@ -15702,8 +15859,8 @@ var ActorRegistry = class {
|
|
|
15702
15859
|
display_name: "System"
|
|
15703
15860
|
});
|
|
15704
15861
|
}
|
|
15705
|
-
get(
|
|
15706
|
-
return this.actors.get(
|
|
15862
|
+
get(id3) {
|
|
15863
|
+
return this.actors.get(id3);
|
|
15707
15864
|
}
|
|
15708
15865
|
register(actor) {
|
|
15709
15866
|
this.actors.set(actor.actor_id, actor);
|
|
@@ -18839,8 +18996,8 @@ var PREFERRED_INPUT_KEYS = [
|
|
|
18839
18996
|
"prompt",
|
|
18840
18997
|
"description"
|
|
18841
18998
|
];
|
|
18842
|
-
function truncate3(
|
|
18843
|
-
const oneLine =
|
|
18999
|
+
function truncate3(text2) {
|
|
19000
|
+
const oneLine = text2.replace(/\s+/g, " ").trim();
|
|
18844
19001
|
return oneLine.length > SUMMARY_MAX_CHARS ? `${oneLine.slice(0, SUMMARY_MAX_CHARS - 1)}\u2026` : oneLine;
|
|
18845
19002
|
}
|
|
18846
19003
|
function summarizeToolInput2(event) {
|
|
@@ -20035,8 +20192,8 @@ function interruptionFromSuspension(stopReason) {
|
|
|
20035
20192
|
}
|
|
20036
20193
|
const question = AGENT_QUESTION.exec(message);
|
|
20037
20194
|
if (question) {
|
|
20038
|
-
const
|
|
20039
|
-
return { kind: "question", message, ...
|
|
20195
|
+
const text2 = group(question, 1)?.trim();
|
|
20196
|
+
return { kind: "question", message, ...text2 ? { question: text2 } : {} };
|
|
20040
20197
|
}
|
|
20041
20198
|
if (/^agent requested sandbox approval\b/.test(message)) {
|
|
20042
20199
|
return { kind: "question", message };
|
|
@@ -20167,9 +20324,9 @@ function sessionStore(store, runId, options = {}) {
|
|
|
20167
20324
|
updateLabel(label) {
|
|
20168
20325
|
store.putSession(sessionId, "session", sessionId, { ...session(), label });
|
|
20169
20326
|
},
|
|
20170
|
-
recordTokens(
|
|
20171
|
-
const adapter = adapters().find((a) => a.sessionId ===
|
|
20172
|
-
if (adapter) store.putSession(sessionId, "adapter",
|
|
20327
|
+
recordTokens(id3, tokens) {
|
|
20328
|
+
const adapter = adapters().find((a) => a.sessionId === id3);
|
|
20329
|
+
if (adapter) store.putSession(sessionId, "adapter", id3, { ...adapter, tokens });
|
|
20173
20330
|
},
|
|
20174
20331
|
getRestoredTokens() {
|
|
20175
20332
|
const all = adapters().flatMap((a) => a.tokens ? [a.tokens] : []);
|
|
@@ -20259,23 +20416,23 @@ var fillSchema = external_exports.strictObject({
|
|
|
20259
20416
|
}),
|
|
20260
20417
|
qa: external_exports.enum(["none", "web", "macos", "both"]),
|
|
20261
20418
|
profile: external_exports.enum(["implementation", "documentation", "investigation"]).optional(),
|
|
20262
|
-
rationale: external_exports.string().min(1).max(2e3).refine((
|
|
20419
|
+
rationale: external_exports.string().min(1).max(2e3).refine((text2) => !TEMPLATE_STRUCTURE.test(text2), {
|
|
20263
20420
|
error: INSTRUCTIONS_MESSAGE
|
|
20264
20421
|
}).optional(),
|
|
20265
20422
|
acceptanceEvidence: external_exports.array(
|
|
20266
|
-
external_exports.string().min(1).max(2e3).refine((
|
|
20423
|
+
external_exports.string().min(1).max(2e3).refine((text2) => !TEMPLATE_STRUCTURE.test(text2), {
|
|
20267
20424
|
error: INSTRUCTIONS_MESSAGE
|
|
20268
20425
|
})
|
|
20269
20426
|
).min(1).optional(),
|
|
20270
20427
|
testFirst: external_exports.strictObject({
|
|
20271
20428
|
enabled: external_exports.boolean(),
|
|
20272
|
-
reason: external_exports.string().min(1).max(1e3).refine((
|
|
20429
|
+
reason: external_exports.string().min(1).max(1e3).refine((text2) => !TEMPLATE_STRUCTURE.test(text2), {
|
|
20273
20430
|
error: INSTRUCTIONS_MESSAGE
|
|
20274
20431
|
})
|
|
20275
20432
|
}).optional(),
|
|
20276
20433
|
review: external_exports.strictObject({
|
|
20277
20434
|
enabled: external_exports.boolean(),
|
|
20278
|
-
reason: external_exports.string().min(1).max(1e3).refine((
|
|
20435
|
+
reason: external_exports.string().min(1).max(1e3).refine((text2) => !TEMPLATE_STRUCTURE.test(text2), {
|
|
20279
20436
|
error: INSTRUCTIONS_MESSAGE
|
|
20280
20437
|
})
|
|
20281
20438
|
}).optional(),
|
|
@@ -20290,7 +20447,7 @@ var fillSchema = external_exports.strictObject({
|
|
|
20290
20447
|
* step a Sign-off the member answers in the child's Thread. Filled from the member's words before Start.
|
|
20291
20448
|
*/
|
|
20292
20449
|
merge: external_exports.enum(["agent", "you"]).optional(),
|
|
20293
|
-
instructions: external_exports.string().min(1).max(6e3).refine((
|
|
20450
|
+
instructions: external_exports.string().min(1).max(6e3).refine((text2) => !TEMPLATE_STRUCTURE.test(text2), {
|
|
20294
20451
|
error: INSTRUCTIONS_MESSAGE
|
|
20295
20452
|
}),
|
|
20296
20453
|
/**
|
|
@@ -20638,32 +20795,32 @@ function cycleMembers(ids, blockers) {
|
|
|
20638
20795
|
const stack = [];
|
|
20639
20796
|
const onStack = /* @__PURE__ */ new Set();
|
|
20640
20797
|
const members = /* @__PURE__ */ new Set();
|
|
20641
|
-
const visit = (
|
|
20642
|
-
index.set(
|
|
20643
|
-
low.set(
|
|
20798
|
+
const visit = (id3) => {
|
|
20799
|
+
index.set(id3, counter);
|
|
20800
|
+
low.set(id3, counter);
|
|
20644
20801
|
counter++;
|
|
20645
|
-
stack.push(
|
|
20646
|
-
onStack.add(
|
|
20647
|
-
for (const next of blockers.get(
|
|
20802
|
+
stack.push(id3);
|
|
20803
|
+
onStack.add(id3);
|
|
20804
|
+
for (const next of blockers.get(id3) ?? []) {
|
|
20648
20805
|
if (!index.has(next)) {
|
|
20649
20806
|
visit(next);
|
|
20650
|
-
low.set(
|
|
20807
|
+
low.set(id3, Math.min(low.get(id3), low.get(next)));
|
|
20651
20808
|
} else if (onStack.has(next)) {
|
|
20652
|
-
low.set(
|
|
20809
|
+
low.set(id3, Math.min(low.get(id3), index.get(next)));
|
|
20653
20810
|
}
|
|
20654
20811
|
}
|
|
20655
|
-
if (low.get(
|
|
20812
|
+
if (low.get(id3) !== index.get(id3)) return;
|
|
20656
20813
|
const component = [];
|
|
20657
20814
|
let member;
|
|
20658
20815
|
do {
|
|
20659
20816
|
member = stack.pop();
|
|
20660
20817
|
onStack.delete(member);
|
|
20661
20818
|
component.push(member);
|
|
20662
|
-
} while (member !==
|
|
20663
|
-
if (component.length > 1 || (blockers.get(
|
|
20819
|
+
} while (member !== id3);
|
|
20820
|
+
if (component.length > 1 || (blockers.get(id3) ?? []).includes(id3))
|
|
20664
20821
|
for (const each of component) members.add(each);
|
|
20665
20822
|
};
|
|
20666
|
-
for (const
|
|
20823
|
+
for (const id3 of ids) if (!index.has(id3)) visit(id3);
|
|
20667
20824
|
return members;
|
|
20668
20825
|
}
|
|
20669
20826
|
function shownFromFill(fill) {
|
|
@@ -20696,7 +20853,7 @@ function blockingGraph(entries) {
|
|
|
20696
20853
|
issue.id,
|
|
20697
20854
|
[
|
|
20698
20855
|
.../* @__PURE__ */ new Set([
|
|
20699
|
-
...issue.blockedBy.filter((
|
|
20856
|
+
...issue.blockedBy.filter((id3) => entryIds.has(id3)),
|
|
20700
20857
|
...children.get(issue.id) ?? []
|
|
20701
20858
|
])
|
|
20702
20859
|
]
|
|
@@ -20769,13 +20926,13 @@ function planBuild(context) {
|
|
|
20769
20926
|
title: issue.title,
|
|
20770
20927
|
reason: "parent-only"
|
|
20771
20928
|
});
|
|
20772
|
-
const subIssuesOf = (
|
|
20929
|
+
const subIssuesOf = (id3) => input.issues.filter((issue) => issue.parentId === id3).flatMap(
|
|
20773
20930
|
(issue) => parentOnly.has(issue.id) ? subIssuesOf(issue.id) : [issue.id]
|
|
20774
20931
|
);
|
|
20775
20932
|
entries = entries.filter((issue) => !parentOnly.has(issue.id)).map((issue) => ({
|
|
20776
20933
|
...issue,
|
|
20777
20934
|
blockedBy: issue.blockedBy.flatMap(
|
|
20778
|
-
(
|
|
20935
|
+
(id3) => parentOnly.has(id3) ? subIssuesOf(id3) : [id3]
|
|
20779
20936
|
)
|
|
20780
20937
|
}));
|
|
20781
20938
|
({ children, blockers } = blockingGraph(entries));
|
|
@@ -20790,9 +20947,9 @@ function planBuild(context) {
|
|
|
20790
20947
|
const waitsFor = (issue) => [
|
|
20791
20948
|
.../* @__PURE__ */ new Set([
|
|
20792
20949
|
...issue.blockedBy.filter(
|
|
20793
|
-
(
|
|
20794
|
-
(each) => each.id ===
|
|
20795
|
-
(skip) => skip.id ===
|
|
20950
|
+
(id3) => !input.issues.some(
|
|
20951
|
+
(each) => each.id === id3 && (each.state.type === "completed" || skipped.some(
|
|
20952
|
+
(skip) => skip.id === id3 && skip.reason === "merged"
|
|
20796
20953
|
))
|
|
20797
20954
|
)
|
|
20798
20955
|
),
|
|
@@ -20801,11 +20958,11 @@ function planBuild(context) {
|
|
|
20801
20958
|
])
|
|
20802
20959
|
];
|
|
20803
20960
|
const layer = /* @__PURE__ */ new Map();
|
|
20804
|
-
const layerOf = (
|
|
20805
|
-
const known = layer.get(
|
|
20961
|
+
const layerOf = (id3) => {
|
|
20962
|
+
const known = layer.get(id3);
|
|
20806
20963
|
if (known !== void 0) return known;
|
|
20807
|
-
const value = Math.max(0, ...blockers.get(
|
|
20808
|
-
layer.set(
|
|
20964
|
+
const value = Math.max(0, ...blockers.get(id3).map((b) => layerOf(b) + 1));
|
|
20965
|
+
layer.set(id3, value);
|
|
20809
20966
|
return value;
|
|
20810
20967
|
};
|
|
20811
20968
|
const workflows = [];
|
|
@@ -21000,9 +21157,9 @@ function read(file) {
|
|
|
21000
21157
|
return void 0;
|
|
21001
21158
|
}
|
|
21002
21159
|
}
|
|
21003
|
-
function parseJson(
|
|
21160
|
+
function parseJson(text2) {
|
|
21004
21161
|
try {
|
|
21005
|
-
return JSON.parse(
|
|
21162
|
+
return JSON.parse(text2);
|
|
21006
21163
|
} catch {
|
|
21007
21164
|
return void 0;
|
|
21008
21165
|
}
|
|
@@ -21835,7 +21992,7 @@ ${prompt2}`;
|
|
|
21835
21992
|
},
|
|
21836
21993
|
onTurnComplete: () => sweepArtifacts(false, true),
|
|
21837
21994
|
stdout: { write: () => true },
|
|
21838
|
-
stderr: { write: (
|
|
21995
|
+
stderr: { write: (text2) => process.stderr.write(text2) },
|
|
21839
21996
|
json: false
|
|
21840
21997
|
})).finally(() => {
|
|
21841
21998
|
queues.delete(grant.runId);
|
|
@@ -22096,7 +22253,7 @@ var legacyIdentityPath = (directory) => join11(directory, "runner-v2.json");
|
|
|
22096
22253
|
var overriddenIdentityPath = () => process.env.DRISP_RUNNER_CONFIG;
|
|
22097
22254
|
async function machineInstallationId(directory = runnerConfigDirectory()) {
|
|
22098
22255
|
const path23 = join11(directory, "installation-id");
|
|
22099
|
-
const existing = await readFile5(path23, "utf8").then((
|
|
22256
|
+
const existing = await readFile5(path23, "utf8").then((text2) => text2.trim(), () => "");
|
|
22100
22257
|
if (existing) return existing;
|
|
22101
22258
|
let installationId = crypto.randomUUID();
|
|
22102
22259
|
try {
|
|
@@ -22245,6 +22402,10 @@ export {
|
|
|
22245
22402
|
attemptForecast,
|
|
22246
22403
|
budgetCheck,
|
|
22247
22404
|
calibrationSchema,
|
|
22405
|
+
trackerIssueSchema,
|
|
22406
|
+
trackerSnapshotSchema,
|
|
22407
|
+
trackerOperationSchema,
|
|
22408
|
+
trackerImportPreviewSchema,
|
|
22248
22409
|
repositoryBindingSchema,
|
|
22249
22410
|
commandSchema,
|
|
22250
22411
|
historyRecordSchema,
|
|
@@ -22303,4 +22464,4 @@ export {
|
|
|
22303
22464
|
runMachineRunners,
|
|
22304
22465
|
writeIdentityOnce
|
|
22305
22466
|
};
|
|
22306
|
-
//# sourceMappingURL=chunk-
|
|
22467
|
+
//# sourceMappingURL=chunk-5TM2ARN3.js.map
|