@buoy-gg/ask-buoy 7.0.41 → 7.0.42
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 +13 -98
- 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 -783
- package/lib/commonjs/blocks/ExtraBlocks.js +1 -1862
- package/lib/commonjs/blocks/MediaBlocks.js +1 -158
- package/lib/commonjs/blocks/ReceiptBlocks.js +2 -592
- 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/blocks/ruleStates.js +1 -39
- package/lib/commonjs/components/ApprovalCard.js +1 -297
- package/lib/commonjs/components/AskBuoyHeader.js +1 -196
- package/lib/commonjs/components/AskBuoyIcon.js +1 -19
- package/lib/commonjs/components/AskBuoyModal.js +2 -482
- package/lib/commonjs/components/AskBuoySettings.js +1 -181
- package/lib/commonjs/components/ChangesBar.js +1 -212
- 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 -970
- 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 -91
- 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 +2 -588
- 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 -651
- package/lib/commonjs/store/useAskBuoySettings.js +1 -14
- package/lib/commonjs/sync/askBuoySyncAdapter.js +1 -153
- 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 -769
- package/lib/module/blocks/ExtraBlocks.js +1 -1835
- package/lib/module/blocks/MediaBlocks.js +1 -153
- package/lib/module/blocks/ReceiptBlocks.js +2 -580
- 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/blocks/ruleStates.js +1 -35
- package/lib/module/components/ApprovalCard.js +1 -292
- package/lib/module/components/AskBuoyHeader.js +1 -193
- package/lib/module/components/AskBuoyIcon.js +1 -8
- package/lib/module/components/AskBuoyModal.js +2 -477
- package/lib/module/components/AskBuoySettings.js +1 -176
- 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 -964
- 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 -74
- 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 +2 -582
- 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 -646
- package/lib/module/store/useAskBuoySettings.js +1 -9
- package/lib/module/sync/askBuoySyncAdapter.js +1 -148
- 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/web/index.mjs +11 -12
- package/package.json +8 -8
- 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/blocks/ruleStates.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/blocks/ruleStates.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/blocks/ruleStates.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,292 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The approval prompt, shown only when the policy asks for a tap.
|
|
5
|
-
*
|
|
6
|
-
* It renders the EFFECT, not the payload. That is the whole design constraint:
|
|
7
|
-
* every other agent product assumes a developer is reading the proposed
|
|
8
|
-
* command before approving it, and the people this tool is for cannot evaluate
|
|
9
|
-
* `redux_dispatch({type:'SET_ENTITLEMENTS', payload:{…}})`. An approval prompt
|
|
10
|
-
* nobody can read is not oversight — it is a rubber stamp that looks like
|
|
11
|
-
* oversight, which is worse than having no prompt at all.
|
|
12
|
-
*
|
|
13
|
-
* WHICH IS WHY THE DETAIL IS COLLAPSED. The card sits between the message list
|
|
14
|
-
* and the composer, so its height is taken out of the transcript rather than
|
|
15
|
-
* scrolled: a card taller than the sheet pushes its own buttons off the bottom
|
|
16
|
-
* with nothing to scroll them back. That is what happened — `description` is
|
|
17
|
-
* the catalog summary, written for the MODEL, and zustand's runs to a
|
|
18
|
-
* twenty-line paragraph about merge semantics. A prompt you physically cannot
|
|
19
|
-
* answer is the worst failure mode this component has.
|
|
20
|
-
*
|
|
21
|
-
* So the visible card is fixed-height by construction — the title, the effect
|
|
22
|
-
* in one line, the consequence in one line, a disclosure, and the buttons —
|
|
23
|
-
* and the long text lives behind the disclosure inside a capped scroll box, so
|
|
24
|
-
* expanding it can never push the buttons away again either.
|
|
25
|
-
*/
|
|
26
|
-
import { useState } from "react";
|
|
27
|
-
import { Pressable, ScrollView, StyleSheet, Text, TextInput, View } from "react-native";
|
|
28
|
-
import { AlertTriangle, ChevronDown, night } from "@buoy-gg/shared-ui";
|
|
29
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
|
-
export function ApprovalCard({
|
|
31
|
-
pending,
|
|
32
|
-
onAnswer
|
|
33
|
-
}) {
|
|
34
|
-
const [note, setNote] = useState("");
|
|
35
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
36
|
-
style: styles.card,
|
|
37
|
-
testID: "buoy-ask-buoy-approval",
|
|
38
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
39
|
-
style: styles.titleRow,
|
|
40
|
-
children: [/*#__PURE__*/_jsx(AlertTriangle, {
|
|
41
|
-
size: 14,
|
|
42
|
-
color: night.color.warning
|
|
43
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
44
|
-
style: styles.title,
|
|
45
|
-
children: "Allow this change?"
|
|
46
|
-
})]
|
|
47
|
-
}), pending.restored ? /*#__PURE__*/_jsx(Text, {
|
|
48
|
-
style: styles.restored,
|
|
49
|
-
testID: "buoy-ask-buoy-approval-restored",
|
|
50
|
-
children: "Asked before the app restarted \u2014 check it still applies."
|
|
51
|
-
}) : null, /*#__PURE__*/_jsx(Text, {
|
|
52
|
-
style: styles.label,
|
|
53
|
-
children: pending.label
|
|
54
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
55
|
-
style: styles.reason,
|
|
56
|
-
children: pending.reason
|
|
57
|
-
}), pending.description ? /*#__PURE__*/_jsx(ApprovalDetails, {
|
|
58
|
-
text: pending.description
|
|
59
|
-
}) : null, /*#__PURE__*/_jsx(TextInput, {
|
|
60
|
-
testID: "buoy-ask-buoy-approval-note",
|
|
61
|
-
value: note,
|
|
62
|
-
onChangeText: setNote,
|
|
63
|
-
placeholder: "Add a note for the agent (optional)",
|
|
64
|
-
placeholderTextColor: night.color.textTertiary,
|
|
65
|
-
style: styles.note,
|
|
66
|
-
returnKeyType: "done",
|
|
67
|
-
blurOnSubmit: true
|
|
68
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
69
|
-
style: styles.actions,
|
|
70
|
-
children: [/*#__PURE__*/_jsx(Pressable, {
|
|
71
|
-
testID: "buoy-ask-buoy-approve",
|
|
72
|
-
accessibilityRole: "button",
|
|
73
|
-
onPress: () => onAnswer({
|
|
74
|
-
approved: true,
|
|
75
|
-
reason: note
|
|
76
|
-
}),
|
|
77
|
-
style: ({
|
|
78
|
-
pressed
|
|
79
|
-
}) => [styles.button, styles.approve, pressed && styles.pressed],
|
|
80
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
81
|
-
style: styles.approveText,
|
|
82
|
-
children: "Allow"
|
|
83
|
-
})
|
|
84
|
-
}), pending.restored ? null : /*#__PURE__*/_jsx(Pressable, {
|
|
85
|
-
testID: "buoy-ask-buoy-approve-trust",
|
|
86
|
-
accessibilityRole: "button",
|
|
87
|
-
onPress: () => onAnswer({
|
|
88
|
-
approved: true,
|
|
89
|
-
reason: note,
|
|
90
|
-
trust: true
|
|
91
|
-
}),
|
|
92
|
-
style: ({
|
|
93
|
-
pressed
|
|
94
|
-
}) => [styles.button, styles.trust, pressed && styles.pressed],
|
|
95
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
96
|
-
style: styles.trustText,
|
|
97
|
-
children: "Allow for this chat"
|
|
98
|
-
})
|
|
99
|
-
}), /*#__PURE__*/_jsx(Pressable, {
|
|
100
|
-
testID: "buoy-ask-buoy-reject",
|
|
101
|
-
accessibilityRole: "button",
|
|
102
|
-
onPress: () => onAnswer({
|
|
103
|
-
approved: false,
|
|
104
|
-
reason: note
|
|
105
|
-
}),
|
|
106
|
-
style: ({
|
|
107
|
-
pressed
|
|
108
|
-
}) => [styles.button, styles.reject, pressed && styles.pressed],
|
|
109
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
110
|
-
style: styles.rejectText,
|
|
111
|
-
children: "Not now"
|
|
112
|
-
})
|
|
113
|
-
})]
|
|
114
|
-
})]
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* The catalog's own description, behind a disclosure, closed by default.
|
|
120
|
-
*
|
|
121
|
-
* Owns its open state rather than taking it as a prop: nothing above the card
|
|
122
|
-
* needs to know, and answering the prompt unmounts the whole thing anyway.
|
|
123
|
-
* One ChevronDown rotated in place, not a swap between two icon components —
|
|
124
|
-
* the tree keeps its shape whichever way it is pointing.
|
|
125
|
-
*/
|
|
126
|
-
function ApprovalDetails({
|
|
127
|
-
text
|
|
128
|
-
}) {
|
|
129
|
-
const [open, setOpen] = useState(false);
|
|
130
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
131
|
-
children: [/*#__PURE__*/_jsxs(Pressable, {
|
|
132
|
-
testID: "buoy-ask-buoy-approval-details",
|
|
133
|
-
accessibilityRole: "button",
|
|
134
|
-
accessibilityState: {
|
|
135
|
-
expanded: open
|
|
136
|
-
},
|
|
137
|
-
onPress: () => setOpen(prev => !prev),
|
|
138
|
-
style: ({
|
|
139
|
-
pressed
|
|
140
|
-
}) => [styles.disclosure, pressed && styles.pressed],
|
|
141
|
-
hitSlop: 6,
|
|
142
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
143
|
-
style: open ? styles.chevronOpen : styles.chevronClosed,
|
|
144
|
-
children: /*#__PURE__*/_jsx(ChevronDown, {
|
|
145
|
-
size: 12,
|
|
146
|
-
color: night.color.textTertiary
|
|
147
|
-
})
|
|
148
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
149
|
-
style: styles.disclosureText,
|
|
150
|
-
children: open ? "Hide details" : "Details"
|
|
151
|
-
})]
|
|
152
|
-
}), open ?
|
|
153
|
-
/*#__PURE__*/
|
|
154
|
-
// Capped and scrollable: the text behind this is unbounded, and the
|
|
155
|
-
// buttons below must stay on screen whatever it says.
|
|
156
|
-
_jsx(ScrollView, {
|
|
157
|
-
style: styles.detail,
|
|
158
|
-
contentContainerStyle: styles.detailContent,
|
|
159
|
-
nestedScrollEnabled: true,
|
|
160
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
161
|
-
style: styles.description,
|
|
162
|
-
children: text
|
|
163
|
-
})
|
|
164
|
-
}) : null]
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
const styles = StyleSheet.create({
|
|
168
|
-
card: {
|
|
169
|
-
marginHorizontal: night.gutter,
|
|
170
|
-
marginBottom: 10,
|
|
171
|
-
padding: night.cardPad,
|
|
172
|
-
borderRadius: night.radius.card,
|
|
173
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
174
|
-
borderColor: night.color.accentBorderStrong,
|
|
175
|
-
backgroundColor: night.color.surface,
|
|
176
|
-
gap: 6
|
|
177
|
-
},
|
|
178
|
-
titleRow: {
|
|
179
|
-
flexDirection: "row",
|
|
180
|
-
alignItems: "center",
|
|
181
|
-
gap: 6
|
|
182
|
-
},
|
|
183
|
-
title: {
|
|
184
|
-
color: night.color.text,
|
|
185
|
-
fontSize: night.font.caption,
|
|
186
|
-
fontWeight: "600"
|
|
187
|
-
},
|
|
188
|
-
label: {
|
|
189
|
-
color: night.color.text,
|
|
190
|
-
fontSize: night.font.row,
|
|
191
|
-
fontWeight: "600",
|
|
192
|
-
lineHeight: 20
|
|
193
|
-
},
|
|
194
|
-
description: {
|
|
195
|
-
color: night.color.textSecondary,
|
|
196
|
-
fontSize: night.font.caption,
|
|
197
|
-
lineHeight: 18
|
|
198
|
-
},
|
|
199
|
-
reason: {
|
|
200
|
-
color: night.color.warning,
|
|
201
|
-
fontSize: night.font.caption,
|
|
202
|
-
lineHeight: 18
|
|
203
|
-
},
|
|
204
|
-
restored: {
|
|
205
|
-
color: night.color.info,
|
|
206
|
-
backgroundColor: night.color.infoSoft,
|
|
207
|
-
fontSize: night.font.micro,
|
|
208
|
-
lineHeight: 16,
|
|
209
|
-
paddingHorizontal: 8,
|
|
210
|
-
paddingVertical: 5,
|
|
211
|
-
borderRadius: 8
|
|
212
|
-
},
|
|
213
|
-
disclosure: {
|
|
214
|
-
flexDirection: "row",
|
|
215
|
-
alignItems: "center",
|
|
216
|
-
gap: 4,
|
|
217
|
-
paddingVertical: 4
|
|
218
|
-
},
|
|
219
|
-
disclosureText: {
|
|
220
|
-
color: night.color.textTertiary,
|
|
221
|
-
fontSize: night.font.micro,
|
|
222
|
-
fontWeight: "600"
|
|
223
|
-
},
|
|
224
|
-
chevronOpen: {
|
|
225
|
-
transform: [{
|
|
226
|
-
rotate: "0deg"
|
|
227
|
-
}]
|
|
228
|
-
},
|
|
229
|
-
chevronClosed: {
|
|
230
|
-
transform: [{
|
|
231
|
-
rotate: "-90deg"
|
|
232
|
-
}]
|
|
233
|
-
},
|
|
234
|
-
detail: {
|
|
235
|
-
maxHeight: 150,
|
|
236
|
-
marginTop: 2
|
|
237
|
-
},
|
|
238
|
-
detailContent: {
|
|
239
|
-
paddingBottom: 2
|
|
240
|
-
},
|
|
241
|
-
note: {
|
|
242
|
-
color: night.color.text,
|
|
243
|
-
fontSize: night.font.caption,
|
|
244
|
-
paddingHorizontal: 10,
|
|
245
|
-
paddingVertical: 7,
|
|
246
|
-
borderRadius: night.radius.row,
|
|
247
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
248
|
-
borderColor: night.color.border,
|
|
249
|
-
backgroundColor: night.color.button,
|
|
250
|
-
marginTop: 2
|
|
251
|
-
},
|
|
252
|
-
actions: {
|
|
253
|
-
flexDirection: "row",
|
|
254
|
-
flexWrap: "wrap",
|
|
255
|
-
gap: 8,
|
|
256
|
-
marginTop: 6
|
|
257
|
-
},
|
|
258
|
-
button: {
|
|
259
|
-
paddingHorizontal: 16,
|
|
260
|
-
paddingVertical: 9,
|
|
261
|
-
borderRadius: night.radius.row
|
|
262
|
-
},
|
|
263
|
-
approve: {
|
|
264
|
-
backgroundColor: night.color.accent
|
|
265
|
-
},
|
|
266
|
-
approveText: {
|
|
267
|
-
color: night.color.onAccent,
|
|
268
|
-
fontWeight: "600",
|
|
269
|
-
fontSize: night.font.caption
|
|
270
|
-
},
|
|
271
|
-
trust: {
|
|
272
|
-
backgroundColor: night.color.button,
|
|
273
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
274
|
-
borderColor: night.color.accentBorderStrong
|
|
275
|
-
},
|
|
276
|
-
trustText: {
|
|
277
|
-
color: night.color.accent,
|
|
278
|
-
fontWeight: "600",
|
|
279
|
-
fontSize: night.font.caption
|
|
280
|
-
},
|
|
281
|
-
reject: {
|
|
282
|
-
backgroundColor: night.color.button
|
|
283
|
-
},
|
|
284
|
-
rejectText: {
|
|
285
|
-
color: night.color.text,
|
|
286
|
-
fontSize: night.font.caption
|
|
287
|
-
},
|
|
288
|
-
pressed: {
|
|
289
|
-
opacity: 0.7
|
|
290
|
-
}
|
|
291
|
-
});
|
|
292
|
-
//# sourceMappingURL=ApprovalCard.js.map
|
|
1
|
+
"use strict";import{useState as h}from"react";import{Pressable as p,ScrollView as b,StyleSheet as u,Text as r,TextInput as y,View as s}from"react-native";import{AlertTriangle as f,ChevronDown as g,night as o}from"@buoy-gg/shared-ui";import{jsx as t,jsxs as d}from"react/jsx-runtime";export function ApprovalCard({pending:l,onAnswer:n}){const[i,a]=h("");return d(s,{style:e.card,testID:"buoy-ask-buoy-approval",children:[d(s,{style:e.titleRow,children:[t(f,{size:14,color:o.color.warning}),t(r,{style:e.title,children:"Allow this change?"})]}),l.restored?t(r,{style:e.restored,testID:"buoy-ask-buoy-approval-restored",children:"Asked before the app restarted \u2014 check it still applies."}):null,t(r,{style:e.label,children:l.label}),t(r,{style:e.reason,children:l.reason}),l.description?t(x,{text:l.description}):null,t(y,{testID:"buoy-ask-buoy-approval-note",value:i,onChangeText:a,placeholder:"Add a note for the agent (optional)",placeholderTextColor:o.color.textTertiary,style:e.note,returnKeyType:"done",blurOnSubmit:true}),d(s,{style:e.actions,children:[t(p,{testID:"buoy-ask-buoy-approve",accessibilityRole:"button",onPress:()=>n({approved:true,reason:i}),style:({pressed:c})=>[e.button,e.approve,c&&e.pressed],children:t(r,{style:e.approveText,children:"Allow"})}),l.restored?null:t(p,{testID:"buoy-ask-buoy-approve-trust",accessibilityRole:"button",onPress:()=>n({approved:true,reason:i,trust:true}),style:({pressed:c})=>[e.button,e.trust,c&&e.pressed],children:t(r,{style:e.trustText,children:"Allow for this chat"})}),t(p,{testID:"buoy-ask-buoy-reject",accessibilityRole:"button",onPress:()=>n({approved:false,reason:i}),style:({pressed:c})=>[e.button,e.reject,c&&e.pressed],children:t(r,{style:e.rejectText,children:"Not now"})})]})]})}function x({text:l}){const[n,i]=h(false);return d(s,{children:[d(p,{testID:"buoy-ask-buoy-approval-details",accessibilityRole:"button",accessibilityState:{expanded:n},onPress:()=>i(a=>!a),style:({pressed:a})=>[e.disclosure,a&&e.pressed],hitSlop:6,children:[t(s,{style:n?e.chevronOpen:e.chevronClosed,children:t(g,{size:12,color:o.color.textTertiary})}),t(r,{style:e.disclosureText,children:n?"Hide details":"Details"})]}),n?t(b,{style:e.detail,contentContainerStyle:e.detailContent,nestedScrollEnabled:true,children:t(r,{style:e.description,children:l})}):null]})}const e=u.create({card:{marginHorizontal:o.gutter,marginBottom:10,padding:o.cardPad,borderRadius:o.radius.card,borderWidth:u.hairlineWidth,borderColor:o.color.accentBorderStrong,backgroundColor:o.color.surface,gap:6},titleRow:{flexDirection:"row",alignItems:"center",gap:6},title:{color:o.color.text,fontSize:o.font.caption,fontWeight:"600"},label:{color:o.color.text,fontSize:o.font.row,fontWeight:"600",lineHeight:20},description:{color:o.color.textSecondary,fontSize:o.font.caption,lineHeight:18},reason:{color:o.color.warning,fontSize:o.font.caption,lineHeight:18},restored:{color:o.color.info,backgroundColor:o.color.infoSoft,fontSize:o.font.micro,lineHeight:16,paddingHorizontal:8,paddingVertical:5,borderRadius:8},disclosure:{flexDirection:"row",alignItems:"center",gap:4,paddingVertical:4},disclosureText:{color:o.color.textTertiary,fontSize:o.font.micro,fontWeight:"600"},chevronOpen:{transform:[{rotate:"0deg"}]},chevronClosed:{transform:[{rotate:"-90deg"}]},detail:{maxHeight:150,marginTop:2},detailContent:{paddingBottom:2},note:{color:o.color.text,fontSize:o.font.caption,paddingHorizontal:10,paddingVertical:7,borderRadius:o.radius.row,borderWidth:u.hairlineWidth,borderColor:o.color.border,backgroundColor:o.color.button,marginTop:2},actions:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:6},button:{paddingHorizontal:16,paddingVertical:9,borderRadius:o.radius.row},approve:{backgroundColor:o.color.accent},approveText:{color:o.color.onAccent,fontWeight:"600",fontSize:o.font.caption},trust:{backgroundColor:o.color.button,borderWidth:u.hairlineWidth,borderColor:o.color.accentBorderStrong},trustText:{color:o.color.accent,fontWeight:"600",fontSize:o.font.caption},reject:{backgroundColor:o.color.button},rejectText:{color:o.color.text,fontSize:o.font.caption},pressed:{opacity:.7}});
|
|
@@ -1,193 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The sheet header.
|
|
5
|
-
*
|
|
6
|
-
* Built on the shared `ModalHeader` so it matches Console, Network and Events
|
|
7
|
-
* 1:1 — the stock JsModal header was designed for a single centred title and
|
|
8
|
-
* paints its "Double tap: Toggle • Triple tap: Close" hint through the middle
|
|
9
|
-
* of it, which is how "Ask Buoy" ended up overprinted by grey italics.
|
|
10
|
-
*
|
|
11
|
-
* The subtitle is the one piece of live status the sheet has: what the agent
|
|
12
|
-
* is doing right now, in words a tester can act on. "Thinking…" while a
|
|
13
|
-
* response is streaming with no tool in flight, the current tool's title
|
|
14
|
-
* while one runs, and the reachable tool count at rest so a "why can't it
|
|
15
|
-
* see my network calls" question has an answer in the header.
|
|
16
|
-
*
|
|
17
|
-
* "New conversation" moved up here from a 11pt text link under the composer.
|
|
18
|
-
* A reset that lives under the keyboard is a reset nobody finds. Copy sits
|
|
19
|
-
* beside it for the same reason: the transcript actions under the newest
|
|
20
|
-
* answer are only reachable once you have scrolled back down to it.
|
|
21
|
-
*/
|
|
22
|
-
import { useEffect, useState } from "react";
|
|
23
|
-
import { StyleSheet, TouchableOpacity, View } from "react-native";
|
|
24
|
-
import { Check, Copy, FileText, ModalHeader, night, Otto, Plus, SettingsSolid } from "@buoy-gg/shared-ui";
|
|
25
|
-
import { useCopyAction } from "./useCopyAction";
|
|
26
|
-
import { formatElapsed } from "../store/activityGroups";
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Slower than the sprite's default 140ms.
|
|
30
|
-
*
|
|
31
|
-
* This mascot is ambient status a user stares at for the length of a turn,
|
|
32
|
-
* not a moment of delight they glance at once — at the stock tick it read as
|
|
33
|
-
* fidgeting in the corner of the eye while you were trying to read the
|
|
34
|
-
* answer next to it. Every other placement keeps the default.
|
|
35
|
-
*/
|
|
36
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
37
|
-
const HEADER_TICK_MS = 200;
|
|
38
|
-
|
|
39
|
-
/** No conversation to copy — the button is left out rather than left dead. */
|
|
40
|
-
const NO_TRANSCRIPT = () => "";
|
|
41
|
-
export function AskBuoyHeader({
|
|
42
|
-
configured,
|
|
43
|
-
busy,
|
|
44
|
-
failed = false,
|
|
45
|
-
activeLabel,
|
|
46
|
-
awaitingApproval = false,
|
|
47
|
-
startedAt = null,
|
|
48
|
-
stopping = false,
|
|
49
|
-
readOnly = false,
|
|
50
|
-
toolCount,
|
|
51
|
-
hasMessages,
|
|
52
|
-
onBack,
|
|
53
|
-
onReset,
|
|
54
|
-
getTranscript,
|
|
55
|
-
onOpenSettings,
|
|
56
|
-
onTicket
|
|
57
|
-
}) {
|
|
58
|
-
const {
|
|
59
|
-
copied,
|
|
60
|
-
copy
|
|
61
|
-
} = useCopyAction(getTranscript ?? NO_TRANSCRIPT);
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* ONE mascot state per turn, held to the end of it.
|
|
65
|
-
*
|
|
66
|
-
* `activeLabel` drops to null in the gap between two tool calls, so deriving
|
|
67
|
-
* the state from it directly flipped robot → thinking → robot on every
|
|
68
|
-
* boundary. A turn that runs four tools swapped the sprite eight times in
|
|
69
|
-
* about three seconds — a strobe that reads as a glitch, not as progress.
|
|
70
|
-
* So the robot latches: once this turn has driven a tool it stays `robot`
|
|
71
|
-
* until the turn ends, which is also the honest summary of that turn.
|
|
72
|
-
*
|
|
73
|
-
* The SUBTITLE still tracks each call, because updating a line of text is
|
|
74
|
-
* informative where restarting an animation is just noise.
|
|
75
|
-
*/
|
|
76
|
-
const [droveTool, setDroveTool] = useState(false);
|
|
77
|
-
useEffect(() => {
|
|
78
|
-
if (!busy) setDroveTool(false);else if (activeLabel) setDroveTool(true);
|
|
79
|
-
}, [busy, activeLabel]);
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* The elapsed clock. Ticks only while a turn is running and not parked on
|
|
83
|
-
* the user (nothing is elapsing while an approval card waits for a tap).
|
|
84
|
-
*/
|
|
85
|
-
const ticking = busy && !awaitingApproval && startedAt !== null;
|
|
86
|
-
const [now, setNow] = useState(() => Date.now());
|
|
87
|
-
useEffect(() => {
|
|
88
|
-
if (!ticking) return;
|
|
89
|
-
setNow(Date.now());
|
|
90
|
-
const timer = setInterval(() => setNow(Date.now()), 1000);
|
|
91
|
-
return () => clearInterval(timer);
|
|
92
|
-
}, [ticking]);
|
|
93
|
-
const elapsed = ticking && startedAt !== null ? formatElapsed(now - startedAt) : null;
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Otto mirrors the subtitle, never contradicts it. This is the one place in
|
|
97
|
-
* the product where a mascot earns continuous presence: the user is waiting
|
|
98
|
-
* on a machine and the header is the only thing reporting on it.
|
|
99
|
-
*
|
|
100
|
-
* `robot` while a tool runs is literal — the agent IS driving the tools.
|
|
101
|
-
*/
|
|
102
|
-
const otto = !configured ? "confused" : failed ? "error" : busy ? activeLabel || droveTool ? "robot" : "thinking" : "idle";
|
|
103
|
-
const working = stopping ? "Stopping" : activeLabel ?? "Thinking";
|
|
104
|
-
const subtitle = !configured ? "Not set up in this app" : awaitingApproval ? "Waiting for you" : busy ? elapsed ? `${working} · ${elapsed}` : `${working}…` : readOnly ? `Read only${toolCount > 0 ? ` · ${toolCount} tool${toolCount === 1 ? "" : "s"}` : ""}` : toolCount > 0 ? `Ready · ${toolCount} tool${toolCount === 1 ? "" : "s"} available` : "Ready";
|
|
105
|
-
return /*#__PURE__*/_jsxs(ModalHeader, {
|
|
106
|
-
children: [onBack ? /*#__PURE__*/_jsx(ModalHeader.Navigation, {
|
|
107
|
-
onBack: onBack
|
|
108
|
-
}) : null, /*#__PURE__*/_jsx(View, {
|
|
109
|
-
style: styles.otto,
|
|
110
|
-
testID: "buoy-ask-buoy-otto",
|
|
111
|
-
children: /*#__PURE__*/_jsx(Otto, {
|
|
112
|
-
state: otto,
|
|
113
|
-
pixelSize: 2,
|
|
114
|
-
tickMs: HEADER_TICK_MS,
|
|
115
|
-
water: false
|
|
116
|
-
})
|
|
117
|
-
}), /*#__PURE__*/_jsx(ModalHeader.Content, {
|
|
118
|
-
title: "Ask Buoy",
|
|
119
|
-
subtitle: subtitle,
|
|
120
|
-
testID: "buoy-ask-buoy-title"
|
|
121
|
-
}), /*#__PURE__*/_jsxs(ModalHeader.Actions, {
|
|
122
|
-
children: [onTicket ? /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
123
|
-
testID: "buoy-ask-buoy-ticket",
|
|
124
|
-
accessibilityRole: "button",
|
|
125
|
-
accessibilityLabel: "Summarize for a ticket",
|
|
126
|
-
disabled: !hasMessages || busy,
|
|
127
|
-
onPress: onTicket,
|
|
128
|
-
style: [styles.actionBtn, (!hasMessages || busy) && styles.actionBtnDisabled],
|
|
129
|
-
children: /*#__PURE__*/_jsx(FileText, {
|
|
130
|
-
size: 14,
|
|
131
|
-
color: hasMessages && !busy ? night.color.textSecondary : night.color.textTertiary
|
|
132
|
-
})
|
|
133
|
-
}) : null, getTranscript ? /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
134
|
-
testID: "buoy-ask-buoy-copy-chat",
|
|
135
|
-
accessibilityRole: "button",
|
|
136
|
-
accessibilityLabel: copied ? "Conversation copied" : "Copy conversation",
|
|
137
|
-
disabled: !hasMessages,
|
|
138
|
-
onPress: copy,
|
|
139
|
-
style: [styles.actionBtn, !hasMessages && styles.actionBtnDisabled],
|
|
140
|
-
children: copied ? /*#__PURE__*/_jsx(Check, {
|
|
141
|
-
size: 14,
|
|
142
|
-
color: night.color.accent
|
|
143
|
-
}) : /*#__PURE__*/_jsx(Copy, {
|
|
144
|
-
size: 14,
|
|
145
|
-
color: hasMessages ? night.color.textSecondary : night.color.textTertiary
|
|
146
|
-
})
|
|
147
|
-
}) : null, onOpenSettings ? /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
148
|
-
testID: "buoy-ask-buoy-settings",
|
|
149
|
-
accessibilityRole: "button",
|
|
150
|
-
accessibilityLabel: "Settings",
|
|
151
|
-
onPress: onOpenSettings,
|
|
152
|
-
style: styles.actionBtn,
|
|
153
|
-
children: /*#__PURE__*/_jsx(SettingsSolid, {
|
|
154
|
-
size: 14,
|
|
155
|
-
color: night.color.textSecondary
|
|
156
|
-
})
|
|
157
|
-
}) : null, /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
158
|
-
testID: "buoy-ask-buoy-reset",
|
|
159
|
-
accessibilityRole: "button",
|
|
160
|
-
accessibilityLabel: "New conversation",
|
|
161
|
-
disabled: !hasMessages,
|
|
162
|
-
onPress: onReset,
|
|
163
|
-
style: [styles.actionBtn, !hasMessages && styles.actionBtnDisabled],
|
|
164
|
-
children: /*#__PURE__*/_jsx(Plus, {
|
|
165
|
-
size: 14,
|
|
166
|
-
color: hasMessages ? night.color.textSecondary : night.color.textTertiary
|
|
167
|
-
})
|
|
168
|
-
})]
|
|
169
|
-
})]
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
const styles = StyleSheet.create({
|
|
173
|
-
// 32pt of Otto (16 grid × 2pt) reading as the header's status glyph.
|
|
174
|
-
otto: {
|
|
175
|
-
marginRight: 8,
|
|
176
|
-
justifyContent: "center"
|
|
177
|
-
},
|
|
178
|
-
// Same plate as the Console header's action buttons.
|
|
179
|
-
actionBtn: {
|
|
180
|
-
width: 32,
|
|
181
|
-
height: 32,
|
|
182
|
-
borderRadius: 8,
|
|
183
|
-
backgroundColor: night.color.buttonSurface,
|
|
184
|
-
borderWidth: 1,
|
|
185
|
-
borderColor: night.color.border,
|
|
186
|
-
alignItems: "center",
|
|
187
|
-
justifyContent: "center"
|
|
188
|
-
},
|
|
189
|
-
actionBtnDisabled: {
|
|
190
|
-
opacity: 0.55
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
//# sourceMappingURL=AskBuoyHeader.js.map
|
|
1
|
+
"use strict";import{useEffect as B,useState as I}from"react";import{StyleSheet as E,TouchableOpacity as c,View as A}from"react-native";import{Check as H,Copy as O,FileText as W,ModalHeader as s,night as o,Otto as F,Plus as K,SettingsSolid as L,realNow as d}from"@buoy-gg/shared-ui";import{useCopyAction as V}from"./useCopyAction";import{formatElapsed as q}from"../store/activityGroups";import{jsx as t,jsxs as T}from"react/jsx-runtime";const G=200;const J=()=>"";export function AskBuoyHeader({configured:b,busy:i,failed:$=false,activeLabel:r,awaitingApproval:u=false,startedAt:a=null,stopping:w=false,readOnly:z=false,toolCount:n,hasMessages:e,onBack:f,onReset:C,getTranscript:p,onOpenSettings:m,onTicket:k}){const{copied:S,copy:N}=V(p??J);const[j,x]=I(false);B(()=>{if(!i)x(false);else if(r)x(true)},[i,r]);const y=i&&!u&&a!==null;const[P,h]=I(()=>d());B(()=>{if(!y)return;h(d());const g=setInterval(()=>h(d()),1e3);return()=>clearInterval(g)},[y]);const D=y&&a!==null?q(P-a):null;const v=!b?"confused":$?"error":i?r||j?"robot":"thinking":"idle";const R=w?"Stopping":r??"Thinking";const _=!b?"Not set up in this app":u?"Waiting for you":i?D?`${R} \xB7 ${D}`:`${R}\u2026`:z?`Read only${n>0?` \xB7 ${n} tool${n===1?"":"s"}`:""}`:n>0?`Ready \xB7 ${n} tool${n===1?"":"s"} available`:"Ready";return T(s,{children:[f?t(s.Navigation,{onBack:f}):null,t(A,{style:l.otto,testID:"buoy-ask-buoy-otto",children:t(F,{state:v,pixelSize:2,tickMs:G,water:false})}),t(s.Content,{title:"Ask Buoy",subtitle:_,testID:"buoy-ask-buoy-title"}),T(s.Actions,{children:[k?t(c,{testID:"buoy-ask-buoy-ticket",accessibilityRole:"button",accessibilityLabel:"Summarize for a ticket",disabled:!e||i,onPress:k,style:[l.actionBtn,(!e||i)&&l.actionBtnDisabled],children:t(W,{size:14,color:e&&!i?o.color.textSecondary:o.color.textTertiary})}):null,p?t(c,{testID:"buoy-ask-buoy-copy-chat",accessibilityRole:"button",accessibilityLabel:S?"Conversation copied":"Copy conversation",disabled:!e,onPress:N,style:[l.actionBtn,!e&&l.actionBtnDisabled],children:S?t(H,{size:14,color:o.color.accent}):t(O,{size:14,color:e?o.color.textSecondary:o.color.textTertiary})}):null,m?t(c,{testID:"buoy-ask-buoy-settings",accessibilityRole:"button",accessibilityLabel:"Settings",onPress:m,style:l.actionBtn,children:t(L,{size:14,color:o.color.textSecondary})}):null,t(c,{testID:"buoy-ask-buoy-reset",accessibilityRole:"button",accessibilityLabel:"New conversation",disabled:!e,onPress:C,style:[l.actionBtn,!e&&l.actionBtnDisabled],children:t(K,{size:14,color:e?o.color.textSecondary:o.color.textTertiary})})]})]})}const l=E.create({otto:{marginRight:8,justifyContent:"center"},actionBtn:{width:32,height:32,borderRadius:8,backgroundColor:o.color.buttonSurface,borderWidth:1,borderColor:o.color.border,alignItems:"center",justifyContent:"center"},actionBtnDisabled:{opacity:.55}});
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Re-exported from floating-tools-core so the tool package has one import
|
|
5
|
-
* surface, matching how every other Buoy tool exposes its icon.
|
|
6
|
-
*/
|
|
7
|
-
export { AskBuoyIcon, ASK_BUOY_ICON_COLOR } from "@buoy-gg/floating-tools-core";
|
|
8
|
-
//# sourceMappingURL=AskBuoyIcon.js.map
|
|
1
|
+
"use strict";export{AskBuoyIcon,ASK_BUOY_ICON_COLOR}from"@buoy-gg/floating-tools-core";
|