@axorum/client 0.0.0-stage → 1.1.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 (79) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +537 -2
  3. package/dist/agent-uri.d.ts +33 -0
  4. package/dist/agent-uri.d.ts.map +1 -0
  5. package/dist/agent-uri.js +231 -0
  6. package/dist/agent-uri.js.map +1 -0
  7. package/dist/authorize.d.ts +671 -0
  8. package/dist/authorize.d.ts.map +1 -0
  9. package/dist/authorize.js +947 -0
  10. package/dist/authorize.js.map +1 -0
  11. package/dist/capabilities.d.ts +30 -0
  12. package/dist/capabilities.d.ts.map +1 -0
  13. package/dist/capabilities.js +40 -0
  14. package/dist/capabilities.js.map +1 -0
  15. package/dist/chart.d.ts +74 -0
  16. package/dist/chart.d.ts.map +1 -0
  17. package/dist/chart.js +107 -0
  18. package/dist/chart.js.map +1 -0
  19. package/dist/client.d.ts +645 -0
  20. package/dist/client.d.ts.map +1 -0
  21. package/dist/client.js +1303 -0
  22. package/dist/client.js.map +1 -0
  23. package/dist/errors.d.ts +646 -0
  24. package/dist/errors.d.ts.map +1 -0
  25. package/dist/errors.js +928 -0
  26. package/dist/errors.js.map +1 -0
  27. package/dist/failover.d.ts +197 -0
  28. package/dist/failover.d.ts.map +1 -0
  29. package/dist/failover.js +289 -0
  30. package/dist/failover.js.map +1 -0
  31. package/dist/freshness.d.ts +65 -0
  32. package/dist/freshness.d.ts.map +1 -0
  33. package/dist/freshness.js +148 -0
  34. package/dist/freshness.js.map +1 -0
  35. package/dist/generated/agent-plane.d.ts +1865 -0
  36. package/dist/generated/agent-plane.d.ts.map +1 -0
  37. package/dist/generated/agent-plane.js +19 -0
  38. package/dist/generated/agent-plane.js.map +1 -0
  39. package/dist/idempotency.d.ts +160 -0
  40. package/dist/idempotency.d.ts.map +1 -0
  41. package/dist/idempotency.js +208 -0
  42. package/dist/idempotency.js.map +1 -0
  43. package/dist/index.d.ts +90 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +88 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/intent.d.ts +163 -0
  48. package/dist/intent.d.ts.map +1 -0
  49. package/dist/intent.js +82 -0
  50. package/dist/intent.js.map +1 -0
  51. package/dist/json.d.ts +49 -0
  52. package/dist/json.d.ts.map +1 -0
  53. package/dist/json.js +259 -0
  54. package/dist/json.js.map +1 -0
  55. package/dist/key.d.ts +64 -0
  56. package/dist/key.d.ts.map +1 -0
  57. package/dist/key.js +71 -0
  58. package/dist/key.js.map +1 -0
  59. package/dist/payment.d.ts +172 -0
  60. package/dist/payment.d.ts.map +1 -0
  61. package/dist/payment.js +178 -0
  62. package/dist/payment.js.map +1 -0
  63. package/dist/refusal.d.ts +121 -0
  64. package/dist/refusal.d.ts.map +1 -0
  65. package/dist/refusal.js +176 -0
  66. package/dist/refusal.js.map +1 -0
  67. package/dist/retry.d.ts +215 -0
  68. package/dist/retry.d.ts.map +1 -0
  69. package/dist/retry.js +297 -0
  70. package/dist/retry.js.map +1 -0
  71. package/dist/typeid.d.ts +64 -0
  72. package/dist/typeid.d.ts.map +1 -0
  73. package/dist/typeid.js +119 -0
  74. package/dist/typeid.js.map +1 -0
  75. package/dist/types.d.ts +245 -0
  76. package/dist/types.d.ts.map +1 -0
  77. package/dist/types.js +14 -0
  78. package/dist/types.js.map +1 -0
  79. package/package.json +58 -3
@@ -0,0 +1,1865 @@
1
+ /**
2
+ * Wire types for the Axorum agent plane, generated from the frozen contract at
3
+ * `spec/openapi/agent-plane.v1.json`.
4
+ *
5
+ * DO NOT EDIT BY HAND — run `pnpm generate`.
6
+ *
7
+ * Field names are the wire's own: `snake_case` here means `snake_case` on the wire.
8
+ * Every `integer` in the contract is typed `bigint`, because the contract's integers
9
+ * include 128-bit money that a JavaScript `number` silently truncates; `src/json.ts`
10
+ * decodes and encodes them to match.
11
+ */
12
+ export interface paths {
13
+ "/api/v1/accounts/{id}/balance": {
14
+ parameters: {
15
+ query?: never;
16
+ header?: never;
17
+ path?: never;
18
+ cookie?: never;
19
+ };
20
+ /** `GET /api/v1/accounts/{id}/balance` — an account's net balance. */
21
+ get: operations["get_balance"];
22
+ put?: never;
23
+ post?: never;
24
+ delete?: never;
25
+ options?: never;
26
+ head?: never;
27
+ patch?: never;
28
+ trace?: never;
29
+ };
30
+ "/api/v1/currencies": {
31
+ parameters: {
32
+ query?: never;
33
+ header?: never;
34
+ path?: never;
35
+ cookie?: never;
36
+ };
37
+ /**
38
+ * `GET /api/v1/currencies` — the ledger's currency registry.
39
+ * @description Any bound agent may read it, with the same attestation its intents carry. A
40
+ * rail reads it at boot with its `[gate] attestation` and refuses to become ready
41
+ * unless its currency is declared at the scale it parses amounts at. The
42
+ * registry is the deployment's configuration, not a party's data, so it is not
43
+ * owner-scoped. It is bounded by `max_currencies` and sits inside the read
44
+ * ceiling.
45
+ */
46
+ get: operations["currencies"];
47
+ put?: never;
48
+ post?: never;
49
+ delete?: never;
50
+ options?: never;
51
+ head?: never;
52
+ patch?: never;
53
+ trace?: never;
54
+ };
55
+ "/api/v1/intents": {
56
+ parameters: {
57
+ query?: never;
58
+ header?: never;
59
+ path?: never;
60
+ cookie?: never;
61
+ };
62
+ get?: never;
63
+ put?: never;
64
+ /**
65
+ * `POST /api/v1/intents` — submit an intent envelope.
66
+ * @description Commits at the current server tick with the boundary wall-clock. A committed
67
+ * but forbidden transaction (`ForbiddenRejected`) is a **success** — 200 with
68
+ * `posted:false` — not a transport error.
69
+ */
70
+ post: operations["submit_intent"];
71
+ delete?: never;
72
+ options?: never;
73
+ head?: never;
74
+ patch?: never;
75
+ trace?: never;
76
+ };
77
+ "/api/v1/obligations": {
78
+ parameters: {
79
+ query?: never;
80
+ header?: never;
81
+ path?: never;
82
+ cookie?: never;
83
+ };
84
+ /**
85
+ * `GET /api/v1/obligations?actor=…` — the duties the **calling agent's party**
86
+ * owes.
87
+ */
88
+ get: operations["get_obligations"];
89
+ put?: never;
90
+ post?: never;
91
+ delete?: never;
92
+ options?: never;
93
+ head?: never;
94
+ patch?: never;
95
+ trace?: never;
96
+ };
97
+ "/api/v1/policies/active": {
98
+ parameters: {
99
+ query?: never;
100
+ header?: never;
101
+ path?: never;
102
+ cookie?: never;
103
+ };
104
+ /** `GET /api/v1/policies/active` — the id of the policy in force, or `null`. */
105
+ get: operations["active_policy"];
106
+ put?: never;
107
+ post?: never;
108
+ delete?: never;
109
+ options?: never;
110
+ head?: never;
111
+ patch?: never;
112
+ trace?: never;
113
+ };
114
+ "/api/v1/transactions/{txn_id}": {
115
+ parameters: {
116
+ query?: never;
117
+ header?: never;
118
+ path?: never;
119
+ cookie?: never;
120
+ };
121
+ /**
122
+ * `GET /api/v1/transactions/{txn_id}` — the stored record (idempotent replay
123
+ * lookup without resubmitting).
124
+ */
125
+ get: operations["get_transaction"];
126
+ put?: never;
127
+ post?: never;
128
+ delete?: never;
129
+ options?: never;
130
+ head?: never;
131
+ patch?: never;
132
+ trace?: never;
133
+ };
134
+ "/api/v1/transactions/{txn_id}/receipt": {
135
+ parameters: {
136
+ query?: never;
137
+ header?: never;
138
+ path?: never;
139
+ cookie?: never;
140
+ };
141
+ /**
142
+ * `GET /api/v1/transactions/{txn_id}/receipt` — the signed receipt,
143
+ * re-minted deterministically from the stored record and re-signed
144
+ * (`spec/evidence-signing.md` §3.6 surface 2). Byte-identical to the inline
145
+ * receipt the submission carried, because both are minted from the applied
146
+ * record's facts and Ed25519 is deterministic.
147
+ */
148
+ get: operations["get_receipt"];
149
+ put?: never;
150
+ post?: never;
151
+ delete?: never;
152
+ options?: never;
153
+ head?: never;
154
+ patch?: never;
155
+ trace?: never;
156
+ };
157
+ "/api/v1/usages/{id}": {
158
+ parameters: {
159
+ query?: never;
160
+ header?: never;
161
+ path?: never;
162
+ cookie?: never;
163
+ };
164
+ /** `GET /api/v1/usages/{id}` — one usage balance, readable only by its owner. */
165
+ get: operations["get_usage"];
166
+ put?: never;
167
+ post?: never;
168
+ delete?: never;
169
+ options?: never;
170
+ head?: never;
171
+ patch?: never;
172
+ trace?: never;
173
+ };
174
+ }
175
+ export type webhooks = Record<string, never>;
176
+ export interface components {
177
+ schemas: {
178
+ /** @description A concrete action reference with bound argument values. */
179
+ ActionTerm: {
180
+ /**
181
+ * @description The action being referenced, e.g. `post`.
182
+ * @example post
183
+ */
184
+ action: string;
185
+ /** @description The argument values bound by parameter name. */
186
+ bindings: {
187
+ [key: string]: components["schemas"]["Value"];
188
+ };
189
+ };
190
+ /** @description The `GET /api/v1/policies/active` response. */
191
+ ActivePolicyResponse: {
192
+ /**
193
+ * @description The id of the policy in force (`pol_…`), or `null` if none is.
194
+ *
195
+ * Always present — `null` is emitted explicitly, never omitted.
196
+ */
197
+ policy: string | null;
198
+ };
199
+ /**
200
+ * @description What the agent receives back — the outcome typology.
201
+ *
202
+ * A `ForbiddenRejected` verdict arrives here with `posted: false` on a **200**:
203
+ * the transaction reached the commit point, was judged, and the refusal was
204
+ * recorded. It is a protocol success, not a transport failure.
205
+ */
206
+ AgentOutcome: {
207
+ /**
208
+ * Format: int64
209
+ * @description Authoritative ledger tick of this exact transaction occurrence.
210
+ */
211
+ commit_tick: bigint;
212
+ /**
213
+ * @description Present exactly when `replayed` is: `true` when the ledger compared this
214
+ * retry's content with the stored intent and they matched, `false` when it
215
+ * had no stored content to compare with. That happens only for an id
216
+ * committed before 1.0.0 whose content hash the old log never recorded,
217
+ * retried by the party that committed it (or by any party, when the
218
+ * committer was never recorded either), and only until the replay window
219
+ * that follows the upgrade expires: every
220
+ * id committed on 1.0.0 carries its hash. A `false` replay still posted
221
+ * nothing; it means the retry's content was not checked, so a caller that
222
+ * changed it learns nothing from this answer about the change. Absent
223
+ * (never `null`) on a first answer.
224
+ */
225
+ content_verified?: boolean;
226
+ /**
227
+ * @description The lowercase-hex SHA-256 of the justification the transaction was
228
+ * committed with. On a replay it is the committed one, not the one the
229
+ * retry sent, and it matches the receipt's; only a replay with
230
+ * `content_verified: false` of an id folded before 1.0.0 carries the
231
+ * retry's, because no committed hash was kept.
232
+ */
233
+ justification_hash: string;
234
+ /** @description Every open obligation this party owes or may perform after the commit. */
235
+ obligations_pending: components["schemas"]["ObligationInstance"][];
236
+ /** @description The policy in force at commit time. */
237
+ policy: string;
238
+ /**
239
+ * @description Whether the entries were posted. `false` **iff** the verdict is
240
+ * `ForbiddenRejected`.
241
+ */
242
+ posted: boolean;
243
+ /** @description The audit trail. */
244
+ provenance: components["schemas"]["OutcomeProvenance"];
245
+ /**
246
+ * @description The signed receipt — present only when the deployment signs artifacts
247
+ * and the signing sidecar answered. **Absent is not an error**: the
248
+ * commit stands either way, and `GET /transactions/{txn_id}/receipt`
249
+ * re-mints the identical receipt once signing is restored.
250
+ */
251
+ receipt?: components["schemas"]["Envelope"];
252
+ /**
253
+ * @description Why the intent was refused — present **iff** `posted` is `false`, and
254
+ * absent (never `null`) on every outcome that posted. Branch on
255
+ * `refusal.code`; for policy-specific reasons, branch on
256
+ * `refusal.rule.name`, which you declared.
257
+ *
258
+ * Not covered by `receipt`: the receipt signs the provenance and the
259
+ * policy hash, and the refusal is derived from them deterministically,
260
+ * so a verifier recomputes it from signed facts rather than trusting
261
+ * these bytes.
262
+ */
263
+ refusal?: components["schemas"]["Refusal"];
264
+ /**
265
+ * @description `true` when this answer replays an earlier commit of the same
266
+ * `transaction` id with the same content: the ledger judged and posted
267
+ * **once**, on the first submit, and this retry changed nothing. Every
268
+ * other field is the original answer's. Absent (never `false`, never
269
+ * `null`) on a first answer.
270
+ */
271
+ replayed?: boolean;
272
+ /** @description The transaction id — an echo of the submission. */
273
+ transaction: string;
274
+ /** @description The five-member deontic verdict. */
275
+ verdict: components["schemas"]["Verdict"];
276
+ };
277
+ /** @description A monetary amount in integer minor units. */
278
+ Amount: {
279
+ /**
280
+ * @description The ISO-4217-style currency the minor units are denominated in.
281
+ * @example USD
282
+ */
283
+ currency: string;
284
+ /**
285
+ * @description The value in minor units (e.g. cents).
286
+ *
287
+ * **A 128-bit integer, emitted as a bare JSON number.** Its range exceeds
288
+ * what an IEEE-754 double represents exactly, so a client whose JSON parser
289
+ * decodes numbers as doubles (JavaScript's `JSON.parse`, notably) must decode
290
+ * this field as a big integer to avoid silent precision loss on large values.
291
+ * No standard numeric `format` expresses this range, which is why it is spelled
292
+ * out here instead.
293
+ * @example 50000
294
+ */
295
+ minor: bigint;
296
+ };
297
+ /**
298
+ * @description The structured error body every non-2xx agent-plane response carries.
299
+ *
300
+ * `error` is a **stable `snake_case` code** an authoring loop can branch on —
301
+ * never an internal type or variant name — and `message` is human prose. Some
302
+ * codes carry extra structured fields alongside (documented per-field below); a
303
+ * client should branch on `error` and ignore fields it does not know.
304
+ */
305
+ ApiError: {
306
+ /** @description The offending action (`capability_mapping`). */
307
+ action?: string;
308
+ /** @description The policy actually in force (`stale_policy`, `policy_pin_mismatch`). */
309
+ active?: string;
310
+ /**
311
+ * @description What the caller must change (`substrate_rejected` with `kind:
312
+ * "validation"`), present only when the refusal broke no law but was
313
+ * malformed in a way the caller can fix; a body carries `law` or `cause`,
314
+ * never both.
315
+ *
316
+ * An **open** vocabulary. The known values are below
317
+ * (and in `spec/fixtures/causes-v1.json`); a client MUST tolerate a value
318
+ * it does not know, because a later contract may add a cause without a
319
+ * major version. Fall back to `message`.
320
+ *
321
+ * | cause | meaning | what to do next |
322
+ * |---|---|---|
323
+ * | `unknown_account` | an entry names an account the ledger has not provisioned | provision the account, or post to one that exists |
324
+ * | `account_revoked` | an entry names a revoked account | post to an active account |
325
+ * | `currency_mismatch` | an amount's currency differs from its account's, mandate's, usage balance's, deferral's or register's | submit the amount in that currency |
326
+ * | `non_positive_amount` | an amount is zero or negative | make every entry amount positive |
327
+ * | `entry_count` | too few or too many entries | submit at least two legs and no more than the ledger's bound |
328
+ * | `amount_overflow` | an amount or a running total is out of the representable range | split the transaction into smaller amounts |
329
+ * | `unknown_mandate` | the intent charges a mandate the ledger does not hold | charge a mandate the ledger holds, or have a principal issue it |
330
+ * | `mandate_revoked` | the intent charges a revoked mandate | charge an active mandate |
331
+ * | `unknown_usage` | the ledger records an owner for a usage balance that is not open, an inconsistency no intent can cause (a move naming a missing balance answers usage_not_owned) | nothing the caller can change; report it to the operator |
332
+ * | `usage_not_owned` | the intent moves a usage balance its agent does not own, or one that does not exist (both answer alike, so a usage id reveals nothing) | move a usage balance the acting agent owns |
333
+ * | `unknown_deferral` | the intent recognizes from a deferral the ledger does not hold | recognize from a deferral the ledger holds |
334
+ * | `unknown_counterparty` | a counterparty the intent names is not in the imported registry | import the counterparty, or name a registered one |
335
+ * | `counterparty_mandate_unresolved` | a counterparty-scoped cap needs a mandate charge the intent does not carry, or whose root cannot be resolved | charge the intent to a mandate whose chain resolves to a root |
336
+ * | `undeclared_action` | the action is not declared by the policy in force | use an action the policy declares, or ask a principal to declare it |
337
+ * | `missing_param` | a parameter the action declares, or a rule reads, is not bound | bind every parameter the action declares |
338
+ * | `unexpected_param` | a parameter is bound that the action does not declare | remove the parameters the action does not declare |
339
+ * | `param_type_mismatch` | a parameter is bound with a value of the wrong type | bind the parameter with the type the action declares |
340
+ * | `period_closed` | the intent posts into a closed or unknown fiscal period | post into an open fiscal period |
341
+ * | `undeclared_currency` | the intent, or an instrument it opens, is in a currency the deployment never declared | use a declared currency, or ask the operator to declare it (`[currencies]`) |
342
+ * @example unknown_account
343
+ */
344
+ cause?: string;
345
+ /** @description The currencies the spend moved (`multi_currency_mandate_charge`). */
346
+ currencies?: string[];
347
+ /**
348
+ * @description The stable `snake_case` error code.
349
+ *
350
+ * Reachable on the agent plane:
351
+ *
352
+ * | code | status | meaning |
353
+ * |---|---|---|
354
+ * | `invalid_transaction_id` | 400 | the path segment is not a transaction id |
355
+ * | `invalid_account_id` | 400 | the path segment is not an account id |
356
+ * | `unknown_agent` | 401 | the `agent://` URI is not bound |
357
+ * | `attestation` | 403 | the PASETO attestation was rejected |
358
+ * | `unknown_transaction` | 404 | no such transaction |
359
+ * | `unknown_account` | 404 | no such account |
360
+ * | `stale_policy` | 409 | the pinned policy is not the one in force (pre-check); carries `pinned`/`active` |
361
+ * | `policy_pin_mismatch` | 409 | the policy changed between check and record; **nothing was written**; carries `pinned`/`active` |
362
+ * | `no_active_policy` | 409 | no policy is in force |
363
+ * | `transaction_reused` | 409 | the transaction id was committed with different content; **nothing was written**; carries `stored_content_hash`/`submitted_content_hash`, present only to the party that committed the id; for an id whose stored content is unknown (committed before 1.0.0) it is raised, with neither hash, for any party but the one that committed the id, which gets a replay with `content_verified: false` |
364
+ * | `stale_idempotency_key` | 409 | the envelope's `minted_at_ms` is older than the advertised idempotency window less a 5-minute skew margin; **nothing was written**; checked only when the heartbeat runs |
365
+ * | `body_too_large` | 413 | the request body is larger than the route accepts; refused before the handler ran; **nothing was written** |
366
+ * | `unsupported_media_type` | 415 | the request body was not sent as `Content-Type: application/json`; refused before the handler ran; **nothing was written** |
367
+ * | `not_primary` | 421 | cluster mode: a mutation reached a non-primary; carries `primary_api_addr` |
368
+ * | `invalid_envelope` | 422 | the request body is not JSON, is cut short, or does not fit the envelope; the message gives the serde path and a short reason and never repeats a value from the body; refused before the handler ran; **nothing was written** |
369
+ * | `invalid_agent_uri` | 422 | the `agent://` URI is malformed; carries `uri` |
370
+ * | `capability_mapping` | 422 | the action maps to no capability; carries `action` |
371
+ * | `rail_capability_mapping` | 422 | the declared rail's name maps to no valid capability path |
372
+ * | `multi_currency_mandate_charge` | 422 | a mandate-bound spend moved outflow in >1 currency; carries `currencies` |
373
+ * | `invalid_key_mint` | 422 | the retry key's mint time is refused: `minted_at_ms` or the `UUIDv7` transaction id's own time is more than the 5-minute skew margin ahead of the service's clock, or the two differ by more than it; the message names the check and its bound; **nothing was written** |
374
+ * | `invalid_fulfillment` | 422 | the selected duties cannot be fulfilled by this intent; no mutation and no target existence or ownership disclosure |
375
+ * | `substrate_rejected` | 422 | the ledger refused the transaction; carries `kind: "validation"`, and `law` when a conservation law fired or `cause` when the caller must change the intent |
376
+ * | `gateway_error` | 422 | a gateway rejection with no more specific code |
377
+ * | `substrate_rejected` | 507 | a ledger capacity bound was breached; carries `kind: "capacity"` |
378
+ * | `snapshot_capacity` | 507 | cluster mode: the next snapshot frame, with this commit in it, would pass half the snapshot store; **nothing was written**; `Retry-After` names when a sweep evicts enough aged ids, a lower bound after a view change, and is absent when ageing alone cannot make room (an operator resizes the store) or the heartbeat is off |
379
+ * | `idempotency_window_full` | 507 | the idempotency index is at its byte budget; refused at apply: **no ledger state changed and the id is not recorded**; ids held inside the window still replay; `Retry-After` names when a sweep evicts enough aged ids, a lower bound after a view change, and is absent when ageing alone cannot make room or the heartbeat is off |
380
+ * | `idempotency_seed_refused` | 500 | the ledger refused this primary's idempotency seed; **this request was not proposed and nothing was written**; terminal: do not retry (no `Retry-After`) |
381
+ * | `commit_unavailable` | 503 | cluster mode: the request was proposed and its commit could not be confirmed; **in doubt**: it may yet commit; carries `reason` |
382
+ * | `idempotency_unseeded` | 503 | the idempotency index is not seeded yet; **this request was not written and will not be**: the primary stopped it before proposing it, or a replica that had not applied the seed refused it at apply; retry the same request. Says nothing about the transaction id, which an earlier attempt may still commit |
383
+ * | `not_normal` | 503 | cluster mode: the replica is in a view change or a recovery; **this request was not proposed and nothing was written**; retry the same request shortly: once the change ends, the replica proposes it or answers `421 not_primary`. Says nothing about the transaction id, which an earlier attempt may still commit |
384
+ * | `archive_pressure` | 503 | cluster mode: the primary holds more records for its local archive than its ceiling allows and takes no client write until the archive catches up; **this request was not proposed and nothing was written**; retry the same request later. Says nothing about the transaction id, which an earlier attempt may still commit |
385
+ * | `quarantined` | 503 | replay verification found a divergence on this node; **this request was not proposed and nothing was written**; it does not clear on its own |
386
+ * | `proposal_refused` | 500 | cluster mode: the node refused the proposal for a reason this build does not name; **this request was not proposed and nothing was written** |
387
+ * @example unknown_transaction
388
+ */
389
+ error: string;
390
+ /** @description `"validation"` (422) or `"capacity"` (507) (`substrate_rejected`). */
391
+ kind?: string;
392
+ /**
393
+ * @description The substrate conservation law the transaction would have broken
394
+ * (`substrate_rejected` with `kind: "validation"`), present only on a
395
+ * genuine law violation and absent on malformed input (an unknown or
396
+ * revoked account, a non-positive amount, too few entries). An **open**
397
+ * vocabulary: a client MUST tolerate a law it does not know and fall back
398
+ * to `message`. The laws are specified under `spec/`:
399
+ *
400
+ * | law | invariant | spec |
401
+ * |---|---|---|
402
+ * | `conservative` | debits equal credits, per currency | substrate law 1 |
403
+ * | `authorization_conservation` | `0 ≤ executed ≤ ceiling` on a mandate | `authorization-conservation-law-sketch.md` §3 |
404
+ * | `revenue_cost_matching` | `0 ≤ recognized ≤ deferred` | substrate law 4 |
405
+ * | `usage_balance_conservation` | `0 ≤ billed ≤ metered ≤ consumed` | `usage-conservation-law.md` §3–4 |
406
+ * | `period_close_roll_forward` | a period closes only once ended, with nothing posted past its end | `period-close-law.md` §2 |
407
+ * @example usage_balance_conservation
408
+ */
409
+ law?: string;
410
+ /**
411
+ * @description Human-readable prose. For `policy_pin_mismatch` this is plain
412
+ * compliance-English stating that nothing was recorded.
413
+ */
414
+ message: string;
415
+ /** @description The policy the request pinned (`stale_policy`, `policy_pin_mismatch`). */
416
+ pinned?: string;
417
+ /**
418
+ * @description The primary's API origin, as the replica that answered last knew it
419
+ * (`not_primary`): the `[cluster.node] api_addr` the primary advertises. A
420
+ * hint, not a redirect: it can name a primary that has just died.
421
+ *
422
+ * Itself nullable: `not_primary` carries the key with a `null` value when the
423
+ * primary's origin is unknown.
424
+ */
425
+ primary_api_addr?: string | null;
426
+ /**
427
+ * @description Why the commit is unconfirmed / the node is not primary
428
+ * (`commit_unavailable`, `not_primary`).
429
+ */
430
+ reason?: string;
431
+ /**
432
+ * @description The lowercase-hex SHA-256 content hash of the intent already committed
433
+ * under this transaction id (`transaction_reused`). Present only to the
434
+ * party that committed the id: to any other party it would reveal what
435
+ * that party intended, so its refusal carries neither hash.
436
+ */
437
+ stored_content_hash?: string;
438
+ /**
439
+ * @description The lowercase-hex SHA-256 content hash of the intent this request
440
+ * submitted (`transaction_reused`). Present only to the party that
441
+ * committed the id, with `stored_content_hash`.
442
+ */
443
+ submitted_content_hash?: string;
444
+ /** @description The offending URI (`invalid_agent_uri`, `unknown_agent`). */
445
+ uri?: string;
446
+ };
447
+ /** @description The `GET /api/v1/accounts/{id}/balance` response. */
448
+ BalanceResponse: {
449
+ /** @description The account, echoed back **exactly as supplied** in the path. */
450
+ account: string;
451
+ /**
452
+ * @description The account's net balance in minor units.
453
+ *
454
+ * **A 128-bit integer, emitted as a bare JSON number** — see the note on
455
+ * `Amount.minor`: decode it as a big integer, not a double, or large values
456
+ * lose precision silently.
457
+ * @example 50000
458
+ */
459
+ balance: bigint;
460
+ };
461
+ /**
462
+ * @description One clause of the refusing forbid's guard and the literal that satisfied
463
+ * it (the first satisfied literal, where evaluation stopped).
464
+ */
465
+ Condition: {
466
+ /**
467
+ * Format: int32
468
+ * @description The zero-based clause position in the rule's guard.
469
+ */
470
+ clause: bigint;
471
+ /**
472
+ * Format: int32
473
+ * @description The index into `figures` of the comparison this literal made.
474
+ */
475
+ figure?: bigint;
476
+ /**
477
+ * @description What the literal tested. An **open** vocabulary:
478
+ *
479
+ * | kind | the literal compared |
480
+ * |---|---|
481
+ * | `register_cap` | an aggregate register to a constant |
482
+ * | `counterparty_limit` | an amount to a counterparty's registry-carried limit |
483
+ * | `mandate_cap` | a mandate's spent / ceiling / remaining / projected quantity to a cap |
484
+ * | `counterparty_list` | membership in the approved-counterparty list |
485
+ * | `chart_of_accounts` | membership in the chart of accounts |
486
+ * | `posting_period` | membership in an open fiscal period |
487
+ * | `posted_balance` | a posted balance to an amount |
488
+ * | `time_window` | the event clock to a constant |
489
+ * | `actor` | the acting party to a party |
490
+ * | `param` | an intent parameter to a constant or another parameter |
491
+ * @example register_cap
492
+ */
493
+ kind: string;
494
+ /**
495
+ * Format: int32
496
+ * @description The zero-based literal position within the clause.
497
+ */
498
+ literal: bigint;
499
+ /**
500
+ * @description Present and `true` when the literal is negated; a negated literal is
501
+ * satisfied when its comparison is false.
502
+ */
503
+ negated?: boolean;
504
+ /**
505
+ * @description The intent parameter the literal reads, when it reads one.
506
+ * @example payee
507
+ */
508
+ param?: string;
509
+ };
510
+ /**
511
+ * @description A declared currency the policy in force cannot let some action commit in.
512
+ *
513
+ * Every intent on one of `actions` in this currency is refused at commit with
514
+ * `422` and `cause: "currency_mismatch"`, whatever its parameters: a register
515
+ * the action feeds sums money in another currency, and a register never mixes
516
+ * two. An agent cannot change that. Pay in a currency with no warning, or hand
517
+ * `remedy` to a human operator.
518
+ *
519
+ * Only the actions are named. Which register closes each one is policy
520
+ * structure, reported on the admin plane.
521
+ */
522
+ CurrencyWarning: {
523
+ /**
524
+ * @description The actions refused in this currency, in canonical (sorted) order.
525
+ * Never empty.
526
+ * @example [
527
+ * "purchase"
528
+ * ]
529
+ */
530
+ actions: string[];
531
+ /**
532
+ * @description Why the warning is here. An **open** vocabulary; the known value is below.
533
+ *
534
+ * | code | meaning |
535
+ * |---|---|
536
+ * | `DSL3002` | the policy in force refuses `actions` in this currency |
537
+ *
538
+ * The same code `axorum policy check --currencies` prints for the same
539
+ * finding. A client MUST tolerate a code it does not know.
540
+ * @example DSL3002
541
+ */
542
+ code: string;
543
+ /**
544
+ * @description What an operator does about it, verbatim: the same sentence
545
+ * `spec/fixtures/remedies-v1.json` pins for the `policy_currency` remedy.
546
+ * @example the policy in force does not speak EUR: activate a policy whose aggregates are in EUR
547
+ */
548
+ remedy: string;
549
+ };
550
+ /** @description The `GET /api/v1/currencies` response: the ledger's currency registry. */
551
+ DeclaredCurrencies: {
552
+ /**
553
+ * @description Every standing declaration, in canonical (sorted) code order. Empty
554
+ * means nothing is declared, and the ledger then refuses every intent that
555
+ * names a currency.
556
+ */
557
+ currencies: components["schemas"]["DeclaredCurrency"][];
558
+ };
559
+ /** @description One standing declaration in the ledger's currency registry. */
560
+ DeclaredCurrency: {
561
+ /**
562
+ * @description The declared currency code: three to eight uppercase ASCII letters.
563
+ * @example USD
564
+ */
565
+ currency: string;
566
+ /**
567
+ * Format: int32
568
+ * @description How many decimal digits one minor unit of the currency is worth: `2` for
569
+ * `USD` (a stored `1250` is $12.50), `6` for `USDC`, `0` for `JPY`.
570
+ * @example 2
571
+ */
572
+ exponent: bigint;
573
+ /**
574
+ * @description Present only when the policy in force refuses some action in this
575
+ * currency whatever the proposal; omitted, never `null`, otherwise.
576
+ */
577
+ warning?: components["schemas"]["CurrencyWarning"];
578
+ };
579
+ /** @description A single journal leg: a positive amount posted to one side of one account. */
580
+ Entry: {
581
+ /**
582
+ * @description The account this leg posts to (`acc_…`).
583
+ * @example acc_2n4kqx21g5bty927z2tj955css
584
+ */
585
+ account: string;
586
+ /** @description The positive amount posted (magnitude only — `side` carries the sign). */
587
+ amount: components["schemas"]["Amount"];
588
+ /** @description Whether the leg is a debit or a credit. */
589
+ side: components["schemas"]["Side"];
590
+ };
591
+ /**
592
+ * @description A detached-payload signature envelope — `axorum.evidence.v0`
593
+ * (`spec/evidence-signing.md` §3.1, committed JSON Schema at
594
+ * `spec/schemas/axorum.evidence.v0.schema.json`). The `payload` carries the
595
+ * exact signed bytes (base64), so verification needs nothing but this
596
+ * envelope and the deployment's published key list — no server, no
597
+ * canonicalization.
598
+ */
599
+ Envelope: {
600
+ /**
601
+ * @description The operator-set deployment identifier — whose ledger signed this.
602
+ * Inside the signed message: no artifact transplants across deployments.
603
+ */
604
+ deployment: string;
605
+ /**
606
+ * @description The signing key's id: lowercase-hex SHA-256 of the 32-byte Ed25519
607
+ * public key, resolvable in the published key list.
608
+ */
609
+ key_id: string;
610
+ /**
611
+ * @description The artifact kind — for a receipt, `receipt`. One of the six closed
612
+ * kind strings; the kind is inside the signed message, so a signature
613
+ * cannot be replayed across kinds.
614
+ * @example receipt
615
+ */
616
+ kind: string;
617
+ /**
618
+ * @description The exact payload bytes, standard base64 (for a receipt: the compact
619
+ * `axorum.receipt.v0` JSON).
620
+ */
621
+ payload: string;
622
+ /** @description The 64-byte Ed25519 signature, 128 lowercase hex characters. */
623
+ signature: string;
624
+ /**
625
+ * @description The envelope format version — always `axorum.evidence.v0`.
626
+ * @example axorum.evidence.v0
627
+ */
628
+ version: string;
629
+ };
630
+ /**
631
+ * @description One exact comparison the refusing forbid's guard made.
632
+ *
633
+ * **Every amount is a 128-bit integer emitted as a bare JSON number** in
634
+ * minor units of `currency` (a plain count when `currency` is absent), like
635
+ * `Amount.minor`: decode it as a big integer.
636
+ *
637
+ * **Disclosure.** `current`, `compared` and `headroom` are a cell's running
638
+ * total, and a cell may accumulate other parties' activity, so they are
639
+ * present only for the caller's own cells: a `per_party` register (always
640
+ * the acting party's cell) and the agent's own mandate, the one the intent
641
+ * charges (on a refusal, the bound mandate the cap was evaluated against). A
642
+ * bound agent's non-spend intent charges nothing, so its own mandate's
643
+ * figure is withheld too, deliberately. Every other figure omits all three
644
+ * (absent means withheld from this caller, never zero) and keeps `source`,
645
+ * its register or mandate fields, `op`, `negated`, `currency`, `attempted`,
646
+ * `limit` and `held`. A counterparty cell always names the counterparty the
647
+ * intent itself named. `current` and `compared` are present together or not
648
+ * at all, and `headroom` only beside them.
649
+ */
650
+ Figure: {
651
+ /**
652
+ * @description This intent's own contribution.
653
+ * @example 50000
654
+ */
655
+ attempted: bigint;
656
+ /**
657
+ * @description What was compared against `limit`: `current + attempted` for a
658
+ * projected read, `current` otherwise. Absent exactly when `current` is.
659
+ * @example 170000
660
+ */
661
+ compared?: bigint;
662
+ /** @description The counterparty cell, for a counterparty-scoped register. */
663
+ counterparty?: components["schemas"]["FigureCounterparty"];
664
+ /**
665
+ * @description The currency the amounts are counted in; absent for a count register.
666
+ * @example USD
667
+ */
668
+ currency?: string;
669
+ /**
670
+ * @description The quantity before this intent. Absent when the cell is not the
671
+ * caller's own (see **Disclosure**).
672
+ * @example 120000
673
+ */
674
+ current?: bigint;
675
+ /**
676
+ * Format: int32
677
+ * @description The deployment's declared minor-unit exponent for `currency`; absent
678
+ * when the currency is undeclared.
679
+ * @example 2
680
+ */
681
+ exponent?: bigint;
682
+ /**
683
+ * @description The largest `attempted` for which this literal would not have held;
684
+ * zero or negative when no amount clears it. Absent when the comparison
685
+ * does not bound the attempt, and always absent when `current` is.
686
+ * @example 30000
687
+ */
688
+ headroom?: bigint;
689
+ /** @description Whether the literal was satisfied, polarity applied. */
690
+ held: boolean;
691
+ /**
692
+ * @description The right-hand side of the comparison.
693
+ * @example 150000
694
+ */
695
+ limit: bigint;
696
+ /** @description The spending mandate read (`mand_…`). */
697
+ mandate?: string;
698
+ /** @description Present and `true` when the literal is negated. */
699
+ negated?: boolean;
700
+ /**
701
+ * @description The comparison as the policy wrote it. An **open** vocabulary: `eq`,
702
+ * `ne`, `lt`, `le`, `gt`, `ge`, `in`.
703
+ * @example gt
704
+ */
705
+ op: string;
706
+ /**
707
+ * @description Which mandate quantity was read. An **open** vocabulary: `spent`,
708
+ * `ceiling`, `remaining`, `projected`.
709
+ * @example projected
710
+ */
711
+ quantity?: string;
712
+ /**
713
+ * @description The aggregate register read.
714
+ * @example daily_vendor_spend
715
+ */
716
+ register?: string;
717
+ /**
718
+ * @description How the register partitions its accumulation. An **open** vocabulary:
719
+ * `per_party`, `per_role`, `per_counterparty`, `per_rail`, `global`.
720
+ * @example per_counterparty
721
+ */
722
+ scope?: string;
723
+ /**
724
+ * @description What was read. An **open** vocabulary: `register` (carries `register`,
725
+ * `window`, `scope`) or `mandate` (carries `mandate`, `quantity`).
726
+ * @example register
727
+ */
728
+ source: string;
729
+ /** @description The window the register accumulates over. */
730
+ window?: components["schemas"]["FigureWindow"];
731
+ };
732
+ /** @description The counterparty cell a counterparty-scoped register read resolved to. */
733
+ FigureCounterparty: {
734
+ /**
735
+ * @description The registry's display name, when it has one.
736
+ * @example Acme Corp
737
+ */
738
+ display_name?: string;
739
+ /**
740
+ * @description The registry-resolved counterparty key.
741
+ * @example acme
742
+ */
743
+ key: string;
744
+ };
745
+ /** @description The window a register figure accumulates over. */
746
+ FigureWindow: {
747
+ /**
748
+ * @description An **open** vocabulary: `rolling`, `calendar`, `unbounded`.
749
+ * @example rolling
750
+ */
751
+ kind: string;
752
+ /**
753
+ * Format: int64
754
+ * @description The window's width in ticks; absent for `unbounded`.
755
+ * @example 86400
756
+ */
757
+ ticks?: bigint;
758
+ };
759
+ /** @description What an agent submits — the intent protocol. */
760
+ IntentEnvelope: {
761
+ /** @description The proposed deontic action and its typed bindings. */
762
+ action: components["schemas"]["ActionTerm"];
763
+ /**
764
+ * @description The agent's `agent://` URI, e.g.
765
+ * `agent://example.com/agent/clerk_01h455vb4pex5vsknk084sn02q`.
766
+ * @example agent://example.com/agent/clerk_01h455vb4pex5vsknk084sn02q
767
+ */
768
+ agent: string;
769
+ /** @description The PASETO v4.public capability attestation proving the agent may act. */
770
+ attestation: string;
771
+ /**
772
+ * @description The **bill** move this intent carries, if any: a signed delta on a usage
773
+ * balance's `billed` running total — the financial recognition of metering.
774
+ * Billing past `metered` is billing without a meter basis and is refused.
775
+ * Omitted when absent, like `consume_usage`.
776
+ */
777
+ bill_usage?: components["schemas"]["UsageMove"];
778
+ /**
779
+ * @description The **consume** move this intent carries, if any: a signed delta on a
780
+ * usage balance's `consumed` running total — the ground-truth event that the
781
+ * agent used a metered resource.
782
+ *
783
+ * **Omitted entirely** when the intent consumes nothing — the key is absent,
784
+ * never `null`. A move that would break the usage-balance conservation law
785
+ * (`0 ≤ billed ≤ metered ≤ consumed`) is refused `422` (`substrate_rejected`,
786
+ * `kind: "validation"`) and **nothing posts**.
787
+ */
788
+ consume_usage?: components["schemas"]["UsageMove"];
789
+ /** @description The accounting journal legs. Debits and credits must balance per currency. */
790
+ entries: components["schemas"]["Entry"][];
791
+ /** @description Lowercase-hex SHA-256 digests of external evidence the agent references. */
792
+ evidence: string[];
793
+ fulfills?: string[];
794
+ /**
795
+ * @description The agent's stated reason. Hashed at the gateway; the hash goes on-ledger,
796
+ * the text is retained off-ledger by the caller.
797
+ */
798
+ justification: string;
799
+ /**
800
+ * @description The **meter** move this intent carries, if any: a signed delta on a usage
801
+ * balance's `metered` running total — the measurement recognition of
802
+ * consumption. Metering past `consumed` is phantom usage and is refused.
803
+ * Omitted when absent, like `consume_usage`.
804
+ */
805
+ meter_usage?: components["schemas"]["UsageMove"];
806
+ /**
807
+ * Format: int64
808
+ * @description When the retry key behind `transaction` was minted, in whole
809
+ * milliseconds since the Unix epoch. Required: an envelope without it is
810
+ * refused `422 invalid_envelope`, and nothing is recorded. A retry restates
811
+ * the first attempt's mint time, not the time of the retry.
812
+ *
813
+ * A deployment that runs a heartbeat refuses new work
814
+ * `409 stale_idempotency_key`, recording nothing, once the key is older
815
+ * than the `axorum-idempotency-window-seconds` window less a 5-minute
816
+ * clock-skew margin, because past that point the id may no longer be held
817
+ * and a resubmission could commit twice. A retry of an id the deployment
818
+ * still holds replays however old its key. Outside the intent's content: a
819
+ * resubmission restating the same key replays, and a caller-chosen id sent
820
+ * with its true mint time passes exactly as a freshly minted one does.
821
+ * @example 1758643200000
822
+ */
823
+ minted_at_ms: bigint;
824
+ /**
825
+ * @description The policy the agent believes is in force (`pol_…`) — the staleness pin.
826
+ * A stale pin is refused `409` and nothing is written.
827
+ * @example pol_2s5479gmf7bhrsavd5awacb0fg
828
+ */
829
+ policy: string;
830
+ /**
831
+ * @description The payment rail this intent arrived over, if a rail sidecar submitted it
832
+ * — `x402`, `acp`, `ap2`, `tap`. Omitted when absent, like `consume_usage`.
833
+ *
834
+ * **Attested, then recorded.** The gateway admits a rail declaration only
835
+ * from a bearer whose attested capabilities cover `<identity>/rail/<rail>`;
836
+ * naming a rail the token does not cover is rejected before evaluation
837
+ * (403, like any other capability failure). The capability attests the
838
+ * right to *declare* the rail, not that the payment crossed that wire. It
839
+ * is provenance for reporting — which sidecar says it gated this — and a
840
+ * `per rail` aggregate register accrues by it, so a policy's rail budgets
841
+ * turn on it even though no verdict reads it directly as a condition.
842
+ *
843
+ * A validated name (`[a-z0-9_]`, non-empty, ≤ 64 bytes), open rather than
844
+ * enumerated, so a rail Axorum has never heard of can still label itself.
845
+ * @example x402
846
+ */
847
+ rail?: string;
848
+ /**
849
+ * @description The **client-minted** transaction id (`txn_…`) — the substrate's
850
+ * idempotency key. Re-submitting a committed id replays its outcome.
851
+ * @example txn_7w5b4trnc7b2ja027jyyb64395
852
+ */
853
+ transaction: string;
854
+ };
855
+ /**
856
+ * @description The ERP source-version markers the verdict was decided under.
857
+ *
858
+ * Every field is **omitted** when its domain had not been imported at decision
859
+ * time — absence is meaningful, and is not the same as `null`.
860
+ */
861
+ MasterDataBasis: {
862
+ /** @description The counterparty registry in force. Omitted if never imported. */
863
+ counterparties_version?: string;
864
+ /** @description The fiscal calendar in force. Omitted if never imported. */
865
+ fiscal_periods_version?: string;
866
+ /** @description The chart of accounts in force. Omitted if never imported. */
867
+ gl_accounts_version?: string;
868
+ };
869
+ /** @description A live obligation instance — a duty bound to an actor at a tick. */
870
+ ObligationInstance: {
871
+ /** @description The obligated action — performing it discharges this instance. */
872
+ action: components["schemas"]["ActionTerm"];
873
+ /** @description The actor the obligation binds (`party_…`). */
874
+ actor: string;
875
+ /**
876
+ * Format: int64
877
+ * @description The tick the instance was anchored at (its activation tick).
878
+ */
879
+ anchor: bigint;
880
+ /**
881
+ * Format: int64
882
+ * @description The tick after which the instance breaches, or `null` if it has no
883
+ * deadline.
884
+ *
885
+ * **Always present** — a deadline-free obligation emits an explicit `null`
886
+ * rather than omitting the key.
887
+ */
888
+ deadline: bigint | null;
889
+ /** @description The deterministic instance id (`obl_…`). */
890
+ id: string;
891
+ /** @description Original action whose values were captured into this contract. */
892
+ origin_action: components["schemas"]["ActionTerm"];
893
+ /**
894
+ * Format: int64
895
+ * @description Tick of the originating transaction occurrence, retained through reparations.
896
+ */
897
+ origin_tick: bigint;
898
+ /** @description Transaction that originally incurred the duty. */
899
+ origin_transaction: string;
900
+ /** @description Parent breached duty for a reparation, otherwise null. */
901
+ parent: string | null;
902
+ /** @description Authenticated party authorized to perform this duty. */
903
+ performer: string;
904
+ /** @description Policy whose obligation contract remains in force for this duty. */
905
+ policy: string;
906
+ /** @description The rule this instance was created from (`rule_…`). */
907
+ rule: string;
908
+ /** @description The instance's lifecycle state. */
909
+ state: components["schemas"]["ObligationState"];
910
+ };
911
+ /** @description The obligation state changes recorded by one evaluation. */
912
+ ObligationOutcomes: {
913
+ /** @description Obligation instances created (born active) by this evaluation (`obl_…`). */
914
+ created: string[];
915
+ /** @description Obligation instances discharged (`obl_…`). */
916
+ discharged: string[];
917
+ /** @description Obligation instances violated (`obl_…`). */
918
+ violated: string[];
919
+ };
920
+ /**
921
+ * @description The obligation lifecycle state machine.
922
+ * @enum {string}
923
+ */
924
+ ObligationState: "Dormant" | "Active" | "Discharged" | "Violated" | "Waived" | "Expired";
925
+ /** @description The `GET /api/v1/obligations` response: duties a party owes or is authorized to perform. */
926
+ ObligationsResponse: {
927
+ /**
928
+ * @description The actor, echoed back **exactly as supplied** in the query — a party id
929
+ * or the DSL party name, not the canonicalized id.
930
+ */
931
+ actor: string;
932
+ /** @description Every open obligation this party owes or is authorized to perform. */
933
+ pending: components["schemas"]["ObligationInstance"][];
934
+ };
935
+ /**
936
+ * @description The provenance carried by a committed transaction's outcome.
937
+ *
938
+ * An **externally tagged** union with a twist: `Recorded` is an object
939
+ * (`{"Recorded": {…}}`) but `Archived` is a bare string (`"Archived"`). A client
940
+ * must accept both forms.
941
+ *
942
+ * `Archived` means the transaction committed but its record has been folded out
943
+ * of the live tail by rolling compaction. The retained `verdict` / `posted` /
944
+ * `policy` on the enclosing outcome are still true; the full audit trail must be
945
+ * read from the archived report.
946
+ */
947
+ OutcomeProvenance: {
948
+ /** @description The full, self-contained audit trail from the evaluator (the normal case). */
949
+ Recorded: components["schemas"]["Provenance"];
950
+ } | "Archived";
951
+ /**
952
+ * @description The self-contained audit record accompanying every verdict.
953
+ *
954
+ * Given the committed transaction and the referenced policy bundle, an auditor
955
+ * replaying the evaluation must obtain this identical record.
956
+ */
957
+ Provenance: {
958
+ /**
959
+ * @description The rules applicable to the input (`rule_…`), in descending-priority
960
+ * encounter order.
961
+ */
962
+ applied: string[];
963
+ /**
964
+ * @description The defeaters that fired, each a **two-element array** pairing the rule id
965
+ * it defeated with the `unless`-clause name that defeated it, e.g.
966
+ * `[["rule_1a2b…", "over_ceiling"]]`.
967
+ */
968
+ defeated: [
969
+ string,
970
+ string
971
+ ][];
972
+ /** @description The delegation(s) the actor acted under (`deleg_…`). */
973
+ delegation: string[];
974
+ /**
975
+ * @description External evidence bound at commit, carried verbatim as lowercase-hex
976
+ * SHA-256 digests.
977
+ */
978
+ evidence: string[];
979
+ /**
980
+ * @description The replicated master-data version(s) the verdict was decided under.
981
+ *
982
+ * **Omitted entirely** unless the governing policy consults a reference set
983
+ * — the key is absent, and is never `null`.
984
+ */
985
+ master_data?: components["schemas"]["MasterDataBasis"];
986
+ /** @description The obligation state changes this evaluation produced. */
987
+ obligations: components["schemas"]["ObligationOutcomes"];
988
+ /** @description The content-addressed id of the governing policy bundle (`pol_…`). */
989
+ policy: string;
990
+ /**
991
+ * Format: int32
992
+ * @description The evaluation-semantics version under which the verdict was decided.
993
+ *
994
+ * **Omitted entirely** for a pre-versioning record; the key is absent, and
995
+ * is never `null`.
996
+ */
997
+ semantics?: bigint;
998
+ /** @description The verdict reached. */
999
+ verdict: components["schemas"]["Verdict"];
1000
+ /**
1001
+ * @description The norm that determined the verdict (`rule_…`), or `null` if none did.
1002
+ *
1003
+ * **Always present** — an undetermined verdict emits an explicit `null`.
1004
+ */
1005
+ winning: string | null;
1006
+ };
1007
+ /**
1008
+ * @description The body of a `429`: the rate limiter's own error shape, not the agent plane's `ApiError`.
1009
+ *
1010
+ * The limiter answers before any agent-plane handler runs, so its refusal is
1011
+ * acton-service's `RATE_LIMIT_EXCEEDED` body. What a client does is the same
1012
+ * whatever it says: wait the response's `Retry-After` and re-send.
1013
+ */
1014
+ RateLimited: {
1015
+ /** @description `RATE_LIMIT_EXCEEDED`. */
1016
+ code: string;
1017
+ /** @description Human prose: `Too many requests`. */
1018
+ error: string;
1019
+ /**
1020
+ * Format: int32
1021
+ * @description `429`.
1022
+ */
1023
+ status: bigint;
1024
+ };
1025
+ /**
1026
+ * @description A replicated master-data set a policy can test membership in.
1027
+ * @enum {string}
1028
+ */
1029
+ ReferenceSet: "ApprovedCounterparties" | "GlAccounts" | "OpenFiscalPeriods";
1030
+ /**
1031
+ * @description Why a refused intent was refused (`AgentOutcome.refusal`).
1032
+ *
1033
+ * A stable machine `code`, the `rule` that fired when one did, the guard
1034
+ * `conditions` and exact `figures` behind a forbid, the norms their own
1035
+ * exceptions `set_aside`, and a plain-English `explanation` that says what to
1036
+ * do next. Every list is omitted when empty.
1037
+ *
1038
+ * **Every refusal vocabulary is open**: `code`, the condition `kind`, the
1039
+ * figure `source`, `op`, `scope`, `quantity` and window `kind`, and the
1040
+ * set-aside `modality` (like `ErrorBody.law` and `ErrorBody.cause`). A client
1041
+ * MUST tolerate a value it does not know, because a later contract may add
1042
+ * one without a major version, and fall back to `explanation`.
1043
+ */
1044
+ Refusal: {
1045
+ /**
1046
+ * @description The stable `snake_case` refusal code. An **open** vocabulary: a
1047
+ * client must accept a code it does not know and fall back to
1048
+ * `explanation`.
1049
+ *
1050
+ * | code | meaning | `rule` |
1051
+ * |---|---|---|
1052
+ * | `forbidden_by_rule` | a forbid rule in the judging policy won and no permit overrode it | present: the forbid |
1053
+ * | `not_delegated` | a permit matched and its conditions held, but no delegation to the acting agent covers it | present: the highest-priority such permit |
1054
+ * | `denied_by_default` | no rule permitted the action for this actor, so the policy's default deny applied | absent |
1055
+ * | `reason_archived` | the refused record has been archived, so this replay cannot carry the reason | absent |
1056
+ * @example forbidden_by_rule
1057
+ */
1058
+ code: string;
1059
+ /**
1060
+ * @description For `forbidden_by_rule` only: one entry per clause of the forbid's
1061
+ * guard, naming the literal that satisfied it. Omitted when empty.
1062
+ */
1063
+ conditions?: components["schemas"]["Condition"][];
1064
+ /** @description A plain-English explanation of the refusal and what to do next. */
1065
+ explanation: string;
1066
+ /**
1067
+ * @description For `forbidden_by_rule` only: every register and mandate comparison the
1068
+ * forbid's guard made, in evaluation order. `conditions[].figure` indexes
1069
+ * this list. Omitted when empty.
1070
+ */
1071
+ figures?: components["schemas"]["Figure"][];
1072
+ /**
1073
+ * @description The rule behind the refusal — present exactly when `code` is
1074
+ * `forbidden_by_rule` (the winning forbid) or `not_delegated` (the permit
1075
+ * no delegation covers).
1076
+ */
1077
+ rule?: components["schemas"]["RefusingRule"];
1078
+ /**
1079
+ * @description Norms their own `unless` clause set aside for this intent. Omitted when
1080
+ * empty.
1081
+ */
1082
+ set_aside?: components["schemas"]["SetAside"][];
1083
+ };
1084
+ /**
1085
+ * @description The rule that refused an intent, named from the policy that judged it
1086
+ * (`AgentOutcome.policy`), not whichever policy is in force when the
1087
+ * answer is read.
1088
+ */
1089
+ RefusingRule: {
1090
+ /**
1091
+ * @description The rule's id (`rule_…`), the same id `provenance.Recorded.winning`
1092
+ * carries.
1093
+ * @example rule_133a287fqyatytd2n3ntyy7mv9
1094
+ */
1095
+ id: string;
1096
+ /**
1097
+ * @description The rule's name as declared in the policy source. Absent when the
1098
+ * server could not read the judging policy's source.
1099
+ * @example no_unapproved_vendors
1100
+ */
1101
+ name?: string;
1102
+ };
1103
+ /** @description A norm its own `unless` clause set aside for this intent. */
1104
+ SetAside: {
1105
+ /**
1106
+ * @description The exception that set the rule aside.
1107
+ * @example after_hours
1108
+ */
1109
+ exception: string;
1110
+ /**
1111
+ * @description The defeated rule's modality. An **open** vocabulary: `permitted`,
1112
+ * `obligated`, `forbidden`.
1113
+ * @example permitted
1114
+ */
1115
+ modality: string;
1116
+ /** @description The defeated rule. */
1117
+ rule: components["schemas"]["RefusingRule"];
1118
+ };
1119
+ /**
1120
+ * @description The side of a journal entry.
1121
+ * @enum {string}
1122
+ */
1123
+ Side: "Debit" | "Credit";
1124
+ /**
1125
+ * @description The stored ledger record for one transaction — **an opaque object in this
1126
+ * version of the contract.**
1127
+ *
1128
+ * This endpoint returns the raw normative-log record. That record's own shape is
1129
+ * not yet frozen: it is a tagged union over every kind of ledger event, and its
1130
+ * transaction arm carries the full evaluation proposal and decision. Pinning a
1131
+ * schema for it here would mean publishing a **guess** at a shape that is still
1132
+ * moving — precisely the dishonesty this contract exists to prevent — so it is
1133
+ * declared a free-form object and clients should treat it as opaque JSON.
1134
+ *
1135
+ * It gets its real, frozen contract in the forthcoming API extraction.
1136
+ *
1137
+ * What **is** guaranteed today: the record of a committed transaction carries a
1138
+ * `posted` boolean, and a recorded refusal appears with `posted: false`.
1139
+ */
1140
+ TransactionRecord: {
1141
+ [key: string]: unknown;
1142
+ };
1143
+ /**
1144
+ * @description The `GET /api/v1/usages/{id}` response: one usage balance, readable only by the
1145
+ * party that owns it.
1146
+ *
1147
+ * The wire shape is `axorum_report::UsageBalanceReport`'s own fields at the top level
1148
+ * with the compliance-English narration embedded as `text` — the `ReportBody` flatten
1149
+ * the writer serializes. It is mirrored here rather than derived for the usual reason
1150
+ * (see the module docs): `UsageId` and `CurrencyCode` are foreign newtypes with
1151
+ * hand-written `Serialize` impls that emit plain strings, and a derive would describe
1152
+ * their innards instead.
1153
+ *
1154
+ * **Every counter is a 128-bit integer emitted as a bare JSON number** — the same rule
1155
+ * as `Amount.minor`, and it matters more here than anywhere else on the agent plane:
1156
+ * this is the *only* money read the contract exposes, `consume` has no ceiling, and a
1157
+ * balance can lawfully outgrow `u64`. Decode these as big integers, never as doubles,
1158
+ * or large figures lose precision silently. (The TypeScript generator's
1159
+ * integer→`bigint` rewrite keys off exactly this.)
1160
+ */
1161
+ UsageBalanceReport: {
1162
+ /**
1163
+ * @description The running total **billed** — the financial recognition of metering, in minor
1164
+ * units. Never above `metered`, by the law.
1165
+ * @example 4000
1166
+ */
1167
+ billed: bigint;
1168
+ /**
1169
+ * @description The running total **consumed** — the ground-truth event, in minor units.
1170
+ * @example 10000
1171
+ */
1172
+ consumed: bigint;
1173
+ /**
1174
+ * @description The single currency/unit every move against this balance must match.
1175
+ * @example USD
1176
+ */
1177
+ currency: string;
1178
+ /**
1179
+ * @description The running total **metered** — the measurement recognition of consumption, in
1180
+ * minor units. Never above `consumed`, by the law.
1181
+ * @example 6500
1182
+ */
1183
+ metered: bigint;
1184
+ /** @description Whether the chain has reconciled: `consumed = metered = billed`. */
1185
+ reconciled: boolean;
1186
+ /** @description The balance narrated in compliance English, with exact money figures. */
1187
+ text: string;
1188
+ /**
1189
+ * @description The un-billed headroom (`metered − billed`): metering recognized but not yet
1190
+ * billed. Never negative, by the law.
1191
+ * @example 2500
1192
+ */
1193
+ unbilled: bigint;
1194
+ /**
1195
+ * @description The un-metered headroom (`consumed − metered`): consumption recognized but not
1196
+ * yet measured. Never negative, by the law.
1197
+ * @example 3500
1198
+ */
1199
+ unmetered: bigint;
1200
+ /**
1201
+ * @description The usage-balance id (`usage_…`), as a string.
1202
+ * @example usage_2n4kqx21g5bty927z2tj955css
1203
+ */
1204
+ usage: string;
1205
+ };
1206
+ /**
1207
+ * @description A single **usage move**: a signed delta against one usage balance's counter,
1208
+ * carried on an intent as `consume_usage` / `meter_usage` / `bill_usage`.
1209
+ *
1210
+ * The three moves of one intent are validated **together** against the combined
1211
+ * post-state, so a single intent may consume, meter, and bill the same amount.
1212
+ * Usage balances are opened on the admin plane and are unscoped in v0 (no owning
1213
+ * party — the substrate law is what refuses every chain violation).
1214
+ */
1215
+ UsageMove: {
1216
+ /**
1217
+ * @description The signed delta, denominated in the balance's currency/unit: positive
1218
+ * recognizes fresh consumption/metering/billing, negative a correction that
1219
+ * unwinds it. Carries `Amount`'s 128-bit-integer caveat: decode `minor` as a
1220
+ * big integer, not a double.
1221
+ */
1222
+ amount: components["schemas"]["Amount"];
1223
+ /**
1224
+ * @description The usage balance the move lands on (`usage_…`).
1225
+ * @example usage_2s5479gmf7bhrsavd5awacb0fg
1226
+ */
1227
+ usage: string;
1228
+ };
1229
+ /**
1230
+ * @description A typed literal in the deontic AST.
1231
+ *
1232
+ * An **externally tagged** union: exactly one key, the variant name — e.g.
1233
+ * `{"Int": 3}` or `{"Amount": {"minor": 500, "currency": "USD"}}`.
1234
+ */
1235
+ Value: {
1236
+ /** @description A boolean. */
1237
+ Bool: boolean;
1238
+ } | {
1239
+ /**
1240
+ * Format: int64
1241
+ * @description A 64-bit signed integer (counts, quantities — never money).
1242
+ */
1243
+ Int: bigint;
1244
+ } | {
1245
+ /** @description A monetary amount. */
1246
+ Amount: components["schemas"]["Amount"];
1247
+ } | {
1248
+ /** @description UTF-8 text. */
1249
+ Text: string;
1250
+ } | {
1251
+ /** @description A reference to a party by id (`party_…`). */
1252
+ Party: string;
1253
+ } | {
1254
+ /** @description A transaction identity (`txn_…`). */
1255
+ Transaction: string;
1256
+ } | {
1257
+ /** @description A role name. */
1258
+ Role: string;
1259
+ } | {
1260
+ /**
1261
+ * Format: int64
1262
+ * @description An event-clock point.
1263
+ */
1264
+ Tick: bigint;
1265
+ } | {
1266
+ /** @description An action type name. */
1267
+ Action: string;
1268
+ } | {
1269
+ /** @description A named replicated reference set (membership tests only). */
1270
+ SetRef: components["schemas"]["ReferenceSet"];
1271
+ };
1272
+ /**
1273
+ * @description The outcome of evaluating a transaction against the policy in force.
1274
+ *
1275
+ * `ForbiddenRejected` is the **recorded refusal** — it arrives on a `200` with
1276
+ * `posted: false`.
1277
+ * @enum {string}
1278
+ */
1279
+ Verdict: "Permitted" | "ForbiddenRejected" | "ForbiddenRecorded" | "ObligatedPending" | "ObligatedFulfilled";
1280
+ };
1281
+ responses: {
1282
+ /**
1283
+ * @description The rate limiter refused the request before any handler read it, so **nothing was read or written**. Wait `Retry-After` seconds and re-send the same request; a submission keeps its `transaction` id. The body is the limiter's own shape (`RateLimited`), not `ApiError`.
1284
+ *
1285
+ * A request is counted in its agent's own bucket when it carries an `Authorization: Bearer` attestation that verifies against a trusted issuer, is unexpired, and names a bound agent; otherwise in its address's bucket.
1286
+ */
1287
+ RateLimited: {
1288
+ headers: {
1289
+ /** @description Whole seconds to wait before re-sending, at least 1. Always present on a 429. */
1290
+ "Retry-After"?: bigint;
1291
+ [name: string]: unknown;
1292
+ };
1293
+ content: {
1294
+ "application/json": components["schemas"]["RateLimited"];
1295
+ };
1296
+ };
1297
+ };
1298
+ parameters: never;
1299
+ requestBodies: never;
1300
+ headers: never;
1301
+ pathItems: never;
1302
+ }
1303
+ export type $defs = Record<string, never>;
1304
+ export interface operations {
1305
+ get_balance: {
1306
+ parameters: {
1307
+ query?: never;
1308
+ header?: never;
1309
+ path: {
1310
+ /**
1311
+ * @description The account id (`acc_…`).
1312
+ * @example acc_2n4kqx21g5bty927z2tj955css
1313
+ */
1314
+ id: string;
1315
+ };
1316
+ cookie?: never;
1317
+ };
1318
+ requestBody?: never;
1319
+ responses: {
1320
+ /**
1321
+ * @description The account's net balance.
1322
+ *
1323
+ * Readable only by the party that **owns** the account.
1324
+ */
1325
+ 200: {
1326
+ headers: {
1327
+ [name: string]: unknown;
1328
+ };
1329
+ content: {
1330
+ "application/json": components["schemas"]["BalanceResponse"];
1331
+ };
1332
+ };
1333
+ /** @description `invalid_account_id` — the path segment is not an account id. */
1334
+ 400: {
1335
+ headers: {
1336
+ [name: string]: unknown;
1337
+ };
1338
+ content: {
1339
+ "application/json": components["schemas"]["ApiError"];
1340
+ };
1341
+ };
1342
+ /** @description `unauthorized` — no `Authorization: Bearer <attestation>` was presented; or `unknown_agent` — the attested `agent://` URI is not bound to a party. */
1343
+ 401: {
1344
+ headers: {
1345
+ [name: string]: unknown;
1346
+ };
1347
+ content: {
1348
+ "application/json": components["schemas"]["ApiError"];
1349
+ };
1350
+ };
1351
+ /** @description `attestation` — the attestation was rejected (bad signature, expired, or an untrusted issuer). */
1352
+ 403: {
1353
+ headers: {
1354
+ [name: string]: unknown;
1355
+ };
1356
+ content: {
1357
+ "application/json": components["schemas"]["ApiError"];
1358
+ };
1359
+ };
1360
+ /** @description `unknown_account` — no such account, **or** the account is not the calling party's: owned by another party, or opened with no owner at all (fail-closed — readable by nobody). The cases are deliberately indistinguishable: an account id is never an existence oracle across a tenant boundary. */
1361
+ 404: {
1362
+ headers: {
1363
+ [name: string]: unknown;
1364
+ };
1365
+ content: {
1366
+ "application/json": components["schemas"]["ApiError"];
1367
+ };
1368
+ };
1369
+ 429: components["responses"]["RateLimited"];
1370
+ };
1371
+ };
1372
+ currencies: {
1373
+ parameters: {
1374
+ query?: never;
1375
+ header?: never;
1376
+ path?: never;
1377
+ cookie?: never;
1378
+ };
1379
+ requestBody?: never;
1380
+ responses: {
1381
+ /**
1382
+ * @description Every declared currency and its minor-unit exponent, in canonical (sorted) code order. An intent that names any other currency is refused with `422` and `cause: "undeclared_currency"`. An empty list means nothing is declared.
1383
+ *
1384
+ * A currency carries a `warning` when the policy in force refuses some action in it whatever the proposal: every intent on one of `warning.actions` in that currency is refused at commit. An agent cannot change that; pay in a currency with no warning, or hand `warning.remedy` to a human operator.
1385
+ */
1386
+ 200: {
1387
+ headers: {
1388
+ [name: string]: unknown;
1389
+ };
1390
+ content: {
1391
+ "application/json": components["schemas"]["DeclaredCurrencies"];
1392
+ };
1393
+ };
1394
+ /** @description `unauthorized` — no `Authorization: Bearer <attestation>` was presented; or `unknown_agent` — the attested `agent://` URI is not bound to a party. */
1395
+ 401: {
1396
+ headers: {
1397
+ [name: string]: unknown;
1398
+ };
1399
+ content: {
1400
+ "application/json": components["schemas"]["ApiError"];
1401
+ };
1402
+ };
1403
+ /** @description `attestation` — the attestation was rejected (bad signature, expired, or an untrusted issuer). */
1404
+ 403: {
1405
+ headers: {
1406
+ [name: string]: unknown;
1407
+ };
1408
+ content: {
1409
+ "application/json": components["schemas"]["ApiError"];
1410
+ };
1411
+ };
1412
+ 429: components["responses"]["RateLimited"];
1413
+ };
1414
+ };
1415
+ submit_intent: {
1416
+ parameters: {
1417
+ query?: never;
1418
+ header?: never;
1419
+ path?: never;
1420
+ cookie?: never;
1421
+ };
1422
+ /** @description The intent envelope: identity (`agent` + `attestation`), the accounting view (`entries`), the deontic view (`action`), the policy pin, external `evidence`, and the agent's `justification`. */
1423
+ requestBody: {
1424
+ content: {
1425
+ "application/json": components["schemas"]["IntentEnvelope"];
1426
+ };
1427
+ };
1428
+ responses: {
1429
+ /**
1430
+ * @description The intent reached the commit point and was judged.
1431
+ *
1432
+ * **This includes a refusal.** If the policy in force forbids the action, the verdict is `ForbiddenRejected` and `posted` is `false` — the refusal was *recorded*, and that recording is the result. It is still a 200. Clients must branch on `verdict`/`posted`, never on the status code, to learn whether the entries posted.
1433
+ *
1434
+ * Re-submitting an already-committed `transaction` id with the **same content** replays its stored outcome (client-minted ids are the substrate's idempotency key) rather than double-posting; the replayed answer carries `replayed: true` and `content_verified: true`, and is otherwise the original answer's bytes. The same id with different content is a `409 transaction_reused`. An id committed before 1.0.0 whose content hash the old log never recorded has nothing to compare with: until the replay window after the upgrade expires, a retry of it by the party that committed it replays with `content_verified: false` and posts nothing, as does a retry by any party when the committer was never recorded either; any other party gets the `409 transaction_reused`.
1435
+ *
1436
+ * A retry is answered **before** admission: once the caller authenticates, a committed id with the same content replays even if its pin is no longer the policy in force, its currency is not declared, or its `minted_at_ms` is older than the replay window, and different content is `409 transaction_reused`. Only a new id faces the pin, currency admission and the key window.
1437
+ */
1438
+ 200: {
1439
+ headers: {
1440
+ [name: string]: unknown;
1441
+ };
1442
+ content: {
1443
+ "application/json": components["schemas"]["AgentOutcome"];
1444
+ };
1445
+ };
1446
+ /** @description `unknown_agent` — the `agent://` URI is not bound to a party. */
1447
+ 401: {
1448
+ headers: {
1449
+ [name: string]: unknown;
1450
+ };
1451
+ content: {
1452
+ "application/json": components["schemas"]["ApiError"];
1453
+ };
1454
+ };
1455
+ /** @description `attestation` — the PASETO v4.public capability attestation was rejected (bad signature, expired, wrong audience, or an untrusted issuer). */
1456
+ 403: {
1457
+ headers: {
1458
+ [name: string]: unknown;
1459
+ };
1460
+ content: {
1461
+ "application/json": components["schemas"]["ApiError"];
1462
+ };
1463
+ };
1464
+ /**
1465
+ * @description The policy pin did not hold and **nothing was written**.
1466
+ *
1467
+ * - `stale_policy` — the pre-propose fast path: the pinned policy is not the one in force. Carries `pinned` and `active`. A retry of a committed id never gets it: the retry replays whatever it pins.
1468
+ * - `policy_pin_mismatch` — the race-closing apply-time check: the policy in force changed between the request being checked and it being recorded. Carries `pinned` and `active`, and a plain compliance-English `message` stating that nothing was recorded. Identical body on the standalone and cluster paths.
1469
+ * - `no_active_policy` — no policy is in force at all.
1470
+ *
1471
+ * For these three: re-read `GET /api/v1/policies/active` and resubmit against the policy now in force.
1472
+ *
1473
+ * - `transaction_reused` — the `transaction` id was already committed with **different** content (a different agent, entries, action, rail or usage move). Nothing was written. To the party that committed the id it carries `stored_content_hash` and `submitted_content_hash`, and none of the content; to any other party it carries neither hash. Choose a fresh id for a new intent; resubmit the original content unchanged to read the stored outcome back. When the stored content is unknown (an id committed before 1.0.0), raised with neither hash for any party but the one that committed the id.
1474
+ * - `stale_idempotency_key` — the envelope's `minted_at_ms` is older than the `axorum-idempotency-window-seconds` window less a 5-minute clock-skew margin, so the id may no longer be held and a resubmission could commit twice. Nothing was written. Read the id back to learn whether it committed, and mint a new transaction id for a new attempt. Checked only when the deployment runs a heartbeat, and only for new work: a retry of an id the deployment still holds replays however old its key.
1475
+ */
1476
+ 409: {
1477
+ headers: {
1478
+ [name: string]: unknown;
1479
+ };
1480
+ content: {
1481
+ "application/json": components["schemas"]["ApiError"];
1482
+ };
1483
+ };
1484
+ /** @description `body_too_large`: the request body is larger than this route accepts. It was refused before it was read as an intent, so nothing was written. */
1485
+ 413: {
1486
+ headers: {
1487
+ [name: string]: unknown;
1488
+ };
1489
+ content: {
1490
+ "application/json": components["schemas"]["ApiError"];
1491
+ };
1492
+ };
1493
+ /** @description `unsupported_media_type`: the request body was not sent as `Content-Type: application/json`. Nothing was written; resend it with that header. */
1494
+ 415: {
1495
+ headers: {
1496
+ [name: string]: unknown;
1497
+ };
1498
+ content: {
1499
+ "application/json": components["schemas"]["ApiError"];
1500
+ };
1501
+ };
1502
+ /** @description `not_primary` — cluster mode: this mutation reached a non-primary replica. This attempt may or may not have been recorded: a primary stepping down can answer so after proposing it. Carries `primary_api_addr`, the primary's API origin as this replica last knew it: a hint that can trail a failover. Re-send the same transaction id through the configured endpoints. */
1503
+ 421: {
1504
+ headers: {
1505
+ [name: string]: unknown;
1506
+ };
1507
+ content: {
1508
+ "application/json": components["schemas"]["ApiError"];
1509
+ };
1510
+ };
1511
+ /** @description The request was well-formed HTTP but could not be recorded: `invalid_envelope` (the body is not JSON, is cut short, or does not fit the envelope, for example a missing required field; the `message` gives the serde path and a short reason and never repeats a value from the body; refused before the intent was read, so nothing was written), `invalid_agent_uri` (carries `uri`), `capability_mapping` (the action maps to no capability the attestation grants; carries `action`), `multi_currency_mandate_charge` (carries `currencies`), `invalid_key_mint` (the retry key's `minted_at_ms`, or the time a UUIDv7 `transaction` id records, is more than a 5-minute clock-skew margin ahead of the service's clock, or the two differ by more than it; the `message` names the check and its bound; nothing was written; send the time the id was minted, as it was first sent), `substrate_rejected` with `kind: "validation"` (the ledger refused it — unbalanced legs, unknown account, a breached mandate ceiling, a matching-law violation, or a usage-law violation: metering past consumption, billing past metering, a correction below zero, an unknown or wrong-currency usage balance — the `message` is the compliance-English refusal with exact figures, and nothing posted; `law` names the law it would have broken, or `cause` names what to change when it broke none), or `gateway_error` for a rejection with no more specific code. */
1512
+ 422: {
1513
+ headers: {
1514
+ [name: string]: unknown;
1515
+ };
1516
+ content: {
1517
+ "application/json": components["schemas"]["ApiError"];
1518
+ };
1519
+ };
1520
+ 429: components["responses"]["RateLimited"];
1521
+ /** @description `idempotency_seed_refused` — cluster mode: the ledger refused this primary's idempotency seed, so this request was not proposed and nothing was written. Terminal: no `Retry-After`, and a retry reaches the same refusal until an operator steps the primary down. `proposal_refused` — cluster mode: the node refused the proposal for a reason this build does not name, so this request was not proposed and nothing was written. */
1522
+ 500: {
1523
+ headers: {
1524
+ [name: string]: unknown;
1525
+ };
1526
+ content: {
1527
+ "application/json": components["schemas"]["ApiError"];
1528
+ };
1529
+ };
1530
+ /** @description `commit_unavailable` — cluster mode: the request was proposed and its commit could not be confirmed (timeout, node gone, or an ambiguous view change). It may or may not have landed; retry (submission is idempotent by `transaction` id) or consult `GET /api/v1/transactions/{txn_id}`. `idempotency_unseeded` — this request was not written and will not be, because the idempotency index is not seeded yet (a new or just-upgraded cluster, or one without a quorum); retry it. That says nothing about the transaction id: an earlier attempt with the same id, sent to an earlier primary, may still commit. `not_normal` — cluster mode: the replica is in a view change or a recovery, so this request was not proposed and nothing was written; retry it shortly. `archive_pressure` — cluster mode: the primary's local archive is past its hold ceiling, so this request was not proposed and nothing was written; retry it later. `quarantined` — replay verification found a divergence on this node, so this request was not proposed and nothing was written; it does not clear on its own, and an operator must resolve it. None of these three says anything about the transaction id. */
1531
+ 503: {
1532
+ headers: {
1533
+ [name: string]: unknown;
1534
+ };
1535
+ content: {
1536
+ "application/json": components["schemas"]["ApiError"];
1537
+ };
1538
+ };
1539
+ /** @description `substrate_rejected` with `kind: "capacity"` — a ledger capacity bound was breached. `idempotency_window_full`: the idempotency index is at its byte budget, so this id cannot be held. Nothing was written, and ids already held still replay. `Retry-After` names the earliest sweep that evicts enough aged ids, a lower bound after a view change; it is absent when ageing alone cannot make room or the heartbeat is off. Retry the same request. `snapshot_capacity`, cluster mode: the primary's next snapshot frame, with this commit in it, would pass half its snapshot store. Nothing was written. `Retry-After` as for `idempotency_window_full`; absent, only an operator resizing the store makes room. */
1540
+ 507: {
1541
+ headers: {
1542
+ [name: string]: unknown;
1543
+ };
1544
+ content: {
1545
+ "application/json": components["schemas"]["ApiError"];
1546
+ };
1547
+ };
1548
+ };
1549
+ };
1550
+ get_obligations: {
1551
+ parameters: {
1552
+ query?: {
1553
+ /**
1554
+ * @description The actor: a party id (`party_…`) or a DSL party name (derived to its id).
1555
+ *
1556
+ * **Optional, and no longer the thing that selects whose duties are returned.**
1557
+ * The answer is always scoped to the party the *credential* is bound to; this
1558
+ * is an assertion the service checks against that party (a mismatch is a
1559
+ * `403`), kept so a caller can be explicit about who it thinks it is. Omit it
1560
+ * and the caller's own party is used.
1561
+ */
1562
+ actor?: string | null;
1563
+ };
1564
+ header?: never;
1565
+ path?: never;
1566
+ cookie?: never;
1567
+ };
1568
+ requestBody?: never;
1569
+ responses: {
1570
+ /**
1571
+ * @description The **calling party's** open obligations. A duty-free party is not an error — it answers 200 with an empty `pending` list.
1572
+ *
1573
+ * Whose duties these are is decided by the credential, never by `?actor=`.
1574
+ */
1575
+ 200: {
1576
+ headers: {
1577
+ [name: string]: unknown;
1578
+ };
1579
+ content: {
1580
+ "application/json": components["schemas"]["ObligationsResponse"];
1581
+ };
1582
+ };
1583
+ /** @description `unauthorized` — no `Authorization: Bearer <attestation>` was presented; or `unknown_agent` — the attested `agent://` URI is not bound to a party. */
1584
+ 401: {
1585
+ headers: {
1586
+ [name: string]: unknown;
1587
+ };
1588
+ content: {
1589
+ "application/json": components["schemas"]["ApiError"];
1590
+ };
1591
+ };
1592
+ /** @description `attestation` — the attestation was rejected (bad signature, expired, or an untrusted issuer); or `forbidden` — `?actor=` named a party other than the one the calling agent is bound to. */
1593
+ 403: {
1594
+ headers: {
1595
+ [name: string]: unknown;
1596
+ };
1597
+ content: {
1598
+ "application/json": components["schemas"]["ApiError"];
1599
+ };
1600
+ };
1601
+ 429: components["responses"]["RateLimited"];
1602
+ };
1603
+ };
1604
+ active_policy: {
1605
+ parameters: {
1606
+ query?: never;
1607
+ header?: never;
1608
+ path?: never;
1609
+ cookie?: never;
1610
+ };
1611
+ requestBody?: never;
1612
+ responses: {
1613
+ /**
1614
+ * @description The policy in force, or `{"policy": null}` if none is.
1615
+ *
1616
+ * This is the endpoint to re-read after a `409` (`stale_policy` / `policy_pin_mismatch`) before resubmitting an intent: its value is what the envelope's `policy` pin must carry.
1617
+ */
1618
+ 200: {
1619
+ headers: {
1620
+ [name: string]: unknown;
1621
+ };
1622
+ content: {
1623
+ "application/json": components["schemas"]["ActivePolicyResponse"];
1624
+ };
1625
+ };
1626
+ 429: components["responses"]["RateLimited"];
1627
+ };
1628
+ };
1629
+ get_transaction: {
1630
+ parameters: {
1631
+ query?: never;
1632
+ header?: never;
1633
+ path: {
1634
+ /**
1635
+ * @description The client-minted transaction id (`txn_…`).
1636
+ * @example txn_7w5b4trnc7b2ja027jyyb64395
1637
+ */
1638
+ txn_id: string;
1639
+ };
1640
+ cookie?: never;
1641
+ };
1642
+ requestBody?: never;
1643
+ responses: {
1644
+ /**
1645
+ * @description The stored ledger record. Reading it is the idempotent replay lookup — it tells you what a previously-submitted `transaction` id did without resubmitting it.
1646
+ *
1647
+ * A recorded refusal is present here like any other record, with `posted: false`.
1648
+ *
1649
+ * Readable only by the party that proposed it.
1650
+ */
1651
+ 200: {
1652
+ headers: {
1653
+ [name: string]: unknown;
1654
+ };
1655
+ content: {
1656
+ "application/json": components["schemas"]["TransactionRecord"];
1657
+ };
1658
+ };
1659
+ /** @description `invalid_transaction_id` — the path segment is not a transaction id. */
1660
+ 400: {
1661
+ headers: {
1662
+ [name: string]: unknown;
1663
+ };
1664
+ content: {
1665
+ "application/json": components["schemas"]["ApiError"];
1666
+ };
1667
+ };
1668
+ /** @description `unauthorized` — no `Authorization: Bearer <attestation>` was presented; or `unknown_agent` — the attested `agent://` URI is not bound to a party. */
1669
+ 401: {
1670
+ headers: {
1671
+ [name: string]: unknown;
1672
+ };
1673
+ content: {
1674
+ "application/json": components["schemas"]["ApiError"];
1675
+ };
1676
+ };
1677
+ /** @description `attestation` — the attestation was rejected (bad signature, expired, or an untrusted issuer). */
1678
+ 403: {
1679
+ headers: {
1680
+ [name: string]: unknown;
1681
+ };
1682
+ content: {
1683
+ "application/json": components["schemas"]["ApiError"];
1684
+ };
1685
+ };
1686
+ /** @description `unknown_transaction` — no such transaction, **or** the transaction belongs to another party. The two are deliberately indistinguishable: a transaction id is never an existence oracle across a tenant boundary. */
1687
+ 404: {
1688
+ headers: {
1689
+ [name: string]: unknown;
1690
+ };
1691
+ content: {
1692
+ "application/json": components["schemas"]["ApiError"];
1693
+ };
1694
+ };
1695
+ 429: components["responses"]["RateLimited"];
1696
+ };
1697
+ };
1698
+ get_receipt: {
1699
+ parameters: {
1700
+ query?: never;
1701
+ header?: never;
1702
+ path: {
1703
+ /**
1704
+ * @description The client-minted transaction id (`txn_…`).
1705
+ * @example txn_7w5b4trnc7b2ja027jyyb64395
1706
+ */
1707
+ txn_id: string;
1708
+ };
1709
+ cookie?: never;
1710
+ };
1711
+ requestBody?: never;
1712
+ responses: {
1713
+ /**
1714
+ * @description The signed receipt: an `axorum.evidence.v0` envelope whose base64 `payload` is the `axorum.receipt.v0` facts of the applied record. Verifiable fully offline against the deployment's published key list (`GET /api/verification-keys.json`) — see the committed JSON Schemas under `spec/schemas/`. Re-minted from the stored record on every fetch and byte-identical across fetches and to the inline `receipt` the original submission carried.
1715
+ *
1716
+ * A recorded refusal's receipt is a first-class receipt (`verdict: ForbiddenRejected`, `posted: false`) — signed proof the refusal was recorded.
1717
+ *
1718
+ * Readable only by the party that proposed the transaction.
1719
+ */
1720
+ 200: {
1721
+ headers: {
1722
+ [name: string]: unknown;
1723
+ };
1724
+ content: {
1725
+ "application/json": components["schemas"]["Envelope"];
1726
+ };
1727
+ };
1728
+ /** @description `invalid_transaction_id` — the path segment is not a transaction id. */
1729
+ 400: {
1730
+ headers: {
1731
+ [name: string]: unknown;
1732
+ };
1733
+ content: {
1734
+ "application/json": components["schemas"]["ApiError"];
1735
+ };
1736
+ };
1737
+ /** @description `unauthorized` — no `Authorization: Bearer <attestation>` was presented; or `unknown_agent` — the attested `agent://` URI is not bound to a party. */
1738
+ 401: {
1739
+ headers: {
1740
+ [name: string]: unknown;
1741
+ };
1742
+ content: {
1743
+ "application/json": components["schemas"]["ApiError"];
1744
+ };
1745
+ };
1746
+ /** @description `attestation` — the attestation was rejected (bad signature, expired, or an untrusted issuer). */
1747
+ 403: {
1748
+ headers: {
1749
+ [name: string]: unknown;
1750
+ };
1751
+ content: {
1752
+ "application/json": components["schemas"]["ApiError"];
1753
+ };
1754
+ };
1755
+ /** @description `unknown_transaction` — no such transaction, the transaction belongs to another party, **or** its record has been archived out of the live tail. All deliberately indistinguishable (no existence oracle; no archived-vs-foreign oracle either). The commit-time inline receipt is the durable artifact for anything that outlives the tail. */
1756
+ 404: {
1757
+ headers: {
1758
+ [name: string]: unknown;
1759
+ };
1760
+ content: {
1761
+ "application/json": components["schemas"]["ApiError"];
1762
+ };
1763
+ };
1764
+ 429: components["responses"]["RateLimited"];
1765
+ /** @description `signing_not_configured` — this deployment does not sign artifacts; or `signing_unavailable` — the signing service did not answer (the transaction is committed and unaffected; retry once signing is restored). */
1766
+ 503: {
1767
+ headers: {
1768
+ [name: string]: unknown;
1769
+ };
1770
+ content: {
1771
+ "application/json": components["schemas"]["ApiError"];
1772
+ };
1773
+ };
1774
+ };
1775
+ };
1776
+ get_usage: {
1777
+ parameters: {
1778
+ query?: {
1779
+ /** @description `json` (default) or `text` for the compliance-English narration alone. */
1780
+ format?: string;
1781
+ };
1782
+ header?: never;
1783
+ path: {
1784
+ /**
1785
+ * @description The usage-balance id (`usage_…`).
1786
+ * @example usage_2n4kqx21g5bty927z2tj955css
1787
+ */
1788
+ id: string;
1789
+ };
1790
+ cookie?: never;
1791
+ };
1792
+ requestBody?: never;
1793
+ responses: {
1794
+ /**
1795
+ * @description The balance's three running totals (`consumed`/`metered`/`billed`), the derived headrooms, and whether the chain has reconciled — narrated in compliance English with exact figures.
1796
+ *
1797
+ * Readable only by the party that **owns** the balance.
1798
+ *
1799
+ * Every counter is a 128-bit integer on the wire: decode as a big integer, not a double. `consume` has no ceiling, so a balance can lawfully outgrow `u64`.
1800
+ */
1801
+ 200: {
1802
+ headers: {
1803
+ [name: string]: unknown;
1804
+ };
1805
+ content: {
1806
+ "application/json": components["schemas"]["UsageBalanceReport"];
1807
+ };
1808
+ };
1809
+ /** @description `invalid_usage_id` — the path segment is not a usage-balance id. */
1810
+ 400: {
1811
+ headers: {
1812
+ [name: string]: unknown;
1813
+ };
1814
+ content: {
1815
+ "application/json": components["schemas"]["ApiError"];
1816
+ };
1817
+ };
1818
+ /** @description `unauthorized` — no `Authorization: Bearer <attestation>` was presented; or `unknown_agent` — the attested `agent://` URI is not bound to a party. */
1819
+ 401: {
1820
+ headers: {
1821
+ [name: string]: unknown;
1822
+ };
1823
+ content: {
1824
+ "application/json": components["schemas"]["ApiError"];
1825
+ };
1826
+ };
1827
+ /** @description `attestation` — the attestation was rejected (bad signature, expired, or an untrusted issuer). */
1828
+ 403: {
1829
+ headers: {
1830
+ [name: string]: unknown;
1831
+ };
1832
+ content: {
1833
+ "application/json": components["schemas"]["ApiError"];
1834
+ };
1835
+ };
1836
+ /** @description `unknown_usage` — no such usage balance, **or** the balance is not the calling party's: owned by another party, or opened with no owner at all (fail-closed — readable by nobody). The cases are deliberately indistinguishable: a usage id is never an existence oracle across a tenant boundary. */
1837
+ 404: {
1838
+ headers: {
1839
+ [name: string]: unknown;
1840
+ };
1841
+ content: {
1842
+ "application/json": components["schemas"]["ApiError"];
1843
+ };
1844
+ };
1845
+ /** @description `substrate_rejected` (`kind: "validation"`, `cause: "undeclared_currency"`) — the balance is the caller's and exists, but its currency was never declared, so its amounts cannot be rendered at the right scale. An operator declares it (`axorum currency declare`); the message names the code. Only ever answered after the ownership check, so it reveals nothing a `404` hides. */
1846
+ 422: {
1847
+ headers: {
1848
+ [name: string]: unknown;
1849
+ };
1850
+ content: {
1851
+ "application/json": components["schemas"]["ApiError"];
1852
+ };
1853
+ };
1854
+ 429: components["responses"]["RateLimited"];
1855
+ };
1856
+ };
1857
+ }
1858
+ /**
1859
+ * The capabilities this contract's server advertises in
1860
+ * `info["x-axorum-capabilities"]` of `GET /api/openapi.json`: each token names a
1861
+ * guarantee beyond the contract version. A client ignores tokens it does not
1862
+ * know; an empty list promises nothing more.
1863
+ */
1864
+ export declare const capabilities: readonly string[];
1865
+ //# sourceMappingURL=agent-plane.d.ts.map