Skip to content

feat: add script runner tool#878

Merged
pedrobonamin merged 6 commits into
mainfrom
issue-bot/repro-gh-520
May 12, 2026
Merged

feat: add script runner tool#878
pedrobonamin merged 6 commits into
mainfrom
issue-bot/repro-gh-520

Conversation

@pedrobonamin

@pedrobonamin pedrobonamin commented May 12, 2026

Copy link
Copy Markdown
Contributor

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

sanity-issue-bot and others added 4 commits May 12, 2026 12:39
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
Copilot AI review requested due to automatic review settings May 12, 2026 14:01
@pedrobonamin pedrobonamin requested a review from a team as a code owner May 12, 2026 14:01
@pedrobonamin pedrobonamin requested review from annez and removed request for a team May 12, 2026 14:01
@vercel

vercel Bot commented May 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
plugins-studio Ready Ready Preview, Comment May 12, 2026 2:16pm

Request Review

@changeset-bot

changeset-bot Bot commented May 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8c4fb9e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-studio config/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.

Comment thread dev/test-studio/package.json Outdated
Comment thread dev/test-studio/src/script-runner/scripts/seed-issue-520/REPRO.md Outdated
Comment thread dev/test-studio/src/script-runner/scripts/seed-issue-520/REPRO.md Outdated
Comment thread .agents/skills/test-studio-script-runner/SKILL.md
Comment thread dev/test-studio/src/script-runner/ScriptRunnerTool.tsx
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@juice49 juice49 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea! 💯

@pedrobonamin pedrobonamin merged commit 795bfad into main May 12, 2026
15 of 16 checks passed
@pedrobonamin pedrobonamin deleted the issue-bot/repro-gh-520 branch May 12, 2026 15:57
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.

3 participants