saturndocs 0.7.0 → 0.8.0
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/LICENSE +64 -21
- package/dist/access-PCFOIL5M.js +23 -0
- package/dist/{auth-76SYM7IA.js → auth-PTDA4S5U.js} +5 -5
- package/dist/{broken-links-E4GALBEW.js → broken-links-6UPUX7IV.js} +13 -12
- package/dist/{check-YVUYIH3Y.js → check-QZSQJSYC.js} +21 -19
- package/dist/{chunk-XBDKZGCA.js → chunk-3EGICOO5.js} +9 -23
- package/dist/{chunk-2G4DQ7MR.js → chunk-3OYU5437.js} +8 -6
- package/dist/{chunk-VWPXQFHD.js → chunk-4E3Z2PUE.js} +9 -7
- package/dist/{chunk-WBMWO34R.js → chunk-6SK43CS5.js} +7 -5
- package/dist/{chunk-YFET6FIO.js → chunk-7BLNCYSF.js} +11 -10
- package/dist/{chunk-OCDPAWTL.js → chunk-7OTEK7WQ.js} +1 -2
- package/dist/chunk-C57JP2BQ.js +90 -0
- package/dist/chunk-DIB6RGFR.js +238 -0
- package/dist/{chunk-O7FL4UDY.js → chunk-DSFPO7R4.js} +7 -5
- package/dist/{chunk-2XGQJ6O5.js → chunk-EQ5VQHVS.js} +47 -11
- package/dist/{chunk-SVRGZWBQ.js → chunk-GSCFDLM5.js} +8 -10
- package/dist/{chunk-FTRNX643.js → chunk-HBDKZBKV.js} +8 -6
- package/dist/{chunk-HWAQ2YEK.js → chunk-ILX5YFUT.js} +5 -55
- package/dist/{chunk-X2HK6HRK.js → chunk-J5SPLLNM.js} +7 -5
- package/dist/{chunk-74RXKLCM.js → chunk-JLPAKS7U.js} +276 -45
- package/dist/{chunk-FNPG5423.js → chunk-K4MC3C6U.js} +1 -86
- package/dist/{chunk-D5WG63T5.js → chunk-KYIVRM6P.js} +252 -95
- package/dist/{chunk-YXS34FS2.js → chunk-OWLMAQQY.js} +9 -18
- package/dist/{chunk-WKRDJOFJ.js → chunk-PUG55M6V.js} +12 -10
- package/dist/{chunk-STUQD2NY.js → chunk-RVBR7ZSV.js} +1 -1
- package/dist/{chunk-Y6X7O2RH.js → chunk-S2S3E3RZ.js} +6 -4
- package/dist/{chunk-2QAM6CSJ.js → chunk-TZHISB3Q.js} +1 -1
- package/dist/{chunk-3XZBGNY4.js → chunk-U4CDSDW4.js} +7 -5
- package/dist/{chunk-SNXQSHWR.js → chunk-UONZ3YIB.js} +7 -5
- package/dist/{chunk-Z2CENESG.js → chunk-XQVUUYJB.js} +9 -7
- package/dist/{chunk-E5LB2OL7.js → chunk-Y57MKMGT.js} +7 -5
- package/dist/chunk-ZM2OA7CV.js +83 -0
- package/dist/{chunk-N5W667O7.js → chunk-ZR7WZJRF.js} +2 -2
- package/dist/cli.js +54 -13
- package/dist/{coverage-XQU3PEAH.js → coverage-AOQBEJSJ.js} +5 -5
- package/dist/{dev-G24A7FEQ.js → dev-M6WKTVD4.js} +15 -16
- package/dist/{dist-GONQDTBT.js → dist-T2YNSN2K.js} +2 -6
- package/dist/index.d.ts +112 -122
- package/dist/index.js +40 -64
- package/dist/{init-O4R3LDNE.js → init-BLSN7IGY.js} +7 -6
- package/dist/{lint-XQQEHOHB.js → lint-CEANA4YL.js} +4 -3
- package/dist/{local-metadata-5KLCOASW.js → local-metadata-OYXKFDJF.js} +2 -4
- package/dist/{login-ZE257BGZ.js → login-A4HKYU6S.js} +5 -5
- package/dist/{manage-25YZ3NEO.js → manage-TQQ7RHVK.js} +5 -5
- package/dist/{nav-35UUYP45.js → nav-NFROHU6U.js} +5 -5
- package/dist/{openapiCheck-HLWOQZKQ.js → openapiCheck-V7GGZOUG.js} +8 -6
- package/dist/pages-SSR5AELT.js +17 -0
- package/dist/{read-KXU34B5I.js → read-6XKOE3GD.js} +8 -7
- package/dist/{read-NA76WCIK.js → read-JEWYHGAR.js} +9 -8
- package/dist/renderer-TNIIWUEG.js +14 -0
- package/dist/requests-STDUQFVH.js +14 -0
- package/dist/{schema-IGC5XO4E.js → schema-LGI4GA2Q.js} +5 -4
- package/dist/sites-ERFKLYSA.js +16 -0
- package/dist/{status-3UNBNX4X.js → status-RWJKMJ37.js} +5 -5
- package/dist/{suggestions-4PE6SHVW.js → suggestions-QDAAXUUA.js} +12 -10
- package/dist/validate-HE4WEOKP.js +16 -0
- package/package.json +6 -6
- package/dist/build-SSRHSDDN.js +0 -150
- package/dist/chunk-6LD7SPWQ.js +0 -79
- package/dist/chunk-LDE53VKA.js +0 -146
- package/dist/chunk-YOXZMP5Z.js +0 -39
- package/dist/chunk-YP6IRZZV.js +0 -259
- package/dist/pages-ZUAODNC6.js +0 -17
- package/dist/renderer-LKTT533L.js +0 -12
- package/dist/requests-326KNATQ.js +0 -14
- package/dist/sites-ECFP6IMI.js +0 -16
- package/dist/validate-PMTH2ICX.js +0 -15
package/LICENSE
CHANGED
|
@@ -1,21 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 SaturnDocs
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
SaturnDocs Proprietary Software License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SaturnDocs. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This license covers this package and every SaturnDocs component that it
|
|
6
|
+
downloads or runs, including the SaturnDocs renderer and the pages, themes,
|
|
7
|
+
scripts, and styles that the renderer produces (together, the "Software").
|
|
8
|
+
The Software is proprietary to SaturnDocs. It is licensed, not sold.
|
|
9
|
+
|
|
10
|
+
1. Grant. If you have a SaturnDocs account in good standing, SaturnDocs grants
|
|
11
|
+
you a limited, non-exclusive, non-transferable, non-sublicensable, and
|
|
12
|
+
revocable license to install and run the Software. You may use it only to
|
|
13
|
+
write, check, preview, and publish documentation for sites that SaturnDocs
|
|
14
|
+
hosts, and to manage those sites. Your employees, contractors, and AI agents
|
|
15
|
+
may run the Software for you under this license. You are responsible for
|
|
16
|
+
their compliance with it.
|
|
17
|
+
|
|
18
|
+
2. Restrictions. You must not, and must not let anyone else:
|
|
19
|
+
a. host, publish, or serve a site, page, theme, script, or style that the
|
|
20
|
+
Software produces anywhere except on the SaturnDocs platform;
|
|
21
|
+
b. copy, modify, adapt, translate, or create derivative works of the
|
|
22
|
+
Software, except for the copies needed to install and run it under
|
|
23
|
+
section 1;
|
|
24
|
+
c. distribute, sell, rent, lease, lend, or sublicense the Software, or make
|
|
25
|
+
it available to anyone outside your organization;
|
|
26
|
+
d. reverse engineer, decompile, or disassemble the Software, or try to
|
|
27
|
+
extract its source code, except to the extent that applicable law
|
|
28
|
+
permits this despite this restriction;
|
|
29
|
+
e. remove, disable, or work around a sign-in requirement, license check,
|
|
30
|
+
usage limit, or other technical restriction in the Software;
|
|
31
|
+
f. use the Software to build or support a product or service that competes
|
|
32
|
+
with SaturnDocs; or
|
|
33
|
+
g. remove or change a notice of ownership in the Software.
|
|
34
|
+
|
|
35
|
+
3. Your content. The documentation source files that you write remain yours.
|
|
36
|
+
This license restricts the Software and what the Software produces. It does
|
|
37
|
+
not restrict your own content.
|
|
38
|
+
|
|
39
|
+
4. Terms of Service. The SaturnDocs Terms of Service at
|
|
40
|
+
https://saturndocs.com/terms also govern your use of the Software. If you
|
|
41
|
+
have a signed written agreement with SaturnDocs, that agreement controls
|
|
42
|
+
where it conflicts with this license.
|
|
43
|
+
|
|
44
|
+
5. Termination. This license ends automatically when your SaturnDocs account
|
|
45
|
+
or subscription ends, or when you break this license. When it ends, you
|
|
46
|
+
must stop using the Software and delete every copy of it, including copies
|
|
47
|
+
in caches.
|
|
48
|
+
|
|
49
|
+
6. Third-party software. The Software includes and downloads open-source
|
|
50
|
+
components. Each of those components is licensed under its own terms, and
|
|
51
|
+
this license does not change those terms.
|
|
52
|
+
|
|
53
|
+
7. No warranty. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
54
|
+
EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR
|
|
55
|
+
A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
|
56
|
+
|
|
57
|
+
8. Limitation of liability. TO THE MAXIMUM EXTENT PERMITTED BY LAW, SATURNDOCS
|
|
58
|
+
IS NOT LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR
|
|
59
|
+
PUNITIVE DAMAGES, OR FOR LOST PROFITS OR LOST DATA, THAT ARISE FROM THE
|
|
60
|
+
SOFTWARE OR THIS LICENSE. SATURNDOCS'S TOTAL LIABILITY IS LIMITED AS THE
|
|
61
|
+
TERMS OF SERVICE STATE.
|
|
62
|
+
|
|
63
|
+
9. Governing law. The laws of the State of Delaware, United States, govern
|
|
64
|
+
this license, without regard to their conflict-of-law rules.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CONFIRMED_FOR_MS,
|
|
3
|
+
LOGIN_RECOVERY,
|
|
4
|
+
OFFLINE_GRACE_MS,
|
|
5
|
+
TEST_CONFIRMATION_ORIGIN,
|
|
6
|
+
currentAccess,
|
|
7
|
+
notLoggedIn,
|
|
8
|
+
refusedLogin,
|
|
9
|
+
requireAccess
|
|
10
|
+
} from "./chunk-DIB6RGFR.js";
|
|
11
|
+
import "./chunk-EQ5VQHVS.js";
|
|
12
|
+
import "./chunk-C57JP2BQ.js";
|
|
13
|
+
import "./chunk-7OTEK7WQ.js";
|
|
14
|
+
export {
|
|
15
|
+
CONFIRMED_FOR_MS,
|
|
16
|
+
LOGIN_RECOVERY,
|
|
17
|
+
OFFLINE_GRACE_MS,
|
|
18
|
+
TEST_CONFIRMATION_ORIGIN,
|
|
19
|
+
currentAccess,
|
|
20
|
+
notLoggedIn,
|
|
21
|
+
refusedLogin,
|
|
22
|
+
requireAccess
|
|
23
|
+
};
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
authStatusOf,
|
|
4
4
|
registerAuth,
|
|
5
5
|
savedLoginStatusOf
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-YOXZMP5Z.js";
|
|
6
|
+
} from "./chunk-Y57MKMGT.js";
|
|
7
|
+
import "./chunk-EQ5VQHVS.js";
|
|
9
8
|
import "./chunk-FNZJHYAX.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-K4MC3C6U.js";
|
|
10
|
+
import "./chunk-C57JP2BQ.js";
|
|
11
|
+
import "./chunk-7OTEK7WQ.js";
|
|
12
12
|
export {
|
|
13
13
|
AUTH_METADATA,
|
|
14
14
|
authStatusOf,
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
2
|
checkLinks
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-YP6IRZZV.js";
|
|
6
|
-
import "./chunk-74RXKLCM.js";
|
|
3
|
+
} from "./chunk-GSCFDLM5.js";
|
|
4
|
+
import "./chunk-JLPAKS7U.js";
|
|
7
5
|
import {
|
|
8
6
|
requireDocsDir
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-RVBR7ZSV.js";
|
|
8
|
+
import "./chunk-QSJHJKJP.js";
|
|
9
|
+
import "./chunk-ZR7WZJRF.js";
|
|
10
|
+
import "./chunk-ILX5YFUT.js";
|
|
11
|
+
import "./chunk-OWLMAQQY.js";
|
|
13
12
|
import {
|
|
14
13
|
applyCommandHelp
|
|
15
14
|
} from "./chunk-FNZJHYAX.js";
|
|
16
15
|
import {
|
|
17
16
|
createResultWriter,
|
|
17
|
+
resolveGlobalOptions
|
|
18
|
+
} from "./chunk-K4MC3C6U.js";
|
|
19
|
+
import {
|
|
18
20
|
failureResult,
|
|
19
21
|
invalidInput,
|
|
20
|
-
resolveGlobalOptions,
|
|
21
22
|
successResult
|
|
22
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-C57JP2BQ.js";
|
|
23
24
|
import {
|
|
24
25
|
BROKEN_LINKS_METADATA
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-3EGICOO5.js";
|
|
27
|
+
import "./chunk-7OTEK7WQ.js";
|
|
27
28
|
|
|
28
29
|
// src/commands/broken-links.ts
|
|
29
30
|
function linkLine(d) {
|
|
@@ -1,40 +1,42 @@
|
|
|
1
1
|
import {
|
|
2
2
|
checkLinks
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GSCFDLM5.js";
|
|
4
|
+
import "./chunk-JLPAKS7U.js";
|
|
5
|
+
import {
|
|
6
|
+
requireDocsDir
|
|
7
|
+
} from "./chunk-RVBR7ZSV.js";
|
|
4
8
|
import "./chunk-QSJHJKJP.js";
|
|
5
|
-
import
|
|
9
|
+
import {
|
|
10
|
+
validateDocsDetailed
|
|
11
|
+
} from "./chunk-ZR7WZJRF.js";
|
|
6
12
|
import {
|
|
7
13
|
RendererError
|
|
8
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-KYIVRM6P.js";
|
|
15
|
+
import "./chunk-DIB6RGFR.js";
|
|
16
|
+
import "./chunk-EQ5VQHVS.js";
|
|
17
|
+
import "./chunk-ILX5YFUT.js";
|
|
18
|
+
import "./chunk-OWLMAQQY.js";
|
|
9
19
|
import {
|
|
10
20
|
lintDocsDir
|
|
11
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-HBDKZBKV.js";
|
|
12
22
|
import "./chunk-YGVC4N4V.js";
|
|
13
|
-
import "./chunk-YP6IRZZV.js";
|
|
14
|
-
import "./chunk-74RXKLCM.js";
|
|
15
|
-
import {
|
|
16
|
-
requireDocsDir
|
|
17
|
-
} from "./chunk-STUQD2NY.js";
|
|
18
|
-
import {
|
|
19
|
-
validateDocsDetailed
|
|
20
|
-
} from "./chunk-N5W667O7.js";
|
|
21
|
-
import "./chunk-HWAQ2YEK.js";
|
|
22
|
-
import "./chunk-YXS34FS2.js";
|
|
23
23
|
import {
|
|
24
24
|
applyCommandHelp
|
|
25
25
|
} from "./chunk-FNZJHYAX.js";
|
|
26
26
|
import {
|
|
27
|
-
CliError,
|
|
28
27
|
createResultWriter,
|
|
28
|
+
resolveGlobalOptions
|
|
29
|
+
} from "./chunk-K4MC3C6U.js";
|
|
30
|
+
import {
|
|
31
|
+
CliError,
|
|
29
32
|
failureResult,
|
|
30
33
|
invalidInput,
|
|
31
|
-
resolveGlobalOptions,
|
|
32
34
|
successResult
|
|
33
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-C57JP2BQ.js";
|
|
34
36
|
import {
|
|
35
37
|
CHECK_METADATA
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
+
} from "./chunk-3EGICOO5.js";
|
|
39
|
+
import "./chunk-7OTEK7WQ.js";
|
|
38
40
|
|
|
39
41
|
// src/commands/check.ts
|
|
40
42
|
var MISSING_ANCHOR = "No element with this id on the target page";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
commandMetadata
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7OTEK7WQ.js";
|
|
4
4
|
|
|
5
5
|
// src/commands/local-metadata.ts
|
|
6
6
|
var DIR = { name: "dir", required: false, description: "The docs directory, which holds docs.json. Defaults to the current directory." };
|
|
@@ -10,7 +10,7 @@ var CHECK_METADATA = Object.freeze([
|
|
|
10
10
|
target: { arguments: [DIR] },
|
|
11
11
|
effect: "Writes nothing in the docs directory. The link check downloads the renderer on its first run and builds the site in a temporary directory.",
|
|
12
12
|
output: { fields: ["docs_dir", "passed", "errors", "warnings", "checks", "findings"], ids: [], limitations: ["section_unavailable"] },
|
|
13
|
-
errors: ["invalid_input", "service_unavailable", "interrupted"],
|
|
13
|
+
errors: ["invalid_input", "unauthorized", "service_unavailable", "interrupted"],
|
|
14
14
|
examples: [
|
|
15
15
|
{ command: "saturndocs check", description: "Check the docs directory in the current directory before a push." },
|
|
16
16
|
{ command: "saturndocs check ./docs --json", description: "The same report as one result object, for an agent." },
|
|
@@ -24,7 +24,7 @@ var INIT_METADATA = Object.freeze([
|
|
|
24
24
|
target: { arguments: [{ name: "dir", required: false, description: "The directory to scaffold. Defaults to the current directory." }] },
|
|
25
25
|
effect: "Creates files in the directory. With --from-url it reads that website for a name, a color, and a logo.",
|
|
26
26
|
output: { fields: ["docs_dir", "files", "name", "primary", "extraction", "next_steps"], ids: [], limitations: [] },
|
|
27
|
-
errors: ["invalid_input", "service_unavailable", "interrupted"],
|
|
27
|
+
errors: ["invalid_input", "unauthorized", "service_unavailable", "interrupted"],
|
|
28
28
|
examples: [
|
|
29
29
|
{ command: 'saturndocs init docs --name "Acme"', description: "Scaffold a project named Acme in ./docs." },
|
|
30
30
|
{ command: 'saturndocs init docs --primary "#3355ff" --json', description: "Set the brand color and take one result object." }
|
|
@@ -35,9 +35,9 @@ var VALIDATE_METADATA = Object.freeze([
|
|
|
35
35
|
commandMetadata("validate", {
|
|
36
36
|
description: "Validate a docs directory against the rules hosted ingest applies: docs.json, the files a site may hold, page syntax and components, images and icons, internal links, and OpenAPI specs. Each error names a file, a line where one exists, a rule, and a fix. A link passes when it names a page, an OpenAPI operation page, a platform route, or the source of a docs.json redirect. Warnings do not change the exit code.",
|
|
37
37
|
target: { arguments: [DIR] },
|
|
38
|
-
effect: "Nothing. It reads files on this machine
|
|
38
|
+
effect: "Nothing. It reads files on this machine. Its only call is the login check, at most once a day.",
|
|
39
39
|
output: { fields: ["docs_dir", "valid", "errors", "warnings"], ids: [], limitations: [] },
|
|
40
|
-
errors: ["invalid_input", "interrupted"],
|
|
40
|
+
errors: ["invalid_input", "unauthorized", "service_unavailable", "interrupted"],
|
|
41
41
|
examples: [
|
|
42
42
|
{ command: "saturndocs validate", description: "Validate the docs directory in the current directory." },
|
|
43
43
|
{ command: "saturndocs validate ./docs --json", description: "The same check on another directory, as one result object." }
|
|
@@ -48,9 +48,9 @@ var OPENAPI_CHECK_METADATA = Object.freeze([
|
|
|
48
48
|
commandMetadata("openapi-check", {
|
|
49
49
|
description: "Parse each OpenAPI specification that a docs.json navigation group references and print its operations: method, path, and the page address the site serves. Exits 2 when a specification is missing or does not parse.",
|
|
50
50
|
target: { arguments: [DIR] },
|
|
51
|
-
effect: "Nothing. It reads files on this machine
|
|
51
|
+
effect: "Nothing. It reads files on this machine. Its only call is the login check, at most once a day.",
|
|
52
52
|
output: { fields: ["docs_dir", "specs"], ids: [], limitations: [] },
|
|
53
|
-
errors: ["invalid_input", "interrupted"],
|
|
53
|
+
errors: ["invalid_input", "unauthorized", "service_unavailable", "interrupted"],
|
|
54
54
|
examples: [
|
|
55
55
|
{ command: "saturndocs openapi-check", description: "Print the operation table for the current directory." },
|
|
56
56
|
{ command: "saturndocs openapi-check ./docs --json", description: "The same table as one result object." }
|
|
@@ -64,33 +64,20 @@ var DEV_METADATA = Object.freeze([
|
|
|
64
64
|
target: { arguments: [DIR] },
|
|
65
65
|
effect: "Starts a loopback server and a file watcher. Writes nothing in the docs directory.",
|
|
66
66
|
output: { fields: ["origin", "sign_in_url", "status_url", "opened"], ids: [], limitations: [] },
|
|
67
|
-
errors: ["invalid_input", "service_unavailable", "interrupted"],
|
|
67
|
+
errors: ["invalid_input", "unauthorized", "service_unavailable", "interrupted"],
|
|
68
68
|
examples: [
|
|
69
69
|
{ command: "saturndocs dev --open", description: "Preview the current directory in the default browser." },
|
|
70
70
|
{ command: "saturndocs dev ./docs --port 4000", description: "Preview another directory on a fixed port and print the sign-in link." }
|
|
71
71
|
]
|
|
72
72
|
})
|
|
73
73
|
]);
|
|
74
|
-
var BUILD_METADATA = Object.freeze([
|
|
75
|
-
commandMetadata("build", {
|
|
76
|
-
description: `Build a docs directory into a static site with the production renderer, and write it to --out-dir. The output directory must be outside the docs directory. The command replaces only a directory that it created, and it keeps the previous output when a build fails. A problem in the docs exits 2 with each issue in data.errors. A dead link is a warning here, as it is in a hosted build; check and broken-links fail on it. ${PREVIEW_PLATFORMS}`,
|
|
77
|
-
target: { arguments: [DIR] },
|
|
78
|
-
effect: "Writes the static site to --out-dir. Writes nothing in the docs directory.",
|
|
79
|
-
output: { fields: ["output_path", "renderer_identity", "input_digest", "site_url", "warnings", "duration_ms", "author_preview"], ids: [], limitations: [] },
|
|
80
|
-
errors: ["invalid_input", "service_unavailable", "interrupted"],
|
|
81
|
-
examples: [
|
|
82
|
-
{ command: "saturndocs build --out-dir ../preview", description: "Build the current directory into ../preview." },
|
|
83
|
-
{ command: "saturndocs build ./docs --out-dir ./preview --json", description: "Build another directory and take one result object." }
|
|
84
|
-
]
|
|
85
|
-
})
|
|
86
|
-
]);
|
|
87
74
|
var BROKEN_LINKS_METADATA = Object.freeze([
|
|
88
75
|
commandMetadata("broken-links", {
|
|
89
76
|
description: `Build a docs directory and check every link, asset, redirect target, and fragment in the rendered site, including links that components render. Each diagnostic names the page and line that an author edits where the link is written in a page, and a link in site chrome is reported once with a count. The command exits 2 when any link does not resolve, with the list in data.diagnostics. External links are not fetched. ${PREVIEW_PLATFORMS}`,
|
|
90
77
|
target: { arguments: [DIR] },
|
|
91
78
|
effect: "Builds the site in a temporary directory and removes it. Writes nothing in the docs directory.",
|
|
92
79
|
output: { fields: ["diagnostics", "renderer_identity", "input_digest", "site_url", "warnings", "duration_ms", "author_preview"], ids: [], limitations: [] },
|
|
93
|
-
errors: ["invalid_input", "service_unavailable", "interrupted"],
|
|
80
|
+
errors: ["invalid_input", "unauthorized", "service_unavailable", "interrupted"],
|
|
94
81
|
examples: [
|
|
95
82
|
{ command: "saturndocs broken-links", description: "Check the links of the docs directory in the current directory." },
|
|
96
83
|
{ command: "saturndocs broken-links ./docs --json", description: "The same check as one result object." }
|
|
@@ -104,6 +91,5 @@ export {
|
|
|
104
91
|
VALIDATE_METADATA,
|
|
105
92
|
OPENAPI_CHECK_METADATA,
|
|
106
93
|
DEV_METADATA,
|
|
107
|
-
BUILD_METADATA,
|
|
108
94
|
BROKEN_LINKS_METADATA
|
|
109
95
|
};
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
asCliError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EQ5VQHVS.js";
|
|
4
4
|
import {
|
|
5
5
|
applyCommandHelp
|
|
6
6
|
} from "./chunk-FNZJHYAX.js";
|
|
7
7
|
import {
|
|
8
8
|
createResultWriter,
|
|
9
|
+
resolveGlobalOptions
|
|
10
|
+
} from "./chunk-K4MC3C6U.js";
|
|
11
|
+
import {
|
|
9
12
|
failureResult,
|
|
10
13
|
invalidInput,
|
|
11
14
|
messageOf,
|
|
12
|
-
resolveGlobalOptions,
|
|
13
15
|
successResult
|
|
14
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-C57JP2BQ.js";
|
|
15
17
|
import {
|
|
16
18
|
commandMetadata
|
|
17
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-7OTEK7WQ.js";
|
|
18
20
|
|
|
19
21
|
// src/commands/nav.ts
|
|
20
22
|
import { existsSync } from "fs";
|
|
@@ -26,7 +28,7 @@ var NAV_METADATA = Object.freeze([
|
|
|
26
28
|
target: { arguments: [{ name: "dir", required: false, description: "Docs directory that holds docs.json. Defaults to the current directory." }] },
|
|
27
29
|
effect: "Rewrites docs.json in the docs directory: replaces its navigation key and keeps every other key. Writes nothing when the outline or docs.json is invalid.",
|
|
28
30
|
output: { fields: ["groups", "pages"], ids: [], limitations: [] },
|
|
29
|
-
errors: ["invalid_input", "interrupted"],
|
|
31
|
+
errors: ["invalid_input", "unauthorized", "service_unavailable", "interrupted"],
|
|
30
32
|
examples: [
|
|
31
33
|
{ command: "saturndocs nav --outline .launch-docs/outline.json", description: "Write the navigation from the approved outline into docs.json in the current directory." },
|
|
32
34
|
{ command: "saturndocs nav --outline .launch-docs/outline.json --json", description: "The same write, reported as one result object for an agent." }
|
|
@@ -47,7 +49,7 @@ async function readJson(path, label) {
|
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
async function applyOutlineNavigation(docsDir, outlinePath) {
|
|
50
|
-
const { parseOutline, navigationFromOutline } = await import("./dist-
|
|
52
|
+
const { parseOutline, navigationFromOutline } = await import("./dist-T2YNSN2K.js");
|
|
51
53
|
const docsPath = resolve(docsDir, "docs.json");
|
|
52
54
|
if (!existsSync(docsPath)) throw invalidInput(`No docs.json found in ${docsDir}. Pass a docs directory.`);
|
|
53
55
|
const config = await readJson(docsPath, "docs.json");
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AGENT_INSTRUCTIONS,
|
|
3
3
|
validateBundleSemantics
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ILX5YFUT.js";
|
|
5
5
|
import {
|
|
6
6
|
loadDocsConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OWLMAQQY.js";
|
|
8
8
|
import {
|
|
9
9
|
applyCommandHelp
|
|
10
10
|
} from "./chunk-FNZJHYAX.js";
|
|
11
11
|
import {
|
|
12
12
|
createResultWriter,
|
|
13
|
+
resolveGlobalOptions
|
|
14
|
+
} from "./chunk-K4MC3C6U.js";
|
|
15
|
+
import {
|
|
13
16
|
failureResult,
|
|
14
17
|
invalidInput,
|
|
15
|
-
resolveGlobalOptions,
|
|
16
18
|
successResult
|
|
17
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-C57JP2BQ.js";
|
|
18
20
|
import {
|
|
19
21
|
INIT_METADATA
|
|
20
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-3EGICOO5.js";
|
|
21
23
|
|
|
22
24
|
// src/commands/init.ts
|
|
23
25
|
import { existsSync } from "fs";
|
|
@@ -2170,7 +2172,7 @@ description: ${yamlString(description)}
|
|
|
2170
2172
|
Add MDX files under \`pages/\`, then list them in \`docs.json\`.
|
|
2171
2173
|
</Card>
|
|
2172
2174
|
<Card title="Check your changes" icon="circle-check">
|
|
2173
|
-
Run \`saturndocs validate\` and \`saturndocs lint\` before you push.
|
|
2175
|
+
Run \`saturndocs login\` once, then \`saturndocs validate\` and \`saturndocs lint\` before you push.
|
|
2174
2176
|
</Card>
|
|
2175
2177
|
</Columns>
|
|
2176
2178
|
`;
|
|
@@ -2183,7 +2185,7 @@ description: ${yamlString(`Start editing ${name}.`)}
|
|
|
2183
2185
|
|
|
2184
2186
|
## Check the site
|
|
2185
2187
|
|
|
2186
|
-
|
|
2188
|
+
Every \`saturndocs\` command needs a login, so run \`saturndocs login\` once. Then run both checks from the docs folder before you push.
|
|
2187
2189
|
|
|
2188
2190
|
\`\`\`sh
|
|
2189
2191
|
saturndocs validate
|
|
@@ -3,18 +3,20 @@ import {
|
|
|
3
3
|
environmentToken,
|
|
4
4
|
loginEnvironment,
|
|
5
5
|
resolveSavedLogin
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EQ5VQHVS.js";
|
|
7
7
|
import {
|
|
8
8
|
applyCommandHelp
|
|
9
9
|
} from "./chunk-FNZJHYAX.js";
|
|
10
10
|
import {
|
|
11
|
-
CliError,
|
|
12
11
|
createResultWriter,
|
|
12
|
+
resolveGlobalOptions
|
|
13
|
+
} from "./chunk-K4MC3C6U.js";
|
|
14
|
+
import {
|
|
15
|
+
CliError,
|
|
13
16
|
failureResult,
|
|
14
17
|
invalidInput,
|
|
15
|
-
resolveGlobalOptions,
|
|
16
18
|
successResult
|
|
17
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-C57JP2BQ.js";
|
|
18
20
|
import {
|
|
19
21
|
commandMetadata,
|
|
20
22
|
createClient,
|
|
@@ -23,7 +25,7 @@ import {
|
|
|
23
25
|
requireCommitSha,
|
|
24
26
|
requiresManagementReceipt,
|
|
25
27
|
resolveTarget
|
|
26
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-7OTEK7WQ.js";
|
|
27
29
|
|
|
28
30
|
// src/commands/manage.ts
|
|
29
31
|
import { readFile } from "fs/promises";
|
|
@@ -24,30 +24,32 @@ import {
|
|
|
24
24
|
windowsUnsupported,
|
|
25
25
|
withCredentialLock,
|
|
26
26
|
withPollLock
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-EQ5VQHVS.js";
|
|
28
28
|
import {
|
|
29
29
|
applyCommandHelp
|
|
30
30
|
} from "./chunk-FNZJHYAX.js";
|
|
31
31
|
import {
|
|
32
|
-
CliError,
|
|
33
32
|
createResultWriter,
|
|
33
|
+
resolveGlobalOptions
|
|
34
|
+
} from "./chunk-K4MC3C6U.js";
|
|
35
|
+
import {
|
|
36
|
+
CliError,
|
|
34
37
|
failureResult,
|
|
35
38
|
invalidInput,
|
|
36
|
-
resolveGlobalOptions,
|
|
37
39
|
successResult
|
|
38
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-C57JP2BQ.js";
|
|
39
41
|
import {
|
|
40
42
|
commandMetadata,
|
|
41
43
|
parseOrigin
|
|
42
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-7OTEK7WQ.js";
|
|
43
45
|
|
|
44
46
|
// src/commands/login.ts
|
|
45
47
|
import { execFile } from "child_process";
|
|
46
|
-
import { createHash } from "crypto";
|
|
48
|
+
import { createHash, randomUUID } from "crypto";
|
|
47
49
|
var LOGIN_ERRORS = ["invalid_input", "forbidden", "conflict", "rate_limited", "service_unavailable", "transport_failure", "unknown_outcome", "wait_timeout", "interrupted"];
|
|
48
50
|
var LOGIN_METADATA = Object.freeze([
|
|
49
51
|
commandMetadata("login", {
|
|
50
|
-
description: "Start the device approval flow: print a link and a code, wait while a person approves this agent for one site in the browser, then save the login. The person chooses the site and the permissions on the approval page; --site or --new-site only proposes one. The login is kept in the macOS Keychain when it answers, otherwise in a file only this user can read (on Linux, always the file
|
|
52
|
+
description: "Start the device approval flow: print a link and a code, wait while a person approves this agent for one site in the browser, then save the login. The person chooses the site and the permissions on the approval page; --site or --new-site only proposes one. The login is kept in the macOS Keychain when it answers, otherwise in a file only this user can read (on Linux, always the file), and every later command uses it when SATURNDOCS_MANAGEMENT_TOKEN is not set.",
|
|
51
53
|
target: { arguments: [] },
|
|
52
54
|
effect: "Creates nothing until the person approves. On approval the server records a grant for the one site, and the CLI saves its tokens on this computer.",
|
|
53
55
|
output: { fields: ["status", "site_id", "scope", "store", "access_expires_at", "primary_host", "repo_connected", "replaced_grant_revoked", "verification_uri_complete", "user_code", "expires_at"], ids: [], limitations: [] },
|
|
@@ -109,8 +111,7 @@ function approvalNotice(pending) {
|
|
|
109
111
|
].join("\n");
|
|
110
112
|
}
|
|
111
113
|
function openBrowser(url) {
|
|
112
|
-
|
|
113
|
-
execFile(file, args, { windowsHide: true }, () => void 0).unref();
|
|
114
|
+
execFile(process.platform === "darwin" ? "open" : "xdg-open", [url], () => void 0).unref();
|
|
114
115
|
}
|
|
115
116
|
function storesOrRefuse(environment) {
|
|
116
117
|
const choice = storesFor(environment);
|
|
@@ -175,7 +176,7 @@ async function finishLogin(origin, pending, environment, deadlineAt) {
|
|
|
175
176
|
if (outcome.kind === "expired") throw new CliError("wait_timeout", "The approval link expired before anyone approved it. Run saturndocs login again for a new link.", { mutation: "known" });
|
|
176
177
|
throw new CliError("conflict", "This approval was already used or is no longer valid. Run saturndocs login again for a new link.");
|
|
177
178
|
}
|
|
178
|
-
const grant = grantFromTokens(outcome.tokens, now());
|
|
179
|
+
const grant = grantFromTokens(outcome.tokens, now(), randomUUID());
|
|
179
180
|
const revoked = (token) => revokeToken(ctx, token).then(() => true, () => false);
|
|
180
181
|
let displaced = null;
|
|
181
182
|
let writeAttempted = false;
|
|
@@ -8,7 +8,6 @@ import { z } from "zod";
|
|
|
8
8
|
import { z as z2 } from "zod";
|
|
9
9
|
|
|
10
10
|
// ../control-abi/dist/index.js
|
|
11
|
-
var HOSTNAME_TRANSITIONS = Object.freeze({ unclaimed: Object.freeze(["claimed"]), claimed: Object.freeze(["unclaimed"]) });
|
|
12
11
|
var OWNER_NOTIFICATION_EVENTS = [
|
|
13
12
|
"suggestion_created",
|
|
14
13
|
"suggestion_published",
|
|
@@ -30,7 +29,6 @@ var SCHEDULE_INTERVAL_MS = Object.freeze({ daily: 24 * 60 * 60 * 1e3, weekly: 7
|
|
|
30
29
|
var DEFAULT_SKIP_LABELS = Object.freeze(["no-docs", "skip-docs"]);
|
|
31
30
|
var DEFAULT_IGNORE_GLOBS = Object.freeze(["**/*.test.*", "**/__tests__/**", "**/*.lock", "**/node_modules/**", ".github/**"]);
|
|
32
31
|
var DEFAULT_SKIP_AUTHORS = Object.freeze(["*[bot]"]);
|
|
33
|
-
var ENFORCEMENT = Object.freeze({ ownership: "d1_transaction", heads: "d1_transaction", hostname: "d1_transaction", gitConnections: "d1_transaction", webhookDeliveries: "d1_transaction", tombstone: "d1_transaction", jobRelations: "d1_transaction", records: "d1_transaction", sourceBlobs: "r2_ordering", releaseObjects: "r2_ordering" });
|
|
34
32
|
var PR_PREVIEW_IDLE_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
35
33
|
|
|
36
34
|
// ../owner-contract/dist/index.js
|
|
@@ -4085,6 +4083,7 @@ export {
|
|
|
4085
4083
|
GLOBAL_FLAGS,
|
|
4086
4084
|
REQUEST_TEXT_LIMIT,
|
|
4087
4085
|
requireCommitSha,
|
|
4086
|
+
DEFAULT_ORIGIN,
|
|
4088
4087
|
parseOrigin,
|
|
4089
4088
|
createClient,
|
|
4090
4089
|
resolveTarget,
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CLIENT_ERROR_CATEGORIES,
|
|
3
|
+
CLIENT_SCHEMA_VERSION
|
|
4
|
+
} from "./chunk-7OTEK7WQ.js";
|
|
5
|
+
|
|
6
|
+
// src/adapter/errors.ts
|
|
7
|
+
var CliError = class extends Error {
|
|
8
|
+
code;
|
|
9
|
+
server;
|
|
10
|
+
retryable;
|
|
11
|
+
mutation;
|
|
12
|
+
exit;
|
|
13
|
+
limitations;
|
|
14
|
+
recovery;
|
|
15
|
+
data;
|
|
16
|
+
constructor(code, message, options = {}) {
|
|
17
|
+
super(message, options.cause === void 0 ? void 0 : { cause: options.cause });
|
|
18
|
+
this.name = "CliError";
|
|
19
|
+
this.code = code;
|
|
20
|
+
this.server = options.server ?? null;
|
|
21
|
+
this.retryable = options.retryable ?? CLIENT_ERROR_CATEGORIES[code].retryable;
|
|
22
|
+
this.mutation = options.mutation ?? CLIENT_ERROR_CATEGORIES[code].mutation;
|
|
23
|
+
this.exit = options.exit ?? CLIENT_ERROR_CATEGORIES[code].exit;
|
|
24
|
+
this.limitations = options.limitations ?? [];
|
|
25
|
+
this.recovery = options.recovery ?? null;
|
|
26
|
+
this.data = options.data;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
function invalidInput(message, options = {}) {
|
|
30
|
+
return new CliError("invalid_input", message, options);
|
|
31
|
+
}
|
|
32
|
+
function interrupted(message = CLIENT_ERROR_CATEGORIES.interrupted.meaning, options = {}) {
|
|
33
|
+
return new CliError("interrupted", message, options);
|
|
34
|
+
}
|
|
35
|
+
function clientError(code, message, server = null) {
|
|
36
|
+
const category = CLIENT_ERROR_CATEGORIES[code];
|
|
37
|
+
return { code, message, retryable: category.retryable, mutation: category.mutation, exit: category.exit, server };
|
|
38
|
+
}
|
|
39
|
+
function envelope(context) {
|
|
40
|
+
return {
|
|
41
|
+
schema_version: CLIENT_SCHEMA_VERSION,
|
|
42
|
+
command: context.command,
|
|
43
|
+
site_id: context.siteId ?? null,
|
|
44
|
+
ids: context.ids ?? {},
|
|
45
|
+
limitations: [...context.limitations ?? []],
|
|
46
|
+
recovery: context.recovery ?? null
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function successResult(context, data) {
|
|
50
|
+
return { ...envelope(context), ok: true, data };
|
|
51
|
+
}
|
|
52
|
+
function messageOf(error) {
|
|
53
|
+
if (error instanceof Error && error.message !== "") return error.message;
|
|
54
|
+
const text = String(error);
|
|
55
|
+
return text === "" ? "The command failed and said nothing." : text;
|
|
56
|
+
}
|
|
57
|
+
var UNCLASSIFIED = "service_unavailable";
|
|
58
|
+
function failureResult(error, context) {
|
|
59
|
+
const classified = error instanceof CliError;
|
|
60
|
+
const code = classified ? error.code : UNCLASSIFIED;
|
|
61
|
+
const base = envelope({
|
|
62
|
+
...context,
|
|
63
|
+
limitations: [...context.limitations ?? [], ...classified ? error.limitations : []],
|
|
64
|
+
recovery: (classified ? error.recovery : null) ?? context.recovery ?? null
|
|
65
|
+
});
|
|
66
|
+
const failure = {
|
|
67
|
+
...base,
|
|
68
|
+
ok: false,
|
|
69
|
+
error: classified ? {
|
|
70
|
+
code,
|
|
71
|
+
message: messageOf(error),
|
|
72
|
+
retryable: error.retryable,
|
|
73
|
+
mutation: error.mutation,
|
|
74
|
+
exit: error.exit,
|
|
75
|
+
server: error.server
|
|
76
|
+
} : clientError(code, messageOf(error))
|
|
77
|
+
};
|
|
78
|
+
if (classified && error.data !== void 0) failure.data = error.data;
|
|
79
|
+
return failure;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export {
|
|
83
|
+
CliError,
|
|
84
|
+
invalidInput,
|
|
85
|
+
interrupted,
|
|
86
|
+
clientError,
|
|
87
|
+
successResult,
|
|
88
|
+
messageOf,
|
|
89
|
+
failureResult
|
|
90
|
+
};
|