@bike4mind/cli 0.2.64-worktree-refactor-extract-search-query-builders.21815 → 0.2.64

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.
Files changed (85) hide show
  1. package/bin/bike4mind-cli.mjs +6 -6
  2. package/dist/BubblewrapRuntime-BHbtqvLx.mjs +72 -0
  3. package/dist/ConfigStore-CllM6jOf.mjs +8614 -0
  4. package/dist/ImageStore-DaKT_Ew8.mjs +202 -0
  5. package/dist/ProxyManager-Dl2nFk-A.mjs +259 -0
  6. package/dist/ProxyManager-kiOD1X8-.mjs +3 -0
  7. package/dist/SandboxOrchestrator-BEW3rqYi.mjs +159 -0
  8. package/dist/SandboxOrchestrator-CHZgSR3P.mjs +3 -0
  9. package/dist/SandboxRuntimeAdapter-C1B4t20N.mjs +57 -0
  10. package/dist/SandboxRuntimeAdapter-D7UAG13n.mjs +3 -0
  11. package/dist/SeatbeltRuntime-D4m0VOcD.mjs +116 -0
  12. package/dist/StderrViolationParser-D0afQ3-1.mjs +70 -0
  13. package/dist/ViolationLogStore-CZl35HcA.mjs +96 -0
  14. package/dist/bashExecute-BTkdqlSs-5foM20Lb.mjs +466 -0
  15. package/dist/commands/doctorCommand.mjs +101 -0
  16. package/dist/commands/headlessCommand.mjs +319 -0
  17. package/dist/commands/mcpCommand.mjs +218 -0
  18. package/dist/commands/updateCommand.mjs +40 -0
  19. package/dist/createFile-yQfh8uvk-I-yM5DxC.mjs +63 -0
  20. package/dist/deleteFile-DKHfnyny-G3b1Kj2T.mjs +66 -0
  21. package/dist/globFiles-D1en6joM-8jekiXdX.mjs +100 -0
  22. package/dist/grepSearch-aMamoBn_-DCJcY8JS.mjs +173 -0
  23. package/dist/index.mjs +6722 -0
  24. package/dist/pathValidation-Cgjh5WQO-DiCZTcq6.mjs +63 -0
  25. package/dist/store-Dw1nZX2Y.mjs +128 -0
  26. package/dist/store-nZExNOWX.mjs +3 -0
  27. package/dist/terminalSetup-rmr1P8KF.mjs +254 -0
  28. package/dist/tools-C6M5aW8W.mjs +20907 -0
  29. package/dist/treeSitterEngine-DCSXcm_3.mjs +309 -0
  30. package/dist/types-DBEjF9YS.mjs +59 -0
  31. package/dist/types-DK3P88Px.mjs +3 -0
  32. package/dist/updateChecker-Cu9dkHxV.mjs +120 -0
  33. package/package.json +10 -10
  34. package/dist/BubblewrapRuntime-PMIOLWKR.js +0 -71
  35. package/dist/HydrationEngine-YL2HWJ3V.js +0 -9
  36. package/dist/ImageStore-MMUOUPI2.js +0 -224
  37. package/dist/ProxyManager-HEB4TLVX.js +0 -7
  38. package/dist/SandboxOrchestrator-UIJ5GYBB.js +0 -8
  39. package/dist/SandboxRuntimeAdapter-FQ56MAB2.js +0 -13
  40. package/dist/SeatbeltRuntime-EE3TTLEP.js +0 -98
  41. package/dist/StderrViolationParser-7OYPM2DJ.js +0 -59
  42. package/dist/ViolationLogStore-RIIUVURH.js +0 -104
  43. package/dist/artifactExtractor-R7DIP2XO.js +0 -180
  44. package/dist/bashExecute-GLGLD3JD.js +0 -379
  45. package/dist/chunk-4BIBE3J7.js +0 -48
  46. package/dist/chunk-5LZS5CVJ.js +0 -161
  47. package/dist/chunk-BDQBOLYG.js +0 -120
  48. package/dist/chunk-BPFEGDC7.js +0 -192
  49. package/dist/chunk-EPIYC3LA.js +0 -13770
  50. package/dist/chunk-G4ZGEQFT.js +0 -250
  51. package/dist/chunk-GQGOWACU.js +0 -770
  52. package/dist/chunk-J6ZBI6TI.js +0 -1079
  53. package/dist/chunk-JW3JRHH7.js +0 -12433
  54. package/dist/chunk-KQAMBXAW.js +0 -163
  55. package/dist/chunk-KUVV2NAB.js +0 -19125
  56. package/dist/chunk-LTLJRF6I.js +0 -44
  57. package/dist/chunk-PFBYGCOW.js +0 -449
  58. package/dist/chunk-QWB6ZYY4.js +0 -48
  59. package/dist/chunk-SGPRXN4C.js +0 -245
  60. package/dist/chunk-UZUHPHZC.js +0 -95
  61. package/dist/chunk-WBE7SQUB.js +0 -241
  62. package/dist/chunk-Y4WOJJM3.js +0 -147
  63. package/dist/commands/doctorCommand.js +0 -87
  64. package/dist/commands/headlessCommand.js +0 -380
  65. package/dist/commands/mcpCommand.js +0 -203
  66. package/dist/commands/updateCommand.js +0 -42
  67. package/dist/create-C4VEEEYR.js +0 -12
  68. package/dist/createFile-6PSPLW6R.js +0 -71
  69. package/dist/deleteFile-AUSRLWIK.js +0 -73
  70. package/dist/formatConverter-5QEJDW24.js +0 -7
  71. package/dist/globFiles-TSRN64N2.js +0 -120
  72. package/dist/grepSearch-634XWZOJ.js +0 -216
  73. package/dist/index.js +0 -6779
  74. package/dist/llmMarkdownGenerator-Z6NB26TT.js +0 -371
  75. package/dist/markdownGenerator-SK2ZQQL4.js +0 -269
  76. package/dist/mementoService-N4IM6QAC.js +0 -12
  77. package/dist/notificationDeduplicator-HUC53NEW.js +0 -9
  78. package/dist/src-F4KZCAA2.js +0 -319
  79. package/dist/src-ISX322I7.js +0 -1101
  80. package/dist/store-CAB6BV3P.js +0 -11
  81. package/dist/subtractCredits-D4KEM6VU.js +0 -12
  82. package/dist/terminalSetup-C5FHMLC3.js +0 -214
  83. package/dist/treeSitterEngine-4SGFQDY3.js +0 -330
  84. package/dist/types-KB5NP6T4.js +0 -7
  85. package/dist/utils-JCHWDM4Z.js +0 -31
@@ -1,163 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- DEFAULT_SANDBOX_CONFIG
4
- } from "./chunk-4BIBE3J7.js";
5
-
6
- // src/sandbox/SandboxOrchestrator.ts
7
- var SandboxOrchestrator = class {
8
- constructor(config, runtime, proxyManager) {
9
- this.stats = { sandboxed: 0, unsandboxed: 0, blocked: 0, violations: 0 };
10
- this.violationStore = null;
11
- this.config = config ?? DEFAULT_SANDBOX_CONFIG;
12
- this.runtime = runtime ?? null;
13
- this.proxyManager = proxyManager ?? null;
14
- }
15
- /**
16
- * Determine whether a command should be sandboxed.
17
- *
18
- * Decision logic:
19
- * 1. If sandbox is disabled → unsandboxed (no permission change)
20
- * 2. If command matches an excluded command → unsandboxed (requires permission)
21
- * 3. If runtime is not available → unsandboxed with warning
22
- * 4. Otherwise → sandbox the command
23
- */
24
- shouldSandbox(command, cwd) {
25
- if (!this.config.enabled || this.config.mode === "disabled") {
26
- return { type: "unsandboxed", requiresPermission: true };
27
- }
28
- const baseCommand = this.getBaseCommand(command);
29
- if (this.isExcludedCommand(baseCommand)) {
30
- if (!this.config.allowUnsandboxedCommands) {
31
- return {
32
- type: "blocked",
33
- reason: `Command '${baseCommand}' is excluded from sandboxing and unsandboxed commands are not allowed`
34
- };
35
- }
36
- return {
37
- type: "unsandboxed",
38
- requiresPermission: true,
39
- reason: `Command '${baseCommand}' is excluded from sandboxing`
40
- };
41
- }
42
- if (!this.runtime) {
43
- return {
44
- type: "unsandboxed",
45
- requiresPermission: true,
46
- reason: "Sandbox runtime not available on this platform"
47
- };
48
- }
49
- const proxyEnv = this.proxyManager?.getProxyEnv() ?? {};
50
- const wrappedCommand = this.runtime.wrapCommand({
51
- command,
52
- cwd,
53
- filesystemConfig: this.config.filesystem,
54
- env: proxyEnv,
55
- ...this.runtime.platform === "linux" && this.config.platform.linux.seccompProfile && {
56
- seccompProfile: this.config.platform.linux.seccompProfile
57
- }
58
- });
59
- return { type: "sandbox", wrappedCommand };
60
- }
61
- /** Get the current sandbox mode */
62
- getMode() {
63
- return this.config.mode;
64
- }
65
- /** Set the sandbox mode (does not persist — caller must save config) */
66
- setMode(mode) {
67
- this.config.mode = mode;
68
- this.config.enabled = mode !== "disabled";
69
- }
70
- /** Check if sandbox is enabled and runtime is available */
71
- isAvailable() {
72
- return this.runtime !== null && this.runtime.isAvailable();
73
- }
74
- /** Check if sandbox is currently active (enabled + available) */
75
- isActive() {
76
- return this.config.enabled && this.config.mode !== "disabled" && this.isAvailable();
77
- }
78
- /** Get the current sandbox configuration */
79
- getConfig() {
80
- return this.config;
81
- }
82
- /** Update config (does not persist — caller must save) */
83
- updateConfig(config) {
84
- this.config = config;
85
- }
86
- /** Get the ProxyManager instance (if any) */
87
- getProxyManager() {
88
- return this.proxyManager;
89
- }
90
- /** Start the network proxy (if configured) */
91
- async startProxy() {
92
- await this.proxyManager?.start();
93
- }
94
- /** Stop the network proxy */
95
- async stopProxy() {
96
- await this.proxyManager?.stop();
97
- }
98
- /** Get full status information for display */
99
- getStatus() {
100
- return {
101
- mode: this.config.mode,
102
- enabled: this.config.enabled,
103
- platform: this.runtime?.platform ?? null,
104
- runtimeAvailable: this.runtime?.isAvailable() ?? false,
105
- runtimeName: this.runtime?.name ?? null,
106
- proxyRunning: this.proxyManager?.isRunning() ?? false,
107
- proxyPort: this.proxyManager?.getPort() ?? null,
108
- config: this.config,
109
- stats: { ...this.stats }
110
- };
111
- }
112
- // --- Stats tracking ---
113
- recordSandboxed() {
114
- this.stats.sandboxed++;
115
- }
116
- recordUnsandboxed() {
117
- this.stats.unsandboxed++;
118
- }
119
- recordBlocked() {
120
- this.stats.blocked++;
121
- }
122
- recordViolations(count = 1) {
123
- this.stats.violations += count;
124
- }
125
- getStats() {
126
- return { ...this.stats };
127
- }
128
- resetStats() {
129
- this.stats = { sandboxed: 0, unsandboxed: 0, blocked: 0, violations: 0 };
130
- }
131
- // --- Violation store ---
132
- setViolationStore(store) {
133
- this.violationStore = store;
134
- }
135
- getViolationStore() {
136
- return this.violationStore;
137
- }
138
- /** Record a violation to store and increment stats */
139
- async recordViolation(violation) {
140
- this.stats.violations++;
141
- await this.violationStore?.record(violation).catch(() => {
142
- });
143
- }
144
- /**
145
- * Extract the base command name from a full command string.
146
- * e.g., "docker compose up -d" → "docker"
147
- */
148
- getBaseCommand(command) {
149
- const trimmed = command.trim();
150
- const withoutEnv = trimmed.replace(/^(\w+=\S+\s+)*/, "");
151
- const parts = withoutEnv.split(/\s+/);
152
- const first = parts[0] || "";
153
- return first.split("/").pop() || first;
154
- }
155
- /** Check if a command is in the excluded list */
156
- isExcludedCommand(baseCommand) {
157
- return this.config.excludedCommands.some((excluded) => baseCommand === excluded);
158
- }
159
- };
160
-
161
- export {
162
- SandboxOrchestrator
163
- };