@caperjs/core 0.5.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -53,6 +53,8 @@ not enough, open the one file the doc cites, not the whole tree.
53
53
  ## 3. Verify loop
54
54
 
55
55
  ```bash
56
+ npx caper doctor # 10 lines: which caper, types fresh?, pointers, peers. Fix ✗/⚠ first
57
+ npx caper types # regenerate caper-app.d.ts + caper-assets.d.ts, no dev server (fresh clone, renames)
56
58
  pnpm typecheck # or the app's tsc script; first gate after any .ts change
57
59
  pnpm build # vite build; catches asset and discovery errors
58
60
  ```
@@ -77,11 +79,13 @@ Then check behaviour live, cheapest first:
77
79
  ```
78
80
 
79
81
  - **Headless via the automation bridge** (dev server, or `automation: true`
80
- in config, or `VITE_CAPER_AUTOMATION=true`): from Playwright or a browser
81
- tool, `const app = await Caper.ready(); const a = Caper.automation[app.config.id];`
82
- then `a.action('name', data)`, `a.getContext()`, `a.getState()`,
83
- `await a.waitFor(s => …, { timeoutMs })`, and inspect `a.log` (last 200
84
- actions / context changes / state pushes). Details: llms.txt §17.
82
+ in config, or `VITE_CAPER_AUTOMATION=true`). Shipped driver, no code:
83
+ `npx caper agent probe <url> [--action name[=json]]… [--until "s => …"] [--screenshot p] [--json]`
84
+ context, state, action log, page/console errors, exit 1 on failure. For
85
+ anything richer, in Playwright: `const app = await Caper.ready(); const a =
86
+ Caper.automation[app.config.id];` then `a.action('name', data)`,
87
+ `a.getContext()`, `a.getState()`, `await a.waitFor(s => …, { timeoutMs })`,
88
+ and inspect `a.log` (last 200 entries). Details: llms.txt §17.
85
89
  - **Do not start the dev server yourself** and leave it running in the
86
90
  foreground; it never exits. If the human has it running, use it. Otherwise
87
91
  ask them to run `pnpm dev` and report.
@@ -90,14 +94,14 @@ Then check behaviour live, cheapest first:
90
94
 
91
95
  - Out-of-context actions are **dropped by the ActionsPlugin**. That is the
92
96
  phase guard; do not add `if (phase !== …)` checks around `sendAction`.
93
- - `src/types/caper-app.d.ts` and `caper-assets.d.ts` are **generated** on dev
94
- server start. Never hand-edit. Missing or stale delete them and have the
95
- dev server run once. They are usually gitignored, so a fresh clone has no
96
- typed ids until then.
97
+ - `src/types/caper-app.d.ts` and `caper-assets.d.ts` are **generated**. Never
98
+ hand-edit. Missing (fresh clone; they are usually gitignored) or stale after a
99
+ rename `npx caper types`. No dev server needed.
97
100
  - Weird asset / name mismatches → `rm -rf .assetpack .cache dist` and rebuild.
98
101
  - Renamed a scene / popup / entity id? Regenerate types (above) or old ids
99
102
  linger in the unions and cause confusing downstream errors.
100
103
  - If the engine is **linked from a local checkout**, consumer apps resolve the
101
104
  built `lib/`; rebuild the engine (`pnpm framework:build` in the caper repo)
102
105
  after editing engine source, unless the app's vite config aliases
103
- `@caperjs/core` to the engine `src/`.
106
+ `@caperjs/core` to the engine `src/`. `npx caper doctor` reports "linked from
107
+ …" and flags a stale build.
package/lib/caper.mjs CHANGED
@@ -204,7 +204,7 @@ function B(e, t) {
204
204
  }
205
205
  //#endregion
206
206
  //#region src/version.ts
207
- var V = "0.5.2", H = "8.19.0", Mn = " ........ ..... ............ ............. ........... \n ............. ....... ................ ............. .............. \n .............. ......... ............... ............. .............. \n ..... ........... .............. ............ .............. \n ..... ...... ...... .............. ............. ............. \n .............. ...... ..... ............ ............. ..... ...... \n ................... ..... ..... ............. ..... ....... \n ................ .......... ............. ..... ..... ";
207
+ var V = "0.6.0", H = "8.19.0", Mn = " ........ ..... ............ ............. ........... \n ............. ....... ................ ............. .............. \n .............. ......... ............... ............. .............. \n ..... ........... .............. ............ .............. \n ..... ...... ...... .............. ............. ............. \n .............. ...... ..... ............ ............. ..... ...... \n ................... ..... ..... ............. ..... ....... \n ................ .......... ............. ..... ..... ";
208
208
  function U() {
209
209
  let e = `\n${Mn}\n\n v${V} | %cPixi.js v${H} %c| %chttps://github.com/anthonysapp/caper\n\n`;
210
210
  console.log(e, "color: #E91E63; font-weight: 600;", "color: inherit;", "color: #00BCD4; text-decoration: underline;");