@bike4mind/cli 0.9.0 → 0.9.1
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/commands/doctorCommand.mjs +1 -1
- package/dist/commands/headlessCommand.mjs +1 -1
- package/dist/commands/updateCommand.mjs +1 -1
- package/dist/index.mjs +17 -18
- package/dist/{tools-B0Y_zziv.mjs → tools-ICW0xW8W.mjs} +10 -2
- package/dist/{updateChecker-CtczXQeW.mjs → updateChecker-Dproz7j-.mjs} +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as version, n as compareSemver, r as fetchLatestVersion } from "../updateChecker-
|
|
2
|
+
import { a as version, n as compareSemver, r as fetchLatestVersion } from "../updateChecker-Dproz7j-.mjs";
|
|
3
3
|
import { execSync } from "child_process";
|
|
4
4
|
import { constants, existsSync, promises } from "fs";
|
|
5
5
|
import { homedir } from "os";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as WebSocketToolExecutor, D as ServerLlmBackend, E as WebSocketLlmBackend, F as PermissionManager, I as generateCliTools, M as loadContextFiles, N as getApiUrl, O as McpManager, Q as CheckpointStore, S as ApiClient, T as FallbackLlmBackend, W as setWebSocketToolExecutor, X as ReActAgent, Y as isReadOnlyTool, Z as CustomCommandStore, _ as createAgentDelegateTool, b as createSkillTool, d as createFindDefinitionTool, et as SessionStore, f as createTodoStore, g as BackgroundAgentManager, h as createBackgroundAgentTools, m as createCoordinateTaskTool, p as createWriteTodosTool, q as buildSystemPrompt, u as createGetFileStructureTool, v as AgentStore, w as WebSocketConnectionManager, y as SubagentOrchestrator } from "../tools-
|
|
2
|
+
import { C as WebSocketToolExecutor, D as ServerLlmBackend, E as WebSocketLlmBackend, F as PermissionManager, I as generateCliTools, M as loadContextFiles, N as getApiUrl, O as McpManager, Q as CheckpointStore, S as ApiClient, T as FallbackLlmBackend, W as setWebSocketToolExecutor, X as ReActAgent, Y as isReadOnlyTool, Z as CustomCommandStore, _ as createAgentDelegateTool, b as createSkillTool, d as createFindDefinitionTool, et as SessionStore, f as createTodoStore, g as BackgroundAgentManager, h as createBackgroundAgentTools, m as createCoordinateTaskTool, p as createWriteTodosTool, q as buildSystemPrompt, u as createGetFileStructureTool, v as AgentStore, w as WebSocketConnectionManager, y as SubagentOrchestrator } from "../tools-ICW0xW8W.mjs";
|
|
3
3
|
import { n as logger, t as ConfigStore } from "../ConfigStore-CAKSUXCi.mjs";
|
|
4
4
|
import { t as DEFAULT_SANDBOX_CONFIG } from "../types-DBEjF9YS.mjs";
|
|
5
5
|
import { t as createSandboxRuntime } from "../SandboxRuntimeAdapter-C1B4t20N.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as version, i as forceCheckForUpdate } from "../updateChecker-
|
|
2
|
+
import { a as version, i as forceCheckForUpdate } from "../updateChecker-Dproz7j-.mjs";
|
|
3
3
|
import { execSync } from "child_process";
|
|
4
4
|
//#region src/commands/updateCommand.ts
|
|
5
5
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { n as useCliStore, t as selectActiveBackgroundAgents } from "./store-DLduYYGR.mjs";
|
|
3
|
-
import { $ as CommandHistoryStore, A as formatStep, B as DEFAULT_RETRY_CONFIG, C as WebSocketToolExecutor, D as ServerLlmBackend, E as WebSocketLlmBackend, F as PermissionManager, G as OllamaBackend, H as clearFeatureModuleTools, I as generateCliTools, J as buildSkillsPromptSection, K as getPlanModeFilePath, L as ALWAYS_DENIED_FOR_AGENTS, M as loadContextFiles, N as getApiUrl, O as McpManager, P as getEnvironmentName, Q as CheckpointStore, R as DEFAULT_AGENT_MODEL, S as ApiClient, T as FallbackLlmBackend, U as registerFeatureModuleTools, V as DEFAULT_THOROUGHNESS, W as setWebSocketToolExecutor, X as ReActAgent, Y as isReadOnlyTool, Z as CustomCommandStore, _ as createAgentDelegateTool, a as createBlockerTools, at as mergeCommands, b as createSkillTool, c as createDecisionStore, ct as warmFileCache, d as createFindDefinitionTool, et as SessionStore, f as createTodoStore, g as BackgroundAgentManager, h as createBackgroundAgentTools, i as createBlockerStore, it as searchCommands, j as extractCompactInstructions, k as substituteArguments, l as formatDecisionsOutput, m as createCoordinateTaskTool, n as createReviewGateTool, nt as hasFileReferences, o as formatBlockersOutput, ot as formatFileSize, p as createWriteTodosTool, q as buildSystemPrompt, r as formatReviewGatesOutput, rt as processFileReferences, s as createDecisionLogTool, st as searchFiles, t as createReviewGateStore, tt as OAuthClient, u as createGetFileStructureTool, v as AgentStore, w as WebSocketConnectionManager, x as parseAgentConfig, y as SubagentOrchestrator, z as DEFAULT_MAX_ITERATIONS } from "./tools-
|
|
3
|
+
import { $ as CommandHistoryStore, A as formatStep, B as DEFAULT_RETRY_CONFIG, C as WebSocketToolExecutor, D as ServerLlmBackend, E as WebSocketLlmBackend, F as PermissionManager, G as OllamaBackend, H as clearFeatureModuleTools, I as generateCliTools, J as buildSkillsPromptSection, K as getPlanModeFilePath, L as ALWAYS_DENIED_FOR_AGENTS, M as loadContextFiles, N as getApiUrl, O as McpManager, P as getEnvironmentName, Q as CheckpointStore, R as DEFAULT_AGENT_MODEL, S as ApiClient, T as FallbackLlmBackend, U as registerFeatureModuleTools, V as DEFAULT_THOROUGHNESS, W as setWebSocketToolExecutor, X as ReActAgent, Y as isReadOnlyTool, Z as CustomCommandStore, _ as createAgentDelegateTool, a as createBlockerTools, at as mergeCommands, b as createSkillTool, c as createDecisionStore, ct as warmFileCache, d as createFindDefinitionTool, et as SessionStore, f as createTodoStore, g as BackgroundAgentManager, h as createBackgroundAgentTools, i as createBlockerStore, it as searchCommands, j as extractCompactInstructions, k as substituteArguments, l as formatDecisionsOutput, m as createCoordinateTaskTool, n as createReviewGateTool, nt as hasFileReferences, o as formatBlockersOutput, ot as formatFileSize, p as createWriteTodosTool, q as buildSystemPrompt, r as formatReviewGatesOutput, rt as processFileReferences, s as createDecisionLogTool, st as searchFiles, t as createReviewGateStore, tt as OAuthClient, u as createGetFileStructureTool, v as AgentStore, w as WebSocketConnectionManager, x as parseAgentConfig, y as SubagentOrchestrator, z as DEFAULT_MAX_ITERATIONS } from "./tools-ICW0xW8W.mjs";
|
|
4
4
|
import { Nt as validateJupyterKernelName, Pt as validateNotebookPath$1, g as ChatModels, m as CREDIT_DEDUCT_TRANSACTION_TYPES, n as logger, t as ConfigStore } from "./ConfigStore-CAKSUXCi.mjs";
|
|
5
|
-
import { a as version, t as checkForUpdate } from "./updateChecker-
|
|
5
|
+
import { a as version, t as checkForUpdate } from "./updateChecker-Dproz7j-.mjs";
|
|
6
6
|
import React, { useCallback, useEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
7
7
|
import { Box, Static, Text, render, useApp, useInput, usePaste, useStdout } from "ink";
|
|
8
8
|
import { execSync } from "child_process";
|
|
@@ -1022,7 +1022,7 @@ function renderDiffPreview(preview) {
|
|
|
1022
1022
|
}, line);
|
|
1023
1023
|
});
|
|
1024
1024
|
}
|
|
1025
|
-
const TOOLS_WITH_HIDDEN_ARGS$1 = new Set(["edit_local_file"]);
|
|
1025
|
+
const TOOLS_WITH_HIDDEN_ARGS$1 = new Set(["edit_local_file", "bash_execute"]);
|
|
1026
1026
|
/**
|
|
1027
1027
|
* Permission prompt component
|
|
1028
1028
|
*
|
|
@@ -2075,7 +2075,7 @@ const MessageItem = React.memo(function MessageItem({ message, showThoughts = tr
|
|
|
2075
2075
|
const { stdout } = useStdout();
|
|
2076
2076
|
const terminalCols = stdout?.columns ?? 80;
|
|
2077
2077
|
const userPromptText = `❯ ${message.content}`;
|
|
2078
|
-
const paddedUserPromptText = userPromptText.length >= terminalCols
|
|
2078
|
+
const paddedUserPromptText = userPromptText.length >= terminalCols ? userPromptText : userPromptText.padEnd(terminalCols);
|
|
2079
2079
|
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, isUser && message.content && /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, {
|
|
2080
2080
|
backgroundColor: "whiteBright",
|
|
2081
2081
|
color: "black",
|
|
@@ -2209,15 +2209,13 @@ function App({ onMessage, onBackgroundCompletion, onCommand, onBashCommand, onPe
|
|
|
2209
2209
|
onClose: () => setShowMcpViewer(false)
|
|
2210
2210
|
})) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Static, { items: messages }, (message) => /* @__PURE__ */ React.createElement(Box, {
|
|
2211
2211
|
key: message.id,
|
|
2212
|
-
flexDirection: "column"
|
|
2213
|
-
paddingX: 1
|
|
2212
|
+
flexDirection: "column"
|
|
2214
2213
|
}, /* @__PURE__ */ React.createElement(MessageItem, {
|
|
2215
2214
|
message,
|
|
2216
2215
|
showThoughts
|
|
2217
2216
|
}))), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, pendingMessages.map((message) => /* @__PURE__ */ React.createElement(Box, {
|
|
2218
2217
|
key: message.id,
|
|
2219
|
-
flexDirection: "column"
|
|
2220
|
-
paddingX: 1
|
|
2218
|
+
flexDirection: "column"
|
|
2221
2219
|
}, /* @__PURE__ */ React.createElement(MessageItem, {
|
|
2222
2220
|
message,
|
|
2223
2221
|
showThoughts
|
|
@@ -2281,7 +2279,9 @@ function App({ onMessage, onBackgroundCompletion, onCommand, onBashCommand, onPe
|
|
|
2281
2279
|
borderStyle: "single",
|
|
2282
2280
|
borderColor: isBashMode ? "yellow" : "cyan",
|
|
2283
2281
|
borderTop: true,
|
|
2284
|
-
borderBottom: true
|
|
2282
|
+
borderBottom: true,
|
|
2283
|
+
borderLeft: false,
|
|
2284
|
+
borderRight: false
|
|
2285
2285
|
}, /* @__PURE__ */ React.createElement(InputPrompt, {
|
|
2286
2286
|
onSubmit: handleSubmit,
|
|
2287
2287
|
onBashCommand,
|
|
@@ -5582,8 +5582,6 @@ function CliApp() {
|
|
|
5582
5582
|
setCommandHistory(await state.commandHistoryStore.load());
|
|
5583
5583
|
try {
|
|
5584
5584
|
await state.customCommandStore.loadCommands();
|
|
5585
|
-
const customCommandCount = state.customCommandStore.getCommandCount();
|
|
5586
|
-
if (customCommandCount > 0) startupLog.push(`📝 Loaded ${customCommandCount} custom command${customCommandCount !== 1 ? "s" : ""}`);
|
|
5587
5585
|
} catch (error) {
|
|
5588
5586
|
console.warn("Failed to load custom commands:", error instanceof Error ? error.message : String(error));
|
|
5589
5587
|
}
|
|
@@ -5612,7 +5610,7 @@ function CliApp() {
|
|
|
5612
5610
|
startupLog.push(`✅ Authenticated (expires in ${daysUntilExpiry} day${daysUntilExpiry !== 1 ? "s" : ""})`);
|
|
5613
5611
|
const apiBaseURL = getApiUrl(config.apiConfig);
|
|
5614
5612
|
const envName = getEnvironmentName(config.apiConfig);
|
|
5615
|
-
if (import.meta.url.includes("/src/") || process.env.NODE_ENV === "development" || envName !== "Bike4Mind")
|
|
5613
|
+
if (import.meta.url.includes("/src/") || process.env.NODE_ENV === "development" || envName !== "Bike4Mind") startupLog.unshift(`🌍 API Environment: ${envName} (${apiBaseURL})`);
|
|
5616
5614
|
const apiClient = new ApiClient(apiBaseURL, state.configStore);
|
|
5617
5615
|
const tokenGetter = async () => {
|
|
5618
5616
|
return (await state.configStore.getAuthTokens())?.accessToken ?? null;
|
|
@@ -5906,7 +5904,6 @@ function CliApp() {
|
|
|
5906
5904
|
observationQueue: []
|
|
5907
5905
|
};
|
|
5908
5906
|
const { tools: b4mTools } = await generateCliTools(config.userId, llm, modelInfo.id, permissionManager, promptFn, agentContext, state.configStore, apiClient, void 0, userQuestionFn, checkpointStore, sandboxOrchestrator, additionalDirectories);
|
|
5909
|
-
startupLog.push(`🛠️ Loaded ${b4mTools.length} B4M tool(s)`);
|
|
5910
5907
|
const mcpManager = new McpManager(config);
|
|
5911
5908
|
const builtinAgentsDir = new URL("./agents/defaults/", import.meta.url).pathname;
|
|
5912
5909
|
const agentProjectDir = state.configStore.getProjectConfigDir();
|
|
@@ -5919,8 +5916,8 @@ function CliApp() {
|
|
|
5919
5916
|
const mcpTools = mcpManager.getTools();
|
|
5920
5917
|
if (mcpTools.length > 0) {
|
|
5921
5918
|
const serverSummaries = mcpManager.getToolCount().map((s) => `${s.serverName} (${s.count})`).join(", ");
|
|
5922
|
-
startupLog.push(
|
|
5923
|
-
} else startupLog.push(
|
|
5919
|
+
startupLog.push(`🛠️ Loaded ${b4mTools.length} B4M + ${mcpTools.length} MCP tool(s): ${serverSummaries}`);
|
|
5920
|
+
} else startupLog.push(`🛠️ Loaded ${b4mTools.length} B4M tool(s), no MCP tools`);
|
|
5924
5921
|
const agentSummary = agentStore.getSummary();
|
|
5925
5922
|
startupLog.push(`🤖 Loaded ${agentSummary.total} agent(s): ${agentSummary.builtin} built-in, ${agentSummary.global} global, ${agentSummary.project} project`);
|
|
5926
5923
|
const orchestrator = new SubagentOrchestrator({
|
|
@@ -6002,11 +5999,9 @@ function CliApp() {
|
|
|
6002
5999
|
];
|
|
6003
6000
|
startupLog.push(`📂 Working directory: ${process.cwd()}`);
|
|
6004
6001
|
if (additionalDirectories.length > 0) startupLog.push(`📁 Additional directories: ${additionalDirectories.length}`);
|
|
6005
|
-
const agentNamesList = agentStore.getAgentNames().join(", ");
|
|
6006
|
-
startupLog.push(`🤖 Subagent delegation enabled (${agentNamesList}) + background execution`);
|
|
6007
6002
|
if (skillTool) {
|
|
6008
6003
|
const skillCount = state.customCommandStore.getCommandCount();
|
|
6009
|
-
if (skillCount > 0) startupLog.push(`🛠️
|
|
6004
|
+
if (skillCount > 0) startupLog.push(`🛠️ Skill tool enabled (${skillCount} skills available)`);
|
|
6010
6005
|
}
|
|
6011
6006
|
if (dynamicAgentTool) startupLog.push(`🧪 Dynamic agent creation enabled (experimental)`);
|
|
6012
6007
|
if (featureRegistry.hasModules) {
|
|
@@ -8465,6 +8460,10 @@ Multi-line Input:
|
|
|
8465
8460
|
allow: response !== "deny",
|
|
8466
8461
|
resolvedBy: "user"
|
|
8467
8462
|
});
|
|
8463
|
+
if (response === "deny") {
|
|
8464
|
+
abortControllerRef.current?.abort();
|
|
8465
|
+
return;
|
|
8466
|
+
}
|
|
8468
8467
|
emitNextAwaitingStatus();
|
|
8469
8468
|
},
|
|
8470
8469
|
onUserQuestionResponse: (response, promptId) => {
|
|
@@ -3262,7 +3262,11 @@ You have tools for tracking decisions, blockers, and human review gates during y
|
|
|
3262
3262
|
|
|
3263
3263
|
- request_review_gate: Pause for explicit human approval before crossing a significant decision point — one that affects interpretation, evidence, cost, credentials, platform, or public commitment (e.g., narrowing research scope after synthesis, hard-to-reverse refactors, architectural pivots, dependency swaps). Do NOT use for routine operations or actions already covered by the standard permission system (file edits, bash commands). Treat a rejection as a hard stop — re-plan, do not retry.
|
|
3264
3264
|
|
|
3265
|
-
These tools are lightweight — use them naturally as part of your work, not as a ceremony
|
|
3265
|
+
These tools are lightweight — use them naturally as part of your work, not as a ceremony.
|
|
3266
|
+
|
|
3267
|
+
## Working Directory
|
|
3268
|
+
|
|
3269
|
+
The current working directory is \`${process.cwd()}\`. All relative paths in tool calls resolve from here. When using \`${TOOL_GLOB_FILES}\` or \`${TOOL_GREP_SEARCH}\` without an explicit \`dir_path\`, they search from this directory.${directoriesSection}${projectContextSection}${skillsSection}${featureModulesSection}${planModeSection}`;
|
|
3266
3270
|
}
|
|
3267
3271
|
/**
|
|
3268
3272
|
* Build the minimal-variant system prompt. Reuses the project context,
|
|
@@ -3286,7 +3290,11 @@ function buildMinimalSystemPrompt(config = {}) {
|
|
|
3286
3290
|
Guidelines:
|
|
3287
3291
|
- Be concise in your responses.
|
|
3288
3292
|
- Show file paths clearly when working with files.
|
|
3289
|
-
- When the task is done, give the user a direct answer — no recap of steps already visible in the tool history
|
|
3293
|
+
- When the task is done, give the user a direct answer — no recap of steps already visible in the tool history.
|
|
3294
|
+
|
|
3295
|
+
## Working Directory
|
|
3296
|
+
|
|
3297
|
+
The current working directory is \`${process.cwd()}\`. All relative paths in tool calls resolve from here. When using \`${TOOL_GLOB_FILES}\` or \`${TOOL_GREP_SEARCH}\` without an explicit \`dir_path\`, they search from this directory.${directoriesSection}${projectContextSection}${skillsSection}${featureModulesSection}${planModeSection}`;
|
|
3290
3298
|
}
|
|
3291
3299
|
/**
|
|
3292
3300
|
* Pick a system prompt by variant. The dispatch point for the
|