rapier-html 1.1.99 → 1.1.102
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/BUILD.json +95 -4
- package/README.md +23 -24
- package/dist/ledger/LICENSE +10 -2
- package/dist/ledger/data.mjs +1 -1
- package/dist/ledger/diff.mjs +610 -0
- package/dist/ledger/format.mjs +12 -5
- package/dist/ledger/hash.mjs +16 -22
- package/dist/ledger/history.mjs +309 -0
- package/dist/ledger/inverse-source.mjs +316 -0
- package/dist/ledger/journal-records.mjs +116 -12
- package/dist/ledger/transport.mjs +123 -19
- package/dist/rapier.html +399 -618
- package/dist/wrap.mjs +28 -4
- package/package.json +1 -1
package/BUILD.json
CHANGED
|
@@ -1,12 +1,103 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "rapier-html",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.102",
|
|
4
4
|
"path": "dist/rapier.html",
|
|
5
|
-
"bytes":
|
|
6
|
-
"sha256": "
|
|
7
|
-
"builtAt": "2026-10-
|
|
5
|
+
"bytes": 3629652,
|
|
6
|
+
"sha256": "b326753f3804e8b1bd1382e062436ce631d774b41da66041427f608c4a16c032",
|
|
7
|
+
"builtAt": "2026-10-11T21:53:14.793Z",
|
|
8
8
|
"node": "v22.23.3",
|
|
9
9
|
"canonical": true,
|
|
10
10
|
"packing": "zopfli",
|
|
11
|
+
"plugins": [
|
|
12
|
+
{
|
|
13
|
+
"id": "math",
|
|
14
|
+
"delivery": "built-in",
|
|
15
|
+
"kind": "script",
|
|
16
|
+
"element": "rapier-plugin-math",
|
|
17
|
+
"bytes": 803451,
|
|
18
|
+
"packedBytes": 544485,
|
|
19
|
+
"files": [
|
|
20
|
+
{
|
|
21
|
+
"id": "rapier-math",
|
|
22
|
+
"name": "rapier-math-1.0.1.js",
|
|
23
|
+
"version": "1.0.1",
|
|
24
|
+
"bytes": 803451,
|
|
25
|
+
"sri": "1kdn6mohx3a5MAiwqRWY+6oviUHUheHfY1VMsxjDsUrn7woTaa7FSKo4juYtuNaF"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "mermaid",
|
|
31
|
+
"delivery": "built-in",
|
|
32
|
+
"kind": "script",
|
|
33
|
+
"element": "rapier-plugin-mermaid",
|
|
34
|
+
"bytes": 294857,
|
|
35
|
+
"packedBytes": 103232,
|
|
36
|
+
"files": [
|
|
37
|
+
{
|
|
38
|
+
"id": "rapier-mermaid",
|
|
39
|
+
"name": "rapier-diagrams-1.1.102.js",
|
|
40
|
+
"version": "1.1.102",
|
|
41
|
+
"bytes": 294857,
|
|
42
|
+
"sri": "fmQHeVOJnX1gwaqVihnI/FFSP8hm+Bh/dLQWQ17yvUAJoF9tFd2d6mY5tZ249t8u"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": "letters",
|
|
48
|
+
"delivery": "built-in",
|
|
49
|
+
"kind": "files",
|
|
50
|
+
"element": "rapier-plugin-letters",
|
|
51
|
+
"bytes": 463027,
|
|
52
|
+
"packedBytes": 204178,
|
|
53
|
+
"files": [
|
|
54
|
+
{
|
|
55
|
+
"id": "rapier-letters-field",
|
|
56
|
+
"name": "field.json",
|
|
57
|
+
"version": "VFsCE/7zS6Kkq/EW1/7NfYHVGoVXNUm0pWHdtJmzXwhWgJWBSKhNHuU0ODuGCar0",
|
|
58
|
+
"bytes": 96902,
|
|
59
|
+
"sri": "VFsCE/7zS6Kkq/EW1/7NfYHVGoVXNUm0pWHdtJmzXwhWgJWBSKhNHuU0ODuGCar0"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"id": "rapier-letters-relief",
|
|
63
|
+
"name": "relief.json",
|
|
64
|
+
"version": "tQctBake2gu7B/v5/1jC6XFt5smV5uVg7W7GdJXsJZBZ62Zc7crSP3zRkZPgQqgq",
|
|
65
|
+
"bytes": 95172,
|
|
66
|
+
"sri": "tQctBake2gu7B/v5/1jC6XFt5smV5uVg7W7GdJXsJZBZ62Zc7crSP3zRkZPgQqgq"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "rapier-letters-leaf",
|
|
70
|
+
"name": "leaf.json",
|
|
71
|
+
"version": "DtSKWtWhiitlNOfjx9o5Jf0FYcpWLw4nmWAjo1eAA3FOvs2OjB2hddHlRCnrtZ7g",
|
|
72
|
+
"bytes": 134918,
|
|
73
|
+
"sri": "DtSKWtWhiitlNOfjx9o5Jf0FYcpWLw4nmWAjo1eAA3FOvs2OjB2hddHlRCnrtZ7g"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"id": "rapier-letters-arabesque",
|
|
77
|
+
"name": "arabesque.json",
|
|
78
|
+
"version": "Zx2z2bEpD4VNkIccLejcUY68eqAFraPEN7hqsqkcVqHOKGvsSMqbLLiXXklvZINl",
|
|
79
|
+
"bytes": 136035,
|
|
80
|
+
"sri": "Zx2z2bEpD4VNkIccLejcUY68eqAFraPEN7hqsqkcVqHOKGvsSMqbLLiXXklvZINl"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"id": "font-subset",
|
|
86
|
+
"delivery": "built-in",
|
|
87
|
+
"kind": "files",
|
|
88
|
+
"element": "rapier-plugin-font-subset",
|
|
89
|
+
"bytes": 1214356,
|
|
90
|
+
"packedBytes": 453061,
|
|
91
|
+
"files": [
|
|
92
|
+
{
|
|
93
|
+
"id": "rapier-font-subset",
|
|
94
|
+
"name": "rapier-font-subset-2.js",
|
|
95
|
+
"version": "2",
|
|
96
|
+
"bytes": 1214356,
|
|
97
|
+
"sri": "q4mHA3+u3N3Yt8z1wisCEXQqWNo5UhHZ0nUESid8BGNZz6BtV8dSUlVOvyndc0Tj"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
],
|
|
11
102
|
"validation": "a release build; not a browser test"
|
|
12
103
|
}
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Turn Markdown into one offline HTML file with the full Rapier editor. It opens in any browser on a phone or
|
|
4
4
|
computer, with no account. People read, edit, draw and paint watercolor. Agents deliver documents, show what
|
|
5
|
-
changed and receive the person's edited copy through the door. Start with `npx rapier-html@1.1.
|
|
5
|
+
changed and receive the person's edited copy through the door. Start with `npx rapier-html@1.1.102 notes.md`.
|
|
6
6
|
|
|
7
7
|
Use it for a plan to rearrange, an illustrated guide to annotate, a draft to continue writing, or a revision
|
|
8
8
|
to review. Text and drawings stay editable, and the file remains usable independently of a hosted workspace.
|
|
@@ -18,21 +18,21 @@ to review. Text and drawings stay editable, and the file remains usable independ
|
|
|
18
18
|
Node 22 or newer.
|
|
19
19
|
|
|
20
20
|
```sh
|
|
21
|
-
npx -- rapier-html@1.1.
|
|
22
|
-
npx -- rapier-html@1.1.
|
|
23
|
-
npx -- rapier-html@1.1.
|
|
24
|
-
npx -- rapier-html@1.1.
|
|
25
|
-
npx -- rapier-html@1.1.
|
|
26
|
-
npx -- rapier-html@1.1.
|
|
27
|
-
npx -- rapier-html@1.1.
|
|
28
|
-
npm install rapier-html@1.1.
|
|
21
|
+
npx -- rapier-html@1.1.102 notes.md # the editor, notes.md inside it, written beside the file
|
|
22
|
+
npx -- rapier-html@1.1.102 notes.md --view draw # opens on Draw: sketch and paint, the document behind it
|
|
23
|
+
npx -- rapier-html@1.1.102 notes.md --view notes # opens the Notes library
|
|
24
|
+
npx -- rapier-html@1.1.102 notes.md --drawing sketch.svg # carries a drawing, opened on Draw over the document
|
|
25
|
+
npx -- rapier-html@1.1.102 revised.md --compare original.md # opens showing what changed
|
|
26
|
+
npx -- rapier-html@1.1.102 notes.md --return "$RETURN_URL" --return-expires-at "$RETURN_EXPIRES_AT" # Send back
|
|
27
|
+
npx -- rapier-html@1.1.102 notes.md out.html # a named output
|
|
28
|
+
npm install rapier-html@1.1.102 # as a library: wrap, unwrap
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
The first `--` is for npm, so `--help` reaches the command. It never overwrites a file.
|
|
32
32
|
|
|
33
33
|
For live shared editing, open the document through Rapier's MCP tools. The agent edits beside the person or
|
|
34
34
|
while they are away. Rapier shows its presence and change marks; the person taps a change to see the before
|
|
35
|
-
and undoes anything. Use `comparison
|
|
35
|
+
and undoes anything. Use `show {target:"comparison"}` to show a diff deliberately. Export Markdown or an offline
|
|
36
36
|
editor when the result needs an independent copy. Send back returns the edited copy alongside the hosted
|
|
37
37
|
document, preserving both.
|
|
38
38
|
|
|
@@ -44,10 +44,10 @@ Rapier is a phone-first Markdown editor for notes, diagrams, drawing and waterco
|
|
|
44
44
|
as one HTML file on Android, Web and Windows.
|
|
45
45
|
Collaborate over MCP and WebMCP, use optional encrypted sync to your own Cloudflare account, or embed the
|
|
46
46
|
editor and lightweight reader (about 190 kB gzipped). The agent edits live; the person sees its presence and
|
|
47
|
-
changes, taps a change to see the before and undoes anything. Use `comparison
|
|
47
|
+
changes, taps a change to see the before and undoes anything. Use `show {target:"comparison"}` to show a diff deliberately.
|
|
48
48
|
|
|
49
|
-
1. **Work together live.** Connect to `https://mcp.rapier.website/mcp`, then call `
|
|
50
|
-
2. **Deliver an offline editor.** Run `npx rapier-html@1.1.
|
|
49
|
+
1. **Work together live.** Connect to `https://mcp.rapier.website/mcp`, then call `open` to share one document with the person.
|
|
50
|
+
2. **Deliver an offline editor.** Run `npx rapier-html@1.1.102 notes.md` to put the document and editor in one HTML file ([rapier-html](https://github.com/jackskip22/rapier-plugins/tree/main/npm/rapier-html)).
|
|
51
51
|
3. **Embed in your app.** Install [rapier-embed](https://github.com/jackskip22/rapier-plugins/tree/main/npm/rapier-embed); mount the editor or reader, with your app's agent over WebMCP in the editor.
|
|
52
52
|
4. **Keep portable Markdown.** Use [rapier-markdown-kit](https://github.com/jackskip22/rapier-plugins/tree/main/npm/rapier-markdown-kit) for pictures, editable SVG drawings and layout in one `.md` file. Respect [Will/1](https://github.com/jackskip22/will) `keep`, `append` and `edit` regions.
|
|
53
53
|
5. **Encode JPEG XL.** Install [rapier-jxl](https://github.com/jackskip22/rapier-jxl) to encode pixels, photographs and existing JPEGs in JavaScript.
|
|
@@ -55,7 +55,7 @@ changes, taps a change to see the before and undoes anything. Use `comparison.pr
|
|
|
55
55
|
|
|
56
56
|
## Send an edited document back
|
|
57
57
|
|
|
58
|
-
Call `
|
|
58
|
+
Call `show {target:"return"}` on the Rapier agent door for the document's workspace and pass its `return_url`
|
|
59
59
|
and `return_expires_at` as `--return "$RETURN_URL" --return-expires-at "$RETURN_EXPIRES_AT"`, or
|
|
60
60
|
`wrap(..., {return: return_url, return_expires_at})`. Only the worker's HTTPS return route at
|
|
61
61
|
`https://mcp.rapier.website/return/…` is accepted. The page then shows Send back in Share; a page without an
|
|
@@ -63,14 +63,13 @@ address has no such action.
|
|
|
63
63
|
|
|
64
64
|
The person edits offline and presses Send back: the current source and filename go once, the page shows the
|
|
65
65
|
acceptance or the worker's refusal, and it sends nothing again. The return lasts up to one day, takes one
|
|
66
|
-
document
|
|
66
|
+
document with a 64 MiB decoded-source ceiling, subject to the workspace’s remaining storage quota, and grants no
|
|
67
|
+
access to the agent's workspace. After the expiry, or a refusal, Share offers
|
|
67
68
|
Save instead; bring that file back to the assistant for a fresh return.
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
`
|
|
71
|
-
|
|
72
|
-
to continue until complete. The returned copy stays separate from the workspace's
|
|
73
|
-
current document.
|
|
70
|
+
`show {target:"ask",wait:"message"}` returns a `returned` receipt with the `return_id`, name and time;
|
|
71
|
+
`read {state:true}` lists returned-copy receipts. Use `read {return_id}` for the source, then `cursor`
|
|
72
|
+
alone to continue until complete. The returned copy stays separate from the workspace's current document.
|
|
74
73
|
|
|
75
74
|
## As a library
|
|
76
75
|
|
|
@@ -112,10 +111,10 @@ Send back.
|
|
|
112
111
|
- It never overwrites: an existing output, the document itself included, is refused, as are unknown options, a
|
|
113
112
|
`--view` other than `draw` or `notes`, a `--drawing` or `--compare` with no file, a return without its expiry, an
|
|
114
113
|
invalid expiry, an unsafe return URL and a third filename.
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
Send back
|
|
118
|
-
are refused.
|
|
114
|
+
- Opening and rendering use carried resources; the page cannot fetch pictures, media, fonts or plug-ins.
|
|
115
|
+
The staged editor includes verified math, Mermaid and lettering resources. Embed any document pictures.
|
|
116
|
+
An explicit Send back connects only to the minted return origin. Its URL names the worker's exact route;
|
|
117
|
+
credentials, query strings and fragments are refused.
|
|
119
118
|
|
|
120
119
|
## Optional edit history
|
|
121
120
|
|
package/dist/ledger/LICENSE
CHANGED
|
@@ -22,7 +22,9 @@ SOFTWARE.
|
|
|
22
22
|
|
|
23
23
|
Files under this licence carry `SPDX-License-Identifier: MIT` in their first lines: the standard's
|
|
24
24
|
grammar, marks and reference style (`spec/md-layout.mjs`, `spec/md-marks.mjs`, `spec/flowchart.mjs`, `spec/markdown-style.css`), the layout model and line planner
|
|
25
|
-
(`layout/model.mjs`, `layout/line-plan.mjs
|
|
25
|
+
(`layout/model.mjs`, `layout/line-plan.mjs`, `layout/typography.mjs`),
|
|
26
|
+
the portable HTML and document metadata helpers (`spec/html-blocks.mjs`, `spec/frontmatter.mjs`,
|
|
27
|
+
`spec/document-settings.mjs`, `spec/document-fonts.mjs`), the Will grammar (`agent/will.mjs`), the picture appendix reader and writer
|
|
26
28
|
(`spec/md-assets.mjs`), the two shared-page reference readers (`tools/read-shared-page.mjs`,
|
|
27
29
|
`tools/read-shared-page.py`), and the host helper `packages/rapier-embed/embed.mjs` with its
|
|
28
30
|
contract owner `packages/rapier-embed/contract.mjs`. The vendored Pretext (`agent/vendor/pretext`) and micromark carry their
|
|
@@ -32,12 +34,18 @@ record validator/replayer and text-only conflict merger were moved, not copied,
|
|
|
32
34
|
into that module; the Notes index merger and the rest of the agent/editor remain
|
|
33
35
|
AGPL-3.0-only. The wrapper's carrier-staging helper
|
|
34
36
|
(`skills/rapier-html/package-files.mjs`) is MIT. The kit's MIT-marked facades,
|
|
35
|
-
`kit/render-entry.mjs`, `kit/render*.mjs`, `kit/
|
|
37
|
+
`kit/render-entry.mjs`, `kit/render*.mjs`, `kit/export-fonts.mjs`, `kit/print-capitals.mjs`,
|
|
38
|
+
`kit/pdf-vectors.mjs`, `kit/pdf-glyphs.mjs`, `kit/stage.mjs` and MIT-marked conformance
|
|
36
39
|
modules are covered too. These names describe the Rapier-owned files carrying the
|
|
37
40
|
MIT notice, not a grant over the editor or third-party code. Other Rapier-owned
|
|
38
41
|
files retain their stated licence; the editor is AGPL-3.0-only (see `LICENSE`).
|
|
39
42
|
Third-party components retain their own copyright and licence notices.
|
|
40
43
|
|
|
44
|
+
The portable font helpers read document definitions and accept explicit host validation and
|
|
45
|
+
subsetting functions. The application binding (`editor/export-fonts.mjs`), captured-font
|
|
46
|
+
materializer (`kit/document-fonts.mjs`) and font codecs (`draw/font*.mjs`) remain AGPL-3.0-only
|
|
47
|
+
and are not part of the MIT package's import graph.
|
|
48
|
+
|
|
41
49
|
The picture appendix reader and writer used to be part of `images/assets.mjs`, a file that also
|
|
42
50
|
holds JPEG XL/raster header inspection and SVG sanitizing -- both of which reach the editor's own
|
|
43
51
|
AGPL-3.0-only decoders (`images/raster.mjs`, `draw/font.mjs`), so the whole file could not honestly
|
package/dist/ledger/data.mjs
CHANGED
|
@@ -27,7 +27,7 @@ export function exactKeys(value, keys) {
|
|
|
27
27
|
}
|
|
28
28
|
export function documentText(text) {
|
|
29
29
|
if (typeof text !== 'string' || /[\uD800-\uDFFF]/u.test(text)) throw fault('document is not whole-character text');
|
|
30
|
-
if (new TextEncoder().encode(text).length >
|
|
30
|
+
if (new TextEncoder().encode(text).length > 64 * 1024 * 1024) throw fault('document exceeds the editor text limit');
|
|
31
31
|
return text;
|
|
32
32
|
}
|
|
33
33
|
export const nonnegative = value => Number.isSafeInteger(value) && value >= 0 && !Object.is(value, -0);
|