@zhin.js/agent 1.1.2 → 1.1.5

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 (1105) hide show
  1. package/README.md +52 -52
  2. package/lib/activity-feedback/adapter-integration.d.ts +8 -9
  3. package/lib/activity-feedback/adapter-integration.d.ts.map +1 -1
  4. package/lib/activity-feedback/adapter-integration.js +22 -18
  5. package/lib/activity-feedback/adapter-integration.js.map +1 -1
  6. package/lib/activity-feedback/ai-bus.d.ts.map +1 -1
  7. package/lib/activity-feedback/ai-bus.js +7 -1
  8. package/lib/activity-feedback/ai-bus.js.map +1 -1
  9. package/lib/activity-feedback/event-context.d.ts +1 -1
  10. package/lib/activity-feedback/event-context.d.ts.map +1 -1
  11. package/lib/activity-feedback/event-context.js +9 -6
  12. package/lib/activity-feedback/event-context.js.map +1 -1
  13. package/lib/activity-feedback/index.d.ts +3 -2
  14. package/lib/activity-feedback/index.d.ts.map +1 -1
  15. package/lib/activity-feedback/index.js +3 -2
  16. package/lib/activity-feedback/index.js.map +1 -1
  17. package/lib/activity-feedback/manager.d.ts +4 -1
  18. package/lib/activity-feedback/manager.d.ts.map +1 -1
  19. package/lib/activity-feedback/manager.js +10 -8
  20. package/lib/activity-feedback/manager.js.map +1 -1
  21. package/lib/activity-feedback/subagent-prefix.d.ts +17 -0
  22. package/lib/activity-feedback/subagent-prefix.d.ts.map +1 -0
  23. package/lib/activity-feedback/subagent-prefix.js +54 -0
  24. package/lib/activity-feedback/subagent-prefix.js.map +1 -0
  25. package/lib/agent-prompt/registry.js +1 -1
  26. package/lib/agent-prompt/registry.js.map +1 -1
  27. package/lib/agent-prompt/resolver.d.ts.map +1 -1
  28. package/lib/agent-prompt/resolver.js +5 -7
  29. package/lib/agent-prompt/resolver.js.map +1 -1
  30. package/lib/ai-event-bus.js +2 -2
  31. package/lib/ai-event-bus.js.map +1 -1
  32. package/lib/ai-event-subscriber.d.ts +1 -1
  33. package/lib/ai-event-subscriber.d.ts.map +1 -1
  34. package/lib/ai-event-subscriber.js +1 -1
  35. package/lib/ai-event-subscriber.js.map +1 -1
  36. package/lib/aop/index.d.ts +1 -1
  37. package/lib/aop/index.d.ts.map +1 -1
  38. package/lib/aop/index.js +1 -1
  39. package/lib/aop/index.js.map +1 -1
  40. package/lib/aop/pipeline/pipeline-service.d.ts +2 -0
  41. package/lib/aop/pipeline/pipeline-service.d.ts.map +1 -1
  42. package/lib/aop/pipeline/pipeline-service.js +26 -14
  43. package/lib/aop/pipeline/pipeline-service.js.map +1 -1
  44. package/lib/assistant/bootstrap-assistant-home.d.ts +31 -0
  45. package/lib/assistant/bootstrap-assistant-home.d.ts.map +1 -0
  46. package/lib/assistant/bootstrap-assistant-home.js +97 -0
  47. package/lib/assistant/bootstrap-assistant-home.js.map +1 -0
  48. package/lib/assistant/deliver-schedule-to-adapter.d.ts +3 -3
  49. package/lib/assistant/deliver-schedule-to-adapter.d.ts.map +1 -1
  50. package/lib/assistant/deliver-schedule-to-adapter.js +2 -6
  51. package/lib/assistant/deliver-schedule-to-adapter.js.map +1 -1
  52. package/lib/assistant/domains/{home-assistant.d.ts → ha-home-backend.d.ts} +16 -13
  53. package/lib/assistant/domains/ha-home-backend.d.ts.map +1 -0
  54. package/lib/assistant/domains/{home-assistant.js → ha-home-backend.js} +32 -7
  55. package/lib/assistant/domains/ha-home-backend.js.map +1 -0
  56. package/lib/assistant/domains/ha-ws-transport.d.ts +59 -0
  57. package/lib/assistant/domains/ha-ws-transport.d.ts.map +1 -0
  58. package/lib/assistant/domains/ha-ws-transport.js +135 -0
  59. package/lib/assistant/domains/ha-ws-transport.js.map +1 -0
  60. package/lib/assistant/domains/home-entity.d.ts +5 -0
  61. package/lib/assistant/domains/home-entity.d.ts.map +1 -0
  62. package/lib/assistant/domains/home-entity.js +8 -0
  63. package/lib/assistant/domains/home-entity.js.map +1 -0
  64. package/lib/assistant/domains/home-state-watch.d.ts +40 -0
  65. package/lib/assistant/domains/home-state-watch.d.ts.map +1 -0
  66. package/lib/assistant/domains/home-state-watch.js +118 -0
  67. package/lib/assistant/domains/home-state-watch.js.map +1 -0
  68. package/lib/assistant/home-config.d.ts +21 -7
  69. package/lib/assistant/home-config.d.ts.map +1 -1
  70. package/lib/assistant/home-config.js +5 -0
  71. package/lib/assistant/home-config.js.map +1 -1
  72. package/lib/assistant/home-facade.d.ts +73 -0
  73. package/lib/assistant/home-facade.d.ts.map +1 -0
  74. package/lib/assistant/home-facade.js +144 -0
  75. package/lib/assistant/home-facade.js.map +1 -0
  76. package/lib/assistant/home-policy.d.ts +3 -2
  77. package/lib/assistant/home-policy.d.ts.map +1 -1
  78. package/lib/assistant/home-policy.js +8 -36
  79. package/lib/assistant/home-policy.js.map +1 -1
  80. package/lib/assistant/home-tools.d.ts +9 -12
  81. package/lib/assistant/home-tools.d.ts.map +1 -1
  82. package/lib/assistant/home-tools.js +94 -135
  83. package/lib/assistant/home-tools.js.map +1 -1
  84. package/lib/assistant/index.d.ts +18 -11
  85. package/lib/assistant/index.d.ts.map +1 -1
  86. package/lib/assistant/index.js +10 -7
  87. package/lib/assistant/index.js.map +1 -1
  88. package/lib/assistant/job-creator.d.ts +3 -3
  89. package/lib/assistant/job-creator.d.ts.map +1 -1
  90. package/lib/assistant/job-creator.js +6 -11
  91. package/lib/assistant/job-creator.js.map +1 -1
  92. package/lib/assistant/job-engine.d.ts +1 -1
  93. package/lib/assistant/job-engine.d.ts.map +1 -1
  94. package/lib/assistant/job-engine.js +11 -22
  95. package/lib/assistant/job-engine.js.map +1 -1
  96. package/lib/assistant/job-scheduler.d.ts +0 -3
  97. package/lib/assistant/job-scheduler.d.ts.map +1 -1
  98. package/lib/assistant/job-scheduler.js +5 -3
  99. package/lib/assistant/job-scheduler.js.map +1 -1
  100. package/lib/assistant/job-store.d.ts.map +1 -1
  101. package/lib/assistant/job-store.js +31 -3
  102. package/lib/assistant/job-store.js.map +1 -1
  103. package/lib/assistant/job-worker.d.ts +2 -9
  104. package/lib/assistant/job-worker.d.ts.map +1 -1
  105. package/lib/assistant/job-worker.js +42 -36
  106. package/lib/assistant/job-worker.js.map +1 -1
  107. package/lib/assistant/notification-router.d.ts +2 -1
  108. package/lib/assistant/notification-router.d.ts.map +1 -1
  109. package/lib/assistant/notification-router.js +18 -9
  110. package/lib/assistant/notification-router.js.map +1 -1
  111. package/lib/assistant/runtime-registry.d.ts +4 -3
  112. package/lib/assistant/runtime-registry.d.ts.map +1 -1
  113. package/lib/assistant/runtime-registry.js +7 -16
  114. package/lib/assistant/runtime-registry.js.map +1 -1
  115. package/lib/assistant/schedule-execution.d.ts +0 -17
  116. package/lib/assistant/schedule-execution.d.ts.map +1 -1
  117. package/lib/assistant/schedule-execution.js +0 -41
  118. package/lib/assistant/schedule-execution.js.map +1 -1
  119. package/lib/assistant/schedule-job-service.d.ts +4 -2
  120. package/lib/assistant/schedule-job-service.d.ts.map +1 -1
  121. package/lib/assistant/schedule-job-service.js +38 -8
  122. package/lib/assistant/schedule-job-service.js.map +1 -1
  123. package/lib/assistant/types.d.ts +3 -0
  124. package/lib/assistant/types.d.ts.map +1 -1
  125. package/lib/assistant/types.js.map +1 -1
  126. package/lib/authoring/entries/tools.d.ts +1 -1
  127. package/lib/authoring/entries/tools.d.ts.map +1 -1
  128. package/lib/authoring/entries/tools.js +1 -1
  129. package/lib/authoring/entries/tools.js.map +1 -1
  130. package/lib/authoring/index.d.ts +1 -1
  131. package/lib/authoring/index.d.ts.map +1 -1
  132. package/lib/authoring/index.js +1 -1
  133. package/lib/authoring/index.js.map +1 -1
  134. package/lib/authoring/tool-policy.d.ts +1 -1
  135. package/lib/authoring/tool-policy.d.ts.map +1 -1
  136. package/lib/authoring/tool-policy.js +1 -1
  137. package/lib/authoring/tool-policy.js.map +1 -1
  138. package/lib/bootstrap.d.ts +14 -3
  139. package/lib/bootstrap.d.ts.map +1 -1
  140. package/lib/bootstrap.js +66 -12
  141. package/lib/bootstrap.js.map +1 -1
  142. package/lib/builtin/analyze-media-tool.d.ts.map +1 -1
  143. package/lib/builtin/analyze-media-tool.js +0 -12
  144. package/lib/builtin/analyze-media-tool.js.map +1 -1
  145. package/lib/builtin/bash-tool.d.ts.map +1 -1
  146. package/lib/builtin/bash-tool.js +0 -6
  147. package/lib/builtin/bash-tool.js.map +1 -1
  148. package/lib/builtin/bing-search-html.d.ts +1 -17
  149. package/lib/builtin/bing-search-html.d.ts.map +1 -1
  150. package/lib/builtin/bing-search-html.js +12 -10
  151. package/lib/builtin/bing-search-html.js.map +1 -1
  152. package/lib/builtin/edit-file-tool.d.ts.map +1 -1
  153. package/lib/builtin/edit-file-tool.js +0 -7
  154. package/lib/builtin/edit-file-tool.js.map +1 -1
  155. package/lib/builtin/glob-tool.d.ts.map +1 -1
  156. package/lib/builtin/glob-tool.js +0 -5
  157. package/lib/builtin/glob-tool.js.map +1 -1
  158. package/lib/builtin/grep-tool.d.ts.map +1 -1
  159. package/lib/builtin/grep-tool.js +0 -5
  160. package/lib/builtin/grep-tool.js.map +1 -1
  161. package/lib/builtin/list-dir-tool.d.ts.map +1 -1
  162. package/lib/builtin/list-dir-tool.js +0 -5
  163. package/lib/builtin/list-dir-tool.js.map +1 -1
  164. package/lib/builtin/memory-search-tool.js +1 -1
  165. package/lib/builtin/memory-search-tool.js.map +1 -1
  166. package/lib/builtin/memory-upsert-tool.js +1 -1
  167. package/lib/builtin/memory-upsert-tool.js.map +1 -1
  168. package/lib/builtin/read-file-tool.d.ts.map +1 -1
  169. package/lib/builtin/read-file-tool.js +0 -13
  170. package/lib/builtin/read-file-tool.js.map +1 -1
  171. package/lib/builtin/spawn-task-tool.d.ts.map +1 -1
  172. package/lib/builtin/spawn-task-tool.js +8 -10
  173. package/lib/builtin/spawn-task-tool.js.map +1 -1
  174. package/lib/builtin/web-fetch-tool.d.ts.map +1 -1
  175. package/lib/builtin/web-fetch-tool.js +9 -28
  176. package/lib/builtin/web-fetch-tool.js.map +1 -1
  177. package/lib/builtin/web-search-tool.d.ts.map +1 -1
  178. package/lib/builtin/web-search-tool.js +10 -0
  179. package/lib/builtin/web-search-tool.js.map +1 -1
  180. package/lib/builtin/write-file-tool.d.ts.map +1 -1
  181. package/lib/builtin/write-file-tool.js +0 -7
  182. package/lib/builtin/write-file-tool.js.map +1 -1
  183. package/lib/builtin-tools.d.ts +3 -14
  184. package/lib/builtin-tools.d.ts.map +1 -1
  185. package/lib/builtin-tools.js +3 -14
  186. package/lib/builtin-tools.js.map +1 -1
  187. package/lib/collaboration/collab-admin-gate.d.ts +1 -1
  188. package/lib/collaboration/collab-admin-gate.d.ts.map +1 -1
  189. package/lib/collaboration/collab-admin-gate.js +8 -8
  190. package/lib/collaboration/collab-admin-gate.js.map +1 -1
  191. package/lib/collaboration/collab-utils.d.ts +15 -0
  192. package/lib/collaboration/collab-utils.d.ts.map +1 -0
  193. package/lib/collaboration/collab-utils.js +37 -0
  194. package/lib/collaboration/collab-utils.js.map +1 -0
  195. package/lib/collaboration/collaboration-artifact-repository.d.ts +2 -0
  196. package/lib/collaboration/collaboration-artifact-repository.d.ts.map +1 -1
  197. package/lib/collaboration/collaboration-artifact-repository.js +17 -5
  198. package/lib/collaboration/collaboration-artifact-repository.js.map +1 -1
  199. package/lib/collaboration/collaboration-commands.d.ts +3 -3
  200. package/lib/collaboration/collaboration-commands.d.ts.map +1 -1
  201. package/lib/collaboration/collaboration-commands.js +25 -156
  202. package/lib/collaboration/collaboration-commands.js.map +1 -1
  203. package/lib/collaboration/collaboration-config.d.ts +5 -5
  204. package/lib/collaboration/collaboration-config.d.ts.map +1 -1
  205. package/lib/collaboration/collaboration-config.js +19 -19
  206. package/lib/collaboration/collaboration-config.js.map +1 -1
  207. package/lib/collaboration/collaboration-context.d.ts +5 -2
  208. package/lib/collaboration/collaboration-context.d.ts.map +1 -1
  209. package/lib/collaboration/collaboration-context.js +39 -27
  210. package/lib/collaboration/collaboration-context.js.map +1 -1
  211. package/lib/collaboration/collaboration-db-model.d.ts +2 -2
  212. package/lib/collaboration/collaboration-db-model.d.ts.map +1 -1
  213. package/lib/collaboration/collaboration-db-model.js +2 -2
  214. package/lib/collaboration/collaboration-db-model.js.map +1 -1
  215. package/lib/collaboration/collaboration-delegation.d.ts +2 -2
  216. package/lib/collaboration/collaboration-delegation.d.ts.map +1 -1
  217. package/lib/collaboration/collaboration-delegation.js +4 -6
  218. package/lib/collaboration/collaboration-delegation.js.map +1 -1
  219. package/lib/collaboration/collaboration-dispatch.d.ts +4 -4
  220. package/lib/collaboration/collaboration-dispatch.d.ts.map +1 -1
  221. package/lib/collaboration/collaboration-dispatch.js +12 -12
  222. package/lib/collaboration/collaboration-dispatch.js.map +1 -1
  223. package/lib/collaboration/collaboration-kernel-bridge.d.ts +3 -3
  224. package/lib/collaboration/collaboration-kernel-bridge.d.ts.map +1 -1
  225. package/lib/collaboration/collaboration-kernel-bridge.js +15 -16
  226. package/lib/collaboration/collaboration-kernel-bridge.js.map +1 -1
  227. package/lib/collaboration/collaboration-outbound.d.ts +7 -7
  228. package/lib/collaboration/collaboration-outbound.d.ts.map +1 -1
  229. package/lib/collaboration/collaboration-outbound.js +38 -41
  230. package/lib/collaboration/collaboration-outbound.js.map +1 -1
  231. package/lib/collaboration/collaboration-scene-repository.d.ts +17 -15
  232. package/lib/collaboration/collaboration-scene-repository.d.ts.map +1 -1
  233. package/lib/collaboration/collaboration-scene-repository.js +43 -32
  234. package/lib/collaboration/collaboration-scene-repository.js.map +1 -1
  235. package/lib/collaboration/collaboration-turn-snapshot.d.ts +3 -3
  236. package/lib/collaboration/collaboration-turn-snapshot.d.ts.map +1 -1
  237. package/lib/collaboration/collaboration-turn-snapshot.js +6 -6
  238. package/lib/collaboration/collaboration-turn-snapshot.js.map +1 -1
  239. package/lib/collaboration/delegation-state.d.ts +6 -6
  240. package/lib/collaboration/delegation-state.d.ts.map +1 -1
  241. package/lib/collaboration/delegation-state.js +17 -17
  242. package/lib/collaboration/delegation-state.js.map +1 -1
  243. package/lib/collaboration/endpoint-identity.d.ts +4 -4
  244. package/lib/collaboration/endpoint-identity.d.ts.map +1 -1
  245. package/lib/collaboration/endpoint-identity.js +17 -25
  246. package/lib/collaboration/endpoint-identity.js.map +1 -1
  247. package/lib/collaboration/group-message.d.ts +5 -5
  248. package/lib/collaboration/group-message.d.ts.map +1 -1
  249. package/lib/collaboration/group-message.js +10 -71
  250. package/lib/collaboration/group-message.js.map +1 -1
  251. package/lib/collaboration/im-mention-delegate.d.ts +1 -1
  252. package/lib/collaboration/im-mention-delegate.d.ts.map +1 -1
  253. package/lib/collaboration/im-mention-delegate.js +2 -2
  254. package/lib/collaboration/im-mention-delegate.js.map +1 -1
  255. package/lib/collaboration/inbound-peer-handback.d.ts +1 -1
  256. package/lib/collaboration/inbound-peer-handback.d.ts.map +1 -1
  257. package/lib/collaboration/inbound-peer-handback.js +13 -17
  258. package/lib/collaboration/inbound-peer-handback.js.map +1 -1
  259. package/lib/collaboration/inbound-spawn-task.d.ts.map +1 -1
  260. package/lib/collaboration/inbound-spawn-task.js +7 -8
  261. package/lib/collaboration/inbound-spawn-task.js.map +1 -1
  262. package/lib/collaboration/inbound-turn-tools.d.ts +1 -1
  263. package/lib/collaboration/inbound-turn-tools.d.ts.map +1 -1
  264. package/lib/collaboration/inbound-turn-tools.js +8 -3
  265. package/lib/collaboration/inbound-turn-tools.js.map +1 -1
  266. package/lib/collaboration/index.d.ts +1 -5
  267. package/lib/collaboration/index.d.ts.map +1 -1
  268. package/lib/collaboration/index.js +1 -4
  269. package/lib/collaboration/index.js.map +1 -1
  270. package/lib/collaboration/init-observe-hook.d.ts +8 -11
  271. package/lib/collaboration/init-observe-hook.d.ts.map +1 -1
  272. package/lib/collaboration/init-observe-hook.js +18 -40
  273. package/lib/collaboration/init-observe-hook.js.map +1 -1
  274. package/lib/collaboration/init-wizard-service.d.ts +2 -2
  275. package/lib/collaboration/init-wizard-service.d.ts.map +1 -1
  276. package/lib/collaboration/init-wizard-service.js +9 -11
  277. package/lib/collaboration/init-wizard-service.js.map +1 -1
  278. package/lib/collaboration/outbound-resolver.d.ts +3 -3
  279. package/lib/collaboration/outbound-resolver.d.ts.map +1 -1
  280. package/lib/collaboration/outbound-resolver.js +18 -18
  281. package/lib/collaboration/outbound-resolver.js.map +1 -1
  282. package/lib/collaboration/peer-policy.d.ts +7 -7
  283. package/lib/collaboration/peer-policy.d.ts.map +1 -1
  284. package/lib/collaboration/peer-policy.js +19 -19
  285. package/lib/collaboration/peer-policy.js.map +1 -1
  286. package/lib/collaboration/resolve-agent-session-key.js +2 -2
  287. package/lib/collaboration/resolve-agent-session-key.js.map +1 -1
  288. package/lib/collaboration/runtime-inbound-gate.d.ts.map +1 -1
  289. package/lib/collaboration/runtime-inbound-gate.js +26 -32
  290. package/lib/collaboration/runtime-inbound-gate.js.map +1 -1
  291. package/lib/collaboration/scene-identity-service.d.ts +13 -11
  292. package/lib/collaboration/scene-identity-service.d.ts.map +1 -1
  293. package/lib/collaboration/scene-identity-service.js +33 -22
  294. package/lib/collaboration/scene-identity-service.js.map +1 -1
  295. package/lib/collaboration/scene-service.d.ts +5 -3
  296. package/lib/collaboration/scene-service.d.ts.map +1 -1
  297. package/lib/collaboration/scene-service.js +17 -12
  298. package/lib/collaboration/scene-service.js.map +1 -1
  299. package/lib/collaboration/structured-ai-outbound.d.ts +1 -1
  300. package/lib/collaboration/structured-ai-outbound.d.ts.map +1 -1
  301. package/lib/collaboration/structured-ai-outbound.js +8 -9
  302. package/lib/collaboration/structured-ai-outbound.js.map +1 -1
  303. package/lib/collaboration/turn-plan-resolver.d.ts +2 -2
  304. package/lib/collaboration/turn-plan-resolver.d.ts.map +1 -1
  305. package/lib/collaboration/turn-plan-resolver.js +12 -12
  306. package/lib/collaboration/turn-plan-resolver.js.map +1 -1
  307. package/lib/collaboration/types.d.ts +6 -6
  308. package/lib/collaboration/types.d.ts.map +1 -1
  309. package/lib/collaboration/wire-collaboration-storage.d.ts.map +1 -1
  310. package/lib/collaboration/wire-collaboration-storage.js +0 -2
  311. package/lib/collaboration/wire-collaboration-storage.js.map +1 -1
  312. package/lib/common-adapter-tools.js +1 -1
  313. package/lib/common-adapter-tools.js.map +1 -1
  314. package/lib/config/agent-interfaces.d.ts +1 -2
  315. package/lib/config/agent-interfaces.d.ts.map +1 -1
  316. package/lib/config/fix-ai-config.d.ts.map +1 -1
  317. package/lib/config/fix-ai-config.js +52 -3
  318. package/lib/config/fix-ai-config.js.map +1 -1
  319. package/lib/config/index.d.ts +1 -1
  320. package/lib/config/index.d.ts.map +1 -1
  321. package/lib/config/index.js.map +1 -1
  322. package/lib/config/normalize-ai-config.d.ts +4 -2
  323. package/lib/config/normalize-ai-config.d.ts.map +1 -1
  324. package/lib/config/normalize-ai-config.js +29 -81
  325. package/lib/config/normalize-ai-config.js.map +1 -1
  326. package/lib/config/validate-ai-config.d.ts.map +1 -1
  327. package/lib/config/validate-ai-config.js +10 -0
  328. package/lib/config/validate-ai-config.js.map +1 -1
  329. package/lib/config/zhin-agent-config.d.ts +20 -0
  330. package/lib/config/zhin-agent-config.d.ts.map +1 -1
  331. package/lib/config/zhin-agent-defaults.d.ts.map +1 -1
  332. package/lib/config/zhin-agent-defaults.js +14 -0
  333. package/lib/config/zhin-agent-defaults.js.map +1 -1
  334. package/lib/config/zhin-agent-dependencies.d.ts +1 -0
  335. package/lib/config/zhin-agent-dependencies.d.ts.map +1 -1
  336. package/lib/context/context-system.d.ts +4 -2
  337. package/lib/context/context-system.d.ts.map +1 -1
  338. package/lib/context/context-system.js +15 -12
  339. package/lib/context/context-system.js.map +1 -1
  340. package/lib/context/contracts.d.ts +3 -3
  341. package/lib/context/contracts.d.ts.map +1 -1
  342. package/lib/context/default-builders.js +3 -3
  343. package/lib/context/default-builders.js.map +1 -1
  344. package/lib/context/im-turn-context-adapter.d.ts +9 -0
  345. package/lib/context/im-turn-context-adapter.d.ts.map +1 -0
  346. package/lib/context/im-turn-context-adapter.js +54 -0
  347. package/lib/context/im-turn-context-adapter.js.map +1 -0
  348. package/lib/context/index.d.ts +2 -2
  349. package/lib/context/index.d.ts.map +1 -1
  350. package/lib/context/index.js +1 -1
  351. package/lib/context/index.js.map +1 -1
  352. package/lib/context/turn-envelope.d.ts +5 -4
  353. package/lib/context/turn-envelope.d.ts.map +1 -1
  354. package/lib/context/turn-envelope.js +43 -50
  355. package/lib/context/turn-envelope.js.map +1 -1
  356. package/lib/core/agent-core-run.d.ts +37 -14
  357. package/lib/core/agent-core-run.d.ts.map +1 -1
  358. package/lib/core/agent-core-run.js +79 -182
  359. package/lib/core/agent-core-run.js.map +1 -1
  360. package/lib/core/agent-loop-standalone.d.ts.map +1 -1
  361. package/lib/core/agent-loop-standalone.js +35 -34
  362. package/lib/core/agent-loop-standalone.js.map +1 -1
  363. package/lib/core/agent-run-shared.d.ts +4 -0
  364. package/lib/core/agent-run-shared.d.ts.map +1 -0
  365. package/lib/core/agent-run-shared.js +8 -0
  366. package/lib/core/agent-run-shared.js.map +1 -0
  367. package/lib/core/compose-deps.d.ts.map +1 -1
  368. package/lib/core/compose-deps.js +1 -2
  369. package/lib/core/compose-deps.js.map +1 -1
  370. package/lib/core/spawn-delegation.d.ts +23 -0
  371. package/lib/core/spawn-delegation.d.ts.map +1 -0
  372. package/lib/core/spawn-delegation.js +64 -0
  373. package/lib/core/spawn-delegation.js.map +1 -0
  374. package/lib/core/tool-execution-authority.d.ts +21 -0
  375. package/lib/core/tool-execution-authority.d.ts.map +1 -0
  376. package/lib/core/tool-execution-authority.js +2 -0
  377. package/lib/core/tool-execution-authority.js.map +1 -0
  378. package/lib/core/turn-event-mapper.d.ts.map +1 -1
  379. package/lib/core/turn-event-mapper.js +13 -0
  380. package/lib/core/turn-event-mapper.js.map +1 -1
  381. package/lib/deferred-worker-runner.d.ts.map +1 -1
  382. package/lib/deferred-worker-runner.js +9 -23
  383. package/lib/deferred-worker-runner.js.map +1 -1
  384. package/lib/discovery/agent-surface-info.d.ts.map +1 -1
  385. package/lib/discovery/agent-surface-info.js +7 -2
  386. package/lib/discovery/agent-surface-info.js.map +1 -1
  387. package/lib/discovery/skills.js +3 -3
  388. package/lib/discovery/skills.js.map +1 -1
  389. package/lib/discovery/tools.js +2 -2
  390. package/lib/discovery/tools.js.map +1 -1
  391. package/lib/event/event-emitter.d.ts.map +1 -1
  392. package/lib/event/event-emitter.js +2 -13
  393. package/lib/event/event-emitter.js.map +1 -1
  394. package/lib/event/session-events.d.ts +3 -2
  395. package/lib/event/session-events.d.ts.map +1 -1
  396. package/lib/event/session-events.js.map +1 -1
  397. package/lib/event/turn-event.d.ts +35 -2
  398. package/lib/event/turn-event.d.ts.map +1 -1
  399. package/lib/event/turn-event.js +4 -1
  400. package/lib/event/turn-event.js.map +1 -1
  401. package/lib/event/turn-to-agent-stream.js +20 -0
  402. package/lib/event/turn-to-agent-stream.js.map +1 -1
  403. package/lib/hooks.d.ts +1 -1
  404. package/lib/hooks.d.ts.map +1 -1
  405. package/lib/index.d.ts +34 -27
  406. package/lib/index.d.ts.map +1 -1
  407. package/lib/index.js +26 -21
  408. package/lib/index.js.map +1 -1
  409. package/lib/ingress/capability-ingress.d.ts +3 -1
  410. package/lib/ingress/capability-ingress.d.ts.map +1 -1
  411. package/lib/ingress/capability-ingress.js +10 -6
  412. package/lib/ingress/capability-ingress.js.map +1 -1
  413. package/lib/init/configure-zhin-agent.d.ts +7 -34
  414. package/lib/init/configure-zhin-agent.d.ts.map +1 -1
  415. package/lib/init/configure-zhin-agent.js +5 -1
  416. package/lib/init/configure-zhin-agent.js.map +1 -1
  417. package/lib/init/create-zhin-agent.d.ts.map +1 -1
  418. package/lib/init/create-zhin-agent.js +64 -78
  419. package/lib/init/create-zhin-agent.js.map +1 -1
  420. package/lib/init/dispose-zhin-agent.d.ts +6 -22
  421. package/lib/init/dispose-zhin-agent.d.ts.map +1 -1
  422. package/lib/init/dispose-zhin-agent.js +1 -2
  423. package/lib/init/dispose-zhin-agent.js.map +1 -1
  424. package/lib/init/introspection-collectors.js +2 -2
  425. package/lib/init/introspection-collectors.js.map +1 -1
  426. package/lib/init/register-ai-service.d.ts.map +1 -1
  427. package/lib/init/register-ai-service.js +3 -4
  428. package/lib/init/register-ai-service.js.map +1 -1
  429. package/lib/init/register-builtin-tools.d.ts.map +1 -1
  430. package/lib/init/register-builtin-tools.js +20 -31
  431. package/lib/init/register-builtin-tools.js.map +1 -1
  432. package/lib/init/register-db-upgrade.d.ts.map +1 -1
  433. package/lib/init/register-db-upgrade.js +5 -9
  434. package/lib/init/register-db-upgrade.js.map +1 -1
  435. package/lib/init/register-group-session-passive.d.ts.map +1 -1
  436. package/lib/init/register-group-session-passive.js +15 -10
  437. package/lib/init/register-group-session-passive.js.map +1 -1
  438. package/lib/init/register-init-wizard-guardrail.d.ts.map +1 -1
  439. package/lib/init/register-init-wizard-guardrail.js +6 -11
  440. package/lib/init/register-init-wizard-guardrail.js.map +1 -1
  441. package/lib/init/register-introspection-commands.d.ts.map +1 -1
  442. package/lib/init/register-introspection-commands.js +20 -1
  443. package/lib/init/register-introspection-commands.js.map +1 -1
  444. package/lib/init/register-mcp-from-config.js +4 -4
  445. package/lib/init/register-mcp-from-config.js.map +1 -1
  446. package/lib/init/upgrade-endpoint-id-schema.d.ts +2 -2
  447. package/lib/init/upgrade-endpoint-id-schema.d.ts.map +1 -1
  448. package/lib/init/upgrade-endpoint-id-schema.js +3 -3
  449. package/lib/init/upgrade-endpoint-id-schema.js.map +1 -1
  450. package/lib/init.d.ts +4 -22
  451. package/lib/init.d.ts.map +1 -1
  452. package/lib/init.js +6 -57
  453. package/lib/init.js.map +1 -1
  454. package/lib/interaction/index.d.ts +2 -0
  455. package/lib/interaction/index.d.ts.map +1 -0
  456. package/lib/interaction/index.js +2 -0
  457. package/lib/interaction/index.js.map +1 -0
  458. package/lib/interaction/interaction-router.d.ts +20 -0
  459. package/lib/interaction/interaction-router.d.ts.map +1 -0
  460. package/lib/interaction/interaction-router.js +146 -0
  461. package/lib/interaction/interaction-router.js.map +1 -0
  462. package/lib/internal/agent-host.d.ts +59 -67
  463. package/lib/internal/agent-host.d.ts.map +1 -1
  464. package/lib/internal/ai-service-refs.d.ts +8 -0
  465. package/lib/internal/ai-service-refs.d.ts.map +1 -0
  466. package/lib/internal/ai-service-refs.js +7 -0
  467. package/lib/internal/ai-service-refs.js.map +1 -0
  468. package/lib/internal/as-private.d.ts +3 -6
  469. package/lib/internal/as-private.d.ts.map +1 -1
  470. package/lib/internal/as-private.js.map +1 -1
  471. package/lib/internal/host-types.d.ts +26 -3
  472. package/lib/internal/host-types.d.ts.map +1 -1
  473. package/lib/internal/prompt-trace.d.ts.map +1 -1
  474. package/lib/internal/prompt-trace.js +4 -15
  475. package/lib/internal/prompt-trace.js.map +1 -1
  476. package/lib/internal/turn-context.d.ts +1 -6
  477. package/lib/internal/turn-context.d.ts.map +1 -1
  478. package/lib/internal/turn-context.js +0 -9
  479. package/lib/internal/turn-context.js.map +1 -1
  480. package/lib/journal/file-journal-store.d.ts +21 -0
  481. package/lib/journal/file-journal-store.d.ts.map +1 -0
  482. package/lib/journal/file-journal-store.js +200 -0
  483. package/lib/journal/file-journal-store.js.map +1 -0
  484. package/lib/journal/index.d.ts +3 -0
  485. package/lib/journal/index.d.ts.map +1 -0
  486. package/lib/journal/index.js +3 -0
  487. package/lib/journal/index.js.map +1 -0
  488. package/lib/journal/persistent-turn-journal.d.ts +13 -0
  489. package/lib/journal/persistent-turn-journal.d.ts.map +1 -0
  490. package/lib/journal/persistent-turn-journal.js +72 -0
  491. package/lib/journal/persistent-turn-journal.js.map +1 -0
  492. package/lib/media/index.d.ts +0 -1
  493. package/lib/media/index.d.ts.map +1 -1
  494. package/lib/media/index.js +0 -1
  495. package/lib/media/index.js.map +1 -1
  496. package/lib/media/media-capabilities.d.ts.map +1 -1
  497. package/lib/media/media-capabilities.js +0 -6
  498. package/lib/media/media-capabilities.js.map +1 -1
  499. package/lib/media/media-normalize.d.ts +1 -7
  500. package/lib/media/media-normalize.d.ts.map +1 -1
  501. package/lib/media/media-normalize.js +0 -47
  502. package/lib/media/media-normalize.js.map +1 -1
  503. package/lib/media/media-router.d.ts +1 -2
  504. package/lib/media/media-router.d.ts.map +1 -1
  505. package/lib/media/media-router.js +2 -10
  506. package/lib/media/media-router.js.map +1 -1
  507. package/lib/media/resolve-config.d.ts.map +1 -1
  508. package/lib/media/resolve-config.js +1 -28
  509. package/lib/media/resolve-config.js.map +1 -1
  510. package/lib/media/subagent-inbound.d.ts +2 -2
  511. package/lib/media/subagent-inbound.d.ts.map +1 -1
  512. package/lib/media/subagent-inbound.js +2 -7
  513. package/lib/media/subagent-inbound.js.map +1 -1
  514. package/lib/media/vision-capability.d.ts +1 -3
  515. package/lib/media/vision-capability.d.ts.map +1 -1
  516. package/lib/media/vision-capability.js +0 -15
  517. package/lib/media/vision-capability.js.map +1 -1
  518. package/lib/memory/compaction-runtime.d.ts +3 -4
  519. package/lib/memory/compaction-runtime.d.ts.map +1 -1
  520. package/lib/memory/compaction-runtime.js +0 -10
  521. package/lib/memory/compaction-runtime.js.map +1 -1
  522. package/lib/memory/memory-system.d.ts.map +1 -1
  523. package/lib/memory/memory-system.js +1 -2
  524. package/lib/memory/memory-system.js.map +1 -1
  525. package/lib/memory-entry-registry.d.ts +6 -0
  526. package/lib/memory-entry-registry.d.ts.map +1 -1
  527. package/lib/memory-entry-registry.js +19 -3
  528. package/lib/memory-entry-registry.js.map +1 -1
  529. package/lib/memory-layers.d.ts +2 -2
  530. package/lib/memory-layers.d.ts.map +1 -1
  531. package/lib/memory-layers.js +11 -22
  532. package/lib/memory-layers.js.map +1 -1
  533. package/lib/orchestration-runtime-registry.d.ts +3 -1
  534. package/lib/orchestration-runtime-registry.d.ts.map +1 -1
  535. package/lib/orchestration-runtime-registry.js +9 -4
  536. package/lib/orchestration-runtime-registry.js.map +1 -1
  537. package/lib/orchestrator/agent-dispatcher.d.ts +3 -38
  538. package/lib/orchestrator/agent-dispatcher.d.ts.map +1 -1
  539. package/lib/orchestrator/agent-dispatcher.js +2 -155
  540. package/lib/orchestrator/agent-dispatcher.js.map +1 -1
  541. package/lib/orchestrator/bootstrap-executors.d.ts +5 -1
  542. package/lib/orchestrator/bootstrap-executors.d.ts.map +1 -1
  543. package/lib/orchestrator/bootstrap-executors.js +65 -36
  544. package/lib/orchestrator/bootstrap-executors.js.map +1 -1
  545. package/lib/orchestrator/index.d.ts +1 -1
  546. package/lib/orchestrator/index.d.ts.map +1 -1
  547. package/lib/orchestrator/index.js +1 -1
  548. package/lib/orchestrator/index.js.map +1 -1
  549. package/lib/orchestrator/orchestration-mappers.js +8 -8
  550. package/lib/orchestrator/orchestration-mappers.js.map +1 -1
  551. package/lib/orchestrator/orchestration-service.d.ts +18 -9
  552. package/lib/orchestrator/orchestration-service.d.ts.map +1 -1
  553. package/lib/orchestrator/orchestration-service.js +50 -47
  554. package/lib/orchestrator/orchestration-service.js.map +1 -1
  555. package/lib/orchestrator/remote-agent-registry.d.ts +3 -3
  556. package/lib/orchestrator/remote-agent-registry.d.ts.map +1 -1
  557. package/lib/orchestrator/remote-agent-registry.js +9 -13
  558. package/lib/orchestrator/remote-agent-registry.js.map +1 -1
  559. package/lib/orchestrator/remote-task-executor.d.ts.map +1 -1
  560. package/lib/orchestrator/remote-task-executor.js +12 -4
  561. package/lib/orchestrator/remote-task-executor.js.map +1 -1
  562. package/lib/orchestrator/remote-task-poller.d.ts +3 -2
  563. package/lib/orchestrator/remote-task-poller.d.ts.map +1 -1
  564. package/lib/orchestrator/remote-task-poller.js +18 -15
  565. package/lib/orchestrator/remote-task-poller.js.map +1 -1
  566. package/lib/orchestrator/role-configs.d.ts +30 -0
  567. package/lib/orchestrator/role-configs.d.ts.map +1 -0
  568. package/lib/orchestrator/role-configs.js +133 -0
  569. package/lib/orchestrator/role-configs.js.map +1 -0
  570. package/lib/orchestrator/task-queue.d.ts +3 -2
  571. package/lib/orchestrator/task-queue.d.ts.map +1 -1
  572. package/lib/orchestrator/task-queue.js +12 -11
  573. package/lib/orchestrator/task-queue.js.map +1 -1
  574. package/lib/orchestrator/tool-selection.d.ts +4 -3
  575. package/lib/orchestrator/tool-selection.d.ts.map +1 -1
  576. package/lib/orchestrator/tool-selection.js +17 -14
  577. package/lib/orchestrator/tool-selection.js.map +1 -1
  578. package/lib/orchestrator/types.d.ts +3 -2
  579. package/lib/orchestrator/types.d.ts.map +1 -1
  580. package/lib/outbound/send-proactive.js +1 -1
  581. package/lib/outbound/send-proactive.js.map +1 -1
  582. package/lib/plugin-ai-hook-bus.d.ts +3 -6
  583. package/lib/plugin-ai-hook-bus.d.ts.map +1 -1
  584. package/lib/plugin-ai-hook-bus.js +2 -20
  585. package/lib/plugin-ai-hook-bus.js.map +1 -1
  586. package/lib/plugin-runtime/agent-host-port.d.ts +25 -0
  587. package/lib/plugin-runtime/agent-host-port.d.ts.map +1 -1
  588. package/lib/plugin-runtime/agent-host-port.js.map +1 -1
  589. package/lib/plugin-runtime/agent-runtime.d.ts +61 -8
  590. package/lib/plugin-runtime/agent-runtime.d.ts.map +1 -1
  591. package/lib/plugin-runtime/agent-runtime.js +226 -11
  592. package/lib/plugin-runtime/agent-runtime.js.map +1 -1
  593. package/lib/plugin-runtime/capability-ingress.d.ts +4 -4
  594. package/lib/plugin-runtime/capability-ingress.d.ts.map +1 -1
  595. package/lib/plugin-runtime/capability-ingress.js +46 -20
  596. package/lib/plugin-runtime/capability-ingress.js.map +1 -1
  597. package/lib/plugin-runtime/capability-tools.d.ts +17 -0
  598. package/lib/plugin-runtime/capability-tools.d.ts.map +1 -0
  599. package/lib/plugin-runtime/capability-tools.js +55 -0
  600. package/lib/plugin-runtime/capability-tools.js.map +1 -0
  601. package/lib/plugin-runtime/deferred-capability-plan.d.ts +30 -0
  602. package/lib/plugin-runtime/deferred-capability-plan.d.ts.map +1 -0
  603. package/lib/plugin-runtime/deferred-capability-plan.js +152 -0
  604. package/lib/plugin-runtime/deferred-capability-plan.js.map +1 -0
  605. package/lib/plugin-runtime/full-agent-turn-engine.d.ts +17 -0
  606. package/lib/plugin-runtime/full-agent-turn-engine.d.ts.map +1 -0
  607. package/lib/plugin-runtime/full-agent-turn-engine.js +174 -0
  608. package/lib/plugin-runtime/full-agent-turn-engine.js.map +1 -0
  609. package/lib/plugin-runtime/host-mcp-projection.d.ts +10 -0
  610. package/lib/plugin-runtime/host-mcp-projection.d.ts.map +1 -0
  611. package/lib/plugin-runtime/host-mcp-projection.js +33 -0
  612. package/lib/plugin-runtime/host-mcp-projection.js.map +1 -0
  613. package/lib/plugin-runtime/host-tool-projection.d.ts +21 -0
  614. package/lib/plugin-runtime/host-tool-projection.d.ts.map +1 -0
  615. package/lib/plugin-runtime/host-tool-projection.js +22 -0
  616. package/lib/plugin-runtime/host-tool-projection.js.map +1 -0
  617. package/lib/plugin-runtime/index.d.ts +10 -0
  618. package/lib/plugin-runtime/index.d.ts.map +1 -1
  619. package/lib/plugin-runtime/index.js +10 -0
  620. package/lib/plugin-runtime/index.js.map +1 -1
  621. package/lib/plugin-runtime/native-file-tools.d.ts +9 -0
  622. package/lib/plugin-runtime/native-file-tools.d.ts.map +1 -0
  623. package/lib/plugin-runtime/native-file-tools.js +240 -0
  624. package/lib/plugin-runtime/native-file-tools.js.map +1 -0
  625. package/lib/plugin-runtime/native-interaction-tools.d.ts +8 -0
  626. package/lib/plugin-runtime/native-interaction-tools.d.ts.map +1 -0
  627. package/lib/plugin-runtime/native-interaction-tools.js +72 -0
  628. package/lib/plugin-runtime/native-interaction-tools.js.map +1 -0
  629. package/lib/plugin-runtime/native-todo-tools.d.ts +26 -0
  630. package/lib/plugin-runtime/native-todo-tools.d.ts.map +1 -0
  631. package/lib/plugin-runtime/native-todo-tools.js +152 -0
  632. package/lib/plugin-runtime/native-todo-tools.js.map +1 -0
  633. package/lib/plugin-runtime/native-web-tools.d.ts +10 -0
  634. package/lib/plugin-runtime/native-web-tools.d.ts.map +1 -0
  635. package/lib/plugin-runtime/native-web-tools.js +120 -0
  636. package/lib/plugin-runtime/native-web-tools.js.map +1 -0
  637. package/lib/prompt/assembly.d.ts +19 -9
  638. package/lib/prompt/assembly.d.ts.map +1 -1
  639. package/lib/prompt/assembly.js +64 -25
  640. package/lib/prompt/assembly.js.map +1 -1
  641. package/lib/prompt/git-context.d.ts +7 -0
  642. package/lib/prompt/git-context.d.ts.map +1 -0
  643. package/lib/prompt/git-context.js +75 -0
  644. package/lib/prompt/git-context.js.map +1 -0
  645. package/lib/prompt/index.d.ts +3 -2
  646. package/lib/prompt/index.d.ts.map +1 -1
  647. package/lib/prompt/index.js +2 -2
  648. package/lib/prompt/index.js.map +1 -1
  649. package/lib/prompt/model-aware-builder.d.ts +8 -0
  650. package/lib/prompt/model-aware-builder.d.ts.map +1 -0
  651. package/lib/prompt/model-aware-builder.js +61 -0
  652. package/lib/prompt/model-aware-builder.js.map +1 -0
  653. package/lib/prompt/model-prompt-strategy.d.ts +12 -0
  654. package/lib/prompt/model-prompt-strategy.d.ts.map +1 -0
  655. package/lib/prompt/model-prompt-strategy.js +171 -0
  656. package/lib/prompt/model-prompt-strategy.js.map +1 -0
  657. package/lib/prompt/rules/code-references.d.ts +2 -0
  658. package/lib/prompt/rules/code-references.d.ts.map +1 -0
  659. package/lib/prompt/rules/code-references.js +11 -0
  660. package/lib/prompt/rules/code-references.js.map +1 -0
  661. package/lib/prompt/rules/critical-rules.d.ts +2 -0
  662. package/lib/prompt/rules/critical-rules.d.ts.map +1 -0
  663. package/lib/prompt/rules/critical-rules.js +17 -0
  664. package/lib/prompt/rules/critical-rules.js.map +1 -0
  665. package/lib/prompt/rules/editing.d.ts +2 -0
  666. package/lib/prompt/rules/editing.d.ts.map +1 -0
  667. package/lib/prompt/rules/editing.js +18 -0
  668. package/lib/prompt/rules/editing.js.map +1 -0
  669. package/lib/prompt/rules/error-handling.d.ts +2 -0
  670. package/lib/prompt/rules/error-handling.d.ts.map +1 -0
  671. package/lib/prompt/rules/error-handling.js +18 -0
  672. package/lib/prompt/rules/error-handling.js.map +1 -0
  673. package/lib/prompt/rules/index.d.ts +8 -0
  674. package/lib/prompt/rules/index.d.ts.map +1 -0
  675. package/lib/prompt/rules/index.js +8 -0
  676. package/lib/prompt/rules/index.js.map +1 -0
  677. package/lib/prompt/rules/memory.d.ts +2 -0
  678. package/lib/prompt/rules/memory.d.ts.map +1 -0
  679. package/lib/prompt/rules/memory.js +13 -0
  680. package/lib/prompt/rules/memory.js.map +1 -0
  681. package/lib/prompt/rules/task-completion.d.ts +2 -0
  682. package/lib/prompt/rules/task-completion.d.ts.map +1 -0
  683. package/lib/prompt/rules/task-completion.js +11 -0
  684. package/lib/prompt/rules/task-completion.js.map +1 -0
  685. package/lib/prompt/rules/workflow-rules.d.ts +2 -0
  686. package/lib/prompt/rules/workflow-rules.d.ts.map +1 -0
  687. package/lib/prompt/rules/workflow-rules.js +27 -0
  688. package/lib/prompt/rules/workflow-rules.js.map +1 -0
  689. package/lib/prompt/system-prompt.d.ts +19 -22
  690. package/lib/prompt/system-prompt.d.ts.map +1 -1
  691. package/lib/prompt/system-prompt.js +82 -262
  692. package/lib/prompt/system-prompt.js.map +1 -1
  693. package/lib/prompt/templates.d.ts +3 -6
  694. package/lib/prompt/templates.d.ts.map +1 -1
  695. package/lib/prompt/templates.js +17 -21
  696. package/lib/prompt/templates.js.map +1 -1
  697. package/lib/prompt/turn-prompt-profile.d.ts +16 -0
  698. package/lib/prompt/turn-prompt-profile.d.ts.map +1 -0
  699. package/lib/prompt/turn-prompt-profile.js +2 -0
  700. package/lib/prompt/turn-prompt-profile.js.map +1 -0
  701. package/lib/routing/route-matcher.d.ts +2 -2
  702. package/lib/routing/route-matcher.d.ts.map +1 -1
  703. package/lib/routing/route-matcher.js +1 -1
  704. package/lib/routing/route-matcher.js.map +1 -1
  705. package/lib/routing/subagent-summarize.d.ts.map +1 -1
  706. package/lib/routing/subagent-summarize.js +1 -6
  707. package/lib/routing/subagent-summarize.js.map +1 -1
  708. package/lib/schedule-domain/audit-logger.d.ts +38 -0
  709. package/lib/schedule-domain/audit-logger.d.ts.map +1 -0
  710. package/lib/schedule-domain/audit-logger.js +27 -0
  711. package/lib/schedule-domain/audit-logger.js.map +1 -0
  712. package/lib/schedule-domain/budget-guard.d.ts +27 -0
  713. package/lib/schedule-domain/budget-guard.d.ts.map +1 -0
  714. package/lib/schedule-domain/budget-guard.js +48 -0
  715. package/lib/schedule-domain/budget-guard.js.map +1 -0
  716. package/lib/schedule-domain/execution-domain.d.ts +49 -0
  717. package/lib/schedule-domain/execution-domain.d.ts.map +1 -0
  718. package/lib/schedule-domain/execution-domain.js +125 -0
  719. package/lib/schedule-domain/execution-domain.js.map +1 -0
  720. package/lib/schedule-domain/index.d.ts +8 -0
  721. package/lib/schedule-domain/index.d.ts.map +1 -0
  722. package/lib/schedule-domain/index.js +8 -0
  723. package/lib/schedule-domain/index.js.map +1 -0
  724. package/lib/schedule-domain/output-validator.d.ts +7 -0
  725. package/lib/schedule-domain/output-validator.d.ts.map +1 -0
  726. package/lib/schedule-domain/output-validator.js +36 -0
  727. package/lib/schedule-domain/output-validator.js.map +1 -0
  728. package/lib/schedule-domain/prompt-assembler.d.ts +22 -0
  729. package/lib/schedule-domain/prompt-assembler.d.ts.map +1 -0
  730. package/lib/schedule-domain/prompt-assembler.js +75 -0
  731. package/lib/schedule-domain/prompt-assembler.js.map +1 -0
  732. package/lib/schedule-domain/security-harness.d.ts +19 -0
  733. package/lib/schedule-domain/security-harness.d.ts.map +1 -0
  734. package/lib/schedule-domain/security-harness.js +89 -0
  735. package/lib/schedule-domain/security-harness.js.map +1 -0
  736. package/lib/schedule-domain/tool-resolver.d.ts +20 -0
  737. package/lib/schedule-domain/tool-resolver.d.ts.map +1 -0
  738. package/lib/schedule-domain/tool-resolver.js +80 -0
  739. package/lib/schedule-domain/tool-resolver.js.map +1 -0
  740. package/lib/schedule-domain/turn-context.d.ts +9 -0
  741. package/lib/schedule-domain/turn-context.d.ts.map +1 -0
  742. package/lib/schedule-domain/turn-context.js +36 -0
  743. package/lib/schedule-domain/turn-context.js.map +1 -0
  744. package/lib/schedule-manager.d.ts +12 -13
  745. package/lib/schedule-manager.d.ts.map +1 -1
  746. package/lib/schedule-manager.js +91 -155
  747. package/lib/schedule-manager.js.map +1 -1
  748. package/lib/security/anomaly-detection.d.ts +3 -6
  749. package/lib/security/anomaly-detection.d.ts.map +1 -1
  750. package/lib/security/anomaly-detection.js +24 -31
  751. package/lib/security/anomaly-detection.js.map +1 -1
  752. package/lib/security/audit-logger.d.ts +5 -4
  753. package/lib/security/audit-logger.d.ts.map +1 -1
  754. package/lib/security/audit-logger.js +17 -25
  755. package/lib/security/audit-logger.js.map +1 -1
  756. package/lib/security/dangerous-tool-policy.d.ts +1 -1
  757. package/lib/security/dangerous-tool-policy.d.ts.map +1 -1
  758. package/lib/security/dangerous-tool-policy.js +6 -25
  759. package/lib/security/dangerous-tool-policy.js.map +1 -1
  760. package/lib/security/exec-policy.d.ts +2 -1
  761. package/lib/security/exec-policy.d.ts.map +1 -1
  762. package/lib/security/exec-policy.js +6 -11
  763. package/lib/security/exec-policy.js.map +1 -1
  764. package/lib/security/file-policy.d.ts.map +1 -1
  765. package/lib/security/file-policy.js +1 -0
  766. package/lib/security/file-policy.js.map +1 -1
  767. package/lib/security/file-role-policy.d.ts.map +1 -1
  768. package/lib/security/file-role-policy.js +1 -4
  769. package/lib/security/file-role-policy.js.map +1 -1
  770. package/lib/security/index.d.ts +0 -2
  771. package/lib/security/index.d.ts.map +1 -1
  772. package/lib/security/index.js +0 -2
  773. package/lib/security/index.js.map +1 -1
  774. package/lib/security/network-policy-context.d.ts +7 -0
  775. package/lib/security/network-policy-context.d.ts.map +1 -0
  776. package/lib/security/network-policy-context.js +9 -0
  777. package/lib/security/network-policy-context.js.map +1 -0
  778. package/lib/security/network-policy.d.ts +14 -1
  779. package/lib/security/network-policy.d.ts.map +1 -1
  780. package/lib/security/network-policy.js +70 -3
  781. package/lib/security/network-policy.js.map +1 -1
  782. package/lib/security/owner-approve-always-store.d.ts +1 -1
  783. package/lib/security/owner-approve-always-store.d.ts.map +1 -1
  784. package/lib/security/owner-approve-always-store.js +12 -12
  785. package/lib/security/owner-approve-always-store.js.map +1 -1
  786. package/lib/security/policy-facade.d.ts +27 -0
  787. package/lib/security/policy-facade.d.ts.map +1 -1
  788. package/lib/security/policy-facade.js +190 -3
  789. package/lib/security/policy-facade.js.map +1 -1
  790. package/lib/security/sandbox.d.ts +2 -7
  791. package/lib/security/sandbox.d.ts.map +1 -1
  792. package/lib/security/sandbox.js +12 -21
  793. package/lib/security/sandbox.js.map +1 -1
  794. package/lib/security/turn-file-authority.d.ts +14 -0
  795. package/lib/security/turn-file-authority.d.ts.map +1 -0
  796. package/lib/security/turn-file-authority.js +101 -0
  797. package/lib/security/turn-file-authority.js.map +1 -0
  798. package/lib/security/turn-network-client.d.ts +30 -0
  799. package/lib/security/turn-network-client.d.ts.map +1 -0
  800. package/lib/security/turn-network-client.js +111 -0
  801. package/lib/security/turn-network-client.js.map +1 -0
  802. package/lib/service.d.ts +3 -13
  803. package/lib/service.d.ts.map +1 -1
  804. package/lib/service.js +3 -35
  805. package/lib/service.js.map +1 -1
  806. package/lib/session/{session-interaction-port.d.ts → approval-port.d.ts} +4 -7
  807. package/lib/session/approval-port.d.ts.map +1 -0
  808. package/lib/session/{session-interaction-port.js → approval-port.js} +1 -1
  809. package/lib/session/approval-port.js.map +1 -0
  810. package/lib/session/http-approval-adapter.d.ts +2 -2
  811. package/lib/session/http-approval-adapter.d.ts.map +1 -1
  812. package/lib/session/http-approval-adapter.js +1 -1
  813. package/lib/session/http-approval-adapter.js.map +1 -1
  814. package/lib/session/http-approval-waiter.d.ts +1 -1
  815. package/lib/session/http-approval-waiter.d.ts.map +1 -1
  816. package/lib/session/http-approval-waiter.js +25 -2
  817. package/lib/session/http-approval-waiter.js.map +1 -1
  818. package/lib/session/index.d.ts +6 -3
  819. package/lib/session/index.d.ts.map +1 -1
  820. package/lib/session/index.js +3 -2
  821. package/lib/session/index.js.map +1 -1
  822. package/lib/session/passive-group-session.d.ts +8 -10
  823. package/lib/session/passive-group-session.d.ts.map +1 -1
  824. package/lib/session/passive-group-session.js +23 -27
  825. package/lib/session/passive-group-session.js.map +1 -1
  826. package/lib/session/resolve-approval-port.d.ts +7 -0
  827. package/lib/session/resolve-approval-port.d.ts.map +1 -0
  828. package/lib/session/resolve-approval-port.js +13 -0
  829. package/lib/session/resolve-approval-port.js.map +1 -0
  830. package/lib/session/session-io.d.ts +3 -4
  831. package/lib/session/session-io.d.ts.map +1 -1
  832. package/lib/session/session-io.js +7 -15
  833. package/lib/session/session-io.js.map +1 -1
  834. package/lib/session/session-system.d.ts +22 -1
  835. package/lib/session/session-system.d.ts.map +1 -1
  836. package/lib/session/session-system.js +72 -10
  837. package/lib/session/session-system.js.map +1 -1
  838. package/lib/session/session-tree-commands.d.ts.map +1 -1
  839. package/lib/session/session-tree-commands.js +2 -4
  840. package/lib/session/session-tree-commands.js.map +1 -1
  841. package/lib/session/turn-ingress-session.d.ts +23 -0
  842. package/lib/session/turn-ingress-session.d.ts.map +1 -0
  843. package/lib/session/turn-ingress-session.js +89 -0
  844. package/lib/session/turn-ingress-session.js.map +1 -0
  845. package/lib/session-tree-runtime-registry.d.ts +3 -1
  846. package/lib/session-tree-runtime-registry.d.ts.map +1 -1
  847. package/lib/session-tree-runtime-registry.js +6 -4
  848. package/lib/session-tree-runtime-registry.js.map +1 -1
  849. package/lib/stability/memory-pressure.d.ts.map +1 -1
  850. package/lib/stability/memory-pressure.js +4 -21
  851. package/lib/stability/memory-pressure.js.map +1 -1
  852. package/lib/subagent/subagent-runtime.d.ts.map +1 -1
  853. package/lib/subagent/subagent-runtime.js +1 -5
  854. package/lib/subagent/subagent-runtime.js.map +1 -1
  855. package/lib/subagent/subagent-system-init.js +2 -2
  856. package/lib/subagent/subagent-system-init.js.map +1 -1
  857. package/lib/subagent-ai-events.d.ts +3 -0
  858. package/lib/subagent-ai-events.d.ts.map +1 -1
  859. package/lib/subagent-ai-events.js +4 -1
  860. package/lib/subagent-ai-events.js.map +1 -1
  861. package/lib/subagent-goal-notify.d.ts +1 -1
  862. package/lib/subagent-goal-notify.d.ts.map +1 -1
  863. package/lib/subagent-goal-notify.js +1 -1
  864. package/lib/subagent-goal-notify.js.map +1 -1
  865. package/lib/subagent-parent-context.d.ts +9 -0
  866. package/lib/subagent-parent-context.d.ts.map +1 -1
  867. package/lib/subagent-parent-context.js +8 -0
  868. package/lib/subagent-parent-context.js.map +1 -1
  869. package/lib/task-executor.d.ts +14 -25
  870. package/lib/task-executor.d.ts.map +1 -1
  871. package/lib/task-executor.js +106 -137
  872. package/lib/task-executor.js.map +1 -1
  873. package/lib/tool/builtin-policy-extractors.d.ts +2 -0
  874. package/lib/tool/builtin-policy-extractors.d.ts.map +1 -0
  875. package/lib/tool/builtin-policy-extractors.js +65 -0
  876. package/lib/tool/builtin-policy-extractors.js.map +1 -0
  877. package/lib/tool/classic-tool-execution-authority.d.ts +22 -0
  878. package/lib/tool/classic-tool-execution-authority.d.ts.map +1 -0
  879. package/lib/tool/classic-tool-execution-authority.js +79 -0
  880. package/lib/tool/classic-tool-execution-authority.js.map +1 -0
  881. package/lib/tool/contracts.d.ts +2 -2
  882. package/lib/tool/contracts.d.ts.map +1 -1
  883. package/lib/tool/contracts.js +1 -1
  884. package/lib/tool/deferred-resolution.d.ts +5 -3
  885. package/lib/tool/deferred-resolution.d.ts.map +1 -1
  886. package/lib/tool/deferred-resolution.js +31 -5
  887. package/lib/tool/deferred-resolution.js.map +1 -1
  888. package/lib/tool/index.d.ts +2 -0
  889. package/lib/tool/index.d.ts.map +1 -1
  890. package/lib/tool/index.js +1 -0
  891. package/lib/tool/index.js.map +1 -1
  892. package/lib/tool/prepare-turn-tools.d.ts +2 -0
  893. package/lib/tool/prepare-turn-tools.d.ts.map +1 -1
  894. package/lib/tool/prepare-turn-tools.js +62 -10
  895. package/lib/tool/prepare-turn-tools.js.map +1 -1
  896. package/lib/tool/runtime.d.ts +1 -1
  897. package/lib/tool/runtime.d.ts.map +1 -1
  898. package/lib/tool/runtime.js +1 -1
  899. package/lib/tool/runtime.js.map +1 -1
  900. package/lib/tool/sources.d.ts +5 -2
  901. package/lib/tool/sources.d.ts.map +1 -1
  902. package/lib/tool/sources.js +4 -4
  903. package/lib/tool/sources.js.map +1 -1
  904. package/lib/tool/tool-approval-gate.d.ts +3 -3
  905. package/lib/tool/tool-approval-gate.d.ts.map +1 -1
  906. package/lib/tool/tool-approval-gate.js +2 -1
  907. package/lib/tool/tool-approval-gate.js.map +1 -1
  908. package/lib/tool/tool-runtime.d.ts +52 -0
  909. package/lib/tool/tool-runtime.d.ts.map +1 -0
  910. package/lib/tool/tool-runtime.js +101 -0
  911. package/lib/tool/tool-runtime.js.map +1 -0
  912. package/lib/tool/tool-system.d.ts +7 -3
  913. package/lib/tool/tool-system.d.ts.map +1 -1
  914. package/lib/tool/tool-system.js +12 -6
  915. package/lib/tool/tool-system.js.map +1 -1
  916. package/lib/tool/turn-tool-runtime.d.ts +29 -0
  917. package/lib/tool/turn-tool-runtime.d.ts.map +1 -0
  918. package/lib/tool/turn-tool-runtime.js +89 -0
  919. package/lib/tool/turn-tool-runtime.js.map +1 -0
  920. package/lib/tool-catalog/deferred-turn-controller.d.ts +30 -0
  921. package/lib/tool-catalog/deferred-turn-controller.d.ts.map +1 -0
  922. package/lib/tool-catalog/deferred-turn-controller.js +126 -0
  923. package/lib/tool-catalog/deferred-turn-controller.js.map +1 -0
  924. package/lib/turn/auto-continue.d.ts +6 -15
  925. package/lib/turn/auto-continue.d.ts.map +1 -1
  926. package/lib/turn/auto-continue.js +43 -31
  927. package/lib/turn/auto-continue.js.map +1 -1
  928. package/lib/turn/deferred-turn-state.d.ts +29 -0
  929. package/lib/turn/deferred-turn-state.d.ts.map +1 -0
  930. package/lib/turn/deferred-turn-state.js +35 -0
  931. package/lib/turn/deferred-turn-state.js.map +1 -0
  932. package/lib/turn/execute-agent-turn.d.ts +14 -0
  933. package/lib/turn/execute-agent-turn.d.ts.map +1 -0
  934. package/lib/turn/execute-agent-turn.js +171 -0
  935. package/lib/turn/execute-agent-turn.js.map +1 -0
  936. package/lib/turn/inbound-media.d.ts +3 -3
  937. package/lib/turn/inbound-media.d.ts.map +1 -1
  938. package/lib/turn/inbound-media.js +11 -4
  939. package/lib/turn/inbound-media.js.map +1 -1
  940. package/lib/turn/index.d.ts +8 -1
  941. package/lib/turn/index.d.ts.map +1 -1
  942. package/lib/turn/index.js +5 -1
  943. package/lib/turn/index.js.map +1 -1
  944. package/lib/turn/journal-integrity.d.ts +5 -0
  945. package/lib/turn/journal-integrity.d.ts.map +1 -0
  946. package/lib/turn/journal-integrity.js +8 -0
  947. package/lib/turn/journal-integrity.js.map +1 -0
  948. package/lib/turn/process-stream.d.ts.map +1 -1
  949. package/lib/turn/process-stream.js +21 -55
  950. package/lib/turn/process-stream.js.map +1 -1
  951. package/lib/turn/prompt-controller.d.ts +7 -4
  952. package/lib/turn/prompt-controller.d.ts.map +1 -1
  953. package/lib/turn/prompt-controller.js +23 -11
  954. package/lib/turn/prompt-controller.js.map +1 -1
  955. package/lib/turn/subagent-auto-continue.d.ts +2 -0
  956. package/lib/turn/subagent-auto-continue.d.ts.map +1 -1
  957. package/lib/turn/subagent-auto-continue.js +17 -1
  958. package/lib/turn/subagent-auto-continue.js.map +1 -1
  959. package/lib/turn/task-continuation.d.ts +3 -6
  960. package/lib/turn/task-continuation.d.ts.map +1 -1
  961. package/lib/turn/task-continuation.js +10 -13
  962. package/lib/turn/task-continuation.js.map +1 -1
  963. package/lib/turn/turn-complete.d.ts +1 -0
  964. package/lib/turn/turn-complete.d.ts.map +1 -1
  965. package/lib/turn/turn-complete.js +3 -2
  966. package/lib/turn/turn-complete.js.map +1 -1
  967. package/lib/turn/turn-context-bridge.d.ts +0 -4
  968. package/lib/turn/turn-context-bridge.d.ts.map +1 -1
  969. package/lib/turn/turn-context-bridge.js +0 -10
  970. package/lib/turn/turn-context-bridge.js.map +1 -1
  971. package/lib/turn/turn-event-source.d.ts +15 -0
  972. package/lib/turn/turn-event-source.d.ts.map +1 -0
  973. package/lib/turn/turn-event-source.js +61 -0
  974. package/lib/turn/turn-event-source.js.map +1 -0
  975. package/lib/turn/turn-ingress.d.ts +157 -0
  976. package/lib/turn/turn-ingress.d.ts.map +1 -0
  977. package/lib/turn/turn-ingress.js +76 -0
  978. package/lib/turn/turn-ingress.js.map +1 -0
  979. package/lib/turn/turn-metrics.d.ts.map +1 -1
  980. package/lib/turn/turn-metrics.js +10 -9
  981. package/lib/turn/turn-metrics.js.map +1 -1
  982. package/lib/turn/turn-pipeline.d.ts +10 -3
  983. package/lib/turn/turn-pipeline.d.ts.map +1 -1
  984. package/lib/turn/turn-pipeline.js +73 -41
  985. package/lib/turn/turn-pipeline.js.map +1 -1
  986. package/lib/typing-indicator/adapter-integration.d.ts +3 -5
  987. package/lib/typing-indicator/adapter-integration.d.ts.map +1 -1
  988. package/lib/typing-indicator/adapter-integration.js.map +1 -1
  989. package/lib/typing-indicator/index.d.ts +4 -4
  990. package/lib/typing-indicator/index.d.ts.map +1 -1
  991. package/lib/typing-indicator/index.js +25 -29
  992. package/lib/typing-indicator/index.js.map +1 -1
  993. package/lib/typing-indicator/integration.d.ts +6 -8
  994. package/lib/typing-indicator/integration.d.ts.map +1 -1
  995. package/lib/typing-indicator/integration.js +12 -10
  996. package/lib/typing-indicator/integration.js.map +1 -1
  997. package/lib/utils/keyed-mutex.d.ts +10 -0
  998. package/lib/utils/keyed-mutex.d.ts.map +1 -0
  999. package/lib/utils/keyed-mutex.js +34 -0
  1000. package/lib/utils/keyed-mutex.js.map +1 -0
  1001. package/lib/zhin-agent/index.d.ts +71 -76
  1002. package/lib/zhin-agent/index.d.ts.map +1 -1
  1003. package/lib/zhin-agent/index.js +51 -157
  1004. package/lib/zhin-agent/index.js.map +1 -1
  1005. package/lib/zhin-agent/runtime-modules.d.ts +1 -0
  1006. package/lib/zhin-agent/runtime-modules.d.ts.map +1 -1
  1007. package/lib/zhin-agent/runtime-modules.js +16 -0
  1008. package/lib/zhin-agent/runtime-modules.js.map +1 -1
  1009. package/package.json +13 -11
  1010. package/lib/assistant/domains/home-assistant.d.ts.map +0 -1
  1011. package/lib/assistant/domains/home-assistant.js.map +0 -1
  1012. package/lib/assistant/schedule-message.d.ts +0 -9
  1013. package/lib/assistant/schedule-message.d.ts.map +0 -1
  1014. package/lib/assistant/schedule-message.js +0 -23
  1015. package/lib/assistant/schedule-message.js.map +0 -1
  1016. package/lib/assistant/schedule-tool-runtime.d.ts +0 -7
  1017. package/lib/assistant/schedule-tool-runtime.d.ts.map +0 -1
  1018. package/lib/assistant/schedule-tool-runtime.js +0 -50
  1019. package/lib/assistant/schedule-tool-runtime.js.map +0 -1
  1020. package/lib/builtin/ask-user-session-service.d.ts +0 -40
  1021. package/lib/builtin/ask-user-session-service.d.ts.map +0 -1
  1022. package/lib/builtin/ask-user-session-service.js +0 -258
  1023. package/lib/builtin/ask-user-session-service.js.map +0 -1
  1024. package/lib/builtin/ask-user-session.d.ts +0 -18
  1025. package/lib/builtin/ask-user-session.d.ts.map +0 -1
  1026. package/lib/builtin/ask-user-session.js +0 -21
  1027. package/lib/builtin/ask-user-session.js.map +0 -1
  1028. package/lib/builtin/ask-user-tool.d.ts +0 -22
  1029. package/lib/builtin/ask-user-tool.d.ts.map +0 -1
  1030. package/lib/builtin/ask-user-tool.js +0 -148
  1031. package/lib/builtin/ask-user-tool.js.map +0 -1
  1032. package/lib/builtin/deferred-tool-meta.d.ts +0 -51
  1033. package/lib/builtin/deferred-tool-meta.d.ts.map +0 -1
  1034. package/lib/builtin/deferred-tool-meta.js +0 -143
  1035. package/lib/builtin/deferred-tool-meta.js.map +0 -1
  1036. package/lib/collaboration/ask-user-bridge.d.ts +0 -9
  1037. package/lib/collaboration/ask-user-bridge.d.ts.map +0 -1
  1038. package/lib/collaboration/ask-user-bridge.js +0 -73
  1039. package/lib/collaboration/ask-user-bridge.js.map +0 -1
  1040. package/lib/collaboration/bootstrap-agent-runtimes.d.ts +0 -22
  1041. package/lib/collaboration/bootstrap-agent-runtimes.d.ts.map +0 -1
  1042. package/lib/collaboration/bootstrap-agent-runtimes.js +0 -106
  1043. package/lib/collaboration/bootstrap-agent-runtimes.js.map +0 -1
  1044. package/lib/collaboration/inbound-turn-compat.d.ts +0 -32
  1045. package/lib/collaboration/inbound-turn-compat.d.ts.map +0 -1
  1046. package/lib/collaboration/inbound-turn-compat.js +0 -30
  1047. package/lib/collaboration/inbound-turn-compat.js.map +0 -1
  1048. package/lib/collaboration/runtime-registry.d.ts +0 -18
  1049. package/lib/collaboration/runtime-registry.d.ts.map +0 -1
  1050. package/lib/collaboration/runtime-registry.js +0 -45
  1051. package/lib/collaboration/runtime-registry.js.map +0 -1
  1052. package/lib/init/management-command-guard.d.ts +0 -6
  1053. package/lib/init/management-command-guard.d.ts.map +0 -1
  1054. package/lib/init/management-command-guard.js +0 -6
  1055. package/lib/init/management-command-guard.js.map +0 -1
  1056. package/lib/init/output-renderer.d.ts +0 -7
  1057. package/lib/init/output-renderer.d.ts.map +0 -1
  1058. package/lib/init/output-renderer.js +0 -44
  1059. package/lib/init/output-renderer.js.map +0 -1
  1060. package/lib/init/register-home-tools.d.ts +0 -2
  1061. package/lib/init/register-home-tools.d.ts.map +0 -1
  1062. package/lib/init/register-home-tools.js +0 -51
  1063. package/lib/init/register-home-tools.js.map +0 -1
  1064. package/lib/init/register-owner-approve-commands.d.ts +0 -10
  1065. package/lib/init/register-owner-approve-commands.d.ts.map +0 -1
  1066. package/lib/init/register-owner-approve-commands.js +0 -12
  1067. package/lib/init/register-owner-approve-commands.js.map +0 -1
  1068. package/lib/media/constants.d.ts +0 -3
  1069. package/lib/media/constants.d.ts.map +0 -1
  1070. package/lib/media/constants.js +0 -3
  1071. package/lib/media/constants.js.map +0 -1
  1072. package/lib/orchestrator/owner-confirm-orchestration.d.ts +0 -39
  1073. package/lib/orchestrator/owner-confirm-orchestration.d.ts.map +0 -1
  1074. package/lib/orchestrator/owner-confirm-orchestration.js +0 -92
  1075. package/lib/orchestrator/owner-confirm-orchestration.js.map +0 -1
  1076. package/lib/orchestrator/owner-orchestration-constants.d.ts +0 -6
  1077. package/lib/orchestrator/owner-orchestration-constants.d.ts.map +0 -1
  1078. package/lib/orchestrator/owner-orchestration-constants.js +0 -10
  1079. package/lib/orchestrator/owner-orchestration-constants.js.map +0 -1
  1080. package/lib/security/dangerous-tool-policy-hook.d.ts +0 -6
  1081. package/lib/security/dangerous-tool-policy-hook.d.ts.map +0 -1
  1082. package/lib/security/dangerous-tool-policy-hook.js +0 -41
  1083. package/lib/security/dangerous-tool-policy-hook.js.map +0 -1
  1084. package/lib/security/exec-policy-hook.d.ts +0 -7
  1085. package/lib/security/exec-policy-hook.d.ts.map +0 -1
  1086. package/lib/security/exec-policy-hook.js +0 -29
  1087. package/lib/security/exec-policy-hook.js.map +0 -1
  1088. package/lib/security/file-policy-hook.d.ts +0 -6
  1089. package/lib/security/file-policy-hook.d.ts.map +0 -1
  1090. package/lib/security/file-policy-hook.js +0 -30
  1091. package/lib/security/file-policy-hook.js.map +0 -1
  1092. package/lib/security/sandbox-enhanced.d.ts +0 -173
  1093. package/lib/security/sandbox-enhanced.d.ts.map +0 -1
  1094. package/lib/security/sandbox-enhanced.js +0 -665
  1095. package/lib/security/sandbox-enhanced.js.map +0 -1
  1096. package/lib/session/im-approval-adapter.d.ts +0 -12
  1097. package/lib/session/im-approval-adapter.d.ts.map +0 -1
  1098. package/lib/session/im-approval-adapter.js +0 -24
  1099. package/lib/session/im-approval-adapter.js.map +0 -1
  1100. package/lib/session/resolve-session-interaction-port.d.ts +0 -9
  1101. package/lib/session/resolve-session-interaction-port.d.ts.map +0 -1
  1102. package/lib/session/resolve-session-interaction-port.js +0 -17
  1103. package/lib/session/resolve-session-interaction-port.js.map +0 -1
  1104. package/lib/session/session-interaction-port.d.ts.map +0 -1
  1105. package/lib/session/session-interaction-port.js.map +0 -1
@@ -0,0 +1,120 @@
1
+ import { defineAgentTool, toolFeatureId, } from '@zhin.js/tool';
2
+ import { bingSearchFetchHeaders, buildBingSearchUrl, extractBingResults, hostnameMatchesList, } from '../builtin/bing-search-html.js';
3
+ import { DEFAULT_WEB_SEARCH_MARKET } from '../builtin/web-search-locale.js';
4
+ import { ZHIN_WEB_USER_AGENT } from '../builtin/web-tool-utils.js';
5
+ import { NodeNetworkTransport, TurnNetworkClient, } from '../security/turn-network-client.js';
6
+ /** Native generation ToolFeatures backed by the Turn-scoped network module. */
7
+ export function createNativeWebToolFeatures(transport = new NodeNetworkTransport()) {
8
+ return Object.freeze([
9
+ feature('web_fetch', defineAgentTool({
10
+ description: 'Fetch public HTTP(S) content through the Turn network policy and return readable text.',
11
+ inputSchema: objectSchema({
12
+ url: { type: 'string', description: 'Absolute HTTP(S) URL' },
13
+ max_length: { type: 'number', description: 'Maximum returned characters' },
14
+ }, ['url']),
15
+ approval: 'on-risk',
16
+ execute: (input, context) => fetchWeb(input, context, transport),
17
+ })),
18
+ feature('web_search', defineAgentTool({
19
+ description: 'Search the public web through the Turn network policy and return titles, URLs, and snippets.',
20
+ inputSchema: objectSchema({
21
+ query: { type: 'string', description: 'Search query' },
22
+ limit: { type: 'number', description: 'Result count from 1 to 20' },
23
+ market: { type: 'string', description: 'Bing market such as en-US or zh-CN' },
24
+ allowed_domains: { type: 'array', items: { type: 'string' } },
25
+ blocked_domains: { type: 'array', items: { type: 'string' } },
26
+ }, ['query']),
27
+ approval: 'never',
28
+ execute: (input, context) => searchWeb(input, context, transport),
29
+ })),
30
+ ]);
31
+ }
32
+ async function fetchWeb(input, context, transport) {
33
+ const url = requiredString(input.url, 'url');
34
+ const maxLength = positiveInteger(input.max_length, 20 * 1024, 200_000);
35
+ const response = await new TurnNetworkClient(context.policy, context.signal, transport).getText(url, {
36
+ headers: { 'User-Agent': ZHIN_WEB_USER_AGENT },
37
+ timeoutMs: 15_000,
38
+ maxRedirects: 5,
39
+ maxBytes: 2 * 1024 * 1024,
40
+ });
41
+ if (response.status < 200 || response.status >= 300) {
42
+ throw new Error(`HTTP ${response.status}: ${response.statusText}`);
43
+ }
44
+ const text = htmlToPlainText(response.body);
45
+ return text.length > maxLength ? `${text.slice(0, maxLength)}\n...(truncated)` : text;
46
+ }
47
+ async function searchWeb(input, context, transport) {
48
+ const query = requiredString(input.query, 'query');
49
+ const market = typeof input.market === 'string' && /^[a-z]{2}-[A-Z]{2}$/.test(input.market)
50
+ ? input.market
51
+ : DEFAULT_WEB_SEARCH_MARKET;
52
+ const limit = positiveInteger(input.limit, 5, 20);
53
+ const response = await new TurnNetworkClient(context.policy, context.signal, transport).getText(buildBingSearchUrl(query, market), {
54
+ headers: bingSearchFetchHeaders(market),
55
+ timeoutMs: 30_000,
56
+ maxRedirects: 5,
57
+ maxBytes: 2 * 1024 * 1024,
58
+ });
59
+ if (response.status < 200 || response.status >= 300) {
60
+ throw new Error(`HTTP ${response.status}: ${response.statusText}`);
61
+ }
62
+ const rows = filterDomains(extractBingResults(response.body), stringList(input.allowed_domains), stringList(input.blocked_domains)).slice(0, limit);
63
+ if (rows.length === 0)
64
+ return 'No results found.';
65
+ return rows.map((row, index) => [
66
+ `${index + 1}. ${row.title}`,
67
+ ` URL: ${row.url}`,
68
+ ...(row.snippet ? [` ${row.snippet}`] : []),
69
+ ].join('\n')).join('\n\n');
70
+ }
71
+ function filterDomains(rows, allowed, blocked) {
72
+ return rows.filter((row) => {
73
+ let hostname;
74
+ try {
75
+ hostname = new URL(row.url).hostname;
76
+ }
77
+ catch {
78
+ return false;
79
+ }
80
+ if (allowed.length > 0 && !allowed.some((domain) => hostnameMatchesList(hostname, domain)))
81
+ return false;
82
+ return !blocked.some((domain) => hostnameMatchesList(hostname, domain));
83
+ });
84
+ }
85
+ function htmlToPlainText(html) {
86
+ return html
87
+ .replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi, ' ')
88
+ .replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi, ' ')
89
+ .replace(/<[^>]+>/g, ' ')
90
+ .replace(/&nbsp;/gi, ' ')
91
+ .replace(/&amp;/gi, '&')
92
+ .replace(/&lt;/gi, '<')
93
+ .replace(/&gt;/gi, '>')
94
+ .replace(/&quot;/gi, '"')
95
+ .replace(/&#39;/gi, "'")
96
+ .replace(/\s+/g, ' ')
97
+ .trim();
98
+ }
99
+ function feature(name, definition) {
100
+ return Object.freeze({ feature: toolFeatureId, name, definition });
101
+ }
102
+ function objectSchema(properties, required) {
103
+ return Object.freeze({ type: 'object', properties: Object.freeze(properties), required: Object.freeze([...required]) });
104
+ }
105
+ function requiredString(value, name) {
106
+ if (typeof value !== 'string' || !value.trim())
107
+ throw new TypeError(`${name} is required`);
108
+ return value.trim();
109
+ }
110
+ function positiveInteger(value, fallback, maximum) {
111
+ if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0)
112
+ return fallback;
113
+ return Math.min(maximum, Math.floor(value));
114
+ }
115
+ function stringList(value) {
116
+ return Array.isArray(value)
117
+ ? value.filter((item) => typeof item === 'string' && item.trim().length > 0)
118
+ : [];
119
+ }
120
+ //# sourceMappingURL=native-web-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-web-tools.js","sourceRoot":"","sources":["../../src/plugin-runtime/native-web-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,aAAa,GAGd,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACL,oBAAoB,EACpB,iBAAiB,GAElB,MAAM,oCAAoC,CAAC;AAQ5C,+EAA+E;AAC/E,MAAM,UAAU,2BAA2B,CACzC,YAA8B,IAAI,oBAAoB,EAAE;IAExD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,OAAO,CAAC,WAAW,EAAE,eAAe,CAAC;YACnC,WAAW,EAAE,wFAAwF;YACrG,WAAW,EAAE,YAAY,CAAC;gBACxB,GAAG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Info } from './system-prompt.js';
3
- import type { ZhinAgentPrivate } from '../internal/agent-host.js';
4
- import type { AgentMessage } from '@zhin.js/ai';
5
- export declare function buildDisciplinedPrompt(_agent: ZhinAgentPrivate, basePrompt: string): string;
2
+ import type { AgentContextHost, ZhinAgentPrivate } from '../internal/agent-host.js';
3
+ import { type AgentMessage } from '@zhin.js/ai';
4
+ import type { AgentPromptProfile } from './turn-prompt-profile.js';
5
+ import type { TurnContextView } from '../context/turn-envelope.js';
6
+ export declare function buildDisciplinedPrompt(_host: AgentContextHost, basePrompt: string): string;
6
7
  export declare function describeAgentPathPromptSections(agent: ZhinAgentPrivate, options: {
7
- commMessage: Message;
8
+ turn: TurnContextView;
8
9
  content: string;
9
10
  sessionId: string;
10
11
  deferredStats?: string;
11
12
  modelSdk?: string;
13
+ runtime?: PromptRuntimeOverrides;
12
14
  }): Promise<PromptSectionDebugInfo[]>;
13
15
  export declare function buildAgentPathSystemPrompt(agent: ZhinAgentPrivate, options: {
16
+ profile: AgentPromptProfile;
17
+ turn: TurnContextView;
14
18
  content: string;
15
- commMessage: Message;
16
19
  sessionId: string;
17
20
  personaEnhanced: string;
18
21
  preData?: string;
19
22
  deferredStats?: string;
20
23
  modelSdk?: string;
24
+ runtime?: PromptRuntimeOverrides;
21
25
  }): Promise<string>;
22
- export declare function buildFastPathSystemPrompt(agent: ZhinAgentPrivate, personaEnhanced: string, preData: string | undefined, _commMessage: Message): string;
23
- export declare function buildChatPathSystemPrompt(agent: ZhinAgentPrivate, personaEnhanced: string, _commMessage: Message): string;
26
+ export interface PromptRuntimeOverrides {
27
+ readonly bootstrapContext?: string;
28
+ readonly activeSkillsContext?: string;
29
+ readonly agentNickname?: string;
30
+ readonly modelId?: string;
31
+ readonly providerAlias?: string;
32
+ }
33
+ export declare function buildChatPathSystemPrompt(agent: ZhinAgentPrivate, personaEnhanced: string, profile: AgentPromptProfile): string;
24
34
  export declare function buildMultimodalVisionSystemPrompt(agent: ZhinAgentPrivate, options: {
25
- commMessage: Message;
35
+ turn: TurnContextView;
26
36
  sessionId: string;
27
37
  textContent: string;
28
38
  personaEnhanced: string;
@@ -1 +1 @@
1
- {"version":3,"file":"assembly.d.ts","sourceRoot":"","sources":["../../src/prompt/assembly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAML,KAAK,sBAAsB,EAC5B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAU3F;AAED,wBAAsB,+BAA+B,CACnD,KAAK,EAAE,gBAAgB,EACvB,OAAO,EAAE;IACP,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GACA,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAyBnC;AAED,wBAAsB,0BAA0B,CAC9C,KAAK,EAAE,gBAAgB,EACvB,OAAO,EAAE;IACP,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GACA,OAAO,CAAC,MAAM,CAAC,CAgCjB;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,gBAAgB,EACvB,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,YAAY,E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{ buildRichSystemPrompt, buildLiteSystemPromptWithPlatform, buildUserMessageWithHistory, FIXED_DISCIPLINE_RULES, describePromptSectionsForDebug, } from './system-prompt.js';
3
- import { buildPreExecFastPathPrompt } from '../tool/runtime.js';
4
- export function buildDisciplinedPrompt(_agent, basePrompt) {
3
+ import { getGitStatusLine } from './git-context.js';
4
+ import { getLlmTransportModel } from '@zhin.js/ai';
5
+ import { assembleSchedulePrompt } from '../schedule-domain/prompt-assembler.js';
6
+ function promptPlatform(turn) {
7
+ return turn.origin.kind === 'im' ? turn.origin.platform : undefined;
8
+ }
9
+ function scheduleSystemPrompt(agent, profile, platformContext) {
10
+ return assembleSchedulePrompt({
11
+ jobId: profile.jobId,
12
+ prompt: profile.prompt,
13
+ createdBy: profile.createdBy,
14
+ security: profile.security,
15
+ platformContext,
16
+ skillContext: agent.getTurnActiveSkills(),
17
+ bootstrapContext: [agent.globalContext, agent.bootstrapContext].filter(Boolean).join('\n\n'),
18
+ }).systemPrompt;
19
+ }
20
+ export function buildDisciplinedPrompt(_host, basePrompt) {
5
21
  const guidance = [
6
22
  '# Style',
7
23
  '- Lead with the answer or result.',
@@ -13,10 +29,11 @@ export function buildDisciplinedPrompt(_agent, basePrompt) {
13
29
  return `${basePrompt}\n\n${guidance}`;
14
30
  }
15
31
  export async function describeAgentPathPromptSections(agent, options) {
16
- const platformMarkdown = await resolveAgentPromptMarkdown({
32
+ const platform = promptPlatform(options.turn);
33
+ const platformMarkdown = platform ? await resolveAgentPromptMarkdown({
17
34
  ctx: {
18
35
  slot: 'orchestrator',
19
- commMessage: options.commMessage,
36
+ platform,
20
37
  userMessagePreview: options.content.slice(0, 500),
21
38
  deferred: options.deferredStats
22
39
  ? { goal: options.content, domainStats: options.deferredStats }
@@ -24,66 +41,88 @@ export async function describeAgentPathPromptSections(agent, options) {
24
41
  },
25
42
  config: agent.config,
26
43
  sessionId: options.sessionId,
27
- });
44
+ }) : '';
28
45
  return describePromptSectionsForDebug({
29
46
  config: agent.config,
30
47
  skillRegistry: agent.skillRegistry,
31
48
  skillsSummaryXML: agent.skillsSummaryXML,
32
- activeSkillsContext: agent.getTurnActiveSkills(),
33
- bootstrapContext: agent.bootstrapContext,
34
- commMessage: options.commMessage,
49
+ activeSkillsContext: options.runtime?.activeSkillsContext ?? agent.getTurnActiveSkills(),
50
+ bootstrapContext: options.runtime?.bootstrapContext ?? agent.bootstrapContext,
51
+ globalContext: agent.globalContext,
52
+ turn: options.turn,
53
+ gitStatus: agent.config.gitStatus
54
+ ? (await getGitStatusLine(process.cwd())) ?? undefined
55
+ : undefined,
35
56
  toolSearchDeferredStats: options.deferredStats,
36
57
  platformSections: platformMarkdown,
37
58
  orchestratorSdk: options.modelSdk,
38
- agentNickname: agent.activeBinding?.nickname,
59
+ agentNickname: options.runtime?.agentNickname ?? agent.activeBinding?.nickname,
39
60
  });
40
61
  }
41
62
  export async function buildAgentPathSystemPrompt(agent, options) {
42
- const { content, commMessage, sessionId, personaEnhanced, preData, deferredStats, modelSdk } = options;
43
- const platformMarkdown = await resolveAgentPromptMarkdown({
63
+ const { content, sessionId, personaEnhanced, preData, deferredStats, modelSdk } = options;
64
+ if (options.profile.kind === 'schedule') {
65
+ return scheduleSystemPrompt(agent, options.profile);
66
+ }
67
+ const platform = promptPlatform(options.turn);
68
+ const platformMarkdown = platform ? await resolveAgentPromptMarkdown({
44
69
  ctx: {
45
70
  slot: 'orchestrator',
46
- commMessage,
71
+ platform,
47
72
  userMessagePreview: content.slice(0, 500),
48
73
  deferred: deferredStats ? { goal: content, domainStats: deferredStats } : undefined,
49
74
  },
50
75
  config: agent.config,
51
76
  sessionId,
52
- });
77
+ }) : '';
78
+ const gitStatus = agent.config.gitStatus
79
+ ? await getGitStatusLine(process.cwd())
80
+ : null;
81
+ const bindingModel = options.runtime?.modelId ?? agent.activeBinding?.model;
82
+ const providerAlias = options.runtime?.providerAlias
83
+ ?? agent.activeBinding?.providerAlias
84
+ ?? agent.getTurnProvider().name;
85
+ const llmModel = bindingModel
86
+ ? getLlmTransportModel(providerAlias, bindingModel)
87
+ : undefined;
53
88
  const promptCtx = {
54
89
  config: agent.config,
55
90
  skillRegistry: agent.skillRegistry,
56
91
  skillsSummaryXML: agent.skillsSummaryXML,
57
- activeSkillsContext: agent.getTurnActiveSkills(),
58
- bootstrapContext: agent.bootstrapContext,
59
- commMessage,
92
+ activeSkillsContext: options.runtime?.activeSkillsContext ?? agent.getTurnActiveSkills(),
93
+ bootstrapContext: options.runtime?.bootstrapContext ?? agent.bootstrapContext,
94
+ globalContext: agent.globalContext,
95
+ turn: options.turn,
96
+ gitStatus: gitStatus ?? undefined,
60
97
  toolSearchDeferredStats: deferredStats,
61
98
  platformSections: platformMarkdown,
62
99
  orchestratorSdk: modelSdk,
63
- agentNickname: agent.activeBinding?.nickname,
100
+ agentNickname: options.runtime?.agentNickname ?? agent.activeBinding?.nickname,
101
+ modelId: bindingModel,
102
+ contextWindow: llmModel?.contextWindow ?? agent.config.contextTokens,
64
103
  };
65
104
  const richPrompt = buildRichSystemPrompt(promptCtx);
66
105
  const dynamicBlock = agent.turnDynamicInstructions?.trim();
67
106
  const dynamicSuffix = dynamicBlock ? `\n\n# Dynamic context\n${dynamicBlock}` : '';
68
107
  return `${richPrompt}${dynamicSuffix}${preData ? `\n\nPre-fetched data:\n${preData}` : ''}`;
69
108
  }
70
- export function buildFastPathSystemPrompt(agent, personaEnhanced, preData, _commMessage) {
71
- return buildDisciplinedPrompt(agent, buildPreExecFastPathPrompt(personaEnhanced, preData ?? ''));
72
- }
73
- export function buildChatPathSystemPrompt(agent, personaEnhanced, _commMessage) {
109
+ export function buildChatPathSystemPrompt(agent, personaEnhanced, profile) {
110
+ if (profile.kind === 'schedule')
111
+ return scheduleSystemPrompt(agent, profile);
74
112
  return buildDisciplinedPrompt(agent, personaEnhanced);
75
113
  }
76
114
  export async function buildMultimodalVisionSystemPrompt(agent, options) {
77
- const { commMessage, sessionId, textContent, personaEnhanced } = options;
78
- const platformMarkdown = await resolveAgentPromptMarkdown({
115
+ const { turn, sessionId, textContent, personaEnhanced } = options;
116
+ const platform = promptPlatform(turn);
117
+ const platformMarkdown = platform ? await resolveAgentPromptMarkdown({
79
118
  ctx: {
80
119
  slot: 'orchestrator',
81
- commMessage,
120
+ platform,
82
121
  userMessagePreview: textContent.slice(0, 500),
83
122
  },
84
123
  config: agent.config,
85
124
  sessionId,
86
- });
125
+ }) : '';
87
126
  return buildLiteSystemPromptWithPlatform(personaEnhanced, platformMarkdown);
88
127
  }
89
128
  export function buildAgentUserMessage(historyMessages, content) {
@@ -1 +1 @@
1
- {"version":3,"file":"assembly.js","sourceRoot":"","sources":["../../src/prompt/assembly.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EACL,qBAAqB,EACrB,iCAAiC,EACjC,2BAA2B,EAC3B,sBAAsB,EACtB,8BAA8B,GAE/B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAIhE,MAAM,UAAU,sBAAsB,CAAC,MAAwB,EAAE,UAAkB;IACjF,MAAM,QAAQ,GAAG;QACf,SAAS;QACT,mCAAmC;QACnC,mCAAmC;QACnC,EAAE;QACF,UAAU;QACV,GAAG,sBAAsB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC;KACnD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACb,OAAO,GAAG,UAAU,OAAO,QAAQ,EAAE,CAAC;AACxC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,+BAA+B,CACnD,KAAuB,EACvB,OAMC;IAED,MAAM,gBAAgB,GAAG,MAAM,0BAA0B,CAAC;QACxD,GAAG,EAAE;YACH,IAAI,EAAE,cAAc;YACpB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,kBAAkB,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,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E,GAAG,CAAC;SAC9C;QACD,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,SAAS;KACV,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACR,OAAO,iCAAiC,CACtC,eAAe,EACf,gBAAgB,CACjB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,eAA+B,EAC/B,OAAe;IAEf,OAAO,2BAA2B,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,7 @@
1
+ /** 测试用:清空缓存 */
2
+ export declare function clearGitStatusCache(): void;
3
+ /**
4
+ * 返回单行 git 摘要,如 `Git: main | 3M 1A 2? | ahead 1`;非 git 仓库或失败返回 null。
5
+ */
6
+ export declare function getGitStatusLine(cwd: string): Promise<string | null>;
7
+ //# sourceMappingURL=git-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-context.d.ts","sourceRoot":"","sources":["../../src/prompt/git-context.ts"],"names":[],"mappings":"AAmBA,eAAe;AACf,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAWD;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA2C1E"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Git 状态单行摘要(注入 §1 Runtime 信息行)。
3
+ *
4
+ * 设计约束:越短越好——只给分支 + 按状态聚合计数,不列文件清单;
5
+ * agent 需要细节可用 exec 工具自行跑 git。进程内 TTL 缓存避免每条消息 fork git。
6
+ */
7
+ import { execFile } from 'node:child_process';
8
+ const GIT_TIMEOUT_MS = 2000;
9
+ const CACHE_TTL_MS = 60_000;
10
+ const MAX_LINE_CHARS = 256;
11
+ const cache = new Map();
12
+ /** 测试用:清空缓存 */
13
+ export function clearGitStatusCache() {
14
+ cache.clear();
15
+ }
16
+ function runGit(cwd, args) {
17
+ return new Promise((resolve, reject) => {
18
+ execFile('git', args, { cwd, timeout: GIT_TIMEOUT_MS }, (err, stdout) => {
19
+ if (err)
20
+ reject(err);
21
+ else
22
+ resolve(stdout);
23
+ });
24
+ });
25
+ }
26
+ /**
27
+ * 返回单行 git 摘要,如 `Git: main | 3M 1A 2? | ahead 1`;非 git 仓库或失败返回 null。
28
+ */
29
+ export async function getGitStatusLine(cwd) {
30
+ const now = Date.now();
31
+ const cached = cache.get(cwd);
32
+ if (cached && cached.expiresAt > now)
33
+ return cached.line;
34
+ let line = null;
35
+ try {
36
+ const inside = (await runGit(cwd, ['rev-parse', '--is-inside-work-tree'])).trim();
37
+ if (inside === 'true') {
38
+ // --branch 首行形如 `## main...origin/main [ahead 1]`;无提交时为 `## No commits yet on main`
39
+ const raw = await runGit(cwd, ['status', '--short', '--branch']);
40
+ const lines = raw.split('\n').filter(Boolean);
41
+ const header = lines[0]?.startsWith('##') ? lines.shift() : '';
42
+ const branch = header.replace(/^##\s*/, '').replace(/\.\.\..*$/, '').replace(/^No commits yet on /, '') || 'unknown';
43
+ const aheadBehind = header.match(/\[(ahead \d+|behind \d+|ahead \d+, behind \d+)\]/)?.[1];
44
+ const counts = new Map();
45
+ for (const entry of lines) {
46
+ const xy = entry.slice(0, 2);
47
+ if (xy === '??') {
48
+ counts.set('?', (counts.get('?') ?? 0) + 1);
49
+ continue;
50
+ }
51
+ for (const ch of xy) {
52
+ if (ch === ' ' || ch === '?')
53
+ continue;
54
+ counts.set(ch, (counts.get(ch) ?? 0) + 1);
55
+ }
56
+ }
57
+ const parts = [];
58
+ // 常见状态优先:M 修改、A 新增、D 删除、R 改名、? 未跟踪
59
+ for (const key of ['M', 'A', 'D', 'R', 'C', 'U', '?']) {
60
+ const n = counts.get(key);
61
+ if (n)
62
+ parts.push(`${n}${key}`);
63
+ }
64
+ line = `Git: ${branch}${parts.length ? ` | ${parts.join(' ')}` : ' | clean'}${aheadBehind ? ` | ${aheadBehind}` : ''}`;
65
+ if (line.length > MAX_LINE_CHARS)
66
+ line = line.slice(0, MAX_LINE_CHARS - 1) + '…';
67
+ }
68
+ }
69
+ catch {
70
+ line = null;
71
+ }
72
+ cache.set(cwd, { line, expiresAt: now + CACHE_TTL_MS });
73
+ return line;
74
+ }
75
+ //# sourceMappingURL=git-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-context.js","sourceRoot":"","sources":["../../src/prompt/git-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,MAAM,YAAY,GAAG,MAAM,CAAC;AAC5B,MAAM,cAAc,GAAG,GAAG,CAAC;AAO3B,MAAM,KAAK,GAAG,IAAI,GAAG,EAAsB,CAAC;AAE5C,eAAe;AACf,MAAM,UAAU,mBAAmB;IACjC,KAAK,CAAC,KAAK,EAAE,CAAC;AAChB,CAAC;AAED,SAAS,MAAM,CAAC,GAAW,EAAE,IAAc;IACzC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;YACtE,IAAI,GAAG;gBAAE,MAAM,CAAC,GAAG,CAAC,CAAC;;gBAChB,OAAO,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,GAAW;IAChD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,MAAM,IAAI,MAAM,CAAC,SAAS,GAAG,GAAG;QAAE,OAAO,MAAM,CAAC,IAAI,CAAC;IAEzD,IAAI,IAAI,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@
3
3
  */
4
4
  export { resolveWorkspacePrompt, clearWorkspacePromptCache, } from './workspace-prompt.js';
5
5
  export type { WorkspacePromptRole } from './workspace-prompt.js';
6
- export { FIXED_DISCIPLINE_RULES, contentToText, buildUserMessageWithHistory, buildEnhancedPersona, resolvePromptFileRole, buildContextHint, describePromptSectionsForDebug, buildRichSystemPrompt, buildRichSystemPromptWithBuilder, buildLiteSystemPromptWithPlatform, appendQuoteContextSystemHint, } from './system-prompt.js';
6
+ export { FIXED_DISCIPLINE_RULES, buildUserMessageWithHistory, describePromptSectionsForDebug, buildRichSystemPrompt, buildLiteSystemPromptWithPlatform, } from './system-prompt.js';
7
7
  export type { RichSystemPromptContext, PromptSectionDebugInfo } from './system-prompt.js';
8
- export { buildDisciplinedPrompt, describeAgentPathPromptSections, buildAgentPathSystemPrompt, buildFastPathSystemPrompt, buildChatPathSystemPrompt, buildMultimodalVisionSystemPrompt, buildAgentUserMessage, } from './assembly.js';
8
+ export type { AgentPromptProfile } from './turn-prompt-profile.js';
9
+ export { buildDisciplinedPrompt, describeAgentPathPromptSections, buildAgentPathSystemPrompt, buildChatPathSystemPrompt, buildMultimodalVisionSystemPrompt, buildAgentUserMessage, } from './assembly.js';
9
10
  export * from './prompt-builder.js';
10
11
  export * from './templates.js';
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompt/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,8BAA8B,EAC9B,qBAAqB,EACrB,gCAAgC,EAChC,iCAAiC,EACjC,4BAA4B,GAC7B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE1F,OAAO,EACL,sBAAsB,EACtB,+BAA+B,EAC/B,0BAA0B,EAC1B,yBAAyB,EACzB,yBAAyB,EACzB,iCAAiC,EACjC,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAEvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompt/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,8BAA8B,EAC9B,qBAAqB,EACrB,iCAAiC,GAClC,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC1F,YAAY,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EACL,sBAAsB,EACtB,+BAA+B,EAC/B,0BAA0B,EAC1B,yBAAyB,EACzB,iCAAiC,EACjC,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAEvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC"}
@@ -2,8 +2,8 @@
2
2
  * Prompt module — system prompt builders, assembly, workspace templates.
3
3
  */
4
4
  export { resolveWorkspacePrompt, clearWorkspacePromptCache, } from './workspace-prompt.js';
5
- export { FIXED_DISCIPLINE_RULES, contentToText, buildUserMessageWithHistory, buildEnhancedPersona, resolvePromptFileRole, buildContextHint, describePromptSectionsForDebug, buildRichSystemPrompt, buildRichSystemPromptWithBuilder, buildLiteSystemPromptWithPlatform, appendQuoteContextSystemHint, } from './system-prompt.js';
6
- export { buildDisciplinedPrompt, describeAgentPathPromptSections, buildAgentPathSystemPrompt, buildFastPathSystemPrompt, buildChatPathSystemPrompt, buildMultimodalVisionSystemPrompt, buildAgentUserMessage, } from './assembly.js';
5
+ export { FIXED_DISCIPLINE_RULES, buildUserMessageWithHistory, describePromptSectionsForDebug, buildRichSystemPrompt, buildLiteSystemPromptWithPlatform, } from './system-prompt.js';
6
+ export { buildDisciplinedPrompt, describeAgentPathPromptSections, buildAgentPathSystemPrompt, buildChatPathSystemPrompt, buildMultimodalVisionSystemPrompt, buildAgentUserMessage, } from './assembly.js';
7
7
  export * from './prompt-builder.js';
8
8
  export * from './templates.js';
9
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompt/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,8BAA8B,EAC9B,qBAAqB,EACrB,gCAAgC,EAChC,iCAAiC,EACjC,4BAA4B,GAC7B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,sBAAsB,EACtB,+BAA+B,EAC/B,0BAA0B,EAC1B,yBAAyB,EACzB,yBAAyB,EACzB,iCAAiC,EACjC,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAEvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompt/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,8BAA8B,EAC9B,qBAAqB,EACrB,iCAAiC,GAClC,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EACL,sBAAsB,EACtB,+BAA+B,EAC/B,0BAA0B,EAC1B,yBAAyB,EACzB,iCAAiC,EACjC,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAEvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type ModelPromptStrategy } from './model-prompt-strategy.js';
2
+ export declare class ModelAwarePromptBuilder {
3
+ readonly strategy: ModelPromptStrategy;
4
+ constructor(modelId?: string);
5
+ buildStyleSection(): string;
6
+ buildContextModeHint(contextWindow: number): string | null;
7
+ }
8
+ //# sourceMappingURL=model-aware-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-aware-builder.d.ts","sourceRoot":"","sources":["../../src/prompt/model-aware-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAA0C,MAAM,4BAA4B,CAAC;AAE9G,qBAAa,uBAAuB;IAClC,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;gBAE3B,OAAO,CAAC,EAAE,MAAM;IAI5B,iBAAiB,IAAI,MAAM;IAiC3B,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAqB3D"}
@@ -0,0 +1,61 @@
1
+ import { resolveModelStrategy, DEFAULT_STRATEGY } from './model-prompt-strategy.js';
2
+ export class ModelAwarePromptBuilder {
3
+ strategy;
4
+ constructor(modelId) {
5
+ this.strategy = modelId ? resolveModelStrategy(modelId) : DEFAULT_STRATEGY;
6
+ }
7
+ buildStyleSection() {
8
+ switch (this.strategy.style) {
9
+ case 'concise':
10
+ return [
11
+ '# Style',
12
+ ' - Direct and concise — match reply length to question complexity',
13
+ ' - Simple question = short answer; complex task = structured reply',
14
+ ' - No preamble ("Here\'s...", "I\'ll..."), no postamble ("Let me know...")',
15
+ ' - Focus on actions and results, not explanations',
16
+ ' - Match the user\'s language; follow SOUL.md for default language',
17
+ ].join('\n');
18
+ case 'detailed':
19
+ return [
20
+ '# Style',
21
+ ' - Lead with the answer or result',
22
+ ' - Be concise, direct, and useful',
23
+ ' - Use Markdown formatting (headings, lists, tables) for multi-part answers',
24
+ ' - Match reply length to complexity: 1 line for greetings, structured format for multi-step results',
25
+ ' - No preamble ("Here\'s...", "I\'ll..."), no postamble ("Let me know...")',
26
+ ' - Match the user\'s language; follow SOUL.md for default language',
27
+ ].join('\n');
28
+ default:
29
+ return [
30
+ '# Style',
31
+ ' - Lead with the answer or result',
32
+ ' - Be concise, direct, and useful — match reply length to question complexity',
33
+ ' - Use Markdown when helpful for structure',
34
+ ' - No preamble ("Here\'s...", "I\'ll..."), no postamble ("Let me know...")',
35
+ ' - Match the user\'s language; follow SOUL.md for default language',
36
+ ].join('\n');
37
+ }
38
+ }
39
+ buildContextModeHint(contextWindow) {
40
+ if (contextWindow >= 100000) {
41
+ return [
42
+ '# Long Context Mode',
43
+ ' - You have a large context window. Use it wisely.',
44
+ ' - Read entire files before editing when needed.',
45
+ ' - You can process multiple files in parallel.',
46
+ ' - Keep history context in mind when making decisions.',
47
+ ].join('\n');
48
+ }
49
+ if (contextWindow <= 16000) {
50
+ return [
51
+ '# Short Context Mode',
52
+ ' - Context is limited. Be efficient.',
53
+ ' - Read only the sections you need using offset/limit.',
54
+ ' - Avoid reading entire large files.',
55
+ ' - Summarize rather than quote when possible.',
56
+ ].join('\n');
57
+ }
58
+ return null;
59
+ }
60
+ }
61
+ //# sourceMappingURL=model-aware-builder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-aware-builder.js","sourceRoot":"","sources":["../../src/prompt/model-aware-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9G,MAAM,OAAO,uBAAuB;IACzB,QAAQ,CAAsB;IAEvC,YAAY,OAAgB;QAC1B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC;IAC7E,CAAC;IAED,iBAAiB;QACf,QAAQ,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YAC5B,KAAK,SAAS;gBACZ,OAAO;oBACL,SAAS;oBACT,mEAAmE;oBACnE,oEAAoE;oBACpE,4EAA4E;oBAC5E,mDAAmD;oBACnD,oEAAoE;iBACrE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACf,KAAK,UAAU;gBACb,OAAO;oBACL,SAAS;oBACT,mCAAmC;oBACnC,mCAAmC;oBACnC,6EAA6E;oBAC7E,qGAAqG;oBACrG,4EAA4E;oBAC5E,oEAAoE;iBACrE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACf;gBACE,OAAO;oBACL,SAAS;oBACT,mCAAmC;oBACnC,+EAA+E;oBAC/E,4CAA4C;oBAC5C,4EAA4E;oBAC5E,oEAAoE;iBACrE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC;IACH,CAAC;IAED,oBAAoB,CAAC,aAAqB;QACxC,IAAI,aAAa,IAAI,MAAM,EAAE,CAAC;YAC5B,OAAO;gBACL,qBAAqB;gBACrB,oDAAoD;gBACpD,kDAAkD;gBAClD,gDAAgD;gBAChD,wDAAwD;aACzD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACf,CAAC;QACD,IAAI,aAAa,IAAI,KAAK,EAAE,CAAC;YAC3B,OAAO;gBACL,sBAAsB;gBACtB,sCAAsC;gBACtC,wDAAwD;gBACxD,sCAAsC;gBACtC,+CAA+C;aAChD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACf,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ export interface ModelPromptStrategy {
2
+ readonly family: string;
3
+ readonly contextWindowThreshold: number;
4
+ readonly preferConcise: boolean;
5
+ readonly detailedToolInstructions: boolean;
6
+ readonly detailedSecurityRules: boolean;
7
+ readonly maxPromptChars: number;
8
+ readonly style: 'concise' | 'balanced' | 'detailed';
9
+ }
10
+ export declare const DEFAULT_STRATEGY: ModelPromptStrategy;
11
+ export declare function resolveModelStrategy(modelId: string): ModelPromptStrategy;
12
+ //# sourceMappingURL=model-prompt-strategy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-prompt-strategy.d.ts","sourceRoot":"","sources":["../../src/prompt/model-prompt-strategy.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;IACxC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,wBAAwB,EAAE,OAAO,CAAC;IAC3C,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAC;IACxC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;CACrD;AAED,eAAO,MAAM,gBAAgB,EAAE,mBAQ7B,CAAC;AA2JH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,CAQzE"}