Files
Gabriel Brown c1263b2e69 Worker: interactive terminal WebSocket bridge (PTY in workspace container)
- attachTerminalServer() upgrades /jobs/:id/terminal WS connections, verifying a
  short-lived job-scoped HMAC token (verifyTerminalToken) so the browser never
  holds the worker secret
- Bridges the socket to a bash PTY via dockerode exec (Tty) in a persistent
  per-job shell container (spoon-agent-term-<id>) mounting the workspace; binary
  frames = stdin, JSON text frames = resize; idle containers reaped after 30m
- New env: SPOON_AGENT_TERMINAL_IMAGE/SECRET/IDLE_MS (secret falls back to the
  shared worker internal token)
2026-06-24 08:16:39 -04:00

41 lines
1.3 KiB
JSON

{
"name": "@spoon/agent-worker",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"dev": "bun with-env bash ../../scripts/dev-agent-worker -- bun src/index.ts",
"start": "bun src/index.ts",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "eslint --flag unstable_native_nodejs_ts_config",
"typecheck": "tsc --noEmit",
"test:unit": "vitest run --project unit --passWithNoTests",
"test:integration": "vitest run --project integration --passWithNoTests",
"test:component": "vitest run --project component --passWithNoTests",
"with-env": "sh ../../scripts/with-env ${INFISICAL_ENV:-dev} --"
},
"dependencies": {
"@octokit/auth-app": "^8.2.0",
"@octokit/rest": "^22.0.1",
"@opencode-ai/sdk": "latest",
"convex": "catalog:convex",
"dockerode": "^4.0.7",
"execa": "latest",
"ws": "catalog:",
"zod": "catalog:"
},
"devDependencies": {
"@spoon/eslint-config": "workspace:*",
"@spoon/prettier-config": "workspace:*",
"@spoon/tsconfig": "workspace:*",
"@types/dockerode": "^3.3.42",
"@types/node": "catalog:",
"@types/ws": "^8.18.1",
"eslint": "catalog:",
"prettier": "catalog:",
"typescript": "catalog:",
"vitest": "catalog:test"
},
"prettier": "@spoon/prettier-config"
}