@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.
- package/README.md +221 -2
- package/chunks/{action-JXCU2JKC.js → action-27BJMHFD.js} +38 -6
- package/chunks/{action-5BJL72JE.js → action-2BZ3AFBR.js} +10 -7
- package/chunks/{action-RPTLQBMK.js → action-3DBOUHKS.js} +8 -6
- package/chunks/{action-6I2PWENU.js → action-3R3MVTP3.js} +67 -88
- package/chunks/{action-T4MM4OUS.js → action-5HWPNWVU.js} +52 -29
- package/chunks/{action-EWZLVN45.js → action-5JTBIUPZ.js} +47 -27
- package/chunks/{action-4ESHWOAM.js → action-5QDBZTBF.js} +9 -8
- package/chunks/{action-D7L757PX.js → action-7HHTD65O.js} +13 -12
- package/chunks/{action-Y7EBKCUU.js → action-ASBFLTOA.js} +1 -1
- package/chunks/{action-H4GW3KAI.js → action-CXQ3HLVC.js} +15 -15
- package/chunks/{action-EPGS3U3T.js → action-EGF7LXVA.js} +63 -48
- package/chunks/{action-7CUPRYNA.js → action-F5LSDVJA.js} +36 -23
- package/chunks/{action-6A4NM5WS.js → action-FR6UPGZP.js} +9 -8
- package/chunks/{action-KIOYSVKX.js → action-FZZ2VLNA.js} +23 -6
- package/chunks/{action-ZOYQBWGD.js → action-GIKW67JB.js} +13 -13
- package/chunks/{action-ED4TSPRZ.js → action-GLC54N3F.js} +11 -11
- package/chunks/{action-FBOTIFVC.js → action-GRAMP3QD.js} +12 -10
- package/chunks/{action-BYYKW4S6.js → action-IUG6MPST.js} +25 -10
- package/chunks/{action-ZBEOLJJR.js → action-JCBTINNL.js} +9 -6
- package/chunks/{action-VVKMUOKR.js → action-JEI24ZNE.js} +13 -5
- package/chunks/{action-EWDQOX5B.js → action-JFNK5UCV.js} +6 -4
- package/chunks/action-JRPGHJGA.js +48 -0
- package/chunks/{action-Q3DI54OW.js → action-KRXJWRCE.js} +15 -15
- package/chunks/{action-B74PPGKB.js → action-PBJFNJMY.js} +34 -16
- package/chunks/{action-O7ROX6NF.js → action-PDOW5JS2.js} +12 -11
- package/chunks/{action-GMJJMZXY.js → action-RYLO75IN.js} +11 -11
- package/chunks/{action-HAKFAXTQ.js → action-VEXFHEQR.js} +6 -6
- package/chunks/{action-YXRCGKCK.js → action-W3AGGZ42.js} +6 -4
- package/chunks/action-W5VD63XO.js +55 -0
- package/chunks/{action-M5OUEDV2.js → action-WEDLKGDY.js} +4 -4
- package/chunks/{action-FBQAU5LV.js → action-WI6UW2AL.js} +12 -12
- package/chunks/{action-AYKKHH7A.js → action-WQPMJZXL.js} +51 -24
- package/chunks/{action-GJHOZ6Q5.js → action-WY4GOD2Y.js} +10 -8
- package/chunks/{action-I2IV4VLL.js → action-XXIRB2F6.js} +32 -16
- package/chunks/{actions-EXQNVV4T.js → actions-I4HS6ASR.js} +20 -18
- package/chunks/{agent-XAHNA4MB.js → agent-E6PYTXAU.js} +3 -3
- package/chunks/{asyncapi-FNOWXSKB.js → asyncapi-VQ7CCUCY.js} +9 -7
- package/chunks/{build.action-TIKRZPQ5.js → build.action-LIAREWUF.js} +36 -19
- package/chunks/chunk-2XWUFFEZ.js +133 -0
- package/chunks/{chunk-2GKXAGSH.js → chunk-6VAEDMCP.js} +7 -7
- package/chunks/{chunk-EUFK4MVX.js → chunk-6YDIOXF7.js} +2 -2
- package/chunks/{chunk-EBNFCIKS.js → chunk-APX65SRT.js} +2 -1
- package/chunks/{chunk-WKW5W2ZP.js → chunk-DWN6JOF2.js} +1 -1
- package/chunks/{chunk-EXJUFF6G.js → chunk-FXELV3AW.js} +8 -3
- package/chunks/{chunk-IOW726L2.js → chunk-GARUDDWI.js} +1 -1
- package/chunks/{chunk-JWNWOK2M.js → chunk-HZ4UKLOE.js} +12 -5
- package/chunks/{chunk-2AK5O3NQ.js → chunk-IDWF5L45.js} +28 -28
- package/chunks/chunk-IRQJDPZE.js +34 -0
- package/chunks/{chunk-TYNF7ROW.js → chunk-JHJDLZSM.js} +1 -1
- package/chunks/{chunk-TI4NDKQC.js → chunk-KTI65ZVY.js} +5 -5
- package/chunks/chunk-LK2ZIDHH.js +32 -0
- package/chunks/{chunk-I7ZVWF57.js → chunk-LUR7BA3W.js} +15 -9
- package/chunks/{chunk-AOZQPCWI.js → chunk-M4QTWCJ7.js} +2 -0
- package/chunks/{chunk-7S34K2P3.js → chunk-NOD4CBF7.js} +1 -1
- package/chunks/{chunk-KPLWZIOV.js → chunk-P4EPNS46.js} +3 -3
- package/chunks/{chunk-CUHVXHIV.js → chunk-PWFA23M2.js} +1 -1
- package/chunks/{chunk-KWIY2QZY.js → chunk-QRYMQPFT.js} +2 -2
- package/chunks/{chunk-FI7UKPRF.js → chunk-QS2T7JAK.js} +1 -1
- package/chunks/{chunk-OZQPMMTA.js → chunk-QUUBUPAW.js} +5 -5
- package/chunks/{chunk-FYMDIB7J.js → chunk-R3NDJICA.js} +1 -1
- package/chunks/{chunk-V7RTDFHK.js → chunk-RAJM56L7.js} +5 -1
- package/chunks/{chunk-Y2OQOAY7.js → chunk-RQNLEGMQ.js} +1 -1
- package/chunks/chunk-RZDLPTXV.js +167 -0
- package/chunks/chunk-SIPBGEVT.js +16 -0
- package/chunks/chunk-SNQFFEYH.js +11 -0
- package/chunks/{chunk-62OOT7FY.js → chunk-SNSJW2JT.js} +2 -2
- package/chunks/{chunk-LEECPQZN.js → chunk-UNV7BZD3.js} +2 -2
- package/chunks/{chunk-IRA5BW2J.js → chunk-X62ZTOQF.js} +31 -4
- package/chunks/{chunk-UN2AAVO5.js → chunk-XFBCZL7J.js} +2 -2
- package/chunks/chunk-XUX6JXU5.js +58 -0
- package/chunks/{create.action-K7GTWYST.js → create.action-PZMCTYGS.js} +31 -22
- package/chunks/{delete.action-JKLXBYRD.js → delete.action-J57JIFG3.js} +35 -21
- package/chunks/{delete.action-E4XRGKQW.js → delete.action-VDSTPSWG.js} +37 -21
- package/chunks/{get.action-IY7WSJMX.js → get.action-KUP32QJT.js} +13 -13
- package/chunks/{get.action-2AKMD4W3.js → get.action-ZOSML6XG.js} +12 -10
- package/chunks/{list.action-NRL2DDL5.js → list.action-Q5MPDR42.js} +15 -15
- package/chunks/{list.action-44YVCWKN.js → list.action-VYENIC5L.js} +13 -13
- package/chunks/{publish.action-E76MHLCN.js → publish.action-MBAZHQ2J.js} +48 -28
- package/chunks/{update.action-LZCAHAWW.js → update.action-BWMCXWQ5.js} +35 -21
- package/chunks/{update.action-FTTVWVAB.js → update.action-IEXVMUKG.js} +46 -26
- package/index.js +212 -127
- package/package.json +1 -1
- package/skills/scalar-cli/SKILL.md +4 -2
- package/template.md +220 -1
- package/chunks/action-BDDXF4YV.js +0 -38
- package/chunks/chunk-BOPEAS7H.js +0 -38
- package/chunks/chunk-EGOXR5FB.js +0 -15
- 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-
|
|
81
|
-
import "./chunk-
|
|
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-
|
|
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-
|
|
7
|
+
} from "./chunk-LUR7BA3W.js";
|
|
8
8
|
import {
|
|
9
9
|
isAsyncApiDocument
|
|
10
|
-
} from "./chunk-
|
|
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-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
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-
|
|
22
|
+
import "./chunk-JHJDLZSM.js";
|
|
22
23
|
import {
|
|
23
24
|
output
|
|
24
25
|
} from "./chunk-T5HJUAWB.js";
|
|
25
|
-
import "./chunk-
|
|
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-
|
|
7
|
+
} from "./chunk-KTI65ZVY.js";
|
|
5
8
|
import {
|
|
6
9
|
getDatabaseClient
|
|
7
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-HZ4UKLOE.js";
|
|
8
11
|
import {
|
|
9
12
|
apiService
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
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-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
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-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
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-
|
|
39
|
+
import "./chunk-JHJDLZSM.js";
|
|
33
40
|
import {
|
|
34
41
|
output
|
|
35
42
|
} from "./chunk-T5HJUAWB.js";
|
|
36
|
-
import "./chunk-
|
|
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 (
|
|
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
|
|
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
|
-
|
|
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-
|
|
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-
|
|
23
|
+
} from "./chunk-RQNLEGMQ.js";
|
|
24
24
|
import {
|
|
25
25
|
mcpEnvironmentSchema
|
|
26
|
-
} from "./chunk-
|
|
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-
|
|
36
|
+
} from "./chunk-QS2T7JAK.js";
|
|
37
37
|
import {
|
|
38
38
|
config
|
|
39
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
8
|
+
} from "./chunk-PWFA23M2.js";
|
|
9
9
|
import {
|
|
10
10
|
config
|
|
11
|
-
} from "./chunk-
|
|
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
|
-
"
|
|
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-
|
|
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
|
-
|
|
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:
|
|
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
|
};
|
|
@@ -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-
|
|
4
|
+
} from "./chunk-QS2T7JAK.js";
|
|
5
5
|
import {
|
|
6
6
|
config
|
|
7
|
-
} from "./chunk-
|
|
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
|
-
|
|
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
|
};
|