@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.
@@ -1,2 +1,2 @@
1
- export { x as SuggestedPrompt, z as UseAppilotsFieldOptions, B as UseAppilotsSliderOptions, D as UseAppilotsTargetOptions, G as UseAppilotsToggleOptions, H as UseSuggestedPromptsOptions, I as UseSuggestedPromptsReturn, X as useAppilots, Y as useAppilotsActions, Z as useAppilotsChat, $ as useAppilotsField, a1 as useAppilotsNavigation, a2 as useAppilotsSlider, a3 as useAppilotsTarget, a4 as useAppilotsToggle, a5 as useSuggestedPrompts } from '../index-BDb1WVNo.mjs';
1
+ export { H as SuggestedPrompt, O as UseAppilotsFieldOptions, Q as UseAppilotsSliderOptions, V as UseAppilotsTargetOptions, W as UseAppilotsToggleOptions, X as UseSuggestedPromptsOptions, Y as UseSuggestedPromptsReturn, a8 as useAppilots, a9 as useAppilotsActions, aa as useAppilotsChat, ac as useAppilotsField, ad as useAppilotsNavigation, ae as useAppilotsSlider, af as useAppilotsTarget, ag as useAppilotsToggle, ah as useSuggestedPrompts } from '../index-Cb0D6uKH.mjs';
2
2
  import 'react';
@@ -1,2 +1,2 @@
1
- export { x as SuggestedPrompt, z as UseAppilotsFieldOptions, B as UseAppilotsSliderOptions, D as UseAppilotsTargetOptions, G as UseAppilotsToggleOptions, H as UseSuggestedPromptsOptions, I as UseSuggestedPromptsReturn, X as useAppilots, Y as useAppilotsActions, Z as useAppilotsChat, $ as useAppilotsField, a1 as useAppilotsNavigation, a2 as useAppilotsSlider, a3 as useAppilotsTarget, a4 as useAppilotsToggle, a5 as useSuggestedPrompts } from '../index-BDb1WVNo.js';
1
+ export { H as SuggestedPrompt, O as UseAppilotsFieldOptions, Q as UseAppilotsSliderOptions, V as UseAppilotsTargetOptions, W as UseAppilotsToggleOptions, X as UseSuggestedPromptsOptions, Y as UseSuggestedPromptsReturn, a8 as useAppilots, a9 as useAppilotsActions, aa as useAppilotsChat, ac as useAppilotsField, ad as useAppilotsNavigation, ae as useAppilotsSlider, af as useAppilotsTarget, ag as useAppilotsToggle, ah as useSuggestedPrompts } from '../index-Cb0D6uKH.js';
2
2
  import 'react';
@@ -1,43 +1,43 @@
1
1
  'use strict';
2
2
 
3
- var chunkIASJ7YHC_js = require('../chunk-IASJ7YHC.js');
4
- require('../chunk-SIBKF7AA.js');
3
+ var chunkY7EA6R2G_js = require('../chunk-Y7EA6R2G.js');
4
+ require('../chunk-V3TUIIT2.js');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "useAppilots", {
9
9
  enumerable: true,
10
- get: function () { return chunkIASJ7YHC_js.useAppilots; }
10
+ get: function () { return chunkY7EA6R2G_js.useAppilots; }
11
11
  });
12
12
  Object.defineProperty(exports, "useAppilotsActions", {
13
13
  enumerable: true,
14
- get: function () { return chunkIASJ7YHC_js.useAppilotsActions; }
14
+ get: function () { return chunkY7EA6R2G_js.useAppilotsActions; }
15
15
  });
16
16
  Object.defineProperty(exports, "useAppilotsChat", {
17
17
  enumerable: true,
18
- get: function () { return chunkIASJ7YHC_js.useAppilotsChat; }
18
+ get: function () { return chunkY7EA6R2G_js.useAppilotsChat; }
19
19
  });
20
20
  Object.defineProperty(exports, "useAppilotsField", {
21
21
  enumerable: true,
22
- get: function () { return chunkIASJ7YHC_js.useAppilotsField; }
22
+ get: function () { return chunkY7EA6R2G_js.useAppilotsField; }
23
23
  });
24
24
  Object.defineProperty(exports, "useAppilotsNavigation", {
25
25
  enumerable: true,
26
- get: function () { return chunkIASJ7YHC_js.useAppilotsNavigation; }
26
+ get: function () { return chunkY7EA6R2G_js.useAppilotsNavigation; }
27
27
  });
28
28
  Object.defineProperty(exports, "useAppilotsSlider", {
29
29
  enumerable: true,
30
- get: function () { return chunkIASJ7YHC_js.useAppilotsSlider; }
30
+ get: function () { return chunkY7EA6R2G_js.useAppilotsSlider; }
31
31
  });
32
32
  Object.defineProperty(exports, "useAppilotsTarget", {
33
33
  enumerable: true,
34
- get: function () { return chunkIASJ7YHC_js.useAppilotsTarget; }
34
+ get: function () { return chunkY7EA6R2G_js.useAppilotsTarget; }
35
35
  });
36
36
  Object.defineProperty(exports, "useAppilotsToggle", {
37
37
  enumerable: true,
38
- get: function () { return chunkIASJ7YHC_js.useAppilotsToggle; }
38
+ get: function () { return chunkY7EA6R2G_js.useAppilotsToggle; }
39
39
  });
40
40
  Object.defineProperty(exports, "useSuggestedPrompts", {
41
41
  enumerable: true,
42
- get: function () { return chunkIASJ7YHC_js.useSuggestedPrompts; }
42
+ get: function () { return chunkY7EA6R2G_js.useSuggestedPrompts; }
43
43
  });
@@ -1,2 +1,2 @@
1
- export { useAppilots, useAppilotsActions, useAppilotsChat, useAppilotsField, useAppilotsNavigation, useAppilotsSlider, useAppilotsTarget, useAppilotsToggle, useSuggestedPrompts } from '../chunk-GEM6TPAK.mjs';
2
- import '../chunk-HDLZGXNF.mjs';
1
+ export { useAppilots, useAppilotsActions, useAppilotsChat, useAppilotsField, useAppilotsNavigation, useAppilotsSlider, useAppilotsTarget, useAppilotsToggle, useSuggestedPrompts } from '../chunk-42WI3UDB.mjs';
2
+ import '../chunk-JBOLV5AM.mjs';
@@ -119,113 +119,20 @@ type PartialThemeTokens = {
119
119
  declare function mergeThemeTokens(base: AppilotsThemeTokens, partial?: PartialThemeTokens | null): AppilotsThemeTokens;
120
120
 
121
121
  /**
122
- * i18n keys — the canonical list of every translatable string in the
123
- * SDK chat UI. Adding UI copy means adding a key here AND a value in
124
- * every bundle under `./bundles/` (TypeScript will fail the bundle if a
125
- * key is missing). BACKLOG 4.1.
126
- */
127
- interface AppilotsStrings {
128
- /** Default chat header title when the dev hasn't supplied one. */
129
- chatTitle: string;
130
- /** Header button that wipes the conversation. */
131
- clearButton: string;
132
- /** Placeholder for the message input. */
133
- inputPlaceholder: string;
134
- /** Empty state heading. */
135
- emptyTitle: string;
136
- /** Empty state subtitle / one-liner under the heading. */
137
- emptySubtitle: string;
138
- /** "Thinking..." placeholder shown while the assistant is replying. */
139
- thinking: string;
140
- /** Status shown while the assistant is planning from the current screen. */
141
- statusAnalyzing: string;
142
- /** Status shown while the SDK waits for the app to settle after an action. */
143
- statusWaitingApp: string;
144
- /** Status shown while the assistant adjusts after a recoverable failure. */
145
- statusAdjusting: string;
146
- /** Footer line shown when poweredByVisible !== false. */
147
- poweredBy: string;
148
- /** Approve button on a pending action row in the breadcrumb. */
149
- approve: string;
150
- /** Reject button on a pending action row in the breadcrumb. */
151
- reject: string;
152
- /** Generic "cancelled by the user" message after a reject. */
153
- cancelledByUser: string;
154
- /** Fallback humanised name for an unknown action type. */
155
- unknownAction: string;
156
- /** Generic friendly error when nothing else fits. */
157
- somethingWentWrong: string;
158
- /** Open chat accessibility label for the floating bubble. */
159
- openChatA11y: string;
160
- /** Close chat accessibility label. */
161
- closeChatA11y: string;
162
- /** A11y label for the stop-generation button (OKR-008 KR4). */
163
- stopGeneratingA11y: string;
164
- /** A11y label for the "talk to a human" header button. */
165
- talkToHumanA11y: string;
166
- /** Sender label above a human operator's bubble. */
167
- humanAgentLabel: string;
168
- /** System line right after the user (or the offer chip) escalates. */
169
- escalationRequested: string;
170
- /** System line when an operator claims the conversation. */
171
- escalationConnected: string;
172
- /** System line when the operator resolves — AI takes over again. */
173
- escalationResolved: string;
174
- /** System line offering the handoff after the agent gives up. */
175
- escalationOffer: string;
176
- /** Label of the tappable chip under the offer line. */
177
- escalationOfferChip: string;
178
- /** Thin banner under the header while waiting in the queue. */
179
- escalationPendingBanner: string;
180
- /** Thin banner under the header while connected to an operator. */
181
- escalationActiveBanner: string;
182
- }
183
- type AppilotsStringKey = keyof AppilotsStrings;
184
-
185
- /**
186
- * SDK locale code. Adding a locale = adding a bundle file in
187
- * `./bundles/` AND a branch in `BUNDLES` below. BACKLOG 4.1.
122
+ * SDK locale code. Canonical source of truth for `AppilotsLocale` — moved
123
+ * here (out of the React Native-coupled `i18n/I18nProvider`) so that
124
+ * platform-agnostic contract types (`RemotePersonalization.defaultLocale`)
125
+ * don't pull in a React/React Native import just for a string union type.
126
+ *
127
+ * `@appilots/sdk`'s `i18n/I18nProvider.tsx` re-exports this type from its
128
+ * original public path (`@appilots/sdk`'s `./i18n` barrel) so nothing
129
+ * downstream of the SDK's public API changes.
130
+ *
131
+ * Adding a locale = adding a bundle file in `@appilots/sdk`'s
132
+ * `i18n/bundles/` AND a branch in `i18n/I18nProvider.tsx`'s `BUNDLES`
133
+ * map AND a variant here. BACKLOG 4.1.
188
134
  */
189
135
  type AppilotsLocale = 'pt-BR' | 'en' | 'es';
190
- /**
191
- * Best-effort device-locale detection. Returns the closest supported
192
- * locale or `null` if we can't tell. Designed to never throw — RN's
193
- * native modules are platform-specific and can be missing in test
194
- * harnesses.
195
- */
196
- declare function detectDeviceLocale(): AppilotsLocale | null;
197
- /**
198
- * Resolve the locale to use given the prop and the device default.
199
- * Order: explicit prop → device-detected → DEFAULT_LOCALE.
200
- */
201
- declare function resolveLocale(prop?: AppilotsLocale | null): AppilotsLocale;
202
- interface I18nContextValue {
203
- locale: AppilotsLocale;
204
- strings: AppilotsStrings;
205
- /**
206
- * Helper to read a single key. Components can also destructure
207
- * `strings` directly if they need many in one render.
208
- */
209
- t: (key: AppilotsStringKey) => string;
210
- }
211
- interface AppilotsI18nProviderProps {
212
- /** Force a locale. Falls through to device detection when omitted. */
213
- locale?: AppilotsLocale | null;
214
- /**
215
- * Per-key overrides to merge on top of the bundle. Useful when the
216
- * dev wants to rename only "Powered by Appilots" while keeping the
217
- * rest in the default language.
218
- */
219
- overrides?: Partial<AppilotsStrings> | null;
220
- children: React__default.ReactNode;
221
- }
222
- declare function AppilotsI18nProvider({ locale, overrides, children, }: AppilotsI18nProviderProps): React__default.JSX.Element;
223
- /**
224
- * Read the locale + strings from context. Falls back to the default
225
- * locale bundle if no provider is mounted, so components don't need a
226
- * provider to be safe — they just lose the dev's overrides.
227
- */
228
- declare function useAppilotsI18n(): I18nContextValue;
229
136
 
230
137
  /**
231
138
  * Core types for the Appilots SDK.
@@ -459,6 +366,16 @@ interface SendMessageStreamOptions {
459
366
  }
460
367
  /** Runtime context sent with every user message. */
461
368
  interface SendMessageContext {
369
+ /**
370
+ * Which client platform this observation came from — `'react-native'`,
371
+ * `'web'`, `'android'`, `'ios'`, or any other client-defined string.
372
+ * The server treats an absent value as `'react-native'` (see
373
+ * `docs/agent-contract.md`'s "The `platform` field" section), so
374
+ * setting it is optional but forward-compatible: a client that sends
375
+ * it explicitly isn't relying on that default staying `'react-native'`
376
+ * forever.
377
+ */
378
+ platform?: string;
462
379
  currentScreen?: string;
463
380
  formState?: Record<string, unknown>;
464
381
  /** Design-time screen metadata from registerScreen() or the MCP doc */
@@ -684,6 +601,339 @@ declare class AppilotsClient {
684
601
  }): () => void;
685
602
  }
686
603
 
604
+ /**
605
+ * Snapshot types — the platform-agnostic "view model" of what the user
606
+ * is currently seeing on screen, sent to the AI agent so it has
607
+ * accurate visible state.
608
+ *
609
+ * Every platform walker (React Native fiber walk, web DOM walk, ...)
610
+ * produces this same shape; the wire contract it feeds is
611
+ * `agentSnapshotSchema` in `@appilots/shared`.
612
+ */
613
+ interface InputSnapshot {
614
+ /** Best identifier — testID/data-testid, accessibilityLabel/aria-label, or placeholder */
615
+ id?: string;
616
+ /** Human-readable label inferred from accessibility metadata or sibling text */
617
+ label?: string;
618
+ /** Current value (only present for controlled inputs) */
619
+ value?: string;
620
+ /** Placeholder text */
621
+ placeholder?: string;
622
+ /** Whether the input is editable */
623
+ editable?: boolean;
624
+ /** Whether the input is secure (password field) */
625
+ secure?: boolean;
626
+ /** Inferred type based on the platform's input-type metadata */
627
+ type?: 'text' | 'email' | 'number' | 'phone' | 'password';
628
+ /**
629
+ * True when this input lives inside a currently-visible modal. When a
630
+ * modal is open, only inModal elements can actually receive input —
631
+ * everything else is behind the overlay.
632
+ */
633
+ inModal?: boolean;
634
+ }
635
+ interface ButtonSnapshot {
636
+ /** Best identifier — testID/data-testid, accessibilityLabel/aria-label, or inferred from child text */
637
+ id?: string;
638
+ /** Human-readable label — usually the visible text inside the button */
639
+ label?: string;
640
+ /** Whether the button is disabled */
641
+ disabled?: boolean;
642
+ /**
643
+ * Whether the button currently appears selected/active — set by
644
+ * grouped, mutually-exclusive controls (segmented controls, radio
645
+ * groups) where each option is its own pressable target.
646
+ */
647
+ selected?: boolean;
648
+ /** True when this button lives inside a currently-visible modal. */
649
+ inModal?: boolean;
650
+ }
651
+ interface ToggleSnapshot {
652
+ /** Best identifier */
653
+ id?: string;
654
+ /** Human-readable label */
655
+ label?: string;
656
+ /** Current on/off state */
657
+ value?: boolean;
658
+ /** True when this toggle lives inside a currently-visible modal. */
659
+ inModal?: boolean;
660
+ }
661
+ interface SliderSnapshot {
662
+ /** Registry id — the executable handle. */
663
+ id?: string;
664
+ /** Human-readable label */
665
+ label?: string;
666
+ /** Current numeric value */
667
+ value?: number;
668
+ /** Lower bound the executor clamps to */
669
+ min?: number;
670
+ /** Upper bound the executor clamps to */
671
+ max?: number;
672
+ /** Step the executor snaps to (omitted = continuous) */
673
+ step?: number;
674
+ /** Whether the slider is currently disabled */
675
+ disabled?: boolean;
676
+ /** True when this slider lives inside a currently-visible modal. */
677
+ inModal?: boolean;
678
+ }
679
+ interface ListItemSnapshot {
680
+ /** 1-indexed position within the parent list (matches "selecione o terceiro"). */
681
+ index: number;
682
+ /**
683
+ * 0-based index of this row in the list's backing DATA, when known.
684
+ * For scrolled/virtualized lists this differs from `index`.
685
+ */
686
+ dataIndex?: number;
687
+ /** Framework key of the row, if present (typically the item's domain id). */
688
+ reactKey?: string;
689
+ /** Runtime key supplied by list tracking, if available. */
690
+ itemKey?: string;
691
+ /** Texts captured from this item's subtree, preserving row association. */
692
+ texts: string[];
693
+ /** Buttons inside this item — e.g. an inline "Edit" button on a row. */
694
+ buttons: ButtonSnapshot[];
695
+ /** Inputs inside this item — rare but possible (inline edit row). */
696
+ inputs: InputSnapshot[];
697
+ /** Toggles inside this item. */
698
+ toggles: ToggleSnapshot[];
699
+ /**
700
+ * Synthetic id assigned by the walker. Stable within a single
701
+ * snapshot; format `list-<L>-item-<I>` (0-indexed L, 1-indexed I).
702
+ * Used by tap-by-ordinal resolution in the executor.
703
+ */
704
+ syntheticId: string;
705
+ }
706
+ interface ListSnapshot {
707
+ /** 0-indexed list ordinal — multiple lists on one screen get 0, 1, 2... */
708
+ index: number;
709
+ /** Runtime list id when tracking or explicit props provide one. */
710
+ id?: string;
711
+ /** The container component/tag name as observed by the walker. */
712
+ containerType: string;
713
+ /**
714
+ * Source that identified this list. `'fiber'`/`'auto-tracked'` are
715
+ * the walker's own discovery tags (a DOM walker reports
716
+ * `'auto-tracked'` for app-annotated lists and omits the field for
717
+ * heuristically-detected ones); `'registry'` means the list came
718
+ * from the SDK's list registry rather than the tree walk.
719
+ */
720
+ source?: 'fiber' | 'auto-tracked' | 'registry';
721
+ /** Total data-set count when the list exposes it. */
722
+ itemCount?: number;
723
+ /** Number of row items captured in this snapshot. */
724
+ visibleItemCount?: number;
725
+ /** True when the list reports a refresh/loading state. */
726
+ refreshing?: boolean;
727
+ /** True when total item count is known and zero. */
728
+ empty?: boolean;
729
+ /** Human-readable label if the app supplied one. */
730
+ label?: string;
731
+ /** Items in visible order. */
732
+ items: ListItemSnapshot[];
733
+ /**
734
+ * Lightweight text projection of the list's FULL data set (capped),
735
+ * so the agent can see/search rows that virtualization keeps
736
+ * unmounted. Each entry: 0-based data index, stable key, short text.
737
+ */
738
+ dataPreview?: ListDataPreviewEntry[];
739
+ /** Current vertical scroll offset in px, when readable. */
740
+ scrollOffsetY?: number;
741
+ /** True when there is scrollable content above the viewport. */
742
+ canScrollUp?: boolean;
743
+ /** True when there is scrollable content below the viewport. */
744
+ canScrollDown?: boolean;
745
+ }
746
+ interface ListDataPreviewEntry {
747
+ /** 0-based index in the list's backing data. */
748
+ index: number;
749
+ /** Stable key from the item's domain id when available. */
750
+ key?: string;
751
+ /** Short human-readable projection of the item (capped length). */
752
+ text: string;
753
+ }
754
+ interface ChoiceOptionSnapshot {
755
+ /** 1-indexed option position within this group. */
756
+ index: number;
757
+ /** Stable-enough id for the current snapshot/action turn. */
758
+ syntheticId: string;
759
+ /** Best target id if this option is backed by a pressable component. */
760
+ targetId?: string;
761
+ /** Human-readable option label. */
762
+ label?: string;
763
+ /** Text segments that belong to this option. */
764
+ texts: string[];
765
+ /** Whether this option appears selected. */
766
+ selected?: boolean;
767
+ /** Whether this option appears disabled. */
768
+ disabled?: boolean;
769
+ }
770
+ interface ChoiceGroupSnapshot {
771
+ /** 0-indexed group ordinal on the current screen. */
772
+ index: number;
773
+ /** Runtime id when known, usually inherited from a list/collection. */
774
+ id?: string;
775
+ /** Human-readable label when known. */
776
+ label?: string;
777
+ /** Source that produced this choice group. */
778
+ source?: 'list' | 'buttons' | 'heuristic';
779
+ /** Visible options in order. */
780
+ options: ChoiceOptionSnapshot[];
781
+ }
782
+ interface InteractionElementListContext {
783
+ listIndex?: number;
784
+ listId?: string;
785
+ listLabel?: string;
786
+ itemIndex?: number;
787
+ itemKey?: string;
788
+ reactKey?: string;
789
+ syntheticId?: string;
790
+ }
791
+ interface InteractionElementSnapshot {
792
+ /** Stable id for the current screen/content, preferred for tool calls. */
793
+ id: string;
794
+ /** Semantic UI role. */
795
+ role: 'option' | 'button' | 'input' | 'toggle' | 'slider' | 'listItem';
796
+ /** Human-readable label. */
797
+ label?: string;
798
+ /** Text segments associated with this element. */
799
+ texts: string[];
800
+ /** Actions supported by this element. */
801
+ actions: Array<'press' | 'focus' | 'toggle' | 'setValue'>;
802
+ /** Whether the element is currently disabled. */
803
+ disabled?: boolean;
804
+ /** Whether the element appears selected. */
805
+ selected?: boolean;
806
+ /** Source that produced the element. */
807
+ source?: 'list' | 'button' | 'input' | 'toggle' | 'slider' | 'choice';
808
+ /** Legacy/fallback target id, if any. */
809
+ targetId?: string;
810
+ /** Context for row/list options. */
811
+ listContext?: InteractionElementListContext;
812
+ /**
813
+ * True when the underlying component lives inside a currently-visible
814
+ * modal — the only targets actually touchable while the overlay is up.
815
+ */
816
+ inModal?: boolean;
817
+ }
818
+ interface ScreenSnapshot {
819
+ /** The currently active route name, if known */
820
+ route: string | null;
821
+ /** All visible static text */
822
+ texts: string[];
823
+ /** All text inputs currently rendered (and visible) */
824
+ inputs: InputSnapshot[];
825
+ /** All button-like components */
826
+ buttons: ButtonSnapshot[];
827
+ /** All toggle components */
828
+ toggles: ToggleSnapshot[];
829
+ /** Sliders / adjustable numeric controls. */
830
+ sliders: SliderSnapshot[];
831
+ /** Whether a loading indicator is visible */
832
+ loading: boolean;
833
+ /** Whether a modal is currently open */
834
+ modalOpen: boolean;
835
+ /**
836
+ * Lists detected in the visible tree. Each list's items have their
837
+ * own per-item texts/buttons/inputs/toggles, NOT duplicated in the
838
+ * flat top-level arrays — preserving the row association the flat
839
+ * shape destroys.
840
+ */
841
+ lists: ListSnapshot[];
842
+ /**
843
+ * Choice groups detected from visible cards/rows/chips/buttons, used
844
+ * for select-like flows where no text input exists.
845
+ */
846
+ choiceGroups: ChoiceGroupSnapshot[];
847
+ /**
848
+ * Interaction graph: visible actionable elements with stable ids,
849
+ * semantic roles, labels, and execution fallbacks. Agents should
850
+ * prefer these ids over synthetic ordinal handles.
851
+ */
852
+ elements: InteractionElementSnapshot[];
853
+ /** Diagnostic counts for debugging */
854
+ stats?: {
855
+ visitedFibers: number;
856
+ skippedHidden: number;
857
+ };
858
+ }
859
+ /**
860
+ * Localized copy for escalation system messages, injected by the chat
861
+ * surface (the machine has no i18n access — same pattern as errorPrefix).
862
+ * When omitted, no system messages are appended but the state machine
863
+ * still works.
864
+ */
865
+ interface EscalationStrings {
866
+ /** Appended right after the escalation is created. */
867
+ requested: string;
868
+ /** Appended when an operator claims the conversation. */
869
+ connected: string;
870
+ /** Appended when the operator resolves — AI takes over again. */
871
+ resolved: string;
872
+ /** Content of the offer chip message appended when the agent gives up. */
873
+ offer: string;
874
+ }
875
+
876
+ type TraceListener = (entries: AppilotsTraceEntry[]) => void;
877
+ declare function recordAppilotsDebugTrace(entry: Omit<AppilotsTraceEntry, 'id'> & {
878
+ id?: string;
879
+ }): void;
880
+ declare function getAppilotsDebugTraces(): AppilotsTraceEntry[];
881
+ declare function clearAppilotsDebugTraces(): void;
882
+ declare function subscribeAppilotsDebugTraces(listener: TraceListener): () => void;
883
+
884
+ /**
885
+ * Human-readable labels and error messages for the action breadcrumb.
886
+ *
887
+ * Strings are PT-BR hardcoded for now. i18n is planned for backlog item
888
+ * 4.1 (Personalização) — when that lands, these strings move into the
889
+ * locale bundles.
890
+ *
891
+ * Two responsibilities:
892
+ * 1. `describeAction(action)` — turns a typed AgentAction into a label
893
+ * that varies by lifecycle state (pending/running/done/failed).
894
+ * 2. `humanizeError(raw, action)` — sanitises the raw error string from
895
+ * the executor into a short user-facing reason. Stack traces and
896
+ * protocol errors are collapsed into "algo deu errado" so users
897
+ * aren't shown technical noise.
898
+ */
899
+
900
+ type BreadcrumbState = 'pending' | 'running' | 'success' | 'failed';
901
+ interface BreadcrumbItem {
902
+ /** What to render on the line. */
903
+ label: string;
904
+ /** Lifecycle state — drives icon + colour in the breadcrumb. */
905
+ state: BreadcrumbState;
906
+ }
907
+ /**
908
+ * Map an AgentAction + its current status to a breadcrumb item ready to
909
+ * render. The function is intentionally defensive — both the native-tools
910
+ * and JSON-fallback code paths feed actions through here, and the JSON
911
+ * path is loose with payload shapes, so every field access has to assume
912
+ * `unknown`.
913
+ */
914
+ declare function describeAction(action: AgentAction): BreadcrumbItem;
915
+ /**
916
+ * Convert the executor's raw error string into a short, user-facing
917
+ * reason that fits inside parentheses on the breadcrumb line. Returns
918
+ * `undefined` when there's no useful information to show — caller can
919
+ * then drop the parenthetical entirely.
920
+ *
921
+ * Heuristics:
922
+ * - Apply known-pattern rewrites (rejected, not found, network, etc.)
923
+ * - If the result looks technical (stack frame, HTTP status, JSON
924
+ * dump) or is suspiciously long, fall back to "algo deu errado".
925
+ * - Trim and lowercase the first letter so it reads naturally inside
926
+ * the parens after the action verb.
927
+ */
928
+ declare function humanizeError(raw: string | undefined, _action?: AgentAction): string | undefined;
929
+
930
+ /**
931
+ * SDK version — bumped by changesets on release. Lives in its own module
932
+ * so runtime code (AppilotsClient) can import it without pulling the whole
933
+ * public barrel in and creating an import cycle.
934
+ */
935
+ declare const SDK_VERSION = "0.1.0";
936
+
687
937
  interface AppilotsConfig {
688
938
  /** Project ID from the Appilots dashboard */
689
939
  projectId: string;
@@ -800,22 +1050,6 @@ interface UseAppilotsNavigationReturn {
800
1050
  */
801
1051
  declare function useAppilotsNavigation(): UseAppilotsNavigationReturn;
802
1052
 
803
- /**
804
- * Localized copy for escalation system messages, injected by the chat
805
- * surface (the hook has no i18n access — same pattern as errorPrefix).
806
- * When omitted, no system messages are appended but the state machine
807
- * still works.
808
- */
809
- interface EscalationStrings {
810
- /** Appended right after the escalation is created. */
811
- requested: string;
812
- /** Appended when an operator claims the conversation. */
813
- connected: string;
814
- /** Appended when the operator resolves — AI takes over again. */
815
- resolved: string;
816
- /** Content of the offer chip message appended when the agent gives up. */
817
- offer: string;
818
- }
819
1053
  interface UseAppilotsChatReturn {
820
1054
  messages: ChatMessage[];
821
1055
  isLoading: boolean;
@@ -860,6 +1094,12 @@ interface UseAppilotsChatOptions {
860
1094
  /**
861
1095
  * Hook for managing chat state and sending messages to the Appilots agent.
862
1096
  *
1097
+ * This is a thin React binding over `ChatSessionMachine` from
1098
+ * `@appilots/client-core` — the turn/continuation/recovery orchestration
1099
+ * itself is platform-agnostic and shared with the web client. Everything
1100
+ * React Native-specific (Fiber snapshotting, React Navigation settling)
1101
+ * enters through `reactNativeChatAdapter`.
1102
+ *
863
1103
  * @example
864
1104
  * ```tsx
865
1105
  * const { messages, sendMessage, isLoading } = useAppilotsChat();
@@ -894,8 +1134,11 @@ interface UseAppilotsActionsReturn {
894
1134
  /**
895
1135
  * Hook for monitoring and controlling agent actions.
896
1136
  *
897
- * Now integrates with the ActionExecutor to actually execute actions
898
- * against live UI components via the ComponentRegistry.
1137
+ * A thin React binding over `ActionQueueMachine` from
1138
+ * `@appilots/client-core`: the queue, its status transitions, the
1139
+ * confirm gate (server-injected and locally synthesized) and sequential
1140
+ * auto-execution are platform-agnostic. React Native execution goes
1141
+ * through the ActionExecutor via `createReactNativeActionRunner`.
899
1142
  *
900
1143
  * @example
901
1144
  * ```tsx
@@ -1297,4 +1540,4 @@ interface UseSuggestedPromptsReturn {
1297
1540
  */
1298
1541
  declare function useSuggestedPrompts(options: UseSuggestedPromptsOptions): UseSuggestedPromptsReturn;
1299
1542
 
1300
- export { useAppilotsField as $, type AppilotsThemeTokens as A, type UseAppilotsSliderOptions as B, type ComponentRegistry as C, type UseAppilotsTargetOptions as D, type EscalationState as E, type FieldEntry as F, type UseAppilotsToggleOptions as G, type UseSuggestedPromptsOptions as H, type UseSuggestedPromptsReturn as I, componentRegistry as J, createComponentRegistry as K, defaultDarkTheme as L, type MessageRole as M, type NavigationPayload as N, defaultLightTheme as O, type PartialThemeTokens as P, detectDeviceLocale as Q, type RemotePersonalization as R, type SliderEntry as S, type TargetEntry as T, type UIInteractionPayload as U, mergeThemeTokens as V, resolveLocale as W, useAppilots as X, useAppilotsActions as Y, useAppilotsChat as Z, useAppilotsContext as _, type AppilotsLocale as a, useAppilotsI18n as a0, useAppilotsNavigation as a1, useAppilotsSlider as a2, useAppilotsTarget as a3, useAppilotsToggle as a4, useSuggestedPrompts as a5, type AgentAction as b, type AgentPermissions as c, type AppilotsTraceEntry as d, type AppilotsEvent as e, type AgentActionType as f, type AgentMessage as g, AppilotsClient as h, type AppilotsClientOptions as i, type AppilotsConfig as j, type AppilotsEventHandler as k, type AppilotsEventType as l, AppilotsI18nProvider as m, type AppilotsI18nProviderProps as n, AppilotsProvider as o, type AppilotsProviderProps as p, type AppilotsStringKey as q, type AppilotsStrings as r, type AppilotsUser as s, type ChatMessage as t, type ComponentEntry as u, type ComponentKind as v, type FormFillPayload as w, type SuggestedPrompt as x, type ToggleEntry as y, type UseAppilotsFieldOptions as z };
1543
+ export { createComponentRegistry as $, type AppilotsThemeTokens as A, type BreadcrumbItem as B, type ComponentRegistry as C, SDK_VERSION as D, type EscalationState as E, type FieldEntry as F, type SliderEntry as G, type SuggestedPrompt as H, type InteractionElementSnapshot as I, type ToggleEntry as J, type ToggleSnapshot as K, type ListItemSnapshot as L, type MessageRole as M, type NavigationPayload as N, type UseAppilotsFieldOptions as O, type PartialThemeTokens as P, type UseAppilotsSliderOptions as Q, type RemotePersonalization as R, type ScreenSnapshot as S, type TargetEntry as T, type UIInteractionPayload as U, type UseAppilotsTargetOptions as V, type UseAppilotsToggleOptions as W, type UseSuggestedPromptsOptions as X, type UseSuggestedPromptsReturn as Y, clearAppilotsDebugTraces as Z, componentRegistry as _, type AppilotsLocale as a, defaultDarkTheme as a0, defaultLightTheme as a1, describeAction as a2, getAppilotsDebugTraces as a3, humanizeError as a4, mergeThemeTokens as a5, recordAppilotsDebugTrace as a6, subscribeAppilotsDebugTraces as a7, useAppilots as a8, useAppilotsActions as a9, useAppilotsChat as aa, useAppilotsContext as ab, useAppilotsField as ac, useAppilotsNavigation as ad, useAppilotsSlider as ae, useAppilotsTarget as af, useAppilotsToggle as ag, useSuggestedPrompts as ah, type AgentAction as b, type AgentPermissions as c, type AppilotsEvent as d, type AgentActionType as e, type AgentMessage as f, AppilotsClient as g, type AppilotsClientOptions as h, type AppilotsConfig as i, type AppilotsEventHandler as j, type AppilotsEventType as k, AppilotsProvider as l, type AppilotsProviderProps as m, type AppilotsTraceEntry as n, type AppilotsUser as o, type BreadcrumbState as p, type ButtonSnapshot as q, type ChatMessage as r, type ChoiceGroupSnapshot as s, type ChoiceOptionSnapshot as t, type ComponentEntry as u, type ComponentKind as v, type FormFillPayload as w, type InputSnapshot as x, type InteractionElementListContext as y, type ListSnapshot as z };