overlane 0.1.134 → 0.1.136
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 +1002 -376
- 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 +10 -1
- package/plugins/claude/plugins/mvrx-harness/scripts/harness-codemap.mjs +72 -0
- package/plugins/claude/plugins/mvrx-harness/scripts/harness-context.mjs +40 -39
- package/plugins/claude/plugins/mvrx-harness/scripts/harness-guard.mjs +33 -33
- package/plugins/claude/plugins/mvrx-harness/scripts/harness-intake.mjs +34 -34
- package/plugins/claude/plugins/mvrx-harness/scripts/harness-quota.mjs +38 -38
- package/plugins/claude/plugins/mvrx-harness/scripts/harness-statusline.mjs +34 -34
- package/plugins/claude/plugins/mvrx-harness/scripts/harness-stop.mjs +38 -38
- package/plugins/codex/plugins/mvrx-harness/.codex-plugin/plugin.json +1 -1
- package/plugins/codex/plugins/mvrx-harness/hooks/hooks.json +11 -1
- package/plugins/codex/plugins/mvrx-harness/scripts/harness-codemap.mjs +72 -0
- package/plugins/codex/plugins/mvrx-harness/scripts/harness-context.mjs +40 -39
- package/plugins/codex/plugins/mvrx-harness/scripts/harness-guard.mjs +33 -33
- package/plugins/codex/plugins/mvrx-harness/scripts/harness-intake.mjs +34 -34
- package/plugins/codex/plugins/mvrx-harness/scripts/harness-quota.mjs +38 -38
- package/plugins/codex/plugins/mvrx-harness/scripts/harness-statusline.mjs +34 -34
- package/plugins/codex/plugins/mvrx-harness/scripts/harness-stop.mjs +38 -38
- package/plugins/release-manifest.json +32 -22
package/dist/overlane.mjs
CHANGED
|
@@ -603,8 +603,8 @@ function getLengthableOrigin(input2) {
|
|
|
603
603
|
return "unknown";
|
|
604
604
|
}
|
|
605
605
|
function parsedType(data) {
|
|
606
|
-
const
|
|
607
|
-
switch (
|
|
606
|
+
const t2 = typeof data;
|
|
607
|
+
switch (t2) {
|
|
608
608
|
case "number": {
|
|
609
609
|
return Number.isNaN(data) ? "nan" : "number";
|
|
610
610
|
}
|
|
@@ -621,7 +621,7 @@ function parsedType(data) {
|
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
|
-
return
|
|
624
|
+
return t2;
|
|
625
625
|
}
|
|
626
626
|
function issue(...args2) {
|
|
627
627
|
const [iss, input2, inst] = args2;
|
|
@@ -817,8 +817,8 @@ var init_util = __esm({
|
|
|
817
817
|
}
|
|
818
818
|
});
|
|
819
819
|
getParsedType = (data) => {
|
|
820
|
-
const
|
|
821
|
-
switch (
|
|
820
|
+
const t2 = typeof data;
|
|
821
|
+
switch (t2) {
|
|
822
822
|
case "undefined":
|
|
823
823
|
return "undefined";
|
|
824
824
|
case "string":
|
|
@@ -857,7 +857,7 @@ var init_util = __esm({
|
|
|
857
857
|
}
|
|
858
858
|
return "object";
|
|
859
859
|
default:
|
|
860
|
-
throw new Error(`Unknown data type: ${
|
|
860
|
+
throw new Error(`Unknown data type: ${t2}`);
|
|
861
861
|
}
|
|
862
862
|
};
|
|
863
863
|
propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
@@ -2330,7 +2330,7 @@ function handleCatchall(proms, input2, payload, ctx, def, inst, abortEarly) {
|
|
|
2330
2330
|
const unrecognized = [];
|
|
2331
2331
|
const keySet = def.keySet;
|
|
2332
2332
|
const _catchall = def.catchall._zod;
|
|
2333
|
-
const
|
|
2333
|
+
const t2 = _catchall.def.type;
|
|
2334
2334
|
const optin = _catchall.optin;
|
|
2335
2335
|
const optout = _catchall.optout;
|
|
2336
2336
|
let seen = 0;
|
|
@@ -2343,11 +2343,11 @@ function handleCatchall(proms, input2, payload, ctx, def, inst, abortEarly) {
|
|
|
2343
2343
|
if (keySet.has(key))
|
|
2344
2344
|
continue;
|
|
2345
2345
|
if (key === "__proto__") {
|
|
2346
|
-
if (
|
|
2346
|
+
if (t2 === "never")
|
|
2347
2347
|
unrecognized.push(key);
|
|
2348
2348
|
continue;
|
|
2349
2349
|
}
|
|
2350
|
-
if (
|
|
2350
|
+
if (t2 === "never") {
|
|
2351
2351
|
unrecognized.push(key);
|
|
2352
2352
|
continue;
|
|
2353
2353
|
}
|
|
@@ -3632,7 +3632,7 @@ var init_schemas = __esm({
|
|
|
3632
3632
|
defineLazyInternal(inst, "pattern", (zod) => {
|
|
3633
3633
|
if (zod.def.options.every((o) => o._zod.pattern)) {
|
|
3634
3634
|
const patterns = zod.def.options.map((o) => o._zod.pattern);
|
|
3635
|
-
return new RegExp(`^(${patterns.map((
|
|
3635
|
+
return new RegExp(`^(${patterns.map((p2) => cleanRegex(p2.source)).join("|")})$`);
|
|
3636
3636
|
}
|
|
3637
3637
|
return void 0;
|
|
3638
3638
|
});
|
|
@@ -5684,7 +5684,7 @@ var init_ckb = __esm({
|
|
|
5684
5684
|
const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
|
|
5685
5685
|
const receivedType = parsedType(issue2.input);
|
|
5686
5686
|
const received = TypeDictionary[receivedType] ?? receivedType;
|
|
5687
|
-
const postfix = ["\u0627", "\u0648", "\u06C6", "\u0648\u0648", "\u06D5", "\u06CC", "\u06CE"].some((
|
|
5687
|
+
const postfix = ["\u0627", "\u0648", "\u06C6", "\u0648\u0648", "\u06D5", "\u06CC", "\u06CE"].some((p2) => received.endsWith(p2)) ? "\u06CC\u06D5" : "\u06D5";
|
|
5688
5688
|
const isEnglish = /^[a-zA-Z]+$/.test(received);
|
|
5689
5689
|
if (receivedType === "null" || receivedType === "undefined")
|
|
5690
5690
|
return `\u062F\u0627\u0648\u0627\u06A9\u0631\u0627\u0648\u06D5`;
|
|
@@ -7289,16 +7289,16 @@ var init_he = __esm({
|
|
|
7289
7289
|
number: { unit: "", shortLabel: "\u05E7\u05D8\u05DF", longLabel: "\u05D2\u05D3\u05D5\u05DC" }
|
|
7290
7290
|
// no unit
|
|
7291
7291
|
};
|
|
7292
|
-
const typeEntry = (
|
|
7293
|
-
const typeLabel = (
|
|
7294
|
-
const e2 = typeEntry(
|
|
7292
|
+
const typeEntry = (t2) => t2 ? TypeNames[t2] : void 0;
|
|
7293
|
+
const typeLabel = (t2) => {
|
|
7294
|
+
const e2 = typeEntry(t2);
|
|
7295
7295
|
if (e2)
|
|
7296
7296
|
return e2.label;
|
|
7297
|
-
return
|
|
7297
|
+
return t2 ?? TypeNames.unknown.label;
|
|
7298
7298
|
};
|
|
7299
|
-
const withDefinite = (
|
|
7300
|
-
const verbFor = (
|
|
7301
|
-
const e2 = typeEntry(
|
|
7299
|
+
const withDefinite = (t2) => `\u05D4${typeLabel(t2)}`;
|
|
7300
|
+
const verbFor = (t2) => {
|
|
7301
|
+
const e2 = typeEntry(t2);
|
|
7302
7302
|
const gender = e2?.gender ?? "m";
|
|
7303
7303
|
return gender === "f" ? "\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA" : "\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA";
|
|
7304
7304
|
};
|
|
@@ -12866,9 +12866,9 @@ var init_registries = __esm({
|
|
|
12866
12866
|
return this;
|
|
12867
12867
|
}
|
|
12868
12868
|
get(schema) {
|
|
12869
|
-
const
|
|
12870
|
-
if (
|
|
12871
|
-
const pm = { ...this.get(
|
|
12869
|
+
const p2 = schema._zod.parent;
|
|
12870
|
+
if (p2) {
|
|
12871
|
+
const pm = { ...this.get(p2) ?? {} };
|
|
12872
12872
|
delete pm.id;
|
|
12873
12873
|
const f = { ...pm, ...this._map.get(schema) };
|
|
12874
12874
|
return Object.keys(f).length ? f : void 0;
|
|
@@ -16106,8 +16106,8 @@ var init_to_json_schema = __esm({
|
|
|
16106
16106
|
function aggregateChecks(schema) {
|
|
16107
16107
|
const agg = {};
|
|
16108
16108
|
const def = schema._zod.def;
|
|
16109
|
-
const
|
|
16110
|
-
for (const ch of
|
|
16109
|
+
const list2 = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
|
|
16110
|
+
for (const ch of list2)
|
|
16111
16111
|
contributors[ch._zod.def.check]?.(agg, ch._zod.def);
|
|
16112
16112
|
const bag = schema._zod.bag;
|
|
16113
16113
|
if (bag.minimum !== void 0)
|
|
@@ -16161,7 +16161,7 @@ function stringifyKeyNames(bySchema, json2, visited) {
|
|
|
16161
16161
|
json2 = { ...json2, [keyword]: mapped };
|
|
16162
16162
|
}
|
|
16163
16163
|
const types = Array.isArray(json2.type) ? json2.type : [json2.type];
|
|
16164
|
-
const numericType = !types.includes("string") && types.some((
|
|
16164
|
+
const numericType = !types.includes("string") && types.some((t2) => t2 === "number" || t2 === "integer");
|
|
16165
16165
|
const values = json2.enum ?? (json2.const !== void 0 ? [json2.const] : void 0);
|
|
16166
16166
|
if (!numericType && !values?.some((v) => typeof v === "number"))
|
|
16167
16167
|
return json2;
|
|
@@ -16329,7 +16329,7 @@ var init_json_schema_processors = __esm({
|
|
|
16329
16329
|
[base64Charset, base64],
|
|
16330
16330
|
[base64urlCharset, base64url]
|
|
16331
16331
|
]);
|
|
16332
|
-
exactPattern = (
|
|
16332
|
+
exactPattern = (p2) => exactPatterns.get(p2) ?? p2;
|
|
16333
16333
|
stringProcessor = (schema, ctx, _json, _params) => {
|
|
16334
16334
|
const json2 = _json;
|
|
16335
16335
|
json2.type = "string";
|
|
@@ -19394,8 +19394,8 @@ function convertBaseSchema(schema, ctx) {
|
|
|
19394
19394
|
}
|
|
19395
19395
|
const type = schema.type;
|
|
19396
19396
|
if (Array.isArray(type)) {
|
|
19397
|
-
const typeSchemas = type.map((
|
|
19398
|
-
const typeSchema = { ...schema, type:
|
|
19397
|
+
const typeSchemas = type.map((t2) => {
|
|
19398
|
+
const typeSchema = { ...schema, type: t2 };
|
|
19399
19399
|
return convertBaseSchema(typeSchema, ctx);
|
|
19400
19400
|
});
|
|
19401
19401
|
if (typeSchemas.length === 0) {
|
|
@@ -19550,7 +19550,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
19550
19550
|
}
|
|
19551
19551
|
if (schema.additionalProperties === false) {
|
|
19552
19552
|
const propertyKeys = Object.keys(shape2);
|
|
19553
|
-
const patterns = patternKeys.map((
|
|
19553
|
+
const patterns = patternKeys.map((p2) => new RegExp(p2));
|
|
19554
19554
|
const basePatternSchema = zodSchema;
|
|
19555
19555
|
zodSchema = zodSchema.check((payload) => {
|
|
19556
19556
|
if (!isPlainObject(payload.value))
|
|
@@ -21450,7 +21450,7 @@ var init_identity = __esm({
|
|
|
21450
21450
|
ConfirmLinkRequest = external_exports.object({ secret: external_exports.string().min(20) }).strict();
|
|
21451
21451
|
ConfirmLinkResponse = external_exports.object({ ok: external_exports.literal(true), linkedToTenantId: TenantId }).strict();
|
|
21452
21452
|
EmailMessage = external_exports.object({
|
|
21453
|
-
kind: external_exports.enum(["invitation", "link_confirmation"]),
|
|
21453
|
+
kind: external_exports.enum(["invitation", "link_confirmation", "alert"]),
|
|
21454
21454
|
to: external_exports.string().email(),
|
|
21455
21455
|
subject: external_exports.string().min(1).max(200),
|
|
21456
21456
|
text: external_exports.string().min(1).max(5e3)
|
|
@@ -22351,22 +22351,22 @@ var init_issues = __esm({
|
|
|
22351
22351
|
IssueEventList = external_exports.object({ events: external_exports.array(FieldChangeEvent) }).strict();
|
|
22352
22352
|
base2 = (tenantId, projectId) => `/v1/tenants/${encodeURIComponent(tenantId)}/projects/${encodeURIComponent(projectId)}`;
|
|
22353
22353
|
issuePaths = {
|
|
22354
|
-
issues: (
|
|
22355
|
-
issue: (
|
|
22356
|
-
assign: (
|
|
22357
|
-
events: (
|
|
22358
|
-
import: (
|
|
22359
|
-
workProjects: (
|
|
22360
|
-
workProject: (
|
|
22361
|
-
cycles: (
|
|
22362
|
-
labels: (
|
|
22363
|
-
views: (
|
|
22364
|
-
viewRun: (
|
|
22365
|
-
loops: (
|
|
22366
|
-
loop: (
|
|
22367
|
-
loopFire: (
|
|
22368
|
-
sync: (
|
|
22369
|
-
syncDeliveries: (
|
|
22354
|
+
issues: (t2, p2) => `${base2(t2, p2)}/issues`,
|
|
22355
|
+
issue: (t2, p2, id2) => `${base2(t2, p2)}/issues/${encodeURIComponent(id2)}`,
|
|
22356
|
+
assign: (t2, p2, id2) => `${base2(t2, p2)}/issues/${encodeURIComponent(id2)}/assign`,
|
|
22357
|
+
events: (t2, p2, id2) => `${base2(t2, p2)}/issues/${encodeURIComponent(id2)}/events`,
|
|
22358
|
+
import: (t2, p2) => `${base2(t2, p2)}/issues-import`,
|
|
22359
|
+
workProjects: (t2, p2) => `${base2(t2, p2)}/work-projects`,
|
|
22360
|
+
workProject: (t2, p2, id2) => `${base2(t2, p2)}/work-projects/${encodeURIComponent(id2)}`,
|
|
22361
|
+
cycles: (t2, p2) => `${base2(t2, p2)}/cycles`,
|
|
22362
|
+
labels: (t2, p2) => `${base2(t2, p2)}/labels`,
|
|
22363
|
+
views: (t2, p2) => `${base2(t2, p2)}/views`,
|
|
22364
|
+
viewRun: (t2, p2, id2) => `${base2(t2, p2)}/views/${encodeURIComponent(id2)}/run`,
|
|
22365
|
+
loops: (t2, p2) => `${base2(t2, p2)}/loops`,
|
|
22366
|
+
loop: (t2, p2, id2) => `${base2(t2, p2)}/loops/${encodeURIComponent(id2)}`,
|
|
22367
|
+
loopFire: (t2, p2, id2) => `${base2(t2, p2)}/loops/${encodeURIComponent(id2)}/fire`,
|
|
22368
|
+
sync: (t2, p2) => `${base2(t2, p2)}/issue-sync`,
|
|
22369
|
+
syncDeliveries: (t2, p2) => `${base2(t2, p2)}/issue-sync/deliveries`
|
|
22370
22370
|
};
|
|
22371
22371
|
}
|
|
22372
22372
|
});
|
|
@@ -23553,7 +23553,7 @@ var init_wording = __esm({
|
|
|
23553
23553
|
});
|
|
23554
23554
|
|
|
23555
23555
|
// ../contracts/src/code-map-context.ts
|
|
23556
|
-
var CodeMapDigest, CODE_MAP_DIGEST_PATH;
|
|
23556
|
+
var CodeMapDigest, CODE_MAP_DIGEST_PATH, CODE_INDEX_PATH;
|
|
23557
23557
|
var init_code_map_context = __esm({
|
|
23558
23558
|
"../contracts/src/code-map-context.ts"() {
|
|
23559
23559
|
"use strict";
|
|
@@ -23571,6 +23571,7 @@ var init_code_map_context = __esm({
|
|
|
23571
23571
|
seeds: external_exports.array(external_exports.string())
|
|
23572
23572
|
}).strict();
|
|
23573
23573
|
CODE_MAP_DIGEST_PATH = ".harness/code-map.json";
|
|
23574
|
+
CODE_INDEX_PATH = ".harness/code-index.json";
|
|
23574
23575
|
}
|
|
23575
23576
|
});
|
|
23576
23577
|
|
|
@@ -23622,7 +23623,7 @@ var init_agent = __esm({
|
|
|
23622
23623
|
minRole: Role,
|
|
23623
23624
|
/** JSON-schema-like description of the arguments, property name to a short hint. */
|
|
23624
23625
|
arguments: external_exports.record(external_exports.string().min(1).max(64), external_exports.string().max(200))
|
|
23625
|
-
}).strict().refine((
|
|
23626
|
+
}).strict().refine((t2) => t2.class === classifyMethod(t2.operation.method), { message: "class must match the HTTP method (REQ-AGT-09)", path: ["class"] }).refine((t2) => blockedClassFor(t2.operation) === null, { message: "billing, secrets and destructive operations are never tools (REQ-AGT-08)", path: ["operation"] });
|
|
23626
23627
|
AGENT_REFUSAL_CODES = [
|
|
23627
23628
|
"role_forbidden",
|
|
23628
23629
|
"read_only_mode",
|
|
@@ -24346,22 +24347,22 @@ var init_git = __esm({
|
|
|
24346
24347
|
e = encodeURIComponent;
|
|
24347
24348
|
gitPaths = {
|
|
24348
24349
|
repos: repoBase,
|
|
24349
|
-
capability: (
|
|
24350
|
-
repo: (
|
|
24351
|
-
import: (
|
|
24352
|
-
sync: (
|
|
24353
|
-
branches: (
|
|
24354
|
-
branch: (
|
|
24355
|
-
push: (
|
|
24356
|
-
pushCheck: (
|
|
24357
|
-
protection: (
|
|
24358
|
-
tokens: (
|
|
24359
|
-
token: (
|
|
24360
|
-
pulls: (
|
|
24361
|
-
pull: (
|
|
24362
|
-
reviews: (
|
|
24363
|
-
merge: (
|
|
24364
|
-
index: (
|
|
24350
|
+
capability: (t2, p2) => `${repoBase(t2, p2)}/capability`,
|
|
24351
|
+
repo: (t2, p2, r) => `${repoBase(t2, p2)}/${e(r)}`,
|
|
24352
|
+
import: (t2, p2) => `${repoBase(t2, p2)}/import`,
|
|
24353
|
+
sync: (t2, p2, r) => `${repoBase(t2, p2)}/${e(r)}/sync`,
|
|
24354
|
+
branches: (t2, p2, r) => `${repoBase(t2, p2)}/${e(r)}/branches`,
|
|
24355
|
+
branch: (t2, p2, r, b) => `${repoBase(t2, p2)}/${e(r)}/branches/${e(b)}`,
|
|
24356
|
+
push: (t2, p2, r) => `${repoBase(t2, p2)}/${e(r)}/push`,
|
|
24357
|
+
pushCheck: (t2, p2, r) => `${repoBase(t2, p2)}/${e(r)}/push-check`,
|
|
24358
|
+
protection: (t2, p2, r) => `${repoBase(t2, p2)}/${e(r)}/protection`,
|
|
24359
|
+
tokens: (t2, p2, r) => `${repoBase(t2, p2)}/${e(r)}/tokens`,
|
|
24360
|
+
token: (t2, p2, r, id2) => `${repoBase(t2, p2)}/${e(r)}/tokens/${e(id2)}`,
|
|
24361
|
+
pulls: (t2, p2, r) => `${repoBase(t2, p2)}/${e(r)}/pulls`,
|
|
24362
|
+
pull: (t2, p2, r, n) => `${repoBase(t2, p2)}/${e(r)}/pulls/${n}`,
|
|
24363
|
+
reviews: (t2, p2, r, n) => `${repoBase(t2, p2)}/${e(r)}/pulls/${n}/reviews`,
|
|
24364
|
+
merge: (t2, p2, r, n) => `${repoBase(t2, p2)}/${e(r)}/pulls/${n}/merge`,
|
|
24365
|
+
index: (t2, p2, r) => `${repoBase(t2, p2)}/${e(r)}/index`
|
|
24365
24366
|
};
|
|
24366
24367
|
}
|
|
24367
24368
|
});
|
|
@@ -24818,18 +24819,18 @@ var init_ci = __esm({
|
|
|
24818
24819
|
CiSecretListResponse = external_exports.object({ tenantId: TenantId, secrets: external_exports.array(CiSecretMeta) }).strict();
|
|
24819
24820
|
ValidateConfigRequest = external_exports.object({ config: external_exports.string().min(1).max(1e5) }).strict();
|
|
24820
24821
|
ValidateConfigResponse = external_exports.object({ tenantId: TenantId, ok: external_exports.boolean(), issues: external_exports.array(external_exports.object({ line: external_exports.number().int().positive(), message: external_exports.string() }).strict()), jobs: external_exports.array(external_exports.string()) }).strict();
|
|
24821
|
-
ciBase = (
|
|
24822
|
+
ciBase = (t2, p2) => `/v1/tenants/${encodeURIComponent(t2)}/projects/${encodeURIComponent(p2)}/ci`;
|
|
24822
24823
|
ciPaths = {
|
|
24823
|
-
runs: (
|
|
24824
|
-
run: (
|
|
24825
|
-
cancel: (
|
|
24826
|
-
logs: (
|
|
24827
|
-
rerun: (
|
|
24828
|
-
validate: (
|
|
24829
|
-
settings: (
|
|
24830
|
-
secrets: (
|
|
24831
|
-
secret: (
|
|
24832
|
-
usage: (
|
|
24824
|
+
runs: (t2, p2) => `${ciBase(t2, p2)}/runs`,
|
|
24825
|
+
run: (t2, p2, id2) => `${ciBase(t2, p2)}/runs/${encodeURIComponent(id2)}`,
|
|
24826
|
+
cancel: (t2, p2, id2) => `${ciBase(t2, p2)}/runs/${encodeURIComponent(id2)}/cancel`,
|
|
24827
|
+
logs: (t2, p2, id2) => `${ciBase(t2, p2)}/runs/${encodeURIComponent(id2)}/logs`,
|
|
24828
|
+
rerun: (t2, p2, id2) => `${ciBase(t2, p2)}/runs/${encodeURIComponent(id2)}/rerun`,
|
|
24829
|
+
validate: (t2, p2) => `${ciBase(t2, p2)}/validate`,
|
|
24830
|
+
settings: (t2, p2) => `${ciBase(t2, p2)}/settings`,
|
|
24831
|
+
secrets: (t2, p2) => `${ciBase(t2, p2)}/secrets`,
|
|
24832
|
+
secret: (t2, p2, name2) => `${ciBase(t2, p2)}/secrets/${encodeURIComponent(name2)}`,
|
|
24833
|
+
usage: (t2, p2) => `${ciBase(t2, p2)}/usage`
|
|
24833
24834
|
};
|
|
24834
24835
|
}
|
|
24835
24836
|
});
|
|
@@ -24951,16 +24952,16 @@ var init_deploy = __esm({
|
|
|
24951
24952
|
TargetListResponse = external_exports.object({ tenantId: TenantId, targets: external_exports.array(DeployTarget), environments: external_exports.array(Environment) }).strict();
|
|
24952
24953
|
EnvironmentResponse = external_exports.object({ tenantId: TenantId, environment: Environment }).strict();
|
|
24953
24954
|
TargetResponse = external_exports.object({ tenantId: TenantId, target: DeployTarget }).strict();
|
|
24954
|
-
depBase = (
|
|
24955
|
+
depBase = (t2, p2) => `/v1/tenants/${encodeURIComponent(t2)}/projects/${encodeURIComponent(p2)}/deploy`;
|
|
24955
24956
|
enc = encodeURIComponent;
|
|
24956
24957
|
deployPaths = {
|
|
24957
|
-
targets: (
|
|
24958
|
-
environments: (
|
|
24959
|
-
deploys: (
|
|
24960
|
-
releases: (
|
|
24961
|
-
previews: (
|
|
24962
|
-
rollback: (
|
|
24963
|
-
secrets: (
|
|
24958
|
+
targets: (t2, p2) => `${depBase(t2, p2)}/targets`,
|
|
24959
|
+
environments: (t2, p2) => `${depBase(t2, p2)}/environments`,
|
|
24960
|
+
deploys: (t2, p2) => `${depBase(t2, p2)}/releases`,
|
|
24961
|
+
releases: (t2, p2, env) => `${depBase(t2, p2)}/releases${env === void 0 ? "" : `?environment=${enc(env)}`}`,
|
|
24962
|
+
previews: (t2, p2) => `${depBase(t2, p2)}/previews`,
|
|
24963
|
+
rollback: (t2, p2, env) => `${depBase(t2, p2)}/environments/${enc(env)}/rollback`,
|
|
24964
|
+
secrets: (t2, p2, env) => `${depBase(t2, p2)}/environments/${enc(env)}/secrets`
|
|
24964
24965
|
};
|
|
24965
24966
|
}
|
|
24966
24967
|
});
|
|
@@ -25528,8 +25529,8 @@ function checkRules(source, input2) {
|
|
|
25528
25529
|
const check2 = validateRulesSource(source);
|
|
25529
25530
|
if (!check2.ok) return { configured: true, revision: null, sourceProblem: check2.problem, drifted: true, targets: [], nextCommand: `fix ${RULES_SOURCE_PATH}` };
|
|
25530
25531
|
const targets = RULES_TARGETS.map((target2) => target2.kind === "region" ? inspectRegionTarget(target2, input2.files[target2.path] ?? null, check2) : inspectGeminiSettings(target2, input2.files[target2.path] ?? null));
|
|
25531
|
-
const drifted = targets.some((
|
|
25532
|
-
const needsForce = targets.some((
|
|
25532
|
+
const drifted = targets.some((t2) => t2.state !== "in_sync");
|
|
25533
|
+
const needsForce = targets.some((t2) => t2.state === "edited");
|
|
25533
25534
|
return { configured: true, revision: check2.revision, sourceProblem: null, drifted, targets, nextCommand: !drifted ? null : needsForce ? "overlane rules sync --overwrite-edits" : "overlane rules sync" };
|
|
25534
25535
|
}
|
|
25535
25536
|
function planRulesSync(source, input2, options = {}) {
|
|
@@ -25909,6 +25910,259 @@ var init_egress = __esm({
|
|
|
25909
25910
|
}
|
|
25910
25911
|
});
|
|
25911
25912
|
|
|
25913
|
+
// ../contracts/src/observability.ts
|
|
25914
|
+
var RUN_EVENT_TYPES, RunEventType, OBS_RUN_STATUSES, ObsRunStatus, REVIEW_OUTCOMES, ReviewOutcome, Name2, Level, RunEventFields, RunEvent, RunEventInput, IngestRunEventsRequest, RunResume, LogRecord, LogInput, Span, SpanInput, IngestTelemetryRequest, IngestTelemetryResult, LogRecordList, ObsRun, TraceBundle, METRIC_KINDS, MetricKind, METRIC_DIMENSIONS, MetricDimension, MetricDimensions, MetricInput, Metric, IngestMetricsRequest, IngestMetricsResult, MetricTotal, MetricTotals, CostRowV1, CostSummaryV1, CostReport, ReconcileLine, Reconciliation, ALERT_KINDS, AlertKind, ALERT_CHANNELS, AlertChannel, AlertTarget, AlertThreshold, AlertRule, PutAlertRuleRequest, DeleteAlertRuleRequest, AlertDelivery, Incident, AlertOverview, EvaluateAlertsResult, AlertNotice, RETENTION_COVERS, RETENTION_KEEPS, RetentionPolicy, RetentionPurgeResult, ComparisonEntry, ComparisonReport, ReplayResult, EvalRow, EvalReport, RunEvalRequest, DecisionSummary, ObserveStatus, t, p, observePaths;
|
|
25915
|
+
var init_observability = __esm({
|
|
25916
|
+
"../contracts/src/observability.ts"() {
|
|
25917
|
+
"use strict";
|
|
25918
|
+
init_zod();
|
|
25919
|
+
init_plans();
|
|
25920
|
+
init_common();
|
|
25921
|
+
RUN_EVENT_TYPES = ["run.started", "run.step", "run.log", "run.cost", "run.decision", "run.ended"];
|
|
25922
|
+
RunEventType = external_exports.enum(RUN_EVENT_TYPES);
|
|
25923
|
+
OBS_RUN_STATUSES = ["running", "passed", "failed", "paused"];
|
|
25924
|
+
ObsRunStatus = external_exports.enum(OBS_RUN_STATUSES);
|
|
25925
|
+
REVIEW_OUTCOMES = ["approved", "changes_requested", "pending", "none"];
|
|
25926
|
+
ReviewOutcome = external_exports.enum(REVIEW_OUTCOMES);
|
|
25927
|
+
Name2 = external_exports.string().min(1).max(128);
|
|
25928
|
+
Level = external_exports.enum(["info", "warn", "error"]);
|
|
25929
|
+
RunEventFields = {
|
|
25930
|
+
schemaVersion: SchemaVersion,
|
|
25931
|
+
tenantId: TenantId,
|
|
25932
|
+
projectId: ProjectId,
|
|
25933
|
+
runId: Name2,
|
|
25934
|
+
eventId: external_exports.string().min(8).max(128),
|
|
25935
|
+
type: RunEventType,
|
|
25936
|
+
agent: Name2,
|
|
25937
|
+
tool: Name2.optional(),
|
|
25938
|
+
status: ObsRunStatus,
|
|
25939
|
+
occurredAt: Timestamp,
|
|
25940
|
+
label: external_exports.string().max(300).optional(),
|
|
25941
|
+
detail: external_exports.string().max(1e3).optional(),
|
|
25942
|
+
level: Level.optional(),
|
|
25943
|
+
costMicros: external_exports.number().int().nonnegative().optional(),
|
|
25944
|
+
tokens: external_exports.number().int().nonnegative().optional(),
|
|
25945
|
+
taskId: Name2.optional(),
|
|
25946
|
+
pr: Name2.optional(),
|
|
25947
|
+
reviewOutcome: ReviewOutcome.optional()
|
|
25948
|
+
};
|
|
25949
|
+
RunEvent = external_exports.object({ ...RunEventFields, sequence: external_exports.number().int().positive() }).strict();
|
|
25950
|
+
RunEventInput = external_exports.object(RunEventFields).omit({ schemaVersion: true, tenantId: true, projectId: true }).strict();
|
|
25951
|
+
IngestRunEventsRequest = external_exports.object({ events: external_exports.array(RunEventInput).min(1).max(100) }).strict();
|
|
25952
|
+
RunResume = external_exports.object({ type: external_exports.literal("resume"), after: external_exports.number().int().min(-1) }).strict();
|
|
25953
|
+
LogRecord = external_exports.object({
|
|
25954
|
+
schemaVersion: SchemaVersion,
|
|
25955
|
+
tenantId: TenantId,
|
|
25956
|
+
projectId: ProjectId,
|
|
25957
|
+
runId: Name2,
|
|
25958
|
+
logId: external_exports.string().min(8).max(128),
|
|
25959
|
+
at: Timestamp,
|
|
25960
|
+
level: Level,
|
|
25961
|
+
source: external_exports.string().min(1).max(60),
|
|
25962
|
+
agent: Name2.optional(),
|
|
25963
|
+
/** Already redacted. */
|
|
25964
|
+
message: external_exports.string().max(4e3),
|
|
25965
|
+
/** True when ingest replaced anything. There is no field that holds the original text. */
|
|
25966
|
+
redacted: external_exports.boolean(),
|
|
25967
|
+
redactions: external_exports.number().int().nonnegative()
|
|
25968
|
+
}).strict();
|
|
25969
|
+
LogInput = external_exports.object({ logId: external_exports.string().min(8).max(128), runId: Name2, at: Timestamp, level: Level, source: external_exports.string().min(1).max(60), agent: Name2.optional(), message: external_exports.string().max(2e4) }).strict();
|
|
25970
|
+
Span = external_exports.object({
|
|
25971
|
+
schemaVersion: SchemaVersion,
|
|
25972
|
+
tenantId: TenantId,
|
|
25973
|
+
projectId: ProjectId,
|
|
25974
|
+
runId: Name2,
|
|
25975
|
+
spanId: external_exports.string().min(4).max(128),
|
|
25976
|
+
parentSpanId: external_exports.string().min(4).max(128).optional(),
|
|
25977
|
+
name: external_exports.string().min(1).max(200),
|
|
25978
|
+
agent: Name2,
|
|
25979
|
+
tool: Name2.optional(),
|
|
25980
|
+
startedAt: Timestamp,
|
|
25981
|
+
durationMs: external_exports.number().int().nonnegative(),
|
|
25982
|
+
status: external_exports.enum(["ok", "error"]),
|
|
25983
|
+
/** Already redacted. */
|
|
25984
|
+
attributes: external_exports.record(external_exports.string().max(60), external_exports.string().max(500)),
|
|
25985
|
+
redactions: external_exports.number().int().nonnegative()
|
|
25986
|
+
}).strict();
|
|
25987
|
+
SpanInput = external_exports.object({
|
|
25988
|
+
runId: Name2,
|
|
25989
|
+
spanId: external_exports.string().min(4).max(128),
|
|
25990
|
+
parentSpanId: external_exports.string().min(4).max(128).optional(),
|
|
25991
|
+
name: external_exports.string().min(1).max(200),
|
|
25992
|
+
agent: Name2,
|
|
25993
|
+
tool: Name2.optional(),
|
|
25994
|
+
startedAt: Timestamp,
|
|
25995
|
+
durationMs: external_exports.number().int().nonnegative(),
|
|
25996
|
+
status: external_exports.enum(["ok", "error"]),
|
|
25997
|
+
attributes: external_exports.record(external_exports.string().max(60), external_exports.string().max(5e3)).default({})
|
|
25998
|
+
}).strict();
|
|
25999
|
+
IngestTelemetryRequest = external_exports.object({
|
|
26000
|
+
logs: external_exports.array(LogInput).max(200).default([]),
|
|
26001
|
+
spans: external_exports.array(SpanInput).max(200).default([]),
|
|
26002
|
+
headers: external_exports.record(external_exports.string().max(200), external_exports.string().max(5e3)).optional(),
|
|
26003
|
+
environment: external_exports.record(external_exports.string().max(200), external_exports.string().max(5e3)).optional(),
|
|
26004
|
+
toolOutput: external_exports.string().max(1e5).optional(),
|
|
26005
|
+
runId: Name2.optional()
|
|
26006
|
+
}).strict();
|
|
26007
|
+
IngestTelemetryResult = external_exports.object({ tenantId: TenantId, logs: external_exports.number().int(), spans: external_exports.number().int(), duplicates: external_exports.number().int(), redactions: external_exports.number().int() }).strict();
|
|
26008
|
+
LogRecordList = external_exports.object({ tenantId: TenantId, projectId: ProjectId, logs: external_exports.array(LogRecord) }).strict();
|
|
26009
|
+
ObsRun = external_exports.object({
|
|
26010
|
+
tenantId: TenantId,
|
|
26011
|
+
projectId: ProjectId,
|
|
26012
|
+
runId: Name2,
|
|
26013
|
+
agent: Name2,
|
|
26014
|
+
status: ObsRunStatus,
|
|
26015
|
+
taskId: Name2.optional(),
|
|
26016
|
+
pr: Name2.optional(),
|
|
26017
|
+
startedAt: Timestamp,
|
|
26018
|
+
endedAt: Timestamp.optional(),
|
|
26019
|
+
lastEventAt: Timestamp,
|
|
26020
|
+
costMicros: external_exports.number().int().nonnegative(),
|
|
26021
|
+
tokens: external_exports.number().int().nonnegative(),
|
|
26022
|
+
reviewOutcome: ReviewOutcome
|
|
26023
|
+
}).strict();
|
|
26024
|
+
TraceBundle = external_exports.object({ tenantId: TenantId, projectId: ProjectId, runId: Name2, run: ObsRun.nullable(), events: external_exports.array(RunEvent), logs: external_exports.array(LogRecord), spans: external_exports.array(Span) }).strict();
|
|
26025
|
+
METRIC_KINDS = ["cost_micros", "tokens", "tool_calls", "success", "failure", "latency_ms"];
|
|
26026
|
+
MetricKind = external_exports.enum(METRIC_KINDS);
|
|
26027
|
+
METRIC_DIMENSIONS = ["agent", "project", "team", "pr", "task"];
|
|
26028
|
+
MetricDimension = external_exports.enum(METRIC_DIMENSIONS);
|
|
26029
|
+
MetricDimensions = external_exports.object({ agent: Name2.optional(), project: Name2.optional(), team: Name2.optional(), pr: Name2.optional(), task: Name2.optional() }).strict();
|
|
26030
|
+
MetricInput = external_exports.object({ metricId: external_exports.string().min(8).max(160), kind: MetricKind, value: external_exports.number().int().nonnegative(), at: Timestamp, runId: Name2.optional(), dimensions: MetricDimensions }).strict();
|
|
26031
|
+
Metric = MetricInput.extend({ tenantId: TenantId }).strict();
|
|
26032
|
+
IngestMetricsRequest = external_exports.object({ metrics: external_exports.array(MetricInput).min(1).max(200) }).strict();
|
|
26033
|
+
IngestMetricsResult = external_exports.object({ tenantId: TenantId, accepted: external_exports.number().int(), duplicates: external_exports.number().int() }).strict();
|
|
26034
|
+
MetricTotal = external_exports.object({ key: external_exports.string(), value: external_exports.number().int().nonnegative() }).strict();
|
|
26035
|
+
MetricTotals = external_exports.object({ tenantId: TenantId, kind: MetricKind, by: MetricDimension, from: Timestamp.nullable(), totals: external_exports.array(MetricTotal) }).strict();
|
|
26036
|
+
CostRowV1 = external_exports.object({ key: external_exports.string().min(1).max(200), runs: external_exports.number().int().nonnegative(), tokens: external_exports.number().int().nonnegative(), costCents: external_exports.number().int().nonnegative() }).strict();
|
|
26037
|
+
CostSummaryV1 = external_exports.object({ period: external_exports.string().min(1).max(60), byAgent: external_exports.array(CostRowV1), byProject: external_exports.array(CostRowV1) }).strict();
|
|
26038
|
+
CostReport = external_exports.object({
|
|
26039
|
+
tenantId: TenantId,
|
|
26040
|
+
period: external_exports.string().min(1).max(60),
|
|
26041
|
+
from: Timestamp,
|
|
26042
|
+
totalMicros: external_exports.number().int().nonnegative(),
|
|
26043
|
+
tokens: external_exports.number().int().nonnegative(),
|
|
26044
|
+
byAgent: external_exports.array(CostRowV1.extend({ costMicros: external_exports.number().int().nonnegative() }).strict()),
|
|
26045
|
+
byProject: external_exports.array(CostRowV1.extend({ costMicros: external_exports.number().int().nonnegative() }).strict()),
|
|
26046
|
+
byTeam: external_exports.array(CostRowV1.extend({ costMicros: external_exports.number().int().nonnegative() }).strict())
|
|
26047
|
+
}).strict();
|
|
26048
|
+
ReconcileLine = external_exports.object({ key: external_exports.string(), meteredMicros: external_exports.number().int().nonnegative(), observedMicros: external_exports.number().int().nonnegative(), errorBps: external_exports.number().int().nonnegative(), within: external_exports.boolean() }).strict();
|
|
26049
|
+
Reconciliation = external_exports.object({
|
|
26050
|
+
tenantId: TenantId,
|
|
26051
|
+
periodStart: Timestamp,
|
|
26052
|
+
toleranceBps: external_exports.number().int(),
|
|
26053
|
+
total: ReconcileLine,
|
|
26054
|
+
byAgent: external_exports.array(ReconcileLine),
|
|
26055
|
+
byProject: external_exports.array(ReconcileLine),
|
|
26056
|
+
withinTolerance: external_exports.boolean()
|
|
26057
|
+
}).strict();
|
|
26058
|
+
ALERT_KINDS = ["spend_cap", "failing_run", "stuck_lease", "index_stale"];
|
|
26059
|
+
AlertKind = external_exports.enum(ALERT_KINDS);
|
|
26060
|
+
ALERT_CHANNELS = ["email", "slack", "teams"];
|
|
26061
|
+
AlertChannel = external_exports.enum(ALERT_CHANNELS);
|
|
26062
|
+
AlertTarget = external_exports.object({ channel: AlertChannel, destination: external_exports.string().min(1).max(200) }).strict();
|
|
26063
|
+
AlertThreshold = external_exports.object({ percent: external_exports.number().int().min(1).max(100).optional(), minutes: external_exports.number().int().min(1).max(10080).optional() }).strict();
|
|
26064
|
+
AlertRule = external_exports.object({ tenantId: TenantId, ruleId: Name2, kind: AlertKind, threshold: AlertThreshold, targets: external_exports.array(AlertTarget).min(1).max(10), enabled: external_exports.boolean(), updatedBy: external_exports.string().min(1).max(200), updatedAt: Timestamp }).strict();
|
|
26065
|
+
PutAlertRuleRequest = external_exports.object({ requestId: external_exports.string().min(8).max(128), ruleId: Name2.optional(), kind: AlertKind, threshold: AlertThreshold.default({}), targets: external_exports.array(AlertTarget).min(1).max(10), enabled: external_exports.boolean().default(true) }).strict();
|
|
26066
|
+
DeleteAlertRuleRequest = external_exports.object({ ruleId: Name2 }).strict();
|
|
26067
|
+
AlertDelivery = external_exports.object({ channel: AlertChannel, destination: external_exports.string(), outcome: external_exports.enum(["delivered", "failed"]), kind: external_exports.enum(["opened", "resolved"]), at: Timestamp }).strict();
|
|
26068
|
+
Incident = external_exports.object({
|
|
26069
|
+
tenantId: TenantId,
|
|
26070
|
+
incidentId: Name2,
|
|
26071
|
+
ruleId: Name2,
|
|
26072
|
+
kind: AlertKind,
|
|
26073
|
+
/** The condition's identity, for example `spend:project:p1:2026-10-01`. Unique per rule. */
|
|
26074
|
+
key: external_exports.string().min(1).max(300),
|
|
26075
|
+
subject: external_exports.string().min(1).max(300),
|
|
26076
|
+
detail: external_exports.string().max(1e3),
|
|
26077
|
+
state: external_exports.enum(["open", "resolved"]),
|
|
26078
|
+
openedAt: Timestamp,
|
|
26079
|
+
resolvedAt: Timestamp.optional(),
|
|
26080
|
+
nextCommand: external_exports.string().max(300),
|
|
26081
|
+
deliveries: external_exports.array(AlertDelivery)
|
|
26082
|
+
}).strict();
|
|
26083
|
+
AlertOverview = external_exports.object({ tenantId: TenantId, rules: external_exports.array(AlertRule), incidents: external_exports.array(Incident) }).strict();
|
|
26084
|
+
EvaluateAlertsResult = external_exports.object({ tenantId: TenantId, opened: external_exports.array(Incident), resolved: external_exports.array(Incident), stillOpen: external_exports.number().int().nonnegative() }).strict();
|
|
26085
|
+
AlertNotice = external_exports.object({ tenantId: TenantId, incidentId: Name2, kind: AlertKind, state: external_exports.enum(["opened", "resolved"]), subject: external_exports.string(), detail: external_exports.string(), nextCommand: external_exports.string() }).strict();
|
|
26086
|
+
RETENTION_COVERS = ["run_events", "logs", "spans", "metrics", "runs", "resolved_incidents", "eval_results"];
|
|
26087
|
+
RETENTION_KEEPS = ["ledger", "evidence", "audit", "billing", "decisions"];
|
|
26088
|
+
RetentionPolicy = external_exports.object({
|
|
26089
|
+
tenantId: TenantId,
|
|
26090
|
+
plan: BillingPlanId,
|
|
26091
|
+
/** Null: the plan sets no fixed period (the contract decides); the purge deletes nothing. */
|
|
26092
|
+
retentionDays: external_exports.number().int().positive().nullable(),
|
|
26093
|
+
covers: external_exports.array(external_exports.enum(RETENTION_COVERS)),
|
|
26094
|
+
keeps: external_exports.array(external_exports.enum(RETENTION_KEEPS))
|
|
26095
|
+
}).strict();
|
|
26096
|
+
RetentionPurgeResult = external_exports.object({ tenantId: TenantId, plan: BillingPlanId, retentionDays: external_exports.number().int().positive().nullable(), cutoff: Timestamp.nullable(), deleted: external_exports.record(external_exports.string(), external_exports.number().int().nonnegative()) }).strict();
|
|
26097
|
+
ComparisonEntry = external_exports.object({
|
|
26098
|
+
agent: Name2,
|
|
26099
|
+
runs: external_exports.number().int().nonnegative(),
|
|
26100
|
+
costMicros: external_exports.number().int().nonnegative(),
|
|
26101
|
+
tokens: external_exports.number().int().nonnegative(),
|
|
26102
|
+
durationMs: external_exports.number().int().nonnegative(),
|
|
26103
|
+
status: ObsRunStatus,
|
|
26104
|
+
reviewOutcome: ReviewOutcome
|
|
26105
|
+
}).strict();
|
|
26106
|
+
ComparisonReport = external_exports.object({
|
|
26107
|
+
tenantId: TenantId,
|
|
26108
|
+
taskId: Name2,
|
|
26109
|
+
generatedAt: Timestamp,
|
|
26110
|
+
entries: external_exports.array(ComparisonEntry),
|
|
26111
|
+
cheapest: Name2.nullable(),
|
|
26112
|
+
fastest: Name2.nullable(),
|
|
26113
|
+
/** The agent whose work was approved at the lowest cost, or null when none was approved. */
|
|
26114
|
+
recommended: Name2.nullable()
|
|
26115
|
+
}).strict();
|
|
26116
|
+
ReplayResult = external_exports.object({
|
|
26117
|
+
tenantId: TenantId,
|
|
26118
|
+
replayId: external_exports.string().min(8).max(160),
|
|
26119
|
+
prRef: external_exports.string().min(1).max(200),
|
|
26120
|
+
agent: Name2,
|
|
26121
|
+
config: Name2,
|
|
26122
|
+
passed: external_exports.boolean(),
|
|
26123
|
+
costMicros: external_exports.number().int().nonnegative(),
|
|
26124
|
+
reviewMs: external_exports.number().int().nonnegative(),
|
|
26125
|
+
at: Timestamp
|
|
26126
|
+
}).strict();
|
|
26127
|
+
EvalRow = external_exports.object({ agent: Name2, config: Name2, prs: external_exports.number().int().nonnegative(), passed: external_exports.number().int().nonnegative(), passRateBps: external_exports.number().int().min(0).max(1e4), meanCostMicros: external_exports.number().int().nonnegative(), meanReviewMs: external_exports.number().int().nonnegative() }).strict();
|
|
26128
|
+
EvalReport = external_exports.object({ tenantId: TenantId, generatedAt: Timestamp, prs: external_exports.number().int().nonnegative(), rows: external_exports.array(EvalRow), best: external_exports.object({ agent: Name2, config: Name2 }).strict().nullable() }).strict();
|
|
26129
|
+
RunEvalRequest = external_exports.object({ requestId: external_exports.string().min(8).max(128), prs: external_exports.array(external_exports.string().min(1).max(200)).min(1).max(50), agents: external_exports.array(Name2).min(1).max(10), configs: external_exports.array(Name2).min(1).max(10) }).strict();
|
|
26130
|
+
DecisionSummary = external_exports.object({ total: external_exports.number().int().nonnegative(), byOutcome: external_exports.record(external_exports.string(), external_exports.number().int().nonnegative()), byUse: external_exports.record(external_exports.string(), external_exports.number().int().nonnegative()), meanLatencyMs: external_exports.number().int().nonnegative() }).strict();
|
|
26131
|
+
ObserveStatus = external_exports.object({
|
|
26132
|
+
tenantId: TenantId,
|
|
26133
|
+
generatedAt: Timestamp,
|
|
26134
|
+
runs: external_exports.object({ running: external_exports.number().int(), passed: external_exports.number().int(), failed: external_exports.number().int(), paused: external_exports.number().int() }).strict(),
|
|
26135
|
+
openIncidents: external_exports.number().int().nonnegative(),
|
|
26136
|
+
costMicros: external_exports.number().int().nonnegative(),
|
|
26137
|
+
tokens: external_exports.number().int().nonnegative(),
|
|
26138
|
+
decisions: DecisionSummary,
|
|
26139
|
+
retention: RetentionPolicy
|
|
26140
|
+
}).strict();
|
|
26141
|
+
t = (tenantId) => `/v1/tenants/${encodeURIComponent(tenantId)}`;
|
|
26142
|
+
p = (tenantId, projectId) => `${t(tenantId)}/projects/${encodeURIComponent(projectId)}`;
|
|
26143
|
+
observePaths = {
|
|
26144
|
+
status: (tenantId) => `${t(tenantId)}/observe/status`,
|
|
26145
|
+
stream: (tenantId, projectId, runId) => `${p(tenantId, projectId)}/runs/${encodeURIComponent(runId)}/stream`,
|
|
26146
|
+
trace: (tenantId, projectId, runId) => `${p(tenantId, projectId)}/runs/${encodeURIComponent(runId)}/trace`,
|
|
26147
|
+
events: (tenantId, projectId) => `${p(tenantId, projectId)}/observe/events`,
|
|
26148
|
+
telemetry: (tenantId, projectId) => `${p(tenantId, projectId)}/observe/telemetry`,
|
|
26149
|
+
logs: (tenantId, projectId) => `${p(tenantId, projectId)}/observe/logs`,
|
|
26150
|
+
webLogs: (tenantId, projectId) => `${p(tenantId, projectId)}/logs`,
|
|
26151
|
+
metrics: (tenantId) => `${t(tenantId)}/observe/metrics`,
|
|
26152
|
+
cost: (tenantId) => `${t(tenantId)}/observe/cost`,
|
|
26153
|
+
webCost: (tenantId) => `${t(tenantId)}/metrics/cost`,
|
|
26154
|
+
reconcile: (tenantId) => `${t(tenantId)}/observe/reconcile`,
|
|
26155
|
+
compare: (tenantId) => `${t(tenantId)}/observe/compare`,
|
|
26156
|
+
evals: (tenantId) => `${t(tenantId)}/observe/evals`,
|
|
26157
|
+
alerts: (tenantId) => `${t(tenantId)}/observe/alerts`,
|
|
26158
|
+
alertRules: (tenantId) => `${t(tenantId)}/observe/alerts/rules`,
|
|
26159
|
+
alertsEvaluate: (tenantId) => `${t(tenantId)}/observe/alerts/evaluate`,
|
|
26160
|
+
retention: (tenantId) => `${t(tenantId)}/observe/retention`,
|
|
26161
|
+
retentionPurge: (tenantId) => `${t(tenantId)}/observe/retention/purge`
|
|
26162
|
+
};
|
|
26163
|
+
}
|
|
26164
|
+
});
|
|
26165
|
+
|
|
25912
26166
|
// ../contracts/src/index.ts
|
|
25913
26167
|
var init_src = __esm({
|
|
25914
26168
|
"../contracts/src/index.ts"() {
|
|
@@ -25955,6 +26209,7 @@ var init_src = __esm({
|
|
|
25955
26209
|
init_rules_sync();
|
|
25956
26210
|
init_pr_routing();
|
|
25957
26211
|
init_egress();
|
|
26212
|
+
init_observability();
|
|
25958
26213
|
}
|
|
25959
26214
|
});
|
|
25960
26215
|
|
|
@@ -26693,13 +26948,13 @@ var require_createNode = __commonJS({
|
|
|
26693
26948
|
var defaultTagPrefix = "tag:yaml.org,2002:";
|
|
26694
26949
|
function findTagObject(value, tagName, tags) {
|
|
26695
26950
|
if (tagName) {
|
|
26696
|
-
const match = tags.filter((
|
|
26697
|
-
const tagObj = match.find((
|
|
26951
|
+
const match = tags.filter((t2) => t2.tag === tagName);
|
|
26952
|
+
const tagObj = match.find((t2) => !t2.format) ?? match[0];
|
|
26698
26953
|
if (!tagObj)
|
|
26699
26954
|
throw new Error(`Tag ${tagName} not found`);
|
|
26700
26955
|
return tagObj;
|
|
26701
26956
|
}
|
|
26702
|
-
return tags.find((
|
|
26957
|
+
return tags.find((t2) => t2.identify?.(value) && !t2.format);
|
|
26703
26958
|
}
|
|
26704
26959
|
function createNode(value, tagName, ctx) {
|
|
26705
26960
|
if (identity.isDocument(value))
|
|
@@ -27326,10 +27581,10 @@ ${indent}`);
|
|
|
27326
27581
|
let res = _stringify(type);
|
|
27327
27582
|
if (res === null) {
|
|
27328
27583
|
const { defaultKeyType, defaultStringType } = ctx.options;
|
|
27329
|
-
const
|
|
27330
|
-
res = _stringify(
|
|
27584
|
+
const t2 = implicitKey && defaultKeyType || defaultStringType;
|
|
27585
|
+
res = _stringify(t2);
|
|
27331
27586
|
if (res === null)
|
|
27332
|
-
throw new Error(`Unsupported default string type ${
|
|
27587
|
+
throw new Error(`Unsupported default string type ${t2}`);
|
|
27333
27588
|
}
|
|
27334
27589
|
return res;
|
|
27335
27590
|
}
|
|
@@ -27389,24 +27644,24 @@ var require_stringify = __commonJS({
|
|
|
27389
27644
|
}
|
|
27390
27645
|
function getTagObject(tags, item) {
|
|
27391
27646
|
if (item.tag) {
|
|
27392
|
-
const match = tags.filter((
|
|
27647
|
+
const match = tags.filter((t2) => t2.tag === item.tag);
|
|
27393
27648
|
if (match.length > 0)
|
|
27394
|
-
return match.find((
|
|
27649
|
+
return match.find((t2) => t2.format === item.format) ?? match[0];
|
|
27395
27650
|
}
|
|
27396
27651
|
let tagObj = void 0;
|
|
27397
27652
|
let obj;
|
|
27398
27653
|
if (identity.isScalar(item)) {
|
|
27399
27654
|
obj = item.value;
|
|
27400
|
-
let match = tags.filter((
|
|
27655
|
+
let match = tags.filter((t2) => t2.identify?.(obj));
|
|
27401
27656
|
if (match.length > 1) {
|
|
27402
|
-
const testMatch = match.filter((
|
|
27657
|
+
const testMatch = match.filter((t2) => t2.test);
|
|
27403
27658
|
if (testMatch.length > 0)
|
|
27404
27659
|
match = testMatch;
|
|
27405
27660
|
}
|
|
27406
|
-
tagObj = match.find((
|
|
27661
|
+
tagObj = match.find((t2) => t2.format === item.format) ?? match.find((t2) => !t2.format);
|
|
27407
27662
|
} else {
|
|
27408
27663
|
obj = item;
|
|
27409
|
-
tagObj = tags.find((
|
|
27664
|
+
tagObj = tags.find((t2) => t2.nodeClass && obj instanceof t2.nodeClass);
|
|
27410
27665
|
}
|
|
27411
27666
|
if (!tagObj) {
|
|
27412
27667
|
const name2 = obj?.constructor?.name ?? (obj === null ? "null" : typeof obj);
|
|
@@ -28989,7 +29244,7 @@ var require_timestamp = __commonJS({
|
|
|
28989
29244
|
const sign = str[0];
|
|
28990
29245
|
const parts2 = sign === "-" || sign === "+" ? str.substring(1) : str;
|
|
28991
29246
|
const num = (n) => asBigInt ? BigInt(n) : Number(n);
|
|
28992
|
-
const res = parts2.replace(/_/g, "").split(":").reduce((res2,
|
|
29247
|
+
const res = parts2.replace(/_/g, "").split(":").reduce((res2, p2) => res2 * num(60) + num(p2), num(0));
|
|
28993
29248
|
return sign === "-" ? num(-1) * res : res;
|
|
28994
29249
|
}
|
|
28995
29250
|
function stringifySexagesimal(node2) {
|
|
@@ -30335,7 +30590,7 @@ var require_compose_collection = __commonJS({
|
|
|
30335
30590
|
if (!tagToken || !tagName || tagName === "!" || tagName === YAMLMap.YAMLMap.tagName && expType === "map" || tagName === YAMLSeq.YAMLSeq.tagName && expType === "seq") {
|
|
30336
30591
|
return resolveCollection(CN, ctx, token, onError, tagName);
|
|
30337
30592
|
}
|
|
30338
|
-
let tag = ctx.schema.tags.find((
|
|
30593
|
+
let tag = ctx.schema.tags.find((t2) => t2.tag === tagName && t2.collection === expType);
|
|
30339
30594
|
if (!tag) {
|
|
30340
30595
|
const kt = ctx.schema.knownTags[tagName];
|
|
30341
30596
|
if (kt?.collection === expType) {
|
|
@@ -32272,15 +32527,15 @@ var require_parser = __commonJS({
|
|
|
32272
32527
|
var node_process = __require("process");
|
|
32273
32528
|
var cst = require_cst();
|
|
32274
32529
|
var lexer = require_lexer();
|
|
32275
|
-
function includesToken(
|
|
32276
|
-
for (let i2 = 0; i2 <
|
|
32277
|
-
if (
|
|
32530
|
+
function includesToken(list2, type) {
|
|
32531
|
+
for (let i2 = 0; i2 < list2.length; ++i2)
|
|
32532
|
+
if (list2[i2].type === type)
|
|
32278
32533
|
return true;
|
|
32279
32534
|
return false;
|
|
32280
32535
|
}
|
|
32281
|
-
function findNonEmptyIndex(
|
|
32282
|
-
for (let i2 = 0; i2 <
|
|
32283
|
-
switch (
|
|
32536
|
+
function findNonEmptyIndex(list2) {
|
|
32537
|
+
for (let i2 = 0; i2 < list2.length; ++i2) {
|
|
32538
|
+
switch (list2[i2].type) {
|
|
32284
32539
|
case "space":
|
|
32285
32540
|
case "comment":
|
|
32286
32541
|
case "newline":
|
|
@@ -33307,7 +33562,7 @@ var VERSION;
|
|
|
33307
33562
|
var init_assets = __esm({
|
|
33308
33563
|
"src/assets.ts"() {
|
|
33309
33564
|
"use strict";
|
|
33310
|
-
VERSION = true ? "0.1.
|
|
33565
|
+
VERSION = true ? "0.1.136" : "0.0.0-dev";
|
|
33311
33566
|
}
|
|
33312
33567
|
});
|
|
33313
33568
|
|
|
@@ -34362,7 +34617,7 @@ function base64Decode(base64Str) {
|
|
|
34362
34617
|
}
|
|
34363
34618
|
function setFromBase64(bytes, base64Str) {
|
|
34364
34619
|
const table2 = getDecodeTable();
|
|
34365
|
-
let bytePos = 0, groupPos = 0, b,
|
|
34620
|
+
let bytePos = 0, groupPos = 0, b, p2 = 0;
|
|
34366
34621
|
for (let i2 = 0; i2 < base64Str.length; i2++) {
|
|
34367
34622
|
b = table2[base64Str.charCodeAt(i2)];
|
|
34368
34623
|
if (b === void 0) {
|
|
@@ -34383,21 +34638,21 @@ function setFromBase64(bytes, base64Str) {
|
|
|
34383
34638
|
}
|
|
34384
34639
|
switch (groupPos) {
|
|
34385
34640
|
case 0:
|
|
34386
|
-
|
|
34641
|
+
p2 = b;
|
|
34387
34642
|
groupPos = 1;
|
|
34388
34643
|
break;
|
|
34389
34644
|
case 1:
|
|
34390
|
-
bytes[bytePos++] =
|
|
34391
|
-
|
|
34645
|
+
bytes[bytePos++] = p2 << 2 | (b & 48) >> 4;
|
|
34646
|
+
p2 = b;
|
|
34392
34647
|
groupPos = 2;
|
|
34393
34648
|
break;
|
|
34394
34649
|
case 2:
|
|
34395
|
-
bytes[bytePos++] = (
|
|
34396
|
-
|
|
34650
|
+
bytes[bytePos++] = (p2 & 15) << 4 | (b & 60) >> 2;
|
|
34651
|
+
p2 = b;
|
|
34397
34652
|
groupPos = 3;
|
|
34398
34653
|
break;
|
|
34399
34654
|
case 3:
|
|
34400
|
-
bytes[bytePos++] = (
|
|
34655
|
+
bytes[bytePos++] = (p2 & 3) << 6 | b;
|
|
34401
34656
|
groupPos = 0;
|
|
34402
34657
|
break;
|
|
34403
34658
|
}
|
|
@@ -34606,11 +34861,11 @@ function unescapeBytesDefaultValue(str) {
|
|
|
34606
34861
|
case "6":
|
|
34607
34862
|
case "7": {
|
|
34608
34863
|
const s = input2.c;
|
|
34609
|
-
const
|
|
34610
|
-
if (
|
|
34864
|
+
const t2 = input2.take(2);
|
|
34865
|
+
if (t2 === false) {
|
|
34611
34866
|
return false;
|
|
34612
34867
|
}
|
|
34613
|
-
const n = parseInt(s +
|
|
34868
|
+
const n = parseInt(s + t2, 8);
|
|
34614
34869
|
if (Number.isNaN(n)) {
|
|
34615
34870
|
return false;
|
|
34616
34871
|
}
|
|
@@ -34619,11 +34874,11 @@ function unescapeBytesDefaultValue(str) {
|
|
|
34619
34874
|
}
|
|
34620
34875
|
case "x": {
|
|
34621
34876
|
const s = input2.c;
|
|
34622
|
-
const
|
|
34623
|
-
if (
|
|
34877
|
+
const t2 = input2.take(2);
|
|
34878
|
+
if (t2 === false) {
|
|
34624
34879
|
return false;
|
|
34625
34880
|
}
|
|
34626
|
-
const n = parseInt(s +
|
|
34881
|
+
const n = parseInt(s + t2, 16);
|
|
34627
34882
|
if (Number.isNaN(n)) {
|
|
34628
34883
|
return false;
|
|
34629
34884
|
}
|
|
@@ -34632,11 +34887,11 @@ function unescapeBytesDefaultValue(str) {
|
|
|
34632
34887
|
}
|
|
34633
34888
|
case "u": {
|
|
34634
34889
|
const s = input2.c;
|
|
34635
|
-
const
|
|
34636
|
-
if (
|
|
34890
|
+
const t2 = input2.take(4);
|
|
34891
|
+
if (t2 === false) {
|
|
34637
34892
|
return false;
|
|
34638
34893
|
}
|
|
34639
|
-
const n = parseInt(s +
|
|
34894
|
+
const n = parseInt(s + t2, 16);
|
|
34640
34895
|
if (Number.isNaN(n)) {
|
|
34641
34896
|
return false;
|
|
34642
34897
|
}
|
|
@@ -34648,11 +34903,11 @@ function unescapeBytesDefaultValue(str) {
|
|
|
34648
34903
|
}
|
|
34649
34904
|
case "U": {
|
|
34650
34905
|
const s = input2.c;
|
|
34651
|
-
const
|
|
34652
|
-
if (
|
|
34906
|
+
const t2 = input2.take(8);
|
|
34907
|
+
if (t2 === false) {
|
|
34653
34908
|
return false;
|
|
34654
34909
|
}
|
|
34655
|
-
const tc = protoInt64.uEnc(s +
|
|
34910
|
+
const tc = protoInt64.uEnc(s + t2);
|
|
34656
34911
|
const chunk = new Uint8Array(8);
|
|
34657
34912
|
const view = new DataView(chunk.buffer);
|
|
34658
34913
|
view.setInt32(0, tc.lo, true);
|
|
@@ -34801,24 +35056,24 @@ function createBaseRegistry() {
|
|
|
34801
35056
|
return files.get(fileName);
|
|
34802
35057
|
},
|
|
34803
35058
|
getMessage(typeName) {
|
|
34804
|
-
const
|
|
34805
|
-
return (
|
|
35059
|
+
const t2 = types.get(typeName);
|
|
35060
|
+
return (t2 === null || t2 === void 0 ? void 0 : t2.kind) == "message" ? t2 : void 0;
|
|
34806
35061
|
},
|
|
34807
35062
|
getEnum(typeName) {
|
|
34808
|
-
const
|
|
34809
|
-
return (
|
|
35063
|
+
const t2 = types.get(typeName);
|
|
35064
|
+
return (t2 === null || t2 === void 0 ? void 0 : t2.kind) == "enum" ? t2 : void 0;
|
|
34810
35065
|
},
|
|
34811
35066
|
getExtension(typeName) {
|
|
34812
|
-
const
|
|
34813
|
-
return (
|
|
35067
|
+
const t2 = types.get(typeName);
|
|
35068
|
+
return (t2 === null || t2 === void 0 ? void 0 : t2.kind) == "extension" ? t2 : void 0;
|
|
34814
35069
|
},
|
|
34815
35070
|
getExtensionFor(extendee, no) {
|
|
34816
35071
|
var _a3;
|
|
34817
35072
|
return (_a3 = extendees.get(extendee.typeName)) === null || _a3 === void 0 ? void 0 : _a3.get(no);
|
|
34818
35073
|
},
|
|
34819
35074
|
getService(typeName) {
|
|
34820
|
-
const
|
|
34821
|
-
return (
|
|
35075
|
+
const t2 = types.get(typeName);
|
|
35076
|
+
return (t2 === null || t2 === void 0 ? void 0 : t2.kind) == "service" ? t2 : void 0;
|
|
34822
35077
|
}
|
|
34823
35078
|
};
|
|
34824
35079
|
}
|
|
@@ -34936,19 +35191,19 @@ function addEnum(proto, file2, parent, reg) {
|
|
|
34936
35191
|
};
|
|
34937
35192
|
desc.open = isEnumOpen(desc);
|
|
34938
35193
|
reg.add(desc);
|
|
34939
|
-
for (const
|
|
34940
|
-
const name2 =
|
|
35194
|
+
for (const p2 of proto.value) {
|
|
35195
|
+
const name2 = p2.name;
|
|
34941
35196
|
desc.values.push(
|
|
34942
35197
|
// biome-ignore lint/suspicious/noAssignInExpressions: no
|
|
34943
|
-
desc.value[
|
|
35198
|
+
desc.value[p2.number] = {
|
|
34944
35199
|
kind: "enum_value",
|
|
34945
|
-
proto:
|
|
34946
|
-
deprecated: (_d = (_c =
|
|
35200
|
+
proto: p2,
|
|
35201
|
+
deprecated: (_d = (_c = p2.options) === null || _c === void 0 ? void 0 : _c.deprecated) !== null && _d !== void 0 ? _d : false,
|
|
34947
35202
|
parent: desc,
|
|
34948
35203
|
name: name2,
|
|
34949
35204
|
localName: safeObjectProperty(sharedPrefix == void 0 ? name2 : name2.substring(sharedPrefix.length)),
|
|
34950
|
-
number:
|
|
34951
|
-
jsonName: (_e = findEnumValueJsonName(
|
|
35205
|
+
number: p2.number,
|
|
35206
|
+
jsonName: (_e = findEnumValueJsonName(p2)) !== null && _e !== void 0 ? _e : name2,
|
|
34952
35207
|
toString() {
|
|
34953
35208
|
return `enum value ${desc.typeName}.${name2}`;
|
|
34954
35209
|
}
|
|
@@ -40786,7 +41041,7 @@ ${JSON.stringify(symbolNames, null, 2)}`);
|
|
|
40786
41041
|
address += SIZE_OF_INT;
|
|
40787
41042
|
const captures = new Array(captureCount);
|
|
40788
41043
|
address = unmarshalCaptures(this, node2.tree, address, patternIndex, captures);
|
|
40789
|
-
if (this.textPredicates[patternIndex].every((
|
|
41044
|
+
if (this.textPredicates[patternIndex].every((p2) => p2(captures))) {
|
|
40790
41045
|
result[filteredCount] = { patternIndex, captures };
|
|
40791
41046
|
const setProperties = this.setProperties[patternIndex];
|
|
40792
41047
|
result[filteredCount].setProperties = setProperties;
|
|
@@ -40879,7 +41134,7 @@ ${JSON.stringify(symbolNames, null, 2)}`);
|
|
|
40879
41134
|
address += SIZE_OF_INT;
|
|
40880
41135
|
captures.length = captureCount;
|
|
40881
41136
|
address = unmarshalCaptures(this, node2.tree, address, patternIndex, captures);
|
|
40882
|
-
if (this.textPredicates[patternIndex].every((
|
|
41137
|
+
if (this.textPredicates[patternIndex].every((p2) => p2(captures))) {
|
|
40883
41138
|
const capture = captures[captureIndex];
|
|
40884
41139
|
const setProperties = this.setProperties[patternIndex];
|
|
40885
41140
|
capture.setProperties = setProperties;
|
|
@@ -41445,10 +41700,7 @@ var init_oidc = __esm({
|
|
|
41445
41700
|
}
|
|
41446
41701
|
});
|
|
41447
41702
|
|
|
41448
|
-
// ../index-builder/src/
|
|
41449
|
-
function stripNoise(text) {
|
|
41450
|
-
return text.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/\/\/[^\n]*/g, " ").replace(/"(?:[^"\\\n]|\\.)*"|'(?:[^'\\\n]|\\.)*'|`(?:[^`\\]|\\.)*`/g, '""');
|
|
41451
|
-
}
|
|
41703
|
+
// ../index-builder/src/rank.ts
|
|
41452
41704
|
function wordsOf(text) {
|
|
41453
41705
|
const parts2 = text.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[^A-Za-z0-9]+/);
|
|
41454
41706
|
const out2 = [];
|
|
@@ -41463,106 +41715,6 @@ function wordsOf(text) {
|
|
|
41463
41715
|
}
|
|
41464
41716
|
return out2;
|
|
41465
41717
|
}
|
|
41466
|
-
function resolveImport(from, spec) {
|
|
41467
|
-
if (!spec.startsWith(".")) return null;
|
|
41468
|
-
const parts2 = from.split("/").slice(0, -1);
|
|
41469
|
-
for (const piece of spec.split("/")) {
|
|
41470
|
-
if (piece === "." || piece === "") continue;
|
|
41471
|
-
if (piece === "..") parts2.pop();
|
|
41472
|
-
else parts2.push(piece);
|
|
41473
|
-
}
|
|
41474
|
-
return stripModuleExtension(parts2.join("/"));
|
|
41475
|
-
}
|
|
41476
|
-
function stripModuleExtension(path) {
|
|
41477
|
-
return path.replace(/\.(?:[cm]?[jt]sx?|d\.ts)$/, "");
|
|
41478
|
-
}
|
|
41479
|
-
function reaches(visible, path) {
|
|
41480
|
-
const bare = stripModuleExtension(path);
|
|
41481
|
-
return visible.has(bare) || visible.has(path) || bare.endsWith("/index") && visible.has(bare.slice(0, -"/index".length));
|
|
41482
|
-
}
|
|
41483
|
-
function headerOf(content, symbol2) {
|
|
41484
|
-
const lines = content.split("\n");
|
|
41485
|
-
const start2 = symbol2.range[0];
|
|
41486
|
-
const chunk = [];
|
|
41487
|
-
for (let i2 = start2; i2 < Math.min(lines.length, start2 + 4); i2 += 1) {
|
|
41488
|
-
const line3 = lines[i2] ?? "";
|
|
41489
|
-
chunk.push(line3);
|
|
41490
|
-
if (line3.includes("{")) break;
|
|
41491
|
-
}
|
|
41492
|
-
return chunk.join(" ");
|
|
41493
|
-
}
|
|
41494
|
-
async function buildRepoIndex(files) {
|
|
41495
|
-
const symbols2 = /* @__PURE__ */ new Map();
|
|
41496
|
-
const byName = /* @__PURE__ */ new Map();
|
|
41497
|
-
const byFile = /* @__PURE__ */ new Map();
|
|
41498
|
-
const imports = /* @__PURE__ */ new Map();
|
|
41499
|
-
const ranges = /* @__PURE__ */ new Map();
|
|
41500
|
-
const headers = /* @__PURE__ */ new Map();
|
|
41501
|
-
const paths = [...files.keys()].filter((path) => languageForPath(path) !== null).sort();
|
|
41502
|
-
for (const path of paths) {
|
|
41503
|
-
const content = files.get(path);
|
|
41504
|
-
const shard = await parseDeclarations(path, content);
|
|
41505
|
-
if (shard === null) continue;
|
|
41506
|
-
const targets = /* @__PURE__ */ new Set();
|
|
41507
|
-
for (const match of content.matchAll(/from\s+["']([^"']+)["']/g)) {
|
|
41508
|
-
const resolved = resolveImport(path, match[1] ?? "");
|
|
41509
|
-
if (resolved !== null) targets.add(resolved);
|
|
41510
|
-
}
|
|
41511
|
-
imports.set(path, targets);
|
|
41512
|
-
for (const symbol2 of shard.symbols) {
|
|
41513
|
-
const hash2 = symbol2.symbol.indexOf("#");
|
|
41514
|
-
const entry = { id: symbol2.symbol, name: symbol2.name, qualified: symbol2.symbol.slice(hash2 + 1), kind: symbol2.kind, path, line: symbol2.range[0] + 1, parent: symbol2.parent };
|
|
41515
|
-
symbols2.set(entry.id, entry);
|
|
41516
|
-
ranges.set(entry.id, symbol2);
|
|
41517
|
-
byName.set(entry.name, [...byName.get(entry.name) ?? [], entry]);
|
|
41518
|
-
byFile.set(path, [...byFile.get(path) ?? [], entry]);
|
|
41519
|
-
if (symbol2.kind === "class" || symbol2.kind === "interface") headers.set(entry.id, headerOf(content, symbol2));
|
|
41520
|
-
}
|
|
41521
|
-
}
|
|
41522
|
-
const callees = /* @__PURE__ */ new Map();
|
|
41523
|
-
const callers = /* @__PURE__ */ new Map();
|
|
41524
|
-
for (const entry of symbols2.values()) {
|
|
41525
|
-
if (!CALLABLE.has(entry.kind)) continue;
|
|
41526
|
-
const range = ranges.get(entry.id)?.enclosingRange;
|
|
41527
|
-
if (range === void 0) continue;
|
|
41528
|
-
const text = stripNoise(files.get(entry.path).split("\n").slice(range[0], range[2] + 1).join("\n"));
|
|
41529
|
-
const visible = imports.get(entry.path) ?? /* @__PURE__ */ new Set();
|
|
41530
|
-
const seen = /* @__PURE__ */ new Set();
|
|
41531
|
-
for (const match of text.matchAll(/[A-Za-z_$][\w$]*/g)) {
|
|
41532
|
-
const id2 = match[0];
|
|
41533
|
-
if (KEYWORDS.has(id2) || seen.has(id2)) continue;
|
|
41534
|
-
seen.add(id2);
|
|
41535
|
-
for (const target2 of byName.get(id2) ?? []) {
|
|
41536
|
-
if (target2.id === entry.id || target2.kind === "property" || target2.kind === "parameter") continue;
|
|
41537
|
-
if (target2.path !== entry.path && !reaches(visible, target2.path)) continue;
|
|
41538
|
-
if (target2.id === entry.parent) continue;
|
|
41539
|
-
callees.set(entry.id, (callees.get(entry.id) ?? /* @__PURE__ */ new Set()).add(target2.id));
|
|
41540
|
-
callers.set(target2.id, (callers.get(target2.id) ?? /* @__PURE__ */ new Set()).add(entry.id));
|
|
41541
|
-
}
|
|
41542
|
-
}
|
|
41543
|
-
}
|
|
41544
|
-
const heritage = /* @__PURE__ */ new Map();
|
|
41545
|
-
const heirs = /* @__PURE__ */ new Map();
|
|
41546
|
-
const resolve16 = (from, name2) => {
|
|
41547
|
-
const visible = imports.get(from.path) ?? /* @__PURE__ */ new Set();
|
|
41548
|
-
return (byName.get(baseName(name2)) ?? []).find((candidate) => candidate.path === from.path || reaches(visible, candidate.path));
|
|
41549
|
-
};
|
|
41550
|
-
for (const [id2, header] of headers) {
|
|
41551
|
-
const entry = symbols2.get(id2);
|
|
41552
|
-
const stem2 = header.slice(header.indexOf(entry.name) + entry.name.length).replace(/^<[^>]*>/, "").replace(/\{.*$/, "");
|
|
41553
|
-
const ext = /\bextends\s+([A-Za-z_$][\w$.]*)/.exec(stem2)?.[1];
|
|
41554
|
-
const impl = /\bimplements\s+(.+)$/.exec(stem2)?.[1];
|
|
41555
|
-
const extendsIds = ext === void 0 ? [] : [resolve16(entry, ext)?.id].filter((value) => value !== void 0);
|
|
41556
|
-
const implementsIds = (impl === void 0 ? [] : impl.split(/,(?![^<]*>)/).map((part) => resolve16(entry, part.trim()))).filter((value) => value !== void 0).map((value) => value.id);
|
|
41557
|
-
if (extendsIds.length === 0 && implementsIds.length === 0) continue;
|
|
41558
|
-
heritage.set(id2, { extends: extendsIds, implements: implementsIds });
|
|
41559
|
-
for (const target2 of extendsIds) heirs.set(target2, { extendedBy: [...heirs.get(target2)?.extendedBy ?? [], id2], implementedBy: heirs.get(target2)?.implementedBy ?? [] });
|
|
41560
|
-
for (const target2 of implementsIds) heirs.set(target2, { extendedBy: heirs.get(target2)?.extendedBy ?? [], implementedBy: [...heirs.get(target2)?.implementedBy ?? [], id2] });
|
|
41561
|
-
}
|
|
41562
|
-
const words = /* @__PURE__ */ new Map();
|
|
41563
|
-
for (const entry of symbols2.values()) for (const word of new Set(wordsOf(entry.name))) words.set(word, (words.get(word) ?? 0) + 1);
|
|
41564
|
-
return { files: paths.length, symbols: symbols2, byName, byFile, callees, callers, heritage, heirs, imports, words, wordDocs: symbols2.size };
|
|
41565
|
-
}
|
|
41566
41718
|
function idf(index, word) {
|
|
41567
41719
|
return Math.log(index.wordDocs / (1 + (index.words.get(word) ?? 0)));
|
|
41568
41720
|
}
|
|
@@ -41664,17 +41816,17 @@ function seedBlock(index, seed) {
|
|
|
41664
41816
|
const out2 = [`${seed.kind} ${where(seed)}`];
|
|
41665
41817
|
const heirs = index.heirs.get(seed.id);
|
|
41666
41818
|
const heritage = index.heritage.get(seed.id);
|
|
41667
|
-
const
|
|
41819
|
+
const list2 = (ids, limit) => {
|
|
41668
41820
|
const shown2 = ids.slice(0, limit).map((id2) => index.symbols.get(id2)).filter((value) => value !== void 0).sort((a, b) => a.path.localeCompare(b.path));
|
|
41669
41821
|
return `${shown2.map((entry) => `${entry.name} ${entry.path}:${entry.line}`).join("; ")}${ids.length > limit ? `; (+${ids.length - limit} more, ${ids.length} total)` : ""}`;
|
|
41670
41822
|
};
|
|
41671
41823
|
if (heritage !== void 0) {
|
|
41672
|
-
if (heritage.extends.length > 0) out2.push(` extends: ${
|
|
41673
|
-
if (heritage.implements.length > 0) out2.push(` implements: ${
|
|
41824
|
+
if (heritage.extends.length > 0) out2.push(` extends: ${list2(heritage.extends, 4)}`);
|
|
41825
|
+
if (heritage.implements.length > 0) out2.push(` implements: ${list2(heritage.implements, 4)}`);
|
|
41674
41826
|
}
|
|
41675
41827
|
if (heirs !== void 0) {
|
|
41676
|
-
if (heirs.implementedBy.length > 0) out2.push(` implemented by: ${
|
|
41677
|
-
if (heirs.extendedBy.length > 0) out2.push(` extended by: ${
|
|
41828
|
+
if (heirs.implementedBy.length > 0) out2.push(` implemented by: ${list2(heirs.implementedBy, 12)}`);
|
|
41829
|
+
if (heirs.extendedBy.length > 0) out2.push(` extended by: ${list2(heirs.extendedBy, 6)}`);
|
|
41678
41830
|
}
|
|
41679
41831
|
const calls = [...index.callees.get(seed.id) ?? []].map((id2) => index.symbols.get(id2)).sort((a, b) => a.path.localeCompare(b.path) || a.line - b.line);
|
|
41680
41832
|
if (calls.length > 0) out2.push(` calls: ${calls.slice(0, 8).map((entry) => `${entry.qualified} ${entry.path}:${entry.line}`).join("; ")}${calls.length > 8 ? `; (+${calls.length - 8} more)` : ""}`);
|
|
@@ -41760,27 +41912,150 @@ function buildCodeMapDigest(input2) {
|
|
|
41760
41912
|
seeds: map2.seeds
|
|
41761
41913
|
};
|
|
41762
41914
|
}
|
|
41763
|
-
|
|
41764
|
-
|
|
41765
|
-
|
|
41915
|
+
function serializeRepoIndex(index) {
|
|
41916
|
+
const position = /* @__PURE__ */ new Map();
|
|
41917
|
+
for (const id2 of index.symbols.keys()) position.set(id2, position.size);
|
|
41918
|
+
const at = (id2) => position.get(id2) ?? -1;
|
|
41919
|
+
const symbols2 = [...index.symbols.values()].map((s) => [s.name, s.qualified, s.kind, s.path, s.line, s.parent === void 0 ? -1 : at(s.parent)]);
|
|
41920
|
+
const callees = [...index.callees].map(([from, to]) => [at(from), ...[...to].map(at)]);
|
|
41921
|
+
const heritage = [...index.heritage].map(([id2, h]) => ({ id: at(id2), extends: h.extends.map(at), implements: h.implements.map(at) }));
|
|
41922
|
+
return { schemaVersion: "1", files: index.files, wordDocs: index.wordDocs, symbols: symbols2, callees, heritage, paths: [...index.imports.keys()], words: [...index.words] };
|
|
41923
|
+
}
|
|
41924
|
+
var SEEDABLE, MIN_WORD_IDF, MIN_SOFT_SCORE, MAX_RELATED_FILES, STOP, DEFAULT_MAP_OPTIONS, estimateTokens, where;
|
|
41925
|
+
var init_rank = __esm({
|
|
41926
|
+
"../index-builder/src/rank.ts"() {
|
|
41766
41927
|
"use strict";
|
|
41767
41928
|
init_src();
|
|
41768
|
-
init_languages();
|
|
41769
|
-
init_treesitter();
|
|
41770
|
-
KEYWORDS = /* @__PURE__ */ new Set(["const", "let", "var", "function", "return", "if", "else", "new", "this", "class", "extends", "implements", "import", "export", "from", "type", "interface", "async", "await", "string", "number", "boolean", "void", "null", "undefined", "true", "false", "private", "protected", "public", "readonly", "static", "abstract", "super", "typeof", "for", "of", "in", "while", "throw", "try", "catch", "as"]);
|
|
41771
|
-
CALLABLE = /* @__PURE__ */ new Set(["function", "method", "constant", "variable"]);
|
|
41772
41929
|
SEEDABLE = /* @__PURE__ */ new Set(["function", "method", "class", "interface", "type", "constant"]);
|
|
41773
41930
|
MIN_WORD_IDF = 2.5;
|
|
41774
41931
|
MIN_SOFT_SCORE = 3.5;
|
|
41775
41932
|
MAX_RELATED_FILES = 14;
|
|
41776
41933
|
STOP = /* @__PURE__ */ new Set(["the", "a", "an", "of", "to", "in", "is", "are", "and", "or", "for", "that", "this", "it", "its", "by", "be", "on", "as", "at", "with", "from", "which", "what", "when", "where", "who", "how", "do", "does", "not", "any", "each", "every", "all", "also", "than", "then", "so", "if", "into", "file", "path", "answer", "end", "final", "message", "line", "start", "follow", "separate", "comma", "give", "name", "modify", "files", "repository", "source", "code", "change", "update", "make", "use", "uses", "used", "other", "only", "about", "will", "can", "should", "need", "needs", "happen", "merely", "share", "same", "return", "returns", "pass", "passes"]);
|
|
41777
|
-
baseName = (name2) => name2.replace(/<.*$/, "").split(".").pop() ?? name2;
|
|
41778
41934
|
DEFAULT_MAP_OPTIONS = { maxTokens: 3400, maxSeeds: 6 };
|
|
41779
41935
|
estimateTokens = estimateCodeMapTokens;
|
|
41780
41936
|
where = (symbol2) => `${symbol2.qualified} ${symbol2.path}:${symbol2.line}`;
|
|
41781
41937
|
}
|
|
41782
41938
|
});
|
|
41783
41939
|
|
|
41940
|
+
// ../index-builder/src/context-map.ts
|
|
41941
|
+
function stripNoise(text) {
|
|
41942
|
+
return text.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/\/\/[^\n]*/g, " ").replace(/"(?:[^"\\\n]|\\.)*"|'(?:[^'\\\n]|\\.)*'|`(?:[^`\\]|\\.)*`/g, '""');
|
|
41943
|
+
}
|
|
41944
|
+
function resolveImport(from, spec) {
|
|
41945
|
+
if (!spec.startsWith(".")) return null;
|
|
41946
|
+
const parts2 = from.split("/").slice(0, -1);
|
|
41947
|
+
for (const piece of spec.split("/")) {
|
|
41948
|
+
if (piece === "." || piece === "") continue;
|
|
41949
|
+
if (piece === "..") parts2.pop();
|
|
41950
|
+
else parts2.push(piece);
|
|
41951
|
+
}
|
|
41952
|
+
return stripModuleExtension(parts2.join("/"));
|
|
41953
|
+
}
|
|
41954
|
+
function stripModuleExtension(path) {
|
|
41955
|
+
return path.replace(/\.(?:[cm]?[jt]sx?|d\.ts)$/, "");
|
|
41956
|
+
}
|
|
41957
|
+
function reaches(visible, path) {
|
|
41958
|
+
const bare = stripModuleExtension(path);
|
|
41959
|
+
return visible.has(bare) || visible.has(path) || bare.endsWith("/index") && visible.has(bare.slice(0, -"/index".length));
|
|
41960
|
+
}
|
|
41961
|
+
function headerOf(content, symbol2) {
|
|
41962
|
+
const lines = content.split("\n");
|
|
41963
|
+
const start2 = symbol2.range[0];
|
|
41964
|
+
const chunk = [];
|
|
41965
|
+
for (let i2 = start2; i2 < Math.min(lines.length, start2 + 4); i2 += 1) {
|
|
41966
|
+
const line3 = lines[i2] ?? "";
|
|
41967
|
+
chunk.push(line3);
|
|
41968
|
+
if (line3.includes("{")) break;
|
|
41969
|
+
}
|
|
41970
|
+
return chunk.join(" ");
|
|
41971
|
+
}
|
|
41972
|
+
async function buildRepoIndex(files) {
|
|
41973
|
+
const symbols2 = /* @__PURE__ */ new Map();
|
|
41974
|
+
const byName = /* @__PURE__ */ new Map();
|
|
41975
|
+
const byFile = /* @__PURE__ */ new Map();
|
|
41976
|
+
const imports = /* @__PURE__ */ new Map();
|
|
41977
|
+
const ranges = /* @__PURE__ */ new Map();
|
|
41978
|
+
const headers = /* @__PURE__ */ new Map();
|
|
41979
|
+
const paths = [...files.keys()].filter((path) => languageForPath(path) !== null).sort();
|
|
41980
|
+
for (const path of paths) {
|
|
41981
|
+
const content = files.get(path);
|
|
41982
|
+
const shard = await parseDeclarations(path, content);
|
|
41983
|
+
if (shard === null) continue;
|
|
41984
|
+
const targets = /* @__PURE__ */ new Set();
|
|
41985
|
+
for (const match of content.matchAll(/from\s+["']([^"']+)["']/g)) {
|
|
41986
|
+
const resolved = resolveImport(path, match[1] ?? "");
|
|
41987
|
+
if (resolved !== null) targets.add(resolved);
|
|
41988
|
+
}
|
|
41989
|
+
imports.set(path, targets);
|
|
41990
|
+
for (const symbol2 of shard.symbols) {
|
|
41991
|
+
const hash2 = symbol2.symbol.indexOf("#");
|
|
41992
|
+
const entry = { id: symbol2.symbol, name: symbol2.name, qualified: symbol2.symbol.slice(hash2 + 1), kind: symbol2.kind, path, line: symbol2.range[0] + 1, parent: symbol2.parent };
|
|
41993
|
+
symbols2.set(entry.id, entry);
|
|
41994
|
+
ranges.set(entry.id, symbol2);
|
|
41995
|
+
byName.set(entry.name, [...byName.get(entry.name) ?? [], entry]);
|
|
41996
|
+
byFile.set(path, [...byFile.get(path) ?? [], entry]);
|
|
41997
|
+
if (symbol2.kind === "class" || symbol2.kind === "interface") headers.set(entry.id, headerOf(content, symbol2));
|
|
41998
|
+
}
|
|
41999
|
+
}
|
|
42000
|
+
const callees = /* @__PURE__ */ new Map();
|
|
42001
|
+
const callers = /* @__PURE__ */ new Map();
|
|
42002
|
+
for (const entry of symbols2.values()) {
|
|
42003
|
+
if (!CALLABLE.has(entry.kind)) continue;
|
|
42004
|
+
const range = ranges.get(entry.id)?.enclosingRange;
|
|
42005
|
+
if (range === void 0) continue;
|
|
42006
|
+
const text = stripNoise(files.get(entry.path).split("\n").slice(range[0], range[2] + 1).join("\n"));
|
|
42007
|
+
const visible = imports.get(entry.path) ?? /* @__PURE__ */ new Set();
|
|
42008
|
+
const seen = /* @__PURE__ */ new Set();
|
|
42009
|
+
for (const match of text.matchAll(/[A-Za-z_$][\w$]*/g)) {
|
|
42010
|
+
const id2 = match[0];
|
|
42011
|
+
if (KEYWORDS.has(id2) || seen.has(id2)) continue;
|
|
42012
|
+
seen.add(id2);
|
|
42013
|
+
for (const target2 of byName.get(id2) ?? []) {
|
|
42014
|
+
if (target2.id === entry.id || target2.kind === "property" || target2.kind === "parameter") continue;
|
|
42015
|
+
if (target2.path !== entry.path && !reaches(visible, target2.path)) continue;
|
|
42016
|
+
if (target2.id === entry.parent) continue;
|
|
42017
|
+
callees.set(entry.id, (callees.get(entry.id) ?? /* @__PURE__ */ new Set()).add(target2.id));
|
|
42018
|
+
callers.set(target2.id, (callers.get(target2.id) ?? /* @__PURE__ */ new Set()).add(entry.id));
|
|
42019
|
+
}
|
|
42020
|
+
}
|
|
42021
|
+
}
|
|
42022
|
+
const heritage = /* @__PURE__ */ new Map();
|
|
42023
|
+
const heirs = /* @__PURE__ */ new Map();
|
|
42024
|
+
const resolve16 = (from, name2) => {
|
|
42025
|
+
const visible = imports.get(from.path) ?? /* @__PURE__ */ new Set();
|
|
42026
|
+
return (byName.get(baseName(name2)) ?? []).find((candidate) => candidate.path === from.path || reaches(visible, candidate.path));
|
|
42027
|
+
};
|
|
42028
|
+
for (const [id2, header] of headers) {
|
|
42029
|
+
const entry = symbols2.get(id2);
|
|
42030
|
+
const stem2 = header.slice(header.indexOf(entry.name) + entry.name.length).replace(/^<[^>]*>/, "").replace(/\{.*$/, "");
|
|
42031
|
+
const ext = /\bextends\s+([A-Za-z_$][\w$.]*)/.exec(stem2)?.[1];
|
|
42032
|
+
const impl = /\bimplements\s+(.+)$/.exec(stem2)?.[1];
|
|
42033
|
+
const extendsIds = ext === void 0 ? [] : [resolve16(entry, ext)?.id].filter((value) => value !== void 0);
|
|
42034
|
+
const implementsIds = (impl === void 0 ? [] : impl.split(/,(?![^<]*>)/).map((part) => resolve16(entry, part.trim()))).filter((value) => value !== void 0).map((value) => value.id);
|
|
42035
|
+
if (extendsIds.length === 0 && implementsIds.length === 0) continue;
|
|
42036
|
+
heritage.set(id2, { extends: extendsIds, implements: implementsIds });
|
|
42037
|
+
for (const target2 of extendsIds) heirs.set(target2, { extendedBy: [...heirs.get(target2)?.extendedBy ?? [], id2], implementedBy: heirs.get(target2)?.implementedBy ?? [] });
|
|
42038
|
+
for (const target2 of implementsIds) heirs.set(target2, { extendedBy: heirs.get(target2)?.extendedBy ?? [], implementedBy: [...heirs.get(target2)?.implementedBy ?? [], id2] });
|
|
42039
|
+
}
|
|
42040
|
+
const words = /* @__PURE__ */ new Map();
|
|
42041
|
+
for (const entry of symbols2.values()) for (const word of new Set(wordsOf(entry.name))) words.set(word, (words.get(word) ?? 0) + 1);
|
|
42042
|
+
return { files: paths.length, symbols: symbols2, byName, byFile, callees, callers, heritage, heirs, imports, words, wordDocs: symbols2.size };
|
|
42043
|
+
}
|
|
42044
|
+
var KEYWORDS, CALLABLE, baseName;
|
|
42045
|
+
var init_context_map = __esm({
|
|
42046
|
+
"../index-builder/src/context-map.ts"() {
|
|
42047
|
+
"use strict";
|
|
42048
|
+
init_src();
|
|
42049
|
+
init_languages();
|
|
42050
|
+
init_treesitter();
|
|
42051
|
+
init_rank();
|
|
42052
|
+
init_rank();
|
|
42053
|
+
KEYWORDS = /* @__PURE__ */ new Set(["const", "let", "var", "function", "return", "if", "else", "new", "this", "class", "extends", "implements", "import", "export", "from", "type", "interface", "async", "await", "string", "number", "boolean", "void", "null", "undefined", "true", "false", "private", "protected", "public", "readonly", "static", "abstract", "super", "typeof", "for", "of", "in", "while", "throw", "try", "catch", "as"]);
|
|
42054
|
+
CALLABLE = /* @__PURE__ */ new Set(["function", "method", "constant", "variable"]);
|
|
42055
|
+
baseName = (name2) => name2.replace(/<.*$/, "").split(".").pop() ?? name2;
|
|
42056
|
+
}
|
|
42057
|
+
});
|
|
42058
|
+
|
|
41784
42059
|
// ../index-builder/src/context-map-build.ts
|
|
41785
42060
|
import { execFile as execFile2 } from "node:child_process";
|
|
41786
42061
|
import { mkdir as mkdir3, readFile as readFile5, writeFile as writeFile3 } from "node:fs/promises";
|
|
@@ -41790,7 +42065,7 @@ async function git5(root, args2) {
|
|
|
41790
42065
|
const { stdout } = await execFileAsync2("git", args2, { cwd: root, encoding: "utf8", maxBuffer: 256 * 1024 * 1024 });
|
|
41791
42066
|
return stdout.trim();
|
|
41792
42067
|
}
|
|
41793
|
-
async function
|
|
42068
|
+
async function buildArtifactsForCheckout(options) {
|
|
41794
42069
|
const tracked = (await execFileAsync2("git", ["ls-files", "-z"], { cwd: options.root, encoding: "utf8", maxBuffer: 256 * 1024 * 1024 })).stdout.split("\0").filter((path) => path !== "");
|
|
41795
42070
|
const files = /* @__PURE__ */ new Map();
|
|
41796
42071
|
let uncovered = 0;
|
|
@@ -41815,9 +42090,17 @@ async function buildDigestForCheckout(options) {
|
|
|
41815
42090
|
} catch {
|
|
41816
42091
|
branch = void 0;
|
|
41817
42092
|
}
|
|
41818
|
-
|
|
41819
|
-
|
|
41820
|
-
);
|
|
42093
|
+
const builtAt = options.builtAt ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
42094
|
+
const digest = CodeMapDigest.parse(buildCodeMapDigest({ index, commitSha, ...branch === void 0 ? {} : { branch }, uncovered, builtAt, ...options.task === void 0 ? {} : { task: options.task } }));
|
|
42095
|
+
const indexFile = { schemaVersion: "1", revision: { commitSha, ...branch === void 0 ? {} : { branch } }, builtAt, uncovered, index: serializeRepoIndex(index) };
|
|
42096
|
+
return { digest, indexFile };
|
|
42097
|
+
}
|
|
42098
|
+
async function writeIndexFile(root, indexFile) {
|
|
42099
|
+
const path = join27(root, CODE_INDEX_PATH);
|
|
42100
|
+
await mkdir3(dirname10(path), { recursive: true });
|
|
42101
|
+
await writeFile3(path, `${JSON.stringify(indexFile)}
|
|
42102
|
+
`);
|
|
42103
|
+
return path;
|
|
41821
42104
|
}
|
|
41822
42105
|
async function writeDigest(root, digest, out2) {
|
|
41823
42106
|
const path = out2 ?? join27(root, CODE_MAP_DIGEST_PATH);
|
|
@@ -41896,9 +42179,10 @@ async function runCli2(argv, env, out2 = console.log, err2 = console.error) {
|
|
|
41896
42179
|
}
|
|
41897
42180
|
if (command === "map") {
|
|
41898
42181
|
const root = resolve14(values.root ?? process.cwd());
|
|
41899
|
-
const digest = await
|
|
42182
|
+
const { digest, indexFile } = await buildArtifactsForCheckout({ root, ...values.task === void 0 ? {} : { task: values.task } });
|
|
41900
42183
|
const path = await writeDigest(root, digest, values.out === void 0 ? void 0 : resolve14(values.out));
|
|
41901
|
-
|
|
42184
|
+
const indexPath = values.out === void 0 ? await writeIndexFile(root, indexFile) : null;
|
|
42185
|
+
out2(`wrote the code map digest for ${digest.revision.commitSha.slice(0, 12)} (${digest.coverage.files} files, ${digest.coverage.symbols} symbols, ${digest.lines.length} lines) to ${path}${indexPath === null ? "" : `, and the ranking index to ${indexPath}`}`);
|
|
41902
42186
|
return 0;
|
|
41903
42187
|
}
|
|
41904
42188
|
if (command === "upload") {
|
|
@@ -44124,8 +44408,8 @@ function triState$1(schema, raw) {
|
|
|
44124
44408
|
message: String(parsed.error)
|
|
44125
44409
|
};
|
|
44126
44410
|
}
|
|
44127
|
-
function toolNeedsLegacyWrap(
|
|
44128
|
-
return isPlainObject$6(
|
|
44411
|
+
function toolNeedsLegacyWrap(t2) {
|
|
44412
|
+
return isPlainObject$6(t2) && isPlainObject$6(t2["outputSchema"]) && isNonObjectJsonSchemaRoot(t2["outputSchema"]);
|
|
44129
44413
|
}
|
|
44130
44414
|
function toNeutralResult(value) {
|
|
44131
44415
|
return value;
|
|
@@ -45387,7 +45671,7 @@ function isProvablyObjectShapedRoot(schema) {
|
|
|
45387
45671
|
}
|
|
45388
45672
|
function formatIssue(issue2) {
|
|
45389
45673
|
if (!issue2.path?.length) return issue2.message;
|
|
45390
|
-
return `${issue2.path.map((
|
|
45674
|
+
return `${issue2.path.map((p2) => String(typeof p2 === "object" ? p2.key : p2)).join(".")}: ${issue2.message}`;
|
|
45391
45675
|
}
|
|
45392
45676
|
async function validateStandardSchema(schema, data) {
|
|
45393
45677
|
const result = await schema["~standard"].validate(data);
|
|
@@ -46002,13 +46286,13 @@ var init_src_CX2iR2pK = __esm({
|
|
|
46002
46286
|
encodeResult(method, result) {
|
|
46003
46287
|
if (method !== "tools/list") return result;
|
|
46004
46288
|
const tools = result.tools;
|
|
46005
|
-
if (!Array.isArray(tools) || !tools.some((
|
|
46289
|
+
if (!Array.isArray(tools) || !tools.some((t2) => toolNeedsLegacyWrap(t2))) return result;
|
|
46006
46290
|
return {
|
|
46007
46291
|
...result,
|
|
46008
|
-
tools: tools.map((
|
|
46009
|
-
...
|
|
46010
|
-
outputSchema: wrapOutputSchemaForLegacy(
|
|
46011
|
-
} :
|
|
46292
|
+
tools: tools.map((t2) => toolNeedsLegacyWrap(t2) ? {
|
|
46293
|
+
...t2,
|
|
46294
|
+
outputSchema: wrapOutputSchemaForLegacy(t2.outputSchema)
|
|
46295
|
+
} : t2)
|
|
46012
46296
|
};
|
|
46013
46297
|
},
|
|
46014
46298
|
encodeErrorCode: (code2) => code2 === -32002 ? -32602 : code2,
|
|
@@ -47674,7 +47958,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
47674
47958
|
};
|
|
47675
47959
|
exports._CodeOrName = _CodeOrName;
|
|
47676
47960
|
exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
|
|
47677
|
-
var
|
|
47961
|
+
var Name3 = class extends _CodeOrName {
|
|
47678
47962
|
constructor(s) {
|
|
47679
47963
|
super();
|
|
47680
47964
|
if (!exports.IDENTIFIER.test(s)) throw new Error("CodeGen: name must be a valid identifier");
|
|
@@ -47690,7 +47974,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
47690
47974
|
return { [this.str]: 1 };
|
|
47691
47975
|
}
|
|
47692
47976
|
};
|
|
47693
|
-
exports.Name =
|
|
47977
|
+
exports.Name = Name3;
|
|
47694
47978
|
var _Code = class extends _CodeOrName {
|
|
47695
47979
|
constructor(code2) {
|
|
47696
47980
|
super();
|
|
@@ -47711,7 +47995,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
47711
47995
|
get names() {
|
|
47712
47996
|
var _a3;
|
|
47713
47997
|
return (_a3 = this._names) !== null && _a3 !== void 0 ? _a3 : this._names = this._items.reduce((names, c) => {
|
|
47714
|
-
if (c instanceof
|
|
47998
|
+
if (c instanceof Name3) names[c.str] = (names[c.str] || 0) + 1;
|
|
47715
47999
|
return names;
|
|
47716
48000
|
}, {});
|
|
47717
48001
|
}
|
|
@@ -47743,7 +48027,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
47743
48027
|
exports.str = str;
|
|
47744
48028
|
function addCodeArg(code2, arg4) {
|
|
47745
48029
|
if (arg4 instanceof _Code) code2.push(...arg4._items);
|
|
47746
|
-
else if (arg4 instanceof
|
|
48030
|
+
else if (arg4 instanceof Name3) code2.push(arg4);
|
|
47747
48031
|
else code2.push(interpolate(arg4));
|
|
47748
48032
|
}
|
|
47749
48033
|
exports.addCodeArg = addCodeArg;
|
|
@@ -47765,12 +48049,12 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
47765
48049
|
if (b === '""') return a;
|
|
47766
48050
|
if (a === '""') return b;
|
|
47767
48051
|
if (typeof a == "string") {
|
|
47768
|
-
if (b instanceof
|
|
48052
|
+
if (b instanceof Name3 || a[a.length - 1] !== '"') return;
|
|
47769
48053
|
if (typeof b != "string") return `${a.slice(0, -1)}${b}"`;
|
|
47770
48054
|
if (b[0] === '"') return a.slice(0, -1) + b.slice(1);
|
|
47771
48055
|
return;
|
|
47772
48056
|
}
|
|
47773
|
-
if (typeof b == "string" && b[0] === '"' && !(a instanceof
|
|
48057
|
+
if (typeof b == "string" && b[0] === '"' && !(a instanceof Name3)) return `"${a}${b.slice(1)}`;
|
|
47774
48058
|
}
|
|
47775
48059
|
function strConcat(c1, c2) {
|
|
47776
48060
|
return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`;
|
|
@@ -48713,7 +48997,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
48713
48997
|
}
|
|
48714
48998
|
exports.evaluatedPropsToName = evaluatedPropsToName;
|
|
48715
48999
|
function setEvaluated(gen, props, ps) {
|
|
48716
|
-
Object.keys(ps).forEach((
|
|
49000
|
+
Object.keys(ps).forEach((p2) => gen.assign((0, codegen_1._)`${props}${(0, codegen_1.getProperty)(p2)}`, true));
|
|
48717
49001
|
}
|
|
48718
49002
|
exports.setEvaluated = setEvaluated;
|
|
48719
49003
|
const snippets = {};
|
|
@@ -49027,7 +49311,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
49027
49311
|
"null"
|
|
49028
49312
|
]);
|
|
49029
49313
|
function coerceToTypes(types, coerceTypes) {
|
|
49030
|
-
return coerceTypes ? types.filter((
|
|
49314
|
+
return coerceTypes ? types.filter((t2) => COERCIBLE.has(t2) || coerceTypes === "array" && t2 === "array") : [];
|
|
49031
49315
|
}
|
|
49032
49316
|
function coerceData(it, types, coerceTo) {
|
|
49033
49317
|
const { gen, data, opts } = it;
|
|
@@ -49035,7 +49319,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
49035
49319
|
const coerced = gen.let("coerced", (0, codegen_1._)`undefined`);
|
|
49036
49320
|
if (opts.coerceTypes === "array") gen.if((0, codegen_1._)`${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen.assign(data, (0, codegen_1._)`${data}[0]`).assign(dataType, (0, codegen_1._)`typeof ${data}`).if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data)));
|
|
49037
49321
|
gen.if((0, codegen_1._)`${coerced} !== undefined`);
|
|
49038
|
-
for (const
|
|
49322
|
+
for (const t2 of coerceTo) if (COERCIBLE.has(t2) || t2 === "array" && opts.coerceTypes === "array") coerceSpecificType(t2);
|
|
49039
49323
|
gen.else();
|
|
49040
49324
|
reportTypeError(it);
|
|
49041
49325
|
gen.endIf();
|
|
@@ -49043,8 +49327,8 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
49043
49327
|
gen.assign(data, coerced);
|
|
49044
49328
|
assignParentData(it, coerced);
|
|
49045
49329
|
});
|
|
49046
|
-
function coerceSpecificType(
|
|
49047
|
-
switch (
|
|
49330
|
+
function coerceSpecificType(t2) {
|
|
49331
|
+
switch (t2) {
|
|
49048
49332
|
case "string":
|
|
49049
49333
|
gen.elseIf((0, codegen_1._)`${dataType} == "number" || ${dataType} == "boolean"`).assign(coerced, (0, codegen_1._)`"" + ${data}`).elseIf((0, codegen_1._)`${data} === null`).assign(coerced, (0, codegen_1._)`""`);
|
|
49050
49334
|
return;
|
|
@@ -49111,7 +49395,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
49111
49395
|
delete types.object;
|
|
49112
49396
|
} else cond = codegen_1.nil;
|
|
49113
49397
|
if (types.number) delete types.integer;
|
|
49114
|
-
for (const
|
|
49398
|
+
for (const t2 in types) cond = (0, codegen_1.and)(cond, checkDataType(t2, data, strictNums, correct));
|
|
49115
49399
|
return cond;
|
|
49116
49400
|
}
|
|
49117
49401
|
exports.checkDataTypes = checkDataTypes;
|
|
@@ -49210,11 +49494,11 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
49210
49494
|
}
|
|
49211
49495
|
exports.noPropertyInData = noPropertyInData;
|
|
49212
49496
|
function allSchemaProperties(schemaMap) {
|
|
49213
|
-
return schemaMap ? Object.keys(schemaMap).filter((
|
|
49497
|
+
return schemaMap ? Object.keys(schemaMap).filter((p2) => p2 !== "__proto__") : [];
|
|
49214
49498
|
}
|
|
49215
49499
|
exports.allSchemaProperties = allSchemaProperties;
|
|
49216
49500
|
function schemaProperties(it, schemaMap) {
|
|
49217
|
-
return allSchemaProperties(schemaMap).filter((
|
|
49501
|
+
return allSchemaProperties(schemaMap).filter((p2) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p2]));
|
|
49218
49502
|
}
|
|
49219
49503
|
exports.schemaProperties = schemaProperties;
|
|
49220
49504
|
function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func2, context4, passSchema) {
|
|
@@ -49619,8 +49903,8 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
49619
49903
|
return _getFullPath(resolver, resolver.parse(id2));
|
|
49620
49904
|
}
|
|
49621
49905
|
exports.getFullPath = getFullPath;
|
|
49622
|
-
function _getFullPath(resolver,
|
|
49623
|
-
return resolver.serialize(
|
|
49906
|
+
function _getFullPath(resolver, p2) {
|
|
49907
|
+
return resolver.serialize(p2).split("#")[0] + "#";
|
|
49624
49908
|
}
|
|
49625
49909
|
exports._getFullPath = _getFullPath;
|
|
49626
49910
|
const TRAILING_SLASH_HASH = /#\/?$/;
|
|
@@ -49873,8 +50157,8 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
49873
50157
|
it.dataTypes = types;
|
|
49874
50158
|
return;
|
|
49875
50159
|
}
|
|
49876
|
-
types.forEach((
|
|
49877
|
-
if (!includesType(it.dataTypes,
|
|
50160
|
+
types.forEach((t2) => {
|
|
50161
|
+
if (!includesType(it.dataTypes, t2)) strictTypesError(it, `type "${t2}" not allowed by context "${it.dataTypes.join(",")}"`);
|
|
49878
50162
|
});
|
|
49879
50163
|
narrowSchemaTypes(it, types);
|
|
49880
50164
|
}
|
|
@@ -49887,20 +50171,20 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
49887
50171
|
const rule = rules[keyword];
|
|
49888
50172
|
if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) {
|
|
49889
50173
|
const { type } = rule.definition;
|
|
49890
|
-
if (type.length && !type.some((
|
|
50174
|
+
if (type.length && !type.some((t2) => hasApplicableType(ts, t2))) strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`);
|
|
49891
50175
|
}
|
|
49892
50176
|
}
|
|
49893
50177
|
}
|
|
49894
50178
|
function hasApplicableType(schTs, kwdT) {
|
|
49895
50179
|
return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer");
|
|
49896
50180
|
}
|
|
49897
|
-
function includesType(ts,
|
|
49898
|
-
return ts.includes(
|
|
50181
|
+
function includesType(ts, t2) {
|
|
50182
|
+
return ts.includes(t2) || t2 === "integer" && ts.includes("number");
|
|
49899
50183
|
}
|
|
49900
50184
|
function narrowSchemaTypes(it, withTypes) {
|
|
49901
50185
|
const ts = [];
|
|
49902
|
-
for (const
|
|
49903
|
-
else if (withTypes.includes("integer") &&
|
|
50186
|
+
for (const t2 of it.dataTypes) if (includesType(withTypes, t2)) ts.push(t2);
|
|
50187
|
+
else if (withTypes.includes("integer") && t2 === "number") ts.push("integer");
|
|
49904
50188
|
it.dataTypes = ts;
|
|
49905
50189
|
}
|
|
49906
50190
|
function strictTypesError(it, msg) {
|
|
@@ -50271,16 +50555,16 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
50271
50555
|
return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);
|
|
50272
50556
|
}
|
|
50273
50557
|
function resolveSchema(root, ref) {
|
|
50274
|
-
const
|
|
50275
|
-
const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver,
|
|
50558
|
+
const p2 = this.opts.uriResolver.parse(ref);
|
|
50559
|
+
const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p2);
|
|
50276
50560
|
let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, void 0);
|
|
50277
|
-
if (Object.keys(root.schema).length > 0 && refPath === baseId) return getJsonPointer.call(this,
|
|
50561
|
+
if (Object.keys(root.schema).length > 0 && refPath === baseId) return getJsonPointer.call(this, p2, root);
|
|
50278
50562
|
const id2 = (0, resolve_1.normalizeId)(refPath);
|
|
50279
50563
|
const schOrRef = this.refs[id2] || this.schemas[id2];
|
|
50280
50564
|
if (typeof schOrRef == "string") {
|
|
50281
50565
|
const sch = resolveSchema.call(this, root, schOrRef);
|
|
50282
50566
|
if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object") return;
|
|
50283
|
-
return getJsonPointer.call(this,
|
|
50567
|
+
return getJsonPointer.call(this, p2, sch);
|
|
50284
50568
|
}
|
|
50285
50569
|
if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object") return;
|
|
50286
50570
|
if (!schOrRef.validate) compileSchema.call(this, schOrRef);
|
|
@@ -50296,7 +50580,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
50296
50580
|
baseId
|
|
50297
50581
|
});
|
|
50298
50582
|
}
|
|
50299
|
-
return getJsonPointer.call(this,
|
|
50583
|
+
return getJsonPointer.call(this, p2, schOrRef);
|
|
50300
50584
|
}
|
|
50301
50585
|
exports.resolveSchema = resolveSchema;
|
|
50302
50586
|
const PREVENT_SCOPE_CHANGE = /* @__PURE__ */ new Set([
|
|
@@ -51138,8 +51422,8 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
51138
51422
|
if (!this.refs[ref]) this.addSchema(_schema, ref, meta3);
|
|
51139
51423
|
}
|
|
51140
51424
|
async function _loadSchema(ref) {
|
|
51141
|
-
const
|
|
51142
|
-
if (
|
|
51425
|
+
const p2 = this._loading[ref];
|
|
51426
|
+
if (p2) return p2;
|
|
51143
51427
|
try {
|
|
51144
51428
|
return await (this._loading[ref] = loadSchema(ref));
|
|
51145
51429
|
} finally {
|
|
@@ -51263,7 +51547,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
51263
51547
|
type: (0, dataType_1.getJSONTypes)(def.type),
|
|
51264
51548
|
schemaType: (0, dataType_1.getJSONTypes)(def.schemaType)
|
|
51265
51549
|
};
|
|
51266
|
-
(0, util_1.eachItem)(keyword, definition.type.length === 0 ? (k) => addRule.call(this, k, definition) : (k) => definition.type.forEach((
|
|
51550
|
+
(0, util_1.eachItem)(keyword, definition.type.length === 0 ? (k) => addRule.call(this, k, definition) : (k) => definition.type.forEach((t2) => addRule.call(this, k, definition, t2)));
|
|
51267
51551
|
return this;
|
|
51268
51552
|
}
|
|
51269
51553
|
getKeyword(keyword) {
|
|
@@ -51433,7 +51717,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
51433
51717
|
const post2 = definition === null || definition === void 0 ? void 0 : definition.post;
|
|
51434
51718
|
if (dataType && post2) throw new Error('keyword with "post" flag cannot have "type"');
|
|
51435
51719
|
const { RULES } = this;
|
|
51436
|
-
let ruleGroup = post2 ? RULES.post : RULES.rules.find(({ type:
|
|
51720
|
+
let ruleGroup = post2 ? RULES.post : RULES.rules.find(({ type: t2 }) => t2 === dataType);
|
|
51437
51721
|
if (!ruleGroup) {
|
|
51438
51722
|
ruleGroup = {
|
|
51439
51723
|
type: dataType,
|
|
@@ -51893,7 +52177,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
51893
52177
|
gen.if((0, codegen_1._)`${i2} > 1`, () => (canOptimize() ? loopN : loopN2)(i2, j));
|
|
51894
52178
|
}
|
|
51895
52179
|
function canOptimize() {
|
|
51896
|
-
return itemTypes.length > 0 && !itemTypes.some((
|
|
52180
|
+
return itemTypes.length > 0 && !itemTypes.some((t2) => t2 === "object" || t2 === "array");
|
|
51897
52181
|
}
|
|
51898
52182
|
function loopN(i2, j) {
|
|
51899
52183
|
const item = gen.name("item");
|
|
@@ -52390,9 +52674,9 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
52390
52674
|
if (props.length > 8) {
|
|
52391
52675
|
const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties");
|
|
52392
52676
|
definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key);
|
|
52393
|
-
} else if (props.length) definedProp = (0, codegen_1.or)(...props.map((
|
|
52677
|
+
} else if (props.length) definedProp = (0, codegen_1.or)(...props.map((p2) => (0, codegen_1._)`${key} === ${p2}`));
|
|
52394
52678
|
else definedProp = codegen_1.nil;
|
|
52395
|
-
if (patProps.length) definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((
|
|
52679
|
+
if (patProps.length) definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p2) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p2)}.test(${key})`));
|
|
52396
52680
|
return (0, codegen_1.not)(definedProp);
|
|
52397
52681
|
}
|
|
52398
52682
|
function deleteAdditional(key) {
|
|
@@ -52456,7 +52740,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
52456
52740
|
const allProps = (0, code_1.allSchemaProperties)(schema);
|
|
52457
52741
|
for (const prop of allProps) it.definedProperties.add(prop);
|
|
52458
52742
|
if (it.opts.unevaluated && allProps.length && it.props !== true) it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);
|
|
52459
|
-
const properties = allProps.filter((
|
|
52743
|
+
const properties = allProps.filter((p2) => !(0, util_1.alwaysValidSchema)(it, schema[p2]));
|
|
52460
52744
|
if (properties.length === 0) return;
|
|
52461
52745
|
const valid = gen.name("valid");
|
|
52462
52746
|
for (const prop of properties) {
|
|
@@ -52498,7 +52782,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
52498
52782
|
const { gen, schema, data, parentSchema, it } = cxt;
|
|
52499
52783
|
const { opts } = it;
|
|
52500
52784
|
const patterns = (0, code_1.allSchemaProperties)(schema);
|
|
52501
|
-
const alwaysValidPatterns = patterns.filter((
|
|
52785
|
+
const alwaysValidPatterns = patterns.filter((p2) => (0, util_1.alwaysValidSchema)(it, schema[p2]));
|
|
52502
52786
|
if (patterns.length === 0 || alwaysValidPatterns.length === patterns.length && (!it.opts.unevaluated || it.props === true)) return;
|
|
52503
52787
|
const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties;
|
|
52504
52788
|
const valid = gen.name("valid");
|
|
@@ -53406,7 +53690,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
53406
53690
|
}
|
|
53407
53691
|
function unevaluatedStatic(evaluatedProps, key) {
|
|
53408
53692
|
const ps = [];
|
|
53409
|
-
for (const
|
|
53693
|
+
for (const p2 in evaluatedProps) if (evaluatedProps[p2] === true) ps.push((0, codegen_1._)`${key} !== ${p2}`);
|
|
53410
53694
|
return (0, codegen_1.and)(...ps);
|
|
53411
53695
|
}
|
|
53412
53696
|
}
|
|
@@ -54593,11 +54877,11 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
54593
54877
|
if (!f) throw new Error(`Unknown format "${name2}"`);
|
|
54594
54878
|
return f;
|
|
54595
54879
|
};
|
|
54596
|
-
function addFormats2(ajv,
|
|
54880
|
+
function addFormats2(ajv, list2, fs2, exportName) {
|
|
54597
54881
|
var _a3;
|
|
54598
54882
|
var _b;
|
|
54599
54883
|
(_a3 = (_b = ajv.opts.code).formats) !== null && _a3 !== void 0 || (_b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`);
|
|
54600
|
-
for (const f of
|
|
54884
|
+
for (const f of list2) ajv.addFormat(f, fs2[f]);
|
|
54601
54885
|
}
|
|
54602
54886
|
module2.exports = exports = formatsPlugin;
|
|
54603
54887
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -55847,7 +56131,7 @@ var init_mcp_DXXb3Vv3 = __esm({
|
|
|
55847
56131
|
return createCompletionResult(await completer(request.params.argument.value, request.params.context));
|
|
55848
56132
|
}
|
|
55849
56133
|
async handleResourceCompletion(request, ref) {
|
|
55850
|
-
const template = Object.values(this._registeredResourceTemplates).find((
|
|
56134
|
+
const template = Object.values(this._registeredResourceTemplates).find((t2) => t2.resourceTemplate.uriTemplate.toString() === ref.uri);
|
|
55851
56135
|
if (!template) {
|
|
55852
56136
|
if (this._registeredResources[ref.uri]) return EMPTY_COMPLETION_RESULT;
|
|
55853
56137
|
throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Resource template ${request.params.ref.uri} not found`);
|
|
@@ -57153,7 +57437,7 @@ function localSymbolHits(shards, keep) {
|
|
|
57153
57437
|
async function symbolsOverview(deps, args2) {
|
|
57154
57438
|
const state = deps.state();
|
|
57155
57439
|
const scope = args2.path;
|
|
57156
|
-
const dirty2 = await parseDirty(deps.index, state, (
|
|
57440
|
+
const dirty2 = await parseDirty(deps.index, state, (p2) => isUnder(p2, scope));
|
|
57157
57441
|
const cloud = await deps.cloud.query("symbols_overview", state.head, args2, SymbolAnswer);
|
|
57158
57442
|
const local2 = localSymbolHits(dirty2.shards, (shard, i2) => shard.symbols[i2]?.parent === void 0);
|
|
57159
57443
|
const base4 = cloud.kind === "ok" ? cloudSymbols(cloud.data.symbols, state).filter((hit) => isUnder(hit.path, scope)) : [];
|
|
@@ -57360,9 +57644,9 @@ async function renameSymbol(deps, args2) {
|
|
|
57360
57644
|
const targets = [{ path: args2.path, range: found.symbol.range }, ...answer.references.map((hit) => ({ path: hit.path, range: hit.range }))];
|
|
57361
57645
|
const byFile = /* @__PURE__ */ new Map();
|
|
57362
57646
|
for (const target2 of targets) {
|
|
57363
|
-
const
|
|
57364
|
-
if (!
|
|
57365
|
-
byFile.set(target2.path,
|
|
57647
|
+
const list2 = byFile.get(target2.path) ?? [];
|
|
57648
|
+
if (!list2.some((r) => r.join(",") === target2.range.join(","))) list2.push(target2.range);
|
|
57649
|
+
byFile.set(target2.path, list2);
|
|
57366
57650
|
}
|
|
57367
57651
|
const plan3 = [];
|
|
57368
57652
|
for (const [path, ranges] of byFile) {
|
|
@@ -58226,7 +58510,7 @@ function readTables(text) {
|
|
|
58226
58510
|
return tables;
|
|
58227
58511
|
}
|
|
58228
58512
|
function findTable(text, path) {
|
|
58229
|
-
return readTables(text).find((table2) => table2.path.length === path.length && table2.path.every((
|
|
58513
|
+
return readTables(text).find((table2) => table2.path.length === path.length && table2.path.every((p2, i2) => p2 === path[i2])) ?? null;
|
|
58230
58514
|
}
|
|
58231
58515
|
function isTrue(body2, key) {
|
|
58232
58516
|
return new RegExp(`^\\s*${key}\\s*=\\s*true\\s*(?:#.*)?$`, "m").test(body2);
|
|
@@ -61506,8 +61790,8 @@ function stop2(deps, reason, detail) {
|
|
|
61506
61790
|
function budgetStop(deps, state) {
|
|
61507
61791
|
const { policy } = state;
|
|
61508
61792
|
if (state.tasksClaimed.length >= policy.maxTasksPerRun) return { reason: "budget_tasks", detail: `${state.tasksClaimed.length} of ${policy.maxTasksPerRun} tasks claimed` };
|
|
61509
|
-
const
|
|
61510
|
-
if (
|
|
61793
|
+
const minutes2 = (deps.now() - Date.parse(state.startedAt)) / 6e4;
|
|
61794
|
+
if (minutes2 >= policy.maxMinutesPerRun) return { reason: "budget_minutes", detail: `${Math.floor(minutes2)} of ${policy.maxMinutesPerRun} minutes used` };
|
|
61511
61795
|
return usageStop(deps, state.executor, policy);
|
|
61512
61796
|
}
|
|
61513
61797
|
function usageStop(deps, executor, policy) {
|
|
@@ -61807,8 +62091,8 @@ async function runStatus(deps, input2) {
|
|
|
61807
62091
|
if (run3 === null) {
|
|
61808
62092
|
say(deps, "No active run in this working copy.");
|
|
61809
62093
|
} else {
|
|
61810
|
-
const
|
|
61811
|
-
say(deps, `Run ${run3.runId} (${run3.executor}): tasks ${run3.tasksClaimed.length}/${run3.policy.maxTasksPerRun}, minutes ${
|
|
62094
|
+
const minutes2 = Math.floor((deps.now() - Date.parse(run3.startedAt)) / 6e4);
|
|
62095
|
+
say(deps, `Run ${run3.runId} (${run3.executor}): tasks ${run3.tasksClaimed.length}/${run3.policy.maxTasksPerRun}, minutes ${minutes2}/${run3.policy.maxMinutesPerRun}`);
|
|
61812
62096
|
const usage = run3.executor === "claude-code" ? currentUsagePercent(readUsage(deps), deps.now()) : null;
|
|
61813
62097
|
if (usage !== null) say(deps, `Usage: ${usage.label} ${Math.round(usage.percent)}% (stop at ${run3.policy.maxUsageWindowPercent}%)`);
|
|
61814
62098
|
const budget = budgetStop(deps, run3);
|
|
@@ -61821,7 +62105,7 @@ async function runStatus(deps, input2) {
|
|
|
61821
62105
|
executor: run3.executor,
|
|
61822
62106
|
tasksClaimed: run3.tasksClaimed.length,
|
|
61823
62107
|
maxTasks: run3.policy.maxTasksPerRun,
|
|
61824
|
-
minutesUsed:
|
|
62108
|
+
minutesUsed: minutes2,
|
|
61825
62109
|
maxMinutes: run3.policy.maxMinutesPerRun,
|
|
61826
62110
|
...usage === null ? {} : { usage: { label: usage.label, percent: Math.round(usage.percent), stopAt: run3.policy.maxUsageWindowPercent } }
|
|
61827
62111
|
};
|
|
@@ -62272,7 +62556,7 @@ var libAddCommand = defineCommand({
|
|
|
62272
62556
|
}
|
|
62273
62557
|
});
|
|
62274
62558
|
const body2 = { library: libraryArg(inv), ecosystem: textFlag(inv, "ecosystem") ?? "npm", version: version2, pages };
|
|
62275
|
-
if (inv.dryRun) return plan(inv, "POST", docsPaths.private(textFlag(inv, "team") ?? ":your-team"), { ...body2, pages: pages.map((
|
|
62559
|
+
if (inv.dryRun) return plan(inv, "POST", docsPaths.private(textFlag(inv, "team") ?? ":your-team"), { ...body2, pages: pages.map((p2) => ({ title: p2.title, text: `(${p2.text.length} characters)` })) }, "pages are scanned for credentials on the server");
|
|
62276
62560
|
const { call: call2 } = await authed(inv);
|
|
62277
62561
|
const tenantId = await tenantOf(call2, inv);
|
|
62278
62562
|
const result = await call2(DocsPrivateResult, "POST", docsPaths.private(tenantId), body2);
|
|
@@ -62554,7 +62838,7 @@ var teamListCommand = defineCommand({
|
|
|
62554
62838
|
needsNetwork: true,
|
|
62555
62839
|
keywords: ["teams", "organisations", "organizations", "workspaces", "my role", "members", "which team"],
|
|
62556
62840
|
result: TeamListResult,
|
|
62557
|
-
text: (d) => [...d.teams.map((
|
|
62841
|
+
text: (d) => [...d.teams.map((t2) => `${t2.current ? "*" : " "} ${t2.tenantId} ${t2.name} (${t2.kind}, ${t2.role})`), `Next: ${d.next}`],
|
|
62558
62842
|
handler: async (inv) => {
|
|
62559
62843
|
const { call: call2 } = await authed2(inv);
|
|
62560
62844
|
const me = await call2(WhoAmI, "GET", apiPaths.whoami);
|
|
@@ -62661,12 +62945,12 @@ var tokenListCommand = defineCommand({
|
|
|
62661
62945
|
needsNetwork: true,
|
|
62662
62946
|
keywords: ["agent tokens", "list tokens", "api keys", "credentials", "who has access"],
|
|
62663
62947
|
result: TokenListResult,
|
|
62664
|
-
text: (d) => d.tokens.map((
|
|
62948
|
+
text: (d) => d.tokens.map((t2) => `${t2.tokenId} ${t2.label} ${t2.scope} expires ${t2.expiresAt}${t2.revokedAt === void 0 ? "" : " REVOKED"}`),
|
|
62665
62949
|
handler: async (inv) => {
|
|
62666
62950
|
const { call: call2 } = await authed2(inv);
|
|
62667
62951
|
const tenantId = await tenantOf2(call2, inv);
|
|
62668
62952
|
const listed = await call2(external_exports.object({ tokens: external_exports.array(AgentToken) }), "GET", `/v1/tenants/${encodeURIComponent(tenantId)}/tokens`);
|
|
62669
|
-
return { data: { tenantId, tokens: listed.tokens.map((
|
|
62953
|
+
return { data: { tenantId, tokens: listed.tokens.map((t2) => ({ ...shape(t2), createdBy: t2.createdBy })) } };
|
|
62670
62954
|
}
|
|
62671
62955
|
});
|
|
62672
62956
|
var tokenRevokeCommand = defineCommand({
|
|
@@ -63112,7 +63396,7 @@ var repoDeleteCommand = defineCommand({
|
|
|
63112
63396
|
text: (d) => "deleted" in d ? [`Deleted ${d.repoId}.`] : [],
|
|
63113
63397
|
handler: async (inv) => {
|
|
63114
63398
|
const repo = arg(inv, 0, "a repository", "overlane repo list");
|
|
63115
|
-
if (inv.dryRun) return planned2(inv, "repo", "DELETE", (
|
|
63399
|
+
if (inv.dryRun) return planned2(inv, "repo", "DELETE", (t2, p2) => gitPaths.repo(t2, p2, repo));
|
|
63116
63400
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63117
63401
|
return { data: await call2(DeleteRepoResponse, "DELETE", gitPaths.repo(tenantId, projectId, repo), void 0, approvalHeaders(inv)) };
|
|
63118
63402
|
},
|
|
@@ -63150,7 +63434,7 @@ var repoBranchCreateCommand = defineCommand({
|
|
|
63150
63434
|
const repo = arg(inv, 0, "a repository", "overlane repo list");
|
|
63151
63435
|
const from = textFlag(inv, "from");
|
|
63152
63436
|
const body2 = { name: arg(inv, 1, "a branch name", "overlane repo branch create app feature/x"), ...from === void 0 ? {} : { from } };
|
|
63153
|
-
if (inv.dryRun) return planned2(inv, "repo", "POST", (
|
|
63437
|
+
if (inv.dryRun) return planned2(inv, "repo", "POST", (t2, p2) => gitPaths.branches(t2, p2, repo), body2);
|
|
63154
63438
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63155
63439
|
return { data: await call2(external_exports.object({ name: external_exports.string(), sha: external_exports.string() }).strict(), "POST", gitPaths.branches(tenantId, projectId, repo), body2) };
|
|
63156
63440
|
}
|
|
@@ -63169,7 +63453,7 @@ var repoBranchDeleteCommand = defineCommand({
|
|
|
63169
63453
|
handler: async (inv) => {
|
|
63170
63454
|
const repo = arg(inv, 0, "a repository", "overlane repo list");
|
|
63171
63455
|
const name2 = arg(inv, 1, "a branch name", "overlane repo branches app");
|
|
63172
|
-
if (inv.dryRun) return planned2(inv, "repo", "DELETE", (
|
|
63456
|
+
if (inv.dryRun) return planned2(inv, "repo", "DELETE", (t2, p2) => gitPaths.branch(t2, p2, repo, name2));
|
|
63173
63457
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63174
63458
|
return { data: await call2(external_exports.object({ name: external_exports.string() }).strict(), "DELETE", gitPaths.branch(tenantId, projectId, repo, name2), void 0, approvalHeaders(inv)) };
|
|
63175
63459
|
},
|
|
@@ -63226,7 +63510,7 @@ var repoPushCommand = defineCommand({
|
|
|
63226
63510
|
const body2 = (expectedOld) => ({ requestId: requestId4(), ref: branch, expectedOld, force: boolFlag(inv, "rewrite"), ...parent === void 0 ? {} : { parent }, commits: [{ message, files }] });
|
|
63227
63511
|
if (inv.dryRun) {
|
|
63228
63512
|
const shown2 = { ...body2(textFlag(inv, "expect") ?? null), commits: [{ message, files: files.map((file2) => ({ path: file2.path, content: file2.content === null ? null : `<${file2.content.length} characters>` })) }] };
|
|
63229
|
-
return planned2(inv, "repo", "POST", (
|
|
63513
|
+
return planned2(inv, "repo", "POST", (t2, p2) => gitPaths.push(t2, p2, repo), shown2, "one commit; the server checks protection and guardrail rules first");
|
|
63230
63514
|
}
|
|
63231
63515
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63232
63516
|
let expected = textFlag(inv, "expect") ?? null;
|
|
@@ -63262,7 +63546,7 @@ var repoProtectCommand = defineCommand({
|
|
|
63262
63546
|
const methods = listFlag(inv, "merge-method");
|
|
63263
63547
|
const body2 = { pattern, ...approvals === void 0 ? {} : { requiredApprovals: Number(approvals) }, requiredChecks: listFlag(inv, "check"), ...methods.length === 0 ? {} : { allowedMergeMethods: methods } };
|
|
63264
63548
|
if (approvals !== void 0 && (!/^\d+$/.test(approvals) || Number(approvals) > 10)) throw new UsageError("--approvals must be a number from 0 to 10");
|
|
63265
|
-
if (inv.dryRun) return planned2(inv, "repo", "PUT", (
|
|
63549
|
+
if (inv.dryRun) return planned2(inv, "repo", "PUT", (t2, p2) => gitPaths.protection(t2, p2, repo), body2);
|
|
63266
63550
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63267
63551
|
return { data: await call2(BranchProtection, "PUT", gitPaths.protection(tenantId, projectId, repo), body2) };
|
|
63268
63552
|
}
|
|
@@ -63303,14 +63587,14 @@ var repoTokenCommand = defineCommand({
|
|
|
63303
63587
|
const repo = arg(inv, 0, "a repository", "overlane repo list");
|
|
63304
63588
|
const ttl = positive(textFlag(inv, "ttl"), "ttl");
|
|
63305
63589
|
const body2 = { scope: textFlag(inv, "scope") ?? "write", ...ttl === void 0 ? {} : { ttlSeconds: ttl } };
|
|
63306
|
-
if (inv.dryRun) return planned2(inv, "repo", "POST", (
|
|
63590
|
+
if (inv.dryRun) return planned2(inv, "repo", "POST", (t2, p2) => gitPaths.tokens(t2, p2, repo), body2);
|
|
63307
63591
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63308
63592
|
return { data: await call2(GitTokenGrant, "POST", gitPaths.tokens(tenantId, projectId, repo), body2) };
|
|
63309
63593
|
}
|
|
63310
63594
|
});
|
|
63311
63595
|
var repoTokenRevokeCommand = defineCommand({
|
|
63312
63596
|
path: ["repo", "token", "revoke"],
|
|
63313
|
-
summary: "
|
|
63597
|
+
summary: "Stop a repository git push credential from working",
|
|
63314
63598
|
description: "Revokes a token at once; any clone or push using it is refused from the next call.",
|
|
63315
63599
|
args: [REPO_ARG_LATE, { name: "token-id", required: false, description: "The token ID shown when it was minted (required)" }],
|
|
63316
63600
|
examples: ["overlane repo token revoke app gtk_abc123 --force"],
|
|
@@ -63322,7 +63606,7 @@ var repoTokenRevokeCommand = defineCommand({
|
|
|
63322
63606
|
handler: async (inv) => {
|
|
63323
63607
|
const repo = arg(inv, 0, "a repository", "overlane repo list");
|
|
63324
63608
|
const id2 = arg(inv, 1, "a token ID", "overlane repo token app");
|
|
63325
|
-
if (inv.dryRun) return planned2(inv, "repo", "DELETE", (
|
|
63609
|
+
if (inv.dryRun) return planned2(inv, "repo", "DELETE", (t2, p2) => gitPaths.token(t2, p2, repo, id2));
|
|
63326
63610
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63327
63611
|
return { data: await call2(external_exports.object({ tokenId: external_exports.string(), revoked: external_exports.literal(true) }).strict(), "DELETE", gitPaths.token(tenantId, projectId, repo, id2)) };
|
|
63328
63612
|
}
|
|
@@ -63343,7 +63627,7 @@ var repoMirrorSetCommand = defineCommand({
|
|
|
63343
63627
|
const repo = arg(inv, 0, "a repository", "overlane repo list");
|
|
63344
63628
|
const writable = textFlag(inv, "writable");
|
|
63345
63629
|
if (writable === void 0) throw new UsageError("--writable is required", { hint: "overlane repo mirror set app --writable overlane" });
|
|
63346
|
-
const path = (
|
|
63630
|
+
const path = (t2, p2) => `${gitPaths.repo(t2, p2, repo)}/mirror`;
|
|
63347
63631
|
if (inv.dryRun) return planned2(inv, "repo", "PUT", path, { writable });
|
|
63348
63632
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63349
63633
|
return { data: await call2(Repo, "PUT", path(tenantId, projectId), { writable }) };
|
|
@@ -63362,7 +63646,7 @@ var repoSyncCommand = defineCommand({
|
|
|
63362
63646
|
text: (d) => "applied" in d ? [`${d.applied} ref(s) updated${d.staleShas.length === 0 ? "" : `; ${d.staleShas.length} commit(s) are stale after a rewritten history`}.`] : [],
|
|
63363
63647
|
handler: async (inv) => {
|
|
63364
63648
|
const repo = arg(inv, 0, "a repository", "overlane repo list");
|
|
63365
|
-
const path = (
|
|
63649
|
+
const path = (t2, p2) => gitPaths.sync(t2, p2, repo);
|
|
63366
63650
|
if (inv.dryRun) return planned2(inv, "repo", "POST", path);
|
|
63367
63651
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63368
63652
|
return { data: await call2(MirrorSyncResponse, "POST", path(tenantId, projectId)) };
|
|
@@ -63398,7 +63682,7 @@ var repoIndexRunCommand = defineCommand({
|
|
|
63398
63682
|
text: (d) => "applied" in d ? [`${d.applied} job(s) applied, ${d.ignored} ignored as stale.`] : [],
|
|
63399
63683
|
handler: async (inv) => {
|
|
63400
63684
|
const repo = arg(inv, 0, "a repository", "overlane repo list");
|
|
63401
|
-
const path = (
|
|
63685
|
+
const path = (t2, p2) => gitPaths.index(t2, p2, repo);
|
|
63402
63686
|
if (inv.dryRun) return planned2(inv, "repo", "POST", path);
|
|
63403
63687
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63404
63688
|
return { data: await call2(external_exports.object({ tenantId: external_exports.string(), applied: external_exports.number(), ignored: external_exports.number() }).strict(), "POST", path(tenantId, projectId)) };
|
|
@@ -63464,7 +63748,7 @@ var prOpenCommand = defineCommand({
|
|
|
63464
63748
|
const base4 = textFlag(inv, "base");
|
|
63465
63749
|
const text = textFlag(inv, "body");
|
|
63466
63750
|
const body2 = { requestId: requestId4(), title, head, ...base4 === void 0 ? {} : { base: base4 }, ...text === void 0 ? {} : { body: text }, draft: boolFlag(inv, "draft") };
|
|
63467
|
-
if (inv.dryRun) return planned2(inv, "repo", "POST", (
|
|
63751
|
+
if (inv.dryRun) return planned2(inv, "repo", "POST", (t2, p2) => gitPaths.pulls(t2, p2, repo), body2);
|
|
63468
63752
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63469
63753
|
return { data: await call2(PullRequest, "POST", gitPaths.pulls(tenantId, projectId, repo), body2) };
|
|
63470
63754
|
}
|
|
@@ -63490,7 +63774,7 @@ var prReviewCommand = defineCommand({
|
|
|
63490
63774
|
const state = textFlag(inv, "state");
|
|
63491
63775
|
if (state === void 0) throw new UsageError("--state is required", { hint: "overlane repo pr review app 7 --state approved" });
|
|
63492
63776
|
const body2 = { requestId: requestId4(), state, body: textFlag(inv, "body") ?? "" };
|
|
63493
|
-
if (inv.dryRun) return planned2(inv, "repo", "POST", (
|
|
63777
|
+
if (inv.dryRun) return planned2(inv, "repo", "POST", (t2, p2) => gitPaths.reviews(t2, p2, repo, number4), body2);
|
|
63494
63778
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63495
63779
|
return { data: await call2(PullReview, "POST", gitPaths.reviews(tenantId, projectId, repo, number4), body2) };
|
|
63496
63780
|
}
|
|
@@ -63511,7 +63795,7 @@ var prMergeCommand = defineCommand({
|
|
|
63511
63795
|
const repo = arg(inv, 0, "a repository", "overlane repo list");
|
|
63512
63796
|
const number4 = pullNumber(inv, 1, "overlane repo pr list app");
|
|
63513
63797
|
const body2 = { requestId: requestId4(), method: textFlag(inv, "method") ?? "squash" };
|
|
63514
|
-
if (inv.dryRun) return planned2(inv, "repo", "POST", (
|
|
63798
|
+
if (inv.dryRun) return planned2(inv, "repo", "POST", (t2, p2) => gitPaths.merge(t2, p2, repo, number4), body2);
|
|
63515
63799
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63516
63800
|
return { data: await call2(MergeResult, "POST", gitPaths.merge(tenantId, projectId, repo, number4), body2, approvalHeaders(inv)) };
|
|
63517
63801
|
}
|
|
@@ -63530,7 +63814,7 @@ var prCloseCommand = defineCommand({
|
|
|
63530
63814
|
handler: async (inv) => {
|
|
63531
63815
|
const repo = arg(inv, 0, "a repository", "overlane repo list");
|
|
63532
63816
|
const number4 = pullNumber(inv, 1, "overlane repo pr list app");
|
|
63533
|
-
const path = (
|
|
63817
|
+
const path = (t2, p2) => `${gitPaths.pull(t2, p2, repo, number4)}/close`;
|
|
63534
63818
|
if (inv.dryRun) return planned2(inv, "repo", "POST", path);
|
|
63535
63819
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63536
63820
|
return { data: await call2(PullRequest, "POST", path(tenantId, projectId), {}) };
|
|
@@ -63700,7 +63984,7 @@ var ciCancelCommand = defineCommand({
|
|
|
63700
63984
|
text: (d) => "runId" in d ? [runLine(d)] : [],
|
|
63701
63985
|
handler: async (inv) => {
|
|
63702
63986
|
const run3 = arg2(inv, 0, "a run ID", "overlane ci list");
|
|
63703
|
-
if (inv.dryRun) return planned2(inv, "ci", "POST", (
|
|
63987
|
+
if (inv.dryRun) return planned2(inv, "ci", "POST", (t2, p2) => ciPaths.cancel(t2, p2, run3), {});
|
|
63704
63988
|
const { call: call2, tenantId, projectId } = await connected2(inv, "ci");
|
|
63705
63989
|
return { data: await call2(PipelineRun, "POST", ciPaths.cancel(tenantId, projectId, run3), {}) };
|
|
63706
63990
|
}
|
|
@@ -63719,7 +64003,7 @@ var ciRerunCommand = defineCommand({
|
|
|
63719
64003
|
handler: async (inv) => {
|
|
63720
64004
|
const run3 = arg2(inv, 0, "a run ID", "overlane ci list");
|
|
63721
64005
|
const body2 = { requestId: requestId4() };
|
|
63722
|
-
if (inv.dryRun) return planned2(inv, "ci", "POST", (
|
|
64006
|
+
if (inv.dryRun) return planned2(inv, "ci", "POST", (t2, p2) => ciPaths.rerun(t2, p2, run3), body2);
|
|
63723
64007
|
const { call: call2, tenantId, projectId } = await connected2(inv, "ci");
|
|
63724
64008
|
const result = await call2(RunResponse, "POST", ciPaths.rerun(tenantId, projectId, run3), body2);
|
|
63725
64009
|
const exit = runExit(result.run);
|
|
@@ -63793,7 +64077,7 @@ var ciSecretDeleteCommand = defineCommand({
|
|
|
63793
64077
|
text: (d) => "deleted" in d ? [`Deleted ${d.name}.`] : [],
|
|
63794
64078
|
handler: async (inv) => {
|
|
63795
64079
|
const name2 = arg2(inv, 0, "a secret name", "overlane ci secrets");
|
|
63796
|
-
if (inv.dryRun) return planned2(inv, "ci", "DELETE", (
|
|
64080
|
+
if (inv.dryRun) return planned2(inv, "ci", "DELETE", (t2, p2) => ciPaths.secret(t2, p2, name2));
|
|
63797
64081
|
const { call: call2, tenantId, projectId } = await connected2(inv, "ci");
|
|
63798
64082
|
return { data: await call2(external_exports.object({ tenantId: external_exports.string(), name: external_exports.string(), deleted: external_exports.literal(true) }).strict(), "DELETE", ciPaths.secret(tenantId, projectId, name2)) };
|
|
63799
64083
|
}
|
|
@@ -63829,10 +64113,10 @@ var ciSettingsSetCommand = defineCommand({
|
|
|
63829
64113
|
result: withDryRun(CiSettings),
|
|
63830
64114
|
text: (d) => "maxMinutesPerPull" in d ? [`cost gate ${d.maxMinutesPerPull} minutes per pull request, ${d.maxConcurrentRuns} concurrent, superseded runs ${d.cancelSuperseded ? "cancelled" : "kept"}`] : [],
|
|
63831
64115
|
handler: async (inv) => {
|
|
63832
|
-
const
|
|
64116
|
+
const minutes2 = positive(textFlag(inv, "max-minutes-per-pull"), "max-minutes-per-pull");
|
|
63833
64117
|
const concurrent = positive(textFlag(inv, "max-concurrent"), "max-concurrent");
|
|
63834
64118
|
const cancel = textFlag(inv, "cancel-superseded");
|
|
63835
|
-
const body2 = { ...
|
|
64119
|
+
const body2 = { ...minutes2 === void 0 ? {} : { maxMinutesPerPull: minutes2 }, ...concurrent === void 0 ? {} : { maxConcurrentRuns: concurrent }, ...cancel === void 0 ? {} : { cancelSuperseded: cancel === "true" } };
|
|
63836
64120
|
if (Object.keys(body2).length === 0) throw new UsageError("nothing to change", { hint: "overlane ci settings set --max-minutes-per-pull 120" });
|
|
63837
64121
|
if (inv.dryRun) return planned2(inv, "ci", "PUT", ciPaths.settings, body2);
|
|
63838
64122
|
const { call: call2, tenantId, projectId } = await connected2(inv, "ci");
|
|
@@ -64088,7 +64372,7 @@ var deployRollbackCommand = defineCommand({
|
|
|
64088
64372
|
if (reason === void 0) throw new UsageError("--reason is required", { hint: 'overlane deploy rollback production --reason "why"' });
|
|
64089
64373
|
const to = textFlag(inv, "to");
|
|
64090
64374
|
const body2 = { requestId: requestId4(), reason, ...to === void 0 ? {} : { toReleaseId: to } };
|
|
64091
|
-
if (inv.dryRun) return planned2(inv, "deploy", "POST", (
|
|
64375
|
+
if (inv.dryRun) return planned2(inv, "deploy", "POST", (t2, p2) => deployPaths.rollback(t2, p2, env), body2);
|
|
64092
64376
|
const { call: call2, tenantId, projectId } = await connected2(inv, "deploy");
|
|
64093
64377
|
return { data: await call2(RollbackResponse, "POST", deployPaths.rollback(tenantId, projectId, env), body2) };
|
|
64094
64378
|
}
|
|
@@ -64787,7 +65071,7 @@ var issueUpdateCommand = defineCommand({
|
|
|
64787
65071
|
...estimate === void 0 ? {} : { estimate: Number(estimate) }
|
|
64788
65072
|
};
|
|
64789
65073
|
if (Object.keys(body2).length === 1) throw new UsageError("update needs at least one of --title, --description, --status, --priority, --estimate");
|
|
64790
|
-
return send(inv.deps, "issue", Issue, "PATCH", (
|
|
65074
|
+
return send(inv.deps, "issue", Issue, "PATCH", (t2, p2) => issuePaths.issue(t2, p2, id2), body2, inv.dryRun);
|
|
64791
65075
|
}
|
|
64792
65076
|
});
|
|
64793
65077
|
var issueAssignCommand = defineCommand({
|
|
@@ -64807,7 +65091,7 @@ var issueAssignCommand = defineCommand({
|
|
|
64807
65091
|
const id2 = inv.positionals[0];
|
|
64808
65092
|
if (id2 === void 0) throw new UsageError("assign needs an ISSUE_ID and an assignee");
|
|
64809
65093
|
const assignee = parseAssignee(inv.positionals[1]);
|
|
64810
|
-
const result = await send(inv.deps, "issue", AssignResult, "POST", (
|
|
65094
|
+
const result = await send(inv.deps, "issue", AssignResult, "POST", (t2, p2) => issuePaths.assign(t2, p2, id2), { requestId: requestId7(), assignee }, inv.dryRun);
|
|
64811
65095
|
if (result.value !== void 0) say(inv.deps, result.value.taskId === null ? "Assigned." : `Assigned. Task: ${result.value.taskId}${result.value.createdTask ? " (new)" : ""}`);
|
|
64812
65096
|
return result;
|
|
64813
65097
|
}
|
|
@@ -64967,7 +65251,7 @@ var viewDeleteCommand = defineCommand({
|
|
|
64967
65251
|
handler: async (inv) => {
|
|
64968
65252
|
const id2 = inv.positionals[0];
|
|
64969
65253
|
if (id2 === void 0) throw new UsageError("delete needs a VIEW_ID");
|
|
64970
|
-
return send(inv.deps, "view", Deleted, "DELETE", (
|
|
65254
|
+
return send(inv.deps, "view", Deleted, "DELETE", (t2, p2) => `${issuePaths.views(t2, p2)}/${encodeURIComponent(id2)}`, void 0, inv.dryRun);
|
|
64971
65255
|
}
|
|
64972
65256
|
});
|
|
64973
65257
|
var loopListCommand = defineCommand({
|
|
@@ -65027,7 +65311,7 @@ var loopSetCommand = defineCommand({
|
|
|
65027
65311
|
handler: async (inv) => {
|
|
65028
65312
|
const [id2, state] = inv.positionals;
|
|
65029
65313
|
if (id2 === void 0 || state !== "on" && state !== "off") throw new UsageError("set needs a LOOP_ID and on or off");
|
|
65030
|
-
return send(inv.deps, "loop", LoopDefinition, "PATCH", (
|
|
65314
|
+
return send(inv.deps, "loop", LoopDefinition, "PATCH", (t2, p2) => issuePaths.loop(t2, p2, id2), { requestId: requestId7(), enabled: state === "on" }, inv.dryRun);
|
|
65031
65315
|
}
|
|
65032
65316
|
});
|
|
65033
65317
|
var loopFireCommand = defineCommand({
|
|
@@ -65043,7 +65327,7 @@ var loopFireCommand = defineCommand({
|
|
|
65043
65327
|
handler: async (inv) => {
|
|
65044
65328
|
const id2 = inv.positionals[0];
|
|
65045
65329
|
if (id2 === void 0) throw new UsageError("fire needs a LOOP_ID");
|
|
65046
|
-
const result = await send(inv.deps, "loop", LoopRun, "POST", (
|
|
65330
|
+
const result = await send(inv.deps, "loop", LoopRun, "POST", (t2, p2) => issuePaths.loopFire(t2, p2, id2), { requestId: requestId7(), trigger: "schedule" }, inv.dryRun);
|
|
65047
65331
|
if (result.value !== void 0) say(inv.deps, `Loop run ${result.value.runId ?? "(none)"}: ${result.value.claimed.length} claimed, stopped: ${result.value.stopReason}.`);
|
|
65048
65332
|
return result;
|
|
65049
65333
|
}
|
|
@@ -65061,7 +65345,7 @@ var loopDeleteCommand = defineCommand({
|
|
|
65061
65345
|
handler: async (inv) => {
|
|
65062
65346
|
const id2 = inv.positionals[0];
|
|
65063
65347
|
if (id2 === void 0) throw new UsageError("delete needs a LOOP_ID");
|
|
65064
|
-
return send(inv.deps, "loop", Deleted, "DELETE", (
|
|
65348
|
+
return send(inv.deps, "loop", Deleted, "DELETE", (t2, p2) => issuePaths.loop(t2, p2, id2), void 0, inv.dryRun);
|
|
65065
65349
|
}
|
|
65066
65350
|
});
|
|
65067
65351
|
var viewCommands = [viewListCommand, viewRunCommand, viewNewCommand, viewDeleteCommand];
|
|
@@ -65852,7 +66136,7 @@ function rulesStatus(root) {
|
|
|
65852
66136
|
const read = readRules(root);
|
|
65853
66137
|
const report2 = checkRules(read.source, { files: read.files });
|
|
65854
66138
|
if (read.unsafe.length > 0 && report2.configured) {
|
|
65855
|
-
const targets = report2.targets.map((
|
|
66139
|
+
const targets = report2.targets.map((t2) => read.unsafe.includes(t2.path) ? { ...t2, state: "damaged", detail: `${t2.path} is a symbolic link or not a regular file; replace it with a regular file`, syncable: false } : t2);
|
|
65856
66140
|
return { report: { ...report2, drifted: true, targets }, unsafe: read.unsafe };
|
|
65857
66141
|
}
|
|
65858
66142
|
return { report: report2, unsafe: read.unsafe };
|
|
@@ -65931,7 +66215,7 @@ async function doctor(deps, options) {
|
|
|
65931
66215
|
for (const line3 of renderReports(reports)) say(deps, line3);
|
|
65932
66216
|
const rules = rulesStatus(root).report;
|
|
65933
66217
|
if (rules.configured) {
|
|
65934
|
-
say(deps, rules.sourceProblem !== null ? `Rules: source problem - ${rules.sourceProblem}` : rules.drifted ? `Rules: drifted - ${rules.targets.filter((
|
|
66218
|
+
say(deps, rules.sourceProblem !== null ? `Rules: source problem - ${rules.sourceProblem}` : rules.drifted ? `Rules: drifted - ${rules.targets.filter((t2) => t2.state !== "in_sync").map((t2) => `${t2.path} (${t2.state})`).join(", ")}; next: ${rules.nextCommand ?? "overlane rules check"}` : `Rules: in sync at revision ${rules.revision}`);
|
|
65935
66219
|
}
|
|
65936
66220
|
const installedStates = reports.filter((report2, index) => infos[index]?.installed === true).map((report2) => report2.state);
|
|
65937
66221
|
const agentsReady = installedStates.length > 0 && installedStates.every((state) => state === "ready");
|
|
@@ -65951,12 +66235,12 @@ async function doctor(deps, options) {
|
|
|
65951
66235
|
action: report2.action,
|
|
65952
66236
|
completionGate: completionGate(report2.agent)
|
|
65953
66237
|
})),
|
|
65954
|
-
...rules.configured ? { rules: { drifted: rules.drifted, revision: rules.revision, targets: rules.targets.map((
|
|
66238
|
+
...rules.configured ? { rules: { drifted: rules.drifted, revision: rules.revision, targets: rules.targets.map((t2) => ({ path: t2.path, state: t2.state })), nextCommand: rules.nextCommand } } : {},
|
|
65955
66239
|
ready
|
|
65956
66240
|
};
|
|
65957
66241
|
if (ready) return { data };
|
|
65958
66242
|
if (agentsReady && rulesDrifted) {
|
|
65959
|
-
return { data, error: new CliError(`not ready: the rules files have drifted from the source - ${rules.sourceProblem ?? rules.targets.find((
|
|
66243
|
+
return { data, error: new CliError(`not ready: the rules files have drifted from the source - ${rules.sourceProblem ?? rules.targets.find((t2) => t2.state !== "in_sync")?.detail ?? ""}`, { code: "rules_drift", exit: EXIT.conflict, hint: rules.nextCommand ?? "overlane rules check", quiet: true }) };
|
|
65960
66244
|
}
|
|
65961
66245
|
const pending = reports.find((report2) => report2.action !== null);
|
|
65962
66246
|
return {
|
|
@@ -66189,11 +66473,11 @@ async function connectKit(deps, options) {
|
|
|
66189
66473
|
const agentConfig = [join23(".claude", "settings.json"), join23(".codex", "config.toml")];
|
|
66190
66474
|
const preDirty = new Set(await dirty(deps, root, agentConfig));
|
|
66191
66475
|
const preExisting = new Set(agentConfig.filter((file2) => existsSync7(join23(root, file2))));
|
|
66192
|
-
const
|
|
66193
|
-
if (
|
|
66476
|
+
const connected10 = await connect(deps, { ...options, yes: true });
|
|
66477
|
+
if (connected10.error !== void 0 || readBindingFile(root).kind !== "ok") {
|
|
66194
66478
|
throw new CliError(`connect did not finish; the kit files are on ${KIT_BRANCH}, uncommitted. Fix the cause and run \`overlane connect\`, then commit`, { code: "connect_incomplete", hint: "overlane connect --yes" });
|
|
66195
66479
|
}
|
|
66196
|
-
const connectData =
|
|
66480
|
+
const connectData = connected10.data !== void 0 && !("dryRun" in connected10.data) ? connected10.data : void 0;
|
|
66197
66481
|
for (const file2 of agentConfig) {
|
|
66198
66482
|
if (!existsSync7(join23(root, file2)) || preDirty.has(file2) || preExisting.has(file2) && (await dirty(deps, root, [file2])).length === 0) continue;
|
|
66199
66483
|
if ((await gitOut(deps, root, "check-ignore", "-q", "--", file2)).code === 0) continue;
|
|
@@ -67489,7 +67773,7 @@ var SCOPE_FLAGS = [
|
|
|
67489
67773
|
{ name: "paths", type: "string", value: "A,B", description: "For a module the code map does not know: the paths it covers (comma separated)" }
|
|
67490
67774
|
];
|
|
67491
67775
|
function scopesOf(inv) {
|
|
67492
|
-
const paths = (textFlag(inv, "paths") ?? "").split(",").map((
|
|
67776
|
+
const paths = (textFlag(inv, "paths") ?? "").split(",").map((p2) => p2.trim()).filter((p2) => p2 !== "");
|
|
67493
67777
|
const scopes = [
|
|
67494
67778
|
...listFlag(inv, "path").map((value) => ({ kind: "path", value })),
|
|
67495
67779
|
...listFlag(inv, "glob").map((value) => ({ kind: "glob", value })),
|
|
@@ -67585,7 +67869,7 @@ var claimRenewCommand = defineCommand({
|
|
|
67585
67869
|
const lease = leaseFlag(inv);
|
|
67586
67870
|
const here = await whereAmI(inv.deps);
|
|
67587
67871
|
const body2 = { ...lease === void 0 ? {} : { leaseSeconds: lease }, ...here };
|
|
67588
|
-
if (inv.dryRun) return planned5(inv, "POST", (
|
|
67872
|
+
if (inv.dryRun) return planned5(inv, "POST", (t2, p2) => claimPaths.renew(t2, p2, id2), body2);
|
|
67589
67873
|
const { call: call2, tenantId, projectId } = await connected5(inv);
|
|
67590
67874
|
return { data: await call2(Claim, "POST", claimPaths.renew(tenantId, projectId, id2), body2) };
|
|
67591
67875
|
}
|
|
@@ -67608,7 +67892,7 @@ var claimReleaseCommand = defineCommand({
|
|
|
67608
67892
|
const id2 = textFlag(inv, "claim");
|
|
67609
67893
|
if (id2 === void 0) throw new UsageError("claim release needs --claim", { hint: "overlane claim list" });
|
|
67610
67894
|
const body2 = { reason: inv.values["done"] === true ? "done" : "released" };
|
|
67611
|
-
if (inv.dryRun) return planned5(inv, "POST", (
|
|
67895
|
+
if (inv.dryRun) return planned5(inv, "POST", (t2, p2) => claimPaths.release(t2, p2, id2), body2);
|
|
67612
67896
|
const { call: call2, tenantId, projectId } = await connected5(inv);
|
|
67613
67897
|
return { data: await call2(Claim, "POST", claimPaths.release(tenantId, projectId, id2), body2) };
|
|
67614
67898
|
}
|
|
@@ -67856,7 +68140,7 @@ var rulesSyncCommand = defineCommand({
|
|
|
67856
68140
|
const root = project.root;
|
|
67857
68141
|
const force = boolFlag(inv, "overwrite-edits");
|
|
67858
68142
|
const { read, plan: plan3 } = planFromDisk(root, force);
|
|
67859
|
-
if (!plan3.ok && inv.dryRun) return planOutcome(inv.deps, dryRunPlan({ writes: RULES_TARGETS.map((
|
|
68143
|
+
if (!plan3.ok && inv.dryRun) return planOutcome(inv.deps, dryRunPlan({ writes: RULES_TARGETS.map((t2) => ({ path: t2.path, action: "write", description: `would be written from ${RULES_SOURCE_PATH}` })), notes: [`Would stop: ${plan3.problem}`] }));
|
|
67860
68144
|
if (!plan3.ok) throw new CliError(plan3.problem, { code: "rules_source_invalid", exit: EXIT.conflict, hint: `create ${RULES_SOURCE_PATH} with the rules every agent should follow, then run overlane rules sync` });
|
|
67861
68145
|
if (inv.dryRun) {
|
|
67862
68146
|
return planOutcome(
|
|
@@ -67892,12 +68176,12 @@ var rulesCheckCommand = defineCommand({
|
|
|
67892
68176
|
...common17,
|
|
67893
68177
|
keywords: ["rules drift", "instructions out of date", "hand edit AGENTS.md", "ci check rules", "doctor rules"],
|
|
67894
68178
|
result: RulesCheckReport,
|
|
67895
|
-
text: (d) => !d.configured ? [`No rules source: ${d.nextCommand ?? ""}`] : d.sourceProblem !== null ? [`Rules source problem: ${d.sourceProblem}`] : [`Rules revision ${d.revision}`, ...d.targets.map((
|
|
68179
|
+
text: (d) => !d.configured ? [`No rules source: ${d.nextCommand ?? ""}`] : d.sourceProblem !== null ? [`Rules source problem: ${d.sourceProblem}`] : [`Rules revision ${d.revision}`, ...d.targets.map((t2) => `${t2.state.toUpperCase().padEnd(10)} ${t2.path} ${t2.detail}`), ...d.nextCommand === null ? ["All in sync."] : [`next: ${d.nextCommand}`]],
|
|
67896
68180
|
handler: async (inv) => {
|
|
67897
68181
|
const project = await detectProject(inv.deps);
|
|
67898
68182
|
const { report: report2 } = rulesStatus(project.root);
|
|
67899
68183
|
if (!report2.drifted) return { data: report2 };
|
|
67900
|
-
const first = report2.targets.find((
|
|
68184
|
+
const first = report2.targets.find((t2) => t2.state !== "in_sync");
|
|
67901
68185
|
return { data: report2, exit: EXIT.blocked, error: new CliError(report2.sourceProblem ?? first?.detail ?? "the rules files have drifted from the source", { code: "rules_drift", exit: EXIT.blocked, ...report2.nextCommand === null ? {} : { hint: report2.nextCommand }, quiet: true }) };
|
|
67902
68186
|
}
|
|
67903
68187
|
});
|
|
@@ -68117,8 +68401,8 @@ async function planned8(inv, method, path, body2, note) {
|
|
|
68117
68401
|
}
|
|
68118
68402
|
function ruleOf(text) {
|
|
68119
68403
|
const [host, ports] = text.split(":");
|
|
68120
|
-
const parsedPorts = ports === void 0 ? [443] : ports.split(",").map((
|
|
68121
|
-
if (parsedPorts.some((
|
|
68404
|
+
const parsedPorts = ports === void 0 ? [443] : ports.split(",").map((p2) => /^\d{1,5}$/.test(p2) ? Number(p2) : Number.NaN);
|
|
68405
|
+
if (parsedPorts.some((p2) => !Number.isInteger(p2) || p2 < 1 || p2 > 65535)) throw new UsageError(`${text}: ports are whole numbers from 1 to 65535, for example registry.npmjs.org:443,8443`);
|
|
68122
68406
|
const checked2 = normaliseHost(host.replace(/^\*\./, "x."));
|
|
68123
68407
|
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" });
|
|
68124
68408
|
return { host: host.toLowerCase(), ports: parsedPorts };
|
|
@@ -68248,8 +68532,8 @@ var egressGrantCommand = defineCommand({
|
|
|
68248
68532
|
const scope = textFlag(inv, "scope") ?? "task";
|
|
68249
68533
|
const task = textFlag(inv, "task");
|
|
68250
68534
|
if (scope === "task" && task === void 0) throw new UsageError("a task grant names its task", { hint: "overlane egress grant --task TASK --host api.github.com --secret GITHUB_TOKEN" });
|
|
68251
|
-
const
|
|
68252
|
-
if (
|
|
68535
|
+
const minutes2 = textFlag(inv, "minutes");
|
|
68536
|
+
if (minutes2 !== void 0 && (!/^\d+$/.test(minutes2) || Number(minutes2) < 1 || Number(minutes2) > 1440)) throw new UsageError("--minutes is a whole number from 1 to 1440");
|
|
68253
68537
|
const header = textFlag(inv, "header");
|
|
68254
68538
|
const body2 = {
|
|
68255
68539
|
requestId: requestId13(),
|
|
@@ -68258,7 +68542,7 @@ var egressGrantCommand = defineCommand({
|
|
|
68258
68542
|
hosts: listFlag(inv, "host"),
|
|
68259
68543
|
secretName: textFlag(inv, "secret"),
|
|
68260
68544
|
...header === void 0 ? {} : { attach: { kind: "header", name: header.toLowerCase() } },
|
|
68261
|
-
...
|
|
68545
|
+
...minutes2 === void 0 ? {} : { ttlSeconds: Number(minutes2) * 60 }
|
|
68262
68546
|
};
|
|
68263
68547
|
if (inv.dryRun) return planned8(inv, "POST", egressPaths.grants, body2, "the secret's value is not part of the request or the answer");
|
|
68264
68548
|
const { call: call2, tenantId, projectId } = await connected8(inv);
|
|
@@ -68302,7 +68586,7 @@ var egressRevokeCommand = defineCommand({
|
|
|
68302
68586
|
handler: async (inv) => {
|
|
68303
68587
|
const id2 = textFlag(inv, "grant");
|
|
68304
68588
|
if (id2 === void 0) throw new UsageError("revoke needs --grant", { hint: "overlane egress grants" });
|
|
68305
|
-
if (inv.dryRun) return planned8(inv, "POST", (
|
|
68589
|
+
if (inv.dryRun) return planned8(inv, "POST", (t2, p2) => egressPaths.revoke(t2, p2, id2), {});
|
|
68306
68590
|
const { call: call2, tenantId, projectId } = await connected8(inv);
|
|
68307
68591
|
return { data: await call2(TaskGrant, "POST", egressPaths.revoke(tenantId, projectId, id2), {}) };
|
|
68308
68592
|
}
|
|
@@ -68328,6 +68612,347 @@ var egressScanCommand = defineCommand({
|
|
|
68328
68612
|
});
|
|
68329
68613
|
var egressCommands = [egressPolicyShowCommand, egressPolicySetCommand, egressCheckCommand, egressEventsCommand, egressGrantCommand, egressGrantsCommand, egressRevokeCommand, egressScanCommand];
|
|
68330
68614
|
|
|
68615
|
+
// ../cli/src/commands/observe.ts
|
|
68616
|
+
init_src();
|
|
68617
|
+
init_zod();
|
|
68618
|
+
import { randomUUID as randomUUID15 } from "node:crypto";
|
|
68619
|
+
var common20 = { needsAuth: true, needsNetwork: true };
|
|
68620
|
+
var requestId14 = () => `cli-${randomUUID15()}`;
|
|
68621
|
+
async function connected9(inv) {
|
|
68622
|
+
const project = await connectedProject(inv.deps, "observe");
|
|
68623
|
+
return { call: serviceCall(inv.deps, project.serviceUrl, project.token), tenantId: project.binding.tenantId, projectId: project.binding.projectId };
|
|
68624
|
+
}
|
|
68625
|
+
async function planned9(inv, method, path, body2, note) {
|
|
68626
|
+
const project = await offlineProject(inv.deps, "observe");
|
|
68627
|
+
return planOutcome(inv.deps, dryRunPlan({ service: project.serviceUrl, requests: [{ method, path: path(project.binding.tenantId), ...body2 === void 0 ? {} : { body: body2 }, ...note === void 0 ? {} : { note } }] }));
|
|
68628
|
+
}
|
|
68629
|
+
var usd3 = (micros2) => {
|
|
68630
|
+
const cents = Math.round(micros2 / 1e4);
|
|
68631
|
+
return `$${Math.trunc(cents / 100)}.${String(cents % 100).padStart(2, "0")}`;
|
|
68632
|
+
};
|
|
68633
|
+
var minutes = (ms) => `${(ms / 6e4).toFixed(1)} min`;
|
|
68634
|
+
var observeStatusCommand = defineCommand({
|
|
68635
|
+
path: ["observe", "status"],
|
|
68636
|
+
summary: "Show runs, open incidents, cost, decision records and the retention period",
|
|
68637
|
+
description: "One read of the team's observability: runs in the last 24 hours by status, open alert incidents, cost and tokens this billing period, the decision-model records (outcomes and latency), and how long telemetry is kept on the plan.",
|
|
68638
|
+
examples: ["overlane observe status", "overlane observe status --json"],
|
|
68639
|
+
effect: "read",
|
|
68640
|
+
...common20,
|
|
68641
|
+
keywords: ["observability", "run status", "open incidents", "how are my agents doing", "telemetry"],
|
|
68642
|
+
result: ObserveStatus,
|
|
68643
|
+
text: (d) => [
|
|
68644
|
+
`runs (24h): ${d.runs.running} running, ${d.runs.passed} passed, ${d.runs.failed} failed, ${d.runs.paused} paused`,
|
|
68645
|
+
`open incidents: ${d.openIncidents}`,
|
|
68646
|
+
`cost this period: ${usd3(d.costMicros)}, ${d.tokens} tokens`,
|
|
68647
|
+
`decision records: ${d.decisions.total}${Object.entries(d.decisions.byOutcome).map(([k, v]) => ` ${k} ${v}`).join(",")}`,
|
|
68648
|
+
`retention: ${d.retention.retentionDays === null ? "set by contract" : `${d.retention.retentionDays} days`} (${d.retention.plan})`
|
|
68649
|
+
],
|
|
68650
|
+
handler: async (inv) => {
|
|
68651
|
+
const { call: call2, tenantId } = await connected9(inv);
|
|
68652
|
+
return { data: await call2(ObserveStatus, "GET", observePaths.status(tenantId)) };
|
|
68653
|
+
}
|
|
68654
|
+
});
|
|
68655
|
+
var observeLogsCommand = defineCommand({
|
|
68656
|
+
path: ["observe", "logs"],
|
|
68657
|
+
summary: "List a project's logs, optionally for one run",
|
|
68658
|
+
description: "Lists recorded log lines for the connected project, newest first, or oldest first for one run. Text was redacted at ingest: a replaced span reads [redacted:rule] and the line says how many were replaced.",
|
|
68659
|
+
flags: [
|
|
68660
|
+
{ name: "run", type: "string", value: "RUN", description: "Only this run's lines, oldest first" },
|
|
68661
|
+
{ name: "limit", type: "string", value: "N", description: "How many lines, default 200, at most 1000" }
|
|
68662
|
+
],
|
|
68663
|
+
examples: ["overlane observe logs", "overlane observe logs --run run-12 --limit 50"],
|
|
68664
|
+
effect: "read",
|
|
68665
|
+
...common20,
|
|
68666
|
+
keywords: ["logs", "agent logs", "what happened in the run", "tool output"],
|
|
68667
|
+
result: LogRecordList,
|
|
68668
|
+
text: (d) => d.logs.length === 0 ? ["No log lines recorded."] : d.logs.map((l) => `${l.at} ${l.level.toUpperCase().padEnd(5)} ${l.runId} ${l.source} ${l.message}${l.redacted ? ` (${l.redactions} redacted)` : ""}`),
|
|
68669
|
+
handler: async (inv) => {
|
|
68670
|
+
const { call: call2, tenantId, projectId } = await connected9(inv);
|
|
68671
|
+
const run3 = textFlag(inv, "run");
|
|
68672
|
+
const limit = textFlag(inv, "limit");
|
|
68673
|
+
if (limit !== void 0 && !/^\d+$/.test(limit)) throw new UsageError("--limit is a whole number");
|
|
68674
|
+
const query = [run3 === void 0 ? null : `run=${encodeURIComponent(run3)}`, limit === void 0 ? null : `limit=${limit}`].filter((part) => part !== null).join("&");
|
|
68675
|
+
return { data: await call2(LogRecordList, "GET", `${observePaths.logs(tenantId, projectId)}${query === "" ? "" : `?${query}`}`) };
|
|
68676
|
+
}
|
|
68677
|
+
});
|
|
68678
|
+
var observeTraceCommand = defineCommand({
|
|
68679
|
+
path: ["observe", "trace"],
|
|
68680
|
+
summary: "Show one run's events, logs and spans together",
|
|
68681
|
+
description: "Everything recorded for a run, stitched by run ID: its ordered event stream, its log lines and its spans, with the run's status, cost and tokens.",
|
|
68682
|
+
flags: [{ name: "run", type: "string", required: true, value: "RUN", description: "The run ID" }],
|
|
68683
|
+
examples: ["overlane observe trace --run run-12", "overlane observe trace --run run-12 --json"],
|
|
68684
|
+
effect: "read",
|
|
68685
|
+
...common20,
|
|
68686
|
+
keywords: ["trace", "run trace", "stitched logs", "spans", "run id"],
|
|
68687
|
+
result: TraceBundle,
|
|
68688
|
+
text: (d) => [
|
|
68689
|
+
`run ${d.runId}${d.run === null ? "" : `: ${d.run.agent}, ${d.run.status}, ${usd3(d.run.costMicros)}, ${d.run.tokens} tokens`}`,
|
|
68690
|
+
...d.events.map((e2) => ` #${e2.sequence} ${e2.occurredAt} ${e2.type} ${e2.status}${e2.label === void 0 ? "" : ` ${e2.label}`}`),
|
|
68691
|
+
...d.spans.map((s) => ` span ${s.spanId} ${s.name} ${s.durationMs} ms ${s.status}`),
|
|
68692
|
+
...d.logs.map((l) => ` log ${l.at} ${l.level} ${l.message}`)
|
|
68693
|
+
],
|
|
68694
|
+
handler: async (inv) => {
|
|
68695
|
+
const run3 = textFlag(inv, "run");
|
|
68696
|
+
if (run3 === void 0) throw new UsageError("trace needs --run", { hint: "overlane observe trace --run <run id>" });
|
|
68697
|
+
const { call: call2, tenantId, projectId } = await connected9(inv);
|
|
68698
|
+
return { data: await call2(TraceBundle, "GET", observePaths.trace(tenantId, projectId, run3)) };
|
|
68699
|
+
}
|
|
68700
|
+
});
|
|
68701
|
+
var observeCostCommand = defineCommand({
|
|
68702
|
+
path: ["observe", "cost"],
|
|
68703
|
+
summary: "Show cost and tokens per agent, project and team for this billing period",
|
|
68704
|
+
description: "Cost in dollars, tokens and run counts grouped by agent, by project and for the team, from the metrics the runs reported. `overlane observe reconcile` compares the same figures with metered usage.",
|
|
68705
|
+
examples: ["overlane observe cost", "overlane observe cost --json"],
|
|
68706
|
+
effect: "read",
|
|
68707
|
+
...common20,
|
|
68708
|
+
keywords: ["cost per agent", "token usage", "spend per project", "how much did the run cost"],
|
|
68709
|
+
result: CostReport,
|
|
68710
|
+
text: (d) => [
|
|
68711
|
+
`${d.period}: ${usd3(d.totalMicros)}, ${d.tokens} tokens`,
|
|
68712
|
+
...d.byAgent.map((r) => ` agent ${r.key.padEnd(20)} ${usd3(r.costMicros).padStart(10)} ${String(r.tokens).padStart(10)} tokens ${r.runs} runs`),
|
|
68713
|
+
...d.byProject.map((r) => ` project ${r.key.padEnd(18)} ${usd3(r.costMicros).padStart(10)} ${String(r.tokens).padStart(10)} tokens ${r.runs} runs`)
|
|
68714
|
+
],
|
|
68715
|
+
handler: async (inv) => {
|
|
68716
|
+
const { call: call2, tenantId } = await connected9(inv);
|
|
68717
|
+
return { data: await call2(CostReport, "GET", observePaths.cost(tenantId)) };
|
|
68718
|
+
}
|
|
68719
|
+
});
|
|
68720
|
+
var observeReconcileCommand = defineCommand({
|
|
68721
|
+
path: ["observe", "reconcile"],
|
|
68722
|
+
summary: "Compare observed cost with metered usage; the tolerance is 1 percent",
|
|
68723
|
+
description: "Compares the cost the metrics report with the usage the billing ledger meters, per agent, per project and in total. A line outside the tolerance names the key and the error in basis points.",
|
|
68724
|
+
examples: ["overlane observe reconcile", "overlane observe reconcile --json"],
|
|
68725
|
+
effect: "read",
|
|
68726
|
+
...common20,
|
|
68727
|
+
keywords: ["reconcile cost", "metered usage", "cost matches billing", "metrics accuracy"],
|
|
68728
|
+
result: Reconciliation,
|
|
68729
|
+
text: (d) => [
|
|
68730
|
+
`${d.withinTolerance ? "within" : "OUTSIDE"} ${d.toleranceBps / 100}%: metered ${usd3(d.total.meteredMicros)}, observed ${usd3(d.total.observedMicros)}, error ${d.total.errorBps} bps`,
|
|
68731
|
+
...[...d.byAgent.map((l) => ({ ...l, key: `agent ${l.key}` })), ...d.byProject.map((l) => ({ ...l, key: `project ${l.key}` }))].filter((l) => !l.within).map((l) => ` ${l.key}: metered ${usd3(l.meteredMicros)}, observed ${usd3(l.observedMicros)}, error ${l.errorBps} bps`)
|
|
68732
|
+
],
|
|
68733
|
+
handler: async (inv) => {
|
|
68734
|
+
const { call: call2, tenantId } = await connected9(inv);
|
|
68735
|
+
return { data: await call2(Reconciliation, "GET", observePaths.reconcile(tenantId)) };
|
|
68736
|
+
}
|
|
68737
|
+
});
|
|
68738
|
+
var observeCompareCommand = defineCommand({
|
|
68739
|
+
path: ["observe", "compare"],
|
|
68740
|
+
summary: "Compare the agents that worked the same task: cost, time and review outcome",
|
|
68741
|
+
description: "For one task given to more than one agent, shows each agent's runs, cost, tokens, time and review outcome, and names the cheapest, the fastest and the lowest-cost agent whose work was approved.",
|
|
68742
|
+
flags: [{ name: "task", type: "string", required: true, value: "TASK", description: "The task ID" }],
|
|
68743
|
+
examples: ["overlane observe compare --task task-77", "overlane observe compare --task task-77 --json"],
|
|
68744
|
+
effect: "read",
|
|
68745
|
+
...common20,
|
|
68746
|
+
keywords: ["compare agents", "which agent is better", "claude vs codex", "agent report", "same task two agents"],
|
|
68747
|
+
result: ComparisonReport,
|
|
68748
|
+
text: (d) => d.entries.length === 0 ? [`No runs recorded for task ${d.taskId}.`] : [
|
|
68749
|
+
...d.entries.map((e2) => `${e2.agent.padEnd(18)} ${usd3(e2.costMicros).padStart(9)} ${minutes(e2.durationMs).padStart(10)} ${String(e2.tokens).padStart(8)} tokens ${e2.status} review: ${e2.reviewOutcome}`),
|
|
68750
|
+
`cheapest: ${d.cheapest ?? "none"}; fastest: ${d.fastest ?? "none"}; recommended: ${d.recommended ?? "none approved"}`
|
|
68751
|
+
],
|
|
68752
|
+
handler: async (inv) => {
|
|
68753
|
+
const task = textFlag(inv, "task");
|
|
68754
|
+
if (task === void 0) throw new UsageError("compare needs --task", { hint: "overlane observe compare --task <task id>" });
|
|
68755
|
+
const { call: call2, tenantId } = await connected9(inv);
|
|
68756
|
+
return { data: await call2(ComparisonReport, "GET", `${observePaths.compare(tenantId)}?task=${encodeURIComponent(task)}`) };
|
|
68757
|
+
}
|
|
68758
|
+
});
|
|
68759
|
+
var observeEvalsCommand = defineCommand({
|
|
68760
|
+
path: ["observe", "evals"],
|
|
68761
|
+
summary: "Show eval scores from replaying merged pull requests per agent and configuration",
|
|
68762
|
+
description: "Pass rate, mean cost and mean review time per agent and configuration, scored from the stored replays of your own merged pull requests. Scoring is arithmetic over checks, never a model's opinion.",
|
|
68763
|
+
examples: ["overlane observe evals", "overlane observe evals --json"],
|
|
68764
|
+
effect: "read",
|
|
68765
|
+
...common20,
|
|
68766
|
+
keywords: ["evals", "replay merged prs", "agent pass rate", "benchmark my repo", "which config works"],
|
|
68767
|
+
result: EvalReport,
|
|
68768
|
+
text: (d) => d.rows.length === 0 ? ["No replays recorded. Run some: overlane observe evals run --prs pr-1,pr-2 --agents codex --configs default"] : [...d.rows.map((r) => `${r.agent.padEnd(16)} ${r.config.padEnd(14)} pass ${(r.passRateBps / 100).toFixed(1)}% ${r.passed}/${r.prs} cost ${usd3(r.meanCostMicros)} review ${minutes(r.meanReviewMs)}`), `best: ${d.best === null ? "none" : `${d.best.agent} / ${d.best.config}`}`],
|
|
68769
|
+
handler: async (inv) => {
|
|
68770
|
+
const { call: call2, tenantId } = await connected9(inv);
|
|
68771
|
+
return { data: await call2(EvalReport, "GET", observePaths.evals(tenantId)) };
|
|
68772
|
+
}
|
|
68773
|
+
});
|
|
68774
|
+
var list = (value, name2) => {
|
|
68775
|
+
const items = (value ?? "").split(",").map((item) => item.trim()).filter((item) => item !== "");
|
|
68776
|
+
if (items.length === 0) throw new UsageError(`--${name2} needs at least one value, comma separated`, { hint: "overlane observe evals run --prs pr-1,pr-2 --agents codex --configs default" });
|
|
68777
|
+
return items;
|
|
68778
|
+
};
|
|
68779
|
+
var observeEvalsRunCommand = defineCommand({
|
|
68780
|
+
path: ["observe", "evals", "run"],
|
|
68781
|
+
summary: "Replay merged pull requests against agents and configurations and score the results",
|
|
68782
|
+
description: "Replays each listed merged pull request against each agent and configuration through the replay runner, stores the results and prints the scores. Asking again with the same request ID counts once. Needs the native runner; until it is bound the service answers live_leg_pending.",
|
|
68783
|
+
flags: [
|
|
68784
|
+
{ name: "prs", type: "string", required: true, value: "LIST", description: "Merged pull requests, comma separated" },
|
|
68785
|
+
{ name: "agents", type: "string", required: true, value: "LIST", description: "Agents to replay with, comma separated" },
|
|
68786
|
+
{ name: "configs", type: "string", required: true, value: "LIST", description: "Configurations to compare, comma separated" }
|
|
68787
|
+
],
|
|
68788
|
+
examples: ["overlane observe evals run --prs pr-1,pr-2 --agents codex,claude-code --configs default,strict", "overlane observe evals run --prs pr-1 --agents codex --configs default --dry-run"],
|
|
68789
|
+
effect: "write",
|
|
68790
|
+
...common20,
|
|
68791
|
+
keywords: ["run evals", "replay pull requests", "compare configs", "agent benchmark on my repo"],
|
|
68792
|
+
result: withDryRun(EvalReport),
|
|
68793
|
+
text: (d) => "rows" in d ? d.rows.map((r) => `${r.agent} / ${r.config}: pass ${(r.passRateBps / 100).toFixed(1)}%, cost ${usd3(r.meanCostMicros)}, review ${minutes(r.meanReviewMs)}`) : [],
|
|
68794
|
+
handler: async (inv) => {
|
|
68795
|
+
const body2 = { requestId: requestId14(), prs: list(textFlag(inv, "prs"), "prs"), agents: list(textFlag(inv, "agents"), "agents"), configs: list(textFlag(inv, "configs"), "configs") };
|
|
68796
|
+
if (inv.dryRun) return planned9(inv, "POST", observePaths.evals, body2, "replays each pull request with each agent and configuration");
|
|
68797
|
+
const { call: call2, tenantId } = await connected9(inv);
|
|
68798
|
+
return { data: await call2(EvalReport, "POST", observePaths.evals(tenantId), body2) };
|
|
68799
|
+
}
|
|
68800
|
+
});
|
|
68801
|
+
var observeAlertsCommand = defineCommand({
|
|
68802
|
+
path: ["observe", "alerts"],
|
|
68803
|
+
summary: "List alert rules and incidents",
|
|
68804
|
+
description: "Alert rules (spend cap reached, failing run, stuck lease, stale index) with where each one goes, and the incidents they opened. An incident fires once; resolving it is a separate notice.",
|
|
68805
|
+
examples: ["overlane observe alerts", "overlane observe alerts --json"],
|
|
68806
|
+
effect: "read",
|
|
68807
|
+
...common20,
|
|
68808
|
+
keywords: ["alerts", "incidents", "notifications", "who gets paged", "failing runs"],
|
|
68809
|
+
result: AlertOverview,
|
|
68810
|
+
text: (d) => [
|
|
68811
|
+
...d.rules.length === 0 ? ["No alert rules. Add one: overlane observe alerts set --kind failing_run --email ops@example.com"] : d.rules.map((r) => `rule ${r.ruleId} ${r.kind} ${r.enabled ? "on" : "off"} -> ${r.targets.map((t2) => `${t2.channel}:${t2.destination}`).join(", ")}`),
|
|
68812
|
+
...d.incidents.map((i2) => `${i2.state.padEnd(8)} ${i2.openedAt} ${i2.kind} ${i2.subject} next: ${i2.nextCommand}`)
|
|
68813
|
+
],
|
|
68814
|
+
handler: async (inv) => {
|
|
68815
|
+
const { call: call2, tenantId } = await connected9(inv);
|
|
68816
|
+
return { data: await call2(AlertOverview, "GET", observePaths.alerts(tenantId)) };
|
|
68817
|
+
}
|
|
68818
|
+
});
|
|
68819
|
+
function targetsOf(inv) {
|
|
68820
|
+
const targets = [];
|
|
68821
|
+
for (const channel of ["email", "slack", "teams"]) {
|
|
68822
|
+
const destination = textFlag(inv, channel);
|
|
68823
|
+
if (destination !== void 0) targets.push({ channel, destination });
|
|
68824
|
+
}
|
|
68825
|
+
if (targets.length === 0) throw new UsageError("an alert rule needs a target: --email, --slack or --teams", { hint: "overlane observe alerts set --kind failing_run --email ops@example.com" });
|
|
68826
|
+
return targets;
|
|
68827
|
+
}
|
|
68828
|
+
var RuleSet = external_exports.object({ tenantId: external_exports.string(), rule: AlertRule }).strict();
|
|
68829
|
+
var observeAlertsSetCommand = defineCommand({
|
|
68830
|
+
path: ["observe", "alerts", "set"],
|
|
68831
|
+
summary: "Create or change an alert rule",
|
|
68832
|
+
description: "Sets a rule for a spend cap, a failing run, a stuck lease or a stale index, and where its notice goes: an email address, a Slack channel or a Teams channel. --percent sets the spend threshold, --minutes the age for a stuck lease or stale index. Reusing a rule ID changes that rule.",
|
|
68833
|
+
flags: [
|
|
68834
|
+
{ name: "kind", type: "string", required: true, enum: ALERT_KINDS, value: "KIND", description: "spend_cap, failing_run, stuck_lease or index_stale" },
|
|
68835
|
+
{ name: "email", type: "string", value: "ADDRESS", description: "Send to this email address" },
|
|
68836
|
+
{ name: "slack", type: "string", value: "CHANNEL", description: "Send to this Slack channel" },
|
|
68837
|
+
{ name: "teams", type: "string", value: "CHANNEL", description: "Send to this Teams channel" },
|
|
68838
|
+
{ name: "percent", type: "string", value: "N", description: "Spend threshold as a percent of the limit, 1 to 100" },
|
|
68839
|
+
{ name: "minutes", type: "string", value: "N", description: "Age in minutes for a stuck lease or a stale index" },
|
|
68840
|
+
{ name: "rule-id", type: "string", value: "ID", description: "Change this rule instead of adding one" },
|
|
68841
|
+
{ name: "off", type: "boolean", description: "Keep the rule but turn it off" }
|
|
68842
|
+
],
|
|
68843
|
+
examples: ["overlane observe alerts set --kind failing_run --email ops@example.com --slack ops", "overlane observe alerts set --kind spend_cap --percent 80 --email ops@example.com --dry-run"],
|
|
68844
|
+
effect: "write",
|
|
68845
|
+
...common20,
|
|
68846
|
+
keywords: ["add alert", "alert on failing runs", "alert on spend", "notify slack", "notify email"],
|
|
68847
|
+
result: withDryRun(RuleSet),
|
|
68848
|
+
text: (d) => "rule" in d ? [`rule ${d.rule.ruleId}: ${d.rule.kind}, ${d.rule.enabled ? "on" : "off"}, -> ${d.rule.targets.map((t2) => `${t2.channel}:${t2.destination}`).join(", ")}`] : [],
|
|
68849
|
+
handler: async (inv) => {
|
|
68850
|
+
const number4 = (name2) => {
|
|
68851
|
+
const value = textFlag(inv, name2);
|
|
68852
|
+
if (value === void 0) return void 0;
|
|
68853
|
+
if (!/^\d+$/.test(value)) throw new UsageError(`--${name2} is a whole number`);
|
|
68854
|
+
return Number(value);
|
|
68855
|
+
};
|
|
68856
|
+
const percent = number4("percent");
|
|
68857
|
+
const mins = number4("minutes");
|
|
68858
|
+
const ruleId = textFlag(inv, "rule-id");
|
|
68859
|
+
const body2 = {
|
|
68860
|
+
requestId: requestId14(),
|
|
68861
|
+
kind: textFlag(inv, "kind"),
|
|
68862
|
+
targets: targetsOf(inv),
|
|
68863
|
+
threshold: { ...percent === void 0 ? {} : { percent }, ...mins === void 0 ? {} : { minutes: mins } },
|
|
68864
|
+
enabled: !boolFlag(inv, "off"),
|
|
68865
|
+
...ruleId === void 0 ? {} : { ruleId }
|
|
68866
|
+
};
|
|
68867
|
+
if (inv.dryRun) return planned9(inv, "PUT", observePaths.alertRules, body2);
|
|
68868
|
+
const { call: call2, tenantId } = await connected9(inv);
|
|
68869
|
+
return { data: await call2(RuleSet, "PUT", observePaths.alertRules(tenantId), body2) };
|
|
68870
|
+
}
|
|
68871
|
+
});
|
|
68872
|
+
var RuleRemoved = external_exports.object({ tenantId: external_exports.string(), removed: external_exports.literal(true) }).strict();
|
|
68873
|
+
var observeAlertsRemoveCommand = defineCommand({
|
|
68874
|
+
path: ["observe", "alerts", "remove"],
|
|
68875
|
+
summary: "Remove an alert rule",
|
|
68876
|
+
description: "Deletes the rule. Incidents it already opened stay in the list. Destructive: it needs --force without a terminal.",
|
|
68877
|
+
flags: [{ name: "rule-id", type: "string", value: "ID", description: "The rule to remove (required)" }],
|
|
68878
|
+
examples: ["overlane observe alerts remove --rule-id rule-1 --force", "overlane observe alerts remove --rule-id rule-1 --dry-run"],
|
|
68879
|
+
effect: "destructive",
|
|
68880
|
+
...common20,
|
|
68881
|
+
keywords: ["delete alert", "remove alert rule", "stop alerts"],
|
|
68882
|
+
result: withDryRun(RuleRemoved),
|
|
68883
|
+
text: (d) => "removed" in d ? ["rule removed"] : [],
|
|
68884
|
+
handler: async (inv) => {
|
|
68885
|
+
const ruleId = textFlag(inv, "rule-id");
|
|
68886
|
+
if (ruleId === void 0) throw new UsageError("remove needs --rule-id", { hint: "overlane observe alerts" });
|
|
68887
|
+
if (inv.dryRun) return planned9(inv, "DELETE", observePaths.alertRules, { ruleId });
|
|
68888
|
+
const { call: call2, tenantId } = await connected9(inv);
|
|
68889
|
+
return { data: await call2(RuleRemoved, "DELETE", observePaths.alertRules(tenantId), { ruleId }) };
|
|
68890
|
+
}
|
|
68891
|
+
});
|
|
68892
|
+
var observeAlertsEvaluateCommand = defineCommand({
|
|
68893
|
+
path: ["observe", "alerts", "evaluate"],
|
|
68894
|
+
summary: "Check every alert rule now and send the notices that are due",
|
|
68895
|
+
description: "Looks at each enabled rule's condition, opens an incident for a new one, resolves one that cleared, and sends each notice once. The service also runs this on a schedule and when a run ends in failure.",
|
|
68896
|
+
examples: ["overlane observe alerts evaluate", "overlane observe alerts evaluate --dry-run"],
|
|
68897
|
+
effect: "write",
|
|
68898
|
+
...common20,
|
|
68899
|
+
keywords: ["check alerts now", "evaluate rules", "send alerts"],
|
|
68900
|
+
result: withDryRun(EvaluateAlertsResult),
|
|
68901
|
+
text: (d) => "opened" in d ? [`opened ${d.opened.length}, resolved ${d.resolved.length}, still open ${d.stillOpen}`, ...d.opened.map((i2) => ` ${i2.kind}: ${i2.subject}`)] : [],
|
|
68902
|
+
handler: async (inv) => {
|
|
68903
|
+
if (inv.dryRun) return planned9(inv, "POST", observePaths.alertsEvaluate, {}, "opens incidents and sends notices");
|
|
68904
|
+
const { call: call2, tenantId } = await connected9(inv);
|
|
68905
|
+
return { data: await call2(EvaluateAlertsResult, "POST", observePaths.alertsEvaluate(tenantId), {}) };
|
|
68906
|
+
}
|
|
68907
|
+
});
|
|
68908
|
+
var observeRetentionCommand = defineCommand({
|
|
68909
|
+
path: ["observe", "retention"],
|
|
68910
|
+
summary: "Show how long telemetry is kept on the plan",
|
|
68911
|
+
description: "The retention period for logs, spans, metrics and run events on the team's plan, and the records no purge ever touches: the task ledger, evidence, the audit log, billing and decision records.",
|
|
68912
|
+
examples: ["overlane observe retention", "overlane observe retention --json"],
|
|
68913
|
+
effect: "read",
|
|
68914
|
+
...common20,
|
|
68915
|
+
keywords: ["retention", "how long are logs kept", "data retention", "purge"],
|
|
68916
|
+
result: RetentionPolicy,
|
|
68917
|
+
text: (d) => [`plan ${d.plan}: ${d.retentionDays === null ? "no fixed period" : `${d.retentionDays} days`}`, `purged: ${d.covers.join(", ")}`, `never purged: ${d.keeps.join(", ")}`],
|
|
68918
|
+
handler: async (inv) => {
|
|
68919
|
+
const { call: call2, tenantId } = await connected9(inv);
|
|
68920
|
+
return { data: await call2(RetentionPolicy, "GET", observePaths.retention(tenantId)) };
|
|
68921
|
+
}
|
|
68922
|
+
});
|
|
68923
|
+
var observeRetentionPurgeCommand = defineCommand({
|
|
68924
|
+
path: ["observe", "retention", "purge"],
|
|
68925
|
+
summary: "Delete telemetry older than the plan keeps",
|
|
68926
|
+
description: "Deletes logs, spans, metrics, run events and resolved incidents older than the plan's retention period and prints how many of each. The task ledger, evidence, audit log, billing and decision records are never touched. The service also runs this on a schedule. Destructive: it needs --force without a terminal.",
|
|
68927
|
+
examples: ["overlane observe retention purge --force", "overlane observe retention purge --dry-run"],
|
|
68928
|
+
effect: "destructive",
|
|
68929
|
+
...common20,
|
|
68930
|
+
keywords: ["purge logs", "delete old telemetry", "enforce retention"],
|
|
68931
|
+
result: withDryRun(RetentionPurgeResult),
|
|
68932
|
+
text: (d) => "deleted" in d ? [`plan ${d.plan}, cutoff ${d.cutoff ?? "none"}`, ...Object.entries(d.deleted).map(([k, v]) => ` ${k}: ${v}`)] : [],
|
|
68933
|
+
handler: async (inv) => {
|
|
68934
|
+
if (inv.dryRun) return planned9(inv, "POST", observePaths.retentionPurge, {}, "deletes telemetry older than the plan keeps");
|
|
68935
|
+
const { call: call2, tenantId } = await connected9(inv);
|
|
68936
|
+
return { data: await call2(RetentionPurgeResult, "POST", observePaths.retentionPurge(tenantId), {}) };
|
|
68937
|
+
}
|
|
68938
|
+
});
|
|
68939
|
+
var observeCommands = [
|
|
68940
|
+
observeStatusCommand,
|
|
68941
|
+
observeLogsCommand,
|
|
68942
|
+
observeTraceCommand,
|
|
68943
|
+
observeCostCommand,
|
|
68944
|
+
observeReconcileCommand,
|
|
68945
|
+
observeCompareCommand,
|
|
68946
|
+
observeEvalsCommand,
|
|
68947
|
+
observeEvalsRunCommand,
|
|
68948
|
+
observeAlertsCommand,
|
|
68949
|
+
observeAlertsSetCommand,
|
|
68950
|
+
observeAlertsRemoveCommand,
|
|
68951
|
+
observeAlertsEvaluateCommand,
|
|
68952
|
+
observeRetentionCommand,
|
|
68953
|
+
observeRetentionPurgeCommand
|
|
68954
|
+
];
|
|
68955
|
+
|
|
68331
68956
|
// ../cli/src/commands/index.ts
|
|
68332
68957
|
function coreCommands() {
|
|
68333
68958
|
return [
|
|
@@ -68361,6 +68986,7 @@ function coreCommands() {
|
|
|
68361
68986
|
...rulesCommands,
|
|
68362
68987
|
...prCommands,
|
|
68363
68988
|
...egressCommands,
|
|
68989
|
+
...observeCommands,
|
|
68364
68990
|
...repoCommands,
|
|
68365
68991
|
...ciCommands,
|
|
68366
68992
|
...deployCommands
|
|
@@ -68389,12 +69015,12 @@ function parseFor(spec, tokens) {
|
|
|
68389
69015
|
for (const flag of spec.flags) {
|
|
68390
69016
|
const given = values[flag.name];
|
|
68391
69017
|
if (given === void 0 && flag.default !== void 0) values[flag.name] = flag.default;
|
|
68392
|
-
const
|
|
68393
|
-
if (flag.required === true &&
|
|
69018
|
+
const list2 = Array.isArray(given) ? given : given === void 0 ? [] : [given];
|
|
69019
|
+
if (flag.required === true && list2.length === 0) {
|
|
68394
69020
|
throw new UsageError(`${last} needs --${flag.name}${flag.type === "string" ? ` ${placeholder(flag)}` : ""}`, { hint });
|
|
68395
69021
|
}
|
|
68396
69022
|
if (flag.enum !== void 0) {
|
|
68397
|
-
for (const value of
|
|
69023
|
+
for (const value of list2) {
|
|
68398
69024
|
if (typeof value === "string" && !flag.enum.includes(value)) {
|
|
68399
69025
|
throw new UsageError(`--${flag.name} must be one of ${flag.enum.join(", ")}`, { hint });
|
|
68400
69026
|
}
|