@appilots/sdk 0.2.0 → 0.4.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/{chunk-GEM6TPAK.mjs → chunk-42WI3UDB.mjs} +312 -1635
- package/dist/{chunk-KGN3DNGX.js → chunk-CHY5D2PV.js} +5 -5
- package/dist/{chunk-KCDNL4HV.mjs → chunk-GEKCGVJN.mjs} +1 -1
- package/dist/{chunk-HDLZGXNF.mjs → chunk-JBOLV5AM.mjs} +2016 -96
- package/dist/{chunk-SIBKF7AA.js → chunk-V3TUIIT2.js} +2036 -97
- package/dist/{chunk-IASJ7YHC.js → chunk-Y7EA6R2G.js} +412 -1735
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +11 -11
- package/dist/hooks/index.mjs +2 -2
- package/dist/{index-BDb1WVNo.d.mts → index-Cb0D6uKH.d.mts} +367 -124
- package/dist/{index-BDb1WVNo.d.ts → index-Cb0D6uKH.d.ts} +367 -124
- package/dist/index.d.mts +109 -341
- package/dist/index.d.ts +109 -341
- package/dist/index.js +84 -462
- package/dist/index.mjs +10 -403
- package/dist/navigation/index.js +13 -13
- package/dist/navigation/index.mjs +2 -2
- package/hooks/package.json +9 -0
- package/metro.d.ts +49 -0
- package/metro.js +0 -37
- package/navigation/package.json +9 -0
- package/package.json +45 -25
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PartialThemeTokens, A as AppilotsThemeTokens, a as AppilotsLocale, b as AgentAction, C as ComponentRegistry, c as AgentPermissions,
|
|
2
|
-
export {
|
|
1
|
+
import { P as PartialThemeTokens, A as AppilotsThemeTokens, a as AppilotsLocale, b as AgentAction, I as InteractionElementSnapshot, C as ComponentRegistry, c as AgentPermissions, S as ScreenSnapshot, F as FieldEntry, d as AppilotsEvent } from './index-Cb0D6uKH.mjs';
|
|
2
|
+
export { e as AgentActionType, f as AgentMessage, g as AppilotsClient, h as AppilotsClientOptions, i as AppilotsConfig, j as AppilotsEventHandler, k as AppilotsEventType, l as AppilotsProvider, m as AppilotsProviderProps, n as AppilotsTraceEntry, o as AppilotsUser, B as BreadcrumbItem, p as BreadcrumbState, q as ButtonSnapshot, r as ChatMessage, s as ChoiceGroupSnapshot, t as ChoiceOptionSnapshot, u as ComponentEntry, v as ComponentKind, E as EscalationState, w as FormFillPayload, x as InputSnapshot, y as InteractionElementListContext, L as ListItemSnapshot, z as ListSnapshot, M as MessageRole, N as NavigationPayload, R as RemotePersonalization, D as SDK_VERSION, G as SliderEntry, H as SuggestedPrompt, T as TargetEntry, J as ToggleEntry, K as ToggleSnapshot, U as UIInteractionPayload, O as UseAppilotsFieldOptions, Q as UseAppilotsSliderOptions, V as UseAppilotsTargetOptions, W as UseAppilotsToggleOptions, X as UseSuggestedPromptsOptions, Y as UseSuggestedPromptsReturn, Z as clearAppilotsDebugTraces, _ as componentRegistry, $ as createComponentRegistry, a0 as defaultDarkTheme, a1 as defaultLightTheme, a2 as describeAction, a3 as getAppilotsDebugTraces, a4 as humanizeError, a5 as mergeThemeTokens, a6 as recordAppilotsDebugTrace, a7 as subscribeAppilotsDebugTraces, a8 as useAppilots, a9 as useAppilotsActions, aa as useAppilotsChat, ab as useAppilotsContext, ac as useAppilotsField, ad as useAppilotsNavigation, ae as useAppilotsSlider, af as useAppilotsTarget, ag as useAppilotsToggle, ah as useSuggestedPrompts } from './index-Cb0D6uKH.mjs';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import React__default from 'react';
|
|
5
5
|
export { A as AppilotsNavigationContainer, N as NavigationConfig, b as ScreenMetadata, r as registerScreen } from './registerScreen-D1oGm28T.mjs';
|
|
@@ -78,6 +78,110 @@ declare const appilotsTheme: {
|
|
|
78
78
|
fromTailwind: typeof appilotsThemeFromTailwind;
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
* i18n keys — the canonical list of every translatable string in the
|
|
83
|
+
* SDK chat UI. Adding UI copy means adding a key here AND a value in
|
|
84
|
+
* every bundle under `./bundles/` (TypeScript will fail the bundle if a
|
|
85
|
+
* key is missing). BACKLOG 4.1.
|
|
86
|
+
*/
|
|
87
|
+
interface AppilotsStrings {
|
|
88
|
+
/** Default chat header title when the dev hasn't supplied one. */
|
|
89
|
+
chatTitle: string;
|
|
90
|
+
/** Header button that wipes the conversation. */
|
|
91
|
+
clearButton: string;
|
|
92
|
+
/** Placeholder for the message input. */
|
|
93
|
+
inputPlaceholder: string;
|
|
94
|
+
/** Empty state heading. */
|
|
95
|
+
emptyTitle: string;
|
|
96
|
+
/** Empty state subtitle / one-liner under the heading. */
|
|
97
|
+
emptySubtitle: string;
|
|
98
|
+
/** "Thinking..." placeholder shown while the assistant is replying. */
|
|
99
|
+
thinking: string;
|
|
100
|
+
/** Status shown while the assistant is planning from the current screen. */
|
|
101
|
+
statusAnalyzing: string;
|
|
102
|
+
/** Status shown while the SDK waits for the app to settle after an action. */
|
|
103
|
+
statusWaitingApp: string;
|
|
104
|
+
/** Status shown while the assistant adjusts after a recoverable failure. */
|
|
105
|
+
statusAdjusting: string;
|
|
106
|
+
/** Footer line shown when poweredByVisible !== false. */
|
|
107
|
+
poweredBy: string;
|
|
108
|
+
/** Approve button on a pending action row in the breadcrumb. */
|
|
109
|
+
approve: string;
|
|
110
|
+
/** Reject button on a pending action row in the breadcrumb. */
|
|
111
|
+
reject: string;
|
|
112
|
+
/** Generic "cancelled by the user" message after a reject. */
|
|
113
|
+
cancelledByUser: string;
|
|
114
|
+
/** Fallback humanised name for an unknown action type. */
|
|
115
|
+
unknownAction: string;
|
|
116
|
+
/** Generic friendly error when nothing else fits. */
|
|
117
|
+
somethingWentWrong: string;
|
|
118
|
+
/** Open chat accessibility label for the floating bubble. */
|
|
119
|
+
openChatA11y: string;
|
|
120
|
+
/** Close chat accessibility label. */
|
|
121
|
+
closeChatA11y: string;
|
|
122
|
+
/** A11y label for the stop-generation button (OKR-008 KR4). */
|
|
123
|
+
stopGeneratingA11y: string;
|
|
124
|
+
/** A11y label for the "talk to a human" header button. */
|
|
125
|
+
talkToHumanA11y: string;
|
|
126
|
+
/** Sender label above a human operator's bubble. */
|
|
127
|
+
humanAgentLabel: string;
|
|
128
|
+
/** System line right after the user (or the offer chip) escalates. */
|
|
129
|
+
escalationRequested: string;
|
|
130
|
+
/** System line when an operator claims the conversation. */
|
|
131
|
+
escalationConnected: string;
|
|
132
|
+
/** System line when the operator resolves — AI takes over again. */
|
|
133
|
+
escalationResolved: string;
|
|
134
|
+
/** System line offering the handoff after the agent gives up. */
|
|
135
|
+
escalationOffer: string;
|
|
136
|
+
/** Label of the tappable chip under the offer line. */
|
|
137
|
+
escalationOfferChip: string;
|
|
138
|
+
/** Thin banner under the header while waiting in the queue. */
|
|
139
|
+
escalationPendingBanner: string;
|
|
140
|
+
/** Thin banner under the header while connected to an operator. */
|
|
141
|
+
escalationActiveBanner: string;
|
|
142
|
+
}
|
|
143
|
+
type AppilotsStringKey = keyof AppilotsStrings;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Best-effort device-locale detection. Returns the closest supported
|
|
147
|
+
* locale or `null` if we can't tell. Designed to never throw — RN's
|
|
148
|
+
* native modules are platform-specific and can be missing in test
|
|
149
|
+
* harnesses.
|
|
150
|
+
*/
|
|
151
|
+
declare function detectDeviceLocale(): AppilotsLocale | null;
|
|
152
|
+
/**
|
|
153
|
+
* Resolve the locale to use given the prop and the device default.
|
|
154
|
+
* Order: explicit prop → device-detected → DEFAULT_LOCALE.
|
|
155
|
+
*/
|
|
156
|
+
declare function resolveLocale(prop?: AppilotsLocale | null): AppilotsLocale;
|
|
157
|
+
interface I18nContextValue {
|
|
158
|
+
locale: AppilotsLocale;
|
|
159
|
+
strings: AppilotsStrings;
|
|
160
|
+
/**
|
|
161
|
+
* Helper to read a single key. Components can also destructure
|
|
162
|
+
* `strings` directly if they need many in one render.
|
|
163
|
+
*/
|
|
164
|
+
t: (key: AppilotsStringKey) => string;
|
|
165
|
+
}
|
|
166
|
+
interface AppilotsI18nProviderProps {
|
|
167
|
+
/** Force a locale. Falls through to device detection when omitted. */
|
|
168
|
+
locale?: AppilotsLocale | null;
|
|
169
|
+
/**
|
|
170
|
+
* Per-key overrides to merge on top of the bundle. Useful when the
|
|
171
|
+
* dev wants to rename only "Powered by Appilots" while keeping the
|
|
172
|
+
* rest in the default language.
|
|
173
|
+
*/
|
|
174
|
+
overrides?: Partial<AppilotsStrings> | null;
|
|
175
|
+
children: React__default.ReactNode;
|
|
176
|
+
}
|
|
177
|
+
declare function AppilotsI18nProvider({ locale, overrides, children, }: AppilotsI18nProviderProps): React__default.JSX.Element;
|
|
178
|
+
/**
|
|
179
|
+
* Read the locale + strings from context. Falls back to the default
|
|
180
|
+
* locale bundle if no provider is mounted, so components don't need a
|
|
181
|
+
* provider to be safe — they just lose the dev's overrides.
|
|
182
|
+
*/
|
|
183
|
+
declare function useAppilotsI18n(): I18nContextValue;
|
|
184
|
+
|
|
81
185
|
/**
|
|
82
186
|
* Layout modes for the chat (BACKLOG 4.1).
|
|
83
187
|
* - `bubble` — floating action button + bottom sheet modal (default)
|
|
@@ -218,52 +322,6 @@ interface ConfirmDialogProps {
|
|
|
218
322
|
/** @deprecated No-op. See file header. */
|
|
219
323
|
declare function ConfirmDialog(_props?: ConfirmDialogProps): React__default.ReactElement | null;
|
|
220
324
|
|
|
221
|
-
/**
|
|
222
|
-
* Human-readable labels and error messages for the action breadcrumb.
|
|
223
|
-
*
|
|
224
|
-
* Strings are PT-BR hardcoded for now. i18n is planned for backlog item
|
|
225
|
-
* 4.1 (Personalização) — when that lands, these strings move into the
|
|
226
|
-
* locale bundles.
|
|
227
|
-
*
|
|
228
|
-
* Two responsibilities:
|
|
229
|
-
* 1. `describeAction(action)` — turns a typed AgentAction into a label
|
|
230
|
-
* that varies by lifecycle state (pending/running/done/failed).
|
|
231
|
-
* 2. `humanizeError(raw, action)` — sanitises the raw error string from
|
|
232
|
-
* the executor into a short user-facing reason. Stack traces and
|
|
233
|
-
* protocol errors are collapsed into "algo deu errado" so users
|
|
234
|
-
* aren't shown technical noise.
|
|
235
|
-
*/
|
|
236
|
-
|
|
237
|
-
type BreadcrumbState = 'pending' | 'running' | 'success' | 'failed';
|
|
238
|
-
interface BreadcrumbItem {
|
|
239
|
-
/** What to render on the line. */
|
|
240
|
-
label: string;
|
|
241
|
-
/** Lifecycle state — drives icon + colour in the breadcrumb. */
|
|
242
|
-
state: BreadcrumbState;
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* Map an AgentAction + its current status to a breadcrumb item ready to
|
|
246
|
-
* render. The function is intentionally defensive — both the native-tools
|
|
247
|
-
* and JSON-fallback code paths feed actions through here, and the JSON
|
|
248
|
-
* path is loose with payload shapes, so every field access has to assume
|
|
249
|
-
* `unknown`.
|
|
250
|
-
*/
|
|
251
|
-
declare function describeAction(action: AgentAction): BreadcrumbItem;
|
|
252
|
-
/**
|
|
253
|
-
* Convert the executor's raw error string into a short, user-facing
|
|
254
|
-
* reason that fits inside parentheses on the breadcrumb line. Returns
|
|
255
|
-
* `undefined` when there's no useful information to show — caller can
|
|
256
|
-
* then drop the parenthetical entirely.
|
|
257
|
-
*
|
|
258
|
-
* Heuristics:
|
|
259
|
-
* - Apply known-pattern rewrites (rejected, not found, network, etc.)
|
|
260
|
-
* - If the result looks technical (stack frame, HTTP status, JSON
|
|
261
|
-
* dump) or is suspiciously long, fall back to "algo deu errado".
|
|
262
|
-
* - Trim and lowercase the first letter so it reads naturally inside
|
|
263
|
-
* the parens after the action verb.
|
|
264
|
-
*/
|
|
265
|
-
declare function humanizeError(raw: string | undefined, _action?: AgentAction): string | undefined;
|
|
266
|
-
|
|
267
325
|
/**
|
|
268
326
|
* Pure presentation logic for ActionBreadcrumb, extracted from the RN
|
|
269
327
|
* component (same pattern as `humanizeAction.ts` / `chatTimeline.ts`)
|
|
@@ -403,7 +461,7 @@ declare function HeadsetIcon({ size, color }: HeadsetIconProps): React$1.JSX.Ele
|
|
|
403
461
|
* registers that metadata here so snapshots can describe collections
|
|
404
462
|
* without relying only on structural guesses.
|
|
405
463
|
*/
|
|
406
|
-
interface ListDataPreviewEntry
|
|
464
|
+
interface ListDataPreviewEntry {
|
|
407
465
|
/** 0-based index in the list's backing data. */
|
|
408
466
|
index: number;
|
|
409
467
|
/** Stable key from keyExtractor / item.id when available. */
|
|
@@ -440,7 +498,7 @@ interface ListEntry {
|
|
|
440
498
|
* the auto-tracking wrapper from `props.data` so the agent can see
|
|
441
499
|
* rows that virtualization keeps unmounted.
|
|
442
500
|
*/
|
|
443
|
-
dataPreview?: ListDataPreviewEntry
|
|
501
|
+
dataPreview?: ListDataPreviewEntry[];
|
|
444
502
|
/** Scroll so the 0-based data index becomes visible. Returns false when unsupported. */
|
|
445
503
|
scrollToIndex?: (index: number) => boolean;
|
|
446
504
|
/** Scroll to an absolute pixel offset. Returns false when unsupported. */
|
|
@@ -465,281 +523,6 @@ declare class ListRegistryImpl {
|
|
|
465
523
|
declare const listRegistry: ListRegistry;
|
|
466
524
|
declare function createListRegistry(): ListRegistry;
|
|
467
525
|
|
|
468
|
-
/**
|
|
469
|
-
* Snapshot types — the shape of data captured from the React fiber tree.
|
|
470
|
-
*
|
|
471
|
-
* This is the runtime "view model" of what the user is currently seeing
|
|
472
|
-
* on screen, sent to the AI agent so it has accurate visible state.
|
|
473
|
-
*/
|
|
474
|
-
interface InputSnapshot {
|
|
475
|
-
/** Best identifier — testID, accessibilityLabel, or placeholder */
|
|
476
|
-
id?: string;
|
|
477
|
-
/** Human-readable label inferred from accessibilityLabel, label prop, or sibling Text */
|
|
478
|
-
label?: string;
|
|
479
|
-
/** Current value (only present for controlled inputs) */
|
|
480
|
-
value?: string;
|
|
481
|
-
/** Placeholder text */
|
|
482
|
-
placeholder?: string;
|
|
483
|
-
/** Whether the input is editable */
|
|
484
|
-
editable?: boolean;
|
|
485
|
-
/** Whether the input is secure (password field) */
|
|
486
|
-
secure?: boolean;
|
|
487
|
-
/** Inferred type based on keyboardType / secureTextEntry */
|
|
488
|
-
type?: 'text' | 'email' | 'number' | 'phone' | 'password';
|
|
489
|
-
/**
|
|
490
|
-
* True when this input lives inside a currently-visible Modal. When a
|
|
491
|
-
* modal is open, only inModal elements can actually receive touches —
|
|
492
|
-
* everything else is behind the overlay.
|
|
493
|
-
*/
|
|
494
|
-
inModal?: boolean;
|
|
495
|
-
}
|
|
496
|
-
interface ButtonSnapshot {
|
|
497
|
-
/** Best identifier — testID, accessibilityLabel, or inferred from child text */
|
|
498
|
-
id?: string;
|
|
499
|
-
/** Human-readable label — usually the visible text inside the button */
|
|
500
|
-
label?: string;
|
|
501
|
-
/** Whether the button is disabled */
|
|
502
|
-
disabled?: boolean;
|
|
503
|
-
/**
|
|
504
|
-
* Whether the button currently appears selected/active — read from
|
|
505
|
-
* `accessibilityState.selected`. Set by grouped, mutually-exclusive
|
|
506
|
-
* controls (SegmentedControl, RadioGroup) where each option is its
|
|
507
|
-
* own pressable target; absent/false for ordinary buttons.
|
|
508
|
-
*/
|
|
509
|
-
selected?: boolean;
|
|
510
|
-
/** True when this button lives inside a currently-visible Modal. */
|
|
511
|
-
inModal?: boolean;
|
|
512
|
-
}
|
|
513
|
-
interface ToggleSnapshot {
|
|
514
|
-
/** Best identifier — testID or accessibilityLabel */
|
|
515
|
-
id?: string;
|
|
516
|
-
/** Human-readable label */
|
|
517
|
-
label?: string;
|
|
518
|
-
/** Current on/off state */
|
|
519
|
-
value?: boolean;
|
|
520
|
-
/** True when this toggle lives inside a currently-visible Modal. */
|
|
521
|
-
inModal?: boolean;
|
|
522
|
-
}
|
|
523
|
-
interface SliderSnapshot {
|
|
524
|
-
/** Registry id (the id apps pass to useAppilotsSlider) — the executable handle. */
|
|
525
|
-
id?: string;
|
|
526
|
-
/** Human-readable label */
|
|
527
|
-
label?: string;
|
|
528
|
-
/** Current numeric value */
|
|
529
|
-
value?: number;
|
|
530
|
-
/** Lower bound the executor clamps to */
|
|
531
|
-
min?: number;
|
|
532
|
-
/** Upper bound the executor clamps to */
|
|
533
|
-
max?: number;
|
|
534
|
-
/** Step the executor snaps to (omitted = continuous) */
|
|
535
|
-
step?: number;
|
|
536
|
-
/** Whether the slider is currently disabled */
|
|
537
|
-
disabled?: boolean;
|
|
538
|
-
/** True when this slider lives inside a currently-visible Modal. */
|
|
539
|
-
inModal?: boolean;
|
|
540
|
-
}
|
|
541
|
-
interface ListItemSnapshot {
|
|
542
|
-
/** 1-indexed position within the parent list (matches "selecione o terceiro"). */
|
|
543
|
-
index: number;
|
|
544
|
-
/**
|
|
545
|
-
* 0-based index of this row in the list's backing DATA, when the
|
|
546
|
-
* auto-tracking wrapper stamped it (`__appilotsItemIndex`). For
|
|
547
|
-
* scrolled/virtualized lists this differs from `index`: the first
|
|
548
|
-
* MOUNTED row might be data item 42. Lets the prompt show absolute
|
|
549
|
-
* positions ("#43 of 100") so ordinal references stay correct.
|
|
550
|
-
*/
|
|
551
|
-
dataIndex?: number;
|
|
552
|
-
/**
|
|
553
|
-
* React key of the cell, if present (typically the item's domain id
|
|
554
|
-
* from keyExtractor). Useful for the LLM when the user references an
|
|
555
|
-
* item by name and we want to surface a deterministic handle for
|
|
556
|
-
* future tap-by-ordinal resolution (Phase B).
|
|
557
|
-
*/
|
|
558
|
-
reactKey?: string;
|
|
559
|
-
/** Runtime key supplied by auto-tracked list renderItem, if available. */
|
|
560
|
-
itemKey?: string;
|
|
561
|
-
/**
|
|
562
|
-
* Texts captured from this item's subtree (vehicle name, plate,
|
|
563
|
-
* tags, etc.). Per-item to preserve row association — the flat
|
|
564
|
-
* `snapshot.texts` lost it.
|
|
565
|
-
*/
|
|
566
|
-
texts: string[];
|
|
567
|
-
/** Buttons inside this item — e.g. an inline "Edit" button on a row. */
|
|
568
|
-
buttons: ButtonSnapshot[];
|
|
569
|
-
/** Inputs inside this item — rare but possible (inline edit row). */
|
|
570
|
-
inputs: InputSnapshot[];
|
|
571
|
-
/** Toggles inside this item. */
|
|
572
|
-
toggles: ToggleSnapshot[];
|
|
573
|
-
/**
|
|
574
|
-
* Synthetic id assigned by the walker. Stable within a single
|
|
575
|
-
* snapshot; format `list-<L>-item-<I>` (0-indexed L, 1-indexed I).
|
|
576
|
-
* Used by Phase B's tap-by-ordinal resolution in uiInteractionHandler.
|
|
577
|
-
*/
|
|
578
|
-
syntheticId: string;
|
|
579
|
-
}
|
|
580
|
-
interface ListSnapshot {
|
|
581
|
-
/** 0-indexed list ordinal — multiple lists on one screen get 0, 1, 2... */
|
|
582
|
-
index: number;
|
|
583
|
-
/** Runtime list id when auto-tracking or explicit props provide one. */
|
|
584
|
-
id?: string;
|
|
585
|
-
/**
|
|
586
|
-
* The container component name as observed in the fiber tree.
|
|
587
|
-
* Common values: 'FlatList', 'SectionList', 'VirtualizedList',
|
|
588
|
-
* 'FlashList', 'ScrollView' (when detected by N≥2 keyed children).
|
|
589
|
-
*/
|
|
590
|
-
containerType: string;
|
|
591
|
-
/** Source that identified this list. */
|
|
592
|
-
source?: 'fiber' | 'auto-tracked' | 'registry';
|
|
593
|
-
/** Total data-set count when the list component exposes it. */
|
|
594
|
-
itemCount?: number;
|
|
595
|
-
/** Number of row items captured in this snapshot. */
|
|
596
|
-
visibleItemCount?: number;
|
|
597
|
-
/** True when the list reports a refresh/loading state. */
|
|
598
|
-
refreshing?: boolean;
|
|
599
|
-
/** True when total item count is known and zero. */
|
|
600
|
-
empty?: boolean;
|
|
601
|
-
/** Human-readable label if the app supplied one. */
|
|
602
|
-
label?: string;
|
|
603
|
-
/**
|
|
604
|
-
* Items in visible order. Real list components may expose one mounted
|
|
605
|
-
* item when virtualization or an overlay limits the visible window;
|
|
606
|
-
* heuristic ScrollView lists still require at least two list-like items.
|
|
607
|
-
*/
|
|
608
|
-
items: ListItemSnapshot[];
|
|
609
|
-
/**
|
|
610
|
-
* Lightweight text projection of the list's FULL data set (capped),
|
|
611
|
-
* captured by the auto-tracking wrapper from `props.data`. Lets the
|
|
612
|
-
* agent see/search rows that virtualization keeps unmounted. Each
|
|
613
|
-
* entry: 0-based data index, stable key (keyExtractor), short text.
|
|
614
|
-
*/
|
|
615
|
-
dataPreview?: ListDataPreviewEntry[];
|
|
616
|
-
/** Current vertical scroll offset in px, when the SDK could read it. */
|
|
617
|
-
scrollOffsetY?: number;
|
|
618
|
-
/** True when there is scrollable content above the viewport. */
|
|
619
|
-
canScrollUp?: boolean;
|
|
620
|
-
/** True when there is scrollable content below the viewport. */
|
|
621
|
-
canScrollDown?: boolean;
|
|
622
|
-
}
|
|
623
|
-
interface ListDataPreviewEntry {
|
|
624
|
-
/** 0-based index in the list's backing data. */
|
|
625
|
-
index: number;
|
|
626
|
-
/** Stable key from keyExtractor / item.id when available. */
|
|
627
|
-
key?: string;
|
|
628
|
-
/** Short human-readable projection of the item (capped length). */
|
|
629
|
-
text: string;
|
|
630
|
-
}
|
|
631
|
-
interface ChoiceOptionSnapshot {
|
|
632
|
-
/** 1-indexed option position within this group. */
|
|
633
|
-
index: number;
|
|
634
|
-
/** Stable-enough id for the current snapshot/action turn. */
|
|
635
|
-
syntheticId: string;
|
|
636
|
-
/** Best target id if this option is backed by a pressable component. */
|
|
637
|
-
targetId?: string;
|
|
638
|
-
/** Human-readable option label. */
|
|
639
|
-
label?: string;
|
|
640
|
-
/** Text segments that belong to this option. */
|
|
641
|
-
texts: string[];
|
|
642
|
-
/** Whether this option appears selected. */
|
|
643
|
-
selected?: boolean;
|
|
644
|
-
/** Whether this option appears disabled. */
|
|
645
|
-
disabled?: boolean;
|
|
646
|
-
}
|
|
647
|
-
interface ChoiceGroupSnapshot {
|
|
648
|
-
/** 0-indexed group ordinal on the current screen. */
|
|
649
|
-
index: number;
|
|
650
|
-
/** Runtime id when known, usually inherited from a list/collection. */
|
|
651
|
-
id?: string;
|
|
652
|
-
/** Human-readable label when known. */
|
|
653
|
-
label?: string;
|
|
654
|
-
/** Source that produced this choice group. */
|
|
655
|
-
source?: 'list' | 'buttons' | 'heuristic';
|
|
656
|
-
/** Visible options in order. */
|
|
657
|
-
options: ChoiceOptionSnapshot[];
|
|
658
|
-
}
|
|
659
|
-
interface InteractionElementListContext {
|
|
660
|
-
listIndex?: number;
|
|
661
|
-
listId?: string;
|
|
662
|
-
listLabel?: string;
|
|
663
|
-
itemIndex?: number;
|
|
664
|
-
itemKey?: string;
|
|
665
|
-
reactKey?: string;
|
|
666
|
-
syntheticId?: string;
|
|
667
|
-
}
|
|
668
|
-
interface InteractionElementSnapshot {
|
|
669
|
-
/** Stable id for the current screen/content, preferred for tool calls. */
|
|
670
|
-
id: string;
|
|
671
|
-
/** Semantic UI role. */
|
|
672
|
-
role: 'option' | 'button' | 'input' | 'toggle' | 'slider' | 'listItem';
|
|
673
|
-
/** Human-readable label. */
|
|
674
|
-
label?: string;
|
|
675
|
-
/** Text segments associated with this element. */
|
|
676
|
-
texts: string[];
|
|
677
|
-
/** Actions supported by this element. */
|
|
678
|
-
actions: Array<'press' | 'focus' | 'toggle' | 'setValue'>;
|
|
679
|
-
/** Whether the element is currently disabled. */
|
|
680
|
-
disabled?: boolean;
|
|
681
|
-
/** Whether the element appears selected. */
|
|
682
|
-
selected?: boolean;
|
|
683
|
-
/** Source that produced the element. */
|
|
684
|
-
source?: 'list' | 'button' | 'input' | 'toggle' | 'slider' | 'choice';
|
|
685
|
-
/** Legacy/fallback target id, if any. */
|
|
686
|
-
targetId?: string;
|
|
687
|
-
/** Context for row/list options. */
|
|
688
|
-
listContext?: InteractionElementListContext;
|
|
689
|
-
/**
|
|
690
|
-
* True when the underlying component lives inside a currently-visible
|
|
691
|
-
* Modal — the only targets actually touchable while the overlay is up.
|
|
692
|
-
*/
|
|
693
|
-
inModal?: boolean;
|
|
694
|
-
}
|
|
695
|
-
interface ScreenSnapshot {
|
|
696
|
-
/** The currently active route name, if known */
|
|
697
|
-
route: string | null;
|
|
698
|
-
/** All visible static text (text content of <Text> components) */
|
|
699
|
-
texts: string[];
|
|
700
|
-
/** All TextInput components currently rendered (and visible) */
|
|
701
|
-
inputs: InputSnapshot[];
|
|
702
|
-
/** All button-like components (TouchableOpacity, Pressable, etc.) */
|
|
703
|
-
buttons: ButtonSnapshot[];
|
|
704
|
-
/** All Switch components */
|
|
705
|
-
toggles: ToggleSnapshot[];
|
|
706
|
-
/**
|
|
707
|
-
* Sliders / adjustable numeric controls. Populated from the
|
|
708
|
-
* ComponentRegistry (useAppilotsSlider) by captureSnapshot — the
|
|
709
|
-
* registry is the only source that knows min/max/step AND can
|
|
710
|
-
* execute set_value, so observation and execution stay in contract.
|
|
711
|
-
*/
|
|
712
|
-
sliders: SliderSnapshot[];
|
|
713
|
-
/** Whether an ActivityIndicator is visible (signals loading state) */
|
|
714
|
-
loading: boolean;
|
|
715
|
-
/** Whether a Modal is currently open */
|
|
716
|
-
modalOpen: boolean;
|
|
717
|
-
/**
|
|
718
|
-
* Lists detected in the visible tree. Each list's items have their
|
|
719
|
-
* own per-item texts/buttons/inputs/toggles, NOT duplicated in the
|
|
720
|
-
* flat top-level arrays — that's the whole reason this field exists,
|
|
721
|
-
* to preserve row association the flat shape destroys.
|
|
722
|
-
*/
|
|
723
|
-
lists: ListSnapshot[];
|
|
724
|
-
/**
|
|
725
|
-
* Choice groups detected from visible cards/rows/chips/buttons.
|
|
726
|
-
* These are used for select-like flows where no TextInput exists:
|
|
727
|
-
* choose an option by pressing a row/card, then advance.
|
|
728
|
-
*/
|
|
729
|
-
choiceGroups: ChoiceGroupSnapshot[];
|
|
730
|
-
/**
|
|
731
|
-
* Interaction graph: visible actionable elements with stable ids,
|
|
732
|
-
* semantic roles, labels, and execution fallbacks. Agents should
|
|
733
|
-
* prefer these ids over synthetic ordinal handles.
|
|
734
|
-
*/
|
|
735
|
-
elements: InteractionElementSnapshot[];
|
|
736
|
-
/** Diagnostic counts for debugging */
|
|
737
|
-
stats?: {
|
|
738
|
-
visitedFibers: number;
|
|
739
|
-
skippedHidden: number;
|
|
740
|
-
};
|
|
741
|
-
}
|
|
742
|
-
|
|
743
526
|
type InteractionElementEntry = InteractionElementSnapshot;
|
|
744
527
|
type Listener = (id: string, entry: InteractionElementEntry | null) => void;
|
|
745
528
|
type ElementRegistry = ElementRegistryImpl;
|
|
@@ -900,14 +683,6 @@ declare function _patchJsxRuntimes(jsxRuntime: any, jsxDevRuntime: any): void;
|
|
|
900
683
|
*/
|
|
901
684
|
declare function isAutoTrackingEnabled(): boolean;
|
|
902
685
|
|
|
903
|
-
type TraceListener = (entries: AppilotsTraceEntry[]) => void;
|
|
904
|
-
declare function recordAppilotsDebugTrace(entry: Omit<AppilotsTraceEntry, 'id'> & {
|
|
905
|
-
id?: string;
|
|
906
|
-
}): void;
|
|
907
|
-
declare function getAppilotsDebugTraces(): AppilotsTraceEntry[];
|
|
908
|
-
declare function clearAppilotsDebugTraces(): void;
|
|
909
|
-
declare function subscribeAppilotsDebugTraces(listener: TraceListener): () => void;
|
|
910
|
-
|
|
911
686
|
/**
|
|
912
687
|
* captureSnapshot — the public entry point for runtime UI introspection.
|
|
913
688
|
*
|
|
@@ -1146,11 +921,4 @@ interface ExecutorContext {
|
|
|
1146
921
|
}
|
|
1147
922
|
declare function executeAction(action: AgentAction, context: ExecutorContext): Promise<ActionResult>;
|
|
1148
923
|
|
|
1149
|
-
|
|
1150
|
-
* SDK version — bumped by changesets on release. Lives in its own module
|
|
1151
|
-
* so runtime code (AppilotsClient) can import it without pulling the whole
|
|
1152
|
-
* public barrel in and creating an import cycle.
|
|
1153
|
-
*/
|
|
1154
|
-
declare const SDK_VERSION = "0.1.0";
|
|
1155
|
-
|
|
1156
|
-
export { ActionBreadcrumb, type ActionBreadcrumbProps, type ActionResult, AgentAction, AgentPermissions, type AppilotsButtonProps, AppilotsChat, type AppilotsChatMode, type AppilotsChatPosition, type AppilotsChatProps, type AppilotsChatTheme, AppilotsEvent, type AppilotsInputProps, AppilotsLocale, type AppilotsRC, AppilotsRegistryProvider, type AppilotsSwitchProps, AppilotsThemeProvider, type AppilotsThemeProviderProps, AppilotsThemeTokens, AppilotsTraceEntry, type BreadcrumbItem, type BreadcrumbState, type ButtonSnapshot, ChatIcon, type ChatIconProps, type ChoiceGroupSnapshot, type ChoiceOptionSnapshot, ComponentRegistry, ConfirmDialog, type ConfirmDialogProps, type ElementRegistry, type ExecutorContext, FieldEntry, HeadsetIcon, type HeadsetIconProps, type InputSnapshot, type InteractionElementEntry, type InteractionElementListContext, type InteractionElementSnapshot, type ListEntry, type ListItemSnapshot, type ListRegistry, type ListSnapshot, PartialThemeTokens, SDK_VERSION, type ScreenSnapshot, type TailwindResolvedConfig, type ToggleSnapshot, _patchJsxRuntimes, appilotsTheme, appilotsThemeFromTailwind, captureSnapshot, clearAppilotsDebugTraces, createAppilotsButton, createAppilotsInput, createAppilotsSwitch, createElementRegistry, createListRegistry, describeAction, elementRegistry, enableAppilotsAutoTracking, executeAction, getAppilotsDebugTraces, getGlobalConfig, humanizeError, initAppilots, isAutoTrackingEnabled, listRegistry, recordAppilotsDebugTrace, subscribeAppilotsDebugTraces, useAppilotsTheme, useResolvedRegistry };
|
|
924
|
+
export { ActionBreadcrumb, type ActionBreadcrumbProps, type ActionResult, AgentAction, AgentPermissions, type AppilotsButtonProps, AppilotsChat, type AppilotsChatMode, type AppilotsChatPosition, type AppilotsChatProps, type AppilotsChatTheme, AppilotsEvent, AppilotsI18nProvider, type AppilotsI18nProviderProps, type AppilotsInputProps, AppilotsLocale, type AppilotsRC, AppilotsRegistryProvider, type AppilotsStringKey, type AppilotsStrings, type AppilotsSwitchProps, AppilotsThemeProvider, type AppilotsThemeProviderProps, AppilotsThemeTokens, ChatIcon, type ChatIconProps, ComponentRegistry, ConfirmDialog, type ConfirmDialogProps, type ElementRegistry, type ExecutorContext, FieldEntry, HeadsetIcon, type HeadsetIconProps, type InteractionElementEntry, InteractionElementSnapshot, type ListEntry, type ListRegistry, PartialThemeTokens, ScreenSnapshot, type TailwindResolvedConfig, _patchJsxRuntimes, appilotsTheme, appilotsThemeFromTailwind, captureSnapshot, createAppilotsButton, createAppilotsInput, createAppilotsSwitch, createElementRegistry, createListRegistry, detectDeviceLocale, elementRegistry, enableAppilotsAutoTracking, executeAction, getGlobalConfig, initAppilots, isAutoTrackingEnabled, listRegistry, resolveLocale, useAppilotsI18n, useAppilotsTheme, useResolvedRegistry };
|