@mainsoft/agent-cms 0.0.0-stage → 0.7.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/CHANGELOG.md +54 -0
- package/LICENSE +21 -0
- package/README.md +359 -2
- package/TODO.md +178 -0
- package/UPGRADE-0.6.md +236 -0
- package/dist/agent.cjs +250 -0
- package/dist/agent.d.cts +88 -0
- package/dist/agent.d.ts +88 -0
- package/dist/agent.js +24 -0
- package/dist/ai.cjs +555 -0
- package/dist/ai.d.cts +48 -0
- package/dist/ai.d.ts +48 -0
- package/dist/ai.js +73 -0
- package/dist/bin.js +1556 -0
- package/dist/chunk-2NTK7H4W.js +10 -0
- package/dist/chunk-52NUUZC7.js +1446 -0
- package/dist/chunk-6K5ZTGHQ.js +30 -0
- package/dist/chunk-AKN7SUXU.js +281 -0
- package/dist/chunk-CRDW6Q72.js +188 -0
- package/dist/chunk-DD56PTZ4.js +78 -0
- package/dist/chunk-DOADAH4L.js +52 -0
- package/dist/chunk-EXV6JNLY.js +251 -0
- package/dist/chunk-IGL2V6US.js +324 -0
- package/dist/chunk-IW3D4I7Q.js +317 -0
- package/dist/chunk-OQ55GEF3.js +6 -0
- package/dist/chunk-QC2M4NZY.js +158 -0
- package/dist/chunk-QQV6VLYJ.js +204 -0
- package/dist/chunk-T66ZKBHF.js +25 -0
- package/dist/chunk-VICZ76TR.js +118 -0
- package/dist/chunk-Y63XQS2J.js +6 -0
- package/dist/cli.cjs +1596 -0
- package/dist/cli.d.cts +89 -0
- package/dist/cli.d.ts +89 -0
- package/dist/cli.js +534 -0
- package/dist/client.cjs +185 -0
- package/dist/client.d.cts +228 -0
- package/dist/client.d.ts +228 -0
- package/dist/client.js +13 -0
- package/dist/cms-BPp01z-8.d.ts +411 -0
- package/dist/cms-D6D89-qZ.d.cts +411 -0
- package/dist/config.cjs +61 -0
- package/dist/config.d.cts +36 -0
- package/dist/config.d.ts +36 -0
- package/dist/config.js +11 -0
- package/dist/diff.cjs +316 -0
- package/dist/diff.d.cts +122 -0
- package/dist/diff.d.ts +122 -0
- package/dist/diff.js +29 -0
- package/dist/drizzle-repo-B1rt7r4j.d.ts +90 -0
- package/dist/drizzle-repo-Cn-kL2FK.d.cts +90 -0
- package/dist/errors.cjs +193 -0
- package/dist/errors.d.cts +109 -0
- package/dist/errors.d.ts +109 -0
- package/dist/errors.js +16 -0
- package/dist/frontmatter.cjs +103 -0
- package/dist/frontmatter.d.cts +32 -0
- package/dist/frontmatter.d.ts +32 -0
- package/dist/frontmatter.js +9 -0
- package/dist/http.cjs +1105 -0
- package/dist/http.d.cts +75 -0
- package/dist/http.d.ts +75 -0
- package/dist/http.js +321 -0
- package/dist/index.cjs +3066 -0
- package/dist/index.d.cts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +263 -0
- package/dist/markdown.cjs +220 -0
- package/dist/markdown.d.cts +88 -0
- package/dist/markdown.d.ts +88 -0
- package/dist/markdown.js +23 -0
- package/dist/mcp.cjs +652 -0
- package/dist/mcp.d.cts +43 -0
- package/dist/mcp.d.ts +43 -0
- package/dist/mcp.js +26 -0
- package/dist/messages/en.cjs +76 -0
- package/dist/messages/en.d.cts +7 -0
- package/dist/messages/en.d.ts +7 -0
- package/dist/messages/en.js +7 -0
- package/dist/messages/ko.cjs +76 -0
- package/dist/messages/ko.d.cts +7 -0
- package/dist/messages/ko.d.ts +7 -0
- package/dist/messages/ko.js +53 -0
- package/dist/registry/cms-audit.json +25 -0
- package/dist/registry/cms-command.json +23 -0
- package/dist/registry/cms-doc-editor.json +36 -0
- package/dist/registry/cms-doc-list.json +29 -0
- package/dist/registry/cms-empty.json +22 -0
- package/dist/registry/cms-keys.json +29 -0
- package/dist/registry/cms-lib.json +33 -0
- package/dist/registry/cms-merge.json +26 -0
- package/dist/registry/cms-shell.json +22 -0
- package/dist/registry/cms-versions.json +26 -0
- package/dist/registry/registry.json +255 -0
- package/dist/repo-BWI2Pkrv.d.ts +162 -0
- package/dist/repo-CeDxUxO6.d.cts +162 -0
- package/dist/tables.cjs +356 -0
- package/dist/tables.d.cts +3515 -0
- package/dist/tables.d.ts +3515 -0
- package/dist/tables.js +35 -0
- package/dist/tools.cjs +420 -0
- package/dist/tools.d.cts +27 -0
- package/dist/tools.d.ts +27 -0
- package/dist/tools.js +18 -0
- package/dist/types.cjs +226 -0
- package/dist/types.d.cts +286 -0
- package/dist/types.d.ts +286 -0
- package/dist/types.js +28 -0
- package/package.json +277 -4
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The markdown subset documents are written in, parsed to a small block tree.
|
|
3
|
+
* Framework-free: the app renders the tree with its own components, so a doc
|
|
4
|
+
* looks native wherever it shows (public page, admin preview, chat).
|
|
5
|
+
*
|
|
6
|
+
* Supported: `## / ###` headings, paragraphs, `-`/`*` and `1.` lists, `>`
|
|
7
|
+
* quotes and `> [!note]` callouts, fenced code, `---`, and inline **bold**,
|
|
8
|
+
* `code`, [text](url) and the CMS link `[[link:key|label]]`.
|
|
9
|
+
*/
|
|
10
|
+
type Inline = {
|
|
11
|
+
t: "text";
|
|
12
|
+
v: string;
|
|
13
|
+
} | {
|
|
14
|
+
t: "strong";
|
|
15
|
+
v: string;
|
|
16
|
+
} | {
|
|
17
|
+
t: "code";
|
|
18
|
+
v: string;
|
|
19
|
+
} | {
|
|
20
|
+
t: "link";
|
|
21
|
+
href: string;
|
|
22
|
+
v: string;
|
|
23
|
+
}
|
|
24
|
+
/** `[[link:key|label]]` — an app screen, resolved by the collection. */
|
|
25
|
+
| {
|
|
26
|
+
t: "applink";
|
|
27
|
+
key: string;
|
|
28
|
+
v: string;
|
|
29
|
+
};
|
|
30
|
+
type Block = {
|
|
31
|
+
t: "heading";
|
|
32
|
+
level: 2 | 3;
|
|
33
|
+
id: string;
|
|
34
|
+
text: string;
|
|
35
|
+
inline: Inline[];
|
|
36
|
+
} | {
|
|
37
|
+
t: "p";
|
|
38
|
+
inline: Inline[];
|
|
39
|
+
} | {
|
|
40
|
+
t: "list";
|
|
41
|
+
ordered: boolean;
|
|
42
|
+
items: Inline[][];
|
|
43
|
+
} | {
|
|
44
|
+
t: "quote";
|
|
45
|
+
callout: "note" | "tip" | "warning" | null;
|
|
46
|
+
blocks: Block[];
|
|
47
|
+
} | {
|
|
48
|
+
t: "code";
|
|
49
|
+
lang: string;
|
|
50
|
+
v: string;
|
|
51
|
+
} | {
|
|
52
|
+
t: "hr";
|
|
53
|
+
}
|
|
54
|
+
/** A paragraph that is only app links: drawn as link cards. */
|
|
55
|
+
| {
|
|
56
|
+
t: "links";
|
|
57
|
+
items: {
|
|
58
|
+
key: string;
|
|
59
|
+
v: string;
|
|
60
|
+
}[];
|
|
61
|
+
};
|
|
62
|
+
interface TocItem {
|
|
63
|
+
id: string;
|
|
64
|
+
text: string;
|
|
65
|
+
level: 2 | 3;
|
|
66
|
+
}
|
|
67
|
+
declare const APP_LINK_RE: RegExp;
|
|
68
|
+
/** Heading anchor: lowercase, spaces → '-', keeps Hangul; stable across renders. */
|
|
69
|
+
declare function anchorOf(text: string): string;
|
|
70
|
+
declare function parseInline(src: string): Inline[];
|
|
71
|
+
declare function inlineText(inline: Inline[]): string;
|
|
72
|
+
declare function parseMarkdown(source: string): Block[];
|
|
73
|
+
declare function extractToc(blocks: Block[]): TocItem[];
|
|
74
|
+
/** Every `[[link:key|…]]` key in a body. */
|
|
75
|
+
declare function appLinkKeys(body: string): string[];
|
|
76
|
+
/** Plain text of a body (for search and summaries): no markup, links as labels. */
|
|
77
|
+
declare function plainText(body: string): string;
|
|
78
|
+
interface Section {
|
|
79
|
+
/** Heading anchor, or "" for the text before the first heading. */
|
|
80
|
+
anchor: string;
|
|
81
|
+
heading: string;
|
|
82
|
+
/** Markdown of the section (heading line excluded). */
|
|
83
|
+
markdown: string;
|
|
84
|
+
}
|
|
85
|
+
/** Split a body at `##` headings (### stays inside its section). */
|
|
86
|
+
declare function splitSections(body: string): Section[];
|
|
87
|
+
|
|
88
|
+
export { APP_LINK_RE, type Block, type Inline, type Section, type TocItem, anchorOf, appLinkKeys, extractToc, inlineText, parseInline, parseMarkdown, plainText, splitSections };
|
package/dist/markdown.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
APP_LINK_RE,
|
|
3
|
+
anchorOf,
|
|
4
|
+
appLinkKeys,
|
|
5
|
+
extractToc,
|
|
6
|
+
inlineText,
|
|
7
|
+
parseInline,
|
|
8
|
+
parseMarkdown,
|
|
9
|
+
plainText,
|
|
10
|
+
splitSections
|
|
11
|
+
} from "./chunk-CRDW6Q72.js";
|
|
12
|
+
import "./chunk-2NTK7H4W.js";
|
|
13
|
+
export {
|
|
14
|
+
APP_LINK_RE,
|
|
15
|
+
anchorOf,
|
|
16
|
+
appLinkKeys,
|
|
17
|
+
extractToc,
|
|
18
|
+
inlineText,
|
|
19
|
+
parseInline,
|
|
20
|
+
parseMarkdown,
|
|
21
|
+
plainText,
|
|
22
|
+
splitSections
|
|
23
|
+
};
|