@ixo/decision-oracle 0.0.0-stage → 0.2.1

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 (1118) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +794 -2
  3. package/dist/act.d.ts +87 -0
  4. package/dist/act.d.ts.map +1 -0
  5. package/dist/act.js +20 -0
  6. package/dist/act.js.map +1 -0
  7. package/dist/app.d.ts +22 -0
  8. package/dist/app.d.ts.map +1 -0
  9. package/dist/app.js +128 -0
  10. package/dist/app.js.map +1 -0
  11. package/dist/c2pa.wasm +0 -0
  12. package/dist/cli/commands/api.d.ts +50 -0
  13. package/dist/cli/commands/api.d.ts.map +1 -0
  14. package/dist/cli/commands/api.js +737 -0
  15. package/dist/cli/commands/api.js.map +1 -0
  16. package/dist/cli/commands/create-collection.d.ts +40 -0
  17. package/dist/cli/commands/create-collection.d.ts.map +1 -0
  18. package/dist/cli/commands/create-collection.js +318 -0
  19. package/dist/cli/commands/create-collection.js.map +1 -0
  20. package/dist/cli/commands/create-deed.d.ts +31 -0
  21. package/dist/cli/commands/create-deed.d.ts.map +1 -0
  22. package/dist/cli/commands/create-deed.js +208 -0
  23. package/dist/cli/commands/create-deed.js.map +1 -0
  24. package/dist/cli/commands/delegation.d.ts +26 -0
  25. package/dist/cli/commands/delegation.d.ts.map +1 -0
  26. package/dist/cli/commands/delegation.js +162 -0
  27. package/dist/cli/commands/delegation.js.map +1 -0
  28. package/dist/cli/commands/derive.d.ts +22 -0
  29. package/dist/cli/commands/derive.d.ts.map +1 -0
  30. package/dist/cli/commands/derive.js +53 -0
  31. package/dist/cli/commands/derive.js.map +1 -0
  32. package/dist/cli/commands/engine.d.ts +25 -0
  33. package/dist/cli/commands/engine.d.ts.map +1 -0
  34. package/dist/cli/commands/engine.js +107 -0
  35. package/dist/cli/commands/engine.js.map +1 -0
  36. package/dist/cli/commands/erase.d.ts +17 -0
  37. package/dist/cli/commands/erase.d.ts.map +1 -0
  38. package/dist/cli/commands/erase.js +117 -0
  39. package/dist/cli/commands/erase.js.map +1 -0
  40. package/dist/cli/commands/facts-run.d.ts +30 -0
  41. package/dist/cli/commands/facts-run.d.ts.map +1 -0
  42. package/dist/cli/commands/facts-run.js +409 -0
  43. package/dist/cli/commands/facts-run.js.map +1 -0
  44. package/dist/cli/commands/facts-scaffold.d.ts +22 -0
  45. package/dist/cli/commands/facts-scaffold.d.ts.map +1 -0
  46. package/dist/cli/commands/facts-scaffold.js +208 -0
  47. package/dist/cli/commands/facts-scaffold.js.map +1 -0
  48. package/dist/cli/commands/init.d.ts +18 -0
  49. package/dist/cli/commands/init.d.ts.map +1 -0
  50. package/dist/cli/commands/init.js +34 -0
  51. package/dist/cli/commands/init.js.map +1 -0
  52. package/dist/cli/commands/login.d.ts +9 -0
  53. package/dist/cli/commands/login.d.ts.map +1 -0
  54. package/dist/cli/commands/login.js +16 -0
  55. package/dist/cli/commands/login.js.map +1 -0
  56. package/dist/cli/commands/logout.d.ts +10 -0
  57. package/dist/cli/commands/logout.d.ts.map +1 -0
  58. package/dist/cli/commands/logout.js +28 -0
  59. package/dist/cli/commands/logout.js.map +1 -0
  60. package/dist/cli/commands/manifest.d.ts +12 -0
  61. package/dist/cli/commands/manifest.d.ts.map +1 -0
  62. package/dist/cli/commands/manifest.js +48 -0
  63. package/dist/cli/commands/manifest.js.map +1 -0
  64. package/dist/cli/commands/oracle-init.d.ts +48 -0
  65. package/dist/cli/commands/oracle-init.d.ts.map +1 -0
  66. package/dist/cli/commands/oracle-init.js +1122 -0
  67. package/dist/cli/commands/oracle-init.js.map +1 -0
  68. package/dist/cli/commands/org.d.ts +28 -0
  69. package/dist/cli/commands/org.d.ts.map +1 -0
  70. package/dist/cli/commands/org.js +309 -0
  71. package/dist/cli/commands/org.js.map +1 -0
  72. package/dist/cli/commands/protocol-review.d.ts +20 -0
  73. package/dist/cli/commands/protocol-review.d.ts.map +1 -0
  74. package/dist/cli/commands/protocol-review.js +162 -0
  75. package/dist/cli/commands/protocol-review.js.map +1 -0
  76. package/dist/cli/commands/publish-protocol.d.ts +43 -0
  77. package/dist/cli/commands/publish-protocol.d.ts.map +1 -0
  78. package/dist/cli/commands/publish-protocol.js +345 -0
  79. package/dist/cli/commands/publish-protocol.js.map +1 -0
  80. package/dist/cli/commands/register.d.ts +16 -0
  81. package/dist/cli/commands/register.d.ts.map +1 -0
  82. package/dist/cli/commands/register.js +54 -0
  83. package/dist/cli/commands/register.js.map +1 -0
  84. package/dist/cli/commands/relink.d.ts +11 -0
  85. package/dist/cli/commands/relink.d.ts.map +1 -0
  86. package/dist/cli/commands/relink.js +36 -0
  87. package/dist/cli/commands/relink.js.map +1 -0
  88. package/dist/cli/commands/rubric-fetch-form.d.ts +16 -0
  89. package/dist/cli/commands/rubric-fetch-form.d.ts.map +1 -0
  90. package/dist/cli/commands/rubric-fetch-form.js +83 -0
  91. package/dist/cli/commands/rubric-fetch-form.js.map +1 -0
  92. package/dist/cli/commands/rubric-validate.d.ts +72 -0
  93. package/dist/cli/commands/rubric-validate.d.ts.map +1 -0
  94. package/dist/cli/commands/rubric-validate.js +163 -0
  95. package/dist/cli/commands/rubric-validate.js.map +1 -0
  96. package/dist/cli/commands/scan.d.ts +13 -0
  97. package/dist/cli/commands/scan.d.ts.map +1 -0
  98. package/dist/cli/commands/scan.js +39 -0
  99. package/dist/cli/commands/scan.js.map +1 -0
  100. package/dist/cli/commands/skills.d.ts +11 -0
  101. package/dist/cli/commands/skills.d.ts.map +1 -0
  102. package/dist/cli/commands/skills.js +19 -0
  103. package/dist/cli/commands/skills.js.map +1 -0
  104. package/dist/cli/commands/submit-claim.d.ts +25 -0
  105. package/dist/cli/commands/submit-claim.d.ts.map +1 -0
  106. package/dist/cli/commands/submit-claim.js +155 -0
  107. package/dist/cli/commands/submit-claim.js.map +1 -0
  108. package/dist/cli/index.d.ts +15 -0
  109. package/dist/cli/index.d.ts.map +1 -0
  110. package/dist/cli/index.js +206 -0
  111. package/dist/cli/index.js.map +1 -0
  112. package/dist/cli/lib/agent-card-schema.d.ts +8 -0
  113. package/dist/cli/lib/agent-card-schema.d.ts.map +1 -0
  114. package/dist/cli/lib/agent-card-schema.js +169 -0
  115. package/dist/cli/lib/agent-card-schema.js.map +1 -0
  116. package/dist/cli/lib/ai-rest.d.ts +12 -0
  117. package/dist/cli/lib/ai-rest.d.ts.map +1 -0
  118. package/dist/cli/lib/ai-rest.js +36 -0
  119. package/dist/cli/lib/ai-rest.js.map +1 -0
  120. package/dist/cli/lib/args.d.ts +33 -0
  121. package/dist/cli/lib/args.d.ts.map +1 -0
  122. package/dist/cli/lib/args.js +24 -0
  123. package/dist/cli/lib/args.js.map +1 -0
  124. package/dist/cli/lib/authhub.d.ts +7 -0
  125. package/dist/cli/lib/authhub.d.ts.map +1 -0
  126. package/dist/cli/lib/authhub.js +210 -0
  127. package/dist/cli/lib/authhub.js.map +1 -0
  128. package/dist/cli/lib/chain.d.ts +264 -0
  129. package/dist/cli/lib/chain.d.ts.map +1 -0
  130. package/dist/cli/lib/chain.js +584 -0
  131. package/dist/cli/lib/chain.js.map +1 -0
  132. package/dist/cli/lib/devvars.d.ts +59 -0
  133. package/dist/cli/lib/devvars.d.ts.map +1 -0
  134. package/dist/cli/lib/devvars.js +206 -0
  135. package/dist/cli/lib/devvars.js.map +1 -0
  136. package/dist/cli/lib/engine.d.ts +54 -0
  137. package/dist/cli/lib/engine.d.ts.map +1 -0
  138. package/dist/cli/lib/engine.js +112 -0
  139. package/dist/cli/lib/engine.js.map +1 -0
  140. package/dist/cli/lib/identity-cards.d.ts +188 -0
  141. package/dist/cli/lib/identity-cards.d.ts.map +1 -0
  142. package/dist/cli/lib/identity-cards.js +261 -0
  143. package/dist/cli/lib/identity-cards.js.map +1 -0
  144. package/dist/cli/lib/matrix-account.d.ts +79 -0
  145. package/dist/cli/lib/matrix-account.d.ts.map +1 -0
  146. package/dist/cli/lib/matrix-account.js +228 -0
  147. package/dist/cli/lib/matrix-account.js.map +1 -0
  148. package/dist/cli/lib/oracle-account.d.ts +108 -0
  149. package/dist/cli/lib/oracle-account.d.ts.map +1 -0
  150. package/dist/cli/lib/oracle-account.js +207 -0
  151. package/dist/cli/lib/oracle-account.js.map +1 -0
  152. package/dist/cli/lib/project.d.ts +22 -0
  153. package/dist/cli/lib/project.d.ts.map +1 -0
  154. package/dist/cli/lib/project.js +62 -0
  155. package/dist/cli/lib/project.js.map +1 -0
  156. package/dist/cli/lib/session.d.ts +109 -0
  157. package/dist/cli/lib/session.d.ts.map +1 -0
  158. package/dist/cli/lib/session.js +354 -0
  159. package/dist/cli/lib/session.js.map +1 -0
  160. package/dist/cli/lib/workorder.d.ts +57 -0
  161. package/dist/cli/lib/workorder.d.ts.map +1 -0
  162. package/dist/cli/lib/workorder.js +101 -0
  163. package/dist/cli/lib/workorder.js.map +1 -0
  164. package/dist/config.d.ts +221 -0
  165. package/dist/config.d.ts.map +1 -0
  166. package/dist/config.js +431 -0
  167. package/dist/config.js.map +1 -0
  168. package/dist/context.d.ts +88 -0
  169. package/dist/context.d.ts.map +1 -0
  170. package/dist/context.js +9 -0
  171. package/dist/context.js.map +1 -0
  172. package/dist/contracts/api.d.ts +3367 -0
  173. package/dist/contracts/api.d.ts.map +1 -0
  174. package/dist/contracts/api.js +1303 -0
  175. package/dist/contracts/api.js.map +1 -0
  176. package/dist/contracts/capabilities.d.ts +126 -0
  177. package/dist/contracts/capabilities.d.ts.map +1 -0
  178. package/dist/contracts/capabilities.js +164 -0
  179. package/dist/contracts/capabilities.js.map +1 -0
  180. package/dist/contracts/claim-source.d.ts +98 -0
  181. package/dist/contracts/claim-source.d.ts.map +1 -0
  182. package/dist/contracts/claim-source.js +17 -0
  183. package/dist/contracts/claim-source.js.map +1 -0
  184. package/dist/contracts/errors.d.ts +150 -0
  185. package/dist/contracts/errors.d.ts.map +1 -0
  186. package/dist/contracts/errors.js +121 -0
  187. package/dist/contracts/errors.js.map +1 -0
  188. package/dist/contracts/index.d.ts +15 -0
  189. package/dist/contracts/index.d.ts.map +1 -0
  190. package/dist/contracts/index.js +11 -0
  191. package/dist/contracts/index.js.map +1 -0
  192. package/dist/contracts/payment-gate.d.ts +129 -0
  193. package/dist/contracts/payment-gate.d.ts.map +1 -0
  194. package/dist/contracts/payment-gate.js +24 -0
  195. package/dist/contracts/payment-gate.js.map +1 -0
  196. package/dist/contracts/start-api-claim.d.ts +90 -0
  197. package/dist/contracts/start-api-claim.d.ts.map +1 -0
  198. package/dist/contracts/start-api-claim.js +22 -0
  199. package/dist/contracts/start-api-claim.js.map +1 -0
  200. package/dist/contracts/webhooks.d.ts +1487 -0
  201. package/dist/contracts/webhooks.d.ts.map +1 -0
  202. package/dist/contracts/webhooks.js +71 -0
  203. package/dist/contracts/webhooks.js.map +1 -0
  204. package/dist/contracts/work-order.d.ts +29 -0
  205. package/dist/contracts/work-order.d.ts.map +1 -0
  206. package/dist/contracts/work-order.js +12 -0
  207. package/dist/contracts/work-order.js.map +1 -0
  208. package/dist/cron/ai-cost.d.ts +29 -0
  209. package/dist/cron/ai-cost.d.ts.map +1 -0
  210. package/dist/cron/ai-cost.js +80 -0
  211. package/dist/cron/ai-cost.js.map +1 -0
  212. package/dist/cron/api-lane.d.ts +39 -0
  213. package/dist/cron/api-lane.d.ts.map +1 -0
  214. package/dist/cron/api-lane.js +203 -0
  215. package/dist/cron/api-lane.js.map +1 -0
  216. package/dist/cron/backlog.d.ts +50 -0
  217. package/dist/cron/backlog.d.ts.map +1 -0
  218. package/dist/cron/backlog.js +115 -0
  219. package/dist/cron/backlog.js.map +1 -0
  220. package/dist/cron/billing.d.ts +11 -0
  221. package/dist/cron/billing.d.ts.map +1 -0
  222. package/dist/cron/billing.js +69 -0
  223. package/dist/cron/billing.js.map +1 -0
  224. package/dist/cron/collection.d.ts +50 -0
  225. package/dist/cron/collection.d.ts.map +1 -0
  226. package/dist/cron/collection.js +118 -0
  227. package/dist/cron/collection.js.map +1 -0
  228. package/dist/cron/funding.d.ts +16 -0
  229. package/dist/cron/funding.d.ts.map +1 -0
  230. package/dist/cron/funding.js +262 -0
  231. package/dist/cron/funding.js.map +1 -0
  232. package/dist/cron/payer-billing.d.ts +38 -0
  233. package/dist/cron/payer-billing.d.ts.map +1 -0
  234. package/dist/cron/payer-billing.js +119 -0
  235. package/dist/cron/payer-billing.js.map +1 -0
  236. package/dist/cron/scan.d.ts +43 -0
  237. package/dist/cron/scan.d.ts.map +1 -0
  238. package/dist/cron/scan.js +250 -0
  239. package/dist/cron/scan.js.map +1 -0
  240. package/dist/db/client.d.ts +14 -0
  241. package/dist/db/client.d.ts.map +1 -0
  242. package/dist/db/client.js +14 -0
  243. package/dist/db/client.js.map +1 -0
  244. package/dist/db/index.d.ts +7 -0
  245. package/dist/db/index.d.ts.map +1 -0
  246. package/dist/db/index.js +7 -0
  247. package/dist/db/index.js.map +1 -0
  248. package/dist/db/schema.d.ts +6738 -0
  249. package/dist/db/schema.d.ts.map +1 -0
  250. package/dist/db/schema.js +1433 -0
  251. package/dist/db/schema.js.map +1 -0
  252. package/dist/define-oracle.d.ts +32 -0
  253. package/dist/define-oracle.d.ts.map +1 -0
  254. package/dist/define-oracle.js +80 -0
  255. package/dist/define-oracle.js.map +1 -0
  256. package/dist/dev-oracle.d.ts +9 -0
  257. package/dist/dev-oracle.d.ts.map +1 -0
  258. package/dist/dev-oracle.js +19 -0
  259. package/dist/dev-oracle.js.map +1 -0
  260. package/dist/dev-worker.d.ts +10 -0
  261. package/dist/dev-worker.d.ts.map +1 -0
  262. package/dist/dev-worker.js +12 -0
  263. package/dist/dev-worker.js.map +1 -0
  264. package/dist/env.d.ts +146 -0
  265. package/dist/env.d.ts.map +1 -0
  266. package/dist/env.js +10 -0
  267. package/dist/env.js.map +1 -0
  268. package/dist/facts/exif.d.ts +43 -0
  269. package/dist/facts/exif.d.ts.map +1 -0
  270. package/dist/facts/exif.js +224 -0
  271. package/dist/facts/exif.js.map +1 -0
  272. package/dist/facts/fact.d.ts +62 -0
  273. package/dist/facts/fact.d.ts.map +1 -0
  274. package/dist/facts/fact.js +105 -0
  275. package/dist/facts/fact.js.map +1 -0
  276. package/dist/facts/geo.d.ts +55 -0
  277. package/dist/facts/geo.d.ts.map +1 -0
  278. package/dist/facts/geo.js +267 -0
  279. package/dist/facts/geo.js.map +1 -0
  280. package/dist/facts/index.d.ts +31 -0
  281. package/dist/facts/index.d.ts.map +1 -0
  282. package/dist/facts/index.js +27 -0
  283. package/dist/facts/index.js.map +1 -0
  284. package/dist/facts/linked-doc.d.ts +60 -0
  285. package/dist/facts/linked-doc.d.ts.map +1 -0
  286. package/dist/facts/linked-doc.js +101 -0
  287. package/dist/facts/linked-doc.js.map +1 -0
  288. package/dist/facts/types.d.ts +278 -0
  289. package/dist/facts/types.d.ts.map +1 -0
  290. package/dist/facts/types.js +19 -0
  291. package/dist/facts/types.js.map +1 -0
  292. package/dist/index.d.ts +25 -0
  293. package/dist/index.d.ts.map +1 -0
  294. package/dist/index.js +19 -0
  295. package/dist/index.js.map +1 -0
  296. package/dist/lib/api-lane/accept.d.ts +29 -0
  297. package/dist/lib/api-lane/accept.d.ts.map +1 -0
  298. package/dist/lib/api-lane/accept.js +218 -0
  299. package/dist/lib/api-lane/accept.js.map +1 -0
  300. package/dist/lib/api-lane/claim-list.d.ts +44 -0
  301. package/dist/lib/api-lane/claim-list.d.ts.map +1 -0
  302. package/dist/lib/api-lane/claim-list.js +92 -0
  303. package/dist/lib/api-lane/claim-list.js.map +1 -0
  304. package/dist/lib/api-lane/company.d.ts +56 -0
  305. package/dist/lib/api-lane/company.d.ts.map +1 -0
  306. package/dist/lib/api-lane/company.js +103 -0
  307. package/dist/lib/api-lane/company.js.map +1 -0
  308. package/dist/lib/api-lane/events.d.ts +21 -0
  309. package/dist/lib/api-lane/events.d.ts.map +1 -0
  310. package/dist/lib/api-lane/events.js +111 -0
  311. package/dist/lib/api-lane/events.js.map +1 -0
  312. package/dist/lib/api-lane/ids.d.ts +39 -0
  313. package/dist/lib/api-lane/ids.d.ts.map +1 -0
  314. package/dist/lib/api-lane/ids.js +78 -0
  315. package/dist/lib/api-lane/ids.js.map +1 -0
  316. package/dist/lib/api-lane/index.d.ts +16 -0
  317. package/dist/lib/api-lane/index.d.ts.map +1 -0
  318. package/dist/lib/api-lane/index.js +16 -0
  319. package/dist/lib/api-lane/index.js.map +1 -0
  320. package/dist/lib/api-lane/linked.d.ts +264 -0
  321. package/dist/lib/api-lane/linked.d.ts.map +1 -0
  322. package/dist/lib/api-lane/linked.js +272 -0
  323. package/dist/lib/api-lane/linked.js.map +1 -0
  324. package/dist/lib/api-lane/media-type.d.ts +15 -0
  325. package/dist/lib/api-lane/media-type.d.ts.map +1 -0
  326. package/dist/lib/api-lane/media-type.js +73 -0
  327. package/dist/lib/api-lane/media-type.js.map +1 -0
  328. package/dist/lib/api-lane/member-emails.d.ts +83 -0
  329. package/dist/lib/api-lane/member-emails.d.ts.map +1 -0
  330. package/dist/lib/api-lane/member-emails.js +213 -0
  331. package/dist/lib/api-lane/member-emails.js.map +1 -0
  332. package/dist/lib/api-lane/members.d.ts +42 -0
  333. package/dist/lib/api-lane/members.d.ts.map +1 -0
  334. package/dist/lib/api-lane/members.js +75 -0
  335. package/dist/lib/api-lane/members.js.map +1 -0
  336. package/dist/lib/api-lane/notify.d.ts +47 -0
  337. package/dist/lib/api-lane/notify.d.ts.map +1 -0
  338. package/dist/lib/api-lane/notify.js +240 -0
  339. package/dist/lib/api-lane/notify.js.map +1 -0
  340. package/dist/lib/api-lane/pause.d.ts +41 -0
  341. package/dist/lib/api-lane/pause.d.ts.map +1 -0
  342. package/dist/lib/api-lane/pause.js +155 -0
  343. package/dist/lib/api-lane/pause.js.map +1 -0
  344. package/dist/lib/api-lane/record.d.ts +76 -0
  345. package/dist/lib/api-lane/record.d.ts.map +1 -0
  346. package/dist/lib/api-lane/record.js +337 -0
  347. package/dist/lib/api-lane/record.js.map +1 -0
  348. package/dist/lib/api-lane/retention.d.ts +43 -0
  349. package/dist/lib/api-lane/retention.d.ts.map +1 -0
  350. package/dist/lib/api-lane/retention.js +176 -0
  351. package/dist/lib/api-lane/retention.js.map +1 -0
  352. package/dist/lib/api-lane/review.d.ts +76 -0
  353. package/dist/lib/api-lane/review.d.ts.map +1 -0
  354. package/dist/lib/api-lane/review.js +355 -0
  355. package/dist/lib/api-lane/review.js.map +1 -0
  356. package/dist/lib/api-lane/reviewers.d.ts +109 -0
  357. package/dist/lib/api-lane/reviewers.d.ts.map +1 -0
  358. package/dist/lib/api-lane/reviewers.js +755 -0
  359. package/dist/lib/api-lane/reviewers.js.map +1 -0
  360. package/dist/lib/api-lane/source-delete.d.ts +16 -0
  361. package/dist/lib/api-lane/source-delete.d.ts.map +1 -0
  362. package/dist/lib/api-lane/source-delete.js +50 -0
  363. package/dist/lib/api-lane/source-delete.js.map +1 -0
  364. package/dist/lib/api-lane/source.d.ts +19 -0
  365. package/dist/lib/api-lane/source.d.ts.map +1 -0
  366. package/dist/lib/api-lane/source.js +226 -0
  367. package/dist/lib/api-lane/source.js.map +1 -0
  368. package/dist/lib/api-lane/submitter.d.ts +22 -0
  369. package/dist/lib/api-lane/submitter.d.ts.map +1 -0
  370. package/dist/lib/api-lane/submitter.js +34 -0
  371. package/dist/lib/api-lane/submitter.js.map +1 -0
  372. package/dist/lib/api-lane/timeline.d.ts +20 -0
  373. package/dist/lib/api-lane/timeline.d.ts.map +1 -0
  374. package/dist/lib/api-lane/timeline.js +23 -0
  375. package/dist/lib/api-lane/timeline.js.map +1 -0
  376. package/dist/lib/api-lane/webhook-crypto.d.ts +44 -0
  377. package/dist/lib/api-lane/webhook-crypto.d.ts.map +1 -0
  378. package/dist/lib/api-lane/webhook-crypto.js +103 -0
  379. package/dist/lib/api-lane/webhook-crypto.js.map +1 -0
  380. package/dist/lib/api-lane/webhooks.d.ts +117 -0
  381. package/dist/lib/api-lane/webhooks.d.ts.map +1 -0
  382. package/dist/lib/api-lane/webhooks.js +503 -0
  383. package/dist/lib/api-lane/webhooks.js.map +1 -0
  384. package/dist/lib/archive.d.ts +64 -0
  385. package/dist/lib/archive.d.ts.map +1 -0
  386. package/dist/lib/archive.js +305 -0
  387. package/dist/lib/archive.js.map +1 -0
  388. package/dist/lib/bech32.d.ts +8 -0
  389. package/dist/lib/bech32.d.ts.map +1 -0
  390. package/dist/lib/bech32.js +39 -0
  391. package/dist/lib/bech32.js.map +1 -0
  392. package/dist/lib/claim-erase.d.ts +22 -0
  393. package/dist/lib/claim-erase.d.ts.map +1 -0
  394. package/dist/lib/claim-erase.js +44 -0
  395. package/dist/lib/claim-erase.js.map +1 -0
  396. package/dist/lib/cursor.d.ts +11 -0
  397. package/dist/lib/cursor.d.ts.map +1 -0
  398. package/dist/lib/cursor.js +20 -0
  399. package/dist/lib/cursor.js.map +1 -0
  400. package/dist/lib/email/send.d.ts +43 -0
  401. package/dist/lib/email/send.d.ts.map +1 -0
  402. package/dist/lib/email/send.js +71 -0
  403. package/dist/lib/email/send.js.map +1 -0
  404. package/dist/lib/email/template.d.ts +217 -0
  405. package/dist/lib/email/template.d.ts.map +1 -0
  406. package/dist/lib/email/template.js +713 -0
  407. package/dist/lib/email/template.js.map +1 -0
  408. package/dist/lib/engine/adr36.d.ts +56 -0
  409. package/dist/lib/engine/adr36.d.ts.map +1 -0
  410. package/dist/lib/engine/adr36.js +76 -0
  411. package/dist/lib/engine/adr36.js.map +1 -0
  412. package/dist/lib/engine/client.d.ts +162 -0
  413. package/dist/lib/engine/client.d.ts.map +1 -0
  414. package/dist/lib/engine/client.js +473 -0
  415. package/dist/lib/engine/client.js.map +1 -0
  416. package/dist/lib/engine/types.d.ts +1356 -0
  417. package/dist/lib/engine/types.d.ts.map +1 -0
  418. package/dist/lib/engine/types.js +562 -0
  419. package/dist/lib/engine/types.js.map +1 -0
  420. package/dist/lib/errors.d.ts +73 -0
  421. package/dist/lib/errors.d.ts.map +1 -0
  422. package/dist/lib/errors.js +96 -0
  423. package/dist/lib/errors.js.map +1 -0
  424. package/dist/lib/facts/builder.d.ts +88 -0
  425. package/dist/lib/facts/builder.d.ts.map +1 -0
  426. package/dist/lib/facts/builder.js +239 -0
  427. package/dist/lib/facts/builder.js.map +1 -0
  428. package/dist/lib/facts/ctx.d.ts +34 -0
  429. package/dist/lib/facts/ctx.d.ts.map +1 -0
  430. package/dist/lib/facts/ctx.js +51 -0
  431. package/dist/lib/facts/ctx.js.map +1 -0
  432. package/dist/lib/facts/expected.d.ts +23 -0
  433. package/dist/lib/facts/expected.d.ts.map +1 -0
  434. package/dist/lib/facts/expected.js +16 -0
  435. package/dist/lib/facts/expected.js.map +1 -0
  436. package/dist/lib/facts/fact-cache.d.ts +469 -0
  437. package/dist/lib/facts/fact-cache.d.ts.map +1 -0
  438. package/dist/lib/facts/fact-cache.js +52 -0
  439. package/dist/lib/facts/fact-cache.js.map +1 -0
  440. package/dist/lib/facts/factset.d.ts +608 -0
  441. package/dist/lib/facts/factset.d.ts.map +1 -0
  442. package/dist/lib/facts/factset.js +226 -0
  443. package/dist/lib/facts/factset.js.map +1 -0
  444. package/dist/lib/facts/producer.d.ts +190 -0
  445. package/dist/lib/facts/producer.d.ts.map +1 -0
  446. package/dist/lib/facts/producer.js +15 -0
  447. package/dist/lib/facts/producer.js.map +1 -0
  448. package/dist/lib/facts/runner.d.ts +111 -0
  449. package/dist/lib/facts/runner.d.ts.map +1 -0
  450. package/dist/lib/facts/runner.js +438 -0
  451. package/dist/lib/facts/runner.js.map +1 -0
  452. package/dist/lib/facts/stock/ai-check.d.ts +100 -0
  453. package/dist/lib/facts/stock/ai-check.d.ts.map +1 -0
  454. package/dist/lib/facts/stock/ai-check.js +526 -0
  455. package/dist/lib/facts/stock/ai-check.js.map +1 -0
  456. package/dist/lib/facts/stock/ai-inputs.d.ts +104 -0
  457. package/dist/lib/facts/stock/ai-inputs.d.ts.map +1 -0
  458. package/dist/lib/facts/stock/ai-inputs.js +332 -0
  459. package/dist/lib/facts/stock/ai-inputs.js.map +1 -0
  460. package/dist/lib/facts/stock/ai-provider.d.ts +105 -0
  461. package/dist/lib/facts/stock/ai-provider.d.ts.map +1 -0
  462. package/dist/lib/facts/stock/ai-provider.js +250 -0
  463. package/dist/lib/facts/stock/ai-provider.js.map +1 -0
  464. package/dist/lib/facts/stock/ai-unique.d.ts +85 -0
  465. package/dist/lib/facts/stock/ai-unique.d.ts.map +1 -0
  466. package/dist/lib/facts/stock/ai-unique.js +208 -0
  467. package/dist/lib/facts/stock/ai-unique.js.map +1 -0
  468. package/dist/lib/facts/stock/archive.d.ts +63 -0
  469. package/dist/lib/facts/stock/archive.d.ts.map +1 -0
  470. package/dist/lib/facts/stock/archive.js +349 -0
  471. package/dist/lib/facts/stock/archive.js.map +1 -0
  472. package/dist/lib/facts/stock/c2pa-trust-list.d.ts +16 -0
  473. package/dist/lib/facts/stock/c2pa-trust-list.d.ts.map +1 -0
  474. package/dist/lib/facts/stock/c2pa-trust-list.js +637 -0
  475. package/dist/lib/facts/stock/c2pa-trust-list.js.map +1 -0
  476. package/dist/lib/facts/stock/c2pa.d.ts +56 -0
  477. package/dist/lib/facts/stock/c2pa.d.ts.map +1 -0
  478. package/dist/lib/facts/stock/c2pa.js +234 -0
  479. package/dist/lib/facts/stock/c2pa.js.map +1 -0
  480. package/dist/lib/facts/stock/call.d.ts +91 -0
  481. package/dist/lib/facts/stock/call.d.ts.map +1 -0
  482. package/dist/lib/facts/stock/call.js +281 -0
  483. package/dist/lib/facts/stock/call.js.map +1 -0
  484. package/dist/lib/facts/stock/capability.d.ts +39 -0
  485. package/dist/lib/facts/stock/capability.d.ts.map +1 -0
  486. package/dist/lib/facts/stock/capability.js +59 -0
  487. package/dist/lib/facts/stock/capability.js.map +1 -0
  488. package/dist/lib/facts/stock/ext-source.d.ts +51 -0
  489. package/dist/lib/facts/stock/ext-source.d.ts.map +1 -0
  490. package/dist/lib/facts/stock/ext-source.js +201 -0
  491. package/dist/lib/facts/stock/ext-source.js.map +1 -0
  492. package/dist/lib/facts/stock/frequency-fact.d.ts +59 -0
  493. package/dist/lib/facts/stock/frequency-fact.d.ts.map +1 -0
  494. package/dist/lib/facts/stock/frequency-fact.js +86 -0
  495. package/dist/lib/facts/stock/frequency-fact.js.map +1 -0
  496. package/dist/lib/facts/stock/frequency.d.ts +32 -0
  497. package/dist/lib/facts/stock/frequency.d.ts.map +1 -0
  498. package/dist/lib/facts/stock/frequency.js +48 -0
  499. package/dist/lib/facts/stock/frequency.js.map +1 -0
  500. package/dist/lib/facts/stock/index.d.ts +27 -0
  501. package/dist/lib/facts/stock/index.d.ts.map +1 -0
  502. package/dist/lib/facts/stock/index.js +28 -0
  503. package/dist/lib/facts/stock/index.js.map +1 -0
  504. package/dist/lib/facts/stock/normalize.d.ts +45 -0
  505. package/dist/lib/facts/stock/normalize.d.ts.map +1 -0
  506. package/dist/lib/facts/stock/normalize.js +135 -0
  507. package/dist/lib/facts/stock/normalize.js.map +1 -0
  508. package/dist/lib/facts/stock/phash.d.ts +55 -0
  509. package/dist/lib/facts/stock/phash.d.ts.map +1 -0
  510. package/dist/lib/facts/stock/phash.js +256 -0
  511. package/dist/lib/facts/stock/phash.js.map +1 -0
  512. package/dist/lib/facts/stock/rule-defaults.d.ts +72 -0
  513. package/dist/lib/facts/stock/rule-defaults.d.ts.map +1 -0
  514. package/dist/lib/facts/stock/rule-defaults.js +55 -0
  515. package/dist/lib/facts/stock/rule-defaults.js.map +1 -0
  516. package/dist/lib/facts/stock/send.d.ts +52 -0
  517. package/dist/lib/facts/stock/send.d.ts.map +1 -0
  518. package/dist/lib/facts/stock/send.js +148 -0
  519. package/dist/lib/facts/stock/send.js.map +1 -0
  520. package/dist/lib/facts/stock/unique-score.d.ts +138 -0
  521. package/dist/lib/facts/stock/unique-score.d.ts.map +1 -0
  522. package/dist/lib/facts/stock/unique-score.js +257 -0
  523. package/dist/lib/facts/stock/unique-score.js.map +1 -0
  524. package/dist/lib/facts/stock/unique-store.d.ts +420 -0
  525. package/dist/lib/facts/stock/unique-store.d.ts.map +1 -0
  526. package/dist/lib/facts/stock/unique-store.js +328 -0
  527. package/dist/lib/facts/stock/unique-store.js.map +1 -0
  528. package/dist/lib/facts/stock/unique.d.ts +35 -0
  529. package/dist/lib/facts/stock/unique.d.ts.map +1 -0
  530. package/dist/lib/facts/stock/unique.js +327 -0
  531. package/dist/lib/facts/stock/unique.js.map +1 -0
  532. package/dist/lib/facts/tools.d.ts +57 -0
  533. package/dist/lib/facts/tools.d.ts.map +1 -0
  534. package/dist/lib/facts/tools.js +325 -0
  535. package/dist/lib/facts/tools.js.map +1 -0
  536. package/dist/lib/facts/validate.d.ts +33 -0
  537. package/dist/lib/facts/validate.d.ts.map +1 -0
  538. package/dist/lib/facts/validate.js +137 -0
  539. package/dist/lib/facts/validate.js.map +1 -0
  540. package/dist/lib/hash.d.ts +44 -0
  541. package/dist/lib/hash.d.ts.map +1 -0
  542. package/dist/lib/hash.js +80 -0
  543. package/dist/lib/hash.js.map +1 -0
  544. package/dist/lib/http/client.d.ts +113 -0
  545. package/dist/lib/http/client.d.ts.map +1 -0
  546. package/dist/lib/http/client.js +330 -0
  547. package/dist/lib/http/client.js.map +1 -0
  548. package/dist/lib/ids.d.ts +17 -0
  549. package/dist/lib/ids.d.ts.map +1 -0
  550. package/dist/lib/ids.js +26 -0
  551. package/dist/lib/ids.js.map +1 -0
  552. package/dist/lib/ixo/attachments.d.ts +116 -0
  553. package/dist/lib/ixo/attachments.d.ts.map +1 -0
  554. package/dist/lib/ixo/attachments.js +290 -0
  555. package/dist/lib/ixo/attachments.js.map +1 -0
  556. package/dist/lib/ixo/authz.d.ts +40 -0
  557. package/dist/lib/ixo/authz.d.ts.map +1 -0
  558. package/dist/lib/ixo/authz.js +113 -0
  559. package/dist/lib/ixo/authz.js.map +1 -0
  560. package/dist/lib/ixo/blocksync/index.d.ts +90 -0
  561. package/dist/lib/ixo/blocksync/index.d.ts.map +1 -0
  562. package/dist/lib/ixo/blocksync/index.js +251 -0
  563. package/dist/lib/ixo/blocksync/index.js.map +1 -0
  564. package/dist/lib/ixo/blocksync/queries.d.ts +15 -0
  565. package/dist/lib/ixo/blocksync/queries.d.ts.map +1 -0
  566. package/dist/lib/ixo/blocksync/queries.js +144 -0
  567. package/dist/lib/ixo/blocksync/queries.js.map +1 -0
  568. package/dist/lib/ixo/blocksync/types.d.ts +184 -0
  569. package/dist/lib/ixo/blocksync/types.d.ts.map +1 -0
  570. package/dist/lib/ixo/blocksync/types.js +108 -0
  571. package/dist/lib/ixo/blocksync/types.js.map +1 -0
  572. package/dist/lib/ixo/cellnode.d.ts +35 -0
  573. package/dist/lib/ixo/cellnode.d.ts.map +1 -0
  574. package/dist/lib/ixo/cellnode.js +43 -0
  575. package/dist/lib/ixo/cellnode.js.map +1 -0
  576. package/dist/lib/ixo/chain-write.d.ts +130 -0
  577. package/dist/lib/ixo/chain-write.d.ts.map +1 -0
  578. package/dist/lib/ixo/chain-write.js +460 -0
  579. package/dist/lib/ixo/chain-write.js.map +1 -0
  580. package/dist/lib/ixo/chain.d.ts +1046 -0
  581. package/dist/lib/ixo/chain.d.ts.map +1 -0
  582. package/dist/lib/ixo/chain.js +279 -0
  583. package/dist/lib/ixo/chain.js.map +1 -0
  584. package/dist/lib/ixo/claim-bot.d.ts +49 -0
  585. package/dist/lib/ixo/claim-bot.d.ts.map +1 -0
  586. package/dist/lib/ixo/claim-bot.js +141 -0
  587. package/dist/lib/ixo/claim-bot.js.map +1 -0
  588. package/dist/lib/ixo/delegation-verify.d.ts +44 -0
  589. package/dist/lib/ixo/delegation-verify.d.ts.map +1 -0
  590. package/dist/lib/ixo/delegation-verify.js +101 -0
  591. package/dist/lib/ixo/delegation-verify.js.map +1 -0
  592. package/dist/lib/ixo/did.d.ts +13 -0
  593. package/dist/lib/ixo/did.d.ts.map +1 -0
  594. package/dist/lib/ixo/did.js +85 -0
  595. package/dist/lib/ixo/did.js.map +1 -0
  596. package/dist/lib/ixo/grant-chain.d.ts +55 -0
  597. package/dist/lib/ixo/grant-chain.d.ts.map +1 -0
  598. package/dist/lib/ixo/grant-chain.js +185 -0
  599. package/dist/lib/ixo/grant-chain.js.map +1 -0
  600. package/dist/lib/ixo/identity.d.ts +32 -0
  601. package/dist/lib/ixo/identity.d.ts.map +1 -0
  602. package/dist/lib/ixo/identity.js +104 -0
  603. package/dist/lib/ixo/identity.js.map +1 -0
  604. package/dist/lib/ixo/index.d.ts +118 -0
  605. package/dist/lib/ixo/index.d.ts.map +1 -0
  606. package/dist/lib/ixo/index.js +395 -0
  607. package/dist/lib/ixo/index.js.map +1 -0
  608. package/dist/lib/ixo/payment.d.ts +104 -0
  609. package/dist/lib/ixo/payment.d.ts.map +1 -0
  610. package/dist/lib/ixo/payment.js +136 -0
  611. package/dist/lib/ixo/payment.js.map +1 -0
  612. package/dist/lib/ixo/ucan-store.d.ts +30 -0
  613. package/dist/lib/ixo/ucan-store.d.ts.map +1 -0
  614. package/dist/lib/ixo/ucan-store.js +134 -0
  615. package/dist/lib/ixo/ucan-store.js.map +1 -0
  616. package/dist/lib/ixo/ucan.d.ts +96 -0
  617. package/dist/lib/ixo/ucan.d.ts.map +1 -0
  618. package/dist/lib/ixo/ucan.js +216 -0
  619. package/dist/lib/ixo/ucan.js.map +1 -0
  620. package/dist/lib/ixo/verified-read.d.ts +43 -0
  621. package/dist/lib/ixo/verified-read.d.ts.map +1 -0
  622. package/dist/lib/ixo/verified-read.js +73 -0
  623. package/dist/lib/ixo/verified-read.js.map +1 -0
  624. package/dist/lib/ixo/vfs.d.ts +27 -0
  625. package/dist/lib/ixo/vfs.d.ts.map +1 -0
  626. package/dist/lib/ixo/vfs.js +42 -0
  627. package/dist/lib/ixo/vfs.js.map +1 -0
  628. package/dist/lib/ixo/web-did.d.ts +7 -0
  629. package/dist/lib/ixo/web-did.d.ts.map +1 -0
  630. package/dist/lib/ixo/web-did.js +9 -0
  631. package/dist/lib/ixo/web-did.js.map +1 -0
  632. package/dist/lib/logger.d.ts +34 -0
  633. package/dist/lib/logger.d.ts.map +1 -0
  634. package/dist/lib/logger.js +126 -0
  635. package/dist/lib/logger.js.map +1 -0
  636. package/dist/lib/matrix/api.d.ts +57 -0
  637. package/dist/lib/matrix/api.d.ts.map +1 -0
  638. package/dist/lib/matrix/api.js +58 -0
  639. package/dist/lib/matrix/api.js.map +1 -0
  640. package/dist/lib/matrix/client.d.ts +41 -0
  641. package/dist/lib/matrix/client.d.ts.map +1 -0
  642. package/dist/lib/matrix/client.js +104 -0
  643. package/dist/lib/matrix/client.js.map +1 -0
  644. package/dist/lib/matrix/deliver.d.ts +224 -0
  645. package/dist/lib/matrix/deliver.d.ts.map +1 -0
  646. package/dist/lib/matrix/deliver.js +788 -0
  647. package/dist/lib/matrix/deliver.js.map +1 -0
  648. package/dist/lib/matrix/events.d.ts +114 -0
  649. package/dist/lib/matrix/events.d.ts.map +1 -0
  650. package/dist/lib/matrix/events.js +143 -0
  651. package/dist/lib/matrix/events.js.map +1 -0
  652. package/dist/lib/matrix/mxid.d.ts +24 -0
  653. package/dist/lib/matrix/mxid.d.ts.map +1 -0
  654. package/dist/lib/matrix/mxid.js +47 -0
  655. package/dist/lib/matrix/mxid.js.map +1 -0
  656. package/dist/lib/metrics.d.ts +105 -0
  657. package/dist/lib/metrics.d.ts.map +1 -0
  658. package/dist/lib/metrics.js +204 -0
  659. package/dist/lib/metrics.js.map +1 -0
  660. package/dist/lib/oauth/approvals.d.ts +160 -0
  661. package/dist/lib/oauth/approvals.d.ts.map +1 -0
  662. package/dist/lib/oauth/approvals.js +273 -0
  663. package/dist/lib/oauth/approvals.js.map +1 -0
  664. package/dist/lib/oauth/standing.d.ts +152 -0
  665. package/dist/lib/oauth/standing.d.ts.map +1 -0
  666. package/dist/lib/oauth/standing.js +299 -0
  667. package/dist/lib/oauth/standing.js.map +1 -0
  668. package/dist/lib/oauth/token.d.ts +60 -0
  669. package/dist/lib/oauth/token.d.ts.map +1 -0
  670. package/dist/lib/oauth/token.js +129 -0
  671. package/dist/lib/oauth/token.js.map +1 -0
  672. package/dist/lib/payments/extend.d.ts +42 -0
  673. package/dist/lib/payments/extend.d.ts.map +1 -0
  674. package/dist/lib/payments/extend.js +98 -0
  675. package/dist/lib/payments/extend.js.map +1 -0
  676. package/dist/lib/payments/facilitator.d.ts +220 -0
  677. package/dist/lib/payments/facilitator.d.ts.map +1 -0
  678. package/dist/lib/payments/facilitator.js +451 -0
  679. package/dist/lib/payments/facilitator.js.map +1 -0
  680. package/dist/lib/payments/gate.d.ts +207 -0
  681. package/dist/lib/payments/gate.d.ts.map +1 -0
  682. package/dist/lib/payments/gate.js +481 -0
  683. package/dist/lib/payments/gate.js.map +1 -0
  684. package/dist/lib/payments/header-seal.d.ts +33 -0
  685. package/dist/lib/payments/header-seal.d.ts.map +1 -0
  686. package/dist/lib/payments/header-seal.js +76 -0
  687. package/dist/lib/payments/header-seal.js.map +1 -0
  688. package/dist/lib/payments/index.d.ts +12 -0
  689. package/dist/lib/payments/index.d.ts.map +1 -0
  690. package/dist/lib/payments/index.js +11 -0
  691. package/dist/lib/payments/index.js.map +1 -0
  692. package/dist/lib/payments/price.d.ts +25 -0
  693. package/dist/lib/payments/price.d.ts.map +1 -0
  694. package/dist/lib/payments/price.js +43 -0
  695. package/dist/lib/payments/price.js.map +1 -0
  696. package/dist/lib/payments/reconcile.d.ts +77 -0
  697. package/dist/lib/payments/reconcile.d.ts.map +1 -0
  698. package/dist/lib/payments/reconcile.js +317 -0
  699. package/dist/lib/payments/reconcile.js.map +1 -0
  700. package/dist/lib/payments/refund.d.ts +34 -0
  701. package/dist/lib/payments/refund.d.ts.map +1 -0
  702. package/dist/lib/payments/refund.js +123 -0
  703. package/dist/lib/payments/refund.js.map +1 -0
  704. package/dist/lib/payments/review-billing.d.ts +222 -0
  705. package/dist/lib/payments/review-billing.d.ts.map +1 -0
  706. package/dist/lib/payments/review-billing.js +609 -0
  707. package/dist/lib/payments/review-billing.js.map +1 -0
  708. package/dist/lib/payments/settle.d.ts +44 -0
  709. package/dist/lib/payments/settle.d.ts.map +1 -0
  710. package/dist/lib/payments/settle.js +306 -0
  711. package/dist/lib/payments/settle.js.map +1 -0
  712. package/dist/lib/payments/terms.d.ts +27 -0
  713. package/dist/lib/payments/terms.d.ts.map +1 -0
  714. package/dist/lib/payments/terms.js +21 -0
  715. package/dist/lib/payments/terms.js.map +1 -0
  716. package/dist/lib/payouts.d.ts +20 -0
  717. package/dist/lib/payouts.d.ts.map +1 -0
  718. package/dist/lib/payouts.js +30 -0
  719. package/dist/lib/payouts.js.map +1 -0
  720. package/dist/lib/readiness.d.ts +42 -0
  721. package/dist/lib/readiness.d.ts.map +1 -0
  722. package/dist/lib/readiness.js +130 -0
  723. package/dist/lib/readiness.js.map +1 -0
  724. package/dist/lib/redact.d.ts +23 -0
  725. package/dist/lib/redact.d.ts.map +1 -0
  726. package/dist/lib/redact.js +67 -0
  727. package/dist/lib/redact.js.map +1 -0
  728. package/dist/lib/register.d.ts +85 -0
  729. package/dist/lib/register.d.ts.map +1 -0
  730. package/dist/lib/register.js +390 -0
  731. package/dist/lib/register.js.map +1 -0
  732. package/dist/lib/review/attestation.d.ts +92 -0
  733. package/dist/lib/review/attestation.d.ts.map +1 -0
  734. package/dist/lib/review/attestation.js +264 -0
  735. package/dist/lib/review/attestation.js.map +1 -0
  736. package/dist/lib/review/reviewer-grant.d.ts +146 -0
  737. package/dist/lib/review/reviewer-grant.d.ts.map +1 -0
  738. package/dist/lib/review/reviewer-grant.js +359 -0
  739. package/dist/lib/review/reviewer-grant.js.map +1 -0
  740. package/dist/lib/review/tasks.d.ts +18 -0
  741. package/dist/lib/review/tasks.d.ts.map +1 -0
  742. package/dist/lib/review/tasks.js +36 -0
  743. package/dist/lib/review/tasks.js.map +1 -0
  744. package/dist/lib/sentry.d.ts +89 -0
  745. package/dist/lib/sentry.d.ts.map +1 -0
  746. package/dist/lib/sentry.js +284 -0
  747. package/dist/lib/sentry.js.map +1 -0
  748. package/dist/lib/spans.d.ts +14 -0
  749. package/dist/lib/spans.d.ts.map +1 -0
  750. package/dist/lib/spans.js +28 -0
  751. package/dist/lib/spans.js.map +1 -0
  752. package/dist/lib/tracing.d.ts +31 -0
  753. package/dist/lib/tracing.d.ts.map +1 -0
  754. package/dist/lib/tracing.js +66 -0
  755. package/dist/lib/tracing.js.map +1 -0
  756. package/dist/lib/ttl-cache.d.ts +26 -0
  757. package/dist/lib/ttl-cache.d.ts.map +1 -0
  758. package/dist/lib/ttl-cache.js +61 -0
  759. package/dist/lib/ttl-cache.js.map +1 -0
  760. package/dist/lib/validator.d.ts +19 -0
  761. package/dist/lib/validator.d.ts.map +1 -0
  762. package/dist/lib/validator.js +32 -0
  763. package/dist/lib/validator.js.map +1 -0
  764. package/dist/lib/work-order/form.d.ts +40 -0
  765. package/dist/lib/work-order/form.d.ts.map +1 -0
  766. package/dist/lib/work-order/form.js +316 -0
  767. package/dist/lib/work-order/form.js.map +1 -0
  768. package/dist/lib/work-order/index.d.ts +20 -0
  769. package/dist/lib/work-order/index.d.ts.map +1 -0
  770. package/dist/lib/work-order/index.js +66 -0
  771. package/dist/lib/work-order/index.js.map +1 -0
  772. package/dist/middleware/api/audit.d.ts +9 -0
  773. package/dist/middleware/api/audit.d.ts.map +1 -0
  774. package/dist/middleware/api/audit.js +38 -0
  775. package/dist/middleware/api/audit.js.map +1 -0
  776. package/dist/middleware/api/auth.d.ts +29 -0
  777. package/dist/middleware/api/auth.d.ts.map +1 -0
  778. package/dist/middleware/api/auth.js +105 -0
  779. package/dist/middleware/api/auth.js.map +1 -0
  780. package/dist/middleware/api/console.d.ts +92 -0
  781. package/dist/middleware/api/console.d.ts.map +1 -0
  782. package/dist/middleware/api/console.js +446 -0
  783. package/dist/middleware/api/console.js.map +1 -0
  784. package/dist/middleware/api/errors.d.ts +48 -0
  785. package/dist/middleware/api/errors.d.ts.map +1 -0
  786. package/dist/middleware/api/errors.js +133 -0
  787. package/dist/middleware/api/errors.js.map +1 -0
  788. package/dist/middleware/api/idempotency.d.ts +23 -0
  789. package/dist/middleware/api/idempotency.d.ts.map +1 -0
  790. package/dist/middleware/api/idempotency.js +158 -0
  791. package/dist/middleware/api/idempotency.js.map +1 -0
  792. package/dist/middleware/api/keys.d.ts +14 -0
  793. package/dist/middleware/api/keys.d.ts.map +1 -0
  794. package/dist/middleware/api/keys.js +66 -0
  795. package/dist/middleware/api/keys.js.map +1 -0
  796. package/dist/middleware/api/membership.d.ts +32 -0
  797. package/dist/middleware/api/membership.d.ts.map +1 -0
  798. package/dist/middleware/api/membership.js +48 -0
  799. package/dist/middleware/api/membership.js.map +1 -0
  800. package/dist/middleware/api/oauth.d.ts +28 -0
  801. package/dist/middleware/api/oauth.d.ts.map +1 -0
  802. package/dist/middleware/api/oauth.js +109 -0
  803. package/dist/middleware/api/oauth.js.map +1 -0
  804. package/dist/middleware/api/rate-limit.d.ts +23 -0
  805. package/dist/middleware/api/rate-limit.d.ts.map +1 -0
  806. package/dist/middleware/api/rate-limit.js +70 -0
  807. package/dist/middleware/api/rate-limit.js.map +1 -0
  808. package/dist/middleware/api/types.d.ts +92 -0
  809. package/dist/middleware/api/types.d.ts.map +1 -0
  810. package/dist/middleware/api/types.js +7 -0
  811. package/dist/middleware/api/types.js.map +1 -0
  812. package/dist/middleware/api/wait.d.ts +21 -0
  813. package/dist/middleware/api/wait.d.ts.map +1 -0
  814. package/dist/middleware/api/wait.js +85 -0
  815. package/dist/middleware/api/wait.js.map +1 -0
  816. package/dist/middleware/capability.d.ts +32 -0
  817. package/dist/middleware/capability.d.ts.map +1 -0
  818. package/dist/middleware/capability.js +113 -0
  819. package/dist/middleware/capability.js.map +1 -0
  820. package/dist/middleware/database.d.ts +14 -0
  821. package/dist/middleware/database.d.ts.map +1 -0
  822. package/dist/middleware/database.js +18 -0
  823. package/dist/middleware/database.js.map +1 -0
  824. package/dist/middleware/error-handler.d.ts +13 -0
  825. package/dist/middleware/error-handler.d.ts.map +1 -0
  826. package/dist/middleware/error-handler.js +127 -0
  827. package/dist/middleware/error-handler.js.map +1 -0
  828. package/dist/middleware/observability.d.ts +32 -0
  829. package/dist/middleware/observability.d.ts.map +1 -0
  830. package/dist/middleware/observability.js +134 -0
  831. package/dist/middleware/observability.js.map +1 -0
  832. package/dist/middleware/rate-limit.d.ts +16 -0
  833. package/dist/middleware/rate-limit.d.ts.map +1 -0
  834. package/dist/middleware/rate-limit.js +56 -0
  835. package/dist/middleware/rate-limit.js.map +1 -0
  836. package/dist/middleware/ucan-auth.d.ts +39 -0
  837. package/dist/middleware/ucan-auth.d.ts.map +1 -0
  838. package/dist/middleware/ucan-auth.js +278 -0
  839. package/dist/middleware/ucan-auth.js.map +1 -0
  840. package/dist/networks.d.ts +34 -0
  841. package/dist/networks.d.ts.map +1 -0
  842. package/dist/networks.js +49 -0
  843. package/dist/networks.js.map +1 -0
  844. package/dist/oracle.d.ts +193 -0
  845. package/dist/oracle.d.ts.map +1 -0
  846. package/dist/oracle.js +245 -0
  847. package/dist/oracle.js.map +1 -0
  848. package/dist/routes/health.d.ts +16 -0
  849. package/dist/routes/health.d.ts.map +1 -0
  850. package/dist/routes/health.js +29 -0
  851. package/dist/routes/health.js.map +1 -0
  852. package/dist/routes/v1/admin.d.ts +18 -0
  853. package/dist/routes/v1/admin.d.ts.map +1 -0
  854. package/dist/routes/v1/admin.js +101 -0
  855. package/dist/routes/v1/admin.js.map +1 -0
  856. package/dist/routes/v1/api/admin-claims.d.ts +14 -0
  857. package/dist/routes/v1/api/admin-claims.d.ts.map +1 -0
  858. package/dist/routes/v1/api/admin-claims.js +82 -0
  859. package/dist/routes/v1/api/admin-claims.js.map +1 -0
  860. package/dist/routes/v1/api/admin-facilitator.d.ts +20 -0
  861. package/dist/routes/v1/api/admin-facilitator.d.ts.map +1 -0
  862. package/dist/routes/v1/api/admin-facilitator.js +64 -0
  863. package/dist/routes/v1/api/admin-facilitator.js.map +1 -0
  864. package/dist/routes/v1/api/admin.d.ts +9 -0
  865. package/dist/routes/v1/api/admin.d.ts.map +1 -0
  866. package/dist/routes/v1/api/admin.js +110 -0
  867. package/dist/routes/v1/api/admin.js.map +1 -0
  868. package/dist/routes/v1/api/audit.d.ts +8 -0
  869. package/dist/routes/v1/api/audit.d.ts.map +1 -0
  870. package/dist/routes/v1/api/audit.js +56 -0
  871. package/dist/routes/v1/api/audit.js.map +1 -0
  872. package/dist/routes/v1/api/batch.d.ts +17 -0
  873. package/dist/routes/v1/api/batch.d.ts.map +1 -0
  874. package/dist/routes/v1/api/batch.js +192 -0
  875. package/dist/routes/v1/api/batch.js.map +1 -0
  876. package/dist/routes/v1/api/claims-read.d.ts +43 -0
  877. package/dist/routes/v1/api/claims-read.d.ts.map +1 -0
  878. package/dist/routes/v1/api/claims-read.js +123 -0
  879. package/dist/routes/v1/api/claims-read.js.map +1 -0
  880. package/dist/routes/v1/api/claims.d.ts +131 -0
  881. package/dist/routes/v1/api/claims.d.ts.map +1 -0
  882. package/dist/routes/v1/api/claims.js +407 -0
  883. package/dist/routes/v1/api/claims.js.map +1 -0
  884. package/dist/routes/v1/api/collections-link.d.ts +14 -0
  885. package/dist/routes/v1/api/collections-link.d.ts.map +1 -0
  886. package/dist/routes/v1/api/collections-link.js +97 -0
  887. package/dist/routes/v1/api/collections-link.js.map +1 -0
  888. package/dist/routes/v1/api/export.d.ts +48 -0
  889. package/dist/routes/v1/api/export.d.ts.map +1 -0
  890. package/dist/routes/v1/api/export.js +251 -0
  891. package/dist/routes/v1/api/export.js.map +1 -0
  892. package/dist/routes/v1/api/index.d.ts +16 -0
  893. package/dist/routes/v1/api/index.d.ts.map +1 -0
  894. package/dist/routes/v1/api/index.js +68 -0
  895. package/dist/routes/v1/api/index.js.map +1 -0
  896. package/dist/routes/v1/api/keys.d.ts +9 -0
  897. package/dist/routes/v1/api/keys.d.ts.map +1 -0
  898. package/dist/routes/v1/api/keys.js +95 -0
  899. package/dist/routes/v1/api/keys.js.map +1 -0
  900. package/dist/routes/v1/api/me.d.ts +21 -0
  901. package/dist/routes/v1/api/me.d.ts.map +1 -0
  902. package/dist/routes/v1/api/me.js +122 -0
  903. package/dist/routes/v1/api/me.js.map +1 -0
  904. package/dist/routes/v1/api/members.d.ts +17 -0
  905. package/dist/routes/v1/api/members.d.ts.map +1 -0
  906. package/dist/routes/v1/api/members.js +406 -0
  907. package/dist/routes/v1/api/members.js.map +1 -0
  908. package/dist/routes/v1/api/meta.d.ts +12 -0
  909. package/dist/routes/v1/api/meta.d.ts.map +1 -0
  910. package/dist/routes/v1/api/meta.js +59 -0
  911. package/dist/routes/v1/api/meta.js.map +1 -0
  912. package/dist/routes/v1/api/openapi.gen.d.ts +2 -0
  913. package/dist/routes/v1/api/openapi.gen.d.ts.map +1 -0
  914. package/dist/routes/v1/api/openapi.gen.js +7 -0
  915. package/dist/routes/v1/api/openapi.gen.js.map +1 -0
  916. package/dist/routes/v1/api/protocols.d.ts +22 -0
  917. package/dist/routes/v1/api/protocols.d.ts.map +1 -0
  918. package/dist/routes/v1/api/protocols.js +153 -0
  919. package/dist/routes/v1/api/protocols.js.map +1 -0
  920. package/dist/routes/v1/api/review-billing.d.ts +18 -0
  921. package/dist/routes/v1/api/review-billing.d.ts.map +1 -0
  922. package/dist/routes/v1/api/review-billing.js +196 -0
  923. package/dist/routes/v1/api/review-billing.js.map +1 -0
  924. package/dist/routes/v1/api/review.d.ts +30 -0
  925. package/dist/routes/v1/api/review.d.ts.map +1 -0
  926. package/dist/routes/v1/api/review.js +302 -0
  927. package/dist/routes/v1/api/review.js.map +1 -0
  928. package/dist/routes/v1/api/sources.d.ts +10 -0
  929. package/dist/routes/v1/api/sources.d.ts.map +1 -0
  930. package/dist/routes/v1/api/sources.js +293 -0
  931. package/dist/routes/v1/api/sources.js.map +1 -0
  932. package/dist/routes/v1/api/uploads.d.ts +37 -0
  933. package/dist/routes/v1/api/uploads.d.ts.map +1 -0
  934. package/dist/routes/v1/api/uploads.js +414 -0
  935. package/dist/routes/v1/api/uploads.js.map +1 -0
  936. package/dist/routes/v1/api/views.d.ts +18 -0
  937. package/dist/routes/v1/api/views.d.ts.map +1 -0
  938. package/dist/routes/v1/api/views.js +95 -0
  939. package/dist/routes/v1/api/views.js.map +1 -0
  940. package/dist/routes/v1/api/webhooks.d.ts +14 -0
  941. package/dist/routes/v1/api/webhooks.d.ts.map +1 -0
  942. package/dist/routes/v1/api/webhooks.js +282 -0
  943. package/dist/routes/v1/api/webhooks.js.map +1 -0
  944. package/dist/routes/v1/api/work-orders.d.ts +45 -0
  945. package/dist/routes/v1/api/work-orders.d.ts.map +1 -0
  946. package/dist/routes/v1/api/work-orders.js +171 -0
  947. package/dist/routes/v1/api/work-orders.js.map +1 -0
  948. package/dist/routes/v1/claims.d.ts +21 -0
  949. package/dist/routes/v1/claims.d.ts.map +1 -0
  950. package/dist/routes/v1/claims.js +153 -0
  951. package/dist/routes/v1/claims.js.map +1 -0
  952. package/dist/routes/v1/collections.d.ts +45 -0
  953. package/dist/routes/v1/collections.d.ts.map +1 -0
  954. package/dist/routes/v1/collections.js +201 -0
  955. package/dist/routes/v1/collections.js.map +1 -0
  956. package/dist/routes/v1/index.d.ts +13 -0
  957. package/dist/routes/v1/index.d.ts.map +1 -0
  958. package/dist/routes/v1/index.js +41 -0
  959. package/dist/routes/v1/index.js.map +1 -0
  960. package/dist/routes/v1/info.d.ts +14 -0
  961. package/dist/routes/v1/info.d.ts.map +1 -0
  962. package/dist/routes/v1/info.js +75 -0
  963. package/dist/routes/v1/info.js.map +1 -0
  964. package/dist/routes/v1/mcp/index.d.ts +33 -0
  965. package/dist/routes/v1/mcp/index.d.ts.map +1 -0
  966. package/dist/routes/v1/mcp/index.js +252 -0
  967. package/dist/routes/v1/mcp/index.js.map +1 -0
  968. package/dist/routes/v1/mcp/oauth.d.ts +27 -0
  969. package/dist/routes/v1/mcp/oauth.d.ts.map +1 -0
  970. package/dist/routes/v1/mcp/oauth.js +500 -0
  971. package/dist/routes/v1/mcp/oauth.js.map +1 -0
  972. package/dist/routes/v1/mcp/tools.d.ts +71 -0
  973. package/dist/routes/v1/mcp/tools.d.ts.map +1 -0
  974. package/dist/routes/v1/mcp/tools.js +432 -0
  975. package/dist/routes/v1/mcp/tools.js.map +1 -0
  976. package/dist/routes/v1/mcp/ui.d.ts +45 -0
  977. package/dist/routes/v1/mcp/ui.d.ts.map +1 -0
  978. package/dist/routes/v1/mcp/ui.js +454 -0
  979. package/dist/routes/v1/mcp/ui.js.map +1 -0
  980. package/dist/routes/v1/oauth.d.ts +29 -0
  981. package/dist/routes/v1/oauth.d.ts.map +1 -0
  982. package/dist/routes/v1/oauth.js +256 -0
  983. package/dist/routes/v1/oauth.js.map +1 -0
  984. package/dist/routes/v1/reviewers.d.ts +22 -0
  985. package/dist/routes/v1/reviewers.d.ts.map +1 -0
  986. package/dist/routes/v1/reviewers.js +165 -0
  987. package/dist/routes/v1/reviewers.js.map +1 -0
  988. package/dist/routes/v1/reviews.d.ts +38 -0
  989. package/dist/routes/v1/reviews.d.ts.map +1 -0
  990. package/dist/routes/v1/reviews.js +234 -0
  991. package/dist/routes/v1/reviews.js.map +1 -0
  992. package/dist/routes/v1/shared.d.ts +586 -0
  993. package/dist/routes/v1/shared.d.ts.map +1 -0
  994. package/dist/routes/v1/shared.js +229 -0
  995. package/dist/routes/v1/shared.js.map +1 -0
  996. package/dist/routes/well-known.d.ts +15 -0
  997. package/dist/routes/well-known.d.ts.map +1 -0
  998. package/dist/routes/well-known.js +35 -0
  999. package/dist/routes/well-known.js.map +1 -0
  1000. package/dist/runtime.d.ts +100 -0
  1001. package/dist/runtime.d.ts.map +1 -0
  1002. package/dist/runtime.js +144 -0
  1003. package/dist/runtime.js.map +1 -0
  1004. package/dist/testing/fake-tools.d.ts +104 -0
  1005. package/dist/testing/fake-tools.d.ts.map +1 -0
  1006. package/dist/testing/fake-tools.js +213 -0
  1007. package/dist/testing/fake-tools.js.map +1 -0
  1008. package/dist/testing/index.d.ts +54 -0
  1009. package/dist/testing/index.d.ts.map +1 -0
  1010. package/dist/testing/index.js +104 -0
  1011. package/dist/testing/index.js.map +1 -0
  1012. package/dist/testing/samples.d.ts +70 -0
  1013. package/dist/testing/samples.d.ts.map +1 -0
  1014. package/dist/testing/samples.js +92 -0
  1015. package/dist/testing/samples.js.map +1 -0
  1016. package/dist/workflows/claim-ingest.d.ts +250 -0
  1017. package/dist/workflows/claim-ingest.d.ts.map +1 -0
  1018. package/dist/workflows/claim-ingest.js +1020 -0
  1019. package/dist/workflows/claim-ingest.js.map +1 -0
  1020. package/dist/workflows/claim-source.d.ts +25 -0
  1021. package/dist/workflows/claim-source.d.ts.map +1 -0
  1022. package/dist/workflows/claim-source.js +107 -0
  1023. package/dist/workflows/claim-source.js.map +1 -0
  1024. package/dist/workflows/review-complete.d.ts +82 -0
  1025. package/dist/workflows/review-complete.d.ts.map +1 -0
  1026. package/dist/workflows/review-complete.js +455 -0
  1027. package/dist/workflows/review-complete.js.map +1 -0
  1028. package/dist/workflows/steps.d.ts +125 -0
  1029. package/dist/workflows/steps.d.ts.map +1 -0
  1030. package/dist/workflows/steps.js +325 -0
  1031. package/dist/workflows/steps.js.map +1 -0
  1032. package/docs/api.md +2595 -0
  1033. package/docs/guide.md +1525 -0
  1034. package/migrations/0000_init.sql +108 -0
  1035. package/migrations/0001_review_attestation.sql +1 -0
  1036. package/migrations/0002_decisions_facts.sql +1 -0
  1037. package/migrations/0003_api_lane.sql +171 -0
  1038. package/migrations/0004_api_v1_1.sql +19 -0
  1039. package/migrations/0005_member_notify.sql +3 -0
  1040. package/migrations/0006_source_collections.sql +16 -0
  1041. package/migrations/0007_api_settlement.sql +27 -0
  1042. package/migrations/0008_review_extend.sql +1 -0
  1043. package/migrations/0009_card_refunds.sql +4 -0
  1044. package/migrations/0010_even_scorpion.sql +16 -0
  1045. package/migrations/0011_mcp_oauth.sql +27 -0
  1046. package/migrations/0012_mcp_standing.sql +21 -0
  1047. package/migrations/0013_unknown_krista_starr.sql +2 -0
  1048. package/migrations/0014_last_carnage.sql +14 -0
  1049. package/migrations/0015_company_authority.sql +26 -0
  1050. package/migrations/0016_owner_only_links.sql +6 -0
  1051. package/migrations/0017_organisations.sql +35 -0
  1052. package/migrations/0018_remove_app_signed.sql +4 -0
  1053. package/migrations/0019_submitted_via.sql +2 -0
  1054. package/migrations/0020_drop_decision_to_pay.sql +4 -0
  1055. package/migrations/0021_manual_erase.sql +25 -0
  1056. package/migrations/0022_errored_facts.sql +1 -0
  1057. package/migrations/0023_review_billing.sql +20 -0
  1058. package/migrations/0024_pending_task_details.sql +1 -0
  1059. package/migrations/meta/0000_snapshot.json +707 -0
  1060. package/migrations/meta/0001_snapshot.json +714 -0
  1061. package/migrations/meta/0002_snapshot.json +721 -0
  1062. package/migrations/meta/0003_snapshot.json +1845 -0
  1063. package/migrations/meta/0004_snapshot.json +1969 -0
  1064. package/migrations/meta/0005_snapshot.json +1991 -0
  1065. package/migrations/meta/0006_snapshot.json +2097 -0
  1066. package/migrations/meta/0007_snapshot.json +2128 -0
  1067. package/migrations/meta/0008_snapshot.json +2133 -0
  1068. package/migrations/meta/0009_snapshot.json +2161 -0
  1069. package/migrations/meta/0010_snapshot.json +2265 -0
  1070. package/migrations/meta/0011_snapshot.json +2448 -0
  1071. package/migrations/meta/0012_snapshot.json +2577 -0
  1072. package/migrations/meta/0013_snapshot.json +2594 -0
  1073. package/migrations/meta/0014_snapshot.json +2602 -0
  1074. package/migrations/meta/0015_snapshot.json +2778 -0
  1075. package/migrations/meta/0016_snapshot.json +2778 -0
  1076. package/migrations/meta/0017_snapshot.json +2792 -0
  1077. package/migrations/meta/0018_snapshot.json +2778 -0
  1078. package/migrations/meta/0019_snapshot.json +2792 -0
  1079. package/migrations/meta/0020_snapshot.json +2785 -0
  1080. package/migrations/meta/0021_snapshot.json +2762 -0
  1081. package/migrations/meta/0022_snapshot.json +2769 -0
  1082. package/migrations/meta/0023_snapshot.json +2900 -0
  1083. package/migrations/meta/0024_snapshot.json +2907 -0
  1084. package/migrations/meta/_journal.json +181 -0
  1085. package/openapi/decision-api.yaml +12204 -0
  1086. package/package.json +123 -4
  1087. package/skills/README.md +19 -0
  1088. package/skills/add-openhands-support/SKILL.md +113 -0
  1089. package/skills/create-collection/SKILL.md +199 -0
  1090. package/skills/create-collection/reference/claims-stack.md +106 -0
  1091. package/skills/create-collection/reference/collection.md +111 -0
  1092. package/skills/create-oracle/SKILL.md +400 -0
  1093. package/skills/create-rubric/SKILL.md +130 -0
  1094. package/skills/create-rubric/reference/format-cheatsheet.md +186 -0
  1095. package/skills/create-rubric/templates/claim-form.example.json +60 -0
  1096. package/skills/decision-api-client/SKILL.md +236 -0
  1097. package/skills/decision-api-oracle/SKILL.md +336 -0
  1098. package/skills/publish-protocol/SKILL.md +151 -0
  1099. package/skills/publish-protocol/reference/publishing.md +116 -0
  1100. package/skills/reference/engine-contract.md +222 -0
  1101. package/skills/write-facts/SKILL.md +221 -0
  1102. package/skills/write-facts/reference/examples/http-vendor.ts +88 -0
  1103. package/skills/write-facts/reference/examples/price-matches-agreement.ts +67 -0
  1104. package/skills/write-facts/reference/facts-api.md +232 -0
  1105. package/templates/project/.dev.vars.example +93 -0
  1106. package/templates/project/.editorconfig +9 -0
  1107. package/templates/project/CLAUDE.md +45 -0
  1108. package/templates/project/README.md +199 -0
  1109. package/templates/project/biome.json +37 -0
  1110. package/templates/project/gitignore +29 -0
  1111. package/templates/project/package.json +32 -0
  1112. package/templates/project/src/facts/index.ts +19 -0
  1113. package/templates/project/src/index.ts +25 -0
  1114. package/templates/project/test/api-lane.test.ts +57 -0
  1115. package/templates/project/test/facts.test.ts +14 -0
  1116. package/templates/project/tsconfig.json +25 -0
  1117. package/templates/project/vitest.config.ts +13 -0
  1118. package/templates/project/wrangler.jsonc +446 -0
@@ -0,0 +1,359 @@
1
+ /**
2
+ * Who may answer a chain claim's review (company authority D2; ownership review F1, F2, F12): a
3
+ * person the COMPANY named, never "whoever holds an evaluate grant". The grant is one `@ixo/ucan`
4
+ * delegation, `claims/review` on `ixo:oracle/<our did:web>/collection/<id>`, from a current
5
+ * controller of the collection's entity to the reviewer's `did:ixo` (docs/ENGINE-CONTRACT.md
6
+ * "Reviewer authority: `reviewerGrant`"). The owner files it here (`POST /v1/collections/:id/
7
+ * reviewers`), the reviewer sends it back with every answer, and the fold forwards it verbatim: the
8
+ * engine checks the root again itself and records it in the receipt.
9
+ *
10
+ * The gate runs at the answer AND inside the fold (workflows/review-complete.ts): a revoke, a
11
+ * controller removed, or an evaluate grant given to the reviewer between the two refuses the fold
12
+ * with no engine call. The revocation half is OURS alone this round (the engine checks only the
13
+ * root and the cap) — which is exactly why it must run at fold time too.
14
+ *
15
+ * Checks, in order — the cheap and deterministic first, the chain reads last:
16
+ * 1. the CAR (`parseReviewerGrant`): one delegation, no proofs, no extra block; the signature
17
+ * verifies against the issuer's on-chain key; the capability is exactly `claims/review` on
18
+ * this collection's resource (no wildcard); issuer and audience are distinct `did:ixo`
19
+ * accounts; `nbf` and `exp` both set, `exp − nbf` ≤ 30 days (ucanto has no `iat`), and
20
+ * `nbf ≤ now + 60 s < …`, `now < exp` → 400 INVALID
21
+ * 2. the audience is the reviewer (the attestation issuer, the UCAN principal) → 400 INVALID
22
+ * 3. revocation: the canonical CID is a `collection_reviewers` row, unrevoked → 403
23
+ * 4. no identity of THIS oracle anywhere in the chain — its OWNER included → 403
24
+ * 5. live root: the issuer is a current controller of the collection's entity → 403
25
+ * 6. no `did:ixo` in the chain holds an `EvaluateClaimAuthorization` on the collection — read
26
+ * uncached: an evaluator must not review (F12) → 403
27
+ * Blocksync, the chain or a DID resolver unreachable is a 503 (`AppError.unavailable`), never a pass;
28
+ * so is a collection with no entity — there is no controller to root a grant at (fail closed).
29
+ *
30
+ * Every refusal carries `details.reason` in the engine's CA4 vocabulary (`GrantRefusal`), so the
31
+ * Portal and the Console read one set whichever side refused. `revoked` is ours alone: the engine
32
+ * keeps no revocations this round.
33
+ */
34
+ import { and, eq, gt, isNull } from "drizzle-orm";
35
+ import { collectionResource, sourceResource } from "../../contracts/capabilities.js";
36
+ import { collectionReviewers } from "../../db/schema.js";
37
+ import { AppError } from "../errors.js";
38
+ import { queryEvaluateGrant } from "../ixo/authz.js";
39
+ import { getCollection, getEntityControllers } from "../ixo/blocksync/index.js";
40
+ import { decode, finite, Invalid, proofsOf, Refused, summarize, verifyChain, verifySignedWith, } from "../ixo/grant-chain.js";
41
+ import { oracleWebDid } from "../ixo/ucan.js";
42
+ /** The one ability a reviewer grant carries. */
43
+ export const REVIEW_CAN = "claims/review";
44
+ /** The longest a reviewer grant may live (`exp − nbf`), as the engine enforces it. */
45
+ export const REVIEWER_GRANT_MAX_SEC = 30 * 86_400;
46
+ /** Clock skew allowed on `nbf`, as the engine allows it (CA4): a grant minted on a clock a little
47
+ * ahead of ours stands at once. `exp` is strict on both sides. */
48
+ export const REVIEWER_GRANT_SKEW_SEC = 60;
49
+ const ACCOUNT_DID = /^did:ixo:ixo1[0-9a-z]+$/;
50
+ export const invalid = (reason, why) => new AppError(`This reviewer grant can't be used: ${why}.`, {
51
+ code: "REVIEWER_GRANT_INVALID",
52
+ details: { reason },
53
+ });
54
+ export const notAuthorized = (reason, why) => new AppError(`This reviewer grant does not authorize a review: ${why}.`, {
55
+ code: "REVIEWER_NOT_AUTHORIZED",
56
+ details: { reason },
57
+ });
58
+ /** One check over the CAR, its token-level defects (`Invalid`/`Refused`) named `reason`. */
59
+ async function check(reason, run) {
60
+ try {
61
+ return await run();
62
+ }
63
+ catch (err) {
64
+ if (err instanceof Invalid || err instanceof Refused)
65
+ throw invalid(reason, err.message);
66
+ throw err;
67
+ }
68
+ }
69
+ /** The collection's entity controllers, live. No entity (or no collection) is 503, never `[]`. */
70
+ async function controllersOf(deps, collectionId) {
71
+ const collection = await getCollection(deps, collectionId);
72
+ if (!collection?.entity) {
73
+ throw AppError.unavailable(`Collection ${collectionId} has no entity to root reviewer grants at`);
74
+ }
75
+ return {
76
+ controllers: await getEntityControllers(deps, collection.entity),
77
+ admin: collection.admin,
78
+ };
79
+ }
80
+ /**
81
+ * One `claims/review` link on `resource`, read off its CAR: shape, signature (`verify`), the one
82
+ * capability, two IXO accounts, and the window. Who the accounts may be is the caller's.
83
+ */
84
+ async function readGrant(car, resource, verify, renew, now) {
85
+ const leaf = await check("unparseable", () => decode(car));
86
+ await check("shape", () => proofsOf(leaf, {
87
+ max: 0,
88
+ message: "it must be one grant from the company, not a grant passed on",
89
+ }));
90
+ // The delegation and nothing else. The one block allowed beyond it IS the archive's variant root:
91
+ // `decode` (ucanto's extract) only reads a CAR whose root is that block, so it is always present
92
+ // and a smuggled block makes two. The engine's rule is the same count (blocks = links + 1).
93
+ const extra = [...leaf.blocks.keys()].filter((k) => k !== leaf.cid.toString());
94
+ if (extra.length > 1)
95
+ throw invalid("extra-block", "the CAR carries blocks beyond the one grant");
96
+ await check("signature", () => verify(leaf));
97
+ const link = await check("shape", () => summarize(leaf));
98
+ onlyReview(link, resource);
99
+ if (!ACCOUNT_DID.test(link.issuer) || !ACCOUNT_DID.test(link.audience)) {
100
+ throw invalid("identity", "it must be issued by an IXO account (did:ixo:ixo1…) to an IXO account");
101
+ }
102
+ inWindow(link, renew, now);
103
+ return link;
104
+ }
105
+ /** Exactly one capability: `claims/review` on `resource`. */
106
+ function onlyReview(link, resource) {
107
+ const [cap, ...more] = link.caps;
108
+ const one = `it must carry exactly one capability, { with: "${resource}", can: "${REVIEW_CAN}" }`;
109
+ if (!cap || more.length > 0 || cap.can !== REVIEW_CAN)
110
+ throw invalid("capability", one);
111
+ if (cap.with !== resource)
112
+ throw invalid("resource", one);
113
+ }
114
+ /** The engine's window: `nbf` and `exp` both set, `exp − nbf` ≤ 30 days, `nbf ≤ now + skew`,
115
+ * `now < exp`. */
116
+ function inWindow(link, renew, now) {
117
+ if (link.nbf === null || link.exp === null) {
118
+ throw invalid("lifetime", "it must state when it starts (nbf) and when it ends (exp)");
119
+ }
120
+ if (link.exp - link.nbf > REVIEWER_GRANT_MAX_SEC) {
121
+ throw invalid("too-long", `it may last at most ${REVIEWER_GRANT_MAX_SEC / 86_400} days`);
122
+ }
123
+ if (link.nbf > now + REVIEWER_GRANT_SKEW_SEC)
124
+ throw invalid("not-yet-valid", "it has not started yet");
125
+ if (link.exp <= now)
126
+ throw invalid("expired", `it has expired — ${renew}`);
127
+ }
128
+ /** Check 1 — the CAR alone: shape, signature, capability, identities and window. */
129
+ export async function parseReviewerGrant(config, car, collectionId, now = Math.floor(Date.now() / 1000)) {
130
+ // Chain claims: root → member, one link (an API-lane root signs its own: `parseSelfReviewGrant`).
131
+ const link = await readGrant(car, collectionResource(oracleWebDid(config), collectionId), (leaf) => verifyChain(config, [leaf]), "ask the collection's owner for a new one", now);
132
+ if (link.issuer === link.audience)
133
+ throw invalid("identity", "it must be issued to someone else");
134
+ return {
135
+ cid: link.cid,
136
+ rootDid: link.issuer,
137
+ memberDid: link.audience,
138
+ exp: link.exp,
139
+ delegation: car,
140
+ };
141
+ }
142
+ /**
143
+ * An API-lane root's grant to itself (owner 2026-10-10; the engine's `rootKind:
144
+ * company-controller`): an organisation's controller answering a review of one of its sources
145
+ * carries ONE self-link — issuer = audience = `controllerDid`, `claims/review` on
146
+ * `ixo:oracle/<our did:web>/source/<sourceId>`, the same window rules — signed with `keyDid`, the
147
+ * key its attestation was signed with (already proved to be on its IID). Its controller-ness is
148
+ * the console's live root check, and the engine re-reads it; no oracle identity may be the
149
+ * controller. Throws `REVIEWER_GRANT_INVALID` / `REVIEWER_NOT_AUTHORIZED` with `details.reason`.
150
+ */
151
+ export async function parseSelfReviewGrant(config, car, scope, now = Math.floor(Date.now() / 1000)) {
152
+ const link = await readGrant(car, sourceResource(oracleWebDid(config), scope.sourceId), (leaf) => verifySignedWith(leaf, scope.keyDid), "sign a new one", now);
153
+ if (link.issuer !== scope.controllerDid || link.audience !== scope.controllerDid) {
154
+ throw invalid("audience", `it must be issued by ${scope.controllerDid} to itself, the controller answering`);
155
+ }
156
+ await assertNotOracle(config, [scope.controllerDid]);
157
+ return {
158
+ cid: link.cid,
159
+ rootDid: link.issuer,
160
+ memberDid: link.audience,
161
+ exp: link.exp,
162
+ delegation: car,
163
+ };
164
+ }
165
+ /**
166
+ * An API-lane MEMBER's reviewer grant (owner 2026-10-10, S1: the engine refuses a company
167
+ * decision's fold without one): ONE CAR of exactly two links, root first —
168
+ * 1. a current controller of the source's organisation → the member's did:ixo: the member's
169
+ * STORED, unrevoked role grant, matched by canonical CID (`delegationCid`) — so `mayReview`'s
170
+ * reading of that row (capabilities, `nb.protocols`, which the engine does not read) is the
171
+ * protocol limit; any other first link is refused;
172
+ * 2. the member's did:ixo → `reviewerKey`, the did:key the member registered and the answers
173
+ * are signed with: exactly `claims/review` on this source.
174
+ * Per link, as the engine: no wildcard in any `can` / `with`, a `claims/review` cap on
175
+ * `ixo:oracle/<our did:web>/source/<sourceId>`, the window (`inWindow`), and no oracle identity.
176
+ * Deterministic checks first; the two signatures (each against its issuer's IID) last.
177
+ */
178
+ export async function parseMemberReviewGrant(config, car, scope, now = Math.floor(Date.now() / 1000)) {
179
+ const resource = sourceResource(oracleWebDid(config), scope.sourceId);
180
+ const two = "it must be two links: your access from the organisation, then your grant to your reviewer key";
181
+ const leaf = await check("unparseable", () => decode(car));
182
+ const [root] = await check("shape", () => proofsOf(leaf, { max: 1, message: two }));
183
+ if (!root)
184
+ throw invalid("shape", two);
185
+ // The two delegations and nothing else — the one block beyond them is the variant root (above).
186
+ const own = new Set([leaf.cid.toString(), root.cid.toString()]);
187
+ if ([...leaf.blocks.keys()].filter((k) => !own.has(k)).length > 1) {
188
+ throw invalid("extra-block", "the CAR carries blocks beyond the two grants");
189
+ }
190
+ const [access, key] = await check("shape", () => Promise.all([summarize(root), summarize(leaf)]));
191
+ // Link 1: what the member holds now, from a root that is one now.
192
+ for (const cap of access.caps) {
193
+ if (cap.can.includes("*") || cap.with.includes("*")) {
194
+ throw invalid("capability", "your access from the organisation grants everything (a wildcard) — a reviewer grant names claims/review; ask an admin to give you a role that reviews");
195
+ }
196
+ }
197
+ if (!access.caps.some((cap) => cap.can === REVIEW_CAN && cap.with === resource)) {
198
+ throw invalid("capability", `your access from the organisation does not include ${REVIEW_CAN}`);
199
+ }
200
+ if (access.cid !== scope.delegationCid) {
201
+ throw notAuthorized("revoked", "its first link is not your current access to this source — reload the console and answer again");
202
+ }
203
+ inWindow(access, "ask an admin of the organisation to grant your role again", now);
204
+ if (!ACCOUNT_DID.test(access.issuer) || !scope.roots.includes(access.issuer)) {
205
+ throw notAuthorized("root-not-controller", `${access.issuer} is not a current controller of this source's organisation`);
206
+ }
207
+ // Link 2: the member to the key that signed the answers.
208
+ onlyReview(key, resource);
209
+ if (access.audience !== scope.memberDid || key.issuer !== scope.memberDid) {
210
+ throw invalid("audience", `both links must name you, ${scope.memberDid}`);
211
+ }
212
+ if (key.audience !== scope.reviewerKey) {
213
+ throw invalid("audience", `it must be granted to ${scope.reviewerKey}, the reviewer key the answers are signed with`);
214
+ }
215
+ inWindow(key, "sign a new one", now);
216
+ await assertNotOracle(config, [access.issuer, scope.memberDid, scope.reviewerKey]);
217
+ await check("signature", () => verifyChain(config, [root, leaf]));
218
+ return {
219
+ cid: key.cid,
220
+ rootDid: access.issuer,
221
+ memberDid: scope.memberDid,
222
+ exp: Math.min(access.exp, key.exp),
223
+ delegation: car,
224
+ };
225
+ }
226
+ /** Every identity of THIS oracle — none may root, receive or self-sign a reviewer grant. */
227
+ function oracleIdentities(config) {
228
+ return new Set([
229
+ config.ORACLE_DID,
230
+ `did:ixo:${config.ORACLE_ADDRESS}`,
231
+ oracleWebDid(config),
232
+ config.ORACLE_ENTITY_DID,
233
+ ].filter((did) => !!did));
234
+ }
235
+ /**
236
+ * Check 4: no identity of this oracle in `dids` — nor its OWNER, the account that signed
237
+ * `OWNER_DELEGATION_CAR`: the engine counts the owner among the oracle's identities and refuses its
238
+ * fold, so an answer that names it is refused here, before anything is stored (owner 2026-10-11).
239
+ */
240
+ export async function assertNotOracle(config, dids) {
241
+ const oracle = oracleIdentities(config);
242
+ if (dids.some((did) => oracle.has(did))) {
243
+ throw notAuthorized("oracle", "this oracle may not review the claims it evaluates");
244
+ }
245
+ const owner = await oracleOwnerDid(config);
246
+ if (owner && dids.includes(owner)) {
247
+ throw notAuthorized("oracle-owner", "the oracle's owner may not review the claims it evaluates — another controller of the organisation reviews");
248
+ }
249
+ }
250
+ let ownerMemo;
251
+ /**
252
+ * The oracle's owner: the issuer of `OWNER_DELEGATION_CAR` (the AuthHub session that registered the
253
+ * oracle with the engine — lib/engine/client.ts `register`). Null when none is configured. Read once
254
+ * per isolate per CAR; our own secret, so no signature check. One that does not parse is a broken
255
+ * config and throws, loud — the engine could not register this oracle with it either.
256
+ */
257
+ export function oracleOwnerDid(config) {
258
+ const car = config.OWNER_DELEGATION_CAR;
259
+ if (!car)
260
+ return Promise.resolve(null);
261
+ if (ownerMemo?.car !== car) {
262
+ ownerMemo = {
263
+ car,
264
+ did: import("@ixo/ucan")
265
+ .then(({ parseDelegation }) => parseDelegation(car))
266
+ .then((d) => d.issuer.did(), (err) => {
267
+ throw AppError.internal("OWNER_DELEGATION_CAR is not a UCAN delegation", err);
268
+ }),
269
+ };
270
+ }
271
+ return ownerMemo.did;
272
+ }
273
+ /**
274
+ * Checks 4–6 — what the chain says about the people in a grant, now. Shared with the grant route,
275
+ * which runs it before filing a grant so an owner hears "that person evaluates this collection" at
276
+ * once rather than at their reviewer's first answer.
277
+ */
278
+ export async function assertReviewerAuthority(deps, grant, collectionId) {
279
+ const { config } = deps;
280
+ const people = [grant.rootDid, grant.memberDid];
281
+ await assertNotOracle(config, people);
282
+ const { controllers, admin } = await controllersOf(deps, collectionId);
283
+ if (!controllers.includes(grant.rootDid)) {
284
+ throw notAuthorized("root-not-controller", `${grant.rootDid} is not a current controller of collection ${collectionId}'s entity`);
285
+ }
286
+ // An evaluate grant can sign MsgEvaluateClaim and move the collection's payments directly (F12);
287
+ // that power and review authority stay in different hands. Uncached: a grant given moments ago
288
+ // counts. No admin ⇒ no grant can exist.
289
+ if (admin) {
290
+ const evaluators = await Promise.all(people.map((did) => queryEvaluateGrant(config, admin, did.slice("did:ixo:".length), collectionId)));
291
+ const evaluator = people.find((_, i) => evaluators[i]);
292
+ if (evaluator) {
293
+ throw notAuthorized("evaluator", `${evaluator} holds an evaluate grant on collection ${collectionId} — an evaluator may not review`);
294
+ }
295
+ }
296
+ }
297
+ /**
298
+ * The whole gate (header): the grant the reviewer sent with an answer, for `reviewerDid` on
299
+ * `collectionId`. Throws the refusal; returns the verified grant.
300
+ */
301
+ export async function checkReviewerGrant(deps, car, scope) {
302
+ const grant = await parseReviewerGrant(deps.config, car, scope.collectionId);
303
+ if (grant.memberDid !== scope.reviewerDid) {
304
+ throw invalid("audience", `it was granted to ${grant.memberDid}, not to the reviewer ${scope.reviewerDid}`);
305
+ }
306
+ const [row] = await deps.db
307
+ .select({ delegation: collectionReviewers.delegation })
308
+ .from(collectionReviewers)
309
+ .where(and(eq(collectionReviewers.collectionId, scope.collectionId), eq(collectionReviewers.delegationCid, grant.cid), isNull(collectionReviewers.revokedAt)));
310
+ if (!row) {
311
+ throw notAuthorized("revoked", "it is not a live reviewer grant of this collection (never filed, or revoked) — ask its owner");
312
+ }
313
+ await assertReviewerAuthority(deps, grant, scope.collectionId);
314
+ return { ...grant, delegation: row.delegation };
315
+ }
316
+ /**
317
+ * The collection's filed grants that stand NOW — the read gate's reviewer path (routes/v1/shared.ts)
318
+ * and the review room (lib/matrix/deliver.ts): unrevoked, inside their window (`nbf ≤ now + skew`, `now < exp`;
319
+ * the row keeps no `nbf`, so it is read off the filed CAR), and from a root that is STILL a current
320
+ * controller of the collection's entity. The standing half of the gate — no signature check, the
321
+ * row was verified when it was filed; an answer and a fold run the whole of `checkReviewerGrant`.
322
+ * Controllers are read uncached, and only once a row survives the table's own filter, so a caller
323
+ * who was never granted costs no chain read. Blocksync trouble throws (503), never an empty answer.
324
+ */
325
+ export async function liveReviewerGrants(deps, db, collectionId, opts = {}) {
326
+ const now = opts.now ?? new Date();
327
+ const rows = await db
328
+ .select({
329
+ memberDid: collectionReviewers.memberDid,
330
+ rootDid: collectionReviewers.rootDid,
331
+ delegationCid: collectionReviewers.delegationCid,
332
+ delegation: collectionReviewers.delegation,
333
+ })
334
+ .from(collectionReviewers)
335
+ .where(and(eq(collectionReviewers.collectionId, collectionId), opts.memberDid ? eq(collectionReviewers.memberDid, opts.memberDid) : undefined, isNull(collectionReviewers.revokedAt), gt(collectionReviewers.expiresAt, now)));
336
+ const nowSec = Math.floor(now.getTime() / 1000);
337
+ const started = [];
338
+ for (const { delegation, ...row } of rows) {
339
+ if (await startedBy(delegation, nowSec))
340
+ started.push(row);
341
+ }
342
+ if (started.length === 0)
343
+ return [];
344
+ const { controllers } = await controllersOf(deps, collectionId);
345
+ return started.filter((row) => controllers.includes(row.rootDid));
346
+ }
347
+ /** The filed CAR's `nbf` has passed. One that no longer decodes stands for nothing (fail closed). */
348
+ async function startedBy(car, nowSec) {
349
+ try {
350
+ const nbf = finite((await decode(car)).notBefore);
351
+ return nbf !== null && nbf <= nowSec + REVIEWER_GRANT_SKEW_SEC;
352
+ }
353
+ catch (err) {
354
+ if (err instanceof Invalid)
355
+ return false;
356
+ throw err;
357
+ }
358
+ }
359
+ //# sourceMappingURL=reviewer-grant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reviewer-grant.js","sourceRoot":"","sources":["../../../src/lib/review/reviewer-grant.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAGH,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAElF,OAAO,EAA2B,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EACL,MAAM,EACN,MAAM,EACN,OAAO,EAEP,QAAQ,EACR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MAAM,CAAC;YAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7D,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACpC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,aAAa,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAChE,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,qGAAqG;AACrG,KAAK,UAAU,SAAS,CAAC,GAAW,EAAE,MAAc;IAClD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAClD,OAAO,GAAG,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,GAAG,uBAAuB,CAAC;IACjE,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,OAAO;YAAE,OAAO,KAAK,CAAC;QACzC,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * One pending review task as a reviewer is asked it: id, prompt, answer shape. The manifest's
3
+ * `review.taskDetails` says it (engine T9). Without an entry — an older engine, or a manifest read
4
+ * that failed — a rubric task falls back to its bare id and a boolean (the fold lane's default).
5
+ *
6
+ * The engine's SYNTHETIC tasks never do (engine #82): `unique:<ruleId>` (a possible duplicate) and
7
+ * `checks:held` (a claim held only by a failed check, on a rubric with no claim-level task) are
8
+ * answered `"approve"` / `"reject"`, and the engine refuses a boolean with a 400. So their fallback
9
+ * is the engine's own enum and prompt, never a boolean the reviewer could not send.
10
+ */
11
+ import type { Manifest, ManifestReviewAnswer } from "../engine/types.js";
12
+ export interface ReviewTaskShape {
13
+ id: string;
14
+ prompt: string;
15
+ answer: ManifestReviewAnswer;
16
+ }
17
+ export declare function reviewTaskOf(id: string, review: Manifest["review"]): ReviewTaskShape;
18
+ //# sourceMappingURL=tasks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../../src/lib/review/tasks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEtE,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AAuBD,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,eAAe,CAIpF"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * One pending review task as a reviewer is asked it: id, prompt, answer shape. The manifest's
3
+ * `review.taskDetails` says it (engine T9). Without an entry — an older engine, or a manifest read
4
+ * that failed — a rubric task falls back to its bare id and a boolean (the fold lane's default).
5
+ *
6
+ * The engine's SYNTHETIC tasks never do (engine #82): `unique:<ruleId>` (a possible duplicate) and
7
+ * `checks:held` (a claim held only by a failed check, on a rubric with no claim-level task) are
8
+ * answered `"approve"` / `"reject"`, and the engine refuses a boolean with a 400. So their fallback
9
+ * is the engine's own enum and prompt, never a boolean the reviewer could not send.
10
+ */
11
+ const APPROVE_REJECT = { type: "enum", options: ["approve", "reject"] };
12
+ /** The engine's prompts for its synthetic tasks (engine #82), used only when no detail came. */
13
+ function syntheticTask(id) {
14
+ if (id.startsWith("unique:")) {
15
+ return {
16
+ id,
17
+ prompt: "Is this a different job from the earlier claim shown?",
18
+ answer: { ...APPROVE_REJECT, options: [...APPROVE_REJECT.options] },
19
+ };
20
+ }
21
+ if (id === "checks:held") {
22
+ return {
23
+ id,
24
+ prompt: "An automatic check couldn't run. Approve or reject this claim?",
25
+ answer: { ...APPROVE_REJECT, options: [...APPROVE_REJECT.options] },
26
+ };
27
+ }
28
+ return null;
29
+ }
30
+ export function reviewTaskOf(id, review) {
31
+ const detail = review?.taskDetails?.find((t) => t.id === id);
32
+ if (detail)
33
+ return { id: detail.id, prompt: detail.prompt, answer: detail.answer };
34
+ return syntheticTask(id) ?? { id, prompt: id, answer: { type: "boolean" } };
35
+ }
36
+ //# sourceMappingURL=tasks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../../src/lib/review/tasks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAUH,MAAM,cAAc,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAW,CAAC;AAEjF,gGAAgG;AAChG,SAAS,aAAa,CAAC,EAAU;IAC/B,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC7B,OAAO;YACL,EAAE;YACF,MAAM,EAAE,uDAAuD;YAC/D,MAAM,EAAE,EAAE,GAAG,cAAc,EAAE,OAAO,EAAE,CAAC,GAAG,cAAc,CAAC,OAAO,CAAC,EAAE;SACpE,CAAC;IACJ,CAAC;IACD,IAAI,EAAE,KAAK,aAAa,EAAE,CAAC;QACzB,OAAO;YACL,EAAE;YACF,MAAM,EAAE,gEAAgE;YACxE,MAAM,EAAE,EAAE,GAAG,cAAc,EAAE,OAAO,EAAE,CAAC,GAAG,cAAc,CAAC,OAAO,CAAC,EAAE;SACpE,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,EAAU,EAAE,MAA0B;IACjE,MAAM,MAAM,GAAG,MAAM,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAC7D,IAAI,MAAM;QAAE,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;IACnF,OAAO,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC;AAC9E,CAAC"}
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Error reporting (OBS-02). One place that decides what leaves this service.
3
+ *
4
+ * The boundary is the SAME one the engine's signed receipts hold: **codes, scores and identifiers may
5
+ * leave; answer values, trace contents and credentials may not.** That is deliberately not "send
6
+ * nothing" — an issue you cannot debug is worse than no issue, so claim ids, collection ids, step
7
+ * names and error codes all ride along, and the log trail comes with them. What gets redacted is
8
+ * the short list in `SENSITIVE_KEYS` (lib/redact.ts, shared with the logger) plus auth headers.
9
+ *
10
+ * Two things this file exists to enforce:
11
+ *
12
+ * 1. **`withSentry` alone would report almost nothing.** This codebase catches by design — Hono's
13
+ * `onError` converts every throw into the `AppError` envelope, and each side-effect lane
14
+ * (chain-write, Matrix, cron) swallows its own failure so it can never fail a
15
+ * workflow. An unhandled exception is the exception here, so the fail-soft catches call
16
+ * `reportError` explicitly. Installing the SDK without those calls buys a green dashboard and
17
+ * silent failures.
18
+ * 2. **Redaction is ours now.** Cloudflare's old dashboard integration scrubbed headers for you via
19
+ * `BLOCKED_HEADERS`; that flow was removed in 2025, so the hooks below are the only thing
20
+ * standing between a UCAN bearer token and Sentry.
21
+ *
22
+ * Unset `SENTRY_DSN` ⇒ every function here is a no-op (`captureException` with no client is safe),
23
+ * which is what keeps local dev and CI from shipping events.
24
+ */
25
+ import * as Sentry from "@sentry/cloudflare";
26
+ import type { Config } from "../config.js";
27
+ import type { OracleEnv } from "../env.js";
28
+ import type { Logger } from "./logger.js";
29
+ /**
30
+ * The init options, shared by the fetch/scheduled wrapper and by every instrumented Workflow so a
31
+ * workflow event can never be less redacted than a request event.
32
+ */
33
+ export declare function sentryOptions(env: OracleEnv): Sentry.CloudflareOptions;
34
+ /** True when the lane is configured at all — lets callers skip building context for nothing. */
35
+ export declare const sentryEnabled: (config: Pick<Config, "SENTRY_DSN">) => boolean;
36
+ /**
37
+ * Identifiers that make an issue actionable. All become Sentry TAGS (indexed and searchable — you
38
+ * can filter the issue stream by `claimId`), not just context, because "which claim was this?" is
39
+ * the first question every one of these failures raises.
40
+ */
41
+ export interface ErrorScope {
42
+ /** Which lane swallowed it: `chain-evaluate`, `notify`, `cron`, `review`, … */
43
+ lane: string;
44
+ /** The durable step, where one applies — retries of the same step group into one issue. */
45
+ step?: string;
46
+ claimId?: string;
47
+ collectionId?: string;
48
+ /** The Workflow instance id — paste straight into `wrangler workflows instances describe`. */
49
+ instanceId?: string;
50
+ /** Anything else: CODES AND IDENTIFIERS ONLY. Never answer values, never trace contents. */
51
+ context?: Record<string, string | number | boolean | null | undefined>;
52
+ }
53
+ /**
54
+ * Report a failure the code deliberately swallowed.
55
+ *
56
+ * `fingerprint` groups retries of the same durable step into ONE issue instead of one per attempt;
57
+ * Workflow steps retry by design, and without this a single stuck claim would page repeatedly.
58
+ * (The SDK already disables its own dedupe integration inside Workflows.) It is deliberately NOT
59
+ * keyed on claimId — one broken lane should be one issue with many events, not one issue per claim.
60
+ */
61
+ export declare function reportError(err: unknown, scope: ErrorScope): void;
62
+ /** What `reportAlert` needs — every lane that pages already carries these three on its deps. */
63
+ export interface AlertDeps {
64
+ config: Partial<Pick<Config, "OPS_ALERT_WEBHOOK_URL" | "SERVICE_NAME" | "IXO_NETWORK">>;
65
+ /** `env.CACHE_KV` — the 30-minute dedupe. Absent ⇒ nothing is deduped. */
66
+ cache?: KVNamespace;
67
+ logger: Logger;
68
+ }
69
+ /** CODES, IDS AND NUMBERS ONLY — the same boundary as `ErrorScope.context`. */
70
+ export type AlertFields = Record<string, string | number | boolean | null | undefined>;
71
+ /**
72
+ * Page someone (observability spec §5.2): a condition a runbook says wakes a person, as opposed to
73
+ * a failure `reportError` records. The same contract in every IXO service:
74
+ *
75
+ * 1. Dedupe FIRST, on KV `ops-alert:<dedupeKey ?? event>` for 30 minutes — so both sinks see one
76
+ * page per condition per window, not one per occurrence. That is why event names carry the
77
+ * reason (`collection.paused.rubric-unusable`): the dedupe must never hide a different condition.
78
+ * A KV that throws is no reason to stay silent: send anyway.
79
+ * 2. Sentry: one `captureMessage` at `error`, fingerprinted on `event`, so one condition is one
80
+ * issue — the issue alert routes it to Slack. A no-op without `SENTRY_DSN`.
81
+ * 3. `OPS_ALERT_WEBHOOK_URL`, only when set: a Slack-compatible `{ text }` POST, under
82
+ * `suppressTracing` so no span or breadcrumb records the URL (it is the credential). A POST that
83
+ * fails frees the dedupe key, so the next occurrence tries again.
84
+ *
85
+ * Never throws — it sits beside the log line of a lane that is already failing, and must not be
86
+ * the thing that fails it. A webhook failure is one `ops-alert.failed` warn (no URL in it).
87
+ */
88
+ export declare function reportAlert(deps: AlertDeps, event: string, fields?: AlertFields, dedupeKey?: string): Promise<void>;
89
+ //# sourceMappingURL=sentry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentry.d.ts","sourceRoot":"","sources":["../../src/lib/sentry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAiFvC;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM,CAAC,iBAAiB,CAoEtE;AAED,gGAAgG;AAChG,eAAO,MAAM,aAAa,WAAY,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,KAAG,OAA8B,CAAC;A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