@staff0rd/assist 0.1209.8 → 0.1209.9
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/.build-files +15 -15
- package/dist/built-version +1 -1
- package/dist/chunk-5PHEZZZO.js +186 -0
- package/dist/{chunk-QK6LOFXI.js → chunk-KU2IELJH.js} +93 -13
- package/dist/{chunk-NBA3Z4TA.js → chunk-KU2IRR7U.js} +1 -1
- package/dist/{chunk-ITQOKBXS.js → chunk-OSNDBX3R.js} +1 -1
- package/dist/{chunk-5FZEIJNQ.js → chunk-PTOLRRVQ.js} +1 -1
- package/dist/{chunk-3B3TZFFZ.js → chunk-SFB4YFAJ.js} +1 -1
- package/dist/{chunk-5XORAPRE.js → chunk-WGQXKODT.js} +1 -1
- package/dist/commands/sessions/web/bundle.js +440 -440
- package/dist/{doctorNodes-KRVVGZ3H.js → doctorNodes-ILYR6LIB.js} +3 -3
- package/dist/index.js +12 -12
- package/dist/{restartNode-KLNVUHES.js → restartNode-UQER2YEA.js} +5 -5
- package/dist/{review-63J2YROM.js → review-6QWY2FON.js} +82 -122
- package/dist/{runDaemon-5QC62HXQ.js → runDaemon-HJT23FAG.js} +2 -2
- package/dist/{signExtension-OD33BOCP.js → signExtension-R6ALW56Z.js} +1 -1
- package/dist/{updateNode-XBXWVBTG.js → updateNode-WDASOL4N.js} +5 -5
- package/dist/{web-EYVVF2JJ.js → web-CADUUMQL.js} +6 -6
- package/dist/{web-FQDB4QQA.js → web-VPM5E2E6.js} +6 -6
- package/package.json +1 -1
- package/dist/chunk-ZABRGL2F.js +0 -45
package/dist/.build-files
CHANGED
|
@@ -43,7 +43,6 @@ chunk-2MYEKLIW.js
|
|
|
43
43
|
chunk-2R3CA6BW.js
|
|
44
44
|
chunk-2T5HRFWP.js
|
|
45
45
|
chunk-36F3K7HM.js
|
|
46
|
-
chunk-3B3TZFFZ.js
|
|
47
46
|
chunk-3COAWQ2J.js
|
|
48
47
|
chunk-3DNFNT2L.js
|
|
49
48
|
chunk-3EPOPLVB.js
|
|
@@ -81,15 +80,14 @@ chunk-4YHDWC5E.js
|
|
|
81
80
|
chunk-556BOFTS.js
|
|
82
81
|
chunk-5A6C7CM3.js
|
|
83
82
|
chunk-5B6YWHDU.js
|
|
84
|
-
chunk-5FZEIJNQ.js
|
|
85
83
|
chunk-5GE4SCZV.js
|
|
86
84
|
chunk-5H7EHZ3J.js
|
|
87
85
|
chunk-5JOVEUBS.js
|
|
88
86
|
chunk-5OZ7Q62P.js
|
|
87
|
+
chunk-5PHEZZZO.js
|
|
89
88
|
chunk-5Q7MUHCK.js
|
|
90
89
|
chunk-5RWSZYF7.js
|
|
91
90
|
chunk-5SDSC2UT.js
|
|
92
|
-
chunk-5XORAPRE.js
|
|
93
91
|
chunk-63BWAQH5.js
|
|
94
92
|
chunk-67DONCGH.js
|
|
95
93
|
chunk-6DGPQ67E.js
|
|
@@ -201,7 +199,6 @@ chunk-IDGZZD5V.js
|
|
|
201
199
|
chunk-IOKBCYSG.js
|
|
202
200
|
chunk-IOYGR6YV.js
|
|
203
201
|
chunk-IRYX737Z.js
|
|
204
|
-
chunk-ITQOKBXS.js
|
|
205
202
|
chunk-IUCU34F3.js
|
|
206
203
|
chunk-IVBWOIGE.js
|
|
207
204
|
chunk-IXBA6TVF.js
|
|
@@ -223,6 +220,8 @@ chunk-K45LIKCT.js
|
|
|
223
220
|
chunk-K6FSJTVW.js
|
|
224
221
|
chunk-KD2PWI4Z.js
|
|
225
222
|
chunk-KP5S3FE5.js
|
|
223
|
+
chunk-KU2IELJH.js
|
|
224
|
+
chunk-KU2IRR7U.js
|
|
226
225
|
chunk-KY77XKAU.js
|
|
227
226
|
chunk-KZKDTL6N.js
|
|
228
227
|
chunk-L363MNYZ.js
|
|
@@ -245,7 +244,6 @@ chunk-MYH4MQX2.js
|
|
|
245
244
|
chunk-N65VOEFI.js
|
|
246
245
|
chunk-N755UYFK.js
|
|
247
246
|
chunk-N7VXTGWR.js
|
|
248
|
-
chunk-NBA3Z4TA.js
|
|
249
247
|
chunk-NBADZOXB.js
|
|
250
248
|
chunk-NEC6OVBH.js
|
|
251
249
|
chunk-NGTSPXSJ.js
|
|
@@ -264,6 +262,7 @@ chunk-ODLSWRTS.js
|
|
|
264
262
|
chunk-OLE7XSNB.js
|
|
265
263
|
chunk-OPWKQZ2B.js
|
|
266
264
|
chunk-OQ6AYXHB.js
|
|
265
|
+
chunk-OSNDBX3R.js
|
|
267
266
|
chunk-OTAPY3HJ.js
|
|
268
267
|
chunk-OU6Q5ZS3.js
|
|
269
268
|
chunk-OWFKW7AV.js
|
|
@@ -277,6 +276,7 @@ chunk-PA3ILSLY.js
|
|
|
277
276
|
chunk-PBOFEIFX.js
|
|
278
277
|
chunk-PIDKNOD6.js
|
|
279
278
|
chunk-PL2LYGSK.js
|
|
279
|
+
chunk-PTOLRRVQ.js
|
|
280
280
|
chunk-PURNABFX.js
|
|
281
281
|
chunk-PVJZDW3D.js
|
|
282
282
|
chunk-PYNYJOWR.js
|
|
@@ -287,7 +287,6 @@ chunk-QC43EFYN.js
|
|
|
287
287
|
chunk-QCKZ4DFR.js
|
|
288
288
|
chunk-QELNZW7U.js
|
|
289
289
|
chunk-QJRCKXTM.js
|
|
290
|
-
chunk-QK6LOFXI.js
|
|
291
290
|
chunk-QNVYNVAM.js
|
|
292
291
|
chunk-QRTB7PVR.js
|
|
293
292
|
chunk-QU6OQZJ2.js
|
|
@@ -303,6 +302,7 @@ chunk-RXE3VWIG.js
|
|
|
303
302
|
chunk-RXKI4XAU.js
|
|
304
303
|
chunk-S6XYTJU2.js
|
|
305
304
|
chunk-SDMBTSYP.js
|
|
305
|
+
chunk-SFB4YFAJ.js
|
|
306
306
|
chunk-SO3IBV6J.js
|
|
307
307
|
chunk-SQX66MN6.js
|
|
308
308
|
chunk-SSKHLBQB.js
|
|
@@ -353,6 +353,7 @@ chunk-W7TRZLEM.js
|
|
|
353
353
|
chunk-WC4M6JEA.js
|
|
354
354
|
chunk-WCLES4VX.js
|
|
355
355
|
chunk-WDODIKZ4.js
|
|
356
|
+
chunk-WGQXKODT.js
|
|
356
357
|
chunk-WH7O5RLE.js
|
|
357
358
|
chunk-WHLB5F6P.js
|
|
358
359
|
chunk-WI4DUARF.js
|
|
@@ -398,7 +399,6 @@ chunk-YYN72ZUT.js
|
|
|
398
399
|
chunk-YZ5KJFYU.js
|
|
399
400
|
chunk-Z2YQQYCQ.js
|
|
400
401
|
chunk-Z64YKE5O.js
|
|
401
|
-
chunk-ZABRGL2F.js
|
|
402
402
|
chunk-ZDSSSQZZ.js
|
|
403
403
|
chunk-ZFX4EZMW.js
|
|
404
404
|
chunk-ZJZLYXOF.js
|
|
@@ -475,7 +475,7 @@ deps-RSUOIZPE.js
|
|
|
475
475
|
docsConfirm-XP2EFRWT.js
|
|
476
476
|
docsScreenshots-J7WG2PYD.js
|
|
477
477
|
docsUnlock-WNJLAT4J.js
|
|
478
|
-
doctorNodes-
|
|
478
|
+
doctorNodes-ILYR6LIB.js
|
|
479
479
|
done-7XDZ5EOV.js
|
|
480
480
|
drainDaemon-AJVBJMP2.js
|
|
481
481
|
dropRetiredTables-JBLALSG5.js
|
|
@@ -582,15 +582,15 @@ repos-7Y32XNHJ.js
|
|
|
582
582
|
resolveHarness-2XXVQD4D.js
|
|
583
583
|
resolveModel-3BMDGQEG.js
|
|
584
584
|
restartDaemon-2IKVI3XO.js
|
|
585
|
-
restartNode-
|
|
585
|
+
restartNode-UQER2YEA.js
|
|
586
586
|
restructure-PJYGHKRZ.js
|
|
587
|
-
review-
|
|
587
|
+
review-6QWY2FON.js
|
|
588
588
|
reviewPrComments-BOOP6SKN.js
|
|
589
589
|
rewindPhase-LUTTHL7A.js
|
|
590
590
|
rulesAdd-47GOWHPF.js
|
|
591
591
|
run-T4LRCNGP.js
|
|
592
592
|
run-XKK6RIXT.js
|
|
593
|
-
runDaemon-
|
|
593
|
+
runDaemon-HJT23FAG.js
|
|
594
594
|
runExtract-WIONH6SP.js
|
|
595
595
|
runParallelPhase-TF7ICWA2.js
|
|
596
596
|
runRefine-U5VSEHLT.js
|
|
@@ -612,7 +612,7 @@ show-75ROW5SY.js
|
|
|
612
612
|
show-TKEXHAGK.js
|
|
613
613
|
showClaudeCodeIcon-E4SAM3GN.js
|
|
614
614
|
showCodexIcon-YUAKV4NI.js
|
|
615
|
-
signExtension-
|
|
615
|
+
signExtension-R6ALW56Z.js
|
|
616
616
|
simulateDivergence-VB4UL4UR.js
|
|
617
617
|
skip-UWV5HX7H.js
|
|
618
618
|
slack-5E72HAOV.js
|
|
@@ -640,7 +640,7 @@ unlinkNode-KX5WA2HZ.js
|
|
|
640
640
|
unstar-BB23HT3U.js
|
|
641
641
|
update-2KYZDF6T.js
|
|
642
642
|
update-WUU6TBGS.js
|
|
643
|
-
updateNode-
|
|
643
|
+
updateNode-WDASOL4N.js
|
|
644
644
|
updatePhase-C5IZ3DSJ.js
|
|
645
645
|
updatePlan-6CS7QADL.js
|
|
646
646
|
version-MCQGJOH5.js
|
|
@@ -648,8 +648,8 @@ viewIssue-N6W53LSK.js
|
|
|
648
648
|
watchLoop-MV7DVGC6.js
|
|
649
649
|
watchReport-A4W7UOAJ.js
|
|
650
650
|
watchWait-RGBLOW4I.js
|
|
651
|
-
web-
|
|
652
|
-
web-
|
|
651
|
+
web-CADUUMQL.js
|
|
652
|
+
web-VPM5E2E6.js
|
|
653
653
|
withPool-D7ST2D4M.js
|
|
654
654
|
wontdo-SRK4L3IF.js
|
|
655
655
|
wontfix-J5RLLLYW.js
|
package/dist/built-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1209.
|
|
1
|
+
0.1209.9
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getNestedValue
|
|
3
|
+
} from "./chunk-OU6Q5ZS3.js";
|
|
4
|
+
import {
|
|
5
|
+
mapConfigSecrets
|
|
6
|
+
} from "./chunk-YNHPTUHS.js";
|
|
7
|
+
import {
|
|
8
|
+
getStoreDir
|
|
9
|
+
} from "./chunk-CGYVYHMM.js";
|
|
10
|
+
|
|
11
|
+
// src/shared/redactConfigSecrets.ts
|
|
12
|
+
var REDACTED_SECRET = { assistSecret: "set" };
|
|
13
|
+
function isRedactedSecret(value) {
|
|
14
|
+
return typeof value === "object" && value !== null && value.assistSecret === "set";
|
|
15
|
+
}
|
|
16
|
+
function redactConfigSecrets(value, node) {
|
|
17
|
+
return mapConfigSecrets(value, node, () => REDACTED_SECRET);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// src/commands/config/configEntryLayers.ts
|
|
21
|
+
var LAYERS = [
|
|
22
|
+
["project", "project"],
|
|
23
|
+
["repo", "repoOverride"],
|
|
24
|
+
["global", "global"],
|
|
25
|
+
["user", "user"]
|
|
26
|
+
];
|
|
27
|
+
function configEntryLayers(key, layers, node) {
|
|
28
|
+
const entryLayers = {};
|
|
29
|
+
for (const [scope, layer] of LAYERS) {
|
|
30
|
+
const raw = getNestedValue(layers[layer], key);
|
|
31
|
+
if (raw !== void 0) entryLayers[scope] = redactConfigSecrets(raw, node);
|
|
32
|
+
}
|
|
33
|
+
return entryLayers;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// src/shared/ghFailure.ts
|
|
37
|
+
function ghFailure(error) {
|
|
38
|
+
const stderr = error.stderr;
|
|
39
|
+
if (typeof stderr === "string" && stderr.trim()) return stderr.trim();
|
|
40
|
+
return error instanceof Error ? error.message : "gh api failed";
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// src/commands/review/highLevel/progressStore/migrateHighLevelDrafts.ts
|
|
44
|
+
import { existsSync as existsSync2, readdirSync, rmSync } from "fs";
|
|
45
|
+
import { dirname as dirname2, join as join3 } from "path";
|
|
46
|
+
|
|
47
|
+
// src/commands/review/highLevel/highLevelReviewPath.ts
|
|
48
|
+
import { join } from "path";
|
|
49
|
+
function slug(value) {
|
|
50
|
+
return value.replace(/[^\w.-]+/g, "-");
|
|
51
|
+
}
|
|
52
|
+
function highLevelReviewPath(repo, headRef, headSha) {
|
|
53
|
+
return join(
|
|
54
|
+
getStoreDir(),
|
|
55
|
+
"high-level-reviews",
|
|
56
|
+
slug(repo),
|
|
57
|
+
`${slug(headRef)}-${headSha}.json`
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// src/commands/review/highLevel/readJsonFile.ts
|
|
62
|
+
import { existsSync, readFileSync } from "fs";
|
|
63
|
+
function readJsonFile(path) {
|
|
64
|
+
if (!existsSync(path)) return void 0;
|
|
65
|
+
try {
|
|
66
|
+
return JSON.parse(readFileSync(path, "utf8"));
|
|
67
|
+
} catch {
|
|
68
|
+
return void 0;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// src/commands/review/highLevel/writeJsonFile.ts
|
|
73
|
+
import { mkdirSync, writeFileSync } from "fs";
|
|
74
|
+
import { dirname } from "path";
|
|
75
|
+
function writeJsonFile(path, data) {
|
|
76
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
77
|
+
writeFileSync(path, `${JSON.stringify(data, null, 2)}
|
|
78
|
+
`);
|
|
79
|
+
return path;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// src/commands/review/highLevel/progressStore/highLevelProgressPath.ts
|
|
83
|
+
import { join as join2 } from "path";
|
|
84
|
+
function slug2(value) {
|
|
85
|
+
return value.replace(/[^\w.-]+/g, "-");
|
|
86
|
+
}
|
|
87
|
+
function highLevelProgressPath(repo, prNumber) {
|
|
88
|
+
return join2(
|
|
89
|
+
getStoreDir(),
|
|
90
|
+
"high-level-progress",
|
|
91
|
+
slug2(repo),
|
|
92
|
+
`${prNumber}.json`
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// src/commands/review/highLevel/progressStore/toStoredHighLevelProgress.ts
|
|
97
|
+
function toStoredHighLevelProgress(head, progress) {
|
|
98
|
+
return {
|
|
99
|
+
repo: head.repo,
|
|
100
|
+
prNumber: head.prNumber,
|
|
101
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
102
|
+
items: progress.items.map((item) => ({
|
|
103
|
+
id: item.id,
|
|
104
|
+
ticked: item.ticked === true,
|
|
105
|
+
...item.comment ? { comment: item.comment } : {},
|
|
106
|
+
...item.slice !== void 0 ? { slice: item.slice } : {},
|
|
107
|
+
headSha: head.headSha
|
|
108
|
+
})),
|
|
109
|
+
reviewComments: (progress.reviewComments ?? []).map((comment) => ({
|
|
110
|
+
...comment,
|
|
111
|
+
headSha: comment.headSha ?? head.headSha
|
|
112
|
+
}))
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// src/commands/review/highLevel/progressStore/migrateHighLevelDrafts.ts
|
|
117
|
+
var DRAFT_SUFFIX = ".draft.json";
|
|
118
|
+
function draftsFor(dir, prNumber) {
|
|
119
|
+
if (!existsSync2(dir)) return [];
|
|
120
|
+
return readdirSync(dir).filter((name) => name.endsWith(DRAFT_SUFFIX)).map((name) => ({
|
|
121
|
+
path: join3(dir, name),
|
|
122
|
+
draft: readJsonFile(join3(dir, name))
|
|
123
|
+
})).filter(({ draft }) => draft?.prNumber === prNumber);
|
|
124
|
+
}
|
|
125
|
+
function migrateHighLevelDrafts(repo, prNumber) {
|
|
126
|
+
const dir = dirname2(highLevelReviewPath(repo, "x", "x"));
|
|
127
|
+
const drafts = draftsFor(dir, prNumber);
|
|
128
|
+
const newest = drafts.map(({ draft }) => draft).sort((a, b) => b.savedAt.localeCompare(a.savedAt))[0];
|
|
129
|
+
if (!newest) return;
|
|
130
|
+
if (!existsSync2(highLevelProgressPath(repo, prNumber)))
|
|
131
|
+
writeJsonFile(
|
|
132
|
+
highLevelProgressPath(repo, prNumber),
|
|
133
|
+
toStoredHighLevelProgress(newest, newest)
|
|
134
|
+
);
|
|
135
|
+
for (const { path } of drafts) rmSync(path, { force: true });
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// src/commands/review/highLevel/progressStore/readStoredHighLevelProgress.ts
|
|
139
|
+
function readStoredHighLevelProgress(repo, prNumber) {
|
|
140
|
+
return readJsonFile(
|
|
141
|
+
highLevelProgressPath(repo, prNumber)
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// src/commands/review/highLevel/progressStore/loadHighLevelProgress.ts
|
|
146
|
+
function loadHighLevelProgress(repo, prNumber, headSha) {
|
|
147
|
+
migrateHighLevelDrafts(repo, prNumber);
|
|
148
|
+
const stored = readStoredHighLevelProgress(repo, prNumber);
|
|
149
|
+
if (!stored || stored.items.length === 0 && stored.reviewComments.length === 0)
|
|
150
|
+
return void 0;
|
|
151
|
+
return {
|
|
152
|
+
updatedAt: stored.updatedAt,
|
|
153
|
+
items: stored.items.flatMap(({ headSha: madeOn, ...item }) => {
|
|
154
|
+
if (madeOn === headSha) return [item];
|
|
155
|
+
const { ticked: _stale, ...carried } = item;
|
|
156
|
+
return carried.comment ? [carried] : [];
|
|
157
|
+
}),
|
|
158
|
+
reviewComments: stored.reviewComments
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// src/commands/review/highLevel/progressStore/saveHighLevelProgress.ts
|
|
163
|
+
function saveHighLevelProgress(head, progress) {
|
|
164
|
+
const stored = readStoredHighLevelProgress(head.repo, head.prNumber);
|
|
165
|
+
const closedRequests = stored?.closedRequests ?? [];
|
|
166
|
+
if (head.requestId && closedRequests.includes(head.requestId)) return false;
|
|
167
|
+
writeJsonFile(highLevelProgressPath(head.repo, head.prNumber), {
|
|
168
|
+
...toStoredHighLevelProgress(head, progress),
|
|
169
|
+
...closedRequests.length > 0 ? { closedRequests } : {}
|
|
170
|
+
});
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export {
|
|
175
|
+
isRedactedSecret,
|
|
176
|
+
redactConfigSecrets,
|
|
177
|
+
configEntryLayers,
|
|
178
|
+
ghFailure,
|
|
179
|
+
highLevelReviewPath,
|
|
180
|
+
readJsonFile,
|
|
181
|
+
writeJsonFile,
|
|
182
|
+
highLevelProgressPath,
|
|
183
|
+
readStoredHighLevelProgress,
|
|
184
|
+
loadHighLevelProgress,
|
|
185
|
+
saveHighLevelProgress
|
|
186
|
+
};
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-JM57BCD6.js";
|
|
11
11
|
import {
|
|
12
12
|
firstBrokenHop
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-WGQXKODT.js";
|
|
14
14
|
import {
|
|
15
15
|
describePeerError,
|
|
16
16
|
fetchPeerJson
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
import {
|
|
48
48
|
ASSIST_VERSION,
|
|
49
49
|
PROTOCOL_VERSION
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-PTOLRRVQ.js";
|
|
51
51
|
import {
|
|
52
52
|
findLinkSpec
|
|
53
53
|
} from "./chunk-HPBO553P.js";
|
|
@@ -89,8 +89,10 @@ import {
|
|
|
89
89
|
configEntryLayers,
|
|
90
90
|
ghFailure,
|
|
91
91
|
isRedactedSecret,
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
loadHighLevelProgress,
|
|
93
|
+
redactConfigSecrets,
|
|
94
|
+
saveHighLevelProgress
|
|
95
|
+
} from "./chunk-5PHEZZZO.js";
|
|
94
96
|
import {
|
|
95
97
|
stripAnsi
|
|
96
98
|
} from "./chunk-YJ72SXVD.js";
|
|
@@ -5804,23 +5806,99 @@ async function prStatus(req, res) {
|
|
|
5804
5806
|
respondJson(res, 200, { pr });
|
|
5805
5807
|
}
|
|
5806
5808
|
|
|
5807
|
-
// src/commands/
|
|
5809
|
+
// src/commands/review/highLevel/progressStore/highLevelProgressApiPath.ts
|
|
5810
|
+
var highLevelProgressApiPath = "/api/high-level-progress";
|
|
5811
|
+
|
|
5812
|
+
// src/commands/sessions/web/highLevelProgress/highLevelProgressHeadSchema.ts
|
|
5808
5813
|
import { z as z6 } from "zod";
|
|
5809
|
-
var
|
|
5810
|
-
|
|
5811
|
-
prNumber: z6.number().int().positive()
|
|
5814
|
+
var highLevelProgressHeadSchema = z6.object({
|
|
5815
|
+
repo: z6.string().regex(/^[\w.-]+\/[\w.-]+$/),
|
|
5816
|
+
prNumber: z6.coerce.number().int().positive(),
|
|
5817
|
+
headSha: z6.string().regex(/^[0-9a-f]{7,40}$/i)
|
|
5812
5818
|
});
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5819
|
+
|
|
5820
|
+
// src/commands/sessions/web/highLevelProgress/getHighLevelProgress.ts
|
|
5821
|
+
function getHighLevelProgress(req, res) {
|
|
5822
|
+
const params = new URL(req.url ?? "/", "http://localhost").searchParams;
|
|
5823
|
+
const head = highLevelProgressHeadSchema.safeParse(
|
|
5824
|
+
Object.fromEntries(params)
|
|
5825
|
+
);
|
|
5826
|
+
if (!head.success) {
|
|
5827
|
+
respondJson(res, 400, { error: "Invalid repo, prNumber or headSha" });
|
|
5828
|
+
return;
|
|
5829
|
+
}
|
|
5830
|
+
const { repo, prNumber, headSha } = head.data;
|
|
5831
|
+
respondJson(res, 200, {
|
|
5832
|
+
progress: loadHighLevelProgress(repo, prNumber, headSha) ?? null
|
|
5833
|
+
});
|
|
5834
|
+
}
|
|
5835
|
+
|
|
5836
|
+
// src/commands/sessions/web/highLevelProgress/postHighLevelProgress.ts
|
|
5837
|
+
import { z as z7 } from "zod";
|
|
5838
|
+
|
|
5839
|
+
// src/commands/sessions/web/parseJsonBody.ts
|
|
5840
|
+
async function parseJsonBody(req, schema) {
|
|
5841
|
+
const parsed = schema.safeParse(
|
|
5816
5842
|
await readJsonBody(req).catch(() => void 0)
|
|
5817
5843
|
);
|
|
5818
|
-
|
|
5844
|
+
return parsed.success ? parsed.data : void 0;
|
|
5845
|
+
}
|
|
5846
|
+
|
|
5847
|
+
// src/commands/sessions/web/highLevelProgress/postHighLevelProgress.ts
|
|
5848
|
+
var side = z7.enum(["LEFT", "RIGHT"]).optional();
|
|
5849
|
+
var bodySchema = highLevelProgressHeadSchema.extend({
|
|
5850
|
+
requestId: z7.string().min(1).optional(),
|
|
5851
|
+
items: z7.array(
|
|
5852
|
+
z7.object({
|
|
5853
|
+
id: z7.string(),
|
|
5854
|
+
ticked: z7.boolean().optional(),
|
|
5855
|
+
comment: z7.string().optional(),
|
|
5856
|
+
slice: z7.number().int().optional()
|
|
5857
|
+
})
|
|
5858
|
+
),
|
|
5859
|
+
reviewComments: z7.array(
|
|
5860
|
+
z7.object({
|
|
5861
|
+
path: z7.string(),
|
|
5862
|
+
startLine: z7.number().int(),
|
|
5863
|
+
endLine: z7.number().int(),
|
|
5864
|
+
quote: z7.string(),
|
|
5865
|
+
note: z7.string(),
|
|
5866
|
+
startSide: side,
|
|
5867
|
+
side,
|
|
5868
|
+
headSha: z7.string().optional()
|
|
5869
|
+
})
|
|
5870
|
+
)
|
|
5871
|
+
});
|
|
5872
|
+
async function postHighLevelProgress(req, res) {
|
|
5873
|
+
const body = await parseJsonBody(req, bodySchema);
|
|
5874
|
+
if (!body) {
|
|
5875
|
+
respondJson(res, 400, { error: "Invalid high-level progress" });
|
|
5876
|
+
return;
|
|
5877
|
+
}
|
|
5878
|
+
const { repo, prNumber, headSha, requestId, ...progress } = body;
|
|
5879
|
+
if (saveHighLevelProgress(
|
|
5880
|
+
{ repo, prNumber, headSha, ...requestId ? { requestId } : {} },
|
|
5881
|
+
progress
|
|
5882
|
+
))
|
|
5883
|
+
respondJson(res, 200, { ok: true });
|
|
5884
|
+
else respondJson(res, 409, { error: "This review already has a verdict" });
|
|
5885
|
+
}
|
|
5886
|
+
|
|
5887
|
+
// src/commands/sessions/web/reopenHighLevelReview.ts
|
|
5888
|
+
import { z as z8 } from "zod";
|
|
5889
|
+
var bodySchema2 = z8.object({
|
|
5890
|
+
sessionId: z8.string().min(1),
|
|
5891
|
+
prNumber: z8.number().int().positive()
|
|
5892
|
+
});
|
|
5893
|
+
var REOPEN_TIMEOUT_MS = 18e4;
|
|
5894
|
+
async function reopenHighLevelReview(req, res) {
|
|
5895
|
+
const body = await parseJsonBody(req, bodySchema2);
|
|
5896
|
+
if (!body) {
|
|
5819
5897
|
respondJson(res, 400, { error: "Invalid reopen request" });
|
|
5820
5898
|
return;
|
|
5821
5899
|
}
|
|
5822
5900
|
const reply = await requestDaemonReply(
|
|
5823
|
-
{ type: "reopen-high-level-review", ...
|
|
5901
|
+
{ type: "reopen-high-level-review", ...body },
|
|
5824
5902
|
"reopen-high-level-review-result",
|
|
5825
5903
|
REOPEN_TIMEOUT_MS
|
|
5826
5904
|
);
|
|
@@ -7578,6 +7656,8 @@ var routes2 = {
|
|
|
7578
7656
|
"OPTIONS /api/sessions/review-from-github": sessionFromGithubPreflight,
|
|
7579
7657
|
"POST /api/sessions/docs-feedback": docsFeedback,
|
|
7580
7658
|
"POST /api/sessions/reopen-high-level-review": reopenHighLevelReview,
|
|
7659
|
+
[`GET ${highLevelProgressApiPath}`]: getHighLevelProgress,
|
|
7660
|
+
[`POST ${highLevelProgressApiPath}`]: postHighLevelProgress,
|
|
7581
7661
|
"OPTIONS /api/sessions/docs-feedback": sessionFromGithubPreflight,
|
|
7582
7662
|
"POST /api/link-status": linkStatus,
|
|
7583
7663
|
"OPTIONS /api/link-status": sessionFromGithubPreflight,
|