loki-mode 11.124.1 → 11.125.0
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/SKILL.md +2 -2
- package/VERSION +1 -1
- package/dashboard/__init__.py +1 -1
- package/docs/CLI-REFERENCE.md +1 -1
- package/docs/INSTALLATION.md +1 -1
- package/loki-ts/dist/loki.js +1281 -1278
- package/mcp/__init__.py +1 -1
- package/package.json +2 -2
- package/packages/control-plane/dist/server.js +178 -54
- package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
- package/web-app/dist/assets/{AdminPage-C9YXclra.js → AdminPage-RubWD9oO.js} +1 -1
- package/web-app/dist/assets/{Avatar-DcHwmo8Q.js → Avatar-BhJZyVKb.js} +1 -1
- package/web-app/dist/assets/{Badge-DFRrk7D-.js → Badge-Cs0xL3BJ.js} +1 -1
- package/web-app/dist/assets/{Button-y19VaxSR.js → Button-DCLg6fL2.js} +1 -1
- package/web-app/dist/assets/{CockpitPage-DX3I-w5q.js → CockpitPage-CHRIwKG5.js} +1 -1
- package/web-app/dist/assets/{ComparePage-CkBggRv7.js → ComparePage-_cdgzCzn.js} +1 -1
- package/web-app/dist/assets/{ErrorBoundary-mLvOnCJ1.js → ErrorBoundary-2kfwYHs_.js} +1 -1
- package/web-app/dist/assets/{EvidenceReceiptPanel-BkmkNppK.js → EvidenceReceiptPanel-WwDzmLv4.js} +1 -1
- package/web-app/dist/assets/{GitHubIssuesPanel-Cs8rKLO7.js → GitHubIssuesPanel-B3XgeJq6.js} +1 -1
- package/web-app/dist/assets/{GitHubPRsPanel-FgKZAobV.js → GitHubPRsPanel-DRBvsAWC.js} +1 -1
- package/web-app/dist/assets/{HomePage-F_FNrAKj.js → HomePage-DnLIbuTR.js} +2 -2
- package/web-app/dist/assets/{LoginPage-B-2bqmPh.js → LoginPage-DOxVPm7G.js} +1 -1
- package/web-app/dist/assets/{MagicPage-WPCVC2fy.js → MagicPage-DqKnikAa.js} +1 -1
- package/web-app/dist/assets/{MetricsPage-DYJ6MOpJ.js → MetricsPage-B-hL20Yr.js} +1 -1
- package/web-app/dist/assets/{NotFoundPage-CyrIHlCL.js → NotFoundPage-B-FfekYZ.js} +1 -1
- package/web-app/dist/assets/{ProjectPage-BAmwg2sJ.js → ProjectPage-Kr786tsn.js} +3 -3
- package/web-app/dist/assets/{ProjectsPage-COAKl6xX.js → ProjectsPage-BcYnxPnw.js} +1 -1
- package/web-app/dist/assets/{SettingsPage-rpHmbyL0.js → SettingsPage-CadqPZBx.js} +1 -1
- package/web-app/dist/assets/{ShowcasePage-btQXeHy5.js → ShowcasePage-Cw1pE-QX.js} +1 -1
- package/web-app/dist/assets/{SystemSettingsPage-RRwW7JCN.js → SystemSettingsPage-CW2oh-P6.js} +1 -1
- package/web-app/dist/assets/{TeamsPage-BiUdYmVH.js → TeamsPage-3ZIlJUBu.js} +1 -1
- package/web-app/dist/assets/{TemplatesPage-BRh8dRWR.js → TemplatesPage-Bpf1Uv3t.js} +1 -1
- package/web-app/dist/assets/{TerminalOutput-HXMsEbnh.js → TerminalOutput-BLHigjGk.js} +1 -1
- package/web-app/dist/assets/{activity-CP62VCuF.js → activity-Cu72vUFn.js} +1 -1
- package/web-app/dist/assets/{bell-D6tfe2Lc.js → bell-eGy2IUwb.js} +1 -1
- package/web-app/dist/assets/{bot-BcumQWsn.js → bot-B1wk5sfm.js} +1 -1
- package/web-app/dist/assets/{check-Dr3Y24yi.js → check-DU0DutJ9.js} +1 -1
- package/web-app/dist/assets/{chevron-left-DqxUiGVI.js → chevron-left-BNofLtza.js} +1 -1
- package/web-app/dist/assets/{circle-alert-DItIPVXH.js → circle-alert-Bcy_6fp6.js} +1 -1
- package/web-app/dist/assets/{clock-DW0A6_om.js → clock-CHnczWRf.js} +1 -1
- package/web-app/dist/assets/{cloud-Dpg6r2M0.js → cloud-CuNO8Rl6.js} +1 -1
- package/web-app/dist/assets/{code-xml-CRCM56ot.js → code-xml-CskjK2xL.js} +1 -1
- package/web-app/dist/assets/{database-DrakaR5y.js → database-B_IJNpmx.js} +1 -1
- package/web-app/dist/assets/{dollar-sign-Bx88-uC1.js → dollar-sign-NAdnxWrK.js} +1 -1
- package/web-app/dist/assets/{file-code-corner-u54f6D1m.js → file-code-corner-BmBPO5KT.js} +1 -1
- package/web-app/dist/assets/{file-plus-BoUK6DIP.js → file-plus-0tJgKSZv.js} +1 -1
- package/web-app/dist/assets/{globe-CxjteMVu.js → globe-Bto5vosI.js} +1 -1
- package/web-app/dist/assets/{hammer-DfPVK8V-.js → hammer-qXKFv-V5.js} +1 -1
- package/web-app/dist/assets/{index-PdsIYs8D.js → index-kTHVz24w.js} +3 -3
- package/web-app/dist/assets/{layers-BkC-tIBJ.js → layers-C15aH6x4.js} +1 -1
- package/web-app/dist/assets/{loader-circle-ZFbmGHbG.js → loader-circle-B1-sHf-g.js} +1 -1
- package/web-app/dist/assets/{lock-DCPTgRju.js → lock-0A8jdC7f.js} +1 -1
- package/web-app/dist/assets/{package-CQiO2qzH.js → package-CyWW-pM9.js} +1 -1
- package/web-app/dist/assets/{plus-CnOfFWUF.js → plus-pnXKfqXV.js} +1 -1
- package/web-app/dist/assets/{refresh-cw-odLkbX4s.js → refresh-cw-Cbi26Fcs.js} +1 -1
- package/web-app/dist/assets/{rotate-ccw-BwYmXJvd.js → rotate-ccw-cTYDcXnn.js} +1 -1
- package/web-app/dist/assets/{scroll-text--pDgaJgE.js → scroll-text-C2ekJBvD.js} +1 -1
- package/web-app/dist/assets/{server-CD4f5Vze.js → server-URjYn5UG.js} +1 -1
- package/web-app/dist/assets/{shield-alert-CcQwHRj8.js → shield-alert-5DAr2N-t.js} +1 -1
- package/web-app/dist/assets/{thumbs-up-Dlt9cYEo.js → thumbs-up-CGb4Hujd.js} +1 -1
- package/web-app/dist/assets/{trash-2-xnhro-Jd.js → trash-2-DB48tCzu.js} +1 -1
- package/web-app/dist/assets/{trending-down-UmLy_Cck.js → trending-down-C4e4eBTG.js} +1 -1
- package/web-app/dist/assets/{trending-up-ahzpV7N6.js → trending-up-pD6jXeWg.js} +1 -1
- package/web-app/dist/assets/{upload-BMRTmfO-.js → upload-Iv0MU_85.js} +1 -1
- package/web-app/dist/assets/{usePolling-VSt8R-0Q.js → usePolling-CaKlIXJo.js} +1 -1
- package/web-app/dist/assets/{user-C72PyQtn.js → user-D_rqqHLB.js} +1 -1
- package/web-app/dist/index.html +1 -1
package/mcp/__init__.py
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loki-mode",
|
|
3
3
|
"mcpName": "io.github.asklokesh/loki-mode",
|
|
4
|
-
"version": "11.
|
|
4
|
+
"version": "11.125.0",
|
|
5
5
|
"description": "An autonomous software factory that knows what it is supposed to deliver, and proves it did.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"agent",
|
|
@@ -161,5 +161,5 @@
|
|
|
161
161
|
"dependencies": {
|
|
162
162
|
"@resvg/resvg-wasm": "^2.6.2"
|
|
163
163
|
},
|
|
164
|
-
"gitHead": "
|
|
164
|
+
"gitHead": "5ba09bd246bf4401ef6afc8c053f78c41b4daa73"
|
|
165
165
|
}
|
|
@@ -9896,6 +9896,18 @@ function classifyExitCause(exit, killed, killCause, tail2, provider) {
|
|
|
9896
9896
|
}
|
|
9897
9897
|
return EXIT_CAUSES[exit] ?? `exit ${exit} (unrecognized code)`;
|
|
9898
9898
|
}
|
|
9899
|
+
function spawnDetached(cmd, args, opts = {}) {
|
|
9900
|
+
try {
|
|
9901
|
+
const c = spawn7(cmd, args, { ...opts, stdio: "ignore", detached: true });
|
|
9902
|
+
c.on("error", () => {});
|
|
9903
|
+
if (!c.pid)
|
|
9904
|
+
return null;
|
|
9905
|
+
c.unref();
|
|
9906
|
+
return c.pid;
|
|
9907
|
+
} catch {
|
|
9908
|
+
return null;
|
|
9909
|
+
}
|
|
9910
|
+
}
|
|
9899
9911
|
var CANCEL_GRACE_MS, DRAIN_MS = 2000, KILL_GRACE_MS2 = 2000, BASH_CLAMP_FLOOR_MS = 30000, BASH_CLAMP_MARGIN_MS = 1e4, MAX_TURNS_EXIT = 98, SECONDS_PER_TURN = 3, MIN_TURNS = 10, POSIX_BASH = "/bin/bash", isExecutable = (p) => {
|
|
9900
9912
|
try {
|
|
9901
9913
|
accessSync(p, fsConstants2.X_OK);
|
|
@@ -27341,8 +27353,25 @@ function criteria(task) {
|
|
|
27341
27353
|
`).map((l) => l.trim()).filter(Boolean)), lines2 = acceptance(kept);
|
|
27342
27354
|
if (kept.every((l) => /^#+\s/.test(l)))
|
|
27343
27355
|
return [];
|
|
27344
|
-
const items2 = lines2.filter((l) => /^([-*+]|\d+[.)])\s+/.test(l)).map((l) => l.replace(/^([-*+]|\d+[.)])\s+(\[[ xX]\]\s*)?/, ""));
|
|
27345
|
-
return more((items2.length > 0 ? items2 : lines2.slice(0, 1)).map(clip4), MAX_CRITERIA2);
|
|
27356
|
+
const items2 = lines2.filter((l) => /^([-*+]|\d+[.)])\s+/.test(l)).map((l) => l.replace(/^([-*+]|\d+[.)])\s+(\[[ xX]\]\s*)?/, "")), numbered = items2.length > 0 ? [] : inlineCriteria(kept);
|
|
27357
|
+
return more((items2.length > 0 ? items2 : numbered.length > 0 ? numbered : lines2.slice(0, 1)).map(clip4), MAX_CRITERIA2);
|
|
27358
|
+
}
|
|
27359
|
+
function inlineCriteria(lines2) {
|
|
27360
|
+
const l = lines2.find((x) => /^acceptance criteria:\s*\(1\)\s/i.test(x));
|
|
27361
|
+
if (!l)
|
|
27362
|
+
return [];
|
|
27363
|
+
const out2 = [];
|
|
27364
|
+
let rest = l.replace(/^acceptance criteria:\s*\(1\)\s*/i, "");
|
|
27365
|
+
for (let k = 2;; k++) {
|
|
27366
|
+
const i = rest.indexOf(`; (${k}) `);
|
|
27367
|
+
if (i < 0) {
|
|
27368
|
+
out2.push(rest.trim());
|
|
27369
|
+
break;
|
|
27370
|
+
}
|
|
27371
|
+
out2.push(rest.slice(0, i).trim());
|
|
27372
|
+
rest = rest.slice(i + `; (${k}) `.length);
|
|
27373
|
+
}
|
|
27374
|
+
return out2.filter(Boolean);
|
|
27346
27375
|
}
|
|
27347
27376
|
function tested(o) {
|
|
27348
27377
|
if (!o.verify)
|
|
@@ -27365,8 +27394,8 @@ function renderReviewerBody(i, env = process.env, version2 = getVersion()) {
|
|
|
27365
27394
|
const task = typeof i.outputs.intake?.["task"] === "string" ? i.outputs.intake["task"] : "", title = typeof i.outputs.intake?.["title"] === "string" ? i.outputs.intake["title"] : "";
|
|
27366
27395
|
const changed = arr3(i.outputs.verify?.["changed_files"]).filter((f) => !WALL_FILE.test(f)), planned = arr3(i.outputs.plan?.["relevant_files"]);
|
|
27367
27396
|
const files = changed.length > 0 ? changed.map((f) => `- ${f}`) : planned.length > 0 ? [`- Files in scope (planned, no diff recorded): ${planned.slice(0, MAX_FILES2).join(", ")}${planned.length > MAX_FILES2 ? ` (+${planned.length - MAX_FILES2} more)` : ""}`] : [], planText = i.outputs.plan?.["plan"];
|
|
27368
|
-
const
|
|
27369
|
-
`)[0] ?? "") || (typeof planText === "string" ? planText.split(`
|
|
27397
|
+
const line1 = (task.split(`
|
|
27398
|
+
`)[0] ?? "").trim(), why = parseSliceHead(line1)?.title || line1 || title || (typeof planText === "string" ? planText.split(`
|
|
27370
27399
|
`).find((l) => l.trim()) ?? "" : "");
|
|
27371
27400
|
const il = intentLine(i.outputs.plan?.["intent_card"]), cr = task ? criteria(task).map((c) => `- ${c}`) : [], asked = cr.length > 0 ? cr : il ? [`- ${clip4(il)}`] : [];
|
|
27372
27401
|
const L = ["## What the issue asked", ...asked.length > 0 ? asked : ["- not recorded"], "", "## What changed and why", `- Why: ${why ? clip4(why) : "not recorded"}`, ...files.length > 0 ? more(files, MAX_FILES2) : ["- Files in scope: not recorded"], ""];
|
|
@@ -28023,6 +28052,7 @@ __export(exports_pr, {
|
|
|
28023
28052
|
runPrReady: () => runPrReady,
|
|
28024
28053
|
runPr: () => runPr,
|
|
28025
28054
|
resolvePrAuthor: () => resolvePrAuthor,
|
|
28055
|
+
prTitle: () => prTitle,
|
|
28026
28056
|
prChildTimeoutMs: () => prChildTimeoutMs,
|
|
28027
28057
|
partialHead: () => partialHead,
|
|
28028
28058
|
issueLink: () => issueLink,
|
|
@@ -28134,6 +28164,28 @@ ${verdict === "VERIFIED" ? "Closes" : "Refs"} ${i.repo}#${i.number}
|
|
|
28134
28164
|
return "";
|
|
28135
28165
|
}
|
|
28136
28166
|
}
|
|
28167
|
+
function prTitle(verdict, runDir, task) {
|
|
28168
|
+
const one = (t) => t.replace(/[\u0000-\u001f\u007f]+/g, " ").replace(/\s+/g, " ").trim();
|
|
28169
|
+
const first = one(task.split(`
|
|
28170
|
+
`).find((l) => l.trim() !== "") ?? "").replace(/^#+\s*/, ""), slice = parseSliceHead(first);
|
|
28171
|
+
let what = slice?.title ?? "", ref = slice ? ` (#${slice.n} ${slice.id})` : "";
|
|
28172
|
+
if (!slice) {
|
|
28173
|
+
try {
|
|
28174
|
+
const i = JSON.parse(readFileSync74(join87(runDir, "issue.json"), "utf8"));
|
|
28175
|
+
if (typeof i.title === "string" && one(i.title)) {
|
|
28176
|
+
what = one(i.title);
|
|
28177
|
+
ref = Number.isInteger(i.number) && i.number > 0 ? ` (#${i.number})` : "";
|
|
28178
|
+
}
|
|
28179
|
+
} catch {}
|
|
28180
|
+
if (!what)
|
|
28181
|
+
what = first;
|
|
28182
|
+
}
|
|
28183
|
+
const head = verdict === "PARTIAL" ? "[PARTIAL] " : "", room = TITLE_MAX - head.length - ref.length;
|
|
28184
|
+
if (!what)
|
|
28185
|
+
return `${head}Loki change${ref}`;
|
|
28186
|
+
const cps = Array.from(what), cut = cps.length <= room ? what : ((short) => `${short.replace(/\s+\S*$/, "") || short}...`)(cps.slice(0, room - 3).join(""));
|
|
28187
|
+
return `${head}${cut}${ref}`;
|
|
28188
|
+
}
|
|
28137
28189
|
function partialHead(verdict, notProven) {
|
|
28138
28190
|
const np2 = verdict === "PARTIAL" ? notProven.filter((r) => r.trim() !== "") : [];
|
|
28139
28191
|
if (np2.length === 0)
|
|
@@ -28167,8 +28219,8 @@ async function runPr(ctx, signal, opts = {}) {
|
|
|
28167
28219
|
${tierBodyLine(tierSealFor(ctx.repoDir, ctx.runId))}
|
|
28168
28220
|
` : "") + intentSection(ctx.outputs().plan) + specPrLine(process.env) + triagePrLine(ctx.outputs().intake) + evidenceSection(seal.receipt_path) + briefSection(ctx) + beforeAfter + (seal.mutation_line ? `
|
|
28169
28221
|
${seal.mutation_line}
|
|
28170
|
-
` : "") + link + stackSection(process.env, base, link !== "") + (ctx.handoffMd ?? ""), "utf8");
|
|
28171
|
-
const title =
|
|
28222
|
+
` : "") + link + stackSection(process.env, base, link !== "", ctx.repoDir) + (ctx.handoffMd ?? ""), "utf8");
|
|
28223
|
+
const title = prTitle(verdict, ctx.runDir, String(ctx.outputs().intake?.task ?? ""));
|
|
28172
28224
|
const scriptPath = opts.pushScriptPath ?? DEFAULT_PUSH_SH;
|
|
28173
28225
|
const env = pushEnv(ctx.repoDir, pinnedOrigin);
|
|
28174
28226
|
opts.onSpawnEnv?.(env);
|
|
@@ -28206,7 +28258,7 @@ ${seal.mutation_line}
|
|
|
28206
28258
|
await (await Promise.resolve().then(() => (init_writeback(), exports_writeback))).writeBack({ phase: "done", verdict, prUrl: url, receiptSha256: seal.receipt_sha256 ?? null, task: String(ctx.outputs().intake?.task ?? "") });
|
|
28207
28259
|
return { status: "completed", data: { pr_url: url, draft, existing, ...notProvenOut.length ? { not_proven: notProvenOut } : {} } };
|
|
28208
28260
|
}
|
|
28209
|
-
var DEFAULT_PUSH_SH, PR_URL_RE, DEFAULT_PUSH_GITLAB_SH, MR_URL_RE, isGitlabOrigin = (o) => /^(?:https:\/\/gitlab\.com\/|git@gitlab\.com:|ssh:\/\/git@gitlab\.com\/)/i.test(o), SHA_RE, stage2;
|
|
28261
|
+
var DEFAULT_PUSH_SH, PR_URL_RE, DEFAULT_PUSH_GITLAB_SH, MR_URL_RE, isGitlabOrigin = (o) => /^(?:https:\/\/gitlab\.com\/|git@gitlab\.com:|ssh:\/\/git@gitlab\.com\/)/i.test(o), SHA_RE, TITLE_MAX = 100, stage2;
|
|
28210
28262
|
var init_pr = __esm(() => {
|
|
28211
28263
|
init_types2();
|
|
28212
28264
|
init_reviewer_brief();
|
|
@@ -38947,7 +38999,7 @@ function decomposeBrief(slug, i, triageReason, outPath, note = "") {
|
|
|
38947
38999
|
}
|
|
38948
39000
|
function sliceTask(slug, epic, s, index2, total, parent) {
|
|
38949
39001
|
return [
|
|
38950
|
-
|
|
39002
|
+
sliceHeadLine(s.id, total, slug, epic.number, s.title),
|
|
38951
39003
|
`This is slice ${index2 + 1} of a larger issue that was split into ${total} pull requests. Implement only this slice.` + (parent ? ` The branch already contains slice ${parent} and everything it depends on.` : ""),
|
|
38952
39004
|
`Acceptance criteria: ${s.acceptance.map((a, k) => `(${k + 1}) ${a}`).join("; ")}`,
|
|
38953
39005
|
s.files.length ? `Likely files: ${s.files.join(", ")}` : "",
|
|
@@ -39083,6 +39135,7 @@ var ID_RE2, MIN_SLICES = 2, MAX_SLICES = 4, oneLine3 = (s) => s.replace(/[\x00-\
|
|
|
39083
39135
|
}, overCapNote = (got) => `Your previous split had ${got} slices but the limit is ${MAX_SLICES}. Merge related slices so the plan has at most ${MAX_SLICES}, and write the corrected JSON object to the file.`, invalidSplitNote = (reason) => `Your previous split was refused: ${oneLine3(reason)}. Fix that and write the corrected JSON object to the file, in the same form.`, stacksOn = (r, needPr = true) => !!r && (!needPr || !!r.pr) && !!r.branch && !/^(FAILED|BLOCKED|SKIPPED)/.test(r.outcome), progressLine = (n3, p) => `#${n3} epic: ${p.done}/${p.total} slices done, ${p.running} running, ${p.waiting} waiting`;
|
|
39084
39136
|
var init_issues_epic = __esm(() => {
|
|
39085
39137
|
init_output();
|
|
39138
|
+
init_run_outputs();
|
|
39086
39139
|
ID_RE2 = /^[A-Za-z0-9_-]{1,32}$/;
|
|
39087
39140
|
});
|
|
39088
39141
|
|
|
@@ -39102,10 +39155,11 @@ __export(exports_issues_run, {
|
|
|
39102
39155
|
issuesRun: () => issuesRun,
|
|
39103
39156
|
coveredIssues: () => coveredIssues,
|
|
39104
39157
|
askYesNo: () => askYesNo,
|
|
39105
|
-
TRIAGE_RE: () => TRIAGE_RE
|
|
39158
|
+
TRIAGE_RE: () => TRIAGE_RE,
|
|
39159
|
+
REAPER_SH: () => REAPER_SH
|
|
39106
39160
|
});
|
|
39107
39161
|
import { spawnSync as spawnSync16 } from "child_process";
|
|
39108
|
-
import { cpSync as cpSync4, existsSync as existsSync80, mkdirSync as mkdirSync59, mkdtempSync as mkdtempSync12, readFileSync as readFileSync101, rmSync as rmSync29, writeFileSync as writeFileSync58 } from "fs";
|
|
39162
|
+
import { cpSync as cpSync4, existsSync as existsSync80, mkdirSync as mkdirSync59, mkdtempSync as mkdtempSync12, readdirSync as readdirSync41, readFileSync as readFileSync101, rmdirSync as rmdirSync2, rmSync as rmSync29, writeFileSync as writeFileSync58 } from "fs";
|
|
39109
39163
|
import { tmpdir as tmpdir17 } from "os";
|
|
39110
39164
|
import { join as join117, resolve as resolve31 } from "path";
|
|
39111
39165
|
import { createInterface as createInterface3 } from "readline";
|
|
@@ -39376,7 +39430,7 @@ ${USAGE}`);
|
|
|
39376
39430
|
return await runWithRetry(d, runDir, `#${n3}`, ref, opts, wt);
|
|
39377
39431
|
} finally {
|
|
39378
39432
|
if (wt)
|
|
39379
|
-
d.worktree.remove(`issue-${n3}`, wt);
|
|
39433
|
+
d.worktree.remove(`issue-${n3}`, wt, runDir);
|
|
39380
39434
|
}
|
|
39381
39435
|
};
|
|
39382
39436
|
const wholeFailed = [];
|
|
@@ -39487,7 +39541,7 @@ async function runOneEpic(d, slug, e, parallel, receiptsDir, pr) {
|
|
|
39487
39541
|
} catch (err) {
|
|
39488
39542
|
res = { rc: 1, output: `runner threw: ${err instanceof Error ? err.message : String(err)}` };
|
|
39489
39543
|
} finally {
|
|
39490
|
-
d.worktree.remove(name, wt);
|
|
39544
|
+
d.worktree.remove(name, wt, receiptsDir);
|
|
39491
39545
|
}
|
|
39492
39546
|
const prUrl = PR_URL_RE2.exec(res.output)?.[0] ?? null;
|
|
39493
39547
|
const budget = res.rc === 3 || /^Outcome:\s+BUDGET_STOP\b/m.test(res.output);
|
|
@@ -39629,20 +39683,31 @@ function makeSessionTriage(repoDir, lokiDir2, provider) {
|
|
|
39629
39683
|
}
|
|
39630
39684
|
function makeWorktrees(repoDir) {
|
|
39631
39685
|
let root = null;
|
|
39686
|
+
const removeNow = (name, p) => {
|
|
39687
|
+
try {
|
|
39688
|
+
safeGit(repoDir, ["worktree", "remove", "--force", p]);
|
|
39689
|
+
safeGit(repoDir, ["branch", "-D", `loki/${name}`]);
|
|
39690
|
+
} catch {
|
|
39691
|
+
rmSync29(p, { recursive: true, force: true });
|
|
39692
|
+
}
|
|
39693
|
+
if (root)
|
|
39694
|
+
try {
|
|
39695
|
+
rmdirSync2(root);
|
|
39696
|
+
} catch {}
|
|
39697
|
+
};
|
|
39632
39698
|
return {
|
|
39633
39699
|
create: (name, base2) => {
|
|
39634
39700
|
root ??= mkdtempSync12(join117(tmpdir17(), "loki-issues-"));
|
|
39701
|
+
mkdirSync59(root, { recursive: true });
|
|
39635
39702
|
const p = join117(root, name);
|
|
39636
39703
|
safeGit(repoDir, ["worktree", "add", "-B", `loki/${name}`, p, base2]);
|
|
39637
39704
|
return p;
|
|
39638
39705
|
},
|
|
39639
|
-
remove: (name, p) => {
|
|
39640
|
-
|
|
39641
|
-
|
|
39642
|
-
|
|
39643
|
-
|
|
39644
|
-
rmSync29(p, { recursive: true, force: true });
|
|
39645
|
-
}
|
|
39706
|
+
remove: (name, p, keep) => {
|
|
39707
|
+
const pids = deepPids(p);
|
|
39708
|
+
if (pids.length && root && spawnDetached("sh", ["-c", REAPER_SH, "loki-reaper", repoDir, p, `loki/${name}`, keep ?? "", root, ...pids.map(String)], { cwd: tmpdir17(), env: process.env }))
|
|
39709
|
+
return;
|
|
39710
|
+
removeNow(name, p);
|
|
39646
39711
|
}
|
|
39647
39712
|
};
|
|
39648
39713
|
}
|
|
@@ -39702,7 +39767,16 @@ var USAGE = `usage: loki issues run [owner/repo] [--label L] [--milestone M] [--
|
|
|
39702
39767
|
const one2 = s.replace(/[\x00-\x1f\x7f|]+/g, " ").trim();
|
|
39703
39768
|
return one2.length > n3 ? `${one2.slice(0, n3 - 3)}...` : one2;
|
|
39704
39769
|
}, lastLine = (s) => s.split(`
|
|
39705
|
-
`).map((l) => l.trim()).filter(Boolean).pop() ?? "", GITHUB_URL_RE, secs = (s) => s < 90 ? `${Math.round(s)}s` : `${Math.round(s / 60)}m`, PR_URL_RE2, noGovernor = async () => ({ ok: true, hold: false, reason: "not consulted" }), TRIAGE_RE
|
|
39770
|
+
`).map((l) => l.trim()).filter(Boolean).pop() ?? "", GITHUB_URL_RE, secs = (s) => s < 90 ? `${Math.round(s)}s` : `${Math.round(s / 60)}m`, PR_URL_RE2, noGovernor = async () => ({ ok: true, hold: false, reason: "not consulted" }), TRIAGE_RE, deepPids = (wt) => {
|
|
39771
|
+
try {
|
|
39772
|
+
return readdirSync41(join117(wt, ".loki", "runs")).flatMap((id) => {
|
|
39773
|
+
const pid = deepPid(join117(wt, ".loki", "runs", id));
|
|
39774
|
+
return pid ? [pid] : [];
|
|
39775
|
+
});
|
|
39776
|
+
} catch {
|
|
39777
|
+
return [];
|
|
39778
|
+
}
|
|
39779
|
+
}, REAPER_SH = 'repo="$1"; wt="$2"; br="$3"; keep="$4"; root="$5"; shift 5; for pid in "$@"; do while kill -0 "$pid" 2>/dev/null; do sleep 2; done; done; if [ -n "$keep" ] && [ -d "$wt/.loki/runs" ]; then for r in "$wt"/.loki/runs/*/; do [ -d "$r" ] || continue; id="$(basename "$r")"; mkdir -p "$keep/receipts/$id" && cp -R "$r". "$keep/receipts/$id/"; done; fi; git -C "$repo" worktree remove --force "$wt" 2>/dev/null || { case "$wt" in "$root"/*) rm -rf -- "$wt"; git -C "$repo" worktree prune;; esac; }; git -C "$repo" branch -D "$br" >/dev/null 2>&1; rmdir "$root" 2>/dev/null; exit 0';
|
|
39706
39780
|
var init_issues_run = __esm(() => {
|
|
39707
39781
|
init_budget_cap();
|
|
39708
39782
|
init_queue();
|
|
@@ -39710,6 +39784,8 @@ var init_issues_run = __esm(() => {
|
|
|
39710
39784
|
init_issues_epic();
|
|
39711
39785
|
init_budget();
|
|
39712
39786
|
init_safe_git();
|
|
39787
|
+
init_base_guard();
|
|
39788
|
+
init_worker_proc();
|
|
39713
39789
|
init_session();
|
|
39714
39790
|
init_decompose();
|
|
39715
39791
|
SLUG_RE2 = /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;
|
|
@@ -39823,7 +39899,7 @@ __export(exports_supervisor, {
|
|
|
39823
39899
|
BACKSTOP_NOT_PROVEN: () => BACKSTOP_NOT_PROVEN,
|
|
39824
39900
|
BACKSTOP_GRACE_S: () => BACKSTOP_GRACE_S
|
|
39825
39901
|
});
|
|
39826
|
-
import {
|
|
39902
|
+
import { spawnSync as spawnSync17 } from "child_process";
|
|
39827
39903
|
import { createHash as createHash33, createPublicKey as createPublicKey4, sign as sign3 } from "crypto";
|
|
39828
39904
|
import { existsSync as existsSync81, mkdirSync as mkdirSync61, readFileSync as readFileSync102, writeFileSync as writeFileSync59 } from "fs";
|
|
39829
39905
|
import { dirname as dirname45, join as join119, relative as relative26, resolve as resolve32 } from "path";
|
|
@@ -40059,12 +40135,10 @@ async function runSupervisor(opts) {
|
|
|
40059
40135
|
} catch (e) {
|
|
40060
40136
|
notProven.push(`deep verify not spawned: ${e.message}`);
|
|
40061
40137
|
}
|
|
40062
|
-
const [cmd2, ...dArgs] = argv ?? [],
|
|
40063
|
-
|
|
40064
|
-
if (child?.pid) {
|
|
40065
|
-
child.unref();
|
|
40138
|
+
const [cmd2, ...dArgs] = argv ?? [], pid = argv && cmd2 ? spawnDetached(cmd2, dArgs, { cwd: opts.repoDir, env: workerEnv }) : null;
|
|
40139
|
+
if (pid) {
|
|
40066
40140
|
log.append("capability.recorded", "deep", { stages: [stageCapability("deep", workerEnv, argv ?? [])] });
|
|
40067
|
-
log.append("deep.started", "deep", { pid
|
|
40141
|
+
log.append("deep.started", "deep", { pid });
|
|
40068
40142
|
} else if (argv)
|
|
40069
40143
|
notProven.push("deep verify not spawned");
|
|
40070
40144
|
}
|
|
@@ -42681,7 +42755,7 @@ __export(exports_dashboard, {
|
|
|
42681
42755
|
modernizeRoute: () => modernizeRoute,
|
|
42682
42756
|
listModernizeIds: () => listModernizeIds
|
|
42683
42757
|
});
|
|
42684
|
-
import { existsSync as existsSync88, readdirSync as
|
|
42758
|
+
import { existsSync as existsSync88, readdirSync as readdirSync42 } from "fs";
|
|
42685
42759
|
import { join as join128 } from "path";
|
|
42686
42760
|
function modernizeDir(repoDir) {
|
|
42687
42761
|
return join128(repoDir, ".loki", "modernize");
|
|
@@ -42690,7 +42764,7 @@ function listModernizeIds(repoDir) {
|
|
|
42690
42764
|
const dir = modernizeDir(repoDir);
|
|
42691
42765
|
if (!existsSync88(dir))
|
|
42692
42766
|
return [];
|
|
42693
|
-
return
|
|
42767
|
+
return readdirSync42(dir, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name).sort();
|
|
42694
42768
|
}
|
|
42695
42769
|
function summarizeModernize(repoDir, mid) {
|
|
42696
42770
|
const events2 = readModernizeEvents(repoDir, mid);
|
|
@@ -43456,7 +43530,7 @@ var init_seal2 = __esm(() => {
|
|
|
43456
43530
|
|
|
43457
43531
|
// ../../loki-ts/src/engine10/modernize/oracle/search.ts
|
|
43458
43532
|
import { spawnSync as spawnSync20 } from "child_process";
|
|
43459
|
-
import { copyFileSync as copyFileSync9, existsSync as existsSync90, linkSync as linkSync4, mkdirSync as mkdirSync69, mkdtempSync as mkdtempSync16, readFileSync as readFileSync112, renameSync as renameSync23, rmSync as rmSync33, rmdirSync as
|
|
43533
|
+
import { copyFileSync as copyFileSync9, existsSync as existsSync90, linkSync as linkSync4, mkdirSync as mkdirSync69, mkdtempSync as mkdtempSync16, readFileSync as readFileSync112, renameSync as renameSync23, rmSync as rmSync33, rmdirSync as rmdirSync3, writeFileSync as writeFileSync65 } from "fs";
|
|
43460
43534
|
import { tmpdir as tmpdir21 } from "os";
|
|
43461
43535
|
import { basename as basename34, dirname as dirname51, join as join132 } from "path";
|
|
43462
43536
|
function search(unitSource, seedCases, propose, runCapture, opts = {}) {
|
|
@@ -43661,7 +43735,7 @@ function captureUnitOracle(a) {
|
|
|
43661
43735
|
rmSync33(join132(dir, "coverage.json"), { force: true });
|
|
43662
43736
|
for (const p of created) {
|
|
43663
43737
|
try {
|
|
43664
|
-
|
|
43738
|
+
rmdirSync3(p);
|
|
43665
43739
|
} catch {
|
|
43666
43740
|
break;
|
|
43667
43741
|
}
|
|
@@ -44672,7 +44746,7 @@ var init_presealed_wall = __esm(() => {
|
|
|
44672
44746
|
// ../../loki-ts/src/engine10/modernize/unit.ts
|
|
44673
44747
|
import { spawnSync as spawnSync21 } from "child_process";
|
|
44674
44748
|
import { createHash as createHash36 } from "crypto";
|
|
44675
|
-
import { lstatSync as lstatSync29, readFileSync as readFileSync117, readdirSync as
|
|
44749
|
+
import { lstatSync as lstatSync29, readFileSync as readFileSync117, readdirSync as readdirSync43, readlinkSync as readlinkSync6, realpathSync as realpathSync32, rmSync as rmSync34 } from "fs";
|
|
44676
44750
|
import { tmpdir as tmpdir22 } from "os";
|
|
44677
44751
|
import { join as join137, sep as sep21 } from "path";
|
|
44678
44752
|
function isSealedName(rel) {
|
|
@@ -44682,7 +44756,7 @@ function purgePycache(dir) {
|
|
|
44682
44756
|
const walk = (d) => {
|
|
44683
44757
|
let ents;
|
|
44684
44758
|
try {
|
|
44685
|
-
ents =
|
|
44759
|
+
ents = readdirSync43(d, { withFileTypes: true });
|
|
44686
44760
|
} catch {
|
|
44687
44761
|
return;
|
|
44688
44762
|
}
|
|
@@ -44738,7 +44812,7 @@ function outsideTargetDigest(dir, full) {
|
|
|
44738
44812
|
if (st.isDirectory()) {
|
|
44739
44813
|
let names = [];
|
|
44740
44814
|
try {
|
|
44741
|
-
names =
|
|
44815
|
+
names = readdirSync43(p).sort();
|
|
44742
44816
|
} catch {
|
|
44743
44817
|
h.update("unreadable");
|
|
44744
44818
|
}
|
|
@@ -44765,7 +44839,7 @@ function conformanceHashes(dir) {
|
|
|
44765
44839
|
const walk = (sub2, inSkip) => {
|
|
44766
44840
|
let ents;
|
|
44767
44841
|
try {
|
|
44768
|
-
ents =
|
|
44842
|
+
ents = readdirSync43(join137(dir, sub2), { withFileTypes: true });
|
|
44769
44843
|
} catch {
|
|
44770
44844
|
return;
|
|
44771
44845
|
}
|
|
@@ -46432,7 +46506,7 @@ var init_undo = __esm(() => {
|
|
|
46432
46506
|
});
|
|
46433
46507
|
|
|
46434
46508
|
// ../../loki-ts/src/commands/run_status.ts
|
|
46435
|
-
import { existsSync as existsSync97, readdirSync as
|
|
46509
|
+
import { existsSync as existsSync97, readdirSync as readdirSync44, readFileSync as readFileSync123, statSync as statSync39 } from "fs";
|
|
46436
46510
|
import { basename as basename35, dirname as dirname53, join as join142, resolve as resolve37 } from "path";
|
|
46437
46511
|
function runsRoot(env, repoDir) {
|
|
46438
46512
|
return env.LOKI_DIR ? join142(resolve37(repoDir, env.LOKI_DIR), "runs") : join142(repoDir, ".loki", "runs");
|
|
@@ -46440,7 +46514,7 @@ function runsRoot(env, repoDir) {
|
|
|
46440
46514
|
function listRunIds(root) {
|
|
46441
46515
|
if (!existsSync97(root))
|
|
46442
46516
|
return [];
|
|
46443
|
-
return
|
|
46517
|
+
return readdirSync44(root, { withFileTypes: true }).filter((d) => d.isDirectory() && d.name !== LEGACY_BRANCHES_DIR).map((d) => d.name).sort();
|
|
46444
46518
|
}
|
|
46445
46519
|
function latestRunId(root) {
|
|
46446
46520
|
const ids = listRunIds(root);
|
|
@@ -46482,13 +46556,15 @@ __export(exports_base_guard, {
|
|
|
46482
46556
|
finishDeferredRun: () => finishDeferredRun,
|
|
46483
46557
|
envChangedSince: () => envChangedSince,
|
|
46484
46558
|
depsSeeHead: () => depsSeeHead,
|
|
46559
|
+
deepPid: () => deepPid,
|
|
46560
|
+
deepAlive: () => deepAlive,
|
|
46485
46561
|
baseLine: () => baseLine,
|
|
46486
46562
|
baseDepsLinker: () => baseDepsLinker,
|
|
46487
46563
|
addedSymlinkNotes: () => addedSymlinkNotes
|
|
46488
46564
|
});
|
|
46489
46565
|
import { execFileSync as execFileSync9 } from "child_process";
|
|
46490
46566
|
import { createHash as createHash39 } from "crypto";
|
|
46491
|
-
import { existsSync as existsSync98, mkdirSync as mkdirSync73, mkdtempSync as mkdtempSync19, readdirSync as
|
|
46567
|
+
import { existsSync as existsSync98, mkdirSync as mkdirSync73, mkdtempSync as mkdtempSync19, readdirSync as readdirSync45, readFileSync as readFileSync124, readlinkSync as readlinkSync7, realpathSync as realpathSync34, rmSync as rmSync37, statSync as statSync40, symlinkSync as symlinkSync4, utimesSync, writeFileSync as writeFileSync71 } from "fs";
|
|
46492
46568
|
import { tmpdir as tmpdir25 } from "os";
|
|
46493
46569
|
import { basename as basename36, dirname as dirname54, join as join143, relative as relative28, resolve as resolve38, sep as sep23 } from "path";
|
|
46494
46570
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
@@ -46611,7 +46687,7 @@ function depsSeeHead(pkgDir, repoDir) {
|
|
|
46611
46687
|
}
|
|
46612
46688
|
let seen = 0;
|
|
46613
46689
|
const walk = (dir, own) => {
|
|
46614
|
-
for (const e of
|
|
46690
|
+
for (const e of readdirSync45(dir, { withFileTypes: true })) {
|
|
46615
46691
|
if (++seen > WALK_BOUND)
|
|
46616
46692
|
return true;
|
|
46617
46693
|
const p = join143(dir, e.name);
|
|
@@ -46958,18 +47034,19 @@ var exists2 = (repoDir, ref) => git13(repoDir, ["rev-parse", "--verify", "-q", `
|
|
|
46958
47034
|
} catch {
|
|
46959
47035
|
return null;
|
|
46960
47036
|
}
|
|
46961
|
-
}, keepRunBranch = (env = process.env) => env.LOKI_KEEP_RUN_BRANCH === "1",
|
|
47037
|
+
}, keepRunBranch = (env = process.env) => env.LOKI_KEEP_RUN_BRANCH === "1", deepPid = (runDir) => {
|
|
47038
|
+
let pid;
|
|
46962
47039
|
try {
|
|
46963
|
-
|
|
47040
|
+
pid = readFileSync124(join143(runDir, "events.jsonl"), "utf8").split(`
|
|
46964
47041
|
`).filter((l) => l.includes('"deep.started"')).map((l) => Number(JSON.parse(l).data?.pid)).pop();
|
|
46965
47042
|
if (!pid || !Number.isInteger(pid) || pid <= 1)
|
|
46966
|
-
return
|
|
47043
|
+
return null;
|
|
46967
47044
|
process.kill(pid, 0);
|
|
46968
|
-
return
|
|
47045
|
+
return pid;
|
|
46969
47046
|
} catch (e) {
|
|
46970
|
-
return e.code === "EPERM";
|
|
47047
|
+
return pid && e.code === "EPERM" ? pid : null;
|
|
46971
47048
|
}
|
|
46972
|
-
}, runLive = (runDir) => runOwnerAlive(runDir) || deepAlive(runDir), readRecord = (file) => {
|
|
47049
|
+
}, deepAlive = (runDir) => deepPid(runDir) !== null, runLive = (runDir) => runOwnerAlive(runDir) || deepAlive(runDir), readRecord = (file) => {
|
|
46973
47050
|
try {
|
|
46974
47051
|
return JSON.parse(readFileSync124(file, "utf8"));
|
|
46975
47052
|
} catch {
|
|
@@ -89173,7 +89250,7 @@ __export(exports_session, {
|
|
|
89173
89250
|
PROVIDER_DEFAULT_MODEL: () => PROVIDER_DEFAULT_MODEL,
|
|
89174
89251
|
HEARTBEAT_MS_DEFAULT: () => HEARTBEAT_MS_DEFAULT
|
|
89175
89252
|
});
|
|
89176
|
-
import { spawn as
|
|
89253
|
+
import { spawn as spawn13 } from "child_process";
|
|
89177
89254
|
import { copyFileSync as copyFileSync10, existsSync as existsSync103, mkdirSync as mkdirSync78, readFileSync as readFileSync129, writeFileSync as writeFileSync73, writeSync as writeSync4 } from "fs";
|
|
89178
89255
|
import { dirname as dirname58, join as join148 } from "path";
|
|
89179
89256
|
function resolveModel(provider) {
|
|
@@ -89348,7 +89425,7 @@ function createSessionRunner(cfg) {
|
|
|
89348
89425
|
];
|
|
89349
89426
|
const sessionId = opts.iterationId;
|
|
89350
89427
|
const guardSnap = isGuarded(cfg.provider) && cfg.lokiRoot ? beginGuard(opts.cwd ?? process.cwd(), cfg.lokiRoot) : null;
|
|
89351
|
-
const child =
|
|
89428
|
+
const child = spawn13(cmd2, args, { cwd: opts.cwd, env: envWithPwd(env, opts.cwd), detached: true, stdio: ["ignore", "pipe", "pipe"] });
|
|
89352
89429
|
const pgid = child.pid;
|
|
89353
89430
|
let stdout = "";
|
|
89354
89431
|
child.stdout?.on("data", (d) => {
|
|
@@ -89473,7 +89550,7 @@ var init_session = __esm(() => {
|
|
|
89473
89550
|
});
|
|
89474
89551
|
|
|
89475
89552
|
// ../../loki-ts/src/runner/session_resume.ts
|
|
89476
|
-
import { existsSync as existsSync104, mkdirSync as mkdirSync79, readdirSync as
|
|
89553
|
+
import { existsSync as existsSync104, mkdirSync as mkdirSync79, readdirSync as readdirSync47, readFileSync as readFileSync130, renameSync as renameSync25, rmSync as rmSync40, writeFileSync as writeFileSync74 } from "fs";
|
|
89477
89554
|
import { basename as basename39, dirname as dirname59, join as join149 } from "path";
|
|
89478
89555
|
function readFirstTurnTokens(repoDir, iterationId) {
|
|
89479
89556
|
try {
|
|
@@ -89514,7 +89591,7 @@ function sessionFilePath(repoDir, iterationId) {
|
|
|
89514
89591
|
function migrateSessionFiles(repoDir, isLive = () => false) {
|
|
89515
89592
|
let moved = 0, names = [];
|
|
89516
89593
|
try {
|
|
89517
|
-
names =
|
|
89594
|
+
names = readdirSync47(join149(repoDir, ".loki")).filter((n10) => /^e10-session-.+\.json$/.test(n10));
|
|
89518
89595
|
} catch {
|
|
89519
89596
|
return 0;
|
|
89520
89597
|
}
|
|
@@ -90087,6 +90164,7 @@ __export(exports_run_outputs, {
|
|
|
90087
90164
|
stageCheckpoints: () => stageCheckpoints,
|
|
90088
90165
|
stackSection: () => stackSection,
|
|
90089
90166
|
stackBase: () => stackBase,
|
|
90167
|
+
sliceHeadLine: () => sliceHeadLine,
|
|
90090
90168
|
seededCorpusBlock: () => seededCorpusBlock,
|
|
90091
90169
|
seedResumeCtx: () => seedResumeCtx,
|
|
90092
90170
|
sealRefusal: () => sealRefusal,
|
|
@@ -90101,10 +90179,12 @@ __export(exports_run_outputs, {
|
|
|
90101
90179
|
resumeFlag: () => resumeFlag,
|
|
90102
90180
|
renderMainOutput: () => renderMainOutput,
|
|
90103
90181
|
receiptSealAccuracy: () => receiptSealAccuracy,
|
|
90182
|
+
prWorkflowsSkipping: () => prWorkflowsSkipping,
|
|
90104
90183
|
prGate: () => prGate,
|
|
90105
90184
|
policyGate: () => policyGate,
|
|
90106
90185
|
policyFile: () => policyFile,
|
|
90107
90186
|
phaseOf: () => phaseOf,
|
|
90187
|
+
parseSliceHead: () => parseSliceHead,
|
|
90108
90188
|
parseRecoveryChoice: () => parseRecoveryChoice,
|
|
90109
90189
|
outputsFromEvents: () => outputsFromEvents,
|
|
90110
90190
|
nextStepText: () => nextStepText,
|
|
@@ -90128,7 +90208,7 @@ __export(exports_run_outputs, {
|
|
|
90128
90208
|
});
|
|
90129
90209
|
import { execFile as execFile3, spawnSync as spawnSync24 } from "child_process";
|
|
90130
90210
|
import { createHash as createHash41 } from "crypto";
|
|
90131
|
-
import { existsSync as existsSync106, lstatSync as lstatSync32, mkdirSync as mkdirSync81, readdirSync as
|
|
90211
|
+
import { existsSync as existsSync106, lstatSync as lstatSync32, mkdirSync as mkdirSync81, readdirSync as readdirSync48, readFileSync as readFileSync132, statSync as statSync44, writeFileSync as writeFileSync76 } from "fs";
|
|
90132
90212
|
import { basename as basename41, join as join151, resolve as resolve42 } from "path";
|
|
90133
90213
|
function intentRevisionsBlock(revs) {
|
|
90134
90214
|
const r = (revs ?? []).filter((r10) => r10.unapplied !== true).map(({ rev, source, actor, sha: sha6 }) => ({ rev, source, actor, sha: sha6 }));
|
|
@@ -90306,7 +90386,7 @@ function findInterrupted(repoDir, runId2, includeCancelled = false, why) {
|
|
|
90306
90386
|
const root = join151(repoDir, ".loki", "runs");
|
|
90307
90387
|
let ids = [];
|
|
90308
90388
|
try {
|
|
90309
|
-
ids = runId2 ? [runId2] :
|
|
90389
|
+
ids = runId2 ? [runId2] : readdirSync48(root);
|
|
90310
90390
|
} catch {
|
|
90311
90391
|
return null;
|
|
90312
90392
|
}
|
|
@@ -91004,14 +91084,58 @@ function stackBase(env) {
|
|
|
91004
91084
|
return;
|
|
91005
91085
|
return /^[A-Za-z0-9][A-Za-z0-9._/-]{0,200}$/.test(b) && !b.includes("..") && !b.includes("//") && !b.endsWith("/") && !b.endsWith(".lock") ? b : null;
|
|
91006
91086
|
}
|
|
91007
|
-
function
|
|
91087
|
+
function parseSliceHead(line2) {
|
|
91088
|
+
const m = /^Slice (\S+) of \d+ for ([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+)#(\d+): (.+)$/.exec(line2.trim());
|
|
91089
|
+
return m ? { id: m[1], slug: m[2], n: Number(m[3]), title: m[4].trim() } : null;
|
|
91090
|
+
}
|
|
91091
|
+
function stackSection(env, base2, hasIssueLink, repoDir) {
|
|
91008
91092
|
const r = env.LOKI_PR_REFS ?? "";
|
|
91009
91093
|
const refs = !hasIssueLink && /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+#\d+$/.test(r) ? `
|
|
91010
91094
|
Refs ${r}
|
|
91095
|
+
` : "";
|
|
91096
|
+
const skip = base2 && repoDir ? prWorkflowsSkipping(repoDir, base2) : [];
|
|
91097
|
+
const ci3 = skip.length ? `
|
|
91098
|
+
CI: this repository's pull request workflows (${skip.join(", ")}) do not run for a pull request into \`${base2}\`, so this one shows no CI checks yet. They run once it targets the default branch: GitHub retargets it when the pull request above merges and its branch is deleted.
|
|
91011
91099
|
` : "";
|
|
91012
91100
|
return refs + (base2 ? `
|
|
91013
91101
|
Stacked on \`${base2}\`: review and merge that pull request first.
|
|
91014
|
-
` : "");
|
|
91102
|
+
` : "") + ci3;
|
|
91103
|
+
}
|
|
91104
|
+
function prWorkflowsSkipping(repoDir, base2) {
|
|
91105
|
+
const glob = (g10) => new RegExp(`^${g10.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*\*/g, "\x00").replace(/\*/g, "[^/]*").replace(/\u0000/g, ".*")}$`);
|
|
91106
|
+
const hit2 = (v) => (typeof v === "string" ? [v] : Array.isArray(v) ? v : []).some((g10) => typeof g10 === "string" && glob(g10).test(base2));
|
|
91107
|
+
const dir = join151(repoDir, ".github", "workflows"), skips = [];
|
|
91108
|
+
let runs2 = false;
|
|
91109
|
+
let files = [];
|
|
91110
|
+
try {
|
|
91111
|
+
files = readdirSync48(dir).filter((f) => /\.ya?ml$/.test(f)).sort();
|
|
91112
|
+
} catch {
|
|
91113
|
+
return [];
|
|
91114
|
+
}
|
|
91115
|
+
for (const f of files) {
|
|
91116
|
+
let doc;
|
|
91117
|
+
try {
|
|
91118
|
+
doc = Bun.YAML.parse(readFileSync132(join151(dir, f), "utf8"));
|
|
91119
|
+
} catch {
|
|
91120
|
+
return [];
|
|
91121
|
+
}
|
|
91122
|
+
const on2 = doc?.["on"] ?? doc?.[true];
|
|
91123
|
+
const target = on2 === "pull_request_target" || Array.isArray(on2) && on2.includes("pull_request_target") || typeof on2 === "object" && on2 !== null && !Array.isArray(on2) && "pull_request_target" in on2;
|
|
91124
|
+
if (target) {
|
|
91125
|
+
runs2 = true;
|
|
91126
|
+
continue;
|
|
91127
|
+
}
|
|
91128
|
+
const has2 = on2 === "pull_request" || Array.isArray(on2) && on2.includes("pull_request") || typeof on2 === "object" && on2 !== null && !Array.isArray(on2) && "pull_request" in on2;
|
|
91129
|
+
if (!has2)
|
|
91130
|
+
continue;
|
|
91131
|
+
const pr2 = typeof on2 === "object" && on2 !== null && !Array.isArray(on2) ? on2["pull_request"] : null;
|
|
91132
|
+
const branches = pr2?.["branches"], ignore = pr2?.["branches-ignore"];
|
|
91133
|
+
if (branches !== undefined && !hit2(branches) || branches === undefined && hit2(ignore))
|
|
91134
|
+
skips.push(f);
|
|
91135
|
+
else
|
|
91136
|
+
runs2 = true;
|
|
91137
|
+
}
|
|
91138
|
+
return runs2 ? [] : skips;
|
|
91015
91139
|
}
|
|
91016
91140
|
function tierSealFor(repoDir, runId2) {
|
|
91017
91141
|
const root = join151(repoDir, ".loki", "runs"), shape = shapeKeyForRun(repoDir, join151(root, basename41(runId2))), receipts = [], read3 = (d) => {
|
|
@@ -91024,7 +91148,7 @@ function tierSealFor(repoDir, runId2) {
|
|
|
91024
91148
|
};
|
|
91025
91149
|
let dirs = [];
|
|
91026
91150
|
try {
|
|
91027
|
-
dirs =
|
|
91151
|
+
dirs = readdirSync48(root).sort().slice(-200);
|
|
91028
91152
|
} catch {}
|
|
91029
91153
|
for (const d of dirs) {
|
|
91030
91154
|
const own = shapeKeyForRun(repoDir, join151(root, d), true), receipt = own === null ? null : read3(d);
|
|
@@ -91156,7 +91280,7 @@ var SEAL_ACCURACY_NOT_MEASURED = "Seal accuracy: not measured", SEAL_ACCURACY_MA
|
|
|
91156
91280
|
} finally {
|
|
91157
91281
|
rl2.close();
|
|
91158
91282
|
}
|
|
91159
|
-
}, STATUS_MARKER = "<!-- loki-status -->", plain = (t) => t.replace(/[\x00-\x1f\x7f]+/g, " ").replace(/[<>`@]/g, " ").slice(0, 500), summaryTier = (repoDir, runId2, tampered) => tampered ? undefined : tierSealFor(repoDir, runId2);
|
|
91283
|
+
}, STATUS_MARKER = "<!-- loki-status -->", plain = (t) => t.replace(/[\x00-\x1f\x7f]+/g, " ").replace(/[<>`@]/g, " ").slice(0, 500), sliceHeadLine = (id2, total, slug, n10, title) => `Slice ${id2} of ${total} for ${slug}#${n10}: ${title}`, summaryTier = (repoDir, runId2, tampered) => tampered ? undefined : tierSealFor(repoDir, runId2);
|
|
91160
91284
|
var init_run_outputs = __esm(() => {
|
|
91161
91285
|
init_worker_proc();
|
|
91162
91286
|
init_events();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
|
|
3
3
|
"name": "loki-mode",
|
|
4
4
|
"displayName": "Loki Mode",
|
|
5
|
-
"version": "11.
|
|
5
|
+
"version": "11.125.0",
|
|
6
6
|
"description": "Autonomous spec-to-product build system with a built-in trust layer (RARV-C closure loop, 8 quality gates, completion council). Ships Loki's spec-hardening, drift-detection, and deterministic PR verification commands plus the Loki MCP server.",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Autonomi",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as L,r as x,j as e,w as re,Z as ne,m as le,h as ie,p as P,F as ye,U as I,X as ce,L as de,x as oe,M as Ae,T as Z,S as we,l as xe,k as me,y as Ce,E as Fe,a0 as Se,a as U,a2 as he}from"./index-
|
|
1
|
+
import{c as L,r as x,j as e,w as re,Z as ne,m as le,h as ie,p as P,F as ye,U as I,X as ce,L as de,x as oe,M as Ae,T as Z,S as we,l as xe,k as me,y as Ce,E as Fe,a0 as Se,a as U,a2 as he}from"./index-kTHVz24w.js";import{B as C}from"./Button-DCLg6fL2.js";import{T as $e}from"./trending-up-pD6jXeWg.js";import{C as z}from"./clock-CHnczWRf.js";import{A as Be,U as ue,M as De}from"./Avatar-BhJZyVKb.js";import{A as J}from"./activity-Cu72vUFn.js";import{R as pe}from"./refresh-cw-Cbi26Fcs.js";import{G as ze}from"./globe-Bto5vosI.js";import{C as Le}from"./chevron-left-BNofLtza.js";import{C as je}from"./check-DU0DutJ9.js";import{D as Y}from"./dollar-sign-NAdnxWrK.js";import{U as Te}from"./user-D_rqqHLB.js";import{D as Me}from"./database-B_IJNpmx.js";import{L as Ue}from"./lock-0A8jdC7f.js";import{S as Re}from"./scroll-text-C2ekJBvD.js";import{S as Ie}from"./shield-alert-5DAr2N-t.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./index-
|
|
1
|
+
import{j as e}from"./index-kTHVz24w.js";import{C as r}from"./clock-CHnczWRf.js";import{C as a}from"./circle-alert-Bcy_6fp6.js";import{C as l}from"./check-DU0DutJ9.js";const i={completed:"bg-[#1FC5A8]/10 text-[#1FC5A8]",running:"bg-[#553DE9]/10 text-[#553DE9]",failed:"bg-[#C45B5B]/10 text-[#C45B5B]",started:"bg-[#D4A03C]/10 text-[#D4A03C]",empty:"bg-[#F8F4F0] text-[#6B6960]",version:"bg-[#553DE9]/10 text-[#553DE9]"};function o({status:t}){switch(t){case"completed":return e.jsx(l,{size:12});case"running":return e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"animate-ping motion-reduce:animate-none absolute inline-flex h-full w-full rounded-full bg-current opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-current"})]});case"failed":return e.jsx(a,{size:12});case"started":return e.jsx(r,{size:12});default:return null}}function f({status:t,children:n,className:s=""}){return e.jsxs("span",{className:["inline-flex items-center gap-1 rounded-btn px-2.5 py-0.5 text-xs font-semibold",i[t],s].filter(Boolean).join(" "),children:[e.jsx(o,{status:t}),n]})}export{f as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as p,j as t}from"./index-
|
|
1
|
+
import{r as p,j as t}from"./index-kTHVz24w.js";const m={primary:"bg-[#553DE9] text-white hover:bg-[#4432c4] shadow-button rounded-btn",secondary:"border border-[#553DE9] text-[#553DE9] hover:bg-[#E8E4FD] bg-transparent rounded-btn",ghost:"text-[#36342E] hover:bg-[#F8F4F0] rounded-btn",danger:"bg-[#C45B5B]/10 text-[#C45B5B] border border-[#C45B5B]/20 hover:bg-[#C45B5B]/20 rounded-btn"},b={sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},u={sm:14,md:16,lg:18};function h({size:e}){return t.jsxs("svg",{className:"animate-spin",width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}const B=p.forwardRef(({variant:e="primary",size:o="md",icon:n,iconRight:i,loading:r=!1,disabled:a,className:c="",children:l,...x},d)=>{const s=u[o];return t.jsxs("button",{ref:d,disabled:a||r,className:["inline-flex items-center justify-center gap-2 font-medium transition-colors",m[e],b[o],(a||r)&&"opacity-60 cursor-not-allowed",c].filter(Boolean).join(" "),...x,children:[r?t.jsx(h,{size:s}):n?t.jsx(n,{size:s}):null,l,i&&!r&&t.jsx(i,{size:s})]})});B.displayName="Button";export{B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as $,r as l,j as e,G as we,Q as Se,F as Ce,h as Re,T as U,Z as Ee,a as S,V as Me,S as $e,Y as Te,X as Pe,P as ie,i as Ae,g as ze,C as Ie,l as Le,N as I,J as _e,K as De,O as Fe,u as Oe}from"./index-
|
|
1
|
+
import{c as $,r as l,j as e,G as we,Q as Se,F as Ce,h as Re,T as U,Z as Ee,a as S,V as Me,S as $e,Y as Te,X as Pe,P as ie,i as Ae,g as ze,C as Ie,l as Le,N as I,J as _e,K as De,O as Fe,u as Oe}from"./index-kTHVz24w.js";import{P as K,S as He,E as Be}from"./ErrorBoundary-2kfwYHs_.js";import{C as qe,F as Ge,M as Ue,H as Ke,a as We,G as Ve,T as Qe}from"./thumbs-up-CGb4Hujd.js";import{C as oe}from"./check-DU0DutJ9.js";import{C as Ye}from"./clock-CHnczWRf.js";import{D as Xe}from"./dollar-sign-NAdnxWrK.js";import{U as Ze}from"./upload-Iv0MU_85.js";import{L as V}from"./loader-circle-B1-sHf-g.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|