@wix/himalaya-cli 0.1015.0 → 0.1016.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/builder.d.ts +67 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/state/src/index.d.ts +45 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +18 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +7 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/genie-chat/src/index.d.ts +51 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +21 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +79 -6
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-genie-chat.mjs +23 -0
- package/dist/cli.mjs +1225 -645
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/component-reference.json +1 -1
- package/guides/component-reference.md +25 -9
- package/guides/designing-himi-screens.md +6 -4
- package/guides/headless-loop.md +1 -0
- package/guides/sdk-reference.json +47 -5
- package/guides/tier-5-add-a-screen.md +40 -13
- package/guides/wix-api-usage.md +9 -0
- package/package.json +2 -2
- package/templates/beauty-salon/dev/index.ts +252 -7
- package/templates/beauty-salon/tier5-src/himi-booking-bookings/index.ts +5 -2
- package/templates/beauty-salon-owner/config.ts +1 -1
- package/templates/beauty-salon-owner/dev/index.ts +419 -2
- package/templates/beauty-salon-owner/tier5-src/_shared/aria-chat.ts +226 -9
- package/templates/beauty-salon-owner/tier5-src/_shared/aria-client-tools.ts +234 -0
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-aria/index.ts +40 -0
- package/templates/branded-lite/dev/index.ts +487 -14
- package/templates/branded-lite/tier5-src/himi-booking-bookings/index.ts +5 -2
- package/templates/community-club/dev/index.ts +196 -13
- package/templates/community-club-owner/config.ts +1 -1
- package/templates/community-club-owner/dev/index.ts +402 -2
- package/templates/community-club-owner/tier5-src/_shared/aria-chat.ts +226 -9
- package/templates/community-club-owner/tier5-src/_shared/aria-client-tools.ts +234 -0
- package/templates/community-club-owner/tier5-src/himi-owner-lite-aria/index.ts +40 -0
- package/templates/events-meetups/dev/index.ts +196 -13
- package/templates/events-meetups-owner/config.ts +1 -1
- package/templates/events-meetups-owner/dev/index.ts +348 -2
- package/templates/events-meetups-owner/tier5-src/_shared/aria-chat.ts +226 -9
- package/templates/events-meetups-owner/tier5-src/_shared/aria-client-tools.ts +234 -0
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-aria/index.ts +40 -0
- package/templates/gym-fitness/dev/index.ts +324 -12
- package/templates/gym-fitness/tier5-src/himi-booking-bookings/index.ts +5 -2
- package/templates/gym-fitness-owner/config.ts +1 -1
- package/templates/gym-fitness-owner/dev/index.ts +440 -2
- package/templates/gym-fitness-owner/tier5-src/_shared/aria-chat.ts +226 -9
- package/templates/gym-fitness-owner/tier5-src/_shared/aria-client-tools.ts +234 -0
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-aria/index.ts +40 -0
- package/templates/himi-chat/dev/index.ts +2 -2
- package/templates/nonprofit-cause/dev/index.ts +212 -13
- package/templates/nonprofit-cause-owner/config.ts +1 -1
- package/templates/nonprofit-cause-owner/dev/index.ts +386 -2
- package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-chat.ts +226 -9
- package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-client-tools.ts +234 -0
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-aria/index.ts +40 -0
- package/templates/owner-lite/config.ts +1 -1
- package/templates/owner-lite/dev/index.ts +446 -2
- package/templates/owner-lite/tier5-src/_shared/aria-chat.ts +226 -9
- package/templates/owner-lite/tier5-src/_shared/aria-client-tools.ts +234 -0
- package/templates/owner-lite/tier5-src/himi-owner-lite-aria/index.ts +40 -0
- package/templates/podcast-creator/dev/index.ts +206 -13
- package/templates/podcast-creator-owner/config.ts +1 -1
- package/templates/podcast-creator-owner/dev/index.ts +402 -2
- package/templates/podcast-creator-owner/tier5-src/_shared/aria-chat.ts +226 -9
- package/templates/podcast-creator-owner/tier5-src/_shared/aria-client-tools.ts +234 -0
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-aria/index.ts +40 -0
- package/templates/portfolio-creative/dev/index.ts +249 -11
- package/templates/portfolio-creative-owner/config.ts +1 -1
- package/templates/portfolio-creative-owner/dev/index.ts +419 -2
- package/templates/portfolio-creative-owner/tier5-src/_shared/aria-chat.ts +226 -9
- package/templates/portfolio-creative-owner/tier5-src/_shared/aria-client-tools.ts +234 -0
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-aria/index.ts +40 -0
- package/templates/restaurant/dev/index.ts +219 -11
- package/templates/restaurant-owner/config.ts +1 -1
- package/templates/restaurant-owner/dev/index.ts +440 -2
- package/templates/restaurant-owner/tier5-src/_shared/aria-chat.ts +226 -9
- package/templates/restaurant-owner/tier5-src/_shared/aria-client-tools.ts +234 -0
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-aria/index.ts +40 -0
- package/templates/retail-store/dev/index.ts +159 -6
- package/templates/retail-store-owner/config.ts +1 -1
- package/templates/retail-store-owner/dev/index.ts +381 -2
- package/templates/retail-store-owner/tier5-src/_shared/aria-chat.ts +226 -9
- package/templates/retail-store-owner/tier5-src/_shared/aria-client-tools.ts +234 -0
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-aria/index.ts +40 -0
- package/templates/yoga-studio/dev/index.ts +284 -12
- package/templates/yoga-studio/tier5-src/himi-booking-bookings/index.ts +5 -2
- package/templates/yoga-studio-owner/config.ts +1 -1
- package/templates/yoga-studio-owner/dev/index.ts +386 -2
- package/templates/yoga-studio-owner/tier5-src/_shared/aria-chat.ts +226 -9
- package/templates/yoga-studio-owner/tier5-src/_shared/aria-client-tools.ts +234 -0
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-aria/index.ts +40 -0
|
@@ -185,6 +185,11 @@ export declare function emptyState(props: {
|
|
|
185
185
|
export declare function appIntent(pkg: string, type: string, props: unknown, opts?: {
|
|
186
186
|
id?: string;
|
|
187
187
|
}): Component;
|
|
188
|
+
/** RFC 0058 §3.3 — an `image` with a `contentDescription` is an IMAGE the tree
|
|
189
|
+
* announces; without one it is DECORATIVE. Both are correct answers and the
|
|
190
|
+
* choice is the author's, but `contentDescription: ""` spells the second one
|
|
191
|
+
* ambiguously — it reads as an unfinished name rather than a decision. Pass
|
|
192
|
+
* `decorative: true` to say it out loud (`modifiers.accessibilityRole`). */
|
|
188
193
|
export declare function image(props: {
|
|
189
194
|
url?: string;
|
|
190
195
|
asset?: string;
|
|
@@ -194,6 +199,10 @@ export declare function image(props: {
|
|
|
194
199
|
height?: number;
|
|
195
200
|
fillWidth?: boolean;
|
|
196
201
|
contentDescription?: string;
|
|
202
|
+
/** Declare the image purely presentational — it leaves the accessibility
|
|
203
|
+
* tree instead of being announced. Mutually exclusive with a non-empty
|
|
204
|
+
* `contentDescription`. */
|
|
205
|
+
decorative?: boolean;
|
|
197
206
|
contentMode?: "fit" | "fill" | "stretch";
|
|
198
207
|
shape?: "rect" | "rounded" | "circle";
|
|
199
208
|
aspectRatio?: number;
|
|
@@ -206,11 +215,66 @@ export declare function divider(opts?: {
|
|
|
206
215
|
}): Component;
|
|
207
216
|
/** Vector icon from the design system's named set (search, trash,
|
|
208
217
|
* chevron_right, more, plus, person, circle_fill, …). Resolves to an SF
|
|
209
|
-
* Symbol on iOS / Material icon on Android.
|
|
218
|
+
* Symbol on iOS / Material icon on Android.
|
|
219
|
+
*
|
|
220
|
+
* RFC 0058 §3.3 — an icon owes the accessibility tree exactly one of two
|
|
221
|
+
* answers, and both are spellable here:
|
|
222
|
+
*
|
|
223
|
+
* • `decorative: true` → `modifiers.accessibilityRole: "decorative"`. The glyph
|
|
224
|
+
* beside a word, the chevron at the end of a row, the monogram behind a
|
|
225
|
+
* missing photo. The node stops being an accessibility element while its
|
|
226
|
+
* subtree stays traversable. This is the RIGHT answer for most icons — a
|
|
227
|
+
* screen reader announcing "chevron right" is worse than one that skips it,
|
|
228
|
+
* so a name invented for a glyph is a regression that also passes a counter.
|
|
229
|
+
* • `contentDescription: "…"` → `IconProps.contentDescription`. The name for a
|
|
230
|
+
* glyph that carries meaning nothing beside it repeats.
|
|
231
|
+
*
|
|
232
|
+
* Passing both is a contradiction and throws. Passing neither leaves the role
|
|
233
|
+
* UNSPECIFIED and lets each renderer infer (§3.3) — which is what the exemplar
|
|
234
|
+
* apps stopped doing, because "inferred on three arms" is the shape every a11y
|
|
235
|
+
* bug in the RFC's audit had. */
|
|
210
236
|
export declare function icon(name: string, opts?: {
|
|
211
237
|
id?: string;
|
|
212
238
|
size?: number;
|
|
213
239
|
tint?: string;
|
|
240
|
+
contentDescription?: string;
|
|
241
|
+
decorative?: boolean;
|
|
242
|
+
}): Component;
|
|
243
|
+
/**
|
|
244
|
+
* An icon-only tap target that CANNOT be built without a name.
|
|
245
|
+
*
|
|
246
|
+
* Promoted from the two places that had independently discovered the shape:
|
|
247
|
+
* `apps/msgr/dev/index.ts` (whose local helper folds the label into `title` so
|
|
248
|
+
* "one string, no way to ship one without the other") and `tip-calc`'s
|
|
249
|
+
* `iconButton`, which takes `accessibilityLabel` as a required parameter. This
|
|
250
|
+
* is the shared version, and `accessibilityLabel` is required by the TYPE as
|
|
251
|
+
* well as checked at build time — an omitted name is a compile error, an empty
|
|
252
|
+
* one is a thrown error, and neither reaches a descriptor.
|
|
253
|
+
*
|
|
254
|
+
* A `Button` with `iconOnly: true`, NOT an `Icon` in a tappable container. Both
|
|
255
|
+
* draw the same circle, but a container carrying `modifiers.accessibilityLabel`
|
|
256
|
+
* emits no accessible name on web (measured in msgr's composer), while
|
|
257
|
+
* `ButtonProps.title` is non-optional in the native schema precisely because it
|
|
258
|
+
* doubles as the name. The glyph rides in `leadingIcon`, so there is no second
|
|
259
|
+
* node for a screen reader to announce.
|
|
260
|
+
*/
|
|
261
|
+
export declare function iconButton(props: {
|
|
262
|
+
/** The glyph — `leadingIcon`, so it is never its own accessibility element. */
|
|
263
|
+
icon: string;
|
|
264
|
+
/** REQUIRED. Becomes both `title` (the native accessible name) and
|
|
265
|
+
* `modifiers.accessibilityLabel`. Empty/whitespace throws. */
|
|
266
|
+
accessibilityLabel: string;
|
|
267
|
+
action: ActionShape;
|
|
268
|
+
/** Defaults to `tertiary` — "plain" is in none of the four renderers'
|
|
269
|
+
* switches, so Android's `else` arm draws it as a FILLED primary. */
|
|
270
|
+
style?: string;
|
|
271
|
+
/** Square edge, in pt/dp/px. Defaults to 44 — the platform tap-target floor. */
|
|
272
|
+
size?: number;
|
|
273
|
+
disabled?: boolean;
|
|
274
|
+
/** RFC 0058 §3.1 — the supplementary "what happens if I act" phrase. */
|
|
275
|
+
accessibilityHint?: string;
|
|
276
|
+
}, opts?: {
|
|
277
|
+
id?: string;
|
|
214
278
|
}): Component;
|
|
215
279
|
/** One named series of a multi-series {@link chart}. */
|
|
216
280
|
export interface ChartSeriesShape {
|
|
@@ -910,6 +974,8 @@ export declare function rating(props: {
|
|
|
910
974
|
color?: string;
|
|
911
975
|
icon?: string;
|
|
912
976
|
valuePath?: string;
|
|
977
|
+
/** `"sm"` — the compact size for dense display rows. Unset/`"md"` keeps the standard size. */
|
|
978
|
+
size?: "sm" | "md";
|
|
913
979
|
}, opts?: {
|
|
914
980
|
id?: string;
|
|
915
981
|
}): Component;
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/state/src/index.d.ts
CHANGED
|
@@ -56,9 +56,12 @@ export declare function withStream<S extends object>(state: S, directive: Stream
|
|
|
56
56
|
* `_nav` field; the runtime strips it from the stored state (so it never
|
|
57
57
|
* persists or re-fires on the next spread) and surfaces it on the value
|
|
58
58
|
* `__invokeAction` resolves to. The host reads it there and asks the app router
|
|
59
|
-
* to
|
|
59
|
+
* to move the user — to a screen ONLY if that screen is a linkable target, the same
|
|
60
60
|
* check a `himi.open` action already gets.
|
|
61
61
|
*
|
|
62
|
+
* Three forms, one per kind of move: open a screen, go back / dismiss, or switch
|
|
63
|
+
* tab. See {@link NavToScreen}, {@link NavBackOrDismiss} and {@link NavToTab}.
|
|
64
|
+
*
|
|
62
65
|
* WHY THIS EXISTS: all three hosts invoked a `tier5.*` action and threw the
|
|
63
66
|
* result away, so a worker could change state but never move the user. A
|
|
64
67
|
* generated (RFC 0046) row tap could therefore only *arm* an authored button —
|
|
@@ -67,15 +70,54 @@ export declare function withStream<S extends object>(state: S, directive: Stream
|
|
|
67
70
|
* a component or a token. With `_nav`, the model still only fires an allowlisted
|
|
68
71
|
* `tier5.*` action id; the WORKER maps entity → screenId from its own table.
|
|
69
72
|
*/
|
|
70
|
-
export
|
|
73
|
+
export type NavDirective = NavToScreen | NavBackOrDismiss | NavToTab;
|
|
74
|
+
/**
|
|
75
|
+
* Open a screen. `presentation` picks how: `push` (the default) onto the current tab's
|
|
76
|
+
* stack, `replace` to show it in place of the current screen, or present it as a
|
|
77
|
+
* `sheet` / `full_screen` modal.
|
|
78
|
+
*/
|
|
79
|
+
export interface NavToScreen {
|
|
71
80
|
/** Screen to open. Must be linkable, or the host ignores the directive. */
|
|
72
81
|
screenId: string;
|
|
73
82
|
/** Nav params for the target (e.g. the record `id`). Strings only. */
|
|
74
83
|
args?: Record<string, string>;
|
|
84
|
+
/** How to show it. Absent ⇒ `push`. */
|
|
85
|
+
presentation?: "push" | "replace" | "sheet" | "full_screen";
|
|
86
|
+
tab?: never;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Leave the current screen. `back` pops the current stack. On iOS and Android, inside an
|
|
90
|
+
* open sheet or cover it pops the modal's own stack and closes the modal at its root; on
|
|
91
|
+
* web it pops the tab's stack, so close a modal with `dismiss`. `dismiss` closes the open
|
|
92
|
+
* sheet / full-screen cover. Both are no-ops with nothing to leave. No target: the host
|
|
93
|
+
* already knows where "back" is.
|
|
94
|
+
*/
|
|
95
|
+
export interface NavBackOrDismiss {
|
|
96
|
+
presentation: "back" | "dismiss";
|
|
97
|
+
screenId?: never;
|
|
98
|
+
args?: never;
|
|
99
|
+
tab?: never;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Switch to the top-level destination with this id — a tab-bar item, or a sidebar-rail
|
|
103
|
+
* item on a wide layout. The host closes any open sheet first. An id the app is not
|
|
104
|
+
* showing right now (unknown, or hidden by the nav worker) is ignored, and so is the tab
|
|
105
|
+
* the user is already on (their stack is kept — it is not a re-tap). A tab switch is not a
|
|
106
|
+
* stack operation: a later `back` pops the NEW tab's stack, not the switch.
|
|
107
|
+
*/
|
|
108
|
+
export interface NavToTab {
|
|
109
|
+
tab: string;
|
|
110
|
+
screenId?: never;
|
|
111
|
+
args?: never;
|
|
112
|
+
presentation?: never;
|
|
75
113
|
}
|
|
76
114
|
/**
|
|
77
115
|
* Attach a {@link NavDirective} to a state object an action returns. Sugar for
|
|
78
|
-
* `{ ...state, _nav:
|
|
116
|
+
* `{ ...state, _nav: target }` that keeps the field name in one place.
|
|
117
|
+
*
|
|
118
|
+
* `target` is exactly ONE of three forms — `{ screenId, args?, presentation? }`,
|
|
119
|
+
* `{ presentation: "back" | "dismiss" }`, or `{ tab }`. A directive that mixes them
|
|
120
|
+
* (a `tab` with a `screenId`, say) is dropped by every host.
|
|
79
121
|
*/
|
|
80
122
|
export declare function navigate<S extends object>(state: S, target: NavDirective): S & {
|
|
81
123
|
_nav: NavDirective;
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts
CHANGED
|
@@ -80,6 +80,13 @@ export interface AppCommerceConfig {
|
|
|
80
80
|
/** Copy-pack overrides for the paywall. */
|
|
81
81
|
copy?: Record<string, string>;
|
|
82
82
|
}
|
|
83
|
+
/** RFC 0058 §5 — see `AppConfig.a11y`. */
|
|
84
|
+
export interface A11yConfig {
|
|
85
|
+
/** `"error"` (the default when omitted), `"warn"` (non-blocking), or `"off"` (needs `reason`). */
|
|
86
|
+
enforce?: "off" | "warn" | "error";
|
|
87
|
+
/** Why the floor is lowered. Required with `"off"`; recommended with `"warn"`. */
|
|
88
|
+
reason?: string;
|
|
89
|
+
}
|
|
83
90
|
/**
|
|
84
91
|
* RFC 0059 §3.2 — the idiom policy: which named overlay from `tokens.json`'s `idiom` block a
|
|
85
92
|
* surface wears. `policy` is a tag, and each value owns its own sibling fields; the union
|
|
@@ -280,6 +287,17 @@ export interface AppConfig {
|
|
|
280
287
|
* Omit ⇒ today's follow-the-device behavior.
|
|
281
288
|
*/
|
|
282
289
|
locale?: LocaleConfig;
|
|
290
|
+
/**
|
|
291
|
+
* RFC 0058 §5 — the accessibility enforcement ladder for this app's `himi validate` /
|
|
292
|
+
* `himi push` lint. **Omit it**: the default is `"error"`, and a new app is gated from its
|
|
293
|
+
* first commit at zero authoring cost.
|
|
294
|
+
*
|
|
295
|
+
* `"warn"` is the deliberate, logged escape for an app mid-migration — the same findings,
|
|
296
|
+
* non-blocking. Delete it once the app's findings are cleared, so the app returns to the
|
|
297
|
+
* default. `"off"` silences the pass and requires a `reason`, so lowering the floor is a
|
|
298
|
+
* visible, reviewable act.
|
|
299
|
+
*/
|
|
300
|
+
a11y?: A11yConfig;
|
|
283
301
|
/**
|
|
284
302
|
* The LAUNCHER icon — the mark the OS home screen, App Store / Play listing,
|
|
285
303
|
* macOS Dock and browser tab show for this app.
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts
CHANGED
|
@@ -1321,6 +1321,13 @@ export interface RatingProps {
|
|
|
1321
1321
|
color?: TokenName;
|
|
1322
1322
|
icon?: IconRef;
|
|
1323
1323
|
valuePath?: string;
|
|
1324
|
+
/** Star size. `"sm"` is the compact size for dense rows — a star tally sharing a row
|
|
1325
|
+
* with a tag and a meta line, where the default stars crowd the text into wrapping.
|
|
1326
|
+
* It draws 16pt cells with a 14pt glyph, 2pt apart, identically on every platform.
|
|
1327
|
+
* Leave it unset (or `"md"`) for the standard size, unchanged from before `size`
|
|
1328
|
+
* existed. `"sm"` is meant for display rows; an interactive rating still works at
|
|
1329
|
+
* it, but its tap targets shrink with it. */
|
|
1330
|
+
size?: "sm" | "md";
|
|
1324
1331
|
}
|
|
1325
1332
|
/**
|
|
1326
1333
|
* A compact data chart (sparkline / trend) — line, area, or bar. Tier-5 screens
|
|
@@ -51,6 +51,35 @@ export interface ConversationMessage {
|
|
|
51
51
|
role?: MessageRole;
|
|
52
52
|
createdDate?: string;
|
|
53
53
|
status?: MessageStatus;
|
|
54
|
+
/** Client tools this assistant turn asks the CALLER to run — see `FunctionCall`. */
|
|
55
|
+
functionCalls?: FunctionCall[];
|
|
56
|
+
}
|
|
57
|
+
/** A client-side tool the assistant wants the caller to run before it can go on
|
|
58
|
+
* — asking the owner for consent, say. It arrives on the `/user-message`
|
|
59
|
+
* response and the agent then WAITS: nothing more is written until the result
|
|
60
|
+
* comes back through `sendFunctionCallResults`.
|
|
61
|
+
*
|
|
62
|
+
* Shape from the chat-service's generated client (`wix.genie.v1` `FunctionCall`
|
|
63
|
+
* / `FunctionCallResult`), which the native Aria app and the React Native
|
|
64
|
+
* dashboard assistant both drive; NOT captured from this client's own traffic,
|
|
65
|
+
* because no hermetic account can make the agent ask for a tool on demand. */
|
|
66
|
+
export interface FunctionCall {
|
|
67
|
+
/** Matches the result to the call. Copied back verbatim. */
|
|
68
|
+
id?: string;
|
|
69
|
+
/** The function's name. Also copied back. */
|
|
70
|
+
name?: string;
|
|
71
|
+
/** A JSON-ENCODED object — a string on the wire, not a nested object. */
|
|
72
|
+
arguments?: string;
|
|
73
|
+
}
|
|
74
|
+
/** The answer to one `FunctionCall`. Note the wire spells the flag `success`. */
|
|
75
|
+
export interface FunctionCallResult {
|
|
76
|
+
id?: string;
|
|
77
|
+
name?: string;
|
|
78
|
+
/** Text for the model — the error text when `success` is false. */
|
|
79
|
+
content?: string;
|
|
80
|
+
success?: boolean;
|
|
81
|
+
/** A JSON-ENCODED object carrying the tool's structured answer. */
|
|
82
|
+
widgetResponse?: string;
|
|
54
83
|
}
|
|
55
84
|
/** Which assistant the conversation talks to. The real dashboard sends a
|
|
56
85
|
* `unifiedAssistantReference`; helper `ariaAssistantConfig()` builds it. */
|
|
@@ -101,6 +130,9 @@ export interface SendMessageResponse {
|
|
|
101
130
|
* NOT carry `userMessage`, so this field is the one reliable source; read it
|
|
102
131
|
* through `userMessageIdOf` rather than directly. */
|
|
103
132
|
userMessageId?: string;
|
|
133
|
+
/** Client tools the agent is waiting on. Read through `functionCallsOf`: the
|
|
134
|
+
* service can also nest them on the first assistant message. */
|
|
135
|
+
functionCalls?: FunctionCall[];
|
|
104
136
|
}
|
|
105
137
|
/** Empty on success — the service answers `{}`. Named rather than `void` so a
|
|
106
138
|
* future field has somewhere to land without changing every call site. */
|
|
@@ -175,6 +207,18 @@ export declare function sendMessage(conversationId: string, content: string, mod
|
|
|
175
207
|
* failed — see `sendMessage`, which attaches the id to its error for exactly
|
|
176
208
|
* this call. Carries no content: the turn it names is the content. */
|
|
177
209
|
export declare function triggerAssistantMessage(conversationId: string, userMessageId: string, opts?: SendMessageOptions): Promise<SendMessageResponse>;
|
|
210
|
+
/** Answer the client tools a `/user-message` response asked for, and let the
|
|
211
|
+
* agent carry on.
|
|
212
|
+
*
|
|
213
|
+
* The SAME route as the trigger, with a different body: no content and no
|
|
214
|
+
* `userMessageId` — the results ARE the turn. The response has the shape of any
|
|
215
|
+
* other send, so it can carry the NEXT round of `functionCalls`; a caller loops
|
|
216
|
+
* until one comes back without any (see `functionCallsOf`).
|
|
217
|
+
*
|
|
218
|
+
* Nothing here decides what a tool does or whether the owner agreed to it. That
|
|
219
|
+
* is the caller's, and it is the part that has to be right: a result that says
|
|
220
|
+
* `userConsent: true` is the owner's signature on whatever the agent does next. */
|
|
221
|
+
export declare function sendFunctionCallResults(conversationId: string, results: FunctionCallResult[], opts?: SendMessageOptions): Promise<SendMessageResponse>;
|
|
178
222
|
/** Ask the service to abandon the assistant reply it is generating for
|
|
179
223
|
* `userMessageId` — the "stop" a chat surface puts beside a reply in progress.
|
|
180
224
|
*
|
|
@@ -197,6 +241,13 @@ export declare function messagesOf(res: GetConversationMessagesResponse | null |
|
|
|
197
241
|
* cannot be aborted, and a caller must degrade rather than send `undefined` to
|
|
198
242
|
* the abort route. */
|
|
199
243
|
export declare function userMessageIdOf(res: SendMessageResponse | null | undefined): string;
|
|
244
|
+
/** The client tools a send response is waiting on, or `[]`.
|
|
245
|
+
*
|
|
246
|
+
* Under either of the two places the service puts them: nested on the FIRST
|
|
247
|
+
* assistant message when that carries any, otherwise top-level. That order is
|
|
248
|
+
* the one both native Aria clients read, and it matters when both are present —
|
|
249
|
+
* the nested set is the one the agent is actually blocked on. */
|
|
250
|
+
export declare function functionCallsOf(res: SendMessageResponse | null | undefined): FunctionCall[];
|
|
200
251
|
/** The conversation id from a createConversation response, under either key. */
|
|
201
252
|
export declare function conversationIdOf(res: CreateConversationResponse | null | undefined): string;
|
|
202
253
|
/** A message's text. `content` is normally a string, but can arrive as an object
|
|
@@ -7578,6 +7578,9 @@ function validateConfigShape(config) {
|
|
|
7578
7578
|
if (config.locale) {
|
|
7579
7579
|
validateLocale(config.locale);
|
|
7580
7580
|
}
|
|
7581
|
+
if (config.a11y !== void 0) {
|
|
7582
|
+
validateA11y(config.a11y);
|
|
7583
|
+
}
|
|
7581
7584
|
if (config.icon) {
|
|
7582
7585
|
validateIcon(config.icon, config.designTokens?.colors, config.designTokensPath);
|
|
7583
7586
|
}
|
|
@@ -7595,6 +7598,24 @@ function validateConfigShape(config) {
|
|
|
7595
7598
|
var SPLASH_MIN_VISIBLE_MS_MAX = 2e3;
|
|
7596
7599
|
var SPLASH_MAX_HOLD_MS_MAX = 8e3;
|
|
7597
7600
|
var SPLASH_LAYOUTS = ["centered", "centeredStacked", "logoOnly"];
|
|
7601
|
+
function validateA11y(a11y) {
|
|
7602
|
+
if (!a11y || typeof a11y !== "object" || Array.isArray(a11y)) {
|
|
7603
|
+
throw new Error('defineApp: a11y must be an object like { enforce: "warn" }.');
|
|
7604
|
+
}
|
|
7605
|
+
if (a11y.enforce !== void 0 && !["off", "warn", "error"].includes(a11y.enforce)) {
|
|
7606
|
+
throw new Error(
|
|
7607
|
+
`defineApp: a11y.enforce must be "off", "warn" or "error" (got ${JSON.stringify(a11y.enforce)}).`
|
|
7608
|
+
);
|
|
7609
|
+
}
|
|
7610
|
+
if (a11y.reason !== void 0 && typeof a11y.reason !== "string") {
|
|
7611
|
+
throw new Error("defineApp: a11y.reason must be a string.");
|
|
7612
|
+
}
|
|
7613
|
+
if (a11y.enforce === "off" && !(a11y.reason ?? "").trim()) {
|
|
7614
|
+
throw new Error(
|
|
7615
|
+
'defineApp: a11y.enforce "off" needs a non-empty a11y.reason \u2014 turning the accessibility gate off has to be a visible, reviewable act (RFC 0058 \xA75), never a silent absence.'
|
|
7616
|
+
);
|
|
7617
|
+
}
|
|
7618
|
+
}
|
|
7598
7619
|
function validateLocale(locale) {
|
|
7599
7620
|
const tag = coerceSupportedLocale(locale.default);
|
|
7600
7621
|
if (!tag) {
|
|
@@ -8045,18 +8045,75 @@ function appIntent(pkg, type, props, opts) {
|
|
|
8045
8045
|
};
|
|
8046
8046
|
}
|
|
8047
8047
|
function image(props, opts) {
|
|
8048
|
-
|
|
8048
|
+
const { decorative, ...imageProps } = props;
|
|
8049
|
+
if (decorative && (imageProps.contentDescription ?? "").trim() !== "") {
|
|
8050
|
+
throw new Error(
|
|
8051
|
+
`image(): decorative and a non-empty contentDescription are mutually exclusive \u2014 an image either carries meaning or it does not (RFC 0058 \xA73.3)`
|
|
8052
|
+
);
|
|
8053
|
+
}
|
|
8054
|
+
const node = {
|
|
8049
8055
|
id: opts?.id ?? auto("image"),
|
|
8050
|
-
body: { package: "himalaya", type: "Image", props }
|
|
8056
|
+
body: { package: "himalaya", type: "Image", props: imageProps }
|
|
8051
8057
|
};
|
|
8058
|
+
return decorative ? { ...node, modifiers: { accessibilityRole: "decorative" } } : node;
|
|
8052
8059
|
}
|
|
8053
8060
|
function divider(opts) {
|
|
8054
8061
|
return { id: opts?.id ?? auto("divider"), body: { package: "himalaya", type: "Divider", props: {} } };
|
|
8055
8062
|
}
|
|
8056
8063
|
function icon(name, opts) {
|
|
8057
|
-
|
|
8064
|
+
if (opts?.decorative && opts?.contentDescription !== void 0) {
|
|
8065
|
+
throw new Error(
|
|
8066
|
+
`icon("${name}"): decorative and contentDescription are mutually exclusive \u2014 a glyph either carries meaning or it does not (RFC 0058 \xA73.3)`
|
|
8067
|
+
);
|
|
8068
|
+
}
|
|
8069
|
+
const node = {
|
|
8058
8070
|
id: opts?.id ?? auto("icon"),
|
|
8059
|
-
body: {
|
|
8071
|
+
body: {
|
|
8072
|
+
package: "himalaya",
|
|
8073
|
+
type: "Icon",
|
|
8074
|
+
props: { name, size: opts?.size, tint: opts?.tint, ...opts?.contentDescription !== void 0 ? { contentDescription: opts.contentDescription } : {} }
|
|
8075
|
+
}
|
|
8076
|
+
};
|
|
8077
|
+
return opts?.decorative ? { ...node, modifiers: { accessibilityRole: "decorative" } } : node;
|
|
8078
|
+
}
|
|
8079
|
+
function carriesName(c) {
|
|
8080
|
+
const label2 = c.modifiers?.accessibilityLabel;
|
|
8081
|
+
if (typeof label2 === "string" && label2.trim() !== "") return true;
|
|
8082
|
+
const props = c.body?.props;
|
|
8083
|
+
const cd = props?.contentDescription;
|
|
8084
|
+
return typeof cd === "string" && cd.trim() !== "";
|
|
8085
|
+
}
|
|
8086
|
+
function iconButton(props, opts) {
|
|
8087
|
+
const name = props.accessibilityLabel;
|
|
8088
|
+
if (typeof name !== "string" || name.trim() === "") {
|
|
8089
|
+
throw new Error(
|
|
8090
|
+
`iconButton("${props.icon}"): accessibilityLabel is required and must be non-empty \u2014 an icon-only control with no name is unreachable by screen reader (RFC 0058 \xA73.3)`
|
|
8091
|
+
);
|
|
8092
|
+
}
|
|
8093
|
+
const size = props.size ?? 44;
|
|
8094
|
+
return {
|
|
8095
|
+
id: opts?.id ?? slugId("btn", props.action?.actionId),
|
|
8096
|
+
body: {
|
|
8097
|
+
package: "himalaya",
|
|
8098
|
+
type: "Button",
|
|
8099
|
+
props: {
|
|
8100
|
+
title: name,
|
|
8101
|
+
action: props.action,
|
|
8102
|
+
style: props.style ?? "tertiary",
|
|
8103
|
+
iconOnly: true,
|
|
8104
|
+
leadingIcon: props.icon,
|
|
8105
|
+
cornerRadius: Math.round(size / 2),
|
|
8106
|
+
minHeight: size,
|
|
8107
|
+
...props.disabled !== void 0 ? { disabled: props.disabled } : {}
|
|
8108
|
+
}
|
|
8109
|
+
},
|
|
8110
|
+
modifiers: {
|
|
8111
|
+
width: size,
|
|
8112
|
+
height: size,
|
|
8113
|
+
accessibilityLabel: name,
|
|
8114
|
+
accessibilityRole: "button",
|
|
8115
|
+
...props.accessibilityHint !== void 0 ? { accessibilityHint: props.accessibilityHint } : {}
|
|
8116
|
+
}
|
|
8060
8117
|
};
|
|
8061
8118
|
}
|
|
8062
8119
|
function chart(props, opts) {
|
|
@@ -8078,10 +8135,25 @@ function spacer(opts) {
|
|
|
8078
8135
|
return { id: opts?.id ?? auto("spacer"), body: { package: "himalaya", type: "Spacer", props } };
|
|
8079
8136
|
}
|
|
8080
8137
|
function button(props, opts) {
|
|
8138
|
+
if (props.iconOnly && (typeof props.title !== "string" || props.title.trim() === "")) {
|
|
8139
|
+
throw new Error(
|
|
8140
|
+
`button({ iconOnly: true }): title is required and must be non-empty \u2014 it IS the accessible name of an icon-only control (RFC 0058 \xA73.3). Prefer \`iconButton({ icon, accessibilityLabel, action })\`.`
|
|
8141
|
+
);
|
|
8142
|
+
}
|
|
8081
8143
|
return { id: opts?.id ?? slugId("btn", props.action?.actionId), body: { package: "himalaya", type: "Button", props } };
|
|
8082
8144
|
}
|
|
8083
8145
|
function withModifiers(c, mods) {
|
|
8084
|
-
|
|
8146
|
+
const merged = { ...c.modifiers, ...mods };
|
|
8147
|
+
if (c.body?.type === "Icon" && merged.onTap && !carriesName({ ...c, modifiers: merged })) {
|
|
8148
|
+
const glyph = c.body.props?.name;
|
|
8149
|
+
throw new Error(
|
|
8150
|
+
`withModifiers: tappable Icon "${String(glyph)}"${c.id ? ` (${c.id})` : ""} has no accessible name \u2014 pass \`accessibilityLabel\`, or build it with \`iconButton({ icon, accessibilityLabel, action })\` (RFC 0058 \xA73.3)`
|
|
8151
|
+
);
|
|
8152
|
+
}
|
|
8153
|
+
if (merged.accessibilityRole === "decorative" && merged.onTap) {
|
|
8154
|
+
return { ...c, modifiers: { ...merged, accessibilityRole: "button" } };
|
|
8155
|
+
}
|
|
8156
|
+
return { ...c, modifiers: merged };
|
|
8085
8157
|
}
|
|
8086
8158
|
function withId(c, id) {
|
|
8087
8159
|
return { ...c, id };
|
|
@@ -8513,7 +8585,7 @@ function skRect(height, id) {
|
|
|
8513
8585
|
}
|
|
8514
8586
|
function emptyBlock(service, titlePath, ctaTitle, ctaScreen, iconName, id, opts = {}) {
|
|
8515
8587
|
const children = [
|
|
8516
|
-
icon(iconName, { size: opts.iconSize ?? 34, tint: "textTertiary" }),
|
|
8588
|
+
icon(iconName, { size: opts.iconSize ?? 34, tint: "textTertiary", decorative: true }),
|
|
8517
8589
|
text(titlePath, "bodyEmphasis", { color: "textSecondary", collapseWhenEmpty: true })
|
|
8518
8590
|
];
|
|
8519
8591
|
if (opts.subtitle !== void 0) {
|
|
@@ -8566,6 +8638,7 @@ export {
|
|
|
8566
8638
|
hiddenWhen,
|
|
8567
8639
|
hstack,
|
|
8568
8640
|
icon,
|
|
8641
|
+
iconButton,
|
|
8569
8642
|
image,
|
|
8570
8643
|
label,
|
|
8571
8644
|
labeledContent,
|
|
@@ -93,6 +93,22 @@ function triggerAssistantMessage(conversationId, userMessageId, opts = {}) {
|
|
|
93
93
|
...opts.enforceAccountScopedConversations === void 0 ? {} : { enforceAccountScopedConversations: opts.enforceAccountScopedConversations }
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
+
function sendFunctionCallResults(conversationId, results, opts = {}) {
|
|
97
|
+
if (!conversationId) throw new Error("sendFunctionCallResults: conversationId is required");
|
|
98
|
+
if (!results.length) throw new Error("sendFunctionCallResults: at least one result is required");
|
|
99
|
+
return wixCall("POST", `${BASE}/user-message`, {
|
|
100
|
+
conversationId,
|
|
101
|
+
functionCallResults: results,
|
|
102
|
+
userMessageInputSource: "TEXT",
|
|
103
|
+
communicationMode: opts.communicationMode ?? "POLLING",
|
|
104
|
+
enableRealtimeEvents: opts.enableRealtimeEvents ?? true,
|
|
105
|
+
origin: opts.origin ?? ARIA_ORIGIN,
|
|
106
|
+
...opts.metadata === void 0 ? {} : { metadata: opts.metadata },
|
|
107
|
+
// The same scoping the trigger that opened this turn was sent with, so the
|
|
108
|
+
// continuation runs under the rules its start did.
|
|
109
|
+
...opts.enforceAccountScopedConversations === void 0 ? {} : { enforceAccountScopedConversations: opts.enforceAccountScopedConversations }
|
|
110
|
+
});
|
|
111
|
+
}
|
|
96
112
|
function abortAssistantMessageGeneration(userMessageId) {
|
|
97
113
|
if (!userMessageId) throw new Error("abortAssistantMessageGeneration: userMessageId is required");
|
|
98
114
|
return wixCall("POST", `${BASE}/abort-assistant-message-generation`, { userMessageId });
|
|
@@ -107,6 +123,11 @@ function messagesOf(res) {
|
|
|
107
123
|
function userMessageIdOf(res) {
|
|
108
124
|
return (res?.userMessageId ?? res?.userMessage?.id ?? "").trim();
|
|
109
125
|
}
|
|
126
|
+
function functionCallsOf(res) {
|
|
127
|
+
const nested = res?.assistantMessages?.[0]?.functionCalls;
|
|
128
|
+
if (Array.isArray(nested) && nested.length) return nested;
|
|
129
|
+
return Array.isArray(res?.functionCalls) ? res.functionCalls : [];
|
|
130
|
+
}
|
|
110
131
|
function conversationIdOf(res) {
|
|
111
132
|
return (res?.conversationId || res?.conversation?.id || "").trim();
|
|
112
133
|
}
|
|
@@ -138,6 +159,7 @@ export {
|
|
|
138
159
|
conversationIdOf,
|
|
139
160
|
conversationUserMessage,
|
|
140
161
|
createConversation,
|
|
162
|
+
functionCallsOf,
|
|
141
163
|
genieChatError,
|
|
142
164
|
getConversationMessages,
|
|
143
165
|
getConversations,
|
|
@@ -145,6 +167,7 @@ export {
|
|
|
145
167
|
lastAssistantMessage,
|
|
146
168
|
messageText,
|
|
147
169
|
messagesOf,
|
|
170
|
+
sendFunctionCallResults,
|
|
148
171
|
sendMessage,
|
|
149
172
|
triggerAssistantMessage,
|
|
150
173
|
userMessageIdOf,
|