Skip to content
This repository was archived by the owner on Aug 5, 2026. It is now read-only.

Commit c57a00e

Browse files
authored
Decouple build configuration & Update command path resolution logic (#47)
* chore: bump version to 0.1.6 and disable composite in tsconfig files * refactor: decouple build configuration from source compilation and update command path resolution logic * fix: improve path resolution, directory traversal security, and dynamic stdout messaging in mkdir handler * test: update mkdir test expectations to use double quotes for path arguments * feat: add package build steps to release workflow prior to publication * refactor: reorder build steps and consolidate WASM sandbox generation in release workflow * chore: add tsup build configuration for wasm assets to mcp * feat: add shebang to index.ts to enable direct script execution * refactor: move internal dependencies to dependencies and update tsup configuration to exclude internal packages from bundling * chore: update pnpm lockfile dependencies
1 parent 28ba46e commit c57a00e

21 files changed

Lines changed: 98 additions & 47 deletions

.github/workflows/release.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,13 @@ jobs:
4141
- name: Install dependencies
4242
run: pnpm install
4343

44-
- name: Build WASM sandboxes
45-
run: pnpm prebuild-wasm
44+
- name: Build packages
45+
run: |
46+
pnpm --filter @capsule-run/bash-types build
47+
pnpm --filter @capsule-run/bash build
48+
pnpm --filter @capsule-run/bash-wasm build
49+
pnpm prebuild-wasm
50+
pnpm --filter @capsule-run/bash-mcp build
4651
4752
- name: Publish packages in dependency order
4853
env:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "capsulerun-bash-monorepo",
3-
"version": "0.1.5",
3+
"version": "0.1.11",
44
"private": true,
55
"description": "Sandboxed bash for untrusted command execution",
66
"license": "Apache-2.0",

packages/bash-mcp/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@capsule-run/bash-mcp",
3-
"version": "0.1.5",
3+
"version": "0.1.11",
44
"description": "MCP server exposing sandboxed bash for untrusted command execution",
55
"type": "module",
66
"bin": {
@@ -12,7 +12,7 @@
1212
"scripts": {
1313
"start": "node --conditions source --import tsx/esm src/index.ts",
1414
"dev": "tsx --conditions source watch src/index.ts",
15-
"build": "tsup src/index.ts --format esm"
15+
"build": "tsup"
1616
},
1717
"homepage": "https://github.com/capsulerun/bash/tree/main/packages/bash-mcp",
1818
"repository": {
@@ -24,13 +24,13 @@
2424
"packageManager": "pnpm@10.21.0",
2525
"devDependencies": {
2626
"tsup": "^8.0.0",
27-
"tsx": "^4.0.0"
27+
"tsx": "^4.0.0",
28+
"@modelcontextprotocol/sdk": "^1.10.2",
29+
"zod": "^3.25.0",
30+
"@capsule-run/bash-types": "workspace:*"
2831
},
2932
"dependencies": {
3033
"@capsule-run/bash": "workspace:*",
31-
"@capsule-run/bash-types": "workspace:*",
32-
"@capsule-run/bash-wasm": "workspace:*",
33-
"@modelcontextprotocol/sdk": "^1.10.2",
34-
"zod": "^3.25.0"
34+
"@capsule-run/bash-wasm": "workspace:*"
3535
}
3636
}

packages/bash-mcp/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env node
12
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
23
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
34
import { z } from 'zod';
@@ -23,7 +24,7 @@ function getSession(sessionId: string): Bash {
2324
const server = new McpServer(
2425
{
2526
name: '@capsule-run/bash-mcp',
26-
version: '0.1.5',
27+
version: '0.1.11',
2728
},
2829
{
2930
instructions: `

packages/bash-mcp/tsup.config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { defineConfig } from 'tsup';
2+
3+
export default defineConfig({
4+
entry: ['src/index.ts'],
5+
format: ['esm'],
6+
dts: false,
7+
clean: true,
8+
treeshake: true,
9+
noExternal: [/^(?!@capsule-run\/).*/],
10+
tsconfig: 'tsconfig.json',
11+
});

packages/bash-types/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@capsule-run/bash-types",
3-
"version": "0.1.5",
3+
"version": "0.1.11",
44
"description": "",
55
"type": "module",
66
"homepage": "https://github.com/capsulerun/bash",
@@ -25,7 +25,7 @@
2525
}
2626
},
2727
"scripts": {
28-
"build": "tsc --project tsconfig.json",
28+
"build": "tsc --project tsconfig.build.json",
2929
"test": "echo \"Error: no test specified\" && exit 1"
3030
},
3131
"keywords": [],
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"composite": false,
5+
"declaration": true,
6+
"emitDeclarationOnly": true
7+
}
8+
}

packages/bash-types/tsconfig.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"outDir": "dist",
5-
"rootDir": "src",
6-
"declaration": true,
7-
"emitDeclarationOnly": true
5+
"rootDir": "src"
86
},
97
"include": ["src/**/*"]
108
}

packages/bash-wasm/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@capsule-run/bash-wasm",
3-
"version": "0.1.5",
3+
"version": "0.1.11",
44
"description": "Sandboxed bash for untrusted command execution",
55
"type": "module",
66
"homepage": "https://github.com/capsulerun/bash",
@@ -35,7 +35,7 @@
3535
"dist"
3636
],
3737
"scripts": {
38-
"build": "tsup && tsc --project tsconfig.json",
38+
"build": "tsup && tsc --project tsconfig.build.json",
3939
"pretest": "pip install -r sandboxes/python/requirements.txt -q",
4040
"test": "vitest run"
4141
},
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"composite": false,
5+
"declaration": true,
6+
"emitDeclarationOnly": true
7+
}
8+
}

0 commit comments

Comments
 (0)