@wix/himalaya-cli 0.1928.0 → 0.1930.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 (183) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +2 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +7 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/chat-web/src/index.d.ts +12 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-chat-web.mjs +19 -9
  5. package/dist/browser-plane/assets.json +5 -5
  6. package/dist/browser-plane/preview-deferred/{95a3ae045bad903e458ea7a5800e60e1044f0f754a65d7127de66ba62e897068.bin → 7656e5effbeaee2ab20810b9903e7e785d9dffb0a0563f25c2746011cf4e23e9.bin} +1 -1
  7. package/dist/browser-plane/sw.js +10 -10
  8. package/dist/cli.mjs +256 -70
  9. package/dist/preview-assets.generated.bin +0 -0
  10. package/guides/component-index.md +1 -1
  11. package/guides/component-reference.json +1 -1
  12. package/guides/component-reference.md +7 -0
  13. package/guides/sdk-reference.json +2 -2
  14. package/package.json +2 -2
  15. package/templates/bare-fashion/tier5-src/_shared/owner-load-error.ts +1 -1
  16. package/templates/beauty-salon/tier5-src/_shared/owner-load-error.ts +1 -1
  17. package/templates/beauty-salon-owner/dev/index.ts +169 -139
  18. package/templates/beauty-salon-owner/tier5-src/_shared/owner-load-error.ts +1 -1
  19. package/templates/beauty-salon-owner/tier5-src/_shared/owner-maestro-availability.ts +12 -2
  20. package/templates/beauty-salon-owner/tier5-src/_shared/owner-maestro-tab.ts +81 -5
  21. package/templates/beauty-salon-owner/tier5-src/_shared/owner-selected-site.ts +15 -0
  22. package/templates/beauty-salon-owner/tier5-src/_shared/owner-widget-reads.ts +7 -0
  23. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-home/index.ts +30 -8
  24. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-inbox/index.ts +47 -8
  25. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-inbox-thread/index.ts +12 -5
  26. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-maestro/index.ts +132 -39
  27. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +10 -8
  28. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-order/index.ts +4 -1
  29. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-record/index.ts +7 -1
  30. package/templates/beauty-salon-owner/tier5-src/wix-owner-booking/index.ts +4 -1
  31. package/templates/branded-lite/tier5-src/_shared/owner-load-error.ts +1 -1
  32. package/templates/brandy/tier5-src/_shared/owner-load-error.ts +1 -1
  33. package/templates/community-club/tier5-src/_shared/owner-load-error.ts +1 -1
  34. package/templates/community-club-owner/dev/index.ts +167 -132
  35. package/templates/community-club-owner/tier5-src/_shared/owner-load-error.ts +1 -1
  36. package/templates/community-club-owner/tier5-src/_shared/owner-maestro-availability.ts +12 -2
  37. package/templates/community-club-owner/tier5-src/_shared/owner-maestro-tab.ts +81 -5
  38. package/templates/community-club-owner/tier5-src/_shared/owner-selected-site.ts +15 -0
  39. package/templates/community-club-owner/tier5-src/_shared/owner-widget-reads.ts +7 -0
  40. package/templates/community-club-owner/tier5-src/himi-owner-lite-home/index.ts +30 -8
  41. package/templates/community-club-owner/tier5-src/himi-owner-lite-inbox/index.ts +47 -8
  42. package/templates/community-club-owner/tier5-src/himi-owner-lite-inbox-thread/index.ts +12 -5
  43. package/templates/community-club-owner/tier5-src/himi-owner-lite-maestro/index.ts +132 -39
  44. package/templates/community-club-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +10 -8
  45. package/templates/community-club-owner/tier5-src/himi-owner-lite-order/index.ts +4 -1
  46. package/templates/community-club-owner/tier5-src/himi-owner-lite-record/index.ts +7 -1
  47. package/templates/conference/tier5-src/_shared/owner-load-error.ts +1 -1
  48. package/templates/events-meetups/tier5-src/_shared/owner-load-error.ts +1 -1
  49. package/templates/events-meetups-owner/dev/index.ts +165 -125
  50. package/templates/events-meetups-owner/tier5-src/_shared/owner-load-error.ts +1 -1
  51. package/templates/events-meetups-owner/tier5-src/_shared/owner-maestro-availability.ts +12 -2
  52. package/templates/events-meetups-owner/tier5-src/_shared/owner-maestro-tab.ts +81 -5
  53. package/templates/events-meetups-owner/tier5-src/_shared/owner-selected-site.ts +15 -0
  54. package/templates/events-meetups-owner/tier5-src/_shared/owner-widget-reads.ts +7 -0
  55. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-home/index.ts +30 -8
  56. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-inbox/index.ts +47 -8
  57. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-inbox-thread/index.ts +12 -5
  58. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-maestro/index.ts +132 -39
  59. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +10 -8
  60. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-record/index.ts +7 -1
  61. package/templates/fitness-gym/tier5-src/_shared/owner-load-error.ts +1 -1
  62. package/templates/gym-fitness/tier5-src/_shared/owner-load-error.ts +1 -1
  63. package/templates/gym-fitness-owner/dev/index.ts +169 -139
  64. package/templates/gym-fitness-owner/tier5-src/_shared/owner-load-error.ts +1 -1
  65. package/templates/gym-fitness-owner/tier5-src/_shared/owner-maestro-availability.ts +12 -2
  66. package/templates/gym-fitness-owner/tier5-src/_shared/owner-maestro-tab.ts +81 -5
  67. package/templates/gym-fitness-owner/tier5-src/_shared/owner-selected-site.ts +15 -0
  68. package/templates/gym-fitness-owner/tier5-src/_shared/owner-widget-reads.ts +7 -0
  69. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-home/index.ts +30 -8
  70. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-inbox/index.ts +47 -8
  71. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-inbox-thread/index.ts +12 -5
  72. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-maestro/index.ts +132 -39
  73. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +10 -8
  74. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-order/index.ts +4 -1
  75. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-record/index.ts +7 -1
  76. package/templates/gym-fitness-owner/tier5-src/wix-owner-booking/index.ts +4 -1
  77. package/templates/himi-chat/tier5-src/_shared/owner-load-error.ts +1 -1
  78. package/templates/medical-services/tier5-src/_shared/owner-load-error.ts +1 -1
  79. package/templates/nonprofit-cause/tier5-src/_shared/owner-load-error.ts +1 -1
  80. package/templates/nonprofit-cause-owner/dev/index.ts +167 -132
  81. package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-load-error.ts +1 -1
  82. package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-maestro-availability.ts +12 -2
  83. package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-maestro-tab.ts +81 -5
  84. package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-selected-site.ts +15 -0
  85. package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-widget-reads.ts +7 -0
  86. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-home/index.ts +30 -8
  87. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-inbox/index.ts +47 -8
  88. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-inbox-thread/index.ts +12 -5
  89. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-maestro/index.ts +132 -39
  90. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +10 -8
  91. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-record/index.ts +7 -1
  92. package/templates/nonprofit-cause-owner/tier5-src/wix-owner-booking/index.ts +4 -1
  93. package/templates/owner-lite/dev/index.ts +171 -141
  94. package/templates/owner-lite/himalaya.content.json +1 -1
  95. package/templates/owner-lite/tier5-src/_shared/owner-load-error.ts +1 -1
  96. package/templates/owner-lite/tier5-src/_shared/owner-maestro-availability.ts +12 -2
  97. package/templates/owner-lite/tier5-src/_shared/owner-maestro-tab.ts +81 -5
  98. package/templates/owner-lite/tier5-src/_shared/owner-selected-site.ts +15 -0
  99. package/templates/owner-lite/tier5-src/_shared/owner-widget-reads.ts +7 -0
  100. package/templates/owner-lite/tier5-src/himi-owner-lite-home/index.ts +30 -8
  101. package/templates/owner-lite/tier5-src/himi-owner-lite-inbox/index.ts +47 -8
  102. package/templates/owner-lite/tier5-src/himi-owner-lite-inbox-thread/index.ts +12 -5
  103. package/templates/owner-lite/tier5-src/himi-owner-lite-maestro/index.ts +132 -39
  104. package/templates/owner-lite/tier5-src/himi-owner-lite-maestro-history/index.ts +10 -8
  105. package/templates/owner-lite/tier5-src/himi-owner-lite-order/index.ts +4 -1
  106. package/templates/owner-lite/tier5-src/himi-owner-lite-record/index.ts +7 -1
  107. package/templates/owner-lite/tier5-src/wix-owner-booking/index.ts +4 -1
  108. package/templates/personal-fitness-trainer/tier5-src/_shared/owner-load-error.ts +1 -1
  109. package/templates/podcast-creator/tier5-src/_shared/owner-load-error.ts +1 -1
  110. package/templates/podcast-creator-owner/dev/index.ts +167 -132
  111. package/templates/podcast-creator-owner/tier5-src/_shared/owner-load-error.ts +1 -1
  112. package/templates/podcast-creator-owner/tier5-src/_shared/owner-maestro-availability.ts +12 -2
  113. package/templates/podcast-creator-owner/tier5-src/_shared/owner-maestro-tab.ts +81 -5
  114. package/templates/podcast-creator-owner/tier5-src/_shared/owner-selected-site.ts +15 -0
  115. package/templates/podcast-creator-owner/tier5-src/_shared/owner-widget-reads.ts +7 -0
  116. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-home/index.ts +30 -8
  117. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-inbox/index.ts +47 -8
  118. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-inbox-thread/index.ts +12 -5
  119. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-maestro/index.ts +132 -39
  120. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +10 -8
  121. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-order/index.ts +4 -1
  122. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-record/index.ts +7 -1
  123. package/templates/portfolio-creative/tier5-src/_shared/owner-load-error.ts +1 -1
  124. package/templates/portfolio-creative-owner/dev/index.ts +169 -139
  125. package/templates/portfolio-creative-owner/tier5-src/_shared/owner-load-error.ts +1 -1
  126. package/templates/portfolio-creative-owner/tier5-src/_shared/owner-maestro-availability.ts +12 -2
  127. package/templates/portfolio-creative-owner/tier5-src/_shared/owner-maestro-tab.ts +81 -5
  128. package/templates/portfolio-creative-owner/tier5-src/_shared/owner-selected-site.ts +15 -0
  129. package/templates/portfolio-creative-owner/tier5-src/_shared/owner-widget-reads.ts +7 -0
  130. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-home/index.ts +30 -8
  131. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-inbox/index.ts +47 -8
  132. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-inbox-thread/index.ts +12 -5
  133. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-maestro/index.ts +132 -39
  134. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +10 -8
  135. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-order/index.ts +4 -1
  136. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-record/index.ts +7 -1
  137. package/templates/portfolio-creative-owner/tier5-src/wix-owner-booking/index.ts +4 -1
  138. package/templates/professional-services/tier5-src/_shared/owner-load-error.ts +1 -1
  139. package/templates/restaurant/tier5-src/_shared/owner-load-error.ts +1 -1
  140. package/templates/restaurant-owner/dev/index.ts +169 -139
  141. package/templates/restaurant-owner/tier5-src/_shared/owner-load-error.ts +1 -1
  142. package/templates/restaurant-owner/tier5-src/_shared/owner-maestro-availability.ts +12 -2
  143. package/templates/restaurant-owner/tier5-src/_shared/owner-maestro-tab.ts +81 -5
  144. package/templates/restaurant-owner/tier5-src/_shared/owner-selected-site.ts +15 -0
  145. package/templates/restaurant-owner/tier5-src/_shared/owner-widget-reads.ts +7 -0
  146. package/templates/restaurant-owner/tier5-src/himi-owner-lite-home/index.ts +30 -8
  147. package/templates/restaurant-owner/tier5-src/himi-owner-lite-inbox/index.ts +47 -8
  148. package/templates/restaurant-owner/tier5-src/himi-owner-lite-inbox-thread/index.ts +12 -5
  149. package/templates/restaurant-owner/tier5-src/himi-owner-lite-maestro/index.ts +132 -39
  150. package/templates/restaurant-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +10 -8
  151. package/templates/restaurant-owner/tier5-src/himi-owner-lite-order/index.ts +4 -1
  152. package/templates/restaurant-owner/tier5-src/himi-owner-lite-record/index.ts +7 -1
  153. package/templates/restaurant-owner/tier5-src/wix-owner-booking/index.ts +4 -1
  154. package/templates/retail-store/tier5-src/_shared/owner-load-error.ts +1 -1
  155. package/templates/retail-store-owner/dev/index.ts +167 -132
  156. package/templates/retail-store-owner/tier5-src/_shared/owner-load-error.ts +1 -1
  157. package/templates/retail-store-owner/tier5-src/_shared/owner-maestro-availability.ts +12 -2
  158. package/templates/retail-store-owner/tier5-src/_shared/owner-maestro-tab.ts +81 -5
  159. package/templates/retail-store-owner/tier5-src/_shared/owner-selected-site.ts +15 -0
  160. package/templates/retail-store-owner/tier5-src/_shared/owner-widget-reads.ts +7 -0
  161. package/templates/retail-store-owner/tier5-src/himi-owner-lite-home/index.ts +30 -8
  162. package/templates/retail-store-owner/tier5-src/himi-owner-lite-inbox/index.ts +47 -8
  163. package/templates/retail-store-owner/tier5-src/himi-owner-lite-inbox-thread/index.ts +12 -5
  164. package/templates/retail-store-owner/tier5-src/himi-owner-lite-maestro/index.ts +132 -39
  165. package/templates/retail-store-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +10 -8
  166. package/templates/retail-store-owner/tier5-src/himi-owner-lite-order/index.ts +4 -1
  167. package/templates/retail-store-owner/tier5-src/himi-owner-lite-record/index.ts +7 -1
  168. package/templates/salon-spa/tier5-src/_shared/owner-load-error.ts +1 -1
  169. package/templates/wholesale-store/tier5-src/_shared/owner-load-error.ts +1 -1
  170. package/templates/yoga-studio/tier5-src/_shared/owner-load-error.ts +1 -1
  171. package/templates/yoga-studio-owner/dev/index.ts +167 -132
  172. package/templates/yoga-studio-owner/tier5-src/_shared/owner-load-error.ts +1 -1
  173. package/templates/yoga-studio-owner/tier5-src/_shared/owner-maestro-availability.ts +12 -2
  174. package/templates/yoga-studio-owner/tier5-src/_shared/owner-maestro-tab.ts +81 -5
  175. package/templates/yoga-studio-owner/tier5-src/_shared/owner-selected-site.ts +15 -0
  176. package/templates/yoga-studio-owner/tier5-src/_shared/owner-widget-reads.ts +7 -0
  177. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-home/index.ts +30 -8
  178. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-inbox/index.ts +47 -8
  179. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-inbox-thread/index.ts +12 -5
  180. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-maestro/index.ts +132 -39
  181. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-maestro-history/index.ts +10 -8
  182. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-record/index.ts +7 -1
  183. package/templates/yoga-studio-owner/tier5-src/wix-owner-booking/index.ts +4 -1
@@ -5,10 +5,10 @@
5
5
  // messages itself. Nothing is cached here: storage is shared by everyone who signs in on the
6
6
  // device, and a business id is not an account.
7
7
 
8
- import { formatMonthDay } from "../_shared/engine-intl.js";
8
+ import { formatClock, formatMonthDayTime } from "../_shared/engine-intl.js";
9
9
  import { defineService } from "@himalaya/state";
10
10
  import { copyParam, stashCopy } from "../_shared/himi-copy.js";
11
- import { readSelectedSite } from "../_shared/owner-selected-site.js";
11
+ import { currentBusinessId } from "../_shared/owner-selected-site.js";
12
12
  import { symphonyAccount, type MaestroWixApi } from "../_shared/owner-maestro-availability.js";
13
13
  import { pastChats, type PastChat } from "../_shared/owner-maestro-chat.js";
14
14
 
@@ -17,9 +17,7 @@ const host = (): Host => (globalThis as { himalaya?: Host }).himalaya ?? {};
17
17
 
18
18
  /** The same business the Maestro screen talks about. */
19
19
  function activeSiteId(): string {
20
- const v = host().input?.__himiPreferenceBusiness;
21
- const scoped = typeof v === "string" ? v.trim() : "";
22
- return scoped || readSelectedSite()?.id || "";
20
+ return currentBusinessId();
23
21
  }
24
22
 
25
23
  /** `stamp` marks the list a row was shown in, so opening the same chat from a later list is a new request. */
@@ -53,10 +51,14 @@ function bucketOf(updated: string, now: number): string {
53
51
  return copyParam("ownerMaestroHistory.older", "Older");
54
52
  }
55
53
 
56
- function dayLabel(updated: string): string {
54
+ /** When a chat was last active: the time for one from today, whose rows would otherwise all
55
+ * read the same date; the date and the time for an older one. */
56
+ function whenLabel(updated: string, now: number): string {
57
57
  const at = Date.parse(updated);
58
58
  if (Number.isNaN(at)) return "";
59
- return formatMonthDay(new Date(at));
59
+ const midnight = new Date(now);
60
+ midnight.setHours(0, 0, 0, 0);
61
+ return at >= midnight.getTime() ? formatClock(new Date(at)) : formatMonthDayTime(new Date(at));
60
62
  }
61
63
 
62
64
  /** Rows in the order given, with the bucket named on the first row of each bucket only. */
@@ -66,7 +68,7 @@ function rowsOf(chats: PastChat[], now: number): HistoryRow[] {
66
68
  const bucket = bucketOf(c.updated, now);
67
69
  const section = bucket === last ? "" : bucket;
68
70
  last = bucket;
69
- return { id: c.id, title: c.title || copyParam("ownerMaestroHistory.untitled", "Untitled conversation"), subtitle: dayLabel(c.updated), section, stamp: String(now) };
71
+ return { id: c.id, title: c.title || copyParam("ownerMaestroHistory.untitled", "Untitled conversation"), subtitle: whenLabel(c.updated, now), section, stamp: String(now) };
70
72
  });
71
73
  }
72
74
 
@@ -2,7 +2,7 @@ import { defineService } from '@himalaya/state';
2
2
  import { getOwnerRecord, ownerModuleError, type OwnerRecord } from '../_shared/owner-module-data.js';
3
3
  import { ownerInput, inputOwnerModule, openOwnerDashboard } from '../_shared/owner-module-runtime.js';
4
4
  import { stashCopy, copyParam } from '../_shared/himi-copy.js';
5
- import { askMaestroHidden } from '../_shared/owner-maestro-tab.js';
5
+ import { askMaestroHidden, askMaestroNav } from '../_shared/owner-maestro-tab.js';
6
6
  const moduleId = inputOwnerModule();
7
7
  interface State {
8
8
  /** The record on screen, so the screen can name it to another screen. */
@@ -18,6 +18,12 @@ const svc = defineService('himiOwnerRecord', {
18
18
  state: { id: '', askMaestroHidden: 'true', status: 'loading', title: '', subtitle: '', image: '', noImage: true, statusLabel: '', fields: [], error: '',
19
19
  notLoading: false, notErrored: true, hideContent: true, handoffError: '' } as State,
20
20
  actions: {
21
+ // "Ask Maestro": the chat opens on the Maestro tab, about this record.
22
+ // The screen says what kind of record this is (only a contact's detail has the button). No
23
+ // subject: a contact's title is a person's name, which the Maestro worker reads itself.
24
+ askMaestro(state: State, arg?: unknown): State {
25
+ return askMaestroNav(state, { kind: (arg as { kind?: unknown } | undefined)?.kind, id: state.id });
26
+ },
21
27
  async load(state: State, arg?: unknown): Promise<State | undefined> {
22
28
  stashCopy(arg);
23
29
  const revision = ++generation;
@@ -13,7 +13,7 @@ import { formatWeekdayDateTime } from "../_shared/engine-intl.js";
13
13
  import { ownerLoadError, isBridgeUnavailable, isOwnerPreviewDemo } from "../_shared/owner-load-error.js";
14
14
  import { DEMO_APPOINTMENTS, DEMO_NOTE, demoAppointmentWindow } from "../_shared/owner-preview-demo.js";
15
15
  import { copyParam } from "../_shared/himi-copy.js";
16
- import { askMaestroHidden } from "../_shared/owner-maestro-tab.js";
16
+ import { askMaestroHidden, askMaestroNav } from "../_shared/owner-maestro-tab.js";
17
17
 
18
18
  interface ActionRow { id: string; label: string; action: string; url: string; screen: string; title: string; }
19
19
  interface KV { id: string; label: string; value: string; }
@@ -206,9 +206,12 @@ const svc = defineService<BookingState, {
206
206
  markPaid: (s: BookingState) => Promise<BookingState>;
207
207
  setAttended: (s: BookingState) => Promise<BookingState>;
208
208
  setNoShow: (s: BookingState) => Promise<BookingState>;
209
+ askMaestro: (s: BookingState) => BookingState;
209
210
  }>("ownerBooking", {
210
211
  state: { id: "", askMaestroHidden: "true", status: "loading", title: "", subtitle: "", initial: "?", when: "—", ends: "—", participants: "—", email: "—", phone: "—", staff: "—", location: "", locationHeader: "", videoLabel: "", videoUrl: "", intakeHeader: "", intake: "", actions: [], bookingStatus: "—", payment: "—", statusRaw: "", paymentRaw: "", orderId: "", isClass: false, attendedRaw: false, hideConfirm: true, hideMarkPaid: true, hideAttendance: true, hideDecline: true, hideCancel: true, revision: "", actionError: "", error: "", demoNote: "", notDemo: true },
211
212
  actions: {
213
+ // "Ask Maestro": the chat opens on the Maestro tab, about this booking.
214
+ askMaestro: (s) => askMaestroNav(s, { kind: "booking", id: s.id, subject: s.title }),
212
215
  load: async (s) => {
213
216
  try { return { ...(await fetchInto(s)), id: bookingId(), askMaestroHidden: askMaestroHidden() }; }
214
217
  catch (e) {
@@ -13104,13 +13104,9 @@ const SCREENS = runtimeSetting({
13104
13104
  "fullWidth": true,
13105
13105
  "leadingIcon": "ai",
13106
13106
  "action": {
13107
- "actionId": "himi.open",
13107
+ "actionId": "tier5.himiOwnerRecord.askMaestro",
13108
13108
  "params": {
13109
- "screenId": "himi_owner_lite_maestro",
13110
- "kind": "contact",
13111
- "id": "$service:himiOwnerRecord.id",
13112
- "title": "Maestro",
13113
- "subtitle": "Your business assistant, by Symphony."
13109
+ "kind": "contact"
13114
13110
  }
13115
13111
  }
13116
13112
  }
@@ -56598,7 +56594,7 @@ const SCREENS = runtimeSetting({
56598
56594
  "himi_owner_lite_ask": {
56599
56595
  "screenId": "himi_owner_lite_ask",
56600
56596
  "renderer": "sdui_intent",
56601
- "title": "Ask about your business",
56597
+ "title": "Ask your records",
56602
56598
  "schemaVersion": 1,
56603
56599
  "cacheControl": {
56604
56600
  "maxAge": 0,
@@ -56620,7 +56616,7 @@ const SCREENS = runtimeSetting({
56620
56616
  "package": "himalaya",
56621
56617
  "type": "Text",
56622
56618
  "props": {
56623
- "text": "Get an answer laid out from your own records. For help with Wix itself, ask Aria.",
56619
+ "text": "Get an answer laid out from your own records. For anything else, use the assistant tab.",
56624
56620
  "style": "footnote",
56625
56621
  "color": "textSecondary"
56626
56622
  }
@@ -57288,6 +57284,9 @@ const SCREENS = runtimeSetting({
57288
57284
  ],
57289
57285
  "minBinaryVersion": "0.1.0",
57290
57286
  "bundleVersion": "0.0.1"
57287
+ },
57288
+ "topBar": {
57289
+ "actions": []
57291
57290
  }
57292
57291
  },
57293
57292
  "himi_owner_lite_brief": {
@@ -64163,6 +64162,22 @@ const SCREENS = runtimeSetting({
64163
64162
  "collapseWhenEmpty": true
64164
64163
  }
64165
64164
  }
64165
+ },
64166
+ {
64167
+ "id": "himi_owner_lite_maestro.context",
64168
+ "body": {
64169
+ "package": "himalaya",
64170
+ "type": "Text",
64171
+ "props": {
64172
+ "text": "$service:himiOwnerLiteMaestro.contextLabel",
64173
+ "style": "footnote",
64174
+ "color": "textSecondary",
64175
+ "maxLines": 1
64176
+ }
64177
+ },
64178
+ "modifiers": {
64179
+ "hiddenPath": "$service:himiOwnerLiteMaestro.contextHidden"
64180
+ }
64166
64181
  }
64167
64182
  ]
64168
64183
  }
@@ -64426,16 +64441,32 @@ const SCREENS = runtimeSetting({
64426
64441
  "package": "himalaya",
64427
64442
  "type": "Text",
64428
64443
  "props": {
64429
- "text": "Working on it…",
64444
+ "text": "$item.content",
64430
64445
  "style": "footnote",
64431
64446
  "color": "textSecondary",
64432
- "maxLines": 1
64447
+ "maxLines": 2
64433
64448
  }
64434
64449
  },
64435
64450
  "modifiers": {
64436
64451
  "hiddenPath": "$item.thinkingHidden"
64437
64452
  }
64438
64453
  },
64454
+ {
64455
+ "id": "",
64456
+ "body": {
64457
+ "package": "himalaya",
64458
+ "type": "Text",
64459
+ "props": {
64460
+ "text": "$item.content",
64461
+ "style": "footnote",
64462
+ "color": "textSecondary",
64463
+ "maxLines": 3
64464
+ }
64465
+ },
64466
+ "modifiers": {
64467
+ "hiddenPath": "$item.noteHidden"
64468
+ }
64469
+ },
64439
64470
  {
64440
64471
  "id": "himi_owner_lite_maestro.card_$item.id",
64441
64472
  "body": {
@@ -64626,6 +64657,7 @@ const SCREENS = runtimeSetting({
64626
64657
  "top": 18,
64627
64658
  "bottom": 24
64628
64659
  },
64660
+ "keyboardDismiss": "tap",
64629
64661
  "onAppear": {
64630
64662
  "actionId": "tier5.himiOwnerLiteMaestro.load"
64631
64663
  }
@@ -64644,88 +64676,34 @@ const SCREENS = runtimeSetting({
64644
64676
  "minBinaryVersion": "0.1.0",
64645
64677
  "bundleVersion": "0.0.1"
64646
64678
  },
64647
- "stickyHeader": {
64648
- "id": "himi_owner_lite_maestro.controls",
64649
- "body": {
64650
- "package": "himalaya",
64651
- "type": "HStack",
64652
- "props": {
64653
- "spacing": 8,
64654
- "children": [
64655
- {
64656
- "id": "himi_owner_lite_maestro.context",
64657
- "body": {
64658
- "package": "himalaya",
64659
- "type": "Text",
64660
- "props": {
64661
- "text": "$service:himiOwnerLiteMaestro.contextLabel",
64662
- "style": "footnote",
64663
- "color": "textSecondary",
64664
- "maxLines": 1,
64665
- "collapseWhenEmpty": true
64666
- }
64667
- }
64668
- },
64669
- {
64670
- "id": "",
64671
- "body": {
64672
- "package": "himalaya",
64673
- "type": "Spacer",
64674
- "props": {}
64675
- }
64676
- },
64677
- {
64678
- "id": "himi_owner_lite_maestro.history",
64679
- "body": {
64680
- "package": "himalaya",
64681
- "type": "Button",
64682
- "props": {
64683
- "title": "History",
64684
- "style": "link",
64685
- "size": "sm",
64686
- "fullWidth": false,
64687
- "action": {
64688
- "actionId": "himi.open",
64689
- "params": {
64690
- "screenId": "himi_owner_lite_maestro_history",
64691
- "title": "Conversations",
64692
- "subtitle": "Pick up where you left off."
64693
- }
64694
- }
64695
- }
64696
- }
64697
- },
64698
- {
64699
- "id": "himi_owner_lite_maestro.newChat",
64700
- "body": {
64701
- "package": "himalaya",
64702
- "type": "Button",
64703
- "props": {
64704
- "title": "New chat",
64705
- "style": "link",
64706
- "size": "sm",
64707
- "fullWidth": false,
64708
- "action": {
64709
- "actionId": "tier5.himiOwnerLiteMaestro.newChat"
64710
- }
64711
- }
64712
- }
64679
+ "topBar": {
64680
+ "actions": [
64681
+ {
64682
+ "id": "himi_owner_lite_maestro.history",
64683
+ "icon": "clock",
64684
+ "accessibilityLabel": "History",
64685
+ "onTap": {
64686
+ "actionId": "himi.open",
64687
+ "params": {
64688
+ "screenId": "himi_owner_lite_maestro_history",
64689
+ "title": "Conversations",
64690
+ "subtitle": "Pick up where you left off."
64713
64691
  }
64714
- ]
64715
- }
64716
- },
64717
- "modifiers": {
64718
- "background": {
64719
- "token": "surfacePrimary"
64720
- },
64721
- "padding": {
64722
- "leading": 16,
64723
- "trailing": 16,
64724
- "top": 4,
64725
- "bottom": 4
64692
+ },
64693
+ "hiddenPath": "$service:himiOwnerLiteMaestro.chatHidden",
64694
+ "hiddenPathScope": "screen"
64726
64695
  },
64727
- "hiddenPath": "$service:himiOwnerLiteMaestro.chatHidden"
64728
- }
64696
+ {
64697
+ "id": "himi_owner_lite_maestro.newChat",
64698
+ "icon": "edit",
64699
+ "accessibilityLabel": "New chat",
64700
+ "onTap": {
64701
+ "actionId": "tier5.himiOwnerLiteMaestro.newChat"
64702
+ },
64703
+ "hiddenPath": "$service:himiOwnerLiteMaestro.chatHidden",
64704
+ "hiddenPathScope": "screen"
64705
+ }
64706
+ ]
64729
64707
  },
64730
64708
  "stickyFooter": {
64731
64709
  "id": "himi_owner_lite_maestro.composer",
@@ -64823,50 +64801,111 @@ const SCREENS = runtimeSetting({
64823
64801
  }
64824
64802
  },
64825
64803
  {
64826
- "id": "form_maestro",
64804
+ "id": "",
64827
64805
  "body": {
64828
64806
  "package": "himalaya",
64829
- "type": "Form",
64807
+ "type": "HStack",
64830
64808
  "props": {
64831
- "id": "maestro",
64832
- "fields": [
64809
+ "spacing": 8,
64810
+ "alignment": "trailing",
64811
+ "children": [
64833
64812
  {
64834
- "id": "field_message",
64813
+ "id": "himi_owner_lite_maestro.input",
64835
64814
  "body": {
64836
64815
  "package": "himalaya",
64837
- "type": "FormField",
64816
+ "type": "TextField",
64838
64817
  "props": {
64839
- "id": "message",
64840
- "label": "",
64841
- "kind": "text",
64842
- "text": {
64843
- "value": "$service:himiOwnerLiteMaestro.input",
64844
- "placeholder": "Ask Maestro…",
64845
- "keyboard": "default",
64846
- "autoCapitalization": "sentences",
64847
- "multilineMaxLines": 4,
64848
- "onChange": {
64849
- "actionId": "tier5.himiOwnerLiteMaestro.setInput"
64850
- }
64851
- }
64818
+ "valuePath": "$service:himiOwnerLiteMaestro.input",
64819
+ "placeholder": "Ask Maestro…",
64820
+ "keyboard": "default",
64821
+ "autoCapitalization": "sentences",
64822
+ "multilineMaxLines": 4,
64823
+ "maxLength": 4000,
64824
+ "onChange": {
64825
+ "actionId": "tier5.himiOwnerLiteMaestro.setInput"
64826
+ },
64827
+ "borderless": true
64828
+ }
64829
+ },
64830
+ "modifiers": {
64831
+ "weight": 1,
64832
+ "accessibilityLabel": "Ask Maestro…",
64833
+ "background": {
64834
+ "token": "surfaceSecondary"
64835
+ },
64836
+ "cornerRadius": 22,
64837
+ "padding": {
64838
+ "leading": 16,
64839
+ "trailing": 12,
64840
+ "top": 11,
64841
+ "bottom": 11
64852
64842
  }
64853
64843
  }
64854
- }
64855
- ],
64856
- "submitButton": {
64857
- "id": "himi_owner_lite_maestro.send",
64858
- "body": {
64859
- "package": "himalaya",
64860
- "type": "Button",
64861
- "props": {
64862
- "title": "Send",
64863
- "style": "primary",
64864
- "action": {
64865
- "actionId": "tier5.himiOwnerLiteMaestro.submit"
64844
+ },
64845
+ {
64846
+ "id": "",
64847
+ "body": {
64848
+ "package": "himalaya",
64849
+ "type": "ZStack",
64850
+ "props": {
64851
+ "alignment": "center",
64852
+ "children": [
64853
+ {
64854
+ "id": "himi_owner_lite_maestro.send_off",
64855
+ "body": {
64856
+ "package": "himalaya",
64857
+ "type": "Icon",
64858
+ "props": {
64859
+ "name": "send",
64860
+ "size": 20,
64861
+ "tint": "textTertiary"
64862
+ }
64863
+ },
64864
+ "modifiers": {
64865
+ "accessibilityRole": "decorative",
64866
+ "width": 44,
64867
+ "height": 44,
64868
+ "cornerRadius": 22,
64869
+ "background": {
64870
+ "token": "surfaceSecondary"
64871
+ }
64872
+ }
64873
+ },
64874
+ {
64875
+ "id": "himi_owner_lite_maestro.send",
64876
+ "body": {
64877
+ "package": "himalaya",
64878
+ "type": "Icon",
64879
+ "props": {
64880
+ "name": "send",
64881
+ "size": 20,
64882
+ "tint": "textOnAccent"
64883
+ }
64884
+ },
64885
+ "modifiers": {
64886
+ "accessibilityRole": "button",
64887
+ "width": 44,
64888
+ "height": 44,
64889
+ "cornerRadius": 22,
64890
+ "background": {
64891
+ "token": "accentPrimary"
64892
+ },
64893
+ "accessibilityLabel": "Send",
64894
+ "onTap": {
64895
+ "actionId": "tier5.himiOwnerLiteMaestro.submit"
64896
+ },
64897
+ "hiddenPath": "$service:himiOwnerLiteMaestro.noInput"
64898
+ }
64899
+ }
64900
+ ]
64866
64901
  }
64902
+ },
64903
+ "modifiers": {
64904
+ "width": 44,
64905
+ "height": 44
64867
64906
  }
64868
64907
  }
64869
- }
64908
+ ]
64870
64909
  }
64871
64910
  }
64872
64911
  }
@@ -64893,8 +64932,7 @@ const SCREENS = runtimeSetting({
64893
64932
  },
64894
64933
  "hostTitle": {
64895
64934
  "title": "Maestro",
64896
- "subtitle": "Your business assistant, by Symphony.",
64897
- "replaces": "himi_owner_lite_maestro.header"
64935
+ "replaces": "himi_owner_lite_maestro.header.title"
64898
64936
  }
64899
64937
  },
64900
64938
  "himi_owner_lite_maestro_history": {
@@ -65031,7 +65069,7 @@ const SCREENS = runtimeSetting({
65031
65069
  "package": "himalaya",
65032
65070
  "type": "Icon",
65033
65071
  "props": {
65034
- "name": "edit",
65072
+ "name": "chat",
65035
65073
  "size": 20,
65036
65074
  "tint": "accentPrimary"
65037
65075
  }
@@ -65117,8 +65155,7 @@ const SCREENS = runtimeSetting({
65117
65155
  "screenId": "himi_owner_lite_maestro",
65118
65156
  "conversationId": "$item.id",
65119
65157
  "n": "$item.stamp",
65120
- "title": "Maestro",
65121
- "subtitle": "Your business assistant, by Symphony."
65158
+ "title": "Maestro"
65122
65159
  }
65123
65160
  }
65124
65161
  }
@@ -65206,6 +65243,9 @@ const SCREENS = runtimeSetting({
65206
65243
  "minBinaryVersion": "0.1.0",
65207
65244
  "bundleVersion": "0.0.1"
65208
65245
  },
65246
+ "topBar": {
65247
+ "actions": []
65248
+ },
65209
65249
  "hostTitle": {
65210
65250
  "title": "Conversations",
65211
65251
  "subtitle": "Pick up where you left off.",
@@ -88418,14 +88458,9 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
88418
88458
  "fullWidth": true,
88419
88459
  "leadingIcon": "ai",
88420
88460
  "action": {
88421
- "actionId": "himi.open",
88461
+ "actionId": "tier5.himiOwnerLiteOrder.askMaestro",
88422
88462
  "params": {
88423
- "screenId": "himi_owner_lite_maestro",
88424
- "kind": "order",
88425
- "id": "$service:himiOwnerLiteOrder.id",
88426
- "subject": "$service:himiOwnerLiteOrder.title",
88427
- "title": "Maestro",
88428
- "subtitle": "Your business assistant, by Symphony."
88463
+ "kind": "order"
88429
88464
  }
88430
88465
  }
88431
88466
  }
@@ -93379,14 +93414,9 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
93379
93414
  "fullWidth": true,
93380
93415
  "leadingIcon": "ai",
93381
93416
  "action": {
93382
- "actionId": "himi.open",
93417
+ "actionId": "tier5.ownerBooking.askMaestro",
93383
93418
  "params": {
93384
- "screenId": "himi_owner_lite_maestro",
93385
- "kind": "booking",
93386
- "id": "$service:ownerBooking.id",
93387
- "subject": "$service:ownerBooking.title",
93388
- "title": "Maestro",
93389
- "subtitle": "Your business assistant, by Symphony."
93419
+ "kind": "booking"
93390
93420
  }
93391
93421
  }
93392
93422
  }
@@ -23,7 +23,7 @@
23
23
  "displayName": "Aria History"
24
24
  },
25
25
  "himi_owner_lite_ask": {
26
- "displayName": "Ask about your business"
26
+ "displayName": "Ask your records"
27
27
  },
28
28
  "himi_owner_lite_booking": {
29
29
  "displayName": "Booking"
@@ -146,7 +146,7 @@ const CODED = /HTTP (\d{3}) \[([A-Z0-9_]+)\]/;
146
146
  * `HTTP 428 [MISSING_METASITE_ID]: Couldn't extract metasiteId from the request
147
147
  * context` where "6 orders" belongs.
148
148
  */
149
- const SITE_CONTEXT_CODES = ["MISSING_METASITE_ID", "MISSING_REQUEST_SITE_CONTEXT", "MISSING_SITE_CONTEXT"];
149
+ export const SITE_CONTEXT_CODES = ["MISSING_METASITE_ID", "MISSING_REQUEST_SITE_CONTEXT", "MISSING_SITE_CONTEXT"];
150
150
  /** Longest raw upstream text worth showing. Beyond this it stops being a
151
151
  * message and starts being a payload dump. */
152
152
  const MAX_RAW = 200;
@@ -28,9 +28,19 @@ export async function symphonyAccount(api: MaestroWixApi): Promise<string> {
28
28
  return typeof id === "string" ? id.trim() : "";
29
29
  }
30
30
 
31
+ /** The account's Spaces. Throws when they could not be asked.
32
+ *
33
+ * Not asked a second time here after a refusal. The first call a run makes for the Symphony
34
+ * account can answer 403 (measured live 2026-11-28), but a worker has no timer to wait with, and
35
+ * the host remembers a credential it could not get for ten seconds, so an immediate second ask
36
+ * is refused the same way. The caller asks again on its own schedule. */
37
+ async function readSpaces(api: MaestroWixApi, account: string): Promise<Spaces | null> {
38
+ return (await api.call("POST", SPACES, {}, forSymphonyAccount(account))) as Spaces | null;
39
+ }
40
+
31
41
  /** Whether `site` is the website of one of the owner's Spaces. Throws when it could not be asked. */
32
42
  export async function isSpaceWebsite(api: MaestroWixApi, account: string, site: string): Promise<boolean> {
33
- const res = (await api.call("POST", SPACES, {}, forSymphonyAccount(account))) as Spaces | null;
43
+ const res = await readSpaces(api, account);
34
44
  return (res?.workspaces ?? []).some((w) => w?.website?.metaSiteId === site);
35
45
  }
36
46
 
@@ -45,7 +55,7 @@ export interface SpaceWebsite { id: string; name: string; space: string }
45
55
  export async function spaceWebsites(api: MaestroWixApi): Promise<SpaceWebsite[]> {
46
56
  const account = await symphonyAccount(api);
47
57
  if (!account) return [];
48
- const res = (await api.call("POST", SPACES, {}, forSymphonyAccount(account))) as Spaces | null;
58
+ const res = await readSpaces(api, account);
49
59
  const out: SpaceWebsite[] = [];
50
60
  for (const w of res?.workspaces ?? []) {
51
61
  const id = typeof w?.website?.metaSiteId === "string" ? w.website.metaSiteId.trim() : "";