@dexto/core 1.2.4 → 1.2.6

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 (551) hide show
  1. package/README.md +60 -0
  2. package/dist/agent/DextoAgent.cjs +579 -345
  3. package/dist/agent/DextoAgent.d.ts +131 -83
  4. package/dist/agent/DextoAgent.d.ts.map +1 -1
  5. package/dist/agent/DextoAgent.js +573 -336
  6. package/dist/agent/agentCard.cjs +4 -2
  7. package/dist/agent/agentCard.d.ts +0 -1
  8. package/dist/agent/agentCard.d.ts.map +1 -1
  9. package/dist/agent/agentCard.js +4 -2
  10. package/dist/agent/index.cjs +3 -7
  11. package/dist/agent/index.d.ts +3 -3
  12. package/dist/agent/index.d.ts.map +1 -1
  13. package/dist/agent/index.js +7 -6
  14. package/dist/agent/schemas.cjs +179 -75
  15. package/dist/agent/schemas.d.ts +2678 -586
  16. package/dist/agent/schemas.d.ts.map +1 -1
  17. package/dist/agent/schemas.js +172 -65
  18. package/dist/agent/state-manager.cjs +28 -23
  19. package/dist/agent/state-manager.d.ts +4 -1
  20. package/dist/agent/state-manager.d.ts.map +1 -1
  21. package/dist/agent/state-manager.js +28 -23
  22. package/dist/{preferences/constants.cjs → agent/types.cjs} +2 -14
  23. package/dist/agent/types.d.ts +54 -0
  24. package/dist/agent/types.d.ts.map +1 -0
  25. package/dist/agent/types.js +0 -0
  26. package/dist/approval/errors.cjs +89 -8
  27. package/dist/approval/errors.d.ts +5 -3
  28. package/dist/approval/errors.d.ts.map +1 -1
  29. package/dist/approval/errors.js +89 -8
  30. package/dist/approval/{providers/factory.d.ts → factory.d.ts} +2 -2
  31. package/dist/approval/factory.d.ts.map +1 -0
  32. package/dist/approval/{providers/factory.js → factory.js} +1 -1
  33. package/dist/approval/index.cjs +4 -6
  34. package/dist/approval/index.d.ts +3 -5
  35. package/dist/approval/index.d.ts.map +1 -1
  36. package/dist/approval/index.js +4 -5
  37. package/dist/approval/manager.cjs +140 -37
  38. package/dist/approval/manager.d.ts +56 -17
  39. package/dist/approval/manager.d.ts.map +1 -1
  40. package/dist/approval/manager.js +141 -38
  41. package/dist/approval/schemas.cjs +9 -1
  42. package/dist/approval/schemas.d.ts +120 -35
  43. package/dist/approval/schemas.d.ts.map +1 -1
  44. package/dist/approval/schemas.js +9 -2
  45. package/dist/approval/types.cjs +14 -2
  46. package/dist/approval/types.d.ts +64 -12
  47. package/dist/approval/types.d.ts.map +1 -1
  48. package/dist/approval/types.js +12 -1
  49. package/dist/context/compression/middle-removal.cjs +11 -11
  50. package/dist/context/compression/middle-removal.d.ts +3 -1
  51. package/dist/context/compression/middle-removal.d.ts.map +1 -1
  52. package/dist/context/compression/middle-removal.js +11 -11
  53. package/dist/context/compression/oldest-removal.cjs +18 -5
  54. package/dist/context/compression/oldest-removal.d.ts +3 -1
  55. package/dist/context/compression/oldest-removal.d.ts.map +1 -1
  56. package/dist/context/compression/oldest-removal.js +18 -5
  57. package/dist/context/manager.cjs +94 -67
  58. package/dist/context/manager.d.ts +13 -10
  59. package/dist/context/manager.d.ts.map +1 -1
  60. package/dist/context/manager.js +94 -67
  61. package/dist/context/utils.cjs +79 -65
  62. package/dist/context/utils.d.ts +15 -12
  63. package/dist/context/utils.d.ts.map +1 -1
  64. package/dist/context/utils.js +45 -31
  65. package/dist/errors/DextoRuntimeError.d.ts +5 -5
  66. package/dist/errors/DextoRuntimeError.d.ts.map +1 -1
  67. package/dist/errors/result-bridge.cjs +2 -3
  68. package/dist/errors/result-bridge.d.ts +5 -3
  69. package/dist/errors/result-bridge.d.ts.map +1 -1
  70. package/dist/errors/result-bridge.js +1 -2
  71. package/dist/errors/types.cjs +1 -2
  72. package/dist/errors/types.d.ts +5 -8
  73. package/dist/errors/types.d.ts.map +1 -1
  74. package/dist/errors/types.js +1 -2
  75. package/dist/events/index.cjs +125 -55
  76. package/dist/events/index.d.ts +204 -97
  77. package/dist/events/index.d.ts.map +1 -1
  78. package/dist/events/index.js +123 -55
  79. package/dist/filesystem/filesystem-service.cjs +40 -30
  80. package/dist/filesystem/filesystem-service.d.ts +9 -1
  81. package/dist/filesystem/filesystem-service.d.ts.map +1 -1
  82. package/dist/filesystem/filesystem-service.js +40 -30
  83. package/dist/filesystem/path-validator.cjs +4 -3
  84. package/dist/filesystem/path-validator.d.ts +3 -1
  85. package/dist/filesystem/path-validator.d.ts.map +1 -1
  86. package/dist/filesystem/path-validator.js +4 -3
  87. package/dist/filesystem/types.d.ts +3 -3
  88. package/dist/filesystem/types.d.ts.map +1 -1
  89. package/dist/index.browser.cjs +7 -0
  90. package/dist/index.browser.d.ts +2 -0
  91. package/dist/index.browser.d.ts.map +1 -1
  92. package/dist/index.browser.js +4 -0
  93. package/dist/index.cjs +0 -7
  94. package/dist/index.d.ts +12 -3
  95. package/dist/index.d.ts.map +1 -1
  96. package/dist/index.js +0 -4
  97. package/dist/llm/formatters/anthropic.cjs +32 -21
  98. package/dist/llm/formatters/anthropic.d.ts +3 -0
  99. package/dist/llm/formatters/anthropic.d.ts.map +1 -1
  100. package/dist/llm/formatters/anthropic.js +32 -21
  101. package/dist/llm/formatters/factory.cjs +6 -7
  102. package/dist/llm/formatters/factory.d.ts +2 -1
  103. package/dist/llm/formatters/factory.d.ts.map +1 -1
  104. package/dist/llm/formatters/factory.js +4 -5
  105. package/dist/llm/formatters/openai.cjs +38 -9
  106. package/dist/llm/formatters/openai.d.ts +3 -0
  107. package/dist/llm/formatters/openai.d.ts.map +1 -1
  108. package/dist/llm/formatters/openai.js +38 -9
  109. package/dist/llm/formatters/vercel.cjs +49 -8
  110. package/dist/llm/formatters/vercel.d.ts +3 -0
  111. package/dist/llm/formatters/vercel.d.ts.map +1 -1
  112. package/dist/llm/formatters/vercel.js +49 -8
  113. package/dist/llm/registry.cjs +153 -17
  114. package/dist/llm/registry.d.ts +5 -2
  115. package/dist/llm/registry.d.ts.map +1 -1
  116. package/dist/llm/registry.js +143 -7
  117. package/dist/llm/resolver.cjs +4 -4
  118. package/dist/llm/resolver.d.ts +3 -2
  119. package/dist/llm/resolver.d.ts.map +1 -1
  120. package/dist/llm/resolver.js +4 -4
  121. package/dist/llm/schemas.cjs +6 -3
  122. package/dist/llm/schemas.d.ts +51 -17
  123. package/dist/llm/schemas.d.ts.map +1 -1
  124. package/dist/llm/schemas.js +5 -3
  125. package/dist/llm/services/anthropic.cjs +216 -183
  126. package/dist/llm/services/anthropic.d.ts +3 -1
  127. package/dist/llm/services/anthropic.d.ts.map +1 -1
  128. package/dist/llm/services/anthropic.js +217 -184
  129. package/dist/llm/services/factory.cjs +15 -9
  130. package/dist/llm/services/factory.d.ts +2 -1
  131. package/dist/llm/services/factory.d.ts.map +1 -1
  132. package/dist/llm/services/factory.js +15 -9
  133. package/dist/llm/services/openai.cjs +262 -225
  134. package/dist/llm/services/openai.d.ts +3 -1
  135. package/dist/llm/services/openai.d.ts.map +1 -1
  136. package/dist/llm/services/openai.js +263 -226
  137. package/dist/llm/services/test-utils.integration.cjs +58 -12
  138. package/dist/llm/services/test-utils.integration.d.ts.map +1 -1
  139. package/dist/llm/services/test-utils.integration.js +58 -12
  140. package/dist/llm/services/types.d.ts +9 -0
  141. package/dist/llm/services/types.d.ts.map +1 -1
  142. package/dist/llm/services/vercel.cjs +163 -111
  143. package/dist/llm/services/vercel.d.ts +3 -1
  144. package/dist/llm/services/vercel.d.ts.map +1 -1
  145. package/dist/llm/services/vercel.js +157 -105
  146. package/dist/llm/tokenizer/factory.cjs +2 -2
  147. package/dist/llm/tokenizer/factory.d.ts +3 -1
  148. package/dist/llm/tokenizer/factory.d.ts.map +1 -1
  149. package/dist/llm/tokenizer/factory.js +2 -2
  150. package/dist/llm/tokenizer/openai.cjs +16 -9
  151. package/dist/llm/tokenizer/openai.d.ts +4 -1
  152. package/dist/llm/tokenizer/openai.d.ts.map +1 -1
  153. package/dist/llm/tokenizer/openai.js +16 -9
  154. package/dist/llm/validation.cjs +8 -9
  155. package/dist/llm/validation.d.ts +3 -1
  156. package/dist/llm/validation.d.ts.map +1 -1
  157. package/dist/llm/validation.js +5 -6
  158. package/dist/logger/factory.cjs +54 -0
  159. package/dist/logger/factory.d.ts +36 -0
  160. package/dist/logger/factory.d.ts.map +1 -0
  161. package/dist/logger/factory.js +31 -0
  162. package/dist/logger/index.cjs +42 -3
  163. package/dist/logger/index.d.ts +17 -1
  164. package/dist/logger/index.d.ts.map +1 -1
  165. package/dist/logger/index.js +26 -1
  166. package/dist/logger/logger.cjs +30 -17
  167. package/dist/logger/logger.d.ts.map +1 -1
  168. package/dist/logger/logger.js +30 -17
  169. package/dist/logger/v2/dexto-logger.cjs +141 -0
  170. package/dist/logger/v2/dexto-logger.d.ts +54 -0
  171. package/dist/logger/v2/dexto-logger.d.ts.map +1 -0
  172. package/dist/logger/v2/dexto-logger.js +118 -0
  173. package/dist/{preferences → logger/v2}/error-codes.cjs +11 -10
  174. package/dist/logger/v2/error-codes.d.ts +13 -0
  175. package/dist/logger/v2/error-codes.d.ts.map +1 -0
  176. package/dist/logger/v2/error-codes.js +13 -0
  177. package/dist/logger/v2/errors.cjs +107 -0
  178. package/dist/logger/v2/errors.d.ts +32 -0
  179. package/dist/logger/v2/errors.d.ts.map +1 -0
  180. package/dist/logger/v2/errors.js +84 -0
  181. package/dist/logger/v2/schemas.cjs +57 -0
  182. package/dist/logger/v2/schemas.d.ts +147 -0
  183. package/dist/logger/v2/schemas.d.ts.map +1 -0
  184. package/dist/logger/v2/schemas.js +33 -0
  185. package/dist/logger/v2/transport-factory.cjs +53 -0
  186. package/dist/logger/v2/transport-factory.d.ts +21 -0
  187. package/dist/logger/v2/transport-factory.d.ts.map +1 -0
  188. package/dist/logger/v2/transport-factory.js +29 -0
  189. package/dist/logger/v2/transports/console-transport.cjs +79 -0
  190. package/dist/logger/v2/transports/console-transport.d.ts +23 -0
  191. package/dist/logger/v2/transports/console-transport.d.ts.map +1 -0
  192. package/dist/logger/v2/transports/console-transport.js +46 -0
  193. package/dist/logger/v2/transports/file-transport.cjs +161 -0
  194. package/dist/logger/v2/transports/file-transport.d.ts +46 -0
  195. package/dist/logger/v2/transports/file-transport.d.ts.map +1 -0
  196. package/dist/logger/v2/transports/file-transport.js +128 -0
  197. package/dist/logger/v2/types.cjs +49 -0
  198. package/dist/logger/v2/types.d.ts +123 -0
  199. package/dist/logger/v2/types.d.ts.map +1 -0
  200. package/dist/logger/v2/types.js +26 -0
  201. package/dist/mcp/manager.cjs +88 -78
  202. package/dist/mcp/manager.d.ts +3 -1
  203. package/dist/mcp/manager.d.ts.map +1 -1
  204. package/dist/mcp/manager.js +88 -78
  205. package/dist/mcp/mcp-client.cjs +109 -79
  206. package/dist/mcp/mcp-client.d.ts +3 -0
  207. package/dist/mcp/mcp-client.d.ts.map +1 -1
  208. package/dist/mcp/mcp-client.js +102 -72
  209. package/dist/memory/index.cjs +2 -0
  210. package/dist/memory/index.d.ts +1 -1
  211. package/dist/memory/index.d.ts.map +1 -1
  212. package/dist/memory/index.js +3 -1
  213. package/dist/memory/manager.cjs +9 -7
  214. package/dist/memory/manager.d.ts +3 -1
  215. package/dist/memory/manager.d.ts.map +1 -1
  216. package/dist/memory/manager.js +9 -7
  217. package/dist/memory/schemas.cjs +10 -0
  218. package/dist/memory/schemas.d.ts +37 -8
  219. package/dist/memory/schemas.d.ts.map +1 -1
  220. package/dist/memory/schemas.js +9 -0
  221. package/dist/plugins/manager.cjs +21 -19
  222. package/dist/plugins/manager.d.ts +3 -1
  223. package/dist/plugins/manager.d.ts.map +1 -1
  224. package/dist/plugins/manager.js +21 -19
  225. package/dist/plugins/schemas.d.ts +9 -9
  226. package/dist/plugins/types.d.ts +2 -2
  227. package/dist/plugins/types.d.ts.map +1 -1
  228. package/dist/process/command-validator.cjs +30 -20
  229. package/dist/process/command-validator.d.ts +4 -1
  230. package/dist/process/command-validator.d.ts.map +1 -1
  231. package/dist/process/command-validator.js +30 -20
  232. package/dist/process/process-service.cjs +23 -21
  233. package/dist/process/process-service.d.ts +3 -1
  234. package/dist/process/process-service.d.ts.map +1 -1
  235. package/dist/process/process-service.js +23 -21
  236. package/dist/prompts/index.cjs +6 -8
  237. package/dist/prompts/index.d.ts +2 -4
  238. package/dist/prompts/index.d.ts.map +1 -1
  239. package/dist/prompts/index.js +4 -6
  240. package/dist/prompts/prompt-manager.cjs +25 -20
  241. package/dist/prompts/prompt-manager.d.ts +3 -1
  242. package/dist/prompts/prompt-manager.d.ts.map +1 -1
  243. package/dist/prompts/prompt-manager.js +25 -20
  244. package/dist/prompts/providers/config-prompt-provider.cjs +331 -0
  245. package/dist/prompts/providers/config-prompt-provider.d.ts +34 -0
  246. package/dist/prompts/providers/config-prompt-provider.d.ts.map +1 -0
  247. package/dist/prompts/providers/config-prompt-provider.js +308 -0
  248. package/dist/prompts/providers/custom-prompt-provider.cjs +11 -7
  249. package/dist/prompts/providers/custom-prompt-provider.d.ts +3 -1
  250. package/dist/prompts/providers/custom-prompt-provider.d.ts.map +1 -1
  251. package/dist/prompts/providers/custom-prompt-provider.js +11 -7
  252. package/dist/prompts/providers/mcp-prompt-provider.cjs +7 -6
  253. package/dist/prompts/providers/mcp-prompt-provider.d.ts +3 -1
  254. package/dist/prompts/providers/mcp-prompt-provider.d.ts.map +1 -1
  255. package/dist/prompts/providers/mcp-prompt-provider.js +7 -6
  256. package/dist/prompts/schemas.cjs +42 -23
  257. package/dist/prompts/schemas.d.ts +123 -14
  258. package/dist/prompts/schemas.d.ts.map +1 -1
  259. package/dist/prompts/schemas.js +39 -22
  260. package/dist/prompts/types.d.ts +1 -1
  261. package/dist/prompts/types.d.ts.map +1 -1
  262. package/dist/resources/handlers/blob-handler.cjs +15 -11
  263. package/dist/resources/handlers/blob-handler.d.ts +3 -1
  264. package/dist/resources/handlers/blob-handler.d.ts.map +1 -1
  265. package/dist/resources/handlers/blob-handler.js +15 -11
  266. package/dist/resources/handlers/factory.cjs +3 -3
  267. package/dist/resources/handlers/factory.d.ts +2 -1
  268. package/dist/resources/handlers/factory.d.ts.map +1 -1
  269. package/dist/resources/handlers/factory.js +3 -3
  270. package/dist/resources/handlers/filesystem-handler.cjs +10 -8
  271. package/dist/resources/handlers/filesystem-handler.d.ts +3 -1
  272. package/dist/resources/handlers/filesystem-handler.d.ts.map +1 -1
  273. package/dist/resources/handlers/filesystem-handler.js +10 -8
  274. package/dist/resources/internal-provider.cjs +28 -20
  275. package/dist/resources/internal-provider.d.ts +3 -1
  276. package/dist/resources/internal-provider.d.ts.map +1 -1
  277. package/dist/resources/internal-provider.js +28 -20
  278. package/dist/resources/manager.cjs +34 -25
  279. package/dist/resources/manager.d.ts +3 -1
  280. package/dist/resources/manager.d.ts.map +1 -1
  281. package/dist/resources/manager.js +34 -25
  282. package/dist/resources/schemas.d.ts +6 -6
  283. package/dist/search/search-service.cjs +8 -6
  284. package/dist/search/search-service.d.ts +3 -1
  285. package/dist/search/search-service.d.ts.map +1 -1
  286. package/dist/search/search-service.js +8 -6
  287. package/dist/session/chat-session.cjs +40 -27
  288. package/dist/session/chat-session.d.ts +10 -7
  289. package/dist/session/chat-session.d.ts.map +1 -1
  290. package/dist/session/chat-session.js +40 -27
  291. package/dist/session/history/database.cjs +18 -11
  292. package/dist/session/history/database.d.ts +3 -1
  293. package/dist/session/history/database.d.ts.map +1 -1
  294. package/dist/session/history/database.js +18 -11
  295. package/dist/session/history/factory.cjs +2 -2
  296. package/dist/session/history/factory.d.ts +5 -1
  297. package/dist/session/history/factory.d.ts.map +1 -1
  298. package/dist/session/history/factory.js +2 -2
  299. package/dist/session/session-manager.cjs +37 -53
  300. package/dist/session/session-manager.d.ts +3 -17
  301. package/dist/session/session-manager.d.ts.map +1 -1
  302. package/dist/session/session-manager.js +37 -53
  303. package/dist/session/title-generator.cjs +3 -2
  304. package/dist/session/title-generator.d.ts +2 -1
  305. package/dist/session/title-generator.d.ts.map +1 -1
  306. package/dist/session/title-generator.js +3 -2
  307. package/dist/storage/blob/factory.cjs +9 -18
  308. package/dist/storage/blob/factory.d.ts +5 -4
  309. package/dist/storage/blob/factory.d.ts.map +1 -1
  310. package/dist/storage/blob/factory.js +8 -17
  311. package/dist/storage/blob/local-blob-store.cjs +25 -32
  312. package/dist/storage/blob/local-blob-store.d.ts +3 -2
  313. package/dist/storage/blob/local-blob-store.d.ts.map +1 -1
  314. package/dist/storage/blob/local-blob-store.js +25 -32
  315. package/dist/storage/blob/memory-blob-store.cjs +326 -0
  316. package/dist/storage/blob/memory-blob-store.d.ts +66 -0
  317. package/dist/storage/blob/memory-blob-store.d.ts.map +1 -0
  318. package/dist/storage/blob/memory-blob-store.js +303 -0
  319. package/dist/storage/blob/schemas.cjs +3 -1
  320. package/dist/storage/blob/schemas.d.ts +6 -6
  321. package/dist/storage/blob/schemas.d.ts.map +1 -1
  322. package/dist/storage/blob/schemas.js +3 -1
  323. package/dist/storage/cache/factory.cjs +7 -8
  324. package/dist/storage/cache/factory.d.ts +4 -1
  325. package/dist/storage/cache/factory.d.ts.map +1 -1
  326. package/dist/storage/cache/factory.js +4 -5
  327. package/dist/storage/cache/redis-store.cjs +4 -1
  328. package/dist/storage/cache/redis-store.d.ts +3 -1
  329. package/dist/storage/cache/redis-store.d.ts.map +1 -1
  330. package/dist/storage/cache/redis-store.js +4 -1
  331. package/dist/storage/database/factory.cjs +13 -16
  332. package/dist/storage/database/factory.d.ts +5 -3
  333. package/dist/storage/database/factory.d.ts.map +1 -1
  334. package/dist/storage/database/factory.js +9 -12
  335. package/dist/storage/database/postgres-store.cjs +4 -1
  336. package/dist/storage/database/postgres-store.d.ts +3 -1
  337. package/dist/storage/database/postgres-store.d.ts.map +1 -1
  338. package/dist/storage/database/postgres-store.js +4 -1
  339. package/dist/storage/database/schemas.cjs +3 -4
  340. package/dist/storage/database/schemas.d.ts +8 -16
  341. package/dist/storage/database/schemas.d.ts.map +1 -1
  342. package/dist/storage/database/schemas.js +3 -4
  343. package/dist/storage/database/sqlite-store.cjs +17 -45
  344. package/dist/storage/database/sqlite-store.d.ts +3 -3
  345. package/dist/storage/database/sqlite-store.d.ts.map +1 -1
  346. package/dist/storage/database/sqlite-store.js +17 -45
  347. package/dist/storage/schemas.cjs +3 -1
  348. package/dist/storage/schemas.d.ts +16 -23
  349. package/dist/storage/schemas.d.ts.map +1 -1
  350. package/dist/storage/schemas.js +3 -1
  351. package/dist/storage/storage-manager.cjs +15 -15
  352. package/dist/storage/storage-manager.d.ts +6 -6
  353. package/dist/storage/storage-manager.d.ts.map +1 -1
  354. package/dist/storage/storage-manager.js +15 -15
  355. package/dist/systemPrompt/contributors.cjs +15 -15
  356. package/dist/systemPrompt/contributors.d.ts +5 -3
  357. package/dist/systemPrompt/contributors.d.ts.map +1 -1
  358. package/dist/systemPrompt/contributors.js +15 -15
  359. package/dist/systemPrompt/in-built-prompts.cjs +0 -5
  360. package/dist/systemPrompt/in-built-prompts.d.ts +1 -2
  361. package/dist/systemPrompt/in-built-prompts.d.ts.map +1 -1
  362. package/dist/systemPrompt/in-built-prompts.js +0 -4
  363. package/dist/systemPrompt/manager.cjs +31 -23
  364. package/dist/systemPrompt/manager.d.ts +5 -3
  365. package/dist/systemPrompt/manager.d.ts.map +1 -1
  366. package/dist/systemPrompt/manager.js +31 -23
  367. package/dist/systemPrompt/registry.cjs +1 -2
  368. package/dist/systemPrompt/registry.d.ts +1 -1
  369. package/dist/systemPrompt/registry.d.ts.map +1 -1
  370. package/dist/systemPrompt/registry.js +1 -2
  371. package/dist/systemPrompt/schemas.cjs +24 -18
  372. package/dist/systemPrompt/schemas.d.ts +46 -222
  373. package/dist/systemPrompt/schemas.d.ts.map +1 -1
  374. package/dist/systemPrompt/schemas.js +14 -18
  375. package/dist/telemetry/decorators.cjs +54 -15
  376. package/dist/telemetry/decorators.d.ts.map +1 -1
  377. package/dist/telemetry/decorators.js +54 -15
  378. package/dist/telemetry/utils.cjs +21 -14
  379. package/dist/telemetry/utils.d.ts +7 -3
  380. package/dist/telemetry/utils.d.ts.map +1 -1
  381. package/dist/telemetry/utils.js +21 -14
  382. package/dist/tools/confirmation/allowed-tools-provider/factory.cjs +2 -2
  383. package/dist/tools/confirmation/allowed-tools-provider/factory.d.ts +2 -1
  384. package/dist/tools/confirmation/allowed-tools-provider/factory.d.ts.map +1 -1
  385. package/dist/tools/confirmation/allowed-tools-provider/factory.js +2 -2
  386. package/dist/tools/confirmation/allowed-tools-provider/storage.cjs +7 -6
  387. package/dist/tools/confirmation/allowed-tools-provider/storage.d.ts +3 -1
  388. package/dist/tools/confirmation/allowed-tools-provider/storage.d.ts.map +1 -1
  389. package/dist/tools/confirmation/allowed-tools-provider/storage.js +7 -6
  390. package/dist/tools/errors.cjs +2 -1
  391. package/dist/tools/errors.d.ts.map +1 -1
  392. package/dist/tools/errors.js +2 -1
  393. package/dist/tools/internal-tools/constants.cjs +2 -1
  394. package/dist/tools/internal-tools/constants.d.ts +1 -1
  395. package/dist/tools/internal-tools/constants.d.ts.map +1 -1
  396. package/dist/tools/internal-tools/constants.js +2 -1
  397. package/dist/tools/internal-tools/implementations/bash-exec-tool.cjs +1 -1
  398. package/dist/tools/internal-tools/implementations/bash-exec-tool.js +1 -1
  399. package/dist/tools/internal-tools/implementations/delegate-to-url-tool.cjs +192 -0
  400. package/dist/tools/internal-tools/implementations/delegate-to-url-tool.d.ts +33 -0
  401. package/dist/tools/internal-tools/implementations/delegate-to-url-tool.d.ts.map +1 -0
  402. package/dist/tools/internal-tools/implementations/delegate-to-url-tool.js +169 -0
  403. package/dist/tools/internal-tools/provider.cjs +21 -17
  404. package/dist/tools/internal-tools/provider.d.ts +3 -1
  405. package/dist/tools/internal-tools/provider.d.ts.map +1 -1
  406. package/dist/tools/internal-tools/provider.js +21 -17
  407. package/dist/tools/internal-tools/registry.cjs +5 -0
  408. package/dist/tools/internal-tools/registry.d.ts.map +1 -1
  409. package/dist/tools/internal-tools/registry.js +5 -0
  410. package/dist/tools/schemas.cjs +16 -4
  411. package/dist/tools/schemas.d.ts +21 -9
  412. package/dist/tools/schemas.d.ts.map +1 -1
  413. package/dist/tools/schemas.js +15 -4
  414. package/dist/tools/tool-manager.cjs +64 -47
  415. package/dist/tools/tool-manager.d.ts +4 -2
  416. package/dist/tools/tool-manager.d.ts.map +1 -1
  417. package/dist/tools/tool-manager.js +61 -44
  418. package/dist/tools/types.d.ts +0 -4
  419. package/dist/tools/types.d.ts.map +1 -1
  420. package/dist/utils/env-file.cjs +118 -0
  421. package/dist/utils/env-file.d.ts +5 -0
  422. package/dist/utils/env-file.d.ts.map +1 -0
  423. package/dist/utils/env-file.js +85 -0
  424. package/dist/utils/error-conversion.cjs +23 -1
  425. package/dist/utils/error-conversion.d.ts +2 -1
  426. package/dist/utils/error-conversion.d.ts.map +1 -1
  427. package/dist/utils/error-conversion.js +23 -1
  428. package/dist/utils/execution-context.d.ts.map +1 -1
  429. package/dist/utils/fs-walk.d.ts.map +1 -1
  430. package/dist/utils/index.cjs +7 -9
  431. package/dist/utils/index.d.ts +3 -4
  432. package/dist/utils/index.d.ts.map +1 -1
  433. package/dist/utils/index.js +3 -4
  434. package/dist/utils/path.cjs +22 -57
  435. package/dist/utils/path.d.ts +8 -7
  436. package/dist/utils/path.d.ts.map +1 -1
  437. package/dist/utils/path.js +21 -54
  438. package/dist/utils/result.cjs +37 -14
  439. package/dist/utils/result.d.ts.map +1 -1
  440. package/dist/utils/result.js +37 -14
  441. package/dist/utils/schema.cjs +2 -3
  442. package/dist/utils/schema.d.ts +2 -1
  443. package/dist/utils/schema.d.ts.map +1 -1
  444. package/dist/utils/schema.js +1 -2
  445. package/dist/utils/service-initializer.cjs +88 -61
  446. package/dist/utils/service-initializer.d.ts +4 -2
  447. package/dist/utils/service-initializer.d.ts.map +1 -1
  448. package/dist/utils/service-initializer.js +70 -43
  449. package/package.json +7 -3
  450. package/dist/Dexto.cjs +0 -251
  451. package/dist/Dexto.d.ts +0 -191
  452. package/dist/Dexto.d.ts.map +0 -1
  453. package/dist/Dexto.js +0 -228
  454. package/dist/agent/registry/error-codes.cjs +0 -44
  455. package/dist/agent/registry/error-codes.d.ts +0 -21
  456. package/dist/agent/registry/error-codes.d.ts.map +0 -1
  457. package/dist/agent/registry/error-codes.js +0 -21
  458. package/dist/agent/registry/errors.cjs +0 -188
  459. package/dist/agent/registry/errors.d.ts +0 -63
  460. package/dist/agent/registry/errors.d.ts.map +0 -1
  461. package/dist/agent/registry/errors.js +0 -165
  462. package/dist/agent/registry/registry.cjs +0 -479
  463. package/dist/agent/registry/registry.d.ts +0 -130
  464. package/dist/agent/registry/registry.d.ts.map +0 -1
  465. package/dist/agent/registry/registry.js +0 -453
  466. package/dist/agent/registry/types.cjs +0 -74
  467. package/dist/agent/registry/types.d.ts +0 -142
  468. package/dist/agent/registry/types.d.ts.map +0 -1
  469. package/dist/agent/registry/types.js +0 -48
  470. package/dist/agent/registry/user-registry.cjs +0 -140
  471. package/dist/agent/registry/user-registry.d.ts +0 -34
  472. package/dist/agent/registry/user-registry.d.ts.map +0 -1
  473. package/dist/agent/registry/user-registry.js +0 -105
  474. package/dist/approval/providers/event-based-approval-provider.cjs +0 -156
  475. package/dist/approval/providers/event-based-approval-provider.d.ts +0 -39
  476. package/dist/approval/providers/event-based-approval-provider.d.ts.map +0 -1
  477. package/dist/approval/providers/event-based-approval-provider.js +0 -133
  478. package/dist/approval/providers/factory.d.ts.map +0 -1
  479. package/dist/approval/providers/noop-approval-provider.cjs +0 -54
  480. package/dist/approval/providers/noop-approval-provider.d.ts +0 -18
  481. package/dist/approval/providers/noop-approval-provider.d.ts.map +0 -1
  482. package/dist/approval/providers/noop-approval-provider.js +0 -31
  483. package/dist/config/agent-resolver.cjs +0 -153
  484. package/dist/config/agent-resolver.d.ts +0 -14
  485. package/dist/config/agent-resolver.d.ts.map +0 -1
  486. package/dist/config/agent-resolver.js +0 -123
  487. package/dist/config/error-codes.cjs +0 -39
  488. package/dist/config/error-codes.d.ts +0 -16
  489. package/dist/config/error-codes.d.ts.map +0 -1
  490. package/dist/config/error-codes.js +0 -16
  491. package/dist/config/errors.cjs +0 -126
  492. package/dist/config/errors.d.ts +0 -34
  493. package/dist/config/errors.d.ts.map +0 -1
  494. package/dist/config/errors.js +0 -103
  495. package/dist/config/index.cjs +0 -26
  496. package/dist/config/index.d.ts +0 -4
  497. package/dist/config/index.d.ts.map +0 -1
  498. package/dist/config/index.js +0 -3
  499. package/dist/config/loader.cjs +0 -119
  500. package/dist/config/loader.d.ts +0 -16
  501. package/dist/config/loader.d.ts.map +0 -1
  502. package/dist/config/loader.js +0 -86
  503. package/dist/config/writer.cjs +0 -182
  504. package/dist/config/writer.d.ts +0 -35
  505. package/dist/config/writer.d.ts.map +0 -1
  506. package/dist/config/writer.js +0 -147
  507. package/dist/preferences/constants.d.ts +0 -2
  508. package/dist/preferences/constants.d.ts.map +0 -1
  509. package/dist/preferences/constants.js +0 -5
  510. package/dist/preferences/error-codes.d.ts +0 -8
  511. package/dist/preferences/error-codes.d.ts.map +0 -1
  512. package/dist/preferences/error-codes.js +0 -12
  513. package/dist/preferences/errors.cjs +0 -75
  514. package/dist/preferences/errors.d.ts +0 -18
  515. package/dist/preferences/errors.d.ts.map +0 -1
  516. package/dist/preferences/errors.js +0 -51
  517. package/dist/preferences/index.cjs +0 -55
  518. package/dist/preferences/index.d.ts +0 -6
  519. package/dist/preferences/index.d.ts.map +0 -1
  520. package/dist/preferences/index.js +0 -32
  521. package/dist/preferences/loader.cjs +0 -138
  522. package/dist/preferences/loader.d.ts +0 -51
  523. package/dist/preferences/loader.d.ts.map +0 -1
  524. package/dist/preferences/loader.js +0 -110
  525. package/dist/preferences/schemas.cjs +0 -75
  526. package/dist/preferences/schemas.d.ts +0 -110
  527. package/dist/preferences/schemas.d.ts.map +0 -1
  528. package/dist/preferences/schemas.js +0 -49
  529. package/dist/prompts/providers/file-prompt-provider.cjs +0 -399
  530. package/dist/prompts/providers/file-prompt-provider.d.ts +0 -47
  531. package/dist/prompts/providers/file-prompt-provider.d.ts.map +0 -1
  532. package/dist/prompts/providers/file-prompt-provider.js +0 -376
  533. package/dist/prompts/providers/starter-prompt-provider.cjs +0 -170
  534. package/dist/prompts/providers/starter-prompt-provider.d.ts +0 -45
  535. package/dist/prompts/providers/starter-prompt-provider.d.ts.map +0 -1
  536. package/dist/prompts/providers/starter-prompt-provider.js +0 -147
  537. package/dist/utils/api-key-store.cjs +0 -56
  538. package/dist/utils/api-key-store.d.ts +0 -24
  539. package/dist/utils/api-key-store.d.ts.map +0 -1
  540. package/dist/utils/api-key-store.js +0 -31
  541. package/dist/utils/env.cjs +0 -154
  542. package/dist/utils/env.d.ts +0 -28
  543. package/dist/utils/env.d.ts.map +0 -1
  544. package/dist/utils/env.js +0 -119
  545. package/dist/utils/port-utils.cjs +0 -37
  546. package/dist/utils/port-utils.d.ts +0 -10
  547. package/dist/utils/port-utils.d.ts.map +0 -1
  548. package/dist/utils/port-utils.js +0 -14
  549. package/dist/utils/port-utils.spec.cjs +0 -26
  550. package/dist/utils/port-utils.spec.js +0 -25
  551. /package/dist/approval/{providers/factory.cjs → factory.cjs} +0 -0
package/dist/Dexto.cjs DELETED
@@ -1,251 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var Dexto_exports = {};
20
- __export(Dexto_exports, {
21
- Dexto: () => Dexto
22
- });
23
- module.exports = __toCommonJS(Dexto_exports);
24
- var import_logger = require("./logger/index.js");
25
- var import_registry = require("./agent/registry/registry.js");
26
- var import_loader = require("./config/loader.js");
27
- var import_errors = require("./agent/errors.js");
28
- var import_DextoAgent = require("./agent/DextoAgent.js");
29
- var import_types = require("./agent/registry/types.js");
30
- class Dexto {
31
- /**
32
- * Lists available and installed agents from the registry.
33
- * Returns a structured object containing both installed and available agents,
34
- * along with metadata like descriptions, authors, and tags.
35
- *
36
- * @returns Promise resolving to object with installed and available agent lists
37
- *
38
- * @example
39
- * ```typescript
40
- * const agents = await Dexto.listAgents();
41
- * console.log(agents.installed); // ['default', 'my-custom-agent']
42
- * console.log(agents.available); // [{ name: 'productivity', description: '...', ... }]
43
- * console.log(agents.current?.name); // 'default'
44
- * ```
45
- */
46
- static async listAgents() {
47
- const agentRegistry = (0, import_registry.getAgentRegistry)();
48
- const availableMap = agentRegistry.getAvailableAgents();
49
- const installedNames = await agentRegistry.getInstalledAgents();
50
- const installed = await Promise.all(
51
- installedNames.map(async (agentId) => {
52
- const registryEntry = availableMap[agentId];
53
- if (registryEntry) {
54
- return {
55
- id: agentId,
56
- name: registryEntry.name,
57
- description: registryEntry.description,
58
- author: registryEntry.author,
59
- tags: registryEntry.tags,
60
- type: registryEntry.type
61
- };
62
- } else {
63
- try {
64
- const config = await (0, import_loader.loadAgentConfig)(agentId);
65
- const author = config.agentCard?.provider?.organization;
66
- const result = {
67
- id: agentId,
68
- name: typeof config.agentCard?.name === "string" ? config.agentCard.name : (0, import_types.deriveDisplayName)(agentId),
69
- description: config.agentCard?.description || "Local agent",
70
- tags: [],
71
- type: "custom"
72
- // Assume custom if not in registry
73
- };
74
- if (author) {
75
- result.author = author;
76
- }
77
- return result;
78
- } catch {
79
- const result = {
80
- id: agentId,
81
- name: (0, import_types.deriveDisplayName)(agentId),
82
- description: "Local agent (config unavailable)",
83
- tags: [],
84
- type: "custom"
85
- // Assume custom if not in registry
86
- };
87
- return result;
88
- }
89
- }
90
- })
91
- );
92
- const available = Object.entries(availableMap).filter(([agentId]) => !installedNames.includes(agentId)).map(([agentId, entry]) => ({
93
- id: agentId,
94
- name: entry.name,
95
- description: entry.description,
96
- author: entry.author,
97
- tags: entry.tags,
98
- type: entry.type
99
- }));
100
- return {
101
- installed,
102
- available,
103
- current: { id: null, name: null }
104
- // TODO: Track current agent name
105
- };
106
- }
107
- /**
108
- * Installs an agent from the registry.
109
- * Downloads and sets up the specified agent, making it available for use.
110
- *
111
- * @param agentName The name of the agent to install from the registry
112
- * @returns Promise that resolves when installation is complete
113
- *
114
- * @throws {AgentError} When agent is not found in registry or installation fails
115
- *
116
- * @example
117
- * ```typescript
118
- * await Dexto.installAgent('productivity');
119
- * console.log('Productivity agent installed successfully');
120
- * ```
121
- */
122
- static async installAgent(agentName) {
123
- const agentRegistry = (0, import_registry.getAgentRegistry)();
124
- if (!agentRegistry.hasAgent(agentName)) {
125
- throw import_errors.AgentError.apiValidationError(`Agent '${agentName}' not found in registry`);
126
- }
127
- try {
128
- await agentRegistry.installAgent(agentName, true);
129
- import_logger.logger.info(`Successfully installed agent: ${agentName}`);
130
- } catch (error) {
131
- const errorMessage = error instanceof Error ? error.message : String(error);
132
- import_logger.logger.error(`Failed to install agent ${agentName}: ${errorMessage}`);
133
- throw import_errors.AgentError.apiValidationError(
134
- `Installation failed for agent '${agentName}'`,
135
- error
136
- );
137
- }
138
- }
139
- /**
140
- * Installs a custom agent from a local file or directory path.
141
- * Creates a new custom agent entry in the user registry with provided metadata.
142
- *
143
- * @param agentName The name to use for the custom agent (must be unique)
144
- * @param sourcePath Absolute path to the agent YAML file or directory
145
- * @param metadata Agent metadata (description, author, tags, main config file)
146
- * @param injectPreferences Whether to inject global preferences into agent config (default: true)
147
- * @returns Promise resolving to the path of the installed main config file
148
- *
149
- * @throws {AgentError} When name conflicts with existing agent or installation fails
150
- *
151
- * @example
152
- * ```typescript
153
- * await Dexto.installCustomAgent('my-coding-agent', '/path/to/agent.yml', {
154
- * description: 'Custom coding assistant',
155
- * author: 'John Doe',
156
- * tags: ['coding', 'custom']
157
- * });
158
- * console.log('Custom agent installed successfully');
159
- * ```
160
- */
161
- static async installCustomAgent(agentName, sourcePath, metadata, injectPreferences = true) {
162
- const agentRegistry = (0, import_registry.getAgentRegistry)();
163
- try {
164
- const mainConfigPath = await agentRegistry.installCustomAgentFromPath(
165
- agentName,
166
- sourcePath,
167
- metadata,
168
- injectPreferences
169
- );
170
- import_logger.logger.info(`Successfully installed custom agent: ${agentName}`);
171
- return mainConfigPath;
172
- } catch (error) {
173
- const errorMessage = error instanceof Error ? error.message : String(error);
174
- import_logger.logger.error(`Failed to install custom agent ${agentName}: ${errorMessage}`);
175
- throw import_errors.AgentError.apiValidationError(
176
- `Installation failed for custom agent '${agentName}'`,
177
- error
178
- );
179
- }
180
- }
181
- /**
182
- * Uninstalls an agent by removing its directory from disk.
183
- * For custom agents: also removes from user registry.
184
- * For builtin agents: only removes from disk (can be reinstalled).
185
- *
186
- * @param agentName The name of the agent to uninstall
187
- * @param force Whether to force uninstall even if agent is protected (default: false)
188
- * @returns Promise that resolves when uninstallation is complete
189
- *
190
- * @throws {AgentError} When agent is not installed or uninstallation fails
191
- *
192
- * @example
193
- * ```typescript
194
- * await Dexto.uninstallAgent('my-custom-agent');
195
- * console.log('Agent uninstalled successfully');
196
- * ```
197
- */
198
- static async uninstallAgent(agentName, force = false) {
199
- const agentRegistry = (0, import_registry.getAgentRegistry)();
200
- try {
201
- await agentRegistry.uninstallAgent(agentName, force);
202
- import_logger.logger.info(`Successfully uninstalled agent: ${agentName}`);
203
- } catch (error) {
204
- const errorMessage = error instanceof Error ? error.message : String(error);
205
- import_logger.logger.error(`Failed to uninstall agent ${agentName}: ${errorMessage}`);
206
- throw import_errors.AgentError.apiValidationError(
207
- `Uninstallation failed for agent '${agentName}'`,
208
- error
209
- );
210
- }
211
- }
212
- /**
213
- * Creates a new agent instance for the specified agent name.
214
- * This method resolves the agent (installing if needed), loads its configuration,
215
- * and returns a new DextoAgent instance ready to be started.
216
- *
217
- * This is a factory method that doesn't affect any existing agent instances.
218
- * The caller is responsible for managing the lifecycle of the returned agent.
219
- *
220
- * @param agentName The name of the agent to create
221
- * @returns Promise resolving to a new DextoAgent instance (not started)
222
- *
223
- * @throws {AgentError} When agent is not found or creation fails
224
- *
225
- * @example
226
- * ```typescript
227
- * const newAgent = await Dexto.createAgent('productivity');
228
- * await newAgent.start();
229
- * ```
230
- */
231
- static async createAgent(agentName) {
232
- const agentRegistry = (0, import_registry.getAgentRegistry)();
233
- try {
234
- const agentPath = await agentRegistry.resolveAgent(agentName, true, true);
235
- const config = await (0, import_loader.loadAgentConfig)(agentPath);
236
- import_logger.logger.info(`Creating agent: ${agentName}`);
237
- const newAgent = new import_DextoAgent.DextoAgent(config, agentPath);
238
- import_logger.logger.info(`Successfully created agent: ${agentName}`);
239
- return newAgent;
240
- } catch (error) {
241
- import_logger.logger.error(
242
- `Failed to create agent '${agentName}': ${error instanceof Error ? error.message : String(error)}`
243
- );
244
- throw import_errors.AgentError.apiValidationError(`Failed to create agent '${agentName}'`, error);
245
- }
246
- }
247
- }
248
- // Annotate the CommonJS export names for ESM import in node:
249
- 0 && (module.exports = {
250
- Dexto
251
- });
package/dist/Dexto.d.ts DELETED
@@ -1,191 +0,0 @@
1
- import { DextoAgent } from './agent/DextoAgent.js';
2
- /**
3
- * Dexto - Main orchestrator class for managing Dexto agents
4
- *
5
- * This class serves as the primary entry point for agent lifecycle management,
6
- * including installation, creation, and coordination of multiple agent instances.
7
- *
8
- * ## Current Features
9
- * - **Agent Discovery**: List available and installed agents
10
- * - **Agent Installation**: Install agents from registry or custom sources
11
- * - **Agent Creation**: Factory methods for creating agent instances
12
- * - **Agent Removal**: Uninstall agents from the system
13
- *
14
- * ## Future Orchestration Features (Planned)
15
- * The following features are planned for future releases to enable advanced
16
- * multi-agent orchestration and coordination:
17
- *
18
- * ### Multi-Agent Instance Management
19
- * - Manage multiple concurrent agent instances with different configurations
20
- * - Track agent lifecycle states (created, started, stopped, errored)
21
- * - Provide APIs for listing and querying active agent instances
22
- *
23
- * ### Agent Switching & Routing
24
- * - Switch between active agents dynamically during runtime
25
- * - Route requests to appropriate agents based on context or capabilities
26
- * - Maintain conversation continuity across agent switches
27
- *
28
- * ### Cross-Agent Coordination
29
- * - Enable agents to collaborate on complex tasks requiring specialized skills
30
- * - Delegate sub-tasks from one agent to another
31
- * - Aggregate results from multiple agents working in parallel
32
- *
33
- * ### Global Event Bus
34
- * - Centralized event bus for cross-agent communication
35
- * - Subscribe to events from any managed agent instance
36
- * - Coordinate state synchronization across agent boundaries
37
- *
38
- * ### Resource Management
39
- * - Shared resource pools (API keys, rate limits, connection pools)
40
- * - Resource allocation and quota management across agents
41
- * - Prevent resource conflicts between concurrent agent instances
42
- *
43
- * ### Agent Persistence & Sessions
44
- * - Save and restore agent instances with their full state
45
- * - Support for long-running agent workflows that span multiple sessions
46
- * - Checkpoint and resume capabilities for complex agent operations
47
- *
48
- * @example
49
- * ```typescript
50
- * // List available agents
51
- * const agents = await Dexto.listAgents();
52
- * console.log(agents.installed, agents.available);
53
- *
54
- * // Install agent
55
- * await Dexto.installAgent('productivity');
56
- *
57
- * // Create and start agent
58
- * const agent = await Dexto.createAgent('productivity');
59
- * await agent.start();
60
- *
61
- * // Install custom agent
62
- * await Dexto.installCustomAgent('my-agent', '/path/to/config.yml', {
63
- * description: 'My custom agent',
64
- * author: 'John Doe',
65
- * tags: ['custom', 'specialized']
66
- * });
67
- * ```
68
- */
69
- export declare class Dexto {
70
- /**
71
- * Lists available and installed agents from the registry.
72
- * Returns a structured object containing both installed and available agents,
73
- * along with metadata like descriptions, authors, and tags.
74
- *
75
- * @returns Promise resolving to object with installed and available agent lists
76
- *
77
- * @example
78
- * ```typescript
79
- * const agents = await Dexto.listAgents();
80
- * console.log(agents.installed); // ['default', 'my-custom-agent']
81
- * console.log(agents.available); // [{ name: 'productivity', description: '...', ... }]
82
- * console.log(agents.current?.name); // 'default'
83
- * ```
84
- */
85
- static listAgents(): Promise<{
86
- installed: Array<{
87
- id: string;
88
- name: string;
89
- description: string;
90
- author?: string;
91
- tags?: string[];
92
- type: 'builtin' | 'custom';
93
- }>;
94
- available: Array<{
95
- id: string;
96
- name: string;
97
- description: string;
98
- author?: string;
99
- tags?: string[];
100
- type: 'builtin' | 'custom';
101
- }>;
102
- current?: {
103
- id?: string | null;
104
- name?: string | null;
105
- };
106
- }>;
107
- /**
108
- * Installs an agent from the registry.
109
- * Downloads and sets up the specified agent, making it available for use.
110
- *
111
- * @param agentName The name of the agent to install from the registry
112
- * @returns Promise that resolves when installation is complete
113
- *
114
- * @throws {AgentError} When agent is not found in registry or installation fails
115
- *
116
- * @example
117
- * ```typescript
118
- * await Dexto.installAgent('productivity');
119
- * console.log('Productivity agent installed successfully');
120
- * ```
121
- */
122
- static installAgent(agentName: string): Promise<void>;
123
- /**
124
- * Installs a custom agent from a local file or directory path.
125
- * Creates a new custom agent entry in the user registry with provided metadata.
126
- *
127
- * @param agentName The name to use for the custom agent (must be unique)
128
- * @param sourcePath Absolute path to the agent YAML file or directory
129
- * @param metadata Agent metadata (description, author, tags, main config file)
130
- * @param injectPreferences Whether to inject global preferences into agent config (default: true)
131
- * @returns Promise resolving to the path of the installed main config file
132
- *
133
- * @throws {AgentError} When name conflicts with existing agent or installation fails
134
- *
135
- * @example
136
- * ```typescript
137
- * await Dexto.installCustomAgent('my-coding-agent', '/path/to/agent.yml', {
138
- * description: 'Custom coding assistant',
139
- * author: 'John Doe',
140
- * tags: ['coding', 'custom']
141
- * });
142
- * console.log('Custom agent installed successfully');
143
- * ```
144
- */
145
- static installCustomAgent(agentName: string, sourcePath: string, metadata: {
146
- name?: string;
147
- description: string;
148
- author: string;
149
- tags: string[];
150
- main?: string;
151
- }, injectPreferences?: boolean): Promise<string>;
152
- /**
153
- * Uninstalls an agent by removing its directory from disk.
154
- * For custom agents: also removes from user registry.
155
- * For builtin agents: only removes from disk (can be reinstalled).
156
- *
157
- * @param agentName The name of the agent to uninstall
158
- * @param force Whether to force uninstall even if agent is protected (default: false)
159
- * @returns Promise that resolves when uninstallation is complete
160
- *
161
- * @throws {AgentError} When agent is not installed or uninstallation fails
162
- *
163
- * @example
164
- * ```typescript
165
- * await Dexto.uninstallAgent('my-custom-agent');
166
- * console.log('Agent uninstalled successfully');
167
- * ```
168
- */
169
- static uninstallAgent(agentName: string, force?: boolean): Promise<void>;
170
- /**
171
- * Creates a new agent instance for the specified agent name.
172
- * This method resolves the agent (installing if needed), loads its configuration,
173
- * and returns a new DextoAgent instance ready to be started.
174
- *
175
- * This is a factory method that doesn't affect any existing agent instances.
176
- * The caller is responsible for managing the lifecycle of the returned agent.
177
- *
178
- * @param agentName The name of the agent to create
179
- * @returns Promise resolving to a new DextoAgent instance (not started)
180
- *
181
- * @throws {AgentError} When agent is not found or creation fails
182
- *
183
- * @example
184
- * ```typescript
185
- * const newAgent = await Dexto.createAgent('productivity');
186
- * await newAgent.start();
187
- * ```
188
- */
189
- static createAgent(agentName: string): Promise<DextoAgent>;
190
- }
191
- //# sourceMappingURL=Dexto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Dexto.d.ts","sourceRoot":"","sources":["../src/Dexto.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,qBAAa,KAAK;IACd;;;;;;;;;;;;;;OAcG;WACiB,UAAU,IAAI,OAAO,CAAC;QACtC,SAAS,EAAE,KAAK,CAAC;YACb,EAAE,EAAE,MAAM,CAAC;YACX,IAAI,EAAE,MAAM,CAAC;YACb,WAAW,EAAE,MAAM,CAAC;YACpB,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;YAChB,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;SAC9B,CAAC,CAAC;QACH,SAAS,EAAE,KAAK,CAAC;YACb,EAAE,EAAE,MAAM,CAAC;YACX,IAAI,EAAE,MAAM,CAAC;YACb,WAAW,EAAE,MAAM,CAAC;YACpB,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;YAChB,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;SAC9B,CAAC,CAAC;QACH,OAAO,CAAC,EAAE;YAAE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAC;KAC1D,CAAC;IAoFF;;;;;;;;;;;;;;OAcG;WACiB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBlE;;;;;;;;;;;;;;;;;;;;;OAqBG;WACiB,kBAAkB,CAClC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACjB,EACD,iBAAiB,GAAE,OAAc,GAClC,OAAO,CAAC,MAAM,CAAC;IAsBlB;;;;;;;;;;;;;;;;OAgBG;WACiB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,GAAE,OAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB5F;;;;;;;;;;;;;;;;;;OAkBG;WACiB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;CAyB1E"}
package/dist/Dexto.js DELETED
@@ -1,228 +0,0 @@
1
- import "./chunk-C6A6W6XS.js";
2
- import { logger } from "./logger/index.js";
3
- import { getAgentRegistry } from "./agent/registry/registry.js";
4
- import { loadAgentConfig } from "./config/loader.js";
5
- import { AgentError } from "./agent/errors.js";
6
- import { DextoAgent } from "./agent/DextoAgent.js";
7
- import { deriveDisplayName } from "./agent/registry/types.js";
8
- class Dexto {
9
- /**
10
- * Lists available and installed agents from the registry.
11
- * Returns a structured object containing both installed and available agents,
12
- * along with metadata like descriptions, authors, and tags.
13
- *
14
- * @returns Promise resolving to object with installed and available agent lists
15
- *
16
- * @example
17
- * ```typescript
18
- * const agents = await Dexto.listAgents();
19
- * console.log(agents.installed); // ['default', 'my-custom-agent']
20
- * console.log(agents.available); // [{ name: 'productivity', description: '...', ... }]
21
- * console.log(agents.current?.name); // 'default'
22
- * ```
23
- */
24
- static async listAgents() {
25
- const agentRegistry = getAgentRegistry();
26
- const availableMap = agentRegistry.getAvailableAgents();
27
- const installedNames = await agentRegistry.getInstalledAgents();
28
- const installed = await Promise.all(
29
- installedNames.map(async (agentId) => {
30
- const registryEntry = availableMap[agentId];
31
- if (registryEntry) {
32
- return {
33
- id: agentId,
34
- name: registryEntry.name,
35
- description: registryEntry.description,
36
- author: registryEntry.author,
37
- tags: registryEntry.tags,
38
- type: registryEntry.type
39
- };
40
- } else {
41
- try {
42
- const config = await loadAgentConfig(agentId);
43
- const author = config.agentCard?.provider?.organization;
44
- const result = {
45
- id: agentId,
46
- name: typeof config.agentCard?.name === "string" ? config.agentCard.name : deriveDisplayName(agentId),
47
- description: config.agentCard?.description || "Local agent",
48
- tags: [],
49
- type: "custom"
50
- // Assume custom if not in registry
51
- };
52
- if (author) {
53
- result.author = author;
54
- }
55
- return result;
56
- } catch {
57
- const result = {
58
- id: agentId,
59
- name: deriveDisplayName(agentId),
60
- description: "Local agent (config unavailable)",
61
- tags: [],
62
- type: "custom"
63
- // Assume custom if not in registry
64
- };
65
- return result;
66
- }
67
- }
68
- })
69
- );
70
- const available = Object.entries(availableMap).filter(([agentId]) => !installedNames.includes(agentId)).map(([agentId, entry]) => ({
71
- id: agentId,
72
- name: entry.name,
73
- description: entry.description,
74
- author: entry.author,
75
- tags: entry.tags,
76
- type: entry.type
77
- }));
78
- return {
79
- installed,
80
- available,
81
- current: { id: null, name: null }
82
- // TODO: Track current agent name
83
- };
84
- }
85
- /**
86
- * Installs an agent from the registry.
87
- * Downloads and sets up the specified agent, making it available for use.
88
- *
89
- * @param agentName The name of the agent to install from the registry
90
- * @returns Promise that resolves when installation is complete
91
- *
92
- * @throws {AgentError} When agent is not found in registry or installation fails
93
- *
94
- * @example
95
- * ```typescript
96
- * await Dexto.installAgent('productivity');
97
- * console.log('Productivity agent installed successfully');
98
- * ```
99
- */
100
- static async installAgent(agentName) {
101
- const agentRegistry = getAgentRegistry();
102
- if (!agentRegistry.hasAgent(agentName)) {
103
- throw AgentError.apiValidationError(`Agent '${agentName}' not found in registry`);
104
- }
105
- try {
106
- await agentRegistry.installAgent(agentName, true);
107
- logger.info(`Successfully installed agent: ${agentName}`);
108
- } catch (error) {
109
- const errorMessage = error instanceof Error ? error.message : String(error);
110
- logger.error(`Failed to install agent ${agentName}: ${errorMessage}`);
111
- throw AgentError.apiValidationError(
112
- `Installation failed for agent '${agentName}'`,
113
- error
114
- );
115
- }
116
- }
117
- /**
118
- * Installs a custom agent from a local file or directory path.
119
- * Creates a new custom agent entry in the user registry with provided metadata.
120
- *
121
- * @param agentName The name to use for the custom agent (must be unique)
122
- * @param sourcePath Absolute path to the agent YAML file or directory
123
- * @param metadata Agent metadata (description, author, tags, main config file)
124
- * @param injectPreferences Whether to inject global preferences into agent config (default: true)
125
- * @returns Promise resolving to the path of the installed main config file
126
- *
127
- * @throws {AgentError} When name conflicts with existing agent or installation fails
128
- *
129
- * @example
130
- * ```typescript
131
- * await Dexto.installCustomAgent('my-coding-agent', '/path/to/agent.yml', {
132
- * description: 'Custom coding assistant',
133
- * author: 'John Doe',
134
- * tags: ['coding', 'custom']
135
- * });
136
- * console.log('Custom agent installed successfully');
137
- * ```
138
- */
139
- static async installCustomAgent(agentName, sourcePath, metadata, injectPreferences = true) {
140
- const agentRegistry = getAgentRegistry();
141
- try {
142
- const mainConfigPath = await agentRegistry.installCustomAgentFromPath(
143
- agentName,
144
- sourcePath,
145
- metadata,
146
- injectPreferences
147
- );
148
- logger.info(`Successfully installed custom agent: ${agentName}`);
149
- return mainConfigPath;
150
- } catch (error) {
151
- const errorMessage = error instanceof Error ? error.message : String(error);
152
- logger.error(`Failed to install custom agent ${agentName}: ${errorMessage}`);
153
- throw AgentError.apiValidationError(
154
- `Installation failed for custom agent '${agentName}'`,
155
- error
156
- );
157
- }
158
- }
159
- /**
160
- * Uninstalls an agent by removing its directory from disk.
161
- * For custom agents: also removes from user registry.
162
- * For builtin agents: only removes from disk (can be reinstalled).
163
- *
164
- * @param agentName The name of the agent to uninstall
165
- * @param force Whether to force uninstall even if agent is protected (default: false)
166
- * @returns Promise that resolves when uninstallation is complete
167
- *
168
- * @throws {AgentError} When agent is not installed or uninstallation fails
169
- *
170
- * @example
171
- * ```typescript
172
- * await Dexto.uninstallAgent('my-custom-agent');
173
- * console.log('Agent uninstalled successfully');
174
- * ```
175
- */
176
- static async uninstallAgent(agentName, force = false) {
177
- const agentRegistry = getAgentRegistry();
178
- try {
179
- await agentRegistry.uninstallAgent(agentName, force);
180
- logger.info(`Successfully uninstalled agent: ${agentName}`);
181
- } catch (error) {
182
- const errorMessage = error instanceof Error ? error.message : String(error);
183
- logger.error(`Failed to uninstall agent ${agentName}: ${errorMessage}`);
184
- throw AgentError.apiValidationError(
185
- `Uninstallation failed for agent '${agentName}'`,
186
- error
187
- );
188
- }
189
- }
190
- /**
191
- * Creates a new agent instance for the specified agent name.
192
- * This method resolves the agent (installing if needed), loads its configuration,
193
- * and returns a new DextoAgent instance ready to be started.
194
- *
195
- * This is a factory method that doesn't affect any existing agent instances.
196
- * The caller is responsible for managing the lifecycle of the returned agent.
197
- *
198
- * @param agentName The name of the agent to create
199
- * @returns Promise resolving to a new DextoAgent instance (not started)
200
- *
201
- * @throws {AgentError} When agent is not found or creation fails
202
- *
203
- * @example
204
- * ```typescript
205
- * const newAgent = await Dexto.createAgent('productivity');
206
- * await newAgent.start();
207
- * ```
208
- */
209
- static async createAgent(agentName) {
210
- const agentRegistry = getAgentRegistry();
211
- try {
212
- const agentPath = await agentRegistry.resolveAgent(agentName, true, true);
213
- const config = await loadAgentConfig(agentPath);
214
- logger.info(`Creating agent: ${agentName}`);
215
- const newAgent = new DextoAgent(config, agentPath);
216
- logger.info(`Successfully created agent: ${agentName}`);
217
- return newAgent;
218
- } catch (error) {
219
- logger.error(
220
- `Failed to create agent '${agentName}': ${error instanceof Error ? error.message : String(error)}`
221
- );
222
- throw AgentError.apiValidationError(`Failed to create agent '${agentName}'`, error);
223
- }
224
- }
225
- }
226
- export {
227
- Dexto
228
- };