@appilots/sdk 0.7.0 → 0.10.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/README.md +46 -4
- package/dist/.build-meta.json +5 -0
- package/dist/{chunk-KYFAXT6V.js → chunk-2GCWCPSD.js} +19 -16
- package/dist/{chunk-R4D34FEW.mjs → chunk-AHHDOUVX.mjs} +2151 -333
- package/dist/{chunk-DR75QTYK.mjs → chunk-IHPLS5FE.mjs} +16 -13
- package/dist/{chunk-HFRIB4YN.js → chunk-VX7AL4SA.js} +1049 -1162
- package/dist/{chunk-KUFWRJC4.mjs → chunk-XHR65V2W.mjs} +831 -949
- package/dist/{chunk-DZ7QRFHD.js → chunk-YB77RYCC.js} +2178 -332
- 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-nI-s3Exg.d.mts → index-BPZ0j71S.d.mts} +315 -15
- package/dist/{index-nI-s3Exg.d.ts → index-BPZ0j71S.d.ts} +315 -15
- package/dist/index.d.mts +325 -22
- package/dist/index.d.ts +325 -22
- package/dist/index.js +340 -227
- package/dist/index.mjs +274 -173
- package/dist/navigation/index.d.mts +171 -3
- package/dist/navigation/index.d.ts +171 -3
- package/dist/navigation/index.js +13 -13
- package/dist/navigation/index.mjs +2 -2
- package/metro.d.ts +16 -1
- package/metro.js +104 -10
- package/package.json +16 -6
- package/dist/registerScreen-D1oGm28T.d.mts +0 -159
- package/dist/registerScreen-D1oGm28T.d.ts +0 -159
|
@@ -210,7 +210,8 @@ interface AgentAction {
|
|
|
210
210
|
destructive?: boolean;
|
|
211
211
|
}
|
|
212
212
|
interface NavigationPayload {
|
|
213
|
-
|
|
213
|
+
/** Absent only for `goBack`, which has no destination to name (#398). */
|
|
214
|
+
screenName?: string;
|
|
214
215
|
params?: Record<string, unknown>;
|
|
215
216
|
navigationAction: 'push' | 'navigate' | 'replace' | 'goBack' | 'reset';
|
|
216
217
|
/**
|
|
@@ -303,11 +304,13 @@ interface EscalationState {
|
|
|
303
304
|
/**
|
|
304
305
|
* Mirrors `introspectionDiagnosticsSchema` on the wire. Declared here
|
|
305
306
|
* rather than imported so client-core stays free of the server's
|
|
306
|
-
* validator package.
|
|
307
|
+
* validator package — which means the two must be kept in step by hand.
|
|
308
|
+
* Adding a reason to one and not the other is a typecheck failure at
|
|
309
|
+
* the SDK, not a silent wire mismatch.
|
|
307
310
|
*/
|
|
308
311
|
interface IntrospectionDiagnosticsInput {
|
|
309
312
|
captured: boolean;
|
|
310
|
-
failureReason?: 'sentinel-missing-internals' | 'never-mounted' | null;
|
|
313
|
+
failureReason?: 'sentinel-missing-internals' | 'never-mounted' | 'render-crashed' | 'names-mangled' | 'walk-recognized-nothing' | null;
|
|
311
314
|
reactVersion?: string | null;
|
|
312
315
|
failureCount?: number;
|
|
313
316
|
}
|
|
@@ -347,6 +350,20 @@ interface AppilotsClientOptions {
|
|
|
347
350
|
* essential for OTA-updated fleets where multiple app versions coexist.
|
|
348
351
|
*/
|
|
349
352
|
appVersion?: string;
|
|
353
|
+
/**
|
|
354
|
+
* The version of the SDK package driving this client, sent as
|
|
355
|
+
* `X-Appilots-Sdk-Version`. Each platform SDK passes its OWN published
|
|
356
|
+
* version (`@appilots/sdk`, `@appilots/web-sdk`); `@appilots/client-core`
|
|
357
|
+
* is private and never published, so its version means nothing to a
|
|
358
|
+
* customer and is only the fallback for a caller that constructs
|
|
359
|
+
* `AppilotsClient` directly.
|
|
360
|
+
*
|
|
361
|
+
* This is the server's only evidence of which SDKs are in the field,
|
|
362
|
+
* and therefore the only input to "is this field safe to tighten yet?"
|
|
363
|
+
* (issue #312). Leaving it wrong is not cosmetic: it makes the
|
|
364
|
+
* backward-compatibility promise in CLAUDE.md unverifiable.
|
|
365
|
+
*/
|
|
366
|
+
sdkVersion?: string;
|
|
350
367
|
/**
|
|
351
368
|
* Who the app's current user is. `id` becomes the session's
|
|
352
369
|
* externalUserId; `name`/`identifiers` are upserted into the
|
|
@@ -456,6 +473,7 @@ interface SendMessageContext {
|
|
|
456
473
|
empty?: boolean;
|
|
457
474
|
}>;
|
|
458
475
|
}
|
|
476
|
+
|
|
459
477
|
declare class AppilotsClient {
|
|
460
478
|
private readonly baseUrl;
|
|
461
479
|
private readonly projectId;
|
|
@@ -469,6 +487,18 @@ declare class AppilotsClient {
|
|
|
469
487
|
/** Guard so identify fires at most once per client instance. */
|
|
470
488
|
private identified;
|
|
471
489
|
constructor(options: AppilotsClientOptions);
|
|
490
|
+
/**
|
|
491
|
+
* A 404 on an `/agent/*` path is almost never a missing record — those
|
|
492
|
+
* routes are static. It means the request reached SOMETHING that is not
|
|
493
|
+
* this API, or reached it at the wrong mount point, and the server's own
|
|
494
|
+
* message ("Route not found") tells the integrator nothing about which.
|
|
495
|
+
*
|
|
496
|
+
* The symptom is unmistakable once you have seen it: every message
|
|
497
|
+
* fails, including a plain "hello" that needs no tool at all, because
|
|
498
|
+
* nothing ever reaches the agent. Left as-is it reads like the agent is
|
|
499
|
+
* broken.
|
|
500
|
+
*/
|
|
501
|
+
private explainIfMisroutedBaseUrl;
|
|
472
502
|
private log;
|
|
473
503
|
private describeNonJsonResponse;
|
|
474
504
|
private request;
|
|
@@ -664,9 +694,45 @@ declare class AppilotsClient {
|
|
|
664
694
|
* produces this same shape; the wire contract it feeds is
|
|
665
695
|
* `agentSnapshotSchema` in `@appilots/shared`.
|
|
666
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';
|
|
667
720
|
interface InputSnapshot {
|
|
668
721
|
/** Best identifier — testID/data-testid, accessibilityLabel/aria-label, or placeholder */
|
|
669
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;
|
|
670
736
|
/** Human-readable label inferred from accessibility metadata or sibling text */
|
|
671
737
|
label?: string;
|
|
672
738
|
/** Current value (only present for controlled inputs) */
|
|
@@ -679,6 +745,15 @@ interface InputSnapshot {
|
|
|
679
745
|
secure?: boolean;
|
|
680
746
|
/** Inferred type based on the platform's input-type metadata */
|
|
681
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;
|
|
682
757
|
/**
|
|
683
758
|
* True when this input lives inside a currently-visible modal. When a
|
|
684
759
|
* modal is open, only inModal elements can actually receive input —
|
|
@@ -689,14 +764,35 @@ interface InputSnapshot {
|
|
|
689
764
|
interface ButtonSnapshot {
|
|
690
765
|
/** Best identifier — testID/data-testid, accessibilityLabel/aria-label, or inferred from child text */
|
|
691
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;
|
|
692
780
|
/** Human-readable label — usually the visible text inside the button */
|
|
693
781
|
label?: string;
|
|
694
782
|
/** Whether the button is disabled */
|
|
695
783
|
disabled?: boolean;
|
|
696
784
|
/**
|
|
697
|
-
* Whether
|
|
698
|
-
*
|
|
699
|
-
*
|
|
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.
|
|
700
796
|
*/
|
|
701
797
|
selected?: boolean;
|
|
702
798
|
/** True when this button lives inside a currently-visible modal. */
|
|
@@ -705,6 +801,19 @@ interface ButtonSnapshot {
|
|
|
705
801
|
interface ToggleSnapshot {
|
|
706
802
|
/** Best identifier */
|
|
707
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;
|
|
708
817
|
/** Human-readable label */
|
|
709
818
|
label?: string;
|
|
710
819
|
/** Current on/off state */
|
|
@@ -715,6 +824,19 @@ interface ToggleSnapshot {
|
|
|
715
824
|
interface SliderSnapshot {
|
|
716
825
|
/** Registry id — the executable handle. */
|
|
717
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;
|
|
718
840
|
/** Human-readable label */
|
|
719
841
|
label?: string;
|
|
720
842
|
/** Current numeric value */
|
|
@@ -805,6 +927,51 @@ interface ListDataPreviewEntry {
|
|
|
805
927
|
/** Short human-readable projection of the item (capped length). */
|
|
806
928
|
text: string;
|
|
807
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
|
+
}
|
|
808
975
|
interface ChoiceOptionSnapshot {
|
|
809
976
|
/** 1-indexed option position within this group. */
|
|
810
977
|
index: number;
|
|
@@ -859,6 +1026,24 @@ interface InteractionElementSnapshot {
|
|
|
859
1026
|
selected?: boolean;
|
|
860
1027
|
/** Source that produced the element. */
|
|
861
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;
|
|
862
1047
|
/** Legacy/fallback target id, if any. */
|
|
863
1048
|
targetId?: string;
|
|
864
1049
|
/** Context for row/list options. */
|
|
@@ -869,6 +1054,37 @@ interface InteractionElementSnapshot {
|
|
|
869
1054
|
*/
|
|
870
1055
|
inModal?: boolean;
|
|
871
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
|
+
}
|
|
872
1088
|
interface ScreenSnapshot {
|
|
873
1089
|
/** The currently active route name, if known */
|
|
874
1090
|
route: string | null;
|
|
@@ -886,6 +1102,15 @@ interface ScreenSnapshot {
|
|
|
886
1102
|
loading: boolean;
|
|
887
1103
|
/** Whether a modal is currently open */
|
|
888
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;
|
|
889
1114
|
/**
|
|
890
1115
|
* Lists detected in the visible tree. Each list's items have their
|
|
891
1116
|
* own per-item texts/buttons/inputs/toggles, NOT duplicated in the
|
|
@@ -898,16 +1123,49 @@ interface ScreenSnapshot {
|
|
|
898
1123
|
* for select-like flows where no text input exists.
|
|
899
1124
|
*/
|
|
900
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[];
|
|
901
1132
|
/**
|
|
902
1133
|
* Interaction graph: visible actionable elements with stable ids,
|
|
903
1134
|
* semantic roles, labels, and execution fallbacks. Agents should
|
|
904
1135
|
* prefer these ids over synthetic ordinal handles.
|
|
905
1136
|
*/
|
|
906
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;
|
|
907
1150
|
/** Diagnostic counts for debugging */
|
|
908
1151
|
stats?: {
|
|
909
1152
|
visitedFibers: number;
|
|
910
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
|
+
};
|
|
911
1169
|
};
|
|
912
1170
|
}
|
|
913
1171
|
/**
|
|
@@ -981,13 +1239,6 @@ declare function describeAction(action: AgentAction): BreadcrumbItem;
|
|
|
981
1239
|
*/
|
|
982
1240
|
declare function humanizeError(raw: string | undefined, _action?: AgentAction): string | undefined;
|
|
983
1241
|
|
|
984
|
-
/**
|
|
985
|
-
* SDK version — bumped by changesets on release. Lives in its own module
|
|
986
|
-
* so runtime code (AppilotsClient) can import it without pulling the whole
|
|
987
|
-
* public barrel in and creating an import cycle.
|
|
988
|
-
*/
|
|
989
|
-
declare const SDK_VERSION = "0.1.0";
|
|
990
|
-
|
|
991
1242
|
interface AppilotsConfig {
|
|
992
1243
|
/** Project ID from the Appilots dashboard */
|
|
993
1244
|
projectId: string;
|
|
@@ -1025,6 +1276,37 @@ interface AppilotsConfig {
|
|
|
1025
1276
|
* @default true
|
|
1026
1277
|
*/
|
|
1027
1278
|
fetchPersonalization?: boolean;
|
|
1279
|
+
/**
|
|
1280
|
+
* While running a destructive action the user already approved on the
|
|
1281
|
+
* chat's confirm card, suppress the app's OWN `Alert.alert`
|
|
1282
|
+
* confirmation once — otherwise they answer the same question twice
|
|
1283
|
+
* and the second dialog is one the agent cannot press.
|
|
1284
|
+
*
|
|
1285
|
+
* Doing that means briefly replacing a global that belongs to your
|
|
1286
|
+
* app, so it is opt-outable: set `false` to keep `Alert.alert`
|
|
1287
|
+
* untouched at all times and show your own dialog instead. See
|
|
1288
|
+
* `platform/confirmedDestructiveAlert.ts` for the exact window.
|
|
1289
|
+
* @default true
|
|
1290
|
+
*/
|
|
1291
|
+
suppressNativeConfirm?: boolean;
|
|
1292
|
+
/**
|
|
1293
|
+
* Record the app's own `Alert.alert` dialogs so the agent can SEE
|
|
1294
|
+
* them.
|
|
1295
|
+
*
|
|
1296
|
+
* A native dialog renders outside React, so it is invisible to the
|
|
1297
|
+
* tree walk — and because every press invokes the React handler
|
|
1298
|
+
* directly, the agent otherwise keeps operating the app underneath a
|
|
1299
|
+
* dialog that blocks every real finger. With tracking on, the
|
|
1300
|
+
* observation reports the dialog, presses behind it fail honestly,
|
|
1301
|
+
* and the agent can answer it.
|
|
1302
|
+
*
|
|
1303
|
+
* Like the suppression above, this replaces a global that belongs to
|
|
1304
|
+
* your app, so it is opt-outable: set `false` to keep `Alert.alert`
|
|
1305
|
+
* untouched — at the cost of the agent acting blind whenever one is
|
|
1306
|
+
* up. See `platform/nativeDialogTracking.ts`.
|
|
1307
|
+
* @default true
|
|
1308
|
+
*/
|
|
1309
|
+
trackNativeDialogs?: boolean;
|
|
1028
1310
|
}
|
|
1029
1311
|
interface AppilotsProviderProps {
|
|
1030
1312
|
/**
|
|
@@ -1049,8 +1331,26 @@ interface AppilotsContextValue {
|
|
|
1049
1331
|
* and re-renders once this lands (accepted cold-start flash).
|
|
1050
1332
|
*/
|
|
1051
1333
|
remotePersonalization: RemotePersonalization | null;
|
|
1334
|
+
/**
|
|
1335
|
+
* True when the provider crashed and the error boundary degraded it.
|
|
1336
|
+
* The host app is still mounted and still has a context (so its
|
|
1337
|
+
* `useAppilots()` calls don't throw), but nothing is wired: `client`
|
|
1338
|
+
* rejects, `emit`/`subscribe` are inert, and `AppilotsChat` renders
|
|
1339
|
+
* nothing. Consumers that show their own assistant affordance should
|
|
1340
|
+
* branch on this.
|
|
1341
|
+
*/
|
|
1342
|
+
degraded?: boolean;
|
|
1052
1343
|
}
|
|
1053
|
-
|
|
1344
|
+
/**
|
|
1345
|
+
* Public entry point. Its only job is to keep an exception thrown by
|
|
1346
|
+
* anything Appilots renders from unmounting the host app's tree.
|
|
1347
|
+
*
|
|
1348
|
+
* The fallback deliberately re-renders `children` under a degraded
|
|
1349
|
+
* context instead of a "something went wrong" screen: the children ARE
|
|
1350
|
+
* the customer's app, and replacing them would be the same outage the
|
|
1351
|
+
* boundary is here to prevent, just with nicer wording.
|
|
1352
|
+
*/
|
|
1353
|
+
declare function AppilotsProvider({ config, children, client }: AppilotsProviderProps): React__default.JSX.Element;
|
|
1054
1354
|
declare function useAppilotsContext(): AppilotsContextValue;
|
|
1055
1355
|
|
|
1056
1356
|
/**
|
|
@@ -1594,4 +1894,4 @@ interface UseSuggestedPromptsReturn {
|
|
|
1594
1894
|
*/
|
|
1595
1895
|
declare function useSuggestedPrompts(options: UseSuggestedPromptsOptions): UseSuggestedPromptsReturn;
|
|
1596
1896
|
|
|
1597
|
-
export { componentRegistry as $, type AppilotsThemeTokens as A, type BreadcrumbItem as B, type ComponentRegistry as C, type
|
|
1897
|
+
export { componentRegistry as $, type AppilotsThemeTokens as A, type BreadcrumbItem as B, type ComponentRegistry as C, type ListSnapshot as D, type EscalationState as E, type FieldEntry as F, type RemotePersonalization as G, type SliderEntry as H, type InteractionElementEntry as I, type SuggestedPrompt as J, type ToggleEntry as K, type ListItemSnapshot as L, type MessageRole as M, type NavigationPayload as N, type ToggleSnapshot as O, type PartialThemeTokens as P, type UseAppilotsFieldOptions as Q, RateLimitedError as R, type ScreenSnapshot as S, type TargetEntry as T, type UIInteractionPayload as U, type UseAppilotsSliderOptions as V, type UseAppilotsTargetOptions as W, type UseAppilotsToggleOptions as X, type UseSuggestedPromptsOptions as Y, type UseSuggestedPromptsReturn as Z, clearAppilotsDebugTraces as _, type AppilotsLocale as a, createComponentRegistry as a0, defaultDarkTheme as a1, defaultLightTheme as a2, describeAction as a3, getAppilotsDebugTraces as a4, humanizeError as a5, mergeThemeTokens as a6, recordAppilotsDebugTrace as a7, subscribeAppilotsDebugTraces as a8, useAppilots as a9, useAppilotsActions as aa, useAppilotsChat as ab, useAppilotsContext as ac, useAppilotsField as ad, useAppilotsNavigation as ae, useAppilotsSlider as af, useAppilotsTarget as ag, useAppilotsToggle as ah, useSuggestedPrompts as ai, 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 InteractionElementSnapshot as z };
|