@wix/himalaya-cli 0.1306.0 → 0.1307.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 (50) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/wix-gateway.rules.d.ts +5 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/genie-chat/src/index.d.ts +63 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-genie-chat.mjs +81 -0
  4. package/dist/cli.mjs +116 -3
  5. package/guides/sdk-reference.json +36 -0
  6. package/package.json +2 -2
  7. package/templates/beauty-salon-owner/dev/index.ts +15 -27
  8. package/templates/beauty-salon-owner/tier5-src/_shared/aria-chat.ts +293 -12
  9. package/templates/beauty-salon-owner/tier5-src/_shared/aria-stream.ts +165 -0
  10. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-aria/index.ts +26 -2
  11. package/templates/community-club-owner/dev/index.ts +15 -27
  12. package/templates/community-club-owner/tier5-src/_shared/aria-chat.ts +293 -12
  13. package/templates/community-club-owner/tier5-src/_shared/aria-stream.ts +165 -0
  14. package/templates/community-club-owner/tier5-src/himi-owner-lite-aria/index.ts +26 -2
  15. package/templates/events-meetups-owner/dev/index.ts +15 -27
  16. package/templates/events-meetups-owner/tier5-src/_shared/aria-chat.ts +293 -12
  17. package/templates/events-meetups-owner/tier5-src/_shared/aria-stream.ts +165 -0
  18. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-aria/index.ts +26 -2
  19. package/templates/gym-fitness-owner/dev/index.ts +15 -27
  20. package/templates/gym-fitness-owner/tier5-src/_shared/aria-chat.ts +293 -12
  21. package/templates/gym-fitness-owner/tier5-src/_shared/aria-stream.ts +165 -0
  22. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-aria/index.ts +26 -2
  23. package/templates/nonprofit-cause-owner/dev/index.ts +15 -27
  24. package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-chat.ts +293 -12
  25. package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-stream.ts +165 -0
  26. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-aria/index.ts +26 -2
  27. package/templates/owner-lite/dev/index.ts +15 -27
  28. package/templates/owner-lite/tier5-src/_shared/aria-chat.ts +293 -12
  29. package/templates/owner-lite/tier5-src/_shared/aria-stream.ts +165 -0
  30. package/templates/owner-lite/tier5-src/himi-owner-lite-aria/index.ts +26 -2
  31. package/templates/podcast-creator-owner/dev/index.ts +15 -27
  32. package/templates/podcast-creator-owner/tier5-src/_shared/aria-chat.ts +293 -12
  33. package/templates/podcast-creator-owner/tier5-src/_shared/aria-stream.ts +165 -0
  34. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-aria/index.ts +26 -2
  35. package/templates/portfolio-creative-owner/dev/index.ts +15 -27
  36. package/templates/portfolio-creative-owner/tier5-src/_shared/aria-chat.ts +293 -12
  37. package/templates/portfolio-creative-owner/tier5-src/_shared/aria-stream.ts +165 -0
  38. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-aria/index.ts +26 -2
  39. package/templates/restaurant-owner/dev/index.ts +15 -27
  40. package/templates/restaurant-owner/tier5-src/_shared/aria-chat.ts +293 -12
  41. package/templates/restaurant-owner/tier5-src/_shared/aria-stream.ts +165 -0
  42. package/templates/restaurant-owner/tier5-src/himi-owner-lite-aria/index.ts +26 -2
  43. package/templates/retail-store-owner/dev/index.ts +15 -27
  44. package/templates/retail-store-owner/tier5-src/_shared/aria-chat.ts +293 -12
  45. package/templates/retail-store-owner/tier5-src/_shared/aria-stream.ts +165 -0
  46. package/templates/retail-store-owner/tier5-src/himi-owner-lite-aria/index.ts +26 -2
  47. package/templates/yoga-studio-owner/dev/index.ts +15 -27
  48. package/templates/yoga-studio-owner/tier5-src/_shared/aria-chat.ts +293 -12
  49. package/templates/yoga-studio-owner/tier5-src/_shared/aria-stream.ts +165 -0
  50. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-aria/index.ts +26 -2
@@ -34,6 +34,8 @@ import { alert } from "@himalaya/ui";
34
34
  import {
35
35
  activeSiteId,
36
36
  createAriaChat,
37
+ authoredRealtimeUrl,
38
+ stashRealtimeUrl,
37
39
  type AriaActionArg,
38
40
  type AriaChatState,
39
41
  type AriaDictationResult,
@@ -53,6 +55,10 @@ const SERVICE = "himiOwnerLiteAria";
53
55
  // clone's blocking loop, which paints nothing for the length of a turn.
54
56
  const FAST_MS = 2000;
55
57
  const IDLE_MS = 15000;
58
+ // While the realtime stream is delivering a reply, the transcript is only read to
59
+ // CONFIRM the turn ended — the words come from the stream — so the ladder runs at
60
+ // this slower rate. A whole interval with no frame drops it back to FAST_MS.
61
+ const STREAM_MS = 6000;
56
62
 
57
63
  function prompts(): AriaPromptChip[] {
58
64
  return [
@@ -250,7 +256,13 @@ const core = createAriaChat({
250
256
  const screenId = screenForUrl(url, allowedTargets());
251
257
  return screenId ? { screenId } : null;
252
258
  },
253
- poll: { action: `${SERVICE}.tick`, fastMs: FAST_MS, idleMs: IDLE_MS },
259
+ poll: { action: `${SERVICE}.tick`, fastMs: FAST_MS, idleMs: IDLE_MS, streamMs: STREAM_MS },
260
+ // The realtime stream: the reply's words as they are written, plus the quick
261
+ // replies that follow it. Only where the screen was built with a stream url
262
+ // (authored onAppear load params); everywhere else — and wherever the host cannot
263
+ // open it — the turn is polled exactly as before. The screen must declare
264
+ // "stream" for the host to open it at all.
265
+ stream: { url: authoredRealtimeUrl },
254
266
  // Composer dictation, on the platform recognizer: SFSpeechRecognizer,
255
267
  // Android SpeechRecognizer, Web Speech. No audio crosses the bridge — only the
256
268
  // final transcript. An empty language means the device's own locale, which is
@@ -319,6 +331,12 @@ const svc = defineService<AriaChatState, {
319
331
  finishDictation: (s: AriaChatState) => AriaChatState;
320
332
  // `undefined` for a result whose session is no longer the live one — see the core.
321
333
  dictated: (s: AriaChatState, arg?: AriaDictationResult) => AriaChatState | undefined;
334
+ // The realtime stream's callbacks, named by the `_stream` directive the core
335
+ // returns from a send — never by the descriptor. `undefined` from
336
+ // `streamEvent` for the same reason `tick` has it.
337
+ streamEvent: (s: AriaChatState, event?: unknown) => Promise<AriaChatState | undefined>;
338
+ streamEnded: (s: AriaChatState) => AriaChatState;
339
+ streamFailed: (s: AriaChatState, err?: unknown) => AriaChatState;
322
340
  mentionOpen: (s: AriaChatState) => Promise<AriaChatState | undefined>;
323
341
  mentionClose: (s: AriaChatState) => AriaChatState;
324
342
  mentionBack: (s: AriaChatState) => AriaChatState;
@@ -334,7 +352,7 @@ const svc = defineService<AriaChatState, {
334
352
  state: core.initialState,
335
353
  actions: {
336
354
  // `load` is the onAppear dispatch, so it is where the copy pack arrives.
337
- load: (s, arg) => { stashCopy(arg); stashTargets(arg); return core.load(s); },
355
+ load: (s, arg) => { stashCopy(arg); stashTargets(arg); stashRealtimeUrl(arg); return core.load(s); },
338
356
  submit: core.submit,
339
357
  submitPrompt: core.submitPrompt,
340
358
  newChat: core.newChat,
@@ -391,6 +409,12 @@ const svc = defineService<AriaChatState, {
391
409
  attachmentSettled: core.attachmentSettled,
392
410
  removeAttachment: core.removeAttachment,
393
411
  retryAttachment: core.retryAttachment,
412
+ // Dispatched by the HOST as the stream delivers, closes or fails. A name
413
+ // the entry does not export is a callback the host silently drops, and the
414
+ // turn would then be polled with nobody noticing the stream was ignored.
415
+ streamEvent: core.streamEvent,
416
+ streamEnded: core.streamEnded,
417
+ streamFailed: core.streamFailed,
394
418
  },
395
419
  });
396
420