@bubblebrain-ai/bubble 0.0.35 → 0.0.37
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 +27 -7
- package/dist/agent/categories.d.ts +66 -2
- package/dist/agent/categories.js +120 -19
- package/dist/agent/discovery-barrier.js +1 -1
- package/dist/agent/profiles.d.ts +1 -0
- package/dist/agent/profiles.js +25 -11
- package/dist/agent/routing-catalog.d.ts +113 -0
- package/dist/agent/routing-catalog.js +240 -0
- package/dist/agent/workflow/control.d.ts +14 -0
- package/dist/agent/workflow/control.js +30 -9
- package/dist/agent.d.ts +75 -5
- package/dist/agent.js +313 -61
- package/dist/approval/controller.js +28 -0
- package/dist/approval/tool-helper.js +2 -0
- package/dist/approval/types.d.ts +21 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +2 -1
- package/dist/config.d.ts +4 -0
- package/dist/config.js +4 -0
- package/dist/context/compact-llm.d.ts +2 -2
- package/dist/external-runtime/grok-acp.d.ts +56 -0
- package/dist/external-runtime/grok-acp.js +386 -0
- package/dist/external-runtime/grok-binary.d.ts +25 -0
- package/dist/external-runtime/grok-binary.js +108 -0
- package/dist/external-runtime/grok-errors.d.ts +7 -0
- package/dist/external-runtime/grok-errors.js +15 -0
- package/dist/external-runtime/grok-input-policy.d.ts +58 -0
- package/dist/external-runtime/grok-input-policy.js +52 -0
- package/dist/external-runtime/grok-ndjson.d.ts +14 -0
- package/dist/external-runtime/grok-ndjson.js +193 -0
- package/dist/external-runtime/grok-network.d.ts +15 -0
- package/dist/external-runtime/grok-network.js +81 -0
- package/dist/external-runtime/grok-preflight.d.ts +28 -0
- package/dist/external-runtime/grok-preflight.js +194 -0
- package/dist/external-runtime/grok-process.d.ts +26 -0
- package/dist/external-runtime/grok-process.js +184 -0
- package/dist/external-runtime/grok-profile.d.ts +32 -0
- package/dist/external-runtime/grok-profile.js +419 -0
- package/dist/external-runtime/grok-provider.d.ts +31 -0
- package/dist/external-runtime/grok-provider.js +41 -0
- package/dist/external-runtime/grok-runtime.d.ts +91 -0
- package/dist/external-runtime/grok-runtime.js +882 -0
- package/dist/external-runtime/index.d.ts +13 -0
- package/dist/external-runtime/index.js +13 -0
- package/dist/external-runtime/session-policy.d.ts +11 -0
- package/dist/external-runtime/session-policy.js +30 -0
- package/dist/external-runtime/types.d.ts +65 -0
- package/dist/external-runtime/types.js +1 -0
- package/dist/feishu/agent-host/approval-card.js +21 -0
- package/dist/feishu/agent-host/run-driver.js +19 -3
- package/dist/feishu/serve.js +1 -0
- package/dist/goal/tools.d.ts +6 -3
- package/dist/goal/tools.js +7 -19
- package/dist/main.js +105 -27
- package/dist/memory/db.d.ts +2 -0
- package/dist/memory/db.js +10 -0
- package/dist/memory/index.d.ts +1 -0
- package/dist/memory/index.js +1 -0
- package/dist/memory/phase1.js +14 -2
- package/dist/memory/phase2.js +21 -2
- package/dist/memory/prompts.js +1 -1
- package/dist/memory/session-policy.d.ts +25 -0
- package/dist/memory/session-policy.js +55 -0
- package/dist/memory/storage.d.ts +1 -0
- package/dist/memory/storage.js +13 -0
- package/dist/model-catalog.d.ts +18 -0
- package/dist/model-catalog.js +87 -41
- package/dist/model-config.d.ts +3 -1
- package/dist/model-config.js +11 -0
- package/dist/oauth/grok.d.ts +25 -0
- package/dist/oauth/grok.js +218 -0
- package/dist/oauth/index.d.ts +1 -0
- package/dist/oauth/index.js +1 -0
- package/dist/oauth/storage.d.ts +9 -0
- package/dist/oauth/storage.js +25 -0
- package/dist/orchestrator/default-hooks.js +17 -7
- package/dist/prompt/compose.d.ts +3 -0
- package/dist/prompt/compose.js +3 -0
- package/dist/prompt/delegation.js +22 -3
- package/dist/prompt/environment.js +0 -4
- package/dist/prompt/reminders.d.ts +0 -1
- package/dist/prompt/reminders.js +1 -11
- package/dist/prompt/routing.d.ts +14 -0
- package/dist/prompt/routing.js +71 -0
- package/dist/prompt/runtime.js +1 -1
- package/dist/prompt/task-reminders.d.ts +19 -0
- package/dist/prompt/task-reminders.js +49 -0
- package/dist/provider-ai-sdk.js +2 -2
- package/dist/provider-grok.d.ts +26 -0
- package/dist/provider-grok.js +59 -0
- package/dist/provider-openai-codex.d.ts +17 -1
- package/dist/provider-openai-codex.js +101 -29
- package/dist/provider-registry.d.ts +72 -0
- package/dist/provider-registry.js +336 -59
- package/dist/provider-transform.d.ts +1 -1
- package/dist/provider-transform.js +28 -5
- package/dist/provider.d.ts +3 -0
- package/dist/provider.js +14 -0
- package/dist/session-types.d.ts +19 -1
- package/dist/session.d.ts +1 -0
- package/dist/session.js +4 -0
- package/dist/slash-commands/commands.js +224 -14
- package/dist/slash-commands/types.d.ts +14 -1
- package/dist/system-prompt.d.ts +2 -0
- package/dist/tools/agent-lifecycle.js +9 -11
- package/dist/tools/bash.js +1 -1
- package/dist/tools/child-tools.js +2 -0
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js +7 -5
- package/dist/tools/lsp.js +1 -0
- package/dist/tools/memory.d.ts +7 -2
- package/dist/tools/memory.js +28 -43
- package/dist/tools/server.js +4 -0
- package/dist/tools/tool-search.d.ts +1 -1
- package/dist/tools/tool-search.js +23 -3
- package/dist/tui/model-switch.d.ts +7 -0
- package/dist/tui/model-switch.js +15 -5
- package/dist/tui-ink/app.d.ts +3 -1
- package/dist/tui-ink/app.js +649 -233
- package/dist/tui-ink/approval/approval-dialog.js +36 -0
- package/dist/tui-ink/composer-buffer.d.ts +55 -0
- package/dist/tui-ink/composer-buffer.js +317 -0
- package/dist/tui-ink/footer.d.ts +1 -0
- package/dist/tui-ink/footer.js +7 -2
- package/dist/tui-ink/input-box.d.ts +35 -1
- package/dist/tui-ink/input-box.js +215 -122
- package/dist/tui-ink/message-list.js +5 -5
- package/dist/tui-ink/model-picker.d.ts +61 -4
- package/dist/tui-ink/model-picker.js +486 -133
- package/dist/tui-ink/paste-operation-tracker.d.ts +13 -0
- package/dist/tui-ink/paste-operation-tracker.js +25 -0
- package/dist/tui-ink/run.d.ts +3 -0
- package/dist/tui-ink/run.js +1 -1
- package/dist/tui-ink/subagent-view.d.ts +31 -0
- package/dist/tui-ink/subagent-view.js +82 -1
- package/dist/types.d.ts +5 -5
- package/dist/types.js +1 -1
- package/dist/variant/thinking-level.d.ts +2 -2
- package/dist/variant/thinking-level.js +2 -1
- package/dist/variant/variant-resolver.d.ts +9 -0
- package/dist/variant/variant-resolver.js +17 -0
- package/package.json +2 -1
- package/dist/tools/task.d.ts +0 -2
- package/dist/tools/task.js +0 -58
|
@@ -55,10 +55,10 @@ export function MessageList({ messages, streamingContent, streamingReasoning, st
|
|
|
55
55
|
const clampDynamic = typeof maxStreamRows === "number" && maxStreamRows > 0;
|
|
56
56
|
return (_jsxs(Box, { flexDirection: "column", flexShrink: 0, children: [_jsx(Static, { items: staticItems, children: (item) => {
|
|
57
57
|
if (item.kind === "welcome") {
|
|
58
|
-
return (_jsx(Box, { flexDirection: "column", paddingX: paddingX, children: welcomeBanner }, item.key));
|
|
58
|
+
return (_jsx(Box, { flexDirection: "column", paddingX: paddingX, backgroundColor: theme.background, children: welcomeBanner }, item.key));
|
|
59
59
|
}
|
|
60
|
-
return (_jsx(Box, { flexDirection: "column", paddingX: paddingX, children: _jsx(MessageItem, { message: item.message, terminalColumns: terminalColumns, showThinking: showThinking, verboseTrace: verboseTrace, showExpandHint: item.showExpandHint, separateFromPrevious: item.separateFromPrevious }) }, item.key));
|
|
61
|
-
} }, `transcript-${staticGeneration}`), hasDynamic && (_jsxs(DynamicClamp, { maxRows: clampDynamic ? maxStreamRows : undefined, paddingX: paddingX, children: [hasStreaming && (_jsx(StreamingMessage, { content: streamingContent, reasoning: streamingReasoning, tools: streamingTools, parts: streamingParts, terminalColumns: terminalColumns, showThinking: showThinking, verboseTrace: verboseTrace, pendingApproval: pendingApproval, nowTick: nowTick })), pendingSteerMessages.length > 0 && (_jsx(PendingInputMessagesBlock, { messages: pendingSteerMessages, terminalColumns: terminalColumns, title: "Messages to steer at next model call", hint: "applies before the next provider request", bulletColor: theme.warning })), queuedInputMessages.length > 0 && (_jsx(PendingInputMessagesBlock, { messages: queuedInputMessages, terminalColumns: terminalColumns, title: "Messages queued for next turn", hint: "runs after the current answer", bulletColor: theme.muted }))] }))] }));
|
|
60
|
+
return (_jsx(Box, { flexDirection: "column", paddingX: paddingX, backgroundColor: theme.background, children: _jsx(MessageItem, { message: item.message, terminalColumns: terminalColumns, showThinking: showThinking, verboseTrace: verboseTrace, showExpandHint: item.showExpandHint, separateFromPrevious: item.separateFromPrevious }) }, item.key));
|
|
61
|
+
} }, `transcript-${staticGeneration}`), hasDynamic && (_jsxs(DynamicClamp, { maxRows: clampDynamic ? maxStreamRows : undefined, paddingX: paddingX, backgroundColor: theme.background, children: [hasStreaming && (_jsx(StreamingMessage, { content: streamingContent, reasoning: streamingReasoning, tools: streamingTools, parts: streamingParts, terminalColumns: terminalColumns, showThinking: showThinking, verboseTrace: verboseTrace, pendingApproval: pendingApproval, nowTick: nowTick })), pendingSteerMessages.length > 0 && (_jsx(PendingInputMessagesBlock, { messages: pendingSteerMessages, terminalColumns: terminalColumns, title: "Messages to steer at next model call", hint: "applies before the next provider request", bulletColor: theme.warning })), queuedInputMessages.length > 0 && (_jsx(PendingInputMessagesBlock, { messages: queuedInputMessages, terminalColumns: terminalColumns, title: "Messages queued for next turn", hint: "runs after the current answer", bulletColor: theme.muted }))] }))] }));
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* Bounds the live (in-progress turn) region to at most `maxRows` rows, pinned
|
|
@@ -70,7 +70,7 @@ export function MessageList({ messages, streamingContent, streamingReasoning, st
|
|
|
70
70
|
* (no reserved-space gap). The full turn still lands in <Static> scrollback the
|
|
71
71
|
* moment it commits, so nothing is lost — only the live preview is windowed.
|
|
72
72
|
*/
|
|
73
|
-
function DynamicClamp({ maxRows, paddingX, children, }) {
|
|
73
|
+
function DynamicClamp({ maxRows, paddingX, backgroundColor, children, }) {
|
|
74
74
|
const innerRef = React.useRef(null);
|
|
75
75
|
const [offset, setOffset] = React.useState(0);
|
|
76
76
|
const [clipHeight, setClipHeight] = React.useState(undefined);
|
|
@@ -102,7 +102,7 @@ function DynamicClamp({ maxRows, paddingX, children, }) {
|
|
|
102
102
|
setClipHeight(undefined);
|
|
103
103
|
}
|
|
104
104
|
});
|
|
105
|
-
return (_jsx(Box, { flexDirection: "column", flexShrink: 0, paddingX: paddingX, ...(clipHeight !== undefined ? { height: clipHeight, overflowY: "hidden" } : {}), children: _jsx(Box, { ref: innerRef, flexDirection: "column", flexShrink: 0, marginTop: offset, children: children }) }));
|
|
105
|
+
return (_jsx(Box, { flexDirection: "column", flexShrink: 0, paddingX: paddingX, backgroundColor: backgroundColor, ...(clipHeight !== undefined ? { height: clipHeight, overflowY: "hidden" } : {}), children: _jsx(Box, { ref: innerRef, flexDirection: "column", flexShrink: 0, marginTop: offset, children: children }) }));
|
|
106
106
|
}
|
|
107
107
|
// Memoized: with no <Static> region, every transcript row re-renders on each
|
|
108
108
|
// state change unless its props are referentially stable. Message objects are
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProviderRegistry } from "../provider-registry.js";
|
|
1
|
+
import { ProviderRegistry, type ModelDiscoverySource, type ModelInfo, type ProviderProfile } from "../provider-registry.js";
|
|
2
2
|
import type { ThinkingLevel } from "../types.js";
|
|
3
3
|
export { padVisual, truncateVisual } from "../text-display.js";
|
|
4
4
|
export interface ModelPickerOption {
|
|
@@ -7,6 +7,25 @@ export interface ModelPickerOption {
|
|
|
7
7
|
group: string;
|
|
8
8
|
providerBadge: string;
|
|
9
9
|
reasoningLevels: ThinkingLevel[];
|
|
10
|
+
defaultReasoningLevel?: ThinkingLevel;
|
|
11
|
+
contextWindow?: number;
|
|
12
|
+
toolOutputTokenLimit?: number;
|
|
13
|
+
available: boolean;
|
|
14
|
+
pending: boolean;
|
|
15
|
+
}
|
|
16
|
+
export type ModelPickerPhase = {
|
|
17
|
+
kind: "model";
|
|
18
|
+
} | {
|
|
19
|
+
kind: "effort";
|
|
20
|
+
model: ModelPickerOption;
|
|
21
|
+
selectedIndex: number;
|
|
22
|
+
};
|
|
23
|
+
export interface ModelProviderDiscoveryState {
|
|
24
|
+
status: "pending" | "complete";
|
|
25
|
+
models: ModelInfo[];
|
|
26
|
+
source?: ModelDiscoverySource;
|
|
27
|
+
authoritative: boolean;
|
|
28
|
+
error?: string;
|
|
10
29
|
}
|
|
11
30
|
export type PickerKeyAction = "up" | "down" | "enter" | "escape" | "backspace" | "delete";
|
|
12
31
|
export declare function resolvePickerKeyAction(input: string, key: {
|
|
@@ -26,13 +45,36 @@ export declare function formatSkillPickerRow(skill: {
|
|
|
26
45
|
width: number;
|
|
27
46
|
}): string;
|
|
28
47
|
export declare const MODEL_PICKER_MAX_BODY_ROWS = 10;
|
|
29
|
-
export declare const MODEL_PICKER_CHROME_ROWS =
|
|
48
|
+
export declare const MODEL_PICKER_CHROME_ROWS = 14;
|
|
49
|
+
export declare const MODEL_PICKER_RECENT_FAMILY_LIMIT = 3;
|
|
50
|
+
export type ModelPickerDisplayItem = {
|
|
51
|
+
kind: "header";
|
|
52
|
+
key: string;
|
|
53
|
+
label: string;
|
|
54
|
+
} | {
|
|
55
|
+
kind: "model";
|
|
56
|
+
key: string;
|
|
57
|
+
option: ModelPickerOption;
|
|
58
|
+
};
|
|
30
59
|
export declare function modelPickerBodyRows(termHeight: number): number;
|
|
31
60
|
export declare function clampPickerIndex(index: number, length: number): number;
|
|
32
61
|
export declare function pickerWindowStart(selectedIndex: number, length: number, visibleRows: number): number;
|
|
33
62
|
export declare function padPickerRows(rows: string[], bodyRows: number, width: number): string[];
|
|
63
|
+
export declare function modelPickerRecentKey(recent: readonly string[]): string;
|
|
64
|
+
/**
|
|
65
|
+
* Returns a provider-scoped family key for model ordering.
|
|
66
|
+
*
|
|
67
|
+
* Keep this deliberately conservative: suffixes such as `mini`, `codex`,
|
|
68
|
+
* `spark`, or `highspeed` often describe distinct products rather than
|
|
69
|
+
* interchangeable siblings. The Codex Sol/Terra/Luna trio is the one family
|
|
70
|
+
* whose relationship is explicitly declared by the provider catalog.
|
|
71
|
+
*/
|
|
72
|
+
export declare function modelPickerFamilyKey(provider: Pick<ProviderProfile, "id" | "authType">, modelId: string): string;
|
|
73
|
+
export declare function buildModelPickerDisplayItems(options: readonly ModelPickerOption[]): ModelPickerDisplayItem[];
|
|
74
|
+
export declare function resolveModelPickerDisplayIndex(items: readonly ModelPickerDisplayItem[], selectedId: string | undefined): number;
|
|
75
|
+
export declare function filterAndRankModelPickerOptions(options: readonly ModelPickerOption[], query: string): ModelPickerOption[];
|
|
34
76
|
export declare function formatReasoningLevelsLabel(levels: readonly ThinkingLevel[], asToggle?: boolean): string;
|
|
35
|
-
export declare function formatModelPickerRow(option: Pick<ModelPickerOption, "id" | "label" | "providerBadge" | "reasoningLevels"
|
|
77
|
+
export declare function formatModelPickerRow(option: Pick<ModelPickerOption, "id" | "label" | "providerBadge" | "reasoningLevels"> & Partial<Pick<ModelPickerOption, "available" | "pending">>, options: {
|
|
36
78
|
selected: boolean;
|
|
37
79
|
current: boolean;
|
|
38
80
|
width: number;
|
|
@@ -43,8 +85,12 @@ export declare function formatEffortPickerRow(level: ThinkingLevel, options: {
|
|
|
43
85
|
asToggle?: boolean;
|
|
44
86
|
}): string;
|
|
45
87
|
export declare function formatNoModelResultsRow(query: string, width: number): string;
|
|
46
|
-
export declare function preferredEffortIndex(option: Pick<ModelPickerOption, "reasoningLevels">, currentThinkingLevel: ThinkingLevel): number;
|
|
88
|
+
export declare function preferredEffortIndex(option: Pick<ModelPickerOption, "reasoningLevels" | "defaultReasoningLevel">, currentThinkingLevel: ThinkingLevel): number;
|
|
47
89
|
export declare function shouldOpenEffortPicker(option: Pick<ModelPickerOption, "reasoningLevels">): boolean;
|
|
90
|
+
export declare function isModelOptionSelectable(option: Pick<ModelPickerOption, "available" | "pending" | "reasoningLevels">): boolean;
|
|
91
|
+
export declare function resolveSelectedModelId(options: readonly ModelPickerOption[], selectedId: string | undefined): string | undefined;
|
|
92
|
+
export declare function moveModelSelection(options: readonly ModelPickerOption[], selectedId: string | undefined, direction: -1 | 1): string | undefined;
|
|
93
|
+
export declare function reconcileModelPickerPhase(phase: ModelPickerPhase, options: readonly ModelPickerOption[], currentThinkingLevel: ThinkingLevel): ModelPickerPhase;
|
|
48
94
|
export interface ModelPickerProps {
|
|
49
95
|
registry: ProviderRegistry;
|
|
50
96
|
current: string;
|
|
@@ -55,6 +101,17 @@ export interface ModelPickerProps {
|
|
|
55
101
|
}
|
|
56
102
|
export declare function ModelPicker({ registry, current, currentThinkingLevel, recent, onSelect, onCancel }: ModelPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
57
103
|
export declare function buildLocalModelOptions(registry: ProviderRegistry, current: string, recent: string[]): ModelPickerOption[];
|
|
104
|
+
export declare function buildMergedModelOptions(input: {
|
|
105
|
+
providers: ReturnType<ProviderRegistry["getEnabled"]>;
|
|
106
|
+
localModelsByProvider: ReadonlyMap<string, readonly ModelInfo[]>;
|
|
107
|
+
discoveries: ReadonlyMap<string, ModelProviderDiscoveryState>;
|
|
108
|
+
current: string;
|
|
109
|
+
recent: readonly string[];
|
|
110
|
+
}): ModelPickerOption[];
|
|
111
|
+
export declare function formatModelDiscoveryStatus(providers: readonly Pick<ReturnType<ProviderRegistry["getEnabled"]>[number], "id" | "name">[], discoveries: ReadonlyMap<string, ModelProviderDiscoveryState>): {
|
|
112
|
+
text: string;
|
|
113
|
+
hasError: boolean;
|
|
114
|
+
};
|
|
58
115
|
export interface ProviderPickerProps {
|
|
59
116
|
providers: Array<{
|
|
60
117
|
id: string;
|