@runpod/mcp-server 1.2.0 → 1.4.0
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/CHANGELOG.md +47 -0
- package/README.md +163 -92
- package/dist/chunk-D4AEYJ2O.mjs +1160 -0
- package/dist/chunk-D4AEYJ2O.mjs.map +1 -0
- package/dist/http.cjs +1276 -0
- package/dist/http.cjs.map +1 -0
- package/dist/http.d.cts +18 -0
- package/dist/http.d.ts +18 -0
- package/dist/http.mjs +88 -0
- package/dist/http.mjs.map +1 -0
- package/dist/stdio.cjs +1639 -0
- package/dist/stdio.cjs.map +1 -0
- package/dist/stdio.d.cts +2 -0
- package/dist/stdio.d.ts +2 -0
- package/dist/stdio.mjs +1197 -0
- package/dist/stdio.mjs.map +1 -0
- package/dist/tools.cjs +1194 -0
- package/dist/tools.cjs.map +1 -0
- package/dist/tools.d.cts +21 -0
- package/dist/tools.d.ts +21 -0
- package/dist/tools.mjs +7 -0
- package/dist/tools.mjs.map +1 -0
- package/dist/wizard-37ZJSVB5.mjs +402 -0
- package/dist/wizard-37ZJSVB5.mjs.map +1 -0
- package/package.json +31 -13
- package/dist/index.d.cts +0 -3
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -1136
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -1102
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/install/wizard.ts","../src/install/clients.ts"],"sourcesContent":["import { execFileSync } from 'child_process';\nimport * as p from '@clack/prompts';\nimport {\n CLIENTS,\n HOSTED_URL,\n type AddMode,\n type McpClient,\n} from './clients.js';\n\nconst API_KEYS_URL = 'https://www.runpod.io/console/user/settings';\n\n// Open a URL in the user's default browser. Best-effort and non-fatal.\nfunction openBrowser(url: string): void {\n try {\n // No shell: pass the URL as a literal arg. On Windows the opener is the cmd\n // built-in `start` (first quoted arg is the window title, hence the empty '').\n if (process.platform === 'darwin') {\n execFileSync('open', [url], { stdio: 'ignore' });\n } else if (process.platform === 'win32') {\n execFileSync('cmd', ['/c', 'start', '', url], { stdio: 'ignore' });\n } else {\n execFileSync('xdg-open', [url], { stdio: 'ignore' });\n }\n } catch {\n // Ignore — the user can open the URL manually.\n }\n}\n\n// Verify the API key works by calling a read-only REST endpoint. Returns true\n// on success, false on auth failure, and null when the check itself failed\n// (offline, etc.) so we can warn without blocking.\nasync function verifyApiKey(apiKey: string): Promise<boolean | null> {\n try {\n const base = process.env.RUNPOD_REST_API_URL ?? 'https://rest.runpod.io/v1';\n const response = await fetch(`${base}/pods`, {\n headers: { Authorization: `Bearer ${apiKey}` },\n });\n if (response.ok) return true;\n if (response.status === 401 || response.status === 403) return false;\n return null;\n } catch {\n return null;\n }\n}\n\nfunction bail(message = 'Cancelled.'): never {\n p.cancel(message);\n process.exit(0);\n}\n\nasync function promptForApiKey(): Promise<string> {\n const fromEnv = process.env.RUNPOD_API_KEY;\n if (fromEnv) {\n const useEnv = await p.confirm({\n message: 'Use the RUNPOD_API_KEY from your environment?',\n });\n if (p.isCancel(useEnv)) bail();\n if (useEnv) return fromEnv;\n }\n\n const create = await p.confirm({\n message: 'Open the Runpod console to create or copy an API key?',\n });\n if (p.isCancel(create)) bail();\n if (create) {\n openBrowser(API_KEYS_URL);\n p.log.info(`Opening ${API_KEYS_URL}`);\n }\n\n const apiKey = await p.password({\n message: 'Paste your Runpod API key',\n validate: (value) =>\n !value || value.trim().length === 0\n ? 'API key cannot be empty'\n : undefined,\n });\n if (p.isCancel(apiKey)) bail();\n return apiKey.trim();\n}\n\nasync function selectClients(\n detected: Map<string, boolean>,\n verb: string\n): Promise<McpClient[]> {\n const options = CLIENTS.map((client) => ({\n value: client.id,\n label: client.name,\n hint: detected.get(client.id) ? 'detected' : undefined,\n }));\n\n const selected = await p.multiselect<string>({\n message: `Which agents should we ${verb}?`,\n options,\n // Pre-select detected clients so the common case is a single Enter press.\n initialValues: CLIENTS.filter((c) => detected.get(c.id)).map((c) => c.id),\n required: true,\n });\n if (p.isCancel(selected)) bail();\n\n return CLIENTS.filter((c) => selected.includes(c.id));\n}\n\nasync function detectAll(): Promise<Map<string, boolean>> {\n const entries = await Promise.all(\n CLIENTS.map(async (c) => [c.id, await c.detect()] as const)\n );\n return new Map(entries);\n}\n\n// Ask how the server should be wired up, then collect what that mode needs.\n// Hosted is the default: the client signs in with Runpod over OAuth and no key\n// is ever written to disk. Local runs the server via npx with an API key.\nasync function selectMode(): Promise<AddMode> {\n const kind = await p.select({\n message: 'How do you want to connect to Runpod?',\n options: [\n {\n value: 'hosted',\n label: 'Sign in with Runpod (recommended)',\n hint: 'hosted, OAuth, no API key stored',\n },\n {\n value: 'local',\n label: 'Run locally with an API key',\n hint: 'runs on this machine via npx',\n },\n ],\n initialValue: 'hosted',\n });\n if (p.isCancel(kind)) bail();\n\n if (kind === 'hosted') {\n return { kind: 'hosted', url: HOSTED_URL };\n }\n\n const apiKey = await promptForApiKey();\n\n const verifySpinner = p.spinner();\n verifySpinner.start('Verifying API key');\n const valid = await verifyApiKey(apiKey);\n if (valid === true) {\n verifySpinner.stop('API key verified.');\n } else if (valid === false) {\n verifySpinner.stop('API key rejected by Runpod.');\n const proceed = await p.confirm({\n message: 'The key did not authenticate. Continue anyway?',\n initialValue: false,\n });\n if (p.isCancel(proceed) || !proceed) bail();\n } else {\n verifySpinner.stop('Could not verify the key (offline?). Continuing.');\n }\n\n return { kind: 'local', apiKey };\n}\n\nasync function runAdd(): Promise<void> {\n const detected = await detectAll();\n const clients = await selectClients(detected, 'set up');\n const mode = await selectMode();\n\n const results: string[] = [];\n for (const client of clients) {\n const spinner = p.spinner();\n spinner.start(`Configuring ${client.name}`);\n const result = await client.add(mode);\n if (result.success) {\n spinner.stop(`${client.name} configured.`);\n results.push(`✓ ${client.name} — ${client.describeTarget()}`);\n } else {\n spinner.stop(`${client.name} failed.`);\n results.push(`✗ ${client.name} — ${result.message ?? 'unknown error'}`);\n }\n }\n\n p.note(results.join('\\n'), 'Results');\n p.outro(\n mode.kind === 'hosted'\n ? 'Restart your agent, then complete \"Sign in with Runpod\" when it connects.'\n : 'Restart your agent (or reconnect MCP) to load the Runpod tools.'\n );\n}\n\nasync function runRemove(): Promise<void> {\n const detected = await detectAll();\n const clients = await selectClients(detected, 'remove Runpod from');\n\n const results: string[] = [];\n for (const client of clients) {\n const spinner = p.spinner();\n spinner.start(`Removing from ${client.name}`);\n const result = await client.remove();\n spinner.stop(\n result.success ? `${client.name} cleaned up.` : `${client.name} failed.`\n );\n results.push(\n `${result.success ? '✓' : '✗'} ${client.name}${\n result.message ? ` — ${result.message}` : ''\n }`\n );\n }\n\n p.note(results.join('\\n'), 'Results');\n p.outro('Done.');\n}\n\n// Entry point for `npx @runpod/mcp-server <add|remove>`.\nexport async function runWizard(subcommand: string): Promise<void> {\n p.intro('Runpod MCP server installer');\n\n if (subcommand === 'remove') {\n await runRemove();\n } else {\n await runAdd();\n }\n}\n","import * as fs from 'fs';\nimport * as os from 'os';\nimport * as path from 'path';\nimport { execSync, execFileSync } from 'child_process';\nimport * as jsonc from 'jsonc-parser';\n\n// The npm package and the name the server is registered under in client config.\nexport const SERVER_NAME = 'runpod';\nexport const NPM_PACKAGE = '@runpod/mcp-server@latest';\n\n// The hosted Streamable HTTP endpoint. Clients point here and authenticate with\n// the OAuth \"Sign in with Runpod\" flow — no API key is stored in their config.\n// Overridable so a non-production deployment can be targeted during testing.\nexport const HOSTED_URL =\n process.env.RUNPOD_MCP_URL ?? 'https://mcp.getrunpod.io/';\n\n// How the user wants the server wired up:\n// - local: run via npx on this machine, authenticated by an API key in the env.\n// - hosted: connect to the hosted HTTP server and sign in with Runpod (OAuth).\nexport type AddMode =\n | { kind: 'local'; apiKey: string }\n | { kind: 'hosted'; url: string };\n\nexport interface AddResult {\n success: boolean;\n message?: string;\n}\n\nexport interface McpClient {\n // Stable id used as the multiselect value.\n id: string;\n // Human-readable label shown in the picker.\n name: string;\n // True when the client appears to be installed on this machine.\n detect(): Promise<boolean>;\n // Write (or update) the Runpod server entry in the client's config.\n add(mode: AddMode): Promise<AddResult>;\n // Remove the Runpod server entry from the client's config.\n remove(): Promise<AddResult>;\n // Where the config lives, for display and manual fallback.\n describeTarget(): string;\n}\n\n// The local stdio config: Runpod's MCP server runs via npx and reads the API\n// key from the environment. VS Code's `servers` map requires an explicit\n// transport type for stdio servers (mcpServers-style clients infer it).\nfunction localServerConfig(apiKey: string, serverProperty: string) {\n const config = {\n command: 'npx',\n args: ['-y', NPM_PACKAGE],\n env: { RUNPOD_API_KEY: apiKey },\n };\n return serverProperty === 'servers' ? { type: 'stdio', ...config } : config;\n}\n\n// The hosted config. Clients with native remote-MCP support take the URL\n// directly (VS Code additionally needs `type: 'http'`); the rest reach the\n// hosted server through the `mcp-remote` stdio bridge, which also drives OAuth.\nfunction hostedServerConfig(\n strategy: 'http' | 'mcp-remote',\n serverProperty: string,\n url: string\n) {\n if (strategy === 'mcp-remote') {\n return { command: 'npx', args: ['-y', 'mcp-remote', url] };\n }\n return serverProperty === 'servers' ? { type: 'http', url } : { url };\n}\n\n// Read, edit, and write a JSON config while preserving the user's existing\n// formatting and comments (jsonc). Creates the file and parent dirs if missing.\nfunction upsertJsonServer(\n configPath: string,\n serverProperty: string,\n value: unknown\n): AddResult {\n try {\n fs.mkdirSync(path.dirname(configPath), { recursive: true });\n const content = fs.existsSync(configPath)\n ? fs.readFileSync(configPath, 'utf8')\n : '';\n const edits = jsonc.modify(content, [serverProperty, SERVER_NAME], value, {\n formattingOptions: { tabSize: 2, insertSpaces: true },\n });\n fs.writeFileSync(configPath, jsonc.applyEdits(content, edits), 'utf8');\n return { success: true };\n } catch (error) {\n return { success: false, message: errMessage(error) };\n }\n}\n\nfunction removeJsonServer(\n configPath: string,\n serverProperty: string\n): AddResult {\n try {\n if (!fs.existsSync(configPath)) {\n return { success: true, message: 'nothing to remove' };\n }\n const content = fs.readFileSync(configPath, 'utf8');\n const edits = jsonc.modify(\n content,\n [serverProperty, SERVER_NAME],\n undefined,\n { formattingOptions: { tabSize: 2, insertSpaces: true } }\n );\n fs.writeFileSync(configPath, jsonc.applyEdits(content, edits), 'utf8');\n return { success: true };\n } catch (error) {\n return { success: false, message: errMessage(error) };\n }\n}\n\nfunction errMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nfunction exists(p: string): boolean {\n try {\n return fs.existsSync(p);\n } catch {\n return false;\n }\n}\n\n// A JSON-config client that differs only in config path, server property, and\n// how it reaches the hosted server.\nfunction jsonClient(opts: {\n id: string;\n name: string;\n serverProperty?: string;\n // Native HTTP support, or the `mcp-remote` bridge for stdio-only clients.\n hostedStrategy?: 'http' | 'mcp-remote';\n configPath: () => string;\n detectPaths?: () => string[];\n}): McpClient {\n const serverProperty = opts.serverProperty ?? 'mcpServers';\n const hostedStrategy = opts.hostedStrategy ?? 'http';\n return {\n id: opts.id,\n name: opts.name,\n detect: () =>\n Promise.resolve(\n (opts.detectPaths?.() ?? [path.dirname(opts.configPath())]).some(exists)\n ),\n add: (mode) => {\n const value =\n mode.kind === 'local'\n ? localServerConfig(mode.apiKey, serverProperty)\n : hostedServerConfig(hostedStrategy, serverProperty, mode.url);\n return Promise.resolve(\n upsertJsonServer(opts.configPath(), serverProperty, value)\n );\n },\n remove: () =>\n Promise.resolve(removeJsonServer(opts.configPath(), serverProperty)),\n describeTarget: () => opts.configPath(),\n };\n}\n\n// Locate the Claude Code CLI binary across common install locations and PATH.\nfunction findClaudeBinary(): string | null {\n const candidates = [\n path.join(os.homedir(), '.claude', 'local', 'claude'),\n '/usr/local/bin/claude',\n '/opt/homebrew/bin/claude',\n ];\n for (const candidate of candidates) {\n if (exists(candidate)) return candidate;\n }\n try {\n execSync('command -v claude', { stdio: 'pipe' });\n return 'claude';\n } catch {\n return null;\n }\n}\n\nfunction runClaude(binary: string, args: string[]): AddResult {\n try {\n // execFileSync (no shell) — args pass directly, so an API key with shell\n // metacharacters can't be interpreted by a shell.\n execFileSync(binary, args, { stdio: 'pipe' });\n return { success: true };\n } catch (error) {\n const message = errMessage(error);\n // Re-running the wizard should be idempotent, not an error.\n if (message.includes('already exists')) {\n return { success: true, message: 'already configured' };\n }\n return { success: false, message };\n }\n}\n\n// Claude Code manages its own config, so we drive its CLI rather than writing\n// files directly. This mirrors the documented `claude mcp add` command.\nconst claudeCodeClient: McpClient = {\n id: 'claude-code',\n name: 'Claude Code',\n detect: () => Promise.resolve(findClaudeBinary() !== null),\n add: (mode) => {\n const binary = findClaudeBinary();\n if (!binary) {\n return Promise.resolve({\n success: false,\n message: 'claude CLI not found',\n });\n }\n const args =\n mode.kind === 'local'\n ? [\n 'mcp',\n 'add',\n SERVER_NAME,\n '--scope',\n 'user',\n '-e',\n `RUNPOD_API_KEY=${mode.apiKey}`,\n '--',\n 'npx',\n '-y',\n NPM_PACKAGE,\n ]\n : [\n 'mcp',\n 'add',\n '--transport',\n 'http',\n '--scope',\n 'user',\n SERVER_NAME,\n mode.url,\n ];\n return Promise.resolve(runClaude(binary, args));\n },\n remove: () => {\n const binary = findClaudeBinary();\n if (!binary) {\n return Promise.resolve({\n success: false,\n message: 'claude CLI not found',\n });\n }\n try {\n execFileSync(binary, ['mcp', 'remove', '--scope', 'user', SERVER_NAME], {\n stdio: 'pipe',\n });\n return Promise.resolve({ success: true });\n } catch (error) {\n return Promise.resolve({ success: true, message: errMessage(error) });\n }\n },\n describeTarget: () => 'Claude Code user config (via `claude mcp` CLI)',\n};\n\nconst home = os.homedir();\nconst appData = process.env.APPDATA ?? path.join(home, 'AppData', 'Roaming');\n\n// Claude Desktop stores its config in an OS-specific location.\nfunction claudeDesktopConfigPath(): string {\n if (process.platform === 'win32') {\n return path.join(appData, 'Claude', 'claude_desktop_config.json');\n }\n return path.join(\n home,\n 'Library',\n 'Application Support',\n 'Claude',\n 'claude_desktop_config.json'\n );\n}\n\n// VS Code uses a `servers` property (not `mcpServers`) in a per-user mcp.json.\nfunction vsCodeConfigPath(): string {\n if (process.platform === 'win32') {\n return path.join(appData, 'Code', 'User', 'mcp.json');\n }\n if (process.platform === 'darwin') {\n return path.join(\n home,\n 'Library',\n 'Application Support',\n 'Code',\n 'User',\n 'mcp.json'\n );\n }\n return path.join(home, '.config', 'Code', 'User', 'mcp.json');\n}\n\nexport const CLIENTS: McpClient[] = [\n claudeCodeClient,\n jsonClient({\n id: 'cursor',\n name: 'Cursor',\n configPath: () => path.join(home, '.cursor', 'mcp.json'),\n }),\n jsonClient({\n id: 'windsurf',\n name: 'Windsurf',\n // Windsurf is stdio-only, so it reaches the hosted server via mcp-remote.\n hostedStrategy: 'mcp-remote',\n configPath: () =>\n path.join(home, '.codeium', 'windsurf', 'mcp_config.json'),\n }),\n jsonClient({\n id: 'claude-desktop',\n name: 'Claude Desktop',\n // Claude Desktop config files are stdio-only; use the mcp-remote bridge.\n hostedStrategy: 'mcp-remote',\n configPath: claudeDesktopConfigPath,\n // Detect by the application/support directory, which exists once the app runs.\n detectPaths: () => [path.dirname(claudeDesktopConfigPath())],\n }),\n jsonClient({\n id: 'vscode',\n name: 'Visual Studio Code',\n serverProperty: 'servers',\n configPath: vsCodeConfigPath,\n detectPaths: () => [path.dirname(vsCodeConfigPath())],\n }),\n];\n"],"mappings":";;;AAAA,SAAS,gBAAAA,qBAAoB;AAC7B,YAAY,OAAO;;;ACDnB,YAAY,QAAQ;AACpB,YAAY,QAAQ;AACpB,YAAY,UAAU;AACtB,SAAS,UAAU,oBAAoB;AACvC,YAAY,WAAW;AAGhB,IAAM,cAAc;AACpB,IAAM,cAAc;AAKpB,IAAM,aACX,QAAQ,IAAI,kBAAkB;AAgChC,SAAS,kBAAkB,QAAgB,gBAAwB;AACjE,QAAM,SAAS;AAAA,IACb,SAAS;AAAA,IACT,MAAM,CAAC,MAAM,WAAW;AAAA,IACxB,KAAK,EAAE,gBAAgB,OAAO;AAAA,EAChC;AACA,SAAO,mBAAmB,YAAY,EAAE,MAAM,SAAS,GAAG,OAAO,IAAI;AACvE;AAKA,SAAS,mBACP,UACA,gBACA,KACA;AAC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AAG,SAAS;AACpC,EAAE;AAAA,IACA,KAAK,SAAS,WACV,8EACA;AAAA,EACN;AACF;AAEA,eAAe,YAA2B;AACxC,QAAM,WAAW,MAAM,UAAU;AACjC,QAAM,UAAU,MAAM,cAAc,UAAU,oBAAoB;AAElE,QAAM,UAAoB,CAAC;AAC3B,aAAW,UAAU,SAAS;AAC5B,UAAMA,WAAY,UAAQ;AAC1B,IAAAA,SAAQ,MAAM,iBAAiB,OAAO,IAAI,EAAE;AAC5C,UAAM,SAAS,MAAM,OAAO,OAAO;AACnC,IAAAA,SAAQ;AAAA,MACN,OAAO,UAAU,GAAG,OAAO,IAAI,iBAAiB,GAAG,OAAO,IAAI;AAAA,IAChE;AACA,YAAQ;AAAA,MACN,GAAG,OAAO,UAAU,WAAM,QAAG,IAAI,OAAO,IAAI,GAC1C,OAAO,UAAU,WAAM,OAAO,OAAO,KAAK,EAC5C;AAAA,IACF;AAAA,EACF;AAEA,EAAE,OAAK,QAAQ,KAAK,IAAI,GAAG,SAAS;AACpC,EAAE,QAAM,OAAO;AACjB;AAGA,eAAsB,UAAU,YAAmC;AACjE,EAAE,QAAM,6BAA6B;AAErC,MAAI,eAAe,UAAU;AAC3B,UAAM,UAAU;AAAA,EAClB,OAAO;AACL,UAAM,OAAO;AAAA,EACf;AACF;","names":["execFileSync","p","execFileSync","spinner"]}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runpod/mcp-server",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "MCP server for interacting with
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": "MCP server for interacting with Runpod API",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"main": "./dist/
|
|
8
|
-
"module": "./dist/
|
|
9
|
-
"types": "./dist/
|
|
7
|
+
"main": "./dist/stdio.cjs",
|
|
8
|
+
"module": "./dist/stdio.mjs",
|
|
9
|
+
"types": "./dist/stdio.d.ts",
|
|
10
10
|
"bin": {
|
|
11
|
-
"runpod-mcp": "./dist/
|
|
11
|
+
"runpod-mcp": "./dist/stdio.mjs"
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"dist/**/*",
|
|
@@ -17,18 +17,31 @@
|
|
|
17
17
|
"exports": {
|
|
18
18
|
"./package.json": "./package.json",
|
|
19
19
|
".": {
|
|
20
|
-
"types": "./dist/
|
|
21
|
-
"import": "./dist/
|
|
22
|
-
"require": "./dist/
|
|
20
|
+
"types": "./dist/stdio.d.ts",
|
|
21
|
+
"import": "./dist/stdio.mjs",
|
|
22
|
+
"require": "./dist/stdio.cjs"
|
|
23
|
+
},
|
|
24
|
+
"./http": {
|
|
25
|
+
"types": "./dist/http.d.ts",
|
|
26
|
+
"import": "./dist/http.mjs",
|
|
27
|
+
"require": "./dist/http.cjs"
|
|
28
|
+
},
|
|
29
|
+
"./tools": {
|
|
30
|
+
"types": "./dist/tools.d.ts",
|
|
31
|
+
"import": "./dist/tools.mjs",
|
|
32
|
+
"require": "./dist/tools.cjs"
|
|
23
33
|
}
|
|
24
34
|
},
|
|
25
35
|
"dependencies": {
|
|
36
|
+
"@clack/prompts": "^1.5.1",
|
|
26
37
|
"@modelcontextprotocol/sdk": "^1.7.0",
|
|
38
|
+
"jsonc-parser": "^3.3.1",
|
|
27
39
|
"node-fetch": "^3.3.2",
|
|
28
40
|
"zod": "^3.22.4"
|
|
29
41
|
},
|
|
30
42
|
"devDependencies": {
|
|
31
43
|
"@changesets/cli": "^2.29.6",
|
|
44
|
+
"@vercel/node": "^5.1.0",
|
|
32
45
|
"@types/node": "^20.10.5",
|
|
33
46
|
"@typescript-eslint/eslint-plugin": "^8.39.1",
|
|
34
47
|
"@typescript-eslint/parser": "^8.39.1",
|
|
@@ -39,7 +52,8 @@
|
|
|
39
52
|
"typescript": "^5.3.3"
|
|
40
53
|
},
|
|
41
54
|
"engines": {
|
|
42
|
-
"node": ">=18"
|
|
55
|
+
"node": ">=18",
|
|
56
|
+
"pnpm": ">=10"
|
|
43
57
|
},
|
|
44
58
|
"publishConfig": {
|
|
45
59
|
"access": "public"
|
|
@@ -64,10 +78,14 @@
|
|
|
64
78
|
"build:watch": "pnpm clean && tsup --watch",
|
|
65
79
|
"clean": "rm -rf dist *.tsbuildinfo",
|
|
66
80
|
"lint": "eslint \"./**/*.ts*\"",
|
|
67
|
-
"type-check": "tsc --
|
|
81
|
+
"type-check": "tsc --noEmit -p tsconfig.json",
|
|
82
|
+
"test": "node --import tsx --test tests/*.test.ts",
|
|
68
83
|
"prettier-check": "prettier --check \"./**/*.ts*\"",
|
|
69
|
-
"start": "node dist/
|
|
70
|
-
"dev": "tsx src/
|
|
84
|
+
"start": "node dist/stdio.mjs",
|
|
85
|
+
"dev": "tsx src/stdio.ts",
|
|
86
|
+
"smoke:http": "tsx scripts/smoke.ts http",
|
|
87
|
+
"smoke:stdio": "tsx scripts/smoke.ts stdio",
|
|
88
|
+
"oauth-e2e": "tsx scripts/oauth-e2e.ts",
|
|
71
89
|
"changeset": "changeset",
|
|
72
90
|
"changeset:version": "changeset version",
|
|
73
91
|
"changeset:publish": "changeset publish"
|
package/dist/index.d.cts
DELETED
package/dist/index.d.ts
DELETED