overlane 0.1.143 → 0.1.145
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/overlane.mjs +664 -411
- package/package.json +1 -1
- package/plugins/claude/plugins/mvrx-harness/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/plugins/mvrx-harness/hooks/hooks.json +24 -1
- package/plugins/claude/plugins/mvrx-harness/scripts/harness-codemap.mjs +1 -1
- package/plugins/claude/plugins/mvrx-harness/scripts/harness-context.mjs +1 -1
- package/plugins/claude/plugins/mvrx-harness/scripts/harness-guard.mjs +1 -1
- package/plugins/claude/plugins/mvrx-harness/scripts/harness-intake.mjs +1 -1
- package/plugins/claude/plugins/mvrx-harness/scripts/harness-overlay.mjs +66 -0
- package/plugins/claude/plugins/mvrx-harness/scripts/harness-quota.mjs +1 -1
- package/plugins/claude/plugins/mvrx-harness/scripts/harness-statusline.mjs +1 -1
- package/plugins/claude/plugins/mvrx-harness/scripts/harness-stop.mjs +1 -1
- package/plugins/codex/plugins/mvrx-harness/.codex-plugin/plugin.json +1 -1
- package/plugins/codex/plugins/mvrx-harness/scripts/harness-codemap.mjs +1 -1
- package/plugins/codex/plugins/mvrx-harness/scripts/harness-context.mjs +1 -1
- package/plugins/codex/plugins/mvrx-harness/scripts/harness-guard.mjs +1 -1
- package/plugins/codex/plugins/mvrx-harness/scripts/harness-intake.mjs +1 -1
- package/plugins/codex/plugins/mvrx-harness/scripts/harness-overlay.mjs +66 -0
- package/plugins/codex/plugins/mvrx-harness/scripts/harness-quota.mjs +1 -1
- package/plugins/codex/plugins/mvrx-harness/scripts/harness-statusline.mjs +1 -1
- package/plugins/codex/plugins/mvrx-harness/scripts/harness-stop.mjs +1 -1
- package/plugins/release-manifest.json +33 -23
package/dist/overlane.mjs
CHANGED
|
@@ -3446,7 +3446,7 @@ var init_schemas = __esm({
|
|
|
3446
3446
|
}
|
|
3447
3447
|
return propValues;
|
|
3448
3448
|
});
|
|
3449
|
-
const
|
|
3449
|
+
const isObject4 = isObject;
|
|
3450
3450
|
const catchall = def.catchall;
|
|
3451
3451
|
let value;
|
|
3452
3452
|
const memo3 = globalConfig.memoizer;
|
|
@@ -3454,7 +3454,7 @@ var init_schemas = __esm({
|
|
|
3454
3454
|
inst._zod.parse = (payload, ctx) => {
|
|
3455
3455
|
value ?? (value = _normalized.value);
|
|
3456
3456
|
const input2 = payload.value;
|
|
3457
|
-
if (!
|
|
3457
|
+
if (!isObject4(input2)) {
|
|
3458
3458
|
payload.issues.push({
|
|
3459
3459
|
expected: "object",
|
|
3460
3460
|
code: "invalid_type",
|
|
@@ -3590,7 +3590,7 @@ var init_schemas = __esm({
|
|
|
3590
3590
|
return doc.compile();
|
|
3591
3591
|
};
|
|
3592
3592
|
let fastpass;
|
|
3593
|
-
const
|
|
3593
|
+
const isObject4 = isObject;
|
|
3594
3594
|
const jit = !globalConfig.jitless;
|
|
3595
3595
|
const allowsEval2 = allowsEval;
|
|
3596
3596
|
const fastEnabled = jit && allowsEval2.value;
|
|
@@ -3599,7 +3599,7 @@ var init_schemas = __esm({
|
|
|
3599
3599
|
inst._zod.parse = (payload, ctx) => {
|
|
3600
3600
|
value ?? (value = _normalized.value);
|
|
3601
3601
|
const input2 = payload.value;
|
|
3602
|
-
if (!
|
|
3602
|
+
if (!isObject4(input2)) {
|
|
3603
3603
|
payload.issues.push({
|
|
3604
3604
|
expected: "object",
|
|
3605
3605
|
code: "invalid_type",
|
|
@@ -8993,8 +8993,8 @@ var capitalizeFirstCharacter, error33;
|
|
|
8993
8993
|
var init_lt = __esm({
|
|
8994
8994
|
"../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/lt.js"() {
|
|
8995
8995
|
init_util();
|
|
8996
|
-
capitalizeFirstCharacter = (
|
|
8997
|
-
return
|
|
8996
|
+
capitalizeFirstCharacter = (text2) => {
|
|
8997
|
+
return text2.charAt(0).toUpperCase() + text2.slice(1);
|
|
8998
8998
|
};
|
|
8999
8999
|
error33 = () => {
|
|
9000
9000
|
const Sizable = {
|
|
@@ -20701,7 +20701,7 @@ var init_code_map = __esm({
|
|
|
20701
20701
|
CODE_MAP_BASES = ["gate-07-failed", "gate-07-passed", "spec-default-provisional", "spec-default", "project-setting"];
|
|
20702
20702
|
CodeMapDefault = external_exports.object({ setting: CodeMapSetting, on: external_exports.boolean(), basis: external_exports.enum(CODE_MAP_BASES), reason: external_exports.string().min(1), gate07: Gate07Verdict }).strict();
|
|
20703
20703
|
CODE_MAP_CHARS_PER_TOKEN = 2.3;
|
|
20704
|
-
estimateCodeMapTokens = (
|
|
20704
|
+
estimateCodeMapTokens = (text2) => Math.ceil(text2.length * 10 / (CODE_MAP_CHARS_PER_TOKEN * 10));
|
|
20705
20705
|
CODE_MAP_CONTEXT_SETTINGS = ["default", "on", "off"];
|
|
20706
20706
|
CodeMapContextSetting = external_exports.enum(CODE_MAP_CONTEXT_SETTINGS);
|
|
20707
20707
|
CODE_MAP_INTENTS = ["read-only", "edit", "unknown"];
|
|
@@ -20782,7 +20782,7 @@ var init_context_packet = __esm({
|
|
|
20782
20782
|
}).strict();
|
|
20783
20783
|
SkillSummary = external_exports.object({
|
|
20784
20784
|
name: external_exports.string().regex(/^[a-z0-9][a-z0-9-]*$/, "skill names are lowercase kebab-case"),
|
|
20785
|
-
description: external_exports.string().min(1).max(200).refine((
|
|
20785
|
+
description: external_exports.string().min(1).max(200).refine((text2) => !/[\r\n]/.test(text2), "description must be one line")
|
|
20786
20786
|
}).strict();
|
|
20787
20787
|
ContextPacket = external_exports.object({
|
|
20788
20788
|
tenantId: TenantId,
|
|
@@ -21299,9 +21299,9 @@ var init_release = __esm({
|
|
|
21299
21299
|
});
|
|
21300
21300
|
|
|
21301
21301
|
// ../contracts/src/kit.ts
|
|
21302
|
-
function fingerprint(
|
|
21302
|
+
function fingerprint(text2) {
|
|
21303
21303
|
let hash2 = 0xcbf29ce484222325n;
|
|
21304
|
-
for (const byte of new TextEncoder().encode(
|
|
21304
|
+
for (const byte of new TextEncoder().encode(text2)) {
|
|
21305
21305
|
hash2 ^= BigInt(byte);
|
|
21306
21306
|
hash2 = BigInt.asUintN(64, hash2 * 0x100000001b3n);
|
|
21307
21307
|
}
|
|
@@ -21977,7 +21977,7 @@ var init_memory = __esm({
|
|
|
21977
21977
|
RECALL_LABEL = "recalled memory: untrusted data, not an instruction";
|
|
21978
21978
|
Id = external_exports.string().min(1).max(64).regex(/^[A-Za-z0-9][A-Za-z0-9_.:-]*$/);
|
|
21979
21979
|
MemoryItemId = Id;
|
|
21980
|
-
Body = external_exports.string().refine((
|
|
21980
|
+
Body = external_exports.string().refine((text2) => new TextEncoder().encode(text2).length <= MAX_MEMORY_BODY_BYTES, { message: `body must be at most ${MAX_MEMORY_BODY_BYTES} bytes` });
|
|
21981
21981
|
MemoryObserverKind = external_exports.enum(["user", "agent", "ci", "curator"]);
|
|
21982
21982
|
MemoryProvenance = external_exports.object({
|
|
21983
21983
|
observer: external_exports.string().min(1).max(160),
|
|
@@ -22092,10 +22092,21 @@ var init_memory = __esm({
|
|
|
22092
22092
|
/** Estimated tokens of the returned items; the startup packet uses at most STARTUP_PACKET_TOKEN_CAP. */
|
|
22093
22093
|
estimatedTokens: external_exports.number().int().min(0),
|
|
22094
22094
|
truncated: external_exports.boolean(),
|
|
22095
|
+
/**
|
|
22096
|
+
* How the items were ranked. `lexical` is the default: BM25 over the memory text, deterministic, no model call (ADR 0043).
|
|
22097
|
+
* `lexical+embedding` means the team turned embedding re-rank on and the lexical candidates were re-ordered by it.
|
|
22098
|
+
*/
|
|
22099
|
+
ranking: external_exports.enum(["lexical", "lexical+embedding"]).default("lexical"),
|
|
22095
22100
|
/** Present with `format=data`: the same items rendered as a labelled, quoted data block. */
|
|
22096
22101
|
rendered: external_exports.string().optional()
|
|
22097
22102
|
}).strict();
|
|
22098
|
-
MemorySettings = external_exports.object({
|
|
22103
|
+
MemorySettings = external_exports.object({
|
|
22104
|
+
tenantId: TenantId,
|
|
22105
|
+
globalContribution: external_exports.boolean(),
|
|
22106
|
+
/** Off by default. When on, a search embeds the query and re-orders the lexical candidates; recall is still decided by the lexical match. */
|
|
22107
|
+
embeddingRerank: external_exports.boolean().default(false),
|
|
22108
|
+
updatedAt: Timestamp.nullable()
|
|
22109
|
+
}).strict();
|
|
22099
22110
|
MemoryUnlearnRecord = external_exports.object({
|
|
22100
22111
|
tenantId: TenantId,
|
|
22101
22112
|
id: Id,
|
|
@@ -22145,7 +22156,7 @@ var init_memory = __esm({
|
|
|
22145
22156
|
contributions: external_exports.record(external_exports.string(), external_exports.number().int().min(0)),
|
|
22146
22157
|
pendingJobs: external_exports.number().int().min(0)
|
|
22147
22158
|
}).strict();
|
|
22148
|
-
MemorySettingsRequest = external_exports.object({ globalContribution: external_exports.boolean() }).strict();
|
|
22159
|
+
MemorySettingsRequest = external_exports.object({ globalContribution: external_exports.boolean().optional(), embeddingRerank: external_exports.boolean().optional() }).strict().refine((value) => value.globalContribution !== void 0 || value.embeddingRerank !== void 0, { message: "send globalContribution, embeddingRerank or both" });
|
|
22149
22160
|
MEMORY_EVENT_TYPES = [
|
|
22150
22161
|
"memory.candidate_created",
|
|
22151
22162
|
"memory.confirmed",
|
|
@@ -22624,8 +22635,8 @@ function canonicalJson(value) {
|
|
|
22624
22635
|
const entries = Object.entries(value).filter(([, v]) => v !== void 0).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
22625
22636
|
return `{${entries.map(([k, v]) => `${JSON.stringify(k)}:${canonicalJson(v)}`).join(",")}}`;
|
|
22626
22637
|
}
|
|
22627
|
-
function sha256Hex(
|
|
22628
|
-
const data = new TextEncoder().encode(
|
|
22638
|
+
function sha256Hex(text2) {
|
|
22639
|
+
const data = new TextEncoder().encode(text2);
|
|
22629
22640
|
const bitLength = data.length * 8;
|
|
22630
22641
|
const padded = new Uint8Array(Math.ceil((data.length + 9) / 64) * 64);
|
|
22631
22642
|
padded.set(data);
|
|
@@ -23772,10 +23783,10 @@ function classifyMethod(method) {
|
|
|
23772
23783
|
}
|
|
23773
23784
|
function blockedClassFor(op) {
|
|
23774
23785
|
const words = op.operationId.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
23775
|
-
const
|
|
23776
|
-
if (op.method.toUpperCase() === "DELETE" || DESTRUCTIVE.test(
|
|
23777
|
-
if (BILLING.test(
|
|
23778
|
-
if (SECRETS.test(
|
|
23786
|
+
const text2 = `${op.path.toLowerCase()} ${words}`;
|
|
23787
|
+
if (op.method.toUpperCase() === "DELETE" || DESTRUCTIVE.test(text2)) return "destructive";
|
|
23788
|
+
if (BILLING.test(text2)) return "billing";
|
|
23789
|
+
if (SECRETS.test(text2)) return "secrets";
|
|
23779
23790
|
return null;
|
|
23780
23791
|
}
|
|
23781
23792
|
var AGENT_PLANS, AgentPlan, AGENT_PROVIDERS, AgentProvider, TOOL_CLASSES, AgentToolClass, BLOCKED_CLASSES, BlockedClass, BILLING, SECRETS, DESTRUCTIVE, AgentOperation, AgentToolDefinition, AGENT_REFUSAL_CODES, AgentRefusalCode, AgentRefusal, AgentDiffEntry, APPROVAL_STATES, AgentApprovalState, AgentInverseChange, AgentApproval, AgentWriteToolResult, AgentReadToolResult, AgentToolResult, AgentCitation, MESSAGE_ORIGINS, AgentMessageOrigin, AgentMessage, AgentChatRequest, AgentFeedback, AGENT_AUDIT_RESULTS, AgentAuditResult, AgentAuditEvent, AgentReadOnlyMode, RouteIndexEntry, RouteIndex, AgentRouteHit;
|
|
@@ -24558,43 +24569,43 @@ var init_git = __esm({
|
|
|
24558
24569
|
});
|
|
24559
24570
|
|
|
24560
24571
|
// ../contracts/src/ci.ts
|
|
24561
|
-
function stripComment(
|
|
24572
|
+
function stripComment(text2) {
|
|
24562
24573
|
let quote4 = null;
|
|
24563
|
-
for (let i2 = 0; i2 <
|
|
24564
|
-
const ch =
|
|
24574
|
+
for (let i2 = 0; i2 < text2.length; i2 += 1) {
|
|
24575
|
+
const ch = text2[i2];
|
|
24565
24576
|
if (quote4 !== null) {
|
|
24566
24577
|
if (ch === quote4) quote4 = null;
|
|
24567
24578
|
} else if (ch === '"' || ch === "'") {
|
|
24568
|
-
if (i2 === 0 || /[\s[,{:]/.test(
|
|
24569
|
-
} else if (ch === "#" && (i2 === 0 || /\s/.test(
|
|
24570
|
-
return
|
|
24579
|
+
if (i2 === 0 || /[\s[,{:]/.test(text2[i2 - 1] ?? " ")) quote4 = ch;
|
|
24580
|
+
} else if (ch === "#" && (i2 === 0 || /\s/.test(text2[i2 - 1] ?? ""))) {
|
|
24581
|
+
return text2.slice(0, i2);
|
|
24571
24582
|
}
|
|
24572
24583
|
}
|
|
24573
|
-
return
|
|
24584
|
+
return text2;
|
|
24574
24585
|
}
|
|
24575
24586
|
function parseScalar(raw, line3) {
|
|
24576
|
-
const
|
|
24577
|
-
if (
|
|
24578
|
-
if (
|
|
24579
|
-
if (
|
|
24580
|
-
if (/^-?\d+$/.test(
|
|
24581
|
-
if (
|
|
24582
|
-
if (!
|
|
24587
|
+
const text2 = raw.trim();
|
|
24588
|
+
if (text2 === "" || text2 === "~" || text2 === "null") return null;
|
|
24589
|
+
if (text2 === "true") return true;
|
|
24590
|
+
if (text2 === "false") return false;
|
|
24591
|
+
if (/^-?\d+$/.test(text2)) return Number(text2);
|
|
24592
|
+
if (text2.startsWith('"')) {
|
|
24593
|
+
if (!text2.endsWith('"') || text2.length < 2) throw new YamlFail(line3, "unterminated double-quoted string");
|
|
24583
24594
|
try {
|
|
24584
|
-
return JSON.parse(
|
|
24595
|
+
return JSON.parse(text2);
|
|
24585
24596
|
} catch {
|
|
24586
24597
|
throw new YamlFail(line3, "bad escape in double-quoted string");
|
|
24587
24598
|
}
|
|
24588
24599
|
}
|
|
24589
|
-
if (
|
|
24590
|
-
if (!
|
|
24591
|
-
return
|
|
24600
|
+
if (text2.startsWith("'")) {
|
|
24601
|
+
if (!text2.endsWith("'") || text2.length < 2) throw new YamlFail(line3, "unterminated single-quoted string");
|
|
24602
|
+
return text2.slice(1, -1).replaceAll("''", "'");
|
|
24592
24603
|
}
|
|
24593
|
-
if (
|
|
24594
|
-
if (
|
|
24595
|
-
if (
|
|
24596
|
-
if (!
|
|
24597
|
-
const inner =
|
|
24604
|
+
if (text2 === "{}") return {};
|
|
24605
|
+
if (text2 === "[]") return [];
|
|
24606
|
+
if (text2.startsWith("[")) {
|
|
24607
|
+
if (!text2.endsWith("]")) throw new YamlFail(line3, "unterminated list; write the list on one line or use '- ' items");
|
|
24608
|
+
const inner = text2.slice(1, -1);
|
|
24598
24609
|
const items = [];
|
|
24599
24610
|
let current2 = "";
|
|
24600
24611
|
let quote4 = null;
|
|
@@ -24613,9 +24624,9 @@ function parseScalar(raw, line3) {
|
|
|
24613
24624
|
if (current2.trim() !== "" || items.length > 0) items.push(parseScalar(current2, line3));
|
|
24614
24625
|
return items;
|
|
24615
24626
|
}
|
|
24616
|
-
if (
|
|
24617
|
-
if (/^[&*!%@`]/.test(
|
|
24618
|
-
return
|
|
24627
|
+
if (text2.startsWith("{")) throw new YamlFail(line3, "flow maps are not supported; use an indented block");
|
|
24628
|
+
if (/^[&*!%@`]/.test(text2)) throw new YamlFail(line3, `'${text2[0]}' (anchors, aliases and tags) is not supported`);
|
|
24629
|
+
return text2;
|
|
24619
24630
|
}
|
|
24620
24631
|
function parseYaml(source) {
|
|
24621
24632
|
const lines = source.replaceAll("\r\n", "\n").split("\n");
|
|
@@ -24761,10 +24772,10 @@ function mapKeys(value, canon, orig, paths) {
|
|
|
24761
24772
|
}
|
|
24762
24773
|
return value;
|
|
24763
24774
|
}
|
|
24764
|
-
function parsePipelineConfig(
|
|
24775
|
+
function parsePipelineConfig(text2) {
|
|
24765
24776
|
let located;
|
|
24766
24777
|
try {
|
|
24767
|
-
located = parseYaml(
|
|
24778
|
+
located = parseYaml(text2);
|
|
24768
24779
|
} catch (error62) {
|
|
24769
24780
|
if (error62 instanceof YamlFail) return { ok: false, issues: [{ line: error62.line, message: error62.message }] };
|
|
24770
24781
|
throw error62;
|
|
@@ -26191,12 +26202,12 @@ function rulesRevision(source) {
|
|
|
26191
26202
|
return sha256Hex(normaliseText(source)).slice(0, 12);
|
|
26192
26203
|
}
|
|
26193
26204
|
function validateRulesSource(source) {
|
|
26194
|
-
const
|
|
26195
|
-
if (
|
|
26196
|
-
if (new TextEncoder().encode(
|
|
26197
|
-
if (
|
|
26198
|
-
return { ok: true, text:
|
|
26199
|
-
`, revision: rulesRevision(
|
|
26205
|
+
const text2 = normaliseText(source);
|
|
26206
|
+
if (text2.trim() === "") return { ok: false, problem: `${RULES_SOURCE_PATH} is empty` };
|
|
26207
|
+
if (new TextEncoder().encode(text2).length > MAX_RULES_BYTES) return { ok: false, problem: `${RULES_SOURCE_PATH} is larger than ${MAX_RULES_BYTES / 1024} KB` };
|
|
26208
|
+
if (text2.includes(MARKER)) return { ok: false, problem: `${RULES_SOURCE_PATH} contains the text "${MARKER}", which is reserved for the managed region markers` };
|
|
26209
|
+
return { ok: true, text: text2.endsWith("\n") ? text2 : `${text2}
|
|
26210
|
+
`, revision: rulesRevision(text2) };
|
|
26200
26211
|
}
|
|
26201
26212
|
function regionBody(source) {
|
|
26202
26213
|
return `<!-- Generated from ${RULES_SOURCE_PATH}. Edit that file, then run \`overlane rules sync\`. A hand edit in this region is reported as drift. -->
|
|
@@ -26244,8 +26255,8 @@ function firstDifference(found, expected) {
|
|
|
26244
26255
|
}
|
|
26245
26256
|
return { line: 1, found: "", expected: "" };
|
|
26246
26257
|
}
|
|
26247
|
-
function describeLine(
|
|
26248
|
-
const clean2 =
|
|
26258
|
+
function describeLine(text2) {
|
|
26259
|
+
const clean2 = text2.trim();
|
|
26249
26260
|
return clean2.length > 80 ? `${clean2.slice(0, 77)}...` : clean2;
|
|
26250
26261
|
}
|
|
26251
26262
|
function inspectRegionTarget(target2, fileText, source) {
|
|
@@ -26280,9 +26291,9 @@ function planRegionSync(target2, fileText, source, force) {
|
|
|
26280
26291
|
case "missing":
|
|
26281
26292
|
return { ...base5, action: "create", next: `${target2.preamble}${region}`, reason: "created" };
|
|
26282
26293
|
case "unmanaged": {
|
|
26283
|
-
const
|
|
26284
|
-
const joined =
|
|
26285
|
-
` : `${
|
|
26294
|
+
const text2 = normaliseText(fileText);
|
|
26295
|
+
const joined = text2 === "" ? "" : text2.endsWith("\n\n") ? text2 : text2.endsWith("\n") ? `${text2}
|
|
26296
|
+
` : `${text2}
|
|
26286
26297
|
|
|
26287
26298
|
`;
|
|
26288
26299
|
return { ...base5, action: "append", next: `${joined}${region}`, reason: "appended a managed region at the end; every existing line is kept" };
|
|
@@ -26313,10 +26324,10 @@ function planRegionSync(target2, fileText, source, force) {
|
|
|
26313
26324
|
return { ...base5, action: "refuse", next: null, reason: report2.detail };
|
|
26314
26325
|
}
|
|
26315
26326
|
}
|
|
26316
|
-
function parseSettings(
|
|
26317
|
-
if (
|
|
26327
|
+
function parseSettings(text2) {
|
|
26328
|
+
if (text2 === null || text2.trim() === "") return { ok: true, value: {} };
|
|
26318
26329
|
try {
|
|
26319
|
-
const value = JSON.parse(
|
|
26330
|
+
const value = JSON.parse(text2);
|
|
26320
26331
|
if (value === null || typeof value !== "object" || Array.isArray(value)) return { ok: false, problem: "is not a JSON object" };
|
|
26321
26332
|
return { ok: true, value };
|
|
26322
26333
|
} catch {
|
|
@@ -26394,7 +26405,7 @@ var init_rules_sync = __esm({
|
|
|
26394
26405
|
{ id: "gemini-settings", path: ".gemini/settings.json", kind: "gemini-settings", reader: "Gemini CLI settings (context.fileName)", preamble: "" }
|
|
26395
26406
|
];
|
|
26396
26407
|
GEMINI_CONTEXT_FILES = ["GEMINI.md", "AGENTS.md"];
|
|
26397
|
-
normaliseText = (
|
|
26408
|
+
normaliseText = (text2) => text2.replace(/\r\n?/g, "\n");
|
|
26398
26409
|
digestOf = (body2) => sha256Hex(body2).slice(0, 16);
|
|
26399
26410
|
BEGIN = new RegExp(`^<!-- ${MARKER}:begin rev=([0-9a-f]{12}) digest=([0-9a-f]{16}) -->$`);
|
|
26400
26411
|
END_LINE = `<!-- ${MARKER}:end -->`;
|
|
@@ -26618,10 +26629,10 @@ var init_egress = __esm({
|
|
|
26618
26629
|
"repl.co"
|
|
26619
26630
|
];
|
|
26620
26631
|
HOST_PATTERN = external_exports.string().min(3).max(253).refine((value) => {
|
|
26621
|
-
const
|
|
26622
|
-
const name2 =
|
|
26632
|
+
const text2 = value.trim().toLowerCase();
|
|
26633
|
+
const name2 = text2.startsWith("*.") ? text2.slice(2) : text2;
|
|
26623
26634
|
const check2 = normaliseHost(name2);
|
|
26624
|
-
return check2.ok && check2.kind === "name" && name2.includes(".") && !isMetadataHost(name2) && !isInternalName(name2) && !isSharedHostingWildcard(
|
|
26635
|
+
return check2.ok && check2.kind === "name" && name2.includes(".") && !isMetadataHost(name2) && !isInternalName(name2) && !isSharedHostingWildcard(text2);
|
|
26625
26636
|
}, "must be a host name such as registry.npmjs.org or *.example.com (no address, no internal name, no wildcard over a top-level or shared-hosting domain)");
|
|
26626
26637
|
MAX_EGRESS_RULES = 100;
|
|
26627
26638
|
EgressRule = external_exports.object({
|
|
@@ -26746,15 +26757,15 @@ var init_egress = __esm({
|
|
|
26746
26757
|
});
|
|
26747
26758
|
|
|
26748
26759
|
// ../contracts/src/enterprise.ts
|
|
26749
|
-
function parseCsv(
|
|
26760
|
+
function parseCsv(text2) {
|
|
26750
26761
|
const rows = [];
|
|
26751
26762
|
let row = [];
|
|
26752
26763
|
let cell = "";
|
|
26753
26764
|
let quoted = false;
|
|
26754
|
-
for (let i2 = 0; i2 <
|
|
26755
|
-
const ch =
|
|
26765
|
+
for (let i2 = 0; i2 < text2.length; i2 += 1) {
|
|
26766
|
+
const ch = text2[i2];
|
|
26756
26767
|
if (quoted) {
|
|
26757
|
-
if (ch === '"' &&
|
|
26768
|
+
if (ch === '"' && text2[i2 + 1] === '"') {
|
|
26758
26769
|
cell += '"';
|
|
26759
26770
|
i2 += 1;
|
|
26760
26771
|
} else if (ch === '"') quoted = false;
|
|
@@ -26764,7 +26775,7 @@ function parseCsv(text) {
|
|
|
26764
26775
|
row.push(cell);
|
|
26765
26776
|
cell = "";
|
|
26766
26777
|
} else if (ch === "\n" || ch === "\r") {
|
|
26767
|
-
if (ch === "\r" &&
|
|
26778
|
+
if (ch === "\r" && text2[i2 + 1] === "\n") i2 += 1;
|
|
26768
26779
|
row.push(cell);
|
|
26769
26780
|
rows.push(row);
|
|
26770
26781
|
row = [];
|
|
@@ -28296,14 +28307,14 @@ var require_foldFlowLines = __commonJS({
|
|
|
28296
28307
|
var FOLD_FLOW = "flow";
|
|
28297
28308
|
var FOLD_BLOCK = "block";
|
|
28298
28309
|
var FOLD_QUOTED = "quoted";
|
|
28299
|
-
function foldFlowLines(
|
|
28310
|
+
function foldFlowLines(text2, indent, mode = "flow", { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {
|
|
28300
28311
|
if (!lineWidth || lineWidth < 0)
|
|
28301
|
-
return
|
|
28312
|
+
return text2;
|
|
28302
28313
|
if (lineWidth < minContentWidth)
|
|
28303
28314
|
minContentWidth = 0;
|
|
28304
28315
|
const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);
|
|
28305
|
-
if (
|
|
28306
|
-
return
|
|
28316
|
+
if (text2.length <= endStep)
|
|
28317
|
+
return text2;
|
|
28307
28318
|
const folds = [];
|
|
28308
28319
|
const escapedFolds = {};
|
|
28309
28320
|
let end = lineWidth - indent.length;
|
|
@@ -28320,14 +28331,14 @@ var require_foldFlowLines = __commonJS({
|
|
|
28320
28331
|
let escStart = -1;
|
|
28321
28332
|
let escEnd = -1;
|
|
28322
28333
|
if (mode === FOLD_BLOCK) {
|
|
28323
|
-
i2 = consumeMoreIndentedLines(
|
|
28334
|
+
i2 = consumeMoreIndentedLines(text2, i2, indent.length);
|
|
28324
28335
|
if (i2 !== -1)
|
|
28325
28336
|
end = i2 + endStep;
|
|
28326
28337
|
}
|
|
28327
|
-
for (let ch; ch =
|
|
28338
|
+
for (let ch; ch = text2[i2 += 1]; ) {
|
|
28328
28339
|
if (mode === FOLD_QUOTED && ch === "\\") {
|
|
28329
28340
|
escStart = i2;
|
|
28330
|
-
switch (
|
|
28341
|
+
switch (text2[i2 + 1]) {
|
|
28331
28342
|
case "x":
|
|
28332
28343
|
i2 += 3;
|
|
28333
28344
|
break;
|
|
@@ -28344,12 +28355,12 @@ var require_foldFlowLines = __commonJS({
|
|
|
28344
28355
|
}
|
|
28345
28356
|
if (ch === "\n") {
|
|
28346
28357
|
if (mode === FOLD_BLOCK)
|
|
28347
|
-
i2 = consumeMoreIndentedLines(
|
|
28358
|
+
i2 = consumeMoreIndentedLines(text2, i2, indent.length);
|
|
28348
28359
|
end = i2 + indent.length + endStep;
|
|
28349
28360
|
split = void 0;
|
|
28350
28361
|
} else {
|
|
28351
28362
|
if (ch === " " && prev && prev !== " " && prev !== "\n" && prev !== " ") {
|
|
28352
|
-
const next =
|
|
28363
|
+
const next = text2[i2 + 1];
|
|
28353
28364
|
if (next && next !== " " && next !== "\n" && next !== " ")
|
|
28354
28365
|
split = i2;
|
|
28355
28366
|
}
|
|
@@ -28361,12 +28372,12 @@ var require_foldFlowLines = __commonJS({
|
|
|
28361
28372
|
} else if (mode === FOLD_QUOTED) {
|
|
28362
28373
|
while (prev === " " || prev === " ") {
|
|
28363
28374
|
prev = ch;
|
|
28364
|
-
ch =
|
|
28375
|
+
ch = text2[i2 += 1];
|
|
28365
28376
|
overflow = true;
|
|
28366
28377
|
}
|
|
28367
28378
|
const j = i2 > escEnd + 1 ? i2 - 2 : escStart - 1;
|
|
28368
28379
|
if (escapedFolds[j])
|
|
28369
|
-
return
|
|
28380
|
+
return text2;
|
|
28370
28381
|
folds.push(j);
|
|
28371
28382
|
escapedFolds[j] = true;
|
|
28372
28383
|
end = j + endStep;
|
|
@@ -28381,39 +28392,39 @@ var require_foldFlowLines = __commonJS({
|
|
|
28381
28392
|
if (overflow && onOverflow)
|
|
28382
28393
|
onOverflow();
|
|
28383
28394
|
if (folds.length === 0)
|
|
28384
|
-
return
|
|
28395
|
+
return text2;
|
|
28385
28396
|
if (onFold)
|
|
28386
28397
|
onFold();
|
|
28387
|
-
let res =
|
|
28398
|
+
let res = text2.slice(0, folds[0]);
|
|
28388
28399
|
for (let i3 = 0; i3 < folds.length; ++i3) {
|
|
28389
28400
|
const fold = folds[i3];
|
|
28390
|
-
const end2 = folds[i3 + 1] ||
|
|
28401
|
+
const end2 = folds[i3 + 1] || text2.length;
|
|
28391
28402
|
if (fold === 0)
|
|
28392
28403
|
res = `
|
|
28393
|
-
${indent}${
|
|
28404
|
+
${indent}${text2.slice(0, end2)}`;
|
|
28394
28405
|
else {
|
|
28395
28406
|
if (mode === FOLD_QUOTED && escapedFolds[fold])
|
|
28396
|
-
res += `${
|
|
28407
|
+
res += `${text2[fold]}\\`;
|
|
28397
28408
|
res += `
|
|
28398
|
-
${indent}${
|
|
28409
|
+
${indent}${text2.slice(fold + 1, end2)}`;
|
|
28399
28410
|
}
|
|
28400
28411
|
}
|
|
28401
28412
|
return res;
|
|
28402
28413
|
}
|
|
28403
|
-
function consumeMoreIndentedLines(
|
|
28414
|
+
function consumeMoreIndentedLines(text2, i2, indent) {
|
|
28404
28415
|
let end = i2;
|
|
28405
28416
|
let start2 = i2 + 1;
|
|
28406
|
-
let ch =
|
|
28417
|
+
let ch = text2[start2];
|
|
28407
28418
|
while (ch === " " || ch === " ") {
|
|
28408
28419
|
if (i2 < start2 + indent) {
|
|
28409
|
-
ch =
|
|
28420
|
+
ch = text2[++i2];
|
|
28410
28421
|
} else {
|
|
28411
28422
|
do {
|
|
28412
|
-
ch =
|
|
28423
|
+
ch = text2[++i2];
|
|
28413
28424
|
} while (ch && ch !== "\n");
|
|
28414
28425
|
end = i2;
|
|
28415
28426
|
start2 = i2 + 1;
|
|
28416
|
-
ch =
|
|
28427
|
+
ch = text2[start2];
|
|
28417
28428
|
}
|
|
28418
28429
|
}
|
|
28419
28430
|
return end;
|
|
@@ -34660,7 +34671,7 @@ var require_dist = __commonJS({
|
|
|
34660
34671
|
});
|
|
34661
34672
|
|
|
34662
34673
|
// src/assets.ts
|
|
34663
|
-
import { basename as basename5, join as
|
|
34674
|
+
import { basename as basename5, join as join32, resolve as resolve17 } from "node:path";
|
|
34664
34675
|
import { fileURLToPath } from "node:url";
|
|
34665
34676
|
function packageRoot(env = process.env) {
|
|
34666
34677
|
const override = env["MVRX_PACKAGE_ROOT"];
|
|
@@ -34669,16 +34680,16 @@ function packageRoot(env = process.env) {
|
|
|
34669
34680
|
}
|
|
34670
34681
|
function assetDir(env = process.env) {
|
|
34671
34682
|
const override = env["MVRX_ASSET_DIR"];
|
|
34672
|
-
return override !== void 0 && override !== "" ? override :
|
|
34683
|
+
return override !== void 0 && override !== "" ? override : join32(packageRoot(env), "assets");
|
|
34673
34684
|
}
|
|
34674
34685
|
function assetFile(name2) {
|
|
34675
|
-
return
|
|
34686
|
+
return join32(assetDir(), basename5(name2));
|
|
34676
34687
|
}
|
|
34677
34688
|
var VERSION;
|
|
34678
34689
|
var init_assets = __esm({
|
|
34679
34690
|
"src/assets.ts"() {
|
|
34680
34691
|
"use strict";
|
|
34681
|
-
VERSION = true ? "0.1.
|
|
34692
|
+
VERSION = true ? "0.1.145" : "0.0.0-dev";
|
|
34682
34693
|
}
|
|
34683
34694
|
});
|
|
34684
34695
|
|
|
@@ -35061,7 +35072,7 @@ var init_unsafe = __esm({
|
|
|
35061
35072
|
});
|
|
35062
35073
|
|
|
35063
35074
|
// ../../node_modules/.pnpm/@bufbuild+protobuf@2.16.0/node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.js
|
|
35064
|
-
function
|
|
35075
|
+
function isObject3(arg4) {
|
|
35065
35076
|
return arg4 !== null && typeof arg4 == "object" && !Array.isArray(arg4);
|
|
35066
35077
|
}
|
|
35067
35078
|
var init_guard = __esm({
|
|
@@ -35136,7 +35147,7 @@ function compileCreate(desc) {
|
|
|
35136
35147
|
message[name2] = property.convert !== void 0 && Array.isArray(initValue) ? initValue.map(property.convert) : initValue !== null && initValue !== void 0 ? initValue : [];
|
|
35137
35148
|
break;
|
|
35138
35149
|
case INIT_MAP:
|
|
35139
|
-
if (property.convert === void 0 || !
|
|
35150
|
+
if (property.convert === void 0 || !isObject3(initValue)) {
|
|
35140
35151
|
message[name2] = initValue !== null && initValue !== void 0 ? initValue : {};
|
|
35141
35152
|
} else {
|
|
35142
35153
|
const converted = {};
|
|
@@ -35254,7 +35265,7 @@ function compileConvertMessage(field2) {
|
|
|
35254
35265
|
const messageDesc2 = field2.message;
|
|
35255
35266
|
let compiled;
|
|
35256
35267
|
return (value) => {
|
|
35257
|
-
if (!
|
|
35268
|
+
if (!isObject3(value) || isMessage(value, messageDesc2)) {
|
|
35258
35269
|
return value;
|
|
35259
35270
|
}
|
|
35260
35271
|
compiled !== null && compiled !== void 0 ? compiled : compiled = compiledCreate(messageDesc2);
|
|
@@ -35316,8 +35327,8 @@ function getTextEncoding() {
|
|
|
35316
35327
|
const textDecoder = new globals.TextDecoder();
|
|
35317
35328
|
let textDecoderStrict;
|
|
35318
35329
|
const config2 = {
|
|
35319
|
-
encodeUtf8(
|
|
35320
|
-
return textEncoder.encode(
|
|
35330
|
+
encodeUtf8(text2) {
|
|
35331
|
+
return textEncoder.encode(text2);
|
|
35321
35332
|
},
|
|
35322
35333
|
decodeUtf8(bytes, strict) {
|
|
35323
35334
|
if (strict) {
|
|
@@ -35330,9 +35341,9 @@ function getTextEncoding() {
|
|
|
35330
35341
|
}
|
|
35331
35342
|
return textDecoder.decode(bytes);
|
|
35332
35343
|
},
|
|
35333
|
-
checkUtf8(
|
|
35344
|
+
checkUtf8(text2) {
|
|
35334
35345
|
try {
|
|
35335
|
-
encodeURIComponent(
|
|
35346
|
+
encodeURIComponent(text2);
|
|
35336
35347
|
return true;
|
|
35337
35348
|
} catch (_) {
|
|
35338
35349
|
return false;
|
|
@@ -35344,8 +35355,8 @@ function getTextEncoding() {
|
|
|
35344
35355
|
}
|
|
35345
35356
|
const nativeStringIsWellFormed = String.prototype.isWellFormed;
|
|
35346
35357
|
if (nativeStringIsWellFormed) {
|
|
35347
|
-
config2.checkUtf8 = (
|
|
35348
|
-
return nativeStringIsWellFormed.call(
|
|
35358
|
+
config2.checkUtf8 = (text2) => {
|
|
35359
|
+
return nativeStringIsWellFormed.call(text2);
|
|
35349
35360
|
};
|
|
35350
35361
|
}
|
|
35351
35362
|
configureTextEncoding(config2);
|
|
@@ -35353,8 +35364,8 @@ function getTextEncoding() {
|
|
|
35353
35364
|
return te;
|
|
35354
35365
|
}
|
|
35355
35366
|
function emulateEncodeInto(encodeUtf8) {
|
|
35356
|
-
return (
|
|
35357
|
-
const bytes = encodeUtf8(
|
|
35367
|
+
return (text2, dest) => {
|
|
35368
|
+
const bytes = encodeUtf8(text2);
|
|
35358
35369
|
dest.set(bytes);
|
|
35359
35370
|
return { written: bytes.byteLength };
|
|
35360
35371
|
};
|
|
@@ -35622,7 +35633,7 @@ function wktStructToReflect(json2) {
|
|
|
35622
35633
|
$typeName: "google.protobuf.Struct",
|
|
35623
35634
|
fields: {}
|
|
35624
35635
|
};
|
|
35625
|
-
if (
|
|
35636
|
+
if (isObject3(json2)) {
|
|
35626
35637
|
for (const k of Object.keys(json2)) {
|
|
35627
35638
|
setOwn(struct.fields, k, wktValueToReflect(json2[k]));
|
|
35628
35639
|
}
|
|
@@ -38024,22 +38035,22 @@ function parseScipSymbol(symbol2) {
|
|
|
38024
38035
|
}
|
|
38025
38036
|
return parseDescriptors(symbol2.slice(index));
|
|
38026
38037
|
}
|
|
38027
|
-
function parseDescriptors(
|
|
38038
|
+
function parseDescriptors(text2) {
|
|
38028
38039
|
const out2 = [];
|
|
38029
38040
|
let i2 = 0;
|
|
38030
|
-
while (i2 <
|
|
38031
|
-
const ch =
|
|
38041
|
+
while (i2 < text2.length) {
|
|
38042
|
+
const ch = text2[i2];
|
|
38032
38043
|
if (ch === "[") {
|
|
38033
|
-
const end =
|
|
38044
|
+
const end = text2.indexOf("]", i2);
|
|
38034
38045
|
if (end < 0) return null;
|
|
38035
|
-
out2.push({ name:
|
|
38046
|
+
out2.push({ name: text2.slice(i2 + 1, end), suffix: "typeParameter" });
|
|
38036
38047
|
i2 = end + 1;
|
|
38037
38048
|
continue;
|
|
38038
38049
|
}
|
|
38039
38050
|
if (ch === "(") {
|
|
38040
|
-
const end =
|
|
38051
|
+
const end = text2.indexOf(")", i2);
|
|
38041
38052
|
if (end < 0) return null;
|
|
38042
|
-
out2.push({ name:
|
|
38053
|
+
out2.push({ name: text2.slice(i2 + 1, end), suffix: "parameter" });
|
|
38043
38054
|
i2 = end + 1;
|
|
38044
38055
|
continue;
|
|
38045
38056
|
}
|
|
@@ -38047,9 +38058,9 @@ function parseDescriptors(text) {
|
|
|
38047
38058
|
if (ch === "`") {
|
|
38048
38059
|
i2 += 1;
|
|
38049
38060
|
for (; ; ) {
|
|
38050
|
-
if (i2 >=
|
|
38051
|
-
if (
|
|
38052
|
-
if (
|
|
38061
|
+
if (i2 >= text2.length) return null;
|
|
38062
|
+
if (text2[i2] === "`") {
|
|
38063
|
+
if (text2[i2 + 1] === "`") {
|
|
38053
38064
|
name2 += "`";
|
|
38054
38065
|
i2 += 2;
|
|
38055
38066
|
continue;
|
|
@@ -38057,17 +38068,17 @@ function parseDescriptors(text) {
|
|
|
38057
38068
|
i2 += 1;
|
|
38058
38069
|
break;
|
|
38059
38070
|
}
|
|
38060
|
-
name2 +=
|
|
38071
|
+
name2 += text2[i2];
|
|
38061
38072
|
i2 += 1;
|
|
38062
38073
|
}
|
|
38063
38074
|
} else {
|
|
38064
|
-
while (i2 <
|
|
38065
|
-
name2 +=
|
|
38075
|
+
while (i2 < text2.length && SIMPLE_IDENTIFIER.test(text2[i2] ?? "")) {
|
|
38076
|
+
name2 += text2[i2];
|
|
38066
38077
|
i2 += 1;
|
|
38067
38078
|
}
|
|
38068
38079
|
if (name2 === "") return null;
|
|
38069
38080
|
}
|
|
38070
|
-
const suffix =
|
|
38081
|
+
const suffix = text2[i2];
|
|
38071
38082
|
i2 += 1;
|
|
38072
38083
|
switch (suffix) {
|
|
38073
38084
|
case "/":
|
|
@@ -38086,7 +38097,7 @@ function parseDescriptors(text) {
|
|
|
38086
38097
|
out2.push({ name: name2, suffix: "macro" });
|
|
38087
38098
|
break;
|
|
38088
38099
|
case "(": {
|
|
38089
|
-
const end =
|
|
38100
|
+
const end = text2.indexOf(").", i2);
|
|
38090
38101
|
if (end < 0) return null;
|
|
38091
38102
|
out2.push({ name: name2, suffix: "method" });
|
|
38092
38103
|
i2 = end + 2;
|
|
@@ -40141,11 +40152,11 @@ function parseMatchPredicate(steps, index, operator, textPredicates) {
|
|
|
40141
40152
|
for (const c2 of captures) {
|
|
40142
40153
|
if (c2.name === captureName) nodes.push(c2.node.text);
|
|
40143
40154
|
}
|
|
40144
|
-
const test = /* @__PURE__ */ __name((
|
|
40145
|
-
return positive2 ? regex.test(
|
|
40155
|
+
const test = /* @__PURE__ */ __name((text2, positive2) => {
|
|
40156
|
+
return positive2 ? regex.test(text2) : !regex.test(text2);
|
|
40146
40157
|
}, "test");
|
|
40147
40158
|
if (nodes.length === 0) return !isPositive;
|
|
40148
|
-
return matchAll ? nodes.every((
|
|
40159
|
+
return matchAll ? nodes.every((text2) => test(text2, isPositive)) : nodes.some((text2) => test(text2, isPositive));
|
|
40149
40160
|
});
|
|
40150
40161
|
}
|
|
40151
40162
|
function parseAnyOfPredicate(steps, index, operator, textPredicates) {
|
|
@@ -40174,7 +40185,7 @@ function parseAnyOfPredicate(steps, index, operator, textPredicates) {
|
|
|
40174
40185
|
if (c2.name === captureName) nodes.push(c2.node.text);
|
|
40175
40186
|
}
|
|
40176
40187
|
if (nodes.length === 0) return !isPositive;
|
|
40177
|
-
return nodes.every((
|
|
40188
|
+
return nodes.every((text2) => values.includes(text2)) === isPositive;
|
|
40178
40189
|
});
|
|
40179
40190
|
}
|
|
40180
40191
|
function parseIsPredicate(steps, index, operator, assertedProperties, refutedProperties) {
|
|
@@ -42622,7 +42633,7 @@ var init_treesitter = __esm({
|
|
|
42622
42633
|
import { execFile as execFile2 } from "node:child_process";
|
|
42623
42634
|
import { createHash as createHash6 } from "node:crypto";
|
|
42624
42635
|
import { lstat, readFile as readFile4 } from "node:fs/promises";
|
|
42625
|
-
import { join as
|
|
42636
|
+
import { join as join33 } from "node:path";
|
|
42626
42637
|
import { promisify } from "node:util";
|
|
42627
42638
|
function shardKeyOf(shard) {
|
|
42628
42639
|
return `sha256:${sha256Hex2(Buffer.from(`${shard.path}\0${shard.contentHash}\0${shard.precision}`, "utf8"))}`;
|
|
@@ -42649,7 +42660,7 @@ async function mapLimit(items, limit, task) {
|
|
|
42649
42660
|
return results;
|
|
42650
42661
|
}
|
|
42651
42662
|
async function hashRegularFile(repoRoot, path) {
|
|
42652
|
-
const absolute =
|
|
42663
|
+
const absolute = join33(repoRoot, path);
|
|
42653
42664
|
try {
|
|
42654
42665
|
const stats = await lstat(absolute);
|
|
42655
42666
|
if (!stats.isFile()) return null;
|
|
@@ -42687,7 +42698,7 @@ async function buildSnapshot(options) {
|
|
|
42687
42698
|
const needParse = [...hashes.keys()].filter((path) => !byPath.has(path));
|
|
42688
42699
|
const parsed = await mapLimit(needParse, 8, async (path) => {
|
|
42689
42700
|
if (languageForPath(path) === null) return { path, shard: null };
|
|
42690
|
-
const bytes = await readFile4(
|
|
42701
|
+
const bytes = await readFile4(join33(options.repoRoot, path));
|
|
42691
42702
|
if (bytes.byteLength > MAX_PARSE_BYTES) return { path, shard: null };
|
|
42692
42703
|
const hash2 = `sha256:${sha256Hex2(bytes)}`;
|
|
42693
42704
|
if (hash2 !== hashes.get(path)) throw new Error(`${path} changed while the snapshot was being built`);
|
|
@@ -42761,9 +42772,9 @@ async function uploadSnapshot(options) {
|
|
|
42761
42772
|
if (response.ok) return response;
|
|
42762
42773
|
const retryable = response.status === 429 || response.status >= 500;
|
|
42763
42774
|
if (!retryable || attempt2 >= ATTEMPTS) {
|
|
42764
|
-
const
|
|
42765
|
-
const hint = refusalHint(response.status,
|
|
42766
|
-
throw new HttpError(`POST ${path} failed with status ${response.status}: ${
|
|
42775
|
+
const text2 = await response.text();
|
|
42776
|
+
const hint = refusalHint(response.status, text2);
|
|
42777
|
+
throw new HttpError(`POST ${path} failed with status ${response.status}: ${text2.slice(0, 300)}${hint === null ? "" : `
|
|
42767
42778
|
${hint}`}`);
|
|
42768
42779
|
}
|
|
42769
42780
|
failure4 = `status ${response.status}`;
|
|
@@ -42849,8 +42860,8 @@ var init_oidc = __esm({
|
|
|
42849
42860
|
});
|
|
42850
42861
|
|
|
42851
42862
|
// ../index-builder/src/rank.ts
|
|
42852
|
-
function wordsOf(
|
|
42853
|
-
const parts2 =
|
|
42863
|
+
function wordsOf(text2) {
|
|
42864
|
+
const parts2 = text2.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[^A-Za-z0-9]+/);
|
|
42854
42865
|
const out2 = [];
|
|
42855
42866
|
for (const part of parts2) {
|
|
42856
42867
|
let word = part.toLowerCase();
|
|
@@ -43079,9 +43090,9 @@ function buildCodeMap(index, task, options = DEFAULT_MAP_OPTIONS) {
|
|
|
43079
43090
|
related.push(line3);
|
|
43080
43091
|
}
|
|
43081
43092
|
if (related.length > 0) lines.push("", taskFree ? "Central files:" : "Related files:", ...related);
|
|
43082
|
-
const
|
|
43093
|
+
const text2 = `${lines.join("\n")}
|
|
43083
43094
|
`;
|
|
43084
|
-
return { lines, text, estimatedTokens: estimateTokens(
|
|
43095
|
+
return { lines, text: text2, estimatedTokens: estimateTokens(text2), seeds: seeds.map((seed) => seed.qualified), files: index.files, symbols: index.symbols.size };
|
|
43085
43096
|
}
|
|
43086
43097
|
function buildCodeMapDigest(input2) {
|
|
43087
43098
|
const map2 = buildCodeMap(input2.index, input2.task ?? "", input2.options ?? DEFAULT_MAP_OPTIONS);
|
|
@@ -43122,8 +43133,8 @@ var init_rank = __esm({
|
|
|
43122
43133
|
});
|
|
43123
43134
|
|
|
43124
43135
|
// ../index-builder/src/context-map.ts
|
|
43125
|
-
function stripNoise(
|
|
43126
|
-
return
|
|
43136
|
+
function stripNoise(text2) {
|
|
43137
|
+
return text2.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/\/\/[^\n]*/g, " ").replace(/"(?:[^"\\\n]|\\.)*"|'(?:[^'\\\n]|\\.)*'|`(?:[^`\\]|\\.)*`/g, '""');
|
|
43127
43138
|
}
|
|
43128
43139
|
function resolveImport(from, spec) {
|
|
43129
43140
|
if (!spec.startsWith(".")) return null;
|
|
@@ -43187,10 +43198,10 @@ async function buildRepoIndex(files) {
|
|
|
43187
43198
|
if (!CALLABLE.has(entry.kind)) continue;
|
|
43188
43199
|
const range = ranges.get(entry.id)?.enclosingRange;
|
|
43189
43200
|
if (range === void 0) continue;
|
|
43190
|
-
const
|
|
43201
|
+
const text2 = stripNoise(files.get(entry.path).split("\n").slice(range[0], range[2] + 1).join("\n"));
|
|
43191
43202
|
const visible = imports.get(entry.path) ?? /* @__PURE__ */ new Set();
|
|
43192
43203
|
const seen = /* @__PURE__ */ new Set();
|
|
43193
|
-
for (const match of
|
|
43204
|
+
for (const match of text2.matchAll(/[A-Za-z_$][\w$]*/g)) {
|
|
43194
43205
|
const id2 = match[0];
|
|
43195
43206
|
if (KEYWORDS.has(id2) || seen.has(id2)) continue;
|
|
43196
43207
|
seen.add(id2);
|
|
@@ -43243,7 +43254,7 @@ var init_context_map = __esm({
|
|
|
43243
43254
|
// ../index-builder/src/context-map-build.ts
|
|
43244
43255
|
import { execFile as execFile3 } from "node:child_process";
|
|
43245
43256
|
import { mkdir as mkdir3, readFile as readFile5, writeFile as writeFile3 } from "node:fs/promises";
|
|
43246
|
-
import { dirname as dirname11, join as
|
|
43257
|
+
import { dirname as dirname11, join as join34 } from "node:path";
|
|
43247
43258
|
import { promisify as promisify2 } from "node:util";
|
|
43248
43259
|
async function git5(root, args2) {
|
|
43249
43260
|
const { stdout } = await execFileAsync2("git", args2, { cwd: root, encoding: "utf8", maxBuffer: 256 * 1024 * 1024 });
|
|
@@ -43256,7 +43267,7 @@ async function buildArtifactsForCheckout(options) {
|
|
|
43256
43267
|
for (const path of tracked) {
|
|
43257
43268
|
if (languageForPath(path) === null) continue;
|
|
43258
43269
|
try {
|
|
43259
|
-
const bytes = await readFile5(
|
|
43270
|
+
const bytes = await readFile5(join34(options.root, path));
|
|
43260
43271
|
if (bytes.byteLength > MAX_PARSE_BYTES) {
|
|
43261
43272
|
uncovered += 1;
|
|
43262
43273
|
continue;
|
|
@@ -43280,14 +43291,14 @@ async function buildArtifactsForCheckout(options) {
|
|
|
43280
43291
|
return { digest, indexFile };
|
|
43281
43292
|
}
|
|
43282
43293
|
async function writeIndexFile(root, indexFile) {
|
|
43283
|
-
const path =
|
|
43294
|
+
const path = join34(root, CODE_INDEX_PATH);
|
|
43284
43295
|
await mkdir3(dirname11(path), { recursive: true });
|
|
43285
43296
|
await writeFile3(path, `${JSON.stringify(indexFile)}
|
|
43286
43297
|
`);
|
|
43287
43298
|
return path;
|
|
43288
43299
|
}
|
|
43289
43300
|
async function writeDigest(root, digest, out2) {
|
|
43290
|
-
const path = out2 ??
|
|
43301
|
+
const path = out2 ?? join34(root, CODE_MAP_DIGEST_PATH);
|
|
43291
43302
|
await mkdir3(dirname11(path), { recursive: true });
|
|
43292
43303
|
await writeFile3(path, `${JSON.stringify(digest)}
|
|
43293
43304
|
`);
|
|
@@ -43308,7 +43319,7 @@ var init_context_map_build = __esm({
|
|
|
43308
43319
|
// ../index-builder/src/run.ts
|
|
43309
43320
|
import { execFile as execFile4 } from "node:child_process";
|
|
43310
43321
|
import { mkdir as mkdir4, readdir as readdir4, rm as rm2, writeFile as writeFile4 } from "node:fs/promises";
|
|
43311
|
-
import { join as
|
|
43322
|
+
import { join as join35, resolve as resolve18 } from "node:path";
|
|
43312
43323
|
import { parseArgs as parseArgs2 } from "node:util";
|
|
43313
43324
|
import { promisify as promisify3 } from "node:util";
|
|
43314
43325
|
function originOf(url2) {
|
|
@@ -43399,13 +43410,13 @@ ${USAGE}`);
|
|
|
43399
43410
|
}
|
|
43400
43411
|
}
|
|
43401
43412
|
async function writeSnapshot(dir, built) {
|
|
43402
|
-
await mkdir4(
|
|
43403
|
-
for (const name2 of await readdir4(
|
|
43404
|
-
await writeFile4(
|
|
43405
|
-
await writeFile4(
|
|
43413
|
+
await mkdir4(join35(dir, "shards"), { recursive: true });
|
|
43414
|
+
for (const name2 of await readdir4(join35(dir, "shards"))) await rm2(join35(dir, "shards", name2));
|
|
43415
|
+
await writeFile4(join35(dir, "manifest.json"), JSON.stringify(built.manifest, null, 2));
|
|
43416
|
+
await writeFile4(join35(dir, "uncovered.json"), JSON.stringify(built.uncovered, null, 2));
|
|
43406
43417
|
for (const shard of built.shards) {
|
|
43407
43418
|
const name2 = shardKeyOf(shard).slice("sha256:".length);
|
|
43408
|
-
await writeFile4(
|
|
43419
|
+
await writeFile4(join35(dir, "shards", `${name2}.json`), JSON.stringify(shard));
|
|
43409
43420
|
}
|
|
43410
43421
|
}
|
|
43411
43422
|
var execFileAsync3, USAGE, UsageError2, OPTIONS;
|
|
@@ -51115,7 +51126,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
51115
51126
|
const schId = normalizeId(schema[schemaId] || baseId);
|
|
51116
51127
|
const baseIds = { "": schId };
|
|
51117
51128
|
const pathPrefix = getFullPath(uriResolver, schId, false);
|
|
51118
|
-
const
|
|
51129
|
+
const localRefs2 = {};
|
|
51119
51130
|
const schemaRefs = /* @__PURE__ */ new Set();
|
|
51120
51131
|
traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {
|
|
51121
51132
|
if (parentJsonPtr === void 0) return;
|
|
@@ -51134,8 +51145,8 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
51134
51145
|
if (typeof schOrRef == "string") schOrRef = this.refs[schOrRef];
|
|
51135
51146
|
if (typeof schOrRef == "object") checkAmbiguosRef(sch, schOrRef.schema, ref);
|
|
51136
51147
|
else if (ref !== normalizeId(fullPath)) if (ref[0] === "#") {
|
|
51137
|
-
checkAmbiguosRef(sch,
|
|
51138
|
-
|
|
51148
|
+
checkAmbiguosRef(sch, localRefs2[ref], ref);
|
|
51149
|
+
localRefs2[ref] = sch;
|
|
51139
51150
|
} else this.refs[ref] = fullPath;
|
|
51140
51151
|
return ref;
|
|
51141
51152
|
}
|
|
@@ -51146,7 +51157,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
51146
51157
|
}
|
|
51147
51158
|
}
|
|
51148
51159
|
});
|
|
51149
|
-
return
|
|
51160
|
+
return localRefs2;
|
|
51150
51161
|
function checkAmbiguosRef(sch1, sch2, ref) {
|
|
51151
51162
|
if (sch2 !== void 0 && !equal(sch1, sch2)) throw ambiguos(ref);
|
|
51152
51163
|
}
|
|
@@ -52762,7 +52773,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
52762
52773
|
}
|
|
52763
52774
|
errorsText(errors = this.errors, { separator = ", ", dataVar = "data" } = {}) {
|
|
52764
52775
|
if (!errors || errors.length === 0) return "No errors";
|
|
52765
|
-
return errors.map((e2) => `${dataVar}${e2.instancePath} ${e2.message}`).reduce((
|
|
52776
|
+
return errors.map((e2) => `${dataVar}${e2.instancePath} ${e2.message}`).reduce((text2, msg) => text2 + separator + msg);
|
|
52766
52777
|
}
|
|
52767
52778
|
$dataMetaSchema(metaSchema, keywordsJsonPointers) {
|
|
52768
52779
|
const rules = this.RULES.all;
|
|
@@ -52802,13 +52813,13 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
52802
52813
|
let sch = this._cache.get(schema);
|
|
52803
52814
|
if (sch !== void 0) return sch;
|
|
52804
52815
|
baseId = (0, resolve_1.normalizeId)(id2 || baseId);
|
|
52805
|
-
const
|
|
52816
|
+
const localRefs2 = resolve_1.getSchemaRefs.call(this, schema, baseId);
|
|
52806
52817
|
sch = new compile_1.SchemaEnv({
|
|
52807
52818
|
schema,
|
|
52808
52819
|
schemaId,
|
|
52809
52820
|
meta: meta3,
|
|
52810
52821
|
baseId,
|
|
52811
|
-
localRefs
|
|
52822
|
+
localRefs: localRefs2
|
|
52812
52823
|
});
|
|
52813
52824
|
this._cache.set(sch.schema, sch);
|
|
52814
52825
|
if (addSchema && !baseId.startsWith("#")) {
|
|
@@ -54699,14 +54710,14 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
54699
54710
|
exports.dynamicAnchor = dynamicAnchor;
|
|
54700
54711
|
function _getValidate(cxt) {
|
|
54701
54712
|
const { schemaEnv, schema, self } = cxt.it;
|
|
54702
|
-
const { root, baseId, localRefs, meta: meta3 } = schemaEnv.root;
|
|
54713
|
+
const { root, baseId, localRefs: localRefs2, meta: meta3 } = schemaEnv.root;
|
|
54703
54714
|
const { schemaId } = self.opts;
|
|
54704
54715
|
const sch = new compile_1.SchemaEnv({
|
|
54705
54716
|
schema,
|
|
54706
54717
|
schemaId,
|
|
54707
54718
|
root,
|
|
54708
54719
|
baseId,
|
|
54709
|
-
localRefs,
|
|
54720
|
+
localRefs: localRefs2,
|
|
54710
54721
|
meta: meta3
|
|
54711
54722
|
});
|
|
54712
54723
|
compile_1.compileSchema.call(self, sch);
|
|
@@ -58250,12 +58261,12 @@ var init_cloud = __esm({
|
|
|
58250
58261
|
});
|
|
58251
58262
|
|
|
58252
58263
|
// ../code-shim/src/git.ts
|
|
58253
|
-
import { execFileSync } from "node:child_process";
|
|
58264
|
+
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
58254
58265
|
import { existsSync as existsSync14 } from "node:fs";
|
|
58255
|
-
import { join as
|
|
58266
|
+
import { join as join39 } from "node:path";
|
|
58256
58267
|
function git7(root, args2) {
|
|
58257
58268
|
try {
|
|
58258
|
-
return
|
|
58269
|
+
return execFileSync2("git", args2, { cwd: root, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"], maxBuffer: 64 * 1024 * 1024, timeout: 1e4 });
|
|
58259
58270
|
} catch {
|
|
58260
58271
|
return null;
|
|
58261
58272
|
}
|
|
@@ -58314,7 +58325,7 @@ function readWorkingCopyState(root) {
|
|
|
58314
58325
|
const head = headCommit2(root);
|
|
58315
58326
|
const raw = git7(root, ["status", "--porcelain=v2", "-z", "--untracked-files=all"]);
|
|
58316
58327
|
if (raw === null) return { head, dirty: /* @__PURE__ */ new Set(), deleted: /* @__PURE__ */ new Set(), renamed: /* @__PURE__ */ new Map() };
|
|
58317
|
-
return { head, ...parseStatus(raw, (path) => existsSync14(
|
|
58328
|
+
return { head, ...parseStatus(raw, (path) => existsSync14(join39(root, path))) };
|
|
58318
58329
|
}
|
|
58319
58330
|
var init_git2 = __esm({
|
|
58320
58331
|
"../code-shim/src/git.ts"() {
|
|
@@ -58323,18 +58334,18 @@ var init_git2 = __esm({
|
|
|
58323
58334
|
});
|
|
58324
58335
|
|
|
58325
58336
|
// ../code-shim/src/config.ts
|
|
58326
|
-
import { readFileSync as
|
|
58327
|
-
import { homedir as
|
|
58328
|
-
import { join as
|
|
58329
|
-
function
|
|
58330
|
-
const base5 = env["XDG_CONFIG_HOME"] ?? (process.platform === "win32" ? env["APPDATA"] : void 0) ??
|
|
58331
|
-
return
|
|
58337
|
+
import { readFileSync as readFileSync22 } from "node:fs";
|
|
58338
|
+
import { homedir as homedir3 } from "node:os";
|
|
58339
|
+
import { join as join40 } from "node:path";
|
|
58340
|
+
function configDir2(env) {
|
|
58341
|
+
const base5 = env["XDG_CONFIG_HOME"] ?? (process.platform === "win32" ? env["APPDATA"] : void 0) ?? join40(homedir3(), ".config");
|
|
58342
|
+
return join40(base5, "mvrx-harness");
|
|
58332
58343
|
}
|
|
58333
58344
|
function findToken2(env, serviceUrl, now) {
|
|
58334
58345
|
const fromEnv = env["HARNESS_TOKEN"];
|
|
58335
58346
|
if (fromEnv !== void 0 && fromEnv.length > 0) return fromEnv;
|
|
58336
58347
|
try {
|
|
58337
|
-
const file2 = JSON.parse(
|
|
58348
|
+
const file2 = JSON.parse(readFileSync22(join40(configDir2(env), "credentials.json"), "utf8"));
|
|
58338
58349
|
const stored = file2[serviceUrl];
|
|
58339
58350
|
if (stored === void 0 || typeof stored.accessToken !== "string" || stored.accessToken.length === 0) return null;
|
|
58340
58351
|
if (typeof stored.expiresAt === "number" && stored.expiresAt <= now) return null;
|
|
@@ -58346,7 +58357,7 @@ function findToken2(env, serviceUrl, now) {
|
|
|
58346
58357
|
function resolveCloudConfig(root, env, now) {
|
|
58347
58358
|
let binding;
|
|
58348
58359
|
try {
|
|
58349
|
-
const parsed = ProjectBinding.safeParse(JSON.parse(
|
|
58360
|
+
const parsed = ProjectBinding.safeParse(JSON.parse(readFileSync22(join40(root, ".harness", "project.json"), "utf8")));
|
|
58350
58361
|
if (!parsed.success) return null;
|
|
58351
58362
|
binding = parsed.data;
|
|
58352
58363
|
} catch {
|
|
@@ -58368,7 +58379,7 @@ var init_config = __esm({
|
|
|
58368
58379
|
});
|
|
58369
58380
|
|
|
58370
58381
|
// ../code-shim/src/local.ts
|
|
58371
|
-
import { readFileSync as
|
|
58382
|
+
import { readFileSync as readFileSync23, statSync as statSync4 } from "node:fs";
|
|
58372
58383
|
import { isAbsolute as isAbsolute2, relative as relative5, resolve as resolve19, sep as sep2 } from "node:path";
|
|
58373
58384
|
function resolveInside(root, path) {
|
|
58374
58385
|
const absolute = resolve19(root, path);
|
|
@@ -58488,7 +58499,7 @@ var init_local = __esm({
|
|
|
58488
58499
|
let shard;
|
|
58489
58500
|
try {
|
|
58490
58501
|
this.parses += 1;
|
|
58491
|
-
shard = await this.parse(path,
|
|
58502
|
+
shard = await this.parse(path, readFileSync23(absolute, "utf8"));
|
|
58492
58503
|
} catch {
|
|
58493
58504
|
shard = null;
|
|
58494
58505
|
}
|
|
@@ -58500,7 +58511,7 @@ var init_local = __esm({
|
|
|
58500
58511
|
const absolute = resolveInside(this.root, path);
|
|
58501
58512
|
if (absolute === null) return null;
|
|
58502
58513
|
try {
|
|
58503
|
-
return
|
|
58514
|
+
return readFileSync23(absolute, "utf8");
|
|
58504
58515
|
} catch {
|
|
58505
58516
|
return null;
|
|
58506
58517
|
}
|
|
@@ -58510,7 +58521,7 @@ var init_local = __esm({
|
|
|
58510
58521
|
const absolute = resolveInside(this.root, path);
|
|
58511
58522
|
if (absolute === null) return void 0;
|
|
58512
58523
|
try {
|
|
58513
|
-
const lines =
|
|
58524
|
+
const lines = readFileSync23(absolute, "utf8").split("\n");
|
|
58514
58525
|
const start2 = range[0];
|
|
58515
58526
|
if (start2 >= lines.length) return void 0;
|
|
58516
58527
|
const end = Math.min(Math.max(range[2], start2), start2 + maxLines - 1, lines.length - 1);
|
|
@@ -58737,26 +58748,26 @@ var init_nav = __esm({
|
|
|
58737
58748
|
|
|
58738
58749
|
// ../code-shim/src/edit.ts
|
|
58739
58750
|
import { createHash as createHash8 } from "node:crypto";
|
|
58740
|
-
import { readFileSync as
|
|
58741
|
-
function lineStarts(
|
|
58751
|
+
import { readFileSync as readFileSync24, writeFileSync as writeFileSync11 } from "node:fs";
|
|
58752
|
+
function lineStarts(text2) {
|
|
58742
58753
|
const starts = [0];
|
|
58743
|
-
for (let i2 = 0; i2 <
|
|
58754
|
+
for (let i2 = 0; i2 < text2.length; i2 += 1) if (text2[i2] === "\n") starts.push(i2 + 1);
|
|
58744
58755
|
return starts;
|
|
58745
58756
|
}
|
|
58746
|
-
function offsetOf(starts,
|
|
58757
|
+
function offsetOf(starts, text2, line3, character) {
|
|
58747
58758
|
const start2 = starts[line3];
|
|
58748
58759
|
if (start2 === void 0) return null;
|
|
58749
|
-
const next = starts[line3 + 1] ??
|
|
58760
|
+
const next = starts[line3 + 1] ?? text2.length + 1;
|
|
58750
58761
|
return Math.min(start2 + character, next - 1);
|
|
58751
58762
|
}
|
|
58752
|
-
function positionAt(
|
|
58753
|
-
const starts = lineStarts(
|
|
58763
|
+
function positionAt(text2, offset) {
|
|
58764
|
+
const starts = lineStarts(text2.slice(0, offset));
|
|
58754
58765
|
const line3 = starts.length - 1;
|
|
58755
58766
|
return [line3, offset - (starts[line3] ?? 0)];
|
|
58756
58767
|
}
|
|
58757
|
-
function lineEnd(starts,
|
|
58768
|
+
function lineEnd(starts, text2, line3) {
|
|
58758
58769
|
const next = starts[line3 + 1];
|
|
58759
|
-
return next === void 0 ?
|
|
58770
|
+
return next === void 0 ? text2.length : next - 1;
|
|
58760
58771
|
}
|
|
58761
58772
|
async function locate(index, path, namePath) {
|
|
58762
58773
|
if (resolveInside(index.root, path) === null) return { ok: false, reason: `path ${path} is outside the repository` };
|
|
@@ -58778,7 +58789,7 @@ async function editSymbol(index, args2) {
|
|
|
58778
58789
|
if (!found.ok) return found;
|
|
58779
58790
|
const absolute = resolveInside(index.root, args2.path);
|
|
58780
58791
|
if (absolute === null) return { ok: false, reason: `path ${args2.path} is outside the repository` };
|
|
58781
|
-
const original =
|
|
58792
|
+
const original = readFileSync24(absolute, "utf8");
|
|
58782
58793
|
const starts = lineStarts(original);
|
|
58783
58794
|
const range = found.symbol.enclosingRange ?? found.symbol.range;
|
|
58784
58795
|
const from = offsetOf(starts, original, range[0], range[1]);
|
|
@@ -58843,21 +58854,21 @@ async function renameSymbol(deps, args2) {
|
|
|
58843
58854
|
for (const [path, ranges] of byFile) {
|
|
58844
58855
|
const absolute = resolveInside(deps.index.root, path);
|
|
58845
58856
|
if (absolute === null) return { ok: false, reason: `reference path ${path} is outside the repository` };
|
|
58846
|
-
let
|
|
58857
|
+
let text2;
|
|
58847
58858
|
try {
|
|
58848
|
-
|
|
58859
|
+
text2 = readFileSync24(absolute, "utf8");
|
|
58849
58860
|
} catch {
|
|
58850
58861
|
return { ok: false, reason: `cannot read ${path}` };
|
|
58851
58862
|
}
|
|
58852
|
-
const starts = lineStarts(
|
|
58863
|
+
const starts = lineStarts(text2);
|
|
58853
58864
|
for (const range of ranges) {
|
|
58854
|
-
const from = offsetOf(starts,
|
|
58855
|
-
const to = offsetOf(starts,
|
|
58856
|
-
if (range[0] !== range[2] || from === null || to === null ||
|
|
58865
|
+
const from = offsetOf(starts, text2, range[0], range[1]);
|
|
58866
|
+
const to = offsetOf(starts, text2, range[2], range[3]);
|
|
58867
|
+
if (range[0] !== range[2] || from === null || to === null || text2.slice(from, to) !== oldName) {
|
|
58857
58868
|
return { ok: false, reason: `${path}:${range[0] + 1}:${range[1] + 1} does not contain ${oldName}; the index is out of step with the file` };
|
|
58858
58869
|
}
|
|
58859
58870
|
}
|
|
58860
|
-
plan3.push({ path, absolute, text, ranges });
|
|
58871
|
+
plan3.push({ path, absolute, text: text2, ranges });
|
|
58861
58872
|
}
|
|
58862
58873
|
const filesChanged = [];
|
|
58863
58874
|
let edits = 0;
|
|
@@ -59170,10 +59181,10 @@ function isMissing(error62) {
|
|
|
59170
59181
|
return error62 instanceof Error && "code" in error62 && (error62.code === "ENOENT" || error62.code === "ENOTDIR");
|
|
59171
59182
|
}
|
|
59172
59183
|
function readJson(path) {
|
|
59173
|
-
const
|
|
59174
|
-
if (
|
|
59184
|
+
const text2 = readText(path);
|
|
59185
|
+
if (text2 === null) return void 0;
|
|
59175
59186
|
try {
|
|
59176
|
-
return JSON.parse(
|
|
59187
|
+
return JSON.parse(text2);
|
|
59177
59188
|
} catch {
|
|
59178
59189
|
return void 0;
|
|
59179
59190
|
}
|
|
@@ -59244,11 +59255,11 @@ function removeOwned(root) {
|
|
|
59244
59255
|
|
|
59245
59256
|
// ../cli/src/binding.ts
|
|
59246
59257
|
function readBindingFile(root) {
|
|
59247
|
-
const
|
|
59248
|
-
if (
|
|
59258
|
+
const text2 = readText(join2(root, BINDING_FILE));
|
|
59259
|
+
if (text2 === null) return { kind: "missing" };
|
|
59249
59260
|
let raw;
|
|
59250
59261
|
try {
|
|
59251
|
-
raw = JSON.parse(
|
|
59262
|
+
raw = JSON.parse(text2);
|
|
59252
59263
|
} catch {
|
|
59253
59264
|
return { kind: "invalid", detail: "not JSON" };
|
|
59254
59265
|
}
|
|
@@ -59450,8 +59461,8 @@ var PATTERNS = [
|
|
|
59450
59461
|
[/(["']?(?:access_?token|refresh_?token|id_?token|token|api_?key|secret|password|authorization|client_?secret)["']?\s*[:=]\s*)(["']?)[^\s"',;}&]{6,}\2/gi, "$1$2[redacted]$2"],
|
|
59451
59462
|
[/(-----BEGIN [A-Z ]*PRIVATE KEY-----)[\s\S]*?(-----END [A-Z ]*PRIVATE KEY-----)/g, "$1[redacted]$2"]
|
|
59452
59463
|
];
|
|
59453
|
-
function redact(
|
|
59454
|
-
let out2 =
|
|
59464
|
+
function redact(text2) {
|
|
59465
|
+
let out2 = text2;
|
|
59455
59466
|
for (const secret of knownSecrets) out2 = out2.split(secret).join("[redacted]");
|
|
59456
59467
|
for (const [pattern, replacement] of PATTERNS) out2 = out2.replace(pattern, replacement);
|
|
59457
59468
|
return out2;
|
|
@@ -59700,10 +59711,10 @@ function parseKeyPath(source) {
|
|
|
59700
59711
|
return parts2.length === 0 ? null : parts2;
|
|
59701
59712
|
}
|
|
59702
59713
|
var HEADER = /^\s*\[(?!\[)(.+?)\]\s*(?:#.*)?$/;
|
|
59703
|
-
function readTables(
|
|
59714
|
+
function readTables(text2) {
|
|
59704
59715
|
const tables = [];
|
|
59705
59716
|
let current2 = null;
|
|
59706
|
-
for (const line3 of
|
|
59717
|
+
for (const line3 of text2.split("\n")) {
|
|
59707
59718
|
const match = HEADER.exec(line3);
|
|
59708
59719
|
if (match !== null && match[1] !== void 0) {
|
|
59709
59720
|
if (current2 !== null) tables.push({ path: current2.path, body: current2.lines.join("\n") });
|
|
@@ -59719,8 +59730,8 @@ function readTables(text) {
|
|
|
59719
59730
|
if (current2 !== null) tables.push({ path: current2.path, body: current2.lines.join("\n") });
|
|
59720
59731
|
return tables;
|
|
59721
59732
|
}
|
|
59722
|
-
function findTable(
|
|
59723
|
-
return readTables(
|
|
59733
|
+
function findTable(text2, path) {
|
|
59734
|
+
return readTables(text2).find((table2) => table2.path.length === path.length && table2.path.every((p2, i2) => p2 === path[i2])) ?? null;
|
|
59724
59735
|
}
|
|
59725
59736
|
function isTrue(body2, key) {
|
|
59726
59737
|
return new RegExp(`^\\s*${key}\\s*=\\s*true\\s*(?:#.*)?$`, "m").test(body2);
|
|
@@ -59950,10 +59961,10 @@ async function startLoopback(preferredPort, state) {
|
|
|
59950
59961
|
}
|
|
59951
59962
|
async function postJson(deps, url2, body2, contentType) {
|
|
59952
59963
|
const response = await deps.fetch(url2, { method: "POST", headers: { "content-type": contentType, accept: "application/json" }, body: body2 });
|
|
59953
|
-
const
|
|
59954
|
-
if (!response.ok) throw new CliError(`${url2} answered ${response.status}: ${
|
|
59964
|
+
const text2 = await response.text();
|
|
59965
|
+
if (!response.ok) throw new CliError(`${url2} answered ${response.status}: ${text2.slice(0, 200)}`);
|
|
59955
59966
|
try {
|
|
59956
|
-
return JSON.parse(
|
|
59967
|
+
return JSON.parse(text2);
|
|
59957
59968
|
} catch {
|
|
59958
59969
|
throw new CliError(`${url2} did not answer with JSON`);
|
|
59959
59970
|
}
|
|
@@ -60109,8 +60120,8 @@ function parseProvider(value) {
|
|
|
60109
60120
|
if (PROVIDERS.includes(value)) return value;
|
|
60110
60121
|
throw new UsageError(`--provider must be one of ${PROVIDERS.join(", ")}`, { hint: "overlane connect --provider overlane" });
|
|
60111
60122
|
}
|
|
60112
|
-
function safeName(
|
|
60113
|
-
const cleaned =
|
|
60123
|
+
function safeName(text2) {
|
|
60124
|
+
const cleaned = text2.replace(/[^A-Za-z0-9._-]+/g, "-").replace(/^[-.]+|-+$/g, "");
|
|
60114
60125
|
return cleaned.slice(0, 100) === "" ? "project" : cleaned.slice(0, 100);
|
|
60115
60126
|
}
|
|
60116
60127
|
function projectLabel(project) {
|
|
@@ -60167,18 +60178,18 @@ async function isHarnessIgnored(deps, root) {
|
|
|
60167
60178
|
}
|
|
60168
60179
|
async function addExclude(deps, root) {
|
|
60169
60180
|
const path = await excludePath(deps, root);
|
|
60170
|
-
const
|
|
60171
|
-
if (
|
|
60172
|
-
const prefix =
|
|
60173
|
-
writeIfDifferent(path, `${
|
|
60181
|
+
const text2 = readText(path) ?? "";
|
|
60182
|
+
if (text2.split("\n").includes(EXCLUDE_LINE)) return false;
|
|
60183
|
+
const prefix = text2.length === 0 || text2.endsWith("\n") ? "" : "\n";
|
|
60184
|
+
writeIfDifferent(path, `${text2}${prefix}${EXCLUDE_LINE}
|
|
60174
60185
|
`);
|
|
60175
60186
|
return true;
|
|
60176
60187
|
}
|
|
60177
60188
|
async function removeExclude(deps, root) {
|
|
60178
60189
|
const path = await excludePath(deps, root);
|
|
60179
|
-
const
|
|
60180
|
-
if (
|
|
60181
|
-
const lines =
|
|
60190
|
+
const text2 = readText(path);
|
|
60191
|
+
if (text2 === null) return;
|
|
60192
|
+
const lines = text2.split("\n");
|
|
60182
60193
|
const index = lines.indexOf(EXCLUDE_LINE);
|
|
60183
60194
|
if (index === -1) return;
|
|
60184
60195
|
lines.splice(index, 1);
|
|
@@ -60268,9 +60279,9 @@ var ReleaseRefusal = class extends CliError {
|
|
|
60268
60279
|
}
|
|
60269
60280
|
};
|
|
60270
60281
|
async function failure2(response) {
|
|
60271
|
-
const
|
|
60282
|
+
const text2 = await response.text();
|
|
60272
60283
|
try {
|
|
60273
|
-
const parsed = ApiError.safeParse(JSON.parse(
|
|
60284
|
+
const parsed = ApiError.safeParse(JSON.parse(text2));
|
|
60274
60285
|
if (parsed.success) return { code: parsed.data.error.code, text: `${parsed.data.error.code}: ${parsed.data.error.message}` };
|
|
60275
60286
|
} catch {
|
|
60276
60287
|
}
|
|
@@ -60329,9 +60340,9 @@ function authHeaders(token) {
|
|
|
60329
60340
|
return { authorization: `Bearer ${token}`, accept: "application/json" };
|
|
60330
60341
|
}
|
|
60331
60342
|
async function describeFailure(response) {
|
|
60332
|
-
const
|
|
60343
|
+
const text2 = await response.text();
|
|
60333
60344
|
try {
|
|
60334
|
-
const parsed = ApiError.safeParse(JSON.parse(
|
|
60345
|
+
const parsed = ApiError.safeParse(JSON.parse(text2));
|
|
60335
60346
|
if (parsed.success) return { text: `${parsed.data.error.code}: ${parsed.data.error.message}`, code: parsed.data.error.code };
|
|
60336
60347
|
} catch {
|
|
60337
60348
|
}
|
|
@@ -61206,9 +61217,9 @@ var LocalTaskState = external_exports.object({
|
|
|
61206
61217
|
}).strict();
|
|
61207
61218
|
function readTaskState(root) {
|
|
61208
61219
|
try {
|
|
61209
|
-
const
|
|
61210
|
-
if (
|
|
61211
|
-
const parsed = LocalTaskState.safeParse(JSON.parse(
|
|
61220
|
+
const text2 = readText(join10(root, TASK_STATE_PATH));
|
|
61221
|
+
if (text2 === null) return null;
|
|
61222
|
+
const parsed = LocalTaskState.safeParse(JSON.parse(text2));
|
|
61212
61223
|
return parsed.success ? parsed.data : null;
|
|
61213
61224
|
} catch {
|
|
61214
61225
|
return null;
|
|
@@ -61460,9 +61471,9 @@ init_zod();
|
|
|
61460
61471
|
// ../cli/src/task/api.ts
|
|
61461
61472
|
init_src();
|
|
61462
61473
|
async function failure3(response) {
|
|
61463
|
-
const
|
|
61474
|
+
const text2 = await response.text();
|
|
61464
61475
|
try {
|
|
61465
|
-
const json2 = JSON.parse(
|
|
61476
|
+
const json2 = JSON.parse(text2);
|
|
61466
61477
|
const parsed = ApiError.safeParse(json2);
|
|
61467
61478
|
const developer = parsed.success ? null : DeveloperError.safeParse(json2);
|
|
61468
61479
|
const error62 = parsed.success ? parsed.data.error : developer?.success === true ? developer.data.error : null;
|
|
@@ -61558,9 +61569,9 @@ var LocalRunState = external_exports.object({
|
|
|
61558
61569
|
}).strict();
|
|
61559
61570
|
function readRunState(root) {
|
|
61560
61571
|
try {
|
|
61561
|
-
const
|
|
61562
|
-
if (
|
|
61563
|
-
const parsed = LocalRunState.safeParse(JSON.parse(
|
|
61572
|
+
const text2 = readText(join14(root, RUN_STATE_PATH));
|
|
61573
|
+
if (text2 === null) return null;
|
|
61574
|
+
const parsed = LocalRunState.safeParse(JSON.parse(text2));
|
|
61564
61575
|
return parsed.success ? parsed.data : null;
|
|
61565
61576
|
} catch {
|
|
61566
61577
|
return null;
|
|
@@ -61615,8 +61626,8 @@ function naturalCompare(a, b) {
|
|
|
61615
61626
|
}
|
|
61616
61627
|
return left.length - right.length || (a < b ? -1 : a > b ? 1 : 0);
|
|
61617
61628
|
}
|
|
61618
|
-
function splitFrontMatter(
|
|
61619
|
-
const normalized =
|
|
61629
|
+
function splitFrontMatter(text2, where2) {
|
|
61630
|
+
const normalized = text2.replace(/\r\n/g, "\n");
|
|
61620
61631
|
const match = /^---\n([\s\S]*?)\n?---\n?([\s\S]*)$/.exec(normalized);
|
|
61621
61632
|
if (!match) throw new KitError(`${where2}: missing YAML front matter`);
|
|
61622
61633
|
let data;
|
|
@@ -61738,7 +61749,7 @@ async function writePlan(repoDir, plan3) {
|
|
|
61738
61749
|
await mkdir(paths.tasks, { recursive: true });
|
|
61739
61750
|
const keep = new Set(canonical.tasks.map((task) => `${task.id}.md`));
|
|
61740
61751
|
for (const entry of await readdir(paths.tasks)) if (entry.endsWith(".md") && !keep.has(entry)) await rm(join15(paths.tasks, entry));
|
|
61741
|
-
for (const [file2,
|
|
61752
|
+
for (const [file2, text2] of files) await writeFile(file2, text2, "utf8");
|
|
61742
61753
|
return [...files.keys()].map((file2) => file2.slice(repoDir.length).replace(/^\/+/, ""));
|
|
61743
61754
|
}
|
|
61744
61755
|
async function readText2(file2) {
|
|
@@ -61748,16 +61759,16 @@ async function readText2(file2) {
|
|
|
61748
61759
|
throw new KitError(`cannot read ${file2}`, [error62 instanceof Error ? error62.message : String(error62)]);
|
|
61749
61760
|
}
|
|
61750
61761
|
}
|
|
61751
|
-
function parseProject(
|
|
61752
|
-
const { data, body: body2 } = splitFrontMatter(
|
|
61762
|
+
function parseProject(text2, where2) {
|
|
61763
|
+
const { data, body: body2 } = splitFrontMatter(text2, where2);
|
|
61753
61764
|
const sections = sectionsOf(body2);
|
|
61754
61765
|
return {
|
|
61755
61766
|
schemaVersion: data["schemaVersion"],
|
|
61756
61767
|
project: { name: data["name"], goal: sectionText(sections.get("Goal")), constraints: bulletsOf(sections.get("Constraints"), `${where2} Constraints`) }
|
|
61757
61768
|
};
|
|
61758
61769
|
}
|
|
61759
|
-
function parseMilestones(
|
|
61760
|
-
const { body: body2 } = splitFrontMatter(
|
|
61770
|
+
function parseMilestones(text2, where2) {
|
|
61771
|
+
const { body: body2 } = splitFrontMatter(text2, where2);
|
|
61761
61772
|
const milestones = [];
|
|
61762
61773
|
let current2;
|
|
61763
61774
|
let inAcceptance = false;
|
|
@@ -61785,8 +61796,8 @@ function parseMilestones(text, where2) {
|
|
|
61785
61796
|
}
|
|
61786
61797
|
return milestones;
|
|
61787
61798
|
}
|
|
61788
|
-
function parseTask(
|
|
61789
|
-
const { data, body: body2 } = splitFrontMatter(
|
|
61799
|
+
function parseTask(text2, where2) {
|
|
61800
|
+
const { data, body: body2 } = splitFrontMatter(text2, where2);
|
|
61790
61801
|
const sections = sectionsOf(body2);
|
|
61791
61802
|
return {
|
|
61792
61803
|
id: data["id"],
|
|
@@ -61841,14 +61852,14 @@ async function readOptional(file2) {
|
|
|
61841
61852
|
}
|
|
61842
61853
|
}
|
|
61843
61854
|
function classifyCommand(command) {
|
|
61844
|
-
const
|
|
61845
|
-
if (/^(echo|printf|cat|export|git|curl|wget|mkdir|cp|mv|rm|set|source)\b/.test(
|
|
61846
|
-
if (/^(pnpm|npm|yarn|bun)\s+(install|ci|i)\b/.test(
|
|
61847
|
-
if (/^(pip3?|python3? -m pip|sudo|apt|apt-get|brew|cargo install|go install|npm (i|install) -g)\b/.test(
|
|
61848
|
-
if (/\b(typecheck|type-check|tsc|mypy|pyright)\b/.test(
|
|
61849
|
-
if (/\b(lint|eslint|ruff|flake8|biome|clippy|golangci-lint)\b/.test(
|
|
61850
|
-
if (/\b(test|tests|pytest|vitest|jest)\b/.test(
|
|
61851
|
-
if (/\bbuild\b/.test(
|
|
61855
|
+
const text2 = command.trim();
|
|
61856
|
+
if (/^(echo|printf|cat|export|git|curl|wget|mkdir|cp|mv|rm|set|source)\b/.test(text2)) return void 0;
|
|
61857
|
+
if (/^(pnpm|npm|yarn|bun)\s+(install|ci|i)\b/.test(text2) || /^(pip3?|python3? -m pip)\s+install\s+(-r|-e|--requirement|--editable|\.)/.test(text2) || /^(uv sync|poetry install|bundle install)\b/.test(text2)) return "install";
|
|
61858
|
+
if (/^(pip3?|python3? -m pip|sudo|apt|apt-get|brew|cargo install|go install|npm (i|install) -g)\b/.test(text2)) return void 0;
|
|
61859
|
+
if (/\b(typecheck|type-check|tsc|mypy|pyright)\b/.test(text2)) return "typecheck";
|
|
61860
|
+
if (/\b(lint|eslint|ruff|flake8|biome|clippy|golangci-lint)\b/.test(text2)) return "lint";
|
|
61861
|
+
if (/\b(test|tests|pytest|vitest|jest)\b/.test(text2)) return "test";
|
|
61862
|
+
if (/\bbuild\b/.test(text2)) return "build";
|
|
61852
61863
|
return void 0;
|
|
61853
61864
|
}
|
|
61854
61865
|
async function packageManagerOf(repoDir, pkg) {
|
|
@@ -62027,9 +62038,9 @@ async function readOptional2(file2) {
|
|
|
62027
62038
|
return void 0;
|
|
62028
62039
|
}
|
|
62029
62040
|
}
|
|
62030
|
-
function parseTasksFile(
|
|
62041
|
+
function parseTasksFile(text2, where2) {
|
|
62031
62042
|
let block2 = { milestones: {}, tasks: {} };
|
|
62032
|
-
const match = BLOCK_PATTERN.exec(
|
|
62043
|
+
const match = BLOCK_PATTERN.exec(text2);
|
|
62033
62044
|
if (match) {
|
|
62034
62045
|
try {
|
|
62035
62046
|
block2 = BlockSchema.parse(JSON.parse(match[1] ?? ""));
|
|
@@ -62046,7 +62057,7 @@ function parseTasksFile(text, where2) {
|
|
|
62046
62057
|
}
|
|
62047
62058
|
return state.current;
|
|
62048
62059
|
};
|
|
62049
|
-
for (const line3 of
|
|
62060
|
+
for (const line3 of text2.replace(BLOCK_PATTERN, "").replace(/\r\n/g, "\n").split("\n")) {
|
|
62050
62061
|
const heading = /^##\s+Phase\s+(\d+)\s*[:\u2013\u2014-]\s*(.*?)\s*$/i.exec(line3);
|
|
62051
62062
|
if (heading) {
|
|
62052
62063
|
let title2 = heading[2] ?? "";
|
|
@@ -62102,8 +62113,8 @@ function parseStories(specText) {
|
|
|
62102
62113
|
}
|
|
62103
62114
|
return stories;
|
|
62104
62115
|
}
|
|
62105
|
-
function parseConstitution(
|
|
62106
|
-
const noComments =
|
|
62116
|
+
function parseConstitution(text2) {
|
|
62117
|
+
const noComments = text2.replace(/<!--[\s\S]*?-->/g, "");
|
|
62107
62118
|
const h1 = /^#\s+(.+?)\s*$/m.exec(noComments)?.[1];
|
|
62108
62119
|
const name2 = h1 ? h1.replace(/\s+Constitution$/i, "").trim() : void 0;
|
|
62109
62120
|
const sections = sectionsOf(noComments);
|
|
@@ -62127,8 +62138,8 @@ function parseConstitution(text) {
|
|
|
62127
62138
|
}
|
|
62128
62139
|
async function findConstitution(repoDir) {
|
|
62129
62140
|
for (const rel of CONSTITUTION_PATHS) {
|
|
62130
|
-
const
|
|
62131
|
-
if (
|
|
62141
|
+
const text2 = await readOptional2(join17(repoDir, rel));
|
|
62142
|
+
if (text2 !== void 0) return { file: rel, text: text2 };
|
|
62132
62143
|
}
|
|
62133
62144
|
return void 0;
|
|
62134
62145
|
}
|
|
@@ -62304,9 +62315,9 @@ function window2(value) {
|
|
|
62304
62315
|
}
|
|
62305
62316
|
function readUsage(deps) {
|
|
62306
62317
|
try {
|
|
62307
|
-
const
|
|
62308
|
-
if (
|
|
62309
|
-
const raw = JSON.parse(
|
|
62318
|
+
const text2 = readText(join18(deps.paths.configDir, "usage.json"));
|
|
62319
|
+
if (text2 === null) return null;
|
|
62320
|
+
const raw = JSON.parse(text2);
|
|
62310
62321
|
if (typeof raw.updatedAt !== "number") return null;
|
|
62311
62322
|
return { updatedAt: raw.updatedAt, fiveHour: window2(raw.fiveHour), sevenDay: window2(raw.sevenDay) };
|
|
62312
62323
|
} catch {
|
|
@@ -62840,7 +62851,7 @@ async function submitTask(deps, input2) {
|
|
|
62840
62851
|
}
|
|
62841
62852
|
};
|
|
62842
62853
|
}
|
|
62843
|
-
var sha256 = (
|
|
62854
|
+
var sha256 = (text2) => `sha256:${createHash4("sha256").update(text2).digest("hex")}`;
|
|
62844
62855
|
async function recordEvidence(deps, input2) {
|
|
62845
62856
|
if (input2.level !== "L1") throw new UsageError("evidence needs --level L1 (L2 evidence comes from CI on the pushed commit)");
|
|
62846
62857
|
const command = input2.words.join(" ").trim();
|
|
@@ -64210,15 +64221,15 @@ async function planned(inv, method, path, body2, note) {
|
|
|
64210
64221
|
}
|
|
64211
64222
|
var usd = (cents) => `$${Math.trunc(cents / 100)}.${String(cents % 100).padStart(2, "0")}`;
|
|
64212
64223
|
var micros = (value) => value % 1e4 === 0 ? usd(value / 1e4) : `$${(value / 1e6).toFixed(3)}`;
|
|
64213
|
-
function parseUsdToCents(
|
|
64214
|
-
const match = /^(\d{1,7})(?:\.(\d{1,2}))?$/.exec(
|
|
64224
|
+
function parseUsdToCents(text2) {
|
|
64225
|
+
const match = /^(\d{1,7})(?:\.(\d{1,2}))?$/.exec(text2.trim());
|
|
64215
64226
|
if (match === null) throw new UsageError("--usd must be an amount like 50 or 12.50", { hint: "overlane billing caps set --scope team --usd 50" });
|
|
64216
64227
|
return Number(match[1]) * 100 + Number((match[2] ?? "").padEnd(2, "0") || "0");
|
|
64217
64228
|
}
|
|
64218
|
-
function positiveInt(
|
|
64219
|
-
if (
|
|
64220
|
-
if (!/^\d+$/.test(
|
|
64221
|
-
return Number(
|
|
64229
|
+
function positiveInt(text2, flag) {
|
|
64230
|
+
if (text2 === void 0) return void 0;
|
|
64231
|
+
if (!/^\d+$/.test(text2) || Number(text2) < 1) throw new UsageError(`--${flag} must be a whole number of at least 1`);
|
|
64232
|
+
return Number(text2);
|
|
64222
64233
|
}
|
|
64223
64234
|
var PLAN_FLAG = (plans, required2) => ({ name: "plan", type: "string", required: required2, enum: plans, value: "PLAN", description: "The plan" });
|
|
64224
64235
|
var INTERVAL_FLAG = { name: "interval", type: "string", enum: ["month", "year"], value: "month|year", description: "Billing period; annual billing is cheaper per month" };
|
|
@@ -64483,10 +64494,10 @@ var approvalHeaders = (inv) => {
|
|
|
64483
64494
|
const id2 = textFlag(inv, "approval");
|
|
64484
64495
|
return id2 === void 0 ? void 0 : { [APPROVAL_HEADER]: id2 };
|
|
64485
64496
|
};
|
|
64486
|
-
function positive(
|
|
64487
|
-
if (
|
|
64488
|
-
if (!/^\d+$/.test(
|
|
64489
|
-
return Number(
|
|
64497
|
+
function positive(text2, flag) {
|
|
64498
|
+
if (text2 === void 0) return void 0;
|
|
64499
|
+
if (!/^\d+$/.test(text2) || Number(text2) < 1) throw new UsageError(`--${flag} must be a whole number of at least 1`);
|
|
64500
|
+
return Number(text2);
|
|
64490
64501
|
}
|
|
64491
64502
|
function arg(inv, index, what, hint) {
|
|
64492
64503
|
const value = inv.positionals[index];
|
|
@@ -64959,8 +64970,8 @@ var prOpenCommand = defineCommand({
|
|
|
64959
64970
|
const title = textFlag(inv, "title");
|
|
64960
64971
|
if (head === void 0 || title === void 0) throw new UsageError("--head and --title are required", { hint: 'overlane repo pr open app --head feature/x --title "Add x"' });
|
|
64961
64972
|
const base5 = textFlag(inv, "base");
|
|
64962
|
-
const
|
|
64963
|
-
const body2 = { requestId: requestId4(), title, head, ...base5 === void 0 ? {} : { base: base5 }, ...
|
|
64973
|
+
const text2 = textFlag(inv, "body");
|
|
64974
|
+
const body2 = { requestId: requestId4(), title, head, ...base5 === void 0 ? {} : { base: base5 }, ...text2 === void 0 ? {} : { body: text2 }, draft: boolFlag(inv, "draft") };
|
|
64964
64975
|
if (inv.dryRun) return planned2(inv, "repo", "POST", (t2, p2) => gitPaths.pulls(t2, p2, repo), body2);
|
|
64965
64976
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
64966
64977
|
return { data: await call2(PullRequest, "POST", gitPaths.pulls(tenantId, projectId, repo), body2) };
|
|
@@ -65090,21 +65101,21 @@ var ciValidateCommand = defineCommand({
|
|
|
65090
65101
|
text: (d) => d.ok ? [`${d.file} is valid: jobs ${d.jobs.join(", ")}`] : formatConfigIssues(d.file, d.issues),
|
|
65091
65102
|
handler: async (inv) => {
|
|
65092
65103
|
const file2 = textFlag(inv, "file") ?? PIPELINE_CONFIG_PATH;
|
|
65093
|
-
let
|
|
65104
|
+
let text2;
|
|
65094
65105
|
try {
|
|
65095
|
-
|
|
65106
|
+
text2 = readFileSync9(resolve9(inv.deps.paths.cwd, file2), "utf8");
|
|
65096
65107
|
} catch {
|
|
65097
65108
|
throw new UsageError(`could not read ${file2}`, { hint: "overlane ci validate --file <path>" });
|
|
65098
65109
|
}
|
|
65099
|
-
const parsed = parsePipelineConfig(
|
|
65110
|
+
const parsed = parsePipelineConfig(text2);
|
|
65100
65111
|
const data = { ok: parsed.ok, file: file2, jobs: parsed.ok ? Object.keys(parsed.config.jobs) : [], issues: parsed.ok ? [] : parsed.issues };
|
|
65101
65112
|
return parsed.ok ? { data } : { data, exit: EXIT.usage };
|
|
65102
65113
|
}
|
|
65103
65114
|
});
|
|
65104
65115
|
async function gitFact(inv, args2) {
|
|
65105
65116
|
const out2 = await inv.deps.exec("git", args2, { cwd: inv.deps.paths.cwd });
|
|
65106
|
-
const
|
|
65107
|
-
return out2.code === 0 &&
|
|
65117
|
+
const text2 = out2.stdout.trim();
|
|
65118
|
+
return out2.code === 0 && text2.length > 0 ? text2 : void 0;
|
|
65108
65119
|
}
|
|
65109
65120
|
var ciRunCommand = defineCommand({
|
|
65110
65121
|
path: ["ci", "run"],
|
|
@@ -66154,14 +66165,14 @@ var shown = (deps, issue2) => isAgent(deps) ? forAgent(issue2) : issue2;
|
|
|
66154
66165
|
var textOf = (value) => typeof value === "string" ? value : value.text;
|
|
66155
66166
|
var IssueShown = external_exports.union([Issue, AgentIssueView]);
|
|
66156
66167
|
var line = (issue2) => `#${issue2.number} ${issue2.issueId} ${issue2.status} ${issue2.priority} ${issue2.assignee === null ? "unassigned" : issue2.assignee.type} ${textOf(issue2.title)}`;
|
|
66157
|
-
function parseAssignee(
|
|
66158
|
-
if (
|
|
66159
|
-
if (
|
|
66160
|
-
const [kind, value] = [
|
|
66168
|
+
function parseAssignee(text2) {
|
|
66169
|
+
if (text2 === void 0) throw new UsageError("assign needs an assignee: human:<user-id>, agent:claude-code, agent:codex, bot:<bot-id> or none");
|
|
66170
|
+
if (text2 === "none") return null;
|
|
66171
|
+
const [kind, value] = [text2.slice(0, text2.indexOf(":")), text2.slice(text2.indexOf(":") + 1)];
|
|
66161
66172
|
if (kind === "human" && value.length > 0) return { type: "human", userId: value };
|
|
66162
66173
|
if (kind === "agent" && (value === "claude-code" || value === "codex")) return { type: "agent", executor: value };
|
|
66163
66174
|
if (kind === "bot" && /^bot_[A-Za-z0-9]{8,32}$/.test(value)) return { type: "bot", botId: value };
|
|
66164
|
-
throw new UsageError(`"${
|
|
66175
|
+
throw new UsageError(`"${text2}" is not an assignee; use human:<user-id>, agent:claude-code, agent:codex, bot:<bot-id> or none`);
|
|
66165
66176
|
}
|
|
66166
66177
|
function priorityFlag(inv) {
|
|
66167
66178
|
const value = inv.values["priority"];
|
|
@@ -66384,10 +66395,10 @@ init_zod();
|
|
|
66384
66395
|
var common7 = { needsAuth: true, needsNetwork: true };
|
|
66385
66396
|
var Deleted = external_exports.object({ deleted: external_exports.literal(true) });
|
|
66386
66397
|
var FIELDS = ["status", "priority", "assigneeType", "assignee", "labelId", "workProjectId", "cycleId", "estimate", "source", "title", "number", "createdAt", "updatedAt"];
|
|
66387
|
-
function parseCondition(
|
|
66388
|
-
const match = /^([A-Za-z]+)(!=|=|~)(.+)$/.exec(
|
|
66398
|
+
function parseCondition(text2) {
|
|
66399
|
+
const match = /^([A-Za-z]+)(!=|=|~)(.+)$/.exec(text2);
|
|
66389
66400
|
const field2 = match?.[1];
|
|
66390
|
-
if (match === null || field2 === void 0 || !FIELDS.includes(field2)) throw new UsageError(`"${
|
|
66401
|
+
if (match === null || field2 === void 0 || !FIELDS.includes(field2)) throw new UsageError(`"${text2}" is not a filter; write field=value, field!=value or field~value with a field from: ${FIELDS.join(", ")}`);
|
|
66391
66402
|
const value = /^\d+$/.test(match[3] ?? "") && (field2 === "number" || field2 === "estimate") ? Number(match[3]) : match[3];
|
|
66392
66403
|
return { field: field2, op: match[2] === "=" ? "eq" : match[2] === "!=" ? "neq" : "contains", value };
|
|
66393
66404
|
}
|
|
@@ -66594,29 +66605,29 @@ async function diffOf(inv) {
|
|
|
66594
66605
|
const pull = inv.positionals[0];
|
|
66595
66606
|
if (flag !== void 0 && pull !== void 0) throw new UsageError("give a pull request number or --diff, not both", { hint: "overlane review run --diff change.patch" });
|
|
66596
66607
|
let from;
|
|
66597
|
-
let
|
|
66608
|
+
let text2;
|
|
66598
66609
|
if (flag !== void 0) {
|
|
66599
66610
|
if (flag === "-") {
|
|
66600
66611
|
if (inv.deps.stdin === void 0) throw new UsageError("--diff - reads standard input, which is not available here", { hint: "overlane review run --diff change.patch" });
|
|
66601
66612
|
from = "standard input";
|
|
66602
|
-
|
|
66613
|
+
text2 = await inv.deps.stdin.read();
|
|
66603
66614
|
} else {
|
|
66604
66615
|
from = flag;
|
|
66605
|
-
|
|
66606
|
-
if (
|
|
66616
|
+
text2 = readText(resolve11(inv.deps.paths.cwd, flag));
|
|
66617
|
+
if (text2 === null) throw new UsageError(`could not read the diff file ${flag}`, { hint: "git diff > change.patch && overlane review run --diff change.patch" });
|
|
66607
66618
|
}
|
|
66608
66619
|
} else if (pull === void 0) {
|
|
66609
66620
|
if (inv.deps.stdin === void 0 || inv.deps.stdin.isTTY) {
|
|
66610
66621
|
throw new UsageError("nothing to review: give a diff (--diff change.patch, or pipe one in) or a pull request number", { hint: "overlane review run --diff change.patch" });
|
|
66611
66622
|
}
|
|
66612
66623
|
from = "standard input";
|
|
66613
|
-
|
|
66624
|
+
text2 = await inv.deps.stdin.read();
|
|
66614
66625
|
} else {
|
|
66615
66626
|
return void 0;
|
|
66616
66627
|
}
|
|
66617
|
-
if (
|
|
66618
|
-
if (
|
|
66619
|
-
return { text, from };
|
|
66628
|
+
if (text2.trim().length === 0) throw new UsageError(`the diff from ${from} is empty: there is nothing to review`, { hint: "git diff > change.patch && overlane review run --diff change.patch" });
|
|
66629
|
+
if (text2.length > MAX_PATCH_BYTES) throw new UsageError(`the diff is larger than ${MAX_PATCH_BYTES} characters; review it in parts`);
|
|
66630
|
+
return { text: text2, from };
|
|
66620
66631
|
}
|
|
66621
66632
|
function id(inv, what) {
|
|
66622
66633
|
const value = inv.positionals[0];
|
|
@@ -66946,8 +66957,8 @@ function stem(word) {
|
|
|
66946
66957
|
if (word.length > 3 && word.endsWith("s") && !word.endsWith("ss")) return word.slice(0, -1);
|
|
66947
66958
|
return word;
|
|
66948
66959
|
}
|
|
66949
|
-
function tokenize(
|
|
66950
|
-
const words =
|
|
66960
|
+
function tokenize(text2) {
|
|
66961
|
+
const words = text2.toLowerCase().split(/[^a-z0-9]+/).filter((word) => word.length > 0 && !STOP_WORDS.has(word));
|
|
66951
66962
|
const out2 = [];
|
|
66952
66963
|
for (let index = 0; index < words.length; index += 1) {
|
|
66953
66964
|
const word = words[index] ?? "";
|
|
@@ -69448,9 +69459,9 @@ async function secretOf(inv, required2) {
|
|
|
69448
69459
|
}
|
|
69449
69460
|
if (inv.values["secret-stdin"] === true) {
|
|
69450
69461
|
if (inv.deps.stdin === void 0) throw new UsageError("there is no standard input to read the secret from", { hint: "use --secret-env NAME" });
|
|
69451
|
-
const
|
|
69452
|
-
if (
|
|
69453
|
-
return
|
|
69462
|
+
const text2 = (await inv.deps.stdin.read()).trim();
|
|
69463
|
+
if (text2 === "") throw new UsageError("standard input was empty", { hint: "pipe the credential in, or use --secret-env NAME" });
|
|
69464
|
+
return text2;
|
|
69454
69465
|
}
|
|
69455
69466
|
if (required2) throw new UsageError("give the credential with --secret-env NAME or --secret-stdin (it is never taken from an argument)", { hint: "overlane schema connector connect" });
|
|
69456
69467
|
return void 0;
|
|
@@ -69534,9 +69545,9 @@ function inputOf(inv) {
|
|
|
69534
69545
|
const inline = textFlag(inv, "input");
|
|
69535
69546
|
const file2 = textFlag(inv, "input-file");
|
|
69536
69547
|
if (inline !== void 0 && file2 !== void 0) throw new UsageError("give --input or --input-file, not both", { hint: "overlane schema connector run" });
|
|
69537
|
-
const
|
|
69548
|
+
const text2 = inline ?? (file2 === void 0 ? "{}" : readFileSync13(file2, "utf8"));
|
|
69538
69549
|
try {
|
|
69539
|
-
const parsed = JSON.parse(
|
|
69550
|
+
const parsed = JSON.parse(text2);
|
|
69540
69551
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) throw new Error("not an object");
|
|
69541
69552
|
return parsed;
|
|
69542
69553
|
} catch {
|
|
@@ -69807,10 +69818,10 @@ function scopesOf(inv) {
|
|
|
69807
69818
|
return scopes;
|
|
69808
69819
|
}
|
|
69809
69820
|
function leaseFlag(inv) {
|
|
69810
|
-
const
|
|
69811
|
-
if (
|
|
69812
|
-
if (!/^\d+$/.test(
|
|
69813
|
-
return Number(
|
|
69821
|
+
const text2 = textFlag(inv, "lease-seconds");
|
|
69822
|
+
if (text2 === void 0) return void 0;
|
|
69823
|
+
if (!/^\d+$/.test(text2) || Number(text2) < 60) throw new UsageError("--lease-seconds is a whole number of at least 60");
|
|
69824
|
+
return Number(text2);
|
|
69814
69825
|
}
|
|
69815
69826
|
var claimAcquireCommand = defineCommand({
|
|
69816
69827
|
path: ["claim", "acquire"],
|
|
@@ -70248,9 +70259,9 @@ async function snapshotOf(inv, head, base5) {
|
|
|
70248
70259
|
return { provider: project.provider === "github" ? "github" : "overlane", repository, headSha: sha.stdout.trim(), baseRef: base5, files };
|
|
70249
70260
|
}
|
|
70250
70261
|
function numberOf(inv) {
|
|
70251
|
-
const
|
|
70252
|
-
if (
|
|
70253
|
-
return Number(
|
|
70262
|
+
const text2 = textFlag(inv, "number");
|
|
70263
|
+
if (text2 === void 0 || !/^[1-9]\d*$/.test(text2)) throw new UsageError("give the pull request number with --number", { hint: "overlane pr route --number 7" });
|
|
70264
|
+
return Number(text2);
|
|
70254
70265
|
}
|
|
70255
70266
|
function checkFlag(inv, name2) {
|
|
70256
70267
|
const value = textFlag(inv, name2);
|
|
@@ -70423,10 +70434,10 @@ async function planned8(inv, method, path, body2, note) {
|
|
|
70423
70434
|
const project = await offlineProject(inv.deps, "egress");
|
|
70424
70435
|
return planOutcome(inv.deps, dryRunPlan({ service: project.serviceUrl, requests: [{ method, path: path(project.binding.tenantId, project.binding.projectId), ...body2 === void 0 ? {} : { body: body2 }, ...note === void 0 ? {} : { note } }] }));
|
|
70425
70436
|
}
|
|
70426
|
-
function ruleOf(
|
|
70427
|
-
const [host, ports] =
|
|
70437
|
+
function ruleOf(text2) {
|
|
70438
|
+
const [host, ports] = text2.split(":");
|
|
70428
70439
|
const parsedPorts = ports === void 0 ? [443] : ports.split(",").map((p2) => /^\d{1,5}$/.test(p2) ? Number(p2) : Number.NaN);
|
|
70429
|
-
if (parsedPorts.some((p2) => !Number.isInteger(p2) || p2 < 1 || p2 > 65535)) throw new UsageError(`${
|
|
70440
|
+
if (parsedPorts.some((p2) => !Number.isInteger(p2) || p2 < 1 || p2 > 65535)) throw new UsageError(`${text2}: ports are whole numbers from 1 to 65535, for example registry.npmjs.org:443,8443`);
|
|
70430
70441
|
const checked2 = normaliseHost(host.replace(/^\*\./, "x."));
|
|
70431
70442
|
if (!checked2.ok || checked2.kind !== "name") throw new UsageError(`${host} is not a host name; an address cannot be a rule`, { hint: "overlane egress policy set --allow registry.npmjs.org" });
|
|
70432
70443
|
return { host: host.toLowerCase(), ports: parsedPorts };
|
|
@@ -70658,8 +70669,8 @@ async function secretValue2(inv, envFlag) {
|
|
|
70658
70669
|
return value;
|
|
70659
70670
|
}
|
|
70660
70671
|
if (inv.deps.stdin !== void 0 && !inv.deps.stdin.isTTY) {
|
|
70661
|
-
const
|
|
70662
|
-
if (
|
|
70672
|
+
const text2 = (await inv.deps.stdin.read()).trim();
|
|
70673
|
+
if (text2 !== "") return text2;
|
|
70663
70674
|
}
|
|
70664
70675
|
throw new UsageError("give the key through --value-env NAME or on standard input; it is never an argument", { hint: "overlane enterprise keys add --alias team-anthropic --provider anthropic --value-env PROVIDER_KEY" });
|
|
70665
70676
|
}
|
|
@@ -70972,9 +70983,9 @@ var enterpriseRetentionSetCommand = defineCommand({
|
|
|
70972
70983
|
handler: async (inv) => {
|
|
70973
70984
|
const raw = inv.values["rule"];
|
|
70974
70985
|
const texts = (Array.isArray(raw) ? raw : raw === void 0 ? [] : [raw]).filter((v) => typeof v === "string");
|
|
70975
|
-
const rules = texts.map((
|
|
70976
|
-
const [dataClass, days] =
|
|
70977
|
-
if (dataClass === void 0 || days === void 0 || !/^\d{1,4}$/.test(days)) throw new UsageError(`${
|
|
70986
|
+
const rules = texts.map((text2) => {
|
|
70987
|
+
const [dataClass, days] = text2.split("=");
|
|
70988
|
+
if (dataClass === void 0 || days === void 0 || !/^\d{1,4}$/.test(days)) throw new UsageError(`${text2}: use CLASS=DAYS, for example memory=365`);
|
|
70978
70989
|
return { dataClass, days: Number(days) };
|
|
70979
70990
|
});
|
|
70980
70991
|
if (inv.dryRun) return planned9(inv, "PUT", enterprisePaths.retention, { rules });
|
|
@@ -71104,11 +71115,11 @@ var enterpriseSsoGroupsSetCommand = defineCommand({
|
|
|
71104
71115
|
handler: async (inv) => {
|
|
71105
71116
|
const raw = inv.values["map"];
|
|
71106
71117
|
const texts = (Array.isArray(raw) ? raw : raw === void 0 ? [] : [raw]).filter((v) => typeof v === "string");
|
|
71107
|
-
const mappings = texts.map((
|
|
71108
|
-
const at =
|
|
71109
|
-
const groupName = at < 1 ? "" :
|
|
71110
|
-
const role =
|
|
71111
|
-
if (groupName === "" || !["viewer", "member", "admin"].includes(role)) throw new UsageError(`${
|
|
71118
|
+
const mappings = texts.map((text2) => {
|
|
71119
|
+
const at = text2.lastIndexOf("=");
|
|
71120
|
+
const groupName = at < 1 ? "" : text2.slice(0, at);
|
|
71121
|
+
const role = text2.slice(at + 1);
|
|
71122
|
+
if (groupName === "" || !["viewer", "member", "admin"].includes(role)) throw new UsageError(`${text2}: use GROUP=ROLE with ROLE viewer, member or admin`, { hint: "overlane enterprise sso groups set --map Engineering=member" });
|
|
71112
71123
|
return { groupName, role };
|
|
71113
71124
|
});
|
|
71114
71125
|
const body2 = { cap: textFlag(inv, "cap") ?? "admin", mappings };
|
|
@@ -71688,8 +71699,8 @@ function shortPath(cwd, path) {
|
|
|
71688
71699
|
return rel === "" || rel.startsWith("..") ? path : rel;
|
|
71689
71700
|
}
|
|
71690
71701
|
var sha7 = (sha) => sha.slice(0, 7);
|
|
71691
|
-
function clip(
|
|
71692
|
-
const one =
|
|
71702
|
+
function clip(text2, max) {
|
|
71703
|
+
const one = text2.replace(/\s+/g, " ").trim();
|
|
71693
71704
|
return one.length <= max ? one : `${one.slice(0, max - 1)}\u2026`;
|
|
71694
71705
|
}
|
|
71695
71706
|
|
|
@@ -71719,8 +71730,8 @@ function formatGitBrief(b) {
|
|
|
71719
71730
|
const where2 = b.upstream === null ? "no upstream" : `ahead ${b.ahead} behind ${b.behind} of ${b.upstream}`;
|
|
71720
71731
|
return `${b.branch} ${b.sha} ${where2}, ${b.dirty} dirty, last: ${b.subject === "" ? "(no commits)" : b.subject}`;
|
|
71721
71732
|
}
|
|
71722
|
-
function openP0Lines(
|
|
71723
|
-
return
|
|
71733
|
+
function openP0Lines(text2) {
|
|
71734
|
+
return text2.split("\n").filter((line3) => /^\s*- \[ \]\s+P0\b/.test(line3)).map((line3) => clip(line3.trim(), 160));
|
|
71724
71735
|
}
|
|
71725
71736
|
async function brief(ctx, input2) {
|
|
71726
71737
|
const mode = input2.mode ?? "all";
|
|
@@ -71826,14 +71837,14 @@ var LoadedIndex = class {
|
|
|
71826
71837
|
return this.callerMap.get(i2) ?? [];
|
|
71827
71838
|
}
|
|
71828
71839
|
};
|
|
71829
|
-
function parseIndex(
|
|
71840
|
+
function parseIndex(text2) {
|
|
71830
71841
|
let raw;
|
|
71831
71842
|
try {
|
|
71832
|
-
const cut =
|
|
71833
|
-
raw = JSON.parse(cut > 0 ? `${
|
|
71843
|
+
const cut = text2.lastIndexOf(',"words":[');
|
|
71844
|
+
raw = JSON.parse(cut > 0 ? `${text2.slice(0, cut)}}}` : text2);
|
|
71834
71845
|
} catch {
|
|
71835
71846
|
try {
|
|
71836
|
-
raw = JSON.parse(
|
|
71847
|
+
raw = JSON.parse(text2);
|
|
71837
71848
|
} catch {
|
|
71838
71849
|
return null;
|
|
71839
71850
|
}
|
|
@@ -71855,13 +71866,13 @@ function loadFreshIndex(ctx, root) {
|
|
|
71855
71866
|
async function loadFreshIndexUncached(ctx, root) {
|
|
71856
71867
|
const file2 = join27(root, INDEX_PATH);
|
|
71857
71868
|
if (!existsSync10(file2)) return { state: "missing" };
|
|
71858
|
-
let
|
|
71869
|
+
let text2;
|
|
71859
71870
|
try {
|
|
71860
|
-
|
|
71871
|
+
text2 = readFileSync16(file2, "utf8");
|
|
71861
71872
|
} catch {
|
|
71862
71873
|
return { state: "missing" };
|
|
71863
71874
|
}
|
|
71864
|
-
const index = parseIndex(
|
|
71875
|
+
const index = parseIndex(text2);
|
|
71865
71876
|
if (index === null) return { state: "unusable", reason: "the index file is not a version 1 code index" };
|
|
71866
71877
|
const [diff, untracked, head, count] = await Promise.all([
|
|
71867
71878
|
ctx.git(["diff", "--name-only", index.sha], root),
|
|
@@ -71909,11 +71920,11 @@ function braceEnd(lines, start2, limit = lines.length) {
|
|
|
71909
71920
|
let quote4 = "";
|
|
71910
71921
|
const stop3 = Math.min(limit, lines.length);
|
|
71911
71922
|
for (let n = start2; n <= stop3; n += 1) {
|
|
71912
|
-
const
|
|
71923
|
+
const text2 = lines[n - 1] ?? "";
|
|
71913
71924
|
let lastCode = "";
|
|
71914
|
-
for (let i2 = 0; i2 <
|
|
71915
|
-
const c2 =
|
|
71916
|
-
const two =
|
|
71925
|
+
for (let i2 = 0; i2 < text2.length; i2 += 1) {
|
|
71926
|
+
const c2 = text2[i2];
|
|
71927
|
+
const two = text2.slice(i2, i2 + 2);
|
|
71917
71928
|
if (block2) {
|
|
71918
71929
|
if (two === "*/") {
|
|
71919
71930
|
block2 = false;
|
|
@@ -71945,9 +71956,9 @@ function braceEnd(lines, start2, limit = lines.length) {
|
|
|
71945
71956
|
}
|
|
71946
71957
|
if (quote4 === '"' || quote4 === "'") quote4 = "";
|
|
71947
71958
|
if (depth <= 0 && quote4 === "" && !block2) {
|
|
71948
|
-
const t2 =
|
|
71959
|
+
const t2 = text2.trim();
|
|
71949
71960
|
if (opened || depth < 0) return n;
|
|
71950
|
-
if (t2 !== "" && !/[=,(&|?:+\-*/<>]$/.test(t2) && lastCode !== "" && !/^\s*(?:@|\/\/)/.test(
|
|
71961
|
+
if (t2 !== "" && !/[=,(&|?:+\-*/<>]$/.test(t2) && lastCode !== "" && !/^\s*(?:@|\/\/)/.test(text2)) {
|
|
71951
71962
|
const nextText = (lines[n] ?? "").trim();
|
|
71952
71963
|
if (!/^[|&?:.]/.test(nextText) && !/^extends\b|^implements\b/.test(nextText)) return n;
|
|
71953
71964
|
}
|
|
@@ -71959,10 +71970,10 @@ function indentEnd(lines, start2) {
|
|
|
71959
71970
|
const base5 = (lines[start2 - 1] ?? "").match(/^\s*/)?.[0].length ?? 0;
|
|
71960
71971
|
let end = start2;
|
|
71961
71972
|
for (let n = start2 + 1; n <= lines.length; n += 1) {
|
|
71962
|
-
const
|
|
71963
|
-
if (
|
|
71964
|
-
const indent =
|
|
71965
|
-
if (indent <= base5 && !/^\s*[)\]}]/.test(
|
|
71973
|
+
const text2 = lines[n - 1] ?? "";
|
|
71974
|
+
if (text2.trim() === "") continue;
|
|
71975
|
+
const indent = text2.match(/^\s*/)?.[0].length ?? 0;
|
|
71976
|
+
if (indent <= base5 && !/^\s*[)\]}]/.test(text2)) break;
|
|
71966
71977
|
end = n;
|
|
71967
71978
|
}
|
|
71968
71979
|
return end;
|
|
@@ -71982,7 +71993,7 @@ var SOURCE_FILE = /\.(?:[cm]?[jt]sx?|py|go|rs|java|rb|php|cs|kt|swift|astro|vue|
|
|
|
71982
71993
|
var DEF_WORDS = "function\\*?|class|interface|type|enum|const|let|var|def|fn|func|struct|trait|namespace|abstract class";
|
|
71983
71994
|
var KIND_RANK = { function: 0, class: 1, interface: 2, type: 3, constant: 4, method: 5, variable: 6, namespace: 7, property: 9 };
|
|
71984
71995
|
var GREP_EXCLUDES = [":(exclude)pnpm-lock.yaml", ":(exclude)*.lock", ":(exclude)evals/results"];
|
|
71985
|
-
var escapeRegex2 = (
|
|
71996
|
+
var escapeRegex2 = (text2) => text2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
71986
71997
|
var isTestPath = (path) => /(?:^|\/)(?:tests?|__tests__|fixtures)\/|\.(?:test|spec)\.[a-z]+$/.test(path);
|
|
71987
71998
|
function readLines(root, path) {
|
|
71988
71999
|
try {
|
|
@@ -72027,10 +72038,10 @@ function scanForDefinitions(root, files, name2) {
|
|
|
72027
72038
|
if (!SOURCE_FILE.test(path)) continue;
|
|
72028
72039
|
const lines = readLines(root, path);
|
|
72029
72040
|
if (lines === null) continue;
|
|
72030
|
-
lines.forEach((
|
|
72031
|
-
const m =
|
|
72041
|
+
lines.forEach((text2, i2) => {
|
|
72042
|
+
const m = text2.match(regex);
|
|
72032
72043
|
if (m === null) return;
|
|
72033
|
-
const word = (
|
|
72044
|
+
const word = (text2.match(new RegExp(`(?:${DEF_WORDS})(?=\\s+${escapeRegex2(name2)})`))?.[0] ?? "const").replace("abstract ", "").replace("*", "");
|
|
72034
72045
|
hits.push({ kind: KIND_OF_WORD[word] ?? "constant", qualified: name2, path, line: i2 + 1 });
|
|
72035
72046
|
});
|
|
72036
72047
|
}
|
|
@@ -72225,14 +72236,14 @@ async function outlineCore(ctx, input2) {
|
|
|
72225
72236
|
notice = fresh.state === "ready" ? fresh.changed.has(path) ? `${path} changed since index ${sha7(fresh.index.sha)}; outline by pattern` : `${path} is not in the index; outline by pattern` : indexProblem(fresh);
|
|
72226
72237
|
const lines = readLines(root, path) ?? [];
|
|
72227
72238
|
const any2 = new RegExp(`^(?:export\\s+)?(?:default\\s+)?(?:declare\\s+)?(?:async\\s+)?(${DEF_WORDS})\\s+([A-Za-z_$][\\w$]*)`);
|
|
72228
|
-
lines.forEach((
|
|
72229
|
-
const m =
|
|
72239
|
+
lines.forEach((text3, i2) => {
|
|
72240
|
+
const m = text3.match(any2);
|
|
72230
72241
|
if (m !== null) symbols2.push({ line: i2 + 1, kind: KIND_OF_WORD[m[1].replace("*", "")] ?? "constant", name: m[2] });
|
|
72231
72242
|
});
|
|
72232
72243
|
}
|
|
72233
|
-
const
|
|
72244
|
+
const text2 = symbols2.map((s) => `${s.line} ${s.kind} ${s.name}`);
|
|
72234
72245
|
if (symbols2.length === 0) return { data: { path, source, symbols: symbols2, ...notice === "" ? {} : { notice } }, lines: [...notice === "" ? [] : [notice], `none: no symbols in ${path}`], exit: 4 };
|
|
72235
|
-
return { data: { path, source, symbols: symbols2, ...notice === "" ? {} : { notice } }, lines: [...notice === "" ? [] : [notice], ...
|
|
72246
|
+
return { data: { path, source, symbols: symbols2, ...notice === "" ? {} : { notice } }, lines: [...notice === "" ? [] : [notice], ...text2], exit: 0 };
|
|
72236
72247
|
}
|
|
72237
72248
|
async function refsCore(ctx, input2) {
|
|
72238
72249
|
const root = findRoot(ctx.cwd);
|
|
@@ -72293,6 +72304,143 @@ async function refsCore(ctx, input2) {
|
|
|
72293
72304
|
return { data, lines, exit: 0 };
|
|
72294
72305
|
}
|
|
72295
72306
|
|
|
72307
|
+
// ../cli/src/token/cloud.ts
|
|
72308
|
+
import { execFileSync } from "node:child_process";
|
|
72309
|
+
import { readFileSync as readFileSync18 } from "node:fs";
|
|
72310
|
+
import { homedir } from "node:os";
|
|
72311
|
+
import { join as join29 } from "node:path";
|
|
72312
|
+
var CLOUD_TIMEOUT_MS = 4e3;
|
|
72313
|
+
var BINDING_FILE2 = join29(".harness", "project.json");
|
|
72314
|
+
var KEYCHAIN_SERVICE2 = "mvrx-harness";
|
|
72315
|
+
var CloudUnavailable = class extends Error {
|
|
72316
|
+
};
|
|
72317
|
+
var text = (value) => typeof value === "string" && value.length > 0 ? value : void 0;
|
|
72318
|
+
function readCloudBinding(root) {
|
|
72319
|
+
try {
|
|
72320
|
+
const raw = JSON.parse(readFileSync18(join29(root, BINDING_FILE2), "utf8"));
|
|
72321
|
+
const serviceUrl = text(raw["serviceUrl"]);
|
|
72322
|
+
const tenantId = text(raw["tenantId"]);
|
|
72323
|
+
const projectId = text(raw["projectId"]);
|
|
72324
|
+
if (serviceUrl === void 0 || tenantId === void 0 || projectId === void 0 || !serviceUrl.startsWith("https://")) return null;
|
|
72325
|
+
return { serviceUrl: serviceUrl.replace(/\/+$/, ""), tenantId, projectId };
|
|
72326
|
+
} catch {
|
|
72327
|
+
return null;
|
|
72328
|
+
}
|
|
72329
|
+
}
|
|
72330
|
+
function configDir(env) {
|
|
72331
|
+
const base5 = env["XDG_CONFIG_HOME"] ?? (process.platform === "win32" ? env["APPDATA"] : void 0) ?? join29(homedir(), ".config");
|
|
72332
|
+
return join29(base5, "mvrx-harness");
|
|
72333
|
+
}
|
|
72334
|
+
function readKeychain(serviceUrl) {
|
|
72335
|
+
const commands = {
|
|
72336
|
+
darwin: ["security", ["find-generic-password", "-s", KEYCHAIN_SERVICE2, "-a", serviceUrl, "-w"]],
|
|
72337
|
+
linux: ["secret-tool", ["lookup", "service", KEYCHAIN_SERVICE2, "username", serviceUrl]]
|
|
72338
|
+
};
|
|
72339
|
+
const command = commands[process.platform];
|
|
72340
|
+
if (command === void 0) return null;
|
|
72341
|
+
try {
|
|
72342
|
+
const out2 = execFileSync(command[0], command[1], { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"], timeout: 150 }).trim();
|
|
72343
|
+
return out2.length > 0 ? out2 : null;
|
|
72344
|
+
} catch {
|
|
72345
|
+
return null;
|
|
72346
|
+
}
|
|
72347
|
+
}
|
|
72348
|
+
function usable(raw, now) {
|
|
72349
|
+
if (typeof raw !== "object" || raw === null) return null;
|
|
72350
|
+
const stored = raw;
|
|
72351
|
+
if (typeof stored.accessToken !== "string" || stored.accessToken.length === 0) return null;
|
|
72352
|
+
if (typeof stored.expiresAt === "number" && stored.expiresAt <= now) return null;
|
|
72353
|
+
return stored.accessToken;
|
|
72354
|
+
}
|
|
72355
|
+
function findCloudToken(ctx, serviceUrl) {
|
|
72356
|
+
const fromEnv = ctx.env["HARNESS_TOKEN"];
|
|
72357
|
+
if (fromEnv !== void 0 && fromEnv.length > 0) return fromEnv;
|
|
72358
|
+
const stored = (ctx.keychain ?? readKeychain)(serviceUrl);
|
|
72359
|
+
if (stored !== null) {
|
|
72360
|
+
try {
|
|
72361
|
+
const token = usable(JSON.parse(stored), ctx.now());
|
|
72362
|
+
if (token !== null) return token;
|
|
72363
|
+
} catch {
|
|
72364
|
+
}
|
|
72365
|
+
}
|
|
72366
|
+
try {
|
|
72367
|
+
const file2 = JSON.parse(readFileSync18(join29(configDir(ctx.env), "credentials.json"), "utf8"));
|
|
72368
|
+
return usable(file2[serviceUrl], ctx.now());
|
|
72369
|
+
} catch {
|
|
72370
|
+
return null;
|
|
72371
|
+
}
|
|
72372
|
+
}
|
|
72373
|
+
function readOverlaySession(root) {
|
|
72374
|
+
try {
|
|
72375
|
+
const id2 = readFileSync18(join29(root, ".harness", "overlay", "session"), "utf8").trim();
|
|
72376
|
+
return /^[A-Za-z0-9._-]{1,64}$/.test(id2) ? id2 : void 0;
|
|
72377
|
+
} catch {
|
|
72378
|
+
return void 0;
|
|
72379
|
+
}
|
|
72380
|
+
}
|
|
72381
|
+
function cloudState(ctx, root) {
|
|
72382
|
+
const offline = ctx.env["OVERLANE_OFFLINE"] ?? ctx.env["HARNESS_OFFLINE"];
|
|
72383
|
+
if (offline !== void 0 && offline !== "" && offline !== "0" && offline !== "false") return { state: "offline" };
|
|
72384
|
+
const binding = readCloudBinding(root);
|
|
72385
|
+
if (binding === null) return { state: "unbound" };
|
|
72386
|
+
const token = findCloudToken(ctx, binding.serviceUrl);
|
|
72387
|
+
return token === null ? { state: "no-credentials", binding } : { state: "ready", binding, token };
|
|
72388
|
+
}
|
|
72389
|
+
var isObject2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
72390
|
+
var FRESHNESS = /* @__PURE__ */ new Set(["fresh", "partial", "stale", "unavailable"]);
|
|
72391
|
+
function hasMeta(value) {
|
|
72392
|
+
const coverage = value["coverage"];
|
|
72393
|
+
return isObject2(coverage) && typeof coverage["files"] === "number" && typeof value["freshness"] === "string" && FRESHNESS.has(value["freshness"]) && typeof value["incomplete"] === "boolean";
|
|
72394
|
+
}
|
|
72395
|
+
var CloudCodeSource = class {
|
|
72396
|
+
constructor(options) {
|
|
72397
|
+
this.options = options;
|
|
72398
|
+
}
|
|
72399
|
+
options;
|
|
72400
|
+
async call(route, args2, shape2) {
|
|
72401
|
+
const { ctx, binding, token, commit, session } = this.options;
|
|
72402
|
+
const doFetch = ctx.fetch ?? globalThis.fetch;
|
|
72403
|
+
const url2 = `${binding.serviceUrl}/v1/tenants/${encodeURIComponent(binding.tenantId)}/projects/${encodeURIComponent(binding.projectId)}/code/${route}`;
|
|
72404
|
+
const body2 = { ...commit === void 0 ? {} : { commit }, ...session === void 0 ? {} : { session }, ...args2 };
|
|
72405
|
+
const controller = new AbortController();
|
|
72406
|
+
const timer = setTimeout(() => controller.abort(), CLOUD_TIMEOUT_MS);
|
|
72407
|
+
try {
|
|
72408
|
+
const response = await doFetch(url2, { method: "POST", headers: { accept: "application/json", "content-type": "application/json", authorization: `Bearer ${token}` }, body: JSON.stringify(body2), signal: controller.signal });
|
|
72409
|
+
if (response.status === 401 || response.status === 403) throw new CloudUnavailable(`refused (HTTP ${response.status}); run overlane doctor`);
|
|
72410
|
+
if (!response.ok) throw new CloudUnavailable(`HTTP ${response.status}`);
|
|
72411
|
+
const parsed = JSON.parse(await response.text());
|
|
72412
|
+
if (!isObject2(parsed) || !shape2(parsed)) throw new CloudUnavailable("unexpected answer");
|
|
72413
|
+
return parsed;
|
|
72414
|
+
} catch (error62) {
|
|
72415
|
+
if (error62 instanceof CloudUnavailable) throw error62;
|
|
72416
|
+
throw new CloudUnavailable(controller.signal.aborted ? `no answer in ${CLOUD_TIMEOUT_MS / 1e3}s` : "unreachable");
|
|
72417
|
+
} finally {
|
|
72418
|
+
clearTimeout(timer);
|
|
72419
|
+
}
|
|
72420
|
+
}
|
|
72421
|
+
async find(name2, options) {
|
|
72422
|
+
return await this.call("find", { name: name2, ...options.kind === void 0 ? {} : { kind: options.kind }, ...options.limit === void 0 ? {} : { limit: options.limit } }, (v) => hasMeta(v) && Array.isArray(v["matches"]));
|
|
72423
|
+
}
|
|
72424
|
+
async outline(path, options) {
|
|
72425
|
+
return await this.call("outline", { path, ...options.all === true ? { all: true } : {} }, (v) => hasMeta(v) && Array.isArray(v["symbols"]));
|
|
72426
|
+
}
|
|
72427
|
+
async refs(name2, options) {
|
|
72428
|
+
return await this.call("refs", { name: name2, ...options.limit === void 0 ? {} : { limit: options.limit } }, (v) => hasMeta(v) && Array.isArray(v["matches"]) && Array.isArray(v["callers"]));
|
|
72429
|
+
}
|
|
72430
|
+
async span(target2, options) {
|
|
72431
|
+
return await this.call("span", { target: target2, ...options.kind === void 0 ? {} : { kind: options.kind } }, (v) => hasMeta(v) && typeof v["found"] === "boolean");
|
|
72432
|
+
}
|
|
72433
|
+
/** Source for a range, for a native project with no checkout here (the cloud reads it at the indexed commit). */
|
|
72434
|
+
async show(path, start2, end, maxLines) {
|
|
72435
|
+
return await this.call("show", { path, start: start2, end, maxLines }, (v) => hasMeta(v) && typeof v["text"] === "string");
|
|
72436
|
+
}
|
|
72437
|
+
};
|
|
72438
|
+
function metaHeader(meta3) {
|
|
72439
|
+
const sha = (value) => value === null ? "none" : value.slice(0, 7);
|
|
72440
|
+
const asked = meta3.requestedCommit !== null && meta3.requestedCommit !== meta3.indexedCommit ? ` (asked ${sha(meta3.requestedCommit)})` : "";
|
|
72441
|
+
return `@${sha(meta3.indexedCommit)} ${meta3.freshness}${asked}${meta3.overlay === void 0 ? "" : ` ${meta3.overlay}`} cov ${meta3.coverage.files}f/${meta3.coverage.symbols}s${meta3.incomplete ? " INCOMPLETE" : ""}`;
|
|
72442
|
+
}
|
|
72443
|
+
|
|
72296
72444
|
// ../cli/src/token/source.ts
|
|
72297
72445
|
async function navMeta(ctx) {
|
|
72298
72446
|
const root = findRoot(ctx.cwd);
|
|
@@ -72315,19 +72463,124 @@ async function withMeta(ctx, result) {
|
|
|
72315
72463
|
const meta3 = await navMeta(ctx);
|
|
72316
72464
|
return { ...result, data: { ...meta3, ...result.data } };
|
|
72317
72465
|
}
|
|
72318
|
-
var
|
|
72319
|
-
var
|
|
72320
|
-
var
|
|
72321
|
-
var
|
|
72466
|
+
var localFind = async (ctx, input2) => withMeta(ctx, await findCore(ctx, input2));
|
|
72467
|
+
var localShow = async (ctx, input2) => withMeta(ctx, await showCore(ctx, input2));
|
|
72468
|
+
var localOutline = async (ctx, input2) => withMeta(ctx, await outlineCore(ctx, input2));
|
|
72469
|
+
var localRefs = async (ctx, input2) => withMeta(ctx, await refsCore(ctx, input2));
|
|
72470
|
+
var PATH_LINE2 = /^(.+):(\d+)$/;
|
|
72471
|
+
var NO_ANSWER = /* @__PURE__ */ Symbol("no cloud answer");
|
|
72472
|
+
function fallbackNote(state, reason) {
|
|
72473
|
+
if (state.state === "offline") return "cloud: offline; answered from the local index";
|
|
72474
|
+
if (state.state === "no-credentials") return "cloud: no credentials; answered from the local index (overlane login)";
|
|
72475
|
+
if (state.state === "ready") return `cloud: ${reason ?? "unreachable"}; answered from the local index`;
|
|
72476
|
+
return void 0;
|
|
72477
|
+
}
|
|
72478
|
+
function withNote(result, note) {
|
|
72479
|
+
if (note === void 0) return result;
|
|
72480
|
+
const notice = result.data.notice === void 0 || result.data.notice === "" ? note : `${note}; ${result.data.notice}`;
|
|
72481
|
+
return { ...result, data: { ...result.data, notice }, lines: [note, ...result.lines] };
|
|
72482
|
+
}
|
|
72483
|
+
async function cloudFirst(ctx, ask, local2) {
|
|
72484
|
+
const root = findRoot(ctx.cwd);
|
|
72485
|
+
const state = cloudState(ctx, root);
|
|
72486
|
+
if (state.state !== "ready") return withNote(await local2(), fallbackNote(state));
|
|
72487
|
+
const head = await ctx.git(["rev-parse", "HEAD"], root);
|
|
72488
|
+
const commit = head.code === 0 && /^[0-9a-f]{40}$/.test(head.stdout.trim()) ? head.stdout.trim() : void 0;
|
|
72489
|
+
const source = new CloudCodeSource({ ctx, binding: state.binding, token: state.token, commit, session: readOverlaySession(root) });
|
|
72490
|
+
try {
|
|
72491
|
+
const answer = await ask(source, root);
|
|
72492
|
+
if (answer !== NO_ANSWER) return answer;
|
|
72493
|
+
return withNote(await local2(), "cloud: index incomplete for this; answered from the local index");
|
|
72494
|
+
} catch (error62) {
|
|
72495
|
+
if (!(error62 instanceof CloudUnavailable)) throw error62;
|
|
72496
|
+
return withNote(await local2(), fallbackNote(state, error62.message));
|
|
72497
|
+
}
|
|
72498
|
+
}
|
|
72499
|
+
var noticeLines = (meta3) => meta3.notice === void 0 || meta3.notice === "" ? [] : [meta3.notice];
|
|
72500
|
+
var codeFind = (ctx, input2) => cloudFirst(
|
|
72501
|
+
ctx,
|
|
72502
|
+
async (source) => {
|
|
72503
|
+
const limit = Math.max(1, input2.limit ?? DEFAULT_FIND_LIMIT);
|
|
72504
|
+
const a = await source.find(input2.name, { kind: input2.kind, limit });
|
|
72505
|
+
if (a.matches.length === 0 && a.incomplete) return NO_ANSWER;
|
|
72506
|
+
const rows = a.matches.slice(0, limit).map((h) => `${h.kind} ${h.qualified} ${h.path}:${h.line}`);
|
|
72507
|
+
const head = [metaHeader(a), ...noticeLines(a)];
|
|
72508
|
+
if (rows.length === 0) return { data: a, lines: [...head, `none: no definition of ${input2.name}${input2.kind === void 0 ? "" : ` (kind ${input2.kind})`}`], exit: 4 };
|
|
72509
|
+
return { data: a, lines: [...head, ...rows, ...a.more ? [`more: overlane code find ${input2.name} --limit ${limit * 3}`] : []], exit: 0 };
|
|
72510
|
+
},
|
|
72511
|
+
() => localFind(ctx, input2)
|
|
72512
|
+
);
|
|
72513
|
+
var codeOutline = (ctx, input2) => cloudFirst(
|
|
72514
|
+
ctx,
|
|
72515
|
+
async (source, root) => {
|
|
72516
|
+
const path = resolveFile(ctx, root, input2.path) ?? input2.path;
|
|
72517
|
+
const a = await source.outline(path, { all: input2.all });
|
|
72518
|
+
if (a.symbols.length === 0 && a.incomplete) return NO_ANSWER;
|
|
72519
|
+
const rows = a.symbols.map((s) => `${s.line} ${s.kind} ${s.name}`);
|
|
72520
|
+
const head = [metaHeader(a), ...noticeLines(a)];
|
|
72521
|
+
return { data: a, lines: rows.length === 0 ? [...head, `none: no symbols in ${a.path}`] : [...head, ...rows], exit: rows.length === 0 ? 4 : 0 };
|
|
72522
|
+
},
|
|
72523
|
+
() => localOutline(ctx, input2)
|
|
72524
|
+
);
|
|
72525
|
+
var codeRefs = (ctx, input2) => cloudFirst(
|
|
72526
|
+
ctx,
|
|
72527
|
+
async (source) => {
|
|
72528
|
+
const limit = Math.max(1, input2.limit ?? DEFAULT_REFS_LIMIT);
|
|
72529
|
+
const a = await source.refs(input2.name, { limit });
|
|
72530
|
+
if (a.matches.length === 0 && a.callers.length === 0 && a.incomplete) return NO_ANSWER;
|
|
72531
|
+
const rows = [...a.callers.slice(0, limit).map((h) => `caller ${h.qualified} ${h.path}:${h.line}`), ...a.matches.slice(0, limit).map((h) => `${h.path}:${h.line} ${h.text}`)];
|
|
72532
|
+
const head = [metaHeader(a), ...noticeLines(a)];
|
|
72533
|
+
if (rows.length === 0) return { data: a, lines: [...head, `none: no references to ${input2.name}`], exit: 4 };
|
|
72534
|
+
return { data: a, lines: [...head, ...rows, ...a.more > 0 ? [`+${a.more} more: overlane code refs ${input2.name} --limit ${limit * 3}`] : []], exit: 0 };
|
|
72535
|
+
},
|
|
72536
|
+
() => localRefs(ctx, input2)
|
|
72537
|
+
);
|
|
72538
|
+
var hitOf2 = (h) => ({ kind: h.kind, qualified: h.qualified, path: h.path, line: h.line });
|
|
72539
|
+
var codeShow = (ctx, input2) => cloudFirst(
|
|
72540
|
+
ctx,
|
|
72541
|
+
async (source, root) => {
|
|
72542
|
+
const at = PATH_LINE2.exec(input2.target);
|
|
72543
|
+
const file2 = at === null ? null : resolveFile(ctx, root, at[1]);
|
|
72544
|
+
const target2 = at !== null && file2 !== null ? `${file2}:${at[2]}` : input2.target;
|
|
72545
|
+
const span = await source.span(target2, { kind: input2.kind });
|
|
72546
|
+
const meta3 = { indexedCommit: span.indexedCommit, requestedCommit: span.requestedCommit, coverage: span.coverage, freshness: span.freshness, incomplete: span.incomplete, ...span.notice === void 0 ? {} : { notice: span.notice }, ...span.overlay === void 0 ? {} : { overlay: span.overlay } };
|
|
72547
|
+
if (!span.found) {
|
|
72548
|
+
if (span.incomplete) return NO_ANSWER;
|
|
72549
|
+
return { data: { ...meta3, path: "", kind: "", qualified: input2.target, start: 0, end: 0, from: 0, to: 0, truncated: false, remaining: 0, text: [], also: [] }, lines: [metaHeader(span), ...noticeLines(span), `none: no definition of ${input2.target}`], exit: 4 };
|
|
72550
|
+
}
|
|
72551
|
+
const notes = [metaHeader(span), ...noticeLines(span)];
|
|
72552
|
+
const cap = Math.max(1, input2.max ?? SHOW_CAP);
|
|
72553
|
+
const also = span.also.map(hitOf2);
|
|
72554
|
+
const lines = readLines(root, span.path);
|
|
72555
|
+
const end = Math.max(span.start, span.end);
|
|
72556
|
+
if (lines !== null) {
|
|
72557
|
+
const shown2 = finishShow(span.path, span.kind, span.qualified, span.start, Math.min(end, lines.length), lines, Math.max(0, input2.context ?? 0), input2.from, cap, also, notes);
|
|
72558
|
+
return { ...shown2, data: { ...meta3, ...shown2.data } };
|
|
72559
|
+
}
|
|
72560
|
+
let remote = null;
|
|
72561
|
+
try {
|
|
72562
|
+
remote = (await source.show(span.path, span.start, end, cap)).text.split("\n");
|
|
72563
|
+
if (remote.at(-1) === "") remote.pop();
|
|
72564
|
+
} catch (error62) {
|
|
72565
|
+
if (!(error62 instanceof CloudUnavailable)) throw error62;
|
|
72566
|
+
}
|
|
72567
|
+
const body2 = remote === null ? [] : remote.map((t2, i2) => `${span.start + i2} ${t2}`);
|
|
72568
|
+
const header = `${span.path}:${span.start}-${end} ${span.kind}${span.qualified === "" ? "" : ` ${span.qualified}`}`;
|
|
72569
|
+
const hint = remote === null ? [`no checkout of ${span.path} here and the cloud holds no source for it; read lines ${span.start}-${end} from the repository`] : [];
|
|
72570
|
+
const data = { ...meta3, path: span.path, kind: span.kind, qualified: span.qualified, start: span.start, end, from: span.start, to: remote === null ? span.start : span.start + remote.length - 1, truncated: false, remaining: 0, text: body2, also };
|
|
72571
|
+
return { data, lines: [...notes, header, ...body2, ...hint], exit: 0 };
|
|
72572
|
+
},
|
|
72573
|
+
() => localShow(ctx, input2)
|
|
72574
|
+
);
|
|
72322
72575
|
|
|
72323
72576
|
// ../cli/src/token/exec.ts
|
|
72324
72577
|
import { spawn } from "node:child_process";
|
|
72325
72578
|
import { createWriteStream, mkdirSync as mkdirSync10 } from "node:fs";
|
|
72326
|
-
import { join as
|
|
72579
|
+
import { join as join30 } from "node:path";
|
|
72327
72580
|
|
|
72328
72581
|
// ../cli/src/token/parsers.ts
|
|
72329
72582
|
var ANSI = /\u001b\[[0-9;?]*[A-Za-z]/g;
|
|
72330
|
-
var stripAnsi = (
|
|
72583
|
+
var stripAnsi = (text2) => text2.replace(ANSI, "");
|
|
72331
72584
|
var MAX_FAILURES = 15;
|
|
72332
72585
|
function groupByPackage(lines) {
|
|
72333
72586
|
const known = /* @__PURE__ */ new Set();
|
|
@@ -72356,9 +72609,9 @@ function groupByPackage(lines) {
|
|
|
72356
72609
|
return { groups, prefixed: true };
|
|
72357
72610
|
}
|
|
72358
72611
|
var packageOf = (key) => key.split(" ")[0] ?? key;
|
|
72359
|
-
function parseCountLine(
|
|
72360
|
-
const get = (word) => Number(
|
|
72361
|
-
return { failed: get("failed"), passed: get("passed"), skipped: get("skipped"), todo: get("todo"), total: Number(
|
|
72612
|
+
function parseCountLine(text2) {
|
|
72613
|
+
const get = (word) => Number(text2.match(new RegExp(`(\\d+) ${word}`))?.[1] ?? 0);
|
|
72614
|
+
return { failed: get("failed"), passed: get("passed"), skipped: get("skipped"), todo: get("todo"), total: Number(text2.match(/\((\d+)\)/)?.[1] ?? 0) };
|
|
72362
72615
|
}
|
|
72363
72616
|
function parseVitestBlock(lines, packageName2) {
|
|
72364
72617
|
const clean2 = lines.map(stripAnsi);
|
|
@@ -72561,14 +72814,14 @@ function wranglerErrors(lines) {
|
|
|
72561
72814
|
for (let i2 = 0; i2 < lines.length; i2 += 1) {
|
|
72562
72815
|
const m = lines[i2].match(/^\s*✘\s*\[ERROR\]\s*(.*)$/);
|
|
72563
72816
|
if (m === null) continue;
|
|
72564
|
-
let
|
|
72817
|
+
let text2 = m[1];
|
|
72565
72818
|
for (let j = i2 + 1; j < Math.min(lines.length, i2 + 5); j += 1) {
|
|
72566
72819
|
const next = lines[j].trim();
|
|
72567
72820
|
if (next === "") continue;
|
|
72568
72821
|
if (/^✘|^▲|^If you think/.test(next)) break;
|
|
72569
|
-
if (
|
|
72822
|
+
if (text2.length < 160) text2 += ` ${next}`;
|
|
72570
72823
|
}
|
|
72571
|
-
errors.push(clip(
|
|
72824
|
+
errors.push(clip(text2, 220));
|
|
72572
72825
|
}
|
|
72573
72826
|
return errors.slice(0, 10);
|
|
72574
72827
|
}
|
|
@@ -72686,10 +72939,10 @@ async function execCommand(ctx, input2) {
|
|
|
72686
72939
|
}
|
|
72687
72940
|
const command = commandLine(input2.tokens);
|
|
72688
72941
|
const root = findRoot(ctx.cwd);
|
|
72689
|
-
const dir =
|
|
72942
|
+
const dir = join30(root, ".harness", "logs");
|
|
72690
72943
|
mkdirSync10(dir, { recursive: true });
|
|
72691
72944
|
const started = ctx.now();
|
|
72692
|
-
const logFile =
|
|
72945
|
+
const logFile = join30(dir, `${utcStamp(started)}-${slugOf(input2.name, command)}.log`);
|
|
72693
72946
|
const stream = createWriteStream(logFile);
|
|
72694
72947
|
const chunks = [];
|
|
72695
72948
|
let captured = 0;
|
|
@@ -72728,8 +72981,8 @@ function signalNumber(signal) {
|
|
|
72728
72981
|
}
|
|
72729
72982
|
|
|
72730
72983
|
// ../cli/src/token/ledger.ts
|
|
72731
|
-
import { existsSync as existsSync12, readFileSync as
|
|
72732
|
-
import { join as
|
|
72984
|
+
import { existsSync as existsSync12, readFileSync as readFileSync19 } from "node:fs";
|
|
72985
|
+
import { join as join31, resolve as resolve16 } from "node:path";
|
|
72733
72986
|
var LEDGER_PATH = ".harness/token-ledger.jsonl";
|
|
72734
72987
|
var CATEGORY_RULES = [
|
|
72735
72988
|
["wrangler", /\bwrangler\b/],
|
|
@@ -72744,8 +72997,8 @@ var CATEGORY_RULES = [
|
|
|
72744
72997
|
];
|
|
72745
72998
|
function categorise(tool, command) {
|
|
72746
72999
|
if (tool === "Bash" || tool === "bash" || tool === "shell") {
|
|
72747
|
-
const
|
|
72748
|
-
for (const [name2, pattern] of CATEGORY_RULES) if (pattern.test(
|
|
73000
|
+
const text2 = (command ?? "").trim();
|
|
73001
|
+
for (const [name2, pattern] of CATEGORY_RULES) if (pattern.test(text2)) return name2;
|
|
72749
73002
|
return "other";
|
|
72750
73003
|
}
|
|
72751
73004
|
if (tool === "Grep" || tool === "Glob") return "grep/sed/cat";
|
|
@@ -72776,10 +73029,10 @@ function parseSince(value, now) {
|
|
|
72776
73029
|
if (Number.isNaN(date5)) throw new CoreError(`--since must be like 7d, 12h, 30m or a date; got "${value}"`, { exit: 2, code: "usage", hint: "overlane tokens report --since 7d" });
|
|
72777
73030
|
return date5;
|
|
72778
73031
|
}
|
|
72779
|
-
function readLedger(
|
|
73032
|
+
function readLedger(text2) {
|
|
72780
73033
|
const calls = [];
|
|
72781
73034
|
let skipped = 0;
|
|
72782
|
-
for (const line3 of
|
|
73035
|
+
for (const line3 of text2.split("\n")) {
|
|
72783
73036
|
if (line3.trim() === "") continue;
|
|
72784
73037
|
try {
|
|
72785
73038
|
const o = JSON.parse(line3);
|
|
@@ -72803,11 +73056,11 @@ function textOf2(content) {
|
|
|
72803
73056
|
if (Array.isArray(content)) return content.map((part) => typeof part === "string" ? part : typeof part.text === "string" ? part.text : "").join("");
|
|
72804
73057
|
return "";
|
|
72805
73058
|
}
|
|
72806
|
-
function readTranscript(
|
|
73059
|
+
function readTranscript(text2) {
|
|
72807
73060
|
const pending = /* @__PURE__ */ new Map();
|
|
72808
73061
|
const order = [];
|
|
72809
73062
|
let skipped = 0;
|
|
72810
|
-
for (const line3 of
|
|
73063
|
+
for (const line3 of text2.split("\n")) {
|
|
72811
73064
|
if (line3.trim() === "") continue;
|
|
72812
73065
|
let entry;
|
|
72813
73066
|
try {
|
|
@@ -72864,14 +73117,14 @@ async function tokensReport(ctx, input2) {
|
|
|
72864
73117
|
const file2 = resolve16(ctx.cwd, input2.transcript);
|
|
72865
73118
|
if (!existsSync12(file2)) return { data: { source: input2.transcript, since: input2.since ?? null, calls: 0, tokens: 0, skipped: 0, rows: [] }, lines: [`none: no transcript at ${input2.transcript}`], exit: 4 };
|
|
72866
73119
|
source = input2.transcript;
|
|
72867
|
-
read = readTranscript(
|
|
73120
|
+
read = readTranscript(readFileSync19(file2, "utf8"));
|
|
72868
73121
|
} else {
|
|
72869
|
-
const file2 =
|
|
73122
|
+
const file2 = join31(root, LEDGER_PATH);
|
|
72870
73123
|
if (!existsSync12(file2)) {
|
|
72871
73124
|
return { data: { source: LEDGER_PATH, since: input2.since ?? null, calls: 0, tokens: 0, skipped: 0, rows: [] }, lines: [`none: no ledger at ${LEDGER_PATH}; the tool-call hook writes it, or pass --transcript <path.jsonl>`], exit: 4 };
|
|
72872
73125
|
}
|
|
72873
73126
|
source = LEDGER_PATH;
|
|
72874
|
-
read = readLedger(
|
|
73127
|
+
read = readLedger(readFileSync19(file2, "utf8"));
|
|
72875
73128
|
}
|
|
72876
73129
|
const calls = cutoff === null ? read.calls : read.calls.filter((c2) => c2.ts >= cutoff);
|
|
72877
73130
|
const report2 = buildReport(calls, top, source, input2.since ?? null, read.skipped);
|
|
@@ -73229,7 +73482,7 @@ async function runCli(argv, deps, options) {
|
|
|
73229
73482
|
const globals = extractGlobals(argv);
|
|
73230
73483
|
const mode = outputMode(globals, deps, registry2.find(globals.tokens)?.spec.textDefault === true);
|
|
73231
73484
|
rememberSecret(deps.env["HARNESS_TOKEN"]);
|
|
73232
|
-
const inner = mode === "json" ? { ...deps, stdout: globals.verbose ? (
|
|
73485
|
+
const inner = mode === "json" ? { ...deps, stdout: globals.verbose ? (text2) => deps.stderr(redact(text2)) : () => void 0 } : deps;
|
|
73233
73486
|
const [first, ...more] = globals.tokens;
|
|
73234
73487
|
let current2;
|
|
73235
73488
|
try {
|
|
@@ -73322,38 +73575,38 @@ init_assets();
|
|
|
73322
73575
|
init_src2();
|
|
73323
73576
|
|
|
73324
73577
|
// src/data-dir.ts
|
|
73325
|
-
import { homedir } from "node:os";
|
|
73326
|
-
import { join as
|
|
73327
|
-
function dataDir(env = process.env, home =
|
|
73578
|
+
import { homedir as homedir2 } from "node:os";
|
|
73579
|
+
import { join as join36 } from "node:path";
|
|
73580
|
+
function dataDir(env = process.env, home = homedir2()) {
|
|
73328
73581
|
const override = env["MVRX_DATA_DIR"];
|
|
73329
73582
|
if (override !== void 0 && override !== "") return override;
|
|
73330
|
-
const base5 = env["XDG_DATA_HOME"] ?? (process.platform === "win32" ? env["LOCALAPPDATA"] : void 0) ?? (process.platform === "darwin" ?
|
|
73331
|
-
return
|
|
73583
|
+
const base5 = env["XDG_DATA_HOME"] ?? (process.platform === "win32" ? env["LOCALAPPDATA"] : void 0) ?? (process.platform === "darwin" ? join36(home, "Library", "Application Support") : join36(home, ".local", "share"));
|
|
73584
|
+
return join36(base5, "mvrx-harness");
|
|
73332
73585
|
}
|
|
73333
|
-
function marketplaceRoot(env = process.env, home =
|
|
73334
|
-
return
|
|
73586
|
+
function marketplaceRoot(env = process.env, home = homedir2()) {
|
|
73587
|
+
return join36(dataDir(env, home), "marketplace");
|
|
73335
73588
|
}
|
|
73336
73589
|
|
|
73337
73590
|
// src/plugin.ts
|
|
73338
|
-
import { readFileSync as
|
|
73339
|
-
import { join as
|
|
73591
|
+
import { readFileSync as readFileSync21 } from "node:fs";
|
|
73592
|
+
import { join as join38 } from "node:path";
|
|
73340
73593
|
import { parseArgs as parseArgs3 } from "node:util";
|
|
73341
73594
|
|
|
73342
73595
|
// src/marketplace.ts
|
|
73343
73596
|
init_src();
|
|
73344
73597
|
import { createHash as createHash7 } from "node:crypto";
|
|
73345
|
-
import { cpSync, existsSync as existsSync13, mkdirSync as mkdirSync11, readdirSync as readdirSync3, readFileSync as
|
|
73346
|
-
import { dirname as dirname12, join as
|
|
73598
|
+
import { cpSync, existsSync as existsSync13, mkdirSync as mkdirSync11, readdirSync as readdirSync3, readFileSync as readFileSync20, renameSync as renameSync7, rmSync as rmSync4, statSync as statSync3, writeFileSync as writeFileSync10 } from "node:fs";
|
|
73599
|
+
import { dirname as dirname12, join as join37, relative as relative4, sep } from "node:path";
|
|
73347
73600
|
var CLIENT_DIRS = ["claude", "codex"];
|
|
73348
73601
|
var EMBEDDED_MANIFEST = "release-manifest.json";
|
|
73349
|
-
var INSTALLED_MANIFEST =
|
|
73602
|
+
var INSTALLED_MANIFEST = join37(".release", "manifest.json");
|
|
73350
73603
|
var MarketplaceError = class extends Error {
|
|
73351
73604
|
};
|
|
73352
73605
|
function loadEmbedded(packageRoot2) {
|
|
73353
|
-
const dir =
|
|
73354
|
-
const path =
|
|
73606
|
+
const dir = join37(packageRoot2, "plugins");
|
|
73607
|
+
const path = join37(dir, EMBEDDED_MANIFEST);
|
|
73355
73608
|
if (!existsSync13(path)) throw new MarketplaceError(`this package has no embedded plugin release (${path} is missing)`);
|
|
73356
|
-
const parsed = ReleaseManifest.safeParse(JSON.parse(
|
|
73609
|
+
const parsed = ReleaseManifest.safeParse(JSON.parse(readFileSync20(path, "utf8")));
|
|
73357
73610
|
if (!parsed.success) throw new MarketplaceError(`the embedded release manifest is invalid: ${parsed.error.message}`);
|
|
73358
73611
|
return { dir, manifest: parsed.data };
|
|
73359
73612
|
}
|
|
@@ -73364,7 +73617,7 @@ function listFiles(root, dir = root) {
|
|
|
73364
73617
|
if (!existsSync13(dir)) return [];
|
|
73365
73618
|
const out2 = [];
|
|
73366
73619
|
for (const entry of readdirSync3(dir, { withFileTypes: true })) {
|
|
73367
|
-
const full =
|
|
73620
|
+
const full = join37(dir, entry.name);
|
|
73368
73621
|
if (entry.isDirectory()) out2.push(...listFiles(root, full));
|
|
73369
73622
|
else out2.push(relative4(root, full).split(sep).join("/"));
|
|
73370
73623
|
}
|
|
@@ -73376,15 +73629,15 @@ async function verifyTree(treeRoot, manifest) {
|
|
|
73376
73629
|
if (recomputed !== manifest.digest) problems.push(`manifest digest ${manifest.digest} does not match its file list (${recomputed})`);
|
|
73377
73630
|
const listed = new Set(manifest.files.map((file2) => file2.path));
|
|
73378
73631
|
for (const file2 of manifest.files) {
|
|
73379
|
-
const path =
|
|
73632
|
+
const path = join37(treeRoot, file2.path);
|
|
73380
73633
|
if (!existsSync13(path)) {
|
|
73381
73634
|
problems.push(`missing: ${file2.path}`);
|
|
73382
73635
|
continue;
|
|
73383
73636
|
}
|
|
73384
|
-
if (sha2562(
|
|
73637
|
+
if (sha2562(readFileSync20(path)) !== file2.digest) problems.push(`modified: ${file2.path}`);
|
|
73385
73638
|
}
|
|
73386
73639
|
for (const client of CLIENT_DIRS) {
|
|
73387
|
-
for (const found of listFiles(
|
|
73640
|
+
for (const found of listFiles(join37(treeRoot, client))) {
|
|
73388
73641
|
if (!listed.has(`${client}/${found}`)) problems.push(`unlisted: ${client}/${found}`);
|
|
73389
73642
|
}
|
|
73390
73643
|
}
|
|
@@ -73392,7 +73645,7 @@ async function verifyTree(treeRoot, manifest) {
|
|
|
73392
73645
|
}
|
|
73393
73646
|
function readInstalledManifest(target2) {
|
|
73394
73647
|
try {
|
|
73395
|
-
const parsed = ReleaseManifest.safeParse(JSON.parse(
|
|
73648
|
+
const parsed = ReleaseManifest.safeParse(JSON.parse(readFileSync20(join37(target2, INSTALLED_MANIFEST), "utf8")));
|
|
73396
73649
|
return parsed.success ? parsed.data : null;
|
|
73397
73650
|
} catch {
|
|
73398
73651
|
return null;
|
|
@@ -73420,10 +73673,10 @@ async function syncMarketplace(embedded, target2) {
|
|
|
73420
73673
|
mkdirSync11(staging, { recursive: true });
|
|
73421
73674
|
try {
|
|
73422
73675
|
for (const client of CLIENT_DIRS) {
|
|
73423
|
-
if (existsSync13(
|
|
73676
|
+
if (existsSync13(join37(embedded.dir, client))) cpSync(join37(embedded.dir, client), join37(staging, client), { recursive: true });
|
|
73424
73677
|
}
|
|
73425
|
-
mkdirSync11(
|
|
73426
|
-
writeFileSync10(
|
|
73678
|
+
mkdirSync11(join37(staging, ".release"), { recursive: true });
|
|
73679
|
+
writeFileSync10(join37(staging, INSTALLED_MANIFEST), `${JSON.stringify(embedded.manifest, null, 2)}
|
|
73427
73680
|
`);
|
|
73428
73681
|
const after = await verifyTree(staging, embedded.manifest);
|
|
73429
73682
|
if (after.length > 0) throw new MarketplaceError(`the copied plugin files do not match the release manifest:
|
|
@@ -73455,8 +73708,8 @@ var PLUGIN_USAGE = ` overlane plugin install [--scope project|user] [--client c
|
|
|
73455
73708
|
var PluginUsageError = class extends Error {
|
|
73456
73709
|
};
|
|
73457
73710
|
function readNames(treeRoot, client) {
|
|
73458
|
-
const file2 = client === "claude" ?
|
|
73459
|
-
const parsed = JSON.parse(
|
|
73711
|
+
const file2 = client === "claude" ? join38(treeRoot, "claude", ".claude-plugin", "marketplace.json") : join38(treeRoot, "codex", ".agents", "plugins", "marketplace.json");
|
|
73712
|
+
const parsed = JSON.parse(readFileSync21(file2, "utf8"));
|
|
73460
73713
|
const record3 = parsed;
|
|
73461
73714
|
const plugin = record3.plugins?.[0]?.name;
|
|
73462
73715
|
if (typeof record3.name !== "string" || typeof plugin !== "string") throw new MarketplaceError(`${file2} names no marketplace or plugin`);
|
|
@@ -73469,8 +73722,8 @@ async function step(deps, program, args2, cwd) {
|
|
|
73469
73722
|
deps.stdout(` $ ${[program, ...args2].join(" ")}
|
|
73470
73723
|
`);
|
|
73471
73724
|
const result = await deps.exec(program, args2, { cwd });
|
|
73472
|
-
const
|
|
73473
|
-
if (
|
|
73725
|
+
const text2 = `${result.stdout}${result.stderr}`.trim();
|
|
73726
|
+
if (text2 !== "") deps.stdout(`${text2.split("\n").map((line3) => ` ${line3}`).join("\n")}
|
|
73474
73727
|
`);
|
|
73475
73728
|
return result.code === 0;
|
|
73476
73729
|
}
|
|
@@ -73502,7 +73755,7 @@ ${PLUGIN_USAGE}`);
|
|
|
73502
73755
|
const key = `${names.plugin}@${names.marketplace}`;
|
|
73503
73756
|
if (!await available(deps, client)) {
|
|
73504
73757
|
if (explicit !== void 0) {
|
|
73505
|
-
deps.stderr(`overlane: \`${client}\` was not found on PATH; the marketplace is at ${
|
|
73758
|
+
deps.stderr(`overlane: \`${client}\` was not found on PATH; the marketplace is at ${join38(root, client)}
|
|
73506
73759
|
`);
|
|
73507
73760
|
failed = true;
|
|
73508
73761
|
} else {
|
|
@@ -73514,7 +73767,7 @@ ${PLUGIN_USAGE}`);
|
|
|
73514
73767
|
ranAny = true;
|
|
73515
73768
|
deps.stdout(`${client}:
|
|
73516
73769
|
`);
|
|
73517
|
-
const dir =
|
|
73770
|
+
const dir = join38(root, client);
|
|
73518
73771
|
const steps = client === "claude" ? [
|
|
73519
73772
|
["claude", ["plugin", "marketplace", "add", dir, "--scope", scope]],
|
|
73520
73773
|
["claude", ["plugin", "marketplace", "update", names.marketplace]],
|
|
@@ -73549,10 +73802,10 @@ ${PLUGIN_USAGE}`);
|
|
|
73549
73802
|
}
|
|
73550
73803
|
|
|
73551
73804
|
// src/shim.ts
|
|
73552
|
-
import { execFileSync as
|
|
73805
|
+
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
73553
73806
|
function repositoryRoot(cwd) {
|
|
73554
73807
|
try {
|
|
73555
|
-
return
|
|
73808
|
+
return execFileSync3("git", ["rev-parse", "--show-toplevel"], { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
73556
73809
|
} catch {
|
|
73557
73810
|
return null;
|
|
73558
73811
|
}
|
|
@@ -73681,8 +73934,8 @@ var packageCommands = [indexBuildCommand, indexUploadCommand, shimCommand, plugi
|
|
|
73681
73934
|
|
|
73682
73935
|
// src/deps.ts
|
|
73683
73936
|
import { execFile as execFile5, spawn as spawn2 } from "node:child_process";
|
|
73684
|
-
import { homedir as
|
|
73685
|
-
import { join as
|
|
73937
|
+
import { homedir as homedir4 } from "node:os";
|
|
73938
|
+
import { join as join41 } from "node:path";
|
|
73686
73939
|
import { createInterface } from "node:readline/promises";
|
|
73687
73940
|
function exec(command, args2, options) {
|
|
73688
73941
|
return new Promise((resolveResult) => {
|
|
@@ -73727,19 +73980,19 @@ async function confirm(question) {
|
|
|
73727
73980
|
rl.close();
|
|
73728
73981
|
}
|
|
73729
73982
|
}
|
|
73730
|
-
function
|
|
73731
|
-
const base5 = env["XDG_CONFIG_HOME"] ?? (process.platform === "win32" ? env["APPDATA"] : void 0) ??
|
|
73732
|
-
return
|
|
73983
|
+
function configDir3(env) {
|
|
73984
|
+
const base5 = env["XDG_CONFIG_HOME"] ?? (process.platform === "win32" ? env["APPDATA"] : void 0) ?? join41(homedir4(), ".config");
|
|
73985
|
+
return join41(base5, "mvrx-harness");
|
|
73733
73986
|
}
|
|
73734
73987
|
function createDeps2(env = process.env) {
|
|
73735
73988
|
return {
|
|
73736
73989
|
exec,
|
|
73737
73990
|
fetch: (input2, init2) => globalThis.fetch(input2, init2),
|
|
73738
73991
|
keychain: noKeychain,
|
|
73739
|
-
paths: { cwd: process.cwd(), home:
|
|
73992
|
+
paths: { cwd: process.cwd(), home: homedir4(), configDir: configDir3(env), defaultMarketplaceRoot: marketplaceRoot(env) },
|
|
73740
73993
|
env,
|
|
73741
|
-
stdout: (
|
|
73742
|
-
stderr: (
|
|
73994
|
+
stdout: (text2) => void process.stdout.write(text2),
|
|
73995
|
+
stderr: (text2) => void process.stderr.write(text2),
|
|
73743
73996
|
isTTY: process.stdin.isTTY === true && process.stdout.isTTY === true,
|
|
73744
73997
|
stdoutIsTTY: process.stdout.isTTY === true,
|
|
73745
73998
|
confirm,
|