@bike4mind/cli 0.2.61 → 0.2.62-chore-7507-migrate-tsdown.21766
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/bin/bike4mind-cli.mjs +6 -6
- package/dist/BubblewrapRuntime-BHbtqvLx.mjs +72 -0
- package/dist/ConfigStore-6JNrjWhn.mjs +8603 -0
- package/dist/ImageStore-DaKT_Ew8.mjs +202 -0
- package/dist/ProxyManager-Dl2nFk-A.mjs +259 -0
- package/dist/ProxyManager-kiOD1X8-.mjs +3 -0
- package/dist/SandboxOrchestrator-BEW3rqYi.mjs +159 -0
- package/dist/SandboxOrchestrator-CHZgSR3P.mjs +3 -0
- package/dist/SandboxRuntimeAdapter-C1B4t20N.mjs +57 -0
- package/dist/SandboxRuntimeAdapter-D7UAG13n.mjs +3 -0
- package/dist/SeatbeltRuntime-D4m0VOcD.mjs +116 -0
- package/dist/StderrViolationParser-D0afQ3-1.mjs +70 -0
- package/dist/ViolationLogStore-CZl35HcA.mjs +96 -0
- package/dist/bashExecute-BTkdqlSs-5foM20Lb.mjs +466 -0
- package/dist/commands/doctorCommand.mjs +101 -0
- package/dist/commands/headlessCommand.mjs +319 -0
- package/dist/commands/mcpCommand.mjs +218 -0
- package/dist/commands/updateCommand.mjs +40 -0
- package/dist/createFile-yQfh8uvk-I-yM5DxC.mjs +63 -0
- package/dist/deleteFile-DKHfnyny-G3b1Kj2T.mjs +66 -0
- package/dist/globFiles-D1en6joM-8jekiXdX.mjs +100 -0
- package/dist/grepSearch-aMamoBn_-DCJcY8JS.mjs +173 -0
- package/dist/index.mjs +6722 -0
- package/dist/pathValidation-Cgjh5WQO-DiCZTcq6.mjs +63 -0
- package/dist/store-Dw1nZX2Y.mjs +128 -0
- package/dist/store-nZExNOWX.mjs +3 -0
- package/dist/terminalSetup-rmr1P8KF.mjs +254 -0
- package/dist/tools-BDiw0M6l.mjs +20906 -0
- package/dist/treeSitterEngine-DCSXcm_3.mjs +309 -0
- package/dist/types-DBEjF9YS.mjs +59 -0
- package/dist/types-DK3P88Px.mjs +3 -0
- package/dist/updateChecker-BrOBnIkj.mjs +120 -0
- package/package.json +10 -10
- package/dist/BubblewrapRuntime-PMIOLWKR.js +0 -71
- package/dist/HydrationEngine-YL2HWJ3V.js +0 -9
- package/dist/ImageStore-MMUOUPI2.js +0 -224
- package/dist/ProxyManager-HEB4TLVX.js +0 -7
- package/dist/SandboxOrchestrator-UIJ5GYBB.js +0 -8
- package/dist/SandboxRuntimeAdapter-FQ56MAB2.js +0 -13
- package/dist/SeatbeltRuntime-EE3TTLEP.js +0 -98
- package/dist/StderrViolationParser-7OYPM2DJ.js +0 -59
- package/dist/ViolationLogStore-RIIUVURH.js +0 -104
- package/dist/artifactExtractor-TK2FFZ4C.js +0 -180
- package/dist/bashExecute-GLGLD3JD.js +0 -379
- package/dist/chunk-22G2T3X7.js +0 -1079
- package/dist/chunk-4BIBE3J7.js +0 -48
- package/dist/chunk-4QTLLPJJ.js +0 -12421
- package/dist/chunk-6RJWHTIX.js +0 -19111
- package/dist/chunk-76NSNH4E.js +0 -13618
- package/dist/chunk-BDQBOLYG.js +0 -120
- package/dist/chunk-BPFEGDC7.js +0 -192
- package/dist/chunk-F5WF4RWS.js +0 -161
- package/dist/chunk-G4ZGEQFT.js +0 -250
- package/dist/chunk-GQGOWACU.js +0 -770
- package/dist/chunk-JTBRGW2F.js +0 -95
- package/dist/chunk-KQAMBXAW.js +0 -163
- package/dist/chunk-LTLJRF6I.js +0 -44
- package/dist/chunk-PFBYGCOW.js +0 -449
- package/dist/chunk-QWB6ZYY4.js +0 -48
- package/dist/chunk-RFVINAUP.js +0 -241
- package/dist/chunk-UB2LL4RE.js +0 -245
- package/dist/chunk-Y4WOJJM3.js +0 -147
- package/dist/commands/doctorCommand.js +0 -87
- package/dist/commands/headlessCommand.js +0 -380
- package/dist/commands/mcpCommand.js +0 -203
- package/dist/commands/updateCommand.js +0 -42
- package/dist/create-NVG5T7TG.js +0 -12
- package/dist/createFile-6PSPLW6R.js +0 -71
- package/dist/deleteFile-AUSRLWIK.js +0 -73
- package/dist/formatConverter-5QEJDW24.js +0 -7
- package/dist/globFiles-TSRN64N2.js +0 -120
- package/dist/grepSearch-634XWZOJ.js +0 -216
- package/dist/index.js +0 -6779
- package/dist/llmMarkdownGenerator-EYODN3A7.js +0 -371
- package/dist/markdownGenerator-JGCTGPEX.js +0 -269
- package/dist/mementoService-OT4FL5SA.js +0 -12
- package/dist/notificationDeduplicator-HUC53NEW.js +0 -9
- package/dist/src-2AUTMBAJ.js +0 -319
- package/dist/src-Z43GIM7S.js +0 -1099
- package/dist/store-CAB6BV3P.js +0 -11
- package/dist/subtractCredits-JKD3JDC2.js +0 -12
- package/dist/terminalSetup-C5FHMLC3.js +0 -214
- package/dist/treeSitterEngine-4SGFQDY3.js +0 -330
- package/dist/types-KB5NP6T4.js +0 -7
- package/dist/utils-JCHWDM4Z.js +0 -31
package/bin/bike4mind-cli.mjs
CHANGED
|
@@ -144,7 +144,7 @@ if (argv['ollama-host']) {
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
// Auto-detect environment: prefer production mode when dist exists
|
|
147
|
-
const distPath = join(__dirname, '../dist/index.
|
|
147
|
+
const distPath = join(__dirname, '../dist/index.mjs');
|
|
148
148
|
const srcPath = join(__dirname, '../src/index.tsx');
|
|
149
149
|
const hasSource = existsSync(srcPath);
|
|
150
150
|
const hasDist = existsSync(distPath);
|
|
@@ -171,7 +171,7 @@ if (argv.prompt !== undefined) {
|
|
|
171
171
|
const module = await import('../src/commands/headlessCommand.ts');
|
|
172
172
|
handleHeadlessCommand = module.handleHeadlessCommand;
|
|
173
173
|
} else {
|
|
174
|
-
const module = await import('../dist/commands/headlessCommand.
|
|
174
|
+
const module = await import('../dist/commands/headlessCommand.mjs');
|
|
175
175
|
handleHeadlessCommand = module.handleHeadlessCommand;
|
|
176
176
|
}
|
|
177
177
|
|
|
@@ -206,7 +206,7 @@ if (argv._[0] === 'mcp') {
|
|
|
206
206
|
handleMcpCommand = module.handleMcpCommand;
|
|
207
207
|
} else {
|
|
208
208
|
// Production: import compiled JavaScript
|
|
209
|
-
const module = await import('../dist/commands/mcpCommand.
|
|
209
|
+
const module = await import('../dist/commands/mcpCommand.mjs');
|
|
210
210
|
handleMcpCommand = module.handleMcpCommand;
|
|
211
211
|
}
|
|
212
212
|
|
|
@@ -229,7 +229,7 @@ if (argv._[0] === 'update') {
|
|
|
229
229
|
const module = await import('../src/commands/updateCommand.ts');
|
|
230
230
|
handleUpdateCommand = module.handleUpdateCommand;
|
|
231
231
|
} else {
|
|
232
|
-
const module = await import('../dist/commands/updateCommand.
|
|
232
|
+
const module = await import('../dist/commands/updateCommand.mjs');
|
|
233
233
|
handleUpdateCommand = module.handleUpdateCommand;
|
|
234
234
|
}
|
|
235
235
|
|
|
@@ -252,7 +252,7 @@ if (argv._[0] === 'doctor') {
|
|
|
252
252
|
const module = await import('../src/commands/doctorCommand.ts');
|
|
253
253
|
handleDoctorCommand = module.handleDoctorCommand;
|
|
254
254
|
} else {
|
|
255
|
-
const module = await import('../dist/commands/doctorCommand.
|
|
255
|
+
const module = await import('../dist/commands/doctorCommand.mjs');
|
|
256
256
|
handleDoctorCommand = module.handleDoctorCommand;
|
|
257
257
|
}
|
|
258
258
|
|
|
@@ -282,7 +282,7 @@ if (isDev) {
|
|
|
282
282
|
} else {
|
|
283
283
|
// Production: run compiled JavaScript
|
|
284
284
|
try {
|
|
285
|
-
await import(join(__dirname, '../dist/index.
|
|
285
|
+
await import(join(__dirname, '../dist/index.mjs'));
|
|
286
286
|
} catch (error) {
|
|
287
287
|
console.error('Failed to start CLI:', error);
|
|
288
288
|
console.error('\nTry running: pnpm build');
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { i as isBinaryAvailable, r as expandPath } from "./SandboxRuntimeAdapter-C1B4t20N.mjs";
|
|
3
|
+
import os from "os";
|
|
4
|
+
//#region src/sandbox/runtime/BubblewrapRuntime.ts
|
|
5
|
+
/**
|
|
6
|
+
* Linux Bubblewrap (bwrap) runtime implementation.
|
|
7
|
+
*
|
|
8
|
+
* Uses bubblewrap to create a sandboxed environment with:
|
|
9
|
+
* - Read-only system paths (/usr, /lib, /bin, etc.)
|
|
10
|
+
* - Read-write access only to the working directory
|
|
11
|
+
* - Denied paths mounted as empty tmpfs
|
|
12
|
+
* - Process namespace isolation
|
|
13
|
+
*/
|
|
14
|
+
/** System paths to bind read-only into the sandbox */
|
|
15
|
+
const SYSTEM_RO_BINDS = [
|
|
16
|
+
"/usr",
|
|
17
|
+
"/bin",
|
|
18
|
+
"/lib",
|
|
19
|
+
"/lib64",
|
|
20
|
+
"/sbin",
|
|
21
|
+
"/etc"
|
|
22
|
+
];
|
|
23
|
+
/** Paths that need special handling (dev, proc, tmp) */
|
|
24
|
+
const SPECIAL_MOUNTS = {
|
|
25
|
+
dev: "/dev",
|
|
26
|
+
proc: "/proc",
|
|
27
|
+
tmp: "/tmp"
|
|
28
|
+
};
|
|
29
|
+
var BubblewrapRuntime = class {
|
|
30
|
+
constructor() {
|
|
31
|
+
this.platform = "linux";
|
|
32
|
+
this.name = "bubblewrap";
|
|
33
|
+
}
|
|
34
|
+
isAvailable() {
|
|
35
|
+
return isBinaryAvailable("bwrap");
|
|
36
|
+
}
|
|
37
|
+
wrapCommand(options) {
|
|
38
|
+
const { command, cwd, filesystemConfig, env } = options;
|
|
39
|
+
const expandedDenied = filesystemConfig.deniedPaths.map(expandPath);
|
|
40
|
+
const expandedAllowed = filesystemConfig.allowedReadPaths.map(expandPath);
|
|
41
|
+
const args = [];
|
|
42
|
+
for (const sysPath of SYSTEM_RO_BINDS) args.push("--ro-bind-try", sysPath, sysPath);
|
|
43
|
+
args.push("--dev", SPECIAL_MOUNTS.dev);
|
|
44
|
+
args.push("--proc", SPECIAL_MOUNTS.proc);
|
|
45
|
+
args.push("--tmpfs", SPECIAL_MOUNTS.tmp);
|
|
46
|
+
args.push("--bind", cwd, cwd);
|
|
47
|
+
const homeDir = os.homedir();
|
|
48
|
+
args.push("--ro-bind", homeDir, homeDir);
|
|
49
|
+
for (const allowedPath of expandedAllowed) if (!allowedPath.startsWith(homeDir)) args.push("--ro-bind-try", allowedPath, allowedPath);
|
|
50
|
+
for (const deniedPath of expandedDenied) args.push("--tmpfs", deniedPath);
|
|
51
|
+
args.push("--unshare-all");
|
|
52
|
+
args.push("--share-net");
|
|
53
|
+
args.push("--die-with-parent");
|
|
54
|
+
if (options.seccompProfile) args.push("--seccomp", options.seccompProfile);
|
|
55
|
+
for (const [key, value] of Object.entries(env ?? {})) args.push("--setenv", key, value);
|
|
56
|
+
args.push("--chdir", cwd);
|
|
57
|
+
args.push("bash", "-c", command);
|
|
58
|
+
const commandString = ["bwrap", ...args.map(shellEscape)].join(" ");
|
|
59
|
+
return {
|
|
60
|
+
executable: "bwrap",
|
|
61
|
+
args,
|
|
62
|
+
env: env ?? {},
|
|
63
|
+
commandString
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
function shellEscape(str) {
|
|
68
|
+
if (/^[a-zA-Z0-9._/=:-]+$/.test(str)) return str;
|
|
69
|
+
return `'${str.replace(/'/g, "'\\''")}'`;
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
export { BubblewrapRuntime };
|