@atcn/subledger 1.4.0 → 1.5.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 +11 -6
- package/dist/documents.d.ts +1067 -26
- package/dist/documents.js +121 -7
- package/dist/exceptions.d.ts +47 -2
- package/dist/exceptions.js +173 -3
- package/dist/expectations.d.ts +96 -0
- package/dist/expectations.js +236 -0
- package/dist/importing.d.ts +53 -0
- package/dist/importing.js +192 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/outcome.d.ts +36 -0
- package/dist/outcome.js +64 -0
- package/dist/projection.d.ts +28 -3
- package/dist/projection.js +69 -4
- package/dist/rails.d.ts +108 -0
- package/dist/rails.js +242 -0
- package/dist/response.d.ts +2 -0
- package/dist/response.js +1 -0
- package/dist/rollup.d.ts +1 -1
- package/dist/rollup.js +10 -4
- package/dist/types.d.ts +279 -7
- package/dist/types.js +179 -6
- package/dist/usage.d.ts +41 -0
- package/dist/usage.js +86 -0
- package/dist/verify.d.ts +8 -1
- package/dist/verify.js +385 -7
- package/package.json +6 -4
- package/test-vectors/reconciliation-results.json +151 -0
- package/test-vectors/reconciliation.json +107 -0
- package/test-vectors/vectors.json +25666 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,14 +1,78 @@
|
|
|
1
|
+
import { type SkillRef } from "@atcn/schema";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
/** Agent Work Subledger record shapes (PRD v1.2 §6-§7). Amounts are integer minor units; currencies are ISO 4217. */
|
|
3
4
|
export declare const Currency: z.ZodString;
|
|
4
5
|
export declare const Minor: z.ZodNumber;
|
|
5
|
-
|
|
6
|
+
/** "estimate" and "hold" (schema 1.5) record what was expected before work ran; they are never costs. */
|
|
7
|
+
export declare const FINANCIAL_EVENT_TYPES: readonly ["quote", "invoice", "charge", "payment_reported", "refund", "reversal", "fee", "credit", "adjustment", "fx_rate", "estimate", "hold"];
|
|
6
8
|
export type FinancialEventType = (typeof FINANCIAL_EVENT_TYPES)[number];
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Normalized status vocabulary; the provider's original status is always kept beside it. "pending_finality" (schema
|
|
11
|
+
* 1.5) is a payment the rail reports as settled that can still be reversed until the rail's finality window ends.
|
|
12
|
+
*/
|
|
13
|
+
export declare const NORMALIZED_STATUSES: readonly ["quoted", "issued", "pending", "reported_paid", "pending_finality", "failed", "refunded", "reversed", "void", "unknown"];
|
|
14
|
+
/** Financial event types that bill for work and so may name the skill billed (schema 1.5). */
|
|
15
|
+
export declare const SKILL_BILLED_EVENT_TYPES: readonly FinancialEventType[];
|
|
16
|
+
/**
|
|
17
|
+
* Estimates and holds (schema 1.5): what the agent, a budget gateway or the operator expected a piece of work to cost
|
|
18
|
+
* before it ran. ATCN records them and reports the gap against actual cost; it never enforces, blocks or reserves.
|
|
19
|
+
*/
|
|
20
|
+
export declare const EXPECTATION_EVENT_TYPES: readonly FinancialEventType[];
|
|
21
|
+
export declare const EXPECTATION_ISSUERS: readonly ["agent", "gateway", "operator"];
|
|
22
|
+
export type ExpectationIssuer = (typeof EXPECTATION_ISSUERS)[number];
|
|
23
|
+
export declare const HOLD_STATUSES: readonly ["open", "captured", "released", "expired"];
|
|
24
|
+
export type HoldStatus = (typeof HOLD_STATUSES)[number];
|
|
25
|
+
/**
|
|
26
|
+
* A signature by a key bound to a registered provider (an agent's provider or a gateway), over the statement of an
|
|
27
|
+
* estimate, a hold, or a terminal delivery claim (schema 1.5).
|
|
28
|
+
*/
|
|
29
|
+
export declare const KeySignerSchema: z.ZodObject<{
|
|
30
|
+
provider_id: z.ZodString;
|
|
31
|
+
binding_id: z.ZodString;
|
|
32
|
+
key_id: z.ZodString;
|
|
33
|
+
value: z.ZodString;
|
|
34
|
+
}, z.core.$strict>;
|
|
35
|
+
export type KeySigner = z.infer<typeof KeySignerSchema>;
|
|
36
|
+
export declare const ExpectationSchema: z.ZodObject<{
|
|
37
|
+
issued_by: z.ZodEnum<{
|
|
38
|
+
agent: "agent";
|
|
39
|
+
gateway: "gateway";
|
|
40
|
+
operator: "operator";
|
|
41
|
+
}>;
|
|
42
|
+
source_ref: z.ZodNullable<z.ZodString>;
|
|
43
|
+
basis: z.ZodNullable<z.ZodString>;
|
|
44
|
+
expires_at: z.ZodNullable<z.ZodISODateTime>;
|
|
45
|
+
supersedes: z.ZodNullable<z.ZodString>;
|
|
46
|
+
hold_status: z.ZodOptional<z.ZodEnum<{
|
|
47
|
+
open: "open";
|
|
48
|
+
captured: "captured";
|
|
49
|
+
released: "released";
|
|
50
|
+
expired: "expired";
|
|
51
|
+
}>>;
|
|
52
|
+
signer: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
provider_id: z.ZodString;
|
|
54
|
+
binding_id: z.ZodString;
|
|
55
|
+
key_id: z.ZodString;
|
|
56
|
+
value: z.ZodString;
|
|
57
|
+
}, z.core.$strict>>;
|
|
58
|
+
}, z.core.$strict>;
|
|
59
|
+
export type Expectation = z.infer<typeof ExpectationSchema>;
|
|
60
|
+
/**
|
|
61
|
+
* A payment rail's own record of a payment or refund (schema 1.5), for example an A2A-SE escrow attestation with its
|
|
62
|
+
* Merkle inclusion proof. `scheme` names the format; `record` is the rail's record exactly as received.
|
|
63
|
+
*/
|
|
64
|
+
export declare const RailAttestationSchema: z.ZodObject<{
|
|
65
|
+
scheme: z.ZodString;
|
|
66
|
+
record: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
67
|
+
}, z.core.$strict>;
|
|
68
|
+
export type RailAttestation = z.infer<typeof RailAttestationSchema>;
|
|
69
|
+
export declare const RAIL_ATTESTED_EVENT_TYPES: readonly FinancialEventType[];
|
|
9
70
|
export declare const PAYERS: readonly ["buyer", "provider", "other"];
|
|
10
71
|
export declare const DELIVERY_EVENT_TYPES: readonly ["acceptance", "completion", "partial_completion", "cancellation", "provider_failure", "terms_update", "correction"];
|
|
11
72
|
export type DeliveryEventType = (typeof DELIVERY_EVENT_TYPES)[number];
|
|
73
|
+
/** Outcome claims the provider may sign with its bound key (schema 1.5): how its work ended. */
|
|
74
|
+
export declare const SIGNED_CLAIM_TYPES: readonly ["completion", "partial_completion", "cancellation", "provider_failure"];
|
|
75
|
+
export type SignedClaimType = (typeof SIGNED_CLAIM_TYPES)[number];
|
|
12
76
|
/**
|
|
13
77
|
* Who made a delivery statement. Callers record "buyer" or "provider" (relayed by the buyer). The other values are
|
|
14
78
|
* recorded only from clearing-network events: "clearing_policy" for a decision computed by the agreed policy from
|
|
@@ -17,18 +81,42 @@ export type DeliveryEventType = (typeof DELIVERY_EVENT_TYPES)[number];
|
|
|
17
81
|
*/
|
|
18
82
|
export declare const CLAIM_ASSERTERS: readonly ["buyer", "provider", "clearing_policy", "dispute_reviewer", "clearing_network"];
|
|
19
83
|
export type ClaimAsserter = (typeof CLAIM_ASSERTERS)[number];
|
|
20
|
-
export declare const EXCEPTION_KINDS: readonly ["budget_overrun", "unmatched_charge", "ambiguous_match", "missing_receipt", "duplicate_event", "amount_mismatch", "currency_mismatch", "stale_quote", "refund_after_close", "allocation_changed_after_close", "incomplete_lineage"];
|
|
84
|
+
export declare const EXCEPTION_KINDS: readonly ["budget_overrun", "unmatched_charge", "ambiguous_match", "missing_receipt", "duplicate_event", "amount_mismatch", "currency_mismatch", "stale_quote", "refund_after_close", "allocation_changed_after_close", "incomplete_lineage", "usage_unpriced", "usage_cost_mismatch", "refund_terms_breach", "skill_price_mismatch", "witness_quorum_not_met", "conflicting_statements", "unmatched_estimate", "actual_exceeds_estimate", "actual_exceeds_hold", "hold_not_released", "estimate_after_charge", "charge_after_cancellation"];
|
|
21
85
|
export type ExceptionKind = (typeof EXCEPTION_KINDS)[number];
|
|
22
86
|
/** Trust labels kept separate on every screen and export (PRD §16 "Identity assurance"). Never collapsed into "verified". */
|
|
23
|
-
export declare const ASSURANCE_LABELS: readonly ["issuer_signed", "buyer_recorded", "network_recorded", "recipient_viewed", "link_authenticated_response", "provider_identity_bound", "provider_key_signed", "contested", "superseded", "expired", "revoked"];
|
|
87
|
+
export declare const ASSURANCE_LABELS: readonly ["issuer_signed", "buyer_recorded", "network_recorded", "recipient_viewed", "link_authenticated_response", "provider_identity_bound", "provider_key_signed", "contested", "superseded", "expired", "revoked", "gateway_signed", "rail_attested"];
|
|
24
88
|
export type AssuranceLabel = (typeof ASSURANCE_LABELS)[number];
|
|
25
89
|
export declare const RESPONSE_TYPES: readonly ["acknowledge_view", "acknowledge_delivery", "submit_evidence", "propose_correction", "signed_attestation"];
|
|
26
90
|
export type ResponseType = (typeof RESPONSE_TYPES)[number];
|
|
27
|
-
|
|
91
|
+
/** "witness_attestation" (schema 1.5) lets an independent witness sign a statement that it observed the run. */
|
|
92
|
+
export declare const SHARE_ACTIONS: readonly ["view", "acknowledge_delivery", "submit_evidence", "propose_correction", "signed_attestation", "witness_attestation"];
|
|
28
93
|
export type ShareAction = (typeof SHARE_ACTIONS)[number];
|
|
29
94
|
/** Receipt fields a provider may attest to or contest. Attesting one never implies the others (acceptance 16). */
|
|
30
|
-
export declare const ATTESTABLE_FIELDS: readonly ["delivery.status", "delivery.evidence", "scope.terms_digest", "financial.amounts", "financial.status"];
|
|
95
|
+
export declare const ATTESTABLE_FIELDS: readonly ["delivery.status", "delivery.evidence", "scope.terms_digest", "financial.amounts", "financial.status", "delivery.usage"];
|
|
31
96
|
export type AttestableField = (typeof ATTESTABLE_FIELDS)[number];
|
|
97
|
+
export declare function attestableFieldsFor(schemaVersion: string): readonly AttestableField[];
|
|
98
|
+
/** The usage of a run as recorded on a delivery claim: the trace's summary and the digest of the full trace, which stays with its holder. */
|
|
99
|
+
export declare const UsageRecordSchema: z.ZodObject<{
|
|
100
|
+
trace_digest: z.ZodString;
|
|
101
|
+
summary: z.ZodObject<{
|
|
102
|
+
models: z.ZodArray<z.ZodObject<{
|
|
103
|
+
provider: z.ZodString;
|
|
104
|
+
name: z.ZodString;
|
|
105
|
+
calls: z.ZodNumber;
|
|
106
|
+
input_tokens: z.ZodNumber;
|
|
107
|
+
output_tokens: z.ZodNumber;
|
|
108
|
+
cache_read_input_tokens: z.ZodNumber;
|
|
109
|
+
}, z.core.$strict>>;
|
|
110
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
111
|
+
name: z.ZodString;
|
|
112
|
+
calls: z.ZodNumber;
|
|
113
|
+
}, z.core.$strict>>;
|
|
114
|
+
a2a_calls: z.ZodNumber;
|
|
115
|
+
}, z.core.$strict>;
|
|
116
|
+
}, z.core.$strict>;
|
|
117
|
+
export type UsageRecord = z.infer<typeof UsageRecordSchema>;
|
|
118
|
+
/** Delivery claims that may carry usage. */
|
|
119
|
+
export declare const USAGE_CLAIM_TYPES: readonly string[];
|
|
32
120
|
/** Evidence stays in its source system; only references and digests are stored. Script-capable schemes are refused. */
|
|
33
121
|
export declare const EvidenceRefSchema: z.ZodObject<{
|
|
34
122
|
uri: z.ZodString;
|
|
@@ -36,6 +124,20 @@ export declare const EvidenceRefSchema: z.ZodObject<{
|
|
|
36
124
|
evidence_type: z.ZodString;
|
|
37
125
|
}, z.core.$strip>;
|
|
38
126
|
export type EvidenceRef = z.infer<typeof EvidenceRefSchema>;
|
|
127
|
+
/** Why part of a delegation chain was not captured. broken_edge: a reported sub-task arrived with no outcome. */
|
|
128
|
+
export declare const CAPTURE_GAP_KINDS: readonly ["capture_failed", "queue_overflow", "provider_undisclosed", "manual_gap", "broken_edge"];
|
|
129
|
+
export declare const CaptureGapInputSchema: z.ZodObject<{
|
|
130
|
+
delegation_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
131
|
+
kind: z.ZodEnum<{
|
|
132
|
+
capture_failed: "capture_failed";
|
|
133
|
+
queue_overflow: "queue_overflow";
|
|
134
|
+
provider_undisclosed: "provider_undisclosed";
|
|
135
|
+
manual_gap: "manual_gap";
|
|
136
|
+
broken_edge: "broken_edge";
|
|
137
|
+
}>;
|
|
138
|
+
detail: z.ZodString;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
export type CaptureGapInput = z.infer<typeof CaptureGapInputSchema>;
|
|
39
141
|
export declare const TaskInputSchema: z.ZodObject<{
|
|
40
142
|
external_ref: z.ZodString;
|
|
41
143
|
currency: z.ZodString;
|
|
@@ -47,6 +149,7 @@ export declare const TaskInputSchema: z.ZodObject<{
|
|
|
47
149
|
shared_description: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
48
150
|
retrospective: z.ZodDefault<z.ZodBoolean>;
|
|
49
151
|
occurred_at: z.ZodDefault<z.ZodNullable<z.ZodISODateTime>>;
|
|
152
|
+
estimate_tolerance_bps: z.ZodOptional<z.ZodNumber>;
|
|
50
153
|
}, z.core.$strip>;
|
|
51
154
|
export type TaskInput = z.infer<typeof TaskInputSchema>;
|
|
52
155
|
export declare const ProviderInputSchema: z.ZodObject<{
|
|
@@ -54,6 +157,17 @@ export declare const ProviderInputSchema: z.ZodObject<{
|
|
|
54
157
|
provider_own_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
55
158
|
domain: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
56
159
|
}, z.core.$strip>;
|
|
160
|
+
/**
|
|
161
|
+
* Independent witnesses a delegation requires (schema 1.5). A witness is a registered provider other than the
|
|
162
|
+
* delegation's own, signing with a domain-challenged key; it counts only if that registrable domain differs from the
|
|
163
|
+
* provider's, the buyer operator's and every other counted witness's. Too few raise witness_quorum_not_met.
|
|
164
|
+
*/
|
|
165
|
+
export declare const SubledgerWitnessPolicySchema: z.ZodObject<{
|
|
166
|
+
min_independent_witnesses: z.ZodNumber;
|
|
167
|
+
witness_provider_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
168
|
+
independence: z.ZodLiteral<"distinct_verified_domain">;
|
|
169
|
+
}, z.core.$strict>;
|
|
170
|
+
export type SubledgerWitnessPolicy = z.infer<typeof SubledgerWitnessPolicySchema>;
|
|
57
171
|
export declare const DelegationInputSchema: z.ZodObject<{
|
|
58
172
|
parent_delegation_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
59
173
|
provider_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
@@ -92,6 +206,11 @@ export declare const DelegationInputSchema: z.ZodObject<{
|
|
|
92
206
|
name: z.ZodString;
|
|
93
207
|
version: z.ZodString;
|
|
94
208
|
}, z.core.$strip>>;
|
|
209
|
+
additional_models: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
210
|
+
provider: z.ZodString;
|
|
211
|
+
name: z.ZodString;
|
|
212
|
+
version: z.ZodString;
|
|
213
|
+
}, z.core.$strip>>>;
|
|
95
214
|
config_digest: z.ZodOptional<z.ZodString>;
|
|
96
215
|
}, z.core.$strip>;
|
|
97
216
|
skill: z.ZodOptional<z.ZodObject<{
|
|
@@ -100,6 +219,46 @@ export declare const DelegationInputSchema: z.ZodObject<{
|
|
|
100
219
|
agent_card_url: z.ZodOptional<z.ZodURL>;
|
|
101
220
|
}, z.core.$strip>>;
|
|
102
221
|
}, z.core.$strip>>;
|
|
222
|
+
pricing: z.ZodOptional<z.ZodObject<{
|
|
223
|
+
rates: z.ZodArray<z.ZodObject<{
|
|
224
|
+
meter: z.ZodEnum<{
|
|
225
|
+
input_tokens: "input_tokens";
|
|
226
|
+
output_tokens: "output_tokens";
|
|
227
|
+
cache_read_input_tokens: "cache_read_input_tokens";
|
|
228
|
+
model_call: "model_call";
|
|
229
|
+
tool_call: "tool_call";
|
|
230
|
+
a2a_call: "a2a_call";
|
|
231
|
+
}>;
|
|
232
|
+
model: z.ZodOptional<z.ZodObject<{
|
|
233
|
+
provider: z.ZodString;
|
|
234
|
+
name: z.ZodString;
|
|
235
|
+
}, z.core.$strict>>;
|
|
236
|
+
tool_name: z.ZodOptional<z.ZodString>;
|
|
237
|
+
price_numerator: z.ZodNumber;
|
|
238
|
+
price_denominator: z.ZodNumber;
|
|
239
|
+
}, z.core.$strict>>;
|
|
240
|
+
fixed_minor: z.ZodOptional<z.ZodNumber>;
|
|
241
|
+
tolerance_bps: z.ZodNumber;
|
|
242
|
+
}, z.core.$strict>>;
|
|
243
|
+
refund_terms: z.ZodOptional<z.ZodObject<{
|
|
244
|
+
on_failure: z.ZodEnum<{
|
|
245
|
+
dispute: "dispute";
|
|
246
|
+
refund: "refund";
|
|
247
|
+
}>;
|
|
248
|
+
on_timeout: z.ZodEnum<{
|
|
249
|
+
dispute: "dispute";
|
|
250
|
+
refund: "refund";
|
|
251
|
+
}>;
|
|
252
|
+
after_settlement: z.ZodObject<{
|
|
253
|
+
cap_minor: z.ZodNumber;
|
|
254
|
+
window_seconds: z.ZodNumber;
|
|
255
|
+
}, z.core.$strict>;
|
|
256
|
+
}, z.core.$strict>>;
|
|
257
|
+
witness_policy: z.ZodOptional<z.ZodObject<{
|
|
258
|
+
min_independent_witnesses: z.ZodNumber;
|
|
259
|
+
witness_provider_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
260
|
+
independence: z.ZodLiteral<"distinct_verified_domain">;
|
|
261
|
+
}, z.core.$strict>>;
|
|
103
262
|
}, z.core.$strip>;
|
|
104
263
|
export type DelegationInput = z.infer<typeof DelegationInputSchema>;
|
|
105
264
|
export declare const DelegationEventInputSchema: z.ZodObject<{
|
|
@@ -134,13 +293,79 @@ export declare const DelegationEventInputSchema: z.ZodObject<{
|
|
|
134
293
|
disclosed: "disclosed";
|
|
135
294
|
none: "none";
|
|
136
295
|
}>>;
|
|
296
|
+
pricing: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
297
|
+
rates: z.ZodArray<z.ZodObject<{
|
|
298
|
+
meter: z.ZodEnum<{
|
|
299
|
+
input_tokens: "input_tokens";
|
|
300
|
+
output_tokens: "output_tokens";
|
|
301
|
+
cache_read_input_tokens: "cache_read_input_tokens";
|
|
302
|
+
model_call: "model_call";
|
|
303
|
+
tool_call: "tool_call";
|
|
304
|
+
a2a_call: "a2a_call";
|
|
305
|
+
}>;
|
|
306
|
+
model: z.ZodOptional<z.ZodObject<{
|
|
307
|
+
provider: z.ZodString;
|
|
308
|
+
name: z.ZodString;
|
|
309
|
+
}, z.core.$strict>>;
|
|
310
|
+
tool_name: z.ZodOptional<z.ZodString>;
|
|
311
|
+
price_numerator: z.ZodNumber;
|
|
312
|
+
price_denominator: z.ZodNumber;
|
|
313
|
+
}, z.core.$strict>>;
|
|
314
|
+
fixed_minor: z.ZodOptional<z.ZodNumber>;
|
|
315
|
+
tolerance_bps: z.ZodNumber;
|
|
316
|
+
}, z.core.$strict>>>;
|
|
317
|
+
refund_terms: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
318
|
+
on_failure: z.ZodEnum<{
|
|
319
|
+
dispute: "dispute";
|
|
320
|
+
refund: "refund";
|
|
321
|
+
}>;
|
|
322
|
+
on_timeout: z.ZodEnum<{
|
|
323
|
+
dispute: "dispute";
|
|
324
|
+
refund: "refund";
|
|
325
|
+
}>;
|
|
326
|
+
after_settlement: z.ZodObject<{
|
|
327
|
+
cap_minor: z.ZodNumber;
|
|
328
|
+
window_seconds: z.ZodNumber;
|
|
329
|
+
}, z.core.$strict>;
|
|
330
|
+
}, z.core.$strict>>>;
|
|
331
|
+
witness_policy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
332
|
+
min_independent_witnesses: z.ZodNumber;
|
|
333
|
+
witness_provider_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
334
|
+
independence: z.ZodLiteral<"distinct_verified_domain">;
|
|
335
|
+
}, z.core.$strict>>>;
|
|
137
336
|
}, z.core.$strip>>>;
|
|
138
337
|
supersedes_event_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
139
338
|
reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
140
339
|
retrospective: z.ZodDefault<z.ZodBoolean>;
|
|
141
340
|
occurred_at: z.ZodDefault<z.ZodNullable<z.ZodISODateTime>>;
|
|
341
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
342
|
+
trace_digest: z.ZodString;
|
|
343
|
+
summary: z.ZodObject<{
|
|
344
|
+
models: z.ZodArray<z.ZodObject<{
|
|
345
|
+
provider: z.ZodString;
|
|
346
|
+
name: z.ZodString;
|
|
347
|
+
calls: z.ZodNumber;
|
|
348
|
+
input_tokens: z.ZodNumber;
|
|
349
|
+
output_tokens: z.ZodNumber;
|
|
350
|
+
cache_read_input_tokens: z.ZodNumber;
|
|
351
|
+
}, z.core.$strict>>;
|
|
352
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
353
|
+
name: z.ZodString;
|
|
354
|
+
calls: z.ZodNumber;
|
|
355
|
+
}, z.core.$strict>>;
|
|
356
|
+
a2a_calls: z.ZodNumber;
|
|
357
|
+
}, z.core.$strict>;
|
|
358
|
+
}, z.core.$strict>>;
|
|
359
|
+
signer: z.ZodOptional<z.ZodObject<{
|
|
360
|
+
provider_id: z.ZodString;
|
|
361
|
+
binding_id: z.ZodString;
|
|
362
|
+
key_id: z.ZodString;
|
|
363
|
+
value: z.ZodString;
|
|
364
|
+
}, z.core.$strict>>;
|
|
142
365
|
}, z.core.$strip>;
|
|
143
366
|
export type DelegationEventInput = z.infer<typeof DelegationEventInputSchema>;
|
|
367
|
+
/** Rules across fields of a delivery event that the schema cannot express. */
|
|
368
|
+
export declare function delegationEventProblems(input: Pick<DelegationEventInput, "type" | "usage"> & Partial<Pick<DelegationEventInput, "asserted_by" | "signer">>): string[];
|
|
144
369
|
export declare const FxSchema: z.ZodObject<{
|
|
145
370
|
base_currency: z.ZodString;
|
|
146
371
|
quote_currency: z.ZodString;
|
|
@@ -160,6 +385,8 @@ export declare const FinancialEventInputSchema: z.ZodObject<{
|
|
|
160
385
|
credit: "credit";
|
|
161
386
|
adjustment: "adjustment";
|
|
162
387
|
fx_rate: "fx_rate";
|
|
388
|
+
estimate: "estimate";
|
|
389
|
+
hold: "hold";
|
|
163
390
|
}>;
|
|
164
391
|
source: z.ZodString;
|
|
165
392
|
source_event_id: z.ZodString;
|
|
@@ -174,6 +401,7 @@ export declare const FinancialEventInputSchema: z.ZodObject<{
|
|
|
174
401
|
issued: "issued";
|
|
175
402
|
pending: "pending";
|
|
176
403
|
reported_paid: "reported_paid";
|
|
404
|
+
pending_finality: "pending_finality";
|
|
177
405
|
failed: "failed";
|
|
178
406
|
refunded: "refunded";
|
|
179
407
|
reversed: "reversed";
|
|
@@ -203,6 +431,38 @@ export declare const FinancialEventInputSchema: z.ZodObject<{
|
|
|
203
431
|
rate_denominator: z.ZodNumber;
|
|
204
432
|
}, z.core.$strip>>>;
|
|
205
433
|
reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
434
|
+
skill: z.ZodOptional<z.ZodObject<{
|
|
435
|
+
namespace: z.ZodString;
|
|
436
|
+
skill_id: z.ZodString;
|
|
437
|
+
agent_card_url: z.ZodOptional<z.ZodURL>;
|
|
438
|
+
}, z.core.$strip>>;
|
|
439
|
+
expectation: z.ZodOptional<z.ZodObject<{
|
|
440
|
+
issued_by: z.ZodEnum<{
|
|
441
|
+
agent: "agent";
|
|
442
|
+
gateway: "gateway";
|
|
443
|
+
operator: "operator";
|
|
444
|
+
}>;
|
|
445
|
+
source_ref: z.ZodNullable<z.ZodString>;
|
|
446
|
+
basis: z.ZodNullable<z.ZodString>;
|
|
447
|
+
expires_at: z.ZodNullable<z.ZodISODateTime>;
|
|
448
|
+
supersedes: z.ZodNullable<z.ZodString>;
|
|
449
|
+
hold_status: z.ZodOptional<z.ZodEnum<{
|
|
450
|
+
open: "open";
|
|
451
|
+
captured: "captured";
|
|
452
|
+
released: "released";
|
|
453
|
+
expired: "expired";
|
|
454
|
+
}>>;
|
|
455
|
+
signer: z.ZodOptional<z.ZodObject<{
|
|
456
|
+
provider_id: z.ZodString;
|
|
457
|
+
binding_id: z.ZodString;
|
|
458
|
+
key_id: z.ZodString;
|
|
459
|
+
value: z.ZodString;
|
|
460
|
+
}, z.core.$strict>>;
|
|
461
|
+
}, z.core.$strict>>;
|
|
462
|
+
rail_attestation: z.ZodOptional<z.ZodObject<{
|
|
463
|
+
scheme: z.ZodString;
|
|
464
|
+
record: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
465
|
+
}, z.core.$strict>>;
|
|
206
466
|
match: z.ZodDefault<z.ZodObject<{
|
|
207
467
|
task_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
208
468
|
delegation_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
@@ -211,6 +471,12 @@ export declare const FinancialEventInputSchema: z.ZodObject<{
|
|
|
211
471
|
provider_job_ref: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
212
472
|
}, z.core.$strip>>;
|
|
213
473
|
}, z.core.$strip>;
|
|
474
|
+
/** Rules for estimates and holds that the schema cannot express. */
|
|
475
|
+
export declare function expectationProblems(e: {
|
|
476
|
+
type: FinancialEventType;
|
|
477
|
+
amount_minor: number;
|
|
478
|
+
expectation?: Expectation;
|
|
479
|
+
}): string[];
|
|
214
480
|
export type FinancialEventInput = z.input<typeof FinancialEventInputSchema>;
|
|
215
481
|
/** A stored financial event exactly as hashed into exports. */
|
|
216
482
|
export interface FinancialEventRecord {
|
|
@@ -236,6 +502,12 @@ export interface FinancialEventRecord {
|
|
|
236
502
|
settles_event_id: string | null;
|
|
237
503
|
fx: Fx | null;
|
|
238
504
|
reason: string | null;
|
|
505
|
+
/** Schema 1.5, present only when stated: the skill billed. */
|
|
506
|
+
skill?: SkillRef;
|
|
507
|
+
/** Schema 1.5, estimates and holds only. */
|
|
508
|
+
expectation?: Expectation;
|
|
509
|
+
/** Schema 1.5, payments and refunds only. */
|
|
510
|
+
rail_attestation?: RailAttestation;
|
|
239
511
|
}
|
|
240
512
|
export declare const AllocationTargetSchema: z.ZodObject<{
|
|
241
513
|
type: z.ZodEnum<{
|