@docsworth/cli 0.0.0-stage → 0.3.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 +55 -0
- package/README.md +238 -2
- package/dist/cli.d.ts +11 -0
- package/dist/cli.js +458 -0
- package/dist/core/acl.d.ts +37 -0
- package/dist/core/acl.js +136 -0
- package/dist/core/adopt.d.ts +68 -0
- package/dist/core/adopt.js +665 -0
- package/dist/core/audit-log.d.ts +133 -0
- package/dist/core/audit-log.js +290 -0
- package/dist/core/blocks.d.ts +35 -0
- package/dist/core/blocks.js +417 -0
- package/dist/core/codeowners.d.ts +62 -0
- package/dist/core/codeowners.js +133 -0
- package/dist/core/config.d.ts +101 -0
- package/dist/core/config.js +175 -0
- package/dist/core/coverage.d.ts +25 -0
- package/dist/core/coverage.js +41 -0
- package/dist/core/duration.d.ts +20 -0
- package/dist/core/duration.js +60 -0
- package/dist/core/edits.d.ts +13 -0
- package/dist/core/edits.js +20 -0
- package/dist/core/errors.d.ts +11 -0
- package/dist/core/errors.js +13 -0
- package/dist/core/frontmatter.d.ts +29 -0
- package/dist/core/frontmatter.js +49 -0
- package/dist/core/gate.d.ts +17 -0
- package/dist/core/gate.js +25 -0
- package/dist/core/gfm.d.ts +13 -0
- package/dist/core/gfm.js +244 -0
- package/dist/core/github.d.ts +152 -0
- package/dist/core/github.js +234 -0
- package/dist/core/host.d.ts +125 -0
- package/dist/core/host.js +22 -0
- package/dist/core/identity.d.ts +39 -0
- package/dist/core/identity.js +127 -0
- package/dist/core/init.d.ts +25 -0
- package/dist/core/init.js +86 -0
- package/dist/core/links.d.ts +82 -0
- package/dist/core/links.js +345 -0
- package/dist/core/lint.d.ts +16 -0
- package/dist/core/lint.js +149 -0
- package/dist/core/mcp/audit-transport.d.ts +16 -0
- package/dist/core/mcp/audit-transport.js +238 -0
- package/dist/core/mcp/server.d.ts +19 -0
- package/dist/core/mcp/server.js +216 -0
- package/dist/core/mcp/text.d.ts +14 -0
- package/dist/core/mcp/text.js +43 -0
- package/dist/core/mirror-view.d.ts +68 -0
- package/dist/core/mirror-view.js +367 -0
- package/dist/core/new-page.d.ts +52 -0
- package/dist/core/new-page.js +49 -0
- package/dist/core/policy.d.ts +10 -0
- package/dist/core/policy.js +30 -0
- package/dist/core/polish.d.ts +42 -0
- package/dist/core/polish.js +1000 -0
- package/dist/core/printable.d.ts +4 -0
- package/dist/core/printable.js +16 -0
- package/dist/core/references.d.ts +87 -0
- package/dist/core/references.js +1744 -0
- package/dist/core/repo.d.ts +46 -0
- package/dist/core/repo.js +118 -0
- package/dist/core/schema.d.ts +50 -0
- package/dist/core/schema.js +51 -0
- package/dist/core/search.d.ts +32 -0
- package/dist/core/search.js +132 -0
- package/dist/core/serve/auth.d.ts +23 -0
- package/dist/core/serve/auth.js +38 -0
- package/dist/core/serve/server.d.ts +21 -0
- package/dist/core/serve/server.js +138 -0
- package/dist/core/serve/sessions.d.ts +40 -0
- package/dist/core/serve/sessions.js +203 -0
- package/dist/core/serve/token.d.ts +10 -0
- package/dist/core/serve/token.js +96 -0
- package/dist/core/service.d.ts +473 -0
- package/dist/core/service.js +973 -0
- package/dist/core/sla.d.ts +16 -0
- package/dist/core/sla.js +20 -0
- package/dist/core/stale.d.ts +16 -0
- package/dist/core/stale.js +24 -0
- package/dist/core/tool-registry.d.ts +31 -0
- package/dist/core/tool-registry.js +80 -0
- package/dist/core/url.d.ts +4 -0
- package/dist/core/url.js +31 -0
- package/dist/core/verify-pages.d.ts +19 -0
- package/dist/core/verify-pages.js +110 -0
- package/dist/core/version.d.ts +22 -0
- package/dist/core/version.js +32 -0
- package/dist/core/writes.d.ts +58 -0
- package/dist/core/writes.js +113 -0
- package/dist/web/assets/index-8J-FUbb0.js +29 -0
- package/dist/web/assets/index-BGpAZzeM.css +1 -0
- package/dist/web/index.html +14 -0
- package/docs/format-spec.md +349 -0
- package/package.json +75 -4
- package/plugin/.claude-plugin/plugin.json +8 -0
- package/plugin/.mcp.json +8 -0
- package/plugin/bin/docsworth-mcp.mjs +46 -0
- package/plugin/skills/draft-runbook/SKILL.md +75 -0
- package/plugin/skills/polish-page/SKILL.md +64 -0
- package/plugin/skills/update-after-incident/SKILL.md +59 -0
- package/plugin/skills/verify-page/SKILL.md +46 -0
- package/templates/github/knowledge.yml +51 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type Config } from "./config.js";
|
|
2
|
+
import { UserError } from "./errors.js";
|
|
3
|
+
import { unprefixed } from "./links.js";
|
|
4
|
+
export { unprefixed };
|
|
5
|
+
export declare class AdoptError extends UserError {
|
|
6
|
+
}
|
|
7
|
+
export interface AdoptOptions {
|
|
8
|
+
now: Date;
|
|
9
|
+
/** The owning team where CODEOWNERS doesn't name exactly one. */
|
|
10
|
+
team?: string;
|
|
11
|
+
/** `review_every` for pages without one (default 90d). */
|
|
12
|
+
reviewEvery?: string;
|
|
13
|
+
/** Report, and write nothing. */
|
|
14
|
+
dryRun?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface AdoptResult {
|
|
17
|
+
dryRun: boolean;
|
|
18
|
+
/** Pages adopt changed (or would, on a dry run). */
|
|
19
|
+
adopted: string[];
|
|
20
|
+
/** Pages it had nothing to change on. */
|
|
21
|
+
unchanged: string[];
|
|
22
|
+
/** Pages, and symbolic links, it left as they are, and why. */
|
|
23
|
+
left: {
|
|
24
|
+
path: string;
|
|
25
|
+
reason: string;
|
|
26
|
+
}[];
|
|
27
|
+
/** What the team still has to do: a CODEOWNERS line, say. */
|
|
28
|
+
hints: string[];
|
|
29
|
+
/** Route links rewritten to relative `.md` links (R2). */
|
|
30
|
+
linksRewritten: number;
|
|
31
|
+
/** Links lint fails that adopt couldn't rewrite, as written, and why. */
|
|
32
|
+
linksLeft: {
|
|
33
|
+
path: string;
|
|
34
|
+
link: string;
|
|
35
|
+
why: string;
|
|
36
|
+
}[];
|
|
37
|
+
/** Keys added to the config's `frontmatter.extra_fields`: the adopted pages' unknown keys (R3). */
|
|
38
|
+
extraFields: string[];
|
|
39
|
+
}
|
|
40
|
+
/** The repo, its config and its knowledge root, by real path, each checked to be inside the repo (R9). */
|
|
41
|
+
export interface RepoPaths {
|
|
42
|
+
repo: string;
|
|
43
|
+
config: Config;
|
|
44
|
+
configPath: string;
|
|
45
|
+
knowledge: string;
|
|
46
|
+
}
|
|
47
|
+
/** Whether `child` is `parent` or under it, by path components (so `/repo-other` isn't under `/repo`). */
|
|
48
|
+
export declare function within(parent: string, child: string): boolean;
|
|
49
|
+
/** R9's checks, before any page is read: the config and the knowledge root are inside the repo. */
|
|
50
|
+
export declare function repoPaths(root: string, Err?: new (m: string) => Error, verb?: string): RepoPaths;
|
|
51
|
+
/**
|
|
52
|
+
* Why a file with other hard links is left, or null: the other path could be anywhere,
|
|
53
|
+
* outside the repo too, and a write here would change the file there (R9).
|
|
54
|
+
*/
|
|
55
|
+
export declare function hardLinked(abs: string, verb: string): string | null;
|
|
56
|
+
/** Why a symbolic link in the knowledge root is left. */
|
|
57
|
+
export declare const symlinkReason: (verb: string) => string;
|
|
58
|
+
/**
|
|
59
|
+
* The knowledge root's pages, as the loader finds them (directories starting with a dot
|
|
60
|
+
* skipped), by real path. It follows no symbolic link: the loader reads none, and a link is
|
|
61
|
+
* the one way a walk could leave the root (R9). A link that names a page or a directory is
|
|
62
|
+
* reported.
|
|
63
|
+
*/
|
|
64
|
+
export declare function walk(dir: string, out: {
|
|
65
|
+
files: string[];
|
|
66
|
+
symlinks: string[];
|
|
67
|
+
}): void;
|
|
68
|
+
export declare function adoptRepo(root: string, opts: AdoptOptions): AdoptResult;
|