@vellumai/vellum-gateway 0.11.7-staging.1 → 0.11.7

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.
@@ -16,6 +16,13 @@
16
16
  * - `delete_credential` — Delete a credential by account name
17
17
  * - `list_credentials` — List all credential account names
18
18
  * - `bulk_set_credentials` — Store multiple credentials at once
19
+ *
20
+ * **Credential records** (non-secret identity + policy)
21
+ * - `get_credential_record` — Retrieve a credential record by account name
22
+ * - `set_credential_record` — Store or update a credential record
23
+ * - `delete_credential_record` — Delete a credential record by account name
24
+ * - `list_credential_records` — List all credential records
25
+ * - `bulk_set_credential_records` — Store multiple credential records at once
19
26
  */
20
27
 
21
28
  import { z } from "zod";
@@ -38,6 +45,16 @@ export const CesRpcMethod = {
38
45
  ListCredentials: "list_credentials",
39
46
  /** Bulk-import credentials (set multiple at once). */
40
47
  BulkSetCredentials: "bulk_set_credentials",
48
+ /** Retrieve a single credential record (identity + policy) by account name. */
49
+ GetCredentialRecord: "get_credential_record",
50
+ /** Store or update a credential record by account name. */
51
+ SetCredentialRecord: "set_credential_record",
52
+ /** Delete a credential record by account name. */
53
+ DeleteCredentialRecord: "delete_credential_record",
54
+ /** List all credential records. */
55
+ ListCredentialRecords: "list_credential_records",
56
+ /** Bulk-import credential records. */
57
+ BulkSetCredentialRecords: "bulk_set_credential_records",
41
58
  } as const;
42
59
 
43
60
  export type CesRpcMethod = (typeof CesRpcMethod)[keyof typeof CesRpcMethod];
@@ -168,6 +185,123 @@ export type BulkSetCredentialsResponse = z.infer<
168
185
  typeof BulkSetCredentialsResponseSchema
169
186
  >;
170
187
 
188
+ // ---------------------------------------------------------------------------
189
+ // Credential records (identity + policy, never secret values)
190
+ // ---------------------------------------------------------------------------
191
+
192
+ export const CredentialInjectionTemplateSchema = z.object({
193
+ hostPattern: z.string(),
194
+ injectionType: z.enum(["header", "query"]),
195
+ headerName: z.string().optional(),
196
+ valuePrefix: z.string().optional(),
197
+ queryParamName: z.string().optional(),
198
+ composeWith: z
199
+ .object({
200
+ service: z.string(),
201
+ field: z.string(),
202
+ separator: z.string(),
203
+ })
204
+ .optional(),
205
+ valueTransform: z.enum(["base64"]).optional(),
206
+ });
207
+ export type CredentialInjectionTemplate = z.infer<
208
+ typeof CredentialInjectionTemplateSchema
209
+ >;
210
+
211
+ export const CredentialRecordSchema = z.object({
212
+ credentialId: z.string(),
213
+ service: z.string(),
214
+ field: z.string(),
215
+ allowedTools: z.array(z.string()),
216
+ allowedDomains: z.array(z.string()),
217
+ usageDescription: z.string().optional(),
218
+ alias: z.string().optional(),
219
+ injectionTemplates: z.array(CredentialInjectionTemplateSchema).optional(),
220
+ createdAt: z.number(),
221
+ updatedAt: z.number(),
222
+ });
223
+ export type CredentialRecord = z.infer<typeof CredentialRecordSchema>;
224
+
225
+ export const GetCredentialRecordSchema = z.object({
226
+ /** The account name to look up (`credential/{service}/{field}`). */
227
+ account: z.string(),
228
+ });
229
+ export type GetCredentialRecord = z.infer<typeof GetCredentialRecordSchema>;
230
+
231
+ export const GetCredentialRecordResponseSchema = z.object({
232
+ found: z.boolean(),
233
+ record: CredentialRecordSchema.optional(),
234
+ });
235
+ export type GetCredentialRecordResponse = z.infer<
236
+ typeof GetCredentialRecordResponseSchema
237
+ >;
238
+
239
+ export const SetCredentialRecordSchema = z.object({
240
+ account: z.string(),
241
+ record: CredentialRecordSchema,
242
+ });
243
+ export type SetCredentialRecord = z.infer<typeof SetCredentialRecordSchema>;
244
+
245
+ export const SetCredentialRecordResponseSchema = z.object({
246
+ ok: z.boolean(),
247
+ });
248
+ export type SetCredentialRecordResponse = z.infer<
249
+ typeof SetCredentialRecordResponseSchema
250
+ >;
251
+
252
+ export const DeleteCredentialRecordSchema = z.object({
253
+ account: z.string(),
254
+ });
255
+ export type DeleteCredentialRecord = z.infer<
256
+ typeof DeleteCredentialRecordSchema
257
+ >;
258
+
259
+ export const DeleteCredentialRecordResponseSchema = z.object({
260
+ result: z.enum(["deleted", "not-found", "error"]),
261
+ });
262
+ export type DeleteCredentialRecordResponse = z.infer<
263
+ typeof DeleteCredentialRecordResponseSchema
264
+ >;
265
+
266
+ export const ListCredentialRecordsSchema = z.object({});
267
+ export type ListCredentialRecords = z.infer<typeof ListCredentialRecordsSchema>;
268
+
269
+ export const ListCredentialRecordsResponseSchema = z.object({
270
+ records: z.array(
271
+ z.object({
272
+ account: z.string(),
273
+ record: CredentialRecordSchema,
274
+ }),
275
+ ),
276
+ });
277
+ export type ListCredentialRecordsResponse = z.infer<
278
+ typeof ListCredentialRecordsResponseSchema
279
+ >;
280
+
281
+ export const BulkSetCredentialRecordsSchema = z.object({
282
+ records: z.array(
283
+ z.object({
284
+ account: z.string(),
285
+ record: CredentialRecordSchema,
286
+ }),
287
+ ),
288
+ });
289
+ export type BulkSetCredentialRecords = z.infer<
290
+ typeof BulkSetCredentialRecordsSchema
291
+ >;
292
+
293
+ export const BulkSetCredentialRecordsResponseSchema = z.object({
294
+ results: z.array(
295
+ z.object({
296
+ account: z.string(),
297
+ ok: z.boolean(),
298
+ }),
299
+ ),
300
+ });
301
+ export type BulkSetCredentialRecordsResponse = z.infer<
302
+ typeof BulkSetCredentialRecordsResponseSchema
303
+ >;
304
+
171
305
  // ---------------------------------------------------------------------------
172
306
  // Full RPC contract type map
173
307
  // ---------------------------------------------------------------------------
@@ -201,6 +335,26 @@ export interface CesRpcContract {
201
335
  request: BulkSetCredentials;
202
336
  response: BulkSetCredentialsResponse;
203
337
  };
338
+ [CesRpcMethod.GetCredentialRecord]: {
339
+ request: GetCredentialRecord;
340
+ response: GetCredentialRecordResponse;
341
+ };
342
+ [CesRpcMethod.SetCredentialRecord]: {
343
+ request: SetCredentialRecord;
344
+ response: SetCredentialRecordResponse;
345
+ };
346
+ [CesRpcMethod.DeleteCredentialRecord]: {
347
+ request: DeleteCredentialRecord;
348
+ response: DeleteCredentialRecordResponse;
349
+ };
350
+ [CesRpcMethod.ListCredentialRecords]: {
351
+ request: ListCredentialRecords;
352
+ response: ListCredentialRecordsResponse;
353
+ };
354
+ [CesRpcMethod.BulkSetCredentialRecords]: {
355
+ request: BulkSetCredentialRecords;
356
+ response: BulkSetCredentialRecordsResponse;
357
+ };
204
358
  }
205
359
 
206
360
  /**
@@ -231,4 +385,24 @@ export const CesRpcSchemas = {
231
385
  request: BulkSetCredentialsSchema,
232
386
  response: BulkSetCredentialsResponseSchema,
233
387
  },
388
+ [CesRpcMethod.GetCredentialRecord]: {
389
+ request: GetCredentialRecordSchema,
390
+ response: GetCredentialRecordResponseSchema,
391
+ },
392
+ [CesRpcMethod.SetCredentialRecord]: {
393
+ request: SetCredentialRecordSchema,
394
+ response: SetCredentialRecordResponseSchema,
395
+ },
396
+ [CesRpcMethod.DeleteCredentialRecord]: {
397
+ request: DeleteCredentialRecordSchema,
398
+ response: DeleteCredentialRecordResponseSchema,
399
+ },
400
+ [CesRpcMethod.ListCredentialRecords]: {
401
+ request: ListCredentialRecordsSchema,
402
+ response: ListCredentialRecordsResponseSchema,
403
+ },
404
+ [CesRpcMethod.BulkSetCredentialRecords]: {
405
+ request: BulkSetCredentialRecordsSchema,
406
+ response: BulkSetCredentialRecordsResponseSchema,
407
+ },
234
408
  } as const;
@@ -16,10 +16,14 @@
16
16
  * Auth: Bearer token from a caller-supplied config.
17
17
  */
18
18
 
19
+ import type { CredentialRecord } from "@vellumai/service-contracts/credential-rpc";
20
+
19
21
  // ---------------------------------------------------------------------------
20
22
  // Types
21
23
  // ---------------------------------------------------------------------------
22
24
 
25
+ export type { CredentialRecord };
26
+
23
27
  /** Result of a credential get operation. */
24
28
  export interface CesCredentialGetResult {
25
29
  value: string | undefined;
@@ -111,6 +115,28 @@ export interface CesHttpCredentialClient {
111
115
 
112
116
  /** List all credential account names. */
113
117
  list(): Promise<CesCredentialListResult>;
118
+
119
+ /** Retrieve a credential record (identity + policy) by account name. */
120
+ getRecord(
121
+ account: string,
122
+ ): Promise<{ record: CredentialRecord | undefined; unreachable: boolean }>;
123
+
124
+ /** Store or update a credential record. */
125
+ setRecord(account: string, record: CredentialRecord): Promise<boolean>;
126
+
127
+ /** Delete a credential record by account name. */
128
+ deleteRecord(account: string): Promise<CesDeleteResult>;
129
+
130
+ /** List all credential records. */
131
+ listRecords(): Promise<{
132
+ records: Array<{ account: string; record: CredentialRecord }>;
133
+ unreachable: boolean;
134
+ }>;
135
+
136
+ /** Bulk-set credential records. */
137
+ bulkSetRecords(
138
+ records: Array<{ account: string; record: CredentialRecord }>,
139
+ ): Promise<Array<{ account: string; ok: boolean }>>;
114
140
  }
115
141
 
116
142
  // ---------------------------------------------------------------------------
@@ -292,5 +318,140 @@ export function createCesHttpCredentialClient(
292
318
  return { accounts: [], unreachable: true };
293
319
  }
294
320
  },
321
+
322
+ async getRecord(account: string) {
323
+ try {
324
+ const res = await cesRequest(
325
+ config,
326
+ logger,
327
+ "GET",
328
+ `/v1/metadata/${encodeURIComponent(account)}`,
329
+ );
330
+ if (!res) {
331
+ return { record: undefined, unreachable: true };
332
+ }
333
+ if (res.status === 404) {
334
+ return { record: undefined, unreachable: false };
335
+ }
336
+ if (!res.ok) {
337
+ logger.warn(
338
+ { account, status: res.status },
339
+ "CES credential record get returned non-OK status",
340
+ );
341
+ return { record: undefined, unreachable: true };
342
+ }
343
+ const data = (await res.json()) as { record?: CredentialRecord };
344
+ return { record: data.record, unreachable: false };
345
+ } catch (err) {
346
+ logger.warn(
347
+ { err, account } as Record<string, unknown>,
348
+ "CES credential record get threw unexpectedly",
349
+ );
350
+ return { record: undefined, unreachable: true };
351
+ }
352
+ },
353
+
354
+ async setRecord(account: string, record: CredentialRecord) {
355
+ try {
356
+ const res = await cesRequest(
357
+ config,
358
+ logger,
359
+ "PUT",
360
+ `/v1/metadata/${encodeURIComponent(account)}`,
361
+ { record },
362
+ );
363
+ return !!res?.ok;
364
+ } catch (err) {
365
+ logger.warn(
366
+ { err, account } as Record<string, unknown>,
367
+ "CES credential record set threw unexpectedly",
368
+ );
369
+ return false;
370
+ }
371
+ },
372
+
373
+ async deleteRecord(account: string) {
374
+ try {
375
+ const res = await cesRequest(
376
+ config,
377
+ logger,
378
+ "DELETE",
379
+ `/v1/metadata/${encodeURIComponent(account)}`,
380
+ );
381
+ if (!res) {
382
+ return "error";
383
+ }
384
+ if (res.status === 404) {
385
+ return "not-found";
386
+ }
387
+ if (!res.ok) {
388
+ return "error";
389
+ }
390
+ return "deleted";
391
+ } catch (err) {
392
+ logger.warn(
393
+ { err, account } as Record<string, unknown>,
394
+ "CES credential record delete threw unexpectedly",
395
+ );
396
+ return "error";
397
+ }
398
+ },
399
+
400
+ async listRecords() {
401
+ try {
402
+ const res = await cesRequest(
403
+ config,
404
+ logger,
405
+ "GET",
406
+ "/v1/metadata",
407
+ );
408
+ if (!res) {
409
+ return { records: [], unreachable: true };
410
+ }
411
+ if (!res.ok) {
412
+ return { records: [], unreachable: true };
413
+ }
414
+ const data = (await res.json()) as {
415
+ records?: Array<{ account: string; record: CredentialRecord }>;
416
+ };
417
+ return { records: data.records ?? [], unreachable: false };
418
+ } catch (err) {
419
+ logger.warn(
420
+ { err } as Record<string, unknown>,
421
+ "CES credential record list threw unexpectedly",
422
+ );
423
+ return { records: [], unreachable: true };
424
+ }
425
+ },
426
+
427
+ async bulkSetRecords(
428
+ records: Array<{ account: string; record: CredentialRecord }>,
429
+ ) {
430
+ try {
431
+ const res = await cesRequest(
432
+ config,
433
+ logger,
434
+ "POST",
435
+ "/v1/metadata/bulk",
436
+ { records },
437
+ );
438
+ if (!res?.ok) {
439
+ return records.map((entry) => ({
440
+ account: entry.account,
441
+ ok: false,
442
+ }));
443
+ }
444
+ const data = (await res.json()) as {
445
+ results: Array<{ account: string; ok: boolean }>;
446
+ };
447
+ return data.results;
448
+ } catch (err) {
449
+ logger.warn(
450
+ { err } as Record<string, unknown>,
451
+ "CES credential record bulk set threw unexpectedly",
452
+ );
453
+ return records.map((entry) => ({ account: entry.account, ok: false }));
454
+ }
455
+ },
295
456
  };
296
457
  }
@@ -18,6 +18,7 @@ export {
18
18
  type CesCredentialGetResult,
19
19
  type CesCredentialListResult,
20
20
  type CesDeleteResult,
21
+ type CredentialRecord,
21
22
  } from "./http-credentials.js";
22
23
 
23
24
  export {
@@ -16,6 +16,13 @@
16
16
  * - `delete_credential` — Delete a credential by account name
17
17
  * - `list_credentials` — List all credential account names
18
18
  * - `bulk_set_credentials` — Store multiple credentials at once
19
+ *
20
+ * **Credential records** (non-secret identity + policy)
21
+ * - `get_credential_record` — Retrieve a credential record by account name
22
+ * - `set_credential_record` — Store or update a credential record
23
+ * - `delete_credential_record` — Delete a credential record by account name
24
+ * - `list_credential_records` — List all credential records
25
+ * - `bulk_set_credential_records` — Store multiple credential records at once
19
26
  */
20
27
 
21
28
  import { z } from "zod";
@@ -38,6 +45,16 @@ export const CesRpcMethod = {
38
45
  ListCredentials: "list_credentials",
39
46
  /** Bulk-import credentials (set multiple at once). */
40
47
  BulkSetCredentials: "bulk_set_credentials",
48
+ /** Retrieve a single credential record (identity + policy) by account name. */
49
+ GetCredentialRecord: "get_credential_record",
50
+ /** Store or update a credential record by account name. */
51
+ SetCredentialRecord: "set_credential_record",
52
+ /** Delete a credential record by account name. */
53
+ DeleteCredentialRecord: "delete_credential_record",
54
+ /** List all credential records. */
55
+ ListCredentialRecords: "list_credential_records",
56
+ /** Bulk-import credential records. */
57
+ BulkSetCredentialRecords: "bulk_set_credential_records",
41
58
  } as const;
42
59
 
43
60
  export type CesRpcMethod = (typeof CesRpcMethod)[keyof typeof CesRpcMethod];
@@ -168,6 +185,123 @@ export type BulkSetCredentialsResponse = z.infer<
168
185
  typeof BulkSetCredentialsResponseSchema
169
186
  >;
170
187
 
188
+ // ---------------------------------------------------------------------------
189
+ // Credential records (identity + policy, never secret values)
190
+ // ---------------------------------------------------------------------------
191
+
192
+ export const CredentialInjectionTemplateSchema = z.object({
193
+ hostPattern: z.string(),
194
+ injectionType: z.enum(["header", "query"]),
195
+ headerName: z.string().optional(),
196
+ valuePrefix: z.string().optional(),
197
+ queryParamName: z.string().optional(),
198
+ composeWith: z
199
+ .object({
200
+ service: z.string(),
201
+ field: z.string(),
202
+ separator: z.string(),
203
+ })
204
+ .optional(),
205
+ valueTransform: z.enum(["base64"]).optional(),
206
+ });
207
+ export type CredentialInjectionTemplate = z.infer<
208
+ typeof CredentialInjectionTemplateSchema
209
+ >;
210
+
211
+ export const CredentialRecordSchema = z.object({
212
+ credentialId: z.string(),
213
+ service: z.string(),
214
+ field: z.string(),
215
+ allowedTools: z.array(z.string()),
216
+ allowedDomains: z.array(z.string()),
217
+ usageDescription: z.string().optional(),
218
+ alias: z.string().optional(),
219
+ injectionTemplates: z.array(CredentialInjectionTemplateSchema).optional(),
220
+ createdAt: z.number(),
221
+ updatedAt: z.number(),
222
+ });
223
+ export type CredentialRecord = z.infer<typeof CredentialRecordSchema>;
224
+
225
+ export const GetCredentialRecordSchema = z.object({
226
+ /** The account name to look up (`credential/{service}/{field}`). */
227
+ account: z.string(),
228
+ });
229
+ export type GetCredentialRecord = z.infer<typeof GetCredentialRecordSchema>;
230
+
231
+ export const GetCredentialRecordResponseSchema = z.object({
232
+ found: z.boolean(),
233
+ record: CredentialRecordSchema.optional(),
234
+ });
235
+ export type GetCredentialRecordResponse = z.infer<
236
+ typeof GetCredentialRecordResponseSchema
237
+ >;
238
+
239
+ export const SetCredentialRecordSchema = z.object({
240
+ account: z.string(),
241
+ record: CredentialRecordSchema,
242
+ });
243
+ export type SetCredentialRecord = z.infer<typeof SetCredentialRecordSchema>;
244
+
245
+ export const SetCredentialRecordResponseSchema = z.object({
246
+ ok: z.boolean(),
247
+ });
248
+ export type SetCredentialRecordResponse = z.infer<
249
+ typeof SetCredentialRecordResponseSchema
250
+ >;
251
+
252
+ export const DeleteCredentialRecordSchema = z.object({
253
+ account: z.string(),
254
+ });
255
+ export type DeleteCredentialRecord = z.infer<
256
+ typeof DeleteCredentialRecordSchema
257
+ >;
258
+
259
+ export const DeleteCredentialRecordResponseSchema = z.object({
260
+ result: z.enum(["deleted", "not-found", "error"]),
261
+ });
262
+ export type DeleteCredentialRecordResponse = z.infer<
263
+ typeof DeleteCredentialRecordResponseSchema
264
+ >;
265
+
266
+ export const ListCredentialRecordsSchema = z.object({});
267
+ export type ListCredentialRecords = z.infer<typeof ListCredentialRecordsSchema>;
268
+
269
+ export const ListCredentialRecordsResponseSchema = z.object({
270
+ records: z.array(
271
+ z.object({
272
+ account: z.string(),
273
+ record: CredentialRecordSchema,
274
+ }),
275
+ ),
276
+ });
277
+ export type ListCredentialRecordsResponse = z.infer<
278
+ typeof ListCredentialRecordsResponseSchema
279
+ >;
280
+
281
+ export const BulkSetCredentialRecordsSchema = z.object({
282
+ records: z.array(
283
+ z.object({
284
+ account: z.string(),
285
+ record: CredentialRecordSchema,
286
+ }),
287
+ ),
288
+ });
289
+ export type BulkSetCredentialRecords = z.infer<
290
+ typeof BulkSetCredentialRecordsSchema
291
+ >;
292
+
293
+ export const BulkSetCredentialRecordsResponseSchema = z.object({
294
+ results: z.array(
295
+ z.object({
296
+ account: z.string(),
297
+ ok: z.boolean(),
298
+ }),
299
+ ),
300
+ });
301
+ export type BulkSetCredentialRecordsResponse = z.infer<
302
+ typeof BulkSetCredentialRecordsResponseSchema
303
+ >;
304
+
171
305
  // ---------------------------------------------------------------------------
172
306
  // Full RPC contract type map
173
307
  // ---------------------------------------------------------------------------
@@ -201,6 +335,26 @@ export interface CesRpcContract {
201
335
  request: BulkSetCredentials;
202
336
  response: BulkSetCredentialsResponse;
203
337
  };
338
+ [CesRpcMethod.GetCredentialRecord]: {
339
+ request: GetCredentialRecord;
340
+ response: GetCredentialRecordResponse;
341
+ };
342
+ [CesRpcMethod.SetCredentialRecord]: {
343
+ request: SetCredentialRecord;
344
+ response: SetCredentialRecordResponse;
345
+ };
346
+ [CesRpcMethod.DeleteCredentialRecord]: {
347
+ request: DeleteCredentialRecord;
348
+ response: DeleteCredentialRecordResponse;
349
+ };
350
+ [CesRpcMethod.ListCredentialRecords]: {
351
+ request: ListCredentialRecords;
352
+ response: ListCredentialRecordsResponse;
353
+ };
354
+ [CesRpcMethod.BulkSetCredentialRecords]: {
355
+ request: BulkSetCredentialRecords;
356
+ response: BulkSetCredentialRecordsResponse;
357
+ };
204
358
  }
205
359
 
206
360
  /**
@@ -231,4 +385,24 @@ export const CesRpcSchemas = {
231
385
  request: BulkSetCredentialsSchema,
232
386
  response: BulkSetCredentialsResponseSchema,
233
387
  },
388
+ [CesRpcMethod.GetCredentialRecord]: {
389
+ request: GetCredentialRecordSchema,
390
+ response: GetCredentialRecordResponseSchema,
391
+ },
392
+ [CesRpcMethod.SetCredentialRecord]: {
393
+ request: SetCredentialRecordSchema,
394
+ response: SetCredentialRecordResponseSchema,
395
+ },
396
+ [CesRpcMethod.DeleteCredentialRecord]: {
397
+ request: DeleteCredentialRecordSchema,
398
+ response: DeleteCredentialRecordResponseSchema,
399
+ },
400
+ [CesRpcMethod.ListCredentialRecords]: {
401
+ request: ListCredentialRecordsSchema,
402
+ response: ListCredentialRecordsResponseSchema,
403
+ },
404
+ [CesRpcMethod.BulkSetCredentialRecords]: {
405
+ request: BulkSetCredentialRecordsSchema,
406
+ response: BulkSetCredentialRecordsResponseSchema,
407
+ },
234
408
  } as const;
@@ -16,6 +16,13 @@
16
16
  * - `delete_credential` — Delete a credential by account name
17
17
  * - `list_credentials` — List all credential account names
18
18
  * - `bulk_set_credentials` — Store multiple credentials at once
19
+ *
20
+ * **Credential records** (non-secret identity + policy)
21
+ * - `get_credential_record` — Retrieve a credential record by account name
22
+ * - `set_credential_record` — Store or update a credential record
23
+ * - `delete_credential_record` — Delete a credential record by account name
24
+ * - `list_credential_records` — List all credential records
25
+ * - `bulk_set_credential_records` — Store multiple credential records at once
19
26
  */
20
27
 
21
28
  import { z } from "zod";
@@ -38,6 +45,16 @@ export const CesRpcMethod = {
38
45
  ListCredentials: "list_credentials",
39
46
  /** Bulk-import credentials (set multiple at once). */
40
47
  BulkSetCredentials: "bulk_set_credentials",
48
+ /** Retrieve a single credential record (identity + policy) by account name. */
49
+ GetCredentialRecord: "get_credential_record",
50
+ /** Store or update a credential record by account name. */
51
+ SetCredentialRecord: "set_credential_record",
52
+ /** Delete a credential record by account name. */
53
+ DeleteCredentialRecord: "delete_credential_record",
54
+ /** List all credential records. */
55
+ ListCredentialRecords: "list_credential_records",
56
+ /** Bulk-import credential records. */
57
+ BulkSetCredentialRecords: "bulk_set_credential_records",
41
58
  } as const;
42
59
 
43
60
  export type CesRpcMethod = (typeof CesRpcMethod)[keyof typeof CesRpcMethod];
@@ -168,6 +185,123 @@ export type BulkSetCredentialsResponse = z.infer<
168
185
  typeof BulkSetCredentialsResponseSchema
169
186
  >;
170
187
 
188
+ // ---------------------------------------------------------------------------
189
+ // Credential records (identity + policy, never secret values)
190
+ // ---------------------------------------------------------------------------
191
+
192
+ export const CredentialInjectionTemplateSchema = z.object({
193
+ hostPattern: z.string(),
194
+ injectionType: z.enum(["header", "query"]),
195
+ headerName: z.string().optional(),
196
+ valuePrefix: z.string().optional(),
197
+ queryParamName: z.string().optional(),
198
+ composeWith: z
199
+ .object({
200
+ service: z.string(),
201
+ field: z.string(),
202
+ separator: z.string(),
203
+ })
204
+ .optional(),
205
+ valueTransform: z.enum(["base64"]).optional(),
206
+ });
207
+ export type CredentialInjectionTemplate = z.infer<
208
+ typeof CredentialInjectionTemplateSchema
209
+ >;
210
+
211
+ export const CredentialRecordSchema = z.object({
212
+ credentialId: z.string(),
213
+ service: z.string(),
214
+ field: z.string(),
215
+ allowedTools: z.array(z.string()),
216
+ allowedDomains: z.array(z.string()),
217
+ usageDescription: z.string().optional(),
218
+ alias: z.string().optional(),
219
+ injectionTemplates: z.array(CredentialInjectionTemplateSchema).optional(),
220
+ createdAt: z.number(),
221
+ updatedAt: z.number(),
222
+ });
223
+ export type CredentialRecord = z.infer<typeof CredentialRecordSchema>;
224
+
225
+ export const GetCredentialRecordSchema = z.object({
226
+ /** The account name to look up (`credential/{service}/{field}`). */
227
+ account: z.string(),
228
+ });
229
+ export type GetCredentialRecord = z.infer<typeof GetCredentialRecordSchema>;
230
+
231
+ export const GetCredentialRecordResponseSchema = z.object({
232
+ found: z.boolean(),
233
+ record: CredentialRecordSchema.optional(),
234
+ });
235
+ export type GetCredentialRecordResponse = z.infer<
236
+ typeof GetCredentialRecordResponseSchema
237
+ >;
238
+
239
+ export const SetCredentialRecordSchema = z.object({
240
+ account: z.string(),
241
+ record: CredentialRecordSchema,
242
+ });
243
+ export type SetCredentialRecord = z.infer<typeof SetCredentialRecordSchema>;
244
+
245
+ export const SetCredentialRecordResponseSchema = z.object({
246
+ ok: z.boolean(),
247
+ });
248
+ export type SetCredentialRecordResponse = z.infer<
249
+ typeof SetCredentialRecordResponseSchema
250
+ >;
251
+
252
+ export const DeleteCredentialRecordSchema = z.object({
253
+ account: z.string(),
254
+ });
255
+ export type DeleteCredentialRecord = z.infer<
256
+ typeof DeleteCredentialRecordSchema
257
+ >;
258
+
259
+ export const DeleteCredentialRecordResponseSchema = z.object({
260
+ result: z.enum(["deleted", "not-found", "error"]),
261
+ });
262
+ export type DeleteCredentialRecordResponse = z.infer<
263
+ typeof DeleteCredentialRecordResponseSchema
264
+ >;
265
+
266
+ export const ListCredentialRecordsSchema = z.object({});
267
+ export type ListCredentialRecords = z.infer<typeof ListCredentialRecordsSchema>;
268
+
269
+ export const ListCredentialRecordsResponseSchema = z.object({
270
+ records: z.array(
271
+ z.object({
272
+ account: z.string(),
273
+ record: CredentialRecordSchema,
274
+ }),
275
+ ),
276
+ });
277
+ export type ListCredentialRecordsResponse = z.infer<
278
+ typeof ListCredentialRecordsResponseSchema
279
+ >;
280
+
281
+ export const BulkSetCredentialRecordsSchema = z.object({
282
+ records: z.array(
283
+ z.object({
284
+ account: z.string(),
285
+ record: CredentialRecordSchema,
286
+ }),
287
+ ),
288
+ });
289
+ export type BulkSetCredentialRecords = z.infer<
290
+ typeof BulkSetCredentialRecordsSchema
291
+ >;
292
+
293
+ export const BulkSetCredentialRecordsResponseSchema = z.object({
294
+ results: z.array(
295
+ z.object({
296
+ account: z.string(),
297
+ ok: z.boolean(),
298
+ }),
299
+ ),
300
+ });
301
+ export type BulkSetCredentialRecordsResponse = z.infer<
302
+ typeof BulkSetCredentialRecordsResponseSchema
303
+ >;
304
+
171
305
  // ---------------------------------------------------------------------------
172
306
  // Full RPC contract type map
173
307
  // ---------------------------------------------------------------------------
@@ -201,6 +335,26 @@ export interface CesRpcContract {
201
335
  request: BulkSetCredentials;
202
336
  response: BulkSetCredentialsResponse;
203
337
  };
338
+ [CesRpcMethod.GetCredentialRecord]: {
339
+ request: GetCredentialRecord;
340
+ response: GetCredentialRecordResponse;
341
+ };
342
+ [CesRpcMethod.SetCredentialRecord]: {
343
+ request: SetCredentialRecord;
344
+ response: SetCredentialRecordResponse;
345
+ };
346
+ [CesRpcMethod.DeleteCredentialRecord]: {
347
+ request: DeleteCredentialRecord;
348
+ response: DeleteCredentialRecordResponse;
349
+ };
350
+ [CesRpcMethod.ListCredentialRecords]: {
351
+ request: ListCredentialRecords;
352
+ response: ListCredentialRecordsResponse;
353
+ };
354
+ [CesRpcMethod.BulkSetCredentialRecords]: {
355
+ request: BulkSetCredentialRecords;
356
+ response: BulkSetCredentialRecordsResponse;
357
+ };
204
358
  }
205
359
 
206
360
  /**
@@ -231,4 +385,24 @@ export const CesRpcSchemas = {
231
385
  request: BulkSetCredentialsSchema,
232
386
  response: BulkSetCredentialsResponseSchema,
233
387
  },
388
+ [CesRpcMethod.GetCredentialRecord]: {
389
+ request: GetCredentialRecordSchema,
390
+ response: GetCredentialRecordResponseSchema,
391
+ },
392
+ [CesRpcMethod.SetCredentialRecord]: {
393
+ request: SetCredentialRecordSchema,
394
+ response: SetCredentialRecordResponseSchema,
395
+ },
396
+ [CesRpcMethod.DeleteCredentialRecord]: {
397
+ request: DeleteCredentialRecordSchema,
398
+ response: DeleteCredentialRecordResponseSchema,
399
+ },
400
+ [CesRpcMethod.ListCredentialRecords]: {
401
+ request: ListCredentialRecordsSchema,
402
+ response: ListCredentialRecordsResponseSchema,
403
+ },
404
+ [CesRpcMethod.BulkSetCredentialRecords]: {
405
+ request: BulkSetCredentialRecordsSchema,
406
+ response: BulkSetCredentialRecordsResponseSchema,
407
+ },
234
408
  } as const;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/vellum-gateway",
3
- "version": "0.11.7-staging.1",
3
+ "version": "0.11.7",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -404,6 +404,22 @@
404
404
  "label": "Channel Conversation Sidecar",
405
405
  "description": "Renders a conversation bound to an external channel (Slack, Telegram, Discord, phone, email, and any other channel adapter) as two lanes in web chat: Vellum stays the primary full-width lane, and the canonical external-channel transcript moves into the existing read-only right drawer, opened from a channel-thread control in the chat header. Rows the client can attribute to the external channel are drawn once, in the drawer, instead of being blended into the Vellum lane. The drawer offers an Open in <channel> secondary action and a per-message Reference in Vellum action that stages one quoted reference above the Vellum composer. The Vellum composer stays the only input; nothing about delivery, routing, or permissions changes. Off leaves the header deep-link pill and the blended transcript unchanged.",
406
406
  "defaultEnabled": false
407
+ },
408
+ {
409
+ "id": "monday-oauth",
410
+ "scope": "assistant",
411
+ "key": "monday-oauth",
412
+ "label": "monday.com Integration",
413
+ "description": "Gates the seeded monday.com OAuth provider. When off, the provider is hidden from GET /v1/oauth/providers, its get-by-id route, and the connect/update routes, so it cannot be listed or connected from the CLI, gateway, or web integrations list. The row is still seeded into oauth_providers on startup; only its visibility changes.",
414
+ "defaultEnabled": false
415
+ },
416
+ {
417
+ "id": "chatgpt-device-code-login",
418
+ "scope": "client",
419
+ "key": "chatgpt-device-code-login",
420
+ "label": "ChatGPT Device Code Login",
421
+ "description": "Gates the device-code sign-in as the primary ChatGPT subscription connect flow in the web client. Off: the redirect-and-paste flow is the only flow the connect section shows, with no device code UI and no other-sign-in-options disclosure. On: device code leads, and the redirect-and-paste flow stays reachable behind that disclosure and takes the section over when the assistant has no device-auth route.",
422
+ "defaultEnabled": false
407
423
  }
408
424
  ]
409
425
  }