@prisma/cli 8.0.0-rc.15-dev.107 → 8.0.0-rc.15-dev.109

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.js +32 -4
  2. package/package.json +7 -7
package/dist/cli.js CHANGED
@@ -1238,6 +1238,7 @@ async function tryCompletePastedCallback(url, options) {
1238
1238
  await options.complete(url);
1239
1239
  return true;
1240
1240
  } catch (error) {
1241
+ if (error instanceof CliStructuredError) throw error;
1241
1242
  const message = error instanceof Error ? error.message : String(error);
1242
1243
  options.output.write(`Sign-in didn't complete (${message}). Paste the callback URL to try again.\n`);
1243
1244
  return false;
@@ -1296,6 +1297,11 @@ var LoginState = class {
1296
1297
  if (url.pathname !== "/auth/callback") throw new AuthError$1("Not a callback URL");
1297
1298
  const params = url.searchParams;
1298
1299
  const error = params.get("error");
1300
+ if (error === "access_denied") throw new CliStructuredError("AUTH.LOGIN_DENIED", "Sign-in was not authorized.", { nextActions: [{
1301
+ kind: "run-command",
1302
+ label: "Sign in again if you want to grant access",
1303
+ command: `${CLI_NAME} auth login`
1304
+ }] });
1299
1305
  if (error) {
1300
1306
  const desc = params.get("error_description");
1301
1307
  throw new AuthError$1(desc ? `${error}: ${desc}` : error);
@@ -14552,7 +14558,13 @@ async function maybeWriteSkillsStaleNotice(runtime) {
14552
14558
  if (config !== null && !config.check) return;
14553
14559
  const agents = config?.agents ?? DEFAULT_AGENTS;
14554
14560
  if (agents.length === 0) return;
14555
- const notice = renderStaleNotice(status, agentSkillDirs(agents));
14561
+ const dirs = agentSkillDirs(agents);
14562
+ if (isFormat(flagTokens(runtime.argv), "markdown")) {
14563
+ const notice = renderStaleNoticeMarkdown(status, dirs);
14564
+ if (notice !== null) runtime.stdout.write(notice);
14565
+ return;
14566
+ }
14567
+ const notice = renderStaleNotice(status, dirs);
14556
14568
  if (notice !== null) runtime.stderr.write(notice);
14557
14569
  } catch {
14558
14570
  return;
@@ -14563,11 +14575,23 @@ async function maybeWriteSkillsStaleNotice(runtime) {
14563
14575
  function firstOutdatedSkillIn(status, dirs) {
14564
14576
  return status.skills.find((skill) => skill.targets.some((target) => dirs.includes(target.dir) && (target.state === "stale" || target.state === "absent"))) ?? null;
14565
14577
  }
14566
- function renderStaleNotice(status, dirs) {
14578
+ /** The mismatch in words, without the stream's framing around it. */
14579
+ function staleNoticeSentence(status, dirs) {
14567
14580
  const outdated = firstOutdatedSkillIn(status, dirs);
14568
14581
  if (outdated === null) return null;
14569
14582
  const synced = outdated.targets.find((target) => dirs.includes(target.dir) && target.state === "stale")?.syncedVersion;
14570
- return `Prisma agent skills are out of date (installed ${outdated.library} ${outdated.version}, synced ${synced ?? "none"}). Run: ${getCliName()} skills sync\n`;
14583
+ return `Prisma agent skills are out of date (installed ${outdated.library} ${outdated.version}, synced ${synced ?? "none"})`;
14584
+ }
14585
+ function renderStaleNotice(status, dirs) {
14586
+ const sentence = staleNoticeSentence(status, dirs);
14587
+ return sentence === null ? null : `${sentence}. Run: ${getCliName()} skills sync\n`;
14588
+ }
14589
+ /** The same notice as a trailing section of the Markdown document, in
14590
+ * the heading-then-bullet shape the engine renders `### Diagnostics`
14591
+ * in. The leading blank line separates it from the command's output. */
14592
+ function renderStaleNoticeMarkdown(status, dirs) {
14593
+ const sentence = staleNoticeSentence(status, dirs);
14594
+ return sentence === null ? null : `\n### Notice\n${sentence}.\n- Sync agent skills: \`${getCliName()} skills sync\`\n`;
14571
14595
  }
14572
14596
  /** The shared flags that take a separate value, so the word after them
14573
14597
  * is that value rather than the command being invoked. */
@@ -14602,7 +14626,10 @@ function isSuppressedByInvocation(runtime) {
14602
14626
  if (group === "skills" || group === "init") return true;
14603
14627
  if (argv.includes("--json") || argv.includes("--quiet") || argv.includes("-q")) return true;
14604
14628
  if (argv.includes("--version")) return true;
14605
- return argv.some((token, index) => token === "--format=json" || token === "--format" && argv[index + 1] === "json");
14629
+ return isFormat(argv, "json");
14630
+ }
14631
+ function isFormat(tokens, format) {
14632
+ return tokens.some((token, index) => token === `--format=${format}` || token === "--format" && tokens[index + 1] === format);
14606
14633
  }
14607
14634
  /** The file an explicit --config names, so the check reads the same
14608
14635
  * config the command did. Discovery is otherwise cwd-only. */
@@ -14835,6 +14862,7 @@ async function main(proc, buildCliForRun = buildCli) {
14835
14862
  env: proc.env,
14836
14863
  argv: proc.argv.slice(2),
14837
14864
  cwd: proc.cwd(),
14865
+ stdout: proc.stdout,
14838
14866
  stderr: proc.stderr
14839
14867
  });
14840
14868
  return exitCode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/cli",
3
- "version": "8.0.0-rc.15-dev.107",
3
+ "version": "8.0.0-rc.15-dev.109",
4
4
  "description": "Command-line interface for the Prisma Developer Platform.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -41,10 +41,10 @@
41
41
  "dependencies": {
42
42
  "@manypkg/tools": "^2.1.2",
43
43
  "@prisma/cli-engine": "0.4.0",
44
- "@prisma/composer-cli": "0.20.0-dev.5",
44
+ "@prisma/composer-cli": "0.20.0-dev.6",
45
45
  "@prisma/compute-sdk": "0.42.0",
46
46
  "@prisma/management-api-sdk": "1.69.0",
47
- "@prisma/orm-toolchain": "8.0.0-rc.11-dev.13",
47
+ "@prisma/orm-toolchain": "8.0.0-rc.11-dev.22",
48
48
  "@vercel/detect-agent": "^1.2.3",
49
49
  "better-result": "^2.9.2",
50
50
  "cross-spawn": "^7.0.6",
@@ -53,11 +53,11 @@
53
53
  "open": "^11.0.0"
54
54
  },
55
55
  "devDependencies": {
56
- "@prisma/composer": "0.20.0-dev.5",
56
+ "@prisma/composer": "0.20.0-dev.6",
57
57
  "@prisma/credentials-store": "^7.8.0",
58
- "@repo/cli-conformance": "8.0.0-rc.15-dev.107",
59
- "@repo/cli-telemetry": "8.0.0-rc.15-dev.107",
60
- "@repo/tsconfig": "8.0.0-rc.15-dev.107",
58
+ "@repo/cli-conformance": "8.0.0-rc.15-dev.109",
59
+ "@repo/cli-telemetry": "8.0.0-rc.15-dev.109",
60
+ "@repo/tsconfig": "8.0.0-rc.15-dev.109",
61
61
  "@types/node": "^22.19.19",
62
62
  "@types/cross-spawn": "^6.0.6",
63
63
  "tsdown": "^0.21.10",