@artifactshare/cli 0.16.0 → 0.17.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artifactshare/cli",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "Upload and share HTML, Markdown, folders, and static sites from terminals, AI agents, automation, and CI.",
5
5
  "homepage": "https://artifactshare.com/connect",
6
6
  "repository": {
@@ -44,6 +44,8 @@ contain `$`, spaces, `*`, or `?`; use single quotes such as
44
44
 
45
45
  The browser share page opens HTML, Markdown, and static sites with its URL fragment (`#…`) and follows fragment changes inside the frame. Copy link includes the current fragment, so filtered views and Markdown headings can be shared. For static sites, only the entrypoint updates the share fragment; subpages leave it unchanged. This does not change CLI local preview.
46
46
 
47
+ 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.
48
+
47
49
  ## Quick reference
48
50
 
49
51
  | Task | Command |
@@ -146,6 +148,8 @@ npm exec --yes --package=@artifactshare/cli -- artifactshare share ./site-dir --
146
148
 
147
149
  ## Audience and visibility settings
148
150
 
151
+ Destination lists include only active projects you can post into. A private project permits its creator, a current workspace owner/admin on the team plan, or a verified contributor/manager. On free and plus, admin status alone does not permit placement in another member’s private project. Viewer access and individual artifact grants do not authorize placement. Agents and bots still require their fixed project and a verified contributor/manager grant for private projects; publisher credentials cannot select projects.
152
+
149
153
  Posting to a project delivers to the audience defined by that project. Without
150
154
  a destination, `share` posts to home. Choose the home audience by purpose:
151
155
 
@@ -708,3 +712,58 @@ refund. Edits, deletions, resolve/reopen and anchor reports consume nothing.
708
712
  Mutation readback contains only the affected thread window and changed message.
709
713
  `refresh_required: true` means the write committed but advisory readback failed:
710
714
  read that thread by ID; do not replay the write automatically.
715
+
716
+ ### Upload path safety
717
+
718
+ For `share`, `append`, and `update`, use a regular file or directory (`append`
719
+ requires one nonempty UTF-8 file). Relative selections stay in physical cwd and
720
+ reject linked components. Absolute selections trust parent directories but reject
721
+ a linked selection or included descendant. Never normalize `..`: every such
722
+ component is rejected; pass a direct absolute path. Copy linked content into the
723
+ selection or pass the target by absolute path. Hidden names, `__MACOSX`, excluded
724
+ dependency/metadata directories, and ignored OS filenames are skipped before
725
+ inspection. Other entries use `lstat`; cloud placeholders work with stable file
726
+ identities. Content is verified before authentication or project lookup, and auth
727
+ retries reuse it. `validation_failed` includes `details.path` and `details.reason`:
728
+ `parent_traversal`, `link`, `outside_cwd`, `not_found`, `changed`,
729
+ `unsupported_guarantee`, or `invalid_type`. Follow the specific hint; retry for
730
+ `changed` or `upload_read_failed` (filesystem errno in `details.errno`). POSIX uses
731
+ available `O_NOFOLLOW`; Windows uses the same handle identity checks and rejects
732
+ links reported by `lstat`. Neither detects every transient swap-and-restore or
733
+ same-identity, same-size in-place edit. See the CLI README for the full guarantee.
734
+
735
+ ## Local write recovery
736
+
737
+ Download accepts only unique artifact IDs matching `^[a-z0-9]{10}$`, including
738
+ IDs from list pages and the previous index.
739
+ Artifact IDs with surrounding whitespace are rejected, not trimmed, including
740
+ single-download targets. Remove the whitespace before retrying. URLs use normal
741
+ URL-to-ID resolution. Output parents may be links; their resolved directory identities are rechecked.
742
+ Linked output roots, indexes, and listed artifact trees are refused even with `--force`. Preflight checks every listed
743
+ artifact tree, including unchanged versions, and the index; unrelated content is
744
+ not walked. Network failures and invalid manifest paths, bodies, or identities are recorded per artifact;
745
+ every boundary violation stops further publication, including the final index.
746
+ Successful replacements retain originals and previous indexes in `data.backup_paths`
747
+ and report them in human output. Inspect those paths before manual cleanup.
748
+ Failed recovery also names retained paths in the error. Cleanup removes only
749
+ CLI-created temporary entries, never containers holding originals. Staging and
750
+ backups live in one private directory inside the output root for project
751
+ downloads, or in its parent for single downloads. Project index temporary files
752
+ use that same private directory so publication stays on the output filesystem.
753
+ Identity checks detect observed swaps;
754
+ Node path-based operations do not provide atomic confinement against arbitrary
755
+ concurrent changes.
756
+
757
+ Config-mode `init` preserves unknown keys and refuses links at `.artifactshare`
758
+ or `config.local.json`. Git worktrees/submodules save config normally but warn
759
+ instead of following `.git` files, links, or redirect metadata. Only a real
760
+ repository `.git` directory with regular or absent `info/exclude` is updated.
761
+ Follow `git_exclude_warning` to add the exact exclude line manually. Onboarding
762
+ without config arguments still installs user-scope skills.
763
+
764
+ Upload aliases use the stored filename for kind, filename, and content type.
765
+ Retry `changed` when an enumerated file disappears; correct `not_found` when a
766
+ relative path passes through a regular file. Both `share --help` and
767
+ `append --help` list `upload_read_failed` and all `validation_failed` reasons:
768
+ `link`, `outside_cwd`, `parent_traversal`, `changed`, `not_found`, `invalid_type`,
769
+ and `unsupported_guarantee`.
@@ -56,6 +56,7 @@ contain `$`, spaces, `*`, or `?`; use single quotes such as
56
56
  - Use `logout --profile <name> --json` to revoke a device-login credential before removing it locally; this keeps profile metadata. API-token profiles are removed locally only and their server token is not revoked.
57
57
  - Switch profiles with `profiles use <name> --json`; list with `profiles list --json`; remove a profile entry and its credential with `profiles delete <name> --json`.
58
58
  - When the user gives an Artifact Share URL, start with `open <artifact-id-or-url> --json`. It ensures this rule is installed or updated, then reads single-file artifacts or returns a `download` next command for static sites and multi-file artifacts.
59
+ - Destination lists include only active projects you can post into. A private project permits its creator, a current workspace owner/admin on the team plan, or a verified contributor/manager. On free and plus, admin status alone does not permit placement in another member’s private project. Viewer access and individual artifact grants do not authorize placement. Agents and bots still require their fixed project and a verified contributor/manager grant for private projects; publisher credentials cannot select projects.
59
60
  - Share with `share <path> --json`. In JSON output, give the user `data.artifact.url`; the artifact ID is `data.artifact.id`. Do not rerun `share` just to inspect the JSON shape: without `--key`, each successful run creates a new artifact. Posting to a project delivers to the audience defined by that project. Pick it with `--project-id <id>` or `--project <name>` (by exact name), or use the saved default. With no destination, share posts to home. Choose `home_audience` by purpose: use `config set home_audience private --scope user --json` for a personal safe default in this CLI environment, use `--scope repository` only for a policy agreed by all participants, and use `--visibility private|workspace|link` for one home post. For link sharing, pass exactly one of `--link-expires-at <RFC3339 UTC>` or `--no-link-expiry`; omit both to use the workspace default. Confirm the resolved audience with `config get home_audience --scope effective --json`; `--grant-email` does not change the resolved default.
60
61
  - If a successful `share` result contains `data.warnings`, tell the user each
61
62
  warning explicitly. `slack_reauthorization_required` means project Slack
@@ -130,6 +131,8 @@ Owners with unrestricted credentials can use `edit <target> --retain-versions N`
130
131
 
131
132
  The browser share page opens HTML, Markdown, and static sites with its URL fragment (`#…`) and follows fragment changes inside the frame. Copy link includes the current fragment, so filtered views and Markdown headings can be shared. For static sites, only the entrypoint updates the share fragment; subpages leave it unchanged. This does not change CLI local preview.
132
133
 
134
+ 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.
135
+
133
136
  ## Static-site scripts and data
134
137
 
135
138
  Folder shares support WebAssembly, same-origin worker files, and `blob:` workers.
@@ -267,3 +270,59 @@ refund. Edits, deletions, resolve/reopen and anchor reports consume nothing.
267
270
  Mutation readback contains only the affected thread window and changed message.
268
271
  `refresh_required: true` means the write committed but advisory readback failed:
269
272
  read that thread by ID; do not replay the write automatically.
273
+
274
+
275
+ ### Upload path safety
276
+
277
+ For `share`, `append`, and `update`, use a regular file or directory (`append`
278
+ requires one nonempty UTF-8 file). Relative selections stay in physical cwd and
279
+ reject linked components. Absolute selections trust parent directories but reject
280
+ a linked selection or included descendant. Never normalize `..`: every such
281
+ component is rejected; pass a direct absolute path. Copy linked content into the
282
+ selection or pass the target by absolute path. Hidden names, `__MACOSX`, excluded
283
+ dependency/metadata directories, and ignored OS filenames are skipped before
284
+ inspection. Other entries use `lstat`; cloud placeholders work with stable file
285
+ identities. Content is verified before authentication or project lookup, and auth
286
+ retries reuse it. `validation_failed` includes `details.path` and `details.reason`:
287
+ `parent_traversal`, `link`, `outside_cwd`, `not_found`, `changed`,
288
+ `unsupported_guarantee`, or `invalid_type`. Follow the specific hint; retry for
289
+ `changed` or `upload_read_failed` (filesystem errno in `details.errno`). POSIX uses
290
+ available `O_NOFOLLOW`; Windows uses the same handle identity checks and rejects
291
+ links reported by `lstat`. Neither detects every transient swap-and-restore or
292
+ same-identity, same-size in-place edit. See the CLI README for the full guarantee.
293
+
294
+ ## Local write recovery
295
+
296
+ Download accepts only unique artifact IDs matching `^[a-z0-9]{10}$`, including
297
+ IDs from list pages and the previous index.
298
+ Artifact IDs with surrounding whitespace are rejected, not trimmed, including
299
+ single-download targets. Remove the whitespace before retrying. URLs use normal
300
+ URL-to-ID resolution. Output parents may be links; their resolved directory identities are rechecked.
301
+ Linked output roots, indexes, and listed artifact trees are refused even with `--force`. Preflight checks every listed
302
+ artifact tree, including unchanged versions, and the index; unrelated content is
303
+ not walked. Network failures and invalid manifest paths, bodies, or identities are recorded per artifact;
304
+ every boundary violation stops further publication, including the final index.
305
+ Successful replacements retain originals and previous indexes in `data.backup_paths`
306
+ and report them in human output. Inspect those paths before manual cleanup.
307
+ Failed recovery also names retained paths in the error. Cleanup removes only
308
+ CLI-created temporary entries, never containers holding originals. Staging and
309
+ backups live in one private directory inside the output root for project
310
+ downloads, or in its parent for single downloads. Project index temporary files
311
+ use that same private directory so publication stays on the output filesystem.
312
+ Identity checks detect observed swaps;
313
+ Node path-based operations do not provide atomic confinement against arbitrary
314
+ concurrent changes.
315
+
316
+ Config-mode `init` preserves unknown keys and refuses links at `.artifactshare`
317
+ or `config.local.json`. Git worktrees/submodules save config normally but warn
318
+ instead of following `.git` files, links, or redirect metadata. Only a real
319
+ repository `.git` directory with regular or absent `info/exclude` is updated.
320
+ Follow `git_exclude_warning` to add the exact exclude line manually. Onboarding
321
+ without config arguments still installs user-scope skills.
322
+
323
+ Upload aliases use the stored filename for kind, filename, and content type.
324
+ Retry `changed` when an enumerated file disappears; correct `not_found` when a
325
+ relative path passes through a regular file. Both `share --help` and
326
+ `append --help` list `upload_read_failed` and all `validation_failed` reasons:
327
+ `link`, `outside_cwd`, `parent_traversal`, `changed`, `not_found`, `invalid_type`,
328
+ and `unsupported_guarantee`.