@vellumai/cli 0.10.8-dev.202607152027.f053d5a → 0.10.8-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.
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import fs from "node:fs";
|
|
3
|
-
import os from "node:os";
|
|
4
|
-
import path from "node:path";
|
|
5
2
|
|
|
6
|
-
import {
|
|
7
|
-
readAllowedGatewayPorts,
|
|
8
|
-
resolveGatewayProxyTarget,
|
|
9
|
-
} from "../gateway-proxy";
|
|
3
|
+
import { resolveGatewayProxyTarget } from "../gateway-proxy";
|
|
10
4
|
|
|
11
5
|
const allow =
|
|
12
6
|
(...ports: number[]) =>
|
|
@@ -70,41 +64,6 @@ describe("resolveGatewayProxyTarget", () => {
|
|
|
70
64
|
});
|
|
71
65
|
});
|
|
72
66
|
|
|
73
|
-
test("allowlists ports from resources, loopback URLs, and docker runtimeUrls — never remote URLs", () => {
|
|
74
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "gateway-proxy-test-"));
|
|
75
|
-
const lockfilePath = path.join(dir, "assistants.json");
|
|
76
|
-
try {
|
|
77
|
-
fs.writeFileSync(
|
|
78
|
-
lockfilePath,
|
|
79
|
-
JSON.stringify({
|
|
80
|
-
assistants: [
|
|
81
|
-
{ assistantId: "local-a", resources: { gatewayPort: 7830 } },
|
|
82
|
-
{ assistantId: "local-b", localUrl: "http://127.0.0.1:7831" },
|
|
83
|
-
// Docker entries record their published gateway only as a
|
|
84
|
-
// loopback runtimeUrl.
|
|
85
|
-
{
|
|
86
|
-
assistantId: "docker-a",
|
|
87
|
-
cloud: "docker",
|
|
88
|
-
runtimeUrl: "http://localhost:7930",
|
|
89
|
-
},
|
|
90
|
-
// Remote runtimeUrls (managed / gcp / paired) must never widen
|
|
91
|
-
// the allowlist.
|
|
92
|
-
{
|
|
93
|
-
assistantId: "remote-a",
|
|
94
|
-
cloud: "gcp",
|
|
95
|
-
runtimeUrl: "https://assistant.example.com:8443",
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
|
-
}),
|
|
99
|
-
);
|
|
100
|
-
expect(readAllowedGatewayPorts([lockfilePath])).toEqual(
|
|
101
|
-
new Set([7830, 7831, 7930]),
|
|
102
|
-
);
|
|
103
|
-
} finally {
|
|
104
|
-
fs.rmSync(dir, { recursive: true, force: true });
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
|
|
108
67
|
test("never reads the allowlist for non-gateway or invalid-port paths", () => {
|
|
109
68
|
let reads = 0;
|
|
110
69
|
const counting = () => {
|
|
@@ -87,7 +87,6 @@ export function readAllowedGatewayPorts(lockfilePaths: string[]): Set<number> {
|
|
|
87
87
|
assistants?: Array<{
|
|
88
88
|
gatewayUrl?: unknown;
|
|
89
89
|
localUrl?: unknown;
|
|
90
|
-
runtimeUrl?: unknown;
|
|
91
90
|
resources?: { gatewayPort?: unknown };
|
|
92
91
|
}>;
|
|
93
92
|
};
|
|
@@ -96,10 +95,6 @@ export function readAllowedGatewayPorts(lockfilePaths: string[]): Set<number> {
|
|
|
96
95
|
if (!assistant) continue;
|
|
97
96
|
addPortFromUrl(assistant.gatewayUrl, ports);
|
|
98
97
|
addPortFromUrl(assistant.localUrl, ports);
|
|
99
|
-
// Docker entries record their published gateway as a loopback
|
|
100
|
-
// `runtimeUrl` with no `resources` block; the loopback-hostname filter
|
|
101
|
-
// in addPortFromUrl keeps remote runtimeUrls out of the allowlist.
|
|
102
|
-
addPortFromUrl(assistant.runtimeUrl, ports);
|
|
103
98
|
const gp = assistant.resources?.gatewayPort;
|
|
104
99
|
if (typeof gp === "number" && Number.isInteger(gp) && gp >= 1024 && gp <= 65535) {
|
|
105
100
|
ports.add(gp);
|
package/package.json
CHANGED
|
@@ -176,11 +176,6 @@ export function inferProviderFromModel(model: string): string | undefined {
|
|
|
176
176
|
if (model.startsWith("accounts/fireworks/models/")) {
|
|
177
177
|
return "fireworks";
|
|
178
178
|
}
|
|
179
|
-
if (model.startsWith("openai/gpt-5.6")) {
|
|
180
|
-
// Listed by OpenRouter (#37856), the earlier catalog entry; the Vercel
|
|
181
|
-
// AI Gateway does not carry these IDs.
|
|
182
|
-
return "openrouter";
|
|
183
|
-
}
|
|
184
179
|
if (model.startsWith("openai/") || model.startsWith("xai/")) {
|
|
185
180
|
return "vercel-ai-gateway";
|
|
186
181
|
}
|