@artifactshare/cli 0.21.0 → 0.23.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 CHANGED
@@ -3,6 +3,34 @@
3
3
  All notable changes to `@artifactshare/cli` are documented here.
4
4
  For user-facing announcements, see https://artifactshare.com/updates?product=cli.
5
5
 
6
+ ## 0.23.0 - 2026-11-09
7
+
8
+ - `comments list` and comment readback include the PDF page a reader commented on. Such anchors keep `kind: "artifact"` and add `page_number` with `version_id` and `version_number` of the version it was posted on (null once deleted); released CLIs ignore the added fields. Agents cannot post page comments. Update the bundled skill to version 63 with this guidance.
9
+
10
+ - `comments list` text anchors now include `target_path`, the page the quoted text is on. On multi-file sites, where readers can now comment on selected text, it is the file or route path plus any `#/` or `#!/` hash route. Quoted-text posting by agents on multi-file sites remains unsupported. Update the bundled skill to version 62 with this guidance.
11
+
12
+ - Share PDF files with `share`, keyed resend and `update`. A file is a PDF only when its name ends in `.pdf` (any case) and it starts with `%PDF-`; the 25 MiB per-artifact limit is unchanged. `download` saves the original PDF bytes. `append`, `preview` and `artifacts get` text readback do not support PDFs. Update the bundled skill to version 60 with PDF guidance.
13
+ - Send `X-ArtifactShare-Artifact-Kinds: pdf` with every request, so the server reports PDF artifacts to this CLI while earlier releases keep receiving lists and resolve results they can parse.
14
+ - Share MP4 videos with `share`, keyed resend and `update`. A file is a video only when its name ends in `.mp4` (any case) and it has an ISO base media `ftyp` box at byte 4; otherwise `share` fails with `validation_failed` before any upload. The 25 MiB per-artifact limit is unchanged, and an `.mp4` inside a static-site folder stays a site asset. Readers play the video in the viewer. `download` saves the original MP4 bytes; `append`, `preview` and `artifacts get` text readback do not support videos. The CLI now sends `X-ArtifactShare-Artifact-Kinds: pdf, video`. Update the bundled skill to version 61 with video guidance.
15
+
16
+ - Fix local Markdown preview on phones showing the full outline list before the compact contents row. Markdown is labelled Japanese only when its body contains kana, so English or Chinese text with kanji stays English unless frontmatter `lang` says otherwise.
17
+ - Fix local preview dark-mode contrast, document backgrounds, truncated labels and narrow headers. Preserve failed annotation drafts with a retry message and keep Share sign-in, upload and result state when reopened. Oversized element anchors use bounded hash/excerpt fields while normal and legacy anchors remain compatible.
18
+ - Update the bundled skill to version 59 with oversized preview anchor and retry guidance.
19
+
20
+ - Add `artifacts versions <target> --json` with cursor pagination for files and static sites. Get/list now report `retain_versions`, `version_count`, and `total_size_bytes`. Static-site get opts into metadata without source; released source-only clients keep their existing unsupported-kind response and open download guidance. Publisher history restrictions and retention behavior are unchanged.
21
+
22
+ - Reject keyed resends with a different effective explicit visibility before creating a version, with an edit command for recovery. Home treats project as private, matching creation.
23
+ - Include current visibility and display title in artifacts get JSON output.
24
+ - Update the bundled skill to version 55 with visibility, readback, retained-version pagination and logical storage guidance.
25
+
26
+ ## 0.22.0 - 2026-10-30
27
+
28
+ - Text comment readback optionally includes page-derived creation context in `anchor.locus`: heading labels and the surrounding text block. Older and agent-posted comments omit it.
29
+
30
+ - Read earlier published source with `artifacts get --version <version-id>` or MCP `get_artifact` `version_id`, including the version recorded on a comment. Retention-removed versions return a distinct error. Publisher credentials reject version selection.
31
+
32
+ - Return stored quote context, original version and viewer creation ambiguity in text comment readback.
33
+
6
34
  ## 0.21.0 - 2026-10-29
7
35
 
8
36
  - Default unspecified Home shares to private for accounts without workspace visibility, using the server-reported capability before a single upload. Preserve explicit and configured audiences, report private fallback provenance, and resolve preview defaults after sign-in.
package/README.md CHANGED
@@ -2,12 +2,38 @@
2
2
 
3
3
  Copyright © TechTalk, Inc.
4
4
 
5
- The official CLI to open, share, and update files, folders, and static sites on [Artifact Share](https://artifactshare.com) from terminals, AI agents, and automation. Share HTML, Markdown, and exported sites to stable URLs, update existing files, and emit `--json` for scripts and agents.
5
+ The official CLI to open, share, and update files, folders, and static sites on [Artifact Share](https://artifactshare.com) from terminals, AI agents, and automation. Share HTML, Markdown, PDF, MP4 video, and exported sites to stable URLs, update existing files, and emit `--json` for scripts and agents.
6
6
 
7
- Artifact Share hosts AI-built reports, documents, and static sites so you can share them with teammates and clients. This CLI shares a single file or a whole folder (HTML, Markdown, exported SPAs, images included), updates versions, opens shared URLs for agents, reads content and comments back, and works the same for humans, terminal agents (Claude Code, Codex, Cursor Agent), and automation.
7
+ Artifact Share hosts AI-built reports, documents, and static sites so you can share them with teammates and clients. This CLI shares a single file (HTML, Markdown, PDF, or MP4 video) or a whole folder (HTML, Markdown, exported SPAs, images included), updates versions, opens shared URLs for agents, reads content and comments back, and works the same for humans, terminal agents (Claude Code, Codex, Cursor Agent), and automation.
8
8
 
9
9
  Targets accept artifact IDs, app share URLs, per-ID `artifactshare.link` viewer URLs, and `a-<id>--v-<hex-version>.artifactshareusercontent.com` or `l-<id>--v-<hex-version>.artifactshareusercontent.com` execution URLs. Legacy sandbox and link-content URLs still resolve to IDs through the API; they no longer serve file content. Public share URLs are unchanged.
10
10
 
11
+ ## PDF files
12
+
13
+ `share ./deck.pdf` shares one PDF as its original file; `update` and `share --key`
14
+ add PDF versions the same way. A single file is a PDF only when its name ends in
15
+ `.pdf` (any case) and its bytes start with `%PDF-`; a `.pdf` without that header
16
+ fails locally with `validation_failed` before any upload, and the MIME type alone
17
+ never selects PDF. The 25 MiB per-artifact limit applies (`file_too_large`).
18
+ `download` saves the original `.pdf` bytes. PDFs have no text source:
19
+ `artifacts get` returns `unsupported_kind` (use `download` instead), and `append`,
20
+ local `preview`, and MCP uploads do not accept PDFs. Static-site folders still do
21
+ not accept `.pdf` files.
22
+
23
+ ## Video files
24
+
25
+ `share ./demo.mp4` shares one MP4 video as its original file; `update` and
26
+ `share --key` add video versions the same way. A single file is a video only
27
+ when its name ends in `.mp4` (any case) and its bytes have an ISO base media
28
+ `ftyp` box at byte 4; a `.mp4` without it fails locally with
29
+ `validation_failed` before any upload, and the MIME type alone never selects
30
+ video. Other video formats are not accepted. The 25 MiB per-artifact limit
31
+ applies (`file_too_large`). Readers play the video in the viewer; `download`
32
+ saves the original `.mp4` bytes. Videos have no text source: `artifacts get`
33
+ returns `unsupported_kind` (use `download` instead), and `append`, local
34
+ `preview`, and MCP uploads do not accept videos. An `.mp4` inside a static-site
35
+ folder stays an ordinary site asset.
36
+
11
37
  ## WebAssembly dashboards
12
38
 
13
39
  Static sites can run WebAssembly and workers, such as DuckDB-WASM loaded from jsDelivr, and folder uploads accept `.wasm` and `.parquet`; extensions such as `parquet` load from `extensions.duckdb.org`, and the bundled skill describes the setup.
@@ -49,7 +75,7 @@ runs add versions to the same file.
49
75
  Pass `--expected-version <version-id>` to reject an update when another version
50
76
  became current first. Project-scoped agent profiles must pass it to `update`
51
77
  and to repeat `share --key` updates; initial key creation does not require it.
52
- After `login --preset agent`, updates require `--expected-version <version-id>` using `data.version.id` from the previous successful `share` or `update` output. If omitted, `expected_version_required` reports `recovery.kind: change_input`; retry with that value. `artifacts get` instead returns the current version as `data.version_id`.
78
+ After `login --preset agent`, updates require `--expected-version <version-id>` using `data.version.id` from the previous successful `share` or `update` output. If omitted, `expected_version_required` reports `recovery.kind: change_input`; retry with that value. `artifacts get` without `--version` returns the current version as `data.version_id`.
53
79
 
54
80
  Unknown options fail locally with `unknown_option` before authentication, requests,
55
81
  or writes. Correct `details.option`; the hint suggests a nearby option when one
@@ -82,29 +108,30 @@ project's Slack channel must be reauthorized.
82
108
 
83
109
  ## Commands
84
110
 
85
- | Command | What it does |
86
- | ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
87
- | `open <target>` | First command for agents opening a share or artifactshareusercontent.com execution URL; ensures skills, then reads or suggests download |
88
- | `share <path>` | Share a file or folder; unspecified Home audiences use workspace when available, otherwise private (`--project`, `--home`, `--visibility`, `--key`, link expiry options) |
89
- | `update <target> <path>` | Add a new version to an existing file (ID or share URL); optional `--label` adds a version note |
90
- | `append <target> <path>` | Append a non-empty UTF-8 file without a separator: at Markdown source end or before `</body>` in HTML, falling back to source end |
91
- | `edit <target>` | Change title, sharing, link expiry, explicit viewers, or project placement |
92
- | `delete <target>` | Permanently delete a file you shared |
93
- | `artifacts delete <target>` | Alias of delete; permanently delete a file you shared |
94
- | `resolve <value>` | Find files by URL, ID, title, or project name |
95
- | `artifacts get <target>` | Read a file's content and metadata back |
96
- | `download <target>` | Save a file or a whole static site locally |
97
- | `comments list / post / edit / resolve / reopen / delete <target>` | Read, write, edit, resolve, reopen, and permanently delete comments |
98
- | `projects list / create / edit` | List eligible project destinations; create and edit projects and audience |
99
- | `move <target>` | Move an existing file into a project or back home; `edit` is preferred for new automation |
100
- | `preview <file>` (alias of `preview start`) | Serve a local Markdown or HTML file with the product viewer look for browser annotation; local only, no sign-in, nothing uploaded |
101
- | `preview next` / `preview done` / `preview reply` / `preview stop` | Agent loop for a live preview: poll submitted annotation batches, report fixed/skipped outcomes from stdin, reply into a thread, and stop the session |
102
- | `login` / `logout` / `whoami` | Sign in, revoke a device-login credential before removing it locally, and check who you are |
103
- | `doctor` | Diagnose token storage, auth, destination, network, and upload readiness — tells you the next command to run |
104
- | `changelog` | Show the installed version, this release's notes, and the public updates page |
105
- | `profiles list / use / import-token / delete` | Switch between local account profiles, import an issued token from stdin, and delete profile entries |
106
- | `init` | Set up this directory: detect Claude Code, Codex, or Cursor and install the full skill folder in user scope (migrating managed legacy Cursor project rules), then show next steps; or save defaults with `--profile` / `--project-id` |
107
- | `skills ensure / install / list / update / remove` | Install or update the bundled usage guide; shared directory aliases are handled once, unmanaged folders are skipped, protected links refused for mutations, and newer installed versions preserved unless forced; Claude user scope follows CLAUDE_CONFIG_DIR (blank values are unavailable) |
111
+ | Command | What it does |
112
+ | ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
113
+ | `open <target>` | First command for agents opening a share or artifactshareusercontent.com execution URL; ensures skills, then reads or suggests download |
114
+ | `share <path>` | Share an HTML, Markdown, PDF, or MP4 video file (up to 25 MiB; a `.pdf` must start with `%PDF-`, a `.mp4` needs an `ftyp` box) or a static-site folder; unspecified Home audiences use workspace when available, otherwise private (`--project`, `--home`, `--visibility`, `--key`, link expiry options) |
115
+ | `update <target> <path>` | Add a new version to an existing file (ID or share URL); optional `--label` adds a version note |
116
+ | `append <target> <path>` | Append a non-empty UTF-8 file without a separator: at Markdown source end or before `</body>` in HTML, falling back to source end; not for PDFs, videos, or static sites |
117
+ | `edit <target>` | Change title, sharing, link expiry, explicit viewers, or project placement |
118
+ | `delete <target>` | Permanently delete a file you shared |
119
+ | `artifacts delete <target>` | Alias of delete; permanently delete a file you shared |
120
+ | `resolve <value>` | Find files by URL, ID, title, or project name |
121
+ | `artifacts get <target>` | Read file source or static-site metadata and version totals; PDFs and videos have no text source, so use download |
122
+ | `artifacts versions <target>` | List retained versions and logical byte totals; continue with --cursor |
123
+ | `download <target>` | Save a file (a PDF or video as its original `.pdf` or `.mp4` bytes) or a whole static site locally |
124
+ | `comments list / post / edit / resolve / reopen / delete <target>` | Read, write, edit, resolve, reopen, and permanently delete comments |
125
+ | `projects list / create / edit` | List eligible project destinations; create and edit projects and audience |
126
+ | `move <target>` | Move an existing file into a project or back home; `edit` is preferred for new automation |
127
+ | `preview <file>` (alias of `preview start`) | Serve a local Markdown or HTML file with the product viewer look for browser annotation; local only, no sign-in, nothing uploaded; PDFs and videos cannot be previewed |
128
+ | `preview next` / `preview done` / `preview reply` / `preview stop` | Agent loop for a live preview: poll submitted annotation batches (oversized element text uses ownTextHash and a reader-only ownTextExcerpt above 16,000 UTF-16 code units), report fixed/skipped outcomes from stdin, reply into a thread, and stop the session |
129
+ | `login` / `logout` / `whoami` | Sign in, revoke a device-login credential before removing it locally, and check who you are |
130
+ | `doctor` | Diagnose token storage, auth, destination, network, and upload readiness — tells you the next command to run |
131
+ | `changelog` | Show the installed version, this release's notes, and the public updates page |
132
+ | `profiles list / use / import-token / delete` | Switch between local account profiles, import an issued token from stdin, and delete profile entries |
133
+ | `init` | Set up this directory: detect Claude Code, Codex, or Cursor and install the full skill folder in user scope (migrating managed legacy Cursor project rules), then show next steps; or save defaults with `--profile` / `--project-id` |
134
+ | `skills ensure / install / list / update / remove` | Install or update the bundled usage guide; shared directory aliases are handled once, unmanaged folders are skipped, protected links refused for mutations, and newer installed versions preserved unless forced; Claude user scope follows CLAUDE_CONFIG_DIR (blank values are unavailable) |
108
135
 
109
136
  Public command paths covered by this reference:
110
137
 
@@ -360,6 +387,34 @@ rotation and can be revoked from Settings → CLI sessions.
360
387
 
361
388
  ## Comment windows and posting limits
362
389
 
390
+ Text-anchor JSON may include `quote_before` and `quote_after`: the saved rendered
391
+ text on either side, with whitespace collapsed and adjacent spaces retained.
392
+ When searching HTML source, remove tags and collapse whitespace first. An empty
393
+ side from a viewer selection denotes the start or end of the document; for an
394
+ agent-created comment it means that side was not supplied. `version_id` names
395
+ the version where the comment originated, or is null if that version was deleted.
396
+ The attachment fields describe the displayed version instead: `unchecked`
397
+ means no browser has inspected that version, and `needs-check` means it has been
398
+ opened but the position could not be uniquely located. Viewer selections also
399
+ carry `ambiguous_at_creation` (including false), describing ambiguity at creation,
400
+ not attachment today. Agent and legacy anchors omit that key. Older servers may
401
+ omit all these additional fields. Artifact-level anchors are unchanged.
402
+
403
+ Text anchors also return `target_path`, the page the text is on. Single-file
404
+ artifacts return their entry page. On a multi-file site it is the file path
405
+ (for example `/docs/setup.html`), or for a single-page app the route path
406
+ (`/settings`) plus a hash route that starts with `#/` or `#!/`
407
+ (`/index.html#/billing`). Other fragments, such as `#intro`, are in-page anchors
408
+ and are not part of the path. Agents cannot post quoted-text comments on
409
+ multi-file sites; post whole-artifact comments there.
410
+
411
+ PDF comments that readers post from the comment panel carry the page that was
412
+ open. Their anchor keeps `kind: "artifact"` (with `quoted_text` and `state`
413
+ null) and adds `page_number`, plus `version_id` and `version_number` for the
414
+ version it was posted on. Both are null once that version is deleted, and
415
+ `version_number` is null for a version without a number. Other whole-artifact
416
+ anchors omit all three. Agents cannot post page comments.
417
+
363
418
  `comments list <target> --json` returns at most 50 threads, open first. Each
364
419
  thread contains its current first message and latest three replies, plus
365
420
  `message_count`, `reply_count` and `older_cursor`. These are partial histories.
@@ -516,3 +571,34 @@ Without tool filters, update/remove continue healthy targets after a conflict. P
516
571
  When a newer CLI installed the managed version, list/doctor report `update_available: false` and a `hint` containing "A newer CLI installed", with no update recommendation. Unforced skills install and skills update preserve the entire target, including temporary files and legacy rules. Explicit `--force` permits a downgrade, reported with both versions in `hint`; `--dry-run --force` reports the same intent without writing. Protected links and newer pending intents still refuse force.
517
572
 
518
573
  Writes prefer a private sibling `.artifactshare-staging-<uuid>` directory. If the parent is not writable or a commit crosses filesystems, the CLI stages inside the skill folder instead and still commits files by rename. Real install, update, ensure and automatic updates clean reserved staging directories and exact UUID-shaped `.artifactshare-<uuid>.tmp` regular files only when their modification times are more than ten minutes old before checking conflicts, including no-op selections except newer installed versions skipped by skills install or skills update. Diagnostics and dry runs never clean files. Unrelated names and symlink referents are never deleted. Failed writes roll back committed paths and remove staging; interrupted processes leave debris for the next mutation.
574
+
575
+ ## Read the source of an earlier version
576
+
577
+ Use `artifacts get <target> --version <version-id> --json`, or MCP
578
+ `get_artifact` with `version_id`, to read a published single-file version you
579
+ can access. There is no age limit. Omitting the parameter reads current content.
580
+ Only `artifacts get` accepts a value for `--version`; `-v` still prints the CLI
581
+ package version, as do root `--version` and root `-v`.
582
+ The returned `version_id` and `format` describe the source actually read.
583
+ Repeat the same selection with `offset` / `--offset` set to `next_offset` until
584
+ `truncated` is false. Static sites are unsupported; publisher credentials reject
585
+ version selection.
586
+
587
+ For an orphaned text comment, pass its non-null `anchor.version_id` to inspect
588
+ what the commenter saw. A null anchor id cannot select the original source.
589
+ Retention removal returns `version_removed` in CLI output or `version-removed`
590
+ in MCP/API (HTTP 410); omit the selection to inspect current content. Unknown, foreign, or
591
+ unpublished ids return not-found. Before updating, read again without a
592
+ version selection and use that current id for `--expected-version`.
593
+
594
+ Keyed `share` resends preserve visibility. A different explicit `--visibility` fails before a version is created, with an `edit <id> --visibility <value> --json` recovery command. The same value or no flag resends normally. Home normalizes `project` to `private` for comparison, matching creation.
595
+
596
+ Use `artifacts get <id> --json` to check `data.visibility` and `data.title` for HTML/Markdown artifacts. These describe the current artifact even when reading historical source.
597
+
598
+ ## Retained versions and logical storage
599
+
600
+ Run `artifacts versions <target> --json` for HTML, Markdown, or static sites. Each entry includes `version_id`, `created_at`, `size_bytes`, and `is_current`, plus available labels and creator metadata. Pages contain up to 50 entries, newest first. While `has_more` is true, pass `next_cursor` as `--cursor`; an invalid or wrong-artifact cursor requires restarting without it. Publication or pruning between pages is not a snapshot.
601
+
602
+ For human and agent credentials, updated servers return `retain_versions` (null means unlimited), `version_count`, and `total_size_bytes` in `artifacts get` and every `artifacts list` row, and on history pages. Counts and byte totals cover versions the caller can list, independently of the history page or source `--version`. Static-site history and totals include only published versions with a publication timestamp for every caller, including owners. Publisher credentials do not receive `version_count` or `total_size_bytes` and cannot list artifacts or read history. Publisher-created static-site versions may have a null `creator`. Static-site bytes sum all files in each version, including inherited files. Reused files count in each version. These are logical bytes, not physical storage, billing, or proof of object cleanup. Publisher-managed histories may exceed the policy because human-created and current versions are protected. Combine list pages and compare `total_size_bytes` client-side to find the largest artifacts.
603
+
604
+ Static-site `artifacts get` now succeeds with metadata only, without `content` or `format`; `--include`, `--version`, and `--offset` remain unsupported for sites. Updated CLI get explicitly requests metadata. Released source-only clients retain unsupported-kind, so open still suggests download. Publisher credentials can read their scoped current metadata and, for sites, retain_versions, without version counts or total sizes but cannot list history or use `get --include versions`. Existing human/agent access rules apply; unreadable artifacts return `target_not_found` (API 404), with failure JSON on stderr, empty stdout, and exit 1. Shared viewers retain history access with creator email redaction. All shared flags and supported target URL forms work with `artifacts versions`.