@axorum/mcp 0.0.0-stage → 1.0.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.js","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,SAAS,GAIV,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,WAAW,CAAC,OAAqB;IAC/C,QAAQ,OAAO,CAAC,OAAO,EAAE,CAAC;QACxB,KAAK,WAAW;YACd,OAAO,iHAAiH,CAAC;QAE3H,KAAK,oBAAoB;YACvB,OAAO,4JAA4J,CAAC;QAEtK,KAAK,kBAAkB;YACrB,OAAO,CACL,sFAAsF;gBACtF,GAAG,cAAc,CAAC,OAAO,CAAC,mBAAmB,CAAC,MAAM,CAAC,SAAS;gBAC9D,uEAAuE,CACxE,CAAC;QAEJ,KAAK,mBAAmB;YACtB,OAAO,CACL,wFAAwF;gBACxF,sFAAsF;gBACtF,qFAAqF;gBACrF,8CAA8C,CAC/C,CAAC;QAEJ,KAAK,mBAAmB,CAAC,CAAC,CAAC;YACzB,mFAAmF;YACnF,sFAAsF;YACtF,qFAAqF;YACrF,qFAAqF;YACrF,sFAAsF;YACtF,uEAAuE;YACvE,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;YACnC,MAAM,GAAG,GAAG,OAAO;gBACjB,CAAC,CAAC,QAAQ,OAAO,CAAC,IAAI,MAAM,OAAO,CAAC,WAAW,EAAE;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C,GAAG,KAAK,CAAC,GAAG,CAAC;IAC5B,CAAC;IACD,IAAI,KAAK,YAAY,sBAAsB,IAAI,KAAK,CAAC,iBAAiB,KAAK,SAAS,EAAE,CAAC;QACrF,MAAM,CAAC,qBAAqB,CAAC,GAAG,KAAK,CAAC,iBAAiB,CAAC;QACxD,MAAM,CAAC,wBAAwB,CAAC,GAAG,KAAK,CAAC,oBAAoB,CAAC;IAChE,CAAC;IACD,sFAAsF;IACtF,uFAAuF;IACvF,mDAAmD;IACnD,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC;IAC9B,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,kEAAkE;AAClE,SAAS,OAAO,CAAC,OAAe,EAAE,MAA+B;IAC/D,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE;YAC/B,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE;SAC3C;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,238 @@
1
+ /**
2
+ * The tool input schemas — and the one place money crosses from text into `bigint`.
3
+ *
4
+ * # Why `minor` is a string
5
+ *
6
+ * The ledger's minor units are **128-bit integers**. JSON Schema — which is what an MCP
7
+ * tool's input schema is, and what the model actually sees — has one numeric type, and
8
+ * every JSON parser between the model and this process will decode a bare number as an
9
+ * IEEE-754 double. A double holds integers exactly only up to 2^53. So a `minor` declared
10
+ * as a JSON *number* would be silently rounded somewhere in the pipe for any large value,
11
+ * and the ledger would faithfully post the rounded figure.
12
+ *
13
+ * So `minor` is declared as a **decimal string** — `"50000"`, not `50000` — matched
14
+ * against a strict integer pattern and converted to a `bigint` here, exactly once, on the
15
+ * way to the wire. It is the one piece of friction this server asks a model to accept, and
16
+ * it buys exactness at every magnitude.
17
+ *
18
+ * @packageDocumentation
19
+ */
20
+ import * as z from "zod";
21
+ /**
22
+ * A JSON integer literal, and nothing else.
23
+ *
24
+ * No leading `+`, no leading zeroes, no decimal point, no exponent, no whitespace. `"1e3"`
25
+ * and `"1_000"` and `"10.00"` are all rejected rather than guessed at: a financial-control
26
+ * server that interprets a malformed amount is worse than one that refuses it.
27
+ */
28
+ export declare const INTEGER: RegExp;
29
+ /** The three master-data sets a policy can test membership in. */
30
+ export declare const REFERENCE_SETS: readonly ["ApprovedCounterparties", "GlAccounts", "OpenFiscalPeriods"];
31
+ /** A monetary amount in integer minor units. See the module docs on why `minor` is text. */
32
+ export declare const amountSchema: z.ZodObject<{
33
+ minor: z.ZodString;
34
+ currency: z.ZodString;
35
+ }, z.core.$strict>;
36
+ /**
37
+ * A typed literal in the deontic AST: an externally tagged union, e.g. `{ "Text": "abc" }`.
38
+ *
39
+ * `Int` and `Tick` are strings for the same reason `minor` is — they are 64-bit, and the
40
+ * pipe between the model and this process is not.
41
+ */
42
+ export declare const valueSchema: z.ZodUnion<readonly [z.ZodObject<{
43
+ Bool: z.ZodBoolean;
44
+ }, z.core.$strict>, z.ZodObject<{
45
+ Int: z.ZodString;
46
+ }, z.core.$strict>, z.ZodObject<{
47
+ Amount: z.ZodObject<{
48
+ minor: z.ZodString;
49
+ currency: z.ZodString;
50
+ }, z.core.$strict>;
51
+ }, z.core.$strict>, z.ZodObject<{
52
+ Text: z.ZodString;
53
+ }, z.core.$strict>, z.ZodObject<{
54
+ Party: z.ZodString;
55
+ }, z.core.$strict>, z.ZodObject<{
56
+ Transaction: z.ZodString;
57
+ }, z.core.$strict>, z.ZodObject<{
58
+ Role: z.ZodString;
59
+ }, z.core.$strict>, z.ZodObject<{
60
+ Tick: z.ZodString;
61
+ }, z.core.$strict>, z.ZodObject<{
62
+ Action: z.ZodString;
63
+ }, z.core.$strict>, z.ZodObject<{
64
+ SetRef: z.ZodEnum<{
65
+ ApprovedCounterparties: "ApprovedCounterparties";
66
+ GlAccounts: "GlAccounts";
67
+ OpenFiscalPeriods: "OpenFiscalPeriods";
68
+ }>;
69
+ }, z.core.$strict>]>;
70
+ /** A single journal leg: a positive amount posted to one side of one account. */
71
+ export declare const entrySchema: z.ZodObject<{
72
+ account: z.ZodString;
73
+ side: z.ZodEnum<{
74
+ Debit: "Debit";
75
+ Credit: "Credit";
76
+ }>;
77
+ amount: z.ZodObject<{
78
+ minor: z.ZodString;
79
+ currency: z.ZodString;
80
+ }, z.core.$strict>;
81
+ }, z.core.$strict>;
82
+ /** The proposed deontic action and its typed bindings. */
83
+ export declare const actionSchema: z.ZodObject<{
84
+ action: z.ZodString;
85
+ bindings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
86
+ Bool: z.ZodBoolean;
87
+ }, z.core.$strict>, z.ZodObject<{
88
+ Int: z.ZodString;
89
+ }, z.core.$strict>, z.ZodObject<{
90
+ Amount: z.ZodObject<{
91
+ minor: z.ZodString;
92
+ currency: z.ZodString;
93
+ }, z.core.$strict>;
94
+ }, z.core.$strict>, z.ZodObject<{
95
+ Text: z.ZodString;
96
+ }, z.core.$strict>, z.ZodObject<{
97
+ Party: z.ZodString;
98
+ }, z.core.$strict>, z.ZodObject<{
99
+ Transaction: z.ZodString;
100
+ }, z.core.$strict>, z.ZodObject<{
101
+ Role: z.ZodString;
102
+ }, z.core.$strict>, z.ZodObject<{
103
+ Tick: z.ZodString;
104
+ }, z.core.$strict>, z.ZodObject<{
105
+ Action: z.ZodString;
106
+ }, z.core.$strict>, z.ZodObject<{
107
+ SetRef: z.ZodEnum<{
108
+ ApprovedCounterparties: "ApprovedCounterparties";
109
+ GlAccounts: "GlAccounts";
110
+ OpenFiscalPeriods: "OpenFiscalPeriods";
111
+ }>;
112
+ }, z.core.$strict>]>>>;
113
+ }, z.core.$strict>;
114
+ /**
115
+ * A move against one usage balance's counter — the metered-billing half of an intent.
116
+ *
117
+ * `amount` carries the same decimal-string `minor` as every other money figure here, for
118
+ * the same reason: the ledger's counters are 128-bit, and a JSON number is not.
119
+ */
120
+ export declare const usageMoveSchema: z.ZodObject<{
121
+ usage: z.ZodString;
122
+ amount: z.ZodObject<{
123
+ minor: z.ZodString;
124
+ currency: z.ZodString;
125
+ }, z.core.$strict>;
126
+ }, z.core.$strict>;
127
+ /**
128
+ * The `submit_intent` input — the shape the model fills in to move money.
129
+ *
130
+ * A `ZodRawShape` (a plain object of schemas), not a `z.object`: that is what the MCP
131
+ * SDK's `registerTool` takes, and it is what it turns into the advertised JSON Schema.
132
+ */
133
+ export declare const submitIntentShape: {
134
+ entries: z.ZodArray<z.ZodObject<{
135
+ account: z.ZodString;
136
+ side: z.ZodEnum<{
137
+ Debit: "Debit";
138
+ Credit: "Credit";
139
+ }>;
140
+ amount: z.ZodObject<{
141
+ minor: z.ZodString;
142
+ currency: z.ZodString;
143
+ }, z.core.$strict>;
144
+ }, z.core.$strict>>;
145
+ action: z.ZodObject<{
146
+ action: z.ZodString;
147
+ bindings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
148
+ Bool: z.ZodBoolean;
149
+ }, z.core.$strict>, z.ZodObject<{
150
+ Int: z.ZodString;
151
+ }, z.core.$strict>, z.ZodObject<{
152
+ Amount: z.ZodObject<{
153
+ minor: z.ZodString;
154
+ currency: z.ZodString;
155
+ }, z.core.$strict>;
156
+ }, z.core.$strict>, z.ZodObject<{
157
+ Text: z.ZodString;
158
+ }, z.core.$strict>, z.ZodObject<{
159
+ Party: z.ZodString;
160
+ }, z.core.$strict>, z.ZodObject<{
161
+ Transaction: z.ZodString;
162
+ }, z.core.$strict>, z.ZodObject<{
163
+ Role: z.ZodString;
164
+ }, z.core.$strict>, z.ZodObject<{
165
+ Tick: z.ZodString;
166
+ }, z.core.$strict>, z.ZodObject<{
167
+ Action: z.ZodString;
168
+ }, z.core.$strict>, z.ZodObject<{
169
+ SetRef: z.ZodEnum<{
170
+ ApprovedCounterparties: "ApprovedCounterparties";
171
+ GlAccounts: "GlAccounts";
172
+ OpenFiscalPeriods: "OpenFiscalPeriods";
173
+ }>;
174
+ }, z.core.$strict>]>>>;
175
+ }, z.core.$strict>;
176
+ justification: z.ZodString;
177
+ transaction: z.ZodOptional<z.ZodString>;
178
+ fulfills: z.ZodOptional<z.ZodArray<z.ZodString>>;
179
+ evidence: z.ZodOptional<z.ZodArray<z.ZodString>>;
180
+ consume_usage: z.ZodOptional<z.ZodObject<{
181
+ usage: z.ZodString;
182
+ amount: z.ZodObject<{
183
+ minor: z.ZodString;
184
+ currency: z.ZodString;
185
+ }, z.core.$strict>;
186
+ }, z.core.$strict>>;
187
+ meter_usage: z.ZodOptional<z.ZodObject<{
188
+ usage: z.ZodString;
189
+ amount: z.ZodObject<{
190
+ minor: z.ZodString;
191
+ currency: z.ZodString;
192
+ }, z.core.$strict>;
193
+ }, z.core.$strict>>;
194
+ bill_usage: z.ZodOptional<z.ZodObject<{
195
+ usage: z.ZodString;
196
+ amount: z.ZodObject<{
197
+ minor: z.ZodString;
198
+ currency: z.ZodString;
199
+ }, z.core.$strict>;
200
+ }, z.core.$strict>>;
201
+ };
202
+ /** The `get_transaction` input. */
203
+ export declare const getTransactionShape: {
204
+ transaction: z.ZodString;
205
+ };
206
+ /** The `get_receipt` input. */
207
+ export declare const getReceiptShape: {
208
+ transaction: z.ZodString;
209
+ };
210
+ /** The `verify_receipt` input. */
211
+ export declare const verifyReceiptShape: {
212
+ receipt_envelope: z.ZodRecord<z.ZodString, z.ZodUnknown>;
213
+ verification_keys: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
214
+ pinned_generation: z.ZodOptional<z.ZodNumber>;
215
+ };
216
+ /** The `get_usage` input. */
217
+ export declare const getUsageShape: {
218
+ usage: z.ZodString;
219
+ };
220
+ /** The `get_obligations` input. */
221
+ export declare const getObligationsShape: {
222
+ actor: z.ZodOptional<z.ZodString>;
223
+ };
224
+ /** The `get_balance` input. */
225
+ export declare const getBalanceShape: {
226
+ account: z.ZodString;
227
+ };
228
+ /** The validated `submit_intent` input, as the tool callback receives it. */
229
+ export type SubmitIntentInput = z.infer<z.ZodObject<typeof submitIntentShape>>;
230
+ /** A validated amount, before its `minor` is lifted into a `bigint`. */
231
+ export type AmountInput = z.infer<typeof amountSchema>;
232
+ /** A validated value, before its `Int`/`Tick` are lifted into `bigint`s. */
233
+ export type ValueInput = z.infer<typeof valueSchema>;
234
+ /** A validated entry, before its amount is lifted. */
235
+ export type EntryInput = z.infer<typeof entrySchema>;
236
+ /** A validated usage move, before its amount is lifted. */
237
+ export type UsageMoveInput = z.infer<typeof usageMoveSchema>;
238
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,QAA0B,CAAC;AAE/C,kEAAkE;AAClE,eAAO,MAAM,cAAc,wEAAyE,CAAC;AAErG,4FAA4F;AAC5F,eAAO,MAAM,YAAY;;;kBAmBd,CAAC;AAEZ;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAkBrB,CAAC;AAEJ,iFAAiF;AACjF,eAAO,MAAM,WAAW;;;;;;;;;;kBAWb,CAAC;AAEZ,0DAA0D;AAC1D,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiBd,CAAC;AAEZ;;;;;GAKG;AACH,eAAO,MAAM,eAAe;;;;;;kBAgBjB,CAAC;AAEZ;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkE7B,CAAC;AAEF,mCAAmC;AACnC,eAAO,MAAM,mBAAmB;;CAK/B,CAAC;AAEF,+BAA+B;AAC/B,eAAO,MAAM,eAAe;;CAK3B,CAAC;AAEF,kCAAkC;AAClC,eAAO,MAAM,kBAAkB;;;;CAyB9B,CAAC;AAEF,6BAA6B;AAC7B,eAAO,MAAM,aAAa;;CAKzB,CAAC;AAEF,mCAAmC;AACnC,eAAO,MAAM,mBAAmB;;CAW/B,CAAC;AAEF,+BAA+B;AAC/B,eAAO,MAAM,eAAe;;CAK3B,CAAC;AAEF,6EAA6E;AAC7E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC;AAE/E,wEAAwE;AACxE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAEvD,4EAA4E;AAC5E,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAErD,sDAAsD;AACtD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAErD,2DAA2D;AAC3D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
@@ -0,0 +1,234 @@
1
+ /**
2
+ * The tool input schemas — and the one place money crosses from text into `bigint`.
3
+ *
4
+ * # Why `minor` is a string
5
+ *
6
+ * The ledger's minor units are **128-bit integers**. JSON Schema — which is what an MCP
7
+ * tool's input schema is, and what the model actually sees — has one numeric type, and
8
+ * every JSON parser between the model and this process will decode a bare number as an
9
+ * IEEE-754 double. A double holds integers exactly only up to 2^53. So a `minor` declared
10
+ * as a JSON *number* would be silently rounded somewhere in the pipe for any large value,
11
+ * and the ledger would faithfully post the rounded figure.
12
+ *
13
+ * So `minor` is declared as a **decimal string** — `"50000"`, not `50000` — matched
14
+ * against a strict integer pattern and converted to a `bigint` here, exactly once, on the
15
+ * way to the wire. It is the one piece of friction this server asks a model to accept, and
16
+ * it buys exactness at every magnitude.
17
+ *
18
+ * @packageDocumentation
19
+ */
20
+ import * as z from "zod";
21
+ /**
22
+ * A JSON integer literal, and nothing else.
23
+ *
24
+ * No leading `+`, no leading zeroes, no decimal point, no exponent, no whitespace. `"1e3"`
25
+ * and `"1_000"` and `"10.00"` are all rejected rather than guessed at: a financial-control
26
+ * server that interprets a malformed amount is worse than one that refuses it.
27
+ */
28
+ export const INTEGER = /^-?(?:0|[1-9][0-9]*)$/;
29
+ /** The three master-data sets a policy can test membership in. */
30
+ export const REFERENCE_SETS = ["ApprovedCounterparties", "GlAccounts", "OpenFiscalPeriods"];
31
+ /** A monetary amount in integer minor units. See the module docs on why `minor` is text. */
32
+ export const amountSchema = z
33
+ .object({
34
+ minor: z
35
+ .string()
36
+ .regex(INTEGER, "minor must be a plain integer written as a string, e.g. \"50000\" for $500.00 — " +
37
+ "no decimal point, no exponent, no separators")
38
+ .describe("The amount in integer MINOR units (cents, not dollars), written as a decimal " +
39
+ 'string: "50000" means $500.00. It is a string because the ledger uses 128-bit ' +
40
+ "integers, which a JSON number cannot hold exactly."),
41
+ currency: z
42
+ .string()
43
+ .min(1)
44
+ .describe('The ISO-4217-style currency the minor units are denominated in, e.g. "USD".'),
45
+ })
46
+ .strict();
47
+ /**
48
+ * A typed literal in the deontic AST: an externally tagged union, e.g. `{ "Text": "abc" }`.
49
+ *
50
+ * `Int` and `Tick` are strings for the same reason `minor` is — they are 64-bit, and the
51
+ * pipe between the model and this process is not.
52
+ */
53
+ export const valueSchema = z
54
+ .union([
55
+ z.object({ Bool: z.boolean() }).strict(),
56
+ z.object({ Int: z.string().regex(INTEGER) }).strict(),
57
+ z.object({ Amount: amountSchema }).strict(),
58
+ z.object({ Text: z.string() }).strict(),
59
+ z.object({ Party: z.string() }).strict(),
60
+ z.object({ Transaction: z.string().regex(/^txn_[0-7][0-9a-hjkmnp-tv-z]{25}$/) }).strict(),
61
+ z.object({ Role: z.string() }).strict(),
62
+ z.object({ Tick: z.string().regex(INTEGER) }).strict(),
63
+ z.object({ Action: z.string() }).strict(),
64
+ z.object({ SetRef: z.enum(REFERENCE_SETS) }).strict(),
65
+ ])
66
+ .describe("A typed value, tagged by its type: {\"Text\": \"abc\"}, {\"Int\": \"3\"}, " +
67
+ '{"Bool": true}, {"Amount": {"minor": "500", "currency": "USD"}}, {"Party": "party_…"}, ' +
68
+ '{"Role": "clerk"}, {"Tick": "12"}, {"Action": "post"}, or {"SetRef": "GlAccounts"}. ' +
69
+ "Int and Tick are written as strings for exactness, like minor.");
70
+ /** A single journal leg: a positive amount posted to one side of one account. */
71
+ export const entrySchema = z
72
+ .object({
73
+ account: z
74
+ .string()
75
+ .min(1)
76
+ .describe("The account this leg posts to (an `acc_…` id)."),
77
+ side: z
78
+ .enum(["Debit", "Credit"])
79
+ .describe("Whether this leg is a Debit or a Credit. The side carries the sign."),
80
+ amount: amountSchema.describe("The positive amount posted. The side, not a minus sign, carries direction."),
81
+ })
82
+ .strict();
83
+ /** The proposed deontic action and its typed bindings. */
84
+ export const actionSchema = z
85
+ .object({
86
+ action: z
87
+ .string()
88
+ .min(1)
89
+ .describe('The action being proposed, e.g. "post". It must be an action the policy in force ' +
90
+ "declares; an action the policy has never heard of cannot be permitted."),
91
+ bindings: z
92
+ .record(z.string(), valueSchema)
93
+ .optional()
94
+ .describe("The action's argument values, bound by parameter name. Omit it (or pass {}) for an " +
95
+ "action that takes no arguments."),
96
+ })
97
+ .strict();
98
+ /**
99
+ * A move against one usage balance's counter — the metered-billing half of an intent.
100
+ *
101
+ * `amount` carries the same decimal-string `minor` as every other money figure here, for
102
+ * the same reason: the ledger's counters are 128-bit, and a JSON number is not.
103
+ */
104
+ export const usageMoveSchema = z
105
+ .object({
106
+ usage: z
107
+ .string()
108
+ .min(1)
109
+ .describe("The usage balance this move lands on (a `usage_…` id). An operator opens usage " +
110
+ "balances for you; you cannot create one, and you can only move a balance your " +
111
+ "party owns."),
112
+ amount: amountSchema.describe("The signed delta, in the balance's own currency/unit. POSITIVE recognizes fresh " +
113
+ 'consumption, metering, or billing ("500" = 5 more dollars of it). NEGATIVE is a ' +
114
+ 'correction that unwinds it — a metering fix, a credit memo ("-500").'),
115
+ })
116
+ .strict();
117
+ /**
118
+ * The `submit_intent` input — the shape the model fills in to move money.
119
+ *
120
+ * A `ZodRawShape` (a plain object of schemas), not a `z.object`: that is what the MCP
121
+ * SDK's `registerTool` takes, and it is what it turns into the advertised JSON Schema.
122
+ */
123
+ export const submitIntentShape = {
124
+ entries: z
125
+ .array(entrySchema)
126
+ .describe("The accounting journal legs. Debits and credits MUST balance per currency — the sum " +
127
+ "of debits equals the sum of credits — or the ledger rejects the intent. Pass [] for a " +
128
+ "deontic action that moves no money."),
129
+ action: actionSchema.describe("The deontic action being proposed. This — not the entries — is what the policy judges."),
130
+ justification: z
131
+ .string()
132
+ .min(1)
133
+ .describe("YOUR stated reason for this intent, in plain language: why you are doing it, and on " +
134
+ "whose authority. This is recorded in the audit trail (the ledger stores its hash, the " +
135
+ "text stays with the caller), and a human reading the ledger later will read this to " +
136
+ "understand what you thought you were doing. Write it for them. Do not write 'test' or " +
137
+ "'n/a'; cite the invoice, the ticket, the instruction you were given."),
138
+ transaction: z
139
+ .string()
140
+ .min(1)
141
+ .optional()
142
+ .describe("An optional client-minted transaction id (`txn_…`). Omit it and one is minted for you. " +
143
+ "It is the ledger's IDEMPOTENCY KEY: re-submitting an id that already committed replays " +
144
+ "its stored outcome instead of posting twice, which is what makes retrying a submission " +
145
+ "safe. Supply one only to deliberately replay, or to correlate with a record outside Axorum. " +
146
+ "It must be an id this server minted (a UUIDv7 id, which carries the time it was minted): " +
147
+ "an id that carries no mint time is refused and nothing is sent."),
148
+ fulfills: z.array(z.string().regex(/^obl_[0-7][0-9a-hjkmnp-tv-z]{25}$/))
149
+ .max(64)
150
+ .refine((ids) => new Set(ids).size === ids.length, "Fulfillment targets must be distinct")
151
+ .optional()
152
+ .describe("Exact obligation IDs this intent proposes to fulfill. All targets must validate."),
153
+ evidence: z
154
+ .array(z.string())
155
+ .optional()
156
+ .describe("Optional lowercase-hex SHA-256 digests of external evidence you are relying on (an " +
157
+ "invoice PDF, a signed approval). The digests go on the ledger; the documents stay with you."),
158
+ consume_usage: usageMoveSchema
159
+ .optional()
160
+ .describe("Optional. Record that you USED a metered resource — an API call, compute-seconds, " +
161
+ "tokens. This is the ground-truth event, and nothing limits it from above: you may " +
162
+ "always report what you actually used. Omit it entirely if this intent consumes nothing."),
163
+ meter_usage: usageMoveSchema
164
+ .optional()
165
+ .describe("Optional. Record that consumption has been MEASURED. You may never meter more than " +
166
+ "was consumed — that is phantom usage, and the ledger refuses the whole intent, " +
167
+ "including the money entries. Omit it entirely if this intent meters nothing."),
168
+ bill_usage: usageMoveSchema
169
+ .optional()
170
+ .describe("Optional. Record that metered usage has been BILLED. You may never bill more than " +
171
+ "was metered — billing with no meter basis is refused, and the whole intent fails " +
172
+ "with it. Omit it entirely if this intent bills nothing."),
173
+ };
174
+ /** The `get_transaction` input. */
175
+ export const getTransactionShape = {
176
+ transaction: z
177
+ .string()
178
+ .min(1)
179
+ .describe("The transaction id (`txn_…`) to read back."),
180
+ };
181
+ /** The `get_receipt` input. */
182
+ export const getReceiptShape = {
183
+ transaction: z
184
+ .string()
185
+ .min(1)
186
+ .describe("The transaction id (`txn_…`) whose signed receipt to fetch."),
187
+ };
188
+ /** The `verify_receipt` input. */
189
+ export const verifyReceiptShape = {
190
+ receipt_envelope: z
191
+ .record(z.string(), z.unknown())
192
+ .describe("The signed receipt to verify: the `axorum.evidence.v0` envelope object exactly as " +
193
+ "`get_receipt` (or the inline `receipt` on a submit outcome) returned it."),
194
+ verification_keys: z
195
+ .record(z.string(), z.unknown())
196
+ .optional()
197
+ .describe("Optional. The deployment's signed key-list envelope (the JSON served at " +
198
+ "`GET /api/verification-keys.json`). Supply one you obtained and pinned " +
199
+ "out-of-band for the strongest check; omit it and the server fetches the " +
200
+ "configured deployment's published list for you."),
201
+ pinned_generation: z
202
+ .number()
203
+ .int()
204
+ .nonnegative()
205
+ .optional()
206
+ .describe("Optional. A previously-seen key-list generation to pin: a list older than " +
207
+ "this is refused as a rollback (a revocation could be hiding in the gap)."),
208
+ };
209
+ /** The `get_usage` input. */
210
+ export const getUsageShape = {
211
+ usage: z
212
+ .string()
213
+ .min(1)
214
+ .describe("The usage balance (`usage_…`) whose running totals to read."),
215
+ };
216
+ /** The `get_obligations` input. */
217
+ export const getObligationsShape = {
218
+ actor: z
219
+ .string()
220
+ .min(1)
221
+ .optional()
222
+ .describe("Optional. Omit it to read duties your party owes or is authorized to perform. Your " +
223
+ "attestation identifies the party. If you pass one (a party id `party_…` or the DSL party name), the " +
224
+ "service confirms it resolves to that same party and returns an error if it does not; " +
225
+ "it cannot be used to read another party's duties."),
226
+ };
227
+ /** The `get_balance` input. */
228
+ export const getBalanceShape = {
229
+ account: z
230
+ .string()
231
+ .min(1)
232
+ .describe("The account id (`acc_…`) whose net balance to read."),
233
+ };
234
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,uBAAuB,CAAC;AAE/C,kEAAkE;AAClE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,wBAAwB,EAAE,YAAY,EAAE,mBAAmB,CAAU,CAAC;AAErG,4FAA4F;AAC5F,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC;KAC1B,MAAM,CAAC;IACN,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,KAAK,CACJ,OAAO,EACP,kFAAkF;QAChF,8CAA8C,CACjD;SACA,QAAQ,CACP,+EAA+E;QAC7E,gFAAgF;QAChF,oDAAoD,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AC3E,CAAC;AAEF,mCAAmC;AACnC,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CACP,qFAAqF;QACnF,sGAAsG;QACtG,uFAAuF;QACvF,mDAAmD,CACtD;CACJ,CAAC;AAEF,+BAA+B;AAC/B,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,qDAAqD,CAAC;CACnE,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * The MCP server: six tools over the Axorum agent plane.
3
+ *
4
+ * # What this is for
5
+ *
6
+ * An MCP-capable agent that connects to this server becomes an Axorum-governed spender,
7
+ * with no integration code. It gets a tool that moves money — and it gets it *safely*,
8
+ * because Axorum sits underneath refusing what the policy in force forbids, and recording
9
+ * the refusal. The guardrail is not a prompt asking the model to behave. It is a ledger
10
+ * that will not post what it is not allowed to post.
11
+ *
12
+ * # The tool descriptions are prompts
13
+ *
14
+ * The `description` on each tool is not documentation for a human skimming a table; it is
15
+ * the text a language model reads when deciding whether to call the tool and what to pass
16
+ * it. So each one says when to use the tool, what a refusal means, and what *not* to do —
17
+ * do not retry a refusal, do not follow a `not_primary` redirect. Those sentences are load
18
+ * bearing. They are the difference between a model that adapts to a policy and one that
19
+ * hammers it.
20
+ *
21
+ * @packageDocumentation
22
+ */
23
+ import { AxorumClient, type AxorumClientOptions } from "@axorum/client";
24
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
25
+ import type { ServerConfig } from "./config.js";
26
+ export declare const SERVER_INFO: {
27
+ readonly name: "axorum";
28
+ readonly version: string;
29
+ };
30
+ /**
31
+ * Builds the server, wired to `client`.
32
+ *
33
+ * The client is injectable so the integration suite can point a real one at a real booted
34
+ * service; production passes none and gets one built from `config`.
35
+ */
36
+ export declare function createServer(config: ServerConfig, client?: AxorumClient): McpServer;
37
+ /**
38
+ * The SDK client's options for the validated configuration. Pure.
39
+ *
40
+ * With failover URLs, `@axorum/client` holds every replica, and a read moves to the next
41
+ * one on a refused connection, a timeout or a `421`, but only under a retry policy. So reads
42
+ * get {@link DEFAULT_RETRY_POLICY}, with at least one send per replica. A submission is sent
43
+ * once, to the replica that last answered, which the policy read `submit_intent` makes
44
+ * first has just found. Without failover URLs no retry policy is set, as before.
45
+ */
46
+ export declare function clientOptions(config: ServerConfig): AxorumClientOptions;
47
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,EAAE,YAAY,EAAwB,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC9F,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAkChD,eAAO,MAAM,WAAW;;;CAAyD,CAAC;AAelF;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAuBnF;AAOD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,mBAAmB,CAkBvE"}