Skip to content
Open
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
5 changes: 5 additions & 0 deletions agent-harness/cli_anything/drclaw/core/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
"cursor": "cursor-command",
"codex": "codex-command",
"gemini": "gemini-command",
"copilot": "copilot-command",
"nano": "nano-command",
}
_COMPLETE_EVENT_TYPES = {
"claude-complete",
"copilot-complete",
"codex-complete",
"gemini-complete",
"complete",
Expand All @@ -27,15 +29,18 @@
"cursor-error",
"codex-error",
"gemini-error",
"copilot-error",
"error",
}
_WATCH_EVENT_TYPES = {
"session-created",
"claude-complete",
"copilot-complete",
"codex-complete",
"gemini-complete",
"session-complete",
"session-status",
"copilot-status",
"active-sessions",
"projects_updated",
"taskmaster-project-updated",
Expand Down
3 changes: 2 additions & 1 deletion agent-harness/cli_anything/drclaw/drclaw_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@
"cursor": "cursorSessions",
"codex": "codexSessions",
"gemini": "geminiSessions",
"copilot": "copilotSessions",
}
_PROVIDER_CHOICES = ["claude", "cursor", "codex", "gemini"]
_PROVIDER_CHOICES = ["claude", "cursor", "codex", "gemini", "copilot"]
_OPENCLAW_SKILL_DIR_NAME = "drclaw"
_SKILL_MD_FILENAME = "SKILL.md"
_HARNESS_ROOT = Path(__file__).parent.parent.parent
Expand Down
3,738 changes: 1,752 additions & 1,986 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"scripts": {
"predev": "node scripts/check-deps.js",
"dev": "npm run native:node && concurrently --kill-others \"npm run server\" \"npm run client\"",
"dev:stop": "node scripts/stop-dev.mjs",
"server": "npm run native:node && node --watch-path=./server/routes --watch-path=./server/middleware --watch-path=./server/database --watch-path=./server/utils --watch-path=./server/constants --watch-path=./server/index.js server/index.js",
"client": "vite --host",
"build": "vite build",
Expand Down
75 changes: 75 additions & 0 deletions scripts/stop-dev.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import {
clearRuntimePortSync,
getRuntimePortStateSync
} from '../server/utils/runtimePorts.js'

function isPidAlive(pid) {
if (!Number.isInteger(pid) || pid <= 0) {
return false
}

try {
process.kill(pid, 0)
return true
} catch (error) {
return error.code === 'EPERM'
}
}

function wait(ms) {
return new Promise(resolve => setTimeout(resolve, ms))
}

async function stopPid(pid, label) {
if (!isPidAlive(pid)) {
console.log(`[stop-dev] ${label} PID ${pid} is not running`)
return false
}

console.log(`[stop-dev] Sending SIGTERM to ${label} PID ${pid}`)
process.kill(pid, 'SIGTERM')

for (let attempt = 0; attempt < 10; attempt += 1) {
if (!isPidAlive(pid)) {
console.log(`[stop-dev] ${label} PID ${pid} stopped`)
return true
}
await wait(200)
}

console.log(`[stop-dev] Escalating to SIGKILL for ${label} PID ${pid}`)
process.kill(pid, 'SIGKILL')
await wait(100)
return !isPidAlive(pid)
}

async function main() {
const runtimeState = getRuntimePortStateSync()
const targets = Object.entries(runtimeState)
.filter(([, entry]) => entry?.pid)
.map(([kind, entry]) => ({
kind,
pid: entry.pid,
port: entry.port
}))

if (targets.length === 0) {
console.log('[stop-dev] No tracked dr-claw dev processes found')
return
}

for (const target of targets) {
try {
await stopPid(target.pid, `${target.kind} (port ${target.port})`)
} catch (error) {
console.warn(`[stop-dev] Failed to stop ${target.kind} PID ${target.pid}: ${error.message}`)
} finally {
clearRuntimePortSync(target.kind)
}
}
}

main().catch(error => {
console.error('[stop-dev] Failed:', error.message)
process.exitCode = 1
})
Loading