@wix/himalaya-cli 0.1722.0 → 0.1724.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.
Files changed (73) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-config.d.ts +1 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-module.d.ts +2 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/godot/src/index.d.ts +3 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/attendance-classifier.d.ts +1 -1
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments-contract.d.ts +3 -39
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +10 -0
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/index.d.ts +2 -0
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/preview-surfaces.d.ts +24 -0
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-web-sdk.d.ts +37 -0
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-web-sdk.generated.d.ts +1 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/wrapped-app-link.d.ts +13 -0
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/checkout-source.d.ts +2 -3
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-order-backend.d.ts +0 -2
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/attendance.d.ts +2 -8
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/index.d.ts +4 -13
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +175 -1
  17. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap-checkout.mjs +46 -502
  18. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap.mjs +5 -26
  19. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +64 -648
  20. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +1 -0
  21. package/dist/browser-plane/assets.json +5 -5
  22. package/dist/browser-plane/package-reader.js +4 -4
  23. package/dist/browser-plane/preview-deferred/{74e5b76ecf38392d7eb3f9a9512d60a0675de85d411c9c56293e123152b3f70b.bin → a6e25c06d2a17ab2b5e34bf2b5965fa3ddd76ce3da32a036e546a60938130d7b.bin} +1 -1
  24. package/dist/browser-plane/sw.js +9 -9
  25. package/dist/cli.mjs +1325 -422
  26. package/dist/preview-assets.generated.bin +0 -0
  27. package/guides/himi-json-output.md +6 -2
  28. package/guides/iap-screen-adoption.md +4 -4
  29. package/guides/sdk-reference.json +11 -74
  30. package/guides/webview-page-sdk.md +14 -0
  31. package/guides/wix-business-context.md +24 -0
  32. package/guides/wix-site-to-himi-app.md +2 -1
  33. package/package.json +2 -2
  34. package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +2 -2
  35. package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +5 -8
  36. package/templates/beauty-salon-owner/config.ts +1 -1
  37. package/templates/branded-lite/tier5-src/himi-store-account/index.ts +2 -2
  38. package/templates/branded-lite/tier5-src/himi-store-product/index.ts +5 -8
  39. package/templates/brandy/README.md +14 -1
  40. package/templates/brandy/config.ts +71 -5
  41. package/templates/brandy/dev/index.ts +522 -8
  42. package/templates/brandy/himalaya.content.json +1 -1
  43. package/templates/brandy/himalaya.template.json +1 -1
  44. package/templates/brandy/tier5-src/himi-brandy-base44-account/index.ts +187 -0
  45. package/templates/community-club/tier5-src/himi-store-account/index.ts +2 -2
  46. package/templates/community-club-owner/config.ts +1 -1
  47. package/templates/conference/tier5-src/himi-store-account/index.ts +2 -2
  48. package/templates/events-meetups/tier5-src/himi-store-account/index.ts +2 -2
  49. package/templates/events-meetups-owner/config.ts +1 -1
  50. package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +2 -2
  51. package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +5 -8
  52. package/templates/gym-fitness-owner/config.ts +1 -1
  53. package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +2 -2
  54. package/templates/nonprofit-cause-owner/config.ts +1 -1
  55. package/templates/owner-lite/config.ts +1 -1
  56. package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +2 -2
  57. package/templates/podcast-creator-owner/config.ts +1 -1
  58. package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +2 -2
  59. package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +5 -8
  60. package/templates/portfolio-creative-owner/config.ts +1 -1
  61. package/templates/restaurant/tier5-src/himi-store-account/index.ts +2 -2
  62. package/templates/restaurant-owner/config.ts +1 -1
  63. package/templates/retail-store/tier5-src/himi-store-account/index.ts +2 -2
  64. package/templates/retail-store/tier5-src/himi-store-product/index.ts +5 -8
  65. package/templates/retail-store-owner/config.ts +1 -1
  66. package/templates/salon-spa/tier5-src/himi-store-account/index.ts +2 -2
  67. package/templates/wholesale-store/tier5-src/himi-store-account/index.ts +2 -2
  68. package/templates/wholesale-store/tier5-src/himi-store-product/index.ts +5 -8
  69. package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +2 -2
  70. package/templates/yoga-studio-owner/config.ts +1 -1
  71. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/attendance-orders.d.ts +0 -10
  72. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/online-programs-orders.d.ts +0 -2
  73. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/pricing-plans-orders.d.ts +0 -2
Binary file
@@ -163,7 +163,11 @@ configEdited, fields }`.
163
163
  `himi ext list` exits 0 and reports problems in `findings[]` (`code`, `extension`, `file?`,
164
164
  `line?`, `message`): the manifest and interface codes (`extension_manifest_invalid`,
165
165
  `extension_name_invalid`, `extension_feature_unsupported`, `extension_action_invalid`,
166
- `extension_interface_invalid`), `extension_unsafe_file`, `extension_too_large`,
166
+ `extension_interface_invalid`), the dependency and privacy-manifest codes
167
+ (`extension_dependency_not_curated` — an `ios.spm` or `android.gradle` entry that is not on the curated
168
+ dependency list at that version; `extension_dependency_invalid` — a malformed one;
169
+ `extension_privacy_manifest_invalid` — an `ios.privacyManifest` that is missing or is not a valid privacy
170
+ manifest), `extension_unsafe_file`, `extension_too_large`,
167
171
  `extension_sources_missing`, `extension_not_found`, `extension_declared_missing`,
168
172
  `extension_not_declared` and `extension_view_shadows_core`, and coverage gaps in `warnings[]`:
169
173
  `extension_range_unreserved`, `extension_single_platform`, `extension_web_unsupported` and
@@ -270,7 +274,7 @@ worker's bundle. These names are stable.
270
274
  | `auth_provider_invalid` | The app's `config.ts` `auth` entry cannot be used: missing, no `providerId`, or a `config` that is not an object. `file`, `field` and `fix` say where and what to write. Nothing is published. Exit 2. The same code comes from `himi validate`, `render`, `test`, `pack` and `run` (see "`config.ts` failures" below). |
271
275
  | `one_app_readiness_failed` | Reserved legacy refusal code. One App migration readiness is now advisory: publish and promotion report structured warnings instead. Other independent release checks may still refuse a push. |
272
276
  | `control_token_expired` | The selected control token has expired. |
273
- | `extension_invalid` | A native extension the app declares (config.ts `extensions`) cannot be uploaded: a missing `extensions/<name>/`, an invalid `himi-extension.json` or `interface.ts`, a refused build-time file (an SPM or Gradle script, a binary), or one over the size limit. `findings[]` carries `{ code, extension, file?, line?, message }` per problem. Nothing is published. Extension artifacts are uploaded even with `--no-source`. A publishing service that predates native extensions publishes without them; push then reports the warning `extensions_unenforced` (not a refusal, like `require_ota_unenforced`). |
277
+ | `extension_invalid` | A native extension the app declares (config.ts `extensions`) cannot be uploaded: a missing `extensions/<name>/`, an invalid `himi-extension.json` or `interface.ts`, a refused build-time file (an SPM or Gradle script, a binary), a dependency off the curated list (finding code `extension_dependency_not_curated`), or one over the size limit. `findings[]` carries `{ code, extension, file?, line?, message }` per problem. Nothing is published. Extension artifacts are uploaded even with `--no-source`. A publishing service that predates native extensions publishes without them; push then reports the warning `extensions_unenforced` (not a refusal, like `require_ota_unenforced`). |
274
278
  | `app_source_contains_secrets` | Source archiving detected a possible credential. |
275
279
  | `app_source_too_large` | The encoded source archive exceeds its limit. |
276
280
  | `publish_body_too_large` | The complete publish request exceeds its limit. `bodyBytes` is the plain JSON and `limit` the 8,388,608-byte plain limit, as before. Added: `overageBytes`, `decodedLimit` (33,554,432), `decodedOverageBytes`; when push would gzip the body, `wireBytes`, `wireLimit` and `wireOverageBytes`; and `compressedUpload`, why the gzip upload was not admitted: `decoded_limit_exceeded`, `self_serve_credential`, `credential_unverified` (a static or opaque credential the CLI cannot read as a provisioned token) or `wire_limit_exceeded`. `appSourceBytes` and `breakdown` are unchanged. No credential or payload content is included. |
@@ -43,10 +43,10 @@ withdraw the shared checkout's access state; reading existing access never creat
43
43
 
44
44
  The existing Stores adapter reads `paymentStatus: PAID` as granted. That proves payment,
45
45
  not usable delivery of a download or course. It also lacks a verified member-scoped
46
- existing-ownership read. Only the product screen installs `storesProductOrders` for sales, while
47
- `storesAppleSalesEnabled()` is true. As shipped, `STORES_APPLE_SALES_ENABLED` is on, so mapped digital
48
- products without options are paid through wix-iap StartItemPayment: the device opens no eCom checkout
49
- and makes no cashier charge. Live digital fulfillment remains unverified.
46
+ existing-ownership read. Only the product screen installs `storesProductOrders` for sales. Mapped
47
+ digital products without options are paid through wix-iap StartItemPayment: the device opens no eCom
48
+ checkout and makes no cashier charge. Plans, Programs, Bookings and Events are paid the same way; no
49
+ switch turns any of them off. Live digital fulfillment remains unverified.
50
50
  The cart and list screens do not start Apple sales. A confirmed physical product retains its
51
51
  regular checkout.
52
52
  Unknown product facts, unsupported catalog apps and missing routing fail closed.
@@ -1877,7 +1877,7 @@
1877
1877
  "name": "PackResult",
1878
1878
  "kind": "interface",
1879
1879
  "jsdoc": "",
1880
- "decl": "export interface PackResult {\n status: PackStatus;\n /** Local path the verified pack was written to, when it got that far. */\n path?: string;\n}",
1880
+ "decl": "export interface PackResult {\n status: PackStatus;\n /** Local path the verified pack was written to, when it got that far. */\n path?: string;\n /** Why it failed, when the platform said: e.g. `http 404 host/v1/asset/<sha>`, `network -1009 host/…`,\n * `sri mismatch`. Never a query or a header, so it is safe to show. */\n detail?: string;\n}",
1881
1881
  "verificationChecked": true
1882
1882
  },
1883
1883
  {
@@ -2797,27 +2797,6 @@
2797
2797
  "decl": "export interface AppleSaleRule {\n appProductId(entityId: string): string;\n productType: \"NON_CONSUMABLE\" | \"CONSUMABLE\";\n}",
2798
2798
  "verificationChecked": true
2799
2799
  },
2800
- {
2801
- "name": "BOOKINGS_APPLE_SALES_ENABLED",
2802
- "kind": "const",
2803
- "jsdoc": "",
2804
- "decl": "export const BOOKINGS_APPLE_SALES_ENABLED = true;",
2805
- "verificationChecked": true
2806
- },
2807
- {
2808
- "name": "EVENTS_APPLE_SALES_ENABLED",
2809
- "kind": "const",
2810
- "jsdoc": "",
2811
- "decl": "export const EVENTS_APPLE_SALES_ENABLED = true;",
2812
- "verificationChecked": true
2813
- },
2814
- {
2815
- "name": "STORES_APPLE_SALES_ENABLED",
2816
- "kind": "const",
2817
- "jsdoc": "/**\n * Whether Wix Stores items sell through the App Store: the Stores rule in `APPLE_SALE_RULES` and the\n * product screen's Buy. A sale is wix-iap StartItemPayment (catalyst-server #24496), which places and\n * charges the member's eCom order for one catalog item server-side; the device never opens an eCom\n * checkout or a cashier charge for it. ON for mapped digital products.\n */",
2818
- "decl": "export const STORES_APPLE_SALES_ENABLED = true;",
2819
- "verificationChecked": true
2820
- },
2821
2800
  {
2822
2801
  "name": "STORES_PRODUCT_SALE_RULE",
2823
2802
  "kind": "const",
@@ -2825,13 +2804,6 @@
2825
2804
  "decl": "export const STORES_PRODUCT_SALE_RULE: AppleSaleRule = { appProductId: (id) => id, productType: \"NON_CONSUMABLE\" };",
2826
2805
  "verificationChecked": true
2827
2806
  },
2828
- {
2829
- "name": "PRICING_PLAN_APPLE_SALES_ENABLED",
2830
- "kind": "const",
2831
- "jsdoc": "/** One-time unlimited plans sell through the App Store. Proven live in Sandbox on 2026-10-19: a member's\n * online plan order is charged with one cashier item whose id is the plan id, so StartPayment maps it to the\n * plan's Apple product, and the order reads ACTIVE and PAID. Recurring and time-limited plans stay outside\n * this rule; their Billing lifecycle is unfinished. */",
2832
- "decl": "export const PRICING_PLAN_APPLE_SALES_ENABLED = true;",
2833
- "verificationChecked": true
2834
- },
2835
2807
  {
2836
2808
  "name": "VIDEOS_APPLE_SALES_ENABLED",
2837
2809
  "kind": "const",
@@ -2839,46 +2811,11 @@
2839
2811
  "decl": "export const VIDEOS_APPLE_SALES_ENABLED = false;",
2840
2812
  "verificationChecked": true
2841
2813
  },
2842
- {
2843
- "name": "PRICING_PLAN_ITEM_PAYMENT_ENABLED",
2844
- "kind": "const",
2845
- "jsdoc": "/**\n * Which verticals order through wix-iap StartItemPayment (catalyst-server #24878 Plans, #24880 Online\n * Programs, #24881 Bookings, #24882 Events) instead of the device's own checkout and StartPayment. The\n * server places the order as the member, charges it with appleIAP and names the App Store product. Each\n * OFF: that vertical keeps its client checkout. Turn one on only once production wix-iap and Serve's\n * generated client carry its fields; each flips on its own.\n */",
2846
- "decl": "export const PRICING_PLAN_ITEM_PAYMENT_ENABLED = false;",
2847
- "verificationChecked": true
2848
- },
2849
- {
2850
- "name": "ONLINE_PROGRAM_ITEM_PAYMENT_ENABLED",
2851
- "kind": "const",
2852
- "jsdoc": "",
2853
- "decl": "export const ONLINE_PROGRAM_ITEM_PAYMENT_ENABLED = false;",
2854
- "verificationChecked": true
2855
- },
2856
- {
2857
- "name": "BOOKINGS_ITEM_PAYMENT_ENABLED",
2858
- "kind": "const",
2859
- "jsdoc": "",
2860
- "decl": "export const BOOKINGS_ITEM_PAYMENT_ENABLED = false;",
2861
- "verificationChecked": true
2862
- },
2863
- {
2864
- "name": "EVENTS_ITEM_PAYMENT_ENABLED",
2865
- "kind": "const",
2866
- "jsdoc": "",
2867
- "decl": "export const EVENTS_ITEM_PAYMENT_ENABLED = false;",
2868
- "verificationChecked": true
2869
- },
2870
- {
2871
- "name": "CANCEL_PAYMENT_ENABLED",
2872
- "kind": "const",
2873
- "jsdoc": "/**\n * CancelPayment (catalyst-server #24894, not deployed) when the member closes the Apple sheet: it cancels\n * the pending Payment and releases the ticket reservation or booking it held. OFF: nothing is sent, and the\n * Payment expires on its own in about an hour.\n */",
2874
- "decl": "export const CANCEL_PAYMENT_ENABLED = false;",
2875
- "verificationChecked": true
2876
- },
2877
2814
  {
2878
2815
  "name": "AppleSaleOptions",
2879
2816
  "kind": "interface",
2880
- "jsdoc": "/**\n * The one definition `himi store iap connect` writes mappings by and the mapping source reads them by,\n * keyed by catalog kind. wix-iap StartPayment maps the cashier order's single item id, and Online\n * Programs builds that order with the program id as the item id; programs are one-time unlocks.\n * Wix Stores and one-time unlimited Pricing Plans join only with their independent switches.\n */",
2881
- "decl": "export interface AppleSaleOptions {\n storesAppleSalesEnabled?: boolean;\n pricingPlanAppleSalesEnabled?: boolean;\n bookingsAppleSalesEnabled?: boolean;\n eventsAppleSalesEnabled?: boolean;\n videosAppleSalesEnabled?: boolean;\n}",
2817
+ "jsdoc": "/**\n * The one definition `himi store iap connect` writes mappings by and the mapping source reads them by,\n * keyed by catalog kind. Every vertical but Video sells through wix-iap StartItemPayment, which orders\n * the item server-side and names the App Store product by the item's own id.\n */",
2818
+ "decl": "export interface AppleSaleOptions {\n videosAppleSalesEnabled?: boolean;\n}",
2882
2819
  "verificationChecked": true
2883
2820
  },
2884
2821
  {
@@ -2898,8 +2835,8 @@
2898
2835
  {
2899
2836
  "name": "APPLE_PROVISIONING_RULES",
2900
2837
  "kind": "const",
2901
- "jsdoc": "/** Catalog setup may precede activation; purchases still require the independent sales switches. */",
2902
- "decl": "export const APPLE_PROVISIONING_RULES: Readonly<Record<string, AppleSaleRule>> = {\n ...APPLE_SALE_RULES, bookingsService: ATTENDANCE_SALE_RULE, eventsTicket: ATTENDANCE_SALE_RULE, wixVideo: VIDEO_SALE_RULE,\n};",
2838
+ "jsdoc": "/** Catalog setup may precede activation: a video is provisioned while its sales stay off. */",
2839
+ "decl": "export const APPLE_PROVISIONING_RULES: Readonly<Record<string, AppleSaleRule>> = {\n ...APPLE_SALE_RULES, wixVideo: VIDEO_SALE_RULE,\n};",
2903
2840
  "verificationChecked": true
2904
2841
  },
2905
2842
  {
@@ -3153,7 +3090,7 @@
3153
3090
  {
3154
3091
  "name": "attendanceCheckoutRoute",
3155
3092
  "kind": "function",
3156
- "jsdoc": "/** Applies platform support and activation switches without sending uncertain iOS offers to web checkout. */",
3093
+ "jsdoc": "/** Applies platform support without sending uncertain iOS offers to web checkout. */",
3157
3094
  "decl": "export function attendanceCheckoutRoute(item: BookingAttendance | TicketAttendance, currency: string, platform: string): \"regular\" | \"appleIap\" | \"blocked\";",
3158
3095
  "verificationChecked": true
3159
3096
  },
@@ -3448,28 +3385,28 @@
3448
3385
  "name": "onlineProgramOrders",
3449
3386
  "kind": "const",
3450
3387
  "jsdoc": "",
3451
- "decl": "export const onlineProgramOrders: IapOrderAdapter = ONLINE_PROGRAM_ITEM_PAYMENT_ENABLED ? onlineProgramItemPayments : onlineProgramClientOrders;",
3388
+ "decl": "export const onlineProgramOrders = onlineProgramItemPayments;",
3452
3389
  "verificationChecked": true
3453
3390
  },
3454
3391
  {
3455
3392
  "name": "pricingPlanOrders",
3456
3393
  "kind": "const",
3457
3394
  "jsdoc": "",
3458
- "decl": "export const pricingPlanOrders: IapOrderAdapter = PRICING_PLAN_ITEM_PAYMENT_ENABLED ? pricingPlanItemPayments : pricingPlanClientOrders;",
3395
+ "decl": "export const pricingPlanOrders = pricingPlanItemPayments;",
3459
3396
  "verificationChecked": true
3460
3397
  },
3461
3398
  {
3462
3399
  "name": "bookingOrders",
3463
3400
  "kind": "const",
3464
3401
  "jsdoc": "",
3465
- "decl": "export const bookingOrders: IapOrderAdapter = BOOKINGS_ITEM_PAYMENT_ENABLED ? bookingItemPayments : bookingClientOrders;",
3402
+ "decl": "export const bookingOrders = bookingItemPayments;",
3466
3403
  "verificationChecked": true
3467
3404
  },
3468
3405
  {
3469
3406
  "name": "eventTicketOrders",
3470
3407
  "kind": "const",
3471
3408
  "jsdoc": "",
3472
- "decl": "export const eventTicketOrders: IapOrderAdapter = EVENTS_ITEM_PAYMENT_ENABLED ? eventTicketItemPayments : eventTicketClientOrders;",
3409
+ "decl": "export const eventTicketOrders = eventTicketItemPayments;",
3473
3410
  "verificationChecked": true
3474
3411
  },
3475
3412
  {
@@ -3482,7 +3419,7 @@
3482
3419
  {
3483
3420
  "name": "storesAppleSalesEnabled",
3484
3421
  "kind": "function",
3485
- "jsdoc": "/** Whether Wix Stores items sell through the App Store: wix-iap StartItemPayment places and charges\n * the member's eCom order (`STORES_APPLE_SALES_ENABLED` in @himalaya/iap). Turning it off stops only\n * new attempts: stored ones are still held, completed and tracked (). */",
3422
+ "jsdoc": "/** @deprecated Always true: Wix Stores items always sell through the App Store (wix-iap StartItemPayment).\n * Kept because screens generated from earlier `himi init` templates still call it. */",
3486
3423
  "decl": "export function storesAppleSalesEnabled(): boolean;",
3487
3424
  "verificationChecked": true
3488
3425
  },
@@ -247,6 +247,20 @@ every build. (Inside the Himi repository Brandy's customer build does the same:
247
247
  for a local preview.) To expose
248
248
  fewer methods, write your own companion and name it in `bundle` — a named bundle is used as is.
249
249
 
250
+ Each site screen must also carry the companion, so its pages can reach it. In a site-shell
251
+ content package (`himi init --template brandy`) `dev/index.ts` already does this for every page
252
+ with `withSiteWebSdk` from `@wix/himalaya/core`:
253
+
254
+ ```ts
255
+ import { siteScreens, withSiteWebSdk } from "@wix/himalaya/core";
256
+ // provisioning.json's `webSdk` block; absent or empty ⇒ the screen is returned unchanged.
257
+ exact: { site_home: (ctx) => withSiteWebSdk(siteScreens(site).site_home, ctx, provisioning.webSdk) }
258
+ ```
259
+
260
+ It names the bundle the build generates, declares `webview`, the enabled capabilities and anything
261
+ their SDKs call besides them, and returns `null` (the screen does not build) when the companion was
262
+ not built. A screen that carries a companion keeps its WebView form only.
263
+
250
264
  Brandy accepts capabilities `himi dist` can add to an extensible shell. Capabilities requiring
251
265
  app-specific boot wiring remain refused until that shell supplies the wiring — the list is in
252
266
  [the web page guide](https://apps.wix.com/_api/himi-serve/docs/web-page-native-sdk.md#before-you-start-what-the-app-owner-must-enable).
@@ -211,6 +211,30 @@ bottom tabs; more than five → `drawer`), `branding.primaryColor` from its them
211
211
  verticals added to `installedVerticals` unless a probe answered 428. To recreate the whole app rather
212
212
  than seed a template from it, run `himi one-app migrate`.
213
213
 
214
+ ### The retired Wix Forum (`book.legacyForum`)
215
+
216
+ Wix Forum was discontinued on 1 March 2026; Wix Groups replaced it. A site can still list the Forum
217
+ app, a `/forum` page or Forum sections in its mobile app, so analyze never treats `forum` as an
218
+ installed vertical: not from a probe, the published site or `book.mobileApp`. The app never gets
219
+ Forum screens, an empty Groups tab or Blog posts in their place. A stale "Forum" nav link names no
220
+ tab, `--site-pages` never embeds or maps the `/forum` page, and `himi template recommend --book`
221
+ does not count Forum (or Groups read as `none`).
222
+
223
+ When the Forum app is installed, its API answers, or the mobile app has Forum sections, the book
224
+ gets `legacyForum` (also `## Legacy Forum` in `book.md`, and one warning):
225
+
226
+ | `groups` | What the app gets | Owner step (`next`) |
227
+ |---|---|---|
228
+ | `found` | the site's real Wix Groups (`groupsMemberOnly` when the visitor read answered with none) | confirm in the dashboard that these groups hold the Forum's posts before saying it moved |
229
+ | `none` (a 428, or an empty owner read) | no community screen, even when the old app had a Groups section | the owner moves the forum to Wix Groups from the dashboard, if Wix still offers it, then re-runs analyze |
230
+ | `unknown` | no Forum screen; Groups only from another signal (the published site, or the old app's Groups section) | the owner Groups read failed (fix the token or permission), was not made (re-run with `--site`), or nothing was read (re-run with `--client-id`) |
231
+
232
+ `migration` is always `not-verified`. The Forum-to-Groups migration record (status, stage counts,
233
+ old-to-new ids) needs an app identity with Manage Social Groups, which analyze does not hold. So
234
+ analyze never reads it and never starts, retries or completes a migration; it also never invites
235
+ members or publishes the site. Do not tell an owner that their Forum moved, or promise to recover
236
+ posts after the deadline, from this chapter alone.
237
+
214
238
  The plane has no headless browser (`look.unavailable: no_browser_on_plane`). Owner token is a **request field**, never spawned via `wix token` on the guest. Blobs in the book are **URLs** (Media Manager / wixstatic), not S3 and not base64.
215
239
 
216
240
  `--apply` writes `appearance.homeLayout` + `navigation.navKind` plus identity/colors. It never silently overwrites committed Amit1 `apps/himi-branded-lite/provisioning.json`.
@@ -144,7 +144,8 @@ for **behavior** is the website; design authority for **layout** is
144
144
 
145
145
  | Website | Mobile |
146
146
  |---|---|
147
- | Vertical (book, shop, events, forum, members, blog) | Template/overlay screen; bind with `himi sdk` + live `@himalaya/wix-*`. Any screen showing a digital item's price (program, product, plan) also uses the shared IAP pricing layer — `himi docs iap-pricing` — whether it came from a template or you wrote it |
147
+ | Retired Wix Forum (`book.legacyForum`) | No Forum screen. The app shows the site's Wix Groups only when analyze found some; otherwise pass the `next` owner step on. Never a Blog post or an empty Groups tab instead (`himi docs wix-business-context`) |
148
+ | Vertical (book, shop, events, members, blog, groups) | Template/overlay screen; bind with `himi sdk` + live `@himalaya/wix-*`. Any screen showing a digital item's price (program, product, plan) also uses the shared IAP pricing layer — `himi docs iap-pricing` — whether it came from a template or you wrote it |
148
149
  | Custom content / CMS / forms | One T5 screen per *job*; data = adopted CMS (`wixId`) or a form worker (`himi docs recipe-form-submit`) |
149
150
  | Velo page modules | Briefing only: field names, collection ids, submit flow. **Rewrite** as a worker. Never copy Velo JS. Site HTTP functions (`/_functions/`) are a separate API: `himi docs wix-site-http-functions` / `himi site function` — analyze never invokes them |
150
151
  | Lightboxes, popups, multi-column editors | Push screen or sheet — not a ported lightbox |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1722.0",
3
+ "version": "0.1724.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": [
@@ -81,5 +81,5 @@
81
81
  "artifactId": "himalaya-cli"
82
82
  }
83
83
  },
84
- "falconPackageHash": "973869fcc70c3872e3bbfdb1843520206df2c43b7e127052433180c3"
84
+ "falconPackageHash": "aad0bbdce1ff36542b6167a0e6087ed91f11189e9990ddcce4a37333"
85
85
  }
@@ -17,7 +17,7 @@ import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
17
17
  import { signInPageStyle, signInSheetStyle } from "../_shared/sign-in-sheet.js";
18
18
  import { memberAccountRoutes } from "../_shared/member-account-routes.js";
19
19
  import { CONTINUATION_BUDGET_MS, memberScreenTarget, within } from "../_shared/member-screen.js";
20
- import { createIapCommerce, onlineProgramOrders, pricingPlanOrders, storesAppleSalesEnabled, storesProductOrders } from "@himalaya/iap-checkout";
20
+ import { createIapCommerce, onlineProgramOrders, pricingPlanOrders, storesProductOrders } from "@himalaya/iap-checkout";
21
21
  import { IAP_RESTORE_KEYS, NO_IAP_RESTORE, createIapRestore, resetUnhydratedKeysOnOlderRuntime, type IapRestoreFields } from "../_shared/iap-worker.js";
22
22
 
23
23
  interface AuthRouteInput {
@@ -615,7 +615,7 @@ interface S extends IapRestoreFields {
615
615
  // row shows once purchasing is ready on this host (a bound iOS binary with managed StoreKit), to a
616
616
  // guest too: the restore itself asks them to sign in.
617
617
  const commerce = createIapCommerce({
618
- adapters: [onlineProgramOrders, pricingPlanOrders, ...(storesAppleSalesEnabled() ? [storesProductOrders] : [])],
618
+ adapters: [onlineProgramOrders, pricingPlanOrders, storesProductOrders],
619
619
  onChange: () => { void svc.restorePublish(); },
620
620
  });
621
621
  const restore = createIapRestore(commerce, { prefix: "storeAccount", repaint: () => { void svc.restorePublish(); } });
@@ -2,7 +2,7 @@ import { withOnlineWrites, offlineWritesEnabled, offlineWriteMessage } from "../
2
2
  import { defineService as registerState } from "@himalaya/state";
3
3
  // Tier-5 bundle: himi-store — product detail.
4
4
  import { withIapPresentation } from "../_shared/iap-presentation.js";
5
- import { storesAppleSalesEnabled, storesProductOrders, type IapCommerce, type IapPurchaseFields } from "@himalaya/iap-checkout";
5
+ import { storesProductOrders, type IapCommerce, type IapPurchaseFields } from "@himalaya/iap-checkout";
6
6
  import { iapPriceCopy, iapPurchaseCopy } from "../_shared/iap-worker.js";
7
7
  import { share as shareSheet } from "@himalaya/share";
8
8
  import { addToCurrentCart, getCurrentCart } from "@himalaya/wix-ecom";
@@ -466,10 +466,8 @@ function derive(s: S): S {
466
466
  // read answering late — must not replace the badge the add set (#3468 review).
467
467
  let cartBadgeEpoch = 0;
468
468
 
469
- // A digital product with no options sells through the App Store once the platform sells Wix Stores
470
- // items there (`storesAppleSalesEnabled`): wix-iap StartItemPayment places and charges its order.
471
- // Until then, and for any other product, an App Store route only blocks the regular checkout.
472
- const SELLS_THROUGH_APPLE = storesAppleSalesEnabled();
469
+ // A digital product with no options sells through the App Store: wix-iap StartItemPayment places and
470
+ // charges its order. For any other product, an App Store route only blocks the regular checkout.
473
471
  const WIX_STORES_APP = "215238eb-22a5-4c36-9e7b-e7c08025e04e";
474
472
  const NOT_APPLE: IapPurchaseFields = { appleRoute: false, accessReady: false, buyLabel: "", buyDisabled: true, buyBusy: false, buyNote: "" };
475
473
 
@@ -477,7 +475,7 @@ let productPricing: IapCommerce;
477
475
  let checkoutEntered = false;
478
476
  const defineService = withIapPresentation<S>({
479
477
  register: withOnlineWrites(registerState, ["beginAdd", "addToCart", "buy"], { derive, messageFields: action => action === "buy" ? ["buyNote"] : ["cartHint"] }),
480
- adapters: SELLS_THROUGH_APPLE ? [storesProductOrders] : [],
478
+ adapters: [storesProductOrders],
481
479
  onCreate: commerce => { productPricing = commerce; }, prefix: "product",
482
480
  transientKeys: ["optionValidationTarget", "optionValidationRequest", "opt1ScrollRequest", "opt2ScrollRequest", "opt3ScrollRequest", "galleryIndex", "price", "optionsIncomplete", "cartHint", "cartHidden", "buyHidden", "buyLabel", "buyDisabled", "buyNote", "purchasedNote", "addedSheetPresented", "shareHint"], contentActions: ["load", "paintCached"], concurrentPublishActions: ["buy"],
483
481
  items: state => inputId() ? [{ reference: { kind: "storesProduct", id: inputId() }, commerceDisplayPrice: state.price }] : [],
@@ -508,7 +506,7 @@ const defineService = withIapPresentation<S>({
508
506
  function applePurchase(state: S): IapPurchaseFields {
509
507
  const id = inputId();
510
508
  const loaded = !!id && lastLoadedId === id;
511
- const sellable = SELLS_THROUGH_APPLE && loaded && lastProduct?.productType?.toLowerCase() === "digital" && !state.optionsUnknown && state.optionGroups.length === 0;
509
+ const sellable = loaded && lastProduct?.productType?.toLowerCase() === "digital" && !state.optionsUnknown && state.optionGroups.length === 0;
512
510
  const copy = iapPurchaseCopy("product");
513
511
  const fields = sellable ? productPricing.purchaseFields({ kind: "storesProduct", id }, copy) : NOT_APPLE;
514
512
  return fields.appleRoute ? fields : NOT_APPLE;
@@ -516,7 +514,6 @@ function applePurchase(state: S): IapPurchaseFields {
516
514
 
517
515
  /** On every entry: the first starts the checkout (recovering held purchases), later ones reconcile. */
518
516
  function enterCheckout(): void {
519
- if (!SELLS_THROUGH_APPLE) return;
520
517
  void (checkoutEntered ? productPricing.reconcile() : productPricing.start());
521
518
  checkoutEntered = true;
522
519
  }
@@ -37,7 +37,7 @@ export default defineApp({
37
37
  actions: "http://localhost:8190/v1/actions",
38
38
  sync: "http://localhost:8190/v1/sync",
39
39
  },
40
- capabilities: ["live_activity","push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","stream","wix_api"],
40
+ capabilities: ["live_activity","push","share","secure_storage","open_url","local_database","clipboard","ui","speech","camera","photos","file_picker","files","presigned_upload","app_info","biometrics","wix_platform","wix_api","stream"],
41
41
  designTokensPath: "./tokens.json",
42
42
  // Native fallback; the T5 splash descriptor owns the editable launch appearance.
43
43
  splash: {
@@ -17,7 +17,7 @@ import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
17
17
  import { signInPageStyle, signInSheetStyle } from "../_shared/sign-in-sheet.js";
18
18
  import { memberAccountRoutes } from "../_shared/member-account-routes.js";
19
19
  import { CONTINUATION_BUDGET_MS, memberScreenTarget, within } from "../_shared/member-screen.js";
20
- import { createIapCommerce, onlineProgramOrders, pricingPlanOrders, storesAppleSalesEnabled, storesProductOrders } from "@himalaya/iap-checkout";
20
+ import { createIapCommerce, onlineProgramOrders, pricingPlanOrders, storesProductOrders } from "@himalaya/iap-checkout";
21
21
  import { IAP_RESTORE_KEYS, NO_IAP_RESTORE, createIapRestore, resetUnhydratedKeysOnOlderRuntime, type IapRestoreFields } from "../_shared/iap-worker.js";
22
22
 
23
23
  interface AuthRouteInput {
@@ -615,7 +615,7 @@ interface S extends IapRestoreFields {
615
615
  // row shows once purchasing is ready on this host (a bound iOS binary with managed StoreKit), to a
616
616
  // guest too: the restore itself asks them to sign in.
617
617
  const commerce = createIapCommerce({
618
- adapters: [onlineProgramOrders, pricingPlanOrders, ...(storesAppleSalesEnabled() ? [storesProductOrders] : [])],
618
+ adapters: [onlineProgramOrders, pricingPlanOrders, storesProductOrders],
619
619
  onChange: () => { void svc.restorePublish(); },
620
620
  });
621
621
  const restore = createIapRestore(commerce, { prefix: "storeAccount", repaint: () => { void svc.restorePublish(); } });
@@ -3,7 +3,7 @@ import { withOnlineWrites, offlineWritesEnabled, offlineWriteMessage } from "../
3
3
  import { defineService as registerState } from "@himalaya/state";
4
4
  // Tier-5 bundle: himi-store — product detail.
5
5
  import { withIapPresentation } from "../_shared/iap-presentation.js";
6
- import { storesAppleSalesEnabled, storesProductOrders, type IapCommerce, type IapPurchaseFields } from "@himalaya/iap-checkout";
6
+ import { storesProductOrders, type IapCommerce, type IapPurchaseFields } from "@himalaya/iap-checkout";
7
7
  import { iapPriceCopy, iapPurchaseCopy } from "../_shared/iap-worker.js";
8
8
  import { share as shareSheet } from "@himalaya/share";
9
9
  import { addToCurrentCart, getCurrentCart } from "@himalaya/wix-ecom";
@@ -451,10 +451,8 @@ function derive(s: S): S {
451
451
  // read answering late — must not replace the badge the add set (#3468 review).
452
452
  let cartBadgeEpoch = 0;
453
453
 
454
- // A digital product with no options sells through the App Store once the platform sells Wix Stores
455
- // items there (`storesAppleSalesEnabled`): wix-iap StartItemPayment places and charges its order.
456
- // Until then, and for any other product, an App Store route only blocks the regular checkout.
457
- const SELLS_THROUGH_APPLE = storesAppleSalesEnabled();
454
+ // A digital product with no options sells through the App Store: wix-iap StartItemPayment places and
455
+ // charges its order. For any other product, an App Store route only blocks the regular checkout.
458
456
  const WIX_STORES_APP = "215238eb-22a5-4c36-9e7b-e7c08025e04e";
459
457
  const NOT_APPLE: IapPurchaseFields = { appleRoute: false, accessReady: false, buyLabel: "", buyDisabled: true, buyBusy: false, buyNote: "" };
460
458
 
@@ -462,7 +460,7 @@ let productPricing: IapCommerce;
462
460
  let checkoutEntered = false;
463
461
  const registerProduct = withIapPresentation<S>({
464
462
  register: withOnlineWrites(registerState, ["beginAdd", "addToCart", "buy"], { derive, messageFields: action => action === "buy" ? ["buyNote"] : ["cartHint"] }),
465
- adapters: SELLS_THROUGH_APPLE ? [storesProductOrders] : [],
463
+ adapters: [storesProductOrders],
466
464
  onCreate: commerce => { productPricing = commerce; }, prefix: "product",
467
465
  transientKeys: ["optionValidationTarget", "optionValidationRequest", "opt1ScrollRequest", "opt2ScrollRequest", "opt3ScrollRequest", "galleryIndex", "price", "optionsIncomplete", "cartHint", "cartHidden", "buyHidden", "buyLabel", "buyDisabled", "buyNote", "purchasedNote", "addedSheetPresented", "shareHint"], contentActions: ["load", "readChanged"], concurrentPublishActions: ["buy"],
468
466
  items: state => inputId() ? [{ reference: { kind: "storesProduct", id: inputId() }, commerceDisplayPrice: state.price }] : [],
@@ -513,7 +511,7 @@ const defineService = withReadLifecycle(registerProduct, "load", {
513
511
  function applePurchase(state: S): IapPurchaseFields {
514
512
  const id = inputId();
515
513
  const loaded = !!id && lastLoadedId === id;
516
- const sellable = SELLS_THROUGH_APPLE && loaded && lastProduct?.productType?.toLowerCase() === "digital" && !state.optionsUnknown && state.optionGroups.length === 0;
514
+ const sellable = loaded && lastProduct?.productType?.toLowerCase() === "digital" && !state.optionsUnknown && state.optionGroups.length === 0;
517
515
  const copy = iapPurchaseCopy("product");
518
516
  const fields = sellable ? productPricing.purchaseFields({ kind: "storesProduct", id }, copy) : NOT_APPLE;
519
517
  return fields.appleRoute ? fields : NOT_APPLE;
@@ -521,7 +519,6 @@ function applePurchase(state: S): IapPurchaseFields {
521
519
 
522
520
  /** On every entry: the first starts the checkout (recovering held purchases), later ones reconcile. */
523
521
  function enterCheckout(): void {
524
- if (!SELLS_THROUGH_APPLE) return;
525
522
  void (checkoutEntered ? productPricing.reconcile() : productPricing.start());
526
523
  checkoutEntered = true;
527
524
  }
@@ -30,7 +30,7 @@ The placeholder origin above is not a real site. Replace it by deriving the bloc
30
30
  own menu, from inside this folder:
31
31
 
32
32
  ```bash
33
- himi site analyze --url https://your-account.wixsite.com/your-site --shell brandy --apply
33
+ himi site analyze --url https://your-account.wixsite.com/your-site --apply
34
34
  ```
35
35
 
36
36
  That writes the derived `site` block into this `provisioning.json` and your site's colours into
@@ -51,6 +51,19 @@ To review the map first, leave out `--apply`: the block is then only written to
51
51
  `config.ts` validates the block whenever the app loads, so an `http` origin, a duplicate id or a map
52
52
  with no tab fails `himi validate`, `himi render` and `himi push` rather than shipping.
53
53
 
54
+ ## Let your pages call the phone
55
+
56
+ A `webSdk` block in `provisioning.json` lets your site's pages call native features through the
57
+ web page SDK (`himi docs webview-page-sdk`):
58
+
59
+ ```json
60
+ "webSdk": { "capabilities": ["haptic", "share"] }
61
+ ```
62
+
63
+ `himi build` generates the worker that answers those calls, and `dev/index.ts` attaches it to every
64
+ page (`withSiteWebSdk`); `config.ts` adds the capabilities to the app, with any `permissionCopy`
65
+ wording for the ones that ask the user. Leave the block out and the pages call nothing native.
66
+
54
67
  ## Loop
55
68
 
56
69
  ```bash
@@ -3,7 +3,7 @@
3
3
  //
4
4
  // Nothing here names a page. The pages come from the `site` block of ./provisioning.json, so you
5
5
  // change the app by changing that block — by hand, or with
6
- // himi site analyze --url https://<your-site> --shell brandy
6
+ // himi site analyze --url https://<your-site>
7
7
  // which derives it from your site's own menu. Inspect the live values any time with
8
8
  // `himi context`; see `himi docs app-config`.
9
9
  import {
@@ -14,7 +14,9 @@ import {
14
14
  siteNavKind,
15
15
  siteSidebar,
16
16
  siteNavConfig,
17
+ siteWebSdkCompanion,
17
18
  type SiteShellConfig,
19
+ type SiteWebSdk,
18
20
  } from "@himalaya/core";
19
21
  import { ConsoleTelemetrySink } from "@himalaya/telemetry-console";
20
22
  import provisioning from "./provisioning.json" with { type: "json" };
@@ -31,6 +33,64 @@ if (nav.tabs[0]?.screenId !== "site_home") {
31
33
  throw new Error('provisioning.json: the "home" page must be the first tab — list it first in site.pages');
32
34
  }
33
35
 
36
+ /** The native capabilities your website's pages may call (`webSdk` in provisioning.json), e.g.
37
+ * `{ "capabilities": ["haptic", "share"] }`. `himi build` generates the worker that answers those
38
+ * calls, and dev/index.ts attaches it to every page. Absent: the pages call nothing native. */
39
+ export const webSdk = (provisioning as { webSdk?: SiteWebSdk & { permissionCopy?: Record<string, string> } }).webSdk;
40
+ // What the pages' worker declares: the page channel (`webview`), the enabled capabilities and
41
+ // anything their SDKs call besides them (`iap` also calls `wix_api`), taken from the worker's own
42
+ // declaration so the app grants exactly that. `push` and `base44` are listed by the app already.
43
+ const pageCapabilities = (siteWebSdkCompanion(webSdk)?.declaredCapabilities ?? [])
44
+ .filter((id) => id !== "push" && id !== "base44");
45
+
46
+ /** A Base44 site's app (`base44` in provisioning.json, or `bindings.base44`): members sign in on the
47
+ * native Account screen, and the app carries the session into the website's pages. Absent for a
48
+ * Wix site, which stays visitor-only. */
49
+ export interface Base44Binding { appId: string; serverUrl?: string; deleteAccountFunction?: string }
50
+ /** `https://host[:port]` with no path, query or fragment (a trailing `/` is dropped): the form the
51
+ * app's `base44.serverUrl` takes. */
52
+ function bareHttpsOrigin(raw: string): string {
53
+ let url: URL;
54
+ try { url = new URL(raw); } catch { throw new Error(`provisioning.json: base44.serverUrl must be an https origin, got: ${raw}`); }
55
+ if (url.protocol !== "https:" || url.username || url.password || url.search || url.hash || !/^\/*$/.test(url.pathname)) {
56
+ throw new Error(`provisioning.json: base44.serverUrl must be a bare https origin (no path), got: ${raw}`);
57
+ }
58
+ return url.origin;
59
+ }
60
+ const rawBase44 = ((provisioning as { base44?: unknown }).base44
61
+ ?? (provisioning as { bindings?: { base44?: unknown } }).bindings?.base44) as Partial<Base44Binding> | undefined;
62
+ export const base44: Base44Binding | undefined = rawBase44 == null ? undefined : (() => {
63
+ if (typeof rawBase44.appId !== "string" || !/^[A-Za-z0-9]{8,64}$/.test(rawBase44.appId.trim())) {
64
+ throw new Error("provisioning.json: base44.appId must be your Base44 app id (8-64 letters and digits)");
65
+ }
66
+ if (site.kind !== "base44") throw new Error('provisioning.json: a base44 binding needs a site of kind "base44"');
67
+ const serverUrl = typeof rawBase44.serverUrl === "string" && rawBase44.serverUrl.trim() ? bareHttpsOrigin(rawBase44.serverUrl.trim()) : undefined;
68
+ return {
69
+ appId: rawBase44.appId.trim(),
70
+ ...(serverUrl ? { serverUrl } : {}),
71
+ ...(typeof rawBase44.deleteAccountFunction === "string" && rawBase44.deleteAccountFunction.trim()
72
+ ? { deleteAccountFunction: rawBase44.deleteAccountFunction.trim() } : {}),
73
+ };
74
+ })();
75
+ /** What the app's `base44` setting carries: the app id, and its server when the binding names one. */
76
+ const base44Config = base44 === undefined ? undefined
77
+ : base44.serverUrl ? { appId: base44.appId, serverUrl: base44.serverUrl } : { appId: base44.appId };
78
+ /** The native Base44 Account screen's id (shared by every site shell; never `himi_account`). */
79
+ export const BASE44_ACCOUNT_SCREEN_ID = "himi_base44_account";
80
+ const notificationsRow = { id: "drawer_notifications", screenId: "himi_notification_settings", label: "Notifications", icon: "bell" as const };
81
+ const nativeRows = base44
82
+ ? [{ id: "drawer_account", screenId: BASE44_ACCOUNT_SCREEN_ID, label: "Account", icon: "person" as const }, notificationsRow]
83
+ : [notificationsRow];
84
+ // The native rows' ids are reserved — the same rule as the Brandy shell's contract parser: a site page
85
+ // that is not `overflow` gets a row, and one called `notifications` (or `account`, beside the Account
86
+ // row) would share its row id with the app's own, while navigation finds a destination by row id.
87
+ const reservedPageIds = base44 ? ["notifications", "account"] : ["notifications"];
88
+ for (const page of site.pages) {
89
+ if ((page.placement ?? "tab") !== "overflow" && reservedPageIds.includes(page.id)) {
90
+ throw new Error(`provisioning.json: site page id "${page.id}" is reserved for the app's native ${page.id} screen — rename the page or make it an overflow page`);
91
+ }
92
+ }
93
+
34
94
  export default defineApp({
35
95
  id: "__HIMI_APP_DOTID__",
36
96
  name: "__HIMI_APP_NAME__",
@@ -50,7 +110,12 @@ export default defineApp({
50
110
  sync: "http://localhost:8190/v1/sync",
51
111
  },
52
112
  // `push` lets the app ask for notification permission and show the Notifications screen.
53
- capabilities: ["push"],
113
+ // `base44` (a Base44 site only) lets the Account screen sign members in to your Base44 app.
114
+ // Then whatever `webSdk` lets your pages call, with its permission wording.
115
+ capabilities: ["push", ...(base44 ? ["base44"] : []), ...pageCapabilities],
116
+ permissionCopy: webSdk?.permissionCopy,
117
+ // The Base44 app the native sign-in and the website pages' session talk to (none for a Wix site).
118
+ base44: base44Config,
54
119
  // Ask for notification permission on the first launch. Tapped notifications that carry one of
55
120
  // your site's URLs open the page's tab (`navigation.site` below).
56
121
  push: {
@@ -79,14 +144,15 @@ export default defineApp({
79
144
  linkableScreens: [
80
145
  ...siteLinkableScreens(site),
81
146
  { screenId: "himi_notification_settings", isPublic: true, paramKeys: [], parentScreenId: "" },
147
+ ...(base44 ? [{ screenId: BASE44_ACCOUNT_SCREEN_ID, isPublic: true, paramKeys: [], parentScreenId: "" }] : []),
82
148
  ],
83
149
  // A notification or app link carrying one of your site's URLs opens that page's tab.
84
150
  site: siteNavConfig(site),
85
151
  tabBar: { items: nav.tabs },
86
- // Your site's drawer pages, then the native Notifications screen.
87
- drawer: { items: [...nav.drawer, { id: "drawer_notifications", screenId: "himi_notification_settings", label: "Notifications", icon: "bell" }] },
152
+ // Your site's drawer pages, then the native screens: Account (a Base44 site) and Notifications.
153
+ drawer: { items: [...nav.drawer, ...nativeRows] },
88
154
  // The rail (tablet, or `layout: "sidebar"`) replaces the drawer, so it lists the same rows.
89
- sidebar: { items: [...siteSidebar(site), { id: "drawer_notifications", screenId: "himi_notification_settings", label: "Notifications", icon: "bell" }] },
155
+ sidebar: { items: [...siteSidebar(site), ...nativeRows] },
90
156
  },
91
157
  entities: {},
92
158
  });