@buoy-gg/ask-buoy 7.0.36 → 7.0.38
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.
- package/README.md +58 -27
- package/lib/commonjs/blocks/AskBlocks.js +1 -338
- package/lib/commonjs/blocks/BlockRenderer.js +1 -262
- package/lib/commonjs/blocks/ChromePrototypes.js +1 -514
- package/lib/commonjs/blocks/DataBlocks.js +1 -781
- package/lib/commonjs/blocks/ExtraBlocks.js +1 -1860
- package/lib/commonjs/blocks/MediaBlocks.js +1 -156
- package/lib/commonjs/blocks/ReceiptBlocks.js +1 -586
- package/lib/commonjs/blocks/blockText.js +1 -60
- package/lib/commonjs/blocks/blockText.test.js +1 -53
- package/lib/commonjs/blocks/context.js +1 -42
- package/lib/commonjs/blocks/icons.js +1 -96
- package/lib/commonjs/blocks/index.js +1 -95
- package/lib/commonjs/blocks/listRow.test.js +1 -55
- package/lib/commonjs/blocks/pageState.js +1 -34
- package/lib/commonjs/blocks/pageState.test.js +1 -57
- package/lib/commonjs/blocks/primitives.js +1 -457
- package/lib/commonjs/blocks/primitivesIndex.js +1 -62
- package/lib/commonjs/components/ApprovalCard.js +1 -244
- package/lib/commonjs/components/AskBuoyHeader.js +1 -196
- package/lib/commonjs/components/AskBuoyIcon.js +1 -19
- package/lib/commonjs/components/AskBuoyModal.js +1 -479
- package/lib/commonjs/components/AskBuoySettings.js +1 -119
- package/lib/commonjs/components/ChangesBar.js +1 -211
- package/lib/commonjs/components/Composer.js +1 -255
- package/lib/commonjs/components/EmptyState.js +1 -161
- package/lib/commonjs/components/KeyboardPad.js +1 -80
- package/lib/commonjs/components/Markdown.js +1 -310
- package/lib/commonjs/components/MessageList.js +1 -930
- package/lib/commonjs/components/QueuedMessages.js +1 -145
- package/lib/commonjs/components/ThinkingStrip.js +1 -223
- package/lib/commonjs/components/TypingDots.js +1 -63
- package/lib/commonjs/components/markdownParse.js +1 -131
- package/lib/commonjs/components/markdownParse.test.js +1 -99
- package/lib/commonjs/components/useCopyAction.js +1 -50
- package/lib/commonjs/index.js +1 -252
- package/lib/commonjs/preset.js +1 -90
- package/lib/commonjs/store/activityGroups.js +1 -110
- package/lib/commonjs/store/activityGroups.test.js +1 -78
- package/lib/commonjs/store/askBuoySettings.js +1 -72
- package/lib/commonjs/store/askBuoyStore.js +1 -547
- package/lib/commonjs/store/blockPlacement.js +1 -64
- package/lib/commonjs/store/blockPlacement.test.js +1 -123
- package/lib/commonjs/store/queue.test.js +1 -150
- package/lib/commonjs/store/resetConversation.js +1 -77
- package/lib/commonjs/store/restorePending.test.js +1 -63
- package/lib/commonjs/store/restoredIds.test.js +1 -47
- package/lib/commonjs/store/suggestions.js +1 -54
- package/lib/commonjs/store/suggestions.test.js +1 -58
- package/lib/commonjs/store/systemLine.test.js +1 -77
- package/lib/commonjs/store/ticketPrompt.js +1 -17
- package/lib/commonjs/store/traceText.js +1 -81
- package/lib/commonjs/store/traceText.test.js +1 -112
- package/lib/commonjs/store/transcriptPersistence.js +1 -297
- package/lib/commonjs/store/transcriptPersistence.test.js +1 -333
- package/lib/commonjs/store/turnRendering.test.js +1 -151
- package/lib/commonjs/store/useAskBuoy.js +1 -622
- package/lib/commonjs/store/useAskBuoySettings.js +1 -14
- package/lib/commonjs/sync/askBuoySyncAdapter.js +1 -140
- package/lib/commonjs/sync/askBuoySyncAdapter.test.js +1 -141
- package/lib/commonjs/sync/wire.js +1 -58
- package/lib/commonjs/types.js +1 -6
- package/lib/module/blocks/AskBlocks.js +1 -331
- package/lib/module/blocks/BlockRenderer.js +1 -257
- package/lib/module/blocks/ChromePrototypes.js +1 -503
- package/lib/module/blocks/DataBlocks.js +1 -767
- package/lib/module/blocks/ExtraBlocks.js +1 -1833
- package/lib/module/blocks/MediaBlocks.js +1 -151
- package/lib/module/blocks/ReceiptBlocks.js +1 -574
- package/lib/module/blocks/blockText.js +1 -55
- package/lib/module/blocks/blockText.test.js +1 -53
- package/lib/module/blocks/context.js +1 -35
- package/lib/module/blocks/icons.js +1 -91
- package/lib/module/blocks/index.js +1 -8
- package/lib/module/blocks/listRow.test.js +1 -56
- package/lib/module/blocks/pageState.js +1 -30
- package/lib/module/blocks/pageState.test.js +1 -56
- package/lib/module/blocks/primitives.js +1 -445
- package/lib/module/blocks/primitivesIndex.js +1 -5
- package/lib/module/components/ApprovalCard.js +1 -239
- package/lib/module/components/AskBuoyHeader.js +1 -193
- package/lib/module/components/AskBuoyIcon.js +1 -8
- package/lib/module/components/AskBuoyModal.js +1 -474
- package/lib/module/components/AskBuoySettings.js +1 -114
- package/lib/module/components/ChangesBar.js +1 -206
- package/lib/module/components/Composer.js +1 -250
- package/lib/module/components/EmptyState.js +1 -156
- package/lib/module/components/KeyboardPad.js +1 -75
- package/lib/module/components/Markdown.js +1 -305
- package/lib/module/components/MessageList.js +1 -924
- package/lib/module/components/QueuedMessages.js +1 -140
- package/lib/module/components/ThinkingStrip.js +1 -218
- package/lib/module/components/TypingDots.js +1 -58
- package/lib/module/components/markdownParse.js +1 -125
- package/lib/module/components/markdownParse.test.js +1 -98
- package/lib/module/components/useCopyAction.js +1 -46
- package/lib/module/index.js +1 -34
- package/lib/module/preset.js +1 -73
- package/lib/module/store/activityGroups.js +1 -103
- package/lib/module/store/activityGroups.test.js +1 -77
- package/lib/module/store/askBuoySettings.js +1 -67
- package/lib/module/store/askBuoyStore.js +1 -541
- package/lib/module/store/blockPlacement.js +1 -59
- package/lib/module/store/blockPlacement.test.js +1 -122
- package/lib/module/store/queue.test.js +1 -149
- package/lib/module/store/resetConversation.js +1 -72
- package/lib/module/store/restorePending.test.js +1 -62
- package/lib/module/store/restoredIds.test.js +1 -46
- package/lib/module/store/suggestions.js +1 -49
- package/lib/module/store/suggestions.test.js +1 -57
- package/lib/module/store/systemLine.test.js +1 -76
- package/lib/module/store/ticketPrompt.js +1 -13
- package/lib/module/store/traceText.js +1 -75
- package/lib/module/store/traceText.test.js +1 -111
- package/lib/module/store/transcriptPersistence.js +1 -287
- package/lib/module/store/transcriptPersistence.test.js +1 -332
- package/lib/module/store/turnRendering.test.js +1 -150
- package/lib/module/store/useAskBuoy.js +1 -616
- package/lib/module/store/useAskBuoySettings.js +1 -9
- package/lib/module/sync/askBuoySyncAdapter.js +1 -135
- package/lib/module/sync/askBuoySyncAdapter.test.js +1 -140
- package/lib/module/sync/wire.js +1 -47
- package/lib/module/types.js +1 -4
- package/lib/typescript/components/ApprovalCard.d.ts +9 -1
- package/lib/typescript/preset.d.ts +4 -2
- package/lib/typescript/store/askBuoyStore.d.ts +32 -4
- package/lib/typescript/store/useAskBuoy.d.ts +3 -2
- package/lib/typescript/sync/askBuoySyncAdapter.d.ts +3 -0
- package/package.json +9 -9
- package/lib/commonjs/blocks/AskBlocks.js.map +0 -1
- package/lib/commonjs/blocks/BlockRenderer.js.map +0 -1
- package/lib/commonjs/blocks/ChromePrototypes.js.map +0 -1
- package/lib/commonjs/blocks/DataBlocks.js.map +0 -1
- package/lib/commonjs/blocks/ExtraBlocks.js.map +0 -1
- package/lib/commonjs/blocks/MediaBlocks.js.map +0 -1
- package/lib/commonjs/blocks/ReceiptBlocks.js.map +0 -1
- package/lib/commonjs/blocks/blockText.js.map +0 -1
- package/lib/commonjs/blocks/blockText.test.js.map +0 -1
- package/lib/commonjs/blocks/context.js.map +0 -1
- package/lib/commonjs/blocks/icons.js.map +0 -1
- package/lib/commonjs/blocks/index.js.map +0 -1
- package/lib/commonjs/blocks/listRow.test.js.map +0 -1
- package/lib/commonjs/blocks/pageState.js.map +0 -1
- package/lib/commonjs/blocks/pageState.test.js.map +0 -1
- package/lib/commonjs/blocks/primitives.js.map +0 -1
- package/lib/commonjs/blocks/primitivesIndex.js.map +0 -1
- package/lib/commonjs/components/ApprovalCard.js.map +0 -1
- package/lib/commonjs/components/AskBuoyHeader.js.map +0 -1
- package/lib/commonjs/components/AskBuoyIcon.js.map +0 -1
- package/lib/commonjs/components/AskBuoyModal.js.map +0 -1
- package/lib/commonjs/components/AskBuoySettings.js.map +0 -1
- package/lib/commonjs/components/ChangesBar.js.map +0 -1
- package/lib/commonjs/components/Composer.js.map +0 -1
- package/lib/commonjs/components/EmptyState.js.map +0 -1
- package/lib/commonjs/components/KeyboardPad.js.map +0 -1
- package/lib/commonjs/components/Markdown.js.map +0 -1
- package/lib/commonjs/components/MessageList.js.map +0 -1
- package/lib/commonjs/components/QueuedMessages.js.map +0 -1
- package/lib/commonjs/components/ThinkingStrip.js.map +0 -1
- package/lib/commonjs/components/TypingDots.js.map +0 -1
- package/lib/commonjs/components/markdownParse.js.map +0 -1
- package/lib/commonjs/components/markdownParse.test.js.map +0 -1
- package/lib/commonjs/components/useCopyAction.js.map +0 -1
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/preset.js.map +0 -1
- package/lib/commonjs/store/activityGroups.js.map +0 -1
- package/lib/commonjs/store/activityGroups.test.js.map +0 -1
- package/lib/commonjs/store/askBuoySettings.js.map +0 -1
- package/lib/commonjs/store/askBuoyStore.js.map +0 -1
- package/lib/commonjs/store/blockPlacement.js.map +0 -1
- package/lib/commonjs/store/blockPlacement.test.js.map +0 -1
- package/lib/commonjs/store/queue.test.js.map +0 -1
- package/lib/commonjs/store/resetConversation.js.map +0 -1
- package/lib/commonjs/store/restorePending.test.js.map +0 -1
- package/lib/commonjs/store/restoredIds.test.js.map +0 -1
- package/lib/commonjs/store/suggestions.js.map +0 -1
- package/lib/commonjs/store/suggestions.test.js.map +0 -1
- package/lib/commonjs/store/systemLine.test.js.map +0 -1
- package/lib/commonjs/store/ticketPrompt.js.map +0 -1
- package/lib/commonjs/store/traceText.js.map +0 -1
- package/lib/commonjs/store/traceText.test.js.map +0 -1
- package/lib/commonjs/store/transcriptPersistence.js.map +0 -1
- package/lib/commonjs/store/transcriptPersistence.test.js.map +0 -1
- package/lib/commonjs/store/turnRendering.test.js.map +0 -1
- package/lib/commonjs/store/useAskBuoy.js.map +0 -1
- package/lib/commonjs/store/useAskBuoySettings.js.map +0 -1
- package/lib/commonjs/sync/askBuoySyncAdapter.js.map +0 -1
- package/lib/commonjs/sync/askBuoySyncAdapter.test.js.map +0 -1
- package/lib/commonjs/sync/wire.js.map +0 -1
- package/lib/commonjs/types.js.map +0 -1
- package/lib/module/blocks/AskBlocks.js.map +0 -1
- package/lib/module/blocks/BlockRenderer.js.map +0 -1
- package/lib/module/blocks/ChromePrototypes.js.map +0 -1
- package/lib/module/blocks/DataBlocks.js.map +0 -1
- package/lib/module/blocks/ExtraBlocks.js.map +0 -1
- package/lib/module/blocks/MediaBlocks.js.map +0 -1
- package/lib/module/blocks/ReceiptBlocks.js.map +0 -1
- package/lib/module/blocks/blockText.js.map +0 -1
- package/lib/module/blocks/blockText.test.js.map +0 -1
- package/lib/module/blocks/context.js.map +0 -1
- package/lib/module/blocks/icons.js.map +0 -1
- package/lib/module/blocks/index.js.map +0 -1
- package/lib/module/blocks/listRow.test.js.map +0 -1
- package/lib/module/blocks/pageState.js.map +0 -1
- package/lib/module/blocks/pageState.test.js.map +0 -1
- package/lib/module/blocks/primitives.js.map +0 -1
- package/lib/module/blocks/primitivesIndex.js.map +0 -1
- package/lib/module/components/ApprovalCard.js.map +0 -1
- package/lib/module/components/AskBuoyHeader.js.map +0 -1
- package/lib/module/components/AskBuoyIcon.js.map +0 -1
- package/lib/module/components/AskBuoyModal.js.map +0 -1
- package/lib/module/components/AskBuoySettings.js.map +0 -1
- package/lib/module/components/ChangesBar.js.map +0 -1
- package/lib/module/components/Composer.js.map +0 -1
- package/lib/module/components/EmptyState.js.map +0 -1
- package/lib/module/components/KeyboardPad.js.map +0 -1
- package/lib/module/components/Markdown.js.map +0 -1
- package/lib/module/components/MessageList.js.map +0 -1
- package/lib/module/components/QueuedMessages.js.map +0 -1
- package/lib/module/components/ThinkingStrip.js.map +0 -1
- package/lib/module/components/TypingDots.js.map +0 -1
- package/lib/module/components/markdownParse.js.map +0 -1
- package/lib/module/components/markdownParse.test.js.map +0 -1
- package/lib/module/components/useCopyAction.js.map +0 -1
- package/lib/module/index.js.map +0 -1
- package/lib/module/preset.js.map +0 -1
- package/lib/module/store/activityGroups.js.map +0 -1
- package/lib/module/store/activityGroups.test.js.map +0 -1
- package/lib/module/store/askBuoySettings.js.map +0 -1
- package/lib/module/store/askBuoyStore.js.map +0 -1
- package/lib/module/store/blockPlacement.js.map +0 -1
- package/lib/module/store/blockPlacement.test.js.map +0 -1
- package/lib/module/store/queue.test.js.map +0 -1
- package/lib/module/store/resetConversation.js.map +0 -1
- package/lib/module/store/restorePending.test.js.map +0 -1
- package/lib/module/store/restoredIds.test.js.map +0 -1
- package/lib/module/store/suggestions.js.map +0 -1
- package/lib/module/store/suggestions.test.js.map +0 -1
- package/lib/module/store/systemLine.test.js.map +0 -1
- package/lib/module/store/ticketPrompt.js.map +0 -1
- package/lib/module/store/traceText.js.map +0 -1
- package/lib/module/store/traceText.test.js.map +0 -1
- package/lib/module/store/transcriptPersistence.js.map +0 -1
- package/lib/module/store/transcriptPersistence.test.js.map +0 -1
- package/lib/module/store/turnRendering.test.js.map +0 -1
- package/lib/module/store/useAskBuoy.js.map +0 -1
- package/lib/module/store/useAskBuoySettings.js.map +0 -1
- package/lib/module/sync/askBuoySyncAdapter.js.map +0 -1
- package/lib/module/sync/askBuoySyncAdapter.test.js.map +0 -1
- package/lib/module/sync/wire.js.map +0 -1
- package/lib/module/types.js.map +0 -1
- package/lib/typescript/blocks/AskBlocks.d.ts.map +0 -1
- package/lib/typescript/blocks/BlockRenderer.d.ts.map +0 -1
- package/lib/typescript/blocks/ChromePrototypes.d.ts.map +0 -1
- package/lib/typescript/blocks/DataBlocks.d.ts.map +0 -1
- package/lib/typescript/blocks/ExtraBlocks.d.ts.map +0 -1
- package/lib/typescript/blocks/MediaBlocks.d.ts.map +0 -1
- package/lib/typescript/blocks/ReceiptBlocks.d.ts.map +0 -1
- package/lib/typescript/blocks/blockText.d.ts.map +0 -1
- package/lib/typescript/blocks/blockText.test.d.ts.map +0 -1
- package/lib/typescript/blocks/context.d.ts.map +0 -1
- package/lib/typescript/blocks/icons.d.ts.map +0 -1
- package/lib/typescript/blocks/index.d.ts.map +0 -1
- package/lib/typescript/blocks/listRow.test.d.ts.map +0 -1
- package/lib/typescript/blocks/pageState.d.ts.map +0 -1
- package/lib/typescript/blocks/pageState.test.d.ts.map +0 -1
- package/lib/typescript/blocks/primitives.d.ts.map +0 -1
- package/lib/typescript/blocks/primitivesIndex.d.ts.map +0 -1
- package/lib/typescript/components/ApprovalCard.d.ts.map +0 -1
- package/lib/typescript/components/AskBuoyHeader.d.ts.map +0 -1
- package/lib/typescript/components/AskBuoyIcon.d.ts.map +0 -1
- package/lib/typescript/components/AskBuoyModal.d.ts.map +0 -1
- package/lib/typescript/components/AskBuoySettings.d.ts.map +0 -1
- package/lib/typescript/components/ChangesBar.d.ts.map +0 -1
- package/lib/typescript/components/Composer.d.ts.map +0 -1
- package/lib/typescript/components/EmptyState.d.ts.map +0 -1
- package/lib/typescript/components/KeyboardPad.d.ts.map +0 -1
- package/lib/typescript/components/Markdown.d.ts.map +0 -1
- package/lib/typescript/components/MessageList.d.ts.map +0 -1
- package/lib/typescript/components/QueuedMessages.d.ts.map +0 -1
- package/lib/typescript/components/ThinkingStrip.d.ts.map +0 -1
- package/lib/typescript/components/TypingDots.d.ts.map +0 -1
- package/lib/typescript/components/markdownParse.d.ts.map +0 -1
- package/lib/typescript/components/markdownParse.test.d.ts.map +0 -1
- package/lib/typescript/components/useCopyAction.d.ts.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/preset.d.ts.map +0 -1
- package/lib/typescript/store/activityGroups.d.ts.map +0 -1
- package/lib/typescript/store/activityGroups.test.d.ts.map +0 -1
- package/lib/typescript/store/askBuoySettings.d.ts.map +0 -1
- package/lib/typescript/store/askBuoyStore.d.ts.map +0 -1
- package/lib/typescript/store/blockPlacement.d.ts.map +0 -1
- package/lib/typescript/store/blockPlacement.test.d.ts.map +0 -1
- package/lib/typescript/store/queue.test.d.ts.map +0 -1
- package/lib/typescript/store/resetConversation.d.ts.map +0 -1
- package/lib/typescript/store/restorePending.test.d.ts.map +0 -1
- package/lib/typescript/store/restoredIds.test.d.ts.map +0 -1
- package/lib/typescript/store/suggestions.d.ts.map +0 -1
- package/lib/typescript/store/suggestions.test.d.ts.map +0 -1
- package/lib/typescript/store/systemLine.test.d.ts.map +0 -1
- package/lib/typescript/store/ticketPrompt.d.ts.map +0 -1
- package/lib/typescript/store/traceText.d.ts.map +0 -1
- package/lib/typescript/store/traceText.test.d.ts.map +0 -1
- package/lib/typescript/store/transcriptPersistence.d.ts.map +0 -1
- package/lib/typescript/store/transcriptPersistence.test.d.ts.map +0 -1
- package/lib/typescript/store/turnRendering.test.d.ts.map +0 -1
- package/lib/typescript/store/useAskBuoy.d.ts.map +0 -1
- package/lib/typescript/store/useAskBuoySettings.d.ts.map +0 -1
- package/lib/typescript/sync/askBuoySyncAdapter.d.ts.map +0 -1
- package/lib/typescript/sync/askBuoySyncAdapter.test.d.ts.map +0 -1
- package/lib/typescript/sync/wire.d.ts.map +0 -1
- package/lib/typescript/types.d.ts.map +0 -1
|
@@ -1,145 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.QueuedMessages = QueuedMessages;
|
|
7
|
-
var _reactNative = require("react-native");
|
|
8
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
/**
|
|
11
|
-
* Messages typed while the agent was working, waiting their turn.
|
|
12
|
-
*
|
|
13
|
-
* Visible because the alternative was a placeholder. The queue used to be one
|
|
14
|
-
* string behind the composer's "Queued — sends when this turn finishes" hint:
|
|
15
|
-
* a second message typed mid-turn silently replaced the first, and nothing on
|
|
16
|
-
* screen could have told you. A list you can see is a list you can trust.
|
|
17
|
-
*
|
|
18
|
-
* Each row: the text (capped at three lines), tap to pull it back into the
|
|
19
|
-
* composer to edit, ✕ to drop it. The hint underneath says whether the queue
|
|
20
|
-
* is delivering or why it is holding — see `queuePauseReason` in the store.
|
|
21
|
-
*
|
|
22
|
-
* Height is bounded, so a long queue can never push the approval card or the
|
|
23
|
-
* Stop button off the bottom of the sheet.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
/** Three rows, then it scrolls. */
|
|
27
|
-
const MAX_LIST_HEIGHT = 132;
|
|
28
|
-
function QueuedMessages({
|
|
29
|
-
items,
|
|
30
|
-
paused,
|
|
31
|
-
onEdit,
|
|
32
|
-
onRemove
|
|
33
|
-
}) {
|
|
34
|
-
if (items.length === 0) return null;
|
|
35
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
36
|
-
style: styles.wrap,
|
|
37
|
-
testID: "buoy-ask-buoy-queue",
|
|
38
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
39
|
-
style: styles.list,
|
|
40
|
-
contentContainerStyle: styles.listContent,
|
|
41
|
-
keyboardShouldPersistTaps: "handled",
|
|
42
|
-
children: items.map((item, i) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
43
|
-
style: [styles.row, paused !== null && styles.rowPaused],
|
|
44
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
|
|
45
|
-
testID: `buoy-ask-buoy-queue-item-${i}`,
|
|
46
|
-
accessibilityRole: "button",
|
|
47
|
-
accessibilityLabel: `Edit queued message: ${item.text}`,
|
|
48
|
-
onPress: () => onEdit(item.id),
|
|
49
|
-
style: ({
|
|
50
|
-
pressed
|
|
51
|
-
}) => [styles.rowBody, pressed && styles.pressed],
|
|
52
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
53
|
-
style: styles.ordinal,
|
|
54
|
-
children: i === 0 ? "NEXT" : "THEN"
|
|
55
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
56
|
-
style: styles.text,
|
|
57
|
-
numberOfLines: 3,
|
|
58
|
-
children: item.text
|
|
59
|
-
})]
|
|
60
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
61
|
-
testID: `buoy-ask-buoy-queue-remove-${i}`,
|
|
62
|
-
accessibilityRole: "button",
|
|
63
|
-
accessibilityLabel: "Remove queued message",
|
|
64
|
-
onPress: () => onRemove(item.id),
|
|
65
|
-
hitSlop: 8,
|
|
66
|
-
style: ({
|
|
67
|
-
pressed
|
|
68
|
-
}) => [styles.remove, pressed && styles.pressed],
|
|
69
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.X, {
|
|
70
|
-
size: 11,
|
|
71
|
-
color: _sharedUi.night.color.textTertiary
|
|
72
|
-
})
|
|
73
|
-
})]
|
|
74
|
-
}, item.id))
|
|
75
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
76
|
-
style: [styles.hint, paused !== null && styles.hintPaused],
|
|
77
|
-
testID: "buoy-ask-buoy-queue-hint",
|
|
78
|
-
children: paused ?? "Sends one at a time when this turn finishes · tap to edit"
|
|
79
|
-
})]
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
const styles = _reactNative.StyleSheet.create({
|
|
83
|
-
wrap: {
|
|
84
|
-
paddingHorizontal: _sharedUi.night.gutter,
|
|
85
|
-
paddingTop: 8,
|
|
86
|
-
gap: 6,
|
|
87
|
-
// Opaque, like the composer: the transcript scrolls under it.
|
|
88
|
-
backgroundColor: _sharedUi.night.color.bg
|
|
89
|
-
},
|
|
90
|
-
list: {
|
|
91
|
-
maxHeight: MAX_LIST_HEIGHT
|
|
92
|
-
},
|
|
93
|
-
listContent: {
|
|
94
|
-
gap: 6
|
|
95
|
-
},
|
|
96
|
-
row: {
|
|
97
|
-
flexDirection: "row",
|
|
98
|
-
alignItems: "center",
|
|
99
|
-
borderRadius: _sharedUi.night.radius.row,
|
|
100
|
-
borderWidth: _reactNative.StyleSheet.hairlineWidth,
|
|
101
|
-
borderColor: _sharedUi.night.color.border,
|
|
102
|
-
backgroundColor: _sharedUi.night.color.surface
|
|
103
|
-
},
|
|
104
|
-
rowPaused: {
|
|
105
|
-
borderColor: _sharedUi.night.color.warning
|
|
106
|
-
},
|
|
107
|
-
rowBody: {
|
|
108
|
-
flex: 1,
|
|
109
|
-
flexDirection: "row",
|
|
110
|
-
alignItems: "center",
|
|
111
|
-
gap: 8,
|
|
112
|
-
paddingVertical: 7,
|
|
113
|
-
paddingLeft: 10
|
|
114
|
-
},
|
|
115
|
-
ordinal: {
|
|
116
|
-
color: _sharedUi.night.color.textTertiary,
|
|
117
|
-
fontSize: 9,
|
|
118
|
-
fontWeight: "700",
|
|
119
|
-
letterSpacing: 0.6,
|
|
120
|
-
width: 30
|
|
121
|
-
},
|
|
122
|
-
text: {
|
|
123
|
-
flex: 1,
|
|
124
|
-
color: _sharedUi.night.color.textSecondary,
|
|
125
|
-
fontSize: _sharedUi.night.font.caption,
|
|
126
|
-
lineHeight: 17
|
|
127
|
-
},
|
|
128
|
-
remove: {
|
|
129
|
-
width: 32,
|
|
130
|
-
height: 32,
|
|
131
|
-
alignItems: "center",
|
|
132
|
-
justifyContent: "center"
|
|
133
|
-
},
|
|
134
|
-
pressed: {
|
|
135
|
-
opacity: 0.7
|
|
136
|
-
},
|
|
137
|
-
hint: {
|
|
138
|
-
color: _sharedUi.night.color.textTertiary,
|
|
139
|
-
fontSize: _sharedUi.night.font.micro
|
|
140
|
-
},
|
|
141
|
-
hintPaused: {
|
|
142
|
-
color: _sharedUi.night.color.warning
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
//# sourceMappingURL=QueuedMessages.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.QueuedMessages=QueuedMessages;var _reactNative=require("react-native"),_sharedUi=require("@buoy-gg/shared-ui"),_jsxRuntime=require("react/jsx-runtime");const MAX_LIST_HEIGHT=132;function QueuedMessages({items:e,paused:t,onEdit:s,onRemove:i}){return 0===e.length?null:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.wrap,testID:"buoy-ask-buoy-queued",children:[(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:styles.list,contentContainerStyle:styles.listContent,keyboardShouldPersistTaps:"handled",children:e.map((e,r)=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.row,null!==t&&styles.rowPaused],children:[(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{testID:`buoy-ask-buoy-queue-item-${r}`,accessibilityRole:"button",accessibilityLabel:`Edit queued message: ${e.text}`,onPress:()=>s(e.id),style:({pressed:e})=>[styles.rowBody,e&&styles.pressed],children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.ordinal,children:0===r?"NEXT":"THEN"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.text,numberOfLines:3,children:e.text})]}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{testID:`buoy-ask-buoy-queue-remove-${r}`,accessibilityRole:"button",accessibilityLabel:"Remove queued message",onPress:()=>i(e.id),hitSlop:8,style:({pressed:e})=>[styles.remove,e&&styles.pressed],children:(0,_jsxRuntime.jsx)(_sharedUi.X,{size:11,color:_sharedUi.night.color.textTertiary})})]},e.id))}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.hint,null!==t&&styles.hintPaused],testID:"buoy-ask-buoy-queue-hint",children:t??"Sends one at a time when this turn finishes · tap to edit"})]})}const styles=_reactNative.StyleSheet.create({wrap:{paddingHorizontal:_sharedUi.night.gutter,paddingTop:8,gap:6,backgroundColor:_sharedUi.night.color.bg},list:{maxHeight:132},listContent:{gap:6},row:{flexDirection:"row",alignItems:"center",borderRadius:_sharedUi.night.radius.row,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_sharedUi.night.color.border,backgroundColor:_sharedUi.night.color.surface},rowPaused:{borderColor:_sharedUi.night.color.warning},rowBody:{flex:1,flexDirection:"row",alignItems:"center",gap:8,paddingVertical:7,paddingLeft:10},ordinal:{color:_sharedUi.night.color.textTertiary,fontSize:9,fontWeight:"700",letterSpacing:.6,width:30},text:{flex:1,color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,lineHeight:17},remove:{width:32,height:32,alignItems:"center",justifyContent:"center"},pressed:{opacity:.7},hint:{color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.micro},hintPaused:{color:_sharedUi.night.color.warning}});
|
|
@@ -1,223 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ThinkingStrip = ThinkingStrip;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
10
|
-
var _traceText = require("../store/traceText");
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
/**
|
|
13
|
-
* The agent's own working, under an answer, collapsed by default.
|
|
14
|
-
*
|
|
15
|
-
* Collapsed is the whole design constraint. A multi-step turn's reasoning is
|
|
16
|
-
* longer than the answer it produced, and rendered open it pushes the answer —
|
|
17
|
-
* the thing the user came for — off the screen. So the strip is one line until
|
|
18
|
-
* someone wants it, and the summary on that line ("3 steps · 2 thoughts") is
|
|
19
|
-
* enough to tell whether opening it is worth it.
|
|
20
|
-
*
|
|
21
|
-
* Every step is expandable on its own too, because the parameters are the
|
|
22
|
-
* useful part when hunting a bug and the tool name alone is not.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
function StepRow({
|
|
26
|
-
n,
|
|
27
|
-
call
|
|
28
|
-
}) {
|
|
29
|
-
const [open, setOpen] = (0, _react.useState)(false);
|
|
30
|
-
const failed = call.status === "failed" || call.status === "refused";
|
|
31
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
|
|
32
|
-
onPress: () => setOpen(v => !v),
|
|
33
|
-
accessibilityRole: "button",
|
|
34
|
-
accessibilityState: {
|
|
35
|
-
expanded: open
|
|
36
|
-
},
|
|
37
|
-
style: styles.step,
|
|
38
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
39
|
-
style: styles.stepLine,
|
|
40
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
41
|
-
style: styles.stepN,
|
|
42
|
-
children: n
|
|
43
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
44
|
-
style: [styles.stepName, failed && styles.stepFailed],
|
|
45
|
-
numberOfLines: 1,
|
|
46
|
-
children: [call.toolId, ".", call.action]
|
|
47
|
-
}), call.durationMs !== undefined ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
48
|
-
style: styles.stepMs,
|
|
49
|
-
children: [call.durationMs, "ms"]
|
|
50
|
-
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
51
|
-
style: [styles.stepStatus, failed && styles.stepFailed],
|
|
52
|
-
numberOfLines: 1,
|
|
53
|
-
children: call.status === "ok" ? call.summary || "done" : call.status
|
|
54
|
-
})]
|
|
55
|
-
}), open ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
56
|
-
style: styles.detail,
|
|
57
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
58
|
-
style: styles.detailLabel,
|
|
59
|
-
children: "SENT"
|
|
60
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
61
|
-
style: styles.code,
|
|
62
|
-
selectable: true,
|
|
63
|
-
children: call.params ?? "no parameters"
|
|
64
|
-
}), call.result ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
65
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
66
|
-
style: styles.detailLabel,
|
|
67
|
-
children: "RETURNED"
|
|
68
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
69
|
-
style: styles.code,
|
|
70
|
-
selectable: true,
|
|
71
|
-
children: call.result
|
|
72
|
-
})]
|
|
73
|
-
}) : null]
|
|
74
|
-
}) : null]
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
function ThinkingStrip({
|
|
78
|
-
message
|
|
79
|
-
}) {
|
|
80
|
-
const [open, setOpen] = (0, _react.useState)(false);
|
|
81
|
-
if (!(0, _traceText.hasTrace)(message)) return null;
|
|
82
|
-
const entries = (0, _traceText.traceEntries)(message);
|
|
83
|
-
const steps = entries.filter(e => e.kind === "step").length;
|
|
84
|
-
const thoughts = entries.length - steps;
|
|
85
|
-
const wall = message.startedAt !== undefined && message.endedAt !== undefined ? `${((message.endedAt - message.startedAt) / 1000).toFixed(1)}s` : null;
|
|
86
|
-
const summary = [steps ? `${steps} step${steps === 1 ? "" : "s"}` : null, thoughts ? `${thoughts} thought${thoughts === 1 ? "" : "s"}` : null, wall, message.usage ? `${message.usage.input + message.usage.output} tokens` : null].filter(Boolean).join(" · ");
|
|
87
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
88
|
-
style: styles.wrap,
|
|
89
|
-
testID: "buoy-ask-buoy-thinking",
|
|
90
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
|
|
91
|
-
testID: "buoy-ask-buoy-thinking-toggle",
|
|
92
|
-
onPress: () => setOpen(v => !v),
|
|
93
|
-
accessibilityRole: "button",
|
|
94
|
-
accessibilityLabel: open ? "Hide agent thinking" : "Show agent thinking",
|
|
95
|
-
accessibilityState: {
|
|
96
|
-
expanded: open
|
|
97
|
-
},
|
|
98
|
-
style: styles.head,
|
|
99
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Activity, {
|
|
100
|
-
size: 12,
|
|
101
|
-
color: _sharedUi.night.color.textTertiary
|
|
102
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
103
|
-
style: styles.headText,
|
|
104
|
-
children: summary
|
|
105
|
-
}), open ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronDown, {
|
|
106
|
-
size: 12,
|
|
107
|
-
color: _sharedUi.night.color.textTertiary
|
|
108
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronRight, {
|
|
109
|
-
size: 12,
|
|
110
|
-
color: _sharedUi.night.color.textTertiary
|
|
111
|
-
})]
|
|
112
|
-
}), open ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
113
|
-
style: styles.body,
|
|
114
|
-
children: [entries.map((entry, i) => entry.kind === "thought" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
115
|
-
style: styles.thought,
|
|
116
|
-
selectable: true,
|
|
117
|
-
children: entry.text.trim()
|
|
118
|
-
}, `t${i}`) : /*#__PURE__*/(0, _jsxRuntime.jsx)(StepRow, {
|
|
119
|
-
n: entry.n,
|
|
120
|
-
call: entry.call
|
|
121
|
-
}, entry.call.id)), thoughts === 0 ?
|
|
122
|
-
/*#__PURE__*/
|
|
123
|
-
// Said plainly, because an empty reasoning section reads as broken.
|
|
124
|
-
// Most models report none: Claude thinks by default, gpt-4.1 never.
|
|
125
|
-
(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
126
|
-
style: styles.none,
|
|
127
|
-
children: "This model reports no reasoning \u2014 the steps above are the whole trace."
|
|
128
|
-
}) : null]
|
|
129
|
-
}) : null]
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
const styles = _reactNative.StyleSheet.create({
|
|
133
|
-
wrap: {
|
|
134
|
-
marginTop: 8,
|
|
135
|
-
borderRadius: _sharedUi.night.radius.badge,
|
|
136
|
-
borderWidth: _reactNative.StyleSheet.hairlineWidth,
|
|
137
|
-
borderColor: _sharedUi.night.color.separator,
|
|
138
|
-
backgroundColor: _sharedUi.night.color.fill,
|
|
139
|
-
overflow: "hidden"
|
|
140
|
-
},
|
|
141
|
-
head: {
|
|
142
|
-
flexDirection: "row",
|
|
143
|
-
alignItems: "center",
|
|
144
|
-
gap: 6,
|
|
145
|
-
paddingHorizontal: 10,
|
|
146
|
-
paddingVertical: 7
|
|
147
|
-
},
|
|
148
|
-
headText: {
|
|
149
|
-
flex: 1,
|
|
150
|
-
color: _sharedUi.night.color.textTertiary,
|
|
151
|
-
fontSize: _sharedUi.night.font.micro,
|
|
152
|
-
fontWeight: "600"
|
|
153
|
-
},
|
|
154
|
-
body: {
|
|
155
|
-
borderTopWidth: _reactNative.StyleSheet.hairlineWidth,
|
|
156
|
-
borderTopColor: _sharedUi.night.color.separator
|
|
157
|
-
},
|
|
158
|
-
thought: {
|
|
159
|
-
color: _sharedUi.night.color.textSecondary,
|
|
160
|
-
fontSize: _sharedUi.night.font.micro,
|
|
161
|
-
lineHeight: 17,
|
|
162
|
-
fontStyle: "italic",
|
|
163
|
-
paddingHorizontal: 10,
|
|
164
|
-
paddingVertical: 8
|
|
165
|
-
},
|
|
166
|
-
step: {
|
|
167
|
-
paddingHorizontal: 10,
|
|
168
|
-
paddingVertical: 7
|
|
169
|
-
},
|
|
170
|
-
stepLine: {
|
|
171
|
-
flexDirection: "row",
|
|
172
|
-
alignItems: "center",
|
|
173
|
-
gap: 8
|
|
174
|
-
},
|
|
175
|
-
stepN: {
|
|
176
|
-
color: _sharedUi.night.color.textTertiary,
|
|
177
|
-
fontSize: _sharedUi.night.font.micro,
|
|
178
|
-
width: 14
|
|
179
|
-
},
|
|
180
|
-
stepName: {
|
|
181
|
-
flex: 1,
|
|
182
|
-
color: _sharedUi.night.color.textSecondary,
|
|
183
|
-
fontSize: _sharedUi.night.font.micro,
|
|
184
|
-
fontWeight: "600"
|
|
185
|
-
},
|
|
186
|
-
stepMs: {
|
|
187
|
-
color: _sharedUi.night.color.textTertiary,
|
|
188
|
-
fontSize: _sharedUi.night.font.micro
|
|
189
|
-
},
|
|
190
|
-
stepStatus: {
|
|
191
|
-
color: _sharedUi.night.color.textTertiary,
|
|
192
|
-
fontSize: _sharedUi.night.font.micro,
|
|
193
|
-
maxWidth: 110
|
|
194
|
-
},
|
|
195
|
-
stepFailed: {
|
|
196
|
-
color: _sharedUi.night.color.danger
|
|
197
|
-
},
|
|
198
|
-
detail: {
|
|
199
|
-
marginTop: 6,
|
|
200
|
-
marginLeft: 22,
|
|
201
|
-
gap: 3
|
|
202
|
-
},
|
|
203
|
-
detailLabel: {
|
|
204
|
-
color: _sharedUi.night.color.textTertiary,
|
|
205
|
-
fontSize: 9,
|
|
206
|
-
fontWeight: "700",
|
|
207
|
-
letterSpacing: 0.5
|
|
208
|
-
},
|
|
209
|
-
code: {
|
|
210
|
-
color: _sharedUi.night.color.textSecondary,
|
|
211
|
-
fontSize: _sharedUi.night.font.micro,
|
|
212
|
-
lineHeight: 16,
|
|
213
|
-
marginBottom: 3
|
|
214
|
-
},
|
|
215
|
-
none: {
|
|
216
|
-
color: _sharedUi.night.color.textTertiary,
|
|
217
|
-
fontSize: _sharedUi.night.font.micro,
|
|
218
|
-
fontStyle: "italic",
|
|
219
|
-
paddingHorizontal: 10,
|
|
220
|
-
paddingVertical: 8
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
//# sourceMappingURL=ThinkingStrip.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ThinkingStrip=ThinkingStrip;var _react=require("react"),_reactNative=require("react-native"),_sharedUi=require("@buoy-gg/shared-ui"),_traceText=require("../store/traceText"),_jsxRuntime=require("react/jsx-runtime");function StepRow({n:e,call:t}){const[i,s]=(0,_react.useState)(!1),r="failed"===t.status||"refused"===t.status;return(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{onPress:()=>s(e=>!e),accessibilityRole:"button",accessibilityState:{expanded:i},style:styles.step,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.stepLine,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.stepN,children:e}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[styles.stepName,r&&styles.stepFailed],numberOfLines:1,children:[t.toolId,".",t.action]}),void 0!==t.durationMs?(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.stepMs,children:[t.durationMs,"ms"]}):null,(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.stepStatus,r&&styles.stepFailed],numberOfLines:1,children:"ok"===t.status?t.summary||"done":t.status})]}),i?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.detail,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.detailLabel,children:"SENT"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.code,selectable:!0,children:t.params??"no parameters"}),t.result?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.detailLabel,children:"RETURNED"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.code,selectable:!0,children:t.result})]}):null]}):null]})}function ThinkingStrip({message:e}){const[t,i]=(0,_react.useState)(!1);if(!(0,_traceText.hasTrace)(e))return null;const s=(0,_traceText.traceEntries)(e),r=s.filter(e=>"step"===e.kind).length,a=s.length-r,n=[r?`${r} step${1===r?"":"s"}`:null,a?`${a} thought${1===a?"":"s"}`:null,void 0!==e.startedAt&&void 0!==e.endedAt?`${((e.endedAt-e.startedAt)/1e3).toFixed(1)}s`:null,e.usage?`${e.usage.input+e.usage.output} tokens`:null].filter(Boolean).join(" · ");return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.wrap,testID:"buoy-ask-buoy-thinking",children:[(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{testID:"buoy-ask-buoy-thinking-toggle",onPress:()=>i(e=>!e),accessibilityRole:"button",accessibilityLabel:t?"Hide agent thinking":"Show agent thinking",accessibilityState:{expanded:t},style:styles.head,children:[(0,_jsxRuntime.jsx)(_sharedUi.Activity,{size:12,color:_sharedUi.night.color.textTertiary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headText,children:n}),t?(0,_jsxRuntime.jsx)(_sharedUi.ChevronDown,{size:12,color:_sharedUi.night.color.textTertiary}):(0,_jsxRuntime.jsx)(_sharedUi.ChevronRight,{size:12,color:_sharedUi.night.color.textTertiary})]}),t?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.body,children:[s.map((e,t)=>"thought"===e.kind?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.thought,selectable:!0,children:e.text.trim()},`t${t}`):(0,_jsxRuntime.jsx)(StepRow,{n:e.n,call:e.call},e.call.id)),0===a?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.none,children:"This model reports no reasoning — the steps above are the whole trace."}):null]}):null]})}const styles=_reactNative.StyleSheet.create({wrap:{marginTop:8,borderRadius:_sharedUi.night.radius.badge,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_sharedUi.night.color.separator,backgroundColor:_sharedUi.night.color.fill,overflow:"hidden"},head:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:10,paddingVertical:7},headText:{flex:1,color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.micro,fontWeight:"600"},body:{borderTopWidth:_reactNative.StyleSheet.hairlineWidth,borderTopColor:_sharedUi.night.color.separator},thought:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.micro,lineHeight:17,fontStyle:"italic",paddingHorizontal:10,paddingVertical:8},step:{paddingHorizontal:10,paddingVertical:7},stepLine:{flexDirection:"row",alignItems:"center",gap:8},stepN:{color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.micro,width:14},stepName:{flex:1,color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.micro,fontWeight:"600"},stepMs:{color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.micro},stepStatus:{color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.micro,maxWidth:110},stepFailed:{color:_sharedUi.night.color.danger},detail:{marginTop:6,marginLeft:22,gap:3},detailLabel:{color:_sharedUi.night.color.textTertiary,fontSize:9,fontWeight:"700",letterSpacing:.5},code:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.micro,lineHeight:16,marginBottom:3},none:{color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.micro,fontStyle:"italic",paddingHorizontal:10,paddingVertical:8}});
|
|
@@ -1,63 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.TypingDots = TypingDots;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
/**
|
|
12
|
-
* Three pulsing dots — the "it heard you" signal between sending a message
|
|
13
|
-
* and the first streamed token. A static "…" glyph read as a finished (and
|
|
14
|
-
* confusing) answer.
|
|
15
|
-
*
|
|
16
|
-
* Native-driver opacity only, so it costs the JS thread nothing while the
|
|
17
|
-
* stream that replaces it is being parsed.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
function TypingDots() {
|
|
21
|
-
const dots = (0, _react.useRef)([0, 1, 2].map(() => new _reactNative.Animated.Value(0.25))).current;
|
|
22
|
-
(0, _react.useEffect)(() => {
|
|
23
|
-
const loops = dots.map((v, i) => _reactNative.Animated.loop(_reactNative.Animated.sequence([_reactNative.Animated.delay(i * 140), _reactNative.Animated.timing(v, {
|
|
24
|
-
toValue: 1,
|
|
25
|
-
duration: 320,
|
|
26
|
-
easing: _reactNative.Easing.inOut(_reactNative.Easing.ease),
|
|
27
|
-
useNativeDriver: true
|
|
28
|
-
}), _reactNative.Animated.timing(v, {
|
|
29
|
-
toValue: 0.25,
|
|
30
|
-
duration: 320,
|
|
31
|
-
easing: _reactNative.Easing.inOut(_reactNative.Easing.ease),
|
|
32
|
-
useNativeDriver: true
|
|
33
|
-
}), _reactNative.Animated.delay((2 - i) * 140)])));
|
|
34
|
-
loops.forEach(l => l.start());
|
|
35
|
-
return () => loops.forEach(l => l.stop());
|
|
36
|
-
}, [dots]);
|
|
37
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
38
|
-
style: styles.wrap,
|
|
39
|
-
testID: "buoy-ask-buoy-typing",
|
|
40
|
-
accessibilityLabel: "Thinking",
|
|
41
|
-
children: dots.map((v, i) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
42
|
-
style: [styles.dot, {
|
|
43
|
-
opacity: v
|
|
44
|
-
}]
|
|
45
|
-
}, i))
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
const styles = _reactNative.StyleSheet.create({
|
|
49
|
-
wrap: {
|
|
50
|
-
flexDirection: "row",
|
|
51
|
-
alignItems: "center",
|
|
52
|
-
gap: 5,
|
|
53
|
-
paddingVertical: 8,
|
|
54
|
-
paddingHorizontal: 2
|
|
55
|
-
},
|
|
56
|
-
dot: {
|
|
57
|
-
width: 7,
|
|
58
|
-
height: 7,
|
|
59
|
-
borderRadius: 4,
|
|
60
|
-
backgroundColor: _sharedUi.night.color.textSecondary
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
//# sourceMappingURL=TypingDots.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TypingDots=TypingDots;var _react=require("react"),_reactNative=require("react-native"),_sharedUi=require("@buoy-gg/shared-ui"),_jsxRuntime=require("react/jsx-runtime");function TypingDots(){const e=(0,_react.useRef)([0,1,2].map(()=>new _reactNative.Animated.Value(.25))).current;return(0,_react.useEffect)(()=>{const t=e.map((e,t)=>_reactNative.Animated.loop(_reactNative.Animated.sequence([_reactNative.Animated.delay(140*t),_reactNative.Animated.timing(e,{toValue:1,duration:320,easing:_reactNative.Easing.inOut(_reactNative.Easing.ease),useNativeDriver:!0}),_reactNative.Animated.timing(e,{toValue:.25,duration:320,easing:_reactNative.Easing.inOut(_reactNative.Easing.ease),useNativeDriver:!0}),_reactNative.Animated.delay(140*(2-t))])));return t.forEach(e=>e.start()),()=>t.forEach(e=>e.stop())},[e]),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.wrap,testID:"buoy-ask-buoy-typing",accessibilityLabel:"Thinking",children:e.map((e,t)=>(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[styles.dot,{opacity:e}]},t))})}const styles=_reactNative.StyleSheet.create({wrap:{flexDirection:"row",alignItems:"center",gap:5,paddingVertical:8,paddingHorizontal:2},dot:{width:7,height:7,borderRadius:4,backgroundColor:_sharedUi.night.color.textSecondary}});
|
|
@@ -1,131 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.TABLE_PREVIEW_ROWS = exports.TABLE_PREVIEW_COLS = void 0;
|
|
7
|
-
exports.parseBlocks = parseBlocks;
|
|
8
|
-
exports.tableTruncation = tableTruncation;
|
|
9
|
-
/**
|
|
10
|
-
* The Markdown parser, kept apart from the renderer so it can be unit-tested
|
|
11
|
-
* without React Native.
|
|
12
|
-
*
|
|
13
|
-
* Just enough for a chat answer: paragraphs, `-`/`*`/`1.` lists, `#` headings,
|
|
14
|
-
* pipe tables, and fenced code. Anything it does not understand falls through
|
|
15
|
-
* as plain text, never as a blank.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
const isTableRow = l => /^\s*\|.*\|\s*$/.test(l);
|
|
19
|
-
const isTableRule = l => /^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)*\|?\s*$/.test(l);
|
|
20
|
-
const splitRow = l => l.trim().replace(/^\|/, "").replace(/\|$/, "").split("|").map(c => c.trim());
|
|
21
|
-
const FENCE = /^\s*```\s*([\w+-]*)\s*$/;
|
|
22
|
-
function parseBlocks(source) {
|
|
23
|
-
const blocks = [];
|
|
24
|
-
let para = [];
|
|
25
|
-
const flush = () => {
|
|
26
|
-
if (para.length) blocks.push({
|
|
27
|
-
kind: "p",
|
|
28
|
-
text: para.join(" ")
|
|
29
|
-
});
|
|
30
|
-
para = [];
|
|
31
|
-
};
|
|
32
|
-
const lines = source.split("\n");
|
|
33
|
-
for (let li = 0; li < lines.length; li++) {
|
|
34
|
-
const raw = lines[li];
|
|
35
|
-
const line = raw.replace(/\s+$/, "");
|
|
36
|
-
|
|
37
|
-
// A fence opens a block that keeps its newlines and indentation — the
|
|
38
|
-
// one place in a chat answer where whitespace IS the content (JSON, a
|
|
39
|
-
// stack trace, a repro). Fences used to be unknown to this parser, so the
|
|
40
|
-
// lines were joined into a paragraph with the backticks shown literally.
|
|
41
|
-
const fence = FENCE.exec(line);
|
|
42
|
-
if (fence) {
|
|
43
|
-
flush();
|
|
44
|
-
const body = [];
|
|
45
|
-
let j = li + 1;
|
|
46
|
-
let closed = false;
|
|
47
|
-
while (j < lines.length) {
|
|
48
|
-
if (/^\s*```\s*$/.test(lines[j])) {
|
|
49
|
-
closed = true;
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
body.push(lines[j]);
|
|
53
|
-
j++;
|
|
54
|
-
}
|
|
55
|
-
blocks.push({
|
|
56
|
-
kind: "code",
|
|
57
|
-
lang: fence[1] ?? "",
|
|
58
|
-
text: body.join("\n"),
|
|
59
|
-
closed
|
|
60
|
-
});
|
|
61
|
-
li = closed ? j : lines.length;
|
|
62
|
-
continue;
|
|
63
|
-
}
|
|
64
|
-
if (!line.trim()) {
|
|
65
|
-
flush();
|
|
66
|
-
continue;
|
|
67
|
-
}
|
|
68
|
-
// A pipe table: header row, a rule row, then body rows.
|
|
69
|
-
if (isTableRow(line) && lines[li + 1] && isTableRule(lines[li + 1])) {
|
|
70
|
-
flush();
|
|
71
|
-
const header = splitRow(line);
|
|
72
|
-
const rows = [];
|
|
73
|
-
let j = li + 2;
|
|
74
|
-
while (j < lines.length && isTableRow(lines[j])) {
|
|
75
|
-
rows.push(splitRow(lines[j]));
|
|
76
|
-
j++;
|
|
77
|
-
}
|
|
78
|
-
blocks.push({
|
|
79
|
-
kind: "table",
|
|
80
|
-
header,
|
|
81
|
-
rows
|
|
82
|
-
});
|
|
83
|
-
li = j - 1;
|
|
84
|
-
continue;
|
|
85
|
-
}
|
|
86
|
-
const heading = /^#{1,6}\s+(.*)$/.exec(line);
|
|
87
|
-
if (heading) {
|
|
88
|
-
flush();
|
|
89
|
-
blocks.push({
|
|
90
|
-
kind: "h",
|
|
91
|
-
text: heading[1]
|
|
92
|
-
});
|
|
93
|
-
continue;
|
|
94
|
-
}
|
|
95
|
-
const bullet = /^(\s*)([-*•]|\d+[.)])\s+(.*)$/.exec(line);
|
|
96
|
-
if (bullet) {
|
|
97
|
-
flush();
|
|
98
|
-
const depth = Math.min(2, Math.floor(bullet[1].length / 2));
|
|
99
|
-
const marker = /^\d/.test(bullet[2]) ? bullet[2].replace(")", ".") : "•";
|
|
100
|
-
blocks.push({
|
|
101
|
-
kind: "li",
|
|
102
|
-
text: bullet[3],
|
|
103
|
-
marker,
|
|
104
|
-
depth
|
|
105
|
-
});
|
|
106
|
-
continue;
|
|
107
|
-
}
|
|
108
|
-
para.push(line.trim());
|
|
109
|
-
}
|
|
110
|
-
flush();
|
|
111
|
-
return blocks;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/** The preview a table is cut to. Past this it says so and offers the rest. */
|
|
115
|
-
const TABLE_PREVIEW_ROWS = exports.TABLE_PREVIEW_ROWS = 12;
|
|
116
|
-
const TABLE_PREVIEW_COLS = exports.TABLE_PREVIEW_COLS = 4;
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* What a table preview leaves out, in the user's words — or null when nothing.
|
|
120
|
-
*
|
|
121
|
-
* The renderer used to slice to 4 columns and 12 rows and say nothing, so a
|
|
122
|
-
* 30-line bag read as a 12-line bag and the bug report that followed was
|
|
123
|
-
* "the bag only has 12 items". Evidence that is cut must say it is cut.
|
|
124
|
-
*/
|
|
125
|
-
function tableTruncation(header, rows) {
|
|
126
|
-
const parts = [];
|
|
127
|
-
if (rows.length > TABLE_PREVIEW_ROWS) parts.push(`${TABLE_PREVIEW_ROWS} of ${rows.length} rows`);
|
|
128
|
-
if (header.length > TABLE_PREVIEW_COLS) parts.push(`${TABLE_PREVIEW_COLS} of ${header.length} columns`);
|
|
129
|
-
return parts.length ? `Showing ${parts.join(" · ")}` : null;
|
|
130
|
-
}
|
|
131
|
-
//# sourceMappingURL=markdownParse.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TABLE_PREVIEW_ROWS=exports.TABLE_PREVIEW_COLS=void 0,exports.parseBlocks=parseBlocks,exports.tableTruncation=tableTruncation;const isTableRow=t=>/^\s*\|.*\|\s*$/.test(t),isTableRule=t=>/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)*\|?\s*$/.test(t),splitRow=t=>t.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim()),FENCE=/^\s*```\s*([\w+-]*)\s*$/;function parseBlocks(t){const e=[];let s=[];const n=()=>{s.length&&e.push({kind:"p",text:s.join(" ")}),s=[]},o=t.split("\n");for(let t=0;t<o.length;t++){const l=o[t].replace(/\s+$/,""),i=FENCE.exec(l);if(i){n();const s=[];let l=t+1,r=!1;for(;l<o.length;){if(/^\s*```\s*$/.test(o[l])){r=!0;break}s.push(o[l]),l++}e.push({kind:"code",lang:i[1]??"",text:s.join("\n"),closed:r}),t=r?l:o.length;continue}if(!l.trim()){n();continue}if(isTableRow(l)&&o[t+1]&&isTableRule(o[t+1])){n();const s=splitRow(l),i=[];let r=t+2;for(;r<o.length&&isTableRow(o[r]);)i.push(splitRow(o[r])),r++;e.push({kind:"table",header:s,rows:i}),t=r-1;continue}const r=/^#{1,6}\s+(.*)$/.exec(l);if(r){n(),e.push({kind:"h",text:r[1]});continue}const c=/^(\s*)([-*•]|\d+[.)])\s+(.*)$/.exec(l);if(c){n();const t=Math.min(2,Math.floor(c[1].length/2)),s=/^\d/.test(c[2])?c[2].replace(")","."):"•";e.push({kind:"li",text:c[3],marker:s,depth:t});continue}s.push(l.trim())}return n(),e}const TABLE_PREVIEW_ROWS=exports.TABLE_PREVIEW_ROWS=12,TABLE_PREVIEW_COLS=exports.TABLE_PREVIEW_COLS=4;function tableTruncation(t,e){const s=[];return e.length>TABLE_PREVIEW_ROWS&&s.push(`${TABLE_PREVIEW_ROWS} of ${e.length} rows`),t.length>TABLE_PREVIEW_COLS&&s.push(`${TABLE_PREVIEW_COLS} of ${t.length} columns`),s.length?`Showing ${s.join(" · ")}`:null}
|