@ixo/decision-oracle 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +794 -2
- package/dist/act.d.ts +87 -0
- package/dist/act.d.ts.map +1 -0
- package/dist/act.js +20 -0
- package/dist/act.js.map +1 -0
- package/dist/app.d.ts +22 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +128 -0
- package/dist/app.js.map +1 -0
- package/dist/c2pa.wasm +0 -0
- package/dist/cli/commands/api.d.ts +50 -0
- package/dist/cli/commands/api.d.ts.map +1 -0
- package/dist/cli/commands/api.js +737 -0
- package/dist/cli/commands/api.js.map +1 -0
- package/dist/cli/commands/create-collection.d.ts +40 -0
- package/dist/cli/commands/create-collection.d.ts.map +1 -0
- package/dist/cli/commands/create-collection.js +318 -0
- package/dist/cli/commands/create-collection.js.map +1 -0
- package/dist/cli/commands/create-deed.d.ts +31 -0
- package/dist/cli/commands/create-deed.d.ts.map +1 -0
- package/dist/cli/commands/create-deed.js +208 -0
- package/dist/cli/commands/create-deed.js.map +1 -0
- package/dist/cli/commands/delegation.d.ts +26 -0
- package/dist/cli/commands/delegation.d.ts.map +1 -0
- package/dist/cli/commands/delegation.js +162 -0
- package/dist/cli/commands/delegation.js.map +1 -0
- package/dist/cli/commands/derive.d.ts +22 -0
- package/dist/cli/commands/derive.d.ts.map +1 -0
- package/dist/cli/commands/derive.js +53 -0
- package/dist/cli/commands/derive.js.map +1 -0
- package/dist/cli/commands/engine.d.ts +25 -0
- package/dist/cli/commands/engine.d.ts.map +1 -0
- package/dist/cli/commands/engine.js +107 -0
- package/dist/cli/commands/engine.js.map +1 -0
- package/dist/cli/commands/erase.d.ts +17 -0
- package/dist/cli/commands/erase.d.ts.map +1 -0
- package/dist/cli/commands/erase.js +117 -0
- package/dist/cli/commands/erase.js.map +1 -0
- package/dist/cli/commands/facts-run.d.ts +30 -0
- package/dist/cli/commands/facts-run.d.ts.map +1 -0
- package/dist/cli/commands/facts-run.js +409 -0
- package/dist/cli/commands/facts-run.js.map +1 -0
- package/dist/cli/commands/facts-scaffold.d.ts +22 -0
- package/dist/cli/commands/facts-scaffold.d.ts.map +1 -0
- package/dist/cli/commands/facts-scaffold.js +208 -0
- package/dist/cli/commands/facts-scaffold.js.map +1 -0
- package/dist/cli/commands/init.d.ts +18 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +34 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/login.d.ts +9 -0
- package/dist/cli/commands/login.d.ts.map +1 -0
- package/dist/cli/commands/login.js +16 -0
- package/dist/cli/commands/login.js.map +1 -0
- package/dist/cli/commands/logout.d.ts +10 -0
- package/dist/cli/commands/logout.d.ts.map +1 -0
- package/dist/cli/commands/logout.js +28 -0
- package/dist/cli/commands/logout.js.map +1 -0
- package/dist/cli/commands/manifest.d.ts +12 -0
- package/dist/cli/commands/manifest.d.ts.map +1 -0
- package/dist/cli/commands/manifest.js +48 -0
- package/dist/cli/commands/manifest.js.map +1 -0
- package/dist/cli/commands/oracle-init.d.ts +48 -0
- package/dist/cli/commands/oracle-init.d.ts.map +1 -0
- package/dist/cli/commands/oracle-init.js +1122 -0
- package/dist/cli/commands/oracle-init.js.map +1 -0
- package/dist/cli/commands/org.d.ts +28 -0
- package/dist/cli/commands/org.d.ts.map +1 -0
- package/dist/cli/commands/org.js +309 -0
- package/dist/cli/commands/org.js.map +1 -0
- package/dist/cli/commands/protocol-review.d.ts +20 -0
- package/dist/cli/commands/protocol-review.d.ts.map +1 -0
- package/dist/cli/commands/protocol-review.js +162 -0
- package/dist/cli/commands/protocol-review.js.map +1 -0
- package/dist/cli/commands/publish-protocol.d.ts +43 -0
- package/dist/cli/commands/publish-protocol.d.ts.map +1 -0
- package/dist/cli/commands/publish-protocol.js +345 -0
- package/dist/cli/commands/publish-protocol.js.map +1 -0
- package/dist/cli/commands/register.d.ts +16 -0
- package/dist/cli/commands/register.d.ts.map +1 -0
- package/dist/cli/commands/register.js +54 -0
- package/dist/cli/commands/register.js.map +1 -0
- package/dist/cli/commands/relink.d.ts +11 -0
- package/dist/cli/commands/relink.d.ts.map +1 -0
- package/dist/cli/commands/relink.js +36 -0
- package/dist/cli/commands/relink.js.map +1 -0
- package/dist/cli/commands/rubric-fetch-form.d.ts +16 -0
- package/dist/cli/commands/rubric-fetch-form.d.ts.map +1 -0
- package/dist/cli/commands/rubric-fetch-form.js +83 -0
- package/dist/cli/commands/rubric-fetch-form.js.map +1 -0
- package/dist/cli/commands/rubric-validate.d.ts +72 -0
- package/dist/cli/commands/rubric-validate.d.ts.map +1 -0
- package/dist/cli/commands/rubric-validate.js +163 -0
- package/dist/cli/commands/rubric-validate.js.map +1 -0
- package/dist/cli/commands/scan.d.ts +13 -0
- package/dist/cli/commands/scan.d.ts.map +1 -0
- package/dist/cli/commands/scan.js +39 -0
- package/dist/cli/commands/scan.js.map +1 -0
- package/dist/cli/commands/skills.d.ts +11 -0
- package/dist/cli/commands/skills.d.ts.map +1 -0
- package/dist/cli/commands/skills.js +19 -0
- package/dist/cli/commands/skills.js.map +1 -0
- package/dist/cli/commands/submit-claim.d.ts +25 -0
- package/dist/cli/commands/submit-claim.d.ts.map +1 -0
- package/dist/cli/commands/submit-claim.js +155 -0
- package/dist/cli/commands/submit-claim.js.map +1 -0
- package/dist/cli/index.d.ts +15 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +206 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/lib/agent-card-schema.d.ts +8 -0
- package/dist/cli/lib/agent-card-schema.d.ts.map +1 -0
- package/dist/cli/lib/agent-card-schema.js +169 -0
- package/dist/cli/lib/agent-card-schema.js.map +1 -0
- package/dist/cli/lib/ai-rest.d.ts +12 -0
- package/dist/cli/lib/ai-rest.d.ts.map +1 -0
- package/dist/cli/lib/ai-rest.js +36 -0
- package/dist/cli/lib/ai-rest.js.map +1 -0
- package/dist/cli/lib/args.d.ts +33 -0
- package/dist/cli/lib/args.d.ts.map +1 -0
- package/dist/cli/lib/args.js +24 -0
- package/dist/cli/lib/args.js.map +1 -0
- package/dist/cli/lib/authhub.d.ts +7 -0
- package/dist/cli/lib/authhub.d.ts.map +1 -0
- package/dist/cli/lib/authhub.js +210 -0
- package/dist/cli/lib/authhub.js.map +1 -0
- package/dist/cli/lib/chain.d.ts +264 -0
- package/dist/cli/lib/chain.d.ts.map +1 -0
- package/dist/cli/lib/chain.js +584 -0
- package/dist/cli/lib/chain.js.map +1 -0
- package/dist/cli/lib/devvars.d.ts +59 -0
- package/dist/cli/lib/devvars.d.ts.map +1 -0
- package/dist/cli/lib/devvars.js +206 -0
- package/dist/cli/lib/devvars.js.map +1 -0
- package/dist/cli/lib/engine.d.ts +54 -0
- package/dist/cli/lib/engine.d.ts.map +1 -0
- package/dist/cli/lib/engine.js +112 -0
- package/dist/cli/lib/engine.js.map +1 -0
- package/dist/cli/lib/identity-cards.d.ts +188 -0
- package/dist/cli/lib/identity-cards.d.ts.map +1 -0
- package/dist/cli/lib/identity-cards.js +261 -0
- package/dist/cli/lib/identity-cards.js.map +1 -0
- package/dist/cli/lib/matrix-account.d.ts +79 -0
- package/dist/cli/lib/matrix-account.d.ts.map +1 -0
- package/dist/cli/lib/matrix-account.js +228 -0
- package/dist/cli/lib/matrix-account.js.map +1 -0
- package/dist/cli/lib/oracle-account.d.ts +108 -0
- package/dist/cli/lib/oracle-account.d.ts.map +1 -0
- package/dist/cli/lib/oracle-account.js +207 -0
- package/dist/cli/lib/oracle-account.js.map +1 -0
- package/dist/cli/lib/project.d.ts +22 -0
- package/dist/cli/lib/project.d.ts.map +1 -0
- package/dist/cli/lib/project.js +62 -0
- package/dist/cli/lib/project.js.map +1 -0
- package/dist/cli/lib/session.d.ts +109 -0
- package/dist/cli/lib/session.d.ts.map +1 -0
- package/dist/cli/lib/session.js +354 -0
- package/dist/cli/lib/session.js.map +1 -0
- package/dist/cli/lib/workorder.d.ts +57 -0
- package/dist/cli/lib/workorder.d.ts.map +1 -0
- package/dist/cli/lib/workorder.js +101 -0
- package/dist/cli/lib/workorder.js.map +1 -0
- package/dist/config.d.ts +221 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +431 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +88 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +9 -0
- package/dist/context.js.map +1 -0
- package/dist/contracts/api.d.ts +3367 -0
- package/dist/contracts/api.d.ts.map +1 -0
- package/dist/contracts/api.js +1303 -0
- package/dist/contracts/api.js.map +1 -0
- package/dist/contracts/capabilities.d.ts +126 -0
- package/dist/contracts/capabilities.d.ts.map +1 -0
- package/dist/contracts/capabilities.js +164 -0
- package/dist/contracts/capabilities.js.map +1 -0
- package/dist/contracts/claim-source.d.ts +98 -0
- package/dist/contracts/claim-source.d.ts.map +1 -0
- package/dist/contracts/claim-source.js +17 -0
- package/dist/contracts/claim-source.js.map +1 -0
- package/dist/contracts/errors.d.ts +150 -0
- package/dist/contracts/errors.d.ts.map +1 -0
- package/dist/contracts/errors.js +121 -0
- package/dist/contracts/errors.js.map +1 -0
- package/dist/contracts/index.d.ts +15 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +11 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/contracts/payment-gate.d.ts +129 -0
- package/dist/contracts/payment-gate.d.ts.map +1 -0
- package/dist/contracts/payment-gate.js +24 -0
- package/dist/contracts/payment-gate.js.map +1 -0
- package/dist/contracts/start-api-claim.d.ts +90 -0
- package/dist/contracts/start-api-claim.d.ts.map +1 -0
- package/dist/contracts/start-api-claim.js +22 -0
- package/dist/contracts/start-api-claim.js.map +1 -0
- package/dist/contracts/webhooks.d.ts +1487 -0
- package/dist/contracts/webhooks.d.ts.map +1 -0
- package/dist/contracts/webhooks.js +71 -0
- package/dist/contracts/webhooks.js.map +1 -0
- package/dist/contracts/work-order.d.ts +29 -0
- package/dist/contracts/work-order.d.ts.map +1 -0
- package/dist/contracts/work-order.js +12 -0
- package/dist/contracts/work-order.js.map +1 -0
- package/dist/cron/ai-cost.d.ts +29 -0
- package/dist/cron/ai-cost.d.ts.map +1 -0
- package/dist/cron/ai-cost.js +80 -0
- package/dist/cron/ai-cost.js.map +1 -0
- package/dist/cron/api-lane.d.ts +39 -0
- package/dist/cron/api-lane.d.ts.map +1 -0
- package/dist/cron/api-lane.js +203 -0
- package/dist/cron/api-lane.js.map +1 -0
- package/dist/cron/backlog.d.ts +50 -0
- package/dist/cron/backlog.d.ts.map +1 -0
- package/dist/cron/backlog.js +115 -0
- package/dist/cron/backlog.js.map +1 -0
- package/dist/cron/billing.d.ts +11 -0
- package/dist/cron/billing.d.ts.map +1 -0
- package/dist/cron/billing.js +69 -0
- package/dist/cron/billing.js.map +1 -0
- package/dist/cron/collection.d.ts +50 -0
- package/dist/cron/collection.d.ts.map +1 -0
- package/dist/cron/collection.js +118 -0
- package/dist/cron/collection.js.map +1 -0
- package/dist/cron/funding.d.ts +16 -0
- package/dist/cron/funding.d.ts.map +1 -0
- package/dist/cron/funding.js +262 -0
- package/dist/cron/funding.js.map +1 -0
- package/dist/cron/payer-billing.d.ts +38 -0
- package/dist/cron/payer-billing.d.ts.map +1 -0
- package/dist/cron/payer-billing.js +119 -0
- package/dist/cron/payer-billing.js.map +1 -0
- package/dist/cron/scan.d.ts +43 -0
- package/dist/cron/scan.d.ts.map +1 -0
- package/dist/cron/scan.js +250 -0
- package/dist/cron/scan.js.map +1 -0
- package/dist/db/client.d.ts +14 -0
- package/dist/db/client.d.ts.map +1 -0
- package/dist/db/client.js +14 -0
- package/dist/db/client.js.map +1 -0
- package/dist/db/index.d.ts +7 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +7 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/schema.d.ts +6738 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +1433 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/define-oracle.d.ts +32 -0
- package/dist/define-oracle.d.ts.map +1 -0
- package/dist/define-oracle.js +80 -0
- package/dist/define-oracle.js.map +1 -0
- package/dist/dev-oracle.d.ts +9 -0
- package/dist/dev-oracle.d.ts.map +1 -0
- package/dist/dev-oracle.js +19 -0
- package/dist/dev-oracle.js.map +1 -0
- package/dist/dev-worker.d.ts +10 -0
- package/dist/dev-worker.d.ts.map +1 -0
- package/dist/dev-worker.js +12 -0
- package/dist/dev-worker.js.map +1 -0
- package/dist/env.d.ts +146 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/env.js +10 -0
- package/dist/env.js.map +1 -0
- package/dist/facts/exif.d.ts +43 -0
- package/dist/facts/exif.d.ts.map +1 -0
- package/dist/facts/exif.js +224 -0
- package/dist/facts/exif.js.map +1 -0
- package/dist/facts/fact.d.ts +62 -0
- package/dist/facts/fact.d.ts.map +1 -0
- package/dist/facts/fact.js +105 -0
- package/dist/facts/fact.js.map +1 -0
- package/dist/facts/geo.d.ts +55 -0
- package/dist/facts/geo.d.ts.map +1 -0
- package/dist/facts/geo.js +267 -0
- package/dist/facts/geo.js.map +1 -0
- package/dist/facts/index.d.ts +31 -0
- package/dist/facts/index.d.ts.map +1 -0
- package/dist/facts/index.js +27 -0
- package/dist/facts/index.js.map +1 -0
- package/dist/facts/linked-doc.d.ts +60 -0
- package/dist/facts/linked-doc.d.ts.map +1 -0
- package/dist/facts/linked-doc.js +101 -0
- package/dist/facts/linked-doc.js.map +1 -0
- package/dist/facts/types.d.ts +278 -0
- package/dist/facts/types.d.ts.map +1 -0
- package/dist/facts/types.js +19 -0
- package/dist/facts/types.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/api-lane/accept.d.ts +29 -0
- package/dist/lib/api-lane/accept.d.ts.map +1 -0
- package/dist/lib/api-lane/accept.js +218 -0
- package/dist/lib/api-lane/accept.js.map +1 -0
- package/dist/lib/api-lane/claim-list.d.ts +44 -0
- package/dist/lib/api-lane/claim-list.d.ts.map +1 -0
- package/dist/lib/api-lane/claim-list.js +92 -0
- package/dist/lib/api-lane/claim-list.js.map +1 -0
- package/dist/lib/api-lane/company.d.ts +56 -0
- package/dist/lib/api-lane/company.d.ts.map +1 -0
- package/dist/lib/api-lane/company.js +103 -0
- package/dist/lib/api-lane/company.js.map +1 -0
- package/dist/lib/api-lane/events.d.ts +21 -0
- package/dist/lib/api-lane/events.d.ts.map +1 -0
- package/dist/lib/api-lane/events.js +111 -0
- package/dist/lib/api-lane/events.js.map +1 -0
- package/dist/lib/api-lane/ids.d.ts +39 -0
- package/dist/lib/api-lane/ids.d.ts.map +1 -0
- package/dist/lib/api-lane/ids.js +78 -0
- package/dist/lib/api-lane/ids.js.map +1 -0
- package/dist/lib/api-lane/index.d.ts +16 -0
- package/dist/lib/api-lane/index.d.ts.map +1 -0
- package/dist/lib/api-lane/index.js +16 -0
- package/dist/lib/api-lane/index.js.map +1 -0
- package/dist/lib/api-lane/linked.d.ts +264 -0
- package/dist/lib/api-lane/linked.d.ts.map +1 -0
- package/dist/lib/api-lane/linked.js +272 -0
- package/dist/lib/api-lane/linked.js.map +1 -0
- package/dist/lib/api-lane/media-type.d.ts +15 -0
- package/dist/lib/api-lane/media-type.d.ts.map +1 -0
- package/dist/lib/api-lane/media-type.js +73 -0
- package/dist/lib/api-lane/media-type.js.map +1 -0
- package/dist/lib/api-lane/member-emails.d.ts +83 -0
- package/dist/lib/api-lane/member-emails.d.ts.map +1 -0
- package/dist/lib/api-lane/member-emails.js +213 -0
- package/dist/lib/api-lane/member-emails.js.map +1 -0
- package/dist/lib/api-lane/members.d.ts +42 -0
- package/dist/lib/api-lane/members.d.ts.map +1 -0
- package/dist/lib/api-lane/members.js +75 -0
- package/dist/lib/api-lane/members.js.map +1 -0
- package/dist/lib/api-lane/notify.d.ts +47 -0
- package/dist/lib/api-lane/notify.d.ts.map +1 -0
- package/dist/lib/api-lane/notify.js +240 -0
- package/dist/lib/api-lane/notify.js.map +1 -0
- package/dist/lib/api-lane/pause.d.ts +41 -0
- package/dist/lib/api-lane/pause.d.ts.map +1 -0
- package/dist/lib/api-lane/pause.js +155 -0
- package/dist/lib/api-lane/pause.js.map +1 -0
- package/dist/lib/api-lane/record.d.ts +76 -0
- package/dist/lib/api-lane/record.d.ts.map +1 -0
- package/dist/lib/api-lane/record.js +337 -0
- package/dist/lib/api-lane/record.js.map +1 -0
- package/dist/lib/api-lane/retention.d.ts +43 -0
- package/dist/lib/api-lane/retention.d.ts.map +1 -0
- package/dist/lib/api-lane/retention.js +176 -0
- package/dist/lib/api-lane/retention.js.map +1 -0
- package/dist/lib/api-lane/review.d.ts +76 -0
- package/dist/lib/api-lane/review.d.ts.map +1 -0
- package/dist/lib/api-lane/review.js +355 -0
- package/dist/lib/api-lane/review.js.map +1 -0
- package/dist/lib/api-lane/reviewers.d.ts +109 -0
- package/dist/lib/api-lane/reviewers.d.ts.map +1 -0
- package/dist/lib/api-lane/reviewers.js +755 -0
- package/dist/lib/api-lane/reviewers.js.map +1 -0
- package/dist/lib/api-lane/source-delete.d.ts +16 -0
- package/dist/lib/api-lane/source-delete.d.ts.map +1 -0
- package/dist/lib/api-lane/source-delete.js +50 -0
- package/dist/lib/api-lane/source-delete.js.map +1 -0
- package/dist/lib/api-lane/source.d.ts +19 -0
- package/dist/lib/api-lane/source.d.ts.map +1 -0
- package/dist/lib/api-lane/source.js +226 -0
- package/dist/lib/api-lane/source.js.map +1 -0
- package/dist/lib/api-lane/submitter.d.ts +22 -0
- package/dist/lib/api-lane/submitter.d.ts.map +1 -0
- package/dist/lib/api-lane/submitter.js +34 -0
- package/dist/lib/api-lane/submitter.js.map +1 -0
- package/dist/lib/api-lane/timeline.d.ts +20 -0
- package/dist/lib/api-lane/timeline.d.ts.map +1 -0
- package/dist/lib/api-lane/timeline.js +23 -0
- package/dist/lib/api-lane/timeline.js.map +1 -0
- package/dist/lib/api-lane/webhook-crypto.d.ts +44 -0
- package/dist/lib/api-lane/webhook-crypto.d.ts.map +1 -0
- package/dist/lib/api-lane/webhook-crypto.js +103 -0
- package/dist/lib/api-lane/webhook-crypto.js.map +1 -0
- package/dist/lib/api-lane/webhooks.d.ts +117 -0
- package/dist/lib/api-lane/webhooks.d.ts.map +1 -0
- package/dist/lib/api-lane/webhooks.js +503 -0
- package/dist/lib/api-lane/webhooks.js.map +1 -0
- package/dist/lib/archive.d.ts +64 -0
- package/dist/lib/archive.d.ts.map +1 -0
- package/dist/lib/archive.js +305 -0
- package/dist/lib/archive.js.map +1 -0
- package/dist/lib/bech32.d.ts +8 -0
- package/dist/lib/bech32.d.ts.map +1 -0
- package/dist/lib/bech32.js +39 -0
- package/dist/lib/bech32.js.map +1 -0
- package/dist/lib/claim-erase.d.ts +22 -0
- package/dist/lib/claim-erase.d.ts.map +1 -0
- package/dist/lib/claim-erase.js +44 -0
- package/dist/lib/claim-erase.js.map +1 -0
- package/dist/lib/cursor.d.ts +11 -0
- package/dist/lib/cursor.d.ts.map +1 -0
- package/dist/lib/cursor.js +20 -0
- package/dist/lib/cursor.js.map +1 -0
- package/dist/lib/email/send.d.ts +43 -0
- package/dist/lib/email/send.d.ts.map +1 -0
- package/dist/lib/email/send.js +71 -0
- package/dist/lib/email/send.js.map +1 -0
- package/dist/lib/email/template.d.ts +217 -0
- package/dist/lib/email/template.d.ts.map +1 -0
- package/dist/lib/email/template.js +713 -0
- package/dist/lib/email/template.js.map +1 -0
- package/dist/lib/engine/adr36.d.ts +56 -0
- package/dist/lib/engine/adr36.d.ts.map +1 -0
- package/dist/lib/engine/adr36.js +76 -0
- package/dist/lib/engine/adr36.js.map +1 -0
- package/dist/lib/engine/client.d.ts +162 -0
- package/dist/lib/engine/client.d.ts.map +1 -0
- package/dist/lib/engine/client.js +473 -0
- package/dist/lib/engine/client.js.map +1 -0
- package/dist/lib/engine/types.d.ts +1356 -0
- package/dist/lib/engine/types.d.ts.map +1 -0
- package/dist/lib/engine/types.js +562 -0
- package/dist/lib/engine/types.js.map +1 -0
- package/dist/lib/errors.d.ts +73 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +96 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/facts/builder.d.ts +88 -0
- package/dist/lib/facts/builder.d.ts.map +1 -0
- package/dist/lib/facts/builder.js +239 -0
- package/dist/lib/facts/builder.js.map +1 -0
- package/dist/lib/facts/ctx.d.ts +34 -0
- package/dist/lib/facts/ctx.d.ts.map +1 -0
- package/dist/lib/facts/ctx.js +51 -0
- package/dist/lib/facts/ctx.js.map +1 -0
- package/dist/lib/facts/expected.d.ts +23 -0
- package/dist/lib/facts/expected.d.ts.map +1 -0
- package/dist/lib/facts/expected.js +16 -0
- package/dist/lib/facts/expected.js.map +1 -0
- package/dist/lib/facts/fact-cache.d.ts +469 -0
- package/dist/lib/facts/fact-cache.d.ts.map +1 -0
- package/dist/lib/facts/fact-cache.js +52 -0
- package/dist/lib/facts/fact-cache.js.map +1 -0
- package/dist/lib/facts/factset.d.ts +608 -0
- package/dist/lib/facts/factset.d.ts.map +1 -0
- package/dist/lib/facts/factset.js +226 -0
- package/dist/lib/facts/factset.js.map +1 -0
- package/dist/lib/facts/producer.d.ts +190 -0
- package/dist/lib/facts/producer.d.ts.map +1 -0
- package/dist/lib/facts/producer.js +15 -0
- package/dist/lib/facts/producer.js.map +1 -0
- package/dist/lib/facts/runner.d.ts +111 -0
- package/dist/lib/facts/runner.d.ts.map +1 -0
- package/dist/lib/facts/runner.js +438 -0
- package/dist/lib/facts/runner.js.map +1 -0
- package/dist/lib/facts/stock/ai-check.d.ts +100 -0
- package/dist/lib/facts/stock/ai-check.d.ts.map +1 -0
- package/dist/lib/facts/stock/ai-check.js +526 -0
- package/dist/lib/facts/stock/ai-check.js.map +1 -0
- package/dist/lib/facts/stock/ai-inputs.d.ts +104 -0
- package/dist/lib/facts/stock/ai-inputs.d.ts.map +1 -0
- package/dist/lib/facts/stock/ai-inputs.js +332 -0
- package/dist/lib/facts/stock/ai-inputs.js.map +1 -0
- package/dist/lib/facts/stock/ai-provider.d.ts +105 -0
- package/dist/lib/facts/stock/ai-provider.d.ts.map +1 -0
- package/dist/lib/facts/stock/ai-provider.js +250 -0
- package/dist/lib/facts/stock/ai-provider.js.map +1 -0
- package/dist/lib/facts/stock/ai-unique.d.ts +85 -0
- package/dist/lib/facts/stock/ai-unique.d.ts.map +1 -0
- package/dist/lib/facts/stock/ai-unique.js +208 -0
- package/dist/lib/facts/stock/ai-unique.js.map +1 -0
- package/dist/lib/facts/stock/archive.d.ts +63 -0
- package/dist/lib/facts/stock/archive.d.ts.map +1 -0
- package/dist/lib/facts/stock/archive.js +349 -0
- package/dist/lib/facts/stock/archive.js.map +1 -0
- package/dist/lib/facts/stock/c2pa-trust-list.d.ts +16 -0
- package/dist/lib/facts/stock/c2pa-trust-list.d.ts.map +1 -0
- package/dist/lib/facts/stock/c2pa-trust-list.js +637 -0
- package/dist/lib/facts/stock/c2pa-trust-list.js.map +1 -0
- package/dist/lib/facts/stock/c2pa.d.ts +56 -0
- package/dist/lib/facts/stock/c2pa.d.ts.map +1 -0
- package/dist/lib/facts/stock/c2pa.js +234 -0
- package/dist/lib/facts/stock/c2pa.js.map +1 -0
- package/dist/lib/facts/stock/call.d.ts +91 -0
- package/dist/lib/facts/stock/call.d.ts.map +1 -0
- package/dist/lib/facts/stock/call.js +281 -0
- package/dist/lib/facts/stock/call.js.map +1 -0
- package/dist/lib/facts/stock/capability.d.ts +39 -0
- package/dist/lib/facts/stock/capability.d.ts.map +1 -0
- package/dist/lib/facts/stock/capability.js +59 -0
- package/dist/lib/facts/stock/capability.js.map +1 -0
- package/dist/lib/facts/stock/ext-source.d.ts +51 -0
- package/dist/lib/facts/stock/ext-source.d.ts.map +1 -0
- package/dist/lib/facts/stock/ext-source.js +201 -0
- package/dist/lib/facts/stock/ext-source.js.map +1 -0
- package/dist/lib/facts/stock/frequency-fact.d.ts +59 -0
- package/dist/lib/facts/stock/frequency-fact.d.ts.map +1 -0
- package/dist/lib/facts/stock/frequency-fact.js +86 -0
- package/dist/lib/facts/stock/frequency-fact.js.map +1 -0
- package/dist/lib/facts/stock/frequency.d.ts +32 -0
- package/dist/lib/facts/stock/frequency.d.ts.map +1 -0
- package/dist/lib/facts/stock/frequency.js +48 -0
- package/dist/lib/facts/stock/frequency.js.map +1 -0
- package/dist/lib/facts/stock/index.d.ts +27 -0
- package/dist/lib/facts/stock/index.d.ts.map +1 -0
- package/dist/lib/facts/stock/index.js +28 -0
- package/dist/lib/facts/stock/index.js.map +1 -0
- package/dist/lib/facts/stock/normalize.d.ts +45 -0
- package/dist/lib/facts/stock/normalize.d.ts.map +1 -0
- package/dist/lib/facts/stock/normalize.js +135 -0
- package/dist/lib/facts/stock/normalize.js.map +1 -0
- package/dist/lib/facts/stock/phash.d.ts +55 -0
- package/dist/lib/facts/stock/phash.d.ts.map +1 -0
- package/dist/lib/facts/stock/phash.js +256 -0
- package/dist/lib/facts/stock/phash.js.map +1 -0
- package/dist/lib/facts/stock/rule-defaults.d.ts +72 -0
- package/dist/lib/facts/stock/rule-defaults.d.ts.map +1 -0
- package/dist/lib/facts/stock/rule-defaults.js +55 -0
- package/dist/lib/facts/stock/rule-defaults.js.map +1 -0
- package/dist/lib/facts/stock/send.d.ts +52 -0
- package/dist/lib/facts/stock/send.d.ts.map +1 -0
- package/dist/lib/facts/stock/send.js +148 -0
- package/dist/lib/facts/stock/send.js.map +1 -0
- package/dist/lib/facts/stock/unique-score.d.ts +138 -0
- package/dist/lib/facts/stock/unique-score.d.ts.map +1 -0
- package/dist/lib/facts/stock/unique-score.js +257 -0
- package/dist/lib/facts/stock/unique-score.js.map +1 -0
- package/dist/lib/facts/stock/unique-store.d.ts +420 -0
- package/dist/lib/facts/stock/unique-store.d.ts.map +1 -0
- package/dist/lib/facts/stock/unique-store.js +328 -0
- package/dist/lib/facts/stock/unique-store.js.map +1 -0
- package/dist/lib/facts/stock/unique.d.ts +35 -0
- package/dist/lib/facts/stock/unique.d.ts.map +1 -0
- package/dist/lib/facts/stock/unique.js +327 -0
- package/dist/lib/facts/stock/unique.js.map +1 -0
- package/dist/lib/facts/tools.d.ts +57 -0
- package/dist/lib/facts/tools.d.ts.map +1 -0
- package/dist/lib/facts/tools.js +325 -0
- package/dist/lib/facts/tools.js.map +1 -0
- package/dist/lib/facts/validate.d.ts +33 -0
- package/dist/lib/facts/validate.d.ts.map +1 -0
- package/dist/lib/facts/validate.js +137 -0
- package/dist/lib/facts/validate.js.map +1 -0
- package/dist/lib/hash.d.ts +44 -0
- package/dist/lib/hash.d.ts.map +1 -0
- package/dist/lib/hash.js +80 -0
- package/dist/lib/hash.js.map +1 -0
- package/dist/lib/http/client.d.ts +113 -0
- package/dist/lib/http/client.d.ts.map +1 -0
- package/dist/lib/http/client.js +330 -0
- package/dist/lib/http/client.js.map +1 -0
- package/dist/lib/ids.d.ts +17 -0
- package/dist/lib/ids.d.ts.map +1 -0
- package/dist/lib/ids.js +26 -0
- package/dist/lib/ids.js.map +1 -0
- package/dist/lib/ixo/attachments.d.ts +116 -0
- package/dist/lib/ixo/attachments.d.ts.map +1 -0
- package/dist/lib/ixo/attachments.js +290 -0
- package/dist/lib/ixo/attachments.js.map +1 -0
- package/dist/lib/ixo/authz.d.ts +40 -0
- package/dist/lib/ixo/authz.d.ts.map +1 -0
- package/dist/lib/ixo/authz.js +113 -0
- package/dist/lib/ixo/authz.js.map +1 -0
- package/dist/lib/ixo/blocksync/index.d.ts +90 -0
- package/dist/lib/ixo/blocksync/index.d.ts.map +1 -0
- package/dist/lib/ixo/blocksync/index.js +251 -0
- package/dist/lib/ixo/blocksync/index.js.map +1 -0
- package/dist/lib/ixo/blocksync/queries.d.ts +15 -0
- package/dist/lib/ixo/blocksync/queries.d.ts.map +1 -0
- package/dist/lib/ixo/blocksync/queries.js +144 -0
- package/dist/lib/ixo/blocksync/queries.js.map +1 -0
- package/dist/lib/ixo/blocksync/types.d.ts +184 -0
- package/dist/lib/ixo/blocksync/types.d.ts.map +1 -0
- package/dist/lib/ixo/blocksync/types.js +108 -0
- package/dist/lib/ixo/blocksync/types.js.map +1 -0
- package/dist/lib/ixo/cellnode.d.ts +35 -0
- package/dist/lib/ixo/cellnode.d.ts.map +1 -0
- package/dist/lib/ixo/cellnode.js +43 -0
- package/dist/lib/ixo/cellnode.js.map +1 -0
- package/dist/lib/ixo/chain-write.d.ts +130 -0
- package/dist/lib/ixo/chain-write.d.ts.map +1 -0
- package/dist/lib/ixo/chain-write.js +460 -0
- package/dist/lib/ixo/chain-write.js.map +1 -0
- package/dist/lib/ixo/chain.d.ts +1046 -0
- package/dist/lib/ixo/chain.d.ts.map +1 -0
- package/dist/lib/ixo/chain.js +279 -0
- package/dist/lib/ixo/chain.js.map +1 -0
- package/dist/lib/ixo/claim-bot.d.ts +49 -0
- package/dist/lib/ixo/claim-bot.d.ts.map +1 -0
- package/dist/lib/ixo/claim-bot.js +141 -0
- package/dist/lib/ixo/claim-bot.js.map +1 -0
- package/dist/lib/ixo/delegation-verify.d.ts +44 -0
- package/dist/lib/ixo/delegation-verify.d.ts.map +1 -0
- package/dist/lib/ixo/delegation-verify.js +101 -0
- package/dist/lib/ixo/delegation-verify.js.map +1 -0
- package/dist/lib/ixo/did.d.ts +13 -0
- package/dist/lib/ixo/did.d.ts.map +1 -0
- package/dist/lib/ixo/did.js +85 -0
- package/dist/lib/ixo/did.js.map +1 -0
- package/dist/lib/ixo/grant-chain.d.ts +55 -0
- package/dist/lib/ixo/grant-chain.d.ts.map +1 -0
- package/dist/lib/ixo/grant-chain.js +185 -0
- package/dist/lib/ixo/grant-chain.js.map +1 -0
- package/dist/lib/ixo/identity.d.ts +32 -0
- package/dist/lib/ixo/identity.d.ts.map +1 -0
- package/dist/lib/ixo/identity.js +104 -0
- package/dist/lib/ixo/identity.js.map +1 -0
- package/dist/lib/ixo/index.d.ts +118 -0
- package/dist/lib/ixo/index.d.ts.map +1 -0
- package/dist/lib/ixo/index.js +395 -0
- package/dist/lib/ixo/index.js.map +1 -0
- package/dist/lib/ixo/payment.d.ts +104 -0
- package/dist/lib/ixo/payment.d.ts.map +1 -0
- package/dist/lib/ixo/payment.js +136 -0
- package/dist/lib/ixo/payment.js.map +1 -0
- package/dist/lib/ixo/ucan-store.d.ts +30 -0
- package/dist/lib/ixo/ucan-store.d.ts.map +1 -0
- package/dist/lib/ixo/ucan-store.js +134 -0
- package/dist/lib/ixo/ucan-store.js.map +1 -0
- package/dist/lib/ixo/ucan.d.ts +96 -0
- package/dist/lib/ixo/ucan.d.ts.map +1 -0
- package/dist/lib/ixo/ucan.js +216 -0
- package/dist/lib/ixo/ucan.js.map +1 -0
- package/dist/lib/ixo/verified-read.d.ts +43 -0
- package/dist/lib/ixo/verified-read.d.ts.map +1 -0
- package/dist/lib/ixo/verified-read.js +73 -0
- package/dist/lib/ixo/verified-read.js.map +1 -0
- package/dist/lib/ixo/vfs.d.ts +27 -0
- package/dist/lib/ixo/vfs.d.ts.map +1 -0
- package/dist/lib/ixo/vfs.js +42 -0
- package/dist/lib/ixo/vfs.js.map +1 -0
- package/dist/lib/ixo/web-did.d.ts +7 -0
- package/dist/lib/ixo/web-did.d.ts.map +1 -0
- package/dist/lib/ixo/web-did.js +9 -0
- package/dist/lib/ixo/web-did.js.map +1 -0
- package/dist/lib/logger.d.ts +34 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +126 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/matrix/api.d.ts +57 -0
- package/dist/lib/matrix/api.d.ts.map +1 -0
- package/dist/lib/matrix/api.js +58 -0
- package/dist/lib/matrix/api.js.map +1 -0
- package/dist/lib/matrix/client.d.ts +41 -0
- package/dist/lib/matrix/client.d.ts.map +1 -0
- package/dist/lib/matrix/client.js +104 -0
- package/dist/lib/matrix/client.js.map +1 -0
- package/dist/lib/matrix/deliver.d.ts +224 -0
- package/dist/lib/matrix/deliver.d.ts.map +1 -0
- package/dist/lib/matrix/deliver.js +788 -0
- package/dist/lib/matrix/deliver.js.map +1 -0
- package/dist/lib/matrix/events.d.ts +114 -0
- package/dist/lib/matrix/events.d.ts.map +1 -0
- package/dist/lib/matrix/events.js +143 -0
- package/dist/lib/matrix/events.js.map +1 -0
- package/dist/lib/matrix/mxid.d.ts +24 -0
- package/dist/lib/matrix/mxid.d.ts.map +1 -0
- package/dist/lib/matrix/mxid.js +47 -0
- package/dist/lib/matrix/mxid.js.map +1 -0
- package/dist/lib/metrics.d.ts +105 -0
- package/dist/lib/metrics.d.ts.map +1 -0
- package/dist/lib/metrics.js +204 -0
- package/dist/lib/metrics.js.map +1 -0
- package/dist/lib/oauth/approvals.d.ts +160 -0
- package/dist/lib/oauth/approvals.d.ts.map +1 -0
- package/dist/lib/oauth/approvals.js +273 -0
- package/dist/lib/oauth/approvals.js.map +1 -0
- package/dist/lib/oauth/standing.d.ts +152 -0
- package/dist/lib/oauth/standing.d.ts.map +1 -0
- package/dist/lib/oauth/standing.js +299 -0
- package/dist/lib/oauth/standing.js.map +1 -0
- package/dist/lib/oauth/token.d.ts +60 -0
- package/dist/lib/oauth/token.d.ts.map +1 -0
- package/dist/lib/oauth/token.js +129 -0
- package/dist/lib/oauth/token.js.map +1 -0
- package/dist/lib/payments/extend.d.ts +42 -0
- package/dist/lib/payments/extend.d.ts.map +1 -0
- package/dist/lib/payments/extend.js +98 -0
- package/dist/lib/payments/extend.js.map +1 -0
- package/dist/lib/payments/facilitator.d.ts +220 -0
- package/dist/lib/payments/facilitator.d.ts.map +1 -0
- package/dist/lib/payments/facilitator.js +451 -0
- package/dist/lib/payments/facilitator.js.map +1 -0
- package/dist/lib/payments/gate.d.ts +207 -0
- package/dist/lib/payments/gate.d.ts.map +1 -0
- package/dist/lib/payments/gate.js +481 -0
- package/dist/lib/payments/gate.js.map +1 -0
- package/dist/lib/payments/header-seal.d.ts +33 -0
- package/dist/lib/payments/header-seal.d.ts.map +1 -0
- package/dist/lib/payments/header-seal.js +76 -0
- package/dist/lib/payments/header-seal.js.map +1 -0
- package/dist/lib/payments/index.d.ts +12 -0
- package/dist/lib/payments/index.d.ts.map +1 -0
- package/dist/lib/payments/index.js +11 -0
- package/dist/lib/payments/index.js.map +1 -0
- package/dist/lib/payments/price.d.ts +25 -0
- package/dist/lib/payments/price.d.ts.map +1 -0
- package/dist/lib/payments/price.js +43 -0
- package/dist/lib/payments/price.js.map +1 -0
- package/dist/lib/payments/reconcile.d.ts +77 -0
- package/dist/lib/payments/reconcile.d.ts.map +1 -0
- package/dist/lib/payments/reconcile.js +317 -0
- package/dist/lib/payments/reconcile.js.map +1 -0
- package/dist/lib/payments/refund.d.ts +34 -0
- package/dist/lib/payments/refund.d.ts.map +1 -0
- package/dist/lib/payments/refund.js +123 -0
- package/dist/lib/payments/refund.js.map +1 -0
- package/dist/lib/payments/review-billing.d.ts +222 -0
- package/dist/lib/payments/review-billing.d.ts.map +1 -0
- package/dist/lib/payments/review-billing.js +609 -0
- package/dist/lib/payments/review-billing.js.map +1 -0
- package/dist/lib/payments/settle.d.ts +44 -0
- package/dist/lib/payments/settle.d.ts.map +1 -0
- package/dist/lib/payments/settle.js +306 -0
- package/dist/lib/payments/settle.js.map +1 -0
- package/dist/lib/payments/terms.d.ts +27 -0
- package/dist/lib/payments/terms.d.ts.map +1 -0
- package/dist/lib/payments/terms.js +21 -0
- package/dist/lib/payments/terms.js.map +1 -0
- package/dist/lib/payouts.d.ts +20 -0
- package/dist/lib/payouts.d.ts.map +1 -0
- package/dist/lib/payouts.js +30 -0
- package/dist/lib/payouts.js.map +1 -0
- package/dist/lib/readiness.d.ts +42 -0
- package/dist/lib/readiness.d.ts.map +1 -0
- package/dist/lib/readiness.js +130 -0
- package/dist/lib/readiness.js.map +1 -0
- package/dist/lib/redact.d.ts +23 -0
- package/dist/lib/redact.d.ts.map +1 -0
- package/dist/lib/redact.js +67 -0
- package/dist/lib/redact.js.map +1 -0
- package/dist/lib/register.d.ts +85 -0
- package/dist/lib/register.d.ts.map +1 -0
- package/dist/lib/register.js +390 -0
- package/dist/lib/register.js.map +1 -0
- package/dist/lib/review/attestation.d.ts +92 -0
- package/dist/lib/review/attestation.d.ts.map +1 -0
- package/dist/lib/review/attestation.js +264 -0
- package/dist/lib/review/attestation.js.map +1 -0
- package/dist/lib/review/reviewer-grant.d.ts +146 -0
- package/dist/lib/review/reviewer-grant.d.ts.map +1 -0
- package/dist/lib/review/reviewer-grant.js +359 -0
- package/dist/lib/review/reviewer-grant.js.map +1 -0
- package/dist/lib/review/tasks.d.ts +18 -0
- package/dist/lib/review/tasks.d.ts.map +1 -0
- package/dist/lib/review/tasks.js +36 -0
- package/dist/lib/review/tasks.js.map +1 -0
- package/dist/lib/sentry.d.ts +89 -0
- package/dist/lib/sentry.d.ts.map +1 -0
- package/dist/lib/sentry.js +284 -0
- package/dist/lib/sentry.js.map +1 -0
- package/dist/lib/spans.d.ts +14 -0
- package/dist/lib/spans.d.ts.map +1 -0
- package/dist/lib/spans.js +28 -0
- package/dist/lib/spans.js.map +1 -0
- package/dist/lib/tracing.d.ts +31 -0
- package/dist/lib/tracing.d.ts.map +1 -0
- package/dist/lib/tracing.js +66 -0
- package/dist/lib/tracing.js.map +1 -0
- package/dist/lib/ttl-cache.d.ts +26 -0
- package/dist/lib/ttl-cache.d.ts.map +1 -0
- package/dist/lib/ttl-cache.js +61 -0
- package/dist/lib/ttl-cache.js.map +1 -0
- package/dist/lib/validator.d.ts +19 -0
- package/dist/lib/validator.d.ts.map +1 -0
- package/dist/lib/validator.js +32 -0
- package/dist/lib/validator.js.map +1 -0
- package/dist/lib/work-order/form.d.ts +40 -0
- package/dist/lib/work-order/form.d.ts.map +1 -0
- package/dist/lib/work-order/form.js +316 -0
- package/dist/lib/work-order/form.js.map +1 -0
- package/dist/lib/work-order/index.d.ts +20 -0
- package/dist/lib/work-order/index.d.ts.map +1 -0
- package/dist/lib/work-order/index.js +66 -0
- package/dist/lib/work-order/index.js.map +1 -0
- package/dist/middleware/api/audit.d.ts +9 -0
- package/dist/middleware/api/audit.d.ts.map +1 -0
- package/dist/middleware/api/audit.js +38 -0
- package/dist/middleware/api/audit.js.map +1 -0
- package/dist/middleware/api/auth.d.ts +29 -0
- package/dist/middleware/api/auth.d.ts.map +1 -0
- package/dist/middleware/api/auth.js +105 -0
- package/dist/middleware/api/auth.js.map +1 -0
- package/dist/middleware/api/console.d.ts +92 -0
- package/dist/middleware/api/console.d.ts.map +1 -0
- package/dist/middleware/api/console.js +446 -0
- package/dist/middleware/api/console.js.map +1 -0
- package/dist/middleware/api/errors.d.ts +48 -0
- package/dist/middleware/api/errors.d.ts.map +1 -0
- package/dist/middleware/api/errors.js +133 -0
- package/dist/middleware/api/errors.js.map +1 -0
- package/dist/middleware/api/idempotency.d.ts +23 -0
- package/dist/middleware/api/idempotency.d.ts.map +1 -0
- package/dist/middleware/api/idempotency.js +158 -0
- package/dist/middleware/api/idempotency.js.map +1 -0
- package/dist/middleware/api/keys.d.ts +14 -0
- package/dist/middleware/api/keys.d.ts.map +1 -0
- package/dist/middleware/api/keys.js +66 -0
- package/dist/middleware/api/keys.js.map +1 -0
- package/dist/middleware/api/membership.d.ts +32 -0
- package/dist/middleware/api/membership.d.ts.map +1 -0
- package/dist/middleware/api/membership.js +48 -0
- package/dist/middleware/api/membership.js.map +1 -0
- package/dist/middleware/api/oauth.d.ts +28 -0
- package/dist/middleware/api/oauth.d.ts.map +1 -0
- package/dist/middleware/api/oauth.js +109 -0
- package/dist/middleware/api/oauth.js.map +1 -0
- package/dist/middleware/api/rate-limit.d.ts +23 -0
- package/dist/middleware/api/rate-limit.d.ts.map +1 -0
- package/dist/middleware/api/rate-limit.js +70 -0
- package/dist/middleware/api/rate-limit.js.map +1 -0
- package/dist/middleware/api/types.d.ts +92 -0
- package/dist/middleware/api/types.d.ts.map +1 -0
- package/dist/middleware/api/types.js +7 -0
- package/dist/middleware/api/types.js.map +1 -0
- package/dist/middleware/api/wait.d.ts +21 -0
- package/dist/middleware/api/wait.d.ts.map +1 -0
- package/dist/middleware/api/wait.js +85 -0
- package/dist/middleware/api/wait.js.map +1 -0
- package/dist/middleware/capability.d.ts +32 -0
- package/dist/middleware/capability.d.ts.map +1 -0
- package/dist/middleware/capability.js +113 -0
- package/dist/middleware/capability.js.map +1 -0
- package/dist/middleware/database.d.ts +14 -0
- package/dist/middleware/database.d.ts.map +1 -0
- package/dist/middleware/database.js +18 -0
- package/dist/middleware/database.js.map +1 -0
- package/dist/middleware/error-handler.d.ts +13 -0
- package/dist/middleware/error-handler.d.ts.map +1 -0
- package/dist/middleware/error-handler.js +127 -0
- package/dist/middleware/error-handler.js.map +1 -0
- package/dist/middleware/observability.d.ts +32 -0
- package/dist/middleware/observability.d.ts.map +1 -0
- package/dist/middleware/observability.js +134 -0
- package/dist/middleware/observability.js.map +1 -0
- package/dist/middleware/rate-limit.d.ts +16 -0
- package/dist/middleware/rate-limit.d.ts.map +1 -0
- package/dist/middleware/rate-limit.js +56 -0
- package/dist/middleware/rate-limit.js.map +1 -0
- package/dist/middleware/ucan-auth.d.ts +39 -0
- package/dist/middleware/ucan-auth.d.ts.map +1 -0
- package/dist/middleware/ucan-auth.js +278 -0
- package/dist/middleware/ucan-auth.js.map +1 -0
- package/dist/networks.d.ts +34 -0
- package/dist/networks.d.ts.map +1 -0
- package/dist/networks.js +49 -0
- package/dist/networks.js.map +1 -0
- package/dist/oracle.d.ts +193 -0
- package/dist/oracle.d.ts.map +1 -0
- package/dist/oracle.js +245 -0
- package/dist/oracle.js.map +1 -0
- package/dist/routes/health.d.ts +16 -0
- package/dist/routes/health.d.ts.map +1 -0
- package/dist/routes/health.js +29 -0
- package/dist/routes/health.js.map +1 -0
- package/dist/routes/v1/admin.d.ts +18 -0
- package/dist/routes/v1/admin.d.ts.map +1 -0
- package/dist/routes/v1/admin.js +101 -0
- package/dist/routes/v1/admin.js.map +1 -0
- package/dist/routes/v1/api/admin-claims.d.ts +14 -0
- package/dist/routes/v1/api/admin-claims.d.ts.map +1 -0
- package/dist/routes/v1/api/admin-claims.js +82 -0
- package/dist/routes/v1/api/admin-claims.js.map +1 -0
- package/dist/routes/v1/api/admin-facilitator.d.ts +20 -0
- package/dist/routes/v1/api/admin-facilitator.d.ts.map +1 -0
- package/dist/routes/v1/api/admin-facilitator.js +64 -0
- package/dist/routes/v1/api/admin-facilitator.js.map +1 -0
- package/dist/routes/v1/api/admin.d.ts +9 -0
- package/dist/routes/v1/api/admin.d.ts.map +1 -0
- package/dist/routes/v1/api/admin.js +110 -0
- package/dist/routes/v1/api/admin.js.map +1 -0
- package/dist/routes/v1/api/audit.d.ts +8 -0
- package/dist/routes/v1/api/audit.d.ts.map +1 -0
- package/dist/routes/v1/api/audit.js +56 -0
- package/dist/routes/v1/api/audit.js.map +1 -0
- package/dist/routes/v1/api/batch.d.ts +17 -0
- package/dist/routes/v1/api/batch.d.ts.map +1 -0
- package/dist/routes/v1/api/batch.js +192 -0
- package/dist/routes/v1/api/batch.js.map +1 -0
- package/dist/routes/v1/api/claims-read.d.ts +43 -0
- package/dist/routes/v1/api/claims-read.d.ts.map +1 -0
- package/dist/routes/v1/api/claims-read.js +123 -0
- package/dist/routes/v1/api/claims-read.js.map +1 -0
- package/dist/routes/v1/api/claims.d.ts +131 -0
- package/dist/routes/v1/api/claims.d.ts.map +1 -0
- package/dist/routes/v1/api/claims.js +407 -0
- package/dist/routes/v1/api/claims.js.map +1 -0
- package/dist/routes/v1/api/collections-link.d.ts +14 -0
- package/dist/routes/v1/api/collections-link.d.ts.map +1 -0
- package/dist/routes/v1/api/collections-link.js +97 -0
- package/dist/routes/v1/api/collections-link.js.map +1 -0
- package/dist/routes/v1/api/export.d.ts +48 -0
- package/dist/routes/v1/api/export.d.ts.map +1 -0
- package/dist/routes/v1/api/export.js +251 -0
- package/dist/routes/v1/api/export.js.map +1 -0
- package/dist/routes/v1/api/index.d.ts +16 -0
- package/dist/routes/v1/api/index.d.ts.map +1 -0
- package/dist/routes/v1/api/index.js +68 -0
- package/dist/routes/v1/api/index.js.map +1 -0
- package/dist/routes/v1/api/keys.d.ts +9 -0
- package/dist/routes/v1/api/keys.d.ts.map +1 -0
- package/dist/routes/v1/api/keys.js +95 -0
- package/dist/routes/v1/api/keys.js.map +1 -0
- package/dist/routes/v1/api/me.d.ts +21 -0
- package/dist/routes/v1/api/me.d.ts.map +1 -0
- package/dist/routes/v1/api/me.js +122 -0
- package/dist/routes/v1/api/me.js.map +1 -0
- package/dist/routes/v1/api/members.d.ts +17 -0
- package/dist/routes/v1/api/members.d.ts.map +1 -0
- package/dist/routes/v1/api/members.js +406 -0
- package/dist/routes/v1/api/members.js.map +1 -0
- package/dist/routes/v1/api/meta.d.ts +12 -0
- package/dist/routes/v1/api/meta.d.ts.map +1 -0
- package/dist/routes/v1/api/meta.js +59 -0
- package/dist/routes/v1/api/meta.js.map +1 -0
- package/dist/routes/v1/api/openapi.gen.d.ts +2 -0
- package/dist/routes/v1/api/openapi.gen.d.ts.map +1 -0
- package/dist/routes/v1/api/openapi.gen.js +7 -0
- package/dist/routes/v1/api/openapi.gen.js.map +1 -0
- package/dist/routes/v1/api/protocols.d.ts +22 -0
- package/dist/routes/v1/api/protocols.d.ts.map +1 -0
- package/dist/routes/v1/api/protocols.js +153 -0
- package/dist/routes/v1/api/protocols.js.map +1 -0
- package/dist/routes/v1/api/review-billing.d.ts +18 -0
- package/dist/routes/v1/api/review-billing.d.ts.map +1 -0
- package/dist/routes/v1/api/review-billing.js +196 -0
- package/dist/routes/v1/api/review-billing.js.map +1 -0
- package/dist/routes/v1/api/review.d.ts +30 -0
- package/dist/routes/v1/api/review.d.ts.map +1 -0
- package/dist/routes/v1/api/review.js +302 -0
- package/dist/routes/v1/api/review.js.map +1 -0
- package/dist/routes/v1/api/sources.d.ts +10 -0
- package/dist/routes/v1/api/sources.d.ts.map +1 -0
- package/dist/routes/v1/api/sources.js +293 -0
- package/dist/routes/v1/api/sources.js.map +1 -0
- package/dist/routes/v1/api/uploads.d.ts +37 -0
- package/dist/routes/v1/api/uploads.d.ts.map +1 -0
- package/dist/routes/v1/api/uploads.js +414 -0
- package/dist/routes/v1/api/uploads.js.map +1 -0
- package/dist/routes/v1/api/views.d.ts +18 -0
- package/dist/routes/v1/api/views.d.ts.map +1 -0
- package/dist/routes/v1/api/views.js +95 -0
- package/dist/routes/v1/api/views.js.map +1 -0
- package/dist/routes/v1/api/webhooks.d.ts +14 -0
- package/dist/routes/v1/api/webhooks.d.ts.map +1 -0
- package/dist/routes/v1/api/webhooks.js +282 -0
- package/dist/routes/v1/api/webhooks.js.map +1 -0
- package/dist/routes/v1/api/work-orders.d.ts +45 -0
- package/dist/routes/v1/api/work-orders.d.ts.map +1 -0
- package/dist/routes/v1/api/work-orders.js +171 -0
- package/dist/routes/v1/api/work-orders.js.map +1 -0
- package/dist/routes/v1/claims.d.ts +21 -0
- package/dist/routes/v1/claims.d.ts.map +1 -0
- package/dist/routes/v1/claims.js +153 -0
- package/dist/routes/v1/claims.js.map +1 -0
- package/dist/routes/v1/collections.d.ts +45 -0
- package/dist/routes/v1/collections.d.ts.map +1 -0
- package/dist/routes/v1/collections.js +201 -0
- package/dist/routes/v1/collections.js.map +1 -0
- package/dist/routes/v1/index.d.ts +13 -0
- package/dist/routes/v1/index.d.ts.map +1 -0
- package/dist/routes/v1/index.js +41 -0
- package/dist/routes/v1/index.js.map +1 -0
- package/dist/routes/v1/info.d.ts +14 -0
- package/dist/routes/v1/info.d.ts.map +1 -0
- package/dist/routes/v1/info.js +75 -0
- package/dist/routes/v1/info.js.map +1 -0
- package/dist/routes/v1/mcp/index.d.ts +33 -0
- package/dist/routes/v1/mcp/index.d.ts.map +1 -0
- package/dist/routes/v1/mcp/index.js +252 -0
- package/dist/routes/v1/mcp/index.js.map +1 -0
- package/dist/routes/v1/mcp/oauth.d.ts +27 -0
- package/dist/routes/v1/mcp/oauth.d.ts.map +1 -0
- package/dist/routes/v1/mcp/oauth.js +500 -0
- package/dist/routes/v1/mcp/oauth.js.map +1 -0
- package/dist/routes/v1/mcp/tools.d.ts +71 -0
- package/dist/routes/v1/mcp/tools.d.ts.map +1 -0
- package/dist/routes/v1/mcp/tools.js +432 -0
- package/dist/routes/v1/mcp/tools.js.map +1 -0
- package/dist/routes/v1/mcp/ui.d.ts +45 -0
- package/dist/routes/v1/mcp/ui.d.ts.map +1 -0
- package/dist/routes/v1/mcp/ui.js +454 -0
- package/dist/routes/v1/mcp/ui.js.map +1 -0
- package/dist/routes/v1/oauth.d.ts +29 -0
- package/dist/routes/v1/oauth.d.ts.map +1 -0
- package/dist/routes/v1/oauth.js +256 -0
- package/dist/routes/v1/oauth.js.map +1 -0
- package/dist/routes/v1/reviewers.d.ts +22 -0
- package/dist/routes/v1/reviewers.d.ts.map +1 -0
- package/dist/routes/v1/reviewers.js +165 -0
- package/dist/routes/v1/reviewers.js.map +1 -0
- package/dist/routes/v1/reviews.d.ts +38 -0
- package/dist/routes/v1/reviews.d.ts.map +1 -0
- package/dist/routes/v1/reviews.js +234 -0
- package/dist/routes/v1/reviews.js.map +1 -0
- package/dist/routes/v1/shared.d.ts +586 -0
- package/dist/routes/v1/shared.d.ts.map +1 -0
- package/dist/routes/v1/shared.js +229 -0
- package/dist/routes/v1/shared.js.map +1 -0
- package/dist/routes/well-known.d.ts +15 -0
- package/dist/routes/well-known.d.ts.map +1 -0
- package/dist/routes/well-known.js +35 -0
- package/dist/routes/well-known.js.map +1 -0
- package/dist/runtime.d.ts +100 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +144 -0
- package/dist/runtime.js.map +1 -0
- package/dist/testing/fake-tools.d.ts +104 -0
- package/dist/testing/fake-tools.d.ts.map +1 -0
- package/dist/testing/fake-tools.js +213 -0
- package/dist/testing/fake-tools.js.map +1 -0
- package/dist/testing/index.d.ts +54 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +104 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/samples.d.ts +70 -0
- package/dist/testing/samples.d.ts.map +1 -0
- package/dist/testing/samples.js +92 -0
- package/dist/testing/samples.js.map +1 -0
- package/dist/workflows/claim-ingest.d.ts +250 -0
- package/dist/workflows/claim-ingest.d.ts.map +1 -0
- package/dist/workflows/claim-ingest.js +1020 -0
- package/dist/workflows/claim-ingest.js.map +1 -0
- package/dist/workflows/claim-source.d.ts +25 -0
- package/dist/workflows/claim-source.d.ts.map +1 -0
- package/dist/workflows/claim-source.js +107 -0
- package/dist/workflows/claim-source.js.map +1 -0
- package/dist/workflows/review-complete.d.ts +82 -0
- package/dist/workflows/review-complete.d.ts.map +1 -0
- package/dist/workflows/review-complete.js +455 -0
- package/dist/workflows/review-complete.js.map +1 -0
- package/dist/workflows/steps.d.ts +125 -0
- package/dist/workflows/steps.d.ts.map +1 -0
- package/dist/workflows/steps.js +325 -0
- package/dist/workflows/steps.js.map +1 -0
- package/docs/api.md +2595 -0
- package/docs/guide.md +1525 -0
- package/migrations/0000_init.sql +108 -0
- package/migrations/0001_review_attestation.sql +1 -0
- package/migrations/0002_decisions_facts.sql +1 -0
- package/migrations/0003_api_lane.sql +171 -0
- package/migrations/0004_api_v1_1.sql +19 -0
- package/migrations/0005_member_notify.sql +3 -0
- package/migrations/0006_source_collections.sql +16 -0
- package/migrations/0007_api_settlement.sql +27 -0
- package/migrations/0008_review_extend.sql +1 -0
- package/migrations/0009_card_refunds.sql +4 -0
- package/migrations/0010_even_scorpion.sql +16 -0
- package/migrations/0011_mcp_oauth.sql +27 -0
- package/migrations/0012_mcp_standing.sql +21 -0
- package/migrations/0013_unknown_krista_starr.sql +2 -0
- package/migrations/0014_last_carnage.sql +14 -0
- package/migrations/0015_company_authority.sql +26 -0
- package/migrations/0016_owner_only_links.sql +6 -0
- package/migrations/0017_organisations.sql +35 -0
- package/migrations/0018_remove_app_signed.sql +4 -0
- package/migrations/0019_submitted_via.sql +2 -0
- package/migrations/0020_drop_decision_to_pay.sql +4 -0
- package/migrations/0021_manual_erase.sql +25 -0
- package/migrations/0022_errored_facts.sql +1 -0
- package/migrations/0023_review_billing.sql +20 -0
- package/migrations/0024_pending_task_details.sql +1 -0
- package/migrations/meta/0000_snapshot.json +707 -0
- package/migrations/meta/0001_snapshot.json +714 -0
- package/migrations/meta/0002_snapshot.json +721 -0
- package/migrations/meta/0003_snapshot.json +1845 -0
- package/migrations/meta/0004_snapshot.json +1969 -0
- package/migrations/meta/0005_snapshot.json +1991 -0
- package/migrations/meta/0006_snapshot.json +2097 -0
- package/migrations/meta/0007_snapshot.json +2128 -0
- package/migrations/meta/0008_snapshot.json +2133 -0
- package/migrations/meta/0009_snapshot.json +2161 -0
- package/migrations/meta/0010_snapshot.json +2265 -0
- package/migrations/meta/0011_snapshot.json +2448 -0
- package/migrations/meta/0012_snapshot.json +2577 -0
- package/migrations/meta/0013_snapshot.json +2594 -0
- package/migrations/meta/0014_snapshot.json +2602 -0
- package/migrations/meta/0015_snapshot.json +2778 -0
- package/migrations/meta/0016_snapshot.json +2778 -0
- package/migrations/meta/0017_snapshot.json +2792 -0
- package/migrations/meta/0018_snapshot.json +2778 -0
- package/migrations/meta/0019_snapshot.json +2792 -0
- package/migrations/meta/0020_snapshot.json +2785 -0
- package/migrations/meta/0021_snapshot.json +2762 -0
- package/migrations/meta/0022_snapshot.json +2769 -0
- package/migrations/meta/0023_snapshot.json +2900 -0
- package/migrations/meta/0024_snapshot.json +2907 -0
- package/migrations/meta/_journal.json +181 -0
- package/openapi/decision-api.yaml +12204 -0
- package/package.json +121 -4
- package/skills/README.md +19 -0
- package/skills/add-openhands-support/SKILL.md +113 -0
- package/skills/create-collection/SKILL.md +199 -0
- package/skills/create-collection/reference/claims-stack.md +106 -0
- package/skills/create-collection/reference/collection.md +111 -0
- package/skills/create-oracle/SKILL.md +400 -0
- package/skills/create-rubric/SKILL.md +130 -0
- package/skills/create-rubric/reference/format-cheatsheet.md +186 -0
- package/skills/create-rubric/templates/claim-form.example.json +60 -0
- package/skills/decision-api-client/SKILL.md +236 -0
- package/skills/decision-api-oracle/SKILL.md +336 -0
- package/skills/publish-protocol/SKILL.md +151 -0
- package/skills/publish-protocol/reference/publishing.md +116 -0
- package/skills/reference/engine-contract.md +222 -0
- package/skills/write-facts/SKILL.md +221 -0
- package/skills/write-facts/reference/examples/http-vendor.ts +88 -0
- package/skills/write-facts/reference/examples/price-matches-agreement.ts +67 -0
- package/skills/write-facts/reference/facts-api.md +232 -0
- package/templates/project/.dev.vars.example +93 -0
- package/templates/project/.editorconfig +9 -0
- package/templates/project/CLAUDE.md +45 -0
- package/templates/project/README.md +199 -0
- package/templates/project/biome.json +37 -0
- package/templates/project/gitignore +29 -0
- package/templates/project/package.json +32 -0
- package/templates/project/src/facts/index.ts +19 -0
- package/templates/project/src/index.ts +25 -0
- package/templates/project/test/api-lane.test.ts +57 -0
- package/templates/project/test/facts.test.ts +14 -0
- package/templates/project/tsconfig.json +25 -0
- package/templates/project/vitest.config.ts +13 -0
- package/templates/project/wrangler.jsonc +446 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
# The facts API — cheat sheet
|
|
2
|
+
|
|
3
|
+
Full reference: `node_modules/@ixo/decision-oracle/docs/api.md` (or `packages/eval-oracle/docs/api.md`
|
|
4
|
+
in this repo) — every export, every default, every cap. This page is the working subset.
|
|
5
|
+
|
|
6
|
+
Everything a handler is handed, everything it may hand back, and the rules the runner enforces
|
|
7
|
+
around it. Import surface: `@ixo/decision-oracle/facts` (node-safe) and `@ixo/decision-oracle/testing`
|
|
8
|
+
(node-safe). A handler never imports the worker.
|
|
9
|
+
|
|
10
|
+
## The table
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { defineFacts, group } from "@ixo/decision-oracle/facts";
|
|
14
|
+
|
|
15
|
+
export const facts = defineFacts({
|
|
16
|
+
ext: { [name]: ExtHandler }, // unlisted ⇒ the STOCK ext lane (a UCAN-signed POST to the declared endpoint)
|
|
17
|
+
ai: { [name]: AiHandler, // unlisted ⇒ the STOCK ai lane (the configured AI provider with the rubric's instructions)
|
|
18
|
+
"*": AiHandler }, // catches every check not named above; a named handler still wins
|
|
19
|
+
groups: [group([name, name], GroupHandler)], // ONE call answers several sources (below)
|
|
20
|
+
unique: UniqueHandler, // absent ⇒ the stock duplicate lane (this oracle's D1 registries)
|
|
21
|
+
frequency: FrequencyHandler, // absent ⇒ the stock Blocksync submission count
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
A table is a DIFF against stock, never a replacement of it. A handler for a name the manifest does
|
|
26
|
+
not declare is ignored with one `facts.handler-unused` warning — a renamed rubric entry shows up as
|
|
27
|
+
that warning, not as a broken build. One name, one handler: a name listed in `ext` *and* claimed by
|
|
28
|
+
a group (or claimed by two groups) throws at **boot**.
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
// Each returns the value OR a promise of it — a synchronous handler is fine.
|
|
32
|
+
type ExtHandler = (input: ExtInput, tools: ExtTools) => Promise<ExtResult> | ExtResult; // boolean | number | ExtFact | FactErrorDraft
|
|
33
|
+
type AiHandler = (input: AiInput, tools: AiTools) => Promise<AiResult> | AiResult; // boolean | AiFact | FactErrorDraft
|
|
34
|
+
type GroupHandler = (input: GroupInput, tools: FactTools) => Promise<GroupResult> | GroupResult; // Record<name, ExtResult>
|
|
35
|
+
type UniqueHandler = (input: UniqueInput, tools: FactTools) => Promise<UniqueFact> | UniqueFact;
|
|
36
|
+
type FrequencyHandler = (input: FrequencyInput, tools: FactTools) => Promise<FrequencyFact> | FrequencyFact;
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`ExtTools` / `AiTools` are `FactTools` narrowed to the lane's own fact — that is what makes
|
|
40
|
+
`return tools.stock()` type-check with no cast.
|
|
41
|
+
|
|
42
|
+
## The input
|
|
43
|
+
|
|
44
|
+
Every handler gets these:
|
|
45
|
+
|
|
46
|
+
| Field | What it is |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| `claim` | the pulled claim: `claimId`, `collectionId`, `metadata` (agent address, submission date, payment), `attachments`, `body` |
|
|
49
|
+
| `answers` | `claim.body` — the credentialSubject, verbatim |
|
|
50
|
+
| `ctx` | the build's ONE clock read + the collection window: `{ now, collection: { startDate, endDate }, claim: { submitter, submitterAddress, submissionDate } }`. **Never read the clock in a handler** — `ctx.now` is what the engine's rules compare against |
|
|
51
|
+
| `settings` | this oracle's policies for this build: `{ allowAiChecks, allowImageChecks }` |
|
|
52
|
+
| `manifest` | the whole work order: `fields`, `derived`, `ctx`, `unique`, `frequency`, every `ext`/`ai` declaration |
|
|
53
|
+
|
|
54
|
+
Per lane, on top of that:
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
ExtInput { name, expected: ManifestExt, send, unresolved }
|
|
58
|
+
AiInput { name, check: ManifestAi, send, unresolved, inputs: AiSendEntry[] }
|
|
59
|
+
GroupInput { names: string[], sources: Record<name, ExtInput> } // one call, several sources
|
|
60
|
+
UniqueInput { rule: UniqueRule } // rule defaults already applied
|
|
61
|
+
FrequencyInput { rule: FrequencyRule | null } // null ⇒ the manifest declared no max/per
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
- `send` — the rubric's declared `send` map, already resolved against the answers and ctx. A slot
|
|
65
|
+
naming a `~derived` value is `null` and its ref is listed in `unresolved`; the expression is in
|
|
66
|
+
`manifest.derived[]` if your handler wants to compute it (the stock lanes refuse it instead).
|
|
67
|
+
- `expected` / `check` — the declaration for THIS name: `expect` (`"boolean"` | `"score"`),
|
|
68
|
+
`onError`, `endpoint`, `audience`, `capability`, `timeoutMs`, `instructions`, `usedBy`.
|
|
69
|
+
- `inputs` (ai) — the `send` map as the judge's typed, ordered entries: `{ kind: "text", key, value }`
|
|
70
|
+
and one `{ kind: "attachment", key, attachment }` per file on a `$question` slot.
|
|
71
|
+
|
|
72
|
+
## What to return
|
|
73
|
+
|
|
74
|
+
| Return | Becomes |
|
|
75
|
+
| --- | --- |
|
|
76
|
+
| `true` / `false` (ext, ai) | `{ status: "ok", value, reason: null }` (ai also gets `failedRules: []`, `score: 100`) |
|
|
77
|
+
| `8200` (ext, `expect: "score"`) | `{ status: "ok", value: 8200, reason: null }` — an INTEGER 0..10000, never a float, never clamped |
|
|
78
|
+
| `fact.ok(value, { reason?, confidence?, transcript? })` | the same, with colour for the trace |
|
|
79
|
+
| `fact.ai.ok(value, { reason?, failedRules?, score?, confidence?, transcript? })` | an AI verdict; `score` is confidence in the VERDICT (0–100), not input quality |
|
|
80
|
+
| `fact.error(detail, { transcript? })` | `{ status: "error", onError: <the manifest's>, detail }` |
|
|
81
|
+
| `throw fact.retryLater(detail)` | the workflow step retries; facts already answered are kept |
|
|
82
|
+
| a retryable engine/chain failure (5xx, `UNAVAILABLE`, `RATE_LIMITED`, an outage) | NOT a fact — it retries too, same as `retryLater` |
|
|
83
|
+
| any other throw | an `error` fact with the manifest's `onError`, logged `facts.handler-threw` |
|
|
84
|
+
|
|
85
|
+
`fact.error` takes no `onError` and there is no way to pass one: the runner stamps the rubric's own,
|
|
86
|
+
over whatever a handler put there. **A handler cannot turn its own failure into an approval.**
|
|
87
|
+
|
|
88
|
+
**A deterministic failure is a fact; a transient one is a retry.** Don't `catch` a transient
|
|
89
|
+
engine/chain error yourself and turn it into `fact.error(...)` — that freezes a verdict over
|
|
90
|
+
trouble that was never the claim's fault, and a claim is decided once, so it can never be re-run
|
|
91
|
+
(task-14, 2026-09-14: a devnet claim was held for review on every fact because the engine's own 5xx
|
|
92
|
+
got frozen this way). `tools.agreement()` and `tools.chain.*` already let a retryable failure
|
|
93
|
+
propagate instead of catching it — see below.
|
|
94
|
+
|
|
95
|
+
## One call, many facts
|
|
96
|
+
|
|
97
|
+
`group(["quality", "price"], handler)` in `groups` takes those `ext` names over and answers them
|
|
98
|
+
from ONE call — four criteria judged by a single structured model call is four completions as four
|
|
99
|
+
handlers and one as a group. It is the sanctioned way to share a call between facts; a private cache
|
|
100
|
+
inside a handler still is not (the runner's fact cache is the only cache).
|
|
101
|
+
|
|
102
|
+
AI checks cannot currently be grouped; `group()` answers `ext` sources only.
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
export const workScores: GroupHandler = async ({ names, answers }, tools) => {
|
|
106
|
+
const res = await tools.http.json<Scores>(JUDGE_URL, { method: "POST", body: { …answers } });
|
|
107
|
+
// One call, one failure: every name it owed gets an error carrying the rubric's own `onError`.
|
|
108
|
+
if (!res.ok) return Object.fromEntries(names.map((n) => [n, fact.error(`judge ${res.status}`)]));
|
|
109
|
+
return { quality: 8600, price: fact.ok(7000, { reason: "under the agreed price" }) };
|
|
110
|
+
};
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
- `names` — the names THIS call must answer (the group's names, minus any the manifest does not
|
|
114
|
+
declare and any a previous attempt already paid for). **Answer every one of them**: a name you
|
|
115
|
+
leave out becomes its own `handler returned no fact for <name>` error.
|
|
116
|
+
- `sources[name]` — that name's `ExtInput`: its `expected` declaration and its resolved `send`.
|
|
117
|
+
- Return one fact per name, each anything a single ext handler may return.
|
|
118
|
+
- The group is **one** call per claim and **one** slot in the fan-out cap. Each fact still carries
|
|
119
|
+
its own declaration's `onError` and its own cache entry; a throw freezes every name it owed.
|
|
120
|
+
- A name nobody asked for is dropped with a `facts.group-extra-fact` warning. `tools.stock()`
|
|
121
|
+
throws inside a group — it names none of the group's sources.
|
|
122
|
+
|
|
123
|
+
## `tools`
|
|
124
|
+
|
|
125
|
+
| Call | One-line use |
|
|
126
|
+
| --- | --- |
|
|
127
|
+
| `tools.stock()` | `const base = await tools.stock();` — the stock lane for THIS fact: wrap it, fall back to it, or ignore it. Typed per lane (an `ExtFact` in an ext handler, an `AiFact` in an ai one), so `return tools.stock()` needs no cast |
|
|
128
|
+
| `tools.http.json<T>(url, init?)` | `const res = await tools.http.json<Reply>(url, { method: "POST", body, timeoutMs: 5000 });` — retries, timeout, SSRF guard, a recorded transcript; NEVER throws for an HTTP outcome. `{ ok, status, body, transcript }`, `status: null` = no response at all. Name the response type (or `body` is `unknown`) |
|
|
129
|
+
| `tools.http.json(url, { ucan })` | `await tools.http.json(expected.endpoint, { method: "POST", ucan: true, body })` — signed as this oracle's did:web FOR THAT URL'S HOST; `ucan: { capability }` for your own (in code — never `expected.capability`, the rubric's, which is ignored). An `ixo:` service capability is an error fact |
|
|
130
|
+
| `tools.http.ucanHeaders(audience, capability?)` | the same token as headers, for back-compat — the audience must be the host you call; prefer `json(url, { ucan })` |
|
|
131
|
+
| `tools.ai.judge(instructions, inputs, opts?)` | `return tools.ai.judge(["Shows a passport"], input.inputs);` — the stock judge with YOUR rules; errors when `settings.allowAiChecks` is off |
|
|
132
|
+
| `tools.ai.inputsFor(check)` | `tools.ai.inputsFor(input.check).filter((e) => e.kind === "attachment")` — re-slice what the lane would send |
|
|
133
|
+
| `tools.attachments.on(question)` | `const [photo] = tools.attachments.on("deliveryPhoto");` — by ROOT question name, not `$path` |
|
|
134
|
+
| `tools.attachments.bytes(att, opts?)` | `const body = await tools.attachments.bytes(photo, { maxBytes: 5_000_000 });` → `{ ok: true, bytes } \| { ok: false, reason }` |
|
|
135
|
+
| `tools.attachments.size(att)` | `await tools.attachments.size(photo)` → bytes or `null` |
|
|
136
|
+
| `tools.c2pa.screen(bytes, mediaType?)` | `const prov = await tools.c2pa.screen(body.bytes);` — Content Credentials, `null` when there are none |
|
|
137
|
+
| `tools.chain.linkedResources(entityDid)` | `const [card] = (await tools.chain.linkedResources(did)).filter((r) => r.id === "#acard");` — what an entity anchors on chain, with each resource's `proof` hash |
|
|
138
|
+
| `tools.chain.claimIntent({ agentAddress, collectionId, before, after? })` | `const intent = await tools.chain.claimIntent({ agentAddress, collectionId, before: submittedAt, after: agreed.consentedAt });` → `{ time, transactionHash }` or `null` — the newest `MsgClaimIntent` this agent filed on this collection before `before`, **bare or authz-wrapped** (an intent filed as an authz grantee is nested in a `MsgExec`, which is how the portal and the boilerplate chain client file one). **One server-side filtered query, never a scan**; `null` means it filed none. Pass the agreement's consent time as `after` so an earlier engagement's intent can never become the clock |
|
|
139
|
+
| `tools.chain.query()` | `const q = await tools.chain.query();` — the chain RPC query client (balances, grants, module state). The SDK loads on first call and is memoised per isolate |
|
|
140
|
+
| `tools.agreement(counterparty?)` | `const agreed = await tools.agreement();` — the buyer statement for this collection. **Read it LAST.** Omitted ⇒ the claim's own agent; an explicit `null` ⇒ the collection's own terms. The agreement is read once per claim and shared: every handler in the build sees the same snapshot, at the cost of one engine call. `null` means a real 404 — no agreement on file; a transient engine failure (5xx / `UNAVAILABLE` / `RATE_LIMITED`) throws instead, so don't wrap this call in your own `try/catch` |
|
|
141
|
+
| `tools.logger` | `tools.logger.warn("vendor slow", { name });` — structured, ends up in the oracle's logs |
|
|
142
|
+
| `tools.config` | validated config (`IXO_NETWORK`, hostnames, …) |
|
|
143
|
+
| `tools.env` | YOUR bindings and secrets from `wrangler.jsonc` / `.dev.vars` — where a vendor API key comes from |
|
|
144
|
+
|
|
145
|
+
Two readers come with the API for picking values out of a claim body the way the engine's binder
|
|
146
|
+
does: `readAnswer(answers, "$q.row.col")` and `rootQuestionName("$deliveryPhoto")`.
|
|
147
|
+
|
|
148
|
+
**`tools.chain` is reads only, and an empty answer is a FACT.** An entity that anchors nothing
|
|
149
|
+
answers `[]`. Blocksync being *unreachable* is a different thing and throws, which the runner passes
|
|
150
|
+
through as the step's retry signal — so a chain outage retries instead of freezing a verdict. Catch
|
|
151
|
+
it only if "could not read the chain" is genuinely the fact you mean, and then say so with
|
|
152
|
+
`fact.error`. `tools.agreement()` follows the same rule against the eval engine (task-14): a real
|
|
153
|
+
"no agreement on file" is `null`, a transient engine outage throws.
|
|
154
|
+
|
|
155
|
+
**There is no GENERAL chain message-history read, and you must not build one.** The one thing an
|
|
156
|
+
oracle may look up about what preceded a claim is the agent's own commitment, and `claimIntent` is
|
|
157
|
+
on `tools.chain` precisely so it stays ONE filtered query — the indexer narrows by message type
|
|
158
|
+
(bare intent, or the authz `MsgExec` an intent is normally filed through), by the agent/collection
|
|
159
|
+
inside the message's jsonb `value`, and by time, and hands back at most one row. A handler that
|
|
160
|
+
pages the chain looking for anything is a bug, not a fact. `null` from `claimIntent` is the ANSWER
|
|
161
|
+
"this agent filed no intent"; an outage throws, as above.
|
|
162
|
+
|
|
163
|
+
## What the runner guarantees, for stock and custom alike
|
|
164
|
+
|
|
165
|
+
1. **Normalization** — a plain return becomes a full fact; a `fact.error` draft becomes a full error.
|
|
166
|
+
2. **Fail closed** — an error carries the MANIFEST's `onError`. A throw is an error fact, never an
|
|
167
|
+
approve, never a lost claim — unless it's transient (next point).
|
|
168
|
+
3. **One retry signal** — `fact.retryLater()`, the package's own loud errors, and a retryable
|
|
169
|
+
`EngineError` from the eval engine (5xx / `UNAVAILABLE` / `RATE_LIMITED`, e.g. `tools.agreement()`)
|
|
170
|
+
all get out, as `unavailable`, so the workflow step retries instead of freezing a verdict. A
|
|
171
|
+
deterministic failure is a fact; a transient one is a retry.
|
|
172
|
+
4. **The fact cache** — every `ext`/`ai` answer is cached for the claim, so a step retry after a
|
|
173
|
+
crash never re-buys a paid answer and never re-runs the handler. `unique`/`frequency` never cache.
|
|
174
|
+
5. **The fan-out cap** — at most 4 ext/ai handlers in flight at once; a group is ONE of them,
|
|
175
|
+
however many names it answers.
|
|
176
|
+
6. **Type check** — `validateFacts` refuses the build if a declared name is missing, an `ok` value is
|
|
177
|
+
the wrong type, an error's `onError` was tampered with, or an undeclared name is present.
|
|
178
|
+
|
|
179
|
+
## Testing
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
import { fakeTools, httpResponse, runFacts, sampleClaim, sampleManifest } from "@ixo/decision-oracle/testing";
|
|
183
|
+
|
|
184
|
+
const out = await runFacts(facts, {
|
|
185
|
+
claim: sampleClaim({ reference: "ABC" }, { agentAddress: "ixo1…", attachments: [{ question: "photo", name: "p.jpg", mediaType: "image/jpeg", url: "https://media.example/p.jpg" }] }),
|
|
186
|
+
manifest: sampleManifest({ ext: { deliveryConfirmed: { expect: "boolean", onError: "review" } } }),
|
|
187
|
+
tools: fakeTools({
|
|
188
|
+
http: { "https://courier.example/deliveries/ABC": { status: "delivered" } }, // any value = that body, under a 200
|
|
189
|
+
// httpResponse(503, { error: "down" }) — when the STATUS is the point
|
|
190
|
+
// stock: fact.ai.ok(true), agreement: { id, digest, counterparty, doc }, attachments: { url: bytes }, c2pa: null, env: { VENDOR_KEY: "k" }
|
|
191
|
+
// chain: { linkedResources: { "did:ixo:entity:…": [{ id: "#acard", proof: "…" }] }, claimIntent: { time, transactionHash } | null | ((params) => …), query }
|
|
192
|
+
}),
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
expect(out.issues).toEqual([]); // empty ⇔ the engine would accept this FactSet
|
|
196
|
+
expect(out.ext.deliveryConfirmed).toMatchObject({ status: "ok", value: true });
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
An AI check is declared with its instructions, and a handler that wraps the stock judge is tested by
|
|
200
|
+
canning that judge:
|
|
201
|
+
|
|
202
|
+
```ts
|
|
203
|
+
manifest: sampleManifest({ ai: { photoLooksReal: { instructions: ["Shows a passport"], onError: "review" } } }),
|
|
204
|
+
tools: fakeTools({ stock: fact.ai.ok(true, { score: 90 }) }),
|
|
205
|
+
// …and the failure half: fakeTools({ stock: fact.ai.ok(true) }) with a claim that has no photo,
|
|
206
|
+
// asserting the handler answered `{ status: "error", onError: "review", detail: … }` anyway.
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
`runFacts` runs the SAME runner production runs, then the SAME `validateFacts` — minus the cache and
|
|
210
|
+
D1. `fakeTools().logs` collects what the handler logged, and `fakeTools().chainCalls` every
|
|
211
|
+
`tools.chain` call in order (`{ call: "linkedResources", entityDid }` / `{ call: "claimIntent", params }`
|
|
212
|
+
/ `{ call: "query" }`) — assert on what your handler asked for. An unlisted entity DID answers
|
|
213
|
+
`[]` and `claimIntent` answers `null`, as on chain; give `claimIntent` a FUNCTION when the test is
|
|
214
|
+
about what was asked, or to throw and stand in for an outage. `chain.query()` throws "not available
|
|
215
|
+
in tests" unless you supply a client. An
|
|
216
|
+
unmatched URL is a network failure
|
|
217
|
+
(`ok: false`, `status: null`), which is exactly the case worth testing. `sampleCtx({ now })` fixes
|
|
218
|
+
the clock. There is no stock lane behind a test: `tools.stock()` answers an error fact unless you
|
|
219
|
+
pass `stock`, and `runFacts({ stock: { ext, ai } })` overrides a whole lane.
|
|
220
|
+
|
|
221
|
+
## Gotchas
|
|
222
|
+
|
|
223
|
+
- **`tools.stock()` needs no cast** — it is typed to the lane's OWN fact: an `ExtFact` in an `ext`
|
|
224
|
+
handler, an `AiFact` in an `ai` one, so `return tools.stock()` type-checks as it stands. Only
|
|
225
|
+
`unique`/`frequency`/grouped handlers see the bare `ExtFact | AiFact` union, and there `stock()`
|
|
226
|
+
throws by design — such a handler REPLACES the lane for every name it answers.
|
|
227
|
+
- **Money and scores are integers** — basis points 0..10000 for a `score` fact, whole cents for USD
|
|
228
|
+
comparisons. Never float equality.
|
|
229
|
+
- **`send` vs the endpoint** — if you call the declared endpoint yourself, do NOT also call
|
|
230
|
+
`tools.stock()`: that is two calls (and two charges) for one fact.
|
|
231
|
+
- **`ctx.now`, not `Date.now()`** — the engine's date rules compare against the frozen `ctx.now`;
|
|
232
|
+
a second clock read makes a fact that cannot be replayed.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Local secrets for `wrangler dev`. Copy to `.dev.vars` (git-ignored) and fill in.
|
|
2
|
+
# Non-secret config lives in wrangler.jsonc `vars`. Real secrets in production are
|
|
3
|
+
# set with: wrangler secret put <NAME>
|
|
4
|
+
#
|
|
5
|
+
# Every secret is optional so the Worker boots (health, did.json) without them; each lane fails
|
|
6
|
+
# loudly (or no-ops, where noted) at the point of use when its secret is missing.
|
|
7
|
+
|
|
8
|
+
# --- This oracle's identities ---
|
|
9
|
+
# did:web key: SHA256(mnemonic) → Ed25519 seed. Signs every UCAN invocation this oracle mints
|
|
10
|
+
# (to the eval engine, the claim bot, the UCAN Store) and backs /.well-known/did.json.
|
|
11
|
+
SERVICE_ED25519_MNEMONIC="twelve word mnemonic ..."
|
|
12
|
+
# Chain signer (secp256k1) — signs `MsgEvaluateClaim`. Must be the wallet behind ORACLE_ADDRESS
|
|
13
|
+
# in wrangler.jsonc. Unset ⇒ the chain-write lane logs one line and skips.
|
|
14
|
+
# Both of these, and the three public vars derived from the second, come from:
|
|
15
|
+
# bunx decision-oracle derive --new
|
|
16
|
+
ORACLE_SECP_MNEMONIC="twelve word mnemonic ..."
|
|
17
|
+
# The oracle OWNER's UCAN delegation to the decision engine (base64 CAR), posted once at register
|
|
18
|
+
# so the engine can find (and bill) their subscription. Mint it as the owner with
|
|
19
|
+
# `bunx decision-oracle delegation --for engine --audience <engine did:web> --oracle <this did:web>`
|
|
20
|
+
# (after `bunx decision-oracle login --network <n>`, once — the AuthHub login of the subscriber).
|
|
21
|
+
# Unset ⇒ register refuses, loudly. A 402 at register means: open the portal at the printed URL,
|
|
22
|
+
# buy credits, then register again.
|
|
23
|
+
OWNER_DELEGATION_CAR="uCAR..."
|
|
24
|
+
# The oracle bot's Matrix access token (the ORACLE_MATRIX_USER_ID account). Read by the
|
|
25
|
+
# review-notification lane; unset ⇒ that lane logs and skips. You do NOT obtain this yourself:
|
|
26
|
+
# `bunx decision-oracle oracle init` creates the account and writes this line, in place, for you
|
|
27
|
+
# (deployed: wrangler secret put ORACLE_MATRIX_ACCESS_TOKEN).
|
|
28
|
+
# ORACLE_MATRIX_ACCESS_TOKEN= # unset = Matrix lane off; an empty string is refused by the config schema
|
|
29
|
+
# ORACLE_ENTITY_DID is NOT here: it is public config, so it lives in wrangler.jsonc `vars` (already
|
|
30
|
+
# there, "" until `bunx decision-oracle oracle init` declares the entity) — one value per environment.
|
|
31
|
+
|
|
32
|
+
# --- Connectors ---
|
|
33
|
+
# AI checks + the duplicate lane's same-event judge. Default provider: the Cloudflare AI Gateway —
|
|
34
|
+
# the `ai` binding + AI_GATEWAY_ID (wrangler.jsonc); nothing secret here. `facts run` in a
|
|
35
|
+
# terminal has no binding, so it calls the gateway's REST endpoint with these two:
|
|
36
|
+
# CLOUDFLARE_ACCOUNT_ID="..."
|
|
37
|
+
# CLOUDFLARE_API_TOKEN="..." # Workers AI: Read
|
|
38
|
+
# Only with AI_PROVIDER=openrouter:
|
|
39
|
+
# OPENROUTER_API_KEY="sk-or-..."
|
|
40
|
+
# HMAC key for the duplicate-detection body digest (a rubric declaring `unique`). Keep it for the
|
|
41
|
+
# oracle's lifetime — rotating it orphans every registered digest. Generate one with:
|
|
42
|
+
# openssl rand -base64 32
|
|
43
|
+
UNIQUE_HMAC_KEY="change-me-to-a-long-random-string"
|
|
44
|
+
|
|
45
|
+
# --- Decision API lane ---
|
|
46
|
+
# The lane (paid, off-chain claims at /v1/api) is switched by API_LANE in wrangler.jsonc — per env,
|
|
47
|
+
# "false" by default. Its only secret:
|
|
48
|
+
# Encrypts webhook signing secrets at rest (every endpoint's, and each source's own) — one per
|
|
49
|
+
# deployment, kept for its lifetime (rotating it strands every stored secret). REQUIRED when
|
|
50
|
+
# API_LANE is on: the worker refuses to start without it. Generate one with:
|
|
51
|
+
# openssl rand -base64 32
|
|
52
|
+
# (deployed: wrangler secret put WEBHOOK_ENCRYPTION_KEY [--env testnet|production])
|
|
53
|
+
# WEBHOOK_ENCRYPTION_KEY="change-me-to-a-long-random-string"
|
|
54
|
+
# Where your earnings land is NOT a secret: EARNINGS_ADDRESS (ixo1…, PAY and USDC on IXO) and
|
|
55
|
+
# EARNINGS_BASE_WALLET (0x…, USDC on Base) live in wrangler.jsonc `vars`, per env. Each offer names
|
|
56
|
+
# them as its payTo; a way to pay whose address is unset is not offered. For `wrangler dev` only:
|
|
57
|
+
# EARNINGS_ADDRESS="ixo1..."
|
|
58
|
+
|
|
59
|
+
# --- Observability ---
|
|
60
|
+
# Sentry DSN. Unset ⇒ error reporting is a no-op (local dev and CI never ship events).
|
|
61
|
+
# SENTRY_DSN= # unset = Sentry off; an empty string is refused by the config schema
|
|
62
|
+
# Sentry tuning. Not secrets — deployed, they live in wrangler.jsonc `vars` per env; set them here
|
|
63
|
+
# only to try them under `wrangler dev`. Unset ⇒ 0.1 of requests traced, environment = ENVIRONMENT.
|
|
64
|
+
# SENTRY_TRACES_SAMPLE_RATE="1"
|
|
65
|
+
# SENTRY_ENVIRONMENT="local"
|
|
66
|
+
# A Slack-compatible incoming webhook for ops alerts (a paused collection, a dead webhook, a lost
|
|
67
|
+
# settlement, a failing cron job) — one message per condition per 30 minutes. The URL is the
|
|
68
|
+
# credential. Unset ⇒ alerts reach Sentry only (nowhere without SENTRY_DSN).
|
|
69
|
+
# OPS_ALERT_WEBHOOK_URL= # unset = no Slack alerts; an empty string counts as unset
|
|
70
|
+
# Read-only access to GET /v1/admin/status for a monitoring service (e.g. your decision engine's
|
|
71
|
+
# status board), by its DID of any method. Not a secret — deployed, it lives in wrangler.jsonc `vars`;
|
|
72
|
+
# set it here only to try it under `wrangler dev`. Unset ⇒ only ORACLE_ADMIN_DIDS can read the status.
|
|
73
|
+
# STATUS_READER_DIDS="did:web:<monitor host>"
|
|
74
|
+
|
|
75
|
+
# --- Local dev logging ---
|
|
76
|
+
# Pretty, colorized log lines for the terminal. Local-only: this file is never
|
|
77
|
+
# uploaded, so deployed envs always emit JSON (what Workers Logs ingests).
|
|
78
|
+
LOG_PRETTY="true"
|
|
79
|
+
|
|
80
|
+
# --- Local harness / self-hosted stacks ---
|
|
81
|
+
# When your claim bot is NOT reachable at the derived
|
|
82
|
+
# `https://claim.bot.<homeserver domain>` (e.g. a local testing harness runs
|
|
83
|
+
# it on a plain host:port), set the URL to use as-is. Never set in deployed
|
|
84
|
+
# environments — the derivation is the production behavior.
|
|
85
|
+
# CLAIM_BOT_URL_OVERRIDE="http://localhost:34083"
|
|
86
|
+
|
|
87
|
+
# EVAL_ENGINE_HOSTNAME is normally left unset and defaults per IXO_NETWORK.
|
|
88
|
+
# Set it here ONLY to point at a local engine or a tunnel instead of the network's real engine:
|
|
89
|
+
# EVAL_ENGINE_HOSTNAME="localhost:8787"
|
|
90
|
+
|
|
91
|
+
# AUTH_HUB_URL (the OAuth server of /v1/mcp) also defaults per IXO_NETWORK. Set it ONLY for a
|
|
92
|
+
# local AuthHub; its did:web is then the one the approvals back-channel accepts:
|
|
93
|
+
# AUTH_HUB_URL="http://localhost:8787"
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
Guidance for Claude Code working in this repository.
|
|
4
|
+
|
|
5
|
+
## What this is
|
|
6
|
+
|
|
7
|
+
`{{name}}` — an IXO **evaluation oracle** on Cloudflare Workers, built on `@ixo/decision-oracle`. It
|
|
8
|
+
pulls claims from the collections it was hired for, produces the **facts** the collection's rubric
|
|
9
|
+
asks for, sends them to the IXO decision engine, and signs the verdict on chain.
|
|
10
|
+
|
|
11
|
+
## Ours, and the package's
|
|
12
|
+
|
|
13
|
+
- `src/facts/index.ts` (and anything it imports) is **the work**: one handler per fact name the
|
|
14
|
+
rubric declares and the stock lane cannot answer. Everything a handler needs is injected as
|
|
15
|
+
`tools`; handler files import only `@ixo/decision-oracle/facts` (`defineFacts`, `fact`, types).
|
|
16
|
+
- `src/index.ts` declares what this oracle is: name, `supportedProtocols`, `pricing`, `policies`.
|
|
17
|
+
- `wrangler.jsonc` + `.dev.vars` are deployment: bindings, network, identity, secrets. Binding and
|
|
18
|
+
var names are the package's contract — never rename them.
|
|
19
|
+
- Everything else — claim pulling, the engine handshake, the D1 ledgers, review folds, the chain
|
|
20
|
+
write, billing pauses, notifications — is `@ixo/decision-oracle`. Read its README before rebuilding.
|
|
21
|
+
- The package ships its own docs: `node_modules/@ixo/decision-oracle/docs/api.md` (the complete
|
|
22
|
+
reference — every export, option, default and cap) and `.../docs/guide.md` (building and
|
|
23
|
+
operating an oracle, end to end). Read those before guessing at an import or a default.
|
|
24
|
+
|
|
25
|
+
## Skills
|
|
26
|
+
|
|
27
|
+
`.claude/skills/` holds the skills shipped with the package — `create-oracle` (the build runbook),
|
|
28
|
+
`write-facts` (one fact handler at a time), `create-rubric`, `publish-protocol`,
|
|
29
|
+
`create-collection`, `decision-api-oracle` (the Decision API lane: deploy, register, verify). Use
|
|
30
|
+
them for those workflows rather than improvising, and refresh them after upgrading:
|
|
31
|
+
`bunx decision-oracle skills sync`.
|
|
32
|
+
|
|
33
|
+
## The two rules
|
|
34
|
+
|
|
35
|
+
1. **Never fake an ok.** A fact that could not be established is `fact.error(detail)`, never `false`
|
|
36
|
+
and never a guess — the rubric's own `onError` decides what it means. A handler that turns a
|
|
37
|
+
failure into an approval is the one unrecoverable bug in an oracle.
|
|
38
|
+
2. **Never decide here.** No rubric parsing, no thresholds, no gates, no binding to the claim form.
|
|
39
|
+
The engine judges; this project produces facts and signs.
|
|
40
|
+
|
|
41
|
+
## Working here
|
|
42
|
+
|
|
43
|
+
- `bun run check` before you finish; `bun run cf-typegen` after any `wrangler.jsonc` binding or var
|
|
44
|
+
change. Handler tests are plain vitest with `@ixo/decision-oracle/testing` — never real network.
|
|
45
|
+
Comments explain **why** (an invariant, a source's quirk), not what.
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# {{name}}
|
|
2
|
+
|
|
3
|
+
An IXO **evaluation oracle**, built on
|
|
4
|
+
[`@ixo/decision-oracle`](https://www.npmjs.com/package/@ixo/decision-oracle). It pulls each new claim from
|
|
5
|
+
the collections you were hired for, produces the **facts** the collection's rubric asks for, sends
|
|
6
|
+
them to the IXO **decision engine** — the deterministic decider you pay per decision — and signs
|
|
7
|
+
the verdict on chain with your own key.
|
|
8
|
+
|
|
9
|
+
The rubric is the work order. The engine decides. You produce facts and sign.
|
|
10
|
+
|
|
11
|
+
Everything else — pulling claims, the engine handshake, the D1 ledgers, review folds, the chain
|
|
12
|
+
write, billing pauses, email and Matrix notices — is the package's. What is yours is three files:
|
|
13
|
+
|
|
14
|
+
| File | What it is |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| `src/index.ts` | what this oracle IS: its listing, its price, its policies |
|
|
17
|
+
| `src/facts/index.ts` | how it produces the facts a rubric asks for — the only oracle-specific code |
|
|
18
|
+
| `wrangler.jsonc` | where it runs: bindings, the network, its identity |
|
|
19
|
+
|
|
20
|
+
## 1. Install
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
bun install
|
|
24
|
+
bun run cf-typegen # generates worker-configuration.d.ts from wrangler.jsonc
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 2. Storage
|
|
28
|
+
|
|
29
|
+
Create the two bindings and paste their ids into `wrangler.jsonc` (once per env you deploy):
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
wrangler d1 create {{name}}
|
|
33
|
+
wrangler kv namespace create CACHE_KV
|
|
34
|
+
bun run db:migrate # applies the package's migrations to the local D1
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The schema ships with `@ixo/decision-oracle` — `migrations_dir` points into `node_modules`, so you
|
|
38
|
+
never write a migration.
|
|
39
|
+
|
|
40
|
+
## 3. Identity — two keys, two DIDs
|
|
41
|
+
|
|
42
|
+
`bunx decision-oracle derive --new` prints a fresh mnemonic and the three public vars derived from it.
|
|
43
|
+
Secrets go in `.dev.vars` locally (`cp .dev.vars.example .dev.vars`) and via
|
|
44
|
+
`wrangler secret put <NAME>` once deployed; their public halves are `vars` in `wrangler.jsonc`.
|
|
45
|
+
|
|
46
|
+
| Secret | Derives | Public var(s) in `wrangler.jsonc` |
|
|
47
|
+
| --- | --- | --- |
|
|
48
|
+
| `SERVICE_ED25519_MNEMONIC` | the did:web key — `SHA256(mnemonic)` → Ed25519 | `ORACLE_HOSTNAME` — the host `did:web:<host>` is served from |
|
|
49
|
+
| `ORACLE_SECP_MNEMONIC` | the chain wallet (cosmos path, `ixo` prefix) that signs `MsgEvaluateClaim` | `ORACLE_ADDRESS` (its `ixo1…` address), `ORACLE_DID` (`did:ixo:<address>`), `ORACLE_MATRIX_USER_ID` (`@did-ixo-<address>:<homeserver>`) |
|
|
50
|
+
| _(none)_ | `ORACLE_ENTITY_DID` — the on-chain oracle ENTITY (step 7), not a key; the portal resolves this oracle from its `#eval` service, so a review card's `oracleDid` must be it | `ORACLE_ENTITY_DID` (optional; unset ⇒ `ORACLE_DID`, portal-page review only) |
|
|
51
|
+
| `OWNER_DELEGATION_CAR` | not derived — forwarded verbatim at register; the engine bills the OWNER's credits per decision, never this oracle's wallet | none — minted by the owner with `bunx decision-oracle login` then `bunx decision-oracle delegation --for engine` |
|
|
52
|
+
|
|
53
|
+
`ORACLE_ADDRESS` is asserted against the mnemonic at first use — a mismatch fails loud, never signs
|
|
54
|
+
as someone else.
|
|
55
|
+
|
|
56
|
+
## 4. The work order
|
|
57
|
+
|
|
58
|
+
A rubric is authored and anchored on chain against a protocol; the engine turns it into a
|
|
59
|
+
**manifest** — the list of `ext.<name>` and `ai.<name>` facts your oracle must produce, with the
|
|
60
|
+
type each expects and what happens when one cannot be answered. Ask for it in plain words:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
bunx decision-oracle protocol review <protocol did>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Every declared name has a **stock** lane already: an external source becomes a UCAN-signed POST to
|
|
67
|
+
the endpoint the rubric declares, an AI check runs the configured AI provider (Cloudflare AI Gateway by default) with the rubric's own instructions.
|
|
68
|
+
You only write a handler for the names stock cannot answer — typically anything that needs YOUR
|
|
69
|
+
system, or a value the rubric derives.
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
bunx decision-oracle facts scaffold <protocol did> # stubs + tests for exactly those names
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## 5. Write the handlers
|
|
76
|
+
|
|
77
|
+
One name, one function. Return a plain value for the happy path; return `fact.error(detail)` when
|
|
78
|
+
the truth is unreachable — the runner stamps the rubric's own `onError` (a handler can never turn
|
|
79
|
+
a failure into an approval, and can never pick a different `onError`).
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import { defineFacts, fact } from "@ixo/decision-oracle/facts";
|
|
83
|
+
|
|
84
|
+
export const facts = defineFacts({
|
|
85
|
+
ext: {
|
|
86
|
+
// input: { name, expected, send, unresolved, claim, answers, ctx, settings, manifest }
|
|
87
|
+
deliveryConfirmed: async ({ send }, tools) => {
|
|
88
|
+
const res = await tools.http.json<{ status: string }>(
|
|
89
|
+
`https://courier.example/deliveries/${send.reference}`,
|
|
90
|
+
);
|
|
91
|
+
if (!res.ok) return fact.error(`courier responded ${res.status}`);
|
|
92
|
+
return res.body?.status === "delivered"; // boolean | number ⇒ an `ok` fact
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
ai: {
|
|
96
|
+
// "*" answers every AI check you did not name; `tools.stock()` runs the lane you would replace
|
|
97
|
+
// "*": async (_input, tools) => tools.stock(),
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The `tools` a handler is handed:
|
|
103
|
+
|
|
104
|
+
| Tool | For |
|
|
105
|
+
| --- | --- |
|
|
106
|
+
| `tools.stock()` | run the stock lane for this very fact (wrap it, don't reimplement it) |
|
|
107
|
+
| `tools.http.json(url, init?)` | a JSON request with retries, a timeout, the SSRF guard and a recorded transcript — never throws for an HTTP outcome |
|
|
108
|
+
| `tools.http.json(url, { ucan: true })` | the call signed as this oracle for that URL's host, for a source that authenticates you — capability `ixo:external-source`; `ucan: { capability }` for your own (never the rubric's `expected.capability`) |
|
|
109
|
+
| `tools.ai.judge(instructions, inputs)` | the stock judge with YOUR rules |
|
|
110
|
+
| `tools.attachments.on(question)` / `.bytes(att)` | the claim's files |
|
|
111
|
+
| `tools.c2pa.screen(bytes)` | Content Credentials on an image |
|
|
112
|
+
| `tools.agreement()` | the buyer's statement for this collection — read it LAST |
|
|
113
|
+
| `tools.logger`, `tools.config`, `tools.env` | logging and your own bindings/secrets |
|
|
114
|
+
|
|
115
|
+
`throw fact.retryLater(detail)` when a source is temporarily down: the workflow step retries and
|
|
116
|
+
the facts already answered are kept. Anything else that throws becomes an `error` fact, logged.
|
|
117
|
+
|
|
118
|
+
Test them without a Worker — plain vitest, fake tools:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
bun run test
|
|
122
|
+
bunx decision-oracle facts run --protocol <protocol did> --claim claim.json --preview
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
`claim.json` is a flat answers object under the question names the rubric reads — or the full
|
|
126
|
+
`{ answers, attachments }` envelope when the claim carries files. `--preview` asks the engine for
|
|
127
|
+
the decision your facts would produce, without recording anything.
|
|
128
|
+
|
|
129
|
+
## 6. Run it
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
bun run dev # local D1 under .wrangler/state; --test-scheduled, so you can fire the cron:
|
|
133
|
+
curl "http://localhost:8787/__scheduled?cron=*+*+*+*+*"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
`GET /v1/info` is your public listing; `GET /.well-known/did.json` is your identity. Everything
|
|
137
|
+
under `/v1` requires a UCAN invocation addressed to `did:web:<ORACLE_HOSTNAME>`.
|
|
138
|
+
|
|
139
|
+
## 7. Deploy and declare yourself on chain
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
bun run deploy # or deploy:testnet / deploy:production
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
The Custom Domain in `routes` must equal `ORACLE_HOSTNAME` — the did:web document is served from
|
|
146
|
+
it, and that is how anyone verifies who you are.
|
|
147
|
+
|
|
148
|
+
`GET /v1/info` only answers a portal that already knows your host. For discovery that starts from
|
|
149
|
+
the protocol, declare yourself on chain — an oracle entity, a `#eval` service pointing at your
|
|
150
|
+
host, a `linkedEntity` per supported protocol, and the back-link on the protocol itself:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
bunx decision-oracle login # once per network (AuthHub)
|
|
154
|
+
bunx decision-oracle oracle init --protocol <protocol did> --kit-url https://<your host>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Ownership vs. runtime identity: the oracle entity is owned by whoever logged in via AuthHub;
|
|
158
|
+
`ORACLE_ADDRESS` / `ORACLE_DID` stay this oracle's runtime identity — what signs `MsgEvaluateClaim`
|
|
159
|
+
and what a commissioner's grant must name. Put the entity DID it prints in `ORACLE_ENTITY_DID`.
|
|
160
|
+
|
|
161
|
+
Keep `supportedProtocols` in `src/index.ts` in lockstep with what you declared on chain: register
|
|
162
|
+
enforces only the config side, so a protocol declared on chain but missing from the config (or the
|
|
163
|
+
reverse) is a drift nothing can see for you.
|
|
164
|
+
|
|
165
|
+
## 8. Get hired
|
|
166
|
+
|
|
167
|
+
A commissioner grants `ORACLE_ADDRESS` an `EvaluateClaimAuthorization` on their collection (the
|
|
168
|
+
portal's Grant Role flow) and registers it with you:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
bunx decision-oracle register --collection <collection id>
|
|
172
|
+
bunx decision-oracle scan --collection <collection id> # discover + start now, instead of next tick
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Registration is refused, loudly, unless the collection's on-chain evaluation payment meets your
|
|
176
|
+
fee — `EVALUATION_DENOM` / `EVALUATION_MIN_AMOUNT` in `wrangler.jsonc` (per env: a `uixo` stand-in
|
|
177
|
+
on devnet/testnet, real USDC on mainnet, where they are required), else the `pricing` in
|
|
178
|
+
`src/index.ts`. That payment is how you earn.
|
|
179
|
+
|
|
180
|
+
## Commands
|
|
181
|
+
|
|
182
|
+
| Command | What it does |
|
|
183
|
+
| --- | --- |
|
|
184
|
+
| `bun run dev` | `wrangler dev` with a local D1 and the cron fireable by hand |
|
|
185
|
+
| `bun run check` | typecheck + lint + tests — run before you finish |
|
|
186
|
+
| `bun run test` | handler tests (plain node, no Worker) |
|
|
187
|
+
| `bun run cf-typegen` | REQUIRED after any `wrangler.jsonc` binding/var change |
|
|
188
|
+
| `bun run db:migrate` / `db:migrate:remote` | apply the package's migrations locally / to the deployed D1 |
|
|
189
|
+
| `bun run build` | dry-run deploy — bundle validation |
|
|
190
|
+
| `bun run deploy[:testnet\|:production]` | deploy the named env |
|
|
191
|
+
| `bunx decision-oracle --help` | the full CLI (identity, protocol, facts, register, scan) |
|
|
192
|
+
| `bunx decision-oracle skills sync` | refresh `.claude/skills/` from the installed package |
|
|
193
|
+
|
|
194
|
+
## The two rules
|
|
195
|
+
|
|
196
|
+
1. **Never fake an ok.** A fact you could not establish is `fact.error(detail)` — the rubric decides
|
|
197
|
+
what that means. Returning `false` says "I checked, and it is false".
|
|
198
|
+
2. **Never decide here.** This oracle produces facts and signs the verdict; the engine judges them
|
|
199
|
+
against the live claim form. No rubric parsing, no thresholds, no gates in this project.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.5.3/schema.json",
|
|
3
|
+
"vcs": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"clientKind": "git",
|
|
6
|
+
"useIgnoreFile": true
|
|
7
|
+
},
|
|
8
|
+
"files": {
|
|
9
|
+
"ignoreUnknown": true,
|
|
10
|
+
"includes": ["**", "!worker-configuration.d.ts", "!dist", "!.wrangler", "!protocol"]
|
|
11
|
+
},
|
|
12
|
+
"formatter": {
|
|
13
|
+
"enabled": true,
|
|
14
|
+
"indentStyle": "space",
|
|
15
|
+
"indentWidth": 2,
|
|
16
|
+
"lineWidth": 100
|
|
17
|
+
},
|
|
18
|
+
"assist": {
|
|
19
|
+
"actions": {
|
|
20
|
+
"source": {
|
|
21
|
+
"organizeImports": "on"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"linter": {
|
|
26
|
+
"enabled": true,
|
|
27
|
+
"rules": {
|
|
28
|
+
"preset": "recommended"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"javascript": {
|
|
32
|
+
"formatter": {
|
|
33
|
+
"quoteStyle": "double",
|
|
34
|
+
"semicolons": "always"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# deps
|
|
2
|
+
node_modules/
|
|
3
|
+
|
|
4
|
+
# build output (`bun run build` — the wrangler dry-run bundle)
|
|
5
|
+
dist/
|
|
6
|
+
|
|
7
|
+
# wrangler / local runtime state (includes the local D1 database under .wrangler/state)
|
|
8
|
+
.wrangler/
|
|
9
|
+
|
|
10
|
+
# secrets: .dev.vars is read by `wrangler dev` and never uploaded — keep the example, never the file
|
|
11
|
+
.dev.vars
|
|
12
|
+
.dev.vars.*
|
|
13
|
+
!.dev.vars.example
|
|
14
|
+
|
|
15
|
+
# generated binding types (regenerate with `bun run cf-typegen`)
|
|
16
|
+
worker-configuration.d.ts
|
|
17
|
+
|
|
18
|
+
# UCAN delegation CARs — credentials, never committed
|
|
19
|
+
*.car
|
|
20
|
+
|
|
21
|
+
# host tooling env
|
|
22
|
+
.env
|
|
23
|
+
.env.*
|
|
24
|
+
!.env.example
|
|
25
|
+
|
|
26
|
+
# logs / misc
|
|
27
|
+
*.log
|
|
28
|
+
.DS_Store
|
|
29
|
+
coverage/
|