@appilots/sdk 0.3.0 → 0.4.1
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-QMSMXTED.mjs → chunk-4GUPZDWT.mjs} +1439 -51
- package/dist/{chunk-MCY5YFYD.js → chunk-J75B2HWG.js} +1447 -57
- package/dist/{chunk-BKFO4DHW.mjs → chunk-L2A4EZ6V.mjs} +325 -1480
- package/dist/{chunk-DUSYQXAQ.mjs → chunk-P2BR4DFF.mjs} +1 -1
- package/dist/{chunk-XNKPS7W3.js → chunk-YSLDAQV7.js} +398 -1553
- package/dist/{chunk-N2I3CA7Q.js → chunk-ZWPABTLA.js} +5 -5
- package/dist/hooks/index.d.mts +1 -2
- package/dist/hooks/index.d.ts +1 -2
- package/dist/hooks/index.js +11 -11
- package/dist/hooks/index.mjs +2 -2
- package/dist/index-Cb0D6uKH.d.mts +1543 -0
- package/dist/index-Cb0D6uKH.d.ts +1543 -0
- package/dist/index.d.mts +5 -282
- package/dist/index.d.ts +5 -282
- package/dist/index.js +65 -65
- package/dist/index.mjs +5 -5
- 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 +31 -12
- package/dist/index-BYVRBzjJ.d.mts +0 -619
- package/dist/index-BYVRBzjJ.d.ts +0 -619
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { C as ComponentRegistry, F as FieldEntry } from './index-
|
|
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
|
-
import { PartialThemeTokens, AppilotsThemeTokens, AppilotsLocale, AgentAction, AgentPermissions, AppilotsEvent } from '@appilots/client-core';
|
|
6
|
-
export { AgentAction, AgentActionType, AgentMessage, AgentPermissions, AppilotsClient, AppilotsClientOptions, AppilotsEvent, AppilotsEventHandler, AppilotsEventType, AppilotsLocale, AppilotsThemeTokens, AppilotsTraceEntry, AppilotsUser, BreadcrumbItem, BreadcrumbState, ChatMessage, EscalationState, FormFillPayload, MessageRole, NavigationPayload, PartialThemeTokens, RemotePersonalization, SDK_VERSION, UIInteractionPayload, clearAppilotsDebugTraces, defaultDarkTheme, defaultLightTheme, describeAction, getAppilotsDebugTraces, humanizeError, mergeThemeTokens, recordAppilotsDebugTrace, subscribeAppilotsDebugTraces } from '@appilots/client-core';
|
|
7
5
|
export { A as AppilotsNavigationContainer, N as NavigationConfig, b as ScreenMetadata, r as registerScreen } from './registerScreen-D1oGm28T.mjs';
|
|
8
6
|
|
|
9
7
|
interface AppilotsThemeProviderProps {
|
|
@@ -463,7 +461,7 @@ declare function HeadsetIcon({ size, color }: HeadsetIconProps): React$1.JSX.Ele
|
|
|
463
461
|
* registers that metadata here so snapshots can describe collections
|
|
464
462
|
* without relying only on structural guesses.
|
|
465
463
|
*/
|
|
466
|
-
interface ListDataPreviewEntry
|
|
464
|
+
interface ListDataPreviewEntry {
|
|
467
465
|
/** 0-based index in the list's backing data. */
|
|
468
466
|
index: number;
|
|
469
467
|
/** Stable key from keyExtractor / item.id when available. */
|
|
@@ -500,7 +498,7 @@ interface ListEntry {
|
|
|
500
498
|
* the auto-tracking wrapper from `props.data` so the agent can see
|
|
501
499
|
* rows that virtualization keeps unmounted.
|
|
502
500
|
*/
|
|
503
|
-
dataPreview?: ListDataPreviewEntry
|
|
501
|
+
dataPreview?: ListDataPreviewEntry[];
|
|
504
502
|
/** Scroll so the 0-based data index becomes visible. Returns false when unsupported. */
|
|
505
503
|
scrollToIndex?: (index: number) => boolean;
|
|
506
504
|
/** Scroll to an absolute pixel offset. Returns false when unsupported. */
|
|
@@ -525,281 +523,6 @@ declare class ListRegistryImpl {
|
|
|
525
523
|
declare const listRegistry: ListRegistry;
|
|
526
524
|
declare function createListRegistry(): ListRegistry;
|
|
527
525
|
|
|
528
|
-
/**
|
|
529
|
-
* Snapshot types — the shape of data captured from the React fiber tree.
|
|
530
|
-
*
|
|
531
|
-
* This is the runtime "view model" of what the user is currently seeing
|
|
532
|
-
* on screen, sent to the AI agent so it has accurate visible state.
|
|
533
|
-
*/
|
|
534
|
-
interface InputSnapshot {
|
|
535
|
-
/** Best identifier — testID, accessibilityLabel, or placeholder */
|
|
536
|
-
id?: string;
|
|
537
|
-
/** Human-readable label inferred from accessibilityLabel, label prop, or sibling Text */
|
|
538
|
-
label?: string;
|
|
539
|
-
/** Current value (only present for controlled inputs) */
|
|
540
|
-
value?: string;
|
|
541
|
-
/** Placeholder text */
|
|
542
|
-
placeholder?: string;
|
|
543
|
-
/** Whether the input is editable */
|
|
544
|
-
editable?: boolean;
|
|
545
|
-
/** Whether the input is secure (password field) */
|
|
546
|
-
secure?: boolean;
|
|
547
|
-
/** Inferred type based on keyboardType / secureTextEntry */
|
|
548
|
-
type?: 'text' | 'email' | 'number' | 'phone' | 'password';
|
|
549
|
-
/**
|
|
550
|
-
* True when this input lives inside a currently-visible Modal. When a
|
|
551
|
-
* modal is open, only inModal elements can actually receive touches —
|
|
552
|
-
* everything else is behind the overlay.
|
|
553
|
-
*/
|
|
554
|
-
inModal?: boolean;
|
|
555
|
-
}
|
|
556
|
-
interface ButtonSnapshot {
|
|
557
|
-
/** Best identifier — testID, accessibilityLabel, or inferred from child text */
|
|
558
|
-
id?: string;
|
|
559
|
-
/** Human-readable label — usually the visible text inside the button */
|
|
560
|
-
label?: string;
|
|
561
|
-
/** Whether the button is disabled */
|
|
562
|
-
disabled?: boolean;
|
|
563
|
-
/**
|
|
564
|
-
* Whether the button currently appears selected/active — read from
|
|
565
|
-
* `accessibilityState.selected`. Set by grouped, mutually-exclusive
|
|
566
|
-
* controls (SegmentedControl, RadioGroup) where each option is its
|
|
567
|
-
* own pressable target; absent/false for ordinary buttons.
|
|
568
|
-
*/
|
|
569
|
-
selected?: boolean;
|
|
570
|
-
/** True when this button lives inside a currently-visible Modal. */
|
|
571
|
-
inModal?: boolean;
|
|
572
|
-
}
|
|
573
|
-
interface ToggleSnapshot {
|
|
574
|
-
/** Best identifier — testID or accessibilityLabel */
|
|
575
|
-
id?: string;
|
|
576
|
-
/** Human-readable label */
|
|
577
|
-
label?: string;
|
|
578
|
-
/** Current on/off state */
|
|
579
|
-
value?: boolean;
|
|
580
|
-
/** True when this toggle lives inside a currently-visible Modal. */
|
|
581
|
-
inModal?: boolean;
|
|
582
|
-
}
|
|
583
|
-
interface SliderSnapshot {
|
|
584
|
-
/** Registry id (the id apps pass to useAppilotsSlider) — the executable handle. */
|
|
585
|
-
id?: string;
|
|
586
|
-
/** Human-readable label */
|
|
587
|
-
label?: string;
|
|
588
|
-
/** Current numeric value */
|
|
589
|
-
value?: number;
|
|
590
|
-
/** Lower bound the executor clamps to */
|
|
591
|
-
min?: number;
|
|
592
|
-
/** Upper bound the executor clamps to */
|
|
593
|
-
max?: number;
|
|
594
|
-
/** Step the executor snaps to (omitted = continuous) */
|
|
595
|
-
step?: number;
|
|
596
|
-
/** Whether the slider is currently disabled */
|
|
597
|
-
disabled?: boolean;
|
|
598
|
-
/** True when this slider lives inside a currently-visible Modal. */
|
|
599
|
-
inModal?: boolean;
|
|
600
|
-
}
|
|
601
|
-
interface ListItemSnapshot {
|
|
602
|
-
/** 1-indexed position within the parent list (matches "selecione o terceiro"). */
|
|
603
|
-
index: number;
|
|
604
|
-
/**
|
|
605
|
-
* 0-based index of this row in the list's backing DATA, when the
|
|
606
|
-
* auto-tracking wrapper stamped it (`__appilotsItemIndex`). For
|
|
607
|
-
* scrolled/virtualized lists this differs from `index`: the first
|
|
608
|
-
* MOUNTED row might be data item 42. Lets the prompt show absolute
|
|
609
|
-
* positions ("#43 of 100") so ordinal references stay correct.
|
|
610
|
-
*/
|
|
611
|
-
dataIndex?: number;
|
|
612
|
-
/**
|
|
613
|
-
* React key of the cell, if present (typically the item's domain id
|
|
614
|
-
* from keyExtractor). Useful for the LLM when the user references an
|
|
615
|
-
* item by name and we want to surface a deterministic handle for
|
|
616
|
-
* future tap-by-ordinal resolution (Phase B).
|
|
617
|
-
*/
|
|
618
|
-
reactKey?: string;
|
|
619
|
-
/** Runtime key supplied by auto-tracked list renderItem, if available. */
|
|
620
|
-
itemKey?: string;
|
|
621
|
-
/**
|
|
622
|
-
* Texts captured from this item's subtree (vehicle name, plate,
|
|
623
|
-
* tags, etc.). Per-item to preserve row association — the flat
|
|
624
|
-
* `snapshot.texts` lost it.
|
|
625
|
-
*/
|
|
626
|
-
texts: string[];
|
|
627
|
-
/** Buttons inside this item — e.g. an inline "Edit" button on a row. */
|
|
628
|
-
buttons: ButtonSnapshot[];
|
|
629
|
-
/** Inputs inside this item — rare but possible (inline edit row). */
|
|
630
|
-
inputs: InputSnapshot[];
|
|
631
|
-
/** Toggles inside this item. */
|
|
632
|
-
toggles: ToggleSnapshot[];
|
|
633
|
-
/**
|
|
634
|
-
* Synthetic id assigned by the walker. Stable within a single
|
|
635
|
-
* snapshot; format `list-<L>-item-<I>` (0-indexed L, 1-indexed I).
|
|
636
|
-
* Used by Phase B's tap-by-ordinal resolution in uiInteractionHandler.
|
|
637
|
-
*/
|
|
638
|
-
syntheticId: string;
|
|
639
|
-
}
|
|
640
|
-
interface ListSnapshot {
|
|
641
|
-
/** 0-indexed list ordinal — multiple lists on one screen get 0, 1, 2... */
|
|
642
|
-
index: number;
|
|
643
|
-
/** Runtime list id when auto-tracking or explicit props provide one. */
|
|
644
|
-
id?: string;
|
|
645
|
-
/**
|
|
646
|
-
* The container component name as observed in the fiber tree.
|
|
647
|
-
* Common values: 'FlatList', 'SectionList', 'VirtualizedList',
|
|
648
|
-
* 'FlashList', 'ScrollView' (when detected by N≥2 keyed children).
|
|
649
|
-
*/
|
|
650
|
-
containerType: string;
|
|
651
|
-
/** Source that identified this list. */
|
|
652
|
-
source?: 'fiber' | 'auto-tracked' | 'registry';
|
|
653
|
-
/** Total data-set count when the list component exposes it. */
|
|
654
|
-
itemCount?: number;
|
|
655
|
-
/** Number of row items captured in this snapshot. */
|
|
656
|
-
visibleItemCount?: number;
|
|
657
|
-
/** True when the list reports a refresh/loading state. */
|
|
658
|
-
refreshing?: boolean;
|
|
659
|
-
/** True when total item count is known and zero. */
|
|
660
|
-
empty?: boolean;
|
|
661
|
-
/** Human-readable label if the app supplied one. */
|
|
662
|
-
label?: string;
|
|
663
|
-
/**
|
|
664
|
-
* Items in visible order. Real list components may expose one mounted
|
|
665
|
-
* item when virtualization or an overlay limits the visible window;
|
|
666
|
-
* heuristic ScrollView lists still require at least two list-like items.
|
|
667
|
-
*/
|
|
668
|
-
items: ListItemSnapshot[];
|
|
669
|
-
/**
|
|
670
|
-
* Lightweight text projection of the list's FULL data set (capped),
|
|
671
|
-
* captured by the auto-tracking wrapper from `props.data`. Lets the
|
|
672
|
-
* agent see/search rows that virtualization keeps unmounted. Each
|
|
673
|
-
* entry: 0-based data index, stable key (keyExtractor), short text.
|
|
674
|
-
*/
|
|
675
|
-
dataPreview?: ListDataPreviewEntry[];
|
|
676
|
-
/** Current vertical scroll offset in px, when the SDK could read it. */
|
|
677
|
-
scrollOffsetY?: number;
|
|
678
|
-
/** True when there is scrollable content above the viewport. */
|
|
679
|
-
canScrollUp?: boolean;
|
|
680
|
-
/** True when there is scrollable content below the viewport. */
|
|
681
|
-
canScrollDown?: boolean;
|
|
682
|
-
}
|
|
683
|
-
interface ListDataPreviewEntry {
|
|
684
|
-
/** 0-based index in the list's backing data. */
|
|
685
|
-
index: number;
|
|
686
|
-
/** Stable key from keyExtractor / item.id when available. */
|
|
687
|
-
key?: string;
|
|
688
|
-
/** Short human-readable projection of the item (capped length). */
|
|
689
|
-
text: string;
|
|
690
|
-
}
|
|
691
|
-
interface ChoiceOptionSnapshot {
|
|
692
|
-
/** 1-indexed option position within this group. */
|
|
693
|
-
index: number;
|
|
694
|
-
/** Stable-enough id for the current snapshot/action turn. */
|
|
695
|
-
syntheticId: string;
|
|
696
|
-
/** Best target id if this option is backed by a pressable component. */
|
|
697
|
-
targetId?: string;
|
|
698
|
-
/** Human-readable option label. */
|
|
699
|
-
label?: string;
|
|
700
|
-
/** Text segments that belong to this option. */
|
|
701
|
-
texts: string[];
|
|
702
|
-
/** Whether this option appears selected. */
|
|
703
|
-
selected?: boolean;
|
|
704
|
-
/** Whether this option appears disabled. */
|
|
705
|
-
disabled?: boolean;
|
|
706
|
-
}
|
|
707
|
-
interface ChoiceGroupSnapshot {
|
|
708
|
-
/** 0-indexed group ordinal on the current screen. */
|
|
709
|
-
index: number;
|
|
710
|
-
/** Runtime id when known, usually inherited from a list/collection. */
|
|
711
|
-
id?: string;
|
|
712
|
-
/** Human-readable label when known. */
|
|
713
|
-
label?: string;
|
|
714
|
-
/** Source that produced this choice group. */
|
|
715
|
-
source?: 'list' | 'buttons' | 'heuristic';
|
|
716
|
-
/** Visible options in order. */
|
|
717
|
-
options: ChoiceOptionSnapshot[];
|
|
718
|
-
}
|
|
719
|
-
interface InteractionElementListContext {
|
|
720
|
-
listIndex?: number;
|
|
721
|
-
listId?: string;
|
|
722
|
-
listLabel?: string;
|
|
723
|
-
itemIndex?: number;
|
|
724
|
-
itemKey?: string;
|
|
725
|
-
reactKey?: string;
|
|
726
|
-
syntheticId?: string;
|
|
727
|
-
}
|
|
728
|
-
interface InteractionElementSnapshot {
|
|
729
|
-
/** Stable id for the current screen/content, preferred for tool calls. */
|
|
730
|
-
id: string;
|
|
731
|
-
/** Semantic UI role. */
|
|
732
|
-
role: 'option' | 'button' | 'input' | 'toggle' | 'slider' | 'listItem';
|
|
733
|
-
/** Human-readable label. */
|
|
734
|
-
label?: string;
|
|
735
|
-
/** Text segments associated with this element. */
|
|
736
|
-
texts: string[];
|
|
737
|
-
/** Actions supported by this element. */
|
|
738
|
-
actions: Array<'press' | 'focus' | 'toggle' | 'setValue'>;
|
|
739
|
-
/** Whether the element is currently disabled. */
|
|
740
|
-
disabled?: boolean;
|
|
741
|
-
/** Whether the element appears selected. */
|
|
742
|
-
selected?: boolean;
|
|
743
|
-
/** Source that produced the element. */
|
|
744
|
-
source?: 'list' | 'button' | 'input' | 'toggle' | 'slider' | 'choice';
|
|
745
|
-
/** Legacy/fallback target id, if any. */
|
|
746
|
-
targetId?: string;
|
|
747
|
-
/** Context for row/list options. */
|
|
748
|
-
listContext?: InteractionElementListContext;
|
|
749
|
-
/**
|
|
750
|
-
* True when the underlying component lives inside a currently-visible
|
|
751
|
-
* Modal — the only targets actually touchable while the overlay is up.
|
|
752
|
-
*/
|
|
753
|
-
inModal?: boolean;
|
|
754
|
-
}
|
|
755
|
-
interface ScreenSnapshot {
|
|
756
|
-
/** The currently active route name, if known */
|
|
757
|
-
route: string | null;
|
|
758
|
-
/** All visible static text (text content of <Text> components) */
|
|
759
|
-
texts: string[];
|
|
760
|
-
/** All TextInput components currently rendered (and visible) */
|
|
761
|
-
inputs: InputSnapshot[];
|
|
762
|
-
/** All button-like components (TouchableOpacity, Pressable, etc.) */
|
|
763
|
-
buttons: ButtonSnapshot[];
|
|
764
|
-
/** All Switch components */
|
|
765
|
-
toggles: ToggleSnapshot[];
|
|
766
|
-
/**
|
|
767
|
-
* Sliders / adjustable numeric controls. Populated from the
|
|
768
|
-
* ComponentRegistry (useAppilotsSlider) by captureSnapshot — the
|
|
769
|
-
* registry is the only source that knows min/max/step AND can
|
|
770
|
-
* execute set_value, so observation and execution stay in contract.
|
|
771
|
-
*/
|
|
772
|
-
sliders: SliderSnapshot[];
|
|
773
|
-
/** Whether an ActivityIndicator is visible (signals loading state) */
|
|
774
|
-
loading: boolean;
|
|
775
|
-
/** Whether a Modal is currently open */
|
|
776
|
-
modalOpen: boolean;
|
|
777
|
-
/**
|
|
778
|
-
* Lists detected in the visible tree. Each list's items have their
|
|
779
|
-
* own per-item texts/buttons/inputs/toggles, NOT duplicated in the
|
|
780
|
-
* flat top-level arrays — that's the whole reason this field exists,
|
|
781
|
-
* to preserve row association the flat shape destroys.
|
|
782
|
-
*/
|
|
783
|
-
lists: ListSnapshot[];
|
|
784
|
-
/**
|
|
785
|
-
* Choice groups detected from visible cards/rows/chips/buttons.
|
|
786
|
-
* These are used for select-like flows where no TextInput exists:
|
|
787
|
-
* choose an option by pressing a row/card, then advance.
|
|
788
|
-
*/
|
|
789
|
-
choiceGroups: ChoiceGroupSnapshot[];
|
|
790
|
-
/**
|
|
791
|
-
* Interaction graph: visible actionable elements with stable ids,
|
|
792
|
-
* semantic roles, labels, and execution fallbacks. Agents should
|
|
793
|
-
* prefer these ids over synthetic ordinal handles.
|
|
794
|
-
*/
|
|
795
|
-
elements: InteractionElementSnapshot[];
|
|
796
|
-
/** Diagnostic counts for debugging */
|
|
797
|
-
stats?: {
|
|
798
|
-
visitedFibers: number;
|
|
799
|
-
skippedHidden: number;
|
|
800
|
-
};
|
|
801
|
-
}
|
|
802
|
-
|
|
803
526
|
type InteractionElementEntry = InteractionElementSnapshot;
|
|
804
527
|
type Listener = (id: string, entry: InteractionElementEntry | null) => void;
|
|
805
528
|
type ElementRegistry = ElementRegistryImpl;
|
|
@@ -1198,4 +921,4 @@ interface ExecutorContext {
|
|
|
1198
921
|
}
|
|
1199
922
|
declare function executeAction(action: AgentAction, context: ExecutorContext): Promise<ActionResult>;
|
|
1200
923
|
|
|
1201
|
-
export { ActionBreadcrumb, type ActionBreadcrumbProps, type ActionResult, type AppilotsButtonProps, AppilotsChat, type AppilotsChatMode, type AppilotsChatPosition, type AppilotsChatProps, type AppilotsChatTheme, AppilotsI18nProvider, type AppilotsI18nProviderProps, type AppilotsInputProps, type AppilotsRC, AppilotsRegistryProvider, type AppilotsStringKey, type AppilotsStrings, type AppilotsSwitchProps, AppilotsThemeProvider, type AppilotsThemeProviderProps,
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { C as ComponentRegistry, F as FieldEntry } from './index-
|
|
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.js';
|
|
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.js';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import React__default from 'react';
|
|
5
|
-
import { PartialThemeTokens, AppilotsThemeTokens, AppilotsLocale, AgentAction, AgentPermissions, AppilotsEvent } from '@appilots/client-core';
|
|
6
|
-
export { AgentAction, AgentActionType, AgentMessage, AgentPermissions, AppilotsClient, AppilotsClientOptions, AppilotsEvent, AppilotsEventHandler, AppilotsEventType, AppilotsLocale, AppilotsThemeTokens, AppilotsTraceEntry, AppilotsUser, BreadcrumbItem, BreadcrumbState, ChatMessage, EscalationState, FormFillPayload, MessageRole, NavigationPayload, PartialThemeTokens, RemotePersonalization, SDK_VERSION, UIInteractionPayload, clearAppilotsDebugTraces, defaultDarkTheme, defaultLightTheme, describeAction, getAppilotsDebugTraces, humanizeError, mergeThemeTokens, recordAppilotsDebugTrace, subscribeAppilotsDebugTraces } from '@appilots/client-core';
|
|
7
5
|
export { A as AppilotsNavigationContainer, N as NavigationConfig, b as ScreenMetadata, r as registerScreen } from './registerScreen-D1oGm28T.js';
|
|
8
6
|
|
|
9
7
|
interface AppilotsThemeProviderProps {
|
|
@@ -463,7 +461,7 @@ declare function HeadsetIcon({ size, color }: HeadsetIconProps): React$1.JSX.Ele
|
|
|
463
461
|
* registers that metadata here so snapshots can describe collections
|
|
464
462
|
* without relying only on structural guesses.
|
|
465
463
|
*/
|
|
466
|
-
interface ListDataPreviewEntry
|
|
464
|
+
interface ListDataPreviewEntry {
|
|
467
465
|
/** 0-based index in the list's backing data. */
|
|
468
466
|
index: number;
|
|
469
467
|
/** Stable key from keyExtractor / item.id when available. */
|
|
@@ -500,7 +498,7 @@ interface ListEntry {
|
|
|
500
498
|
* the auto-tracking wrapper from `props.data` so the agent can see
|
|
501
499
|
* rows that virtualization keeps unmounted.
|
|
502
500
|
*/
|
|
503
|
-
dataPreview?: ListDataPreviewEntry
|
|
501
|
+
dataPreview?: ListDataPreviewEntry[];
|
|
504
502
|
/** Scroll so the 0-based data index becomes visible. Returns false when unsupported. */
|
|
505
503
|
scrollToIndex?: (index: number) => boolean;
|
|
506
504
|
/** Scroll to an absolute pixel offset. Returns false when unsupported. */
|
|
@@ -525,281 +523,6 @@ declare class ListRegistryImpl {
|
|
|
525
523
|
declare const listRegistry: ListRegistry;
|
|
526
524
|
declare function createListRegistry(): ListRegistry;
|
|
527
525
|
|
|
528
|
-
/**
|
|
529
|
-
* Snapshot types — the shape of data captured from the React fiber tree.
|
|
530
|
-
*
|
|
531
|
-
* This is the runtime "view model" of what the user is currently seeing
|
|
532
|
-
* on screen, sent to the AI agent so it has accurate visible state.
|
|
533
|
-
*/
|
|
534
|
-
interface InputSnapshot {
|
|
535
|
-
/** Best identifier — testID, accessibilityLabel, or placeholder */
|
|
536
|
-
id?: string;
|
|
537
|
-
/** Human-readable label inferred from accessibilityLabel, label prop, or sibling Text */
|
|
538
|
-
label?: string;
|
|
539
|
-
/** Current value (only present for controlled inputs) */
|
|
540
|
-
value?: string;
|
|
541
|
-
/** Placeholder text */
|
|
542
|
-
placeholder?: string;
|
|
543
|
-
/** Whether the input is editable */
|
|
544
|
-
editable?: boolean;
|
|
545
|
-
/** Whether the input is secure (password field) */
|
|
546
|
-
secure?: boolean;
|
|
547
|
-
/** Inferred type based on keyboardType / secureTextEntry */
|
|
548
|
-
type?: 'text' | 'email' | 'number' | 'phone' | 'password';
|
|
549
|
-
/**
|
|
550
|
-
* True when this input lives inside a currently-visible Modal. When a
|
|
551
|
-
* modal is open, only inModal elements can actually receive touches —
|
|
552
|
-
* everything else is behind the overlay.
|
|
553
|
-
*/
|
|
554
|
-
inModal?: boolean;
|
|
555
|
-
}
|
|
556
|
-
interface ButtonSnapshot {
|
|
557
|
-
/** Best identifier — testID, accessibilityLabel, or inferred from child text */
|
|
558
|
-
id?: string;
|
|
559
|
-
/** Human-readable label — usually the visible text inside the button */
|
|
560
|
-
label?: string;
|
|
561
|
-
/** Whether the button is disabled */
|
|
562
|
-
disabled?: boolean;
|
|
563
|
-
/**
|
|
564
|
-
* Whether the button currently appears selected/active — read from
|
|
565
|
-
* `accessibilityState.selected`. Set by grouped, mutually-exclusive
|
|
566
|
-
* controls (SegmentedControl, RadioGroup) where each option is its
|
|
567
|
-
* own pressable target; absent/false for ordinary buttons.
|
|
568
|
-
*/
|
|
569
|
-
selected?: boolean;
|
|
570
|
-
/** True when this button lives inside a currently-visible Modal. */
|
|
571
|
-
inModal?: boolean;
|
|
572
|
-
}
|
|
573
|
-
interface ToggleSnapshot {
|
|
574
|
-
/** Best identifier — testID or accessibilityLabel */
|
|
575
|
-
id?: string;
|
|
576
|
-
/** Human-readable label */
|
|
577
|
-
label?: string;
|
|
578
|
-
/** Current on/off state */
|
|
579
|
-
value?: boolean;
|
|
580
|
-
/** True when this toggle lives inside a currently-visible Modal. */
|
|
581
|
-
inModal?: boolean;
|
|
582
|
-
}
|
|
583
|
-
interface SliderSnapshot {
|
|
584
|
-
/** Registry id (the id apps pass to useAppilotsSlider) — the executable handle. */
|
|
585
|
-
id?: string;
|
|
586
|
-
/** Human-readable label */
|
|
587
|
-
label?: string;
|
|
588
|
-
/** Current numeric value */
|
|
589
|
-
value?: number;
|
|
590
|
-
/** Lower bound the executor clamps to */
|
|
591
|
-
min?: number;
|
|
592
|
-
/** Upper bound the executor clamps to */
|
|
593
|
-
max?: number;
|
|
594
|
-
/** Step the executor snaps to (omitted = continuous) */
|
|
595
|
-
step?: number;
|
|
596
|
-
/** Whether the slider is currently disabled */
|
|
597
|
-
disabled?: boolean;
|
|
598
|
-
/** True when this slider lives inside a currently-visible Modal. */
|
|
599
|
-
inModal?: boolean;
|
|
600
|
-
}
|
|
601
|
-
interface ListItemSnapshot {
|
|
602
|
-
/** 1-indexed position within the parent list (matches "selecione o terceiro"). */
|
|
603
|
-
index: number;
|
|
604
|
-
/**
|
|
605
|
-
* 0-based index of this row in the list's backing DATA, when the
|
|
606
|
-
* auto-tracking wrapper stamped it (`__appilotsItemIndex`). For
|
|
607
|
-
* scrolled/virtualized lists this differs from `index`: the first
|
|
608
|
-
* MOUNTED row might be data item 42. Lets the prompt show absolute
|
|
609
|
-
* positions ("#43 of 100") so ordinal references stay correct.
|
|
610
|
-
*/
|
|
611
|
-
dataIndex?: number;
|
|
612
|
-
/**
|
|
613
|
-
* React key of the cell, if present (typically the item's domain id
|
|
614
|
-
* from keyExtractor). Useful for the LLM when the user references an
|
|
615
|
-
* item by name and we want to surface a deterministic handle for
|
|
616
|
-
* future tap-by-ordinal resolution (Phase B).
|
|
617
|
-
*/
|
|
618
|
-
reactKey?: string;
|
|
619
|
-
/** Runtime key supplied by auto-tracked list renderItem, if available. */
|
|
620
|
-
itemKey?: string;
|
|
621
|
-
/**
|
|
622
|
-
* Texts captured from this item's subtree (vehicle name, plate,
|
|
623
|
-
* tags, etc.). Per-item to preserve row association — the flat
|
|
624
|
-
* `snapshot.texts` lost it.
|
|
625
|
-
*/
|
|
626
|
-
texts: string[];
|
|
627
|
-
/** Buttons inside this item — e.g. an inline "Edit" button on a row. */
|
|
628
|
-
buttons: ButtonSnapshot[];
|
|
629
|
-
/** Inputs inside this item — rare but possible (inline edit row). */
|
|
630
|
-
inputs: InputSnapshot[];
|
|
631
|
-
/** Toggles inside this item. */
|
|
632
|
-
toggles: ToggleSnapshot[];
|
|
633
|
-
/**
|
|
634
|
-
* Synthetic id assigned by the walker. Stable within a single
|
|
635
|
-
* snapshot; format `list-<L>-item-<I>` (0-indexed L, 1-indexed I).
|
|
636
|
-
* Used by Phase B's tap-by-ordinal resolution in uiInteractionHandler.
|
|
637
|
-
*/
|
|
638
|
-
syntheticId: string;
|
|
639
|
-
}
|
|
640
|
-
interface ListSnapshot {
|
|
641
|
-
/** 0-indexed list ordinal — multiple lists on one screen get 0, 1, 2... */
|
|
642
|
-
index: number;
|
|
643
|
-
/** Runtime list id when auto-tracking or explicit props provide one. */
|
|
644
|
-
id?: string;
|
|
645
|
-
/**
|
|
646
|
-
* The container component name as observed in the fiber tree.
|
|
647
|
-
* Common values: 'FlatList', 'SectionList', 'VirtualizedList',
|
|
648
|
-
* 'FlashList', 'ScrollView' (when detected by N≥2 keyed children).
|
|
649
|
-
*/
|
|
650
|
-
containerType: string;
|
|
651
|
-
/** Source that identified this list. */
|
|
652
|
-
source?: 'fiber' | 'auto-tracked' | 'registry';
|
|
653
|
-
/** Total data-set count when the list component exposes it. */
|
|
654
|
-
itemCount?: number;
|
|
655
|
-
/** Number of row items captured in this snapshot. */
|
|
656
|
-
visibleItemCount?: number;
|
|
657
|
-
/** True when the list reports a refresh/loading state. */
|
|
658
|
-
refreshing?: boolean;
|
|
659
|
-
/** True when total item count is known and zero. */
|
|
660
|
-
empty?: boolean;
|
|
661
|
-
/** Human-readable label if the app supplied one. */
|
|
662
|
-
label?: string;
|
|
663
|
-
/**
|
|
664
|
-
* Items in visible order. Real list components may expose one mounted
|
|
665
|
-
* item when virtualization or an overlay limits the visible window;
|
|
666
|
-
* heuristic ScrollView lists still require at least two list-like items.
|
|
667
|
-
*/
|
|
668
|
-
items: ListItemSnapshot[];
|
|
669
|
-
/**
|
|
670
|
-
* Lightweight text projection of the list's FULL data set (capped),
|
|
671
|
-
* captured by the auto-tracking wrapper from `props.data`. Lets the
|
|
672
|
-
* agent see/search rows that virtualization keeps unmounted. Each
|
|
673
|
-
* entry: 0-based data index, stable key (keyExtractor), short text.
|
|
674
|
-
*/
|
|
675
|
-
dataPreview?: ListDataPreviewEntry[];
|
|
676
|
-
/** Current vertical scroll offset in px, when the SDK could read it. */
|
|
677
|
-
scrollOffsetY?: number;
|
|
678
|
-
/** True when there is scrollable content above the viewport. */
|
|
679
|
-
canScrollUp?: boolean;
|
|
680
|
-
/** True when there is scrollable content below the viewport. */
|
|
681
|
-
canScrollDown?: boolean;
|
|
682
|
-
}
|
|
683
|
-
interface ListDataPreviewEntry {
|
|
684
|
-
/** 0-based index in the list's backing data. */
|
|
685
|
-
index: number;
|
|
686
|
-
/** Stable key from keyExtractor / item.id when available. */
|
|
687
|
-
key?: string;
|
|
688
|
-
/** Short human-readable projection of the item (capped length). */
|
|
689
|
-
text: string;
|
|
690
|
-
}
|
|
691
|
-
interface ChoiceOptionSnapshot {
|
|
692
|
-
/** 1-indexed option position within this group. */
|
|
693
|
-
index: number;
|
|
694
|
-
/** Stable-enough id for the current snapshot/action turn. */
|
|
695
|
-
syntheticId: string;
|
|
696
|
-
/** Best target id if this option is backed by a pressable component. */
|
|
697
|
-
targetId?: string;
|
|
698
|
-
/** Human-readable option label. */
|
|
699
|
-
label?: string;
|
|
700
|
-
/** Text segments that belong to this option. */
|
|
701
|
-
texts: string[];
|
|
702
|
-
/** Whether this option appears selected. */
|
|
703
|
-
selected?: boolean;
|
|
704
|
-
/** Whether this option appears disabled. */
|
|
705
|
-
disabled?: boolean;
|
|
706
|
-
}
|
|
707
|
-
interface ChoiceGroupSnapshot {
|
|
708
|
-
/** 0-indexed group ordinal on the current screen. */
|
|
709
|
-
index: number;
|
|
710
|
-
/** Runtime id when known, usually inherited from a list/collection. */
|
|
711
|
-
id?: string;
|
|
712
|
-
/** Human-readable label when known. */
|
|
713
|
-
label?: string;
|
|
714
|
-
/** Source that produced this choice group. */
|
|
715
|
-
source?: 'list' | 'buttons' | 'heuristic';
|
|
716
|
-
/** Visible options in order. */
|
|
717
|
-
options: ChoiceOptionSnapshot[];
|
|
718
|
-
}
|
|
719
|
-
interface InteractionElementListContext {
|
|
720
|
-
listIndex?: number;
|
|
721
|
-
listId?: string;
|
|
722
|
-
listLabel?: string;
|
|
723
|
-
itemIndex?: number;
|
|
724
|
-
itemKey?: string;
|
|
725
|
-
reactKey?: string;
|
|
726
|
-
syntheticId?: string;
|
|
727
|
-
}
|
|
728
|
-
interface InteractionElementSnapshot {
|
|
729
|
-
/** Stable id for the current screen/content, preferred for tool calls. */
|
|
730
|
-
id: string;
|
|
731
|
-
/** Semantic UI role. */
|
|
732
|
-
role: 'option' | 'button' | 'input' | 'toggle' | 'slider' | 'listItem';
|
|
733
|
-
/** Human-readable label. */
|
|
734
|
-
label?: string;
|
|
735
|
-
/** Text segments associated with this element. */
|
|
736
|
-
texts: string[];
|
|
737
|
-
/** Actions supported by this element. */
|
|
738
|
-
actions: Array<'press' | 'focus' | 'toggle' | 'setValue'>;
|
|
739
|
-
/** Whether the element is currently disabled. */
|
|
740
|
-
disabled?: boolean;
|
|
741
|
-
/** Whether the element appears selected. */
|
|
742
|
-
selected?: boolean;
|
|
743
|
-
/** Source that produced the element. */
|
|
744
|
-
source?: 'list' | 'button' | 'input' | 'toggle' | 'slider' | 'choice';
|
|
745
|
-
/** Legacy/fallback target id, if any. */
|
|
746
|
-
targetId?: string;
|
|
747
|
-
/** Context for row/list options. */
|
|
748
|
-
listContext?: InteractionElementListContext;
|
|
749
|
-
/**
|
|
750
|
-
* True when the underlying component lives inside a currently-visible
|
|
751
|
-
* Modal — the only targets actually touchable while the overlay is up.
|
|
752
|
-
*/
|
|
753
|
-
inModal?: boolean;
|
|
754
|
-
}
|
|
755
|
-
interface ScreenSnapshot {
|
|
756
|
-
/** The currently active route name, if known */
|
|
757
|
-
route: string | null;
|
|
758
|
-
/** All visible static text (text content of <Text> components) */
|
|
759
|
-
texts: string[];
|
|
760
|
-
/** All TextInput components currently rendered (and visible) */
|
|
761
|
-
inputs: InputSnapshot[];
|
|
762
|
-
/** All button-like components (TouchableOpacity, Pressable, etc.) */
|
|
763
|
-
buttons: ButtonSnapshot[];
|
|
764
|
-
/** All Switch components */
|
|
765
|
-
toggles: ToggleSnapshot[];
|
|
766
|
-
/**
|
|
767
|
-
* Sliders / adjustable numeric controls. Populated from the
|
|
768
|
-
* ComponentRegistry (useAppilotsSlider) by captureSnapshot — the
|
|
769
|
-
* registry is the only source that knows min/max/step AND can
|
|
770
|
-
* execute set_value, so observation and execution stay in contract.
|
|
771
|
-
*/
|
|
772
|
-
sliders: SliderSnapshot[];
|
|
773
|
-
/** Whether an ActivityIndicator is visible (signals loading state) */
|
|
774
|
-
loading: boolean;
|
|
775
|
-
/** Whether a Modal is currently open */
|
|
776
|
-
modalOpen: boolean;
|
|
777
|
-
/**
|
|
778
|
-
* Lists detected in the visible tree. Each list's items have their
|
|
779
|
-
* own per-item texts/buttons/inputs/toggles, NOT duplicated in the
|
|
780
|
-
* flat top-level arrays — that's the whole reason this field exists,
|
|
781
|
-
* to preserve row association the flat shape destroys.
|
|
782
|
-
*/
|
|
783
|
-
lists: ListSnapshot[];
|
|
784
|
-
/**
|
|
785
|
-
* Choice groups detected from visible cards/rows/chips/buttons.
|
|
786
|
-
* These are used for select-like flows where no TextInput exists:
|
|
787
|
-
* choose an option by pressing a row/card, then advance.
|
|
788
|
-
*/
|
|
789
|
-
choiceGroups: ChoiceGroupSnapshot[];
|
|
790
|
-
/**
|
|
791
|
-
* Interaction graph: visible actionable elements with stable ids,
|
|
792
|
-
* semantic roles, labels, and execution fallbacks. Agents should
|
|
793
|
-
* prefer these ids over synthetic ordinal handles.
|
|
794
|
-
*/
|
|
795
|
-
elements: InteractionElementSnapshot[];
|
|
796
|
-
/** Diagnostic counts for debugging */
|
|
797
|
-
stats?: {
|
|
798
|
-
visitedFibers: number;
|
|
799
|
-
skippedHidden: number;
|
|
800
|
-
};
|
|
801
|
-
}
|
|
802
|
-
|
|
803
526
|
type InteractionElementEntry = InteractionElementSnapshot;
|
|
804
527
|
type Listener = (id: string, entry: InteractionElementEntry | null) => void;
|
|
805
528
|
type ElementRegistry = ElementRegistryImpl;
|
|
@@ -1198,4 +921,4 @@ interface ExecutorContext {
|
|
|
1198
921
|
}
|
|
1199
922
|
declare function executeAction(action: AgentAction, context: ExecutorContext): Promise<ActionResult>;
|
|
1200
923
|
|
|
1201
|
-
export { ActionBreadcrumb, type ActionBreadcrumbProps, type ActionResult, type AppilotsButtonProps, AppilotsChat, type AppilotsChatMode, type AppilotsChatPosition, type AppilotsChatProps, type AppilotsChatTheme, AppilotsI18nProvider, type AppilotsI18nProviderProps, type AppilotsInputProps, type AppilotsRC, AppilotsRegistryProvider, type AppilotsStringKey, type AppilotsStrings, type AppilotsSwitchProps, AppilotsThemeProvider, type AppilotsThemeProviderProps,
|
|
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 };
|