@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,206 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * "The agent changed things" — the bar, and the list behind it.
5
+ *
6
+ * Ask Buoy mutates without asking, so this is what keeps the user in control:
7
+ * if reality has been bent, you can never not know it. Same principle as the
8
+ * impersonate and override banners.
9
+ *
10
+ * It counts REVERSIBLE and ONE-SHOT effects separately, which is the one place
11
+ * this deliberately differs from the Scenarios banner. That one folds
12
+ * transients into a single "N changes" total and then silently no-ops on them
13
+ * at revert — a user who taps Undo, sees "4 changes", and finds three of them
14
+ * still in place learns not to trust the bar. Better to say "1 undoable ·
15
+ * 1 permanent" and be believed.
16
+ */
17
+ import { useSyncExternalStore } from "react";
18
+ import { Pressable, ScrollView, StyleSheet, Text, View } from "react-native";
19
+ import { ChevronDown, ChevronRight, night } from "@buoy-gg/shared-ui";
20
+ import { isReversible } from "@buoy-gg/agent-core";
21
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
+ const EMPTY = [];
23
+ function useLedgerEntries(ledger) {
24
+ return useSyncExternalStore(fn => ledger?.subscribe(fn) ?? (() => {}), () => ledger?.list() ?? EMPTY, () => ledger?.list() ?? EMPTY);
25
+ }
26
+ export function ChangesBar({
27
+ ledger,
28
+ onUndoAll,
29
+ expanded,
30
+ onToggle
31
+ }) {
32
+ const entries = useLedgerEntries(ledger);
33
+ const outstanding = entries.filter(e => !e.undoneAt);
34
+ // Transients — navigation, taps — are one-shot ACTIONS, not changes. Counting
35
+ // them here read "Changed this app · 9 permanent" after a read-only tour,
36
+ // which is the bar lying in the alarming direction. They still appear in the
37
+ // expanded panel's footnote, because honesty, but they raise no banner.
38
+ const changes = outstanding.filter(e => e.effect.kind !== "transient");
39
+ if (changes.length === 0) return null;
40
+ const reversible = changes.filter(e => isReversible(e.effect));
41
+ const permanent = changes.length - reversible.length;
42
+ const transients = outstanding.length - changes.length;
43
+ const Chevron = expanded ? ChevronDown : ChevronRight;
44
+ const counts = [reversible.length > 0 ? `${reversible.length} undoable` : null, permanent > 0 ? `${permanent} permanent` : null].filter(Boolean).join(" · ");
45
+ return /*#__PURE__*/_jsxs(View, {
46
+ style: styles.wrap,
47
+ children: [/*#__PURE__*/_jsxs(Pressable, {
48
+ testID: "buoy-ask-buoy-changes-bar",
49
+ accessibilityRole: "button",
50
+ accessibilityState: {
51
+ expanded
52
+ },
53
+ onPress: onToggle,
54
+ style: styles.bar,
55
+ children: [/*#__PURE__*/_jsx(View, {
56
+ style: styles.dot
57
+ }), /*#__PURE__*/_jsx(Text, {
58
+ style: styles.summary,
59
+ numberOfLines: 1,
60
+ children: "Changed this app"
61
+ }), /*#__PURE__*/_jsx(Text, {
62
+ style: styles.counts,
63
+ numberOfLines: 1,
64
+ children: counts
65
+ }), /*#__PURE__*/_jsx(Chevron, {
66
+ size: 12,
67
+ color: night.color.textSecondary
68
+ })]
69
+ }), expanded && /*#__PURE__*/_jsxs(View, {
70
+ style: styles.panel,
71
+ children: [/*#__PURE__*/_jsxs(ScrollView, {
72
+ style: styles.panelScroll,
73
+ testID: "buoy-ask-buoy-changes-scroll",
74
+ keyboardShouldPersistTaps: "handled",
75
+ children: [changes.map(entry => {
76
+ const oneOff = !isReversible(entry.effect);
77
+ return /*#__PURE__*/_jsxs(View, {
78
+ style: styles.row,
79
+ children: [/*#__PURE__*/_jsx(Text, {
80
+ style: styles.rowLabel,
81
+ children: entry.effect.label
82
+ }), /*#__PURE__*/_jsx(Text, {
83
+ style: [styles.rowTag, oneOff && styles.rowTagMuted],
84
+ children: oneOff ? "Permanent" : "Undoable"
85
+ })]
86
+ }, entry.id);
87
+ }), transients > 0 && /*#__PURE__*/_jsx(View, {
88
+ style: styles.row,
89
+ children: /*#__PURE__*/_jsxs(Text, {
90
+ style: [styles.rowLabel, styles.rowLabelMuted],
91
+ children: ["Also did ", transients, " one-shot action", transients === 1 ? "" : "s", " (navigation, taps) \u2014 nothing to undo."]
92
+ })
93
+ })]
94
+ }), /*#__PURE__*/_jsxs(View, {
95
+ style: styles.footer,
96
+ children: [reversible.length > 0 && /*#__PURE__*/_jsx(Pressable, {
97
+ testID: "buoy-ask-buoy-undo-all",
98
+ accessibilityRole: "button",
99
+ onPress: onUndoAll,
100
+ style: ({
101
+ pressed
102
+ }) => [styles.undo, pressed && styles.pressed],
103
+ children: /*#__PURE__*/_jsxs(Text, {
104
+ style: styles.undoText,
105
+ children: ["Undo ", reversible.length, " change", reversible.length === 1 ? "" : "s"]
106
+ })
107
+ }), permanent > 0 && /*#__PURE__*/_jsx(Text, {
108
+ style: styles.footnote,
109
+ children: "Permanent changes can't be undone from here."
110
+ })]
111
+ })]
112
+ })]
113
+ });
114
+ }
115
+ const styles = StyleSheet.create({
116
+ wrap: {
117
+ borderBottomWidth: StyleSheet.hairlineWidth,
118
+ borderBottomColor: night.color.border,
119
+ backgroundColor: night.color.warningSoft
120
+ },
121
+ bar: {
122
+ flexDirection: "row",
123
+ alignItems: "center",
124
+ gap: 8,
125
+ paddingHorizontal: night.gutter,
126
+ paddingVertical: 10
127
+ },
128
+ dot: {
129
+ width: 7,
130
+ height: 7,
131
+ borderRadius: 4,
132
+ backgroundColor: night.color.warning
133
+ },
134
+ summary: {
135
+ color: night.color.text,
136
+ fontSize: night.font.caption,
137
+ fontWeight: "600"
138
+ },
139
+ counts: {
140
+ flex: 1,
141
+ color: night.color.textSecondary,
142
+ fontSize: night.font.caption
143
+ },
144
+ panel: {
145
+ paddingHorizontal: night.gutter,
146
+ paddingBottom: 12,
147
+ gap: 10
148
+ },
149
+ panelScroll: {
150
+ maxHeight: 180
151
+ },
152
+ row: {
153
+ flexDirection: "row",
154
+ alignItems: "flex-start",
155
+ gap: 10,
156
+ paddingVertical: 8,
157
+ borderTopWidth: StyleSheet.hairlineWidth,
158
+ borderTopColor: night.color.separator
159
+ },
160
+ rowLabel: {
161
+ flex: 1,
162
+ color: night.color.text,
163
+ fontSize: night.font.caption,
164
+ lineHeight: 18
165
+ },
166
+ rowTag: {
167
+ color: night.color.accent,
168
+ fontSize: night.font.micro,
169
+ fontWeight: "600",
170
+ letterSpacing: 0.6,
171
+ textTransform: "uppercase",
172
+ paddingTop: 2
173
+ },
174
+ rowTagMuted: {
175
+ color: night.color.textTertiary
176
+ },
177
+ rowLabelMuted: {
178
+ color: night.color.textTertiary
179
+ },
180
+ footer: {
181
+ flexDirection: "row",
182
+ alignItems: "center",
183
+ gap: 12,
184
+ flexWrap: "wrap"
185
+ },
186
+ undo: {
187
+ paddingHorizontal: 14,
188
+ paddingVertical: 8,
189
+ borderRadius: night.radius.row,
190
+ backgroundColor: night.color.button
191
+ },
192
+ undoText: {
193
+ color: night.color.accent,
194
+ fontSize: night.font.caption,
195
+ fontWeight: "600"
196
+ },
197
+ footnote: {
198
+ flex: 1,
199
+ color: night.color.textTertiary,
200
+ fontSize: night.font.micro
201
+ },
202
+ pressed: {
203
+ opacity: 0.7
204
+ }
205
+ });
206
+ //# sourceMappingURL=ChangesBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useSyncExternalStore","Pressable","ScrollView","StyleSheet","Text","View","ChevronDown","ChevronRight","night","isReversible","jsx","_jsx","jsxs","_jsxs","EMPTY","useLedgerEntries","ledger","fn","subscribe","list","ChangesBar","onUndoAll","expanded","onToggle","entries","outstanding","filter","e","undoneAt","changes","effect","kind","length","reversible","permanent","transients","Chevron","counts","Boolean","join","style","styles","wrap","children","testID","accessibilityRole","accessibilityState","onPress","bar","dot","summary","numberOfLines","size","color","textSecondary","panel","panelScroll","keyboardShouldPersistTaps","map","entry","oneOff","row","rowLabel","label","rowTag","rowTagMuted","id","rowLabelMuted","footer","pressed","undo","undoText","footnote","create","borderBottomWidth","hairlineWidth","borderBottomColor","border","backgroundColor","warningSoft","flexDirection","alignItems","gap","paddingHorizontal","gutter","paddingVertical","width","height","borderRadius","warning","text","fontSize","font","caption","fontWeight","flex","paddingBottom","maxHeight","borderTopWidth","borderTopColor","separator","lineHeight","accent","micro","letterSpacing","textTransform","paddingTop","textTertiary","flexWrap","radius","button","opacity"],"sourceRoot":"../../../src","sources":["components/ChangesBar.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,oBAAoB,QAAQ,OAAO;AAC5C,SAASC,SAAS,EAAEC,UAAU,EAAEC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC5E,SAASC,WAAW,EAAEC,YAAY,EAAEC,KAAK,QAAQ,oBAAoB;AACrE,SAASC,YAAY,QAA6C,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AASxF,MAAMC,KAAoB,GAAG,EAAE;AAE/B,SAASC,gBAAgBA,CAACC,MAA2B,EAAiB;EACpE,OAAOhB,oBAAoB,CACxBiB,EAAE,IAAKD,MAAM,EAAEE,SAAS,CAACD,EAAE,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,EAC3C,MAAMD,MAAM,EAAEG,IAAI,CAAC,CAAC,IAAIL,KAAK,EAC7B,MAAME,MAAM,EAAEG,IAAI,CAAC,CAAC,IAAIL,KAC1B,CAAC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AE7C,KAAK,CAAC6C,KAAK,CAACsD,YAAY;IAC/BhB,QAAQ,EAAEnF,KAAK,CAACoF,IAAI,CAACW;EACvB,CAAC;EACDlC,OAAO,EAAE;IAAE0C,OAAO,EAAE;EAAI;AAC1B,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,170 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * The message box.
5
+ *
6
+ * This is the first keyboard-safe BOTTOM input in Buoy, and the reason none
7
+ * existed before is that JsModal has no keyboard handling at all: the sheet is
8
+ * `position:absolute; bottom:0` inside the app tree, not an RN `Modal`, so on
9
+ * iOS the keyboard simply draws over it. Two other tools hit this and chose to
10
+ * dodge it — NetworkNumberPrompt and StorageValueEditModal both say so in
11
+ * comments and pin their inputs to the TOP of the screen. A chat cannot.
12
+ *
13
+ * What makes it work:
14
+ * - `KeyboardAvoidingView` with `behavior="padding"`, iOS only. On Android
15
+ * Expo's default `softwareKeyboardLayoutMode: "resize"` shrinks the window
16
+ * and a bottom-anchored view rides up for free; adding padding there would
17
+ * lift it twice.
18
+ * - The parent list carries `keyboardShouldPersistTaps="handled"`. Without it
19
+ * the first tap after typing only dismisses the keyboard and Send never
20
+ * fires — a real shipped bug in Time Machine, and invisible to Detox because
21
+ * `replaceText` opens no keyboard.
22
+ * - `keyboardType="ascii-capable"`, because iOS Smart Punctuation rewrites
23
+ * straight quotes as curly ones. That permanently broke the raw-JSON editor
24
+ * in Storage, and a tester pasting a JSON blob here would hit the same wall.
25
+ *
26
+ * While the agent is working the send button becomes a STOP button — a
27
+ * square, the universal glyph — rather than a spinner in a circle, which
28
+ * looked like a disabled control and gave no hint it was tappable.
29
+ */
30
+ import { useCallback, useState } from "react";
31
+ import { Platform, Pressable, StyleSheet, Text, TextInput, View } from "react-native";
32
+ import { night } from "@buoy-gg/shared-ui";
33
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
34
+ export function Composer({
35
+ onSend,
36
+ onStop,
37
+ busy,
38
+ disabled,
39
+ placeholder
40
+ }) {
41
+ const [text, setText] = useState("");
42
+ const submit = useCallback(() => {
43
+ const value = text.trim();
44
+ if (!value) return;
45
+ setText("");
46
+ onSend(value);
47
+ }, [text, onSend]);
48
+ const canSend = text.trim().length > 0 && !busy && !disabled;
49
+ return /*#__PURE__*/_jsxs(View, {
50
+ style: styles.wrap,
51
+ children: [/*#__PURE__*/_jsx(View, {
52
+ style: [styles.field, disabled && styles.fieldDisabled],
53
+ children: /*#__PURE__*/_jsx(TextInput, {
54
+ testID: "buoy-ask-buoy-input",
55
+ style: styles.input,
56
+ value: text,
57
+ onChangeText: setText,
58
+ placeholder: placeholder ?? (disabled ? "Ask Buoy isn't set up yet" : "Ask, or tell it what to change…"),
59
+ placeholderTextColor: night.color.placeholder,
60
+ multiline: true,
61
+ editable: !disabled
62
+ // Straight quotes only — see the header note.
63
+ ,
64
+ keyboardType: "ascii-capable",
65
+ autoCorrect: true,
66
+ autoCapitalize: "sentences"
67
+ // Enter sends; Shift-Enter is not a thing on a phone keyboard, and a
68
+ // multiline box with no submit affordance strands people.
69
+ ,
70
+ blurOnSubmit: false,
71
+ onSubmitEditing: submit,
72
+ returnKeyType: "send",
73
+ maxLength: 4000
74
+ })
75
+ }), busy ? /*#__PURE__*/_jsx(Pressable, {
76
+ testID: "buoy-ask-buoy-stop",
77
+ accessibilityRole: "button",
78
+ accessibilityLabel: "Stop",
79
+ onPress: onStop,
80
+ style: ({
81
+ pressed
82
+ }) => [styles.button, styles.stop, pressed && styles.pressed],
83
+ children: /*#__PURE__*/_jsx(View, {
84
+ style: styles.stopGlyph
85
+ })
86
+ }) : /*#__PURE__*/_jsx(Pressable, {
87
+ testID: "buoy-ask-buoy-send",
88
+ accessibilityRole: "button",
89
+ accessibilityLabel: "Send",
90
+ disabled: !canSend,
91
+ onPress: submit,
92
+ style: ({
93
+ pressed
94
+ }) => [styles.button, canSend ? styles.sendOn : styles.sendOff, pressed && canSend && styles.pressed],
95
+ children: /*#__PURE__*/_jsx(Text, {
96
+ style: [styles.sendGlyph, {
97
+ color: canSend ? night.color.onAccent : night.color.textTertiary
98
+ }],
99
+ children: "\u2191"
100
+ })
101
+ })]
102
+ });
103
+ }
104
+ const styles = StyleSheet.create({
105
+ wrap: {
106
+ flexDirection: "row",
107
+ alignItems: "flex-end",
108
+ gap: 8,
109
+ paddingHorizontal: night.gutter,
110
+ paddingTop: 10,
111
+ paddingBottom: 6,
112
+ borderTopWidth: StyleSheet.hairlineWidth,
113
+ borderTopColor: night.color.border,
114
+ // Opaque: messages scroll UNDER the composer, and a translucent bar over
115
+ // moving text is unreadable.
116
+ backgroundColor: night.color.bg
117
+ },
118
+ field: {
119
+ flex: 1,
120
+ minHeight: 40,
121
+ justifyContent: "center",
122
+ borderRadius: 20,
123
+ borderWidth: StyleSheet.hairlineWidth,
124
+ borderColor: night.color.border,
125
+ backgroundColor: night.color.surfaceElevated
126
+ },
127
+ fieldDisabled: {
128
+ opacity: 0.6
129
+ },
130
+ input: {
131
+ maxHeight: 120,
132
+ paddingHorizontal: 16,
133
+ paddingTop: Platform.OS === "ios" ? 10 : 6,
134
+ paddingBottom: Platform.OS === "ios" ? 10 : 6,
135
+ color: night.color.text,
136
+ fontSize: night.font.row,
137
+ lineHeight: 20
138
+ },
139
+ button: {
140
+ width: 40,
141
+ height: 40,
142
+ borderRadius: 20,
143
+ alignItems: "center",
144
+ justifyContent: "center"
145
+ },
146
+ sendGlyph: {
147
+ fontSize: 20,
148
+ fontWeight: "700",
149
+ lineHeight: 22
150
+ },
151
+ sendOn: {
152
+ backgroundColor: night.color.accent
153
+ },
154
+ sendOff: {
155
+ backgroundColor: night.color.fill
156
+ },
157
+ stop: {
158
+ backgroundColor: night.color.fillTertiary
159
+ },
160
+ stopGlyph: {
161
+ width: 12,
162
+ height: 12,
163
+ borderRadius: 2,
164
+ backgroundColor: night.color.text
165
+ },
166
+ pressed: {
167
+ opacity: 0.7
168
+ }
169
+ });
170
+ //# sourceMappingURL=Composer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useCallback","useState","Platform","Pressable","StyleSheet","Text","TextInput","View","night","jsx","_jsx","jsxs","_jsxs","Composer","onSend","onStop","busy","disabled","placeholder","text","setText","submit","value","trim","canSend","length","style","styles","wrap","children","field","fieldDisabled","testID","input","onChangeText","placeholderTextColor","color","multiline","editable","keyboardType","autoCorrect","autoCapitalize","blurOnSubmit","onSubmitEditing","returnKeyType","maxLength","accessibilityRole","accessibilityLabel","onPress","pressed","button","stop","stopGlyph","sendOn","sendOff","sendGlyph","onAccent","textTertiary","create","flexDirection","alignItems","gap","paddingHorizontal","gutter","paddingTop","paddingBottom","borderTopWidth","hairlineWidth","borderTopColor","border","backgroundColor","bg","flex","minHeight","justifyContent","borderRadius","borderWidth","borderColor","surfaceElevated","opacity","maxHeight","OS","fontSize","font","row","lineHeight","width","height","fontWeight","accent","fill","fillTertiary"],"sourceRoot":"../../../src","sources":["components/Composer.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAC7C,SACEC,QAAQ,EACRC,SAAS,EACTC,UAAU,EACVC,IAAI,EACJC,SAAS,EACTC,IAAI,QACC,cAAc;AACrB,SAASC,KAAK,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAU3C,OAAO,SAASC,QAAQA,CAAC;EACvBC,MAAM;EACNC,MAAM;EACNC,IAAI;EACJC,QAAQ;EACRC;AACa,CAAC,EAAE;EAChB,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGnB,QAAQ,CAAC,EAAE,CAAC;EAEpC,MAAMoB,MAAM,GAAGrB,WAAW,CAAC,MAAM;IAC/B,MAAMsB,KAAK,GAAGH,IAAI,CAACI,IAAI,CAAC,CAA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9D,KAAK,CAAC4B,KAAK,CAACuD;EAAa,CAAC;EACnDvC,SAAS,EAAE;IACTkC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVZ,YAAY,EAAE,CAAC;IACfL,eAAe,EAAE9D,KAAK,CAAC4B,KAAK,CAACjB;EAC/B,CAAC;EACD8B,OAAO,EAAE;IAAE8B,OAAO,EAAE;EAAI;AAC1B,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,149 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * The first screen.
5
+ *
6
+ * Written for someone who has never used a devtool. The suggestions are not
7
+ * decoration — they are the fastest way to teach a tester what kind of sentence
8
+ * works here, and they are phrased as outcomes ("why is this screen empty?")
9
+ * rather than as tool names, because the tools are the thing this feature
10
+ * exists to hide.
11
+ */
12
+ import { Pressable, StyleSheet, Text, View } from "react-native";
13
+ import { ChevronRight, night, NightSectionLabel } from "@buoy-gg/shared-ui";
14
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
+ const isRelease = typeof __DEV__ !== "undefined" && !__DEV__;
16
+ const SUGGESTIONS = ["Why is this screen empty?", "What did the last few network calls return?", "Show me what's saved for this user", "Make the next request to this screen fail with a 500"];
17
+ export function EmptyState({
18
+ configured,
19
+ onPick
20
+ }) {
21
+ if (!configured) {
22
+ return /*#__PURE__*/_jsxs(View, {
23
+ style: styles.wrap,
24
+ testID: "buoy-ask-buoy-unconfigured",
25
+ children: [/*#__PURE__*/_jsx(Text, {
26
+ style: styles.title,
27
+ children: "Not set up yet"
28
+ }), /*#__PURE__*/_jsxs(Text, {
29
+ style: styles.body,
30
+ children: ["Ask Buoy talks to your own company's AI endpoint \u2014 nothing goes to Buoy. A developer needs to add the ", /*#__PURE__*/_jsx(Text, {
31
+ style: styles.code,
32
+ children: "askBuoy"
33
+ }), " prop to", " ", /*#__PURE__*/_jsx(Text, {
34
+ style: styles.code,
35
+ children: "<FloatingDevTools />"
36
+ }), " with your team's endpoint and model."]
37
+ })]
38
+ });
39
+ }
40
+ return /*#__PURE__*/_jsxs(View, {
41
+ style: styles.wrap,
42
+ testID: "buoy-ask-buoy-empty",
43
+ children: [/*#__PURE__*/_jsx(Text, {
44
+ style: styles.title,
45
+ children: "Ask about this app"
46
+ }), /*#__PURE__*/_jsx(Text, {
47
+ style: styles.body,
48
+ children: "Ask what the app is doing right now, or tell it to change something. Anything it changes shows up in a bar at the top, and you can undo it."
49
+ }), /*#__PURE__*/_jsx(Text, {
50
+ style: styles.buildLine,
51
+ testID: "buoy-ask-buoy-build-line",
52
+ children: isRelease ? "Release build — reading, impersonation and navigation work; simulations (forcing server responses, driving the screen) need a dev build." : "Dev build — full simulation available."
53
+ }), /*#__PURE__*/_jsxs(View, {
54
+ style: styles.group,
55
+ children: [/*#__PURE__*/_jsx(NightSectionLabel, {
56
+ children: "Try asking"
57
+ }), /*#__PURE__*/_jsx(View, {
58
+ style: styles.card,
59
+ children: SUGGESTIONS.map((s, i) => /*#__PURE__*/_jsx(Suggestion, {
60
+ text: s,
61
+ onPick: onPick,
62
+ last: i === SUGGESTIONS.length - 1
63
+ }, s))
64
+ })]
65
+ })]
66
+ });
67
+ }
68
+ function Suggestion({
69
+ text,
70
+ onPick,
71
+ last
72
+ }) {
73
+ return /*#__PURE__*/_jsxs(Pressable, {
74
+ testID: `buoy-ask-buoy-suggestion-${text.slice(0, 12)}`,
75
+ accessibilityRole: "button",
76
+ onPress: () => onPick(text),
77
+ style: ({
78
+ pressed
79
+ }) => [styles.row, !last && styles.rowDivider, pressed && styles.pressed],
80
+ children: [/*#__PURE__*/_jsx(Text, {
81
+ style: styles.rowText,
82
+ children: text
83
+ }), /*#__PURE__*/_jsx(ChevronRight, {
84
+ size: 14,
85
+ color: night.color.textTertiary
86
+ })]
87
+ });
88
+ }
89
+ const styles = StyleSheet.create({
90
+ wrap: {
91
+ flex: 1,
92
+ justifyContent: "center",
93
+ paddingHorizontal: night.gutter,
94
+ paddingVertical: 24,
95
+ gap: 8
96
+ },
97
+ title: {
98
+ color: night.color.text,
99
+ fontSize: 22,
100
+ fontWeight: "700",
101
+ letterSpacing: -0.3
102
+ },
103
+ body: {
104
+ color: night.color.textSecondary,
105
+ fontSize: night.font.body,
106
+ lineHeight: 20
107
+ },
108
+ code: {
109
+ color: night.color.text,
110
+ fontFamily: "Menlo"
111
+ },
112
+ buildLine: {
113
+ marginTop: 8,
114
+ color: night.color.textTertiary,
115
+ fontSize: night.font.micro,
116
+ lineHeight: 15
117
+ },
118
+ group: {
119
+ marginTop: night.groupGap - 8
120
+ },
121
+ card: {
122
+ borderRadius: night.radius.card,
123
+ borderWidth: StyleSheet.hairlineWidth,
124
+ borderColor: night.color.border,
125
+ backgroundColor: night.color.surface,
126
+ overflow: "hidden"
127
+ },
128
+ row: {
129
+ flexDirection: "row",
130
+ alignItems: "center",
131
+ gap: 10,
132
+ paddingHorizontal: night.rowPadH,
133
+ paddingVertical: 13
134
+ },
135
+ rowDivider: {
136
+ borderBottomWidth: StyleSheet.hairlineWidth,
137
+ borderBottomColor: night.color.separator
138
+ },
139
+ rowText: {
140
+ flex: 1,
141
+ color: night.color.text,
142
+ fontSize: night.font.body,
143
+ lineHeight: 19
144
+ },
145
+ pressed: {
146
+ backgroundColor: night.color.fill
147
+ }
148
+ });
149
+ //# sourceMappingURL=EmptyState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Pressable","StyleSheet","Text","View","ChevronRight","night","NightSectionLabel","jsx","_jsx","jsxs","_jsxs","isRelease","__DEV__","SUGGESTIONS","EmptyState","configured","onPick","style","styles","wrap","testID","children","title","body","code","buildLine","group","card","map","s","i","Suggestion","text","last","length","slice","accessibilityRole","onPress","pressed","row","rowDivider","rowText","size","color","textTertiary","create","flex","justifyContent","paddingHorizontal","gutter","paddingVertical","gap","fontSize","fontWeight","letterSpacing","textSecondary","font","lineHeight","fontFamily","marginTop","micro","groupGap","borderRadius","radius","borderWidth","hairlineWidth","borderColor","border","backgroundColor","surface","overflow","flexDirection","alignItems","rowPadH","borderBottomWidth","borderBottomColor","separator","fill"],"sourceRoot":"../../../src","sources":["components/EmptyState.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAChE,SAASC,YAAY,EAAEC,KAAK,EAAEC,iBAAiB,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE5E,MAAMC,SAAS,GAAG,OAAOC,OAAO,KAAK,WAAW,IAAI,CAACA,OAAO;AAE5D,MAAMC,WAAW,GAAG,CAClB,2BAA2B,EAC3B,6CAA6C,EAC7C,oCAAoC,EACpC,sDAAsD,CACvD;AAOD,OAAO,SAASC,UAAUA,CAAC;EAAEC,UAAU;EAAEC;AAAwB,CAAC,EAAE;EAClE,IAAI,CAACD,UAAU,EAAE;IACf,oBACEL,KAAA,CAACP,IAAI;MAACc,KAAK,EAAEC,MAAM,CAACC,IAAK;MAACC,MAAM,EAAC,4BAA4B;MAAAC,QAAA,gBAC3Db,IAAA,CAACN,IAAI;QAACe,KAAK,EAAEC,MAAM,CAACI,KAAM;QAAAD,QAAA,EAAC;MAAc,CAAM,CAAC,eAChDX,KAAA,CAACR,IAAI;QAACe,KAAK,EAAEC,MAAM,CAACK,IAAK;QAAAF,QAAA,GAAC,6GAEK,eAAAb,IAAA,CAACN,IAAI;UAACe,KAAK,EAAEC,MAAM,CAACM,IAAK;UAAAH,QAAA,EAAC;QAAO,CAAM,CAAC,YAAQ,EAAC,GAAG,eACjFb,IAAA,CAACN,IAAI;UAACe,KAAK,EAAEC,MAAM,CAACM,IAAK;UAAAH,QAAA,EAAE;QAAsB,CAAO,CAAC,yCAE3D;MAAA,CAAM,CAAC;IAAA,CACH,CAAC;EAEX;EAEA,oBACEX,KAAA,CAACP,IAAI;IAACc,KAAK,EAAEC,MAAM,CAACC,IAAK;IAACC,MAAM,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