@bubblebrain-ai/bubble 0.0.58 → 0.0.60
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 +56 -6
- package/dist/agent/child-runner.js +5 -1
- package/dist/agent/internal-reminder-sanitizer.d.ts +1 -1
- package/dist/agent/internal-reminder-sanitizer.js +7 -1
- package/dist/agent/profiles.js +4 -4
- package/dist/agent/routing-catalog.d.ts +19 -1
- package/dist/agent/routing-catalog.js +32 -13
- package/dist/agent/subagent/runtime.d.ts +28 -0
- package/dist/agent/subagent/runtime.js +34 -30
- package/dist/agent/subagent-control.d.ts +7 -0
- package/dist/agent/subagent-control.js +2 -0
- package/dist/agent/subagent-lifecycle-reminder.js +2 -1
- package/dist/agent/subagent-wait-guidance.d.ts +2 -0
- package/dist/agent/subagent-wait-guidance.js +8 -0
- package/dist/agent/subtask-policy.js +4 -4
- package/dist/agent.d.ts +20 -11
- package/dist/agent.js +200 -117
- package/dist/anthropic-thinking.d.ts +4 -0
- package/dist/anthropic-thinking.js +11 -0
- package/dist/approval/controller.d.ts +20 -6
- package/dist/approval/controller.js +67 -8
- package/dist/approval/protected-paths.d.ts +1 -0
- package/dist/approval/protected-paths.js +35 -0
- package/dist/approval/session-cache.d.ts +12 -26
- package/dist/approval/session-cache.js +20 -50
- package/dist/approval/types.d.ts +27 -1
- package/dist/cli.d.ts +5 -0
- package/dist/cli.js +25 -2
- package/dist/config.d.ts +3 -0
- package/dist/config.js +7 -0
- package/dist/context/checkpoint.d.ts +18 -0
- package/dist/context/checkpoint.js +117 -0
- package/dist/context/compact-llm.js +7 -0
- package/dist/context/compact.d.ts +8 -0
- package/dist/context/compact.js +40 -7
- package/dist/context/llm-compactor.d.ts +36 -2
- package/dist/context/llm-compactor.js +227 -44
- package/dist/context/session-write-lock.d.ts +20 -0
- package/dist/context/session-write-lock.js +162 -0
- package/dist/context/tool-images.d.ts +3 -0
- package/dist/context/tool-images.js +35 -0
- package/dist/context/usage.js +22 -5
- package/dist/feishu/agent-host/run-driver.js +56 -9
- package/dist/lsp/service.d.ts +13 -1
- package/dist/lsp/service.js +163 -43
- package/dist/main.js +82 -16
- package/dist/mcp/config.d.ts +4 -0
- package/dist/mcp/config.js +17 -0
- package/dist/mcp/manager.d.ts +13 -1
- package/dist/mcp/manager.js +32 -1
- package/dist/mcp/transports.js +11 -0
- package/dist/memory/db.d.ts +1 -0
- package/dist/memory/db.js +20 -4
- package/dist/memory/phase1.js +122 -16
- package/dist/memory/prompts.js +3 -0
- package/dist/model-catalog.js +19 -3
- package/dist/model-config.d.ts +1 -0
- package/dist/model-config.js +5 -5
- package/dist/model-pricing.js +26 -9
- package/dist/network/provider-transport-log.d.ts +12 -0
- package/dist/network/provider-transport-log.js +32 -0
- package/dist/network/provider-transport.js +6 -1
- package/dist/network/retry.d.ts +1 -1
- package/dist/network/retry.js +1 -1
- package/dist/oauth/grok.d.ts +1 -0
- package/dist/oauth/grok.js +20 -16
- package/dist/oauth/openai-codex.d.ts +1 -0
- package/dist/oauth/openai-codex.js +29 -25
- package/dist/oauth/refresh-control.d.ts +12 -0
- package/dist/oauth/refresh-control.js +42 -0
- package/dist/oauth/storage.d.ts +55 -1
- package/dist/oauth/storage.js +281 -16
- package/dist/permissions/rule.d.ts +6 -3
- package/dist/permissions/rule.js +71 -12
- package/dist/permissions/settings.d.ts +28 -1
- package/dist/permissions/settings.js +93 -3
- package/dist/permissions/shell-command.d.ts +36 -0
- package/dist/permissions/shell-command.js +226 -0
- package/dist/permissions/trust-prompt.d.ts +10 -0
- package/dist/permissions/trust-prompt.js +34 -0
- package/dist/permissions/trust.d.ts +26 -0
- package/dist/permissions/trust.js +113 -0
- package/dist/prompt/compose.d.ts +3 -0
- package/dist/prompt/compose.js +24 -7
- package/dist/prompt/environment.js +2 -2
- package/dist/prompt/reminders.js +1 -1
- package/dist/prompt/runtime.js +1 -1
- package/dist/provider-anthropic.d.ts +6 -2
- package/dist/provider-anthropic.js +98 -18
- package/dist/provider-error-record.d.ts +9 -0
- package/dist/provider-error-record.js +42 -14
- package/dist/provider-grok.js +5 -1
- package/dist/provider-openai-codex.d.ts +8 -0
- package/dist/provider-openai-codex.js +107 -24
- package/dist/provider-registry.d.ts +45 -2
- package/dist/provider-registry.js +300 -88
- package/dist/provider-transform.js +8 -0
- package/dist/provider-zen-errors.d.ts +9 -0
- package/dist/provider-zen-errors.js +36 -0
- package/dist/provider.js +36 -5
- package/dist/sdk/index.d.ts +69 -8
- package/dist/sdk/index.js +252 -39
- package/dist/sdk/replay-event-log.d.ts +7 -0
- package/dist/sdk/replay-event-log.js +66 -16
- package/dist/session-context-fence.d.ts +16 -0
- package/dist/session-context-fence.js +26 -0
- package/dist/session-log.d.ts +11 -2
- package/dist/session-log.js +187 -39
- package/dist/session-types.d.ts +5 -1
- package/dist/session.d.ts +39 -7
- package/dist/session.js +341 -93
- package/dist/skills/format.d.ts +31 -1
- package/dist/skills/format.js +45 -24
- package/dist/slash-commands/commands.d.ts +3 -0
- package/dist/slash-commands/commands.js +29 -14
- package/dist/system-prompt.d.ts +3 -1
- package/dist/tasks/manager.d.ts +7 -0
- package/dist/tasks/manager.js +97 -18
- package/dist/tools/agent-lifecycle.js +11 -7
- package/dist/tools/child-tools.d.ts +1 -1
- package/dist/tools/child-tools.js +4 -4
- package/dist/tools/edit-apply.d.ts +0 -3
- package/dist/tools/edit-apply.js +45 -249
- package/dist/tools/edit.js +3 -3
- package/dist/tools/exit-plan-mode.d.ts +5 -0
- package/dist/tools/exit-plan-mode.js +3 -2
- package/dist/tools/file-state.d.ts +4 -0
- package/dist/tools/file-state.js +12 -3
- package/dist/tools/grep.js +20 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +3 -3
- package/dist/tools/ls.d.ts +3 -0
- package/dist/tools/ls.js +85 -0
- package/dist/tools/path-utils.d.ts +6 -0
- package/dist/tools/path-utils.js +38 -1
- package/dist/tools/sensitive-paths.d.ts +8 -0
- package/dist/tools/sensitive-paths.js +85 -3
- package/dist/tools/skill.d.ts +2 -0
- package/dist/tools/skill.js +34 -2
- package/dist/tools/task-tools.js +11 -7
- package/dist/tui/app.js +22 -12
- package/dist/tui/components/approval-dialog.d.ts +5 -5
- package/dist/tui/components/approval-dialog.js +16 -51
- package/dist/tui/components/skills-panel.d.ts +4 -0
- package/dist/tui/components/skills-panel.js +15 -1
- package/dist/tui/components/streaming-message.js +7 -2
- package/dist/tui/components/tasks-pane.d.ts +38 -0
- package/dist/tui/components/tasks-pane.js +182 -32
- package/dist/tui/components/transcript.d.ts +11 -4
- package/dist/tui/components/transcript.js +158 -71
- package/dist/tui/composer-autocomplete.d.ts +17 -2
- package/dist/tui/composer-autocomplete.js +79 -2
- package/dist/tui/controller/controller.d.ts +9 -4
- package/dist/tui/controller/controller.js +87 -95
- package/dist/tui/controller/goal-runtime-controller.js +1 -1
- package/dist/tui/controller/session-transition.js +1 -1
- package/dist/tui/model/subagent-view.d.ts +11 -19
- package/dist/tui/model/subagent-view.js +56 -85
- package/dist/tui/model/task-lifecycle.d.ts +57 -0
- package/dist/tui/model/task-lifecycle.js +124 -0
- package/dist/tui/model/trace-groups.js +10 -9
- package/dist/tui/trace-groups.js +10 -9
- package/dist/types.d.ts +20 -0
- package/dist/variant/variant-resolver.js +2 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui-alt-screen.d.ts +1 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui-alt-screen.d.ts.map +1 -1
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui-alt-screen.js +6 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui-alt-screen.js.map +1 -1
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui.d.ts +2 -0
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui.d.ts.map +1 -1
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui.js +8 -4
- package/node_modules/@bubblebrain-ai/pi-tui/dist/src/tui.js.map +1 -1
- package/package.json +11 -3
- package/dist/prompt/skills.d.ts +0 -2
- package/dist/prompt/skills.js +0 -4
- package/dist/tools/glob.d.ts +0 -5
- package/dist/tools/glob.js +0 -199
package/dist/agent.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Agent - The core decision loop.
|
|
3
|
-
* It maintains message state, calls the LLM, executes tools, and auto-continues.
|
|
4
|
-
*/
|
|
1
|
+
import { type ContextCheckpoint } from "./context/checkpoint.js";
|
|
5
2
|
import { type ContextUsageSnapshot } from "./context/usage.js";
|
|
6
3
|
import type { AgentEvent, AgentInputController, ContentPart, PermissionMode, Message, Provider, ThinkingLevel, ToolResult, ToolRegistryEntry, ToolUpdate } from "./types.js";
|
|
7
4
|
import { type TurnHooks } from "./orchestrator/hooks.js";
|
|
@@ -65,6 +62,9 @@ export interface AgentOptions {
|
|
|
65
62
|
* session-level summary entry would make resume skip earlier history.
|
|
66
63
|
*/
|
|
67
64
|
onCompactionApplied?: (summary: string) => void;
|
|
65
|
+
/** Required durable commit hook for hosts; exceptions abort the context switch. */
|
|
66
|
+
onContextCheckpoint?: (checkpoint: ContextCheckpoint) => void;
|
|
67
|
+
getContextRevision?: () => string;
|
|
68
68
|
hooks?: TurnHooks[];
|
|
69
69
|
externalHooks?: ExternalHookController;
|
|
70
70
|
agentRole?: "parent" | "subagent";
|
|
@@ -75,6 +75,8 @@ export interface AgentOptions {
|
|
|
75
75
|
subAgentId?: string;
|
|
76
76
|
};
|
|
77
77
|
skills?: SkillSummary[];
|
|
78
|
+
/** Skill catalog budget in characters for rebuilt system prompts (0 = off). */
|
|
79
|
+
skillCatalogChars?: number;
|
|
78
80
|
memoryPrompt?: string;
|
|
79
81
|
fileStateTracker?: FileStateTracker;
|
|
80
82
|
agentCategories?: AgentCategoriesConfig;
|
|
@@ -103,6 +105,8 @@ export interface AgentOptions {
|
|
|
103
105
|
export interface AgentRunOptions {
|
|
104
106
|
abortSignal?: AbortSignal;
|
|
105
107
|
inputController?: AgentInputController;
|
|
108
|
+
/** Child follow-ups continue at a safe boundary, including a tool-free answer. */
|
|
109
|
+
continueOnPendingInput?: boolean;
|
|
106
110
|
/** Local-only presentation metadata persisted with the submitted user turn. */
|
|
107
111
|
userMessageUi?: Extract<Message, {
|
|
108
112
|
role: "user";
|
|
@@ -159,6 +163,9 @@ export declare class Agent {
|
|
|
159
163
|
private _modeVersion;
|
|
160
164
|
private onModeUpdate?;
|
|
161
165
|
private onCompactionApplied?;
|
|
166
|
+
private onContextCheckpoint?;
|
|
167
|
+
private getContextRevision?;
|
|
168
|
+
private lastCompactionId?;
|
|
162
169
|
private onMessageAppend?;
|
|
163
170
|
private onProviderError?;
|
|
164
171
|
private onToolResult?;
|
|
@@ -171,6 +178,7 @@ export declare class Agent {
|
|
|
171
178
|
private budgetLedger?;
|
|
172
179
|
private budgetSource;
|
|
173
180
|
private skillSummaries;
|
|
181
|
+
private skillCatalogChars?;
|
|
174
182
|
private memoryPrompt?;
|
|
175
183
|
private fileStateTracker?;
|
|
176
184
|
private agentCategories;
|
|
@@ -193,6 +201,7 @@ export declare class Agent {
|
|
|
193
201
|
private lastInputTokens;
|
|
194
202
|
private lastAnchorMessageCount;
|
|
195
203
|
private compactionStats;
|
|
204
|
+
private contextEvents;
|
|
196
205
|
constructor(options: AgentOptions);
|
|
197
206
|
/**
|
|
198
207
|
* Re-inject the deferred-tools advertisement. Hosts that reassign
|
|
@@ -232,8 +241,10 @@ export declare class Agent {
|
|
|
232
241
|
unlockDeferredTools(names: string[]): void;
|
|
233
242
|
/** All deferred tools in this session (for tool_search to inspect). */
|
|
234
243
|
listDeferredTools(): ToolRegistryEntry[];
|
|
235
|
-
getSystemPromptToolOptions(): Pick<import("./system-prompt.js").SystemPromptOptions, "tools" | "toolSnippets" | "guidelines" | "modelRoutingPrompt" | "memoryPrompt">;
|
|
236
|
-
|
|
244
|
+
getSystemPromptToolOptions(): Pick<import("./system-prompt.js").SystemPromptOptions, "tools" | "toolSnippets" | "guidelines" | "modelRoutingPrompt" | "memoryPrompt" | "skills" | "skillCatalogChars">;
|
|
245
|
+
getSkillSummaries(): SkillSummary[];
|
|
246
|
+
getSkillCatalogChars(): number | undefined;
|
|
247
|
+
/** Refresh the live Skill catalog after /skills reloads or changes enablement; hosts then rebuild the system prompt. */
|
|
237
248
|
setSkillSummaries(skills: SkillSummary[]): void;
|
|
238
249
|
/** Current routing menu (design §4); undefined when no accessor is wired. */
|
|
239
250
|
buildModelRoutingPromptSection(): string | undefined;
|
|
@@ -308,6 +319,7 @@ export declare class Agent {
|
|
|
308
319
|
resident: number;
|
|
309
320
|
subturn: number;
|
|
310
321
|
llm: number;
|
|
322
|
+
heuristic: number;
|
|
311
323
|
overflow: number;
|
|
312
324
|
fired: number;
|
|
313
325
|
droppedMessages: number;
|
|
@@ -438,11 +450,8 @@ export declare class Agent {
|
|
|
438
450
|
private createChildAgent;
|
|
439
451
|
private forkMessagesForSubagent;
|
|
440
452
|
private maybeCompactResidentHistory;
|
|
441
|
-
/**
|
|
442
|
-
|
|
443
|
-
* Failure is swallowed: losing persistence must never break the run itself.
|
|
444
|
-
*/
|
|
445
|
-
private persistCompactionSummary;
|
|
453
|
+
/** Persist conversational context first; keep live reminders outside the durable projection. */
|
|
454
|
+
private applyContextCheckpoint;
|
|
446
455
|
private appendMessage;
|
|
447
456
|
private persistProviderError;
|
|
448
457
|
private recordProviderError;
|