@artifactshare/cli 0.15.3 → 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/CHANGELOG.md +42 -0
- package/README.md +189 -3
- package/dist/index.js +1199 -385
- package/package.json +1 -1
- package/skills/artifactshare/SKILL.md +162 -23
- package/skills/artifactshare/artifactshare.mdc +136 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artifactshare/cli",
|
|
3
|
-
"version": "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,27 +44,30 @@ 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
|
-
| Task | Command
|
|
50
|
-
| ------------------------ |
|
|
51
|
-
| Share a file or folder | `share <path> --json`
|
|
52
|
-
| Share a link with expiry | `share <path> --visibility link --link-expires-at '<RFC3339 UTC>' --json`
|
|
53
|
-
| Replace with same URL | `update <target> <path> --json`
|
|
54
|
-
| Append to same URL | `append <target> <path> --json`
|
|
55
|
-
| Read back source | `artifacts get <target> --json`
|
|
56
|
-
| Download a site bundle | `download <target> --output ./out --json`
|
|
57
|
-
| Download a whole project | `download --project-id <id> --output ./out --json`
|
|
58
|
-
| List your artifacts | `artifacts list --json`
|
|
59
|
-
| Post a comment | `comments post <target> --body '<text>' --json`
|
|
60
|
-
| Read comments | `comments list <target> --json`
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
51
|
+
| Task | Command |
|
|
52
|
+
| ------------------------ | ----------------------------------------------------------------------------------- |
|
|
53
|
+
| Share a file or folder | `share <path> --json` |
|
|
54
|
+
| Share a link with expiry | `share <path> --visibility link --link-expires-at '<RFC3339 UTC>' --json` |
|
|
55
|
+
| Replace with same URL | `update <target> <path> --json` |
|
|
56
|
+
| Append to same URL | `append <target> <path> --json` |
|
|
57
|
+
| Read back source | `artifacts get <target> --json` |
|
|
58
|
+
| Download a site bundle | `download <target> --output ./out --json` |
|
|
59
|
+
| Download a whole project | `download --project-id <id> --output ./out --json` |
|
|
60
|
+
| List your artifacts | `artifacts list --json` |
|
|
61
|
+
| Post a comment | `comments post <target> --body '<text>' --json` |
|
|
62
|
+
| Read comments | `comments list <target> --json` |
|
|
63
|
+
| Read older replies | `comments list <target> --thread-id <id> --before <older_cursor> --limit 50 --json` |
|
|
64
|
+
| Change title or sharing | `edit <target> --title 'New' --json` |
|
|
65
|
+
| Move to a project | `edit <target> --project-id <id> --json` |
|
|
66
|
+
| Create a project | `projects create 'Name' --json` |
|
|
67
|
+
| Find an ID from a title | `resolve <value> --json` |
|
|
68
|
+
| Open a share URL | `open <url> --json` |
|
|
69
|
+
| Preview a local file | `preview <file> --json` (local, no sign-in) |
|
|
70
|
+
| Log out | `logout --profile <name> --json` |
|
|
68
71
|
|
|
69
72
|
## Authentication
|
|
70
73
|
|
|
@@ -145,6 +148,8 @@ npm exec --yes --package=@artifactshare/cli -- artifactshare share ./site-dir --
|
|
|
145
148
|
|
|
146
149
|
## Audience and visibility settings
|
|
147
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
|
+
|
|
148
153
|
Posting to a project delivers to the audience defined by that project. Without
|
|
149
154
|
a destination, `share` posts to home. Choose the home audience by purpose:
|
|
150
155
|
|
|
@@ -285,11 +290,14 @@ npm exec --yes --package=@artifactshare/cli -- artifactshare delete <artifact-id
|
|
|
285
290
|
```
|
|
286
291
|
|
|
287
292
|
- Owners with unrestricted credentials can set `edit <target> --retain-versions N`
|
|
288
|
-
to keep the latest N published versions, or `--retain-versions all` to keep all
|
|
289
|
-
future versions. Setting or lowering retention immediately deletes older
|
|
293
|
+
to keep the latest N eligible published versions, or `--retain-versions all` to keep all
|
|
294
|
+
future versions. For files created by or assigned to a publisher client, this counts only published publisher versions (including earlier clients) and keeps every version people added, even when an unrestricted owner changes the setting. Other files keep counting all published versions. The current version is always kept. Setting or lowering retention immediately deletes older eligible
|
|
290
295
|
versions; the response reports `retain_versions` and `deleted_versions`.
|
|
291
|
-
|
|
292
|
-
|
|
296
|
+
Owners can also use the file history panel, which confirms existing removals.
|
|
297
|
+
Authorized viewers of versions removed by retention see an explanation and
|
|
298
|
+
a latest-version link (HTTP 410). Unknown IDs still return 404 for signed-in
|
|
299
|
+
viewers. Clearing the limit never restores deleted content. Comments and
|
|
300
|
+
surviving version numbers remain. Agent-preset credentials cannot change retention.
|
|
293
301
|
- `edit` changes title, visibility, explicit viewers, or project placement
|
|
294
302
|
without adding a new version.
|
|
295
303
|
- Set `--visibility link` with `--link-expires-at <RFC3339 UTC>` for a finite
|
|
@@ -628,3 +636,134 @@ physical objects once across retained versions; only sent files add bytes.
|
|
|
628
636
|
Pruning keeps objects referenced by remaining versions. Version URLs retain
|
|
629
637
|
immutable manifests. This is a REST API feature: there are no CLI `update`
|
|
630
638
|
flags, MCP inputs, or bridge inputs for inheritance.
|
|
639
|
+
|
|
640
|
+
### Publisher device credentials (API only)
|
|
641
|
+
|
|
642
|
+
Versions added with publisher credentials are scheduled updates: content and live viewers refresh, but list order, feeds, unread indicators, and human update labels do not change. Browser history marks Scheduled update without exposing client names. API `updated_at` remains the actual mutation time; internal `activity_at` controls human activity ordering. Initial creation and versions published through other credentials keep their existing behavior.
|
|
643
|
+
|
|
644
|
+
The device API accepts `preset: "publisher"` with a required `device_name`.
|
|
645
|
+
Names are trimmed, NFC-normalized, case-sensitive, and limited to 1–100 Unicode
|
|
646
|
+
letters, marks, numbers, ASCII spaces, or `._-()`. The browser approver explicitly
|
|
647
|
+
creates a new client or continues one of their existing clients in that workspace.
|
|
648
|
+
Names cannot be edited on the approval screen: if a name already exists, continue
|
|
649
|
+
that client or request login again with a different name. Only explicit continuation
|
|
650
|
+
restores access to earlier files; `device_id` never selects a client.
|
|
651
|
+
|
|
652
|
+
A publisher can create private HTML, Markdown, or static-site artifacts in the
|
|
653
|
+
approver's home. Static sites use `POST /api/shareables/uploads?artifact_kind=static_site`.
|
|
654
|
+
It can manage only artifacts created by or assigned to its client, still owned by
|
|
655
|
+
that approver in the same workspace, including after the owner shares or moves them.
|
|
656
|
+
Single-file versions require `expected_version`. Static-site versions accept
|
|
657
|
+
`artifact_kind=static_site` with either `expected_version` for replacement or
|
|
658
|
+
`base_version` for changed-files uploads and repeated `delete_path` removals.
|
|
659
|
+
The base must be current. Version uploads preserve audience, location and retention.
|
|
660
|
+
|
|
661
|
+
On artifacts created by or assigned to a publisher client, retention counts only published versions added with publisher credentials, including earlier clients, and keeps every other version. This also applies to unrestricted owner edits. The newest N publisher versions and every current version are kept; drafts do not count. Unmanaged artifacts continue to count all published versions.
|
|
662
|
+
|
|
663
|
+
The exact `GET /api/cli/artifacts/:id/download` returns raw source bytes for
|
|
664
|
+
single files and a JSON manifest with version id, paths and SHA-256 hashes for
|
|
665
|
+
static sites. Individual `download/*` requests are denied. `GET /api/cli/artifacts/:id`
|
|
666
|
+
includes visibility; static-site readback contains metadata only. No `include`
|
|
667
|
+
expansions are allowed. `DELETE /api/cli/artifacts/:id` deletes the artifact.
|
|
668
|
+
POST or PATCH `/api/cli/shareables/:id/edit` accepts only `retain_versions`, a
|
|
669
|
+
positive integer or null. Setting a limit prunes older versions immediately;
|
|
670
|
+
clearing it never restores deleted content. Other presets remain POST-only.
|
|
671
|
+
|
|
672
|
+
The owner can assign an existing artifact using an unrestricted credential or
|
|
673
|
+
browser session: `POST /api/cli/artifacts/:id/adopt` with
|
|
674
|
+
`{"publisher_client_id":"client1"}`. Obtain the verified client id from whoami or
|
|
675
|
+
doctor. Assignment replaces the previous client's access and is audited even when
|
|
676
|
+
repeated; historical creation attribution stays unchanged. Publisher credentials
|
|
677
|
+
cannot adopt. There is no adoption UI or CLI command.
|
|
678
|
+
|
|
679
|
+
Other clients' artifacts, list, resolve, comments, audience/title/expiry edits,
|
|
680
|
+
move, projects, append and upsert remain denied. Existing presets' download and
|
|
681
|
+
readback responses are unchanged. CLI publisher login/resume and publishing/download
|
|
682
|
+
workflows remain unsupported; use the API. Credentials retain their client across
|
|
683
|
+
rotation and can be revoked from Settings → CLI sessions.
|
|
684
|
+
|
|
685
|
+
## Comment windows and posting limits
|
|
686
|
+
|
|
687
|
+
`comments list <target> --json` returns at most 50 threads, open first. Each
|
|
688
|
+
thread contains its current first message and latest three replies, plus
|
|
689
|
+
`message_count`, `reply_count` and `older_cursor`. These are partial histories.
|
|
690
|
+
Use `comments list <target> --thread-id <id> --before <older_cursor> --limit 50
|
|
691
|
+
--json` for older replies. Repeat with the returned cursor until it is null;
|
|
692
|
+
merge by message ID and display in `(created_at, message_id)` order. Each page
|
|
693
|
+
also includes the current first message. Cursors remain usable after their
|
|
694
|
+
boundary message is deleted. `--around-message-id <id>` selects a bounded page
|
|
695
|
+
containing a message; do not combine it with `--before`.
|
|
696
|
+
|
|
697
|
+
A thread holds 500 currently stored messages, including its first message.
|
|
698
|
+
`thread_capacity` means start a new thread. Existing excess messages are kept;
|
|
699
|
+
deletions can restore space. Deleting the first message promotes the next
|
|
700
|
+
earliest message; deleting the last removes the thread and anchor. Resolved
|
|
701
|
+
threads still refuse replies.
|
|
702
|
+
|
|
703
|
+
Creation and replies share 20 admissions per authenticated user and artifact
|
|
704
|
+
per fixed UTC minute across browser, CLI, MCP and API tokens. Adjacent minute
|
|
705
|
+
boundaries can admit 40 posts within a sliding 60 seconds. `rate_limited`
|
|
706
|
+
includes `retry_after_seconds` and UTC `retry_at`; HTTP also sends `Retry-After`.
|
|
707
|
+
Keep unsent content and retry after that time. Invalid requests, capacity refusals
|
|
708
|
+
and closed-thread refusals observed before admission consume nothing. Rate
|
|
709
|
+
refusals do not increment the counter; quota storage failures refuse the post.
|
|
710
|
+
Once admitted, commit failures and status/version/capacity races consume the admission without a
|
|
711
|
+
refund. Edits, deletions, resolve/reopen and anchor reports consume nothing.
|
|
712
|
+
Mutation readback contains only the affected thread window and changed message.
|
|
713
|
+
`refresh_required: true` means the write committed but advisory readback failed:
|
|
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
|
|
@@ -126,10 +127,12 @@ version menu and full history show the label as plain text.
|
|
|
126
127
|
Labels are update-only: initial uploads, `share --key`, `append`, preview,
|
|
127
128
|
bridge publishing, and MCP update inputs do not accept them.
|
|
128
129
|
|
|
129
|
-
Owners with unrestricted credentials can use `edit <target> --retain-versions N` to keep the latest N versions, or `--retain-versions all` to clear the limit. Setting or lowering retention prunes older published versions immediately; the response includes `retain_versions` and `deleted_versions`. Comments and surviving version numbers remain. Agent-preset credentials cannot change retention.
|
|
130
|
+
Owners with unrestricted credentials can use `edit <target> --retain-versions N` to keep the latest N eligible published versions, or `--retain-versions all` to clear the limit. For files created by or assigned to a publisher client, this counts only published publisher versions (including earlier clients) and keeps every version people added, even when an unrestricted owner changes the setting. Other files keep counting all published versions. The current version is always kept. Setting or lowering retention prunes older eligible published versions immediately; the response includes `retain_versions` and `deleted_versions`. Owners can also change this setting in file history, with confirmation before existing versions are removed. Authorized viewers of removed versions see an explanation and a latest-version link (HTTP 410). Clearing never restores deleted content. Comments and surviving version numbers remain. Agent-preset credentials cannot change retention.
|
|
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.
|
|
@@ -191,3 +194,135 @@ physical objects once across retained versions; only sent files add bytes.
|
|
|
191
194
|
Pruning keeps objects referenced by remaining versions. Version URLs retain
|
|
192
195
|
immutable manifests. This is a REST API feature: there are no CLI `update`
|
|
193
196
|
flags, MCP inputs, or bridge inputs for inheritance.
|
|
197
|
+
|
|
198
|
+
### Publisher device credentials (API only)
|
|
199
|
+
|
|
200
|
+
Versions added with publisher credentials are scheduled updates: content and live viewers refresh, but list order, feeds, unread indicators, and human update labels do not change. Browser history marks Scheduled update without exposing client names. API `updated_at` remains the actual mutation time; internal `activity_at` controls human activity ordering. Initial creation and versions published through other credentials keep their existing behavior.
|
|
201
|
+
|
|
202
|
+
The device API accepts `preset: "publisher"` with a required `device_name`.
|
|
203
|
+
Names are trimmed, NFC-normalized, case-sensitive, and limited to 1–100 Unicode
|
|
204
|
+
letters, marks, numbers, ASCII spaces, or `._-()`. The browser approver explicitly
|
|
205
|
+
creates a new client or continues one of their existing clients in that workspace.
|
|
206
|
+
Names cannot be edited on the approval screen: if a name already exists, continue
|
|
207
|
+
that client or request login again with a different name. Only explicit continuation
|
|
208
|
+
restores access to earlier files; `device_id` never selects a client.
|
|
209
|
+
|
|
210
|
+
A publisher can create private HTML, Markdown, or static-site artifacts in the
|
|
211
|
+
approver's home. Static sites use `POST /api/shareables/uploads?artifact_kind=static_site`.
|
|
212
|
+
It can manage only artifacts created by or assigned to its client, still owned by
|
|
213
|
+
that approver in the same workspace, including after the owner shares or moves them.
|
|
214
|
+
Single-file versions require `expected_version`. Static-site versions accept
|
|
215
|
+
`artifact_kind=static_site` with either `expected_version` for replacement or
|
|
216
|
+
`base_version` for changed-files uploads and repeated `delete_path` removals.
|
|
217
|
+
The base must be current. Version uploads preserve audience, location and retention.
|
|
218
|
+
|
|
219
|
+
On artifacts created by or assigned to a publisher client, retention counts only published versions added with publisher credentials, including earlier clients, and keeps every other version. This also applies to unrestricted owner edits. The newest N publisher versions and every current version are kept; drafts do not count. Unmanaged artifacts continue to count all published versions.
|
|
220
|
+
|
|
221
|
+
The exact `GET /api/cli/artifacts/:id/download` returns raw source bytes for
|
|
222
|
+
single files and a JSON manifest with version id, paths and SHA-256 hashes for
|
|
223
|
+
static sites. Individual `download/*` requests are denied. `GET /api/cli/artifacts/:id`
|
|
224
|
+
includes visibility; static-site readback contains metadata only. No `include`
|
|
225
|
+
expansions are allowed. `DELETE /api/cli/artifacts/:id` deletes the artifact.
|
|
226
|
+
POST or PATCH `/api/cli/shareables/:id/edit` accepts only `retain_versions`, a
|
|
227
|
+
positive integer or null. Setting a limit prunes older versions immediately;
|
|
228
|
+
clearing it never restores deleted content. Other presets remain POST-only.
|
|
229
|
+
|
|
230
|
+
The owner can assign an existing artifact using an unrestricted credential or
|
|
231
|
+
browser session: `POST /api/cli/artifacts/:id/adopt` with
|
|
232
|
+
`{"publisher_client_id":"client1"}`. Obtain the verified client id from whoami or
|
|
233
|
+
doctor. Assignment replaces the previous client's access and is audited even when
|
|
234
|
+
repeated; historical creation attribution stays unchanged. Publisher credentials
|
|
235
|
+
cannot adopt. There is no adoption UI or CLI command.
|
|
236
|
+
|
|
237
|
+
Other clients' artifacts, list, resolve, comments, audience/title/expiry edits,
|
|
238
|
+
move, projects, append and upsert remain denied. Existing presets' download and
|
|
239
|
+
readback responses are unchanged. CLI publisher login/resume and publishing/download
|
|
240
|
+
workflows remain unsupported; use the API. Credentials retain their client across
|
|
241
|
+
rotation and can be revoked from Settings → CLI sessions.
|
|
242
|
+
|
|
243
|
+
## Comment windows and posting limits
|
|
244
|
+
|
|
245
|
+
`comments list <target> --json` returns at most 50 threads, open first. Each
|
|
246
|
+
thread contains its current first message and latest three replies, plus
|
|
247
|
+
`message_count`, `reply_count` and `older_cursor`. These are partial histories.
|
|
248
|
+
Use `comments list <target> --thread-id <id> --before <older_cursor> --limit 50
|
|
249
|
+
--json` for older replies. Repeat with the returned cursor until it is null;
|
|
250
|
+
merge by message ID and display in `(created_at, message_id)` order. Each page
|
|
251
|
+
also includes the current first message. Cursors remain usable after their
|
|
252
|
+
boundary message is deleted. `--around-message-id <id>` selects a bounded page
|
|
253
|
+
containing a message; do not combine it with `--before`.
|
|
254
|
+
|
|
255
|
+
A thread holds 500 currently stored messages, including its first message.
|
|
256
|
+
`thread_capacity` means start a new thread. Existing excess messages are kept;
|
|
257
|
+
deletions can restore space. Deleting the first message promotes the next
|
|
258
|
+
earliest message; deleting the last removes the thread and anchor. Resolved
|
|
259
|
+
threads still refuse replies.
|
|
260
|
+
|
|
261
|
+
Creation and replies share 20 admissions per authenticated user and artifact
|
|
262
|
+
per fixed UTC minute across browser, CLI, MCP and API tokens. Adjacent minute
|
|
263
|
+
boundaries can admit 40 posts within a sliding 60 seconds. `rate_limited`
|
|
264
|
+
includes `retry_after_seconds` and UTC `retry_at`; HTTP also sends `Retry-After`.
|
|
265
|
+
Keep unsent content and retry after that time. Invalid requests, capacity refusals
|
|
266
|
+
and closed-thread refusals observed before admission consume nothing. Rate
|
|
267
|
+
refusals do not increment the counter; quota storage failures refuse the post.
|
|
268
|
+
Once admitted, commit failures and status/version/capacity races consume the admission without a
|
|
269
|
+
refund. Edits, deletions, resolve/reopen and anchor reports consume nothing.
|
|
270
|
+
Mutation readback contains only the affected thread window and changed message.
|
|
271
|
+
`refresh_required: true` means the write committed but advisory readback failed:
|
|
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`.
|