@appilots/sdk 0.11.1 → 0.13.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/control-transformer.js +69 -0
- package/dist/.build-meta.json +3 -3
- package/dist/{chunk-X4MPSZL3.js → chunk-AJDHZRBN.js} +1180 -487
- package/dist/{chunk-DRXUBLGY.js → chunk-ALJGKORS.js} +8 -8
- package/dist/{chunk-PQZ64CCE.mjs → chunk-HRWBK35Y.mjs} +6007 -527
- package/dist/{chunk-LLH7QCSX.mjs → chunk-L3SY3Q4K.mjs} +1 -1
- package/dist/{chunk-GSHE45YX.mjs → chunk-UYBKXULM.mjs} +903 -223
- package/dist/{chunk-KZ2BLMS4.js → chunk-UZ2D4BVX.js} +6026 -525
- 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-C01Spw6F.d.mts → index-CI4jmSoP.d.mts} +136 -549
- package/dist/{index-C01Spw6F.d.ts → index-CI4jmSoP.d.ts} +136 -549
- package/dist/index.d.mts +1472 -76
- package/dist/index.d.ts +1472 -76
- package/dist/index.js +1100 -673
- package/dist/index.mjs +933 -565
- package/dist/navigation/index.d.mts +64 -7
- package/dist/navigation/index.d.ts +64 -7
- package/dist/navigation/index.js +13 -13
- package/dist/navigation/index.mjs +2 -2
- package/metro.d.ts +3 -5
- package/metro.js +46 -5
- package/package.json +16 -2
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
|
|
4
|
+
/** Customer conversation/UI locales. Map text and host-app labels may use other languages. */
|
|
5
|
+
declare const SUPPORTED_APPILOTS_LOCALES: readonly ["pt-BR", "en", "es", "fr"];
|
|
6
|
+
type SupportedAppilotsLocale = (typeof SUPPORTED_APPILOTS_LOCALES)[number];
|
|
7
|
+
|
|
8
|
+
type MissionStatus = 'awaiting_approval' | 'running' | 'paused' | 'blocked' | 'completed' | 'cancelled';
|
|
9
|
+
interface MissionScope {
|
|
10
|
+
id: string;
|
|
11
|
+
revision: number;
|
|
12
|
+
operation: 'delete';
|
|
13
|
+
screen: string;
|
|
14
|
+
listId: string;
|
|
15
|
+
items: Array<{
|
|
16
|
+
key: string;
|
|
17
|
+
label: string;
|
|
18
|
+
}>;
|
|
19
|
+
expiresAt: number;
|
|
20
|
+
}
|
|
21
|
+
interface MissionView {
|
|
22
|
+
scope: MissionScope;
|
|
23
|
+
objective: string;
|
|
24
|
+
status: MissionStatus;
|
|
25
|
+
completed: number;
|
|
26
|
+
total: number;
|
|
27
|
+
reason?: string;
|
|
28
|
+
progressText: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
4
31
|
/**
|
|
5
32
|
* Theme tokens — the source of truth for any color, font, radius or
|
|
6
33
|
* shadow used inside the SDK's chat UI. Components must read from these
|
|
@@ -132,7 +159,7 @@ declare function mergeThemeTokens(base: AppilotsThemeTokens, partial?: PartialTh
|
|
|
132
159
|
* `i18n/bundles/` AND a branch in `i18n/I18nProvider.tsx`'s `BUNDLES`
|
|
133
160
|
* map AND a variant here. BACKLOG 4.1.
|
|
134
161
|
*/
|
|
135
|
-
type AppilotsLocale =
|
|
162
|
+
type AppilotsLocale = SupportedAppilotsLocale;
|
|
136
163
|
|
|
137
164
|
/**
|
|
138
165
|
* Core types for the Appilots SDK.
|
|
@@ -282,7 +309,9 @@ interface AgentPermissions {
|
|
|
282
309
|
blockedScreens?: string[];
|
|
283
310
|
allowedActions?: AgentActionType[];
|
|
284
311
|
}
|
|
285
|
-
type AppilotsEventType = 'agent:action:start'
|
|
312
|
+
type AppilotsEventType = 'agent:action:start'
|
|
313
|
+
/** Queue dispatch, after approval; distinct from a proposed action. */
|
|
314
|
+
| 'agent:action:executing' | 'agent:action:complete' | 'agent:action:error' | 'agent:message' | 'navigation:change' | 'chat:open' | 'chat:close' | 'chat:cancel' | 'chat:escalation:start' | 'chat:escalation:message' | 'chat:escalation:end' | 'sdk:introspection:unavailable';
|
|
286
315
|
interface AppilotsEvent {
|
|
287
316
|
type: AppilotsEventType;
|
|
288
317
|
timestamp: number;
|
|
@@ -301,6 +330,12 @@ interface EscalationState {
|
|
|
301
330
|
operatorName?: string;
|
|
302
331
|
}
|
|
303
332
|
|
|
333
|
+
/** Optional host storage; only a session handle is stored, never screen contents. */
|
|
334
|
+
interface AppilotsSessionStorage {
|
|
335
|
+
getItem(key: string): Promise<string | null>;
|
|
336
|
+
setItem(key: string, value: string): Promise<void>;
|
|
337
|
+
removeItem(key: string): Promise<void>;
|
|
338
|
+
}
|
|
304
339
|
/**
|
|
305
340
|
* Mirrors `introspectionDiagnosticsSchema` on the wire. Declared here
|
|
306
341
|
* rather than imported so client-core stays free of the server's
|
|
@@ -315,6 +350,7 @@ interface IntrospectionDiagnosticsInput {
|
|
|
315
350
|
failureCount?: number;
|
|
316
351
|
}
|
|
317
352
|
interface AppilotsClientOptions {
|
|
353
|
+
sessionStorage?: AppilotsSessionStorage;
|
|
318
354
|
projectId: string;
|
|
319
355
|
apiBaseUrl?: string;
|
|
320
356
|
apiKey?: string;
|
|
@@ -381,6 +417,8 @@ interface AppilotsUser {
|
|
|
381
417
|
identifiers?: Record<string, string>;
|
|
382
418
|
}
|
|
383
419
|
interface SendMessageResponse {
|
|
420
|
+
mission?: MissionView;
|
|
421
|
+
replyLocale?: SupportedAppilotsLocale;
|
|
384
422
|
sessionId: string;
|
|
385
423
|
message: ChatMessage;
|
|
386
424
|
/** Summary message to show AFTER actions complete */
|
|
@@ -400,6 +438,7 @@ interface SendMessageStreamOptions {
|
|
|
400
438
|
onTextDelta?: (chunk: string, fullText: string) => void;
|
|
401
439
|
/** Fired once when the server announces the session id. */
|
|
402
440
|
onSession?: (sessionId: string) => void;
|
|
441
|
+
onReplyLocale?: (locale: SupportedAppilotsLocale) => void;
|
|
403
442
|
/** Abort mid-generation (stop button). Rejects with name='AbortError'. */
|
|
404
443
|
signal?: AbortSignal;
|
|
405
444
|
}
|
|
@@ -429,6 +468,10 @@ declare class RateLimitedError extends Error {
|
|
|
429
468
|
}
|
|
430
469
|
/** Runtime context sent with every user message. */
|
|
431
470
|
interface SendMessageContext {
|
|
471
|
+
missionProtocol?: 1;
|
|
472
|
+
missionId?: string;
|
|
473
|
+
/** Supported device language, independent of the app/map/visible UI locale. */
|
|
474
|
+
deviceLocale?: SupportedAppilotsLocale;
|
|
432
475
|
/**
|
|
433
476
|
* Which client platform this observation came from — `'react-native'`,
|
|
434
477
|
* `'web'`, `'android'`, `'ios'`, or any other client-defined string.
|
|
@@ -484,6 +527,11 @@ declare class AppilotsClient {
|
|
|
484
527
|
private readonly introspectionReporter;
|
|
485
528
|
private readonly user;
|
|
486
529
|
private sessionId;
|
|
530
|
+
private mission;
|
|
531
|
+
private missionDispatchPaused;
|
|
532
|
+
private readonly sessionStorage;
|
|
533
|
+
private readonly sessionStorageKey;
|
|
534
|
+
private sessionLoad;
|
|
487
535
|
/** Guard so identify fires at most once per client instance. */
|
|
488
536
|
private identified;
|
|
489
537
|
constructor(options: AppilotsClientOptions);
|
|
@@ -570,6 +618,23 @@ declare class AppilotsClient {
|
|
|
570
618
|
isDone: boolean;
|
|
571
619
|
hop: number;
|
|
572
620
|
}>;
|
|
621
|
+
private acceptMission;
|
|
622
|
+
getMission(): MissionView | null;
|
|
623
|
+
pauseMissionLocally(): void;
|
|
624
|
+
missionApprovalAllowed(action: AgentAction): boolean;
|
|
625
|
+
missionScopeForAction(action: AgentAction): MissionScope | undefined;
|
|
626
|
+
claimMissionAction(action: AgentAction, context: Record<string, unknown>): Promise<{
|
|
627
|
+
allowed: boolean;
|
|
628
|
+
scope: MissionScope;
|
|
629
|
+
expiresAt: number;
|
|
630
|
+
}>;
|
|
631
|
+
controlMission(command: 'observe' | 'pause' | 'resume' | 'cancel', context: Record<string, unknown>): Promise<SendMessageResponse & {
|
|
632
|
+
isDone: boolean;
|
|
633
|
+
hop: number;
|
|
634
|
+
}>;
|
|
635
|
+
private persistSession;
|
|
636
|
+
private loadStoredSession;
|
|
637
|
+
restoreMission(): Promise<MissionView | null>;
|
|
573
638
|
executeAction(actionId: string): Promise<AgentAction>;
|
|
574
639
|
/**
|
|
575
640
|
* Rewrite an action's type when the AI used a semantically-misclassified
|
|
@@ -685,489 +750,6 @@ declare class AppilotsClient {
|
|
|
685
750
|
}): () => void;
|
|
686
751
|
}
|
|
687
752
|
|
|
688
|
-
/**
|
|
689
|
-
* Snapshot types — the platform-agnostic "view model" of what the user
|
|
690
|
-
* is currently seeing on screen, sent to the AI agent so it has
|
|
691
|
-
* accurate visible state.
|
|
692
|
-
*
|
|
693
|
-
* Every platform walker (React Native fiber walk, web DOM walk, ...)
|
|
694
|
-
* produces this same shape; the wire contract it feeds is
|
|
695
|
-
* `agentSnapshotSchema` in `@appilots/shared`.
|
|
696
|
-
*/
|
|
697
|
-
/**
|
|
698
|
-
* How much the walker actually knows about an element's identifier.
|
|
699
|
-
*
|
|
700
|
-
* The observation used to say nothing here, so `btn-3` — an ordinal the
|
|
701
|
-
* walker invented — read to the model exactly like `testID="submit-order"`,
|
|
702
|
-
* which a developer wrote down on purpose. That is how a confident press on
|
|
703
|
-
* the wrong control happens.
|
|
704
|
-
*
|
|
705
|
-
* - `declared` the app named it: `testID` / `data-testid` /
|
|
706
|
-
* `accessibilityLabel` / `aria-label`. Stable across renders
|
|
707
|
-
* and across releases; safe to copy into a tool call.
|
|
708
|
-
* - `derived` folded from what the user can see — the button's own text,
|
|
709
|
-
* a `label` or `placeholder` prop. Stable as long as the copy
|
|
710
|
-
* does not change, and it changes with the app's language.
|
|
711
|
-
* - `positional` nothing but an ordinal in the current snapshot. Valid for
|
|
712
|
-
* this observation only: a re-render, a scroll or an inserted
|
|
713
|
-
* sibling moves it.
|
|
714
|
-
*
|
|
715
|
-
* ABSENT means unknown, NOT `declared` — clients published before this field
|
|
716
|
-
* existed send no provenance at all, and a missing value must never be read
|
|
717
|
-
* as the most trustworthy one.
|
|
718
|
-
*/
|
|
719
|
-
type IdentityProvenance = 'declared' | 'derived' | 'positional';
|
|
720
|
-
interface InputSnapshot {
|
|
721
|
-
/** Best identifier — testID/data-testid, accessibilityLabel/aria-label, or placeholder */
|
|
722
|
-
id?: string;
|
|
723
|
-
/** How `id` was obtained. See {@link IdentityProvenance}. */
|
|
724
|
-
provenance?: IdentityProvenance;
|
|
725
|
-
/**
|
|
726
|
-
* False when the control is mounted but currently outside the window —
|
|
727
|
-
* below the fold of a ScrollView, scrolled off the top, pushed sideways
|
|
728
|
-
* by a carousel.
|
|
729
|
-
*
|
|
730
|
-
* ABSENT MEANS UNKNOWN. The old React Native architecture cannot report a
|
|
731
|
-
* synchronous window-relative rect, and no SDK published before this
|
|
732
|
-
* field existed reports one at all; reading absence as `false` would make
|
|
733
|
-
* the agent refuse to press a control the user is looking at.
|
|
734
|
-
*/
|
|
735
|
-
onScreen?: boolean;
|
|
736
|
-
/** Human-readable label inferred from accessibility metadata or sibling text */
|
|
737
|
-
label?: string;
|
|
738
|
-
/** Current value (only present for controlled inputs) */
|
|
739
|
-
value?: string;
|
|
740
|
-
/** Placeholder text */
|
|
741
|
-
placeholder?: string;
|
|
742
|
-
/** Whether the input is editable */
|
|
743
|
-
editable?: boolean;
|
|
744
|
-
/** Whether the input is secure (password field) */
|
|
745
|
-
secure?: boolean;
|
|
746
|
-
/** Inferred type based on the platform's input-type metadata */
|
|
747
|
-
type?: 'text' | 'email' | 'number' | 'phone' | 'password';
|
|
748
|
-
/**
|
|
749
|
-
* True when pressing return on this field submits — RN's
|
|
750
|
-
* `onSubmitEditing`, the web's implicit form submit.
|
|
751
|
-
*
|
|
752
|
-
* On a search box, a one-field login or a chat composer this IS the
|
|
753
|
-
* submit; the screen has no button and never will. Absent means the
|
|
754
|
-
* field declares no such handler, so the form needs a button.
|
|
755
|
-
*/
|
|
756
|
-
submitsOnReturn?: boolean;
|
|
757
|
-
/**
|
|
758
|
-
* True when this input lives inside a currently-visible modal. When a
|
|
759
|
-
* modal is open, only inModal elements can actually receive input —
|
|
760
|
-
* everything else is behind the overlay.
|
|
761
|
-
*/
|
|
762
|
-
inModal?: boolean;
|
|
763
|
-
}
|
|
764
|
-
interface ButtonSnapshot {
|
|
765
|
-
/** Best identifier — testID/data-testid, accessibilityLabel/aria-label, or inferred from child text */
|
|
766
|
-
id?: string;
|
|
767
|
-
/** How `id` was obtained. See {@link IdentityProvenance}. */
|
|
768
|
-
provenance?: IdentityProvenance;
|
|
769
|
-
/**
|
|
770
|
-
* False when the control is mounted but currently outside the window —
|
|
771
|
-
* below the fold of a ScrollView, scrolled off the top, pushed sideways
|
|
772
|
-
* by a carousel.
|
|
773
|
-
*
|
|
774
|
-
* ABSENT MEANS UNKNOWN. The old React Native architecture cannot report a
|
|
775
|
-
* synchronous window-relative rect, and no SDK published before this
|
|
776
|
-
* field existed reports one at all; reading absence as `false` would make
|
|
777
|
-
* the agent refuse to press a control the user is looking at.
|
|
778
|
-
*/
|
|
779
|
-
onScreen?: boolean;
|
|
780
|
-
/** Human-readable label — usually the visible text inside the button */
|
|
781
|
-
label?: string;
|
|
782
|
-
/** Whether the button is disabled */
|
|
783
|
-
disabled?: boolean;
|
|
784
|
-
/**
|
|
785
|
-
* Whether this control is currently in its ON state.
|
|
786
|
-
*
|
|
787
|
-
* Covers both accessibility states that mean it, because the agent
|
|
788
|
-
* needs the same thing from either: `accessibilityState.selected`
|
|
789
|
-
* (grouped, mutually-exclusive controls — segmented controls, radio
|
|
790
|
-
* groups, each option its own pressable target) and
|
|
791
|
-
* `accessibilityState.checked` (an independent checkbox).
|
|
792
|
-
*
|
|
793
|
-
* Absent means "not on OR not observable" — the walker cannot tell a
|
|
794
|
-
* custom checkbox that declares no a11y state from an ordinary button,
|
|
795
|
-
* so absence is never proof that a box is unticked.
|
|
796
|
-
*/
|
|
797
|
-
selected?: boolean;
|
|
798
|
-
/** True when this button lives inside a currently-visible modal. */
|
|
799
|
-
inModal?: boolean;
|
|
800
|
-
}
|
|
801
|
-
interface ToggleSnapshot {
|
|
802
|
-
/** Best identifier */
|
|
803
|
-
id?: string;
|
|
804
|
-
/** How `id` was obtained. See {@link IdentityProvenance}. */
|
|
805
|
-
provenance?: IdentityProvenance;
|
|
806
|
-
/**
|
|
807
|
-
* False when the control is mounted but currently outside the window —
|
|
808
|
-
* below the fold of a ScrollView, scrolled off the top, pushed sideways
|
|
809
|
-
* by a carousel.
|
|
810
|
-
*
|
|
811
|
-
* ABSENT MEANS UNKNOWN. The old React Native architecture cannot report a
|
|
812
|
-
* synchronous window-relative rect, and no SDK published before this
|
|
813
|
-
* field existed reports one at all; reading absence as `false` would make
|
|
814
|
-
* the agent refuse to press a control the user is looking at.
|
|
815
|
-
*/
|
|
816
|
-
onScreen?: boolean;
|
|
817
|
-
/** Human-readable label */
|
|
818
|
-
label?: string;
|
|
819
|
-
/** Current on/off state */
|
|
820
|
-
value?: boolean;
|
|
821
|
-
/** True when this toggle lives inside a currently-visible modal. */
|
|
822
|
-
inModal?: boolean;
|
|
823
|
-
}
|
|
824
|
-
interface SliderSnapshot {
|
|
825
|
-
/** Registry id — the executable handle. */
|
|
826
|
-
id?: string;
|
|
827
|
-
/** How `id` was obtained. See {@link IdentityProvenance}. */
|
|
828
|
-
provenance?: IdentityProvenance;
|
|
829
|
-
/**
|
|
830
|
-
* False when the control is mounted but currently outside the window —
|
|
831
|
-
* below the fold of a ScrollView, scrolled off the top, pushed sideways
|
|
832
|
-
* by a carousel.
|
|
833
|
-
*
|
|
834
|
-
* ABSENT MEANS UNKNOWN. The old React Native architecture cannot report a
|
|
835
|
-
* synchronous window-relative rect, and no SDK published before this
|
|
836
|
-
* field existed reports one at all; reading absence as `false` would make
|
|
837
|
-
* the agent refuse to press a control the user is looking at.
|
|
838
|
-
*/
|
|
839
|
-
onScreen?: boolean;
|
|
840
|
-
/** Human-readable label */
|
|
841
|
-
label?: string;
|
|
842
|
-
/** Current numeric value */
|
|
843
|
-
value?: number;
|
|
844
|
-
/** Lower bound the executor clamps to */
|
|
845
|
-
min?: number;
|
|
846
|
-
/** Upper bound the executor clamps to */
|
|
847
|
-
max?: number;
|
|
848
|
-
/** Step the executor snaps to (omitted = continuous) */
|
|
849
|
-
step?: number;
|
|
850
|
-
/** Whether the slider is currently disabled */
|
|
851
|
-
disabled?: boolean;
|
|
852
|
-
/** True when this slider lives inside a currently-visible modal. */
|
|
853
|
-
inModal?: boolean;
|
|
854
|
-
}
|
|
855
|
-
interface ListItemSnapshot {
|
|
856
|
-
/** 1-indexed position within the parent list (matches "selecione o terceiro"). */
|
|
857
|
-
index: number;
|
|
858
|
-
/**
|
|
859
|
-
* 0-based index of this row in the list's backing DATA, when known.
|
|
860
|
-
* For scrolled/virtualized lists this differs from `index`.
|
|
861
|
-
*/
|
|
862
|
-
dataIndex?: number;
|
|
863
|
-
/** Framework key of the row, if present (typically the item's domain id). */
|
|
864
|
-
reactKey?: string;
|
|
865
|
-
/** Runtime key supplied by list tracking, if available. */
|
|
866
|
-
itemKey?: string;
|
|
867
|
-
/** Texts captured from this item's subtree, preserving row association. */
|
|
868
|
-
texts: string[];
|
|
869
|
-
/** Buttons inside this item — e.g. an inline "Edit" button on a row. */
|
|
870
|
-
buttons: ButtonSnapshot[];
|
|
871
|
-
/** Inputs inside this item — rare but possible (inline edit row). */
|
|
872
|
-
inputs: InputSnapshot[];
|
|
873
|
-
/** Toggles inside this item. */
|
|
874
|
-
toggles: ToggleSnapshot[];
|
|
875
|
-
/**
|
|
876
|
-
* Synthetic id assigned by the walker. Stable within a single
|
|
877
|
-
* snapshot; format `list-<L>-item-<I>` (0-indexed L, 1-indexed I).
|
|
878
|
-
* Used by tap-by-ordinal resolution in the executor.
|
|
879
|
-
*/
|
|
880
|
-
syntheticId: string;
|
|
881
|
-
}
|
|
882
|
-
interface ListSnapshot {
|
|
883
|
-
/** 0-indexed list ordinal — multiple lists on one screen get 0, 1, 2... */
|
|
884
|
-
index: number;
|
|
885
|
-
/** Runtime list id when tracking or explicit props provide one. */
|
|
886
|
-
id?: string;
|
|
887
|
-
/** The container component/tag name as observed by the walker. */
|
|
888
|
-
containerType: string;
|
|
889
|
-
/**
|
|
890
|
-
* Source that identified this list. `'fiber'`/`'auto-tracked'` are
|
|
891
|
-
* the walker's own discovery tags (a DOM walker reports
|
|
892
|
-
* `'auto-tracked'` for app-annotated lists and omits the field for
|
|
893
|
-
* heuristically-detected ones); `'registry'` means the list came
|
|
894
|
-
* from the SDK's list registry rather than the tree walk.
|
|
895
|
-
*/
|
|
896
|
-
source?: 'fiber' | 'auto-tracked' | 'registry';
|
|
897
|
-
/** Total data-set count when the list exposes it. */
|
|
898
|
-
itemCount?: number;
|
|
899
|
-
/** Number of row items captured in this snapshot. */
|
|
900
|
-
visibleItemCount?: number;
|
|
901
|
-
/** True when the list reports a refresh/loading state. */
|
|
902
|
-
refreshing?: boolean;
|
|
903
|
-
/** True when total item count is known and zero. */
|
|
904
|
-
empty?: boolean;
|
|
905
|
-
/** Human-readable label if the app supplied one. */
|
|
906
|
-
label?: string;
|
|
907
|
-
/** Items in visible order. */
|
|
908
|
-
items: ListItemSnapshot[];
|
|
909
|
-
/**
|
|
910
|
-
* Lightweight text projection of the list's FULL data set (capped),
|
|
911
|
-
* so the agent can see/search rows that virtualization keeps
|
|
912
|
-
* unmounted. Each entry: 0-based data index, stable key, short text.
|
|
913
|
-
*/
|
|
914
|
-
dataPreview?: ListDataPreviewEntry[];
|
|
915
|
-
/** Current vertical scroll offset in px, when readable. */
|
|
916
|
-
scrollOffsetY?: number;
|
|
917
|
-
/** True when there is scrollable content above the viewport. */
|
|
918
|
-
canScrollUp?: boolean;
|
|
919
|
-
/** True when there is scrollable content below the viewport. */
|
|
920
|
-
canScrollDown?: boolean;
|
|
921
|
-
}
|
|
922
|
-
interface ListDataPreviewEntry {
|
|
923
|
-
/** 0-based index in the list's backing data. */
|
|
924
|
-
index: number;
|
|
925
|
-
/** Stable key from the item's domain id when available. */
|
|
926
|
-
key?: string;
|
|
927
|
-
/** Short human-readable projection of the item (capped length). */
|
|
928
|
-
text: string;
|
|
929
|
-
}
|
|
930
|
-
/**
|
|
931
|
-
* A scrollable surface that is NOT a collection — a long form, a detail
|
|
932
|
-
* page, a settings screen inside a `ScrollView`.
|
|
933
|
-
*
|
|
934
|
-
* It exists as its own concept, and not as a `ListSnapshot` with zero
|
|
935
|
-
* rows, because everything the agent knows how to do with a list
|
|
936
|
-
* (ordinals, totals, "select the third one") is meaningless here. The
|
|
937
|
-
* only affordance is paging toward content below the fold — and without
|
|
938
|
-
* it, a screen taller than the viewport ends at the fold.
|
|
939
|
-
*/
|
|
940
|
-
interface ScrollableSnapshot {
|
|
941
|
-
/** Runtime id — the handle `scroll_list` addresses. */
|
|
942
|
-
id: string;
|
|
943
|
-
/** The container component as observed: ScrollView, ... */
|
|
944
|
-
containerType: string;
|
|
945
|
-
/** Human-readable label if the app supplied one. */
|
|
946
|
-
label?: string;
|
|
947
|
-
/** Current scroll offset in px. */
|
|
948
|
-
scrollOffsetY?: number;
|
|
949
|
-
/** True when there is content above the viewport. */
|
|
950
|
-
canScrollUp?: boolean;
|
|
951
|
-
/** True when there is content below the viewport. */
|
|
952
|
-
canScrollDown?: boolean;
|
|
953
|
-
/** True when the surface scrolls sideways rather than vertically. */
|
|
954
|
-
horizontal?: boolean;
|
|
955
|
-
}
|
|
956
|
-
/**
|
|
957
|
-
* A platform dialog covering the screen — React Native's `Alert.alert`,
|
|
958
|
-
* an action sheet, an OS permission prompt.
|
|
959
|
-
*
|
|
960
|
-
* It renders outside React, so no amount of tree walking finds it. It
|
|
961
|
-
* has to be reported separately or the agent keeps operating the app
|
|
962
|
-
* underneath a dialog that blocks every real finger.
|
|
963
|
-
*/
|
|
964
|
-
interface NativeDialogSnapshot {
|
|
965
|
-
/** Stable for as long as this dialog is open. */
|
|
966
|
-
id: string;
|
|
967
|
-
title?: string;
|
|
968
|
-
message?: string;
|
|
969
|
-
/** The buttons the user can press. Never empty. */
|
|
970
|
-
buttons: Array<{
|
|
971
|
-
label: string;
|
|
972
|
-
style?: 'default' | 'cancel' | 'destructive';
|
|
973
|
-
}>;
|
|
974
|
-
}
|
|
975
|
-
interface ChoiceOptionSnapshot {
|
|
976
|
-
/** 1-indexed option position within this group. */
|
|
977
|
-
index: number;
|
|
978
|
-
/** Stable-enough id for the current snapshot/action turn. */
|
|
979
|
-
syntheticId: string;
|
|
980
|
-
/** Best target id if this option is backed by a pressable component. */
|
|
981
|
-
targetId?: string;
|
|
982
|
-
/** Human-readable option label. */
|
|
983
|
-
label?: string;
|
|
984
|
-
/** Text segments that belong to this option. */
|
|
985
|
-
texts: string[];
|
|
986
|
-
/** Whether this option appears selected. */
|
|
987
|
-
selected?: boolean;
|
|
988
|
-
/** Whether this option appears disabled. */
|
|
989
|
-
disabled?: boolean;
|
|
990
|
-
}
|
|
991
|
-
interface ChoiceGroupSnapshot {
|
|
992
|
-
/** 0-indexed group ordinal on the current screen. */
|
|
993
|
-
index: number;
|
|
994
|
-
/** Runtime id when known, usually inherited from a list/collection. */
|
|
995
|
-
id?: string;
|
|
996
|
-
/** Human-readable label when known. */
|
|
997
|
-
label?: string;
|
|
998
|
-
/** Source that produced this choice group. */
|
|
999
|
-
source?: 'list' | 'buttons' | 'heuristic';
|
|
1000
|
-
/** Visible options in order. */
|
|
1001
|
-
options: ChoiceOptionSnapshot[];
|
|
1002
|
-
}
|
|
1003
|
-
interface InteractionElementListContext {
|
|
1004
|
-
listIndex?: number;
|
|
1005
|
-
listId?: string;
|
|
1006
|
-
listLabel?: string;
|
|
1007
|
-
itemIndex?: number;
|
|
1008
|
-
itemKey?: string;
|
|
1009
|
-
reactKey?: string;
|
|
1010
|
-
syntheticId?: string;
|
|
1011
|
-
}
|
|
1012
|
-
interface InteractionElementSnapshot {
|
|
1013
|
-
/** Stable id for the current screen/content, preferred for tool calls. */
|
|
1014
|
-
id: string;
|
|
1015
|
-
/** Semantic UI role. */
|
|
1016
|
-
role: 'option' | 'button' | 'input' | 'toggle' | 'slider' | 'listItem';
|
|
1017
|
-
/** Human-readable label. */
|
|
1018
|
-
label?: string;
|
|
1019
|
-
/** Text segments associated with this element. */
|
|
1020
|
-
texts: string[];
|
|
1021
|
-
/** Actions supported by this element. */
|
|
1022
|
-
actions: Array<'press' | 'focus' | 'toggle' | 'setValue'>;
|
|
1023
|
-
/** Whether the element is currently disabled. */
|
|
1024
|
-
disabled?: boolean;
|
|
1025
|
-
/** Whether the element appears selected. */
|
|
1026
|
-
selected?: boolean;
|
|
1027
|
-
/** Source that produced the element. */
|
|
1028
|
-
source?: 'list' | 'button' | 'input' | 'toggle' | 'slider' | 'choice';
|
|
1029
|
-
/**
|
|
1030
|
-
* How the underlying control's identifier was obtained. Carried up from
|
|
1031
|
-
* the snapshot entry this element was derived from, so a consumer that
|
|
1032
|
-
* only reads `elements` still knows what it is trusting. See
|
|
1033
|
-
* {@link IdentityProvenance}.
|
|
1034
|
-
*/
|
|
1035
|
-
provenance?: IdentityProvenance;
|
|
1036
|
-
/**
|
|
1037
|
-
* False when the control is mounted but currently outside the window —
|
|
1038
|
-
* below the fold of a ScrollView, scrolled off the top, pushed sideways
|
|
1039
|
-
* by a carousel.
|
|
1040
|
-
*
|
|
1041
|
-
* ABSENT MEANS UNKNOWN. The old React Native architecture cannot report a
|
|
1042
|
-
* synchronous window-relative rect, and no SDK published before this
|
|
1043
|
-
* field existed reports one at all; reading absence as `false` would make
|
|
1044
|
-
* the agent refuse to press a control the user is looking at.
|
|
1045
|
-
*/
|
|
1046
|
-
onScreen?: boolean;
|
|
1047
|
-
/** Legacy/fallback target id, if any. */
|
|
1048
|
-
targetId?: string;
|
|
1049
|
-
/** Context for row/list options. */
|
|
1050
|
-
listContext?: InteractionElementListContext;
|
|
1051
|
-
/**
|
|
1052
|
-
* True when the underlying component lives inside a currently-visible
|
|
1053
|
-
* modal — the only targets actually touchable while the overlay is up.
|
|
1054
|
-
*/
|
|
1055
|
-
inModal?: boolean;
|
|
1056
|
-
}
|
|
1057
|
-
/** Window-relative box, in the coordinate space the platform reports. */
|
|
1058
|
-
interface ElementRect {
|
|
1059
|
-
x: number;
|
|
1060
|
-
y: number;
|
|
1061
|
-
width: number;
|
|
1062
|
-
height: number;
|
|
1063
|
-
}
|
|
1064
|
-
/**
|
|
1065
|
-
* What the CLIENT keeps about an element, which is strictly more than what
|
|
1066
|
-
* the model is told about it.
|
|
1067
|
-
*
|
|
1068
|
-
* The wire shape (`InteractionElementSnapshot`) is sized for a language
|
|
1069
|
-
* model: names, roles, state, everything it needs to decide. This one adds
|
|
1070
|
-
* what only the executor needs — coordinates it will never read aloud —
|
|
1071
|
-
* and it exists because that data was being measured and then discarded
|
|
1072
|
-
* for want of somewhere to put it that wasn't the wire.
|
|
1073
|
-
*
|
|
1074
|
-
* The split is the point. Anything added here is free: it never reaches
|
|
1075
|
-
* `agentSnapshotSchema`, never crosses the network, and never costs a
|
|
1076
|
-
* token. Anything added to the wire type is paid for on every observation
|
|
1077
|
-
* of every session, so it has to earn the model's attention.
|
|
1078
|
-
*/
|
|
1079
|
-
interface InteractionElementEntry extends InteractionElementSnapshot {
|
|
1080
|
-
/**
|
|
1081
|
-
* Where the control was on screen when the snapshot was taken. Absent
|
|
1082
|
-
* when the platform cannot measure synchronously (React Native's old
|
|
1083
|
-
* architecture) or when the element came from a source with no fiber
|
|
1084
|
-
* behind it.
|
|
1085
|
-
*/
|
|
1086
|
-
rect?: ElementRect;
|
|
1087
|
-
}
|
|
1088
|
-
interface ScreenSnapshot {
|
|
1089
|
-
/** The currently active route name, if known */
|
|
1090
|
-
route: string | null;
|
|
1091
|
-
/** All visible static text */
|
|
1092
|
-
texts: string[];
|
|
1093
|
-
/** All text inputs currently rendered (and visible) */
|
|
1094
|
-
inputs: InputSnapshot[];
|
|
1095
|
-
/** All button-like components */
|
|
1096
|
-
buttons: ButtonSnapshot[];
|
|
1097
|
-
/** All toggle components */
|
|
1098
|
-
toggles: ToggleSnapshot[];
|
|
1099
|
-
/** Sliders / adjustable numeric controls. */
|
|
1100
|
-
sliders: SliderSnapshot[];
|
|
1101
|
-
/** Whether a loading indicator is visible */
|
|
1102
|
-
loading: boolean;
|
|
1103
|
-
/** Whether a modal is currently open */
|
|
1104
|
-
modalOpen: boolean;
|
|
1105
|
-
/**
|
|
1106
|
-
* A native dialog covering the screen, when the SDK could observe one.
|
|
1107
|
-
*
|
|
1108
|
-
* Its presence also forces `modalOpen`, because for every purpose the
|
|
1109
|
-
* agent cares about it IS a modal — nothing behind it is touchable.
|
|
1110
|
-
* Absence is not proof there is no dialog: an OS permission prompt or
|
|
1111
|
-
* a share sheet cannot be instrumented at all.
|
|
1112
|
-
*/
|
|
1113
|
-
nativeDialog?: NativeDialogSnapshot;
|
|
1114
|
-
/**
|
|
1115
|
-
* Lists detected in the visible tree. Each list's items have their
|
|
1116
|
-
* own per-item texts/buttons/inputs/toggles, NOT duplicated in the
|
|
1117
|
-
* flat top-level arrays — preserving the row association the flat
|
|
1118
|
-
* shape destroys.
|
|
1119
|
-
*/
|
|
1120
|
-
lists: ListSnapshot[];
|
|
1121
|
-
/**
|
|
1122
|
-
* Choice groups detected from visible cards/rows/chips/buttons, used
|
|
1123
|
-
* for select-like flows where no text input exists.
|
|
1124
|
-
*/
|
|
1125
|
-
choiceGroups: ChoiceGroupSnapshot[];
|
|
1126
|
-
/**
|
|
1127
|
-
* Scrollable surfaces that carry no rows. Absent/empty means either
|
|
1128
|
-
* the screen does not scroll or the SDK could not observe that it
|
|
1129
|
-
* does — never that the visible content is all the content.
|
|
1130
|
-
*/
|
|
1131
|
-
scrollables?: ScrollableSnapshot[];
|
|
1132
|
-
/**
|
|
1133
|
-
* Interaction graph: visible actionable elements with stable ids,
|
|
1134
|
-
* semantic roles, labels, and execution fallbacks. Agents should
|
|
1135
|
-
* prefer these ids over synthetic ordinal handles.
|
|
1136
|
-
*/
|
|
1137
|
-
elements: InteractionElementSnapshot[];
|
|
1138
|
-
/**
|
|
1139
|
-
* Set when the walker's output exceeded the wire contract and
|
|
1140
|
-
* `clampSnapshotToWireLimits` dropped part of it (see
|
|
1141
|
-
* `introspection/wireLimits.ts`). Absent means the observation is
|
|
1142
|
-
* complete.
|
|
1143
|
-
*
|
|
1144
|
-
* The server surfaces this to the model: a screen whose text was cut
|
|
1145
|
-
* at 500 entries must not be read as a screen with only 500 things on
|
|
1146
|
-
* it. Without the flag a truncated observation is indistinguishable
|
|
1147
|
-
* from a short one.
|
|
1148
|
-
*/
|
|
1149
|
-
truncated?: boolean;
|
|
1150
|
-
/** Diagnostic counts for debugging */
|
|
1151
|
-
stats?: {
|
|
1152
|
-
visitedFibers: number;
|
|
1153
|
-
skippedHidden: number;
|
|
1154
|
-
/**
|
|
1155
|
-
* How many controls the walker could name, and how well.
|
|
1156
|
-
*
|
|
1157
|
-
* `WalkDetectorCounts` counts RECOGNITIONS, not emissions, so a screen
|
|
1158
|
-
* whose controls were all silently dropped still reported healthy
|
|
1159
|
-
* detector numbers. This is the emission side: `positional` climbing is
|
|
1160
|
-
* the signal that an app needs annotating, and comparing it between a
|
|
1161
|
-
* debug and a release build is the first real measurement of what
|
|
1162
|
-
* minification costs the agent.
|
|
1163
|
-
*/
|
|
1164
|
-
identity?: {
|
|
1165
|
-
declared: number;
|
|
1166
|
-
derived: number;
|
|
1167
|
-
positional: number;
|
|
1168
|
-
};
|
|
1169
|
-
};
|
|
1170
|
-
}
|
|
1171
753
|
/**
|
|
1172
754
|
* Localized copy for escalation system messages, injected by the chat
|
|
1173
755
|
* surface (the machine has no i18n access — same pattern as errorPrefix).
|
|
@@ -1185,69 +767,25 @@ interface EscalationStrings {
|
|
|
1185
767
|
offer: string;
|
|
1186
768
|
}
|
|
1187
769
|
|
|
1188
|
-
type TraceListener = (entries: AppilotsTraceEntry[]) => void;
|
|
1189
|
-
declare function recordAppilotsDebugTrace(entry: Omit<AppilotsTraceEntry, 'id'> & {
|
|
1190
|
-
id?: string;
|
|
1191
|
-
}): void;
|
|
1192
|
-
declare function getAppilotsDebugTraces(): AppilotsTraceEntry[];
|
|
1193
|
-
declare function clearAppilotsDebugTraces(): void;
|
|
1194
|
-
declare function subscribeAppilotsDebugTraces(listener: TraceListener): () => void;
|
|
1195
|
-
|
|
1196
|
-
/**
|
|
1197
|
-
* Human-readable labels and error messages for the action breadcrumb.
|
|
1198
|
-
*
|
|
1199
|
-
* Strings are PT-BR hardcoded for now. i18n is planned for backlog item
|
|
1200
|
-
* 4.1 (Personalização) — when that lands, these strings move into the
|
|
1201
|
-
* locale bundles.
|
|
1202
|
-
*
|
|
1203
|
-
* Two responsibilities:
|
|
1204
|
-
* 1. `describeAction(action)` — turns a typed AgentAction into a label
|
|
1205
|
-
* that varies by lifecycle state (pending/running/done/failed).
|
|
1206
|
-
* 2. `humanizeError(raw, action)` — sanitises the raw error string from
|
|
1207
|
-
* the executor into a short user-facing reason. Stack traces and
|
|
1208
|
-
* protocol errors are collapsed into "algo deu errado" so users
|
|
1209
|
-
* aren't shown technical noise.
|
|
1210
|
-
*/
|
|
1211
|
-
|
|
1212
|
-
type BreadcrumbState = 'pending' | 'running' | 'success' | 'failed';
|
|
1213
|
-
interface BreadcrumbItem {
|
|
1214
|
-
/** What to render on the line. */
|
|
1215
|
-
label: string;
|
|
1216
|
-
/** Lifecycle state — drives icon + colour in the breadcrumb. */
|
|
1217
|
-
state: BreadcrumbState;
|
|
1218
|
-
}
|
|
1219
|
-
/**
|
|
1220
|
-
* Map an AgentAction + its current status to a breadcrumb item ready to
|
|
1221
|
-
* render. The function is intentionally defensive — both the native-tools
|
|
1222
|
-
* and JSON-fallback code paths feed actions through here, and the JSON
|
|
1223
|
-
* path is loose with payload shapes, so every field access has to assume
|
|
1224
|
-
* `unknown`.
|
|
1225
|
-
*/
|
|
1226
|
-
declare function describeAction(action: AgentAction): BreadcrumbItem;
|
|
1227
|
-
/**
|
|
1228
|
-
* Convert the executor's raw error string into a short, user-facing
|
|
1229
|
-
* reason that fits inside parentheses on the breadcrumb line. Returns
|
|
1230
|
-
* `undefined` when there's no useful information to show — caller can
|
|
1231
|
-
* then drop the parenthetical entirely.
|
|
1232
|
-
*
|
|
1233
|
-
* Heuristics:
|
|
1234
|
-
* - Apply known-pattern rewrites (rejected, not found, network, etc.)
|
|
1235
|
-
* - If the result looks technical (stack frame, HTTP status, JSON
|
|
1236
|
-
* dump) or is suspiciously long, fall back to "algo deu errado".
|
|
1237
|
-
* - Trim and lowercase the first letter so it reads naturally inside
|
|
1238
|
-
* the parens after the action verb.
|
|
1239
|
-
*/
|
|
1240
|
-
declare function humanizeError(raw: string | undefined, _action?: AgentAction): string | undefined;
|
|
1241
|
-
|
|
1242
770
|
interface AppilotsConfig {
|
|
771
|
+
/** Persist the session handle to resume a mission after an app restart. */
|
|
772
|
+
sessionStorage?: AppilotsSessionStorage;
|
|
1243
773
|
/** Project ID from the Appilots dashboard */
|
|
1244
774
|
projectId: string;
|
|
1245
775
|
/** API base URL (defaults to Appilots cloud) */
|
|
1246
776
|
apiBaseUrl?: string;
|
|
1247
777
|
/** SDK API key (ak_...) for authenticating with the backend */
|
|
1248
778
|
apiKey?: string;
|
|
1249
|
-
/**
|
|
1250
|
-
|
|
779
|
+
/**
|
|
780
|
+
* Agent permissions for this app instance.
|
|
781
|
+
*
|
|
782
|
+
* PARTIAL: name only the flags you want to change. Every flag you
|
|
783
|
+
* omit takes its default (see `DEFAULT_AGENT_PERMISSIONS`), which is
|
|
784
|
+
* also what a config with no `permissions` key at all gets — the two
|
|
785
|
+
* used to disagree, and a `.appilotsrc` naming three of the four
|
|
786
|
+
* flags silently denied the fourth.
|
|
787
|
+
*/
|
|
788
|
+
permissions?: Partial<AgentPermissions>;
|
|
1251
789
|
/** Enable debug logging */
|
|
1252
790
|
debug?: boolean;
|
|
1253
791
|
/**
|
|
@@ -1405,6 +943,12 @@ interface UseAppilotsNavigationReturn {
|
|
|
1405
943
|
declare function useAppilotsNavigation(): UseAppilotsNavigationReturn;
|
|
1406
944
|
|
|
1407
945
|
interface UseAppilotsChatReturn {
|
|
946
|
+
mission?: MissionView | null;
|
|
947
|
+
pauseMission: () => Promise<void>;
|
|
948
|
+
resumeMission: () => Promise<void>;
|
|
949
|
+
cancelMission: () => Promise<void>;
|
|
950
|
+
hasStartedActing: boolean;
|
|
951
|
+
replyLocale: AppilotsLocale | null;
|
|
1408
952
|
messages: ChatMessage[];
|
|
1409
953
|
isLoading: boolean;
|
|
1410
954
|
loadingStatusKey: 'thinking' | 'statusAnalyzing' | 'statusWaitingApp' | 'statusAdjusting';
|
|
@@ -1425,9 +969,8 @@ interface UseAppilotsChatReturn {
|
|
|
1425
969
|
/**
|
|
1426
970
|
* Cancels the in-flight generation (OKR-008 KR4). Streamed partial
|
|
1427
971
|
* text is kept in the transcript; a no-op when nothing is in flight.
|
|
1428
|
-
*
|
|
1429
|
-
*
|
|
1430
|
-
* form fill would leave the app in a worse state than finishing it).
|
|
972
|
+
* Pending actions and later continuation responses are discarded; an
|
|
973
|
+
* action already dispatched on-device is allowed to finish.
|
|
1431
974
|
*/
|
|
1432
975
|
cancelMessage: () => void;
|
|
1433
976
|
clearMessages: () => void;
|
|
@@ -1505,6 +1048,45 @@ interface UseAppilotsActionsReturn {
|
|
|
1505
1048
|
*/
|
|
1506
1049
|
declare function useAppilotsActions(options?: UseAppilotsActionsOptions): UseAppilotsActionsReturn;
|
|
1507
1050
|
|
|
1051
|
+
/**
|
|
1052
|
+
* What a registration hook hands back for the app to spread.
|
|
1053
|
+
*
|
|
1054
|
+
* The registration hooks (`useAppilotsField`, `useAppilotsTarget`,
|
|
1055
|
+
* `useAppilotsToggle`, `useAppilotsSlider`) returned `void`. They put the
|
|
1056
|
+
* declared id in the ComponentRegistry, where the EXECUTOR looks it up,
|
|
1057
|
+
* and nothing carried that id to the rendered element — so the control
|
|
1058
|
+
* ended up with two identities: the declared one, which is what the
|
|
1059
|
+
* application map shows the agent, and one `walkFiber` derives from the
|
|
1060
|
+
* visible label (`testID ?? accessibilityLabel`, then `labelToId`, then
|
|
1061
|
+
* position).
|
|
1062
|
+
*
|
|
1063
|
+
* The two agree only while the label spells the id. A translated app, an
|
|
1064
|
+
* icon-only control, a reworded button or a label composed at runtime
|
|
1065
|
+
* breaks the coincidence, and the agent then asks for something the
|
|
1066
|
+
* snapshot does not contain.
|
|
1067
|
+
*
|
|
1068
|
+
* Spreading the return value closes it:
|
|
1069
|
+
*
|
|
1070
|
+
* ```tsx
|
|
1071
|
+
* <Switch {...useAppilotsToggle('pushEnabled', { value, onValueChange })} />
|
|
1072
|
+
* ```
|
|
1073
|
+
*
|
|
1074
|
+
* Ignoring it is still valid — every existing call site keeps compiling
|
|
1075
|
+
* and behaving exactly as before, which is why this is additive rather
|
|
1076
|
+
* than a new required argument.
|
|
1077
|
+
*/
|
|
1078
|
+
interface AppilotsElementProps {
|
|
1079
|
+
/**
|
|
1080
|
+
* The declared id, published where the identity chain looks FIRST.
|
|
1081
|
+
*
|
|
1082
|
+
* Spread it last if the component also takes a `testID` of its own and
|
|
1083
|
+
* you want yours to win; spread it first if you want the declared id
|
|
1084
|
+
* to win. The SDK does not decide that for you here, because unlike
|
|
1085
|
+
* the HOC path there is no way to see what else you are passing.
|
|
1086
|
+
*/
|
|
1087
|
+
testID: string;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1508
1090
|
/**
|
|
1509
1091
|
* ComponentRegistry — Central registry mapping component IDs to their
|
|
1510
1092
|
* refs, callbacks, and metadata so the ActionExecutor can find and
|
|
@@ -1524,6 +1106,8 @@ interface FieldEntry {
|
|
|
1524
1106
|
setValue: (value: string) => void;
|
|
1525
1107
|
/** Optional: focus the input */
|
|
1526
1108
|
focus?: () => void;
|
|
1109
|
+
/** End editing after the latest render, without submitting the form. */
|
|
1110
|
+
finishEditing?: () => void;
|
|
1527
1111
|
/** Field type hint for the executor */
|
|
1528
1112
|
fieldType?: 'text' | 'select' | 'toggle' | 'date' | 'number' | 'custom';
|
|
1529
1113
|
/** Human-readable label */
|
|
@@ -1715,7 +1299,7 @@ interface UseAppilotsFieldOptions {
|
|
|
1715
1299
|
* @param id - Unique identifier for this field (e.g. "plate", "customerName")
|
|
1716
1300
|
* @param options - Field configuration
|
|
1717
1301
|
*/
|
|
1718
|
-
declare function useAppilotsField(id: string, options: UseAppilotsFieldOptions):
|
|
1302
|
+
declare function useAppilotsField(id: string, options: UseAppilotsFieldOptions): AppilotsElementProps;
|
|
1719
1303
|
|
|
1720
1304
|
/**
|
|
1721
1305
|
* useAppilotsTarget — Register a pressable UI element (button, card, link)
|
|
@@ -1734,6 +1318,7 @@ declare function useAppilotsField(id: string, options: UseAppilotsFieldOptions):
|
|
|
1734
1318
|
* return <Button title="Submit" onPress={handleSubmit} />;
|
|
1735
1319
|
* ```
|
|
1736
1320
|
*/
|
|
1321
|
+
|
|
1737
1322
|
interface UseAppilotsTargetOptions {
|
|
1738
1323
|
/** Primary press handler */
|
|
1739
1324
|
onPress: () => void;
|
|
@@ -1753,7 +1338,7 @@ interface UseAppilotsTargetOptions {
|
|
|
1753
1338
|
* @param id - Unique identifier (e.g. "submitVehicle", "openSettings")
|
|
1754
1339
|
* @param options - Target configuration
|
|
1755
1340
|
*/
|
|
1756
|
-
declare function useAppilotsTarget(id: string, options: UseAppilotsTargetOptions):
|
|
1341
|
+
declare function useAppilotsTarget(id: string, options: UseAppilotsTargetOptions): AppilotsElementProps;
|
|
1757
1342
|
|
|
1758
1343
|
/**
|
|
1759
1344
|
* useAppilotsToggle — Register a toggle/switch with the ComponentRegistry
|
|
@@ -1773,6 +1358,7 @@ declare function useAppilotsTarget(id: string, options: UseAppilotsTargetOptions
|
|
|
1773
1358
|
* return <Switch value={pushEnabled} onValueChange={setPushEnabled} />;
|
|
1774
1359
|
* ```
|
|
1775
1360
|
*/
|
|
1361
|
+
|
|
1776
1362
|
interface UseAppilotsToggleOptions {
|
|
1777
1363
|
/** Current toggle value */
|
|
1778
1364
|
value: boolean;
|
|
@@ -1790,7 +1376,7 @@ interface UseAppilotsToggleOptions {
|
|
|
1790
1376
|
* @param id - Unique identifier (e.g. "pushNotifications", "darkMode")
|
|
1791
1377
|
* @param options - Toggle configuration
|
|
1792
1378
|
*/
|
|
1793
|
-
declare function useAppilotsToggle(id: string, options: UseAppilotsToggleOptions):
|
|
1379
|
+
declare function useAppilotsToggle(id: string, options: UseAppilotsToggleOptions): AppilotsElementProps;
|
|
1794
1380
|
|
|
1795
1381
|
/**
|
|
1796
1382
|
* useAppilotsSlider — Register a slider / adjustable numeric control with
|
|
@@ -1820,6 +1406,7 @@ declare function useAppilotsToggle(id: string, options: UseAppilotsToggleOptions
|
|
|
1820
1406
|
* return <MySlider value={mileage} onChange={setMileage} min={0} max={300000} />;
|
|
1821
1407
|
* ```
|
|
1822
1408
|
*/
|
|
1409
|
+
|
|
1823
1410
|
interface UseAppilotsSliderOptions {
|
|
1824
1411
|
/** Current slider value */
|
|
1825
1412
|
value: number;
|
|
@@ -1843,7 +1430,7 @@ interface UseAppilotsSliderOptions {
|
|
|
1843
1430
|
* @param id - Unique identifier (e.g. "quilometragem", "volume")
|
|
1844
1431
|
* @param options - Slider configuration
|
|
1845
1432
|
*/
|
|
1846
|
-
declare function useAppilotsSlider(id: string, options: UseAppilotsSliderOptions):
|
|
1433
|
+
declare function useAppilotsSlider(id: string, options: UseAppilotsSliderOptions): AppilotsElementProps;
|
|
1847
1434
|
|
|
1848
1435
|
interface SuggestedPrompt {
|
|
1849
1436
|
/** Display label shown on the chip and inserted into the input on tap. */
|
|
@@ -1894,4 +1481,4 @@ interface UseSuggestedPromptsReturn {
|
|
|
1894
1481
|
*/
|
|
1895
1482
|
declare function useSuggestedPrompts(options: UseSuggestedPromptsOptions): UseSuggestedPromptsReturn;
|
|
1896
1483
|
|
|
1897
|
-
export {
|
|
1484
|
+
export { useAppilotsTarget as $, type AppilotsTraceEntry as A, type UseAppilotsTargetOptions as B, type ComponentRegistry as C, type UseAppilotsToggleOptions as D, type EscalationState as E, type FieldEntry as F, type UseSuggestedPromptsOptions as G, type UseSuggestedPromptsReturn as H, componentRegistry as I, createComponentRegistry as J, defaultDarkTheme as K, defaultLightTheme as L, type MessageRole as M, type NavigationPayload as N, mergeThemeTokens as O, type PartialThemeTokens as P, useAppilots as Q, RateLimitedError as R, type SliderEntry as S, type TargetEntry as T, type UIInteractionPayload as U, useAppilotsActions as V, useAppilotsChat as W, useAppilotsContext as X, useAppilotsField as Y, useAppilotsNavigation as Z, useAppilotsSlider as _, type AgentAction as a, useAppilotsToggle as a0, useSuggestedPrompts as a1, type AppilotsLocale as b, type AppilotsThemeTokens as c, type AppilotsSessionStorage as d, type AgentPermissions as e, type AppilotsEvent as f, type AgentActionType as g, type AgentMessage as h, AppilotsClient as i, type AppilotsClientOptions as j, type AppilotsConfig as k, type AppilotsElementProps as l, type AppilotsEventHandler as m, type AppilotsEventType as n, AppilotsProvider as o, type AppilotsProviderProps as p, type AppilotsUser as q, type ChatMessage as r, type ComponentEntry as s, type ComponentKind as t, type FormFillPayload as u, type RemotePersonalization as v, type SuggestedPrompt as w, type ToggleEntry as x, type UseAppilotsFieldOptions as y, type UseAppilotsSliderOptions as z };
|