@avallon-labs/mcp 72.4.0 → 72.5.0-staging.1546

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -56,5 +56,5 @@ function describeErrors(body) {
56
56
 
57
57
  // src/index.ts
58
58
  setupFetch();
59
- await import("./server-JLVG5YXW.js");
59
+ await import("./server-EJM7EZXD.js");
60
60
  //# sourceMappingURL=index.js.map
@@ -3839,6 +3839,141 @@ var deleteOrgUnit = async (orgUnitId, options) => {
3839
3839
  const data = body ? JSON.parse(body) : void 0;
3840
3840
  return { data, status: res.status, headers: res.headers };
3841
3841
  };
3842
+ var getCreateLedgerUrl = () => {
3843
+ return `/v1/ledgers`;
3844
+ };
3845
+ var createLedger = async (createLedgerBody, options) => {
3846
+ const getHeaders = (h) => {
3847
+ if (!h) return {};
3848
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
3849
+ if (Array.isArray(h)) return Object.fromEntries(h);
3850
+ return h;
3851
+ };
3852
+ const res = await fetch(
3853
+ getCreateLedgerUrl(),
3854
+ {
3855
+ ...options,
3856
+ method: "POST",
3857
+ headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
3858
+ body: JSON.stringify(createLedgerBody)
3859
+ }
3860
+ );
3861
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3862
+ const data = body ? JSON.parse(body) : {};
3863
+ return { data, status: res.status, headers: res.headers };
3864
+ };
3865
+ var getListLedgersUrl = (params) => {
3866
+ const normalizedParams = new URLSearchParams();
3867
+ Object.entries(params || {}).forEach(([key, value]) => {
3868
+ if (value !== void 0) {
3869
+ normalizedParams.append(key, value === null ? "null" : String(value));
3870
+ }
3871
+ });
3872
+ const stringifiedParams = normalizedParams.toString();
3873
+ return stringifiedParams.length > 0 ? `/v1/ledgers?${stringifiedParams}` : `/v1/ledgers`;
3874
+ };
3875
+ var listLedgers = async (params, options) => {
3876
+ const res = await fetch(
3877
+ getListLedgersUrl(params),
3878
+ {
3879
+ ...options,
3880
+ method: "GET"
3881
+ }
3882
+ );
3883
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3884
+ const data = body ? JSON.parse(body) : {};
3885
+ return { data, status: res.status, headers: res.headers };
3886
+ };
3887
+ var getCreateLedgerAccountUrl = (ledgerId) => {
3888
+ return `/v1/ledgers/${ledgerId}/accounts`;
3889
+ };
3890
+ var createLedgerAccount = async (ledgerId, createLedgerAccountBody, options) => {
3891
+ const getHeaders = (h) => {
3892
+ if (!h) return {};
3893
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
3894
+ if (Array.isArray(h)) return Object.fromEntries(h);
3895
+ return h;
3896
+ };
3897
+ const res = await fetch(
3898
+ getCreateLedgerAccountUrl(ledgerId),
3899
+ {
3900
+ ...options,
3901
+ method: "POST",
3902
+ headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
3903
+ body: JSON.stringify(createLedgerAccountBody)
3904
+ }
3905
+ );
3906
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3907
+ const data = body ? JSON.parse(body) : {};
3908
+ return { data, status: res.status, headers: res.headers };
3909
+ };
3910
+ var getListLedgerAccountsUrl = (ledgerId, params) => {
3911
+ const normalizedParams = new URLSearchParams();
3912
+ Object.entries(params || {}).forEach(([key, value]) => {
3913
+ if (value !== void 0) {
3914
+ normalizedParams.append(key, value === null ? "null" : String(value));
3915
+ }
3916
+ });
3917
+ const stringifiedParams = normalizedParams.toString();
3918
+ return stringifiedParams.length > 0 ? `/v1/ledgers/${ledgerId}/accounts?${stringifiedParams}` : `/v1/ledgers/${ledgerId}/accounts`;
3919
+ };
3920
+ var listLedgerAccounts = async (ledgerId, params, options) => {
3921
+ const res = await fetch(
3922
+ getListLedgerAccountsUrl(ledgerId, params),
3923
+ {
3924
+ ...options,
3925
+ method: "GET"
3926
+ }
3927
+ );
3928
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3929
+ const data = body ? JSON.parse(body) : {};
3930
+ return { data, status: res.status, headers: res.headers };
3931
+ };
3932
+ var getCreateLedgerBookingUrl = (ledgerId) => {
3933
+ return `/v1/ledgers/${ledgerId}/bookings`;
3934
+ };
3935
+ var createLedgerBooking = async (ledgerId, createLedgerBookingBody, options) => {
3936
+ const getHeaders = (h) => {
3937
+ if (!h) return {};
3938
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
3939
+ if (Array.isArray(h)) return Object.fromEntries(h);
3940
+ return h;
3941
+ };
3942
+ const res = await fetch(
3943
+ getCreateLedgerBookingUrl(ledgerId),
3944
+ {
3945
+ ...options,
3946
+ method: "POST",
3947
+ headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
3948
+ body: JSON.stringify(createLedgerBookingBody)
3949
+ }
3950
+ );
3951
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3952
+ const data = body ? JSON.parse(body) : {};
3953
+ return { data, status: res.status, headers: res.headers };
3954
+ };
3955
+ var getListLedgerBookingsUrl = (ledgerId, params) => {
3956
+ const normalizedParams = new URLSearchParams();
3957
+ Object.entries(params || {}).forEach(([key, value]) => {
3958
+ if (value !== void 0) {
3959
+ normalizedParams.append(key, value === null ? "null" : String(value));
3960
+ }
3961
+ });
3962
+ const stringifiedParams = normalizedParams.toString();
3963
+ return stringifiedParams.length > 0 ? `/v1/ledgers/${ledgerId}/bookings?${stringifiedParams}` : `/v1/ledgers/${ledgerId}/bookings`;
3964
+ };
3965
+ var listLedgerBookings = async (ledgerId, params, options) => {
3966
+ const res = await fetch(
3967
+ getListLedgerBookingsUrl(ledgerId, params),
3968
+ {
3969
+ ...options,
3970
+ method: "GET"
3971
+ }
3972
+ );
3973
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3974
+ const data = body ? JSON.parse(body) : {};
3975
+ return { data, status: res.status, headers: res.headers };
3976
+ };
3842
3977
  var getListDispatchesUrl = (params) => {
3843
3978
  const normalizedParams = new URLSearchParams();
3844
3979
  Object.entries(params || {}).forEach(([key, value]) => {
@@ -9158,6 +9293,144 @@ var deleteOrgUnitHandler = async (args, options) => {
9158
9293
  structuredContent: res.data
9159
9294
  };
9160
9295
  };
9296
+ var createLedgerHandler = async (args, options) => {
9297
+ const res = await createLedger(args.bodyParams, options);
9298
+ if (res.status >= 400) {
9299
+ return {
9300
+ content: [
9301
+ {
9302
+ type: "text",
9303
+ text: JSON.stringify(res.data ?? null)
9304
+ }
9305
+ ],
9306
+ isError: true
9307
+ };
9308
+ }
9309
+ return {
9310
+ content: [
9311
+ {
9312
+ type: "text",
9313
+ text: JSON.stringify(res.data ?? null)
9314
+ }
9315
+ ],
9316
+ structuredContent: res.data
9317
+ };
9318
+ };
9319
+ var listLedgersHandler = async (args, options) => {
9320
+ const res = await listLedgers(args.queryParams, options);
9321
+ if (res.status >= 400) {
9322
+ return {
9323
+ content: [
9324
+ {
9325
+ type: "text",
9326
+ text: JSON.stringify(res.data ?? null)
9327
+ }
9328
+ ],
9329
+ isError: true
9330
+ };
9331
+ }
9332
+ return {
9333
+ content: [
9334
+ {
9335
+ type: "text",
9336
+ text: JSON.stringify(res.data ?? null)
9337
+ }
9338
+ ],
9339
+ structuredContent: res.data
9340
+ };
9341
+ };
9342
+ var createLedgerAccountHandler = async (args, options) => {
9343
+ const res = await createLedgerAccount(args.pathParams.ledgerId, args.bodyParams, options);
9344
+ if (res.status >= 400) {
9345
+ return {
9346
+ content: [
9347
+ {
9348
+ type: "text",
9349
+ text: JSON.stringify(res.data ?? null)
9350
+ }
9351
+ ],
9352
+ isError: true
9353
+ };
9354
+ }
9355
+ return {
9356
+ content: [
9357
+ {
9358
+ type: "text",
9359
+ text: JSON.stringify(res.data ?? null)
9360
+ }
9361
+ ],
9362
+ structuredContent: res.data
9363
+ };
9364
+ };
9365
+ var listLedgerAccountsHandler = async (args, options) => {
9366
+ const res = await listLedgerAccounts(args.pathParams.ledgerId, args.queryParams, options);
9367
+ if (res.status >= 400) {
9368
+ return {
9369
+ content: [
9370
+ {
9371
+ type: "text",
9372
+ text: JSON.stringify(res.data ?? null)
9373
+ }
9374
+ ],
9375
+ isError: true
9376
+ };
9377
+ }
9378
+ return {
9379
+ content: [
9380
+ {
9381
+ type: "text",
9382
+ text: JSON.stringify(res.data ?? null)
9383
+ }
9384
+ ],
9385
+ structuredContent: res.data
9386
+ };
9387
+ };
9388
+ var createLedgerBookingHandler = async (args, options) => {
9389
+ const res = await createLedgerBooking(args.pathParams.ledgerId, args.bodyParams, options);
9390
+ if (res.status >= 400) {
9391
+ return {
9392
+ content: [
9393
+ {
9394
+ type: "text",
9395
+ text: JSON.stringify(res.data ?? null)
9396
+ }
9397
+ ],
9398
+ isError: true
9399
+ };
9400
+ }
9401
+ return {
9402
+ content: [
9403
+ {
9404
+ type: "text",
9405
+ text: JSON.stringify(res.data ?? null)
9406
+ }
9407
+ ],
9408
+ structuredContent: res.data
9409
+ };
9410
+ };
9411
+ var listLedgerBookingsHandler = async (args, options) => {
9412
+ const res = await listLedgerBookings(args.pathParams.ledgerId, args.queryParams, options);
9413
+ if (res.status >= 400) {
9414
+ return {
9415
+ content: [
9416
+ {
9417
+ type: "text",
9418
+ text: JSON.stringify(res.data ?? null)
9419
+ }
9420
+ ],
9421
+ isError: true
9422
+ };
9423
+ }
9424
+ return {
9425
+ content: [
9426
+ {
9427
+ type: "text",
9428
+ text: JSON.stringify(res.data ?? null)
9429
+ }
9430
+ ],
9431
+ structuredContent: res.data
9432
+ };
9433
+ };
9161
9434
  var listDispatchesHandler = async (args, options) => {
9162
9435
  const res = await listDispatches(args.queryParams, options);
9163
9436
  if (res.status >= 400) {
@@ -15127,7 +15400,7 @@ var GetProfileResponse = zod.object({
15127
15400
  "last_name": zod.union([zod.string(), zod.null()]),
15128
15401
  "email": zod.string(),
15129
15402
  "role": zod.enum(["admin", "avallon_admin", "member"]),
15130
- "permissions": zod.array(zod.enum(["voice-agents:read", "voice-agents:write", "voice-agents:promote", "tools:write", "tools:execute", "tools:promote", "tool-calls:read", "extractors:write", "inboxes:write", "inboxes:send", "artifacts:write", "api-keys:write", "teams:write", "cases:write", "cases:delete", "case-types:read", "case-types:create", "case-types:write", "forms:read", "forms:create", "forms:write", "forms:request", "forms:promote", "information-requests:write", "information-requests:resolve", "information-requests:delete", "feedback:write", "outbound-jobs:write", "outbound-jobs:schedule", "calls:monitor", "workers:read", "workers:create", "workers:write", "workers:execute", "workers:write-mcp", "workers:run", "workers:promote", "chat-agents:write", "evaluators:write", "intakes:write", "intakes:review", "notifications:write", "prompts:read", "prompts:write", "secrets:read", "secrets:write", "identity-providers:write", "schedules:read", "schedules:write", "org-units:write", "tenants:write", "analytics:view-cost"])),
15403
+ "permissions": zod.array(zod.enum(["voice-agents:read", "voice-agents:write", "voice-agents:promote", "tools:write", "tools:execute", "tools:promote", "tool-calls:read", "extractors:write", "inboxes:write", "inboxes:send", "artifacts:write", "api-keys:write", "teams:write", "cases:write", "cases:delete", "case-types:read", "case-types:create", "case-types:write", "forms:read", "forms:create", "forms:write", "forms:request", "forms:promote", "information-requests:write", "information-requests:resolve", "information-requests:delete", "feedback:write", "outbound-jobs:write", "outbound-jobs:schedule", "calls:monitor", "workers:read", "workers:create", "workers:write", "workers:execute", "workers:write-mcp", "workers:run", "workers:promote", "chat-agents:write", "evaluators:write", "intakes:write", "intakes:review", "notifications:write", "prompts:read", "prompts:write", "secrets:read", "secrets:write", "identity-providers:write", "schedules:read", "schedules:write", "org-units:write", "ledgers:write", "tenants:write", "analytics:view-cost"])),
15131
15404
  "tenants": zod.object({
15132
15405
  "active": zod.object({
15133
15406
  "id": zod.string(),
@@ -15859,6 +16132,157 @@ var DeleteOrgUnitParams = zod.object({
15859
16132
  "orgUnitId": zod.string().uuid()
15860
16133
  });
15861
16134
  var DeleteOrgUnitResponse = zod.void();
16135
+ var createLedgerBodyNameMax = 200;
16136
+ var createLedgerBodyAccountsItemNameRegExp = new RegExp("^[a-z0-9_]{1,100}$");
16137
+ var createLedgerBodyAccountsDefault = [];
16138
+ var createLedgerBodyAccountsMax = 100;
16139
+ var CreateLedgerBody = zod.object({
16140
+ "name": zod.string().min(1).max(createLedgerBodyNameMax).describe('Name of the ledger, e.g. "Demo client claims account"'),
16141
+ "environment": zod.enum(["live", "test"]).optional().describe("Environment the ledger belongs to. Defaults to `live`."),
16142
+ "accounts": zod.array(zod.object({
16143
+ "name": zod.string().regex(createLedgerBodyAccountsItemNameRegExp).describe('Name of the account within the ledger, e.g. "cash"'),
16144
+ "kind": zod.enum(["money", "estimate"]).describe("`money` for accounts that follow real amounts, `estimate` for estimates such as reserves.")
16145
+ })).max(createLedgerBodyAccountsMax).default(createLedgerBodyAccountsDefault).describe("Accounts to create with the ledger. The ledger and all accounts are created together, or nothing is.")
16146
+ });
16147
+ var CreateLedgerResponse = zod.object({
16148
+ "data": zod.object({
16149
+ "id": zod.string().uuid(),
16150
+ "name": zod.string(),
16151
+ "environment": zod.enum(["live", "test"]),
16152
+ "created_at": zod.string().datetime({ "offset": true }),
16153
+ "accounts": zod.array(zod.object({
16154
+ "id": zod.string().uuid(),
16155
+ "name": zod.string(),
16156
+ "kind": zod.enum(["money", "estimate"]).describe("`money` accounts follow real amounts, `estimate` accounts hold estimates such as reserves. A booking never crosses kinds."),
16157
+ "created_at": zod.string().datetime({ "offset": true })
16158
+ }))
16159
+ }),
16160
+ "message": zod.string()
16161
+ });
16162
+ var listLedgersQueryCountDefault = 50;
16163
+ var listLedgersQueryCountMax = 100;
16164
+ var listLedgersQueryOffsetDefault = 0;
16165
+ var listLedgersQueryOffsetMin = 0;
16166
+ var listLedgersQuerySortByDefault = `name`;
16167
+ var listLedgersQuerySortOrderDefault = `asc`;
16168
+ var ListLedgersQueryParams = zod.object({
16169
+ "count": zod.number().min(1).max(listLedgersQueryCountMax).default(listLedgersQueryCountDefault),
16170
+ "offset": zod.number().min(listLedgersQueryOffsetMin).default(listLedgersQueryOffsetDefault),
16171
+ "sort_by": zod.enum(["name", "created_at"]).default(listLedgersQuerySortByDefault),
16172
+ "sort_order": zod.enum(["asc", "desc"]).default(listLedgersQuerySortOrderDefault)
16173
+ });
16174
+ var ListLedgersResponse = zod.object({
16175
+ "data": zod.array(zod.object({
16176
+ "id": zod.string().uuid(),
16177
+ "name": zod.string(),
16178
+ "environment": zod.enum(["live", "test"]),
16179
+ "created_at": zod.string().datetime({ "offset": true })
16180
+ })),
16181
+ "message": zod.string(),
16182
+ "meta": zod.object({
16183
+ "total": zod.number()
16184
+ })
16185
+ });
16186
+ var CreateLedgerAccountParams = zod.object({
16187
+ "ledgerId": zod.string().uuid()
16188
+ });
16189
+ var createLedgerAccountBodyNameRegExp = new RegExp("^[a-z0-9_]{1,100}$");
16190
+ var CreateLedgerAccountBody = zod.object({
16191
+ "name": zod.string().regex(createLedgerAccountBodyNameRegExp).describe('Name of the account within the ledger, e.g. "cash"'),
16192
+ "kind": zod.enum(["money", "estimate"]).describe("`money` for accounts that follow real amounts, `estimate` for estimates such as reserves.")
16193
+ });
16194
+ var CreateLedgerAccountResponse = zod.object({
16195
+ "data": zod.object({
16196
+ "id": zod.string().uuid(),
16197
+ "name": zod.string(),
16198
+ "kind": zod.enum(["money", "estimate"]).describe("`money` accounts follow real amounts, `estimate` accounts hold estimates such as reserves. A booking never crosses kinds."),
16199
+ "created_at": zod.string().datetime({ "offset": true })
16200
+ }),
16201
+ "message": zod.string()
16202
+ });
16203
+ var ListLedgerAccountsParams = zod.object({
16204
+ "ledgerId": zod.string().uuid()
16205
+ });
16206
+ var ListLedgerAccountsQueryParams = zod.object({
16207
+ "case_id": zod.string().min(1).optional().describe("Count only the bookings of this case. Omit for the balances of the whole ledger.")
16208
+ });
16209
+ var listLedgerAccountsResponseDataItemBalanceCentsMin = -9007199254740991;
16210
+ var listLedgerAccountsResponseDataItemBalanceCentsMax = 9007199254740991;
16211
+ var ListLedgerAccountsResponse = zod.object({
16212
+ "data": zod.array(zod.object({
16213
+ "id": zod.string().uuid(),
16214
+ "name": zod.string(),
16215
+ "kind": zod.enum(["money", "estimate"]).describe("`money` accounts follow real amounts, `estimate` accounts hold estimates such as reserves. A booking never crosses kinds."),
16216
+ "created_at": zod.string().datetime({ "offset": true }),
16217
+ "balance_cents": zod.number().int().min(listLedgerAccountsResponseDataItemBalanceCentsMin).max(listLedgerAccountsResponseDataItemBalanceCentsMax).describe("Everything booked into the account minus everything booked out of it, in cents. Can be negative.")
16218
+ })),
16219
+ "message": zod.string()
16220
+ });
16221
+ var CreateLedgerBookingParams = zod.object({
16222
+ "ledgerId": zod.string().uuid()
16223
+ });
16224
+ var createLedgerBookingBodyFromAccountRegExp = new RegExp("^[a-z0-9_]{1,100}$");
16225
+ var createLedgerBookingBodyToAccountRegExp = new RegExp("^[a-z0-9_]{1,100}$");
16226
+ var createLedgerBookingBodyAmountCentsMax = 9007199254740991;
16227
+ var createLedgerBookingBodyMemoMax = 500;
16228
+ var createLedgerBookingBodyIdempotencyKeyMax = 200;
16229
+ var CreateLedgerBookingBody = zod.object({
16230
+ "from_account": zod.string().regex(createLedgerBookingBodyFromAccountRegExp).describe("Name of the account the amount is taken out of"),
16231
+ "to_account": zod.string().regex(createLedgerBookingBodyToAccountRegExp).describe("Name of the account the amount is put into. Must have the same kind as `from_account`."),
16232
+ "amount_cents": zod.number().int().min(1).max(createLedgerBookingBodyAmountCentsMax).describe("Amount in whole cents, above zero"),
16233
+ "case_id": zod.string().min(1).optional().describe("Case the booking belongs to. Omit for a booking with no case."),
16234
+ "memo": zod.string().min(1).max(createLedgerBookingBodyMemoMax).optional().describe('Free text for people, e.g. "Mock check 10001"'),
16235
+ "idempotency_key": zod.string().min(1).max(createLedgerBookingBodyIdempotencyKeyMax).describe("Unique within the ledger. Sending the same key with the same content again returns the first booking and books nothing; the same key with different content returns 409.")
16236
+ });
16237
+ var createLedgerBookingResponseDataAmountCentsMax = 9007199254740991;
16238
+ var CreateLedgerBookingResponse = zod.object({
16239
+ "data": zod.object({
16240
+ "id": zod.string().uuid(),
16241
+ "from_account": zod.string().describe("Account the amount was taken out of"),
16242
+ "to_account": zod.string().describe("Account the amount was put into"),
16243
+ "amount_cents": zod.number().int().min(1).max(createLedgerBookingResponseDataAmountCentsMax),
16244
+ "case_id": zod.union([zod.string(), zod.null()]).describe("Case the booking belongs to. Null for a booking with no case."),
16245
+ "memo": zod.union([zod.string(), zod.null()]),
16246
+ "created_by": zod.string(),
16247
+ "created_at": zod.string().datetime({ "offset": true })
16248
+ }),
16249
+ "message": zod.string()
16250
+ });
16251
+ var ListLedgerBookingsParams = zod.object({
16252
+ "ledgerId": zod.string().uuid()
16253
+ });
16254
+ var listLedgerBookingsQueryAccountRegExp = new RegExp("^[a-z0-9_]{1,100}$");
16255
+ var listLedgerBookingsQueryCountDefault = 50;
16256
+ var listLedgerBookingsQueryCountMax = 100;
16257
+ var listLedgerBookingsQueryOffsetDefault = 0;
16258
+ var listLedgerBookingsQueryOffsetMin = 0;
16259
+ var listLedgerBookingsQuerySortByDefault = `created_at`;
16260
+ var listLedgerBookingsQuerySortOrderDefault = `desc`;
16261
+ var ListLedgerBookingsQueryParams = zod.object({
16262
+ "account": zod.string().regex(listLedgerBookingsQueryAccountRegExp).optional().describe("Only bookings into or out of this account"),
16263
+ "case_id": zod.string().min(1).optional().describe("Only bookings of this case"),
16264
+ "count": zod.number().min(1).max(listLedgerBookingsQueryCountMax).default(listLedgerBookingsQueryCountDefault),
16265
+ "offset": zod.number().min(listLedgerBookingsQueryOffsetMin).default(listLedgerBookingsQueryOffsetDefault),
16266
+ "sort_by": zod.enum(["created_at"]).default(listLedgerBookingsQuerySortByDefault),
16267
+ "sort_order": zod.enum(["asc", "desc"]).default(listLedgerBookingsQuerySortOrderDefault)
16268
+ });
16269
+ var listLedgerBookingsResponseDataItemAmountCentsMax = 9007199254740991;
16270
+ var ListLedgerBookingsResponse = zod.object({
16271
+ "data": zod.array(zod.object({
16272
+ "id": zod.string().uuid(),
16273
+ "from_account": zod.string().describe("Account the amount was taken out of"),
16274
+ "to_account": zod.string().describe("Account the amount was put into"),
16275
+ "amount_cents": zod.number().int().min(1).max(listLedgerBookingsResponseDataItemAmountCentsMax),
16276
+ "case_id": zod.union([zod.string(), zod.null()]).describe("Case the booking belongs to. Null for a booking with no case."),
16277
+ "memo": zod.union([zod.string(), zod.null()]),
16278
+ "created_by": zod.string(),
16279
+ "created_at": zod.string().datetime({ "offset": true })
16280
+ })),
16281
+ "message": zod.string(),
16282
+ "meta": zod.object({
16283
+ "total": zod.number()
16284
+ })
16285
+ });
15862
16286
  var listDispatchesQueryCountDefault = 50;
15863
16287
  var listDispatchesQueryCountMax = 100;
15864
16288
  var listDispatchesQueryOffsetDefault = 0;
@@ -20251,6 +20675,106 @@ var createMcpServer = (options) => {
20251
20675
  signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
20252
20676
  })
20253
20677
  );
20678
+ tools.createLedger = server2.registerTool(
20679
+ "createLedger",
20680
+ {
20681
+ title: "Create a ledger",
20682
+ description: "Create a ledger for one owner of money, such as a client or program with its own bank account. Pass `accounts` to create its accounts in the same call; more can be added later. Returns 400 if an account name is listed more than once. Requires the `ledgers:write` permission.",
20683
+ inputSchema: {
20684
+ bodyParams: CreateLedgerBody.optional()
20685
+ },
20686
+ outputSchema: CreateLedgerResponse,
20687
+ annotations: { destructiveHint: true }
20688
+ },
20689
+ (args, ctx) => createLedgerHandler(args, {
20690
+ ...options,
20691
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
20692
+ })
20693
+ );
20694
+ tools.listLedgers = server2.registerTool(
20695
+ "listLedgers",
20696
+ {
20697
+ title: "List ledgers",
20698
+ description: "List the organization's ledgers, paginated.",
20699
+ inputSchema: {
20700
+ queryParams: ListLedgersQueryParams
20701
+ },
20702
+ outputSchema: ListLedgersResponse,
20703
+ annotations: { readOnlyHint: true }
20704
+ },
20705
+ (args, ctx) => listLedgersHandler(args, {
20706
+ ...options,
20707
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
20708
+ })
20709
+ );
20710
+ tools.createLedgerAccount = server2.registerTool(
20711
+ "createLedgerAccount",
20712
+ {
20713
+ title: "Create a ledger account",
20714
+ description: "Add a named account to a ledger. Returns 409 if the name already exists in this ledger. Requires the `ledgers:write` permission.",
20715
+ inputSchema: {
20716
+ pathParams: CreateLedgerAccountParams,
20717
+ bodyParams: CreateLedgerAccountBody.optional()
20718
+ },
20719
+ outputSchema: CreateLedgerAccountResponse,
20720
+ annotations: { destructiveHint: true }
20721
+ },
20722
+ (args, ctx) => createLedgerAccountHandler(args, {
20723
+ ...options,
20724
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
20725
+ })
20726
+ );
20727
+ tools.listLedgerAccounts = server2.registerTool(
20728
+ "listLedgerAccounts",
20729
+ {
20730
+ title: "List ledger accounts with balances",
20731
+ description: "List every account of a ledger with its balance, for the whole ledger or for one case. Balances are summed from the bookings on every read.",
20732
+ inputSchema: {
20733
+ pathParams: ListLedgerAccountsParams,
20734
+ queryParams: ListLedgerAccountsQueryParams
20735
+ },
20736
+ outputSchema: ListLedgerAccountsResponse,
20737
+ annotations: { readOnlyHint: true }
20738
+ },
20739
+ (args, ctx) => listLedgerAccountsHandler(args, {
20740
+ ...options,
20741
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
20742
+ })
20743
+ );
20744
+ tools.createLedgerBooking = server2.registerTool(
20745
+ "createLedgerBooking",
20746
+ {
20747
+ title: "Create a ledger booking",
20748
+ description: "Move an amount out of one account and into another. Bookings are never changed or deleted: to correct one, book the same amount in the opposite direction. Returns 404 if an account or the case is unknown and 400 if the two accounts have different kinds. Requires the `ledgers:write` permission.",
20749
+ inputSchema: {
20750
+ pathParams: CreateLedgerBookingParams,
20751
+ bodyParams: CreateLedgerBookingBody.optional()
20752
+ },
20753
+ outputSchema: CreateLedgerBookingResponse,
20754
+ annotations: { destructiveHint: true }
20755
+ },
20756
+ (args, ctx) => createLedgerBookingHandler(args, {
20757
+ ...options,
20758
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
20759
+ })
20760
+ );
20761
+ tools.listLedgerBookings = server2.registerTool(
20762
+ "listLedgerBookings",
20763
+ {
20764
+ title: "List ledger bookings",
20765
+ description: "List the bookings of a ledger, newest first, paginated. Filter by account or case.",
20766
+ inputSchema: {
20767
+ pathParams: ListLedgerBookingsParams,
20768
+ queryParams: ListLedgerBookingsQueryParams
20769
+ },
20770
+ outputSchema: ListLedgerBookingsResponse,
20771
+ annotations: { readOnlyHint: true }
20772
+ },
20773
+ (args, ctx) => listLedgerBookingsHandler(args, {
20774
+ ...options,
20775
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
20776
+ })
20777
+ );
20254
20778
  tools.listDispatches = server2.registerTool(
20255
20779
  "listDispatches",
20256
20780
  {
@@ -21062,4 +21586,4 @@ var transport = new StdioServerTransport();
21062
21586
  server.connect(transport).then(() => {
21063
21587
  console.error("MCP server running on stdio");
21064
21588
  }).catch(console.error);
21065
- //# sourceMappingURL=server-JLVG5YXW.js.map
21589
+ //# sourceMappingURL=server-EJM7EZXD.js.map