@winstonsayno/mcp-gateway 7.6.0 → 7.7.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,480 @@
1
+ /**
2
+ * Approvals 2.0 (7.7): multi-step, conditional approval flows with named approvers and escalation.
3
+ *
4
+ * The 1.x approvals hold a call until *an operator* approves it. An **approval flow** holds matching calls until each
5
+ * of its **steps** is approved by the required number of **approvers** (client-id globs — any authenticated client,
6
+ * not only operators). Flows and steps can be **conditional** on the arguments; a step can **escalate** to more
7
+ * approvers after a while. A denial at any step, or the flow timeout, refuses the call (JSON-RPC -32004, as 1.x).
8
+ *
9
+ * ```yaml
10
+ * approvalFlows:
11
+ * flows:
12
+ * - id: payments
13
+ * tools: ["payments/transfer"] # server/tool globs
14
+ * when: [{ path: amount, op: gte, value: 1000 }]
15
+ * timeoutSeconds: 900
16
+ * steps:
17
+ * - { name: lead, approvers: ["key:lead-*"] }
18
+ * - name: finance
19
+ * approvers: ["key:fin-*"]
20
+ * required: 2
21
+ * when: [{ path: amount, op: gte, value: 10000 }] # only for large transfers
22
+ * escalateAfterSeconds: 300
23
+ * escalateTo: ["key:cfo"]
24
+ * ```
25
+ *
26
+ * Conditions: `{ path, op, value }` on the arguments (dot path), `op` ∈ `eq ne gt gte lt lte in matches exists`.
27
+ * The requester can never approve its own call; one approval per client per step.
28
+ *
29
+ * Approvers (any client): `GET /api/v1/features/approval-flows/inbox`, `GET …/mine`,
30
+ * `POST /api/v1/features/approval-flows/:id/approve|deny` `{ reason? }`.
31
+ * Operators: `GET /api/v1/admin/approval-flows`, `POST /api/v1/admin/approval-flows/:id/approve|deny` (override),
32
+ * `POST /api/v1/admin/approval-flows/evaluate` `{ server, tool, client?, arguments? }` (which flow / steps would apply).
33
+ *
34
+ * @module features/approval-flows
35
+ */
36
+ import { z } from 'zod';
37
+ declare const Cond: z.ZodEffects<z.ZodObject<{
38
+ path: z.ZodString;
39
+ op: z.ZodEnum<["eq", "ne", "gt", "gte", "lt", "lte", "in", "matches", "exists"]>;
40
+ value: z.ZodOptional<z.ZodUnknown>;
41
+ }, "strict", z.ZodTypeAny, {
42
+ path: string;
43
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
44
+ value?: unknown;
45
+ }, {
46
+ path: string;
47
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
48
+ value?: unknown;
49
+ }>, {
50
+ path: string;
51
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
52
+ value?: unknown;
53
+ }, {
54
+ path: string;
55
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
56
+ value?: unknown;
57
+ }>;
58
+ declare const Flow: z.ZodObject<{
59
+ id: z.ZodString;
60
+ tools: z.ZodArray<z.ZodString, "many">;
61
+ clients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
62
+ when: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodObject<{
63
+ path: z.ZodString;
64
+ op: z.ZodEnum<["eq", "ne", "gt", "gte", "lt", "lte", "in", "matches", "exists"]>;
65
+ value: z.ZodOptional<z.ZodUnknown>;
66
+ }, "strict", z.ZodTypeAny, {
67
+ path: string;
68
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
69
+ value?: unknown;
70
+ }, {
71
+ path: string;
72
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
73
+ value?: unknown;
74
+ }>, {
75
+ path: string;
76
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
77
+ value?: unknown;
78
+ }, {
79
+ path: string;
80
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
81
+ value?: unknown;
82
+ }>, "many">>;
83
+ timeoutSeconds: z.ZodDefault<z.ZodNumber>;
84
+ steps: z.ZodArray<z.ZodObject<{
85
+ name: z.ZodString;
86
+ approvers: z.ZodArray<z.ZodString, "many">;
87
+ required: z.ZodDefault<z.ZodNumber>;
88
+ when: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodObject<{
89
+ path: z.ZodString;
90
+ op: z.ZodEnum<["eq", "ne", "gt", "gte", "lt", "lte", "in", "matches", "exists"]>;
91
+ value: z.ZodOptional<z.ZodUnknown>;
92
+ }, "strict", z.ZodTypeAny, {
93
+ path: string;
94
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
95
+ value?: unknown;
96
+ }, {
97
+ path: string;
98
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
99
+ value?: unknown;
100
+ }>, {
101
+ path: string;
102
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
103
+ value?: unknown;
104
+ }, {
105
+ path: string;
106
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
107
+ value?: unknown;
108
+ }>, "many">>;
109
+ escalateAfterSeconds: z.ZodOptional<z.ZodNumber>;
110
+ escalateTo: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
111
+ }, "strict", z.ZodTypeAny, {
112
+ name: string;
113
+ when: {
114
+ path: string;
115
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
116
+ value?: unknown;
117
+ }[];
118
+ approvers: string[];
119
+ required: number;
120
+ escalateTo: string[];
121
+ escalateAfterSeconds?: number | undefined;
122
+ }, {
123
+ name: string;
124
+ approvers: string[];
125
+ when?: {
126
+ path: string;
127
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
128
+ value?: unknown;
129
+ }[] | undefined;
130
+ required?: number | undefined;
131
+ escalateAfterSeconds?: number | undefined;
132
+ escalateTo?: string[] | undefined;
133
+ }>, "many">;
134
+ }, "strict", z.ZodTypeAny, {
135
+ id: string;
136
+ tools: string[];
137
+ when: {
138
+ path: string;
139
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
140
+ value?: unknown;
141
+ }[];
142
+ timeoutSeconds: number;
143
+ steps: {
144
+ name: string;
145
+ when: {
146
+ path: string;
147
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
148
+ value?: unknown;
149
+ }[];
150
+ approvers: string[];
151
+ required: number;
152
+ escalateTo: string[];
153
+ escalateAfterSeconds?: number | undefined;
154
+ }[];
155
+ clients?: string[] | undefined;
156
+ }, {
157
+ id: string;
158
+ tools: string[];
159
+ steps: {
160
+ name: string;
161
+ approvers: string[];
162
+ when?: {
163
+ path: string;
164
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
165
+ value?: unknown;
166
+ }[] | undefined;
167
+ required?: number | undefined;
168
+ escalateAfterSeconds?: number | undefined;
169
+ escalateTo?: string[] | undefined;
170
+ }[];
171
+ clients?: string[] | undefined;
172
+ when?: {
173
+ path: string;
174
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
175
+ value?: unknown;
176
+ }[] | undefined;
177
+ timeoutSeconds?: number | undefined;
178
+ }>;
179
+ export declare const ApprovalFlowsSchema: z.ZodEffects<z.ZodObject<{
180
+ enabled: z.ZodDefault<z.ZodBoolean>;
181
+ flows: z.ZodDefault<z.ZodArray<z.ZodObject<{
182
+ id: z.ZodString;
183
+ tools: z.ZodArray<z.ZodString, "many">;
184
+ clients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
185
+ when: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodObject<{
186
+ path: z.ZodString;
187
+ op: z.ZodEnum<["eq", "ne", "gt", "gte", "lt", "lte", "in", "matches", "exists"]>;
188
+ value: z.ZodOptional<z.ZodUnknown>;
189
+ }, "strict", z.ZodTypeAny, {
190
+ path: string;
191
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
192
+ value?: unknown;
193
+ }, {
194
+ path: string;
195
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
196
+ value?: unknown;
197
+ }>, {
198
+ path: string;
199
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
200
+ value?: unknown;
201
+ }, {
202
+ path: string;
203
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
204
+ value?: unknown;
205
+ }>, "many">>;
206
+ timeoutSeconds: z.ZodDefault<z.ZodNumber>;
207
+ steps: z.ZodArray<z.ZodObject<{
208
+ name: z.ZodString;
209
+ approvers: z.ZodArray<z.ZodString, "many">;
210
+ required: z.ZodDefault<z.ZodNumber>;
211
+ when: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodObject<{
212
+ path: z.ZodString;
213
+ op: z.ZodEnum<["eq", "ne", "gt", "gte", "lt", "lte", "in", "matches", "exists"]>;
214
+ value: z.ZodOptional<z.ZodUnknown>;
215
+ }, "strict", z.ZodTypeAny, {
216
+ path: string;
217
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
218
+ value?: unknown;
219
+ }, {
220
+ path: string;
221
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
222
+ value?: unknown;
223
+ }>, {
224
+ path: string;
225
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
226
+ value?: unknown;
227
+ }, {
228
+ path: string;
229
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
230
+ value?: unknown;
231
+ }>, "many">>;
232
+ escalateAfterSeconds: z.ZodOptional<z.ZodNumber>;
233
+ escalateTo: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
234
+ }, "strict", z.ZodTypeAny, {
235
+ name: string;
236
+ when: {
237
+ path: string;
238
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
239
+ value?: unknown;
240
+ }[];
241
+ approvers: string[];
242
+ required: number;
243
+ escalateTo: string[];
244
+ escalateAfterSeconds?: number | undefined;
245
+ }, {
246
+ name: string;
247
+ approvers: string[];
248
+ when?: {
249
+ path: string;
250
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
251
+ value?: unknown;
252
+ }[] | undefined;
253
+ required?: number | undefined;
254
+ escalateAfterSeconds?: number | undefined;
255
+ escalateTo?: string[] | undefined;
256
+ }>, "many">;
257
+ }, "strict", z.ZodTypeAny, {
258
+ id: string;
259
+ tools: string[];
260
+ when: {
261
+ path: string;
262
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
263
+ value?: unknown;
264
+ }[];
265
+ timeoutSeconds: number;
266
+ steps: {
267
+ name: string;
268
+ when: {
269
+ path: string;
270
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
271
+ value?: unknown;
272
+ }[];
273
+ approvers: string[];
274
+ required: number;
275
+ escalateTo: string[];
276
+ escalateAfterSeconds?: number | undefined;
277
+ }[];
278
+ clients?: string[] | undefined;
279
+ }, {
280
+ id: string;
281
+ tools: string[];
282
+ steps: {
283
+ name: string;
284
+ approvers: string[];
285
+ when?: {
286
+ path: string;
287
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
288
+ value?: unknown;
289
+ }[] | undefined;
290
+ required?: number | undefined;
291
+ escalateAfterSeconds?: number | undefined;
292
+ escalateTo?: string[] | undefined;
293
+ }[];
294
+ clients?: string[] | undefined;
295
+ when?: {
296
+ path: string;
297
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
298
+ value?: unknown;
299
+ }[] | undefined;
300
+ timeoutSeconds?: number | undefined;
301
+ }>, "many">>;
302
+ historySize: z.ZodDefault<z.ZodNumber>;
303
+ }, "strict", z.ZodTypeAny, {
304
+ enabled: boolean;
305
+ flows: {
306
+ id: string;
307
+ tools: string[];
308
+ when: {
309
+ path: string;
310
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
311
+ value?: unknown;
312
+ }[];
313
+ timeoutSeconds: number;
314
+ steps: {
315
+ name: string;
316
+ when: {
317
+ path: string;
318
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
319
+ value?: unknown;
320
+ }[];
321
+ approvers: string[];
322
+ required: number;
323
+ escalateTo: string[];
324
+ escalateAfterSeconds?: number | undefined;
325
+ }[];
326
+ clients?: string[] | undefined;
327
+ }[];
328
+ historySize: number;
329
+ }, {
330
+ enabled?: boolean | undefined;
331
+ flows?: {
332
+ id: string;
333
+ tools: string[];
334
+ steps: {
335
+ name: string;
336
+ approvers: string[];
337
+ when?: {
338
+ path: string;
339
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
340
+ value?: unknown;
341
+ }[] | undefined;
342
+ required?: number | undefined;
343
+ escalateAfterSeconds?: number | undefined;
344
+ escalateTo?: string[] | undefined;
345
+ }[];
346
+ clients?: string[] | undefined;
347
+ when?: {
348
+ path: string;
349
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
350
+ value?: unknown;
351
+ }[] | undefined;
352
+ timeoutSeconds?: number | undefined;
353
+ }[] | undefined;
354
+ historySize?: number | undefined;
355
+ }>, {
356
+ enabled: boolean;
357
+ flows: {
358
+ id: string;
359
+ tools: string[];
360
+ when: {
361
+ path: string;
362
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
363
+ value?: unknown;
364
+ }[];
365
+ timeoutSeconds: number;
366
+ steps: {
367
+ name: string;
368
+ when: {
369
+ path: string;
370
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
371
+ value?: unknown;
372
+ }[];
373
+ approvers: string[];
374
+ required: number;
375
+ escalateTo: string[];
376
+ escalateAfterSeconds?: number | undefined;
377
+ }[];
378
+ clients?: string[] | undefined;
379
+ }[];
380
+ historySize: number;
381
+ }, {
382
+ enabled?: boolean | undefined;
383
+ flows?: {
384
+ id: string;
385
+ tools: string[];
386
+ steps: {
387
+ name: string;
388
+ approvers: string[];
389
+ when?: {
390
+ path: string;
391
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
392
+ value?: unknown;
393
+ }[] | undefined;
394
+ required?: number | undefined;
395
+ escalateAfterSeconds?: number | undefined;
396
+ escalateTo?: string[] | undefined;
397
+ }[];
398
+ clients?: string[] | undefined;
399
+ when?: {
400
+ path: string;
401
+ op: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "matches" | "exists";
402
+ value?: unknown;
403
+ }[] | undefined;
404
+ timeoutSeconds?: number | undefined;
405
+ }[] | undefined;
406
+ historySize?: number | undefined;
407
+ }>;
408
+ export type ApprovalFlowsConfig = z.input<typeof ApprovalFlowsSchema>;
409
+ type Cfg = z.output<typeof ApprovalFlowsSchema>;
410
+ type FlowT = z.output<typeof Flow>;
411
+ type CondT = z.output<typeof Cond>;
412
+ /** Evaluate one condition against the call arguments. */
413
+ export declare function test(c: CondT, args: unknown): boolean;
414
+ /** First flow matching a call, with the steps that apply to it. */
415
+ export declare function matchFlow(c: Cfg, call: {
416
+ serverId: string;
417
+ tool: string;
418
+ clientId?: string;
419
+ args: unknown;
420
+ }): {
421
+ flow: FlowT;
422
+ steps: FlowT['steps'];
423
+ } | undefined;
424
+ export interface FlowStepState {
425
+ name: string;
426
+ approvers: string[];
427
+ required: number;
428
+ escalateTo: string[];
429
+ escalated: boolean;
430
+ status: 'waiting' | 'pending' | 'approved';
431
+ approvals: Array<{
432
+ by: string;
433
+ at: string;
434
+ reason?: string;
435
+ }>;
436
+ }
437
+ export interface FlowRequest {
438
+ id: string;
439
+ flow: string;
440
+ status: 'pending' | 'approved' | 'denied' | 'expired';
441
+ clientId?: string;
442
+ serverId: string;
443
+ tool: string;
444
+ arguments: unknown;
445
+ steps: FlowStepState[];
446
+ current: number;
447
+ createdAt: string;
448
+ expiresAt: string;
449
+ decidedAt?: string;
450
+ decidedBy?: string;
451
+ reason?: string;
452
+ }
453
+ export declare class FlowError extends Error {
454
+ readonly status: 403 | 404 | 409;
455
+ constructor(message: string, status: 403 | 404 | 409);
456
+ }
457
+ export declare class FlowQueue {
458
+ private historySize;
459
+ private held;
460
+ history: FlowRequest[];
461
+ constructor(historySize?: number);
462
+ start(flow: FlowT, steps: FlowT['steps'], call: {
463
+ serverId: string;
464
+ tool: string;
465
+ clientId?: string;
466
+ args: unknown;
467
+ }): Promise<FlowRequest>;
468
+ private armEscalation;
469
+ private finish;
470
+ /** May `client` act on the current step of `req`? */
471
+ canApprove(req: FlowRequest, client: string): boolean;
472
+ /** Approve / deny the current step. `override` (operators) skips the approver check and completes the step. */
473
+ decide(id: string, approve: boolean, by: string, reason?: string, override?: boolean): FlowRequest;
474
+ pending(): FlowRequest[];
475
+ get(id: string): FlowRequest | undefined;
476
+ close(): void;
477
+ }
478
+ export declare const flowQueue: FlowQueue;
479
+ export {};
480
+ //# sourceMappingURL=approval-flows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approval-flows.d.ts","sourceRoot":"","sources":["../../src/features/approval-flows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAIH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;EAYN,CAAC;AAWL,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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