feat: add script runner tool#878
Conversation
Adds an end-to-end reproduction inside dev/test-studio: - new issue520Repro document type wired into the kitchen-sink workspace - scripts/seed-issue-520.mjs uses @sanity/client to create a release, add a misordered internationalized array, and publish immediately - plugins/sanity-plugin-internationalized-array/REPRO.md documents the full flow including the unit-test path
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
There was a problem hiding this comment.
Pull request overview
Adds a new “Scripts” tool to the dev/test-studio (kitchen-sink workspace) for running browser-side scripts using the current Studio client (logged-in user), plus an initial script/schema intended to reproduce issue #520.
Changes:
- Introduces the Script Runner tool UI, routing, script registry, and script contract types.
- Adds a seed/repro Studio script (
seed-issue-520) and a dedicated schema type (issue520Repro) to support reproducing issue #520 in the test studio. - Adds documentation/agent skill docs for the tool and updates
dev/test-studioconfig/deps to include it.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Adds lockfile entry for @sanity/client used by test-studio tooling/scripts. |
| dev/test-studio/src/script-runner/types.ts | Defines the script contract (context, inputs, logger) for Studio-run scripts. |
| dev/test-studio/src/script-runner/scripts/seed-issue-520/REPRO.md | Documents steps to reproduce issue #520 using the test studio + seed script. |
| dev/test-studio/src/script-runner/scripts/seed-issue-520/index.ts | Adds a Studio-run script that creates/publishes a release version for repro. |
| dev/test-studio/src/script-runner/scripts/seed-issue-520/helpers.ts | Helpers for generating misordered localized array values. |
| dev/test-studio/src/script-runner/ScriptRunnerTool.tsx | Implements the Scripts tool UI (home, script view, variables, output). |
| dev/test-studio/src/script-runner/registry.ts | Implements eager script discovery/validation via import.meta.glob. |
| dev/test-studio/src/script-runner/README.md | Developer-facing documentation for adding/running Studio scripts. |
| dev/test-studio/src/script-runner/index.tsx | Registers the Scripts tool as a Studio plugin (with router state). |
| dev/test-studio/src/internationalized-array/issue-520-repro.ts | Adds a schema type used to reproduce issue #520. |
| dev/test-studio/src/internationalized-array/index.tsx | Registers the new repro schema type in the internationalized-array example plugin. |
| dev/test-studio/sanity.config.ts | Enables the new scriptRunnerTool() in the kitchen-sink workspace. |
| dev/test-studio/package.json | Adds @sanity/client dep and a seed:issue-520 script entry. |
| .claude/skills/test-studio-script-runner/SKILL.md | Adds Claude skill documentation for the Script Runner tool. |
| .agents/skills/test-studio-script-runner/SKILL.md | Adds agent skill documentation for the Script Runner tool. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
0ecb6f5 to
8c4fb9e
Compare
Description
Let's help agents help us.
Adds a new tool into the studio to run scripts using the studio client and user token.
This will allow agents and humans to build scripts with reproduction cases for issues reported. Like this one #520
The agent created a script to reproduce it, then we can open the studio, run the script and verify if the issue still persists or not.
Screen.Recording.2026-05-12.at.15.55.05.mov
What to review
The new tool
Testing