@buoy-gg/ask-buoy 7.0.33

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 (184) hide show
  1. package/LICENSE +58 -0
  2. package/README.md +50 -0
  3. package/lib/commonjs/blocks/AskBlocks.js +338 -0
  4. package/lib/commonjs/blocks/AskBlocks.js.map +1 -0
  5. package/lib/commonjs/blocks/BlockRenderer.js +250 -0
  6. package/lib/commonjs/blocks/BlockRenderer.js.map +1 -0
  7. package/lib/commonjs/blocks/ChromePrototypes.js +514 -0
  8. package/lib/commonjs/blocks/ChromePrototypes.js.map +1 -0
  9. package/lib/commonjs/blocks/DataBlocks.js +545 -0
  10. package/lib/commonjs/blocks/DataBlocks.js.map +1 -0
  11. package/lib/commonjs/blocks/ExtraBlocks.js +1821 -0
  12. package/lib/commonjs/blocks/ExtraBlocks.js.map +1 -0
  13. package/lib/commonjs/blocks/MediaBlocks.js +140 -0
  14. package/lib/commonjs/blocks/MediaBlocks.js.map +1 -0
  15. package/lib/commonjs/blocks/ReceiptBlocks.js +596 -0
  16. package/lib/commonjs/blocks/ReceiptBlocks.js.map +1 -0
  17. package/lib/commonjs/blocks/context.js +42 -0
  18. package/lib/commonjs/blocks/context.js.map +1 -0
  19. package/lib/commonjs/blocks/icons.js +96 -0
  20. package/lib/commonjs/blocks/icons.js.map +1 -0
  21. package/lib/commonjs/blocks/index.js +95 -0
  22. package/lib/commonjs/blocks/index.js.map +1 -0
  23. package/lib/commonjs/blocks/primitives.js +312 -0
  24. package/lib/commonjs/blocks/primitives.js.map +1 -0
  25. package/lib/commonjs/blocks/primitivesIndex.js +56 -0
  26. package/lib/commonjs/blocks/primitivesIndex.js.map +1 -0
  27. package/lib/commonjs/components/ApprovalCard.js +140 -0
  28. package/lib/commonjs/components/ApprovalCard.js.map +1 -0
  29. package/lib/commonjs/components/AskBuoyHeader.js +127 -0
  30. package/lib/commonjs/components/AskBuoyHeader.js.map +1 -0
  31. package/lib/commonjs/components/AskBuoyIcon.js +19 -0
  32. package/lib/commonjs/components/AskBuoyIcon.js.map +1 -0
  33. package/lib/commonjs/components/AskBuoyModal.js +322 -0
  34. package/lib/commonjs/components/AskBuoyModal.js.map +1 -0
  35. package/lib/commonjs/components/ChangesBar.js +211 -0
  36. package/lib/commonjs/components/ChangesBar.js.map +1 -0
  37. package/lib/commonjs/components/Composer.js +175 -0
  38. package/lib/commonjs/components/Composer.js.map +1 -0
  39. package/lib/commonjs/components/EmptyState.js +154 -0
  40. package/lib/commonjs/components/EmptyState.js.map +1 -0
  41. package/lib/commonjs/components/Markdown.js +252 -0
  42. package/lib/commonjs/components/Markdown.js.map +1 -0
  43. package/lib/commonjs/components/MessageList.js +648 -0
  44. package/lib/commonjs/components/MessageList.js.map +1 -0
  45. package/lib/commonjs/components/TypingDots.js +63 -0
  46. package/lib/commonjs/components/TypingDots.js.map +1 -0
  47. package/lib/commonjs/index.js +205 -0
  48. package/lib/commonjs/index.js.map +1 -0
  49. package/lib/commonjs/package.json +1 -0
  50. package/lib/commonjs/preset.js +90 -0
  51. package/lib/commonjs/preset.js.map +1 -0
  52. package/lib/commonjs/store/askBuoyStore.js +279 -0
  53. package/lib/commonjs/store/askBuoyStore.js.map +1 -0
  54. package/lib/commonjs/store/useAskBuoy.js +299 -0
  55. package/lib/commonjs/store/useAskBuoy.js.map +1 -0
  56. package/lib/commonjs/sync/askBuoySyncAdapter.js +119 -0
  57. package/lib/commonjs/sync/askBuoySyncAdapter.js.map +1 -0
  58. package/lib/commonjs/sync/askBuoySyncAdapter.test.js +136 -0
  59. package/lib/commonjs/sync/askBuoySyncAdapter.test.js.map +1 -0
  60. package/lib/commonjs/sync/wire.js +58 -0
  61. package/lib/commonjs/sync/wire.js.map +1 -0
  62. package/lib/commonjs/types.js +6 -0
  63. package/lib/commonjs/types.js.map +1 -0
  64. package/lib/module/blocks/AskBlocks.js +331 -0
  65. package/lib/module/blocks/AskBlocks.js.map +1 -0
  66. package/lib/module/blocks/BlockRenderer.js +245 -0
  67. package/lib/module/blocks/BlockRenderer.js.map +1 -0
  68. package/lib/module/blocks/ChromePrototypes.js +503 -0
  69. package/lib/module/blocks/ChromePrototypes.js.map +1 -0
  70. package/lib/module/blocks/DataBlocks.js +532 -0
  71. package/lib/module/blocks/DataBlocks.js.map +1 -0
  72. package/lib/module/blocks/ExtraBlocks.js +1794 -0
  73. package/lib/module/blocks/ExtraBlocks.js.map +1 -0
  74. package/lib/module/blocks/MediaBlocks.js +135 -0
  75. package/lib/module/blocks/MediaBlocks.js.map +1 -0
  76. package/lib/module/blocks/ReceiptBlocks.js +584 -0
  77. package/lib/module/blocks/ReceiptBlocks.js.map +1 -0
  78. package/lib/module/blocks/context.js +35 -0
  79. package/lib/module/blocks/context.js.map +1 -0
  80. package/lib/module/blocks/icons.js +91 -0
  81. package/lib/module/blocks/icons.js.map +1 -0
  82. package/lib/module/blocks/index.js +8 -0
  83. package/lib/module/blocks/index.js.map +1 -0
  84. package/lib/module/blocks/primitives.js +301 -0
  85. package/lib/module/blocks/primitives.js.map +1 -0
  86. package/lib/module/blocks/primitivesIndex.js +5 -0
  87. package/lib/module/blocks/primitivesIndex.js.map +1 -0
  88. package/lib/module/components/ApprovalCard.js +135 -0
  89. package/lib/module/components/ApprovalCard.js.map +1 -0
  90. package/lib/module/components/AskBuoyHeader.js +124 -0
  91. package/lib/module/components/AskBuoyHeader.js.map +1 -0
  92. package/lib/module/components/AskBuoyIcon.js +8 -0
  93. package/lib/module/components/AskBuoyIcon.js.map +1 -0
  94. package/lib/module/components/AskBuoyModal.js +317 -0
  95. package/lib/module/components/AskBuoyModal.js.map +1 -0
  96. package/lib/module/components/ChangesBar.js +206 -0
  97. package/lib/module/components/ChangesBar.js.map +1 -0
  98. package/lib/module/components/Composer.js +170 -0
  99. package/lib/module/components/Composer.js.map +1 -0
  100. package/lib/module/components/EmptyState.js +149 -0
  101. package/lib/module/components/EmptyState.js.map +1 -0
  102. package/lib/module/components/Markdown.js +246 -0
  103. package/lib/module/components/Markdown.js.map +1 -0
  104. package/lib/module/components/MessageList.js +642 -0
  105. package/lib/module/components/MessageList.js.map +1 -0
  106. package/lib/module/components/TypingDots.js +58 -0
  107. package/lib/module/components/TypingDots.js.map +1 -0
  108. package/lib/module/index.js +29 -0
  109. package/lib/module/index.js.map +1 -0
  110. package/lib/module/preset.js +73 -0
  111. package/lib/module/preset.js.map +1 -0
  112. package/lib/module/store/askBuoyStore.js +275 -0
  113. package/lib/module/store/askBuoyStore.js.map +1 -0
  114. package/lib/module/store/useAskBuoy.js +293 -0
  115. package/lib/module/store/useAskBuoy.js.map +1 -0
  116. package/lib/module/sync/askBuoySyncAdapter.js +114 -0
  117. package/lib/module/sync/askBuoySyncAdapter.js.map +1 -0
  118. package/lib/module/sync/askBuoySyncAdapter.test.js +135 -0
  119. package/lib/module/sync/askBuoySyncAdapter.test.js.map +1 -0
  120. package/lib/module/sync/wire.js +47 -0
  121. package/lib/module/sync/wire.js.map +1 -0
  122. package/lib/module/types.js +4 -0
  123. package/lib/module/types.js.map +1 -0
  124. package/lib/typescript/blocks/AskBlocks.d.ts +11 -0
  125. package/lib/typescript/blocks/AskBlocks.d.ts.map +1 -0
  126. package/lib/typescript/blocks/BlockRenderer.d.ts +5 -0
  127. package/lib/typescript/blocks/BlockRenderer.d.ts.map +1 -0
  128. package/lib/typescript/blocks/ChromePrototypes.d.ts +27 -0
  129. package/lib/typescript/blocks/ChromePrototypes.d.ts.map +1 -0
  130. package/lib/typescript/blocks/DataBlocks.d.ts +29 -0
  131. package/lib/typescript/blocks/DataBlocks.d.ts.map +1 -0
  132. package/lib/typescript/blocks/ExtraBlocks.d.ts +69 -0
  133. package/lib/typescript/blocks/ExtraBlocks.d.ts.map +1 -0
  134. package/lib/typescript/blocks/MediaBlocks.d.ts +5 -0
  135. package/lib/typescript/blocks/MediaBlocks.d.ts.map +1 -0
  136. package/lib/typescript/blocks/ReceiptBlocks.d.ts +27 -0
  137. package/lib/typescript/blocks/ReceiptBlocks.d.ts.map +1 -0
  138. package/lib/typescript/blocks/context.d.ts +35 -0
  139. package/lib/typescript/blocks/context.d.ts.map +1 -0
  140. package/lib/typescript/blocks/icons.d.ts +6 -0
  141. package/lib/typescript/blocks/icons.d.ts.map +1 -0
  142. package/lib/typescript/blocks/index.d.ts +6 -0
  143. package/lib/typescript/blocks/index.d.ts.map +1 -0
  144. package/lib/typescript/blocks/primitives.d.ts +85 -0
  145. package/lib/typescript/blocks/primitives.d.ts.map +1 -0
  146. package/lib/typescript/blocks/primitivesIndex.d.ts +3 -0
  147. package/lib/typescript/blocks/primitivesIndex.d.ts.map +1 -0
  148. package/lib/typescript/components/ApprovalCard.d.ts +7 -0
  149. package/lib/typescript/components/ApprovalCard.d.ts.map +1 -0
  150. package/lib/typescript/components/AskBuoyHeader.d.ts +14 -0
  151. package/lib/typescript/components/AskBuoyHeader.d.ts.map +1 -0
  152. package/lib/typescript/components/AskBuoyIcon.d.ts +6 -0
  153. package/lib/typescript/components/AskBuoyIcon.d.ts.map +1 -0
  154. package/lib/typescript/components/AskBuoyModal.d.ts +13 -0
  155. package/lib/typescript/components/AskBuoyModal.d.ts.map +1 -0
  156. package/lib/typescript/components/ChangesBar.d.ts +9 -0
  157. package/lib/typescript/components/ChangesBar.d.ts.map +1 -0
  158. package/lib/typescript/components/Composer.d.ts +9 -0
  159. package/lib/typescript/components/Composer.d.ts.map +1 -0
  160. package/lib/typescript/components/EmptyState.d.ts +6 -0
  161. package/lib/typescript/components/EmptyState.d.ts.map +1 -0
  162. package/lib/typescript/components/Markdown.d.ts +23 -0
  163. package/lib/typescript/components/Markdown.d.ts.map +1 -0
  164. package/lib/typescript/components/MessageList.d.ts +18 -0
  165. package/lib/typescript/components/MessageList.d.ts.map +1 -0
  166. package/lib/typescript/components/TypingDots.d.ts +2 -0
  167. package/lib/typescript/components/TypingDots.d.ts.map +1 -0
  168. package/lib/typescript/index.d.ts +28 -0
  169. package/lib/typescript/index.d.ts.map +1 -0
  170. package/lib/typescript/preset.d.ts +61 -0
  171. package/lib/typescript/preset.d.ts.map +1 -0
  172. package/lib/typescript/store/askBuoyStore.d.ts +124 -0
  173. package/lib/typescript/store/askBuoyStore.d.ts.map +1 -0
  174. package/lib/typescript/store/useAskBuoy.d.ts +22 -0
  175. package/lib/typescript/store/useAskBuoy.d.ts.map +1 -0
  176. package/lib/typescript/sync/askBuoySyncAdapter.d.ts +73 -0
  177. package/lib/typescript/sync/askBuoySyncAdapter.d.ts.map +1 -0
  178. package/lib/typescript/sync/askBuoySyncAdapter.test.d.ts +2 -0
  179. package/lib/typescript/sync/askBuoySyncAdapter.test.d.ts.map +1 -0
  180. package/lib/typescript/sync/wire.d.ts +17 -0
  181. package/lib/typescript/sync/wire.d.ts.map +1 -0
  182. package/lib/typescript/types.d.ts +119 -0
  183. package/lib/typescript/types.d.ts.map +1 -0
  184. package/package.json +83 -0
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * The sheet header.
5
+ *
6
+ * Built on the shared `ModalHeader` so it matches Console, Network and Events
7
+ * 1:1 — the stock JsModal header was designed for a single centred title and
8
+ * paints its "Double tap: Toggle • Triple tap: Close" hint through the middle
9
+ * of it, which is how "Ask Buoy" ended up overprinted by grey italics.
10
+ *
11
+ * The subtitle is the one piece of live status the sheet has: what the agent
12
+ * is doing right now, in words a tester can act on. "Thinking…" while a
13
+ * response is streaming with no tool in flight, the current tool's title
14
+ * while one runs, and the reachable tool count at rest so a "why can't it
15
+ * see my network calls" question has an answer in the header.
16
+ *
17
+ * "New conversation" moved up here from a 11pt text link under the composer.
18
+ * A reset that lives under the keyboard is a reset nobody finds.
19
+ */
20
+ import { useEffect, useState } from "react";
21
+ import { StyleSheet, TouchableOpacity, View } from "react-native";
22
+ import { ModalHeader, night, Otto, Plus } from "@buoy-gg/shared-ui";
23
+
24
+ /**
25
+ * Slower than the sprite's default 140ms.
26
+ *
27
+ * This mascot is ambient status a user stares at for the length of a turn,
28
+ * not a moment of delight they glance at once — at the stock tick it read as
29
+ * fidgeting in the corner of the eye while you were trying to read the
30
+ * answer next to it. Every other placement keeps the default.
31
+ */
32
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
33
+ const HEADER_TICK_MS = 200;
34
+ export function AskBuoyHeader({
35
+ configured,
36
+ busy,
37
+ failed = false,
38
+ activeLabel,
39
+ toolCount,
40
+ hasMessages,
41
+ onBack,
42
+ onReset
43
+ }) {
44
+ /**
45
+ * ONE mascot state per turn, held to the end of it.
46
+ *
47
+ * `activeLabel` drops to null in the gap between two tool calls, so deriving
48
+ * the state from it directly flipped robot → thinking → robot on every
49
+ * boundary. A turn that runs four tools swapped the sprite eight times in
50
+ * about three seconds — a strobe that reads as a glitch, not as progress.
51
+ * So the robot latches: once this turn has driven a tool it stays `robot`
52
+ * until the turn ends, which is also the honest summary of that turn.
53
+ *
54
+ * The SUBTITLE still tracks each call, because updating a line of text is
55
+ * informative where restarting an animation is just noise.
56
+ */
57
+ const [droveTool, setDroveTool] = useState(false);
58
+ useEffect(() => {
59
+ if (!busy) setDroveTool(false);else if (activeLabel) setDroveTool(true);
60
+ }, [busy, activeLabel]);
61
+
62
+ /**
63
+ * Otto mirrors the subtitle, never contradicts it. This is the one place in
64
+ * the product where a mascot earns continuous presence: the user is waiting
65
+ * on a machine and the header is the only thing reporting on it.
66
+ *
67
+ * `robot` while a tool runs is literal — the agent IS driving the tools.
68
+ */
69
+ const otto = !configured ? "confused" : failed ? "error" : busy ? activeLabel || droveTool ? "robot" : "thinking" : "idle";
70
+ const subtitle = !configured ? "Not set up in this app" : busy ? activeLabel ? `${activeLabel}…` : "Thinking…" : toolCount > 0 ? `Ready · ${toolCount} tool${toolCount === 1 ? "" : "s"} available` : "Ready";
71
+ return /*#__PURE__*/_jsxs(ModalHeader, {
72
+ children: [onBack ? /*#__PURE__*/_jsx(ModalHeader.Navigation, {
73
+ onBack: onBack
74
+ }) : null, /*#__PURE__*/_jsx(View, {
75
+ style: styles.otto,
76
+ testID: "buoy-ask-buoy-otto",
77
+ children: /*#__PURE__*/_jsx(Otto, {
78
+ state: otto,
79
+ pixelSize: 2,
80
+ tickMs: HEADER_TICK_MS,
81
+ water: false
82
+ })
83
+ }), /*#__PURE__*/_jsx(ModalHeader.Content, {
84
+ title: "Ask Buoy",
85
+ subtitle: subtitle,
86
+ testID: "buoy-ask-buoy-title"
87
+ }), /*#__PURE__*/_jsx(ModalHeader.Actions, {
88
+ children: /*#__PURE__*/_jsx(TouchableOpacity, {
89
+ testID: "buoy-ask-buoy-reset",
90
+ accessibilityRole: "button",
91
+ accessibilityLabel: "New conversation",
92
+ disabled: !hasMessages,
93
+ onPress: onReset,
94
+ style: [styles.actionBtn, !hasMessages && styles.actionBtnDisabled],
95
+ children: /*#__PURE__*/_jsx(Plus, {
96
+ size: 14,
97
+ color: hasMessages ? night.color.textSecondary : night.color.textTertiary
98
+ })
99
+ })
100
+ })]
101
+ });
102
+ }
103
+ const styles = StyleSheet.create({
104
+ // 32pt of Otto (16 grid × 2pt) reading as the header's status glyph.
105
+ otto: {
106
+ marginRight: 8,
107
+ justifyContent: "center"
108
+ },
109
+ // Same plate as the Console header's action buttons.
110
+ actionBtn: {
111
+ width: 32,
112
+ height: 32,
113
+ borderRadius: 8,
114
+ backgroundColor: night.color.buttonSurface,
115
+ borderWidth: 1,
116
+ borderColor: night.color.border,
117
+ alignItems: "center",
118
+ justifyContent: "center"
119
+ },
120
+ actionBtnDisabled: {
121
+ opacity: 0.55
122
+ }
123
+ });
124
+ //# sourceMappingURL=AskBuoyHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useState","StyleSheet","TouchableOpacity","View","ModalHeader","night","Otto","Plus","jsx","_jsx","jsxs","_jsxs","HEADER_TICK_MS","AskBuoyHeader","configured","busy","failed","activeLabel","toolCount","hasMessages","onBack","onReset","droveTool","setDroveTool","otto","subtitle","children","Navigation","style","styles","testID","state","pixelSize","tickMs","water","Content","title","Actions","accessibilityRole","accessibilityLabel","disabled","onPress","actionBtn","actionBtnDisabled","size","color","textSecondary","textTertiary","create","marginRight","justifyContent","width","height","borderRadius","backgroundColor","buttonSurface","borderWidth","borderColor","border","alignItems","opacity"],"sourceRoot":"../../../src","sources":["components/AskBuoyHeader.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,UAAU,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AACjE,SAASC,WAAW,EAAEC,KAAK,EAAEC,IAAI,EAAEC,IAAI,QAAwB,oBAAoB;;AAEnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAQA,MAAMC,cAAc,GAAG,GAAG;AAe1B,OAAO,SAASC,aAAaA,CAAC;EAC5BC,UAAU;EACVC,IAAI;EACJC,MAAM,GAAG,KAAK;EACdC,WAAW;EACXC,SAAS;EACTC,WAAW;EACXC,MAAM;EACNC;AACkB,CAAC,EAAE;EACrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAGvB,QAAQ,CAAC,KAAK,CAAC;EACjDD,SAAS,CAAC,MAAM;IACd,IAAI,CAACgB,IAAI,EAAEQ,YAAY,CAAC,KAAK,CAAC,CAAC,KAC1B,IAAIN,WAAW,EAAEM,YAAY,CAAC,IAAI,CAAC;EAC1C,CAAC,EAAE,CAACR,IAAI,EAAEE,WAAW,CAAC,CAAC;;EAEvB;AACF;AACA;AACA;AACA;AACA;AACA;EACE,MAAMO,IAAe,GAAG,CAACV,UAAU,GAC/B,UAAU,GACVE,MAAM,GACJ,OAAO,GACPD,IAAI,GACFE,WAAW,IAAIK,SAAS,GACtB,OAAO,GACP,UAAU,GACZ,MAAM;E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K,CAACwC,KAAK,CAACE;QAAa,CAC3E;MAAC,CACc;IAAC,CACA,CAAC;EAAA,CACX,CAAC;AAElB;AAEA,MAAMlB,MAAM,GAAG5B,UAAU,CAAC+C,MAAM,CAAC;EAC/B;EACAxB,IAAI,EAAE;IAAEyB,WAAW,EAAE,CAAC;IAAEC,cAAc,EAAE;EAAS,CAAC;EAClD;EACAR,SAAS,EAAE;IACTS,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVC,YAAY,EAAE,CAAC;IACfC,eAAe,EAAEjD,KAAK,CAACwC,KAAK,CAACU,aAAa;IAC1CC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAEpD,KAAK,CAACwC,KAAK,CAACa,MAAM;IAC/BC,UAAU,EAAE,QAAQ;IACpBT,cAAc,EAAE;EAClB,CAAC;EACDP,iBAAiB,EAAE;IAAEiB,OAAO,EAAE;EAAK;AACrC,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Re-exported from floating-tools-core so the tool package has one import
5
+ * surface, matching how every other Buoy tool exposes its icon.
6
+ */
7
+ export { AskBuoyIcon, ASK_BUOY_ICON_COLOR } from "@buoy-gg/floating-tools-core";
8
+ //# sourceMappingURL=AskBuoyIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AskBuoyIcon","ASK_BUOY_ICON_COLOR"],"sourceRoot":"../../../src","sources":["components/AskBuoyIcon.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,mBAAmB,QAAQ,8BAA8B","ignoreList":[]}
@@ -0,0 +1,317 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Ask Buoy — the sheet.
5
+ *
6
+ * Manual JsModal chrome rather than the declarative `InstalledApp.modal` path,
7
+ * because `ToolModalShell` forwards neither `footer`/`footerHeight` nor
8
+ * `initialHeight`, and a conversation in a 400pt sheet with no sticky composer
9
+ * is not usable.
10
+ *
11
+ * The layout rules here are all learned ones, each noted at its line: one
12
+ * scroller owned by the message list, no animated background competing with
13
+ * streaming text, transparent containers so the sheet's own chrome shows, and
14
+ * an iOS-only keyboard offset.
15
+ *
16
+ * Top to bottom: header (title, live status, new-conversation) · changes bar
17
+ * (only once something has been changed) · transcript · approval card (only
18
+ * with `requireApproval`) · composer. Nothing else. The old "New conversation"
19
+ * text link under the composer is gone — it is the header's + button now.
20
+ */
21
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
22
+ import { Alert, Animated, KeyboardAvoidingView, Platform, StyleSheet, Text, View } from "react-native";
23
+ import { isReversible } from "@buoy-gg/agent-core";
24
+ import { dispatchToolAction, FeatureGate, Info, JsModal, night, useSafeAreaInsets } from "@buoy-gg/shared-ui";
25
+ import { BlockHandlersProvider } from "../blocks";
26
+ import { ApprovalCard } from "./ApprovalCard";
27
+ import { ChangesBar } from "./ChangesBar";
28
+ import { Composer } from "./Composer";
29
+ import { AskBuoyHeader } from "./AskBuoyHeader";
30
+ import { EmptyState } from "./EmptyState";
31
+ import { MessageList } from "./MessageList";
32
+ import { askBuoyStore } from "../store/askBuoyStore";
33
+ import { useAskBuoy } from "../store/useAskBuoy";
34
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
35
+ export function AskBuoyModal({
36
+ visible,
37
+ onClose,
38
+ onBack,
39
+ onMinimize,
40
+ persistenceKey,
41
+ config
42
+ }) {
43
+ const {
44
+ state,
45
+ send,
46
+ stop,
47
+ reset,
48
+ approve,
49
+ retry,
50
+ answer,
51
+ runAction,
52
+ configured,
53
+ toolCount
54
+ } = useAskBuoy(config);
55
+ const [changesOpen, setChangesOpen] = useState(false);
56
+ // A hardcoded device map, not the native library — an unmapped phone
57
+ // silently returns bottom: 0, which is how footers ended up sitting on the
58
+ // home indicator.
59
+ const insets = useSafeAreaInsets({
60
+ minBottom: 16
61
+ });
62
+
63
+ /**
64
+ * `dispatchToolAction` is imported STATICALLY at the top of this file, not
65
+ * with `import()`. A dynamic import here resolves through Metro's
66
+ * async-require path, which in a lazy dev bundle rejects with "Expected
67
+ * HMRClient.setup() call at startup" — and because the promise was voided,
68
+ * Undo did nothing at all while the bar went on claiming the changes were
69
+ * undoable. shared-ui is already a static dependency of this component.
70
+ *
71
+ * A failed revert is SHOWN. `revertAll` reports what it could not put back,
72
+ * and swallowing that is the same failure in a quieter form: the whole
73
+ * reason mutations may auto-run is that undo is real.
74
+ */
75
+ const undoAll = useCallback(() => {
76
+ const ledger = askBuoyStore.getLedger();
77
+ if (!ledger) return;
78
+ void (async () => {
79
+ const outcome = await ledger.revertAll(dispatchToolAction);
80
+ if (outcome.failed.length === 0) {
81
+ askBuoyStore.setNotice(null);
82
+ return;
83
+ }
84
+ const detail = outcome.failed.map(f => `${f.label} (${f.error})`).join("; ");
85
+ askBuoyStore.setNotice(`Couldn't undo ${outcome.failed.length} change${outcome.failed.length === 1 ? "" : "s"} — ${detail}`);
86
+ })();
87
+ }, []);
88
+ const toggleChanges = useCallback(() => setChangesOpen(v => !v), []);
89
+
90
+ /**
91
+ * PEEK. When the agent navigates or taps, the sheet drops to a 120pt strip
92
+ * for ~2.5s so the user watches the app do it, then springs back to the
93
+ * height it had (including a user's drag-resize — the value is read live,
94
+ * never assumed). Rides JsModal's external `animatedHeight` seam, so the
95
+ * modal's own drag-resize keeps working on the same value.
96
+ */
97
+ const sheetHeight = useRef(new Animated.Value(560)).current;
98
+ const peeking = useRef(false);
99
+ const runPeek = useCallback(() => {
100
+ if (peeking.current) return;
101
+ peeking.current = true;
102
+ sheetHeight.stopAnimation(from => {
103
+ const restoreTo = typeof from === "number" && from > 200 ? from : 560;
104
+ Animated.timing(sheetHeight, {
105
+ toValue: 120,
106
+ duration: 220,
107
+ useNativeDriver: false
108
+ }).start(() => {
109
+ setTimeout(() => {
110
+ Animated.spring(sheetHeight, {
111
+ toValue: restoreTo,
112
+ friction: 9,
113
+ useNativeDriver: false
114
+ }).start(() => {
115
+ peeking.current = false;
116
+ });
117
+ }, 2500);
118
+ });
119
+ });
120
+ }, [sheetHeight]);
121
+
122
+ // A new `peek` receipt (navigate, tap) triggers the shrink. Keyed by
123
+ // message id + count so a fresh assistant message restarts the count.
124
+ const peekKey = useMemo(() => {
125
+ const last = state.messages[state.messages.length - 1];
126
+ if (!last || last.role !== "assistant") return "";
127
+ const peeks = last.blocks.filter(p => p.block.kind === "peek").length;
128
+ return peeks > 0 ? `${last.id}:${peeks}` : "";
129
+ }, [state.messages]);
130
+ const prevPeekKey = useRef("");
131
+ useEffect(() => {
132
+ if (peekKey && peekKey !== prevPeekKey.current && config?.peek !== false) runPeek();
133
+ prevPeekKey.current = peekKey;
134
+ }, [peekKey, runPeek, config]);
135
+
136
+ /**
137
+ * New conversation, guarded. Clearing the session clears the ledger — the
138
+ * ONLY undo surface — while the agent's changes stay live in the app, so
139
+ * with reversible changes outstanding the user chooses their fate first.
140
+ */
141
+ const confirmReset = useCallback(() => {
142
+ const ledger = askBuoyStore.getLedger();
143
+ const reversible = ledger?.list().filter(e => !e.undoneAt && isReversible(e.effect)).length ?? 0;
144
+ if (reversible === 0) {
145
+ reset();
146
+ return;
147
+ }
148
+ Alert.alert("Undo changes first?", `Ask Buoy made ${reversible} change${reversible === 1 ? "" : "s"} that can still be undone. Clearing the conversation loses the only automatic undo for ${reversible === 1 ? "it" : "them"}.`, [{
149
+ text: "Undo, then clear",
150
+ onPress: () => {
151
+ void (async () => {
152
+ const l = askBuoyStore.getLedger();
153
+ if (l) await l.revertAll(dispatchToolAction);
154
+ reset();
155
+ })();
156
+ }
157
+ }, {
158
+ text: "Clear anyway",
159
+ style: "destructive",
160
+ onPress: reset
161
+ }, {
162
+ text: "Cancel",
163
+ style: "cancel"
164
+ }]);
165
+ }, [reset]);
166
+
167
+ // The header's live status: the title of whichever tool call is in flight.
168
+ const activeLabel = useMemo(() => {
169
+ const last = state.messages[state.messages.length - 1];
170
+ if (!last || last.role !== "assistant" || !last.streaming) return null;
171
+ return last.toolCalls.find(c => c.status === "running")?.label ?? null;
172
+ }, [state.messages]);
173
+
174
+ /**
175
+ * What a block can do in THIS host. `minimize` collapses the sheet to the
176
+ * rail so the user can look at the app (the peek chip). `openTool` has no
177
+ * seam yet, so those buttons don't render here rather than render dead.
178
+ */
179
+ const blockHandlers = useMemo(() => ({
180
+ answer,
181
+ runAction: (action, blockId) => {
182
+ if (action.minimize) {
183
+ onMinimize?.({
184
+ mode: "bottomSheet"
185
+ });
186
+ return;
187
+ }
188
+ return runAction(action, blockId);
189
+ },
190
+ answered: state.answers,
191
+ actionState: state.actionState,
192
+ busy: state.busy,
193
+ supports: {
194
+ openTool: false,
195
+ minimize: !!onMinimize,
196
+ dispatch: true
197
+ }
198
+ }), [answer, runAction, onMinimize, state.answers, state.actionState, state.busy]);
199
+
200
+ // The last assistant turn carrying an error is the only "it went wrong"
201
+ // signal the header can read; it clears as soon as the next send starts.
202
+ const lastMessage = state.messages[state.messages.length - 1];
203
+ const failed = !state.busy && lastMessage?.role === "assistant" && !!lastMessage.error;
204
+ const header = /*#__PURE__*/_jsx(AskBuoyHeader, {
205
+ configured: configured,
206
+ busy: state.busy,
207
+ failed: failed,
208
+ activeLabel: activeLabel,
209
+ toolCount: toolCount,
210
+ hasMessages: state.messages.length > 0,
211
+ onBack: onBack,
212
+ onReset: confirmReset
213
+ });
214
+ return /*#__PURE__*/_jsx(JsModal, {
215
+ visible: visible,
216
+ onClose: onClose
217
+ // The message list is the only scroller. JsModal's default wrapper is
218
+ // flexGrow:1, which makes a nested flex:1 scroller resolve against the
219
+ // content and never scroll at all.
220
+ ,
221
+ disableScrollWrapper: true
222
+ // ToolBackground is an animated star field. A chat re-renders on every
223
+ // streamed token; two continuous animations competing is a dropped
224
+ // frame budget for no benefit.
225
+ ,
226
+ background: false,
227
+ initialHeight: 560,
228
+ animatedHeight: sheetHeight,
229
+ header: {
230
+ customContent: header,
231
+ showToggleButton: false
232
+ },
233
+ onBack: onBack,
234
+ onMinimize: onMinimize,
235
+ persistenceKey: persistenceKey ?? "buoy-ask-buoy",
236
+ enablePersistence: true,
237
+ children: /*#__PURE__*/_jsx(BlockHandlersProvider, {
238
+ value: blockHandlers,
239
+ children: /*#__PURE__*/_jsxs(View, {
240
+ style: [styles.root, {
241
+ paddingBottom: insets.bottom
242
+ }],
243
+ children: [/*#__PURE__*/_jsx(ChangesBar, {
244
+ ledger: askBuoyStore.getLedger(),
245
+ onUndoAll: undoAll,
246
+ expanded: changesOpen,
247
+ onToggle: toggleChanges
248
+ }), state.notice && /*#__PURE__*/_jsxs(View, {
249
+ style: styles.notice,
250
+ testID: "buoy-ask-buoy-notice",
251
+ children: [/*#__PURE__*/_jsx(Info, {
252
+ size: 14,
253
+ color: night.color.info
254
+ }), /*#__PURE__*/_jsx(Text, {
255
+ style: styles.noticeText,
256
+ children: state.notice
257
+ })]
258
+ }), /*#__PURE__*/_jsx(KeyboardAvoidingView, {
259
+ style: styles.flex
260
+ // iOS only: Android's default softwareKeyboardLayoutMode is "resize",
261
+ // so the window shrinks and a bottom-anchored view rides up already.
262
+ // Padding on both would lift the composer twice.
263
+ ,
264
+ behavior: Platform.OS === "ios" ? "padding" : undefined,
265
+ enabled: Platform.OS === "ios",
266
+ keyboardVerticalOffset: insets.bottom,
267
+ children: /*#__PURE__*/_jsxs(FeatureGate, {
268
+ featureName: "Ask Buoy",
269
+ children: [/*#__PURE__*/_jsx(MessageList, {
270
+ messages: state.messages,
271
+ onRetry: retry,
272
+ ListEmptyComponent: /*#__PURE__*/_jsx(EmptyState, {
273
+ configured: configured,
274
+ onPick: send
275
+ })
276
+ }), state.pending && /*#__PURE__*/_jsx(ApprovalCard, {
277
+ pending: state.pending,
278
+ onAnswer: approve
279
+ }), /*#__PURE__*/_jsx(Composer, {
280
+ onSend: send,
281
+ onStop: stop,
282
+ busy: state.busy,
283
+ disabled: !configured,
284
+ placeholder: state.queued ? "Queued — sends when this turn finishes" : state.awaitingBlockId ? "Pick an option above, or type…" : undefined
285
+ })]
286
+ })
287
+ })]
288
+ })
289
+ })
290
+ });
291
+ }
292
+ const styles = StyleSheet.create({
293
+ // Transparent or it paints over the sheet's own chrome — the convention is
294
+ // repeated verbatim across every Buoy tool body.
295
+ root: {
296
+ flex: 1,
297
+ backgroundColor: "transparent"
298
+ },
299
+ flex: {
300
+ flex: 1
301
+ },
302
+ notice: {
303
+ flexDirection: "row",
304
+ alignItems: "flex-start",
305
+ gap: 8,
306
+ paddingHorizontal: night.gutter,
307
+ paddingVertical: 10,
308
+ backgroundColor: night.color.infoSoft
309
+ },
310
+ noticeText: {
311
+ flex: 1,
312
+ color: night.color.text,
313
+ fontSize: night.font.caption,
314
+ lineHeight: 18
315
+ }
316
+ });
317
+ //# sourceMappingURL=AskBuoyModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useCallback","useEffect","useMemo","useRef","useState","Alert","Animated","KeyboardAvoidingView","Platform","StyleSheet","Text","View","isReversible","dispatchToolAction","FeatureGate","Info","JsModal","night","useSafeAreaInsets","BlockHandlersProvider","ApprovalCard","ChangesBar","Composer","AskBuoyHeader","EmptyState","MessageList","askBuoyStore","useAskBuoy","jsx","_jsx","jsxs","_jsxs","AskBuoyModal","visible","onClose","onBack","onMinimize","persistenceKey","config","state","send","stop","reset","approve","retry","answer","runAction","configured","toolCount","changesOpen","setChangesOpen","insets","minBottom","undoAll","ledger","getLedger","outcome","revertAll","failed","length","setNotice","detail","map","f","label","error","join","toggleChanges","v","sheetHeight","Value","current","peeking","runPeek","stopAnimation","from","restoreTo","timing","toValue","duration","useNativeDriver","start","setTimeout","spring","friction","peekKey","last","messages","role","peeks","blocks","filter","p","block","kind","id","prevPeekKey","peek","confirmReset","reversible","list","e","undoneAt","effect","alert","text","onPress","l","style","activeLabel","streaming","toolCalls","find","c","status","blockHandlers","action","blockId","minimize","mode","answered","answers","actionState","busy","supports","openTool","dispatch","lastMessage","header","hasMessages","onReset","disableScrollWrapper","background","initialHeight","animatedHeight","customContent","showToggleButton","enablePersistence","children","value","styles","root","paddingBottom","bottom","onUndoAll","expanded","onToggle","notice","testID","size","color","info","noticeText","flex","behavior","OS","undefined","enabled","keyboardVerticalOffset","featureName","onRetry","ListEmptyComponent","onPick","pending","onAnswer","onSend","onStop","disabled","placeholder","queued","awaitingBlockId","create","backgroundColor","flexDirection","alignItems","gap","paddingHorizontal","gutter","paddingVertical","infoSoft","fontSize","font","caption","lineHeight"],"sourceRoot":"../../../src","sources":["components/AskBuoyModal.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACzE,SACEC,KAAK,EACLC,QAAQ,EACRC,oBAAoB,EACpBC,QAAQ,EACRC,UAAU,EACVC,IAAI,EACJC,IAAI,QACC,cAAc;AACrB,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SACEC,kBAAkB,EAClBC,WAAW,EACXC,IAAI,EACJC,OAAO,EACPC,KAAK,EACLC,iBAAiB,QACZ,oBAAoB;AAG3B,SAASC,qBAAqB,QAA4B,WAAW;AACrE,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,UAAU,QAAQ,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAajD,OAAO,SAASC,YAAYA,CAAC;EAC3BC,OAAO;EACPC,OAAO;EACPC,MAAM;EACNC,UAAU;EACVC,cAAc;EACdC;AACiB,CAAC,EAAE;EACpB,MAAM;IAAEC,KAAK;IAAEC,IAAI;IAAEC,IAAI;IAAEC,KAAK;IAAEC,O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