toolcraft 0.0.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 +91 -0
- package/dist/cli.compile-check.d.ts +1 -0
- package/dist/cli.compile-check.js +26 -0
- package/dist/cli.d.ts +12 -0
- package/dist/cli.js +1312 -0
- package/dist/index.compile-check.d.ts +1 -0
- package/dist/index.compile-check.js +50 -0
- package/dist/index.d.ts +164 -0
- package/dist/index.js +366 -0
- package/dist/mcp.compile-check.d.ts +1 -0
- package/dist/mcp.compile-check.js +26 -0
- package/dist/mcp.d.ts +31 -0
- package/dist/mcp.js +354 -0
- package/dist/number-schema.d.ts +3 -0
- package/dist/number-schema.js +8 -0
- package/dist/renderer.d.ts +5 -0
- package/dist/renderer.js +148 -0
- package/dist/schema-scope.d.ts +4 -0
- package/dist/schema-scope.js +34 -0
- package/dist/sdk.compile-check.d.ts +1 -0
- package/dist/sdk.compile-check.js +79 -0
- package/dist/sdk.d.ts +63 -0
- package/dist/sdk.js +218 -0
- package/node_modules/@poe-code/design-system/dist/acp/components.d.ts +11 -0
- package/node_modules/@poe-code/design-system/dist/acp/components.js +121 -0
- package/node_modules/@poe-code/design-system/dist/acp/index.d.ts +3 -0
- package/node_modules/@poe-code/design-system/dist/acp/index.js +2 -0
- package/node_modules/@poe-code/design-system/dist/acp/writer.d.ts +13 -0
- package/node_modules/@poe-code/design-system/dist/acp/writer.js +21 -0
- package/node_modules/@poe-code/design-system/dist/components/command-errors.d.ts +16 -0
- package/node_modules/@poe-code/design-system/dist/components/command-errors.js +22 -0
- package/node_modules/@poe-code/design-system/dist/components/help-formatter.d.ts +20 -0
- package/node_modules/@poe-code/design-system/dist/components/help-formatter.js +27 -0
- package/node_modules/@poe-code/design-system/dist/components/index.d.ts +10 -0
- package/node_modules/@poe-code/design-system/dist/components/index.js +7 -0
- package/node_modules/@poe-code/design-system/dist/components/logger.d.ts +11 -0
- package/node_modules/@poe-code/design-system/dist/components/logger.js +60 -0
- package/node_modules/@poe-code/design-system/dist/components/symbols.d.ts +12 -0
- package/node_modules/@poe-code/design-system/dist/components/symbols.js +71 -0
- package/node_modules/@poe-code/design-system/dist/components/table.d.ts +13 -0
- package/node_modules/@poe-code/design-system/dist/components/table.js +74 -0
- package/node_modules/@poe-code/design-system/dist/components/text.d.ts +14 -0
- package/node_modules/@poe-code/design-system/dist/components/text.js +104 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/ansi.d.ts +18 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/ansi.js +298 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/buffer.d.ts +25 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/buffer.js +189 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/components/border.d.ts +9 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/components/border.js +123 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/components/footer.d.ts +8 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/components/footer.js +57 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/components/output-pane.d.ts +12 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/components/output-pane.js +254 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/components/stats-pane.d.ts +7 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/components/stats-pane.js +121 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/dashboard.d.ts +20 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/dashboard.js +167 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/demo.d.ts +13 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/demo.js +145 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/index.d.ts +8 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/index.js +4 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/keymap.d.ts +3 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/keymap.js +99 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/layout.d.ts +25 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/layout.js +79 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/should-use-dashboard.d.ts +10 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/should-use-dashboard.js +7 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/snapshot.d.ts +10 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/snapshot.js +68 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/store.d.ts +8 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/store.js +51 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/terminal.d.ts +37 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/terminal.js +233 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/types.d.ts +36 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/types.js +1 -0
- package/node_modules/@poe-code/design-system/dist/index.d.ts +33 -0
- package/node_modules/@poe-code/design-system/dist/index.js +31 -0
- package/node_modules/@poe-code/design-system/dist/internal/output-format.d.ts +6 -0
- package/node_modules/@poe-code/design-system/dist/internal/output-format.js +22 -0
- package/node_modules/@poe-code/design-system/dist/internal/strip-ansi.d.ts +1 -0
- package/node_modules/@poe-code/design-system/dist/internal/strip-ansi.js +3 -0
- package/node_modules/@poe-code/design-system/dist/internal/theme-detect.d.ts +11 -0
- package/node_modules/@poe-code/design-system/dist/internal/theme-detect.js +49 -0
- package/node_modules/@poe-code/design-system/dist/prompts/index.d.ts +66 -0
- package/node_modules/@poe-code/design-system/dist/prompts/index.js +132 -0
- package/node_modules/@poe-code/design-system/dist/prompts/primitives/cancel.d.ts +2 -0
- package/node_modules/@poe-code/design-system/dist/prompts/primitives/cancel.js +9 -0
- package/node_modules/@poe-code/design-system/dist/prompts/primitives/intro.d.ts +1 -0
- package/node_modules/@poe-code/design-system/dist/prompts/primitives/intro.js +15 -0
- package/node_modules/@poe-code/design-system/dist/prompts/primitives/log.d.ts +18 -0
- package/node_modules/@poe-code/design-system/dist/prompts/primitives/log.js +101 -0
- package/node_modules/@poe-code/design-system/dist/prompts/primitives/note.d.ts +1 -0
- package/node_modules/@poe-code/design-system/dist/prompts/primitives/note.js +39 -0
- package/node_modules/@poe-code/design-system/dist/prompts/primitives/outro.d.ts +1 -0
- package/node_modules/@poe-code/design-system/dist/prompts/primitives/outro.js +16 -0
- package/node_modules/@poe-code/design-system/dist/prompts/primitives/spinner.d.ts +6 -0
- package/node_modules/@poe-code/design-system/dist/prompts/primitives/spinner.js +74 -0
- package/node_modules/@poe-code/design-system/dist/prompts/theme.d.ts +11 -0
- package/node_modules/@poe-code/design-system/dist/prompts/theme.js +12 -0
- package/node_modules/@poe-code/design-system/dist/static/index.d.ts +4 -0
- package/node_modules/@poe-code/design-system/dist/static/index.js +2 -0
- package/node_modules/@poe-code/design-system/dist/static/menu.d.ts +11 -0
- package/node_modules/@poe-code/design-system/dist/static/menu.js +36 -0
- package/node_modules/@poe-code/design-system/dist/static/spinner.d.ts +14 -0
- package/node_modules/@poe-code/design-system/dist/static/spinner.js +46 -0
- package/node_modules/@poe-code/design-system/dist/terminal-markdown/ast.d.ts +92 -0
- package/node_modules/@poe-code/design-system/dist/terminal-markdown/ast.js +1 -0
- package/node_modules/@poe-code/design-system/dist/terminal-markdown/demo-content.d.ts +2 -0
- package/node_modules/@poe-code/design-system/dist/terminal-markdown/demo-content.js +139 -0
- package/node_modules/@poe-code/design-system/dist/terminal-markdown/index.d.ts +6 -0
- package/node_modules/@poe-code/design-system/dist/terminal-markdown/index.js +8 -0
- package/node_modules/@poe-code/design-system/dist/terminal-markdown/parser/block.d.ts +7 -0
- package/node_modules/@poe-code/design-system/dist/terminal-markdown/parser/block.js +1495 -0
- package/node_modules/@poe-code/design-system/dist/terminal-markdown/parser/frontmatter.d.ts +8 -0
- package/node_modules/@poe-code/design-system/dist/terminal-markdown/parser/frontmatter.js +412 -0
- package/node_modules/@poe-code/design-system/dist/terminal-markdown/parser/inline.d.ts +10 -0
- package/node_modules/@poe-code/design-system/dist/terminal-markdown/parser/inline.js +1166 -0
- package/node_modules/@poe-code/design-system/dist/terminal-markdown/parser.d.ts +5 -0
- package/node_modules/@poe-code/design-system/dist/terminal-markdown/parser.js +42 -0
- package/node_modules/@poe-code/design-system/dist/terminal-markdown/renderer.d.ts +6 -0
- package/node_modules/@poe-code/design-system/dist/terminal-markdown/renderer.js +572 -0
- package/node_modules/@poe-code/design-system/dist/terminal-markdown/testing/theme-render-fixture.d.ts +1 -0
- package/node_modules/@poe-code/design-system/dist/terminal-markdown/testing/theme-render-fixture.js +27 -0
- package/node_modules/@poe-code/design-system/dist/tokens/colors.d.ts +35 -0
- package/node_modules/@poe-code/design-system/dist/tokens/colors.js +34 -0
- package/node_modules/@poe-code/design-system/dist/tokens/index.d.ts +4 -0
- package/node_modules/@poe-code/design-system/dist/tokens/index.js +4 -0
- package/node_modules/@poe-code/design-system/dist/tokens/spacing.d.ts +6 -0
- package/node_modules/@poe-code/design-system/dist/tokens/spacing.js +6 -0
- package/node_modules/@poe-code/design-system/dist/tokens/typography.d.ts +7 -0
- package/node_modules/@poe-code/design-system/dist/tokens/typography.js +8 -0
- package/node_modules/@poe-code/design-system/dist/tokens/widths.d.ts +5 -0
- package/node_modules/@poe-code/design-system/dist/tokens/widths.js +5 -0
- package/node_modules/@poe-code/design-system/package.json +25 -0
- package/package.json +57 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export type MdRange = {
|
|
2
|
+
start: number;
|
|
3
|
+
end: number;
|
|
4
|
+
};
|
|
5
|
+
type MdNodeWithRange = {
|
|
6
|
+
range?: MdRange;
|
|
7
|
+
};
|
|
8
|
+
export type MdNode = MdNodeWithRange & ({
|
|
9
|
+
type: "root";
|
|
10
|
+
children: MdNode[];
|
|
11
|
+
} | {
|
|
12
|
+
type: "heading";
|
|
13
|
+
depth: 1 | 2 | 3 | 4 | 5 | 6;
|
|
14
|
+
children: MdNode[];
|
|
15
|
+
} | {
|
|
16
|
+
type: "paragraph";
|
|
17
|
+
children: MdNode[];
|
|
18
|
+
} | {
|
|
19
|
+
type: "blockquote";
|
|
20
|
+
children: MdNode[];
|
|
21
|
+
} | {
|
|
22
|
+
type: "code";
|
|
23
|
+
lang?: string;
|
|
24
|
+
meta?: string;
|
|
25
|
+
value: string;
|
|
26
|
+
} | {
|
|
27
|
+
type: "list";
|
|
28
|
+
ordered: boolean;
|
|
29
|
+
start?: number;
|
|
30
|
+
children: MdNode[];
|
|
31
|
+
} | {
|
|
32
|
+
type: "listItem";
|
|
33
|
+
checked?: boolean;
|
|
34
|
+
children: MdNode[];
|
|
35
|
+
} | {
|
|
36
|
+
type: "thematicBreak";
|
|
37
|
+
} | {
|
|
38
|
+
type: "table";
|
|
39
|
+
align: Array<"left" | "center" | "right" | null>;
|
|
40
|
+
children: MdNode[];
|
|
41
|
+
} | {
|
|
42
|
+
type: "tableRow";
|
|
43
|
+
children: MdNode[];
|
|
44
|
+
} | {
|
|
45
|
+
type: "tableCell";
|
|
46
|
+
children: MdNode[];
|
|
47
|
+
} | {
|
|
48
|
+
type: "html";
|
|
49
|
+
value: string;
|
|
50
|
+
} | {
|
|
51
|
+
type: "text";
|
|
52
|
+
value: string;
|
|
53
|
+
} | {
|
|
54
|
+
type: "emphasis";
|
|
55
|
+
children: MdNode[];
|
|
56
|
+
} | {
|
|
57
|
+
type: "strong";
|
|
58
|
+
children: MdNode[];
|
|
59
|
+
} | {
|
|
60
|
+
type: "strikethrough";
|
|
61
|
+
children: MdNode[];
|
|
62
|
+
} | {
|
|
63
|
+
type: "inlineCode";
|
|
64
|
+
value: string;
|
|
65
|
+
} | {
|
|
66
|
+
type: "link";
|
|
67
|
+
url: string;
|
|
68
|
+
title?: string;
|
|
69
|
+
children: MdNode[];
|
|
70
|
+
} | {
|
|
71
|
+
type: "image";
|
|
72
|
+
url: string;
|
|
73
|
+
alt: string;
|
|
74
|
+
title?: string;
|
|
75
|
+
} | {
|
|
76
|
+
type: "break";
|
|
77
|
+
} | {
|
|
78
|
+
type: "frontmatter";
|
|
79
|
+
data: Record<string, unknown>;
|
|
80
|
+
} | {
|
|
81
|
+
type: "alert";
|
|
82
|
+
kind: "NOTE" | "TIP" | "IMPORTANT" | "WARNING" | "CAUTION";
|
|
83
|
+
children: MdNode[];
|
|
84
|
+
} | {
|
|
85
|
+
type: "footnoteDefinition";
|
|
86
|
+
label: string;
|
|
87
|
+
children: MdNode[];
|
|
88
|
+
} | {
|
|
89
|
+
type: "footnoteReference";
|
|
90
|
+
label: string;
|
|
91
|
+
});
|
|
92
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
export function getMarkdownDemo(name = "default") {
|
|
2
|
+
switch (name) {
|
|
3
|
+
case "minimal":
|
|
4
|
+
return [
|
|
5
|
+
"# Markdown Minimal",
|
|
6
|
+
"",
|
|
7
|
+
"Quick validation paragraph.",
|
|
8
|
+
"",
|
|
9
|
+
"```ts",
|
|
10
|
+
'console.log("demo");',
|
|
11
|
+
"```"
|
|
12
|
+
].join("\n");
|
|
13
|
+
case "code-blocks":
|
|
14
|
+
return [
|
|
15
|
+
"# Code Blocks",
|
|
16
|
+
"",
|
|
17
|
+
"```ts",
|
|
18
|
+
'const sample = "**still literal**";',
|
|
19
|
+
"",
|
|
20
|
+
"function increment(value: number): number {",
|
|
21
|
+
" return value + 1;",
|
|
22
|
+
"}",
|
|
23
|
+
"",
|
|
24
|
+
'console.log("``` also literal inside code");',
|
|
25
|
+
"```"
|
|
26
|
+
].join("\n");
|
|
27
|
+
case "blockquotes":
|
|
28
|
+
return [
|
|
29
|
+
"# Blockquotes",
|
|
30
|
+
"",
|
|
31
|
+
"> Outer quote",
|
|
32
|
+
"> with a second line for spacing.",
|
|
33
|
+
">",
|
|
34
|
+
"> > Nested quote",
|
|
35
|
+
"> > keeps its own bar prefix.",
|
|
36
|
+
"> >",
|
|
37
|
+
"> > > Deep quote",
|
|
38
|
+
"> > > stays indented."
|
|
39
|
+
].join("\n");
|
|
40
|
+
case "lists":
|
|
41
|
+
return [
|
|
42
|
+
"# Lists",
|
|
43
|
+
"",
|
|
44
|
+
"- unordered item",
|
|
45
|
+
" - nested item",
|
|
46
|
+
" - another nested item",
|
|
47
|
+
"- another unordered item",
|
|
48
|
+
"",
|
|
49
|
+
"1. ordered item",
|
|
50
|
+
"2. ordered item",
|
|
51
|
+
" 1. nested ordered item",
|
|
52
|
+
" 2. another nested ordered item",
|
|
53
|
+
"",
|
|
54
|
+
"- [x] completed task",
|
|
55
|
+
"- [ ] pending task",
|
|
56
|
+
" - [x] nested done task",
|
|
57
|
+
" - [ ] nested pending task"
|
|
58
|
+
].join("\n");
|
|
59
|
+
case "tables":
|
|
60
|
+
return [
|
|
61
|
+
"# Tables",
|
|
62
|
+
"",
|
|
63
|
+
"| Column | Left | Center | Right |",
|
|
64
|
+
"| :----- | :--- | :----: | ----: |",
|
|
65
|
+
"| Alignment | alpha | beta | 42 |",
|
|
66
|
+
"| Separators | left | mid | 9000 |",
|
|
67
|
+
"| Header | visible | x | 7 |"
|
|
68
|
+
].join("\n");
|
|
69
|
+
case "alerts":
|
|
70
|
+
return [
|
|
71
|
+
"# Alerts",
|
|
72
|
+
"",
|
|
73
|
+
"> [!NOTE]",
|
|
74
|
+
"> Note labels use info styling.",
|
|
75
|
+
">",
|
|
76
|
+
"> Wrapped content stays aligned beneath the bar.",
|
|
77
|
+
"",
|
|
78
|
+
"> [!TIP]",
|
|
79
|
+
"> Tip labels use success styling.",
|
|
80
|
+
">",
|
|
81
|
+
"> Multi-line content keeps its indentation.",
|
|
82
|
+
"",
|
|
83
|
+
"> [!IMPORTANT]",
|
|
84
|
+
"> Important labels reuse the info color.",
|
|
85
|
+
">",
|
|
86
|
+
"> The follow-up line stays under the same prefix.",
|
|
87
|
+
"",
|
|
88
|
+
"> [!WARNING]",
|
|
89
|
+
"> Warning labels use warning styling.",
|
|
90
|
+
">",
|
|
91
|
+
"> Additional detail remains aligned.",
|
|
92
|
+
"",
|
|
93
|
+
"> [!CAUTION]",
|
|
94
|
+
"> Caution labels use error styling.",
|
|
95
|
+
">",
|
|
96
|
+
"> The final alert confirms the red variant."
|
|
97
|
+
].join("\n");
|
|
98
|
+
case "default":
|
|
99
|
+
return [
|
|
100
|
+
"# Design System Markdown",
|
|
101
|
+
"",
|
|
102
|
+
"## Overview",
|
|
103
|
+
"",
|
|
104
|
+
"### Renderer Features",
|
|
105
|
+
"",
|
|
106
|
+
"Paragraph with **bold**, *italic*, ~~strikethrough~~, `code span`, a [docs link](https://example.com/docs), an image , and a footnote reference[^demo].",
|
|
107
|
+
"",
|
|
108
|
+
"```ts",
|
|
109
|
+
'const agent = "poe-code";',
|
|
110
|
+
"console.log(agent);",
|
|
111
|
+
"```",
|
|
112
|
+
"",
|
|
113
|
+
"> Outer quote",
|
|
114
|
+
">",
|
|
115
|
+
"> > Nested quote",
|
|
116
|
+
"",
|
|
117
|
+
"- unordered item",
|
|
118
|
+
"- another unordered item",
|
|
119
|
+
"",
|
|
120
|
+
"1. ordered item",
|
|
121
|
+
"2. another ordered item",
|
|
122
|
+
"",
|
|
123
|
+
"- [x] completed task",
|
|
124
|
+
"- [ ] pending task",
|
|
125
|
+
"",
|
|
126
|
+
"| Feature | Alignment | Status |",
|
|
127
|
+
"| :------ | :-------: | -----: |",
|
|
128
|
+
"| Headings | center | Ready |",
|
|
129
|
+
"| Tables | aligned | 100% |",
|
|
130
|
+
"",
|
|
131
|
+
"> [!NOTE]",
|
|
132
|
+
"> Alerts are rendered as styled notes.",
|
|
133
|
+
"",
|
|
134
|
+
"---",
|
|
135
|
+
"",
|
|
136
|
+
"[^demo]: Footnote definition for the markdown demo."
|
|
137
|
+
].join("\n");
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type RenderOptions } from "./renderer.js";
|
|
2
|
+
export type { MdNode } from "./ast.js";
|
|
3
|
+
export { parse } from "./parser.js";
|
|
4
|
+
export { render } from "./renderer.js";
|
|
5
|
+
export type { RenderOptions } from "./renderer.js";
|
|
6
|
+
export declare function renderMarkdown(markdown: string, options?: RenderOptions): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { parse } from "./parser.js";
|
|
2
|
+
import { render } from "./renderer.js";
|
|
3
|
+
export { parse } from "./parser.js";
|
|
4
|
+
export { render } from "./renderer.js";
|
|
5
|
+
export function renderMarkdown(markdown, options) {
|
|
6
|
+
const { ast } = parse(markdown);
|
|
7
|
+
return render(ast, options);
|
|
8
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MdNode, MdRange } from "../ast.js";
|
|
2
|
+
export declare function parseBlocks(input: string): MdNode[];
|
|
3
|
+
export declare function parseBlockDocument(input: string): {
|
|
4
|
+
frontmatter?: Record<string, unknown>;
|
|
5
|
+
frontmatterRange?: MdRange;
|
|
6
|
+
children: MdNode[];
|
|
7
|
+
};
|