@bubblebrain-ai/bubble 0.0.23 → 0.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/README.md +1 -1
  2. package/dist/config.d.ts +3 -0
  3. package/dist/config.js +22 -6
  4. package/dist/goal/command.d.ts +20 -0
  5. package/dist/goal/command.js +71 -0
  6. package/dist/goal/engine.d.ts +33 -0
  7. package/dist/goal/engine.js +65 -0
  8. package/dist/goal/format.d.ts +18 -0
  9. package/dist/goal/format.js +112 -0
  10. package/dist/goal/prompts.d.ts +13 -0
  11. package/dist/goal/prompts.js +84 -0
  12. package/dist/goal/store.d.ts +64 -0
  13. package/dist/goal/store.js +174 -0
  14. package/dist/goal/tools.d.ts +10 -0
  15. package/dist/goal/tools.js +70 -0
  16. package/dist/goal/usage.d.ts +2 -0
  17. package/dist/goal/usage.js +3 -0
  18. package/dist/main.js +29 -42
  19. package/dist/model-catalog.js +11 -0
  20. package/dist/provider-transform.js +17 -0
  21. package/dist/provider.js +20 -5
  22. package/dist/session-types.d.ts +3 -0
  23. package/dist/tools/index.d.ts +3 -0
  24. package/dist/tools/index.js +2 -0
  25. package/dist/tui/detect-theme.d.ts +1 -0
  26. package/dist/tui/detect-theme.js +23 -0
  27. package/dist/tui/image-display.d.ts +13 -0
  28. package/dist/tui/image-display.js +49 -0
  29. package/dist/tui/input-history.d.ts +37 -6
  30. package/dist/tui/input-history.js +194 -23
  31. package/dist/tui/model-switch.d.ts +42 -0
  32. package/dist/tui/model-switch.js +55 -0
  33. package/dist/tui-ink/app.d.ts +32 -2
  34. package/dist/tui-ink/app.js +1360 -522
  35. package/dist/tui-ink/approval/select.js +10 -0
  36. package/dist/tui-ink/detect-theme.d.ts +1 -2
  37. package/dist/tui-ink/detect-theme.js +1 -87
  38. package/dist/tui-ink/display-history.d.ts +1 -0
  39. package/dist/tui-ink/display-history.js +11 -0
  40. package/dist/tui-ink/feedback-dialog.js +10 -0
  41. package/dist/tui-ink/feishu-setup-picker.js +10 -0
  42. package/dist/tui-ink/footer.d.ts +1 -0
  43. package/dist/tui-ink/footer.js +8 -2
  44. package/dist/tui-ink/input-box.d.ts +70 -9
  45. package/dist/tui-ink/input-box.js +354 -120
  46. package/dist/tui-ink/input-history.d.ts +1 -16
  47. package/dist/tui-ink/input-history.js +1 -79
  48. package/dist/tui-ink/input-queue.d.ts +12 -0
  49. package/dist/tui-ink/input-queue.js +17 -0
  50. package/dist/tui-ink/key-events.d.ts +9 -0
  51. package/dist/tui-ink/key-events.js +8 -0
  52. package/dist/tui-ink/markdown.js +1 -1
  53. package/dist/tui-ink/message-list.d.ts +3 -1
  54. package/dist/tui-ink/message-list.js +42 -24
  55. package/dist/tui-ink/model-picker.d.ts +24 -2
  56. package/dist/tui-ink/model-picker.js +224 -20
  57. package/dist/tui-ink/plan-confirm.js +10 -0
  58. package/dist/tui-ink/question-dialog.js +10 -0
  59. package/dist/tui-ink/run.d.ts +11 -0
  60. package/dist/tui-ink/run.js +21 -28
  61. package/dist/tui-ink/session-picker.js +3 -0
  62. package/dist/tui-ink/submit-dedupe.d.ts +5 -0
  63. package/dist/tui-ink/submit-dedupe.js +25 -0
  64. package/dist/tui-ink/terminal-mouse.d.ts +13 -1
  65. package/dist/tui-ink/terminal-mouse.js +63 -21
  66. package/dist/tui-ink/theme.d.ts +6 -3
  67. package/dist/tui-ink/theme.js +10 -4
  68. package/dist/tui-ink/transcript-input.d.ts +8 -0
  69. package/dist/tui-ink/transcript-input.js +9 -0
  70. package/dist/tui-ink/transcript-viewport-math.d.ts +1 -2
  71. package/dist/tui-ink/transcript-viewport-math.js +1 -2
  72. package/dist/tui-ink/welcome.d.ts +1 -0
  73. package/dist/tui-ink/welcome.js +25 -28
  74. package/package.json +1 -5
  75. package/dist/tui/clipboard.d.ts +0 -1
  76. package/dist/tui/clipboard.js +0 -53
  77. package/dist/tui/escape-confirmation.d.ts +0 -15
  78. package/dist/tui/escape-confirmation.js +0 -30
  79. package/dist/tui/global-key-router.d.ts +0 -3
  80. package/dist/tui/global-key-router.js +0 -87
  81. package/dist/tui/markdown-inline.d.ts +0 -22
  82. package/dist/tui/markdown-inline.js +0 -68
  83. package/dist/tui/markdown-theme-rules.d.ts +0 -23
  84. package/dist/tui/markdown-theme-rules.js +0 -164
  85. package/dist/tui/markdown-theme.d.ts +0 -5
  86. package/dist/tui/markdown-theme.js +0 -27
  87. package/dist/tui/opencode-spinner.d.ts +0 -22
  88. package/dist/tui/opencode-spinner.js +0 -216
  89. package/dist/tui/prompt-keybindings.d.ts +0 -42
  90. package/dist/tui/prompt-keybindings.js +0 -35
  91. package/dist/tui/render-signature.d.ts +0 -1
  92. package/dist/tui/render-signature.js +0 -7
  93. package/dist/tui/run.d.ts +0 -65
  94. package/dist/tui/run.js +0 -9934
  95. package/dist/tui/sidebar-mcp.d.ts +0 -31
  96. package/dist/tui/sidebar-mcp.js +0 -62
  97. package/dist/tui/sidebar-state.d.ts +0 -12
  98. package/dist/tui/sidebar-state.js +0 -69
  99. package/dist/tui/streaming-tool-args.d.ts +0 -15
  100. package/dist/tui/streaming-tool-args.js +0 -30
  101. package/dist/tui/tool-renderers/fallback.d.ts +0 -2
  102. package/dist/tui/tool-renderers/fallback.js +0 -75
  103. package/dist/tui/tool-renderers/registry.d.ts +0 -3
  104. package/dist/tui/tool-renderers/registry.js +0 -11
  105. package/dist/tui/tool-renderers/subagent.d.ts +0 -2
  106. package/dist/tui/tool-renderers/subagent.js +0 -135
  107. package/dist/tui/tool-renderers/types.d.ts +0 -36
  108. package/dist/tui/tool-renderers/types.js +0 -1
  109. package/dist/tui/tool-renderers/write-preview.d.ts +0 -12
  110. package/dist/tui/tool-renderers/write-preview.js +0 -32
  111. package/dist/tui/tool-renderers/write.d.ts +0 -6
  112. package/dist/tui/tool-renderers/write.js +0 -88
  113. package/dist/tui-opentui/app.d.ts +0 -54
  114. package/dist/tui-opentui/app.js +0 -1371
  115. package/dist/tui-opentui/approval/approval-dialog.d.ts +0 -15
  116. package/dist/tui-opentui/approval/approval-dialog.js +0 -155
  117. package/dist/tui-opentui/approval/diff-view.d.ts +0 -9
  118. package/dist/tui-opentui/approval/diff-view.js +0 -43
  119. package/dist/tui-opentui/approval/select.d.ts +0 -37
  120. package/dist/tui-opentui/approval/select.js +0 -91
  121. package/dist/tui-opentui/detect-theme.d.ts +0 -2
  122. package/dist/tui-opentui/detect-theme.js +0 -87
  123. package/dist/tui-opentui/display-history.d.ts +0 -56
  124. package/dist/tui-opentui/display-history.js +0 -130
  125. package/dist/tui-opentui/edit-diff.d.ts +0 -11
  126. package/dist/tui-opentui/edit-diff.js +0 -57
  127. package/dist/tui-opentui/feedback-dialog.d.ts +0 -21
  128. package/dist/tui-opentui/feedback-dialog.js +0 -164
  129. package/dist/tui-opentui/feishu-setup-picker.d.ts +0 -7
  130. package/dist/tui-opentui/feishu-setup-picker.js +0 -272
  131. package/dist/tui-opentui/file-mentions.d.ts +0 -29
  132. package/dist/tui-opentui/file-mentions.js +0 -174
  133. package/dist/tui-opentui/footer.d.ts +0 -26
  134. package/dist/tui-opentui/footer.js +0 -40
  135. package/dist/tui-opentui/image-paste.d.ts +0 -54
  136. package/dist/tui-opentui/image-paste.js +0 -288
  137. package/dist/tui-opentui/input-box.d.ts +0 -32
  138. package/dist/tui-opentui/input-box.js +0 -462
  139. package/dist/tui-opentui/input-history.d.ts +0 -16
  140. package/dist/tui-opentui/input-history.js +0 -79
  141. package/dist/tui-opentui/markdown.d.ts +0 -66
  142. package/dist/tui-opentui/markdown.js +0 -127
  143. package/dist/tui-opentui/message-list.d.ts +0 -31
  144. package/dist/tui-opentui/message-list.js +0 -131
  145. package/dist/tui-opentui/model-picker.d.ts +0 -63
  146. package/dist/tui-opentui/model-picker.js +0 -450
  147. package/dist/tui-opentui/plan-confirm.d.ts +0 -9
  148. package/dist/tui-opentui/plan-confirm.js +0 -124
  149. package/dist/tui-opentui/question-dialog.d.ts +0 -10
  150. package/dist/tui-opentui/question-dialog.js +0 -110
  151. package/dist/tui-opentui/recent-activity.d.ts +0 -8
  152. package/dist/tui-opentui/recent-activity.js +0 -71
  153. package/dist/tui-opentui/run-session-picker.d.ts +0 -10
  154. package/dist/tui-opentui/run-session-picker.js +0 -28
  155. package/dist/tui-opentui/run.d.ts +0 -38
  156. package/dist/tui-opentui/run.js +0 -48
  157. package/dist/tui-opentui/session-picker.d.ts +0 -12
  158. package/dist/tui-opentui/session-picker.js +0 -120
  159. package/dist/tui-opentui/theme.d.ts +0 -89
  160. package/dist/tui-opentui/theme.js +0 -157
  161. package/dist/tui-opentui/todos.d.ts +0 -9
  162. package/dist/tui-opentui/todos.js +0 -45
  163. package/dist/tui-opentui/trace-groups.d.ts +0 -27
  164. package/dist/tui-opentui/trace-groups.js +0 -455
  165. package/dist/tui-opentui/use-terminal-size.d.ts +0 -4
  166. package/dist/tui-opentui/use-terminal-size.js +0 -5
  167. package/dist/tui-opentui/welcome.d.ts +0 -25
  168. package/dist/tui-opentui/welcome.js +0 -77
@@ -1,4 +0,0 @@
1
- export declare function useTerminalSize(): {
2
- columns: number;
3
- rows: number;
4
- };
@@ -1,5 +0,0 @@
1
- import { useTerminalDimensions } from "@opentui/react";
2
- export function useTerminalSize() {
3
- const { width, height } = useTerminalDimensions();
4
- return { columns: width || 80, rows: height || 24 };
5
- }
@@ -1,25 +0,0 @@
1
- /** @jsxImportSource @opentui/react */
2
- import React from "react";
3
- import type { DisplayMessage } from "./display-history.js";
4
- interface WelcomeBannerProps {
5
- terminalColumns: number;
6
- modelLabel?: string;
7
- cwd?: string;
8
- tips: string[];
9
- skillsCount?: number;
10
- mcpConnectedCount?: number;
11
- mcpTotalCount?: number;
12
- hasAgentsFile?: boolean;
13
- }
14
- interface HomeSurfaceProps extends WelcomeBannerProps {
15
- terminalRows: number;
16
- composer: React.ReactNode;
17
- }
18
- interface WelcomeVisibilityInput {
19
- messages: Pick<DisplayMessage, "role" | "syntheticKind">[];
20
- startedWithVisibleHistory: boolean;
21
- }
22
- export declare function shouldShowWelcomeBanner({ messages, startedWithVisibleHistory, }: WelcomeVisibilityInput): boolean;
23
- export declare function WelcomeBanner({ terminalColumns, modelLabel, cwd, tips, skillsCount, mcpConnectedCount, mcpTotalCount, hasAgentsFile, }: WelcomeBannerProps): React.ReactNode;
24
- export declare function HomeSurface({ terminalColumns, terminalRows, modelLabel, cwd, tips, skillsCount, mcpConnectedCount, mcpTotalCount, hasAgentsFile, composer, }: HomeSurfaceProps): React.ReactNode;
25
- export {};
@@ -1,77 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
2
- import { createRequire } from "node:module";
3
- import { useTheme } from "./theme.js";
4
- import { BUBBLE_COMPACT_WORDMARK, BUBBLE_WORDMARK, bubbleWordmarkMaxWidth, } from "../tui/wordmark.js";
5
- const require = createRequire(import.meta.url);
6
- const PACKAGE_VERSION = readPackageVersion();
7
- const WIDE_LOGO_MIN_WIDTH = bubbleWordmarkMaxWidth(BUBBLE_WORDMARK) + 4;
8
- export function shouldShowWelcomeBanner({ messages, startedWithVisibleHistory, }) {
9
- if (startedWithVisibleHistory)
10
- return false;
11
- return !messages.some((message) => message.syntheticKind !== "ui_summary");
12
- }
13
- export function WelcomeBanner({ terminalColumns, modelLabel, cwd, tips, skillsCount = 0, mcpConnectedCount = 0, mcpTotalCount = 0, hasAgentsFile = false, }) {
14
- const theme = useTheme();
15
- const effectiveWidth = Math.max(20, Math.min(terminalColumns - 2, 118));
16
- const useWideLogo = effectiveWidth >= WIDE_LOGO_MIN_WIDTH;
17
- const actionableTips = tips
18
- .filter((item) => !item.startsWith("Ready with") && item.trim().length > 0)
19
- .slice(0, 2);
20
- const tip = actionableTips.length > 0
21
- ? actionableTips.join(" · ")
22
- : "Type / for commands and @ to reference files";
23
- const sessionLine = modelLabel
24
- ? `${modelLabel}${cwd ? ` · ${cwd}` : ""}`
25
- : cwd;
26
- return (_jsxs("box", { style: { flexDirection: "column", marginBottom: 1 }, children: [useWideLogo ? (_jsx("box", { style: { flexDirection: "column" }, children: BUBBLE_WORDMARK.map((line, i) => (_jsx(LogoRow, { line: line, theme: theme }, `logo-row-${i}`))) })) : (_jsx(LogoRow, { line: BUBBLE_COMPACT_WORDMARK[0] ?? { text: "bubble βrain", tone: "ink" }, theme: theme })), _jsxs("box", { style: { marginTop: 1, flexDirection: "column" }, children: [_jsx(MetaRow, { label: "Version", value: PACKAGE_VERSION, theme: theme }), sessionLine && _jsx(MetaRow, { label: "Session", value: sessionLine, theme: theme, bold: true }), _jsx(MetaRow, { label: "Tip", value: tip, theme: theme }), _jsx(MetaRow, { label: "Status", value: statusSummary(skillsCount, mcpConnectedCount, mcpTotalCount, hasAgentsFile), theme: theme })] })] }));
27
- }
28
- function LogoRow({ line, theme }) {
29
- if (!line.segments) {
30
- return (_jsx("text", { fg: logoColor(theme, line.tone ?? "caption"), attributes: 1, content: line.text ?? "" }));
31
- }
32
- return (_jsx("box", { style: { flexDirection: "row" }, children: line.segments.map((segment, index) => (_jsx("text", { fg: logoColor(theme, segment.tone), attributes: 1, content: segment.text }, `${index}-${segment.text}`))) }));
33
- }
34
- function logoColor(theme, tone) {
35
- switch (tone) {
36
- case "brand": return theme.warning;
37
- case "ink": return theme.text;
38
- case "stone": return theme.textMuted;
39
- case "soft": return theme.textDim;
40
- case "caption": return theme.textMuted;
41
- }
42
- }
43
- export function HomeSurface({ terminalColumns, terminalRows, modelLabel, cwd, tips, skillsCount = 0, mcpConnectedCount = 0, mcpTotalCount = 0, hasAgentsFile = false, composer, }) {
44
- const theme = useTheme();
45
- const height = Math.max(18, terminalRows - 1);
46
- const effectiveWidth = Math.max(24, Math.min(terminalColumns - 4, 118));
47
- const composerWidth = Math.min(76, effectiveWidth);
48
- return (_jsxs("box", { style: {
49
- height,
50
- flexDirection: "column",
51
- alignItems: "center",
52
- justifyContent: "center",
53
- paddingLeft: 2,
54
- paddingRight: 2,
55
- }, children: [_jsx(WelcomeBanner, { terminalColumns: effectiveWidth, modelLabel: modelLabel, cwd: cwd, tips: tips, skillsCount: skillsCount, mcpConnectedCount: mcpConnectedCount, mcpTotalCount: mcpTotalCount, hasAgentsFile: hasAgentsFile }), _jsx("box", { style: { width: composerWidth, maxWidth: composerWidth, marginTop: 1 }, children: composer }), _jsx("box", { style: { marginTop: 1 }, children: _jsx("text", { fg: theme.textMuted, content: "enter send \u00B7 shift+enter newline \u00B7 / commands \u00B7 @ files" }) })] }));
56
- }
57
- function MetaRow({ label, value, theme, bold, }) {
58
- // opencode uses 10-char left-padded labels in textMuted + bold value in text.
59
- const padded = label.padEnd(10, " ");
60
- return (_jsxs("box", { style: { flexDirection: "row" }, children: [_jsx("text", { fg: theme.textMuted, content: padded }), _jsx("text", { fg: theme.text, attributes: bold ? 1 : 0, content: value })] }));
61
- }
62
- function statusSummary(skills, mcpOn, mcpTotal, agents) {
63
- const parts = [];
64
- parts.push(skills > 0 ? `${skills} skills` : "no skills");
65
- parts.push(mcpTotal === 0 ? "no MCPs" : `${mcpOn}/${mcpTotal} MCPs`);
66
- parts.push(agents ? "AGENTS.md ✓" : "AGENTS.md ×");
67
- return parts.join(" · ");
68
- }
69
- function readPackageVersion() {
70
- try {
71
- const pkg = require("../../package.json");
72
- return pkg.version ? `v${pkg.version}` : "v0.0.0";
73
- }
74
- catch {
75
- return "v0.0.0";
76
- }
77
- }