@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.
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/wix-gateway.rules.d.ts +5 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/genie-chat/src/index.d.ts +63 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-genie-chat.mjs +81 -0
- package/dist/cli.mjs +116 -3
- package/guides/sdk-reference.json +36 -0
- package/package.json +2 -2
- package/templates/beauty-salon-owner/dev/index.ts +15 -27
- package/templates/beauty-salon-owner/tier5-src/_shared/aria-chat.ts +293 -12
- package/templates/beauty-salon-owner/tier5-src/_shared/aria-stream.ts +165 -0
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-aria/index.ts +26 -2
- package/templates/community-club-owner/dev/index.ts +15 -27
- package/templates/community-club-owner/tier5-src/_shared/aria-chat.ts +293 -12
- package/templates/community-club-owner/tier5-src/_shared/aria-stream.ts +165 -0
- package/templates/community-club-owner/tier5-src/himi-owner-lite-aria/index.ts +26 -2
- package/templates/events-meetups-owner/dev/index.ts +15 -27
- package/templates/events-meetups-owner/tier5-src/_shared/aria-chat.ts +293 -12
- package/templates/events-meetups-owner/tier5-src/_shared/aria-stream.ts +165 -0
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-aria/index.ts +26 -2
- package/templates/gym-fitness-owner/dev/index.ts +15 -27
- package/templates/gym-fitness-owner/tier5-src/_shared/aria-chat.ts +293 -12
- package/templates/gym-fitness-owner/tier5-src/_shared/aria-stream.ts +165 -0
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-aria/index.ts +26 -2
- package/templates/nonprofit-cause-owner/dev/index.ts +15 -27
- package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-chat.ts +293 -12
- package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-stream.ts +165 -0
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-aria/index.ts +26 -2
- package/templates/owner-lite/dev/index.ts +15 -27
- package/templates/owner-lite/tier5-src/_shared/aria-chat.ts +293 -12
- package/templates/owner-lite/tier5-src/_shared/aria-stream.ts +165 -0
- package/templates/owner-lite/tier5-src/himi-owner-lite-aria/index.ts +26 -2
- package/templates/podcast-creator-owner/dev/index.ts +15 -27
- package/templates/podcast-creator-owner/tier5-src/_shared/aria-chat.ts +293 -12
- package/templates/podcast-creator-owner/tier5-src/_shared/aria-stream.ts +165 -0
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-aria/index.ts +26 -2
- package/templates/portfolio-creative-owner/dev/index.ts +15 -27
- package/templates/portfolio-creative-owner/tier5-src/_shared/aria-chat.ts +293 -12
- package/templates/portfolio-creative-owner/tier5-src/_shared/aria-stream.ts +165 -0
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-aria/index.ts +26 -2
- package/templates/restaurant-owner/dev/index.ts +15 -27
- package/templates/restaurant-owner/tier5-src/_shared/aria-chat.ts +293 -12
- package/templates/restaurant-owner/tier5-src/_shared/aria-stream.ts +165 -0
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-aria/index.ts +26 -2
- package/templates/retail-store-owner/dev/index.ts +15 -27
- package/templates/retail-store-owner/tier5-src/_shared/aria-chat.ts +293 -12
- package/templates/retail-store-owner/tier5-src/_shared/aria-stream.ts +165 -0
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-aria/index.ts +26 -2
- package/templates/yoga-studio-owner/dev/index.ts +15 -27
- package/templates/yoga-studio-owner/tier5-src/_shared/aria-chat.ts +293 -12
- package/templates/yoga-studio-owner/tier5-src/_shared/aria-stream.ts +165 -0
- 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
|
|