@framers/agentos 0.1.119 → 0.1.121

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 (409) hide show
  1. package/README.md +21 -0
  2. package/dist/api/agency.d.ts.map +1 -1
  3. package/dist/api/agency.js +227 -84
  4. package/dist/api/agency.js.map +1 -1
  5. package/dist/api/analyzeVideo.d.ts +127 -0
  6. package/dist/api/analyzeVideo.d.ts.map +1 -0
  7. package/dist/api/analyzeVideo.js +136 -0
  8. package/dist/api/analyzeVideo.js.map +1 -0
  9. package/dist/api/detectScenes.d.ts +82 -0
  10. package/dist/api/detectScenes.d.ts.map +1 -0
  11. package/dist/api/detectScenes.js +67 -0
  12. package/dist/api/detectScenes.js.map +1 -0
  13. package/dist/api/generateImage.d.ts +7 -0
  14. package/dist/api/generateImage.d.ts.map +1 -1
  15. package/dist/api/generateImage.js +133 -9
  16. package/dist/api/generateImage.js.map +1 -1
  17. package/dist/api/generateMusic.d.ts +98 -0
  18. package/dist/api/generateMusic.d.ts.map +1 -0
  19. package/dist/api/generateMusic.js +319 -0
  20. package/dist/api/generateMusic.js.map +1 -0
  21. package/dist/api/generateSFX.d.ts +96 -0
  22. package/dist/api/generateSFX.d.ts.map +1 -0
  23. package/dist/api/generateSFX.js +317 -0
  24. package/dist/api/generateSFX.js.map +1 -0
  25. package/dist/api/generateVideo.d.ts +113 -0
  26. package/dist/api/generateVideo.d.ts.map +1 -0
  27. package/dist/api/generateVideo.js +342 -0
  28. package/dist/api/generateVideo.js.map +1 -0
  29. package/dist/api/model.d.ts.map +1 -1
  30. package/dist/api/model.js +8 -4
  31. package/dist/api/model.js.map +1 -1
  32. package/dist/api/performOCR.d.ts +169 -0
  33. package/dist/api/performOCR.d.ts.map +1 -0
  34. package/dist/api/performOCR.js +198 -0
  35. package/dist/api/performOCR.js.map +1 -0
  36. package/dist/api/provider-defaults.d.ts +7 -5
  37. package/dist/api/provider-defaults.d.ts.map +1 -1
  38. package/dist/api/provider-defaults.js +32 -10
  39. package/dist/api/provider-defaults.js.map +1 -1
  40. package/dist/api/strategies/debate.d.ts.map +1 -1
  41. package/dist/api/strategies/debate.js +1 -0
  42. package/dist/api/strategies/debate.js.map +1 -1
  43. package/dist/api/strategies/graph.d.ts.map +1 -1
  44. package/dist/api/strategies/graph.js +69 -13
  45. package/dist/api/strategies/graph.js.map +1 -1
  46. package/dist/api/strategies/hierarchical.d.ts.map +1 -1
  47. package/dist/api/strategies/hierarchical.js +1 -0
  48. package/dist/api/strategies/hierarchical.js.map +1 -1
  49. package/dist/api/strategies/parallel.d.ts.map +1 -1
  50. package/dist/api/strategies/parallel.js +1 -0
  51. package/dist/api/strategies/parallel.js.map +1 -1
  52. package/dist/api/strategies/review-loop.d.ts.map +1 -1
  53. package/dist/api/strategies/review-loop.js +1 -0
  54. package/dist/api/strategies/review-loop.js.map +1 -1
  55. package/dist/api/strategies/sequential.d.ts.map +1 -1
  56. package/dist/api/strategies/sequential.js +54 -48
  57. package/dist/api/strategies/sequential.js.map +1 -1
  58. package/dist/api/streamBuffer.d.ts +20 -0
  59. package/dist/api/streamBuffer.d.ts.map +1 -0
  60. package/dist/api/streamBuffer.js +81 -0
  61. package/dist/api/streamBuffer.js.map +1 -0
  62. package/dist/api/types.d.ts +145 -5
  63. package/dist/api/types.d.ts.map +1 -1
  64. package/dist/api/types.js.map +1 -1
  65. package/dist/channels/adapters/RedditChannelAdapter.js.map +1 -1
  66. package/dist/core/audio/AudioProcessor.d.ts.map +1 -1
  67. package/dist/core/audio/AudioProcessor.js +1 -0
  68. package/dist/core/audio/AudioProcessor.js.map +1 -1
  69. package/dist/core/audio/EnvironmentalCalibrator.d.ts.map +1 -1
  70. package/dist/core/audio/EnvironmentalCalibrator.js +1 -0
  71. package/dist/core/audio/EnvironmentalCalibrator.js.map +1 -1
  72. package/dist/core/audio/FallbackAudioProxy.d.ts +169 -0
  73. package/dist/core/audio/FallbackAudioProxy.d.ts.map +1 -0
  74. package/dist/core/audio/FallbackAudioProxy.js +236 -0
  75. package/dist/core/audio/FallbackAudioProxy.js.map +1 -0
  76. package/dist/core/audio/IAudioGenerator.d.ts +103 -0
  77. package/dist/core/audio/IAudioGenerator.d.ts.map +1 -0
  78. package/dist/core/audio/IAudioGenerator.js +24 -0
  79. package/dist/core/audio/IAudioGenerator.js.map +1 -0
  80. package/dist/core/audio/index.d.ts +54 -0
  81. package/dist/core/audio/index.d.ts.map +1 -1
  82. package/dist/core/audio/index.js +93 -0
  83. package/dist/core/audio/index.js.map +1 -1
  84. package/dist/core/audio/providers/AudioGenLocalProvider.d.ts +136 -0
  85. package/dist/core/audio/providers/AudioGenLocalProvider.d.ts.map +1 -0
  86. package/dist/core/audio/providers/AudioGenLocalProvider.js +235 -0
  87. package/dist/core/audio/providers/AudioGenLocalProvider.js.map +1 -0
  88. package/dist/core/audio/providers/ElevenLabsSFXProvider.d.ts +107 -0
  89. package/dist/core/audio/providers/ElevenLabsSFXProvider.d.ts.map +1 -0
  90. package/dist/core/audio/providers/ElevenLabsSFXProvider.js +154 -0
  91. package/dist/core/audio/providers/ElevenLabsSFXProvider.js.map +1 -0
  92. package/dist/core/audio/providers/FalAudioProvider.d.ts +207 -0
  93. package/dist/core/audio/providers/FalAudioProvider.d.ts.map +1 -0
  94. package/dist/core/audio/providers/FalAudioProvider.js +315 -0
  95. package/dist/core/audio/providers/FalAudioProvider.js.map +1 -0
  96. package/dist/core/audio/providers/MusicGenLocalProvider.d.ts +136 -0
  97. package/dist/core/audio/providers/MusicGenLocalProvider.d.ts.map +1 -0
  98. package/dist/core/audio/providers/MusicGenLocalProvider.js +235 -0
  99. package/dist/core/audio/providers/MusicGenLocalProvider.js.map +1 -0
  100. package/dist/core/audio/providers/ReplicateAudioProvider.d.ts +200 -0
  101. package/dist/core/audio/providers/ReplicateAudioProvider.d.ts.map +1 -0
  102. package/dist/core/audio/providers/ReplicateAudioProvider.js +346 -0
  103. package/dist/core/audio/providers/ReplicateAudioProvider.js.map +1 -0
  104. package/dist/core/audio/providers/StableAudioProvider.d.ts +138 -0
  105. package/dist/core/audio/providers/StableAudioProvider.d.ts.map +1 -0
  106. package/dist/core/audio/providers/StableAudioProvider.js +192 -0
  107. package/dist/core/audio/providers/StableAudioProvider.js.map +1 -0
  108. package/dist/core/audio/providers/SunoProvider.d.ts +182 -0
  109. package/dist/core/audio/providers/SunoProvider.d.ts.map +1 -0
  110. package/dist/core/audio/providers/SunoProvider.js +312 -0
  111. package/dist/core/audio/providers/SunoProvider.js.map +1 -0
  112. package/dist/core/audio/providers/UdioProvider.d.ts +177 -0
  113. package/dist/core/audio/providers/UdioProvider.d.ts.map +1 -0
  114. package/dist/core/audio/providers/UdioProvider.js +305 -0
  115. package/dist/core/audio/providers/UdioProvider.js.map +1 -0
  116. package/dist/core/audio/types.d.ts +257 -0
  117. package/dist/core/audio/types.d.ts.map +1 -0
  118. package/dist/core/audio/types.js +21 -0
  119. package/dist/core/audio/types.js.map +1 -0
  120. package/dist/core/images/FallbackImageProxy.d.ts +183 -0
  121. package/dist/core/images/FallbackImageProxy.d.ts.map +1 -0
  122. package/dist/core/images/FallbackImageProxy.js +283 -0
  123. package/dist/core/images/FallbackImageProxy.js.map +1 -0
  124. package/dist/core/images/IImageProvider.d.ts +1 -1
  125. package/dist/core/images/IImageProvider.d.ts.map +1 -1
  126. package/dist/core/images/index.d.ts +1 -0
  127. package/dist/core/images/index.d.ts.map +1 -1
  128. package/dist/core/images/index.js +1 -0
  129. package/dist/core/images/index.js.map +1 -1
  130. package/dist/core/llm/providers/AIModelProviderManager.d.ts +3 -1
  131. package/dist/core/llm/providers/AIModelProviderManager.d.ts.map +1 -1
  132. package/dist/core/llm/providers/AIModelProviderManager.js +8 -0
  133. package/dist/core/llm/providers/AIModelProviderManager.js.map +1 -1
  134. package/dist/core/llm/providers/errors/ClaudeCodeProviderError.d.ts +52 -0
  135. package/dist/core/llm/providers/errors/ClaudeCodeProviderError.d.ts.map +1 -0
  136. package/dist/core/llm/providers/errors/ClaudeCodeProviderError.js +36 -0
  137. package/dist/core/llm/providers/errors/ClaudeCodeProviderError.js.map +1 -0
  138. package/dist/core/llm/providers/errors/GeminiCLIProviderError.d.ts +32 -0
  139. package/dist/core/llm/providers/errors/GeminiCLIProviderError.d.ts.map +1 -0
  140. package/dist/core/llm/providers/errors/GeminiCLIProviderError.js +27 -0
  141. package/dist/core/llm/providers/errors/GeminiCLIProviderError.js.map +1 -0
  142. package/dist/core/llm/providers/implementations/ClaudeCodeCLIBridge.d.ts +38 -0
  143. package/dist/core/llm/providers/implementations/ClaudeCodeCLIBridge.d.ts.map +1 -0
  144. package/dist/core/llm/providers/implementations/ClaudeCodeCLIBridge.js +128 -0
  145. package/dist/core/llm/providers/implementations/ClaudeCodeCLIBridge.js.map +1 -0
  146. package/dist/core/llm/providers/implementations/ClaudeCodeProvider.d.ts +107 -0
  147. package/dist/core/llm/providers/implementations/ClaudeCodeProvider.d.ts.map +1 -0
  148. package/dist/core/llm/providers/implementations/ClaudeCodeProvider.js +504 -0
  149. package/dist/core/llm/providers/implementations/ClaudeCodeProvider.js.map +1 -0
  150. package/dist/core/llm/providers/implementations/GeminiCLIBridge.d.ts +60 -0
  151. package/dist/core/llm/providers/implementations/GeminiCLIBridge.d.ts.map +1 -0
  152. package/dist/core/llm/providers/implementations/GeminiCLIBridge.js +177 -0
  153. package/dist/core/llm/providers/implementations/GeminiCLIBridge.js.map +1 -0
  154. package/dist/core/llm/providers/implementations/GeminiCLIProvider.d.ts +55 -0
  155. package/dist/core/llm/providers/implementations/GeminiCLIProvider.d.ts.map +1 -0
  156. package/dist/core/llm/providers/implementations/GeminiCLIProvider.js +447 -0
  157. package/dist/core/llm/providers/implementations/GeminiCLIProvider.js.map +1 -0
  158. package/dist/core/media/ProviderPreferences.d.ts +158 -0
  159. package/dist/core/media/ProviderPreferences.d.ts.map +1 -0
  160. package/dist/core/media/ProviderPreferences.js +183 -0
  161. package/dist/core/media/ProviderPreferences.js.map +1 -0
  162. package/dist/core/subprocess/CLIRegistry.d.ts +71 -0
  163. package/dist/core/subprocess/CLIRegistry.d.ts.map +1 -0
  164. package/dist/core/subprocess/CLIRegistry.js +210 -0
  165. package/dist/core/subprocess/CLIRegistry.js.map +1 -0
  166. package/dist/core/subprocess/CLISubprocessBridge.d.ts +117 -0
  167. package/dist/core/subprocess/CLISubprocessBridge.d.ts.map +1 -0
  168. package/dist/core/subprocess/CLISubprocessBridge.js +199 -0
  169. package/dist/core/subprocess/CLISubprocessBridge.js.map +1 -0
  170. package/dist/core/subprocess/errors.d.ts +76 -0
  171. package/dist/core/subprocess/errors.d.ts.map +1 -0
  172. package/dist/core/subprocess/errors.js +75 -0
  173. package/dist/core/subprocess/errors.js.map +1 -0
  174. package/dist/core/subprocess/index.d.ts +11 -0
  175. package/dist/core/subprocess/index.d.ts.map +1 -0
  176. package/dist/core/subprocess/index.js +10 -0
  177. package/dist/core/subprocess/index.js.map +1 -0
  178. package/dist/core/subprocess/types.d.ts +100 -0
  179. package/dist/core/subprocess/types.d.ts.map +1 -0
  180. package/dist/core/subprocess/types.js +9 -0
  181. package/dist/core/subprocess/types.js.map +1 -0
  182. package/dist/core/video/FallbackVideoProxy.d.ts +166 -0
  183. package/dist/core/video/FallbackVideoProxy.d.ts.map +1 -0
  184. package/dist/core/video/FallbackVideoProxy.js +228 -0
  185. package/dist/core/video/FallbackVideoProxy.js.map +1 -0
  186. package/dist/core/video/IVideoAnalyzer.d.ts +29 -0
  187. package/dist/core/video/IVideoAnalyzer.d.ts.map +1 -0
  188. package/dist/core/video/IVideoAnalyzer.js +12 -0
  189. package/dist/core/video/IVideoAnalyzer.js.map +1 -0
  190. package/dist/core/video/IVideoGenerator.d.ts +76 -0
  191. package/dist/core/video/IVideoGenerator.d.ts.map +1 -0
  192. package/dist/core/video/IVideoGenerator.js +13 -0
  193. package/dist/core/video/IVideoGenerator.js.map +1 -0
  194. package/dist/core/video/VideoAnalyzer.d.ts +278 -0
  195. package/dist/core/video/VideoAnalyzer.d.ts.map +1 -0
  196. package/dist/core/video/VideoAnalyzer.js +648 -0
  197. package/dist/core/video/VideoAnalyzer.js.map +1 -0
  198. package/dist/core/video/index.d.ts +55 -0
  199. package/dist/core/video/index.d.ts.map +1 -0
  200. package/dist/core/video/index.js +78 -0
  201. package/dist/core/video/index.js.map +1 -0
  202. package/dist/core/video/providers/FalVideoProvider.d.ts +195 -0
  203. package/dist/core/video/providers/FalVideoProvider.d.ts.map +1 -0
  204. package/dist/core/video/providers/FalVideoProvider.js +322 -0
  205. package/dist/core/video/providers/FalVideoProvider.js.map +1 -0
  206. package/dist/core/video/providers/ReplicateVideoProvider.d.ts +194 -0
  207. package/dist/core/video/providers/ReplicateVideoProvider.d.ts.map +1 -0
  208. package/dist/core/video/providers/ReplicateVideoProvider.js +356 -0
  209. package/dist/core/video/providers/ReplicateVideoProvider.js.map +1 -0
  210. package/dist/core/video/providers/RunwayVideoProvider.d.ts +175 -0
  211. package/dist/core/video/providers/RunwayVideoProvider.d.ts.map +1 -0
  212. package/dist/core/video/providers/RunwayVideoProvider.js +293 -0
  213. package/dist/core/video/providers/RunwayVideoProvider.js.map +1 -0
  214. package/dist/core/video/types.d.ts +441 -0
  215. package/dist/core/video/types.d.ts.map +1 -0
  216. package/dist/core/video/types.js +10 -0
  217. package/dist/core/video/types.js.map +1 -0
  218. package/dist/core/vision/SceneDetector.d.ts +180 -0
  219. package/dist/core/vision/SceneDetector.d.ts.map +1 -0
  220. package/dist/core/vision/SceneDetector.js +366 -0
  221. package/dist/core/vision/SceneDetector.js.map +1 -0
  222. package/dist/core/vision/index.d.ts +2 -1
  223. package/dist/core/vision/index.d.ts.map +1 -1
  224. package/dist/core/vision/index.js +1 -0
  225. package/dist/core/vision/index.js.map +1 -1
  226. package/dist/core/vision/types.d.ts +125 -0
  227. package/dist/core/vision/types.d.ts.map +1 -1
  228. package/dist/discovery/CapabilityDiscoveryEngine.d.ts +32 -0
  229. package/dist/discovery/CapabilityDiscoveryEngine.d.ts.map +1 -1
  230. package/dist/discovery/CapabilityDiscoveryEngine.js +46 -0
  231. package/dist/discovery/CapabilityDiscoveryEngine.js.map +1 -1
  232. package/dist/extensions/MultiRegistryLoader.js.map +1 -1
  233. package/dist/index.d.ts +17 -2
  234. package/dist/index.d.ts.map +1 -1
  235. package/dist/index.js +12 -0
  236. package/dist/index.js.map +1 -1
  237. package/dist/memory/CognitiveMemoryManager.d.ts +40 -0
  238. package/dist/memory/CognitiveMemoryManager.d.ts.map +1 -1
  239. package/dist/memory/CognitiveMemoryManager.js +54 -1
  240. package/dist/memory/CognitiveMemoryManager.js.map +1 -1
  241. package/dist/memory/facade/Memory.d.ts +4 -0
  242. package/dist/memory/facade/Memory.d.ts.map +1 -1
  243. package/dist/memory/facade/Memory.js +140 -4
  244. package/dist/memory/facade/Memory.js.map +1 -1
  245. package/dist/memory/facade/types.d.ts +30 -2
  246. package/dist/memory/facade/types.d.ts.map +1 -1
  247. package/dist/memory/index.d.ts +1 -0
  248. package/dist/memory/index.d.ts.map +1 -1
  249. package/dist/memory/index.js +1 -0
  250. package/dist/memory/index.js.map +1 -1
  251. package/dist/memory/store/HnswSidecar.d.ts +115 -0
  252. package/dist/memory/store/HnswSidecar.d.ts.map +1 -0
  253. package/dist/memory/store/HnswSidecar.js +256 -0
  254. package/dist/memory/store/HnswSidecar.js.map +1 -0
  255. package/dist/memory/types.d.ts +15 -0
  256. package/dist/memory/types.d.ts.map +1 -1
  257. package/dist/query-router/QueryClassifier.d.ts +192 -21
  258. package/dist/query-router/QueryClassifier.d.ts.map +1 -1
  259. package/dist/query-router/QueryClassifier.js +604 -23
  260. package/dist/query-router/QueryClassifier.js.map +1 -1
  261. package/dist/query-router/QueryDispatcher.d.ts +106 -8
  262. package/dist/query-router/QueryDispatcher.d.ts.map +1 -1
  263. package/dist/query-router/QueryDispatcher.js +387 -8
  264. package/dist/query-router/QueryDispatcher.js.map +1 -1
  265. package/dist/query-router/QueryRouter.d.ts +198 -14
  266. package/dist/query-router/QueryRouter.d.ts.map +1 -1
  267. package/dist/query-router/QueryRouter.js +738 -50
  268. package/dist/query-router/QueryRouter.js.map +1 -1
  269. package/dist/query-router/index.d.ts +1 -1
  270. package/dist/query-router/index.d.ts.map +1 -1
  271. package/dist/query-router/index.js +1 -1
  272. package/dist/query-router/index.js.map +1 -1
  273. package/dist/query-router/types.d.ts +396 -3
  274. package/dist/query-router/types.d.ts.map +1 -1
  275. package/dist/query-router/types.js +35 -0
  276. package/dist/query-router/types.js.map +1 -1
  277. package/dist/rag/HydeRetriever.d.ts +108 -0
  278. package/dist/rag/HydeRetriever.d.ts.map +1 -1
  279. package/dist/rag/HydeRetriever.js +184 -0
  280. package/dist/rag/HydeRetriever.js.map +1 -1
  281. package/dist/rag/IRetrievalAugmentor.d.ts +15 -0
  282. package/dist/rag/IRetrievalAugmentor.d.ts.map +1 -1
  283. package/dist/rag/RetrievalAugmentor.d.ts +58 -0
  284. package/dist/rag/RetrievalAugmentor.d.ts.map +1 -1
  285. package/dist/rag/RetrievalAugmentor.js +200 -32
  286. package/dist/rag/RetrievalAugmentor.js.map +1 -1
  287. package/dist/rag/VectorStoreManager.js +1 -1
  288. package/dist/rag/audit/RAGAuditCollector.d.ts +7 -0
  289. package/dist/rag/audit/RAGAuditCollector.d.ts.map +1 -1
  290. package/dist/rag/audit/RAGAuditCollector.js +10 -0
  291. package/dist/rag/audit/RAGAuditCollector.js.map +1 -1
  292. package/dist/rag/audit/RAGAuditTypes.d.ts +10 -1
  293. package/dist/rag/audit/RAGAuditTypes.d.ts.map +1 -1
  294. package/dist/rag/chunking/SemanticChunker.d.ts +210 -0
  295. package/dist/rag/chunking/SemanticChunker.d.ts.map +1 -0
  296. package/dist/rag/chunking/SemanticChunker.js +460 -0
  297. package/dist/rag/chunking/SemanticChunker.js.map +1 -0
  298. package/dist/rag/chunking/index.d.ts +10 -0
  299. package/dist/rag/chunking/index.d.ts.map +1 -0
  300. package/dist/rag/chunking/index.js +10 -0
  301. package/dist/rag/chunking/index.js.map +1 -0
  302. package/dist/rag/implementations/vector_stores/PineconeVectorStore.d.ts +103 -0
  303. package/dist/rag/implementations/vector_stores/PineconeVectorStore.d.ts.map +1 -0
  304. package/dist/rag/implementations/vector_stores/PineconeVectorStore.js +315 -0
  305. package/dist/rag/implementations/vector_stores/PineconeVectorStore.js.map +1 -0
  306. package/dist/rag/implementations/vector_stores/PostgresVectorStore.d.ts +107 -0
  307. package/dist/rag/implementations/vector_stores/PostgresVectorStore.d.ts.map +1 -0
  308. package/dist/rag/implementations/vector_stores/PostgresVectorStore.js +438 -0
  309. package/dist/rag/implementations/vector_stores/PostgresVectorStore.js.map +1 -0
  310. package/dist/rag/index.d.ts +15 -1
  311. package/dist/rag/index.d.ts.map +1 -1
  312. package/dist/rag/index.js +32 -0
  313. package/dist/rag/index.js.map +1 -1
  314. package/dist/rag/migration/MigrationEngine.d.ts +47 -0
  315. package/dist/rag/migration/MigrationEngine.d.ts.map +1 -0
  316. package/dist/rag/migration/MigrationEngine.js +168 -0
  317. package/dist/rag/migration/MigrationEngine.js.map +1 -0
  318. package/dist/rag/migration/adapters/PineconeSourceAdapter.d.ts +23 -0
  319. package/dist/rag/migration/adapters/PineconeSourceAdapter.d.ts.map +1 -0
  320. package/dist/rag/migration/adapters/PineconeSourceAdapter.js +63 -0
  321. package/dist/rag/migration/adapters/PineconeSourceAdapter.js.map +1 -0
  322. package/dist/rag/migration/adapters/PostgresSourceAdapter.d.ts +30 -0
  323. package/dist/rag/migration/adapters/PostgresSourceAdapter.d.ts.map +1 -0
  324. package/dist/rag/migration/adapters/PostgresSourceAdapter.js +71 -0
  325. package/dist/rag/migration/adapters/PostgresSourceAdapter.js.map +1 -0
  326. package/dist/rag/migration/adapters/PostgresTargetAdapter.d.ts +38 -0
  327. package/dist/rag/migration/adapters/PostgresTargetAdapter.d.ts.map +1 -0
  328. package/dist/rag/migration/adapters/PostgresTargetAdapter.js +114 -0
  329. package/dist/rag/migration/adapters/PostgresTargetAdapter.js.map +1 -0
  330. package/dist/rag/migration/adapters/QdrantSourceAdapter.d.ts +36 -0
  331. package/dist/rag/migration/adapters/QdrantSourceAdapter.d.ts.map +1 -0
  332. package/dist/rag/migration/adapters/QdrantSourceAdapter.js +109 -0
  333. package/dist/rag/migration/adapters/QdrantSourceAdapter.js.map +1 -0
  334. package/dist/rag/migration/adapters/QdrantTargetAdapter.d.ts +35 -0
  335. package/dist/rag/migration/adapters/QdrantTargetAdapter.d.ts.map +1 -0
  336. package/dist/rag/migration/adapters/QdrantTargetAdapter.js +110 -0
  337. package/dist/rag/migration/adapters/QdrantTargetAdapter.js.map +1 -0
  338. package/dist/rag/migration/adapters/SqliteSourceAdapter.d.ts +37 -0
  339. package/dist/rag/migration/adapters/SqliteSourceAdapter.d.ts.map +1 -0
  340. package/dist/rag/migration/adapters/SqliteSourceAdapter.js +72 -0
  341. package/dist/rag/migration/adapters/SqliteSourceAdapter.js.map +1 -0
  342. package/dist/rag/migration/adapters/SqliteTargetAdapter.d.ts +47 -0
  343. package/dist/rag/migration/adapters/SqliteTargetAdapter.d.ts.map +1 -0
  344. package/dist/rag/migration/adapters/SqliteTargetAdapter.js +93 -0
  345. package/dist/rag/migration/adapters/SqliteTargetAdapter.js.map +1 -0
  346. package/dist/rag/migration/types.d.ts +108 -0
  347. package/dist/rag/migration/types.d.ts.map +1 -0
  348. package/dist/rag/migration/types.js +11 -0
  349. package/dist/rag/migration/types.js.map +1 -0
  350. package/dist/rag/multimodal/MultimodalIndexer.d.ts +35 -0
  351. package/dist/rag/multimodal/MultimodalIndexer.d.ts.map +1 -1
  352. package/dist/rag/multimodal/MultimodalIndexer.js +66 -1
  353. package/dist/rag/multimodal/MultimodalIndexer.js.map +1 -1
  354. package/dist/rag/multimodal/types.d.ts +24 -0
  355. package/dist/rag/multimodal/types.d.ts.map +1 -1
  356. package/dist/rag/raptor/RaptorTree.d.ts +268 -0
  357. package/dist/rag/raptor/RaptorTree.d.ts.map +1 -0
  358. package/dist/rag/raptor/RaptorTree.js +443 -0
  359. package/dist/rag/raptor/RaptorTree.js.map +1 -0
  360. package/dist/rag/raptor/index.d.ts +11 -0
  361. package/dist/rag/raptor/index.d.ts.map +1 -0
  362. package/dist/rag/raptor/index.js +11 -0
  363. package/dist/rag/raptor/index.js.map +1 -0
  364. package/dist/rag/reranking/providers/CohereReranker.js.map +1 -1
  365. package/dist/rag/search/BM25Index.d.ts +282 -0
  366. package/dist/rag/search/BM25Index.d.ts.map +1 -0
  367. package/dist/rag/search/BM25Index.js +344 -0
  368. package/dist/rag/search/BM25Index.js.map +1 -0
  369. package/dist/rag/search/HybridSearcher.d.ts +198 -0
  370. package/dist/rag/search/HybridSearcher.d.ts.map +1 -0
  371. package/dist/rag/search/HybridSearcher.js +316 -0
  372. package/dist/rag/search/HybridSearcher.js.map +1 -0
  373. package/dist/rag/search/index.d.ts +12 -0
  374. package/dist/rag/search/index.d.ts.map +1 -0
  375. package/dist/rag/search/index.js +12 -0
  376. package/dist/rag/search/index.js.map +1 -0
  377. package/dist/rag/setup/DockerDetector.d.ts +67 -0
  378. package/dist/rag/setup/DockerDetector.d.ts.map +1 -0
  379. package/dist/rag/setup/DockerDetector.js +125 -0
  380. package/dist/rag/setup/DockerDetector.js.map +1 -0
  381. package/dist/rag/setup/PostgresSetup.d.ts +20 -0
  382. package/dist/rag/setup/PostgresSetup.d.ts.map +1 -0
  383. package/dist/rag/setup/PostgresSetup.js +133 -0
  384. package/dist/rag/setup/PostgresSetup.js.map +1 -0
  385. package/dist/rag/setup/QdrantSetup.d.ts +26 -0
  386. package/dist/rag/setup/QdrantSetup.d.ts.map +1 -0
  387. package/dist/rag/setup/QdrantSetup.js +96 -0
  388. package/dist/rag/setup/QdrantSetup.js.map +1 -0
  389. package/dist/rag/setup/types.d.ts +55 -0
  390. package/dist/rag/setup/types.d.ts.map +1 -0
  391. package/dist/rag/setup/types.js +6 -0
  392. package/dist/rag/setup/types.js.map +1 -0
  393. package/dist/rag/unified/UnifiedRetriever.d.ts +472 -0
  394. package/dist/rag/unified/UnifiedRetriever.d.ts.map +1 -0
  395. package/dist/rag/unified/UnifiedRetriever.js +887 -0
  396. package/dist/rag/unified/UnifiedRetriever.js.map +1 -0
  397. package/dist/rag/unified/index.d.ts +24 -0
  398. package/dist/rag/unified/index.d.ts.map +1 -0
  399. package/dist/rag/unified/index.js +23 -0
  400. package/dist/rag/unified/index.js.map +1 -0
  401. package/dist/rag/unified/types.d.ts +546 -0
  402. package/dist/rag/unified/types.d.ts.map +1 -0
  403. package/dist/rag/unified/types.js +177 -0
  404. package/dist/rag/unified/types.js.map +1 -0
  405. package/dist/speech/providers/AssemblyAISTTProvider.js.map +1 -1
  406. package/dist/speech/providers/AzureSpeechSTTProvider.js.map +1 -1
  407. package/dist/speech/providers/BuiltInAdaptiveVadProvider.d.ts +1 -1
  408. package/dist/speech/providers/DeepgramBatchSTTProvider.js.map +1 -1
  409. package/package.json +5 -1
@@ -0,0 +1,199 @@
1
+ /**
2
+ * @fileoverview Abstract base class for CLI subprocess bridges.
3
+ * Uses the template method pattern: owns subprocess lifecycle (spawn, pipe,
4
+ * parse NDJSON, timeout/abort) while subclasses implement CLI-specific
5
+ * flag assembly, error classification, and stream event parsing.
6
+ *
7
+ * This is a first-class AgentOS core capability — any provider, extension,
8
+ * tool, or skill can extend this to manage external CLI binaries.
9
+ *
10
+ * @module agentos/core/subprocess/CLISubprocessBridge
11
+ * @see ClaudeCodeCLIBridge
12
+ */
13
+ import { execa } from 'execa';
14
+ /** Default subprocess timeout (2 minutes). */
15
+ const DEFAULT_TIMEOUT_MS = 120000;
16
+ /**
17
+ * Abstract base class for managing CLI subprocesses via execa.
18
+ *
19
+ * Subclasses implement four methods:
20
+ * - {@link binaryName} — the CLI binary on PATH
21
+ * - {@link buildArgs} — CLI-specific flag assembly
22
+ * - {@link classifyError} — error classification with guidance
23
+ * - {@link parseStreamEvent} — stream-json event parsing
24
+ *
25
+ * The base class handles:
26
+ * - Binary installation detection (`which` + version parsing)
27
+ * - Authentication health checks
28
+ * - Non-streaming execution with JSON result parsing
29
+ * - Streaming execution with NDJSON line splitting
30
+ * - Timeout and abort signal management
31
+ *
32
+ * @example
33
+ * class MyToolBridge extends CLISubprocessBridge {
34
+ * protected readonly binaryName = 'mytool';
35
+ * protected buildArgs(opts, fmt) { return ['-p', '--format', fmt]; }
36
+ * protected classifyError(err) { return new CLISubprocessError(...); }
37
+ * protected parseStreamEvent(raw) { return { type: 'text_delta', text: raw.text }; }
38
+ * }
39
+ */
40
+ export class CLISubprocessBridge {
41
+ /* ---- Virtual: override if your CLI differs ---- */
42
+ /**
43
+ * Parse the JSON stdout from `--output-format json`.
44
+ * Default implementation: JSON.parse with graceful fallback to raw text.
45
+ * Override if your CLI's JSON output has a different shape.
46
+ */
47
+ parseJsonResult(stdout, durationMs) {
48
+ try {
49
+ const parsed = JSON.parse(stdout.trim());
50
+ return {
51
+ result: parsed.result ?? parsed.message ?? parsed.response ?? stdout.trim(),
52
+ sessionId: parsed.session_id,
53
+ usage: parsed.usage
54
+ ? { input_tokens: parsed.usage.input_tokens ?? 0, output_tokens: parsed.usage.output_tokens ?? 0 }
55
+ : undefined,
56
+ isError: parsed.is_error === true,
57
+ durationMs,
58
+ };
59
+ }
60
+ catch {
61
+ return { result: stdout.trim(), isError: false, durationMs };
62
+ }
63
+ }
64
+ /**
65
+ * Build args and stdin for the lightweight authentication check.
66
+ * Override for CLI-specific flags (e.g. Claude needs --bare --max-turns 1).
67
+ */
68
+ buildAuthCheckArgs() {
69
+ return {
70
+ args: ['-p', '--output-format', 'json'],
71
+ stdin: 'Reply with exactly: pong',
72
+ };
73
+ }
74
+ /**
75
+ * Parse a version string from the CLI's --version output.
76
+ * Default: extracts first semver-like pattern (/\d+\.\d+\.\d+/).
77
+ */
78
+ parseVersion(stdout) {
79
+ const match = stdout.match(/(\d+\.\d+\.\d+)/);
80
+ return match ? match[1] : 'unknown';
81
+ }
82
+ /* ---- Concrete: shared lifecycle ---- */
83
+ /**
84
+ * Check if the binary is installed and on PATH.
85
+ * Returns the resolved path and parsed version string if found.
86
+ */
87
+ async checkBinaryInstalled() {
88
+ try {
89
+ const whichResult = await execa('which', [this.binaryName]);
90
+ const binaryPath = whichResult.stdout.trim();
91
+ const versionResult = await execa(this.binaryName, ['--version']);
92
+ const version = this.parseVersion(versionResult.stdout);
93
+ return { installed: true, binaryPath, version };
94
+ }
95
+ catch {
96
+ return { installed: false };
97
+ }
98
+ }
99
+ /**
100
+ * Check if the CLI is authenticated via a lightweight ping.
101
+ * Uses {@link buildAuthCheckArgs} for CLI-specific flags.
102
+ */
103
+ async checkAuthenticated() {
104
+ try {
105
+ const { args, stdin } = this.buildAuthCheckArgs();
106
+ await execa(this.binaryName, args, { input: stdin, timeout: 30000 });
107
+ return true;
108
+ }
109
+ catch {
110
+ return false;
111
+ }
112
+ }
113
+ /**
114
+ * Non-streaming execution.
115
+ * Spawns the binary with `--output-format json`, pipes prompt via stdin,
116
+ * and returns the parsed result.
117
+ *
118
+ * @param options — bridge options (prompt, system prompt, model, etc.)
119
+ * @returns parsed result with text, session ID, usage, and timing
120
+ * @throws {CLISubprocessError} on subprocess failure (via {@link classifyError})
121
+ */
122
+ async execute(options) {
123
+ const args = this.buildArgs(options, 'json');
124
+ const startMs = Date.now();
125
+ try {
126
+ const result = await execa(this.binaryName, args, {
127
+ input: options.prompt,
128
+ timeout: options.timeout ?? DEFAULT_TIMEOUT_MS,
129
+ cancelSignal: options.abortSignal,
130
+ ...(options.env ? { env: { ...process.env, ...options.env } } : {}),
131
+ });
132
+ const durationMs = Date.now() - startMs;
133
+ return this.parseJsonResult(result.stdout, durationMs);
134
+ }
135
+ catch (error) {
136
+ throw this.classifyError(error);
137
+ }
138
+ }
139
+ /**
140
+ * Streaming execution.
141
+ * Spawns the binary with `--output-format stream-json` and yields
142
+ * {@link StreamEvent}s parsed from newline-delimited JSON on stdout.
143
+ *
144
+ * @param options — bridge options
145
+ * @yields typed stream events (text_delta, result, error, system)
146
+ * @throws {CLISubprocessError} on subprocess failure (via {@link classifyError})
147
+ */
148
+ async *stream(options) {
149
+ const args = this.buildArgs(options, 'stream-json');
150
+ let subprocess;
151
+ try {
152
+ subprocess = execa(this.binaryName, args, {
153
+ input: options.prompt,
154
+ timeout: options.timeout ?? DEFAULT_TIMEOUT_MS,
155
+ cancelSignal: options.abortSignal,
156
+ ...(options.env ? { env: { ...process.env, ...options.env } } : {}),
157
+ });
158
+ }
159
+ catch (error) {
160
+ throw this.classifyError(error);
161
+ }
162
+ let buffer = '';
163
+ try {
164
+ for await (const chunk of subprocess.stdout) {
165
+ buffer += chunk.toString();
166
+ const lines = buffer.split('\n');
167
+ buffer = lines.pop() ?? '';
168
+ for (const line of lines) {
169
+ const trimmed = line.trim();
170
+ if (!trimmed)
171
+ continue;
172
+ try {
173
+ const event = this.parseStreamEvent(JSON.parse(trimmed));
174
+ if (event)
175
+ yield event;
176
+ }
177
+ catch {
178
+ /* skip unparseable lines (progress spinners, etc.) */
179
+ }
180
+ }
181
+ }
182
+ /* flush remaining buffer */
183
+ if (buffer.trim()) {
184
+ try {
185
+ const event = this.parseStreamEvent(JSON.parse(buffer.trim()));
186
+ if (event)
187
+ yield event;
188
+ }
189
+ catch { /* ignore */ }
190
+ }
191
+ /* Ensure non-zero exits after stdout drains still surface as errors. */
192
+ await subprocess;
193
+ }
194
+ catch (error) {
195
+ throw this.classifyError(error);
196
+ }
197
+ }
198
+ }
199
+ //# sourceMappingURL=CLISubprocessBridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CLISubprocessBridge.js","sourceRoot":"","sources":["../../../src/core/subprocess/CLISubprocessBridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,KAAK,EAAsB,MAAM,OAAO,CAAC;AAUlD,8CAA8C;AAC9C,MAAM,kBAAkB,GAAG,MAAO,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,OAAgB,mBAAmB;IAmCvC,qDAAqD;IAErD;;;;OAIG;IACO,eA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AwC,EAAE,CAAC;gBAC9E,MAAM,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;gBAC3B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBACjC,MAAM,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;gBAE3B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;oBACzB,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;oBAC5B,IAAI,CAAC,OAAO;wBAAE,SAAS;oBAEvB,IAAI,CAAC;wBACH,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;wBACzD,IAAI,KAAK;4BAAE,MAAM,KAAK,CAAC;oBACzB,CAAC;oBAAC,MAAM,CAAC;wBACP,sDAAsD;oBACxD,CAAC;gBACH,CAAC;YACH,CAAC;YAED,4BAA4B;YAC5B,IAAI,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;gBAClB,IAAI,CAAC;oBACH,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;oBAC/D,IAAI,KAAK;wBAAE,MAAM,KAAK,CAAC;gBACzB,CAAC;gBAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC;YAC1B,CAAC;YAED,wEAAwE;YACxE,MAAM,UAAU,CAAC;QACnB,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * @fileoverview Base error class for CLI subprocess operations.
3
+ * Fully generic — works for any binary (LLM CLIs, dev tools, media tools, etc.).
4
+ * Error codes are open strings so each consumer can define their own.
5
+ *
6
+ * @module agentos/core/subprocess/errors
7
+ */
8
+ /**
9
+ * Base error for ANY CLI subprocess managed by {@link CLISubprocessBridge}.
10
+ * Not specific to LLM CLIs — works for ffmpeg, git, docker, or any binary.
11
+ *
12
+ * Carries actionable {@link guidance} so the user knows how to fix the problem,
13
+ * and a {@link recoverable} flag so callers know whether to retry or fall back.
14
+ *
15
+ * @example
16
+ * throw new CLISubprocessError(
17
+ * 'ffmpeg not found.',
18
+ * CLI_ERROR.BINARY_NOT_FOUND,
19
+ * 'ffmpeg',
20
+ * 'Install ffmpeg: brew install ffmpeg',
21
+ * false,
22
+ * );
23
+ */
24
+ export declare class CLISubprocessError extends Error {
25
+ /** Error code — open string, not a fixed union. Each CLI defines its own. */
26
+ readonly code: string;
27
+ /** The binary that failed (e.g. 'claude', 'gemini', 'ffmpeg'). */
28
+ readonly binaryName: string;
29
+ /** Human-readable fix instructions shown to the user. */
30
+ readonly guidance: string;
31
+ /** Whether the caller can retry or fall back. */
32
+ readonly recoverable: boolean;
33
+ /** Optional underlying error or extra context. */
34
+ readonly details?: unknown;
35
+ /**
36
+ * @param message — human-readable error description
37
+ * @param code — error code string (use {@link CLI_ERROR} constants or your own)
38
+ * @param binaryName — the CLI binary that failed
39
+ * @param guidance — actionable fix instructions shown to the user
40
+ * @param recoverable — true if the caller should attempt retry/fallback (default false)
41
+ * @param details — optional underlying error or extra context
42
+ */
43
+ constructor(message: string, code: string, binaryName: string, guidance: string, recoverable?: boolean, details?: unknown);
44
+ }
45
+ /**
46
+ * Common error code constants shared across many CLIs.
47
+ * Consumers can use these or define their own — these are suggestions, not constraints.
48
+ *
49
+ * @example
50
+ * // Use a common code
51
+ * new CLISubprocessError('Not found', CLI_ERROR.BINARY_NOT_FOUND, 'claude', '...');
52
+ *
53
+ * // Use a custom code
54
+ * new CLISubprocessError('Codec missing', 'CODEC_NOT_FOUND', 'ffmpeg', '...');
55
+ */
56
+ export declare const CLI_ERROR: {
57
+ /** Binary not found on PATH. */
58
+ readonly BINARY_NOT_FOUND: "BINARY_NOT_FOUND";
59
+ /** Binary installed but not authenticated / logged in. */
60
+ readonly NOT_AUTHENTICATED: "NOT_AUTHENTICATED";
61
+ /** Binary version too old for required features. */
62
+ readonly VERSION_OUTDATED: "VERSION_OUTDATED";
63
+ /** Process failed to start (permissions, missing deps, etc.). */
64
+ readonly SPAWN_FAILED: "SPAWN_FAILED";
65
+ /** Process exceeded timeout. */
66
+ readonly TIMEOUT: "TIMEOUT";
67
+ /** Process exited with non-zero exit code. */
68
+ readonly CRASHED: "CRASHED";
69
+ /** Rate limit / quota exceeded. */
70
+ readonly RATE_LIMITED: "RATE_LIMITED";
71
+ /** Permission denied (EACCES). */
72
+ readonly PERMISSION_DENIED: "PERMISSION_DENIED";
73
+ /** Input/context too long for the CLI to handle. */
74
+ readonly CONTEXT_TOO_LONG: "CONTEXT_TOO_LONG";
75
+ };
76
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/core/subprocess/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,6EAA6E;IAC7E,SAAgB,IAAI,EAAE,MAAM,CAAC;IAE7B,kEAAkE;IAClE,SAAgB,UAAU,EAAE,MAAM,CAAC;IAEnC,yDAAyD;IACzD,SAAgB,QAAQ,EAAE,MAAM,CAAC;IAEjC,iDAAiD;IACjD,SAAgB,WAAW,EAAE,OAAO,CAAC;IAErC,kDAAkD;IAClD,SAAgB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElC;;;;;;;OAOG;gBAED,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,WAAW,GAAE,OAAe,EAC5B,OAAO,CAAC,EAAE,OAAO;CAYpB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS;IACpB,gCAAgC;;IAEhC,0DAA0D;;IAE1D,oDAAoD;;IAEpD,iEAAiE;;IAEjE,gCAAgC;;IAEhC,8CAA8C;;IAE9C,mCAAmC;;IAEnC,kCAAkC;;IAElC,oDAAoD;;CAE5C,CAAC"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * @fileoverview Base error class for CLI subprocess operations.
3
+ * Fully generic — works for any binary (LLM CLIs, dev tools, media tools, etc.).
4
+ * Error codes are open strings so each consumer can define their own.
5
+ *
6
+ * @module agentos/core/subprocess/errors
7
+ */
8
+ /**
9
+ * Base error for ANY CLI subprocess managed by {@link CLISubprocessBridge}.
10
+ * Not specific to LLM CLIs — works for ffmpeg, git, docker, or any binary.
11
+ *
12
+ * Carries actionable {@link guidance} so the user knows how to fix the problem,
13
+ * and a {@link recoverable} flag so callers know whether to retry or fall back.
14
+ *
15
+ * @example
16
+ * throw new CLISubprocessError(
17
+ * 'ffmpeg not found.',
18
+ * CLI_ERROR.BINARY_NOT_FOUND,
19
+ * 'ffmpeg',
20
+ * 'Install ffmpeg: brew install ffmpeg',
21
+ * false,
22
+ * );
23
+ */
24
+ export class CLISubprocessError extends Error {
25
+ /**
26
+ * @param message — human-readable error description
27
+ * @param code — error code string (use {@link CLI_ERROR} constants or your own)
28
+ * @param binaryName — the CLI binary that failed
29
+ * @param guidance — actionable fix instructions shown to the user
30
+ * @param recoverable — true if the caller should attempt retry/fallback (default false)
31
+ * @param details — optional underlying error or extra context
32
+ */
33
+ constructor(message, code, binaryName, guidance, recoverable = false, details) {
34
+ super(message);
35
+ this.name = 'CLISubprocessError';
36
+ this.code = code;
37
+ this.binaryName = binaryName;
38
+ this.guidance = guidance;
39
+ this.recoverable = recoverable;
40
+ this.details = details;
41
+ Object.setPrototypeOf(this, CLISubprocessError.prototype);
42
+ }
43
+ }
44
+ /**
45
+ * Common error code constants shared across many CLIs.
46
+ * Consumers can use these or define their own — these are suggestions, not constraints.
47
+ *
48
+ * @example
49
+ * // Use a common code
50
+ * new CLISubprocessError('Not found', CLI_ERROR.BINARY_NOT_FOUND, 'claude', '...');
51
+ *
52
+ * // Use a custom code
53
+ * new CLISubprocessError('Codec missing', 'CODEC_NOT_FOUND', 'ffmpeg', '...');
54
+ */
55
+ export const CLI_ERROR = {
56
+ /** Binary not found on PATH. */
57
+ BINARY_NOT_FOUND: 'BINARY_NOT_FOUND',
58
+ /** Binary installed but not authenticated / logged in. */
59
+ NOT_AUTHENTICATED: 'NOT_AUTHENTICATED',
60
+ /** Binary version too old for required features. */
61
+ VERSION_OUTDATED: 'VERSION_OUTDATED',
62
+ /** Process failed to start (permissions, missing deps, etc.). */
63
+ SPAWN_FAILED: 'SPAWN_FAILED',
64
+ /** Process exceeded timeout. */
65
+ TIMEOUT: 'TIMEOUT',
66
+ /** Process exited with non-zero exit code. */
67
+ CRASHED: 'CRASHED',
68
+ /** Rate limit / quota exceeded. */
69
+ RATE_LIMITED: 'RATE_LIMITED',
70
+ /** Permission denied (EACCES). */
71
+ PERMISSION_DENIED: 'PERMISSION_DENIED',
72
+ /** Input/context too long for the CLI to handle. */
73
+ CONTEXT_TOO_LONG: 'CONTEXT_TOO_LONG',
74
+ };
75
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/core/subprocess/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAgB3C;;;;;;;OAOG;IACH,YACE,OAAe,EACf,IAAY,EACZ,UAAkB,EAClB,QAAgB,EAChB,cAAuB,KAAK,EAC5B,OAAiB;QAEjB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC;CACF;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,gCAAgC;IAChC,gBAAgB,EAAE,kBAAkB;IACpC,0DAA0D;IAC1D,iBAAiB,EAAE,mBAAmB;IACtC,oDAAoD;IACpD,gBAAgB,EAAE,kBAAkB;IACpC,iEAAiE;IACjE,YAAY,EAAE,cAAc;IAC5B,gCAAgC;IAChC,OAAO,EAAE,SAAS;IAClB,8CAA8C;IAC9C,OAAO,EAAE,SAAS;IAClB,mCAAmC;IACnC,YAAY,EAAE,cAAc;IAC5B,kCAAkC;IAClC,iBAAiB,EAAE,mBAAmB;IACtC,oDAAoD;IACpD,gBAAgB,EAAE,kBAAkB;CAC5B,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @fileoverview Core subprocess management — first-class AgentOS capability
3
+ * for spawning and managing external CLI binaries.
4
+ *
5
+ * @module agentos/core/subprocess
6
+ */
7
+ export { CLISubprocessBridge } from './CLISubprocessBridge';
8
+ export { CLIRegistry, WELL_KNOWN_CLIS } from './CLIRegistry';
9
+ export { CLISubprocessError, CLI_ERROR } from './errors';
10
+ export type { BridgeOptions, BridgeResult, StreamEvent, OutputFormat, InstallCheckResult, CLIDescriptor, CLIScanResult, } from './types';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/subprocess/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACzD,YAAY,EACV,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,aAAa,GACd,MAAM,SAAS,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @fileoverview Core subprocess management — first-class AgentOS capability
3
+ * for spawning and managing external CLI binaries.
4
+ *
5
+ * @module agentos/core/subprocess
6
+ */
7
+ export { CLISubprocessBridge } from './CLISubprocessBridge.js';
8
+ export { CLIRegistry, WELL_KNOWN_CLIS } from './CLIRegistry.js';
9
+ export { CLISubprocessError, CLI_ERROR } from './errors.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/subprocess/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,100 @@
1
+ /**
2
+ * @fileoverview Shared types for the CLI subprocess bridge system.
3
+ * These types are CLI-agnostic — they work for any binary managed
4
+ * by {@link CLISubprocessBridge} (LLM CLIs, dev tools, media tools, etc.).
5
+ *
6
+ * @module agentos/core/subprocess/types
7
+ */
8
+ /** Output format supported by CLI subprocess bridges. */
9
+ export type OutputFormat = 'json' | 'stream-json' | 'text';
10
+ /** Options for {@link CLISubprocessBridge.execute} and {@link CLISubprocessBridge.stream}. */
11
+ export interface BridgeOptions {
12
+ /** The prompt or input text to pipe via stdin. */
13
+ prompt: string;
14
+ /** System prompt — how it's passed depends on the CLI (flag, file, env var). */
15
+ systemPrompt?: string;
16
+ /** Model ID for LLM CLIs. */
17
+ model?: string;
18
+ /** JSON schema for structured output (if the CLI supports it). */
19
+ jsonSchema?: object;
20
+ /** Maximum agentic turns (if the CLI supports it). */
21
+ maxTurns?: number;
22
+ /** Subprocess timeout in milliseconds (default 120 000). */
23
+ timeout?: number;
24
+ /** AbortSignal to cancel the subprocess. */
25
+ abortSignal?: AbortSignal;
26
+ /** Extra CLI flags specific to a particular bridge. */
27
+ extraArgs?: string[];
28
+ /** Extra environment variables merged into the subprocess env. */
29
+ env?: Record<string, string>;
30
+ }
31
+ /** Result from a non-streaming {@link CLISubprocessBridge.execute} call. */
32
+ export interface BridgeResult {
33
+ /** The text result returned by the CLI. */
34
+ result: string;
35
+ /** Session ID for potential future use. */
36
+ sessionId?: string;
37
+ /** Token usage stats if available. */
38
+ usage?: {
39
+ input_tokens: number;
40
+ output_tokens: number;
41
+ };
42
+ /** Whether the CLI reported an error. */
43
+ isError: boolean;
44
+ /** Wall-clock duration of the subprocess in ms. */
45
+ durationMs: number;
46
+ }
47
+ /** Typed events yielded by {@link CLISubprocessBridge.stream}. */
48
+ export type StreamEvent = {
49
+ type: 'text_delta';
50
+ text: string;
51
+ } | {
52
+ type: 'result';
53
+ result: string;
54
+ sessionId?: string;
55
+ usage?: {
56
+ input_tokens: number;
57
+ output_tokens: number;
58
+ };
59
+ } | {
60
+ type: 'error';
61
+ error: string;
62
+ } | {
63
+ type: 'system';
64
+ message: string;
65
+ };
66
+ /** Result from {@link CLISubprocessBridge.checkBinaryInstalled}. */
67
+ export type InstallCheckResult = {
68
+ installed: true;
69
+ binaryPath: string;
70
+ version: string;
71
+ } | {
72
+ installed: false;
73
+ };
74
+ /** Descriptor for a known CLI binary. Used by {@link CLIRegistry}. */
75
+ export interface CLIDescriptor {
76
+ /** Binary name on PATH (e.g. 'claude', 'gemini', 'docker', 'ffmpeg'). */
77
+ binaryName: string;
78
+ /** Human-readable display name. */
79
+ displayName: string;
80
+ /** What this CLI does. */
81
+ description: string;
82
+ /** Category for grouping (e.g. 'llm', 'media', 'devtools', 'cloud', 'runtime'). */
83
+ category: string;
84
+ /** How to install if missing. */
85
+ installGuidance: string;
86
+ /** Version flag override if not --version. */
87
+ versionFlag?: string;
88
+ /** Regex to parse version from output (default: /(\d+\.\d+\.\d+)/). */
89
+ versionPattern?: RegExp;
90
+ }
91
+ /** Result from {@link CLIRegistry.scan} or {@link CLIRegistry.check}. */
92
+ export interface CLIScanResult extends CLIDescriptor {
93
+ /** Whether the binary was found on PATH. */
94
+ installed: boolean;
95
+ /** Resolved absolute path to the binary. */
96
+ binaryPath?: string;
97
+ /** Parsed version string. */
98
+ version?: string;
99
+ }
100
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/subprocess/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,yDAAyD;AACzD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,aAAa,GAAG,MAAM,CAAC;AAE3D,8FAA8F;AAC9F,MAAM,WAAW,aAAa;IAC5B,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,kEAAkE;IAClE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED,4EAA4E;AAC5E,MAAM,WAAW,YAAY;IAC3B,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC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AC;CACzB;AAED,yEAAyE;AACzE,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,4CAA4C;IAC5C,SAAS,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @fileoverview Shared types for the CLI subprocess bridge system.
3
+ * These types are CLI-agnostic — they work for any binary managed
4
+ * by {@link CLISubprocessBridge} (LLM CLIs, dev tools, media tools, etc.).
5
+ *
6
+ * @module agentos/core/subprocess/types
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/subprocess/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}