Skip to content

Add edit-artifact: patch-based artifact updates - #1512

Merged
RhysSullivan merged 1 commit into
mainfrom
artifact-patch-edits
Jul 31, 2026
Merged

Add edit-artifact: patch-based artifact updates#1512
RhysSullivan merged 1 commit into
mainfrom
artifact-patch-edits

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

Every artifact edit currently re-emits the entire component source, so the model's output — and the user's wait — scales with component size rather than edit size. This adds an edit-artifact tool: exact find-and-replace patches against the stored source, applied in order, all-or-nothing.

  • applyArtifactEdits (pure, in create-artifact.ts): unique-match enforcement with a replaceAll opt-out, ordered application, and rejection messages the model can retry from.
  • The edited result runs the same validate → smoke-render → bind → save pipeline as a create, so an edit cannot save anything a create would refuse. A failed batch changes nothing and returns the current source in structuredContent.code, so the retry needs no show-artifact round trip.
  • create-artifact's description, the artifactId param text, and the create-artifact skill now route tweaks to edit-artifact and reserve full re-send for rewrites.

Tests: 9 new tool-level cases (sequencing, replaceAll, ambiguity, atomicity, validation/smoke-render of the edited result, probe-proof foreign ids, binding re-resolution, title/description updates); visibility assertions and the e2e opt-out enumeration updated. Format, lint, typecheck, mcp + execution suites, and the artifacts selfhost e2e scenario all pass.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing e8b4dad Commit Preview URL

Branch Preview URL
Jul 31 2026, 08:56 PM

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud e8b4dad Jul 31 2026, 08:57 PM

@pkg-pr-new

pkg-pr-new Bot commented Jul 31, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@1512

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@1512

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@1512

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@1512

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@1512

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@1512

executor

npm i https://pkg.pr.new/executor@1512

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@1512

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@1512

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@1512

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@1512

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@1512

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@1512

commit: e8b4dad

@RhysSullivan
RhysSullivan marked this pull request as ready for review July 31, 2026 21:04
@RhysSullivan
RhysSullivan merged commit 0e02fc5 into main Jul 31, 2026
19 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant