@appilots/sdk 0.11.1 → 0.11.3

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.
@@ -83,6 +83,33 @@ interface ScreenActionMetadata {
83
83
  * between sdk and mcp-generator packages.
84
84
  */
85
85
  appilotsInferred?: AppilotsInferredAction;
86
+ /**
87
+ * How long this action's work takes, in milliseconds, as DECLARED by
88
+ * the app. The SDK waits this long for the UI to settle after pressing
89
+ * it, instead of the agnostic default.
90
+ *
91
+ * There is no constant that fits: an app operation runs from ~100ms to
92
+ * minutes, and when the wait is too short the agent photographs a
93
+ * loading screen with no controls on it and plans against nothing. The
94
+ * app is the only party that knows, so it says so:
95
+ *
96
+ * ```tsx
97
+ * registerScreen({
98
+ * name: 'Wizard',
99
+ * actions: [{ id: 'gerar', label: 'Gerar', type: 'submit', asyncBudgetMs: 90_000 }],
100
+ * });
101
+ * ```
102
+ *
103
+ * Omitting it is supported and common: the SDK then falls back on its
104
+ * defaults (6s, or 10s when the generator inferred the handler is
105
+ * async) AND on what it can see — while the screen keeps a loading
106
+ * indicator up, the wait runs on to a safety ceiling. So declaring is
107
+ * how an app says "this one is QUICK, do not wait on my spinner", or
108
+ * gives a number for work that shows no indicator at all. The value is
109
+ * clamped to `MAX_DECLARED_ASYNC_BUDGET_MS`: a declaration is a
110
+ * request, not a licence to hang the session.
111
+ */
112
+ asyncBudgetMs?: number;
86
113
  }
87
114
  /**
88
115
  * Inferred metadata about an action's expected async behavior.
@@ -156,12 +183,6 @@ declare function getAllScreens(): ScreenMetadata[];
156
183
  /** Clear the screen registry (useful for testing) */
157
184
  declare function clearScreenRegistry(): void;
158
185
 
159
- /**
160
- * Global navigation state — lightweight singleton so any part of the SDK
161
- * can read the current screen without needing a React context or hook.
162
- *
163
- * Updated by AppilotsNavigationContainer and read by useAppilotsChat().
164
- */
165
186
  /**
166
187
  * Tell the SDK which screen the user is on.
167
188
  *
@@ -199,6 +220,21 @@ interface RuntimeNavigationStateSnapshot {
199
220
  routeNames: string[];
200
221
  /** Whether React Navigation reports that goBack() can currently run. */
201
222
  canGoBack?: boolean;
223
+ /**
224
+ * The stack a back press pops through, oldest first, ending on the
225
+ * current screen. Empty when no navigator is reachable.
226
+ *
227
+ * `canGoBack` says a back exists; this says where it goes.
228
+ */
229
+ backStack?: string[];
230
+ /**
231
+ * Screens the user has been on this session, oldest first, capped and
232
+ * with consecutive repeats collapsed.
233
+ *
234
+ * Different from `backStack`: a popped screen leaves the stack and
235
+ * stays here, and a tab switch never touches the stack at all.
236
+ */
237
+ visited?: string[];
202
238
  }
203
239
  /**
204
240
  * Snapshot the runtime navigation tree in a small, serializable shape.
@@ -83,6 +83,33 @@ interface ScreenActionMetadata {
83
83
  * between sdk and mcp-generator packages.
84
84
  */
85
85
  appilotsInferred?: AppilotsInferredAction;
86
+ /**
87
+ * How long this action's work takes, in milliseconds, as DECLARED by
88
+ * the app. The SDK waits this long for the UI to settle after pressing
89
+ * it, instead of the agnostic default.
90
+ *
91
+ * There is no constant that fits: an app operation runs from ~100ms to
92
+ * minutes, and when the wait is too short the agent photographs a
93
+ * loading screen with no controls on it and plans against nothing. The
94
+ * app is the only party that knows, so it says so:
95
+ *
96
+ * ```tsx
97
+ * registerScreen({
98
+ * name: 'Wizard',
99
+ * actions: [{ id: 'gerar', label: 'Gerar', type: 'submit', asyncBudgetMs: 90_000 }],
100
+ * });
101
+ * ```
102
+ *
103
+ * Omitting it is supported and common: the SDK then falls back on its
104
+ * defaults (6s, or 10s when the generator inferred the handler is
105
+ * async) AND on what it can see — while the screen keeps a loading
106
+ * indicator up, the wait runs on to a safety ceiling. So declaring is
107
+ * how an app says "this one is QUICK, do not wait on my spinner", or
108
+ * gives a number for work that shows no indicator at all. The value is
109
+ * clamped to `MAX_DECLARED_ASYNC_BUDGET_MS`: a declaration is a
110
+ * request, not a licence to hang the session.
111
+ */
112
+ asyncBudgetMs?: number;
86
113
  }
87
114
  /**
88
115
  * Inferred metadata about an action's expected async behavior.
@@ -156,12 +183,6 @@ declare function getAllScreens(): ScreenMetadata[];
156
183
  /** Clear the screen registry (useful for testing) */
157
184
  declare function clearScreenRegistry(): void;
158
185
 
159
- /**
160
- * Global navigation state — lightweight singleton so any part of the SDK
161
- * can read the current screen without needing a React context or hook.
162
- *
163
- * Updated by AppilotsNavigationContainer and read by useAppilotsChat().
164
- */
165
186
  /**
166
187
  * Tell the SDK which screen the user is on.
167
188
  *
@@ -199,6 +220,21 @@ interface RuntimeNavigationStateSnapshot {
199
220
  routeNames: string[];
200
221
  /** Whether React Navigation reports that goBack() can currently run. */
201
222
  canGoBack?: boolean;
223
+ /**
224
+ * The stack a back press pops through, oldest first, ending on the
225
+ * current screen. Empty when no navigator is reachable.
226
+ *
227
+ * `canGoBack` says a back exists; this says where it goes.
228
+ */
229
+ backStack?: string[];
230
+ /**
231
+ * Screens the user has been on this session, oldest first, capped and
232
+ * with consecutive repeats collapsed.
233
+ *
234
+ * Different from `backStack`: a popped screen leaves the stack and
235
+ * stays here, and a tab switch never touches the stack at all.
236
+ */
237
+ visited?: string[];
202
238
  }
203
239
  /**
204
240
  * Snapshot the runtime navigation tree in a small, serializable shape.
@@ -1,51 +1,51 @@
1
1
  'use strict';
2
2
 
3
- var chunkDRXUBLGY_js = require('../chunk-DRXUBLGY.js');
4
- var chunkKZ2BLMS4_js = require('../chunk-KZ2BLMS4.js');
3
+ var chunk5UVMNKPT_js = require('../chunk-5UVMNKPT.js');
4
+ var chunkSUMIABJK_js = require('../chunk-SUMIABJK.js');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "AppilotsNavigationContainer", {
9
9
  enumerable: true,
10
- get: function () { return chunkDRXUBLGY_js.AppilotsNavigationContainer; }
10
+ get: function () { return chunk5UVMNKPT_js.AppilotsNavigationContainer; }
11
11
  });
12
12
  Object.defineProperty(exports, "clearScreenRegistry", {
13
13
  enumerable: true,
14
- get: function () { return chunkKZ2BLMS4_js.clearScreenRegistry; }
14
+ get: function () { return chunkSUMIABJK_js.clearScreenRegistry; }
15
15
  });
16
16
  Object.defineProperty(exports, "getActiveRouteNames", {
17
17
  enumerable: true,
18
- get: function () { return chunkKZ2BLMS4_js.getActiveRouteNames; }
18
+ get: function () { return chunkSUMIABJK_js.getActiveRouteNames; }
19
19
  });
20
20
  Object.defineProperty(exports, "getAllScreens", {
21
21
  enumerable: true,
22
- get: function () { return chunkKZ2BLMS4_js.getAllScreens; }
22
+ get: function () { return chunkSUMIABJK_js.getAllScreens; }
23
23
  });
24
24
  Object.defineProperty(exports, "getCurrentScreen", {
25
25
  enumerable: true,
26
- get: function () { return chunkKZ2BLMS4_js.getCurrentScreen; }
26
+ get: function () { return chunkSUMIABJK_js.getCurrentScreen; }
27
27
  });
28
28
  Object.defineProperty(exports, "getNavigationRef", {
29
29
  enumerable: true,
30
- get: function () { return chunkKZ2BLMS4_js.getNavigationRef; }
30
+ get: function () { return chunkSUMIABJK_js.getNavigationRef; }
31
31
  });
32
32
  Object.defineProperty(exports, "getNavigationStateSnapshot", {
33
33
  enumerable: true,
34
- get: function () { return chunkKZ2BLMS4_js.getNavigationStateSnapshot; }
34
+ get: function () { return chunkSUMIABJK_js.getNavigationStateSnapshot; }
35
35
  });
36
36
  Object.defineProperty(exports, "getScreenMetadata", {
37
37
  enumerable: true,
38
- get: function () { return chunkKZ2BLMS4_js.getScreenMetadata; }
38
+ get: function () { return chunkSUMIABJK_js.getScreenMetadata; }
39
39
  });
40
40
  Object.defineProperty(exports, "registerScreen", {
41
41
  enumerable: true,
42
- get: function () { return chunkKZ2BLMS4_js.registerScreen; }
42
+ get: function () { return chunkSUMIABJK_js.registerScreen; }
43
43
  });
44
44
  Object.defineProperty(exports, "setCurrentScreen", {
45
45
  enumerable: true,
46
- get: function () { return chunkKZ2BLMS4_js.setCurrentScreen; }
46
+ get: function () { return chunkSUMIABJK_js.setCurrentScreen; }
47
47
  });
48
48
  Object.defineProperty(exports, "setNavigationRef", {
49
49
  enumerable: true,
50
- get: function () { return chunkKZ2BLMS4_js.setNavigationRef; }
50
+ get: function () { return chunkSUMIABJK_js.setNavigationRef; }
51
51
  });
@@ -1,2 +1,2 @@
1
- export { AppilotsNavigationContainer } from '../chunk-LLH7QCSX.mjs';
2
- export { clearScreenRegistry, getActiveRouteNames, getAllScreens, getCurrentScreen, getNavigationRef, getNavigationStateSnapshot, getScreenMetadata, registerScreen, setCurrentScreen, setNavigationRef } from '../chunk-PQZ64CCE.mjs';
1
+ export { AppilotsNavigationContainer } from '../chunk-JKLE5SLN.mjs';
2
+ export { clearScreenRegistry, getActiveRouteNames, getAllScreens, getCurrentScreen, getNavigationRef, getNavigationStateSnapshot, getScreenMetadata, registerScreen, setCurrentScreen, setNavigationRef } from '../chunk-ROXXCDIG.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appilots/sdk",
3
- "version": "0.11.1",
3
+ "version": "0.11.3",
4
4
  "description": "AI-powered chat component and navigation SDK for React Native apps",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",