@appilots/sdk 0.13.0 → 0.14.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/dist/index.d.mts CHANGED
@@ -1,7 +1,8 @@
1
- import { A as AppilotsTraceEntry, a as AgentAction, b as AppilotsLocale, P as PartialThemeTokens, c as AppilotsThemeTokens, C as ComponentRegistry, d as AppilotsSessionStorage, e as AgentPermissions, F as FieldEntry, f as AppilotsEvent } from './index-CI4jmSoP.mjs';
2
- export { g as AgentActionType, h as AgentMessage, i as AppilotsClient, j as AppilotsClientOptions, k as AppilotsConfig, l as AppilotsElementProps, m as AppilotsEventHandler, n as AppilotsEventType, o as AppilotsProvider, p as AppilotsProviderProps, q as AppilotsUser, r as ChatMessage, s as ComponentEntry, t as ComponentKind, E as EscalationState, u as FormFillPayload, M as MessageRole, N as NavigationPayload, R as RateLimitedError, v as RemotePersonalization, S as SliderEntry, w as SuggestedPrompt, T as TargetEntry, x as ToggleEntry, U as UIInteractionPayload, y as UseAppilotsFieldOptions, z as UseAppilotsSliderOptions, B as UseAppilotsTargetOptions, D as UseAppilotsToggleOptions, G as UseSuggestedPromptsOptions, H as UseSuggestedPromptsReturn, I as componentRegistry, J as createComponentRegistry, K as defaultDarkTheme, L as defaultLightTheme, O as mergeThemeTokens, Q as useAppilots, V as useAppilotsActions, W as useAppilotsChat, X as useAppilotsContext, Y as useAppilotsField, Z as useAppilotsNavigation, _ as useAppilotsSlider, $ as useAppilotsTarget, a0 as useAppilotsToggle, a1 as useSuggestedPrompts } from './index-CI4jmSoP.mjs';
1
+ import { A as AppilotsTraceEntry, a as AgentAction, b as AppilotsLocale, P as PartialThemeTokens, c as AppilotsThemeTokens, C as ComponentRegistry, d as AppilotsSessionStorage, e as AgentPermissions, F as FieldEntry, f as AppilotsEvent } from './index-wMMetyrj.mjs';
2
+ export { g as AgentActionType, h as AgentMessage, i as AppilotsClient, j as AppilotsClientOptions, k as AppilotsConfig, l as AppilotsElementProps, m as AppilotsEventHandler, n as AppilotsEventType, o as AppilotsProvider, p as AppilotsProviderProps, q as AppilotsUser, r as ChatMessage, s as ComponentEntry, t as ComponentKind, E as EscalationState, u as FormFillPayload, M as MessageRole, N as NavigationPayload, R as RateLimitedError, v as RemotePersonalization, S as SliderEntry, w as SuggestedPrompt, T as TargetEntry, x as ToggleEntry, U as UIInteractionPayload, y as UseAppilotsFieldOptions, z as UseAppilotsSliderOptions, B as UseAppilotsTargetOptions, D as UseAppilotsToggleOptions, G as UseSuggestedPromptsOptions, H as UseSuggestedPromptsReturn, I as componentRegistry, J as createComponentRegistry, K as defaultDarkTheme, L as defaultLightTheme, O as mergeThemeTokens, Q as useAppilots, V as useAppilotsActions, W as useAppilotsChat, X as useAppilotsContext, Y as useAppilotsField, Z as useAppilotsNavigation, _ as useAppilotsSlider, $ as useAppilotsTarget, a0 as useAppilotsToggle, a1 as useSuggestedPrompts } from './index-wMMetyrj.mjs';
3
3
  import * as React$1 from 'react';
4
4
  import React__default from 'react';
5
+ import { TouchableOpacity } from 'react-native';
5
6
  export { AppilotsNavigationContainer, NavigationConfig, ScreenMetadata, registerScreen, setCurrentScreen } from './navigation/index.mjs';
6
7
 
7
8
  /** Source facts, not an executable locator or proof of a business outcome. */
@@ -22,6 +23,87 @@ interface ControlEvidence {
22
23
 
23
24
  type ActionPresentationState = 'pending' | 'running' | 'success' | 'failed';
24
25
 
26
+ /**
27
+ * The speech seam.
28
+ *
29
+ * The SDK ships no speech engine and never will. Every usable one on
30
+ * React Native is a native module — `@react-native-voice/voice`,
31
+ * `expo-speech-recognition`, a vendor SDK — and a dependency here would
32
+ * force native linking on every integrator, including the majority who
33
+ * will never turn voice on. Worse, it would pick their engine for them:
34
+ * the right one depends on the locale they need, whether recognition
35
+ * may leave the device, and what their app store review already covers.
36
+ *
37
+ * So this is an interface and nothing else, injected the same way
38
+ * `GeometryHost` and the `Alert` in `confirmedDestructiveAlert` are.
39
+ * Pass an adapter and the mic button appears; pass nothing and
40
+ * `resolveExperience` reports `input: 'voice'` as an unmet request
41
+ * rather than rendering a button that does nothing.
42
+ *
43
+ * It lives in client-core because the web SDK takes the same contract:
44
+ * its built-in Web Speech engine is one implementation of it, and a
45
+ * host that needs recognition to stay on-device (or a vendor engine)
46
+ * passes its own.
47
+ *
48
+ * Everything here is transcription only. Playing audio back is not
49
+ * modelled, because nothing in the loop produces audio.
50
+ */
51
+ /** What the SDK needs to run a mic button (hold-to-talk or toggle). */
52
+ interface SpeechHost {
53
+ /**
54
+ * Begin listening. Resolve once capture is actually running, so the
55
+ * UI can wait before telling the user to speak.
56
+ *
57
+ * Implementations own permissions: if the OS prompt has not been
58
+ * accepted, request it here and reject when refused.
59
+ */
60
+ start(options: SpeechStartOptions): Promise<void>;
61
+ /**
62
+ * Stop listening and resolve with the final transcript.
63
+ *
64
+ * Resolving with an empty string is the normal outcome for "the user
65
+ * pressed and said nothing" — it must not reject for that.
66
+ */
67
+ stop(): Promise<string>;
68
+ /** Abandon the capture. No transcript, no error. */
69
+ cancel(): Promise<void>;
70
+ /**
71
+ * Partial results while the user is still talking, if the engine has
72
+ * them. Return a disposer. Optional — a host without interim results
73
+ * simply shows the placeholder until `stop` resolves.
74
+ */
75
+ onPartial?(listener: (text: string) => void): () => void;
76
+ /**
77
+ * The engine ended the capture on its own — silence timeout, lost
78
+ * permission, network — without `stop` or `cancel` being called.
79
+ * `error` is set when it ended by failure. Return a disposer.
80
+ *
81
+ * Optional, but without it a UI cannot leave `listening` until the
82
+ * user presses again: the button would claim to record while the
83
+ * engine is not.
84
+ */
85
+ onEnd?(listener: (error?: unknown) => void): () => void;
86
+ }
87
+ interface SpeechStartOptions {
88
+ /**
89
+ * BCP-47 tag resolved from the chat's locale, so a pt-BR chat does
90
+ * not transcribe against a US English model. Hosts that only support
91
+ * one locale may ignore it.
92
+ */
93
+ locale: string;
94
+ }
95
+ /** Where a mic button is in its cycle. */
96
+ type SpeechState = 'idle' | 'starting' | 'listening' | 'stopping' | 'error';
97
+ /**
98
+ * Is this object usable as a host?
99
+ *
100
+ * Checked at the boundary rather than trusted from the type, because
101
+ * the value crosses from the host app's JavaScript — where it may have
102
+ * come from a config file, a lazy import that failed, or a version of
103
+ * an adapter predating a method.
104
+ */
105
+ declare function isSpeechHost(value: unknown): value is SpeechHost;
106
+
25
107
  /**
26
108
  * Snapshot types — the platform-agnostic "view model" of what the user
27
109
  * is currently seeing on screen, sent to the AI agent so it has
@@ -710,61 +792,6 @@ declare function humanizeError(raw: string | undefined, _action?: AgentAction):
710
792
  */
711
793
  type AppilotsChatPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
712
794
 
713
- /**
714
- * The speech seam.
715
- *
716
- * The SDK ships no speech engine and never will. Every usable one on
717
- * React Native is a native module — `@react-native-voice/voice`,
718
- * `expo-speech-recognition`, a vendor SDK — and a dependency here would
719
- * force native linking on every integrator, including the majority who
720
- * will never turn voice on. Worse, it would pick their engine for them:
721
- * the right one depends on the locale they need, whether recognition
722
- * may leave the device, and what their app store review already covers.
723
- *
724
- * So this is an interface and nothing else, injected the same way
725
- * `GeometryHost` and the `Alert` in `confirmedDestructiveAlert` are.
726
- * Pass an adapter and the mic button appears; pass nothing and
727
- * `resolveExperience` reports `input: 'voice'` as an unmet request
728
- * rather than rendering a button that does nothing.
729
- *
730
- * Everything here is transcription only. Playing audio back is not
731
- * modelled, because nothing in the loop produces audio.
732
- */
733
- /** What the SDK needs to run a hold-to-talk button. */
734
- interface SpeechHost {
735
- /**
736
- * Begin listening. Resolve once capture is actually running, so the
737
- * UI can wait before telling the user to speak.
738
- *
739
- * Implementations own permissions: if the OS prompt has not been
740
- * accepted, request it here and reject when refused.
741
- */
742
- start(options: SpeechStartOptions): Promise<void>;
743
- /**
744
- * Stop listening and resolve with the final transcript.
745
- *
746
- * Resolving with an empty string is the normal outcome for "the user
747
- * pressed and said nothing" — it must not reject for that.
748
- */
749
- stop(): Promise<string>;
750
- /** Abandon the capture. No transcript, no error. */
751
- cancel(): Promise<void>;
752
- /**
753
- * Partial results while the user is still talking, if the engine has
754
- * them. Return a disposer. Optional — a host without interim results
755
- * simply shows the placeholder until `stop` resolves.
756
- */
757
- onPartial?(listener: (text: string) => void): () => void;
758
- }
759
- interface SpeechStartOptions {
760
- /**
761
- * BCP-47 tag resolved from the chat's locale, so a pt-BR chat does
762
- * not transcribe against a US English model. Hosts that only support
763
- * one locale may ignore it.
764
- */
765
- locale: string;
766
- }
767
-
768
795
  /**
769
796
  * Pure resolution for the chat's *experience* config — the knobs that
770
797
  * decide what the user sees WHILE the agent drives the app, and how a
@@ -985,6 +1012,11 @@ interface AppilotsStrings {
985
1012
  statusWaitingApp: string;
986
1013
  /** Status shown while the assistant adjusts after a recoverable failure. */
987
1014
  statusAdjusting: string;
1015
+ /**
1016
+ * Periodic status on long turns (visible and announced to screen
1017
+ * readers). `{seconds}` is replaced with the elapsed time.
1018
+ */
1019
+ stillWorking: string;
988
1020
  /** Footer line shown when poweredByVisible !== false. */
989
1021
  poweredBy: string;
990
1022
  /** Approve button on a pending action row in the breadcrumb. */
@@ -1007,6 +1039,8 @@ interface AppilotsStrings {
1007
1039
  confirmCancel: string;
1008
1040
  /** Last-resort name for an action with no description of its own. */
1009
1041
  confirmThisAction: string;
1042
+ /** Shown and announced when a pending confirmation can no longer be approved. */
1043
+ confirmExpired: string;
1010
1044
  /** Fallback humanised name for an unknown action type. */
1011
1045
  unknownAction: string;
1012
1046
  /** Generic friendly error when nothing else fits. */
@@ -1047,6 +1081,10 @@ interface AppilotsStrings {
1047
1081
  missionPaused: string;
1048
1082
  /** Pill label after the turn ends, before the user opens the sheet. */
1049
1083
  pillDone: string;
1084
+ /** Announced when the turn stops to wait for the user's approval. */
1085
+ a11yAwaitingApproval: string;
1086
+ /** Announced when a turn in which the agent acted on the app ends. */
1087
+ a11yTurnDone: string;
1050
1088
  /** A11y label for the hold-to-talk mic button at rest. */
1051
1089
  micStartA11y: string;
1052
1090
  /** A11y label while a capture is running. */
@@ -1319,6 +1357,8 @@ interface AgentPillProps {
1319
1357
  state: BreadcrumbState;
1320
1358
  /** Tap anywhere on the pill — raises the full sheet. */
1321
1359
  onExpand: () => void;
1360
+ /** The expand control — where a screen reader's focus returns when the sheet collapses. */
1361
+ expandRef?: React__default.Ref<React__default.ElementRef<typeof TouchableOpacity>>;
1322
1362
  /**
1323
1363
  * Stop button. Omit to hide it — there is nothing to cancel once the
1324
1364
  * turn has ended, and a dead button on a one-line surface is worse
@@ -1344,7 +1384,7 @@ interface AgentPillProps {
1344
1384
  fontFamily?: string;
1345
1385
  strings: AgentPillStrings;
1346
1386
  }
1347
- declare function AgentPill({ label, state, onExpand, onStop, position, insets, colors, fontFamily, strings, }: AgentPillProps): React__default.JSX.Element;
1387
+ declare function AgentPill({ label, state, onExpand, expandRef, onStop, position, insets, colors, fontFamily, strings, }: AgentPillProps): React__default.JSX.Element;
1348
1388
 
1349
1389
  /**
1350
1390
  * Is this control actually on the screen right now?
@@ -1418,6 +1458,10 @@ type GeometryAvailability =
1418
1458
  * `pointerEvents="none"` throughout. The ring marks a control the user
1419
1459
  * can still press themselves — swallowing that press to draw decoration
1420
1460
  * over it would defeat the point of leaving the app touchable.
1461
+ *
1462
+ * Being invisible to touch and to the accessibility tree, the ring says
1463
+ * nothing to a screen reader. The chat speaks the same fact instead,
1464
+ * from the store's announcement channel (`subscribeSpotlightAnnouncement`).
1421
1465
  */
1422
1466
 
1423
1467
  interface SpotlightOverlayProps {
@@ -1473,6 +1517,8 @@ interface SpotlightTarget {
1473
1517
  seq: number;
1474
1518
  }
1475
1519
  type Listener$2 = (target: SpotlightTarget | null) => void;
1520
+ /** What the agent does to the control — picks the verb of the spoken announcement. */
1521
+ type SpotlightVerb = 'press' | 'toggle' | 'focus' | 'fill';
1476
1522
  /**
1477
1523
  * How long a ring stays up after the action it marks.
1478
1524
  *
@@ -1491,7 +1537,7 @@ declare function getSpotlightMode(): SpotlightMode;
1491
1537
  * measurable, so the previous ring does not linger over an unrelated
1492
1538
  * control and imply the agent is aiming at it.
1493
1539
  */
1494
- declare function setSpotlightTarget(rect: Rect | null, label?: string): void;
1540
+ declare function setSpotlightTarget(rect: Rect | null, label?: string, verb?: SpotlightVerb): void;
1495
1541
  declare function getSpotlightTarget(): SpotlightTarget | null;
1496
1542
  /** Subscribe. Returns the unsubscribe. Does NOT fire on subscribe. */
1497
1543
  declare function subscribeSpotlight(listener: Listener$2): () => void;
@@ -1748,6 +1794,8 @@ interface ConfirmCardStrings {
1748
1794
  confirmApprove: string;
1749
1795
  confirmCancel: string;
1750
1796
  confirmThisAction: string;
1797
+ /** Optional so hosts that built this object before it existed keep compiling. */
1798
+ confirmExpired?: string;
1751
1799
  }
1752
1800
 
1753
1801
  interface ActionBreadcrumbProps {
@@ -1781,8 +1829,13 @@ interface ActionBreadcrumbProps {
1781
1829
  /** Required when `requireApprovalFor` returns true for any action. */
1782
1830
  onApprove?: (actionId: string) => void;
1783
1831
  onReject?: (actionId: string) => void;
1832
+ /**
1833
+ * Called when a confirm card leaves the screen (answered, expired or
1834
+ * dropped), so the chat can hand screen-reader focus back to the composer.
1835
+ */
1836
+ onConfirmCardGone?: () => void;
1784
1837
  }
1785
- declare function ActionBreadcrumb({ actions, primaryColor, textColor, fontFamily, palette, confirmStrings, locale, requireApprovalFor, onApprove, onReject, }: ActionBreadcrumbProps): React__default.JSX.Element | null;
1838
+ declare function ActionBreadcrumb({ actions, primaryColor, textColor, fontFamily, palette, confirmStrings, locale, requireApprovalFor, onApprove, onReject, onConfirmCardGone, }: ActionBreadcrumbProps): React__default.JSX.Element | null;
1786
1839
 
1787
1840
  interface ChatIconProps {
1788
1841
  /** Outer width/height in points. Default 24. */
@@ -2655,6 +2708,6 @@ declare function executeAction(action: AgentAction, context: ExecutorContext): P
2655
2708
  * (`X-Appilots-Sdk-Version`). Kept identical to package.json by the
2656
2709
  * release flow; `version.test.ts` fails if the two ever disagree.
2657
2710
  */
2658
- declare const SDK_VERSION = "0.13.0";
2711
+ declare const SDK_VERSION = "0.14.0";
2659
2712
 
2660
- export { ActionBreadcrumb, type ActionBreadcrumbProps, type ActionResult, AgentAction, AgentPermissions, AgentPill, type AgentPillProps, type AgentPillStrings, type AppilotsButtonProps, AppilotsChat, type AppilotsChatMode, type AppilotsChatPosition, type AppilotsChatProps, type AppilotsChatTheme, type AppilotsControl, type AppilotsEntryPoint, AppilotsEvent, type AppilotsExperience, AppilotsI18nProvider, type AppilotsI18nProviderProps, type AppilotsInputMode, type AppilotsInputProps, AppilotsLocale, type AppilotsPresence, type AppilotsRC, AppilotsRegistryProvider, type AppilotsSelfCheckReport, type AppilotsSpotlight, type AppilotsStringKey, type AppilotsStrings, type AppilotsSwitchProps, AppilotsThemeProvider, type AppilotsThemeProviderProps, AppilotsThemeTokens, AppilotsTraceEntry, type AutoTrackingState, type BreadcrumbItem, type BreadcrumbState, type ButtonSnapshot, ChatIcon, type ChatIconProps, type ChoiceGroupSnapshot, type ChoiceOptionSnapshot, ComponentRegistry, ConfirmDialog, type ConfirmDialogProps, DEFAULT_EXPERIENCE, type ElementRegistry, type ExecutorContext, type ExperienceCapabilities, type ExperienceDowngrade, type ExperienceResolution, FieldEntry, HeadsetIcon, type HeadsetIconProps, type InputSnapshot, type InteractionElementEntry, type InteractionElementListContext, type InteractionElementSnapshot, type IntrospectionDiagnostics, type IntrospectionFailureReason, type ListEntry, type ListItemSnapshot, type ListRegistry, type ListSnapshot, type NameManglingProbe, PartialThemeTokens, type PillStatus, type PillStatusStrings, REVEAL_MARGIN, type ResolvedExperience, type RevealInput, type RevealResult, SDK_VERSION, SPOTLIGHT_TTL_MS, type ScreenSnapshot, type ScrollMetrics, type SelfCheckRegistry, type SelfCheckWalk, type SpotlightMode, SpotlightOverlay, type SpotlightOverlayProps, type SpotlightTarget, type SurfaceState, type TailwindResolvedConfig, type ToggleSnapshot, type TurnActivity, type WalkDetectorCounts, _patchJsxRuntimes, appilotsListTotal, appilotsSelfCheck, appilotsTheme, appilotsThemeFromTailwind, captureSnapshot, clearAppilotsDebugTraces, createAppilotsButton, createAppilotsInput, createAppilotsSwitch, createElementRegistry, createListRegistry, describeAction, detectDeviceLocale, elementRegistry, enableAppilotsAutoTracking, executeAction, formatDowngrades, getAppilotsDebugTraces, getAutoTrackingState, getGlobalConfig, getIntrospectionDiagnostics, getSpotlightMode, getSpotlightTarget, humanizeError, initAppilots, isAutoTrackingEnabled, listRegistry, offsetToReveal, recordAppilotsDebugTrace, resolveExperience, resolveLocale, resolvePillStatus, resolveSurface, revealTarget, setSpotlightMode, setSpotlightTarget, shouldReopenOnTurnEnd, subscribeAppilotsDebugTraces, subscribeSpotlight, useAppilotsI18n, useAppilotsTheme, useResolvedRegistry, useSpotlight, usesPill };
2713
+ export { ActionBreadcrumb, type ActionBreadcrumbProps, type ActionResult, AgentAction, AgentPermissions, AgentPill, type AgentPillProps, type AgentPillStrings, type AppilotsButtonProps, AppilotsChat, type AppilotsChatMode, type AppilotsChatPosition, type AppilotsChatProps, type AppilotsChatTheme, type AppilotsControl, type AppilotsEntryPoint, AppilotsEvent, type AppilotsExperience, AppilotsI18nProvider, type AppilotsI18nProviderProps, type AppilotsInputMode, type AppilotsInputProps, AppilotsLocale, type AppilotsPresence, type AppilotsRC, AppilotsRegistryProvider, type AppilotsSelfCheckReport, type AppilotsSpotlight, type AppilotsStringKey, type AppilotsStrings, type AppilotsSwitchProps, AppilotsThemeProvider, type AppilotsThemeProviderProps, AppilotsThemeTokens, AppilotsTraceEntry, type AutoTrackingState, type BreadcrumbItem, type BreadcrumbState, type ButtonSnapshot, ChatIcon, type ChatIconProps, type ChoiceGroupSnapshot, type ChoiceOptionSnapshot, ComponentRegistry, ConfirmDialog, type ConfirmDialogProps, DEFAULT_EXPERIENCE, type ElementRegistry, type ExecutorContext, type ExperienceCapabilities, type ExperienceDowngrade, type ExperienceResolution, FieldEntry, HeadsetIcon, type HeadsetIconProps, type InputSnapshot, type InteractionElementEntry, type InteractionElementListContext, type InteractionElementSnapshot, type IntrospectionDiagnostics, type IntrospectionFailureReason, type ListEntry, type ListItemSnapshot, type ListRegistry, type ListSnapshot, type NameManglingProbe, PartialThemeTokens, type PillStatus, type PillStatusStrings, REVEAL_MARGIN, type ResolvedExperience, type RevealInput, type RevealResult, SDK_VERSION, SPOTLIGHT_TTL_MS, type ScreenSnapshot, type ScrollMetrics, type SelfCheckRegistry, type SelfCheckWalk, type SpeechHost, type SpeechStartOptions, type SpeechState, type SpotlightMode, SpotlightOverlay, type SpotlightOverlayProps, type SpotlightTarget, type SurfaceState, type TailwindResolvedConfig, type ToggleSnapshot, type TurnActivity, type WalkDetectorCounts, _patchJsxRuntimes, appilotsListTotal, appilotsSelfCheck, appilotsTheme, appilotsThemeFromTailwind, captureSnapshot, clearAppilotsDebugTraces, createAppilotsButton, createAppilotsInput, createAppilotsSwitch, createElementRegistry, createListRegistry, describeAction, detectDeviceLocale, elementRegistry, enableAppilotsAutoTracking, executeAction, formatDowngrades, getAppilotsDebugTraces, getAutoTrackingState, getGlobalConfig, getIntrospectionDiagnostics, getSpotlightMode, getSpotlightTarget, humanizeError, initAppilots, isAutoTrackingEnabled, isSpeechHost, listRegistry, offsetToReveal, recordAppilotsDebugTrace, resolveExperience, resolveLocale, resolvePillStatus, resolveSurface, revealTarget, setSpotlightMode, setSpotlightTarget, shouldReopenOnTurnEnd, subscribeAppilotsDebugTraces, subscribeSpotlight, useAppilotsI18n, useAppilotsTheme, useResolvedRegistry, useSpotlight, usesPill };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { A as AppilotsTraceEntry, a as AgentAction, b as AppilotsLocale, P as PartialThemeTokens, c as AppilotsThemeTokens, C as ComponentRegistry, d as AppilotsSessionStorage, e as AgentPermissions, F as FieldEntry, f as AppilotsEvent } from './index-CI4jmSoP.js';
2
- export { g as AgentActionType, h as AgentMessage, i as AppilotsClient, j as AppilotsClientOptions, k as AppilotsConfig, l as AppilotsElementProps, m as AppilotsEventHandler, n as AppilotsEventType, o as AppilotsProvider, p as AppilotsProviderProps, q as AppilotsUser, r as ChatMessage, s as ComponentEntry, t as ComponentKind, E as EscalationState, u as FormFillPayload, M as MessageRole, N as NavigationPayload, R as RateLimitedError, v as RemotePersonalization, S as SliderEntry, w as SuggestedPrompt, T as TargetEntry, x as ToggleEntry, U as UIInteractionPayload, y as UseAppilotsFieldOptions, z as UseAppilotsSliderOptions, B as UseAppilotsTargetOptions, D as UseAppilotsToggleOptions, G as UseSuggestedPromptsOptions, H as UseSuggestedPromptsReturn, I as componentRegistry, J as createComponentRegistry, K as defaultDarkTheme, L as defaultLightTheme, O as mergeThemeTokens, Q as useAppilots, V as useAppilotsActions, W as useAppilotsChat, X as useAppilotsContext, Y as useAppilotsField, Z as useAppilotsNavigation, _ as useAppilotsSlider, $ as useAppilotsTarget, a0 as useAppilotsToggle, a1 as useSuggestedPrompts } from './index-CI4jmSoP.js';
1
+ import { A as AppilotsTraceEntry, a as AgentAction, b as AppilotsLocale, P as PartialThemeTokens, c as AppilotsThemeTokens, C as ComponentRegistry, d as AppilotsSessionStorage, e as AgentPermissions, F as FieldEntry, f as AppilotsEvent } from './index-wMMetyrj.js';
2
+ export { g as AgentActionType, h as AgentMessage, i as AppilotsClient, j as AppilotsClientOptions, k as AppilotsConfig, l as AppilotsElementProps, m as AppilotsEventHandler, n as AppilotsEventType, o as AppilotsProvider, p as AppilotsProviderProps, q as AppilotsUser, r as ChatMessage, s as ComponentEntry, t as ComponentKind, E as EscalationState, u as FormFillPayload, M as MessageRole, N as NavigationPayload, R as RateLimitedError, v as RemotePersonalization, S as SliderEntry, w as SuggestedPrompt, T as TargetEntry, x as ToggleEntry, U as UIInteractionPayload, y as UseAppilotsFieldOptions, z as UseAppilotsSliderOptions, B as UseAppilotsTargetOptions, D as UseAppilotsToggleOptions, G as UseSuggestedPromptsOptions, H as UseSuggestedPromptsReturn, I as componentRegistry, J as createComponentRegistry, K as defaultDarkTheme, L as defaultLightTheme, O as mergeThemeTokens, Q as useAppilots, V as useAppilotsActions, W as useAppilotsChat, X as useAppilotsContext, Y as useAppilotsField, Z as useAppilotsNavigation, _ as useAppilotsSlider, $ as useAppilotsTarget, a0 as useAppilotsToggle, a1 as useSuggestedPrompts } from './index-wMMetyrj.js';
3
3
  import * as React$1 from 'react';
4
4
  import React__default from 'react';
5
+ import { TouchableOpacity } from 'react-native';
5
6
  export { AppilotsNavigationContainer, NavigationConfig, ScreenMetadata, registerScreen, setCurrentScreen } from './navigation/index.js';
6
7
 
7
8
  /** Source facts, not an executable locator or proof of a business outcome. */
@@ -22,6 +23,87 @@ interface ControlEvidence {
22
23
 
23
24
  type ActionPresentationState = 'pending' | 'running' | 'success' | 'failed';
24
25
 
26
+ /**
27
+ * The speech seam.
28
+ *
29
+ * The SDK ships no speech engine and never will. Every usable one on
30
+ * React Native is a native module — `@react-native-voice/voice`,
31
+ * `expo-speech-recognition`, a vendor SDK — and a dependency here would
32
+ * force native linking on every integrator, including the majority who
33
+ * will never turn voice on. Worse, it would pick their engine for them:
34
+ * the right one depends on the locale they need, whether recognition
35
+ * may leave the device, and what their app store review already covers.
36
+ *
37
+ * So this is an interface and nothing else, injected the same way
38
+ * `GeometryHost` and the `Alert` in `confirmedDestructiveAlert` are.
39
+ * Pass an adapter and the mic button appears; pass nothing and
40
+ * `resolveExperience` reports `input: 'voice'` as an unmet request
41
+ * rather than rendering a button that does nothing.
42
+ *
43
+ * It lives in client-core because the web SDK takes the same contract:
44
+ * its built-in Web Speech engine is one implementation of it, and a
45
+ * host that needs recognition to stay on-device (or a vendor engine)
46
+ * passes its own.
47
+ *
48
+ * Everything here is transcription only. Playing audio back is not
49
+ * modelled, because nothing in the loop produces audio.
50
+ */
51
+ /** What the SDK needs to run a mic button (hold-to-talk or toggle). */
52
+ interface SpeechHost {
53
+ /**
54
+ * Begin listening. Resolve once capture is actually running, so the
55
+ * UI can wait before telling the user to speak.
56
+ *
57
+ * Implementations own permissions: if the OS prompt has not been
58
+ * accepted, request it here and reject when refused.
59
+ */
60
+ start(options: SpeechStartOptions): Promise<void>;
61
+ /**
62
+ * Stop listening and resolve with the final transcript.
63
+ *
64
+ * Resolving with an empty string is the normal outcome for "the user
65
+ * pressed and said nothing" — it must not reject for that.
66
+ */
67
+ stop(): Promise<string>;
68
+ /** Abandon the capture. No transcript, no error. */
69
+ cancel(): Promise<void>;
70
+ /**
71
+ * Partial results while the user is still talking, if the engine has
72
+ * them. Return a disposer. Optional — a host without interim results
73
+ * simply shows the placeholder until `stop` resolves.
74
+ */
75
+ onPartial?(listener: (text: string) => void): () => void;
76
+ /**
77
+ * The engine ended the capture on its own — silence timeout, lost
78
+ * permission, network — without `stop` or `cancel` being called.
79
+ * `error` is set when it ended by failure. Return a disposer.
80
+ *
81
+ * Optional, but without it a UI cannot leave `listening` until the
82
+ * user presses again: the button would claim to record while the
83
+ * engine is not.
84
+ */
85
+ onEnd?(listener: (error?: unknown) => void): () => void;
86
+ }
87
+ interface SpeechStartOptions {
88
+ /**
89
+ * BCP-47 tag resolved from the chat's locale, so a pt-BR chat does
90
+ * not transcribe against a US English model. Hosts that only support
91
+ * one locale may ignore it.
92
+ */
93
+ locale: string;
94
+ }
95
+ /** Where a mic button is in its cycle. */
96
+ type SpeechState = 'idle' | 'starting' | 'listening' | 'stopping' | 'error';
97
+ /**
98
+ * Is this object usable as a host?
99
+ *
100
+ * Checked at the boundary rather than trusted from the type, because
101
+ * the value crosses from the host app's JavaScript — where it may have
102
+ * come from a config file, a lazy import that failed, or a version of
103
+ * an adapter predating a method.
104
+ */
105
+ declare function isSpeechHost(value: unknown): value is SpeechHost;
106
+
25
107
  /**
26
108
  * Snapshot types — the platform-agnostic "view model" of what the user
27
109
  * is currently seeing on screen, sent to the AI agent so it has
@@ -710,61 +792,6 @@ declare function humanizeError(raw: string | undefined, _action?: AgentAction):
710
792
  */
711
793
  type AppilotsChatPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
712
794
 
713
- /**
714
- * The speech seam.
715
- *
716
- * The SDK ships no speech engine and never will. Every usable one on
717
- * React Native is a native module — `@react-native-voice/voice`,
718
- * `expo-speech-recognition`, a vendor SDK — and a dependency here would
719
- * force native linking on every integrator, including the majority who
720
- * will never turn voice on. Worse, it would pick their engine for them:
721
- * the right one depends on the locale they need, whether recognition
722
- * may leave the device, and what their app store review already covers.
723
- *
724
- * So this is an interface and nothing else, injected the same way
725
- * `GeometryHost` and the `Alert` in `confirmedDestructiveAlert` are.
726
- * Pass an adapter and the mic button appears; pass nothing and
727
- * `resolveExperience` reports `input: 'voice'` as an unmet request
728
- * rather than rendering a button that does nothing.
729
- *
730
- * Everything here is transcription only. Playing audio back is not
731
- * modelled, because nothing in the loop produces audio.
732
- */
733
- /** What the SDK needs to run a hold-to-talk button. */
734
- interface SpeechHost {
735
- /**
736
- * Begin listening. Resolve once capture is actually running, so the
737
- * UI can wait before telling the user to speak.
738
- *
739
- * Implementations own permissions: if the OS prompt has not been
740
- * accepted, request it here and reject when refused.
741
- */
742
- start(options: SpeechStartOptions): Promise<void>;
743
- /**
744
- * Stop listening and resolve with the final transcript.
745
- *
746
- * Resolving with an empty string is the normal outcome for "the user
747
- * pressed and said nothing" — it must not reject for that.
748
- */
749
- stop(): Promise<string>;
750
- /** Abandon the capture. No transcript, no error. */
751
- cancel(): Promise<void>;
752
- /**
753
- * Partial results while the user is still talking, if the engine has
754
- * them. Return a disposer. Optional — a host without interim results
755
- * simply shows the placeholder until `stop` resolves.
756
- */
757
- onPartial?(listener: (text: string) => void): () => void;
758
- }
759
- interface SpeechStartOptions {
760
- /**
761
- * BCP-47 tag resolved from the chat's locale, so a pt-BR chat does
762
- * not transcribe against a US English model. Hosts that only support
763
- * one locale may ignore it.
764
- */
765
- locale: string;
766
- }
767
-
768
795
  /**
769
796
  * Pure resolution for the chat's *experience* config — the knobs that
770
797
  * decide what the user sees WHILE the agent drives the app, and how a
@@ -985,6 +1012,11 @@ interface AppilotsStrings {
985
1012
  statusWaitingApp: string;
986
1013
  /** Status shown while the assistant adjusts after a recoverable failure. */
987
1014
  statusAdjusting: string;
1015
+ /**
1016
+ * Periodic status on long turns (visible and announced to screen
1017
+ * readers). `{seconds}` is replaced with the elapsed time.
1018
+ */
1019
+ stillWorking: string;
988
1020
  /** Footer line shown when poweredByVisible !== false. */
989
1021
  poweredBy: string;
990
1022
  /** Approve button on a pending action row in the breadcrumb. */
@@ -1007,6 +1039,8 @@ interface AppilotsStrings {
1007
1039
  confirmCancel: string;
1008
1040
  /** Last-resort name for an action with no description of its own. */
1009
1041
  confirmThisAction: string;
1042
+ /** Shown and announced when a pending confirmation can no longer be approved. */
1043
+ confirmExpired: string;
1010
1044
  /** Fallback humanised name for an unknown action type. */
1011
1045
  unknownAction: string;
1012
1046
  /** Generic friendly error when nothing else fits. */
@@ -1047,6 +1081,10 @@ interface AppilotsStrings {
1047
1081
  missionPaused: string;
1048
1082
  /** Pill label after the turn ends, before the user opens the sheet. */
1049
1083
  pillDone: string;
1084
+ /** Announced when the turn stops to wait for the user's approval. */
1085
+ a11yAwaitingApproval: string;
1086
+ /** Announced when a turn in which the agent acted on the app ends. */
1087
+ a11yTurnDone: string;
1050
1088
  /** A11y label for the hold-to-talk mic button at rest. */
1051
1089
  micStartA11y: string;
1052
1090
  /** A11y label while a capture is running. */
@@ -1319,6 +1357,8 @@ interface AgentPillProps {
1319
1357
  state: BreadcrumbState;
1320
1358
  /** Tap anywhere on the pill — raises the full sheet. */
1321
1359
  onExpand: () => void;
1360
+ /** The expand control — where a screen reader's focus returns when the sheet collapses. */
1361
+ expandRef?: React__default.Ref<React__default.ElementRef<typeof TouchableOpacity>>;
1322
1362
  /**
1323
1363
  * Stop button. Omit to hide it — there is nothing to cancel once the
1324
1364
  * turn has ended, and a dead button on a one-line surface is worse
@@ -1344,7 +1384,7 @@ interface AgentPillProps {
1344
1384
  fontFamily?: string;
1345
1385
  strings: AgentPillStrings;
1346
1386
  }
1347
- declare function AgentPill({ label, state, onExpand, onStop, position, insets, colors, fontFamily, strings, }: AgentPillProps): React__default.JSX.Element;
1387
+ declare function AgentPill({ label, state, onExpand, expandRef, onStop, position, insets, colors, fontFamily, strings, }: AgentPillProps): React__default.JSX.Element;
1348
1388
 
1349
1389
  /**
1350
1390
  * Is this control actually on the screen right now?
@@ -1418,6 +1458,10 @@ type GeometryAvailability =
1418
1458
  * `pointerEvents="none"` throughout. The ring marks a control the user
1419
1459
  * can still press themselves — swallowing that press to draw decoration
1420
1460
  * over it would defeat the point of leaving the app touchable.
1461
+ *
1462
+ * Being invisible to touch and to the accessibility tree, the ring says
1463
+ * nothing to a screen reader. The chat speaks the same fact instead,
1464
+ * from the store's announcement channel (`subscribeSpotlightAnnouncement`).
1421
1465
  */
1422
1466
 
1423
1467
  interface SpotlightOverlayProps {
@@ -1473,6 +1517,8 @@ interface SpotlightTarget {
1473
1517
  seq: number;
1474
1518
  }
1475
1519
  type Listener$2 = (target: SpotlightTarget | null) => void;
1520
+ /** What the agent does to the control — picks the verb of the spoken announcement. */
1521
+ type SpotlightVerb = 'press' | 'toggle' | 'focus' | 'fill';
1476
1522
  /**
1477
1523
  * How long a ring stays up after the action it marks.
1478
1524
  *
@@ -1491,7 +1537,7 @@ declare function getSpotlightMode(): SpotlightMode;
1491
1537
  * measurable, so the previous ring does not linger over an unrelated
1492
1538
  * control and imply the agent is aiming at it.
1493
1539
  */
1494
- declare function setSpotlightTarget(rect: Rect | null, label?: string): void;
1540
+ declare function setSpotlightTarget(rect: Rect | null, label?: string, verb?: SpotlightVerb): void;
1495
1541
  declare function getSpotlightTarget(): SpotlightTarget | null;
1496
1542
  /** Subscribe. Returns the unsubscribe. Does NOT fire on subscribe. */
1497
1543
  declare function subscribeSpotlight(listener: Listener$2): () => void;
@@ -1748,6 +1794,8 @@ interface ConfirmCardStrings {
1748
1794
  confirmApprove: string;
1749
1795
  confirmCancel: string;
1750
1796
  confirmThisAction: string;
1797
+ /** Optional so hosts that built this object before it existed keep compiling. */
1798
+ confirmExpired?: string;
1751
1799
  }
1752
1800
 
1753
1801
  interface ActionBreadcrumbProps {
@@ -1781,8 +1829,13 @@ interface ActionBreadcrumbProps {
1781
1829
  /** Required when `requireApprovalFor` returns true for any action. */
1782
1830
  onApprove?: (actionId: string) => void;
1783
1831
  onReject?: (actionId: string) => void;
1832
+ /**
1833
+ * Called when a confirm card leaves the screen (answered, expired or
1834
+ * dropped), so the chat can hand screen-reader focus back to the composer.
1835
+ */
1836
+ onConfirmCardGone?: () => void;
1784
1837
  }
1785
- declare function ActionBreadcrumb({ actions, primaryColor, textColor, fontFamily, palette, confirmStrings, locale, requireApprovalFor, onApprove, onReject, }: ActionBreadcrumbProps): React__default.JSX.Element | null;
1838
+ declare function ActionBreadcrumb({ actions, primaryColor, textColor, fontFamily, palette, confirmStrings, locale, requireApprovalFor, onApprove, onReject, onConfirmCardGone, }: ActionBreadcrumbProps): React__default.JSX.Element | null;
1786
1839
 
1787
1840
  interface ChatIconProps {
1788
1841
  /** Outer width/height in points. Default 24. */
@@ -2655,6 +2708,6 @@ declare function executeAction(action: AgentAction, context: ExecutorContext): P
2655
2708
  * (`X-Appilots-Sdk-Version`). Kept identical to package.json by the
2656
2709
  * release flow; `version.test.ts` fails if the two ever disagree.
2657
2710
  */
2658
- declare const SDK_VERSION = "0.13.0";
2711
+ declare const SDK_VERSION = "0.14.0";
2659
2712
 
2660
- export { ActionBreadcrumb, type ActionBreadcrumbProps, type ActionResult, AgentAction, AgentPermissions, AgentPill, type AgentPillProps, type AgentPillStrings, type AppilotsButtonProps, AppilotsChat, type AppilotsChatMode, type AppilotsChatPosition, type AppilotsChatProps, type AppilotsChatTheme, type AppilotsControl, type AppilotsEntryPoint, AppilotsEvent, type AppilotsExperience, AppilotsI18nProvider, type AppilotsI18nProviderProps, type AppilotsInputMode, type AppilotsInputProps, AppilotsLocale, type AppilotsPresence, type AppilotsRC, AppilotsRegistryProvider, type AppilotsSelfCheckReport, type AppilotsSpotlight, type AppilotsStringKey, type AppilotsStrings, type AppilotsSwitchProps, AppilotsThemeProvider, type AppilotsThemeProviderProps, AppilotsThemeTokens, AppilotsTraceEntry, type AutoTrackingState, type BreadcrumbItem, type BreadcrumbState, type ButtonSnapshot, ChatIcon, type ChatIconProps, type ChoiceGroupSnapshot, type ChoiceOptionSnapshot, ComponentRegistry, ConfirmDialog, type ConfirmDialogProps, DEFAULT_EXPERIENCE, type ElementRegistry, type ExecutorContext, type ExperienceCapabilities, type ExperienceDowngrade, type ExperienceResolution, FieldEntry, HeadsetIcon, type HeadsetIconProps, type InputSnapshot, type InteractionElementEntry, type InteractionElementListContext, type InteractionElementSnapshot, type IntrospectionDiagnostics, type IntrospectionFailureReason, type ListEntry, type ListItemSnapshot, type ListRegistry, type ListSnapshot, type NameManglingProbe, PartialThemeTokens, type PillStatus, type PillStatusStrings, REVEAL_MARGIN, type ResolvedExperience, type RevealInput, type RevealResult, SDK_VERSION, SPOTLIGHT_TTL_MS, type ScreenSnapshot, type ScrollMetrics, type SelfCheckRegistry, type SelfCheckWalk, type SpotlightMode, SpotlightOverlay, type SpotlightOverlayProps, type SpotlightTarget, type SurfaceState, type TailwindResolvedConfig, type ToggleSnapshot, type TurnActivity, type WalkDetectorCounts, _patchJsxRuntimes, appilotsListTotal, appilotsSelfCheck, appilotsTheme, appilotsThemeFromTailwind, captureSnapshot, clearAppilotsDebugTraces, createAppilotsButton, createAppilotsInput, createAppilotsSwitch, createElementRegistry, createListRegistry, describeAction, detectDeviceLocale, elementRegistry, enableAppilotsAutoTracking, executeAction, formatDowngrades, getAppilotsDebugTraces, getAutoTrackingState, getGlobalConfig, getIntrospectionDiagnostics, getSpotlightMode, getSpotlightTarget, humanizeError, initAppilots, isAutoTrackingEnabled, listRegistry, offsetToReveal, recordAppilotsDebugTrace, resolveExperience, resolveLocale, resolvePillStatus, resolveSurface, revealTarget, setSpotlightMode, setSpotlightTarget, shouldReopenOnTurnEnd, subscribeAppilotsDebugTraces, subscribeSpotlight, useAppilotsI18n, useAppilotsTheme, useResolvedRegistry, useSpotlight, usesPill };
2713
+ export { ActionBreadcrumb, type ActionBreadcrumbProps, type ActionResult, AgentAction, AgentPermissions, AgentPill, type AgentPillProps, type AgentPillStrings, type AppilotsButtonProps, AppilotsChat, type AppilotsChatMode, type AppilotsChatPosition, type AppilotsChatProps, type AppilotsChatTheme, type AppilotsControl, type AppilotsEntryPoint, AppilotsEvent, type AppilotsExperience, AppilotsI18nProvider, type AppilotsI18nProviderProps, type AppilotsInputMode, type AppilotsInputProps, AppilotsLocale, type AppilotsPresence, type AppilotsRC, AppilotsRegistryProvider, type AppilotsSelfCheckReport, type AppilotsSpotlight, type AppilotsStringKey, type AppilotsStrings, type AppilotsSwitchProps, AppilotsThemeProvider, type AppilotsThemeProviderProps, AppilotsThemeTokens, AppilotsTraceEntry, type AutoTrackingState, type BreadcrumbItem, type BreadcrumbState, type ButtonSnapshot, ChatIcon, type ChatIconProps, type ChoiceGroupSnapshot, type ChoiceOptionSnapshot, ComponentRegistry, ConfirmDialog, type ConfirmDialogProps, DEFAULT_EXPERIENCE, type ElementRegistry, type ExecutorContext, type ExperienceCapabilities, type ExperienceDowngrade, type ExperienceResolution, FieldEntry, HeadsetIcon, type HeadsetIconProps, type InputSnapshot, type InteractionElementEntry, type InteractionElementListContext, type InteractionElementSnapshot, type IntrospectionDiagnostics, type IntrospectionFailureReason, type ListEntry, type ListItemSnapshot, type ListRegistry, type ListSnapshot, type NameManglingProbe, PartialThemeTokens, type PillStatus, type PillStatusStrings, REVEAL_MARGIN, type ResolvedExperience, type RevealInput, type RevealResult, SDK_VERSION, SPOTLIGHT_TTL_MS, type ScreenSnapshot, type ScrollMetrics, type SelfCheckRegistry, type SelfCheckWalk, type SpeechHost, type SpeechStartOptions, type SpeechState, type SpotlightMode, SpotlightOverlay, type SpotlightOverlayProps, type SpotlightTarget, type SurfaceState, type TailwindResolvedConfig, type ToggleSnapshot, type TurnActivity, type WalkDetectorCounts, _patchJsxRuntimes, appilotsListTotal, appilotsSelfCheck, appilotsTheme, appilotsThemeFromTailwind, captureSnapshot, clearAppilotsDebugTraces, createAppilotsButton, createAppilotsInput, createAppilotsSwitch, createElementRegistry, createListRegistry, describeAction, detectDeviceLocale, elementRegistry, enableAppilotsAutoTracking, executeAction, formatDowngrades, getAppilotsDebugTraces, getAutoTrackingState, getGlobalConfig, getIntrospectionDiagnostics, getSpotlightMode, getSpotlightTarget, humanizeError, initAppilots, isAutoTrackingEnabled, isSpeechHost, listRegistry, offsetToReveal, recordAppilotsDebugTrace, resolveExperience, resolveLocale, resolvePillStatus, resolveSurface, revealTarget, setSpotlightMode, setSpotlightTarget, shouldReopenOnTurnEnd, subscribeAppilotsDebugTraces, subscribeSpotlight, useAppilotsI18n, useAppilotsTheme, useResolvedRegistry, useSpotlight, usesPill };