@theholocron/cli 2.0.0-alpha.60 → 2.0.0-alpha.61

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.
Files changed (2) hide show
  1. package/dist/cli.mjs +34 -1
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -4304,6 +4304,23 @@ async function runSetup(input) {
4304
4304
  });
4305
4305
  print("");
4306
4306
  print(` ${summary.ok} ok, ${summary.fail} fail, ${summary.skip} skipped${dryRun ? `, ${summary.dryRun} would-do` : ""}`);
4307
+ if (steps.some((s) => s.reason === "permissions")) {
4308
+ print("");
4309
+ print(" ⚠ Some steps failed with 403 (insufficient token permissions).");
4310
+ print(" These operations require a temporary fine-grained PAT with the");
4311
+ print(" following repository permissions:");
4312
+ print("");
4313
+ print(" · Administration — read and write");
4314
+ print(" · Code scanning alerts — read and write");
4315
+ print(" · Contents — read and write");
4316
+ print(" · Secret scanning alerts — read and write");
4317
+ print(" · Workflows — read and write");
4318
+ print(" · Metadata — read (added automatically)");
4319
+ print("");
4320
+ print(" Create one at: https://github.com/settings/personal-access-tokens/new");
4321
+ print(" Then re-run: holocron setup --token <your-temp-pat>");
4322
+ print(" You can revoke it immediately after setup completes.");
4323
+ }
4307
4324
  return {
4308
4325
  steps,
4309
4326
  summary
@@ -4325,6 +4342,16 @@ async function runStep(capability, step, dryRun, body) {
4325
4342
  if (typeof note === "string") result.message = note;
4326
4343
  return result;
4327
4344
  } catch (err) {
4345
+ if (err instanceof ProviderApiError$1 && err.status === 403) {
4346
+ const reason = classify403(err);
4347
+ return {
4348
+ capability,
4349
+ step,
4350
+ status: "fail",
4351
+ message: err.message,
4352
+ reason
4353
+ };
4354
+ }
4328
4355
  return {
4329
4356
  capability,
4330
4357
  step,
@@ -4333,10 +4360,16 @@ async function runStep(capability, step, dryRun, body) {
4333
4360
  };
4334
4361
  }
4335
4362
  }
4363
+ function classify403(err) {
4364
+ const msg = `${err.message} ${String(err.details)}`.toLowerCase();
4365
+ if (msg.includes("advanced security") || msg.includes("not enabled for this repository") || msg.includes("upgrade") || msg.includes("not available on")) return "plan";
4366
+ return "permissions";
4367
+ }
4336
4368
  function formatStep(step) {
4337
4369
  const icon = step.status === "ok" ? "✓" : step.status === "fail" ? "✗" : step.status === "dry-run" ? "…" : "·";
4370
+ const tag = step.reason === "permissions" ? " [permissions]" : step.reason === "plan" ? " [plan restriction]" : "";
4338
4371
  const detail = step.message ? ` (${step.message})` : "";
4339
- return ` ${icon} ${step.step}${detail}`;
4372
+ return ` ${icon} ${step.step}${tag}${detail}`;
4340
4373
  }
4341
4374
  //#endregion
4342
4375
  //#region src/commands/sync.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/cli",
3
- "version": "2.0.0-alpha.60",
3
+ "version": "2.0.0-alpha.61",
4
4
  "description": "The Holocron CLI — a pluggable, capability-based orchestrator for spinning up and operating software projects.",
5
5
  "homepage": "https://github.com/theholocron/holocron/tree/main/packages/cli#readme",
6
6
  "bugs": "https://github.com/theholocron/holocron/issues",