artifacty 0.10.8 → 0.11.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/CLAUDE.md +1 -1
- package/README.md +260 -5
- package/docs/artifact-schema-v1.md +187 -1
- package/docs/central-team-deployment-design.md +3 -1
- package/docs/integrations.md +9 -1
- package/docs/mcp-public-api.md +103 -9
- package/docs/release-checklist.md +1 -1
- package/docs/roadmap-design.md +977 -0
- package/docs/sarif-csv-artifact-plan.md +42 -7
- package/docs/threat-model.md +217 -2
- package/package.json +2 -1
- package/src/cli.js +550 -43
- package/src/client/viewer.js +377 -0
- package/src/lib/backup.js +326 -15
- package/src/lib/converters.js +99 -5
- package/src/lib/csv.js +51 -0
- package/src/lib/diff.js +656 -0
- package/src/lib/doctor.js +88 -2
- package/src/lib/embeddings.js +407 -0
- package/src/lib/events.js +183 -0
- package/src/lib/i18n.js +290 -2
- package/src/lib/listing.js +46 -0
- package/src/lib/openapi.js +614 -0
- package/src/lib/render.js +1604 -160
- package/src/lib/retention-form.js +31 -0
- package/src/lib/retention.js +499 -0
- package/src/lib/sarif-csv-export.js +290 -0
- package/src/lib/schemas.js +461 -0
- package/src/lib/security.js +226 -1
- package/src/lib/sse.js +52 -0
- package/src/lib/storage.js +2935 -305
- package/src/lib/webhooks.js +356 -0
- package/src/mcp-server.js +756 -25
- package/src/server.js +1529 -98
package/docs/mcp-public-api.md
CHANGED
|
@@ -10,28 +10,64 @@ currently targets MCP protocol `2025-06-18`.
|
|
|
10
10
|
|
|
11
11
|
`initialize` advertises:
|
|
12
12
|
|
|
13
|
-
- `tools`: Artifact create, import, list, get, update, archive, restore, audit, and info.
|
|
14
|
-
- `resources`: static and dynamic read-only artifact resources
|
|
13
|
+
- `tools`: Artifact create, import, list, get, update, archive, restore, link, unlink, diff, audit, and info.
|
|
14
|
+
- `resources`: static and dynamic read-only artifact resources, with `subscribe: true` and `listChanged: true`.
|
|
15
15
|
- `prompts`: reusable workflow prompt templates.
|
|
16
16
|
|
|
17
|
+
## Visibility and Access Control
|
|
18
|
+
|
|
19
|
+
Once any user account exists on the server, every tool call and resource read
|
|
20
|
+
is scoped by artifact `visibility` and `ownerUserId`: over the streamable-HTTP
|
|
21
|
+
transport, a personal API token or session scopes access to that user; the
|
|
22
|
+
shared `ARTIFACTY_API_TOKEN` (or any connection before the first user is
|
|
23
|
+
created) has no personal identity and is treated as an anonymous team
|
|
24
|
+
principal that can read/write `team` artifacts but never sees `private` ones.
|
|
25
|
+
The local stdio transport is a fully trusted process: it is scoped to a
|
|
26
|
+
personal user only when the local `ARTIFACTY_API_TOKEN` resolves to a
|
|
27
|
+
personal API token, and is otherwise anonymous once the store has users. A
|
|
28
|
+
`private` artifact a caller cannot see 404s (`ARTIFACT_NOT_FOUND`) from
|
|
29
|
+
`artifacty_get`, resource reads, and list results, to avoid leaking its
|
|
30
|
+
existence; write and manage operations (`artifacty_update`,
|
|
31
|
+
`artifacty_archive`/`artifacty_restore`, `artifacty_set_visibility`) on an
|
|
32
|
+
artifact the caller can see but does not own return
|
|
33
|
+
`structuredContent.code === "forbidden"`. In single-user mode (no user
|
|
34
|
+
accounts) none of this applies. See the README Security Model section for
|
|
35
|
+
the full rule table.
|
|
36
|
+
|
|
17
37
|
## Tools
|
|
18
38
|
|
|
19
39
|
Stable tool names:
|
|
20
40
|
|
|
21
|
-
- `artifacty_create`: create a native Artifacty artifact.
|
|
41
|
+
- `artifacty_create`: create a native Artifacty artifact. Accepts an optional `relations` array (`[{ toId, relation }]`) to link the new artifact to others in the same call, and an optional `visibility` (`"private"` or `"team"`; defaults to `"team"`).
|
|
22
42
|
- `artifacty_publish`: backwards-compatible alias for `artifacty_create`.
|
|
23
43
|
- `artifacty_import`: convert external Claude, Codex, Gemini, Copilot, Cursor, Artifacty, or generic payloads.
|
|
24
|
-
- `artifacty_list`: list artifacts with `query`, `tag`, `sourceAgent`, `includeArchived`, `limit`, and `offset`.
|
|
25
|
-
- `artifacty_get`: read one artifact by `id` and optional `version`.
|
|
26
|
-
- `artifacty_update`: append an immutable version.
|
|
27
|
-
- `artifacty_archive` / `artifacty_restore`: toggle archive state.
|
|
44
|
+
- `artifacty_list`: list artifacts with `query`, `tag`, `sourceAgent`, `artifactType`, `publisher`, `createdAfter`, `createdBefore`, `reviewStatus`, `relatedTo`, `relation`, `mode`, `includeArchived`, `view`, `limit`, and `offset`. `relatedTo` restricts results to artifacts related (in either direction) to the given artifact ID; `relation` further restricts to that relation name. `publisher` matches `publisherId`, `publisherUserId`, or `ownerUserId`. `createdAfter`/`createdBefore` take an ISO date or date-time and return an `isError: true` result with `structuredContent.code === "invalid_filter"` if unparseable. `view` names a saved view (by id or name, see docs/roadmap-design.md section 8) whose filters are expanded first; any other argument passed alongside `view` overrides that one filter. `mode` is `"keyword"`, `"semantic"`, or `"hybrid"` (see docs/roadmap-design.md section 6): `hybrid` is the default once an embedding provider is configured (`ARTIFACTY_EMBEDDINGS_URL` or `ARTIFACTY_EMBEDDINGS_COMMAND`) and `query` is set; without a provider, `semantic`/`hybrid` silently fall back to `keyword` and the response's `search.fallback` is `true`. Responses carry `search.mode` and, for `semantic`/`hybrid` results, a per-artifact `searchScore`.
|
|
45
|
+
- `artifacty_get`: read one artifact by `id` and optional `version`. The response includes `relations: { outgoing, incoming }`, where each entry carries the related artifact's summary (or `missing: true` if the target no longer exists). Pass `includeComments: true` to also return `comments`, the requested version's open (unresolved, non-deleted) comments; omitted by default.
|
|
46
|
+
- `artifacty_update`: append an immutable version. Accepts an optional `expectedVersion` (the `latestVersion` returned by `artifacty_get`); if the artifact has since moved to a different `latestVersion`, the call returns an `isError: true` tool result with `structuredContent.code === "version_conflict"` and `structuredContent.latestVersion` instead of creating a version that would silently discard a concurrent change. Agents should pass back `latestVersion` from their last `artifacty_get` as `expectedVersion` when updating. Also accepts an optional `relations` array like `artifacty_create`.
|
|
47
|
+
- `artifacty_archive` / `artifacty_restore`: toggle archive state. Requires the artifact's owner or an admin once any user account exists.
|
|
48
|
+
- `artifacty_set_visibility`: change `id`'s `visibility` to `"private"` or `"team"`. Requires the artifact's owner or an admin once any user account exists.
|
|
49
|
+
- `artifacty_link`: create a typed, directional relation from one artifact (`id`) to another (`toId`) with a `relation` name: `derived-from`, `supersedes`, `reviews`, `references`, or `part-of`.
|
|
50
|
+
- `artifacty_unlink`: remove a previously created relation given the same `id`, `toId`, and `relation`.
|
|
51
|
+
- `artifacty_comment`: add a comment or a reply to an artifact (`id`), given `body` (Markdown, up to 16 KB), and optional `version` (defaults to the latest), `anchor` (a format-specific rendering hint, e.g. `{ line: 42 }`, not validated against content), and `parentId` (reply to a root comment; threads are one level deep, so the target must not itself be a reply).
|
|
52
|
+
- `artifacty_resolve_comment`: mark a comment (`id`, `commentId`) resolved.
|
|
53
|
+
- `artifacty_set_review_status`: set an artifact's (`id`) `status` to `none`, `pending`, `changes-requested`, or `approved`. Requires the artifact's owner or an admin once any user account exists. Automatically resets to `pending` (noted in that update's audit metadata) when a new version is appended after `approved`.
|
|
54
|
+
- `artifacty_diff`: diff two versions of an artifact given `id` and optional `from`/`to` (defaults: `to` = latest version, `from` = `to - 1`) and `view` (`structured` or `lines`; defaults to `structured` for JSON-like formats — `json`, `sarif`, `csv`, `notebook`, `bundle` — and `lines` otherwise). Returns a compact unified-diff text in `content[].text` and the structured diff (JSON path entries, CSV row/cell entries, line entries with word-level highlight ranges, or bundle per-file entries) in `structuredContent`, capped at `ARTIFACTY_MAX_DIFF_ENTRIES` (default 5000) with `structuredContent.structuredDiff.truncated` set when the cap is hit.
|
|
28
55
|
- `artifacty_audit`: list audit events.
|
|
29
|
-
- `artifacty_info`: return store, browser URL, transport, and protocol information.
|
|
56
|
+
- `artifacty_info`: return store, browser URL, transport, and protocol information, plus `embeddings: { provider, model } | null` reporting whether a semantic-search embedding provider is configured.
|
|
57
|
+
- `artifacty_wait`: `{ artifactId?, tag?, type?, timeoutMs }` blocks up to `timeoutMs` (default 30000, max 120000) for the first change event matching the filter, and returns it as `structuredContent.event`, or `{ timedOut: true }` if none arrived in time. Works over any transport, including the stateless HTTP transport where `resources/subscribe` cannot push notifications (see Resources below) — it is a long-poll primitive for clients that cannot receive pushed notifications.
|
|
30
58
|
|
|
31
59
|
Tool schemas use Artifacty schema v1 formats and artifact types. New optional
|
|
32
60
|
properties may be added during 0.x releases; existing names should not be
|
|
33
61
|
renamed without a documented migration.
|
|
34
62
|
|
|
63
|
+
Storage-layer validation and not-found errors (relation and comment errors
|
|
64
|
+
included) carry a machine-readable `code`. `tools/call` surfaces those as an
|
|
65
|
+
`isError: true` tool result with `structuredContent.code` set (for example
|
|
66
|
+
`INVALID_RELATION`, `SELF_RELATION`, `ARTIFACT_NOT_FOUND`,
|
|
67
|
+
`RELATION_NOT_FOUND`, `COMMENT_NOT_FOUND`, `THREAD_TOO_DEEP`,
|
|
68
|
+
`COMMENT_TOO_LARGE`, `INVALID_REVIEW_STATUS`) instead of a JSON-RPC protocol
|
|
69
|
+
error, so clients can branch on the code without inspecting error text.
|
|
70
|
+
|
|
35
71
|
## Resources
|
|
36
72
|
|
|
37
73
|
Static resources:
|
|
@@ -43,9 +79,29 @@ Resource templates:
|
|
|
43
79
|
|
|
44
80
|
- `artifacty://artifacts/{id}`: JSON artifact metadata, selected version, content, and URLs.
|
|
45
81
|
- `artifacty://artifacts/{id}/raw{?version}`: raw artifact content for latest or specified version.
|
|
82
|
+
- `artifacty://artifacts/{id}/graph`: JSON depth-2 adjacency list of artifacts reachable from `{id}` through relations, as `{ rootId, nodes, edges }` where `nodes` are artifact summaries and each edge is `{ from, to, relation }`.
|
|
46
83
|
|
|
47
84
|
Resources are read-only and may record an audit `read` event for artifact content.
|
|
48
85
|
|
|
86
|
+
### Subscriptions
|
|
87
|
+
|
|
88
|
+
`resources/subscribe` accepts `{ uri }` for `artifacty://artifacts/{id}` (that
|
|
89
|
+
artifact only) or `artifacty://recent` (every artifact). While subscribed, a
|
|
90
|
+
matching change event sends `notifications/resources/updated` with the same
|
|
91
|
+
`{ uri }`. `resources/unsubscribe` accepts the same `{ uri }` shape and stops
|
|
92
|
+
delivery.
|
|
93
|
+
|
|
94
|
+
Subscriptions only deliver over the **stdio transport**, where one MCP
|
|
95
|
+
context lives for the whole process and notifications are written directly
|
|
96
|
+
to stdout. The streamable-HTTP `/mcp` transport (and the stdio bridge that
|
|
97
|
+
proxies to it, `ARTIFACTY_MCP_MODE=bridge`) builds a fresh, stateless
|
|
98
|
+
JSON-RPC context per POST request/response cycle — there is no open
|
|
99
|
+
connection left to push a notification over once the response is sent, so
|
|
100
|
+
`resources/subscribe` there is accepted (as the protocol requires) but never
|
|
101
|
+
delivers anything. Clients on that transport should poll with `artifacty_list`
|
|
102
|
+
or, better, use the `artifacty_wait` tool, which works as a bounded long-poll
|
|
103
|
+
within a single request regardless of transport.
|
|
104
|
+
|
|
49
105
|
## Prompts
|
|
50
106
|
|
|
51
107
|
Prompt names:
|
|
@@ -59,10 +115,48 @@ Prompt names:
|
|
|
59
115
|
Each prompt returns one user message that instructs an agent to create or update
|
|
60
116
|
an Artifacty artifact with discoverable `artifactType`, `sourceAgent`, and tags.
|
|
61
117
|
Prompts accept optional context arguments such as `artifactId`, `goal`, `scope`,
|
|
62
|
-
`target`, or `version`.
|
|
118
|
+
`target`, or `version`. `artifacty_handoff` and `artifacty_review` additionally
|
|
119
|
+
instruct the agent to pass `relations` on the create/update call so the graph
|
|
120
|
+
stays populated automatically: `artifacty_handoff` recommends
|
|
121
|
+
`relations: [{ toId: <source artifact ID>, relation: "derived-from" }]`, and
|
|
122
|
+
`artifacty_review` recommends `relations: [{ toId: <reviewed artifact ID>, relation: "reviews" }]`.
|
|
123
|
+
`artifacty_review` also prefers `artifacty_comment` (with `artifacty_set_review_status`
|
|
124
|
+
to record the verdict) over publishing a separate review artifact when the
|
|
125
|
+
review is short — a handful of findings — reserving a full review artifact
|
|
126
|
+
for longer or multi-file reviews.
|
|
127
|
+
|
|
128
|
+
## OpenAPI
|
|
129
|
+
|
|
130
|
+
Every `/api/*` HTTP route (artifacts, versions, import, audit, admin backup)
|
|
131
|
+
plus the `/mcp` JSON-RPC endpoint is described by an OpenAPI 3.1 document:
|
|
132
|
+
|
|
133
|
+
- `GET /openapi.json`: the machine-readable document. No authentication
|
|
134
|
+
required; served with `cache-control: no-store` so it always reflects the
|
|
135
|
+
running server's route set.
|
|
136
|
+
- `GET /docs/api`: a server-rendered HTML reference built from the same
|
|
137
|
+
document (no external UI bundle, no CDN dependency).
|
|
138
|
+
- `artifacty_info` (MCP tool) and `artifacty doctor` both report the
|
|
139
|
+
document's URL as `<serverUrl>/openapi.json`.
|
|
140
|
+
|
|
141
|
+
The document reuses the same JSON Schemas as the MCP tool `outputSchema`
|
|
142
|
+
definitions (see `src/lib/schemas.js`), so an artifact summary, a full
|
|
143
|
+
artifact-with-content record, a version, an audit event, a relation entry,
|
|
144
|
+
and the standard `{ error, code?, details? }` error shape mean the same thing
|
|
145
|
+
whether you're calling the HTTP API or an MCP tool. `test/openapi.test.js`
|
|
146
|
+
keeps the document's route table in sync with `src/server.js`'s dispatch.
|
|
63
147
|
|
|
64
148
|
## Compatibility Notes
|
|
65
149
|
|
|
150
|
+
### Protocol version compatibility matrix
|
|
151
|
+
|
|
152
|
+
| Client-requested `protocolVersion` | Server behavior |
|
|
153
|
+
| --- | --- |
|
|
154
|
+
| `2025-06-18` | Echoed back; this is the only protocol version the implementation has been verified against the public MCP specification. |
|
|
155
|
+
| Any other value (older or a newer version this server hasn't been verified against) | Server falls back to `2025-06-18` in its `initialize` response rather than rejecting the connection, so unfamiliar clients still get a usable session. |
|
|
156
|
+
|
|
157
|
+
`tools/list` reports an `outputSchema` for every tool that returns
|
|
158
|
+
`structuredContent`, generated from the shared schema table described above.
|
|
159
|
+
|
|
66
160
|
- Local stdio remains the default. Enable the central HTTP endpoint with
|
|
67
161
|
`artifacty serve --mcp-http` and install bridge mode with
|
|
68
162
|
`artifacty install <agent> --mcp-url http://host:8787/mcp --api-token <token>`.
|
|
@@ -51,7 +51,7 @@ artifacty doctor
|
|
|
51
51
|
|
|
52
52
|
## Operations
|
|
53
53
|
|
|
54
|
-
- Export a backup before upgrades: `artifacty backup
|
|
54
|
+
- Export a backup before upgrades: `artifacty backup` (artifacts only) or `artifacty backup --full` (also users, tokens, audit log, relations, webhooks) before a server move or major upgrade.
|
|
55
55
|
- Confirm `artifacty audit --limit 20` shows recent create/update/read/archive events.
|
|
56
56
|
- Confirm `artifacty doctor` reports no failures. A stopped server warning is acceptable when intentionally checking an offline store.
|
|
57
57
|
- For background service installs, dry-run first: `artifacty service install --dry-run`. Use `--platform macos|linux|windows` to review another OS definition.
|