@theholocron/cli 5.0.0-alpha.397 → 5.0.0-alpha.399

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/cli.mjs CHANGED
@@ -799,7 +799,8 @@ const COMMAND_CONTEXTS = {
799
799
  "repo cleanup branches": "workspace",
800
800
  "sync github": "workspace",
801
801
  "sync issues": "workspace",
802
- "ideas sync": "workspace"
802
+ "ideas sync": "workspace",
803
+ "ideas promote": "workspace"
803
804
  };
804
805
  /**
805
806
  * The context for a command name from `argv._`. Falls back to the leading
@@ -1498,12 +1499,12 @@ async function runDoctorTokens(input) {
1498
1499
  try {
1499
1500
  module = await importer(pkg);
1500
1501
  } catch (err) {
1501
- rows.push(row$10(pkg, "skip", `cannot load the plugin: ${errorMessage(err)}`));
1502
+ rows.push(row$11(pkg, "skip", `cannot load the plugin: ${errorMessage(err)}`));
1502
1503
  continue;
1503
1504
  }
1504
1505
  for (const token of module.tokens ?? []) rows.push(await checkToken$1(token, module, env, readToken, now()));
1505
1506
  }
1506
- if (rows.length === 0) rows.push(row$10("tokens", "skip", "no configured plugin lists the tokens it takes"));
1507
+ if (rows.length === 0) rows.push(row$11("tokens", "skip", "no configured plugin lists the tokens it takes"));
1507
1508
  printCheckRows(rows, print);
1508
1509
  const summary = summariseChecks(rows);
1509
1510
  printCheckSummary(summary, print);
@@ -1535,11 +1536,11 @@ async function loadCredentials(input) {
1535
1536
  try {
1536
1537
  await loader.load();
1537
1538
  } catch (err) {
1538
- return [row$10("credentials", "skip", `could not load the credentials providers: ${errorMessage(err)}`)];
1539
+ return [row$11("credentials", "skip", `could not load the credentials providers: ${errorMessage(err)}`)];
1539
1540
  }
1540
- return loader.loadFailures().filter((failure) => failure.key === "credentials").map((failure) => row$10(`credentials ${failure.provider}`, "fail", `could not be read: ${errorMessage(failure.error)}`));
1541
+ return loader.loadFailures().filter((failure) => failure.key === "credentials").map((failure) => row$11(`credentials ${failure.provider}`, "fail", `could not be read: ${errorMessage(failure.error)}`));
1541
1542
  }
1542
- function row$10(id, status, detail) {
1543
+ function row$11(id, status, detail) {
1543
1544
  return {
1544
1545
  id,
1545
1546
  title: id,
@@ -1553,21 +1554,21 @@ async function checkToken$1(token, module, env, readToken, now) {
1553
1554
  const fromEnv = env.get(envName) ? envName : vendorEnvName && env.get(vendorEnvName) ? vendorEnvName : void 0;
1554
1555
  const stored = fromEnv ? void 0 : findCredential(...vendorEnvName ? [envName, vendorEnvName] : [envName]);
1555
1556
  const value = fromEnv ? env.get(fromEnv) : stored?.value ?? readToken(keyringKey);
1556
- if (!value) return row$10(keyringKey, "skip", `not set (${vendorEnvName ? `${envName} / ${vendorEnvName}` : envName}, or \`holocron auth set ${keyringKey}\`)`);
1557
+ if (!value) return row$11(keyringKey, "skip", `not set (${vendorEnvName ? `${envName} / ${vendorEnvName}` : envName}, or \`holocron auth set ${keyringKey}\`)`);
1557
1558
  const verify = token.verify ?? (token.verifiable === false ? void 0 : module.verifyToken);
1558
- if (!verify) return row$10(keyringKey, "skip", "set, but its plugin cannot verify it");
1559
+ if (!verify) return row$11(keyringKey, "skip", "set, but its plugin cannot verify it");
1559
1560
  const from = fromEnv ?? stored?.source ?? "keyring";
1560
1561
  try {
1561
1562
  const verified = await verify(value);
1562
- if (!verified.ok) return row$10(keyringKey, "fail", `rejected (${from}): ${verified.message}`);
1563
+ if (!verified.ok) return row$11(keyringKey, "fail", `rejected (${from}): ${verified.message}`);
1563
1564
  const expiry = verified.expiresAt ? describeExpiry(verified.expiresAt, now) : void 0;
1564
- if (!expiry) return row$10(keyringKey, "ok", `${verified.subject} (${from})`);
1565
+ if (!expiry) return row$11(keyringKey, "ok", `${verified.subject} (${from})`);
1565
1566
  return expiry.soon ? {
1566
- ...row$10(keyringKey, "fail", `${verified.subject} (${from}), ${expiry.text}`),
1567
+ ...row$11(keyringKey, "fail", `${verified.subject} (${from}), ${expiry.text}`),
1567
1568
  problems: [`${expiry.text}: renew it`]
1568
- } : row$10(keyringKey, "ok", `${verified.subject} (${from}), ${expiry.text}`);
1569
+ } : row$11(keyringKey, "ok", `${verified.subject} (${from}), ${expiry.text}`);
1569
1570
  } catch (err) {
1570
- return row$10(keyringKey, "fail", `could not be verified (${from}): ${errorMessage(err)}`);
1571
+ return row$11(keyringKey, "fail", `could not be verified (${from}): ${errorMessage(err)}`);
1571
1572
  }
1572
1573
  }
1573
1574
  // src/commands/doctor-tokens/doctor-tokens.command.ts
@@ -2149,6 +2150,18 @@ const githubAppCreateEntry = {
2149
2150
  ],
2150
2151
  supportsDryRun: false
2151
2152
  };
2153
+ // src/commands/ideas-promote/ideas-promote.entry.ts
2154
+ const ideasPromoteEntry = {
2155
+ name: "ideas promote",
2156
+ description: "Write a draft spec in .notes/ from the issue an idea was filed as",
2157
+ positionals: [{
2158
+ key: "issue",
2159
+ message: "Issue (#1234 or a Linear key):",
2160
+ type: "input"
2161
+ }],
2162
+ skipOptions: ["name", "yes"],
2163
+ supportsDryRun: true
2164
+ };
2152
2165
  // src/commands/ideas-sync/ideas-sync.entry.ts
2153
2166
  const ideasSyncEntry = {
2154
2167
  name: "ideas sync",
@@ -2828,6 +2841,7 @@ const registry = createCommandRegistry([
2828
2841
  supportsDryRun: true
2829
2842
  },
2830
2843
  ideasSyncEntry,
2844
+ ideasPromoteEntry,
2831
2845
  {
2832
2846
  name: "repo sync readme",
2833
2847
  description: "Sync the Installation + Usage block in README.md from package.json",
@@ -5008,7 +5022,7 @@ async function runDoctorCredentials(input) {
5008
5022
  };
5009
5023
  }
5010
5024
  /** A row for the provider as a whole, or for one of its variables when `name` is given. */
5011
- function row$9(provider, status, detail, name) {
5025
+ function row$10(provider, status, detail, name) {
5012
5026
  return name === void 0 ? {
5013
5027
  id: provider,
5014
5028
  title: provider,
@@ -5025,32 +5039,32 @@ function row$9(provider, status, detail, name) {
5025
5039
  }
5026
5040
  async function checkCredentials(input, loader) {
5027
5041
  const { resolved } = input.loaded;
5028
- if (!resolved.providers.credentials) return [row$9("credentials", "skip", "no `credentials` provider is configured")];
5029
- const rows = loader.loadFailures().filter((f) => f.key === "credentials").map((f) => row$9(f.provider, "fail", `failed to load: ${errorMessage(f.error)}`));
5042
+ if (!resolved.providers.credentials) return [row$10("credentials", "skip", "no `credentials` provider is configured")];
5043
+ const rows = loader.loadFailures().filter((f) => f.key === "credentials").map((f) => row$10(f.provider, "fail", `failed to load: ${errorMessage(f.error)}`));
5030
5044
  if (!loader.has("credentials")) return rows;
5031
5045
  const expected = await expectedTokens(input);
5032
5046
  const { tuples } = resolved.providers.credentials;
5033
5047
  for (const impl of loader.get("credentials")) {
5034
5048
  const tuple = tuples.find((t) => t.provider === impl.providerName);
5035
5049
  const environment = tuple && credentialsEnvironment(tuple, resolved);
5036
- rows.push(...environment ? await checkProvider(impl, environment, expected) : [row$9(impl.providerName, "skip", "no `environment` option and `credentials.environment` is not set")]);
5050
+ rows.push(...environment ? await checkProvider(impl, environment, expected) : [row$10(impl.providerName, "skip", "no `environment` option and `credentials.environment` is not set")]);
5037
5051
  }
5038
5052
  return rows;
5039
5053
  }
5040
5054
  async function checkProvider(impl, environment, expected) {
5041
5055
  const provider = impl.providerName;
5042
- if (!impl.inspect) return [row$9(provider, "skip", "cannot list the variables without reading their values")];
5043
- if (expected.length === 0) return [row$9(provider, "skip", "no configured plugin lists the tokens it takes")];
5056
+ if (!impl.inspect) return [row$10(provider, "skip", "cannot list the variables without reading their values")];
5057
+ if (expected.length === 0) return [row$10(provider, "skip", "no configured plugin lists the tokens it takes")];
5044
5058
  try {
5045
5059
  const found = await impl.inspect(environment);
5046
5060
  const held = new Set(found.names);
5047
5061
  const where = found.environment === environment ? `"${found.environment}"` : `"${found.environment}" (the config writes "${environment}")`;
5048
5062
  return expected.map(({ name, optional }) => {
5049
- if (held.has(name)) return row$9(provider, "ok", `present in ${where}`, name);
5050
- return optional ? row$9(provider, "skip", `optional, not set in ${where}`, name) : row$9(provider, "fail", `missing from ${where}`, name);
5063
+ if (held.has(name)) return row$10(provider, "ok", `present in ${where}`, name);
5064
+ return optional ? row$10(provider, "skip", `optional, not set in ${where}`, name) : row$10(provider, "fail", `missing from ${where}`, name);
5051
5065
  });
5052
5066
  } catch (err) {
5053
- return [row$9(provider, "fail", errorMessage(err))];
5067
+ return [row$10(provider, "fail", errorMessage(err))];
5054
5068
  }
5055
5069
  }
5056
5070
  /**
@@ -5881,7 +5895,7 @@ async function runDoctorDns(input) {
5881
5895
  });
5882
5896
  else if (!loader.has("dns")) {
5883
5897
  const why = whyMissing(loader, "dns", "no `dns` provider to check them with");
5884
- for (const zone of zones) rows.push(row$8(zone, "skip", why));
5898
+ for (const zone of zones) rows.push(row$9(zone, "skip", why));
5885
5899
  for (const { hostname } of domains) rows.push(domainRow(hostname, "skip", why));
5886
5900
  } else {
5887
5901
  const dns = loader.get("dns");
@@ -5903,7 +5917,7 @@ async function runDoctorDns(input) {
5903
5917
  ...status === "skip" ? { reason: [...new Set(rows.map((r) => r.detail))].join("; ") } : {}
5904
5918
  };
5905
5919
  }
5906
- function row$8(zone, status, detail, problems = []) {
5920
+ function row$9(zone, status, detail, problems = []) {
5907
5921
  return {
5908
5922
  id: `dns-${zone}`,
5909
5923
  title: `${zone} records exist`,
@@ -5932,7 +5946,7 @@ async function checkDomain(dns, deploy, project, hostname) {
5932
5946
  return noToken !== void 0 ? domainRow(hostname, "skip", noToken) : domainRow(hostname, "fail", errorMessage(err));
5933
5947
  }
5934
5948
  }
5935
- async function checkZone(dns, zone, wanted, rowOf = (...args) => row$8(zone, ...args)) {
5949
+ async function checkZone(dns, zone, wanted, rowOf = (...args) => row$9(zone, ...args)) {
5936
5950
  try {
5937
5951
  const have = await dns.listRecords(zone);
5938
5952
  const problems = declaredVsActual(new Map(wanted.map((w) => [keyOf(w), w])), new Map(have.map((h) => [keyOf(h), h])), {
@@ -6067,7 +6081,7 @@ function installationSettingsUrl(account, id) {
6067
6081
  return `https://github.com/settings/installations/${id}`;
6068
6082
  }
6069
6083
  // src/commands/doctor-github-app/app-rows.ts
6070
- const row$7 = (name, what, problems, ok) => ({
6084
+ const row$8 = (name, what, problems, ok) => ({
6071
6085
  id: `${name}:${what}`,
6072
6086
  title: `${name}: ${what}`,
6073
6087
  status: problems.length > 0 ? "fail" : "ok",
@@ -6094,9 +6108,9 @@ function appRows(name, manifest, app, installations) {
6094
6108
  return [`${who} has not accepted the current App: ${gaps.join("; ")}`, `fix: ${who} accepts the update at ${url}`];
6095
6109
  });
6096
6110
  return [
6097
- row$7(name, "events", eventProblems.length > 0 ? [...eventProblems, fix] : [], `all ${manifest.events.length} subscribed${extrasNote("extra event(s)", extraEvents)}`),
6098
- row$7(name, "permissions", permissionProblems.length > 0 ? [...permissionProblems, fix] : [], `all ${Object.keys(manifest.permissions).length} granted${extrasNote("extra permission(s)", extraPermissions)}`),
6099
- row$7(name, "installations", installationProblems, `${installations.length} installation(s) up to date`)
6111
+ row$8(name, "events", eventProblems.length > 0 ? [...eventProblems, fix] : [], `all ${manifest.events.length} subscribed${extrasNote("extra event(s)", extraEvents)}`),
6112
+ row$8(name, "permissions", permissionProblems.length > 0 ? [...permissionProblems, fix] : [], `all ${Object.keys(manifest.permissions).length} granted${extrasNote("extra permission(s)", extraPermissions)}`),
6113
+ row$8(name, "installations", installationProblems, `${installations.length} installation(s) up to date`)
6100
6114
  ];
6101
6115
  }
6102
6116
  // src/commands/doctor-github-app/parse-manifest.ts
@@ -6154,7 +6168,7 @@ async function runDoctorGitHubApp(input) {
6154
6168
  assertPluginsResolvable$1(loader, "doctor github-app");
6155
6169
  }
6156
6170
  const rows = [];
6157
- if (instances.length === 0) rows.push(row$6("github-app", "reachable", "skip", "no `githubApps` are declared in holocron.config.ts"));
6171
+ if (instances.length === 0) rows.push(row$7("github-app", "reachable", "skip", "no `githubApps` are declared in holocron.config.ts"));
6158
6172
  for (const instance of instances) rows.push(...await checkInstance(instance, loader, input));
6159
6173
  printCheckRows(rows, print);
6160
6174
  const summary = summariseChecks(rows);
@@ -6171,7 +6185,7 @@ async function runDoctorGitHubApp(input) {
6171
6185
  ...status === "skip" ? { reason: [...new Set(rows.map((r) => r.detail))].join("; ") } : {}
6172
6186
  };
6173
6187
  }
6174
- function row$6(name, what, status, detail) {
6188
+ function row$7(name, what, status, detail) {
6175
6189
  return {
6176
6190
  id: `${name}:${what}`,
6177
6191
  title: `${name}: ${what}`,
@@ -6214,19 +6228,19 @@ async function checkInstance(instance, loader, input) {
6214
6228
  try {
6215
6229
  manifest = parseManifest(readManifest(instance.manifest));
6216
6230
  } catch (err) {
6217
- return [row$6(name, "manifest", "fail", `cannot read ${instance.manifest}: ${errorMessage(err)}`)];
6231
+ return [row$7(name, "manifest", "fail", `cannot read ${instance.manifest}: ${errorMessage(err)}`)];
6218
6232
  }
6219
6233
  const read = await readCredentials(instance, loader);
6220
- if ("reason" in read) return [row$6(name, "reachable", "skip", read.reason)];
6234
+ if ("reason" in read) return [row$7(name, "reachable", "skip", read.reason)];
6221
6235
  const api = input.api ?? defaultApi;
6222
6236
  const secrets = [read.creds.privateKey];
6223
6237
  try {
6224
6238
  const app = await api.getApp(read.creds);
6225
6239
  const installations = await api.listAppInstallations(read.creds);
6226
6240
  const owner = app.owner ? `, owned by ${app.owner.login}` : "";
6227
- return [row$6(name, "reachable", "ok", `${app.slug}${owner}, settings: ${appSettingsUrl(app)}`), ...appRows(name, manifest, app, installations)];
6241
+ return [row$7(name, "reachable", "ok", `${app.slug}${owner}, settings: ${appSettingsUrl(app)}`), ...appRows(name, manifest, app, installations)];
6228
6242
  } catch (err) {
6229
- return [row$6(name, "reachable", "fail", `cannot call GitHub as the App: ${scrubbed(err, secrets)}`)];
6243
+ return [row$7(name, "reachable", "fail", `cannot call GitHub as the App: ${scrubbed(err, secrets)}`)];
6230
6244
  }
6231
6245
  }
6232
6246
  // src/commands/doctor-github-app/doctor-github-app.command.ts
@@ -6293,7 +6307,7 @@ function datasetTargets(config) {
6293
6307
  * dataset, shared by every environment in it). Only a dataset the provider says is missing, or a token it refuses, fails;
6294
6308
  * a name, a token or a response that cannot be read is a skip with the reason.
6295
6309
  */
6296
- const row$5 = (id, title, status, detail, problems = []) => ({
6310
+ const row$6 = (id, title, status, detail, problems = []) => ({
6297
6311
  id,
6298
6312
  title,
6299
6313
  status,
@@ -6310,7 +6324,7 @@ async function runDoctorLogs(input) {
6310
6324
  if (!loader.has("logs")) {
6311
6325
  const failure = loader.loadFailures().find((f) => f.key === "logs");
6312
6326
  const why = failure ? `\`${failure.provider}\` failed to load: ${describeError(failure.error)}` : "no `logs` provider is configured in holocron.config.ts";
6313
- rows.push(row$5("logs", "logs", "skip", why));
6327
+ rows.push(row$6("logs", "logs", "skip", why));
6314
6328
  } else rows.push(...await checkLogs(loader.get("logs"), datasetTargets(input.loaded.resolved)));
6315
6329
  printCheckRows(rows, print);
6316
6330
  const summary = summariseChecks(rows);
@@ -6334,38 +6348,38 @@ async function checkLogs(logs, targets) {
6334
6348
  for (const target of targets) {
6335
6349
  const id = `logs:dataset:${target.id}`;
6336
6350
  const title = `dataset for ${target.label}`;
6337
- if (!target.name) rows.push(row$5(id, title, "skip", `${target.variable} is not set here, so there is no name to look for`));
6338
- else if (!token.usable) rows.push(row$5(id, title, "skip", `${target.name}: not checked, the token is not usable`));
6339
- else if (!logs.readDataset) rows.push(row$5(id, title, "skip", `${logs.providerName} cannot read a dataset`));
6351
+ if (!target.name) rows.push(row$6(id, title, "skip", `${target.variable} is not set here, so there is no name to look for`));
6352
+ else if (!token.usable) rows.push(row$6(id, title, "skip", `${target.name}: not checked, the token is not usable`));
6353
+ else if (!logs.readDataset) rows.push(row$6(id, title, "skip", `${logs.providerName} cannot read a dataset`));
6340
6354
  else rows.push(...await checkDataset(logs, target, target.name, id, title));
6341
6355
  }
6342
6356
  const org = resolveValue$2(["AXIOM_ORG"], void 0, { prefix: PREFIX });
6343
- rows.push(org ? row$5("logs:org", "organization", "ok", `${PREFIX}_AXIOM_ORG (or AXIOM_ORG) is set`) : row$5("logs:org", "organization", "skip", `${PREFIX}_AXIOM_ORG (or AXIOM_ORG) is not set here; Sentinel's log links and check-dispatched need it`));
6357
+ rows.push(org ? row$6("logs:org", "organization", "ok", `${PREFIX}_AXIOM_ORG (or AXIOM_ORG) is set`) : row$6("logs:org", "organization", "skip", `${PREFIX}_AXIOM_ORG (or AXIOM_ORG) is not set here; Sentinel's log links and check-dispatched need it`));
6344
6358
  return rows;
6345
6359
  }
6346
6360
  /** Whether the provider accepts the token. `usable` is false when it was refused or could not be tried. */
6347
6361
  async function checkToken(logs) {
6348
6362
  const title = "token is accepted";
6349
6363
  if (!logs.checkToken) return {
6350
- row: row$5("logs:token", title, "skip", `${logs.providerName} cannot check a token`),
6364
+ row: row$6("logs:token", title, "skip", `${logs.providerName} cannot check a token`),
6351
6365
  usable: true
6352
6366
  };
6353
6367
  try {
6354
6368
  const result = await logs.checkToken();
6355
6369
  if (result.ok) return {
6356
- row: row$5("logs:token", title, "ok", `${logs.providerName} accepts the token`),
6370
+ row: row$6("logs:token", title, "ok", `${logs.providerName} accepts the token`),
6357
6371
  usable: true
6358
6372
  };
6359
6373
  const reason = result.reason ?? `${logs.providerName} refused the token`;
6360
6374
  return {
6361
- row: row$5("logs:token", title, "fail", reason, [reason]),
6375
+ row: row$6("logs:token", title, "fail", reason, [reason]),
6362
6376
  usable: false
6363
6377
  };
6364
6378
  } catch (err) {
6365
6379
  const noToken = missingTokenReason(err);
6366
6380
  const detail = noToken ?? `could not check the token: ${describeError(err)}`;
6367
6381
  return {
6368
- row: row$5("logs:token", title, "skip", detail),
6382
+ row: row$6("logs:token", title, "skip", detail),
6369
6383
  usable: noToken === void 0
6370
6384
  };
6371
6385
  }
@@ -6375,13 +6389,13 @@ async function checkDataset(logs, target, name, id, title) {
6375
6389
  const found = await logs.readDataset(name);
6376
6390
  if (!found.exists) {
6377
6391
  const problem = `dataset ${name} does not exist (${target.variable}); ${target.fix}`;
6378
- return [row$5(id, title, "fail", `${name} does not exist`, [problem])];
6392
+ return [row$6(id, title, "fail", `${name} does not exist`, [problem])];
6379
6393
  }
6380
6394
  const retention = found.retentionDays === void 0 ? `retention: ${logs.providerName} did not report one for ${name}` : `retention: ${found.retentionDays} days for ${name}`;
6381
- return [row$5(id, title, "ok", `${name} exists`), row$5(`logs:retention:${target.id}`, `retention of ${name}`, "skip", `info: ${retention}; one setting shared by every environment in the dataset (ADR-0019)`)];
6395
+ return [row$6(id, title, "ok", `${name} exists`), row$6(`logs:retention:${target.id}`, `retention of ${name}`, "skip", `info: ${retention}; one setting shared by every environment in the dataset (ADR-0019)`)];
6382
6396
  } catch (err) {
6383
6397
  const detail = missingTokenReason(err) ?? `could not read ${name}: ${describeError(err)}`;
6384
- return [row$5(id, title, "skip", detail)];
6398
+ return [row$6(id, title, "skip", detail)];
6385
6399
  }
6386
6400
  }
6387
6401
  // src/commands/doctor-logs/doctor-logs.command.ts
@@ -9370,7 +9384,7 @@ const info = (id, title, noun, extras) => ({
9370
9384
  detail: `info: ${extras.length} ${noun} not in the template (never deleted)`,
9371
9385
  problems: extras
9372
9386
  });
9373
- const row$4 = (id, title, problems, ok) => ({
9387
+ const row$5 = (id, title, problems, ok) => ({
9374
9388
  id,
9375
9389
  title,
9376
9390
  status: problems.length > 0 ? "fail" : "ok",
@@ -9406,19 +9420,19 @@ function viewProblems(want, found) {
9406
9420
  function boardRows(boardName, template, state) {
9407
9421
  const id = `project:${boardName}`;
9408
9422
  const rows = [];
9409
- rows.push(row$4(`${id}:statuses`, `${boardName}: statuses`, listProblems("status", "statuses", template.statuses.map((s) => s.name), state.statuses), `${template.statuses.length} in order`));
9423
+ rows.push(row$5(`${id}:statuses`, `${boardName}: statuses`, listProblems("status", "statuses", template.statuses.map((s) => s.name), state.statuses), `${template.statuses.length} in order`));
9410
9424
  const extraStatuses = state.statuses.filter((s) => !template.statuses.some((t) => t.name === s));
9411
9425
  if (extraStatuses.length > 0) rows.push(info(`${id}:extra-statuses`, `${boardName}: extra statuses`, "status(es)", extraStatuses));
9412
- for (const want of template.fields) rows.push(row$4(`${id}:field:${want.name}`, `${boardName}: field ${want.name}`, fieldProblems(want, state.fields.find((f) => f.name === want.name)), want.options ? `${want.options.length} options in order` : want.type));
9426
+ for (const want of template.fields) rows.push(row$5(`${id}:field:${want.name}`, `${boardName}: field ${want.name}`, fieldProblems(want, state.fields.find((f) => f.name === want.name)), want.options ? `${want.options.length} options in order` : want.type));
9413
9427
  const extraFields = state.fields.filter((f) => !template.fields.some((t) => t.name === f.name));
9414
9428
  if (extraFields.length > 0) rows.push(info(`${id}:extra-fields`, `${boardName}: extra fields`, "field(s)", extraFields.map((f) => f.name)));
9415
- for (const want of template.views) rows.push(row$4(`${id}:view:${want.name}`, `${boardName}: view ${want.name}`, viewProblems(want, state.views.find((v) => v.name === want.name)), `${want.layout}${want.filter ? `, ${want.filter}` : ""}`));
9429
+ for (const want of template.views) rows.push(row$5(`${id}:view:${want.name}`, `${boardName}: view ${want.name}`, viewProblems(want, state.views.find((v) => v.name === want.name)), `${want.layout}${want.filter ? `, ${want.filter}` : ""}`));
9416
9430
  const extraViews = state.views.filter((v) => !template.views.some((t) => t.name === v.name));
9417
9431
  if (extraViews.length > 0) rows.push(info(`${id}:extra-views`, `${boardName}: extra views`, "view(s)", extraViews.map((v) => v.name)));
9418
9432
  for (const name of template.rules ?? []) {
9419
9433
  const found = state.rules.find((r) => r.name === name);
9420
9434
  const problems = !found ? [`missing rule ${name}`] : found.enabled ? [] : [`rule ${name} is off`];
9421
- rows.push(row$4(`${id}:rule:${name}`, `${boardName}: rule ${name}`, problems, "on"));
9435
+ rows.push(row$5(`${id}:rule:${name}`, `${boardName}: rule ${name}`, problems, "on"));
9422
9436
  }
9423
9437
  return rows;
9424
9438
  }
@@ -9478,7 +9492,7 @@ function itemRows(boardName, items) {
9478
9492
  * never fail the run. A template file that does not read is a failure naming the file. `--post [channel]` shares the
9479
9493
  * failing rows through the `notifications` provider's bot, like `doctor notifications --post`.
9480
9494
  */
9481
- const row$3 = (id, title, status, detail, problems = []) => ({
9495
+ const row$4 = (id, title, status, detail, problems = []) => ({
9482
9496
  id,
9483
9497
  title,
9484
9498
  status,
@@ -9532,14 +9546,14 @@ async function checkBoards(input, loader) {
9532
9546
  loader,
9533
9547
  ...input.io ? { io: input.io } : {}
9534
9548
  });
9535
- if (!opened.ok) return [row$3("project", "project", opened.kind, opened.reason, opened.problems)];
9549
+ if (!opened.ok) return [row$4("project", "project", opened.kind, opened.reason, opened.problems)];
9536
9550
  const { projects, owner, boards, templates, templateProblems } = opened.context;
9537
9551
  const rows = templateProblems.map((problem) => {
9538
9552
  /* v8 ignore next -- split always returns at least one element; the fallback only satisfies noUncheckedIndexedAccess */
9539
9553
  const file = problem.split(": ")[0] ?? problem;
9540
- return row$3(`project:template:${file}`, `template file ${file}`, "fail", problem);
9554
+ return row$4(`project:template:${file}`, `template file ${file}`, "fail", problem);
9541
9555
  });
9542
- if (boards.length === 0) return [...rows, row$3("project", "project", "skip", "no boards are declared in `providers.projects.boards`")];
9556
+ if (boards.length === 0) return [...rows, row$4("project", "project", "skip", "no boards are declared in `providers.projects.boards`")];
9543
9557
  for (const declared of boards) {
9544
9558
  const template = templates[declared.template];
9545
9559
  const title = `${declared.name}: board exists and is open`;
@@ -9547,18 +9561,18 @@ async function checkBoards(input, loader) {
9547
9561
  const board = await projects.find(owner, declared.name);
9548
9562
  if (!board) {
9549
9563
  const closed = (await projects.list(owner)).some((b) => b.name === declared.name && b.closed);
9550
- rows.push(row$3(`project:${declared.name}`, title, "fail", closed ? "the board is closed" : "no open board has this name", [closed ? "reopen it, or run `holocron project setup` to make a new one" : "run `holocron project setup`"]));
9564
+ rows.push(row$4(`project:${declared.name}`, title, "fail", closed ? "the board is closed" : "no open board has this name", [closed ? "reopen it, or run `holocron project setup` to make a new one" : "run `holocron project setup`"]));
9551
9565
  continue;
9552
9566
  }
9553
- rows.push(row$3(`project:${declared.name}`, title, "ok", board.url));
9567
+ rows.push(row$4(`project:${declared.name}`, title, "ok", board.url));
9554
9568
  if (!template) {
9555
- rows.push(row$3(`project:${declared.name}:template`, `${declared.name}: template ${declared.template}`, "fail", "no built-in or file template has this name"));
9569
+ rows.push(row$4(`project:${declared.name}:template`, `${declared.name}: template ${declared.template}`, "fail", "no built-in or file template has this name"));
9556
9570
  continue;
9557
9571
  }
9558
9572
  rows.push(...boardRows(declared.name, template, await projects.read(owner, board)));
9559
- rows.push(...projects.items ? itemRows(declared.name, await projects.items(owner, board, template)) : [row$3(`project:${declared.name}:items`, `${declared.name}: items`, "skip", "the provider cannot list a board's items")]);
9573
+ rows.push(...projects.items ? itemRows(declared.name, await projects.items(owner, board, template)) : [row$4(`project:${declared.name}:items`, `${declared.name}: items`, "skip", "the provider cannot list a board's items")]);
9560
9574
  } catch (err) {
9561
- rows.push(row$3(`project:${declared.name}`, title, "fail", describeError(err)));
9575
+ rows.push(row$4(`project:${declared.name}`, title, "fail", describeError(err)));
9562
9576
  }
9563
9577
  }
9564
9578
  return rows;
@@ -10233,19 +10247,19 @@ async function runDoctorRepo(input) {
10233
10247
  const rows = [];
10234
10248
  if (!loader.has("source")) {
10235
10249
  const why = whyMissing(loader, "source", "no `source` provider to read the repository with");
10236
- for (const check of checks) rows.push(row$2(check, { skip: why }));
10250
+ for (const check of checks) rows.push(row$3(check, { skip: why }));
10237
10251
  } else {
10238
10252
  const source = loader.get("source");
10239
10253
  for (const check of checks) {
10240
10254
  if (typeof source[check.needs] !== "function") {
10241
- rows.push(row$2(check, { skip: `provider does not implement ${check.needs}` }));
10255
+ rows.push(row$3(check, { skip: `provider does not implement ${check.needs}` }));
10242
10256
  continue;
10243
10257
  }
10244
10258
  try {
10245
- rows.push(row$2(check, await check.run(source)));
10259
+ rows.push(row$3(check, await check.run(source)));
10246
10260
  } catch (err) {
10247
10261
  const noToken = missingTokenReason(err);
10248
- if (noToken !== void 0) rows.push(row$2(check, { skip: noToken }));
10262
+ if (noToken !== void 0) rows.push(row$3(check, { skip: noToken }));
10249
10263
  else rows.push({
10250
10264
  id: check.id,
10251
10265
  title: check.title,
@@ -10271,7 +10285,7 @@ async function runDoctorRepo(input) {
10271
10285
  ...status === "skip" ? { reason: rows.map((r) => r.detail).join("; ") } : {}
10272
10286
  };
10273
10287
  }
10274
- function row$2(check, result) {
10288
+ function row$3(check, result) {
10275
10289
  const { id, title } = check;
10276
10290
  if ("skip" in result) return {
10277
10291
  id,
@@ -10679,14 +10693,14 @@ async function runDoctorVariables(input) {
10679
10693
  });
10680
10694
  else if (!loader.has("source")) {
10681
10695
  const why = whyMissing(loader, "source", "no `source` provider to read them with");
10682
- for (const check of checks) rows.push(row$1(check, { skip: why }));
10696
+ for (const check of checks) rows.push(row$2(check, { skip: why }));
10683
10697
  } else {
10684
10698
  const source = loader.get("source");
10685
10699
  for (const check of checks) try {
10686
- rows.push(row$1(check, await check.run(source)));
10700
+ rows.push(row$2(check, await check.run(source)));
10687
10701
  } catch (err) {
10688
10702
  const noToken = missingTokenReason(err);
10689
- if (noToken !== void 0) rows.push(row$1(check, { skip: noToken }));
10703
+ if (noToken !== void 0) rows.push(row$2(check, { skip: noToken }));
10690
10704
  else rows.push({
10691
10705
  id: check.id,
10692
10706
  title: check.title,
@@ -10711,7 +10725,7 @@ async function runDoctorVariables(input) {
10711
10725
  ...status === "skip" ? { reason: rows.map((r) => r.detail).join("; ") } : {}
10712
10726
  };
10713
10727
  }
10714
- function row$1(check, result) {
10728
+ function row$2(check, result) {
10715
10729
  const { id, title } = check;
10716
10730
  if ("skip" in result) return {
10717
10731
  id,
@@ -11474,6 +11488,225 @@ const githubAppCommand = {
11474
11488
  builder: (y) => y.command(githubAppCreateCommand).command(groupMenu$1("github-app")),
11475
11489
  handler: () => {}
11476
11490
  };
11491
+ // src/commands/ideas-promote/build-spec/build-spec.ts
11492
+ const FILED_FROM = /^Filed from idea:.*$/;
11493
+ const MARKER = /^<!-- holocron:idea [^>]*-->$/;
11494
+ /**
11495
+ * A draft spec from an issue: frontmatter (`status: draft`, the `issue`, no `blocked-by`, and no `id`, which
11496
+ * `specs sync` assigns), the title as the heading, and a `Problem` section holding the issue's text. The `Filed from
11497
+ * idea:` line and the hidden marker `ideas sync` appends are dropped, and so is a first `#` heading that repeats the
11498
+ * title. The text is laid out the way Prettier does (LF endings, one blank line between blocks, one final newline).
11499
+ */
11500
+ function buildSpec(input) {
11501
+ const lines = (input.body ?? "").replace(/\r\n?/g, "\n").split("\n");
11502
+ let fromIdea = false;
11503
+ const kept = lines.filter((line) => {
11504
+ const trimmed = line.trim();
11505
+ if (FILED_FROM.test(trimmed) || MARKER.test(trimmed)) {
11506
+ fromIdea = true;
11507
+ return false;
11508
+ }
11509
+ return true;
11510
+ });
11511
+ const first = kept.findIndex((line) => line.trim() !== "");
11512
+ if (first >= 0 && kept[first].trim() === `# ${input.title.trim()}`) kept.splice(first, 1);
11513
+ const problem = kept.map((line) => line.replace(/[ \t]+$/, "")).join("\n").replace(/\n{3,}/g, "\n\n").trim();
11514
+ return {
11515
+ content: [
11516
+ "---",
11517
+ "status: draft",
11518
+ `issue: ${input.issue}`,
11519
+ "blocked-by: []",
11520
+ "---",
11521
+ "",
11522
+ `# ${input.title.trim()}`,
11523
+ "",
11524
+ "## Problem",
11525
+ ...problem ? ["", problem] : [],
11526
+ ""
11527
+ ].join("\n"),
11528
+ fromIdea
11529
+ };
11530
+ }
11531
+ // src/commands/ideas-promote/real-promote-io/real-promote-io.ts
11532
+ /** {@link PromoteIo} over the real disk. A file is never overwritten (`wx`), even if one appears between the check and the write. */
11533
+ const realPromoteIo = {
11534
+ exists: (path) => existsSync(path),
11535
+ write: (path, content) => {
11536
+ mkdirSync(dirname(path), { recursive: true });
11537
+ writeFileSync(path, content, {
11538
+ encoding: "utf8",
11539
+ flag: "wx"
11540
+ });
11541
+ }
11542
+ };
11543
+ // src/commands/ideas-promote/spec-name/spec-name.ts
11544
+ /** The prefix a spec name takes when `--name` does not give the whole name. */
11545
+ const DEFAULT_SPEC_PREFIX = "tech-";
11546
+ /** The longest slug taken from a title, cut at a word. */
11547
+ const MAX_SLUG = 60;
11548
+ const KEBAB = /^[a-z0-9]+(-[a-z0-9]+)*$/;
11549
+ /** A conventional-commit prefix (`feat(ideas): `) and every emoji taken off a title, then kebab-cased and cut at a word. */
11550
+ function slugOf(title) {
11551
+ const slug = title.replace(/^\s*\w+(\([^)]*\))?!?:\s*/, "").replace(/\p{Extended_Pictographic}|‍|️/gu, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
11552
+ if (slug.length <= MAX_SLUG) return slug;
11553
+ const cut = slug.slice(0, MAX_SLUG);
11554
+ const atWord = cut.lastIndexOf("-");
11555
+ return (atWord > 0 ? cut.slice(0, atWord) : cut).replace(/-+$/, "");
11556
+ }
11557
+ /**
11558
+ * The file name (no `.spec.md`) of the spec for an issue. `name` is the whole name when given (the `.spec.md` or `.md`
11559
+ * ending is dropped, and it must be kebab-case); otherwise it is {@link DEFAULT_SPEC_PREFIX} and the title's slug.
11560
+ * `undefined` when no name can be made.
11561
+ */
11562
+ function specName(title, name) {
11563
+ if (name !== void 0) {
11564
+ const bare = name.trim().replace(/\.spec\.md$|\.md$/, "");
11565
+ return KEBAB.test(bare) ? bare : void 0;
11566
+ }
11567
+ const slug = slugOf(title);
11568
+ return slug ? `${DEFAULT_SPEC_PREFIX}${slug}` : void 0;
11569
+ }
11570
+ // src/commands/ideas-promote/run-ideas-promote/run-ideas-promote.ts
11571
+ /**
11572
+ * `holocron ideas promote` — turns a filed idea into a draft spec.
11573
+ *
11574
+ * It reads the issue through the repo's `issues` provider (`Issues.get`, which parses the key in the tracker's own
11575
+ * syntax) and writes `.notes/<name>.spec.md`: draft frontmatter with the `issue:`, the title, and a `Problem` section
11576
+ * with the issue's text, less the `Filed from idea:` line and the hidden marker `ideas sync` added. It writes no `id`
11577
+ * (`specs sync` numbers the spec once it is on the default branch). It refuses to overwrite a file, and it never edits
11578
+ * or closes the issue and never touches the vault, whose note was trashed when the idea was filed. Any issue can be
11579
+ * promoted; the row says whether it carried the idea marker. It writes, so it asks first unless `--dry-run` or
11580
+ * `--yes` (without a terminal it refuses instead).
11581
+ */
11582
+ /** How many lines of the spec a dry run shows. */
11583
+ const PREVIEW_LINES = 12;
11584
+ const row$1 = (id, status, detail) => ({
11585
+ id,
11586
+ title: id,
11587
+ status,
11588
+ detail,
11589
+ problems: []
11590
+ });
11591
+ /** `https://github.com/o/r/issues/12` as `o/r#12`; `undefined` for any other address. */
11592
+ const githubRef = (url) => {
11593
+ const match = /^https:\/\/github\.com\/([^/]+\/[^/]+)\/(?:issues|pull)\/(\d+)/.exec(url ?? "");
11594
+ return match ? `${match[1]}#${match[2]}` : void 0;
11595
+ };
11596
+ async function runIdeasPromote(input) {
11597
+ /* v8 ignore next -- the console is only used outside tests, which inject `print` */
11598
+ const print = input.print ?? ((line) => console.log(line));
11599
+ const dryRun = Boolean(input.context.dryRun);
11600
+ const io = input.io ?? realPromoteIo;
11601
+ const finish = (rows, path) => {
11602
+ printCheckRows(rows, print);
11603
+ const summary = summariseChecks(rows);
11604
+ printCheckSummary(summary, print);
11605
+ return {
11606
+ status: summary.fail > 0 ? "fail" : "ok",
11607
+ rows,
11608
+ ...path ? { path } : {}
11609
+ };
11610
+ };
11611
+ print(style.header(`Holocron ideas promote${dryRun ? " (dry-run)" : ""}`));
11612
+ print("");
11613
+ const entry = input.loaded.resolved.providers.issues;
11614
+ if (!entry) return finish([row$1(input.issue, "fail", "the config has no `issues` provider to read the issue with")]);
11615
+ const credentials = input.loaded.resolved.providers.credentials;
11616
+ /* v8 ignore start -- the real loader is only built outside tests, which always inject one */
11617
+ const loader = input.loader ?? new PluginLoader({
11618
+ ...input.loaded.resolved,
11619
+ providers: {
11620
+ issues: entry,
11621
+ ...credentials ? { credentials } : {}
11622
+ }
11623
+ }, input.context);
11624
+ /* v8 ignore stop */
11625
+ await loader.load();
11626
+ assertPluginsResolvable$1(loader, "ideas promote");
11627
+ if (!loader.has("issues")) {
11628
+ const failure = loader.loadFailures().find((f) => f.key === "issues");
11629
+ return finish([row$1(input.issue, "fail", `the \`issues\` provider is not available${failure ? ` (${describeError(failure.error)})` : ""}`)]);
11630
+ }
11631
+ let issue;
11632
+ try {
11633
+ issue = await loader.get("issues").get(input.issue);
11634
+ } catch (err) {
11635
+ return finish([row$1(input.issue, "fail", `could not read the issue: ${describeError(err)}`)]);
11636
+ }
11637
+ const name = specName(issue.summary, input.name);
11638
+ if (!name) return finish([row$1(issue.key, "fail", input.name === void 0 ? "no spec name can be made from the title; pass --name" : `"${input.name}" is not a spec name: use lower-case words joined by hyphens, such as tech-my-topic`)]);
11639
+ const relative = join(".notes", `${name}.spec.md`);
11640
+ if (io.exists(join(input.context.repoRoot, relative))) return finish([row$1(relative, "fail", "the spec already exists; it is never overwritten")], relative);
11641
+ const { org, name: repoName } = input.loaded.resolved;
11642
+ const ref = githubRef(issue.url) ?? (issue.key.startsWith("#") ? `${org}/${repoName}${issue.key}` : issue.key);
11643
+ const { content, fromIdea } = buildSpec({
11644
+ title: issue.summary,
11645
+ body: issue.body,
11646
+ issue: ref
11647
+ });
11648
+ const origin = fromIdea ? `from ${issue.key}, which carries the idea marker` : `from ${issue.key}, which has no \`Filed from idea:\` marker (its text is used as it is)`;
11649
+ if (dryRun) {
11650
+ print(` ${relative}`);
11651
+ for (const line of content.split("\n").slice(0, PREVIEW_LINES)) print(` ${style.skip(line)}`);
11652
+ print("");
11653
+ return finish([row$1(relative, "skip", `would write the spec ${origin}`)], relative);
11654
+ }
11655
+ if (!input.yes) {
11656
+ if (!(input.interactive ?? Boolean(process.stdin.isTTY))) throw new NonInteractiveError(`\`ideas promote\` writes ${relative}; pass --yes to run it without asking, or --dry-run to preview`);
11657
+ if (!await (input.confirm ?? ((message) => confirm({
11658
+ message,
11659
+ default: false
11660
+ })))(`Write ${relative} from ${issue.key}?`)) {
11661
+ print(` ${style.skip("cancelled; nothing was written")}`);
11662
+ return {
11663
+ status: "cancelled",
11664
+ rows: [],
11665
+ path: relative
11666
+ };
11667
+ }
11668
+ }
11669
+ try {
11670
+ io.write(join(input.context.repoRoot, relative), content);
11671
+ } catch (err) {
11672
+ return finish([row$1(relative, "fail", `could not write the spec: ${describeError(err)}`)], relative);
11673
+ }
11674
+ return finish([row$1(relative, "ok", `wrote the spec ${origin}`)], relative);
11675
+ }
11676
+ // src/commands/ideas-promote/ideas-promote.command.ts
11677
+ const ideasPromoteCommand = {
11678
+ command: "promote <issue>",
11679
+ describe: "Write a draft spec in .notes/ from an issue that an idea was filed as",
11680
+ builder: (y) => y.positional("issue", {
11681
+ type: "string",
11682
+ demandOption: true,
11683
+ describe: "The issue: #1234, 1234 or a Linear key"
11684
+ }).option("name", {
11685
+ type: "string",
11686
+ describe: "The whole spec name, without .spec.md (default: tech- and the title in kebab-case)"
11687
+ }).option("yes", {
11688
+ type: "boolean",
11689
+ describe: "Write without asking (required without a terminal)"
11690
+ }),
11691
+ handler: async (argv) => {
11692
+ const tokens = tokenContext$1(argv.token);
11693
+ if (!tokens) return;
11694
+ const loaded = await loadConfig(argv.cwd);
11695
+ applyResolvedConfig(argv, loaded.resolved);
11696
+ if ((await runIdeasPromote({
11697
+ issue: String(argv.issue),
11698
+ loaded,
11699
+ context: {
11700
+ repoRoot: argv.cwd,
11701
+ dryRun: argv.dryRun,
11702
+ ...tokens,
11703
+ org: resolveOrg(argv, loaded.resolved)
11704
+ },
11705
+ ...argv.name ? { name: argv.name } : {},
11706
+ ...argv.yes ? { yes: true } : {}
11707
+ })).status === "fail") process.exitCode = 1;
11708
+ }
11709
+ };
11477
11710
  // src/commands/ideas-sync/resolve-ideas-provider/resolve-ideas-provider.ts
11478
11711
  /**
11479
11712
  * The `ideas` provider `ideas sync` reads through: `providers.ideas` when the config names one. A config written
@@ -11506,7 +11739,9 @@ function resolveIdeasProvider(resolved, env) {
11506
11739
  * the step run once. An idea with attachments is reported and skipped, since an issue body cannot carry them. Only
11507
11740
  * ideas to be filed, and ideas that need the person's attention, get a row; the rest are counted. The issue body ends
11508
11741
  * with a hidden `<!-- holocron:idea <key> -->` line, and an issue that carries it is reused instead of making a second
11509
- * one (found with `Issues.search`, the recent issues only). It never deletes anything, and an idea it cannot file is a
11742
+ * one (found with one `Issues.search({ text })` per note about to be filed, confirmed by the exact marker in the body;
11743
+ * GitHub searches its 2000 most recently updated issues, so an older one is still missed, and each search uses rate
11744
+ * limit). It never deletes anything, and an idea it cannot file is a
11510
11745
  * failing row (the run goes on). It writes, so it asks first unless `--dry-run` or `--yes` (without a terminal it refuses instead).
11511
11746
  */
11512
11747
  /** The state that files a note when the config names none. */
@@ -11525,8 +11760,12 @@ const row = (id, status, detail) => ({
11525
11760
  const marker = (key) => `<!-- holocron:idea ${key} -->`;
11526
11761
  /** The issue's body: the idea's text, the line that traces the issue to its idea, and the hidden marker. */
11527
11762
  const issueBody = (idea) => `${idea.body.trim()}\n\nFiled from idea: ${idea.title}\n${marker(idea.key)}`;
11528
- /** How many recent issues are searched for the marker (the narrowest existing method, `Issues.search`). */
11529
- const SEARCH_LIMIT = 100;
11763
+ /**
11764
+ * How many text matches are read back per note; the exact marker is then checked in each body. The search itself is
11765
+ * bounded by the provider: GitHub pages up to 2000 recent issues (20 pages of 100) and filters them client-side, so an
11766
+ * issue older than that is still missed, and each search spends rate limit. Linear filters on the server.
11767
+ */
11768
+ const SEARCH_LIMIT = 20;
11530
11769
  async function runIdeasSync(input) {
11531
11770
  /* v8 ignore next -- the console is only used outside tests, which inject `print` */
11532
11771
  const print = input.print ?? ((line) => console.log(line));
@@ -11595,26 +11834,23 @@ async function runIdeasSync(input) {
11595
11834
  await loader.load();
11596
11835
  assertPluginsResolvable$1(loader, "ideas sync");
11597
11836
  const issues = loader.has("issues") ? loader.get("issues") : void 0;
11598
- let recent = [];
11599
- let searchError;
11600
- if (issues) try {
11601
- recent = await issues.search({ limit: SEARCH_LIMIT });
11602
- } catch (err) {
11603
- searchError = err;
11604
- }
11605
- const searchFailed = searchError !== void 0;
11606
11837
  for (const idea of ready) {
11607
11838
  const path = idea.key;
11608
11839
  if (!issues) {
11609
11840
  rows.push(row(path, "fail", "the config has no `issues` provider to file it with"));
11610
11841
  continue;
11611
11842
  }
11612
- if (searchFailed) {
11613
- rows.push(row(path, "fail", `could not check for an existing issue, so none was created: ${describeError(searchError)}`));
11843
+ let existing;
11844
+ try {
11845
+ existing = (await issues.search({
11846
+ text: marker(path),
11847
+ limit: SEARCH_LIMIT
11848
+ })).find((issue) => issue.body?.includes(marker(path)));
11849
+ } catch (err) {
11850
+ rows.push(row(path, "fail", `could not check for an existing issue, so none was created: ${describeError(err)}`));
11614
11851
  continue;
11615
11852
  }
11616
11853
  let key;
11617
- const existing = recent.find((issue) => issue.body?.includes(marker(path)));
11618
11854
  if (existing) key = existing.key;
11619
11855
  else try {
11620
11856
  ({key} = await issues.create({
@@ -11666,7 +11902,7 @@ const ideasSyncCommand = {
11666
11902
  const ideasCommand = {
11667
11903
  command: "ideas",
11668
11904
  describe: "Work with the idea notes that sit in front of the issue tracker",
11669
- builder: (y) => y.command(ideasSyncCommand).command(groupMenu$1("ideas")),
11905
+ builder: (y) => y.command(ideasSyncCommand).command(ideasPromoteCommand).command(groupMenu$1("ideas")),
11670
11906
  handler: () => {}
11671
11907
  };
11672
11908
  // src/commands/menu/menu.command.ts