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
31 changes: 30 additions & 1 deletion .github/workflows/mcpx-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,35 @@ jobs:
fi
go vet ./...


plugin-ts:
name: "basic: mcpx-test plugin-ts"
if: github.event_name != pull_request || github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
# #5151: lint + type-check coverage for the mcpx-owned TypeScript
# plugin sources (plugin/opencode/mcpx/), which the Go jobs and
# the bun test suite never type-check. Toolchain is pinned
# exactly in plugin/opencode/package.json + bun.lock: biome lint
# under the repo-root biome.json (mcpx/biome.json extends it and
# disables only noAssignInExpressions — daemon.ts parses Go
# durations with the canonical while ((m = re.exec(s))) loop)
# and tsc --noEmit under plugin/opencode/tsconfig.json (strict).
# Deno was evaluated first (it is already in this workflow for
# the Go legs): fails on these sources inside its
# tsc host, and default rules flag the daemon wire
# codes established patterns wholesale, so the repos existing
# biome + tsc pair (id web, pm-stack aggregator) is the fit.
- name: Install the pinned plugin check toolchain
working-directory: pkgs/mcpx/plugin/opencode
run: bun install --frozen-lockfile
- name: Lint and type-check the plugin TypeScript
working-directory: pkgs/mcpx/plugin/opencode
run: bun run check

e2e:
name: "basic: mcpx-test e2e (shard ${{ matrix.shard }})"
needs: init
Expand Down Expand Up @@ -174,7 +203,7 @@ jobs:

ci-ok:
name: "mcpx-test ci-ok"
needs: [init, unit, lint, e2e]
needs: [init, unit, lint, plugin-ts, e2e]
if: always() && (github.event_name != 'pull_request' || github.event.pull_request.draft == false)
runs-on: ubuntu-latest
timeout-minutes: 10
Expand Down
110 changes: 110 additions & 0 deletions pkgs/mcpx/plugin/opencode/bun.lock

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

14 changes: 14 additions & 0 deletions pkgs/mcpx/plugin/opencode/mcpx/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://biomejs.dev/schemas/2.5.15/schema.json",
"root": false,
"extends": [
"../../../../../biome.json"
],
"linter": {
"rules": {
"suspicious": {
"noAssignInExpressions": "off"
}
}
}
}
2 changes: 1 addition & 1 deletion pkgs/mcpx/plugin/opencode/mcpx/daemon.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ describe("goDurationMs", () => {
// Just under the ceiling still parses (the largest Go duration
// is 2562047h47m16.854775807s = 2^63-1 ns).
expect(goDurationMs("2562047h47m16.854775s")).toBeDefined();
expect(goDurationMs("2562047h47m16.854775s")).toBeLessThanOrEqual(9_223_372_036_854.776);
expect(goDurationMs("2562047h47m16.854775s")).toBeLessThanOrEqual(9_223_372_036_854.775);
// #2309: Go accepts a bare "0" as zero.
expect(goDurationMs("0")).toBe(0);
});
Expand Down
2 changes: 1 addition & 1 deletion pkgs/mcpx/plugin/opencode/mcpx/daemon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const goDurationMs = (v: string | undefined): number | undefined => {
// past the ceiling), and an infinite discovery cooldown silently
// disabled daemon rediscovery for the whole session (#2309).
// Unparseable-by-Go is this function's "treated as absent".
if (!Number.isFinite(total) || total > 9_223_372_036_854.776) return undefined;
if (!Number.isFinite(total) || total > 9_223_372_036_854.775) return undefined;
return v.trim().startsWith("-") ? undefined : total;
};

Expand Down
16 changes: 16 additions & 0 deletions pkgs/mcpx/plugin/opencode/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "mcpx-opencode-plugin",
"private": true,
"type": "module",
"scripts": {
"lint": "biome lint mcpx/",
"typecheck": "tsc --noEmit",
"check": "biome lint mcpx/ && tsc --noEmit"
},
"devDependencies": {
"@biomejs/biome": "2.5.15",
"@opencode-ai/plugin": "1.19.5",
"@types/bun": "1.4.4",
"typescript": "5.9.3"
}
}
16 changes: 16 additions & 0 deletions pkgs/mcpx/plugin/opencode/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"types": ["bun"],
"lib": ["ES2022", "DOM"],
"strict": true,
"noEmit": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"allowImportingTsExtensions": true,
"noUncheckedIndexedAccess": false
},
"include": ["mcpx/*.ts", "mcpx-session.ts"]
}
Loading