@buoy-gg/ask-buoy 7.0.33 → 7.0.34

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 (153) hide show
  1. package/README.md +1 -1
  2. package/lib/commonjs/blocks/AskBlocks.js +1 -338
  3. package/lib/commonjs/blocks/BlockRenderer.js +1 -250
  4. package/lib/commonjs/blocks/ChromePrototypes.js +1 -514
  5. package/lib/commonjs/blocks/DataBlocks.js +1 -545
  6. package/lib/commonjs/blocks/ExtraBlocks.js +1 -1821
  7. package/lib/commonjs/blocks/MediaBlocks.js +1 -140
  8. package/lib/commonjs/blocks/ReceiptBlocks.js +1 -596
  9. package/lib/commonjs/blocks/context.js +1 -42
  10. package/lib/commonjs/blocks/icons.js +1 -96
  11. package/lib/commonjs/blocks/index.js +1 -95
  12. package/lib/commonjs/blocks/primitives.js +1 -312
  13. package/lib/commonjs/blocks/primitivesIndex.js +1 -56
  14. package/lib/commonjs/components/ApprovalCard.js +1 -140
  15. package/lib/commonjs/components/AskBuoyHeader.js +1 -127
  16. package/lib/commonjs/components/AskBuoyIcon.js +1 -19
  17. package/lib/commonjs/components/AskBuoyModal.js +1 -322
  18. package/lib/commonjs/components/ChangesBar.js +1 -211
  19. package/lib/commonjs/components/Composer.js +1 -175
  20. package/lib/commonjs/components/EmptyState.js +1 -154
  21. package/lib/commonjs/components/Markdown.js +1 -252
  22. package/lib/commonjs/components/MessageList.js +1 -648
  23. package/lib/commonjs/components/TypingDots.js +1 -63
  24. package/lib/commonjs/index.js +1 -205
  25. package/lib/commonjs/preset.js +1 -90
  26. package/lib/commonjs/store/askBuoyStore.js +1 -279
  27. package/lib/commonjs/store/useAskBuoy.js +1 -299
  28. package/lib/commonjs/sync/askBuoySyncAdapter.js +1 -119
  29. package/lib/commonjs/sync/askBuoySyncAdapter.test.js +1 -136
  30. package/lib/commonjs/sync/wire.js +1 -58
  31. package/lib/commonjs/types.js +1 -6
  32. package/lib/module/blocks/AskBlocks.js +1 -331
  33. package/lib/module/blocks/BlockRenderer.js +1 -245
  34. package/lib/module/blocks/ChromePrototypes.js +1 -503
  35. package/lib/module/blocks/DataBlocks.js +1 -532
  36. package/lib/module/blocks/ExtraBlocks.js +1 -1794
  37. package/lib/module/blocks/MediaBlocks.js +1 -135
  38. package/lib/module/blocks/ReceiptBlocks.js +1 -584
  39. package/lib/module/blocks/context.js +1 -35
  40. package/lib/module/blocks/icons.js +1 -91
  41. package/lib/module/blocks/index.js +1 -8
  42. package/lib/module/blocks/primitives.js +1 -301
  43. package/lib/module/blocks/primitivesIndex.js +1 -5
  44. package/lib/module/components/ApprovalCard.js +1 -135
  45. package/lib/module/components/AskBuoyHeader.js +1 -124
  46. package/lib/module/components/AskBuoyIcon.js +1 -8
  47. package/lib/module/components/AskBuoyModal.js +1 -317
  48. package/lib/module/components/ChangesBar.js +1 -206
  49. package/lib/module/components/Composer.js +1 -170
  50. package/lib/module/components/EmptyState.js +1 -149
  51. package/lib/module/components/Markdown.js +1 -246
  52. package/lib/module/components/MessageList.js +1 -642
  53. package/lib/module/components/TypingDots.js +1 -58
  54. package/lib/module/index.js +1 -29
  55. package/lib/module/preset.js +1 -73
  56. package/lib/module/store/askBuoyStore.js +1 -275
  57. package/lib/module/store/useAskBuoy.js +1 -293
  58. package/lib/module/sync/askBuoySyncAdapter.js +1 -114
  59. package/lib/module/sync/askBuoySyncAdapter.test.js +1 -135
  60. package/lib/module/sync/wire.js +1 -47
  61. package/lib/module/types.js +1 -4
  62. package/lib/typescript/preset.d.ts +1 -1
  63. package/package.json +8 -8
  64. package/lib/commonjs/blocks/AskBlocks.js.map +0 -1
  65. package/lib/commonjs/blocks/BlockRenderer.js.map +0 -1
  66. package/lib/commonjs/blocks/ChromePrototypes.js.map +0 -1
  67. package/lib/commonjs/blocks/DataBlocks.js.map +0 -1
  68. package/lib/commonjs/blocks/ExtraBlocks.js.map +0 -1
  69. package/lib/commonjs/blocks/MediaBlocks.js.map +0 -1
  70. package/lib/commonjs/blocks/ReceiptBlocks.js.map +0 -1
  71. package/lib/commonjs/blocks/context.js.map +0 -1
  72. package/lib/commonjs/blocks/icons.js.map +0 -1
  73. package/lib/commonjs/blocks/index.js.map +0 -1
  74. package/lib/commonjs/blocks/primitives.js.map +0 -1
  75. package/lib/commonjs/blocks/primitivesIndex.js.map +0 -1
  76. package/lib/commonjs/components/ApprovalCard.js.map +0 -1
  77. package/lib/commonjs/components/AskBuoyHeader.js.map +0 -1
  78. package/lib/commonjs/components/AskBuoyIcon.js.map +0 -1
  79. package/lib/commonjs/components/AskBuoyModal.js.map +0 -1
  80. package/lib/commonjs/components/ChangesBar.js.map +0 -1
  81. package/lib/commonjs/components/Composer.js.map +0 -1
  82. package/lib/commonjs/components/EmptyState.js.map +0 -1
  83. package/lib/commonjs/components/Markdown.js.map +0 -1
  84. package/lib/commonjs/components/MessageList.js.map +0 -1
  85. package/lib/commonjs/components/TypingDots.js.map +0 -1
  86. package/lib/commonjs/index.js.map +0 -1
  87. package/lib/commonjs/preset.js.map +0 -1
  88. package/lib/commonjs/store/askBuoyStore.js.map +0 -1
  89. package/lib/commonjs/store/useAskBuoy.js.map +0 -1
  90. package/lib/commonjs/sync/askBuoySyncAdapter.js.map +0 -1
  91. package/lib/commonjs/sync/askBuoySyncAdapter.test.js.map +0 -1
  92. package/lib/commonjs/sync/wire.js.map +0 -1
  93. package/lib/commonjs/types.js.map +0 -1
  94. package/lib/module/blocks/AskBlocks.js.map +0 -1
  95. package/lib/module/blocks/BlockRenderer.js.map +0 -1
  96. package/lib/module/blocks/ChromePrototypes.js.map +0 -1
  97. package/lib/module/blocks/DataBlocks.js.map +0 -1
  98. package/lib/module/blocks/ExtraBlocks.js.map +0 -1
  99. package/lib/module/blocks/MediaBlocks.js.map +0 -1
  100. package/lib/module/blocks/ReceiptBlocks.js.map +0 -1
  101. package/lib/module/blocks/context.js.map +0 -1
  102. package/lib/module/blocks/icons.js.map +0 -1
  103. package/lib/module/blocks/index.js.map +0 -1
  104. package/lib/module/blocks/primitives.js.map +0 -1
  105. package/lib/module/blocks/primitivesIndex.js.map +0 -1
  106. package/lib/module/components/ApprovalCard.js.map +0 -1
  107. package/lib/module/components/AskBuoyHeader.js.map +0 -1
  108. package/lib/module/components/AskBuoyIcon.js.map +0 -1
  109. package/lib/module/components/AskBuoyModal.js.map +0 -1
  110. package/lib/module/components/ChangesBar.js.map +0 -1
  111. package/lib/module/components/Composer.js.map +0 -1
  112. package/lib/module/components/EmptyState.js.map +0 -1
  113. package/lib/module/components/Markdown.js.map +0 -1
  114. package/lib/module/components/MessageList.js.map +0 -1
  115. package/lib/module/components/TypingDots.js.map +0 -1
  116. package/lib/module/index.js.map +0 -1
  117. package/lib/module/preset.js.map +0 -1
  118. package/lib/module/store/askBuoyStore.js.map +0 -1
  119. package/lib/module/store/useAskBuoy.js.map +0 -1
  120. package/lib/module/sync/askBuoySyncAdapter.js.map +0 -1
  121. package/lib/module/sync/askBuoySyncAdapter.test.js.map +0 -1
  122. package/lib/module/sync/wire.js.map +0 -1
  123. package/lib/module/types.js.map +0 -1
  124. package/lib/typescript/blocks/AskBlocks.d.ts.map +0 -1
  125. package/lib/typescript/blocks/BlockRenderer.d.ts.map +0 -1
  126. package/lib/typescript/blocks/ChromePrototypes.d.ts.map +0 -1
  127. package/lib/typescript/blocks/DataBlocks.d.ts.map +0 -1
  128. package/lib/typescript/blocks/ExtraBlocks.d.ts.map +0 -1
  129. package/lib/typescript/blocks/MediaBlocks.d.ts.map +0 -1
  130. package/lib/typescript/blocks/ReceiptBlocks.d.ts.map +0 -1
  131. package/lib/typescript/blocks/context.d.ts.map +0 -1
  132. package/lib/typescript/blocks/icons.d.ts.map +0 -1
  133. package/lib/typescript/blocks/index.d.ts.map +0 -1
  134. package/lib/typescript/blocks/primitives.d.ts.map +0 -1
  135. package/lib/typescript/blocks/primitivesIndex.d.ts.map +0 -1
  136. package/lib/typescript/components/ApprovalCard.d.ts.map +0 -1
  137. package/lib/typescript/components/AskBuoyHeader.d.ts.map +0 -1
  138. package/lib/typescript/components/AskBuoyIcon.d.ts.map +0 -1
  139. package/lib/typescript/components/AskBuoyModal.d.ts.map +0 -1
  140. package/lib/typescript/components/ChangesBar.d.ts.map +0 -1
  141. package/lib/typescript/components/Composer.d.ts.map +0 -1
  142. package/lib/typescript/components/EmptyState.d.ts.map +0 -1
  143. package/lib/typescript/components/Markdown.d.ts.map +0 -1
  144. package/lib/typescript/components/MessageList.d.ts.map +0 -1
  145. package/lib/typescript/components/TypingDots.d.ts.map +0 -1
  146. package/lib/typescript/index.d.ts.map +0 -1
  147. package/lib/typescript/preset.d.ts.map +0 -1
  148. package/lib/typescript/store/askBuoyStore.d.ts.map +0 -1
  149. package/lib/typescript/store/useAskBuoy.d.ts.map +0 -1
  150. package/lib/typescript/sync/askBuoySyncAdapter.d.ts.map +0 -1
  151. package/lib/typescript/sync/askBuoySyncAdapter.test.d.ts.map +0 -1
  152. package/lib/typescript/sync/wire.d.ts.map +0 -1
  153. package/lib/typescript/types.d.ts.map +0 -1
@@ -1,514 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.EditableUserBubble = EditableUserBubble;
7
- exports.ElapsedRow = ElapsedRow;
8
- exports.MessageActions = MessageActions;
9
- exports.QueuedComposer = QueuedComposer;
10
- exports.ReasoningStrip = ReasoningStrip;
11
- exports.ReloadDivider = ReloadDivider;
12
- exports.Timestamp = Timestamp;
13
- var _react = require("react");
14
- var _reactNative = require("react-native");
15
- var _sharedUi = require("@buoy-gg/shared-ui");
16
- var _context = require("./context");
17
- var _jsxRuntime = require("react/jsx-runtime");
18
- /**
19
- * Conversation chrome from the survey — NOT blocks. Prototypes for the review
20
- * page so each can be judged before it is wired into the real transcript:
21
- * message actions, a reasoning strip, elapsed time on a running step, a
22
- * queued-message composer state, timestamps + a reload divider, and an
23
- * editable user bubble with a branch affordance.
24
- */
25
-
26
- function IconButton({
27
- label,
28
- onPress,
29
- children
30
- }) {
31
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
32
- onPress: onPress,
33
- accessibilityRole: "button",
34
- accessibilityLabel: label,
35
- style: ({
36
- pressed
37
- }) => [styles.iconBtn, pressed && styles.pressed],
38
- children: children
39
- });
40
- }
41
-
42
- /** Copy · Retry · 👍 👎 · Share, under an assistant message. */
43
- function MessageActions({
44
- id = "chrome-actions"
45
- }) {
46
- const h = (0, _context.useBlockHandlers)();
47
- const [vote, setVote] = (0, _react.useState)(null);
48
- const fire = label => void h.runAction({
49
- label,
50
- send: `__chrome__:${label}`
51
- }, id);
52
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
53
- style: styles.actions,
54
- testID: "chrome-message-actions",
55
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(IconButton, {
56
- label: "Copy",
57
- onPress: () => fire("copy"),
58
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Copy, {
59
- size: 13,
60
- color: _sharedUi.night.color.textSecondary
61
- })
62
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(IconButton, {
63
- label: "Retry",
64
- onPress: () => fire("retry"),
65
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.RefreshCw, {
66
- size: 13,
67
- color: _sharedUi.night.color.textSecondary
68
- })
69
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(IconButton, {
70
- label: "Good answer",
71
- onPress: () => {
72
- setVote("up");
73
- fire("thumbs up");
74
- },
75
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
76
- style: [styles.glyph, vote === "up" && styles.glyphOn],
77
- children: "\uD83D\uDC4D"
78
- })
79
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(IconButton, {
80
- label: "Bad answer",
81
- onPress: () => {
82
- setVote("down");
83
- fire("thumbs down");
84
- },
85
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
86
- style: [styles.glyph, vote === "down" && styles.glyphOn],
87
- children: "\uD83D\uDC4E"
88
- })
89
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(IconButton, {
90
- label: "Export",
91
- onPress: () => fire("export transcript"),
92
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
93
- style: styles.textBtn,
94
- children: "Export"
95
- })
96
- })]
97
- });
98
- }
99
-
100
- /** Collapsible "what I'm doing / what I thought" strip. */
101
- function ReasoningStrip({
102
- text,
103
- live
104
- }) {
105
- const [open, setOpen] = (0, _react.useState)(false);
106
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
107
- style: styles.reasoning,
108
- testID: "chrome-reasoning",
109
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
110
- onPress: () => setOpen(v => !v),
111
- style: styles.reasoningHead,
112
- accessibilityRole: "button",
113
- accessibilityState: {
114
- expanded: open
115
- },
116
- children: [live ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
117
- size: "small",
118
- color: _sharedUi.night.color.textTertiary
119
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
120
- style: styles.reasoningTitle,
121
- children: live ? "Working it out…" : "How I got here"
122
- }), open ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronDown, {
123
- size: 12,
124
- color: _sharedUi.night.color.textTertiary
125
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronRight, {
126
- size: 12,
127
- color: _sharedUi.night.color.textTertiary
128
- })]
129
- }), open ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
130
- style: styles.reasoningBody,
131
- children: text
132
- }) : null]
133
- });
134
- }
135
-
136
- /** A running activity row with elapsed time. */
137
- function ElapsedRow({
138
- label
139
- }) {
140
- const [ms, setMs] = (0, _react.useState)(0);
141
- (0, _react.useEffect)(() => {
142
- const t = setInterval(() => setMs(m => m + 250), 250);
143
- return () => clearInterval(t);
144
- }, []);
145
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
146
- style: styles.elapsed,
147
- testID: "chrome-elapsed",
148
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
149
- size: "small",
150
- color: _sharedUi.night.color.textSecondary
151
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
152
- style: styles.elapsedLabel,
153
- children: label
154
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
155
- style: styles.elapsedMs,
156
- children: [(ms / 1000).toFixed(1), "s"]
157
- })]
158
- });
159
- }
160
-
161
- /** Composer while the agent is busy: type now, it sends when the turn ends. */
162
- function QueuedComposer() {
163
- const [text, setText] = (0, _react.useState)("");
164
- const [queued, setQueued] = (0, _react.useState)(null);
165
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
166
- style: styles.composerWrap,
167
- testID: "chrome-queue",
168
- children: [queued ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
169
- style: styles.queuedRow,
170
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
171
- style: styles.queuedText,
172
- numberOfLines: 1,
173
- children: ["Queued: \"", queued, "\""]
174
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
175
- onPress: () => setQueued(null),
176
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
177
- style: styles.queuedCancel,
178
- children: "Cancel"
179
- })
180
- })]
181
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
182
- style: styles.composer,
183
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
184
- style: styles.composerInput,
185
- value: text,
186
- onChangeText: setText,
187
- placeholder: "Agent is busy \u2014 type and it sends next",
188
- placeholderTextColor: _sharedUi.night.color.placeholder
189
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
190
- disabled: !text.trim(),
191
- onPress: () => {
192
- setQueued(text.trim());
193
- setText("");
194
- },
195
- style: [styles.queueBtn, !text.trim() && {
196
- opacity: 0.5
197
- }],
198
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
199
- style: styles.queueBtnText,
200
- children: "Queue"
201
- })
202
- })]
203
- })]
204
- });
205
- }
206
-
207
- /** "9:41 · 3 min ago" on long-press, and a divider when the app reloaded. */
208
- function ReloadDivider({
209
- at
210
- }) {
211
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
212
- style: styles.divider,
213
- testID: "chrome-divider",
214
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
215
- style: styles.dividerLine
216
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
217
- style: styles.dividerText,
218
- children: ["App reloaded \xB7 ", at]
219
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
220
- style: styles.dividerLine
221
- })]
222
- });
223
- }
224
- function Timestamp({
225
- at
226
- }) {
227
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
228
- style: styles.timestamp,
229
- children: at
230
- });
231
- }
232
-
233
- /** A user bubble you can edit (re-run from here) or branch. */
234
- function EditableUserBubble({
235
- text
236
- }) {
237
- const h = (0, _context.useBlockHandlers)();
238
- const [editing, setEditing] = (0, _react.useState)(false);
239
- const [value, setValue] = (0, _react.useState)(text);
240
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
241
- style: styles.userWrap,
242
- testID: "chrome-edit-bubble",
243
- children: editing ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
244
- style: styles.editBox,
245
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
246
- style: styles.editInput,
247
- value: value,
248
- onChangeText: setValue,
249
- multiline: true
250
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
251
- style: styles.editActions,
252
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
253
- onPress: () => {
254
- setEditing(false);
255
- void h.runAction({
256
- label: "re-run edited",
257
- send: `__chrome__:re-run "${value}"`
258
- }, "chrome-edit");
259
- },
260
- style: styles.editPrimary,
261
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
262
- style: styles.editPrimaryText,
263
- children: "Re-run from here"
264
- })
265
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
266
- onPress: () => {
267
- setEditing(false);
268
- void h.runAction({
269
- label: "branch",
270
- send: `__chrome__:branch "${value}"`
271
- }, "chrome-edit");
272
- },
273
- style: styles.editPlate,
274
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
275
- style: styles.editPlateText,
276
- children: "Branch"
277
- })
278
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
279
- onPress: () => setEditing(false),
280
- style: styles.editPlate,
281
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
282
- style: styles.editPlateText,
283
- children: "Cancel"
284
- })
285
- })]
286
- })]
287
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
288
- onLongPress: () => setEditing(true),
289
- onPress: () => setEditing(true),
290
- style: styles.bubble,
291
- accessibilityRole: "button",
292
- accessibilityLabel: "Edit message",
293
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
294
- style: styles.bubbleText,
295
- children: value
296
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
297
- style: styles.bubbleHint,
298
- children: "tap to edit \xB7 2 branches"
299
- })]
300
- })
301
- });
302
- }
303
- const styles = _reactNative.StyleSheet.create({
304
- actions: {
305
- flexDirection: "row",
306
- alignItems: "center",
307
- gap: 4,
308
- paddingHorizontal: 2
309
- },
310
- iconBtn: {
311
- paddingHorizontal: 8,
312
- paddingVertical: 6,
313
- borderRadius: _sharedUi.night.radius.badge
314
- },
315
- pressed: {
316
- backgroundColor: _sharedUi.night.color.fill
317
- },
318
- glyph: {
319
- fontSize: 13,
320
- opacity: 0.6
321
- },
322
- glyphOn: {
323
- opacity: 1
324
- },
325
- textBtn: {
326
- color: _sharedUi.night.color.textSecondary,
327
- fontSize: _sharedUi.night.font.micro,
328
- fontWeight: "600"
329
- },
330
- reasoning: {
331
- borderRadius: _sharedUi.night.radius.row,
332
- backgroundColor: _sharedUi.night.color.fill,
333
- overflow: "hidden"
334
- },
335
- reasoningHead: {
336
- flexDirection: "row",
337
- alignItems: "center",
338
- gap: 8,
339
- paddingHorizontal: 12,
340
- paddingVertical: 8
341
- },
342
- reasoningTitle: {
343
- flex: 1,
344
- color: _sharedUi.night.color.textSecondary,
345
- fontSize: _sharedUi.night.font.caption,
346
- fontStyle: "italic"
347
- },
348
- reasoningBody: {
349
- color: _sharedUi.night.color.textSecondary,
350
- fontSize: _sharedUi.night.font.caption,
351
- lineHeight: 18,
352
- paddingHorizontal: 12,
353
- paddingBottom: 10
354
- },
355
- elapsed: {
356
- flexDirection: "row",
357
- alignItems: "center",
358
- gap: 10,
359
- paddingHorizontal: 12,
360
- paddingVertical: 10,
361
- borderRadius: _sharedUi.night.radius.card,
362
- borderWidth: _reactNative.StyleSheet.hairlineWidth,
363
- borderColor: _sharedUi.night.color.border,
364
- backgroundColor: _sharedUi.night.color.surface
365
- },
366
- elapsedLabel: {
367
- flex: 1,
368
- color: _sharedUi.night.color.text,
369
- fontSize: _sharedUi.night.font.body
370
- },
371
- elapsedMs: {
372
- color: _sharedUi.night.color.textTertiary,
373
- fontSize: _sharedUi.night.font.caption,
374
- fontFamily: "Menlo"
375
- },
376
- composerWrap: {
377
- gap: 6
378
- },
379
- queuedRow: {
380
- flexDirection: "row",
381
- alignItems: "center",
382
- gap: 8,
383
- paddingHorizontal: 12,
384
- paddingVertical: 6,
385
- borderRadius: _sharedUi.night.radius.row,
386
- backgroundColor: _sharedUi.night.color.infoSoft
387
- },
388
- queuedText: {
389
- flex: 1,
390
- color: _sharedUi.night.color.text,
391
- fontSize: _sharedUi.night.font.caption
392
- },
393
- queuedCancel: {
394
- color: _sharedUi.night.color.info,
395
- fontSize: _sharedUi.night.font.caption,
396
- fontWeight: "600"
397
- },
398
- composer: {
399
- flexDirection: "row",
400
- alignItems: "center",
401
- gap: 8
402
- },
403
- composerInput: {
404
- flex: 1,
405
- height: 40,
406
- paddingHorizontal: 16,
407
- borderRadius: 20,
408
- borderWidth: _reactNative.StyleSheet.hairlineWidth,
409
- borderColor: _sharedUi.night.color.border,
410
- backgroundColor: _sharedUi.night.color.surfaceElevated,
411
- color: _sharedUi.night.color.text,
412
- fontSize: _sharedUi.night.font.body
413
- },
414
- queueBtn: {
415
- paddingHorizontal: 14,
416
- height: 40,
417
- borderRadius: 20,
418
- backgroundColor: _sharedUi.night.color.button,
419
- alignItems: "center",
420
- justifyContent: "center"
421
- },
422
- queueBtnText: {
423
- color: _sharedUi.night.color.text,
424
- fontSize: _sharedUi.night.font.caption,
425
- fontWeight: "600"
426
- },
427
- divider: {
428
- flexDirection: "row",
429
- alignItems: "center",
430
- gap: 10,
431
- paddingVertical: 4
432
- },
433
- dividerLine: {
434
- flex: 1,
435
- height: _reactNative.StyleSheet.hairlineWidth,
436
- backgroundColor: _sharedUi.night.color.border
437
- },
438
- dividerText: {
439
- color: _sharedUi.night.color.textTertiary,
440
- fontSize: _sharedUi.night.font.micro
441
- },
442
- timestamp: {
443
- alignSelf: "center",
444
- color: _sharedUi.night.color.textTertiary,
445
- fontSize: _sharedUi.night.font.micro
446
- },
447
- userWrap: {
448
- alignItems: "flex-end"
449
- },
450
- bubble: {
451
- maxWidth: "84%",
452
- paddingHorizontal: 14,
453
- paddingVertical: 9,
454
- borderRadius: 18,
455
- borderBottomRightRadius: 6,
456
- backgroundColor: _sharedUi.night.color.accentFill,
457
- borderWidth: _reactNative.StyleSheet.hairlineWidth,
458
- borderColor: _sharedUi.night.color.accentBorder,
459
- gap: 4
460
- },
461
- bubbleText: {
462
- color: _sharedUi.night.color.text,
463
- fontSize: _sharedUi.night.font.row,
464
- lineHeight: 21
465
- },
466
- bubbleHint: {
467
- color: _sharedUi.night.color.textTertiary,
468
- fontSize: 10,
469
- textAlign: "right"
470
- },
471
- editBox: {
472
- width: "100%",
473
- gap: 8
474
- },
475
- editInput: {
476
- minHeight: 60,
477
- padding: 12,
478
- borderRadius: _sharedUi.night.radius.row,
479
- backgroundColor: _sharedUi.night.color.surfaceElevated,
480
- color: _sharedUi.night.color.text,
481
- fontSize: _sharedUi.night.font.row,
482
- borderWidth: _reactNative.StyleSheet.hairlineWidth,
483
- borderColor: _sharedUi.night.color.accentBorderStrong
484
- },
485
- editActions: {
486
- flexDirection: "row",
487
- gap: 8,
488
- justifyContent: "flex-end",
489
- flexWrap: "wrap"
490
- },
491
- editPrimary: {
492
- paddingHorizontal: 12,
493
- paddingVertical: 8,
494
- borderRadius: _sharedUi.night.radius.row,
495
- backgroundColor: _sharedUi.night.color.accent
496
- },
497
- editPrimaryText: {
498
- color: _sharedUi.night.color.onAccent,
499
- fontSize: _sharedUi.night.font.caption,
500
- fontWeight: "600"
501
- },
502
- editPlate: {
503
- paddingHorizontal: 12,
504
- paddingVertical: 8,
505
- borderRadius: _sharedUi.night.radius.row,
506
- backgroundColor: _sharedUi.night.color.button
507
- },
508
- editPlateText: {
509
- color: _sharedUi.night.color.text,
510
- fontSize: _sharedUi.night.font.caption,
511
- fontWeight: "600"
512
- }
513
- });
514
- //# sourceMappingURL=ChromePrototypes.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EditableUserBubble=EditableUserBubble,exports.ElapsedRow=ElapsedRow,exports.MessageActions=MessageActions,exports.QueuedComposer=QueuedComposer,exports.ReasoningStrip=ReasoningStrip,exports.ReloadDivider=ReloadDivider,exports.Timestamp=Timestamp;var _react=require("react"),_reactNative=require("react-native"),_sharedUi=require("@buoy-gg/shared-ui"),_context=require("./context"),_jsxRuntime=require("react/jsx-runtime");function IconButton({label:e,onPress:t,children:i}){return(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:t,accessibilityRole:"button",accessibilityLabel:e,style:({pressed:e})=>[styles.iconBtn,e&&styles.pressed],children:i})}function MessageActions({id:e="chrome-actions"}){const t=(0,_context.useBlockHandlers)(),[i,r]=(0,_react.useState)(null),s=i=>{t.runAction({label:i,send:`__chrome__:${i}`},e)};return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actions,testID:"chrome-message-actions",children:[(0,_jsxRuntime.jsx)(IconButton,{label:"Copy",onPress:()=>s("copy"),children:(0,_jsxRuntime.jsx)(_sharedUi.Copy,{size:13,color:_sharedUi.night.color.textSecondary})}),(0,_jsxRuntime.jsx)(IconButton,{label:"Retry",onPress:()=>s("retry"),children:(0,_jsxRuntime.jsx)(_sharedUi.RefreshCw,{size:13,color:_sharedUi.night.color.textSecondary})}),(0,_jsxRuntime.jsx)(IconButton,{label:"Good answer",onPress:()=>{r("up"),s("thumbs up")},children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.glyph,"up"===i&&styles.glyphOn],children:"👍"})}),(0,_jsxRuntime.jsx)(IconButton,{label:"Bad answer",onPress:()=>{r("down"),s("thumbs down")},children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.glyph,"down"===i&&styles.glyphOn],children:"👎"})}),(0,_jsxRuntime.jsx)(IconButton,{label:"Export",onPress:()=>s("export transcript"),children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.textBtn,children:"Export"})})]})}function ReasoningStrip({text:e,live:t}){const[i,r]=(0,_react.useState)(!1);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.reasoning,testID:"chrome-reasoning",children:[(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{onPress:()=>r(e=>!e),style:styles.reasoningHead,accessibilityRole:"button",accessibilityState:{expanded:i},children:[t?(0,_jsxRuntime.jsx)(_reactNative.ActivityIndicator,{size:"small",color:_sharedUi.night.color.textTertiary}):null,(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.reasoningTitle,children:t?"Working it out…":"How I got here"}),i?(0,_jsxRuntime.jsx)(_sharedUi.ChevronDown,{size:12,color:_sharedUi.night.color.textTertiary}):(0,_jsxRuntime.jsx)(_sharedUi.ChevronRight,{size:12,color:_sharedUi.night.color.textTertiary})]}),i?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.reasoningBody,children:e}):null]})}function ElapsedRow({label:e}){const[t,i]=(0,_react.useState)(0);return(0,_react.useEffect)(()=>{const e=setInterval(()=>i(e=>e+250),250);return()=>clearInterval(e)},[]),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.elapsed,testID:"chrome-elapsed",children:[(0,_jsxRuntime.jsx)(_reactNative.ActivityIndicator,{size:"small",color:_sharedUi.night.color.textSecondary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.elapsedLabel,children:e}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.elapsedMs,children:[(t/1e3).toFixed(1),"s"]})]})}function QueuedComposer(){const[e,t]=(0,_react.useState)(""),[i,r]=(0,_react.useState)(null);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.composerWrap,testID:"chrome-queue",children:[i?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.queuedRow,children:[(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.queuedText,numberOfLines:1,children:['Queued: "',i,'"']}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>r(null),children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.queuedCancel,children:"Cancel"})})]}):null,(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.composer,children:[(0,_jsxRuntime.jsx)(_reactNative.TextInput,{style:styles.composerInput,value:e,onChangeText:t,placeholder:"Agent is busy — type and it sends next",placeholderTextColor:_sharedUi.night.color.placeholder}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{disabled:!e.trim(),onPress:()=>{r(e.trim()),t("")},style:[styles.queueBtn,!e.trim()&&{opacity:.5}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.queueBtnText,children:"Queue"})})]})]})}function ReloadDivider({at:e}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.divider,testID:"chrome-divider",children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dividerLine}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.dividerText,children:["App reloaded · ",e]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dividerLine})]})}function Timestamp({at:e}){return(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.timestamp,children:e})}function EditableUserBubble({text:e}){const t=(0,_context.useBlockHandlers)(),[i,r]=(0,_react.useState)(!1),[s,n]=(0,_react.useState)(e);return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.userWrap,testID:"chrome-edit-bubble",children:i?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.editBox,children:[(0,_jsxRuntime.jsx)(_reactNative.TextInput,{style:styles.editInput,value:s,onChangeText:n,multiline:!0}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.editActions,children:[(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>{r(!1),t.runAction({label:"re-run edited",send:`__chrome__:re-run "${s}"`},"chrome-edit")},style:styles.editPrimary,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.editPrimaryText,children:"Re-run from here"})}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>{r(!1),t.runAction({label:"branch",send:`__chrome__:branch "${s}"`},"chrome-edit")},style:styles.editPlate,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.editPlateText,children:"Branch"})}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>r(!1),style:styles.editPlate,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.editPlateText,children:"Cancel"})})]})]}):(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{onLongPress:()=>r(!0),onPress:()=>r(!0),style:styles.bubble,accessibilityRole:"button",accessibilityLabel:"Edit message",children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.bubbleText,children:s}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.bubbleHint,children:"tap to edit · 2 branches"})]})})}const styles=_reactNative.StyleSheet.create({actions:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:2},iconBtn:{paddingHorizontal:8,paddingVertical:6,borderRadius:_sharedUi.night.radius.badge},pressed:{backgroundColor:_sharedUi.night.color.fill},glyph:{fontSize:13,opacity:.6},glyphOn:{opacity:1},textBtn:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.micro,fontWeight:"600"},reasoning:{borderRadius:_sharedUi.night.radius.row,backgroundColor:_sharedUi.night.color.fill,overflow:"hidden"},reasoningHead:{flexDirection:"row",alignItems:"center",gap:8,paddingHorizontal:12,paddingVertical:8},reasoningTitle:{flex:1,color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,fontStyle:"italic"},reasoningBody:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,lineHeight:18,paddingHorizontal:12,paddingBottom:10},elapsed:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:12,paddingVertical:10,borderRadius:_sharedUi.night.radius.card,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_sharedUi.night.color.border,backgroundColor:_sharedUi.night.color.surface},elapsedLabel:{flex:1,color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.body},elapsedMs:{color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.caption,fontFamily:"Menlo"},composerWrap:{gap:6},queuedRow:{flexDirection:"row",alignItems:"center",gap:8,paddingHorizontal:12,paddingVertical:6,borderRadius:_sharedUi.night.radius.row,backgroundColor:_sharedUi.night.color.infoSoft},queuedText:{flex:1,color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption},queuedCancel:{color:_sharedUi.night.color.info,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},composer:{flexDirection:"row",alignItems:"center",gap:8},composerInput:{flex:1,height:40,paddingHorizontal:16,borderRadius:20,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_sharedUi.night.color.border,backgroundColor:_sharedUi.night.color.surfaceElevated,color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.body},queueBtn:{paddingHorizontal:14,height:40,borderRadius:20,backgroundColor:_sharedUi.night.color.button,alignItems:"center",justifyContent:"center"},queueBtnText:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},divider:{flexDirection:"row",alignItems:"center",gap:10,paddingVertical:4},dividerLine:{flex:1,height:_reactNative.StyleSheet.hairlineWidth,backgroundColor:_sharedUi.night.color.border},dividerText:{color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.micro},timestamp:{alignSelf:"center",color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.micro},userWrap:{alignItems:"flex-end"},bubble:{maxWidth:"84%",paddingHorizontal:14,paddingVertical:9,borderRadius:18,borderBottomRightRadius:6,backgroundColor:_sharedUi.night.color.accentFill,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_sharedUi.night.color.accentBorder,gap:4},bubbleText:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.row,lineHeight:21},bubbleHint:{color:_sharedUi.night.color.textTertiary,fontSize:10,textAlign:"right"},editBox:{width:"100%",gap:8},editInput:{minHeight:60,padding:12,borderRadius:_sharedUi.night.radius.row,backgroundColor:_sharedUi.night.color.surfaceElevated,color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.row,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_sharedUi.night.color.accentBorderStrong},editActions:{flexDirection:"row",gap:8,justifyContent:"flex-end",flexWrap:"wrap"},editPrimary:{paddingHorizontal:12,paddingVertical:8,borderRadius:_sharedUi.night.radius.row,backgroundColor:_sharedUi.night.color.accent},editPrimaryText:{color:_sharedUi.night.color.onAccent,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},editPlate:{paddingHorizontal:12,paddingVertical:8,borderRadius:_sharedUi.night.radius.row,backgroundColor:_sharedUi.night.color.button},editPlateText:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,fontWeight:"600"}});