@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,140 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.askBuoySyncAdapter = exports.ASK_BUOY_ADAPTER_VERSION = void 0;
|
|
7
|
-
var _resetConversation = require("../store/resetConversation");
|
|
8
|
-
var _wire = require("./wire");
|
|
9
|
-
var _agentCore = require("@buoy-gg/agent-core");
|
|
10
|
-
var _askBuoyStore = require("../store/askBuoyStore");
|
|
11
|
-
/**
|
|
12
|
-
* The sync adapter, so Buoy Desktop and MCP can see what Ask Buoy is doing.
|
|
13
|
-
*
|
|
14
|
-
* Read-heavy on purpose. There is no `send` action: letting a remote client
|
|
15
|
-
* put words in the agent's mouth would mean anyone who can reach the broker —
|
|
16
|
-
* which has no authentication at all, binds 0.0.0.0, and accepts any client
|
|
17
|
-
* calling itself "Dashboard" — could drive a mutating agent on a tester's
|
|
18
|
-
* device. The chat is initiated on-device, by a person, full stop.
|
|
19
|
-
*
|
|
20
|
-
* `undoAll` IS exposed, because the asymmetry is deliberate: putting things
|
|
21
|
-
* back is the safe direction, and a dev watching from the desktop should be
|
|
22
|
-
* able to clean up a device without walking over to it.
|
|
23
|
-
*
|
|
24
|
-
* The transcript is redacted before it crosses the wire. Action results the
|
|
25
|
-
* agent read can contain storage values and response bodies, and this socket
|
|
26
|
-
* broadcasts to every connected dashboard — it already leaks license keys the
|
|
27
|
-
* same way.
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
const ASK_BUOY_ADAPTER_VERSION = exports.ASK_BUOY_ADAPTER_VERSION = 1;
|
|
31
|
-
const askBuoySyncAdapter = exports.askBuoySyncAdapter = {
|
|
32
|
-
version: ASK_BUOY_ADAPTER_VERSION,
|
|
33
|
-
getSnapshot() {
|
|
34
|
-
const state = _askBuoyStore.askBuoyStore.getState();
|
|
35
|
-
const ledger = _askBuoyStore.askBuoyStore.getLedger();
|
|
36
|
-
const entries = ledger?.list() ?? [];
|
|
37
|
-
const outstanding = entries.filter(e => !e.undoneAt);
|
|
38
|
-
return {
|
|
39
|
-
version: ASK_BUOY_ADAPTER_VERSION,
|
|
40
|
-
busy: state.busy,
|
|
41
|
-
configured: state.configured,
|
|
42
|
-
notice: state.notice,
|
|
43
|
-
messageCount: state.messages.length,
|
|
44
|
-
// Only the shape of the conversation, never tool payloads.
|
|
45
|
-
messages: state.messages.map(m => ({
|
|
46
|
-
id: m.id,
|
|
47
|
-
role: m.role,
|
|
48
|
-
text: (0, _wire.redactForWire)(m.text),
|
|
49
|
-
streaming: !!m.streaming,
|
|
50
|
-
toolCalls: m.toolCalls.map(c => ({
|
|
51
|
-
toolId: c.toolId,
|
|
52
|
-
action: c.action,
|
|
53
|
-
status: c.status
|
|
54
|
-
}))
|
|
55
|
-
})),
|
|
56
|
-
// Session token totals, so a desktop/MCP observer can meter cost.
|
|
57
|
-
usage: state.usage,
|
|
58
|
-
pendingApproval: state.pending ? {
|
|
59
|
-
toolId: state.pending.toolId,
|
|
60
|
-
action: state.pending.action,
|
|
61
|
-
label: state.pending.label
|
|
62
|
-
} : null,
|
|
63
|
-
changes: {
|
|
64
|
-
// Transients (navigation, taps) are one-shot actions, not changes —
|
|
65
|
-
// same rule as the on-device bar, so desktop and device tell one story.
|
|
66
|
-
reversible: outstanding.filter(e => (0, _agentCore.isReversible)(e.effect)).length,
|
|
67
|
-
permanent: outstanding.filter(e => e.effect.kind !== "transient" && !(0, _agentCore.isReversible)(e.effect)).length,
|
|
68
|
-
transients: outstanding.filter(e => e.effect.kind === "transient").length,
|
|
69
|
-
items: outstanding.map(e => ({
|
|
70
|
-
kind: e.effect.kind,
|
|
71
|
-
label: e.effect.label
|
|
72
|
-
}))
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
subscribe(onChange) {
|
|
77
|
-
const offStore = _askBuoyStore.askBuoyStore.subscribe(onChange);
|
|
78
|
-
const offLedger = _askBuoyStore.askBuoyStore.getLedger()?.subscribe(onChange);
|
|
79
|
-
return () => {
|
|
80
|
-
offStore();
|
|
81
|
-
offLedger?.();
|
|
82
|
-
};
|
|
83
|
-
},
|
|
84
|
-
actions: {
|
|
85
|
-
/** What the agent changed, and whether it can be put back. */
|
|
86
|
-
listChanges: () => {
|
|
87
|
-
const entries = _askBuoyStore.askBuoyStore.getLedger()?.list() ?? [];
|
|
88
|
-
return entries.filter(e => !e.undoneAt).map(e => ({
|
|
89
|
-
id: e.id,
|
|
90
|
-
at: e.at,
|
|
91
|
-
toolId: e.toolId,
|
|
92
|
-
action: e.action,
|
|
93
|
-
kind: e.effect.kind,
|
|
94
|
-
label: e.effect.label,
|
|
95
|
-
reversible: (0, _agentCore.isReversible)(e.effect)
|
|
96
|
-
}));
|
|
97
|
-
},
|
|
98
|
-
/** Put back everything that can be put back. Safe direction only. */
|
|
99
|
-
undoAll: async () => {
|
|
100
|
-
const ledger = _askBuoyStore.askBuoyStore.getLedger();
|
|
101
|
-
if (!ledger) return {
|
|
102
|
-
ok: false,
|
|
103
|
-
error: "No Ask Buoy session on this device."
|
|
104
|
-
};
|
|
105
|
-
const outcome = await ledger.revertAll(_wire.dispatchToolAction);
|
|
106
|
-
return {
|
|
107
|
-
ok: true,
|
|
108
|
-
...outcome
|
|
109
|
-
};
|
|
110
|
-
},
|
|
111
|
-
/**
|
|
112
|
-
* Undo what can be undone, then clear the transcript and the ledger.
|
|
113
|
-
*
|
|
114
|
-
* The same path as the sheet's "New conversation" (resetConversation.ts).
|
|
115
|
-
* This action used to clear unconditionally — no question, no undo — so a
|
|
116
|
-
* desktop click could drop the only undo record for changes still live on
|
|
117
|
-
* the tester's phone. Now it refuses to clear when a revert fails and says
|
|
118
|
-
* what is still applied; the dashboard decides whether to clear anyway
|
|
119
|
-
* by calling `undoAll` first or accepting the kept conversation.
|
|
120
|
-
*/
|
|
121
|
-
reset: async () => {
|
|
122
|
-
const outcome = await (0, _resetConversation.resetConversation)({
|
|
123
|
-
dispatch: _wire.dispatchToolAction,
|
|
124
|
-
undoFirst: true
|
|
125
|
-
});
|
|
126
|
-
if (!outcome.cleared) {
|
|
127
|
-
return {
|
|
128
|
-
ok: false,
|
|
129
|
-
error: `Couldn't undo ${outcome.failed.length} change${outcome.failed.length === 1 ? "" : "s"} — conversation kept.`,
|
|
130
|
-
failed: outcome.failed
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
return {
|
|
134
|
-
ok: true,
|
|
135
|
-
reverted: outcome.reverted
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
//# sourceMappingURL=askBuoySyncAdapter.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.askBuoySyncAdapter=exports.ASK_BUOY_ADAPTER_VERSION=void 0;var _resetConversation=require("../store/resetConversation"),_wire=require("./wire"),_agentCore=require("@buoy-gg/agent-core"),_askBuoyStore=require("../store/askBuoyStore");const ASK_BUOY_ADAPTER_VERSION=exports.ASK_BUOY_ADAPTER_VERSION=1,askBuoySyncAdapter=exports.askBuoySyncAdapter={version:ASK_BUOY_ADAPTER_VERSION,async dispose(e){const t=_askBuoyStore.askBuoyStore.getLedger();for(const o of t?.list()??[])o.undoneAt||"network-override"===o.effect.kind&&await e("network","deleteOverrideRule",{id:o.effect.ruleId})},getSnapshot(){const e=_askBuoyStore.askBuoyStore.getState(),t=_askBuoyStore.askBuoyStore.getLedger(),o=(t?.list()??[]).filter(e=>!e.undoneAt);return{version:ASK_BUOY_ADAPTER_VERSION,busy:e.busy,configured:e.configured,notice:e.notice,messageCount:e.messages.length,messages:e.messages.map(e=>({id:e.id,role:e.role,text:(0,_wire.redactForWire)(e.text),streaming:!!e.streaming,toolCalls:e.toolCalls.map(e=>({toolId:e.toolId,action:e.action,status:e.status}))})),usage:e.usage,pendingApproval:e.pending?{toolId:e.pending.toolId,action:e.pending.action,label:e.pending.label}:null,changes:{reversible:o.filter(e=>(0,_agentCore.isReversible)(e.effect)).length,permanent:o.filter(e=>"transient"!==e.effect.kind&&!(0,_agentCore.isReversible)(e.effect)).length,transients:o.filter(e=>"transient"===e.effect.kind).length,items:o.map(e=>({kind:e.effect.kind,label:e.effect.label}))}}},subscribe(e){const t=_askBuoyStore.askBuoyStore.subscribe(e),o=_askBuoyStore.askBuoyStore.getLedger()?.subscribe(e);return()=>{t(),o?.()}},actions:{listChanges:()=>(_askBuoyStore.askBuoyStore.getLedger()?.list()??[]).filter(e=>!e.undoneAt).map(e=>({id:e.id,at:e.at,toolId:e.toolId,action:e.action,kind:e.effect.kind,label:e.effect.label,reversible:(0,_agentCore.isReversible)(e.effect)})),undoAll:async()=>{const e=_askBuoyStore.askBuoyStore.getLedger();return e?{ok:!0,...await e.revertAll(_wire.dispatchToolAction)}:{ok:!1,error:"No Ask Buoy session on this device."}},reset:async()=>{const e=await(0,_resetConversation.resetConversation)({dispatch:_wire.dispatchToolAction,undoFirst:!0});return e.cleared?{ok:!0,reverted:e.reverted}:{ok:!1,error:`Couldn't undo ${e.failed.length} change${1===e.failed.length?"":"s"} — conversation kept.`,failed:e.failed}}}};
|
|
@@ -1,141 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _vitest = require("vitest");
|
|
4
|
-
var _agentCore = require("@buoy-gg/agent-core");
|
|
5
|
-
var _askBuoySyncAdapter = require("./askBuoySyncAdapter");
|
|
6
|
-
var _wire = require("./wire");
|
|
7
|
-
var _askBuoyStore = require("../store/askBuoyStore");
|
|
8
|
-
/**
|
|
9
|
-
* What Ask Buoy is allowed to put on the broker wire, and what it refuses to
|
|
10
|
-
* accept from it.
|
|
11
|
-
*
|
|
12
|
-
* Both directions matter. The broker has no authentication, accepts any client
|
|
13
|
-
* that calls itself "Dashboard", and forwards to every connected dashboard — it
|
|
14
|
-
* already broadcasts license keys that way. So: no tool results go out, and no
|
|
15
|
-
* remote client can make the agent say anything.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
(0, _vitest.beforeEach)(() => {
|
|
19
|
-
_askBuoyStore.askBuoyStore.reset();
|
|
20
|
-
_askBuoyStore.askBuoyStore.setLedger(null);
|
|
21
|
-
});
|
|
22
|
-
(0, _vitest.describe)("the wire surface", () => {
|
|
23
|
-
(0, _vitest.it)("exposes no action that can make the agent talk", () => {
|
|
24
|
-
// A `send` here would let anyone on the LAN drive a mutating agent on a
|
|
25
|
-
// tester's phone. The conversation starts on-device, by a person.
|
|
26
|
-
const actions = Object.keys(_askBuoySyncAdapter.askBuoySyncAdapter.actions);
|
|
27
|
-
(0, _vitest.expect)(actions).not.toContain("send");
|
|
28
|
-
(0, _vitest.expect)(actions).not.toContain("ask");
|
|
29
|
-
(0, _vitest.expect)(actions).not.toContain("prompt");
|
|
30
|
-
(0, _vitest.expect)(actions.sort()).toEqual(["listChanges", "reset", "undoAll"]);
|
|
31
|
-
});
|
|
32
|
-
(0, _vitest.it)("puts the shape of the conversation on the wire, never tool payloads", () => {
|
|
33
|
-
_askBuoyStore.askBuoyStore.addUser("what is in storage");
|
|
34
|
-
const id = _askBuoyStore.askBuoyStore.startAssistant();
|
|
35
|
-
_askBuoyStore.askBuoyStore.applyEvent(id, {
|
|
36
|
-
type: "tool-start",
|
|
37
|
-
id: "c1",
|
|
38
|
-
toolId: "storage",
|
|
39
|
-
action: "async.getItem",
|
|
40
|
-
label: "Read session",
|
|
41
|
-
description: "Read one AsyncStorage key",
|
|
42
|
-
params: {
|
|
43
|
-
key: "session"
|
|
44
|
-
},
|
|
45
|
-
effect: "read"
|
|
46
|
-
});
|
|
47
|
-
_askBuoyStore.askBuoyStore.applyEvent(id, {
|
|
48
|
-
type: "tool-end",
|
|
49
|
-
id: "c1",
|
|
50
|
-
ok: true,
|
|
51
|
-
durationMs: 12,
|
|
52
|
-
summary: "eyJhbGciOiJIUzI1NiJ9.super.secret"
|
|
53
|
-
});
|
|
54
|
-
const snap = _askBuoySyncAdapter.askBuoySyncAdapter.getSnapshot();
|
|
55
|
-
const call = snap.messages[1].toolCalls[0];
|
|
56
|
-
(0, _vitest.expect)(call).toEqual({
|
|
57
|
-
toolId: "storage",
|
|
58
|
-
action: "async.getItem",
|
|
59
|
-
status: "ok"
|
|
60
|
-
});
|
|
61
|
-
// The result summary is not on the wire at all — there is no field for it.
|
|
62
|
-
(0, _vitest.expect)(JSON.stringify(snap)).not.toContain("super.secret");
|
|
63
|
-
});
|
|
64
|
-
(0, _vitest.it)("redacts credentials that made it into the assistant's prose", () => {
|
|
65
|
-
_askBuoyStore.askBuoyStore.addUser("show me the auth header");
|
|
66
|
-
const id = _askBuoyStore.askBuoyStore.startAssistant();
|
|
67
|
-
_askBuoyStore.askBuoyStore.applyEvent(id, {
|
|
68
|
-
type: "text",
|
|
69
|
-
delta: "It sends Authorization: Bearer abcdef0123456789ghijkl to the API."
|
|
70
|
-
});
|
|
71
|
-
const snap = _askBuoySyncAdapter.askBuoySyncAdapter.getSnapshot();
|
|
72
|
-
(0, _vitest.expect)(JSON.stringify(snap)).not.toContain("abcdef0123456789ghijkl");
|
|
73
|
-
});
|
|
74
|
-
(0, _vitest.it)("reports reversible and permanent changes separately", () => {
|
|
75
|
-
const ledger = new _agentCore.EffectLedger();
|
|
76
|
-
_askBuoyStore.askBuoyStore.setLedger(ledger);
|
|
77
|
-
ledger.record("storage", "async.setItem", {
|
|
78
|
-
kind: "storage-write",
|
|
79
|
-
toolId: "storage",
|
|
80
|
-
action: "async.setItem",
|
|
81
|
-
key: "points",
|
|
82
|
-
before: "240",
|
|
83
|
-
label: "Set points to 1500"
|
|
84
|
-
});
|
|
85
|
-
ledger.record("perf-monitor", "clearAll", {
|
|
86
|
-
kind: "transient",
|
|
87
|
-
label: "Cleared samples"
|
|
88
|
-
});
|
|
89
|
-
// A store write with no captured prior state: recorded, visible, and
|
|
90
|
-
// NOT something Undo can deliver — it must count as permanent.
|
|
91
|
-
ledger.record("zustand", "setState", {
|
|
92
|
-
kind: "state-write",
|
|
93
|
-
toolId: "zustand",
|
|
94
|
-
action: "setState",
|
|
95
|
-
label: "Update the cart store"
|
|
96
|
-
});
|
|
97
|
-
const snap = _askBuoySyncAdapter.askBuoySyncAdapter.getSnapshot();
|
|
98
|
-
(0, _vitest.expect)(snap.changes.reversible).toBe(1);
|
|
99
|
-
// The transient is an ACTION, not a change — it must not inflate
|
|
100
|
-
// "permanent" (that read "Changed this app · N permanent" after a
|
|
101
|
-
// read-only tour). It is still reported, in its own count.
|
|
102
|
-
(0, _vitest.expect)(snap.changes.permanent).toBe(1);
|
|
103
|
-
(0, _vitest.expect)(snap.changes.transients).toBe(1);
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
(0, _vitest.describe)("redactForWire", () => {
|
|
107
|
-
(0, _vitest.it)("removes bearer tokens, JWTs, api keys and license keys", () => {
|
|
108
|
-
const cases = ["Authorization: Bearer abcdefghijklmnop123456", "token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9abcdefgh", "key sk-abcdefghijklmnop1234", "license BUOY-ABCD-1234-EFGH", 'the header is "x-api-key": "supersecretvalue"'];
|
|
109
|
-
for (const input of cases) {
|
|
110
|
-
(0, _vitest.expect)((0, _wire.redactForWire)(input)).toContain("removed]");
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
(0, _vitest.it)("leaves ordinary prose alone", () => {
|
|
114
|
-
const text = "The /menu call returned 200 with 12 items and the burger was in stock.";
|
|
115
|
-
(0, _vitest.expect)((0, _wire.redactForWire)(text)).toBe(text);
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
(0, _vitest.describe)("undo from the desktop", () => {
|
|
119
|
-
(0, _vitest.it)("is allowed, because putting things back is the safe direction", async () => {
|
|
120
|
-
const ledger = new _agentCore.EffectLedger();
|
|
121
|
-
_askBuoyStore.askBuoyStore.setLedger(ledger);
|
|
122
|
-
const store = new Map([["points", "1500"]]);
|
|
123
|
-
ledger.record("storage", "async.setItem", {
|
|
124
|
-
kind: "storage-write",
|
|
125
|
-
toolId: "storage",
|
|
126
|
-
action: "async.setItem",
|
|
127
|
-
key: "points",
|
|
128
|
-
before: "240",
|
|
129
|
-
label: "Set points to 1500"
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
// The adapter dispatches through the real seam; stub it at the ledger.
|
|
133
|
-
await ledger.revertAll(async (_t, action, params) => {
|
|
134
|
-
const p = params;
|
|
135
|
-
if (action === "async.setItem") store.set(p.key, p.value);
|
|
136
|
-
return undefined;
|
|
137
|
-
});
|
|
138
|
-
(0, _vitest.expect)(store.get("points")).toBe("240");
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
//# sourceMappingURL=askBuoySyncAdapter.test.js.map
|
|
1
|
+
"use strict";var _vitest=require("vitest"),_agentCore=require("@buoy-gg/agent-core"),_askBuoySyncAdapter=require("./askBuoySyncAdapter"),_wire=require("./wire"),_askBuoyStore=require("../store/askBuoyStore");(0,_vitest.beforeEach)(()=>{_askBuoyStore.askBuoyStore.reset(),_askBuoyStore.askBuoyStore.setLedger(null)}),(0,_vitest.describe)("the wire surface",()=>{(0,_vitest.it)("exposes no action that can make the agent talk",()=>{const e=Object.keys(_askBuoySyncAdapter.askBuoySyncAdapter.actions);(0,_vitest.expect)(e).not.toContain("send"),(0,_vitest.expect)(e).not.toContain("ask"),(0,_vitest.expect)(e).not.toContain("prompt"),(0,_vitest.expect)(e.sort()).toEqual(["listChanges","reset","undoAll"])}),(0,_vitest.it)("puts the shape of the conversation on the wire, never tool payloads",()=>{_askBuoyStore.askBuoyStore.addUser("what is in storage");const e=_askBuoyStore.askBuoyStore.startAssistant();_askBuoyStore.askBuoyStore.applyEvent(e,{type:"tool-start",id:"c1",toolId:"storage",action:"async.getItem",label:"Read session",description:"Read one AsyncStorage key",params:{key:"session"},effect:"read"}),_askBuoyStore.askBuoyStore.applyEvent(e,{type:"tool-end",id:"c1",ok:!0,durationMs:12,summary:"eyJhbGciOiJIUzI1NiJ9.super.secret"});const t=_askBuoySyncAdapter.askBuoySyncAdapter.getSnapshot(),s=t.messages[1].toolCalls[0];(0,_vitest.expect)(s).toEqual({toolId:"storage",action:"async.getItem",status:"ok"}),(0,_vitest.expect)(JSON.stringify(t)).not.toContain("super.secret")}),(0,_vitest.it)("redacts credentials that made it into the assistant's prose",()=>{_askBuoyStore.askBuoyStore.addUser("show me the auth header");const e=_askBuoyStore.askBuoyStore.startAssistant();_askBuoyStore.askBuoyStore.applyEvent(e,{type:"text",delta:"It sends Authorization: Bearer abcdef0123456789ghijkl to the API."});const t=_askBuoySyncAdapter.askBuoySyncAdapter.getSnapshot();(0,_vitest.expect)(JSON.stringify(t)).not.toContain("abcdef0123456789ghijkl")}),(0,_vitest.it)("reports reversible and permanent changes separately",()=>{const e=new _agentCore.EffectLedger;_askBuoyStore.askBuoyStore.setLedger(e),e.record("storage","async.setItem",{kind:"storage-write",toolId:"storage",action:"async.setItem",key:"points",before:"240",label:"Set points to 1500"}),e.record("perf-monitor","clearAll",{kind:"transient",label:"Cleared samples"}),e.record("zustand","setState",{kind:"state-write",toolId:"zustand",action:"setState",label:"Update the cart store"});const t=_askBuoySyncAdapter.askBuoySyncAdapter.getSnapshot();(0,_vitest.expect)(t.changes.reversible).toBe(1),(0,_vitest.expect)(t.changes.permanent).toBe(1),(0,_vitest.expect)(t.changes.transients).toBe(1)})}),(0,_vitest.describe)("redactForWire",()=>{(0,_vitest.it)("removes bearer tokens, JWTs, api keys and license keys",()=>{const e=["Authorization: Bearer abcdefghijklmnop123456","token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9abcdefgh","key sk-abcdefghijklmnop1234","license BUOY-ABCD-1234-EFGH",'the header is "x-api-key": "supersecretvalue"'];for(const t of e)(0,_vitest.expect)((0,_wire.redactForWire)(t)).toContain("removed]")}),(0,_vitest.it)("leaves ordinary prose alone",()=>{const e="The /menu call returned 200 with 12 items and the burger was in stock.";(0,_vitest.expect)((0,_wire.redactForWire)(e)).toBe(e)})}),(0,_vitest.describe)("undo from the desktop",()=>{(0,_vitest.it)("is allowed, because putting things back is the safe direction",async()=>{const e=new _agentCore.EffectLedger;_askBuoyStore.askBuoyStore.setLedger(e);const t=new Map([["points","1500"]]);e.record("storage","async.setItem",{kind:"storage-write",toolId:"storage",action:"async.setItem",key:"points",before:"240",label:"Set points to 1500"}),await e.revertAll(async(e,s,o)=>{const a=o;"async.setItem"===s&&t.set(a.key,a.value)}),(0,_vitest.expect)(t.get("points")).toBe("240")})});
|
|
@@ -1,58 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "dispatchToolAction", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _sharedUi.dispatchToolAction;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
exports.redactForWire = redactForWire;
|
|
13
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
14
|
-
/**
|
|
15
|
-
* What the sync adapter is allowed to put on the broker wire.
|
|
16
|
-
*
|
|
17
|
-
* The broker has no authentication, `cors.origin: "*"`, binds every interface,
|
|
18
|
-
* and forwards to every connected dashboard — it already broadcasts each
|
|
19
|
-
* device's license key to every socket. A chat transcript is not a safe thing
|
|
20
|
-
* to add to that channel unfiltered: the agent reads storage values, network
|
|
21
|
-
* response bodies and user records, and any of it can end up quoted in an
|
|
22
|
-
* answer.
|
|
23
|
-
*
|
|
24
|
-
* So text crossing the wire is scrubbed for the shapes that are unambiguously
|
|
25
|
-
* credentials. This is a reduction in blast radius, not a guarantee — the real
|
|
26
|
-
* guarantee is that tool RESULTS never cross at all (see askBuoySyncAdapter).
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
const PATTERNS = [{
|
|
30
|
-
re: /\bBearer\s+[A-Za-z0-9._~+/-]{12,}=*/gi,
|
|
31
|
-
label: "[bearer token removed]"
|
|
32
|
-
}, {
|
|
33
|
-
re: /\beyJ[A-Za-z0-9._-]{20,}/g,
|
|
34
|
-
label: "[jwt removed]"
|
|
35
|
-
}, {
|
|
36
|
-
re: /\bsk-[A-Za-z0-9_-]{16,}/g,
|
|
37
|
-
label: "[api key removed]"
|
|
38
|
-
}, {
|
|
39
|
-
re: /\bBUOY-[A-Z0-9-]{8,}/g,
|
|
40
|
-
label: "[license key removed]"
|
|
41
|
-
},
|
|
42
|
-
// Common "key: value" credential shapes in a quoted payload.
|
|
43
|
-
{
|
|
44
|
-
re: /("|')?(authorization|x-api-key|api[_-]?key|password|secret|access_token|refresh_token)\1?\s*[:=]\s*("|')?[^\s"',}]{6,}/gi,
|
|
45
|
-
label: "[credential removed]"
|
|
46
|
-
}];
|
|
47
|
-
function redactForWire(text) {
|
|
48
|
-
if (!text) return text;
|
|
49
|
-
let out = text;
|
|
50
|
-
for (const {
|
|
51
|
-
re,
|
|
52
|
-
label
|
|
53
|
-
} of PATTERNS) {
|
|
54
|
-
out = out.replace(re, label);
|
|
55
|
-
}
|
|
56
|
-
return out;
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=wire.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"dispatchToolAction",{enumerable:!0,get:function(){return _sharedUi.dispatchToolAction}}),exports.redactForWire=redactForWire;var _sharedUi=require("@buoy-gg/shared-ui");const PATTERNS=[{re:/\bBearer\s+[A-Za-z0-9._~+/-]{12,}=*/gi,label:"[bearer token removed]"},{re:/\beyJ[A-Za-z0-9._-]{20,}/g,label:"[jwt removed]"},{re:/\bsk-[A-Za-z0-9_-]{16,}/g,label:"[api key removed]"},{re:/\bBUOY-[A-Z0-9-]{8,}/g,label:"[license key removed]"},{re:/("|')?(authorization|x-api-key|api[_-]?key|password|secret|access_token|refresh_token)\1?\s*[:=]\s*("|')?[^\s"',}]{6,}/gi,label:"[credential removed]"}];function redactForWire(e){if(!e)return e;let r=e;for(const{re:e,label:o}of PATTERNS)r=r.replace(e,o);return r}
|