@docsworth/cli 0.0.0-stage → 0.2.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 +186 -2
- package/dist/cli.d.ts +11 -0
- package/dist/cli.js +409 -0
- package/dist/core/acl.d.ts +28 -0
- package/dist/core/acl.js +102 -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 +96 -0
- package/dist/core/config.js +131 -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/errors.d.ts +11 -0
- package/dist/core/errors.js +13 -0
- package/dist/core/frontmatter.d.ts +17 -0
- package/dist/core/frontmatter.js +40 -0
- package/dist/core/gate.d.ts +17 -0
- package/dist/core/gate.js +25 -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/lint.d.ts +17 -0
- package/dist/core/lint.js +115 -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 +207 -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/references.d.ts +52 -0
- package/dist/core/references.js +1242 -0
- package/dist/core/repo.d.ts +42 -0
- package/dist/core/repo.js +116 -0
- package/dist/core/schema.d.ts +46 -0
- package/dist/core/schema.js +49 -0
- package/dist/core/search.d.ts +24 -0
- package/dist/core/search.js +98 -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 +22 -0
- package/dist/core/serve/server.js +138 -0
- package/dist/core/serve/sessions.d.ts +39 -0
- package/dist/core/serve/sessions.js +130 -0
- package/dist/core/serve/token.d.ts +10 -0
- package/dist/core/serve/token.js +96 -0
- package/dist/core/service.d.ts +375 -0
- package/dist/core/service.js +815 -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 +23 -0
- package/dist/core/tool-registry.d.ts +31 -0
- package/dist/core/tool-registry.js +77 -0
- package/dist/core/url.d.ts +4 -0
- package/dist/core/url.js +31 -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-BglLMIyN.css +1 -0
- package/dist/web/assets/index-DugFPoRu.js +25 -0
- package/dist/web/index.html +14 -0
- package/docs/format-spec.md +311 -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,52 @@
|
|
|
1
|
+
import type { Page, Repo } from "./repo.js";
|
|
2
|
+
/**
|
|
3
|
+
* HTML's named character references that hold an ASCII character: all 49 of them. Every
|
|
4
|
+
* other name stands for non-ASCII characters only. test/references.test.ts checks this
|
|
5
|
+
* table against the `entities` package.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ASCII_REFERENCES: Readonly<Record<string, string>>;
|
|
8
|
+
/**
|
|
9
|
+
* HTML's named references to invisible format characters only (soft hyphen, zero-width
|
|
10
|
+
* space and joiners, word joiner, bidi marks): all 17. The rendered view drops them.
|
|
11
|
+
* test/references.test.ts checks this list against the `entities` package.
|
|
12
|
+
*/
|
|
13
|
+
export declare const INVISIBLE_REFERENCES: ReadonlySet<string>;
|
|
14
|
+
/** The pages `who` can't see, as a sweep reads names. Built once per repo and audience. */
|
|
15
|
+
export interface PageNames {
|
|
16
|
+
/** The knowledge root, without a trailing slash. */
|
|
17
|
+
root: string;
|
|
18
|
+
/** Skeleton of each repo path → whether it's hidden (hidden wins a collision). */
|
|
19
|
+
paths: Map<string, boolean>;
|
|
20
|
+
/** The same for each path under the knowledge root, when it has two segments or more. */
|
|
21
|
+
under: Map<string, boolean>;
|
|
22
|
+
/** Skeletons of hidden pages' file names, by length. */
|
|
23
|
+
names: Map<number, Set<string>>;
|
|
24
|
+
/** For each such file name, the hidden pages' repo paths. */
|
|
25
|
+
spelled: Map<string, string[]>;
|
|
26
|
+
/** For each such file name, the hidden pages' paths under the root (two segments or more). */
|
|
27
|
+
spelledUnder: Map<string, string[]>;
|
|
28
|
+
/** The most segments in a repo path: a longer tail can't name one. */
|
|
29
|
+
depth: number;
|
|
30
|
+
/** The knowledge repo's URL prefixes on GitHub (`github.com/acme/knowledge/`), if it's there. */
|
|
31
|
+
repoUrls: string[];
|
|
32
|
+
/** The same, folded as rendered text (`foldRendered`), for the rendered view. */
|
|
33
|
+
rendered?: PageNames;
|
|
34
|
+
}
|
|
35
|
+
export declare function pageNames(repo: Repo, hidden: (page: Page) => boolean): PageNames;
|
|
36
|
+
/**
|
|
37
|
+
* Whether a link destination, as written on page `from`, leads to a hidden page: one
|
|
38
|
+
* that resolves to it, or a URL that ends with its path. A path under the knowledge root
|
|
39
|
+
* that is no loaded page fails closed: a page that didn't load has no trustworthy ACL.
|
|
40
|
+
* `html` for an attribute in raw HTML, where backslash escapes don't apply.
|
|
41
|
+
*/
|
|
42
|
+
export declare function destinationHides(dest: string, from: string, names: PageNames, html?: boolean): boolean;
|
|
43
|
+
/** The lines of `text`, on page `from`, that name a hidden page: see the module comment. */
|
|
44
|
+
export declare function namingLines(text: string, from: string, names: PageNames, depth?: number, inherited?: string[]): Set<number>;
|
|
45
|
+
/**
|
|
46
|
+
* The lines of `text` where `find`, run over each view the sweep reads (as prose and
|
|
47
|
+
* joined, with and without CommonMark's escapes, and as rendered), reports a span. For
|
|
48
|
+
* names that aren't paths: a mirrored page's id, say.
|
|
49
|
+
*/
|
|
50
|
+
export declare function linesWhere(text: string, find: (view: string, cased: string) => Iterable<[number, number]>, depth?: number, inherited?: string[]): Set<number>;
|
|
51
|
+
/** `text` with each line in `lines` replaced by its container markers and `placeholder`. */
|
|
52
|
+
export declare function replaceLines(text: string, lines: Set<number>, placeholder: string): string;
|