@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
package/README.md CHANGED
@@ -1,3 +1,795 @@
1
- # Temporary Holding Version
1
+ # @ixo/decision-oracle
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ An **evaluation oracle** is the service that answers "did this actually happen?" for a project on
4
+ the IXO chain. Someone submits a **claim** against a collection — a delivery, a cookstove refill, a
5
+ site inspection. Your oracle pulls that claim, produces the **facts** the collection's rubric asks
6
+ for (a courier API says the parcel arrived, a model says the photo shows what it should, a registry
7
+ says this is not a duplicate), hands those facts to the IXO **decision engine**, and signs the
8
+ verdict the engine returns on chain with your own key.
9
+
10
+ This repository is the package that is all of that **except the facts**. You write a config object
11
+ and a handful of async functions; `@ixo/decision-oracle` brings the claim pulling, the engine handshake,
12
+ the D1 ledgers, human-review folds, the chain write, billing pauses, email and Matrix notices, the
13
+ cron and the Workflows. It is for developers who want to run an oracle as a service, for teams
14
+ publishing a protocol and its rubric, and for anyone who needs a claim judged the same way twice.
15
+
16
+ **The rubric is the work order. The engine decides. You produce facts and sign.**
17
+
18
+ > **Learn more**
19
+ > · Step-by-step guide: [`packages/eval-oracle/docs/guide.md`](https://github.com/ixoworld/eval-oralce/blob/main/packages/eval-oracle/docs/guide.md)
20
+ > · Full API reference: [`packages/eval-oracle/docs/api.md`](https://github.com/ixoworld/eval-oralce/blob/main/packages/eval-oracle/docs/api.md)
21
+ > · The engine's wire contract: [`docs/ENGINE-CONTRACT.md`](https://github.com/ixoworld/eval-oralce/blob/main/docs/ENGINE-CONTRACT.md)
22
+
23
+ ---
24
+
25
+ ## What you can do with it
26
+
27
+ - **Run your own oracle for a protocol.** `decision-oracle init` scaffolds a Cloudflare Worker with
28
+ three files that are yours; everything else is the package's.
29
+ - **Write fact handlers** — one async function per named fact. External HTTP sources, AI checks,
30
+ duplicate detection and submission-rate limits all have a **stock** lane already, so you only
31
+ write the ones stock cannot answer.
32
+ - **Test them in plain node.** `@ixo/decision-oracle/testing` runs the real production runner against
33
+ fake tools. No Worker, no network, no chain — just `vitest`.
34
+ - **Dry-run against a real claim and the real engine.** `facts run --preview` produces your facts
35
+ with REAL tools and asks the engine for the decision they would yield: nothing recorded, nothing
36
+ billed, no on-chain grant needed.
37
+ - **Publish protocols, rubrics, deeds and collections from the CLI** — `rubric validate`,
38
+ `publish-protocol`, `create-deed`, `create-collection`, `submit-claim`: the whole commissioner
39
+ side, so you can stand up an end-to-end loop by yourself.
40
+ - **Provision the whole oracle on chain with one command** — `oracle init` funds its wallet, writes
41
+ its IID document and its Ed25519 verification key, creates its Matrix account, then the oracle
42
+ entity with its full public identity — profile, domain card, Agent Card — the `#eval` service and
43
+ the protocol links that make you discoverable in the IXO portal's marketplace.
44
+ - **Drive all of it with the shipped Claude skills.** `init` copies six skills into
45
+ `.claude/skills/`: `create-oracle`, `write-facts`, `create-rubric`, `publish-protocol`,
46
+ `create-collection`, `decision-api-oracle`.
47
+
48
+ ## How it works
49
+
50
+ One `ClaimIngest` Workflow per claim; every step is checkpointed and retried independently.
51
+
52
+ 1. **Watch** — `POST /v1/collections/register` passes four gates (who / hired / protocol / paid)
53
+ and lands a watched-collection row.
54
+ 2. **Discover** — a cron tick scans watched collections on Blocksync behind a forward-only cursor
55
+ and starts one Workflow per unseen claim.
56
+ 3. **Pull** — the claim body from the first store that has it: the VFS claims lane (under your
57
+ Evaluate grant), a VFS public copy, the Matrix claim bot (via the owner's delegation), the IPFS
58
+ gateway, then a Cellnode the entity declares. Every store but the bot is CID-verified. Plus
59
+ attachment *descriptors* — a bare CID resolves to the body's own store. Bytes stay where they are.
60
+ 4. **Produce facts** — read the work order from the engine (a **manifest**: the `ext.*` / `ai.*`
61
+ names the rubric declares), run your handlers with the stock lanes behind them, validate the
62
+ answer against the order, and freeze a strict FactSet.
63
+ 5. **Ask the engine** — `POST /v1/decisions` → `{ decision, resultDigest, receipt: { cid, jws } }`,
64
+ cached once. The engine is the only judge of rubric ⇄ form ⇄ facts.
65
+ 6. **Act** — on a terminal verdict, sign `MsgEvaluateClaim` with `verification_proof =
66
+ receipt.cid`. A `review` verdict waits for a human's answers, which the `ReviewComplete`
67
+ Workflow folds into the **same** decision — never a second evaluation.
68
+
69
+ ```
70
+ ┌──────────────────────────────────────────────────┐
71
+ │ commissioner (IXO portal) │
72
+ │ publishes a protocol: claim form + rubric │
73
+ │ grants your ORACLE_ADDRESS the Evaluate role │
74
+ │ registers their collection with your oracle │
75
+ └───────────────────────┬──────────────────────────┘
76
+ │
77
+ IXO chain + Blocksync ▼ IXO decision engine
78
+ ┌──────────────────────┐ ┌───────────────┐ ┌────────────────────┐
79
+ │ collections, claim │ claims │ YOUR ORACLE │manifest│ binds the rubric │
80
+ │ ids, grants, the │────────►│ (Workers) │◄──────►│ to the claim form, │
81
+ │ evaluation payment │ │ │decision│ decides, signs a │
82
+ │ │◄────────│ src/facts/ │◄──────►│ receipt │
83
+ └──────────────────────┘ verdict └───────┬───────┘ └────────────────────┘
84
+ MsgEvaluateClaim │
85
+ │ claim bodies + attachments
86
+ ▼
87
+ ┌───────────────────────┐
88
+ │ VFS · Matrix bot │
89
+ │ · IPFS · Cellnode │
90
+ └───────────────────────┘
91
+ ```
92
+
93
+ ## Prerequisites
94
+
95
+ | You need | Why |
96
+ | --- | --- |
97
+ | **bun ≥ 1.3** | the package manager and the CLI runtime — `decision-oracle` loads your TypeScript handlers directly |
98
+ | **node ≥ 20** | the build's node-load check, and the plain-node lane your handler tests run in |
99
+ | **A Cloudflare account** + `wrangler login` | the oracle is a Worker with D1, KV, Workflows, a Durable Object and a cron |
100
+ | **An IXO wallet / AuthHub login** | only for the chain-authoring commands (`login`, `delegation`, `oracle init`, `publish-protocol`, `create-deed`, `create-collection`, `submit-claim`) |
101
+ | **A decision engine host** | defaults per `IXO_NETWORK` (see [Configuration](#configuration)); `EVAL_ENGINE_HOSTNAME` overrides it for a local engine or a tunnel |
102
+ | **An AI provider** | only if the rubric you serve declares AI checks (or a `unique` rule with its judge on): the Cloudflare AI Gateway by default (the `ai` binding + `AI_GATEWAY_ID`, paid from your Cloudflare credits), or an OpenRouter key with `AI_PROVIDER=openrouter` |
103
+
104
+ > **Not on npm yet.** `@ixo/decision-oracle` is `v0.1.0` and unpublished, so `bunx @ixo/decision-oracle …`
105
+ > does not resolve. Until it ships, work from a clone:
106
+ >
107
+ > ```bash
108
+ > git clone <this repo> && cd eval-oracle && bun install
109
+ > bun packages/eval-oracle/src/cli/index.ts init ../my-oracle
110
+ > ```
111
+ >
112
+ > Then point the new project's one dependency at the workspace — `"@ixo/decision-oracle":
113
+ > "file:<path to>/eval-oracle/packages/eval-oracle"` in its `package.json` — or, to test what npm
114
+ > would actually ship, build a tarball (`cd packages/eval-oracle && bun run build && bun pm pack`)
115
+ > and depend on `"file:<path to>/ixo-decision-oracle-0.1.0.tgz"`. Inside the generated project, run the
116
+ > CLI the same way: `bun <path to>/eval-oracle/packages/eval-oracle/src/cli/index.ts <command>`.
117
+ > Everything below is written as `bunx decision-oracle …`, which is what it becomes once published.
118
+
119
+ ## Quick start
120
+
121
+ Zero to a hired oracle. One command per step.
122
+
123
+ ```bash
124
+ # 1. the project — three source files, the skills, wrangler.jsonc
125
+ bunx @ixo/decision-oracle init my-oracle && cd my-oracle && bun install
126
+
127
+ # 2. binding types from your wrangler.jsonc (re-run after ANY binding/var change)
128
+ bun run cf-typegen && cp .dev.vars.example .dev.vars
129
+
130
+ # 3. storage — the worker and `bun run dev` need a local D1 with the migrations applied
131
+ wrangler d1 create my-oracle # paste the id into wrangler.jsonc
132
+ wrangler kv namespace create CACHE_KV # …and this one
133
+ bun run db:migrate
134
+
135
+ # 4. identities — run this TWICE (see the note below)
136
+ bunx decision-oracle derive --new
137
+
138
+ # 5. what the protocol's rubric asks your oracle to produce
139
+ bunx decision-oracle protocol review <protocol did>
140
+
141
+ # 6. a stub handler + a test for every name stock cannot answer
142
+ bunx decision-oracle facts scaffold <protocol did>
143
+
144
+ # …write the handlers in src/facts/ …
145
+
146
+ # 7. plain vitest — the real runner, fake tools, no Worker, no network
147
+ bun run test
148
+
149
+ # 8. the same handlers over a claim of your own, with REAL tools
150
+ bunx decision-oracle facts run --protocol <protocol did> --claim claim.json
151
+
152
+ # 9. run the oracle locally (local D1; the cron is fireable by hand) — leave it running
153
+ bun run dev
154
+
155
+ # 10. …and now ask the engine what your facts would decide — nothing billed, nothing recorded
156
+ bunx decision-oracle facts run --protocol <protocol did> --claim claim.json --preview
157
+
158
+ # 11. the owner's billing delegation to the engine (a 402 means: buy credits, then retry)
159
+ bunx decision-oracle login
160
+ bunx decision-oracle delegation --for engine --audience did:web:<engine host> \
161
+ --oracle did:web:<ORACLE_HOSTNAME> --out owner-delegation.car --yes
162
+
163
+ # 12. provision the oracle on chain: it funds the wallet, writes the IID document and the Ed25519
164
+ # key, creates the Matrix account (the token is written into .dev.vars, never printed), then
165
+ # the entity (its DID pinned into .dev.vars as ORACLE_ENTITY_DID) with #orz, #pro, the #dmn
166
+ # domain card and the #acard Agent Card, the protocol edges, #eval and the domain indexer.
167
+ # Dry run first — read the plan — then the same line with --yes
168
+ bunx decision-oracle oracle init --protocol <protocol did> --kit-url http://localhost:8787
169
+ bunx decision-oracle oracle init --protocol <protocol did> --kit-url http://localhost:8787 --yes
170
+
171
+ # 13. migrate the deployed D1 BEFORE the first deploy, then ship
172
+ bun run db:migrate:remote && bun run deploy
173
+
174
+ # 14. give the deployed worker the token oracle init wrote, and re-run it with the real host —
175
+ # the host move re-anchors exactly three things: `service` re-points #eval, and `domain` /
176
+ # `acard` replace the two cards (they name the host), merged onto the live ones. `profile`
177
+ # fills in #pro only if step 12 had to skip it (no /v1/info then). `fund` is a floor check, so
178
+ # it tops the wallet back up to 1 IXO if step 12's own txs spent it below; the rest say `skip`
179
+ wrangler secret put ORACLE_MATRIX_ACCESS_TOKEN
180
+ bunx decision-oracle oracle init --protocol <protocol did> --kit-url https://<your host> --yes
181
+
182
+ # 15. get hired: a commissioner's Grant Role + register — or hire yourself
183
+ bunx decision-oracle create-deed --protocol <protocol did> --title "<name>" --yes
184
+ bunx decision-oracle create-collection --entity <deed did> --protocol <protocol did> \
185
+ --eval-amount <uixo> --evaluate <your ORACLE_ADDRESS> --yes
186
+ bunx decision-oracle register --collection <collection id>
187
+ ```
188
+
189
+ A few things that are easy to get wrong:
190
+
191
+ - **Step 4 runs `derive` twice.** Run one: take the mnemonic line and paste it into `.dev.vars`
192
+ **relabelled** as `SERVICE_ED25519_MNEMONIC=` — `derive` always prints it as
193
+ `ORACLE_SECP_MNEMONIC=`, so a verbatim paste silently sets the wrong key. Ignore that run's other
194
+ lines. Run two: the mnemonic IS `ORACLE_SECP_MNEMONIC` (the chain wallet), and the same run's
195
+ `ORACLE_ADDRESS` / `ORACLE_DID` / `ORACLE_MATRIX_USER_ID` are **public vars** → `wrangler.jsonc`.
196
+ - **Step 8's `claim.json`** is the answers a real submitter would give, under the same question
197
+ names the rubric reads:
198
+ ```json
199
+ { "reference": "ABC-123", "deliveredAt": "2026-09-08", "recipient": "A. Nakamura" }
200
+ ```
201
+ `--claim` also takes the full envelope `{ "answers": {…}, "attachments": [{ "question": …,
202
+ "name": …, "mediaType": …, "path": … }] }` when the claim carries files; an attachment `path` is
203
+ relative to the claim file.
204
+ - **`--preview` needs step 9 running.** The engine resolves your `did:web` by fetching
205
+ `/.well-known/did.json` from your oracle, which `bun run dev` is what serves locally.
206
+ - **Step 11's 402 is the owner's credits, not a bug.** The engine bills the oracle OWNER's IXO
207
+ subscription per decision. Open the portal URL the error prints, buy credits, register again. Put
208
+ the CAR in `.dev.vars` as `OWNER_DELEGATION_CAR` (never print it — it is a bearer credential) and
209
+ **restart `wrangler dev`**: a running one reloads source, not secrets.
210
+ - **Step 12 wants step 9 still running.** The `#pro` profile is built from your oracle's own
211
+ `GET /v1/info`, so with nothing listening at `--kit-url` that one step prints
212
+ `profile skip … not reachable` — a skip, never a failure, and step 14's re-run fills it in.
213
+ - **`oracle init` prints an entity DID** — put it in `ORACLE_ENTITY_DID` (a `wrangler.jsonc` var)
214
+ and redeploy, or reviews can only be answered from the portal's claim page, never from a Matrix
215
+ card.
216
+
217
+ ## Writing fact handlers
218
+
219
+ A rubric declares named facts — `ext.<name>` for an external source, `ai.<name>` for an AI check —
220
+ and the engine publishes that list as a **manifest**: the work order. Every declared name already
221
+ has a **stock** lane (an external source becomes a UCAN-signed POST to the endpoint the rubric
222
+ declares; an AI check runs the configured AI provider with the rubric's own instructions). You write a handler only
223
+ for the names stock cannot answer — anything that needs YOUR system, your vendor, or a value the
224
+ rubric derives. **A handler table is always a diff against stock, never a replacement of it.**
225
+
226
+ ```ts
227
+ import { defineFacts, fact } from "@ixo/decision-oracle/facts";
228
+
229
+ export const facts = defineFacts({
230
+ ext: {
231
+ // input: { name, expected, send, unresolved, claim, answers, ctx, settings, manifest }
232
+ // `send` is the rubric's own declared send map, already resolved over the claim's answers
233
+ // and the frozen ctx; `answers` is the whole claim body if you need more than it names.
234
+ deliveryConfirmed: async ({ send }, tools) => {
235
+ const res = await tools.http.json<{ status?: string }>(
236
+ `https://courier.example/deliveries/${send.reference}`,
237
+ );
238
+ if (!res.ok) return fact.error(`courier responded ${res.status}`);
239
+ return res.body?.status === "delivered"; // boolean | number ⇒ an `ok` fact
240
+ },
241
+ },
242
+ ai: {
243
+ // "*" answers every AI check you did not name by name
244
+ "*": async (_input, tools) => tools.stock(),
245
+ },
246
+ });
247
+ ```
248
+
249
+ ### What a handler is handed
250
+
251
+ | Field | What it is |
252
+ | --- | --- |
253
+ | `name` | the `<name>` in `ext.<name>` / `ai.<name>` — the work-order key this handler answers |
254
+ | `expected` / `check` | the manifest entry for that name: `boolean` or `score`, its `send` map, its `onError` |
255
+ | `send` | the rubric's declared `send` map, already resolved over the claim's answers and ctx |
256
+ | `unresolved` | the `~derived` refs only the engine computes — reported, never guessed |
257
+ | `claim` / `answers` | the pulled claim, and `claim.body` (the whole credentialSubject) verbatim |
258
+ | `ctx` | the build's ONE clock read and the collection window — never read the clock yourself |
259
+ | `settings` | this build's ai/image policy, from `defineOracle`'s `policies` |
260
+ | `manifest` | the whole work order — `fields`, `derived`, `ctx`, `usedBy` — as context |
261
+ | `inputs` (ai only) | the `send` map as typed, ordered model inputs: attachments on the lane, scalars as text |
262
+
263
+ ### The tools
264
+
265
+ `tools` is the package's own machinery, built per fact, so a handler is a few lines instead of a
266
+ connector:
267
+
268
+ | Tool | For |
269
+ | --- | --- |
270
+ | `tools.stock()` | the stock lane for **this very fact** — wrap it, fall back to it, or ignore it |
271
+ | `tools.http.json(url, init?)` | a JSON request with the stock retry budget, a timeout, the SSRF guard and a recorded transcript — never throws for an HTTP outcome |
272
+ | `tools.http.json(url, { ucan })` | the call signed as this oracle for the URL's own host — for a source that authenticates you. Capability `ixo:external-source` unless you set your own in code (the rubric's `capability` is ignored; an `ixo:` service capability is refused) |
273
+ | `tools.http.ucanHeaders(audience, capability?)` | the same token as headers (back-compat; the audience must be the host you call) |
274
+ | `tools.ai.judge(instructions, inputs, opts?)` | the stock judge with YOUR rules |
275
+ | `tools.ai.inputsFor(check)` | re-slice a manifest check's declared inputs for that judge |
276
+ | `tools.attachments.on(question)` | the claim's file descriptors for one question |
277
+ | `tools.attachments.bytes(att, opts?)` | fetch one attachment's bytes, on demand |
278
+ | `tools.attachments.size(att)` | an attachment's byte size without downloading it |
279
+ | `tools.c2pa.screen(bytes, mediaType?)` | Content Credentials (provenance) on an image |
280
+ | `tools.chain.linkedResources(entityDid)` | what an entity anchors on chain (`#vct`, `#rub`, a card), each with its `proof` hash |
281
+ | `tools.chain.claimIntent({ agentAddress, collectionId, before, after? })` | the newest `MsgClaimIntent` this agent filed on this collection before `before`, **bare or authz-wrapped** (an agent filing as an authz grantee — the portal's lane and the boilerplate chain client's — has its intent nested inside a `MsgExec`) — a delivery clock and the tx hash to cite for it, or `null`. One server-side filtered query, never a scan. Pass the agreement's consent time as `after` so an earlier engagement's intent can never become the clock |
282
+ | `tools.chain.query()` | the chain RPC query client — loaded lazily, memoised per isolate |
283
+ | `tools.agreement(counterparty?)` | the engine's buyer statement for this collection — read it LAST, right before returning the fact it feeds. `null` is a real "no agreement on file"; a transient engine failure throws instead of returning anything, so don't wrap the call in your own `try/catch` |
284
+ | `tools.logger` | the request logger |
285
+ | `tools.config` | the validated config |
286
+ | `tools.env` | your own bindings and secrets |
287
+
288
+ Two pure readers come with the API: `readAnswer(answers, "$q.row.col")` picks a value out of a claim
289
+ body the way the engine's binder does, and `rootQuestionName("$deliveryPhoto")` gives the root
290
+ question an attachment is keyed by.
291
+
292
+ ### What a handler may return
293
+
294
+ | Return | Becomes |
295
+ | --- | --- |
296
+ | `true` / `false`, or an integer 0–10000 for a `score` fact | an `ok` fact, frozen by the runner |
297
+ | `fact.ok(value, { reason, confidence, transcript })` | an `ok` fact with full control |
298
+ | `fact.ai.ok(value, { reason, failedRules, score, transcript })` | the AI-check equivalent |
299
+ | `fact.error(detail)` | an `error` fact stamped with the **rubric's own** `onError` |
300
+ | anything thrown | the same `error` fact, logged — UNLESS it's transient (next row) |
301
+ | a retryable engine/chain failure (5xx, `UNAVAILABLE`, `RATE_LIMITED`, an outage) | not a fact at all: it propagates like `retryLater` below, so the step retries |
302
+ | `throw fact.retryLater(detail)` | the transient signal: the workflow step retries, every fact already answered is kept |
303
+
304
+ Three rules the runner enforces, not you:
305
+
306
+ - **The manifest's `onError` always wins.** A handler can never turn a failure into an approval,
307
+ and can never pick a different `onError`. Returning `false` says "I checked, and it is false".
308
+ - **Unlisted names run the stock lane.** Your table is a diff.
309
+ - **`"*"` under `ai`** catches every check you did not name; a named handler still wins.
310
+ - **`groups: [group(["quality", "price"], handler)]`** answers several declared sources from ONE
311
+ call — four criteria out of one model call, not four completions. The handler returns one fact per
312
+ name; a name it leaves out becomes that name's own error.
313
+
314
+ `unique` (duplicate detection) and `frequency` (submission rate) are handlers too, and stock covers
315
+ both: the duplicate lane runs over this oracle's own D1 registries, the frequency lane over a
316
+ single Blocksync count. Override either only if you have a better registry.
317
+
318
+ A deterministic failure is a fact; a transient one is a retry. `tools.agreement()` and
319
+ `tools.chain.*` already follow this rule — don't wrap either in your own `try/catch` and turn a
320
+ transient engine/chain failure into `fact.error(...)`: a claim is decided once, so freezing trouble
321
+ that was never the claim's fault holds it for a review it can never get replayed.
322
+
323
+ ### Test them without a Worker
324
+
325
+ `@ixo/decision-oracle/testing` runs the SAME runner production uses, minus the fact cache and D1, then
326
+ the same validator the workflow runs before it freezes a FactSet. Plain vitest, node environment:
327
+
328
+ ```ts
329
+ import { fakeTools, httpResponse, runFacts, sampleClaim, sampleManifest } from "@ixo/decision-oracle/testing";
330
+ import { describe, expect, it } from "vitest";
331
+ import { facts } from "../src/facts";
332
+
333
+ describe("deliveryConfirmed", () => {
334
+ it("is ok when the courier says delivered", async () => {
335
+ const out = await runFacts(facts, {
336
+ claim: sampleClaim({ reference: "ABC" }),
337
+ manifest: sampleManifest({
338
+ ext: { deliveryConfirmed: { expect: "boolean", send: { reference: "$reference" } } },
339
+ }),
340
+ tools: fakeTools({
341
+ http: { "https://courier.example/deliveries/ABC": { status: "delivered" } },
342
+ }),
343
+ });
344
+ expect(out.issues).toEqual([]);
345
+ expect(out.ext.deliveryConfirmed).toMatchObject({ status: "ok", value: true });
346
+ });
347
+
348
+ it("is an error, not a false, when the courier is down", async () => {
349
+ const out = await runFacts(facts, {
350
+ claim: sampleClaim({ reference: "ABC" }),
351
+ manifest: sampleManifest({
352
+ ext: { deliveryConfirmed: { expect: "boolean", send: { reference: "$reference" } } },
353
+ }),
354
+ tools: fakeTools({ http: { "https://courier.example/deliveries/ABC": httpResponse(503, {}) } }),
355
+ });
356
+ expect(out.ext.deliveryConfirmed).toMatchObject({ status: "error" });
357
+ });
358
+ });
359
+ ```
360
+
361
+ `fakeTools`, `httpResponse`, `sampleClaim`, `sampleManifest`, `sampleCtx` and `runFacts` are the
362
+ whole surface. `out.issues` is empty iff the engine would accept this FactSet. Two traps:
363
+
364
+ - **`fakeTools().ai.judge` answers `true` unless you override it.** An AI handler that only
365
+ forwards to the judge therefore passes vacuously in a test that never configures a verdict —
366
+ assert the judge's *input*, or configure `ai: { judge: … }`, or the test proves nothing.
367
+ - **`tools.stock()` is an error fact by default** — the stock lane is not available off-Worker.
368
+ Pass `stock` in `fakeTools({ … })` (or `runFacts`'s `stock` option) when the handler under test
369
+ wraps it.
370
+
371
+ Full reference: [`packages/eval-oracle/docs/api.md`](https://github.com/ixoworld/eval-oralce/blob/main/packages/eval-oracle/docs/api.md).
372
+
373
+ ## CLI reference
374
+
375
+ The CLI runs on **bun** — it loads your TypeScript handlers directly. Run `bunx decision-oracle --help`
376
+ for the same list at the terminal.
377
+
378
+ **Global flags**
379
+
380
+ | Flag | Applies to | Meaning |
381
+ | --- | --- | --- |
382
+ | `--network devnet\|testnet\|mainnet` | every network-facing command | selects the engine, Blocksync, Matrix, the UCAN Store, the RPC, the portal and AuthHub in one go. **Default `devnet`** — testnet and mainnet are always explicit |
383
+ | `--engine-url <url>` | every engine-facing command | talk to this engine instead of the network's (or `EVAL_ENGINE_HOSTNAME`'s) |
384
+ | `--env-file <path>` | every config-reading command | the secrets file to read. **Default `.dev.vars`** in the current directory |
385
+
386
+ Chain-writing commands need a `login` first and sign nothing without `--yes` — without it they
387
+ print the exact plan and stop. Three of them are resumable via `--phase` (`publish-protocol`,
388
+ `create-deed`, `create-collection`); `oracle init` has no phases — every one of its thirteen steps
389
+ re-decides itself against live state, so re-running it is always safe.
390
+
391
+ ### Project
392
+
393
+ | Command | What it does | When you use it |
394
+ | --- | --- | --- |
395
+ | `init <dir> [--name <project-name>]` | scaffolds a project from the package's template plus the shipped skills (it never installs for you) | once, at the very start |
396
+ | `skills sync [--dir <path>]` | refreshes `.claude/skills/` from the installed package, leaving your own skills alone | after upgrading `@ixo/decision-oracle` |
397
+
398
+ ### Identity and billing
399
+
400
+ | Command | What it does | When you use it |
401
+ | --- | --- | --- |
402
+ | `derive ("<mnemonic>" \| --new) [--homeserver <host>]` | derives a chain wallet and prints the `ORACLE_SECP_MNEMONIC` / `ORACLE_ADDRESS` / `ORACLE_DID` / `ORACLE_MATRIX_USER_ID` lines | setting up the oracle's two keys (run it twice — see Quick start) |
403
+ | `login` | AuthHub browser sign-in; the session is saved and reused | once per network, before any chain-authoring command |
404
+ | `logout [--network <n>]` | deletes that network's saved session file (`~/.ixo/publish-session-<network>.json`) and prints `{ removed, path }` — never its contents; `removed: false` when there was none | handing the machine back, or switching accounts |
405
+ | `delegation --audience <did> --out <file> [--for engine\|bot] [--oracle <did:web>] [--days <n>] [--yes]` | mints a UCAN delegation CAR. `--for engine` (needs `--oracle`, defaults to 100 years — nothing renews it) is the owner's billing delegation; `--for bot` (the default, 30 days) lets the oracle pull claim bodies from Matrix | before register — the engine one once as the owner, the bot one per collection |
406
+
407
+ ### Your oracle
408
+
409
+ | Command | What it does | When you use it |
410
+ | --- | --- | --- |
411
+ | `protocol review <protocol did> [--json]` | the rubric's work order in plain words: per name, whether stock covers it or you need a handler | first thing, for any protocol you might serve |
412
+ | `facts scaffold <protocol did> [--all] [--dir <path>]` | writes a stub handler and a test per name that needs one (`--all` for every declared name); nothing existing is overwritten | right after `protocol review` |
413
+ | `facts run --protocol <did> --claim <file> [--collection <id>] [--agent <address>] [--facts <file>] [--preview] [--no-ai] [--json] [--env <name>]` | runs your handlers over a claim file with REAL tools and prints the facts plus any validation issue; `--preview` asks the engine for the decision they would produce — nothing persisted, nothing billed, no grant needed | the first real end-to-end proof, and every time a handler changes |
414
+ | `manifest <protocol did> [--rubric <pin>] [--json]` | a one-line summary of a protocol's manifest (`--rubric` reads an exact historical pin) | a quick "is this rubric usable yet?" |
415
+ | `engine register [--env <name>] [--env-file <path>] [--network <n>] [--engine-url <url>] [--yes] [--json]` | registers this oracle with the decision engine now — the same ADR-36 proof and owner delegation the Worker sends lazily at its first decide, minted as the `--env` block's did:web (so it runs after that env's deploy) — then prints its billing status. A did:web the engine already binds to a DIFFERENT address is refused without `--yes` (old → new printed: an identity change) | right after the first deploy: registering makes the oracle payable at once at the engine's Standard plan terms — nothing else to do (IXO staff move IXO's own oracles to the IXO-owned plan) |
416
+ | `register --collection <id> [--delegation <car>] [--contact-email <addr>] [--kit <url>]` | enrolls a collection with your oracle, as its owner — runs the four gates below | when you are hired (or hire yourself) |
417
+ | `scan --collection <id> [--kit <url>]` | makes the oracle discover and start claims now instead of at the next cron tick | testing, or catching up after a pause |
418
+ | `relink [--collection <id>]… [--kit <url>]` | as an operator (your DID in `ORACLE_ADMIN_DIDS`), links watched collections — every one, or those named — to the `active` Decision API sources of their company, exactly as `register` now does (`POST /v1/admin/collections/relink`); prints each collection's outcome. Idempotent | once, for collections registered before register linked them |
419
+ | `erase (<claimId>… \| --collection <id>) [--kit <url>] [--yes]` | as the collection's current chain owner, erases claims' transcripts and registry text (`DELETE /v1/claims/:claimId/body` per claim; `--collection` = every claim this oracle has seen, skipping and listing those still being decided; a `429` waits its `Retry-After`). Dry run without `--yes` | when the organisation deletes its data — the oracle never does it on its own |
420
+ | `oracle init --protocol <did> --kit-url <url> [--logo <url>] [--openhands [--price-pay <n>]] [--only <step>] [--relogin] [--yes]` | provisions the whole oracle in thirteen idempotent steps — `fund` tops the wallet up to 1 IXO for gas, `iid` its IID document, `key` the Ed25519 verification method, `matrix` its bot account (the access token is written into `.dev.vars`), `entity`, `orz`, `profile`, `domain` (the `#dmn` domain card), `acard` (the `#acard` Agent Card), `linked`, `service` (the `#eval` endpoint, re-pointed when it moved), `backlink`, `index` — `--logo` is optional but recommended (without it the portal and the console show a placeholder); `--openhands` adds `check-openhands` (the OpenHands app's checker marker), priced in PAY from `/v1/info`'s `pricing.api` (else `--price-pay <n>`, 1 PAY = 1 USD); each deciding `do` or `skip` against live state, so a re-run is always safe. Dry run without `--yes`; `--only <step>` runs exactly one, `--relogin` forces a fresh Matrix token. Only `iid`, `key` and `matrix` need the oracle's own `ORACLE_SECP_MNEMONIC` / `SERVICE_ED25519_MNEMONIC` (a step that does names the missing one); every other step runs on the AuthHub session alone, so a deployed oracle whose keys are only worker secrets can still `--only orz|profile|domain|acard` ([what each step does](#declaring-yourself-on-chain)) | once per network, and again after a deploy that changes your host |
421
+
422
+ `facts run --claim` takes a flat answers object or the `{ answers, attachments }` envelope. What is
423
+ real in that run: the manifest, the runner and its rules, HTTP, UCAN headers and `tools.ai.judge`
424
+ — that last one spends real model money, so `--no-ai` turns the ai and image lanes off for the
425
+ run. What is not real: the `unique` lane (it needs the deployed oracle's D1, so it stands in as
426
+ `review`), C2PA provenance (its WASM needs a Worker), and the collection window unless you pass
427
+ `--collection`.
428
+
429
+ ### Organisations
430
+
431
+ A Decision API source belongs to an organisation: an on-chain entity your login controls. These
432
+ sign as your `login` too (`org create` and `org fund` are chain writes, so a dry run without `--yes`).
433
+
434
+ | Command | What it does | When you use it |
435
+ | --- | --- | --- |
436
+ | `org create --name <name> [--logo <https url>] [--network <n>] [--yes]` | creates an organisation the way the Decision Console does: its profile (`#pro`: name, logo) stored on the IXO Vault under your login's key (else the IXO IPFS gateway), then one `MsgCreateEntity` of type `dao` your login controls and owns. Idempotent by name — when your login already controls a `dao` whose profile has that name (the console's org list: owned or co-controlled), it prints that one and signs nothing. Waits for Blocksync to index a new one. Stdout is `{ entityDid, created }` (the plan and progress go to stderr) | before `api source create`, when the organisation has no entity yet |
437
+ | `org balance --entity <did:ixo:entity:…> [--network <n>]` | the organisation entity's `admin` account (Blocksync) and every denom it holds (the chain's bank API), amounts as base-unit strings: `{ adminAddress, balances: [{ denom, amount }] }` | checking what the organisation's account holds |
438
+ | `org fund --entity <did:ixo:entity:…> --amount <n> [--coin ixo\|usdc] [--network <n>] [--yes] [--json]` | tops up that same `admin` account from your login's wallet: one `MsgSend` of `--amount` whole coins (`ixo`, the default, or Noble USDC with `--coin usdc` — mainnet only), memo `Openhands company top-up`. Your login must own or control the organisation, and the wallet must hold the amount plus the ~0.02 IXO fee, else it refuses before signing. Without `--yes` a dry run (the plan on stderr, stdout empty); with it, prints the account's new balance and the tx hash — `--json`: `{ adminAddress, sent, balance, tx }` | when the organisation's account runs low (it pays for its evaluations) |
439
+
440
+ ### The Decision API (with `API_LANE` on)
441
+
442
+ Console calls to your own oracle's `/v1/api`, signed as your `login` (a 120-second UCAN over
443
+ `ixo:oracle/<your did:web>`, or `…/source/<id>` with `X-Source-Id` on a source's routes). The
444
+ oracle is `--kit <url>`, else your `.dev.vars` `ORACLE_HOSTNAME` (a project whose config does not
445
+ load says which var is wrong). On a source's routes your login must be a current controller (admin)
446
+ of the source's organisation — its on-chain entity — which makes it root with no membership; `api
447
+ admin …` needs your DID in the oracle's `ORACLE_ADMIN_DIDS`. Every one takes `--network` (else the project's
448
+ `IXO_NETWORK`, else devnet), `--env-file` and `--json` (the API's answer as is, alone on stdout —
449
+ a plan goes to stderr); a refusal prints the error envelope's `code`, `message` and `requestId`
450
+ and exits 1. Every write carries a fresh `Idempotency-Key`. `decision-oracle api --help` lists them.
451
+
452
+ | Command | What it does | When you use it |
453
+ | --- | --- | --- |
454
+ | `api source create --name <n> --contact <email> --entity <did:ixo:entity:…>` | adds this oracle to an organisation your login controls; prints the source's id and its webhook signing secret — **shown once**. It stays `pending-link` (no claims, no keys) until the organisation's link is signed (`api source link`, or the Decision Console) | adding your own organisation |
455
+ | `api source link <sourceId> [--engine-url <url>] [--yes]` | finishes a `pending-link` source as the console's "Add oracle" does: signs the organisation's `SourceCompanyLink` as your login, PUTs it to the decision engine (`company/link` on `ixo:eval-engine`), then calls the oracle's company sync and prints the source — `active`, or `disputed` when the engine holds another organisation's link. An already-linked source is printed and left alone | right after `api source create` |
456
+ | `api source delete <sourceId> [--yes]` | removes this oracle from the organisation: the source and every row off it (members, keys, webhooks, claims and their decisions, audit). The plan names the source, its status and its organisation (read from `GET /v1/api/me`); `--yes` sends `DELETE /v1/api/sources/:sourceId` (`sources/delete`) as your login — a current controller of the organisation, no proof — and prints `{ "deleted": true, "sourceId" }`. Nothing on chain or at the engine changes | a source linked to the wrong organisation, or `disputed` — delete it and add the oracle again |
457
+ | `api sources [--entity <did:ixo:entity:…>]` | the sources your login belongs to, with your role on each; with `--entity`, every source of an organisation your login controls, `pending-link` ones included (a controller is a member of none) | finding a source id; finding a pending source before adding another |
458
+ | `api key create --source <id> --scopes <scope,…> [--name <n>] [--max-spend-cents <n>]` | mints an API key (`claims:write`, `claims:read`, `webhooks:manage`; `--max-spend-cents` caps its spend per day) — the key is **shown once**, the oracle keeps its hash | giving a partner's backend its credential |
459
+ | `api keys --source <id>` | the source's keys, masked, with their scopes and last use | auditing, or before a rotation |
460
+ | `api key revoke --source <id> <prefix> [--grace-days <n>] [--yes]` | revokes a key (by its 8-char prefix, or the masked `eo_test_<prefix>_…` a listing prints — only the prefix is sent) at once, or after `--grace-days` (≤ 30) so a rotation can overlap | a leaked key, or the old half of a rotation |
461
+ | `api admin sources` | every source on the oracle (operator) | the operator view |
462
+ | `api admin pause <sourceId> [--note <text>] [--yes]` / `api admin resume <sourceId> [--yes]` | pauses or resumes a source's submits (operator) | a partner in breach, or back in good standing |
463
+ | `api admin protocols <sourceId> <did,…>\|--none [--yes]` | replaces the source's allowed protocols whole; `--none` allows nothing (operator) | enabling or narrowing what a source may submit |
464
+ | `api admin billing-mode <sourceId> x402\|none [--yes]` | sets how the source pays — `none` for a partner who should not (operator only, by design) | a commercial term changes |
465
+ | `api review-billing enable --source <id> [--cap <PAY>] [--yes]` | the Decision Console's "Pay for reviews": refused unless the oracle's `/v1/info` says `reviewBilling.mode: "x402"` (IXO's plan), the source is billed and your login is the organisation's owner on chain (Blocksync, the source's `companyEntityDid` from `GET /v1/api/me`). Signs, as your login, an x402-ixo-pay payment delegation — `billing/pay` on `billing:decision-api`, `nb: { maxAmount, denom: "upay", oracles: [<this oracle's did:web>] }`, to the network's facilitator `did:web`, ~100 years — PUTs it on the source (`review-billing/set`), keeps a copy in the UCAN store (so `disable` can revoke it) and prints the stored state. `--cap` is the delegation's LIFETIME total in PAY (default 1000, about 2 000 reviews at 0.5 PAY; 1 PAY = 1 000 000 upay = $1): every review adds to it and nothing refunds it — `enable` again with a higher `--cap` replaces it, from 0 spent | an organisation pays for its chain reviews from its owner's credits |
466
+ | `api review-billing status --source <id>` | the stored delegation (`review-billing/read`): state, payer, cap / spent / remaining in PAY, expiry, credits, price, paused collections, CID — or that there is none | how much is left |
467
+ | `api review-billing disable --source <id> [--yes]` | `DELETE`s it on the source (`review-billing/delete`: this oracle stops charging it, its collections' reviews pause), then revokes it in the UCAN store (`store/revoke`, by CID) when your login signed it and the store holds the copy `enable` left. Otherwise it says the delegation stays valid until it expires — only this oracle could charge it — and that its signer revokes it in the Decision Console | stopping paying for reviews |
468
+
469
+ A source link or delete, a key revoke, every `api admin` change and a `review-billing enable` / `disable` print their plan and stop (exit 0) without `--yes`;
470
+ under `--json` that dry run prints nothing on stdout.
471
+
472
+ Agents reach the same lane through the hosted MCP server at `https://<oracle>/v1/mcp` —
473
+ `claude mcp add --transport http ixo https://<oracle>/v1/mcp --header "Authorization: Bearer eo_live_…"`
474
+ (plus `X-Payment-Delegation` for an `x402` source): `submit_claim`, `get_decision`, `list_protocols`,
475
+ `verify_receipt`, under the key's own scopes and limits (`docs/api.md`, "Use with Claude Code and
476
+ other MCP clients").
477
+
478
+ ### Protocol authoring (the commissioner's side)
479
+
480
+ | Command | What it does | When you use it |
481
+ | --- | --- | --- |
482
+ | `rubric fetch-form --protocol <did> --out <file> [--rub <file>] [--blocksync <url>]` | downloads a protocol's anchored claim form (`#vct`), and its rubric with `--rub` | writing a rubric against a form already on chain |
483
+ | `rubric validate --rubric <file> --form <file> [--proof <value>] [--json]` | validates a rubric against a form through the engine's own binder — the same check `publish-protocol` runs | every rubric edit, before anchoring |
484
+ | `publish-protocol --rubric <file> --form <file> [--entity <did>] [--phase entity\|resources\|room\|all] [--yes]` | anchors a claim form and rubric as a protocol entity on chain | once per protocol; resumable after a half-finished run |
485
+ | `publish-protocol --phase rub --protocol <did> --rubric <file> --form <file> [--yes]` | anchors — or replaces, delete+add in one tx — `#rub` ALONE on a protocol that already carries its `#vct`; a no-op when the same rubric id is already anchored | adopting someone else's protocol, or publishing a new version of your rules |
486
+ | `create-deed --protocol <did> --title "<name>" [--description <text>] [--type <type>] [--entity <did>] [--phase entity\|room\|claims\|all] [--yes]` | creates the deed entity that hosts claims and links it to the protocol | before a collection — a collection's entity is a deed, never the protocol |
487
+ | `create-collection --entity <deed did> --protocol <did> --eval-amount <uixo> [--eval-denom <denom>] [--fund <amount>] [--evaluate <addr,…>] [--submit <addr,…>] [--max-custom-amount <amount><denom>] [--quota <n>] [--days <n>] [--phase collection\|fund\|grants\|all] [--yes]` | creates the claim collection, sets its evaluation payment, funds its admin account and grants the Evaluate/Submit roles (the evaluate grant's `MaxCustomAmount` is written explicitly: `0<eval-denom>` unless you pass more — claims that carry coins need at least the largest claim amount, or approvals fail) | standing up a collection, or hiring your own oracle to prove the loop |
488
+ | `submit-claim --collection <id> --answers <file> [--file <question>=<path> …] [--yes]` | submits a claim as the logged-in wallet: media upload, claim-bot save, the chain message | putting a real claim through your deployed oracle |
489
+
490
+ ## Configuration
491
+
492
+ Two places, and the split is the rule: **public config in `wrangler.jsonc` `vars`, secrets in
493
+ `.dev.vars` locally and `wrangler secret put <NAME>` once deployed.** Nothing secret ever goes in
494
+ `wrangler.jsonc`.
495
+
496
+ ### `wrangler.jsonc` `vars`
497
+
498
+ | Var | What it is |
499
+ | --- | --- |
500
+ | `IXO_NETWORK` | `devnet` / `testnet` / `mainnet` — supplies every per-network URL below |
501
+ | `ORACLE_HOSTNAME` | the host this oracle's `did:web` is served from; **must equal the Custom Domain in `routes`** |
502
+ | `ORACLE_ADDRESS`, `ORACLE_DID` | the public chain identity (asserted against `ORACLE_SECP_MNEMONIC` at first use — a mismatch fails loud) |
503
+ | `ORACLE_MATRIX_USER_ID` | the oracle bot's MXID, `@did-ixo-<address>:<homeserver>` |
504
+ | `ORACLE_ENTITY_DID` | the on-chain oracle ENTITY from `oracle init` — **required for a deployed oracle**: unset on a non-local `ORACLE_HOSTNAME`, `/health/ready` fails its `identity` check (local dev is exempt). Unset, the Matrix review card also falls back to `ORACLE_DID` and reviews work only from the portal page |
505
+ | `AUTO_SIGN` | `"true"` to sign `MsgEvaluateClaim` unattended — the `policies.autoSign` flag must be on too |
506
+ | `AI_CHECK_MODEL` | the pinned model for AI checks (any provider) |
507
+ | `AI_PROVIDER` | `cloudflare` (default — the Cloudflare AI Gateway through the `ai` binding) or `openrouter` (needs `OPENROUTER_API_KEY`) |
508
+ | `AI_GATEWAY_ID` | the AI Gateway the `cloudflare` provider routes through; its per-call USD lands in the `ai_calls` table within ~5 minutes |
509
+ | `AI_AUDIO_VIDEO` | optional, default off: audio/video attachments are sent to the model only when on — **OpenRouter only** (the worker refuses to start otherwise); off, they reach the model as a "content not sent" descriptor |
510
+ | `AI_IMAGE_DETAIL` | optional: `low` / `high` / `auto`, default `high` — the detail images are sent to the model at. `high` is what lets it see a photographed screen or a generated image; it costs more image tokens per check |
511
+ | `C2PA_IMAGE_CHECK` | the image-provenance gate — a verified AI-generated manifest fails an AI check outright |
512
+ | `EVAL_ENGINE_HOSTNAME` | optional override of the network's engine host (a local engine, a tunnel) |
513
+ | `EVALUATION_DENOM`, `EVALUATION_MIN_AMOUNT` | the per-network evaluation fee: when set (both or neither) they replace `pricing.evaluation` at register and on `/v1/info`. **Required on mainnet** (the worker refuses to start without them) — real USDC there; the template sets a `uixo` stand-in on devnet/testnet |
514
+ | `EMAIL_FROM_ADDRESS`, `EMAIL_FROM_NAME` | the From address/name for pause, resume and review notices; unset ⇒ the email lane logs once and skips |
515
+ | `CLAIM_BOT_URL_OVERRIDE` | a claim bot not at the derived host — usually set in `.dev.vars` for local harnesses only |
516
+ | `API_LANE`, `API_PAYMENTS` | the Decision API lane (paid, off-chain claims at `/v1/api`) and its x402 gate — both `"false"` in the template; the lane is dormant until `API_LANE` is on, and with `API_PAYMENTS` off new submits answer `503 payments-disabled` |
517
+ | `API_PRICE_USD_CENTS`, `X402_FACILITATOR_URL`, `X402_NETWORK`, `EARNINGS_ADDRESS`, `EARNINGS_BASE_WALLET`, `BILLING_ENGINE_URL`, `CONSOLE_URL`, `ORACLE_ADMIN_DIDS` | the Decision API lane's fallback price (`pricing.api` wins), payment services, console and the oracle's admins (`ORACLE_ADMIN_DIDS`, your own people) — unset (commented) until the lane is on |
518
+ | `STATUS_READER_DIDS` | DIDs of any method (a monitoring service's `did:web`) allowed to read `GET /v1/admin/status` only — never an operator. Unset ⇒ nobody |
519
+
520
+ Plus the usual `ENVIRONMENT`, `LOG_LEVEL`, `SERVICE_NAME`, `SERVICE_VERSION`, `CORS_ORIGINS` and
521
+ `IXO_CLIENT_SEQUENCE_MIN_DELAY_MS`.
522
+
523
+ ### Secrets
524
+
525
+ | Secret | Why |
526
+ | --- | --- |
527
+ | `SERVICE_ED25519_MNEMONIC` | the did:web key — signs every UCAN invocation this oracle mints and backs its `did.json` |
528
+ | `ORACLE_SECP_MNEMONIC` | the chain wallet that signs `MsgEvaluateClaim`; must be the wallet behind `ORACLE_ADDRESS` |
529
+ | `OWNER_DELEGATION_CAR` | the oracle owner's delegation to the engine, forwarded verbatim at register — the engine bills the OWNER's credits, never this oracle's wallet |
530
+ | `OPENROUTER_API_KEY` | only with `AI_PROVIDER=openrouter`: AI checks and the duplicate lane's same-event judge, when a rubric asks for one |
531
+ | `UNIQUE_HMAC_KEY` | the duplicate lane's body digest and the API lane's submitter digest — **required with `API_LANE`**. One per oracle, **for life** — rotating it orphans every registered digest |
532
+ | `ORACLE_MATRIX_ACCESS_TOKEN` | the oracle bot account's token — **written by `oracle init`** into `.dev.vars` (`wrangler secret put` it for a deployed env). Read by the review-notification lane; unset ⇒ that lane logs and skips |
533
+ | `WEBHOOK_ENCRYPTION_KEY` | the Decision API lane's key for webhook signing secrets at rest (endpoints' and each source's) — one per deployment, for life; required when `API_LANE` is on (the worker refuses to start without it) |
534
+ | `SENTRY_DSN` | optional; unset ⇒ error reporting is a no-op |
535
+ | `OPS_ALERT_WEBHOOK_URL` | optional; a Slack-compatible webhook for ops alerts (a paused collection or source, a dead webhook, a lost settlement, a failing cron job); unset ⇒ alerts reach Sentry only |
536
+
537
+ ### Per-network defaults
538
+
539
+ Set by `IXO_NETWORK` (and by the CLI's `--network`). A normal deployment sets **no URL at all**;
540
+ set one only to override it.
541
+
542
+ | | devnet | testnet | mainnet |
543
+ | --- | --- | --- | --- |
544
+ | Decision engine | `decision-engine.devnet.ixo.earth` | `decision-engine.testnet.ixo.earth` | `decision-engine.ixo.earth` |
545
+ | Blocksync | `devnet-blocksync-graphql.ixo.earth/graphql` | `testnet-blocksync-graphql.ixo.earth/graphql` | `blocksync-graphql.ixo.earth/graphql` |
546
+ | Chain RPC | `devnet.ixo.earth/rpc/` | `testnet.ixo.earth/rpc/` | `impacthub.ixo.world/rpc/` |
547
+ | Matrix | `devmx.ixo.earth` | `testmx.ixo.earth` | `mx.ixo.earth` |
548
+ | UCAN Store | `devnet.store.ucan.ixo.earth` | `testnet.store.ucan.ixo.earth` | `store.ucan.ixo.earth` |
549
+ | VFS | `devnet.vfs.ixo.earth` | `testnet.vfs.ixo.earth` | `vfs.ixo.earth` |
550
+ | IPFS gateway | `ipfs.gateway.ixo.world` | `ipfs.gateway.ixo.world` | `ipfs.gateway.ixo.world` |
551
+ | Portal | `dev.portal.qi.space` | `test.portal.qi.space` | `portal.qi.space` |
552
+ | AuthHub | `dev.auth.ixo.earth` | `test.auth.ixo.earth` | `auth.ixo.earth` |
553
+
554
+ ### `src/index.ts` — what the oracle IS
555
+
556
+ ```ts
557
+ import { defineOracle } from "@ixo/decision-oracle";
558
+ import { facts } from "./facts";
559
+
560
+ const oracle = defineOracle({
561
+ name: "my-oracle",
562
+ description: "Evaluates claims against the collection's rubric via the IXO decision engine.",
563
+ supportedProtocols: [], // protocol entity DIDs; [] ⇒ any
564
+ pricing: { evaluation: { denom: "uixo", minAmount: "1000000" } },
565
+ policies: { autoSign: true, allowAiChecks: true, allowImageChecks: true, allowStandingApprovals: false },
566
+ facts,
567
+ });
568
+
569
+ export default oracle;
570
+ export const { ClaimIngest, ReviewComplete, SequenceManagerDO } = oracle;
571
+ ```
572
+
573
+ `defineOracle` validates the config at module evaluation (a bad price or an empty name throws
574
+ loudly) and hands back every export the Workers runtime needs — the fetch/scheduled handlers, both
575
+ Workflow classes, and the chain sequence keeper.
576
+
577
+ | Setting | Meaning |
578
+ | --- | --- |
579
+ | `supportedProtocols` | protocol entity DIDs this oracle serves; `[]` means any. Enforced at register, and shown on `GET /v1/info` |
580
+ | `pricing.evaluation` | the minimum on-chain evaluation payment a collection must carry, `{ denom, minAmount }` in integer base units — replaced per network by the `EVALUATION_DENOM` / `EVALUATION_MIN_AMOUNT` vars when set (required on mainnet) |
581
+ | `pricing.byProtocol` | optional `{ [protocolDid]: { denom, minAmount } }` override of `pricing.evaluation` per protocol — `minAmount: "0"` lets that protocol's collections register with an EMPTY evaluation leg, for a protocol whose income isn't the evaluation split |
582
+ | `pricing.api` | optional `{ amountMicroUsd, byProtocol? }` — the Decision API lane's price per decision in micro-USD (`1_200_000` = $1.20), per protocol, served publicly at `GET /v1/api/protocols/:did` and checked by the facilitator against every offer. Unset ⇒ the `API_PRICE_USD_CENTS` var; neither ⇒ `price: null`, nothing offered |
583
+ | `policies.autoSign` | sign `MsgEvaluateClaim` unattended on a terminal verdict — the `AUTO_SIGN` var must also be on |
584
+ | `policies.allowAiChecks` | let the facts lane call a model. Off while the work order declares AI checks ⇒ every `ai` fact freezes `error` and the rubric's `onError` decides |
585
+ | `policies.allowImageChecks` | let it screen images (C2PA provenance) |
586
+ | `policies.allowStandingApprovals` | let a signed-in AI app's own auto-approve limits pay for a claim without a per-claim approval (hosted MCP); off, AuthHub cannot set one here (`403 standing_approvals_off`) and every submit is approved per claim |
587
+
588
+ Keep `supportedProtocols` in lockstep with the `linkedEntity` set `oracle init` writes on chain —
589
+ register enforces only the config side, so a drift between the two is invisible to both.
590
+
591
+ ## Deploy and get hired
592
+
593
+ ```bash
594
+ wrangler d1 create my-oracle # paste the id into wrangler.jsonc (once per env)
595
+ wrangler kv namespace create CACHE_KV # …and this one
596
+ bun run db:migrate # the package's migrations → your LOCAL D1
597
+ bun run db:migrate:remote # …and to the deployed one, BEFORE the first deploy
598
+ bun run deploy # or deploy:testnet / deploy:production
599
+ ```
600
+
601
+ The bindings the template declares: **D1** (`DB` — the ledgers), **KV** (`CACHE_KV` — caches only),
602
+ two **Workflows** (`CLAIM_WORKFLOW`, `REVIEW_WORKFLOW`), a **Durable Object** (`SEQUENCE_MANAGER`,
603
+ the chain sequence keeper), two **rate limiters** (`API_RATE_LIMITER` per IP, `API_KEY_RATE_LIMITER`
604
+ per API key for the Decision API lane), **email** (`EMAIL`), and three **cron** triggers (every minute, every five minutes, hourly — keep all three) — plus an
605
+ optional **R2** bucket (`API_UPLOADS`, commented out: absent ⇒ the upload route answers 501), and an optional answer archive (`ANSWERS_ARCHIVE`, commented out: bound ⇒ every evaluated ask, answer and photo is kept in that private bucket, one `<askId>-<title>/` folder per ask, shaped by `defineOracle`'s `archive` hooks — [guide §12](https://github.com/ixoworld/eval-oralce/blob/main/packages/eval-oracle/docs/guide.md#12-operating-it)). Every binding and the whole `vars` block are redeclared per env — they inherit
606
+ nothing from the top level.
607
+
608
+ `db:migrate:remote` applies the migrations that ship **inside the package** (`migrations_dir`
609
+ points at `node_modules/@ixo/decision-oracle/migrations`, so you never write or generate one). It is a
610
+ per-environment step: for a named env, run `wrangler d1 migrations apply <name>-testnet --remote
611
+ --env testnet`, likewise `--env production`. A Worker deployed against an unmigrated D1 fails on
612
+ its first claim.
613
+
614
+ **The Custom Domain in `routes` must equal `ORACLE_HOSTNAME`** for the env you deploy: callers
615
+ verify you by fetching `https://<ORACLE_HOSTNAME>/.well-known/did.json`, and the engine binds its
616
+ records to that did:web.
617
+
618
+ ### Declaring yourself on chain
619
+
620
+ `GET /v1/info` only answers someone who already knows your host. Discovery that starts from the
621
+ protocol — and a claim body you can actually pull — needs the oracle to exist on chain:
622
+
623
+ ```bash
624
+ bunx decision-oracle oracle init --protocol <protocol did> --kit-url https://<your host> \
625
+ [--logo <url>] [--only <step>] [--relogin] [--network <n>] [--yes]
626
+ ```
627
+
628
+ **A full on-chain identity is mandatory** for every oracle built with this kit: the entity, its
629
+ `#pro` profile, its `#dmn` domain card and its `#acard` Agent Card. `--logo <url>` is optional, but
630
+ recommended — without it the domain card has no logo and the portal and the console show a
631
+ placeholder (`oracle init` says so on every run that lacks it).
632
+
633
+ **What `oracle init` does.** Thirteen steps, in order. Each one reads live state and prints `do` or
634
+ `skip` with the reason — so a dry run (no `--yes`) is exactly the plan that `--yes` would execute,
635
+ and re-running after a partial failure, a redeploy or a second provider's attempt converges on the
636
+ same state. **Two signers**: steps 2–4 are the oracle's *own* wallet (only its key may write its own
637
+ IID document or prove its address to the rooms bot); everything else is your AuthHub session, which
638
+ owns the entity it creates.
639
+
640
+ | Step | Signer | What | Skipped when |
641
+ | --- | --- | --- | --- |
642
+ | `fund` | session | `MsgSend` topping `ORACLE_ADDRESS` up to 1 IXO (`1000000uixo`), which pays for every `MsgEvaluateClaim` | the wallet's spendable balance is already ≥ 1 IXO |
643
+ | `iid` | oracle wallet | `MsgCreateIidDocument` for `did:ixo:<ORACLE_ADDRESS>`, with a `#matrix` service pointing at the network's homeserver | that DID already resolves |
644
+ | `key` | oracle wallet | `MsgAddVerification` adding the `SERVICE_ED25519_MNEMONIC` public key (`authentication` + `assertionMethod`) — what makes a UCAN minted as that DID verifiable to the claim bot and the UCAN Store | a verification method for that exact key is already on the document |
645
+ | `matrix` | oracle wallet (it signs the rooms bot's challenge) | creates the oracle's Matrix account if absent, logs in, and writes `ORACLE_MATRIX_ACCESS_TOKEN` into `.dev.vars` — never printed | `.dev.vars` holds a token whose `whoami` is `ORACLE_MATRIX_USER_ID`; `--relogin` forces a new one |
646
+ | `entity` | session | `MsgCreateEntity` — the oracle entity, carrying both services and the protocol edge in one transaction | THIS oracle already has one: `ORACLE_ENTITY_DID` when set — read from `env.<--network>.vars`, else the top-level vars, `.dev.vars` winning — and checked to be an oracle entity the session owns AND bound to this oracle; else the session's oracle entity whose `#orz` grants `ORACLE_ADDRESS`, else whose `#eval` is `--kit-url`. Another oracle's entity is never picked up or written to; two matches, or an `#orz` that cannot be read, stop the run. A created entity's DID is written into `.dev.vars` at once, so a re-run never mints a second |
647
+ | `orz` | session | the `#orz` `oracleAuthZConfig` resource: the portal's entity → `ORACLE_ADDRESS` bridge | `#orz` is on the entity and not on Matrix media (one still there is moved to the Vault, same document) |
648
+ | `profile` | session | the `#pro` `Settings` resource, built from the running oracle's `GET <kit-url>/v1/info` (plus `--logo`) | `#pro` is on the entity — unless `--logo` differs from its logo, which replaces it as a merge (the portal's avatar), or it is still on Matrix media (moved to the Vault, same profile) — **or** the kit URL is not reachable: a skip, never a failure |
649
+ | `domain` | session | the `#dmn` `domainCard` resource — the portal's `ixo:DomainCard` credential (name, description, `url` = `--kit-url`, `logo`/`image` only with `--logo`), hosted like `#pro` and `#acard`: stored on the IXO Vault under your session's key (else the IXO IPFS gateway), its public `…/public/cid/<cid>` URL as `serviceEndpoint`, that `bafkrei…` CID as `proof`; a card whose kit-owned fields drifted is deleted and re-added in ONE transaction, merged onto the live one (your own logo, images, keywords survive; without `--logo` the live logo stays) | every field the kit owns (name, description, `url`, and the logo when `--logo` is given) already matches AND the proof is the CID of the served bytes AND it is not on Matrix media, **or** the kit URL is not reachable, **or** the live card cannot be read (a `⚠`, never a replace) |
650
+ | `acard` | session | the `#acard` `agentCard` resource — an `ixo:AgentCard` credential (services: `claim-evaluation` when the kit publishes evaluation pricing, `decision-api` when its Decision API publishes a price for `--protocol` — each at the oracle's effective price, `byProtocol` and `API_PRICE_USD_CENTS` included; `check-openhands` with `--openhands`; your own services survive a replace), validated against the engine's Agent Card schema before anything is uploaded; replaced like `#dmn` | same as `domain` |
651
+ | `linked` | session | the oracle → protocol `linkedEntity` edge | the edge is already on the entity |
652
+ | `service` | session | `#eval` → `--kit-url`; an existing one pointing somewhere else is deleted and re-added in ONE transaction | `#eval` already equals `--kit-url` |
653
+ | `backlink` | session (must own the protocol) | the protocol's edge back to the oracle, which is what the marketplace filters on | the edge is there, or the session does not own the protocol — it prints the exact edge to ask its owner for |
654
+ | `index` | — | tells the network's domain indexer the entity exists — last, so it reads the `#dmn` just anchored | on `--yes` only (a dry run asks the indexer nothing): its `GET /domain-cards/<did>` serves that `#dmn` (`blockchain_version_id` = the resource's proof) with `status: completed`; a refusal or an unreachable indexer is a `⚠` line, not a failure |
655
+
656
+ Run it once against `http://localhost:8787` while `bun run dev` is up, and again with the deployed
657
+ host afterwards — the second run re-points `#eval`, fills in the `#pro` it had to skip and
658
+ re-anchors both cards (they name the host). **Put the
659
+ entity DID it prints into `ORACLE_ENTITY_DID`** (a `wrangler.jsonc` var) and redeploy: a deployed
660
+ oracle is not ready without it (`/health/ready` fails its `identity` check), and unset, the Matrix
661
+ review card cannot resolve your API and a review can only be answered from the portal's claim page.
662
+
663
+ ### The enrollment gates
664
+
665
+ `POST /v1/collections/register` is refused unless, in order:
666
+
667
+ | Gate | Check | Else |
668
+ | --- | --- | --- |
669
+ | **who** | the caller is the collection entity's chain owner, or holds an active on-chain `EvaluateClaimAuthorization` for it | 403 |
670
+ | **hired** | this oracle's `ORACLE_ADDRESS` holds that grant too — without it `MsgEvaluateClaim` can never be signed | 409 |
671
+ | **protocol** | if `supportedProtocols` is non-empty, the collection's protocol DID must be in it | 409 |
672
+ | **paid** | the collection's on-chain `Payments.evaluation` is in the required denom and ≥ the required `minAmount` — `pricing.byProtocol[collection's protocol]`, else the `EVALUATION_DENOM` / `EVALUATION_MIN_AMOUNT` vars, else `pricing.evaluation` | 402 |
673
+
674
+ The 402 is the business rule: the chain splits *that* payment on every `MsgEvaluateClaim`, so it is
675
+ the oracle's only income — a collection paying less would be evaluated for free. **The one
676
+ exception is a zero fee** (`minAmount: "0"`, typically set per protocol via `pricing.byProtocol`):
677
+ an empty, missing, or wrong-denom evaluation leg is then accepted AS zero rather than refused, for a
678
+ protocol whose income isn't the evaluation split. The protocol gate
679
+ runs before payment, so a wrong-protocol collection is refused outright rather than sent off to fix a
680
+ payment that would never have mattered. Re-registering re-runs the gates and resumes a paused
681
+ collection.
682
+
683
+ ### How a commissioner hires you
684
+
685
+ They grant your `ORACLE_ADDRESS` an `EvaluateClaimAuthorization` on their collection (the IXO
686
+ portal's **Grant Role** flow) and register that collection with your oracle — the portal makes that
687
+ call, and `bunx decision-oracle register --collection <id>` is the same two calls from a terminal.
688
+ Registration also carries the owner→oracle Matrix delegation (`delegation --for bot`, passed as
689
+ `--delegation <car>`): without it your oracle holds the grant but still cannot pull claim bodies
690
+ out of Matrix (a body on the VFS or IPFS needs only the grant).
691
+
692
+ To prove the loop end to end yourself, hire yourself: `create-deed` → `create-collection
693
+ --evaluate <your ORACLE_ADDRESS>` → `register` → `submit-claim`.
694
+
695
+ ### The HTTP API
696
+
697
+ Everything under `/v1` requires a UCAN invocation (`X-Auth-Type: ucan` + Bearer) addressed to
698
+ `did:web:<ORACLE_HOSTNAME>` — that proves identity only. "Read gate" = the collection's current
699
+ chain owner, or any holder of a live evaluate grant on it (the enroller only while it still holds one).
700
+
701
+ | Route | Auth | Purpose |
702
+ | --- | --- | --- |
703
+ | `GET /health` | public | liveness |
704
+ | `GET /health/ready` | public, rate-limited | readiness: `{ ok }`, `503` when D1, KV, the engine (or, with `API_LANE` + `API_PAYMENTS`, the facilitator) is down, or a deployed oracle has no `ORACLE_ENTITY_DID` |
705
+ | `GET /.well-known/did.json` | public | this oracle's did:web document |
706
+ | `GET /v1/info` | public | the marketplace listing: name, pricing, policies, supported protocols, plus this oracle's `did`/`address`/`serviceDid` |
707
+ | `POST /v1/collections/register` | UCAN + the four gates | enroll a collection (`collectionId`, `delegationCar?`, `contactEmail?`) |
708
+ | `GET /v1/collections` | UCAN | the collections the caller owns or enrolled |
709
+ | `POST /v1/collections/:id/pause` \| `/resume` | read gate + owner, enroller (with a live grant) or operator | stop enqueuing, or clear a pause |
710
+ | `POST /v1/collections/:id/scan` | read gate | discover now |
711
+ | `PATCH /v1/collections/:id/settings` | the collection's current chain owner only | `{ operatorAmounts: "off" \| "allowed" }` — whether the act seam's on-chain amount may stand (default `off`: the lane pays its default) |
712
+ | `DELETE /v1/claims/:claimId/body` | the collection's current chain owner only (`claims/erase`) | erase a claim's transcripts and registry text now; the decision, receipt and digests stay. The oracle never deletes claim data on its own |
713
+ | `GET /v1/claims?collectionId=…` | read gate | ingest ⟕ decision summary, newest first, keyset-paginated |
714
+ | `POST /v1/collections/:id/reviewers` | a current controller of the collection's entity | file a `claims/review` grant they signed for a reviewer (`{ delegation }`, ≤ 30 days) |
715
+ | `GET /v1/collections/:id/reviewers` | a controller (every grant) or a reviewer (their own, CAR included) | the collection's reviewer grants |
716
+ | `POST /v1/collections/:id/reviewers/:cid/revoke` | a current controller | end a grant at once (the reviewer leaves the review room) |
717
+ | `GET /v1/claims/:claimId` | read gate, or a live reviewer | the full record (ingest, decision, review, the signed receipt) |
718
+ | `POST /v1/reviews/:claimId` | a reviewer the company granted (never an evaluate grant alone) | `{ answers }` covering exactly `decision.pendingTasks`, plus the required `attestation` (the reviewer's signed statement over them) and `reviewerGrant` (their grant) → 202 |
719
+ | `GET /v1/reviews/:claimId` | read gate, or a live reviewer | pending tasks, stored answers, why a fold failed |
720
+ | `GET /v1/admin/status` | `ORACLE_ADMIN_DIDS` or `STATUS_READER_DIDS` | readiness per check, the backlog, the engine's billing status |
721
+ | `POST /v1/admin/collections/relink` | `ORACLE_ADMIN_DIDS` | `{ collectionIds? }` — link watched collections to their company's Decision API sources, as register does |
722
+
723
+ The claim reads are operator plumbing. The oracle dashboard — billing status, fees, usage,
724
+ decisions, earnings — is hosted by the decision engine, not by this package.
725
+
726
+ ## Local engine (engine developers)
727
+
728
+ A provider never needs this. Set `EVAL_ENGINE_HOSTNAME` (e.g. `localhost:8787`) in `.dev.vars` and
729
+ it overrides the network map's engine host; decisions then work over plain localhost. **Register is
730
+ the exception** — the hosted subscriptions API resolves the ENGINE's did:web to verify the owner's
731
+ delegation, so that leg needs a public tunnel in front of the engine, with the tunnel host set as
732
+ the engine's hostname everywhere and the CAR minted for that same audience.
733
+
734
+ The full runbook, plus the two engine-conformance harnesses:
735
+ [`packages/eval-oracle/dev/README.md`](https://github.com/ixoworld/eval-oralce/blob/main/packages/eval-oracle/dev/README.md).
736
+
737
+ ## Repository layout
738
+
739
+ ```text
740
+ packages/eval-oracle/ THE package — @ixo/decision-oracle
741
+ src/ the Worker: routes, workflows, the facts lane, the CLI
742
+ src/facts/ src/testing/ the two node-safe public subpaths
743
+ migrations/ the D1 migrations — shipped, never hand-written by a consumer
744
+ skills/ the six Claude skills `init` copies into a new project
745
+ templates/project/ exactly what `decision-oracle init` generates
746
+ dev/ engine-conformance harnesses (ours, not published)
747
+ docs/ api.md (the API reference) + guide.md (the walkthrough)
748
+ test/ the workers-pool suite + test/node/ (plain node)
749
+ examples/passport-delivery/ a generated consumer project, kept green by CI
750
+ examples/shipment-delivery/ the Decision API example: SwiftDrop Express (delivery + COD), deployed on devnet
751
+ docs/ENGINE-CONTRACT.md the decision engine's wire contract as this package codes against it
752
+ docs/superpowers/ the package design spec and the implementation plan
753
+ ```
754
+
755
+ ## Developing the package
756
+
757
+ ```bash
758
+ bun install
759
+ bun run check # lint + build the package + its suites (workers pool and node) + the example's
760
+ bun run build # tsc → dist + the C2PA wasm + the dist specifier rewrite + a node-load check
761
+ bun run lint # biome over everything (lint:fix to write)
762
+ ./scripts/pack-smoke.sh
763
+ ```
764
+
765
+ `bun run check` is what CI runs, followed by the example's bundle check and `pack-smoke.sh` — which
766
+ packs the tarball, installs it into a fresh copy of the project template and runs that project's
767
+ own checks, so the published artifact is proven, not assumed.
768
+
769
+ `./scripts/pack-local.sh [outdir]` builds a self-contained tarball (`@ixo/decision-oracle-client`
770
+ bundled inside) for local distribution, e.g. `npx --yes file:/abs/ixo-decision-oracle-<ver>.tgz --help`.
771
+ Beside it, `ixo-decision-oracle-cli-<ver>.tgz` is the CLI alone, one node file with no dependencies, which
772
+ installs in seconds with only node (`init`, `skills` and `facts` need the full package and say so).
773
+
774
+ Two rules worth knowing before you touch `src/`:
775
+
776
+ - **`./facts` and `./testing` must stay node-safe.** Neither may reach `cloudflare:*`, a `.wasm`,
777
+ D1 or KV — a provider imports them from a plain vitest suite. `bun run test:node` in
778
+ `packages/eval-oracle` is the tripwire. If a new import breaks it, inject the runtime thing
779
+ rather than relaxing the lane.
780
+ - **The public surface is three files** — `src/oracle.ts`, `src/facts/types.ts`,
781
+ `src/testing/index.ts`. Changing anything reachable from them is a breaking change of the
782
+ package, not a refactor.
783
+
784
+ The design spec — the layout, `defineOracle`, the facts API, `FactTools`, the CLI, the template and
785
+ the skills — lives in `docs/superpowers/specs/`. Read it before changing a public surface.
786
+
787
+ This README and `packages/eval-oracle/README.md` are the same file (npm shows the package copy;
788
+ symlinks are not packed). CI diffs them — change one, copy it to the other.
789
+
790
+ ## Status
791
+
792
+ `v0.1.0`. Not yet published to npm — install it from a clone or a `bun pm pack` tarball (see
793
+ [Prerequisites](#prerequisites)).
794
+
795
+ Apache License 2.0: `LICENSE` at the repo root and in each package.