@artifactshare/cli 0.14.0 → 0.15.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 CHANGED
@@ -5,6 +5,29 @@ For user-facing announcements, see https://artifactshare.com/updates?product=cli
5
5
 
6
6
  ## Unreleased
7
7
 
8
+ ## 0.15.1 - 2026-10-09
9
+
10
+ - Document API-only static-site inheritance, base-version conflicts, repeated deletion paths, and physical storage accounting in the bundled instructions.
11
+
12
+ - Internal: shared sandbox reporter includes bounded diagnostic samples and CSP disposition, and buffers early diagnostics until the parent readiness check.
13
+
14
+ - Explain DuckDB-WASM runtime extension loading and the optional bundled extension repository in the bundled skill and Cursor rule.
15
+
16
+ - Document static-site WebAssembly and worker support, including DuckDB-WASM from jsDelivr, in the bundled agent instructions.
17
+
18
+ ## 0.15.0 - 2026-10-08
19
+
20
+ - Add owner-only `edit --retain-versions N` (or `all`) to prune old versions, release storage, and preserve version numbers.
21
+
22
+ - Preserve local-preview highlights and anchor updates after back/forward restoration.
23
+
24
+ - Internal: harden shared preview-reporter generation guards and preserve text verification when page code replaces array methods.
25
+
26
+ - Internal: build the preview reporter from typed modules and test the shared anchor engine directly, preserving annotation and handshake behavior.
27
+
28
+ - Preserve legacy preview annotations, including long quotes and trimmed context, and skip malformed saved records individually with a warning.
29
+ - Resolve quoted comments in the viewer using exact context; expose optional `anchor.position_state` (`attached`, `needs-check`, `unchecked`) while retaining `anchor.state`. Local preview uses the same selectors and paints highlights without changing document text nodes.
30
+
8
31
  ## 0.14.0 - 2026-09-30
9
32
 
10
33
  - Include the Viewer version number in update JSON at `data.version.number`, with or without a label; retain compatibility with older servers.
package/README.md CHANGED
@@ -6,6 +6,10 @@ The official CLI to open, share, and update files, folders, and static sites on
6
6
 
7
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.
8
8
 
9
+ ## WebAssembly dashboards
10
+
11
+ 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.
12
+
9
13
  ## Quick start
10
14
 
11
15
  Requires Node.js 22 or later.
@@ -179,6 +183,8 @@ npm exec --yes --package=@artifactshare/cli -- artifactshare config get home_aud
179
183
 
180
184
  Use `--scope repository` only for a policy agreed by all repository participants, and pass `--visibility private|workspace|link` for a one-time home override. For link sharing, pass exactly one of `--link-expires-at <RFC3339 UTC>` or `--no-link-expiry`; omit both to use the workspace default. For project creation, pass `projects create <name> --visibility private|workspace`; persistent project defaults are documented in `projects create --help`. Pass `--no-slack-notify` to suppress the project Slack notification for one post.
181
185
 
186
+ Owners can run `edit <target> --retain-versions 24 --json` to keep the latest 24 published versions, or `--retain-versions all` to clear the limit. Setting or lowering the limit immediately deletes older versions and releases their storage. The response includes `retain_versions` and `deleted_versions`. Deleted version URLs return 404; comments and surviving version numbers remain. This requires unrestricted owner credentials; agent-preset credentials cannot change retention. The edit API accepts the same setting as `retain_versions` (a positive integer or `null`) at `POST /api/cli/shareables/:id/edit`.
187
+
182
188
  Link sharing is available on every plan; Team workspaces can turn it off. A workspace policy may allow a finite expiry from 1 to 365 days or no expiration; the initial default is 30 days and the initial maximum is no limit. Share and edit results include the confirmed `link_expires_at` UTC timestamp or `null`. If a link command fails, use `link_sharing_plan_required` as a legacy code (no plan limit applies today), `link_sharing_disabled` to ask the workspace owner or a Team owner or admin to enable the workspace setting, or `link_expiry_invalid` to correct the timestamp or choose `--no-link-expiry` when allowed. Under the default thresholds, `link_publish_rate_limited` means the service observed 20 counted files before a publication in a Free workspace less than 14 days old during its rolling 24-hour window. A file counts once for its most recent change to link visibility, or for creation with link visibility while it remains link-shared. Share with specific people. `error.recovery` indicates `retry_later`; use `error.message` and `error.hint` for when to retry. Retry the link publication later instead of retrying immediately with unchanged input.
183
189
 
184
190
  For the complete settings reference, `home_audience` is the canonical home key. `default_artifact_visibility` remains a compatibility alias, and `default_project_visibility` is the advanced default for `projects create`. User and repository settings are resolved with repository taking precedence, followed by user and product default `workspace`; home also checks the compatibility alias at each scope. Use `config get home_audience --scope effective --json` to confirm the resolved audience. Keyless `config get --json` returns only `home_audience`; pass an explicit key to read either other setting. These settings only affect new home posts and project creation; update, edit, Web, and MCP defaults are unchanged.
@@ -253,3 +259,37 @@ version menu and full history show the label as plain text.
253
259
  `GET /api/shareables/:id/versions` remains a current-version lookup.
254
260
  Labels are update-only: initial uploads, `share --key`, `append`, preview,
255
261
  bridge publishing, and MCP update inputs do not accept them.
262
+
263
+ ### Quoted comment positions
264
+
265
+ Quoted comments are resolved in the viewer using the exact quote and surrounding context, never the nearest repeated words. `--quote-before` and `--quote-after` accept up to 400 characters per side; preserve spaces next to the quote. Creation does not search the artifact. Optional `anchor.position_state` is `unchecked` until that version is viewed, then `attached` or `needs-check`. Only `attached` maps to `anchor.state: attached`; both other states map to `orphaned`. Older responses may omit `position_state`. Local preview uses the same strict resolution on every reload and preserves the original quote when its position needs checking.
266
+
267
+ Older comments may have lost spaces at the edges of their saved context. The viewer tries those boundary spaces only and attaches only at one unique position. It cannot reconstruct missing separators inside old context (for example, `ab` saved across list items now measured as `a b`); those comments need a position check.
268
+
269
+ ### API-only static-site inheritance
270
+
271
+ `POST /api/shareables/:id/versions?artifact_kind=static_site` accepts one
272
+ `base_version` and repeated `delete_path` query parameters. For example,
273
+ `?artifact_kind=static_site&base_version=v1&delete_path=data/old.parquet&delete_path=old.js`
274
+ with multipart `file` parts for `data/a.parquet` replaces that data file, removes
275
+ the two listed paths, and inherits all other files without copying their objects.
276
+ The base must be the current published version; a stale base returns HTTP 409
277
+ `version_conflict`. It also supplies the expected version for agent credentials.
278
+ If `expected_version` is supplied, it must equal the base (otherwise HTTP 400
279
+ `validation-failed`). Neither parameter changes write permissions.
280
+
281
+ Deletion paths use the same normalization and validation as uploaded paths.
282
+ Sending and deleting the same path is invalid. A case-only addition requires
283
+ explicitly deleting the old spelling. An absent deletion path is harmless.
284
+ A base permits zero sent files, provided the resulting manifest still includes
285
+ `index.html` or `index.md`. Entrypoint precedence, file-count, total-size, and
286
+ case-collision checks apply to the complete resulting manifest. Without a base,
287
+ the existing full replacement behavior applies. Empty or repeated bases,
288
+ deletion without a base, and inheritance parameters on other artifact kinds
289
+ return HTTP 400 `validation-failed`.
290
+
291
+ Version size is the logical sum of that version's files. Workspace quota counts
292
+ physical objects once across retained versions; only sent files add bytes.
293
+ Pruning keeps objects referenced by remaining versions. Version URLs retain
294
+ immutable manifests. This is a REST API feature: there are no CLI `update`
295
+ flags, MCP inputs, or bridge inputs for inheritance.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { d as previewsDir, p as processAlive, t as CURSOR_ACP_ACK_TIMEOUT_MS } from "./cursor-notification-BBGHJ5v5.js";
2
+ import { d as previewsDir, p as processAlive, t as CURSOR_ACP_ACK_TIMEOUT_MS } from "./cursor-notification-Hz6fuACK.js";
3
3
  import { closeSync, mkdirSync, openSync, readFileSync, renameSync, rmSync, statSync, writeFileSync, writeSync } from "node:fs";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { spawn } from "node:child_process";
@@ -37,16 +37,24 @@ function isThreadMessage(value) {
37
37
  function isPreviewAnnotation(value) {
38
38
  if (typeof value !== "object" || value === null) return false;
39
39
  const record = value;
40
- return typeof record.thread === "string" && Number.isInteger(record.generation) && typeof record.status === "string" && ANNOTATION_STATUSES.has(record.status) && isPreviewAnchor(record.anchor) && typeof record.comment === "string" && Array.isArray(record.messages) && record.messages.every(isThreadMessage) && (record.batch_id === null || typeof record.batch_id === "string") && typeof record.created_at === "string" && typeof record.updated_at === "string" && (record.summary === null || typeof record.summary === "string");
40
+ return typeof record.thread === "string" && Number.isInteger(record.generation) && typeof record.status === "string" && ANNOTATION_STATUSES.has(record.status) && isPreviewAnchor(record.anchor, { stored: true }) && typeof record.comment === "string" && Array.isArray(record.messages) && record.messages.every(isThreadMessage) && (record.batch_id === null || typeof record.batch_id === "string") && typeof record.created_at === "string" && typeof record.updated_at === "string" && (record.summary === null || typeof record.summary === "string");
41
41
  }
42
- function isPreviewAnchor(value) {
42
+ function isPreviewAnchor(value, options = {}) {
43
43
  if (typeof value !== "object" || value === null) return false;
44
44
  const record = value;
45
45
  if (record.kind === "artifact") return true;
46
46
  if (record.state !== "attached" && record.state !== "orphaned") return false;
47
47
  const optionalString = (name) => record[name] === void 0 || typeof record[name] === "string";
48
48
  if (record.kind === "element") return optionalString("ownText") && optionalString("tagName") && typeof record.selector === "string" && typeof record.label === "string" && typeof record.contextText === "string";
49
- if (record.kind === "text") return typeof record.quotedText === "string" && typeof record.prefixText === "string" && typeof record.suffixText === "string" && (record.textStart === null || Number.isInteger(record.textStart)) && (record.textEnd === null || Number.isInteger(record.textEnd)) && (record.cssPath === null || typeof record.cssPath === "string");
49
+ if (record.kind === "text") {
50
+ if (record.position_state !== void 0 && ![
51
+ "attached",
52
+ "needs-check",
53
+ "unchecked"
54
+ ].includes(record.position_state)) return false;
55
+ if (record.selectorFormat !== void 0 && (record.selectorFormat !== "normalized-v1" || typeof record.textHash !== "string" || !/^[a-f0-9]{64}$/.test(record.textHash) || typeof record.ambiguousAtCreation !== "boolean" || !Number.isSafeInteger(record.textStart) || !Number.isSafeInteger(record.textEnd) || record.textStart < 0 || typeof record.quotedText !== "string" || record.textEnd - record.textStart !== record.quotedText.length)) return false;
56
+ return typeof record.quotedText === "string" && (options.stored || record.quotedText.length > 0 && record.quotedText.length <= 1e3) && typeof record.prefixText === "string" && (options.stored || record.prefixText.length <= 400) && typeof record.suffixText === "string" && (options.stored || record.suffixText.length <= 400) && (record.textStart === null || Number.isInteger(record.textStart)) && (record.textEnd === null || Number.isInteger(record.textEnd)) && (record.cssPath === null || typeof record.cssPath === "string");
57
+ }
50
58
  return false;
51
59
  }
52
60
  //#endregion