@framers/agentos 0.1.113 → 0.1.114

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 (510) hide show
  1. package/README.md +39 -5
  2. package/dist/api/AgentOS.d.ts +45 -12
  3. package/dist/api/AgentOS.d.ts.map +1 -1
  4. package/dist/api/AgentOS.js +225 -78
  5. package/dist/api/AgentOS.js.map +1 -1
  6. package/dist/api/AgentOSOrchestrator.d.ts +8 -0
  7. package/dist/api/AgentOSOrchestrator.d.ts.map +1 -1
  8. package/dist/api/AgentOSOrchestrator.js +350 -59
  9. package/dist/api/AgentOSOrchestrator.js.map +1 -1
  10. package/dist/api/StreamChunkEmitter.d.ts.map +1 -1
  11. package/dist/api/StreamChunkEmitter.js +2 -0
  12. package/dist/api/StreamChunkEmitter.js.map +1 -1
  13. package/dist/api/agency.d.ts.map +1 -1
  14. package/dist/api/agency.js +47 -1
  15. package/dist/api/agency.js.map +1 -1
  16. package/dist/api/agent.d.ts +18 -5
  17. package/dist/api/agent.d.ts.map +1 -1
  18. package/dist/api/agent.js +48 -9
  19. package/dist/api/agent.js.map +1 -1
  20. package/dist/api/agentExport.d.ts +202 -0
  21. package/dist/api/agentExport.d.ts.map +1 -0
  22. package/dist/api/agentExport.js +323 -0
  23. package/dist/api/agentExport.js.map +1 -0
  24. package/dist/api/editImage.d.ts +119 -0
  25. package/dist/api/editImage.d.ts.map +1 -0
  26. package/dist/api/editImage.js +150 -0
  27. package/dist/api/editImage.js.map +1 -0
  28. package/dist/api/embedText.d.ts +137 -0
  29. package/dist/api/embedText.d.ts.map +1 -0
  30. package/dist/api/embedText.js +229 -0
  31. package/dist/api/embedText.js.map +1 -0
  32. package/dist/api/externalToolRegistry.d.ts +44 -0
  33. package/dist/api/externalToolRegistry.d.ts.map +1 -0
  34. package/dist/api/externalToolRegistry.js +245 -0
  35. package/dist/api/externalToolRegistry.js.map +1 -0
  36. package/dist/api/generateImage.d.ts +1 -1
  37. package/dist/api/generateImage.d.ts.map +1 -1
  38. package/dist/api/generateImage.js +17 -13
  39. package/dist/api/generateImage.js.map +1 -1
  40. package/dist/api/generateObject.d.ts +185 -0
  41. package/dist/api/generateObject.d.ts.map +1 -0
  42. package/dist/api/generateObject.js +249 -0
  43. package/dist/api/generateObject.js.map +1 -0
  44. package/dist/api/generateText.d.ts +13 -3
  45. package/dist/api/generateText.d.ts.map +1 -1
  46. package/dist/api/generateText.js +20 -5
  47. package/dist/api/generateText.js.map +1 -1
  48. package/dist/api/interfaces/IAgentOS.d.ts +29 -1
  49. package/dist/api/interfaces/IAgentOS.d.ts.map +1 -1
  50. package/dist/api/model.d.ts +7 -7
  51. package/dist/api/model.d.ts.map +1 -1
  52. package/dist/api/model.js +22 -16
  53. package/dist/api/model.js.map +1 -1
  54. package/dist/api/processRequestWithExternalTools.d.ts +26 -0
  55. package/dist/api/processRequestWithExternalTools.d.ts.map +1 -0
  56. package/dist/api/processRequestWithExternalTools.js +52 -0
  57. package/dist/api/processRequestWithExternalTools.js.map +1 -0
  58. package/dist/api/processRequestWithRegisteredTools.d.ts +56 -0
  59. package/dist/api/processRequestWithRegisteredTools.d.ts.map +1 -0
  60. package/dist/api/processRequestWithRegisteredTools.js +125 -0
  61. package/dist/api/processRequestWithRegisteredTools.js.map +1 -0
  62. package/dist/api/provider-defaults.d.ts.map +1 -1
  63. package/dist/api/provider-defaults.js +28 -0
  64. package/dist/api/provider-defaults.js.map +1 -1
  65. package/dist/api/resumeExternalToolRequestWithRegisteredTools.d.ts +71 -0
  66. package/dist/api/resumeExternalToolRequestWithRegisteredTools.d.ts.map +1 -0
  67. package/dist/api/resumeExternalToolRequestWithRegisteredTools.js +159 -0
  68. package/dist/api/resumeExternalToolRequestWithRegisteredTools.js.map +1 -0
  69. package/dist/api/strategies/agentGraphBuilder.d.ts +170 -0
  70. package/dist/api/strategies/agentGraphBuilder.d.ts.map +1 -0
  71. package/dist/api/strategies/agentGraphBuilder.js +299 -0
  72. package/dist/api/strategies/agentGraphBuilder.js.map +1 -0
  73. package/dist/api/strategies/graphCompiler.d.ts +84 -0
  74. package/dist/api/strategies/graphCompiler.d.ts.map +1 -0
  75. package/dist/api/strategies/graphCompiler.js +617 -0
  76. package/dist/api/strategies/graphCompiler.js.map +1 -0
  77. package/dist/api/strategies/hierarchical.d.ts.map +1 -1
  78. package/dist/api/strategies/hierarchical.js +2 -1
  79. package/dist/api/strategies/hierarchical.js.map +1 -1
  80. package/dist/api/strategies/index.d.ts +3 -0
  81. package/dist/api/strategies/index.d.ts.map +1 -1
  82. package/dist/api/strategies/index.js +2 -0
  83. package/dist/api/strategies/index.js.map +1 -1
  84. package/dist/api/strategies/shared.d.ts +1 -1
  85. package/dist/api/strategies/shared.d.ts.map +1 -1
  86. package/dist/api/strategies/shared.js +3 -2
  87. package/dist/api/strategies/shared.js.map +1 -1
  88. package/dist/api/streamObject.d.ts +166 -0
  89. package/dist/api/streamObject.d.ts.map +1 -0
  90. package/dist/api/streamObject.js +268 -0
  91. package/dist/api/streamObject.js.map +1 -0
  92. package/dist/api/streamText.d.ts +1 -1
  93. package/dist/api/streamText.d.ts.map +1 -1
  94. package/dist/api/streamText.js +26 -8
  95. package/dist/api/streamText.js.map +1 -1
  96. package/dist/api/toolAdapter.d.ts +44 -8
  97. package/dist/api/toolAdapter.d.ts.map +1 -1
  98. package/dist/api/toolAdapter.js +224 -45
  99. package/dist/api/toolAdapter.js.map +1 -1
  100. package/dist/api/types/AgentOSExternalToolRequest.d.ts +35 -0
  101. package/dist/api/types/AgentOSExternalToolRequest.d.ts.map +1 -0
  102. package/dist/api/types/AgentOSExternalToolRequest.js +2 -0
  103. package/dist/api/types/AgentOSExternalToolRequest.js.map +1 -0
  104. package/dist/api/types/AgentOSResponse.d.ts +25 -0
  105. package/dist/api/types/AgentOSResponse.d.ts.map +1 -1
  106. package/dist/api/types/AgentOSResponse.js +20 -0
  107. package/dist/api/types/AgentOSResponse.js.map +1 -1
  108. package/dist/api/types/AgentOSToolResult.d.ts +11 -0
  109. package/dist/api/types/AgentOSToolResult.d.ts.map +1 -0
  110. package/dist/api/types/AgentOSToolResult.js +2 -0
  111. package/dist/api/types/AgentOSToolResult.js.map +1 -0
  112. package/dist/api/types.d.ts +28 -4
  113. package/dist/api/types.d.ts.map +1 -1
  114. package/dist/api/types.js.map +1 -1
  115. package/dist/api/upscaleImage.d.ts +92 -0
  116. package/dist/api/upscaleImage.d.ts.map +1 -0
  117. package/dist/api/upscaleImage.js +133 -0
  118. package/dist/api/upscaleImage.js.map +1 -0
  119. package/dist/api/variateImage.d.ts +102 -0
  120. package/dist/api/variateImage.d.ts.map +1 -0
  121. package/dist/api/variateImage.js +154 -0
  122. package/dist/api/variateImage.js.map +1 -0
  123. package/dist/cognitive_substrate/GMI.d.ts +16 -2
  124. package/dist/cognitive_substrate/GMI.d.ts.map +1 -1
  125. package/dist/cognitive_substrate/GMI.js +188 -56
  126. package/dist/cognitive_substrate/GMI.js.map +1 -1
  127. package/dist/cognitive_substrate/IGMI.d.ts +10 -0
  128. package/dist/cognitive_substrate/IGMI.d.ts.map +1 -1
  129. package/dist/cognitive_substrate/IGMI.js.map +1 -1
  130. package/dist/config/AgentOSConfig.d.ts +19 -2
  131. package/dist/config/AgentOSConfig.d.ts.map +1 -1
  132. package/dist/config/AgentOSConfig.js +46 -29
  133. package/dist/config/AgentOSConfig.js.map +1 -1
  134. package/dist/core/guardrails/IGuardrailService.d.ts +1 -1
  135. package/dist/core/images/IImageProvider.d.ts +93 -0
  136. package/dist/core/images/IImageProvider.d.ts.map +1 -1
  137. package/dist/core/images/IImageProvider.js.map +1 -1
  138. package/dist/core/images/ImageOperationError.d.ts +52 -0
  139. package/dist/core/images/ImageOperationError.d.ts.map +1 -0
  140. package/dist/core/images/ImageOperationError.js +58 -0
  141. package/dist/core/images/ImageOperationError.js.map +1 -0
  142. package/dist/core/images/imageToBuffer.d.ts +41 -0
  143. package/dist/core/images/imageToBuffer.d.ts.map +1 -0
  144. package/dist/core/images/imageToBuffer.js +95 -0
  145. package/dist/core/images/imageToBuffer.js.map +1 -0
  146. package/dist/core/images/index.d.ts +4 -0
  147. package/dist/core/images/index.d.ts.map +1 -1
  148. package/dist/core/images/index.js +8 -0
  149. package/dist/core/images/index.js.map +1 -1
  150. package/dist/core/images/providers/FalImageProvider.d.ts +208 -0
  151. package/dist/core/images/providers/FalImageProvider.d.ts.map +1 -0
  152. package/dist/core/images/providers/FalImageProvider.js +301 -0
  153. package/dist/core/images/providers/FalImageProvider.js.map +1 -0
  154. package/dist/core/images/providers/FluxImageProvider.d.ts +197 -0
  155. package/dist/core/images/providers/FluxImageProvider.d.ts.map +1 -0
  156. package/dist/core/images/providers/FluxImageProvider.js +271 -0
  157. package/dist/core/images/providers/FluxImageProvider.js.map +1 -0
  158. package/dist/core/images/providers/OpenAIImageProvider.d.ts +33 -1
  159. package/dist/core/images/providers/OpenAIImageProvider.d.ts.map +1 -1
  160. package/dist/core/images/providers/OpenAIImageProvider.js +125 -0
  161. package/dist/core/images/providers/OpenAIImageProvider.js.map +1 -1
  162. package/dist/core/images/providers/ReplicateImageProvider.d.ts +26 -1
  163. package/dist/core/images/providers/ReplicateImageProvider.d.ts.map +1 -1
  164. package/dist/core/images/providers/ReplicateImageProvider.js +118 -0
  165. package/dist/core/images/providers/ReplicateImageProvider.js.map +1 -1
  166. package/dist/core/images/providers/StabilityImageProvider.d.ts +41 -1
  167. package/dist/core/images/providers/StabilityImageProvider.d.ts.map +1 -1
  168. package/dist/core/images/providers/StabilityImageProvider.js +180 -7
  169. package/dist/core/images/providers/StabilityImageProvider.js.map +1 -1
  170. package/dist/core/images/providers/StableDiffusionLocalProvider.d.ts +29 -1
  171. package/dist/core/images/providers/StableDiffusionLocalProvider.d.ts.map +1 -1
  172. package/dist/core/images/providers/StableDiffusionLocalProvider.js +124 -0
  173. package/dist/core/images/providers/StableDiffusionLocalProvider.js.map +1 -1
  174. package/dist/core/llm/IPromptEngine.d.ts +2 -2
  175. package/dist/core/llm/IPromptEngine.d.ts.map +1 -1
  176. package/dist/core/llm/IPromptEngine.js +2 -2
  177. package/dist/core/llm/IPromptEngine.js.map +1 -1
  178. package/dist/core/llm/providers/AIModelProviderManager.d.ts +7 -1
  179. package/dist/core/llm/providers/AIModelProviderManager.d.ts.map +1 -1
  180. package/dist/core/llm/providers/AIModelProviderManager.js +24 -0
  181. package/dist/core/llm/providers/AIModelProviderManager.js.map +1 -1
  182. package/dist/core/llm/providers/errors/AnthropicProviderError.d.ts +42 -0
  183. package/dist/core/llm/providers/errors/AnthropicProviderError.d.ts.map +1 -0
  184. package/dist/core/llm/providers/errors/AnthropicProviderError.js +45 -0
  185. package/dist/core/llm/providers/errors/AnthropicProviderError.js.map +1 -0
  186. package/dist/core/llm/providers/errors/GeminiProviderError.d.ts +45 -0
  187. package/dist/core/llm/providers/errors/GeminiProviderError.d.ts.map +1 -0
  188. package/dist/core/llm/providers/errors/GeminiProviderError.js +46 -0
  189. package/dist/core/llm/providers/errors/GeminiProviderError.js.map +1 -0
  190. package/dist/core/llm/providers/errors/OllamaProviderError.d.ts +1 -1
  191. package/dist/core/llm/providers/errors/OllamaProviderError.d.ts.map +1 -1
  192. package/dist/core/llm/providers/errors/OllamaProviderError.js +1 -1
  193. package/dist/core/llm/providers/errors/OllamaProviderError.js.map +1 -1
  194. package/dist/core/llm/providers/errors/OpenAIProviderError.d.ts +1 -1
  195. package/dist/core/llm/providers/errors/OpenAIProviderError.js +1 -1
  196. package/dist/core/llm/providers/errors/OpenRouterProviderError.d.ts +1 -1
  197. package/dist/core/llm/providers/errors/OpenRouterProviderError.js +1 -1
  198. package/dist/core/llm/providers/implementations/AnthropicProvider.d.ts +340 -0
  199. package/dist/core/llm/providers/implementations/AnthropicProvider.d.ts.map +1 -0
  200. package/dist/core/llm/providers/implementations/AnthropicProvider.js +959 -0
  201. package/dist/core/llm/providers/implementations/AnthropicProvider.js.map +1 -0
  202. package/dist/core/llm/providers/implementations/GeminiProvider.d.ts +339 -0
  203. package/dist/core/llm/providers/implementations/GeminiProvider.d.ts.map +1 -0
  204. package/dist/core/llm/providers/implementations/GeminiProvider.js +1004 -0
  205. package/dist/core/llm/providers/implementations/GeminiProvider.js.map +1 -0
  206. package/dist/core/llm/providers/implementations/GroqProvider.d.ts +105 -0
  207. package/dist/core/llm/providers/implementations/GroqProvider.d.ts.map +1 -0
  208. package/dist/core/llm/providers/implementations/GroqProvider.js +134 -0
  209. package/dist/core/llm/providers/implementations/GroqProvider.js.map +1 -0
  210. package/dist/core/llm/providers/implementations/MistralProvider.d.ts +105 -0
  211. package/dist/core/llm/providers/implementations/MistralProvider.d.ts.map +1 -0
  212. package/dist/core/llm/providers/implementations/MistralProvider.js +146 -0
  213. package/dist/core/llm/providers/implementations/MistralProvider.js.map +1 -0
  214. package/dist/core/llm/providers/implementations/TogetherProvider.d.ts +107 -0
  215. package/dist/core/llm/providers/implementations/TogetherProvider.d.ts.map +1 -0
  216. package/dist/core/llm/providers/implementations/TogetherProvider.js +138 -0
  217. package/dist/core/llm/providers/implementations/TogetherProvider.js.map +1 -0
  218. package/dist/core/llm/providers/implementations/XAIProvider.d.ts +102 -0
  219. package/dist/core/llm/providers/implementations/XAIProvider.d.ts.map +1 -0
  220. package/dist/core/llm/providers/implementations/XAIProvider.js +123 -0
  221. package/dist/core/llm/providers/implementations/XAIProvider.js.map +1 -0
  222. package/dist/core/orchestration/AgentOrchestrator.d.ts.map +1 -1
  223. package/dist/core/orchestration/AgentOrchestrator.js +26 -5
  224. package/dist/core/orchestration/AgentOrchestrator.js.map +1 -1
  225. package/dist/core/tools/IToolOrchestrator.d.ts +2 -2
  226. package/dist/core/tools/IToolOrchestrator.d.ts.map +1 -1
  227. package/dist/core/tools/ToolExecutor.d.ts +3 -0
  228. package/dist/core/tools/ToolExecutor.d.ts.map +1 -1
  229. package/dist/core/tools/ToolExecutor.js +2 -1
  230. package/dist/core/tools/ToolExecutor.js.map +1 -1
  231. package/dist/core/tools/ToolOrchestrator.d.ts +7 -7
  232. package/dist/core/tools/ToolOrchestrator.d.ts.map +1 -1
  233. package/dist/core/tools/ToolOrchestrator.js +135 -36
  234. package/dist/core/tools/ToolOrchestrator.js.map +1 -1
  235. package/dist/core/tools/permissions/ToolPermissionManager.d.ts +6 -5
  236. package/dist/core/tools/permissions/ToolPermissionManager.d.ts.map +1 -1
  237. package/dist/core/tools/permissions/ToolPermissionManager.js +47 -21
  238. package/dist/core/tools/permissions/ToolPermissionManager.js.map +1 -1
  239. package/dist/core/vision/VisionPipeline.d.ts +437 -0
  240. package/dist/core/vision/VisionPipeline.d.ts.map +1 -0
  241. package/dist/core/vision/VisionPipeline.js +1113 -0
  242. package/dist/core/vision/VisionPipeline.js.map +1 -0
  243. package/dist/core/vision/index.d.ts +97 -0
  244. package/dist/core/vision/index.d.ts.map +1 -0
  245. package/dist/core/vision/index.js +182 -0
  246. package/dist/core/vision/index.js.map +1 -0
  247. package/dist/core/vision/providers/LLMVisionProvider.d.ts +135 -0
  248. package/dist/core/vision/providers/LLMVisionProvider.d.ts.map +1 -0
  249. package/dist/core/vision/providers/LLMVisionProvider.js +136 -0
  250. package/dist/core/vision/providers/LLMVisionProvider.js.map +1 -0
  251. package/dist/core/vision/providers/PipelineVisionProvider.d.ts +154 -0
  252. package/dist/core/vision/providers/PipelineVisionProvider.d.ts.map +1 -0
  253. package/dist/core/vision/providers/PipelineVisionProvider.js +160 -0
  254. package/dist/core/vision/providers/PipelineVisionProvider.js.map +1 -0
  255. package/dist/core/vision/types.d.ts +286 -0
  256. package/dist/core/vision/types.d.ts.map +1 -0
  257. package/dist/core/vision/types.js +24 -0
  258. package/dist/core/vision/types.js.map +1 -0
  259. package/dist/discovery/CapabilityDiscoveryEngine.d.ts +1 -1
  260. package/dist/discovery/CapabilityDiscoveryEngine.d.ts.map +1 -1
  261. package/dist/discovery/CapabilityDiscoveryEngine.js +1 -1
  262. package/dist/discovery/CapabilityDiscoveryEngine.js.map +1 -1
  263. package/dist/emergent/ComposableToolBuilder.d.ts +15 -4
  264. package/dist/emergent/ComposableToolBuilder.d.ts.map +1 -1
  265. package/dist/emergent/ComposableToolBuilder.js +29 -14
  266. package/dist/emergent/ComposableToolBuilder.js.map +1 -1
  267. package/dist/emergent/EmergentCapabilityEngine.d.ts +3 -3
  268. package/dist/emergent/EmergentCapabilityEngine.d.ts.map +1 -1
  269. package/dist/emergent/EmergentCapabilityEngine.js +15 -12
  270. package/dist/emergent/EmergentCapabilityEngine.js.map +1 -1
  271. package/dist/emergent/EmergentJudge.d.ts +20 -0
  272. package/dist/emergent/EmergentJudge.d.ts.map +1 -1
  273. package/dist/emergent/EmergentJudge.js +121 -26
  274. package/dist/emergent/EmergentJudge.js.map +1 -1
  275. package/dist/emergent/EmergentToolRegistry.d.ts +17 -0
  276. package/dist/emergent/EmergentToolRegistry.d.ts.map +1 -1
  277. package/dist/emergent/EmergentToolRegistry.js +26 -0
  278. package/dist/emergent/EmergentToolRegistry.js.map +1 -1
  279. package/dist/emergent/ForgeToolMetaTool.d.ts +1 -1
  280. package/dist/emergent/ForgeToolMetaTool.d.ts.map +1 -1
  281. package/dist/emergent/ForgeToolMetaTool.js +15 -2
  282. package/dist/emergent/ForgeToolMetaTool.js.map +1 -1
  283. package/dist/emergent/SandboxedToolForge.d.ts +2 -2
  284. package/dist/emergent/SandboxedToolForge.d.ts.map +1 -1
  285. package/dist/emergent/SandboxedToolForge.js +13 -23
  286. package/dist/emergent/SandboxedToolForge.js.map +1 -1
  287. package/dist/emergent/SkillExporter.d.ts +119 -0
  288. package/dist/emergent/SkillExporter.d.ts.map +1 -0
  289. package/dist/emergent/SkillExporter.js +344 -0
  290. package/dist/emergent/SkillExporter.js.map +1 -0
  291. package/dist/emergent/index.d.ts +1 -0
  292. package/dist/emergent/index.d.ts.map +1 -1
  293. package/dist/emergent/index.js +1 -0
  294. package/dist/emergent/index.js.map +1 -1
  295. package/dist/emergent/types.d.ts +4 -4
  296. package/dist/index.d.ts +30 -5
  297. package/dist/index.d.ts.map +1 -1
  298. package/dist/index.js +19 -2
  299. package/dist/index.js.map +1 -1
  300. package/dist/memory/index.d.ts +10 -8
  301. package/dist/memory/index.d.ts.map +1 -1
  302. package/dist/memory/index.js +2 -0
  303. package/dist/memory/index.js.map +1 -1
  304. package/dist/memory/ingestion/DoclingLoader.d.ts +3 -3
  305. package/dist/memory/ingestion/DoclingLoader.d.ts.map +1 -1
  306. package/dist/memory/ingestion/DoclingLoader.js +12 -8
  307. package/dist/memory/ingestion/DoclingLoader.js.map +1 -1
  308. package/dist/memory/ingestion/FolderScanner.d.ts +7 -7
  309. package/dist/memory/ingestion/FolderScanner.d.ts.map +1 -1
  310. package/dist/memory/ingestion/FolderScanner.js +6 -6
  311. package/dist/memory/ingestion/FolderScanner.js.map +1 -1
  312. package/dist/memory/ingestion/LoaderRegistry.d.ts +8 -8
  313. package/dist/memory/ingestion/LoaderRegistry.d.ts.map +1 -1
  314. package/dist/memory/ingestion/LoaderRegistry.js +9 -11
  315. package/dist/memory/ingestion/LoaderRegistry.js.map +1 -1
  316. package/dist/memory/ingestion/MultimodalAggregator.d.ts +1 -1
  317. package/dist/memory/ingestion/MultimodalAggregator.js +1 -1
  318. package/dist/memory/ingestion/OcrPdfLoader.d.ts +2 -2
  319. package/dist/memory/ingestion/OcrPdfLoader.d.ts.map +1 -1
  320. package/dist/memory/ingestion/OcrPdfLoader.js +12 -8
  321. package/dist/memory/ingestion/OcrPdfLoader.js.map +1 -1
  322. package/dist/memory/ingestion/PdfLoader.d.ts +8 -8
  323. package/dist/memory/ingestion/PdfLoader.d.ts.map +1 -1
  324. package/dist/memory/ingestion/PdfLoader.js +13 -10
  325. package/dist/memory/ingestion/PdfLoader.js.map +1 -1
  326. package/dist/memory/io/MarkdownExporter.d.ts +1 -1
  327. package/dist/memory/io/MarkdownExporter.d.ts.map +1 -1
  328. package/dist/memory/io/MarkdownExporter.js +1 -1
  329. package/dist/memory/io/MarkdownExporter.js.map +1 -1
  330. package/dist/memory/tools/MemoryAddTool.d.ts +2 -2
  331. package/dist/memory/tools/MemoryAddTool.d.ts.map +1 -1
  332. package/dist/memory/tools/MemoryAddTool.js +8 -3
  333. package/dist/memory/tools/MemoryAddTool.js.map +1 -1
  334. package/dist/memory/tools/MemorySearchTool.d.ts +3 -3
  335. package/dist/memory/tools/MemorySearchTool.d.ts.map +1 -1
  336. package/dist/memory/tools/MemorySearchTool.js +11 -9
  337. package/dist/memory/tools/MemorySearchTool.js.map +1 -1
  338. package/dist/memory/tools/scopeContext.d.ts +11 -0
  339. package/dist/memory/tools/scopeContext.d.ts.map +1 -0
  340. package/dist/memory/tools/scopeContext.js +46 -0
  341. package/dist/memory/tools/scopeContext.js.map +1 -0
  342. package/dist/orchestration/builders/AgentGraph.d.ts +12 -11
  343. package/dist/orchestration/builders/AgentGraph.d.ts.map +1 -1
  344. package/dist/orchestration/builders/AgentGraph.js +12 -11
  345. package/dist/orchestration/builders/AgentGraph.js.map +1 -1
  346. package/dist/orchestration/builders/VoiceNodeBuilder.d.ts +2 -2
  347. package/dist/orchestration/builders/VoiceNodeBuilder.d.ts.map +1 -1
  348. package/dist/orchestration/builders/VoiceNodeBuilder.js +2 -2
  349. package/dist/orchestration/builders/VoiceNodeBuilder.js.map +1 -1
  350. package/dist/orchestration/builders/WorkflowBuilder.d.ts +1 -1
  351. package/dist/orchestration/builders/WorkflowBuilder.d.ts.map +1 -1
  352. package/dist/orchestration/builders/WorkflowBuilder.js +1 -1
  353. package/dist/orchestration/builders/WorkflowBuilder.js.map +1 -1
  354. package/dist/orchestration/checkpoint/InMemoryCheckpointStore.d.ts +7 -54
  355. package/dist/orchestration/checkpoint/InMemoryCheckpointStore.d.ts.map +1 -1
  356. package/dist/orchestration/checkpoint/InMemoryCheckpointStore.js +8 -56
  357. package/dist/orchestration/checkpoint/InMemoryCheckpointStore.js.map +1 -1
  358. package/dist/orchestration/events/GraphEvent.d.ts +12 -12
  359. package/dist/orchestration/events/GraphEvent.d.ts.map +1 -1
  360. package/dist/orchestration/events/GraphEvent.js.map +1 -1
  361. package/dist/orchestration/runtime/GraphRuntime.d.ts.map +1 -1
  362. package/dist/orchestration/runtime/GraphRuntime.js +151 -1
  363. package/dist/orchestration/runtime/GraphRuntime.js.map +1 -1
  364. package/dist/orchestration/runtime/LoopController.d.ts +3 -3
  365. package/dist/orchestration/runtime/LoopController.d.ts.map +1 -1
  366. package/dist/orchestration/runtime/LoopController.js.map +1 -1
  367. package/dist/orchestration/runtime/StateManager.d.ts +3 -3
  368. package/dist/orchestration/runtime/StateManager.js +3 -3
  369. package/dist/orchestration/runtime/VoiceNodeExecutor.d.ts +6 -6
  370. package/dist/orchestration/runtime/VoiceNodeExecutor.d.ts.map +1 -1
  371. package/dist/orchestration/runtime/VoiceNodeExecutor.js +27 -10
  372. package/dist/orchestration/runtime/VoiceNodeExecutor.js.map +1 -1
  373. package/dist/orchestration/runtime/VoiceTransportAdapter.d.ts +5 -5
  374. package/dist/orchestration/runtime/VoiceTransportAdapter.js +5 -5
  375. package/dist/orchestration/runtime/VoiceTurnCollector.d.ts +2 -2
  376. package/dist/orchestration/runtime/VoiceTurnCollector.js +2 -2
  377. package/dist/query-router/KeywordFallback.d.ts +70 -0
  378. package/dist/query-router/KeywordFallback.d.ts.map +1 -0
  379. package/dist/query-router/KeywordFallback.js +132 -0
  380. package/dist/query-router/KeywordFallback.js.map +1 -0
  381. package/dist/query-router/QueryClassifier.d.ts +140 -0
  382. package/dist/query-router/QueryClassifier.d.ts.map +1 -0
  383. package/dist/query-router/QueryClassifier.js +223 -0
  384. package/dist/query-router/QueryClassifier.js.map +1 -0
  385. package/dist/query-router/QueryDispatcher.d.ts +139 -0
  386. package/dist/query-router/QueryDispatcher.d.ts.map +1 -0
  387. package/dist/query-router/QueryDispatcher.js +297 -0
  388. package/dist/query-router/QueryDispatcher.js.map +1 -0
  389. package/dist/query-router/QueryGenerator.d.ts +184 -0
  390. package/dist/query-router/QueryGenerator.d.ts.map +1 -0
  391. package/dist/query-router/QueryGenerator.js +241 -0
  392. package/dist/query-router/QueryGenerator.js.map +1 -0
  393. package/dist/query-router/QueryRouter.d.ts +292 -0
  394. package/dist/query-router/QueryRouter.d.ts.map +1 -0
  395. package/dist/query-router/QueryRouter.js +803 -0
  396. package/dist/query-router/QueryRouter.js.map +1 -0
  397. package/dist/query-router/TopicExtractor.d.ts +73 -0
  398. package/dist/query-router/TopicExtractor.d.ts.map +1 -0
  399. package/dist/query-router/TopicExtractor.js +95 -0
  400. package/dist/query-router/TopicExtractor.js.map +1 -0
  401. package/dist/query-router/index.d.ts +40 -0
  402. package/dist/query-router/index.d.ts.map +1 -0
  403. package/dist/query-router/index.js +46 -0
  404. package/dist/query-router/index.js.map +1 -0
  405. package/dist/query-router/types.d.ts +508 -0
  406. package/dist/query-router/types.d.ts.map +1 -0
  407. package/dist/query-router/types.js +39 -0
  408. package/dist/query-router/types.js.map +1 -0
  409. package/dist/rag/index.d.ts +5 -0
  410. package/dist/rag/index.d.ts.map +1 -1
  411. package/dist/rag/index.js +7 -0
  412. package/dist/rag/index.js.map +1 -1
  413. package/dist/rag/multimodal/LLMVisionAdapter.d.ts +43 -0
  414. package/dist/rag/multimodal/LLMVisionAdapter.d.ts.map +1 -0
  415. package/dist/rag/multimodal/LLMVisionAdapter.js +46 -0
  416. package/dist/rag/multimodal/LLMVisionAdapter.js.map +1 -0
  417. package/dist/rag/multimodal/MultimodalIndexer.d.ts +244 -0
  418. package/dist/rag/multimodal/MultimodalIndexer.d.ts.map +1 -0
  419. package/dist/rag/multimodal/MultimodalIndexer.js +411 -0
  420. package/dist/rag/multimodal/MultimodalIndexer.js.map +1 -0
  421. package/dist/rag/multimodal/MultimodalMemoryBridge.d.ts +448 -0
  422. package/dist/rag/multimodal/MultimodalMemoryBridge.d.ts.map +1 -0
  423. package/dist/rag/multimodal/MultimodalMemoryBridge.js +941 -0
  424. package/dist/rag/multimodal/MultimodalMemoryBridge.js.map +1 -0
  425. package/dist/rag/multimodal/SpeechProviderAdapter.d.ts +139 -0
  426. package/dist/rag/multimodal/SpeechProviderAdapter.d.ts.map +1 -0
  427. package/dist/rag/multimodal/SpeechProviderAdapter.js +143 -0
  428. package/dist/rag/multimodal/SpeechProviderAdapter.js.map +1 -0
  429. package/dist/rag/multimodal/createMultimodalIndexerFromResolver.d.ts +172 -0
  430. package/dist/rag/multimodal/createMultimodalIndexerFromResolver.d.ts.map +1 -0
  431. package/dist/rag/multimodal/createMultimodalIndexerFromResolver.js +152 -0
  432. package/dist/rag/multimodal/createMultimodalIndexerFromResolver.js.map +1 -0
  433. package/dist/rag/multimodal/index.d.ts +44 -0
  434. package/dist/rag/multimodal/index.d.ts.map +1 -0
  435. package/dist/rag/multimodal/index.js +42 -0
  436. package/dist/rag/multimodal/index.js.map +1 -0
  437. package/dist/rag/multimodal/types.d.ts +276 -0
  438. package/dist/rag/multimodal/types.d.ts.map +1 -0
  439. package/dist/rag/multimodal/types.js +26 -0
  440. package/dist/rag/multimodal/types.js.map +1 -0
  441. package/dist/social-posting/SocialPostManager.d.ts +3 -3
  442. package/dist/social-posting/SocialPostManager.d.ts.map +1 -1
  443. package/dist/social-posting/SocialPostManager.js +3 -5
  444. package/dist/social-posting/SocialPostManager.js.map +1 -1
  445. package/dist/speech/FallbackProxy.d.ts +6 -6
  446. package/dist/speech/FallbackProxy.d.ts.map +1 -1
  447. package/dist/speech/FallbackProxy.js +3 -3
  448. package/dist/speech/FallbackProxy.js.map +1 -1
  449. package/dist/speech/SpeechProviderResolver.d.ts +8 -8
  450. package/dist/speech/SpeechProviderResolver.d.ts.map +1 -1
  451. package/dist/speech/SpeechProviderResolver.js +22 -11
  452. package/dist/speech/SpeechProviderResolver.js.map +1 -1
  453. package/dist/speech/SpeechRuntime.d.ts +1 -5
  454. package/dist/speech/SpeechRuntime.d.ts.map +1 -1
  455. package/dist/speech/SpeechRuntime.js +17 -9
  456. package/dist/speech/SpeechRuntime.js.map +1 -1
  457. package/dist/speech/providers/AssemblyAISTTProvider.d.ts +4 -4
  458. package/dist/speech/providers/AssemblyAISTTProvider.js +4 -4
  459. package/dist/speech/providers/AzureSpeechTTSProvider.d.ts +3 -3
  460. package/dist/speech/providers/AzureSpeechTTSProvider.js +2 -2
  461. package/dist/speech/providers/AzureSpeechTTSProvider.js.map +1 -1
  462. package/dist/speech/providers/BuiltInAdaptiveVadProvider.d.ts +9 -9
  463. package/dist/speech/providers/BuiltInAdaptiveVadProvider.d.ts.map +1 -1
  464. package/dist/speech/providers/BuiltInAdaptiveVadProvider.js +5 -5
  465. package/dist/speech/providers/BuiltInAdaptiveVadProvider.js.map +1 -1
  466. package/dist/speech/providers/DeepgramBatchSTTProvider.d.ts +2 -2
  467. package/dist/speech/providers/DeepgramBatchSTTProvider.js +2 -2
  468. package/dist/speech/providers/OpenAITextToSpeechProvider.d.ts +3 -3
  469. package/dist/speech/providers/OpenAITextToSpeechProvider.js +2 -2
  470. package/dist/speech/providers/OpenAIWhisperSpeechToTextProvider.d.ts +1 -1
  471. package/dist/speech/providers/OpenAIWhisperSpeechToTextProvider.d.ts.map +1 -1
  472. package/dist/speech/providers/OpenAIWhisperSpeechToTextProvider.js +1 -1
  473. package/dist/speech/providers/OpenAIWhisperSpeechToTextProvider.js.map +1 -1
  474. package/dist/voice/TelephonyStreamTransport.d.ts +6 -6
  475. package/dist/voice/TelephonyStreamTransport.d.ts.map +1 -1
  476. package/dist/voice/TelephonyStreamTransport.js +5 -5
  477. package/dist/voice/TelephonyStreamTransport.js.map +1 -1
  478. package/dist/voice-pipeline/AcousticEndpointDetector.d.ts +4 -4
  479. package/dist/voice-pipeline/AcousticEndpointDetector.d.ts.map +1 -1
  480. package/dist/voice-pipeline/AcousticEndpointDetector.js +4 -4
  481. package/dist/voice-pipeline/AcousticEndpointDetector.js.map +1 -1
  482. package/dist/voice-pipeline/HardCutBargeinHandler.d.ts +3 -3
  483. package/dist/voice-pipeline/HardCutBargeinHandler.js +3 -3
  484. package/dist/voice-pipeline/HeuristicEndpointDetector.d.ts +3 -3
  485. package/dist/voice-pipeline/HeuristicEndpointDetector.d.ts.map +1 -1
  486. package/dist/voice-pipeline/HeuristicEndpointDetector.js +3 -3
  487. package/dist/voice-pipeline/HeuristicEndpointDetector.js.map +1 -1
  488. package/dist/voice-pipeline/SoftFadeBargeinHandler.d.ts +5 -5
  489. package/dist/voice-pipeline/SoftFadeBargeinHandler.js +1 -1
  490. package/dist/voice-pipeline/VoiceInterruptError.d.ts +6 -6
  491. package/dist/voice-pipeline/VoiceInterruptError.d.ts.map +1 -1
  492. package/dist/voice-pipeline/VoiceInterruptError.js +4 -4
  493. package/dist/voice-pipeline/VoiceInterruptError.js.map +1 -1
  494. package/dist/voice-pipeline/VoicePipelineOrchestrator.d.ts +9 -9
  495. package/dist/voice-pipeline/VoicePipelineOrchestrator.d.ts.map +1 -1
  496. package/dist/voice-pipeline/VoicePipelineOrchestrator.js +8 -8
  497. package/dist/voice-pipeline/VoicePipelineOrchestrator.js.map +1 -1
  498. package/dist/voice-pipeline/WebRTCStreamTransport.d.ts +421 -0
  499. package/dist/voice-pipeline/WebRTCStreamTransport.d.ts.map +1 -0
  500. package/dist/voice-pipeline/WebRTCStreamTransport.js +573 -0
  501. package/dist/voice-pipeline/WebRTCStreamTransport.js.map +1 -0
  502. package/dist/voice-pipeline/WebSocketStreamTransport.d.ts +8 -8
  503. package/dist/voice-pipeline/WebSocketStreamTransport.js +5 -5
  504. package/dist/voice-pipeline/index.d.ts +1 -0
  505. package/dist/voice-pipeline/index.d.ts.map +1 -1
  506. package/dist/voice-pipeline/index.js +2 -0
  507. package/dist/voice-pipeline/index.js.map +1 -1
  508. package/dist/voice-pipeline/types.d.ts +43 -43
  509. package/dist/voice-pipeline/types.d.ts.map +1 -1
  510. package/package.json +19 -1
@@ -164,10 +164,15 @@ export class ToolOrchestrator {
164
164
  console.log(`ToolOrchestrator (ID: ${this.orchestratorId}) initialized. Registered tools: ${this.toolExecutor.listAvailableTools().length}. Logging tool calls: ${this.config.logToolCalls}.`);
165
165
  }
166
166
  async registerInitialTool(tool) {
167
- if (!tool || typeof tool.name !== 'string' || !tool.name.trim() || typeof tool.id !== 'string' || !tool.id.trim()) {
167
+ if (!tool ||
168
+ typeof tool.name !== 'string' ||
169
+ !tool.name.trim() ||
170
+ typeof tool.id !== 'string' ||
171
+ !tool.id.trim()) {
168
172
  throw new GMIError("Tool registration failed: The provided tool object is invalid or missing required 'id' or 'name' properties.", GMIErrorCode.INVALID_ARGUMENT, { receivedToolDetails: { id: tool?.id, name: tool?.name } });
169
173
  }
170
- if (this.config.globalDisabledTools?.includes(tool.name) || this.config.globalDisabledTools?.includes(tool.id)) {
174
+ if (this.config.globalDisabledTools?.includes(tool.name) ||
175
+ this.config.globalDisabledTools?.includes(tool.id)) {
171
176
  console.warn(`ToolOrchestrator (ID: ${this.orchestratorId}): Registering tool '${tool.name}' (ID: '${tool.id}'), but it is listed as globally disabled. It may not be executable.`);
172
177
  }
173
178
  await this.toolExecutor.registerTool(tool);
@@ -179,7 +184,10 @@ export class ToolOrchestrator {
179
184
  return 'financial';
180
185
  if (raw.includes('comm') || raw.includes('email') || raw.includes('sms'))
181
186
  return 'communication';
182
- if (raw.includes('file') || raw.includes('storage') || raw.includes('db') || raw.includes('data'))
187
+ if (raw.includes('file') ||
188
+ raw.includes('storage') ||
189
+ raw.includes('db') ||
190
+ raw.includes('data'))
183
191
  return 'data_modification';
184
192
  if (raw.includes('network') || raw.includes('api') || raw.includes('web'))
185
193
  return 'external_api';
@@ -203,12 +211,17 @@ export class ToolOrchestrator {
203
211
  async registerTool(tool) {
204
212
  this.ensureInitialized();
205
213
  if (!this.config.toolRegistrySettings.allowDynamicRegistration) {
206
- throw new GMIError("Dynamic tool registration is disabled by the current ToolOrchestrator configuration.", GMIErrorCode.PERMISSION_DENIED, { toolName: tool?.name, orchestratorId: this.orchestratorId });
214
+ throw new GMIError('Dynamic tool registration is disabled by the current ToolOrchestrator configuration.', GMIErrorCode.PERMISSION_DENIED, { toolName: tool?.name, orchestratorId: this.orchestratorId });
207
215
  }
208
- if (!tool || typeof tool.name !== 'string' || !tool.name.trim() || typeof tool.id !== 'string' || !tool.id.trim()) {
216
+ if (!tool ||
217
+ typeof tool.name !== 'string' ||
218
+ !tool.name.trim() ||
219
+ typeof tool.id !== 'string' ||
220
+ !tool.id.trim()) {
209
221
  throw new GMIError("Tool registration failed: The provided tool object is invalid or missing required 'id' or 'name' properties.", GMIErrorCode.INVALID_ARGUMENT, { receivedToolDetails: { id: tool?.id, name: tool?.name } });
210
222
  }
211
- if (this.config.globalDisabledTools?.includes(tool.name) || this.config.globalDisabledTools?.includes(tool.id)) {
223
+ if (this.config.globalDisabledTools?.includes(tool.name) ||
224
+ this.config.globalDisabledTools?.includes(tool.id)) {
212
225
  console.warn(`ToolOrchestrator (ID: ${this.orchestratorId}): Registering tool '${tool.name}' (ID: '${tool.id}'), but it is listed as globally disabled. It may not be executable.`);
213
226
  }
214
227
  await this.toolExecutor.registerTool(tool);
@@ -220,7 +233,7 @@ export class ToolOrchestrator {
220
233
  async unregisterTool(toolName) {
221
234
  this.ensureInitialized();
222
235
  if (!this.config.toolRegistrySettings.allowDynamicRegistration) {
223
- throw new GMIError("Dynamic tool unregistration is disabled by the current ToolOrchestrator configuration.", GMIErrorCode.PERMISSION_DENIED, { toolName, orchestratorId: this.orchestratorId });
236
+ throw new GMIError('Dynamic tool unregistration is disabled by the current ToolOrchestrator configuration.', GMIErrorCode.PERMISSION_DENIED, { toolName, orchestratorId: this.orchestratorId });
224
237
  }
225
238
  const success = await this.toolExecutor.unregisterTool(toolName);
226
239
  if (success) {
@@ -316,22 +329,31 @@ export class ToolOrchestrator {
316
329
  return allTools.filter((tool) => discoveredToolNames.has(tool.name));
317
330
  }
318
331
  /**
319
- * @inheritdoc
320
- */
332
+ * @inheritdoc
333
+ */
321
334
  async processToolCall(requestDetails) {
322
335
  this.ensureInitialized();
323
336
  const { toolCallRequest, gmiId, personaId, personaCapabilities, userContext } = requestDetails;
324
337
  // Check if toolCallRequest and toolCallRequest.name are valid
325
338
  if (!toolCallRequest || !toolCallRequest.name || typeof toolCallRequest.name !== 'string') {
326
339
  const errorMsg = "Invalid ToolCallRequest: 'name' is missing or not a string.";
327
- console.error(`ToolOrchestrator (ID: ${this.orchestratorId}): ${errorMsg}`, { requestDetails });
328
- return { toolCallId: toolCallRequest?.id || `invalid-call-${uuidv4()}`, toolName: "unknown", output: null, isError: true, errorDetails: { message: errorMsg, code: GMIErrorCode.VALIDATION_ERROR } };
340
+ console.error(`ToolOrchestrator (ID: ${this.orchestratorId}): ${errorMsg}`, {
341
+ requestDetails,
342
+ });
343
+ return {
344
+ toolCallId: toolCallRequest?.id || `invalid-call-${uuidv4()}`,
345
+ toolName: 'unknown',
346
+ output: null,
347
+ isError: true,
348
+ errorDetails: { message: errorMsg, code: GMIErrorCode.VALIDATION_ERROR },
349
+ };
329
350
  }
330
351
  const toolName = toolCallRequest.name;
331
352
  const llmProvidedCallId = toolCallRequest.id;
332
353
  const logPrefix = `ToolOrchestrator (ID: ${this.orchestratorId}, GMI: ${gmiId}, Persona: ${personaId}, LLMCallID: ${llmProvidedCallId}, Tool: ${toolName}):`;
333
354
  if (this.config.logToolCalls) {
334
- const argsPreview = JSON.stringify(toolCallRequest.arguments).substring(0, 200) + (JSON.stringify(toolCallRequest.arguments).length > 200 ? '...' : '');
355
+ const argsPreview = JSON.stringify(toolCallRequest.arguments).substring(0, 200) +
356
+ (JSON.stringify(toolCallRequest.arguments).length > 200 ? '...' : '');
335
357
  console.log(`${logPrefix} Received tool call request. Arguments preview: ${argsPreview}`);
336
358
  }
337
359
  if (this.config.globalDisabledTools?.includes(toolName)) {
@@ -342,21 +364,48 @@ export class ToolOrchestrator {
342
364
  toolName,
343
365
  output: null,
344
366
  isError: true,
345
- errorDetails: { message: errorMsg, code: GMIErrorCode.PERMISSION_DENIED, reason: "Tool is globally disabled." },
367
+ errorDetails: {
368
+ message: errorMsg,
369
+ code: GMIErrorCode.PERMISSION_DENIED,
370
+ reason: 'Tool is globally disabled.',
371
+ },
346
372
  };
347
373
  }
348
374
  const tool = await this.getTool(toolName);
349
375
  if (!tool) {
350
376
  const errorMsg = `Tool '${toolName}' not found in orchestrator's tool registry.`;
351
377
  console.error(`${logPrefix} ${errorMsg}`);
352
- return { toolCallId: llmProvidedCallId, toolName, output: null, isError: true, errorDetails: { message: errorMsg, code: GMIErrorCode.TOOL_NOT_FOUND } };
378
+ return {
379
+ toolCallId: llmProvidedCallId,
380
+ toolName,
381
+ output: null,
382
+ isError: true,
383
+ errorDetails: { message: errorMsg, code: GMIErrorCode.TOOL_NOT_FOUND },
384
+ };
353
385
  }
354
- if (this.config.globalDisabledTools?.includes(tool.name) || this.config.globalDisabledTools?.includes(tool.id)) {
386
+ if (this.config.globalDisabledTools?.includes(tool.name) ||
387
+ this.config.globalDisabledTools?.includes(tool.id)) {
355
388
  const errorMsg = `Attempted to execute globally disabled tool '${toolName}' (ID: '${tool.id}'). Execution denied.`;
356
389
  console.warn(`${logPrefix} ${errorMsg}`);
357
- return { toolCallId: llmProvidedCallId, toolName, output: null, isError: true, errorDetails: { message: errorMsg, code: GMIErrorCode.PERMISSION_DENIED, reason: "Tool is globally disabled." } };
390
+ return {
391
+ toolCallId: llmProvidedCallId,
392
+ toolName,
393
+ output: null,
394
+ isError: true,
395
+ errorDetails: {
396
+ message: errorMsg,
397
+ code: GMIErrorCode.PERMISSION_DENIED,
398
+ reason: 'Tool is globally disabled.',
399
+ },
400
+ };
358
401
  }
359
- const permissionContext = { tool, personaId, personaCapabilities, userContext, gmiId };
402
+ const permissionContext = {
403
+ tool,
404
+ personaId,
405
+ personaCapabilities,
406
+ userContext,
407
+ gmiId,
408
+ };
360
409
  let permissionResult;
361
410
  try {
362
411
  permissionResult = await this.permissionManager.isExecutionAllowed(permissionContext);
@@ -365,12 +414,33 @@ export class ToolOrchestrator {
365
414
  const errorMsg = `An unexpected error occurred during permission check for tool '${toolName}'.`;
366
415
  console.error(`${logPrefix} ${errorMsg}`, permError);
367
416
  const wrappedError = createGMIErrorFromError(permError, GMIErrorCode.PERMISSION_DENIED, permissionContext, errorMsg);
368
- return { toolCallId: llmProvidedCallId, toolName, output: null, isError: true, errorDetails: { message: wrappedError.message, code: wrappedError.code, details: wrappedError.details } };
417
+ return {
418
+ toolCallId: llmProvidedCallId,
419
+ toolName,
420
+ output: null,
421
+ isError: true,
422
+ errorDetails: {
423
+ message: wrappedError.message,
424
+ code: wrappedError.code,
425
+ details: wrappedError.details,
426
+ },
427
+ };
369
428
  }
370
429
  if (!permissionResult.isAllowed) {
371
- const errorMsg = permissionResult.reason || `Permission denied by ToolPermissionManager for tool '${toolName}'.`;
430
+ const errorMsg = permissionResult.reason ||
431
+ `Permission denied by ToolPermissionManager for tool '${toolName}'.`;
372
432
  console.warn(`${logPrefix} ${errorMsg}`, permissionResult.details);
373
- return { toolCallId: llmProvidedCallId, toolName, output: null, isError: true, errorDetails: { message: errorMsg, code: GMIErrorCode.PERMISSION_DENIED, details: permissionResult.details } };
433
+ return {
434
+ toolCallId: llmProvidedCallId,
435
+ toolName,
436
+ output: null,
437
+ isError: true,
438
+ errorDetails: {
439
+ message: errorMsg,
440
+ code: GMIErrorCode.PERMISSION_DENIED,
441
+ details: permissionResult.details,
442
+ },
443
+ };
374
444
  }
375
445
  // Optional HITL gating for side-effect tools.
376
446
  const hitlConfig = this.config.hitl;
@@ -480,10 +550,23 @@ export class ToolOrchestrator {
480
550
  const errorMsg = `Critical error within ToolExecutor's internal pipeline while processing '${toolName}'. This is not an error from the tool's execute method itself.`;
481
551
  console.error(`${logPrefix} ${errorMsg}`, executorPipelineError);
482
552
  const wrappedError = createGMIErrorFromError(executorPipelineError, GMIErrorCode.TOOL_EXECUTION_FAILED, requestDetails, errorMsg);
483
- return { toolCallId: llmProvidedCallId, toolName, output: null, isError: true, errorDetails: { message: wrappedError.message, code: wrappedError.code, details: wrappedError.details } };
553
+ return {
554
+ toolCallId: llmProvidedCallId,
555
+ toolName,
556
+ output: null,
557
+ isError: true,
558
+ errorDetails: {
559
+ message: wrappedError.message,
560
+ code: wrappedError.code,
561
+ details: wrappedError.details,
562
+ },
563
+ };
484
564
  }
485
565
  if (this.config.logToolCalls) {
486
- const outputPreview = coreExecutorResult.output ? JSON.stringify(coreExecutorResult.output).substring(0, 150) + (JSON.stringify(coreExecutorResult.output).length > 150 ? '...' : '') : 'N/A';
566
+ const outputPreview = coreExecutorResult.output
567
+ ? JSON.stringify(coreExecutorResult.output).substring(0, 150) +
568
+ (JSON.stringify(coreExecutorResult.output).length > 150 ? '...' : '')
569
+ : 'N/A';
487
570
  console.log(`${logPrefix} Tool '${toolName}' execution completed by executor. Success: ${coreExecutorResult.success}. Output Preview: ${outputPreview}. Error: ${coreExecutorResult.error || 'N/A'}`);
488
571
  }
489
572
  return {
@@ -491,17 +574,20 @@ export class ToolOrchestrator {
491
574
  toolName: toolName,
492
575
  output: coreExecutorResult.success ? coreExecutorResult.output : null,
493
576
  isError: !coreExecutorResult.success,
494
- errorDetails: !coreExecutorResult.success ? {
495
- message: coreExecutorResult.error || `Tool '${toolName}' reported failure without a specific error message.`,
496
- details: coreExecutorResult.details,
497
- } : undefined,
577
+ errorDetails: !coreExecutorResult.success
578
+ ? {
579
+ message: coreExecutorResult.error ||
580
+ `Tool '${toolName}' reported failure without a specific error message.`,
581
+ details: coreExecutorResult.details,
582
+ }
583
+ : undefined,
498
584
  };
499
585
  }
500
586
  // --------------------------------------------------------------------------
501
587
  // EMERGENT CAPABILITY HELPERS
502
588
  // --------------------------------------------------------------------------
503
589
  /**
504
- * Returns the underlying {@link EmergentCapabilityEngine} instance, or
590
+ * Returns the underlying emergent capability engine instance, or
505
591
  * `undefined` if emergent capabilities were not enabled at initialization.
506
592
  *
507
593
  * Callers can use this to access engine methods like `getSessionTools()`,
@@ -516,7 +602,7 @@ export class ToolOrchestrator {
516
602
  /**
517
603
  * Clean up all emergent session-scoped tools for a given session.
518
604
  *
519
- * Delegates to {@link EmergentCapabilityEngine.cleanupSession}. This should
605
+ * Delegates to the emergent engine's `cleanupSession()` method. This should
520
606
  * be called when a conversation/session ends to free session-tier tools.
521
607
  *
522
608
  * No-op if emergent capabilities are not enabled.
@@ -534,12 +620,12 @@ export class ToolOrchestrator {
534
620
  * Register a dynamically forged emergent tool with the orchestrator so the
535
621
  * agent can use it in subsequent turns within the same session.
536
622
  *
537
- * This is the bridge between the {@link EmergentCapabilityEngine} (which
538
- * stores tool metadata) and the {@link ToolOrchestrator} (which the LLM
623
+ * This is the bridge between the emergent capability engine (which
624
+ * stores tool metadata) and the `ToolOrchestrator` (which the LLM
539
625
  * tool-call pipeline queries). After forge_tool produces a new tool, call
540
626
  * this method to make it appear in `listAvailableTools()`.
541
627
  *
542
- * @param tool - An {@link ITool} instance wrapping the emergent tool.
628
+ * @param tool - An `ITool` instance wrapping the emergent tool.
543
629
  */
544
630
  async registerForgedTool(tool) {
545
631
  this.ensureInitialized();
@@ -554,22 +640,35 @@ export class ToolOrchestrator {
554
640
  */
555
641
  async checkHealth() {
556
642
  this.ensureInitialized();
557
- let pmHealth = { isHealthy: true, details: "ToolPermissionManager: Health not explicitly checked or no checkHealth method available." };
558
- if (this.permissionManager && typeof this.permissionManager.checkHealth === 'function') {
643
+ let pmHealth = {
644
+ isHealthy: true,
645
+ details: 'ToolPermissionManager: Health not explicitly checked or no checkHealth method available.',
646
+ };
647
+ if (this.permissionManager &&
648
+ typeof this.permissionManager.checkHealth === 'function') {
559
649
  try {
560
650
  pmHealth = await this.permissionManager.checkHealth();
561
651
  }
562
652
  catch (e) {
563
- pmHealth = { isHealthy: false, details: `Failed to retrieve ToolPermissionManager health: ${e.message}` };
653
+ pmHealth = {
654
+ isHealthy: false,
655
+ details: `Failed to retrieve ToolPermissionManager health: ${e.message}`,
656
+ };
564
657
  }
565
658
  }
566
- let execHealth = { isHealthy: true, details: "ToolExecutor: Health not explicitly checked or no checkHealth method available." };
659
+ let execHealth = {
660
+ isHealthy: true,
661
+ details: 'ToolExecutor: Health not explicitly checked or no checkHealth method available.',
662
+ };
567
663
  if (this.toolExecutor && typeof this.toolExecutor.checkHealth === 'function') {
568
664
  try {
569
665
  execHealth = await this.toolExecutor.checkHealth();
570
666
  }
571
667
  catch (e) {
572
- execHealth = { isHealthy: false, details: `Failed to retrieve ToolExecutor health: ${e.message}` };
668
+ execHealth = {
669
+ isHealthy: false,
670
+ details: `Failed to retrieve ToolExecutor health: ${e.message}`,
671
+ };
573
672
  }
574
673
  }
575
674
  const isOverallHealthy = this.isInitialized && pmHealth.isHealthy && execHealth.isHealthy;
@@ -1 +1 @@
1
- {"version":3,"file":"ToolOrchestrator.js","sourceRoot":"","sources":["../../../src/core/tools/ToolOrchestrator.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAUrD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAGhG,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAE9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE;;;;;;GAMG;AACH,MAAM,OAAO,gBAAgB;IA8E3B;;;;OAIG;IACH;QAxCA;;;;WAIG;QACK,kBAAa,GAAY,KAAK,CAAC;QAoCrC,IAAI,CAAC,cAAc,GAAG,aAAa,MAAM,EAAE,EAAE,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,gBAAgB,CAAC,cAAc,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,EAA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OAAO,CAAM,EAAE,CAAC;gBAChB,OAAO,CAAC,KAAK,CACX,yBAAyB,IAAI,CAAC,cAAc,kDAAkD,CAAC,CAAC,OAAO,EAAE,EACzG,CAAC,CACF,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,QAAQ;QACnB,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YACxB,OAAO,CAAC,GAAG,CACT,yBAAyB,IAAI,CAAC,cAAc,gFAAgF,CAC7H,CAAC;YACF,OAAO;QACT,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,yBAAyB,IAAI,CAAC,cAAc,oCAAoC,CAAC,CAAC;QAE9F,MAAM,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAErC,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,OAAO,CAAC,GAAG,CACT,yBAAyB,IAAI,CAAC,cAAc,8EAA8E,CAC3H,CAAC;IACJ,CAAC;;AAj4BD;;;;;;GAMG;AACqB,+BAAc,GAAqC;IACzE,cAAc,EAAE,EAAE;IAClB,wBAAwB,EAAE,KAAK;IAC/B,sBAAsB,EAAE,EAAE;IAC1B,YAAY,EAAE,IAAI;IAClB,mBAAmB,EAAE,EAAE;IACvB,oBAAoB,EAAE;QACpB,wBAAwB,EAAE,IAAI;QAC9B,eAAe,EAAE,KAAK;QACtB,eAAe,EAAE,SAAS;KAC3B;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,KAAK;QACd,6BAA6B,EAAE,IAAI;QACnC,0BAA0B,EAAE,MAAM;QAClC,iBAAiB,EAAE,SAAS;QAC5B,wBAAwB,EAAE,KAAK;KAChC;IACD,gBAAgB,EAAE,EAAE;CACrB,AAnBqC,CAmBpC"}
@@ -34,11 +34,12 @@
34
34
  * - Configuration Management: Behavior is driven by `ToolPermissionManagerConfig`.
35
35
  * - Strict Type Safety: Leverages TypeScript's type system to prevent common errors.
36
36
  *
37
- * @see {@link ./IToolPermissionManager.ts} for the interface definition and related types (including `FeatureFlag` and `ToolPermissionManagerConfig`).
38
- * @see {@link ../ITool.ts} for `ITool` and `ToolDefinition` which include `requiredCapabilities`.
39
- * @see {@link ../../../cognitive_substrate/IGMI.ts} for `UserContext` definition.
40
- * @see {@link ../../../../services/user_auth/SubscriptionService.ts} for `ISubscriptionService` and `ISubscriptionTier`.
41
- * @see {@link @framers/agentos/utils/errors.ts} for `GMIError` and `GMIErrorCode`.
37
+ * @see {@link IToolPermissionManager} for the interface definition and related types
38
+ * such as `FeatureFlag` and `ToolPermissionManagerConfig`.
39
+ * See `ITool` and `ToolDefinition` for capability-gated tool metadata.
40
+ * See `UserContext` in `IGMI` for invoking-user context.
41
+ * See `ISubscriptionService` and `ISubscriptionTier` in `services/user_auth/types`.
42
+ * See `GMIError` and `GMIErrorCode` in `@framers/agentos/utils/errors`.
42
43
  */
43
44
  import { IToolPermissionManager, PermissionCheckContext, PermissionCheckResult, ToolPermissionManagerConfig, FeatureFlag } from './IToolPermissionManager';
44
45
  import type { IAuthService, ISubscriptionService } from '../../../services/user_auth/types';
@@ -1 +1 @@
1
- {"version":3,"file":"ToolPermissionManager.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/permissions/ToolPermissionManager.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC3B,WAAW,EACZ,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAqB,MAAM,mCAAmC,CAAC;AAI/G;;;;;;;;;GASG;AACH,qBAAa,qBAAsB,YAAW,sBAAsB;IAClE;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAmD;IAEjE;;;;;;OAMG;IACH,OAAO,CAAC,WAAW,CAAC,CAAe;IAEnC;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB,CAAC,CAAuB;IAEnD;;;;;;OAMG;IACH,OAAO,CAAC,aAAa,CAAkB;IAEvC;;;;;;;OAOG;IACH,SAAgB,SAAS,EAAE,MAAM,CAAC;IAElC;;;;;OAKG;;IAKH;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACU,UAAU,CACrB,MAAM,EAAE,2BAA2B,EACnC,WAAW,CAAC,EAAE,YAAY,EAC1B,mBAAmB,CAAC,EAAE,oBAAoB,GACzC,OAAO,CAAC,IAAI,CAAC;IA+BhB;;;;;;;;;OASG;IACH,OAAO,CAAC,iBAAiB;IAUzB;;;;;;;;;;;;;;OAcG;IACI,uBAAuB,CAC5B,mBAAmB,EAAE,MAAM,EAAE,EAC7B,wBAAwB,EAAE,MAAM,EAAE,GAAG,SAAS,GAC7C,OAAO;IAqBV;;;;;;;;;;;;;OAaG;IACI,0BAA0B,CAAC,YAAY,EAAE,MAAM,GAAG,WAAW,EAAE,GAAG,SAAS;IAKlF;;;;;;;;;;;;;OAaG;IACU,2BAA2B,CACtC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC;QAAC,SAAS,EAAE,OAAO,CAAC;QAAC,eAAe,CAAC,EAAE,WAAW,EAAE,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;IAsDlF;;;;;;;;;OASG;IACU,kBAAkB,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAuDjG"}
1
+ {"version":3,"file":"ToolPermissionManager.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/permissions/ToolPermissionManager.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC3B,WAAW,EACZ,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,YAAY,EACZ,oBAAoB,EAErB,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ages TypeScript's type system to prevent common errors.
37
37
  *
38
- * @see {@link ./IToolPermissionManager.ts} for the interface definition and related types (including `FeatureFlag` and `ToolPermissionManagerConfig`).
39
- * @see {@link ../ITool.ts} for `ITool` and `ToolDefinition` which include `requiredCapabilities`.
40
- * @see {@link ../../../cognitive_substrate/IGMI.ts} for `UserContext` definition.
41
- * @see {@link ../../../../services/user_auth/SubscriptionService.ts} for `ISubscriptionService` and `ISubscriptionTier`.
42
- * @see {@link @framers/agentos/utils/errors.ts} for `GMIError` and `GMIErrorCode`.
38
+ * @see {@link IToolPermissionManager} for the interface definition and related types
39
+ * such as `FeatureFlag` and `ToolPermissionManagerConfig`.
40
+ * See `ITool` and `ToolDefinition` for capability-gated tool metadata.
41
+ * See `UserContext` in `IGMI` for invoking-user context.
42
+ * See `ISubscriptionService` and `ISubscriptionTier` in `services/user_auth/types`.
43
+ * See `GMIError` and `GMIErrorCode` in `@framers/agentos/utils/errors`.
43
44
  */
44
45
  import { GMIError, GMIErrorCode, createGMIErrorFromError } from '../../../utils/errors.js';
45
46
  import { uuidv4 } from '../../../utils/uuid.js';
@@ -109,7 +110,8 @@ export class ToolPermissionManager {
109
110
  });
110
111
  this.authService = authService;
111
112
  this.subscriptionService = subscriptionService;
112
- if (Object.keys(this.config.toolToSubscriptionFeatures).length > 0 && !this.subscriptionService) {
113
+ if (Object.keys(this.config.toolToSubscriptionFeatures).length > 0 &&
114
+ !this.subscriptionService) {
113
115
  console.warn(`ToolPermissionManager (ID: ${this.managerId}): WARNING - 'toolToSubscriptionFeatures' are configured, but no ISubscriptionService instance was provided. Subscription-based tool access checks will default to denial for tools requiring features. This might be a deployment or configuration oversight.`);
114
116
  }
115
117
  this.isInitialized = true;
@@ -127,7 +129,11 @@ export class ToolPermissionManager {
127
129
  */
128
130
  ensureInitialized() {
129
131
  if (!this.isInitialized) {
130
- throw new GMIError(`ToolPermissionManager (ID: ${this.managerId}) is not initialized. Operations cannot be performed until initialize() is called with a valid configuration.`, GMIErrorCode.NOT_INITIALIZED, { component: 'ToolPermissionManager', managerId: this.managerId, attemptedOperationRequiresInitialization: true });
132
+ throw new GMIError(`ToolPermissionManager (ID: ${this.managerId}) is not initialized. Operations cannot be performed until initialize() is called with a valid configuration.`, GMIErrorCode.NOT_INITIALIZED, {
133
+ component: 'ToolPermissionManager',
134
+ managerId: this.managerId,
135
+ attemptedOperationRequiresInitialization: true,
136
+ });
131
137
  }
132
138
  }
133
139
  /**
@@ -153,8 +159,8 @@ export class ToolPermissionManager {
153
159
  if (!personaCapabilities || personaCapabilities.length === 0) {
154
160
  return false;
155
161
  }
156
- const personaCapabilitiesSet = new Set(personaCapabilities.filter(cap => typeof cap === 'string' && cap.trim() !== ''));
157
- const validToolRequiredCaps = toolRequiredCapabilities.filter(cap => typeof cap === 'string' && cap.trim() !== '');
162
+ const personaCapabilitiesSet = new Set(personaCapabilities.filter((cap) => typeof cap === 'string' && cap.trim() !== ''));
163
+ const validToolRequiredCaps = toolRequiredCapabilities.filter((cap) => typeof cap === 'string' && cap.trim() !== '');
158
164
  for (const requiredCap of validToolRequiredCaps) {
159
165
  if (!personaCapabilitiesSet.has(requiredCap)) {
160
166
  return false;
@@ -198,20 +204,26 @@ export class ToolPermissionManager {
198
204
  this.ensureInitialized();
199
205
  const requiredFeatureFlags = this.getRequiredFeaturesForTool(toolIdOrName);
200
206
  if (!requiredFeatureFlags || requiredFeatureFlags.length === 0) {
201
- return { isAllowed: true, reason: `Tool '${toolIdOrName}' does not require specific subscription features.` };
207
+ return {
208
+ isAllowed: true,
209
+ reason: `Tool '${toolIdOrName}' does not require specific subscription features.`,
210
+ };
202
211
  }
203
212
  if (!this.subscriptionService) {
204
- const reason = `Tool '${toolIdOrName}' requires subscription features [${requiredFeatureFlags.map(f => f.flag).join(', ')}], but ISubscriptionService is not configured. To enable subscription-based access control, inject a subscription service via AgentOSConfig or use @framers/agentos-extensions/auth. Defaulting to ALLOW.`;
213
+ const reason = `Tool '${toolIdOrName}' requires subscription features [${requiredFeatureFlags.map((f) => f.flag).join(', ')}], but ISubscriptionService is not configured. To enable subscription-based access control, inject a subscription service via AgentOSConfig or use @framers/agentos-extensions/auth. Defaulting to ALLOW.`;
205
214
  console.warn(`ToolPermissionManager (ID: ${this.managerId}, User: ${userId}): ${reason}`);
206
215
  // Default to allowing access when no subscription service configured
207
- return { isAllowed: true, reason: `No subscription service configured - access allowed by default` };
216
+ return {
217
+ isAllowed: true,
218
+ reason: `No subscription service configured - access allowed by default`,
219
+ };
208
220
  }
209
221
  try {
210
- const userTier = (this.subscriptionService.getUserSubscriptionTier
222
+ const userTier = this.subscriptionService.getUserSubscriptionTier
211
223
  ? await this.subscriptionService.getUserSubscriptionTier(userId)
212
- : await this.subscriptionService.getUserSubscription(userId));
224
+ : await this.subscriptionService.getUserSubscription(userId);
213
225
  if (!userTier) {
214
- const reason = `User (ID: ${userId}) does not have an identifiable or active subscription tier. Access to tool '${toolIdOrName}' requiring features [${requiredFeatureFlags.map(f => f.flag).join(', ')}] is denied.`;
226
+ const reason = `User (ID: ${userId}) does not have an identifiable or active subscription tier. Access to tool '${toolIdOrName}' requiring features [${requiredFeatureFlags.map((f) => f.flag).join(', ')}] is denied.`;
215
227
  return { isAllowed: false, missingFeatures: requiredFeatureFlags, reason };
216
228
  }
217
229
  const userTierFeatureStrings = new Set(userTier.features || []);
@@ -222,10 +234,13 @@ export class ToolPermissionManager {
222
234
  }
223
235
  }
224
236
  if (missingFeaturesAccumulator.length > 0) {
225
- const reason = `User (ID: ${userId}) lacks required subscription features for tool '${toolIdOrName}': [${missingFeaturesAccumulator.map(f => `'${f.flag}'`).join(', ')}]. Current tier: '${userTier.name}'.`;
237
+ const reason = `User (ID: ${userId}) lacks required subscription features for tool '${toolIdOrName}': [${missingFeaturesAccumulator.map((f) => `'${f.flag}'`).join(', ')}]. Current tier: '${userTier.name}'.`;
226
238
  return { isAllowed: false, missingFeatures: missingFeaturesAccumulator, reason };
227
239
  }
228
- return { isAllowed: true, reason: `User (ID: ${userId}) possesses all required subscription features for tool '${toolIdOrName}' via tier '${userTier.name}'.` };
240
+ return {
241
+ isAllowed: true,
242
+ reason: `User (ID: ${userId}) possesses all required subscription features for tool '${toolIdOrName}' via tier '${userTier.name}'.`,
243
+ };
229
244
  }
230
245
  catch (error) {
231
246
  const wrappedError = createGMIErrorFromError(error, GMIErrorCode.SUBSCRIPTION_ERROR, { userId, toolIdOrName, serviceCalled: 'ISubscriptionService.getUserSubscriptionTier' }, `An error occurred while checking subscription features for tool '${toolIdOrName}'.`, this.managerId);
@@ -249,7 +264,7 @@ export class ToolPermissionManager {
249
264
  const logPreamble = `ToolPermissionManager (ID: ${this.managerId}, GMI: ${gmiId || 'N/A'}, Persona: ${personaId}, User: ${userContext.userId}, Tool: ${tool.name} [ID: ${tool.id}])`;
250
265
  if (this.config.strictCapabilityChecking) {
251
266
  if (!this.hasRequiredCapabilities(personaCapabilities, tool.requiredCapabilities)) {
252
- const missingCaps = tool.requiredCapabilities?.filter(rc => !personaCapabilities.includes(rc)) || [];
267
+ const missingCaps = tool.requiredCapabilities?.filter((rc) => !personaCapabilities.includes(rc)) || [];
253
268
  const reason = `Permission Denied: Persona (ID: '${personaId}') lacks required capabilities for tool '${tool.name}'. Missing: [${missingCaps.join(', ')}]. Required: [${tool.requiredCapabilities?.join(', ')}].`;
254
269
  if (this.config.logToolCalls) {
255
270
  console.warn(`${logPreamble}: Strict capability check FAILED. ${reason}`);
@@ -257,7 +272,12 @@ export class ToolPermissionManager {
257
272
  return {
258
273
  isAllowed: false,
259
274
  reason,
260
- details: { checkType: "personaCapabilities", required: tool.requiredCapabilities, possessed: personaCapabilities, missing: missingCaps },
275
+ details: {
276
+ checkType: 'personaCapabilities',
277
+ required: tool.requiredCapabilities,
278
+ possessed: personaCapabilities,
279
+ missing: missingCaps,
280
+ },
261
281
  };
262
282
  }
263
283
  if (this.config.logToolCalls) {
@@ -274,14 +294,20 @@ export class ToolPermissionManager {
274
294
  if (requiredFeatures && requiredFeatures.length > 0) {
275
295
  const subscriptionAccessResult = await this.checkToolSubscriptionAccess(userContext.userId, toolIdentifierForFeatureLookup);
276
296
  if (!subscriptionAccessResult.isAllowed) {
277
- const reason = subscriptionAccessResult.reason || `User (ID: '${userContext.userId}') subscription does not grant access to tool '${tool.name}'.`;
297
+ const reason = subscriptionAccessResult.reason ||
298
+ `User (ID: '${userContext.userId}') subscription does not grant access to tool '${tool.name}'.`;
278
299
  if (this.config.logToolCalls) {
279
300
  console.warn(`${logPreamble}: User subscription feature check FAILED. ${reason}`, subscriptionAccessResult.missingFeatures);
280
301
  }
281
302
  return {
282
303
  isAllowed: false,
283
304
  reason,
284
- details: { checkType: "userSubscriptionFeatures", requiredFeatures: requiredFeatures.map(f => f.flag), missingFeatures: subscriptionAccessResult.missingFeatures?.map(f => f.flag), toolIdentifier: toolIdentifierForFeatureLookup }
305
+ details: {
306
+ checkType: 'userSubscriptionFeatures',
307
+ requiredFeatures: requiredFeatures.map((f) => f.flag),
308
+ missingFeatures: subscriptionAccessResult.missingFeatures?.map((f) => f.flag),
309
+ toolIdentifier: toolIdentifierForFeatureLookup,
310
+ },
285
311
  };
286
312
  }
287
313
  if (this.config.logToolCalls) {