@wix/himalaya-cli 0.1431.0 → 0.1432.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.
@@ -108,7 +108,7 @@ read-only, but it writes the book folder, so it is not annotated read-only to th
108
108
  ],
109
109
  "functions": [
110
110
  { "name": "sendReport", "sourcePath": "base44/functions/sendReport/entry.ts", "kind": "http",
111
- "methods": ["POST"], "invoke": "base44.functions.invoke(\"sendReport\", payload)",
111
+ "methods": ["POST"], "invoke": "functions.invoke(\"sendReport\", payload)",
112
112
  "automations": [{ "name": "weekly", "type": "scheduled", "schedule": "0 9 * * 1" }] }
113
113
  ],
114
114
  "agents": [{ "name": "job_helper", "tools": [{ "entity": "Job", "operations": ["read"] }] }],
@@ -128,7 +128,7 @@ app's own project files) or `rest` (the owner-authenticated API). Treat an opera
128
128
  empty.
129
129
 
130
130
  `BOOK.md` is the same content, summarised for an agent. For each entity it lists the worker calls
131
- the Himi app would make through the `@himalaya/base44` capability: `base44.entities.<Name>.list()`,
131
+ the Himi app would make through the `@himalaya/base44` capability: `entities("<Name>").list()`,
132
132
  `.filter({…})`, `.get(id)`, and the writes (`create`, `update`, `delete`) that the entity's rules do
133
133
  not forbid outright.
134
134
 
@@ -99,6 +99,17 @@ base44: { appId: "<id>", entities: base44Entities, functions: base44Functions },
99
99
  reports row counts and schema drift against the live app. See
100
100
  [`base44-entities`](base44-entities.md) (`himi docs base44-entities`).
101
101
 
102
+ Then generate typed handles from the declaration, and import them in the workers instead of
103
+ spelling entity names:
104
+
105
+ ```bash
106
+ himi base44 types --content . # → tier5-src/_shared/base44-entities.ts (commit it)
107
+ ```
108
+
109
+ A field typo on a typed row (`row.titel`) is then a `himi validate` type error rather than a blank
110
+ cell on device. Re-run it after editing the block — `himi validate` reports `base44-types-stale`
111
+ until you do. See [`base44-sdk`](base44-sdk.md#typed-rows).
112
+
102
113
  ## 3. Plan the screens from the book
103
114
 
104
115
  Write `.himi/screen-plan.md` before editing code. For each entity in `book.entities`:
@@ -285,8 +296,14 @@ himi run --content . # web preview against the live Base
285
296
  ```
286
297
 
287
298
  `himi test` crawls every action against the real workers with hermetic transport, so it proves
288
- the wiring, not your data. Its gap ledger names what the hermetic crawl could not reach (rows that
289
- only exist on the live app, for instance). Close a gap with the remedy it names, or accept it.
299
+ the wiring, not your data. Base44 reads are served from rows you already have: an owned entity's
300
+ `seed:` rows in the `base44.entities` block, then an adopted entity's redacted `sampleRows` from
301
+ `.himi/base44-book/book.json` in the content directory (copy the book in, or re-run analyze with
302
+ `--out .himi/base44-book`). So a list screen crawls populated, its row actions get a row to act on,
303
+ and a typo'd entity name fails loudly instead of rendering empty. Writes and `functions.invoke` are
304
+ refused in the crawl by design, so their error paths are what it exercises. With no seed and no
305
+ book, a declared Base44 read answers nothing and the list crawls empty, as before. Its gap ledger
306
+ names what the hermetic crawl could not reach (rows that only exist on the live app, for instance). Close a gap with the remedy it names, or accept it.
290
307
  Then drive the real flow in `himi run`: list, create, edit, delete a row of each entity, and
291
308
  sign in when the app is not public.
292
309
 
@@ -201,6 +201,16 @@ assembles it from four layers in priority order, **none of which touches the wir
201
201
  4. **offline reject** — the floor that always exists; see the failure UI head-on
202
202
  (`--offline`).
203
203
 
204
+ **Base44 apps have a fifth, beside these.** Base44 reads are `capability.base44.*` calls on the
205
+ host bus, not HTTP, so the layers above never see them. The crawl serves them from the
206
+ `base44.entities` block's `seed:` rows (owned entities, keyed by the physical `Himi<App><Name>`),
207
+ then from `.himi/base44-book/book.json`'s redacted `sampleRows` (adopted entities, keyed by the
208
+ Base44 name). `list` honours `sort` / `skip` / `limit` / `fields`, `filter` matches top-level
209
+ equality only, `get` finds by `id`. An entity neither knows is an error (`http_404`) naming it,
210
+ never `[]`; writes and `functions.invoke` are refused by design. The transport line says
211
+ `+ base44 (N entities …)` when the layer is on. With neither seed nor book it is off, and a
212
+ declared Base44 read answers `null` (the SDK's empty list) as it always did. `--offline` strips it.
213
+
204
214
  **Need your site's real shapes?** `himi test --record` refreshes layer 1 from live reads —
205
215
  `load()` and `onAppear` **only**, read-path-only by construction (GET and read-shaped POST;
206
216
  every write refused at the transport) — then crawls hermetically on what it froze. Explicit
@@ -468,14 +468,14 @@
468
468
  {
469
469
  "name": "EntityHandle",
470
470
  "kind": "interface",
471
- "jsdoc": "",
472
- "decl": "export interface EntityHandle {\n list(opts?: ListOptions): Promise<Base44Row[]>;\n filter(query: JsonObject, opts?: ListOptions): Promise<Base44Row[]>;\n get(id: string): Promise<Base44Row>;\n create(data: JsonObject): Promise<Base44Row>;\n update(id: string, patch: JsonObject): Promise<Base44Row>;\n delete(id: string): Promise<void>;\n bulkCreate(rows: JsonObject[]): Promise<Base44Row[]>;\n}"
471
+ "jsdoc": "/**\n * One entity's verbs. `T` is the row shape: `Base44Row` (untyped) unless the caller names one,\n * e.g. a row type generated by `himi base44 types`. A row type must be a type alias, not an\n * `interface` — only an alias satisfies `Base44Row`'s `JsonObject` index signature.\n */",
472
+ "decl": "export interface EntityHandle<T extends Base44Row = Base44Row> {\n list(opts?: ListOptions): Promise<T[]>;\n filter(query: JsonObject, opts?: ListOptions): Promise<T[]>;\n get(id: string): Promise<T>;\n create(data: Partial<T>): Promise<T>;\n update(id: string, patch: Partial<T>): Promise<T>;\n delete(id: string): Promise<void>;\n bulkCreate(rows: Partial<T>[]): Promise<T[]>;\n}"
473
473
  },
474
474
  {
475
475
  "name": "entities",
476
476
  "kind": "function",
477
- "jsdoc": "/** Typed access to one entity of the configured Base44 app, e.g. `entities(\"Task\").list()`. */",
478
- "decl": "export function entities(name: string): EntityHandle;"
477
+ "jsdoc": "/**\n * Typed access to one entity of the configured Base44 app, e.g. `entities(\"Task\").list()`.\n * Pass a row type to type the rows: `entities<TaskRow>(\"Task\")`. Types only — runtime is identical.\n */",
478
+ "decl": "export function entities<T extends Base44Row = Base44Row>(name: string): EntityHandle<T>;"
479
479
  },
480
480
  {
481
481
  "name": "functions",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1431.0",
3
+ "version": "0.1432.0",
4
4
  "type": "module",
5
5
  "description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
6
6
  "keywords": [
@@ -71,5 +71,5 @@
71
71
  "artifactId": "himalaya-cli"
72
72
  }
73
73
  },
74
- "falconPackageHash": "cb6ae1657ee30165de2fe500a05d3f531ee3a61071976c6db531172e"
74
+ "falconPackageHash": "796dbf6642a176106f5ab3335bbab9788c281db7f264524e0c7fb8e3"
75
75
  }