overlane 0.1.135 → 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 +853 -257
- package/package.json +1 -1
- package/plugins/claude/plugins/mvrx-harness/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/plugins/mvrx-harness/scripts/harness-codemap.mjs +36 -36
- package/plugins/claude/plugins/mvrx-harness/scripts/harness-context.mjs +40 -40
- 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/scripts/harness-codemap.mjs +36 -36
- package/plugins/codex/plugins/mvrx-harness/scripts/harness-context.mjs +40 -40
- 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 +22 -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
|
});
|
|
@@ -23623,7 +23623,7 @@ var init_agent = __esm({
|
|
|
23623
23623
|
minRole: Role,
|
|
23624
23624
|
/** JSON-schema-like description of the arguments, property name to a short hint. */
|
|
23625
23625
|
arguments: external_exports.record(external_exports.string().min(1).max(64), external_exports.string().max(200))
|
|
23626
|
-
}).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"] });
|
|
23627
23627
|
AGENT_REFUSAL_CODES = [
|
|
23628
23628
|
"role_forbidden",
|
|
23629
23629
|
"read_only_mode",
|
|
@@ -24347,22 +24347,22 @@ var init_git = __esm({
|
|
|
24347
24347
|
e = encodeURIComponent;
|
|
24348
24348
|
gitPaths = {
|
|
24349
24349
|
repos: repoBase,
|
|
24350
|
-
capability: (
|
|
24351
|
-
repo: (
|
|
24352
|
-
import: (
|
|
24353
|
-
sync: (
|
|
24354
|
-
branches: (
|
|
24355
|
-
branch: (
|
|
24356
|
-
push: (
|
|
24357
|
-
pushCheck: (
|
|
24358
|
-
protection: (
|
|
24359
|
-
tokens: (
|
|
24360
|
-
token: (
|
|
24361
|
-
pulls: (
|
|
24362
|
-
pull: (
|
|
24363
|
-
reviews: (
|
|
24364
|
-
merge: (
|
|
24365
|
-
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`
|
|
24366
24366
|
};
|
|
24367
24367
|
}
|
|
24368
24368
|
});
|
|
@@ -24819,18 +24819,18 @@ var init_ci = __esm({
|
|
|
24819
24819
|
CiSecretListResponse = external_exports.object({ tenantId: TenantId, secrets: external_exports.array(CiSecretMeta) }).strict();
|
|
24820
24820
|
ValidateConfigRequest = external_exports.object({ config: external_exports.string().min(1).max(1e5) }).strict();
|
|
24821
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();
|
|
24822
|
-
ciBase = (
|
|
24822
|
+
ciBase = (t2, p2) => `/v1/tenants/${encodeURIComponent(t2)}/projects/${encodeURIComponent(p2)}/ci`;
|
|
24823
24823
|
ciPaths = {
|
|
24824
|
-
runs: (
|
|
24825
|
-
run: (
|
|
24826
|
-
cancel: (
|
|
24827
|
-
logs: (
|
|
24828
|
-
rerun: (
|
|
24829
|
-
validate: (
|
|
24830
|
-
settings: (
|
|
24831
|
-
secrets: (
|
|
24832
|
-
secret: (
|
|
24833
|
-
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`
|
|
24834
24834
|
};
|
|
24835
24835
|
}
|
|
24836
24836
|
});
|
|
@@ -24952,16 +24952,16 @@ var init_deploy = __esm({
|
|
|
24952
24952
|
TargetListResponse = external_exports.object({ tenantId: TenantId, targets: external_exports.array(DeployTarget), environments: external_exports.array(Environment) }).strict();
|
|
24953
24953
|
EnvironmentResponse = external_exports.object({ tenantId: TenantId, environment: Environment }).strict();
|
|
24954
24954
|
TargetResponse = external_exports.object({ tenantId: TenantId, target: DeployTarget }).strict();
|
|
24955
|
-
depBase = (
|
|
24955
|
+
depBase = (t2, p2) => `/v1/tenants/${encodeURIComponent(t2)}/projects/${encodeURIComponent(p2)}/deploy`;
|
|
24956
24956
|
enc = encodeURIComponent;
|
|
24957
24957
|
deployPaths = {
|
|
24958
|
-
targets: (
|
|
24959
|
-
environments: (
|
|
24960
|
-
deploys: (
|
|
24961
|
-
releases: (
|
|
24962
|
-
previews: (
|
|
24963
|
-
rollback: (
|
|
24964
|
-
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`
|
|
24965
24965
|
};
|
|
24966
24966
|
}
|
|
24967
24967
|
});
|
|
@@ -25529,8 +25529,8 @@ function checkRules(source, input2) {
|
|
|
25529
25529
|
const check2 = validateRulesSource(source);
|
|
25530
25530
|
if (!check2.ok) return { configured: true, revision: null, sourceProblem: check2.problem, drifted: true, targets: [], nextCommand: `fix ${RULES_SOURCE_PATH}` };
|
|
25531
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));
|
|
25532
|
-
const drifted = targets.some((
|
|
25533
|
-
const needsForce = targets.some((
|
|
25532
|
+
const drifted = targets.some((t2) => t2.state !== "in_sync");
|
|
25533
|
+
const needsForce = targets.some((t2) => t2.state === "edited");
|
|
25534
25534
|
return { configured: true, revision: check2.revision, sourceProblem: null, drifted, targets, nextCommand: !drifted ? null : needsForce ? "overlane rules sync --overwrite-edits" : "overlane rules sync" };
|
|
25535
25535
|
}
|
|
25536
25536
|
function planRulesSync(source, input2, options = {}) {
|
|
@@ -25910,6 +25910,259 @@ var init_egress = __esm({
|
|
|
25910
25910
|
}
|
|
25911
25911
|
});
|
|
25912
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
|
+
|
|
25913
26166
|
// ../contracts/src/index.ts
|
|
25914
26167
|
var init_src = __esm({
|
|
25915
26168
|
"../contracts/src/index.ts"() {
|
|
@@ -25956,6 +26209,7 @@ var init_src = __esm({
|
|
|
25956
26209
|
init_rules_sync();
|
|
25957
26210
|
init_pr_routing();
|
|
25958
26211
|
init_egress();
|
|
26212
|
+
init_observability();
|
|
25959
26213
|
}
|
|
25960
26214
|
});
|
|
25961
26215
|
|
|
@@ -26694,13 +26948,13 @@ var require_createNode = __commonJS({
|
|
|
26694
26948
|
var defaultTagPrefix = "tag:yaml.org,2002:";
|
|
26695
26949
|
function findTagObject(value, tagName, tags) {
|
|
26696
26950
|
if (tagName) {
|
|
26697
|
-
const match = tags.filter((
|
|
26698
|
-
const tagObj = match.find((
|
|
26951
|
+
const match = tags.filter((t2) => t2.tag === tagName);
|
|
26952
|
+
const tagObj = match.find((t2) => !t2.format) ?? match[0];
|
|
26699
26953
|
if (!tagObj)
|
|
26700
26954
|
throw new Error(`Tag ${tagName} not found`);
|
|
26701
26955
|
return tagObj;
|
|
26702
26956
|
}
|
|
26703
|
-
return tags.find((
|
|
26957
|
+
return tags.find((t2) => t2.identify?.(value) && !t2.format);
|
|
26704
26958
|
}
|
|
26705
26959
|
function createNode(value, tagName, ctx) {
|
|
26706
26960
|
if (identity.isDocument(value))
|
|
@@ -27327,10 +27581,10 @@ ${indent}`);
|
|
|
27327
27581
|
let res = _stringify(type);
|
|
27328
27582
|
if (res === null) {
|
|
27329
27583
|
const { defaultKeyType, defaultStringType } = ctx.options;
|
|
27330
|
-
const
|
|
27331
|
-
res = _stringify(
|
|
27584
|
+
const t2 = implicitKey && defaultKeyType || defaultStringType;
|
|
27585
|
+
res = _stringify(t2);
|
|
27332
27586
|
if (res === null)
|
|
27333
|
-
throw new Error(`Unsupported default string type ${
|
|
27587
|
+
throw new Error(`Unsupported default string type ${t2}`);
|
|
27334
27588
|
}
|
|
27335
27589
|
return res;
|
|
27336
27590
|
}
|
|
@@ -27390,24 +27644,24 @@ var require_stringify = __commonJS({
|
|
|
27390
27644
|
}
|
|
27391
27645
|
function getTagObject(tags, item) {
|
|
27392
27646
|
if (item.tag) {
|
|
27393
|
-
const match = tags.filter((
|
|
27647
|
+
const match = tags.filter((t2) => t2.tag === item.tag);
|
|
27394
27648
|
if (match.length > 0)
|
|
27395
|
-
return match.find((
|
|
27649
|
+
return match.find((t2) => t2.format === item.format) ?? match[0];
|
|
27396
27650
|
}
|
|
27397
27651
|
let tagObj = void 0;
|
|
27398
27652
|
let obj;
|
|
27399
27653
|
if (identity.isScalar(item)) {
|
|
27400
27654
|
obj = item.value;
|
|
27401
|
-
let match = tags.filter((
|
|
27655
|
+
let match = tags.filter((t2) => t2.identify?.(obj));
|
|
27402
27656
|
if (match.length > 1) {
|
|
27403
|
-
const testMatch = match.filter((
|
|
27657
|
+
const testMatch = match.filter((t2) => t2.test);
|
|
27404
27658
|
if (testMatch.length > 0)
|
|
27405
27659
|
match = testMatch;
|
|
27406
27660
|
}
|
|
27407
|
-
tagObj = match.find((
|
|
27661
|
+
tagObj = match.find((t2) => t2.format === item.format) ?? match.find((t2) => !t2.format);
|
|
27408
27662
|
} else {
|
|
27409
27663
|
obj = item;
|
|
27410
|
-
tagObj = tags.find((
|
|
27664
|
+
tagObj = tags.find((t2) => t2.nodeClass && obj instanceof t2.nodeClass);
|
|
27411
27665
|
}
|
|
27412
27666
|
if (!tagObj) {
|
|
27413
27667
|
const name2 = obj?.constructor?.name ?? (obj === null ? "null" : typeof obj);
|
|
@@ -28990,7 +29244,7 @@ var require_timestamp = __commonJS({
|
|
|
28990
29244
|
const sign = str[0];
|
|
28991
29245
|
const parts2 = sign === "-" || sign === "+" ? str.substring(1) : str;
|
|
28992
29246
|
const num = (n) => asBigInt ? BigInt(n) : Number(n);
|
|
28993
|
-
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));
|
|
28994
29248
|
return sign === "-" ? num(-1) * res : res;
|
|
28995
29249
|
}
|
|
28996
29250
|
function stringifySexagesimal(node2) {
|
|
@@ -30336,7 +30590,7 @@ var require_compose_collection = __commonJS({
|
|
|
30336
30590
|
if (!tagToken || !tagName || tagName === "!" || tagName === YAMLMap.YAMLMap.tagName && expType === "map" || tagName === YAMLSeq.YAMLSeq.tagName && expType === "seq") {
|
|
30337
30591
|
return resolveCollection(CN, ctx, token, onError, tagName);
|
|
30338
30592
|
}
|
|
30339
|
-
let tag = ctx.schema.tags.find((
|
|
30593
|
+
let tag = ctx.schema.tags.find((t2) => t2.tag === tagName && t2.collection === expType);
|
|
30340
30594
|
if (!tag) {
|
|
30341
30595
|
const kt = ctx.schema.knownTags[tagName];
|
|
30342
30596
|
if (kt?.collection === expType) {
|
|
@@ -32273,15 +32527,15 @@ var require_parser = __commonJS({
|
|
|
32273
32527
|
var node_process = __require("process");
|
|
32274
32528
|
var cst = require_cst();
|
|
32275
32529
|
var lexer = require_lexer();
|
|
32276
|
-
function includesToken(
|
|
32277
|
-
for (let i2 = 0; i2 <
|
|
32278
|
-
if (
|
|
32530
|
+
function includesToken(list2, type) {
|
|
32531
|
+
for (let i2 = 0; i2 < list2.length; ++i2)
|
|
32532
|
+
if (list2[i2].type === type)
|
|
32279
32533
|
return true;
|
|
32280
32534
|
return false;
|
|
32281
32535
|
}
|
|
32282
|
-
function findNonEmptyIndex(
|
|
32283
|
-
for (let i2 = 0; i2 <
|
|
32284
|
-
switch (
|
|
32536
|
+
function findNonEmptyIndex(list2) {
|
|
32537
|
+
for (let i2 = 0; i2 < list2.length; ++i2) {
|
|
32538
|
+
switch (list2[i2].type) {
|
|
32285
32539
|
case "space":
|
|
32286
32540
|
case "comment":
|
|
32287
32541
|
case "newline":
|
|
@@ -33308,7 +33562,7 @@ var VERSION;
|
|
|
33308
33562
|
var init_assets = __esm({
|
|
33309
33563
|
"src/assets.ts"() {
|
|
33310
33564
|
"use strict";
|
|
33311
|
-
VERSION = true ? "0.1.
|
|
33565
|
+
VERSION = true ? "0.1.136" : "0.0.0-dev";
|
|
33312
33566
|
}
|
|
33313
33567
|
});
|
|
33314
33568
|
|
|
@@ -34363,7 +34617,7 @@ function base64Decode(base64Str) {
|
|
|
34363
34617
|
}
|
|
34364
34618
|
function setFromBase64(bytes, base64Str) {
|
|
34365
34619
|
const table2 = getDecodeTable();
|
|
34366
|
-
let bytePos = 0, groupPos = 0, b,
|
|
34620
|
+
let bytePos = 0, groupPos = 0, b, p2 = 0;
|
|
34367
34621
|
for (let i2 = 0; i2 < base64Str.length; i2++) {
|
|
34368
34622
|
b = table2[base64Str.charCodeAt(i2)];
|
|
34369
34623
|
if (b === void 0) {
|
|
@@ -34384,21 +34638,21 @@ function setFromBase64(bytes, base64Str) {
|
|
|
34384
34638
|
}
|
|
34385
34639
|
switch (groupPos) {
|
|
34386
34640
|
case 0:
|
|
34387
|
-
|
|
34641
|
+
p2 = b;
|
|
34388
34642
|
groupPos = 1;
|
|
34389
34643
|
break;
|
|
34390
34644
|
case 1:
|
|
34391
|
-
bytes[bytePos++] =
|
|
34392
|
-
|
|
34645
|
+
bytes[bytePos++] = p2 << 2 | (b & 48) >> 4;
|
|
34646
|
+
p2 = b;
|
|
34393
34647
|
groupPos = 2;
|
|
34394
34648
|
break;
|
|
34395
34649
|
case 2:
|
|
34396
|
-
bytes[bytePos++] = (
|
|
34397
|
-
|
|
34650
|
+
bytes[bytePos++] = (p2 & 15) << 4 | (b & 60) >> 2;
|
|
34651
|
+
p2 = b;
|
|
34398
34652
|
groupPos = 3;
|
|
34399
34653
|
break;
|
|
34400
34654
|
case 3:
|
|
34401
|
-
bytes[bytePos++] = (
|
|
34655
|
+
bytes[bytePos++] = (p2 & 3) << 6 | b;
|
|
34402
34656
|
groupPos = 0;
|
|
34403
34657
|
break;
|
|
34404
34658
|
}
|
|
@@ -34607,11 +34861,11 @@ function unescapeBytesDefaultValue(str) {
|
|
|
34607
34861
|
case "6":
|
|
34608
34862
|
case "7": {
|
|
34609
34863
|
const s = input2.c;
|
|
34610
|
-
const
|
|
34611
|
-
if (
|
|
34864
|
+
const t2 = input2.take(2);
|
|
34865
|
+
if (t2 === false) {
|
|
34612
34866
|
return false;
|
|
34613
34867
|
}
|
|
34614
|
-
const n = parseInt(s +
|
|
34868
|
+
const n = parseInt(s + t2, 8);
|
|
34615
34869
|
if (Number.isNaN(n)) {
|
|
34616
34870
|
return false;
|
|
34617
34871
|
}
|
|
@@ -34620,11 +34874,11 @@ function unescapeBytesDefaultValue(str) {
|
|
|
34620
34874
|
}
|
|
34621
34875
|
case "x": {
|
|
34622
34876
|
const s = input2.c;
|
|
34623
|
-
const
|
|
34624
|
-
if (
|
|
34877
|
+
const t2 = input2.take(2);
|
|
34878
|
+
if (t2 === false) {
|
|
34625
34879
|
return false;
|
|
34626
34880
|
}
|
|
34627
|
-
const n = parseInt(s +
|
|
34881
|
+
const n = parseInt(s + t2, 16);
|
|
34628
34882
|
if (Number.isNaN(n)) {
|
|
34629
34883
|
return false;
|
|
34630
34884
|
}
|
|
@@ -34633,11 +34887,11 @@ function unescapeBytesDefaultValue(str) {
|
|
|
34633
34887
|
}
|
|
34634
34888
|
case "u": {
|
|
34635
34889
|
const s = input2.c;
|
|
34636
|
-
const
|
|
34637
|
-
if (
|
|
34890
|
+
const t2 = input2.take(4);
|
|
34891
|
+
if (t2 === false) {
|
|
34638
34892
|
return false;
|
|
34639
34893
|
}
|
|
34640
|
-
const n = parseInt(s +
|
|
34894
|
+
const n = parseInt(s + t2, 16);
|
|
34641
34895
|
if (Number.isNaN(n)) {
|
|
34642
34896
|
return false;
|
|
34643
34897
|
}
|
|
@@ -34649,11 +34903,11 @@ function unescapeBytesDefaultValue(str) {
|
|
|
34649
34903
|
}
|
|
34650
34904
|
case "U": {
|
|
34651
34905
|
const s = input2.c;
|
|
34652
|
-
const
|
|
34653
|
-
if (
|
|
34906
|
+
const t2 = input2.take(8);
|
|
34907
|
+
if (t2 === false) {
|
|
34654
34908
|
return false;
|
|
34655
34909
|
}
|
|
34656
|
-
const tc = protoInt64.uEnc(s +
|
|
34910
|
+
const tc = protoInt64.uEnc(s + t2);
|
|
34657
34911
|
const chunk = new Uint8Array(8);
|
|
34658
34912
|
const view = new DataView(chunk.buffer);
|
|
34659
34913
|
view.setInt32(0, tc.lo, true);
|
|
@@ -34802,24 +35056,24 @@ function createBaseRegistry() {
|
|
|
34802
35056
|
return files.get(fileName);
|
|
34803
35057
|
},
|
|
34804
35058
|
getMessage(typeName) {
|
|
34805
|
-
const
|
|
34806
|
-
return (
|
|
35059
|
+
const t2 = types.get(typeName);
|
|
35060
|
+
return (t2 === null || t2 === void 0 ? void 0 : t2.kind) == "message" ? t2 : void 0;
|
|
34807
35061
|
},
|
|
34808
35062
|
getEnum(typeName) {
|
|
34809
|
-
const
|
|
34810
|
-
return (
|
|
35063
|
+
const t2 = types.get(typeName);
|
|
35064
|
+
return (t2 === null || t2 === void 0 ? void 0 : t2.kind) == "enum" ? t2 : void 0;
|
|
34811
35065
|
},
|
|
34812
35066
|
getExtension(typeName) {
|
|
34813
|
-
const
|
|
34814
|
-
return (
|
|
35067
|
+
const t2 = types.get(typeName);
|
|
35068
|
+
return (t2 === null || t2 === void 0 ? void 0 : t2.kind) == "extension" ? t2 : void 0;
|
|
34815
35069
|
},
|
|
34816
35070
|
getExtensionFor(extendee, no) {
|
|
34817
35071
|
var _a3;
|
|
34818
35072
|
return (_a3 = extendees.get(extendee.typeName)) === null || _a3 === void 0 ? void 0 : _a3.get(no);
|
|
34819
35073
|
},
|
|
34820
35074
|
getService(typeName) {
|
|
34821
|
-
const
|
|
34822
|
-
return (
|
|
35075
|
+
const t2 = types.get(typeName);
|
|
35076
|
+
return (t2 === null || t2 === void 0 ? void 0 : t2.kind) == "service" ? t2 : void 0;
|
|
34823
35077
|
}
|
|
34824
35078
|
};
|
|
34825
35079
|
}
|
|
@@ -34937,19 +35191,19 @@ function addEnum(proto, file2, parent, reg) {
|
|
|
34937
35191
|
};
|
|
34938
35192
|
desc.open = isEnumOpen(desc);
|
|
34939
35193
|
reg.add(desc);
|
|
34940
|
-
for (const
|
|
34941
|
-
const name2 =
|
|
35194
|
+
for (const p2 of proto.value) {
|
|
35195
|
+
const name2 = p2.name;
|
|
34942
35196
|
desc.values.push(
|
|
34943
35197
|
// biome-ignore lint/suspicious/noAssignInExpressions: no
|
|
34944
|
-
desc.value[
|
|
35198
|
+
desc.value[p2.number] = {
|
|
34945
35199
|
kind: "enum_value",
|
|
34946
|
-
proto:
|
|
34947
|
-
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,
|
|
34948
35202
|
parent: desc,
|
|
34949
35203
|
name: name2,
|
|
34950
35204
|
localName: safeObjectProperty(sharedPrefix == void 0 ? name2 : name2.substring(sharedPrefix.length)),
|
|
34951
|
-
number:
|
|
34952
|
-
jsonName: (_e = findEnumValueJsonName(
|
|
35205
|
+
number: p2.number,
|
|
35206
|
+
jsonName: (_e = findEnumValueJsonName(p2)) !== null && _e !== void 0 ? _e : name2,
|
|
34953
35207
|
toString() {
|
|
34954
35208
|
return `enum value ${desc.typeName}.${name2}`;
|
|
34955
35209
|
}
|
|
@@ -40787,7 +41041,7 @@ ${JSON.stringify(symbolNames, null, 2)}`);
|
|
|
40787
41041
|
address += SIZE_OF_INT;
|
|
40788
41042
|
const captures = new Array(captureCount);
|
|
40789
41043
|
address = unmarshalCaptures(this, node2.tree, address, patternIndex, captures);
|
|
40790
|
-
if (this.textPredicates[patternIndex].every((
|
|
41044
|
+
if (this.textPredicates[patternIndex].every((p2) => p2(captures))) {
|
|
40791
41045
|
result[filteredCount] = { patternIndex, captures };
|
|
40792
41046
|
const setProperties = this.setProperties[patternIndex];
|
|
40793
41047
|
result[filteredCount].setProperties = setProperties;
|
|
@@ -40880,7 +41134,7 @@ ${JSON.stringify(symbolNames, null, 2)}`);
|
|
|
40880
41134
|
address += SIZE_OF_INT;
|
|
40881
41135
|
captures.length = captureCount;
|
|
40882
41136
|
address = unmarshalCaptures(this, node2.tree, address, patternIndex, captures);
|
|
40883
|
-
if (this.textPredicates[patternIndex].every((
|
|
41137
|
+
if (this.textPredicates[patternIndex].every((p2) => p2(captures))) {
|
|
40884
41138
|
const capture = captures[captureIndex];
|
|
40885
41139
|
const setProperties = this.setProperties[patternIndex];
|
|
40886
41140
|
capture.setProperties = setProperties;
|
|
@@ -41562,17 +41816,17 @@ function seedBlock(index, seed) {
|
|
|
41562
41816
|
const out2 = [`${seed.kind} ${where(seed)}`];
|
|
41563
41817
|
const heirs = index.heirs.get(seed.id);
|
|
41564
41818
|
const heritage = index.heritage.get(seed.id);
|
|
41565
|
-
const
|
|
41819
|
+
const list2 = (ids, limit) => {
|
|
41566
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));
|
|
41567
41821
|
return `${shown2.map((entry) => `${entry.name} ${entry.path}:${entry.line}`).join("; ")}${ids.length > limit ? `; (+${ids.length - limit} more, ${ids.length} total)` : ""}`;
|
|
41568
41822
|
};
|
|
41569
41823
|
if (heritage !== void 0) {
|
|
41570
|
-
if (heritage.extends.length > 0) out2.push(` extends: ${
|
|
41571
|
-
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)}`);
|
|
41572
41826
|
}
|
|
41573
41827
|
if (heirs !== void 0) {
|
|
41574
|
-
if (heirs.implementedBy.length > 0) out2.push(` implemented by: ${
|
|
41575
|
-
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)}`);
|
|
41576
41830
|
}
|
|
41577
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);
|
|
41578
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)` : ""}`);
|
|
@@ -44154,8 +44408,8 @@ function triState$1(schema, raw) {
|
|
|
44154
44408
|
message: String(parsed.error)
|
|
44155
44409
|
};
|
|
44156
44410
|
}
|
|
44157
|
-
function toolNeedsLegacyWrap(
|
|
44158
|
-
return isPlainObject$6(
|
|
44411
|
+
function toolNeedsLegacyWrap(t2) {
|
|
44412
|
+
return isPlainObject$6(t2) && isPlainObject$6(t2["outputSchema"]) && isNonObjectJsonSchemaRoot(t2["outputSchema"]);
|
|
44159
44413
|
}
|
|
44160
44414
|
function toNeutralResult(value) {
|
|
44161
44415
|
return value;
|
|
@@ -45417,7 +45671,7 @@ function isProvablyObjectShapedRoot(schema) {
|
|
|
45417
45671
|
}
|
|
45418
45672
|
function formatIssue(issue2) {
|
|
45419
45673
|
if (!issue2.path?.length) return issue2.message;
|
|
45420
|
-
return `${issue2.path.map((
|
|
45674
|
+
return `${issue2.path.map((p2) => String(typeof p2 === "object" ? p2.key : p2)).join(".")}: ${issue2.message}`;
|
|
45421
45675
|
}
|
|
45422
45676
|
async function validateStandardSchema(schema, data) {
|
|
45423
45677
|
const result = await schema["~standard"].validate(data);
|
|
@@ -46032,13 +46286,13 @@ var init_src_CX2iR2pK = __esm({
|
|
|
46032
46286
|
encodeResult(method, result) {
|
|
46033
46287
|
if (method !== "tools/list") return result;
|
|
46034
46288
|
const tools = result.tools;
|
|
46035
|
-
if (!Array.isArray(tools) || !tools.some((
|
|
46289
|
+
if (!Array.isArray(tools) || !tools.some((t2) => toolNeedsLegacyWrap(t2))) return result;
|
|
46036
46290
|
return {
|
|
46037
46291
|
...result,
|
|
46038
|
-
tools: tools.map((
|
|
46039
|
-
...
|
|
46040
|
-
outputSchema: wrapOutputSchemaForLegacy(
|
|
46041
|
-
} :
|
|
46292
|
+
tools: tools.map((t2) => toolNeedsLegacyWrap(t2) ? {
|
|
46293
|
+
...t2,
|
|
46294
|
+
outputSchema: wrapOutputSchemaForLegacy(t2.outputSchema)
|
|
46295
|
+
} : t2)
|
|
46042
46296
|
};
|
|
46043
46297
|
},
|
|
46044
46298
|
encodeErrorCode: (code2) => code2 === -32002 ? -32602 : code2,
|
|
@@ -47704,7 +47958,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
47704
47958
|
};
|
|
47705
47959
|
exports._CodeOrName = _CodeOrName;
|
|
47706
47960
|
exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
|
|
47707
|
-
var
|
|
47961
|
+
var Name3 = class extends _CodeOrName {
|
|
47708
47962
|
constructor(s) {
|
|
47709
47963
|
super();
|
|
47710
47964
|
if (!exports.IDENTIFIER.test(s)) throw new Error("CodeGen: name must be a valid identifier");
|
|
@@ -47720,7 +47974,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
47720
47974
|
return { [this.str]: 1 };
|
|
47721
47975
|
}
|
|
47722
47976
|
};
|
|
47723
|
-
exports.Name =
|
|
47977
|
+
exports.Name = Name3;
|
|
47724
47978
|
var _Code = class extends _CodeOrName {
|
|
47725
47979
|
constructor(code2) {
|
|
47726
47980
|
super();
|
|
@@ -47741,7 +47995,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
47741
47995
|
get names() {
|
|
47742
47996
|
var _a3;
|
|
47743
47997
|
return (_a3 = this._names) !== null && _a3 !== void 0 ? _a3 : this._names = this._items.reduce((names, c) => {
|
|
47744
|
-
if (c instanceof
|
|
47998
|
+
if (c instanceof Name3) names[c.str] = (names[c.str] || 0) + 1;
|
|
47745
47999
|
return names;
|
|
47746
48000
|
}, {});
|
|
47747
48001
|
}
|
|
@@ -47773,7 +48027,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
47773
48027
|
exports.str = str;
|
|
47774
48028
|
function addCodeArg(code2, arg4) {
|
|
47775
48029
|
if (arg4 instanceof _Code) code2.push(...arg4._items);
|
|
47776
|
-
else if (arg4 instanceof
|
|
48030
|
+
else if (arg4 instanceof Name3) code2.push(arg4);
|
|
47777
48031
|
else code2.push(interpolate(arg4));
|
|
47778
48032
|
}
|
|
47779
48033
|
exports.addCodeArg = addCodeArg;
|
|
@@ -47795,12 +48049,12 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
47795
48049
|
if (b === '""') return a;
|
|
47796
48050
|
if (a === '""') return b;
|
|
47797
48051
|
if (typeof a == "string") {
|
|
47798
|
-
if (b instanceof
|
|
48052
|
+
if (b instanceof Name3 || a[a.length - 1] !== '"') return;
|
|
47799
48053
|
if (typeof b != "string") return `${a.slice(0, -1)}${b}"`;
|
|
47800
48054
|
if (b[0] === '"') return a.slice(0, -1) + b.slice(1);
|
|
47801
48055
|
return;
|
|
47802
48056
|
}
|
|
47803
|
-
if (typeof b == "string" && b[0] === '"' && !(a instanceof
|
|
48057
|
+
if (typeof b == "string" && b[0] === '"' && !(a instanceof Name3)) return `"${a}${b.slice(1)}`;
|
|
47804
48058
|
}
|
|
47805
48059
|
function strConcat(c1, c2) {
|
|
47806
48060
|
return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`;
|
|
@@ -48743,7 +48997,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
48743
48997
|
}
|
|
48744
48998
|
exports.evaluatedPropsToName = evaluatedPropsToName;
|
|
48745
48999
|
function setEvaluated(gen, props, ps) {
|
|
48746
|
-
Object.keys(ps).forEach((
|
|
49000
|
+
Object.keys(ps).forEach((p2) => gen.assign((0, codegen_1._)`${props}${(0, codegen_1.getProperty)(p2)}`, true));
|
|
48747
49001
|
}
|
|
48748
49002
|
exports.setEvaluated = setEvaluated;
|
|
48749
49003
|
const snippets = {};
|
|
@@ -49057,7 +49311,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
49057
49311
|
"null"
|
|
49058
49312
|
]);
|
|
49059
49313
|
function coerceToTypes(types, coerceTypes) {
|
|
49060
|
-
return coerceTypes ? types.filter((
|
|
49314
|
+
return coerceTypes ? types.filter((t2) => COERCIBLE.has(t2) || coerceTypes === "array" && t2 === "array") : [];
|
|
49061
49315
|
}
|
|
49062
49316
|
function coerceData(it, types, coerceTo) {
|
|
49063
49317
|
const { gen, data, opts } = it;
|
|
@@ -49065,7 +49319,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
49065
49319
|
const coerced = gen.let("coerced", (0, codegen_1._)`undefined`);
|
|
49066
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)));
|
|
49067
49321
|
gen.if((0, codegen_1._)`${coerced} !== undefined`);
|
|
49068
|
-
for (const
|
|
49322
|
+
for (const t2 of coerceTo) if (COERCIBLE.has(t2) || t2 === "array" && opts.coerceTypes === "array") coerceSpecificType(t2);
|
|
49069
49323
|
gen.else();
|
|
49070
49324
|
reportTypeError(it);
|
|
49071
49325
|
gen.endIf();
|
|
@@ -49073,8 +49327,8 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
49073
49327
|
gen.assign(data, coerced);
|
|
49074
49328
|
assignParentData(it, coerced);
|
|
49075
49329
|
});
|
|
49076
|
-
function coerceSpecificType(
|
|
49077
|
-
switch (
|
|
49330
|
+
function coerceSpecificType(t2) {
|
|
49331
|
+
switch (t2) {
|
|
49078
49332
|
case "string":
|
|
49079
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._)`""`);
|
|
49080
49334
|
return;
|
|
@@ -49141,7 +49395,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
49141
49395
|
delete types.object;
|
|
49142
49396
|
} else cond = codegen_1.nil;
|
|
49143
49397
|
if (types.number) delete types.integer;
|
|
49144
|
-
for (const
|
|
49398
|
+
for (const t2 in types) cond = (0, codegen_1.and)(cond, checkDataType(t2, data, strictNums, correct));
|
|
49145
49399
|
return cond;
|
|
49146
49400
|
}
|
|
49147
49401
|
exports.checkDataTypes = checkDataTypes;
|
|
@@ -49240,11 +49494,11 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
49240
49494
|
}
|
|
49241
49495
|
exports.noPropertyInData = noPropertyInData;
|
|
49242
49496
|
function allSchemaProperties(schemaMap) {
|
|
49243
|
-
return schemaMap ? Object.keys(schemaMap).filter((
|
|
49497
|
+
return schemaMap ? Object.keys(schemaMap).filter((p2) => p2 !== "__proto__") : [];
|
|
49244
49498
|
}
|
|
49245
49499
|
exports.allSchemaProperties = allSchemaProperties;
|
|
49246
49500
|
function schemaProperties(it, schemaMap) {
|
|
49247
|
-
return allSchemaProperties(schemaMap).filter((
|
|
49501
|
+
return allSchemaProperties(schemaMap).filter((p2) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p2]));
|
|
49248
49502
|
}
|
|
49249
49503
|
exports.schemaProperties = schemaProperties;
|
|
49250
49504
|
function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func2, context4, passSchema) {
|
|
@@ -49649,8 +49903,8 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
49649
49903
|
return _getFullPath(resolver, resolver.parse(id2));
|
|
49650
49904
|
}
|
|
49651
49905
|
exports.getFullPath = getFullPath;
|
|
49652
|
-
function _getFullPath(resolver,
|
|
49653
|
-
return resolver.serialize(
|
|
49906
|
+
function _getFullPath(resolver, p2) {
|
|
49907
|
+
return resolver.serialize(p2).split("#")[0] + "#";
|
|
49654
49908
|
}
|
|
49655
49909
|
exports._getFullPath = _getFullPath;
|
|
49656
49910
|
const TRAILING_SLASH_HASH = /#\/?$/;
|
|
@@ -49903,8 +50157,8 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
49903
50157
|
it.dataTypes = types;
|
|
49904
50158
|
return;
|
|
49905
50159
|
}
|
|
49906
|
-
types.forEach((
|
|
49907
|
-
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(",")}"`);
|
|
49908
50162
|
});
|
|
49909
50163
|
narrowSchemaTypes(it, types);
|
|
49910
50164
|
}
|
|
@@ -49917,20 +50171,20 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
49917
50171
|
const rule = rules[keyword];
|
|
49918
50172
|
if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) {
|
|
49919
50173
|
const { type } = rule.definition;
|
|
49920
|
-
if (type.length && !type.some((
|
|
50174
|
+
if (type.length && !type.some((t2) => hasApplicableType(ts, t2))) strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`);
|
|
49921
50175
|
}
|
|
49922
50176
|
}
|
|
49923
50177
|
}
|
|
49924
50178
|
function hasApplicableType(schTs, kwdT) {
|
|
49925
50179
|
return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer");
|
|
49926
50180
|
}
|
|
49927
|
-
function includesType(ts,
|
|
49928
|
-
return ts.includes(
|
|
50181
|
+
function includesType(ts, t2) {
|
|
50182
|
+
return ts.includes(t2) || t2 === "integer" && ts.includes("number");
|
|
49929
50183
|
}
|
|
49930
50184
|
function narrowSchemaTypes(it, withTypes) {
|
|
49931
50185
|
const ts = [];
|
|
49932
|
-
for (const
|
|
49933
|
-
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");
|
|
49934
50188
|
it.dataTypes = ts;
|
|
49935
50189
|
}
|
|
49936
50190
|
function strictTypesError(it, msg) {
|
|
@@ -50301,16 +50555,16 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
50301
50555
|
return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);
|
|
50302
50556
|
}
|
|
50303
50557
|
function resolveSchema(root, ref) {
|
|
50304
|
-
const
|
|
50305
|
-
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);
|
|
50306
50560
|
let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, void 0);
|
|
50307
|
-
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);
|
|
50308
50562
|
const id2 = (0, resolve_1.normalizeId)(refPath);
|
|
50309
50563
|
const schOrRef = this.refs[id2] || this.schemas[id2];
|
|
50310
50564
|
if (typeof schOrRef == "string") {
|
|
50311
50565
|
const sch = resolveSchema.call(this, root, schOrRef);
|
|
50312
50566
|
if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object") return;
|
|
50313
|
-
return getJsonPointer.call(this,
|
|
50567
|
+
return getJsonPointer.call(this, p2, sch);
|
|
50314
50568
|
}
|
|
50315
50569
|
if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object") return;
|
|
50316
50570
|
if (!schOrRef.validate) compileSchema.call(this, schOrRef);
|
|
@@ -50326,7 +50580,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
50326
50580
|
baseId
|
|
50327
50581
|
});
|
|
50328
50582
|
}
|
|
50329
|
-
return getJsonPointer.call(this,
|
|
50583
|
+
return getJsonPointer.call(this, p2, schOrRef);
|
|
50330
50584
|
}
|
|
50331
50585
|
exports.resolveSchema = resolveSchema;
|
|
50332
50586
|
const PREVENT_SCOPE_CHANGE = /* @__PURE__ */ new Set([
|
|
@@ -51168,8 +51422,8 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
51168
51422
|
if (!this.refs[ref]) this.addSchema(_schema, ref, meta3);
|
|
51169
51423
|
}
|
|
51170
51424
|
async function _loadSchema(ref) {
|
|
51171
|
-
const
|
|
51172
|
-
if (
|
|
51425
|
+
const p2 = this._loading[ref];
|
|
51426
|
+
if (p2) return p2;
|
|
51173
51427
|
try {
|
|
51174
51428
|
return await (this._loading[ref] = loadSchema(ref));
|
|
51175
51429
|
} finally {
|
|
@@ -51293,7 +51547,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
51293
51547
|
type: (0, dataType_1.getJSONTypes)(def.type),
|
|
51294
51548
|
schemaType: (0, dataType_1.getJSONTypes)(def.schemaType)
|
|
51295
51549
|
};
|
|
51296
|
-
(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)));
|
|
51297
51551
|
return this;
|
|
51298
51552
|
}
|
|
51299
51553
|
getKeyword(keyword) {
|
|
@@ -51463,7 +51717,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
51463
51717
|
const post2 = definition === null || definition === void 0 ? void 0 : definition.post;
|
|
51464
51718
|
if (dataType && post2) throw new Error('keyword with "post" flag cannot have "type"');
|
|
51465
51719
|
const { RULES } = this;
|
|
51466
|
-
let ruleGroup = post2 ? RULES.post : RULES.rules.find(({ type:
|
|
51720
|
+
let ruleGroup = post2 ? RULES.post : RULES.rules.find(({ type: t2 }) => t2 === dataType);
|
|
51467
51721
|
if (!ruleGroup) {
|
|
51468
51722
|
ruleGroup = {
|
|
51469
51723
|
type: dataType,
|
|
@@ -51923,7 +52177,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
51923
52177
|
gen.if((0, codegen_1._)`${i2} > 1`, () => (canOptimize() ? loopN : loopN2)(i2, j));
|
|
51924
52178
|
}
|
|
51925
52179
|
function canOptimize() {
|
|
51926
|
-
return itemTypes.length > 0 && !itemTypes.some((
|
|
52180
|
+
return itemTypes.length > 0 && !itemTypes.some((t2) => t2 === "object" || t2 === "array");
|
|
51927
52181
|
}
|
|
51928
52182
|
function loopN(i2, j) {
|
|
51929
52183
|
const item = gen.name("item");
|
|
@@ -52420,9 +52674,9 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
52420
52674
|
if (props.length > 8) {
|
|
52421
52675
|
const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties");
|
|
52422
52676
|
definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key);
|
|
52423
|
-
} 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}`));
|
|
52424
52678
|
else definedProp = codegen_1.nil;
|
|
52425
|
-
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})`));
|
|
52426
52680
|
return (0, codegen_1.not)(definedProp);
|
|
52427
52681
|
}
|
|
52428
52682
|
function deleteAdditional(key) {
|
|
@@ -52486,7 +52740,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
52486
52740
|
const allProps = (0, code_1.allSchemaProperties)(schema);
|
|
52487
52741
|
for (const prop of allProps) it.definedProperties.add(prop);
|
|
52488
52742
|
if (it.opts.unevaluated && allProps.length && it.props !== true) it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);
|
|
52489
|
-
const properties = allProps.filter((
|
|
52743
|
+
const properties = allProps.filter((p2) => !(0, util_1.alwaysValidSchema)(it, schema[p2]));
|
|
52490
52744
|
if (properties.length === 0) return;
|
|
52491
52745
|
const valid = gen.name("valid");
|
|
52492
52746
|
for (const prop of properties) {
|
|
@@ -52528,7 +52782,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
52528
52782
|
const { gen, schema, data, parentSchema, it } = cxt;
|
|
52529
52783
|
const { opts } = it;
|
|
52530
52784
|
const patterns = (0, code_1.allSchemaProperties)(schema);
|
|
52531
|
-
const alwaysValidPatterns = patterns.filter((
|
|
52785
|
+
const alwaysValidPatterns = patterns.filter((p2) => (0, util_1.alwaysValidSchema)(it, schema[p2]));
|
|
52532
52786
|
if (patterns.length === 0 || alwaysValidPatterns.length === patterns.length && (!it.opts.unevaluated || it.props === true)) return;
|
|
52533
52787
|
const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties;
|
|
52534
52788
|
const valid = gen.name("valid");
|
|
@@ -53436,7 +53690,7 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
53436
53690
|
}
|
|
53437
53691
|
function unevaluatedStatic(evaluatedProps, key) {
|
|
53438
53692
|
const ps = [];
|
|
53439
|
-
for (const
|
|
53693
|
+
for (const p2 in evaluatedProps) if (evaluatedProps[p2] === true) ps.push((0, codegen_1._)`${key} !== ${p2}`);
|
|
53440
53694
|
return (0, codegen_1.and)(...ps);
|
|
53441
53695
|
}
|
|
53442
53696
|
}
|
|
@@ -54623,11 +54877,11 @@ var init_ajvProvider_CEoC_sr = __esm({
|
|
|
54623
54877
|
if (!f) throw new Error(`Unknown format "${name2}"`);
|
|
54624
54878
|
return f;
|
|
54625
54879
|
};
|
|
54626
|
-
function addFormats2(ajv,
|
|
54880
|
+
function addFormats2(ajv, list2, fs2, exportName) {
|
|
54627
54881
|
var _a3;
|
|
54628
54882
|
var _b;
|
|
54629
54883
|
(_a3 = (_b = ajv.opts.code).formats) !== null && _a3 !== void 0 || (_b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`);
|
|
54630
|
-
for (const f of
|
|
54884
|
+
for (const f of list2) ajv.addFormat(f, fs2[f]);
|
|
54631
54885
|
}
|
|
54632
54886
|
module2.exports = exports = formatsPlugin;
|
|
54633
54887
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -55877,7 +56131,7 @@ var init_mcp_DXXb3Vv3 = __esm({
|
|
|
55877
56131
|
return createCompletionResult(await completer(request.params.argument.value, request.params.context));
|
|
55878
56132
|
}
|
|
55879
56133
|
async handleResourceCompletion(request, ref) {
|
|
55880
|
-
const template = Object.values(this._registeredResourceTemplates).find((
|
|
56134
|
+
const template = Object.values(this._registeredResourceTemplates).find((t2) => t2.resourceTemplate.uriTemplate.toString() === ref.uri);
|
|
55881
56135
|
if (!template) {
|
|
55882
56136
|
if (this._registeredResources[ref.uri]) return EMPTY_COMPLETION_RESULT;
|
|
55883
56137
|
throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Resource template ${request.params.ref.uri} not found`);
|
|
@@ -57183,7 +57437,7 @@ function localSymbolHits(shards, keep) {
|
|
|
57183
57437
|
async function symbolsOverview(deps, args2) {
|
|
57184
57438
|
const state = deps.state();
|
|
57185
57439
|
const scope = args2.path;
|
|
57186
|
-
const dirty2 = await parseDirty(deps.index, state, (
|
|
57440
|
+
const dirty2 = await parseDirty(deps.index, state, (p2) => isUnder(p2, scope));
|
|
57187
57441
|
const cloud = await deps.cloud.query("symbols_overview", state.head, args2, SymbolAnswer);
|
|
57188
57442
|
const local2 = localSymbolHits(dirty2.shards, (shard, i2) => shard.symbols[i2]?.parent === void 0);
|
|
57189
57443
|
const base4 = cloud.kind === "ok" ? cloudSymbols(cloud.data.symbols, state).filter((hit) => isUnder(hit.path, scope)) : [];
|
|
@@ -57390,9 +57644,9 @@ async function renameSymbol(deps, args2) {
|
|
|
57390
57644
|
const targets = [{ path: args2.path, range: found.symbol.range }, ...answer.references.map((hit) => ({ path: hit.path, range: hit.range }))];
|
|
57391
57645
|
const byFile = /* @__PURE__ */ new Map();
|
|
57392
57646
|
for (const target2 of targets) {
|
|
57393
|
-
const
|
|
57394
|
-
if (!
|
|
57395
|
-
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);
|
|
57396
57650
|
}
|
|
57397
57651
|
const plan3 = [];
|
|
57398
57652
|
for (const [path, ranges] of byFile) {
|
|
@@ -58256,7 +58510,7 @@ function readTables(text) {
|
|
|
58256
58510
|
return tables;
|
|
58257
58511
|
}
|
|
58258
58512
|
function findTable(text, path) {
|
|
58259
|
-
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;
|
|
58260
58514
|
}
|
|
58261
58515
|
function isTrue(body2, key) {
|
|
58262
58516
|
return new RegExp(`^\\s*${key}\\s*=\\s*true\\s*(?:#.*)?$`, "m").test(body2);
|
|
@@ -61536,8 +61790,8 @@ function stop2(deps, reason, detail) {
|
|
|
61536
61790
|
function budgetStop(deps, state) {
|
|
61537
61791
|
const { policy } = state;
|
|
61538
61792
|
if (state.tasksClaimed.length >= policy.maxTasksPerRun) return { reason: "budget_tasks", detail: `${state.tasksClaimed.length} of ${policy.maxTasksPerRun} tasks claimed` };
|
|
61539
|
-
const
|
|
61540
|
-
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` };
|
|
61541
61795
|
return usageStop(deps, state.executor, policy);
|
|
61542
61796
|
}
|
|
61543
61797
|
function usageStop(deps, executor, policy) {
|
|
@@ -61837,8 +62091,8 @@ async function runStatus(deps, input2) {
|
|
|
61837
62091
|
if (run3 === null) {
|
|
61838
62092
|
say(deps, "No active run in this working copy.");
|
|
61839
62093
|
} else {
|
|
61840
|
-
const
|
|
61841
|
-
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}`);
|
|
61842
62096
|
const usage = run3.executor === "claude-code" ? currentUsagePercent(readUsage(deps), deps.now()) : null;
|
|
61843
62097
|
if (usage !== null) say(deps, `Usage: ${usage.label} ${Math.round(usage.percent)}% (stop at ${run3.policy.maxUsageWindowPercent}%)`);
|
|
61844
62098
|
const budget = budgetStop(deps, run3);
|
|
@@ -61851,7 +62105,7 @@ async function runStatus(deps, input2) {
|
|
|
61851
62105
|
executor: run3.executor,
|
|
61852
62106
|
tasksClaimed: run3.tasksClaimed.length,
|
|
61853
62107
|
maxTasks: run3.policy.maxTasksPerRun,
|
|
61854
|
-
minutesUsed:
|
|
62108
|
+
minutesUsed: minutes2,
|
|
61855
62109
|
maxMinutes: run3.policy.maxMinutesPerRun,
|
|
61856
62110
|
...usage === null ? {} : { usage: { label: usage.label, percent: Math.round(usage.percent), stopAt: run3.policy.maxUsageWindowPercent } }
|
|
61857
62111
|
};
|
|
@@ -62302,7 +62556,7 @@ var libAddCommand = defineCommand({
|
|
|
62302
62556
|
}
|
|
62303
62557
|
});
|
|
62304
62558
|
const body2 = { library: libraryArg(inv), ecosystem: textFlag(inv, "ecosystem") ?? "npm", version: version2, pages };
|
|
62305
|
-
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");
|
|
62306
62560
|
const { call: call2 } = await authed(inv);
|
|
62307
62561
|
const tenantId = await tenantOf(call2, inv);
|
|
62308
62562
|
const result = await call2(DocsPrivateResult, "POST", docsPaths.private(tenantId), body2);
|
|
@@ -62584,7 +62838,7 @@ var teamListCommand = defineCommand({
|
|
|
62584
62838
|
needsNetwork: true,
|
|
62585
62839
|
keywords: ["teams", "organisations", "organizations", "workspaces", "my role", "members", "which team"],
|
|
62586
62840
|
result: TeamListResult,
|
|
62587
|
-
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}`],
|
|
62588
62842
|
handler: async (inv) => {
|
|
62589
62843
|
const { call: call2 } = await authed2(inv);
|
|
62590
62844
|
const me = await call2(WhoAmI, "GET", apiPaths.whoami);
|
|
@@ -62691,12 +62945,12 @@ var tokenListCommand = defineCommand({
|
|
|
62691
62945
|
needsNetwork: true,
|
|
62692
62946
|
keywords: ["agent tokens", "list tokens", "api keys", "credentials", "who has access"],
|
|
62693
62947
|
result: TokenListResult,
|
|
62694
|
-
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"}`),
|
|
62695
62949
|
handler: async (inv) => {
|
|
62696
62950
|
const { call: call2 } = await authed2(inv);
|
|
62697
62951
|
const tenantId = await tenantOf2(call2, inv);
|
|
62698
62952
|
const listed = await call2(external_exports.object({ tokens: external_exports.array(AgentToken) }), "GET", `/v1/tenants/${encodeURIComponent(tenantId)}/tokens`);
|
|
62699
|
-
return { data: { tenantId, tokens: listed.tokens.map((
|
|
62953
|
+
return { data: { tenantId, tokens: listed.tokens.map((t2) => ({ ...shape(t2), createdBy: t2.createdBy })) } };
|
|
62700
62954
|
}
|
|
62701
62955
|
});
|
|
62702
62956
|
var tokenRevokeCommand = defineCommand({
|
|
@@ -63142,7 +63396,7 @@ var repoDeleteCommand = defineCommand({
|
|
|
63142
63396
|
text: (d) => "deleted" in d ? [`Deleted ${d.repoId}.`] : [],
|
|
63143
63397
|
handler: async (inv) => {
|
|
63144
63398
|
const repo = arg(inv, 0, "a repository", "overlane repo list");
|
|
63145
|
-
if (inv.dryRun) return planned2(inv, "repo", "DELETE", (
|
|
63399
|
+
if (inv.dryRun) return planned2(inv, "repo", "DELETE", (t2, p2) => gitPaths.repo(t2, p2, repo));
|
|
63146
63400
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63147
63401
|
return { data: await call2(DeleteRepoResponse, "DELETE", gitPaths.repo(tenantId, projectId, repo), void 0, approvalHeaders(inv)) };
|
|
63148
63402
|
},
|
|
@@ -63180,7 +63434,7 @@ var repoBranchCreateCommand = defineCommand({
|
|
|
63180
63434
|
const repo = arg(inv, 0, "a repository", "overlane repo list");
|
|
63181
63435
|
const from = textFlag(inv, "from");
|
|
63182
63436
|
const body2 = { name: arg(inv, 1, "a branch name", "overlane repo branch create app feature/x"), ...from === void 0 ? {} : { from } };
|
|
63183
|
-
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);
|
|
63184
63438
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63185
63439
|
return { data: await call2(external_exports.object({ name: external_exports.string(), sha: external_exports.string() }).strict(), "POST", gitPaths.branches(tenantId, projectId, repo), body2) };
|
|
63186
63440
|
}
|
|
@@ -63199,7 +63453,7 @@ var repoBranchDeleteCommand = defineCommand({
|
|
|
63199
63453
|
handler: async (inv) => {
|
|
63200
63454
|
const repo = arg(inv, 0, "a repository", "overlane repo list");
|
|
63201
63455
|
const name2 = arg(inv, 1, "a branch name", "overlane repo branches app");
|
|
63202
|
-
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));
|
|
63203
63457
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63204
63458
|
return { data: await call2(external_exports.object({ name: external_exports.string() }).strict(), "DELETE", gitPaths.branch(tenantId, projectId, repo, name2), void 0, approvalHeaders(inv)) };
|
|
63205
63459
|
},
|
|
@@ -63256,7 +63510,7 @@ var repoPushCommand = defineCommand({
|
|
|
63256
63510
|
const body2 = (expectedOld) => ({ requestId: requestId4(), ref: branch, expectedOld, force: boolFlag(inv, "rewrite"), ...parent === void 0 ? {} : { parent }, commits: [{ message, files }] });
|
|
63257
63511
|
if (inv.dryRun) {
|
|
63258
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>` })) }] };
|
|
63259
|
-
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");
|
|
63260
63514
|
}
|
|
63261
63515
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63262
63516
|
let expected = textFlag(inv, "expect") ?? null;
|
|
@@ -63292,7 +63546,7 @@ var repoProtectCommand = defineCommand({
|
|
|
63292
63546
|
const methods = listFlag(inv, "merge-method");
|
|
63293
63547
|
const body2 = { pattern, ...approvals === void 0 ? {} : { requiredApprovals: Number(approvals) }, requiredChecks: listFlag(inv, "check"), ...methods.length === 0 ? {} : { allowedMergeMethods: methods } };
|
|
63294
63548
|
if (approvals !== void 0 && (!/^\d+$/.test(approvals) || Number(approvals) > 10)) throw new UsageError("--approvals must be a number from 0 to 10");
|
|
63295
|
-
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);
|
|
63296
63550
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63297
63551
|
return { data: await call2(BranchProtection, "PUT", gitPaths.protection(tenantId, projectId, repo), body2) };
|
|
63298
63552
|
}
|
|
@@ -63333,14 +63587,14 @@ var repoTokenCommand = defineCommand({
|
|
|
63333
63587
|
const repo = arg(inv, 0, "a repository", "overlane repo list");
|
|
63334
63588
|
const ttl = positive(textFlag(inv, "ttl"), "ttl");
|
|
63335
63589
|
const body2 = { scope: textFlag(inv, "scope") ?? "write", ...ttl === void 0 ? {} : { ttlSeconds: ttl } };
|
|
63336
|
-
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);
|
|
63337
63591
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63338
63592
|
return { data: await call2(GitTokenGrant, "POST", gitPaths.tokens(tenantId, projectId, repo), body2) };
|
|
63339
63593
|
}
|
|
63340
63594
|
});
|
|
63341
63595
|
var repoTokenRevokeCommand = defineCommand({
|
|
63342
63596
|
path: ["repo", "token", "revoke"],
|
|
63343
|
-
summary: "
|
|
63597
|
+
summary: "Stop a repository git push credential from working",
|
|
63344
63598
|
description: "Revokes a token at once; any clone or push using it is refused from the next call.",
|
|
63345
63599
|
args: [REPO_ARG_LATE, { name: "token-id", required: false, description: "The token ID shown when it was minted (required)" }],
|
|
63346
63600
|
examples: ["overlane repo token revoke app gtk_abc123 --force"],
|
|
@@ -63352,7 +63606,7 @@ var repoTokenRevokeCommand = defineCommand({
|
|
|
63352
63606
|
handler: async (inv) => {
|
|
63353
63607
|
const repo = arg(inv, 0, "a repository", "overlane repo list");
|
|
63354
63608
|
const id2 = arg(inv, 1, "a token ID", "overlane repo token app");
|
|
63355
|
-
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));
|
|
63356
63610
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63357
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)) };
|
|
63358
63612
|
}
|
|
@@ -63373,7 +63627,7 @@ var repoMirrorSetCommand = defineCommand({
|
|
|
63373
63627
|
const repo = arg(inv, 0, "a repository", "overlane repo list");
|
|
63374
63628
|
const writable = textFlag(inv, "writable");
|
|
63375
63629
|
if (writable === void 0) throw new UsageError("--writable is required", { hint: "overlane repo mirror set app --writable overlane" });
|
|
63376
|
-
const path = (
|
|
63630
|
+
const path = (t2, p2) => `${gitPaths.repo(t2, p2, repo)}/mirror`;
|
|
63377
63631
|
if (inv.dryRun) return planned2(inv, "repo", "PUT", path, { writable });
|
|
63378
63632
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63379
63633
|
return { data: await call2(Repo, "PUT", path(tenantId, projectId), { writable }) };
|
|
@@ -63392,7 +63646,7 @@ var repoSyncCommand = defineCommand({
|
|
|
63392
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`}.`] : [],
|
|
63393
63647
|
handler: async (inv) => {
|
|
63394
63648
|
const repo = arg(inv, 0, "a repository", "overlane repo list");
|
|
63395
|
-
const path = (
|
|
63649
|
+
const path = (t2, p2) => gitPaths.sync(t2, p2, repo);
|
|
63396
63650
|
if (inv.dryRun) return planned2(inv, "repo", "POST", path);
|
|
63397
63651
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63398
63652
|
return { data: await call2(MirrorSyncResponse, "POST", path(tenantId, projectId)) };
|
|
@@ -63428,7 +63682,7 @@ var repoIndexRunCommand = defineCommand({
|
|
|
63428
63682
|
text: (d) => "applied" in d ? [`${d.applied} job(s) applied, ${d.ignored} ignored as stale.`] : [],
|
|
63429
63683
|
handler: async (inv) => {
|
|
63430
63684
|
const repo = arg(inv, 0, "a repository", "overlane repo list");
|
|
63431
|
-
const path = (
|
|
63685
|
+
const path = (t2, p2) => gitPaths.index(t2, p2, repo);
|
|
63432
63686
|
if (inv.dryRun) return planned2(inv, "repo", "POST", path);
|
|
63433
63687
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63434
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)) };
|
|
@@ -63494,7 +63748,7 @@ var prOpenCommand = defineCommand({
|
|
|
63494
63748
|
const base4 = textFlag(inv, "base");
|
|
63495
63749
|
const text = textFlag(inv, "body");
|
|
63496
63750
|
const body2 = { requestId: requestId4(), title, head, ...base4 === void 0 ? {} : { base: base4 }, ...text === void 0 ? {} : { body: text }, draft: boolFlag(inv, "draft") };
|
|
63497
|
-
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);
|
|
63498
63752
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63499
63753
|
return { data: await call2(PullRequest, "POST", gitPaths.pulls(tenantId, projectId, repo), body2) };
|
|
63500
63754
|
}
|
|
@@ -63520,7 +63774,7 @@ var prReviewCommand = defineCommand({
|
|
|
63520
63774
|
const state = textFlag(inv, "state");
|
|
63521
63775
|
if (state === void 0) throw new UsageError("--state is required", { hint: "overlane repo pr review app 7 --state approved" });
|
|
63522
63776
|
const body2 = { requestId: requestId4(), state, body: textFlag(inv, "body") ?? "" };
|
|
63523
|
-
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);
|
|
63524
63778
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63525
63779
|
return { data: await call2(PullReview, "POST", gitPaths.reviews(tenantId, projectId, repo, number4), body2) };
|
|
63526
63780
|
}
|
|
@@ -63541,7 +63795,7 @@ var prMergeCommand = defineCommand({
|
|
|
63541
63795
|
const repo = arg(inv, 0, "a repository", "overlane repo list");
|
|
63542
63796
|
const number4 = pullNumber(inv, 1, "overlane repo pr list app");
|
|
63543
63797
|
const body2 = { requestId: requestId4(), method: textFlag(inv, "method") ?? "squash" };
|
|
63544
|
-
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);
|
|
63545
63799
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63546
63800
|
return { data: await call2(MergeResult, "POST", gitPaths.merge(tenantId, projectId, repo, number4), body2, approvalHeaders(inv)) };
|
|
63547
63801
|
}
|
|
@@ -63560,7 +63814,7 @@ var prCloseCommand = defineCommand({
|
|
|
63560
63814
|
handler: async (inv) => {
|
|
63561
63815
|
const repo = arg(inv, 0, "a repository", "overlane repo list");
|
|
63562
63816
|
const number4 = pullNumber(inv, 1, "overlane repo pr list app");
|
|
63563
|
-
const path = (
|
|
63817
|
+
const path = (t2, p2) => `${gitPaths.pull(t2, p2, repo, number4)}/close`;
|
|
63564
63818
|
if (inv.dryRun) return planned2(inv, "repo", "POST", path);
|
|
63565
63819
|
const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
|
|
63566
63820
|
return { data: await call2(PullRequest, "POST", path(tenantId, projectId), {}) };
|
|
@@ -63730,7 +63984,7 @@ var ciCancelCommand = defineCommand({
|
|
|
63730
63984
|
text: (d) => "runId" in d ? [runLine(d)] : [],
|
|
63731
63985
|
handler: async (inv) => {
|
|
63732
63986
|
const run3 = arg2(inv, 0, "a run ID", "overlane ci list");
|
|
63733
|
-
if (inv.dryRun) return planned2(inv, "ci", "POST", (
|
|
63987
|
+
if (inv.dryRun) return planned2(inv, "ci", "POST", (t2, p2) => ciPaths.cancel(t2, p2, run3), {});
|
|
63734
63988
|
const { call: call2, tenantId, projectId } = await connected2(inv, "ci");
|
|
63735
63989
|
return { data: await call2(PipelineRun, "POST", ciPaths.cancel(tenantId, projectId, run3), {}) };
|
|
63736
63990
|
}
|
|
@@ -63749,7 +64003,7 @@ var ciRerunCommand = defineCommand({
|
|
|
63749
64003
|
handler: async (inv) => {
|
|
63750
64004
|
const run3 = arg2(inv, 0, "a run ID", "overlane ci list");
|
|
63751
64005
|
const body2 = { requestId: requestId4() };
|
|
63752
|
-
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);
|
|
63753
64007
|
const { call: call2, tenantId, projectId } = await connected2(inv, "ci");
|
|
63754
64008
|
const result = await call2(RunResponse, "POST", ciPaths.rerun(tenantId, projectId, run3), body2);
|
|
63755
64009
|
const exit = runExit(result.run);
|
|
@@ -63823,7 +64077,7 @@ var ciSecretDeleteCommand = defineCommand({
|
|
|
63823
64077
|
text: (d) => "deleted" in d ? [`Deleted ${d.name}.`] : [],
|
|
63824
64078
|
handler: async (inv) => {
|
|
63825
64079
|
const name2 = arg2(inv, 0, "a secret name", "overlane ci secrets");
|
|
63826
|
-
if (inv.dryRun) return planned2(inv, "ci", "DELETE", (
|
|
64080
|
+
if (inv.dryRun) return planned2(inv, "ci", "DELETE", (t2, p2) => ciPaths.secret(t2, p2, name2));
|
|
63827
64081
|
const { call: call2, tenantId, projectId } = await connected2(inv, "ci");
|
|
63828
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)) };
|
|
63829
64083
|
}
|
|
@@ -63859,10 +64113,10 @@ var ciSettingsSetCommand = defineCommand({
|
|
|
63859
64113
|
result: withDryRun(CiSettings),
|
|
63860
64114
|
text: (d) => "maxMinutesPerPull" in d ? [`cost gate ${d.maxMinutesPerPull} minutes per pull request, ${d.maxConcurrentRuns} concurrent, superseded runs ${d.cancelSuperseded ? "cancelled" : "kept"}`] : [],
|
|
63861
64115
|
handler: async (inv) => {
|
|
63862
|
-
const
|
|
64116
|
+
const minutes2 = positive(textFlag(inv, "max-minutes-per-pull"), "max-minutes-per-pull");
|
|
63863
64117
|
const concurrent = positive(textFlag(inv, "max-concurrent"), "max-concurrent");
|
|
63864
64118
|
const cancel = textFlag(inv, "cancel-superseded");
|
|
63865
|
-
const body2 = { ...
|
|
64119
|
+
const body2 = { ...minutes2 === void 0 ? {} : { maxMinutesPerPull: minutes2 }, ...concurrent === void 0 ? {} : { maxConcurrentRuns: concurrent }, ...cancel === void 0 ? {} : { cancelSuperseded: cancel === "true" } };
|
|
63866
64120
|
if (Object.keys(body2).length === 0) throw new UsageError("nothing to change", { hint: "overlane ci settings set --max-minutes-per-pull 120" });
|
|
63867
64121
|
if (inv.dryRun) return planned2(inv, "ci", "PUT", ciPaths.settings, body2);
|
|
63868
64122
|
const { call: call2, tenantId, projectId } = await connected2(inv, "ci");
|
|
@@ -64118,7 +64372,7 @@ var deployRollbackCommand = defineCommand({
|
|
|
64118
64372
|
if (reason === void 0) throw new UsageError("--reason is required", { hint: 'overlane deploy rollback production --reason "why"' });
|
|
64119
64373
|
const to = textFlag(inv, "to");
|
|
64120
64374
|
const body2 = { requestId: requestId4(), reason, ...to === void 0 ? {} : { toReleaseId: to } };
|
|
64121
|
-
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);
|
|
64122
64376
|
const { call: call2, tenantId, projectId } = await connected2(inv, "deploy");
|
|
64123
64377
|
return { data: await call2(RollbackResponse, "POST", deployPaths.rollback(tenantId, projectId, env), body2) };
|
|
64124
64378
|
}
|
|
@@ -64817,7 +65071,7 @@ var issueUpdateCommand = defineCommand({
|
|
|
64817
65071
|
...estimate === void 0 ? {} : { estimate: Number(estimate) }
|
|
64818
65072
|
};
|
|
64819
65073
|
if (Object.keys(body2).length === 1) throw new UsageError("update needs at least one of --title, --description, --status, --priority, --estimate");
|
|
64820
|
-
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);
|
|
64821
65075
|
}
|
|
64822
65076
|
});
|
|
64823
65077
|
var issueAssignCommand = defineCommand({
|
|
@@ -64837,7 +65091,7 @@ var issueAssignCommand = defineCommand({
|
|
|
64837
65091
|
const id2 = inv.positionals[0];
|
|
64838
65092
|
if (id2 === void 0) throw new UsageError("assign needs an ISSUE_ID and an assignee");
|
|
64839
65093
|
const assignee = parseAssignee(inv.positionals[1]);
|
|
64840
|
-
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);
|
|
64841
65095
|
if (result.value !== void 0) say(inv.deps, result.value.taskId === null ? "Assigned." : `Assigned. Task: ${result.value.taskId}${result.value.createdTask ? " (new)" : ""}`);
|
|
64842
65096
|
return result;
|
|
64843
65097
|
}
|
|
@@ -64997,7 +65251,7 @@ var viewDeleteCommand = defineCommand({
|
|
|
64997
65251
|
handler: async (inv) => {
|
|
64998
65252
|
const id2 = inv.positionals[0];
|
|
64999
65253
|
if (id2 === void 0) throw new UsageError("delete needs a VIEW_ID");
|
|
65000
|
-
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);
|
|
65001
65255
|
}
|
|
65002
65256
|
});
|
|
65003
65257
|
var loopListCommand = defineCommand({
|
|
@@ -65057,7 +65311,7 @@ var loopSetCommand = defineCommand({
|
|
|
65057
65311
|
handler: async (inv) => {
|
|
65058
65312
|
const [id2, state] = inv.positionals;
|
|
65059
65313
|
if (id2 === void 0 || state !== "on" && state !== "off") throw new UsageError("set needs a LOOP_ID and on or off");
|
|
65060
|
-
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);
|
|
65061
65315
|
}
|
|
65062
65316
|
});
|
|
65063
65317
|
var loopFireCommand = defineCommand({
|
|
@@ -65073,7 +65327,7 @@ var loopFireCommand = defineCommand({
|
|
|
65073
65327
|
handler: async (inv) => {
|
|
65074
65328
|
const id2 = inv.positionals[0];
|
|
65075
65329
|
if (id2 === void 0) throw new UsageError("fire needs a LOOP_ID");
|
|
65076
|
-
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);
|
|
65077
65331
|
if (result.value !== void 0) say(inv.deps, `Loop run ${result.value.runId ?? "(none)"}: ${result.value.claimed.length} claimed, stopped: ${result.value.stopReason}.`);
|
|
65078
65332
|
return result;
|
|
65079
65333
|
}
|
|
@@ -65091,7 +65345,7 @@ var loopDeleteCommand = defineCommand({
|
|
|
65091
65345
|
handler: async (inv) => {
|
|
65092
65346
|
const id2 = inv.positionals[0];
|
|
65093
65347
|
if (id2 === void 0) throw new UsageError("delete needs a LOOP_ID");
|
|
65094
|
-
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);
|
|
65095
65349
|
}
|
|
65096
65350
|
});
|
|
65097
65351
|
var viewCommands = [viewListCommand, viewRunCommand, viewNewCommand, viewDeleteCommand];
|
|
@@ -65882,7 +66136,7 @@ function rulesStatus(root) {
|
|
|
65882
66136
|
const read = readRules(root);
|
|
65883
66137
|
const report2 = checkRules(read.source, { files: read.files });
|
|
65884
66138
|
if (read.unsafe.length > 0 && report2.configured) {
|
|
65885
|
-
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);
|
|
65886
66140
|
return { report: { ...report2, drifted: true, targets }, unsafe: read.unsafe };
|
|
65887
66141
|
}
|
|
65888
66142
|
return { report: report2, unsafe: read.unsafe };
|
|
@@ -65961,7 +66215,7 @@ async function doctor(deps, options) {
|
|
|
65961
66215
|
for (const line3 of renderReports(reports)) say(deps, line3);
|
|
65962
66216
|
const rules = rulesStatus(root).report;
|
|
65963
66217
|
if (rules.configured) {
|
|
65964
|
-
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}`);
|
|
65965
66219
|
}
|
|
65966
66220
|
const installedStates = reports.filter((report2, index) => infos[index]?.installed === true).map((report2) => report2.state);
|
|
65967
66221
|
const agentsReady = installedStates.length > 0 && installedStates.every((state) => state === "ready");
|
|
@@ -65981,12 +66235,12 @@ async function doctor(deps, options) {
|
|
|
65981
66235
|
action: report2.action,
|
|
65982
66236
|
completionGate: completionGate(report2.agent)
|
|
65983
66237
|
})),
|
|
65984
|
-
...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 } } : {},
|
|
65985
66239
|
ready
|
|
65986
66240
|
};
|
|
65987
66241
|
if (ready) return { data };
|
|
65988
66242
|
if (agentsReady && rulesDrifted) {
|
|
65989
|
-
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 }) };
|
|
65990
66244
|
}
|
|
65991
66245
|
const pending = reports.find((report2) => report2.action !== null);
|
|
65992
66246
|
return {
|
|
@@ -66219,11 +66473,11 @@ async function connectKit(deps, options) {
|
|
|
66219
66473
|
const agentConfig = [join23(".claude", "settings.json"), join23(".codex", "config.toml")];
|
|
66220
66474
|
const preDirty = new Set(await dirty(deps, root, agentConfig));
|
|
66221
66475
|
const preExisting = new Set(agentConfig.filter((file2) => existsSync7(join23(root, file2))));
|
|
66222
|
-
const
|
|
66223
|
-
if (
|
|
66476
|
+
const connected10 = await connect(deps, { ...options, yes: true });
|
|
66477
|
+
if (connected10.error !== void 0 || readBindingFile(root).kind !== "ok") {
|
|
66224
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" });
|
|
66225
66479
|
}
|
|
66226
|
-
const connectData =
|
|
66480
|
+
const connectData = connected10.data !== void 0 && !("dryRun" in connected10.data) ? connected10.data : void 0;
|
|
66227
66481
|
for (const file2 of agentConfig) {
|
|
66228
66482
|
if (!existsSync7(join23(root, file2)) || preDirty.has(file2) || preExisting.has(file2) && (await dirty(deps, root, [file2])).length === 0) continue;
|
|
66229
66483
|
if ((await gitOut(deps, root, "check-ignore", "-q", "--", file2)).code === 0) continue;
|
|
@@ -67519,7 +67773,7 @@ var SCOPE_FLAGS = [
|
|
|
67519
67773
|
{ name: "paths", type: "string", value: "A,B", description: "For a module the code map does not know: the paths it covers (comma separated)" }
|
|
67520
67774
|
];
|
|
67521
67775
|
function scopesOf(inv) {
|
|
67522
|
-
const paths = (textFlag(inv, "paths") ?? "").split(",").map((
|
|
67776
|
+
const paths = (textFlag(inv, "paths") ?? "").split(",").map((p2) => p2.trim()).filter((p2) => p2 !== "");
|
|
67523
67777
|
const scopes = [
|
|
67524
67778
|
...listFlag(inv, "path").map((value) => ({ kind: "path", value })),
|
|
67525
67779
|
...listFlag(inv, "glob").map((value) => ({ kind: "glob", value })),
|
|
@@ -67615,7 +67869,7 @@ var claimRenewCommand = defineCommand({
|
|
|
67615
67869
|
const lease = leaseFlag(inv);
|
|
67616
67870
|
const here = await whereAmI(inv.deps);
|
|
67617
67871
|
const body2 = { ...lease === void 0 ? {} : { leaseSeconds: lease }, ...here };
|
|
67618
|
-
if (inv.dryRun) return planned5(inv, "POST", (
|
|
67872
|
+
if (inv.dryRun) return planned5(inv, "POST", (t2, p2) => claimPaths.renew(t2, p2, id2), body2);
|
|
67619
67873
|
const { call: call2, tenantId, projectId } = await connected5(inv);
|
|
67620
67874
|
return { data: await call2(Claim, "POST", claimPaths.renew(tenantId, projectId, id2), body2) };
|
|
67621
67875
|
}
|
|
@@ -67638,7 +67892,7 @@ var claimReleaseCommand = defineCommand({
|
|
|
67638
67892
|
const id2 = textFlag(inv, "claim");
|
|
67639
67893
|
if (id2 === void 0) throw new UsageError("claim release needs --claim", { hint: "overlane claim list" });
|
|
67640
67894
|
const body2 = { reason: inv.values["done"] === true ? "done" : "released" };
|
|
67641
|
-
if (inv.dryRun) return planned5(inv, "POST", (
|
|
67895
|
+
if (inv.dryRun) return planned5(inv, "POST", (t2, p2) => claimPaths.release(t2, p2, id2), body2);
|
|
67642
67896
|
const { call: call2, tenantId, projectId } = await connected5(inv);
|
|
67643
67897
|
return { data: await call2(Claim, "POST", claimPaths.release(tenantId, projectId, id2), body2) };
|
|
67644
67898
|
}
|
|
@@ -67886,7 +68140,7 @@ var rulesSyncCommand = defineCommand({
|
|
|
67886
68140
|
const root = project.root;
|
|
67887
68141
|
const force = boolFlag(inv, "overwrite-edits");
|
|
67888
68142
|
const { read, plan: plan3 } = planFromDisk(root, force);
|
|
67889
|
-
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}`] }));
|
|
67890
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` });
|
|
67891
68145
|
if (inv.dryRun) {
|
|
67892
68146
|
return planOutcome(
|
|
@@ -67922,12 +68176,12 @@ var rulesCheckCommand = defineCommand({
|
|
|
67922
68176
|
...common17,
|
|
67923
68177
|
keywords: ["rules drift", "instructions out of date", "hand edit AGENTS.md", "ci check rules", "doctor rules"],
|
|
67924
68178
|
result: RulesCheckReport,
|
|
67925
|
-
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}`]],
|
|
67926
68180
|
handler: async (inv) => {
|
|
67927
68181
|
const project = await detectProject(inv.deps);
|
|
67928
68182
|
const { report: report2 } = rulesStatus(project.root);
|
|
67929
68183
|
if (!report2.drifted) return { data: report2 };
|
|
67930
|
-
const first = report2.targets.find((
|
|
68184
|
+
const first = report2.targets.find((t2) => t2.state !== "in_sync");
|
|
67931
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 }) };
|
|
67932
68186
|
}
|
|
67933
68187
|
});
|
|
@@ -68147,8 +68401,8 @@ async function planned8(inv, method, path, body2, note) {
|
|
|
68147
68401
|
}
|
|
68148
68402
|
function ruleOf(text) {
|
|
68149
68403
|
const [host, ports] = text.split(":");
|
|
68150
|
-
const parsedPorts = ports === void 0 ? [443] : ports.split(",").map((
|
|
68151
|
-
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`);
|
|
68152
68406
|
const checked2 = normaliseHost(host.replace(/^\*\./, "x."));
|
|
68153
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" });
|
|
68154
68408
|
return { host: host.toLowerCase(), ports: parsedPorts };
|
|
@@ -68278,8 +68532,8 @@ var egressGrantCommand = defineCommand({
|
|
|
68278
68532
|
const scope = textFlag(inv, "scope") ?? "task";
|
|
68279
68533
|
const task = textFlag(inv, "task");
|
|
68280
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" });
|
|
68281
|
-
const
|
|
68282
|
-
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");
|
|
68283
68537
|
const header = textFlag(inv, "header");
|
|
68284
68538
|
const body2 = {
|
|
68285
68539
|
requestId: requestId13(),
|
|
@@ -68288,7 +68542,7 @@ var egressGrantCommand = defineCommand({
|
|
|
68288
68542
|
hosts: listFlag(inv, "host"),
|
|
68289
68543
|
secretName: textFlag(inv, "secret"),
|
|
68290
68544
|
...header === void 0 ? {} : { attach: { kind: "header", name: header.toLowerCase() } },
|
|
68291
|
-
...
|
|
68545
|
+
...minutes2 === void 0 ? {} : { ttlSeconds: Number(minutes2) * 60 }
|
|
68292
68546
|
};
|
|
68293
68547
|
if (inv.dryRun) return planned8(inv, "POST", egressPaths.grants, body2, "the secret's value is not part of the request or the answer");
|
|
68294
68548
|
const { call: call2, tenantId, projectId } = await connected8(inv);
|
|
@@ -68332,7 +68586,7 @@ var egressRevokeCommand = defineCommand({
|
|
|
68332
68586
|
handler: async (inv) => {
|
|
68333
68587
|
const id2 = textFlag(inv, "grant");
|
|
68334
68588
|
if (id2 === void 0) throw new UsageError("revoke needs --grant", { hint: "overlane egress grants" });
|
|
68335
|
-
if (inv.dryRun) return planned8(inv, "POST", (
|
|
68589
|
+
if (inv.dryRun) return planned8(inv, "POST", (t2, p2) => egressPaths.revoke(t2, p2, id2), {});
|
|
68336
68590
|
const { call: call2, tenantId, projectId } = await connected8(inv);
|
|
68337
68591
|
return { data: await call2(TaskGrant, "POST", egressPaths.revoke(tenantId, projectId, id2), {}) };
|
|
68338
68592
|
}
|
|
@@ -68358,6 +68612,347 @@ var egressScanCommand = defineCommand({
|
|
|
68358
68612
|
});
|
|
68359
68613
|
var egressCommands = [egressPolicyShowCommand, egressPolicySetCommand, egressCheckCommand, egressEventsCommand, egressGrantCommand, egressGrantsCommand, egressRevokeCommand, egressScanCommand];
|
|
68360
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
|
+
|
|
68361
68956
|
// ../cli/src/commands/index.ts
|
|
68362
68957
|
function coreCommands() {
|
|
68363
68958
|
return [
|
|
@@ -68391,6 +68986,7 @@ function coreCommands() {
|
|
|
68391
68986
|
...rulesCommands,
|
|
68392
68987
|
...prCommands,
|
|
68393
68988
|
...egressCommands,
|
|
68989
|
+
...observeCommands,
|
|
68394
68990
|
...repoCommands,
|
|
68395
68991
|
...ciCommands,
|
|
68396
68992
|
...deployCommands
|
|
@@ -68419,12 +69015,12 @@ function parseFor(spec, tokens) {
|
|
|
68419
69015
|
for (const flag of spec.flags) {
|
|
68420
69016
|
const given = values[flag.name];
|
|
68421
69017
|
if (given === void 0 && flag.default !== void 0) values[flag.name] = flag.default;
|
|
68422
|
-
const
|
|
68423
|
-
if (flag.required === true &&
|
|
69018
|
+
const list2 = Array.isArray(given) ? given : given === void 0 ? [] : [given];
|
|
69019
|
+
if (flag.required === true && list2.length === 0) {
|
|
68424
69020
|
throw new UsageError(`${last} needs --${flag.name}${flag.type === "string" ? ` ${placeholder(flag)}` : ""}`, { hint });
|
|
68425
69021
|
}
|
|
68426
69022
|
if (flag.enum !== void 0) {
|
|
68427
|
-
for (const value of
|
|
69023
|
+
for (const value of list2) {
|
|
68428
69024
|
if (typeof value === "string" && !flag.enum.includes(value)) {
|
|
68429
69025
|
throw new UsageError(`--${flag.name} must be one of ${flag.enum.join(", ")}`, { hint });
|
|
68430
69026
|
}
|