@wix/himalaya-cli 0.1723.0 → 0.1725.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 (84) 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 +9 -43
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/location/src/index.d.ts +5 -3
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/on-device-ai/src/index.d.ts +19 -7
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +1 -1
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +10 -0
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/index.d.ts +2 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/preview-surfaces.d.ts +24 -0
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-web-sdk.d.ts +37 -0
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-web-sdk.generated.d.ts +1 -0
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/wrapped-app-link.d.ts +13 -0
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/checkout-source.d.ts +5 -3
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-order-backend.d.ts +0 -2
  17. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/attendance.d.ts +2 -8
  18. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/index.d.ts +4 -13
  19. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/videos.d.ts +31 -1
  20. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/index.d.ts +1 -1
  21. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +1 -1
  22. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +1 -1
  23. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +1 -1
  24. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +1 -1
  25. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +175 -1
  26. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap-checkout.mjs +127 -509
  27. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap.mjs +5 -26
  28. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +1 -1
  29. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +1 -1
  30. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/on-device-ai.mjs +49 -3
  31. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +1 -1
  32. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +150 -644
  33. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +1 -1
  34. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +1 -0
  35. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +1 -1
  36. package/dist/browser-plane/assets.json +7 -7
  37. package/dist/browser-plane/package-reader.js +4 -4
  38. package/dist/browser-plane/preview-deferred/{74e5b76ecf38392d7eb3f9a9512d60a0675de85d411c9c56293e123152b3f70b.bin → 49dfd582c5a8fb38ceabd1c544343d87fd478063c04f90c4e7a4ed5ee774f1eb.bin} +1 -1
  39. package/dist/browser-plane/sw.js +9 -9
  40. package/dist/browser-plane/t5-frame.html +16 -0
  41. package/dist/browser-plane/t5-worker-frame.html +16 -0
  42. package/dist/cli.mjs +3039 -1831
  43. package/dist/preview-assets.generated.bin +0 -0
  44. package/guides/capabilities.md +2 -2
  45. package/guides/headless-loop.md +2 -1
  46. package/guides/himi-json-output.md +6 -2
  47. package/guides/iap-products.md +2 -2
  48. package/guides/iap-screen-adoption.md +5 -5
  49. package/guides/sdk-reference.json +47 -82
  50. package/guides/skill.md +1 -1
  51. package/guides/testing-himi-apps.md +4 -3
  52. package/guides/web-page-sdk-reference.md +1 -1
  53. package/guides/webview-page-sdk.md +14 -0
  54. package/guides/wix-business-context.md +24 -0
  55. package/guides/wix-site-to-himi-app.md +2 -1
  56. package/package.json +2 -2
  57. package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +2 -2
  58. package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +5 -8
  59. package/templates/branded-lite/dev/index.ts +35 -0
  60. package/templates/branded-lite/tier5-src/himi-branded-lite-video/index.ts +82 -12
  61. package/templates/branded-lite/tier5-src/himi-store-account/index.ts +2 -2
  62. package/templates/branded-lite/tier5-src/himi-store-product/index.ts +5 -8
  63. package/templates/brandy/README.md +13 -0
  64. package/templates/brandy/config.ts +15 -1
  65. package/templates/brandy/dev/index.ts +10 -7
  66. package/templates/community-club/tier5-src/himi-store-account/index.ts +2 -2
  67. package/templates/conference/tier5-src/himi-store-account/index.ts +2 -2
  68. package/templates/events-meetups/tier5-src/himi-store-account/index.ts +2 -2
  69. package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +2 -2
  70. package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +5 -8
  71. package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +2 -2
  72. package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +2 -2
  73. package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +2 -2
  74. package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +5 -8
  75. package/templates/restaurant/tier5-src/himi-store-account/index.ts +2 -2
  76. package/templates/retail-store/tier5-src/himi-store-account/index.ts +2 -2
  77. package/templates/retail-store/tier5-src/himi-store-product/index.ts +5 -8
  78. package/templates/salon-spa/tier5-src/himi-store-account/index.ts +2 -2
  79. package/templates/wholesale-store/tier5-src/himi-store-account/index.ts +2 -2
  80. package/templates/wholesale-store/tier5-src/himi-store-product/index.ts +5 -8
  81. package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +2 -2
  82. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/attendance-orders.d.ts +0 -10
  83. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/online-programs-orders.d.ts +0 -2
  84. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/pricing-plans-orders.d.ts +0 -2
@@ -673,36 +673,25 @@ var IAP_CATALOG_KINDS = ["onlineProgram", "storesProduct", "pricingPlan", "booki
673
673
 
674
674
  // ../../core/sdk/iap/src/wix-payments-contract.ts
675
675
  var HIMALAYA_SERVE_IAP_ROUTE = { prefix: "/himalaya-serve/v1/iap" };
676
- var BOOKINGS_APPLE_SALES_ENABLED = true;
677
- var EVENTS_APPLE_SALES_ENABLED = true;
678
676
  var ATTENDANCE_SALE_RULE = { appProductId: (id) => id, productType: "CONSUMABLE" };
679
- var STORES_APPLE_SALES_ENABLED = true;
680
677
  var STORES_PRODUCT_SALE_RULE = { appProductId: (id) => id, productType: "NON_CONSUMABLE" };
681
678
  var ONLINE_PROGRAM_SALE_RULE = { appProductId: (id) => id, productType: "NON_CONSUMABLE" };
682
- var PRICING_PLAN_APPLE_SALES_ENABLED = true;
683
679
  var PRICING_PLAN_SALE_RULE = { appProductId: (id) => id, productType: "NON_CONSUMABLE" };
684
680
  var VIDEOS_APPLE_SALES_ENABLED = false;
685
- var PRICING_PLAN_ITEM_PAYMENT_ENABLED = false;
686
- var ONLINE_PROGRAM_ITEM_PAYMENT_ENABLED = false;
687
- var BOOKINGS_ITEM_PAYMENT_ENABLED = false;
688
- var EVENTS_ITEM_PAYMENT_ENABLED = false;
689
- var CANCEL_PAYMENT_ENABLED = false;
690
681
  var VIDEO_SALE_RULE = { appProductId: (id) => id, productType: "NON_CONSUMABLE" };
691
682
  function appleSaleRules(options = {}) {
692
683
  return {
693
684
  onlineProgram: ONLINE_PROGRAM_SALE_RULE,
694
- ...options.storesAppleSalesEnabled ?? STORES_APPLE_SALES_ENABLED ? { storesProduct: STORES_PRODUCT_SALE_RULE } : {},
695
- ...options.pricingPlanAppleSalesEnabled ?? PRICING_PLAN_APPLE_SALES_ENABLED ? { pricingPlan: PRICING_PLAN_SALE_RULE } : {},
696
- ...options.bookingsAppleSalesEnabled ?? BOOKINGS_APPLE_SALES_ENABLED ? { bookingsService: ATTENDANCE_SALE_RULE } : {},
697
- ...options.eventsAppleSalesEnabled ?? EVENTS_APPLE_SALES_ENABLED ? { eventsTicket: ATTENDANCE_SALE_RULE } : {},
685
+ storesProduct: STORES_PRODUCT_SALE_RULE,
686
+ pricingPlan: PRICING_PLAN_SALE_RULE,
687
+ bookingsService: ATTENDANCE_SALE_RULE,
688
+ eventsTicket: ATTENDANCE_SALE_RULE,
698
689
  ...options.videosAppleSalesEnabled ?? VIDEOS_APPLE_SALES_ENABLED ? { wixVideo: VIDEO_SALE_RULE } : {}
699
690
  };
700
691
  }
701
692
  var APPLE_SALE_RULES = appleSaleRules();
702
693
  var APPLE_PROVISIONING_RULES = {
703
694
  ...APPLE_SALE_RULES,
704
- bookingsService: ATTENDANCE_SALE_RULE,
705
- eventsTicket: ATTENDANCE_SALE_RULE,
706
695
  wixVideo: VIDEO_SALE_RULE
707
696
  };
708
697
  var APPLE_PRICING_RULES = { ...APPLE_SALE_RULES, wixVideo: VIDEO_SALE_RULE };
@@ -1480,8 +1469,7 @@ function attendanceCheckoutRoute(item, currency, platform) {
1480
1469
  if (["android", "web"].includes(platform)) return "regular";
1481
1470
  const route = classifyForApple(item, currency);
1482
1471
  if (route === "wixPayments") return "regular";
1483
- const enabled = item.kind === "bookingsService" ? BOOKINGS_APPLE_SALES_ENABLED : EVENTS_APPLE_SALES_ENABLED;
1484
- return platform === "ios" && route === "appleIap" && enabled ? "appleIap" : "blocked";
1472
+ return platform === "ios" && route === "appleIap" ? "appleIap" : "blocked";
1485
1473
  }
1486
1474
  var ADDRESSLESS_CUSTOM = "CUSTOM_WITHOUT_ADDRESS";
1487
1475
  var PHYSICAL_LOCATIONS = ["BUSINESS", "CUSTOMER", "CUSTOM", ADDRESSLESS_CUSTOM];
@@ -1744,19 +1732,10 @@ export {
1744
1732
  APPLE_PRICING_RULES,
1745
1733
  APPLE_PROVISIONING_RULES,
1746
1734
  APPLE_SALE_RULES,
1747
- BOOKINGS_APPLE_SALES_ENABLED,
1748
- BOOKINGS_ITEM_PAYMENT_ENABLED,
1749
- CANCEL_PAYMENT_ENABLED,
1750
- EVENTS_APPLE_SALES_ENABLED,
1751
- EVENTS_ITEM_PAYMENT_ENABLED,
1752
1735
  HIMALAYA_SERVE_IAP_ROUTE,
1753
1736
  IAP_CATALOG_KINDS,
1754
1737
  MAX_AUTOMATIC_ATTEMPTS,
1755
1738
  MAX_RETRY_DELAY_MS,
1756
- ONLINE_PROGRAM_ITEM_PAYMENT_ENABLED,
1757
- PRICING_PLAN_APPLE_SALES_ENABLED,
1758
- PRICING_PLAN_ITEM_PAYMENT_ENABLED,
1759
- STORES_APPLE_SALES_ENABLED,
1760
1739
  STORES_PRODUCT_SALE_RULE,
1761
1740
  VIDEOS_APPLE_SALES_ENABLED,
1762
1741
  appleManagedStore,
@@ -40,7 +40,7 @@ var CAPABILITY_REGISTRY = {
40
40
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
41
41
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
42
42
  "network": ["status", "subscribe"],
43
- "on_device_ai": ["availability", "generateText"],
43
+ "on_device_ai": ["availability", "generateText", "proofreadText", "rewriteText", "summarizeText"],
44
44
  "open_url": ["canOpen", "open"],
45
45
  "pdf": ["isAvailable", "open"],
46
46
  "photos": ["getSavePermissionStatus", "pick", "saveToLibrary"],
@@ -40,7 +40,7 @@ var CAPABILITY_REGISTRY = {
40
40
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
41
41
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
42
42
  "network": ["status", "subscribe"],
43
- "on_device_ai": ["availability", "generateText"],
43
+ "on_device_ai": ["availability", "generateText", "proofreadText", "rewriteText", "summarizeText"],
44
44
  "open_url": ["canOpen", "open"],
45
45
  "pdf": ["isAvailable", "open"],
46
46
  "photos": ["getSavePermissionStatus", "pick", "saveToLibrary"],
@@ -50,10 +50,54 @@ async function generateJson(input) {
50
50
  return null;
51
51
  }
52
52
  }
53
+ function taskResult(r) {
54
+ return {
55
+ success: !!r?.success,
56
+ text: r?.text,
57
+ status: typeof r?.status === "number" ? r.status : r?.success ? 200 : 0,
58
+ error: r?.error,
59
+ engine: r?.engine
60
+ };
61
+ }
62
+ var UNKNOWN_ACTION = /unknown[_ ]?(action|handler)|ActionError\.unknown|^unknown\(|no handler/i;
63
+ async function runTask(pending, fallback) {
64
+ try {
65
+ return taskResult(await pending());
66
+ } catch (e) {
67
+ if (UNKNOWN_ACTION.test(String(e?.message ?? e))) return fallback();
68
+ throw e;
69
+ }
70
+ }
71
+ function viaGenerateText(systemPrompt, text) {
72
+ return generateText({ systemPrompt: `${systemPrompt} Reply with the result only.`, userPrompt: text, responseSchema: {} });
73
+ }
74
+ var REWRITE_HOW = {
75
+ rephrase: "Rephrase the user's text with the same meaning and length.",
76
+ shorter: "Make the user's text shorter while keeping its meaning.",
77
+ elaborate: "Expand the user's text with more detail while keeping its meaning.",
78
+ friendly: "Make the user's text warmer and more casual.",
79
+ professional: "Make the user's text more formal and professional.",
80
+ emojify: "Add fitting emoji to the user's text without changing its words."
81
+ };
82
+ var TEXT_REQUIRED = Object.freeze({ success: false, status: 0, error: "text is required" });
53
83
  async function summarize(text, opts = {}) {
54
- const instruction = opts.instruction ? ` ${opts.instruction}.` : "";
84
+ if (!text?.trim()) return TEXT_REQUIRED;
85
+ if (opts.instruction) return summarizeWithInstruction(text, opts.instruction, opts.taskComplexity ?? "MEDIUM");
86
+ const format = opts.format ?? "paragraph";
87
+ const length = opts.length ?? "medium";
88
+ return runTask(() => dispatch("capability.on_device_ai.summarizeText", { text, format, length }), () => summarizeWithInstruction(text, `${length === "short" ? "In one or two sentences" : length === "long" ? "In detail" : "Briefly"}${format === "bullets" ? ", as a bulleted list" : ""}`, "MEDIUM"));
89
+ }
90
+ async function rewrite(text, style = "rephrase") {
91
+ if (!text?.trim()) return TEXT_REQUIRED;
92
+ return runTask(() => dispatch("capability.on_device_ai.rewriteText", { text, style }), () => viaGenerateText(REWRITE_HOW[style] ?? REWRITE_HOW.rephrase, text));
93
+ }
94
+ async function proofread(text) {
95
+ if (!text?.trim()) return TEXT_REQUIRED;
96
+ return runTask(() => dispatch("capability.on_device_ai.proofreadText", { text }), () => viaGenerateText("Correct the spelling, grammar and punctuation of the user's text without changing its meaning or style.", text));
97
+ }
98
+ async function summarizeWithInstruction(text, instruction, taskComplexity) {
55
99
  const res = await generateText({
56
- systemPrompt: `You are a concise summarizer. Summarize the user's text faithfully.${instruction} Respond ONLY with JSON matching the schema.`,
100
+ systemPrompt: `You are a concise summarizer. Summarize the user's text faithfully. ${instruction}. Respond ONLY with JSON matching the schema.`,
57
101
  userPrompt: text,
58
102
  responseSchema: {
59
103
  type: "object",
@@ -61,7 +105,7 @@ async function summarize(text, opts = {}) {
61
105
  required: ["summary"],
62
106
  additionalProperties: false
63
107
  },
64
- taskComplexity: opts.taskComplexity ?? "MEDIUM"
108
+ taskComplexity
65
109
  });
66
110
  if (!res.success || !res.text) return res;
67
111
  try {
@@ -76,6 +120,8 @@ export {
76
120
  availability,
77
121
  generateJson,
78
122
  generateText,
123
+ proofread,
124
+ rewrite,
79
125
  summarize,
80
126
  version
81
127
  };
@@ -40,7 +40,7 @@ var CAPABILITY_REGISTRY = {
40
40
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
41
41
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
42
42
  "network": ["status", "subscribe"],
43
- "on_device_ai": ["availability", "generateText"],
43
+ "on_device_ai": ["availability", "generateText", "proofreadText", "rewriteText", "summarizeText"],
44
44
  "open_url": ["canOpen", "open"],
45
45
  "pdf": ["isAvailable", "open"],
46
46
  "photos": ["getSavePermissionStatus", "pick", "saveToLibrary"],