blob: 0b2a7504131c9881f91ae58cc9a5c4ba383156e0 [file] [log] [blame] [view]
Pokey Rulebbca2402025-04-24 09:37:58 +01001# Contributing to Sketch
Philip Zeyligerd43e5722025-04-23 19:21:26 -07002
3## Running tests
4
Pokey Rulebbca2402025-04-24 09:37:58 +01005- `go test ./...`
6- `cd webui && npm run test`
7 - If you are an LLM, instead run `cd webui && CI=1 npm run test`
Philip Zeyligerd43e5722025-04-23 19:21:26 -07008
9## Synchronizing Go structs and TypeScript types
10
11Run `npm run gentypes`, which uses `cmd/go2ts/go2ts.go` under the covers and
12which has a list of types to translate.
13
14## Dealing with tests that have HTTP Record sessions
15
16A few tests record/replay calls to LLMs. As necessary (e.g.,
17if changing the system prompt or tool definitions), rebuild the
Josh Bleecher Snyder08951fb2025-04-24 10:42:12 -070018test data by running update_tests.sh in the relevant directory.
Philip Zeyligere114af52025-05-02 16:44:12 -070019
20## Debugging JS Classes
21
22Something like "document.querySelectorAll('sketch-app-shell')[0].dataManager.messages.map(x => x.idx)"
23in the browser JS console works to pull out the custom components implementing the web ui.
Philip Zeyligerf396a002025-05-05 13:12:11 -070024
25## Recursively running Sketch
26
27If you are editing Sketch from within Sketch, you can use the following to give
28Sketch a place to store its skaband client key across sessions, allowing the
29agent to iterate on itself.
30
31```
32# Outside
33mkdir -p ~/.inside-cache/webui
34go run ./cmd/sketch -docker-args "-v $HOME/.inside-cache:/root/.cache/sketch"
35# Inside
36go run ./cmd/sketch -unsafe
37```