@phnx-labs/artifacts-cli 0.4.0 → 0.4.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/CHANGELOG.md +74 -0
- package/README.md +40 -11
- package/dist/cli.js +20 -7
- package/dist/cli.js.map +1 -1
- package/dist/lib/collab.d.ts +61 -0
- package/dist/lib/collab.js +714 -0
- package/dist/lib/collab.js.map +1 -0
- package/dist/lib/fonts.d.ts +3 -0
- package/dist/lib/fonts.js +68 -12
- package/dist/lib/fonts.js.map +1 -1
- package/dist/lib/highlights.d.ts +11 -1
- package/dist/lib/highlights.js +38 -71
- package/dist/lib/highlights.js.map +1 -1
- package/dist/lib/reader-anchors.d.ts +16 -0
- package/dist/lib/reader-anchors.js +146 -0
- package/dist/lib/reader-anchors.js.map +1 -0
- package/dist/lib/render.js +151 -10
- package/dist/lib/render.js.map +1 -1
- package/dist/lib/section-collapse.d.ts +17 -0
- package/dist/lib/section-collapse.js +113 -0
- package/dist/lib/section-collapse.js.map +1 -0
- package/dist/lib/tokens.d.ts +2 -0
- package/dist/lib/tokens.js +5 -1
- package/dist/lib/tokens.js.map +1 -1
- package/fonts/Inter-OFL.txt +92 -0
- package/fonts/InterVariable.woff2 +0 -0
- package/fonts/JetBrainsMono-OFL.txt +93 -0
- package/fonts/JetBrainsMono-wght.woff2 +0 -0
- package/fonts/README.md +16 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,80 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- **`artifacts render` no longer publishes by default — `--publish` is the
|
|
6
|
+
opt-in.** Every render used to shell out to `agents artifacts share … --expire never`
|
|
7
|
+
and mint a permanent owner-only page on the managed share endpoint, so each plan
|
|
8
|
+
iteration (typically three to five renders) permanently consumed a slot of the
|
|
9
|
+
150-object managed quota; one handle hit `413 storage limit reached` inside two
|
|
10
|
+
weeks with 171 pages, most of them intermediate renders nobody would share. A
|
|
11
|
+
rendered page is a local review surface; a share link is a deliberate act. `render`
|
|
12
|
+
and the hidden `pdf` entry point now write the local file only, and print the
|
|
13
|
+
managed URL + QR only with `--publish`. `ARTIFACTS_NO_PUBLISH=1` still wins over
|
|
14
|
+
`--publish`; the old `--no-publish` is accepted (hidden) so a lagging hook copy keeps
|
|
15
|
+
working. The watch-loop re-render under `--open` was already publish-free.
|
|
16
|
+
Source: `src/cli.ts`, `src/cli.test.ts`.
|
|
17
|
+
|
|
18
|
+
- **Sections collapse independently, with state remembered per browser
|
|
19
|
+
(PHNX-3844).** Every `##`/`###` heading now carries a native disclosure
|
|
20
|
+
button (`aria-expanded`/`aria-controls`, keyboard-operable, visible focus)
|
|
21
|
+
after its title. Collapsing an `##` section takes its nested `###`
|
|
22
|
+
subsections with it; a `###` subsection collapses on its own and ends at the
|
|
23
|
+
next `###` or `##`, whichever comes first. Every section starts expanded and
|
|
24
|
+
the server never hides one — collapsing is entirely client-side, so a reader
|
|
25
|
+
with JavaScript disabled always sees the complete document, and printing
|
|
26
|
+
always shows everything regardless of on-screen state. A reader's collapsed
|
|
27
|
+
sections are saved per browser, per document (the same URL-and-title
|
|
28
|
+
identity the read counter and highlights already use — never synced to an
|
|
29
|
+
account), keyed by each heading's own id so the state survives a re-render of
|
|
30
|
+
the same file as long as its heading text is unchanged; a corrupt or
|
|
31
|
+
unavailable `localStorage` fails open to the fully expanded document instead
|
|
32
|
+
of erroring. Following a heading link, an in-page anchor, or a same-page
|
|
33
|
+
click back to an already-active link reopens every collapsed section between
|
|
34
|
+
the document root and the target, including a permalink `<a id="…">` placed
|
|
35
|
+
immediately before or after the heading it names. The contents rail grows a
|
|
36
|
+
**Collapse all** / **Expand all** pair once a document has more than one
|
|
37
|
+
section. Duplicate heading text (two sibling `### Overview` sections) keeps
|
|
38
|
+
its existing distinct-id behaviour, and each one collapses independently.
|
|
39
|
+
Source: `src/lib/section-collapse.ts` (new), `src/lib/render.ts`
|
|
40
|
+
(`wrapCollapsibleSections`, `findHeadingSpans`, the scroll-spy's now
|
|
41
|
+
visibility-aware active-section tracking).
|
|
42
|
+
|
|
43
|
+
- **Default Inter and JetBrains Mono are bundled and inlined (PHNX-3886).**
|
|
44
|
+
`artifacts render` named those families in CSS but did not ship the faces, so a
|
|
45
|
+
Linux box without `fc-match` / Inter produced HTML with zero `@font-face` and
|
|
46
|
+
the viewing browser fell through to system-ui. The package now carries latin
|
|
47
|
+
variable woff2 cuts and inlines them whenever `DESIGN.md` names Inter or
|
|
48
|
+
JetBrains Mono. A resolvable `fonts.files` path still wins; a CSS stack in
|
|
49
|
+
`fonts.body` (`Inter, system-ui, sans-serif`) uses the first family so it
|
|
50
|
+
still embeds Inter. `artifacts estimate` strips those inlined faces the same
|
|
51
|
+
way it already drops the recovery copy of the Markdown, so the authoring-token
|
|
52
|
+
table stays a comparison of agent-authored HTML. Source: `src/lib/fonts.ts`,
|
|
53
|
+
`src/lib/tokens.ts`, `fonts/`.
|
|
54
|
+
|
|
55
|
+
- **Hosted artifacts carry live review threads (PHNX-3835).** Selecting text on
|
|
56
|
+
a collaboration-enabled host now also offers **Comment**, which opens an
|
|
57
|
+
anchored thread in a right-side review rail with replies, resolve/reopen,
|
|
58
|
+
edit/delete on your own comments, and open/resolved filters; below 980px the
|
|
59
|
+
rail becomes a dismissible bottom sheet. A second reader sees every change
|
|
60
|
+
live over `EventSource`, and a reconnect replays what was missed exactly once
|
|
61
|
+
— deliveries are deduplicated by event cursor and an envelope at or before the
|
|
62
|
+
snapshot the client already loaded is ignored, so a full stream replay cannot
|
|
63
|
+
walk a resolved thread back to open. Threads carry the cursor they were
|
|
64
|
+
written at and never move backwards, so a slow write response overtaken by a
|
|
65
|
+
teammate's newer change cannot revert it. Mutations carry an `Idempotency-Key`
|
|
66
|
+
reused across retries, and a write that fails is rolled back visibly with the
|
|
67
|
+
draft text handed back rather than left on screen. The rendered HTML holds no
|
|
68
|
+
endpoint, token, or account id: the page asks its own origin over
|
|
69
|
+
`/__collab/*`, and when discovery is absent or refuses, `file://`, loopback,
|
|
70
|
+
and BYO shares keep their existing local highlight/note behaviour with no
|
|
71
|
+
collaboration chrome. Comments reuse the local highlight range vocabulary and
|
|
72
|
+
are keyed to a new `<meta name="artifacts-body-revision">` — a SHA-256 over
|
|
73
|
+
the artifact body alone, so a metadata-only re-render keeps every anchor — and
|
|
74
|
+
repaint only on an unambiguous anchor plus an exact quote match, otherwise
|
|
75
|
+
showing **From an earlier revision**. Source: `src/lib/collab.ts` (new),
|
|
76
|
+
`src/lib/reader-anchors.ts` (new — the range vocabulary, extracted so
|
|
77
|
+
highlights and threads share one selector format), `src/lib/highlights.ts`,
|
|
78
|
+
`src/lib/render.ts`.
|
|
5
79
|
- **Auto-publish is opt-in at the render funnel — no double links, no per-save
|
|
6
80
|
URLs.** `artifacts render`/`_pdf` publish the rendered artifact to a durable
|
|
7
81
|
private managed URL (with a terminal QR) by default; `--no-publish` /
|
package/README.md
CHANGED
|
@@ -81,7 +81,7 @@ Six commands. Everything else is a flag on one of them.
|
|
|
81
81
|
| --- | --- |
|
|
82
82
|
| `artifacts new <plan\|report\|visual\|worksheet\|design> [--out file] [--project name] [--blank] [--stdout]` | Scaffolds an artifact and pre-fills detectable provenance. When the target lands under a committed `.agents/artifacts/` tree it pre-fills anonymized provenance instead (`human: author`, `host: fleet-worker`, no session id) — that directory is published. `project` is detected only when cwd is genuinely inside the project's own checkout (a known `~/.agents/projects/` entry or the git remote's repo name); inside the durable artifact home (`~/.agents/artifacts/`) detection stays empty rather than inventing a name — pass `--project` or fill the frontmatter, and `artifacts check` warns until you do. `--blank` leaves every field empty (an explicit `--project` still pins the project); `--stdout` prints the skeleton without writing; `design` writes a starter `DESIGN.md`; `worksheet` generates a `worksheet_id`. |
|
|
83
83
|
| `artifacts check file.md` | Validates frontmatter metadata, required sections, asset paths, and embedded HTML/SVG safety. |
|
|
84
|
-
| `artifacts render file.md [--out file] [--open] [--no-serve] [--
|
|
84
|
+
| `artifacts render file.md [--out file] [--open] [--no-serve] [--publish]` | Renders Markdown to self-contained HTML next to the source. Local by default: `--publish` additionally publishes it to a durable **private** managed URL and prints the URL plus a terminal QR (every render used to publish, which filled the managed quota with intermediate iterations; `ARTIFACTS_NO_PUBLISH=1` still overrides `--publish`, and the `--open` watch loop re-renders on save but never publishes). `--open` serves on 127.0.0.1, watches the Markdown, and shows it in your browser; `--no-serve` keeps file:// behavior. Embeds the Markdown source for recovery. |
|
|
85
85
|
| `artifacts answers <ws.md> [--from file.json] [--json] [--pending]` | Reads or merges a `worksheet`'s answers. No flag prints a filled/pending table; `--json` emits `id → {label, value, state}`; `--pending` filters to pending fields or worksheets; `--from` merges an exported answers file back into the `.md` (id-matched, dirty-only, atomic). A directory scans for worksheets and lists per-file pending counts. |
|
|
86
86
|
| `artifacts notes <file.md\|file.html> [--from sidecar.json] [--json]` | Reads the adjacent `<basename>.notes.json` review sidecar as a table or JSON, or imports an `artifacts.notes.v1` sidecar. |
|
|
87
87
|
| `artifacts share file.md [--slug slug]` | Renders Markdown when needed and publishes through the configured R2/Worker endpoint. The URL slug is derived from the artifact title (filename for title-less files); `--slug` overrides it. Re-sharing the same title updates the same URL. |
|
|
@@ -149,7 +149,10 @@ Layout numbers are pixels. They control the content measure, horizontal page pad
|
|
|
149
149
|
|
|
150
150
|
Optional `header` and `footer` frontmatter strings add document chrome to HTML and PDF without repeating those values in the Markdown body. The hero is work-first: `status` is a kicker badge, freeform `facts` are a quiet monoline, `links` render under a **Related** label as the only chip row, and provenance is one unlabeled line (`repository` · `branch` · optional `tracking` · combined harness/model display · `human` · `host` · `session` · `date`). An `owner/repo`-shaped `repository` value links to GitHub. Harness + model merge into one display name (e.g. `grok` + `grok-4.5` → **Grok 4.5**). The `human` field is seeded by `artifacts new` from the Git identity (`user.name`, falling back to the OS username) — except under a committed `.agents/artifacts/` tree, where it is seeded as `author` and no host or session is filled, because that directory is published.
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
The default families — **Inter** (body and display) and **JetBrains Mono**
|
|
153
|
+
(mono) — are bundled in the package and inlined as `@font-face` data URIs, so a
|
|
154
|
+
render is self-contained for type even on a machine that does not have those
|
|
155
|
+
faces installed. A `DESIGN.md` `fonts.files` path still wins when it resolves.
|
|
153
156
|
|
|
154
157
|
```yaml
|
|
155
158
|
fonts:
|
|
@@ -157,12 +160,12 @@ fonts:
|
|
|
157
160
|
mono: JetBrains Mono
|
|
158
161
|
display: Inter
|
|
159
162
|
files:
|
|
160
|
-
Inter: ./fonts/Inter.woff2
|
|
163
|
+
Inter: ./fonts/Inter.woff2 # optional override
|
|
161
164
|
```
|
|
162
165
|
|
|
163
|
-
Font paths resolve relative to the artifact
|
|
164
|
-
|
|
165
|
-
render` warns and emits a fallback stack.
|
|
166
|
+
Font paths resolve relative to the artifact. If an override path is missing, the
|
|
167
|
+
bundled face is used when the family is Inter or JetBrains Mono; otherwise
|
|
168
|
+
`artifacts render` warns and emits a fallback stack.
|
|
166
169
|
|
|
167
170
|
For fonts stored **outside** the project — a shared company font cache, say — add
|
|
168
171
|
the directory to `~/.artifacts/config.json` once. Every later `render` picks it up:
|
|
@@ -175,16 +178,16 @@ the directory to `~/.artifacts/config.json` once. Every later `render` picks it
|
|
|
175
178
|
|
|
176
179
|
## Token Estimate
|
|
177
180
|
|
|
178
|
-
`artifacts estimate` measures the Markdown source against equivalent self-contained HTML generated in memory. It excludes the compiler-only embedded recovery copy of the Markdown so
|
|
181
|
+
`artifacts estimate` measures the Markdown source against equivalent self-contained HTML generated in memory. It excludes the compiler-only embedded recovery copy of the Markdown and inlined `@font-face` data URIs so those payloads are not counted as agent-authored HTML. It uses the exact `o200k_base` tokenizer and names that encoding in its output; model-family token counts can differ.
|
|
179
182
|
|
|
180
183
|
The committed [representative plan](examples/plan.md) measures:
|
|
181
184
|
|
|
182
185
|
| Source | Tokens | Difference from HTML |
|
|
183
186
|
| --- | ---: | ---: |
|
|
184
|
-
| Markdown authored by the agent |
|
|
185
|
-
| Equivalent rendered HTML |
|
|
187
|
+
| Markdown authored by the agent | 2,391 | 22,637 fewer |
|
|
188
|
+
| Equivalent rendered HTML | 25,028 | baseline |
|
|
186
189
|
|
|
187
|
-
That example is
|
|
190
|
+
That example is a **90.4% authoring-token reduction** when the alternative is having the agent emit the same self-contained HTML. It includes complete metadata, ordinary Markdown, a table, embedded layout HTML, inline SVG, theme CSS, responsive rules, print rules, and the theme toggle. Run `artifacts estimate examples/plan.md` to reproduce it — the command is absent from `--help` but still runs.
|
|
188
191
|
|
|
189
192
|
## Links
|
|
190
193
|
|
|
@@ -212,18 +215,44 @@ Brand marks are bundled, so a known host needs no network. Unknown hosts fall ba
|
|
|
212
215
|
|
|
213
216
|
## Reading Surfaces
|
|
214
217
|
|
|
215
|
-
|
|
218
|
+
Five reader affordances are generated from the artifact itself. An agent writes nothing extra for any of them.
|
|
216
219
|
|
|
217
220
|
**References appendix.** Every outbound link in the body is collected into a numbered `References` section at the end — deduped, in order of first appearance, each row carrying the source's mark, its label, and its host. A bare URL lists under its short label (`PR #1914`), not the raw address. Writing your own `References`, `Sources`, `Bibliography`, or `Citations` heading suppresses the generated one.
|
|
218
221
|
|
|
219
222
|
**Contents rail.** The table of contents lists sections and their subsections. At viewports wider than 1380px it becomes a fixed side rail that tracks the section you are reading; below that it stays inline at the top with subsections hidden. Heading ids are unique even when two subsections share a title, so every rail entry addresses its own heading. A heading inside an embedded panel or figure is that block's caption and is deliberately left out of the rail.
|
|
220
223
|
|
|
224
|
+
**Collapsible sections.** Every `##`/`###` heading gets a small toggle after its title — a native `<button>` with `aria-expanded`/`aria-controls`, reachable and operable from the keyboard, with a visible focus ring. Collapsing an `##` section takes its `###` subsections with it; collapsing a `###` subsection leaves its parent and siblings alone. Everything starts expanded and stays that way for a reader with JavaScript disabled — collapsing is a pure client-side enhancement, never a server-side omission. A reader's choices are remembered per browser, per document (not synced to an account), and survive a re-render of the same file as long as a heading's text — and so its id — stays the same. Navigating to a heading, an in-page link, or an anchor tag placed right before or after a heading reopens every collapsed section on the way to it, including a same-page click back to a section you just re-collapsed. The contents rail adds **Collapse all** / **Expand all** once there is more than one section. Printing, and a corrupt or unavailable `localStorage`, both fail open to the full expanded document.
|
|
225
|
+
|
|
221
226
|
**Read count.** Each artifact keeps a per-browser read count in `localStorage`, shown in the document header (`first read`, then `2 reads`). It is scoped to the artifact's own URL and title, so two artifacts published under the same title do not share a counter. Nothing is sent anywhere.
|
|
222
227
|
|
|
223
228
|
**Reader review.** Selecting text always copies it and opens **Copied · Highlight · Note** without clearing the browser selection. **Highlight** explicitly saves the range. **Note** saves it and opens a textarea; clicking an existing highlight opens the same quote/note popover with Copy and Remove. Local state uses the artifact's URL-and-title identity. With `render --open`, notes also autosave after roughly 600 ms to `<basename>.notes.json` beside the Markdown, while Markdown rewrites surface an **Updated · Reload** chip. Static/shared pages never post feedback off-box.
|
|
224
229
|
|
|
225
230
|
Themes already follow the reader's system preference and switch live when the OS theme changes, unless the reader picks one explicitly with the in-page toggle.
|
|
226
231
|
|
|
232
|
+
## Hosted Review Threads
|
|
233
|
+
|
|
234
|
+
On a host that serves collaboration, the same artifact also carries human-to-human review threads: select a sentence, press **Comment**, and the thread appears in a right-side rail with replies, resolve/reopen, and edit/delete on your own comments. A second reader sees every change live, without reloading. Below 980px the rail becomes a dismissible bottom sheet instead of a squeezed column. Markers and thread controls are keyboard reachable — <kbd>Enter</kbd> or <kbd>Space</kbd> on a marker opens its thread, <kbd>Escape</kbd> closes the rail and returns focus to the marker — and arriving comments are announced through an `aria-live` region.
|
|
235
|
+
|
|
236
|
+
Nothing about the host is baked into the file. The page asks its **own origin** whether collaboration exists:
|
|
237
|
+
|
|
238
|
+
```
|
|
239
|
+
GET /__collab/context?share=<encoded normalized path>
|
|
240
|
+
GET /__collab/threads?share=<path>[&after=<cursor>]
|
|
241
|
+
POST /__collab/threads { share, anchor, body }
|
|
242
|
+
POST /__collab/threads/:threadId/replies { share, body }
|
|
243
|
+
PATCH /__collab/comments/:commentId { share, body } | { share, deleted: true }
|
|
244
|
+
PATCH /__collab/threads/:threadId { share, status: "open" | "resolved" }
|
|
245
|
+
GET /__collab/events?share=<path> (text/event-stream)
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
There is no endpoint, token, or account id in the rendered HTML. If discovery is absent or answers anything other than an explicit read grant, the page stays exactly what it was — `file://`, a loopback dev server, and a BYO bucket keep their local highlights and notes and show no collaboration chrome at all. Mutations carry an `Idempotency-Key` that is reused across retries, and the client deduplicates stream and catch-up deliveries by event cursor, so a reconnect replays a missed change exactly once.
|
|
249
|
+
|
|
250
|
+
Every response and every event carries a whole thread, and **each thread carries the `cursor` it was last written at**. That is what makes ordering safe without a lock: the client applies a snapshot only when its cursor is newer than the one it already holds for that thread, so a slow write response overtaken by a teammate's newer change cannot revert it.
|
|
251
|
+
|
|
252
|
+
**Anchors and revisions.** A comment stores the same range vocabulary local highlights use — `{ revision, quote, section, start: { anchor, offset }, end: { anchor, offset } }`. The canonical revision is `<meta name="artifacts-body-revision">`: the SHA-256 of the `<article class="artifact-body">` inner HTML and nothing else, so re-rendering with a new `updated` date, session id, or header does not invalidate a single comment. Renderer, Worker, and viewer all read that one value rather than each deriving their own. A thread repaints only when both anchors resolve to exactly one block each *and* the quoted text still matches; otherwise nothing is painted and the thread is listed as **From an earlier revision** rather than decorating the wrong sentence.
|
|
253
|
+
|
|
254
|
+
**Visibility.** The rail labels a share **Only me**, **Company**, **Anyone with link**, or **Public**, mapped from the context's `me`, `org`, `unlisted`/`private`, and `public`. A company share is never shown as public, and an unrecognized visibility is left unlabeled rather than guessed.
|
|
255
|
+
|
|
227
256
|
## Embedded HTML And SVG
|
|
228
257
|
|
|
229
258
|
Use Markdown for prose, lists, tables, and code. When Markdown cannot express a figure or comparison, write semantic HTML directly in the Markdown file. The renderer sanitizes it, applies the active `DESIGN.md` theme, and keeps the output responsive.
|
package/dist/cli.js
CHANGED
|
@@ -167,7 +167,8 @@ program
|
|
|
167
167
|
Happy path:
|
|
168
168
|
1. artifacts new plan --out <file>.md # kind + title; plans also need surface;
|
|
169
169
|
# provenance auto-fills
|
|
170
|
-
2. artifacts render <file>.md --open #
|
|
170
|
+
2. artifacts render <file>.md --open # <file>.html beside the source, opened locally
|
|
171
|
+
artifacts render <file>.md --publish # ...plus a private managed URL + QR (opt-in)
|
|
171
172
|
|
|
172
173
|
Run artifacts <command> --help for details.
|
|
173
174
|
`);
|
|
@@ -221,12 +222,20 @@ program
|
|
|
221
222
|
});
|
|
222
223
|
program
|
|
223
224
|
.command('render')
|
|
224
|
-
.description('Render Markdown to HTML
|
|
225
|
+
.description('Render Markdown to HTML; --publish also mints a private managed URL.')
|
|
225
226
|
.argument('<file.md|file.html>')
|
|
226
227
|
.option('--out <file>', 'output file')
|
|
227
228
|
.option('--open', 'open the rendered HTML in your default browser')
|
|
228
229
|
.option('--no-serve', 'open the rendered file:// URL without watching or notes sync')
|
|
229
|
-
.
|
|
230
|
+
// Publishing is OPT-IN. Every render used to mint a permanent (--expire never)
|
|
231
|
+
// owner-only share object on the managed endpoint, so each plan iteration —
|
|
232
|
+
// typically three to five renders per plan — permanently consumed a slot of
|
|
233
|
+
// the 150-object managed quota and the endpoint hit 413 within two weeks.
|
|
234
|
+
// A rendered page is a local review surface; a share link is a deliberate act.
|
|
235
|
+
.option('--publish', 'also publish a private managed URL (owner-only, permanent)')
|
|
236
|
+
// Accepted so a lagging hook copy that still passes the old default-off flag
|
|
237
|
+
// gets the same (now default) behavior instead of a Commander parse error.
|
|
238
|
+
.addOption(new Option('--no-publish', 'deprecated; publishing is already off by default').hideHelp())
|
|
230
239
|
// Deprecated in 0.3.0, removed in 0.4.0. A deployed ExitPlanMode hook copy may
|
|
231
240
|
// still print `artifacts render <file> --format html`, and Commander errors on
|
|
232
241
|
// unknown options — so these exist to hand a lagging caller a migration
|
|
@@ -260,7 +269,10 @@ Notes:
|
|
|
260
269
|
console.error(`${chalk.yellow('warning')} --format is deprecated and ignored; render is HTML-only. It is removed in 0.4.0.`);
|
|
261
270
|
}
|
|
262
271
|
const out = opts.out || defaultOutFor(file, '.html');
|
|
263
|
-
|
|
272
|
+
// With both --publish and the hidden --no-publish declared, Commander leaves
|
|
273
|
+
// the value undefined when neither is passed — only an explicit --publish is true.
|
|
274
|
+
const publish = opts.publish === true;
|
|
275
|
+
const result = await compileArtifact(file, out, { publish });
|
|
264
276
|
printDiagnostics(result.diagnostics);
|
|
265
277
|
if (result.diagnostics.some((diagnostic) => diagnostic.level === 'error')) {
|
|
266
278
|
process.exitCode = 1;
|
|
@@ -273,7 +285,7 @@ Notes:
|
|
|
273
285
|
console.log(chalk.bold('opened locally'));
|
|
274
286
|
}
|
|
275
287
|
else {
|
|
276
|
-
const served = await serveArtifact(file, out, { publish
|
|
288
|
+
const served = await serveArtifact(file, out, { publish });
|
|
277
289
|
openPath(served.url);
|
|
278
290
|
console.log(chalk.bold('served locally'));
|
|
279
291
|
}
|
|
@@ -298,7 +310,8 @@ program
|
|
|
298
310
|
.argument('<file.md|file.html>')
|
|
299
311
|
.requiredOption('--out <file>', 'output PDF file')
|
|
300
312
|
.option('--layout <layout>', 'PDF layout: document or poster', parsePdfLayout, 'document')
|
|
301
|
-
.option('--
|
|
313
|
+
.option('--publish', 'also publish the PDF to a private managed URL (owner-only, permanent)')
|
|
314
|
+
.addOption(new Option('--no-publish', 'deprecated; publishing is already off by default').hideHelp())
|
|
302
315
|
.action(async (file, opts) => {
|
|
303
316
|
const outHtml = /\.md$/i.test(file) ? defaultOutFor(file, '.html') : file;
|
|
304
317
|
if (/\.md$/i.test(file)) {
|
|
@@ -310,7 +323,7 @@ program
|
|
|
310
323
|
}
|
|
311
324
|
}
|
|
312
325
|
await exportPdf(outHtml, opts.out, { layout: opts.layout });
|
|
313
|
-
const published = await publishArtifact(opts.out, { publish: opts.publish });
|
|
326
|
+
const published = await publishArtifact(opts.out, { publish: opts.publish === true });
|
|
314
327
|
printDiagnostics(published.diagnostics);
|
|
315
328
|
await printArtifactResult(published, opts.out);
|
|
316
329
|
});
|
package/dist/cli.js.map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AG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACjG,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hosted review threads.
|
|
3
|
+
*
|
|
4
|
+
* The rendered artifact is a static file. It carries no endpoint, token, or
|
|
5
|
+
* account id: the viewer asks its own origin whether collaboration exists, and
|
|
6
|
+
* every other call is same-origin and relative. A `file://` page, a loopback dev
|
|
7
|
+
* server, and a BYO bucket therefore behave exactly as they did before — the
|
|
8
|
+
* discovery call either never happens or does not answer, and no chrome appears.
|
|
9
|
+
*
|
|
10
|
+
* Same-origin contract (fixed, so the Worker, the API, and this client agree):
|
|
11
|
+
*
|
|
12
|
+
* GET /__collab/context?share=<encoded path>
|
|
13
|
+
* GET /__collab/threads?share=<path>[&after=<cursor>]
|
|
14
|
+
* POST /__collab/threads { share, anchor, body }
|
|
15
|
+
* POST /__collab/threads/:threadId/replies { share, body }
|
|
16
|
+
* PATCH /__collab/comments/:commentId { share, body } | { share, deleted: true }
|
|
17
|
+
* PATCH /__collab/threads/:threadId { share, status: "open" | "resolved" }
|
|
18
|
+
* GET /__collab/events?share=<path> (text/event-stream)
|
|
19
|
+
*/
|
|
20
|
+
/** The `<meta>` name carrying the canonical revision comment anchors are bound to. */
|
|
21
|
+
export declare const BODY_REVISION_META = "artifacts-body-revision";
|
|
22
|
+
/**
|
|
23
|
+
* The canonical artifact revision.
|
|
24
|
+
*
|
|
25
|
+
* One revision, agreed by three parties, or anchors drift: it is the SHA-256 of
|
|
26
|
+
* the exact UTF-8 bytes of the `<article class="artifact-body">` inner HTML —
|
|
27
|
+
* the rendered body and nothing else. The hero, the header and footer, the
|
|
28
|
+
* provenance line, the table of contents, the embedded Markdown source, and all
|
|
29
|
+
* reader/collaboration scripts sit outside it, so re-rendering the same content
|
|
30
|
+
* with a new `updated:` date or a new session id does not invalidate a single
|
|
31
|
+
* comment.
|
|
32
|
+
*
|
|
33
|
+
* It is computed once here, at render time, and stamped into the document as
|
|
34
|
+
* `<meta name="artifacts-body-revision">`. The viewer reads that meta rather
|
|
35
|
+
* than re-deriving it from the live DOM (browser serialization is not
|
|
36
|
+
* byte-identical to the renderer's output), and the Worker/API read the same
|
|
37
|
+
* meta out of the stored object. The R2 object revision reported by
|
|
38
|
+
* `/__collab/context` identifies the upload; it is deliberately *not* what
|
|
39
|
+
* anchors are keyed by.
|
|
40
|
+
*/
|
|
41
|
+
export declare function bodyRevision(articleHtml: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* The share key sent to the collaboration endpoints: this page's own location
|
|
44
|
+
* path, normalized so that `/u/plan`, `/u/plan/`, and `/u/plan/index.html` are
|
|
45
|
+
* one share rather than three.
|
|
46
|
+
*
|
|
47
|
+
* Serialized into the browser bundle via `Function.prototype.toString()`, so it
|
|
48
|
+
* must stay self-contained — no imports, no module-scope references.
|
|
49
|
+
*/
|
|
50
|
+
export declare function normalizeSharePath(pathname: string): string;
|
|
51
|
+
/**
|
|
52
|
+
* The reader-facing name for a share's visibility. `org` is *Company*, never
|
|
53
|
+
* *Public* — conflating the two would tell a viewer their company-internal
|
|
54
|
+
* review thread is on the open web. An unrecognized value returns null and the
|
|
55
|
+
* label is omitted: an unlabeled share is recoverable, a mislabeled one is not.
|
|
56
|
+
*
|
|
57
|
+
* Serialized into the browser bundle via `Function.prototype.toString()`, so it
|
|
58
|
+
* must stay self-contained — no imports, no module-scope references.
|
|
59
|
+
*/
|
|
60
|
+
export declare function visibilityLabel(value: unknown): string | null;
|
|
61
|
+
export declare const COLLAB_SCRIPT: string;
|