@bubblebrain-ai/bubble 0.0.4 → 0.0.5
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/dist/agent/budget-ledger.d.ts +20 -0
- package/dist/agent/budget-ledger.js +51 -0
- package/dist/agent/execution-governor.js +1 -1
- package/dist/agent/profiles.d.ts +59 -0
- package/dist/agent/profiles.js +460 -0
- package/dist/agent/subagent-control.d.ts +52 -0
- package/dist/agent/subagent-control.js +38 -0
- package/dist/agent.d.ts +60 -1
- package/dist/agent.js +602 -53
- package/dist/context/budget.js +1 -0
- package/dist/context/compact-llm.js +7 -6
- package/dist/context/compact.js +6 -6
- package/dist/context/projector.d.ts +3 -3
- package/dist/context/projector.js +32 -18
- package/dist/context/prune.d.ts +2 -2
- package/dist/context/prune.js +1 -4
- package/dist/main.js +12 -5
- package/dist/mcp/manager.js +1 -0
- package/dist/orchestrator/default-hooks.js +48 -9
- package/dist/orchestrator/hooks.d.ts +5 -0
- package/dist/prompt/compose.d.ts +1 -0
- package/dist/prompt/compose.js +8 -1
- package/dist/prompt/environment.js +21 -2
- package/dist/prompt/reminders.d.ts +3 -1
- package/dist/prompt/reminders.js +23 -4
- package/dist/prompt/runtime.d.ts +1 -1
- package/dist/prompt/runtime.js +1 -1
- package/dist/provider-artifacts.d.ts +7 -0
- package/dist/provider-artifacts.js +60 -0
- package/dist/provider.d.ts +6 -7
- package/dist/provider.js +77 -15
- package/dist/session-log.js +3 -1
- package/dist/system-prompt.d.ts +2 -0
- package/dist/tools/agent-lifecycle.d.ts +6 -0
- package/dist/tools/agent-lifecycle.js +355 -0
- package/dist/tools/bash.js +2 -0
- package/dist/tools/edit-apply.d.ts +25 -0
- package/dist/tools/edit-apply.js +197 -0
- package/dist/tools/edit.js +63 -56
- package/dist/tools/exit-plan-mode.js +3 -1
- package/dist/tools/file-mutation-queue.d.ts +1 -0
- package/dist/tools/file-mutation-queue.js +32 -0
- package/dist/tools/glob.js +1 -0
- package/dist/tools/grep.js +1 -0
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +3 -3
- package/dist/tools/lsp.js +2 -0
- package/dist/tools/memory.js +2 -0
- package/dist/tools/question.js +2 -0
- package/dist/tools/read.js +1 -0
- package/dist/tools/skill.js +1 -0
- package/dist/tools/task.js +1 -0
- package/dist/tools/todo.js +1 -0
- package/dist/tools/tool-search.js +2 -1
- package/dist/tools/web-fetch.js +1 -0
- package/dist/tools/web-search.js +1 -0
- package/dist/tools/write.js +2 -0
- package/dist/tui/display-history.d.ts +8 -1
- package/dist/tui/markdown-inline.d.ts +22 -0
- package/dist/tui/markdown-inline.js +68 -0
- package/dist/tui/render-signature.d.ts +1 -0
- package/dist/tui/render-signature.js +7 -0
- package/dist/tui/run.js +712 -267
- package/dist/tui/tool-renderers/fallback.d.ts +2 -0
- package/dist/tui/tool-renderers/fallback.js +75 -0
- package/dist/tui/tool-renderers/registry.d.ts +3 -0
- package/dist/tui/tool-renderers/registry.js +11 -0
- package/dist/tui/tool-renderers/subagent.d.ts +2 -0
- package/dist/tui/tool-renderers/subagent.js +114 -0
- package/dist/tui/tool-renderers/types.d.ts +36 -0
- package/dist/tui/tool-renderers/types.js +1 -0
- package/dist/tui/tool-renderers/write-preview.d.ts +12 -0
- package/dist/tui/tool-renderers/write-preview.js +22 -0
- package/dist/tui/tool-renderers/write.d.ts +6 -0
- package/dist/tui/tool-renderers/write.js +82 -0
- package/dist/types.d.ts +90 -10
- package/package.json +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export function markdownInlineSegments(tokens, fallback = "", style = {}) {
|
|
2
|
+
const segments = [];
|
|
3
|
+
for (const token of tokens ?? []) {
|
|
4
|
+
appendInlineToken(segments, token, style);
|
|
5
|
+
}
|
|
6
|
+
if (segments.length === 0 && fallback) {
|
|
7
|
+
appendStyled(segments, fallback, style);
|
|
8
|
+
}
|
|
9
|
+
return segments;
|
|
10
|
+
}
|
|
11
|
+
function appendInlineToken(segments, token, style) {
|
|
12
|
+
switch (token.type) {
|
|
13
|
+
case "strong":
|
|
14
|
+
appendInlineTokens(segments, token.tokens, { ...style, bold: true });
|
|
15
|
+
return;
|
|
16
|
+
case "em":
|
|
17
|
+
appendInlineTokens(segments, token.tokens, { ...style, italic: true, color: style.color ?? "warning" });
|
|
18
|
+
return;
|
|
19
|
+
case "del":
|
|
20
|
+
appendInlineTokens(segments, token.tokens, { ...style, dim: true, color: style.color ?? "textMuted" });
|
|
21
|
+
return;
|
|
22
|
+
case "codespan":
|
|
23
|
+
appendStyled(segments, token.text ?? "", { ...style, color: "success" });
|
|
24
|
+
return;
|
|
25
|
+
case "link":
|
|
26
|
+
appendInlineTokens(segments, token.tokens, { ...style, color: style.color ?? "secondary" });
|
|
27
|
+
return;
|
|
28
|
+
case "br":
|
|
29
|
+
appendStyled(segments, "\n", style);
|
|
30
|
+
return;
|
|
31
|
+
case "text":
|
|
32
|
+
case "paragraph":
|
|
33
|
+
case "list_item":
|
|
34
|
+
case "heading":
|
|
35
|
+
if (token.tokens?.length) {
|
|
36
|
+
appendInlineTokens(segments, token.tokens, style);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
appendStyled(segments, token.text ?? token.raw ?? "", style);
|
|
40
|
+
}
|
|
41
|
+
return;
|
|
42
|
+
case "space":
|
|
43
|
+
return;
|
|
44
|
+
default:
|
|
45
|
+
if (token.tokens?.length) {
|
|
46
|
+
appendInlineTokens(segments, token.tokens, style);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
appendStyled(segments, token.text ?? token.raw ?? "", style);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function appendInlineTokens(segments, tokens, style) {
|
|
54
|
+
for (const child of tokens ?? []) {
|
|
55
|
+
appendInlineToken(segments, child, style);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function appendStyled(segments, text, style) {
|
|
59
|
+
if (!text)
|
|
60
|
+
return;
|
|
61
|
+
segments.push({
|
|
62
|
+
text,
|
|
63
|
+
color: style.color ?? "text",
|
|
64
|
+
bold: style.bold,
|
|
65
|
+
italic: style.italic,
|
|
66
|
+
dim: style.dim,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function hashString(value: string): string;
|