@redditech/agent-protocol 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.
Files changed (55) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/LICENSE +21 -0
  3. package/README.md +394 -2
  4. package/dist/adl.d.ts +141 -0
  5. package/dist/adl.js +3601 -0
  6. package/dist/agent-stack-fixtures.d.ts +743 -0
  7. package/dist/agent-stack-fixtures.js +1554 -0
  8. package/dist/ai-catalog.d.ts +128 -0
  9. package/dist/ai-catalog.js +373 -0
  10. package/dist/attestation-reputation.d.ts +102 -0
  11. package/dist/attestation-reputation.js +279 -0
  12. package/dist/audd-rail-config.d.ts +102 -0
  13. package/dist/audd-rail-config.js +294 -0
  14. package/dist/browser-wallet-approval.d.ts +293 -0
  15. package/dist/browser-wallet-approval.js +1201 -0
  16. package/dist/discovery-source.d.ts +115 -0
  17. package/dist/discovery-source.js +251 -0
  18. package/dist/evidence-archive.d.ts +73 -0
  19. package/dist/evidence-archive.js +238 -0
  20. package/dist/index.d.ts +23 -0
  21. package/dist/index.js +23 -0
  22. package/dist/mpp-tempo-receipt-shapes.d.ts +201 -0
  23. package/dist/mpp-tempo-receipt-shapes.js +330 -0
  24. package/dist/okf-adapter.d.ts +229 -0
  25. package/dist/okf-adapter.js +556 -0
  26. package/dist/okf-conformance.d.ts +208 -0
  27. package/dist/okf-conformance.js +651 -0
  28. package/dist/okf-instruction-safety.d.ts +192 -0
  29. package/dist/okf-instruction-safety.js +509 -0
  30. package/dist/onboarding-analyser-handoff.d.ts +391 -0
  31. package/dist/onboarding-analyser-handoff.js +959 -0
  32. package/dist/onboarding-state-machine.d.ts +228 -0
  33. package/dist/onboarding-state-machine.js +432 -0
  34. package/dist/payment-records.d.ts +181 -0
  35. package/dist/payment-records.js +599 -0
  36. package/dist/policy.d.ts +33 -0
  37. package/dist/policy.js +45 -0
  38. package/dist/provider-trust.d.ts +113 -0
  39. package/dist/provider-trust.js +346 -0
  40. package/dist/quasar-registry-compatibility.d.ts +113 -0
  41. package/dist/quasar-registry-compatibility.js +214 -0
  42. package/dist/ranking-explainability.d.ts +202 -0
  43. package/dist/ranking-explainability.js +302 -0
  44. package/dist/receipt-v2.d.ts +202 -0
  45. package/dist/receipt-v2.js +418 -0
  46. package/dist/repo-explorer-evidence-manifest.d.ts +387 -0
  47. package/dist/repo-explorer-evidence-manifest.js +1187 -0
  48. package/dist/source-diagnostics.d.ts +84 -0
  49. package/dist/source-diagnostics.js +193 -0
  50. package/dist/source-trust-conformance-matrix.d.ts +207 -0
  51. package/dist/source-trust-conformance-matrix.js +672 -0
  52. package/examples/ard-no-spend-ai-catalog.json +51 -0
  53. package/examples/ard-no-spend-demo.mjs +355 -0
  54. package/examples/interpretation-guide-scenarios.mjs +302 -0
  55. package/package.json +144 -4
@@ -0,0 +1,181 @@
1
+ export declare const REDDI_PAYMENT_CANONICALIZATION: "reddi.canonical-json.sha256.v1";
2
+ export declare const REDDI_PAYMENT_JOB_SCHEMA_VERSION: "reddi.payment-job.v1";
3
+ export declare const REDDI_PAYMENT_AGREEMENT_SCHEMA_VERSION: "reddi.payment-agreement.v1";
4
+ export declare const REDDI_PAYMENT_INTENT_SCHEMA_VERSION: "reddi.payment-intent.v1";
5
+ export declare const REDDI_PAYMENT_OBSERVATION_SCHEMA_VERSION: "reddi.payment-observation.v1";
6
+ export declare const REDDI_REFUND_RECORD_SCHEMA_VERSION: "reddi.refund-record.v1";
7
+ export type ReddiPaymentEnvironmentLabel = 'deterministic-fixture' | 'local-test-mint' | 'devnet-unverified' | 'mainnet-gated' | 'controlled-live';
8
+ export type ReddiPaymentEligibilityLabel = 'non_eligible' | 'pending_partner_acceptance' | 'eligible' | 'excluded';
9
+ export type ReddiPaymentRecordLabels = {
10
+ environment: ReddiPaymentEnvironmentLabel;
11
+ eligibility: ReddiPaymentEligibilityLabel;
12
+ exclusionReason?: string;
13
+ partnerAcceptanceRef?: string;
14
+ };
15
+ export type ReddiCanonicalNetworkRef = {
16
+ caip2: string;
17
+ rapAlias?: string;
18
+ };
19
+ export type ReddiPaymentRecordValidationErrorCode = 'malformed_record' | 'malformed_labels' | 'non_live_evidence_marked_eligible' | 'mainnet_partner_acceptance_missing' | 'model_spend_authority_rejected' | 'audd_rail_identity_mismatch' | 'audd_rail_label_mismatch';
20
+ export type ReddiPaymentRecordValidationError = {
21
+ code: ReddiPaymentRecordValidationErrorCode;
22
+ path: string;
23
+ message: string;
24
+ };
25
+ export type ReddiPaymentRecordValidationResult<T> = {
26
+ ok: true;
27
+ record: T;
28
+ } | {
29
+ ok: false;
30
+ errors: ReddiPaymentRecordValidationError[];
31
+ };
32
+ export type ReddiPaymentJobRecord = {
33
+ schemaVersion: typeof REDDI_PAYMENT_JOB_SCHEMA_VERSION;
34
+ id: string;
35
+ canonicalization: typeof REDDI_PAYMENT_CANONICALIZATION;
36
+ labels: ReddiPaymentRecordLabels;
37
+ requestDisclosureHash: string;
38
+ sourceId: string;
39
+ specialistId: string;
40
+ nonce: string;
41
+ createdAt?: string;
42
+ };
43
+ export type ReddiPaymentAgreementRecord = {
44
+ schemaVersion: typeof REDDI_PAYMENT_AGREEMENT_SCHEMA_VERSION;
45
+ id: string;
46
+ canonicalization: typeof REDDI_PAYMENT_CANONICALIZATION;
47
+ labels: ReddiPaymentRecordLabels;
48
+ jobId: string;
49
+ signedOfferHash: string;
50
+ buyerPolicyDecisionHash: string;
51
+ sellerTermsHash: string;
52
+ quoteExpiresAt: string;
53
+ createdAt?: string;
54
+ };
55
+ export type ReddiPaymentIntentAuthorizationState = 'model_draft' | 'policy_approved' | 'operator_approved';
56
+ export type ReddiPaymentIntentAuthorization = {
57
+ state: ReddiPaymentIntentAuthorizationState;
58
+ /** The model may draft an intent, but it is never a spending authority. */
59
+ modelMayAuthorize: false;
60
+ operatorApprovalRequired: boolean;
61
+ policyDecisionRef?: string;
62
+ operatorApprovalRef?: string;
63
+ approvedAt?: string;
64
+ };
65
+ export type ReddiPaymentIntentRecord = {
66
+ schemaVersion: typeof REDDI_PAYMENT_INTENT_SCHEMA_VERSION;
67
+ id: string;
68
+ canonicalization: typeof REDDI_PAYMENT_CANONICALIZATION;
69
+ labels: ReddiPaymentRecordLabels;
70
+ agreementId: string;
71
+ network: ReddiCanonicalNetworkRef;
72
+ asset: {
73
+ symbol: string;
74
+ mint?: string;
75
+ tokenProgram?: string;
76
+ decimals?: number;
77
+ amountBaseUnits: string;
78
+ };
79
+ payTo: string;
80
+ destinationTokenAccount?: string;
81
+ memo?: string;
82
+ evidenceRequired: boolean;
83
+ quoteExpiresAt: string;
84
+ expiresAt: string;
85
+ refundPolicy: {
86
+ mode: 'none' | 'automatic' | 'manual_review';
87
+ description: string;
88
+ refundAddress?: string;
89
+ };
90
+ authorization: ReddiPaymentIntentAuthorization;
91
+ createdAt?: string;
92
+ };
93
+ export type ReddiPaymentObservationRecord = {
94
+ schemaVersion: typeof REDDI_PAYMENT_OBSERVATION_SCHEMA_VERSION;
95
+ id: string;
96
+ canonicalization: typeof REDDI_PAYMENT_CANONICALIZATION;
97
+ labels: ReddiPaymentRecordLabels;
98
+ paymentIntentId?: string;
99
+ agreementId?: string;
100
+ observedAt: string;
101
+ verifier: {
102
+ name: string;
103
+ version: string;
104
+ };
105
+ payment: {
106
+ rail: string;
107
+ network: ReddiCanonicalNetworkRef;
108
+ asset: string;
109
+ mint?: string;
110
+ tokenProgram?: string;
111
+ amountBaseUnits: string;
112
+ payTo: string;
113
+ sourceTokenAccount?: string;
114
+ destinationTokenAccount: string;
115
+ authority?: string;
116
+ signature: string;
117
+ instructionIndex: string;
118
+ memo?: string;
119
+ paymentProofRef: string;
120
+ };
121
+ confirmation: {
122
+ slot: number;
123
+ blockTime?: number;
124
+ commitment: 'confirmed' | 'finalized';
125
+ };
126
+ status: 'observed_confirmed' | 'observed_failed' | 'observation_inconclusive';
127
+ };
128
+ export type ReddiRefundRecord = {
129
+ schemaVersion: typeof REDDI_REFUND_RECORD_SCHEMA_VERSION;
130
+ id: string;
131
+ canonicalization: typeof REDDI_PAYMENT_CANONICALIZATION;
132
+ labels: ReddiPaymentRecordLabels;
133
+ originalPaymentObservationId: string;
134
+ refundObservationId?: string;
135
+ refundSignature?: string;
136
+ amountBaseUnits: string;
137
+ reason: string;
138
+ state: 'requested' | 'operator_approved' | 'observed_confirmed' | 'failed' | 'manual_review';
139
+ createdAt: string;
140
+ };
141
+ export type ReddiPaymentIdKind = 'job' | 'agreement' | 'payment-intent' | 'payment-observation' | 'refund';
142
+ export declare function canonicalizePaymentObject(value: unknown): string;
143
+ export declare function canonicalPaymentHash(value: unknown): string;
144
+ export declare function deriveReddiPaymentId(kind: ReddiPaymentIdKind, payload: unknown): string;
145
+ export declare function validatePaymentRecordLabels(labels: unknown, path?: string): ReddiPaymentRecordValidationResult<ReddiPaymentRecordLabels>;
146
+ export declare function createPaymentJobRecord(input: Omit<ReddiPaymentJobRecord, 'schemaVersion' | 'id' | 'canonicalization'> & {
147
+ id?: string;
148
+ }): ReddiPaymentJobRecord;
149
+ export declare function validatePaymentJobRecord(input: unknown): ReddiPaymentRecordValidationResult<ReddiPaymentJobRecord>;
150
+ export declare function createPaymentAgreementRecord(input: Omit<ReddiPaymentAgreementRecord, 'schemaVersion' | 'id' | 'canonicalization'> & {
151
+ id?: string;
152
+ }): ReddiPaymentAgreementRecord;
153
+ export declare function validatePaymentAgreementRecord(input: unknown): ReddiPaymentRecordValidationResult<ReddiPaymentAgreementRecord>;
154
+ export declare function createPaymentIntentRecord(input: Omit<ReddiPaymentIntentRecord, 'schemaVersion' | 'id' | 'canonicalization'> & {
155
+ id?: string;
156
+ }): ReddiPaymentIntentRecord;
157
+ export declare function createPaymentIntentDraft(input: Omit<ReddiPaymentIntentRecord, 'schemaVersion' | 'id' | 'canonicalization' | 'authorization'> & {
158
+ id?: string;
159
+ policyDecisionRef?: string;
160
+ operatorApprovalRequired?: boolean;
161
+ }): ReddiPaymentIntentRecord;
162
+ export declare function validatePaymentIntentRecord(input: unknown): ReddiPaymentRecordValidationResult<ReddiPaymentIntentRecord>;
163
+ export declare function formatPaymentObservationProofRef(input: {
164
+ network: ReddiCanonicalNetworkRef;
165
+ asset: string;
166
+ signature: string;
167
+ instructionIndex: string | number;
168
+ mint?: string;
169
+ amountBaseUnits: string;
170
+ }): string;
171
+ export declare function createPaymentObservationRecord(input: Omit<ReddiPaymentObservationRecord, 'schemaVersion' | 'id' | 'canonicalization' | 'payment'> & {
172
+ id?: string;
173
+ payment: Omit<ReddiPaymentObservationRecord['payment'], 'paymentProofRef'> & {
174
+ paymentProofRef?: string;
175
+ };
176
+ }): ReddiPaymentObservationRecord;
177
+ export declare function validatePaymentObservationRecord(input: unknown): ReddiPaymentRecordValidationResult<ReddiPaymentObservationRecord>;
178
+ export declare function createRefundRecord(input: Omit<ReddiRefundRecord, 'schemaVersion' | 'id' | 'canonicalization'> & {
179
+ id?: string;
180
+ }): ReddiRefundRecord;
181
+ export declare function validateRefundRecord(input: unknown): ReddiPaymentRecordValidationResult<ReddiRefundRecord>;