@wix/himalaya-cli 0.1272.0 → 0.1273.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.
Binary file
@@ -0,0 +1,35 @@
1
+ {
2
+ "references/html-and-bindings.md": "# HTML and bindings\n\nRead this before authoring a screen. HHP compiles HTML into native components;\nthe browser preview renders that compiled descriptor and its actual T5 worker.\n\n## Document and files\n\nRun `himi hhp init home --content .` inside an existing Himi content package.\nChoose a different ID if home already exists. It creates and registers these files:\n\n```text\nscreens/home.html\nscreens/home.css\nscreens/home.controller.ts\nhhp.json\n```\n\nKeep the generated document metadata and controller/stylesheet links:\n\n```html\n<!doctype html>\n<html><head>\n <meta name=\"himalaya-profile\" content=\"hhp/2\">\n <title>Your profile</title>\n <link rel=\"stylesheet\" href=\"./home.css\">\n <script type=\"application/himalaya-controller\" src=\"./home.controller.ts\"></script>\n</head><body>\n <main>\n <h1>Your profile</h1>\n <input id=\"name\" bind:value=\"name\" placeholder=\"Your name\">\n <button id=\"save\" on:click=\"save\">Save</button>\n <p>{{status}}</p>\n </main>\n</body></html>\n```\n\nThe controller must declare name/status in initialState and save in handlers.\nNormal build registers screens and generates their native descriptors and workers.\nNever edit generated `dev/hhp/` or `tier5-src/hhp-*/` output.\n\n## Semantic mapping\n\nThe generated component reference lists the compiler's exact semantic mapping.\nOrdinary headings/paragraphs become Text; buttons and links become Button;\ninputs/textarea become TextField (checkbox/range select their native input type);\nmain/div become stacks; article becomes Card; section becomes Section; lists become\nLazyList. These elements accept the native fields listed for the resulting component.\nWrap container text in p/span. Nested HTML text styling and browser form behavior\nare not implicit native features.\n\nUse `<himi-component-name>` for advanced components. Kebab-case attributes map to\nnative fields; scalar values use attributes and structured values use JSON:\n\n```html\n<himi-button on:click=\"save\">\n <script type=\"application/himalaya-props\">{\"title\":\"Save\"}</script>\n</himi-button>\n```\n\nDo not supply the same field twice through an attribute, text and JSON. Required\nfields, slots and action names are in references/components.md and the app profile.\n`data-component=\"Button\"` remains available when annotating ordinary elements.\n\n## State and events\n\n| Syntax | Meaning |\n| --- | --- |\n| `bind:value=\"user.name\"` | Typed two-way scalar update; nested path must exist in initialState |\n| `{{status}}` | Text interpolation of a state path |\n| `bind:content=\"status\"` on Text/p | One-way native text binding |\n| `bind:hidden=\"hidden\"` | Boolean visibility: true hides the component |\n| `on:click=\"save\"` | Handler on the ordinary button/click action |\n| `on:change=\"changed\"` | Custom change reducer; do not also use a two-way binding on that control |\n| `on:submit=\"save\"` on form | Native Form submission |\n| `on:on-dismiss=\"dismiss\"` | Explicit native action property, in kebab case |\n\nNative events expose each component's declared payload fields. Input handlers can\nread event.value; selection payloads are normalized to value while retaining their\noriginal fields. Narrow unknown fields in TypeScript before using them.\nInterpolation accepts paths, not JavaScript expressions. Compute derived values in\nhandlers. Only fields with a documented binding mechanism accept `bind:*`.\n\n## Keyed collections\n\n```html\n<himi-grid each=\"items\" key=\"id\" class=\"cards\">\n <article>\n <himi-text bind:content=\"$item.title\"></himi-text>\n <p>{{$item.subtitle}}</p>\n </article>\n</himi-grid>\n```\n\nitems must be an array in initialState; each item needs a stable unique string id.\nUse exactly one row template. `$item.*` bindings are only valid inside that template.\n\nWith `defineController`, Text supports both single paths (`{{status}}`) and mixed\nstrings (`Hello {{name}}`), including keyed rows (`{{name}} chose {{$item.title}}`).\nThe compiler uses native text bindings and computes mixed strings in the worker.\nWith advanced direct `defineService` authoring, compute complete strings in service\nstate and bind them on native surfaces. Raw Text template props are web-only;\nnative profiles reject unsupported templates with `HHP-TEXT-TEMPLATE-SURFACE`.\nTo handle selection, put a declared action and row arguments on the row:\n\n```html\n<article data-mod-on-tap='{\"actionId\":\"tier5.hhp_home.select\",\"args\":{\"id\":\"$item.id\"}}'>\n <himi-text bind:content=\"$item.title\"></himi-text>\n</article>\n```\n\nThis example assumes screen home's default service hhp_home and handler select.\nUse the service name in the generated manifest if the screen sets a custom name.\n\n## Slots and navigation\n\n```html\n<himi-split-view>\n <main slot=\"primary\"><p>Catalog</p></main>\n <main slot=\"detail\"><p>Selected item</p></main>\n</himi-split-view>\n<a href=\"#details\">Open details</a>\n```\n\nRegister details as another HHP screen. App navigation/tabs remain app configuration.\nSplitView follows native platform behavior; make completion/selection useful in the\ncompact primary pane too. External HTTPS links require open_url. Do not use browser\nrouting, DOM listeners or inline browser scripts.\n",
3
+ "references/css-and-responsive-layout.md": "# CSS and responsive layout\n\nRead this while styling a screen. Use the app's tokens and the generated profile's\nCSS mappings. Unsupported declarations are diagnostics, not silently ignored CSS.\n\n```css\n.screen { display:flex; flex-direction:column; gap:16px; padding:24px;\n width:100%; max-width:1100px; background:var(--colors-surfacePrimary) }\n.cards { display:grid; grid-template-columns:repeat(1, 1fr); gap:12px }\n@container (min-width:600px) { .cards { grid-template-columns:repeat(2, 1fr) } }\n@container (min-width:840px) { .cards { grid-template-columns:repeat(3, 1fr) } }\n```\n\nThese are grid container widths, not window widths. A grid in a narrow SplitView\nprimary pane stays narrow even in a wide browser. Check a full-width gallery too.\nOther breakpoint rules or responsive overrides fail in this release.\n\n## Supported subset\n\n| CSS | Native result |\n| --- | --- |\n| flex, row/column, gap, supported alignment | HStack/VStack props |\n| grid with equal-width repeat(N, 1fr) | Grid columns |\n| padding, fixed px width/height, width:100%, max-width, flex-grow | Sizing/spacing modifiers |\n| token color/background, font and shadow | App tokens |\n| radius, border, opacity, aspect-ratio | Visual modifiers |\n| supported translate/scale/rotate, z-index, blur | Native transform modifiers |\n| visibility:hidden, position:sticky | Visibility/sticky modifiers |\n\nUse `var(--colors-TOKEN)`, `var(--typography-TOKEN)` and `var(--shadows-TOKEN)`\nwith token names actually present in the app. CSS px values are native logical\npoints/dp. Check exact accepted values with lint; ordinary browser CSS is broader.\nLinked local stylesheets, inline styles and static tag/class/id compound selectors\nhave deterministic specificity and source order. Dynamic/pseudo selectors,\narbitrary media queries, flex wrapping, arbitrary positioning and general percentage\nsizing are outside this subset.\n\nNative accessibility, gestures, RTL, materials/gradients, measurement, transitions,\npress feedback, motion and haptics use explicit `data-mod-*` attributes. Consult\nreferences/modifiers.md and the app profile rather than inventing CSS equivalents.\nFor example `data-mod-accessibility-label=\"Save profile\"` labels a native element.\n\nUse the compact, medium and expanded studio presets. Native shells also provide\ntheir own responsive navigation behavior; choose that behavior in app configuration.\n",
4
+ "references/controllers-and-sdk.md": "# Controllers and SDKs\n\nRead this before writing stateful behavior or using a capability. Controllers are\ncompiled to existing defineService state/actions; they do not install a new runtime.\n\n```ts\nimport { defineController } from \"@wix/himalaya/hhp\";\nexport default defineController({\n initialState: { name: \"\", status: \"\", hidden: false },\n handlers: {\n save(state) {\n return { ...state, status: state.name.trim() ? `Saved ${state.name}` : \"Enter your name\" };\n },\n changed(state, event) {\n return { ...state, name: typeof event.value === \"string\" ? event.value : state.name };\n }\n }\n});\n```\n\ninitialState is a JSON literal object. Arrays can have TypeScript assertions for\ntheir item type. Use nested objects for nested paths, not undefined values, Date,\nclass instances, spreads, function calls or computed initial keys. Handlers receive\ntyped state and a normalized event and return new state, synchronously or\nasynchronously; undefined preserves state. Update immutably.\n\nLocal TypeScript helpers and static worker-safe SDK imports are supported. Both\n`@himalaya/NAME` and `@wix/himalaya/NAME` work. Inspect the current app profile and\n`dev/hhp/SDK.md` for supported exports, grants, surface registrars and native\nprerequisites. SDK declarations supplied by the installed CLI provide method types.\n\n## Capabilities\n\n```ts\nimport { pick } from \"@wix/himalaya/photos\";\n// Inside handlers; initialState must include photoStatus.\nasync function choosePhoto(state: { photoStatus: string }) {\n try {\n const files = await pick({ limit: 1, type: \"images\" });\n return { ...state, photoStatus: files.length ? \"Photo selected\" : \"Selection cancelled\" };\n } catch (error) {\n return { ...state, photoStatus: error instanceof Error ? error.message : \"Photo selection failed\" };\n }\n}\n```\n\nDeclare photos explicitly in app configuration before using this example. Import\navailability, app grants, native permissions, shell modules and live host support\nare separate facts. The compiler suggests missing grants and honors canonical\nimplications; it never grants permissions. The generated manifest includes runtime\nrequirements from controllers, helper modules and descriptor actions. Type-only\nimports are erased and require no device grant.\n\nRaw fetch, DOM/browser globals and mutation, timers, dynamic imports and server-only\nexports are unavailable. Use typed SDK calls, normalized events and state changes.\nUse standard validation for local database schemas and native module/extension setup.\nAuthentication and checkout use existing worker-safe flows; never embed secrets.\n\n## Streaming and Wix\n\nThe Wix example demonstrates Data queries, signIn, withStream and stream event/error\nreducers. It declares the app-owned `himi_hhp_wix_updates` collection with three\npublic qualification rows. Configure `WIX_CLIENT_ID`, `WIX_SITE_URL` and the\nclient's registered `WIX_REDIRECT_URI`, then use `himi cms create` and `himi cms seed`\nagainst your selected test site. Set `screens/stream-settings.ts` to your HTTPS\nServer-Sent Events endpoint. The controller and `navigation.streamPolicy` use that\nsame URL; the host accepts only its origin, path boundary and GET method. Leave\nthe URL empty until configured: Subscribe reports the missing setup without\nsending a request. Set `authorize: true` only for an endpoint supported by the\nexisting Wix authorization transport. Endpoint setup does not grant capabilities\nor authenticate the user. Local loopback fixtures require development policy;\nproduction endpoints must use HTTPS.\nDo not claim live sign-in\nor data access based on canned fixtures. Read the installed Himalaya SDK references\nand the generated app SDK guide for the specific exported client and method types.\n\nDirect defineService remains available via application/himalaya-service for advanced\nworkers. Use one literal service definition, preserve the existing state/action\ncontract, and verify generated screen bindings against the actual service name.\n",
5
+ "references/preview-and-validation.md": "# Preview and validation\n\nRead this before handing the app back. Work inside the content package; repository\napps can use `--app <name>` instead of `--content .`.\n\n```sh\nhimi hhp profile --content . --json\nhimi hhp lint --content . --json\nhimi build --content .\nhimi validate --strict --content .\nhimi test --content . --json\nhimi run --watch --content .\n```\n\nLint reports file/line/column and stable diagnostic codes with fixes. Rebuild after\nchanging HTML, CSS, controllers, local helpers, assets or tokens. A failed compile\npreserves the last working output; resolve the error and check recovery. If you\nchange initialState's shape while preview preserves state, reload the app to test\nits fresh initial state too. `himi studio --content .` opens the build board and its\ncompact/medium/expanded presets.\n\nThe preview runs compiled native descriptors and actual T5 workers. Exercise typed\ninputs, error and loaded states, keyed row selection, navigation, async results,\nsheet dismissal and controller state through the existing developer inspection.\nAdd stateful journeys to himi-test.json when a result needs multiple actions; the\nform example includes a typed-input submission journey. A crawl is not a complete\nvisual, accessibility or live API test.\n\n## Discover the actual action IDs for a journey\n\nCompile/build first, then inspect `dev/hhp/<screen>.descriptor.json`. An input's\ngenerated onChange action contains its exact `tier5.<service>.__hhpSetN` ID. The\nnumber depends on binding order; do not guess it or treat it as an authored public\nhandler name. Give inputs stable HTML ids and use those ids as journey component\nselectors. Recheck journey action IDs after adding/reordering bound controls.\nThe manifest gives the service name; ordinary controller handler names are stable.\n\nFor example, after confirming the input's generated action and component ID:\n\n```json\n{\"journeys\":[{\"name\":\"save a name\",\"screen\":\"home\",\"steps\":[\n {\"action\":\"tier5.hhp_home.__hhpSet0\",\"component\":\"name\",\"params\":{\"value\":\"Ada\"}},\n {\"action\":\"tier5.hhp_home.save\",\"component\":\"save\"}\n],\"expectText\":[\"Saved Ada\"]}]}\n```\n\nUse the completion text actually visible on that screen. A journey is screen-local;\ncross-screen navigation is checked by the crawl's navigation pass and UI testing.\n\n## Deterministic device fixtures\n\nFor a device-only preview call, create `.himi/hhp-preview.json`:\n\n```json\n{\"mockCapabilities\":[\"photos\"],\"fixtures\":{\n \"capability.photos.pick\":{\"outcome\":\"cancelled\",\"result\":{\"items\":[]}}\n}}\n```\n\nFixture outcomes are success, cancelled, denied and error. Supply the SDK's native\nbridge result shape for success or a cancellation result; photos.pick uses items.\nCancellation without result rejects. Missing configured fixtures fail explicitly;\nthey never count as successful calls. Preview telemetry shows calls and outcomes.\nThese local preview fixtures stay outside production packages. Network calls use\nthe existing network fixture transport.\n\n## Native and packaging\n\nUse the existing Himi shell/build workflow to run the same descriptors and workers\non iOS, Android and enabled macOS. Exercise actual native controls and permissions.\nCheck responsive container widths below/at/above 600px and 840px. Optional modules\nand host features need the appropriate shell. Native decoder tests confirm payload\ncompatibility; they do not establish visual or interaction parity.\n\nPackage a content app after validation with `himi pack --content . --out ./app.himi`.\nUse `--snapshot` for a frozen offline qualification artifact. Player deliberately\ndenies native capabilities and Wix transport for imported packages: this mode can\nprove rendering, bindings, actions and navigation, and can exercise a capability's\ndenial handler. Use a trusted app shell with its declared grants and prerequisites\nto verify the actual photo picker, live Wix authentication and native streaming.\nFor an existing release directory use its normal Himi packaging workflow. Production packages\nmust not contain preview mocks. Report which surfaces and real APIs were actually\nverified and any blockers. An unavailable native test environment or unconfigured\nWix tenant is missing proof, not a pass.\n",
6
+ "examples/catalog/hhp.json": "{\n \"version\": \"hhp/2\",\n \"screens\": {\n \"home\": {\n \"html\": \"screens/home.html\"\n },\n \"gallery\": {\n \"html\": \"screens/gallery.html\"\n }\n }\n}\n",
7
+ "examples/catalog/config.ts": "import { defineApp } from \"@wix/himalaya/core\";\nimport { ConsoleTelemetrySink } from \"@wix/himalaya/telemetry-console\";\n\nexport default defineApp({\n id: \"com.example.hhpcatalog\",\n name: \"hhp-catalog\",\n bundleId: \"com.example.hhpcatalog\",\n applicationId: \"com.example.hhpcatalog\",\n // Schema identifiers for native shell generation. Keep the scaffold values\n // when authoring a portable content package.\n schemaPackage: \"@example/hhpcatalog-schema\",\n schemaPackageRange: { min: 9900, max: 9909 },\n // Local preview ports. Preserve the scaffold values in a content package.\n ports: { devServer: 8190, web: 5390 },\n auth: { providerId: \"none\", config: {} },\n // Wix-site alternative (visitor scope):\n // auth: WixConsumerAuthProvider({ clientId: \"<headless-client-id>\",\n // siteUrl: \"https://<site>.wixsite.com/<slug>\",\n // redirectUri: \"himalayahhpcatalog://oauth/callback\", bootAsVisitor: true }),\n telemetry: ConsoleTelemetrySink(),\n serverUrls: {\n screen: \"http://localhost:8190/v1\",\n actions: \"http://localhost:8190/v1/actions\",\n sync: \"http://localhost:8190/v1/sync\",\n },\n // agent: optional on-device / remote LLM wiring for AI features. Leave as-is if unused.\n agent: {\n onDevice: { ios: \"foundation_models\", android: \"mediapipe\" },\n remote: { providerId: \"anthropic\", config: {} },\n privateModeToggle: false,\n },\n capabilities: [],\n navigation: {\n scheme: \"himalayahhpcatalog\",\n navKind: \"responsive\",\n tabBar: { items: [\n { id: \"explore\", label: \"Explore\", icon: \"house\", screenId: \"home\" },\n { id: \"catalog\", label: \"Catalog\", icon: \"square.grid.2x2\", screenId: \"gallery\" },\n ] },\n },\n designTokensPath: \"./tokens.json\",\n entities: {},\n});\n",
8
+ "examples/catalog/platforms.json": "{\"web\": true, \"macos\": true}",
9
+ "examples/catalog/tokens.json": "{\"colors\":{\"surfacePrimary\":{\"light\":\"#ffffff\",\"dark\":\"#0d1117\"},\"surfaceSecondary\":{\"light\":\"#f6f8fa\",\"dark\":\"#161b22\"},\"surfaceTertiary\":{\"light\":\"#eef1f4\",\"dark\":\"#1c2128\"},\"textPrimary\":{\"light\":\"#1f2328\",\"dark\":\"#e6edf3\"},\"textSecondary\":{\"light\":\"#57606a\",\"dark\":\"#9198a1\"},\"textOnAccent\":{\"light\":\"#ffffff\",\"dark\":\"#0d1117\"},\"accentPrimary\":{\"light\":\"#0969da\",\"dark\":\"#388bfd\"},\"border\":{\"light\":\"#d0d7de\",\"dark\":\"#30363d\"},\"danger\":{\"light\":\"#cf222e\",\"dark\":\"#f85149\"},\"success\":{\"light\":\"#1a7f37\",\"dark\":\"#3fb950\"},\"warning\":{\"light\":\"#9a6700\",\"dark\":\"#d29922\"}},\"spacing\":{\"xs\":4,\"sm\":8,\"md\":12,\"lg\":16,\"xl\":24},\"typography\":{\"title1\":{\"size\":28,\"weight\":700,\"line\":1.2},\"body\":{\"size\":16,\"weight\":400,\"line\":1.5},\"caption\":{\"size\":13,\"weight\":400,\"line\":1.4}},\"radius\":{\"sm\":4,\"md\":8,\"lg\":12}}\n",
10
+ "examples/catalog/himalaya.content.json": "{\"name\": \"hhp-catalog\", \"target\": \"prod\"}",
11
+ "examples/catalog/screens/home.html": "<!doctype html>\n<html><head><meta name=\"himalaya-profile\" content=\"hhp/2\"><title>Responsive catalog</title><link rel=\"stylesheet\" href=\"./home.css\"><script type=\"application/himalaya-controller\" src=\"./home.controller.ts\"></script></head>\n<body><himi-split-view><main slot=\"primary\" class=\"screen\"><h1>Explore</h1><input bind:value=\"query\" placeholder=\"Search the catalog\"><button on:click=\"search\">Search</button><himi-grid class=\"catalog\" each=\"items\" key=\"id\"><article data-mod-on-tap=\"{&quot;actionId&quot;:&quot;tier5.hhp_home.select&quot;,&quot;args&quot;:{&quot;title&quot;:&quot;$item.title&quot;,&quot;subtitle&quot;:&quot;$item.subtitle&quot;}}\"><himi-text bind:content=\"$item.title\"></himi-text><p>{{$item.subtitle}}</p></article></himi-grid><h3>Selected place</h3><p bind:content=\"selectedTitle\"></p><p bind:content=\"selectedSubtitle\"></p><a href=\"#gallery\">View full catalog</a></main><main slot=\"detail\" class=\"screen\"><h2>{{selectedTitle}}</h2><p>{{selectedSubtitle}}</p></main></himi-split-view></body></html>\n",
12
+ "examples/catalog/screens/home.css": ".screen { display:flex;flex-direction:column;gap:16px;padding:24px;width:100%;max-width:1100px }\n.catalog { display:grid;grid-template-columns:repeat(1, 1fr);gap:12px }\n@container (min-width:600px) { .catalog { grid-template-columns:repeat(2, 1fr) } }\n@container (min-width:840px) { .catalog { grid-template-columns:repeat(3, 1fr) } }\n",
13
+ "examples/catalog/screens/home.controller.ts": "import { defineController } from \"@himalaya/hhp\";\nconst catalog = [\n { id: \"coffee\", title: \"Coffee\", subtitle: \"A welcoming place\" },\n { id: \"studio\", title: \"Studio\", subtitle: \"Make something together\" },\n { id: \"garden\", title: \"Garden\", subtitle: \"Room to breathe\" },\n];\nexport default defineController({\n initialState: { query: \"\", selectedTitle: \"Choose a place\", selectedSubtitle: \"Select a catalog card to see its details.\", items: [\n { id: \"coffee\", title: \"Coffee\", subtitle: \"A welcoming place\" },\n { id: \"studio\", title: \"Studio\", subtitle: \"Make something together\" },\n { id: \"garden\", title: \"Garden\", subtitle: \"Room to breathe\" },\n ] },\n handlers: {\n search(state) { return { ...state, items: catalog.filter((item) => item.title.toLowerCase().includes(state.query.toLowerCase())) }; },\n select(state, event) { return { ...state, selectedTitle: String(event.title ?? \"Place\"), selectedSubtitle: String(event.subtitle ?? \"\") }; },\n },\n});\n",
14
+ "examples/catalog/screens/gallery.html": "<!doctype html>\n<html><head><meta name=\"himalaya-profile\" content=\"hhp/2\"><title>Full catalog</title><link rel=\"stylesheet\" href=\"./home.css\"><script type=\"application/himalaya-controller\" src=\"./home.controller.ts\"></script></head>\n<body><main class=\"screen\"><h1>Full catalog</h1><a href=\"#home\">Back to explore</a><himi-grid class=\"catalog\" each=\"items\" key=\"id\"><article><p>{{$item.title}}</p><p>{{$item.subtitle}}</p></article></himi-grid></main></body></html>\n",
15
+ "examples/catalog/himi-test.json": "{\n \"journeys\": [{\n \"name\": \"search and select a keyed catalog item\",\n \"screen\": \"home\",\n \"steps\": [\n { \"action\": \"tier5.hhp_home.__hhpSet0\", \"params\": { \"value\": \"Studio\" } },\n { \"action\": \"tier5.hhp_home.search\" },\n { \"action\": \"tier5.hhp_home.select\", \"params\": { \"title\": \"Studio\", \"subtitle\": \"Make something together\" } }\n ],\n \"expectText\": [\"Studio\", \"Make something together\"]\n }]\n}\n",
16
+ "examples/forms/hhp.json": "{\"version\": \"hhp/2\", \"screens\": {\"home\": {\"html\": \"screens/home.html\"}}}",
17
+ "examples/forms/config.ts": "import { defineApp } from \"@wix/himalaya/core\";\nimport { ConsoleTelemetrySink } from \"@wix/himalaya/telemetry-console\";\n\nexport default defineApp({\n id: \"com.example.hhpforms\",\n name: \"hhp-forms\",\n bundleId: \"com.example.hhpforms\",\n applicationId: \"com.example.hhpforms\",\n // Schema identifiers for native shell generation. Keep the scaffold values\n // when authoring a portable content package.\n schemaPackage: \"@example/hhpforms-schema\",\n schemaPackageRange: { min: 9900, max: 9909 },\n // Local preview ports. Preserve the scaffold values in a content package.\n ports: { devServer: 8190, web: 5390 },\n auth: { providerId: \"none\", config: {} },\n // Wix-site alternative (visitor scope):\n // auth: WixConsumerAuthProvider({ clientId: \"<headless-client-id>\",\n // siteUrl: \"https://<site>.wixsite.com/<slug>\",\n // redirectUri: \"himalayahhpforms://oauth/callback\", bootAsVisitor: true }),\n telemetry: ConsoleTelemetrySink(),\n serverUrls: {\n screen: \"http://localhost:8190/v1\",\n actions: \"http://localhost:8190/v1/actions\",\n sync: \"http://localhost:8190/v1/sync\",\n },\n // agent: optional on-device / remote LLM wiring for AI features. Leave as-is if unused.\n agent: {\n onDevice: { ios: \"foundation_models\", android: \"mediapipe\" },\n remote: { providerId: \"anthropic\", config: {} },\n privateModeToggle: false,\n },\n capabilities: [\"photos\"],\n designTokensPath: \"./tokens.json\",\n entities: {},\n});\n",
18
+ "examples/forms/platforms.json": "{\"web\": true, \"macos\": true}",
19
+ "examples/forms/tokens.json": "{\"colors\":{\"surfacePrimary\":{\"light\":\"#ffffff\",\"dark\":\"#0d1117\"},\"surfaceSecondary\":{\"light\":\"#f6f8fa\",\"dark\":\"#161b22\"},\"surfaceTertiary\":{\"light\":\"#eef1f4\",\"dark\":\"#1c2128\"},\"textPrimary\":{\"light\":\"#1f2328\",\"dark\":\"#e6edf3\"},\"textSecondary\":{\"light\":\"#57606a\",\"dark\":\"#9198a1\"},\"textOnAccent\":{\"light\":\"#ffffff\",\"dark\":\"#0d1117\"},\"accentPrimary\":{\"light\":\"#0969da\",\"dark\":\"#388bfd\"},\"border\":{\"light\":\"#d0d7de\",\"dark\":\"#30363d\"},\"danger\":{\"light\":\"#cf222e\",\"dark\":\"#f85149\"},\"success\":{\"light\":\"#1a7f37\",\"dark\":\"#3fb950\"},\"warning\":{\"light\":\"#9a6700\",\"dark\":\"#d29922\"}},\"spacing\":{\"xs\":4,\"sm\":8,\"md\":12,\"lg\":16,\"xl\":24},\"typography\":{\"title1\":{\"size\":28,\"weight\":700,\"line\":1.2},\"body\":{\"size\":16,\"weight\":400,\"line\":1.5},\"caption\":{\"size\":13,\"weight\":400,\"line\":1.4}},\"radius\":{\"sm\":4,\"md\":8,\"lg\":12}}\n",
20
+ "examples/forms/himalaya.content.json": "{\"name\": \"hhp-forms\", \"target\": \"prod\"}",
21
+ "examples/forms/screens/home.html": "<!doctype html>\n<html><head><meta name=\"himalaya-profile\" content=\"hhp/2\"><title>Your profile</title><link rel=\"stylesheet\" href=\"./home.css\"><script type=\"application/himalaya-controller\" src=\"./home.controller.ts\"></script></head>\n<body><main class=\"screen\"><h1>Your profile</h1><form on:submit=\"save\"><input id=\"name\" bind:value=\"name\" placeholder=\"Your name\"><input id=\"email\" type=\"email\" bind:value=\"email\" placeholder=\"Email\"><himi-field-error bind:text=\"error\"></himi-field-error><button id=\"save\" type=\"submit\">Save profile</button></form><button on:click=\"choosePhoto\">Choose a photo</button><p>{{photoStatus}}</p><himi-bottom-sheet bind:presented=\"presented\" on:dismiss=\"dismiss\"><main slot=\"content\" class=\"screen\"><h2>Profile saved</h2><p>{{name}}</p><button id=\"dismiss\" on:click=\"dismiss\">Done</button></main></himi-bottom-sheet></main></body></html>\n",
22
+ "examples/forms/screens/home.css": ".screen { display:flex;flex-direction:column;gap:16px;padding:24px;width:100%;max-width:720px }\n",
23
+ "examples/forms/screens/home.controller.ts": "import { defineController } from \"@himalaya/hhp\";\nimport { pick } from \"@himalaya/photos\";\nexport default defineController({\n initialState: { name: \"\", email: \"\", error: \"\", presented: false, photoStatus: \"No photo chosen\" },\n handlers: {\n save(state) { return !state.name.trim() || !state.email.includes(\"@\") ? { ...state, error: \"Enter your name and a valid email.\" } : { ...state, error: \"\", presented: true }; },\n dismiss(state) { return { ...state, presented: false }; },\n async choosePhoto(state) {\n try { const files = await pick({ limit: 1, type: \"images\" }); return { ...state, photoStatus: files.length ? \"Photo selected\" : \"Selection cancelled\" }; }\n catch (error) { return { ...state, photoStatus: error instanceof Error ? error.message : \"Photo selection failed\" }; }\n },\n },\n});\n",
24
+ "examples/forms/himi-test.json": "{\n \"journeys\": [{\n \"name\": \"type and save a valid profile\",\n \"screen\": \"home\",\n \"steps\": [\n { \"action\": \"tier5.hhp_home.__hhpSet0\", \"component\": \"name\", \"params\": { \"value\": \"Ada\" } },\n { \"action\": \"tier5.hhp_home.__hhpSet1\", \"component\": \"email\", \"params\": { \"value\": \"ada@example.com\" } },\n { \"action\": \"tier5.hhp_home.save\", \"component\": \"save\" }\n ],\n \"expectText\": [\"Profile saved\", \"Ada\"]\n }]\n}\n",
25
+ "examples/wix/hhp.json": "{\"version\": \"hhp/2\", \"screens\": {\"home\": {\"html\": \"screens/home.html\"}}}",
26
+ "examples/wix/config.ts": "import { defineApp } from \"@wix/himalaya/core\";\nimport { WixConsumerAuthProvider } from \"@wix/himalaya/wix-auth\";\nimport { ConsoleTelemetrySink } from \"@wix/himalaya/telemetry-console\";\nimport { updatesStream } from \"./screens/stream-settings.js\";\n\n// Pair the client with a redirect registered on that client's Wix site.\n\nexport default defineApp({\n id: \"com.example.hhpwix\",\n name: \"hhp-wix\",\n bundleId: \"com.example.hhpwix\",\n applicationId: \"com.example.hhpwix\",\n // Schema identifiers for native shell generation. Keep the scaffold values\n // when authoring a portable content package.\n schemaPackage: \"@example/hhpwix-schema\",\n schemaPackageRange: { min: 9900, max: 9909 },\n // Local preview ports. Preserve the scaffold values in a content package.\n ports: { devServer: 8190, web: 5390 },\n auth: WixConsumerAuthProvider({\n clientId: process.env.WIX_CLIENT_ID ?? \"configure-a-headless-client-before-live-testing\",\n siteUrl: process.env.WIX_SITE_URL ?? \"https://example.wixsite.com/hhp\",\n redirectUri: process.env.WIX_REDIRECT_URI ?? \"himalayahhpwix://oauth/callback\",\n bootAsVisitor: true,\n }),\n // Wix-site alternative (visitor scope):\n // auth: WixConsumerAuthProvider({ clientId: \"<headless-client-id>\",\n // siteUrl: \"https://<site>.wixsite.com/<slug>\",\n // redirectUri: \"himalayahhpwix://oauth/callback\", bootAsVisitor: true }),\n telemetry: ConsoleTelemetrySink(),\n serverUrls: {\n screen: \"http://localhost:8190/v1\",\n actions: \"http://localhost:8190/v1/actions\",\n sync: \"http://localhost:8190/v1/sync\",\n },\n // agent: optional on-device / remote LLM wiring for AI features. Leave as-is if unused.\n agent: {\n onDevice: { ios: \"foundation_models\", android: \"mediapipe\" },\n remote: { providerId: \"anthropic\", config: {} },\n privateModeToggle: false,\n },\n capabilities: [\"wix_api\", \"stream\"],\n navigation: {\n scheme: \"himalayahhpwix\",\n deepLinkPatterns: [],\n linkableScreens: [{ screenId: \"home\", isPublic: true, paramKeys: [] }],\n streamPolicy: {\n version: 1,\n endpoints: updatesStream.url ? [{\n origin: new URL(updatesStream.url).origin,\n pathPrefix: new URL(updatesStream.url).pathname,\n methods: [\"GET\"],\n headerNames: [],\n }] : [],\n },\n },\n cms: {\n collections: [{\n id: \"himi_hhp_wix_updates\",\n displayName: \"HHP qualification updates\",\n displayField: \"title\",\n readRole: \"ANYONE\",\n writeRole: \"ADMIN\",\n fields: [{ key: \"title\", displayName: \"Title\", type: \"TEXT\" }],\n seed: [\n { title: \"HTML screens now run as native descriptors\" },\n { title: \"Controller actions share the T5 worker runtime\" },\n { title: \"Responsive catalog and validated forms are ready to explore\" },\n ],\n }],\n },\n designTokensPath: \"./tokens.json\",\n entities: {},\n});\n",
27
+ "examples/wix/platforms.json": "{\"web\": true, \"macos\": true}",
28
+ "examples/wix/tokens.json": "{\"colors\":{\"surfacePrimary\":{\"light\":\"#ffffff\",\"dark\":\"#0d1117\"},\"surfaceSecondary\":{\"light\":\"#f6f8fa\",\"dark\":\"#161b22\"},\"surfaceTertiary\":{\"light\":\"#eef1f4\",\"dark\":\"#1c2128\"},\"textPrimary\":{\"light\":\"#1f2328\",\"dark\":\"#e6edf3\"},\"textSecondary\":{\"light\":\"#57606a\",\"dark\":\"#9198a1\"},\"textOnAccent\":{\"light\":\"#ffffff\",\"dark\":\"#0d1117\"},\"accentPrimary\":{\"light\":\"#0969da\",\"dark\":\"#388bfd\"},\"border\":{\"light\":\"#d0d7de\",\"dark\":\"#30363d\"},\"danger\":{\"light\":\"#cf222e\",\"dark\":\"#f85149\"},\"success\":{\"light\":\"#1a7f37\",\"dark\":\"#3fb950\"},\"warning\":{\"light\":\"#9a6700\",\"dark\":\"#d29922\"}},\"spacing\":{\"xs\":4,\"sm\":8,\"md\":12,\"lg\":16,\"xl\":24},\"typography\":{\"title1\":{\"size\":28,\"weight\":700,\"line\":1.2},\"body\":{\"size\":16,\"weight\":400,\"line\":1.5},\"caption\":{\"size\":13,\"weight\":400,\"line\":1.4}},\"radius\":{\"sm\":4,\"md\":8,\"lg\":12}}\n",
29
+ "examples/wix/himalaya.content.json": "{\"name\": \"hhp-wix\", \"target\": \"prod\"}",
30
+ "examples/wix/screens/home.html": "<!doctype html>\n<html><head><meta name=\"himalaya-profile\" content=\"hhp/2\"><title>Member updates</title><link rel=\"stylesheet\" href=\"./home.css\"><script type=\"application/himalaya-controller\" src=\"./home.controller.ts\"></script></head>\n<body><main class=\"screen\"><h1>Member updates</h1><button on:click=\"login\">Sign in</button><button on:click=\"load\">Load Wix collection</button><button on:click=\"subscribe\">Subscribe to updates</button><p>{{status}}</p><himi-lazy-list each=\"items\" key=\"id\"><p>{{$item.title}}</p></himi-lazy-list><a href=\"#home\">Back to home</a></main></body></html>\n",
31
+ "examples/wix/screens/home.css": ".screen { display:flex;flex-direction:column;gap:16px;padding:24px;width:100%;max-width:720px }\n",
32
+ "examples/wix/screens/home.controller.ts": "import { defineController } from \"@himalaya/hhp\";\nimport { queryDataItems } from \"@himalaya/wix-data\";\nimport { signIn } from \"@himalaya/auth\";\nimport { withStream, type StreamEvent } from \"@himalaya/state\";\nimport { updatesStream } from \"./stream-settings.js\";\nexport default defineController({\n initialState: { status: \"Choose an action to connect\", items: [] as { id: string; title: string }[] },\n handlers: {\n async login(state) { const result = await signIn(); return { ...state, status: result.ok ? \"Signed in\" : result.reason }; },\n async load(state) {\n try {\n const result = await queryDataItems(\"himi_hhp_wix_updates\", 20);\n return { ...state, status: \"Loaded\", items: (result.dataItems ?? []).map((item) => ({ id: String(item.id), title: String(item.data?.title ?? \"Update\") })) };\n } catch (error) { return { ...state, status: error instanceof Error ? error.message : \"Loading failed\" }; }\n },\n subscribe(state) {\n if (!updatesStream.url) return { ...state, status: \"Configure screens/stream-settings.ts with your HTTPS SSE endpoint\" };\n return withStream({ ...state, status: \"Connecting\" }, { id: \"updates\", request: { method: \"GET\", url: updatesStream.url, authorize: updatesStream.authorize }, onEvent: \"received\", onDone: \"done\", onError: \"failed\" });\n },\n received(state, event) { const update = event as unknown as StreamEvent; return { ...state, status: String(update.data?.message ?? \"Update received\") }; },\n done(state) { return { ...state, status: \"Stream complete\" }; },\n failed(state) { return { ...state, status: \"Stream failed\" }; },\n },\n});\n",
33
+ "examples/wix/screens/stream-settings.ts": "// Set this to your HTTPS SSE endpoint. Config and controller share one URL.\n// Leave it empty until an endpoint is available; no placeholder request is sent.\nexport const updatesStream = { url: \"\", authorize: false };\n",
34
+ "examples/wix/himi-test.json": "{\n \"journeys\": [{\n \"name\": \"unconfigured streaming explains the required setup\",\n \"screen\": \"home\",\n \"steps\": [{ \"action\": \"tier5.hhp_home.subscribe\" }],\n \"expectText\": [\"Configure screens/stream-settings.ts with your HTTPS SSE endpoint\"]\n }]\n}\n"
35
+ }
package/guides/hhp.md ADDED
@@ -0,0 +1,184 @@
1
+ # Responsive HTML authoring for Himi
2
+
3
+ HHP v2 compiles a bounded HTML/CSS/TypeScript authoring language into existing SDUI
4
+ descriptors and T5 workers. The preview runs those artifacts through the web host.
5
+ No HTML page or general browser JavaScript runtime is shipped to a native device.
6
+ Existing hhp/1 documents retain their original interpretation.
7
+
8
+ ## Start
9
+
10
+ Inside an existing content package:
11
+
12
+ ```sh
13
+ himi hhp init home --content .
14
+ # consent preflight: authorize or mock Wix/external startup requests; if there are none, continue
15
+ himi run --watch --content .
16
+ ```
17
+
18
+ Choose a new screen id if `home` is already registered. Repo targets accept
19
+ `--app <name>` instead. The scaffold contains `screens/home.html`, `home.css`, and
20
+ `home.controller.ts`. `hhp.json` declares sources:
21
+
22
+ ```json
23
+ {"version":"hhp/2","screens":{"home":{"html":"screens/home.html"}}}
24
+ ```
25
+
26
+ Normal build, validation, watch, and packaging compile this manifest. The compiler
27
+ owns `dev/hhp/` and `tier5-src/hhp-*/`. Edit sources rather than generated files.
28
+ The registry adapter wraps an existing default-exported app object/identifier and
29
+ merges generated exact screens and seed descriptors. Ambiguous exports, duplicate
30
+ screen ids, and authored worker files are refused. Recompilation is repeatable;
31
+ failed lint keeps the last working output. Deleted screens remove their owned worker.
32
+
33
+ ## Controller and bindings
34
+
35
+ ```ts
36
+ import { defineController } from "@wix/himalaya/hhp";
37
+ export default defineController({
38
+ initialState: { name: "", greeting: "" },
39
+ handlers: {
40
+ greet(state) { return { ...state, greeting: `Hello ${state.name}` }; }
41
+ }
42
+ });
43
+ ```
44
+
45
+ ```html
46
+ <input bind:value="name" placeholder="Your name">
47
+ <button on:click="greet">Continue</button>
48
+ <p>{{greeting}}</p>
49
+ ```
50
+
51
+ Initial state must be JSON literals, including arrays with TypeScript assertions.
52
+ Handlers may be async and import worker-safe SDKs or local helper modules. Event
53
+ payloads retain native fields and normalize selection values into `event.value`.
54
+ Nested scalar paths are checked and updated immutably. Two-way value binding owns
55
+ the component's change callback. Explicit `on:change` is used for custom reducers.
56
+ Boolean `bind:hidden` and existing declared property bindings are available.
57
+ Read-only controls such as Gauge and ActivityIndicator accept one-way value
58
+ bindings without generating a change action.
59
+
60
+ Keyed lists use `each="items" key="id"` on a Grid/LazyList and one row template.
61
+ Initial items require unique string ids. Row text uses `{{$item.title}}`. Compute
62
+ expressions in controllers; interpolation accepts paths, not executable expressions.
63
+ Direct `application/himalaya-service` scripts retain `defineService` authoring.
64
+
65
+ ## Native vocabulary
66
+
67
+ ```sh
68
+ himi hhp profile --content . --json
69
+ himi hhp lint --content . --json
70
+ himi hhp compile --content . --dry-run --json
71
+ ```
72
+
73
+ Semantic HTML covers ordinary controls. `himi-*` tags and existing `data-component`
74
+ annotations expose the generated native vocabulary. Kebab-case attributes map to
75
+ props; `slot="primary"` and `slot="detail"` supply SplitView slots. Structured props
76
+ use a child `script type="application/himalaya-props"` containing JSON.
77
+ `on:<native-action-property>` exposes declared events; click/change/submit have
78
+ ordinary-control aliases. Explicit modifiers use `data-mod-*` or `himi-mod-*`.
79
+
80
+ The profile is the intersection of enabled deployment surfaces. It retains field
81
+ eligibility and reports web support independently. Placeholder renderer cases,
82
+ read-only inputs, absent action payloads, and RN adapter-dependent media are excluded
83
+ where the canonical platform contracts identify them. Registration alone does not
84
+ prove that hardware, permissions, or an optional binary module are available.
85
+
86
+ FragmentSlot uses its finite cases/default contract. WorkerSubtree requires the
87
+ screen in `config.workerSubtreeScreens`, one slot, an existing safe-type/action
88
+ allowlist, positive bounded budgets, and a fallback. These are native policies.
89
+
90
+ Editor metadata and an SDK guide are emitted under `dev/hhp/`. VS Code can consume
91
+ `html.custom-data.json` through `html.customData` and `css.custom-data.json` through
92
+ `css.customData`. `himi agent-init` installs the dedicated HHP skill for agents.
93
+ The installed skill routes to local HTML/binding, CSS/responsive, controller/SDK,
94
+ modifier, preview/validation and example references. Its generated component index
95
+ links to one page per native component, with syntax examples, required fields,
96
+ structured schemas, slots, actions, bindings, event payloads and surface eligibility.
97
+ Catalog, forms and Wix screen sources are installed alongside it. They can be adapted
98
+ to an existing scaffold without inspecting compiler source or writing native
99
+ descriptors/worker registration. Example configuration is guidance, not a replacement
100
+ for the app's existing identity, tokens or capability declarations.
101
+
102
+ The portable compiler stores its generated catalog as a deterministic gzip/base64
103
+ envelope with a SHA-256 check. `himi hhp profile --json` returns the complete decoded
104
+ metadata; the installed component guides and support decision source remain readable.
105
+ `gen-v2.ts --check` verifies the envelope against the canonical schemas and SDK exports.
106
+
107
+ ## CSS
108
+
109
+ Supported mappings are returned in the profile. Static tag/class/id compound
110
+ selectors use deterministic specificity and source order. Linked local stylesheets
111
+ and inline styles work. Unsupported properties, selectors, values, and queries fail.
112
+
113
+ | Authoring | Native representation |
114
+ | --- | --- |
115
+ | flex display, row/column, gap, alignment | HStack/VStack |
116
+ | grid, `repeat(N, 1fr)`, gap | Grid |
117
+ | padding, fixed px sizing, fill width, max width, flex grow | Native sizing modifiers |
118
+ | token colors/background/typography/shadow | App token references |
119
+ | radius, border, opacity, aspect ratio | Native visual modifiers |
120
+ | translateX/Y, scale, rotation, stacking, blur | Native transform modifiers |
121
+ | hidden, sticky | Native visibility/sticky modifiers |
122
+
123
+ Use `var(--colors-TOKEN)`, `var(--typography-TOKEN)`, and `var(--shadows-TOKEN)`.
124
+ Native lengths are logical points/dp. Grids accept only
125
+ `@container (min-width:600px)` and `@container (min-width:840px)` column overrides;
126
+ these compile to `columnsMedium` and `columnsExpanded`. Arbitrary media queries,
127
+ flex wrapping, and positioning are errors. Native gestures, accessibility,
128
+ transitions, haptics, and measurement remain explicit native modifiers.
129
+
130
+ Local HTML images resolve relative to their document and must live in the app's
131
+ declared assets directory. They use the existing content-addressed asset channel.
132
+
133
+ ## SDKs and preview fixtures
134
+
135
+ Import names come from the worker build alias catalog, including both `@himalaya/*`
136
+ and `@wix/himalaya/*`. Server/configuration imports are rejected. SDK imports and
137
+ streaming usage suggest missing capability declarations without granting them.
138
+ The generated manifest lists required capability IDs from runtime imports,
139
+ transitive local helper modules, streaming calls, and descriptor actions. Runtime
140
+ imports are conservative requirements; type-only imports are erased and require
141
+ no device grant. Profiles list SDK export names, and unsupported named imports
142
+ produce source diagnostics.
143
+ Standard strict validation checks app grants and native configuration requirements.
144
+
145
+ Live web capability implementations use the existing dispatcher. To substitute a
146
+ device call in watch preview, create `.himi/hhp-preview.json`:
147
+
148
+ ```json
149
+ {"mockCapabilities":["photos"],"fixtures":{
150
+ "capability.photos.pick":{"outcome":"success","result":{"items":[]}}
151
+ }}
152
+ ```
153
+
154
+ Fixture outcomes are `success`, `cancelled`, `denied`, or `error`; an optional message
155
+ describes a rejection. A cancelled fixture with an explicit `result` returns that
156
+ SDK's native cancellation payload: photos.pick uses `{"items":[]}`. Without a
157
+ result, cancellation rejects. Missing fixtures for mocked capabilities throw explicitly.
158
+ Calls and outcomes appear in the existing preview telemetry/dev console. Fixtures
159
+ are served only by watch preview and remain outside production packages. Streaming
160
+ and auth flows retain their existing transports and network-fixture seams.
161
+ The studio preview adds compact, medium, and expanded presets. Existing worker state,
162
+ action, and SDK inspection remain available through the dev drawer.
163
+
164
+ ## Qualification
165
+
166
+ Automated tests cover v1
167
+ compatibility, catalog freshness, generated worker boot and async updates, bindings,
168
+ all catalog fields, static and structured values, slots, events, bindings, rejected
169
+ surface combinations, registry updates, watch exclusions, polling recovery, and
170
+ preview fixture outcomes. Compiled keyed grids are rendered against container widths
171
+ 599/600/601 and 839/840/841 by the existing web renderer.
172
+
173
+ The installed CLI has passed scaffold, lint, build, strict validation, and render
174
+ outside the source repository. Android's actual decoder has accepted the catalog,
175
+ forms, and Wix example descriptors. These checks confirm packaging and descriptor
176
+ compatibility.
177
+
178
+ Native visual/interaction qualification is still required before release. Browser
179
+ forms have been exercised with validation, input updates, sheet presentation, and
180
+ dismissal. Automated rendering and worker tests are not evidence of native visual
181
+ parity. Every catalog field still needs representative renderer qualification,
182
+ especially fields without a platform payload contract.
183
+ The reviewed support inventory requires an explicit decision when platform
184
+ components, fields, modifiers, or worker import exports change.
@@ -32,6 +32,7 @@ package in one greppable file) or `GET /v1/sdk/<name>` over HTTP; in the CLI,
32
32
  - `@himalaya/gpx` — read and write GPX 1.1, and compute track statistics.
33
33
  - `@himalaya/haptic` — Tier-5 typed binding for the platform's haptic capability.
34
34
  - `@himalaya/health` — Tier-5 typed binding for the platform HEALTH store.
35
+ - `@himalaya/hhp` — —
35
36
  - `@himalaya/himi-apps` — Tier-5 typed binding for cross-app open / host queries.
36
37
  - `@himalaya/iap` — Tier-5 typed binding to the platform's in-app-purchase capability.
37
38
  - `@himalaya/keyboard` — Tier-5 typed binding for the platform's keyboard capability.
package/guides/index.json CHANGED
@@ -29,6 +29,12 @@
29
29
  "User-facing copy is CONFIGURATION, never hardcoded in a descriptor: route every string through a copy key with a stock fallback — `copyOf(key, fallback)` — and feed worker-emitted strings in as descriptor params, so any app/template consumer can retheme ALL copy without touching descriptors. Wire the seam yourself: declare a local `const COPY: Record<string,string> = {…}` in your content package plus `export const copyOf = (k, fallback) => COPY[k] ?? fallback;`, keyed `<screen>.<element>` so a later template publish is mechanical. Either way the rule is the same: no user-facing string baked into a descriptor literal."
30
30
  ],
31
31
  "guides": [
32
+ {
33
+ "id": "hhp",
34
+ "title": "Responsive HTML to native Himi",
35
+ "category": "Tier-5 Screens",
36
+ "file": "hhp.md"
37
+ },
32
38
  {
33
39
  "id": "getting-started",
34
40
  "title": "Start here",
@@ -1519,6 +1519,43 @@
1519
1519
  }
1520
1520
  ]
1521
1521
  },
1522
+ {
1523
+ "name": "@himalaya/hhp",
1524
+ "source": "core/sdk/hhp/src/index.ts",
1525
+ "description": "",
1526
+ "api": [
1527
+ {
1528
+ "name": "ControllerEvent",
1529
+ "kind": "type",
1530
+ "jsdoc": "/** Compile-time controller authoring. This module does not install a device runtime. */",
1531
+ "decl": "export type ControllerEvent<T = unknown> = {\n /** Native action properties retain their declared payload fields. Narrow these\n * values in the handler, or use a typed value payload for ordinary inputs. */\n [field: string]: unknown;\n value?: T;\n key?: string;\n args?: Record<string, unknown>;\n};"
1532
+ },
1533
+ {
1534
+ "name": "Controller",
1535
+ "kind": "interface",
1536
+ "jsdoc": "",
1537
+ "decl": "export interface Controller<S> {\n initialState: S;\n handlers: Record<string, (state: S, event: ControllerEvent) => S | undefined | Promise<S | undefined>>;\n}"
1538
+ },
1539
+ {
1540
+ "name": "defineController",
1541
+ "kind": "function",
1542
+ "jsdoc": "/** HHP lowers this declaration to defineService at build time. */",
1543
+ "decl": "export function defineController<S>(controller: Controller<S>): Controller<S>;"
1544
+ },
1545
+ {
1546
+ "name": "normalizeControllerEvent",
1547
+ "kind": "function",
1548
+ "jsdoc": "/** Normalize the existing worker event payload without discarding native event fields. */",
1549
+ "decl": "export function normalizeControllerEvent(event: unknown): ControllerEvent;"
1550
+ },
1551
+ {
1552
+ "name": "updateBoundValue",
1553
+ "kind": "function",
1554
+ "jsdoc": "/** Used by generated reducers; immutable, own-property-only nested updates. */",
1555
+ "decl": "export function updateBoundValue<S>(state: S, path: string, value: unknown): S;"
1556
+ }
1557
+ ]
1558
+ },
1522
1559
  {
1523
1560
  "name": "@himalaya/himi-apps",
1524
1561
  "source": "core/sdk/himi-apps/src/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1272.0",
3
+ "version": "0.1273.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": [
@@ -38,9 +38,11 @@
38
38
  "@rive-app/canvas": "^2.21.0",
39
39
  "ajv": "^8.17.1",
40
40
  "ajv-formats": "^3.0.1",
41
+ "cheerio": "^1.0.0",
41
42
  "esbuild": "^0.25.0",
42
43
  "fontkit": "^2.0.4",
43
44
  "lottie-web": "^5.12.2",
45
+ "postcss": "8.5.16",
44
46
  "quickjs-emscripten": "^0.32.0",
45
47
  "react": "^18.2.0",
46
48
  "react-dom": "^18.2.0",
@@ -67,5 +69,5 @@
67
69
  "artifactId": "himalaya-cli"
68
70
  }
69
71
  },
70
- "falconPackageHash": "1b765143c0fb934472ac85f0bd15ebe775ddb75ad111666ac6f5a53e"
72
+ "falconPackageHash": "f0c39037eb2a54b21ac2a62c2902e69d3d5a0240d69f8ddb7a757edc"
71
73
  }