@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,28 @@
1
+ /**
2
+ * @file `@jini-ai/cms/server` — the Node-bound half of the CMS capability.
3
+ *
4
+ * PLACEHOLDER. Nothing has been ported yet.
5
+ *
6
+ * ## What belongs here
7
+ *
8
+ * Concrete implementations of the ports declared in `../core`: SQLite/Postgres repositories,
9
+ * filesystem blob stores, image transformers — anything that imports `node:*` or a native
10
+ * dependency. This layer depends on `../core`; the reverse is a boundary violation.
11
+ *
12
+ * ## What does NOT belong here
13
+ *
14
+ * HTTP routing and request/response handling. The source repo's `src/server/**` is an Express
15
+ * composition root and is explicitly out of scope for this port — Jini already has
16
+ * `@jini-ai/http-kit` and `@jini-ai/server` for transport. Porting those routes here would
17
+ * reproduce exactly the coupling this package's layer split exists to prevent (see
18
+ * `../core/index.ts`'s header for the measurements).
19
+ *
20
+ * The name of this subpath is `/server` for consistency with `@jini-ai/admin`'s Node layer, which
21
+ * uses the same convention. It means "the Node-bound layer", not "the HTTP server".
22
+ */
23
+ /**
24
+ * Layer marker — same rationale as `CMS_CORE_LAYER`, and delete it on the same terms: once a real
25
+ * adapter is exported from here, this has no purpose.
26
+ */
27
+ export const CMS_SERVER_LAYER = 'server';
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAiB,CAAC"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * @file The Settings domain's agent-tool catalog, instantiating the naming/callability
3
+ * convention every other domain catalog in this package already uses.
4
+ *
5
+ * Purpose:
6
+ * A static, in-process catalog describing every agent-callable tool this domain exposes. Settings
7
+ * is, by design, a broad key/value surface — a typical human admin screen for it is an uncurated,
8
+ * free-text editor: the operator types ANY namespace string to load it and edits values through a
9
+ * raw-JSON textarea, with no schema-exposing endpoint feeding a typed control. There is no fixed,
10
+ * curated list of named settings on that surface to wire tools against.
11
+ *
12
+ * That disqualifies every GENERIC write in this domain from being wired here:
13
+ * - `SETTINGS_SET`/`SETTINGS_CLEAR` let a caller write/clear the value of any registered
14
+ * namespace+key at any scope it can name — exactly the generic "set any setting key" tool this
15
+ * dispatch's brief prohibits outright, regardless of the write path's own schema validation
16
+ * (validation constrains VALUE shape, not WHICH key can be targeted).
17
+ *
18
+ * One curated write IS wired, and it is not a weaker `settings_set`: `ui-tab-definitions.ts`
19
+ * registers a fixed, statically-declared list, because the settings-dialog tabs need named keys to
20
+ * bind to. `SETTINGS_SET_UI_PREFERENCE` below wires a seven-key subset of that list
21
+ * (`agent-writable-preferences.ts`):
22
+ *
23
+ * - Its `setting` parameter is a JSON Schema `enum`, so WHICH key is targeted is constrained by
24
+ * the same mechanism as everything else — the exact gap the paragraph above identifies. The
25
+ * ledger's registered definition schema still bounds the VALUE, so both halves are covered.
26
+ * - It exposes no `scope` and no `principalId`. Every write is `scope: "user"` against the
27
+ * caller's own principal, which derives `settings.user.self.write` — the narrowest write grant
28
+ * in the system — and makes writing another operator's preferences unrepresentable rather than
29
+ * merely unauthorized.
30
+ * - The keys are per-operator display preferences (locale, theme, accent, notification sounds),
31
+ * each reversible in one call and visible in the admin UI the moment it changes.
32
+ *
33
+ * The generic setter stays excluded, permanently and for its original reason. Nothing above is
34
+ * evidence that the other three writes may now be wired:
35
+ * - `SETTINGS_RESET` is broader still: a single call clears every value in an operator-named
36
+ * namespace at a scope — typically described in a host's own confirmation dialog as
37
+ * irreversible.
38
+ * - `SETTINGS_REGISTER_DEFINITIONS` is schema-level, not value-level: it can rename/retype/
39
+ * deprecate/tombstone the DEFINITION a key resolves through, changing how every existing stored
40
+ * value for that key is interpreted platform-wide.
41
+ *
42
+ * Reads are a different risk class and are wired: `SETTINGS_LIST_DEFINITIONS`/
43
+ * `SETTINGS_GET_EFFECTIVE`/`SETTINGS_GET_RAW` cannot mutate anything, are gated by the same real
44
+ * `authorize()` permissions an admin UI's own reads use (including the cross-principal
45
+ * `settings.user.read` check), and cannot surface a secret value even in principle —
46
+ * `settings.ts`'s `validateDefinitionInput` unconditionally refuses `secret:true` at registration
47
+ * time (REQ-09/INV-08), so no secret setting can exist in this library's current state to leak.
48
+ *
49
+ * How it relates to a host:
50
+ * A host's tool-registration layer consumes this catalog to decide which tool names an agent
51
+ * session may even see; `authorize()` enforces the actual permission checks at call time — this
52
+ * module only declares the catalog shape, it performs no I/O and no enforcement itself.
53
+ *
54
+ * Architectural role:
55
+ * `settings` domain logic. Depends only on its own sibling `agent-writable-preferences.ts` (for
56
+ * the curated write's enum) — no I/O, no enforcement.
57
+ */
58
+ export type AgentToolSideEffect = "none" | "mutates-durable-state" | "mints-token";
59
+ export interface AgentToolDefinition {
60
+ name: string;
61
+ description: string;
62
+ sideEffects: AgentToolSideEffect;
63
+ authorization: {
64
+ permission: string;
65
+ };
66
+ /**
67
+ * JSON Schema for this tool's `input`, published to the model via `ToolDescriptor.inputSchema`
68
+ * (a host's tool-registration layer refuses to wire any tool lacking one). Optional — the four
69
+ * write entries this file documents but never wires (see file header) carry no schema at all,
70
+ * since one is never published for a tool the model never sees.
71
+ */
72
+ inputSchema?: Readonly<Record<string, unknown>>;
73
+ }
74
+ /**
75
+ * The Settings domain's fixed agent-tool catalog — the three reads, one curated write
76
+ * (`settings_set_ui_preference`), and four generic writes documented but deliberately never
77
+ * wired. See file header.
78
+ *
79
+ * @complexity O(1) — a fixed, statically-defined list.
80
+ * @overallScore 100
81
+ */
82
+ export declare function getSettingsAgentToolCatalog(): AgentToolDefinition[];
83
+ //# sourceMappingURL=agent-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-tools.d.ts","sourceRoot":"","sources":["../../src/settings/agent-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAIH,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;;;;;OAKG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACjD;AAyED;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,IAAI,mBAAmB,EAAE,CAyEnE"}
@@ -0,0 +1,200 @@
1
+ /**
2
+ * @file The Settings domain's agent-tool catalog, instantiating the naming/callability
3
+ * convention every other domain catalog in this package already uses.
4
+ *
5
+ * Purpose:
6
+ * A static, in-process catalog describing every agent-callable tool this domain exposes. Settings
7
+ * is, by design, a broad key/value surface — a typical human admin screen for it is an uncurated,
8
+ * free-text editor: the operator types ANY namespace string to load it and edits values through a
9
+ * raw-JSON textarea, with no schema-exposing endpoint feeding a typed control. There is no fixed,
10
+ * curated list of named settings on that surface to wire tools against.
11
+ *
12
+ * That disqualifies every GENERIC write in this domain from being wired here:
13
+ * - `SETTINGS_SET`/`SETTINGS_CLEAR` let a caller write/clear the value of any registered
14
+ * namespace+key at any scope it can name — exactly the generic "set any setting key" tool this
15
+ * dispatch's brief prohibits outright, regardless of the write path's own schema validation
16
+ * (validation constrains VALUE shape, not WHICH key can be targeted).
17
+ *
18
+ * One curated write IS wired, and it is not a weaker `settings_set`: `ui-tab-definitions.ts`
19
+ * registers a fixed, statically-declared list, because the settings-dialog tabs need named keys to
20
+ * bind to. `SETTINGS_SET_UI_PREFERENCE` below wires a seven-key subset of that list
21
+ * (`agent-writable-preferences.ts`):
22
+ *
23
+ * - Its `setting` parameter is a JSON Schema `enum`, so WHICH key is targeted is constrained by
24
+ * the same mechanism as everything else — the exact gap the paragraph above identifies. The
25
+ * ledger's registered definition schema still bounds the VALUE, so both halves are covered.
26
+ * - It exposes no `scope` and no `principalId`. Every write is `scope: "user"` against the
27
+ * caller's own principal, which derives `settings.user.self.write` — the narrowest write grant
28
+ * in the system — and makes writing another operator's preferences unrepresentable rather than
29
+ * merely unauthorized.
30
+ * - The keys are per-operator display preferences (locale, theme, accent, notification sounds),
31
+ * each reversible in one call and visible in the admin UI the moment it changes.
32
+ *
33
+ * The generic setter stays excluded, permanently and for its original reason. Nothing above is
34
+ * evidence that the other three writes may now be wired:
35
+ * - `SETTINGS_RESET` is broader still: a single call clears every value in an operator-named
36
+ * namespace at a scope — typically described in a host's own confirmation dialog as
37
+ * irreversible.
38
+ * - `SETTINGS_REGISTER_DEFINITIONS` is schema-level, not value-level: it can rename/retype/
39
+ * deprecate/tombstone the DEFINITION a key resolves through, changing how every existing stored
40
+ * value for that key is interpreted platform-wide.
41
+ *
42
+ * Reads are a different risk class and are wired: `SETTINGS_LIST_DEFINITIONS`/
43
+ * `SETTINGS_GET_EFFECTIVE`/`SETTINGS_GET_RAW` cannot mutate anything, are gated by the same real
44
+ * `authorize()` permissions an admin UI's own reads use (including the cross-principal
45
+ * `settings.user.read` check), and cannot surface a secret value even in principle —
46
+ * `settings.ts`'s `validateDefinitionInput` unconditionally refuses `secret:true` at registration
47
+ * time (REQ-09/INV-08), so no secret setting can exist in this library's current state to leak.
48
+ *
49
+ * How it relates to a host:
50
+ * A host's tool-registration layer consumes this catalog to decide which tool names an agent
51
+ * session may even see; `authorize()` enforces the actual permission checks at call time — this
52
+ * module only declares the catalog shape, it performs no I/O and no enforcement itself.
53
+ *
54
+ * Architectural role:
55
+ * `settings` domain logic. Depends only on its own sibling `agent-writable-preferences.ts` (for
56
+ * the curated write's enum) — no I/O, no enforcement.
57
+ */
58
+ import { AGENT_WRITABLE_PREFERENCE_IDS, AGENT_WRITABLE_PREFERENCES } from "./agent-writable-preferences.js";
59
+ /** No arguments — `settings_list_definitions` takes none; it always enumerates the caller's own
60
+ * (boot-wired) workspace's site-owned partition plus the shared platform partition. */
61
+ const NO_INPUT_SCHEMA = {
62
+ type: "object",
63
+ additionalProperties: false,
64
+ required: [],
65
+ properties: {},
66
+ };
67
+ /** Shared by `settings_get_effective`/`settings_get_raw`: naming a DIFFERENT principal than the
68
+ * caller requires `settings.user.read` (checked by the handler, not expressed in this schema). */
69
+ const PRINCIPAL_ID_PROPERTY = {
70
+ type: "string",
71
+ description: "Read another principal's user-layer value instead of the caller's own. Requires the settings.user.read permission when it names a principal other than the caller. Omit to read the caller's own user layer.",
72
+ };
73
+ const GET_EFFECTIVE_SCHEMA = {
74
+ type: "object",
75
+ additionalProperties: false,
76
+ required: ["namespace"],
77
+ properties: {
78
+ namespace: { type: "string", minLength: 1, description: "The settings namespace to enumerate, e.g. 'core.presentation'." },
79
+ principalId: PRINCIPAL_ID_PROPERTY,
80
+ },
81
+ };
82
+ const GET_RAW_SCHEMA = {
83
+ type: "object",
84
+ additionalProperties: false,
85
+ required: ["namespace", "key"],
86
+ properties: {
87
+ namespace: { type: "string", minLength: 1, description: "The settings namespace the key belongs to, e.g. 'core.presentation'." },
88
+ key: { type: "string", minLength: 1, description: "The setting key within the namespace." },
89
+ principalId: PRINCIPAL_ID_PROPERTY,
90
+ },
91
+ };
92
+ /**
93
+ * Input schema for `settings_set_ui_preference`.
94
+ *
95
+ * The `enum` on `setting` is the load-bearing part and the reason this tool is wireable at all —
96
+ * it is what makes "which key" a schema-constrained choice rather than free text. Built from
97
+ * {@link AGENT_WRITABLE_PREFERENCE_IDS} rather than listed here, so the published schema and the
98
+ * handler's own allowlist check cannot disagree.
99
+ *
100
+ * `value` is typed only as "present". Constraining it here would mean restating seven different
101
+ * per-key schemas that the ledger already holds and already enforces inside the write chokepoint
102
+ * (`write-service.ts`'s `set()`), and a second copy that drifts is worse than no copy: it would
103
+ * reject values the ledger accepts, or — far worse — describe as acceptable a shape the ledger
104
+ * will refuse. The per-key hints below tell the model what to send; the ledger decides.
105
+ */
106
+ const SET_UI_PREFERENCE_SCHEMA = {
107
+ type: "object",
108
+ additionalProperties: false,
109
+ required: ["setting", "value"],
110
+ properties: {
111
+ setting: {
112
+ type: "string",
113
+ enum: AGENT_WRITABLE_PREFERENCE_IDS,
114
+ description: `The preference to set. Legal values and what each expects: ${AGENT_WRITABLE_PREFERENCES.map((p) => `${p.id} — ${p.valueHint}`).join(" | ")}`,
115
+ },
116
+ value: {
117
+ description: "The new value, matching the shape described for the chosen setting. Validated against that setting's registered schema; a mismatch is rejected and nothing is written.",
118
+ },
119
+ },
120
+ };
121
+ /**
122
+ * The Settings domain's fixed agent-tool catalog — the three reads, one curated write
123
+ * (`settings_set_ui_preference`), and four generic writes documented but deliberately never
124
+ * wired. See file header.
125
+ *
126
+ * @complexity O(1) — a fixed, statically-defined list.
127
+ * @overallScore 100
128
+ */
129
+ export function getSettingsAgentToolCatalog() {
130
+ return [
131
+ {
132
+ name: "settings_list_definitions",
133
+ description: "Lists every active setting definition visible to this workspace (platform core/theme definitions plus this workspace's own site-owned definitions): namespace, key, owner kind, scope bitmask, status, and version. Metadata only — never a value.",
134
+ sideEffects: "none",
135
+ authorization: { permission: "settings.read.definitions" },
136
+ inputSchema: NO_INPUT_SCHEMA,
137
+ },
138
+ {
139
+ name: "settings_get_effective",
140
+ description: "Returns the effective (precedence-resolved: user, then workspace, then global, then default) value of every active setting registered in a namespace.",
141
+ sideEffects: "none",
142
+ authorization: { permission: "settings.read" },
143
+ inputSchema: GET_EFFECTIVE_SCHEMA,
144
+ },
145
+ {
146
+ name: "settings_get_raw",
147
+ description: "Returns the per-layer raw values (global, workspace, user, default) of one setting key, unresolved by precedence.",
148
+ sideEffects: "none",
149
+ authorization: { permission: "settings.read.raw" },
150
+ inputSchema: GET_RAW_SCHEMA,
151
+ },
152
+ {
153
+ name: "settings_set_ui_preference",
154
+ description: "Sets one of the operator's own admin-UI preferences (interface language, theme, accent color, or notification sounds) and returns the stored value. Writes only to the calling operator's own user layer — it cannot target another operator, another scope, or any setting outside its fixed list. Use settings_get_effective to read current values first.",
155
+ sideEffects: "mutates-durable-state",
156
+ // The narrowest write grant in the system, and it is what this tool derives BECAUSE it never
157
+ // names a target principal (`write-service.ts`'s `deriveRequiredPermission`). Declared here
158
+ // to match; the handler does not pass this string, it lets the chokepoint derive it, so the
159
+ // two cannot drift into a state where this file advertises a check that is not the one run.
160
+ authorization: { permission: "settings.user.self.write" },
161
+ inputSchema: SET_UI_PREFERENCE_SCHEMA,
162
+ },
163
+ {
164
+ // EXCLUDED BY DESIGN, never wired: see this file's header. Generic "set any setting key" —
165
+ // a typical human admin UI for this domain is an uncurated free-text/raw-JSON editor, not a
166
+ // fixed named list. `settings_set_ui_preference` above is the curated alternative and does
167
+ // NOT make this one wireable: the whole difference is that its target key is enum-bounded.
168
+ name: "settings_set",
169
+ description: "Sets a setting's value at a scope. NEVER agent-callable — see file header.",
170
+ sideEffects: "mutates-durable-state",
171
+ authorization: { permission: "settings.workspace.write" },
172
+ },
173
+ {
174
+ // EXCLUDED BY DESIGN, never wired: see this file's header. Same "generic key" exclusion as
175
+ // settings_set.
176
+ name: "settings_clear",
177
+ description: "Clears a setting's value at a scope, reverting it to default. NEVER agent-callable — see file header.",
178
+ sideEffects: "mutates-durable-state",
179
+ authorization: { permission: "settings.workspace.write" },
180
+ },
181
+ {
182
+ // EXCLUDED BY DESIGN, never wired: see this file's header. Bulk variant of settings_clear —
183
+ // clears every value in an operator-named namespace at a scope in one call, irreversible.
184
+ name: "settings_reset",
185
+ description: "Resets every setting in a namespace to defaults at a scope. NEVER agent-callable — see file header.",
186
+ sideEffects: "mutates-durable-state",
187
+ authorization: { permission: "settings.reset.workspace" },
188
+ },
189
+ {
190
+ // EXCLUDED BY DESIGN, never wired: see this file's header. Schema-level, not value-level —
191
+ // can rename/retype/deprecate/tombstone the definition a key resolves through, changing how
192
+ // every existing stored value for that key is interpreted platform-wide.
193
+ name: "settings_register_definitions",
194
+ description: "Registers, renames, retypes, deprecates, or tombstones setting definitions. NEVER agent-callable — see file header.",
195
+ sideEffects: "mutates-durable-state",
196
+ authorization: { permission: "settings.definitions.manage" },
197
+ },
198
+ ];
199
+ }
200
+ //# sourceMappingURL=agent-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-tools.js","sourceRoot":"","sources":["../../src/settings/agent-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH,OAAO,EAAE,6BAA6B,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAkB5G;uFACuF;AACvF,MAAM,eAAe,GAAG;IACtB,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,EAAE;CACN,CAAC;AAEX;kGACkG;AAClG,MAAM,qBAAqB,GAAG;IAC5B,IAAI,EAAE,QAAQ;IACd,WAAW,EACT,8MAA8M;CACxM,CAAC;AAEX,MAAM,oBAAoB,GAAG;IAC3B,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,WAAW,CAAC;IACvB,UAAU,EAAE;QACV,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,WAAW,EAAE,gEAAgE,EAAE;QAC1H,WAAW,EAAE,qBAAqB;KACnC;CACO,CAAC;AAEX,MAAM,cAAc,GAAG;IACrB,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC;IAC9B,UAAU,EAAE;QACV,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,WAAW,EAAE,sEAAsE,EAAE;QAChI,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,WAAW,EAAE,uCAAuC,EAAE;QAC3F,WAAW,EAAE,qBAAqB;KACnC;CACO,CAAC;AAEX;;;;;;;;;;;;;GAaG;AACH,MAAM,wBAAwB,GAAG;IAC/B,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC;IAC9B,UAAU,EAAE;QACV,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,6BAA6B;YACnC,WAAW,EAAE,8DAA8D,0BAA0B,CAAC,GAAG,CACvG,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,SAAS,EAAE,CAClC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;SAChB;QACD,KAAK,EAAE;YACL,WAAW,EACT,wKAAwK;SAC3K;KACF;CACO,CAAC;AAEX;;;;;;;GAOG;AACH,MAAM,UAAU,2BAA2B;IACzC,OAAO;QACL;YACE,IAAI,EAAE,2BAA2B;YACjC,WAAW,EACT,oPAAoP;YACtP,WAAW,EAAE,MAAM;YACnB,aAAa,EAAE,EAAE,UAAU,EAAE,2BAA2B,EAAE;YAC1D,WAAW,EAAE,eAAe;SAC7B;QACD;YACE,IAAI,EAAE,wBAAwB;YAC9B,WAAW,EACT,uJAAuJ;YACzJ,WAAW,EAAE,MAAM;YACnB,aAAa,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE;YAC9C,WAAW,EAAE,oBAAoB;SAClC;QACD;YACE,IAAI,EAAE,kBAAkB;YACxB,WAAW,EAAE,mHAAmH;YAChI,WAAW,EAAE,MAAM;YACnB,aAAa,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE;YAClD,WAAW,EAAE,cAAc;SAC5B;QACD;YACE,IAAI,EAAE,4BAA4B;YAClC,WAAW,EACT,8VAA8V;YAChW,WAAW,EAAE,uBAAuB;YACpC,6FAA6F;YAC7F,4FAA4F;YAC5F,4FAA4F;YAC5F,4FAA4F;YAC5F,aAAa,EAAE,EAAE,UAAU,EAAE,0BAA0B,EAAE;YACzD,WAAW,EAAE,wBAAwB;SACtC;QACD;YACE,2FAA2F;YAC3F,4FAA4F;YAC5F,2FAA2F;YAC3F,2FAA2F;YAC3F,IAAI,EAAE,cAAc;YACpB,WAAW,EAAE,4EAA4E;YACzF,WAAW,EAAE,uBAAuB;YACpC,aAAa,EAAE,EAAE,UAAU,EAAE,0BAA0B,EAAE;SAC1D;QACD;YACE,2FAA2F;YAC3F,gBAAgB;YAChB,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,uGAAuG;YACpH,WAAW,EAAE,uBAAuB;YACpC,aAAa,EAAE,EAAE,UAAU,EAAE,0BAA0B,EAAE;SAC1D;QACD;YACE,4FAA4F;YAC5F,0FAA0F;YAC1F,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,qGAAqG;YAClH,WAAW,EAAE,uBAAuB;YACpC,aAAa,EAAE,EAAE,UAAU,EAAE,0BAA0B,EAAE;SAC1D;QACD;YACE,2FAA2F;YAC3F,4FAA4F;YAC5F,yEAAyE;YACzE,IAAI,EAAE,+BAA+B;YACrC,WAAW,EAAE,qHAAqH;YAClI,WAAW,EAAE,uBAAuB;YACpC,aAAa,EAAE,EAAE,UAAU,EAAE,6BAA6B,EAAE;SAC7D;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * One agent-writable preference.
3
+ *
4
+ * `namespace`/`key` are the ledger coordinates; `id` is the dotted form published to the model.
5
+ * They are kept as separate fields rather than split from `id` at call time because a key may
6
+ * itself contain dots (`telemetry.metrics` in the withheld privacy set proves the split is not
7
+ * unambiguous), so deriving one from the other would be a latent bug the moment the allowlist grows.
8
+ */
9
+ export interface AgentWritablePreference {
10
+ /** The dotted `namespace.key`, published in the tool's `setting` enum. */
11
+ readonly id: string;
12
+ readonly namespace: string;
13
+ readonly key: string;
14
+ /**
15
+ * Human-readable hint published alongside the enum, so a model knows what a legal value looks
16
+ * like without a round trip. NOT a validator — the ledger's registered definition schema is the
17
+ * only thing that accepts or rejects a value, and it is checked inside the write chokepoint.
18
+ */
19
+ readonly valueHint: string;
20
+ }
21
+ /**
22
+ * The scope every write through this surface uses.
23
+ *
24
+ * `user`, always, and never operator-selectable. All seven keys register `user | workspace`
25
+ * (`ui-tab-definitions.ts`'s `PER_OPERATOR_SCOPES` / `NOTIFICATIONS_SCOPES`), so `workspace` is
26
+ * reachable in principle — and deliberately not offered. A workspace-scoped write changes the
27
+ * inherited default for every operator who has no user-scoped row of their own, which is a write
28
+ * whose blast radius the caller cannot see. The user layer affects exactly one person, and
29
+ * `write-service.ts`'s `deriveRequiredPermission` gates it behind `settings.user.self.write`, the
30
+ * narrowest write grant in the system, only because the target principal is left unnamed.
31
+ */
32
+ export declare const AGENT_PREFERENCE_WRITE_SCOPE: "user";
33
+ /**
34
+ * Asserted by `__tests__/agent-writable-preferences.test.ts` against `ui-tab-definitions.ts`:
35
+ * every id below must correspond to a definition that is actually registered AND whose scope mask
36
+ * includes {@link SCOPE_BIT.user}. That test is the real guard on this file — an entry naming an
37
+ * unregistered key would otherwise fail only at call time, as a runtime `DefinitionNotFoundError`
38
+ * from inside the write chokepoint, on a tool the model had already been told it could call.
39
+ */
40
+ export declare const AGENT_WRITABLE_PREFERENCES: readonly AgentWritablePreference[];
41
+ /**
42
+ * The `setting` enum published in the tool's input schema.
43
+ *
44
+ * Derived from {@link AGENT_WRITABLE_PREFERENCES} rather than written out a second time: a
45
+ * hand-maintained copy is how an id ends up callable after being removed from the allowlist.
46
+ *
47
+ * @complexity O(n) once at module load.
48
+ */
49
+ export declare const AGENT_WRITABLE_PREFERENCE_IDS: readonly string[];
50
+ /**
51
+ * Resolves a model-supplied `setting` id to its ledger coordinates.
52
+ *
53
+ * Returns `undefined` for anything not on the allowlist — including ids the enum should already
54
+ * have rejected. The redundancy is the point: the enum lives in a schema a caller validates
55
+ * against, and this is the check that holds if that validation is ever bypassed, misconfigured, or
56
+ * outrun by a stale published descriptor. A curated allowlist that is enforced in only one place
57
+ * is enforced nowhere in particular.
58
+ *
59
+ * @param settingId - The dotted `namespace.key` from the tool input.
60
+ * @returns The matching preference, or `undefined` if it is not agent-writable.
61
+ * @complexity O(1).
62
+ * @overallScore 100
63
+ */
64
+ export declare function resolveAgentWritablePreference(settingId: string): AgentWritablePreference | undefined;
65
+ /** Re-exported so the drift test can assert the scope mask without reaching into `types.ts` itself. */
66
+ export declare const AGENT_PREFERENCE_REQUIRED_SCOPE_BIT: 4;
67
+ //# sourceMappingURL=agent-writable-preferences.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-writable-preferences.d.ts","sourceRoot":"","sources":["../../src/settings/agent-writable-preferences.ts"],"names":[],"mappings":"AAwDA;;;;;;;GAOG;AACH,MAAM,WAAW,uBAAuB;IACtC,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B,EAAG,MAAe,CAAC;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,EAAE,SAAS,uBAAuB,EA6CxE,CAAC;AAMF;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,EAAE,SAAS,MAAM,EAAgD,CAAC;AAE5G;;;;;;;;;;;;;GAaG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,MAAM,GAAG,uBAAuB,GAAG,SAAS,CAErG;AAED,uGAAuG;AACvG,eAAO,MAAM,mCAAmC,GAAiB,CAAC"}
@@ -0,0 +1,144 @@
1
+ /**
2
+ * @file The curated list of setting keys an agent may write — the precondition
3
+ * `agent-tools.ts`'s header names.
4
+ *
5
+ * ## Why this file has to exist before any settings write can be wired
6
+ *
7
+ * The generic setter (`settings_set`) is excluded from agent callability because there is no fixed,
8
+ * curated list of named settings to wire tools against for a generic admin surface — an operator
9
+ * can type any namespace string and edit any value through a raw editor. `ui-tab-definitions.ts`
10
+ * changes that for one specific slice: it registers a fixed, statically-declared set of keys — each
11
+ * with a schema, a default, and a scope mask — because the settings-dialog tabs need named keys to
12
+ * bind to. This module is the subset of THAT list which is safe for an agent to write.
13
+ *
14
+ * The exclusion's sharpest objection was that schema validation "constrains the VALUE shape, not
15
+ * WHICH key is targeted". That is exactly right about the generic setter, and exactly what
16
+ * {@link AGENT_WRITABLE_PREFERENCE_IDS} fixes: it is published as a JSON Schema `enum`, so the
17
+ * targeted key is constrained by the same mechanism that constrains everything else in the tool
18
+ * surface. The two halves together are complete — this file bounds WHICH key, and the ledger's
19
+ * own registered definition schema bounds the VALUE (`write-service.ts`'s `set()` validates
20
+ * against it and rejects a mismatch before any write lands).
21
+ *
22
+ * So the generic setter stays excluded, permanently and for its original reason. This is the
23
+ * curated alternative that exclusion explicitly pointed at, not a relaxation of it.
24
+ *
25
+ * ## What is deliberately NOT here
26
+ *
27
+ * `ui-tab-definitions.ts` registers 12 keys. Five are withheld:
28
+ *
29
+ * - **`core.privacy.telemetry.metrics` / `telemetry.content` / `decisionAt` / `installationId`** —
30
+ * a telemetry consent record whose entire purpose is to attest that a HUMAN decided. An agent
31
+ * writing it would not be recording a decision, it would be manufacturing one, and `decisionAt`
32
+ * is specifically the field the tab reads to know whether to stop asking. Withheld because the
33
+ * value means something different depending on who wrote it — the one property a curated
34
+ * allowlist cannot express.
35
+ * - **`core.instructions.custom`** — the custom instructions prepended to every admin-assistant
36
+ * conversation. An agent writing this edits its own standing prompt for all future runs. That
37
+ * may well be worth allowing later, but it is a self-modification question and not a display
38
+ * preference, so it does not ride in on the same decision.
39
+ *
40
+ * Every key that IS here is a per-operator display preference: reversible in one call, scoped to
41
+ * the caller's own user layer, and visible in the admin UI the moment it changes — which is what
42
+ * makes the whole surface auditable by looking at it.
43
+ *
44
+ * ## Architectural role
45
+ *
46
+ * `settings` domain data. No I/O, no enforcement — `tool-registrations.ts` performs the
47
+ * `authorize()` call and the write. Kept as data rather than inlined into the catalog so the tool
48
+ * schema, the handler's dispatch, and the drift test all read the same source.
49
+ */
50
+ import { SCOPE_BIT } from "./types.js";
51
+ import { APPEARANCE_NAMESPACE, LANGUAGE_NAMESPACE, NOTIFICATIONS_NAMESPACE, } from "./ui-tab-definitions.js";
52
+ /**
53
+ * The scope every write through this surface uses.
54
+ *
55
+ * `user`, always, and never operator-selectable. All seven keys register `user | workspace`
56
+ * (`ui-tab-definitions.ts`'s `PER_OPERATOR_SCOPES` / `NOTIFICATIONS_SCOPES`), so `workspace` is
57
+ * reachable in principle — and deliberately not offered. A workspace-scoped write changes the
58
+ * inherited default for every operator who has no user-scoped row of their own, which is a write
59
+ * whose blast radius the caller cannot see. The user layer affects exactly one person, and
60
+ * `write-service.ts`'s `deriveRequiredPermission` gates it behind `settings.user.self.write`, the
61
+ * narrowest write grant in the system, only because the target principal is left unnamed.
62
+ */
63
+ export const AGENT_PREFERENCE_WRITE_SCOPE = "user";
64
+ /**
65
+ * Asserted by `__tests__/agent-writable-preferences.test.ts` against `ui-tab-definitions.ts`:
66
+ * every id below must correspond to a definition that is actually registered AND whose scope mask
67
+ * includes {@link SCOPE_BIT.user}. That test is the real guard on this file — an entry naming an
68
+ * unregistered key would otherwise fail only at call time, as a runtime `DefinitionNotFoundError`
69
+ * from inside the write chokepoint, on a tool the model had already been told it could call.
70
+ */
71
+ export const AGENT_WRITABLE_PREFERENCES = [
72
+ {
73
+ id: "core.language.locale",
74
+ namespace: LANGUAGE_NAMESPACE,
75
+ key: "locale",
76
+ valueHint: "A BCP-47 language code the admin UI ships a translation for, e.g. 'en' or 'es'. An unrecognized code is stored but selects no option in the UI.",
77
+ },
78
+ {
79
+ id: "core.appearance.theme",
80
+ namespace: APPEARANCE_NAMESPACE,
81
+ key: "theme",
82
+ valueHint: "One of 'system', 'light', or 'dark'.",
83
+ },
84
+ {
85
+ id: "core.appearance.accentColor",
86
+ namespace: APPEARANCE_NAMESPACE,
87
+ key: "accentColor",
88
+ valueHint: "A hex color, e.g. '#2563eb'. Malformed values are rejected at render time.",
89
+ },
90
+ {
91
+ id: "core.notifications.soundEnabled",
92
+ namespace: NOTIFICATIONS_NAMESPACE,
93
+ key: "soundEnabled",
94
+ valueHint: "Boolean — whether a sound plays when an assistant run finishes.",
95
+ },
96
+ {
97
+ id: "core.notifications.successSoundId",
98
+ namespace: NOTIFICATIONS_NAMESPACE,
99
+ key: "successSoundId",
100
+ valueHint: "Sound id for a successful run, e.g. 'ding'. An unknown id falls back to the default.",
101
+ },
102
+ {
103
+ id: "core.notifications.failureSoundId",
104
+ namespace: NOTIFICATIONS_NAMESPACE,
105
+ key: "failureSoundId",
106
+ valueHint: "Sound id for a failed run, e.g. 'buzz'. An unknown id falls back to the default.",
107
+ },
108
+ {
109
+ id: "core.notifications.desktopEnabled",
110
+ namespace: NOTIFICATIONS_NAMESPACE,
111
+ key: "desktopEnabled",
112
+ valueHint: "Boolean — the operator's INTENT to receive desktop notifications. The browser's own Notification permission is separate and not settable from here.",
113
+ },
114
+ ];
115
+ const BY_ID = new Map(AGENT_WRITABLE_PREFERENCES.map((pref) => [pref.id, pref]));
116
+ /**
117
+ * The `setting` enum published in the tool's input schema.
118
+ *
119
+ * Derived from {@link AGENT_WRITABLE_PREFERENCES} rather than written out a second time: a
120
+ * hand-maintained copy is how an id ends up callable after being removed from the allowlist.
121
+ *
122
+ * @complexity O(n) once at module load.
123
+ */
124
+ export const AGENT_WRITABLE_PREFERENCE_IDS = AGENT_WRITABLE_PREFERENCES.map((p) => p.id);
125
+ /**
126
+ * Resolves a model-supplied `setting` id to its ledger coordinates.
127
+ *
128
+ * Returns `undefined` for anything not on the allowlist — including ids the enum should already
129
+ * have rejected. The redundancy is the point: the enum lives in a schema a caller validates
130
+ * against, and this is the check that holds if that validation is ever bypassed, misconfigured, or
131
+ * outrun by a stale published descriptor. A curated allowlist that is enforced in only one place
132
+ * is enforced nowhere in particular.
133
+ *
134
+ * @param settingId - The dotted `namespace.key` from the tool input.
135
+ * @returns The matching preference, or `undefined` if it is not agent-writable.
136
+ * @complexity O(1).
137
+ * @overallScore 100
138
+ */
139
+ export function resolveAgentWritablePreference(settingId) {
140
+ return BY_ID.get(settingId);
141
+ }
142
+ /** Re-exported so the drift test can assert the scope mask without reaching into `types.ts` itself. */
143
+ export const AGENT_PREFERENCE_REQUIRED_SCOPE_BIT = SCOPE_BIT.user;
144
+ //# sourceMappingURL=agent-writable-preferences.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-writable-preferences.js","sourceRoot":"","sources":["../../src/settings/agent-writable-preferences.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAuBjC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAe,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAuC;IAC5E;QACE,EAAE,EAAE,sBAAsB;QAC1B,SAAS,EAAE,kBAAkB;QAC7B,GAAG,EAAE,QAAQ;QACb,SAAS,EACP,iJAAiJ;KACpJ;IACD;QACE,EAAE,EAAE,uBAAuB;QAC3B,SAAS,EAAE,oBAAoB;QAC/B,GAAG,EAAE,OAAO;QACZ,SAAS,EAAE,sCAAsC;KAClD;IACD;QACE,EAAE,EAAE,6BAA6B;QACjC,SAAS,EAAE,oBAAoB;QAC/B,GAAG,EAAE,aAAa;QAClB,SAAS,EAAE,4EAA4E;KACxF;IACD;QACE,EAAE,EAAE,iCAAiC;QACrC,SAAS,EAAE,uBAAuB;QAClC,GAAG,EAAE,cAAc;QACnB,SAAS,EAAE,iEAAiE;KAC7E;IACD;QACE,EAAE,EAAE,mCAAmC;QACvC,SAAS,EAAE,uBAAuB;QAClC,GAAG,EAAE,gBAAgB;QACrB,SAAS,EAAE,sFAAsF;KAClG;IACD;QACE,EAAE,EAAE,mCAAmC;QACvC,SAAS,EAAE,uBAAuB;QAClC,GAAG,EAAE,gBAAgB;QACrB,SAAS,EAAE,kFAAkF;KAC9F;IACD;QACE,EAAE,EAAE,mCAAmC;QACvC,SAAS,EAAE,uBAAuB;QAClC,GAAG,EAAE,gBAAgB;QACrB,SAAS,EACP,qJAAqJ;KACxJ;CACF,CAAC;AAEF,MAAM,KAAK,GAAiD,IAAI,GAAG,CACjE,0BAA0B,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAC1D,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAsB,0BAA0B,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAE5G;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,8BAA8B,CAAC,SAAiB;IAC9D,OAAO,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAC9B,CAAC;AAED,uGAAuG;AACvG,MAAM,CAAC,MAAM,mCAAmC,GAAG,SAAS,CAAC,IAAI,CAAC"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * @file Decides which ledger revisions a given caller may be TOLD about, and which namespaces that
3
+ * implies. Kept as pure logic here so a host's transport layer (an SSE/polling route, a websocket
4
+ * push) can be tested without an HTTP server or a clock.
5
+ *
6
+ * ## Why a change feed exists at all
7
+ *
8
+ * A settings write made in one process is invisible to an already-rendered admin tab in another.
9
+ * That is true for a background daemon (a separate OS process) and equally true for a second
10
+ * browser tab, another operator, or a background job. The revision ledger is the one place every
11
+ * write lands regardless of who made it, and its `seq` is a monotonic autoincrement in shared
12
+ * storage — so polling it is cross-process by construction, needing no IPC and no message broker.
13
+ *
14
+ * ## The disclosure rule
15
+ *
16
+ * A subscriber must not learn that settings it cannot read have changed. Even a bare namespace name
17
+ * is a signal — "someone else's preferences just changed" is information the caller was never
18
+ * granted. {@link isRevisionVisibleTo} is therefore an allowlist, not a denylist: an unrecognized
19
+ * scope is withheld rather than passed through, so a future scope added to `SettingScope` is
20
+ * invisible until someone decides what it should mean here.
21
+ *
22
+ * Nothing in the emitted payload carries a VALUE. Subscribers receive namespace names and re-read
23
+ * through the ordinary authorized read path, which is what keeps this module's responsibility
24
+ * narrow: it decides who hears that something moved, never what it moved to.
25
+ */
26
+ import type { SettingRevisionRecord } from "./types.js";
27
+ /** The caller a change feed is being filtered for. */
28
+ export interface ChangeFeedViewer {
29
+ /** The workspace whose admin surface is subscribed. */
30
+ workspaceId: string;
31
+ /** The subscribing principal — the only one whose user-layer changes are disclosed. */
32
+ principalId: string;
33
+ }
34
+ /**
35
+ * Whether `revision` may be disclosed to `viewer`.
36
+ *
37
+ * - **`global`** — platform-wide values every workspace resolves through. Disclosed.
38
+ * - **`workspace`** — disclosed only for the viewer's own workspace (tenant scoping).
39
+ * - **`user`** — disclosed only when the viewer IS the target principal. Another operator's
40
+ * preference changing is not the viewer's business, and telling them would leak both that the
41
+ * other principal exists and that they are active right now.
42
+ * - **definition revisions** (`entityKind: 'definition'`, which carry `scope: null`) — these
43
+ * retype, rename, deprecate, or tombstone a definition, changing how every stored value for that
44
+ * key is interpreted. Workspace-scoped by the definition's own `workspaceId`, with `null` meaning
45
+ * a platform definition visible to all.
46
+ *
47
+ * @complexity O(1).
48
+ * @overallScore 100
49
+ */
50
+ export declare function isRevisionVisibleTo(revision: SettingRevisionRecord, viewer: ChangeFeedViewer): boolean;
51
+ /** One batch of visible changes, plus the cursor a subscriber resumes from. */
52
+ export interface ChangeFeedBatch {
53
+ /** Namespaces to re-read, de-duplicated. Empty when nothing visible changed. */
54
+ namespaces: string[];
55
+ /** The highest `seq` examined — advanced even when nothing was visible, so a stream of writes the
56
+ * viewer cannot see does not make it re-examine them forever. */
57
+ cursor: number;
58
+ }
59
+ /**
60
+ * Reduces raw revisions into the namespaces `viewer` should re-read.
61
+ *
62
+ * `resolveNamespace` returns `null` for a revision whose definition can no longer be resolved (a
63
+ * tombstoned or since-deleted setting). Those advance the cursor but emit nothing: there is no
64
+ * namespace to name, and inventing one would send subscribers chasing a key that is gone.
65
+ *
66
+ * @param revisions - Ledger rows, ascending by `seq`.
67
+ * @param viewer - The subscriber to filter for.
68
+ * @param resolveNamespace - Maps a `settingId` to its namespace, or `null` if unresolvable.
69
+ * @returns The namespaces to refresh and the cursor to resume from.
70
+ * @complexity O(n) in `revisions`, plus one `resolveNamespace` per visible revision.
71
+ * @overallScore 100
72
+ */
73
+ export declare function collectChangedNamespaces(revisions: readonly SettingRevisionRecord[], viewer: ChangeFeedViewer, resolveNamespace: (settingId: string) => Promise<string | null>): Promise<ChangeFeedBatch>;
74
+ //# sourceMappingURL=change-feed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change-feed.d.ts","sourceRoot":"","sources":["../../src/settings/change-feed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,sDAAsD;AACtD,MAAM,WAAW,gBAAgB;IAC/B,uDAAuD;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,uFAAuF;IACvF,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,qBAAqB,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAgBtG;AAED,+EAA+E;AAC/E,MAAM,WAAW,eAAe;IAC9B,gFAAgF;IAChF,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB;sEACkE;IAClE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,wBAAwB,CAC5C,SAAS,EAAE,SAAS,qBAAqB,EAAE,EAC3C,MAAM,EAAE,gBAAgB,EACxB,gBAAgB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAC9D,OAAO,CAAC,eAAe,CAAC,CAY1B"}