th-66b4c6: create_artifact HTML report tool for Big Smooth#274
Merged
Conversation
Big Smooth's answer to Claude Code Artifacts: a new create_artifact agent tool that writes a self-contained HTML document into <workspace>/.smooth-artifacts/ and returns the absolute path plus a clickable file:// URL. Same workspace confinement + Write deny gate as write_file. Registered in the default tool set so every host (incl. the daemon) gets it. Inline rendering in smooth-web is a follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: eff35fd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
brentrager
enabled auto-merge (squash)
July 26, 2026 17:29
…est paths Windows CI caught two things: (1) the test built its expected path with a literal "a/b" join, so it compared forward slashes against the backslashes the tool emits — now nested joins (native on both platforms); (2) a REAL bug — on Windows `file://C:\dir\a.html` is malformed and won't open. URL rendering moved into file_url()/file_url_parts(), emitting `file:///C:/dir/a.html` (three slashes, forward separators) on Windows. Regression test covers both shapes from any host. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TwUg6nyMqXHzFDsibzTKmp
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.
Problem
Big Smooth had no way to produce a rich, self-contained HTML report/artifact the way Claude Code Artifacts do — the agent could only write plain files with no clickable "open this" affordance.
Solution
New `create_artifact` agent tool in `smooth-tools`, modeled on `write_file`:
Tests
Colocated `#[cfg(test)]`: writes-and-round-trips (asserts path + `file://` URL in result), `.html` extension appended when missing, directory components stripped. `cargo test -p smooai-smooth-tools` → 112 passed. Clippy clean on new code.
Follow-up
Rendering the artifact inline in smooth-web (clickable card / iframe preview in the chat UI) is intentionally out of scope here — this PR is just the tool + link. Follow-up pearl to wire the web render.
🤖 Generated with Claude Code