@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.
- package/CHANGELOG.md +89 -0
- package/LICENSE +21 -0
- package/README.md +394 -2
- package/dist/adl.d.ts +141 -0
- package/dist/adl.js +3601 -0
- package/dist/agent-stack-fixtures.d.ts +743 -0
- package/dist/agent-stack-fixtures.js +1554 -0
- package/dist/ai-catalog.d.ts +128 -0
- package/dist/ai-catalog.js +373 -0
- package/dist/attestation-reputation.d.ts +102 -0
- package/dist/attestation-reputation.js +279 -0
- package/dist/audd-rail-config.d.ts +102 -0
- package/dist/audd-rail-config.js +294 -0
- package/dist/browser-wallet-approval.d.ts +293 -0
- package/dist/browser-wallet-approval.js +1201 -0
- package/dist/discovery-source.d.ts +115 -0
- package/dist/discovery-source.js +251 -0
- package/dist/evidence-archive.d.ts +73 -0
- package/dist/evidence-archive.js +238 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +23 -0
- package/dist/mpp-tempo-receipt-shapes.d.ts +201 -0
- package/dist/mpp-tempo-receipt-shapes.js +330 -0
- package/dist/okf-adapter.d.ts +229 -0
- package/dist/okf-adapter.js +556 -0
- package/dist/okf-conformance.d.ts +208 -0
- package/dist/okf-conformance.js +651 -0
- package/dist/okf-instruction-safety.d.ts +192 -0
- package/dist/okf-instruction-safety.js +509 -0
- package/dist/onboarding-analyser-handoff.d.ts +391 -0
- package/dist/onboarding-analyser-handoff.js +959 -0
- package/dist/onboarding-state-machine.d.ts +228 -0
- package/dist/onboarding-state-machine.js +432 -0
- package/dist/payment-records.d.ts +181 -0
- package/dist/payment-records.js +599 -0
- package/dist/policy.d.ts +33 -0
- package/dist/policy.js +45 -0
- package/dist/provider-trust.d.ts +113 -0
- package/dist/provider-trust.js +346 -0
- package/dist/quasar-registry-compatibility.d.ts +113 -0
- package/dist/quasar-registry-compatibility.js +214 -0
- package/dist/ranking-explainability.d.ts +202 -0
- package/dist/ranking-explainability.js +302 -0
- package/dist/receipt-v2.d.ts +202 -0
- package/dist/receipt-v2.js +418 -0
- package/dist/repo-explorer-evidence-manifest.d.ts +387 -0
- package/dist/repo-explorer-evidence-manifest.js +1187 -0
- package/dist/source-diagnostics.d.ts +84 -0
- package/dist/source-diagnostics.js +193 -0
- package/dist/source-trust-conformance-matrix.d.ts +207 -0
- package/dist/source-trust-conformance-matrix.js +672 -0
- package/examples/ard-no-spend-ai-catalog.json +51 -0
- package/examples/ard-no-spend-demo.mjs +355 -0
- package/examples/interpretation-guide-scenarios.mjs +302 -0
- package/package.json +144 -4
package/dist/adl.d.ts
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
export declare const ADL_V03_API_VERSION = "reddiagent.dev/v0.3";
|
|
2
|
+
export declare const ADL_V03_RECEIPT_FORMAT = "reddi.receipt.v2";
|
|
3
|
+
export declare const ADL_V03_LIVE_RAIL = "solana";
|
|
4
|
+
/** The protocol fee: 5% of the amount actually paid. */
|
|
5
|
+
export declare const ADL_V03_PROTOCOL_FEE_BPS = 500;
|
|
6
|
+
/** The launch rate: 2.5% for payouts before `endsAt`. */
|
|
7
|
+
export declare const ADL_V03_LAUNCH_RATE: Readonly<{
|
|
8
|
+
bps: 250;
|
|
9
|
+
endsAt: "2027-04-01T00:00:00Z";
|
|
10
|
+
}>;
|
|
11
|
+
export declare const ADL_V03_PROTOCOL_FEE_SOL_CAP = "0.1";
|
|
12
|
+
/** Mints the escrow program accepts on Solana mainnet-beta. Devnet mints are the operator's choice. */
|
|
13
|
+
export declare const ADL_V03_MAINNET_MINTS: Readonly<Record<string, string>>;
|
|
14
|
+
/** The largest ADL document the parser accepts, in UTF-8 bytes. */
|
|
15
|
+
export declare const ADL_MAX_DOCUMENT_BYTES: number;
|
|
16
|
+
export type AdlDocument = Record<string, unknown>;
|
|
17
|
+
export type AdlLevel = 0 | 1 | 2 | 3 | 4;
|
|
18
|
+
export interface AdlSchemaDiagnostic {
|
|
19
|
+
path: string;
|
|
20
|
+
message: string;
|
|
21
|
+
}
|
|
22
|
+
export interface AdlConformanceReport {
|
|
23
|
+
agent: string;
|
|
24
|
+
apiVersion: typeof ADL_V03_API_VERSION;
|
|
25
|
+
requestedLevel: number;
|
|
26
|
+
/** -1 when the document fails the schema. */
|
|
27
|
+
achievedLevel: number;
|
|
28
|
+
status: "pass" | "fail";
|
|
29
|
+
schemaDiagnostics: AdlSchemaDiagnostic[];
|
|
30
|
+
missingFieldsByLevel: Record<string, string[]>;
|
|
31
|
+
forbiddenCapabilitiesByLevel: Record<string, string[]>;
|
|
32
|
+
payment: {
|
|
33
|
+
mode: string | null;
|
|
34
|
+
paymentMade: false;
|
|
35
|
+
liveRailDeclared: boolean;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export type AdlParseResult = {
|
|
39
|
+
ok: true;
|
|
40
|
+
document: AdlDocument;
|
|
41
|
+
} | {
|
|
42
|
+
ok: false;
|
|
43
|
+
message: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Reads an ADL document from YAML or JSON text. YAML 1.1 rules, as the lab's
|
|
47
|
+
* PyYAML reads it. Refuses documents over `ADL_MAX_DOCUMENT_BYTES`, aliases
|
|
48
|
+
* beyond a small bound, duplicate keys and a top level that is not a mapping.
|
|
49
|
+
*/
|
|
50
|
+
export declare function parseAdlDocument(text: string): AdlParseResult;
|
|
51
|
+
/** The document as YAML text, for publishing. */
|
|
52
|
+
export declare function formatAdlDocument(document: AdlDocument): string;
|
|
53
|
+
/**
|
|
54
|
+
* Checks an ADL v0.3 document against the schema and every conformance level
|
|
55
|
+
* up to the requested one (the option, else `conformance.requestedLevel`,
|
|
56
|
+
* else 0). The same verdict as the lab's `adl_v03_conformance.py`.
|
|
57
|
+
*/
|
|
58
|
+
export declare function checkAdlConformance(doc: AdlDocument, options?: {
|
|
59
|
+
requestedLevel?: AdlLevel;
|
|
60
|
+
}): AdlConformanceReport;
|
|
61
|
+
/** Every problem in a report, one line each, schema problems first. */
|
|
62
|
+
export declare function adlProblems(report: AdlConformanceReport): string[];
|
|
63
|
+
export type AdlNetwork = "solana-devnet" | "solana-mainnet-beta";
|
|
64
|
+
/** A listed price as ADL writes it: decimal strings in the asset. */
|
|
65
|
+
export type AdlPrice = {
|
|
66
|
+
per: "token";
|
|
67
|
+
inputPerMillion: string;
|
|
68
|
+
outputPerMillion: string; /** The most one call can cost; what a buyer authorises at most. */
|
|
69
|
+
maxPerCall: string;
|
|
70
|
+
} | {
|
|
71
|
+
per: "call";
|
|
72
|
+
amount: string;
|
|
73
|
+
};
|
|
74
|
+
export interface ProviderAdlInput {
|
|
75
|
+
/** Listing name, 1 to 80 characters. Becomes `metadata.name` as a slug. */
|
|
76
|
+
name: string;
|
|
77
|
+
description?: string;
|
|
78
|
+
/** The model the provider declares it serves; receipts name it. Optional for a listing that names none. */
|
|
79
|
+
model?: string;
|
|
80
|
+
network: AdlNetwork;
|
|
81
|
+
/** USDC, AUDD, PYUSD or USDG. */
|
|
82
|
+
currency: string;
|
|
83
|
+
mint: string;
|
|
84
|
+
/** The provider wallet that is paid. */
|
|
85
|
+
payTo: string;
|
|
86
|
+
/** Per token, settled through metered escrow; or per call (a fixed-price job), settled through escrow. */
|
|
87
|
+
price: AdlPrice;
|
|
88
|
+
/** `live` for a provider that takes real payments. Defaults to live. */
|
|
89
|
+
mode?: "live" | "dry-run";
|
|
90
|
+
/** Where buyers reach the provider. Recorded under `extensions.identity`. */
|
|
91
|
+
endpointUrl?: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The schema's provider family for a model id: providers speak the
|
|
95
|
+
* OpenAI-compatible API, so anything not plainly Anthropic, Gemini or Ollama
|
|
96
|
+
* is "openai". The exact model is `extensions.identity.declaredModel`.
|
|
97
|
+
*/
|
|
98
|
+
export declare function adlProviderFamily(model: string | undefined): "openai" | "anthropic" | "gemini" | "ollama";
|
|
99
|
+
/** A `metadata.name` the schema accepts: lowercase letters, digits and dashes, 2 to 63 characters. */
|
|
100
|
+
export declare function adlNameSlug(name: string): string;
|
|
101
|
+
/**
|
|
102
|
+
* The ADL v0.3 document for a provider on the Reddi Agent Protocol: a charge
|
|
103
|
+
* on the Solana rail, priced per token and settled through metered escrow (or
|
|
104
|
+
* priced per call and settled through escrow), with the protocol fee, a
|
|
105
|
+
* reddi.receipt.v2 receipt and reputation signals. It passes Level 3. The
|
|
106
|
+
* caller checks its inputs; a bad input gives a document that fails
|
|
107
|
+
* `checkAdlConformance`, never a silently different one.
|
|
108
|
+
*/
|
|
109
|
+
export declare function buildProviderAdl(input: ProviderAdlInput): AdlDocument;
|
|
110
|
+
export interface ProviderAdlTerms {
|
|
111
|
+
name: string;
|
|
112
|
+
description: string;
|
|
113
|
+
/** `extensions.identity.declaredModel`, when the document names one. */
|
|
114
|
+
declaredModel?: string;
|
|
115
|
+
/** `extensions.identity.endpoint`, when the document names one. */
|
|
116
|
+
endpointUrl?: string;
|
|
117
|
+
mode: "live" | "dry-run";
|
|
118
|
+
network: AdlNetwork;
|
|
119
|
+
currency: string;
|
|
120
|
+
mint: string;
|
|
121
|
+
payTo: string;
|
|
122
|
+
price: AdlPrice;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* A provider's listing terms from its ADL: the document must pass Level 3 and
|
|
126
|
+
* hold exactly one charge intent on the Solana rail, in a token, priced per
|
|
127
|
+
* token (metered escrow) or per call (escrow).
|
|
128
|
+
*/
|
|
129
|
+
export declare function providerTermsFromAdl(doc: AdlDocument): {
|
|
130
|
+
ok: true;
|
|
131
|
+
terms: ProviderAdlTerms;
|
|
132
|
+
report: AdlConformanceReport;
|
|
133
|
+
} | {
|
|
134
|
+
ok: false;
|
|
135
|
+
problems: string[];
|
|
136
|
+
report: AdlConformanceReport;
|
|
137
|
+
};
|
|
138
|
+
/** SHA-256 of the lab's ADL v0.3 JSON Schema this copy was made from. */
|
|
139
|
+
export declare const ADL_V03_SCHEMA_SHA256 = "07ef5112a2efeb7db746897fab209e91de18d78a31ed8756f534a64ac21df9e0";
|
|
140
|
+
/** The ADL v0.3 JSON Schema (draft 2020-12). */
|
|
141
|
+
export declare const ADL_V03_SCHEMA: Record<string, unknown>;
|