@bubblebrain-ai/bubble 0.0.12 → 0.0.13

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 (128) hide show
  1. package/dist/agent/input-controller.d.ts +11 -0
  2. package/dist/agent/input-controller.js +30 -0
  3. package/dist/agent.d.ts +6 -4
  4. package/dist/agent.js +38 -0
  5. package/dist/main.js +58 -9
  6. package/dist/slash-commands/commands.js +27 -0
  7. package/dist/slash-commands/types.d.ts +10 -0
  8. package/dist/tui/clipboard.d.ts +1 -0
  9. package/dist/tui/clipboard.js +53 -0
  10. package/dist/tui/detect-theme.d.ts +2 -0
  11. package/dist/tui/detect-theme.js +87 -0
  12. package/dist/tui/display-history.d.ts +62 -0
  13. package/dist/tui/display-history.js +305 -0
  14. package/dist/tui/edit-diff.d.ts +11 -0
  15. package/dist/tui/edit-diff.js +52 -0
  16. package/dist/tui/escape-confirmation.d.ts +15 -0
  17. package/dist/tui/escape-confirmation.js +30 -0
  18. package/dist/tui/file-mentions.d.ts +29 -0
  19. package/dist/tui/file-mentions.js +174 -0
  20. package/dist/tui/global-key-router.d.ts +3 -0
  21. package/dist/tui/global-key-router.js +87 -0
  22. package/dist/tui/image-paste.d.ts +95 -0
  23. package/dist/tui/image-paste.js +505 -0
  24. package/dist/tui/input-history.d.ts +16 -0
  25. package/dist/tui/input-history.js +79 -0
  26. package/dist/tui/markdown-inline.d.ts +22 -0
  27. package/dist/tui/markdown-inline.js +68 -0
  28. package/dist/tui/markdown-theme-rules.d.ts +23 -0
  29. package/dist/tui/markdown-theme-rules.js +164 -0
  30. package/dist/tui/markdown-theme.d.ts +5 -0
  31. package/dist/tui/markdown-theme.js +27 -0
  32. package/dist/tui/opencode-spinner.d.ts +22 -0
  33. package/dist/tui/opencode-spinner.js +216 -0
  34. package/dist/tui/prompt-keybindings.d.ts +42 -0
  35. package/dist/tui/prompt-keybindings.js +35 -0
  36. package/dist/tui/recent-activity.d.ts +8 -0
  37. package/dist/tui/recent-activity.js +71 -0
  38. package/dist/tui/render-signature.d.ts +1 -0
  39. package/dist/tui/render-signature.js +7 -0
  40. package/dist/tui/run.d.ts +45 -0
  41. package/dist/tui/run.js +8816 -0
  42. package/dist/tui/session-display.d.ts +6 -0
  43. package/dist/tui/session-display.js +12 -0
  44. package/dist/tui/sidebar-mcp.d.ts +31 -0
  45. package/dist/tui/sidebar-mcp.js +62 -0
  46. package/dist/tui/sidebar-state.d.ts +12 -0
  47. package/dist/tui/sidebar-state.js +69 -0
  48. package/dist/tui/streaming-tool-args.d.ts +15 -0
  49. package/dist/tui/streaming-tool-args.js +30 -0
  50. package/dist/tui/tool-renderers/fallback.d.ts +2 -0
  51. package/dist/tui/tool-renderers/fallback.js +75 -0
  52. package/dist/tui/tool-renderers/registry.d.ts +3 -0
  53. package/dist/tui/tool-renderers/registry.js +11 -0
  54. package/dist/tui/tool-renderers/subagent.d.ts +2 -0
  55. package/dist/tui/tool-renderers/subagent.js +135 -0
  56. package/dist/tui/tool-renderers/types.d.ts +36 -0
  57. package/dist/tui/tool-renderers/types.js +1 -0
  58. package/dist/tui/tool-renderers/write-preview.d.ts +12 -0
  59. package/dist/tui/tool-renderers/write-preview.js +30 -0
  60. package/dist/tui/tool-renderers/write.d.ts +6 -0
  61. package/dist/tui/tool-renderers/write.js +88 -0
  62. package/dist/tui/trace-groups.d.ts +27 -0
  63. package/dist/tui/trace-groups.js +412 -0
  64. package/dist/tui/wordmark.d.ts +15 -0
  65. package/dist/tui/wordmark.js +179 -0
  66. package/dist/tui-ink/app.js +44 -5
  67. package/dist/tui-ink/message-list.js +9 -1
  68. package/dist/tui-ink/theme.d.ts +3 -9
  69. package/dist/tui-ink/theme.js +39 -45
  70. package/dist/tui-ink/welcome.js +22 -78
  71. package/dist/tui-opentui/app.d.ts +54 -0
  72. package/dist/tui-opentui/app.js +1363 -0
  73. package/dist/tui-opentui/approval/approval-dialog.d.ts +15 -0
  74. package/dist/tui-opentui/approval/approval-dialog.js +139 -0
  75. package/dist/tui-opentui/approval/diff-view.d.ts +9 -0
  76. package/dist/tui-opentui/approval/diff-view.js +43 -0
  77. package/dist/tui-opentui/approval/select.d.ts +37 -0
  78. package/dist/tui-opentui/approval/select.js +91 -0
  79. package/dist/tui-opentui/detect-theme.d.ts +2 -0
  80. package/dist/tui-opentui/detect-theme.js +87 -0
  81. package/dist/tui-opentui/display-history.d.ts +55 -0
  82. package/dist/tui-opentui/display-history.js +129 -0
  83. package/dist/tui-opentui/edit-diff.d.ts +11 -0
  84. package/dist/tui-opentui/edit-diff.js +52 -0
  85. package/dist/tui-opentui/feedback-dialog.d.ts +21 -0
  86. package/dist/tui-opentui/feedback-dialog.js +164 -0
  87. package/dist/tui-opentui/feishu-setup-picker.d.ts +7 -0
  88. package/dist/tui-opentui/feishu-setup-picker.js +272 -0
  89. package/dist/tui-opentui/file-mentions.d.ts +29 -0
  90. package/dist/tui-opentui/file-mentions.js +174 -0
  91. package/dist/tui-opentui/footer.d.ts +26 -0
  92. package/dist/tui-opentui/footer.js +40 -0
  93. package/dist/tui-opentui/image-paste.d.ts +54 -0
  94. package/dist/tui-opentui/image-paste.js +288 -0
  95. package/dist/tui-opentui/input-box.d.ts +34 -0
  96. package/dist/tui-opentui/input-box.js +471 -0
  97. package/dist/tui-opentui/input-history.d.ts +16 -0
  98. package/dist/tui-opentui/input-history.js +79 -0
  99. package/dist/tui-opentui/markdown.d.ts +66 -0
  100. package/dist/tui-opentui/markdown.js +127 -0
  101. package/dist/tui-opentui/message-list.d.ts +31 -0
  102. package/dist/tui-opentui/message-list.js +125 -0
  103. package/dist/tui-opentui/model-picker.d.ts +63 -0
  104. package/dist/tui-opentui/model-picker.js +450 -0
  105. package/dist/tui-opentui/plan-confirm.d.ts +9 -0
  106. package/dist/tui-opentui/plan-confirm.js +124 -0
  107. package/dist/tui-opentui/question-dialog.d.ts +10 -0
  108. package/dist/tui-opentui/question-dialog.js +110 -0
  109. package/dist/tui-opentui/recent-activity.d.ts +8 -0
  110. package/dist/tui-opentui/recent-activity.js +71 -0
  111. package/dist/tui-opentui/run-session-picker.d.ts +10 -0
  112. package/dist/tui-opentui/run-session-picker.js +28 -0
  113. package/dist/tui-opentui/run.d.ts +38 -0
  114. package/dist/tui-opentui/run.js +48 -0
  115. package/dist/tui-opentui/session-picker.d.ts +12 -0
  116. package/dist/tui-opentui/session-picker.js +120 -0
  117. package/dist/tui-opentui/theme.d.ts +89 -0
  118. package/dist/tui-opentui/theme.js +157 -0
  119. package/dist/tui-opentui/todos.d.ts +9 -0
  120. package/dist/tui-opentui/todos.js +45 -0
  121. package/dist/tui-opentui/trace-groups.d.ts +27 -0
  122. package/dist/tui-opentui/trace-groups.js +412 -0
  123. package/dist/tui-opentui/use-terminal-size.d.ts +4 -0
  124. package/dist/tui-opentui/use-terminal-size.js +5 -0
  125. package/dist/tui-opentui/welcome.d.ts +25 -0
  126. package/dist/tui-opentui/welcome.js +77 -0
  127. package/dist/types.d.ts +24 -0
  128. package/package.json +5 -1
@@ -0,0 +1,77 @@
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
+ }
package/dist/types.d.ts CHANGED
@@ -267,6 +267,16 @@ export interface Provider {
267
267
  abortSignal?: AbortSignal;
268
268
  }): Promise<string>;
269
269
  }
270
+ export interface AgentRunInput {
271
+ id: string;
272
+ content: string;
273
+ submittedAt?: number;
274
+ }
275
+ export interface AgentInputController {
276
+ drainPendingInputs(): AgentRunInput[];
277
+ pendingInputCount(): number;
278
+ }
279
+ export type AgentInputRejectedReason = "no_continuation";
270
280
  export type AgentEvent = {
271
281
  type: "turn_start";
272
282
  } | {
@@ -313,6 +323,20 @@ export type AgentEvent = {
313
323
  type: "context_recovered";
314
324
  droppedMessages: number;
315
325
  reason: "overflow";
326
+ } | {
327
+ type: "input_pending_changed";
328
+ pending: number;
329
+ } | {
330
+ type: "input_applied";
331
+ id: string;
332
+ content: string;
333
+ target: "current_turn";
334
+ } | {
335
+ type: "input_rejected";
336
+ id: string;
337
+ content: string;
338
+ reason: AgentInputRejectedReason;
339
+ target: "next_turn";
316
340
  } | {
317
341
  type: "mode_changed";
318
342
  mode: PermissionMode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bubblebrain-ai/bubble",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "A terminal coding agent",
5
5
  "type": "module",
6
6
  "engines": {
@@ -25,6 +25,9 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@larksuiteoapi/node-sdk": "^1.65.0",
28
+ "@opentui/core": "^0.2.15",
29
+ "@opentui/react": "^0.2.15",
30
+ "@opentui/solid": "^0.2.15",
28
31
  "@types/better-sqlite3": "^7.6.13",
29
32
  "@types/react": "^19.2.14",
30
33
  "@vue/language-server": "^3.2.7",
@@ -38,6 +41,7 @@
38
41
  "qrcode-terminal": "^0.12.0",
39
42
  "react": "^19.2.6",
40
43
  "shiki": "^4.0.2",
44
+ "solid-js": "^1.9.12",
41
45
  "string-width": "^8.2.1",
42
46
  "typescript-language-server": "^5.1.3",
43
47
  "vscode-jsonrpc": "^8.2.1",