@vellumai/vellum-gateway 0.6.4 → 0.6.5
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/ARCHITECTURE.md +20 -20
- package/Dockerfile +17 -4
- package/bun.lock +141 -0
- package/knip.json +2 -1
- package/package.json +5 -1
- package/src/__tests__/cloud-oauth-token.test.ts +206 -0
- package/src/__tests__/config-file-cache.test.ts +9 -27
- package/src/__tests__/credential-reader.test.ts +19 -22
- package/src/__tests__/credential-watcher.test.ts +29 -8
- package/src/__tests__/data-migration-m0001-guardian-init-lock.test.ts +130 -0
- package/src/__tests__/feature-flags-route.test.ts +7 -21
- package/src/__tests__/ipc-contact-routes.test.ts +115 -101
- package/src/__tests__/ipc-feature-flag-routes.test.ts +6 -26
- package/src/__tests__/ipc-socket-path.test.ts +71 -0
- package/src/__tests__/privacy-config-route.test.ts +7 -27
- package/src/__tests__/rate-limit-loopback.test.ts +73 -0
- package/src/__tests__/remote-feature-flag-sync.test.ts +93 -53
- package/src/__tests__/route-schema-guard.test.ts +2 -0
- package/src/__tests__/test-preload.ts +73 -9
- package/src/__tests__/trust-rules-routes.test.ts +307 -0
- package/src/__tests__/trust-store.test.ts +810 -0
- package/src/avatar-sync/avatar-sync-watcher.ts +6 -0
- package/src/channels/inbound-event.ts +6 -0
- package/src/config-file-watcher.ts +6 -0
- package/src/credential-watcher.ts +10 -0
- package/src/db/connection.ts +68 -83
- package/src/db/contact-store.ts +48 -136
- package/src/db/data-migrations/m0001-guardian-init-lock.ts +16 -14
- package/src/db/schema.ts +86 -0
- package/src/db/slack-store.ts +49 -52
- package/src/feature-flag-registry.json +25 -9
- package/src/feature-flag-watcher.ts +6 -0
- package/src/handlers/handle-inbound.ts +1 -0
- package/src/http/middleware/rate-limit.ts +20 -0
- package/src/http/routes/cloud-oauth-token.ts +130 -0
- package/src/http/routes/migration-proxy.ts +459 -50
- package/src/http/routes/slack-control-plane-proxy.ts +19 -1
- package/src/http/routes/trust-rules.ts +50 -27
- package/src/index.ts +59 -56
- package/src/ipc/contact-handlers.ts +4 -2
- package/src/ipc/server.ts +27 -7
- package/src/ipc/socket-path.ts +100 -0
- package/src/remote-feature-flag-sync.ts +151 -31
- package/src/schema.ts +117 -4
- package/src/slack/normalize.test.ts +765 -18
- package/src/slack/normalize.ts +187 -17
- package/src/slack/socket-mode.ts +114 -14
- package/src/trust-store.ts +116 -74
- package/src/slack/dm-context.test.ts +0 -170
- package/src/slack/dm-context.ts +0 -135
- package/src/slack/thread-context.test.ts +0 -204
- package/src/slack/thread-context.ts +0 -153
package/ARCHITECTURE.md
CHANGED
|
@@ -61,12 +61,12 @@ Native clients (macOS, iOS) open WebSocket connections through the gateway to th
|
|
|
61
61
|
|
|
62
62
|
**Query parameters:**
|
|
63
63
|
|
|
64
|
-
| Parameter | Required | Description
|
|
65
|
-
| ------------ | -------- |
|
|
66
|
-
| `mimeType` | Yes | MIME type of the audio being streamed (e.g. `audio/webm;codecs=opus`)
|
|
67
|
-
| `provider` | No | Optional STT provider identifier (`deepgram`, `google-gemini`). Forwarded as compatibility metadata — the runtime resolves the transcriber from config, not from this parameter. |
|
|
68
|
-
| `sampleRate` | No | Sample rate in Hz (e.g. `16000`). Passed through to the daemon.
|
|
69
|
-
| `token` | No | Edge JWT (alternative to `Authorization: Bearer` header for WS upgrades)
|
|
64
|
+
| Parameter | Required | Description |
|
|
65
|
+
| ------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
66
|
+
| `mimeType` | Yes | MIME type of the audio being streamed (e.g. `audio/webm;codecs=opus`) |
|
|
67
|
+
| `provider` | No | Optional STT provider identifier (`deepgram`, `google-gemini`, `openai-whisper`, `xai`). Forwarded as compatibility metadata — the runtime resolves the transcriber from config, not from this parameter. |
|
|
68
|
+
| `sampleRate` | No | Sample rate in Hz (e.g. `16000`). Passed through to the daemon. |
|
|
69
|
+
| `token` | No | Edge JWT (alternative to `Authorization: Bearer` header for WS upgrades) |
|
|
70
70
|
|
|
71
71
|
**Auth model:** STT streaming is an authenticated, assistant-scoped path. The client must present a valid edge JWT with an actor principal. Service tokens are rejected. When `runtimeProxyRequireAuth` is globally disabled (dev bypass), the upgrade proceeds without token validation.
|
|
72
72
|
|
|
@@ -1103,20 +1103,20 @@ Malformed or unprocessable provider callback payloads are logged as dead-letter
|
|
|
1103
1103
|
|
|
1104
1104
|
Call behavior is controlled via the `calls` config block in the assistant configuration (`config/schema.ts`). All values have sensible defaults and are validated via Zod:
|
|
1105
1105
|
|
|
1106
|
-
| Field | Type | Default
|
|
1107
|
-
| --------------------------------- | -------- |
|
|
1108
|
-
| `calls.enabled` | boolean | `true`
|
|
1109
|
-
| `calls.provider` | enum | `'twilio'`
|
|
1110
|
-
| `calls.maxDurationSeconds` | int | `3600`
|
|
1111
|
-
| `calls.userConsultTimeoutSeconds` | int | `120`
|
|
1112
|
-
| `calls.disclosure.enabled` | boolean | `true`
|
|
1113
|
-
| `calls.disclosure.text` | string | _(default disclosure prompt)_
|
|
1114
|
-
| `calls.safety.denyCategories` | string[] | `[]`
|
|
1115
|
-
| `
|
|
1116
|
-
| `calls.voice.language` | string | `'en-US'`
|
|
1117
|
-
| `services.stt.provider` | enum | `'deepgram'`
|
|
1118
|
-
| `services.tts.provider` | enum | `'elevenlabs'`
|
|
1119
|
-
| `services.tts.providers.<id>.*` | object | _(per-provider defaults)_
|
|
1106
|
+
| Field | Type | Default | Description |
|
|
1107
|
+
| --------------------------------- | -------- | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1108
|
+
| `calls.enabled` | boolean | `true` | Master toggle for the calls feature. When `false`, call routes return 403 and tools return errors. |
|
|
1109
|
+
| `calls.provider` | enum | `'twilio'` | Voice provider to use (currently only Twilio is supported). |
|
|
1110
|
+
| `calls.maxDurationSeconds` | int | `3600` | Maximum allowed duration per call. |
|
|
1111
|
+
| `calls.userConsultTimeoutSeconds` | int | `120` | How long to wait for a user answer before timing out a pending question. |
|
|
1112
|
+
| `calls.disclosure.enabled` | boolean | `true` | Whether the AI should disclose it is an AI at the start of the call. |
|
|
1113
|
+
| `calls.disclosure.text` | string | _(default disclosure prompt)_ | The disclosure instruction included in the system prompt. |
|
|
1114
|
+
| `calls.safety.denyCategories` | string[] | `[]` | Categories of calls to deny (e.g., emergency numbers are always denied regardless of this setting). |
|
|
1115
|
+
| `llm.callSites.callAgent.model` | string | _(unset — falls back to `llm.default.model`)_ | Optional override for the LLM model used in voice call conversations. |
|
|
1116
|
+
| `calls.voice.language` | string | `'en-US'` | Language code for TTS and transcription. |
|
|
1117
|
+
| `services.stt.provider` | enum | `'deepgram'` | STT provider for all boundaries including telephony. Determines the Twilio integration path (ConversationRelay-native for `deepgram`/`google-gemini`, media-stream for `openai-whisper`/`xai`). |
|
|
1118
|
+
| `services.tts.provider` | enum | `'elevenlabs'` | Active TTS provider for speech synthesis (catalog-driven; see [TTS Provider Abstraction](../assistant/ARCHITECTURE.md#tts-provider-abstraction-servicestts)). |
|
|
1119
|
+
| `services.tts.providers.<id>.*` | object | _(per-provider defaults)_ | Provider-specific settings block. One block per catalog entry (e.g. `elevenlabs`, `fish-audio`). |
|
|
1120
1120
|
|
|
1121
1121
|
### Caller Identity Resolution
|
|
1122
1122
|
|
package/Dockerfile
CHANGED
|
@@ -8,10 +8,15 @@ WORKDIR /app
|
|
|
8
8
|
|
|
9
9
|
COPY --from=bun /usr/local/bin/bun /usr/local/bin/bun
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
# Copy shared packages needed by gateway's repo-local dependencies
|
|
12
|
+
COPY packages/ces-contracts ./packages/ces-contracts
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
# Install gateway dependencies first for cache reuse
|
|
15
|
+
COPY gateway/package.json gateway/bun.lock ./gateway/
|
|
16
|
+
RUN cd /app/gateway && bun install --frozen-lockfile --production
|
|
17
|
+
|
|
18
|
+
# Copy source
|
|
19
|
+
COPY gateway ./gateway
|
|
15
20
|
|
|
16
21
|
# Runtime stage
|
|
17
22
|
FROM debian:trixie-slim@sha256:4ffb3a1511099754cddc70eb1b12e50ffdb67619aa0ab6c13fcd800a78ef7c7a AS runner
|
|
@@ -30,7 +35,15 @@ COPY --from=builder /usr/local/bin/bun /usr/local/bin/bun
|
|
|
30
35
|
RUN groupadd --system --gid 1001 gateway && \
|
|
31
36
|
useradd --system --uid 1001 --gid gateway --create-home gateway
|
|
32
37
|
|
|
33
|
-
COPY --from=builder --chown=gateway:gateway /app /app
|
|
38
|
+
COPY --from=builder --chown=gateway:gateway /app/gateway /app
|
|
39
|
+
# `bun install` materializes `file:../packages/ces-contracts` as a
|
|
40
|
+
# `node_modules/@vellumai/ces-contracts/` directory whose files are symlinks
|
|
41
|
+
# pointing at absolute `/app/packages/ces-contracts/...` source paths in
|
|
42
|
+
# the builder. Those absolute targets have to exist in the runner too, or
|
|
43
|
+
# every `@vellumai/ces-contracts[/…]` import resolves to a dangling link
|
|
44
|
+
# and the gateway crashes with "Cannot find module ..." at first use.
|
|
45
|
+
# Copy the sibling package into the runner so the symlinks resolve.
|
|
46
|
+
COPY --from=builder --chown=gateway:gateway /app/packages /app/packages
|
|
34
47
|
|
|
35
48
|
RUN mkdir -p /gateway-security && chown gateway:gateway /gateway-security
|
|
36
49
|
|
package/bun.lock
CHANGED
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
"": {
|
|
6
6
|
"name": "vellum-gateway",
|
|
7
7
|
"dependencies": {
|
|
8
|
+
"@vellumai/ces-contracts": "file:../packages/ces-contracts",
|
|
9
|
+
"drizzle-kit": "0.30.6",
|
|
10
|
+
"drizzle-orm": "0.45.2",
|
|
8
11
|
"file-type": "21.3.0",
|
|
9
12
|
"minimatch": "10.2.4",
|
|
10
13
|
"pino": "9.14.0",
|
|
@@ -25,12 +28,64 @@
|
|
|
25
28
|
"packages": {
|
|
26
29
|
"@borewit/text-codec": ["@borewit/text-codec@0.2.1", "", {}, "sha512-k7vvKPbf7J2fZ5klGRD9AeKfUvojuZIQ3BT5u7Jfv+puwXkUBUT5PVyMDfJZpy30CBDXGMgw7fguK/lpOMBvgw=="],
|
|
27
30
|
|
|
31
|
+
"@drizzle-team/brocli": ["@drizzle-team/brocli@0.10.2", "", {}, "sha512-z33Il7l5dKjUgGULTqBsQBQwckHh5AbIuxhdsIxDDiZAzBOrZO6q9ogcWC65kU382AfynTfgNumVcNIjuIua6w=="],
|
|
32
|
+
|
|
28
33
|
"@emnapi/core": ["@emnapi/core@1.8.1", "", { "dependencies": { "@emnapi/wasi-threads": "1.1.0", "tslib": "^2.4.0" } }, "sha512-AvT9QFpxK0Zd8J0jopedNm+w/2fIzvtPKPjqyw9jwvBaReTTqPBk9Hixaz7KbjimP+QNz605/XnjFcDAL2pqBg=="],
|
|
29
34
|
|
|
30
35
|
"@emnapi/runtime": ["@emnapi/runtime@1.8.1", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg=="],
|
|
31
36
|
|
|
32
37
|
"@emnapi/wasi-threads": ["@emnapi/wasi-threads@1.1.0", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ=="],
|
|
33
38
|
|
|
39
|
+
"@esbuild-kit/core-utils": ["@esbuild-kit/core-utils@3.3.2", "", { "dependencies": { "esbuild": "~0.18.20", "source-map-support": "^0.5.21" } }, "sha512-sPRAnw9CdSsRmEtnsl2WXWdyquogVpB3yZ3dgwJfe8zrOzTsV7cJvmwrKVa+0ma5BoiGJ+BoqkMvawbayKUsqQ=="],
|
|
40
|
+
|
|
41
|
+
"@esbuild-kit/esm-loader": ["@esbuild-kit/esm-loader@2.6.5", "", { "dependencies": { "@esbuild-kit/core-utils": "^3.3.2", "get-tsconfig": "^4.7.0" } }, "sha512-FxEMIkJKnodyA1OaCUoEvbYRkoZlLZ4d/eXFu9Fh8CbBBgP5EmZxrfTRyN0qpXZ4vOvqnE5YdRdcrmUUXuU+dA=="],
|
|
42
|
+
|
|
43
|
+
"@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.19.12", "", { "os": "aix", "cpu": "ppc64" }, "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA=="],
|
|
44
|
+
|
|
45
|
+
"@esbuild/android-arm": ["@esbuild/android-arm@0.19.12", "", { "os": "android", "cpu": "arm" }, "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w=="],
|
|
46
|
+
|
|
47
|
+
"@esbuild/android-arm64": ["@esbuild/android-arm64@0.19.12", "", { "os": "android", "cpu": "arm64" }, "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA=="],
|
|
48
|
+
|
|
49
|
+
"@esbuild/android-x64": ["@esbuild/android-x64@0.19.12", "", { "os": "android", "cpu": "x64" }, "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew=="],
|
|
50
|
+
|
|
51
|
+
"@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.19.12", "", { "os": "darwin", "cpu": "arm64" }, "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g=="],
|
|
52
|
+
|
|
53
|
+
"@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.19.12", "", { "os": "darwin", "cpu": "x64" }, "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A=="],
|
|
54
|
+
|
|
55
|
+
"@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.19.12", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA=="],
|
|
56
|
+
|
|
57
|
+
"@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.19.12", "", { "os": "freebsd", "cpu": "x64" }, "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg=="],
|
|
58
|
+
|
|
59
|
+
"@esbuild/linux-arm": ["@esbuild/linux-arm@0.19.12", "", { "os": "linux", "cpu": "arm" }, "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w=="],
|
|
60
|
+
|
|
61
|
+
"@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.19.12", "", { "os": "linux", "cpu": "arm64" }, "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA=="],
|
|
62
|
+
|
|
63
|
+
"@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.19.12", "", { "os": "linux", "cpu": "ia32" }, "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA=="],
|
|
64
|
+
|
|
65
|
+
"@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.19.12", "", { "os": "linux", "cpu": "none" }, "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA=="],
|
|
66
|
+
|
|
67
|
+
"@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.19.12", "", { "os": "linux", "cpu": "none" }, "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w=="],
|
|
68
|
+
|
|
69
|
+
"@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.19.12", "", { "os": "linux", "cpu": "ppc64" }, "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg=="],
|
|
70
|
+
|
|
71
|
+
"@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.19.12", "", { "os": "linux", "cpu": "none" }, "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg=="],
|
|
72
|
+
|
|
73
|
+
"@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.19.12", "", { "os": "linux", "cpu": "s390x" }, "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg=="],
|
|
74
|
+
|
|
75
|
+
"@esbuild/linux-x64": ["@esbuild/linux-x64@0.19.12", "", { "os": "linux", "cpu": "x64" }, "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg=="],
|
|
76
|
+
|
|
77
|
+
"@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.19.12", "", { "os": "none", "cpu": "x64" }, "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA=="],
|
|
78
|
+
|
|
79
|
+
"@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.19.12", "", { "os": "openbsd", "cpu": "x64" }, "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw=="],
|
|
80
|
+
|
|
81
|
+
"@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.19.12", "", { "os": "sunos", "cpu": "x64" }, "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA=="],
|
|
82
|
+
|
|
83
|
+
"@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.19.12", "", { "os": "win32", "cpu": "arm64" }, "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A=="],
|
|
84
|
+
|
|
85
|
+
"@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.19.12", "", { "os": "win32", "cpu": "ia32" }, "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ=="],
|
|
86
|
+
|
|
87
|
+
"@esbuild/win32-x64": ["@esbuild/win32-x64@0.19.12", "", { "os": "win32", "cpu": "x64" }, "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA=="],
|
|
88
|
+
|
|
34
89
|
"@eslint-community/eslint-utils": ["@eslint-community/eslint-utils@4.9.1", "", { "dependencies": { "eslint-visitor-keys": "^3.4.3" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ=="],
|
|
35
90
|
|
|
36
91
|
"@eslint-community/regexpp": ["@eslint-community/regexpp@4.12.2", "", {}, "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew=="],
|
|
@@ -103,6 +158,8 @@
|
|
|
103
158
|
|
|
104
159
|
"@oxc-resolver/binding-win32-x64-msvc": ["@oxc-resolver/binding-win32-x64-msvc@11.17.1", "", { "os": "win32", "cpu": "x64" }, "sha512-jRPVU+6/12baj87q2+UGRh30FBVBzqKdJ7rP/mSqiL1kpNQB9yZ1j0+m3sru1m+C8hiFK7lBFwjUtYUBI7+UpQ=="],
|
|
105
160
|
|
|
161
|
+
"@petamoriken/float16": ["@petamoriken/float16@3.9.3", "", {}, "sha512-8awtpHXCx/bNpFt4mt2xdkgtgVvKqty8VbjHI/WWWQuEw+KLzFot3f4+LkQY9YmOtq7A5GdOnqoIC8Pdygjk2g=="],
|
|
162
|
+
|
|
106
163
|
"@pinojs/redact": ["@pinojs/redact@0.4.0", "", {}, "sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg=="],
|
|
107
164
|
|
|
108
165
|
"@tokenizer/inflate": ["@tokenizer/inflate@0.4.1", "", { "dependencies": { "debug": "^4.4.3", "token-types": "^6.1.1" } }, "sha512-2mAv+8pkG6GIZiF1kNg1jAjh27IDxEPKwdGul3snfztFerfPGI1LjDezZp3i7BElXompqEtPmoPx6c2wgtWsOA=="],
|
|
@@ -121,6 +178,8 @@
|
|
|
121
178
|
|
|
122
179
|
"@types/node": ["@types/node@25.2.3", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-m0jEgYlYz+mDJZ2+F4v8D1AyQb+QzsNqRuI7xg1VQX/KlKS0qT9r1Mo16yo5F/MtifXFgaofIFsdFMox2SxIbQ=="],
|
|
123
180
|
|
|
181
|
+
"@types/ws": ["@types/ws@8.5.14", "", { "dependencies": { "@types/node": "*" } }, "sha512-bd/YFLW+URhBzMXurx7lWByOu+xzU9+kb3RboOteXYDfW+tr+JZa99OyNmPINEGB/ahzKrEuc8rcv4gnpJmxTw=="],
|
|
182
|
+
|
|
124
183
|
"@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.56.0", "", { "dependencies": { "@eslint-community/regexpp": "^4.12.2", "@typescript-eslint/scope-manager": "8.56.0", "@typescript-eslint/type-utils": "8.56.0", "@typescript-eslint/utils": "8.56.0", "@typescript-eslint/visitor-keys": "8.56.0", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.4.0" }, "peerDependencies": { "@typescript-eslint/parser": "^8.56.0", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-lRyPDLzNCuae71A3t9NEINBiTn7swyOhvUj3MyUOxb8x6g6vPEFoOU+ZRmGMusNC3X3YMhqMIX7i8ShqhT74Pw=="],
|
|
125
184
|
|
|
126
185
|
"@typescript-eslint/parser": ["@typescript-eslint/parser@8.56.0", "", { "dependencies": { "@typescript-eslint/scope-manager": "8.56.0", "@typescript-eslint/types": "8.56.0", "@typescript-eslint/typescript-estree": "8.56.0", "@typescript-eslint/visitor-keys": "8.56.0", "debug": "^4.4.3" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-IgSWvLobTDOjnaxAfDTIHaECbkNlAlKv2j5SjpB2v7QHKv1FIfjwMy8FsDbVfDX/KjmCmYICcw7uGaXLhtsLNg=="],
|
|
@@ -141,6 +200,8 @@
|
|
|
141
200
|
|
|
142
201
|
"@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.56.0", "", { "dependencies": { "@typescript-eslint/types": "8.56.0", "eslint-visitor-keys": "^5.0.0" } }, "sha512-q+SL+b+05Ud6LbEE35qe4A99P+htKTKVbyiNEe45eCbJFyh/HVK9QXwlrbz+Q4L8SOW4roxSVwXYj4DMBT7Ieg=="],
|
|
143
202
|
|
|
203
|
+
"@vellumai/ces-contracts": ["@vellumai/ces-contracts@file:../packages/ces-contracts", { "dependencies": { "zod": "4.3.6" }, "devDependencies": { "@types/bun": "1.2.4", "typescript": "5.7.3" } }],
|
|
204
|
+
|
|
144
205
|
"acorn": ["acorn@8.15.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg=="],
|
|
145
206
|
|
|
146
207
|
"acorn-jsx": ["acorn-jsx@5.3.2", "", { "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ=="],
|
|
@@ -157,6 +218,8 @@
|
|
|
157
218
|
|
|
158
219
|
"braces": ["braces@3.0.3", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="],
|
|
159
220
|
|
|
221
|
+
"buffer-from": ["buffer-from@1.1.2", "", {}, "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="],
|
|
222
|
+
|
|
160
223
|
"bun-types": ["bun-types@1.3.9", "", { "dependencies": { "@types/node": "*" } }, "sha512-+UBWWOakIP4Tswh0Bt0QD0alpTY8cb5hvgiYeWCMet9YukHbzuruIEeXC2D7nMJPB12kbh8C7XJykSexEqGKJg=="],
|
|
161
224
|
|
|
162
225
|
"colorette": ["colorette@2.0.20", "", {}, "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w=="],
|
|
@@ -169,8 +232,18 @@
|
|
|
169
232
|
|
|
170
233
|
"deep-is": ["deep-is@0.1.4", "", {}, "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="],
|
|
171
234
|
|
|
235
|
+
"drizzle-kit": ["drizzle-kit@0.30.6", "", { "dependencies": { "@drizzle-team/brocli": "^0.10.2", "@esbuild-kit/esm-loader": "^2.5.5", "esbuild": "^0.19.7", "esbuild-register": "^3.5.0", "gel": "^2.0.0" }, "bin": { "drizzle-kit": "bin.cjs" } }, "sha512-U4wWit0fyZuGuP7iNmRleQyK2V8wCuv57vf5l3MnG4z4fzNTjY/U13M8owyQ5RavqvqxBifWORaR3wIUzlN64g=="],
|
|
236
|
+
|
|
237
|
+
"drizzle-orm": ["drizzle-orm@0.45.2", "", { "peerDependencies": { "@aws-sdk/client-rds-data": ">=3", "@cloudflare/workers-types": ">=4", "@electric-sql/pglite": ">=0.2.0", "@libsql/client": ">=0.10.0", "@libsql/client-wasm": ">=0.10.0", "@neondatabase/serverless": ">=0.10.0", "@op-engineering/op-sqlite": ">=2", "@opentelemetry/api": "^1.4.1", "@planetscale/database": ">=1.13", "@prisma/client": "*", "@tidbcloud/serverless": "*", "@types/better-sqlite3": "*", "@types/pg": "*", "@types/sql.js": "*", "@upstash/redis": ">=1.34.7", "@vercel/postgres": ">=0.8.0", "@xata.io/client": "*", "better-sqlite3": ">=7", "bun-types": "*", "expo-sqlite": ">=14.0.0", "gel": ">=2", "knex": "*", "kysely": "*", "mysql2": ">=2", "pg": ">=8", "postgres": ">=3", "sql.js": ">=1", "sqlite3": ">=5" }, "optionalPeers": ["@aws-sdk/client-rds-data", "@cloudflare/workers-types", "@electric-sql/pglite", "@libsql/client", "@libsql/client-wasm", "@neondatabase/serverless", "@op-engineering/op-sqlite", "@opentelemetry/api", "@planetscale/database", "@prisma/client", "@tidbcloud/serverless", "@types/better-sqlite3", "@types/pg", "@types/sql.js", "@upstash/redis", "@vercel/postgres", "@xata.io/client", "better-sqlite3", "bun-types", "expo-sqlite", "gel", "knex", "kysely", "mysql2", "pg", "postgres", "sql.js", "sqlite3"] }, "sha512-kY0BSaTNYWnoDMVoyY8uxmyHjpJW1geOmBMdSSicKo9CIIWkSxMIj2rkeSR51b8KAPB7m+qysjuHme5nKP+E5Q=="],
|
|
238
|
+
|
|
172
239
|
"end-of-stream": ["end-of-stream@1.4.5", "", { "dependencies": { "once": "^1.4.0" } }, "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg=="],
|
|
173
240
|
|
|
241
|
+
"env-paths": ["env-paths@3.0.0", "", {}, "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A=="],
|
|
242
|
+
|
|
243
|
+
"esbuild": ["esbuild@0.19.12", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.19.12", "@esbuild/android-arm": "0.19.12", "@esbuild/android-arm64": "0.19.12", "@esbuild/android-x64": "0.19.12", "@esbuild/darwin-arm64": "0.19.12", "@esbuild/darwin-x64": "0.19.12", "@esbuild/freebsd-arm64": "0.19.12", "@esbuild/freebsd-x64": "0.19.12", "@esbuild/linux-arm": "0.19.12", "@esbuild/linux-arm64": "0.19.12", "@esbuild/linux-ia32": "0.19.12", "@esbuild/linux-loong64": "0.19.12", "@esbuild/linux-mips64el": "0.19.12", "@esbuild/linux-ppc64": "0.19.12", "@esbuild/linux-riscv64": "0.19.12", "@esbuild/linux-s390x": "0.19.12", "@esbuild/linux-x64": "0.19.12", "@esbuild/netbsd-x64": "0.19.12", "@esbuild/openbsd-x64": "0.19.12", "@esbuild/sunos-x64": "0.19.12", "@esbuild/win32-arm64": "0.19.12", "@esbuild/win32-ia32": "0.19.12", "@esbuild/win32-x64": "0.19.12" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg=="],
|
|
244
|
+
|
|
245
|
+
"esbuild-register": ["esbuild-register@3.6.0", "", { "dependencies": { "debug": "^4.3.4" }, "peerDependencies": { "esbuild": ">=0.12 <1" } }, "sha512-H2/S7Pm8a9CL1uhp9OvjwrBh5Pvx0H8qVOxNu8Wed9Y7qv56MPtq+GGM8RJpq6glYJn9Wspr8uw7l55uyinNeg=="],
|
|
246
|
+
|
|
174
247
|
"escape-string-regexp": ["escape-string-regexp@4.0.0", "", {}, "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="],
|
|
175
248
|
|
|
176
249
|
"eslint": ["eslint@10.0.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.2", "@eslint/config-array": "^0.23.0", "@eslint/config-helpers": "^0.5.2", "@eslint/core": "^1.1.0", "@eslint/plugin-kit": "^0.6.0", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", "ajv": "^6.12.4", "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^9.1.0", "eslint-visitor-keys": "^5.0.0", "espree": "^11.1.0", "esquery": "^1.7.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", "minimatch": "^10.1.1", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, "peerDependencies": { "jiti": "*" }, "optionalPeers": ["jiti"], "bin": { "eslint": "bin/eslint.js" } }, "sha512-O0piBKY36YSJhlFSG8p9VUdPV/SxxS4FYDWVpr/9GJuMaepzwlf4J8I4ov1b+ySQfDTPhc3DtLaxcT1fN0yqCg=="],
|
|
@@ -221,6 +294,10 @@
|
|
|
221
294
|
|
|
222
295
|
"formatly": ["formatly@0.3.0", "", { "dependencies": { "fd-package-json": "^2.0.0" }, "bin": { "formatly": "bin/index.mjs" } }, "sha512-9XNj/o4wrRFyhSMJOvsuyMwy8aUfBaZ1VrqHVfohyXf0Sw0e+yfKG+xZaY3arGCOMdwFsqObtzVOc1gU9KiT9w=="],
|
|
223
296
|
|
|
297
|
+
"gel": ["gel@2.2.0", "", { "dependencies": { "@petamoriken/float16": "^3.8.7", "debug": "^4.3.4", "env-paths": "^3.0.0", "semver": "^7.6.2", "shell-quote": "^1.8.1", "which": "^4.0.0" }, "bin": { "gel": "dist/cli.mjs" } }, "sha512-q0ma7z2swmoamHQusey8ayo8+ilVdzDt4WTxSPzq/yRqvucWRfymRVMvNgmSC0XK7eNjjEZEcplxpgaNojKdmQ=="],
|
|
298
|
+
|
|
299
|
+
"get-tsconfig": ["get-tsconfig@4.14.0", "", { "dependencies": { "resolve-pkg-maps": "^1.0.0" } }, "sha512-yTb+8DXzDREzgvYmh6s9vHsSVCHeC0G3PI5bEXNBHtmshPnO+S5O7qgLEOn0I5QvMy6kpZN8K1NKGyilLb93wA=="],
|
|
300
|
+
|
|
224
301
|
"glob-parent": ["glob-parent@6.0.2", "", { "dependencies": { "is-glob": "^4.0.3" } }, "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A=="],
|
|
225
302
|
|
|
226
303
|
"help-me": ["help-me@5.0.0", "", {}, "sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg=="],
|
|
@@ -317,6 +394,8 @@
|
|
|
317
394
|
|
|
318
395
|
"real-require": ["real-require@0.2.0", "", {}, "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg=="],
|
|
319
396
|
|
|
397
|
+
"resolve-pkg-maps": ["resolve-pkg-maps@1.0.0", "", {}, "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw=="],
|
|
398
|
+
|
|
320
399
|
"reusify": ["reusify@1.1.0", "", {}, "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw=="],
|
|
321
400
|
|
|
322
401
|
"run-parallel": ["run-parallel@1.2.0", "", { "dependencies": { "queue-microtask": "^1.2.2" } }, "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA=="],
|
|
@@ -331,10 +410,16 @@
|
|
|
331
410
|
|
|
332
411
|
"shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="],
|
|
333
412
|
|
|
413
|
+
"shell-quote": ["shell-quote@1.8.3", "", {}, "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw=="],
|
|
414
|
+
|
|
334
415
|
"smol-toml": ["smol-toml@1.6.0", "", {}, "sha512-4zemZi0HvTnYwLfrpk/CF9LOd9Lt87kAt50GnqhMpyF9U3poDAP2+iukq2bZsO/ufegbYehBkqINbsWxj4l4cw=="],
|
|
335
416
|
|
|
336
417
|
"sonic-boom": ["sonic-boom@4.2.1", "", { "dependencies": { "atomic-sleep": "^1.0.0" } }, "sha512-w6AxtubXa2wTXAUsZMMWERrsIRAdrK0Sc+FUytWvYAhBJLyuI4llrMIC1DtlNSdI99EI86KZum2MMq3EAZlF9Q=="],
|
|
337
418
|
|
|
419
|
+
"source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="],
|
|
420
|
+
|
|
421
|
+
"source-map-support": ["source-map-support@0.5.21", "", { "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w=="],
|
|
422
|
+
|
|
338
423
|
"split2": ["split2@4.2.0", "", {}, "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg=="],
|
|
339
424
|
|
|
340
425
|
"strip-json-comments": ["strip-json-comments@5.0.3", "", {}, "sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw=="],
|
|
@@ -379,6 +464,8 @@
|
|
|
379
464
|
|
|
380
465
|
"zod": ["zod@4.3.6", "", {}, "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg=="],
|
|
381
466
|
|
|
467
|
+
"@esbuild-kit/core-utils/esbuild": ["esbuild@0.18.20", "", { "optionalDependencies": { "@esbuild/android-arm": "0.18.20", "@esbuild/android-arm64": "0.18.20", "@esbuild/android-x64": "0.18.20", "@esbuild/darwin-arm64": "0.18.20", "@esbuild/darwin-x64": "0.18.20", "@esbuild/freebsd-arm64": "0.18.20", "@esbuild/freebsd-x64": "0.18.20", "@esbuild/linux-arm": "0.18.20", "@esbuild/linux-arm64": "0.18.20", "@esbuild/linux-ia32": "0.18.20", "@esbuild/linux-loong64": "0.18.20", "@esbuild/linux-mips64el": "0.18.20", "@esbuild/linux-ppc64": "0.18.20", "@esbuild/linux-riscv64": "0.18.20", "@esbuild/linux-s390x": "0.18.20", "@esbuild/linux-x64": "0.18.20", "@esbuild/netbsd-x64": "0.18.20", "@esbuild/openbsd-x64": "0.18.20", "@esbuild/sunos-x64": "0.18.20", "@esbuild/win32-arm64": "0.18.20", "@esbuild/win32-ia32": "0.18.20", "@esbuild/win32-x64": "0.18.20" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA=="],
|
|
468
|
+
|
|
382
469
|
"@eslint-community/eslint-utils/eslint-visitor-keys": ["eslint-visitor-keys@3.4.3", "", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="],
|
|
383
470
|
|
|
384
471
|
"@eslint/config-array/minimatch": ["minimatch@10.2.0", "", { "dependencies": { "brace-expansion": "^5.0.2" } }, "sha512-ugkC31VaVg9cF0DFVoADH12k6061zNZkZON+aX8AWsR9GhPcErkcMBceb6znR8wLERM2AkkOxy2nWRLpT9Jq5w=="],
|
|
@@ -387,16 +474,70 @@
|
|
|
387
474
|
|
|
388
475
|
"@typescript-eslint/typescript-estree/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
|
|
389
476
|
|
|
477
|
+
"@vellumai/ces-contracts/@types/bun": ["@types/bun@1.2.4", "", { "dependencies": { "bun-types": "1.2.4" } }, "sha512-QtuV5OMR8/rdKJs213iwXDpfVvnskPXY/S0ZiFbsTjQZycuqPbMW8Gf/XhLfwE5njW8sxI2WjISURXPlHypMFA=="],
|
|
478
|
+
|
|
479
|
+
"@vellumai/ces-contracts/typescript": ["typescript@5.7.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw=="],
|
|
480
|
+
|
|
390
481
|
"eslint/minimatch": ["minimatch@10.2.0", "", { "dependencies": { "brace-expansion": "^5.0.2" } }, "sha512-ugkC31VaVg9cF0DFVoADH12k6061zNZkZON+aX8AWsR9GhPcErkcMBceb6znR8wLERM2AkkOxy2nWRLpT9Jq5w=="],
|
|
391
482
|
|
|
392
483
|
"fast-glob/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="],
|
|
393
484
|
|
|
485
|
+
"gel/which": ["which@4.0.0", "", { "dependencies": { "isexe": "^3.1.1" }, "bin": { "node-which": "bin/which.js" } }, "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg=="],
|
|
486
|
+
|
|
394
487
|
"micromatch/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="],
|
|
395
488
|
|
|
396
489
|
"pino-pretty/pino-abstract-transport": ["pino-abstract-transport@3.0.0", "", { "dependencies": { "split2": "^4.0.0" } }, "sha512-wlfUczU+n7Hy/Ha5j9a/gZNy7We5+cXp8YL+X+PG8S0KXxw7n/JXA3c46Y0zQznIJ83URJiwy7Lh56WLokNuxg=="],
|
|
397
490
|
|
|
491
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/android-arm": ["@esbuild/android-arm@0.18.20", "", { "os": "android", "cpu": "arm" }, "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw=="],
|
|
492
|
+
|
|
493
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/android-arm64": ["@esbuild/android-arm64@0.18.20", "", { "os": "android", "cpu": "arm64" }, "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ=="],
|
|
494
|
+
|
|
495
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/android-x64": ["@esbuild/android-x64@0.18.20", "", { "os": "android", "cpu": "x64" }, "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg=="],
|
|
496
|
+
|
|
497
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.18.20", "", { "os": "darwin", "cpu": "arm64" }, "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA=="],
|
|
498
|
+
|
|
499
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.18.20", "", { "os": "darwin", "cpu": "x64" }, "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ=="],
|
|
500
|
+
|
|
501
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.18.20", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw=="],
|
|
502
|
+
|
|
503
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.18.20", "", { "os": "freebsd", "cpu": "x64" }, "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ=="],
|
|
504
|
+
|
|
505
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/linux-arm": ["@esbuild/linux-arm@0.18.20", "", { "os": "linux", "cpu": "arm" }, "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg=="],
|
|
506
|
+
|
|
507
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.18.20", "", { "os": "linux", "cpu": "arm64" }, "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA=="],
|
|
508
|
+
|
|
509
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.18.20", "", { "os": "linux", "cpu": "ia32" }, "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA=="],
|
|
510
|
+
|
|
511
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.18.20", "", { "os": "linux", "cpu": "none" }, "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg=="],
|
|
512
|
+
|
|
513
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.18.20", "", { "os": "linux", "cpu": "none" }, "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ=="],
|
|
514
|
+
|
|
515
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.18.20", "", { "os": "linux", "cpu": "ppc64" }, "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA=="],
|
|
516
|
+
|
|
517
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.18.20", "", { "os": "linux", "cpu": "none" }, "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A=="],
|
|
518
|
+
|
|
519
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.18.20", "", { "os": "linux", "cpu": "s390x" }, "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ=="],
|
|
520
|
+
|
|
521
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/linux-x64": ["@esbuild/linux-x64@0.18.20", "", { "os": "linux", "cpu": "x64" }, "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w=="],
|
|
522
|
+
|
|
523
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.18.20", "", { "os": "none", "cpu": "x64" }, "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A=="],
|
|
524
|
+
|
|
525
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.18.20", "", { "os": "openbsd", "cpu": "x64" }, "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg=="],
|
|
526
|
+
|
|
527
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.18.20", "", { "os": "sunos", "cpu": "x64" }, "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ=="],
|
|
528
|
+
|
|
529
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.18.20", "", { "os": "win32", "cpu": "arm64" }, "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg=="],
|
|
530
|
+
|
|
531
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.18.20", "", { "os": "win32", "cpu": "ia32" }, "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g=="],
|
|
532
|
+
|
|
533
|
+
"@esbuild-kit/core-utils/esbuild/@esbuild/win32-x64": ["@esbuild/win32-x64@0.18.20", "", { "os": "win32", "cpu": "x64" }, "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ=="],
|
|
534
|
+
|
|
398
535
|
"@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.2", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ=="],
|
|
399
536
|
|
|
537
|
+
"@vellumai/ces-contracts/@types/bun/bun-types": ["bun-types@1.2.4", "", { "dependencies": { "@types/node": "*", "@types/ws": "~8.5.10" } }, "sha512-nDPymR207ZZEoWD4AavvEaa/KZe/qlrbMSchqpQwovPZCKc7pwMoENjEtHgMKaAjJhy+x6vfqSBA1QU3bJgs0Q=="],
|
|
538
|
+
|
|
539
|
+
"gel/which/isexe": ["isexe@3.1.5", "", {}, "sha512-6B3tLtFqtQS4ekarvLVMZ+X+VlvQekbe4taUkf/rhVO3d/h0M2rfARm/pXLcPEsjjMsFgrFgSrhQIxcSVrBz8w=="],
|
|
540
|
+
|
|
400
541
|
"@typescript-eslint/typescript-estree/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="],
|
|
401
542
|
}
|
|
402
543
|
}
|
package/knip.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vellumai/vellum-gateway",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"dev:proxy": "bun run src/cli/enable-proxy.ts && bun run --watch src/index.ts",
|
|
13
13
|
"build": "bun build src/index.ts --outdir dist --target bun",
|
|
14
14
|
"schema": "bun run src/cli/schema.ts",
|
|
15
|
+
"db:generate": "drizzle-kit generate --dialect sqlite --schema src/db/schema.ts --out src/db/migrations",
|
|
15
16
|
"start": "bun run src/index.ts",
|
|
16
17
|
"test": "bash scripts/test.sh",
|
|
17
18
|
"format": "prettier --write .",
|
|
@@ -23,6 +24,9 @@
|
|
|
23
24
|
"postinstall": "cd .. && (git config core.hooksPath || git config core.hooksPath .githooks 2>/dev/null || true) && ([ -f meta/feature-flags/sync-bundled-copies.ts ] && bun run meta/feature-flags/sync-bundled-copies.ts 2>/dev/null || true)"
|
|
24
25
|
},
|
|
25
26
|
"dependencies": {
|
|
27
|
+
"@vellumai/ces-contracts": "file:../packages/ces-contracts",
|
|
28
|
+
"drizzle-kit": "0.30.6",
|
|
29
|
+
"drizzle-orm": "0.45.2",
|
|
26
30
|
"file-type": "21.3.0",
|
|
27
31
|
"minimatch": "10.2.4",
|
|
28
32
|
"pino": "9.14.0",
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { describe, test, expect, beforeAll } from "bun:test";
|
|
2
|
+
import "./test-preload.js";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
initSigningKey,
|
|
6
|
+
loadOrCreateSigningKey,
|
|
7
|
+
mintToken,
|
|
8
|
+
verifyToken,
|
|
9
|
+
} from "../auth/token-service.js";
|
|
10
|
+
import { CURRENT_POLICY_EPOCH } from "../auth/policy.js";
|
|
11
|
+
import { createCloudOAuthTokenHandler } from "../http/routes/cloud-oauth-token.js";
|
|
12
|
+
|
|
13
|
+
let serviceToken: string;
|
|
14
|
+
|
|
15
|
+
beforeAll(() => {
|
|
16
|
+
initSigningKey(loadOrCreateSigningKey());
|
|
17
|
+
// Mint a service token (svc:gateway:self) that the handler accepts.
|
|
18
|
+
serviceToken = mintToken({
|
|
19
|
+
aud: "vellum-gateway",
|
|
20
|
+
sub: "svc:gateway:self",
|
|
21
|
+
scope_profile: "gateway_service_v1",
|
|
22
|
+
policy_epoch: CURRENT_POLICY_EPOCH,
|
|
23
|
+
ttlSeconds: 60,
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const handler = createCloudOAuthTokenHandler();
|
|
28
|
+
|
|
29
|
+
/** Build a POST request with the service-token Authorization header. */
|
|
30
|
+
function makeRequest(body: unknown): Request {
|
|
31
|
+
return new Request(
|
|
32
|
+
"http://gateway.test/v1/internal/oauth/chrome-extension/token",
|
|
33
|
+
{
|
|
34
|
+
method: "POST",
|
|
35
|
+
headers: {
|
|
36
|
+
"content-type": "application/json",
|
|
37
|
+
authorization: `Bearer ${serviceToken}`,
|
|
38
|
+
},
|
|
39
|
+
body: typeof body === "string" ? body : JSON.stringify(body),
|
|
40
|
+
},
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
describe("POST /v1/internal/oauth/chrome-extension/token", () => {
|
|
45
|
+
test("happy path: valid body returns 200 with token, expiresIn, and guardianId", async () => {
|
|
46
|
+
const res = await handler.handleMintToken(
|
|
47
|
+
makeRequest({ assistantId: "asst-123", actorPrincipalId: "user-456" }),
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
expect(res.status).toBe(200);
|
|
51
|
+
const body = (await res.json()) as {
|
|
52
|
+
token: string;
|
|
53
|
+
expiresIn: number;
|
|
54
|
+
guardianId: string;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
expect(typeof body.token).toBe("string");
|
|
58
|
+
expect(body.token.split(".").length).toBe(3); // JWT format
|
|
59
|
+
expect(body.expiresIn).toBe(3600);
|
|
60
|
+
expect(body.guardianId).toBe("user-456");
|
|
61
|
+
|
|
62
|
+
// Verify the minted token has the correct claims
|
|
63
|
+
const result = verifyToken(body.token, "vellum-gateway");
|
|
64
|
+
expect(result.ok).toBe(true);
|
|
65
|
+
if (result.ok) {
|
|
66
|
+
expect(result.claims.sub).toBe("actor:asst-123:user-456");
|
|
67
|
+
expect(result.claims.aud).toBe("vellum-gateway");
|
|
68
|
+
expect(result.claims.scope_profile).toBe("actor_client_v1");
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
test("missing assistantId returns 400", async () => {
|
|
73
|
+
const res = await handler.handleMintToken(
|
|
74
|
+
makeRequest({ actorPrincipalId: "user-456" }),
|
|
75
|
+
);
|
|
76
|
+
expect(res.status).toBe(400);
|
|
77
|
+
const body = (await res.json()) as { error: string };
|
|
78
|
+
expect(body.error).toContain("assistantId");
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test("missing actorPrincipalId returns 400", async () => {
|
|
82
|
+
const res = await handler.handleMintToken(
|
|
83
|
+
makeRequest({ assistantId: "asst-123" }),
|
|
84
|
+
);
|
|
85
|
+
expect(res.status).toBe(400);
|
|
86
|
+
const body = (await res.json()) as { error: string };
|
|
87
|
+
expect(body.error).toContain("actorPrincipalId");
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
test("empty assistantId string returns 400", async () => {
|
|
91
|
+
const res = await handler.handleMintToken(
|
|
92
|
+
makeRequest({ assistantId: "", actorPrincipalId: "user-456" }),
|
|
93
|
+
);
|
|
94
|
+
expect(res.status).toBe(400);
|
|
95
|
+
const body = (await res.json()) as { error: string };
|
|
96
|
+
expect(body.error).toContain("assistantId");
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
test("empty actorPrincipalId string returns 400", async () => {
|
|
100
|
+
const res = await handler.handleMintToken(
|
|
101
|
+
makeRequest({ assistantId: "asst-123", actorPrincipalId: "" }),
|
|
102
|
+
);
|
|
103
|
+
expect(res.status).toBe(400);
|
|
104
|
+
const body = (await res.json()) as { error: string };
|
|
105
|
+
expect(body.error).toContain("actorPrincipalId");
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
test("whitespace-only strings return 400", async () => {
|
|
109
|
+
const res = await handler.handleMintToken(
|
|
110
|
+
makeRequest({ assistantId: " ", actorPrincipalId: "user-456" }),
|
|
111
|
+
);
|
|
112
|
+
expect(res.status).toBe(400);
|
|
113
|
+
const body = (await res.json()) as { error: string };
|
|
114
|
+
expect(body.error).toContain("assistantId");
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
test("invalid JSON body returns 400", async () => {
|
|
118
|
+
const res = await handler.handleMintToken(
|
|
119
|
+
new Request(
|
|
120
|
+
"http://gateway.test/v1/internal/oauth/chrome-extension/token",
|
|
121
|
+
{
|
|
122
|
+
method: "POST",
|
|
123
|
+
headers: {
|
|
124
|
+
"content-type": "application/json",
|
|
125
|
+
authorization: `Bearer ${serviceToken}`,
|
|
126
|
+
},
|
|
127
|
+
body: "not-json",
|
|
128
|
+
},
|
|
129
|
+
),
|
|
130
|
+
);
|
|
131
|
+
expect(res.status).toBe(400);
|
|
132
|
+
const body = (await res.json()) as { error: string };
|
|
133
|
+
expect(body.error).toContain("JSON");
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
test("non-string assistantId returns 400", async () => {
|
|
137
|
+
const res = await handler.handleMintToken(
|
|
138
|
+
makeRequest({ assistantId: 123, actorPrincipalId: "user-456" }),
|
|
139
|
+
);
|
|
140
|
+
expect(res.status).toBe(400);
|
|
141
|
+
const body = (await res.json()) as { error: string };
|
|
142
|
+
expect(body.error).toContain("assistantId");
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test("colon in assistantId returns 400", async () => {
|
|
146
|
+
const res = await handler.handleMintToken(
|
|
147
|
+
makeRequest({ assistantId: "asst:123", actorPrincipalId: "user-456" }),
|
|
148
|
+
);
|
|
149
|
+
expect(res.status).toBe(400);
|
|
150
|
+
const body = (await res.json()) as { error: string };
|
|
151
|
+
expect(body.error).toContain("colon");
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
test("colon in actorPrincipalId returns 400", async () => {
|
|
155
|
+
const res = await handler.handleMintToken(
|
|
156
|
+
makeRequest({ assistantId: "asst-123", actorPrincipalId: "user:456" }),
|
|
157
|
+
);
|
|
158
|
+
expect(res.status).toBe(400);
|
|
159
|
+
const body = (await res.json()) as { error: string };
|
|
160
|
+
expect(body.error).toContain("colon");
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
test("request without authorization header returns 403", async () => {
|
|
164
|
+
const res = await handler.handleMintToken(
|
|
165
|
+
new Request(
|
|
166
|
+
"http://gateway.test/v1/internal/oauth/chrome-extension/token",
|
|
167
|
+
{
|
|
168
|
+
method: "POST",
|
|
169
|
+
headers: { "content-type": "application/json" },
|
|
170
|
+
body: JSON.stringify({
|
|
171
|
+
assistantId: "asst-123",
|
|
172
|
+
actorPrincipalId: "user-456",
|
|
173
|
+
}),
|
|
174
|
+
},
|
|
175
|
+
),
|
|
176
|
+
);
|
|
177
|
+
expect(res.status).toBe(403);
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
test("request with actor token (not service) returns 403", async () => {
|
|
181
|
+
const actorToken = mintToken({
|
|
182
|
+
aud: "vellum-gateway",
|
|
183
|
+
sub: "actor:asst-123:some-user",
|
|
184
|
+
scope_profile: "actor_client_v1",
|
|
185
|
+
policy_epoch: CURRENT_POLICY_EPOCH,
|
|
186
|
+
ttlSeconds: 60,
|
|
187
|
+
});
|
|
188
|
+
const res = await handler.handleMintToken(
|
|
189
|
+
new Request(
|
|
190
|
+
"http://gateway.test/v1/internal/oauth/chrome-extension/token",
|
|
191
|
+
{
|
|
192
|
+
method: "POST",
|
|
193
|
+
headers: {
|
|
194
|
+
"content-type": "application/json",
|
|
195
|
+
authorization: `Bearer ${actorToken}`,
|
|
196
|
+
},
|
|
197
|
+
body: JSON.stringify({
|
|
198
|
+
assistantId: "asst-123",
|
|
199
|
+
actorPrincipalId: "user-456",
|
|
200
|
+
}),
|
|
201
|
+
},
|
|
202
|
+
),
|
|
203
|
+
);
|
|
204
|
+
expect(res.status).toBe(403);
|
|
205
|
+
});
|
|
206
|
+
});
|