@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
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as PartialThemeTokens, A as AppilotsThemeTokens, a as AppilotsLocale, b as AgentAction, I as
|
|
2
|
-
export { e as AgentActionType, f as AgentMessage, g as AppilotsClient, h as AppilotsClientOptions, i as AppilotsConfig, j as AppilotsEventHandler, k as AppilotsEventType, l as AppilotsProvider, m as AppilotsProviderProps, n as AppilotsTraceEntry, o as AppilotsUser, B as BreadcrumbItem, p as BreadcrumbState, q as ButtonSnapshot, r as ChatMessage, s as ChoiceGroupSnapshot, t as ChoiceOptionSnapshot, u as ComponentEntry, v as ComponentKind, E as EscalationState, w as FormFillPayload, x as InputSnapshot, y as InteractionElementListContext, L as ListItemSnapshot,
|
|
1
|
+
import { P as PartialThemeTokens, A as AppilotsThemeTokens, a as AppilotsLocale, b as AgentAction, I as InteractionElementEntry, C as ComponentRegistry, c as AgentPermissions, S as ScreenSnapshot, F as FieldEntry, d as AppilotsEvent } from './index-BPZ0j71S.mjs';
|
|
2
|
+
export { e as AgentActionType, f as AgentMessage, g as AppilotsClient, h as AppilotsClientOptions, i as AppilotsConfig, j as AppilotsEventHandler, k as AppilotsEventType, l as AppilotsProvider, m as AppilotsProviderProps, n as AppilotsTraceEntry, o as AppilotsUser, B as BreadcrumbItem, p as BreadcrumbState, q as ButtonSnapshot, r as ChatMessage, s as ChoiceGroupSnapshot, t as ChoiceOptionSnapshot, u as ComponentEntry, v as ComponentKind, E as EscalationState, w as FormFillPayload, x as InputSnapshot, y as InteractionElementListContext, z as InteractionElementSnapshot, L as ListItemSnapshot, D as ListSnapshot, M as MessageRole, N as NavigationPayload, R as RateLimitedError, G as RemotePersonalization, H as SliderEntry, J as SuggestedPrompt, T as TargetEntry, K as ToggleEntry, O as ToggleSnapshot, U as UIInteractionPayload, Q as UseAppilotsFieldOptions, V as UseAppilotsSliderOptions, W as UseAppilotsTargetOptions, X as UseAppilotsToggleOptions, Y as UseSuggestedPromptsOptions, Z as UseSuggestedPromptsReturn, _ as clearAppilotsDebugTraces, $ as componentRegistry, a0 as createComponentRegistry, a1 as defaultDarkTheme, a2 as defaultLightTheme, a3 as describeAction, a4 as getAppilotsDebugTraces, a5 as humanizeError, a6 as mergeThemeTokens, a7 as recordAppilotsDebugTrace, a8 as subscribeAppilotsDebugTraces, a9 as useAppilots, aa as useAppilotsActions, ab as useAppilotsChat, ac as useAppilotsContext, ad as useAppilotsField, ae as useAppilotsNavigation, af as useAppilotsSlider, ag as useAppilotsTarget, ah as useAppilotsToggle, ai as useSuggestedPrompts } from './index-BPZ0j71S.mjs';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import React__default from 'react';
|
|
5
|
-
export {
|
|
5
|
+
export { AppilotsNavigationContainer, NavigationConfig, ScreenMetadata, registerScreen, setCurrentScreen } from './navigation/index.mjs';
|
|
6
6
|
|
|
7
7
|
interface AppilotsThemeProviderProps {
|
|
8
8
|
/**
|
|
@@ -111,6 +111,20 @@ interface AppilotsStrings {
|
|
|
111
111
|
reject: string;
|
|
112
112
|
/** Generic "cancelled by the user" message after a reject. */
|
|
113
113
|
cancelledByUser: string;
|
|
114
|
+
/** Title of the confirm card for a destructive action. */
|
|
115
|
+
confirmDestructiveTitle: string;
|
|
116
|
+
/** Title of the confirm card for a non-destructive confirmation. */
|
|
117
|
+
confirmTitle: string;
|
|
118
|
+
/** Body of the confirm card. `{action}` is replaced with the action's own description. */
|
|
119
|
+
confirmMessage: string;
|
|
120
|
+
/** Approve button when the action is destructive — states what will happen. */
|
|
121
|
+
confirmDestructiveApprove: string;
|
|
122
|
+
/** Approve button for a non-destructive confirmation. */
|
|
123
|
+
confirmApprove: string;
|
|
124
|
+
/** Cancel button on the confirm card. */
|
|
125
|
+
confirmCancel: string;
|
|
126
|
+
/** Last-resort name for an action with no description of its own. */
|
|
127
|
+
confirmThisAction: string;
|
|
114
128
|
/** Fallback humanised name for an unknown action type. */
|
|
115
129
|
unknownAction: string;
|
|
116
130
|
/** Generic friendly error when nothing else fits. */
|
|
@@ -276,12 +290,15 @@ interface LegacyThemeShape {
|
|
|
276
290
|
fontFamily?: string;
|
|
277
291
|
}
|
|
278
292
|
/**
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
293
|
+
* Public entry point.
|
|
294
|
+
*
|
|
295
|
+
* The chat is a leaf in the host app's tree, so its failure barrier is
|
|
296
|
+
* the simple case: nothing of the customer's app is inside it, and the
|
|
297
|
+
* degraded state can just be "no assistant". Rendering an error card
|
|
298
|
+
* inside somebody else's product would be worse than rendering nothing
|
|
299
|
+
* — they did not ask us to put a broken box on their screen.
|
|
283
300
|
*/
|
|
284
|
-
declare function AppilotsChat(props: AppilotsChatProps): React__default.JSX.Element;
|
|
301
|
+
declare function AppilotsChat(props: AppilotsChatProps): React__default.JSX.Element | null;
|
|
285
302
|
/**
|
|
286
303
|
* Re-exports kept for backwards compatibility — the legacy
|
|
287
304
|
* `AppilotsChatTheme` type used to live on this module. Prefer
|
|
@@ -368,6 +385,20 @@ interface BreadcrumbPalette {
|
|
|
368
385
|
/** "failed" tone AND every destructive badge/CTA (confirm card, reject button). */
|
|
369
386
|
error: string;
|
|
370
387
|
}
|
|
388
|
+
/**
|
|
389
|
+
* The subset of the SDK's strings the confirm card needs. Declared
|
|
390
|
+
* structurally rather than importing `AppilotsStrings` so this module
|
|
391
|
+
* stays a pure presentation helper with no i18n dependency.
|
|
392
|
+
*/
|
|
393
|
+
interface ConfirmCardStrings {
|
|
394
|
+
confirmDestructiveTitle: string;
|
|
395
|
+
confirmTitle: string;
|
|
396
|
+
confirmMessage: string;
|
|
397
|
+
confirmDestructiveApprove: string;
|
|
398
|
+
confirmApprove: string;
|
|
399
|
+
confirmCancel: string;
|
|
400
|
+
confirmThisAction: string;
|
|
401
|
+
}
|
|
371
402
|
|
|
372
403
|
/**
|
|
373
404
|
* ActionBreadcrumb — compact, line-per-action progress UI.
|
|
@@ -404,6 +435,12 @@ interface ActionBreadcrumbProps {
|
|
|
404
435
|
* pre-4.2 shape of this prop set) keep rendering exactly as before.
|
|
405
436
|
*/
|
|
406
437
|
palette?: Partial<Omit<BreadcrumbPalette, 'primary' | 'text'>>;
|
|
438
|
+
/**
|
|
439
|
+
* Resolved confirm-card copy for the host's locale. Optional so every
|
|
440
|
+
* existing caller keeps compiling; when absent the card falls back to
|
|
441
|
+
* the pt-BR literals it always shipped (#402). AppilotsChat passes it.
|
|
442
|
+
*/
|
|
443
|
+
confirmStrings?: ConfirmCardStrings;
|
|
407
444
|
/**
|
|
408
445
|
* Approve/reject inline buttons appear when this returns true for an
|
|
409
446
|
* action in `pending` state. `confirm`-type actions are normally
|
|
@@ -414,7 +451,7 @@ interface ActionBreadcrumbProps {
|
|
|
414
451
|
onApprove?: (actionId: string) => void;
|
|
415
452
|
onReject?: (actionId: string) => void;
|
|
416
453
|
}
|
|
417
|
-
declare function ActionBreadcrumb({ actions, primaryColor, textColor, fontFamily, palette, requireApprovalFor, onApprove, onReject, }: ActionBreadcrumbProps): React__default.JSX.Element | null;
|
|
454
|
+
declare function ActionBreadcrumb({ actions, primaryColor, textColor, fontFamily, palette, confirmStrings, requireApprovalFor, onApprove, onReject, }: ActionBreadcrumbProps): React__default.JSX.Element | null;
|
|
418
455
|
|
|
419
456
|
interface ChatIconProps {
|
|
420
457
|
/** Outer width/height in points. Default 24. */
|
|
@@ -478,7 +515,19 @@ interface ListScrollMetrics {
|
|
|
478
515
|
contentLength: number;
|
|
479
516
|
}
|
|
480
517
|
interface ListEntry {
|
|
481
|
-
|
|
518
|
+
/**
|
|
519
|
+
* `'list'` is a collection with rows — the agent can reason about
|
|
520
|
+
* ordinals, totals and per-item content. `'scroll'` is a bare
|
|
521
|
+
* scrollable surface (a `ScrollView` holding a form or a detail page):
|
|
522
|
+
* it has no rows, no total, and no ordinals — the ONLY thing the agent
|
|
523
|
+
* can do with it is page up/down to reveal content below the fold.
|
|
524
|
+
*
|
|
525
|
+
* They share this registry because they share the scroll handles, but
|
|
526
|
+
* they must never share a description: a `ScrollView` reported as a
|
|
527
|
+
* list with zero rows would invite "selecione o terceiro" against a
|
|
528
|
+
* container that has no third anything.
|
|
529
|
+
*/
|
|
530
|
+
kind: 'list' | 'scroll';
|
|
482
531
|
/** Stable runtime id assigned from testID/accessibilityLabel or generated. */
|
|
483
532
|
id: string;
|
|
484
533
|
/** Component name: FlatList, SectionList, VirtualizedList, FlashList, etc. */
|
|
@@ -523,7 +572,6 @@ declare class ListRegistryImpl {
|
|
|
523
572
|
declare const listRegistry: ListRegistry;
|
|
524
573
|
declare function createListRegistry(): ListRegistry;
|
|
525
574
|
|
|
526
|
-
type InteractionElementEntry = InteractionElementSnapshot;
|
|
527
575
|
type Listener = (id: string, entry: InteractionElementEntry | null) => void;
|
|
528
576
|
type ElementRegistry = ElementRegistryImpl;
|
|
529
577
|
declare class ElementRegistryImpl {
|
|
@@ -613,6 +661,17 @@ interface AppilotsRC {
|
|
|
613
661
|
apiBaseUrl?: string;
|
|
614
662
|
/** Alias for apiBaseUrl (supported for convenience) */
|
|
615
663
|
apiUrl?: string;
|
|
664
|
+
/**
|
|
665
|
+
* Alias for apiBaseUrl — the name `@appilots/cli` uses, and therefore
|
|
666
|
+
* the name that is actually in people's `.appilotsrc`.
|
|
667
|
+
*
|
|
668
|
+
* This used to be read by the CLI only. The SDK reads the very same
|
|
669
|
+
* file through the Metro plugin and simply ignored the key, so an app
|
|
670
|
+
* pointed at a staging or local API kept talking to production and
|
|
671
|
+
* nothing said so: the CLI obeyed, the app did not, and both looked
|
|
672
|
+
* fine. Accepted here so one file means one thing.
|
|
673
|
+
*/
|
|
674
|
+
serverUrl?: string;
|
|
616
675
|
/** Agent permissions */
|
|
617
676
|
permissions?: Partial<AgentPermissions>;
|
|
618
677
|
/** Enable debug logging */
|
|
@@ -682,6 +741,30 @@ declare function _patchJsxRuntimes(jsxRuntime: any, jsxDevRuntime: any): void;
|
|
|
682
741
|
* Check if auto-tracking is enabled.
|
|
683
742
|
*/
|
|
684
743
|
declare function isAutoTrackingEnabled(): boolean;
|
|
744
|
+
/** Which of the three element factories interception actually reached. */
|
|
745
|
+
interface AutoTrackingState {
|
|
746
|
+
/** `enableAppilotsAutoTracking()` ran. */
|
|
747
|
+
enabled: boolean;
|
|
748
|
+
createElementPatched: boolean;
|
|
749
|
+
/** `react/jsx-runtime` — jsx()/jsxs(), the transform release builds use. */
|
|
750
|
+
jsxRuntimePatched: boolean;
|
|
751
|
+
/** `react/jsx-dev-runtime` — jsxDEV(), development only. */
|
|
752
|
+
jsxDevRuntimePatched: boolean;
|
|
753
|
+
/** False once the guard latched interception off after repeated failures. */
|
|
754
|
+
interceptionActive: boolean;
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* Report which patches landed (#388).
|
|
758
|
+
*
|
|
759
|
+
* `enabled` alone is not the answer an integrator needs: the JSX
|
|
760
|
+
* runtime patch is the one that can silently not happen — bundlers
|
|
761
|
+
* resolve `react/jsx-runtime` differently, which is why `metro.js`
|
|
762
|
+
* exists to hand the modules back in. `enabled: true` with
|
|
763
|
+
* `jsxRuntimePatched: false` on a build using the automatic transform
|
|
764
|
+
* is a registry that will stay empty, and it looks exactly like a
|
|
765
|
+
* walker that stopped recognizing things.
|
|
766
|
+
*/
|
|
767
|
+
declare function getAutoTrackingState(): AutoTrackingState;
|
|
685
768
|
|
|
686
769
|
/**
|
|
687
770
|
* captureSnapshot — the public entry point for runtime UI introspection.
|
|
@@ -698,15 +781,6 @@ declare function isAutoTrackingEnabled(): boolean;
|
|
|
698
781
|
|
|
699
782
|
declare function captureSnapshot(): ScreenSnapshot;
|
|
700
783
|
|
|
701
|
-
/**
|
|
702
|
-
* fiberRoot — module-level holder for the root fiber captured by
|
|
703
|
-
* AppilotsFiberRoot. The fiber reference is set during the first render
|
|
704
|
-
* and is used by captureSnapshot() to walk the React tree on demand.
|
|
705
|
-
*
|
|
706
|
-
* Fiber nodes are mutable: React updates their .child/.sibling pointers
|
|
707
|
-
* as the tree re-renders. Storing a reference once is sufficient — we
|
|
708
|
-
* always see the latest tree when we walk.
|
|
709
|
-
*/
|
|
710
784
|
/**
|
|
711
785
|
* Why capture failed, when it did.
|
|
712
786
|
*
|
|
@@ -716,8 +790,23 @@ declare function captureSnapshot(): ScreenSnapshot;
|
|
|
716
790
|
* other way — the app renders fine and only introspection is blind.
|
|
717
791
|
* - `never-mounted`: something asked for a snapshot before
|
|
718
792
|
* `<AppilotsProvider>` committed (or outside it entirely).
|
|
793
|
+
* - `render-crashed`: the SDK's own render surface threw and the error
|
|
794
|
+
* boundary degraded it. Unlike the other two this is OUR bug, not a
|
|
795
|
+
* host-app integration problem — see `recordRenderFailure`.
|
|
796
|
+
* - `names-mangled`: the bundle renamed the React Native components the
|
|
797
|
+
* walker matches by name (#386). Not a capture failure — the fiber
|
|
798
|
+
* root is fine — but the same shape of harm: the app renders
|
|
799
|
+
* correctly and detection degrades to the structural fallbacks, in
|
|
800
|
+
* silence. See `introspection/nameMangling.ts`.
|
|
801
|
+
* - `walk-recognized-nothing`: the walker traversed a substantial tree
|
|
802
|
+
* and none of its eight leaf branches matched (#388). Like
|
|
803
|
+
* `names-mangled` this arrives with `captured: true`, and for the
|
|
804
|
+
* same reason: capture is not the thing that broke. What it reports
|
|
805
|
+
* is the state that used to be invisible — an empty snapshot taken
|
|
806
|
+
* from a screen that was NOT empty. `appilotsSelfCheck()` says which
|
|
807
|
+
* branch died; this says that one did.
|
|
719
808
|
*/
|
|
720
|
-
type IntrospectionFailureReason = 'sentinel-missing-internals' | 'never-mounted';
|
|
809
|
+
type IntrospectionFailureReason = 'sentinel-missing-internals' | 'never-mounted' | 'render-crashed' | 'names-mangled' | 'walk-recognized-nothing';
|
|
721
810
|
interface IntrospectionDiagnostics {
|
|
722
811
|
/** True once a root fiber has been captured. */
|
|
723
812
|
captured: boolean;
|
|
@@ -735,6 +824,211 @@ interface IntrospectionDiagnostics {
|
|
|
735
824
|
*/
|
|
736
825
|
declare function getIntrospectionDiagnostics(): IntrospectionDiagnostics;
|
|
737
826
|
|
|
827
|
+
/**
|
|
828
|
+
* #386 — did the bundler rename the components we match by name?
|
|
829
|
+
*
|
|
830
|
+
* Most of the introspection matches components by name, and
|
|
831
|
+
* `getTypeName` falls back to the function or class name whenever a
|
|
832
|
+
* component sets no `displayName`. That name is the one thing a
|
|
833
|
+
* minifier rewrites.
|
|
834
|
+
*
|
|
835
|
+
* Bundling `apps/example-app` twice with Metro 0.81.5 / RN 0.76.9
|
|
836
|
+
* settles what happens when it runs:
|
|
837
|
+
*
|
|
838
|
+
* ```
|
|
839
|
+
* --minify false --minify true
|
|
840
|
+
* function Switch 1 0
|
|
841
|
+
* function Modal( 1 0
|
|
842
|
+
* function FlatList 1 0
|
|
843
|
+
* function SectionList 1 0
|
|
844
|
+
* function VirtualizedList 4 0
|
|
845
|
+
* displayName='Text' 2 2
|
|
846
|
+
* ```
|
|
847
|
+
*
|
|
848
|
+
* Everything that names itself survives, because a `displayName` is a
|
|
849
|
+
* string literal. Everything that does not is gone.
|
|
850
|
+
*
|
|
851
|
+
* The React Native CLI's own release build does NOT minify — Hermes
|
|
852
|
+
* makes it unnecessary, so `react-native-xcode.sh` passes
|
|
853
|
+
* `--minify false` and the Gradle plugin sets
|
|
854
|
+
* `minifyEnabled = !hermesEnabled`. So the default pipeline is fine.
|
|
855
|
+
* Expo/EAS, Re.Pack, a custom `minifierConfig`, or `hermesEnabled=false`
|
|
856
|
+
* are not this repository's to verify.
|
|
857
|
+
*
|
|
858
|
+
* The structural fallbacks (a11y role for Switch, the native host for
|
|
859
|
+
* Modal, the props signature for lists) are what actually keep working.
|
|
860
|
+
* This probe exists because the failure mode is silent: the app renders
|
|
861
|
+
* perfectly and only the agent goes blind, exactly like
|
|
862
|
+
* `sentinel-missing-internals`. A degraded integration should be
|
|
863
|
+
* legible in a diagnostics dump instead of being guessed at from a
|
|
864
|
+
* support thread.
|
|
865
|
+
*/
|
|
866
|
+
/**
|
|
867
|
+
* Components whose runtime name we compare against what we expect.
|
|
868
|
+
*
|
|
869
|
+
* Deliberately a `displayName` holder AND a bare one: if BOTH are
|
|
870
|
+
* wrong, something stranger than minification is going on, and if only
|
|
871
|
+
* the bare one is wrong we know exactly which fallbacks are carrying
|
|
872
|
+
* the integration.
|
|
873
|
+
*/
|
|
874
|
+
interface NameManglingProbe {
|
|
875
|
+
/** True when a name-only component came back under a different name. */
|
|
876
|
+
mangled: boolean;
|
|
877
|
+
/** What each probed component actually reported, for a bug report. */
|
|
878
|
+
observed: Record<string, string | null>;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
type GeometryAvailability =
|
|
882
|
+
/** A host is installed and returning rects. */
|
|
883
|
+
'available'
|
|
884
|
+
/** No host installed — old architecture, or the provider never wired it. */
|
|
885
|
+
| 'unavailable'
|
|
886
|
+
/** A host is installed but every instance refused to measure. */
|
|
887
|
+
| 'silent';
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* walkFiber — Depth-first traversal of a React fiber tree.
|
|
891
|
+
*
|
|
892
|
+
* Given a root fiber, visits every descendant and extracts data about
|
|
893
|
+
* UI primitives (Text, TextInput, TouchableOpacity, Pressable, Switch,
|
|
894
|
+
* ActivityIndicator, Modal) into a ScreenSnapshot.
|
|
895
|
+
*
|
|
896
|
+
* Designed to be robust against monorepo setups where module instances
|
|
897
|
+
* differ — component types are matched by displayName/name rather than
|
|
898
|
+
* reference equality.
|
|
899
|
+
*/
|
|
900
|
+
|
|
901
|
+
/**
|
|
902
|
+
* How many times each leaf branch of the walker RECOGNIZED a fiber,
|
|
903
|
+
* over one walk (#388).
|
|
904
|
+
*
|
|
905
|
+
* `visitedFibers` answers "did the traversal run?". These answer "did
|
|
906
|
+
* it understand anything?" — the question that separates a genuinely
|
|
907
|
+
* empty screen from a walker whose matching stopped working. Every
|
|
908
|
+
* branch but `adjustable` consults `getTypeName` somewhere, and a name
|
|
909
|
+
* is the one thing a bundler rewrites, a wrapper component shadows and
|
|
910
|
+
* an RN upgrade renames. When they break they break in silence, and
|
|
911
|
+
* all that reaches the agent is an empty snapshot.
|
|
912
|
+
*
|
|
913
|
+
* Hits count RECOGNITIONS, not snapshot entries. The two differ on
|
|
914
|
+
* purpose: `<Text>{''}</Text>` and a de-duplicated button are branches
|
|
915
|
+
* that fired and produced nothing, and the gap between the counters
|
|
916
|
+
* and the snapshot is the second thing worth reading here.
|
|
917
|
+
*/
|
|
918
|
+
interface WalkDetectorCounts {
|
|
919
|
+
Text: number;
|
|
920
|
+
TextInput: number;
|
|
921
|
+
Switch: number;
|
|
922
|
+
ActivityIndicator: number;
|
|
923
|
+
Modal: number;
|
|
924
|
+
adjustable: number;
|
|
925
|
+
pressable: number;
|
|
926
|
+
/** Containers `isAlwaysListContainer`/`isHeuristicListContainer` claimed. */
|
|
927
|
+
listContainers: number;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
* appilotsSelfCheck — "is the integration actually working, in THIS
|
|
932
|
+
* binary?" (#388)
|
|
933
|
+
*
|
|
934
|
+
* Everything the SDK knew about its own health used to be either a
|
|
935
|
+
* `console.log` (gone from a release build, and unreadable on a device
|
|
936
|
+
* that is already in review) or `getIntrospectionDiagnostics()`, which
|
|
937
|
+
* answers a narrower question than it looks like it does: it reports
|
|
938
|
+
* whether the fiber ROOT was captured, not whether the walk that
|
|
939
|
+
* follows understood anything. So the single most common degraded
|
|
940
|
+
* state — root captured, tree walked, nothing recognized — reported as
|
|
941
|
+
* `{captured: true, failureReason: null}`. Green and blind.
|
|
942
|
+
*
|
|
943
|
+
* This is the pull half of the fix. It costs one walk, allocates
|
|
944
|
+
* nothing that outlives the call, and is meant to be wired to a hidden
|
|
945
|
+
* dev-menu button: `JSON.stringify(appilotsSelfCheck())`, pasted into a
|
|
946
|
+
* support thread, replaces the debug-build-and-reproduce round trip
|
|
947
|
+
* that a design partner cannot always do at all.
|
|
948
|
+
*
|
|
949
|
+
* The push half is `walk-recognized-nothing` in
|
|
950
|
+
* `IntrospectionFailureReason` — the same finding, reached without
|
|
951
|
+
* anyone asking.
|
|
952
|
+
*
|
|
953
|
+
* How to read the report:
|
|
954
|
+
*
|
|
955
|
+
* walk.visitedFibers large + every `detectors` count 0
|
|
956
|
+
* → the tree is there and the walker stopped matching it. Compare
|
|
957
|
+
* `nameMangling` first: it names the components whose runtime
|
|
958
|
+
* name no longer matches.
|
|
959
|
+
* detectors.Text > 0 + detectors.Switch === 0 on a screen that
|
|
960
|
+
* visibly has a switch
|
|
961
|
+
* → one branch, not the walker. That is a walkFiber bug (#167
|
|
962
|
+
* territory), and the branch is named.
|
|
963
|
+
* registry counts > 0 + detectors all 0
|
|
964
|
+
* → auto-tracking is registering components the walk cannot find.
|
|
965
|
+
* registry counts 0 + autoTracking.enabled false
|
|
966
|
+
* → `enableAppilotsAutoTracking()` never ran. Same empty screen,
|
|
967
|
+
* completely different fix.
|
|
968
|
+
*/
|
|
969
|
+
|
|
970
|
+
interface SelfCheckWalk {
|
|
971
|
+
visitedFibers: number;
|
|
972
|
+
skippedHidden: number;
|
|
973
|
+
elapsedMs: number;
|
|
974
|
+
}
|
|
975
|
+
interface SelfCheckRegistry {
|
|
976
|
+
fields: number;
|
|
977
|
+
toggles: number;
|
|
978
|
+
sliders: number;
|
|
979
|
+
targets: number;
|
|
980
|
+
lists: number;
|
|
981
|
+
/** Interaction elements from the last `captureSnapshot()`, not this walk. */
|
|
982
|
+
elements: number;
|
|
983
|
+
}
|
|
984
|
+
interface AppilotsSelfCheckReport {
|
|
985
|
+
sdkVersion: string;
|
|
986
|
+
reactVersion: string | null;
|
|
987
|
+
route: string | null;
|
|
988
|
+
/** Unchanged — the existing capture-health record, verbatim. */
|
|
989
|
+
introspection: IntrospectionDiagnostics;
|
|
990
|
+
autoTracking: AutoTrackingState;
|
|
991
|
+
walk: SelfCheckWalk;
|
|
992
|
+
/** Per-branch recognitions from the walk this call just performed. */
|
|
993
|
+
detectors: WalkDetectorCounts;
|
|
994
|
+
registry: SelfCheckRegistry;
|
|
995
|
+
/**
|
|
996
|
+
* The #386 probe, when `<AppilotsProvider>` has run it. Non-null with
|
|
997
|
+
* `mangled: true` is the first explanation to check for name-based
|
|
998
|
+
* detectors reading zero.
|
|
999
|
+
*/
|
|
1000
|
+
nameMangling: NameManglingProbe | null;
|
|
1001
|
+
/**
|
|
1002
|
+
* Whether this build can tell an on-screen control from one below the
|
|
1003
|
+
* fold.
|
|
1004
|
+
*
|
|
1005
|
+
* Three states, and they need different answers:
|
|
1006
|
+
* `unavailable` — the old React Native architecture, which has no
|
|
1007
|
+
* synchronous window-relative rect. Expected, not a fault.
|
|
1008
|
+
* `silent` — a reader IS installed and every instance came back
|
|
1009
|
+
* empty. Reads identically to the above from outside and is a bug.
|
|
1010
|
+
* `available` — working.
|
|
1011
|
+
*/
|
|
1012
|
+
geometry: {
|
|
1013
|
+
availability: GeometryAvailability;
|
|
1014
|
+
asked: number;
|
|
1015
|
+
answered: number;
|
|
1016
|
+
};
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* Walk the tree once and report what the SDK can see.
|
|
1020
|
+
*
|
|
1021
|
+
* Side-effect-free by design: unlike `captureSnapshot()` it does not
|
|
1022
|
+
* replace the element registry, does not reconcile sliders, and does
|
|
1023
|
+
* not record a diagnostic. Calling it must never change what the next
|
|
1024
|
+
* agent turn observes — a diagnostic that perturbs the thing it
|
|
1025
|
+
* measures is worse than none.
|
|
1026
|
+
*
|
|
1027
|
+
* With no fiber root the walk is skipped and the zeros are honest:
|
|
1028
|
+
* `introspection.captured` is the field that says why.
|
|
1029
|
+
*/
|
|
1030
|
+
declare function appilotsSelfCheck(): AppilotsSelfCheckReport;
|
|
1031
|
+
|
|
738
1032
|
/**
|
|
739
1033
|
* createAppilotsInput — HOC factory that wraps any TextInput-like component
|
|
740
1034
|
* and auto-registers it with the ComponentRegistry.
|
|
@@ -958,4 +1252,13 @@ interface ExecutorContext {
|
|
|
958
1252
|
}
|
|
959
1253
|
declare function executeAction(action: AgentAction, context: ExecutorContext): Promise<ActionResult>;
|
|
960
1254
|
|
|
961
|
-
|
|
1255
|
+
/**
|
|
1256
|
+
* GENERATED by scripts/release/sync-sdk-versions.mjs — do not edit.
|
|
1257
|
+
*
|
|
1258
|
+
* The version `@appilots/sdk` reports on the wire
|
|
1259
|
+
* (`X-Appilots-Sdk-Version`). Kept identical to package.json by the
|
|
1260
|
+
* release flow; `version.test.ts` fails if the two ever disagree.
|
|
1261
|
+
*/
|
|
1262
|
+
declare const SDK_VERSION = "0.10.0";
|
|
1263
|
+
|
|
1264
|
+
export { ActionBreadcrumb, type ActionBreadcrumbProps, type ActionResult, AgentAction, AgentPermissions, type AppilotsButtonProps, AppilotsChat, type AppilotsChatMode, type AppilotsChatPosition, type AppilotsChatProps, type AppilotsChatTheme, AppilotsEvent, AppilotsI18nProvider, type AppilotsI18nProviderProps, type AppilotsInputProps, AppilotsLocale, type AppilotsRC, AppilotsRegistryProvider, type AppilotsSelfCheckReport, type AppilotsStringKey, type AppilotsStrings, type AppilotsSwitchProps, AppilotsThemeProvider, type AppilotsThemeProviderProps, AppilotsThemeTokens, type AutoTrackingState, ChatIcon, type ChatIconProps, ComponentRegistry, ConfirmDialog, type ConfirmDialogProps, type ElementRegistry, type ExecutorContext, FieldEntry, HeadsetIcon, type HeadsetIconProps, InteractionElementEntry, type IntrospectionDiagnostics, type IntrospectionFailureReason, type ListEntry, type ListRegistry, type NameManglingProbe, PartialThemeTokens, SDK_VERSION, ScreenSnapshot, type SelfCheckRegistry, type SelfCheckWalk, type TailwindResolvedConfig, type WalkDetectorCounts, _patchJsxRuntimes, appilotsSelfCheck, appilotsTheme, appilotsThemeFromTailwind, captureSnapshot, createAppilotsButton, createAppilotsInput, createAppilotsSwitch, createElementRegistry, createListRegistry, detectDeviceLocale, elementRegistry, enableAppilotsAutoTracking, executeAction, getAutoTrackingState, getGlobalConfig, getIntrospectionDiagnostics, initAppilots, isAutoTrackingEnabled, listRegistry, resolveLocale, useAppilotsI18n, useAppilotsTheme, useResolvedRegistry };
|