@jini-ai/cms 0.1.0

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 (527) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +84 -0
  3. package/dist/content-types/agent-tools.d.ts +65 -0
  4. package/dist/content-types/agent-tools.d.ts.map +1 -0
  5. package/dist/content-types/agent-tools.js +172 -0
  6. package/dist/content-types/agent-tools.js.map +1 -0
  7. package/dist/content-types/cleanup.d.ts +118 -0
  8. package/dist/content-types/cleanup.d.ts.map +1 -0
  9. package/dist/content-types/cleanup.js +65 -0
  10. package/dist/content-types/cleanup.js.map +1 -0
  11. package/dist/content-types/errors.d.ts +90 -0
  12. package/dist/content-types/errors.d.ts.map +1 -0
  13. package/dist/content-types/errors.js +119 -0
  14. package/dist/content-types/errors.js.map +1 -0
  15. package/dist/content-types/field-defs.d.ts +25 -0
  16. package/dist/content-types/field-defs.d.ts.map +1 -0
  17. package/dist/content-types/field-defs.js +155 -0
  18. package/dist/content-types/field-defs.js.map +1 -0
  19. package/dist/content-types/index-provisioning.d.ts +94 -0
  20. package/dist/content-types/index-provisioning.d.ts.map +1 -0
  21. package/dist/content-types/index-provisioning.js +133 -0
  22. package/dist/content-types/index-provisioning.js.map +1 -0
  23. package/dist/content-types/index.d.ts +63 -0
  24. package/dist/content-types/index.d.ts.map +1 -0
  25. package/dist/content-types/index.js +36 -0
  26. package/dist/content-types/index.js.map +1 -0
  27. package/dist/content-types/lifecycle-dispatch.d.ts +38 -0
  28. package/dist/content-types/lifecycle-dispatch.d.ts.map +1 -0
  29. package/dist/content-types/lifecycle-dispatch.js +28 -0
  30. package/dist/content-types/lifecycle-dispatch.js.map +1 -0
  31. package/dist/content-types/lifecycle.d.ts +104 -0
  32. package/dist/content-types/lifecycle.d.ts.map +1 -0
  33. package/dist/content-types/lifecycle.js +143 -0
  34. package/dist/content-types/lifecycle.js.map +1 -0
  35. package/dist/content-types/list.d.ts +44 -0
  36. package/dist/content-types/list.d.ts.map +1 -0
  37. package/dist/content-types/list.js +13 -0
  38. package/dist/content-types/list.js.map +1 -0
  39. package/dist/content-types/repo.memory.d.ts +72 -0
  40. package/dist/content-types/repo.memory.d.ts.map +1 -0
  41. package/dist/content-types/repo.memory.js +71 -0
  42. package/dist/content-types/repo.memory.js.map +1 -0
  43. package/dist/content-types/tool-registrations.d.ts +65 -0
  44. package/dist/content-types/tool-registrations.d.ts.map +1 -0
  45. package/dist/content-types/tool-registrations.js +180 -0
  46. package/dist/content-types/tool-registrations.js.map +1 -0
  47. package/dist/content-types/types.d.ts +78 -0
  48. package/dist/content-types/types.d.ts.map +1 -0
  49. package/dist/content-types/types.js +32 -0
  50. package/dist/content-types/types.js.map +1 -0
  51. package/dist/content-types/write-service.d.ts +141 -0
  52. package/dist/content-types/write-service.d.ts.map +1 -0
  53. package/dist/content-types/write-service.js +180 -0
  54. package/dist/content-types/write-service.js.map +1 -0
  55. package/dist/core/commands/change-set.d.ts +98 -0
  56. package/dist/core/commands/change-set.d.ts.map +1 -0
  57. package/dist/core/commands/change-set.js +2 -0
  58. package/dist/core/commands/change-set.js.map +1 -0
  59. package/dist/core/commands/command.d.ts +168 -0
  60. package/dist/core/commands/command.d.ts.map +1 -0
  61. package/dist/core/commands/command.js +173 -0
  62. package/dist/core/commands/command.js.map +1 -0
  63. package/dist/core/index.d.ts +45 -0
  64. package/dist/core/index.d.ts.map +1 -0
  65. package/dist/core/index.js +43 -0
  66. package/dist/core/index.js.map +1 -0
  67. package/dist/core/ports.d.ts +139 -0
  68. package/dist/core/ports.d.ts.map +1 -0
  69. package/dist/core/ports.js +2 -0
  70. package/dist/core/ports.js.map +1 -0
  71. package/dist/core/tools/registration-kit.d.ts +308 -0
  72. package/dist/core/tools/registration-kit.d.ts.map +1 -0
  73. package/dist/core/tools/registration-kit.js +381 -0
  74. package/dist/core/tools/registration-kit.js.map +1 -0
  75. package/dist/entries/agent-tools.d.ts +78 -0
  76. package/dist/entries/agent-tools.d.ts.map +1 -0
  77. package/dist/entries/agent-tools.js +158 -0
  78. package/dist/entries/agent-tools.js.map +1 -0
  79. package/dist/entries/errors.d.ts +43 -0
  80. package/dist/entries/errors.d.ts.map +1 -0
  81. package/dist/entries/errors.js +59 -0
  82. package/dist/entries/errors.js.map +1 -0
  83. package/dist/entries/field-validation.d.ts +70 -0
  84. package/dist/entries/field-validation.d.ts.map +1 -0
  85. package/dist/entries/field-validation.js +87 -0
  86. package/dist/entries/field-validation.js.map +1 -0
  87. package/dist/entries/index.d.ts +55 -0
  88. package/dist/entries/index.d.ts.map +1 -0
  89. package/dist/entries/index.js +38 -0
  90. package/dist/entries/index.js.map +1 -0
  91. package/dist/entries/lifecycle-dispatch.d.ts +15 -0
  92. package/dist/entries/lifecycle-dispatch.d.ts.map +1 -0
  93. package/dist/entries/lifecycle-dispatch.js +16 -0
  94. package/dist/entries/lifecycle-dispatch.js.map +1 -0
  95. package/dist/entries/list.d.ts +47 -0
  96. package/dist/entries/list.d.ts.map +1 -0
  97. package/dist/entries/list.js +12 -0
  98. package/dist/entries/list.js.map +1 -0
  99. package/dist/entries/repo.memory.d.ts +64 -0
  100. package/dist/entries/repo.memory.d.ts.map +1 -0
  101. package/dist/entries/repo.memory.js +73 -0
  102. package/dist/entries/repo.memory.js.map +1 -0
  103. package/dist/entries/tool-registrations.d.ts +52 -0
  104. package/dist/entries/tool-registrations.d.ts.map +1 -0
  105. package/dist/entries/tool-registrations.js +141 -0
  106. package/dist/entries/tool-registrations.js.map +1 -0
  107. package/dist/entries/types.d.ts +55 -0
  108. package/dist/entries/types.d.ts.map +1 -0
  109. package/dist/entries/types.js +2 -0
  110. package/dist/entries/types.js.map +1 -0
  111. package/dist/entries/write-service.d.ts +202 -0
  112. package/dist/entries/write-service.d.ts.map +1 -0
  113. package/dist/entries/write-service.js +204 -0
  114. package/dist/entries/write-service.js.map +1 -0
  115. package/dist/identity/admin-crud-service.d.ts +252 -0
  116. package/dist/identity/admin-crud-service.d.ts.map +1 -0
  117. package/dist/identity/admin-crud-service.js +437 -0
  118. package/dist/identity/admin-crud-service.js.map +1 -0
  119. package/dist/identity/agent-tool-input.d.ts +58 -0
  120. package/dist/identity/agent-tool-input.d.ts.map +1 -0
  121. package/dist/identity/agent-tool-input.js +126 -0
  122. package/dist/identity/agent-tool-input.js.map +1 -0
  123. package/dist/identity/agent-tools.d.ts +101 -0
  124. package/dist/identity/agent-tools.d.ts.map +1 -0
  125. package/dist/identity/agent-tools.js +290 -0
  126. package/dist/identity/agent-tools.js.map +1 -0
  127. package/dist/identity/auth-service.d.ts +87 -0
  128. package/dist/identity/auth-service.d.ts.map +1 -0
  129. package/dist/identity/auth-service.js +141 -0
  130. package/dist/identity/auth-service.js.map +1 -0
  131. package/dist/identity/authorize.d.ts +90 -0
  132. package/dist/identity/authorize.d.ts.map +1 -0
  133. package/dist/identity/authorize.js +94 -0
  134. package/dist/identity/authorize.js.map +1 -0
  135. package/dist/identity/grant-service.d.ts +198 -0
  136. package/dist/identity/grant-service.d.ts.map +1 -0
  137. package/dist/identity/grant-service.js +361 -0
  138. package/dist/identity/grant-service.js.map +1 -0
  139. package/dist/identity/hasher.d.ts +39 -0
  140. package/dist/identity/hasher.d.ts.map +1 -0
  141. package/dist/identity/hasher.js +39 -0
  142. package/dist/identity/hasher.js.map +1 -0
  143. package/dist/identity/index.d.ts +59 -0
  144. package/dist/identity/index.d.ts.map +1 -0
  145. package/dist/identity/index.js +51 -0
  146. package/dist/identity/index.js.map +1 -0
  147. package/dist/identity/password-policy.d.ts +58 -0
  148. package/dist/identity/password-policy.d.ts.map +1 -0
  149. package/dist/identity/password-policy.js +67 -0
  150. package/dist/identity/password-policy.js.map +1 -0
  151. package/dist/identity/permission-migrations.d.ts +86 -0
  152. package/dist/identity/permission-migrations.d.ts.map +1 -0
  153. package/dist/identity/permission-migrations.js +67 -0
  154. package/dist/identity/permission-migrations.js.map +1 -0
  155. package/dist/identity/permissions.d.ts +35 -0
  156. package/dist/identity/permissions.d.ts.map +1 -0
  157. package/dist/identity/permissions.js +603 -0
  158. package/dist/identity/permissions.js.map +1 -0
  159. package/dist/identity/ports.d.ts +201 -0
  160. package/dist/identity/ports.d.ts.map +1 -0
  161. package/dist/identity/ports.js +2 -0
  162. package/dist/identity/ports.js.map +1 -0
  163. package/dist/identity/repo.memory.d.ts +164 -0
  164. package/dist/identity/repo.memory.d.ts.map +1 -0
  165. package/dist/identity/repo.memory.js +224 -0
  166. package/dist/identity/repo.memory.js.map +1 -0
  167. package/dist/identity/seed.d.ts +42 -0
  168. package/dist/identity/seed.d.ts.map +1 -0
  169. package/dist/identity/seed.js +277 -0
  170. package/dist/identity/seed.js.map +1 -0
  171. package/dist/identity/tool-registrations.d.ts +50 -0
  172. package/dist/identity/tool-registrations.d.ts.map +1 -0
  173. package/dist/identity/tool-registrations.js +419 -0
  174. package/dist/identity/tool-registrations.js.map +1 -0
  175. package/dist/identity/types.d.ts +185 -0
  176. package/dist/identity/types.d.ts.map +1 -0
  177. package/dist/identity/types.js +64 -0
  178. package/dist/identity/types.js.map +1 -0
  179. package/dist/identity/username.d.ts +12 -0
  180. package/dist/identity/username.d.ts.map +1 -0
  181. package/dist/identity/username.js +14 -0
  182. package/dist/identity/username.js.map +1 -0
  183. package/dist/media/agent-tools.d.ts +66 -0
  184. package/dist/media/agent-tools.d.ts.map +1 -0
  185. package/dist/media/agent-tools.js +131 -0
  186. package/dist/media/agent-tools.js.map +1 -0
  187. package/dist/media/blob-gc-lock.d.ts +37 -0
  188. package/dist/media/blob-gc-lock.d.ts.map +1 -0
  189. package/dist/media/blob-gc-lock.js +55 -0
  190. package/dist/media/blob-gc-lock.js.map +1 -0
  191. package/dist/media/blob-gc.d.ts +246 -0
  192. package/dist/media/blob-gc.d.ts.map +1 -0
  193. package/dist/media/blob-gc.js +254 -0
  194. package/dist/media/blob-gc.js.map +1 -0
  195. package/dist/media/blob-key.d.ts +28 -0
  196. package/dist/media/blob-key.d.ts.map +1 -0
  197. package/dist/media/blob-key.js +11 -0
  198. package/dist/media/blob-key.js.map +1 -0
  199. package/dist/media/blob-store.fs.d.ts +23 -0
  200. package/dist/media/blob-store.fs.d.ts.map +1 -0
  201. package/dist/media/blob-store.fs.js +48 -0
  202. package/dist/media/blob-store.fs.js.map +1 -0
  203. package/dist/media/blob-store.memory.d.ts +22 -0
  204. package/dist/media/blob-store.memory.d.ts.map +1 -0
  205. package/dist/media/blob-store.memory.js +23 -0
  206. package/dist/media/blob-store.memory.js.map +1 -0
  207. package/dist/media/content-type-sniffer.d.ts +49 -0
  208. package/dist/media/content-type-sniffer.d.ts.map +1 -0
  209. package/dist/media/content-type-sniffer.js +141 -0
  210. package/dist/media/content-type-sniffer.js.map +1 -0
  211. package/dist/media/image-transformer.d.ts +45 -0
  212. package/dist/media/image-transformer.d.ts.map +1 -0
  213. package/dist/media/image-transformer.js +23 -0
  214. package/dist/media/image-transformer.js.map +1 -0
  215. package/dist/media/image-transformer.sharp.d.ts +26 -0
  216. package/dist/media/image-transformer.sharp.d.ts.map +1 -0
  217. package/dist/media/image-transformer.sharp.js +91 -0
  218. package/dist/media/image-transformer.sharp.js.map +1 -0
  219. package/dist/media/index.d.ts +43 -0
  220. package/dist/media/index.d.ts.map +1 -0
  221. package/dist/media/index.js +31 -0
  222. package/dist/media/index.js.map +1 -0
  223. package/dist/media/media-service.d.ts +244 -0
  224. package/dist/media/media-service.d.ts.map +1 -0
  225. package/dist/media/media-service.js +345 -0
  226. package/dist/media/media-service.js.map +1 -0
  227. package/dist/media/ports.d.ts +142 -0
  228. package/dist/media/ports.d.ts.map +1 -0
  229. package/dist/media/ports.js +2 -0
  230. package/dist/media/ports.js.map +1 -0
  231. package/dist/media/rendition-service.d.ts +66 -0
  232. package/dist/media/rendition-service.d.ts.map +1 -0
  233. package/dist/media/rendition-service.js +135 -0
  234. package/dist/media/rendition-service.js.map +1 -0
  235. package/dist/media/repo.memory.d.ts +107 -0
  236. package/dist/media/repo.memory.d.ts.map +1 -0
  237. package/dist/media/repo.memory.js +131 -0
  238. package/dist/media/repo.memory.js.map +1 -0
  239. package/dist/media/tool-registrations.d.ts +42 -0
  240. package/dist/media/tool-registrations.d.ts.map +1 -0
  241. package/dist/media/tool-registrations.js +121 -0
  242. package/dist/media/tool-registrations.js.map +1 -0
  243. package/dist/media/transform-lock.d.ts +36 -0
  244. package/dist/media/transform-lock.d.ts.map +1 -0
  245. package/dist/media/transform-lock.js +50 -0
  246. package/dist/media/transform-lock.js.map +1 -0
  247. package/dist/media/transform-registry.d.ts +103 -0
  248. package/dist/media/transform-registry.d.ts.map +1 -0
  249. package/dist/media/transform-registry.js +87 -0
  250. package/dist/media/transform-registry.js.map +1 -0
  251. package/dist/media/transform-types.d.ts +82 -0
  252. package/dist/media/transform-types.d.ts.map +1 -0
  253. package/dist/media/transform-types.js +47 -0
  254. package/dist/media/transform-types.js.map +1 -0
  255. package/dist/media/types.d.ts +150 -0
  256. package/dist/media/types.d.ts.map +1 -0
  257. package/dist/media/types.js +26 -0
  258. package/dist/media/types.js.map +1 -0
  259. package/dist/navigation/agent-tools.d.ts +90 -0
  260. package/dist/navigation/agent-tools.d.ts.map +1 -0
  261. package/dist/navigation/agent-tools.js +225 -0
  262. package/dist/navigation/agent-tools.js.map +1 -0
  263. package/dist/navigation/contracts.d.ts +98 -0
  264. package/dist/navigation/contracts.d.ts.map +1 -0
  265. package/dist/navigation/contracts.js +70 -0
  266. package/dist/navigation/contracts.js.map +1 -0
  267. package/dist/navigation/index.d.ts +39 -0
  268. package/dist/navigation/index.d.ts.map +1 -0
  269. package/dist/navigation/index.js +30 -0
  270. package/dist/navigation/index.js.map +1 -0
  271. package/dist/navigation/menu-service.d.ts +256 -0
  272. package/dist/navigation/menu-service.d.ts.map +1 -0
  273. package/dist/navigation/menu-service.js +382 -0
  274. package/dist/navigation/menu-service.js.map +1 -0
  275. package/dist/navigation/ports.d.ts +147 -0
  276. package/dist/navigation/ports.d.ts.map +1 -0
  277. package/dist/navigation/ports.js +2 -0
  278. package/dist/navigation/ports.js.map +1 -0
  279. package/dist/navigation/read-model.d.ts +11 -0
  280. package/dist/navigation/read-model.d.ts.map +1 -0
  281. package/dist/navigation/read-model.js +27 -0
  282. package/dist/navigation/read-model.js.map +1 -0
  283. package/dist/navigation/reconcile.d.ts +57 -0
  284. package/dist/navigation/reconcile.d.ts.map +1 -0
  285. package/dist/navigation/reconcile.js +33 -0
  286. package/dist/navigation/reconcile.js.map +1 -0
  287. package/dist/navigation/repo.memory.d.ts +137 -0
  288. package/dist/navigation/repo.memory.d.ts.map +1 -0
  289. package/dist/navigation/repo.memory.js +95 -0
  290. package/dist/navigation/repo.memory.js.map +1 -0
  291. package/dist/navigation/resolver.d.ts +110 -0
  292. package/dist/navigation/resolver.d.ts.map +1 -0
  293. package/dist/navigation/resolver.js +131 -0
  294. package/dist/navigation/resolver.js.map +1 -0
  295. package/dist/navigation/tool-registrations.d.ts +43 -0
  296. package/dist/navigation/tool-registrations.d.ts.map +1 -0
  297. package/dist/navigation/tool-registrations.js +126 -0
  298. package/dist/navigation/tool-registrations.js.map +1 -0
  299. package/dist/navigation/types.d.ts +207 -0
  300. package/dist/navigation/types.d.ts.map +1 -0
  301. package/dist/navigation/types.js +14 -0
  302. package/dist/navigation/types.js.map +1 -0
  303. package/dist/presentation/index.d.ts +15 -0
  304. package/dist/presentation/index.d.ts.map +1 -0
  305. package/dist/presentation/index.js +15 -0
  306. package/dist/presentation/index.js.map +1 -0
  307. package/dist/presentation/presentation.d.ts +72 -0
  308. package/dist/presentation/presentation.d.ts.map +1 -0
  309. package/dist/presentation/presentation.js +51 -0
  310. package/dist/presentation/presentation.js.map +1 -0
  311. package/dist/presentation/repo.memory.d.ts +9 -0
  312. package/dist/presentation/repo.memory.d.ts.map +1 -0
  313. package/dist/presentation/repo.memory.js +21 -0
  314. package/dist/presentation/repo.memory.js.map +1 -0
  315. package/dist/server/index.d.ts +28 -0
  316. package/dist/server/index.d.ts.map +1 -0
  317. package/dist/server/index.js +28 -0
  318. package/dist/server/index.js.map +1 -0
  319. package/dist/settings/agent-tools.d.ts +83 -0
  320. package/dist/settings/agent-tools.d.ts.map +1 -0
  321. package/dist/settings/agent-tools.js +200 -0
  322. package/dist/settings/agent-tools.js.map +1 -0
  323. package/dist/settings/agent-writable-preferences.d.ts +67 -0
  324. package/dist/settings/agent-writable-preferences.d.ts.map +1 -0
  325. package/dist/settings/agent-writable-preferences.js +144 -0
  326. package/dist/settings/agent-writable-preferences.js.map +1 -0
  327. package/dist/settings/change-feed.d.ts +74 -0
  328. package/dist/settings/change-feed.d.ts.map +1 -0
  329. package/dist/settings/change-feed.js +61 -0
  330. package/dist/settings/change-feed.js.map +1 -0
  331. package/dist/settings/definitions-dispatch.d.ts +51 -0
  332. package/dist/settings/definitions-dispatch.d.ts.map +1 -0
  333. package/dist/settings/definitions-dispatch.js +86 -0
  334. package/dist/settings/definitions-dispatch.js.map +1 -0
  335. package/dist/settings/dictionaries/index.d.ts +45 -0
  336. package/dist/settings/dictionaries/index.d.ts.map +1 -0
  337. package/dist/settings/dictionaries/index.js +69 -0
  338. package/dist/settings/dictionaries/index.js.map +1 -0
  339. package/dist/settings/dictionaries/settings-dialog.ar.d.ts +3 -0
  340. package/dist/settings/dictionaries/settings-dialog.ar.d.ts.map +1 -0
  341. package/dist/settings/dictionaries/settings-dialog.ar.js +28 -0
  342. package/dist/settings/dictionaries/settings-dialog.ar.js.map +1 -0
  343. package/dist/settings/dictionaries/settings-dialog.bn.d.ts +3 -0
  344. package/dist/settings/dictionaries/settings-dialog.bn.d.ts.map +1 -0
  345. package/dist/settings/dictionaries/settings-dialog.bn.js +28 -0
  346. package/dist/settings/dictionaries/settings-dialog.bn.js.map +1 -0
  347. package/dist/settings/dictionaries/settings-dialog.de.d.ts +3 -0
  348. package/dist/settings/dictionaries/settings-dialog.de.d.ts.map +1 -0
  349. package/dist/settings/dictionaries/settings-dialog.de.js +28 -0
  350. package/dist/settings/dictionaries/settings-dialog.de.js.map +1 -0
  351. package/dist/settings/dictionaries/settings-dialog.es.d.ts +3 -0
  352. package/dist/settings/dictionaries/settings-dialog.es.d.ts.map +1 -0
  353. package/dist/settings/dictionaries/settings-dialog.es.js +28 -0
  354. package/dist/settings/dictionaries/settings-dialog.es.js.map +1 -0
  355. package/dist/settings/dictionaries/settings-dialog.fa.d.ts +3 -0
  356. package/dist/settings/dictionaries/settings-dialog.fa.d.ts.map +1 -0
  357. package/dist/settings/dictionaries/settings-dialog.fa.js +28 -0
  358. package/dist/settings/dictionaries/settings-dialog.fa.js.map +1 -0
  359. package/dist/settings/dictionaries/settings-dialog.fr.d.ts +3 -0
  360. package/dist/settings/dictionaries/settings-dialog.fr.d.ts.map +1 -0
  361. package/dist/settings/dictionaries/settings-dialog.fr.js +28 -0
  362. package/dist/settings/dictionaries/settings-dialog.fr.js.map +1 -0
  363. package/dist/settings/dictionaries/settings-dialog.hi.d.ts +3 -0
  364. package/dist/settings/dictionaries/settings-dialog.hi.d.ts.map +1 -0
  365. package/dist/settings/dictionaries/settings-dialog.hi.js +28 -0
  366. package/dist/settings/dictionaries/settings-dialog.hi.js.map +1 -0
  367. package/dist/settings/dictionaries/settings-dialog.hu.d.ts +3 -0
  368. package/dist/settings/dictionaries/settings-dialog.hu.d.ts.map +1 -0
  369. package/dist/settings/dictionaries/settings-dialog.hu.js +28 -0
  370. package/dist/settings/dictionaries/settings-dialog.hu.js.map +1 -0
  371. package/dist/settings/dictionaries/settings-dialog.id.d.ts +3 -0
  372. package/dist/settings/dictionaries/settings-dialog.id.d.ts.map +1 -0
  373. package/dist/settings/dictionaries/settings-dialog.id.js +28 -0
  374. package/dist/settings/dictionaries/settings-dialog.id.js.map +1 -0
  375. package/dist/settings/dictionaries/settings-dialog.it.d.ts +3 -0
  376. package/dist/settings/dictionaries/settings-dialog.it.d.ts.map +1 -0
  377. package/dist/settings/dictionaries/settings-dialog.it.js +28 -0
  378. package/dist/settings/dictionaries/settings-dialog.it.js.map +1 -0
  379. package/dist/settings/dictionaries/settings-dialog.ja.d.ts +3 -0
  380. package/dist/settings/dictionaries/settings-dialog.ja.d.ts.map +1 -0
  381. package/dist/settings/dictionaries/settings-dialog.ja.js +28 -0
  382. package/dist/settings/dictionaries/settings-dialog.ja.js.map +1 -0
  383. package/dist/settings/dictionaries/settings-dialog.ko.d.ts +3 -0
  384. package/dist/settings/dictionaries/settings-dialog.ko.d.ts.map +1 -0
  385. package/dist/settings/dictionaries/settings-dialog.ko.js +28 -0
  386. package/dist/settings/dictionaries/settings-dialog.ko.js.map +1 -0
  387. package/dist/settings/dictionaries/settings-dialog.pl.d.ts +3 -0
  388. package/dist/settings/dictionaries/settings-dialog.pl.d.ts.map +1 -0
  389. package/dist/settings/dictionaries/settings-dialog.pl.js +28 -0
  390. package/dist/settings/dictionaries/settings-dialog.pl.js.map +1 -0
  391. package/dist/settings/dictionaries/settings-dialog.pt-BR.d.ts +3 -0
  392. package/dist/settings/dictionaries/settings-dialog.pt-BR.d.ts.map +1 -0
  393. package/dist/settings/dictionaries/settings-dialog.pt-BR.js +28 -0
  394. package/dist/settings/dictionaries/settings-dialog.pt-BR.js.map +1 -0
  395. package/dist/settings/dictionaries/settings-dialog.ru.d.ts +3 -0
  396. package/dist/settings/dictionaries/settings-dialog.ru.d.ts.map +1 -0
  397. package/dist/settings/dictionaries/settings-dialog.ru.js +28 -0
  398. package/dist/settings/dictionaries/settings-dialog.ru.js.map +1 -0
  399. package/dist/settings/dictionaries/settings-dialog.th.d.ts +3 -0
  400. package/dist/settings/dictionaries/settings-dialog.th.d.ts.map +1 -0
  401. package/dist/settings/dictionaries/settings-dialog.th.js +28 -0
  402. package/dist/settings/dictionaries/settings-dialog.th.js.map +1 -0
  403. package/dist/settings/dictionaries/settings-dialog.tr.d.ts +3 -0
  404. package/dist/settings/dictionaries/settings-dialog.tr.d.ts.map +1 -0
  405. package/dist/settings/dictionaries/settings-dialog.tr.js +28 -0
  406. package/dist/settings/dictionaries/settings-dialog.tr.js.map +1 -0
  407. package/dist/settings/dictionaries/settings-dialog.uk.d.ts +3 -0
  408. package/dist/settings/dictionaries/settings-dialog.uk.d.ts.map +1 -0
  409. package/dist/settings/dictionaries/settings-dialog.uk.js +28 -0
  410. package/dist/settings/dictionaries/settings-dialog.uk.js.map +1 -0
  411. package/dist/settings/dictionaries/settings-dialog.ur.d.ts +3 -0
  412. package/dist/settings/dictionaries/settings-dialog.ur.d.ts.map +1 -0
  413. package/dist/settings/dictionaries/settings-dialog.ur.js +28 -0
  414. package/dist/settings/dictionaries/settings-dialog.ur.js.map +1 -0
  415. package/dist/settings/dictionaries/settings-dialog.zh-CN.d.ts +3 -0
  416. package/dist/settings/dictionaries/settings-dialog.zh-CN.d.ts.map +1 -0
  417. package/dist/settings/dictionaries/settings-dialog.zh-CN.js +28 -0
  418. package/dist/settings/dictionaries/settings-dialog.zh-CN.js.map +1 -0
  419. package/dist/settings/dictionaries/settings-dialog.zh-TW.d.ts +3 -0
  420. package/dist/settings/dictionaries/settings-dialog.zh-TW.d.ts.map +1 -0
  421. package/dist/settings/dictionaries/settings-dialog.zh-TW.js +28 -0
  422. package/dist/settings/dictionaries/settings-dialog.zh-TW.js.map +1 -0
  423. package/dist/settings/ensure-definitions.d.ts +88 -0
  424. package/dist/settings/ensure-definitions.d.ts.map +1 -0
  425. package/dist/settings/ensure-definitions.js +91 -0
  426. package/dist/settings/ensure-definitions.js.map +1 -0
  427. package/dist/settings/errors.d.ts +36 -0
  428. package/dist/settings/errors.d.ts.map +1 -0
  429. package/dist/settings/errors.js +40 -0
  430. package/dist/settings/errors.js.map +1 -0
  431. package/dist/settings/index.d.ts +37 -0
  432. package/dist/settings/index.d.ts.map +1 -0
  433. package/dist/settings/index.js +36 -0
  434. package/dist/settings/index.js.map +1 -0
  435. package/dist/settings/ports.d.ts +117 -0
  436. package/dist/settings/ports.d.ts.map +1 -0
  437. package/dist/settings/ports.js +2 -0
  438. package/dist/settings/ports.js.map +1 -0
  439. package/dist/settings/purge-service.d.ts +53 -0
  440. package/dist/settings/purge-service.d.ts.map +1 -0
  441. package/dist/settings/purge-service.js +105 -0
  442. package/dist/settings/purge-service.js.map +1 -0
  443. package/dist/settings/repo.memory.d.ts +119 -0
  444. package/dist/settings/repo.memory.d.ts.map +1 -0
  445. package/dist/settings/repo.memory.js +199 -0
  446. package/dist/settings/repo.memory.js.map +1 -0
  447. package/dist/settings/settings.d.ts +124 -0
  448. package/dist/settings/settings.d.ts.map +1 -0
  449. package/dist/settings/settings.js +238 -0
  450. package/dist/settings/settings.js.map +1 -0
  451. package/dist/settings/tool-registrations.d.ts +56 -0
  452. package/dist/settings/tool-registrations.d.ts.map +1 -0
  453. package/dist/settings/tool-registrations.js +240 -0
  454. package/dist/settings/tool-registrations.js.map +1 -0
  455. package/dist/settings/types.d.ts +125 -0
  456. package/dist/settings/types.d.ts.map +1 -0
  457. package/dist/settings/types.js +3 -0
  458. package/dist/settings/types.js.map +1 -0
  459. package/dist/settings/ui-tab-definitions.d.ts +41 -0
  460. package/dist/settings/ui-tab-definitions.d.ts.map +1 -0
  461. package/dist/settings/ui-tab-definitions.js +148 -0
  462. package/dist/settings/ui-tab-definitions.js.map +1 -0
  463. package/dist/settings/write-service.d.ts +314 -0
  464. package/dist/settings/write-service.d.ts.map +1 -0
  465. package/dist/settings/write-service.js +677 -0
  466. package/dist/settings/write-service.js.map +1 -0
  467. package/dist/taxonomy/agent-tools.d.ts +76 -0
  468. package/dist/taxonomy/agent-tools.d.ts.map +1 -0
  469. package/dist/taxonomy/agent-tools.js +178 -0
  470. package/dist/taxonomy/agent-tools.js.map +1 -0
  471. package/dist/taxonomy/content-lookup.d.ts +45 -0
  472. package/dist/taxonomy/content-lookup.d.ts.map +1 -0
  473. package/dist/taxonomy/content-lookup.js +9 -0
  474. package/dist/taxonomy/content-lookup.js.map +1 -0
  475. package/dist/taxonomy/index.d.ts +38 -0
  476. package/dist/taxonomy/index.d.ts.map +1 -0
  477. package/dist/taxonomy/index.js +38 -0
  478. package/dist/taxonomy/index.js.map +1 -0
  479. package/dist/taxonomy/list.d.ts +39 -0
  480. package/dist/taxonomy/list.d.ts.map +1 -0
  481. package/dist/taxonomy/list.js +19 -0
  482. package/dist/taxonomy/list.js.map +1 -0
  483. package/dist/taxonomy/merge-term.d.ts +94 -0
  484. package/dist/taxonomy/merge-term.d.ts.map +1 -0
  485. package/dist/taxonomy/merge-term.js +65 -0
  486. package/dist/taxonomy/merge-term.js.map +1 -0
  487. package/dist/taxonomy/repo.memory.d.ts +160 -0
  488. package/dist/taxonomy/repo.memory.d.ts.map +1 -0
  489. package/dist/taxonomy/repo.memory.js +171 -0
  490. package/dist/taxonomy/repo.memory.js.map +1 -0
  491. package/dist/taxonomy/validation-chain.d.ts +114 -0
  492. package/dist/taxonomy/validation-chain.d.ts.map +1 -0
  493. package/dist/taxonomy/validation-chain.js +152 -0
  494. package/dist/taxonomy/validation-chain.js.map +1 -0
  495. package/dist/taxonomy/write-service.d.ts +387 -0
  496. package/dist/taxonomy/write-service.d.ts.map +1 -0
  497. package/dist/taxonomy/write-service.js +350 -0
  498. package/dist/taxonomy/write-service.js.map +1 -0
  499. package/dist/workspace/agent-tools.d.ts +67 -0
  500. package/dist/workspace/agent-tools.d.ts.map +1 -0
  501. package/dist/workspace/agent-tools.js +103 -0
  502. package/dist/workspace/agent-tools.js.map +1 -0
  503. package/dist/workspace/create.d.ts +116 -0
  504. package/dist/workspace/create.d.ts.map +1 -0
  505. package/dist/workspace/create.js +69 -0
  506. package/dist/workspace/create.js.map +1 -0
  507. package/dist/workspace/delete.d.ts +50 -0
  508. package/dist/workspace/delete.d.ts.map +1 -0
  509. package/dist/workspace/delete.js +24 -0
  510. package/dist/workspace/delete.js.map +1 -0
  511. package/dist/workspace/index.d.ts +27 -0
  512. package/dist/workspace/index.d.ts.map +1 -0
  513. package/dist/workspace/index.js +27 -0
  514. package/dist/workspace/index.js.map +1 -0
  515. package/dist/workspace/repo.memory.d.ts +34 -0
  516. package/dist/workspace/repo.memory.d.ts.map +1 -0
  517. package/dist/workspace/repo.memory.js +50 -0
  518. package/dist/workspace/repo.memory.js.map +1 -0
  519. package/dist/workspace/tool-registrations.d.ts +38 -0
  520. package/dist/workspace/tool-registrations.d.ts.map +1 -0
  521. package/dist/workspace/tool-registrations.js +71 -0
  522. package/dist/workspace/tool-registrations.js.map +1 -0
  523. package/dist/workspace/update.d.ts +52 -0
  524. package/dist/workspace/update.d.ts.map +1 -0
  525. package/dist/workspace/update.js +41 -0
  526. package/dist/workspace/update.js.map +1 -0
  527. package/package.json +149 -0
@@ -0,0 +1,381 @@
1
+ /**
2
+ * @file The cross-domain half of the agent-tool wiring split: everything a domain's own
3
+ * `tool-registrations.ts` needs that is NOT specific to that domain.
4
+ *
5
+ * Why this file exists at all. Every domain's wiring repeats the same five moves — index its
6
+ * catalog by id, read a handful of fields off `ctx.input`, run the tool's permission check,
7
+ * decorate a shape rejection with the published schema, and then loop the handler map into
8
+ * `ToolRegistration`s behind a build-time risk/schema gate. Those five moves were previously copied
9
+ * per domain inside one shared `assistant/tool-registrations.ts`, which is exactly why that file
10
+ * grew past 2000 lines and why three independent domain slices could not be developed in parallel
11
+ * without colliding on it. Each domain now owns a `tool-registrations.ts` next to its own code and
12
+ * imports the shared moves from here; `assistant/tool-registrations.ts` is reduced to the
13
+ * aggregator that assembles them.
14
+ *
15
+ * The membership test for anything in this file is "would a fourth, not-yet-written domain need
16
+ * it?". Domain-shaped things deliberately stay out: each domain's model-facing `to*View`
17
+ * projections, its dependency-bag builder, its own `DERIVED_RISK_BY_TOOL_ID` slice (a claim about
18
+ * that domain's handlers, so it is maintained where those handlers live), and its unwired-tool set.
19
+ *
20
+ * What is deliberately NOT abstracted here is the authorization DECISION. {@link requireToolPermission}
21
+ * performs a check a caller asks for; it never decides that a check is needed. The "one
22
+ * evaluator" rule is a per-tool fact — some domains self-enforce inside their service function and
23
+ * must NOT be double-checked here, others have no service-layer gate at all and must be checked at
24
+ * the handler — and that judgement stays recorded in the domain file next to the handler it
25
+ * describes, where a reviewer reading the handler can see it.
26
+ */
27
+ import { ToolInputError } from "@jini-ai/core";
28
+ // Imported from `../commands/command` rather than the `../commands` barrel deliberately. The barrel
29
+ // re-exports `appliers.ts`, which names `features/post` and `features/settings` directly, so any file
30
+ // reaching this kit through the barrel inherits a dependency on two specific features. Every domain's
31
+ // `tool-registrations.ts` imports this kit, so that one barrel hop is what welds the tool layer to the
32
+ // content features and makes domains like `identity` non-extractable. Both symbols below are defined
33
+ // in `command.ts`; importing them from there costs nothing and keeps the kit feature-agnostic.
34
+ import { ForbiddenError } from "../commands/command.js";
35
+ /**
36
+ * Audit provenance stamped onto every revision row a tool handler writes.
37
+ *
38
+ * A constant, not `ctx.principal`'s own kind, and that is the point: `ctx.principal.id` is the
39
+ * HUMAN admin's principal id — the host's proxy reads it from the browser session and stamps it
40
+ * into the run's `contextRef`, and the daemon hands it back to the handler. So a content-type change made by the assistant and one the same person made by clicking
41
+ * through the admin UI record an identical `actorId`. What distinguishes them is the path, and
42
+ * reaching a `tool-registrations.ts` handler IS the agent path — those handlers are only ever
43
+ * invoked by `@jini-ai/daemon`'s `ToolExecutor` during a run. `'agent'` is therefore a fact about
44
+ * the call site, not a default.
45
+ */
46
+ // Typed as the literal "agent" (not the wider `ActorPrincipalKind`/`CommandActor["kind"]` unions
47
+ // each domain declares) so this one constant satisfies both content-types' `principalKind` param
48
+ // and Forms' `CommandActor.kind` param without a cast at either call site.
49
+ export const AGENT_TOOL_PRINCIPAL_KIND = "agent";
50
+ /**
51
+ * Actor-class rules that cannot be honored while no confirmation transport is wired.
52
+ *
53
+ * `confirmer-must-equal-own-delegatedBy` means "a human must confirm this, and the confirmer must
54
+ * be the principal who delegated". A host can only deliver that by building `ToolExecutor` with an
55
+ * `ExecutionDelegate`. Without one, `descriptor.requiresConfirmation` would park the execution on a
56
+ * promise only `resumeConfirmation` can settle — and nothing would call it. The park is also unbounded, because `descriptor.timeoutMs`'s timer is armed only AFTER the
57
+ * confirmation await.
58
+ *
59
+ * So a tool carrying this rule must not be wired at all. Today none is — `collections_execute_cleanup`,
60
+ * `database_execute_migrate_forward`, and `backup_execute_restore` all carry it and all three are
61
+ * declared unwired — which makes this guard a statement of the invariant rather than a fix: a
62
+ * future edit wiring any of them fails the build instead of silently shipping a tool whose stated
63
+ * human-confirmation requirement is unenforceable. When a confirmation transport does land, this
64
+ * constant is the deliberate place to relax.
65
+ */
66
+ export const ACTOR_CLASS_RULES_REQUIRING_CONFIRMATION_TRANSPORT = new Set(["confirmer-must-equal-own-delegatedBy"]);
67
+ /**
68
+ * Indexes a domain catalog by tool id — the single lookup used for descriptors, risk metadata, and
69
+ * schema-bearing error messages.
70
+ *
71
+ * @param catalog - The domain's own `agent-tools.ts` catalog array.
72
+ * @returns The catalog keyed by `name`.
73
+ * @complexity O(n) once at module load, O(1) per subsequent lookup.
74
+ * @overallScore 100
75
+ */
76
+ export function indexCatalogById(catalog) {
77
+ return new Map(catalog.map((tool) => [tool.name, tool]));
78
+ }
79
+ // ---------------------------------------------------------------------------
80
+ // Input readers — the vocabulary every handler uses to read `ctx.input`.
81
+ // ---------------------------------------------------------------------------
82
+ export function isRecord(value) {
83
+ return typeof value === "object" && value !== null;
84
+ }
85
+ /** Narrows `ctx.input` to a record, refusing anything else. The first line of most handlers. */
86
+ export function requireInputRecord(input) {
87
+ if (!isRecord(input))
88
+ throw new ToolInputError("input must be an object");
89
+ return input;
90
+ }
91
+ export function requireString(input, key) {
92
+ const value = input[key];
93
+ if (typeof value !== "string" || value.length === 0) {
94
+ throw new ToolInputError(`'${key}' (non-empty string) is required`);
95
+ }
96
+ return value;
97
+ }
98
+ export function requireNumber(input, key) {
99
+ const value = input[key];
100
+ if (typeof value !== "number" || !Number.isFinite(value)) {
101
+ throw new ToolInputError(`'${key}' (number) is required`);
102
+ }
103
+ return value;
104
+ }
105
+ export function requireObject(input, key) {
106
+ const value = input[key];
107
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
108
+ throw new ToolInputError(`'${key}' (object) is required`);
109
+ }
110
+ return value;
111
+ }
112
+ export function optionalString(input, key) {
113
+ const value = input[key];
114
+ if (value === undefined)
115
+ return undefined;
116
+ if (typeof value !== "string")
117
+ throw new ToolInputError(`'${key}' must be a string`);
118
+ return value;
119
+ }
120
+ export function optionalNumber(input, key) {
121
+ const value = input[key];
122
+ if (value === undefined)
123
+ return undefined;
124
+ if (typeof value !== "number" || !Number.isFinite(value))
125
+ throw new ToolInputError(`'${key}' must be a number`);
126
+ return value;
127
+ }
128
+ export function optionalBoolean(input, key) {
129
+ const value = input[key];
130
+ if (value === undefined)
131
+ return undefined;
132
+ if (typeof value !== "boolean")
133
+ throw new ToolInputError(`'${key}' must be a boolean`);
134
+ return value;
135
+ }
136
+ /**
137
+ * The reader for a parameterless tool: `ctx.input` may be omitted entirely or passed as `{}`,
138
+ * nothing else. Refusing a populated object is deliberate — silently ignoring keys would teach a
139
+ * model that a filter it invented was applied.
140
+ */
141
+ export function requireNoInput(input) {
142
+ if (input === undefined)
143
+ return;
144
+ if (!isRecord(input) || Object.keys(input).length > 0) {
145
+ throw new ToolInputError("this tool accepts no input — omit 'input' or pass {}");
146
+ }
147
+ }
148
+ /**
149
+ * Wraps a `Result<T, Error>`-returning domain call as a value: `ToolExecutor` treats a thrown error
150
+ * as a `'failed'` execution, so an `{ok:false}` becomes a throw rather than a silently-swallowed
151
+ * value.
152
+ */
153
+ export function fromResult(fn) {
154
+ return fn().then((result) => {
155
+ if (!result.ok)
156
+ throw result.error;
157
+ return result.value;
158
+ });
159
+ }
160
+ // ---------------------------------------------------------------------------
161
+ // Authorization
162
+ // ---------------------------------------------------------------------------
163
+ /**
164
+ * Runs the identical inline `authorize()` check the corresponding admin HTTP route performs, for a
165
+ * tool whose own domain function carries no `authorize()` call to inherit.
166
+ *
167
+ * This is NOT a second evaluator alongside another check — that is exactly the single-evaluator
168
+ * rule's concern. For each tool that
169
+ * calls it, this IS the only gate that tool's execution ever reaches, reached by an identical path
170
+ * to the one a human clicking the same admin route reaches. Domains split cleanly on which kind
171
+ * they are: content-types/Forms/Identity mutations and every Widgets write-service call self-enforce
172
+ * inside the domain function and must NOT call this; Comments/Members/Newsletter/Media/Menus/
173
+ * Database/Recovery gate in the route instead, so their handlers call this in the route's place.
174
+ * Which kind a given tool is stays documented next to that tool's handler, not here.
175
+ *
176
+ * Throws `core/commands`'s `ForbiddenError` — the same class `executeCommand` itself throws — so a
177
+ * tool caller and a route caller see the identical error shape for an identical denial. Throw
178
+ * rather than a 403 body because the caller here is `ToolExecutor`, which reads a thrown error as a
179
+ * failed execution and has no response to write to.
180
+ *
181
+ * @param deps - The `authorize()` evaluator and the workspace the run is scoped to.
182
+ * @param required - Who is asking, for what permission, optionally against which entity.
183
+ * @throws {ForbiddenError} If `authorize()` denies.
184
+ * @complexity O(1) beyond the injected `authorize()` call.
185
+ * @overallScore 100
186
+ */
187
+ export async function requireToolPermission(deps, required) {
188
+ const result = await deps.authorize({
189
+ principalId: required.principalId,
190
+ permission: required.permission,
191
+ workspaceId: deps.workspaceId,
192
+ entityType: required.entityType,
193
+ entityId: required.entityId,
194
+ });
195
+ if (!result.allowed) {
196
+ throw new ForbiddenError(`principal '${required.principalId}' is not authorized for '${required.permission}' (${result.reason})`, required.permission, result.reason);
197
+ }
198
+ }
199
+ // ---------------------------------------------------------------------------
200
+ // Error recovery
201
+ // ---------------------------------------------------------------------------
202
+ /** Appended to every decorated rejection so a model does not burn a turn retrying an identical call. */
203
+ const RETRY_IS_FUTILE = "Fix the input and retry — this will not resolve on retry without an input change.";
204
+ /**
205
+ * Re-throws a rejection with the tool's published `inputSchema` appended, so a model can correct
206
+ * its call in a single turn instead of guessing the rest of the shape from one field's complaint.
207
+ *
208
+ * `isShapeRejection` is the domain's own decision and has no default: only errors a DIFFERENT input
209
+ * would fix are decorated. A `ForbiddenError` or a slug conflict is not a shape problem, and
210
+ * appending a schema to one would be noise the model must read past — worse, it would imply the
211
+ * call is retryable when it is not.
212
+ *
213
+ * @param spec.toolId - The tool whose schema is published with the failure.
214
+ * @param spec.catalog - The domain catalog, consulted for that schema.
215
+ * @param spec.isShapeRejection - Predicate selecting the errors worth decorating.
216
+ * @param fn - The domain call.
217
+ * @throws The original error unchanged when it is not a shape rejection, or a decorated `Error`
218
+ * when it is. A tool whose catalog entry publishes no schema still gets the retry-is-futile note.
219
+ * @complexity O(1) beyond the wrapped call, plus the schema's own serialization on the failure path.
220
+ * @overallScore 100
221
+ */
222
+ export async function withSchemaOnRejection(spec, fn) {
223
+ try {
224
+ return await fn();
225
+ }
226
+ catch (error) {
227
+ if (!spec.isShapeRejection(error))
228
+ throw error;
229
+ throw decorateWithSchema({ toolId: spec.toolId, catalog: spec.catalog, message: error.message });
230
+ }
231
+ }
232
+ /**
233
+ * The synchronous half of {@link withSchemaOnRejection}, for a domain that validates BEFORE the
234
+ * call rather than inside it (content-types parses `fields` at a boundary parser, so its rejection
235
+ * never reaches a `try` around a domain call).
236
+ *
237
+ * @returns The `Error` to throw — returned rather than thrown so the caller's own `throw` keeps
238
+ * TypeScript's control-flow narrowing at the call site.
239
+ * @complexity O(s) in the serialized schema size, on the failure path only.
240
+ * @overallScore 100
241
+ */
242
+ export function decorateWithSchema(params) {
243
+ const schema = params.catalog.get(params.toolId)?.inputSchema;
244
+ // A `ToolInputError`, not a plain `Error`: every rejection reaching here already passed the
245
+ // caller's own `isShapeRejection` predicate — "a DIFFERENT input would fix this" — which is
246
+ // exactly what the marker means. `@jini-ai/daemon`'s `ToolExecutor` reads it off the thrown error
247
+ // to tag the execution result `errorKind: 'validation'` rather than folding it into the same
248
+ // redacted-500 bucket a genuine internal failure gets.
249
+ return new ToolInputError(schema
250
+ ? `${params.message}. ${RETRY_IS_FUTILE} Schema for '${params.toolId}': ${JSON.stringify(schema)}`
251
+ : `${params.message}. ${RETRY_IS_FUTILE}`);
252
+ }
253
+ // ---------------------------------------------------------------------------
254
+ // Build-time gates
255
+ // ---------------------------------------------------------------------------
256
+ /**
257
+ * Build-time gate on a single tool's risk metadata: refuses to wire a tool whose declared
258
+ * `sideEffects` disagrees with the wiring layer's own {@link DerivedRiskByToolId} classification,
259
+ * whose id that layer has not classified at all, or whose `actorClassRule` needs a confirmation
260
+ * transport that does not exist.
261
+ *
262
+ * Throws rather than warning, and at registration time rather than call time: a metadata
263
+ * inconsistency is a developer error that should stop the daemon booting, not a runtime condition
264
+ * to degrade around.
265
+ *
266
+ * @param params.toolId - The wired tool id.
267
+ * @param params.catalogEntry - Its `agent-tools.ts` entry, the declared side of the comparison.
268
+ * @param params.derivedRisk - The wiring layer's independent classification, the derived side.
269
+ * @throws {Error} If the tool is unclassified, misclassified, or needs missing confirmation support.
270
+ * @complexity O(1) — two map/set lookups.
271
+ * @overallScore 100
272
+ */
273
+ export function assertToolIsWirable(params) {
274
+ const { toolId, catalogEntry } = params;
275
+ const derived = params.derivedRisk.get(toolId);
276
+ if (!derived) {
277
+ throw new Error(`tool-registrations: '${toolId}' has no entry in DERIVED_RISK_BY_TOOL_ID — classify what its handler actually does before wiring it (unknown operations are refused, never assumed safe)`);
278
+ }
279
+ if (derived !== catalogEntry.sideEffects) {
280
+ throw new Error(`tool-registrations: '${toolId}' declares sideEffects '${catalogEntry.sideEffects}' but this layer derives '${derived}' from what its handler calls — reconcile the two rather than trusting the declaration`);
281
+ }
282
+ if (catalogEntry.actorClassRule && ACTOR_CLASS_RULES_REQUIRING_CONFIRMATION_TRANSPORT.has(catalogEntry.actorClassRule)) {
283
+ throw new Error(`tool-registrations: '${toolId}' declares actorClassRule '${catalogEntry.actorClassRule}', which requires a human-confirmation transport this host has not wired — leave it unwired until one exists (see ACTOR_CLASS_RULES_REQUIRING_CONFIRMATION_TRANSPORT)`);
284
+ }
285
+ }
286
+ /**
287
+ * Turns one domain's handler map into `ToolRegistration`s, applying every build-time gate the
288
+ * wiring layer owes each tool, and tripwiring on any catalog entry that is neither wired nor
289
+ * explicitly declared unwired.
290
+ *
291
+ * The tripwire is the reason this is one shared function rather than a loop each domain copies.
292
+ * "Add a catalog entry, forget to wire it" is the failure this layer is meant to make impossible,
293
+ * and a per-domain copy of the check is a per-domain opportunity to get it subtly wrong — one of
294
+ * the copies this replaced omitted the schema assertion, another omitted the unwired-set escape
295
+ * hatch. Silence is never the outcome: an unwired entry either appears in `unwiredToolIds` with a
296
+ * recorded reason next to it, or the build fails.
297
+ *
298
+ * `policy.authorize` is a pass-through `'allow'` for every registration, and that is by design
299
+ * rather than an omission: each tool's permission is evaluated exactly once — inside its domain
300
+ * function for the self-enforcing domains, or by the handler's own {@link requireToolPermission}
301
+ * call for the domains whose gate lives in the route. A check here would be a SECOND evaluator of
302
+ * the same rule, and a `ToolPolicy`-only check would be bypassable by any future non-tool caller of
303
+ * the same domain function, which is precisely why the chokepoint owns the gate.
304
+ *
305
+ * `descriptor.requiresConfirmation` is deliberately never set — see
306
+ * {@link ACTOR_CLASS_RULES_REQUIRING_CONFIRMATION_TRANSPORT} for why that omission is safe rather
307
+ * than a hole.
308
+ *
309
+ * @param spec.domain - Human-readable domain name, used only in failure messages.
310
+ * @param spec.catalogModule - Path of the catalog file, named in the drift message so the failure
311
+ * points at the file to edit.
312
+ * @param spec.catalog - That domain's catalog indexed by id (see {@link indexCatalogById}).
313
+ * @param spec.handlers - Tool id to handler. Registration order follows this map's key order.
314
+ * @param spec.derivedRisk - The domain's own risk classification (see {@link DerivedRiskByToolId}).
315
+ * @param spec.unwiredToolIds - Catalog ids deliberately not wired. Omit when the domain wires its
316
+ * entire catalog, which makes ANY unwired entry a build failure.
317
+ * @throws {Error} On catalog drift, an unclassified/misclassified tool, a wired tool publishing no
318
+ * `inputSchema`, or a catalog entry that is neither wired nor declared unwired.
319
+ * @complexity O(h + c) in the handler and catalog counts.
320
+ * @overallScore 100
321
+ */
322
+ export function buildDomainRegistrations(spec) {
323
+ const registrations = [];
324
+ for (const [id, handler] of Object.entries(spec.handlers)) {
325
+ const catalogEntry = spec.catalog.get(id);
326
+ if (!catalogEntry) {
327
+ throw new Error(`tool-registrations: ${spec.domain} catalog has no entry named '${id}' — ${spec.catalogModule} drifted`);
328
+ }
329
+ assertToolIsWirable({ toolId: id, catalogEntry, derivedRisk: spec.derivedRisk });
330
+ if (!catalogEntry.inputSchema) {
331
+ throw new Error(`tool-registrations: wired tool '${id}' publishes no inputSchema — add one to its entry in ${spec.catalogModule} so the model gets a contract, or leave the tool unwired`);
332
+ }
333
+ registrations.push({
334
+ descriptor: { id, description: catalogEntry.description, inputSchema: catalogEntry.inputSchema },
335
+ handler,
336
+ policy: { authorize: () => "allow" },
337
+ });
338
+ }
339
+ for (const id of spec.catalog.keys()) {
340
+ if (id in spec.handlers)
341
+ continue;
342
+ if (spec.unwiredToolIds?.has(id))
343
+ continue;
344
+ throw new Error(`tool-registrations: ${spec.domain} catalog entry '${id}' is neither wired nor declared unwired — wire a handler for it, or add it to that domain's unwired set with the reason recorded next to it`);
345
+ }
346
+ return registrations;
347
+ }
348
+ /**
349
+ * Folds every domain's risk slice into the one map the assistant-level
350
+ * `assertRiskMetadataIsWirable(toolId, catalogEntry)` consults, refusing any id two domains both
351
+ * claim.
352
+ *
353
+ * That refusal is the structural answer to the failure this restructure was prompted by: three
354
+ * domain slices were developed in parallel, each checking its new ids only against the ids that
355
+ * existed before it started, so a name two of them both picked would have been discovered at
356
+ * runtime as a silently double-registered tool. A cross-domain id collision now fails the build.
357
+ * The one real collision in the current catalogs — `backup_create_restore_point`, declared by both
358
+ * Database and Recovery — passes because Recovery declares it unwired and therefore contributes no
359
+ * risk entry for it, which is exactly the resolution this check is meant to force.
360
+ *
361
+ * @param slices - Each domain's name (for the failure message) and its own risk map.
362
+ * @throws {Error} If two domains classify the same tool id.
363
+ * @complexity O(t) in the total classified-tool count.
364
+ * @overallScore 100
365
+ */
366
+ export function mergeDerivedRiskMaps(slices) {
367
+ const merged = new Map();
368
+ const ownerByToolId = new Map();
369
+ for (const slice of slices) {
370
+ for (const [toolId, sideEffect] of slice.risk) {
371
+ const owner = ownerByToolId.get(toolId);
372
+ if (owner) {
373
+ throw new Error(`tool-registrations: tool id '${toolId}' is wired by both the ${owner} and ${slice.domain} domains — one id must resolve to exactly one handler; wire it in whichever domain owns the real operation and declare it unwired in the other`);
374
+ }
375
+ ownerByToolId.set(toolId, slice.domain);
376
+ merged.set(toolId, sideEffect);
377
+ }
378
+ }
379
+ return merged;
380
+ }
381
+ //# sourceMappingURL=registration-kit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registration-kit.js","sourceRoot":"","sources":["../../../src/core/tools/registration-kit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,cAAc,EAA2C,MAAM,eAAe,CAAC;AAExF,oGAAoG;AACpG,sGAAsG;AACtG,sGAAsG;AACtG,uGAAuG;AACvG,qGAAqG;AACrG,+FAA+F;AAC/F,OAAO,EAAE,cAAc,EAAoB,MAAM,wBAAwB,CAAC;AA+D1E;;;;;;;;;;GAUG;AACH,iGAAiG;AACjG,iGAAiG;AACjG,2EAA2E;AAC3E,MAAM,CAAC,MAAM,yBAAyB,GAAY,OAAO,CAAC;AAE1D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,kDAAkD,GAAG,IAAI,GAAG,CAAC,CAAC,sCAAsC,CAAC,CAAC,CAAC;AAEpH;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAA6B,OAAqB;IAChF,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,8EAA8E;AAC9E,yEAAyE;AACzE,8EAA8E;AAE9E,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAC/C,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,M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IAAI,CAAC,MAAM,mBAAmB,EAAE,6IAA6I,CACrM,CAAC;IACJ,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAgE;IACnG,MAAM,MAAM,GAAG,IAAI,GAAG,EAA+B,CAAC;IACtD,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEhD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,KAAK,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;YAC9C,MAAM,KAAK,GAAG,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACxC,IAAI,KAAK,EAAE,CAAC;gBACV,MAAM,IAAI,KAAK,CACb,gCAAgC,MAAM,0BAA0B,KAAK,QAAQ,KAAK,CAAC,MAAM,gJAAgJ,CAC1O,CAAC;YACJ,CAAC;YACD,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YACxC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * @file The Entries agent-tool catalog — this domain's instance of the per-domain `agent-tools.ts`
3
+ * convention `features/content-types/agent-tools.ts`, `features/settings/agent-tools.ts`, and every
4
+ * other domain catalog already use.
5
+ *
6
+ * Purpose:
7
+ * A static, in-process catalog describing every agent-callable tool this domain exposes. Every
8
+ * entry maps 1:1 onto a real exported function of `features/entries/write-service.ts` (`createEntry`,
9
+ * `updateEntry`, `publishEntry`, `unpublishEntry`) or `features/entries/list.ts` (`listEntries`) —
10
+ * this catalog never names an operation the domain cannot perform.
11
+ *
12
+ * Naming and scope — a real discrepancy from this dispatch's own brief, disclosed rather than
13
+ * silently reconciled: the brief framed this domain as "backing the Pages, Posts, and Collections
14
+ * admin sections", but reading the actual admin routes shows that is only true for Collections.
15
+ * `server/routes/admin/entries/{create,update,lifecycle,list}.ts` (`/api/admin/v1/entries`, gated by
16
+ * `admin.collections.manage`/`admin.collections.read`) are the ONLY routes backed by THIS package's
17
+ * `write-service.ts`/`list.ts` — exactly what this catalog wraps. Pages and Posts
18
+ * (`server/routes/admin/pages/*`, `server/routes/admin/posts/*`) are, in this codebase's CURRENT
19
+ * state, backed by a wholly separate legacy `features/post` module (`createPost`/`updatePost`/
20
+ * `getAdminPostById`/`listAdminPages`, its own `post` table, routed through `core/commands`'s
21
+ * `executeCommand` gateway, gated by `content.write`/`content.read` — a different permission
22
+ * namespace entirely). `features/entries` has no relationship to that module at all: no shared
23
+ * table, no shared write chokepoint, no shared permission. So this catalog's tools name their
24
+ * resource `collections_entry_*` (pairing with `features/content-types/agent-tools.ts`'s own
25
+ * `collections_content_type_*` prefix — the two packages are "one cohesive domain" per
26
+ * `server/routes/admin/content-types/deps.ts`'s own file header), not `entry_*`/`page_*`/`post_*` —
27
+ * a name that could be misread as covering Pages/Posts. Wiring Pages/Posts agent tools would mean
28
+ * wrapping `features/post`, a different backend this dispatch was not asked to touch and has not
29
+ * inspected for the same safety discipline this catalog applies here.
30
+ *
31
+ * Deliberate absences (the point of a catalog, not an oversight):
32
+ * - There is no delete/purge tool: `write-service.ts` exposes no delete function at all (confirmed
33
+ * by reading the whole file) — there is nothing to wrap or exclude on that front.
34
+ * - `collections_entry_update`'s schema omits `bodyJson` even though `updateEntry` itself accepts an
35
+ * optional `bodyJson` (REQ-44/45, used internally by `widgets/embed-service.ts`'s own guardrailed
36
+ * mutation path). The generic Collections admin route (`entries/update.ts`) never forwards
37
+ * `body.bodyJson` at all — only `title`/`fieldsJson`/`expectedVersion` — so exposing it here would
38
+ * invent capability beyond what the human admin UI's own Collections editor exposes. Omitting it
39
+ * from the input is enough: `updateEntry` leaves `bodyJson` unchanged whenever the field is
40
+ * `undefined`, so this exclusion changes nothing about what a call can still do.
41
+ * - `collections_entry_list`'s schema omits `status`/`orderBy`/`limit` even though
42
+ * `EntryListPort.listByWorkspace` supports all three (added for `widgets/resolvers/recent-entries.ts`'s
43
+ * own bounded-query need) — `server/routes/admin/entries/list.ts` only ever forwards `type` from
44
+ * its query string, so the other three are not part of what the Collections admin list screen
45
+ * itself can do; adding them here would again exceed the human surface this catalog mirrors.
46
+ *
47
+ * What IS included, and why it is safe: all four write-service functions are `admin.collections.*`
48
+ * self-enforcing (each opens with its own `deps.authorize()` call before any other side effect —
49
+ * confirmed by reading `write-service.ts` directly), and `publishEntry`/`unpublishEntry` are ordinary,
50
+ * fully reversible status flips with a full revision trail (`entryRepo.appendRevision`) — publishing
51
+ * and unpublishing are each other's own undo.
52
+ *
53
+ * How it relates to the project:
54
+ * `features/entries/tool-registrations.ts` maps these entries into `@jini-ai/core` `ToolRegistration`s.
55
+ *
56
+ * Architectural role:
57
+ * `features/entries` domain declaration. No dependencies.
58
+ */
59
+ export type AgentToolSideEffect = "none" | "mutates-durable-state" | "mints-token";
60
+ export interface AgentToolDefinition {
61
+ name: string;
62
+ description: string;
63
+ sideEffects: AgentToolSideEffect;
64
+ authorization: {
65
+ permission: string;
66
+ };
67
+ /**
68
+ * JSON Schema for this tool's `input`, published to the model via `ToolDescriptor.inputSchema`
69
+ * (`assistant/tool-registration-kit.ts`'s `buildDomainRegistrations`, which refuses to wire any
70
+ * tool lacking one).
71
+ */
72
+ inputSchema?: Readonly<Record<string, unknown>>;
73
+ }
74
+ /** The Entries domain's fixed agent-tool catalog: the Collections authoring surface's 4 writes
75
+ * (create/update/publish/unpublish) plus its 1 read (list) — see this file's header for the
76
+ * Pages/Posts naming disclosure and the 3 deliberate scope exclusions. */
77
+ export declare const entriesAgentToolCatalog: AgentToolDefinition[];
78
+ //# sourceMappingURL=agent-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-tools.d.ts","sourceRoot":"","sources":["../../src/entries/agent-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,uBAAuB,GAAG,aAAa,CAAC;AAEnF,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,mBAAmB,CAAC;IACjC,aAAa,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC;;;;OAIG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACjD;AAoBD;;0EAE0E;AAC1E,eAAO,MAAM,uBAAuB,EAAE,mBAAmB,EAuFxD,CAAC"}
@@ -0,0 +1,158 @@
1
+ /**
2
+ * @file The Entries agent-tool catalog — this domain's instance of the per-domain `agent-tools.ts`
3
+ * convention `features/content-types/agent-tools.ts`, `features/settings/agent-tools.ts`, and every
4
+ * other domain catalog already use.
5
+ *
6
+ * Purpose:
7
+ * A static, in-process catalog describing every agent-callable tool this domain exposes. Every
8
+ * entry maps 1:1 onto a real exported function of `features/entries/write-service.ts` (`createEntry`,
9
+ * `updateEntry`, `publishEntry`, `unpublishEntry`) or `features/entries/list.ts` (`listEntries`) —
10
+ * this catalog never names an operation the domain cannot perform.
11
+ *
12
+ * Naming and scope — a real discrepancy from this dispatch's own brief, disclosed rather than
13
+ * silently reconciled: the brief framed this domain as "backing the Pages, Posts, and Collections
14
+ * admin sections", but reading the actual admin routes shows that is only true for Collections.
15
+ * `server/routes/admin/entries/{create,update,lifecycle,list}.ts` (`/api/admin/v1/entries`, gated by
16
+ * `admin.collections.manage`/`admin.collections.read`) are the ONLY routes backed by THIS package's
17
+ * `write-service.ts`/`list.ts` — exactly what this catalog wraps. Pages and Posts
18
+ * (`server/routes/admin/pages/*`, `server/routes/admin/posts/*`) are, in this codebase's CURRENT
19
+ * state, backed by a wholly separate legacy `features/post` module (`createPost`/`updatePost`/
20
+ * `getAdminPostById`/`listAdminPages`, its own `post` table, routed through `core/commands`'s
21
+ * `executeCommand` gateway, gated by `content.write`/`content.read` — a different permission
22
+ * namespace entirely). `features/entries` has no relationship to that module at all: no shared
23
+ * table, no shared write chokepoint, no shared permission. So this catalog's tools name their
24
+ * resource `collections_entry_*` (pairing with `features/content-types/agent-tools.ts`'s own
25
+ * `collections_content_type_*` prefix — the two packages are "one cohesive domain" per
26
+ * `server/routes/admin/content-types/deps.ts`'s own file header), not `entry_*`/`page_*`/`post_*` —
27
+ * a name that could be misread as covering Pages/Posts. Wiring Pages/Posts agent tools would mean
28
+ * wrapping `features/post`, a different backend this dispatch was not asked to touch and has not
29
+ * inspected for the same safety discipline this catalog applies here.
30
+ *
31
+ * Deliberate absences (the point of a catalog, not an oversight):
32
+ * - There is no delete/purge tool: `write-service.ts` exposes no delete function at all (confirmed
33
+ * by reading the whole file) — there is nothing to wrap or exclude on that front.
34
+ * - `collections_entry_update`'s schema omits `bodyJson` even though `updateEntry` itself accepts an
35
+ * optional `bodyJson` (REQ-44/45, used internally by `widgets/embed-service.ts`'s own guardrailed
36
+ * mutation path). The generic Collections admin route (`entries/update.ts`) never forwards
37
+ * `body.bodyJson` at all — only `title`/`fieldsJson`/`expectedVersion` — so exposing it here would
38
+ * invent capability beyond what the human admin UI's own Collections editor exposes. Omitting it
39
+ * from the input is enough: `updateEntry` leaves `bodyJson` unchanged whenever the field is
40
+ * `undefined`, so this exclusion changes nothing about what a call can still do.
41
+ * - `collections_entry_list`'s schema omits `status`/`orderBy`/`limit` even though
42
+ * `EntryListPort.listByWorkspace` supports all three (added for `widgets/resolvers/recent-entries.ts`'s
43
+ * own bounded-query need) — `server/routes/admin/entries/list.ts` only ever forwards `type` from
44
+ * its query string, so the other three are not part of what the Collections admin list screen
45
+ * itself can do; adding them here would again exceed the human surface this catalog mirrors.
46
+ *
47
+ * What IS included, and why it is safe: all four write-service functions are `admin.collections.*`
48
+ * self-enforcing (each opens with its own `deps.authorize()` call before any other side effect —
49
+ * confirmed by reading `write-service.ts` directly), and `publishEntry`/`unpublishEntry` are ordinary,
50
+ * fully reversible status flips with a full revision trail (`entryRepo.appendRevision`) — publishing
51
+ * and unpublishing are each other's own undo.
52
+ *
53
+ * How it relates to the project:
54
+ * `features/entries/tool-registrations.ts` maps these entries into `@jini-ai/core` `ToolRegistration`s.
55
+ *
56
+ * Architectural role:
57
+ * `features/entries` domain declaration. No dependencies.
58
+ */
59
+ const ENTRY_ID_SCHEMA = {
60
+ type: "string",
61
+ minLength: 1,
62
+ description: "The entry's id, as returned by collections_entry_create or collections_entry_list.",
63
+ };
64
+ const EXPECTED_VERSION_SCHEMA = {
65
+ type: "integer",
66
+ description: "The entry's current 'version', for optimistic concurrency. Read it first (collections_entry_list, or the previous write's own response) — a stale value is rejected with a version conflict naming the current version.",
67
+ };
68
+ const FIELDS_JSON_SCHEMA = {
69
+ type: "object",
70
+ description: "The entry's field-extension bag, wrapped as { ext: { site: {...} } } envelope. Must conform to the owning content type's CURRENT field schema — an unrecognized key, a wrong-kind value, or a missing required field is rejected with every failing field named, before anything is written.",
71
+ };
72
+ /** The Entries domain's fixed agent-tool catalog: the Collections authoring surface's 4 writes
73
+ * (create/update/publish/unpublish) plus its 1 read (list) — see this file's header for the
74
+ * Pages/Posts naming disclosure and the 3 deliberate scope exclusions. */
75
+ export const entriesAgentToolCatalog = [
76
+ {
77
+ name: "collections_entry_list",
78
+ description: "Lists Collection entries in the workspace (id, type, slug, status, title, fieldsJson, bodyJson, publishedAt, timestamps, version). " +
79
+ "Optionally narrowed to one content type. Mirrors the admin Collections list screen exactly — no status/date/limit filter is available " +
80
+ "here because the admin route itself does not expose one.",
81
+ sideEffects: "none",
82
+ authorization: { permission: "admin.collections.read" },
83
+ inputSchema: {
84
+ type: "object",
85
+ additionalProperties: false,
86
+ required: [],
87
+ properties: {
88
+ type: { type: "string", description: "Narrow the list to one content type's entries (its 'key'). Omit to list every type." },
89
+ },
90
+ },
91
+ },
92
+ {
93
+ name: "collections_entry_create",
94
+ description: "Creates a new draft Collection entry under an existing, ACTIVE content type. Rejected if the content type does not exist in this " +
95
+ "workspace, is deprecated/tombstoned, if fieldsJson fails the type's current field schema, or if (type, slug) is already taken. " +
96
+ "The new entry always starts in 'draft' status — use collections_entry_publish afterward to publish it.",
97
+ sideEffects: "mutates-durable-state",
98
+ authorization: { permission: "admin.collections.manage" },
99
+ inputSchema: {
100
+ type: "object",
101
+ additionalProperties: false,
102
+ required: ["type", "slug", "title"],
103
+ properties: {
104
+ type: { type: "string", minLength: 1, description: "The owning content type's key. Must be an ACTIVE content type already registered in this workspace." },
105
+ slug: { type: "string", minLength: 1, description: "URL-safe slug, unique per (type). A second entry with the same (type, slug) is rejected as a conflict." },
106
+ title: { type: "string", minLength: 1, description: "Human-readable title." },
107
+ fieldsJson: { ...FIELDS_JSON_SCHEMA, description: `${FIELDS_JSON_SCHEMA.description} Omit for an empty { ext: { site: {} } } envelope.` },
108
+ bodyJson: { description: "Optional rich-text body document (TipTap JSON). Not schema-validated." },
109
+ },
110
+ },
111
+ },
112
+ {
113
+ name: "collections_entry_update",
114
+ description: "Updates an existing entry's title and/or fieldsJson (only the fields supplied change). Rejected if the entry does not exist, if its " +
115
+ "owning content type is tombstoned (a deprecated owning type does NOT block this), if fieldsJson fails the type's current schema, or if " +
116
+ "expectedVersion is stale. Cannot change an entry's bodyJson through this tool — the Collections admin editor itself does not expose that.",
117
+ sideEffects: "mutates-durable-state",
118
+ authorization: { permission: "admin.collections.manage" },
119
+ inputSchema: {
120
+ type: "object",
121
+ additionalProperties: false,
122
+ required: ["id", "expectedVersion"],
123
+ properties: {
124
+ id: ENTRY_ID_SCHEMA,
125
+ expectedVersion: EXPECTED_VERSION_SCHEMA,
126
+ title: { type: "string", minLength: 1, description: "New title. Omit to leave the current title unchanged." },
127
+ fieldsJson: { ...FIELDS_JSON_SCHEMA, description: `COMPLETE replacement field-extension bag. ${FIELDS_JSON_SCHEMA.description} Omit to leave fields unchanged.` },
128
+ },
129
+ },
130
+ },
131
+ {
132
+ name: "collections_entry_publish",
133
+ description: "Flips an entry to 'published' (sets publishedAt to now). Rejected only if the owning content type is tombstoned, or if " +
134
+ "expectedVersion is stale. A deprecated owning type does not block this. Fully reversible via collections_entry_unpublish.",
135
+ sideEffects: "mutates-durable-state",
136
+ authorization: { permission: "admin.collections.manage" },
137
+ inputSchema: {
138
+ type: "object",
139
+ additionalProperties: false,
140
+ required: ["id", "expectedVersion"],
141
+ properties: { id: ENTRY_ID_SCHEMA, expectedVersion: EXPECTED_VERSION_SCHEMA },
142
+ },
143
+ },
144
+ {
145
+ name: "collections_entry_unpublish",
146
+ description: "Flips an entry to 'unpublished' (publishedAt is left as-is; only the status changes). Rejected only if the owning content type is " +
147
+ "tombstoned, or if expectedVersion is stale. A deprecated owning type does not block this. Fully reversible via collections_entry_publish.",
148
+ sideEffects: "mutates-durable-state",
149
+ authorization: { permission: "admin.collections.manage" },
150
+ inputSchema: {
151
+ type: "object",
152
+ additionalProperties: false,
153
+ required: ["id", "expectedVersion"],
154
+ properties: { id: ENTRY_ID_SCHEMA, expectedVersion: EXPECTED_VERSION_SCHEMA },
155
+ },
156
+ },
157
+ ];
158
+ //# sourceMappingURL=agent-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-tools.js","sourceRoot":"","sources":["../../src/entries/agent-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAiBH,MAAM,eAAe,GAAG;IACtB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,CAAC;IACZ,WAAW,EAAE,oFAAoF;CACzF,CAAC;AAEX,MAAM,uBAAuB,GAAG;IAC9B,IAAI,EAAE,SAAS;IACf,WAAW,EACT,yNAAyN;CACnN,CAAC;AAEX,MAAM,kBA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