@scalar/cli 2.12.3 → 2.13.1

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 (89) hide show
  1. package/README.md +221 -2
  2. package/chunks/{action-JXCU2JKC.js → action-27BJMHFD.js} +38 -6
  3. package/chunks/{action-5BJL72JE.js → action-2BZ3AFBR.js} +10 -7
  4. package/chunks/{action-RPTLQBMK.js → action-3DBOUHKS.js} +8 -6
  5. package/chunks/{action-6I2PWENU.js → action-3R3MVTP3.js} +67 -88
  6. package/chunks/{action-T4MM4OUS.js → action-5HWPNWVU.js} +52 -29
  7. package/chunks/{action-EWZLVN45.js → action-5JTBIUPZ.js} +47 -27
  8. package/chunks/{action-4ESHWOAM.js → action-5QDBZTBF.js} +9 -8
  9. package/chunks/{action-D7L757PX.js → action-7HHTD65O.js} +13 -12
  10. package/chunks/{action-Y7EBKCUU.js → action-ASBFLTOA.js} +1 -1
  11. package/chunks/{action-H4GW3KAI.js → action-CXQ3HLVC.js} +15 -15
  12. package/chunks/{action-EPGS3U3T.js → action-EGF7LXVA.js} +63 -48
  13. package/chunks/{action-7CUPRYNA.js → action-F5LSDVJA.js} +36 -23
  14. package/chunks/{action-6A4NM5WS.js → action-FR6UPGZP.js} +9 -8
  15. package/chunks/{action-KIOYSVKX.js → action-FZZ2VLNA.js} +23 -6
  16. package/chunks/{action-ZOYQBWGD.js → action-GIKW67JB.js} +13 -13
  17. package/chunks/{action-ED4TSPRZ.js → action-GLC54N3F.js} +11 -11
  18. package/chunks/{action-FBOTIFVC.js → action-GRAMP3QD.js} +12 -10
  19. package/chunks/{action-BYYKW4S6.js → action-IUG6MPST.js} +25 -10
  20. package/chunks/{action-ZBEOLJJR.js → action-JCBTINNL.js} +9 -6
  21. package/chunks/{action-VVKMUOKR.js → action-JEI24ZNE.js} +13 -5
  22. package/chunks/{action-EWDQOX5B.js → action-JFNK5UCV.js} +6 -4
  23. package/chunks/action-JRPGHJGA.js +48 -0
  24. package/chunks/{action-Q3DI54OW.js → action-KRXJWRCE.js} +15 -15
  25. package/chunks/{action-B74PPGKB.js → action-PBJFNJMY.js} +34 -16
  26. package/chunks/{action-O7ROX6NF.js → action-PDOW5JS2.js} +12 -11
  27. package/chunks/{action-GMJJMZXY.js → action-RYLO75IN.js} +11 -11
  28. package/chunks/{action-HAKFAXTQ.js → action-VEXFHEQR.js} +6 -6
  29. package/chunks/{action-YXRCGKCK.js → action-W3AGGZ42.js} +6 -4
  30. package/chunks/action-W5VD63XO.js +55 -0
  31. package/chunks/{action-M5OUEDV2.js → action-WEDLKGDY.js} +4 -4
  32. package/chunks/{action-FBQAU5LV.js → action-WI6UW2AL.js} +12 -12
  33. package/chunks/{action-AYKKHH7A.js → action-WQPMJZXL.js} +51 -24
  34. package/chunks/{action-GJHOZ6Q5.js → action-WY4GOD2Y.js} +10 -8
  35. package/chunks/{action-I2IV4VLL.js → action-XXIRB2F6.js} +32 -16
  36. package/chunks/{actions-EXQNVV4T.js → actions-I4HS6ASR.js} +20 -18
  37. package/chunks/{agent-XAHNA4MB.js → agent-E6PYTXAU.js} +3 -3
  38. package/chunks/{asyncapi-FNOWXSKB.js → asyncapi-VQ7CCUCY.js} +9 -7
  39. package/chunks/{build.action-TIKRZPQ5.js → build.action-LIAREWUF.js} +36 -19
  40. package/chunks/chunk-2XWUFFEZ.js +133 -0
  41. package/chunks/{chunk-2GKXAGSH.js → chunk-6VAEDMCP.js} +7 -7
  42. package/chunks/{chunk-EUFK4MVX.js → chunk-6YDIOXF7.js} +2 -2
  43. package/chunks/{chunk-EBNFCIKS.js → chunk-APX65SRT.js} +2 -1
  44. package/chunks/{chunk-WKW5W2ZP.js → chunk-DWN6JOF2.js} +1 -1
  45. package/chunks/{chunk-EXJUFF6G.js → chunk-FXELV3AW.js} +8 -3
  46. package/chunks/{chunk-IOW726L2.js → chunk-GARUDDWI.js} +1 -1
  47. package/chunks/{chunk-JWNWOK2M.js → chunk-HZ4UKLOE.js} +12 -5
  48. package/chunks/{chunk-2AK5O3NQ.js → chunk-IDWF5L45.js} +28 -28
  49. package/chunks/chunk-IRQJDPZE.js +34 -0
  50. package/chunks/{chunk-TYNF7ROW.js → chunk-JHJDLZSM.js} +1 -1
  51. package/chunks/{chunk-TI4NDKQC.js → chunk-KTI65ZVY.js} +5 -5
  52. package/chunks/chunk-LK2ZIDHH.js +32 -0
  53. package/chunks/{chunk-I7ZVWF57.js → chunk-LUR7BA3W.js} +15 -9
  54. package/chunks/{chunk-AOZQPCWI.js → chunk-M4QTWCJ7.js} +2 -0
  55. package/chunks/{chunk-7S34K2P3.js → chunk-NOD4CBF7.js} +1 -1
  56. package/chunks/{chunk-KPLWZIOV.js → chunk-P4EPNS46.js} +3 -3
  57. package/chunks/{chunk-CUHVXHIV.js → chunk-PWFA23M2.js} +1 -1
  58. package/chunks/{chunk-KWIY2QZY.js → chunk-QRYMQPFT.js} +2 -2
  59. package/chunks/{chunk-FI7UKPRF.js → chunk-QS2T7JAK.js} +1 -1
  60. package/chunks/{chunk-OZQPMMTA.js → chunk-QUUBUPAW.js} +5 -5
  61. package/chunks/{chunk-FYMDIB7J.js → chunk-R3NDJICA.js} +1 -1
  62. package/chunks/{chunk-V7RTDFHK.js → chunk-RAJM56L7.js} +5 -1
  63. package/chunks/{chunk-Y2OQOAY7.js → chunk-RQNLEGMQ.js} +1 -1
  64. package/chunks/chunk-RZDLPTXV.js +167 -0
  65. package/chunks/chunk-SIPBGEVT.js +16 -0
  66. package/chunks/chunk-SNQFFEYH.js +11 -0
  67. package/chunks/{chunk-62OOT7FY.js → chunk-SNSJW2JT.js} +2 -2
  68. package/chunks/{chunk-LEECPQZN.js → chunk-UNV7BZD3.js} +2 -2
  69. package/chunks/{chunk-IRA5BW2J.js → chunk-X62ZTOQF.js} +31 -4
  70. package/chunks/{chunk-UN2AAVO5.js → chunk-XFBCZL7J.js} +2 -2
  71. package/chunks/chunk-XUX6JXU5.js +58 -0
  72. package/chunks/{create.action-K7GTWYST.js → create.action-PZMCTYGS.js} +31 -22
  73. package/chunks/{delete.action-JKLXBYRD.js → delete.action-J57JIFG3.js} +35 -21
  74. package/chunks/{delete.action-E4XRGKQW.js → delete.action-VDSTPSWG.js} +37 -21
  75. package/chunks/{get.action-IY7WSJMX.js → get.action-KUP32QJT.js} +13 -13
  76. package/chunks/{get.action-2AKMD4W3.js → get.action-ZOSML6XG.js} +12 -10
  77. package/chunks/{list.action-NRL2DDL5.js → list.action-Q5MPDR42.js} +15 -15
  78. package/chunks/{list.action-44YVCWKN.js → list.action-VYENIC5L.js} +13 -13
  79. package/chunks/{publish.action-E76MHLCN.js → publish.action-MBAZHQ2J.js} +48 -28
  80. package/chunks/{update.action-LZCAHAWW.js → update.action-BWMCXWQ5.js} +35 -21
  81. package/chunks/{update.action-FTTVWVAB.js → update.action-IEXVMUKG.js} +46 -26
  82. package/index.js +212 -127
  83. package/package.json +1 -1
  84. package/skills/scalar-cli/SKILL.md +4 -2
  85. package/template.md +220 -1
  86. package/chunks/action-BDDXF4YV.js +0 -38
  87. package/chunks/chunk-BOPEAS7H.js +0 -38
  88. package/chunks/chunk-EGOXR5FB.js +0 -15
  89. package/chunks/{action-UHXBY3RD.js → action-3P66ZSL3.js} +1 -1
@@ -77,13 +77,13 @@ import {
77
77
  usageRecordSchema,
78
78
  usageRoutes,
79
79
  versionLabelParamSchema
80
- } from "./chunk-IRA5BW2J.js";
81
- import "./chunk-EXJUFF6G.js";
80
+ } from "./chunk-X62ZTOQF.js";
81
+ import "./chunk-FXELV3AW.js";
82
82
  import "./chunk-F3TQHNSQ.js";
83
83
  import "./chunk-VRZSDUZK.js";
84
84
  import {
85
85
  createdMcpServerSchema
86
- } from "./chunk-AOZQPCWI.js";
86
+ } from "./chunk-M4QTWCJ7.js";
87
87
  import "./chunk-Q26DFKTY.js";
88
88
  import "./chunk-I57ID5K7.js";
89
89
  import "./chunk-3MZYUBJ6.js";
@@ -4,25 +4,27 @@ import {
4
4
  } from "./chunk-2I6V7AI3.js";
5
5
  import {
6
6
  isDocument
7
- } from "./chunk-I7ZVWF57.js";
7
+ } from "./chunk-LUR7BA3W.js";
8
8
  import {
9
9
  isAsyncApiDocument
10
- } from "./chunk-WKW5W2ZP.js";
10
+ } from "./chunk-DWN6JOF2.js";
11
+ import "./chunk-2XWUFFEZ.js";
11
12
  import {
12
13
  watchFile
13
14
  } from "./chunk-RE5Z56QD.js";
14
15
  import "./chunk-VUXPDHTQ.js";
15
- import "./chunk-FI7UKPRF.js";
16
- import "./chunk-FYMDIB7J.js";
17
- import "./chunk-IOW726L2.js";
16
+ import "./chunk-QS2T7JAK.js";
17
+ import "./chunk-R3NDJICA.js";
18
+ import "./chunk-GARUDDWI.js";
18
19
  import "./chunk-F3TQHNSQ.js";
19
20
  import "./chunk-VRZSDUZK.js";
20
21
  import "./chunk-4ORL4MST.js";
21
- import "./chunk-TYNF7ROW.js";
22
+ import "./chunk-JHJDLZSM.js";
22
23
  import {
23
24
  output
24
25
  } from "./chunk-T5HJUAWB.js";
25
- import "./chunk-AOZQPCWI.js";
26
+ import "./chunk-5ENKYZA4.js";
27
+ import "./chunk-M4QTWCJ7.js";
26
28
  import "./chunk-Q26DFKTY.js";
27
29
  import "./chunk-I57ID5K7.js";
28
30
  import "./chunk-3MZYUBJ6.js";
@@ -1,39 +1,47 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
+ import {
3
+ writeJson
4
+ } from "./chunk-SNQFFEYH.js";
2
5
  import {
3
6
  BaseCollections
4
- } from "./chunk-TI4NDKQC.js";
7
+ } from "./chunk-KTI65ZVY.js";
5
8
  import {
6
9
  getDatabaseClient
7
- } from "./chunk-JWNWOK2M.js";
10
+ } from "./chunk-HZ4UKLOE.js";
8
11
  import {
9
12
  apiService
10
- } from "./chunk-2GKXAGSH.js";
11
- import "./chunk-2AK5O3NQ.js";
12
- import "./chunk-KPLWZIOV.js";
13
+ } from "./chunk-6VAEDMCP.js";
14
+ import "./chunk-IDWF5L45.js";
15
+ import "./chunk-P4EPNS46.js";
13
16
  import "./chunk-YTTDYTVB.js";
14
17
  import {
15
18
  sdkSchema
16
- } from "./chunk-Y2OQOAY7.js";
17
- import "./chunk-5ENKYZA4.js";
18
- import "./chunk-IRA5BW2J.js";
19
- import "./chunk-EXJUFF6G.js";
19
+ } from "./chunk-RQNLEGMQ.js";
20
+ import "./chunk-X62ZTOQF.js";
21
+ import "./chunk-FXELV3AW.js";
20
22
  import "./chunk-RE5Z56QD.js";
21
23
  import "./chunk-VUXPDHTQ.js";
22
24
  import {
23
25
  getAuthData
24
- } from "./chunk-FI7UKPRF.js";
25
- import "./chunk-FYMDIB7J.js";
26
- import "./chunk-IOW726L2.js";
26
+ } from "./chunk-QS2T7JAK.js";
27
+ import "./chunk-R3NDJICA.js";
28
+ import "./chunk-GARUDDWI.js";
27
29
  import {
28
30
  teamSchema
29
31
  } from "./chunk-F3TQHNSQ.js";
30
32
  import "./chunk-VRZSDUZK.js";
33
+ import {
34
+ canPrompt,
35
+ select
36
+ } from "./chunk-XUX6JXU5.js";
37
+ import "./chunk-IRQJDPZE.js";
31
38
  import "./chunk-4ORL4MST.js";
32
- import "./chunk-TYNF7ROW.js";
39
+ import "./chunk-JHJDLZSM.js";
33
40
  import {
34
41
  output
35
42
  } from "./chunk-T5HJUAWB.js";
36
- import "./chunk-AOZQPCWI.js";
43
+ import "./chunk-5ENKYZA4.js";
44
+ import "./chunk-M4QTWCJ7.js";
37
45
  import "./chunk-Q26DFKTY.js";
38
46
  import {
39
47
  external_exports,
@@ -43,7 +51,6 @@ import {
43
51
  import "./chunk-3MZYUBJ6.js";
44
52
 
45
53
  // src/domains/sdk/build.action.ts
46
- import { select } from "@clack/prompts";
47
54
  async function buildAction(opts) {
48
55
  const { error, data } = external_exports.object({
49
56
  slug: slugSchema.optional(),
@@ -86,9 +93,9 @@ async function buildAction(opts) {
86
93
  return output.error().title("SDK not found").message(
87
94
  `No SDK "${data.slug}" in namespace "${namespace}". Available: ${availableSlugs}`
88
95
  ).exit("error");
89
- } else if (!process.stdin.isTTY || !process.stdout.isTTY) {
96
+ } else if (opts.json || !canPrompt() || !process.stdout.isTTY) {
90
97
  return output.error().title("Missing SDK slug").message(
91
- `Pass --slug when running without a terminal. Available in "${namespace}": ${availableSlugs}`
98
+ `Pass --slug when running without interactive input. Available in "${namespace}": ${availableSlugs}`
92
99
  ).exit("error");
93
100
  }
94
101
  const slug = data.slug || await select({
@@ -102,12 +109,22 @@ async function buildAction(opts) {
102
109
  if (!matchingSdk) {
103
110
  return output.error().title("SDK not found").message("Provide a valid SDK slug.").exit("error");
104
111
  }
105
- const logger = output.info().loader("Starting SDK build\u2026");
112
+ const logger = opts.json ? void 0 : output.info().loader("Starting SDK build\u2026");
106
113
  const response = await client.sdks.build(matchingSdk.uid);
107
114
  if (response.error) {
108
115
  return output.error().title("Could not start the SDK build").message(response.message).exit("error");
109
116
  }
110
- logger.update("loader", 0, {
117
+ if (opts.json) {
118
+ writeJson({
119
+ uid: matchingSdk.uid,
120
+ namespace,
121
+ slug,
122
+ version: response.data?.version ?? null,
123
+ status: "started"
124
+ });
125
+ return;
126
+ }
127
+ logger?.update("loader", 0, {
111
128
  content: `SDK build started for ${matchingSdk.slug}`
112
129
  }).exit("success");
113
130
  }
@@ -0,0 +1,133 @@
1
+ import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
+ import {
3
+ err,
4
+ ok
5
+ } from "./chunk-5ENKYZA4.js";
6
+
7
+ // src/helpers/input-error.ts
8
+ var causes = {
9
+ ERR_INVALID_URL: {
10
+ reason: "Invalid URL (ERR_INVALID_URL).",
11
+ recovery: "Provide a valid HTTP or HTTPS URL."
12
+ },
13
+ ENOENT: {
14
+ reason: "File not found (ENOENT).",
15
+ recovery: "Check that the file path exists."
16
+ },
17
+ EACCES: {
18
+ reason: "Permission denied (EACCES).",
19
+ recovery: "Check that you have permission to read the file."
20
+ },
21
+ EPERM: {
22
+ reason: "Operation not permitted (EPERM).",
23
+ recovery: "Check that you have permission to read the file."
24
+ },
25
+ EISDIR: {
26
+ reason: "The path is a directory (EISDIR).",
27
+ recovery: "Provide a file path instead of a directory."
28
+ },
29
+ ENOTDIR: {
30
+ reason: "A path component is not a directory (ENOTDIR).",
31
+ recovery: "Check the file path and its parent directories."
32
+ },
33
+ ENOTFOUND: {
34
+ reason: "Host not found (ENOTFOUND).",
35
+ recovery: "Check the URL hostname and your network connection."
36
+ },
37
+ EAI_AGAIN: {
38
+ reason: "DNS lookup failed (EAI_AGAIN).",
39
+ recovery: "Check your network and DNS settings before trying again."
40
+ },
41
+ ECONNREFUSED: {
42
+ reason: "Connection refused (ECONNREFUSED).",
43
+ recovery: "Check the host, port, and whether the server is running."
44
+ },
45
+ ECONNRESET: {
46
+ reason: "Connection reset (ECONNRESET).",
47
+ recovery: "Check your network connection and server availability before trying again."
48
+ },
49
+ ETIMEDOUT: {
50
+ reason: "Connection timed out (ETIMEDOUT).",
51
+ recovery: "Check your network connection and server availability before trying again."
52
+ },
53
+ UND_ERR_CONNECT_TIMEOUT: {
54
+ reason: "Connection timed out (UND_ERR_CONNECT_TIMEOUT).",
55
+ recovery: "Check your network connection and server availability before trying again."
56
+ },
57
+ UND_ERR_SOCKET: {
58
+ reason: "Connection interrupted (UND_ERR_SOCKET).",
59
+ recovery: "Check your network connection and server availability before trying again."
60
+ },
61
+ CERT_HAS_EXPIRED: {
62
+ reason: "The server certificate has expired (CERT_HAS_EXPIRED).",
63
+ recovery: "Ask the server owner to renew its TLS certificate."
64
+ },
65
+ DEPTH_ZERO_SELF_SIGNED_CERT: {
66
+ reason: "The server certificate is not trusted (DEPTH_ZERO_SELF_SIGNED_CERT).",
67
+ recovery: "Check the server certificate and your trusted certificate configuration."
68
+ }
69
+ };
70
+ function quoteInput(input) {
71
+ return JSON.stringify(input).replace(
72
+ /[\p{Cc}\p{Cf}]/gu,
73
+ (character) => character.split("").map((unit) => `\\u${unit.charCodeAt(0).toString(16).padStart(4, "0")}`).join("")
74
+ );
75
+ }
76
+ function safeInput(input, kind) {
77
+ if (kind === "file" && !/^\s*[a-z][a-z\d+.-]*:\/\//i.test(input))
78
+ return quoteInput(input);
79
+ try {
80
+ const url = new URL(input);
81
+ url.username = "";
82
+ url.password = "";
83
+ url.search = "";
84
+ url.hash = "";
85
+ return quoteInput(url.toString());
86
+ } catch {
87
+ return "[invalid URL]";
88
+ }
89
+ }
90
+ function inputFailure(error, kind) {
91
+ for (let depth = 0, current = error; depth < 5; depth++) {
92
+ if (typeof current !== "object" || current === null) break;
93
+ if ("code" in current && typeof current.code === "string" && Object.hasOwn(causes, current.code)) {
94
+ const cause = causes[current.code];
95
+ return `${cause.reason} ${cause.recovery}`;
96
+ }
97
+ current = "cause" in current ? current.cause : void 0;
98
+ }
99
+ return kind === "file" ? "The file could not be read. Check the path and read permissions." : "The download failed. Check the URL, network connection, and server availability before trying again.";
100
+ }
101
+ function httpFailure(status, registry) {
102
+ const recovery = status === 401 ? registry ? "Run scalar auth login and check your access to this resource." : "Check the credentials required by this URL." : status === 403 ? "Check that you have access to this resource." : status === 404 ? registry ? "Check the namespace, slug, and version." : "Check that the URL points to an existing API description." : "Check the URL and server availability before trying again.";
103
+ return `HTTP ${status}. ${recovery}`;
104
+ }
105
+
106
+ // src/helpers/read-url.ts
107
+ var DOWNLOAD_TIMEOUT_MS = 1e4;
108
+ async function readUrl(input, registryAuth) {
109
+ const signal = AbortSignal.timeout(DOWNLOAD_TIMEOUT_MS);
110
+ const context = safeInput(input, "url");
111
+ const failure = (error) => signal.aborted ? "The download timed out after 10 seconds. Check your network connection and server availability before trying again." : inputFailure(error, "url");
112
+ const response = await fetch(input, {
113
+ signal,
114
+ ...registryAuth ? {
115
+ headers: { "x-scalar-auth": registryAuth.accessToken },
116
+ redirect: "error"
117
+ } : {}
118
+ }).then(ok).catch((error) => err(`${context}: ${failure(error)}`));
119
+ if (!response.ok) return response;
120
+ const body = await response.data.text().then(ok).catch((error) => err(failure(error)));
121
+ if (!response.data.ok) {
122
+ return err(
123
+ `${context}: ${httpFailure(response.data.status, registryAuth !== void 0)}${body.ok ? "" : ` ${body.error}`}`
124
+ );
125
+ }
126
+ return body.ok ? body : err(`${context}: ${body.error}`);
127
+ }
128
+
129
+ export {
130
+ safeInput,
131
+ inputFailure,
132
+ readUrl
133
+ };
@@ -14,16 +14,16 @@ import {
14
14
  webhookSubscriptionSchema,
15
15
  workspaceSchema,
16
16
  workspaceVersionSchema
17
- } from "./chunk-KPLWZIOV.js";
17
+ } from "./chunk-P4EPNS46.js";
18
18
  import {
19
19
  userSchema
20
20
  } from "./chunk-YTTDYTVB.js";
21
21
  import {
22
22
  sdkSchema
23
- } from "./chunk-Y2OQOAY7.js";
23
+ } from "./chunk-RQNLEGMQ.js";
24
24
  import {
25
25
  mcpEnvironmentSchema
26
- } from "./chunk-EXJUFF6G.js";
26
+ } from "./chunk-FXELV3AW.js";
27
27
  import {
28
28
  RENEWAL_MARGIN_MS,
29
29
  SESSION_EXPIRED,
@@ -33,10 +33,10 @@ import {
33
33
  needsRenewal,
34
34
  refreshToken,
35
35
  renewAuth
36
- } from "./chunk-FI7UKPRF.js";
36
+ } from "./chunk-QS2T7JAK.js";
37
37
  import {
38
38
  config
39
- } from "./chunk-FYMDIB7J.js";
39
+ } from "./chunk-R3NDJICA.js";
40
40
  import {
41
41
  UnifiedDocsMigrationStatus,
42
42
  pendingInviteSchema,
@@ -57,7 +57,7 @@ import {
57
57
  managedDocSchema,
58
58
  managedDocVersionSchema,
59
59
  ruleSchema
60
- } from "./chunk-TYNF7ROW.js";
60
+ } from "./chunk-JHJDLZSM.js";
61
61
  import {
62
62
  createdMcpServerSchema,
63
63
  docInstanceSchema,
@@ -67,7 +67,7 @@ import {
67
67
  registryGitBindingSchema,
68
68
  registryPublishRecordSchema,
69
69
  secretMetadataSchema
70
- } from "./chunk-AOZQPCWI.js";
70
+ } from "./chunk-M4QTWCJ7.js";
71
71
  import {
72
72
  teamEnvironmentSchema
73
73
  } from "./chunk-Q26DFKTY.js";
@@ -5,10 +5,10 @@ import {
5
5
  import {
6
6
  ISOLATE_DIR,
7
7
  ISOLATE_EXTRACTION_DIR
8
- } from "./chunk-CUHVXHIV.js";
8
+ } from "./chunk-PWFA23M2.js";
9
9
  import {
10
10
  config
11
- } from "./chunk-FYMDIB7J.js";
11
+ } from "./chunk-R3NDJICA.js";
12
12
  import {
13
13
  output
14
14
  } from "./chunk-T5HJUAWB.js";
@@ -5,7 +5,8 @@ var AGENT_NOTES = [
5
5
  "Run `scalar <command>` when the CLI is installed, or `npx @scalar/cli <command>` when it is not.",
6
6
  "Run `scalar context` for this command tree as JSON, or `scalar <command> --help` for a single command.",
7
7
  "Log in with a personal token: `scalar auth login --token <token>`, or set `SCALAR_API_KEY` and run `scalar auth login`. Both store the session on disk for later commands. Without a token, `scalar auth login` opens a browser and waits for a person to log in, so do not run it that way. Check the session with `scalar auth whoami`.",
8
- "Many commands prompt when a value is left out, such as a slug, a team, or a confirmation before overwriting a file, and a prompt blocks a non-interactive run. Pass every value as an argument or flag: for example `--output` on `document bundle` and `document upgrade`, `--yes` on `project rollback`, and `--force` on `project init`.",
8
+ "Use --no-input before or after subcommands to disable prompts and browser launches, including under a PTY. Supply required values explicitly; missing inputs fail with exit code 1 and guidance. Piped input is never a confirmation. Cancelled prompts and EOF exit with code 1. The flag does not imply --yes or --force and neither option chooses an unspecified target.",
9
+ "Many commands prompt when a value is left out, such as a slug, a team, or a confirmation before overwriting a file, and missing values fail when interaction is disabled. Pass every value as an argument or flag: for example `--output` on `document bundle` and `document upgrade`, `--yes` on `project rollback`, and `--force` on `project init`.",
9
10
  "Results go to stdout. Errors go to stderr, prefixed with `[ERROR]`."
10
11
  ];
11
12
  var EXIT_CODES = {
@@ -1,7 +1,7 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  detectManagedDocType
4
- } from "./chunk-TYNF7ROW.js";
4
+ } from "./chunk-JHJDLZSM.js";
5
5
 
6
6
  // src/domains/document/helpers/safe-normalize.ts
7
7
  import { normalize } from "@scalar/json-magic/helpers/normalize";
@@ -3,8 +3,9 @@ import {
3
3
  baseRegistrySchema,
4
4
  mcpChannelModes,
5
5
  mcpEnvironmentPolicies,
6
- mcpServerChannelSchema
7
- } from "./chunk-AOZQPCWI.js";
6
+ mcpServerChannelSchema,
7
+ secretNameSchema
8
+ } from "./chunk-M4QTWCJ7.js";
8
9
  import {
9
10
  environmentSlugSchema
10
11
  } from "./chunk-Q26DFKTY.js";
@@ -189,6 +190,8 @@ var mcpCustomizationSchema = external_exports.object({
189
190
  */
190
191
  logo: external_exports.url({ protocol: /^https?$/ }).max(2048).nullish()
191
192
  }).meta({ id: "mcp-customization" });
193
+ var mcpGroupSecretMappingSchema = external_exports.record(secretNameSchema, external_exports.union([secretNameSchema, external_exports.literal("")]));
194
+ var mcpGroupSecretsSchema = external_exports.record(external_exports.string(), external_exports.record(external_exports.string(), external_exports.string()));
192
195
  var mcpEnvironmentSchema = external_exports.object({
193
196
  /** Per API channel, keyed by the agent document uid: the channel's Config in this environment. */
194
197
  channels: external_exports.record(external_exports.string(), mcpChannelConfigSchema).optional(),
@@ -199,7 +202,7 @@ var mcpEnvironmentSchema = external_exports.object({
199
202
  * `{{ group.KEY }}` sends for a reader that group admits; `""` is none.
200
203
  * Null is none at all, so the environment stops taking production's.
201
204
  */
202
- groupSecrets: external_exports.record(external_exports.string(), external_exports.record(external_exports.string(), external_exports.string())).nullish(),
205
+ groupSecrets: mcpGroupSecretsSchema.nullish(),
203
206
  loginPortalUid: external_exports.string().nullable().optional(),
204
207
  piiRedaction: external_exports.boolean().optional(),
205
208
  credentialRedaction: external_exports.boolean().optional(),
@@ -254,5 +257,7 @@ export {
254
257
  FEEDBACK_PATH_MAX_LENGTH,
255
258
  cloudflareHostnameStateSchema,
256
259
  siteDeploySchema,
260
+ mcpGroupSecretMappingSchema,
261
+ mcpGroupSecretsSchema,
257
262
  mcpEnvironmentSchema
258
263
  };
@@ -2,7 +2,7 @@ import { createRequire as $$cR } from "node:module"; const require = $$cR(import
2
2
 
3
3
  // package.json
4
4
  var name = "@scalar/cli";
5
- var version = "2.12.3";
5
+ var version = "2.13.1";
6
6
  var bin = {
7
7
  scalar: "./dist/index.js",
8
8
  "scalar-cli": "./dist/index.js"
@@ -1,10 +1,10 @@
1
1
  import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
2
2
  import {
3
3
  getAuthData
4
- } from "./chunk-FI7UKPRF.js";
4
+ } from "./chunk-QS2T7JAK.js";
5
5
  import {
6
6
  config
7
- } from "./chunk-FYMDIB7J.js";
7
+ } from "./chunk-R3NDJICA.js";
8
8
  import {
9
9
  external_exports,
10
10
  objectSchema,
@@ -95,6 +95,7 @@ function createAccess(baseURL) {
95
95
  function makeRequest(options) {
96
96
  return fetch(`${baseURL}${options.url}`, {
97
97
  method: options.method,
98
+ signal: options.signal,
98
99
  headers: {
99
100
  ...options.headers,
100
101
  // An empty bearer token is always rejected — omit the header so the
@@ -110,9 +111,10 @@ function createAccess(baseURL) {
110
111
  return formatResponse({ data: await res.json(), status: res.status }, options.schema);
111
112
  }).catch((err) => formatError(err));
112
113
  }
113
- function get({ collectionPath, query, schema, type }) {
114
+ function get({ collectionPath, query, schema, type, signal }) {
114
115
  const data = schemaModel({ collectionPath, query }, getRecordRequestSchema);
115
116
  return makeRequest({
117
+ signal,
116
118
  url: `/database/get-${type}`,
117
119
  method: "POST",
118
120
  data,
@@ -267,17 +269,22 @@ function initDatabase(baseUrl) {
267
269
  }
268
270
 
269
271
  // src/helpers/database.ts
270
- var getDatabaseClient = async () => {
272
+ function createDatabaseClient(accessToken) {
271
273
  const client = initDatabase(`${config.services.api}/rtdb`);
274
+ client.updateAccessToken(accessToken);
275
+ return client;
276
+ }
277
+ var getDatabaseClient = async () => {
272
278
  const auth = await getAuthData();
279
+ const client = createDatabaseClient(auth.accessToken);
273
280
  auth.addEventListener((state) => {
274
281
  Object.assign(auth, state);
275
282
  client.updateAccessToken(state.accessToken);
276
283
  });
277
- client.updateAccessToken(auth.accessToken);
278
284
  return client;
279
285
  };
280
286
 
281
287
  export {
288
+ createDatabaseClient,
282
289
  getDatabaseClient
283
290
  };