@guideai/react-native 0.9.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.
Files changed (49) hide show
  1. package/README.md +6 -3
  2. package/dist/{GuideAIChat-BFu10t6D.cjs → GuideAIChat-BtbkPIvE.cjs} +285 -26
  3. package/dist/GuideAIChat-BtbkPIvE.cjs.map +1 -0
  4. package/dist/{GuideAIChat-Ba6n1ePs.js → GuideAIChat-CKW6dgl_.js} +286 -27
  5. package/dist/GuideAIChat-CKW6dgl_.js.map +1 -0
  6. package/dist/index.cjs +1 -1
  7. package/dist/index.d.ts +58 -6
  8. package/dist/index.mjs +2 -2
  9. package/dist/ui.cjs +2 -2
  10. package/dist/ui.d.ts +13 -3
  11. package/dist/ui.mjs +3 -3
  12. package/dist/{useConversations-C-OmzdeA.js → useConversations-BljCr0Od.js} +1067 -43
  13. package/dist/useConversations-BljCr0Od.js.map +1 -0
  14. package/dist/{useConversations-Chn_GKOz.cjs → useConversations-UiwD_WVF.cjs} +1067 -43
  15. package/dist/useConversations-UiwD_WVF.cjs.map +1 -0
  16. package/dist/voice.cjs +61 -23
  17. package/dist/voice.cjs.map +1 -1
  18. package/dist/voice.d.ts +13 -3
  19. package/dist/voice.mjs +62 -24
  20. package/dist/voice.mjs.map +1 -1
  21. package/package.json +1 -1
  22. package/dist/GuideAIChat-BFu10t6D.cjs.map +0 -1
  23. package/dist/GuideAIChat-BQQ8lUKs.js +0 -2795
  24. package/dist/GuideAIChat-BQQ8lUKs.js.map +0 -1
  25. package/dist/GuideAIChat-Ba6n1ePs.js.map +0 -1
  26. package/dist/GuideAIChat-CNmEo5bZ.cjs +0 -2794
  27. package/dist/GuideAIChat-CNmEo5bZ.cjs.map +0 -1
  28. package/dist/GuideAIChat-CxyWFl_o.cjs +0 -2493
  29. package/dist/GuideAIChat-CxyWFl_o.cjs.map +0 -1
  30. package/dist/GuideAIChat-DOC4zx-a.js +0 -2494
  31. package/dist/GuideAIChat-DOC4zx-a.js.map +0 -1
  32. package/dist/GuideAIChat-SU0CVNby.js +0 -2795
  33. package/dist/GuideAIChat-SU0CVNby.js.map +0 -1
  34. package/dist/GuideAIChat-W8KQ4Y6i.cjs +0 -2794
  35. package/dist/GuideAIChat-W8KQ4Y6i.cjs.map +0 -1
  36. package/dist/useConversations-B_7km_uH.js +0 -4243
  37. package/dist/useConversations-B_7km_uH.js.map +0 -1
  38. package/dist/useConversations-C-OmzdeA.js.map +0 -1
  39. package/dist/useConversations-CJEaVqch.cjs +0 -4290
  40. package/dist/useConversations-CJEaVqch.cjs.map +0 -1
  41. package/dist/useConversations-CTbQBTz-.cjs +0 -4242
  42. package/dist/useConversations-CTbQBTz-.cjs.map +0 -1
  43. package/dist/useConversations-Chn_GKOz.cjs.map +0 -1
  44. package/dist/useConversations-Ckyqbxqi.cjs +0 -4299
  45. package/dist/useConversations-Ckyqbxqi.cjs.map +0 -1
  46. package/dist/useConversations-DzhYCIiY.js +0 -4300
  47. package/dist/useConversations-DzhYCIiY.js.map +0 -1
  48. package/dist/useConversations-SbhtYN_R.js +0 -4291
  49. package/dist/useConversations-SbhtYN_R.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const useConversations = require("./useConversations-Chn_GKOz.cjs");
3
+ const useConversations = require("./useConversations-UiwD_WVF.cjs");
4
4
  const jsxRuntime = require("react/jsx-runtime");
5
5
  const React = require("react");
6
6
  function GuideAIScreen({
package/dist/index.d.ts CHANGED
@@ -1089,6 +1089,11 @@ interface GuideAIMessage {
1089
1089
  * `explainOnWhiteboard(id)`.
1090
1090
  */
1091
1091
  whiteboard?: boolean;
1092
+ /**
1093
+ * This answer can also be taught as a Full lesson (the Blueprint offers
1094
+ * it). Draw a button that calls `explainOnWhiteboard(id, { lesson: true })`.
1095
+ */
1096
+ lesson?: boolean;
1092
1097
  /**
1093
1098
  * Pictures the agent drew. They are also in `content` as Markdown
1094
1099
  * images where they belong; use this list to place them yourself.
@@ -1148,11 +1153,16 @@ interface UseGuideAIResult {
1148
1153
  followUps: string[];
1149
1154
  /** The Blueprint has the whiteboard block. */
1150
1155
  whiteboardAvailable: boolean;
1156
+ /** The Blueprint offers Full lessons beside the whiteboard. */
1157
+ lessonsAvailable: boolean;
1151
1158
  /**
1152
- * Explain an answer on the whiteboard, with the question it answered.
1153
- * Mount `<GuideAIWhiteboard />` once to show the board.
1159
+ * Explain an answer on the whiteboard, with the question it answered;
1160
+ * `{ lesson: true }` for the Full lesson. Mount `<GuideAIWhiteboard />`
1161
+ * once to show the board.
1154
1162
  */
1155
- explainOnWhiteboard(messageId: string): Promise<boolean>;
1163
+ explainOnWhiteboard(messageId: string, options?: {
1164
+ lesson?: boolean;
1165
+ }): Promise<boolean>;
1156
1166
  /**
1157
1167
  * The current input text, and its setter.
1158
1168
  *
@@ -1351,22 +1361,64 @@ interface BoardScene {
1351
1361
  photos?: Record<string, Photo>;
1352
1362
  }
1353
1363
 
1364
+ type IsoAction = Record<string, unknown>;
1365
+ interface IsoStep {
1366
+ say: string;
1367
+ do: IsoAction[];
1368
+ clear?: boolean;
1369
+ metrics?: Record<string, string | [string, string]>;
1370
+ chapter?: string;
1371
+ title?: string;
1372
+ body?: string[];
1373
+ callout?: {
1374
+ kind: string;
1375
+ text: string;
1376
+ };
1377
+ changes?: string[];
1378
+ }
1379
+ interface IsoMetric {
1380
+ id: string;
1381
+ label: string;
1382
+ icon?: string;
1383
+ better?: 'low' | 'high';
1384
+ }
1385
+ interface IsoPlan {
1386
+ kind: 'iso';
1387
+ lesson: boolean;
1388
+ title: string;
1389
+ summary?: string;
1390
+ sample?: boolean;
1391
+ metrics: IsoMetric[];
1392
+ goals?: {
1393
+ text: string;
1394
+ step: number;
1395
+ }[];
1396
+ steps: IsoStep[];
1397
+ }
1398
+
1354
1399
  type WhiteboardStatus = 'closed' | 'loading' | 'playing' | 'error';
1355
1400
  interface WhiteboardState {
1356
1401
  status: WhiteboardStatus;
1357
- scene: BoardScene | null;
1402
+ /** A pen board, or a 3D board / Full lesson (`kind: 'iso'`). */
1403
+ scene: BoardScene | IsoPlan | null;
1358
1404
  error: string | null;
1359
1405
  /** What was asked, for the loading title and Try again. */
1360
1406
  question: string;
1361
1407
  answer?: string;
1408
+ /** A Full lesson was asked for. */
1409
+ lesson?: boolean;
1362
1410
  }
1363
1411
 
1364
1412
  interface UseWhiteboardResult {
1365
1413
  /** The Blueprint has "Explain on a whiteboard". False until the server says so. */
1366
1414
  available: boolean;
1415
+ /** The Blueprint also offers a Full lesson (a 3D lesson that plays by itself). */
1416
+ lessons: boolean;
1367
1417
  state: WhiteboardState;
1368
- /** Explain an answer on the board: the question asked, and the answer given. */
1369
- explain(question: string, answer?: string): Promise<boolean>;
1418
+ /** Explain an answer on the board: the question asked, and the answer given; `lesson` for the Full lesson. */
1419
+ explain(question: string, answer?: string, options?: {
1420
+ lesson?: boolean;
1421
+ }): Promise<boolean>;
1370
1422
  /** Draw a board the host built (see `whiteboardLayouts`). Throws SceneError if it cannot be drawn. */
1371
1423
  play(scene: unknown): void;
1372
1424
  retry(): void;
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { u as useGuideAIRuntime, S as ScreenRegistry, R as RegistryContext, a as useScreenRegistry, L as LIMITS } from "./useConversations-C-OmzdeA.js";
2
- import { G, b, c, d, e } from "./useConversations-C-OmzdeA.js";
1
+ import { u as useGuideAIRuntime, S as ScreenRegistry, R as RegistryContext, a as useScreenRegistry, L as LIMITS } from "./useConversations-BljCr0Od.js";
2
+ import { G, b, c, d, e } from "./useConversations-BljCr0Od.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { useMemo, useEffect, useRef } from "react";
5
5
  function GuideAIScreen({
package/dist/ui.cjs CHANGED
@@ -3,8 +3,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const reactNative = require("react-native");
6
- const GuideAIChat = require("./GuideAIChat-CNmEo5bZ.cjs");
7
- const useConversations = require("./useConversations-Chn_GKOz.cjs");
6
+ const GuideAIChat = require("./GuideAIChat-BtbkPIvE.cjs");
7
+ const useConversations = require("./useConversations-UiwD_WVF.cjs");
8
8
  const POLL_INTERVAL_MS = 3e3;
9
9
  const CONVERSATION_KEY = "guideai_support_conversation";
10
10
  function useStoredConversation() {
package/dist/ui.d.ts CHANGED
@@ -32,6 +32,11 @@ interface GuideAIMessage {
32
32
  * `explainOnWhiteboard(id)`.
33
33
  */
34
34
  whiteboard?: boolean;
35
+ /**
36
+ * This answer can also be taught as a Full lesson (the Blueprint offers
37
+ * it). Draw a button that calls `explainOnWhiteboard(id, { lesson: true })`.
38
+ */
39
+ lesson?: boolean;
35
40
  /**
36
41
  * Pictures the agent drew. They are also in `content` as Markdown
37
42
  * images where they belong; use this list to place them yourself.
@@ -91,11 +96,16 @@ interface UseGuideAIResult {
91
96
  followUps: string[];
92
97
  /** The Blueprint has the whiteboard block. */
93
98
  whiteboardAvailable: boolean;
99
+ /** The Blueprint offers Full lessons beside the whiteboard. */
100
+ lessonsAvailable: boolean;
94
101
  /**
95
- * Explain an answer on the whiteboard, with the question it answered.
96
- * Mount `<GuideAIWhiteboard />` once to show the board.
102
+ * Explain an answer on the whiteboard, with the question it answered;
103
+ * `{ lesson: true }` for the Full lesson. Mount `<GuideAIWhiteboard />`
104
+ * once to show the board.
97
105
  */
98
- explainOnWhiteboard(messageId: string): Promise<boolean>;
106
+ explainOnWhiteboard(messageId: string, options?: {
107
+ lesson?: boolean;
108
+ }): Promise<boolean>;
99
109
  /**
100
110
  * The current input text, and its setter.
101
111
  *
package/dist/ui.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { useState, useRef, useEffect, useCallback, useMemo, useContext, createContext } from "react";
3
3
  import { Platform, StatusBar, KeyboardAvoidingView, View, Text, Pressable, ScrollView, TextInput, ActivityIndicator, FlatList, StyleSheet, Dimensions, Animated, PanResponder, Modal, Easing } from "react-native";
4
- import { r as resolveTheme, G as GuideAIChat } from "./GuideAIChat-SU0CVNby.js";
5
- import { D, a, b, c, d, M, e, l } from "./GuideAIChat-SU0CVNby.js";
6
- import { r as requireConfigured, E as EP, d as useOnboarding } from "./useConversations-C-OmzdeA.js";
4
+ import { r as resolveTheme, G as GuideAIChat } from "./GuideAIChat-CKW6dgl_.js";
5
+ import { D, a, b, c, d, M, e, l } from "./GuideAIChat-CKW6dgl_.js";
6
+ import { r as requireConfigured, E as EP, d as useOnboarding } from "./useConversations-BljCr0Od.js";
7
7
  const POLL_INTERVAL_MS = 3e3;
8
8
  const CONVERSATION_KEY = "guideai_support_conversation";
9
9
  function useStoredConversation() {