htmlcraft 0.0.0-stage → 0.1.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 +21 -0
- package/README.md +77 -2
- package/SECURITY.md +32 -0
- package/THIRD-PARTY-LICENSES.md +1401 -0
- package/dist/cli.js +108625 -0
- package/dist/editor/assets/index-BklY9zS4.css +1 -0
- package/dist/editor/assets/index-CcXgWYEN.js +737 -0
- package/dist/editor/index.html +57 -0
- package/dist/mcp.js +99001 -0
- package/dist/skill/SKILL.md +254 -0
- package/dist/skill/examples/basic.html +742 -0
- package/dist/skill/examples/notes-transitions.html +736 -0
- package/dist/skill/examples/table-chart.html +754 -0
- package/dist/skill/references/authoring.md +160 -0
- package/dist/skill/references/contract.md +177 -0
- package/dist/skill/references/mcp-tools.md +397 -0
- package/dist/skill/references/troubleshooting.md +188 -0
- package/package.json +51 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 htmlppt contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,78 @@
|
|
|
1
|
-
#
|
|
1
|
+
# htmlcraft
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Visual editor, CLI, and MCP server for self-contained HTML presentations. A deck
|
|
4
|
+
is one HTML file: slides are ordinary DOM elements, styles are ordinary CSS, and
|
|
5
|
+
every object keeps a stable id so the editor and AI agents can address it.
|
|
6
|
+
|
|
7
|
+
This package bundles the editor assets and the `htmlcraft` agent skill, so it works
|
|
8
|
+
without a build step or extra downloads.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install -g htmlcraft
|
|
14
|
+
# or run without installing
|
|
15
|
+
npx -y htmlcraft --help
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## CLI
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx htmlcraft new deck.html --slides 3
|
|
22
|
+
npx htmlcraft validate deck.html
|
|
23
|
+
npx htmlcraft open deck.html
|
|
24
|
+
npx htmlcraft stop deck.html
|
|
25
|
+
npx htmlcraft export deck.html --format html
|
|
26
|
+
npx htmlcraft export deck.html --format pdf
|
|
27
|
+
npx htmlcraft export deck.html --format png --out dist/png
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`htmlcraft open` starts a local editor on `127.0.0.1` with a capability token
|
|
31
|
+
recorded for that deck. Later `open` calls for the same deck reuse the recorded
|
|
32
|
+
port and token, so the printed tokenized URL keeps working across a host
|
|
33
|
+
restart; `htmlcraft stop` rotates the token, and replacing a stale-build host
|
|
34
|
+
rotates it too because `open` stops the broken host first, so a URL bookmarked
|
|
35
|
+
before the replacement needs the newly printed one. The first tokenized visit
|
|
36
|
+
exchanges the token for an HttpOnly, `SameSite=Strict` session cookie with a
|
|
37
|
+
30-day `Max-Age`, so the browser stays signed in to that deck. Add
|
|
38
|
+
`--no-browser` to only print the URL. The editor's
|
|
39
|
+
Export menu writes HTML, PDF, or PNG next to the deck; unsaved edits are also
|
|
40
|
+
mirrored to IndexedDB so a crash can offer recovery. Without a host, the editor
|
|
41
|
+
falls back to upload/download mode. PDF and PNG export use a locally installed
|
|
42
|
+
Chrome, Edge, or Chromium; set `HTMLCRAFT_CHROMIUM` to choose one explicitly. The
|
|
43
|
+
CLI refuses to overwrite the source deck.
|
|
44
|
+
|
|
45
|
+
## MCP
|
|
46
|
+
|
|
47
|
+
Add the server to an MCP client:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"mcpServers": {
|
|
52
|
+
"htmlcraft": {
|
|
53
|
+
"command": "npx",
|
|
54
|
+
"args": ["-y", "htmlcraft", "mcp"]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
If you installed the package globally, `"command": "htmlcraft-mcp"` works too.
|
|
61
|
+
|
|
62
|
+
The server exposes deck tools (`create_deck`, `validate_deck`, `set_text`,
|
|
63
|
+
`open_editor`, and more) plus the `htmlcraft://contract` and
|
|
64
|
+
`htmlcraft://authoring` resources. Reference material ships in `dist/skill/`.
|
|
65
|
+
|
|
66
|
+
## Requirements
|
|
67
|
+
|
|
68
|
+
- Node.js 20 or newer.
|
|
69
|
+
- Chrome, Edge, or Chromium for PDF/PNG export; set `HTMLCRAFT_CHROMIUM` to choose
|
|
70
|
+
one explicitly.
|
|
71
|
+
- No telemetry and no remote calls: the editor and MCP server only touch the
|
|
72
|
+
deck you open.
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
MIT. See [LICENSE](LICENSE); third-party notices are in
|
|
77
|
+
[THIRD-PARTY-LICENSES.md](THIRD-PARTY-LICENSES.md); report vulnerabilities as
|
|
78
|
+
described in [SECURITY.md](SECURITY.md).
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
htmlcraft runs locally. The editor host binds to `127.0.0.1` and requires the
|
|
4
|
+
per-deck capability token minted by the first `htmlcraft open`. `open` records the
|
|
5
|
+
token and port in a local credential store and reuses them for that deck until
|
|
6
|
+
`htmlcraft stop` rotates the token. A stale-build replacement rotates it too,
|
|
7
|
+
because `open` stops the broken host first, so a URL bookmarked before the
|
|
8
|
+
replacement needs the newly printed one. The tokenized first visit sets an
|
|
9
|
+
HttpOnly, `SameSite=Strict` session cookie with a 30-day `Max-Age`. It serves
|
|
10
|
+
only the opened deck and the packaged editor assets, and confines HTML/PDF/PNG
|
|
11
|
+
exports to the deck directory. Deck previews use an iframe sandbox without
|
|
12
|
+
script execution; unsaved drafts live only in the editor origin's IndexedDB and
|
|
13
|
+
never contain the session token.
|
|
14
|
+
PDF/PNG rendering runs Chromium with JavaScript disabled and blocks file,
|
|
15
|
+
network-navigation, frame, worker, and script requests. The MCP server uses
|
|
16
|
+
stdio only. Direct mode reads and writes the paths you give it; host-attached
|
|
17
|
+
mode routes through the token-authenticated host. The package has no telemetry
|
|
18
|
+
and makes no remote calls except loading a deck's own image, font, and
|
|
19
|
+
stylesheet assets.
|
|
20
|
+
|
|
21
|
+
See the repository `SECURITY.md` for the full threat model.
|
|
22
|
+
|
|
23
|
+
## Reporting a vulnerability
|
|
24
|
+
|
|
25
|
+
Do not open a public issue for a security problem. Report it privately through
|
|
26
|
+
the repository's GitHub Security Advisories ("Report a vulnerability") with:
|
|
27
|
+
|
|
28
|
+
- the htmlcraft version and operating system,
|
|
29
|
+
- reproduction steps or a minimal deck,
|
|
30
|
+
- the impact you observed.
|
|
31
|
+
|
|
32
|
+
Please allow time for a fix before public disclosure.
|