@vellumai/credential-executor 0.10.7-dev.202607102035.64f07ea → 0.10.7-staging.1

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 +2 -1
  3. package/node_modules/@vellumai/service-contracts/src/__tests__/contracts.test.ts +2 -0
  4. package/node_modules/@vellumai/service-contracts/src/__tests__/grants.test.ts +686 -0
  5. package/node_modules/@vellumai/service-contracts/src/credential-rpc.ts +5 -3
  6. package/node_modules/@vellumai/service-contracts/src/grants.ts +184 -0
  7. package/node_modules/@vellumai/service-contracts/src/index.ts +4 -2
  8. package/node_modules/@vellumai/service-contracts/src/rendering.ts +135 -0
  9. package/node_modules/@vellumai/service-contracts/src/rpc.ts +447 -4
  10. package/package.json +3 -2
  11. package/src/__tests__/bulk-set-credentials.test.ts +1 -1
  12. package/src/__tests__/command-executor.test.ts +1879 -0
  13. package/src/__tests__/command-validator.test.ts +1405 -0
  14. package/src/__tests__/command-workspace.test.ts +1050 -0
  15. package/src/__tests__/grant-store.test.ts +689 -0
  16. package/src/__tests__/http-executor.test.ts +1336 -0
  17. package/src/__tests__/http-policy.test.ts +1069 -0
  18. package/src/__tests__/local-materializers.test.ts +860 -0
  19. package/src/__tests__/local-standalone.test.ts +36 -5
  20. package/src/__tests__/local-token-refresh.test.ts +361 -0
  21. package/src/__tests__/manage-secure-command-tool.test.ts +134 -0
  22. package/src/__tests__/managed-integration.test.ts +91 -112
  23. package/src/__tests__/managed-lazy-getters.test.ts +359 -0
  24. package/src/__tests__/managed-materializers.test.ts +1028 -0
  25. package/src/__tests__/managed-reconnect.test.ts +2 -2
  26. package/src/__tests__/managed-rejection.test.ts +43 -0
  27. package/src/__tests__/toolstore.test.ts +773 -0
  28. package/src/__tests__/transport.test.ts +27 -23
  29. package/src/audit/store.ts +188 -0
  30. package/src/cli.ts +1 -1
  31. package/src/commands/auth-adapters.ts +169 -0
  32. package/src/commands/egress-hooks.ts +203 -0
  33. package/src/commands/executor.ts +1155 -0
  34. package/src/commands/output-scan.ts +157 -0
  35. package/src/commands/profiles.ts +286 -0
  36. package/src/commands/validator.ts +702 -0
  37. package/src/commands/workspace.ts +550 -0
  38. package/src/grants/index.ts +17 -0
  39. package/src/grants/persistent-store.ts +309 -0
  40. package/src/grants/rpc-handlers.ts +293 -0
  41. package/src/grants/temporary-store.ts +289 -0
  42. package/src/http/audit.ts +84 -0
  43. package/src/http/executor.ts +684 -0
  44. package/src/http/path-template.ts +245 -0
  45. package/src/http/policy.ts +238 -0
  46. package/src/http/response-filter.ts +233 -0
  47. package/src/index.ts +88 -8
  48. package/src/main.ts +340 -228
  49. package/src/managed-errors.ts +9 -0
  50. package/src/managed-lazy-getters.ts +106 -0
  51. package/src/managed-main.ts +822 -0
  52. package/src/materializers/local-oauth-lookup.ts +98 -0
  53. package/src/materializers/local-token-refresh.ts +287 -0
  54. package/src/materializers/local.ts +316 -0
  55. package/src/materializers/managed-platform.ts +295 -0
  56. package/src/paths.ts +20 -4
  57. package/src/server.ts +469 -52
  58. package/src/subjects/local.ts +177 -0
  59. package/src/subjects/managed.ts +311 -0
  60. package/src/subjects/policy.ts +79 -0
  61. package/src/toolstore/integrity.ts +94 -0
  62. package/src/toolstore/manifest.ts +154 -0
  63. package/src/toolstore/publish.ts +571 -0
  64. package/node_modules/@vellumai/service-contracts/src/__tests__/attachment-naming.test.ts +0 -104
  65. package/node_modules/@vellumai/service-contracts/src/attachment-naming.ts +0 -118
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Managed CES reconnection test (real entrypoint subprocess).
3
3
  *
4
- * Spawns the actual `main.ts` entrypoint and verifies that the CES
4
+ * Spawns the actual `managed-main.ts` entrypoint and verifies that the CES
5
5
  * sidecar survives the assistant disconnecting and accepts a reconnection,
6
6
  * rather than shutting down when the RPC stream ends.
7
7
  *
@@ -179,7 +179,7 @@ describe("managed CES reconnection (real entrypoint)", () => {
179
179
  mkdirSync(join(assistantDataMount, ".vellum"), { recursive: true });
180
180
 
181
181
  const healthPort = await pickFreePort();
182
- const managedMain = resolve(__dirname, "..", "main.ts");
182
+ const managedMain = resolve(__dirname, "..", "managed-main.ts");
183
183
 
184
184
  proc = Bun.spawn({
185
185
  cmd: [process.execPath, managedMain],
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Managed-mode local_static handle rejection contract tests.
3
+ *
4
+ * Validates that the MANAGED_LOCAL_STATIC_REJECTION_ERROR constant used by
5
+ * managed-main.ts contains the expected contract fragments. These tests
6
+ * import the actual production constant (not a test-local copy), so they
7
+ * will fail if the error message drifts away from the expected contract.
8
+ */
9
+
10
+ import { describe, expect, test } from "bun:test";
11
+
12
+ import { HandleType, localStaticHandle, parseHandle } from "@vellumai/service-contracts/credential-rpc";
13
+
14
+ import { MANAGED_LOCAL_STATIC_REJECTION_ERROR } from "../managed-errors.js";
15
+
16
+ describe("managed-mode local_static rejection error", () => {
17
+ test("error message references platform_oauth as the alternative", () => {
18
+ expect(MANAGED_LOCAL_STATIC_REJECTION_ERROR).toContain("platform_oauth");
19
+ });
20
+
21
+ test("error message references managed mode", () => {
22
+ expect(MANAGED_LOCAL_STATIC_REJECTION_ERROR).toContain("managed");
23
+ });
24
+
25
+ test("error message mentions local_static handles are not supported", () => {
26
+ expect(MANAGED_LOCAL_STATIC_REJECTION_ERROR).toContain(
27
+ "local_static credential handles are not supported",
28
+ );
29
+ });
30
+
31
+ test("error message ends with a period", () => {
32
+ expect(MANAGED_LOCAL_STATIC_REJECTION_ERROR).toMatch(/\.$/);
33
+ });
34
+
35
+ test("local_static handle is correctly identified for rejection", () => {
36
+ const handle = localStaticHandle("github", "api_key");
37
+ const result = parseHandle(handle);
38
+ expect(result.ok).toBe(true);
39
+ if (result.ok) {
40
+ expect(result.handle.type).toBe(HandleType.LocalStatic);
41
+ }
42
+ });
43
+ });