@bike4mind/cli 0.2.11 → 0.2.12-fix-cli-paste-and-file-drag-drop.17399

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 CHANGED
@@ -9,8 +9,10 @@ Interactive command-line interface for Bike4Mind with ReAct agents.
9
9
  - šŸ’¾ Session persistence
10
10
  - šŸ› ļø B4M tools + MCP integration
11
11
  - šŸŽØ Rich terminal UI with Ink
12
+ - šŸ–¼ļø Image paste and drag-and-drop support (iTerm2, Kitty)
12
13
  - šŸ› Debug logging with `--verbose` flag
13
14
  - šŸ“„ Context file loading (CLAUDE.md, AGENTS.md, AI.md)
15
+ - šŸ“ File references with `@` autocomplete
14
16
 
15
17
  ## Installation
16
18
 
@@ -36,6 +38,25 @@ From the project root:
36
38
  pnpm install
37
39
  ```
38
40
 
41
+ #### Build Requirements
42
+
43
+ The CLI uses native dependencies (`better-sqlite3` for image caching, `sharp` for image processing) that require compilation. These should build automatically during installation, but if you encounter errors:
44
+
45
+ **Prerequisites:**
46
+ - Python 3 (required by node-gyp)
47
+ - C++ compiler (Xcode Command Line Tools on macOS, build-essential on Linux, Visual Studio on Windows)
48
+
49
+ **Manual rebuild if needed:**
50
+ ```bash
51
+ # If you see "Could not locate the bindings file" errors
52
+ pnpm rebuild better-sqlite3
53
+
54
+ # Or rebuild all native modules
55
+ pnpm rebuild
56
+ ```
57
+
58
+ **Note:** The postinstall script will automatically rebuild `better-sqlite3` if the native bindings are missing, so manual intervention is rarely needed.
59
+
39
60
  ## Usage
40
61
 
41
62
  ### Start Interactive Session
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/index.js CHANGED
@@ -182,11 +182,11 @@ function CustomTextInput({
182
182
  setCursorOffset(Math.min(value.length, cursorOffset + 1));
183
183
  return;
184
184
  }
185
- if (!key.ctrl && !key.meta && input.length === 1) {
185
+ if (!key.ctrl && !key.meta && input.length > 0) {
186
186
  const sanitizedInput = input === "\r" ? "\n" : input;
187
187
  const newValue = value.slice(0, cursorOffset) + sanitizedInput + value.slice(cursorOffset);
188
188
  onChange(newValue);
189
- setCursorOffset(cursorOffset + 1);
189
+ setCursorOffset(cursorOffset + sanitizedInput.length);
190
190
  }
191
191
  },
192
192
  { isActive: !disabled }
@@ -713,7 +713,7 @@ var ImageInputDetector = class {
713
713
  if (!this.looksLikeFilePath(input)) return null;
714
714
  let filepath = input.trim();
715
715
  filepath = filepath.replace(/^["']|["']$/g, "");
716
- filepath = filepath.replace(/\\\s/g, " ");
716
+ filepath = filepath.replace(/\\(.)/g, "$1");
717
717
  if (!existsSync(filepath)) return null;
718
718
  const stats = statSync2(filepath);
719
719
  if (!stats.isFile()) return null;
@@ -740,7 +740,15 @@ var ImageInputDetector = class {
740
740
  */
741
741
  static looksLikeFilePath(input) {
742
742
  const trimmed = input.trim();
743
- if (trimmed.startsWith("/") || trimmed.match(/^[a-zA-Z]:\\/)) {
743
+ if (trimmed.startsWith("/")) {
744
+ const hasMultipleSegments = trimmed.indexOf("/", 1) !== -1;
745
+ const hasImageExtension = this.SUPPORTED_EXTENSIONS.some((ext) => trimmed.toLowerCase().endsWith(ext));
746
+ if (hasMultipleSegments || hasImageExtension) {
747
+ return true;
748
+ }
749
+ return false;
750
+ }
751
+ if (trimmed.match(/^[a-zA-Z]:\\/)) {
744
752
  return true;
745
753
  }
746
754
  if (trimmed.startsWith("~")) {
@@ -769,6 +777,16 @@ var ImageInputDetector = class {
769
777
  };
770
778
 
771
779
  // src/components/InputPrompt.tsx
780
+ function looksLikeFilePath(input) {
781
+ const trimmed = input.trim();
782
+ if (trimmed.startsWith("/")) {
783
+ const hasMultipleSegments = trimmed.indexOf("/", 1) !== -1;
784
+ if (hasMultipleSegments) return true;
785
+ }
786
+ if (trimmed.startsWith("~")) return true;
787
+ if (trimmed.match(/^[a-zA-Z]:\\/)) return true;
788
+ return false;
789
+ }
772
790
  function findAtTrigger(value) {
773
791
  for (let i = value.length - 1; i >= 0; i--) {
774
792
  if (value[i] === "@") {
@@ -812,7 +830,7 @@ function InputPrompt({
812
830
  useEffect(() => {
813
831
  onBashModeChange?.(isBashMode);
814
832
  }, [isBashMode, onBashModeChange]);
815
- const shouldShowCommandAutocomplete = value.startsWith("/") && !disabled && !fileAutocomplete?.active;
833
+ const shouldShowCommandAutocomplete = value.startsWith("/") && !disabled && !fileAutocomplete?.active && !looksLikeFilePath(value);
816
834
  const commandQuery = shouldShowCommandAutocomplete ? value.slice(1) : "";
817
835
  const filteredCommands = useMemo(() => {
818
836
  if (!shouldShowCommandAutocomplete) return [];
@@ -1358,7 +1376,7 @@ function isNameSuffix(value) {
1358
1376
 
1359
1377
  // src/utils/processFileReferences.ts
1360
1378
  var FILE_REFERENCE_REGEX = /(?:^|\s)@([^\s@]+)/g;
1361
- function looksLikeFilePath(ref) {
1379
+ function looksLikeFilePath2(ref) {
1362
1380
  if (ref.includes("/") || ref.includes(path2.sep)) {
1363
1381
  return true;
1364
1382
  }
@@ -1381,7 +1399,7 @@ function extractFileReferences(message) {
1381
1399
  let match;
1382
1400
  while ((match = FILE_REFERENCE_REGEX.exec(message)) !== null) {
1383
1401
  const ref = match[1];
1384
- if (looksLikeFilePath(ref)) {
1402
+ if (looksLikeFilePath2(ref)) {
1385
1403
  references.push(ref);
1386
1404
  }
1387
1405
  }
@@ -11658,7 +11676,7 @@ import { isAxiosError as isAxiosError2 } from "axios";
11658
11676
  // package.json
11659
11677
  var package_default = {
11660
11678
  name: "@bike4mind/cli",
11661
- version: "0.2.11",
11679
+ version: "0.2.12-fix-cli-paste-and-file-drag-drop.17399+83db78e24",
11662
11680
  type: "module",
11663
11681
  description: "Interactive CLI tool for Bike4Mind with ReAct agents",
11664
11682
  license: "UNLICENSED",
@@ -11695,7 +11713,8 @@ var package_default = {
11695
11713
  test: "vitest run",
11696
11714
  "test:watch": "vitest",
11697
11715
  start: "node dist/index.js",
11698
- prepublishOnly: "pnpm build"
11716
+ prepublishOnly: "pnpm build",
11717
+ postinstall: `node -e "try { require('better-sqlite3') } catch(e) { if(e.message.includes('bindings')) { console.log('\\n\u26A0\uFE0F Rebuilding better-sqlite3 native bindings...'); require('child_process').execSync('pnpm rebuild better-sqlite3', {stdio:'inherit'}) } }"`
11699
11718
  },
11700
11719
  dependencies: {
11701
11720
  "@anthropic-ai/sdk": "^0.22.0",
@@ -11761,11 +11780,11 @@ var package_default = {
11761
11780
  zustand: "^4.5.4"
11762
11781
  },
11763
11782
  devDependencies: {
11764
- "@bike4mind/agents": "workspace:*",
11765
- "@bike4mind/common": "workspace:*",
11766
- "@bike4mind/mcp": "workspace:*",
11767
- "@bike4mind/services": "workspace:*",
11768
- "@bike4mind/utils": "workspace:*",
11783
+ "@bike4mind/agents": "0.1.0",
11784
+ "@bike4mind/common": "2.41.1-fix-cli-paste-and-file-drag-drop.17399+83db78e24",
11785
+ "@bike4mind/mcp": "1.21.1-fix-cli-paste-and-file-drag-drop.17399+83db78e24",
11786
+ "@bike4mind/services": "2.36.1-fix-cli-paste-and-file-drag-drop.17399+83db78e24",
11787
+ "@bike4mind/utils": "2.1.6-fix-cli-paste-and-file-drag-drop.17399+83db78e24",
11769
11788
  "@types/better-sqlite3": "^7.6.13",
11770
11789
  "@types/diff": "^5.0.9",
11771
11790
  "@types/jsonwebtoken": "^9.0.4",
@@ -11777,7 +11796,8 @@ var package_default = {
11777
11796
  tsx: "^4.21.0",
11778
11797
  typescript: "^5.9.3",
11779
11798
  vitest: "^3.2.4"
11780
- }
11799
+ },
11800
+ gitHead: "83db78e247937e7d9ca57049096ea44cfc638790"
11781
11801
  };
11782
11802
 
11783
11803
  // src/config/constants.ts
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bike4mind/cli",
3
- "version": "0.2.11",
3
+ "version": "0.2.12-fix-cli-paste-and-file-drag-drop.17399+83db78e24",
4
4
  "type": "module",
5
5
  "description": "Interactive CLI tool for Bike4Mind with ReAct agents",
6
6
  "license": "UNLICENSED",
@@ -30,6 +30,16 @@
30
30
  "dist",
31
31
  "bin"
32
32
  ],
33
+ "scripts": {
34
+ "dev": "tsx src/index.tsx",
35
+ "build": "tsup",
36
+ "typecheck": "tsc --noEmit",
37
+ "test": "vitest run",
38
+ "test:watch": "vitest",
39
+ "start": "node dist/index.js",
40
+ "prepublishOnly": "pnpm build",
41
+ "postinstall": "node -e \"try { require('better-sqlite3') } catch(e) { if(e.message.includes('bindings')) { console.log('\\nāš ļø Rebuilding better-sqlite3 native bindings...'); require('child_process').execSync('pnpm rebuild better-sqlite3', {stdio:'inherit'}) } }\""
42
+ },
33
43
  "dependencies": {
34
44
  "@anthropic-ai/sdk": "^0.22.0",
35
45
  "@aws-sdk/client-apigatewaymanagementapi": "3.654.0",
@@ -94,6 +104,11 @@
94
104
  "zustand": "^4.5.4"
95
105
  },
96
106
  "devDependencies": {
107
+ "@bike4mind/agents": "0.1.0",
108
+ "@bike4mind/common": "2.41.1-fix-cli-paste-and-file-drag-drop.17399+83db78e24",
109
+ "@bike4mind/mcp": "1.21.1-fix-cli-paste-and-file-drag-drop.17399+83db78e24",
110
+ "@bike4mind/services": "2.36.1-fix-cli-paste-and-file-drag-drop.17399+83db78e24",
111
+ "@bike4mind/utils": "2.1.6-fix-cli-paste-and-file-drag-drop.17399+83db78e24",
97
112
  "@types/better-sqlite3": "^7.6.13",
98
113
  "@types/diff": "^5.0.9",
99
114
  "@types/jsonwebtoken": "^9.0.4",
@@ -104,19 +119,7 @@
104
119
  "tsup": "^8.5.1",
105
120
  "tsx": "^4.21.0",
106
121
  "typescript": "^5.9.3",
107
- "vitest": "^3.2.4",
108
- "@bike4mind/agents": "0.1.0",
109
- "@bike4mind/common": "2.41.0",
110
- "@bike4mind/mcp": "1.21.0",
111
- "@bike4mind/services": "2.36.0",
112
- "@bike4mind/utils": "2.1.5"
122
+ "vitest": "^3.2.4"
113
123
  },
114
- "scripts": {
115
- "dev": "tsx src/index.tsx",
116
- "build": "tsup",
117
- "typecheck": "tsc --noEmit",
118
- "test": "vitest run",
119
- "test:watch": "vitest",
120
- "start": "node dist/index.js"
121
- }
122
- }
124
+ "gitHead": "83db78e247937e7d9ca57049096ea44cfc638790"
125
+ }