dsh-artifact-studio
v0.18.4
Published
Local-first artifacts for DeepSeek Harness: the agent creates pages, documents, spreadsheets, and mockups as versioned files, and you open, edit, restore, and export them beside the chat.
Maintainers
Readme
Artifact Studio

Versioned pages, documents, spreadsheets, and mockups the agent writes and you edit beside the chat.
Artifact Studio is a plugin for the DeepSeek Harness Web app. The agent creates an artifact as a file on your machine, and you open it in a panel beside the conversation to read, edit, compare versions, and export. Artifacts need no account and no hosted service.
Contents
- Install
- Quick start
- Artifact types
- Agent tools
- Versions and drafts
- Tokens and briefs
- Storage
- Editing in the panel
- Privacy and security
- Limits
- Troubleshooting
- Develop
- Credits
- License
Install
Add the package to the Web profile. The profile flag is required.
dsh plugin --profile web add dsh-artifact-studioThe npm package may be older than this checkout. The link install below runs the code described here.
Reload the Harness window after the command, and restart DeepSeek Harness if the Artifacts row does not appear. The package ships a bundle patch that adds three plugin entries: the panel and its local route, the eleven agent tools, and the artifact-design skill.
A local checkout needs a link and a build:
npm install
npm run build
dsh plugin --profile web add link:/absolute/path/to/dsh-artifact-studioRebuild and restart the Web profile after a source change, then reload the window. See Develop for the checks.
Quick start
Open a session in any workspace and ask for the artifact you want. You do not need to load a skill or choose a recipe.
| Type | Sample prompt | Where it opens | | --- | --- | --- | | Page | "Create an artifact page: a one-page dashboard for our weekly support queue." | A tab beside the chat. | | Document | "Create an artifact document: a project brief with context, goals, scope, and open questions for the checkout redesign." | A tab beside the chat. | | Spreadsheet | "Create an artifact sheet: a budget that tracks monthly tools and hosting costs." | The full Artifacts page. | | Mockup | "Create a mockup of the pricing page with three plan cards and a comparison table." | A tab beside the chat. |
Select the artifact card in the reply to open the result. Edit it there or ask the agent for a change. Export from the artifact header.
The Artifacts row in the left sidebar opens the full page: search, a scope selector for all projects, one project, or the library, type filters, covers, and pins. The New artifact button creates one from a starter template. The Artifacts guide in the right panel shows the same list for the current project, and each card opens its own tab. The Artifacts button in the composer lists recent artifacts and starter prompts.

The screenshots use a sample checkout project. Its numbers and names are illustrative.
Artifact types
| Type | Stored as | Edited in | Exports |
| --- | --- | --- | --- |
| Page | content/index.html | Sandboxed HTML preview and code editor | HTML |
| Document | content/document.md | Rich text editor | Markdown, Word, HTML |
| Spreadsheet | content/sheet.json | Grid with a formula bar | CSV, XLSX |
| Mockup | content/design.jsx | Canvas with inspector | PNG, SVG, .fig, HTML viewer, HTML with text |
Pages
A page is one HTML document. It renders in a sandbox with scripts allowed and every network request blocked, so inline every style, script, and image. Preview renders the page and Code edits it. Ctrl or Cmd with the wheel, or with +, -, or 0, zooms the preview. The header percentage shows the scale and offers a reset. Save or Ctrl/Cmd+S writes a version. A page that declares <meta name="color-scheme" content="light dark"> follows the Harness dark theme; without the meta it keeps its light colors.
A page write returns warnings for a network URL, a browser storage API, a fixed width over 960 pixels, a missing viewport meta, a literal color or font, and a page that uses no built-in tokens. Warnings describe the source and do not block the save.

Documents
A document is Markdown edited in a rich text editor. It autosaves about a second after a change, and formatting controls appear over a selection. The editor and HTML export use the built-in tokens. Word export uses selected font and color settings without reproducing the HTML layout. Export as Markdown, Word, or HTML, or print it.

Spreadsheets
A spreadsheet is one JSON workbook with cell values, styles, and Excel formulas. The panel edits it in a virtualized grid with a formula bar, a formatting toolbar, sheet tabs, merged cells, wrapped text, and undo. Changes autosave.
The panel, CSV, XLSX, and print copies share one evaluator, so a value is the same everywhere. The canonical workbook shape is documented in src/sheet/model.ts. A formula that fails is stored and shown as #NAME?, #REF!, #DIV/0!, #VALUE!, #N/A, or #CYCLE!. CSV exports one sheet, the first unless the agent names another. XLSX exports every sheet with styles, formulas, and cached results.

Mockups
A mockup is stored as type design. It is OpenPencil Design JSX: frames, text, shapes, gradients, and bundled Material Design Icons. The host compiles it in a child process and saves a PNG preview.
View is the default mode and does not change the document. Edit adds the select, hand, shape, frame, and text tools plus undo, and opens an inspector with the layer tree and the selected layer's position, size, rotation, radius, opacity, visibility, and text properties. Selecting a layer turns it into an agent request. Edits stay a draft until Save. A version opened from History opens in the same canvas in View and is read only.
Exports are PNG, SVG, a .fig file for OpenPencil or Figma, a self-contained HTML viewer, and a smaller HTML page with the engine SVG and selectable HTML text.

Agent tools
Tools read and write the same files the panel uses. They default to the session's workspace. Pass workspaceId to address another registered workspace; library artifacts take no workspace id.
| Tool | What it does |
| --- | --- |
| artifact_create | Create a page, document, spreadsheet, or mockup. |
| artifact_read | Read content or one saved version, a mockup outline, or spreadsheet values. |
| artifact_update | Save a new version with replace-once edits or complete content. |
| artifact_patch | Replace one mockup layer in place. |
| artifact_sheet_update | Apply cell, range, row, column, and sheet operations. |
| artifact_list | List artifacts in a project or the library. |
| artifact_export | Write a standalone file in one supported format, or one mockup layer as PNG or SVG. |
| artifact_import | Import a .fig file as a mockup. |
| artifact_delete | Move an artifact to the trash. |
| artifact_preview | Render a mockup, or one layer at its own size, and return the image to the model. |
| artifact_brief | Read the technical guide for one artifact type, with optional recipe guidance. |
| artifact_guide_update | Save project conventions or a recipe. |
Eleven tools are always registered. artifact_preview appears only when the profile mounts durable image storage and model routes.
Custom workflows
The only bundled skill is artifact-design, a short guide to choosing a type and using the tools. No walkthroughs or starter recipes ship with the plugin.
To use a personal workflow such as a visual walkthrough, add it as .agents/skills/<name>/SKILL.md in the project or under ~/.agents/skills/ for use across projects. The Harness filesystem skill provider discovers it when mounted. Give the file a name and description in its YAML frontmatter, then write your steps and call artifact_brief for the artifact type you need.
Versions and drafts
- Every save creates a version. Restoring an old version appends a new one and leaves history intact.
- Writes use compare-and-set.
artifact_updateandartifact_sheet_updatetake abaseVersion, and a stale one is refused, so a save never overwrites a newer version. - The store keeps the 50 newest versions and 20 MiB of version history per artifact, then prunes older versions.
- A page or document version pins its recipe and page kit when used. Editing text never restyles the artifact; pass a new recipe to
artifact_updateto change it. Mockups and spreadsheets have no pinned snapshot. - Documents and spreadsheets autosave. Pages and mockups save from the header. A draft lives in window memory, shared by every tab open on that artifact, and does not survive a browser restart.
- Reload and Back ask to save, discard, or cancel when a draft is pending.
- When the agent saves a newer version, a clean tab reloads and names it. A tab with unsaved edits shows a conflict bar instead.
- History previews any saved version. Export and print use the selected version and never fall back to the latest.
Design systems and briefs
Pages and documents take their colors, fonts, type scale, spacing, and radii from one built-in token set, injected as --artifact-* CSS variables. The set carries light and dark values; a page follows dark mode only through its color-scheme meta. Mockups use literal colors and fonts, so the tokens do not restyle one.
To brand a single page, define its palette once as page-local custom properties and reference them with var(). A brand or style rule that must hold across every artifact belongs in project conventions or in a skill, saved with artifact_guide_update. Spreadsheet print uses the built-in tokens around the table and keeps the saved cell styles.
The tools do not require a skill. Call artifact_brief with just the artifact type to get its technical rules, the built-in token values, and the project conventions and user preferences that apply. A recipe is an optional content structure for a Page, Document, or Mockup. Ask the agent to save one with artifact_guide_update in the project or with scope: "library" to share it across projects. The brief lists saved recipes for its type. Pass a recipe ID to include its rules and relevant earlier artifacts. A workspace recipe replaces a library recipe with the same ID. Spreadsheets accept no recipe.
Conventions are reusable instructions for voice, layout, or content. Ask the agent to save them with artifact_guide_update for the project or the library. Project conventions apply in that project, and library conventions apply everywhere. Invalid guide files fail the read and stay on disk for manual repair.
Pages can opt into the shared kit with <meta name="artifact-kit" content="1"> and the ak- classes it injects. A kit version fixes component definitions. Colors still come from the built-in tokens. The packaged page reference shows the token patterns for a page without the kit.
Storage
$DSH_HOME/artifacts/
workspaces/<workspaceId>/<artifact id>/
v1/<artifact id>/ library artifacts
<scope>/.trash/ deleted artifacts, kept 7 daysAn artifact directory holds artifact.json, content/, and versions/<n>/. A mockup adds preview/<sha256>.png with a JSON summary. Tool exports land in exports/. A page or document version also stores versions/<n>/generation.json with its pinned recipe and kit.
A workspace artifact is visible only in its registered workspace. A library artifact is visible in every project. The agent addresses another workspace by workspaceId, which must resolve through the workspace registry before any path is built.
The artifact menu copies or moves a workspace artifact to another registered workspace. A copy writes a new artifact under a new id with the same version history. A move follows the artifact to its destination and keeps the source in the workspace trash for 7 days.
A write takes an exclusive .write-lock file beside the artifact directory and is serialized per artifact in the process. A lock left by a crash is removed by hand after confirming no process is writing.
Editing in the panel
The header carries the title, project, version picker, save status, history, and export. Pages and mockups add a mode switch. The more menu renames or deletes an artifact, and copies or moves a workspace one. Delete sends it to the trash.
Edit with agent saves pending edits, then places the selected text and a reference to the artifact, its workspace, and its saved version in the message box. You finish the sentence and send it. Selections work in documents, spreadsheet cells and ranges, the page preview, and page code. The full Artifacts page has no conversation, so it copies the same text instead.
Several tabs can show one artifact. They share the draft and serialize saves. The right panel guide opens the project list without leaving the conversation.
Privacy and security
- Every artifact is a local file under
$DSH_HOME. The plugin sends no telemetry and needs no account. - A page preview runs with
sandbox="allow-scripts"and noallow-same-origin, under a CSP that blocks network requests. Browser storage APIs throw. - Mockup compilation runs in a separate Node process under the permission model: it reads only the plugin package and its installed modules, with no network, no file writes, and no child processes. A 20 second deadline stops a hung source.
- The canvas engine, icon set, and fonts are served from a fixed list of local assets. Artifact content is never served from that route, and rendering an artifact makes no network request.
- Gallery covers are scriptless, opaque-origin frames with scripts and inline handlers stripped.
- A selection quoted from a page preview is accepted only when the message comes from that frame.
- Library artifacts are shared across projects. Workspace artifacts stay in their workspace.
Limits
| Item | Limit |
| --- | --- |
| Content per version | 2 MiB |
| Versions per artifact | 50 newest, 20 MiB of history |
| Title | 120 characters |
| List page | 50 artifacts per call |
| Sheets per workbook | 20 |
| Rows and columns per sheet | 5,000 rows, 100 columns |
| Cells and formulas per artifact | 20,000 cells, 5,000 formulas |
| Cells in a print copy | 20,000 per sheet |
| Mockup render | 20 seconds |
| .fig import | 128 MiB |
| Mockup preview | 1,600 pixels on the long side |
Troubleshooting
| Symptom | What to do |
| --- | --- |
| dsh plugin add fails with a usage error | Add the profile: dsh plugin --profile web add ... |
| The agent has no artifact tools | Reload the window, then restart DeepSeek Harness if they are still missing. The profile must load dsh-artifact-studio/tools. |
| artifact_preview is missing | The profile needs image storage and model routes. Every other tool works without it. |
| A save is refused as stale | Another view or the agent saved first. Read the artifact again and reapply the change. |
| A mockup save fails | The message names a compile or validation problem in the Design JSX. Fix the source. If the renderer stopped, that is a plugin fault, so report the error. |
| A read fails as corrupt | A saved version or its generation snapshot cannot be read. Restore an earlier version or export before editing. |
| Writes fail after a crash | A .write-lock file was left beside the artifact. Confirm no Harness process is writing, then delete it by hand. |
| The full test suite is killed | It builds and runs every suite. Run one file, such as node --test tests/sheet.test.mjs, or run the full suite on a larger machine. |
Develop
npm install
npm run typecheck # host and client
npm run lint
npm run build
node --test tests/sheet.test.mjsnpm run build compiles the host into dist/, bundles client.js with the lazy client.doc.js, client.sheet.js, and client.canvas.js, and copies the canvas engine and its assets into assets/. Do not edit the built files.
npm test builds, then runs every suite in tests/. It is memory heavy and can be killed by the OS on a small machine.
Source layout:
src/host/holds the local route, the tools, the artifact service and store, the exporters, and the design worker.src/client/holds the panel, the gallery, the editor models, and the three lazy chunks.src/sheet/holds the workbook model, operations, formula evaluation, and views shared by the host and the panel.src/contract.tsandsrc/render.tsare shared by both halves.scripts/build.mjsbuilds the bundles.tests/holds the suites and the optional browser checks.
A live check renders the running Web GUI in headless Chromium and prints console errors, page errors, and a screenshot:
npm run webcheck -- --path / --out .scratch/web-check/home.pngIt needs a running Web profile at $DSH_WEB_URL, an installed Playwright and Chrome, and the profile's browser-session credential in $DSH_HOME. It installs nothing and prints no secret.
Runtime dependencies are MIT. Build-time dependencies bundled into a client chunk are MIT, Apache-2.0, or BSD-3-Clause, and each ships in THIRD_PARTY_NOTICES.md. AGENTS.md records the package facts a new contributor needs, and DESIGN.md covers the panel chrome.
Credits
- DeepSeek Harness and its UI primitives.
- OpenPencil and CanvasKit for the mockup engine and renderer.
- Tiptap for document editing.
- fast-formula-parser and fflate for spreadsheets.
- docx and marked for exports.
- Material Design Icons, Inter, Roboto, and Noto Naskh Arabic for the bundled assets.
License
MIT. See LICENSE.
