@appilots/sdk 0.2.0 → 0.3.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/{chunk-GEM6TPAK.mjs → chunk-BKFO4DHW.mjs} +32 -198
- package/dist/{chunk-KCDNL4HV.mjs → chunk-DUSYQXAQ.mjs} +1 -1
- package/dist/{chunk-SIBKF7AA.js → chunk-MCY5YFYD.js} +619 -65
- package/dist/{chunk-KGN3DNGX.js → chunk-N2I3CA7Q.js} +5 -5
- package/dist/{chunk-HDLZGXNF.mjs → chunk-QMSMXTED.mjs} +602 -66
- package/dist/{chunk-IASJ7YHC.js → chunk-XNKPS7W3.js} +173 -339
- package/dist/hooks/index.d.mts +2 -1
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/index.js +11 -11
- package/dist/hooks/index.mjs +2 -2
- package/dist/index-BYVRBzjJ.d.mts +619 -0
- package/dist/index-BYVRBzjJ.d.ts +619 -0
- package/dist/index.d.mts +109 -64
- package/dist/index.d.ts +109 -64
- package/dist/index.js +84 -462
- package/dist/index.mjs +10 -403
- package/dist/navigation/index.js +13 -13
- package/dist/navigation/index.mjs +2 -2
- package/package.json +16 -15
- package/dist/index-BDb1WVNo.d.mts +0 -1300
- package/dist/index-BDb1WVNo.d.ts +0 -1300
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { C as ComponentRegistry, F as FieldEntry } from './index-BYVRBzjJ.mjs';
|
|
2
|
+
export { A as AppilotsConfig, a as AppilotsProvider, b as AppilotsProviderProps, c as ComponentEntry, d as ComponentKind, S as SliderEntry, e as SuggestedPrompt, T as TargetEntry, f as ToggleEntry, U as UseAppilotsFieldOptions, g as UseAppilotsSliderOptions, h as UseAppilotsTargetOptions, i as UseAppilotsToggleOptions, j as UseSuggestedPromptsOptions, k as UseSuggestedPromptsReturn, l as componentRegistry, m as createComponentRegistry, u as useAppilots, n as useAppilotsActions, o as useAppilotsChat, p as useAppilotsContext, q as useAppilotsField, r as useAppilotsNavigation, s as useAppilotsSlider, t as useAppilotsTarget, v as useAppilotsToggle, w as useSuggestedPrompts } from './index-BYVRBzjJ.mjs';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import React__default from 'react';
|
|
5
|
+
import { PartialThemeTokens, AppilotsThemeTokens, AppilotsLocale, AgentAction, AgentPermissions, AppilotsEvent } from '@appilots/client-core';
|
|
6
|
+
export { AgentAction, AgentActionType, AgentMessage, AgentPermissions, AppilotsClient, AppilotsClientOptions, AppilotsEvent, AppilotsEventHandler, AppilotsEventType, AppilotsLocale, AppilotsThemeTokens, AppilotsTraceEntry, AppilotsUser, BreadcrumbItem, BreadcrumbState, ChatMessage, EscalationState, FormFillPayload, MessageRole, NavigationPayload, PartialThemeTokens, RemotePersonalization, SDK_VERSION, UIInteractionPayload, clearAppilotsDebugTraces, defaultDarkTheme, defaultLightTheme, describeAction, getAppilotsDebugTraces, humanizeError, mergeThemeTokens, recordAppilotsDebugTrace, subscribeAppilotsDebugTraces } from '@appilots/client-core';
|
|
5
7
|
export { A as AppilotsNavigationContainer, N as NavigationConfig, b as ScreenMetadata, r as registerScreen } from './registerScreen-D1oGm28T.mjs';
|
|
6
8
|
|
|
7
9
|
interface AppilotsThemeProviderProps {
|
|
@@ -78,6 +80,110 @@ declare const appilotsTheme: {
|
|
|
78
80
|
fromTailwind: typeof appilotsThemeFromTailwind;
|
|
79
81
|
};
|
|
80
82
|
|
|
83
|
+
/**
|
|
84
|
+
* i18n keys — the canonical list of every translatable string in the
|
|
85
|
+
* SDK chat UI. Adding UI copy means adding a key here AND a value in
|
|
86
|
+
* every bundle under `./bundles/` (TypeScript will fail the bundle if a
|
|
87
|
+
* key is missing). BACKLOG 4.1.
|
|
88
|
+
*/
|
|
89
|
+
interface AppilotsStrings {
|
|
90
|
+
/** Default chat header title when the dev hasn't supplied one. */
|
|
91
|
+
chatTitle: string;
|
|
92
|
+
/** Header button that wipes the conversation. */
|
|
93
|
+
clearButton: string;
|
|
94
|
+
/** Placeholder for the message input. */
|
|
95
|
+
inputPlaceholder: string;
|
|
96
|
+
/** Empty state heading. */
|
|
97
|
+
emptyTitle: string;
|
|
98
|
+
/** Empty state subtitle / one-liner under the heading. */
|
|
99
|
+
emptySubtitle: string;
|
|
100
|
+
/** "Thinking..." placeholder shown while the assistant is replying. */
|
|
101
|
+
thinking: string;
|
|
102
|
+
/** Status shown while the assistant is planning from the current screen. */
|
|
103
|
+
statusAnalyzing: string;
|
|
104
|
+
/** Status shown while the SDK waits for the app to settle after an action. */
|
|
105
|
+
statusWaitingApp: string;
|
|
106
|
+
/** Status shown while the assistant adjusts after a recoverable failure. */
|
|
107
|
+
statusAdjusting: string;
|
|
108
|
+
/** Footer line shown when poweredByVisible !== false. */
|
|
109
|
+
poweredBy: string;
|
|
110
|
+
/** Approve button on a pending action row in the breadcrumb. */
|
|
111
|
+
approve: string;
|
|
112
|
+
/** Reject button on a pending action row in the breadcrumb. */
|
|
113
|
+
reject: string;
|
|
114
|
+
/** Generic "cancelled by the user" message after a reject. */
|
|
115
|
+
cancelledByUser: string;
|
|
116
|
+
/** Fallback humanised name for an unknown action type. */
|
|
117
|
+
unknownAction: string;
|
|
118
|
+
/** Generic friendly error when nothing else fits. */
|
|
119
|
+
somethingWentWrong: string;
|
|
120
|
+
/** Open chat accessibility label for the floating bubble. */
|
|
121
|
+
openChatA11y: string;
|
|
122
|
+
/** Close chat accessibility label. */
|
|
123
|
+
closeChatA11y: string;
|
|
124
|
+
/** A11y label for the stop-generation button (OKR-008 KR4). */
|
|
125
|
+
stopGeneratingA11y: string;
|
|
126
|
+
/** A11y label for the "talk to a human" header button. */
|
|
127
|
+
talkToHumanA11y: string;
|
|
128
|
+
/** Sender label above a human operator's bubble. */
|
|
129
|
+
humanAgentLabel: string;
|
|
130
|
+
/** System line right after the user (or the offer chip) escalates. */
|
|
131
|
+
escalationRequested: string;
|
|
132
|
+
/** System line when an operator claims the conversation. */
|
|
133
|
+
escalationConnected: string;
|
|
134
|
+
/** System line when the operator resolves — AI takes over again. */
|
|
135
|
+
escalationResolved: string;
|
|
136
|
+
/** System line offering the handoff after the agent gives up. */
|
|
137
|
+
escalationOffer: string;
|
|
138
|
+
/** Label of the tappable chip under the offer line. */
|
|
139
|
+
escalationOfferChip: string;
|
|
140
|
+
/** Thin banner under the header while waiting in the queue. */
|
|
141
|
+
escalationPendingBanner: string;
|
|
142
|
+
/** Thin banner under the header while connected to an operator. */
|
|
143
|
+
escalationActiveBanner: string;
|
|
144
|
+
}
|
|
145
|
+
type AppilotsStringKey = keyof AppilotsStrings;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Best-effort device-locale detection. Returns the closest supported
|
|
149
|
+
* locale or `null` if we can't tell. Designed to never throw — RN's
|
|
150
|
+
* native modules are platform-specific and can be missing in test
|
|
151
|
+
* harnesses.
|
|
152
|
+
*/
|
|
153
|
+
declare function detectDeviceLocale(): AppilotsLocale | null;
|
|
154
|
+
/**
|
|
155
|
+
* Resolve the locale to use given the prop and the device default.
|
|
156
|
+
* Order: explicit prop → device-detected → DEFAULT_LOCALE.
|
|
157
|
+
*/
|
|
158
|
+
declare function resolveLocale(prop?: AppilotsLocale | null): AppilotsLocale;
|
|
159
|
+
interface I18nContextValue {
|
|
160
|
+
locale: AppilotsLocale;
|
|
161
|
+
strings: AppilotsStrings;
|
|
162
|
+
/**
|
|
163
|
+
* Helper to read a single key. Components can also destructure
|
|
164
|
+
* `strings` directly if they need many in one render.
|
|
165
|
+
*/
|
|
166
|
+
t: (key: AppilotsStringKey) => string;
|
|
167
|
+
}
|
|
168
|
+
interface AppilotsI18nProviderProps {
|
|
169
|
+
/** Force a locale. Falls through to device detection when omitted. */
|
|
170
|
+
locale?: AppilotsLocale | null;
|
|
171
|
+
/**
|
|
172
|
+
* Per-key overrides to merge on top of the bundle. Useful when the
|
|
173
|
+
* dev wants to rename only "Powered by Appilots" while keeping the
|
|
174
|
+
* rest in the default language.
|
|
175
|
+
*/
|
|
176
|
+
overrides?: Partial<AppilotsStrings> | null;
|
|
177
|
+
children: React__default.ReactNode;
|
|
178
|
+
}
|
|
179
|
+
declare function AppilotsI18nProvider({ locale, overrides, children, }: AppilotsI18nProviderProps): React__default.JSX.Element;
|
|
180
|
+
/**
|
|
181
|
+
* Read the locale + strings from context. Falls back to the default
|
|
182
|
+
* locale bundle if no provider is mounted, so components don't need a
|
|
183
|
+
* provider to be safe — they just lose the dev's overrides.
|
|
184
|
+
*/
|
|
185
|
+
declare function useAppilotsI18n(): I18nContextValue;
|
|
186
|
+
|
|
81
187
|
/**
|
|
82
188
|
* Layout modes for the chat (BACKLOG 4.1).
|
|
83
189
|
* - `bubble` — floating action button + bottom sheet modal (default)
|
|
@@ -218,52 +324,6 @@ interface ConfirmDialogProps {
|
|
|
218
324
|
/** @deprecated No-op. See file header. */
|
|
219
325
|
declare function ConfirmDialog(_props?: ConfirmDialogProps): React__default.ReactElement | null;
|
|
220
326
|
|
|
221
|
-
/**
|
|
222
|
-
* Human-readable labels and error messages for the action breadcrumb.
|
|
223
|
-
*
|
|
224
|
-
* Strings are PT-BR hardcoded for now. i18n is planned for backlog item
|
|
225
|
-
* 4.1 (Personalização) — when that lands, these strings move into the
|
|
226
|
-
* locale bundles.
|
|
227
|
-
*
|
|
228
|
-
* Two responsibilities:
|
|
229
|
-
* 1. `describeAction(action)` — turns a typed AgentAction into a label
|
|
230
|
-
* that varies by lifecycle state (pending/running/done/failed).
|
|
231
|
-
* 2. `humanizeError(raw, action)` — sanitises the raw error string from
|
|
232
|
-
* the executor into a short user-facing reason. Stack traces and
|
|
233
|
-
* protocol errors are collapsed into "algo deu errado" so users
|
|
234
|
-
* aren't shown technical noise.
|
|
235
|
-
*/
|
|
236
|
-
|
|
237
|
-
type BreadcrumbState = 'pending' | 'running' | 'success' | 'failed';
|
|
238
|
-
interface BreadcrumbItem {
|
|
239
|
-
/** What to render on the line. */
|
|
240
|
-
label: string;
|
|
241
|
-
/** Lifecycle state — drives icon + colour in the breadcrumb. */
|
|
242
|
-
state: BreadcrumbState;
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* Map an AgentAction + its current status to a breadcrumb item ready to
|
|
246
|
-
* render. The function is intentionally defensive — both the native-tools
|
|
247
|
-
* and JSON-fallback code paths feed actions through here, and the JSON
|
|
248
|
-
* path is loose with payload shapes, so every field access has to assume
|
|
249
|
-
* `unknown`.
|
|
250
|
-
*/
|
|
251
|
-
declare function describeAction(action: AgentAction): BreadcrumbItem;
|
|
252
|
-
/**
|
|
253
|
-
* Convert the executor's raw error string into a short, user-facing
|
|
254
|
-
* reason that fits inside parentheses on the breadcrumb line. Returns
|
|
255
|
-
* `undefined` when there's no useful information to show — caller can
|
|
256
|
-
* then drop the parenthetical entirely.
|
|
257
|
-
*
|
|
258
|
-
* Heuristics:
|
|
259
|
-
* - Apply known-pattern rewrites (rejected, not found, network, etc.)
|
|
260
|
-
* - If the result looks technical (stack frame, HTTP status, JSON
|
|
261
|
-
* dump) or is suspiciously long, fall back to "algo deu errado".
|
|
262
|
-
* - Trim and lowercase the first letter so it reads naturally inside
|
|
263
|
-
* the parens after the action verb.
|
|
264
|
-
*/
|
|
265
|
-
declare function humanizeError(raw: string | undefined, _action?: AgentAction): string | undefined;
|
|
266
|
-
|
|
267
327
|
/**
|
|
268
328
|
* Pure presentation logic for ActionBreadcrumb, extracted from the RN
|
|
269
329
|
* component (same pattern as `humanizeAction.ts` / `chatTimeline.ts`)
|
|
@@ -900,14 +960,6 @@ declare function _patchJsxRuntimes(jsxRuntime: any, jsxDevRuntime: any): void;
|
|
|
900
960
|
*/
|
|
901
961
|
declare function isAutoTrackingEnabled(): boolean;
|
|
902
962
|
|
|
903
|
-
type TraceListener = (entries: AppilotsTraceEntry[]) => void;
|
|
904
|
-
declare function recordAppilotsDebugTrace(entry: Omit<AppilotsTraceEntry, 'id'> & {
|
|
905
|
-
id?: string;
|
|
906
|
-
}): void;
|
|
907
|
-
declare function getAppilotsDebugTraces(): AppilotsTraceEntry[];
|
|
908
|
-
declare function clearAppilotsDebugTraces(): void;
|
|
909
|
-
declare function subscribeAppilotsDebugTraces(listener: TraceListener): () => void;
|
|
910
|
-
|
|
911
963
|
/**
|
|
912
964
|
* captureSnapshot — the public entry point for runtime UI introspection.
|
|
913
965
|
*
|
|
@@ -1146,11 +1198,4 @@ interface ExecutorContext {
|
|
|
1146
1198
|
}
|
|
1147
1199
|
declare function executeAction(action: AgentAction, context: ExecutorContext): Promise<ActionResult>;
|
|
1148
1200
|
|
|
1149
|
-
|
|
1150
|
-
* SDK version — bumped by changesets on release. Lives in its own module
|
|
1151
|
-
* so runtime code (AppilotsClient) can import it without pulling the whole
|
|
1152
|
-
* public barrel in and creating an import cycle.
|
|
1153
|
-
*/
|
|
1154
|
-
declare const SDK_VERSION = "0.1.0";
|
|
1155
|
-
|
|
1156
|
-
export { ActionBreadcrumb, type ActionBreadcrumbProps, type ActionResult, AgentAction, AgentPermissions, type AppilotsButtonProps, AppilotsChat, type AppilotsChatMode, type AppilotsChatPosition, type AppilotsChatProps, type AppilotsChatTheme, AppilotsEvent, type AppilotsInputProps, AppilotsLocale, type AppilotsRC, AppilotsRegistryProvider, type AppilotsSwitchProps, AppilotsThemeProvider, type AppilotsThemeProviderProps, AppilotsThemeTokens, AppilotsTraceEntry, type BreadcrumbItem, type BreadcrumbState, type ButtonSnapshot, ChatIcon, type ChatIconProps, type ChoiceGroupSnapshot, type ChoiceOptionSnapshot, ComponentRegistry, ConfirmDialog, type ConfirmDialogProps, type ElementRegistry, type ExecutorContext, FieldEntry, HeadsetIcon, type HeadsetIconProps, type InputSnapshot, type InteractionElementEntry, type InteractionElementListContext, type InteractionElementSnapshot, type ListEntry, type ListItemSnapshot, type ListRegistry, type ListSnapshot, PartialThemeTokens, SDK_VERSION, type ScreenSnapshot, type TailwindResolvedConfig, type ToggleSnapshot, _patchJsxRuntimes, appilotsTheme, appilotsThemeFromTailwind, captureSnapshot, clearAppilotsDebugTraces, createAppilotsButton, createAppilotsInput, createAppilotsSwitch, createElementRegistry, createListRegistry, describeAction, elementRegistry, enableAppilotsAutoTracking, executeAction, getAppilotsDebugTraces, getGlobalConfig, humanizeError, initAppilots, isAutoTrackingEnabled, listRegistry, recordAppilotsDebugTrace, subscribeAppilotsDebugTraces, useAppilotsTheme, useResolvedRegistry };
|
|
1201
|
+
export { ActionBreadcrumb, type ActionBreadcrumbProps, type ActionResult, type AppilotsButtonProps, AppilotsChat, type AppilotsChatMode, type AppilotsChatPosition, type AppilotsChatProps, type AppilotsChatTheme, AppilotsI18nProvider, type AppilotsI18nProviderProps, type AppilotsInputProps, type AppilotsRC, AppilotsRegistryProvider, type AppilotsStringKey, type AppilotsStrings, type AppilotsSwitchProps, AppilotsThemeProvider, type AppilotsThemeProviderProps, type ButtonSnapshot, ChatIcon, type ChatIconProps, type ChoiceGroupSnapshot, type ChoiceOptionSnapshot, ComponentRegistry, ConfirmDialog, type ConfirmDialogProps, type ElementRegistry, type ExecutorContext, FieldEntry, HeadsetIcon, type HeadsetIconProps, type InputSnapshot, type InteractionElementEntry, type InteractionElementListContext, type InteractionElementSnapshot, type ListEntry, type ListItemSnapshot, type ListRegistry, type ListSnapshot, type ScreenSnapshot, type TailwindResolvedConfig, type ToggleSnapshot, _patchJsxRuntimes, appilotsTheme, appilotsThemeFromTailwind, captureSnapshot, createAppilotsButton, createAppilotsInput, createAppilotsSwitch, createElementRegistry, createListRegistry, detectDeviceLocale, elementRegistry, enableAppilotsAutoTracking, executeAction, getGlobalConfig, initAppilots, isAutoTrackingEnabled, listRegistry, resolveLocale, useAppilotsI18n, useAppilotsTheme, useResolvedRegistry };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { C as ComponentRegistry, F as FieldEntry } from './index-BYVRBzjJ.js';
|
|
2
|
+
export { A as AppilotsConfig, a as AppilotsProvider, b as AppilotsProviderProps, c as ComponentEntry, d as ComponentKind, S as SliderEntry, e as SuggestedPrompt, T as TargetEntry, f as ToggleEntry, U as UseAppilotsFieldOptions, g as UseAppilotsSliderOptions, h as UseAppilotsTargetOptions, i as UseAppilotsToggleOptions, j as UseSuggestedPromptsOptions, k as UseSuggestedPromptsReturn, l as componentRegistry, m as createComponentRegistry, u as useAppilots, n as useAppilotsActions, o as useAppilotsChat, p as useAppilotsContext, q as useAppilotsField, r as useAppilotsNavigation, s as useAppilotsSlider, t as useAppilotsTarget, v as useAppilotsToggle, w as useSuggestedPrompts } from './index-BYVRBzjJ.js';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import React__default from 'react';
|
|
5
|
+
import { PartialThemeTokens, AppilotsThemeTokens, AppilotsLocale, AgentAction, AgentPermissions, AppilotsEvent } from '@appilots/client-core';
|
|
6
|
+
export { AgentAction, AgentActionType, AgentMessage, AgentPermissions, AppilotsClient, AppilotsClientOptions, AppilotsEvent, AppilotsEventHandler, AppilotsEventType, AppilotsLocale, AppilotsThemeTokens, AppilotsTraceEntry, AppilotsUser, BreadcrumbItem, BreadcrumbState, ChatMessage, EscalationState, FormFillPayload, MessageRole, NavigationPayload, PartialThemeTokens, RemotePersonalization, SDK_VERSION, UIInteractionPayload, clearAppilotsDebugTraces, defaultDarkTheme, defaultLightTheme, describeAction, getAppilotsDebugTraces, humanizeError, mergeThemeTokens, recordAppilotsDebugTrace, subscribeAppilotsDebugTraces } from '@appilots/client-core';
|
|
5
7
|
export { A as AppilotsNavigationContainer, N as NavigationConfig, b as ScreenMetadata, r as registerScreen } from './registerScreen-D1oGm28T.js';
|
|
6
8
|
|
|
7
9
|
interface AppilotsThemeProviderProps {
|
|
@@ -78,6 +80,110 @@ declare const appilotsTheme: {
|
|
|
78
80
|
fromTailwind: typeof appilotsThemeFromTailwind;
|
|
79
81
|
};
|
|
80
82
|
|
|
83
|
+
/**
|
|
84
|
+
* i18n keys — the canonical list of every translatable string in the
|
|
85
|
+
* SDK chat UI. Adding UI copy means adding a key here AND a value in
|
|
86
|
+
* every bundle under `./bundles/` (TypeScript will fail the bundle if a
|
|
87
|
+
* key is missing). BACKLOG 4.1.
|
|
88
|
+
*/
|
|
89
|
+
interface AppilotsStrings {
|
|
90
|
+
/** Default chat header title when the dev hasn't supplied one. */
|
|
91
|
+
chatTitle: string;
|
|
92
|
+
/** Header button that wipes the conversation. */
|
|
93
|
+
clearButton: string;
|
|
94
|
+
/** Placeholder for the message input. */
|
|
95
|
+
inputPlaceholder: string;
|
|
96
|
+
/** Empty state heading. */
|
|
97
|
+
emptyTitle: string;
|
|
98
|
+
/** Empty state subtitle / one-liner under the heading. */
|
|
99
|
+
emptySubtitle: string;
|
|
100
|
+
/** "Thinking..." placeholder shown while the assistant is replying. */
|
|
101
|
+
thinking: string;
|
|
102
|
+
/** Status shown while the assistant is planning from the current screen. */
|
|
103
|
+
statusAnalyzing: string;
|
|
104
|
+
/** Status shown while the SDK waits for the app to settle after an action. */
|
|
105
|
+
statusWaitingApp: string;
|
|
106
|
+
/** Status shown while the assistant adjusts after a recoverable failure. */
|
|
107
|
+
statusAdjusting: string;
|
|
108
|
+
/** Footer line shown when poweredByVisible !== false. */
|
|
109
|
+
poweredBy: string;
|
|
110
|
+
/** Approve button on a pending action row in the breadcrumb. */
|
|
111
|
+
approve: string;
|
|
112
|
+
/** Reject button on a pending action row in the breadcrumb. */
|
|
113
|
+
reject: string;
|
|
114
|
+
/** Generic "cancelled by the user" message after a reject. */
|
|
115
|
+
cancelledByUser: string;
|
|
116
|
+
/** Fallback humanised name for an unknown action type. */
|
|
117
|
+
unknownAction: string;
|
|
118
|
+
/** Generic friendly error when nothing else fits. */
|
|
119
|
+
somethingWentWrong: string;
|
|
120
|
+
/** Open chat accessibility label for the floating bubble. */
|
|
121
|
+
openChatA11y: string;
|
|
122
|
+
/** Close chat accessibility label. */
|
|
123
|
+
closeChatA11y: string;
|
|
124
|
+
/** A11y label for the stop-generation button (OKR-008 KR4). */
|
|
125
|
+
stopGeneratingA11y: string;
|
|
126
|
+
/** A11y label for the "talk to a human" header button. */
|
|
127
|
+
talkToHumanA11y: string;
|
|
128
|
+
/** Sender label above a human operator's bubble. */
|
|
129
|
+
humanAgentLabel: string;
|
|
130
|
+
/** System line right after the user (or the offer chip) escalates. */
|
|
131
|
+
escalationRequested: string;
|
|
132
|
+
/** System line when an operator claims the conversation. */
|
|
133
|
+
escalationConnected: string;
|
|
134
|
+
/** System line when the operator resolves — AI takes over again. */
|
|
135
|
+
escalationResolved: string;
|
|
136
|
+
/** System line offering the handoff after the agent gives up. */
|
|
137
|
+
escalationOffer: string;
|
|
138
|
+
/** Label of the tappable chip under the offer line. */
|
|
139
|
+
escalationOfferChip: string;
|
|
140
|
+
/** Thin banner under the header while waiting in the queue. */
|
|
141
|
+
escalationPendingBanner: string;
|
|
142
|
+
/** Thin banner under the header while connected to an operator. */
|
|
143
|
+
escalationActiveBanner: string;
|
|
144
|
+
}
|
|
145
|
+
type AppilotsStringKey = keyof AppilotsStrings;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Best-effort device-locale detection. Returns the closest supported
|
|
149
|
+
* locale or `null` if we can't tell. Designed to never throw — RN's
|
|
150
|
+
* native modules are platform-specific and can be missing in test
|
|
151
|
+
* harnesses.
|
|
152
|
+
*/
|
|
153
|
+
declare function detectDeviceLocale(): AppilotsLocale | null;
|
|
154
|
+
/**
|
|
155
|
+
* Resolve the locale to use given the prop and the device default.
|
|
156
|
+
* Order: explicit prop → device-detected → DEFAULT_LOCALE.
|
|
157
|
+
*/
|
|
158
|
+
declare function resolveLocale(prop?: AppilotsLocale | null): AppilotsLocale;
|
|
159
|
+
interface I18nContextValue {
|
|
160
|
+
locale: AppilotsLocale;
|
|
161
|
+
strings: AppilotsStrings;
|
|
162
|
+
/**
|
|
163
|
+
* Helper to read a single key. Components can also destructure
|
|
164
|
+
* `strings` directly if they need many in one render.
|
|
165
|
+
*/
|
|
166
|
+
t: (key: AppilotsStringKey) => string;
|
|
167
|
+
}
|
|
168
|
+
interface AppilotsI18nProviderProps {
|
|
169
|
+
/** Force a locale. Falls through to device detection when omitted. */
|
|
170
|
+
locale?: AppilotsLocale | null;
|
|
171
|
+
/**
|
|
172
|
+
* Per-key overrides to merge on top of the bundle. Useful when the
|
|
173
|
+
* dev wants to rename only "Powered by Appilots" while keeping the
|
|
174
|
+
* rest in the default language.
|
|
175
|
+
*/
|
|
176
|
+
overrides?: Partial<AppilotsStrings> | null;
|
|
177
|
+
children: React__default.ReactNode;
|
|
178
|
+
}
|
|
179
|
+
declare function AppilotsI18nProvider({ locale, overrides, children, }: AppilotsI18nProviderProps): React__default.JSX.Element;
|
|
180
|
+
/**
|
|
181
|
+
* Read the locale + strings from context. Falls back to the default
|
|
182
|
+
* locale bundle if no provider is mounted, so components don't need a
|
|
183
|
+
* provider to be safe — they just lose the dev's overrides.
|
|
184
|
+
*/
|
|
185
|
+
declare function useAppilotsI18n(): I18nContextValue;
|
|
186
|
+
|
|
81
187
|
/**
|
|
82
188
|
* Layout modes for the chat (BACKLOG 4.1).
|
|
83
189
|
* - `bubble` — floating action button + bottom sheet modal (default)
|
|
@@ -218,52 +324,6 @@ interface ConfirmDialogProps {
|
|
|
218
324
|
/** @deprecated No-op. See file header. */
|
|
219
325
|
declare function ConfirmDialog(_props?: ConfirmDialogProps): React__default.ReactElement | null;
|
|
220
326
|
|
|
221
|
-
/**
|
|
222
|
-
* Human-readable labels and error messages for the action breadcrumb.
|
|
223
|
-
*
|
|
224
|
-
* Strings are PT-BR hardcoded for now. i18n is planned for backlog item
|
|
225
|
-
* 4.1 (Personalização) — when that lands, these strings move into the
|
|
226
|
-
* locale bundles.
|
|
227
|
-
*
|
|
228
|
-
* Two responsibilities:
|
|
229
|
-
* 1. `describeAction(action)` — turns a typed AgentAction into a label
|
|
230
|
-
* that varies by lifecycle state (pending/running/done/failed).
|
|
231
|
-
* 2. `humanizeError(raw, action)` — sanitises the raw error string from
|
|
232
|
-
* the executor into a short user-facing reason. Stack traces and
|
|
233
|
-
* protocol errors are collapsed into "algo deu errado" so users
|
|
234
|
-
* aren't shown technical noise.
|
|
235
|
-
*/
|
|
236
|
-
|
|
237
|
-
type BreadcrumbState = 'pending' | 'running' | 'success' | 'failed';
|
|
238
|
-
interface BreadcrumbItem {
|
|
239
|
-
/** What to render on the line. */
|
|
240
|
-
label: string;
|
|
241
|
-
/** Lifecycle state — drives icon + colour in the breadcrumb. */
|
|
242
|
-
state: BreadcrumbState;
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* Map an AgentAction + its current status to a breadcrumb item ready to
|
|
246
|
-
* render. The function is intentionally defensive — both the native-tools
|
|
247
|
-
* and JSON-fallback code paths feed actions through here, and the JSON
|
|
248
|
-
* path is loose with payload shapes, so every field access has to assume
|
|
249
|
-
* `unknown`.
|
|
250
|
-
*/
|
|
251
|
-
declare function describeAction(action: AgentAction): BreadcrumbItem;
|
|
252
|
-
/**
|
|
253
|
-
* Convert the executor's raw error string into a short, user-facing
|
|
254
|
-
* reason that fits inside parentheses on the breadcrumb line. Returns
|
|
255
|
-
* `undefined` when there's no useful information to show — caller can
|
|
256
|
-
* then drop the parenthetical entirely.
|
|
257
|
-
*
|
|
258
|
-
* Heuristics:
|
|
259
|
-
* - Apply known-pattern rewrites (rejected, not found, network, etc.)
|
|
260
|
-
* - If the result looks technical (stack frame, HTTP status, JSON
|
|
261
|
-
* dump) or is suspiciously long, fall back to "algo deu errado".
|
|
262
|
-
* - Trim and lowercase the first letter so it reads naturally inside
|
|
263
|
-
* the parens after the action verb.
|
|
264
|
-
*/
|
|
265
|
-
declare function humanizeError(raw: string | undefined, _action?: AgentAction): string | undefined;
|
|
266
|
-
|
|
267
327
|
/**
|
|
268
328
|
* Pure presentation logic for ActionBreadcrumb, extracted from the RN
|
|
269
329
|
* component (same pattern as `humanizeAction.ts` / `chatTimeline.ts`)
|
|
@@ -900,14 +960,6 @@ declare function _patchJsxRuntimes(jsxRuntime: any, jsxDevRuntime: any): void;
|
|
|
900
960
|
*/
|
|
901
961
|
declare function isAutoTrackingEnabled(): boolean;
|
|
902
962
|
|
|
903
|
-
type TraceListener = (entries: AppilotsTraceEntry[]) => void;
|
|
904
|
-
declare function recordAppilotsDebugTrace(entry: Omit<AppilotsTraceEntry, 'id'> & {
|
|
905
|
-
id?: string;
|
|
906
|
-
}): void;
|
|
907
|
-
declare function getAppilotsDebugTraces(): AppilotsTraceEntry[];
|
|
908
|
-
declare function clearAppilotsDebugTraces(): void;
|
|
909
|
-
declare function subscribeAppilotsDebugTraces(listener: TraceListener): () => void;
|
|
910
|
-
|
|
911
963
|
/**
|
|
912
964
|
* captureSnapshot — the public entry point for runtime UI introspection.
|
|
913
965
|
*
|
|
@@ -1146,11 +1198,4 @@ interface ExecutorContext {
|
|
|
1146
1198
|
}
|
|
1147
1199
|
declare function executeAction(action: AgentAction, context: ExecutorContext): Promise<ActionResult>;
|
|
1148
1200
|
|
|
1149
|
-
|
|
1150
|
-
* SDK version — bumped by changesets on release. Lives in its own module
|
|
1151
|
-
* so runtime code (AppilotsClient) can import it without pulling the whole
|
|
1152
|
-
* public barrel in and creating an import cycle.
|
|
1153
|
-
*/
|
|
1154
|
-
declare const SDK_VERSION = "0.1.0";
|
|
1155
|
-
|
|
1156
|
-
export { ActionBreadcrumb, type ActionBreadcrumbProps, type ActionResult, AgentAction, AgentPermissions, type AppilotsButtonProps, AppilotsChat, type AppilotsChatMode, type AppilotsChatPosition, type AppilotsChatProps, type AppilotsChatTheme, AppilotsEvent, type AppilotsInputProps, AppilotsLocale, type AppilotsRC, AppilotsRegistryProvider, type AppilotsSwitchProps, AppilotsThemeProvider, type AppilotsThemeProviderProps, AppilotsThemeTokens, AppilotsTraceEntry, type BreadcrumbItem, type BreadcrumbState, type ButtonSnapshot, ChatIcon, type ChatIconProps, type ChoiceGroupSnapshot, type ChoiceOptionSnapshot, ComponentRegistry, ConfirmDialog, type ConfirmDialogProps, type ElementRegistry, type ExecutorContext, FieldEntry, HeadsetIcon, type HeadsetIconProps, type InputSnapshot, type InteractionElementEntry, type InteractionElementListContext, type InteractionElementSnapshot, type ListEntry, type ListItemSnapshot, type ListRegistry, type ListSnapshot, PartialThemeTokens, SDK_VERSION, type ScreenSnapshot, type TailwindResolvedConfig, type ToggleSnapshot, _patchJsxRuntimes, appilotsTheme, appilotsThemeFromTailwind, captureSnapshot, clearAppilotsDebugTraces, createAppilotsButton, createAppilotsInput, createAppilotsSwitch, createElementRegistry, createListRegistry, describeAction, elementRegistry, enableAppilotsAutoTracking, executeAction, getAppilotsDebugTraces, getGlobalConfig, humanizeError, initAppilots, isAutoTrackingEnabled, listRegistry, recordAppilotsDebugTrace, subscribeAppilotsDebugTraces, useAppilotsTheme, useResolvedRegistry };
|
|
1201
|
+
export { ActionBreadcrumb, type ActionBreadcrumbProps, type ActionResult, type AppilotsButtonProps, AppilotsChat, type AppilotsChatMode, type AppilotsChatPosition, type AppilotsChatProps, type AppilotsChatTheme, AppilotsI18nProvider, type AppilotsI18nProviderProps, type AppilotsInputProps, type AppilotsRC, AppilotsRegistryProvider, type AppilotsStringKey, type AppilotsStrings, type AppilotsSwitchProps, AppilotsThemeProvider, type AppilotsThemeProviderProps, type ButtonSnapshot, ChatIcon, type ChatIconProps, type ChoiceGroupSnapshot, type ChoiceOptionSnapshot, ComponentRegistry, ConfirmDialog, type ConfirmDialogProps, type ElementRegistry, type ExecutorContext, FieldEntry, HeadsetIcon, type HeadsetIconProps, type InputSnapshot, type InteractionElementEntry, type InteractionElementListContext, type InteractionElementSnapshot, type ListEntry, type ListItemSnapshot, type ListRegistry, type ListSnapshot, type ScreenSnapshot, type TailwindResolvedConfig, type ToggleSnapshot, _patchJsxRuntimes, appilotsTheme, appilotsThemeFromTailwind, captureSnapshot, createAppilotsButton, createAppilotsInput, createAppilotsSwitch, createElementRegistry, createListRegistry, detectDeviceLocale, elementRegistry, enableAppilotsAutoTracking, executeAction, getGlobalConfig, initAppilots, isAutoTrackingEnabled, listRegistry, resolveLocale, useAppilotsI18n, useAppilotsTheme, useResolvedRegistry };
|