Skip to content

Latest commit

 

History

History
56 lines (36 loc) · 4.44 KB

development.md

File metadata and controls

56 lines (36 loc) · 4.44 KB

Develop CLI Design Studio

Open this checkout as a trusted Copilot project to work on the editor sources. Enable only one Studio provider in a session. The eval harness, ghmock, and design adapter ship in this repository. No production gh changes are required.

Canvas-only install

In the desktop app's Install canvas extension dialog, paste the URL of the install folder at a fixed revision. For a different version, select the tag or commit on GitHub and copy the URL of install/cli-design-studio-canvas. The repo root and the development entrypoint are not folder installs.

The editor and exports do not need Go, npm, or model quota. The operator guides are accessible through get_operator_guide on the open canvas. To register the named skill separately, use copilot skill add "${COPILOT_HOME:-$HOME/.copilot}/extensions/cli-design-studio-canvas/skills". The whole-plugin install includes the named skill. If you switch to it, disable the separate canvas under Installed.

Prepare the eval tools

Use macOS or Linux with Git, Node.js 22.14 or newer, npm, and Go compatible with the pinned CLI. Local evals also need working sandbox-exec or bwrap. Run from this checkout in project mode. For a device install, change to the directory printed by:

node "${COPILOT_HOME:-$HOME/.copilot}/extensions/cli-design-studio-canvas/runtime.mjs" --path

Build both targets from an existing cli/cli clone. Only the pinned commit is read, not your working changes:

node script/build-cli.mjs --source /path/to/cli

Alternatively, node script/build-cli.mjs --allow-downloads permits downloading the public pin and Go dependencies. To replace only Implementation with your trusted build, run node script/build-cli.mjs --candidate /path/to/built/gh.

go -C script/ghmock build -o "$PWD/bin/ghmock" .
bin/ghmock schemas update  # first-time download of public schemas
npm --prefix evals ci --ignore-scripts
npm --prefix evals run build
./run-evals --list

The builder caches Git objects under .studio-cache/ and compiles in a disposable directory. Without --allow-downloads, it requires a local source or cached pin plus cached Go dependencies. Only Design uses a Go overlay. It never writes to the upstream checkout or patches production gh.

The installed runner and build cache live under $COPILOT_HOME/cli-design-studio/runtime/. The private library is at $COPILOT_HOME/cli-design-studio/artifacts/. COPILOT_HOME defaults to ~/.copilot. Updating or sharing the install folder does not include either directory.

Check changes

node script/build-cli.mjs --target test
go -C script/ghmock test ./...
npm --prefix evals test
node --test .github/extensions/cli-design-studio/test/*.test.mjs

For browser regressions, follow the WebKit and Chromium setup. Ordinary tests use local fixtures, not a paid model or live GitHub repository.

Rebuild the install folder

After changing runtime code or the operator skill, run node script/package-canvas.mjs and review the generated files with your source changes. The packager reads tracked source paths, never a user installation. sources.json lists paths and SHA-256 digests. Each text part contains base64-encoded, zlib-compressed JSON [path, source] pairs. The loader verifies and restores the sources in the private runtime directory.

Run node script/package-canvas.mjs --check to compare each decoded byte with the source and reject stale activation manifests, stale guide files, or unexpected files. The package check exercises a folder-only installation without credentials. Distribute the complete folder at the reviewed revision. The root plugin.json points to the same folder and skill; use a clean checkout for whole-plugin installs.

To update the upstream pin, review the new commit and startup code, update script/upstream.json, and recheck both targets. Do not refresh the startup digest just to bypass a mismatch.