Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/repo/rolldown.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
REPO_ROOT,
SOCKET_GATE_DIST_DIR,
SOCKET_GATE_SRC_DIR,
} from '../../scripts/repo/paths.mts'
} from '../../scripts/paths.mts'
import { createLibStubPlugin } from './rolldown/lib-stub.mts'

// Externalize Node builtins (with + without `node:` prefix). Everything
Expand Down
1 change: 1 addition & 0 deletions .config/repo/vitest.e2e.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ process.env['TZ'] ??= 'UTC'
export default defineConfig({
test: {
...repoTestOptions,
globalSetup: ['./scripts/test/e2e/build.mts'],
include: ['test/e2e/**/*.test.mts'],
},
})
2 changes: 1 addition & 1 deletion .git-hooks/commit-msg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh
set -e
exec node "$(git rev-parse --show-toplevel)/scripts/repo/hooks/commit-msg.mts" "$@"
exec node "$(git rev-parse --show-toplevel)/scripts/hooks/commit-msg.mts" "$@"
2 changes: 1 addition & 1 deletion .git-hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh
set -e
exec node "$(git rev-parse --show-toplevel)/scripts/repo/hooks/pre-commit.mts" "$@"
exec node "$(git rev-parse --show-toplevel)/scripts/hooks/pre-commit.mts" "$@"
4 changes: 3 additions & 1 deletion .github/workflows/ci-gates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:

test:
name: 'Test (${{ matrix.os }})'
env:
SOCKET_MCP_TERMINAL_ARTIFACTS: .cache/terminal-screenshots
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -63,6 +65,6 @@ jobs:
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: terminal-screenshots-${{ matrix.os }}
path: .cache/terminal-screenshots/
path: ${{ env.SOCKET_MCP_TERMINAL_ARTIFACTS }}
include-hidden-files: true
if-no-files-found: ignore
6 changes: 3 additions & 3 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ jobs:
PR_APP_SLUG: ${{ steps.pr-app.outputs.app-slug }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_SHA: ${{ github.sha }}
run: node scripts/repo/npm/prepare.mts
run: node scripts/npm/prepare.mts
- name: Validate package version and release ref
if: ${{ steps.preparation.outputs.should-stage == 'true' }}
env:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
REF: ${{ github.ref }}
run: node scripts/repo/npm/validate.mts
run: node scripts/npm/validate.mts
- name: Verify package
if: ${{ steps.preparation.outputs.should-stage == 'true' }}
run: pnpm run repo:check && pnpm run cover
- name: Stage package with npm provenance
if: ${{ steps.preparation.outputs.should-stage == 'true' }}
env:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
run: node scripts/repo/npm/publish.mts
run: node scripts/npm/publish.mts
2 changes: 1 addition & 1 deletion .github/workflows/release-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
# anonymous HEAD 404 cannot distinguish pending, blocked, deleted, or
# missing versions. A timeout preserves the version for retry.
- name: Wait for exact npm version
run: node scripts/repo/npm/availability.mts "${VERSION}"
run: node scripts/npm/availability.mts "${VERSION}"
env:
VERSION: ${{ steps.release.outputs.version }}
- name: Create or finish GitHub release
Expand Down
6 changes: 3 additions & 3 deletions mock-client/debug-client.mts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
* server still answers a pre-2026 client exactly as it always did. The two
* SDK-backed clients in this directory cover the modern era.
*/
import { isMainModule, runMain } from '../scripts/repo/cli.mts'
import type { ScriptMeta } from '../scripts/repo/cli.mts'
import { isMainModule, runMain } from '../scripts/cli.mts'
import type { ScriptMeta } from '../scripts/cli.mts'
import process from 'node:process'
import readline from 'node:readline'

import { LATEST_PROTOCOL_VERSION } from '@modelcontextprotocol/client'
import { spawn } from '@socketsecurity/lib-stable/process/spawn/child'
import { getDefaultLogger } from '@socketsecurity/lib/logger/default'

import { SERVER_SOURCE } from '../scripts/repo/paths.mts'
import { SERVER_SOURCE } from '../scripts/paths.mts'

const logger = getDefaultLogger()

Expand Down
4 changes: 2 additions & 2 deletions mock-client/http-client.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import { isMainModule, runMain } from '../scripts/repo/cli.mts'
import type { ScriptMeta } from '../scripts/repo/cli.mts'
import { isMainModule, runMain } from '../scripts/cli.mts'
import type { ScriptMeta } from '../scripts/cli.mts'
import process from 'node:process'

import {
Expand Down
6 changes: 3 additions & 3 deletions mock-client/stdio-client.mts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env node
import { isMainModule, runMain } from '../scripts/repo/cli.mts'
import type { ScriptMeta } from '../scripts/repo/cli.mts'
import { isMainModule, runMain } from '../scripts/cli.mts'
import type { ScriptMeta } from '../scripts/cli.mts'
import process from 'node:process'

import { Client } from '@modelcontextprotocol/client'
import { StdioClientTransport } from '@modelcontextprotocol/client/stdio'
import { getDefaultLogger } from '@socketsecurity/lib/logger/default'

import { SERVER_SOURCE } from '../scripts/repo/paths.mts'
import { SERVER_SOURCE } from '../scripts/paths.mts'

const logger = getDefaultLogger()

Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@
"provenance": true
},
"scripts": {
"build": "node scripts/repo/build.mts",
"build": "node scripts/build.mts",
"build-mcpb": "pnpm run build && pnpm run build-mcpb:versions_match && pnpm run build-mcpb:validate && pnpm run build-mcpb:ensure-deps && pnpm run build-mcpb:mcpb-pack",
"build-mcpb:ensure-deps": "npm install --production --ignore-scripts",
"build-mcpb:mcpb-pack": "mcpb pack ./",
"build-mcpb:validate": "mcpb validate ./",
"build-mcpb:versions_match": "node scripts/repo/check-versions.mts",
"build:bundle": "node scripts/repo/build.mts",
"build-mcpb:versions_match": "node scripts/check-versions.mts",
"build:bundle": "node scripts/build.mts",
"build:permissions": "chmod +x ./dist/index.cjs",
"repo:check": "pnpm run repo:type && pnpm run build",
"repo:type": "tsc --noEmit -p tsconfig.json",
"repo:scan": "node scripts/repo/scan.mts",
"clean": "node scripts/repo/clean.mts",
"repo:scan": "node scripts/scan.mts",
"clean": "node scripts/clean.mts",
"cover": "vitest run --coverage --config .config/repo/vitest.config.mts",
"debug-http": "node ./mock-client/http-client.mts",
"debug-sdk": "node ./mock-client/stdio-client.mts",
Expand All @@ -51,12 +51,12 @@
"check": "pnpm run fmt:check && pnpm run lint && pnpm run repo:check && pnpm run build-mcpb:versions_match && pnpm run repo:scan",
"mcp:schema:check": "mcp-tada check --command node --arg index.mts --env SOCKET_API_TOKEN=YOUR_API_TOKEN --env MCP_HTTP_MODE=false --timeout 5000 --against test/repo/integration/server-schema.golden.json",
"mcp:schema:update": "mcp-tada introspect --command node --arg index.mts --env SOCKET_API_TOKEN=YOUR_API_TOKEN --env MCP_HTTP_MODE=false --timeout 5000 --json --out test/repo/integration/server-schema.golden.json && pnpm run fmt test/repo/integration/server-schema.golden.json",
"plugin:chatgpt:pack": "node scripts/repo/plugin/chatgpt/pack.mts",
"plugin:chatgpt:pack": "node scripts/plugin/chatgpt/pack.mts",
"postpublish": "pnpm run clean",
"prepare": "node scripts/repo/install-git-hooks.mts",
"prepare": "node scripts/install-git-hooks.mts",
"prepublishOnly": "node -e \"if (process.env.GITHUB_ACTIONS !== 'true') throw new Error('Publish through the npm workflow')\"",
"publish:npm": "node scripts/repo/npm/dispatch.mts",
"approve:npm": "node scripts/repo/npm/approve.mts",
"publish:npm": "node scripts/npm/dispatch.mts",
"approve:npm": "node scripts/npm/approve.mts",
"server-http": "pnpm run build:bundle && MCP_HTTP_MODE=true SOCKET_API_TOKEN=${SOCKET_API_TOKEN:-${SOCKET_API_KEY}} node ./dist/index.cjs",
"server-http:debug": "pnpm run build:bundle && SOCKET_DEBUG=1 MCP_HTTP_MODE=true SOCKET_API_TOKEN=${SOCKET_API_TOKEN:-${SOCKET_API_KEY}} node ./dist/index.cjs",
"server-stdio": "pnpm run build:bundle && SOCKET_API_TOKEN=${SOCKET_API_TOKEN:-${SOCKET_API_KEY}} node ./dist/index.cjs",
Expand All @@ -65,7 +65,7 @@
"test:e2e": "vitest run --config .config/repo/vitest.e2e.config.mts",
"test:e2e:update": "vitest run --update --config .config/repo/vitest.e2e.config.mts",
"snapshots:refresh": "vitest run --update --config .config/repo/vitest.e2e.config.mts test/e2e/termless.test.mts",
"test:fuzz": "node scripts/repo/fuzz.mts",
"test:fuzz": "node scripts/fuzz.mts",
"test:tsc": "tsgo --noEmit -p tsconfig.json"
},
"devDependencies": {
Expand All @@ -82,7 +82,7 @@
"@socketsecurity/sdk": "catalog:",
"@socketsecurity/sdk-stable": "catalog:",
"@termless/core": "0.11.0",
"@termless/vterm": "0.11.0",
"@termless/xtermjs": "0.11.0",
"@types/node": "catalog:",
"@typescript/native-preview": "catalog:",
"@vitest/coverage-v8": "catalog:",
Expand Down
13 changes: 13 additions & 0 deletions patches/@termless__core@0.11.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/dist/backends-CRpWNI-T.mjs b/dist/backends-CRpWNI-T.mjs
index 81de773c4f73a2b4c53ecb5249d906c21b4ebdfe..7504a072f7b3d63a69318b1947d0d45d4d184a99 100644
--- a/dist/backends-CRpWNI-T.mjs
+++ b/dist/backends-CRpWNI-T.mjs
@@ -113,7 +113,7 @@ function spawnNodePty(options) {
kill(signal) {
const sig = signal === 1 ? "SIGHUP" : signal === 9 ? "SIGKILL" : "SIGTERM";
try {
- ptyProcess.kill(sig);
+ ptyProcess.kill(process.platform === "win32" ? undefined : sig);
} catch {}
},
get exitCode() {
40 changes: 25 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -279,4 +279,5 @@ peerDependencyRules:
"@socketsecurity/registry>typescript": 7.1.0-dev.20261015.1
mcp-tada>typescript: 7.1.0-dev.20261015.1
patchedDependencies:
'@termless/core@0.11.0': patches/@termless__core@0.11.0.patch
vitest@5.0.5: patches/vitest_5.0.5.patch
2 changes: 1 addition & 1 deletion scripts/repo/build.mts → scripts/build.mts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { safeDelete } from '@socketsecurity/lib-stable/fs/safe'
import { getDefaultLogger } from '@socketsecurity/lib-stable/logger/default'
import { rolldown } from 'rolldown'

import { buildConfigs } from '../../.config/repo/rolldown.config.mts'
import { buildConfigs } from '../.config/repo/rolldown.config.mts'
import {
DIST_DIR,
SOCKET_GATE_DIST_DIR,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions scripts/repo/fuzz.mts → scripts/fuzz.mts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import type { SpawnSyncOptions } from '@socketsecurity/lib-stable/process/spawn/

const logger = getDefaultLogger()

// scripts/repo/fuzz.mts → repo root is two levels up.
const repoRoot = path.resolve(import.meta.dirname, '..', '..')
// scripts/fuzz.mts → repo root is one level up.
const repoRoot = path.resolve(import.meta.dirname, '..')
const VITEST_BIN = path.join(
repoRoot,
'node_modules',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export async function main(args = process.argv.slice(2)): Promise<void> {
version,
)
)
throw new Error('Usage: node scripts/repo/npm/availability.mts <version>')
throw new Error('Usage: node scripts/npm/availability.mts <version>')
await waitForNpmVersion(
`https://registry.npmjs.org/@socketsecurity%2fmcp/${encodeURIComponent(version)}`,
)
Expand All @@ -87,5 +87,5 @@ if (isMainModule(import.meta.url))
runMain(main, {
describe:
'Waits for the exact npm version to become anonymously available.',
help: 'Usage: node scripts/repo/npm/availability.mts <version>',
help: 'Usage: node scripts/npm/availability.mts <version>',
})
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion scripts/repo/npm/prepare.mts → scripts/npm/prepare.mts
Original file line number Diff line number Diff line change
Expand Up @@ -577,5 +577,5 @@ if (isMainModule(import.meta.url))
runMain(() => runNpmReleasePreparation(), {
describe:
'Prepares a version bump pull request or resumes a merged npm release.',
help: 'Usage: node scripts/repo/npm/prepare.mts',
help: 'Usage: node scripts/npm/prepare.mts',
})
2 changes: 1 addition & 1 deletion scripts/repo/npm/publish.mts → scripts/npm/publish.mts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,6 @@ if (isMainModule(import.meta.url))
{
describe:
'Builds once, validates, and stages the npm package with provenance.',
help: 'Usage: node scripts/repo/npm/publish.mts (inside the publish workflow)',
help: 'Usage: node scripts/npm/publish.mts (inside the publish workflow)',
},
)
File renamed without changes.
2 changes: 1 addition & 1 deletion scripts/repo/npm/validate.mts → scripts/npm/validate.mts
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ function main(): void {
if (isMainModule(import.meta.url))
runMain(main, {
describe: 'Validates the npm release version, tag, and source branch.',
help: 'Usage: node scripts/repo/npm/validate.mts (inside the publish workflow)',
help: 'Usage: node scripts/npm/validate.mts (inside the publish workflow)',
})
5 changes: 4 additions & 1 deletion scripts/repo/paths.mts → scripts/paths.mts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
import path from 'node:path'
import { fileURLToPath } from 'node:url'

import manifest from '../package.json' with { type: 'json' }

export const REPO_ROOT = path.resolve(
path.dirname(fileURLToPath(import.meta.url)),
'../..',
'..',
)

/**
Expand All @@ -24,6 +26,7 @@ export const DIST_DIR = path.join(REPO_ROOT, 'dist')
*/

export const SERVER_SOURCE = path.join(REPO_ROOT, 'index.mts')
export const SERVER_BIN = path.resolve(REPO_ROOT, manifest.bin['socket-mcp'])

/**
* Absolute path to the ChatGPT plugin package source: the listing manifest,
Expand Down
Loading
Loading