@vellumai/cli 0.12.5-dev.202609260044.543355b → 0.12.5-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.
@@ -3,27 +3,15 @@ import { describe, expect, test } from "bun:test";
3
3
  import {
4
4
  buildShellInvocation,
5
5
  buildShellSpawnFlags,
6
- CHILD_OOM_SCORE_ADJ,
7
6
  pathListDelimiter,
8
7
  prependUniquePathEntries,
9
8
  } from "./shell.js";
10
9
 
11
10
  describe("buildShellInvocation", () => {
12
11
  test("uses Bash on POSIX hosts", () => {
13
- expect(buildShellInvocation("printf hello", "darwin")).toEqual({
14
- command: "bash",
15
- args: ["-c", "--", "printf hello"],
16
- });
17
- });
18
-
19
- test("raises the shell's OOM-kill priority on Linux", () => {
20
12
  expect(buildShellInvocation("printf hello", "linux")).toEqual({
21
13
  command: "bash",
22
- args: [
23
- "-c",
24
- "--",
25
- `echo ${CHILD_OOM_SCORE_ADJ} 2>/dev/null >/proc/self/oom_score_adj; printf hello`,
26
- ],
14
+ args: ["-c", "--", "printf hello"],
27
15
  });
28
16
  });
29
17
 
@@ -24,23 +24,6 @@ if (-not $__vellumCommandSucceeded) {
24
24
  }
25
25
  exit 0`;
26
26
 
27
- /**
28
- * `oom_score_adj` for assistant-owned tool processes. Any positive value
29
- * outranks a 0-scored process; 1000 makes a tool the kernel's first choice
30
- * whenever the container runs out of memory, so the assistant itself is never
31
- * the victim of a runaway command.
32
- */
33
- export const CHILD_OOM_SCORE_ADJ = 1000;
34
-
35
- /**
36
- * Prefix for a Bash `-c` script that raises the shell's own OOM-kill priority
37
- * before the command runs. Every process the command forks inherits it. Bash
38
- * performs a builtin's redirection itself, so `/proc/self` is the shell.
39
- * Redirections apply left to right, so stderr goes to /dev/null before the
40
- * procfs open can fail and complain about it.
41
- */
42
- const LINUX_OOM_SCORE_ADJ_PREFIX = `echo ${CHILD_OOM_SCORE_ADJ} 2>/dev/null >/proc/self/oom_score_adj; `;
43
-
44
27
  export function buildShellInvocation(
45
28
  command: string,
46
29
  hostPlatform: NodeJS.Platform = process.platform,
@@ -62,11 +45,7 @@ export function buildShellInvocation(
62
45
  ],
63
46
  };
64
47
  }
65
- const script =
66
- hostPlatform === "linux"
67
- ? `${LINUX_OOM_SCORE_ADJ_PREFIX}${command}`
68
- : command;
69
- return { command: "bash", args: ["-c", "--", script] };
48
+ return { command: "bash", args: ["-c", "--", command] };
70
49
  }
71
50
 
72
51
  /**
@@ -3,27 +3,15 @@ import { describe, expect, test } from "bun:test";
3
3
  import {
4
4
  buildShellInvocation,
5
5
  buildShellSpawnFlags,
6
- CHILD_OOM_SCORE_ADJ,
7
6
  pathListDelimiter,
8
7
  prependUniquePathEntries,
9
8
  } from "./shell.js";
10
9
 
11
10
  describe("buildShellInvocation", () => {
12
11
  test("uses Bash on POSIX hosts", () => {
13
- expect(buildShellInvocation("printf hello", "darwin")).toEqual({
14
- command: "bash",
15
- args: ["-c", "--", "printf hello"],
16
- });
17
- });
18
-
19
- test("raises the shell's OOM-kill priority on Linux", () => {
20
12
  expect(buildShellInvocation("printf hello", "linux")).toEqual({
21
13
  command: "bash",
22
- args: [
23
- "-c",
24
- "--",
25
- `echo ${CHILD_OOM_SCORE_ADJ} 2>/dev/null >/proc/self/oom_score_adj; printf hello`,
26
- ],
14
+ args: ["-c", "--", "printf hello"],
27
15
  });
28
16
  });
29
17
 
@@ -24,23 +24,6 @@ if (-not $__vellumCommandSucceeded) {
24
24
  }
25
25
  exit 0`;
26
26
 
27
- /**
28
- * `oom_score_adj` for assistant-owned tool processes. Any positive value
29
- * outranks a 0-scored process; 1000 makes a tool the kernel's first choice
30
- * whenever the container runs out of memory, so the assistant itself is never
31
- * the victim of a runaway command.
32
- */
33
- export const CHILD_OOM_SCORE_ADJ = 1000;
34
-
35
- /**
36
- * Prefix for a Bash `-c` script that raises the shell's own OOM-kill priority
37
- * before the command runs. Every process the command forks inherits it. Bash
38
- * performs a builtin's redirection itself, so `/proc/self` is the shell.
39
- * Redirections apply left to right, so stderr goes to /dev/null before the
40
- * procfs open can fail and complain about it.
41
- */
42
- const LINUX_OOM_SCORE_ADJ_PREFIX = `echo ${CHILD_OOM_SCORE_ADJ} 2>/dev/null >/proc/self/oom_score_adj; `;
43
-
44
27
  export function buildShellInvocation(
45
28
  command: string,
46
29
  hostPlatform: NodeJS.Platform = process.platform,
@@ -62,11 +45,7 @@ export function buildShellInvocation(
62
45
  ],
63
46
  };
64
47
  }
65
- const script =
66
- hostPlatform === "linux"
67
- ? `${LINUX_OOM_SCORE_ADJ_PREFIX}${command}`
68
- : command;
69
- return { command: "bash", args: ["-c", "--", script] };
48
+ return { command: "bash", args: ["-c", "--", command] };
70
49
  }
71
50
 
72
51
  /**
@@ -28,8 +28,7 @@
28
28
  "./guardian-requests": "./src/guardian-requests.ts",
29
29
  "./platform-credential": "./src/platform-credential.ts",
30
30
  "./plan-credit": "./src/plan-credit.ts",
31
- "./integration-categories": "./src/integration-categories.ts",
32
- "./mcp-oauth": "./src/mcp-oauth.ts"
31
+ "./integration-categories": "./src/integration-categories.ts"
33
32
  },
34
33
  "scripts": {
35
34
  "typecheck": "bunx tsc --noEmit",
@@ -30,7 +30,6 @@ export * from "./ingress.js";
30
30
  export * from "./no-response.js";
31
31
  export * from "./plan-credit.js";
32
32
  export * from "./integration-categories.js";
33
- export * from "./mcp-oauth.js";
34
33
  export * from "./platform-credential.js";
35
34
  export * from "./remote-web-pairing.js";
36
35
  export * from "./twilio-ingress.js";
@@ -28,8 +28,7 @@
28
28
  "./guardian-requests": "./src/guardian-requests.ts",
29
29
  "./platform-credential": "./src/platform-credential.ts",
30
30
  "./plan-credit": "./src/plan-credit.ts",
31
- "./integration-categories": "./src/integration-categories.ts",
32
- "./mcp-oauth": "./src/mcp-oauth.ts"
31
+ "./integration-categories": "./src/integration-categories.ts"
33
32
  },
34
33
  "scripts": {
35
34
  "typecheck": "bunx tsc --noEmit",
@@ -30,7 +30,6 @@ export * from "./ingress.js";
30
30
  export * from "./no-response.js";
31
31
  export * from "./plan-credit.js";
32
32
  export * from "./integration-categories.js";
33
- export * from "./mcp-oauth.js";
34
33
  export * from "./platform-credential.js";
35
34
  export * from "./remote-web-pairing.js";
36
35
  export * from "./twilio-ingress.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/cli",
3
- "version": "0.12.5-dev.202609260044.543355b",
3
+ "version": "0.12.5-staging.1",
4
4
  "description": "CLI tools for vellum-assistant",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,53 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
-
3
- import {
4
- buildMcpOAuthCallbackUrl,
5
- buildMcpOAuthClientMetadata,
6
- buildMcpOAuthClientMetadataUrl,
7
- } from "../mcp-oauth.js";
8
-
9
- describe("MCP OAuth client metadata", () => {
10
- test("builds the public client document", () => {
11
- expect(
12
- buildMcpOAuthClientMetadata({
13
- clientId:
14
- "https://velay.example/assistant-123/oauth/client-metadata.json",
15
- redirectUris: [
16
- "https://velay.example/assistant-123/webhooks/oauth/callback",
17
- ],
18
- }),
19
- ).toEqual({
20
- client_id:
21
- "https://velay.example/assistant-123/oauth/client-metadata.json",
22
- redirect_uris: [
23
- "https://velay.example/assistant-123/webhooks/oauth/callback",
24
- ],
25
- token_endpoint_auth_method: "none",
26
- grant_types: ["authorization_code", "refresh_token"],
27
- response_types: ["code"],
28
- client_name: "Vellum Assistant",
29
- logo_uri: "https://www.vellum.ai/favicon.svg",
30
- });
31
- });
32
-
33
- test("builds callback and metadata URLs from one normalized base", () => {
34
- const baseUrl = "https://velay.example/assistant-123///";
35
- expect(buildMcpOAuthCallbackUrl(baseUrl)).toBe(
36
- "https://velay.example/assistant-123/webhooks/oauth/callback",
37
- );
38
- expect(buildMcpOAuthClientMetadataUrl(baseUrl)).toBe(
39
- "https://velay.example/assistant-123/oauth/client-metadata.json",
40
- );
41
- });
42
-
43
- test("canonicalizes equivalent public base URL spellings", () => {
44
- const baseUrl = " https://VELAY.EXAMPLE:443/a/../assistant-123/// ";
45
-
46
- expect(buildMcpOAuthCallbackUrl(baseUrl)).toBe(
47
- "https://velay.example/assistant-123/webhooks/oauth/callback",
48
- );
49
- expect(buildMcpOAuthClientMetadataUrl(baseUrl)).toBe(
50
- "https://velay.example/assistant-123/oauth/client-metadata.json",
51
- );
52
- });
53
- });
@@ -1,60 +0,0 @@
1
- import { normalizeHttpPublicBaseUrlWithoutTrailingSlash } from "./ingress.js";
2
-
3
- export const MCP_OAUTH_CALLBACK_PATH = "/webhooks/oauth/callback";
4
- export const MCP_OAUTH_CLIENT_METADATA_PATH = "/oauth/client-metadata.json";
5
- export const MCP_OAUTH_CLIENT_LOGO_URI = "https://www.vellum.ai/favicon.svg";
6
-
7
- export interface McpOAuthClientMetadata {
8
- client_id?: string;
9
- redirect_uris: string[];
10
- token_endpoint_auth_method: "none";
11
- grant_types: ["authorization_code", "refresh_token"];
12
- response_types: ["code"];
13
- client_name: string;
14
- logo_uri: string;
15
- software_id?: string;
16
- software_version?: string;
17
- }
18
-
19
- export interface BuildMcpOAuthClientMetadataOptions {
20
- clientId?: string;
21
- redirectUris: string[];
22
- clientName?: string;
23
- softwareId?: string;
24
- softwareVersion?: string;
25
- }
26
-
27
- export function buildMcpOAuthClientMetadata(
28
- options: BuildMcpOAuthClientMetadataOptions,
29
- ): McpOAuthClientMetadata {
30
- return {
31
- ...(options.clientId && { client_id: options.clientId }),
32
- redirect_uris: options.redirectUris,
33
- token_endpoint_auth_method: "none",
34
- grant_types: ["authorization_code", "refresh_token"],
35
- response_types: ["code"],
36
- client_name: options.clientName ?? "Vellum Assistant",
37
- logo_uri: MCP_OAUTH_CLIENT_LOGO_URI,
38
- ...(options.softwareId && { software_id: options.softwareId }),
39
- ...(options.softwareVersion && {
40
- software_version: options.softwareVersion,
41
- }),
42
- };
43
- }
44
-
45
- export function buildMcpOAuthCallbackUrl(publicBaseUrl: string): string {
46
- return `${normalizeBaseUrl(publicBaseUrl)}${MCP_OAUTH_CALLBACK_PATH}`;
47
- }
48
-
49
- export function buildMcpOAuthClientMetadataUrl(publicBaseUrl: string): string {
50
- return `${normalizeBaseUrl(publicBaseUrl)}${MCP_OAUTH_CLIENT_METADATA_PATH}`;
51
- }
52
-
53
- function normalizeBaseUrl(publicBaseUrl: string): string {
54
- const normalized =
55
- normalizeHttpPublicBaseUrlWithoutTrailingSlash(publicBaseUrl);
56
- if (!normalized) {
57
- throw new Error("MCP OAuth public base URL must be an absolute HTTP URL");
58
- }
59
- return normalized;
60
- }
@@ -1,53 +0,0 @@
1
- import { describe, expect, test } from "bun:test";
2
-
3
- import {
4
- buildMcpOAuthCallbackUrl,
5
- buildMcpOAuthClientMetadata,
6
- buildMcpOAuthClientMetadataUrl,
7
- } from "../mcp-oauth.js";
8
-
9
- describe("MCP OAuth client metadata", () => {
10
- test("builds the public client document", () => {
11
- expect(
12
- buildMcpOAuthClientMetadata({
13
- clientId:
14
- "https://velay.example/assistant-123/oauth/client-metadata.json",
15
- redirectUris: [
16
- "https://velay.example/assistant-123/webhooks/oauth/callback",
17
- ],
18
- }),
19
- ).toEqual({
20
- client_id:
21
- "https://velay.example/assistant-123/oauth/client-metadata.json",
22
- redirect_uris: [
23
- "https://velay.example/assistant-123/webhooks/oauth/callback",
24
- ],
25
- token_endpoint_auth_method: "none",
26
- grant_types: ["authorization_code", "refresh_token"],
27
- response_types: ["code"],
28
- client_name: "Vellum Assistant",
29
- logo_uri: "https://www.vellum.ai/favicon.svg",
30
- });
31
- });
32
-
33
- test("builds callback and metadata URLs from one normalized base", () => {
34
- const baseUrl = "https://velay.example/assistant-123///";
35
- expect(buildMcpOAuthCallbackUrl(baseUrl)).toBe(
36
- "https://velay.example/assistant-123/webhooks/oauth/callback",
37
- );
38
- expect(buildMcpOAuthClientMetadataUrl(baseUrl)).toBe(
39
- "https://velay.example/assistant-123/oauth/client-metadata.json",
40
- );
41
- });
42
-
43
- test("canonicalizes equivalent public base URL spellings", () => {
44
- const baseUrl = " https://VELAY.EXAMPLE:443/a/../assistant-123/// ";
45
-
46
- expect(buildMcpOAuthCallbackUrl(baseUrl)).toBe(
47
- "https://velay.example/assistant-123/webhooks/oauth/callback",
48
- );
49
- expect(buildMcpOAuthClientMetadataUrl(baseUrl)).toBe(
50
- "https://velay.example/assistant-123/oauth/client-metadata.json",
51
- );
52
- });
53
- });
@@ -1,60 +0,0 @@
1
- import { normalizeHttpPublicBaseUrlWithoutTrailingSlash } from "./ingress.js";
2
-
3
- export const MCP_OAUTH_CALLBACK_PATH = "/webhooks/oauth/callback";
4
- export const MCP_OAUTH_CLIENT_METADATA_PATH = "/oauth/client-metadata.json";
5
- export const MCP_OAUTH_CLIENT_LOGO_URI = "https://www.vellum.ai/favicon.svg";
6
-
7
- export interface McpOAuthClientMetadata {
8
- client_id?: string;
9
- redirect_uris: string[];
10
- token_endpoint_auth_method: "none";
11
- grant_types: ["authorization_code", "refresh_token"];
12
- response_types: ["code"];
13
- client_name: string;
14
- logo_uri: string;
15
- software_id?: string;
16
- software_version?: string;
17
- }
18
-
19
- export interface BuildMcpOAuthClientMetadataOptions {
20
- clientId?: string;
21
- redirectUris: string[];
22
- clientName?: string;
23
- softwareId?: string;
24
- softwareVersion?: string;
25
- }
26
-
27
- export function buildMcpOAuthClientMetadata(
28
- options: BuildMcpOAuthClientMetadataOptions,
29
- ): McpOAuthClientMetadata {
30
- return {
31
- ...(options.clientId && { client_id: options.clientId }),
32
- redirect_uris: options.redirectUris,
33
- token_endpoint_auth_method: "none",
34
- grant_types: ["authorization_code", "refresh_token"],
35
- response_types: ["code"],
36
- client_name: options.clientName ?? "Vellum Assistant",
37
- logo_uri: MCP_OAUTH_CLIENT_LOGO_URI,
38
- ...(options.softwareId && { software_id: options.softwareId }),
39
- ...(options.softwareVersion && {
40
- software_version: options.softwareVersion,
41
- }),
42
- };
43
- }
44
-
45
- export function buildMcpOAuthCallbackUrl(publicBaseUrl: string): string {
46
- return `${normalizeBaseUrl(publicBaseUrl)}${MCP_OAUTH_CALLBACK_PATH}`;
47
- }
48
-
49
- export function buildMcpOAuthClientMetadataUrl(publicBaseUrl: string): string {
50
- return `${normalizeBaseUrl(publicBaseUrl)}${MCP_OAUTH_CLIENT_METADATA_PATH}`;
51
- }
52
-
53
- function normalizeBaseUrl(publicBaseUrl: string): string {
54
- const normalized =
55
- normalizeHttpPublicBaseUrlWithoutTrailingSlash(publicBaseUrl);
56
- if (!normalized) {
57
- throw new Error("MCP OAuth public base URL must be an absolute HTTP URL");
58
- }
59
- return normalized;
60
- }