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