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
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
push:
branches: [master]
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7

- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2
with:
bun-version: latest

- name: Install dependencies
run: bun ci

- name: Check
run: bun check

- name: Test
run: bun run test
50 changes: 44 additions & 6 deletions bun.lock

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

2 changes: 1 addition & 1 deletion bunfig.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[install]
exact=true
exact = true
linker = "isolated"
minimumReleaseAge = 259200 # 3 days
minimumReleaseAgeExcludes = []
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@
"sdk:opencode-bridge": "bun scripts/cursor-sdk-local-agent-bridge.mjs",
"test": "vitest run",
"test:watch": "vitest",
"typecheck": "tsc --noEmit",
"format": "oxfmt"
"compile": "tsc --noEmit",
"format": "oxfmt",
"check": "bun --parallel compile 'oxfmt --check'"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
},
"dependencies": {
"@cursor/sdk": "1.0.18"
},
"devDependencies": {
"@types/bun": "1.2.0",
"@types/bun": "1.3.14",
"oxfmt": "0.53.0",
"typescript": "6.0.3",
"typescript": "7.0.1-rc",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
"vitest": "4.1.8"
}
}
3 changes: 2 additions & 1 deletion server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@ async function startBridge(): Promise<BridgeSetup> {
return { bridgeUrl, close: () => void bridgeServer.close(), mode: "in-process SDK bridge" }
}

type SpawnedProcess = ReturnType<typeof Bun.spawn>
function spawnBridgeSubprocess(runtime: string): () => void {
let stopped = false
let child = Bun.spawn([runtime, bridgeScript], { stdout: "inherit", stderr: "inherit" })

const superviseExit = (proc: ReturnType<typeof Bun.spawn>) => {
const superviseExit = (proc: SpawnedProcess) => {
void proc.exited.then((code) => {
if (stopped) return
console.error(`SDK bridge exited with code ${code}; restarting in 1s.`)
Expand Down