@zhin.js/agent 0.3.1 → 1.0.2

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 (1437) hide show
  1. package/README.md +123 -50
  2. package/lib/a2a/delegation-message.d.ts +14 -0
  3. package/lib/a2a/delegation-message.d.ts.map +1 -0
  4. package/lib/a2a/delegation-message.js +53 -0
  5. package/lib/a2a/delegation-message.js.map +1 -0
  6. package/lib/a2a/task-state.d.ts +9 -0
  7. package/lib/a2a/task-state.d.ts.map +1 -0
  8. package/lib/a2a/task-state.js +53 -0
  9. package/lib/a2a/task-state.js.map +1 -0
  10. package/lib/activity-feedback/adapter-integration.d.ts +51 -0
  11. package/lib/activity-feedback/adapter-integration.d.ts.map +1 -0
  12. package/lib/activity-feedback/adapter-integration.js +130 -0
  13. package/lib/activity-feedback/adapter-integration.js.map +1 -0
  14. package/lib/activity-feedback/config-resolver.d.ts +3 -0
  15. package/lib/activity-feedback/config-resolver.d.ts.map +1 -0
  16. package/lib/activity-feedback/config-resolver.js +89 -0
  17. package/lib/activity-feedback/config-resolver.js.map +1 -0
  18. package/lib/activity-feedback/event-context.d.ts +22 -0
  19. package/lib/activity-feedback/event-context.d.ts.map +1 -0
  20. package/lib/activity-feedback/event-context.js +65 -0
  21. package/lib/activity-feedback/event-context.js.map +1 -0
  22. package/lib/activity-feedback/index.d.ts +10 -0
  23. package/lib/activity-feedback/index.d.ts.map +1 -0
  24. package/lib/activity-feedback/index.js +7 -0
  25. package/lib/activity-feedback/index.js.map +1 -0
  26. package/lib/activity-feedback/manager.d.ts +15 -0
  27. package/lib/activity-feedback/manager.d.ts.map +1 -0
  28. package/lib/activity-feedback/manager.js +47 -0
  29. package/lib/activity-feedback/manager.js.map +1 -0
  30. package/lib/activity-feedback/schedule-guard.d.ts +8 -0
  31. package/lib/activity-feedback/schedule-guard.d.ts.map +1 -0
  32. package/lib/activity-feedback/schedule-guard.js +26 -0
  33. package/lib/activity-feedback/schedule-guard.js.map +1 -0
  34. package/lib/activity-feedback/types.d.ts +24 -0
  35. package/lib/activity-feedback/types.d.ts.map +1 -0
  36. package/lib/activity-feedback/types.js +11 -0
  37. package/lib/activity-feedback/types.js.map +1 -0
  38. package/lib/agent-prompt/registry.d.ts +1 -1
  39. package/lib/agent-prompt/registry.d.ts.map +1 -1
  40. package/lib/agent-prompt/registry.js.map +1 -1
  41. package/lib/agent-prompt/resolver.d.ts +2 -2
  42. package/lib/agent-prompt/resolver.d.ts.map +1 -1
  43. package/lib/agent-prompt/resolver.js +4 -2
  44. package/lib/agent-prompt/resolver.js.map +1 -1
  45. package/lib/ai-event-bus.d.ts +1 -1
  46. package/lib/ai-event-bus.d.ts.map +1 -1
  47. package/lib/ai-event-bus.js +2 -3
  48. package/lib/ai-event-bus.js.map +1 -1
  49. package/lib/ai-event-subscriber.d.ts +7 -2
  50. package/lib/ai-event-subscriber.d.ts.map +1 -1
  51. package/lib/ai-event-subscriber.js +5 -0
  52. package/lib/ai-event-subscriber.js.map +1 -1
  53. package/lib/aop/coordination/index.d.ts +7 -0
  54. package/lib/aop/coordination/index.d.ts.map +1 -0
  55. package/lib/aop/coordination/index.js +7 -0
  56. package/lib/aop/coordination/index.js.map +1 -0
  57. package/lib/aop/inbound/index.d.ts +7 -0
  58. package/lib/aop/inbound/index.d.ts.map +1 -0
  59. package/lib/aop/inbound/index.js +6 -0
  60. package/lib/aop/inbound/index.js.map +1 -0
  61. package/lib/aop/index.d.ts +11 -0
  62. package/lib/aop/index.d.ts.map +1 -0
  63. package/lib/aop/index.js +11 -0
  64. package/lib/aop/index.js.map +1 -0
  65. package/lib/aop/pipeline/index.d.ts +12 -0
  66. package/lib/aop/pipeline/index.d.ts.map +1 -0
  67. package/lib/aop/pipeline/index.js +12 -0
  68. package/lib/aop/pipeline/index.js.map +1 -0
  69. package/lib/aop/pipeline/pipeline-flow.d.ts +25 -0
  70. package/lib/aop/pipeline/pipeline-flow.d.ts.map +1 -0
  71. package/lib/aop/pipeline/pipeline-flow.js +115 -0
  72. package/lib/aop/pipeline/pipeline-flow.js.map +1 -0
  73. package/lib/aop/pipeline/pipeline-mode.d.ts +10 -0
  74. package/lib/aop/pipeline/pipeline-mode.d.ts.map +1 -0
  75. package/lib/aop/pipeline/pipeline-mode.js +16 -0
  76. package/lib/aop/pipeline/pipeline-mode.js.map +1 -0
  77. package/lib/aop/pipeline/pipeline-service.d.ts +121 -0
  78. package/lib/aop/pipeline/pipeline-service.d.ts.map +1 -0
  79. package/lib/aop/pipeline/pipeline-service.js +226 -0
  80. package/lib/aop/pipeline/pipeline-service.js.map +1 -0
  81. package/lib/aop/pipeline/pipeline-transitions.d.ts +14 -0
  82. package/lib/aop/pipeline/pipeline-transitions.d.ts.map +1 -0
  83. package/lib/aop/pipeline/pipeline-transitions.js +31 -0
  84. package/lib/aop/pipeline/pipeline-transitions.js.map +1 -0
  85. package/lib/aop/pipeline/ports.d.ts +16 -0
  86. package/lib/aop/pipeline/ports.d.ts.map +1 -0
  87. package/lib/aop/pipeline/ports.js +2 -0
  88. package/lib/aop/pipeline/ports.js.map +1 -0
  89. package/lib/aop/pipeline/role-capability-policy.d.ts +16 -0
  90. package/lib/aop/pipeline/role-capability-policy.d.ts.map +1 -0
  91. package/lib/aop/pipeline/role-capability-policy.js +29 -0
  92. package/lib/aop/pipeline/role-capability-policy.js.map +1 -0
  93. package/lib/aop/runtime/index.d.ts +9 -0
  94. package/lib/aop/runtime/index.d.ts.map +1 -0
  95. package/lib/aop/runtime/index.js +9 -0
  96. package/lib/aop/runtime/index.js.map +1 -0
  97. package/lib/assistant/domains/home-assistant.d.ts +1 -1
  98. package/lib/assistant/domains/home-assistant.d.ts.map +1 -1
  99. package/lib/assistant/domains/home-assistant.js.map +1 -1
  100. package/lib/assistant/event-ingress.d.ts +5 -5
  101. package/lib/assistant/event-ingress.d.ts.map +1 -1
  102. package/lib/assistant/event-ingress.js.map +1 -1
  103. package/lib/assistant/home-mcp-bridge.d.ts +1 -1
  104. package/lib/assistant/home-mcp-bridge.d.ts.map +1 -1
  105. package/lib/assistant/home-mcp-bridge.js.map +1 -1
  106. package/lib/assistant/home-policy.d.ts +4 -1
  107. package/lib/assistant/home-policy.d.ts.map +1 -1
  108. package/lib/assistant/home-policy.js +1 -1
  109. package/lib/assistant/home-policy.js.map +1 -1
  110. package/lib/assistant/home-tools.d.ts.map +1 -1
  111. package/lib/assistant/home-tools.js +1 -2
  112. package/lib/assistant/home-tools.js.map +1 -1
  113. package/lib/assistant/index.d.ts +18 -9
  114. package/lib/assistant/index.d.ts.map +1 -1
  115. package/lib/assistant/index.js +13 -6
  116. package/lib/assistant/index.js.map +1 -1
  117. package/lib/assistant/job-creator.d.ts +14 -0
  118. package/lib/assistant/job-creator.d.ts.map +1 -0
  119. package/lib/assistant/job-creator.js +44 -0
  120. package/lib/assistant/job-creator.js.map +1 -0
  121. package/lib/assistant/job-engine.d.ts +17 -17
  122. package/lib/assistant/job-engine.d.ts.map +1 -1
  123. package/lib/assistant/job-engine.js +29 -35
  124. package/lib/assistant/job-engine.js.map +1 -1
  125. package/lib/assistant/job-scheduler.d.ts +8 -4
  126. package/lib/assistant/job-scheduler.d.ts.map +1 -1
  127. package/lib/assistant/job-scheduler.js +59 -33
  128. package/lib/assistant/job-scheduler.js.map +1 -1
  129. package/lib/assistant/job-store.d.ts +24 -33
  130. package/lib/assistant/job-store.d.ts.map +1 -1
  131. package/lib/assistant/job-store.js +69 -184
  132. package/lib/assistant/job-store.js.map +1 -1
  133. package/lib/assistant/job-utils.d.ts +2 -0
  134. package/lib/assistant/job-utils.d.ts.map +1 -0
  135. package/lib/assistant/job-utils.js +7 -0
  136. package/lib/assistant/job-utils.js.map +1 -0
  137. package/lib/assistant/job-worker.d.ts +6 -2
  138. package/lib/assistant/job-worker.d.ts.map +1 -1
  139. package/lib/assistant/job-worker.js +8 -0
  140. package/lib/assistant/job-worker.js.map +1 -1
  141. package/lib/assistant/notification-router.d.ts +6 -3
  142. package/lib/assistant/notification-router.d.ts.map +1 -1
  143. package/lib/assistant/notification-router.js +75 -32
  144. package/lib/assistant/notification-router.js.map +1 -1
  145. package/lib/assistant/profile-loader.d.ts +15 -10
  146. package/lib/assistant/profile-loader.d.ts.map +1 -1
  147. package/lib/assistant/profile-loader.js +88 -25
  148. package/lib/assistant/profile-loader.js.map +1 -1
  149. package/lib/assistant/profile-types.d.ts +6 -1
  150. package/lib/assistant/profile-types.d.ts.map +1 -1
  151. package/lib/assistant/profile-types.js.map +1 -1
  152. package/lib/assistant/runtime-registry.d.ts +3 -3
  153. package/lib/assistant/runtime-registry.d.ts.map +1 -1
  154. package/lib/assistant/runtime-registry.js +3 -0
  155. package/lib/assistant/runtime-registry.js.map +1 -1
  156. package/lib/assistant/schedule-execution.d.ts +22 -0
  157. package/lib/assistant/schedule-execution.d.ts.map +1 -0
  158. package/lib/assistant/schedule-execution.js +99 -0
  159. package/lib/assistant/schedule-execution.js.map +1 -0
  160. package/lib/assistant/schedule-job-service.d.ts +25 -0
  161. package/lib/assistant/schedule-job-service.d.ts.map +1 -0
  162. package/lib/assistant/schedule-job-service.js +129 -0
  163. package/lib/assistant/schedule-job-service.js.map +1 -0
  164. package/lib/assistant/schedule-message.d.ts +9 -0
  165. package/lib/assistant/schedule-message.d.ts.map +1 -0
  166. package/lib/assistant/schedule-message.js +23 -0
  167. package/lib/assistant/schedule-message.js.map +1 -0
  168. package/lib/assistant/schedule-skills.d.ts +3 -0
  169. package/lib/assistant/schedule-skills.d.ts.map +1 -0
  170. package/lib/assistant/schedule-skills.js +24 -0
  171. package/lib/assistant/schedule-skills.js.map +1 -0
  172. package/lib/assistant/schedule-tool-runtime.d.ts +7 -0
  173. package/lib/assistant/schedule-tool-runtime.d.ts.map +1 -0
  174. package/lib/assistant/schedule-tool-runtime.js +50 -0
  175. package/lib/assistant/schedule-tool-runtime.js.map +1 -0
  176. package/lib/assistant/types.d.ts +70 -18
  177. package/lib/assistant/types.d.ts.map +1 -1
  178. package/lib/assistant/types.js +6 -5
  179. package/lib/assistant/types.js.map +1 -1
  180. package/lib/builtin/analyze-media-tool.d.ts +1 -1
  181. package/lib/builtin/analyze-media-tool.d.ts.map +1 -1
  182. package/lib/builtin/analyze-media-tool.js +2 -2
  183. package/lib/builtin/analyze-media-tool.js.map +1 -1
  184. package/lib/builtin/ask-user-session-service.d.ts +40 -0
  185. package/lib/builtin/ask-user-session-service.d.ts.map +1 -0
  186. package/lib/builtin/ask-user-session-service.js +258 -0
  187. package/lib/builtin/ask-user-session-service.js.map +1 -0
  188. package/lib/builtin/ask-user-session.d.ts +18 -0
  189. package/lib/builtin/ask-user-session.d.ts.map +1 -0
  190. package/lib/builtin/ask-user-session.js +21 -0
  191. package/lib/builtin/ask-user-session.js.map +1 -0
  192. package/lib/builtin/ask-user-tool.d.ts +7 -15
  193. package/lib/builtin/ask-user-tool.d.ts.map +1 -1
  194. package/lib/builtin/ask-user-tool.js +73 -113
  195. package/lib/builtin/ask-user-tool.js.map +1 -1
  196. package/lib/builtin/bash-tool.d.ts +1 -1
  197. package/lib/builtin/bash-tool.d.ts.map +1 -1
  198. package/lib/builtin/bash-tool.js +4 -4
  199. package/lib/builtin/bash-tool.js.map +1 -1
  200. package/lib/builtin/deferred-tool-meta.d.ts +46 -0
  201. package/lib/builtin/deferred-tool-meta.d.ts.map +1 -0
  202. package/lib/builtin/deferred-tool-meta.js +130 -0
  203. package/lib/builtin/deferred-tool-meta.js.map +1 -0
  204. package/lib/builtin/edit-file-tool.d.ts +1 -1
  205. package/lib/builtin/edit-file-tool.d.ts.map +1 -1
  206. package/lib/builtin/edit-file-tool.js +4 -4
  207. package/lib/builtin/edit-file-tool.js.map +1 -1
  208. package/lib/builtin/five-agent/index.d.ts +20 -0
  209. package/lib/builtin/five-agent/index.d.ts.map +1 -0
  210. package/lib/builtin/five-agent/index.js +23 -0
  211. package/lib/builtin/five-agent/index.js.map +1 -0
  212. package/lib/builtin/five-agent/prompts.d.ts +11 -0
  213. package/lib/builtin/five-agent/prompts.d.ts.map +1 -0
  214. package/lib/builtin/five-agent/prompts.js +35 -0
  215. package/lib/builtin/five-agent/prompts.js.map +1 -0
  216. package/lib/builtin/five-agent/strategy.d.ts +4 -0
  217. package/lib/builtin/five-agent/strategy.d.ts.map +1 -0
  218. package/lib/builtin/five-agent/strategy.js +42 -0
  219. package/lib/builtin/five-agent/strategy.js.map +1 -0
  220. package/lib/builtin/generate-image-tool.d.ts +1 -1
  221. package/lib/builtin/generate-image-tool.d.ts.map +1 -1
  222. package/lib/builtin/generate-image-tool.js +9 -9
  223. package/lib/builtin/generate-image-tool.js.map +1 -1
  224. package/lib/builtin/glob-tool.d.ts +1 -1
  225. package/lib/builtin/glob-tool.d.ts.map +1 -1
  226. package/lib/builtin/glob-tool.js +3 -3
  227. package/lib/builtin/glob-tool.js.map +1 -1
  228. package/lib/builtin/grep-tool.d.ts +1 -1
  229. package/lib/builtin/grep-tool.d.ts.map +1 -1
  230. package/lib/builtin/grep-tool.js +10 -10
  231. package/lib/builtin/grep-tool.js.map +1 -1
  232. package/lib/builtin/install-skill-tool.d.ts +1 -1
  233. package/lib/builtin/install-skill-tool.d.ts.map +1 -1
  234. package/lib/builtin/install-skill-tool.js +3 -3
  235. package/lib/builtin/install-skill-tool.js.map +1 -1
  236. package/lib/builtin/knowledge-search-tool.js +3 -3
  237. package/lib/builtin/knowledge-search-tool.js.map +1 -1
  238. package/lib/builtin/list-dir-tool.d.ts +1 -1
  239. package/lib/builtin/list-dir-tool.d.ts.map +1 -1
  240. package/lib/builtin/list-dir-tool.js +2 -2
  241. package/lib/builtin/list-dir-tool.js.map +1 -1
  242. package/lib/builtin/load-skill-tool.d.ts +20 -0
  243. package/lib/builtin/load-skill-tool.d.ts.map +1 -0
  244. package/lib/builtin/load-skill-tool.js +60 -0
  245. package/lib/builtin/load-skill-tool.js.map +1 -0
  246. package/lib/builtin/memory-search-tool.d.ts.map +1 -1
  247. package/lib/builtin/memory-search-tool.js +8 -5
  248. package/lib/builtin/memory-search-tool.js.map +1 -1
  249. package/lib/builtin/memory-upsert-tool.d.ts.map +1 -1
  250. package/lib/builtin/memory-upsert-tool.js +11 -8
  251. package/lib/builtin/memory-upsert-tool.js.map +1 -1
  252. package/lib/builtin/orchestration-tools.d.ts +3 -4
  253. package/lib/builtin/orchestration-tools.d.ts.map +1 -1
  254. package/lib/builtin/orchestration-tools.js +101 -93
  255. package/lib/builtin/orchestration-tools.js.map +1 -1
  256. package/lib/builtin/read-file-tool.d.ts +1 -1
  257. package/lib/builtin/read-file-tool.d.ts.map +1 -1
  258. package/lib/builtin/read-file-tool.js +4 -4
  259. package/lib/builtin/read-file-tool.js.map +1 -1
  260. package/lib/builtin/run-deferred-task-tool.d.ts +1 -1
  261. package/lib/builtin/run-deferred-task-tool.d.ts.map +1 -1
  262. package/lib/builtin/run-deferred-task-tool.js +3 -3
  263. package/lib/builtin/run-deferred-task-tool.js.map +1 -1
  264. package/lib/builtin/spawn-task-tool.d.ts +13 -6
  265. package/lib/builtin/spawn-task-tool.d.ts.map +1 -1
  266. package/lib/builtin/spawn-task-tool.js +135 -30
  267. package/lib/builtin/spawn-task-tool.js.map +1 -1
  268. package/lib/builtin/todo-read-tool.d.ts +1 -1
  269. package/lib/builtin/todo-read-tool.d.ts.map +1 -1
  270. package/lib/builtin/todo-read-tool.js +2 -2
  271. package/lib/builtin/todo-read-tool.js.map +1 -1
  272. package/lib/builtin/todo-write-tool.d.ts +1 -1
  273. package/lib/builtin/todo-write-tool.d.ts.map +1 -1
  274. package/lib/builtin/todo-write-tool.js +3 -3
  275. package/lib/builtin/todo-write-tool.js.map +1 -1
  276. package/lib/builtin/web-fetch-tool.d.ts +2 -2
  277. package/lib/builtin/web-fetch-tool.d.ts.map +1 -1
  278. package/lib/builtin/web-fetch-tool.js +6 -3
  279. package/lib/builtin/web-fetch-tool.js.map +1 -1
  280. package/lib/builtin/web-search-tool.d.ts +1 -1
  281. package/lib/builtin/web-search-tool.d.ts.map +1 -1
  282. package/lib/builtin/web-search-tool.js +5 -5
  283. package/lib/builtin/web-search-tool.js.map +1 -1
  284. package/lib/builtin/write-file-tool.d.ts +1 -1
  285. package/lib/builtin/write-file-tool.d.ts.map +1 -1
  286. package/lib/builtin/write-file-tool.js +3 -3
  287. package/lib/builtin/write-file-tool.js.map +1 -1
  288. package/lib/builtin-tools.d.ts +1 -1
  289. package/lib/builtin-tools.js +3 -3
  290. package/lib/builtin-tools.js.map +1 -1
  291. package/lib/collaboration/ask-user-bridge.d.ts +9 -0
  292. package/lib/collaboration/ask-user-bridge.d.ts.map +1 -0
  293. package/lib/collaboration/ask-user-bridge.js +59 -0
  294. package/lib/collaboration/ask-user-bridge.js.map +1 -0
  295. package/lib/collaboration/bootstrap-agent-runtimes.d.ts +22 -0
  296. package/lib/collaboration/bootstrap-agent-runtimes.d.ts.map +1 -0
  297. package/lib/collaboration/bootstrap-agent-runtimes.js +106 -0
  298. package/lib/collaboration/bootstrap-agent-runtimes.js.map +1 -0
  299. package/lib/collaboration/collab-admin-gate.d.ts +21 -0
  300. package/lib/collaboration/collab-admin-gate.d.ts.map +1 -0
  301. package/lib/collaboration/collab-admin-gate.js +74 -0
  302. package/lib/collaboration/collab-admin-gate.js.map +1 -0
  303. package/lib/collaboration/collaboration-artifact-repository.d.ts +46 -0
  304. package/lib/collaboration/collaboration-artifact-repository.d.ts.map +1 -0
  305. package/lib/collaboration/collaboration-artifact-repository.js +102 -0
  306. package/lib/collaboration/collaboration-artifact-repository.js.map +1 -0
  307. package/lib/collaboration/collaboration-commands.d.ts +38 -0
  308. package/lib/collaboration/collaboration-commands.d.ts.map +1 -0
  309. package/lib/collaboration/collaboration-commands.js +504 -0
  310. package/lib/collaboration/collaboration-commands.js.map +1 -0
  311. package/lib/collaboration/collaboration-config.d.ts +30 -0
  312. package/lib/collaboration/collaboration-config.d.ts.map +1 -0
  313. package/lib/collaboration/collaboration-config.js +170 -0
  314. package/lib/collaboration/collaboration-config.js.map +1 -0
  315. package/lib/collaboration/collaboration-context.d.ts +12 -0
  316. package/lib/collaboration/collaboration-context.d.ts.map +1 -0
  317. package/lib/collaboration/collaboration-context.js +89 -0
  318. package/lib/collaboration/collaboration-context.js.map +1 -0
  319. package/lib/collaboration/collaboration-db-model.d.ts +350 -0
  320. package/lib/collaboration/collaboration-db-model.d.ts.map +1 -0
  321. package/lib/collaboration/collaboration-db-model.js +112 -0
  322. package/lib/collaboration/collaboration-db-model.js.map +1 -0
  323. package/lib/collaboration/collaboration-delegation.d.ts +21 -0
  324. package/lib/collaboration/collaboration-delegation.d.ts.map +1 -0
  325. package/lib/collaboration/collaboration-delegation.js +194 -0
  326. package/lib/collaboration/collaboration-delegation.js.map +1 -0
  327. package/lib/collaboration/collaboration-dispatch.d.ts +32 -0
  328. package/lib/collaboration/collaboration-dispatch.d.ts.map +1 -0
  329. package/lib/collaboration/collaboration-dispatch.js +93 -0
  330. package/lib/collaboration/collaboration-dispatch.js.map +1 -0
  331. package/lib/collaboration/collaboration-kernel-bridge.d.ts +23 -0
  332. package/lib/collaboration/collaboration-kernel-bridge.d.ts.map +1 -0
  333. package/lib/collaboration/collaboration-kernel-bridge.js +106 -0
  334. package/lib/collaboration/collaboration-kernel-bridge.js.map +1 -0
  335. package/lib/collaboration/collaboration-outbound.d.ts +64 -0
  336. package/lib/collaboration/collaboration-outbound.d.ts.map +1 -0
  337. package/lib/collaboration/collaboration-outbound.js +315 -0
  338. package/lib/collaboration/collaboration-outbound.js.map +1 -0
  339. package/lib/collaboration/collaboration-scene-repository.d.ts +152 -0
  340. package/lib/collaboration/collaboration-scene-repository.d.ts.map +1 -0
  341. package/lib/collaboration/collaboration-scene-repository.js +440 -0
  342. package/lib/collaboration/collaboration-scene-repository.js.map +1 -0
  343. package/lib/collaboration/collaboration-turn-snapshot.d.ts +18 -0
  344. package/lib/collaboration/collaboration-turn-snapshot.d.ts.map +1 -0
  345. package/lib/collaboration/collaboration-turn-snapshot.js +35 -0
  346. package/lib/collaboration/collaboration-turn-snapshot.js.map +1 -0
  347. package/lib/collaboration/delegation-state.d.ts +30 -0
  348. package/lib/collaboration/delegation-state.d.ts.map +1 -0
  349. package/lib/collaboration/delegation-state.js +86 -0
  350. package/lib/collaboration/delegation-state.js.map +1 -0
  351. package/lib/collaboration/endpoint-identity.d.ts +28 -0
  352. package/lib/collaboration/endpoint-identity.d.ts.map +1 -0
  353. package/lib/collaboration/endpoint-identity.js +88 -0
  354. package/lib/collaboration/endpoint-identity.js.map +1 -0
  355. package/lib/collaboration/group-feed.d.ts +30 -0
  356. package/lib/collaboration/group-feed.d.ts.map +1 -0
  357. package/lib/collaboration/group-feed.js +150 -0
  358. package/lib/collaboration/group-feed.js.map +1 -0
  359. package/lib/collaboration/group-message.d.ts +53 -0
  360. package/lib/collaboration/group-message.d.ts.map +1 -0
  361. package/lib/collaboration/group-message.js +162 -0
  362. package/lib/collaboration/group-message.js.map +1 -0
  363. package/lib/collaboration/im-mention-delegate.d.ts +22 -0
  364. package/lib/collaboration/im-mention-delegate.d.ts.map +1 -0
  365. package/lib/collaboration/im-mention-delegate.js +15 -0
  366. package/lib/collaboration/im-mention-delegate.js.map +1 -0
  367. package/lib/collaboration/inbound-peer-handback.d.ts +18 -0
  368. package/lib/collaboration/inbound-peer-handback.d.ts.map +1 -0
  369. package/lib/collaboration/inbound-peer-handback.js +69 -0
  370. package/lib/collaboration/inbound-peer-handback.js.map +1 -0
  371. package/lib/collaboration/inbound-spawn-task.d.ts +29 -0
  372. package/lib/collaboration/inbound-spawn-task.d.ts.map +1 -0
  373. package/lib/collaboration/inbound-spawn-task.js +97 -0
  374. package/lib/collaboration/inbound-spawn-task.js.map +1 -0
  375. package/lib/collaboration/inbound-turn-endpoint.d.ts +16 -0
  376. package/lib/collaboration/inbound-turn-endpoint.d.ts.map +1 -0
  377. package/lib/collaboration/inbound-turn-endpoint.js +26 -0
  378. package/lib/collaboration/inbound-turn-endpoint.js.map +1 -0
  379. package/lib/collaboration/inbound-turn-enrich.d.ts +25 -0
  380. package/lib/collaboration/inbound-turn-enrich.d.ts.map +1 -0
  381. package/lib/collaboration/inbound-turn-enrich.js +51 -0
  382. package/lib/collaboration/inbound-turn-enrich.js.map +1 -0
  383. package/lib/collaboration/inbound-turn-execute.d.ts +33 -0
  384. package/lib/collaboration/inbound-turn-execute.d.ts.map +1 -0
  385. package/lib/collaboration/inbound-turn-execute.js +73 -0
  386. package/lib/collaboration/inbound-turn-execute.js.map +1 -0
  387. package/lib/collaboration/inbound-turn-outbound-stage.d.ts +25 -0
  388. package/lib/collaboration/inbound-turn-outbound-stage.d.ts.map +1 -0
  389. package/lib/collaboration/inbound-turn-outbound-stage.js +73 -0
  390. package/lib/collaboration/inbound-turn-outbound-stage.js.map +1 -0
  391. package/lib/collaboration/inbound-turn-pipeline.d.ts +28 -0
  392. package/lib/collaboration/inbound-turn-pipeline.d.ts.map +1 -0
  393. package/lib/collaboration/inbound-turn-pipeline.js +193 -0
  394. package/lib/collaboration/inbound-turn-pipeline.js.map +1 -0
  395. package/lib/collaboration/inbound-turn-route.d.ts +42 -0
  396. package/lib/collaboration/inbound-turn-route.d.ts.map +1 -0
  397. package/lib/collaboration/inbound-turn-route.js +90 -0
  398. package/lib/collaboration/inbound-turn-route.js.map +1 -0
  399. package/lib/collaboration/inbound-turn-tools.d.ts +13 -0
  400. package/lib/collaboration/inbound-turn-tools.d.ts.map +1 -0
  401. package/lib/collaboration/inbound-turn-tools.js +19 -0
  402. package/lib/collaboration/inbound-turn-tools.js.map +1 -0
  403. package/lib/collaboration/index.d.ts +26 -0
  404. package/lib/collaboration/index.d.ts.map +1 -0
  405. package/lib/collaboration/index.js +24 -0
  406. package/lib/collaboration/index.js.map +1 -0
  407. package/lib/collaboration/init-observe-hook.d.ts +59 -0
  408. package/lib/collaboration/init-observe-hook.d.ts.map +1 -0
  409. package/lib/collaboration/init-observe-hook.js +190 -0
  410. package/lib/collaboration/init-observe-hook.js.map +1 -0
  411. package/lib/collaboration/init-wizard-service.d.ts +57 -0
  412. package/lib/collaboration/init-wizard-service.d.ts.map +1 -0
  413. package/lib/collaboration/init-wizard-service.js +188 -0
  414. package/lib/collaboration/init-wizard-service.js.map +1 -0
  415. package/lib/collaboration/outbound-resolver.d.ts +35 -0
  416. package/lib/collaboration/outbound-resolver.d.ts.map +1 -0
  417. package/lib/collaboration/outbound-resolver.js +188 -0
  418. package/lib/collaboration/outbound-resolver.js.map +1 -0
  419. package/lib/collaboration/peer-policy.d.ts +29 -0
  420. package/lib/collaboration/peer-policy.d.ts.map +1 -0
  421. package/lib/collaboration/peer-policy.js +118 -0
  422. package/lib/collaboration/peer-policy.js.map +1 -0
  423. package/lib/collaboration/resolve-agent-session-key.d.ts +21 -0
  424. package/lib/collaboration/resolve-agent-session-key.d.ts.map +1 -0
  425. package/lib/collaboration/resolve-agent-session-key.js +61 -0
  426. package/lib/collaboration/resolve-agent-session-key.js.map +1 -0
  427. package/lib/collaboration/runtime-registry.d.ts +18 -0
  428. package/lib/collaboration/runtime-registry.d.ts.map +1 -0
  429. package/lib/collaboration/runtime-registry.js +40 -0
  430. package/lib/collaboration/runtime-registry.js.map +1 -0
  431. package/lib/collaboration/scene-context.d.ts +17 -0
  432. package/lib/collaboration/scene-context.d.ts.map +1 -0
  433. package/lib/collaboration/scene-context.js +22 -0
  434. package/lib/collaboration/scene-context.js.map +1 -0
  435. package/lib/collaboration/scene-identity-service.d.ts +167 -0
  436. package/lib/collaboration/scene-identity-service.d.ts.map +1 -0
  437. package/lib/collaboration/scene-identity-service.js +468 -0
  438. package/lib/collaboration/scene-identity-service.js.map +1 -0
  439. package/lib/collaboration/scene-service.d.ts +65 -0
  440. package/lib/collaboration/scene-service.d.ts.map +1 -0
  441. package/lib/collaboration/scene-service.js +152 -0
  442. package/lib/collaboration/scene-service.js.map +1 -0
  443. package/lib/collaboration/structured-ai-outbound.d.ts +23 -0
  444. package/lib/collaboration/structured-ai-outbound.d.ts.map +1 -0
  445. package/lib/collaboration/structured-ai-outbound.js +179 -0
  446. package/lib/collaboration/structured-ai-outbound.js.map +1 -0
  447. package/lib/collaboration/turn-plan-resolver.d.ts +17 -0
  448. package/lib/collaboration/turn-plan-resolver.d.ts.map +1 -0
  449. package/lib/collaboration/turn-plan-resolver.js +63 -0
  450. package/lib/collaboration/turn-plan-resolver.js.map +1 -0
  451. package/lib/collaboration/types.d.ts +147 -0
  452. package/lib/collaboration/types.d.ts.map +1 -0
  453. package/lib/collaboration/types.js +16 -0
  454. package/lib/collaboration/types.js.map +1 -0
  455. package/lib/collaboration/wire-collaboration-storage.d.ts +4 -0
  456. package/lib/collaboration/wire-collaboration-storage.d.ts.map +1 -0
  457. package/lib/collaboration/wire-collaboration-storage.js +28 -0
  458. package/lib/collaboration/wire-collaboration-storage.js.map +1 -0
  459. package/lib/common-adapter-tools.d.ts +6 -7
  460. package/lib/common-adapter-tools.d.ts.map +1 -1
  461. package/lib/common-adapter-tools.js +9 -9
  462. package/lib/common-adapter-tools.js.map +1 -1
  463. package/lib/config/agent-binding-registry.d.ts +1 -1
  464. package/lib/config/agent-binding-registry.d.ts.map +1 -1
  465. package/lib/config/agent-binding-registry.js.map +1 -1
  466. package/lib/config/agent-bindings.d.ts +1 -1
  467. package/lib/config/agent-bindings.d.ts.map +1 -1
  468. package/lib/config/agent-bindings.js +2 -0
  469. package/lib/config/agent-bindings.js.map +1 -1
  470. package/lib/config/agent-interfaces.d.ts +58 -0
  471. package/lib/config/agent-interfaces.d.ts.map +1 -0
  472. package/lib/config/agent-interfaces.js +8 -0
  473. package/lib/config/agent-interfaces.js.map +1 -0
  474. package/lib/config/fix-ai-config.d.ts +1 -0
  475. package/lib/config/fix-ai-config.d.ts.map +1 -1
  476. package/lib/config/fix-ai-config.js +152 -15
  477. package/lib/config/fix-ai-config.js.map +1 -1
  478. package/lib/config/index.d.ts +13 -0
  479. package/lib/config/index.d.ts.map +1 -1
  480. package/lib/config/index.js +8 -0
  481. package/lib/config/index.js.map +1 -1
  482. package/lib/config/keyword-triggers.d.ts +6 -0
  483. package/lib/config/keyword-triggers.d.ts.map +1 -0
  484. package/lib/config/keyword-triggers.js +6 -0
  485. package/lib/config/keyword-triggers.js.map +1 -0
  486. package/lib/config/model-harness-runtime.d.ts +5 -0
  487. package/lib/config/model-harness-runtime.d.ts.map +1 -0
  488. package/lib/config/model-harness-runtime.js +65 -0
  489. package/lib/config/model-harness-runtime.js.map +1 -0
  490. package/lib/config/model-harness.d.ts +16 -0
  491. package/lib/config/model-harness.d.ts.map +1 -0
  492. package/lib/config/model-harness.js +2 -0
  493. package/lib/config/model-harness.js.map +1 -0
  494. package/lib/config/normalize-ai-config.d.ts +2 -2
  495. package/lib/config/normalize-ai-config.d.ts.map +1 -1
  496. package/lib/config/normalize-ai-config.js +49 -29
  497. package/lib/config/normalize-ai-config.js.map +1 -1
  498. package/lib/config/provider-instance.d.ts +1 -1
  499. package/lib/config/provider-instance.d.ts.map +1 -1
  500. package/lib/config/provider-instance.js.map +1 -1
  501. package/lib/config/resolve-pipeline-binding.d.ts +16 -0
  502. package/lib/config/resolve-pipeline-binding.d.ts.map +1 -0
  503. package/lib/config/resolve-pipeline-binding.js +35 -0
  504. package/lib/config/resolve-pipeline-binding.js.map +1 -0
  505. package/lib/config/types.d.ts +17 -9
  506. package/lib/config/types.d.ts.map +1 -1
  507. package/lib/config/types.js.map +1 -1
  508. package/lib/config/validate-ai-config.d.ts.map +1 -1
  509. package/lib/config/validate-ai-config.js +6 -1
  510. package/lib/config/validate-ai-config.js.map +1 -1
  511. package/lib/config/zhin-agent-config.d.ts +83 -0
  512. package/lib/config/zhin-agent-config.d.ts.map +1 -0
  513. package/lib/config/zhin-agent-config.js +2 -0
  514. package/lib/config/zhin-agent-config.js.map +1 -0
  515. package/lib/config/zhin-agent-constants.d.ts +11 -0
  516. package/lib/config/zhin-agent-constants.d.ts.map +1 -0
  517. package/lib/config/zhin-agent-constants.js +26 -0
  518. package/lib/config/zhin-agent-constants.js.map +1 -0
  519. package/lib/config/zhin-agent-defaults.d.ts +3 -0
  520. package/lib/config/zhin-agent-defaults.d.ts.map +1 -0
  521. package/lib/config/zhin-agent-defaults.js +63 -0
  522. package/lib/config/zhin-agent-defaults.js.map +1 -0
  523. package/lib/config/zhin-agent-dependencies.d.ts +37 -0
  524. package/lib/config/zhin-agent-dependencies.d.ts.map +1 -0
  525. package/lib/config/zhin-agent-dependencies.js +2 -0
  526. package/lib/config/zhin-agent-dependencies.js.map +1 -0
  527. package/lib/config/zhin-agent-runtime.d.ts +21 -0
  528. package/lib/config/zhin-agent-runtime.d.ts.map +1 -0
  529. package/lib/config/zhin-agent-runtime.js +91 -0
  530. package/lib/config/zhin-agent-runtime.js.map +1 -0
  531. package/lib/context/agents-instruction.d.ts +11 -0
  532. package/lib/context/agents-instruction.d.ts.map +1 -0
  533. package/lib/context/agents-instruction.js +94 -0
  534. package/lib/context/agents-instruction.js.map +1 -0
  535. package/lib/context/context-system.d.ts +47 -0
  536. package/lib/context/context-system.d.ts.map +1 -0
  537. package/lib/context/context-system.js +115 -0
  538. package/lib/context/context-system.js.map +1 -0
  539. package/lib/context/context-tail-limit.d.ts +7 -0
  540. package/lib/context/context-tail-limit.d.ts.map +1 -0
  541. package/lib/context/context-tail-limit.js +12 -0
  542. package/lib/context/context-tail-limit.js.map +1 -0
  543. package/lib/context/contracts.d.ts +34 -0
  544. package/lib/context/contracts.d.ts.map +1 -0
  545. package/lib/context/contracts.js +8 -0
  546. package/lib/context/contracts.js.map +1 -0
  547. package/lib/context/default-builders.d.ts +24 -0
  548. package/lib/context/default-builders.d.ts.map +1 -0
  549. package/lib/context/default-builders.js +56 -0
  550. package/lib/context/default-builders.js.map +1 -0
  551. package/lib/context/envelope-parts.d.ts +13 -0
  552. package/lib/context/envelope-parts.d.ts.map +1 -0
  553. package/lib/context/envelope-parts.js +2 -0
  554. package/lib/context/envelope-parts.js.map +1 -0
  555. package/lib/context/index.d.ts +16 -0
  556. package/lib/context/index.d.ts.map +1 -0
  557. package/lib/context/index.js +10 -0
  558. package/lib/context/index.js.map +1 -0
  559. package/lib/context/model-resolver.d.ts.map +1 -0
  560. package/lib/context/model-resolver.js +28 -0
  561. package/lib/context/model-resolver.js.map +1 -0
  562. package/lib/context/turn-envelope.d.ts +20 -0
  563. package/lib/context/turn-envelope.d.ts.map +1 -0
  564. package/lib/context/turn-envelope.js +80 -0
  565. package/lib/context/turn-envelope.js.map +1 -0
  566. package/lib/context/turn-user-message.d.ts +10 -0
  567. package/lib/context/turn-user-message.d.ts.map +1 -0
  568. package/lib/context/turn-user-message.js +48 -0
  569. package/lib/context/turn-user-message.js.map +1 -0
  570. package/lib/core/agent-core-run.d.ts +61 -0
  571. package/lib/core/agent-core-run.d.ts.map +1 -0
  572. package/lib/core/agent-core-run.js +588 -0
  573. package/lib/core/agent-core-run.js.map +1 -0
  574. package/lib/core/agent-core.d.ts +18 -0
  575. package/lib/core/agent-core.d.ts.map +1 -0
  576. package/lib/core/agent-core.js +73 -0
  577. package/lib/core/agent-core.js.map +1 -0
  578. package/lib/core/agent-loop-standalone.d.ts +42 -0
  579. package/lib/core/agent-loop-standalone.d.ts.map +1 -0
  580. package/lib/core/agent-loop-standalone.js +163 -0
  581. package/lib/core/agent-loop-standalone.js.map +1 -0
  582. package/lib/core/agent-loop-turn.d.ts +8 -0
  583. package/lib/core/agent-loop-turn.d.ts.map +1 -0
  584. package/lib/core/agent-loop-turn.js +17 -0
  585. package/lib/core/agent-loop-turn.js.map +1 -0
  586. package/lib/core/compose-deps.d.ts +13 -0
  587. package/lib/core/compose-deps.d.ts.map +1 -0
  588. package/lib/core/compose-deps.js +35 -0
  589. package/lib/core/compose-deps.js.map +1 -0
  590. package/lib/core/contracts.d.ts +50 -0
  591. package/lib/core/contracts.d.ts.map +1 -0
  592. package/lib/core/contracts.js +11 -0
  593. package/lib/core/contracts.js.map +1 -0
  594. package/lib/core/index.d.ts +13 -0
  595. package/lib/core/index.d.ts.map +1 -0
  596. package/lib/core/index.js +9 -0
  597. package/lib/core/index.js.map +1 -0
  598. package/lib/core/text-sanitize.d.ts.map +1 -0
  599. package/lib/core/text-sanitize.js.map +1 -0
  600. package/lib/core/tool-calls-user-format.d.ts.map +1 -0
  601. package/lib/core/tool-calls-user-format.js +138 -0
  602. package/lib/core/tool-calls-user-format.js.map +1 -0
  603. package/lib/core/turn-event-mapper.d.ts +12 -0
  604. package/lib/core/turn-event-mapper.d.ts.map +1 -0
  605. package/lib/core/turn-event-mapper.js +54 -0
  606. package/lib/core/turn-event-mapper.js.map +1 -0
  607. package/lib/deferred-worker-runner.d.ts +7 -5
  608. package/lib/deferred-worker-runner.d.ts.map +1 -1
  609. package/lib/deferred-worker-runner.js +9 -11
  610. package/lib/deferred-worker-runner.js.map +1 -1
  611. package/lib/deferred-worker-tool-load.d.ts +1 -1
  612. package/lib/deferred-worker-tool-load.d.ts.map +1 -1
  613. package/lib/deferred-worker-tool-load.js +3 -0
  614. package/lib/deferred-worker-tool-load.js.map +1 -1
  615. package/lib/discovery/agents.d.ts +10 -1
  616. package/lib/discovery/agents.d.ts.map +1 -1
  617. package/lib/discovery/agents.js +11 -1
  618. package/lib/discovery/agents.js.map +1 -1
  619. package/lib/event/contracts.d.ts +26 -0
  620. package/lib/event/contracts.d.ts.map +1 -0
  621. package/lib/event/contracts.js +9 -0
  622. package/lib/event/contracts.js.map +1 -0
  623. package/lib/event/event-emitter.d.ts +17 -0
  624. package/lib/event/event-emitter.d.ts.map +1 -0
  625. package/lib/event/event-emitter.js +73 -0
  626. package/lib/event/event-emitter.js.map +1 -0
  627. package/lib/event/event-system.d.ts +13 -0
  628. package/lib/event/event-system.d.ts.map +1 -0
  629. package/lib/event/event-system.js +56 -0
  630. package/lib/event/event-system.js.map +1 -0
  631. package/lib/event/filtering-middleware.d.ts +13 -0
  632. package/lib/event/filtering-middleware.d.ts.map +1 -0
  633. package/lib/event/filtering-middleware.js +19 -0
  634. package/lib/event/filtering-middleware.js.map +1 -0
  635. package/lib/event/index.d.ts +11 -0
  636. package/lib/event/index.d.ts.map +1 -0
  637. package/lib/event/index.js +8 -0
  638. package/lib/event/index.js.map +1 -0
  639. package/lib/event/logging-middleware.d.ts +6 -0
  640. package/lib/event/logging-middleware.d.ts.map +1 -0
  641. package/lib/event/logging-middleware.js +16 -0
  642. package/lib/event/logging-middleware.js.map +1 -0
  643. package/lib/event/session-events.d.ts +10 -0
  644. package/lib/event/session-events.d.ts.map +1 -0
  645. package/lib/event/session-events.js +18 -0
  646. package/lib/event/session-events.js.map +1 -0
  647. package/lib/event/turn-event.d.ts +77 -0
  648. package/lib/event/turn-event.d.ts.map +1 -0
  649. package/lib/event/turn-event.js +2 -0
  650. package/lib/event/turn-event.js.map +1 -0
  651. package/lib/index.d.ts +46 -26
  652. package/lib/index.d.ts.map +1 -1
  653. package/lib/index.js +30 -16
  654. package/lib/index.js.map +1 -1
  655. package/lib/init/activate-ai-database-storage.d.ts +2 -2
  656. package/lib/init/activate-ai-database-storage.d.ts.map +1 -1
  657. package/lib/init/activate-ai-database-storage.js +17 -8
  658. package/lib/init/activate-ai-database-storage.js.map +1 -1
  659. package/lib/init/compose-zhin-agent-runtime.d.ts +29 -0
  660. package/lib/init/compose-zhin-agent-runtime.d.ts.map +1 -0
  661. package/lib/init/compose-zhin-agent-runtime.js +40 -0
  662. package/lib/init/compose-zhin-agent-runtime.js.map +1 -0
  663. package/lib/init/configure-zhin-agent.d.ts +46 -0
  664. package/lib/init/configure-zhin-agent.d.ts.map +1 -0
  665. package/lib/init/configure-zhin-agent.js +75 -0
  666. package/lib/init/configure-zhin-agent.js.map +1 -0
  667. package/lib/init/create-zhin-agent.d.ts.map +1 -1
  668. package/lib/init/create-zhin-agent.js +161 -134
  669. package/lib/init/create-zhin-agent.js.map +1 -1
  670. package/lib/init/dispose-zhin-agent.d.ts +28 -0
  671. package/lib/init/dispose-zhin-agent.d.ts.map +1 -0
  672. package/lib/init/dispose-zhin-agent.js +25 -0
  673. package/lib/init/dispose-zhin-agent.js.map +1 -0
  674. package/lib/init/introspection-args.d.ts +4 -1
  675. package/lib/init/introspection-args.d.ts.map +1 -1
  676. package/lib/init/introspection-args.js.map +1 -1
  677. package/lib/init/management-command-guard.d.ts +2 -5
  678. package/lib/init/management-command-guard.d.ts.map +1 -1
  679. package/lib/init/management-command-guard.js +2 -16
  680. package/lib/init/management-command-guard.js.map +1 -1
  681. package/lib/init/message-media.d.ts +1 -1
  682. package/lib/init/message-media.d.ts.map +1 -1
  683. package/lib/init/message-media.js.map +1 -1
  684. package/lib/init/register-ai-trigger.d.ts.map +1 -1
  685. package/lib/init/register-ai-trigger.js +28 -295
  686. package/lib/init/register-ai-trigger.js.map +1 -1
  687. package/lib/init/register-builtin-tools.d.ts.map +1 -1
  688. package/lib/init/register-builtin-tools.js +9 -8
  689. package/lib/init/register-builtin-tools.js.map +1 -1
  690. package/lib/init/register-collaboration-commands.d.ts +2 -0
  691. package/lib/init/register-collaboration-commands.d.ts.map +1 -0
  692. package/lib/init/register-collaboration-commands.js +110 -0
  693. package/lib/init/register-collaboration-commands.js.map +1 -0
  694. package/lib/init/register-db-models.d.ts.map +1 -1
  695. package/lib/init/register-db-models.js +11 -2
  696. package/lib/init/register-db-models.js.map +1 -1
  697. package/lib/init/register-db-upgrade.d.ts.map +1 -1
  698. package/lib/init/register-db-upgrade.js +14 -9
  699. package/lib/init/register-db-upgrade.js.map +1 -1
  700. package/lib/init/register-group-session-passive.d.ts.map +1 -1
  701. package/lib/init/register-group-session-passive.js +19 -13
  702. package/lib/init/register-group-session-passive.js.map +1 -1
  703. package/lib/init/register-im-segment-filter.d.ts +2 -0
  704. package/lib/init/register-im-segment-filter.d.ts.map +1 -0
  705. package/lib/init/register-im-segment-filter.js +23 -0
  706. package/lib/init/register-im-segment-filter.js.map +1 -0
  707. package/lib/init/register-init-wizard-guardrail.d.ts +2 -0
  708. package/lib/init/register-init-wizard-guardrail.d.ts.map +1 -0
  709. package/lib/init/register-init-wizard-guardrail.js +46 -0
  710. package/lib/init/register-init-wizard-guardrail.js.map +1 -0
  711. package/lib/init/register-introspection-commands.d.ts.map +1 -1
  712. package/lib/init/register-introspection-commands.js +18 -33
  713. package/lib/init/register-introspection-commands.js.map +1 -1
  714. package/lib/init/register-management-tools.d.ts.map +1 -1
  715. package/lib/init/register-management-tools.js +38 -32
  716. package/lib/init/register-management-tools.js.map +1 -1
  717. package/lib/init/register-owner-approve-commands.d.ts.map +1 -1
  718. package/lib/init/register-owner-approve-commands.js +7 -1
  719. package/lib/init/register-owner-approve-commands.js.map +1 -1
  720. package/lib/init.js +6 -6
  721. package/lib/init.js.map +1 -1
  722. package/lib/internal/agent-host.d.ts +86 -0
  723. package/lib/internal/agent-host.d.ts.map +1 -0
  724. package/lib/internal/agent-host.js +2 -0
  725. package/lib/internal/agent-host.js.map +1 -0
  726. package/lib/internal/as-private.d.ts +11 -0
  727. package/lib/internal/as-private.d.ts.map +1 -0
  728. package/lib/internal/as-private.js +4 -0
  729. package/lib/internal/as-private.js.map +1 -0
  730. package/lib/internal/host-types.d.ts +81 -0
  731. package/lib/internal/host-types.d.ts.map +1 -0
  732. package/lib/internal/host-types.js +2 -0
  733. package/lib/internal/host-types.js.map +1 -0
  734. package/lib/internal/phase-trace.d.ts +17 -0
  735. package/lib/internal/phase-trace.d.ts.map +1 -0
  736. package/lib/internal/phase-trace.js.map +1 -0
  737. package/lib/internal/prompt-trace.d.ts +17 -0
  738. package/lib/internal/prompt-trace.d.ts.map +1 -0
  739. package/lib/internal/prompt-trace.js.map +1 -0
  740. package/lib/internal/turn-context.d.ts +26 -0
  741. package/lib/internal/turn-context.d.ts.map +1 -0
  742. package/lib/internal/turn-context.js +64 -0
  743. package/lib/internal/turn-context.js.map +1 -0
  744. package/lib/media/deliver-subagent-result.d.ts +2 -2
  745. package/lib/media/deliver-subagent-result.d.ts.map +1 -1
  746. package/lib/media/media-publisher.d.ts +1 -1
  747. package/lib/media/media-publisher.d.ts.map +1 -1
  748. package/lib/media/media-publisher.js.map +1 -1
  749. package/lib/media/media-router.d.ts +11 -2
  750. package/lib/media/media-router.d.ts.map +1 -1
  751. package/lib/media/media-router.js +62 -4
  752. package/lib/media/media-router.js.map +1 -1
  753. package/lib/media/media-tool-bridge.d.ts +1 -1
  754. package/lib/media/media-tool-bridge.d.ts.map +1 -1
  755. package/lib/media/media-types.d.ts +1 -1
  756. package/lib/media/media-types.d.ts.map +1 -1
  757. package/lib/media/media-types.js +1 -1
  758. package/lib/media/media-types.js.map +1 -1
  759. package/lib/media/resolve-config.d.ts +1 -0
  760. package/lib/media/resolve-config.d.ts.map +1 -1
  761. package/lib/media/resolve-config.js +5 -0
  762. package/lib/media/resolve-config.js.map +1 -1
  763. package/lib/media/subagent-inbound.d.ts.map +1 -1
  764. package/lib/media/subagent-inbound.js +33 -4
  765. package/lib/media/subagent-inbound.js.map +1 -1
  766. package/lib/media/subagent-user-delivery.d.ts +1 -1
  767. package/lib/media/subagent-user-delivery.d.ts.map +1 -1
  768. package/lib/memory/ai-compaction-strategy.d.ts +14 -0
  769. package/lib/memory/ai-compaction-strategy.d.ts.map +1 -0
  770. package/lib/memory/ai-compaction-strategy.js +31 -0
  771. package/lib/memory/ai-compaction-strategy.js.map +1 -0
  772. package/lib/memory/compaction-runtime.d.ts +28 -0
  773. package/lib/memory/compaction-runtime.d.ts.map +1 -0
  774. package/lib/memory/compaction-runtime.js +108 -0
  775. package/lib/memory/compaction-runtime.js.map +1 -0
  776. package/lib/memory/context-repository-store.d.ts +14 -0
  777. package/lib/memory/context-repository-store.d.ts.map +1 -0
  778. package/lib/memory/context-repository-store.js +22 -0
  779. package/lib/memory/context-repository-store.js.map +1 -0
  780. package/lib/memory/contracts.d.ts +24 -0
  781. package/lib/memory/contracts.d.ts.map +1 -0
  782. package/lib/memory/contracts.js +8 -0
  783. package/lib/memory/contracts.js.map +1 -0
  784. package/lib/memory/index.d.ts +11 -0
  785. package/lib/memory/index.d.ts.map +1 -0
  786. package/lib/memory/index.js +8 -0
  787. package/lib/memory/index.js.map +1 -0
  788. package/lib/memory/memory-system.d.ts +22 -0
  789. package/lib/memory/memory-system.d.ts.map +1 -0
  790. package/lib/memory/memory-system.js +71 -0
  791. package/lib/memory/memory-system.js.map +1 -0
  792. package/lib/memory-layers.d.ts +1 -1
  793. package/lib/memory-layers.d.ts.map +1 -1
  794. package/lib/memory-layers.js +1 -2
  795. package/lib/memory-layers.js.map +1 -1
  796. package/lib/orchestrator/agent-dispatcher.d.ts +7 -18
  797. package/lib/orchestrator/agent-dispatcher.d.ts.map +1 -1
  798. package/lib/orchestrator/agent-dispatcher.js +54 -116
  799. package/lib/orchestrator/agent-dispatcher.js.map +1 -1
  800. package/lib/orchestrator/bootstrap-executors.d.ts +7 -0
  801. package/lib/orchestrator/bootstrap-executors.d.ts.map +1 -0
  802. package/lib/orchestrator/bootstrap-executors.js +170 -0
  803. package/lib/orchestrator/bootstrap-executors.js.map +1 -0
  804. package/lib/orchestrator/hook-registry.d.ts +18 -3
  805. package/lib/orchestrator/hook-registry.d.ts.map +1 -1
  806. package/lib/orchestrator/hook-registry.js +66 -2
  807. package/lib/orchestrator/hook-registry.js.map +1 -1
  808. package/lib/orchestrator/index.d.ts +7 -1
  809. package/lib/orchestrator/index.d.ts.map +1 -1
  810. package/lib/orchestrator/index.js +4 -1
  811. package/lib/orchestrator/index.js.map +1 -1
  812. package/lib/orchestrator/orchestration-mappers.d.ts +9 -0
  813. package/lib/orchestrator/orchestration-mappers.d.ts.map +1 -0
  814. package/lib/orchestrator/orchestration-mappers.js +162 -0
  815. package/lib/orchestrator/orchestration-mappers.js.map +1 -0
  816. package/lib/orchestrator/orchestration-repository.d.ts +14 -14
  817. package/lib/orchestrator/orchestration-repository.d.ts.map +1 -1
  818. package/lib/orchestrator/orchestration-repository.js +87 -53
  819. package/lib/orchestrator/orchestration-repository.js.map +1 -1
  820. package/lib/orchestrator/orchestration-service.d.ts +82 -18
  821. package/lib/orchestrator/orchestration-service.d.ts.map +1 -1
  822. package/lib/orchestrator/orchestration-service.js +445 -103
  823. package/lib/orchestrator/orchestration-service.js.map +1 -1
  824. package/lib/orchestrator/orchestration-types.d.ts +88 -0
  825. package/lib/orchestrator/orchestration-types.d.ts.map +1 -0
  826. package/lib/orchestrator/orchestration-types.js +2 -0
  827. package/lib/orchestrator/orchestration-types.js.map +1 -0
  828. package/lib/orchestrator/owner-confirm-orchestration.d.ts +7 -1
  829. package/lib/orchestrator/owner-confirm-orchestration.d.ts.map +1 -1
  830. package/lib/orchestrator/owner-confirm-orchestration.js +1 -1
  831. package/lib/orchestrator/owner-confirm-orchestration.js.map +1 -1
  832. package/lib/orchestrator/remote-agent-registry.d.ts +10 -7
  833. package/lib/orchestrator/remote-agent-registry.d.ts.map +1 -1
  834. package/lib/orchestrator/remote-agent-registry.js +83 -51
  835. package/lib/orchestrator/remote-agent-registry.js.map +1 -1
  836. package/lib/orchestrator/remote-task-executor.d.ts.map +1 -1
  837. package/lib/orchestrator/remote-task-executor.js +179 -98
  838. package/lib/orchestrator/remote-task-executor.js.map +1 -1
  839. package/lib/orchestrator/remote-task-poller.js +1 -1
  840. package/lib/orchestrator/resolve-subagent-tools.d.ts +7 -3
  841. package/lib/orchestrator/resolve-subagent-tools.d.ts.map +1 -1
  842. package/lib/orchestrator/resolve-subagent-tools.js +36 -31
  843. package/lib/orchestrator/resolve-subagent-tools.js.map +1 -1
  844. package/lib/orchestrator/skill-registry.d.ts +10 -1
  845. package/lib/orchestrator/skill-registry.d.ts.map +1 -1
  846. package/lib/orchestrator/skill-registry.js +26 -37
  847. package/lib/orchestrator/skill-registry.js.map +1 -1
  848. package/lib/orchestrator/tool-registry.d.ts +1 -1
  849. package/lib/orchestrator/tool-registry.d.ts.map +1 -1
  850. package/lib/orchestrator/tool-registry.js.map +1 -1
  851. package/lib/orchestrator/tool-selection.d.ts +3 -3
  852. package/lib/orchestrator/tool-selection.d.ts.map +1 -1
  853. package/lib/orchestrator/tool-selection.js +1 -2
  854. package/lib/orchestrator/tool-selection.js.map +1 -1
  855. package/lib/orchestrator/types.d.ts +52 -0
  856. package/lib/orchestrator/types.d.ts.map +1 -1
  857. package/lib/outbound/send-proactive.d.ts +24 -0
  858. package/lib/outbound/send-proactive.d.ts.map +1 -0
  859. package/lib/outbound/send-proactive.js +54 -0
  860. package/lib/outbound/send-proactive.js.map +1 -0
  861. package/lib/prompt/assembly.d.ts +31 -0
  862. package/lib/prompt/assembly.d.ts.map +1 -0
  863. package/lib/prompt/assembly.js +90 -0
  864. package/lib/prompt/assembly.js.map +1 -0
  865. package/lib/prompt/index.d.ts +11 -0
  866. package/lib/prompt/index.d.ts.map +1 -0
  867. package/lib/prompt/index.js +9 -0
  868. package/lib/prompt/index.js.map +1 -0
  869. package/lib/prompt/prompt-builder.d.ts.map +1 -0
  870. package/lib/prompt/prompt-builder.js +574 -0
  871. package/lib/prompt/prompt-builder.js.map +1 -0
  872. package/lib/prompt/system-prompt.d.ts +63 -0
  873. package/lib/prompt/system-prompt.d.ts.map +1 -0
  874. package/lib/prompt/system-prompt.js +496 -0
  875. package/lib/prompt/system-prompt.js.map +1 -0
  876. package/lib/prompt/templates.d.ts +162 -0
  877. package/lib/prompt/templates.d.ts.map +1 -0
  878. package/lib/prompt/templates.js +447 -0
  879. package/lib/prompt/templates.js.map +1 -0
  880. package/lib/prompt/workspace-prompt.d.ts.map +1 -0
  881. package/lib/prompt/workspace-prompt.js.map +1 -0
  882. package/lib/reserved-tools.d.ts.map +1 -1
  883. package/lib/reserved-tools.js +9 -6
  884. package/lib/reserved-tools.js.map +1 -1
  885. package/lib/routing/route-matcher.d.ts +6 -1
  886. package/lib/routing/route-matcher.d.ts.map +1 -1
  887. package/lib/routing/route-matcher.js +53 -8
  888. package/lib/routing/route-matcher.js.map +1 -1
  889. package/lib/routing/runtime-binding.d.ts +1 -1
  890. package/lib/routing/runtime-binding.d.ts.map +1 -1
  891. package/lib/schedule-cron.d.ts +18 -0
  892. package/lib/schedule-cron.d.ts.map +1 -0
  893. package/lib/schedule-cron.js +62 -0
  894. package/lib/schedule-cron.js.map +1 -0
  895. package/lib/schedule-manager.d.ts +28 -0
  896. package/lib/schedule-manager.d.ts.map +1 -0
  897. package/lib/schedule-manager.js +150 -0
  898. package/lib/schedule-manager.js.map +1 -0
  899. package/lib/security/dangerous-tool-policy-hook.d.ts +6 -0
  900. package/lib/security/dangerous-tool-policy-hook.d.ts.map +1 -0
  901. package/lib/security/dangerous-tool-policy-hook.js +41 -0
  902. package/lib/security/dangerous-tool-policy-hook.js.map +1 -0
  903. package/lib/security/dangerous-tool-policy.d.ts +2 -2
  904. package/lib/security/dangerous-tool-policy.d.ts.map +1 -1
  905. package/lib/security/dangerous-tool-policy.js.map +1 -1
  906. package/lib/security/exec-policy-hook.d.ts +7 -0
  907. package/lib/security/exec-policy-hook.d.ts.map +1 -0
  908. package/lib/security/exec-policy-hook.js +29 -0
  909. package/lib/security/exec-policy-hook.js.map +1 -0
  910. package/lib/security/exec-policy.d.ts +1 -1
  911. package/lib/security/exec-policy.d.ts.map +1 -1
  912. package/lib/security/file-policy-hook.d.ts +6 -0
  913. package/lib/security/file-policy-hook.d.ts.map +1 -0
  914. package/lib/security/file-policy-hook.js +30 -0
  915. package/lib/security/file-policy-hook.js.map +1 -0
  916. package/lib/security/owner-approve-always-store.d.ts +1 -1
  917. package/lib/security/owner-approve-always-store.d.ts.map +1 -1
  918. package/lib/security/owner-approve-always-store.js.map +1 -1
  919. package/lib/security/sandbox-enhanced.d.ts.map +1 -1
  920. package/lib/security/sandbox-enhanced.js +10 -8
  921. package/lib/security/sandbox-enhanced.js.map +1 -1
  922. package/lib/security/sandbox.d.ts.map +1 -1
  923. package/lib/security/sandbox.js +5 -4
  924. package/lib/security/sandbox.js.map +1 -1
  925. package/lib/segment/filter-im-delivery.d.ts +7 -0
  926. package/lib/segment/filter-im-delivery.d.ts.map +1 -0
  927. package/lib/segment/filter-im-delivery.js +32 -0
  928. package/lib/segment/filter-im-delivery.js.map +1 -0
  929. package/lib/service.d.ts +5 -14
  930. package/lib/service.d.ts.map +1 -1
  931. package/lib/service.js +7 -12
  932. package/lib/service.js.map +1 -1
  933. package/lib/session/branch-summarization-runtime.d.ts +16 -0
  934. package/lib/session/branch-summarization-runtime.d.ts.map +1 -0
  935. package/lib/session/branch-summarization-runtime.js +58 -0
  936. package/lib/session/branch-summarization-runtime.js.map +1 -0
  937. package/lib/session/contracts.d.ts +27 -0
  938. package/lib/session/contracts.d.ts.map +1 -0
  939. package/lib/session/contracts.js +9 -0
  940. package/lib/session/contracts.js.map +1 -0
  941. package/lib/session/index.d.ts +17 -0
  942. package/lib/session/index.d.ts.map +1 -0
  943. package/lib/session/index.js +12 -0
  944. package/lib/session/index.js.map +1 -0
  945. package/lib/session/passive-group-buffer.d.ts +15 -0
  946. package/lib/session/passive-group-buffer.d.ts.map +1 -0
  947. package/lib/session/passive-group-buffer.js +45 -0
  948. package/lib/session/passive-group-buffer.js.map +1 -0
  949. package/lib/session/passive-group-session.d.ts +12 -0
  950. package/lib/session/passive-group-session.d.ts.map +1 -0
  951. package/lib/session/passive-group-session.js +36 -0
  952. package/lib/session/passive-group-session.js.map +1 -0
  953. package/lib/session/session-io.d.ts +43 -0
  954. package/lib/session/session-io.d.ts.map +1 -0
  955. package/lib/session/session-io.js +135 -0
  956. package/lib/session/session-io.js.map +1 -0
  957. package/lib/session/session-system.d.ts +31 -0
  958. package/lib/session/session-system.d.ts.map +1 -0
  959. package/lib/session/session-system.js +70 -0
  960. package/lib/session/session-system.js.map +1 -0
  961. package/lib/session/session-tree-commands.d.ts +5 -0
  962. package/lib/session/session-tree-commands.d.ts.map +1 -0
  963. package/lib/session/session-tree-commands.js +32 -0
  964. package/lib/session/session-tree-commands.js.map +1 -0
  965. package/lib/session/strategies.d.ts +11 -0
  966. package/lib/session/strategies.d.ts.map +1 -0
  967. package/lib/session/strategies.js +19 -0
  968. package/lib/session/strategies.js.map +1 -0
  969. package/lib/session-tree-runtime-registry.d.ts +1 -1
  970. package/lib/session-tree-runtime-registry.d.ts.map +1 -1
  971. package/lib/session-tree-runtime-registry.js +1 -1
  972. package/lib/session-tree-runtime-registry.js.map +1 -1
  973. package/lib/skill/contracts.d.ts +29 -0
  974. package/lib/skill/contracts.d.ts.map +1 -0
  975. package/lib/skill/contracts.js +7 -0
  976. package/lib/skill/contracts.js.map +1 -0
  977. package/lib/skill/index.d.ts +8 -0
  978. package/lib/skill/index.d.ts.map +1 -0
  979. package/lib/skill/index.js +6 -0
  980. package/lib/skill/index.js.map +1 -0
  981. package/lib/skill/skill-load-opts.d.ts +5 -0
  982. package/lib/skill/skill-load-opts.d.ts.map +1 -0
  983. package/lib/skill/skill-load-opts.js +14 -0
  984. package/lib/skill/skill-load-opts.js.map +1 -0
  985. package/lib/skill/skill-system.d.ts +17 -0
  986. package/lib/skill/skill-system.d.ts.map +1 -0
  987. package/lib/skill/skill-system.js +51 -0
  988. package/lib/skill/skill-system.js.map +1 -0
  989. package/lib/spawn/permission-task.d.ts +9 -0
  990. package/lib/spawn/permission-task.d.ts.map +1 -0
  991. package/lib/spawn/permission-task.js +37 -0
  992. package/lib/spawn/permission-task.js.map +1 -0
  993. package/lib/stability/memory-pressure.js +1 -1
  994. package/lib/stability/memory-pressure.js.map +1 -1
  995. package/lib/subagent/contracts.d.ts +37 -0
  996. package/lib/subagent/contracts.d.ts.map +1 -0
  997. package/lib/subagent/contracts.js +8 -0
  998. package/lib/subagent/contracts.js.map +1 -0
  999. package/lib/subagent/im-result-sink.d.ts +15 -0
  1000. package/lib/subagent/im-result-sink.d.ts.map +1 -0
  1001. package/lib/subagent/im-result-sink.js +47 -0
  1002. package/lib/subagent/im-result-sink.js.map +1 -0
  1003. package/lib/subagent/index.d.ts +12 -0
  1004. package/lib/subagent/index.d.ts.map +1 -0
  1005. package/lib/subagent/index.js +8 -0
  1006. package/lib/subagent/index.js.map +1 -0
  1007. package/lib/subagent/subagent-runtime.d.ts +173 -0
  1008. package/lib/subagent/subagent-runtime.d.ts.map +1 -0
  1009. package/lib/subagent/subagent-runtime.js +553 -0
  1010. package/lib/subagent/subagent-runtime.js.map +1 -0
  1011. package/lib/subagent/subagent-system-init.d.ts +15 -0
  1012. package/lib/subagent/subagent-system-init.d.ts.map +1 -0
  1013. package/lib/subagent/subagent-system-init.js +53 -0
  1014. package/lib/subagent/subagent-system-init.js.map +1 -0
  1015. package/lib/subagent/subagent-system.d.ts +31 -0
  1016. package/lib/subagent/subagent-system.d.ts.map +1 -0
  1017. package/lib/subagent/subagent-system.js +98 -0
  1018. package/lib/subagent/subagent-system.js.map +1 -0
  1019. package/lib/subagent-ai-events.d.ts +4 -4
  1020. package/lib/subagent-ai-events.d.ts.map +1 -1
  1021. package/lib/subagent-ai-events.js.map +1 -1
  1022. package/lib/subagent-goal-notify.d.ts +11 -9
  1023. package/lib/subagent-goal-notify.d.ts.map +1 -1
  1024. package/lib/subagent-goal-notify.js +14 -8
  1025. package/lib/subagent-goal-notify.js.map +1 -1
  1026. package/lib/subagent-preset.js +3 -3
  1027. package/lib/subagent-preset.js.map +1 -1
  1028. package/lib/task-executor.d.ts +14 -10
  1029. package/lib/task-executor.d.ts.map +1 -1
  1030. package/lib/task-executor.js +94 -39
  1031. package/lib/task-executor.js.map +1 -1
  1032. package/lib/tool/context-tools.d.ts +10 -0
  1033. package/lib/tool/context-tools.d.ts.map +1 -0
  1034. package/lib/tool/context-tools.js +107 -0
  1035. package/lib/tool/context-tools.js.map +1 -0
  1036. package/lib/tool/contracts.d.ts +26 -0
  1037. package/lib/tool/contracts.d.ts.map +1 -0
  1038. package/lib/tool/contracts.js +8 -0
  1039. package/lib/tool/contracts.js.map +1 -0
  1040. package/lib/tool/deferred-resolution.d.ts +14 -0
  1041. package/lib/tool/deferred-resolution.d.ts.map +1 -0
  1042. package/lib/tool/deferred-resolution.js +72 -0
  1043. package/lib/tool/deferred-resolution.js.map +1 -0
  1044. package/lib/tool/index.d.ts +14 -0
  1045. package/lib/tool/index.d.ts.map +1 -0
  1046. package/lib/tool/index.js +9 -0
  1047. package/lib/tool/index.js.map +1 -0
  1048. package/lib/tool/pre-exec.d.ts.map +1 -0
  1049. package/lib/tool/pre-exec.js.map +1 -0
  1050. package/lib/tool/prepare-turn-tools.d.ts +22 -0
  1051. package/lib/tool/prepare-turn-tools.d.ts.map +1 -0
  1052. package/lib/tool/prepare-turn-tools.js +73 -0
  1053. package/lib/tool/prepare-turn-tools.js.map +1 -0
  1054. package/lib/tool/runtime.d.ts +24 -0
  1055. package/lib/tool/runtime.d.ts.map +1 -0
  1056. package/lib/tool/runtime.js +20 -0
  1057. package/lib/tool/runtime.js.map +1 -0
  1058. package/lib/tool/sources.d.ts +59 -0
  1059. package/lib/tool/sources.d.ts.map +1 -0
  1060. package/lib/tool/sources.js +110 -0
  1061. package/lib/tool/sources.js.map +1 -0
  1062. package/lib/tool/tool-system.d.ts +36 -0
  1063. package/lib/tool/tool-system.d.ts.map +1 -0
  1064. package/lib/tool/tool-system.js +84 -0
  1065. package/lib/tool/tool-system.js.map +1 -0
  1066. package/lib/tool/web-search-locale-attach.d.ts.map +1 -0
  1067. package/lib/tool/web-search-locale-attach.js.map +1 -0
  1068. package/lib/tool-bridge.d.ts +11 -0
  1069. package/lib/tool-bridge.d.ts.map +1 -0
  1070. package/lib/tool-bridge.js +10 -0
  1071. package/lib/tool-bridge.js.map +1 -0
  1072. package/lib/tool-catalog/index.d.ts +4 -0
  1073. package/lib/tool-catalog/index.d.ts.map +1 -0
  1074. package/lib/tool-catalog/index.js +4 -0
  1075. package/lib/tool-catalog/index.js.map +1 -0
  1076. package/lib/tool-catalog/resolve-config.d.ts +8 -0
  1077. package/lib/tool-catalog/resolve-config.d.ts.map +1 -0
  1078. package/lib/tool-catalog/resolve-config.js +22 -0
  1079. package/lib/tool-catalog/resolve-config.js.map +1 -0
  1080. package/lib/tool-catalog/session-deferred-store.d.ts +22 -0
  1081. package/lib/tool-catalog/session-deferred-store.d.ts.map +1 -0
  1082. package/lib/tool-catalog/session-deferred-store.js +50 -0
  1083. package/lib/tool-catalog/session-deferred-store.js.map +1 -0
  1084. package/lib/tool-catalog/tool-catalog.d.ts +24 -0
  1085. package/lib/tool-catalog/tool-catalog.d.ts.map +1 -0
  1086. package/lib/tool-catalog/tool-catalog.js +119 -0
  1087. package/lib/tool-catalog/tool-catalog.js.map +1 -0
  1088. package/lib/tool-catalog/types.d.ts +29 -0
  1089. package/lib/tool-catalog/types.d.ts.map +1 -0
  1090. package/lib/tool-catalog/types.js +18 -0
  1091. package/lib/tool-catalog/types.js.map +1 -0
  1092. package/lib/turn/auto-continue.d.ts +18 -0
  1093. package/lib/turn/auto-continue.d.ts.map +1 -0
  1094. package/lib/turn/auto-continue.js +76 -0
  1095. package/lib/turn/auto-continue.js.map +1 -0
  1096. package/lib/turn/deferred-auto-continue.d.ts +11 -0
  1097. package/lib/turn/deferred-auto-continue.d.ts.map +1 -0
  1098. package/lib/turn/deferred-auto-continue.js.map +1 -0
  1099. package/lib/turn/deferred-delivery.d.ts +9 -0
  1100. package/lib/turn/deferred-delivery.d.ts.map +1 -0
  1101. package/lib/turn/deferred-delivery.js.map +1 -0
  1102. package/lib/turn/inbound-queue-config.d.ts +14 -0
  1103. package/lib/turn/inbound-queue-config.d.ts.map +1 -0
  1104. package/lib/turn/inbound-queue-config.js +39 -0
  1105. package/lib/turn/inbound-queue-config.js.map +1 -0
  1106. package/lib/turn/inbound-queue-runtime.d.ts +15 -0
  1107. package/lib/turn/inbound-queue-runtime.d.ts.map +1 -0
  1108. package/lib/turn/inbound-queue-runtime.js +29 -0
  1109. package/lib/turn/inbound-queue-runtime.js.map +1 -0
  1110. package/lib/turn/inbound-turn-queue.d.ts +29 -0
  1111. package/lib/turn/inbound-turn-queue.d.ts.map +1 -0
  1112. package/lib/turn/inbound-turn-queue.js +132 -0
  1113. package/lib/turn/inbound-turn-queue.js.map +1 -0
  1114. package/lib/turn/index.d.ts +34 -0
  1115. package/lib/turn/index.d.ts.map +1 -0
  1116. package/lib/turn/index.js +26 -0
  1117. package/lib/turn/index.js.map +1 -0
  1118. package/lib/turn/multimodal-message.d.ts +9 -0
  1119. package/lib/turn/multimodal-message.d.ts.map +1 -0
  1120. package/lib/turn/multimodal-message.js +72 -0
  1121. package/lib/turn/multimodal-message.js.map +1 -0
  1122. package/lib/turn/persist-deferred-context.d.ts +5 -0
  1123. package/lib/turn/persist-deferred-context.d.ts.map +1 -0
  1124. package/lib/turn/persist-deferred-context.js +35 -0
  1125. package/lib/turn/persist-deferred-context.js.map +1 -0
  1126. package/lib/turn/persist-subagent-context.d.ts +5 -0
  1127. package/lib/turn/persist-subagent-context.d.ts.map +1 -0
  1128. package/lib/turn/persist-subagent-context.js +36 -0
  1129. package/lib/turn/persist-subagent-context.js.map +1 -0
  1130. package/lib/turn/process-stream.d.ts +14 -0
  1131. package/lib/turn/process-stream.d.ts.map +1 -0
  1132. package/lib/turn/process-stream.js +56 -0
  1133. package/lib/turn/process-stream.js.map +1 -0
  1134. package/lib/turn/prompt-access.d.ts.map +1 -0
  1135. package/lib/turn/prompt-access.js.map +1 -0
  1136. package/lib/turn/prompt-api.d.ts +14 -0
  1137. package/lib/turn/prompt-api.d.ts.map +1 -0
  1138. package/lib/turn/prompt-api.js +51 -0
  1139. package/lib/turn/prompt-api.js.map +1 -0
  1140. package/lib/turn/prompt-controller.d.ts +59 -0
  1141. package/lib/turn/prompt-controller.d.ts.map +1 -0
  1142. package/lib/turn/prompt-controller.js +190 -0
  1143. package/lib/turn/prompt-controller.js.map +1 -0
  1144. package/lib/turn/prompt-input.d.ts +3 -0
  1145. package/lib/turn/prompt-input.d.ts.map +1 -0
  1146. package/lib/turn/prompt-input.js.map +1 -0
  1147. package/lib/turn/session-message-queue.d.ts +19 -0
  1148. package/lib/turn/session-message-queue.d.ts.map +1 -0
  1149. package/lib/turn/session-message-queue.js.map +1 -0
  1150. package/lib/turn/subagent-auto-continue.d.ts +7 -0
  1151. package/lib/turn/subagent-auto-continue.d.ts.map +1 -0
  1152. package/lib/turn/subagent-auto-continue.js +16 -0
  1153. package/lib/turn/subagent-auto-continue.js.map +1 -0
  1154. package/lib/turn/task-continuation.d.ts.map +1 -0
  1155. package/lib/turn/task-continuation.js.map +1 -0
  1156. package/lib/turn/turn-complete.d.ts +25 -0
  1157. package/lib/turn/turn-complete.d.ts.map +1 -0
  1158. package/lib/turn/turn-complete.js +63 -0
  1159. package/lib/turn/turn-complete.js.map +1 -0
  1160. package/lib/turn/turn-context-bridge.d.ts +13 -0
  1161. package/lib/turn/turn-context-bridge.d.ts.map +1 -0
  1162. package/lib/turn/turn-context-bridge.js +33 -0
  1163. package/lib/turn/turn-context-bridge.js.map +1 -0
  1164. package/lib/turn/turn-deferred-delta.d.ts +6 -0
  1165. package/lib/turn/turn-deferred-delta.d.ts.map +1 -0
  1166. package/lib/turn/turn-deferred-delta.js +24 -0
  1167. package/lib/turn/turn-deferred-delta.js.map +1 -0
  1168. package/lib/turn/turn-metrics.d.ts +10 -0
  1169. package/lib/turn/turn-metrics.d.ts.map +1 -0
  1170. package/lib/turn/turn-metrics.js.map +1 -0
  1171. package/lib/turn/turn-pipeline.d.ts +14 -0
  1172. package/lib/turn/turn-pipeline.d.ts.map +1 -0
  1173. package/lib/turn/turn-pipeline.js +242 -0
  1174. package/lib/turn/turn-pipeline.js.map +1 -0
  1175. package/lib/turn/turn-tracker.d.ts.map +1 -0
  1176. package/lib/turn/turn-tracker.js.map +1 -0
  1177. package/lib/typing-indicator/adapter-integration.d.ts +3 -142
  1178. package/lib/typing-indicator/adapter-integration.d.ts.map +1 -1
  1179. package/lib/typing-indicator/adapter-integration.js +1 -329
  1180. package/lib/typing-indicator/adapter-integration.js.map +1 -1
  1181. package/lib/zhin-agent/index.d.ts +73 -83
  1182. package/lib/zhin-agent/index.d.ts.map +1 -1
  1183. package/lib/zhin-agent/index.js +168 -332
  1184. package/lib/zhin-agent/index.js.map +1 -1
  1185. package/lib/zhin-agent/runtime-modules.d.ts +27 -0
  1186. package/lib/zhin-agent/runtime-modules.d.ts.map +1 -0
  1187. package/lib/zhin-agent/runtime-modules.js +28 -0
  1188. package/lib/zhin-agent/runtime-modules.js.map +1 -0
  1189. package/package.json +59 -6
  1190. package/lib/assistant/legacy-convert.d.ts +0 -43
  1191. package/lib/assistant/legacy-convert.d.ts.map +0 -1
  1192. package/lib/assistant/legacy-convert.js +0 -108
  1193. package/lib/assistant/legacy-convert.js.map +0 -1
  1194. package/lib/builtin/activate-skill-tool.d.ts +0 -21
  1195. package/lib/builtin/activate-skill-tool.d.ts.map +0 -1
  1196. package/lib/builtin/activate-skill-tool.js +0 -57
  1197. package/lib/builtin/activate-skill-tool.js.map +0 -1
  1198. package/lib/builtin/run-spec-dry-run-tool.d.ts +0 -3
  1199. package/lib/builtin/run-spec-dry-run-tool.d.ts.map +0 -1
  1200. package/lib/builtin/run-spec-dry-run-tool.js +0 -51
  1201. package/lib/builtin/run-spec-dry-run-tool.js.map +0 -1
  1202. package/lib/builtin/run-validation-spec-tool.d.ts +0 -5
  1203. package/lib/builtin/run-validation-spec-tool.d.ts.map +0 -1
  1204. package/lib/builtin/run-validation-spec-tool.js +0 -44
  1205. package/lib/builtin/run-validation-spec-tool.js.map +0 -1
  1206. package/lib/builtin/tool-search-tool.d.ts +0 -19
  1207. package/lib/builtin/tool-search-tool.d.ts.map +0 -1
  1208. package/lib/builtin/tool-search-tool.js +0 -54
  1209. package/lib/builtin/tool-search-tool.js.map +0 -1
  1210. package/lib/cron-engine.d.ts +0 -121
  1211. package/lib/cron-engine.d.ts.map +0 -1
  1212. package/lib/cron-engine.js +0 -360
  1213. package/lib/cron-engine.js.map +0 -1
  1214. package/lib/init/register-agent-mesh-mcp.d.ts +0 -2
  1215. package/lib/init/register-agent-mesh-mcp.d.ts.map +0 -1
  1216. package/lib/init/register-agent-mesh-mcp.js +0 -29
  1217. package/lib/init/register-agent-mesh-mcp.js.map +0 -1
  1218. package/lib/init/register-mcp-memory-default.d.ts +0 -2
  1219. package/lib/init/register-mcp-memory-default.d.ts.map +0 -1
  1220. package/lib/init/register-mcp-memory-default.js +0 -35
  1221. package/lib/init/register-mcp-memory-default.js.map +0 -1
  1222. package/lib/init/register-typing-indicator.d.ts +0 -10
  1223. package/lib/init/register-typing-indicator.d.ts.map +0 -1
  1224. package/lib/init/register-typing-indicator.js +0 -286
  1225. package/lib/init/register-typing-indicator.js.map +0 -1
  1226. package/lib/mcp-server/agent-mesh-tools.d.ts +0 -8
  1227. package/lib/mcp-server/agent-mesh-tools.d.ts.map +0 -1
  1228. package/lib/mcp-server/agent-mesh-tools.js +0 -138
  1229. package/lib/mcp-server/agent-mesh-tools.js.map +0 -1
  1230. package/lib/orchestrator/delegation-processor.d.ts +0 -34
  1231. package/lib/orchestrator/delegation-processor.d.ts.map +0 -1
  1232. package/lib/orchestrator/delegation-processor.js +0 -146
  1233. package/lib/orchestrator/delegation-processor.js.map +0 -1
  1234. package/lib/orchestrator/mission-milestone-notify.d.ts +0 -17
  1235. package/lib/orchestrator/mission-milestone-notify.d.ts.map +0 -1
  1236. package/lib/orchestrator/mission-milestone-notify.js +0 -54
  1237. package/lib/orchestrator/mission-milestone-notify.js.map +0 -1
  1238. package/lib/orchestrator/mission-negotiation.d.ts +0 -17
  1239. package/lib/orchestrator/mission-negotiation.d.ts.map +0 -1
  1240. package/lib/orchestrator/mission-negotiation.js +0 -89
  1241. package/lib/orchestrator/mission-negotiation.js.map +0 -1
  1242. package/lib/orchestrator/mission-patch-acl.d.ts +0 -9
  1243. package/lib/orchestrator/mission-patch-acl.d.ts.map +0 -1
  1244. package/lib/orchestrator/mission-patch-acl.js +0 -29
  1245. package/lib/orchestrator/mission-patch-acl.js.map +0 -1
  1246. package/lib/orchestrator/mission-runner.d.ts +0 -23
  1247. package/lib/orchestrator/mission-runner.d.ts.map +0 -1
  1248. package/lib/orchestrator/mission-runner.js +0 -181
  1249. package/lib/orchestrator/mission-runner.js.map +0 -1
  1250. package/lib/orchestrator/mission-spec.d.ts +0 -44
  1251. package/lib/orchestrator/mission-spec.d.ts.map +0 -1
  1252. package/lib/orchestrator/mission-spec.js +0 -121
  1253. package/lib/orchestrator/mission-spec.js.map +0 -1
  1254. package/lib/orchestrator/mission-state.d.ts +0 -48
  1255. package/lib/orchestrator/mission-state.d.ts.map +0 -1
  1256. package/lib/orchestrator/mission-state.js +0 -66
  1257. package/lib/orchestrator/mission-state.js.map +0 -1
  1258. package/lib/subagent.d.ts +0 -141
  1259. package/lib/subagent.d.ts.map +0 -1
  1260. package/lib/subagent.js +0 -483
  1261. package/lib/subagent.js.map +0 -1
  1262. package/lib/zhin-agent/agent-loop-standalone.d.ts +0 -43
  1263. package/lib/zhin-agent/agent-loop-standalone.d.ts.map +0 -1
  1264. package/lib/zhin-agent/agent-loop-standalone.js +0 -163
  1265. package/lib/zhin-agent/agent-loop-standalone.js.map +0 -1
  1266. package/lib/zhin-agent/agent-loop-turn.d.ts +0 -52
  1267. package/lib/zhin-agent/agent-loop-turn.d.ts.map +0 -1
  1268. package/lib/zhin-agent/agent-loop-turn.js +0 -395
  1269. package/lib/zhin-agent/agent-loop-turn.js.map +0 -1
  1270. package/lib/zhin-agent/agents-instruction.d.ts +0 -15
  1271. package/lib/zhin-agent/agents-instruction.d.ts.map +0 -1
  1272. package/lib/zhin-agent/agents-instruction.js +0 -98
  1273. package/lib/zhin-agent/agents-instruction.js.map +0 -1
  1274. package/lib/zhin-agent/branch-summarization-runtime.d.ts +0 -16
  1275. package/lib/zhin-agent/branch-summarization-runtime.d.ts.map +0 -1
  1276. package/lib/zhin-agent/branch-summarization-runtime.js +0 -58
  1277. package/lib/zhin-agent/branch-summarization-runtime.js.map +0 -1
  1278. package/lib/zhin-agent/builtin-tools.d.ts +0 -14
  1279. package/lib/zhin-agent/builtin-tools.d.ts.map +0 -1
  1280. package/lib/zhin-agent/builtin-tools.js +0 -114
  1281. package/lib/zhin-agent/builtin-tools.js.map +0 -1
  1282. package/lib/zhin-agent/compaction-runtime.d.ts +0 -29
  1283. package/lib/zhin-agent/compaction-runtime.d.ts.map +0 -1
  1284. package/lib/zhin-agent/compaction-runtime.js +0 -108
  1285. package/lib/zhin-agent/compaction-runtime.js.map +0 -1
  1286. package/lib/zhin-agent/config.d.ts +0 -190
  1287. package/lib/zhin-agent/config.d.ts.map +0 -1
  1288. package/lib/zhin-agent/config.js +0 -207
  1289. package/lib/zhin-agent/config.js.map +0 -1
  1290. package/lib/zhin-agent/context-budget.d.ts +0 -27
  1291. package/lib/zhin-agent/context-budget.d.ts.map +0 -1
  1292. package/lib/zhin-agent/context-budget.js +0 -50
  1293. package/lib/zhin-agent/context-budget.js.map +0 -1
  1294. package/lib/zhin-agent/deferred-auto-continue.d.ts +0 -11
  1295. package/lib/zhin-agent/deferred-auto-continue.d.ts.map +0 -1
  1296. package/lib/zhin-agent/deferred-auto-continue.js.map +0 -1
  1297. package/lib/zhin-agent/deferred-delivery.d.ts +0 -9
  1298. package/lib/zhin-agent/deferred-delivery.d.ts.map +0 -1
  1299. package/lib/zhin-agent/deferred-delivery.js.map +0 -1
  1300. package/lib/zhin-agent/event-emitter.d.ts +0 -11
  1301. package/lib/zhin-agent/event-emitter.d.ts.map +0 -1
  1302. package/lib/zhin-agent/event-emitter.js +0 -44
  1303. package/lib/zhin-agent/event-emitter.js.map +0 -1
  1304. package/lib/zhin-agent/interfaces.d.ts +0 -63
  1305. package/lib/zhin-agent/interfaces.d.ts.map +0 -1
  1306. package/lib/zhin-agent/interfaces.js +0 -8
  1307. package/lib/zhin-agent/interfaces.js.map +0 -1
  1308. package/lib/zhin-agent/model-harness.d.ts +0 -29
  1309. package/lib/zhin-agent/model-harness.d.ts.map +0 -1
  1310. package/lib/zhin-agent/model-harness.js +0 -67
  1311. package/lib/zhin-agent/model-harness.js.map +0 -1
  1312. package/lib/zhin-agent/model-resolver.d.ts.map +0 -1
  1313. package/lib/zhin-agent/model-resolver.js +0 -27
  1314. package/lib/zhin-agent/model-resolver.js.map +0 -1
  1315. package/lib/zhin-agent/multimodal-message.d.ts +0 -9
  1316. package/lib/zhin-agent/multimodal-message.d.ts.map +0 -1
  1317. package/lib/zhin-agent/multimodal-message.js +0 -69
  1318. package/lib/zhin-agent/multimodal-message.js.map +0 -1
  1319. package/lib/zhin-agent/persist-deferred-context.d.ts +0 -5
  1320. package/lib/zhin-agent/persist-deferred-context.d.ts.map +0 -1
  1321. package/lib/zhin-agent/persist-deferred-context.js +0 -34
  1322. package/lib/zhin-agent/persist-deferred-context.js.map +0 -1
  1323. package/lib/zhin-agent/phase-trace.d.ts +0 -23
  1324. package/lib/zhin-agent/phase-trace.d.ts.map +0 -1
  1325. package/lib/zhin-agent/phase-trace.js.map +0 -1
  1326. package/lib/zhin-agent/pre-exec.d.ts.map +0 -1
  1327. package/lib/zhin-agent/pre-exec.js.map +0 -1
  1328. package/lib/zhin-agent/prompt-access.d.ts.map +0 -1
  1329. package/lib/zhin-agent/prompt-access.js.map +0 -1
  1330. package/lib/zhin-agent/prompt-assembly.d.ts +0 -31
  1331. package/lib/zhin-agent/prompt-assembly.d.ts.map +0 -1
  1332. package/lib/zhin-agent/prompt-assembly.js +0 -87
  1333. package/lib/zhin-agent/prompt-assembly.js.map +0 -1
  1334. package/lib/zhin-agent/prompt-builder.d.ts.map +0 -1
  1335. package/lib/zhin-agent/prompt-builder.js +0 -579
  1336. package/lib/zhin-agent/prompt-builder.js.map +0 -1
  1337. package/lib/zhin-agent/prompt-controller.d.ts +0 -54
  1338. package/lib/zhin-agent/prompt-controller.d.ts.map +0 -1
  1339. package/lib/zhin-agent/prompt-controller.js +0 -177
  1340. package/lib/zhin-agent/prompt-controller.js.map +0 -1
  1341. package/lib/zhin-agent/prompt-input.d.ts +0 -3
  1342. package/lib/zhin-agent/prompt-input.d.ts.map +0 -1
  1343. package/lib/zhin-agent/prompt-input.js.map +0 -1
  1344. package/lib/zhin-agent/prompt-templates.d.ts +0 -162
  1345. package/lib/zhin-agent/prompt-templates.d.ts.map +0 -1
  1346. package/lib/zhin-agent/prompt-templates.js +0 -447
  1347. package/lib/zhin-agent/prompt-templates.js.map +0 -1
  1348. package/lib/zhin-agent/prompt-trace.d.ts +0 -20
  1349. package/lib/zhin-agent/prompt-trace.d.ts.map +0 -1
  1350. package/lib/zhin-agent/prompt-trace.js.map +0 -1
  1351. package/lib/zhin-agent/prompt.d.ts +0 -83
  1352. package/lib/zhin-agent/prompt.d.ts.map +0 -1
  1353. package/lib/zhin-agent/prompt.js +0 -548
  1354. package/lib/zhin-agent/prompt.js.map +0 -1
  1355. package/lib/zhin-agent/session-io.d.ts +0 -37
  1356. package/lib/zhin-agent/session-io.d.ts.map +0 -1
  1357. package/lib/zhin-agent/session-io.js +0 -115
  1358. package/lib/zhin-agent/session-io.js.map +0 -1
  1359. package/lib/zhin-agent/session-message-queue.d.ts +0 -20
  1360. package/lib/zhin-agent/session-message-queue.d.ts.map +0 -1
  1361. package/lib/zhin-agent/session-message-queue.js.map +0 -1
  1362. package/lib/zhin-agent/session-tree-commands.d.ts +0 -5
  1363. package/lib/zhin-agent/session-tree-commands.d.ts.map +0 -1
  1364. package/lib/zhin-agent/session-tree-commands.js +0 -32
  1365. package/lib/zhin-agent/session-tree-commands.js.map +0 -1
  1366. package/lib/zhin-agent/task-continuation.d.ts.map +0 -1
  1367. package/lib/zhin-agent/task-continuation.js.map +0 -1
  1368. package/lib/zhin-agent/text-sanitize.d.ts.map +0 -1
  1369. package/lib/zhin-agent/text-sanitize.js.map +0 -1
  1370. package/lib/zhin-agent/tool-calls-user-format.d.ts.map +0 -1
  1371. package/lib/zhin-agent/tool-calls-user-format.js +0 -138
  1372. package/lib/zhin-agent/tool-calls-user-format.js.map +0 -1
  1373. package/lib/zhin-agent/tool-catalog.d.ts +0 -15
  1374. package/lib/zhin-agent/tool-catalog.d.ts.map +0 -1
  1375. package/lib/zhin-agent/tool-catalog.js +0 -60
  1376. package/lib/zhin-agent/tool-catalog.js.map +0 -1
  1377. package/lib/zhin-agent/tool-orchestration.d.ts +0 -9
  1378. package/lib/zhin-agent/tool-orchestration.d.ts.map +0 -1
  1379. package/lib/zhin-agent/tool-orchestration.js +0 -90
  1380. package/lib/zhin-agent/tool-orchestration.js.map +0 -1
  1381. package/lib/zhin-agent/tool-runtime.d.ts +0 -31
  1382. package/lib/zhin-agent/tool-runtime.d.ts.map +0 -1
  1383. package/lib/zhin-agent/tool-runtime.js +0 -61
  1384. package/lib/zhin-agent/tool-runtime.js.map +0 -1
  1385. package/lib/zhin-agent/tool-search-orchestrator.d.ts +0 -26
  1386. package/lib/zhin-agent/tool-search-orchestrator.d.ts.map +0 -1
  1387. package/lib/zhin-agent/tool-search-orchestrator.js +0 -107
  1388. package/lib/zhin-agent/tool-search-orchestrator.js.map +0 -1
  1389. package/lib/zhin-agent/turn-context.d.ts +0 -9
  1390. package/lib/zhin-agent/turn-context.d.ts.map +0 -1
  1391. package/lib/zhin-agent/turn-context.js +0 -12
  1392. package/lib/zhin-agent/turn-context.js.map +0 -1
  1393. package/lib/zhin-agent/turn-metrics.d.ts +0 -20
  1394. package/lib/zhin-agent/turn-metrics.d.ts.map +0 -1
  1395. package/lib/zhin-agent/turn-metrics.js.map +0 -1
  1396. package/lib/zhin-agent/turn-pipeline.d.ts +0 -12
  1397. package/lib/zhin-agent/turn-pipeline.d.ts.map +0 -1
  1398. package/lib/zhin-agent/turn-pipeline.js +0 -326
  1399. package/lib/zhin-agent/turn-pipeline.js.map +0 -1
  1400. package/lib/zhin-agent/turn-tracker.d.ts.map +0 -1
  1401. package/lib/zhin-agent/turn-tracker.js.map +0 -1
  1402. package/lib/zhin-agent/turn-user-message.d.ts +0 -11
  1403. package/lib/zhin-agent/turn-user-message.d.ts.map +0 -1
  1404. package/lib/zhin-agent/turn-user-message.js +0 -49
  1405. package/lib/zhin-agent/turn-user-message.js.map +0 -1
  1406. package/lib/zhin-agent/web-search-locale-attach.d.ts.map +0 -1
  1407. package/lib/zhin-agent/web-search-locale-attach.js.map +0 -1
  1408. package/lib/zhin-agent/workspace-prompt.d.ts.map +0 -1
  1409. package/lib/zhin-agent/workspace-prompt.js.map +0 -1
  1410. package/lib/zhin-agent/zhin-agent-private.d.ts +0 -90
  1411. package/lib/zhin-agent/zhin-agent-private.d.ts.map +0 -1
  1412. package/lib/zhin-agent/zhin-agent-private.js +0 -4
  1413. package/lib/zhin-agent/zhin-agent-private.js.map +0 -1
  1414. /package/lib/{zhin-agent → context}/model-resolver.d.ts +0 -0
  1415. /package/lib/{zhin-agent → core}/text-sanitize.d.ts +0 -0
  1416. /package/lib/{zhin-agent → core}/text-sanitize.js +0 -0
  1417. /package/lib/{zhin-agent → core}/tool-calls-user-format.d.ts +0 -0
  1418. /package/lib/{zhin-agent → internal}/phase-trace.js +0 -0
  1419. /package/lib/{zhin-agent → internal}/prompt-trace.js +0 -0
  1420. /package/lib/{zhin-agent → prompt}/prompt-builder.d.ts +0 -0
  1421. /package/lib/{zhin-agent → prompt}/workspace-prompt.d.ts +0 -0
  1422. /package/lib/{zhin-agent → prompt}/workspace-prompt.js +0 -0
  1423. /package/lib/{zhin-agent → tool}/pre-exec.d.ts +0 -0
  1424. /package/lib/{zhin-agent → tool}/pre-exec.js +0 -0
  1425. /package/lib/{zhin-agent → tool}/web-search-locale-attach.d.ts +0 -0
  1426. /package/lib/{zhin-agent → tool}/web-search-locale-attach.js +0 -0
  1427. /package/lib/{zhin-agent → turn}/deferred-auto-continue.js +0 -0
  1428. /package/lib/{zhin-agent → turn}/deferred-delivery.js +0 -0
  1429. /package/lib/{zhin-agent → turn}/prompt-access.d.ts +0 -0
  1430. /package/lib/{zhin-agent → turn}/prompt-access.js +0 -0
  1431. /package/lib/{zhin-agent → turn}/prompt-input.js +0 -0
  1432. /package/lib/{zhin-agent → turn}/session-message-queue.js +0 -0
  1433. /package/lib/{zhin-agent → turn}/task-continuation.d.ts +0 -0
  1434. /package/lib/{zhin-agent → turn}/task-continuation.js +0 -0
  1435. /package/lib/{zhin-agent → turn}/turn-metrics.js +0 -0
  1436. /package/lib/{zhin-agent → turn}/turn-tracker.d.ts +0 -0
  1437. /package/lib/{zhin-agent → turn}/turn-tracker.js +0 -0
@@ -0,0 +1,110 @@
1
+ import { isReservedToolName } from '@zhin.js/ai';
2
+ import { sceneRefFromMessage, Logger } from '@zhin.js/core';
3
+ import { KEYWORD_TRIGGERS } from '../config/keyword-triggers.js';
4
+ import { createImTranscriptHistoryTool, createUserProfileTool, } from '../tool/context-tools.js';
5
+ import { buildImTranscriptQuery } from '../session/session-io.js';
6
+ import { sharedToolSelection } from '../orchestrator/tool-selection.js';
7
+ import { RESERVED_TOOL_NAMES, RESERVED_TOOL_NAME_PREFIXES } from '../reserved-tools.js';
8
+ const logger = new Logger(null, 'ToolSystem');
9
+ function canAccessTool(tool, message) {
10
+ const perms = tool.permissions;
11
+ if (!perms?.length)
12
+ return true;
13
+ const adapter = String(message.$adapter ?? '');
14
+ const scene = sceneRefFromMessage(message)?.kind ?? '';
15
+ return perms.some(p => p === adapter || p === scene || p === '*');
16
+ }
17
+ export class ExternalToolSource {
18
+ externalTools;
19
+ name = 'external';
20
+ priority = 200;
21
+ constructor(externalTools) {
22
+ this.externalTools = externalTools;
23
+ }
24
+ collectTools(context) {
25
+ const tools = [];
26
+ for (const tool of this.externalTools) {
27
+ if (!canAccessTool(tool, context.message))
28
+ continue;
29
+ tools.push(sharedToolSelection.normalize(tool, context.message));
30
+ }
31
+ return tools;
32
+ }
33
+ }
34
+ export class SkillToolSource {
35
+ skillRegistry;
36
+ name = 'skills';
37
+ priority = 100;
38
+ constructor(skillRegistry) {
39
+ this.skillRegistry = skillRegistry;
40
+ }
41
+ collectTools(context) {
42
+ if (!this.skillRegistry)
43
+ return [];
44
+ return this.skillRegistry.collectAllTools().map((tool) => sharedToolSelection.normalize(tool, context.message));
45
+ }
46
+ }
47
+ export class RegisteredToolSource {
48
+ externalRegistered;
49
+ name = 'registered';
50
+ priority = 150;
51
+ constructor(externalRegistered) {
52
+ this.externalRegistered = externalRegistered;
53
+ }
54
+ collectTools(_context) {
55
+ return [...this.externalRegistered.values()];
56
+ }
57
+ }
58
+ export class BuiltinToolSource {
59
+ name = 'builtin';
60
+ priority = 1000;
61
+ collectTools(context) {
62
+ const tools = [];
63
+ if (KEYWORD_TRIGGERS.chatHistory.test(context.content)) {
64
+ tools.push(createImTranscriptHistoryTool(context.imTranscriptStore, buildImTranscriptQuery(context.message)));
65
+ }
66
+ if (KEYWORD_TRIGGERS.userProfile.test(context.content)) {
67
+ tools.push(createUserProfileTool(context.userId, context.userProfiles));
68
+ }
69
+ return tools;
70
+ }
71
+ }
72
+ export class McpToolSource {
73
+ name = 'mcp';
74
+ priority = 50;
75
+ collectTools(context) {
76
+ const tools = [];
77
+ for (const mcpTool of context.mcpTools ?? []) {
78
+ if (isReservedToolName(mcpTool.name, {
79
+ reservedNames: RESERVED_TOOL_NAMES,
80
+ reservedPrefixes: RESERVED_TOOL_NAME_PREFIXES,
81
+ })) {
82
+ logger.warn(`[MCP] Skipping tool "${mcpTool.name}": conflicts with reserved tool name`);
83
+ continue;
84
+ }
85
+ tools.push(mcpTool);
86
+ }
87
+ return tools;
88
+ }
89
+ }
90
+ export class PermissionToolFilter {
91
+ name = 'permission';
92
+ filter(tools) {
93
+ return tools;
94
+ }
95
+ }
96
+ export class DedupeToolFilter {
97
+ name = 'dedupe';
98
+ filter(tools) {
99
+ const names = new Set();
100
+ const out = [];
101
+ for (const tool of tools) {
102
+ if (names.has(tool.name))
103
+ continue;
104
+ out.push(tool);
105
+ names.add(tool.name);
106
+ }
107
+ return out;
108
+ }
109
+ }
110
+ //# sourceMappingURL=sources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sources.js","sourceRoot":"","sources":["../../src/tool/sources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAwE,MAAM,aAAa,CAAC;AACvH,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAI5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,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entPrivate } from '../internal/agent-host.js';
4
+ import type { ToolFilter, ToolSource, ToolSystemConfig } from './contracts.js';
5
+ import { type CollectToolsContext } from './sources.js';
6
+ import { type ResolvedToolsForTurn } from './deferred-resolution.js';
7
+ export type { CollectToolsContext } from './sources.js';
8
+ export type { ResolvedToolsForTurn } from './deferred-resolution.js';
9
+ export interface CollectToolsForTurnInput extends CollectToolsContext {
10
+ host: ZhinAgentPrivate;
11
+ spawnableAgentNames?: string[];
12
+ }
13
+ /** 每 turn 独立 Source 列表,不 mutate 共享 ToolSystem 实例。 */
14
+ export declare function createDefaultToolSources(context: CollectToolsContext): ToolSource[];
15
+ export declare function createToolSystem(config?: ToolSystemConfig): ToolSystem;
16
+ export declare class ToolSystem {
17
+ private readonly customSources;
18
+ private readonly filters;
19
+ constructor(_config?: ToolSystemConfig);
20
+ addSource(source: ToolSource): void;
21
+ addFilter(filter: ToolFilter): void;
22
+ collectTools(context: CollectToolsContext, sources?: ToolSource[]): AgentTool[];
23
+ collectForTurn(input: CollectToolsForTurnInput): AgentTool[];
24
+ resolveForTurn(host: ZhinAgentPrivate, allTools: AgentTool[], sessionId: string): Promise<ResolvedToolsForTurn>;
25
+ }
26
+ export interface ToolRunPlan {
27
+ preExecTools: AgentTool[];
28
+ preExecution: PreExecuteResult;
29
+ hasNonPreExecTools: boolean;
30
+ mode: 'chat' | 'pre-exec-fast-path' | 'agent';
31
+ }
32
+ export declare function planToolRun(tools: AgentTool[], timeoutMs: number): Promise<ToolRunPlan>;
33
+ export declare function buildPreExecFastPathPrompt(persona: string, preData: string): string;
34
+ /** 无 per-turn 可变 state;并发 collectForTurn 安全。 */
35
+ export declare const defaultToolSystem: ToolSystem;
36
+ //# sourceMappingURL=tool-system.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-system.d.ts","sourceRoot":"","sources":["../../src/tool/tool-system.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C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W,WAAW;IAC1B,YAAY,EAAE,SAAS,EAAE,CAAC;IAC1B,YAAY,EAAE,gBAAgB,CAAC;IAC/B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,IAAI,EAAE,MAAM,GAAG,oBAAoB,GAAG,OAAO,CAAC;CAC/C;AAED,wBAAsB,WAAW,CAC/B,KAAK,EAAE,SAAS,EAAE,EAClB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,WAAW,CAAC,CAWtB;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAOnF;AAED,gDAAgD;AAChD,eAAO,MAAM,iBAAiB,YAAqB,CAAC"}
@@ -0,0 +1,84 @@
1
+ import { runPreExecutableTools } from './pre-exec.js';
2
+ import { createSpawnTaskTool } from '../builtin/spawn-task-tool.js';
3
+ import { filterAgentsForSpawnDescription } from '../spawn/permission-task.js';
4
+ import { BuiltinToolSource, DedupeToolFilter, ExternalToolSource, McpToolSource, RegisteredToolSource, SkillToolSource, } from './sources.js';
5
+ import { resolveAgentToolsForTurn, } from './deferred-resolution.js';
6
+ /** 每 turn 独立 Source 列表,不 mutate 共享 ToolSystem 实例。 */
7
+ export function createDefaultToolSources(context) {
8
+ return [
9
+ new ExternalToolSource(context.externalTools),
10
+ new SkillToolSource(context.skillRegistry),
11
+ new RegisteredToolSource(context.externalRegistered),
12
+ new BuiltinToolSource(),
13
+ new McpToolSource(),
14
+ ];
15
+ }
16
+ export function createToolSystem(config = {}) {
17
+ return new ToolSystem(config);
18
+ }
19
+ export class ToolSystem {
20
+ customSources = [];
21
+ filters = [];
22
+ constructor(_config = {}) {
23
+ this.addFilter(new DedupeToolFilter());
24
+ }
25
+ addSource(source) {
26
+ this.customSources.push(source);
27
+ this.customSources.sort((a, b) => b.priority - a.priority);
28
+ }
29
+ addFilter(filter) {
30
+ this.filters.push(filter);
31
+ }
32
+ collectTools(context, sources) {
33
+ const activeSources = sources ?? [
34
+ ...createDefaultToolSources(context),
35
+ ...this.customSources,
36
+ ];
37
+ let tools = [];
38
+ for (const source of activeSources) {
39
+ tools.push(...source.collectTools(context));
40
+ }
41
+ for (const filter of this.filters) {
42
+ tools = filter.filter(tools, { message: context.message });
43
+ }
44
+ return tools;
45
+ }
46
+ collectForTurn(input) {
47
+ const { host, spawnableAgentNames, ...ctx } = input;
48
+ const tools = this.collectTools(ctx, createDefaultToolSources(ctx));
49
+ if (host.subagentSystem && spawnableAgentNames) {
50
+ const permissionTask = host.activeBinding?.permission?.task;
51
+ tools.push(createSpawnTaskTool(ctx.message, host.subagentSystem, {
52
+ allowedAgents: filterAgentsForSpawnDescription(spawnableAgentNames, permissionTask),
53
+ permissionTaskRules: permissionTask,
54
+ }));
55
+ }
56
+ return tools;
57
+ }
58
+ async resolveForTurn(host, allTools, sessionId) {
59
+ return resolveAgentToolsForTurn(host, allTools, sessionId);
60
+ }
61
+ }
62
+ export async function planToolRun(tools, timeoutMs) {
63
+ const preExecution = await runPreExecutableTools(tools, timeoutMs);
64
+ const hasNonPreExecTools = tools.some(tool => !tool.preExecutable);
65
+ return {
66
+ preExecTools: preExecution.tools,
67
+ preExecution,
68
+ hasNonPreExecTools,
69
+ mode: tools.length === 0
70
+ ? 'chat'
71
+ : (!hasNonPreExecTools && preExecution.data ? 'pre-exec-fast-path' : 'agent'),
72
+ };
73
+ }
74
+ export function buildPreExecFastPathPrompt(persona, preData) {
75
+ return `${persona}
76
+
77
+ Pre-fetched data (from user's question):
78
+ ${preData}
79
+
80
+ Answer the user's question based on the data above. Be clear and concise; use emoji when appropriate.`;
81
+ }
82
+ /** 无 per-turn 可变 state;并发 collectForTurn 安全。 */
83
+ export const defaultToolSystem = createToolSystem();
84
+ //# sourceMappingURL=tool-system.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-system.js","sourceRoot":"","sources":["../../src/tool/tool-system.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,qBAAqB,EAAE,MAAM,eAAe,CAAC;A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AAC,CAAC;IAC7D,CAAC;CACF;AASD,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,KAAkB,EAClB,SAAiB;IAEjB,MAAM,YAAY,GAAG,MAAM,qBAAqB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACnE,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACnE,OAAO;QACL,YAAY,EAAE,YAAY,CAAC,KAAK;QAChC,YAAY;QACZ,kBAAkB;QAClB,IAAI,EAAE,KAAK,CAAC,MAAM,KAAK,CAAC;YACtB,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,CAAC,CAAC,kBAAkB,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,OAAO,CAAC;KAChF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,OAAe,EAAE,OAAe;IACzE,OAAO,GAAG,OAAO;;;EAGjB,OAAO;;sGAE6F,CAAC;AACvG,CAAC;AAED,gDAAgD;AAChD,MAAM,CAAC,MAAM,iBAAiB,GAAG,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-search-locale-attach.d.ts","sourceRoot":"","sources":["../../src/tool/web-search-locale-attach.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,OAAO,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAMtD,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,OAAO,EACpB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,gBAAgB,GAC7B,OAAO,CAAC,OAAO,CAAC,CAiBlB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-search-locale-attach.js","sourceRoot":"","sources":["../../src/tool/web-search-locale-attach.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,iCAAiC,CAAC;AAEzC,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,WAAoB,EACpB,MAAc,EACd,YAA8B;IAE9B,MAAM,IAAI,GAAG,WAA+B,CAAC;IAC7C,MAAM,KAAK,GAA4B,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC;IACjE,MAAM,QAAQ,GAAG,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACpD,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;QACpD,KAAK,CAAC,2BAA2B,CAAC,GAAG,4BAA4B,CAAC,QAAQ,CAAC,CAAC;QAC5E,OAAO,EAAE,GAAG,WAAW,EAAE,KAAK,EAAa,CAAC;IAC9C,CAAC;IACD,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC9C,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC;QAC9C,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC;KACrC,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,CAAC,SAAS,IAAI,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC;IAC7C,IAAI,IAAI,EAAE,CAAC;QACT,KAAK,CAAC,2BAA2B,CAAC,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,EAAE,GAAG,WAAW,EAAE,KAAK,EAAa,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Tool schema bridge — canonical conversion paths (ADR 0009 / 0019).
3
+ *
4
+ * Authoring SSOT: `@zhin.js/core` Tool (+ Zod/JSON schema)
5
+ * → pluginToolToAgentTool (agent runtime)
6
+ * → agentToolToLlmTool (@zhin.js/ai transport)
7
+ */
8
+ export { agentToolToLlmTool, agentToolsToLlmTools, } from '@zhin.js/ai';
9
+ export { normalizeTool as pluginToolToAgentTool, } from './orchestrator/tool-selection.js';
10
+ export type { NormalizableTool } from './orchestrator/tool-selection.js';
11
+ //# sourceMappingURL=tool-bridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-bridge.d.ts","sourceRoot":"","sources":["../src/tool-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,aAAa,IAAI,qBAAqB,GACvC,MAAM,kCAAkC,CAAC;AAE1C,YAAY,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Tool schema bridge — canonical conversion paths (ADR 0009 / 0019).
3
+ *
4
+ * Authoring SSOT: `@zhin.js/core` Tool (+ Zod/JSON schema)
5
+ * → pluginToolToAgentTool (agent runtime)
6
+ * → agentToolToLlmTool (@zhin.js/ai transport)
7
+ */
8
+ export { agentToolToLlmTool, agentToolsToLlmTools, } from '@zhin.js/ai';
9
+ export { normalizeTool as pluginToolToAgentTool, } from './orchestrator/tool-selection.js';
10
+ //# sourceMappingURL=tool-bridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-bridge.js","sourceRoot":"","sources":["../src/tool-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,aAAa,IAAI,qBAAqB,GACvC,MAAM,kCAAkC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './types.js';
2
+ export * from './tool-catalog.js';
3
+ export * from './resolve-config.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tool-catalog/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './types.js';
2
+ export * from './tool-catalog.js';
3
+ export * from './resolve-config.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tool-catalog/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { ZhinAgentConfig } from '../config/index.js';
2
+ import { type DeferredToolsConfig } from './types.js';
3
+ export declare function resolveDeferredToolsConfig(config: Pick<ZhinAgentConfig, 'deferredTools'>): Required<Pick<DeferredToolsConfig, 'maxLoadedPerSession' | 'discoverTopK' | 'alwaysLoadedTools'>> & {
4
+ mcpServers: NonNullable<DeferredToolsConfig['mcpServers']>;
5
+ };
6
+ export declare function resolveAlwaysLoadedSet(config: Pick<ZhinAgentConfig, 'deferredTools'>): Set<string>;
7
+ export declare function isMcpToolDeferred(toolName: string, mcpServer: string | undefined, deferredConfig: ReturnType<typeof resolveDeferredToolsConfig>): boolean;
8
+ //# sourceMappingURL=resolve-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-config.d.ts","sourceRoot":"","sources":["../../src/tool-catalog/resolve-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,YAAY,CAAC;AAEpB,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,eAAe,CAAC,GAC7C,QAAQ,CAAC,IAAI,CAAC,mBAAmB,EAAE,qBAAqB,GAAG,cAAc,GAAG,mBAAmB,CAAC,CAAC,GAAG;IACrG,UAAU,EAAE,WAAW,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC;CAC5D,CASA;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,eAAe,CAAC,GAC7C,GAAG,CAAC,MAAM,CAAC,CAEb;AAED,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,cAAc,EAAE,UAAU,CAAC,OAAO,0BAA0B,CAAC,GAC5D,OAAO,CAKT"}
@@ -0,0 +1,22 @@
1
+ import { DEFAULT_DEFERRED_TOOLS_CONFIG, } from './types.js';
2
+ export function resolveDeferredToolsConfig(config) {
3
+ const dt = config.deferredTools ?? {};
4
+ const alwaysLoaded = dt.alwaysLoadedTools ?? DEFAULT_DEFERRED_TOOLS_CONFIG.alwaysLoadedTools;
5
+ return {
6
+ maxLoadedPerSession: dt.maxLoadedPerSession ?? DEFAULT_DEFERRED_TOOLS_CONFIG.maxLoadedPerSession,
7
+ discoverTopK: dt.discoverTopK ?? DEFAULT_DEFERRED_TOOLS_CONFIG.discoverTopK,
8
+ alwaysLoadedTools: [...alwaysLoaded],
9
+ mcpServers: dt.mcpServers ?? {},
10
+ };
11
+ }
12
+ export function resolveAlwaysLoadedSet(config) {
13
+ return new Set(resolveDeferredToolsConfig(config).alwaysLoadedTools);
14
+ }
15
+ export function isMcpToolDeferred(toolName, mcpServer, deferredConfig) {
16
+ if (!mcpServer)
17
+ return true;
18
+ const serverCfg = deferredConfig.mcpServers[mcpServer];
19
+ const always = new Set(serverCfg?.alwaysLoaded ?? []);
20
+ return !always.has(toolName);
21
+ }
22
+ //# sourceMappingURL=resolve-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-config.js","sourceRoot":"","sources":["../../src/tool-catalog/resolve-config.ts"],"names":[],"mappings":"AACA,OAAO,EACL,6BAA6B,GAE9B,MAAM,YAAY,CAAC;AAEpB,MAAM,UAAU,0BAA0B,CACxC,MAA8C;IAI9C,MAAM,EAAE,GAAG,MAAM,CAAC,aAAa,IAAI,EAAE,CAAC;IACtC,MAAM,YAAY,GAAG,EAAE,CAAC,iBAAiB,IAAI,6BAA6B,CAAC,iBAAiB,CAAC;IAC7F,OAAO;QACL,mBAAmB,EAAE,EAAE,CAAC,mBAAmB,IAAI,6BAA6B,CAAC,mBAAmB;QAChG,YAAY,EAAE,EAAE,CAAC,YAAY,IAAI,6BAA6B,CAAC,YAAY;QAC3E,iBAAiB,EAAE,CAAC,GAAG,YAAY,CAAC;QACpC,UAAU,EAAE,EAAE,CAAC,UAAU,IAAI,EAAE;KAChC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,MAA8C;IAE9C,OAAO,IAAI,GAAG,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC;AACvE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,QAAgB,EAChB,SAA6B,EAC7B,cAA6D;IAE7D,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5B,MAAM,SAAS,GAAG,cAAc,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACvD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,SAAS,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC;IACtD,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Session-level loaded tool state with LRU eviction.
3
+ * Persisted via ContextRepository session metadata bridge.
4
+ */
5
+ export interface DeferredSessionSnapshot {
6
+ loadedTools: Record<string, number>;
7
+ loadedSkills: string[];
8
+ }
9
+ export declare class SessionDeferredToolStore {
10
+ private readonly bySession;
11
+ get(sessionId: string): DeferredSessionSnapshot;
12
+ set(sessionId: string, snapshot: DeferredSessionSnapshot): void;
13
+ clear(sessionId: string): void;
14
+ touchTool(sessionId: string, name: string, maxLoaded: number): void;
15
+ touchTools(sessionId: string, names: Iterable<string>, maxLoaded: number): void;
16
+ addSkill(sessionId: string, name: string): void;
17
+ getLoadedToolNames(sessionId: string): string[];
18
+ private evictLru;
19
+ }
20
+ /** Process-wide store; ContextRepository adapters may mirror per session. */
21
+ export declare const sharedDeferredToolStore: SessionDeferredToolStore;
22
+ //# sourceMappingURL=session-deferred-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-deferred-store.d.ts","sourceRoot":"","sources":["../../src/tool-catalog/session-deferred-store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,qBAAa,wBAAwB;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA8C;IAExE,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,uBAAuB;IAI/C,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,uBAAuB,GAAG,IAAI;IAI/D,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAI9B,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;IAQnE,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;IAM/E,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAQ/C,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE;IAO/C,OAAO,CAAC,QAAQ;CASjB;AAED,6EAA6E;AAC7E,eAAO,MAAM,uBAAuB,0BAAiC,CAAC"}
@@ -0,0 +1,50 @@
1
+ export class SessionDeferredToolStore {
2
+ bySession = new Map();
3
+ get(sessionId) {
4
+ return this.bySession.get(sessionId) ?? { loadedTools: {}, loadedSkills: [] };
5
+ }
6
+ set(sessionId, snapshot) {
7
+ this.bySession.set(sessionId, snapshot);
8
+ }
9
+ clear(sessionId) {
10
+ this.bySession.delete(sessionId);
11
+ }
12
+ touchTool(sessionId, name, maxLoaded) {
13
+ const snap = this.get(sessionId);
14
+ const now = Date.now();
15
+ snap.loadedTools[name] = now;
16
+ this.evictLru(snap, maxLoaded);
17
+ this.bySession.set(sessionId, snap);
18
+ }
19
+ touchTools(sessionId, names, maxLoaded) {
20
+ for (const name of names) {
21
+ this.touchTool(sessionId, name, maxLoaded);
22
+ }
23
+ }
24
+ addSkill(sessionId, name) {
25
+ const snap = this.get(sessionId);
26
+ if (!snap.loadedSkills.includes(name)) {
27
+ snap.loadedSkills.push(name);
28
+ }
29
+ this.bySession.set(sessionId, snap);
30
+ }
31
+ getLoadedToolNames(sessionId) {
32
+ const snap = this.get(sessionId);
33
+ return Object.entries(snap.loadedTools)
34
+ .sort((a, b) => b[1] - a[1])
35
+ .map(([name]) => name);
36
+ }
37
+ evictLru(snap, maxLoaded) {
38
+ const entries = Object.entries(snap.loadedTools);
39
+ if (entries.length <= maxLoaded)
40
+ return;
41
+ entries.sort((a, b) => a[1] - b[1]);
42
+ const toRemove = entries.length - maxLoaded;
43
+ for (let i = 0; i < toRemove; i++) {
44
+ delete snap.loadedTools[entries[i][0]];
45
+ }
46
+ }
47
+ }
48
+ /** Process-wide store; ContextRepository adapters may mirror per session. */
49
+ export const sharedDeferredToolStore = new SessionDeferredToolStore();
50
+ //# sourceMappingURL=session-deferred-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-deferred-store.js","sourceRoot":"","sources":["../../src/tool-catalog/session-deferred-store.ts"],"names":[],"mappings":"AASA,MAAM,OAAO,wBAAwB;IAClB,SAAS,GAAG,IAAI,GAAG,EAAmC,CAAC;IAExE,GAAG,CAAC,SAAiB;QACnB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAA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,SAAiB;QAClC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACjC,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC;aACpC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;aAC3B,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAEO,QAAQ,CAAC,IAA6B,EAAE,SAAiB;QAC/D,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACjD,IAAI,OAAO,CAAC,MAAM,IAAI,SAAS;YAAE,OAAO;QACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;QAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC;YAClC,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;CACF;AAED,6EAA6E;AAC7E,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,wBAAwB,EAAE,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { type AgentTool } from '@zhin.js/ai';
2
+ import type { SkillRegistry } from '../orchestrator/skill-registry.js';
3
+ import { type DiscoverKind, type DiscoverResultItem, type ToolCatalogItem } from './types.js';
4
+ export interface BuildToolCatalogOptions {
5
+ tools: AgentTool[];
6
+ mcpServerByTool?: Map<string, string>;
7
+ alwaysLoaded: Set<string>;
8
+ }
9
+ export declare function buildToolCatalog(options: BuildToolCatalogOptions): ToolCatalogItem[];
10
+ export declare function catalogToolByName(catalog: ToolCatalogItem[]): Map<string, ToolCatalogItem>;
11
+ export interface DiscoverInCatalogOptions {
12
+ query: string;
13
+ kind: DiscoverKind;
14
+ topK: number;
15
+ platform?: string;
16
+ mcpServer?: string;
17
+ skillRegistry: SkillRegistry | null;
18
+ catalog: ToolCatalogItem[];
19
+ }
20
+ export declare function discoverInCatalog(options: DiscoverInCatalogOptions): DiscoverResultItem[];
21
+ export declare function resolveDeferredApiTools(catalog: ToolCatalogItem[], alwaysLoaded: Set<string>, sessionLoadedNames: string[]): AgentTool[];
22
+ export declare function buildDeferredStats(catalog: ToolCatalogItem[], apiTools: AgentTool[]): string;
23
+ export type { DiscoverKind, DiscoverResultItem, ToolCatalogItem, ToolCatalogSource } from './types.js';
24
+ //# sourceMappingURL=tool-catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-catalog.d.ts","sourceRoot":"","sources":["../../src/tool-catalog/tool-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAoD,MAAM,YAAY,CAAC;AAChJ,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC3B;AAgBD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,eAAe,EAAE,CAoBpF;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAE1F;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IACpC,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,kBAAkB,EAAE,CA8CzF;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,eAAe,EAAE,EAC1B,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,EACzB,kBAAkB,EAAE,MAAM,EAAE,GAC3B,SAAS,EAAE,CAwBb;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,CAS5F;AAED,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,119 @@
1
+ import { filterTools } from '@zhin.js/ai';
2
+ import { DEFERRED_META_TOOL_NAMES } from './types.js';
3
+ function briefFromTool(tool) {
4
+ const desc = tool.description?.trim() ?? '';
5
+ return desc.length > 120 ? `${desc.slice(0, 117)}...` : desc;
6
+ }
7
+ function inferSource(tool, mcpServer) {
8
+ if (DEFERRED_META_TOOL_NAMES.has(tool.name))
9
+ return 'meta';
10
+ if (mcpServer)
11
+ return 'mcp';
12
+ const src = tool.source ?? '';
13
+ if (src.startsWith('builtin'))
14
+ return 'builtin';
15
+ if (src.includes('skill'))
16
+ return 'skill';
17
+ return 'plugin';
18
+ }
19
+ export function buildToolCatalog(options) {
20
+ const { tools, mcpServerByTool, alwaysLoaded } = options;
21
+ const items = [];
22
+ const seen = new Set();
23
+ for (const tool of tools) {
24
+ if (seen.has(tool.name))
25
+ continue;
26
+ seen.add(tool.name);
27
+ const mcpServer = mcpServerByTool?.get(tool.name);
28
+ const isAlways = alwaysLoaded.has(tool.name);
29
+ items.push({
30
+ name: tool.name,
31
+ brief: briefFromTool(tool),
32
+ fullTool: tool,
33
+ source: inferSource(tool, mcpServer),
34
+ mcpServer,
35
+ deferDefault: !isAlways && !DEFERRED_META_TOOL_NAMES.has(tool.name),
36
+ });
37
+ }
38
+ return items;
39
+ }
40
+ export function catalogToolByName(catalog) {
41
+ return new Map(catalog.map(item => [item.name, item]));
42
+ }
43
+ export function discoverInCatalog(options) {
44
+ const { query, kind, topK, platform, mcpServer, skillRegistry, catalog } = options;
45
+ const q = query.trim();
46
+ const results = [];
47
+ const wantTools = kind === 'tool' || kind === 'all';
48
+ const wantSkills = kind === 'skill' || kind === 'all';
49
+ if (wantTools && q) {
50
+ const pool = catalog
51
+ .filter(item => item.source !== 'meta' && !DEFERRED_META_TOOL_NAMES.has(item.name))
52
+ .filter(item => !mcpServer || item.mcpServer === mcpServer)
53
+ .map(item => item.fullTool);
54
+ const ranked = filterTools(q, pool, { maxTools: topK, minScore: 0.08 });
55
+ for (const tool of ranked) {
56
+ const item = catalog.find(c => c.name === tool.name);
57
+ results.push({
58
+ kind: 'tool',
59
+ name: tool.name,
60
+ brief: item?.brief ?? briefFromTool(tool),
61
+ score: 1,
62
+ });
63
+ }
64
+ }
65
+ if (wantSkills) {
66
+ if (skillRegistry && skillRegistry.size > 0) {
67
+ const skills = skillRegistry.search(q, { maxResults: topK, platform });
68
+ for (const skill of skills) {
69
+ results.push({
70
+ kind: 'skill',
71
+ name: skill.name,
72
+ brief: skill.description?.slice(0, 120) ?? '',
73
+ score: 1,
74
+ });
75
+ }
76
+ }
77
+ }
78
+ if (kind === 'all' && q) {
79
+ const toolResults = results.filter(r => r.kind === 'tool').slice(0, topK);
80
+ const skillResults = results.filter(r => r.kind === 'skill').slice(0, topK);
81
+ return [...toolResults, ...skillResults];
82
+ }
83
+ return results.slice(0, topK * (kind === 'all' ? 2 : 1));
84
+ }
85
+ export function resolveDeferredApiTools(catalog, alwaysLoaded, sessionLoadedNames) {
86
+ const byName = catalogToolByName(catalog);
87
+ const out = [];
88
+ const seen = new Set();
89
+ for (const name of alwaysLoaded) {
90
+ if (seen.has(name))
91
+ continue;
92
+ const item = byName.get(name);
93
+ if (item) {
94
+ out.push(item.fullTool);
95
+ seen.add(name);
96
+ }
97
+ }
98
+ for (const name of sessionLoadedNames) {
99
+ if (seen.has(name))
100
+ continue;
101
+ const item = byName.get(name);
102
+ if (item) {
103
+ out.push(item.fullTool);
104
+ seen.add(name);
105
+ }
106
+ }
107
+ return out;
108
+ }
109
+ export function buildDeferredStats(catalog, apiTools) {
110
+ const apiNames = new Set(apiTools.map(t => t.name));
111
+ const deferred = catalog.filter(c => !apiNames.has(c.name));
112
+ const bySource = new Map();
113
+ for (const item of deferred) {
114
+ bySource.set(item.source, (bySource.get(item.source) ?? 0) + 1);
115
+ }
116
+ const parts = [...bySource.entries()].map(([k, v]) => `${k}:${v}`);
117
+ return `deferred ${deferred.length} tools (${parts.join(', ') || 'none'}); loaded ${apiTools.length}`;
118
+ }
119
+ //# sourceMappingURL=tool-catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-catalog.js","sourceRoot":"","sources":["../../src/tool-catalog/tool-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,EAA4F,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAOhJ,SAAS,aAAa,CAAC,IAAe;IACpC,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC5C,OAAO,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,C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IAClF,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACpD,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5D,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC3C,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;QAC5B,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAClE,CAAC;IACD,MAAM,KAAK,GAAG,CAAC,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACnE,OAAO,YAAY,QAAQ,CAAC,MAAM,WAAW,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,aAAa,QAAQ,CAAC,MAAM,EAAE,CAAC;AACxG,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { AgentTool } from '@zhin.js/ai';
2
+ export type ToolCatalogSource = 'builtin' | 'plugin' | 'mcp' | 'skill' | 'meta';
3
+ export interface ToolCatalogItem {
4
+ name: string;
5
+ brief: string;
6
+ fullTool: AgentTool;
7
+ source: ToolCatalogSource;
8
+ mcpServer?: string;
9
+ deferDefault: boolean;
10
+ }
11
+ export type DiscoverKind = 'tool' | 'skill' | 'all';
12
+ export interface DiscoverResultItem {
13
+ kind: 'tool' | 'skill';
14
+ name: string;
15
+ brief: string;
16
+ score: number;
17
+ }
18
+ export interface DeferredToolsConfig {
19
+ maxLoadedPerSession?: number;
20
+ discoverTopK?: number;
21
+ alwaysLoadedTools?: string[];
22
+ mcpServers?: Record<string, {
23
+ alwaysLoaded?: string[];
24
+ }>;
25
+ }
26
+ export declare const DEFAULT_ALWAYS_LOADED_TOOLS: readonly ["ask_user", "spawn_task", "discover", "load_tool", "load_skill"];
27
+ export declare const DEFAULT_DEFERRED_TOOLS_CONFIG: Required<Pick<DeferredToolsConfig, 'maxLoadedPerSession' | 'discoverTopK' | 'alwaysLoadedTools'>>;
28
+ export declare const DEFERRED_META_TOOL_NAMES: Set<string>;
29
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tool-catalog/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;AAEhF,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAEpD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;CAC1D;AAED,eAAO,MAAM,2BAA2B,4EAM9B,CAAC;AAEX,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,IAAI,CAAC,mBAAmB,EAAE,qBAAqB,GAAG,cAAc,GAAG,mBAAmB,CAAC,CAI3I,CAAC;AAEF,eAAO,MAAM,wBAAwB,aAInC,CAAC"}