@belboy47/brc-agent 0.0.0-stage → 2.0.18

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 (416) hide show
  1. package/LICENSE +30 -0
  2. package/LICENSE-desktop-commander +21 -0
  3. package/NOTICE +13 -0
  4. package/README.md +64 -2
  5. package/dist/cli.d.ts +2 -0
  6. package/dist/cli.js +487 -0
  7. package/dist/cli.js.map +1 -0
  8. package/dist/context.d.ts +31 -0
  9. package/dist/context.js +11 -0
  10. package/dist/context.js.map +1 -0
  11. package/dist/core/command-manager.d.ts +8 -0
  12. package/dist/core/command-manager.js +242 -0
  13. package/dist/core/command-manager.js.map +1 -0
  14. package/dist/core/config-field-definitions.d.ts +41 -0
  15. package/dist/core/config-field-definitions.js +38 -0
  16. package/dist/core/config-field-definitions.js.map +1 -0
  17. package/dist/core/config-manager.d.ts +102 -0
  18. package/dist/core/config-manager.js +451 -0
  19. package/dist/core/config-manager.js.map +1 -0
  20. package/dist/core/config.d.ts +6 -0
  21. package/dist/core/config.js +20 -0
  22. package/dist/core/config.js.map +1 -0
  23. package/dist/core/custom-stdio.d.ts +9 -0
  24. package/dist/core/custom-stdio.js +2 -0
  25. package/dist/core/custom-stdio.js.map +1 -0
  26. package/dist/core/error-handlers.d.ts +7 -0
  27. package/dist/core/error-handlers.js +16 -0
  28. package/dist/core/error-handlers.js.map +1 -0
  29. package/dist/core/file-transfer.d.ts +16 -0
  30. package/dist/core/file-transfer.js +316 -0
  31. package/dist/core/file-transfer.js.map +1 -0
  32. package/dist/core/handlers/edit-search-handlers.d.ts +6 -0
  33. package/dist/core/handlers/edit-search-handlers.js +7 -0
  34. package/dist/core/handlers/edit-search-handlers.js.map +1 -0
  35. package/dist/core/handlers/filesystem-handlers.d.ts +38 -0
  36. package/dist/core/handlers/filesystem-handlers.js +535 -0
  37. package/dist/core/handlers/filesystem-handlers.js.map +1 -0
  38. package/dist/core/handlers/history-handlers.d.ts +12 -0
  39. package/dist/core/handlers/history-handlers.js +68 -0
  40. package/dist/core/handlers/history-handlers.js.map +1 -0
  41. package/dist/core/handlers/index.d.ts +7 -0
  42. package/dist/core/handlers/index.js +9 -0
  43. package/dist/core/handlers/index.js.map +1 -0
  44. package/dist/core/handlers/process-handlers.d.ts +9 -0
  45. package/dist/core/handlers/process-handlers.js +16 -0
  46. package/dist/core/handlers/process-handlers.js.map +1 -0
  47. package/dist/core/handlers/search-handlers.d.ts +17 -0
  48. package/dist/core/handlers/search-handlers.js +336 -0
  49. package/dist/core/handlers/search-handlers.js.map +1 -0
  50. package/dist/core/handlers/terminal-handlers.d.ts +21 -0
  51. package/dist/core/handlers/terminal-handlers.js +36 -0
  52. package/dist/core/handlers/terminal-handlers.js.map +1 -0
  53. package/dist/core/handlers/transfer-handlers.d.ts +4 -0
  54. package/dist/core/handlers/transfer-handlers.js +76 -0
  55. package/dist/core/handlers/transfer-handlers.js.map +1 -0
  56. package/dist/core/search-manager.d.ts +162 -0
  57. package/dist/core/search-manager.js +929 -0
  58. package/dist/core/search-manager.js.map +1 -0
  59. package/dist/core/terminal-manager.d.ts +126 -0
  60. package/dist/core/terminal-manager.js +671 -0
  61. package/dist/core/terminal-manager.js.map +1 -0
  62. package/dist/core/tool-definitions.d.ts +9 -0
  63. package/dist/core/tool-definitions.js +1020 -0
  64. package/dist/core/tool-definitions.js.map +1 -0
  65. package/dist/core/tools/config.d.ts +98 -0
  66. package/dist/core/tools/config.js +279 -0
  67. package/dist/core/tools/config.js.map +1 -0
  68. package/dist/core/tools/edit.d.ts +49 -0
  69. package/dist/core/tools/edit.js +540 -0
  70. package/dist/core/tools/edit.js.map +1 -0
  71. package/dist/core/tools/feedback.d.ts +8 -0
  72. package/dist/core/tools/feedback.js +133 -0
  73. package/dist/core/tools/feedback.js.map +1 -0
  74. package/dist/core/tools/filesystem.d.ts +84 -0
  75. package/dist/core/tools/filesystem.js +991 -0
  76. package/dist/core/tools/filesystem.js.map +1 -0
  77. package/dist/core/tools/fuzzySearch.d.ts +14 -0
  78. package/dist/core/tools/fuzzySearch.js +141 -0
  79. package/dist/core/tools/fuzzySearch.js.map +1 -0
  80. package/dist/core/tools/fuzzySearchCore.d.ts +52 -0
  81. package/dist/core/tools/fuzzySearchCore.js +126 -0
  82. package/dist/core/tools/fuzzySearchCore.js.map +1 -0
  83. package/dist/core/tools/improved-process-tools.d.ts +24 -0
  84. package/dist/core/tools/improved-process-tools.js +645 -0
  85. package/dist/core/tools/improved-process-tools.js.map +1 -0
  86. package/dist/core/tools/mime-types.d.ts +3 -0
  87. package/dist/core/tools/mime-types.js +29 -0
  88. package/dist/core/tools/mime-types.js.map +1 -0
  89. package/dist/core/tools/pdf/extract-images.d.ts +34 -0
  90. package/dist/core/tools/pdf/extract-images.js +133 -0
  91. package/dist/core/tools/pdf/extract-images.js.map +1 -0
  92. package/dist/core/tools/pdf/index.d.ts +6 -0
  93. package/dist/core/tools/pdf/index.js +4 -0
  94. package/dist/core/tools/pdf/index.js.map +1 -0
  95. package/dist/core/tools/pdf/lib/pdf2md.d.ts +36 -0
  96. package/dist/core/tools/pdf/lib/pdf2md.js +77 -0
  97. package/dist/core/tools/pdf/lib/pdf2md.js.map +1 -0
  98. package/dist/core/tools/pdf/manipulations.d.ts +13 -0
  99. package/dist/core/tools/pdf/manipulations.js +100 -0
  100. package/dist/core/tools/pdf/manipulations.js.map +1 -0
  101. package/dist/core/tools/pdf/markdown.d.ts +26 -0
  102. package/dist/core/tools/pdf/markdown.js +276 -0
  103. package/dist/core/tools/pdf/markdown.js.map +1 -0
  104. package/dist/core/tools/pdf/utils.d.ts +12 -0
  105. package/dist/core/tools/pdf/utils.js +35 -0
  106. package/dist/core/tools/pdf/utils.js.map +1 -0
  107. package/dist/core/tools/process.d.ts +17 -0
  108. package/dist/core/tools/process.js +88 -0
  109. package/dist/core/tools/process.js.map +1 -0
  110. package/dist/core/tools/prompts.d.ts +28 -0
  111. package/dist/core/tools/prompts.js +260 -0
  112. package/dist/core/tools/prompts.js.map +1 -0
  113. package/dist/core/tools/schemas.d.ts +594 -0
  114. package/dist/core/tools/schemas.js +282 -0
  115. package/dist/core/tools/schemas.js.map +1 -0
  116. package/dist/core/tools/usage.d.ts +5 -0
  117. package/dist/core/tools/usage.js +25 -0
  118. package/dist/core/tools/usage.js.map +1 -0
  119. package/dist/core/types.d.ts +83 -0
  120. package/dist/core/types.js +2 -0
  121. package/dist/core/types.js.map +1 -0
  122. package/dist/core/ui/file-preview/shared/preview-file-types.d.ts +5 -0
  123. package/dist/core/ui/file-preview/shared/preview-file-types.js +60 -0
  124. package/dist/core/ui/file-preview/shared/preview-file-types.js.map +1 -0
  125. package/dist/core/utils/ab-test.d.ts +12 -0
  126. package/dist/core/utils/ab-test.js +105 -0
  127. package/dist/core/utils/ab-test.js.map +1 -0
  128. package/dist/core/utils/capture.d.ts +12 -0
  129. package/dist/core/utils/capture.js +38 -0
  130. package/dist/core/utils/capture.js.map +1 -0
  131. package/dist/core/utils/dockerPrompt.d.ts +17 -0
  132. package/dist/core/utils/dockerPrompt.js +54 -0
  133. package/dist/core/utils/dockerPrompt.js.map +1 -0
  134. package/dist/core/utils/feature-flags.d.ts +59 -0
  135. package/dist/core/utils/feature-flags.js +218 -0
  136. package/dist/core/utils/feature-flags.js.map +1 -0
  137. package/dist/core/utils/files/base.d.ts +173 -0
  138. package/dist/core/utils/files/base.js +6 -0
  139. package/dist/core/utils/files/base.js.map +1 -0
  140. package/dist/core/utils/files/binary.d.ts +21 -0
  141. package/dist/core/utils/files/binary.js +66 -0
  142. package/dist/core/utils/files/binary.js.map +1 -0
  143. package/dist/core/utils/files/docx.d.ts +47 -0
  144. package/dist/core/utils/files/docx.js +678 -0
  145. package/dist/core/utils/files/docx.js.map +1 -0
  146. package/dist/core/utils/files/excel.d.ts +24 -0
  147. package/dist/core/utils/files/excel.js +438 -0
  148. package/dist/core/utils/files/excel.js.map +1 -0
  149. package/dist/core/utils/files/factory.d.ts +29 -0
  150. package/dist/core/utils/files/factory.js +103 -0
  151. package/dist/core/utils/files/factory.js.map +1 -0
  152. package/dist/core/utils/files/image.d.ts +21 -0
  153. package/dist/core/utils/files/image.js +79 -0
  154. package/dist/core/utils/files/image.js.map +1 -0
  155. package/dist/core/utils/files/index.d.ts +9 -0
  156. package/dist/core/utils/files/index.js +15 -0
  157. package/dist/core/utils/files/index.js.map +1 -0
  158. package/dist/core/utils/files/pdf.d.ts +32 -0
  159. package/dist/core/utils/files/pdf.js +141 -0
  160. package/dist/core/utils/files/pdf.js.map +1 -0
  161. package/dist/core/utils/files/text.d.ts +70 -0
  162. package/dist/core/utils/files/text.js +552 -0
  163. package/dist/core/utils/files/text.js.map +1 -0
  164. package/dist/core/utils/fuzzySearchLogger.d.ts +26 -0
  165. package/dist/core/utils/fuzzySearchLogger.js +9 -0
  166. package/dist/core/utils/fuzzySearchLogger.js.map +1 -0
  167. package/dist/core/utils/lineEndingHandler.d.ts +21 -0
  168. package/dist/core/utils/lineEndingHandler.js +78 -0
  169. package/dist/core/utils/lineEndingHandler.js.map +1 -0
  170. package/dist/core/utils/logger.d.ts +17 -0
  171. package/dist/core/utils/logger.js +5 -0
  172. package/dist/core/utils/logger.js.map +1 -0
  173. package/dist/core/utils/mcp-ui-ab-test.d.ts +13 -0
  174. package/dist/core/utils/mcp-ui-ab-test.js +63 -0
  175. package/dist/core/utils/mcp-ui-ab-test.js.map +1 -0
  176. package/dist/core/utils/open-browser.d.ts +9 -0
  177. package/dist/core/utils/open-browser.js +47 -0
  178. package/dist/core/utils/open-browser.js.map +1 -0
  179. package/dist/core/utils/process-detection.d.ts +23 -0
  180. package/dist/core/utils/process-detection.js +151 -0
  181. package/dist/core/utils/process-detection.js.map +1 -0
  182. package/dist/core/utils/ripgrep-resolver.d.ts +9 -0
  183. package/dist/core/utils/ripgrep-resolver.js +96 -0
  184. package/dist/core/utils/ripgrep-resolver.js.map +1 -0
  185. package/dist/core/utils/system-info.d.ts +72 -0
  186. package/dist/core/utils/system-info.js +723 -0
  187. package/dist/core/utils/system-info.js.map +1 -0
  188. package/dist/core/utils/toolHistory.d.ts +31 -0
  189. package/dist/core/utils/toolHistory.js +17 -0
  190. package/dist/core/utils/toolHistory.js.map +1 -0
  191. package/dist/core/utils/trackTools.d.ts +1 -0
  192. package/dist/core/utils/trackTools.js +3 -0
  193. package/dist/core/utils/trackTools.js.map +1 -0
  194. package/dist/core/utils/unsupportedParams.d.ts +24 -0
  195. package/dist/core/utils/unsupportedParams.js +67 -0
  196. package/dist/core/utils/unsupportedParams.js.map +1 -0
  197. package/dist/core/utils/usageTracker.d.ts +125 -0
  198. package/dist/core/utils/usageTracker.js +475 -0
  199. package/dist/core/utils/usageTracker.js.map +1 -0
  200. package/dist/core/utils/welcome-onboarding.d.ts +11 -0
  201. package/dist/core/utils/welcome-onboarding.js +100 -0
  202. package/dist/core/utils/welcome-onboarding.js.map +1 -0
  203. package/dist/core/utils/withTimeout.d.ts +28 -0
  204. package/dist/core/utils/withTimeout.js +86 -0
  205. package/dist/core/utils/withTimeout.js.map +1 -0
  206. package/dist/core/version.d.ts +1 -0
  207. package/dist/core/version.js +2 -0
  208. package/dist/core/version.js.map +1 -0
  209. package/dist/dispatcher.d.ts +7 -0
  210. package/dist/dispatcher.js +179 -0
  211. package/dist/dispatcher.js.map +1 -0
  212. package/dist/index.d.ts +6 -0
  213. package/dist/index.js +7 -0
  214. package/dist/index.js.map +1 -0
  215. package/dist/plugins/cli-commands.d.ts +5 -0
  216. package/dist/plugins/cli-commands.js +240 -0
  217. package/dist/plugins/cli-commands.js.map +1 -0
  218. package/dist/plugins/defaults.d.ts +62 -0
  219. package/dist/plugins/defaults.js +260 -0
  220. package/dist/plugins/defaults.js.map +1 -0
  221. package/dist/plugins/first-run.d.ts +16 -0
  222. package/dist/plugins/first-run.js +89 -0
  223. package/dist/plugins/first-run.js.map +1 -0
  224. package/dist/plugins/host.d.ts +20 -0
  225. package/dist/plugins/host.js +175 -0
  226. package/dist/plugins/host.js.map +1 -0
  227. package/dist/plugins/installer.d.ts +21 -0
  228. package/dist/plugins/installer.js +350 -0
  229. package/dist/plugins/installer.js.map +1 -0
  230. package/dist/plugins/locate.d.ts +15 -0
  231. package/dist/plugins/locate.js +99 -0
  232. package/dist/plugins/locate.js.map +1 -0
  233. package/dist/plugins/manager.d.ts +32 -0
  234. package/dist/plugins/manager.js +139 -0
  235. package/dist/plugins/manager.js.map +1 -0
  236. package/dist/plugins/paths.d.ts +32 -0
  237. package/dist/plugins/paths.js +49 -0
  238. package/dist/plugins/paths.js.map +1 -0
  239. package/dist/plugins/python.d.ts +55 -0
  240. package/dist/plugins/python.js +234 -0
  241. package/dist/plugins/python.js.map +1 -0
  242. package/dist/plugins/store.d.ts +12 -0
  243. package/dist/plugins/store.js +76 -0
  244. package/dist/plugins/store.js.map +1 -0
  245. package/dist/plugins/types.d.ts +112 -0
  246. package/dist/plugins/types.js +9 -0
  247. package/dist/plugins/types.js.map +1 -0
  248. package/dist/plugins/util.d.ts +37 -0
  249. package/dist/plugins/util.js +283 -0
  250. package/dist/plugins/util.js.map +1 -0
  251. package/dist/runtime/activity.d.ts +49 -0
  252. package/dist/runtime/activity.js +158 -0
  253. package/dist/runtime/activity.js.map +1 -0
  254. package/dist/runtime/browser-workflow.d.ts +21 -0
  255. package/dist/runtime/browser-workflow.js +51 -0
  256. package/dist/runtime/browser-workflow.js.map +1 -0
  257. package/dist/runtime/code-graph.d.ts +156 -0
  258. package/dist/runtime/code-graph.js +330 -0
  259. package/dist/runtime/code-graph.js.map +1 -0
  260. package/dist/runtime/code-structure.d.ts +53 -0
  261. package/dist/runtime/code-structure.js +152 -0
  262. package/dist/runtime/code-structure.js.map +1 -0
  263. package/dist/runtime/coding-session.d.ts +97 -0
  264. package/dist/runtime/coding-session.js +142 -0
  265. package/dist/runtime/coding-session.js.map +1 -0
  266. package/dist/runtime/detach.d.ts +114 -0
  267. package/dist/runtime/detach.js +505 -0
  268. package/dist/runtime/detach.js.map +1 -0
  269. package/dist/runtime/docker-client.d.ts +47 -0
  270. package/dist/runtime/docker-client.js +40 -0
  271. package/dist/runtime/docker-client.js.map +1 -0
  272. package/dist/runtime/errors.d.ts +9 -0
  273. package/dist/runtime/errors.js +56 -0
  274. package/dist/runtime/errors.js.map +1 -0
  275. package/dist/runtime/failure-log.d.ts +22 -0
  276. package/dist/runtime/failure-log.js +112 -0
  277. package/dist/runtime/failure-log.js.map +1 -0
  278. package/dist/runtime/fast-batch.d.ts +55 -0
  279. package/dist/runtime/fast-batch.js +104 -0
  280. package/dist/runtime/fast-batch.js.map +1 -0
  281. package/dist/runtime/file-safety.d.ts +7 -0
  282. package/dist/runtime/file-safety.js +134 -0
  283. package/dist/runtime/file-safety.js.map +1 -0
  284. package/dist/runtime/generic-code.d.ts +9 -0
  285. package/dist/runtime/generic-code.js +123 -0
  286. package/dist/runtime/generic-code.js.map +1 -0
  287. package/dist/runtime/graph-outline.d.ts +54 -0
  288. package/dist/runtime/graph-outline.js +118 -0
  289. package/dist/runtime/graph-outline.js.map +1 -0
  290. package/dist/runtime/harness.d.ts +61 -0
  291. package/dist/runtime/harness.js +102 -0
  292. package/dist/runtime/harness.js.map +1 -0
  293. package/dist/runtime/instruction-context.d.ts +23 -0
  294. package/dist/runtime/instruction-context.js +136 -0
  295. package/dist/runtime/instruction-context.js.map +1 -0
  296. package/dist/runtime/lab-mode.d.ts +32 -0
  297. package/dist/runtime/lab-mode.js +138 -0
  298. package/dist/runtime/lab-mode.js.map +1 -0
  299. package/dist/runtime/languages.d.ts +30 -0
  300. package/dist/runtime/languages.js +59 -0
  301. package/dist/runtime/languages.js.map +1 -0
  302. package/dist/runtime/nav-cache.d.ts +2 -0
  303. package/dist/runtime/nav-cache.js +12 -0
  304. package/dist/runtime/nav-cache.js.map +1 -0
  305. package/dist/runtime/operations.d.ts +40 -0
  306. package/dist/runtime/operations.js +86 -0
  307. package/dist/runtime/operations.js.map +1 -0
  308. package/dist/runtime/platform-capabilities.d.ts +20 -0
  309. package/dist/runtime/platform-capabilities.js +36 -0
  310. package/dist/runtime/platform-capabilities.js.map +1 -0
  311. package/dist/runtime/program-runner.d.ts +4 -0
  312. package/dist/runtime/program-runner.js +73 -0
  313. package/dist/runtime/program-runner.js.map +1 -0
  314. package/dist/runtime/project-context.d.ts +53 -0
  315. package/dist/runtime/project-context.js +90 -0
  316. package/dist/runtime/project-context.js.map +1 -0
  317. package/dist/runtime/project-files.d.ts +2 -0
  318. package/dist/runtime/project-files.js +3 -0
  319. package/dist/runtime/project-files.js.map +1 -0
  320. package/dist/runtime/project-index.d.ts +40 -0
  321. package/dist/runtime/project-index.js +158 -0
  322. package/dist/runtime/project-index.js.map +1 -0
  323. package/dist/runtime/resource-limits.d.ts +42 -0
  324. package/dist/runtime/resource-limits.js +50 -0
  325. package/dist/runtime/resource-limits.js.map +1 -0
  326. package/dist/runtime/scratch-budget.d.ts +11 -0
  327. package/dist/runtime/scratch-budget.js +107 -0
  328. package/dist/runtime/scratch-budget.js.map +1 -0
  329. package/dist/runtime/search-diagnostics.d.ts +3 -0
  330. package/dist/runtime/search-diagnostics.js +45 -0
  331. package/dist/runtime/search-diagnostics.js.map +1 -0
  332. package/dist/runtime/toolchains.d.ts +25 -0
  333. package/dist/runtime/toolchains.js +70 -0
  334. package/dist/runtime/toolchains.js.map +1 -0
  335. package/dist/runtime/worker-coordination.d.ts +314 -0
  336. package/dist/runtime/worker-coordination.js +564 -0
  337. package/dist/runtime/worker-coordination.js.map +1 -0
  338. package/dist/runtime/workspace.d.ts +151 -0
  339. package/dist/runtime/workspace.js +267 -0
  340. package/dist/runtime/workspace.js.map +1 -0
  341. package/dist/service.d.ts +3 -0
  342. package/dist/service.js +102 -0
  343. package/dist/service.js.map +1 -0
  344. package/dist/terminal-setup.d.ts +33 -0
  345. package/dist/terminal-setup.js +219 -0
  346. package/dist/terminal-setup.js.map +1 -0
  347. package/dist/terminal-shortcuts.d.ts +22 -0
  348. package/dist/terminal-shortcuts.js +145 -0
  349. package/dist/terminal-shortcuts.js.map +1 -0
  350. package/dist/terminal-ui.d.ts +20 -0
  351. package/dist/terminal-ui.js +53 -0
  352. package/dist/terminal-ui.js.map +1 -0
  353. package/dist/tools/ast-grep.d.ts +132 -0
  354. package/dist/tools/ast-grep.js +625 -0
  355. package/dist/tools/ast-grep.js.map +1 -0
  356. package/dist/tools/brc-tools.d.ts +112 -0
  357. package/dist/tools/brc-tools.js +599 -0
  358. package/dist/tools/brc-tools.js.map +1 -0
  359. package/dist/tools/check-tools.d.ts +4 -0
  360. package/dist/tools/check-tools.js +29 -0
  361. package/dist/tools/check-tools.js.map +1 -0
  362. package/dist/tools/coding-tools.d.ts +33 -0
  363. package/dist/tools/coding-tools.js +190 -0
  364. package/dist/tools/coding-tools.js.map +1 -0
  365. package/dist/tools/command-shell.d.ts +17 -0
  366. package/dist/tools/command-shell.js +84 -0
  367. package/dist/tools/command-shell.js.map +1 -0
  368. package/dist/tools/dev-extras.d.ts +42 -0
  369. package/dist/tools/dev-extras.js +135 -0
  370. package/dist/tools/dev-extras.js.map +1 -0
  371. package/dist/tools/edit-tools.d.ts +4 -0
  372. package/dist/tools/edit-tools.js +293 -0
  373. package/dist/tools/edit-tools.js.map +1 -0
  374. package/dist/tools/fast-exec.d.ts +11 -0
  375. package/dist/tools/fast-exec.js +202 -0
  376. package/dist/tools/fast-exec.js.map +1 -0
  377. package/dist/tools/image-tools.d.ts +37 -0
  378. package/dist/tools/image-tools.js +293 -0
  379. package/dist/tools/image-tools.js.map +1 -0
  380. package/dist/tools/jobs.d.ts +227 -0
  381. package/dist/tools/jobs.js +608 -0
  382. package/dist/tools/jobs.js.map +1 -0
  383. package/dist/tools/ops-tools.d.ts +8 -0
  384. package/dist/tools/ops-tools.js +58 -0
  385. package/dist/tools/ops-tools.js.map +1 -0
  386. package/dist/tools/plugin-tools.d.ts +38 -0
  387. package/dist/tools/plugin-tools.js +133 -0
  388. package/dist/tools/plugin-tools.js.map +1 -0
  389. package/dist/tools/rtk.d.ts +60 -0
  390. package/dist/tools/rtk.js +245 -0
  391. package/dist/tools/rtk.js.map +1 -0
  392. package/dist/tools/sandbox-tools.d.ts +41 -0
  393. package/dist/tools/sandbox-tools.js +146 -0
  394. package/dist/tools/sandbox-tools.js.map +1 -0
  395. package/dist/tools/worker-tools.d.ts +231 -0
  396. package/dist/tools/worker-tools.js +55 -0
  397. package/dist/tools/worker-tools.js.map +1 -0
  398. package/dist/tools/workspace-batch.d.ts +262 -0
  399. package/dist/tools/workspace-batch.js +188 -0
  400. package/dist/tools/workspace-batch.js.map +1 -0
  401. package/dist/transport/pairing.d.ts +22 -0
  402. package/dist/transport/pairing.js +154 -0
  403. package/dist/transport/pairing.js.map +1 -0
  404. package/dist/transport/plugin-admin.d.ts +33 -0
  405. package/dist/transport/plugin-admin.js +156 -0
  406. package/dist/transport/plugin-admin.js.map +1 -0
  407. package/dist/transport/relay-url.d.ts +3 -0
  408. package/dist/transport/relay-url.js +38 -0
  409. package/dist/transport/relay-url.js.map +1 -0
  410. package/dist/transport/result-budget.d.ts +11 -0
  411. package/dist/transport/result-budget.js +45 -0
  412. package/dist/transport/result-budget.js.map +1 -0
  413. package/dist/transport/ws-client.d.ts +64 -0
  414. package/dist/transport/ws-client.js +242 -0
  415. package/dist/transport/ws-client.js.map +1 -0
  416. package/package.json +89 -3
@@ -0,0 +1,451 @@
1
+ import fs from 'fs/promises';
2
+ import path from 'path';
3
+ import { existsSync, watch } from 'fs';
4
+ import { mkdir } from 'fs/promises';
5
+ import os from 'os';
6
+ import lockfile from 'proper-lockfile';
7
+ import { VERSION } from './version.js';
8
+ import { CONFIG_FILE } from './config.js';
9
+ import { labSessionConfig } from '../runtime/lab-mode.js';
10
+ export function normalizeTelemetryEnabledValue(value) {
11
+ if (typeof value !== 'string') {
12
+ return value;
13
+ }
14
+ const normalized = value.trim().toLowerCase();
15
+ if (normalized === 'true') {
16
+ return true;
17
+ }
18
+ if (normalized === 'false') {
19
+ return false;
20
+ }
21
+ return value;
22
+ }
23
+ export function isTelemetryDisabledValue(value) {
24
+ return normalizeTelemetryEnabledValue(value) === false;
25
+ }
26
+ /**
27
+ * Singleton config manager for the server
28
+ */
29
+ class ConfigManager {
30
+ configPath;
31
+ config = {};
32
+ initialized = false;
33
+ // Runtime-only policy. Never save this overlay to config.json.
34
+ labSession = false;
35
+ _isFirstRun = false; // Track if this is the first run (config was just created)
36
+ // Serializes all disk writes so concurrent saves can't corrupt config.json.
37
+ writeChain = Promise.resolve();
38
+ // True while a coalesced background write is already queued (see scheduleSave).
39
+ saveScheduled = false;
40
+ pendingMutations = [];
41
+ watcher = null;
42
+ reloadTimer = null;
43
+ constructor() {
44
+ // Get user's home directory
45
+ // Define config directory and file paths
46
+ this.configPath = CONFIG_FILE;
47
+ }
48
+ /**
49
+ * Initialize configuration - load from disk or create default.
50
+ * Creation and legacy migration use the same cross-process mutation path as
51
+ * normal writes so two processes starting together cannot clobber each other.
52
+ */
53
+ async init() {
54
+ if (this.initialized)
55
+ return;
56
+ try {
57
+ const configDir = path.dirname(this.configPath);
58
+ if (!existsSync(configDir)) {
59
+ await mkdir(configDir, { recursive: true });
60
+ }
61
+ try {
62
+ this.config = await this.readConfigFromDisk();
63
+ this._isFirstRun = false;
64
+ if (this.config['welcomeOnboardingEligible'] === undefined) {
65
+ await this.performConfigMutation((latest) => {
66
+ if (latest['welcomeOnboardingEligible'] === undefined) {
67
+ latest['welcomeOnboardingEligible'] = false;
68
+ latest['pendingWelcomeOnboarding'] = false;
69
+ }
70
+ });
71
+ }
72
+ }
73
+ catch (error) {
74
+ if (error?.code !== 'ENOENT')
75
+ throw error;
76
+ let created = false;
77
+ await this.performConfigMutation((latest, existed) => {
78
+ if (!existed) {
79
+ Object.assign(latest, this.getDefaultConfig());
80
+ created = true;
81
+ }
82
+ });
83
+ this._isFirstRun = created;
84
+ }
85
+ this.config['version'] = VERSION;
86
+ this.initialized = true;
87
+ this.startConfigWatcher();
88
+ }
89
+ catch (error) {
90
+ console.error('Failed to initialize config:', error);
91
+ this.config = this.getDefaultConfig();
92
+ this.initialized = true;
93
+ this.startConfigWatcher();
94
+ }
95
+ }
96
+ /**
97
+ * Alias for init() to maintain backward compatibility
98
+ */
99
+ async loadConfig() {
100
+ return this.init();
101
+ }
102
+ /**
103
+ * Create default configuration
104
+ */
105
+ getDefaultConfig() {
106
+ return {
107
+ blockedCommands: [
108
+ // Disk and partition management
109
+ "mkfs", // Create a filesystem on a device
110
+ "format", // Format a storage device (cross-platform)
111
+ "mount", // Mount a filesystem
112
+ "umount", // Unmount a filesystem
113
+ "fdisk", // Manipulate disk partition tables
114
+ "dd", // Convert and copy files, can write directly to disks
115
+ "parted", // Disk partition manipulator
116
+ "diskpart", // Windows disk partitioning utility
117
+ // System administration and user management
118
+ "sudo", // Execute command as superuser
119
+ "su", // Substitute user identity
120
+ "passwd", // Change user password
121
+ "adduser", // Add a user to the system
122
+ "useradd", // Create a new user
123
+ "usermod", // Modify user account
124
+ "groupadd", // Create a new group
125
+ "chsh", // Change login shell
126
+ "visudo", // Edit the sudoers file
127
+ // System control
128
+ "shutdown", // Shutdown the system
129
+ "reboot", // Restart the system
130
+ "halt", // Stop the system
131
+ "poweroff", // Power off the system
132
+ "init", // Change system runlevel
133
+ // Network and security
134
+ "iptables", // Linux firewall administration
135
+ "firewall", // Generic firewall command
136
+ "netsh", // Windows network configuration
137
+ // Windows system commands
138
+ "sfc", // System File Checker
139
+ "bcdedit", // Boot Configuration Data editor
140
+ "reg", // Windows registry editor
141
+ "net", // Network/user/service management
142
+ "sc", // Service Control manager
143
+ "runas", // Execute command as another user
144
+ "cipher", // Encrypt/decrypt files or wipe data
145
+ "takeown" // Take ownership of files
146
+ ],
147
+ defaultShell: (() => {
148
+ if (os.platform() === 'win32') {
149
+ return 'powershell.exe';
150
+ }
151
+ // Use user's actual shell from environment
152
+ // On macOS, default to zsh (default since Catalina) since process.env.SHELL
153
+ // may not be set when running inside Claude Desktop
154
+ const fallbackShell = os.platform() === 'darwin' ? '/bin/zsh' : '/bin/sh';
155
+ const userShell = process.env.SHELL || fallbackShell;
156
+ // Return just the shell path - we'll handle login shell flag elsewhere
157
+ return userShell;
158
+ })(),
159
+ allowedDirectories: [],
160
+ telemetryEnabled: false, // Better Remote Commander (BRC): off by default
161
+ fileWriteLineLimit: 50, // Default line limit for file write operations (changed from 100)
162
+ fileReadLineLimit: 1000, // Default line limit for file read operations (changed from character-based)
163
+ pendingWelcomeOnboarding: true, // New install flag - triggers A/B test for welcome page
164
+ welcomeOnboardingEligible: true // Distinguishes new installs from migrated legacy configs
165
+ };
166
+ }
167
+ async readConfigFromDisk() {
168
+ let lastError;
169
+ for (let attempt = 0; attempt < 5; attempt++) {
170
+ try {
171
+ return JSON.parse(await fs.readFile(this.configPath, 'utf8'));
172
+ }
173
+ catch (error) {
174
+ lastError = error;
175
+ if (error?.code === 'ENOENT')
176
+ throw error;
177
+ if (!(error instanceof SyntaxError) || attempt === 4)
178
+ throw error;
179
+ await new Promise((resolve) => setTimeout(resolve, 10));
180
+ }
181
+ }
182
+ throw lastError;
183
+ }
184
+ async writeConfigAtomically(config) {
185
+ const tempPath = `${this.configPath}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2)}.tmp`;
186
+ try {
187
+ await fs.writeFile(tempPath, JSON.stringify(config, null, 2), 'utf8');
188
+ await fs.rename(tempPath, this.configPath);
189
+ }
190
+ finally {
191
+ await fs.unlink(tempPath).catch(() => { });
192
+ }
193
+ }
194
+ async acquireConfigLock() {
195
+ return lockfile.lock(this.configPath, {
196
+ realpath: false,
197
+ stale: 30_000,
198
+ update: 10_000,
199
+ retries: { retries: 100, factor: 1.2, minTimeout: 10, maxTimeout: 100 }
200
+ });
201
+ }
202
+ async performConfigMutation(mutate) {
203
+ const release = await this.acquireConfigLock();
204
+ try {
205
+ let latest;
206
+ let existed = true;
207
+ try {
208
+ latest = await this.readConfigFromDisk();
209
+ }
210
+ catch (error) {
211
+ if (error?.code !== 'ENOENT')
212
+ throw error;
213
+ latest = {};
214
+ existed = false;
215
+ }
216
+ mutate(latest, existed);
217
+ await this.writeConfigAtomically(latest);
218
+ this.config = { ...latest, version: VERSION };
219
+ return latest;
220
+ }
221
+ finally {
222
+ try {
223
+ await release();
224
+ }
225
+ catch (error) {
226
+ // The atomic rename is the commit boundary. A release failure after it
227
+ // must not make callers replay a mutation that already persisted.
228
+ console.error('Failed to release config lock:', error);
229
+ }
230
+ }
231
+ }
232
+ queueMutation(mutate) {
233
+ this.pendingMutations.push(mutate);
234
+ // BRC: debounce high-frequency background writes (usage stats are bumped on
235
+ // every tool call). Batching them avoids a lock+read+write+rename per call.
236
+ if (this.debounceTimer)
237
+ return;
238
+ this.debounceTimer = setTimeout(() => {
239
+ this.debounceTimer = null;
240
+ this.scheduleSave();
241
+ }, ConfigManager.BACKGROUND_SAVE_DELAY_MS);
242
+ this.debounceTimer.unref?.();
243
+ }
244
+ static BACKGROUND_SAVE_DELAY_MS = 5_000;
245
+ debounceTimer = null;
246
+ /** Persist any debounced background mutations now (call before exit). */
247
+ async flush() {
248
+ if (this.debounceTimer) {
249
+ clearTimeout(this.debounceTimer);
250
+ this.debounceTimer = null;
251
+ }
252
+ if (this.pendingMutations.length)
253
+ this.scheduleSave();
254
+ await this.writeChain;
255
+ }
256
+ /** Release filesystem watching and persist queued state on orderly shutdown. */
257
+ async close() {
258
+ this.watcher?.close();
259
+ this.watcher = null;
260
+ if (this.reloadTimer) {
261
+ clearTimeout(this.reloadTimer);
262
+ this.reloadTimer = null;
263
+ }
264
+ await this.flush();
265
+ }
266
+ /** Non-blocking, coalesced persistence for high-frequency state updates. */
267
+ scheduleSave() {
268
+ if (this.saveScheduled)
269
+ return;
270
+ this.saveScheduled = true;
271
+ const write = this.writeChain.then(async () => {
272
+ this.saveScheduled = false;
273
+ const mutations = this.pendingMutations.splice(0);
274
+ if (mutations.length === 0)
275
+ return;
276
+ try {
277
+ await this.performConfigMutation((latest) => {
278
+ for (const mutate of mutations)
279
+ mutate(latest);
280
+ });
281
+ }
282
+ catch (error) {
283
+ // Persistence failed before commit, so keep these mutations for a later retry.
284
+ this.pendingMutations.unshift(...mutations);
285
+ console.error('Failed to save config (background), will retry:', error);
286
+ const retry = setTimeout(() => this.scheduleSave(), 250);
287
+ retry.unref?.();
288
+ }
289
+ });
290
+ this.writeChain = write.catch(() => { });
291
+ }
292
+ startConfigWatcher() {
293
+ if (this.watcher)
294
+ return;
295
+ try {
296
+ const dir = path.dirname(this.configPath);
297
+ const filename = path.basename(this.configPath);
298
+ this.watcher = watch(dir, { persistent: false }, (_event, changed) => {
299
+ // Win32 can repeatedly emit rename events after a watched directory is deleted,
300
+ // causing a busy event loop. Never keep watching a removed state dir.
301
+ if (!existsSync(dir)) {
302
+ this.watcher?.close();
303
+ this.watcher = null;
304
+ if (this.reloadTimer) {
305
+ clearTimeout(this.reloadTimer);
306
+ this.reloadTimer = null;
307
+ }
308
+ return;
309
+ }
310
+ if (changed && changed.toString() !== filename)
311
+ return;
312
+ if (this.reloadTimer)
313
+ clearTimeout(this.reloadTimer);
314
+ this.reloadTimer = setTimeout(() => void this.reloadConfigFromDisk(), 20);
315
+ });
316
+ this.watcher.on('error', (error) => {
317
+ this.watcher?.close();
318
+ this.watcher = null;
319
+ console.error('Config watcher error:', error);
320
+ });
321
+ }
322
+ catch (error) {
323
+ console.error('Failed to watch config:', error);
324
+ }
325
+ }
326
+ async reloadConfigFromDisk() {
327
+ try {
328
+ const latest = await this.readConfigFromDisk();
329
+ for (const mutate of this.pendingMutations)
330
+ mutate(latest);
331
+ latest['version'] = VERSION;
332
+ this.config = latest;
333
+ }
334
+ catch (error) {
335
+ if (error?.code !== 'ENOENT')
336
+ console.error('Failed to reload config:', error);
337
+ }
338
+ }
339
+ /**
340
+ * Get the entire config
341
+ */
342
+ async getConfig() {
343
+ await this.init();
344
+ return labSessionConfig(this.config, this.labSession);
345
+ }
346
+ /** Called by the local CLI before connecting; not exposed as a tool. */
347
+ enableLabSession() {
348
+ if (process.platform !== 'linux' || process.getuid?.() !== 0)
349
+ throw new Error('Lab session requires Linux root.');
350
+ this.labSession = true;
351
+ }
352
+ getExecutionMode() {
353
+ return this.labSession ? 'lab' : 'standard';
354
+ }
355
+ /**
356
+ * Get a specific configuration value
357
+ */
358
+ async getValue(key) {
359
+ await this.init();
360
+ return labSessionConfig(this.config, this.labSession)[key];
361
+ }
362
+ /** Set a specific configuration value and wait for durable persistence. */
363
+ async setValue(key, value) {
364
+ await this.init();
365
+ if (key === 'telemetryEnabled')
366
+ value = normalizeTelemetryEnabledValue(value);
367
+ if (key === 'telemetryEnabled' && isTelemetryDisabledValue(value)) {
368
+ const currentValue = this.config[key];
369
+ if (!isTelemetryDisabledValue(currentValue)) {
370
+ const { capture } = await import('./utils/capture.js');
371
+ await capture('server_telemetry_opt_out', { reason: 'user_disabled', prev_value: currentValue });
372
+ }
373
+ }
374
+ const nextValue = value;
375
+ const write = this.writeChain.then(() => this.performConfigMutation((latest) => {
376
+ latest[key] = nextValue;
377
+ }));
378
+ this.writeChain = write.then(() => { }, () => { });
379
+ await write;
380
+ }
381
+ /** Update one value under the cross-process lock and return the durable value. */
382
+ async updateValue(key, updater) {
383
+ await this.init();
384
+ let updatedValue;
385
+ const write = this.writeChain.then(() => this.performConfigMutation((latest) => {
386
+ updatedValue = updater(latest[key]);
387
+ latest[key] = updatedValue;
388
+ }));
389
+ this.writeChain = write.then(() => { }, () => { });
390
+ await write;
391
+ return updatedValue;
392
+ }
393
+ /**
394
+ * Set a value without waiting on disk. The queued operation is applied to the
395
+ * latest on-disk config while holding the cross-process lock.
396
+ */
397
+ async setValueNonBlocking(key, value) {
398
+ await this.init();
399
+ this.config[key] = value;
400
+ this.queueMutation((latest) => { latest[key] = value; });
401
+ }
402
+ /**
403
+ * Atomically update one value without blocking the caller on persistence.
404
+ * The updater is replayed against the latest disk value under the lock, which
405
+ * makes counter-style updates safe across multiple Desktop Commander processes.
406
+ */
407
+ async updateValueNonBlocking(key, updater) {
408
+ await this.init();
409
+ const next = updater(this.config[key]);
410
+ this.config[key] = next;
411
+ this.queueMutation((latest) => { latest[key] = updater(latest[key]); });
412
+ return next;
413
+ }
414
+ /** Update multiple configuration values at once. */
415
+ async updateConfig(updates) {
416
+ await this.init();
417
+ const write = this.writeChain.then(() => this.performConfigMutation((latest) => {
418
+ Object.assign(latest, updates);
419
+ }));
420
+ this.writeChain = write.then(() => { }, () => { });
421
+ return { ...(await write) };
422
+ }
423
+ /** Reset configuration to defaults. This intentionally replaces all keys. */
424
+ async resetConfig() {
425
+ await this.init();
426
+ const defaults = this.getDefaultConfig();
427
+ const write = this.writeChain.then(() => this.performConfigMutation((latest) => {
428
+ for (const key of Object.keys(latest))
429
+ delete latest[key];
430
+ Object.assign(latest, defaults);
431
+ }));
432
+ this.writeChain = write.then(() => { }, () => { });
433
+ return { ...(await write) };
434
+ }
435
+ /**
436
+ * Check if this is the first run (config file was just created)
437
+ */
438
+ isFirstRun() {
439
+ return this._isFirstRun;
440
+ }
441
+ /**
442
+ * Get or create a persistent client ID for analytics and A/B tests
443
+ */
444
+ async getOrCreateClientId() {
445
+ const { randomUUID } = await import('crypto');
446
+ return await this.updateValue('clientId', (current) => current || randomUUID());
447
+ }
448
+ }
449
+ // Export singleton instance
450
+ export const configManager = new ConfigManager();
451
+ //# sourceMappingURL=config-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-manager.js","sourceRoot":"","sources":["../../src/core/config-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,KAAK,EAAkB,MAAM,IAAI,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,gBAA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AC,gBAAgB,EAAE,CAAC;QACzC,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,MAAM,EAAE,EAAE;YAC7E,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;gBAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;YAC1D,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC,CAAC;QACJ,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACjD,OAAO,EAAE,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,mBAAmB;QACvB,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC9C,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,IAAI,UAAU,EAAE,CAAC,CAAC;IAClF,CAAC;;AAGH,4BAA4B;AAC5B,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const USER_HOME: string;
2
+ export declare const CONFIG_DIR: string;
3
+ export declare const CONFIG_FILE: string;
4
+ export declare const TOOL_CALL_FILE: string;
5
+ export declare const TOOL_CALL_FILE_MAX_SIZE: number;
6
+ export declare const DEFAULT_COMMAND_TIMEOUT = 1000;
@@ -0,0 +1,20 @@
1
+ import path from 'path';
2
+ import fs from 'fs';
3
+ import os from 'os';
4
+ // Use user's home directory for configuration files
5
+ export const USER_HOME = os.homedir();
6
+ // Better Remote Commander (BRC): own config dir so we never collide with an installed Desktop Commander
7
+ const longPath = (p) => { try {
8
+ return fs.realpathSync.native(p);
9
+ }
10
+ catch {
11
+ const parent = path.dirname(p);
12
+ return parent === p ? p : path.join(longPath(parent), path.basename(p));
13
+ } };
14
+ export const CONFIG_DIR = longPath(process.env.BRC_HOME ?? path.join(USER_HOME, '.brc'));
15
+ // Paths relative to the config directory
16
+ export const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
17
+ export const TOOL_CALL_FILE = path.join(CONFIG_DIR, 'claude_tool_call.log');
18
+ export const TOOL_CALL_FILE_MAX_SIZE = 1024 * 1024 * 10; // 10 MB
19
+ export const DEFAULT_COMMAND_TIMEOUT = 1000; // milliseconds
20
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,oDAAoD;AACpD,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;AACtC,wGAAwG;AACxG,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAU,EAAE,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAAC,CAAC;AAAC,MAAM,CAAC;IAAC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAAC,OAAO,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AAAC,CAAC,CAAC,CAAC,CAAC;AACzM,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;AAEzF,yCAAyC;AACzC,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AAChE,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,sBAAsB,CAAC,CAAC;AAC5E,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,QAAQ;AAEjE,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC,CAAC,eAAe"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Better Remote Commander (BRC): stub for upstream's stdio transport type.
3
+ * The agent never speaks stdio; this only satisfies the `global.mcpTransport` type
4
+ * referenced by upstream logger/types code. Always undefined at runtime.
5
+ */
6
+ export interface FilteredStdioServerTransport {
7
+ send(message: unknown): Promise<void>;
8
+ sendLog(level: string, message: string, data?: unknown): void;
9
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=custom-stdio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-stdio.js","sourceRoot":"","sources":["../../src/core/custom-stdio.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { ServerResult } from './types.js';
2
+ /**
3
+ * Creates a standard error response for tools
4
+ * @param message The error message
5
+ * @returns A ServerResult with the error message
6
+ */
7
+ export declare function createErrorResponse(message: string): ServerResult;
@@ -0,0 +1,16 @@
1
+ import { capture } from "./utils/capture.js";
2
+ /**
3
+ * Creates a standard error response for tools
4
+ * @param message The error message
5
+ * @returns A ServerResult with the error message
6
+ */
7
+ export function createErrorResponse(message) {
8
+ capture('server_request_error', {
9
+ error: message
10
+ });
11
+ return {
12
+ content: [{ type: "text", text: `Error: ${message}` }],
13
+ isError: true,
14
+ };
15
+ }
16
+ //# sourceMappingURL=error-handlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-handlers.js","sourceRoot":"","sources":["../../src/core/error-handlers.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAE3C;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe;IACjD,OAAO,CAAC,sBAAsB,EAAE;QAC9B,KAAK,EAAE,OAAO;KACf,CAAC,CAAC;IACH,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;QACtD,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
@@ -0,0 +1,16 @@
1
+ export declare function prepareFileReceive(ttlSeconds?: number): {
2
+ receiveId: string;
3
+ recipientPublicKey: string;
4
+ expiresAt: number;
5
+ };
6
+ export declare function sendFileTransfer(sourcePath: string, recipientPublicKey: string, expireSeconds?: number): Promise<{
7
+ transferToken: string;
8
+ size: number;
9
+ sha256: string;
10
+ expiresAt: number;
11
+ }>;
12
+ export declare function receiveFileTransfer(receiveId: string, transferToken: string, destinationPath: string, overwrite?: boolean): Promise<{
13
+ path: string;
14
+ size: number;
15
+ sha256: string;
16
+ }>;