@adtl/gateway 0.8.0 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -3
- package/dist/cli.js +10 -1
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +145 -881
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +37 -9
- package/dist/config.js.map +1 -1
- package/dist/elicitation.d.ts +7 -1
- package/dist/elicitation.d.ts.map +1 -1
- package/dist/elicitation.js +21 -14
- package/dist/elicitation.js.map +1 -1
- package/dist/gateway.d.ts +5 -1
- package/dist/gateway.d.ts.map +1 -1
- package/dist/gateway.js +4 -2
- package/dist/gateway.js.map +1 -1
- package/dist/hooks/claudeCode.d.ts +1 -0
- package/dist/hooks/claudeCode.d.ts.map +1 -1
- package/dist/hooks/claudeCode.js +23 -4
- package/dist/hooks/claudeCode.js.map +1 -1
- package/dist/hooks/run.d.ts.map +1 -1
- package/dist/hooks/run.js +2 -1
- package/dist/hooks/run.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/invoker.d.ts +2 -0
- package/dist/invoker.d.ts.map +1 -1
- package/dist/invoker.js +6 -0
- package/dist/invoker.js.map +1 -1
- package/dist/openfga.d.ts +13 -0
- package/dist/openfga.d.ts.map +1 -0
- package/dist/openfga.js +101 -0
- package/dist/openfga.js.map +1 -0
- package/dist/startup.d.ts +1 -1
- package/dist/startup.d.ts.map +1 -1
- package/dist/startup.js +27 -6
- package/dist/startup.js.map +1 -1
- package/dist/totp.d.ts +42 -0
- package/dist/totp.d.ts.map +1 -0
- package/dist/totp.js +176 -0
- package/dist/totp.js.map +1 -0
- package/dist/totpCli.d.ts +11 -0
- package/dist/totpCli.d.ts.map +1 -0
- package/dist/totpCli.js +46 -0
- package/dist/totpCli.js.map +1 -0
- package/package.json +8 -7
- package/playground/server.mjs +13 -3
- package/src/cli.ts +10 -1
- package/src/config.ts +42 -9
- package/src/elicitation.ts +35 -17
- package/src/gateway.ts +7 -2
- package/src/hooks/claudeCode.ts +25 -5
- package/src/hooks/run.ts +2 -1
- package/src/index.ts +3 -0
- package/src/invoker.ts +7 -0
- package/src/openfga.ts +101 -0
- package/src/startup.ts +27 -6
- package/src/totp.ts +191 -0
- package/src/totpCli.ts +52 -0
- package/src/types/qrcode-terminal.d.ts +4 -0
package/dist/config.d.ts
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* maintainers: { members: [alice], tools: ["github.*"] }
|
|
22
22
|
* readers: { members: ["*"], tools: ["github.read_*", "github.get_*"] }
|
|
23
23
|
* cedar: { policies: ./adtl.cedar } # optional: attribute-based rules (see cedar.ts)
|
|
24
|
+
* openfga: { url: http://localhost:8080, storeId: "${FGA_STORE_ID}" } # optional: relationship rules (see openfga.ts)
|
|
24
25
|
* approvals: # optional: make "ask" really ask
|
|
25
26
|
* timeoutSeconds: 50
|
|
26
27
|
* ntfy: { topic: "${ADTL_NTFY_TOPIC}" }
|
|
@@ -31,1009 +32,272 @@
|
|
|
31
32
|
* from: adtl@example.com
|
|
32
33
|
* to: you@example.com
|
|
33
34
|
*
|
|
34
|
-
* `${VAR}` in command, args, env, cwd, url, headers, approval settings and principal.id is
|
|
35
|
+
* `${VAR}` in command, args, env, cwd, url, headers, approval settings, openfga settings and principal.id is
|
|
35
36
|
* replaced from the gateway's environment. A missing variable is a config error,
|
|
36
37
|
* unless a default is given: `${VAR:-default}`.
|
|
37
38
|
*/
|
|
38
39
|
import { z } from "zod";
|
|
39
40
|
export declare const StdioUpstreamSchema: z.ZodObject<{
|
|
40
41
|
command: z.ZodString;
|
|
41
|
-
args: z.ZodDefault<z.ZodArray<z.ZodString
|
|
42
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
42
43
|
env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
43
44
|
cwd: z.ZodOptional<z.ZodString>;
|
|
44
|
-
},
|
|
45
|
-
command: string;
|
|
46
|
-
args: string[];
|
|
47
|
-
env: Record<string, string>;
|
|
48
|
-
cwd?: string | undefined;
|
|
49
|
-
}, {
|
|
50
|
-
command: string;
|
|
51
|
-
args?: string[] | undefined;
|
|
52
|
-
env?: Record<string, string> | undefined;
|
|
53
|
-
cwd?: string | undefined;
|
|
54
|
-
}>;
|
|
45
|
+
}, z.core.$strict>;
|
|
55
46
|
export declare const HttpUpstreamSchema: z.ZodObject<{
|
|
56
47
|
url: z.ZodString;
|
|
57
48
|
headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
headers: Record<string, string>;
|
|
61
|
-
}, {
|
|
62
|
-
url: string;
|
|
63
|
-
headers?: Record<string, string> | undefined;
|
|
64
|
-
}>;
|
|
65
|
-
export declare const UpstreamSchema: z.ZodUnion<[z.ZodObject<{
|
|
49
|
+
}, z.core.$strict>;
|
|
50
|
+
export declare const UpstreamSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
66
51
|
command: z.ZodString;
|
|
67
|
-
args: z.ZodDefault<z.ZodArray<z.ZodString
|
|
52
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
68
53
|
env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
69
54
|
cwd: z.ZodOptional<z.ZodString>;
|
|
70
|
-
},
|
|
71
|
-
command: string;
|
|
72
|
-
args: string[];
|
|
73
|
-
env: Record<string, string>;
|
|
74
|
-
cwd?: string | undefined;
|
|
75
|
-
}, {
|
|
76
|
-
command: string;
|
|
77
|
-
args?: string[] | undefined;
|
|
78
|
-
env?: Record<string, string> | undefined;
|
|
79
|
-
cwd?: string | undefined;
|
|
80
|
-
}>, z.ZodObject<{
|
|
55
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
81
56
|
url: z.ZodString;
|
|
82
57
|
headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
83
|
-
},
|
|
84
|
-
url: string;
|
|
85
|
-
headers: Record<string, string>;
|
|
86
|
-
}, {
|
|
87
|
-
url: string;
|
|
88
|
-
headers?: Record<string, string> | undefined;
|
|
89
|
-
}>]>;
|
|
58
|
+
}, z.core.$strict>]>;
|
|
90
59
|
export type StdioUpstream = z.infer<typeof StdioUpstreamSchema>;
|
|
91
60
|
export type HttpUpstream = z.infer<typeof HttpUpstreamSchema>;
|
|
92
61
|
export type Upstream = z.infer<typeof UpstreamSchema>;
|
|
93
62
|
export declare const NtfyConfigSchema: z.ZodObject<{
|
|
94
63
|
server: z.ZodDefault<z.ZodString>;
|
|
95
|
-
/** Topic approval requests are sent to. Anyone who can read it can approve: keep it secret. */
|
|
96
64
|
topic: z.ZodString;
|
|
97
|
-
/** Topic answers are posted to. Default: `<topic>-reply`. */
|
|
98
65
|
replyTopic: z.ZodOptional<z.ZodString>;
|
|
99
66
|
token: z.ZodOptional<z.ZodString>;
|
|
100
|
-
},
|
|
101
|
-
server: string;
|
|
102
|
-
topic: string;
|
|
103
|
-
replyTopic?: string | undefined;
|
|
104
|
-
token?: string | undefined;
|
|
105
|
-
}, {
|
|
106
|
-
topic: string;
|
|
107
|
-
server?: string | undefined;
|
|
108
|
-
replyTopic?: string | undefined;
|
|
109
|
-
token?: string | undefined;
|
|
110
|
-
}>;
|
|
67
|
+
}, z.core.$strict>;
|
|
111
68
|
export declare const EmailConfigSchema: z.ZodObject<{
|
|
112
69
|
smtp: z.ZodObject<{
|
|
113
70
|
host: z.ZodString;
|
|
114
71
|
port: z.ZodDefault<z.ZodNumber>;
|
|
115
|
-
/** TLS from the start. Default: true on port 465, otherwise STARTTLS. */
|
|
116
72
|
secure: z.ZodOptional<z.ZodBoolean>;
|
|
117
73
|
user: z.ZodOptional<z.ZodString>;
|
|
118
74
|
pass: z.ZodOptional<z.ZodString>;
|
|
119
|
-
},
|
|
120
|
-
host: string;
|
|
121
|
-
port: number;
|
|
122
|
-
user?: string | undefined;
|
|
123
|
-
secure?: boolean | undefined;
|
|
124
|
-
pass?: string | undefined;
|
|
125
|
-
}, {
|
|
126
|
-
host: string;
|
|
127
|
-
user?: string | undefined;
|
|
128
|
-
port?: number | undefined;
|
|
129
|
-
secure?: boolean | undefined;
|
|
130
|
-
pass?: string | undefined;
|
|
131
|
-
}>;
|
|
75
|
+
}, z.core.$strict>;
|
|
132
76
|
from: z.ZodString;
|
|
133
|
-
to: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString
|
|
134
|
-
on: z.ZodDefault<z.ZodArray<z.ZodEnum<
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
};
|
|
144
|
-
from: string;
|
|
145
|
-
to: string | [string, ...string[]];
|
|
146
|
-
}, {
|
|
147
|
-
smtp: {
|
|
148
|
-
host: string;
|
|
149
|
-
user?: string | undefined;
|
|
150
|
-
port?: number | undefined;
|
|
151
|
-
secure?: boolean | undefined;
|
|
152
|
-
pass?: string | undefined;
|
|
153
|
-
};
|
|
154
|
-
from: string;
|
|
155
|
-
to: string | [string, ...string[]];
|
|
156
|
-
on?: ["approved" | "denied" | "timeout" | "undeliverable" | "pending" | "blocked", ...("approved" | "denied" | "timeout" | "undeliverable" | "pending" | "blocked")[]] | undefined;
|
|
157
|
-
}>;
|
|
77
|
+
to: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
78
|
+
on: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
79
|
+
approved: "approved";
|
|
80
|
+
denied: "denied";
|
|
81
|
+
timeout: "timeout";
|
|
82
|
+
undeliverable: "undeliverable";
|
|
83
|
+
pending: "pending";
|
|
84
|
+
blocked: "blocked";
|
|
85
|
+
}>>>;
|
|
86
|
+
}, z.core.$strict>;
|
|
158
87
|
export declare const ApprovalsConfigSchema: z.ZodObject<{
|
|
159
|
-
/**
|
|
160
|
-
* How long a call waits for an answer; no answer means deny. Many MCP
|
|
161
|
-
* clients give up on a request after 60 seconds, hence the default.
|
|
162
|
-
*/
|
|
163
88
|
timeoutSeconds: z.ZodDefault<z.ZodNumber>;
|
|
164
89
|
ntfy: z.ZodOptional<z.ZodObject<{
|
|
165
90
|
server: z.ZodDefault<z.ZodString>;
|
|
166
|
-
/** Topic approval requests are sent to. Anyone who can read it can approve: keep it secret. */
|
|
167
91
|
topic: z.ZodString;
|
|
168
|
-
/** Topic answers are posted to. Default: `<topic>-reply`. */
|
|
169
92
|
replyTopic: z.ZodOptional<z.ZodString>;
|
|
170
93
|
token: z.ZodOptional<z.ZodString>;
|
|
171
|
-
},
|
|
172
|
-
server: string;
|
|
173
|
-
topic: string;
|
|
174
|
-
replyTopic?: string | undefined;
|
|
175
|
-
token?: string | undefined;
|
|
176
|
-
}, {
|
|
177
|
-
topic: string;
|
|
178
|
-
server?: string | undefined;
|
|
179
|
-
replyTopic?: string | undefined;
|
|
180
|
-
token?: string | undefined;
|
|
181
|
-
}>>;
|
|
94
|
+
}, z.core.$strict>>;
|
|
182
95
|
email: z.ZodOptional<z.ZodObject<{
|
|
183
96
|
smtp: z.ZodObject<{
|
|
184
97
|
host: z.ZodString;
|
|
185
98
|
port: z.ZodDefault<z.ZodNumber>;
|
|
186
|
-
/** TLS from the start. Default: true on port 465, otherwise STARTTLS. */
|
|
187
99
|
secure: z.ZodOptional<z.ZodBoolean>;
|
|
188
100
|
user: z.ZodOptional<z.ZodString>;
|
|
189
101
|
pass: z.ZodOptional<z.ZodString>;
|
|
190
|
-
},
|
|
191
|
-
host: string;
|
|
192
|
-
port: number;
|
|
193
|
-
user?: string | undefined;
|
|
194
|
-
secure?: boolean | undefined;
|
|
195
|
-
pass?: string | undefined;
|
|
196
|
-
}, {
|
|
197
|
-
host: string;
|
|
198
|
-
user?: string | undefined;
|
|
199
|
-
port?: number | undefined;
|
|
200
|
-
secure?: boolean | undefined;
|
|
201
|
-
pass?: string | undefined;
|
|
202
|
-
}>;
|
|
102
|
+
}, z.core.$strict>;
|
|
203
103
|
from: z.ZodString;
|
|
204
|
-
to: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString
|
|
205
|
-
on: z.ZodDefault<z.ZodArray<z.ZodEnum<
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
};
|
|
215
|
-
from: string;
|
|
216
|
-
to: string | [string, ...string[]];
|
|
217
|
-
}, {
|
|
218
|
-
smtp: {
|
|
219
|
-
host: string;
|
|
220
|
-
user?: string | undefined;
|
|
221
|
-
port?: number | undefined;
|
|
222
|
-
secure?: boolean | undefined;
|
|
223
|
-
pass?: string | undefined;
|
|
224
|
-
};
|
|
225
|
-
from: string;
|
|
226
|
-
to: string | [string, ...string[]];
|
|
227
|
-
on?: ["approved" | "denied" | "timeout" | "undeliverable" | "pending" | "blocked", ...("approved" | "denied" | "timeout" | "undeliverable" | "pending" | "blocked")[]] | undefined;
|
|
228
|
-
}>>;
|
|
229
|
-
/**
|
|
230
|
-
* Also ask in the MCP client (elicitation), when it supports it. Off by
|
|
231
|
-
* default: a client that accepts elicitations by itself would approve calls.
|
|
232
|
-
*/
|
|
104
|
+
to: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
105
|
+
on: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
106
|
+
approved: "approved";
|
|
107
|
+
denied: "denied";
|
|
108
|
+
timeout: "timeout";
|
|
109
|
+
undeliverable: "undeliverable";
|
|
110
|
+
pending: "pending";
|
|
111
|
+
blocked: "blocked";
|
|
112
|
+
}>>>;
|
|
113
|
+
}, z.core.$strict>>;
|
|
233
114
|
elicitation: z.ZodDefault<z.ZodBoolean>;
|
|
234
|
-
|
|
235
|
-
* Each approver's own channel, by principal id. Policy rules with
|
|
236
|
-
* `approvers: [role]` ask only these people, so the answer names who approved.
|
|
237
|
-
*/
|
|
115
|
+
totp: z.ZodDefault<z.ZodBoolean>;
|
|
238
116
|
approvers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
239
117
|
ntfy: z.ZodObject<{
|
|
240
118
|
server: z.ZodDefault<z.ZodString>;
|
|
241
|
-
/** Topic approval requests are sent to. Anyone who can read it can approve: keep it secret. */
|
|
242
119
|
topic: z.ZodString;
|
|
243
|
-
/** Topic answers are posted to. Default: `<topic>-reply`. */
|
|
244
120
|
replyTopic: z.ZodOptional<z.ZodString>;
|
|
245
121
|
token: z.ZodOptional<z.ZodString>;
|
|
246
|
-
},
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
replyTopic?: string | undefined;
|
|
250
|
-
token?: string | undefined;
|
|
251
|
-
}, {
|
|
252
|
-
topic: string;
|
|
253
|
-
server?: string | undefined;
|
|
254
|
-
replyTopic?: string | undefined;
|
|
255
|
-
token?: string | undefined;
|
|
256
|
-
}>;
|
|
257
|
-
}, "strict", z.ZodTypeAny, {
|
|
258
|
-
ntfy: {
|
|
259
|
-
server: string;
|
|
260
|
-
topic: string;
|
|
261
|
-
replyTopic?: string | undefined;
|
|
262
|
-
token?: string | undefined;
|
|
263
|
-
};
|
|
264
|
-
}, {
|
|
265
|
-
ntfy: {
|
|
266
|
-
topic: string;
|
|
267
|
-
server?: string | undefined;
|
|
268
|
-
replyTopic?: string | undefined;
|
|
269
|
-
token?: string | undefined;
|
|
270
|
-
};
|
|
271
|
-
}>>>;
|
|
272
|
-
}, "strict", z.ZodTypeAny, {
|
|
273
|
-
timeoutSeconds: number;
|
|
274
|
-
elicitation: boolean;
|
|
275
|
-
approvers?: Record<string, {
|
|
276
|
-
ntfy: {
|
|
277
|
-
server: string;
|
|
278
|
-
topic: string;
|
|
279
|
-
replyTopic?: string | undefined;
|
|
280
|
-
token?: string | undefined;
|
|
281
|
-
};
|
|
282
|
-
}> | undefined;
|
|
283
|
-
email?: {
|
|
284
|
-
on: ["approved" | "denied" | "timeout" | "undeliverable" | "pending" | "blocked", ...("approved" | "denied" | "timeout" | "undeliverable" | "pending" | "blocked")[]];
|
|
285
|
-
smtp: {
|
|
286
|
-
host: string;
|
|
287
|
-
port: number;
|
|
288
|
-
user?: string | undefined;
|
|
289
|
-
secure?: boolean | undefined;
|
|
290
|
-
pass?: string | undefined;
|
|
291
|
-
};
|
|
292
|
-
from: string;
|
|
293
|
-
to: string | [string, ...string[]];
|
|
294
|
-
} | undefined;
|
|
295
|
-
ntfy?: {
|
|
296
|
-
server: string;
|
|
297
|
-
topic: string;
|
|
298
|
-
replyTopic?: string | undefined;
|
|
299
|
-
token?: string | undefined;
|
|
300
|
-
} | undefined;
|
|
301
|
-
}, {
|
|
302
|
-
approvers?: Record<string, {
|
|
303
|
-
ntfy: {
|
|
304
|
-
topic: string;
|
|
305
|
-
server?: string | undefined;
|
|
306
|
-
replyTopic?: string | undefined;
|
|
307
|
-
token?: string | undefined;
|
|
308
|
-
};
|
|
309
|
-
}> | undefined;
|
|
310
|
-
email?: {
|
|
311
|
-
smtp: {
|
|
312
|
-
host: string;
|
|
313
|
-
user?: string | undefined;
|
|
314
|
-
port?: number | undefined;
|
|
315
|
-
secure?: boolean | undefined;
|
|
316
|
-
pass?: string | undefined;
|
|
317
|
-
};
|
|
318
|
-
from: string;
|
|
319
|
-
to: string | [string, ...string[]];
|
|
320
|
-
on?: ["approved" | "denied" | "timeout" | "undeliverable" | "pending" | "blocked", ...("approved" | "denied" | "timeout" | "undeliverable" | "pending" | "blocked")[]] | undefined;
|
|
321
|
-
} | undefined;
|
|
322
|
-
timeoutSeconds?: number | undefined;
|
|
323
|
-
ntfy?: {
|
|
324
|
-
topic: string;
|
|
325
|
-
server?: string | undefined;
|
|
326
|
-
replyTopic?: string | undefined;
|
|
327
|
-
token?: string | undefined;
|
|
328
|
-
} | undefined;
|
|
329
|
-
elicitation?: boolean | undefined;
|
|
330
|
-
}>;
|
|
122
|
+
}, z.core.$strict>;
|
|
123
|
+
}, z.core.$strict>>>;
|
|
124
|
+
}, z.core.$strict>;
|
|
331
125
|
export type ApprovalsConfig = z.infer<typeof ApprovalsConfigSchema>;
|
|
332
126
|
export declare const PrincipalConfigSchema: z.ZodObject<{
|
|
333
|
-
type: z.ZodDefault<z.ZodEnum<
|
|
127
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
128
|
+
user: "user";
|
|
129
|
+
service: "service";
|
|
130
|
+
}>>;
|
|
334
131
|
id: z.ZodString;
|
|
335
132
|
claims: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
336
|
-
},
|
|
337
|
-
id: string;
|
|
338
|
-
type: "user" | "service";
|
|
339
|
-
claims?: Record<string, unknown> | undefined;
|
|
340
|
-
}, {
|
|
341
|
-
id: string;
|
|
342
|
-
type?: "user" | "service" | undefined;
|
|
343
|
-
claims?: Record<string, unknown> | undefined;
|
|
344
|
-
}>;
|
|
133
|
+
}, z.core.$strict>;
|
|
345
134
|
export type PrincipalConfig = z.infer<typeof PrincipalConfigSchema>;
|
|
346
|
-
export declare const RoleSchema: z.
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
resources: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
353
|
-
}, "strict", z.ZodTypeAny, {
|
|
354
|
-
members: [string, ...string[]];
|
|
355
|
-
tools: string[];
|
|
356
|
-
prompts: string[];
|
|
357
|
-
resources: string[];
|
|
358
|
-
}, {
|
|
359
|
-
members: [string, ...string[]];
|
|
360
|
-
tools?: string[] | undefined;
|
|
361
|
-
prompts?: string[] | undefined;
|
|
362
|
-
resources?: string[] | undefined;
|
|
363
|
-
}>, {
|
|
364
|
-
members: [string, ...string[]];
|
|
365
|
-
tools: string[];
|
|
366
|
-
prompts: string[];
|
|
367
|
-
resources: string[];
|
|
368
|
-
}, {
|
|
369
|
-
members: [string, ...string[]];
|
|
370
|
-
tools?: string[] | undefined;
|
|
371
|
-
prompts?: string[] | undefined;
|
|
372
|
-
resources?: string[] | undefined;
|
|
373
|
-
}>;
|
|
135
|
+
export declare const RoleSchema: z.ZodObject<{
|
|
136
|
+
members: z.ZodArray<z.ZodString>;
|
|
137
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
138
|
+
prompts: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
139
|
+
resources: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
140
|
+
}, z.core.$strict>;
|
|
374
141
|
export type RoleConfig = z.infer<typeof RoleSchema>;
|
|
375
142
|
export declare const CedarConfigSchema: z.ZodObject<{
|
|
376
|
-
/** Cedar policy file. Relative paths are resolved against the config file's directory. */
|
|
377
143
|
policies: z.ZodString;
|
|
378
|
-
/** Optional Cedar entities JSON file: groups (`parents`) and attributes. */
|
|
379
144
|
entities: z.ZodOptional<z.ZodString>;
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
}, "strict", z.ZodTypeAny, {
|
|
383
|
-
policies: string;
|
|
384
|
-
entities?: string | undefined;
|
|
385
|
-
timeZone?: string | undefined;
|
|
386
|
-
}, {
|
|
387
|
-
policies: string;
|
|
388
|
-
entities?: string | undefined;
|
|
389
|
-
timeZone?: string | undefined;
|
|
390
|
-
}>;
|
|
145
|
+
timeZone: z.ZodOptional<z.ZodString>;
|
|
146
|
+
}, z.core.$strict>;
|
|
391
147
|
export type CedarConfig = z.infer<typeof CedarConfigSchema>;
|
|
148
|
+
export declare const OpenFgaConfigSchema: z.ZodObject<{
|
|
149
|
+
url: z.ZodString;
|
|
150
|
+
storeId: z.ZodString;
|
|
151
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
152
|
+
token: z.ZodOptional<z.ZodString>;
|
|
153
|
+
relation: z.ZodDefault<z.ZodString>;
|
|
154
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
155
|
+
tools: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
156
|
+
relation: z.ZodOptional<z.ZodString>;
|
|
157
|
+
object: z.ZodOptional<z.ZodString>;
|
|
158
|
+
}, z.core.$strict>>>;
|
|
159
|
+
}, z.core.$strict>;
|
|
160
|
+
export type OpenFgaConfig = z.infer<typeof OpenFgaConfigSchema>;
|
|
392
161
|
/** SEP-2624 InterceptorOverrides, set by the gateway owner for one interceptor. */
|
|
393
162
|
export declare const InterceptorOverridesSchema: z.ZodObject<{
|
|
394
163
|
failOpen: z.ZodOptional<z.ZodBoolean>;
|
|
395
|
-
priorityHint: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodObject<{
|
|
164
|
+
priorityHint: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
396
165
|
request: z.ZodOptional<z.ZodNumber>;
|
|
397
166
|
response: z.ZodOptional<z.ZodNumber>;
|
|
398
|
-
},
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
response?: number | undefined;
|
|
404
|
-
}>]>>;
|
|
405
|
-
mode: z.ZodOptional<z.ZodEnum<["active", "audit"]>>;
|
|
167
|
+
}, z.core.$strict>]>>;
|
|
168
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
169
|
+
active: "active";
|
|
170
|
+
audit: "audit";
|
|
171
|
+
}>>;
|
|
406
172
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
407
173
|
hooks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
408
|
-
events: z.ZodArray<z.ZodString
|
|
409
|
-
phase: z.ZodEnum<
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
},
|
|
414
|
-
|
|
415
|
-
phase: "request" | "response";
|
|
416
|
-
}>, "many">>;
|
|
417
|
-
}, "strict", z.ZodTypeAny, {
|
|
418
|
-
mode?: "active" | "audit" | undefined;
|
|
419
|
-
priorityHint?: number | {
|
|
420
|
-
request?: number | undefined;
|
|
421
|
-
response?: number | undefined;
|
|
422
|
-
} | undefined;
|
|
423
|
-
failOpen?: boolean | undefined;
|
|
424
|
-
timeoutMs?: number | undefined;
|
|
425
|
-
hooks?: {
|
|
426
|
-
events: string[];
|
|
427
|
-
phase: "request" | "response";
|
|
428
|
-
}[] | undefined;
|
|
429
|
-
}, {
|
|
430
|
-
mode?: "active" | "audit" | undefined;
|
|
431
|
-
priorityHint?: number | {
|
|
432
|
-
request?: number | undefined;
|
|
433
|
-
response?: number | undefined;
|
|
434
|
-
} | undefined;
|
|
435
|
-
failOpen?: boolean | undefined;
|
|
436
|
-
timeoutMs?: number | undefined;
|
|
437
|
-
hooks?: {
|
|
438
|
-
events: string[];
|
|
439
|
-
phase: "request" | "response";
|
|
440
|
-
}[] | undefined;
|
|
441
|
-
}>;
|
|
174
|
+
events: z.ZodArray<z.ZodString>;
|
|
175
|
+
phase: z.ZodEnum<{
|
|
176
|
+
request: "request";
|
|
177
|
+
response: "response";
|
|
178
|
+
}>;
|
|
179
|
+
}, z.core.$strict>>>;
|
|
180
|
+
}, z.core.$strict>;
|
|
442
181
|
export declare const GatewayConfigSchema: z.ZodObject<{
|
|
443
|
-
upstreams: z.
|
|
182
|
+
upstreams: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
444
183
|
command: z.ZodString;
|
|
445
|
-
args: z.ZodDefault<z.ZodArray<z.ZodString
|
|
184
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
446
185
|
env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
447
186
|
cwd: z.ZodOptional<z.ZodString>;
|
|
448
|
-
},
|
|
449
|
-
command: string;
|
|
450
|
-
args: string[];
|
|
451
|
-
env: Record<string, string>;
|
|
452
|
-
cwd?: string | undefined;
|
|
453
|
-
}, {
|
|
454
|
-
command: string;
|
|
455
|
-
args?: string[] | undefined;
|
|
456
|
-
env?: Record<string, string> | undefined;
|
|
457
|
-
cwd?: string | undefined;
|
|
458
|
-
}>, z.ZodObject<{
|
|
187
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
459
188
|
url: z.ZodString;
|
|
460
189
|
headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
461
|
-
},
|
|
462
|
-
url: string;
|
|
463
|
-
headers: Record<string, string>;
|
|
464
|
-
}, {
|
|
465
|
-
url: string;
|
|
466
|
-
headers?: Record<string, string> | undefined;
|
|
467
|
-
}>]>>, Record<string, {
|
|
468
|
-
command: string;
|
|
469
|
-
args: string[];
|
|
470
|
-
env: Record<string, string>;
|
|
471
|
-
cwd?: string | undefined;
|
|
472
|
-
} | {
|
|
473
|
-
url: string;
|
|
474
|
-
headers: Record<string, string>;
|
|
475
|
-
}>, Record<string, {
|
|
476
|
-
command: string;
|
|
477
|
-
args?: string[] | undefined;
|
|
478
|
-
env?: Record<string, string> | undefined;
|
|
479
|
-
cwd?: string | undefined;
|
|
480
|
-
} | {
|
|
481
|
-
url: string;
|
|
482
|
-
headers?: Record<string, string> | undefined;
|
|
483
|
-
}>>, Record<string, {
|
|
484
|
-
command: string;
|
|
485
|
-
args: string[];
|
|
486
|
-
env: Record<string, string>;
|
|
487
|
-
cwd?: string | undefined;
|
|
488
|
-
} | {
|
|
489
|
-
url: string;
|
|
490
|
-
headers: Record<string, string>;
|
|
491
|
-
}>, Record<string, {
|
|
492
|
-
command: string;
|
|
493
|
-
args?: string[] | undefined;
|
|
494
|
-
env?: Record<string, string> | undefined;
|
|
495
|
-
cwd?: string | undefined;
|
|
496
|
-
} | {
|
|
497
|
-
url: string;
|
|
498
|
-
headers?: Record<string, string> | undefined;
|
|
499
|
-
}>>;
|
|
500
|
-
/** How to start the interceptor server. Default: the bundled adtl-interceptors with this same config file. */
|
|
190
|
+
}, z.core.$strict>]>>;
|
|
501
191
|
interceptors: z.ZodOptional<z.ZodObject<{
|
|
502
192
|
command: z.ZodString;
|
|
503
|
-
args: z.ZodDefault<z.ZodArray<z.ZodString
|
|
193
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
504
194
|
env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
505
195
|
cwd: z.ZodOptional<z.ZodString>;
|
|
506
|
-
},
|
|
507
|
-
|
|
508
|
-
args: string[];
|
|
509
|
-
env: Record<string, string>;
|
|
510
|
-
cwd?: string | undefined;
|
|
511
|
-
}, {
|
|
512
|
-
command: string;
|
|
513
|
-
args?: string[] | undefined;
|
|
514
|
-
env?: Record<string, string> | undefined;
|
|
515
|
-
cwd?: string | undefined;
|
|
516
|
-
}>>;
|
|
517
|
-
/** More interceptor servers (stdio or Streamable HTTP) whose interceptors run beside ADTL's. */
|
|
518
|
-
interceptorServers: z.ZodDefault<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
196
|
+
}, z.core.$strict>>;
|
|
197
|
+
interceptorServers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
519
198
|
command: z.ZodString;
|
|
520
|
-
args: z.ZodDefault<z.ZodArray<z.ZodString
|
|
199
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
521
200
|
env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
522
201
|
cwd: z.ZodOptional<z.ZodString>;
|
|
523
|
-
},
|
|
524
|
-
command: string;
|
|
525
|
-
args: string[];
|
|
526
|
-
env: Record<string, string>;
|
|
527
|
-
cwd?: string | undefined;
|
|
528
|
-
}, {
|
|
529
|
-
command: string;
|
|
530
|
-
args?: string[] | undefined;
|
|
531
|
-
env?: Record<string, string> | undefined;
|
|
532
|
-
cwd?: string | undefined;
|
|
533
|
-
}>, z.ZodObject<{
|
|
202
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
534
203
|
url: z.ZodString;
|
|
535
204
|
headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
536
|
-
},
|
|
537
|
-
url: string;
|
|
538
|
-
headers: Record<string, string>;
|
|
539
|
-
}, {
|
|
540
|
-
url: string;
|
|
541
|
-
headers?: Record<string, string> | undefined;
|
|
542
|
-
}>]>>, Record<string, {
|
|
543
|
-
command: string;
|
|
544
|
-
args: string[];
|
|
545
|
-
env: Record<string, string>;
|
|
546
|
-
cwd?: string | undefined;
|
|
547
|
-
} | {
|
|
548
|
-
url: string;
|
|
549
|
-
headers: Record<string, string>;
|
|
550
|
-
}>, Record<string, {
|
|
551
|
-
command: string;
|
|
552
|
-
args?: string[] | undefined;
|
|
553
|
-
env?: Record<string, string> | undefined;
|
|
554
|
-
cwd?: string | undefined;
|
|
555
|
-
} | {
|
|
556
|
-
url: string;
|
|
557
|
-
headers?: Record<string, string> | undefined;
|
|
558
|
-
}>>>;
|
|
559
|
-
/** Path of a JSONL audit log. Relative paths are resolved against the config file's directory. */
|
|
205
|
+
}, z.core.$strict>]>>>;
|
|
560
206
|
audit: z.ZodOptional<z.ZodString>;
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
mode: z.ZodDefault<z.ZodEnum<["active", "audit"]>>;
|
|
566
|
-
/** Human approvals for "ask" decisions. Without an answering channel, "ask" blocks. */
|
|
207
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
208
|
+
active: "active";
|
|
209
|
+
audit: "audit";
|
|
210
|
+
}>>;
|
|
567
211
|
approvals: z.ZodOptional<z.ZodObject<{
|
|
568
|
-
/**
|
|
569
|
-
* How long a call waits for an answer; no answer means deny. Many MCP
|
|
570
|
-
* clients give up on a request after 60 seconds, hence the default.
|
|
571
|
-
*/
|
|
572
212
|
timeoutSeconds: z.ZodDefault<z.ZodNumber>;
|
|
573
213
|
ntfy: z.ZodOptional<z.ZodObject<{
|
|
574
214
|
server: z.ZodDefault<z.ZodString>;
|
|
575
|
-
/** Topic approval requests are sent to. Anyone who can read it can approve: keep it secret. */
|
|
576
215
|
topic: z.ZodString;
|
|
577
|
-
/** Topic answers are posted to. Default: `<topic>-reply`. */
|
|
578
216
|
replyTopic: z.ZodOptional<z.ZodString>;
|
|
579
217
|
token: z.ZodOptional<z.ZodString>;
|
|
580
|
-
},
|
|
581
|
-
server: string;
|
|
582
|
-
topic: string;
|
|
583
|
-
replyTopic?: string | undefined;
|
|
584
|
-
token?: string | undefined;
|
|
585
|
-
}, {
|
|
586
|
-
topic: string;
|
|
587
|
-
server?: string | undefined;
|
|
588
|
-
replyTopic?: string | undefined;
|
|
589
|
-
token?: string | undefined;
|
|
590
|
-
}>>;
|
|
218
|
+
}, z.core.$strict>>;
|
|
591
219
|
email: z.ZodOptional<z.ZodObject<{
|
|
592
220
|
smtp: z.ZodObject<{
|
|
593
221
|
host: z.ZodString;
|
|
594
222
|
port: z.ZodDefault<z.ZodNumber>;
|
|
595
|
-
/** TLS from the start. Default: true on port 465, otherwise STARTTLS. */
|
|
596
223
|
secure: z.ZodOptional<z.ZodBoolean>;
|
|
597
224
|
user: z.ZodOptional<z.ZodString>;
|
|
598
225
|
pass: z.ZodOptional<z.ZodString>;
|
|
599
|
-
},
|
|
600
|
-
host: string;
|
|
601
|
-
port: number;
|
|
602
|
-
user?: string | undefined;
|
|
603
|
-
secure?: boolean | undefined;
|
|
604
|
-
pass?: string | undefined;
|
|
605
|
-
}, {
|
|
606
|
-
host: string;
|
|
607
|
-
user?: string | undefined;
|
|
608
|
-
port?: number | undefined;
|
|
609
|
-
secure?: boolean | undefined;
|
|
610
|
-
pass?: string | undefined;
|
|
611
|
-
}>;
|
|
226
|
+
}, z.core.$strict>;
|
|
612
227
|
from: z.ZodString;
|
|
613
|
-
to: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString
|
|
614
|
-
on: z.ZodDefault<z.ZodArray<z.ZodEnum<
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
};
|
|
624
|
-
from: string;
|
|
625
|
-
to: string | [string, ...string[]];
|
|
626
|
-
}, {
|
|
627
|
-
smtp: {
|
|
628
|
-
host: string;
|
|
629
|
-
user?: string | undefined;
|
|
630
|
-
port?: number | undefined;
|
|
631
|
-
secure?: boolean | undefined;
|
|
632
|
-
pass?: string | undefined;
|
|
633
|
-
};
|
|
634
|
-
from: string;
|
|
635
|
-
to: string | [string, ...string[]];
|
|
636
|
-
on?: ["approved" | "denied" | "timeout" | "undeliverable" | "pending" | "blocked", ...("approved" | "denied" | "timeout" | "undeliverable" | "pending" | "blocked")[]] | undefined;
|
|
637
|
-
}>>;
|
|
638
|
-
/**
|
|
639
|
-
* Also ask in the MCP client (elicitation), when it supports it. Off by
|
|
640
|
-
* default: a client that accepts elicitations by itself would approve calls.
|
|
641
|
-
*/
|
|
228
|
+
to: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
229
|
+
on: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
230
|
+
approved: "approved";
|
|
231
|
+
denied: "denied";
|
|
232
|
+
timeout: "timeout";
|
|
233
|
+
undeliverable: "undeliverable";
|
|
234
|
+
pending: "pending";
|
|
235
|
+
blocked: "blocked";
|
|
236
|
+
}>>>;
|
|
237
|
+
}, z.core.$strict>>;
|
|
642
238
|
elicitation: z.ZodDefault<z.ZodBoolean>;
|
|
643
|
-
|
|
644
|
-
* Each approver's own channel, by principal id. Policy rules with
|
|
645
|
-
* `approvers: [role]` ask only these people, so the answer names who approved.
|
|
646
|
-
*/
|
|
239
|
+
totp: z.ZodDefault<z.ZodBoolean>;
|
|
647
240
|
approvers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
648
241
|
ntfy: z.ZodObject<{
|
|
649
242
|
server: z.ZodDefault<z.ZodString>;
|
|
650
|
-
/** Topic approval requests are sent to. Anyone who can read it can approve: keep it secret. */
|
|
651
243
|
topic: z.ZodString;
|
|
652
|
-
/** Topic answers are posted to. Default: `<topic>-reply`. */
|
|
653
244
|
replyTopic: z.ZodOptional<z.ZodString>;
|
|
654
245
|
token: z.ZodOptional<z.ZodString>;
|
|
655
|
-
},
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
replyTopic?: string | undefined;
|
|
659
|
-
token?: string | undefined;
|
|
660
|
-
}, {
|
|
661
|
-
topic: string;
|
|
662
|
-
server?: string | undefined;
|
|
663
|
-
replyTopic?: string | undefined;
|
|
664
|
-
token?: string | undefined;
|
|
665
|
-
}>;
|
|
666
|
-
}, "strict", z.ZodTypeAny, {
|
|
667
|
-
ntfy: {
|
|
668
|
-
server: string;
|
|
669
|
-
topic: string;
|
|
670
|
-
replyTopic?: string | undefined;
|
|
671
|
-
token?: string | undefined;
|
|
672
|
-
};
|
|
673
|
-
}, {
|
|
674
|
-
ntfy: {
|
|
675
|
-
topic: string;
|
|
676
|
-
server?: string | undefined;
|
|
677
|
-
replyTopic?: string | undefined;
|
|
678
|
-
token?: string | undefined;
|
|
679
|
-
};
|
|
680
|
-
}>>>;
|
|
681
|
-
}, "strict", z.ZodTypeAny, {
|
|
682
|
-
timeoutSeconds: number;
|
|
683
|
-
elicitation: boolean;
|
|
684
|
-
approvers?: Record<string, {
|
|
685
|
-
ntfy: {
|
|
686
|
-
server: string;
|
|
687
|
-
topic: string;
|
|
688
|
-
replyTopic?: string | undefined;
|
|
689
|
-
token?: string | undefined;
|
|
690
|
-
};
|
|
691
|
-
}> | undefined;
|
|
692
|
-
email?: {
|
|
693
|
-
on: ["approved" | "denied" | "timeout" | "undeliverable" | "pending" | "blocked", ...("approved" | "denied" | "timeout" | "undeliverable" | "pending" | "blocked")[]];
|
|
694
|
-
smtp: {
|
|
695
|
-
host: string;
|
|
696
|
-
port: number;
|
|
697
|
-
user?: string | undefined;
|
|
698
|
-
secure?: boolean | undefined;
|
|
699
|
-
pass?: string | undefined;
|
|
700
|
-
};
|
|
701
|
-
from: string;
|
|
702
|
-
to: string | [string, ...string[]];
|
|
703
|
-
} | undefined;
|
|
704
|
-
ntfy?: {
|
|
705
|
-
server: string;
|
|
706
|
-
topic: string;
|
|
707
|
-
replyTopic?: string | undefined;
|
|
708
|
-
token?: string | undefined;
|
|
709
|
-
} | undefined;
|
|
710
|
-
}, {
|
|
711
|
-
approvers?: Record<string, {
|
|
712
|
-
ntfy: {
|
|
713
|
-
topic: string;
|
|
714
|
-
server?: string | undefined;
|
|
715
|
-
replyTopic?: string | undefined;
|
|
716
|
-
token?: string | undefined;
|
|
717
|
-
};
|
|
718
|
-
}> | undefined;
|
|
719
|
-
email?: {
|
|
720
|
-
smtp: {
|
|
721
|
-
host: string;
|
|
722
|
-
user?: string | undefined;
|
|
723
|
-
port?: number | undefined;
|
|
724
|
-
secure?: boolean | undefined;
|
|
725
|
-
pass?: string | undefined;
|
|
726
|
-
};
|
|
727
|
-
from: string;
|
|
728
|
-
to: string | [string, ...string[]];
|
|
729
|
-
on?: ["approved" | "denied" | "timeout" | "undeliverable" | "pending" | "blocked", ...("approved" | "denied" | "timeout" | "undeliverable" | "pending" | "blocked")[]] | undefined;
|
|
730
|
-
} | undefined;
|
|
731
|
-
timeoutSeconds?: number | undefined;
|
|
732
|
-
ntfy?: {
|
|
733
|
-
topic: string;
|
|
734
|
-
server?: string | undefined;
|
|
735
|
-
replyTopic?: string | undefined;
|
|
736
|
-
token?: string | undefined;
|
|
737
|
-
} | undefined;
|
|
738
|
-
elicitation?: boolean | undefined;
|
|
739
|
-
}>>;
|
|
740
|
-
/** Timeout for each interceptor invocation, in milliseconds. */
|
|
246
|
+
}, z.core.$strict>;
|
|
247
|
+
}, z.core.$strict>>>;
|
|
248
|
+
}, z.core.$strict>>;
|
|
741
249
|
interceptorTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
742
|
-
/** Per-interceptor overrides of failOpen, priorityHint, mode, timeoutMs and hooks, by interceptor name. */
|
|
743
250
|
interceptorOverrides: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
744
251
|
failOpen: z.ZodOptional<z.ZodBoolean>;
|
|
745
|
-
priorityHint: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodObject<{
|
|
252
|
+
priorityHint: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
746
253
|
request: z.ZodOptional<z.ZodNumber>;
|
|
747
254
|
response: z.ZodOptional<z.ZodNumber>;
|
|
748
|
-
},
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
response?: number | undefined;
|
|
754
|
-
}>]>>;
|
|
755
|
-
mode: z.ZodOptional<z.ZodEnum<["active", "audit"]>>;
|
|
255
|
+
}, z.core.$strict>]>>;
|
|
256
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
257
|
+
active: "active";
|
|
258
|
+
audit: "audit";
|
|
259
|
+
}>>;
|
|
756
260
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
757
261
|
hooks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
758
|
-
events: z.ZodArray<z.ZodString
|
|
759
|
-
phase: z.ZodEnum<
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
},
|
|
764
|
-
|
|
765
|
-
phase: "request" | "response";
|
|
766
|
-
}>, "many">>;
|
|
767
|
-
}, "strict", z.ZodTypeAny, {
|
|
768
|
-
mode?: "active" | "audit" | undefined;
|
|
769
|
-
priorityHint?: number | {
|
|
770
|
-
request?: number | undefined;
|
|
771
|
-
response?: number | undefined;
|
|
772
|
-
} | undefined;
|
|
773
|
-
failOpen?: boolean | undefined;
|
|
774
|
-
timeoutMs?: number | undefined;
|
|
775
|
-
hooks?: {
|
|
776
|
-
events: string[];
|
|
777
|
-
phase: "request" | "response";
|
|
778
|
-
}[] | undefined;
|
|
779
|
-
}, {
|
|
780
|
-
mode?: "active" | "audit" | undefined;
|
|
781
|
-
priorityHint?: number | {
|
|
782
|
-
request?: number | undefined;
|
|
783
|
-
response?: number | undefined;
|
|
784
|
-
} | undefined;
|
|
785
|
-
failOpen?: boolean | undefined;
|
|
786
|
-
timeoutMs?: number | undefined;
|
|
787
|
-
hooks?: {
|
|
788
|
-
events: string[];
|
|
789
|
-
phase: "request" | "response";
|
|
790
|
-
}[] | undefined;
|
|
791
|
-
}>>>;
|
|
792
|
-
/** Who runs this gateway. Passed to the authorizer and the interceptors. Default: anonymous. */
|
|
262
|
+
events: z.ZodArray<z.ZodString>;
|
|
263
|
+
phase: z.ZodEnum<{
|
|
264
|
+
request: "request";
|
|
265
|
+
response: "response";
|
|
266
|
+
}>;
|
|
267
|
+
}, z.core.$strict>>>;
|
|
268
|
+
}, z.core.$strict>>>;
|
|
793
269
|
principal: z.ZodOptional<z.ZodObject<{
|
|
794
|
-
type: z.ZodDefault<z.ZodEnum<
|
|
270
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
271
|
+
user: "user";
|
|
272
|
+
service: "service";
|
|
273
|
+
}>>;
|
|
795
274
|
id: z.ZodString;
|
|
796
275
|
claims: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
797
|
-
},
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
claims?: Record<string, unknown> | undefined;
|
|
805
|
-
}>>;
|
|
806
|
-
/** Role-based authorization: when present, a call no role grants is denied. */
|
|
807
|
-
roles: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
|
|
808
|
-
/** Principal ids; "*" means everyone, including an anonymous caller. */
|
|
809
|
-
members: z.ZodArray<z.ZodString, "atleastone">;
|
|
810
|
-
tools: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
811
|
-
prompts: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
812
|
-
/** Resource URI patterns, e.g. "github://acme/*". */
|
|
813
|
-
resources: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
814
|
-
}, "strict", z.ZodTypeAny, {
|
|
815
|
-
members: [string, ...string[]];
|
|
816
|
-
tools: string[];
|
|
817
|
-
prompts: string[];
|
|
818
|
-
resources: string[];
|
|
819
|
-
}, {
|
|
820
|
-
members: [string, ...string[]];
|
|
821
|
-
tools?: string[] | undefined;
|
|
822
|
-
prompts?: string[] | undefined;
|
|
823
|
-
resources?: string[] | undefined;
|
|
824
|
-
}>, {
|
|
825
|
-
members: [string, ...string[]];
|
|
826
|
-
tools: string[];
|
|
827
|
-
prompts: string[];
|
|
828
|
-
resources: string[];
|
|
829
|
-
}, {
|
|
830
|
-
members: [string, ...string[]];
|
|
831
|
-
tools?: string[] | undefined;
|
|
832
|
-
prompts?: string[] | undefined;
|
|
833
|
-
resources?: string[] | undefined;
|
|
834
|
-
}>>, Record<string, {
|
|
835
|
-
members: [string, ...string[]];
|
|
836
|
-
tools: string[];
|
|
837
|
-
prompts: string[];
|
|
838
|
-
resources: string[];
|
|
839
|
-
}>, Record<string, {
|
|
840
|
-
members: [string, ...string[]];
|
|
841
|
-
tools?: string[] | undefined;
|
|
842
|
-
prompts?: string[] | undefined;
|
|
843
|
-
resources?: string[] | undefined;
|
|
844
|
-
}>>>;
|
|
845
|
-
/** Cedar authorization. With roles as well, both must allow. */
|
|
276
|
+
}, z.core.$strict>>;
|
|
277
|
+
roles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
278
|
+
members: z.ZodArray<z.ZodString>;
|
|
279
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
280
|
+
prompts: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
281
|
+
resources: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
282
|
+
}, z.core.$strict>>>;
|
|
846
283
|
cedar: z.ZodOptional<z.ZodObject<{
|
|
847
|
-
/** Cedar policy file. Relative paths are resolved against the config file's directory. */
|
|
848
284
|
policies: z.ZodString;
|
|
849
|
-
/** Optional Cedar entities JSON file: groups (`parents`) and attributes. */
|
|
850
285
|
entities: z.ZodOptional<z.ZodString>;
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
args: string[];
|
|
867
|
-
env: Record<string, string>;
|
|
868
|
-
cwd?: string | undefined;
|
|
869
|
-
} | {
|
|
870
|
-
url: string;
|
|
871
|
-
headers: Record<string, string>;
|
|
872
|
-
}>;
|
|
873
|
-
interceptorServers: Record<string, {
|
|
874
|
-
command: string;
|
|
875
|
-
args: string[];
|
|
876
|
-
env: Record<string, string>;
|
|
877
|
-
cwd?: string | undefined;
|
|
878
|
-
} | {
|
|
879
|
-
url: string;
|
|
880
|
-
headers: Record<string, string>;
|
|
881
|
-
}>;
|
|
882
|
-
interceptorTimeoutMs: number;
|
|
883
|
-
interceptorOverrides: Record<string, {
|
|
884
|
-
mode?: "active" | "audit" | undefined;
|
|
885
|
-
priorityHint?: number | {
|
|
886
|
-
request?: number | undefined;
|
|
887
|
-
response?: number | undefined;
|
|
888
|
-
} | undefined;
|
|
889
|
-
failOpen?: boolean | undefined;
|
|
890
|
-
timeoutMs?: number | undefined;
|
|
891
|
-
hooks?: {
|
|
892
|
-
events: string[];
|
|
893
|
-
phase: "request" | "response";
|
|
894
|
-
}[] | undefined;
|
|
895
|
-
}>;
|
|
896
|
-
audit?: string | undefined;
|
|
897
|
-
interceptors?: {
|
|
898
|
-
command: string;
|
|
899
|
-
args: string[];
|
|
900
|
-
env: Record<string, string>;
|
|
901
|
-
cwd?: string | undefined;
|
|
902
|
-
} | undefined;
|
|
903
|
-
principal?: {
|
|
904
|
-
id: string;
|
|
905
|
-
type: "user" | "service";
|
|
906
|
-
claims?: Record<string, unknown> | undefined;
|
|
907
|
-
} | undefined;
|
|
908
|
-
approvals?: {
|
|
909
|
-
timeoutSeconds: number;
|
|
910
|
-
elicitation: boolean;
|
|
911
|
-
approvers?: Record<string, {
|
|
912
|
-
ntfy: {
|
|
913
|
-
server: string;
|
|
914
|
-
topic: string;
|
|
915
|
-
replyTopic?: string | undefined;
|
|
916
|
-
token?: string | undefined;
|
|
917
|
-
};
|
|
918
|
-
}> | undefined;
|
|
919
|
-
email?: {
|
|
920
|
-
on: ["approved" | "denied" | "timeout" | "undeliverable" | "pending" | "blocked", ...("approved" | "denied" | "timeout" | "undeliverable" | "pending" | "blocked")[]];
|
|
921
|
-
smtp: {
|
|
922
|
-
host: string;
|
|
923
|
-
port: number;
|
|
924
|
-
user?: string | undefined;
|
|
925
|
-
secure?: boolean | undefined;
|
|
926
|
-
pass?: string | undefined;
|
|
927
|
-
};
|
|
928
|
-
from: string;
|
|
929
|
-
to: string | [string, ...string[]];
|
|
930
|
-
} | undefined;
|
|
931
|
-
ntfy?: {
|
|
932
|
-
server: string;
|
|
933
|
-
topic: string;
|
|
934
|
-
replyTopic?: string | undefined;
|
|
935
|
-
token?: string | undefined;
|
|
936
|
-
} | undefined;
|
|
937
|
-
} | undefined;
|
|
938
|
-
roles?: Record<string, {
|
|
939
|
-
members: [string, ...string[]];
|
|
940
|
-
tools: string[];
|
|
941
|
-
prompts: string[];
|
|
942
|
-
resources: string[];
|
|
943
|
-
}> | undefined;
|
|
944
|
-
cedar?: {
|
|
945
|
-
policies: string;
|
|
946
|
-
entities?: string | undefined;
|
|
947
|
-
timeZone?: string | undefined;
|
|
948
|
-
} | undefined;
|
|
949
|
-
}, {
|
|
950
|
-
upstreams: Record<string, {
|
|
951
|
-
command: string;
|
|
952
|
-
args?: string[] | undefined;
|
|
953
|
-
env?: Record<string, string> | undefined;
|
|
954
|
-
cwd?: string | undefined;
|
|
955
|
-
} | {
|
|
956
|
-
url: string;
|
|
957
|
-
headers?: Record<string, string> | undefined;
|
|
958
|
-
}>;
|
|
959
|
-
mode?: "active" | "audit" | undefined;
|
|
960
|
-
audit?: string | undefined;
|
|
961
|
-
interceptors?: {
|
|
962
|
-
command: string;
|
|
963
|
-
args?: string[] | undefined;
|
|
964
|
-
env?: Record<string, string> | undefined;
|
|
965
|
-
cwd?: string | undefined;
|
|
966
|
-
} | undefined;
|
|
967
|
-
principal?: {
|
|
968
|
-
id: string;
|
|
969
|
-
type?: "user" | "service" | undefined;
|
|
970
|
-
claims?: Record<string, unknown> | undefined;
|
|
971
|
-
} | undefined;
|
|
972
|
-
interceptorServers?: Record<string, {
|
|
973
|
-
command: string;
|
|
974
|
-
args?: string[] | undefined;
|
|
975
|
-
env?: Record<string, string> | undefined;
|
|
976
|
-
cwd?: string | undefined;
|
|
977
|
-
} | {
|
|
978
|
-
url: string;
|
|
979
|
-
headers?: Record<string, string> | undefined;
|
|
980
|
-
}> | undefined;
|
|
981
|
-
approvals?: {
|
|
982
|
-
approvers?: Record<string, {
|
|
983
|
-
ntfy: {
|
|
984
|
-
topic: string;
|
|
985
|
-
server?: string | undefined;
|
|
986
|
-
replyTopic?: string | undefined;
|
|
987
|
-
token?: string | undefined;
|
|
988
|
-
};
|
|
989
|
-
}> | undefined;
|
|
990
|
-
email?: {
|
|
991
|
-
smtp: {
|
|
992
|
-
host: string;
|
|
993
|
-
user?: string | undefined;
|
|
994
|
-
port?: number | undefined;
|
|
995
|
-
secure?: boolean | undefined;
|
|
996
|
-
pass?: string | undefined;
|
|
997
|
-
};
|
|
998
|
-
from: string;
|
|
999
|
-
to: string | [string, ...string[]];
|
|
1000
|
-
on?: ["approved" | "denied" | "timeout" | "undeliverable" | "pending" | "blocked", ...("approved" | "denied" | "timeout" | "undeliverable" | "pending" | "blocked")[]] | undefined;
|
|
1001
|
-
} | undefined;
|
|
1002
|
-
timeoutSeconds?: number | undefined;
|
|
1003
|
-
ntfy?: {
|
|
1004
|
-
topic: string;
|
|
1005
|
-
server?: string | undefined;
|
|
1006
|
-
replyTopic?: string | undefined;
|
|
1007
|
-
token?: string | undefined;
|
|
1008
|
-
} | undefined;
|
|
1009
|
-
elicitation?: boolean | undefined;
|
|
1010
|
-
} | undefined;
|
|
1011
|
-
interceptorTimeoutMs?: number | undefined;
|
|
1012
|
-
interceptorOverrides?: Record<string, {
|
|
1013
|
-
mode?: "active" | "audit" | undefined;
|
|
1014
|
-
priorityHint?: number | {
|
|
1015
|
-
request?: number | undefined;
|
|
1016
|
-
response?: number | undefined;
|
|
1017
|
-
} | undefined;
|
|
1018
|
-
failOpen?: boolean | undefined;
|
|
1019
|
-
timeoutMs?: number | undefined;
|
|
1020
|
-
hooks?: {
|
|
1021
|
-
events: string[];
|
|
1022
|
-
phase: "request" | "response";
|
|
1023
|
-
}[] | undefined;
|
|
1024
|
-
}> | undefined;
|
|
1025
|
-
roles?: Record<string, {
|
|
1026
|
-
members: [string, ...string[]];
|
|
1027
|
-
tools?: string[] | undefined;
|
|
1028
|
-
prompts?: string[] | undefined;
|
|
1029
|
-
resources?: string[] | undefined;
|
|
1030
|
-
}> | undefined;
|
|
1031
|
-
cedar?: {
|
|
1032
|
-
policies: string;
|
|
1033
|
-
entities?: string | undefined;
|
|
1034
|
-
timeZone?: string | undefined;
|
|
1035
|
-
} | undefined;
|
|
1036
|
-
}>;
|
|
286
|
+
timeZone: z.ZodOptional<z.ZodString>;
|
|
287
|
+
}, z.core.$strict>>;
|
|
288
|
+
openfga: z.ZodOptional<z.ZodObject<{
|
|
289
|
+
url: z.ZodString;
|
|
290
|
+
storeId: z.ZodString;
|
|
291
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
292
|
+
token: z.ZodOptional<z.ZodString>;
|
|
293
|
+
relation: z.ZodDefault<z.ZodString>;
|
|
294
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
295
|
+
tools: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
296
|
+
relation: z.ZodOptional<z.ZodString>;
|
|
297
|
+
object: z.ZodOptional<z.ZodString>;
|
|
298
|
+
}, z.core.$strict>>>;
|
|
299
|
+
}, z.core.$strict>>;
|
|
300
|
+
}, z.core.$strict>;
|
|
1037
301
|
export type GatewayConfig = z.infer<typeof GatewayConfigSchema>;
|
|
1038
302
|
export declare const TOOL_SEPARATOR = "__";
|
|
1039
303
|
export declare class EnvExpansionError extends Error {
|