@vellumai/credential-executor 0.10.7 → 0.10.8-dev.202607102228.5945895

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.
Files changed (65) hide show
  1. package/Dockerfile +1 -1
  2. package/node_modules/@vellumai/service-contracts/package.json +1 -2
  3. package/node_modules/@vellumai/service-contracts/src/__tests__/attachment-naming.test.ts +104 -0
  4. package/node_modules/@vellumai/service-contracts/src/__tests__/contracts.test.ts +0 -2
  5. package/node_modules/@vellumai/service-contracts/src/attachment-naming.ts +118 -0
  6. package/node_modules/@vellumai/service-contracts/src/credential-rpc.ts +3 -5
  7. package/node_modules/@vellumai/service-contracts/src/index.ts +2 -4
  8. package/node_modules/@vellumai/service-contracts/src/rpc.ts +4 -447
  9. package/package.json +2 -3
  10. package/src/__tests__/bulk-set-credentials.test.ts +1 -1
  11. package/src/__tests__/local-standalone.test.ts +5 -36
  12. package/src/__tests__/managed-integration.test.ts +112 -91
  13. package/src/__tests__/managed-reconnect.test.ts +2 -2
  14. package/src/__tests__/transport.test.ts +23 -27
  15. package/src/cli.ts +1 -1
  16. package/src/index.ts +8 -88
  17. package/src/main.ts +228 -340
  18. package/src/paths.ts +4 -20
  19. package/src/server.ts +52 -469
  20. package/node_modules/@vellumai/service-contracts/src/__tests__/grants.test.ts +0 -686
  21. package/node_modules/@vellumai/service-contracts/src/grants.ts +0 -184
  22. package/node_modules/@vellumai/service-contracts/src/rendering.ts +0 -135
  23. package/src/__tests__/command-executor.test.ts +0 -1879
  24. package/src/__tests__/command-validator.test.ts +0 -1405
  25. package/src/__tests__/command-workspace.test.ts +0 -1050
  26. package/src/__tests__/grant-store.test.ts +0 -689
  27. package/src/__tests__/http-executor.test.ts +0 -1336
  28. package/src/__tests__/http-policy.test.ts +0 -1069
  29. package/src/__tests__/local-materializers.test.ts +0 -860
  30. package/src/__tests__/local-token-refresh.test.ts +0 -361
  31. package/src/__tests__/manage-secure-command-tool.test.ts +0 -134
  32. package/src/__tests__/managed-lazy-getters.test.ts +0 -359
  33. package/src/__tests__/managed-materializers.test.ts +0 -1028
  34. package/src/__tests__/managed-rejection.test.ts +0 -43
  35. package/src/__tests__/toolstore.test.ts +0 -773
  36. package/src/audit/store.ts +0 -188
  37. package/src/commands/auth-adapters.ts +0 -169
  38. package/src/commands/egress-hooks.ts +0 -203
  39. package/src/commands/executor.ts +0 -1155
  40. package/src/commands/output-scan.ts +0 -157
  41. package/src/commands/profiles.ts +0 -286
  42. package/src/commands/validator.ts +0 -702
  43. package/src/commands/workspace.ts +0 -550
  44. package/src/grants/index.ts +0 -17
  45. package/src/grants/persistent-store.ts +0 -309
  46. package/src/grants/rpc-handlers.ts +0 -293
  47. package/src/grants/temporary-store.ts +0 -289
  48. package/src/http/audit.ts +0 -84
  49. package/src/http/executor.ts +0 -684
  50. package/src/http/path-template.ts +0 -245
  51. package/src/http/policy.ts +0 -238
  52. package/src/http/response-filter.ts +0 -233
  53. package/src/managed-errors.ts +0 -9
  54. package/src/managed-lazy-getters.ts +0 -106
  55. package/src/managed-main.ts +0 -822
  56. package/src/materializers/local-oauth-lookup.ts +0 -98
  57. package/src/materializers/local-token-refresh.ts +0 -287
  58. package/src/materializers/local.ts +0 -316
  59. package/src/materializers/managed-platform.ts +0 -295
  60. package/src/subjects/local.ts +0 -177
  61. package/src/subjects/managed.ts +0 -311
  62. package/src/subjects/policy.ts +0 -79
  63. package/src/toolstore/integrity.ts +0 -94
  64. package/src/toolstore/manifest.ts +0 -154
  65. package/src/toolstore/publish.ts +0 -571
@@ -7,22 +7,6 @@
7
7
  *
8
8
  * Methods:
9
9
  *
10
- * **Tool execution**
11
- * - `make_authenticated_request` — Execute an authenticated HTTP request
12
- * - `run_authenticated_command` — Execute a command with credential env vars
13
- * - `manage_secure_command_tool` — Register/unregister a secure command tool
14
- *
15
- * **Approval flow**
16
- * - `approval_required` — CES notifies the assistant that approval is needed
17
- * - `record_grant` — Record a grant decision after guardian approval
18
- *
19
- * **Grant management**
20
- * - `list_grants` — List grants for a CES connection
21
- * - `revoke_grant` — Revoke a specific grant
22
- *
23
- * **Audit**
24
- * - `list_audit_records` — List audit records for inspection
25
- *
26
10
  * **Lifecycle**
27
11
  * - `update_managed_credential` — Push an updated API key to CES after hatch
28
12
  *
@@ -31,15 +15,10 @@
31
15
  * - `set_credential` — Store or update a credential
32
16
  * - `delete_credential` — Delete a credential by account name
33
17
  * - `list_credentials` — List all credential account names
18
+ * - `bulk_set_credentials` — Store multiple credentials at once
34
19
  */
35
20
 
36
21
  import { z } from "zod";
37
- import {
38
- AuditRecordSummarySchema,
39
- GrantProposalSchema,
40
- PersistentGrantRecordSchema,
41
- TemporaryGrantDecisionSchema,
42
- } from "./grants.js";
43
22
  import { RpcErrorSchema } from "./error.js";
44
23
 
45
24
  // ---------------------------------------------------------------------------
@@ -47,14 +26,6 @@ import { RpcErrorSchema } from "./error.js";
47
26
  // ---------------------------------------------------------------------------
48
27
 
49
28
  export const CesRpcMethod = {
50
- MakeAuthenticatedRequest: "make_authenticated_request",
51
- RunAuthenticatedCommand: "run_authenticated_command",
52
- ManageSecureCommandTool: "manage_secure_command_tool",
53
- ApprovalRequired: "approval_required",
54
- RecordGrant: "record_grant",
55
- ListGrants: "list_grants",
56
- RevokeGrant: "revoke_grant",
57
- ListAuditRecords: "list_audit_records",
58
29
  /** Push an updated assistant credential to CES after post-hatch provisioning. */
59
30
  UpdateManagedCredential: "update_managed_credential",
60
31
  /** Retrieve a single credential by account name. */
@@ -69,353 +40,7 @@ export const CesRpcMethod = {
69
40
  BulkSetCredentials: "bulk_set_credentials",
70
41
  } as const;
71
42
 
72
- export type CesRpcMethod =
73
- (typeof CesRpcMethod)[keyof typeof CesRpcMethod];
74
-
75
- // ---------------------------------------------------------------------------
76
- // make_authenticated_request
77
- // ---------------------------------------------------------------------------
78
-
79
- export const MakeAuthenticatedRequestSchema = z.object({
80
- /** CES credential handle to use for authentication. */
81
- credentialHandle: z.string(),
82
- /** HTTP method. */
83
- method: z.string(),
84
- /** Target URL. */
85
- url: z.string(),
86
- /** Optional request headers (credential headers are injected by CES). */
87
- headers: z.record(z.string(), z.string()).optional(),
88
- /** Optional request body (string or JSON-serialisable). */
89
- body: z.unknown().optional(),
90
- /** Human-readable purpose for audit logging. */
91
- purpose: z.string(),
92
- /** Existing grant ID to consume, if the caller holds one. */
93
- grantId: z.string().optional(),
94
- /** Conversation ID for conversation-scoped temporary grants. */
95
- conversationId: z.string().optional(),
96
- });
97
- export type MakeAuthenticatedRequest = z.infer<
98
- typeof MakeAuthenticatedRequestSchema
99
- >;
100
-
101
- export const MakeAuthenticatedRequestResponseSchema = z.object({
102
- /** Whether the request was executed (not whether the HTTP call succeeded). */
103
- success: z.boolean(),
104
- /** HTTP status code returned by the target. */
105
- statusCode: z.number().optional(),
106
- /** Response headers. */
107
- responseHeaders: z.record(z.string(), z.string()).optional(),
108
- /** Response body (string). */
109
- responseBody: z.string().optional(),
110
- /** Structured error if execution failed. */
111
- error: RpcErrorSchema.optional(),
112
- /** Audit record ID for this execution. */
113
- auditId: z.string().optional(),
114
- });
115
- export type MakeAuthenticatedRequestResponse = z.infer<
116
- typeof MakeAuthenticatedRequestResponseSchema
117
- >;
118
-
119
- // ---------------------------------------------------------------------------
120
- // run_authenticated_command
121
- // ---------------------------------------------------------------------------
122
-
123
- /**
124
- * A file to stage from the assistant workspace into the CES scratch directory.
125
- */
126
- const WorkspaceInputSchema = z.object({
127
- /** Relative path within the assistant workspace directory. */
128
- workspacePath: z.string(),
129
- });
130
-
131
- /**
132
- * A file the command produces in the scratch directory that should be
133
- * copied back to the assistant workspace after execution.
134
- */
135
- const WorkspaceOutputSchema = z.object({
136
- /** Relative path within the scratch directory where the command writes output. */
137
- scratchPath: z.string(),
138
- /** Relative path within the assistant workspace where the output is copied. */
139
- workspacePath: z.string(),
140
- });
141
-
142
- export const RunAuthenticatedCommandSchema = z.object({
143
- /** CES credential handle to use for environment injection. */
144
- credentialHandle: z.string(),
145
- /** Secure command reference in format '<bundleDigest>/<profileName> [argv...]'. Only manifest-driven secure commands are supported. */
146
- command: z.string(),
147
- /** Optional path used for resolving workspace input/output staging, not as the actual execution working directory (CES always runs commands in the scratch directory). */
148
- cwd: z.string().optional(),
149
- /** Workspace files to stage as read-only inputs in the CES scratch directory. */
150
- inputs: z.array(WorkspaceInputSchema).optional(),
151
- /** Workspace files to copy back from the CES scratch directory after execution. */
152
- outputs: z.array(WorkspaceOutputSchema).optional(),
153
- /** Human-readable purpose for audit logging. */
154
- purpose: z.string(),
155
- /** Existing grant ID to consume, if the caller holds one. */
156
- grantId: z.string().optional(),
157
- /** Conversation ID for conversation-scoped temporary grants. */
158
- conversationId: z.string().optional(),
159
- });
160
- export type RunAuthenticatedCommand = z.infer<
161
- typeof RunAuthenticatedCommandSchema
162
- >;
163
-
164
- export const RunAuthenticatedCommandResponseSchema = z.object({
165
- /** Whether the command was executed. */
166
- success: z.boolean(),
167
- /** Process exit code. */
168
- exitCode: z.number().optional(),
169
- /** Combined stdout output. */
170
- stdout: z.string().optional(),
171
- /** Combined stderr output. */
172
- stderr: z.string().optional(),
173
- /** Structured error if execution failed. */
174
- error: RpcErrorSchema.optional(),
175
- /** Audit record ID for this execution. */
176
- auditId: z.string().optional(),
177
- });
178
- export type RunAuthenticatedCommandResponse = z.infer<
179
- typeof RunAuthenticatedCommandResponseSchema
180
- >;
181
-
182
- // ---------------------------------------------------------------------------
183
- // manage_secure_command_tool
184
- // ---------------------------------------------------------------------------
185
-
186
- export const ManageSecureCommandToolAction = {
187
- Register: "register",
188
- Unregister: "unregister",
189
- } as const;
190
-
191
- export type ManageSecureCommandToolAction =
192
- (typeof ManageSecureCommandToolAction)[keyof typeof ManageSecureCommandToolAction];
193
-
194
- /**
195
- * Zod schema for allowed argv patterns within a command profile.
196
- */
197
- const AllowedArgvPatternSchema = z.object({
198
- name: z.string(),
199
- tokens: z.array(z.string()),
200
- });
201
-
202
- /**
203
- * Zod schema for allowed network targets within a command profile.
204
- */
205
- const AllowedNetworkTargetSchema = z.object({
206
- hostPattern: z.string(),
207
- ports: z.array(z.number()).optional(),
208
- protocols: z.array(z.enum(["http", "https"])).optional(),
209
- });
210
-
211
- /**
212
- * Zod schema for a single command profile within a secure command manifest.
213
- */
214
- const CommandProfileSchema = z.object({
215
- description: z.string(),
216
- allowedArgvPatterns: z.array(AllowedArgvPatternSchema),
217
- deniedSubcommands: z.array(z.string()),
218
- deniedFlags: z.array(z.string()).optional(),
219
- allowedNetworkTargets: z.array(AllowedNetworkTargetSchema).optional(),
220
- });
221
-
222
- /**
223
- * Zod schema for auth adapter configuration (discriminated union on `type`).
224
- */
225
- const AuthAdapterConfigSchema = z.discriminatedUnion("type", [
226
- z.object({
227
- type: z.literal("env_var"),
228
- envVarName: z.string(),
229
- valuePrefix: z.string().optional(),
230
- }),
231
- z.object({
232
- type: z.literal("temp_file"),
233
- envVarName: z.string(),
234
- fileExtension: z.string().optional(),
235
- fileMode: z.number().optional(),
236
- }),
237
- z.object({
238
- type: z.literal("credential_process"),
239
- envVarName: z.string(),
240
- helperCommand: z.string(),
241
- timeoutMs: z.number().optional(),
242
- }),
243
- ]);
244
-
245
- /**
246
- * Zod schema for the full secure command manifest passed during register.
247
- * This mirrors the {@link SecureCommandManifest} interface in
248
- * `credential-executor/src/commands/profiles.ts`.
249
- */
250
- export const SecureCommandManifestSchema = z.object({
251
- schemaVersion: z.string(),
252
- bundleDigest: z.string(),
253
- bundleId: z.string(),
254
- version: z.string(),
255
- entrypoint: z.string(),
256
- commandProfiles: z.record(z.string(), CommandProfileSchema),
257
- authAdapter: AuthAdapterConfigSchema,
258
- egressMode: z.enum(["proxy_required", "no_network"]),
259
- cleanConfigDirs: z.record(z.string(), z.string()).optional(),
260
- });
261
-
262
- export const ManageSecureCommandToolSchema = z.object({
263
- /** Whether to register or unregister the tool. */
264
- action: z.enum(["register", "unregister"]),
265
- /** Tool name to register/unregister. */
266
- toolName: z.string(),
267
- /** CES credential handle the tool should use (required for register). */
268
- credentialHandle: z.string().optional(),
269
- /** Human-readable description of the tool (required for register). */
270
- description: z.string().optional(),
271
- /** Bundle identifier for the secure command package (required for register). */
272
- bundleId: z.string().optional(),
273
- /** Semantic version of the bundle to install (required for register). */
274
- version: z.string().optional(),
275
- /** HTTPS URL from which CES will download the bundle (required for register). */
276
- sourceUrl: z.string().optional(),
277
- /** SHA-256 hex digest of the bundle for integrity verification (required for register). */
278
- sha256: z.string().optional(),
279
- /**
280
- * Full secure command manifest for the bundle (required for register).
281
- * Contains entrypoint, command profiles, auth adapter, egress mode, etc.
282
- * CES validates this manifest before publishing the bundle.
283
- */
284
- secureCommandManifest: SecureCommandManifestSchema.optional(),
285
- });
286
- export type ManageSecureCommandTool = z.infer<
287
- typeof ManageSecureCommandToolSchema
288
- >;
289
-
290
- export const ManageSecureCommandToolResponseSchema = z.object({
291
- /** Whether the operation succeeded. */
292
- success: z.boolean(),
293
- /** Structured error if the operation failed. */
294
- error: RpcErrorSchema.optional(),
295
- });
296
- export type ManageSecureCommandToolResponse = z.infer<
297
- typeof ManageSecureCommandToolResponseSchema
298
- >;
299
-
300
- // ---------------------------------------------------------------------------
301
- // approval_required (CES → assistant notification)
302
- // ---------------------------------------------------------------------------
303
-
304
- export const ApprovalRequiredSchema = z.object({
305
- /** The proposal that requires approval. */
306
- proposal: GrantProposalSchema,
307
- /** Deterministic hash of the proposal. */
308
- proposalHash: z.string(),
309
- /** Human-readable rendering of the proposal. */
310
- renderedProposal: z.string(),
311
- /** The CES connection requesting approval. */
312
- sessionId: z.string(),
313
- /** The conversation ID for conversation-scoped grants. */
314
- conversationId: z.string().optional(),
315
- });
316
- export type ApprovalRequired = z.infer<typeof ApprovalRequiredSchema>;
317
-
318
- export const ApprovalRequiredResponseSchema = z.object({
319
- /** Whether the assistant acknowledged the approval request. */
320
- acknowledged: z.boolean(),
321
- });
322
- export type ApprovalRequiredResponse = z.infer<
323
- typeof ApprovalRequiredResponseSchema
324
- >;
325
-
326
- // ---------------------------------------------------------------------------
327
- // record_grant
328
- // ---------------------------------------------------------------------------
329
-
330
- export const RecordGrantSchema = z.object({
331
- /** The grant decision from the guardian. */
332
- decision: TemporaryGrantDecisionSchema,
333
- /** The CES connection this grant applies to. */
334
- sessionId: z.string(),
335
- /** The conversation ID for conversation-scoped grants. */
336
- conversationId: z.string().optional(),
337
- });
338
- export type RecordGrant = z.infer<typeof RecordGrantSchema>;
339
-
340
- export const RecordGrantResponseSchema = z.object({
341
- /** Whether the grant was successfully recorded. */
342
- success: z.boolean(),
343
- /** The persisted grant record (when approved and recorded). */
344
- grant: PersistentGrantRecordSchema.optional(),
345
- /** Structured error if recording failed. */
346
- error: RpcErrorSchema.optional(),
347
- });
348
- export type RecordGrantResponse = z.infer<typeof RecordGrantResponseSchema>;
349
-
350
- // ---------------------------------------------------------------------------
351
- // list_grants
352
- // ---------------------------------------------------------------------------
353
-
354
- export const ListGrantsSchema = z.object({
355
- /** Filter by CES connection ID. */
356
- sessionId: z.string().optional(),
357
- /** Filter by credential handle. */
358
- credentialHandle: z.string().optional(),
359
- /** Filter by grant status. */
360
- status: z
361
- .enum(["active", "expired", "revoked", "consumed"])
362
- .optional(),
363
- });
364
- export type ListGrants = z.infer<typeof ListGrantsSchema>;
365
-
366
- export const ListGrantsResponseSchema = z.object({
367
- /** List of matching grant records. */
368
- grants: z.array(PersistentGrantRecordSchema),
369
- });
370
- export type ListGrantsResponse = z.infer<typeof ListGrantsResponseSchema>;
371
-
372
- // ---------------------------------------------------------------------------
373
- // revoke_grant
374
- // ---------------------------------------------------------------------------
375
-
376
- export const RevokeGrantSchema = z.object({
377
- /** The grant to revoke. */
378
- grantId: z.string(),
379
- /** Human-readable reason for revocation. */
380
- reason: z.string().optional(),
381
- });
382
- export type RevokeGrant = z.infer<typeof RevokeGrantSchema>;
383
-
384
- export const RevokeGrantResponseSchema = z.object({
385
- /** Whether the grant was successfully revoked. */
386
- success: z.boolean(),
387
- /** Structured error if revocation failed. */
388
- error: RpcErrorSchema.optional(),
389
- });
390
- export type RevokeGrantResponse = z.infer<typeof RevokeGrantResponseSchema>;
391
-
392
- // ---------------------------------------------------------------------------
393
- // list_audit_records
394
- // ---------------------------------------------------------------------------
395
-
396
- export const ListAuditRecordsSchema = z.object({
397
- /** Filter by CES connection ID. */
398
- sessionId: z.string().optional(),
399
- /** Filter by credential handle. */
400
- credentialHandle: z.string().optional(),
401
- /** Filter by grant ID. */
402
- grantId: z.string().optional(),
403
- /** Maximum number of records to return. */
404
- limit: z.number().optional(),
405
- /** Cursor for pagination (opaque string from a previous response). */
406
- cursor: z.string().optional(),
407
- });
408
- export type ListAuditRecords = z.infer<typeof ListAuditRecordsSchema>;
409
-
410
- export const ListAuditRecordsResponseSchema = z.object({
411
- /** List of matching audit record summaries. */
412
- records: z.array(AuditRecordSummarySchema),
413
- /** Cursor for the next page (null if no more results). */
414
- nextCursor: z.string().nullable(),
415
- });
416
- export type ListAuditRecordsResponse = z.infer<
417
- typeof ListAuditRecordsResponseSchema
418
- >;
43
+ export type CesRpcMethod = (typeof CesRpcMethod)[keyof typeof CesRpcMethod];
419
44
 
420
45
  // ---------------------------------------------------------------------------
421
46
  // update_managed_credential
@@ -458,9 +83,7 @@ export const GetCredentialResponseSchema = z.object({
458
83
  /** The credential value (present only when found). */
459
84
  value: z.string().optional(),
460
85
  });
461
- export type GetCredentialResponse = z.infer<
462
- typeof GetCredentialResponseSchema
463
- >;
86
+ export type GetCredentialResponse = z.infer<typeof GetCredentialResponseSchema>;
464
87
 
465
88
  // ---------------------------------------------------------------------------
466
89
  // set_credential
@@ -478,9 +101,7 @@ export const SetCredentialResponseSchema = z.object({
478
101
  /** Whether the credential was successfully stored. */
479
102
  ok: z.boolean(),
480
103
  });
481
- export type SetCredentialResponse = z.infer<
482
- typeof SetCredentialResponseSchema
483
- >;
104
+ export type SetCredentialResponse = z.infer<typeof SetCredentialResponseSchema>;
484
105
 
485
106
  // ---------------------------------------------------------------------------
486
107
  // delete_credential
@@ -556,38 +177,6 @@ export type BulkSetCredentialsResponse = z.infer<
556
177
  * schemas. Useful for building type-safe RPC dispatch layers.
557
178
  */
558
179
  export interface CesRpcContract {
559
- [CesRpcMethod.MakeAuthenticatedRequest]: {
560
- request: MakeAuthenticatedRequest;
561
- response: MakeAuthenticatedRequestResponse;
562
- };
563
- [CesRpcMethod.RunAuthenticatedCommand]: {
564
- request: RunAuthenticatedCommand;
565
- response: RunAuthenticatedCommandResponse;
566
- };
567
- [CesRpcMethod.ManageSecureCommandTool]: {
568
- request: ManageSecureCommandTool;
569
- response: ManageSecureCommandToolResponse;
570
- };
571
- [CesRpcMethod.ApprovalRequired]: {
572
- request: ApprovalRequired;
573
- response: ApprovalRequiredResponse;
574
- };
575
- [CesRpcMethod.RecordGrant]: {
576
- request: RecordGrant;
577
- response: RecordGrantResponse;
578
- };
579
- [CesRpcMethod.ListGrants]: {
580
- request: ListGrants;
581
- response: ListGrantsResponse;
582
- };
583
- [CesRpcMethod.RevokeGrant]: {
584
- request: RevokeGrant;
585
- response: RevokeGrantResponse;
586
- };
587
- [CesRpcMethod.ListAuditRecords]: {
588
- request: ListAuditRecords;
589
- response: ListAuditRecordsResponse;
590
- };
591
180
  [CesRpcMethod.UpdateManagedCredential]: {
592
181
  request: UpdateManagedCredential;
593
182
  response: UpdateManagedCredentialResponse;
@@ -618,38 +207,6 @@ export interface CesRpcContract {
618
207
  * Schema lookup map for runtime validation of RPC payloads.
619
208
  */
620
209
  export const CesRpcSchemas = {
621
- [CesRpcMethod.MakeAuthenticatedRequest]: {
622
- request: MakeAuthenticatedRequestSchema,
623
- response: MakeAuthenticatedRequestResponseSchema,
624
- },
625
- [CesRpcMethod.RunAuthenticatedCommand]: {
626
- request: RunAuthenticatedCommandSchema,
627
- response: RunAuthenticatedCommandResponseSchema,
628
- },
629
- [CesRpcMethod.ManageSecureCommandTool]: {
630
- request: ManageSecureCommandToolSchema,
631
- response: ManageSecureCommandToolResponseSchema,
632
- },
633
- [CesRpcMethod.ApprovalRequired]: {
634
- request: ApprovalRequiredSchema,
635
- response: ApprovalRequiredResponseSchema,
636
- },
637
- [CesRpcMethod.RecordGrant]: {
638
- request: RecordGrantSchema,
639
- response: RecordGrantResponseSchema,
640
- },
641
- [CesRpcMethod.ListGrants]: {
642
- request: ListGrantsSchema,
643
- response: ListGrantsResponseSchema,
644
- },
645
- [CesRpcMethod.RevokeGrant]: {
646
- request: RevokeGrantSchema,
647
- response: RevokeGrantResponseSchema,
648
- },
649
- [CesRpcMethod.ListAuditRecords]: {
650
- request: ListAuditRecordsSchema,
651
- response: ListAuditRecordsResponseSchema,
652
- },
653
210
  [CesRpcMethod.UpdateManagedCredential]: {
654
211
  request: UpdateManagedCredentialSchema,
655
212
  response: UpdateManagedCredentialResponseSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/credential-executor",
3
- "version": "0.10.7",
3
+ "version": "0.10.8-dev.202607102228.5945895",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -8,12 +8,11 @@
8
8
  },
9
9
  "bin": {
10
10
  "credential-executor": "./src/main.ts",
11
- "credential-executor-managed": "./src/managed-main.ts",
12
11
  "ces": "./src/cli.ts"
13
12
  },
14
13
  "scripts": {
15
14
  "dev": "bun run src/main.ts",
16
- "dev:managed": "CES_MODE=managed bun run src/managed-main.ts",
15
+ "dev:managed": "CES_MODE=managed bun run src/main.ts",
17
16
  "lint": "eslint",
18
17
  "lint:unused": "knip --include files,dependencies,unlisted",
19
18
  "typecheck": "bunx tsc --noEmit",
@@ -16,7 +16,7 @@ import type { SecureKeyBackend } from "@vellumai/credential-storage";
16
16
 
17
17
  /**
18
18
  * Build a minimal BulkSetCredentials handler using the same logic as
19
- * main.ts / managed-main.ts, backed by the given SecureKeyBackend.
19
+ * main.ts, backed by the given SecureKeyBackend.
20
20
  */
21
21
  function buildBulkSetHandler(secureKeyBackend: SecureKeyBackend) {
22
22
  return async (req: { credentials: Array<{ account: string; value: string }> }) => {
@@ -1,9 +1,8 @@
1
1
  /**
2
- * Local CES standalone-sibling test (real entrypoint subprocess).
2
+ * Local CES sibling test (real entrypoint subprocess).
3
3
  *
4
- * Spawns the actual `main.ts` entrypoint with `CES_STANDALONE=1` and **stdin
5
- * closed** the way the CLI launches the sibling (the `CES_STANDALONE`
6
- * opt-in) — and verifies that CES:
4
+ * Spawns the actual `main.ts` entrypoint with **stdin closed** — the way the
5
+ * CLI launches the sibling and verifies that CES:
7
6
  *
8
7
  * 1. binds its Unix socket and serves RPC despite having no stdio parent
9
8
  * (lifecycle anchored to SIGTERM, not stdin), and
@@ -145,12 +144,12 @@ describe("local CES standalone sibling (real entrypoint)", () => {
145
144
 
146
145
  const localMain = resolve(__dirname, "..", "main.ts");
147
146
 
148
- // CES_STANDALONE=1 + stdin closed is how the CLI launches the sibling.
147
+ // stdin closed is how the CLI launches the sibling — CES serves over a
148
+ // Unix socket, not stdio.
149
149
  proc = Bun.spawn({
150
150
  cmd: [process.execPath, localMain],
151
151
  env: {
152
152
  ...process.env,
153
- CES_STANDALONE: "1",
154
153
  CES_LOCAL_SOCKET: socketPath,
155
154
  CREDENTIAL_SECURITY_DIR: securityDir,
156
155
  VELLUM_WORKSPACE_DIR: workspaceDir,
@@ -200,34 +199,4 @@ describe("local CES standalone sibling (real entrypoint)", () => {
200
199
  ]);
201
200
  expect(exited).toBe(true);
202
201
  }, 30_000);
203
-
204
- test("without CES_STANDALONE, exits when stdin closes (stdio child)", async () => {
205
- tmpDir = mkdtempSync(join(tmpdir(), "ces-stdio-"));
206
- const securityDir = join(tmpDir, "protected");
207
- const workspaceDir = join(tmpDir, "workspace");
208
- mkdirSync(securityDir, { recursive: true });
209
- mkdirSync(workspaceDir, { recursive: true });
210
-
211
- const localMain = resolve(__dirname, "..", "main.ts");
212
-
213
- // Default mode: stdin "ignore" EOFs immediately, so the stdio server's
214
- // input stream ends and CES shuts down on its own — the today behavior.
215
- proc = Bun.spawn({
216
- cmd: [process.execPath, localMain],
217
- env: {
218
- ...process.env,
219
- CREDENTIAL_SECURITY_DIR: securityDir,
220
- VELLUM_WORKSPACE_DIR: workspaceDir,
221
- },
222
- stdin: "ignore",
223
- stdout: "ignore",
224
- stderr: "ignore",
225
- });
226
-
227
- const exited = await Promise.race([
228
- proc.exited.then(() => true),
229
- delay(10_000).then(() => false),
230
- ]);
231
- expect(exited).toBe(true);
232
- }, 20_000);
233
202
  });