overlane 0.1.130 → 0.1.132

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 CHANGED
@@ -17,15 +17,15 @@ var __esm = (fn, res, err2) => function __init() {
17
17
  if (err2) throw err2[0];
18
18
  try {
19
19
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
20
- } catch (e) {
21
- throw err2 = [e], e;
20
+ } catch (e2) {
21
+ throw err2 = [e2], e2;
22
22
  }
23
23
  };
24
24
  var __commonJS = (cb, mod) => function __require2() {
25
25
  try {
26
26
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
27
- } catch (e) {
28
- throw mod = 0, e;
27
+ } catch (e2) {
28
+ throw mod = 0, e2;
29
29
  }
30
30
  };
31
31
  var __export = (target, all) => {
@@ -1239,8 +1239,8 @@ function failure(Err, issues, ctx) {
1239
1239
  }
1240
1240
  return error62;
1241
1241
  },
1242
- set error(e) {
1243
- error62 = e;
1242
+ set error(e2) {
1243
+ error62 = e2;
1244
1244
  issues = void 0;
1245
1245
  ctx = void 0;
1246
1246
  }
@@ -1275,9 +1275,9 @@ var init_parse = __esm({
1275
1275
  throw new $ZodAsyncError();
1276
1276
  }
1277
1277
  if (result.issues.length) {
1278
- const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
1279
- captureStackTrace(e, _params?.callee ?? fn);
1280
- throw e;
1278
+ const e2 = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
1279
+ captureStackTrace(e2, _params?.callee ?? fn);
1280
+ throw e2;
1281
1281
  }
1282
1282
  return result.value;
1283
1283
  };
@@ -1291,9 +1291,9 @@ var init_parse = __esm({
1291
1291
  if (result instanceof Promise)
1292
1292
  result = await result;
1293
1293
  if (result.issues.length) {
1294
- const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
1295
- captureStackTrace(e, params?.callee ?? fn);
1296
- throw e;
1294
+ const e2 = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
1295
+ captureStackTrace(e2, params?.callee ?? fn);
1296
+ throw e2;
1297
1297
  }
1298
1298
  return result.value;
1299
1299
  };
@@ -2073,13 +2073,13 @@ var init_doc = __esm({
2073
2073
  this.indent -= 1;
2074
2074
  }
2075
2075
  }
2076
- write(arg) {
2077
- if (typeof arg === "function") {
2078
- arg(this, { execution: "sync" });
2079
- arg(this, { execution: "async" });
2076
+ write(arg4) {
2077
+ if (typeof arg4 === "function") {
2078
+ arg4(this, { execution: "sync" });
2079
+ arg4(this, { execution: "async" });
2080
2080
  return;
2081
2081
  }
2082
- const content = arg;
2082
+ const content = arg4;
2083
2083
  const lines = content.split("\n").filter((x) => x);
2084
2084
  const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
2085
2085
  const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
@@ -4545,7 +4545,7 @@ function isRef(value) {
4545
4545
  function cloneIssues(issues) {
4546
4546
  return issues.map((iss) => iss.path ? { ...iss, path: iss.path.slice() } : { ...iss });
4547
4547
  }
4548
- function isRecursive(inst, stack, resolve14) {
4548
+ function isRecursive(inst, stack, resolve16) {
4549
4549
  const cached2 = recursive.get(inst);
4550
4550
  if (cached2 !== void 0)
4551
4551
  return cached2 ? PROVEN : NONE;
@@ -4555,7 +4555,7 @@ function isRecursive(inst, stack, resolve14) {
4555
4555
  let result = NONE;
4556
4556
  const check2 = (child) => {
4557
4557
  if (result !== PROVEN && child?._zod) {
4558
- const answer = isRecursive(child, stack, resolve14);
4558
+ const answer = isRecursive(child, stack, resolve16);
4559
4559
  if (answer > result)
4560
4560
  result = answer;
4561
4561
  }
@@ -4566,7 +4566,7 @@ function isRecursive(inst, stack, resolve14) {
4566
4566
  const desc = Object.getOwnPropertyDescriptor(sh, key);
4567
4567
  if (spread && !desc.enumerable)
4568
4568
  continue;
4569
- const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve14) : NONE;
4569
+ const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve16) : NONE;
4570
4570
  if (child > answer)
4571
4571
  answer = child;
4572
4572
  }
@@ -4630,7 +4630,7 @@ function isRecursive(inst, stack, resolve14) {
4630
4630
  break;
4631
4631
  // `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
4632
4632
  case "lazy": {
4633
- const inner = def._cachedInner ?? (resolve14 ? inst._zod.innerType : void 0);
4633
+ const inner = def._cachedInner ?? (resolve16 ? inst._zod.innerType : void 0);
4634
4634
  merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
4635
4635
  break;
4636
4636
  }
@@ -7291,15 +7291,15 @@ var init_he = __esm({
7291
7291
  };
7292
7292
  const typeEntry = (t) => t ? TypeNames[t] : void 0;
7293
7293
  const typeLabel = (t) => {
7294
- const e = typeEntry(t);
7295
- if (e)
7296
- return e.label;
7294
+ const e2 = typeEntry(t);
7295
+ if (e2)
7296
+ return e2.label;
7297
7297
  return t ?? TypeNames.unknown.label;
7298
7298
  };
7299
7299
  const withDefinite = (t) => `\u05D4${typeLabel(t)}`;
7300
7300
  const verbFor = (t) => {
7301
- const e = typeEntry(t);
7302
- const gender = e?.gender ?? "m";
7301
+ const e2 = typeEntry(t);
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
  };
7305
7305
  const getSizing = (origin) => {
@@ -17693,8 +17693,8 @@ function currencyCode2(_params) {
17693
17693
  return _stringFormat(ZodCustomStringFormat, "currency_code", currencyCode, _params);
17694
17694
  }
17695
17695
  function hash(alg, params) {
17696
- const enc = params?.enc ?? "hex";
17697
- const format = `${alg}_${enc}`;
17696
+ const enc2 = params?.enc ?? "hex";
17697
+ const format = `${alg}_${enc2}`;
17698
17698
  const regex = regexes_exports[format];
17699
17699
  if (!regex)
17700
17700
  throw new Error(`Unrecognized hash format: ${format}`);
@@ -18146,11 +18146,11 @@ var init_schemas2 = __esm({
18146
18146
  array() {
18147
18147
  return array(this);
18148
18148
  },
18149
- or(arg) {
18150
- return union([this, arg]);
18149
+ or(arg4) {
18150
+ return union([this, arg4]);
18151
18151
  },
18152
- and(arg) {
18153
- return intersection(this, arg);
18152
+ and(arg4) {
18153
+ return intersection(this, arg4);
18154
18154
  },
18155
18155
  transform(tx) {
18156
18156
  return pipe(this, transform(tx));
@@ -22431,20 +22431,20 @@ function sha256Hex(text) {
22431
22431
  const s1 = rotr(b2, 17) ^ rotr(b2, 19) ^ b2 >>> 10;
22432
22432
  w[i2] = w[i2 - 16] + s0 + w[i2 - 7] + s1 >>> 0;
22433
22433
  }
22434
- let [a, b, c, d, e, f, g, hh] = h;
22434
+ let [a, b, c, d, e2, f, g, hh] = h;
22435
22435
  for (let i2 = 0; i2 < 64; i2 += 1) {
22436
- const t1 = hh + (rotr(e, 6) ^ rotr(e, 11) ^ rotr(e, 25)) + (e & f ^ ~e & g) + K[i2] + w[i2] >>> 0;
22436
+ const t1 = hh + (rotr(e2, 6) ^ rotr(e2, 11) ^ rotr(e2, 25)) + (e2 & f ^ ~e2 & g) + K[i2] + w[i2] >>> 0;
22437
22437
  const t2 = (rotr(a, 2) ^ rotr(a, 13) ^ rotr(a, 22)) + (a & b ^ a & c ^ b & c) >>> 0;
22438
22438
  hh = g;
22439
22439
  g = f;
22440
- f = e;
22441
- e = d + t1 >>> 0;
22440
+ f = e2;
22441
+ e2 = d + t1 >>> 0;
22442
22442
  d = c;
22443
22443
  c = b;
22444
22444
  b = a;
22445
22445
  a = t1 + t2 >>> 0;
22446
22446
  }
22447
- const sums = [a, b, c, d, e, f, g, hh];
22447
+ const sums = [a, b, c, d, e2, f, g, hh];
22448
22448
  for (let i2 = 0; i2 < 8; i2 += 1) h[i2] = h[i2] + sums[i2] >>> 0;
22449
22449
  }
22450
22450
  return [...h].map((n) => n.toString(16).padStart(8, "0")).join("");
@@ -24039,6 +24039,881 @@ var init_billing = __esm({
24039
24039
  }
24040
24040
  });
24041
24041
 
24042
+ // ../contracts/src/git.ts
24043
+ var RepoId, RepoName, BranchName, PrincipalRef, RemoteUrl, ExternalRepoRef, WritableSide, RepoMirror, RepoMode, Repo, CreateRepoRequest, Branch, CreateBranchRequest, PushFile, PushCommit, PushRequest, PushResult, BranchProtection, PutProtectionRequest, MERGE_METHODS, MergeMethod, PR_STATES, PullRequest, OpenPullRequest, REVIEW_STATES, PullReview, SubmitReviewRequest, MergeRequest, MergeBlocker, PullStatus, GIT_EVENT_KINDS, GitEvent, GIT_TOKEN_SCOPES, GitToken, MintGitTokenRequest, GitTokenGrant, ImportRepoRequest, StaleMark, RepoIndexJob, ShardPlan, NativeRepoCapability, RepoListResponse, BranchListResponse, PullListResponse, MergeResult, DeleteRepoResponse, MirrorSyncResponse, IndexJobsResponse, PushCheckRequest, repoBase, e, gitPaths;
24044
+ var init_git = __esm({
24045
+ "../contracts/src/git.ts"() {
24046
+ "use strict";
24047
+ init_zod();
24048
+ init_common();
24049
+ RepoId = external_exports.string().regex(/^repo_[A-Za-z0-9]{6,40}$/);
24050
+ RepoName = external_exports.string().regex(/^[a-z0-9][a-z0-9._-]{0,62}$/, "use lowercase letters, digits, . _ - (at most 63 characters)");
24051
+ BranchName = external_exports.string().min(1).max(200).regex(/^[A-Za-z0-9._/-]+$/).refine((name2) => !name2.startsWith("/") && !name2.endsWith("/") && !name2.includes("//") && !name2.includes(".."), "not a valid branch name");
24052
+ PrincipalRef = external_exports.object({ kind: external_exports.enum(["user", "agent"]), id: external_exports.string().min(1).max(128) }).strict();
24053
+ RemoteUrl = external_exports.string().max(500).refine((value) => {
24054
+ let url2;
24055
+ try {
24056
+ url2 = new URL(value);
24057
+ } catch {
24058
+ return false;
24059
+ }
24060
+ if (url2.protocol !== "https:") return false;
24061
+ if (url2.username !== "" || url2.password !== "") return false;
24062
+ for (const key of url2.searchParams.keys()) if (/token|secret|password|key|auth|expires/i.test(key)) return false;
24063
+ return !value.includes("@");
24064
+ }, "a remote URL must be https and carry no credential");
24065
+ ExternalRepoRef = external_exports.object({ provider: Provider.exclude(["overlane"]), owner: external_exports.string().min(1).max(100), name: external_exports.string().min(1).max(100) }).strict();
24066
+ WritableSide = external_exports.enum(["overlane", "external"]);
24067
+ RepoMirror = external_exports.object({
24068
+ external: ExternalRepoRef,
24069
+ writableSide: WritableSide,
24070
+ lastSyncedAt: Timestamp.nullable(),
24071
+ lastSyncedSha: CommitSha.nullable()
24072
+ }).strict();
24073
+ RepoMode = external_exports.enum(["native", "github-only"]);
24074
+ Repo = external_exports.object({
24075
+ schemaVersion: SchemaVersion,
24076
+ tenantId: TenantId,
24077
+ projectId: ProjectId,
24078
+ repoId: RepoId,
24079
+ name: RepoName,
24080
+ provider: Provider,
24081
+ mode: RepoMode,
24082
+ defaultBranch: BranchName,
24083
+ sizeBytes: external_exports.number().int().nonnegative(),
24084
+ capBytes: external_exports.number().int().positive(),
24085
+ remote: RemoteUrl,
24086
+ mirror: RepoMirror.nullable(),
24087
+ createdBy: PrincipalRef,
24088
+ createdAt: Timestamp,
24089
+ deletedAt: Timestamp.nullable()
24090
+ }).strict();
24091
+ CreateRepoRequest = external_exports.object({
24092
+ requestId: external_exports.string().min(1).max(128),
24093
+ name: RepoName,
24094
+ defaultBranch: BranchName.default("main"),
24095
+ /** Seed the default branch with one commit holding a README, so the first clone is not empty. */
24096
+ seed: external_exports.boolean().default(true)
24097
+ }).strict();
24098
+ Branch = external_exports.object({ tenantId: TenantId, repoId: RepoId, name: BranchName, sha: CommitSha, protected: external_exports.boolean() }).strict();
24099
+ CreateBranchRequest = external_exports.object({ name: BranchName, from: external_exports.union([BranchName, CommitSha]).optional() }).strict();
24100
+ PushFile = external_exports.object({ path: external_exports.string().min(1).max(500), content: external_exports.string().max(5e6).nullable() }).strict();
24101
+ PushCommit = external_exports.object({ message: external_exports.string().min(1).max(5e3), files: external_exports.array(PushFile).min(1).max(500) }).strict();
24102
+ PushRequest = external_exports.object({
24103
+ requestId: external_exports.string().min(1).max(128),
24104
+ ref: BranchName,
24105
+ /** The SHA the caller believes the branch is at; null creates the branch. */
24106
+ expectedOld: CommitSha.nullable(),
24107
+ force: external_exports.boolean().default(false),
24108
+ /** The commit the pushed commits are built on. Defaults to the current tip (none for a new branch). A different parent with `force` rewrites history. */
24109
+ parent: CommitSha.nullable().optional(),
24110
+ commits: external_exports.array(PushCommit).min(1).max(100)
24111
+ }).strict();
24112
+ PushResult = external_exports.object({
24113
+ tenantId: TenantId,
24114
+ repoId: RepoId,
24115
+ ref: BranchName,
24116
+ before: CommitSha.nullable(),
24117
+ after: CommitSha,
24118
+ forced: external_exports.boolean(),
24119
+ eventId: external_exports.string(),
24120
+ sequence: external_exports.number().int().positive(),
24121
+ replay: external_exports.boolean()
24122
+ }).strict();
24123
+ BranchProtection = external_exports.object({
24124
+ tenantId: TenantId,
24125
+ repoId: RepoId,
24126
+ /** A branch name or a glob such as `release/**`. */
24127
+ pattern: external_exports.string().min(1).max(200),
24128
+ requiredChecks: external_exports.array(external_exports.string().min(1).max(128)).max(50),
24129
+ requiredApprovals: external_exports.number().int().min(0).max(10),
24130
+ allowForcePush: external_exports.literal(false),
24131
+ allowedMergeMethods: external_exports.array(external_exports.enum(["merge", "squash", "rebase"])).min(1),
24132
+ updatedAt: Timestamp
24133
+ }).strict();
24134
+ PutProtectionRequest = external_exports.object({
24135
+ pattern: external_exports.string().min(1).max(200),
24136
+ requiredChecks: external_exports.array(external_exports.string().min(1).max(128)).max(50).default([]),
24137
+ requiredApprovals: external_exports.number().int().min(0).max(10).default(1),
24138
+ allowedMergeMethods: external_exports.array(external_exports.enum(["merge", "squash", "rebase"])).min(1).default(["merge", "squash", "rebase"])
24139
+ }).strict();
24140
+ MERGE_METHODS = ["merge", "squash", "rebase"];
24141
+ MergeMethod = external_exports.enum(MERGE_METHODS);
24142
+ PR_STATES = ["open", "merged", "closed"];
24143
+ PullRequest = external_exports.object({
24144
+ schemaVersion: SchemaVersion,
24145
+ tenantId: TenantId,
24146
+ projectId: ProjectId,
24147
+ repoId: RepoId,
24148
+ provider: Provider,
24149
+ number: external_exports.number().int().positive(),
24150
+ title: external_exports.string().min(1).max(500),
24151
+ body: external_exports.string().max(6e4),
24152
+ state: external_exports.enum(PR_STATES),
24153
+ draft: external_exports.boolean(),
24154
+ head: external_exports.object({ branch: BranchName, sha: CommitSha }).strict(),
24155
+ base: external_exports.object({ branch: BranchName, sha: CommitSha }).strict(),
24156
+ author: PrincipalRef,
24157
+ /** The head comes from a fork: no secrets reach CI or review (REQ-CI-04, REQ-REV-09). */
24158
+ fork: external_exports.boolean(),
24159
+ mergeMethod: MergeMethod.nullable(),
24160
+ mergedSha: CommitSha.nullable(),
24161
+ createdAt: Timestamp,
24162
+ updatedAt: Timestamp
24163
+ }).strict();
24164
+ OpenPullRequest = external_exports.object({
24165
+ requestId: external_exports.string().min(1).max(128),
24166
+ title: external_exports.string().min(1).max(500),
24167
+ body: external_exports.string().max(6e4).default(""),
24168
+ head: BranchName,
24169
+ base: BranchName.optional(),
24170
+ draft: external_exports.boolean().default(false)
24171
+ }).strict();
24172
+ REVIEW_STATES = ["approved", "changes_requested", "commented"];
24173
+ PullReview = external_exports.object({
24174
+ tenantId: TenantId,
24175
+ repoId: RepoId,
24176
+ number: external_exports.number().int().positive(),
24177
+ reviewId: external_exports.string().min(1).max(64),
24178
+ reviewer: PrincipalRef,
24179
+ state: external_exports.enum(REVIEW_STATES),
24180
+ /** The head a review applies to: a push after an approval makes it stale (the approval is for the old head). */
24181
+ headSha: CommitSha,
24182
+ body: external_exports.string().max(2e4),
24183
+ at: Timestamp
24184
+ }).strict();
24185
+ SubmitReviewRequest = external_exports.object({ requestId: external_exports.string().min(1).max(128), state: external_exports.enum(REVIEW_STATES), body: external_exports.string().max(2e4).default("") }).strict();
24186
+ MergeRequest = external_exports.object({ requestId: external_exports.string().min(1).max(128), method: MergeMethod.default("squash") }).strict();
24187
+ MergeBlocker = external_exports.object({ code: external_exports.enum(["checks_missing", "checks_failed", "approvals_missing", "changes_requested", "stale_approval", "not_open", "draft", "method_not_allowed", "conflict", "approval_required"]), message: external_exports.string() }).strict();
24188
+ PullStatus = external_exports.object({
24189
+ tenantId: TenantId,
24190
+ pull: PullRequest,
24191
+ reviews: external_exports.array(PullReview),
24192
+ checks: external_exports.array(external_exports.object({ name: external_exports.string(), state: external_exports.enum(["pending", "success", "failure"]), runId: external_exports.string().nullable() }).strict()),
24193
+ approvals: external_exports.number().int().nonnegative(),
24194
+ mergeable: external_exports.boolean(),
24195
+ blockers: external_exports.array(MergeBlocker)
24196
+ }).strict();
24197
+ GIT_EVENT_KINDS = ["push", "branch_created", "branch_deleted", "force_push", "pr_opened", "pr_updated", "pr_merged", "pr_closed", "import_completed", "mirror_synced"];
24198
+ GitEvent = external_exports.object({
24199
+ schemaVersion: SchemaVersion,
24200
+ tenantId: TenantId,
24201
+ repoId: RepoId,
24202
+ /** Idempotency key: the same push delivered twice has the same eventId. */
24203
+ eventId: external_exports.string().min(1).max(200),
24204
+ sequence: external_exports.number().int().positive(),
24205
+ kind: external_exports.enum(GIT_EVENT_KINDS),
24206
+ ref: external_exports.string().max(200).nullable(),
24207
+ beforeSha: CommitSha.nullable(),
24208
+ afterSha: CommitSha.nullable(),
24209
+ forced: external_exports.boolean(),
24210
+ actor: PrincipalRef.nullable(),
24211
+ at: Timestamp
24212
+ }).strict();
24213
+ GIT_TOKEN_SCOPES = ["read", "write"];
24214
+ GitToken = external_exports.object({
24215
+ tenantId: TenantId,
24216
+ repoId: RepoId,
24217
+ tokenId: external_exports.string().min(1).max(64),
24218
+ principal: PrincipalRef,
24219
+ scope: external_exports.enum(GIT_TOKEN_SCOPES),
24220
+ tokenDigest: Sha256Digest,
24221
+ createdAt: Timestamp,
24222
+ expiresAt: Timestamp,
24223
+ revokedAt: Timestamp.nullable()
24224
+ }).strict();
24225
+ MintGitTokenRequest = external_exports.object({ scope: external_exports.enum(GIT_TOKEN_SCOPES).default("write"), ttlSeconds: external_exports.number().int().min(60).max(86400).default(3600) }).strict();
24226
+ GitTokenGrant = external_exports.object({
24227
+ tenantId: TenantId,
24228
+ repoId: RepoId,
24229
+ tokenId: external_exports.string(),
24230
+ scope: external_exports.enum(GIT_TOKEN_SCOPES),
24231
+ expiresAt: Timestamp,
24232
+ remote: RemoteUrl,
24233
+ token: external_exports.string().min(20),
24234
+ usage: external_exports.string()
24235
+ }).strict();
24236
+ ImportRepoRequest = external_exports.object({
24237
+ requestId: external_exports.string().min(1).max(128),
24238
+ source: ExternalRepoRef,
24239
+ name: RepoName.optional(),
24240
+ /** `mirror` keeps syncing from the external side, which stays the only writer; `copy` is a one-time import that makes Overlane the origin. */
24241
+ mode: external_exports.enum(["mirror", "copy"]).default("mirror")
24242
+ }).strict();
24243
+ StaleMark = external_exports.object({
24244
+ tenantId: TenantId,
24245
+ repoId: RepoId,
24246
+ /** Commits that a rewritten history made unreachable; evidence recorded for them is stale (REQ-GIT-08). */
24247
+ shas: external_exports.array(CommitSha),
24248
+ ref: external_exports.string(),
24249
+ reason: external_exports.enum(["force_push", "rewritten_history"]),
24250
+ at: Timestamp
24251
+ }).strict();
24252
+ RepoIndexJob = external_exports.object({
24253
+ tenantId: TenantId,
24254
+ repoId: RepoId,
24255
+ jobId: external_exports.string(),
24256
+ /** The event sequence that started the job. An older sequence never replaces a newer snapshot (REQ-MAP-01, REQ-COD-08). */
24257
+ sequence: external_exports.number().int().positive(),
24258
+ sha: CommitSha,
24259
+ shard: external_exports.object({ id: external_exports.string(), prefixes: external_exports.array(external_exports.string()), fileCount: external_exports.number().int().nonnegative() }).strict().nullable(),
24260
+ status: external_exports.enum(["queued", "applied", "ignored_stale", "failed"]),
24261
+ at: Timestamp
24262
+ }).strict();
24263
+ ShardPlan = external_exports.object({
24264
+ tenantId: TenantId,
24265
+ repoId: RepoId,
24266
+ sha: CommitSha,
24267
+ totalFiles: external_exports.number().int().nonnegative(),
24268
+ shards: external_exports.array(external_exports.object({ id: external_exports.string(), prefixes: external_exports.array(external_exports.string()), fileCount: external_exports.number().int().nonnegative() }).strict()),
24269
+ /** Partial checkout: each shard job fetches only its prefixes (REQ-EDGE-10). */
24270
+ partialCheckout: external_exports.boolean()
24271
+ }).strict();
24272
+ NativeRepoCapability = external_exports.object({
24273
+ tenantId: TenantId,
24274
+ projectId: ProjectId,
24275
+ available: external_exports.boolean(),
24276
+ defaultOn: external_exports.boolean(),
24277
+ mode: RepoMode,
24278
+ host: external_exports.enum(["artifacts", "fake", "unavailable"]),
24279
+ /** A plain sentence for the person: why it is on, off or pending. */
24280
+ reason: external_exports.string(),
24281
+ importAvailable: external_exports.boolean(),
24282
+ capBytes: external_exports.number().int().positive(),
24283
+ /** How many repositories the project has; a project with none is still complete. */
24284
+ repoCount: external_exports.number().int().nonnegative()
24285
+ }).strict();
24286
+ RepoListResponse = external_exports.object({ tenantId: TenantId, repos: external_exports.array(Repo) }).strict();
24287
+ BranchListResponse = external_exports.object({ tenantId: TenantId, repoId: RepoId, branches: external_exports.array(Branch) }).strict();
24288
+ PullListResponse = external_exports.object({ tenantId: TenantId, repoId: RepoId, pulls: external_exports.array(PullRequest) }).strict();
24289
+ MergeResult = external_exports.object({ tenantId: TenantId, pull: PullRequest, mergeSha: CommitSha, replay: external_exports.boolean() }).strict();
24290
+ DeleteRepoResponse = external_exports.object({ tenantId: TenantId, repoId: RepoId, deleted: external_exports.literal(true) }).strict();
24291
+ MirrorSyncResponse = external_exports.object({ tenantId: TenantId, repo: Repo, applied: external_exports.number().int().nonnegative(), staleShas: external_exports.array(CommitSha), refused: external_exports.string().nullable() }).strict();
24292
+ IndexJobsResponse = external_exports.object({ tenantId: TenantId, repoId: RepoId, jobs: external_exports.array(RepoIndexJob), plan: ShardPlan.nullable() }).strict();
24293
+ PushCheckRequest = external_exports.object({ ref: BranchName, before: CommitSha.nullable(), after: CommitSha.nullable(), forced: external_exports.boolean().default(false), paths: external_exports.array(external_exports.string()).max(2e3).default([]) }).strict();
24294
+ repoBase = (tenantId, projectId) => `/v1/tenants/${encodeURIComponent(tenantId)}/projects/${encodeURIComponent(projectId)}/repos`;
24295
+ e = encodeURIComponent;
24296
+ gitPaths = {
24297
+ repos: repoBase,
24298
+ capability: (t, p) => `${repoBase(t, p)}/capability`,
24299
+ repo: (t, p, r) => `${repoBase(t, p)}/${e(r)}`,
24300
+ import: (t, p) => `${repoBase(t, p)}/import`,
24301
+ sync: (t, p, r) => `${repoBase(t, p)}/${e(r)}/sync`,
24302
+ branches: (t, p, r) => `${repoBase(t, p)}/${e(r)}/branches`,
24303
+ branch: (t, p, r, b) => `${repoBase(t, p)}/${e(r)}/branches/${e(b)}`,
24304
+ push: (t, p, r) => `${repoBase(t, p)}/${e(r)}/push`,
24305
+ pushCheck: (t, p, r) => `${repoBase(t, p)}/${e(r)}/push-check`,
24306
+ protection: (t, p, r) => `${repoBase(t, p)}/${e(r)}/protection`,
24307
+ tokens: (t, p, r) => `${repoBase(t, p)}/${e(r)}/tokens`,
24308
+ token: (t, p, r, id2) => `${repoBase(t, p)}/${e(r)}/tokens/${e(id2)}`,
24309
+ pulls: (t, p, r) => `${repoBase(t, p)}/${e(r)}/pulls`,
24310
+ pull: (t, p, r, n) => `${repoBase(t, p)}/${e(r)}/pulls/${n}`,
24311
+ reviews: (t, p, r, n) => `${repoBase(t, p)}/${e(r)}/pulls/${n}/reviews`,
24312
+ merge: (t, p, r, n) => `${repoBase(t, p)}/${e(r)}/pulls/${n}/merge`,
24313
+ index: (t, p, r) => `${repoBase(t, p)}/${e(r)}/index`
24314
+ };
24315
+ }
24316
+ });
24317
+
24318
+ // ../contracts/src/ci.ts
24319
+ function stripComment(text) {
24320
+ let quote3 = null;
24321
+ for (let i2 = 0; i2 < text.length; i2 += 1) {
24322
+ const ch = text[i2];
24323
+ if (quote3 !== null) {
24324
+ if (ch === quote3) quote3 = null;
24325
+ } else if (ch === '"' || ch === "'") {
24326
+ if (i2 === 0 || /[\s[,{:]/.test(text[i2 - 1] ?? " ")) quote3 = ch;
24327
+ } else if (ch === "#" && (i2 === 0 || /\s/.test(text[i2 - 1] ?? ""))) {
24328
+ return text.slice(0, i2);
24329
+ }
24330
+ }
24331
+ return text;
24332
+ }
24333
+ function parseScalar(raw, line2) {
24334
+ const text = raw.trim();
24335
+ if (text === "" || text === "~" || text === "null") return null;
24336
+ if (text === "true") return true;
24337
+ if (text === "false") return false;
24338
+ if (/^-?\d+$/.test(text)) return Number(text);
24339
+ if (text.startsWith('"')) {
24340
+ if (!text.endsWith('"') || text.length < 2) throw new YamlFail(line2, "unterminated double-quoted string");
24341
+ try {
24342
+ return JSON.parse(text);
24343
+ } catch {
24344
+ throw new YamlFail(line2, "bad escape in double-quoted string");
24345
+ }
24346
+ }
24347
+ if (text.startsWith("'")) {
24348
+ if (!text.endsWith("'") || text.length < 2) throw new YamlFail(line2, "unterminated single-quoted string");
24349
+ return text.slice(1, -1).replaceAll("''", "'");
24350
+ }
24351
+ if (text === "{}") return {};
24352
+ if (text === "[]") return [];
24353
+ if (text.startsWith("[")) {
24354
+ if (!text.endsWith("]")) throw new YamlFail(line2, "unterminated list; write the list on one line or use '- ' items");
24355
+ const inner = text.slice(1, -1);
24356
+ const items = [];
24357
+ let current2 = "";
24358
+ let quote3 = null;
24359
+ for (const ch of inner) {
24360
+ if (quote3 !== null) {
24361
+ current2 += ch;
24362
+ if (ch === quote3) quote3 = null;
24363
+ } else if (ch === '"' || ch === "'") {
24364
+ quote3 = ch;
24365
+ current2 += ch;
24366
+ } else if (ch === ",") {
24367
+ items.push(parseScalar(current2, line2));
24368
+ current2 = "";
24369
+ } else current2 += ch;
24370
+ }
24371
+ if (current2.trim() !== "" || items.length > 0) items.push(parseScalar(current2, line2));
24372
+ return items;
24373
+ }
24374
+ if (text.startsWith("{")) throw new YamlFail(line2, "flow maps are not supported; use an indented block");
24375
+ if (/^[&*!%@`]/.test(text)) throw new YamlFail(line2, `'${text[0]}' (anchors, aliases and tags) is not supported`);
24376
+ return text;
24377
+ }
24378
+ function parseYaml(source) {
24379
+ const lines = source.replaceAll("\r\n", "\n").split("\n");
24380
+ const lineMap = /* @__PURE__ */ new Map();
24381
+ let i2 = 0;
24382
+ let pending = null;
24383
+ const keyOf = (path) => JSON.stringify(path);
24384
+ function indentOf(raw, line2) {
24385
+ let n = 0;
24386
+ while (raw[n] === " ") n += 1;
24387
+ if (raw[n] === " ") throw new YamlFail(line2, "tabs are not allowed for indentation; use spaces");
24388
+ return n;
24389
+ }
24390
+ function peek() {
24391
+ if (pending !== null) return pending;
24392
+ while (i2 < lines.length) {
24393
+ const raw = lines[i2] ?? "";
24394
+ const stripped = stripComment(raw);
24395
+ if (stripped.trim() === "") {
24396
+ i2 += 1;
24397
+ continue;
24398
+ }
24399
+ if (/^---\s*$/.test(raw)) {
24400
+ if (i2 === 0) {
24401
+ i2 += 1;
24402
+ continue;
24403
+ }
24404
+ throw new YamlFail(i2 + 1, "multiple documents are not supported");
24405
+ }
24406
+ return { indent: indentOf(raw, i2 + 1), text: stripped.trim(), line: i2 + 1 };
24407
+ }
24408
+ return null;
24409
+ }
24410
+ function advance2() {
24411
+ if (pending !== null) pending = null;
24412
+ i2 += 1;
24413
+ }
24414
+ function blockScalar(parentIndent) {
24415
+ const collected = [];
24416
+ let baseIndent = -1;
24417
+ while (i2 < lines.length) {
24418
+ const raw = lines[i2] ?? "";
24419
+ if (raw.trim() === "") {
24420
+ collected.push("");
24421
+ i2 += 1;
24422
+ continue;
24423
+ }
24424
+ const indent = indentOf(raw, i2 + 1);
24425
+ if (indent <= parentIndent) break;
24426
+ if (baseIndent < 0) baseIndent = indent;
24427
+ collected.push(raw.slice(Math.min(baseIndent, indent)));
24428
+ i2 += 1;
24429
+ }
24430
+ return collected.join("\n").replace(/\n+$/, "");
24431
+ }
24432
+ function parseBlock(indent, path) {
24433
+ const entry = peek();
24434
+ if (entry === null) return null;
24435
+ return entry.text === "-" || entry.text.startsWith("- ") ? parseSeq(indent, path) : parseMap(indent, path);
24436
+ }
24437
+ function parseMap(indent, path) {
24438
+ const out2 = {};
24439
+ for (; ; ) {
24440
+ const entry = peek();
24441
+ if (entry === null || entry.indent < indent) return out2;
24442
+ if (entry.indent > indent) throw new YamlFail(entry.line, "unexpected indentation");
24443
+ if (entry.text === "-" || entry.text.startsWith("- ")) return out2;
24444
+ const match = KEY.exec(entry.text);
24445
+ if (match === null) throw new YamlFail(entry.line, `expected 'key: value', found '${entry.text.slice(0, 60)}'`);
24446
+ let key = match[1] ?? "";
24447
+ if (key.startsWith('"')) key = JSON.parse(key);
24448
+ else if (key.startsWith("'")) key = key.slice(1, -1);
24449
+ if (Object.hasOwn(out2, key)) throw new YamlFail(entry.line, `duplicate key '${key}'`);
24450
+ if (key === "__proto__") throw new YamlFail(entry.line, "key not allowed");
24451
+ const rest = (match[2] ?? "").trim();
24452
+ const childPath = [...path, key];
24453
+ lineMap.set(keyOf(childPath), entry.line);
24454
+ advance2();
24455
+ if (rest === "|" || rest === "|-") {
24456
+ out2[key] = blockScalar(indent);
24457
+ } else if (rest === "") {
24458
+ const next = peek();
24459
+ if (next !== null && (next.indent > indent || next.indent === indent && (next.text === "-" || next.text.startsWith("- ")))) {
24460
+ out2[key] = parseBlock(next.indent, childPath);
24461
+ } else out2[key] = null;
24462
+ } else {
24463
+ out2[key] = parseScalar(rest, entry.line);
24464
+ }
24465
+ }
24466
+ }
24467
+ function parseSeq(indent, path) {
24468
+ const out2 = [];
24469
+ for (; ; ) {
24470
+ const entry = peek();
24471
+ if (entry === null || entry.indent < indent) return out2;
24472
+ if (entry.indent > indent) throw new YamlFail(entry.line, "unexpected indentation");
24473
+ if (!(entry.text === "-" || entry.text.startsWith("- "))) return out2;
24474
+ const childPath = [...path, out2.length];
24475
+ lineMap.set(keyOf(childPath), entry.line);
24476
+ const rest = entry.text.slice(1).trim();
24477
+ const offset = entry.text.length - entry.text.slice(1).trimStart().length;
24478
+ if (rest === "") {
24479
+ advance2();
24480
+ const next = peek();
24481
+ out2.push(next !== null && next.indent > indent ? parseBlock(next.indent, childPath) : null);
24482
+ } else if (KEY.test(rest) && !rest.startsWith('"') && !rest.startsWith("'") && !rest.startsWith("[")) {
24483
+ pending = { indent: indent + offset, text: rest, line: entry.line };
24484
+ out2.push(parseMap(indent + offset, childPath));
24485
+ } else {
24486
+ advance2();
24487
+ out2.push(parseScalar(rest, entry.line));
24488
+ }
24489
+ }
24490
+ }
24491
+ const first = peek();
24492
+ if (first === null) throw new YamlFail(1, "the file is empty");
24493
+ if (first.indent !== 0) throw new YamlFail(first.line, "the file must start at column 1");
24494
+ const value = parseBlock(0, []);
24495
+ const trailing = peek();
24496
+ if (trailing !== null) throw new YamlFail(trailing.line, "unexpected content after the document");
24497
+ return {
24498
+ value,
24499
+ lineOf(path) {
24500
+ for (let n = path.length; n >= 0; n -= 1) {
24501
+ const line2 = n === 0 ? 1 : lineMap.get(keyOf(path.slice(0, n)));
24502
+ if (line2 !== void 0) return line2;
24503
+ }
24504
+ return 1;
24505
+ }
24506
+ };
24507
+ }
24508
+ function mapKeys(value, canon, orig, paths) {
24509
+ paths.set(JSON.stringify(canon), orig);
24510
+ if (Array.isArray(value)) return value.map((item, index) => mapKeys(item, [...canon, index], [...orig, index], paths));
24511
+ if (typeof value === "object" && value !== null) {
24512
+ const out2 = {};
24513
+ for (const [key, child] of Object.entries(value)) {
24514
+ const isData = canon.length === 1 && canon[0] === "jobs" || canon[canon.length - 1] === "env";
24515
+ const renamed = isData ? key : KEY_ALIASES[key] ?? key;
24516
+ out2[renamed] = mapKeys(child, [...canon, renamed], [...orig, key], paths);
24517
+ }
24518
+ return out2;
24519
+ }
24520
+ return value;
24521
+ }
24522
+ function parsePipelineConfig(text) {
24523
+ let located;
24524
+ try {
24525
+ located = parseYaml(text);
24526
+ } catch (error62) {
24527
+ if (error62 instanceof YamlFail) return { ok: false, issues: [{ line: error62.line, message: error62.message }] };
24528
+ throw error62;
24529
+ }
24530
+ const paths = /* @__PURE__ */ new Map();
24531
+ const value = mapKeys(located.value, [], [], paths);
24532
+ const result = PipelineConfig.safeParse(value);
24533
+ const lineFor = (path) => {
24534
+ const segments = path.map((segment) => typeof segment === "symbol" ? String(segment) : segment);
24535
+ for (let n = segments.length; n >= 0; n -= 1) {
24536
+ const original = paths.get(JSON.stringify(segments.slice(0, n)));
24537
+ if (original !== void 0) return located.lineOf(original);
24538
+ }
24539
+ return 1;
24540
+ };
24541
+ const issues = [];
24542
+ if (!result.success) {
24543
+ for (const issue2 of result.error.issues) {
24544
+ const path = [...issue2.path];
24545
+ if (issue2.code === "unrecognized_keys") {
24546
+ for (const key of issue2.keys) issues.push({ line: lineFor([...path, key]), message: `unknown key '${key}'` });
24547
+ continue;
24548
+ }
24549
+ const where = path.length === 0 ? "" : `${path.map(String).join(".")}: `;
24550
+ issues.push({ line: lineFor(path), message: `${where}${issue2.message}` });
24551
+ }
24552
+ return { ok: false, issues: dedupeIssues(issues) };
24553
+ }
24554
+ const config2 = result.data;
24555
+ for (const [name2, job] of Object.entries(config2.jobs)) {
24556
+ job.needs.forEach((need, index) => {
24557
+ if (config2.jobs[need] === void 0) issues.push({ line: lineFor(["jobs", name2, "needs", index]), message: `job '${name2}' needs '${need}', which is not defined` });
24558
+ if (need === name2) issues.push({ line: lineFor(["jobs", name2, "needs", index]), message: `job '${name2}' needs itself` });
24559
+ });
24560
+ job.cache?.keyFiles.forEach((file2, index) => {
24561
+ if (file2.startsWith("/") || file2.includes("..")) issues.push({ line: lineFor(["jobs", name2, "cache", "keyFiles", index]), message: "a cache key file is a path inside the repository" });
24562
+ });
24563
+ if (job.affectedTests && !job.steps.some((step2) => step2.test && step2.run.includes("{affected}"))) {
24564
+ issues.push({ line: lineFor(["jobs", name2, "affectedTests"]), message: "affectedTests needs a test step whose run contains {affected}" });
24565
+ }
24566
+ }
24567
+ const cycle = findCycle(config2);
24568
+ if (cycle !== null) issues.push({ line: lineFor(["jobs", cycle]), message: `job '${cycle}' is part of a needs cycle` });
24569
+ config2.on.schedule?.forEach((cron, index) => {
24570
+ if (!cron.split(/\s+/).every((field2) => CRON_FIELD.test(field2))) issues.push({ line: lineFor(["on", "schedule", index]), message: "not a valid cron expression" });
24571
+ });
24572
+ return issues.length > 0 ? { ok: false, issues: dedupeIssues(issues) } : { ok: true, config: config2 };
24573
+ }
24574
+ function dedupeIssues(issues) {
24575
+ const seen = /* @__PURE__ */ new Set();
24576
+ return issues.filter((issue2) => {
24577
+ const key = `${issue2.line}:${issue2.message}`;
24578
+ if (seen.has(key)) return false;
24579
+ seen.add(key);
24580
+ return true;
24581
+ });
24582
+ }
24583
+ function findCycle(config2) {
24584
+ const state = /* @__PURE__ */ new Map();
24585
+ const visit2 = (name2) => {
24586
+ if (state.get(name2) === 2) return null;
24587
+ if (state.get(name2) === 1) return name2;
24588
+ state.set(name2, 1);
24589
+ for (const need of config2.jobs[name2]?.needs ?? []) {
24590
+ if (config2.jobs[need] === void 0) continue;
24591
+ const found = visit2(need);
24592
+ if (found !== null) return found;
24593
+ }
24594
+ state.set(name2, 2);
24595
+ return null;
24596
+ };
24597
+ for (const name2 of Object.keys(config2.jobs)) {
24598
+ const found = visit2(name2);
24599
+ if (found !== null) return found;
24600
+ }
24601
+ return null;
24602
+ }
24603
+ function formatConfigIssues(path, issues) {
24604
+ return issues.map((issue2) => `${path}:${issue2.line}: ${issue2.message}`);
24605
+ }
24606
+ var PIPELINE_CONFIG_PATH, MAX_JOB_TIMEOUT_MINUTES, RUNNER_INSTANCES, SecretName, Host, Glob, PipelineStep, PipelineJob, PipelineConfig, YamlFail, KEY, KEY_ALIASES, CRON_FIELD, RunnerRoute, RUN_STATUSES, RunStatus, TRIGGERS, StepRun, JobRun, PipelineRun, FlakyRecord, ArtifactDigest, CiSettings, UpdateCiSettingsRequest, CiSecretMeta, SetCiSecretRequest, StartCiRunRequest, RunResponse, RunListResponse, RunLogResponse, CiUsageResponse, CiSecretListResponse, ValidateConfigRequest, ValidateConfigResponse, ciBase, ciPaths;
24607
+ var init_ci = __esm({
24608
+ "../contracts/src/ci.ts"() {
24609
+ "use strict";
24610
+ init_zod();
24611
+ init_common();
24612
+ PIPELINE_CONFIG_PATH = ".overlane/ci.yml";
24613
+ MAX_JOB_TIMEOUT_MINUTES = 360;
24614
+ RUNNER_INSTANCES = ["standard-3", "standard-4"];
24615
+ SecretName = external_exports.string().regex(/^[A-Z][A-Z0-9_]{0,63}$/, "a secret name is UPPER_SNAKE_CASE");
24616
+ Host = external_exports.string().regex(/^(?:\*\.)?[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$/, "a hostname such as registry.npmjs.org (no scheme, no path)");
24617
+ Glob = external_exports.string().min(1).max(200);
24618
+ PipelineStep = external_exports.object({
24619
+ name: external_exports.string().min(1).max(100).optional(),
24620
+ run: external_exports.string().min(1).max(1e4),
24621
+ /** A test step: a failure is re-run once, and pass-after-rerun is recorded as flaky (REQ-CI-06). */
24622
+ test: external_exports.boolean().default(false),
24623
+ /** An artifact this step produces (path); its digest is recorded at build and verified at deploy (REQ-SEC-15). */
24624
+ artifact: external_exports.string().min(1).max(300).optional()
24625
+ }).strict();
24626
+ PipelineJob = external_exports.object({
24627
+ runsOn: external_exports.enum(["standard", "large"]).default("standard"),
24628
+ timeoutMinutes: external_exports.number().int().min(1).max(MAX_JOB_TIMEOUT_MINUTES).default(15),
24629
+ needs: external_exports.array(external_exports.string().min(1).max(64)).max(20).default([]),
24630
+ cache: external_exports.object({ keyFiles: external_exports.array(external_exports.string().min(1).max(200)).min(1).max(10), paths: external_exports.array(external_exports.string().min(1).max(200)).min(1).max(20) }).strict().optional(),
24631
+ /** Secret names; values live in the platform and are handed to the job through the broker (REQ-CI-04). */
24632
+ secrets: external_exports.array(SecretName).max(50).default([]),
24633
+ env: external_exports.record(external_exports.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/), external_exports.string().max(2e3)).default({}),
24634
+ /** Run the job only when a changed file matches (CI waste control, ADR 0052). */
24635
+ paths: external_exports.array(Glob).max(50).optional(),
24636
+ /** Replace `{affected}` in test steps with the tests the change can affect (ADR 0052). */
24637
+ affectedTests: external_exports.boolean().default(false),
24638
+ steps: external_exports.array(PipelineStep).min(1).max(100)
24639
+ }).strict();
24640
+ PipelineConfig = external_exports.object({
24641
+ version: external_exports.literal(1),
24642
+ name: external_exports.string().min(1).max(100).optional(),
24643
+ on: external_exports.object({
24644
+ push: external_exports.object({ branches: external_exports.array(Glob).max(50).optional() }).strict().nullable().optional(),
24645
+ pullRequest: external_exports.object({ branches: external_exports.array(Glob).max(50).optional() }).strict().nullable().optional(),
24646
+ schedule: external_exports.array(external_exports.string().regex(/^\S+(?:\s+\S+){4}$/, "a cron expression has five fields")).max(10).optional()
24647
+ }).strict().default({ push: {} }),
24648
+ /** `cancel-superseded` (default) stops older runs on the same ref when a newer commit arrives (ADR 0052). */
24649
+ concurrency: external_exports.enum(["cancel-superseded", "queue"]).default("cancel-superseded"),
24650
+ /** Hosts a job may reach; narrowed further by guardrail egress rules (REQ-CI-09, ADR 0052). */
24651
+ egress: external_exports.array(Host).max(50).default([]),
24652
+ jobs: external_exports.record(external_exports.string().regex(/^[A-Za-z][A-Za-z0-9_-]{0,63}$/), PipelineJob).refine((jobs) => Object.keys(jobs).length >= 1 && Object.keys(jobs).length <= 50, "between 1 and 50 jobs")
24653
+ }).strict();
24654
+ YamlFail = class extends Error {
24655
+ constructor(line2, message) {
24656
+ super(message);
24657
+ this.line = line2;
24658
+ }
24659
+ line;
24660
+ };
24661
+ KEY = /^("(?:[^"\\]|\\.)*"|'[^']*'|[A-Za-z0-9_.*/-]+)\s*:(?:\s+(.*))?$/;
24662
+ KEY_ALIASES = { "runs-on": "runsOn", "timeout-minutes": "timeoutMinutes", "key-files": "keyFiles", "pull_request": "pullRequest", "affected-tests": "affectedTests" };
24663
+ CRON_FIELD = /^[\d*/,-]+$/;
24664
+ RunnerRoute = external_exports.object({ target: external_exports.literal("containers"), instance: external_exports.enum(RUNNER_INSTANCES), reason: external_exports.string().max(300) }).strict();
24665
+ RUN_STATUSES = ["queued", "running", "passed", "failed", "cancelled", "held"];
24666
+ RunStatus = external_exports.enum(RUN_STATUSES);
24667
+ TRIGGERS = ["push", "pull_request", "schedule", "manual"];
24668
+ StepRun = external_exports.object({
24669
+ name: external_exports.string(),
24670
+ exitCode: external_exports.number().int(),
24671
+ durationMs: external_exports.number().int().nonnegative(),
24672
+ /** 1, or 2 when this is the one re-run of a failed test step. */
24673
+ attempt: external_exports.number().int().min(1).max(2),
24674
+ skipped: external_exports.boolean().default(false)
24675
+ }).strict();
24676
+ JobRun = external_exports.object({
24677
+ tenantId: TenantId,
24678
+ jobId: external_exports.string(),
24679
+ name: external_exports.string(),
24680
+ status: RunStatus,
24681
+ route: RunnerRoute,
24682
+ steps: external_exports.array(StepRun),
24683
+ cache: external_exports.object({ key: external_exports.string().nullable(), hit: external_exports.boolean() }).strict(),
24684
+ /** Set when a test failed and passed on its one re-run (REQ-CI-06). */
24685
+ flaky: external_exports.boolean(),
24686
+ logUri: external_exports.string().nullable(),
24687
+ logDigest: Sha256Digest.nullable(),
24688
+ durationMs: external_exports.number().int().nonnegative(),
24689
+ billedMinutes: external_exports.number().int().nonnegative(),
24690
+ costMicros: external_exports.number().int().nonnegative(),
24691
+ startedAt: Timestamp.nullable(),
24692
+ finishedAt: Timestamp.nullable()
24693
+ }).strict();
24694
+ PipelineRun = external_exports.object({
24695
+ schemaVersion: SchemaVersion,
24696
+ tenantId: TenantId,
24697
+ projectId: ProjectId,
24698
+ runId: external_exports.string().min(1).max(64),
24699
+ provider: Provider,
24700
+ repoId: external_exports.string().nullable(),
24701
+ repository: external_exports.string().nullable(),
24702
+ commitSha: CommitSha,
24703
+ ref: external_exports.string().max(200),
24704
+ trigger: external_exports.enum(TRIGGERS),
24705
+ pullNumber: external_exports.number().int().positive().nullable(),
24706
+ /** A fork pull request runs with an empty secret environment (REQ-CI-04, REQ-EDGE-13). */
24707
+ fork: external_exports.boolean(),
24708
+ status: RunStatus,
24709
+ /** Why a run did not start or stopped early: `superseded`, `cost_gate`, `config`, `cap`. */
24710
+ reason: external_exports.string().max(300).nullable(),
24711
+ supersededBy: external_exports.string().nullable(),
24712
+ configDigest: Sha256Digest,
24713
+ jobs: external_exports.array(JobRun),
24714
+ totalMinutes: external_exports.number().int().nonnegative(),
24715
+ totalCostMicros: external_exports.number().int().nonnegative(),
24716
+ createdAt: Timestamp,
24717
+ finishedAt: Timestamp.nullable()
24718
+ }).strict();
24719
+ FlakyRecord = external_exports.object({
24720
+ tenantId: TenantId,
24721
+ projectId: ProjectId,
24722
+ /** The test step's name. */
24723
+ test: external_exports.string(),
24724
+ runId: external_exports.string(),
24725
+ commitSha: CommitSha,
24726
+ at: Timestamp
24727
+ }).strict();
24728
+ ArtifactDigest = external_exports.object({
24729
+ tenantId: TenantId,
24730
+ projectId: ProjectId,
24731
+ runId: external_exports.string(),
24732
+ jobId: external_exports.string(),
24733
+ name: external_exports.string().max(300),
24734
+ digest: Sha256Digest,
24735
+ sizeBytes: external_exports.number().int().nonnegative(),
24736
+ commitSha: CommitSha,
24737
+ uri: external_exports.string().max(500),
24738
+ recordedAt: Timestamp
24739
+ }).strict();
24740
+ CiSettings = external_exports.object({
24741
+ tenantId: TenantId,
24742
+ projectId: ProjectId,
24743
+ /** CI minutes one pull request may spend before further runs are held for a decision (ADR 0052 cost gate). */
24744
+ maxMinutesPerPull: external_exports.number().int().min(1).max(1e4),
24745
+ maxConcurrentRuns: external_exports.number().int().min(1).max(50),
24746
+ /** Cancel older runs on the same ref when a newer commit arrives. */
24747
+ cancelSuperseded: external_exports.boolean(),
24748
+ updatedAt: Timestamp.nullable()
24749
+ }).strict();
24750
+ UpdateCiSettingsRequest = external_exports.object({ maxMinutesPerPull: external_exports.number().int().min(1).max(1e4).optional(), maxConcurrentRuns: external_exports.number().int().min(1).max(50).optional(), cancelSuperseded: external_exports.boolean().optional() }).strict();
24751
+ CiSecretMeta = external_exports.object({ tenantId: TenantId, projectId: ProjectId, name: external_exports.string(), updatedAt: Timestamp }).strict();
24752
+ SetCiSecretRequest = external_exports.object({ name: external_exports.string().regex(/^[A-Z][A-Z0-9_]{0,63}$/), value: external_exports.string().min(8).max(1e4) }).strict();
24753
+ StartCiRunRequest = external_exports.object({
24754
+ requestId: external_exports.string().min(1).max(128),
24755
+ repoId: external_exports.string().optional(),
24756
+ ref: external_exports.string().min(1).max(200),
24757
+ commitSha: CommitSha,
24758
+ trigger: external_exports.enum(TRIGGERS).default("manual"),
24759
+ pullNumber: external_exports.number().int().positive().optional(),
24760
+ /** Pipeline file text for a repository the engine cannot read (GitHub projects through the App supply it). */
24761
+ config: external_exports.string().max(1e5).optional()
24762
+ }).strict();
24763
+ RunResponse = external_exports.object({ tenantId: TenantId, run: PipelineRun, replay: external_exports.boolean(), cancelled: external_exports.array(external_exports.string()) }).strict();
24764
+ RunListResponse = external_exports.object({ tenantId: TenantId, runs: external_exports.array(PipelineRun) }).strict();
24765
+ RunLogResponse = external_exports.object({ tenantId: TenantId, runId: external_exports.string(), jobs: external_exports.array(external_exports.object({ name: external_exports.string(), log: external_exports.string() }).strict()) }).strict();
24766
+ CiUsageResponse = external_exports.object({ tenantId: TenantId, month: external_exports.string(), minutes: external_exports.number().int().nonnegative(), costMicros: external_exports.number().int().nonnegative(), runs: external_exports.number().int().nonnegative(), flaky: external_exports.array(external_exports.object({ test: external_exports.string(), count: external_exports.number().int() }).strict()) }).strict();
24767
+ CiSecretListResponse = external_exports.object({ tenantId: TenantId, secrets: external_exports.array(CiSecretMeta) }).strict();
24768
+ ValidateConfigRequest = external_exports.object({ config: external_exports.string().min(1).max(1e5) }).strict();
24769
+ 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();
24770
+ ciBase = (t, p) => `/v1/tenants/${encodeURIComponent(t)}/projects/${encodeURIComponent(p)}/ci`;
24771
+ ciPaths = {
24772
+ runs: (t, p) => `${ciBase(t, p)}/runs`,
24773
+ run: (t, p, id2) => `${ciBase(t, p)}/runs/${encodeURIComponent(id2)}`,
24774
+ cancel: (t, p, id2) => `${ciBase(t, p)}/runs/${encodeURIComponent(id2)}/cancel`,
24775
+ logs: (t, p, id2) => `${ciBase(t, p)}/runs/${encodeURIComponent(id2)}/logs`,
24776
+ rerun: (t, p, id2) => `${ciBase(t, p)}/runs/${encodeURIComponent(id2)}/rerun`,
24777
+ validate: (t, p) => `${ciBase(t, p)}/validate`,
24778
+ settings: (t, p) => `${ciBase(t, p)}/settings`,
24779
+ secrets: (t, p) => `${ciBase(t, p)}/secrets`,
24780
+ secret: (t, p, name2) => `${ciBase(t, p)}/secrets/${encodeURIComponent(name2)}`,
24781
+ usage: (t, p) => `${ciBase(t, p)}/usage`
24782
+ };
24783
+ }
24784
+ });
24785
+
24786
+ // ../contracts/src/deploy.ts
24787
+ var DEPLOY_KINDS, DeployKind, Ref, DeployTargetConfig, DeployTarget, CreateTargetRequest, Environment, CreateEnvironmentRequest, SetEnvironmentSecretRequest, RELEASE_STATUSES, DeployRelease, RollbackRecord, DeployRequest, PreviewRequest, RollbackRequest, DeployResponse, RollbackResponse, ReleaseListResponse, TargetListResponse, EnvironmentResponse, TargetResponse, depBase, enc, deployPaths;
24788
+ var init_deploy = __esm({
24789
+ "../contracts/src/deploy.ts"() {
24790
+ "use strict";
24791
+ init_zod();
24792
+ init_common();
24793
+ init_git();
24794
+ DEPLOY_KINDS = ["workers", "vercel", "netlify", "fly"];
24795
+ DeployKind = external_exports.enum(DEPLOY_KINDS);
24796
+ Ref = external_exports.string().regex(/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/);
24797
+ DeployTargetConfig = external_exports.discriminatedUnion("kind", [
24798
+ external_exports.object({ kind: external_exports.literal("workers"), scriptName: Ref, accountId: Ref }).strict(),
24799
+ external_exports.object({ kind: external_exports.literal("vercel"), projectRef: Ref, teamId: Ref.optional() }).strict(),
24800
+ external_exports.object({ kind: external_exports.literal("netlify"), siteId: Ref }).strict(),
24801
+ external_exports.object({ kind: external_exports.literal("fly"), app: Ref, machineId: Ref.optional() }).strict()
24802
+ ]);
24803
+ DeployTarget = external_exports.object({
24804
+ schemaVersion: SchemaVersion,
24805
+ tenantId: TenantId,
24806
+ projectId: ProjectId,
24807
+ targetId: external_exports.string().min(1).max(64),
24808
+ name: external_exports.string().regex(/^[a-z][a-z0-9-]{0,40}$/),
24809
+ config: DeployTargetConfig,
24810
+ /** Name of the secret in the connector vault. */
24811
+ vaultRef: external_exports.string().max(128).nullable(),
24812
+ createdAt: Timestamp
24813
+ }).strict();
24814
+ CreateTargetRequest = external_exports.object({
24815
+ requestId: external_exports.string().min(1).max(128),
24816
+ name: external_exports.string().regex(/^[a-z][a-z0-9-]{0,40}$/),
24817
+ config: DeployTargetConfig,
24818
+ /** The provider token (for Workers, a token for the customer account). It goes to the vault and is never stored in a record or echoed (REQ-DEP-08). */
24819
+ credential: external_exports.string().min(8).max(4e3)
24820
+ }).strict();
24821
+ Environment = external_exports.object({
24822
+ schemaVersion: SchemaVersion,
24823
+ tenantId: TenantId,
24824
+ projectId: ProjectId,
24825
+ name: external_exports.string().regex(/^[a-z][a-z0-9-]{0,40}$/),
24826
+ targetId: external_exports.string(),
24827
+ /** A protected environment needs the approval its guardrail rule demands; production is protected by the platform rule. */
24828
+ protected: external_exports.boolean(),
24829
+ /** Preview environments are made per branch and deleted with it. */
24830
+ kind: external_exports.enum(["permanent", "preview"]),
24831
+ branch: external_exports.string().nullable(),
24832
+ secretNames: external_exports.array(external_exports.string().regex(/^[A-Z][A-Z0-9_]{0,63}$/)).max(100),
24833
+ createdAt: Timestamp
24834
+ }).strict();
24835
+ CreateEnvironmentRequest = external_exports.object({
24836
+ name: external_exports.string().regex(/^[a-z][a-z0-9-]{0,40}$/),
24837
+ targetId: external_exports.string(),
24838
+ protected: external_exports.boolean().optional(),
24839
+ secretNames: external_exports.array(external_exports.string().regex(/^[A-Z][A-Z0-9_]{0,63}$/)).max(100).default([])
24840
+ }).strict();
24841
+ SetEnvironmentSecretRequest = external_exports.object({ name: external_exports.string().regex(/^[A-Z][A-Z0-9_]{0,63}$/), value: external_exports.string().min(8).max(1e4) }).strict();
24842
+ RELEASE_STATUSES = ["pending", "succeeded", "failed", "superseded", "rolled_back"];
24843
+ DeployRelease = external_exports.object({
24844
+ schemaVersion: SchemaVersion,
24845
+ tenantId: TenantId,
24846
+ projectId: ProjectId,
24847
+ releaseId: external_exports.string().min(1).max(64),
24848
+ environment: external_exports.string(),
24849
+ targetId: external_exports.string(),
24850
+ commitSha: CommitSha,
24851
+ /** The artifact built by CI, verified at deploy (REQ-SEC-15). */
24852
+ artifactDigest: Sha256Digest,
24853
+ runId: external_exports.string().nullable(),
24854
+ /** Evidence IDs and CI run that back this deploy (REQ-DEP-06). */
24855
+ evidenceIds: external_exports.array(external_exports.string()).max(100),
24856
+ actor: PrincipalRef,
24857
+ status: external_exports.enum(RELEASE_STATUSES),
24858
+ /** The release this environment served before this one; rollback restores it. */
24859
+ previousReleaseId: external_exports.string().nullable(),
24860
+ live: external_exports.boolean(),
24861
+ providerDeploymentId: external_exports.string().nullable(),
24862
+ url: external_exports.string().max(500).nullable(),
24863
+ error: external_exports.string().max(500).nullable(),
24864
+ approvalId: external_exports.string().nullable(),
24865
+ createdAt: Timestamp,
24866
+ finishedAt: Timestamp.nullable()
24867
+ }).strict();
24868
+ RollbackRecord = external_exports.object({
24869
+ schemaVersion: SchemaVersion,
24870
+ tenantId: TenantId,
24871
+ projectId: ProjectId,
24872
+ rollbackId: external_exports.string(),
24873
+ environment: external_exports.string(),
24874
+ fromReleaseId: external_exports.string(),
24875
+ toReleaseId: external_exports.string(),
24876
+ actor: PrincipalRef,
24877
+ reason: external_exports.string().max(500),
24878
+ at: Timestamp
24879
+ }).strict();
24880
+ DeployRequest = external_exports.object({
24881
+ requestId: external_exports.string().min(1).max(128),
24882
+ environment: external_exports.string().regex(/^[a-z][a-z0-9-]{0,40}$/),
24883
+ commitSha: CommitSha,
24884
+ /** The CI run whose artifact is deployed. */
24885
+ runId: external_exports.string().min(1).max(64),
24886
+ artifact: external_exports.string().min(1).max(300).optional(),
24887
+ /** Digest the caller expects. A different stored digest refuses the deploy. */
24888
+ expectedDigest: Sha256Digest.optional()
24889
+ }).strict();
24890
+ PreviewRequest = external_exports.object({ requestId: external_exports.string().min(1).max(128), branch: external_exports.string().min(1).max(200), targetId: external_exports.string(), commitSha: CommitSha, runId: external_exports.string().min(1).max(64), artifact: external_exports.string().max(300).optional() }).strict();
24891
+ RollbackRequest = external_exports.object({ requestId: external_exports.string().min(1).max(128), reason: external_exports.string().min(1).max(500), toReleaseId: external_exports.string().optional() }).strict();
24892
+ DeployResponse = external_exports.object({
24893
+ tenantId: TenantId,
24894
+ release: DeployRelease.nullable(),
24895
+ approval: external_exports.object({ id: external_exports.string(), summary: external_exports.string(), nextCommand: external_exports.string() }).strict().nullable(),
24896
+ replay: external_exports.boolean()
24897
+ }).strict();
24898
+ RollbackResponse = external_exports.object({ tenantId: TenantId, rollback: RollbackRecord, restored: DeployRelease, replay: external_exports.boolean() }).strict();
24899
+ ReleaseListResponse = external_exports.object({ tenantId: TenantId, environment: external_exports.string().nullable(), releases: external_exports.array(DeployRelease) }).strict();
24900
+ TargetListResponse = external_exports.object({ tenantId: TenantId, targets: external_exports.array(DeployTarget), environments: external_exports.array(Environment) }).strict();
24901
+ EnvironmentResponse = external_exports.object({ tenantId: TenantId, environment: Environment }).strict();
24902
+ TargetResponse = external_exports.object({ tenantId: TenantId, target: DeployTarget }).strict();
24903
+ depBase = (t, p) => `/v1/tenants/${encodeURIComponent(t)}/projects/${encodeURIComponent(p)}/deploy`;
24904
+ enc = encodeURIComponent;
24905
+ deployPaths = {
24906
+ targets: (t, p) => `${depBase(t, p)}/targets`,
24907
+ environments: (t, p) => `${depBase(t, p)}/environments`,
24908
+ deploys: (t, p) => `${depBase(t, p)}/releases`,
24909
+ releases: (t, p, env) => `${depBase(t, p)}/releases${env === void 0 ? "" : `?environment=${enc(env)}`}`,
24910
+ previews: (t, p) => `${depBase(t, p)}/previews`,
24911
+ rollback: (t, p, env) => `${depBase(t, p)}/environments/${enc(env)}/rollback`,
24912
+ secrets: (t, p, env) => `${depBase(t, p)}/environments/${enc(env)}/secrets`
24913
+ };
24914
+ }
24915
+ });
24916
+
24042
24917
  // ../contracts/src/decision.ts
24043
24918
  var DECISION_MODELS, DecisionModel, MAX_QUESTIONS, MAX_IMAGES, QuestionId, Text, NoulQuestion, ChoiceQuestion, ScoreQuestion, ClefQuestion, ClefQuestions, JsonValue, Base64Image, ClefRequest, Probability, NoulAnswer, ChoiceAnswer, ScoreAnswer, ClefAnswer, ClefResponse, DECISION_USES, DecisionUse, DECISION_OUTCOMES, DecisionOutcome, FALLBACK_REASONS, FallbackReason, DecisionRecord;
24044
24919
  var init_decision = __esm({
@@ -24147,6 +25022,9 @@ var init_src = __esm({
24147
25022
  init_agent();
24148
25023
  init_plans();
24149
25024
  init_billing();
25025
+ init_git();
25026
+ init_ci();
25027
+ init_deploy();
24150
25028
  init_decision();
24151
25029
  }
24152
25030
  });
@@ -24662,19 +25540,19 @@ var require_toJS = __commonJS({
24662
25540
  "../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/toJS.js"(exports) {
24663
25541
  "use strict";
24664
25542
  var identity = require_identity();
24665
- function toJS(value, arg, ctx) {
25543
+ function toJS(value, arg4, ctx) {
24666
25544
  if (Array.isArray(value))
24667
25545
  return value.map((v, i2) => toJS(v, String(i2), ctx));
24668
25546
  if (value && typeof value.toJSON === "function") {
24669
25547
  if (!ctx || !identity.hasAnchor(value))
24670
- return value.toJSON(arg, ctx);
25548
+ return value.toJSON(arg4, ctx);
24671
25549
  const data = { aliasCount: 0, count: 1, res: void 0 };
24672
25550
  ctx.anchors.set(value, data);
24673
25551
  ctx.onCreate = (res2) => {
24674
25552
  data.res = res2;
24675
25553
  delete ctx.onCreate;
24676
25554
  };
24677
- const res = value.toJSON(arg, ctx);
25555
+ const res = value.toJSON(arg4, ctx);
24678
25556
  if (ctx.onCreate)
24679
25557
  ctx.onCreate(res);
24680
25558
  return res;
@@ -24859,8 +25737,8 @@ var require_Scalar = __commonJS({
24859
25737
  super(identity.SCALAR);
24860
25738
  this.value = value;
24861
25739
  }
24862
- toJSON(arg, ctx) {
24863
- return ctx?.keep ? this.value : toJS.toJS(this.value, arg, ctx);
25740
+ toJSON(arg4, ctx) {
25741
+ return ctx?.keep ? this.value : toJS.toJS(this.value, arg4, ctx);
24864
25742
  }
24865
25743
  toString() {
24866
25744
  return String(this.value);
@@ -31482,12 +32360,12 @@ var require_dist = __commonJS({
31482
32360
  });
31483
32361
 
31484
32362
  // src/assets.ts
31485
- import { basename as basename5, join as join24, resolve as resolve11 } from "node:path";
32363
+ import { basename as basename5, join as join24, resolve as resolve13 } from "node:path";
31486
32364
  import { fileURLToPath } from "node:url";
31487
32365
  function packageRoot(env = process.env) {
31488
32366
  const override = env["MVRX_PACKAGE_ROOT"];
31489
32367
  if (override !== void 0 && override !== "") return override;
31490
- return resolve11(fileURLToPath(new URL(".", import.meta.url)), "..");
32368
+ return resolve13(fileURLToPath(new URL(".", import.meta.url)), "..");
31491
32369
  }
31492
32370
  function assetDir(env = process.env) {
31493
32371
  const override = env["MVRX_ASSET_DIR"];
@@ -31500,7 +32378,7 @@ var VERSION;
31500
32378
  var init_assets = __esm({
31501
32379
  "src/assets.ts"() {
31502
32380
  "use strict";
31503
- VERSION = true ? "0.1.130" : "0.0.0-dev";
32381
+ VERSION = true ? "0.1.132" : "0.0.0-dev";
31504
32382
  }
31505
32383
  });
31506
32384
 
@@ -31511,15 +32389,15 @@ var init_types = __esm({
31511
32389
  });
31512
32390
 
31513
32391
  // ../../node_modules/.pnpm/@bufbuild+protobuf@2.16.0/node_modules/@bufbuild/protobuf/dist/esm/is-message.js
31514
- function isMessage(arg, schema) {
31515
- const isMessage2 = arg !== null && typeof arg == "object" && "$typeName" in arg && typeof arg.$typeName == "string";
32392
+ function isMessage(arg4, schema) {
32393
+ const isMessage2 = arg4 !== null && typeof arg4 == "object" && "$typeName" in arg4 && typeof arg4.$typeName == "string";
31516
32394
  if (!isMessage2) {
31517
32395
  return false;
31518
32396
  }
31519
32397
  if (schema === void 0) {
31520
32398
  return true;
31521
32399
  }
31522
- return schema.typeName === arg.$typeName;
32400
+ return schema.typeName === arg4.$typeName;
31523
32401
  }
31524
32402
  var init_is_message = __esm({
31525
32403
  "../../node_modules/.pnpm/@bufbuild+protobuf@2.16.0/node_modules/@bufbuild/protobuf/dist/esm/is-message.js"() {
@@ -31883,8 +32761,8 @@ var init_unsafe = __esm({
31883
32761
  });
31884
32762
 
31885
32763
  // ../../node_modules/.pnpm/@bufbuild+protobuf@2.16.0/node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.js
31886
- function isObject2(arg) {
31887
- return arg !== null && typeof arg == "object" && !Array.isArray(arg);
32764
+ function isObject2(arg4) {
32765
+ return arg4 !== null && typeof arg4 == "object" && !Array.isArray(arg4);
31888
32766
  }
31889
32767
  var init_guard = __esm({
31890
32768
  "../../node_modules/.pnpm/@bufbuild+protobuf@2.16.0/node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.js"() {
@@ -32495,8 +33373,8 @@ function wktValueToReflect(json2) {
32495
33373
  values: []
32496
33374
  };
32497
33375
  if (Array.isArray(json2)) {
32498
- for (const e of json2) {
32499
- listValue.values.push(wktValueToReflect(e));
33376
+ for (const e2 of json2) {
33377
+ listValue.values.push(wktValueToReflect(e2));
32500
33378
  }
32501
33379
  }
32502
33380
  value.kind = {
@@ -32918,7 +33796,7 @@ function createFileRegistry(...args2) {
32918
33796
  if (seen.has(protoFileName)) {
32919
33797
  continue;
32920
33798
  }
32921
- const dep = resolve14(protoFileName);
33799
+ const dep = resolve16(protoFileName);
32922
33800
  if (!dep) {
32923
33801
  throw new Error(`Unable to resolve ${protoFileName}, imported by ${file2.name}`);
32924
33802
  }
@@ -32932,7 +33810,7 @@ function createFileRegistry(...args2) {
32932
33810
  return deps.concat(...deps.map(recurseDeps));
32933
33811
  };
32934
33812
  const input2 = args2[0];
32935
- const resolve14 = args2[1];
33813
+ const resolve16 = args2[1];
32936
33814
  const seen = /* @__PURE__ */ new Set();
32937
33815
  for (const file2 of [input2, ...recurseDeps(input2)].reverse()) {
32938
33816
  addFile(file2, registry2);
@@ -33727,7 +34605,7 @@ function bootDescriptorProto(init2) {
33727
34605
  extension: [],
33728
34606
  nestedType: (_d = (_c = init2.nestedType) === null || _c === void 0 ? void 0 : _c.map(bootDescriptorProto)) !== null && _d !== void 0 ? _d : [],
33729
34607
  enumType: (_f = (_e = init2.enumType) === null || _e === void 0 ? void 0 : _e.map(bootEnumDescriptorProto)) !== null && _f !== void 0 ? _f : [],
33730
- extensionRange: (_h = (_g = init2.extensionRange) === null || _g === void 0 ? void 0 : _g.map((e) => Object.assign({ $typeName: "google.protobuf.DescriptorProto.ExtensionRange" }, e))) !== null && _h !== void 0 ? _h : [],
34608
+ extensionRange: (_h = (_g = init2.extensionRange) === null || _g === void 0 ? void 0 : _g.map((e2) => Object.assign({ $typeName: "google.protobuf.DescriptorProto.ExtensionRange" }, e2))) !== null && _h !== void 0 ? _h : [],
33731
34609
  oneofDecl: [],
33732
34610
  reservedRange: [],
33733
34611
  reservedName: []
@@ -33758,7 +34636,7 @@ function bootFieldOptions(init2) {
33758
34636
  debugRedact: false,
33759
34637
  retention: 0
33760
34638
  });
33761
- return Object.assign(proto, Object.assign(Object.assign({ $typeName: "google.protobuf.FieldOptions" }, init2), { targets: (_a3 = init2.targets) !== null && _a3 !== void 0 ? _a3 : [], editionDefaults: (_c = (_b = init2.editionDefaults) === null || _b === void 0 ? void 0 : _b.map((e) => Object.assign({ $typeName: "google.protobuf.FieldOptions.EditionDefault" }, e))) !== null && _c !== void 0 ? _c : [], uninterpretedOption: [] }));
34639
+ return Object.assign(proto, Object.assign(Object.assign({ $typeName: "google.protobuf.FieldOptions" }, init2), { targets: (_a3 = init2.targets) !== null && _a3 !== void 0 ? _a3 : [], editionDefaults: (_c = (_b = init2.editionDefaults) === null || _b === void 0 ? void 0 : _b.map((e2) => Object.assign({ $typeName: "google.protobuf.FieldOptions.EditionDefault" }, e2))) !== null && _c !== void 0 ? _c : [], uninterpretedOption: [] }));
33762
34640
  }
33763
34641
  function bootEnumDescriptorProto(init2) {
33764
34642
  const proto = /* @__PURE__ */ Object.create({
@@ -33769,7 +34647,7 @@ function bootEnumDescriptorProto(init2) {
33769
34647
  name: init2.name,
33770
34648
  reservedName: [],
33771
34649
  reservedRange: [],
33772
- value: init2.value.map((e) => Object.assign({ $typeName: "google.protobuf.EnumValueDescriptorProto" }, e))
34650
+ value: init2.value.map((e2) => Object.assign({ $typeName: "google.protobuf.EnumValueDescriptorProto" }, e2))
33773
34651
  });
33774
34652
  }
33775
34653
  var init_boot = __esm({
@@ -35142,8 +36020,8 @@ function setModule(module2) {
35142
36020
  function newFinalizer(handler) {
35143
36021
  try {
35144
36022
  return new FinalizationRegistry(handler);
35145
- } catch (e) {
35146
- console.error("Unsupported FinalizationRegistry:", e);
36023
+ } catch (e2) {
36024
+ console.error("Unsupported FinalizationRegistry:", e2);
35147
36025
  return;
35148
36026
  }
35149
36027
  }
@@ -35345,13 +36223,13 @@ async function Module2(moduleArg = {}) {
35345
36223
  }
35346
36224
  readAsync = /* @__PURE__ */ __name(async (url2) => {
35347
36225
  if (isFileURI(url2)) {
35348
- return new Promise((resolve14, reject) => {
36226
+ return new Promise((resolve16, reject) => {
35349
36227
  var xhr = new XMLHttpRequest();
35350
36228
  xhr.open("GET", url2, true);
35351
36229
  xhr.responseType = "arraybuffer";
35352
36230
  xhr.onload = () => {
35353
36231
  if (xhr.status == 200 || xhr.status == 0 && xhr.response) {
35354
- resolve14(xhr.response);
36232
+ resolve16(xhr.response);
35355
36233
  return;
35356
36234
  }
35357
36235
  reject(xhr.status);
@@ -35455,9 +36333,9 @@ async function Module2(moduleArg = {}) {
35455
36333
  err(what);
35456
36334
  ABORT = true;
35457
36335
  what += ". Build with -sASSERTIONS for more info.";
35458
- var e = new WebAssembly.RuntimeError(what);
35459
- readyPromiseReject?.(e);
35460
- throw e;
36336
+ var e2 = new WebAssembly.RuntimeError(what);
36337
+ readyPromiseReject?.(e2);
36338
+ throw e2;
35461
36339
  }
35462
36340
  __name(abort, "abort");
35463
36341
  var wasmBinaryFile;
@@ -35547,9 +36425,9 @@ async function Module2(moduleArg = {}) {
35547
36425
  __name(receiveInstantiationResult, "receiveInstantiationResult");
35548
36426
  var info2 = getWasmImports();
35549
36427
  if (Module["instantiateWasm"]) {
35550
- return new Promise((resolve14, reject) => {
36428
+ return new Promise((resolve16, reject) => {
35551
36429
  Module["instantiateWasm"](info2, (mod, inst) => {
35552
- resolve14(receiveInstance(mod, inst));
36430
+ resolve16(receiveInstance(mod, inst));
35553
36431
  });
35554
36432
  });
35555
36433
  }
@@ -35963,15 +36841,15 @@ async function Module2(moduleArg = {}) {
35963
36841
  }, "updateGOT");
35964
36842
  var relocateExports = /* @__PURE__ */ __name((exports, memoryBase22, replace) => {
35965
36843
  var relocated = {};
35966
- for (var e in exports) {
35967
- var value = exports[e];
36844
+ for (var e2 in exports) {
36845
+ var value = exports[e2];
35968
36846
  if (typeof value == "object") {
35969
36847
  value = value.value;
35970
36848
  }
35971
36849
  if (typeof value == "number") {
35972
36850
  value += memoryBase22;
35973
36851
  }
35974
- relocated[e] = value;
36852
+ relocated[e2] = value;
35975
36853
  }
35976
36854
  updateGOT(relocated, replace);
35977
36855
  return relocated;
@@ -35998,9 +36876,9 @@ async function Module2(moduleArg = {}) {
35998
36876
  var sp = stackSave();
35999
36877
  try {
36000
36878
  return dynCall(sig, ptr, args2);
36001
- } catch (e) {
36879
+ } catch (e2) {
36002
36880
  stackRestore(sp);
36003
- if (e !== e + 0) throw e;
36881
+ if (e2 !== e2 + 0) throw e2;
36004
36882
  _setThrew(1, 0);
36005
36883
  if (sig[0] == "j") return 0n;
36006
36884
  }
@@ -36385,7 +37263,7 @@ async function Module2(moduleArg = {}) {
36385
37263
  wasmMemory.grow(pages);
36386
37264
  updateMemoryViews();
36387
37265
  return 1;
36388
- } catch (e) {
37266
+ } catch (e2) {
36389
37267
  }
36390
37268
  }, "growMemory");
36391
37269
  var _emscripten_resize_heap = /* @__PURE__ */ __name((requestedSize) => {
@@ -36498,11 +37376,11 @@ async function Module2(moduleArg = {}) {
36498
37376
  EXITSTATUS = status;
36499
37377
  _proc_exit(status);
36500
37378
  }, "exitJS");
36501
- var handleException = /* @__PURE__ */ __name((e) => {
36502
- if (e instanceof ExitStatus || e == "unwind") {
37379
+ var handleException = /* @__PURE__ */ __name((e2) => {
37380
+ if (e2 instanceof ExitStatus || e2 == "unwind") {
36503
37381
  return EXITSTATUS;
36504
37382
  }
36505
- quit_(1, e);
37383
+ quit_(1, e2);
36506
37384
  }, "handleException");
36507
37385
  var lengthBytesUTF8 = /* @__PURE__ */ __name((str) => {
36508
37386
  var len = 0;
@@ -36825,8 +37703,8 @@ async function Module2(moduleArg = {}) {
36825
37703
  var argc = args2.length;
36826
37704
  var argv = stackAlloc((argc + 1) * 4);
36827
37705
  var argv_ptr = argv;
36828
- args2.forEach((arg) => {
36829
- LE_HEAP_STORE_U32((argv_ptr >> 2) * 4, stringToUTF8OnStack(arg));
37706
+ args2.forEach((arg4) => {
37707
+ LE_HEAP_STORE_U32((argv_ptr >> 2) * 4, stringToUTF8OnStack(arg4));
36830
37708
  argv_ptr += 4;
36831
37709
  });
36832
37710
  LE_HEAP_STORE_U32((argv_ptr >> 2) * 4, 0);
@@ -36838,8 +37716,8 @@ async function Module2(moduleArg = {}) {
36838
37716
  true
36839
37717
  );
36840
37718
  return ret;
36841
- } catch (e) {
36842
- return handleException(e);
37719
+ } catch (e2) {
37720
+ return handleException(e2);
36843
37721
  }
36844
37722
  }
36845
37723
  __name(callMain, "callMain");
@@ -36882,8 +37760,8 @@ async function Module2(moduleArg = {}) {
36882
37760
  if (runtimeInitialized) {
36883
37761
  moduleRtn = Module;
36884
37762
  } else {
36885
- moduleRtn = new Promise((resolve14, reject) => {
36886
- readyPromiseResolve = resolve14;
37763
+ moduleRtn = new Promise((resolve16, reject) => {
37764
+ readyPromiseResolve = resolve16;
36887
37765
  readyPromiseReject = reject;
36888
37766
  });
36889
37767
  }
@@ -36918,8 +37796,8 @@ function parseAnyPredicate(steps, index, operator, textPredicates) {
36918
37796
  if (c.name === captureName1) nodes1.push(c.node);
36919
37797
  if (c.name === captureName2) nodes2.push(c.node);
36920
37798
  }
36921
- const compare = /* @__PURE__ */ __name((n1, n2, positive) => {
36922
- return positive ? n1.text === n2.text : n1.text !== n2.text;
37799
+ const compare = /* @__PURE__ */ __name((n1, n2, positive2) => {
37800
+ return positive2 ? n1.text === n2.text : n1.text !== n2.text;
36923
37801
  }, "compare");
36924
37802
  return matchAll ? nodes1.every((n1) => nodes2.some((n2) => compare(n1, n2, isPositive))) : nodes1.some((n1) => nodes2.some((n2) => compare(n1, n2, isPositive)));
36925
37803
  });
@@ -36963,8 +37841,8 @@ function parseMatchPredicate(steps, index, operator, textPredicates) {
36963
37841
  for (const c of captures) {
36964
37842
  if (c.name === captureName) nodes.push(c.node.text);
36965
37843
  }
36966
- const test = /* @__PURE__ */ __name((text, positive) => {
36967
- return positive ? regex.test(text) : !regex.test(text);
37844
+ const test = /* @__PURE__ */ __name((text, positive2) => {
37845
+ return positive2 ? regex.test(text) : !regex.test(text);
36968
37846
  }, "test");
36969
37847
  if (nodes.length === 0) return !isPositive;
36970
37848
  return matchAll ? nodes.every((text) => test(text, isPositive)) : nodes.some((text) => test(text, isPositive));
@@ -39562,7 +40440,7 @@ async function uploadSnapshot(options) {
39562
40440
  failure4 = error62 instanceof Error ? error62.message : String(error62);
39563
40441
  if (attempt2 >= ATTEMPTS) throw new Error(`POST ${path} failed: ${failure4}`);
39564
40442
  }
39565
- await new Promise((resolve14) => setTimeout(resolve14, (options.retryDelayMs ?? 500) * attempt2));
40443
+ await new Promise((resolve16) => setTimeout(resolve16, (options.retryDelayMs ?? 500) * attempt2));
39566
40444
  }
39567
40445
  };
39568
40446
  const manifestPath = byProject ? codePaths.projectUploadManifest(tenantId, projectId ?? "") : codePaths.uploadManifest(tenantId, repository?.owner ?? "", repository?.name ?? "");
@@ -39641,7 +40519,7 @@ var init_oidc = __esm({
39641
40519
  // ../index-builder/src/run.ts
39642
40520
  import { execFile as execFile2 } from "node:child_process";
39643
40521
  import { mkdir as mkdir3, readdir as readdir4, rm as rm2, writeFile as writeFile3 } from "node:fs/promises";
39644
- import { join as join26, resolve as resolve12 } from "node:path";
40522
+ import { join as join26, resolve as resolve14 } from "node:path";
39645
40523
  import { parseArgs as parseArgs2 } from "node:util";
39646
40524
  import { promisify as promisify2 } from "node:util";
39647
40525
  async function git3(root, args2) {
@@ -39662,7 +40540,7 @@ async function repositoryFromRemote(root) {
39662
40540
  }
39663
40541
  }
39664
40542
  async function snapshotFromArgs(values, env) {
39665
- const root = resolve12(typeof values["root"] === "string" ? values["root"] : process.cwd());
40543
+ const root = resolve14(typeof values["root"] === "string" ? values["root"] : process.cwd());
39666
40544
  const projectId = typeof values["project"] === "string" ? values["project"] : void 0;
39667
40545
  if (projectId !== void 0 && !ProjectId.safeParse(projectId).success) throw new UsageError2(`--project must be a project identifier, got "${projectId}"`);
39668
40546
  const repoText = projectId !== void 0 ? typeof values["repo"] === "string" ? values["repo"] : void 0 : (typeof values["repo"] === "string" ? values["repo"] : void 0) ?? env["GITHUB_REPOSITORY"] ?? await repositoryFromRemote(root);
@@ -39674,7 +40552,7 @@ async function snapshotFromArgs(values, env) {
39674
40552
  const scip = Array.isArray(values["scip"]) ? values["scip"] : [];
39675
40553
  return buildSnapshot({
39676
40554
  repoRoot: root,
39677
- scipFiles: scip.map((file2) => resolve12(file2)),
40555
+ scipFiles: scip.map((file2) => resolve14(file2)),
39678
40556
  tenantId: tenant,
39679
40557
  ...repoText ? { repository: parseRepository(repoText) } : {},
39680
40558
  ...projectId !== void 0 ? { projectId } : {},
@@ -39690,8 +40568,8 @@ async function runCli2(argv, env, out2 = console.log, err2 = console.error) {
39690
40568
  const outDir = values.out;
39691
40569
  if (!outDir) throw new UsageError2("build needs --out DIR");
39692
40570
  const built = await snapshotFromArgs({ ...values, tenant: values.tenant ?? env["HARNESS_TENANT"] ?? "local" }, env);
39693
- await writeSnapshot(resolve12(outDir), built);
39694
- out2(`built ${built.shards.length} shards (${built.uncovered.length} files uncovered) into ${resolve12(outDir)}`);
40571
+ await writeSnapshot(resolve14(outDir), built);
40572
+ out2(`built ${built.shards.length} shards (${built.uncovered.length} files uncovered) into ${resolve14(outDir)}`);
39695
40573
  return 0;
39696
40574
  }
39697
40575
  if (command === "upload") {
@@ -43323,14 +44201,14 @@ function inputRequiredRoundsExceededMessage(method, maxRounds) {
43323
44201
  return `Multi-round-trip request '${method}' still required input after ${maxRounds} rounds (inputRequired.maxRounds)`;
43324
44202
  }
43325
44203
  function sleep2(ms, signal) {
43326
- return new Promise((resolve14, reject) => {
44204
+ return new Promise((resolve16, reject) => {
43327
44205
  if (signal?.aborted) {
43328
44206
  reject(signal.reason instanceof SdkError ? signal.reason : new SdkError(SdkErrorCode.RequestTimeout, String(signal.reason)));
43329
44207
  return;
43330
44208
  }
43331
44209
  const timer = setTimeout(() => {
43332
44210
  signal?.removeEventListener("abort", onAbort);
43333
- resolve14();
44211
+ resolve16();
43334
44212
  }, ms);
43335
44213
  const onAbort = () => {
43336
44214
  clearTimeout(timer);
@@ -45126,7 +46004,7 @@ var init_src_CX2iR2pK = __esm({
45126
46004
  const flowStartedAt = Date.now();
45127
46005
  let onAbort;
45128
46006
  let cleanupMessageId;
45129
- return new Promise((resolve14, reject) => {
46007
+ return new Promise((resolve16, reject) => {
45130
46008
  const earlyReject = (error62) => {
45131
46009
  reject(error62);
45132
46010
  };
@@ -45194,7 +46072,7 @@ var init_src_CX2iR2pK = __esm({
45194
46072
  }
45195
46073
  if (decoded.kind === "invalid") return reject(decoded.error);
45196
46074
  if (decoded.kind === "input_required") {
45197
- if (options?.allowInputRequired === true) return resolve14(manualInputRequiredValue(decoded));
46075
+ if (options?.allowInputRequired === true) return resolve16(manualInputRequiredValue(decoded));
45198
46076
  const flow = {
45199
46077
  codec: codec2,
45200
46078
  request,
@@ -45206,11 +46084,11 @@ var init_src_CX2iR2pK = __esm({
45206
46084
  params
45207
46085
  }, resultSchema2, legOptions)
45208
46086
  };
45209
- return resolve14(this._resolveNonCompleteResult(decoded, flow));
46087
+ return resolve16(this._resolveNonCompleteResult(decoded, flow));
45210
46088
  }
45211
46089
  const result = decoded.result;
45212
46090
  validateStandardSchema(resultSchema2, result).then((parseResult) => {
45213
- if (parseResult.success) resolve14(parseResult.data);
46091
+ if (parseResult.success) resolve16(parseResult.data);
45214
46092
  else reject(new SdkError(SdkErrorCode.InvalidResult, `Invalid result for ${request.method}: ${parseResult.error}`));
45215
46093
  }, reject);
45216
46094
  });
@@ -45528,10 +46406,10 @@ var init_ajvProvider_CEoC_sr = __esm({
45528
46406
  return new _Code(expr);
45529
46407
  }
45530
46408
  exports.str = str;
45531
- function addCodeArg(code2, arg) {
45532
- if (arg instanceof _Code) code2.push(...arg._items);
45533
- else if (arg instanceof Name2) code2.push(arg);
45534
- else code2.push(interpolate(arg));
46409
+ function addCodeArg(code2, arg4) {
46410
+ if (arg4 instanceof _Code) code2.push(...arg4._items);
46411
+ else if (arg4 instanceof Name2) code2.push(arg4);
46412
+ else code2.push(interpolate(arg4));
45535
46413
  }
45536
46414
  exports.addCodeArg = addCodeArg;
45537
46415
  function optimize(expr) {
@@ -45980,15 +46858,15 @@ var init_ajvProvider_CEoC_sr = __esm({
45980
46858
  super.optimizeNodes();
45981
46859
  const cond = this.condition;
45982
46860
  if (cond === true) return this.nodes;
45983
- let e = this.else;
45984
- if (e) {
45985
- const ns = e.optimizeNodes();
45986
- e = this.else = Array.isArray(ns) ? new Else(ns) : ns;
46861
+ let e2 = this.else;
46862
+ if (e2) {
46863
+ const ns = e2.optimizeNodes();
46864
+ e2 = this.else = Array.isArray(ns) ? new Else(ns) : ns;
45987
46865
  }
45988
- if (e) {
45989
- if (cond === false) return e instanceof If2 ? e : e.nodes;
46866
+ if (e2) {
46867
+ if (cond === false) return e2 instanceof If2 ? e2 : e2.nodes;
45990
46868
  if (this.nodes.length) return this;
45991
- return new If2(not(cond), e instanceof If2 ? [e] : e.nodes);
46869
+ return new If2(not(cond), e2 instanceof If2 ? [e2] : e2.nodes);
45992
46870
  }
45993
46871
  if (cond === false || !this.nodes.length) return void 0;
45994
46872
  return this;
@@ -46365,8 +47243,8 @@ var init_ajvProvider_CEoC_sr = __esm({
46365
47243
  delete names[n.str];
46366
47244
  return c;
46367
47245
  }
46368
- function canOptimize(e) {
46369
- return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== void 0);
47246
+ function canOptimize(e2) {
47247
+ return e2 instanceof code_1._Code && e2._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== void 0);
46370
47248
  }
46371
47249
  }
46372
47250
  function subtractNames(names, from) {
@@ -47116,7 +47994,7 @@ var init_ajvProvider_CEoC_sr = __esm({
47116
47994
  }
47117
47995
  function validateAsync3() {
47118
47996
  const ruleErrs = gen.let("ruleErrs", null);
47119
- gen.try(() => assignValid((0, codegen_1._)`await `), (e) => gen.assign(valid, false).if((0, codegen_1._)`${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._)`${e}.errors`), () => gen.throw(e)));
47997
+ gen.try(() => assignValid((0, codegen_1._)`await `), (e2) => gen.assign(valid, false).if((0, codegen_1._)`${e2} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._)`${e2}.errors`), () => gen.throw(e2)));
47120
47998
  return ruleErrs;
47121
47999
  }
47122
48000
  function validateSync() {
@@ -48011,11 +48889,11 @@ var init_ajvProvider_CEoC_sr = __esm({
48011
48889
  }
48012
48890
  sch.validate = validate2;
48013
48891
  return sch;
48014
- } catch (e) {
48892
+ } catch (e2) {
48015
48893
  delete sch.validate;
48016
48894
  delete sch.validateName;
48017
48895
  if (sourceCode) this.logger.error("Error compiling schema, function code:", sourceCode);
48018
- throw e;
48896
+ throw e2;
48019
48897
  } finally {
48020
48898
  this._compilations.delete(sch);
48021
48899
  }
@@ -48026,7 +48904,7 @@ var init_ajvProvider_CEoC_sr = __esm({
48026
48904
  ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);
48027
48905
  const schOrFunc = root.refs[ref];
48028
48906
  if (schOrFunc) return schOrFunc;
48029
- let _sch = resolve14.call(this, root, ref);
48907
+ let _sch = resolve16.call(this, root, ref);
48030
48908
  if (_sch === void 0) {
48031
48909
  const schema = (_a3 = root.localRefs) === null || _a3 === void 0 ? void 0 : _a3[ref];
48032
48910
  const { schemaId } = this.opts;
@@ -48052,7 +48930,7 @@ var init_ajvProvider_CEoC_sr = __esm({
48052
48930
  function sameSchemaEnv(s1, s2) {
48053
48931
  return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
48054
48932
  }
48055
- function resolve14(root, ref) {
48933
+ function resolve16(root, ref) {
48056
48934
  let sch;
48057
48935
  while (typeof (sch = this.refs[ref]) == "string") ref = sch;
48058
48936
  return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);
@@ -48502,7 +49380,7 @@ var init_ajvProvider_CEoC_sr = __esm({
48502
49380
  else if (typeof uri === "object") uri = parse5(serialize(uri, options), options);
48503
49381
  return uri;
48504
49382
  }
48505
- function resolve14(baseURI, relativeURI, options) {
49383
+ function resolve16(baseURI, relativeURI, options) {
48506
49384
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
48507
49385
  const resolved = resolveComponent(parse5(baseURI, schemelessOptions), parse5(relativeURI, schemelessOptions), schemelessOptions, true);
48508
49386
  schemelessOptions.skipEscape = true;
@@ -48657,8 +49535,8 @@ var init_ajvProvider_CEoC_sr = __esm({
48657
49535
  if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
48658
49536
  if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) try {
48659
49537
  parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
48660
- } catch (e) {
48661
- parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
49538
+ } catch (e2) {
49539
+ parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e2;
48662
49540
  }
48663
49541
  }
48664
49542
  if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
@@ -48676,7 +49554,7 @@ var init_ajvProvider_CEoC_sr = __esm({
48676
49554
  const fastUri = {
48677
49555
  SCHEMES,
48678
49556
  normalize,
48679
- resolve: resolve14,
49557
+ resolve: resolve16,
48680
49558
  resolveComponent,
48681
49559
  equal,
48682
49560
  serialize,
@@ -48909,10 +49787,10 @@ var init_ajvProvider_CEoC_sr = __esm({
48909
49787
  async function _compileAsync(sch) {
48910
49788
  try {
48911
49789
  return this._compileSchemaEnv(sch);
48912
- } catch (e) {
48913
- if (!(e instanceof ref_error_1.default)) throw e;
48914
- checkLoaded.call(this, e);
48915
- await loadMissingSchema.call(this, e.missingSchema);
49790
+ } catch (e2) {
49791
+ if (!(e2 instanceof ref_error_1.default)) throw e2;
49792
+ checkLoaded.call(this, e2);
49793
+ await loadMissingSchema.call(this, e2.missingSchema);
48916
49794
  return _compileAsync.call(this, sch);
48917
49795
  }
48918
49796
  }
@@ -49074,7 +49952,7 @@ var init_ajvProvider_CEoC_sr = __esm({
49074
49952
  }
49075
49953
  errorsText(errors = this.errors, { separator = ", ", dataVar = "data" } = {}) {
49076
49954
  if (!errors || errors.length === 0) return "No errors";
49077
- return errors.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((text, msg) => text + separator + msg);
49955
+ return errors.map((e2) => `${dataVar}${e2.instancePath} ${e2.message}`).reduce((text, msg) => text + separator + msg);
49078
49956
  }
49079
49957
  $dataMetaSchema(metaSchema, keywordsJsonPointers) {
49080
49958
  const rules = this.RULES.all;
@@ -49337,9 +50215,9 @@ var init_ajvProvider_CEoC_sr = __esm({
49337
50215
  gen.code((0, codegen_1._)`await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`);
49338
50216
  addEvaluatedFrom(v);
49339
50217
  if (!allErrors) gen.assign(valid, true);
49340
- }, (e) => {
49341
- gen.if((0, codegen_1._)`!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e));
49342
- addErrorsFrom(e);
50218
+ }, (e2) => {
50219
+ gen.if((0, codegen_1._)`!(${e2} instanceof ${it.ValidationError})`, () => gen.throw(e2));
50220
+ addErrorsFrom(e2);
49343
50221
  if (!allErrors) gen.assign(valid, false);
49344
50222
  });
49345
50223
  cxt.ok(valid);
@@ -52276,7 +53154,7 @@ var init_ajvProvider_CEoC_sr = __esm({
52276
53154
  try {
52277
53155
  new RegExp(str);
52278
53156
  return true;
52279
- } catch (e) {
53157
+ } catch (e2) {
52280
53158
  return false;
52281
53159
  }
52282
53160
  }
@@ -54373,7 +55251,7 @@ var init_stdio = __esm({
54373
55251
  }
54374
55252
  send(message) {
54375
55253
  if (this._closed) return Promise.reject(/* @__PURE__ */ new Error("StdioServerTransport is closed"));
54376
- return new Promise((resolve14, reject) => {
55254
+ return new Promise((resolve16, reject) => {
54377
55255
  const json2 = serializeMessage(message);
54378
55256
  let settled = false;
54379
55257
  const onError = (error62) => {
@@ -54388,14 +55266,14 @@ var init_stdio = __esm({
54388
55266
  settled = true;
54389
55267
  this._stdout.off("error", onError);
54390
55268
  this._stdout.off("drain", onDrain);
54391
- resolve14();
55269
+ resolve16();
54392
55270
  };
54393
55271
  this._stdout.once("error", onError);
54394
55272
  if (this._stdout.write(json2)) {
54395
55273
  if (settled) return;
54396
55274
  settled = true;
54397
55275
  this._stdout.off("error", onError);
54398
- resolve14();
55276
+ resolve16();
54399
55277
  } else if (!settled) this._stdout.once("drain", onDrain);
54400
55278
  });
54401
55279
  }
@@ -54449,14 +55327,14 @@ var init_stdio = __esm({
54449
55327
  */
54450
55328
  async whenRequestsAnswered(timeoutMs) {
54451
55329
  if (this._closed || this._pendingRequests.size === 0) return true;
54452
- return await new Promise((resolve14) => {
55330
+ return await new Promise((resolve16) => {
54453
55331
  const waiter = () => {
54454
55332
  clearTimeout(timer);
54455
- resolve14(true);
55333
+ resolve16(true);
54456
55334
  };
54457
55335
  const timer = setTimeout(() => {
54458
55336
  this._drainWaiters = this._drainWaiters.filter((pending) => pending !== waiter);
54459
- resolve14(false);
55337
+ resolve16(false);
54460
55338
  }, timeoutMs);
54461
55339
  this._drainWaiters.push(waiter);
54462
55340
  });
@@ -54628,14 +55506,14 @@ function readWorkingCopyState(root) {
54628
55506
  if (raw === null) return { head, dirty: /* @__PURE__ */ new Set(), deleted: /* @__PURE__ */ new Set(), renamed: /* @__PURE__ */ new Map() };
54629
55507
  return { head, ...parseStatus(raw, (path) => existsSync8(join30(root, path))) };
54630
55508
  }
54631
- var init_git = __esm({
55509
+ var init_git2 = __esm({
54632
55510
  "../code-shim/src/git.ts"() {
54633
55511
  "use strict";
54634
55512
  }
54635
55513
  });
54636
55514
 
54637
55515
  // ../code-shim/src/config.ts
54638
- import { readFileSync as readFileSync12 } from "node:fs";
55516
+ import { readFileSync as readFileSync14 } from "node:fs";
54639
55517
  import { homedir as homedir2 } from "node:os";
54640
55518
  import { join as join31 } from "node:path";
54641
55519
  function configDir(env) {
@@ -54646,7 +55524,7 @@ function findToken2(env, serviceUrl, now) {
54646
55524
  const fromEnv = env["HARNESS_TOKEN"];
54647
55525
  if (fromEnv !== void 0 && fromEnv.length > 0) return fromEnv;
54648
55526
  try {
54649
- const file2 = JSON.parse(readFileSync12(join31(configDir(env), "credentials.json"), "utf8"));
55527
+ const file2 = JSON.parse(readFileSync14(join31(configDir(env), "credentials.json"), "utf8"));
54650
55528
  const stored = file2[serviceUrl];
54651
55529
  if (stored === void 0 || typeof stored.accessToken !== "string" || stored.accessToken.length === 0) return null;
54652
55530
  if (typeof stored.expiresAt === "number" && stored.expiresAt <= now) return null;
@@ -54658,7 +55536,7 @@ function findToken2(env, serviceUrl, now) {
54658
55536
  function resolveCloudConfig(root, env, now) {
54659
55537
  let binding;
54660
55538
  try {
54661
- const parsed = ProjectBinding.safeParse(JSON.parse(readFileSync12(join31(root, ".harness", "project.json"), "utf8")));
55539
+ const parsed = ProjectBinding.safeParse(JSON.parse(readFileSync14(join31(root, ".harness", "project.json"), "utf8")));
54662
55540
  if (!parsed.success) return null;
54663
55541
  binding = parsed.data;
54664
55542
  } catch {
@@ -54675,15 +55553,15 @@ var init_config = __esm({
54675
55553
  "../code-shim/src/config.ts"() {
54676
55554
  "use strict";
54677
55555
  init_src();
54678
- init_git();
55556
+ init_git2();
54679
55557
  }
54680
55558
  });
54681
55559
 
54682
55560
  // ../code-shim/src/local.ts
54683
- import { readFileSync as readFileSync13, statSync as statSync2 } from "node:fs";
54684
- import { isAbsolute as isAbsolute2, relative as relative3, resolve as resolve13, sep as sep2 } from "node:path";
55561
+ import { readFileSync as readFileSync15, statSync as statSync3 } from "node:fs";
55562
+ import { isAbsolute as isAbsolute2, relative as relative3, resolve as resolve15, sep as sep2 } from "node:path";
54685
55563
  function resolveInside(root, path) {
54686
- const absolute = resolve13(root, path);
55564
+ const absolute = resolve15(root, path);
54687
55565
  const rel = relative3(root, absolute);
54688
55566
  if (rel.length === 0 || rel.startsWith("..") || isAbsolute2(rel)) return null;
54689
55567
  return absolute;
@@ -54789,7 +55667,7 @@ var init_local = __esm({
54789
55667
  if (absolute === null || !this.supports(path)) return null;
54790
55668
  let key;
54791
55669
  try {
54792
- const stat = statSync2(absolute);
55670
+ const stat = statSync3(absolute);
54793
55671
  if (!stat.isFile() || stat.size > MAX_PARSE_BYTES2) return null;
54794
55672
  key = `${stat.mtimeMs}:${stat.size}`;
54795
55673
  } catch {
@@ -54800,7 +55678,7 @@ var init_local = __esm({
54800
55678
  let shard;
54801
55679
  try {
54802
55680
  this.parses += 1;
54803
- shard = await this.parse(path, readFileSync13(absolute, "utf8"));
55681
+ shard = await this.parse(path, readFileSync15(absolute, "utf8"));
54804
55682
  } catch {
54805
55683
  shard = null;
54806
55684
  }
@@ -54812,7 +55690,7 @@ var init_local = __esm({
54812
55690
  const absolute = resolveInside(this.root, path);
54813
55691
  if (absolute === null) return null;
54814
55692
  try {
54815
- return readFileSync13(absolute, "utf8");
55693
+ return readFileSync15(absolute, "utf8");
54816
55694
  } catch {
54817
55695
  return null;
54818
55696
  }
@@ -54822,7 +55700,7 @@ var init_local = __esm({
54822
55700
  const absolute = resolveInside(this.root, path);
54823
55701
  if (absolute === null) return void 0;
54824
55702
  try {
54825
- const lines = readFileSync13(absolute, "utf8").split("\n");
55703
+ const lines = readFileSync15(absolute, "utf8").split("\n");
54826
55704
  const start2 = range[0];
54827
55705
  if (start2 >= lines.length) return void 0;
54828
55706
  const end = Math.min(Math.max(range[2], start2), start2 + maxLines - 1, lines.length - 1);
@@ -55049,7 +55927,7 @@ var init_nav = __esm({
55049
55927
 
55050
55928
  // ../code-shim/src/edit.ts
55051
55929
  import { createHash as createHash8 } from "node:crypto";
55052
- import { readFileSync as readFileSync14, writeFileSync as writeFileSync9 } from "node:fs";
55930
+ import { readFileSync as readFileSync16, writeFileSync as writeFileSync9 } from "node:fs";
55053
55931
  function lineStarts(text) {
55054
55932
  const starts = [0];
55055
55933
  for (let i2 = 0; i2 < text.length; i2 += 1) if (text[i2] === "\n") starts.push(i2 + 1);
@@ -55090,7 +55968,7 @@ async function editSymbol(index, args2) {
55090
55968
  if (!found.ok) return found;
55091
55969
  const absolute = resolveInside(index.root, args2.path);
55092
55970
  if (absolute === null) return { ok: false, reason: `path ${args2.path} is outside the repository` };
55093
- const original = readFileSync14(absolute, "utf8");
55971
+ const original = readFileSync16(absolute, "utf8");
55094
55972
  const starts = lineStarts(original);
55095
55973
  const range = found.symbol.enclosingRange ?? found.symbol.range;
55096
55974
  const from = offsetOf(starts, original, range[0], range[1]);
@@ -55157,7 +56035,7 @@ async function renameSymbol(deps, args2) {
55157
56035
  if (absolute === null) return { ok: false, reason: `reference path ${path} is outside the repository` };
55158
56036
  let text;
55159
56037
  try {
55160
- text = readFileSync14(absolute, "utf8");
56038
+ text = readFileSync16(absolute, "utf8");
55161
56039
  } catch {
55162
56040
  return { ok: false, reason: `cannot read ${path}` };
55163
56041
  }
@@ -55291,7 +56169,7 @@ var init_server = __esm({
55291
56169
  init_cloud();
55292
56170
  init_config();
55293
56171
  init_edit();
55294
- init_git();
56172
+ init_git2();
55295
56173
  init_local();
55296
56174
  init_nav();
55297
56175
  ok = (value) => ({ content: [{ type: "text", text: JSON.stringify(value) }] });
@@ -55355,7 +56233,7 @@ var init_src3 = __esm({
55355
56233
  init_cloud();
55356
56234
  init_config();
55357
56235
  init_edit();
55358
- init_git();
56236
+ init_git2();
55359
56237
  init_local();
55360
56238
  init_merge2();
55361
56239
  init_nav();
@@ -55669,6 +56547,21 @@ var SERVICE_CODES = {
55669
56547
  invalid_rules: { exit: EXIT.usage, hint: "overlane guard rules test --file <rules.json> --tool <tool>" },
55670
56548
  finding_not_open: { exit: EXIT.conflict, hint: "overlane review findings --status open" },
55671
56549
  live_leg_pending: { exit: EXIT.failure, hint: "overlane review status" },
56550
+ // native git, CI and deploy (MS-A6)
56551
+ mirror_read_only: { exit: EXIT.blocked, hint: "overlane repo mirror set <repo> --writable overlane" },
56552
+ repo_too_large: { exit: EXIT.blocked, hint: "overlane connect --provider github" },
56553
+ git_unavailable: { exit: EXIT.failure, hint: "overlane connect --provider github" },
56554
+ merge_blocked: { exit: EXIT.conflict, hint: "overlane repo pr show <repo> <number>" },
56555
+ invalid_pipeline: { exit: EXIT.usage, hint: "overlane ci validate" },
56556
+ no_pipeline: { exit: EXIT.usage, hint: "overlane ci validate" },
56557
+ secret_in_config: { exit: EXIT.usage, hint: "overlane ci secret set <NAME> --from-env <VAR>" },
56558
+ artifact_tampered: { exit: EXIT.blocked, hint: "overlane ci run" },
56559
+ digest_mismatch: { exit: EXIT.blocked, hint: "overlane ci show <run>" },
56560
+ run_not_passed: { exit: EXIT.conflict, hint: "overlane ci list" },
56561
+ invalid_git_token: { exit: EXIT.auth, hint: "overlane repo token <repo>" },
56562
+ git_token_scope: { exit: EXIT.blocked, hint: "overlane repo token <repo> --scope write" },
56563
+ git_token_principal: { exit: EXIT.blocked, hint: "overlane repo token <repo>" },
56564
+ self_review: { exit: EXIT.conflict, hint: "overlane repo pr show <repo> <number>" },
55672
56565
  // generic
55673
56566
  unauthorized: { exit: EXIT.auth, hint: "overlane auth login" },
55674
56567
  // identity (MS-A1): a revoked or expired token needs a new sign-in; a role that may not do this is blocked by policy
@@ -56167,19 +57060,19 @@ function pkcePair() {
56167
57060
  return { verifier, challenge: base64url3(createHash("sha256").update(verifier).digest()) };
56168
57061
  }
56169
57062
  function listen(server, port) {
56170
- return new Promise((resolve14, reject) => {
57063
+ return new Promise((resolve16, reject) => {
56171
57064
  const onError = (error62) => reject(error62);
56172
57065
  server.once("error", onError);
56173
57066
  server.listen(port, "127.0.0.1", () => {
56174
57067
  server.off("error", onError);
56175
- resolve14();
57068
+ resolve16();
56176
57069
  });
56177
57070
  });
56178
57071
  }
56179
57072
  async function startLoopback(preferredPort, state) {
56180
57073
  let settle2;
56181
- const code2 = new Promise((resolve14, reject) => {
56182
- settle2 = { resolve: resolve14, reject };
57074
+ const code2 = new Promise((resolve16, reject) => {
57075
+ settle2 = { resolve: resolve16, reject };
56183
57076
  });
56184
57077
  code2.catch(() => void 0);
56185
57078
  const server = createServer((request, response) => {
@@ -56956,8 +57849,8 @@ function withTimeout(deps, ms) {
56956
57849
  }
56957
57850
  async function attempt(deps, ms, work) {
56958
57851
  let timer;
56959
- const deadline = new Promise((resolve14) => {
56960
- timer = setTimeout(() => resolve14("unreachable"), ms);
57852
+ const deadline = new Promise((resolve16) => {
57853
+ timer = setTimeout(() => resolve16("unreachable"), ms);
56961
57854
  });
56962
57855
  try {
56963
57856
  return await Promise.race([work(withTimeout(deps, ms)).catch((error62) => error62 instanceof ServiceError && error62.exit === EXIT.auth ? "unauthenticated" : "unreachable"), deadline]);
@@ -60114,7 +61007,7 @@ async function post(deps, base4, path, body2) {
60114
61007
  return { status: response.status, json: json2 };
60115
61008
  }
60116
61009
  function sleep(ms) {
60117
- return new Promise((resolve14) => setTimeout(resolve14, ms));
61010
+ return new Promise((resolve16) => setTimeout(resolve16, ms));
60118
61011
  }
60119
61012
  async function deviceLogin(deps, service, options) {
60120
61013
  const started = await post(deps, service, "/auth/device", {});
@@ -60737,25 +61630,1155 @@ var billingCommands = [
60737
61630
  billingCapsRemoveCommand
60738
61631
  ];
60739
61632
 
60740
- // ../cli/src/commands/guard.ts
61633
+ // ../cli/src/commands/repo.ts
60741
61634
  init_src();
60742
61635
  init_zod();
60743
61636
  import { randomUUID as randomUUID4 } from "node:crypto";
60744
- import { readFileSync as readFileSync8 } from "node:fs";
61637
+ import { readFileSync as readFileSync8, statSync } from "node:fs";
60745
61638
  import { resolve as resolve8 } from "node:path";
60746
61639
  var common3 = { needsAuth: true, needsNetwork: true };
60747
61640
  var requestId4 = () => `cli-${randomUUID4()}`;
60748
- async function connected2(inv) {
61641
+ async function connected2(inv, label) {
61642
+ const project = await connectedProject(inv.deps, label);
61643
+ return { call: serviceCall(inv.deps, project.serviceUrl, project.token), tenantId: project.binding.tenantId, projectId: project.binding.projectId };
61644
+ }
61645
+ async function planned2(inv, label, method, path, body2, note) {
61646
+ const project = await offlineProject(inv.deps, label);
61647
+ return planOutcome(inv.deps, dryRunPlan({ service: project.serviceUrl, requests: [{ method, path: path(project.binding.tenantId, project.binding.projectId), ...body2 === void 0 ? {} : { body: body2 }, ...note === void 0 ? {} : { note } }] }));
61648
+ }
61649
+ var APPROVAL_FLAG = { name: "approval", type: "string", value: "ID", description: "Run an action that an approval covers; get the ID from `overlane guard approvals list`" };
61650
+ var approvalHeaders = (inv) => {
61651
+ const id2 = textFlag(inv, "approval");
61652
+ return id2 === void 0 ? void 0 : { [APPROVAL_HEADER]: id2 };
61653
+ };
61654
+ function positive(text, flag) {
61655
+ if (text === void 0) return void 0;
61656
+ if (!/^\d+$/.test(text) || Number(text) < 1) throw new UsageError(`--${flag} must be a whole number of at least 1`);
61657
+ return Number(text);
61658
+ }
61659
+ function arg(inv, index, what, hint) {
61660
+ const value = inv.positionals[index];
61661
+ if (value === void 0) throw new UsageError(`${what} is required`, { hint });
61662
+ return value;
61663
+ }
61664
+ var REPO_ARG = { name: "repo", required: true, description: "The repository name or ID" };
61665
+ var REPO_ARG_LATE = { name: "repo", required: false, description: "The repository name or ID (required)" };
61666
+ var PULL_ARG = { name: "number", required: true, description: "The pull request number" };
61667
+ function pullNumber(inv, index, hint) {
61668
+ const number4 = Number(arg(inv, index, "a pull request number", hint));
61669
+ if (!Number.isInteger(number4) || number4 < 1) throw new UsageError("the pull request number must be a whole number", { hint });
61670
+ return number4;
61671
+ }
61672
+ var repoListCommand = defineCommand({
61673
+ path: ["repo", "list"],
61674
+ summary: "List the project's repositories",
61675
+ description: "Lists the native Overlane repositories of this project, with the default branch, size against the 1 GB limit, and the mirror's writable side when the repository mirrors GitHub.",
61676
+ examples: ["overlane repo list", "overlane repo list --json"],
61677
+ effect: "read",
61678
+ ...common3,
61679
+ keywords: ["repositories", "repos", "git", "list repos", "native repo"],
61680
+ result: RepoListResponse,
61681
+ text: (d) => d.repos.length === 0 ? ["No repositories yet. Create one with: overlane repo create <name>"] : d.repos.map((repo) => `${repo.name} ${repo.repoId} ${repo.defaultBranch} ${(repo.sizeBytes / 1048576).toFixed(1)} MB${repo.mirror === null ? "" : ` mirror of ${repo.mirror.external.owner}/${repo.mirror.external.name} (writable: ${repo.mirror.writableSide})`}`),
61682
+ handler: async (inv) => {
61683
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
61684
+ return { data: await call2(RepoListResponse, "GET", gitPaths.repos(tenantId, projectId)) };
61685
+ }
61686
+ });
61687
+ var repoStatusCommand = defineCommand({
61688
+ path: ["repo", "status"],
61689
+ summary: "Show whether this project can get a native repository now",
61690
+ description: "Shows the flag the onboarding flow reads: whether native repositories are live, whether one is offered by default (only when the git host is live), whether import works, and how many repositories the project has. A project with none is complete: a repository stays optional.",
61691
+ examples: ["overlane repo status", "overlane repo status --json"],
61692
+ effect: "read",
61693
+ ...common3,
61694
+ keywords: ["native repo available", "is git hosting live", "can i create a repo", "repository optional"],
61695
+ result: NativeRepoCapability,
61696
+ text: (d) => [`native repositories: ${d.available ? "available" : "not available"}${d.defaultOn ? " (offered by default)" : ""}; ${d.repoCount} in this project`, d.reason],
61697
+ handler: async (inv) => {
61698
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
61699
+ return { data: await call2(NativeRepoCapability, "GET", gitPaths.capability(tenantId, projectId)) };
61700
+ }
61701
+ });
61702
+ var repoShowCommand = defineCommand({
61703
+ path: ["repo", "show"],
61704
+ summary: "Show one repository and its remote",
61705
+ description: "Shows a repository's record. The remote URL carries no credential: use `overlane repo token` for a scoped token and hand it to a git credential helper.",
61706
+ args: [REPO_ARG],
61707
+ examples: ["overlane repo show app"],
61708
+ effect: "read",
61709
+ ...common3,
61710
+ keywords: ["repository details", "remote url", "clone url"],
61711
+ result: Repo,
61712
+ text: (d) => [`${d.name} (${d.repoId}): ${d.remote}`, `default branch ${d.defaultBranch}, ${(d.sizeBytes / 1048576).toFixed(1)} MB of ${(d.capBytes / 1073741824).toFixed(0)} GB`],
61713
+ handler: async (inv) => {
61714
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
61715
+ return { data: await call2(Repo, "GET", gitPaths.repo(tenantId, projectId, arg(inv, 0, "a repository", "overlane repo list"))) };
61716
+ }
61717
+ });
61718
+ var repoCreateCommand = defineCommand({
61719
+ path: ["repo", "create"],
61720
+ summary: "Create a native repository for the project",
61721
+ description: "Creates a git repository on Overlane for this project. No GitHub account is needed. The default branch starts with a README commit unless you pass --no-seed. A repository stays optional: a project works without one.",
61722
+ args: [{ name: "name", required: true, description: "Lowercase letters, digits, dots, dashes and underscores" }],
61723
+ flags: [
61724
+ { name: "branch", type: "string", value: "NAME", description: "The default branch (default: main)" },
61725
+ { name: "no-seed", type: "boolean", description: "Create the repository empty, with no README commit" }
61726
+ ],
61727
+ examples: ["overlane repo create app", "overlane repo create app --branch trunk --dry-run"],
61728
+ effect: "write",
61729
+ ...common3,
61730
+ keywords: ["new repository", "create repo", "git hosting", "native git", "start a repo"],
61731
+ result: withDryRun(Repo),
61732
+ text: (d) => "repoId" in d ? [`Created ${d.name} (${d.repoId}). Remote: ${d.remote}`, `Next: overlane repo token ${d.name} --scope write`] : [],
61733
+ handler: async (inv) => {
61734
+ const name2 = arg(inv, 0, "a repository name", "overlane repo create app");
61735
+ const body2 = { requestId: requestId4(), name: name2, defaultBranch: textFlag(inv, "branch") ?? "main", seed: !boolFlag(inv, "no-seed") };
61736
+ if (inv.dryRun) return planned2(inv, "repo", "POST", gitPaths.repos, body2);
61737
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
61738
+ return { data: await call2(Repo, "POST", gitPaths.repos(tenantId, projectId), body2) };
61739
+ }
61740
+ });
61741
+ var repoImportCommand = defineCommand({
61742
+ path: ["repo", "import"],
61743
+ summary: "Import or mirror a GitHub repository",
61744
+ description: "Copies a GitHub repository's history, branches and tags into a native repository. By default it is a mirror: GitHub stays the only writable side and a push to the Overlane copy is refused with a message saying where to push. With --copy Overlane becomes the origin. A repository over the 1 GB limit is refused with guidance to keep it on GitHub.",
61745
+ args: [{ name: "source", required: true, description: "OWNER/NAME (or github:OWNER/NAME)" }],
61746
+ flags: [
61747
+ { name: "name", type: "string", value: "NAME", description: "The native repository's name (default: the source name)" },
61748
+ { name: "copy", type: "boolean", description: "A one-time copy that makes Overlane the origin instead of a mirror" }
61749
+ ],
61750
+ examples: ["overlane repo import acme/app", "overlane repo import acme/app --copy --name app-native --dry-run"],
61751
+ effect: "write",
61752
+ ...common3,
61753
+ keywords: ["import from github", "mirror github", "migrate repository", "bring my repo", "copy repo"],
61754
+ result: withDryRun(Repo),
61755
+ text: (d) => "repoId" in d ? [`Imported ${d.name}${d.mirror === null ? "" : ` as a mirror of ${d.mirror.external.owner}/${d.mirror.external.name}; ${d.mirror.writableSide} is the writable side`}.`] : [],
61756
+ handler: async (inv) => {
61757
+ const source = arg(inv, 0, "a source repository", "overlane repo import acme/app").replace(/^github:/, "");
61758
+ const match = /^([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)$/.exec(source);
61759
+ if (match === null) throw new UsageError("the source must be OWNER/NAME", { hint: "overlane repo import acme/app" });
61760
+ const name2 = textFlag(inv, "name");
61761
+ const body2 = { requestId: requestId4(), source: { provider: "github", owner: match[1], name: match[2] }, mode: boolFlag(inv, "copy") ? "copy" : "mirror", ...name2 === void 0 ? {} : { name: name2 } };
61762
+ if (inv.dryRun) return planned2(inv, "repo", "POST", gitPaths.import, body2, "reads the repository through the GitHub App and imports it");
61763
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
61764
+ return { data: await call2(Repo, "POST", gitPaths.import(tenantId, projectId), body2) };
61765
+ }
61766
+ });
61767
+ var repoDeleteCommand = defineCommand({
61768
+ path: ["repo", "delete"],
61769
+ summary: "Delete a native repository and its history",
61770
+ description: "Deletes the repository, revokes its git tokens and frees its name. Deleting history cannot be undone, so without a terminal the command needs --force. Deletion is a safety class: it needs an approval from an independent agent (evidence and a reason) or a person first.",
61771
+ args: [REPO_ARG_LATE],
61772
+ examples: ["overlane repo delete app --force"],
61773
+ effect: "destructive",
61774
+ ...common3,
61775
+ keywords: ["remove repository", "delete repo"],
61776
+ result: withDryRun(DeleteRepoResponse),
61777
+ text: (d) => "deleted" in d ? [`Deleted ${d.repoId}.`] : [],
61778
+ handler: async (inv) => {
61779
+ const repo = arg(inv, 0, "a repository", "overlane repo list");
61780
+ if (inv.dryRun) return planned2(inv, "repo", "DELETE", (t, p) => gitPaths.repo(t, p, repo));
61781
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
61782
+ return { data: await call2(DeleteRepoResponse, "DELETE", gitPaths.repo(tenantId, projectId, repo), void 0, approvalHeaders(inv)) };
61783
+ },
61784
+ flags: [APPROVAL_FLAG]
61785
+ });
61786
+ var repoBranchesCommand = defineCommand({
61787
+ path: ["repo", "branches"],
61788
+ summary: "List a repository's branches and which are protected",
61789
+ description: "Lists branches with their tip commits and whether branch protection applies.",
61790
+ args: [REPO_ARG],
61791
+ examples: ["overlane repo branches app"],
61792
+ effect: "read",
61793
+ ...common3,
61794
+ keywords: ["branches", "list branches", "protected branches"],
61795
+ result: BranchListResponse,
61796
+ text: (d) => d.branches.map((branch) => `${branch.name} ${branch.sha.slice(0, 12)}${branch.protected ? " protected" : ""}`),
61797
+ handler: async (inv) => {
61798
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
61799
+ return { data: await call2(BranchListResponse, "GET", gitPaths.branches(tenantId, projectId, arg(inv, 0, "a repository", "overlane repo list"))) };
61800
+ }
61801
+ });
61802
+ var repoBranchCreateCommand = defineCommand({
61803
+ path: ["repo", "branch", "create"],
61804
+ summary: "Create a branch from the default branch or another start point",
61805
+ description: "Creates a branch. The start point is the default branch unless --from names a branch or a commit. Refused on the read-only side of a mirror.",
61806
+ args: [REPO_ARG, { name: "name", required: true, description: "The new branch" }],
61807
+ flags: [{ name: "from", type: "string", value: "BRANCH|SHA", description: "Start point (default: the default branch)" }],
61808
+ examples: ["overlane repo branch create app feature/login", "overlane repo branch create app hotfix --from release/1.2 --dry-run"],
61809
+ effect: "write",
61810
+ ...common3,
61811
+ keywords: ["new branch", "create branch", "git branch"],
61812
+ result: withDryRun(external_exports.object({ name: external_exports.string(), sha: external_exports.string() }).strict()),
61813
+ text: (d) => "sha" in d ? [`Created ${d.name} at ${d.sha.slice(0, 12)}.`] : [],
61814
+ handler: async (inv) => {
61815
+ const repo = arg(inv, 0, "a repository", "overlane repo list");
61816
+ const from = textFlag(inv, "from");
61817
+ const body2 = { name: arg(inv, 1, "a branch name", "overlane repo branch create app feature/x"), ...from === void 0 ? {} : { from } };
61818
+ if (inv.dryRun) return planned2(inv, "repo", "POST", (t, p) => gitPaths.branches(t, p, repo), body2);
61819
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
61820
+ return { data: await call2(external_exports.object({ name: external_exports.string(), sha: external_exports.string() }).strict(), "POST", gitPaths.branches(tenantId, projectId, repo), body2) };
61821
+ }
61822
+ });
61823
+ var repoBranchDeleteCommand = defineCommand({
61824
+ path: ["repo", "branch", "delete"],
61825
+ summary: "Delete a branch",
61826
+ description: "Deletes a branch and closes the pull requests that were open from it. The default branch and protected branches cannot be deleted. Needs --force without a terminal.",
61827
+ args: [REPO_ARG_LATE, { name: "name", required: false, description: "The branch to delete (required)" }],
61828
+ examples: ["overlane repo branch delete app feature/login --force"],
61829
+ effect: "destructive",
61830
+ ...common3,
61831
+ keywords: ["remove branch", "delete branch"],
61832
+ result: withDryRun(external_exports.object({ name: external_exports.string() }).strict()),
61833
+ text: (d) => "name" in d ? [`Deleted branch ${d.name}.`] : [],
61834
+ handler: async (inv) => {
61835
+ const repo = arg(inv, 0, "a repository", "overlane repo list");
61836
+ const name2 = arg(inv, 1, "a branch name", "overlane repo branches app");
61837
+ if (inv.dryRun) return planned2(inv, "repo", "DELETE", (t, p) => gitPaths.branch(t, p, repo, name2));
61838
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
61839
+ return { data: await call2(external_exports.object({ name: external_exports.string() }).strict(), "DELETE", gitPaths.branch(tenantId, projectId, repo, name2), void 0, approvalHeaders(inv)) };
61840
+ },
61841
+ flags: [APPROVAL_FLAG]
61842
+ });
61843
+ function readPushFiles(inv) {
61844
+ const files = [];
61845
+ for (const path of listFlag(inv, "file")) {
61846
+ const absolute = resolve8(inv.deps.paths.cwd, path);
61847
+ let content;
61848
+ try {
61849
+ if (statSync(absolute).size > 5e6) throw new UsageError(`${path} is larger than 5 MB; push it with git and a token instead`, { hint: `overlane repo token <repo> --scope write` });
61850
+ content = readFileSync8(absolute, "utf8");
61851
+ } catch (error62) {
61852
+ if (error62 instanceof UsageError) throw error62;
61853
+ throw new UsageError(`could not read ${path}`);
61854
+ }
61855
+ if (content.includes("\0")) throw new UsageError(`${path} is a binary file; push it with git and a token instead`, { hint: "overlane repo token <repo> --scope write" });
61856
+ files.push({ path: path.replace(/^\.\//, ""), content });
61857
+ }
61858
+ for (const path of listFlag(inv, "delete")) files.push({ path, content: null });
61859
+ return files;
61860
+ }
61861
+ var repoPushCommand = defineCommand({
61862
+ path: ["repo", "push"],
61863
+ summary: "Commit files to a branch through the API",
61864
+ description: "Commits the given files (and deletions) as one commit on a branch, for agents and clients without a git binary. The guardrail rules run on the server first: a protected branch takes changes through a pull request, an agent's push to a protected branch waits for an approval, and a credential in a file is refused. With git installed, use `overlane repo token` and a normal push instead.",
61865
+ args: [REPO_ARG],
61866
+ flags: [
61867
+ { name: "branch", type: "string", required: true, value: "NAME", description: "The branch to commit to" },
61868
+ { name: "message", type: "string", required: true, value: "TEXT", description: "The commit message" },
61869
+ { name: "file", type: "string", multiple: true, value: "PATH", description: "A text file to add or change; repeat for more" },
61870
+ { name: "delete", type: "string", multiple: true, value: "PATH", description: "A path to delete; repeat for more" },
61871
+ { name: "expect", type: "string", value: "SHA", description: "The commit the branch should be at (default: its current tip)" },
61872
+ { name: "rewrite", type: "boolean", description: "Allow a history rewrite on an unprotected branch: the commit is built on --parent instead of the tip" },
61873
+ { name: "parent", type: "string", value: "SHA", description: "With --rewrite: the commit to build on (the orphaned commits become stale)" },
61874
+ APPROVAL_FLAG
61875
+ ],
61876
+ examples: ['overlane repo push app --branch feature/login --message "Add login" --file src/login.ts', 'overlane repo push app --branch main --message "Fix" --file a.ts --dry-run'],
61877
+ effect: "write",
61878
+ ...common3,
61879
+ keywords: ["commit and push", "push files", "git push", "commit to branch"],
61880
+ result: withDryRun(PushResult),
61881
+ text: (d) => "after" in d ? [`${d.ref}: ${d.before === null ? "created at" : `${d.before.slice(0, 12)} ->`} ${d.after.slice(0, 12)}${d.forced ? " (forced)" : ""}${d.replay ? " (replayed)" : ""}`] : [],
61882
+ handler: async (inv) => {
61883
+ const repo = arg(inv, 0, "a repository", "overlane repo list");
61884
+ const branch = textFlag(inv, "branch");
61885
+ const message = textFlag(inv, "message");
61886
+ if (branch === void 0 || message === void 0) throw new UsageError("--branch and --message are required", { hint: 'overlane repo push app --branch feature/x --message "change" --file a.ts' });
61887
+ const files = readPushFiles(inv);
61888
+ if (files.length === 0) throw new UsageError("nothing to push: give --file or --delete", { hint: 'overlane repo push app --branch feature/x --message "change" --file a.ts' });
61889
+ const parent = textFlag(inv, "parent");
61890
+ if (parent !== void 0 && !boolFlag(inv, "rewrite")) throw new UsageError("--parent only makes sense with --rewrite");
61891
+ const body2 = (expectedOld) => ({ requestId: requestId4(), ref: branch, expectedOld, force: boolFlag(inv, "rewrite"), ...parent === void 0 ? {} : { parent }, commits: [{ message, files }] });
61892
+ if (inv.dryRun) {
61893
+ 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>` })) }] };
61894
+ return planned2(inv, "repo", "POST", (t, p) => gitPaths.push(t, p, repo), shown2, "one commit; the server checks protection and guardrail rules first");
61895
+ }
61896
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
61897
+ let expected = textFlag(inv, "expect") ?? null;
61898
+ if (expected === null) {
61899
+ const branches = await call2(BranchListResponse, "GET", gitPaths.branches(tenantId, projectId, repo));
61900
+ expected = branches.branches.find((entry) => entry.name === branch)?.sha ?? null;
61901
+ }
61902
+ return { data: await call2(PushResult, "POST", gitPaths.push(tenantId, projectId, repo), body2(expected), approvalHeaders(inv)) };
61903
+ }
61904
+ });
61905
+ var repoProtectCommand = defineCommand({
61906
+ path: ["repo", "protect"],
61907
+ summary: "Protect a branch: pull requests, approvals and required checks",
61908
+ description: "Sets branch protection for a branch name or pattern such as release/**. Direct pushes are refused and changes go through a pull request that needs the approvals and the required checks (CI job names). Force-push is never allowed on a protected branch. Agents and people with write access set it; under supervised autonomy it waits for approval.",
61909
+ args: [REPO_ARG],
61910
+ flags: [
61911
+ { name: "branch", type: "string", required: true, value: "PATTERN", description: "The branch or pattern to protect" },
61912
+ { name: "approvals", type: "string", value: "N", description: "Approvals a pull request needs (default 1)" },
61913
+ { name: "check", type: "string", multiple: true, value: "JOB", description: "A CI job that must pass; repeat for more" },
61914
+ { name: "merge-method", type: "string", multiple: true, enum: ["merge", "squash", "rebase"], value: "METHOD", description: "A merge method to allow; repeat for more (default: all)" }
61915
+ ],
61916
+ examples: ["overlane repo protect app --branch main --approvals 1 --check unit_tests", "overlane repo protect app --branch release/** --approvals 2 --dry-run"],
61917
+ effect: "write",
61918
+ ...common3,
61919
+ keywords: ["branch protection", "protect main", "required checks", "require review"],
61920
+ result: withDryRun(BranchProtection),
61921
+ text: (d) => "pattern" in d ? [`${d.pattern}: ${d.requiredApprovals} approval(s), checks ${d.requiredChecks.length === 0 ? "none" : d.requiredChecks.join(", ")}, merge ${d.allowedMergeMethods.join("/")}`] : [],
61922
+ handler: async (inv) => {
61923
+ const repo = arg(inv, 0, "a repository", "overlane repo list");
61924
+ const pattern = textFlag(inv, "branch");
61925
+ if (pattern === void 0) throw new UsageError("--branch is required", { hint: "overlane repo protect app --branch main" });
61926
+ const approvals = textFlag(inv, "approvals");
61927
+ const methods = listFlag(inv, "merge-method");
61928
+ const body2 = { pattern, ...approvals === void 0 ? {} : { requiredApprovals: Number(approvals) }, requiredChecks: listFlag(inv, "check"), ...methods.length === 0 ? {} : { allowedMergeMethods: methods } };
61929
+ if (approvals !== void 0 && (!/^\d+$/.test(approvals) || Number(approvals) > 10)) throw new UsageError("--approvals must be a number from 0 to 10");
61930
+ if (inv.dryRun) return planned2(inv, "repo", "PUT", (t, p) => gitPaths.protection(t, p, repo), body2);
61931
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
61932
+ return { data: await call2(BranchProtection, "PUT", gitPaths.protection(tenantId, projectId, repo), body2) };
61933
+ }
61934
+ });
61935
+ var ProtectionList = external_exports.object({ tenantId: external_exports.string(), protections: external_exports.array(BranchProtection) }).strict();
61936
+ var repoProtectionCommand = defineCommand({
61937
+ path: ["repo", "protection"],
61938
+ summary: "Show a repository's branch protection rules",
61939
+ description: "Lists the protection rules: pattern, approvals, required checks and allowed merge methods.",
61940
+ args: [REPO_ARG],
61941
+ examples: ["overlane repo protection app"],
61942
+ effect: "read",
61943
+ ...common3,
61944
+ keywords: ["protection rules", "what is protected"],
61945
+ result: ProtectionList,
61946
+ text: (d) => d.protections.length === 0 ? ["No protection rules."] : d.protections.map((rule) => `${rule.pattern}: ${rule.requiredApprovals} approval(s), checks ${rule.requiredChecks.join(", ") || "none"}`),
61947
+ handler: async (inv) => {
61948
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
61949
+ return { data: await call2(ProtectionList, "GET", gitPaths.protection(tenantId, projectId, arg(inv, 0, "a repository", "overlane repo list"))) };
61950
+ }
61951
+ });
61952
+ var repoTokenCommand = defineCommand({
61953
+ path: ["repo", "token"],
61954
+ summary: "Mint a scoped git token for one repository",
61955
+ description: "Mints a token bound to this repository, a scope (read or write), your principal and an expiry. It is shown once. Hand it to a git credential helper or an Authorization header; never put it in a remote URL or a file in the working copy. Revoke it with `overlane repo token revoke`.",
61956
+ args: [REPO_ARG],
61957
+ flags: [
61958
+ { name: "scope", type: "string", enum: ["read", "write"], value: "read|write", description: "What the token may do (default: write)" },
61959
+ { name: "ttl", type: "string", value: "SECONDS", description: "Lifetime in seconds, 60 to 86400 (default 3600)" }
61960
+ ],
61961
+ examples: ["overlane repo token app --scope read", "overlane repo token app --scope write --ttl 600 --dry-run"],
61962
+ effect: "write",
61963
+ ...common3,
61964
+ keywords: ["git credentials", "clone token", "push token", "git access token"],
61965
+ result: withDryRun(GitTokenGrant),
61966
+ text: (d) => "token" in d ? [`Token ${d.tokenId} (${d.scope}, expires ${d.expiresAt}). Shown once:`, d.token, d.usage, `remote: ${d.remote}`] : [],
61967
+ handler: async (inv) => {
61968
+ const repo = arg(inv, 0, "a repository", "overlane repo list");
61969
+ const ttl = positive(textFlag(inv, "ttl"), "ttl");
61970
+ const body2 = { scope: textFlag(inv, "scope") ?? "write", ...ttl === void 0 ? {} : { ttlSeconds: ttl } };
61971
+ if (inv.dryRun) return planned2(inv, "repo", "POST", (t, p) => gitPaths.tokens(t, p, repo), body2);
61972
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
61973
+ return { data: await call2(GitTokenGrant, "POST", gitPaths.tokens(tenantId, projectId, repo), body2) };
61974
+ }
61975
+ });
61976
+ var repoTokenRevokeCommand = defineCommand({
61977
+ path: ["repo", "token", "revoke"],
61978
+ summary: "Revoke a git token",
61979
+ description: "Revokes a token at once; any clone or push using it is refused from the next call.",
61980
+ args: [REPO_ARG_LATE, { name: "token-id", required: false, description: "The token ID shown when it was minted (required)" }],
61981
+ examples: ["overlane repo token revoke app gtk_abc123 --force"],
61982
+ effect: "destructive",
61983
+ ...common3,
61984
+ keywords: ["revoke git token", "invalidate token"],
61985
+ result: withDryRun(external_exports.object({ tokenId: external_exports.string(), revoked: external_exports.literal(true) }).strict()),
61986
+ text: (d) => "revoked" in d ? [`Revoked ${d.tokenId}.`] : [],
61987
+ handler: async (inv) => {
61988
+ const repo = arg(inv, 0, "a repository", "overlane repo list");
61989
+ const id2 = arg(inv, 1, "a token ID", "overlane repo token app");
61990
+ if (inv.dryRun) return planned2(inv, "repo", "DELETE", (t, p) => gitPaths.token(t, p, repo, id2));
61991
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
61992
+ return { data: await call2(external_exports.object({ tokenId: external_exports.string(), revoked: external_exports.literal(true) }).strict(), "DELETE", gitPaths.token(tenantId, projectId, repo, id2)) };
61993
+ }
61994
+ });
61995
+ var repoMirrorSetCommand = defineCommand({
61996
+ path: ["repo", "mirror", "set"],
61997
+ summary: "Choose which side of a mirror is writable",
61998
+ description: "Exactly one side of a mirror takes pushes. `external` keeps GitHub as the origin and makes the Overlane copy read-only; `overlane` makes Overlane the origin (then make the GitHub side read-only or archive it, and syncing from GitHub is refused). Agents and people with write access change it; under supervised autonomy it waits for approval.",
61999
+ args: [REPO_ARG],
62000
+ flags: [{ name: "writable", type: "string", required: true, enum: ["overlane", "external"], value: "overlane|external", description: "The side that takes pushes" }],
62001
+ examples: ["overlane repo mirror set app --writable overlane", "overlane repo mirror set app --writable external --dry-run"],
62002
+ effect: "write",
62003
+ ...common3,
62004
+ keywords: ["single writer", "make overlane the origin", "read only mirror", "switch origin"],
62005
+ result: withDryRun(Repo),
62006
+ text: (d) => "repoId" in d ? [`${d.name}: ${d.mirror?.writableSide ?? "overlane"} is writable.`] : [],
62007
+ handler: async (inv) => {
62008
+ const repo = arg(inv, 0, "a repository", "overlane repo list");
62009
+ const writable = textFlag(inv, "writable");
62010
+ if (writable === void 0) throw new UsageError("--writable is required", { hint: "overlane repo mirror set app --writable overlane" });
62011
+ const path = (t, p) => `${gitPaths.repo(t, p, repo)}/mirror`;
62012
+ if (inv.dryRun) return planned2(inv, "repo", "PUT", path, { writable });
62013
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
62014
+ return { data: await call2(Repo, "PUT", path(tenantId, projectId), { writable }) };
62015
+ }
62016
+ });
62017
+ var repoSyncCommand = defineCommand({
62018
+ path: ["repo", "sync"],
62019
+ summary: "Sync a mirror from its GitHub source",
62020
+ description: "Brings new commits, branches and tags from GitHub into the mirror. A rewritten branch marks the commits it dropped, the code index and the evidence recorded for those commits stale. Refused when Overlane is the writable side, because it would overwrite pushes made here.",
62021
+ args: [REPO_ARG],
62022
+ examples: ["overlane repo sync app", "overlane repo sync app --dry-run"],
62023
+ effect: "write",
62024
+ ...common3,
62025
+ keywords: ["update mirror", "pull from github", "refresh mirror"],
62026
+ result: withDryRun(MirrorSyncResponse),
62027
+ 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`}.`] : [],
62028
+ handler: async (inv) => {
62029
+ const repo = arg(inv, 0, "a repository", "overlane repo list");
62030
+ const path = (t, p) => gitPaths.sync(t, p, repo);
62031
+ if (inv.dryRun) return planned2(inv, "repo", "POST", path);
62032
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
62033
+ return { data: await call2(MirrorSyncResponse, "POST", path(tenantId, projectId)) };
62034
+ }
62035
+ });
62036
+ var IndexStatus = IndexJobsResponse.extend({ stale: external_exports.boolean() });
62037
+ var repoIndexShowCommand = defineCommand({
62038
+ path: ["repo", "index", "show"],
62039
+ summary: "Show the code index jobs and shard plan",
62040
+ description: "Shows the index jobs started by pushes, their status, whether the index is stale after a rewrite, and the shard plan of the newest snapshot (a large repository is indexed by shard, each shard checking out only its paths).",
62041
+ args: [REPO_ARG],
62042
+ examples: ["overlane repo index show app"],
62043
+ effect: "read",
62044
+ ...common3,
62045
+ keywords: ["index jobs", "shard plan", "is the index stale", "code map index"],
62046
+ result: IndexStatus,
62047
+ text: (d) => [`index ${d.stale ? "STALE (rebuild queued)" : "current"}; ${d.jobs.length} job(s)`, ...d.plan === null ? [] : [`newest snapshot ${d.plan.sha.slice(0, 12)}: ${d.plan.totalFiles} files in ${d.plan.shards.length} shard(s)${d.plan.partialCheckout ? " (partial checkout)" : ""}`]],
62048
+ handler: async (inv) => {
62049
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
62050
+ return { data: await call2(IndexStatus, "GET", gitPaths.index(tenantId, projectId, arg(inv, 0, "a repository", "overlane repo list"))) };
62051
+ }
62052
+ });
62053
+ var repoIndexRunCommand = defineCommand({
62054
+ path: ["repo", "index", "run"],
62055
+ summary: "Run the queued index jobs now",
62056
+ description: "Applies the queued index jobs. The rebuild after a force-push otherwise waits for the scheduled sweep or the next push. An older job never replaces a newer snapshot.",
62057
+ args: [REPO_ARG],
62058
+ examples: ["overlane repo index run app", "overlane repo index run app --dry-run"],
62059
+ effect: "write",
62060
+ ...common3,
62061
+ keywords: ["rebuild index", "run index jobs", "refresh code map"],
62062
+ result: withDryRun(external_exports.object({ tenantId: external_exports.string(), applied: external_exports.number(), ignored: external_exports.number() }).strict()),
62063
+ text: (d) => "applied" in d ? [`${d.applied} job(s) applied, ${d.ignored} ignored as stale.`] : [],
62064
+ handler: async (inv) => {
62065
+ const repo = arg(inv, 0, "a repository", "overlane repo list");
62066
+ const path = (t, p) => gitPaths.index(t, p, repo);
62067
+ if (inv.dryRun) return planned2(inv, "repo", "POST", path);
62068
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
62069
+ return { data: await call2(external_exports.object({ tenantId: external_exports.string(), applied: external_exports.number(), ignored: external_exports.number() }).strict(), "POST", path(tenantId, projectId)) };
62070
+ }
62071
+ });
62072
+ var prListCommand = defineCommand({
62073
+ path: ["repo", "pr", "list"],
62074
+ summary: "List pull requests",
62075
+ description: "Lists a repository's pull requests, newest first; --state narrows to open, merged or closed.",
62076
+ args: [REPO_ARG],
62077
+ flags: [{ name: "state", type: "string", enum: ["open", "merged", "closed"], value: "STATE", description: "Only pull requests in this state" }],
62078
+ examples: ["overlane repo pr list app --state open"],
62079
+ effect: "read",
62080
+ ...common3,
62081
+ keywords: ["pull requests", "list prs", "open prs", "merge requests"],
62082
+ result: PullListResponse,
62083
+ text: (d) => d.pulls.length === 0 ? ["No pull requests."] : d.pulls.map((pull) => `#${pull.number} ${pull.state.padEnd(6)} ${pull.head.branch} -> ${pull.base.branch} ${pull.title}`),
62084
+ handler: async (inv) => {
62085
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
62086
+ const state = textFlag(inv, "state");
62087
+ return { data: await call2(PullListResponse, "GET", `${gitPaths.pulls(tenantId, projectId, arg(inv, 0, "a repository", "overlane repo list"))}${state === void 0 ? "" : `?state=${state}`}`) };
62088
+ }
62089
+ });
62090
+ var prShowCommand = defineCommand({
62091
+ path: ["repo", "pr", "show"],
62092
+ summary: "Show a pull request: reviews, checks and what blocks the merge",
62093
+ description: "Shows the pull request with its reviews, required checks, approvals counted against the current head, and each blocker with a plain reason.",
62094
+ args: [REPO_ARG, PULL_ARG],
62095
+ examples: ["overlane repo pr show app 7"],
62096
+ effect: "read",
62097
+ ...common3,
62098
+ keywords: ["pull request status", "can i merge", "pr checks", "what blocks the merge"],
62099
+ result: PullStatus,
62100
+ text: (d) => [`#${d.pull.number} ${d.pull.title} (${d.pull.state}), ${d.approvals} approval(s)`, ...d.checks.map((check2) => `check ${check2.name}: ${check2.state}`), d.mergeable ? "Ready to merge." : `Blocked: ${d.blockers.map((blocker) => blocker.message).join("; ")}`],
62101
+ handler: async (inv) => {
62102
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
62103
+ return { data: await call2(PullStatus, "GET", gitPaths.pull(tenantId, projectId, arg(inv, 0, "a repository", "overlane repo list"), pullNumber(inv, 1, "overlane repo pr list app"))) };
62104
+ }
62105
+ });
62106
+ var prOpenCommand = defineCommand({
62107
+ path: ["repo", "pr", "open"],
62108
+ summary: "Open a pull request",
62109
+ description: "Opens a pull request from a branch into the default branch (or --base). The review service reviews it with deterministic checks first, and CI runs the pipeline for the head.",
62110
+ args: [REPO_ARG],
62111
+ flags: [
62112
+ { name: "head", type: "string", required: true, value: "BRANCH", description: "The branch with the changes" },
62113
+ { name: "title", type: "string", required: true, value: "TEXT", description: "The title" },
62114
+ { name: "base", type: "string", value: "BRANCH", description: "The branch to merge into (default: the default branch)" },
62115
+ { name: "body", type: "string", value: "TEXT", description: "The description" },
62116
+ { name: "draft", type: "boolean", description: "Open as a draft, which cannot be merged until it is ready" }
62117
+ ],
62118
+ examples: ['overlane repo pr open app --head feature/login --title "Add login"', 'overlane repo pr open app --head fix --title "Fix" --dry-run'],
62119
+ effect: "write",
62120
+ ...common3,
62121
+ keywords: ["open pull request", "create pr", "new pull request"],
62122
+ result: withDryRun(PullRequest),
62123
+ text: (d) => "number" in d ? [`Opened #${d.number}: ${d.title}`] : [],
62124
+ handler: async (inv) => {
62125
+ const repo = arg(inv, 0, "a repository", "overlane repo list");
62126
+ const head = textFlag(inv, "head");
62127
+ const title = textFlag(inv, "title");
62128
+ if (head === void 0 || title === void 0) throw new UsageError("--head and --title are required", { hint: 'overlane repo pr open app --head feature/x --title "Add x"' });
62129
+ const base4 = textFlag(inv, "base");
62130
+ const text = textFlag(inv, "body");
62131
+ const body2 = { requestId: requestId4(), title, head, ...base4 === void 0 ? {} : { base: base4 }, ...text === void 0 ? {} : { body: text }, draft: boolFlag(inv, "draft") };
62132
+ if (inv.dryRun) return planned2(inv, "repo", "POST", (t, p) => gitPaths.pulls(t, p, repo), body2);
62133
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
62134
+ return { data: await call2(PullRequest, "POST", gitPaths.pulls(tenantId, projectId, repo), body2) };
62135
+ }
62136
+ });
62137
+ var prReviewCommand = defineCommand({
62138
+ path: ["repo", "pr", "review"],
62139
+ summary: "Approve, request changes on, or comment on a pull request",
62140
+ description: "Records a review against the pull request's current head, so a later push makes an approval stale. The author cannot approve their own pull request; another person or an independent agent does.",
62141
+ args: [REPO_ARG, PULL_ARG],
62142
+ flags: [
62143
+ { name: "state", type: "string", required: true, enum: ["approved", "changes_requested", "commented"], value: "STATE", description: "Your review" },
62144
+ { name: "body", type: "string", value: "TEXT", description: "What you checked or what must change" }
62145
+ ],
62146
+ examples: ['overlane repo pr review app 7 --state approved --body "checked the tests"', "overlane repo pr review app 7 --state changes_requested --dry-run"],
62147
+ effect: "write",
62148
+ ...common3,
62149
+ keywords: ["approve pr", "review pull request", "request changes"],
62150
+ result: withDryRun(PullReview),
62151
+ text: (d) => "reviewId" in d ? [`${d.state} on ${d.headSha.slice(0, 12)}`] : [],
62152
+ handler: async (inv) => {
62153
+ const repo = arg(inv, 0, "a repository", "overlane repo list");
62154
+ const number4 = pullNumber(inv, 1, "overlane repo pr list app");
62155
+ const state = textFlag(inv, "state");
62156
+ if (state === void 0) throw new UsageError("--state is required", { hint: "overlane repo pr review app 7 --state approved" });
62157
+ const body2 = { requestId: requestId4(), state, body: textFlag(inv, "body") ?? "" };
62158
+ if (inv.dryRun) return planned2(inv, "repo", "POST", (t, p) => gitPaths.reviews(t, p, repo, number4), body2);
62159
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
62160
+ return { data: await call2(PullReview, "POST", gitPaths.reviews(tenantId, projectId, repo, number4), body2) };
62161
+ }
62162
+ });
62163
+ var prMergeCommand = defineCommand({
62164
+ path: ["repo", "pr", "merge"],
62165
+ summary: "Merge a pull request",
62166
+ description: "Merges when the protection rules allow: approvals on the current head, required checks passed, no changes requested, a merge method the branch allows. An agent's merge into a protected branch waits for an approval; the answer names each blocker. Exit 5 when blocked, 6 when waiting for an approval.",
62167
+ args: [REPO_ARG, PULL_ARG],
62168
+ flags: [{ name: "method", type: "string", enum: ["merge", "squash", "rebase"], value: "METHOD", description: "How to merge (default: squash)" }, APPROVAL_FLAG],
62169
+ examples: ["overlane repo pr merge app 7 --method squash", "overlane repo pr merge app 7 --dry-run"],
62170
+ effect: "write",
62171
+ ...common3,
62172
+ keywords: ["merge pr", "merge pull request", "squash merge"],
62173
+ result: withDryRun(MergeResult),
62174
+ text: (d) => "mergeSha" in d ? [`Merged #${d.pull.number} as ${d.mergeSha.slice(0, 12)}${d.replay ? " (replayed)" : ""}.`] : [],
62175
+ handler: async (inv) => {
62176
+ const repo = arg(inv, 0, "a repository", "overlane repo list");
62177
+ const number4 = pullNumber(inv, 1, "overlane repo pr list app");
62178
+ const body2 = { requestId: requestId4(), method: textFlag(inv, "method") ?? "squash" };
62179
+ if (inv.dryRun) return planned2(inv, "repo", "POST", (t, p) => gitPaths.merge(t, p, repo, number4), body2);
62180
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
62181
+ return { data: await call2(MergeResult, "POST", gitPaths.merge(tenantId, projectId, repo, number4), body2, approvalHeaders(inv)) };
62182
+ }
62183
+ });
62184
+ var prCloseCommand = defineCommand({
62185
+ path: ["repo", "pr", "close"],
62186
+ summary: "Close a pull request without merging",
62187
+ description: "Closes an open pull request. It can be reopened by opening a new one from the same branch.",
62188
+ args: [REPO_ARG, PULL_ARG],
62189
+ examples: ["overlane repo pr close app 7"],
62190
+ effect: "write",
62191
+ ...common3,
62192
+ keywords: ["close pr", "abandon pull request"],
62193
+ result: withDryRun(PullRequest),
62194
+ text: (d) => "number" in d ? [`Closed #${d.number}.`] : [],
62195
+ handler: async (inv) => {
62196
+ const repo = arg(inv, 0, "a repository", "overlane repo list");
62197
+ const number4 = pullNumber(inv, 1, "overlane repo pr list app");
62198
+ const path = (t, p) => `${gitPaths.pull(t, p, repo, number4)}/close`;
62199
+ if (inv.dryRun) return planned2(inv, "repo", "POST", path);
62200
+ const { call: call2, tenantId, projectId } = await connected2(inv, "repo");
62201
+ return { data: await call2(PullRequest, "POST", path(tenantId, projectId), {}) };
62202
+ }
62203
+ });
62204
+ var repoCommands = [
62205
+ repoListCommand,
62206
+ repoStatusCommand,
62207
+ repoShowCommand,
62208
+ repoCreateCommand,
62209
+ repoImportCommand,
62210
+ repoDeleteCommand,
62211
+ repoBranchesCommand,
62212
+ repoBranchCreateCommand,
62213
+ repoBranchDeleteCommand,
62214
+ repoPushCommand,
62215
+ repoProtectCommand,
62216
+ repoProtectionCommand,
62217
+ repoTokenCommand,
62218
+ repoTokenRevokeCommand,
62219
+ repoMirrorSetCommand,
62220
+ repoSyncCommand,
62221
+ repoIndexShowCommand,
62222
+ repoIndexRunCommand,
62223
+ prListCommand,
62224
+ prShowCommand,
62225
+ prOpenCommand,
62226
+ prReviewCommand,
62227
+ prMergeCommand,
62228
+ prCloseCommand
62229
+ ];
62230
+
62231
+ // ../cli/src/commands/ci.ts
62232
+ init_src();
62233
+ init_zod();
62234
+ import { readFileSync as readFileSync9 } from "node:fs";
62235
+ import { resolve as resolve9 } from "node:path";
62236
+ var RUN_ARG = { name: "run", required: true, description: "The run ID" };
62237
+ function arg2(inv, index, what, hint) {
62238
+ const value = inv.positionals[index];
62239
+ if (value === void 0) throw new UsageError(`${what} is required`, { hint });
62240
+ return value;
62241
+ }
62242
+ function runExit(run3) {
62243
+ if (run3.status === "failed" || run3.status === "cancelled") return EXIT.failure;
62244
+ if (run3.status === "held") return EXIT.blocked;
62245
+ return void 0;
62246
+ }
62247
+ var runLine = (run3) => `${run3.runId} ${run3.status.padEnd(9)} ${run3.trigger.padEnd(12)} ${run3.ref}@${run3.commitSha.slice(0, 12)} ${run3.totalMinutes} min`;
62248
+ var jobLines = (run3) => run3.jobs.map((job) => ` ${job.name}: ${job.status}${job.flaky ? " (flaky: passed on the re-run)" : ""}${job.cache.key === null ? "" : job.cache.hit ? ", cache hit" : ", cache miss"}, ${job.route.instance}, ${job.billedMinutes} min`);
62249
+ var ciValidateCommand = defineCommand({
62250
+ path: ["ci", "validate"],
62251
+ summary: "Check the pipeline file and show the line of each error",
62252
+ description: "Parses .overlane/ci.yml (or --file) with the parser the service runs before every run, offline. Errors are printed as path:line: message and the command exits 2; a valid file lists its jobs. Run it before pushing a change to the pipeline.",
62253
+ flags: [{ name: "file", type: "string", value: "PATH", description: "The pipeline file (default: .overlane/ci.yml)" }],
62254
+ examples: ["overlane ci validate", "overlane ci validate --file ci/test.yml --json"],
62255
+ effect: "read",
62256
+ keywords: ["validate pipeline", "check ci config", "lint workflow", "pipeline errors"],
62257
+ result: external_exports.object({ ok: external_exports.boolean(), file: external_exports.string(), jobs: external_exports.array(external_exports.string()), issues: external_exports.array(external_exports.object({ line: external_exports.number(), message: external_exports.string() }).strict()) }).strict(),
62258
+ text: (d) => d.ok ? [`${d.file} is valid: jobs ${d.jobs.join(", ")}`] : formatConfigIssues(d.file, d.issues),
62259
+ handler: async (inv) => {
62260
+ const file2 = textFlag(inv, "file") ?? PIPELINE_CONFIG_PATH;
62261
+ let text;
62262
+ try {
62263
+ text = readFileSync9(resolve9(inv.deps.paths.cwd, file2), "utf8");
62264
+ } catch {
62265
+ throw new UsageError(`could not read ${file2}`, { hint: "overlane ci validate --file <path>" });
62266
+ }
62267
+ const parsed = parsePipelineConfig(text);
62268
+ const data = { ok: parsed.ok, file: file2, jobs: parsed.ok ? Object.keys(parsed.config.jobs) : [], issues: parsed.ok ? [] : parsed.issues };
62269
+ return parsed.ok ? { data } : { data, exit: EXIT.usage };
62270
+ }
62271
+ });
62272
+ async function gitFact(inv, args2) {
62273
+ const out2 = await inv.deps.exec("git", args2, { cwd: inv.deps.paths.cwd });
62274
+ const text = out2.stdout.trim();
62275
+ return out2.code === 0 && text.length > 0 ? text : void 0;
62276
+ }
62277
+ var ciRunCommand = defineCommand({
62278
+ path: ["ci", "run"],
62279
+ summary: "Start a pipeline run for a commit",
62280
+ description: "Starts the pipeline from .overlane/ci.yml at a commit (default: the working copy's HEAD and branch). The file is read from the repository, never sent. A failed run exits 1; a run held by the pull request's cost gate exits 6 and names the setting to raise. A native project needs a repository (`overlane repo create`).",
62281
+ flags: [
62282
+ { name: "commit", type: "string", value: "SHA", description: "The full commit SHA (default: HEAD)" },
62283
+ { name: "ref", type: "string", value: "BRANCH", description: "The branch (default: the current branch)" },
62284
+ { name: "repo", type: "string", value: "REPO", description: "The repository, when the project has several" },
62285
+ { name: "pull", type: "string", value: "N", description: "Run as the pull request with this number (its head must be the commit)" },
62286
+ APPROVAL_FLAG
62287
+ ],
62288
+ examples: ["overlane ci run", "overlane ci run --commit 0123456789abcdef0123456789abcdef01234567 --ref main --dry-run"],
62289
+ effect: "write",
62290
+ ...common3,
62291
+ keywords: ["run pipeline", "start ci", "trigger build", "run tests in ci"],
62292
+ result: withDryRun(RunResponse),
62293
+ text: (d) => "run" in d ? [runLine(d.run), ...jobLines(d.run), ...d.run.reason === null ? [] : [d.run.reason], ...d.cancelled.length === 0 ? [] : [`cancelled superseded: ${d.cancelled.join(", ")}`]] : [],
62294
+ handler: async (inv) => {
62295
+ const commit = textFlag(inv, "commit") ?? await gitFact(inv, ["rev-parse", "HEAD"]);
62296
+ const ref = textFlag(inv, "ref") ?? await gitFact(inv, ["rev-parse", "--abbrev-ref", "HEAD"]);
62297
+ if (commit === void 0 || ref === void 0) throw new UsageError("could not read the commit and branch from the working copy; give --commit and --ref", { hint: "overlane ci run --commit <sha> --ref main" });
62298
+ const pull = positive(textFlag(inv, "pull"), "pull");
62299
+ const repo = textFlag(inv, "repo");
62300
+ const body2 = { requestId: requestId4(), ref, commitSha: commit, trigger: pull === void 0 ? "manual" : "pull_request", ...repo === void 0 ? {} : { repoId: repo }, ...pull === void 0 ? {} : { pullNumber: pull } };
62301
+ if (inv.dryRun) return planned2(inv, "ci", "POST", ciPaths.runs, body2, "the service reads .overlane/ci.yml at that commit and validates it first");
62302
+ const { call: call2, tenantId, projectId } = await connected2(inv, "ci");
62303
+ const result = await call2(RunResponse, "POST", ciPaths.runs(tenantId, projectId), body2, approvalHeaders(inv));
62304
+ const exit = runExit(result.run);
62305
+ return exit === void 0 ? { data: result } : { data: result, exit };
62306
+ }
62307
+ });
62308
+ var ciListCommand = defineCommand({
62309
+ path: ["ci", "list"],
62310
+ summary: "List recent pipeline runs",
62311
+ description: "Lists the project's recent runs with status, trigger, commit and minutes used.",
62312
+ examples: ["overlane ci list", "overlane ci list --json"],
62313
+ effect: "read",
62314
+ ...common3,
62315
+ keywords: ["pipeline runs", "ci status", "recent builds"],
62316
+ result: RunListResponse,
62317
+ text: (d) => d.runs.length === 0 ? ["No runs yet."] : d.runs.map(runLine),
62318
+ handler: async (inv) => {
62319
+ const { call: call2, tenantId, projectId } = await connected2(inv, "ci");
62320
+ return { data: await call2(RunListResponse, "GET", ciPaths.runs(tenantId, projectId)) };
62321
+ }
62322
+ });
62323
+ var ciShowCommand = defineCommand({
62324
+ path: ["ci", "show"],
62325
+ summary: "Show a run with its jobs, routing and cache result",
62326
+ description: "Shows a run's jobs with status, the runner each used and why (a job over 20 minutes runs on Containers), the cache hit or miss, flaky marks, minutes and cost.",
62327
+ args: [RUN_ARG],
62328
+ examples: ["overlane ci show run_abc123"],
62329
+ effect: "read",
62330
+ ...common3,
62331
+ keywords: ["run details", "job status", "why did the build fail"],
62332
+ result: PipelineRun,
62333
+ text: (d) => [runLine(d), ...jobLines(d), ...d.jobs.map((job) => ` ${job.name} route: ${job.route.reason}`)],
62334
+ handler: async (inv) => {
62335
+ const { call: call2, tenantId, projectId } = await connected2(inv, "ci");
62336
+ return { data: await call2(PipelineRun, "GET", ciPaths.run(tenantId, projectId, arg2(inv, 0, "a run ID", "overlane ci list"))) };
62337
+ }
62338
+ });
62339
+ var ciLogsCommand = defineCommand({
62340
+ path: ["ci", "logs"],
62341
+ summary: "Show a run's logs, with secrets masked",
62342
+ description: "Prints each job's log from R2. Secret values and anything shaped like a provider key are masked before storage and again here.",
62343
+ args: [RUN_ARG],
62344
+ examples: ["overlane ci logs run_abc123"],
62345
+ effect: "read",
62346
+ ...common3,
62347
+ keywords: ["build log", "ci output", "test output"],
62348
+ result: RunLogResponse,
62349
+ text: (d) => d.jobs.flatMap((job) => [`==== ${job.name} ====`, job.log]),
62350
+ handler: async (inv) => {
62351
+ const { call: call2, tenantId, projectId } = await connected2(inv, "ci");
62352
+ return { data: await call2(RunLogResponse, "GET", ciPaths.logs(tenantId, projectId, arg2(inv, 0, "a run ID", "overlane ci list"))) };
62353
+ }
62354
+ });
62355
+ var ciCancelCommand = defineCommand({
62356
+ path: ["ci", "cancel"],
62357
+ summary: "Cancel a queued or running pipeline run",
62358
+ description: "Stops the run and marks its unfinished jobs cancelled. A finished run is returned unchanged.",
62359
+ args: [RUN_ARG],
62360
+ examples: ["overlane ci cancel run_abc123", "overlane ci cancel run_abc123 --dry-run"],
62361
+ effect: "write",
62362
+ ...common3,
62363
+ keywords: ["stop build", "cancel run"],
62364
+ result: withDryRun(PipelineRun),
62365
+ text: (d) => "runId" in d ? [runLine(d)] : [],
62366
+ handler: async (inv) => {
62367
+ const run3 = arg2(inv, 0, "a run ID", "overlane ci list");
62368
+ if (inv.dryRun) return planned2(inv, "ci", "POST", (t, p) => ciPaths.cancel(t, p, run3), {});
62369
+ const { call: call2, tenantId, projectId } = await connected2(inv, "ci");
62370
+ return { data: await call2(PipelineRun, "POST", ciPaths.cancel(tenantId, projectId, run3), {}) };
62371
+ }
62372
+ });
62373
+ var ciRerunCommand = defineCommand({
62374
+ path: ["ci", "rerun"],
62375
+ summary: "Run a finished or held run again",
62376
+ description: "Starts a new run for the same commit, branch and pull request. Use it after raising the cost gate (`overlane ci settings set --max-minutes-per-pull`) for a held run.",
62377
+ args: [RUN_ARG],
62378
+ examples: ["overlane ci rerun run_abc123", "overlane ci rerun run_abc123 --dry-run"],
62379
+ effect: "write",
62380
+ ...common3,
62381
+ keywords: ["retry build", "rerun pipeline", "run again"],
62382
+ result: withDryRun(RunResponse),
62383
+ text: (d) => "run" in d ? [runLine(d.run), ...jobLines(d.run)] : [],
62384
+ handler: async (inv) => {
62385
+ const run3 = arg2(inv, 0, "a run ID", "overlane ci list");
62386
+ const body2 = { requestId: requestId4() };
62387
+ if (inv.dryRun) return planned2(inv, "ci", "POST", (t, p) => ciPaths.rerun(t, p, run3), body2);
62388
+ const { call: call2, tenantId, projectId } = await connected2(inv, "ci");
62389
+ const result = await call2(RunResponse, "POST", ciPaths.rerun(tenantId, projectId, run3), body2);
62390
+ const exit = runExit(result.run);
62391
+ return exit === void 0 ? { data: result } : { data: result, exit };
62392
+ }
62393
+ });
62394
+ var ciSecretsCommand = defineCommand({
62395
+ path: ["ci", "secrets"],
62396
+ summary: "List the project's CI secret names",
62397
+ description: "Lists secret names and when each changed. Values are never shown: they sit encrypted in the vault and reach a job only through its one-job credential, never a fork pull request.",
62398
+ examples: ["overlane ci secrets"],
62399
+ effect: "read",
62400
+ ...common3,
62401
+ keywords: ["ci secrets", "pipeline secrets", "build secrets"],
62402
+ result: CiSecretListResponse,
62403
+ text: (d) => d.secrets.length === 0 ? ["No secrets set."] : d.secrets.map((secret) => `${secret.name} updated ${secret.updatedAt}`),
62404
+ handler: async (inv) => {
62405
+ const { call: call2, tenantId, projectId } = await connected2(inv, "ci");
62406
+ return { data: await call2(CiSecretListResponse, "GET", ciPaths.secrets(tenantId, projectId)) };
62407
+ }
62408
+ });
62409
+ async function secretValue(inv, hint) {
62410
+ const envName = textFlag(inv, "from-env");
62411
+ if (envName !== void 0) {
62412
+ const value = inv.deps.env[envName];
62413
+ if (value === void 0 || value.length === 0) throw new UsageError(`${envName} is not set in the environment`, { hint });
62414
+ return { value, from: `the ${envName} environment variable` };
62415
+ }
62416
+ if (boolFlag(inv, "stdin")) {
62417
+ if (inv.deps.stdin === void 0) throw new UsageError("--stdin reads standard input, which is not available here", { hint });
62418
+ return { value: (await inv.deps.stdin.read()).replace(/\r?\n$/, ""), from: "standard input" };
62419
+ }
62420
+ throw new UsageError("give the value with --from-env VAR or --stdin; a secret is never taken from an argument", { hint });
62421
+ }
62422
+ var ciSecretSetCommand = defineCommand({
62423
+ path: ["ci", "secret", "set"],
62424
+ summary: "Set a CI secret from the environment or standard input",
62425
+ description: "Stores a secret in the encrypted vault under an UPPER_SNAKE_CASE name a pipeline lists in `secrets:`. The value comes from an environment variable (--from-env) or standard input (--stdin), never an argument that would land in shell history. Values under 8 characters are refused because they cannot be masked in logs reliably. Setting a secret is a safety class: it needs an approval from an independent agent (evidence and a reason) or a person first.",
62426
+ args: [{ name: "name", required: true, description: "The secret name, for example NPM_TOKEN" }],
62427
+ flags: [
62428
+ { name: "from-env", type: "string", value: "VAR", description: "Read the value from this environment variable" },
62429
+ { name: "stdin", type: "boolean", description: "Read the value from standard input" }
62430
+ ],
62431
+ examples: ["overlane ci secret set NPM_TOKEN --from-env NPM_TOKEN", "overlane ci secret set NPM_TOKEN --stdin --dry-run"],
62432
+ effect: "write",
62433
+ ...common3,
62434
+ keywords: ["set secret", "add secret to ci", "pipeline credential"],
62435
+ result: withDryRun(external_exports.object({ tenantId: external_exports.string(), projectId: external_exports.string(), name: external_exports.string(), updatedAt: external_exports.string() }).strict()),
62436
+ text: (d) => "updatedAt" in d ? [`Set ${d.name}. Its value is not shown again.`] : [],
62437
+ handler: async (inv) => {
62438
+ const name2 = arg2(inv, 0, "a secret name", "overlane ci secret set NPM_TOKEN --from-env NPM_TOKEN");
62439
+ if (inv.dryRun) {
62440
+ const project = await offlineProject(inv.deps, "ci");
62441
+ return planOutcome(inv.deps, dryRunPlan({ service: project.serviceUrl, requests: [{ method: "PUT", path: ciPaths.secrets(project.binding.tenantId, project.binding.projectId), body: { name: name2, value: "<hidden>" }, note: "the value is read from the environment or standard input when run for real" }] }));
62442
+ }
62443
+ const { value } = await secretValue(inv, "overlane ci secret set NPM_TOKEN --from-env NPM_TOKEN");
62444
+ const { call: call2, tenantId, projectId } = await connected2(inv, "ci");
62445
+ return { data: await call2(external_exports.object({ tenantId: external_exports.string(), projectId: external_exports.string(), name: external_exports.string(), updatedAt: external_exports.string() }).strict(), "PUT", ciPaths.secrets(tenantId, projectId), { name: name2, value }) };
62446
+ }
62447
+ });
62448
+ var ciSecretDeleteCommand = defineCommand({
62449
+ path: ["ci", "secret", "delete"],
62450
+ summary: "Delete a CI secret",
62451
+ description: "Removes the secret from the vault. Pipelines that list it fail with a plain message until it is set again. Needs --force without a terminal.",
62452
+ args: [{ name: "name", required: false, description: "The secret name (required; checked after the --force confirmation)" }],
62453
+ examples: ["overlane ci secret delete NPM_TOKEN --force"],
62454
+ effect: "destructive",
62455
+ ...common3,
62456
+ keywords: ["remove secret", "delete ci secret", "rotate secret"],
62457
+ result: withDryRun(external_exports.object({ tenantId: external_exports.string(), name: external_exports.string(), deleted: external_exports.literal(true) }).strict()),
62458
+ text: (d) => "deleted" in d ? [`Deleted ${d.name}.`] : [],
62459
+ handler: async (inv) => {
62460
+ const name2 = arg2(inv, 0, "a secret name", "overlane ci secrets");
62461
+ if (inv.dryRun) return planned2(inv, "ci", "DELETE", (t, p) => ciPaths.secret(t, p, name2));
62462
+ const { call: call2, tenantId, projectId } = await connected2(inv, "ci");
62463
+ 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)) };
62464
+ }
62465
+ });
62466
+ var ciSettingsCommand = defineCommand({
62467
+ path: ["ci", "settings"],
62468
+ summary: "Show the CI cost gate and concurrency settings",
62469
+ description: "Shows the minutes one pull request may use before further runs are held, the number of runs that execute at once, and whether a newer commit cancels superseded runs.",
62470
+ examples: ["overlane ci settings"],
62471
+ effect: "read",
62472
+ ...common3,
62473
+ keywords: ["ci limits", "cost gate", "cancel superseded", "concurrency"],
62474
+ result: CiSettings,
62475
+ text: (d) => [`cost gate: ${d.maxMinutesPerPull} minutes per pull request; ${d.maxConcurrentRuns} runs at once; superseded runs ${d.cancelSuperseded ? "are cancelled" : "keep running"}`],
62476
+ handler: async (inv) => {
62477
+ const { call: call2, tenantId, projectId } = await connected2(inv, "ci");
62478
+ return { data: await call2(CiSettings, "GET", ciPaths.settings(tenantId, projectId)) };
62479
+ }
62480
+ });
62481
+ var ciSettingsSetCommand = defineCommand({
62482
+ path: ["ci", "settings", "set"],
62483
+ summary: "Change the cost gate, concurrency or superseded-run cancelling",
62484
+ description: "Sets CI limits for the project. Raising a limit is a spend action and needs an approval from an independent agent (evidence and a reason) or a person; the cost gate is how a team caps the minutes one pull request can spend.",
62485
+ flags: [
62486
+ { name: "max-minutes-per-pull", type: "string", value: "N", description: "Minutes one pull request may use (1 to 10000)" },
62487
+ { name: "max-concurrent", type: "string", value: "N", description: "Runs that execute at once (1 to 50)" },
62488
+ { name: "cancel-superseded", type: "string", enum: ["true", "false"], value: "true|false", description: "Cancel older runs on a ref when a newer commit arrives" }
62489
+ ],
62490
+ examples: ["overlane ci settings set --max-minutes-per-pull 120", "overlane ci settings set --cancel-superseded false --dry-run"],
62491
+ effect: "write",
62492
+ ...common3,
62493
+ keywords: ["raise cost gate", "ci limits", "set minutes per pr"],
62494
+ result: withDryRun(CiSettings),
62495
+ text: (d) => "maxMinutesPerPull" in d ? [`cost gate ${d.maxMinutesPerPull} minutes per pull request, ${d.maxConcurrentRuns} concurrent, superseded runs ${d.cancelSuperseded ? "cancelled" : "kept"}`] : [],
62496
+ handler: async (inv) => {
62497
+ const minutes = positive(textFlag(inv, "max-minutes-per-pull"), "max-minutes-per-pull");
62498
+ const concurrent = positive(textFlag(inv, "max-concurrent"), "max-concurrent");
62499
+ const cancel = textFlag(inv, "cancel-superseded");
62500
+ const body2 = { ...minutes === void 0 ? {} : { maxMinutesPerPull: minutes }, ...concurrent === void 0 ? {} : { maxConcurrentRuns: concurrent }, ...cancel === void 0 ? {} : { cancelSuperseded: cancel === "true" } };
62501
+ if (Object.keys(body2).length === 0) throw new UsageError("nothing to change", { hint: "overlane ci settings set --max-minutes-per-pull 120" });
62502
+ if (inv.dryRun) return planned2(inv, "ci", "PUT", ciPaths.settings, body2);
62503
+ const { call: call2, tenantId, projectId } = await connected2(inv, "ci");
62504
+ return { data: await call2(CiSettings, "PUT", ciPaths.settings(tenantId, projectId), body2) };
62505
+ }
62506
+ });
62507
+ var ciUsageCommand = defineCommand({
62508
+ path: ["ci", "usage"],
62509
+ summary: "Show this month's CI minutes, cost and flaky tests",
62510
+ description: "Shows the minutes metered for the team this month, the cost at the runner rates, and tests marked flaky in the last 7 days (two marks in a week open an issue).",
62511
+ examples: ["overlane ci usage"],
62512
+ effect: "read",
62513
+ ...common3,
62514
+ keywords: ["ci minutes", "ci cost", "flaky tests", "build minutes"],
62515
+ result: CiUsageResponse,
62516
+ text: (d) => [`${d.month}: ${d.minutes} minutes over ${d.runs} run(s), $${(d.costMicros / 1e6).toFixed(4)}`, ...d.flaky.map((entry) => `flaky ${entry.test}: ${entry.count} in 7 days`)],
62517
+ handler: async (inv) => {
62518
+ const { call: call2, tenantId, projectId } = await connected2(inv, "ci");
62519
+ return { data: await call2(CiUsageResponse, "GET", ciPaths.usage(tenantId, projectId)) };
62520
+ }
62521
+ });
62522
+ var ciCommands = [ciValidateCommand, ciRunCommand, ciListCommand, ciShowCommand, ciLogsCommand, ciCancelCommand, ciRerunCommand, ciSecretsCommand, ciSecretSetCommand, ciSecretDeleteCommand, ciSettingsCommand, ciSettingsSetCommand, ciUsageCommand];
62523
+
62524
+ // ../cli/src/commands/deploy.ts
62525
+ init_src();
62526
+ init_zod();
62527
+ function arg3(inv, index, what, hint) {
62528
+ const value = inv.positionals[index];
62529
+ if (value === void 0) throw new UsageError(`${what} is required`, { hint });
62530
+ return value;
62531
+ }
62532
+ var releaseLine = (release) => `${release.releaseId} ${release.environment.padEnd(18)} ${release.status.padEnd(11)}${release.live ? " live" : " "} ${release.commitSha.slice(0, 12)} ${release.url ?? ""}`;
62533
+ function deployExit(release) {
62534
+ return release !== null && release.status === "failed" ? EXIT.failure : void 0;
62535
+ }
62536
+ async function secretFrom(inv, flagHint) {
62537
+ const envName = textFlag(inv, "credential-env") ?? textFlag(inv, "from-env");
62538
+ if (envName !== void 0) {
62539
+ const value = inv.deps.env[envName];
62540
+ if (value === void 0 || value.length === 0) throw new UsageError(`${envName} is not set in the environment`, { hint: flagHint });
62541
+ return value;
62542
+ }
62543
+ if (boolFlag(inv, "stdin")) {
62544
+ if (inv.deps.stdin === void 0) throw new UsageError("--stdin reads standard input, which is not available here", { hint: flagHint });
62545
+ return (await inv.deps.stdin.read()).replace(/\r?\n$/, "");
62546
+ }
62547
+ throw new UsageError("give the value with an environment variable or --stdin; a secret is never taken from an argument", { hint: flagHint });
62548
+ }
62549
+ function targetConfig(inv) {
62550
+ const kind = textFlag(inv, "kind");
62551
+ const pairs = Object.fromEntries(listFlag(inv, "set").map((entry) => {
62552
+ const at = entry.indexOf("=");
62553
+ if (at < 1) throw new UsageError(`--set takes KEY=VALUE, not ${entry}`, { hint: "overlane deploy target add site --kind workers --set scriptName=site --set accountId=abc --credential-env CF_TOKEN" });
62554
+ return [entry.slice(0, at), entry.slice(at + 1)];
62555
+ }));
62556
+ return { kind: kind ?? "", ...pairs };
62557
+ }
62558
+ var deployTargetsCommand = defineCommand({
62559
+ path: ["deploy", "targets"],
62560
+ summary: "List deploy targets and environments",
62561
+ description: "Lists the places this project deploys to (Workers, Vercel, Netlify, Fly) and the environments on them, with which are protected. Provider tokens are never shown.",
62562
+ examples: ["overlane deploy targets"],
62563
+ effect: "read",
62564
+ ...common3,
62565
+ keywords: ["deploy targets", "environments", "where do we deploy", "staging production"],
62566
+ result: TargetListResponse,
62567
+ text: (d) => [...d.targets.map((target) => `target ${target.name} (${target.config.kind}) ${target.targetId}`), ...d.environments.map((env) => `environment ${env.name}${env.protected ? " (protected)" : ""}${env.kind === "preview" ? ` (preview of ${env.branch})` : ""} -> ${env.targetId}`)],
62568
+ handler: async (inv) => {
62569
+ const { call: call2, tenantId, projectId } = await connected2(inv, "deploy");
62570
+ return { data: await call2(TargetListResponse, "GET", deployPaths.targets(tenantId, projectId)) };
62571
+ }
62572
+ });
62573
+ var deployTargetAddCommand = defineCommand({
62574
+ path: ["deploy", "target", "add"],
62575
+ summary: "Add a deploy target with its provider token",
62576
+ description: "Adds a target of kind workers, vercel, netlify or fly. Kind settings come from --set: workers needs scriptName and accountId; vercel needs projectRef (teamId optional); netlify needs siteId; fly needs app (machineId optional). The provider token comes from an environment variable or standard input and goes to the encrypted vault. Storing the provider token is a safety class: it needs an approval from an independent agent (evidence and a reason) or a person first.",
62577
+ args: [{ name: "name", required: true, description: "A name for the target, lowercase letters, digits and dashes" }],
62578
+ flags: [
62579
+ { name: "kind", type: "string", required: true, enum: [...DEPLOY_KINDS], value: "KIND", description: "The provider" },
62580
+ { name: "set", type: "string", multiple: true, value: "KEY=VALUE", description: "A setting for the kind; repeat for more" },
62581
+ { name: "credential-env", type: "string", value: "VAR", description: "Read the provider token from this environment variable" },
62582
+ { name: "stdin", type: "boolean", description: "Read the provider token from standard input" }
62583
+ ],
62584
+ examples: ["overlane deploy target add site --kind workers --set scriptName=site --set accountId=abc123 --credential-env CF_API_TOKEN", "overlane deploy target add web --kind netlify --set siteId=my-site --stdin --dry-run"],
62585
+ effect: "write",
62586
+ ...common3,
62587
+ keywords: ["add deploy target", "connect vercel", "connect netlify", "connect fly", "deploy to workers"],
62588
+ result: withDryRun(TargetResponse),
62589
+ text: (d) => "target" in d ? [`Added ${d.target.name} (${d.target.config.kind}) ${d.target.targetId}. The token is in the vault and is not shown again.`] : [],
62590
+ handler: async (inv) => {
62591
+ const name2 = arg3(inv, 0, "a target name", "overlane deploy target add site --kind workers");
62592
+ const config2 = targetConfig(inv);
62593
+ if (inv.dryRun) {
62594
+ const project = await offlineProject(inv.deps, "deploy");
62595
+ return planOutcome(inv.deps, dryRunPlan({ service: project.serviceUrl, requests: [{ method: "POST", path: deployPaths.targets(project.binding.tenantId, project.binding.projectId), body: { name: name2, config: config2, credential: "<hidden>" }, note: "the token is read from the environment or standard input when run for real" }] }));
62596
+ }
62597
+ const credential = await secretFrom(inv, "overlane deploy target add site --kind workers --credential-env CF_API_TOKEN");
62598
+ const { call: call2, tenantId, projectId } = await connected2(inv, "deploy");
62599
+ return { data: await call2(TargetResponse, "POST", deployPaths.targets(tenantId, projectId), { requestId: requestId4(), name: name2, config: config2, credential }) };
62600
+ }
62601
+ });
62602
+ var deployEnvCreateCommand = defineCommand({
62603
+ path: ["deploy", "env", "create"],
62604
+ summary: "Create an environment on a target",
62605
+ description: "Creates an environment such as staging or production. production and prod are protected by default: a deploy waits for the approval its rule demands, and verified work does not grant it. Pass --protected to protect another one. Creating one is a policy change: under supervised autonomy it waits for approval.",
62606
+ args: [{ name: "name", required: true, description: "The environment name" }],
62607
+ flags: [
62608
+ { name: "target", type: "string", required: true, value: "TARGET", description: "The target it deploys to (name or ID)" },
62609
+ { name: "protected", type: "boolean", description: "Require an approval for every deploy" }
62610
+ ],
62611
+ examples: ["overlane deploy env create staging --target site", "overlane deploy env create canary --target site --protected --dry-run"],
62612
+ effect: "write",
62613
+ ...common3,
62614
+ keywords: ["new environment", "create staging", "protected environment"],
62615
+ result: withDryRun(EnvironmentResponse),
62616
+ text: (d) => "environment" in d ? [`Created ${d.environment.name}${d.environment.protected ? " (protected)" : ""}.`] : [],
62617
+ handler: async (inv) => {
62618
+ const name2 = arg3(inv, 0, "an environment name", "overlane deploy env create staging --target site");
62619
+ const target = textFlag(inv, "target");
62620
+ if (target === void 0) throw new UsageError("--target is required", { hint: "overlane deploy targets" });
62621
+ const body2 = { name: name2, targetId: target, ...boolFlag(inv, "protected") ? { protected: true } : {} };
62622
+ if (inv.dryRun) return planned2(inv, "deploy", "POST", deployPaths.environments, body2);
62623
+ const { call: call2, tenantId, projectId } = await connected2(inv, "deploy");
62624
+ return { data: await call2(EnvironmentResponse, "POST", deployPaths.environments(tenantId, projectId), body2) };
62625
+ }
62626
+ });
62627
+ var deployEnvSecretCommand = defineCommand({
62628
+ path: ["deploy", "env", "secret", "set"],
62629
+ summary: "Set a deploy secret for an environment",
62630
+ description: "Stores a secret in the vault for one environment; only its name is recorded on the environment. The value comes from an environment variable or standard input. Values under 8 characters are refused.",
62631
+ args: [{ name: "env", required: true, description: "The environment" }, { name: "name", required: true, description: "The secret name, UPPER_SNAKE_CASE" }],
62632
+ flags: [
62633
+ { name: "from-env", type: "string", value: "VAR", description: "Read the value from this environment variable" },
62634
+ { name: "stdin", type: "boolean", description: "Read the value from standard input" }
62635
+ ],
62636
+ examples: ["overlane deploy env secret set staging API_KEY --from-env STAGING_API_KEY"],
62637
+ effect: "write",
62638
+ ...common3,
62639
+ keywords: ["environment secret", "deploy secret", "set env var secret"],
62640
+ result: withDryRun(external_exports.object({ tenantId: external_exports.string(), environment: external_exports.string(), name: external_exports.string() }).strict()),
62641
+ text: (d) => "name" in d ? [`Set ${d.name} for ${d.environment}.`] : [],
62642
+ handler: async (inv) => {
62643
+ const env = arg3(inv, 0, "an environment", "overlane deploy targets");
62644
+ const name2 = arg3(inv, 1, "a secret name", "overlane deploy env secret set staging API_KEY --from-env API_KEY");
62645
+ if (inv.dryRun) {
62646
+ const project = await offlineProject(inv.deps, "deploy");
62647
+ return planOutcome(inv.deps, dryRunPlan({ service: project.serviceUrl, requests: [{ method: "PUT", path: deployPaths.secrets(project.binding.tenantId, project.binding.projectId, env), body: { name: name2, value: "<hidden>" } }] }));
62648
+ }
62649
+ const value = await secretFrom(inv, "overlane deploy env secret set staging API_KEY --from-env API_KEY");
62650
+ const { call: call2, tenantId, projectId } = await connected2(inv, "deploy");
62651
+ return { data: await call2(external_exports.object({ tenantId: external_exports.string(), environment: external_exports.string(), name: external_exports.string() }).strict(), "PUT", deployPaths.secrets(tenantId, projectId, env), { name: name2, value }) };
62652
+ }
62653
+ });
62654
+ var deployReleasesCommand = defineCommand({
62655
+ path: ["deploy", "releases"],
62656
+ summary: "List releases and which is live in each environment",
62657
+ description: "Lists deploys newest first with status, whether each is live, the commit, who deployed, and the preview or environment URL.",
62658
+ flags: [{ name: "env", type: "string", value: "ENV", description: "Only this environment" }],
62659
+ examples: ["overlane deploy releases", "overlane deploy releases --env production"],
62660
+ effect: "read",
62661
+ ...common3,
62662
+ keywords: ["what is deployed", "deploy history", "release list", "who deployed"],
62663
+ result: ReleaseListResponse,
62664
+ text: (d) => d.releases.length === 0 ? ["No deploys yet."] : d.releases.map(releaseLine),
62665
+ handler: async (inv) => {
62666
+ const { call: call2, tenantId, projectId } = await connected2(inv, "deploy");
62667
+ return { data: await call2(ReleaseListResponse, "GET", deployPaths.releases(tenantId, projectId, textFlag(inv, "env"))) };
62668
+ }
62669
+ });
62670
+ var deployRunCommand = defineCommand({
62671
+ path: ["deploy", "run"],
62672
+ summary: "Deploy a passed CI run's artifact to an environment",
62673
+ description: "Deploys the artifact a passed pipeline run built. The service re-hashes the stored artifact against the digest recorded at build and refuses a changed one (exit 6). Production and protected environments wait for an approval (exit 6, with the command to answer it); a failed provider deploy exits 1 and the previous release keeps serving. Roll back with `overlane deploy rollback`.",
62674
+ flags: [
62675
+ { name: "env", type: "string", required: true, value: "ENV", description: "The environment" },
62676
+ { name: "commit", type: "string", required: true, value: "SHA", description: "The commit the run built" },
62677
+ { name: "run", type: "string", required: true, value: "RUN", description: "The CI run ID" },
62678
+ { name: "artifact", type: "string", value: "NAME", description: "The artifact, when the run produced several" },
62679
+ { name: "expect-digest", type: "string", value: "DIGEST", description: "Refuse unless the recorded artifact digest equals this" },
62680
+ APPROVAL_FLAG
62681
+ ],
62682
+ examples: ["overlane deploy run --env staging --commit 0123456789abcdef0123456789abcdef01234567 --run run_abc123", "overlane deploy run --env production --commit 0123456789abcdef0123456789abcdef01234567 --run run_abc123 --approval apr_1"],
62683
+ effect: "write",
62684
+ ...common3,
62685
+ keywords: ["deploy", "ship to production", "release to staging", "publish build"],
62686
+ result: withDryRun(DeployResponse),
62687
+ text: (d) => "release" in d && d.release !== null ? [releaseLine(d.release), ...d.release.status === "failed" ? [`Failed: ${d.release.error ?? "the provider refused"}. The previous release is still live.`] : [], `evidence: ${d.release.evidenceIds.length} record(s); actor ${d.release.actor.kind}:${d.release.actor.id}`] : [],
62688
+ handler: async (inv) => {
62689
+ const env = textFlag(inv, "env");
62690
+ const commit = textFlag(inv, "commit");
62691
+ const run3 = textFlag(inv, "run");
62692
+ if (env === void 0 || commit === void 0 || run3 === void 0) throw new UsageError("--env, --commit and --run are required", { hint: "overlane deploy run --env staging --commit <sha> --run <run>" });
62693
+ const artifact = textFlag(inv, "artifact");
62694
+ const digest = textFlag(inv, "expect-digest");
62695
+ const body2 = { requestId: requestId4(), environment: env, commitSha: commit, runId: run3, ...artifact === void 0 ? {} : { artifact }, ...digest === void 0 ? {} : { expectedDigest: digest } };
62696
+ if (inv.dryRun) return planned2(inv, "deploy", "POST", deployPaths.deploys, body2, "verifies the artifact digest and asks the guardrail rules before anything is deployed");
62697
+ const { call: call2, tenantId, projectId } = await connected2(inv, "deploy");
62698
+ const result = await call2(DeployResponse, "POST", deployPaths.deploys(tenantId, projectId), body2, approvalHeaders(inv));
62699
+ const exit = deployExit(result.release);
62700
+ return exit === void 0 ? { data: result } : { data: result, exit };
62701
+ }
62702
+ });
62703
+ var deployPreviewCommand = defineCommand({
62704
+ path: ["deploy", "preview"],
62705
+ summary: "Deploy a branch preview",
62706
+ description: "Makes (or updates) the preview environment for a branch from a passed run on that branch and deploys the artifact to its own preview URL. Previews are never promoted to the live URL and need no approval.",
62707
+ flags: [
62708
+ { name: "branch", type: "string", required: true, value: "BRANCH", description: "The branch" },
62709
+ { name: "target", type: "string", required: true, value: "TARGET", description: "The target (name or ID)" },
62710
+ { name: "commit", type: "string", required: true, value: "SHA", description: "The commit the run built" },
62711
+ { name: "run", type: "string", required: true, value: "RUN", description: "The CI run ID, on that branch" },
62712
+ { name: "artifact", type: "string", value: "NAME", description: "The artifact, when the run produced several" }
62713
+ ],
62714
+ examples: ["overlane deploy preview --branch feature/login --target site --commit 0123456789abcdef0123456789abcdef01234567 --run run_abc123"],
62715
+ effect: "write",
62716
+ ...common3,
62717
+ keywords: ["preview deploy", "branch preview", "preview url", "pr preview"],
62718
+ result: withDryRun(DeployResponse),
62719
+ text: (d) => "release" in d && d.release !== null ? [releaseLine(d.release)] : [],
62720
+ handler: async (inv) => {
62721
+ const branch = textFlag(inv, "branch");
62722
+ const target = textFlag(inv, "target");
62723
+ const commit = textFlag(inv, "commit");
62724
+ const run3 = textFlag(inv, "run");
62725
+ if (branch === void 0 || target === void 0 || commit === void 0 || run3 === void 0) throw new UsageError("--branch, --target, --commit and --run are required", { hint: "overlane deploy preview --branch feature/x --target site --commit <sha> --run <run>" });
62726
+ const artifact = textFlag(inv, "artifact");
62727
+ const body2 = { requestId: requestId4(), branch, targetId: target, commitSha: commit, runId: run3, ...artifact === void 0 ? {} : { artifact } };
62728
+ if (inv.dryRun) return planned2(inv, "deploy", "POST", deployPaths.previews, body2);
62729
+ const { call: call2, tenantId, projectId } = await connected2(inv, "deploy");
62730
+ const result = await call2(DeployResponse, "POST", deployPaths.previews(tenantId, projectId), body2);
62731
+ const exit = deployExit(result.release);
62732
+ return exit === void 0 ? { data: result } : { data: result, exit };
62733
+ }
62734
+ });
62735
+ var deployRollbackCommand = defineCommand({
62736
+ path: ["deploy", "rollback"],
62737
+ summary: "Restore an environment's previous release",
62738
+ description: "Puts the environment back on its previous release (or --to a named earlier one) in one call, and records who did it and why. The restored release was approved and verified at its own deploy, so a rollback is not held for a new approval. If the provider fails, nothing changes and the current release keeps serving. Needs --force without a terminal.",
62739
+ args: [{ name: "env", required: false, description: "The environment (required)" }],
62740
+ flags: [
62741
+ { name: "reason", type: "string", value: "TEXT", description: "Why; kept in the rollback record (required)" },
62742
+ { name: "to", type: "string", value: "RELEASE", description: "A specific earlier release (default: the previous one)" }
62743
+ ],
62744
+ examples: ['overlane deploy rollback production --reason "checkout is failing" --force', 'overlane deploy rollback staging --reason "bad copy" --dry-run'],
62745
+ effect: "destructive",
62746
+ ...common3,
62747
+ keywords: ["roll back deploy", "revert release", "undo deploy", "restore previous version"],
62748
+ result: withDryRun(RollbackResponse),
62749
+ text: (d) => "rollback" in d ? [`${d.rollback.environment}: ${d.rollback.fromReleaseId} -> ${d.restored.releaseId} by ${d.rollback.actor.kind}:${d.rollback.actor.id}`, `reason: ${d.rollback.reason}`] : [],
62750
+ handler: async (inv) => {
62751
+ const env = arg3(inv, 0, "an environment", "overlane deploy targets");
62752
+ const reason = textFlag(inv, "reason");
62753
+ if (reason === void 0) throw new UsageError("--reason is required", { hint: 'overlane deploy rollback production --reason "why"' });
62754
+ const to = textFlag(inv, "to");
62755
+ const body2 = { requestId: requestId4(), reason, ...to === void 0 ? {} : { toReleaseId: to } };
62756
+ if (inv.dryRun) return planned2(inv, "deploy", "POST", (t, p) => deployPaths.rollback(t, p, env), body2);
62757
+ const { call: call2, tenantId, projectId } = await connected2(inv, "deploy");
62758
+ return { data: await call2(RollbackResponse, "POST", deployPaths.rollback(tenantId, projectId, env), body2) };
62759
+ }
62760
+ });
62761
+ var deployCommands = [deployTargetsCommand, deployTargetAddCommand, deployEnvCreateCommand, deployEnvSecretCommand, deployReleasesCommand, deployRunCommand, deployPreviewCommand, deployRollbackCommand];
62762
+
62763
+ // ../cli/src/commands/guard.ts
62764
+ init_src();
62765
+ init_zod();
62766
+ import { randomUUID as randomUUID5 } from "node:crypto";
62767
+ import { readFileSync as readFileSync10 } from "node:fs";
62768
+ import { resolve as resolve10 } from "node:path";
62769
+ var common4 = { needsAuth: true, needsNetwork: true };
62770
+ var requestId5 = () => `cli-${randomUUID5()}`;
62771
+ async function connected3(inv) {
60749
62772
  const project = await connectedProject(inv.deps, "guard");
60750
62773
  return { project, call: serviceCall(inv.deps, project.serviceUrl, project.token), tenantId: project.binding.tenantId, projectId: project.binding.projectId };
60751
62774
  }
60752
- async function planned2(inv, method, path, body2, note) {
62775
+ async function planned3(inv, method, path, body2, note) {
60753
62776
  const project = await offlineProject(inv.deps, "guard");
60754
62777
  return planOutcome(inv.deps, dryRunPlan({ service: project.serviceUrl, requests: [{ method, path: path(project.binding.tenantId), ...body2 === void 0 ? {} : { body: body2 }, ...note === void 0 ? {} : { note } }] }));
60755
62778
  }
60756
62779
  function readText3(inv, path) {
60757
62780
  try {
60758
- return readFileSync8(resolve8(inv.deps.paths.cwd, path), "utf8");
62781
+ return readFileSync10(resolve10(inv.deps.paths.cwd, path), "utf8");
60759
62782
  } catch {
60760
62783
  throw new UsageError(`could not read ${path}`, { hint: "overlane guard rules test --file rules.json --tool git.push" });
60761
62784
  }
@@ -60798,12 +62821,12 @@ var guardRulesListCommand = defineCommand({
60798
62821
  description: "Lists the platform rules (always in force), then the team and project rule files and their rules. A rule change is an audit event; every file version is listed with its digest and author.",
60799
62822
  examples: ["overlane guard rules list", "overlane guard rules list --json"],
60800
62823
  effect: "read",
60801
- ...common3,
62824
+ ...common4,
60802
62825
  keywords: ["guardrails", "policy as code", "rules in force", "protected branches", "what is blocked", "rule files"],
60803
62826
  result: GuardRulesResponse,
60804
62827
  text: (d) => [...d.rules.map((rule) => `${rule.layer.padEnd(8)} ${rule.effect.padEnd(16)} ${rule.id}${rule.dryRun ? " [dry-run]" : ""} ${rule.description}`), ...d.files.map((file2) => `file ${file2.layer} v${file2.version} ${file2.digest.slice(0, 19)} by ${file2.author}`)],
60805
62828
  handler: async (inv) => {
60806
- const { call: call2, tenantId, projectId } = await connected2(inv);
62829
+ const { call: call2, tenantId, projectId } = await connected3(inv);
60807
62830
  return { data: await call2(GuardRulesResponse, "GET", `${guardPaths.rules(tenantId)}?projectId=${encodeURIComponent(projectId)}`) };
60808
62831
  }
60809
62832
  });
@@ -60873,7 +62896,7 @@ var guardRulesPutCommand = defineCommand({
60873
62896
  ],
60874
62897
  examples: ['overlane guard rules put --file rules.json --reason "freeze deploys on Fridays"', "overlane guard rules put --file rules.json --layer project --dry-run"],
60875
62898
  effect: "write",
60876
- ...common3,
62899
+ ...common4,
60877
62900
  keywords: ["publish rules", "update guardrails", "change policy", "upload rule file", "freeze deploys"],
60878
62901
  result: withDryRun(GuardRuleFileRecord),
60879
62902
  text: (d) => "version" in d ? [`Published ${d.layer} rule file v${d.version} (${d.ruleCount} rules, ${d.digest.slice(0, 19)}).`] : [],
@@ -60887,12 +62910,12 @@ var guardRulesPutCommand = defineCommand({
60887
62910
  return planOutcome(inv.deps, dryRunPlan({ service: offline.serviceUrl, requests: [{ method: "PUT", path: guardPaths.rules(offline.binding.tenantId), body: { requestId: "<generated>", layer, ...layer === "project" ? { projectId: offline.binding.projectId } : {}, content: `<contents of ${file2}>`, ...reason === void 0 ? {} : { reason } }, note: "the file is validated and scanned for credentials on the server" }] }));
60888
62911
  }
60889
62912
  const content = readText3(inv, file2);
60890
- const { call: call2, tenantId, projectId } = await connected2(inv);
60891
- return { data: await call2(GuardRuleFileRecord, "PUT", guardPaths.rules(tenantId), { requestId: requestId4(), layer, ...layer === "project" ? { projectId } : {}, content, ...reason === void 0 ? {} : { reason } }) };
62913
+ const { call: call2, tenantId, projectId } = await connected3(inv);
62914
+ return { data: await call2(GuardRuleFileRecord, "PUT", guardPaths.rules(tenantId), { requestId: requestId5(), layer, ...layer === "project" ? { projectId } : {}, content, ...reason === void 0 ? {} : { reason } }) };
60892
62915
  }
60893
62916
  });
60894
62917
  async function evaluate(inv, dryRun) {
60895
- const { call: call2, tenantId, projectId } = await connected2(inv);
62918
+ const { call: call2, tenantId, projectId } = await connected3(inv);
60896
62919
  const contentFile = textFlag(inv, "content-file");
60897
62920
  const body2 = {
60898
62921
  ...actionOf(inv),
@@ -60918,12 +62941,12 @@ var guardCheckCommand = defineCommand({
60918
62941
  flags: [...DECISION_FLAGS, { name: "approval", type: "string", value: "ID", description: "An approval that covers exactly this action" }],
60919
62942
  examples: ["overlane guard check --tool git.push --branch main --task held", 'overlane guard check --tool deploy.run --environment production --summary "Deploy build 42" --dry-run'],
60920
62943
  effect: "write",
60921
- ...common3,
62944
+ ...common4,
60922
62945
  keywords: ["check action", "pre push check", "ci gate", "is this allowed", "approval required", "blocked by policy"],
60923
62946
  result: withDryRun(GuardEvaluateResponse),
60924
62947
  text: (d) => "decision" in d ? describeDecision(d.decision) : [],
60925
62948
  handler: async (inv) => {
60926
- if (inv.dryRun) return planned2(inv, "POST", guardPaths.evaluate, { ...actionOf(inv) }, "the decision is recorded; a rule that needs approval opens one");
62949
+ if (inv.dryRun) return planned3(inv, "POST", guardPaths.evaluate, { ...actionOf(inv) }, "the decision is recorded; a rule that needs approval opens one");
60927
62950
  const reply = await evaluate(inv, false);
60928
62951
  return reply.decision.allowed ? { data: reply } : refusalOutcome(reply, reply.decision);
60929
62952
  }
@@ -60935,7 +62958,7 @@ var guardDryRunCommand = defineCommand({
60935
62958
  flags: DECISION_FLAGS,
60936
62959
  examples: ["overlane guard dry-run --tool git.push --branch main --task held", "overlane guard dry-run --tool egress.fetch --host registry.example.com --json"],
60937
62960
  effect: "read",
60938
- ...common3,
62961
+ ...common4,
60939
62962
  keywords: ["dry run rules", "what would block", "test policy", "simulate", "would be refused"],
60940
62963
  result: GuardEvaluateResponse,
60941
62964
  text: (d) => describeDecision(d.decision),
@@ -60951,14 +62974,14 @@ var guardScanCommand = defineCommand({
60951
62974
  ],
60952
62975
  examples: ["overlane guard scan --path src/config.ts", "overlane guard scan --path ci.log --source log --json"],
60953
62976
  effect: "read",
60954
- ...common3,
62977
+ ...common4,
60955
62978
  keywords: ["secret scan", "find credentials", "leaked key", "push protection", "scan file"],
60956
62979
  result: SecretScanResult,
60957
62980
  text: (d) => d.findings.length === 0 ? ["No credentials found."] : d.findings.map((finding) => `${finding.disposition.padEnd(8)} ${finding.rule}${finding.path === void 0 ? "" : ` ${finding.path}`}${finding.line === void 0 ? "" : `:${finding.line}`}`),
60958
62981
  handler: async (inv) => {
60959
62982
  const path = textFlag(inv, "path");
60960
62983
  if (path === void 0) throw new UsageError("scan needs --path", { hint: "overlane guard scan --path src/config.ts" });
60961
- const { call: call2, tenantId } = await connected2(inv);
62984
+ const { call: call2, tenantId } = await connected3(inv);
60962
62985
  const result = await call2(SecretScanResult, "POST", guardPaths.scan(tenantId), { source: textFlag(inv, "source") ?? "push", content: readText3(inv, path), path });
60963
62986
  return result.blocked ? { data: result, exit: EXIT.blocked, error: new CliError("a credential was found; nothing should be pushed until it is removed and rotated", { code: "secret_detected", exit: EXIT.blocked, hint: "overlane guard scan --path <file>" }) } : { data: result };
60964
62987
  }
@@ -60971,12 +62994,12 @@ var guardApprovalsListCommand = defineCommand({
60971
62994
  flags: [{ name: "status", type: "string", enum: ["pending", "approved", "denied"], description: "Only approvals with this status" }],
60972
62995
  examples: ["overlane guard approvals list", "overlane guard approvals list --status pending --json"],
60973
62996
  effect: "read",
60974
- ...common3,
62997
+ ...common4,
60975
62998
  keywords: ["pending approvals", "approve before write", "who needs to approve", "approval queue"],
60976
62999
  result: ApprovalList2,
60977
63000
  text: (d) => d.approvals.length === 0 ? ["No approvals."] : d.approvals.flatMap((a) => [`${a.status.padEnd(9)} ${a.id} ${a.tool} by ${a.requestedBy} (rule ${a.ruleId})`, ` ${a.summary}`]),
60978
63001
  handler: async (inv) => {
60979
- const { call: call2, tenantId } = await connected2(inv);
63002
+ const { call: call2, tenantId } = await connected3(inv);
60980
63003
  const status = textFlag(inv, "status");
60981
63004
  return { data: await call2(ApprovalList2, "GET", `${guardPaths.approvals(tenantId)}${status === void 0 ? "" : `?status=${status}`}`) };
60982
63005
  }
@@ -60993,7 +63016,7 @@ var guardApprovalsAnswerCommand = defineCommand({
60993
63016
  ],
60994
63017
  examples: ["overlane guard approvals answer apr_1 --decision approve", 'overlane guard approvals answer apr_1 --decision approve --evidence "diff reviewed" --reason "matches the task" --dry-run'],
60995
63018
  effect: "write",
60996
- ...common3,
63019
+ ...common4,
60997
63020
  keywords: ["approve action", "deny action", "answer approval", "allow push", "sign off"],
60998
63021
  result: withDryRun(GuardApproval),
60999
63022
  text: (d) => "status" in d ? [`${d.id} is ${d.status}.`] : [],
@@ -61004,8 +63027,8 @@ var guardApprovalsAnswerCommand = defineCommand({
61004
63027
  const evidence = listFlag(inv, "evidence");
61005
63028
  const parsed = AnswerGuardApprovalRequest.safeParse({ decision: textFlag(inv, "decision"), ...reason === void 0 ? {} : { reason }, ...evidence.length === 0 ? {} : { evidence } });
61006
63029
  if (!parsed.success) throw new UsageError("--decision must be approve or deny", { hint: `overlane guard approvals answer ${approvalId} --decision approve` });
61007
- if (inv.dryRun) return planned2(inv, "POST", (tenantId2) => guardPaths.answer(tenantId2, approvalId), parsed.data);
61008
- const { call: call2, tenantId } = await connected2(inv);
63030
+ if (inv.dryRun) return planned3(inv, "POST", (tenantId2) => guardPaths.answer(tenantId2, approvalId), parsed.data);
63031
+ const { call: call2, tenantId } = await connected3(inv);
61009
63032
  return { data: await call2(GuardApproval, "POST", guardPaths.answer(tenantId, approvalId), parsed.data) };
61010
63033
  }
61011
63034
  });
@@ -61014,10 +63037,10 @@ var guardCommands = [guardRulesListCommand, guardRulesTestCommand, guardRulesPut
61014
63037
  // ../cli/src/commands/memory.ts
61015
63038
  init_src();
61016
63039
  init_zod();
61017
- import { randomUUID as randomUUID5 } from "node:crypto";
63040
+ import { randomUUID as randomUUID6 } from "node:crypto";
61018
63041
  var SERVICE_FLAG3 = { name: "service", type: "string", value: "URL", description: "The service address (default: HARNESS_SERVICE_URL, then the project's binding, then the hosted service)" };
61019
63042
  var TEAM_FLAG3 = { name: "team", type: "string", value: "TENANT_ID", description: "The team (tenant) to act on (default: the one your token belongs to)" };
61020
- var common4 = { needsAuth: true, needsNetwork: true };
63043
+ var common5 = { needsAuth: true, needsNetwork: true };
61021
63044
  async function authed3(inv) {
61022
63045
  const target = await resolveTarget(inv.deps, textFlag(inv, "service"));
61023
63046
  const token = await requireToken(inv.deps, target.storeKey);
@@ -61036,7 +63059,7 @@ async function plan2(inv, method, path, body2, note) {
61036
63059
  const tenant = textFlag(inv, "team") ?? ":your-team";
61037
63060
  return planOutcome(inv.deps, dryRunPlan({ service: target.service, requests: [{ method, path: path(tenant), ...body2 === void 0 ? {} : { body: body2 }, ...note === void 0 ? {} : { note } }] }));
61038
63061
  }
61039
- var requestId5 = () => `cli-${randomUUID5()}`;
63062
+ var requestId6 = () => `cli-${randomUUID6()}`;
61040
63063
  var memorySearchCommand = defineCommand({
61041
63064
  path: ["memory", "search"],
61042
63065
  summary: "Search memory across project, team, user and global scopes",
@@ -61051,7 +63074,7 @@ var memorySearchCommand = defineCommand({
61051
63074
  ],
61052
63075
  examples: ['overlane memory search "how do we deploy"', 'overlane memory search "indentation" --scope team --json'],
61053
63076
  effect: "read",
61054
- ...common4,
63077
+ ...common5,
61055
63078
  keywords: ["recall", "remember", "what do we know", "find memory", "lookup", "notes", "conventions", "decisions"],
61056
63079
  result: MemorySearchResponse,
61057
63080
  text: (d) => d.items.length === 0 ? ["No memories match."] : d.items.map((i2) => `${i2.scope.padEnd(7)} ${i2.status.padEnd(9)} ${i2.id} ${i2.title}${i2.stale ? " [stale]" : ""}${i2.overriddenBy === null ? "" : ` [overridden by ${i2.overriddenBy}]`}`),
@@ -61085,7 +63108,7 @@ var memoryAddCommand = defineCommand({
61085
63108
  ],
61086
63109
  examples: ['overlane memory add --title "Deploy day" "Deploys go out on Tuesdays" --project prj_1', 'overlane memory add --title "Editor" --scope user "I prefer a dark theme" --dry-run'],
61087
63110
  effect: "write",
61088
- ...common4,
63111
+ ...common5,
61089
63112
  keywords: ["remember this", "save a note", "record a decision", "store convention", "candidate"],
61090
63113
  result: AddResult,
61091
63114
  handler: async (inv) => {
@@ -61093,7 +63116,7 @@ var memoryAddCommand = defineCommand({
61093
63116
  if (title === void 0) throw new UsageError("add needs --title", { hint: 'overlane memory add --title "..." "<text>"' });
61094
63117
  const project = textFlag(inv, "project");
61095
63118
  const parsed = MemoryCandidate.safeParse({
61096
- requestId: requestId5(),
63119
+ requestId: requestId6(),
61097
63120
  scope: textFlag(inv, "scope") ?? "project",
61098
63121
  ...project === void 0 ? {} : { projectId: project },
61099
63122
  category: textFlag(inv, "category") ?? "fact",
@@ -61124,7 +63147,7 @@ var memoryConfirmCommand = defineCommand({
61124
63147
  ],
61125
63148
  examples: ["overlane memory confirm mem_ab12", "overlane memory confirm mem_ab12 --basis ci_evidence --evidence 0123abc:unit_tests --dry-run"],
61126
63149
  effect: "write",
61127
- ...common4,
63150
+ ...common5,
61128
63151
  keywords: ["approve memory", "verify", "promote candidate", "second observer", "ci evidence"],
61129
63152
  result: ConfirmResult,
61130
63153
  handler: async (inv) => {
@@ -61148,7 +63171,7 @@ var memoryPromoteCommand = defineCommand({
61148
63171
  flags: [SERVICE_FLAG3, TEAM_FLAG3, { name: "to", type: "string", enum: ["team", "global"], default: "team", description: "Where to promote it" }],
61149
63172
  examples: ["overlane memory promote mem_ab12 --to team", "overlane memory promote mem_cd34 --to global --dry-run"],
61150
63173
  effect: "write",
61151
- ...common4,
63174
+ ...common5,
61152
63175
  keywords: ["share with team", "contribute", "global memory", "make team wide"],
61153
63176
  result: withDryRun(MemoryPromoteResponse),
61154
63177
  handler: async (inv) => {
@@ -61176,7 +63199,7 @@ var memoryExportCommand = defineCommand({
61176
63199
  ],
61177
63200
  examples: ["overlane memory export --json", "overlane memory export --scope user --user usr_1 --json"],
61178
63201
  effect: "read",
61179
- ...common4,
63202
+ ...common5,
61180
63203
  keywords: ["download memory", "backup", "data portability", "gdpr", "subject access"],
61181
63204
  result: MemoryExportRecord,
61182
63205
  text: (d) => [`${d.items.length} memories exported at ${d.exportedAt}. Use --json for the full content.`],
@@ -61200,7 +63223,7 @@ var memoryDeleteCommand = defineCommand({
61200
63223
  flags: [SERVICE_FLAG3, TEAM_FLAG3],
61201
63224
  examples: ["overlane memory delete mem_ab12 --force", "overlane memory delete mem_ab12 --dry-run"],
61202
63225
  effect: "destructive",
61203
- ...common4,
63226
+ ...common5,
61204
63227
  keywords: ["remove memory", "forget", "erase", "wrong memory", "gdpr deletion"],
61205
63228
  result: withDryRun(MemoryDeleteResponse),
61206
63229
  handler: async (inv) => {
@@ -61221,7 +63244,7 @@ var memoryUnlearnCommand = defineCommand({
61221
63244
  flags: [SERVICE_FLAG3, TEAM_FLAG3],
61222
63245
  examples: ["overlane memory unlearn mem_ab12 --force", "overlane memory unlearn mem_ab12 --dry-run"],
61223
63246
  effect: "destructive",
61224
- ...common4,
63247
+ ...common5,
61225
63248
  keywords: ["unlearn", "forget everything derived", "retract", "poisoned memory", "bad memory"],
61226
63249
  result: withDryRun(MemoryUnlearnRecord),
61227
63250
  handler: async (inv) => {
@@ -61241,7 +63264,7 @@ var memoryStatusCommand = defineCommand({
61241
63264
  flags: [SERVICE_FLAG3, TEAM_FLAG3],
61242
63265
  examples: ["overlane memory status", "overlane memory status --json"],
61243
63266
  effect: "read",
61244
- ...common4,
63267
+ ...common5,
61245
63268
  keywords: ["memory health", "stale memory", "how many memories", "contribution", "opt in"],
61246
63269
  result: MemoryStatusResponse,
61247
63270
  text: (d) => [...Object.entries(d.counts).map(([key, n]) => `${key}: ${n}`), `stale: ${d.stale}`, `global contribution: ${d.settings.globalContribution ? "on" : "off"}`, `pending jobs: ${d.pendingJobs}`],
@@ -61259,7 +63282,7 @@ var memoryContributionCommand = defineCommand({
61259
63282
  flags: [SERVICE_FLAG3, TEAM_FLAG3],
61260
63283
  examples: ["overlane memory contribution on", "overlane memory contribution off --dry-run"],
61261
63284
  effect: "write",
61262
- ...common4,
63285
+ ...common5,
61263
63286
  keywords: ["opt in", "opt out", "share patterns", "global pool", "contribute"],
61264
63287
  result: withDryRun(MemorySettings),
61265
63288
  handler: async (inv) => {
@@ -61279,10 +63302,10 @@ var memoryCommands = [memorySearchCommand, memoryAddCommand, memoryConfirmComman
61279
63302
  // ../cli/src/commands/issue.ts
61280
63303
  init_src();
61281
63304
  init_zod();
61282
- import { randomUUID as randomUUID6 } from "node:crypto";
61283
- import { readFileSync as readFileSync9 } from "node:fs";
61284
- var common5 = { needsAuth: true, needsNetwork: true };
61285
- var requestId6 = () => `cli-${randomUUID6()}`;
63305
+ import { randomUUID as randomUUID7 } from "node:crypto";
63306
+ import { readFileSync as readFileSync11 } from "node:fs";
63307
+ var common6 = { needsAuth: true, needsNetwork: true };
63308
+ var requestId7 = () => `cli-${randomUUID7()}`;
61286
63309
  var PRIORITIES = ["P0", "P1", "P2", "P3"];
61287
63310
  var STATUSES = ["backlog", "todo", "in_progress", "in_review", "cancelled"];
61288
63311
  async function send(deps, label, schema, method, path, body2, dryRun) {
@@ -61319,7 +63342,7 @@ var issueListCommand = defineCommand({
61319
63342
  flags: [{ name: "status", type: "string", enum: ["backlog", "todo", "in_progress", "in_review", "done", "cancelled"], description: "Only issues in this status" }],
61320
63343
  examples: ["overlane issue list", "overlane issue list --status todo --json"],
61321
63344
  effect: "read",
61322
- ...common5,
63345
+ ...common6,
61323
63346
  keywords: ["issues", "backlog", "tickets", "work items", "what is open", "list issues"],
61324
63347
  result: external_exports.object({ issues: external_exports.array(IssueShown) }),
61325
63348
  handler: async (inv) => {
@@ -61340,7 +63363,7 @@ var issueShowCommand = defineCommand({
61340
63363
  args: [{ name: "issue-id", required: true, description: "The issue ID, for example iss_ab12cd34ef56gh78" }],
61341
63364
  examples: ["overlane issue show iss_ab12cd34ef56gh78"],
61342
63365
  effect: "read",
61343
- ...common5,
63366
+ ...common6,
61344
63367
  keywords: ["issue details", "ticket", "view issue", "who is working on"],
61345
63368
  result: IssueShown,
61346
63369
  handler: async (inv) => {
@@ -61363,7 +63386,7 @@ var issueEventsCommand = defineCommand({
61363
63386
  args: [{ name: "issue-id", required: true, description: "The issue ID" }],
61364
63387
  examples: ["overlane issue events iss_ab12cd34ef56gh78"],
61365
63388
  effect: "read",
61366
- ...common5,
63389
+ ...common6,
61367
63390
  keywords: ["audit", "history", "who changed", "field changes", "issue log"],
61368
63391
  result: IssueEventList,
61369
63392
  handler: async (inv) => {
@@ -61388,12 +63411,12 @@ var issueNewCommand = defineCommand({
61388
63411
  ],
61389
63412
  examples: ['overlane issue new "Back-time drifts by a second"', 'overlane issue new "Fix export" --priority P0 --description "Fails on empty notes"'],
61390
63413
  effect: "write",
61391
- ...common5,
63414
+ ...common6,
61392
63415
  keywords: ["create issue", "new issue", "file a ticket", "add work item", "report bug"],
61393
63416
  result: withDryRun(Issue),
61394
63417
  handler: async (inv) => {
61395
63418
  const estimate = textFlag(inv, "estimate");
61396
- const body2 = { requestId: requestId6(), title: inv.positionals.join(" "), description: textFlag(inv, "description") ?? "", priority: priorityFlag(inv) ?? "P1", status: textFlag(inv, "status") ?? "backlog", ...estimate === void 0 ? {} : { estimate: Number(estimate) } };
63419
+ const body2 = { requestId: requestId7(), title: inv.positionals.join(" "), description: textFlag(inv, "description") ?? "", priority: priorityFlag(inv) ?? "P1", status: textFlag(inv, "status") ?? "backlog", ...estimate === void 0 ? {} : { estimate: Number(estimate) } };
61397
63420
  const result = await send(inv.deps, "issue", Issue, "POST", issuePaths.issues, body2, inv.dryRun);
61398
63421
  if (result.value !== void 0) say(inv.deps, `Created #${result.value.number} ${result.value.issueId}`);
61399
63422
  return result;
@@ -61413,7 +63436,7 @@ var issueUpdateCommand = defineCommand({
61413
63436
  ],
61414
63437
  examples: ["overlane issue update iss_ab12cd34ef56gh78 --priority P0", 'overlane issue update iss_ab12cd34ef56gh78 --status in_progress --title "New title"'],
61415
63438
  effect: "write",
61416
- ...common5,
63439
+ ...common6,
61417
63440
  keywords: ["edit issue", "change status", "change priority", "rename issue", "update ticket"],
61418
63441
  result: withDryRun(Issue),
61419
63442
  handler: async (inv) => {
@@ -61421,7 +63444,7 @@ var issueUpdateCommand = defineCommand({
61421
63444
  if (id2 === void 0) throw new UsageError("update needs an ISSUE_ID");
61422
63445
  const estimate = textFlag(inv, "estimate");
61423
63446
  const body2 = {
61424
- requestId: requestId6(),
63447
+ requestId: requestId7(),
61425
63448
  ...textFlag(inv, "title") === void 0 ? {} : { title: textFlag(inv, "title") },
61426
63449
  ...textFlag(inv, "description") === void 0 ? {} : { description: textFlag(inv, "description") },
61427
63450
  ...textFlag(inv, "status") === void 0 ? {} : { status: textFlag(inv, "status") },
@@ -61442,14 +63465,14 @@ var issueAssignCommand = defineCommand({
61442
63465
  ],
61443
63466
  examples: ["overlane issue assign iss_ab12cd34ef56gh78 agent:claude-code", "overlane issue assign iss_ab12cd34ef56gh78 none"],
61444
63467
  effect: "write",
61445
- ...common5,
63468
+ ...common6,
61446
63469
  keywords: ["assign", "give to agent", "hand to bot", "delegate", "who works on this", "unassign"],
61447
63470
  result: withDryRun(AssignResult),
61448
63471
  handler: async (inv) => {
61449
63472
  const id2 = inv.positionals[0];
61450
63473
  if (id2 === void 0) throw new UsageError("assign needs an ISSUE_ID and an assignee");
61451
63474
  const assignee = parseAssignee(inv.positionals[1]);
61452
- const result = await send(inv.deps, "issue", AssignResult, "POST", (t, p) => issuePaths.assign(t, p, id2), { requestId: requestId6(), assignee }, inv.dryRun);
63475
+ const result = await send(inv.deps, "issue", AssignResult, "POST", (t, p) => issuePaths.assign(t, p, id2), { requestId: requestId7(), assignee }, inv.dryRun);
61453
63476
  if (result.value !== void 0) say(inv.deps, result.value.taskId === null ? "Assigned." : `Assigned. Task: ${result.value.taskId}${result.value.createdTask ? " (new)" : ""}`);
61454
63477
  return result;
61455
63478
  }
@@ -61465,7 +63488,7 @@ var issueImportCommand = defineCommand({
61465
63488
  flags: [{ name: "preview", type: "boolean", description: "Report what the import would create or update, and write nothing" }],
61466
63489
  examples: ["overlane issue import linear ./linear-export.json --preview", "overlane issue import jira ./jira-search.json"],
61467
63490
  effect: "write",
61468
- ...common5,
63491
+ ...common6,
61469
63492
  keywords: ["import", "migrate from linear", "migrate from jira", "github projects import", "bring issues in"],
61470
63493
  result: withDryRun(ImportReport),
61471
63494
  handler: async (inv) => {
@@ -61474,11 +63497,11 @@ var issueImportCommand = defineCommand({
61474
63497
  if (file2 === void 0) throw new UsageError("import needs the path of the export file");
61475
63498
  let data;
61476
63499
  try {
61477
- data = JSON.parse(readFileSync9(file2, "utf8"));
63500
+ data = JSON.parse(readFileSync11(file2, "utf8"));
61478
63501
  } catch {
61479
63502
  throw new UsageError(`${file2} is not a readable JSON file`);
61480
63503
  }
61481
- const result = await send(inv.deps, "issue", ImportReport, "POST", issuePaths.import, { requestId: requestId6(), source, dryRun: boolFlag(inv, "preview"), data }, inv.dryRun);
63504
+ const result = await send(inv.deps, "issue", ImportReport, "POST", issuePaths.import, { requestId: requestId7(), source, dryRun: boolFlag(inv, "preview"), data }, inv.dryRun);
61482
63505
  if (result.value !== void 0) {
61483
63506
  const r = result.value;
61484
63507
  say(inv.deps, `${r.dryRun ? "Would import" : "Imported"} from ${r.source}: ${r.created} new, ${r.updated} updated, ${r.unchanged} unchanged, ${r.skipped.length} skipped.`);
@@ -61492,7 +63515,7 @@ var issueSyncCommand = defineCommand({
61492
63515
  description: "Overlane issues work with no sync; syncing with GitHub is optional. Shows the repository and mode: off (default), read_only (GitHub changes flow in, nothing is written to GitHub) or write_back (switched on with `overlane issue sync set`).",
61493
63516
  examples: ["overlane issue sync"],
61494
63517
  effect: "read",
61495
- ...common5,
63518
+ ...common6,
61496
63519
  keywords: ["github sync", "sync status", "two-way sync", "write back"],
61497
63520
  result: SyncConfig,
61498
63521
  handler: async (inv) => {
@@ -61512,13 +63535,13 @@ var issueSyncSetCommand = defineCommand({
61512
63535
  ],
61513
63536
  examples: ["overlane issue sync set acme/app read_only", "overlane issue sync set acme/app off"],
61514
63537
  effect: "write",
61515
- ...common5,
63538
+ ...common6,
61516
63539
  keywords: ["enable github sync", "write back", "turn off sync", "read only sync"],
61517
63540
  result: withDryRun(SyncConfig),
61518
63541
  handler: async (inv) => {
61519
63542
  const [repository, mode] = inv.positionals;
61520
63543
  if (repository === void 0 || mode === void 0) throw new UsageError("sync set needs REPOSITORY and MODE");
61521
- return send(inv.deps, "issue", SyncConfig, "PUT", issuePaths.sync, { requestId: requestId6(), repository, mode }, inv.dryRun);
63544
+ return send(inv.deps, "issue", SyncConfig, "PUT", issuePaths.sync, { requestId: requestId7(), repository, mode }, inv.dryRun);
61522
63545
  }
61523
63546
  });
61524
63547
  var issueCommands = [issueListCommand, issueShowCommand, issueEventsCommand, issueNewCommand, issueUpdateCommand, issueAssignCommand, issueImportCommand, issueSyncCommand, issueSyncSetCommand];
@@ -61526,7 +63549,7 @@ var issueCommands = [issueListCommand, issueShowCommand, issueEventsCommand, iss
61526
63549
  // ../cli/src/commands/issue-views.ts
61527
63550
  init_src();
61528
63551
  init_zod();
61529
- var common6 = { needsAuth: true, needsNetwork: true };
63552
+ var common7 = { needsAuth: true, needsNetwork: true };
61530
63553
  var Deleted = external_exports.object({ deleted: external_exports.literal(true) });
61531
63554
  var FIELDS = ["status", "priority", "assigneeType", "assignee", "labelId", "workProjectId", "cycleId", "estimate", "source", "title", "number", "createdAt", "updatedAt"];
61532
63555
  function parseCondition(text) {
@@ -61542,7 +63565,7 @@ var viewListCommand = defineCommand({
61542
63565
  description: "Lists saved views: a filter plus a group-by and sort over any issue field.",
61543
63566
  examples: ["overlane view list"],
61544
63567
  effect: "read",
61545
- ...common6,
63568
+ ...common7,
61546
63569
  keywords: ["saved views", "filters", "board", "group by"],
61547
63570
  result: ViewList,
61548
63571
  handler: async (inv) => {
@@ -61560,7 +63583,7 @@ var viewRunCommand = defineCommand({
61560
63583
  args: [{ name: "view-id", required: true, description: "The saved view ID" }],
61561
63584
  examples: ["overlane view run viw_ab12cd34ef56gh78"],
61562
63585
  effect: "read",
61563
- ...common6,
63586
+ ...common7,
61564
63587
  keywords: ["run view", "show board", "group issues"],
61565
63588
  result: ViewResult,
61566
63589
  handler: async (inv) => {
@@ -61588,12 +63611,12 @@ var viewNewCommand = defineCommand({
61588
63611
  ],
61589
63612
  examples: ["overlane view new Urgent --filter priority=P0 --group-by status", 'overlane view new "Agent work" --filter assigneeType=agent --group-by status'],
61590
63613
  effect: "write",
61591
- ...common6,
63614
+ ...common7,
61592
63615
  keywords: ["create view", "save filter", "board", "group by status"],
61593
63616
  result: withDryRun(SavedView),
61594
63617
  handler: async (inv) => {
61595
63618
  const definition = { filter: listFlag(inv, "filter").map(parseCondition), groupBy: textFlag(inv, "group-by") ?? null, sortBy: textFlag(inv, "sort-by") ?? "number", sortDirection: boolFlag(inv, "desc") ? "desc" : "asc" };
61596
- return send(inv.deps, "view", SavedView, "POST", issuePaths.views, { requestId: requestId6(), name: inv.positionals.join(" "), definition }, inv.dryRun);
63619
+ return send(inv.deps, "view", SavedView, "POST", issuePaths.views, { requestId: requestId7(), name: inv.positionals.join(" "), definition }, inv.dryRun);
61597
63620
  }
61598
63621
  });
61599
63622
  var viewDeleteCommand = defineCommand({
@@ -61603,7 +63626,7 @@ var viewDeleteCommand = defineCommand({
61603
63626
  args: [{ name: "view-id", required: false, description: "The saved view ID (required; checked after the --force confirmation)" }],
61604
63627
  examples: ["overlane view delete viw_ab12cd34ef56gh78 --force"],
61605
63628
  effect: "destructive",
61606
- ...common6,
63629
+ ...common7,
61607
63630
  keywords: ["remove view", "delete filter"],
61608
63631
  result: withDryRun(Deleted),
61609
63632
  handler: async (inv) => {
@@ -61618,7 +63641,7 @@ var loopListCommand = defineCommand({
61618
63641
  description: "Lists loops: a trigger (schedule or event), a filter over issues and the executor they dispatch.",
61619
63642
  examples: ["overlane loop list"],
61620
63643
  effect: "read",
61621
- ...common6,
63644
+ ...common7,
61622
63645
  keywords: ["loops", "scheduled work", "recurring", "automation"],
61623
63646
  result: LoopList,
61624
63647
  handler: async (inv) => {
@@ -61642,7 +63665,7 @@ var loopNewCommand = defineCommand({
61642
63665
  ],
61643
63666
  examples: ["overlane loop new Nightly --every 1440 --filter priority=P0", "overlane loop new OnAssign --on issue.assigned"],
61644
63667
  effect: "write",
61645
- ...common6,
63668
+ ...common7,
61646
63669
  keywords: ["schedule agent", "recurring work", "event trigger", "automation", "nightly"],
61647
63670
  result: withDryRun(LoopDefinition),
61648
63671
  handler: async (inv) => {
@@ -61650,7 +63673,7 @@ var loopNewCommand = defineCommand({
61650
63673
  const on = textFlag(inv, "on");
61651
63674
  if (every === void 0 === (on === void 0)) throw new UsageError("pass exactly one of --every MINUTES or --on EVENT");
61652
63675
  const trigger = every !== void 0 ? { kind: "schedule", everyMinutes: Number(every) } : { kind: "event", on };
61653
- return send(inv.deps, "loop", LoopDefinition, "POST", issuePaths.loops, { requestId: requestId6(), name: inv.positionals.join(" "), trigger, filter: listFlag(inv, "filter").map(parseCondition), executor: textFlag(inv, "executor") ?? "claude-code" }, inv.dryRun);
63676
+ return send(inv.deps, "loop", LoopDefinition, "POST", issuePaths.loops, { requestId: requestId7(), name: inv.positionals.join(" "), trigger, filter: listFlag(inv, "filter").map(parseCondition), executor: textFlag(inv, "executor") ?? "claude-code" }, inv.dryRun);
61654
63677
  }
61655
63678
  });
61656
63679
  var loopSetCommand = defineCommand({
@@ -61663,13 +63686,13 @@ var loopSetCommand = defineCommand({
61663
63686
  ],
61664
63687
  examples: ["overlane loop set lop_ab12cd34ef56gh78 off"],
61665
63688
  effect: "write",
61666
- ...common6,
63689
+ ...common7,
61667
63690
  keywords: ["disable loop", "enable loop", "stop schedule"],
61668
63691
  result: withDryRun(LoopDefinition),
61669
63692
  handler: async (inv) => {
61670
63693
  const [id2, state] = inv.positionals;
61671
63694
  if (id2 === void 0 || state !== "on" && state !== "off") throw new UsageError("set needs a LOOP_ID and on or off");
61672
- return send(inv.deps, "loop", LoopDefinition, "PATCH", (t, p) => issuePaths.loop(t, p, id2), { requestId: requestId6(), enabled: state === "on" }, inv.dryRun);
63695
+ return send(inv.deps, "loop", LoopDefinition, "PATCH", (t, p) => issuePaths.loop(t, p, id2), { requestId: requestId7(), enabled: state === "on" }, inv.dryRun);
61673
63696
  }
61674
63697
  });
61675
63698
  var loopFireCommand = defineCommand({
@@ -61679,13 +63702,13 @@ var loopFireCommand = defineCommand({
61679
63702
  args: [{ name: "loop-id", required: true, description: "The loop ID" }],
61680
63703
  examples: ["overlane loop fire lop_ab12cd34ef56gh78"],
61681
63704
  effect: "write",
61682
- ...common6,
63705
+ ...common7,
61683
63706
  keywords: ["run loop", "trigger loop", "dispatch agent"],
61684
63707
  result: withDryRun(LoopRun),
61685
63708
  handler: async (inv) => {
61686
63709
  const id2 = inv.positionals[0];
61687
63710
  if (id2 === void 0) throw new UsageError("fire needs a LOOP_ID");
61688
- const result = await send(inv.deps, "loop", LoopRun, "POST", (t, p) => issuePaths.loopFire(t, p, id2), { requestId: requestId6(), trigger: "schedule" }, inv.dryRun);
63711
+ const result = await send(inv.deps, "loop", LoopRun, "POST", (t, p) => issuePaths.loopFire(t, p, id2), { requestId: requestId7(), trigger: "schedule" }, inv.dryRun);
61689
63712
  if (result.value !== void 0) say(inv.deps, `Loop run ${result.value.runId ?? "(none)"}: ${result.value.claimed.length} claimed, stopped: ${result.value.stopReason}.`);
61690
63713
  return result;
61691
63714
  }
@@ -61697,7 +63720,7 @@ var loopDeleteCommand = defineCommand({
61697
63720
  args: [{ name: "loop-id", required: false, description: "The loop ID (required; checked after the --force confirmation)" }],
61698
63721
  examples: ["overlane loop delete lop_ab12cd34ef56gh78 --force"],
61699
63722
  effect: "destructive",
61700
- ...common6,
63723
+ ...common7,
61701
63724
  keywords: ["remove loop", "delete schedule"],
61702
63725
  result: withDryRun(Deleted),
61703
63726
  handler: async (inv) => {
@@ -61711,15 +63734,15 @@ var loopCommands = [loopListCommand, loopNewCommand, loopSetCommand, loopFireCom
61711
63734
 
61712
63735
  // ../cli/src/commands/review.ts
61713
63736
  init_src();
61714
- import { randomUUID as randomUUID7 } from "node:crypto";
61715
- import { resolve as resolve9 } from "node:path";
61716
- var common7 = { needsAuth: true, needsNetwork: true };
61717
- var requestId7 = () => `cli-${randomUUID7()}`;
61718
- async function connected3(inv) {
63737
+ import { randomUUID as randomUUID8 } from "node:crypto";
63738
+ import { resolve as resolve11 } from "node:path";
63739
+ var common8 = { needsAuth: true, needsNetwork: true };
63740
+ var requestId8 = () => `cli-${randomUUID8()}`;
63741
+ async function connected4(inv) {
61719
63742
  const project = await connectedProject(inv.deps, "review");
61720
63743
  return { project, call: serviceCall(inv.deps, project.serviceUrl, project.token), tenantId: project.binding.tenantId, projectId: project.binding.projectId };
61721
63744
  }
61722
- async function planned3(inv, method, path, body2, note) {
63745
+ async function planned4(inv, method, path, body2, note) {
61723
63746
  const project = await offlineProject(inv.deps, "review");
61724
63747
  return planOutcome(inv.deps, dryRunPlan({ service: project.serviceUrl, requests: [{ method, path: path(project.binding.tenantId, project.binding.projectId), ...body2 === void 0 ? {} : { body: body2 }, ...note === void 0 ? {} : { note } }] }));
61725
63748
  }
@@ -61747,7 +63770,7 @@ async function diffOf(inv) {
61747
63770
  text = await inv.deps.stdin.read();
61748
63771
  } else {
61749
63772
  from = flag;
61750
- text = readText(resolve9(inv.deps.paths.cwd, flag));
63773
+ text = readText(resolve11(inv.deps.paths.cwd, flag));
61751
63774
  if (text === null) throw new UsageError(`could not read the diff file ${flag}`, { hint: "git diff > change.patch && overlane review run --diff change.patch" });
61752
63775
  }
61753
63776
  } else if (pull === void 0) {
@@ -61782,7 +63805,7 @@ var reviewRunCommand = defineCommand({
61782
63805
  ],
61783
63806
  examples: ["overlane review run --diff change.patch", "overlane review run --diff -", "overlane review run 7 --repo acme/app --dry-run"],
61784
63807
  effect: "write",
61785
- ...common7,
63808
+ ...common8,
61786
63809
  keywords: ["code review", "review diff", "review patch", "review pull request", "review pr", "check my pr", "findings"],
61787
63810
  result: withDryRun(ReviewRunResponse),
61788
63811
  text: (d) => "run" in d ? [`${d.run.status} review of ${d.run.repository}#${d.run.pullNumber} (${d.run.mode}${d.run.posted ? ", posted" : ", nothing posted"}): ${d.run.findings.open} open, ${d.run.findings.fixed} fixed, ${d.run.findings.dismissed} dismissed.`, ...d.findings.filter((finding) => finding.status === "open").map(FINDING_LINE)] : [],
@@ -61792,9 +63815,9 @@ var reviewRunCommand = defineCommand({
61792
63815
  const title = textFlag(inv, "title");
61793
63816
  const label = textFlag(inv, "label");
61794
63817
  const source = { kind: "patch", diff: diff.text, ...title === void 0 ? {} : { title }, ...label === void 0 ? {} : { label } };
61795
- const patchBody = { requestId: requestId7(), trigger: "manual", source };
61796
- if (inv.dryRun) return planned3(inv, "POST", reviewPaths.runs, { ...patchBody, source: { ...source, diff: `<${diff.text.length} characters from ${diff.from}>` } }, "runs the deterministic checks on the diff, then an optional model pass; nothing is posted");
61797
- const sent = await connected3(inv);
63818
+ const patchBody = { requestId: requestId8(), trigger: "manual", source };
63819
+ if (inv.dryRun) return planned4(inv, "POST", reviewPaths.runs, { ...patchBody, source: { ...source, diff: `<${diff.text.length} characters from ${diff.from}>` } }, "runs the deterministic checks on the diff, then an optional model pass; nothing is posted");
63820
+ const sent = await connected4(inv);
61798
63821
  const patched = await sent.call(ReviewRunResponse, "POST", reviewPaths.runs(sent.tenantId, sent.projectId), patchBody);
61799
63822
  if (patched.run.status === "partial") say(inv.deps, "Partial review: the token cap was reached. The summary lists what was not covered.");
61800
63823
  return { data: patched };
@@ -61802,9 +63825,9 @@ var reviewRunCommand = defineCommand({
61802
63825
  const number4 = Number(inv.positionals[0]);
61803
63826
  if (!Number.isInteger(number4) || number4 < 1) throw new UsageError("run needs a pull request number, or a diff with --diff", { hint: "overlane review run --diff change.patch" });
61804
63827
  const repository = await repositoryOf(inv);
61805
- const body2 = { requestId: requestId7(), trigger: "manual", source: { kind: "github", repository, number: number4 } };
61806
- if (inv.dryRun) return planned3(inv, "POST", reviewPaths.runs, body2, "reads the pull request through the GitHub connection and runs the review");
61807
- const { call: call2, tenantId, projectId } = await connected3(inv);
63828
+ const body2 = { requestId: requestId8(), trigger: "manual", source: { kind: "github", repository, number: number4 } };
63829
+ if (inv.dryRun) return planned4(inv, "POST", reviewPaths.runs, body2, "reads the pull request through the GitHub connection and runs the review");
63830
+ const { call: call2, tenantId, projectId } = await connected4(inv);
61808
63831
  const result = await call2(ReviewRunResponse, "POST", reviewPaths.runs(tenantId, projectId), body2);
61809
63832
  if (result.run.status === "partial") say(inv.deps, "Partial review: the token cap was reached. The summary lists what was not covered.");
61810
63833
  return { data: result };
@@ -61816,12 +63839,12 @@ var reviewStatusCommand = defineCommand({
61816
63839
  description: "Shows whether review posts comments or is log-only, the token cap, the latest runs and the number of open findings. States the data-use terms: diffs go to model providers only under terms that exclude training.",
61817
63840
  examples: ["overlane review status", "overlane review status --json"],
61818
63841
  effect: "read",
61819
- ...common7,
63842
+ ...common8,
61820
63843
  keywords: ["review mode", "log only", "review settings", "recent reviews", "how is review doing"],
61821
63844
  result: ReviewStatusResponse,
61822
63845
  text: (d) => [`Review mode: ${d.settings.mode}. Token cap per pull request: ${d.settings.tokenCap}. Open findings: ${d.openFindings}.`, d.settings.privacy, ...d.runs.slice(0, 5).map((run3) => `${run3.startedAt} ${run3.repository}#${run3.pullNumber} ${run3.status} ${run3.tokensUsed} tokens ${run3.model}`)],
61823
63846
  handler: async (inv) => {
61824
- const { call: call2, tenantId, projectId } = await connected3(inv);
63847
+ const { call: call2, tenantId, projectId } = await connected4(inv);
61825
63848
  return { data: await call2(ReviewStatusResponse, "GET", reviewPaths.status(tenantId, projectId)) };
61826
63849
  }
61827
63850
  });
@@ -61836,12 +63859,12 @@ var reviewFindingsCommand = defineCommand({
61836
63859
  ],
61837
63860
  examples: ["overlane review findings --status open", "overlane review findings --pull 7 --json"],
61838
63861
  effect: "read",
61839
- ...common7,
63862
+ ...common8,
61840
63863
  keywords: ["list findings", "open comments", "review comments", "what did review find", "defects"],
61841
63864
  result: ReviewFindingsResponse,
61842
63865
  text: (d) => d.findings.length === 0 ? ["No findings."] : d.findings.map(FINDING_LINE),
61843
63866
  handler: async (inv) => {
61844
- const { call: call2, tenantId, projectId } = await connected3(inv);
63867
+ const { call: call2, tenantId, projectId } = await connected4(inv);
61845
63868
  const params = new URLSearchParams();
61846
63869
  for (const name2 of ["pull", "repo", "status"]) {
61847
63870
  const value = textFlag(inv, name2);
@@ -61862,16 +63885,16 @@ var reviewDismissCommand = defineCommand({
61862
63885
  ],
61863
63886
  examples: ['overlane review dismiss fnd_1 --note "intended"', "overlane review dismiss fnd_2 --accept"],
61864
63887
  effect: "write",
61865
- ...common7,
63888
+ ...common8,
61866
63889
  keywords: ["dismiss finding", "ignore comment", "false positive", "accept finding", "teach reviewer", "feedback"],
61867
63890
  result: withDryRun(FeedbackResponse),
61868
63891
  text: (d) => "finding" in d ? [`${d.finding.id} is ${d.finding.status}.${d.learned === null ? "" : ` Learned: ${d.learned.direction} ${d.learned.rule} (${d.learned.evidence} reviews).`}`] : [],
61869
63892
  handler: async (inv) => {
61870
63893
  const findingId = id(inv, "dismiss");
61871
63894
  const note = textFlag(inv, "note");
61872
- const body2 = { kind: inv.values["accept"] === true ? "accept" : "dismiss", ...note === void 0 ? {} : { note }, requestId: requestId7() };
61873
- if (inv.dryRun) return planned3(inv, "POST", (tenantId2, projectId2) => reviewPaths.feedback(tenantId2, projectId2, findingId), body2);
61874
- const { call: call2, tenantId, projectId } = await connected3(inv);
63895
+ const body2 = { kind: inv.values["accept"] === true ? "accept" : "dismiss", ...note === void 0 ? {} : { note }, requestId: requestId8() };
63896
+ if (inv.dryRun) return planned4(inv, "POST", (tenantId2, projectId2) => reviewPaths.feedback(tenantId2, projectId2, findingId), body2);
63897
+ const { call: call2, tenantId, projectId } = await connected4(inv);
61875
63898
  return { data: await call2(FeedbackResponse, "POST", reviewPaths.feedback(tenantId, projectId, findingId), body2) };
61876
63899
  }
61877
63900
  });
@@ -61883,16 +63906,16 @@ var reviewAutofixCommand = defineCommand({
61883
63906
  flags: [{ name: "assign", type: "string", value: "AGENT", description: "The agent or bot to assign, for example agent:fixer" }],
61884
63907
  examples: ["overlane review autofix fnd_1", "overlane review autofix fnd_1 --assign agent:fixer --dry-run"],
61885
63908
  effect: "write",
61886
- ...common7,
63909
+ ...common8,
61887
63910
  keywords: ["auto fix", "autofix", "fix finding", "create task from finding", "assign to agent"],
61888
63911
  result: withDryRun(AutofixResponse),
61889
63912
  text: (d) => "taskId" in d ? [`Task ${d.taskId} created${d.assignee === null ? "" : ` for ${d.assignee}`}. Start it with: overlane task start ${d.taskId}`] : [],
61890
63913
  handler: async (inv) => {
61891
63914
  const findingId = id(inv, "autofix");
61892
63915
  const assignee = textFlag(inv, "assign");
61893
- const body2 = { requestId: requestId7(), ...assignee === void 0 ? {} : { assignee } };
61894
- if (inv.dryRun) return planned3(inv, "POST", (tenantId2, projectId2) => reviewPaths.autofix(tenantId2, projectId2, findingId), body2);
61895
- const { call: call2, tenantId, projectId } = await connected3(inv);
63916
+ const body2 = { requestId: requestId8(), ...assignee === void 0 ? {} : { assignee } };
63917
+ if (inv.dryRun) return planned4(inv, "POST", (tenantId2, projectId2) => reviewPaths.autofix(tenantId2, projectId2, findingId), body2);
63918
+ const { call: call2, tenantId, projectId } = await connected4(inv);
61896
63919
  return { data: await call2(AutofixResponse, "POST", reviewPaths.autofix(tenantId, projectId, findingId), body2) };
61897
63920
  }
61898
63921
  });
@@ -61902,12 +63925,12 @@ var reviewSettingsCommand = defineCommand({
61902
63925
  description: "Shows the mode (log-only until comments are enabled), the per-PR token cap, extra skip patterns and the statement that diffs go to model providers only under terms that exclude training.",
61903
63926
  examples: ["overlane review settings"],
61904
63927
  effect: "read",
61905
- ...common7,
63928
+ ...common8,
61906
63929
  keywords: ["review configuration", "token cap", "skip patterns", "privacy", "no training", "data use"],
61907
63930
  result: ReviewSettings,
61908
63931
  text: (d) => [`Mode: ${d.mode}. Token cap: ${d.tokenCap}. Extra skip patterns: ${d.skipPatterns.length === 0 ? "none" : d.skipPatterns.join(", ")}.`, d.privacy],
61909
63932
  handler: async (inv) => {
61910
- const { call: call2, tenantId, projectId } = await connected3(inv);
63933
+ const { call: call2, tenantId, projectId } = await connected4(inv);
61911
63934
  return { data: await call2(ReviewSettings, "GET", reviewPaths.settings(tenantId, projectId)) };
61912
63935
  }
61913
63936
  });
@@ -61922,7 +63945,7 @@ var reviewSettingsSetCommand = defineCommand({
61922
63945
  ],
61923
63946
  examples: ["overlane review settings set --mode comments", "overlane review settings set --token-cap 40000 --skip 'docs/**' --dry-run"],
61924
63947
  effect: "write",
61925
- ...common7,
63948
+ ...common8,
61926
63949
  keywords: ["enable review comments", "turn on review", "log only", "set token cap", "skip files"],
61927
63950
  result: withDryRun(ReviewSettings),
61928
63951
  text: (d) => "mode" in d ? [`Review is ${d.mode}. Token cap ${d.tokenCap}.`] : [],
@@ -61936,8 +63959,8 @@ var reviewSettingsSetCommand = defineCommand({
61936
63959
  });
61937
63960
  if (!parsed.success) throw new UsageError(parsed.error.issues.map((issue2) => issue2.message).join("; "), { hint: "overlane review settings set --mode comments" });
61938
63961
  if (Object.keys(parsed.data).length === 0) throw new UsageError("nothing to change", { hint: "overlane review settings set --mode comments" });
61939
- if (inv.dryRun) return planned3(inv, "PUT", reviewPaths.settings, parsed.data);
61940
- const { call: call2, tenantId, projectId } = await connected3(inv);
63962
+ if (inv.dryRun) return planned4(inv, "PUT", reviewPaths.settings, parsed.data);
63963
+ const { call: call2, tenantId, projectId } = await connected4(inv);
61941
63964
  return { data: await call2(ReviewSettings, "PUT", reviewPaths.settings(tenantId, projectId), parsed.data) };
61942
63965
  }
61943
63966
  });
@@ -61947,12 +63970,12 @@ var codeMapStatusCommand = defineCommand({
61947
63970
  description: "Lists every supported client in its local and cloud setting, and the bots, review service, cross-repository questions and wiki, with whether the code map is on and the reason. The default for a setting follows the latest GATE-07 result for that setting: off for a local agent with grep (the local run failed, ADR 0018), on where there is no checkout until a re-run says otherwise.",
61948
63971
  examples: ["overlane code-map status", "overlane code-map status --json"],
61949
63972
  effect: "read",
61950
- ...common7,
63973
+ ...common8,
61951
63974
  keywords: ["code map", "code tools", "is the code map on", "gate-07", "code layer", "per client"],
61952
63975
  result: CodeMapStatus,
61953
63976
  text: (d) => d.clients.map((row) => `${row.on ? "on " : "off"} ${row.subject}: ${row.reason}`),
61954
63977
  handler: async (inv) => {
61955
- const { call: call2, tenantId, projectId } = await connected3(inv);
63978
+ const { call: call2, tenantId, projectId } = await connected4(inv);
61956
63979
  return { data: await call2(CodeMapStatus, "GET", codeMapPaths.status(tenantId, projectId)) };
61957
63980
  }
61958
63981
  });
@@ -61967,9 +63990,9 @@ function flagUsage(flag) {
61967
63990
  const repeated = flag.multiple === true ? "..." : "";
61968
63991
  return flag.required === true ? `${body2}${repeated}` : `[${body2}${repeated}]`;
61969
63992
  }
61970
- function argUsage(arg) {
61971
- const name2 = `${arg.name}${arg.variadic === true ? "..." : ""}`;
61972
- return arg.required ? name2 : `[${name2}]`;
63993
+ function argUsage(arg4) {
63994
+ const name2 = `${arg4.name}${arg4.variadic === true ? "..." : ""}`;
63995
+ return arg4.required ? name2 : `[${name2}]`;
61973
63996
  }
61974
63997
  function usageLine(spec, compact = false) {
61975
63998
  const flags2 = compact ? spec.flags.filter((flag) => flag.name !== "dry-run" && flag.name !== "force") : spec.flags;
@@ -61980,7 +64003,7 @@ function commandHelp(spec) {
61980
64003
  const lines = [`overlane ${commandName(spec)} - ${spec.summary}`, "", spec.description, "", "Usage:", ` ${usageLine(spec)}`];
61981
64004
  if (spec.args.length > 0) {
61982
64005
  lines.push("", "Arguments:");
61983
- for (const arg of spec.args) lines.push(` ${arg.name}${arg.variadic === true ? "..." : ""}${arg.required ? "" : " (optional)"} ${arg.description}`);
64006
+ for (const arg4 of spec.args) lines.push(` ${arg4.name}${arg4.variadic === true ? "..." : ""}${arg4.required ? "" : " (optional)"} ${arg4.description}`);
61984
64007
  }
61985
64008
  if (spec.flags.length > 0) {
61986
64009
  lines.push("", "Flags:");
@@ -62175,7 +64198,7 @@ function schemaOf(spec) {
62175
64198
  needsAuth: spec.needsAuth,
62176
64199
  needsNetwork: spec.needsNetwork,
62177
64200
  safety: { dryRun: spec.flags.some((flag) => flag.name === "dry-run"), force: spec.flags.some((flag) => flag.name === "force") },
62178
- args: spec.args.map((arg) => ({ name: arg.name, required: arg.required, variadic: arg.variadic === true, description: arg.description })),
64201
+ args: spec.args.map((arg4) => ({ name: arg4.name, required: arg4.required, variadic: arg4.variadic === true, description: arg4.description })),
62179
64202
  flags: spec.flags.map((flag) => ({
62180
64203
  name: `--${flag.name}`,
62181
64204
  type: flag.type,
@@ -62456,7 +64479,7 @@ async function disconnect(deps, options) {
62456
64479
  }
62457
64480
 
62458
64481
  // ../cli/src/doctor.ts
62459
- import { resolve as resolve10 } from "node:path";
64482
+ import { resolve as resolve12 } from "node:path";
62460
64483
  init_zod();
62461
64484
  var DoctorResult = external_exports.object({
62462
64485
  project: external_exports.object({ provider: external_exports.enum(["overlane", "github", "gitlab"]).optional(), owner: external_exports.string().optional(), name: external_exports.string(), root: external_exports.string() }),
@@ -62476,7 +64499,7 @@ async function doctor(deps, options) {
62476
64499
  const root = project.root;
62477
64500
  const binding = readBindingFile(root);
62478
64501
  const owned = readOwned(root);
62479
- const marketplaceRoot2 = resolve10(options.marketplaceRoot ?? owned?.marketplaceRoot ?? deps.paths.defaultMarketplaceRoot);
64502
+ const marketplaceRoot2 = resolve12(options.marketplaceRoot ?? owned?.marketplaceRoot ?? deps.paths.defaultMarketplaceRoot);
62480
64503
  const infos = await detectAgents(deps, options.agents, root);
62481
64504
  let service = "reachable";
62482
64505
  let hasToken = false;
@@ -62536,7 +64559,7 @@ async function doctor(deps, options) {
62536
64559
 
62537
64560
  // ../cli/src/kit/setup.ts
62538
64561
  init_src();
62539
- import { randomUUID as randomUUID8 } from "node:crypto";
64562
+ import { randomUUID as randomUUID9 } from "node:crypto";
62540
64563
  import { existsSync as existsSync6, readdirSync as readdirSync2 } from "node:fs";
62541
64564
  import { join as join22 } from "node:path";
62542
64565
 
@@ -62753,11 +64776,11 @@ async function connectKit(deps, options) {
62753
64776
  const agentConfig = [join22(".claude", "settings.json"), join22(".codex", "config.toml")];
62754
64777
  const preDirty = new Set(await dirty(deps, root, agentConfig));
62755
64778
  const preExisting = new Set(agentConfig.filter((file2) => existsSync6(join22(root, file2))));
62756
- const connected4 = await connect(deps, { ...options, yes: true });
62757
- if (connected4.error !== void 0 || readBindingFile(root).kind !== "ok") {
64779
+ const connected5 = await connect(deps, { ...options, yes: true });
64780
+ if (connected5.error !== void 0 || readBindingFile(root).kind !== "ok") {
62758
64781
  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" });
62759
64782
  }
62760
- const connectData = connected4.data !== void 0 && !("dryRun" in connected4.data) ? connected4.data : void 0;
64783
+ const connectData = connected5.data !== void 0 && !("dryRun" in connected5.data) ? connected5.data : void 0;
62761
64784
  for (const file2 of agentConfig) {
62762
64785
  if (!existsSync6(join22(root, file2)) || preDirty.has(file2) || preExisting.has(file2) && (await dirty(deps, root, [file2])).length === 0) continue;
62763
64786
  if ((await gitOut(deps, root, "check-ignore", "-q", "--", file2)).code === 0) continue;
@@ -62776,7 +64799,7 @@ async function connectKit(deps, options) {
62776
64799
  const kit = kitClient(deps, serviceUrl, binding.binding, token.token);
62777
64800
  await kit.putPolicy({ ...DEFAULT_RUN_POLICY, buildAheadLimit: firstMilestone });
62778
64801
  say(deps, `Run policy set (build-ahead limit ${firstMilestone}).`);
62779
- const synced = await kit.syncPlan(PlanSyncRequest.parse({ requestId: `cli-${randomUUID8()}`, sourceCommit: sha, plan: await readPlan(root) }));
64802
+ const synced = await kit.syncPlan(PlanSyncRequest.parse({ requestId: `cli-${randomUUID9()}`, sourceCommit: sha, plan: await readPlan(root) }));
62780
64803
  say(deps, `Plan synced: ${synced.created.length} created, ${synced.updated.length} updated, ${synced.unchanged.length} unchanged, ${synced.deferred.length} deferred.`);
62781
64804
  const pr = await openPullRequest(deps, root, project.name);
62782
64805
  say(deps);
@@ -63064,7 +65087,7 @@ var ReleaseRollbackResult = external_exports.union([
63064
65087
  ]);
63065
65088
 
63066
65089
  // ../cli/src/commands/release.ts
63067
- var common8 = { needsAuth: true, needsNetwork: true };
65090
+ var common9 = { needsAuth: true, needsNetwork: true };
63068
65091
  var APPROVE = { name: "approve", type: "string", value: "DIGEST", description: "Approve this exact release digest when it changes executable files or policy" };
63069
65092
  var releaseListCommand = defineCommand({
63070
65093
  path: ["release", "list"],
@@ -63072,7 +65095,7 @@ var releaseListCommand = defineCommand({
63072
65095
  description: "Lists releases with version, short digest, channel, change kinds, restart rule, compatibility and which projects pin them.",
63073
65096
  examples: ["overlane release list"],
63074
65097
  effect: "read",
63075
- ...common8,
65098
+ ...common9,
63076
65099
  keywords: ["releases", "versions", "available", "published", "what versions", "all releases"],
63077
65100
  result: ReleaseListResult,
63078
65101
  handler: async (inv) => listReleases(inv.deps)
@@ -63083,7 +65106,7 @@ var releaseStatusCommand = defineCommand({
63083
65106
  description: `Compares the installed release (.harness/release.json) with the project binding and the service's pin, and lists approvals recorded on this machine. Works when the service is down (the pin then reads "unreachable").`,
63084
65107
  examples: ["overlane release status"],
63085
65108
  effect: "read",
63086
- ...common8,
65109
+ ...common9,
63087
65110
  keywords: ["installed", "version", "in sync", "update available", "which release", "pinned", "am i up to date", "current release"],
63088
65111
  result: ReleaseStatusResult,
63089
65112
  handler: async (inv) => releaseStatus(inv.deps)
@@ -63095,7 +65118,7 @@ var releaseUpdateCommand = defineCommand({
63095
65118
  flags: [{ name: "to", type: "string", value: "DIGEST", description: "Install this release instead of the project's pin" }, APPROVE],
63096
65119
  examples: ["overlane release update --dry-run", "overlane release update", "overlane release update --approve sha256:..."],
63097
65120
  effect: "write",
63098
- ...common8,
65121
+ ...common9,
63099
65122
  keywords: ["upgrade", "install release", "new version", "pull latest", "plugin update", "approve", "update plugin", "get newest"],
63100
65123
  result: ReleaseUpdateResult,
63101
65124
  handler: async (inv) => updateRelease(inv.deps, { to: textFlag(inv, "to"), approve: textFlag(inv, "approve"), dryRun: inv.dryRun })
@@ -63107,7 +65130,7 @@ var releaseRollbackCommand = defineCommand({
63107
65130
  flags: [APPROVE],
63108
65131
  examples: ["overlane release rollback --dry-run", "overlane release rollback --force"],
63109
65132
  effect: "destructive",
63110
- ...common8,
65133
+ ...common9,
63111
65134
  keywords: ["roll back", "revert", "undo update", "previous version", "downgrade", "go back", "restore", "undo release", "bad release"],
63112
65135
  result: ReleaseRollbackResult,
63113
65136
  handler: async (inv) => rollbackRelease(inv.deps, { approve: textFlag(inv, "approve"), dryRun: inv.dryRun })
@@ -63174,7 +65197,7 @@ var RunStatusResult = external_exports.object({
63174
65197
  var RunPolicyChangeResult = withDryRun(external_exports.object({ changed: external_exports.boolean(), policy: PolicyShape }));
63175
65198
 
63176
65199
  // ../cli/src/commands/run.ts
63177
- var common9 = { needsAuth: true, needsNetwork: true };
65200
+ var common10 = { needsAuth: true, needsNetwork: true };
63178
65201
  var EXECUTOR = { name: "executor", type: "string", enum: ["claude-code", "codex"], description: "Which agent this is (default: detected from the environment)" };
63179
65202
  var STOP_NOTE = "A stop (policy paused, a budget spent, nothing runnable) exits 6 with the reason in the error code and the exact `overlane run end --reason ...` as the hint.";
63180
65203
  var runStartCommand = defineCommand({
@@ -63184,7 +65207,7 @@ var runStartCommand = defineCommand({
63184
65207
  flags: [{ name: "trigger", type: "string", enum: ["schedule", "interactive", "event"], default: "interactive", description: "What started the run" }, EXECUTOR],
63185
65208
  examples: ["overlane run start --trigger schedule", "overlane run start --dry-run"],
63186
65209
  effect: "write",
63187
- ...common9,
65210
+ ...common10,
63188
65211
  keywords: ["begin run", "bounded step", "autonomous", "start working", "new run", "schedule", "kick off"],
63189
65212
  result: RunStartResult,
63190
65213
  handler: async (inv) => startRun(inv.deps, { trigger: textFlag(inv, "trigger"), executor: textFlag(inv, "executor"), dryRun: inv.dryRun })
@@ -63196,7 +65219,7 @@ var runNextCommand = defineCommand({
63196
65219
  flags: [EXECUTOR],
63197
65220
  examples: ["overlane run next"],
63198
65221
  effect: "read",
63199
- ...common9,
65222
+ ...common10,
63200
65223
  keywords: ["what should I work on next", "next task", "runnable", "what to do", "pick a task", "which task", "what's next", "work on", "what is next", "todo"],
63201
65224
  result: RunNextResult,
63202
65225
  handler: async (inv) => nextTask(inv.deps, { executor: textFlag(inv, "executor") })
@@ -63208,7 +65231,7 @@ var runClaimCommand = defineCommand({
63208
65231
  args: [{ name: "task-id", required: false, description: "The task to claim (default: the next runnable one)" }],
63209
65232
  examples: ["overlane run claim", "overlane run claim T003"],
63210
65233
  effect: "write",
63211
- ...common9,
65234
+ ...common10,
63212
65235
  keywords: ["take task", "lease task", "grab", "assign", "pick up task", "get a task"],
63213
65236
  result: RunClaimResult,
63214
65237
  handler: async (inv) => claimTask(inv.deps, { positionals: inv.positionals, dryRun: inv.dryRun })
@@ -63225,7 +65248,7 @@ var runDecideCommand = defineCommand({
63225
65248
  ],
63226
65249
  examples: ['overlane run decide --question "Which date library?" --decision "Use the built-in Intl" --evidence "package.json has no date library"'],
63227
65250
  effect: "write",
63228
- ...common9,
65251
+ ...common10,
63229
65252
  keywords: ["record decision", "question", "unblocked", "owner override", "judgement call", "log choice", "do not ask", "decide"],
63230
65253
  result: RunDecideResult,
63231
65254
  handler: async (inv) => decide(inv.deps, { question: textFlag(inv, "question"), decision: textFlag(inv, "decision"), evidence: listFlag(inv, "evidence"), task: textFlag(inv, "task"), dryRun: inv.dryRun })
@@ -63237,7 +65260,7 @@ var runEndCommand = defineCommand({
63237
65260
  flags: [{ name: "reason", type: "string", required: true, enum: RUN_STOP_REASONS, description: "Why the run ended" }],
63238
65261
  examples: ["overlane run end --reason nothing_runnable", "overlane run end --reason error"],
63239
65262
  effect: "write",
63240
- ...common9,
65263
+ ...common10,
63241
65264
  keywords: ["finish run", "stop", "wrap up", "close run", "release leases", "done with run", "end the run"],
63242
65265
  result: RunEndResult,
63243
65266
  handler: async (inv) => endRun(inv.deps, { reason: textFlag(inv, "reason"), dryRun: inv.dryRun })
@@ -63249,7 +65272,7 @@ var runStatusCommand = defineCommand({
63249
65272
  flags: [EXECUTOR],
63250
65273
  examples: ["overlane run status"],
63251
65274
  effect: "read",
63252
- ...common9,
65275
+ ...common10,
63253
65276
  keywords: ["policy", "budget", "limits", "how much left", "remaining", "state of run", "is it paused", "run policy"],
63254
65277
  result: RunStatusResult,
63255
65278
  handler: async (inv) => runStatus(inv.deps, { executor: textFlag(inv, "executor") })
@@ -63260,7 +65283,7 @@ var runPauseCommand = defineCommand({
63260
65283
  description: "Sets the project's run policy to paused. Every run then stops at its next check (`STOP paused`). Undo with `overlane run resume`. Safe to repeat.",
63261
65284
  examples: ["overlane run pause", "overlane run pause --dry-run"],
63262
65285
  effect: "write",
63263
- ...common9,
65286
+ ...common10,
63264
65287
  keywords: ["pause", "halt", "freeze", "stop all", "emergency brake", "disable autonomous runs", "policy", "no new runs", "stop agents", "turn off", "suspend"],
63265
65288
  result: RunPolicyChangeResult,
63266
65289
  handler: async (inv) => setPolicyStatus(inv.deps, "paused", inv.dryRun)
@@ -63271,7 +65294,7 @@ var runResumeCommand = defineCommand({
63271
65294
  description: "Sets the project's run policy back to active so runs can start and tasks can be claimed again. Safe to repeat.",
63272
65295
  examples: ["overlane run resume", "overlane run resume --dry-run"],
63273
65296
  effect: "write",
63274
- ...common9,
65297
+ ...common10,
63275
65298
  keywords: ["unpause", "re-enable", "continue autonomous", "reactivate", "policy active", "turn on", "restart runs", "lift the pause"],
63276
65299
  result: RunPolicyChangeResult,
63277
65300
  handler: async (inv) => setPolicyStatus(inv.deps, "active", inv.dryRun)
@@ -63281,7 +65304,7 @@ var runCommands = [runStartCommand, runNextCommand, runClaimCommand, runDecideCo
63281
65304
  // ../cli/src/task/queue.ts
63282
65305
  init_src();
63283
65306
  init_zod();
63284
- import { randomUUID as randomUUID9 } from "node:crypto";
65307
+ import { randomUUID as randomUUID10 } from "node:crypto";
63285
65308
  import { mkdirSync as mkdirSync8, renameSync as renameSync5, writeFileSync as writeFileSync7 } from "node:fs";
63286
65309
  import { dirname as dirname8, join as join23 } from "node:path";
63287
65310
  var TASK_POLICY_PATH = join23(".harness", "task-policy.json");
@@ -63301,7 +65324,7 @@ var TaskQueueResult = TaskQueue;
63301
65324
  var TaskPrioritiseResult = withDryRun(external_exports.object({ ...PrioritiseResult.shape, next: external_exports.string() }));
63302
65325
  var TaskPolicyResult = external_exports.object({ enforcement: TaskEnforcement, reason: external_exports.string().optional(), changedBy: external_exports.string().optional(), updatedAt: external_exports.string().optional(), localFile: external_exports.string() });
63303
65326
  var TaskPolicySetResult = withDryRun(TaskPolicyResult);
63304
- var requestId8 = () => `cli-${randomUUID9()}`;
65327
+ var requestId9 = () => `cli-${randomUUID10()}`;
63305
65328
  function priorityOf(value, fallback) {
63306
65329
  const parsed = TaskPriority.safeParse(value ?? fallback);
63307
65330
  if (!parsed.success) throw new UsageError(`--priority must be one of ${TASK_PRIORITIES.join(", ")}`);
@@ -63340,7 +65363,7 @@ async function prioritiseTask(deps, input2) {
63340
65363
  const name2 = detectExecutorName(deps.env);
63341
65364
  let request;
63342
65365
  try {
63343
- request = PrioritiseRequest.parse({ requestId: requestId8(), priority, top: input2.top, origin: name2 === "terminal" ? "user" : "agent", ...input2.reason === void 0 ? {} : { reason: input2.reason }, executor: executorFor(name2) });
65366
+ request = PrioritiseRequest.parse({ requestId: requestId9(), priority, top: input2.top, origin: name2 === "terminal" ? "user" : "agent", ...input2.reason === void 0 ? {} : { reason: input2.reason }, executor: executorFor(name2) });
63344
65367
  } catch (error62) {
63345
65368
  throw new UsageError(String(error62));
63346
65369
  }
@@ -63369,7 +65392,7 @@ async function newTask(deps, input2) {
63369
65392
  const begun = data;
63370
65393
  const project = await connectedProject(deps, "task");
63371
65394
  const name2 = detectExecutorName(deps.env);
63372
- const request = PrioritiseRequest.parse({ requestId: requestId8(), priority, top: input2.top, origin: name2 === "terminal" ? "user" : "agent", executor: executorFor(name2) });
65395
+ const request = PrioritiseRequest.parse({ requestId: requestId9(), priority, top: input2.top, origin: name2 === "terminal" ? "user" : "agent", executor: executorFor(name2) });
63373
65396
  try {
63374
65397
  const ranked = await serviceCall(deps, project.serviceUrl, project.token)(PrioritiseResult, "POST", taskQueuePaths.prioritise(project.binding.tenantId, project.binding.projectId, begun.taskId), request);
63375
65398
  say(deps, `Ranked ${begun.taskId} ${ranked.priority}${input2.top ? " (first)" : ""}.`);
@@ -63390,7 +65413,7 @@ async function setPolicy(deps, input2) {
63390
65413
  const enforcement = TaskEnforcement.safeParse(input2.enforcement);
63391
65414
  if (!enforcement.success) throw new UsageError(`set needs ${TASK_ENFORCEMENT.join(" or ")}`);
63392
65415
  const name2 = detectExecutorName(deps.env);
63393
- const parsed = SetTaskPolicyRequest.safeParse({ requestId: requestId8(), enforcement: enforcement.data, ...input2.reason === void 0 ? {} : { reason: input2.reason }, executor: executorFor(name2) });
65416
+ const parsed = SetTaskPolicyRequest.safeParse({ requestId: requestId9(), enforcement: enforcement.data, ...input2.reason === void 0 ? {} : { reason: input2.reason }, executor: executorFor(name2) });
63394
65417
  if (!parsed.success) throw new UsageError(parsed.error.issues.map((issue2) => issue2.message).join("; "));
63395
65418
  if (input2.dryRun) {
63396
65419
  const project2 = await offlineProject(deps, "task");
@@ -63417,7 +65440,7 @@ async function startExisting(deps, taskId, dryRun) {
63417
65440
  }
63418
65441
 
63419
65442
  // ../cli/src/commands/queue.ts
63420
- var common10 = { needsAuth: true, needsNetwork: true };
65443
+ var common11 = { needsAuth: true, needsNetwork: true };
63421
65444
  var PRIORITIES2 = ["P0", "P1", "P2", "P3"];
63422
65445
  var taskNewCommand = defineCommand({
63423
65446
  path: ["task", "new"],
@@ -63433,7 +65456,7 @@ var taskNewCommand = defineCommand({
63433
65456
  ],
63434
65457
  examples: ['overlane task new "Fix login redirect"', 'overlane task new "Hotfix the build" --priority P0 --top'],
63435
65458
  effect: "write",
63436
- ...common10,
65459
+ ...common11,
63437
65460
  keywords: ["new task", "create task", "no active task", "blocked no task", "start work", "need a task", "begin", "quick task"],
63438
65461
  result: TaskNewResult,
63439
65462
  handler: async (inv) => newTask(inv.deps, {
@@ -63452,7 +65475,7 @@ var taskNextCommand = defineCommand({
63452
65475
  description: "Picks the best ready or paused task: P0 before P3, then rank, then milestone and dependency order. When this working copy holds a task and the next one outranks it, says so (preempt) and prints the commands to checkpoint and switch; the preempted task comes back through this command afterwards.",
63453
65476
  examples: ["overlane task next"],
63454
65477
  effect: "read",
63455
- ...common10,
65478
+ ...common11,
63456
65479
  keywords: ["what next", "next task", "priority", "what should i work on", "pick work", "resume after", "queue"],
63457
65480
  result: TaskNextResult,
63458
65481
  handler: async (inv) => taskNext(inv.deps)
@@ -63463,7 +65486,7 @@ var taskQueueCommand = defineCommand({
63463
65486
  description: "Lists ready, running, paused and blocked tasks by priority, then rank, then plan order, with each task's priority.",
63464
65487
  examples: ["overlane task queue"],
63465
65488
  effect: "read",
63466
- ...common10,
65489
+ ...common11,
63467
65490
  keywords: ["priority list", "ranking", "order", "backlog", "what is queued", "p0"],
63468
65491
  result: TaskQueueResult,
63469
65492
  handler: async (inv) => taskQueue(inv.deps)
@@ -63480,7 +65503,7 @@ var taskPrioritiseCommand = defineCommand({
63480
65503
  ],
63481
65504
  examples: ["overlane task prioritise task-7 --priority P0 --top", 'overlane task prioritise task-9 --priority P2 --reason "user said later"'],
63482
65505
  effect: "write",
63483
- ...common10,
65506
+ ...common11,
63484
65507
  keywords: ["reprioritize", "reprioritise", "bump", "urgent", "move to top", "rank", "lower priority", "p0", "p1", "p2", "p3"],
63485
65508
  result: TaskPrioritiseResult,
63486
65509
  handler: async (inv) => prioritiseTask(inv.deps, { taskId: inv.positionals[0], priority: textFlag(inv, "priority"), top: boolFlag(inv, "top"), reason: textFlag(inv, "reason"), dryRun: inv.dryRun })
@@ -63491,7 +65514,7 @@ var taskPolicyCommand = defineCommand({
63491
65514
  description: "Reads the project's task requirement (default `required`: edits and mutating shell commands are refused without an active task) and writes it to .harness/task-policy.json for the hooks.",
63492
65515
  examples: ["overlane task policy"],
63493
65516
  effect: "read",
63494
- ...common10,
65517
+ ...common11,
63495
65518
  keywords: ["enforcement", "require task", "task gate", "relax", "blocked", "policy"],
63496
65519
  result: TaskPolicyResult,
63497
65520
  handler: async (inv) => showPolicy2(inv.deps)
@@ -63504,7 +65527,7 @@ var taskPolicySetCommand = defineCommand({
63504
65527
  flags: [{ name: "reason", type: "string", value: "TEXT", description: "Why the rule is relaxed (required for relaxed)" }],
63505
65528
  examples: ["overlane task policy set required", 'overlane task policy set relaxed --reason "docs-only repository"'],
63506
65529
  effect: "write",
63507
- ...common10,
65530
+ ...common11,
63508
65531
  keywords: ["relax", "turn off task requirement", "require tasks", "allow edits without task", "enforcement"],
63509
65532
  result: TaskPolicySetResult,
63510
65533
  handler: async (inv) => setPolicy(inv.deps, { enforcement: inv.positionals[0], reason: textFlag(inv, "reason"), dryRun: inv.dryRun })
@@ -63514,7 +65537,7 @@ var queueCommands = [taskNewCommand, taskNextCommand, taskQueueCommand, taskPrio
63514
65537
  // ../cli/src/commands/autonomy.ts
63515
65538
  init_src();
63516
65539
  init_zod();
63517
- var common11 = { needsAuth: true, needsNetwork: true };
65540
+ var common12 = { needsAuth: true, needsNetwork: true };
63518
65541
  var Requirements = external_exports.array(external_exports.object({ class: external_exports.string(), label: external_exports.string(), mode: external_exports.string(), requirement: external_exports.string() }));
63519
65542
  var SettingsReply = external_exports.object({ settings: AutonomySettings, requirements: Requirements });
63520
65543
  var ShowResult = external_exports.object({ tenantId: external_exports.string(), mode: external_exports.string(), source: external_exports.string(), plan: external_exports.string(), version: external_exports.number(), requirements: Requirements, next: external_exports.string() });
@@ -63531,7 +65554,7 @@ var autonomyShowCommand = defineCommand({
63531
65554
  description: "Prints the mode (autonomous, supervised or manual), where it came from (the plan default or a change), and for each action class what an agent needs before it acts. Safety classes (deletion, spend, secrets, production deploy without CI, the autonomy setting) keep an independent-agent guard in every mode. Payments and legal terms are human only.",
63532
65555
  examples: ["overlane autonomy show", "overlane autonomy show --json"],
63533
65556
  effect: "read",
63534
- ...common11,
65557
+ ...common12,
63535
65558
  keywords: ["autonomy", "supervised", "autonomous", "manual", "approval mode", "what can agents do"],
63536
65559
  result: ShowResult,
63537
65560
  handler: async (inv) => {
@@ -63577,7 +65600,7 @@ var autonomySetCommand = defineCommand({
63577
65600
  ],
63578
65601
  examples: ["overlane autonomy set autonomous", "overlane autonomy set supervised --class release_promotion=manual", "overlane autonomy set autonomous --project my-app=supervised --dry-run"],
63579
65602
  effect: "write",
63580
- ...common11,
65603
+ ...common12,
63581
65604
  keywords: ["autonomy", "set mode", "supervised", "autonomous", "manual"],
63582
65605
  result: SetResult,
63583
65606
  handler: async (inv) => {
@@ -63607,7 +65630,7 @@ var autonomyApprovalsListCommand = defineCommand({
63607
65630
  flags: [{ name: "status", type: "string", enum: ["pending", "approved", "denied", "consumed", "expired"], description: "Only approvals with this status" }],
63608
65631
  examples: ["overlane autonomy approvals list", "overlane autonomy approvals list --status pending --json"],
63609
65632
  effect: "read",
63610
- ...common11,
65633
+ ...common12,
63611
65634
  keywords: ["approvals", "pending approvals", "who approved", "audit approvals"],
63612
65635
  result: ListResult,
63613
65636
  handler: async (inv) => {
@@ -63635,7 +65658,7 @@ var autonomyApprovalsRequestCommand = defineCommand({
63635
65658
  ],
63636
65659
  examples: ['overlane autonomy approvals request --class deletion --subject "memory.purge:all:-:-" --summary "Purge stale project memory"'],
63637
65660
  effect: "write",
63638
- ...common11,
65661
+ ...common12,
63639
65662
  keywords: ["request approval", "ask for approval", "independent agent", "second agent"],
63640
65663
  result: RequestResult,
63641
65664
  handler: async (inv) => {
@@ -63673,7 +65696,7 @@ var autonomyApprovalsAnswerCommand = defineCommand({
63673
65696
  ],
63674
65697
  examples: ['overlane autonomy approvals answer apr_1 --decision approve --reason "within policy" --evidence "read the diff" --evidence "tests pass"'],
63675
65698
  effect: "write",
63676
- ...common11,
65699
+ ...common12,
63677
65700
  keywords: ["approve", "deny", "second agent", "independent approval", "answer approval"],
63678
65701
  result: AnswerResult,
63679
65702
  handler: async (inv) => {
@@ -63701,7 +65724,7 @@ var autonomyCommands = [autonomyShowCommand, autonomySetCommand, autonomyApprova
63701
65724
  // ../cli/src/commands/onboarding.ts
63702
65725
  init_src();
63703
65726
  init_zod();
63704
- var common12 = { needsAuth: true, needsNetwork: true };
65727
+ var common13 = { needsAuth: true, needsNetwork: true };
63705
65728
  var EvidenceShape = external_exports.object({ task: external_exports.object({ projectId: external_exports.string(), taskId: external_exports.string(), state: external_exports.string() }).optional(), review: external_exports.object({ projectId: external_exports.string(), runId: external_exports.string() }).optional() });
63706
65729
  var StatusResult = external_exports.object({
63707
65730
  step: external_exports.string(),
@@ -63725,7 +65748,7 @@ var onboardingStatusCommand = defineCommand({
63725
65748
  description: "Prints the six onboarding steps (the same names as the web app), their state, the task and review records behind finished steps, any repair action for a failed step, and the next command an agent runs. An agent with a team token completes every step; a person in the web app is the override.",
63726
65749
  examples: ["overlane onboarding status"],
63727
65750
  effect: "read",
63728
- ...common12,
65751
+ ...common13,
63729
65752
  keywords: ["onboarding", "get started", "setup progress", "first task", "what next", "steps"],
63730
65753
  result: StatusResult,
63731
65754
  handler: async (inv) => {
@@ -63766,7 +65789,7 @@ var onboardingAdvanceCommand = defineCommand({
63766
65789
  ],
63767
65790
  examples: ["overlane onboarding advance agents --agents claude-code", "overlane onboarding advance repo --repo acme/widgets", "overlane onboarding advance first-task", "overlane onboarding advance invite"],
63768
65791
  effect: "write",
63769
- ...common12,
65792
+ ...common13,
63770
65793
  keywords: ["onboarding", "advance step", "complete step", "accept first review", "finish setup"],
63771
65794
  result: AdvanceResult,
63772
65795
  handler: async (inv) => {
@@ -63813,7 +65836,7 @@ var onboardingReviewCommand = defineCommand({
63813
65836
  description: `Prints the team's latest completed review. With no review yet it prints a labelled example (source fixture). ${EVIDENCE_COMMANDS["first-review"]} Then finish the step with \`overlane onboarding advance first-review\`.`,
63814
65837
  examples: ["overlane onboarding review", "overlane onboarding review --json"],
63815
65838
  effect: "read",
63816
- ...common12,
65839
+ ...common13,
63817
65840
  keywords: ["first review", "onboarding review", "accept review", "see review"],
63818
65841
  result: ReviewResult,
63819
65842
  handler: async (inv) => {
@@ -63836,7 +65859,7 @@ var onboardingInviteCommand = defineCommand({
63836
65859
  flags: [{ name: "role", type: "string", enum: ["admin", "member", "viewer"], default: "member", description: "The role the invitations grant" }],
63837
65860
  examples: ["overlane onboarding invite pat@example.com lee@example.com", "overlane onboarding invite --role viewer pat@example.com", "overlane onboarding invite"],
63838
65861
  effect: "write",
63839
- ...common12,
65862
+ ...common13,
63840
65863
  keywords: ["onboarding invite", "finish invite step"],
63841
65864
  result: InviteResult,
63842
65865
  handler: async (inv) => {
@@ -63909,14 +65932,14 @@ var TaskHandoffResult = withDryRun(
63909
65932
  );
63910
65933
 
63911
65934
  // ../cli/src/commands/task.ts
63912
- var common13 = { needsAuth: true, needsNetwork: true };
65935
+ var common14 = { needsAuth: true, needsNetwork: true };
63913
65936
  var taskListCommand = defineCommand({
63914
65937
  path: ["task", "list"],
63915
65938
  summary: "List the project's tasks and their states",
63916
65939
  description: "Lists every task of the connected project with its state, pause reason, version, lease holder, checks and latest checkpoint.",
63917
65940
  examples: ["overlane task list"],
63918
65941
  effect: "read",
63919
- ...common13,
65942
+ ...common14,
63920
65943
  keywords: ["tasks", "show all tasks", "see tasks", "backlog", "what tasks exist", "work items"],
63921
65944
  result: TaskListResult,
63922
65945
  handler: async (inv) => listTasks(inv.deps)
@@ -63934,7 +65957,7 @@ var taskStartCommand = defineCommand({
63934
65957
  ],
63935
65958
  examples: ["overlane task start task-7", 'overlane task start --outcome "Add CSV export" --criterion "export works" --check unit_tests:L2 --path "src/**"', 'overlane task start --outcome "Fix login" --criterion "login passes" --path "src/auth/**" --dry-run'],
63936
65959
  effect: "write",
63937
- ...common13,
65960
+ ...common14,
63938
65961
  keywords: ["begin", "create task", "new task", "open", "claim new", "work item", "contract", "acceptance criteria", "start working"],
63939
65962
  result: TaskStartResult,
63940
65963
  handler: async (inv) => inv.positionals[0] !== void 0 ? startExisting(inv.deps, inv.positionals[0], inv.dryRun) : startTask(inv.deps, { outcome: textFlag(inv, "outcome"), criteria: listFlag(inv, "criterion"), paths: listFlag(inv, "path"), checks: listFlag(inv, "check"), dryRun: inv.dryRun })
@@ -63945,7 +65968,7 @@ var taskStatusCommand = defineCommand({
63945
65968
  description: "Shows the held task from the service: state, lease, acceptance criteria, checks, evidence count and the latest checkpoint. Says so when nothing is held or the lease was lost.",
63946
65969
  examples: ["overlane task status"],
63947
65970
  effect: "read",
63948
- ...common13,
65971
+ ...common14,
63949
65972
  keywords: ["current task", "what am i working on", "lease", "active task", "progress", "held task"],
63950
65973
  result: TaskStatusResult,
63951
65974
  handler: async (inv) => taskStatus(inv.deps)
@@ -63961,7 +65984,7 @@ var taskCheckpointCommand = defineCommand({
63961
65984
  ],
63962
65985
  examples: ['overlane task checkpoint --summary "Parser done" --next "Write the tests"', 'overlane task checkpoint --summary "Out of budget" --next "Resume" --pause quota'],
63963
65986
  effect: "write",
63964
- ...common13,
65987
+ ...common14,
63965
65988
  keywords: ["save", "progress", "pause", "stop work", "park", "quota", "limit reached", "remember place", "snapshot", "save state", "out of budget"],
63966
65989
  result: TaskCheckpointResult,
63967
65990
  handler: async (inv) => checkpointTask(inv.deps, { summary: textFlag(inv, "summary"), next: textFlag(inv, "next"), pause: textFlag(inv, "pause"), dryRun: inv.dryRun })
@@ -63973,7 +65996,7 @@ var taskResumeCommand = defineCommand({
63973
65996
  args: [{ name: "task-id", required: true, description: "The task to resume" }],
63974
65997
  examples: ["overlane task resume task-1"],
63975
65998
  effect: "write",
63976
- ...common13,
65999
+ ...common14,
63977
66000
  keywords: ["continue", "pick up", "restart", "reclaim", "after pause", "take over", "carry on"],
63978
66001
  result: TaskResumeResult,
63979
66002
  handler: async (inv) => resumeTask(inv.deps, { taskId: inv.positionals[0], dryRun: inv.dryRun })
@@ -63984,7 +66007,7 @@ var taskSubmitCommand = defineCommand({
63984
66007
  description: "Asks for verification at HEAD. The task is verified only when evidence at or above each required check's level exists for that commit: L2 comes from CI on the pushed commit, L1 from `overlane task evidence`.",
63985
66008
  examples: ["overlane task submit", "overlane task submit --dry-run"],
63986
66009
  effect: "write",
63987
- ...common13,
66010
+ ...common14,
63988
66011
  keywords: ["finish", "done", "complete", "verify", "ready for review", "request verification", "hand in", "turn in"],
63989
66012
  result: TaskSubmitResult,
63990
66013
  handler: async (inv) => submitTask(inv.deps, { dryRun: inv.dryRun })
@@ -64000,7 +66023,7 @@ var taskEvidenceCommand = defineCommand({
64000
66023
  ],
64001
66024
  examples: ["overlane task evidence --level L1 -- pnpm test"],
64002
66025
  effect: "write",
64003
- ...common13,
66026
+ ...common14,
64004
66027
  keywords: ["tests", "prove", "record test result", "verification", "run checks", "L1", "attest", "run the tests and record"],
64005
66028
  result: TaskEvidenceResult,
64006
66029
  handler: async (inv) => recordEvidence(inv.deps, { level: textFlag(inv, "level"), task: textFlag(inv, "task"), words: inv.positionals, dryRun: inv.dryRun })
@@ -64016,7 +66039,7 @@ var taskHandoffCommand = defineCommand({
64016
66039
  ],
64017
66040
  examples: ["overlane task handoff --to codex", 'overlane task handoff --to claude --summary "API done" --next "Add tests"'],
64018
66041
  effect: "write",
64019
- ...common13,
66042
+ ...common14,
64020
66043
  keywords: ["hand off", "transfer", "give to", "switch agent", "other agent", "codex", "claude", "pass the task", "delegate", "move work", "swap agents"],
64021
66044
  result: TaskHandoffResult,
64022
66045
  handler: async (inv) => handoffTask(inv.deps, { summary: textFlag(inv, "summary"), next: textFlag(inv, "next"), to: textFlag(inv, "to"), dryRun: inv.dryRun })
@@ -64050,7 +66073,10 @@ function coreCommands() {
64050
66073
  ...libCommands,
64051
66074
  ...reviewCommands,
64052
66075
  ...guardCommands,
64053
- ...billingCommands
66076
+ ...billingCommands,
66077
+ ...repoCommands,
66078
+ ...ciCommands,
66079
+ ...deployCommands
64054
66080
  ];
64055
66081
  }
64056
66082
  function createRegistry(extra = []) {
@@ -64088,10 +66114,10 @@ function parseFor(spec, tokens) {
64088
66114
  }
64089
66115
  }
64090
66116
  }
64091
- const required2 = spec.args.filter((arg) => arg.required).length;
64092
- const variadic = spec.args.some((arg) => arg.variadic === true);
66117
+ const required2 = spec.args.filter((arg4) => arg4.required).length;
66118
+ const variadic = spec.args.some((arg4) => arg4.variadic === true);
64093
66119
  if (positionals.length < required2) {
64094
- const missing = spec.args.filter((arg) => arg.required)[positionals.length];
66120
+ const missing = spec.args.filter((arg4) => arg4.required)[positionals.length];
64095
66121
  throw new UsageError(`${last} needs ${missing?.name ?? "an argument"}`, { hint });
64096
66122
  }
64097
66123
  if (!variadic && positionals.length > spec.args.length) {
@@ -64283,14 +66309,14 @@ function marketplaceRoot(env = process.env, home = homedir()) {
64283
66309
  }
64284
66310
 
64285
66311
  // src/plugin.ts
64286
- import { readFileSync as readFileSync11 } from "node:fs";
66312
+ import { readFileSync as readFileSync13 } from "node:fs";
64287
66313
  import { join as join29 } from "node:path";
64288
66314
  import { parseArgs as parseArgs3 } from "node:util";
64289
66315
 
64290
66316
  // src/marketplace.ts
64291
66317
  init_src();
64292
66318
  import { createHash as createHash7 } from "node:crypto";
64293
- import { cpSync, existsSync as existsSync7, mkdirSync as mkdirSync9, readdirSync as readdirSync3, readFileSync as readFileSync10, renameSync as renameSync6, rmSync as rmSync4, statSync, writeFileSync as writeFileSync8 } from "node:fs";
66319
+ import { cpSync, existsSync as existsSync7, mkdirSync as mkdirSync9, readdirSync as readdirSync3, readFileSync as readFileSync12, renameSync as renameSync6, rmSync as rmSync4, statSync as statSync2, writeFileSync as writeFileSync8 } from "node:fs";
64294
66320
  import { dirname as dirname9, join as join28, relative as relative2, sep } from "node:path";
64295
66321
  var CLIENT_DIRS = ["claude", "codex"];
64296
66322
  var EMBEDDED_MANIFEST = "release-manifest.json";
@@ -64301,7 +66327,7 @@ function loadEmbedded(packageRoot2) {
64301
66327
  const dir = join28(packageRoot2, "plugins");
64302
66328
  const path = join28(dir, EMBEDDED_MANIFEST);
64303
66329
  if (!existsSync7(path)) throw new MarketplaceError(`this package has no embedded plugin release (${path} is missing)`);
64304
- const parsed = ReleaseManifest.safeParse(JSON.parse(readFileSync10(path, "utf8")));
66330
+ const parsed = ReleaseManifest.safeParse(JSON.parse(readFileSync12(path, "utf8")));
64305
66331
  if (!parsed.success) throw new MarketplaceError(`the embedded release manifest is invalid: ${parsed.error.message}`);
64306
66332
  return { dir, manifest: parsed.data };
64307
66333
  }
@@ -64329,7 +66355,7 @@ async function verifyTree(treeRoot, manifest) {
64329
66355
  problems.push(`missing: ${file2.path}`);
64330
66356
  continue;
64331
66357
  }
64332
- if (sha2562(readFileSync10(path)) !== file2.digest) problems.push(`modified: ${file2.path}`);
66358
+ if (sha2562(readFileSync12(path)) !== file2.digest) problems.push(`modified: ${file2.path}`);
64333
66359
  }
64334
66360
  for (const client of CLIENT_DIRS) {
64335
66361
  for (const found of listFiles(join28(treeRoot, client))) {
@@ -64340,7 +66366,7 @@ async function verifyTree(treeRoot, manifest) {
64340
66366
  }
64341
66367
  function readInstalledManifest(target) {
64342
66368
  try {
64343
- const parsed = ReleaseManifest.safeParse(JSON.parse(readFileSync10(join28(target, INSTALLED_MANIFEST), "utf8")));
66369
+ const parsed = ReleaseManifest.safeParse(JSON.parse(readFileSync12(join28(target, INSTALLED_MANIFEST), "utf8")));
64344
66370
  return parsed.success ? parsed.data : null;
64345
66371
  } catch {
64346
66372
  return null;
@@ -64391,7 +66417,7 @@ async function syncMarketplace(embedded, target) {
64391
66417
  }
64392
66418
  async function ensureMarketplace(embedded, target) {
64393
66419
  const installed = readInstalledManifest(target);
64394
- const present = existsSync7(target) && statSync(target).isDirectory();
66420
+ const present = existsSync7(target) && statSync2(target).isDirectory();
64395
66421
  if (installed !== null && present && !isNewer(embedded.manifest.version, installed.version)) return false;
64396
66422
  await syncMarketplace(embedded, target);
64397
66423
  return true;
@@ -64404,7 +66430,7 @@ var PluginUsageError = class extends Error {
64404
66430
  };
64405
66431
  function readNames(treeRoot, client) {
64406
66432
  const file2 = client === "claude" ? join29(treeRoot, "claude", ".claude-plugin", "marketplace.json") : join29(treeRoot, "codex", ".agents", "plugins", "marketplace.json");
64407
- const parsed = JSON.parse(readFileSync11(file2, "utf8"));
66433
+ const parsed = JSON.parse(readFileSync13(file2, "utf8"));
64408
66434
  const record3 = parsed;
64409
66435
  const plugin = record3.plugins?.[0]?.name;
64410
66436
  if (typeof record3.name !== "string" || typeof plugin !== "string") throw new MarketplaceError(`${file2} names no marketplace or plugin`);