@bike4mind/cli 0.8.0 → 0.8.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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as version, n as compareSemver, r as fetchLatestVersion } from "../updateChecker-Bbkc_8IL.mjs";
2
+ import { a as version, n as compareSemver, r as fetchLatestVersion } from "../updateChecker-BVKr0OXs.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-Dg1HL5PO.mjs";
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-DDoiKdgk.mjs";
3
3
  import { n as logger, t as ConfigStore } from "../ConfigStore-Bj1IOvWn.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-Bbkc_8IL.mjs";
2
+ import { a as version, i as forceCheckForUpdate } from "../updateChecker-BVKr0OXs.mjs";
3
3
  import { execSync } from "child_process";
4
4
  //#region src/commands/updateCommand.ts
5
5
  /**
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import { n as useCliStore, t as selectActiveBackgroundAgents } from "./store-B0ImnWR4.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-Dg1HL5PO.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-DDoiKdgk.mjs";
4
4
  import { Mt as validateNotebookPath$1, g as ChatModels, jt as validateJupyterKernelName, m as CREDIT_DEDUCT_TRANSACTION_TYPES, n as logger, t as ConfigStore } from "./ConfigStore-Bj1IOvWn.mjs";
5
- import { a as version, t as checkForUpdate } from "./updateChecker-Bbkc_8IL.mjs";
5
+ import { a as version, t as checkForUpdate } from "./updateChecker-BVKr0OXs.mjs";
6
6
  import React, { useCallback, useEffect, useMemo, useReducer, useRef, useState } from "react";
7
- import { Box, Static, Text, render, useApp, useInput } from "ink";
7
+ import { Box, Static, Text, render, useApp, useInput, usePaste } from "ink";
8
8
  import { execSync } from "child_process";
9
9
  import { randomBytes, randomUUID } from "crypto";
10
10
  import { existsSync, promises, readFileSync, statSync } from "fs";
@@ -77,6 +77,20 @@ function CustomTextInput({ value, onChange, onSubmit, onPaste, pasteIndicator, p
77
77
  while (pos < text.length && /\s/.test(text[pos])) pos++;
78
78
  return pos;
79
79
  };
80
+ usePaste((text) => {
81
+ const normalized = (text.length > 5e5 ? text.slice(0, MAX_PASTE_SIZE) : text).replace(/\r\n/g, "\n").replace(/\r/g, "\n");
82
+ if (normalized.split("\n").length >= 5 && onPaste) {
83
+ onPaste(normalized);
84
+ return;
85
+ }
86
+ if (pasteIndicator) {
87
+ emitChange(normalized);
88
+ setCursorOffset(normalized.length);
89
+ return;
90
+ }
91
+ emitChange(value.slice(0, cursorOffset) + normalized + value.slice(cursorOffset));
92
+ setCursorOffset(cursorOffset + normalized.length);
93
+ }, { isActive: !disabled });
80
94
  useInput((input, key) => {
81
95
  if (key.return && !key.meta && !key.shift) {
82
96
  if (value.length > 0 && value[cursorOffset - 1] === "\\") {
@@ -101,7 +115,7 @@ function CustomTextInput({ value, onChange, onSubmit, onPaste, pasteIndicator, p
101
115
  setCursorOffset(findNextWordBoundary(value, cursorOffset));
102
116
  return;
103
117
  }
104
- if (key.backspace || key.delete) {
118
+ if (key.backspace) {
105
119
  const beforeCursor = value.slice(0, cursorOffset);
106
120
  const afterCursor = value.slice(cursorOffset);
107
121
  const newPos = findPreviousWordBoundary(beforeCursor, beforeCursor.length);
@@ -109,6 +123,13 @@ function CustomTextInput({ value, onChange, onSubmit, onPaste, pasteIndicator, p
109
123
  setCursorOffset(newPos);
110
124
  return;
111
125
  }
126
+ if (key.delete) {
127
+ const beforeCursor = value.slice(0, cursorOffset);
128
+ const afterCursor = value.slice(cursorOffset);
129
+ const newPos = findNextWordBoundary(afterCursor, 0);
130
+ emitChange(beforeCursor + afterCursor.slice(newPos));
131
+ return;
132
+ }
112
133
  } else {
113
134
  if (key.leftArrow) {
114
135
  setCursorOffset(0);
@@ -118,11 +139,15 @@ function CustomTextInput({ value, onChange, onSubmit, onPaste, pasteIndicator, p
118
139
  setCursorOffset(value.length);
119
140
  return;
120
141
  }
121
- if (key.backspace || key.delete) {
142
+ if (key.backspace) {
122
143
  emitChange(value.slice(cursorOffset));
123
144
  setCursorOffset(0);
124
145
  return;
125
146
  }
147
+ if (key.delete) {
148
+ emitChange(value.slice(0, cursorOffset));
149
+ return;
150
+ }
126
151
  }
127
152
  if (key.home) {
128
153
  setCursorOffset(0);
@@ -191,7 +216,7 @@ function CustomTextInput({ value, onChange, onSubmit, onPaste, pasteIndicator, p
191
216
  }
192
217
  return;
193
218
  }
194
- if (key.backspace || key.delete) {
219
+ if (key.backspace) {
195
220
  if (pasteIndicator) {
196
221
  emitChange("");
197
222
  setCursorOffset(0);
@@ -203,6 +228,15 @@ function CustomTextInput({ value, onChange, onSubmit, onPaste, pasteIndicator, p
203
228
  }
204
229
  return;
205
230
  }
231
+ if (key.delete) {
232
+ if (pasteIndicator) {
233
+ emitChange("");
234
+ setCursorOffset(0);
235
+ return;
236
+ }
237
+ if (cursorOffset < value.length) emitChange(value.slice(0, cursorOffset) + value.slice(cursorOffset + 1));
238
+ return;
239
+ }
206
240
  if (key.leftArrow && !key.meta && !key.ctrl) {
207
241
  setCursorOffset(Math.max(0, cursorOffset - 1));
208
242
  return;
@@ -724,10 +758,9 @@ function InputPrompt({ onSubmit, onBashCommand, onImageDetected, disabled = fals
724
758
  setFileAutocomplete(null);
725
759
  };
726
760
  const handlePaste = (content) => {
727
- const truncated = content.length > 5e5 ? content.slice(0, MAX_PASTE_SIZE) : content;
728
- const lineCount = truncated.split("\n").length;
761
+ const lineCount = content.split("\n").length;
729
762
  const prefix = value.trim();
730
- setPastedContent(prefix ? `${prefix}\n${truncated}` : truncated, lineCount);
763
+ setPastedContent(prefix ? `${prefix}\n${content}` : content, lineCount);
731
764
  };
732
765
  const handleChange = async (newValue) => {
733
766
  if (pastedContent) clearPaste();
@@ -1859,21 +1892,22 @@ function McpViewer({ config, mcpManager, onClose }) {
1859
1892
  }
1860
1893
  //#endregion
1861
1894
  //#region src/components/MarkdownRenderer.tsx
1862
- function MarkdownRenderer({ content }) {
1895
+ function MarkdownRenderer({ content, columns: columnsProp }) {
1896
+ const columns = columnsProp ?? process.stdout.columns ?? 80;
1863
1897
  const tokens = marked.lexer(content);
1864
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, tokens.map((token, idx) => renderToken(token, idx)));
1898
+ return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, tokens.map((token, idx) => renderToken(token, idx, columns)));
1865
1899
  }
1866
- function renderToken(token, idx) {
1900
+ function renderToken(token, idx, columns) {
1867
1901
  switch (token.type) {
1868
1902
  case "heading": return renderHeading(token, idx);
1869
1903
  case "code": return renderCodeBlock(token, idx);
1870
1904
  case "paragraph": return renderParagraph(token, idx);
1871
1905
  case "list": return renderList(token, idx);
1872
- case "blockquote": return renderBlockquote(token, idx);
1906
+ case "blockquote": return renderBlockquote(token, idx, columns);
1873
1907
  case "hr": return /* @__PURE__ */ React.createElement(Text, {
1874
1908
  key: idx,
1875
1909
  dimColor: true
1876
- }, "─".repeat(50));
1910
+ }, "─".repeat(Math.max(1, columns - 4)));
1877
1911
  case "space": return null;
1878
1912
  default:
1879
1913
  if ("text" in token) return /* @__PURE__ */ React.createElement(Text, { key: idx }, token.text);
@@ -1932,14 +1966,14 @@ function renderListItem(item, idx, ordered, number) {
1932
1966
  paddingLeft: 2
1933
1967
  }, /* @__PURE__ */ React.createElement(Text, null, bullet, " ", parseInlineText(item.text)));
1934
1968
  }
1935
- function renderBlockquote(token, idx) {
1969
+ function renderBlockquote(token, idx, columns) {
1936
1970
  return /* @__PURE__ */ React.createElement(Box, {
1937
1971
  key: idx,
1938
1972
  paddingLeft: 2,
1939
1973
  borderStyle: "single",
1940
1974
  borderLeft: true,
1941
1975
  borderColor: "gray"
1942
- }, token.tokens.map((t, i) => renderToken(t, i)));
1976
+ }, token.tokens.map((t, i) => renderToken(t, i, columns)));
1943
1977
  }
1944
1978
  /**
1945
1979
  * Parse inline markdown formatting (bold, italic, code, links)
@@ -2268,6 +2268,15 @@ Remember: You are an autonomous AGENT. Act independently and solve problems proa
2268
2268
  return this.toolCallCount;
2269
2269
  }
2270
2270
  /**
2271
+ * Get current iteration count.
2272
+ * Cheap accessor for hot paths (e.g., per-step event listeners) — prefer this
2273
+ * over `toCheckpoint().iteration`, which deep-clones messages, steps, and
2274
+ * confidence log on every call.
2275
+ */
2276
+ getIteration() {
2277
+ return this.iterations;
2278
+ }
2279
+ /**
2271
2280
  * Serialize the agent's current execution state for persistence.
2272
2281
  *
2273
2282
  * Call this after each iteration to create a durable checkpoint that can
@@ -4,7 +4,7 @@ import { homedir } from "os";
4
4
  import path from "path";
5
5
  import axios from "axios";
6
6
  //#region package.json
7
- var version = "0.8.0";
7
+ var version = "0.8.1";
8
8
  //#endregion
9
9
  //#region src/utils/updateChecker.ts
10
10
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bike4mind/cli",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "type": "module",
5
5
  "description": "Interactive CLI tool for Bike4Mind with ReAct agents",
6
6
  "license": "UNLICENSED",
@@ -118,11 +118,11 @@
118
118
  "tsx": "^4.21.0",
119
119
  "typescript": "^5.9.3",
120
120
  "vitest": "^4.1.2",
121
- "@bike4mind/agents": "0.7.1",
121
+ "@bike4mind/agents": "0.8.0",
122
122
  "@bike4mind/common": "2.92.2",
123
123
  "@bike4mind/mcp": "1.37.4",
124
- "@bike4mind/services": "2.79.5",
125
- "@bike4mind/utils": "2.19.4"
124
+ "@bike4mind/utils": "2.19.4",
125
+ "@bike4mind/services": "2.80.0"
126
126
  },
127
127
  "optionalDependencies": {
128
128
  "@vscode/ripgrep": "^1.17.1"