artifacty 0.1.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/AGENTS.md ADDED
@@ -0,0 +1,52 @@
1
+ # Repository Guidelines
2
+
3
+ ## Project Structure & Module Organization
4
+
5
+ Artifacty shares LLM artifacts over HTTP, CLI, and MCP.
6
+
7
+ - `src/server.js`: localhost HTTP server, browser routes, and JSON API.
8
+ - `src/mcp-server.js`: MCP stdio server exposing Artifacty tools.
9
+ - `src/cli.js`: command-line interface for serving, publishing, importing, listing, and reading artifacts.
10
+ - `src/lib/storage.js`: SQLite metadata store and immutable version-file handling.
11
+ - `src/lib/converters.js`: agent artifact conversion rules for Claude, Codex, Gemini, and generic payloads.
12
+ - `src/lib/installer.js`: MCP config installers for Claude, Codex, and Gemini.
13
+ - `src/lib/render.js`: server-rendered dashboard, viewer, and editor HTML.
14
+ - `test/*.test.js`: Node test runner suites.
15
+ - `docs/integrations.md`: setup notes for Claude Code, Codex, and Gemini CLI.
16
+
17
+ ## Build, Test, and Development Commands
18
+
19
+ - `npm start`: run the HTTP dashboard on `127.0.0.1:8787`.
20
+ - `npm test`: run all tests with Node’s built-in test runner.
21
+ - `npm run lint`: syntax-check source and test files with `node --check`.
22
+ - `node src/mcp-server.js`: run the MCP stdio server.
23
+ - `node src/cli.js import --agent claude --file artifact.html`: convert and store an external artifact.
24
+ - `node src/cli.js install claude --dry-run`: preview generated MCP config.
25
+ - `node src/cli.js check`: verify MCP tool discovery.
26
+
27
+ ## Coding Style & Naming Conventions
28
+
29
+ Use modern ESM JavaScript and Node built-ins where practical. Keep modules small and route shared behavior through `src/lib/*` instead of duplicating logic in CLI, HTTP, and MCP layers. Use two-space indentation, semicolons only where already present, `camelCase` for functions and variables, and descriptive tool names such as `artifacty_create`.
30
+
31
+ Do not add new dependencies unless the operational value clearly outweighs the extra install and security surface.
32
+
33
+ ## Testing Guidelines
34
+
35
+ Use `node:test` and `node:assert/strict`. Name tests `*.test.js` and keep them close to verified behavior: storage, converters, installers, HTTP routes, and MCP protocol flow. Add regression tests for every new artifact format, route, tool, installer, migration, or storage behavior. Run `npm run lint` and `npm test` before reporting completion.
36
+
37
+ ## Commit & Pull Request Guidelines
38
+
39
+ This repository has no existing Git history to infer from. Use concise, intent-first commit messages, and include useful trailers when relevant:
40
+
41
+ ```text
42
+ Add MCP artifact creation tool
43
+
44
+ Tested: npm test
45
+ Scope-risk: narrow
46
+ ```
47
+
48
+ PRs should explain behavior, changed surfaces, verification, and security or compatibility risks.
49
+
50
+ ## Security & Configuration Tips
51
+
52
+ Artifact content is untrusted. HTML renders in a sandboxed iframe, and the server binds to localhost by default. Keep `ARTIFACTY_HOME` private unless intentionally sharing a store, and avoid exposing the HTTP server on `0.0.0.0` without authentication.
package/CLAUDE.md ADDED
@@ -0,0 +1,64 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code when working with this repository.
4
+
5
+ Artifacty is a local, agent-to-agent artifact exchange for LLM workflows. One agent publishes an artifact once; others list, read, import, update, and continue from it without copying content through chat. It exposes one shared store over HTTP/browser, CLI, and MCP stdio surfaces.
6
+
7
+ See `AGENTS.md` for repository structure, coding-style conventions, and commit/PR guidelines.
8
+
9
+ ## Commands
10
+
11
+ - `npm test` — run all tests with `node --test`.
12
+ - `npm run lint` — syntax-check source and tests with `node --check`.
13
+ - `npm run smoke` — start a temporary token-protected server and verify core HTTP, backup, and MCP behavior.
14
+ - `npm run release:check` — run lint, tests, and smoke together.
15
+ - `npm start` — run the HTTP dashboard. It prefers `127.0.0.1:8787` and falls back when the default port is busy.
16
+ - `node src/mcp-server.js` or `npm run mcp` — run the MCP stdio server.
17
+ - `node src/cli.js help` — inspect CLI usage.
18
+
19
+ Run `npm run release:check` before claiming a release-ready change. There is no build step; this is plain ESM run directly by Node `>=22.5`.
20
+
21
+ ## Architecture
22
+
23
+ ### Shared Library Funnel
24
+
25
+ The three entry points are thin adapters:
26
+
27
+ - `src/server.js` handles HTTP/browser routes and JSON API.
28
+ - `src/cli.js` handles command-line workflows.
29
+ - `src/mcp-server.js` handles MCP JSON-RPC over stdio.
30
+
31
+ Shared behavior belongs in `src/lib/*`. Storage logic lives in `src/lib/storage.js`, conversion logic in `src/lib/converters.js`, installer logic in `src/lib/installer.js`, security checks in `src/lib/security.js`, and server URL discovery in `src/lib/server-state.js`.
32
+
33
+ ### Storage Model
34
+
35
+ The store lives at `ARTIFACTY_HOME` or `~/.artifacty` by default.
36
+
37
+ - SQLite metadata is stored in `artifacty.sqlite`.
38
+ - Immutable version files are stored under `artifacts/<id>/v<n>.<ext>`.
39
+ - `server.json` records the currently running browser server URL so CLI and MCP responses keep working when the default port falls back.
40
+ - Legacy `index.json` stores migrate automatically on first access.
41
+
42
+ Versions are append-only. Do not mutate prior content files.
43
+
44
+ ### Security Model
45
+
46
+ - The HTTP server binds to `127.0.0.1` by default.
47
+ - Non-local bind addresses require `ARTIFACTY_SHARE_MODE=lan` or `team` plus `ARTIFACTY_API_TOKEN`.
48
+ - API routes require token auth when `ARTIFACTY_API_TOKEN` is configured.
49
+ - Storage rejects common secret patterns before persisting content unless an explicit allow flag is used.
50
+ - HTML artifacts render in sandboxed iframes and must remain treated as untrusted.
51
+
52
+ ### Browser Editor
53
+
54
+ The create/import/edit screens use CodeMirror 6 for Markdown, HTML, JSON, and text editing. CodeMirror assets are served locally through allowlisted `/vendor/npm/*` routes, not from a CDN. UI text defaults to English and supports Korean with `?lang=ko`; documentation stays English-only.
55
+
56
+ ### MCP Server
57
+
58
+ The MCP server is a hand-rolled line-delimited JSON-RPC 2.0 implementation using protocol version `2025-06-18`. Tool results include both `content[].text` and `structuredContent`. Keep `artifacty_publish` as a backwards-compatible alias for `artifacty_create`.
59
+
60
+ When `ARTIFACTY_URL` is unset, MCP reads the current browser URL from `server.json`. Do not reintroduce a hard-coded `http://127.0.0.1:8787` default into generated MCP configs.
61
+
62
+ ### Tests
63
+
64
+ Tests use `node:test` and `node:assert/strict`. Add regression tests for every new route, CLI command, MCP tool, converter behavior, security rule, migration, or storage change. Keep tests isolated with temporary stores and cleanup in `finally`.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Raeseok Lee
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,164 @@
1
+ # Artifacty
2
+
3
+ Artifacty is a local, agent-to-agent artifact exchange for LLM workflows. Claude, Codex, Gemini, and other MCP-capable tools can publish an artifact once, then other agents can list, read, update, and continue from it without copying content through chat.
4
+
5
+ ![Artifacty overview showing multiple AI agents sharing artifacts through a local exchange](docs/assets/artifacty.png)
6
+
7
+ ## Why MCP
8
+
9
+ Claude Code artifacts are useful because they turn session output into shareable, versioned pages. Artifacty keeps that local and cross-agent: the browser server renders artifacts for people, while the MCP stdio server gives agents a common tool interface.
10
+
11
+ ## Quick Start
12
+
13
+ Install and start Artifacty:
14
+
15
+ ```bash
16
+ npm install -g artifacty
17
+ artifacty serve
18
+ ```
19
+
20
+ For local development from a checkout:
21
+
22
+ ```bash
23
+ npm install
24
+ npm test
25
+ npm start
26
+ ```
27
+
28
+ Open the URL printed by the server. Artifacty prefers `http://127.0.0.1:8787`; if that default port is busy and no explicit port was configured, it starts on the next available local port and records the actual URL for CLI and MCP responses.
29
+
30
+ Run the production-readiness check:
31
+
32
+ ```bash
33
+ npm run release:check
34
+ ```
35
+
36
+ Create an artifact in the browser:
37
+
38
+ ```text
39
+ http://127.0.0.1:8787/new
40
+ ```
41
+
42
+ Publish from the CLI:
43
+
44
+ ```bash
45
+ node src/cli.js publish --title "handoff note" --format markdown --source codex --content "# Next step\nReview the API plan."
46
+ ```
47
+
48
+ Import an artifact produced by another agent and convert it to Artifacty format:
49
+
50
+ ```bash
51
+ node src/cli.js import --agent claude --file ./deploy-failures.html --tag review
52
+ node src/cli.js import --agent gemini --content '{"title":"Plan","returnDisplay":"# Plan\n- Ship it"}'
53
+ ```
54
+
55
+ List artifacts:
56
+
57
+ ```bash
58
+ node src/cli.js list
59
+ ```
60
+
61
+ Run the MCP server:
62
+
63
+ ```bash
64
+ node src/mcp-server.js
65
+ ```
66
+
67
+ MCP clients can create artifacts with `artifacty_create`. `artifacty_publish` remains as a backwards-compatible alias.
68
+
69
+ Install MCP configuration for local agents:
70
+
71
+ ```bash
72
+ node src/cli.js install claude
73
+ node src/cli.js install codex --dry-run
74
+ node src/cli.js install gemini
75
+ node src/cli.js install all
76
+ node src/cli.js check
77
+ ```
78
+
79
+ See [docs/integrations.md](docs/integrations.md) for Claude Code, Codex, and Gemini CLI setup.
80
+
81
+ Operational commands:
82
+
83
+ ```bash
84
+ node src/cli.js audit --limit 20
85
+ node src/cli.js backup
86
+ node src/cli.js export --file ./artifacty-backup.json
87
+ node src/cli.js import-store --file ./artifacty-backup.json
88
+ node src/cli.js service install --dry-run
89
+ ```
90
+
91
+ After global installation, the same commands are available as `artifacty` and `artifacty-mcp`.
92
+
93
+ ## Storage
94
+
95
+ By default Artifacty stores files under `~/.artifacty`.
96
+
97
+ ```bash
98
+ ARTIFACTY_HOME=/path/to/shared/store npm start
99
+ ```
100
+
101
+ Artifact metadata is stored in `artifacty.sqlite`; artifact content is stored as immutable version files under `artifacts/`. The current browser server URL is written to `server.json` so MCP tools can return the correct links when the default port falls back. Existing `index.json` stores are migrated automatically on first access.
102
+
103
+ ## API Example
104
+
105
+ ```bash
106
+ curl -s http://127.0.0.1:8787/api/artifacts \
107
+ -H 'content-type: application/json' \
108
+ -H "x-artifacty-token: $ARTIFACTY_API_TOKEN" \
109
+ -d '{
110
+ "title": "PR review dashboard",
111
+ "content": "<h1>Review</h1>",
112
+ "format": "html",
113
+ "sourceAgent": "claude",
114
+ "tags": ["review"]
115
+ }'
116
+ ```
117
+
118
+ Convert-and-save an external agent artifact:
119
+
120
+ ```bash
121
+ curl -s http://127.0.0.1:8787/api/import \
122
+ -H 'content-type: application/json' \
123
+ -H "x-artifacty-token: $ARTIFACTY_API_TOKEN" \
124
+ -d '{
125
+ "agent": "claude",
126
+ "fileName": "deploy-failures.html",
127
+ "content": "<html><head><title>Deploy failures</title></head><body>...</body></html>",
128
+ "tags": ["review"]
129
+ }'
130
+ ```
131
+
132
+ Browser routes:
133
+
134
+ - `/`: list artifacts with search, tag, and source filters.
135
+ - `/new`: create an Artifacty-native artifact with the CodeMirror editor.
136
+ - `/import`: paste an external agent artifact and convert it with automatic editor mode detection.
137
+ - `/artifacts/:id/edit`: save a new version with Markdown, HTML, JSON, or text syntax support.
138
+ - `/artifacts/:id/diff`: compare versions.
139
+ - `/api/audit`: list audit events.
140
+
141
+ ## Interface Language
142
+
143
+ The browser UI defaults to English. Add `?lang=ko` to any browser route to use Korean, for example `http://127.0.0.1:8787/new?lang=ko`. Forms and in-app links preserve the selected language. Documentation is maintained in English only.
144
+
145
+ Schema and storage:
146
+
147
+ - Metadata lives in SQLite with `schemaVersion: 1`, `artifactType`, and `archivedAt`.
148
+ - Archive hides artifacts from default lists without deleting versions.
149
+ - Bundle artifacts store multiple files or base64 assets as portable JSON.
150
+ - See [docs/artifact-schema-v1.md](docs/artifact-schema-v1.md).
151
+
152
+ ## Security Model
153
+
154
+ - The HTTP server binds to `127.0.0.1` by default.
155
+ - If `ARTIFACTY_API_TOKEN` is set, HTTP API routes require `Authorization: Bearer <token>` or `x-artifacty-token`.
156
+ - Binding outside localhost requires both `ARTIFACTY_SHARE_MODE=lan` or `team` and `ARTIFACTY_API_TOKEN`.
157
+ - Artifact content is scanned for common API keys and private keys before storage. Use `--allow-secrets` or `ARTIFACTY_ALLOW_SECRETS=true` only for intentional exceptions.
158
+ - Creates, updates, reads, imports, archives, and restores write audit events to SQLite.
159
+ - CodeMirror editor assets are served from local npm dependencies through a package allowlist, not from a public CDN.
160
+ - Mutating HTTP routes reject non-local browser origins.
161
+ - HTML artifacts render in a sandboxed iframe.
162
+ - Artifact content should still be treated as untrusted; use the raw view when handing content back to an agent.
163
+
164
+ See [docs/release-checklist.md](docs/release-checklist.md) before publishing or running a shared instance.
@@ -0,0 +1,8 @@
1
+ # Third Party Notices
2
+
3
+ Artifacty includes CodeMirror 6 packages for the browser editor.
4
+
5
+ - CodeMirror and `@codemirror/*` packages are distributed under the MIT License.
6
+ - Lezer parser packages used by CodeMirror are distributed under the MIT License.
7
+
8
+ The installed package metadata and license files are retained through npm dependency installation.
@@ -0,0 +1,96 @@
1
+ # Artifact Schema v1
2
+
3
+ Artifacty schema v1 defines the stable envelope shared by HTTP, CLI, MCP, converters, and SQLite storage.
4
+
5
+ ## Artifact Record
6
+
7
+ ```json
8
+ {
9
+ "id": "artifact-id",
10
+ "schemaVersion": 1,
11
+ "artifactType": "document",
12
+ "title": "Readable title",
13
+ "sourceAgent": "codex",
14
+ "tags": ["handoff"],
15
+ "createdAt": "2026-06-24T00:00:00.000Z",
16
+ "updatedAt": "2026-06-24T00:00:00.000Z",
17
+ "archivedAt": null,
18
+ "latestVersion": 1,
19
+ "versions": []
20
+ }
21
+ ```
22
+
23
+ Allowed `artifactType` values:
24
+
25
+ - `document`
26
+ - `html-page`
27
+ - `handoff`
28
+ - `code-review`
29
+ - `test-report`
30
+ - `dashboard`
31
+ - `design-option`
32
+ - `diff-walkthrough`
33
+ - `bundle`
34
+ - `asset`
35
+ - `unknown`
36
+
37
+ Unknown legacy or external types should be mapped to `unknown`, not rejected during conversion. Native create/update rejects unsupported explicit types.
38
+
39
+ ## Version Record
40
+
41
+ Each version is immutable and points at one content file.
42
+
43
+ ```json
44
+ {
45
+ "version": 1,
46
+ "createdAt": "2026-06-24T00:00:00.000Z",
47
+ "format": "markdown",
48
+ "contentType": "text/markdown; charset=utf-8",
49
+ "path": "artifacts/id/v1.md",
50
+ "sizeBytes": 128,
51
+ "sha256": "...",
52
+ "metadata": {}
53
+ }
54
+ ```
55
+
56
+ Allowed `format` values are `html`, `markdown`, `text`, and `json`.
57
+
58
+ ## Metadata
59
+
60
+ Metadata is free-form JSON, but converter-generated metadata uses these keys:
61
+
62
+ - `artifactyImport`: converter name, original/source agent, file name/path, content type, artifact type, and conversion timestamp.
63
+ - `originalPayloadShape`: original payload family, such as `gemini-llmContent`, `content`, or `artifact-bundle`.
64
+ - `assetPolicy`: how embedded assets were preserved.
65
+ - `bundlePolicy`: how bundled files were preserved.
66
+
67
+ ## Archive Semantics
68
+
69
+ Artifacts are not deleted by P0 behavior. Archive sets `archivedAt` and hides the artifact from default list results. `includeArchived=true` includes archived records. Restore clears `archivedAt`. Versions and content files remain unchanged.
70
+
71
+ ## Bundle Format
72
+
73
+ Bundles are JSON artifacts with `artifactType: "bundle"` and content type `application/vnd.artifacty.bundle+json; charset=utf-8`.
74
+
75
+ ```json
76
+ {
77
+ "schemaVersion": 1,
78
+ "artifactType": "bundle",
79
+ "title": "Patch bundle",
80
+ "files": [
81
+ {
82
+ "path": "README.md",
83
+ "content": "# Readme",
84
+ "contentType": "text/markdown; charset=utf-8",
85
+ "sizeBytes": 8,
86
+ "sha256": "..."
87
+ }
88
+ ]
89
+ }
90
+ ```
91
+
92
+ Gemini multimodal payloads use the same bundle type with `parts` and `assets`.
93
+
94
+ ## Asset Policy
95
+
96
+ Base64 assets are preserved inline inside bundle JSON with `encoding: "base64"`, `mimeType`, `sizeBytes`, and `sha256`. Consumers must treat decoded assets as untrusted. Large binary asset externalization is intentionally deferred; schema v1 keeps all converted assets inspectable and portable.
Binary file
@@ -0,0 +1,196 @@
1
+ # Agent Integration
2
+
3
+ Artifacty exposes one shared MCP stdio server and one local browser server.
4
+
5
+ ## Start the Browser Server
6
+
7
+ ```bash
8
+ npm start
9
+ ```
10
+
11
+ The dashboard prefers `http://127.0.0.1:8787`. If that port is busy and no explicit port is configured, the server starts on the next available local port and records the actual URL in the store. The store defaults to `~/.artifacty`; set `ARTIFACTY_HOME` to share a different local directory.
12
+
13
+ Create artifacts directly in the browser at `http://127.0.0.1:8787/new`.
14
+
15
+ The browser create/import/edit screens use CodeMirror 6 for Markdown, HTML, JSON, and plain text editing. Editor assets are served from local npm dependencies through `/assets/editor.js` and allowlisted `/vendor/npm/*` module routes.
16
+
17
+ The browser UI defaults to English. Add `?lang=ko` to browser routes to use Korean UI labels; API and MCP payloads are not localized.
18
+
19
+ ## MCP Server Command
20
+
21
+ Use this stdio command from this repository root:
22
+
23
+ ```bash
24
+ node /path/to/artifacty/src/mcp-server.js
25
+ ```
26
+
27
+ Useful environment variables:
28
+
29
+ - `ARTIFACTY_HOME`: store directory, shared by all agents.
30
+ - `ARTIFACTY_URL`: optional browser URL override. Leave it unset to let MCP read the last running server URL from `server.json`.
31
+ - `ARTIFACTY_API_TOKEN`: required token for HTTP API routes when configured.
32
+ - `ARTIFACTY_SHARE_MODE`: set to `lan` or `team` before binding outside localhost.
33
+ - `ARTIFACTY_ALLOW_SECRETS`: set to `true` only when intentionally storing detected secrets.
34
+
35
+ ## Automatic Install
36
+
37
+ Artifacty can write MCP configuration for supported local agents:
38
+
39
+ ```bash
40
+ node src/cli.js install claude
41
+ node src/cli.js install codex --dry-run
42
+ node src/cli.js install gemini
43
+ node src/cli.js install all
44
+ node src/cli.js check
45
+ ```
46
+
47
+ - Claude: writes project `.mcp.json`.
48
+ - Codex: writes or replaces the `[mcp_servers.artifacty]` block in `~/.codex/config.toml` unless `--config` is provided.
49
+ - Gemini: writes project `.gemini/settings.json`.
50
+ - `--dry-run` returns the generated config without writing it.
51
+ - `check` starts the local MCP server and verifies required tools through `initialize` and `tools/list`.
52
+
53
+ ## Claude Code
54
+
55
+ Manual local stdio MCP server:
56
+
57
+ ```bash
58
+ claude mcp add --transport stdio artifacty -- node /path/to/artifacty/src/mcp-server.js
59
+ ```
60
+
61
+ Project-scoped `.mcp.json` shape:
62
+
63
+ ```json
64
+ {
65
+ "mcpServers": {
66
+ "artifacty": {
67
+ "command": "node",
68
+ "args": ["/path/to/artifacty/src/mcp-server.js"],
69
+ "env": {
70
+ "ARTIFACTY_HOME": "/absolute/path/to/artifacty-store"
71
+ }
72
+ }
73
+ }
74
+ }
75
+ ```
76
+
77
+ Claude plugins can bundle MCP servers, so this MCP server can later be wrapped as a plugin. The MVP keeps the server standalone so Claude, Codex, Gemini, and other MCP clients use the same integration surface.
78
+
79
+ ## Codex
80
+
81
+ Add a local MCP server entry to the Codex config:
82
+
83
+ ```toml
84
+ [mcp_servers.artifacty]
85
+ command = "node"
86
+ args = ["/path/to/artifacty/src/mcp-server.js"]
87
+ startup_timeout_sec = 5.0
88
+ env = { ARTIFACTY_HOME = "/absolute/path/to/artifacty-store" }
89
+ ```
90
+
91
+ Restart the Codex session after editing config so the MCP server is loaded.
92
+
93
+ ## Gemini CLI
94
+
95
+ Add a server to `~/.gemini/settings.json` or `.gemini/settings.json`:
96
+
97
+ ```json
98
+ {
99
+ "mcpServers": {
100
+ "artifacty": {
101
+ "command": "node",
102
+ "args": ["/path/to/artifacty/src/mcp-server.js"],
103
+ "env": {
104
+ "ARTIFACTY_HOME": "/absolute/path/to/artifacty-store"
105
+ },
106
+ "timeout": 30000,
107
+ "trust": false
108
+ }
109
+ }
110
+ }
111
+ ```
112
+
113
+ Then run `/mcp` inside Gemini CLI to confirm that the Artifacty tools are connected.
114
+
115
+ ## MCP Tools
116
+
117
+ - `artifacty_create`: create a new Artifacty-native artifact.
118
+ - `artifacty_publish`: backwards-compatible alias for `artifacty_create`.
119
+ - `artifacty_import`: convert a Claude, Codex, Gemini, Artifacty, or generic artifact payload into Artifacty format and save it.
120
+ - `artifacty_list`: discover artifacts by query, tag, or source agent.
121
+ - `artifacty_get`: read artifact metadata and content.
122
+ - `artifacty_update`: append a new version.
123
+ - `artifacty_archive`: hide an artifact without deleting versions.
124
+ - `artifacty_restore`: clear archive state.
125
+ - `artifacty_audit`: list recent audit events.
126
+ - `artifacty_info`: inspect local server/store settings.
127
+
128
+ Mutating MCP tools scan content for common API keys and private keys before storage. Pass `allowSecrets: true` only for intentional exceptions.
129
+
130
+ ## Importing Agent Artifacts
131
+
132
+ Use `artifacty_import` or the CLI `import` command when the artifact was produced by another agent and needs normalization before sharing.
133
+
134
+ ```bash
135
+ node src/cli.js import --agent claude --file ./artifact.html --tag review
136
+ node src/cli.js import --agent codex --file ./handoff.md --tag handoff
137
+ node src/cli.js import --agent gemini --content '{"title":"Options","returnDisplay":"# Options\n- A\n- B"}'
138
+ ```
139
+
140
+ Supported converter inputs:
141
+
142
+ - Claude: local `.html`, `.htm`, `.md`, or JSON payloads with `title`/`content`.
143
+ - Codex: markdown/text/json handoff files, or JSON payloads with `title`, `content`, `format`, `sourceAgent`, and `tags`.
144
+ - Gemini: `returnDisplay`, `llmContent`, text blocks, or local markdown/text/json files.
145
+ - Generic: file extension, content type, HTML doctype, JSON shape, and markdown headings are used to infer format and title.
146
+
147
+ The converter adds `imported` and source-agent tags, preserves the raw content as an immutable Artifacty version, and records source details under `metadata.artifactyImport`.
148
+
149
+ ## HTTP API
150
+
151
+ - `GET /`: dashboard.
152
+ - `GET /new`: browser artifact editor.
153
+ - `POST /new`: create from the browser editor and redirect to the artifact.
154
+ - `GET /import`: browser artifact import form.
155
+ - `POST /import`: convert and save pasted agent output.
156
+ - `GET /health`: health check.
157
+ - `GET /api/artifacts`: list artifacts.
158
+ - `POST /api/artifacts`: create artifact.
159
+ - `POST /api/import`: convert and save an agent-produced artifact.
160
+ - `GET /api/artifacts/:id`: read metadata and content.
161
+ - `POST /api/artifacts/:id`: append a version.
162
+ - `POST /api/artifacts/:id/archive`: archive without deleting versions.
163
+ - `POST /api/artifacts/:id/restore`: restore an archived artifact.
164
+ - `GET /api/audit`: list recent audit events, optionally filtered by `artifactId`.
165
+ - `GET /artifacts/:id`: browser viewer.
166
+ - `GET /artifacts/:id/edit`: browser version editor.
167
+ - `POST /artifacts/:id/edit`: append a version from the browser editor.
168
+ - `POST /artifacts/:id/archive`: archive from the browser.
169
+ - `POST /artifacts/:id/restore`: restore from the browser.
170
+ - `GET /artifacts/:id/diff`: compare two versions.
171
+ - `GET /artifacts/:id/raw?version=n`: raw content.
172
+
173
+ When `ARTIFACTY_API_TOKEN` is configured, `/api/*` routes require either `Authorization: Bearer <token>` or `x-artifacty-token: <token>`. Browser forms can also carry `?token=<token>` in the URL, which is copied to hidden form fields for local team workflows.
174
+
175
+ ## Background Service
176
+
177
+ Generate or install a macOS LaunchAgent plist:
178
+
179
+ ```bash
180
+ node src/cli.js service plist
181
+ node src/cli.js service install --dry-run
182
+ node src/cli.js service install
183
+ ```
184
+
185
+ The generated service runs `src/server.js` with explicit `--host` and `--home` arguments. It includes `--port` only when you configure a port, which keeps the default port fallback available. Load or unload it manually with the `launchctl` commands returned by `service install`.
186
+
187
+ ## Backup and Audit
188
+
189
+ ```bash
190
+ node src/cli.js audit --limit 20
191
+ node src/cli.js backup
192
+ node src/cli.js export --file ./artifacty-backup.json
193
+ node src/cli.js import-store --file ./artifacty-backup.json
194
+ ```
195
+
196
+ Backups include SQLite metadata plus immutable version file contents in one JSON bundle. Importing a store replaces the target store index, so run it against a new or intentionally chosen `ARTIFACTY_HOME`.
@@ -0,0 +1,30 @@
1
+ # Release Checklist
2
+
3
+ Use this checklist before publishing or distributing Artifacty.
4
+
5
+ ## Required Verification
6
+
7
+ ```bash
8
+ npm run release:check
9
+ ```
10
+
11
+ This runs syntax checks, the full Node test suite, and a local smoke test that starts the HTTP server with token auth enabled, creates an artifact, verifies secret blocking, reads audit logs, writes a backup, and checks MCP tool discovery.
12
+
13
+ ## Packaging
14
+
15
+ - Confirm `package.json` `version` and `files` are intentional.
16
+ - Run `npm pack --dry-run` and inspect the included paths.
17
+ - Verify the global commands resolve after install: `artifacty`, `artifacty-mcp`.
18
+
19
+ ## Security
20
+
21
+ - Keep the default HTTP bind address at `127.0.0.1`.
22
+ - Require `ARTIFACTY_API_TOKEN` and `ARTIFACTY_SHARE_MODE=lan` or `team` before binding to `0.0.0.0`.
23
+ - Review secret-scan bypasses. `--allow-secrets` and `ARTIFACTY_ALLOW_SECRETS=true` should be deliberate and temporary.
24
+ - Treat artifact HTML and imported agent payloads as untrusted content.
25
+
26
+ ## Operations
27
+
28
+ - Export a backup before upgrades: `artifacty backup`.
29
+ - Confirm `artifacty audit --limit 20` shows recent create/update/read/archive events.
30
+ - For macOS background service installs, dry-run first: `artifacty service install --dry-run`.