Repository navigation
Artifacts: shared documents and small apps beside the thread (Markdown, HTML, SVG, React) - #104
Open
Erioluwa-dev wants to merge 2 commits into
Open
Erioluwa-dev wants to merge 2 commits into
Erioluwa-dev wants to merge 2 commits into
Conversation
Agents in a room can create, update, read and restore shared artifacts (markdown, html, svg, react). Each save is an immutable multi-file revision with an authenticated author, a base_revision conflict check and durable idempotent create. Reads are paged by UTF-8 bytes; events carry metadata only. The desktop reports build and runtime results back through ReportArtifactBuild so agents can read compile errors. Mutations are rejected in plan mode. Co-Authored-By: Deck <311780591+deck-cli@users.noreply.github.com>
An Artifacts panel shows Markdown in the app and HTML, SVG and React in an isolated view: its own in-memory session, no preload or IPC, a strict CSP, a refusing proxy for WebRTC and a deny-only navigation guard. React revisions are compiled with esbuild-wasm in a disposable utility process from the revision's own files and a short import allowlist; the code is never evaluated there. Adds revision history, restore, source export, chat cards, build and runtime error reporting, and real-Electron isolation tests. Co-Authored-By: Deck <311780591+deck-cli@users.noreply.github.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Agents (Claude or Codex) can now create and iterate on artifacts in a room: Markdown, SVG, single-page HTML/CSS/JS, and multi-file React (JSX/TSX). They open in a new Artifacts tab beside the thread, with Preview / Source / Errors, a revision picker, restore, copy and source export, and a chat card that opens the artifact from the message that made it. See
docs/artifacts.md.How
Engine (Go)
base_revisionconflict checks (typedArtifactConflicton gRPCAborted), durable idempotent create, plan-mode mutations rejected.artifact.create/update/restore/list/revisions/read(reads paged by UTF-8 bytes, 2 KiB for agents, 256 KiB for the desktop). New RPCsArtifacts,ArtifactRevisions,ArtifactRead,ArtifactAction,ReportArtifactBuild; eventartifact_changed = 30carries metadata only.artifact.read.Desktop (Electron)
deck-artifact://scheme with a strict CSP, deny-only navigation, and a refusing proxy plusdisable_non_proxied_udpso WebRTC reaches nothing. A fresh view per show; events carry a request id so a replaced page can't report into the next one.esbuild-wasmin an Electron utility process (killable on cancel). Only the revision's own files andreact,react-dom,react-dom/client,react/jsx-runtimecan be imported. Artifact code is never evaluated in main.react/react-dommoved todependenciesandesbuild-wasmadded so packaged builds can compile.Verification
go build ./...,go veton touched packages, Go tests forartifacts,hub,workspace: pass.desktop-shell:npm run lintclean; 648 artifact + renderer tests pass.test/artifact-electron.cjs, 9 checks): hostile HTML/SVG reach no loopback http/tcp/udp, CSP blocks form/frame/img/script, React renders offline, forbidden imports fail to build, WebRTC STUN/TURN (UDP and TCP, incl. a fresh-frame constructor) sends nothing..deck/artifacts-verification.md, not committed).Known failures, not from this PR
These fail on this Windows machine and I did not confirm each against a clean
main:internal/deck/session:TestInstructionsFitTheBudgetAtEveryLevel(the host's team config inflates the briefing),TestAgentRaceReportsOnceAndIsJudged, and aTestWorktreeLifecyclehang that hit the 10-minute timeout.pkg/rpc:TestGitStatusCheckoutAndCommitandTestTerminaltime out on git/PowerShell.desktop-shell: 7 test files (unix-socketEACCES, POSIX paths, TLS pinning).Not covered
Generated with Deck