artifacty 0.11.1 → 0.12.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 +5 -3
- package/README.md +148 -22
- package/SECURITY.md +25 -16
- package/docs/artifact-schema-v1.md +73 -50
- package/docs/central-team-deployment-design.md +56 -52
- package/docs/integrations.md +25 -25
- package/docs/mcp-public-api.md +75 -57
- package/docs/network-sharing.md +8 -8
- package/docs/release-checklist.md +24 -13
- package/docs/roadmap-design.md +145 -133
- package/docs/sarif-csv-artifact-plan.md +25 -26
- package/docs/threat-model.md +121 -100
- package/docs/writing-style.md +56 -0
- package/package.json +2 -1
- package/src/cli.js +44 -3
- package/src/lib/backup.js +19 -6
- package/src/lib/i18n.js +142 -0
- package/src/lib/network-policy.js +234 -0
- package/src/lib/render.js +141 -27
- package/src/lib/sample-content.js +185 -0
- package/src/lib/samples.js +74 -0
- package/src/lib/share-links.js +136 -0
- package/src/lib/storage.js +455 -32
- package/src/mcp-server.js +18 -6
- package/src/server.js +194 -7
package/docs/mcp-public-api.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# MCP Public API
|
|
2
2
|
|
|
3
|
-
Artifacty's MCP server is the primary agent-to-agent integration
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
stdio
|
|
7
|
-
|
|
3
|
+
Artifacty's MCP server is the primary interface for agent-to-agent integration.
|
|
4
|
+
It uses local stdio MCP by default. The browser server can also expose a
|
|
5
|
+
token-protected HTTP `/mcp` endpoint. Stdio bridge mode lets a client use local
|
|
6
|
+
stdio configuration to write to a central Artifacty server. The server targets
|
|
7
|
+
MCP protocol `2025-06-18`.
|
|
8
8
|
|
|
9
9
|
## Capabilities
|
|
10
10
|
|
|
@@ -16,23 +16,40 @@ currently targets MCP protocol `2025-06-18`.
|
|
|
16
16
|
|
|
17
17
|
## Visibility and Access Control
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
19
|
+
Administrators can select a site-wide `public` or `private` access mode
|
|
20
|
+
at `/admin/access`. Public mode preserves the visibility rules below. Private
|
|
21
|
+
mode requires a personal identity: artifact reads are limited to the owner,
|
|
22
|
+
administrators, and explicitly shared users or team members; shared recipients
|
|
23
|
+
have read, comment, or edit grants. Artifacty applies the strongest permission
|
|
24
|
+
from the user's direct and team grants.
|
|
25
|
+
Comment grants permit feedback and resolution of the caller's own comments;
|
|
26
|
+
edit grants also permit new versions. Sharing, archive/restore, and review-status
|
|
27
|
+
management stay owner/admin-only. Token scopes are an additional restriction:
|
|
28
|
+
a read-scoped token cannot mutate even when its user has an edit grant.
|
|
29
|
+
In private mode, a shared server token or an anonymous stdio connection cannot
|
|
30
|
+
read or create artifacts. Use a personal API token for
|
|
31
|
+
agent access. Revoking shares or team membership affects subsequent resource
|
|
32
|
+
reads, searches, and live notifications. The HTTP transport also obeys the
|
|
33
|
+
administrator's IP/CIDR allowlist, using the TCP peer address, not forwarding
|
|
34
|
+
headers; local stdio has no HTTP source address.
|
|
35
|
+
|
|
36
|
+
In public mode, artifact `visibility` and `ownerUserId` control access after the
|
|
37
|
+
server has a user account. A personal API token identifies the user. The shared
|
|
38
|
+
`ARTIFACTY_API_TOKEN` has no personal identity. Artifacty treats it as an
|
|
39
|
+
anonymous team principal: it can read and write `team` artifacts, but cannot
|
|
40
|
+
read `private` artifacts.
|
|
41
|
+
|
|
42
|
+
Local stdio uses a personal identity only when `ARTIFACTY_API_TOKEN` resolves to
|
|
43
|
+
a personal token in the local store. Otherwise, it is anonymous after the store
|
|
44
|
+
has users. Before the store has users, public mode does not apply these user
|
|
45
|
+
access checks.
|
|
46
|
+
|
|
47
|
+
If a caller cannot read an artifact, `artifacty_get` and resource reads return
|
|
48
|
+
`ARTIFACT_NOT_FOUND`. List results omit the artifact. These rules prevent
|
|
49
|
+
disclosure of its existence. If a caller can read the artifact but lacks the
|
|
50
|
+
required write or management permission, the tool result contains
|
|
51
|
+
`structuredContent.code === "forbidden"`. See the README Security Model section
|
|
52
|
+
for the full rule table.
|
|
36
53
|
|
|
37
54
|
## Tools
|
|
38
55
|
|
|
@@ -56,17 +73,17 @@ Stable tool names:
|
|
|
56
73
|
- `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
74
|
- `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.
|
|
58
75
|
|
|
59
|
-
Tool schemas use Artifacty schema v1 formats and artifact types.
|
|
60
|
-
properties
|
|
61
|
-
|
|
76
|
+
Tool schemas use Artifacty schema v1 formats and artifact types. During 0.x releases, maintainers may add optional
|
|
77
|
+
properties. They should not rename existing properties without a documented
|
|
78
|
+
migration.
|
|
62
79
|
|
|
63
|
-
Storage
|
|
64
|
-
|
|
65
|
-
`isError: true` tool result with `structuredContent.code
|
|
66
|
-
|
|
67
|
-
`
|
|
68
|
-
`
|
|
69
|
-
|
|
80
|
+
Storage validation errors and not-found errors carry a machine-readable `code`.
|
|
81
|
+
This includes relation and comment errors. `tools/call` returns an
|
|
82
|
+
`isError: true` tool result with `structuredContent.code`, rather than a
|
|
83
|
+
JSON-RPC protocol error. Example codes include `INVALID_RELATION`,
|
|
84
|
+
`SELF_RELATION`, `ARTIFACT_NOT_FOUND`, `RELATION_NOT_FOUND`,
|
|
85
|
+
`COMMENT_NOT_FOUND`, `THREAD_TOO_DEEP`, `COMMENT_TOO_LARGE`, and
|
|
86
|
+
`INVALID_REVIEW_STATUS`. Clients can use the code without parsing error text.
|
|
70
87
|
|
|
71
88
|
## Resources
|
|
72
89
|
|
|
@@ -91,16 +108,16 @@ matching change event sends `notifications/resources/updated` with the same
|
|
|
91
108
|
`{ uri }`. `resources/unsubscribe` accepts the same `{ uri }` shape and stops
|
|
92
109
|
delivery.
|
|
93
110
|
|
|
94
|
-
Subscriptions only
|
|
95
|
-
context
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
`resources/subscribe
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
111
|
+
Subscriptions deliver notifications only over the **stdio transport**. One MCP
|
|
112
|
+
context lasts for the whole process and writes notifications to stdout.
|
|
113
|
+
|
|
114
|
+
The streamable-HTTP `/mcp` transport creates a stateless JSON-RPC context for
|
|
115
|
+
each POST request. The stdio bridge (`ARTIFACTY_MCP_MODE=bridge`) uses the same
|
|
116
|
+
HTTP transport. After the server sends a response, no connection remains for
|
|
117
|
+
push notifications. These transports accept `resources/subscribe`, as the
|
|
118
|
+
protocol requires, but do not deliver notifications. Clients should use
|
|
119
|
+
`artifacty_wait` for a bounded long-poll within one request. Alternatively,
|
|
120
|
+
clients can poll with `artifacty_list`.
|
|
104
121
|
|
|
105
122
|
## Prompts
|
|
106
123
|
|
|
@@ -112,23 +129,24 @@ Prompt names:
|
|
|
112
129
|
- `artifacty_visual_qa`
|
|
113
130
|
- `artifacty_release_notes`
|
|
114
131
|
|
|
115
|
-
Each prompt returns one user message
|
|
116
|
-
an
|
|
132
|
+
Each prompt returns one user message. The message instructs an agent to create
|
|
133
|
+
or update an artifact with searchable `artifactType`, `sourceAgent`, and tags.
|
|
117
134
|
Prompts accept optional context arguments such as `artifactId`, `goal`, `scope`,
|
|
118
135
|
`target`, or `version`. `artifacty_handoff` and `artifacty_review` additionally
|
|
119
136
|
instruct the agent to pass `relations` on the create/update call so the graph
|
|
120
137
|
stays populated automatically: `artifacty_handoff` recommends
|
|
121
138
|
`relations: [{ toId: <source artifact ID>, relation: "derived-from" }]`, and
|
|
122
139
|
`artifacty_review` recommends `relations: [{ toId: <reviewed artifact ID>, relation: "reviews" }]`.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
140
|
+
For a short review with a few findings, `artifacty_review` recommends
|
|
141
|
+
`artifacty_comment`. It recommends `artifacty_set_review_status` to record the
|
|
142
|
+
verdict. Longer reviews and reviews of multiple files use a separate review
|
|
143
|
+
artifact.
|
|
127
144
|
|
|
128
145
|
## OpenAPI
|
|
129
146
|
|
|
130
|
-
|
|
131
|
-
|
|
147
|
+
An OpenAPI 3.1 document describes every `/api/*` HTTP route and the `/mcp`
|
|
148
|
+
JSON-RPC endpoint. The HTTP routes include artifacts, versions, import, audit,
|
|
149
|
+
and admin backup:
|
|
132
150
|
|
|
133
151
|
- `GET /openapi.json`: the machine-readable document. No authentication
|
|
134
152
|
required; served with `cache-control: no-store` so it always reflects the
|
|
@@ -138,11 +156,11 @@ plus the `/mcp` JSON-RPC endpoint is described by an OpenAPI 3.1 document:
|
|
|
138
156
|
- `artifacty_info` (MCP tool) and `artifacty doctor` both report the
|
|
139
157
|
document's URL as `<serverUrl>/openapi.json`.
|
|
140
158
|
|
|
141
|
-
The document
|
|
142
|
-
definitions (see `src/lib/schemas.js`)
|
|
143
|
-
|
|
144
|
-
and the
|
|
145
|
-
|
|
159
|
+
The document uses the JSON Schemas from the MCP tool `outputSchema`
|
|
160
|
+
definitions (see `src/lib/schemas.js`). The HTTP API and MCP tools therefore
|
|
161
|
+
use the same artifact summaries, full artifact records, versions, audit events,
|
|
162
|
+
and relation entries. They also use the same `{ error, code?, details? }`
|
|
163
|
+
error shape. `test/openapi.test.js`
|
|
146
164
|
keeps the document's route table in sync with `src/server.js`'s dispatch.
|
|
147
165
|
|
|
148
166
|
## Compatibility Notes
|
|
@@ -163,8 +181,8 @@ keeps the document's route table in sync with `src/server.js`'s dispatch.
|
|
|
163
181
|
- On central servers, use a personal token from `/account` so created artifacts
|
|
164
182
|
include the token owner's email as `publisherId` and audit logs record the
|
|
165
183
|
same identity as `actor`.
|
|
166
|
-
- Remote MCP
|
|
167
|
-
|
|
184
|
+
- Remote MCP uses bearer or header token authentication. Personal tokens support
|
|
185
|
+
`read`, `write`, and `admin` scopes. OAuth is not supported.
|
|
168
186
|
- Binary media resources return stored base64 text through MCP; browser `/raw`
|
|
169
187
|
decodes first-class `image` and `video` artifacts into bytes.
|
|
170
188
|
- Clients may display resources and prompts differently. Tools remain the most
|
package/docs/network-sharing.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Network Sharing
|
|
2
2
|
|
|
3
|
-
Artifacty
|
|
3
|
+
Artifacty stores artifacts locally. By default, the server binds to `127.0.0.1` for use on one machine. You can bind to a non-local address for a short sharing session. This exposes the server to other machines.
|
|
4
4
|
|
|
5
5
|
## Recommended Defaults
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ Use the local server for normal work:
|
|
|
10
10
|
artifacty serve
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
If another device on a trusted LAN or private VPN needs read access,
|
|
13
|
+
If another device on a trusted LAN or private VPN needs read access, bind to a specific interface address. Avoid listening on every interface:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
artifacty serve --host 192.168.1.20 --share-mode lan --generate-token
|
|
@@ -34,23 +34,23 @@ artifacty serve --host 0.0.0.0 --share-mode lan --generate-token
|
|
|
34
34
|
|
|
35
35
|
## Required Safeguards
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
Before binding to a non-local address, set both `ARTIFACTY_SHARE_MODE=lan|team` and an API token. Artifacty rejects startup without these settings.
|
|
38
38
|
|
|
39
|
-
The generated token protects HTTP API routes and browser write forms.
|
|
39
|
+
The generated token protects HTTP API routes and browser write forms. For scripts, use the `x-artifacty-token` or `Authorization: Bearer <token>` header. Local foreground sessions can use `?token=...` URLs. These URLs can expose tokens in browser history, shell history, reverse-proxy logs, or referrers.
|
|
40
40
|
|
|
41
41
|
Artifacty does not terminate TLS. Do not expose it directly on the public internet. If a shared instance must cross an untrusted network, put it behind a TLS reverse proxy or a private VPN.
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
If Artifacty binds outside loopback, startup output warns that other machines can reach the server. The warning also states that Artifacty does not provide TLS. Background `serve` returns the warning in JSON. Foreground `serve` and `src/server.js` also write it to stderr.
|
|
44
44
|
|
|
45
45
|
## Browser Write Behavior
|
|
46
46
|
|
|
47
|
-
Remote browsers can read
|
|
47
|
+
Remote browsers can read pages allowed by the current access mode and artifact permissions. To submit a browser form, the request origin must match the Artifacty host. For example, `Origin: http://10.0.0.50:8787` matches `Host: 10.0.0.50:8787`. Routes that change data reject cross-origin browser requests to reduce CSRF risk. For scripts and agents, use API or MCP writes with an explicit token header.
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
Keep the origin check enabled. A write from the central dashboard should pass when its origin matches the server. A write from another website should fail with `NON_LOCAL_ORIGIN`.
|
|
50
50
|
|
|
51
51
|
## Renderer Guidance
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
Treat artifact content as untrusted. Artifacty uses sandboxing and CSP controls to render HTML, SVG, Mermaid, and React. Shared content still reaches each viewer's browser. Keep `ARTIFACTY_ENABLE_REACT_RENDERER` disabled for LAN sessions unless every viewer trusts the artifact source.
|
|
54
54
|
|
|
55
55
|
See [threat-model.md](threat-model.md) for the full trust-boundary summary.
|
|
56
56
|
|
|
@@ -8,7 +8,14 @@ Use this checklist before publishing or distributing Artifacty.
|
|
|
8
8
|
npm run release:check
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
This runs syntax checks, the full Node test suite, and a local smoke test
|
|
11
|
+
This command runs syntax checks, the full Node test suite, and a local smoke test. The smoke test checks these operations:
|
|
12
|
+
|
|
13
|
+
- Start the HTTP server with token authentication.
|
|
14
|
+
- Create an artifact.
|
|
15
|
+
- Block detected secrets.
|
|
16
|
+
- Read audit logs.
|
|
17
|
+
- Write a backup.
|
|
18
|
+
- Discover MCP tools, resources, and prompts.
|
|
12
19
|
|
|
13
20
|
Run the local diagnostics pass:
|
|
14
21
|
|
|
@@ -19,10 +26,10 @@ artifacty doctor
|
|
|
19
26
|
## Packaging
|
|
20
27
|
|
|
21
28
|
- Confirm `package.json` `version` and `files` are intentional.
|
|
22
|
-
- Run `npm pack --dry-run
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
gated React renderer.
|
|
29
|
+
- Run `npm pack --dry-run`.
|
|
30
|
+
- Inspect the paths in the package output.
|
|
31
|
+
- Review the package size with renderer dependencies included. Mermaid is a default dependency.
|
|
32
|
+
React, ReactDOM, and Babel standalone are optional dependencies for the gated React renderer.
|
|
26
33
|
- Verify the global commands resolve after install: `artifacty`, `artifacty-mcp`.
|
|
27
34
|
|
|
28
35
|
## Security
|
|
@@ -30,10 +37,11 @@ artifacty doctor
|
|
|
30
37
|
- Keep the default HTTP bind address at `127.0.0.1`.
|
|
31
38
|
- Require `ARTIFACTY_API_TOKEN` and `ARTIFACTY_SHARE_MODE=lan` or `team` before binding to `0.0.0.0`.
|
|
32
39
|
- Confirm non-loopback startup output includes the LAN/team warning.
|
|
33
|
-
- Confirm `artifacty serve` starts a managed background server and returns
|
|
40
|
+
- Confirm `artifacty serve` starts a managed background server and returns JSON.
|
|
41
|
+
- Use `artifacty serve --foreground` to check attached logs.
|
|
34
42
|
- Confirm `artifacty service plist|unit|task --dry-run` renders macOS, Linux, and Windows service definitions.
|
|
35
43
|
- Prefer `x-artifacty-token` or `Authorization: Bearer <token>` over query tokens in scripts.
|
|
36
|
-
- Review secret-scan
|
|
44
|
+
- Review each secret-scan bypass. Use `--allow-secrets` and `ARTIFACTY_ALLOW_SECRETS=true` only for deliberate, temporary exceptions.
|
|
37
45
|
- Review [../SECURITY.md](../SECURITY.md) and [threat-model.md](threat-model.md) when changing auth, rendering, MCP, or network-sharing behavior.
|
|
38
46
|
- Treat artifact HTML and imported agent payloads as untrusted content.
|
|
39
47
|
- Confirm scripted artifact iframes never include `allow-same-origin`.
|
|
@@ -41,17 +49,20 @@ artifacty doctor
|
|
|
41
49
|
`Access-Control-Allow-Origin: null` only for `Origin: null` requests, so
|
|
42
50
|
opaque-origin sandbox iframes can import local ESM without weakening sandbox
|
|
43
51
|
flags or using a wildcard CORS policy.
|
|
44
|
-
- Confirm SVG viewer output
|
|
45
|
-
-
|
|
46
|
-
|
|
52
|
+
- Confirm SVG viewer output removes `<script>`, `on*` attributes, and `javascript:` links.
|
|
53
|
+
- Confirm `/raw` preserves the original source.
|
|
54
|
+
- Test each renderer that executes client code in a browser. Confirm the rendered output.
|
|
55
|
+
A successful route response does not prove that Mermaid or React rendered inside the iframe.
|
|
47
56
|
- Keep `ARTIFACTY_ENABLE_REACT_RENDERER` disabled by default. Enable it only when the operator accepts arbitrary component execution risk.
|
|
48
|
-
- Confirm parent app CSP
|
|
57
|
+
- Confirm the parent app CSP excludes `unsafe-eval`.
|
|
58
|
+
- Confirm only the React frame response CSP permits `unsafe-eval`.
|
|
49
59
|
- Confirm CodeQL, Scorecard, and Dependabot configuration changes are intentional.
|
|
50
60
|
- Confirm npm publish still uses OIDC Trusted Publishing rather than a long-lived npm token.
|
|
51
61
|
|
|
52
62
|
## Operations
|
|
53
63
|
|
|
54
|
-
-
|
|
64
|
+
- Before an upgrade or server move, export a backup. Use `artifacty backup` for artifacts only. Use `artifacty backup --full` to also include users, tokens, audit logs, relations, and webhooks.
|
|
55
65
|
- Confirm `artifacty audit --limit 20` shows recent create/update/read/archive events.
|
|
56
66
|
- Confirm `artifacty doctor` reports no failures. A stopped server warning is acceptable when intentionally checking an offline store.
|
|
57
|
-
-
|
|
67
|
+
- Before installing a background service, run `artifacty service install --dry-run`.
|
|
68
|
+
- To review a definition for another operating system, use `--platform macos|linux|windows`.
|