@redditech/agent-protocol 0.0.0-stage → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CHANGELOG.md +95 -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,293 @@
1
+ import { AUDD_ASSET, AUDD_DECIMALS, SOLANA_DEVNET_CAIP2, SPL_TOKEN_PROGRAM_ID } from './audd-rail-config.js';
2
+ import type { ReddiPaymentEligibilityLabel, ReddiPaymentEnvironmentLabel } from './payment-records.js';
3
+ export declare const BROWSER_WALLET_APPROVAL_SCHEMA_VERSION: "reddi.browser-wallet.single-use-approval.v1";
4
+ export declare const BROWSER_WALLET_APPROVAL_VALIDATION_SCHEMA_VERSION: "reddi.browser-wallet.approval-validation.v1";
5
+ export declare const BROWSER_WALLET_TIER1_LOCAL_HARNESS_SCHEMA_VERSION: "reddi.browser-wallet.tier1-local-harness-contract.v1";
6
+ export declare const BROWSER_WALLET_IDENTITY_COPY_GUARD_SCHEMA_VERSION: "reddi.browser-wallet.identity-copy-guard.v1";
7
+ export declare const CANONICAL_DEVNET_USDC_MINT: "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU";
8
+ declare const LOOPBACK_DYNAMIC_SENTINEL: "dynamic-loopback";
9
+ declare const TIER1_REQUIRED_OBSERVATION_FIELDS: readonly ["mint", "tokenProgram", "decimals", "payee", "destinationOwner", "amount", "memo", "signature", "instructionIndex"];
10
+ declare const TIER1_PROHIBITED_ACTION_IDS: readonly ["no-mainnet", "no-devnet-rpc", "no-faucet-or-airdrop", "no-committed-key-material", "no-signature-generation", "no-blockhash-generation", "no-transaction-action", "no-runtime-artifacts"];
11
+ export type BrowserWalletTier1ProhibitedActionId = (typeof TIER1_PROHIBITED_ACTION_IDS)[number];
12
+ export declare const BROWSER_WALLET_TIER1_PROHIBITED_ACTION_EXPLANATIONS: Readonly<Record<BrowserWalletTier1ProhibitedActionId, string>>;
13
+ export type BrowserWalletApprovalValidationErrorCode = 'malformed_browser_wallet_approval' | 'missing_browser_wallet_approval_field' | 'unknown_browser_wallet_approval_field' | 'invalid_browser_wallet_approval_schema' | 'expired_browser_wallet_approval' | 'non_single_use_browser_wallet_approval' | 'unknown_browser_wallet_provider' | 'mainnet_browser_wallet_rejected' | 'production_browser_wallet_rejected' | 'custody_browser_wallet_rejected' | 'settlement_finality_rejected' | 'overly_broad_browser_wallet_approval' | 'non_canonical_browser_wallet_identity' | 'contradictory_browser_wallet_approval' | 'official_audd_devnet_unavailable' | 'secret_material_rejected' | 'ai_faucet_rejected';
14
+ export type BrowserWalletApprovalValidationError = {
15
+ code: BrowserWalletApprovalValidationErrorCode;
16
+ path: string;
17
+ message: string;
18
+ };
19
+ export type BrowserWalletApprovalValidationResult<T = BrowserWalletSingleUseApprovalRecord> = {
20
+ ok: true;
21
+ record: T;
22
+ warnings: string[];
23
+ } | {
24
+ ok: false;
25
+ errors: BrowserWalletApprovalValidationError[];
26
+ warnings: string[];
27
+ };
28
+ export type BrowserWalletProgramIds = {
29
+ escrow: string;
30
+ registry: string;
31
+ reputation: string;
32
+ attestation: string;
33
+ };
34
+ export type BrowserWalletTrustedFutureAuddDevnetIdentity = {
35
+ approvalRef: string;
36
+ sourceUrl: string;
37
+ sourceRetrievedAt: string;
38
+ sourceSha256?: string;
39
+ mint: string;
40
+ decimals: typeof AUDD_DECIMALS;
41
+ tokenProgram: typeof SPL_TOKEN_PROGRAM_ID;
42
+ };
43
+ export type BrowserWalletApprovalValidationOptions = {
44
+ now?: string | Date;
45
+ trustedDevnetProgramIds?: BrowserWalletProgramIds;
46
+ trustedDevnetRpcEndpoints?: {
47
+ rpcHttp: string;
48
+ rpcWs?: string;
49
+ };
50
+ allowFuturePartnerConfirmedAuddDevnet?: boolean;
51
+ trustedFutureAuddDevnetIdentity?: BrowserWalletTrustedFutureAuddDevnetIdentity;
52
+ };
53
+ export type BrowserWalletProviderSource = {
54
+ kind: 'official-docs' | 'browser-extension-store' | 'operator-ui';
55
+ url: string;
56
+ retrievedAt: string;
57
+ sha256?: string;
58
+ };
59
+ export type BrowserWalletSingleUseApprovalRecord = {
60
+ schemaVersion: typeof BROWSER_WALLET_APPROVAL_SCHEMA_VERSION;
61
+ status: 'approved';
62
+ approvalId: string;
63
+ approver: string;
64
+ approvedAt: string;
65
+ expiresAt: string;
66
+ usage: {
67
+ scope: 'single-use';
68
+ approvedUseCount: 1;
69
+ consumedUseCount: 0;
70
+ nonce: string;
71
+ reusePolicy: 'fresh-approval-required';
72
+ };
73
+ provider: {
74
+ name: 'Phantom';
75
+ version: string;
76
+ source: BrowserWalletProviderSource;
77
+ devnetSupport: 'verified-official-docs';
78
+ };
79
+ browserProfile: {
80
+ id: string;
81
+ isolation: 'dedicated-disposable';
82
+ syncDisabled: true;
83
+ primaryProfile: false;
84
+ onlyApprovedExtension: string;
85
+ automatedExtensionInstall: false;
86
+ deleteAfterRun: true;
87
+ };
88
+ wallet: {
89
+ publicKey: string;
90
+ secretMaterial: false;
91
+ productionSeedImported: false;
92
+ custody: 'human-controlled-devnet-only';
93
+ };
94
+ network: {
95
+ rapAlias: 'solana-devnet';
96
+ caip2: typeof SOLANA_DEVNET_CAIP2;
97
+ cluster: 'devnet';
98
+ rpcHttp: string;
99
+ rpcWs?: string;
100
+ };
101
+ uiAction: {
102
+ route: string;
103
+ action: 'connect-only' | 'register-agent' | 'x402-devnet-usdc-payment';
104
+ executionMode: 'manual-human-browser-wallet';
105
+ defaultOff: true;
106
+ exactOnce: true;
107
+ devnetActionAvailableByDefault: false;
108
+ };
109
+ programs: {
110
+ target: 'legacy-anchor';
111
+ framework: 'anchor';
112
+ source: 'resolved-network-profile';
113
+ ids: BrowserWalletProgramIds;
114
+ submissionReady: true;
115
+ };
116
+ funding: {
117
+ source: 'human-capped-devnet';
118
+ sourceRef: string;
119
+ humanApproved: true;
120
+ aiFaucetUse: false;
121
+ autoTopUp: false;
122
+ maxBalanceSol: number;
123
+ };
124
+ caps: {
125
+ perActionBaseUnits: string;
126
+ perSessionBaseUnits: string;
127
+ maxFeeLamports: string;
128
+ maxActions: 1;
129
+ };
130
+ retryPolicy: {
131
+ allowed: boolean;
132
+ maxRetries: number;
133
+ countsAgainstCaps: true;
134
+ };
135
+ asset: {
136
+ symbol: 'SOL' | 'USDC' | typeof AUDD_ASSET | 'AUDD_TEST' | 'LOCAL_AUDD_TEST';
137
+ railEnvironment: ReddiPaymentEnvironmentLabel;
138
+ mint: string | null;
139
+ tokenProgram: string | null;
140
+ decimals: number;
141
+ source: 'devnet-sol-fee' | 'existing-gated-devnet-usdc-lane' | 'partner-confirmed-audd-devnet' | 'local-test-only';
142
+ official: boolean;
143
+ auddPartnerConfirmation?: {
144
+ sourceUrl: string;
145
+ sourceRetrievedAt: string;
146
+ sourceSha256?: string;
147
+ confirmedMint: string;
148
+ confirmedDecimals: typeof AUDD_DECIMALS;
149
+ confirmedTokenProgram: typeof SPL_TOKEN_PROGRAM_ID;
150
+ };
151
+ auddDevnetApprovalRef?: string;
152
+ };
153
+ evidence: {
154
+ destination: string;
155
+ redaction: {
156
+ privateKeys: 'forbidden';
157
+ seedPhrases: 'forbidden';
158
+ signerArrays: 'forbidden';
159
+ authHeaders: 'redact';
160
+ cookies: 'redact';
161
+ rawPaymentPayloads: 'redact';
162
+ screenshots: 'redacted-only';
163
+ includePublicKey: true;
164
+ includeSignatures: 'devnet-only';
165
+ };
166
+ };
167
+ rollback: {
168
+ owner: string;
169
+ disconnectRevoke: true;
170
+ deleteBrowserProfile: true;
171
+ deleteLocalState: true;
172
+ preserveRedactedEvidence: true;
173
+ incidentSuspend: true;
174
+ freshApprovalRequired: true;
175
+ };
176
+ boundaries: {
177
+ noMainnet: true;
178
+ noProduction: true;
179
+ noCustody: true;
180
+ noSettlementFinality: true;
181
+ noOfficialAuddDevnet: true;
182
+ noLiveFunds: true;
183
+ noAiFaucet: true;
184
+ noPayShProduction: true;
185
+ noAutomaticTopUp: true;
186
+ };
187
+ };
188
+ export type BrowserWalletTier1LocalHarnessContract = {
189
+ schemaVersion: typeof BROWSER_WALLET_TIER1_LOCAL_HARNESS_SCHEMA_VERSION;
190
+ enabledByDefault: false;
191
+ executionState: 'dormant-contract-only';
192
+ network: {
193
+ rapAlias: 'local-surfpool';
194
+ caip2: null;
195
+ rpcHttp: typeof LOOPBACK_DYNAMIC_SENTINEL;
196
+ rpcWs: typeof LOOPBACK_DYNAMIC_SENTINEL;
197
+ dynamicPorts: true;
198
+ loopbackOnly: true;
199
+ remoteDatasource: false;
200
+ startupAirdrop: false;
201
+ transactionModeBlockProduction: true;
202
+ };
203
+ browserIdentity: {
204
+ kind: 'disposable-local-browser-identity';
205
+ scope: 'per-run';
206
+ publicKeyOnly: true;
207
+ productionSeedImported: false;
208
+ secretStorage: 'none-committed-public-prefixed-local-only-if-temporarily-used';
209
+ profileIsolation: 'dedicated-disposable';
210
+ };
211
+ asset: {
212
+ label: 'AUDD_TEST' | 'LOCAL_AUDD_TEST';
213
+ environment: 'local-test-mint';
214
+ mint: null;
215
+ mintSource: 'per-run-generated-not-in-this-contract';
216
+ tokenProgram: typeof SPL_TOKEN_PROGRAM_ID;
217
+ decimals: typeof AUDD_DECIMALS;
218
+ grantEligibility: 'non_eligible';
219
+ };
220
+ observation: {
221
+ instruction: 'TransferChecked';
222
+ source: 'local-validator';
223
+ exactTransferChecked: true;
224
+ exactlyOneMatchingTransfer: true;
225
+ requiredFields: Array<(typeof TIER1_REQUIRED_OBSERVATION_FIELDS)[number]>;
226
+ expectedTermsAreObservedEvidence: false;
227
+ };
228
+ railIdentity: {
229
+ railEnvironment: 'local-test-mint';
230
+ networkAlias: 'local-surfpool';
231
+ caip2: null;
232
+ asset: 'AUDD_TEST' | 'LOCAL_AUDD_TEST';
233
+ tokenProgram: typeof SPL_TOKEN_PROGRAM_ID;
234
+ decimals: typeof AUDD_DECIMALS;
235
+ observationSource: 'local-validator';
236
+ grantEligibility: 'non_eligible';
237
+ };
238
+ cleanup: {
239
+ disconnectRevoke: true;
240
+ deleteBrowserProfile: true;
241
+ deleteLocalState: true;
242
+ deleteKeyMaterial: true;
243
+ redactEvidence: true;
244
+ incidentSuspend: true;
245
+ freshApprovalRequired: true;
246
+ };
247
+ prohibitedActions: BrowserWalletTier1ProhibitedActionId[];
248
+ };
249
+ export type BrowserWalletIdentityCopyGuardInput = {
250
+ schemaVersion: typeof BROWSER_WALLET_IDENTITY_COPY_GUARD_SCHEMA_VERSION;
251
+ railEnvironment: ReddiPaymentEnvironmentLabel;
252
+ assetLabel: string;
253
+ networkAlias: string;
254
+ caip2: string | null;
255
+ mint: string | null;
256
+ tokenProgram: string | null;
257
+ decimals: number | null;
258
+ observationSource: 'expected-only' | 'parsed-transaction-fixture' | 'local-validator' | 'parsed-rpc-transaction';
259
+ grantEligibility: ReddiPaymentEligibilityLabel;
260
+ x402Export?: {
261
+ state: 'expected' | 'fixture-observed' | 'observed';
262
+ asset: string;
263
+ networkAlias: string;
264
+ caip2?: string | null;
265
+ mint?: string | null;
266
+ tokenProgram?: string | null;
267
+ decimals?: number | null;
268
+ };
269
+ policy?: {
270
+ grantEligibility: ReddiPaymentEligibilityLabel;
271
+ operatorApprovalRef?: string;
272
+ controlledLive: boolean;
273
+ };
274
+ receipt?: {
275
+ claim: 'expected-only' | 'fixture-only' | 'observed-transfer-checked' | 'observed-settlement';
276
+ observationStatus: 'not-observed' | 'fixture-observed' | 'local-observed' | 'rpc-observed';
277
+ settlementFinality: boolean;
278
+ controlledLiveEvidence: boolean;
279
+ };
280
+ copy?: {
281
+ title?: string;
282
+ summary?: string;
283
+ badges?: string[];
284
+ notes?: string[];
285
+ };
286
+ };
287
+ export type BrowserWalletTier1LocalHarnessValidationResult = BrowserWalletApprovalValidationResult<BrowserWalletTier1LocalHarnessContract>;
288
+ export type BrowserWalletIdentityCopyGuardResult = BrowserWalletApprovalValidationResult<BrowserWalletIdentityCopyGuardInput>;
289
+ export declare function validateBrowserWalletApprovalRecord(input: unknown, options?: BrowserWalletApprovalValidationOptions): BrowserWalletApprovalValidationResult;
290
+ export declare function validateBrowserWalletTier1LocalHarnessContract(input: unknown): BrowserWalletTier1LocalHarnessValidationResult;
291
+ export declare function validateBrowserWalletIdentityCopyClaims(input: unknown): BrowserWalletIdentityCopyGuardResult;
292
+ export declare const DORMANT_TIER1_LOCAL_BROWSER_HARNESS_CONTRACT: BrowserWalletTier1LocalHarnessContract;
293
+ export {};