glimmervoid 0.49.1-next.557 → 0.49.1-next.559
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/chunks/{main-Do8FQTAe.js → main-C_5TP8FY.js} +186 -174
- package/dist/client/assets/{benchmark-panel-BZ-BguIq.js → benchmark-panel-_up9SpHh.js} +1 -1
- package/dist/client/assets/benchmark-panel-_up9SpHh.js.br +0 -0
- package/dist/client/assets/{boards-view-BzihP-XL.js → boards-view-sAuyvpST.js} +1 -1
- package/dist/client/assets/boards-view-sAuyvpST.js.br +0 -0
- package/dist/client/assets/{community-panel-Cgc462sA.js → community-panel-Bin8dbGJ.js} +1 -1
- package/dist/client/assets/community-panel-Bin8dbGJ.js.br +0 -0
- package/dist/client/assets/{dialogs-BwFIl6cl.js → dialogs-BV4I7CoM.js} +1 -1
- package/dist/client/assets/dialogs-BV4I7CoM.js.br +0 -0
- package/dist/client/assets/{doc-editor-ui-Ck3eFQPb.js → doc-editor-ui-DW7gasye.js} +1 -1
- package/dist/client/assets/doc-editor-ui-DW7gasye.js.br +0 -0
- package/dist/client/assets/{feature-hint-CZALOUFK.js → feature-hint-ONlUW17N.js} +1 -1
- package/dist/client/assets/feature-hint-ONlUW17N.js.br +0 -0
- package/dist/client/assets/{first-run-checklist-B8vnsj0B.js → first-run-checklist-Ddea0p8N.js} +1 -1
- package/dist/client/assets/first-run-checklist-Ddea0p8N.js.br +0 -0
- package/dist/client/assets/{hooks-panel-D28q72ql.js → hooks-panel-CmknRPd4.js} +1 -1
- package/dist/client/assets/hooks-panel-CmknRPd4.js.br +0 -0
- package/dist/client/assets/{index-CvF05bPl.js → index-D9xVOKdl.js} +5 -5
- package/dist/client/assets/index-D9xVOKdl.js.br +0 -0
- package/dist/client/assets/{issues-panel-Bl3v4NbY.js → issues-panel-BZQFtHDM.js} +1 -1
- package/dist/client/assets/issues-panel-BZQFtHDM.js.br +0 -0
- package/dist/client/assets/{my-prs-panel-DFM8wSWr.js → my-prs-panel-BY6I8o8f.js} +1 -1
- package/dist/client/assets/my-prs-panel-BY6I8o8f.js.br +0 -0
- package/dist/client/assets/{nyan-cat-CPeIHjXw.js → nyan-cat-C7x1Yu85.js} +1 -1
- package/dist/client/assets/nyan-cat-C7x1Yu85.js.br +0 -0
- package/dist/client/assets/{phone-shell-BBs0QRL6.js → phone-shell-eFDVa3fF.js} +1 -1
- package/dist/client/assets/phone-shell-eFDVa3fF.js.br +0 -0
- package/dist/client/assets/{plan-face-BQds9fox.js → plan-face-Ck7PnwNy.js} +1 -1
- package/dist/client/assets/plan-face-Ck7PnwNy.js.br +0 -0
- package/dist/client/assets/{plan-render-CK3sQycN.js → plan-render-CdaP1nmg.js} +1 -1
- package/dist/client/assets/plan-render-CdaP1nmg.js.br +0 -0
- package/dist/client/assets/{pr-queue-columns-n1Ttll-m.js → pr-queue-columns-CqhUXR6p.js} +1 -1
- package/dist/client/assets/pr-queue-columns-CqhUXR6p.js.br +0 -0
- package/dist/client/assets/{radar-panel-CHHJyadx.js → radar-panel-9iocYJAm.js} +1 -1
- package/dist/client/assets/radar-panel-9iocYJAm.js.br +0 -0
- package/dist/client/assets/{repo-roots-adder-yqnaCW9l.js → repo-roots-adder-aYsLQzUG.js} +1 -1
- package/dist/client/assets/repo-roots-adder-aYsLQzUG.js.br +0 -0
- package/dist/client/assets/{resume-dialog-BxJlO6eS.js → resume-dialog-CQF1ebPs.js} +1 -1
- package/dist/client/assets/resume-dialog-CQF1ebPs.js.br +0 -0
- package/dist/client/assets/{review-queue-panel-D4qOJTf3.js → review-queue-panel-BDzyBke0.js} +1 -1
- package/dist/client/assets/review-queue-panel-BDzyBke0.js.br +0 -0
- package/dist/client/assets/{settings-panel-cmlk9MDH.js → settings-panel-DyVzRbFU.js} +2 -2
- package/dist/client/assets/settings-panel-DyVzRbFU.js.br +0 -0
- package/dist/client/assets/{shown-face-EIKY1wEl.js → shown-face-C9PbNUZ1.js} +1 -1
- package/dist/client/assets/shown-face-C9PbNUZ1.js.br +0 -0
- package/dist/client/assets/{team-review-queue-row-C0iHzeft.js → team-review-queue-row-Ce3B1bRC.js} +1 -1
- package/dist/client/assets/team-review-queue-row-Ce3B1bRC.js.br +0 -0
- package/dist/client/assets/{trace-panel-BTBllQi-.js → trace-panel-Cb0h82FE.js} +1 -1
- package/dist/client/assets/trace-panel-Cb0h82FE.js.br +0 -0
- package/dist/client/assets/{usage-panel-C4DjJRIB.js → usage-panel-azhCRxho.js} +1 -1
- package/dist/client/assets/usage-panel-azhCRxho.js.br +0 -0
- package/dist/client/assets/{your-day-tip-CDGGkrCd.js → your-day-tip-CWbbt5Up.js} +1 -1
- package/dist/client/assets/your-day-tip-CWbbt5Up.js.br +0 -0
- package/dist/client/index.html +1 -1
- package/dist/client/index.html.br +0 -0
- package/dist/server/index.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/benchmark-panel-BZ-BguIq.js.br +0 -0
- package/dist/client/assets/boards-view-BzihP-XL.js.br +0 -0
- package/dist/client/assets/community-panel-Cgc462sA.js.br +0 -0
- package/dist/client/assets/dialogs-BwFIl6cl.js.br +0 -0
- package/dist/client/assets/doc-editor-ui-Ck3eFQPb.js.br +0 -0
- package/dist/client/assets/feature-hint-CZALOUFK.js.br +0 -0
- package/dist/client/assets/first-run-checklist-B8vnsj0B.js.br +0 -0
- package/dist/client/assets/hooks-panel-D28q72ql.js.br +0 -0
- package/dist/client/assets/index-CvF05bPl.js.br +0 -0
- package/dist/client/assets/issues-panel-Bl3v4NbY.js.br +0 -0
- package/dist/client/assets/my-prs-panel-DFM8wSWr.js.br +0 -0
- package/dist/client/assets/nyan-cat-CPeIHjXw.js.br +0 -0
- package/dist/client/assets/phone-shell-BBs0QRL6.js.br +0 -0
- package/dist/client/assets/plan-face-BQds9fox.js.br +0 -0
- package/dist/client/assets/plan-render-CK3sQycN.js.br +0 -0
- package/dist/client/assets/pr-queue-columns-n1Ttll-m.js.br +0 -0
- package/dist/client/assets/radar-panel-CHHJyadx.js.br +0 -0
- package/dist/client/assets/repo-roots-adder-yqnaCW9l.js.br +0 -0
- package/dist/client/assets/resume-dialog-BxJlO6eS.js.br +0 -0
- package/dist/client/assets/review-queue-panel-D4qOJTf3.js.br +0 -0
- package/dist/client/assets/settings-panel-cmlk9MDH.js.br +0 -0
- package/dist/client/assets/shown-face-EIKY1wEl.js.br +0 -0
- package/dist/client/assets/team-review-queue-row-C0iHzeft.js.br +0 -0
- package/dist/client/assets/trace-panel-BTBllQi-.js.br +0 -0
- package/dist/client/assets/usage-panel-C4DjJRIB.js.br +0 -0
- package/dist/client/assets/your-day-tip-CDGGkrCd.js.br +0 -0
|
@@ -30962,7 +30962,7 @@ async function writeUntrustedPayload(laneCwd, payload, maxCharsPerItem) {
|
|
|
30962
30962
|
return payloadPath;
|
|
30963
30963
|
}
|
|
30964
30964
|
//#endregion
|
|
30965
|
-
//#region server/radar/radar-
|
|
30965
|
+
//#region server/radar/radar-posture.ts
|
|
30966
30966
|
var RADAR_SHELL_AND_WEB_DENY = Object.freeze([
|
|
30967
30967
|
"Bash",
|
|
30968
30968
|
"NotebookEdit",
|
|
@@ -31021,51 +31021,14 @@ function radarClaudeArgs(posture, laneArgs) {
|
|
|
31021
31021
|
...readRules.length > 0 ? ["--allowedTools", ...readRules] : []
|
|
31022
31022
|
];
|
|
31023
31023
|
}
|
|
31024
|
-
|
|
31025
|
-
|
|
31026
|
-
var FORCE_TICK_DEBOUNCE_MS = 3e3;
|
|
31027
|
-
var HANDOFF_STEP_LABELS = Object.freeze({
|
|
31028
|
-
"commit-fix": "committing the fix",
|
|
31029
|
-
"read-diff": "reading the branch diff",
|
|
31030
|
-
"count-commits": "counting the branch commits"
|
|
31031
|
-
});
|
|
31032
|
-
async function readNewTranscriptLines(tail, transcriptPath) {
|
|
31033
|
-
const opened = await openContainedFile(path.resolve(transcriptPath), claudeProjectsDir(process.env, os.homedir()));
|
|
31034
|
-
if (!opened.ok) return [];
|
|
31035
|
-
const { handle, realPath, stat } = opened.file;
|
|
31036
|
-
try {
|
|
31037
|
-
if (tail.realPath !== realPath) Object.assign(tail, {
|
|
31038
|
-
realPath,
|
|
31039
|
-
offset: 0
|
|
31040
|
-
});
|
|
31041
|
-
const plan = planContiguousRead(tail, stat);
|
|
31042
|
-
if (plan.action === "skip") return [];
|
|
31043
|
-
const chunk = Buffer.alloc(plan.end - plan.start);
|
|
31044
|
-
const { bytesRead } = await handle.read(chunk, 0, chunk.length, plan.start);
|
|
31045
|
-
const readBytes = chunk.subarray(0, bytesRead);
|
|
31046
|
-
const wholeLineBytes = completeLineBytes(readBytes);
|
|
31047
|
-
const isOneOversizedLine = wholeLineBytes === 0 && bytesRead >= 1048576;
|
|
31048
|
-
tail.offset = plan.start + (isOneOversizedLine ? bytesRead : wholeLineBytes);
|
|
31049
|
-
return readBytes.subarray(0, wholeLineBytes).toString("utf8").split("\n");
|
|
31050
|
-
} finally {
|
|
31051
|
-
await handle.close().catch(() => {});
|
|
31052
|
-
}
|
|
31053
|
-
}
|
|
31024
|
+
//#endregion
|
|
31025
|
+
//#region server/radar/radar-prompts.ts
|
|
31054
31026
|
function safeIssueId(issueId) {
|
|
31055
31027
|
return String(issueId).replace(/[^\w.-]+/g, "-").replace(/\.{2,}/g, "-");
|
|
31056
31028
|
}
|
|
31057
|
-
function reportPathFor(issueId) {
|
|
31058
|
-
return path.join(REPORT_DIR, `${safeIssueId(issueId)}.html`);
|
|
31059
|
-
}
|
|
31060
31029
|
function promptIssueUrl(host, projectId, issueId) {
|
|
31061
31030
|
return `${String(host || "").replace(/\/+$/, "")}/project/${safeIssueId(projectId)}/error_tracking/${safeIssueId(issueId)}`;
|
|
31062
31031
|
}
|
|
31063
|
-
function createResultFileFor(kind, projectId, issueId) {
|
|
31064
|
-
return createJobResultFile(`glimmervoid-posthog-${kind}${safeIssueId(projectId)}-${safeIssueId(issueId)}`);
|
|
31065
|
-
}
|
|
31066
|
-
function newFixDiscriminator() {
|
|
31067
|
-
return `${Date.now().toString(36)}${crypto.randomBytes(2).toString("hex")}`;
|
|
31068
|
-
}
|
|
31069
31032
|
function untrustedIssueLines(eventsFetched) {
|
|
31070
31033
|
return [
|
|
31071
31034
|
UNTRUSTED_PREAMBLE,
|
|
@@ -31142,40 +31105,25 @@ function buildFixPrompt({ issueId, projectId, host, resultPath, repoPath, branch
|
|
|
31142
31105
|
"preamble, no emoji, no em or en dashes."
|
|
31143
31106
|
].join("\n");
|
|
31144
31107
|
}
|
|
31145
|
-
|
|
31146
|
-
|
|
31147
|
-
const names = (await fs.promises.readdir(dir)).filter((n) => n.endsWith(".html") || n.endsWith(".md"));
|
|
31148
|
-
if (names.length <= retain) return;
|
|
31149
|
-
const ordered = (await Promise.all(names.map(async (name) => {
|
|
31150
|
-
const full = path.join(dir, name);
|
|
31151
|
-
try {
|
|
31152
|
-
return {
|
|
31153
|
-
full,
|
|
31154
|
-
mtimeMs: (await fs.promises.stat(full)).mtimeMs
|
|
31155
|
-
};
|
|
31156
|
-
} catch {
|
|
31157
|
-
return null;
|
|
31158
|
-
}
|
|
31159
|
-
}))).filter((entry) => entry !== null).sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
31160
|
-
for (const victim of ordered.slice(retain)) await fs.promises.rm(victim.full, { force: true }).catch(() => {});
|
|
31161
|
-
} catch {}
|
|
31162
|
-
}
|
|
31163
|
-
var INVESTIGATION_VERDICTS = /* @__PURE__ */ new Set([
|
|
31164
|
-
"ROOT_CAUSE",
|
|
31165
|
-
"NEEDS_HUMAN",
|
|
31166
|
-
"TRANSIENT",
|
|
31167
|
-
"ERROR"
|
|
31168
|
-
]);
|
|
31169
|
-
var FIX_RESULT_VERDICTS = new Set(FIX_VERDICTS);
|
|
31170
|
-
function readInvestigationResult(resultPath) {
|
|
31171
|
-
return readResultFile(resultPath, INVESTIGATION_VERDICTS);
|
|
31108
|
+
function fallbackPrTitle(issueId) {
|
|
31109
|
+
return `fix: PostHog issue ${issueId}`;
|
|
31172
31110
|
}
|
|
31173
|
-
function
|
|
31174
|
-
return
|
|
31175
|
-
|
|
31176
|
-
|
|
31177
|
-
|
|
31111
|
+
function fallbackPrBody({ issueUrl, summary }) {
|
|
31112
|
+
return [
|
|
31113
|
+
"Automated fix from the Glimmervoid Radar lane. Reviewed by nobody yet.",
|
|
31114
|
+
"",
|
|
31115
|
+
`Issue: ${issueUrl}`,
|
|
31116
|
+
"Not run: the fix lane has no shell, so neither the fix nor any test it added was executed.",
|
|
31117
|
+
`Agent summary: ${summaryLineFromReportText(summary) || "(none written)"}`
|
|
31118
|
+
].join("\n");
|
|
31178
31119
|
}
|
|
31120
|
+
//#endregion
|
|
31121
|
+
//#region server/radar/radar-fix-handoff.ts
|
|
31122
|
+
var HANDOFF_STEP_LABELS = Object.freeze({
|
|
31123
|
+
"commit-fix": "committing the fix",
|
|
31124
|
+
"read-diff": "reading the branch diff",
|
|
31125
|
+
"count-commits": "counting the branch commits"
|
|
31126
|
+
});
|
|
31179
31127
|
var FIX_HANDOFF_TIMEOUT_MS = 12e4;
|
|
31180
31128
|
async function runCli(cmd, args, cwd, execFileFn) {
|
|
31181
31129
|
const options = {
|
|
@@ -31205,11 +31153,6 @@ function handoffFailure(step, detail, branch) {
|
|
|
31205
31153
|
failedStep: step
|
|
31206
31154
|
};
|
|
31207
31155
|
}
|
|
31208
|
-
function resultErrorReason(outcome) {
|
|
31209
|
-
if (outcome.verdict !== "ERROR") return void 0;
|
|
31210
|
-
if (outcome.ok !== false) return "agent-reported";
|
|
31211
|
-
return outcome.kind === "missing" ? "no-result" : "invalid-result";
|
|
31212
|
-
}
|
|
31213
31156
|
async function checkFixBranch({ run = runCli, workspace }) {
|
|
31214
31157
|
const branch = workspace.branch;
|
|
31215
31158
|
const baseRef = workspace.baseSha || workspace.base;
|
|
@@ -31287,17 +31230,80 @@ async function commitFixWork({ run = runCli, workspace, message, emptyHooksDir }
|
|
|
31287
31230
|
if (!committed.ok) return handoffFailure("commit-fix", committed.err, branch);
|
|
31288
31231
|
return null;
|
|
31289
31232
|
}
|
|
31290
|
-
|
|
31291
|
-
|
|
31233
|
+
//#endregion
|
|
31234
|
+
//#region server/radar/radar-wiring.ts
|
|
31235
|
+
var REPORT_DIR = DEFAULT_POSTHOG_REPORT_DIR;
|
|
31236
|
+
var REPORT_RETAIN_FILES = 20;
|
|
31237
|
+
var FORCE_TICK_DEBOUNCE_MS = 3e3;
|
|
31238
|
+
async function readNewTranscriptLines(tail, transcriptPath) {
|
|
31239
|
+
const opened = await openContainedFile(path.resolve(transcriptPath), claudeProjectsDir(process.env, os.homedir()));
|
|
31240
|
+
if (!opened.ok) return [];
|
|
31241
|
+
const { handle, realPath, stat } = opened.file;
|
|
31242
|
+
try {
|
|
31243
|
+
if (tail.realPath !== realPath) Object.assign(tail, {
|
|
31244
|
+
realPath,
|
|
31245
|
+
offset: 0
|
|
31246
|
+
});
|
|
31247
|
+
const plan = planContiguousRead(tail, stat);
|
|
31248
|
+
if (plan.action === "skip") return [];
|
|
31249
|
+
const chunk = Buffer.alloc(plan.end - plan.start);
|
|
31250
|
+
const { bytesRead } = await handle.read(chunk, 0, chunk.length, plan.start);
|
|
31251
|
+
const readBytes = chunk.subarray(0, bytesRead);
|
|
31252
|
+
const wholeLineBytes = completeLineBytes(readBytes);
|
|
31253
|
+
const isOneOversizedLine = wholeLineBytes === 0 && bytesRead >= 1048576;
|
|
31254
|
+
tail.offset = plan.start + (isOneOversizedLine ? bytesRead : wholeLineBytes);
|
|
31255
|
+
return readBytes.subarray(0, wholeLineBytes).toString("utf8").split("\n");
|
|
31256
|
+
} finally {
|
|
31257
|
+
await handle.close().catch(() => {});
|
|
31258
|
+
}
|
|
31292
31259
|
}
|
|
31293
|
-
function
|
|
31294
|
-
return
|
|
31295
|
-
|
|
31296
|
-
|
|
31297
|
-
|
|
31298
|
-
|
|
31299
|
-
|
|
31300
|
-
|
|
31260
|
+
function reportPathFor(issueId) {
|
|
31261
|
+
return path.join(REPORT_DIR, `${safeIssueId(issueId)}.html`);
|
|
31262
|
+
}
|
|
31263
|
+
function createResultFileFor(kind, projectId, issueId) {
|
|
31264
|
+
return createJobResultFile(`glimmervoid-posthog-${kind}${safeIssueId(projectId)}-${safeIssueId(issueId)}`);
|
|
31265
|
+
}
|
|
31266
|
+
function newFixDiscriminator() {
|
|
31267
|
+
return `${Date.now().toString(36)}${crypto.randomBytes(2).toString("hex")}`;
|
|
31268
|
+
}
|
|
31269
|
+
async function sweepReports(dir = REPORT_DIR, retain = REPORT_RETAIN_FILES) {
|
|
31270
|
+
try {
|
|
31271
|
+
const names = (await fs.promises.readdir(dir)).filter((n) => n.endsWith(".html") || n.endsWith(".md"));
|
|
31272
|
+
if (names.length <= retain) return;
|
|
31273
|
+
const ordered = (await Promise.all(names.map(async (name) => {
|
|
31274
|
+
const full = path.join(dir, name);
|
|
31275
|
+
try {
|
|
31276
|
+
return {
|
|
31277
|
+
full,
|
|
31278
|
+
mtimeMs: (await fs.promises.stat(full)).mtimeMs
|
|
31279
|
+
};
|
|
31280
|
+
} catch {
|
|
31281
|
+
return null;
|
|
31282
|
+
}
|
|
31283
|
+
}))).filter((entry) => entry !== null).sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
31284
|
+
for (const victim of ordered.slice(retain)) await fs.promises.rm(victim.full, { force: true }).catch(() => {});
|
|
31285
|
+
} catch {}
|
|
31286
|
+
}
|
|
31287
|
+
var INVESTIGATION_VERDICTS = /* @__PURE__ */ new Set([
|
|
31288
|
+
"ROOT_CAUSE",
|
|
31289
|
+
"NEEDS_HUMAN",
|
|
31290
|
+
"TRANSIENT",
|
|
31291
|
+
"ERROR"
|
|
31292
|
+
]);
|
|
31293
|
+
var FIX_RESULT_VERDICTS = new Set(FIX_VERDICTS);
|
|
31294
|
+
function readInvestigationResult(resultPath) {
|
|
31295
|
+
return readResultFile(resultPath, INVESTIGATION_VERDICTS);
|
|
31296
|
+
}
|
|
31297
|
+
function readFixResult(resultPath) {
|
|
31298
|
+
return readResultFile(resultPath, FIX_RESULT_VERDICTS, (obj) => ({
|
|
31299
|
+
prTitle: normalizePrTitle(obj.prTitle),
|
|
31300
|
+
prBody: normalizePrBody(obj.prBody)
|
|
31301
|
+
}));
|
|
31302
|
+
}
|
|
31303
|
+
function resultErrorReason(outcome) {
|
|
31304
|
+
if (outcome.verdict !== "ERROR") return void 0;
|
|
31305
|
+
if (outcome.ok !== false) return "agent-reported";
|
|
31306
|
+
return outcome.kind === "missing" ? "no-result" : "invalid-result";
|
|
31301
31307
|
}
|
|
31302
31308
|
function radarShouldStart(cfg) {
|
|
31303
31309
|
const p = cfg.posthog;
|
|
@@ -33054,44 +33060,12 @@ function createThreadJudge(spawn, readReviewer, shutdownSignal) {
|
|
|
33054
33060
|
};
|
|
33055
33061
|
}
|
|
33056
33062
|
//#endregion
|
|
33057
|
-
//#region server/github/pr-gh.ts
|
|
33058
|
-
var GH_MERGE_FLAGS = {
|
|
33059
|
-
MERGE: "--merge",
|
|
33060
|
-
SQUASH: "--squash",
|
|
33061
|
-
REBASE: "--rebase"
|
|
33062
|
-
};
|
|
33063
|
+
//#region server/github/pr-gh/pr-gh-queries.ts
|
|
33063
33064
|
var MY_PR_MERGE_STATE_QUERY = `query($owner: String!, $name: String!, $number: Int!) {
|
|
33064
33065
|
repository(owner: $owner, name: $name) { pullRequest(number: $number) { state isInMergeQueue autoMergeRequest { enabledAt } } }
|
|
33065
33066
|
}`;
|
|
33066
|
-
var GH_READ_TIMEOUT_MS = 15e3;
|
|
33067
|
-
var GH_WRITE_TIMEOUT_MS = 3e4;
|
|
33068
|
-
var GH_MAX_BUFFER_BYTES = 2097153;
|
|
33069
|
-
function run(cmd, args, cwd, input, preserveOutput = false, timeoutMs = GH_READ_TIMEOUT_MS) {
|
|
33070
|
-
return runCommand(cmd, args, {
|
|
33071
|
-
cwd,
|
|
33072
|
-
input,
|
|
33073
|
-
timeoutMs,
|
|
33074
|
-
maxBuffer: GH_MAX_BUFFER_BYTES,
|
|
33075
|
-
trim: !preserveOutput,
|
|
33076
|
-
keepStdoutOnFailure: true,
|
|
33077
|
-
preferStderr: true
|
|
33078
|
-
});
|
|
33079
|
-
}
|
|
33080
|
-
function mergeKindFromPrState(prStateJson) {
|
|
33081
|
-
const parsed = MyPrMergeStateResponse.safeParse(parseJsonOrNull(prStateJson));
|
|
33082
|
-
if (!parsed.success || parsed.data.errors?.length) return "unconfirmed";
|
|
33083
|
-
const pullRequest = parsed.data.data.repository?.pullRequest;
|
|
33084
|
-
if (!pullRequest) return "unconfirmed";
|
|
33085
|
-
if (pullRequest.state === "MERGED") return "merged";
|
|
33086
|
-
if (pullRequest.state !== "OPEN") return "unconfirmed";
|
|
33087
|
-
if (pullRequest.isInMergeQueue) return "queued";
|
|
33088
|
-
if (pullRequest.autoMergeRequest !== null) return "auto-merge";
|
|
33089
|
-
return "unconfirmed";
|
|
33090
|
-
}
|
|
33091
|
-
var HEX_LABEL_COLOR = /^[0-9a-f]{6}$/i;
|
|
33092
33067
|
var CHECK_CONTEXT_FIELDS = "__typename ... on CheckRun { name conclusion status startedAt checkSuite { app { databaseId } workflowRun { workflow { databaseId } } } } ... on StatusContext { context state }";
|
|
33093
33068
|
var MY_PR_CHECK_CONTEXTS_QUERY = `query($id: ID!, $cursor: String!) { node(id: $id) { ... on StatusCheckRollup { contexts(first: 100, after: $cursor) { pageInfo { hasNextPage endCursor } nodes { ${CHECK_CONTEXT_FIELDS} } } } } }`;
|
|
33094
|
-
var MAX_CHECK_CONTEXT_PAGES = 10;
|
|
33095
33069
|
var MY_PR_FIELDS_FRAGMENT = `fragment myPrFields on PullRequest {
|
|
33096
33070
|
__typename id number title url isDraft state createdAt mergedAt updatedAt baseRefName baseRefOid headRefName isCrossRepository headRefOid isInMergeQueue mergeable mergeStateStatus reviewDecision
|
|
33097
33071
|
repository { nameWithOwner viewerDefaultMergeMethod }
|
|
@@ -33113,27 +33087,9 @@ function githubPrsLightSearchQuery(maxMembers = 50) {
|
|
|
33113
33087
|
search(type: ISSUE, first: ${maxMembers}, query: $searchQuery, after: $cursor) { issueCount pageInfo { hasNextPage endCursor } nodes { ... on PullRequest { ${GITHUB_PR_LIGHT_FIELDS} } } }
|
|
33114
33088
|
}`;
|
|
33115
33089
|
}
|
|
33116
|
-
var GITHUB_PR_LIGHT_REPOSITORY = z.object({ pullRequest: GithubPrLightSearchNode.nullable() }).nullable();
|
|
33117
|
-
var GITHUB_PRS_LIGHT_RESPONSE = z.object({
|
|
33118
|
-
data: z.object({ search: z.object({
|
|
33119
|
-
issueCount: z.number().int().nonnegative(),
|
|
33120
|
-
pageInfo: z.object({
|
|
33121
|
-
hasNextPage: z.boolean(),
|
|
33122
|
-
endCursor: z.string().nullable()
|
|
33123
|
-
}),
|
|
33124
|
-
nodes: z.array(GithubPrLightSearchNode)
|
|
33125
|
-
}) }),
|
|
33126
|
-
errors: z.array(z.unknown()).optional()
|
|
33127
|
-
});
|
|
33128
33090
|
var GITHUB_PR_REVIEW_FIELDS = `author { __typename login } authorAssociation
|
|
33129
33091
|
latestReviews(first: 20) { nodes { state submittedAt author { login } commit { oid } } }
|
|
33130
33092
|
writerOpinionatedReviews: latestOpinionatedReviews(first: 20, writersOnly: true) { nodes { state } }`;
|
|
33131
|
-
var GITHUB_PR_DETAIL_REPOSITORY = z.object({ pullRequest: GithubPrDetailNode.nullable() }).nullable();
|
|
33132
|
-
var GITHUB_NOTIFICATIONS = z.array(z.object({ subject: z.object({
|
|
33133
|
-
type: z.string(),
|
|
33134
|
-
url: z.string().nullable()
|
|
33135
|
-
}) }));
|
|
33136
|
-
var MAX_GITHUB_PR_SEARCH_PAGES = 20;
|
|
33137
33093
|
function githubPrsLightByKeyQuery(prs) {
|
|
33138
33094
|
return `query { ${prs.map((pr, index) => {
|
|
33139
33095
|
const [owner, name] = repoParts(pr.repo) ?? ["", ""];
|
|
@@ -33165,36 +33121,17 @@ var MY_PR_THREADS_QUERY = `query($owner: String!, $name: String!, $number: Int!,
|
|
|
33165
33121
|
${REVIEW_THREAD_FIELDS}
|
|
33166
33122
|
} } } }
|
|
33167
33123
|
}`;
|
|
33168
|
-
var GRAPHQL_THREADS_REPOSITORY = z.object({ pullRequest: z.object({ reviewThreads: z.object({
|
|
33169
|
-
pageInfo: z.object({ hasNextPage: z.boolean() }),
|
|
33170
|
-
nodes: z.array(z.unknown())
|
|
33171
|
-
}) }).nullable() });
|
|
33172
33124
|
function reviewThreadsBatchQuery(prs) {
|
|
33173
33125
|
return `query { ${prs.map((pr, index) => {
|
|
33174
33126
|
const [owner, name] = repoParts(pr.repo) ?? ["", ""];
|
|
33175
33127
|
return `pr${index}: repository(owner: "${owner}", name: "${name}") { pullRequest(number: ${pr.number}) { reviewThreads(first: 100) { pageInfo { hasNextPage } nodes { ${REVIEW_THREAD_FIELDS} } } } }`;
|
|
33176
33128
|
}).join(" ")} }`;
|
|
33177
33129
|
}
|
|
33178
|
-
var MERGED_PRS_PAGE_SIZE = 50;
|
|
33179
33130
|
var MERGED_PRS_QUERY = `query($searchQuery: String!, $first: Int!, $cursor: String) {
|
|
33180
33131
|
search(type: ISSUE, query: $searchQuery, first: $first, after: $cursor) { pageInfo { hasNextPage endCursor } nodes {
|
|
33181
33132
|
... on PullRequest { number title url mergedAt reviewThreads { totalCount } reviews { totalCount } }
|
|
33182
33133
|
} }
|
|
33183
33134
|
}`;
|
|
33184
|
-
var MERGED_PRS_RESPONSE = z.object({ data: z.object({ search: z.object({
|
|
33185
|
-
pageInfo: z.object({
|
|
33186
|
-
hasNextPage: z.boolean(),
|
|
33187
|
-
endCursor: z.string().nullable()
|
|
33188
|
-
}),
|
|
33189
|
-
nodes: z.array(z.unknown())
|
|
33190
|
-
}) }) });
|
|
33191
|
-
var BENCHMARK_REVIEW_BATCH_SIZE = 10;
|
|
33192
|
-
var COMPARE_FILE_LIST_CAP = 300;
|
|
33193
|
-
var COMPARE_RESPONSE = z.object({
|
|
33194
|
-
mergeBaseSha: CommitSha,
|
|
33195
|
-
changedFiles: z.array(z.string().min(1)),
|
|
33196
|
-
fileCount: z.number().int().nonnegative()
|
|
33197
|
-
});
|
|
33198
33135
|
function benchmarkReviewDataQuery(prs) {
|
|
33199
33136
|
return `query { ${prs.map((pr, index) => {
|
|
33200
33137
|
const [owner, name] = repoParts(pr.repo) ?? ["", ""];
|
|
@@ -33208,6 +33145,54 @@ function benchmarkReviewDataQuery(prs) {
|
|
|
33208
33145
|
} }`;
|
|
33209
33146
|
}).join(" ")} }`;
|
|
33210
33147
|
}
|
|
33148
|
+
var TEAM_PROFILE_QUERY = "query($org: String!, $slug: String!) { organization(login: $org) { team(slug: $slug) { name avatarUrl } } }";
|
|
33149
|
+
function issueLinkedPullRequestsQuery(issues) {
|
|
33150
|
+
return `query { ${issues.map((issue, index) => {
|
|
33151
|
+
const [owner, name] = repoParts(issue.repo) ?? ["", ""];
|
|
33152
|
+
return `pr${index}: repository(owner: "${owner}", name: "${name}") { issue(number: ${issue.number}) { closedByPullRequestsReferences(first: 5, includeClosedPrs: true) { nodes { number url title state isDraft } } } }`;
|
|
33153
|
+
}).join(" ")} }`;
|
|
33154
|
+
}
|
|
33155
|
+
function behindCountsQuery(prs) {
|
|
33156
|
+
return `query { ${prs.map((pr, index) => {
|
|
33157
|
+
const [owner, name] = repoParts(pr.repo) ?? ["", ""];
|
|
33158
|
+
return `pr${index}: repository(owner: "${owner}", name: "${name}") { pullRequest(number: ${pr.number}) { baseRef { compare(headRef: "${pr.headSha}") { behindBy } } } }`;
|
|
33159
|
+
}).join(" ")} }`;
|
|
33160
|
+
}
|
|
33161
|
+
//#endregion
|
|
33162
|
+
//#region server/github/pr-gh/pr-gh-responses.ts
|
|
33163
|
+
var GITHUB_PR_LIGHT_REPOSITORY = z.object({ pullRequest: GithubPrLightSearchNode.nullable() }).nullable();
|
|
33164
|
+
var GITHUB_PRS_LIGHT_RESPONSE = z.object({
|
|
33165
|
+
data: z.object({ search: z.object({
|
|
33166
|
+
issueCount: z.number().int().nonnegative(),
|
|
33167
|
+
pageInfo: z.object({
|
|
33168
|
+
hasNextPage: z.boolean(),
|
|
33169
|
+
endCursor: z.string().nullable()
|
|
33170
|
+
}),
|
|
33171
|
+
nodes: z.array(GithubPrLightSearchNode)
|
|
33172
|
+
}) }),
|
|
33173
|
+
errors: z.array(z.unknown()).optional()
|
|
33174
|
+
});
|
|
33175
|
+
var GITHUB_PR_DETAIL_REPOSITORY = z.object({ pullRequest: GithubPrDetailNode.nullable() }).nullable();
|
|
33176
|
+
var GITHUB_NOTIFICATIONS = z.array(z.object({ subject: z.object({
|
|
33177
|
+
type: z.string(),
|
|
33178
|
+
url: z.string().nullable()
|
|
33179
|
+
}) }));
|
|
33180
|
+
var GRAPHQL_THREADS_REPOSITORY = z.object({ pullRequest: z.object({ reviewThreads: z.object({
|
|
33181
|
+
pageInfo: z.object({ hasNextPage: z.boolean() }),
|
|
33182
|
+
nodes: z.array(z.unknown())
|
|
33183
|
+
}) }).nullable() });
|
|
33184
|
+
var MERGED_PRS_RESPONSE = z.object({ data: z.object({ search: z.object({
|
|
33185
|
+
pageInfo: z.object({
|
|
33186
|
+
hasNextPage: z.boolean(),
|
|
33187
|
+
endCursor: z.string().nullable()
|
|
33188
|
+
}),
|
|
33189
|
+
nodes: z.array(z.unknown())
|
|
33190
|
+
}) }) });
|
|
33191
|
+
var COMPARE_RESPONSE = z.object({
|
|
33192
|
+
mergeBaseSha: CommitSha,
|
|
33193
|
+
changedFiles: z.array(z.string().min(1)),
|
|
33194
|
+
fileCount: z.number().int().nonnegative()
|
|
33195
|
+
});
|
|
33211
33196
|
var GH_LOGIN = z.string().regex(GH_SEGMENT);
|
|
33212
33197
|
var GH_MEMBERS = z.array(GH_LOGIN);
|
|
33213
33198
|
var GH_TEAMS = z.array(GithubTeam);
|
|
@@ -33218,13 +33203,8 @@ var TEAM_PROFILE = z.object({
|
|
|
33218
33203
|
}).nullable() }).nullable() }),
|
|
33219
33204
|
errors: z.array(z.unknown()).optional()
|
|
33220
33205
|
});
|
|
33221
|
-
var TEAM_PROFILE_QUERY = "query($org: String!, $slug: String!) { organization(login: $org) { team(slug: $slug) { name avatarUrl } } }";
|
|
33222
|
-
var SEARCH_PAGE_SIZE = 100;
|
|
33223
|
-
var MAX_SEARCH_PAGES = 5;
|
|
33224
|
-
var MAX_REVIEW_THREAD_PAGES = 5;
|
|
33225
33206
|
var PR_DIFF_MAX_BYTES = 2097152;
|
|
33226
33207
|
var CREATED_REVIEW = z.object({ id: z.number().int().positive() }).passthrough();
|
|
33227
|
-
var REVIEW_SNAPSHOT_BATCH_SIZE = 25;
|
|
33228
33208
|
var GRAPHQL_BEHIND_REPOSITORY = z.object({ pullRequest: z.object({ baseRef: z.object({ compare: z.object({ behindBy: z.number().int().nonnegative() }).nullable() }).nullable() }).nullable() });
|
|
33229
33209
|
var GRAPHQL_RESPONSE = z.object({
|
|
33230
33210
|
data: z.record(z.string(), z.unknown()).nullable(),
|
|
@@ -33233,6 +33213,20 @@ var GRAPHQL_RESPONSE = z.object({
|
|
|
33233
33213
|
var GRAPHQL_ERROR_ALIAS = z.object({ path: z.tuple([z.string()]).rest(z.union([z.string(), z.number()])) });
|
|
33234
33214
|
var GRAPHQL_NOT_FOUND_ERROR = GRAPHQL_ERROR_ALIAS.extend({ type: z.literal("NOT_FOUND") });
|
|
33235
33215
|
var PR_DIFF = z.string().refine((diff) => Buffer.byteLength(diff, "utf8") <= PR_DIFF_MAX_BYTES);
|
|
33216
|
+
//#endregion
|
|
33217
|
+
//#region server/github/pr-gh/pr-gh-parsing.ts
|
|
33218
|
+
function mergeKindFromPrState(prStateJson) {
|
|
33219
|
+
const parsed = MyPrMergeStateResponse.safeParse(parseJsonOrNull(prStateJson));
|
|
33220
|
+
if (!parsed.success || parsed.data.errors?.length) return "unconfirmed";
|
|
33221
|
+
const pullRequest = parsed.data.data.repository?.pullRequest;
|
|
33222
|
+
if (!pullRequest) return "unconfirmed";
|
|
33223
|
+
if (pullRequest.state === "MERGED") return "merged";
|
|
33224
|
+
if (pullRequest.state !== "OPEN") return "unconfirmed";
|
|
33225
|
+
if (pullRequest.isInMergeQueue) return "queued";
|
|
33226
|
+
if (pullRequest.autoMergeRequest !== null) return "auto-merge";
|
|
33227
|
+
return "unconfirmed";
|
|
33228
|
+
}
|
|
33229
|
+
var HEX_LABEL_COLOR = /^[0-9a-f]{6}$/i;
|
|
33236
33230
|
function aliasesOfErrors(errors) {
|
|
33237
33231
|
const aliases = /* @__PURE__ */ new Set();
|
|
33238
33232
|
for (const error of errors) {
|
|
@@ -33248,18 +33242,6 @@ function isPrNumber(number) {
|
|
|
33248
33242
|
function reviewSnapshotKey(repo, number) {
|
|
33249
33243
|
return `${repo}#${number}`;
|
|
33250
33244
|
}
|
|
33251
|
-
function issueLinkedPullRequestsQuery(issues) {
|
|
33252
|
-
return `query { ${issues.map((issue, index) => {
|
|
33253
|
-
const [owner, name] = repoParts(issue.repo) ?? ["", ""];
|
|
33254
|
-
return `pr${index}: repository(owner: "${owner}", name: "${name}") { issue(number: ${issue.number}) { closedByPullRequestsReferences(first: 5, includeClosedPrs: true) { nodes { number url title state isDraft } } } }`;
|
|
33255
|
-
}).join(" ")} }`;
|
|
33256
|
-
}
|
|
33257
|
-
function behindCountsQuery(prs) {
|
|
33258
|
-
return `query { ${prs.map((pr, index) => {
|
|
33259
|
-
const [owner, name] = repoParts(pr.repo) ?? ["", ""];
|
|
33260
|
-
return `pr${index}: repository(owner: "${owner}", name: "${name}") { pullRequest(number: ${pr.number}) { baseRef { compare(headRef: "${pr.headSha}") { behindBy } } } }`;
|
|
33261
|
-
}).join(" ")} }`;
|
|
33262
|
-
}
|
|
33263
33245
|
function uniqueValidPrs(prs) {
|
|
33264
33246
|
const byKey = /* @__PURE__ */ new Map();
|
|
33265
33247
|
for (const pr of prs) {
|
|
@@ -33376,6 +33358,36 @@ function conditionalGetResult(response) {
|
|
|
33376
33358
|
};
|
|
33377
33359
|
}
|
|
33378
33360
|
}
|
|
33361
|
+
//#endregion
|
|
33362
|
+
//#region server/github/pr-gh.ts
|
|
33363
|
+
var GH_MERGE_FLAGS = {
|
|
33364
|
+
MERGE: "--merge",
|
|
33365
|
+
SQUASH: "--squash",
|
|
33366
|
+
REBASE: "--rebase"
|
|
33367
|
+
};
|
|
33368
|
+
var GH_READ_TIMEOUT_MS = 15e3;
|
|
33369
|
+
var GH_WRITE_TIMEOUT_MS = 3e4;
|
|
33370
|
+
var GH_MAX_BUFFER_BYTES = 2097153;
|
|
33371
|
+
function run(cmd, args, cwd, input, preserveOutput = false, timeoutMs = GH_READ_TIMEOUT_MS) {
|
|
33372
|
+
return runCommand(cmd, args, {
|
|
33373
|
+
cwd,
|
|
33374
|
+
input,
|
|
33375
|
+
timeoutMs,
|
|
33376
|
+
maxBuffer: GH_MAX_BUFFER_BYTES,
|
|
33377
|
+
trim: !preserveOutput,
|
|
33378
|
+
keepStdoutOnFailure: true,
|
|
33379
|
+
preferStderr: true
|
|
33380
|
+
});
|
|
33381
|
+
}
|
|
33382
|
+
var MAX_CHECK_CONTEXT_PAGES = 10;
|
|
33383
|
+
var MAX_GITHUB_PR_SEARCH_PAGES = 20;
|
|
33384
|
+
var MERGED_PRS_PAGE_SIZE = 50;
|
|
33385
|
+
var BENCHMARK_REVIEW_BATCH_SIZE = 10;
|
|
33386
|
+
var COMPARE_FILE_LIST_CAP = 300;
|
|
33387
|
+
var SEARCH_PAGE_SIZE = 100;
|
|
33388
|
+
var MAX_SEARCH_PAGES = 5;
|
|
33389
|
+
var MAX_REVIEW_THREAD_PAGES = 5;
|
|
33390
|
+
var REVIEW_SNAPSHOT_BATCH_SIZE = 25;
|
|
33379
33391
|
function createPrGh(cwd, commandRunner = run) {
|
|
33380
33392
|
async function runGh(args, input, preserveOutput = false, timeoutMs = GH_READ_TIMEOUT_MS) {
|
|
33381
33393
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./updates-view-core-Bg5MiclR.js";import{n as e,r as t,s as n}from"./dom-helpers-qjWTsLGI.js";import{Mi as r,Ni as i,Pi as a}from"./index-
|
|
1
|
+
import"./updates-view-core-Bg5MiclR.js";import{n as e,r as t,s as n}from"./dom-helpers-qjWTsLGI.js";import{Mi as r,Ni as i,Pi as a}from"./index-D9xVOKdl.js";var o={mine:`Mine`,run:`Run`,cancel:`Cancel`},s=null;function c(e){return e===null?`n/a`:`${Math.round(e*100)}%`}function l(e){if(e===null)return`n/a`;let t=Math.round(e*100);return t>0?`+${t}`:String(t)}function u(e,t,r){let a=n(`button`,`bench-action-button`,o[t]);return a.type=`button`,a.disabled=r,a.addEventListener(`click`,()=>i(e.id,t)),a}function d(e,t){let n=e.inFlight;if(!n||n.suiteId!==t.id)return``;let r=n.caseId?`case ${n.caseId}, `:``;return`Cell ${n.cellIndex+1} of ${n.cellCount}: ${r}arm ${n.armId}, trial ${n.trial}, ${n.phase}.`}function f(e){let t=n(`td`,`bench-score`,c(e?.recall??null));return e&&e.invalid>0&&(t.title=`${e.invalid} invalid or failed cell(s)`),e&&e.degraded>0&&(t.dataset.degraded=`true`),t}function p(e){let t=e.armIds.filter(t=>t!==e.baselineArm),r=n(`table`,`bench-table`),i=n(`tr`);i.append(n(`th`,null,`Case`),...e.armIds.map(t=>n(`th`,null,t===e.baselineArm?`${t} (baseline)`:t))),i.append(...t.map(e=>n(`th`,null,`${e} vs baseline`))),r.append(i);for(let i of e.rows){let a=n(`tr`);a.append(n(`td`,`bench-case`,i.caseId),...e.armIds.map(e=>f(i.arms[e]))),a.append(...t.map(e=>n(`td`,`bench-delta`,l(i.deltaVsBaseline[e]??null)))),r.append(a)}let a=[...new Set(e.armIds.flatMap(t=>Object.keys(e.totals[t]?.recallByTag??{})))].sort(),o=n(`tr`,`bench-total`);o.append(n(`td`,`bench-case`,`Paired recall`),...e.armIds.map(t=>f(e.totals[t]))),r.append(o);for(let t of a){let i=n(`tr`,`bench-total`);i.append(n(`td`,`bench-case`,`Recall, ${t}`),...e.armIds.map(r=>n(`td`,`bench-score`,c(e.totals[r]?.recallByTag[t]??null)))),r.append(i)}return r}function m(e,i){let{isServerConnected:a,pendingActionBySuite:o,outcomeBySuite:s}=r(),c=n(`div`,`bench-suite`),l=e.inFlight?.suiteId===i.id,f=!!e.inFlight&&!l,m=o.has(i.id)||!a,h=n(`div`,`bench-summary`);h.append(n(`span`,`bench-suite-title`,i.title),t(`bench`,i.caseCount===1?`case`:`cases`,String(i.caseCount)),t(`bench`,i.candidateCount===1?`candidate`:`candidates`,String(i.candidateCount)),t(`bench`,`arms`,String(i.armIds.length))),c.append(h);let g=n(`div`,`bench-controls`),_=e.configured===!0&&i.error===null;g.append(u(i,`mine`,!_||m||l),u(i,`run`,!_||m||l||f||i.caseCount===0),u(i,`cancel`,m||!l));let v=n(`span`,`bench-status`,(a?``:`Not connected to the server. Reconnecting.`)||d(e,i)||s.get(i.id)||``);if(v.setAttribute(`role`,`status`),g.append(v),c.append(g),i.error)return c.append(n(`p`,`bench-error`,i.error)),c;let y=i.latestReport;return y?(c.append(n(`p`,`bench-run-line`,`Latest run ${y.runId}: ${y.status}. Only cases every arm scored count toward paired recall.`)),y.rows.length>0&&c.append(p(y)),c):(c.append(n(`p`,`bench-empty`,i.caseCount===0?`Move approved candidates into the cases folder, then choose Run.`:`No run yet.`)),c)}function h(){if(!s)return;s.textContent=``;let{status:t}=r(),i=e(`bench`,`Benchmarks`,`Suites from the benchmarks folder of the Glimmervoid home, one run at a time.`);if(s.append(i),!t)s.append(n(`p`,`bench-empty`,`Waiting for the server.`));else if(!t.configured)s.append(n(`p`,`bench-empty`,t.reason||`Benchmarks are off.`));else if(t.suites.length===0)s.append(n(`p`,`bench-empty`,`No suites yet. Create a folder holding suite.json under benchmarks in the Glimmervoid home.`));else for(let e of t.suites)s.append(m(t,e))}function g(e){s||(s=n(`div`,`bench-content`),e.append(s),a(h),h())}var _={mount:g};export{_ as view};
|
|
Binary file
|