workerdeck 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { a as ConfigError, d as parseArgs$1, f as resolveInstanceConfig, u as loadConfigFile } from "./instance-BmQhZ3Px.mjs";
1
+ import { a as ConfigError, d as parseArgs$1, f as resolveInstanceConfig, u as loadConfigFile } from "./instance-DZ2r1RGc.mjs";
2
2
  import { readFileSync } from "node:fs";
3
3
  import { join, resolve } from "node:path";
4
4
  import { parseArgs } from "node:util";
@@ -71,4 +71,4 @@ async function runReload(argv) {
71
71
  //#endregion
72
72
  export { runReload };
73
73
 
74
- //# sourceMappingURL=reload-command-CSaFgxYs.mjs.map
74
+ //# sourceMappingURL=reload-command-CnTDXayN.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"reload-command-CSaFgxYs.mjs","names":["resolvePath","parseCliArgs"],"sources":["../src/dev/reload-command.ts"],"sourcesContent":["import { readFileSync } from 'node:fs'\nimport { join, resolve as resolvePath } from 'node:path'\nimport { parseArgs } from 'node:util'\nimport { ConfigError, loadConfigFile, resolveInstanceConfig, parseArgs as parseCliArgs } from '../config.ts'\n\nconst HELP = `usage: workerdeck reload [--state-dir PATH] [--config PATH]\n\nTells a gateway started with --hot-reload to re-evaluate its own source in place.\nLive sessions, their engine child processes and any turn in flight are carried\nacross the swap. Resolves the running gateway through <state-dir>/gateway.pid,\nso it only ever reaches an instance on this machine.\n\nexit 0 = signalled, 1 = no instance found, 2 = bad arguments\n`\n\nexport async function runReload(argv: string[]): Promise<number> {\n let values: { 'state-dir'?: string; config?: string; help: boolean }\n try {\n values = parseArgs({\n args: argv,\n options: {\n 'state-dir': { type: 'string' },\n config: { type: 'string' },\n help: { type: 'boolean', default: false },\n },\n }).values as typeof values\n } catch (error) {\n process.stderr.write(`reload: ${error instanceof Error ? error.message : String(error)}\\n`)\n return 2\n }\n if (values.help) {\n process.stdout.write(HELP)\n return 0\n }\n\n let stateDir: string | null\n if (values['state-dir']) {\n stateDir = resolvePath(values['state-dir'])\n } else {\n // Resolved the way the gateway itself resolves it, config file included, so `reload` and the instance it is\n // aimed at cannot disagree about where the pidfile is.\n try {\n const loaded = await loadConfigFile(values.config)\n stateDir = resolveInstanceConfig(parseCliArgs(values.config ? ['--config', values.config] : []), loaded).stateDir\n } catch (error) {\n process.stderr.write(`reload: ${error instanceof ConfigError ? error.message : String(error)}\\n`)\n return 2\n }\n }\n if (!stateDir) {\n process.stderr.write(\n 'reload: this configuration has no state dir, so there is no pidfile to read.\\n Send SIGUSR2 to the gateway process instead.\\n',\n )\n return 1\n }\n\n const pidPath = join(stateDir, 'gateway.pid')\n let pid: number\n try {\n pid = Number.parseInt(readFileSync(pidPath, 'utf8').trim(), 10)\n } catch {\n process.stderr.write(`reload: no gateway.pid in ${stateDir}\\n Only a gateway started with --hot-reload writes one.\\n`)\n return 1\n }\n if (!Number.isInteger(pid) || pid <= 0) {\n process.stderr.write(`reload: ${pidPath} does not name a process\\n`)\n return 1\n }\n try {\n // The pid, never the process group: this reload happens inside the gateway process, and signalling the group\n // would reach the npx launcher and every engine child with it.\n process.kill(pid, 'SIGUSR2')\n } catch {\n process.stderr.write(`reload: no process ${pid} (stale pidfile in ${stateDir})\\n`)\n return 1\n }\n process.stdout.write(`reloading gateway ${pid}\\n`)\n return 0\n}\n"],"mappings":";;;;;AAKA,MAAM,OAAO;;;;;;;;;AAUb,eAAsB,UAAU,MAAiC;CAC/D,IAAI;CACJ,IAAI;EACF,SAAS,UAAU;GACjB,MAAM;GACN,SAAS;IACP,aAAa,EAAE,MAAM,SAAS;IAC9B,QAAQ,EAAE,MAAM,SAAS;IACzB,MAAM;KAAE,MAAM;KAAW,SAAS;IAAM;GAC1C;EACF,CAAC,CAAC,CAAC;CACL,SAAS,OAAO;EACd,QAAQ,OAAO,MAAM,WAAW,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,EAAE,GAAG;EAC1F,OAAO;CACT;CACA,IAAI,OAAO,MAAM;EACf,QAAQ,OAAO,MAAM,IAAI;EACzB,OAAO;CACT;CAEA,IAAI;CACJ,IAAI,OAAO,cACT,WAAWA,QAAY,OAAO,YAAY;MAI1C,IAAI;EACF,MAAM,SAAS,MAAM,eAAe,OAAO,MAAM;EACjD,WAAW,sBAAsBC,YAAa,OAAO,SAAS,CAAC,YAAY,OAAO,MAAM,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;CAC3G,SAAS,OAAO;EACd,QAAQ,OAAO,MAAM,WAAW,iBAAiB,cAAc,MAAM,UAAU,OAAO,KAAK,EAAE,GAAG;EAChG,OAAO;CACT;CAEF,IAAI,CAAC,UAAU;EACb,QAAQ,OAAO,MACb,gIACF;EACA,OAAO;CACT;CAEA,MAAM,UAAU,KAAK,UAAU,aAAa;CAC5C,IAAI;CACJ,IAAI;EACF,MAAM,OAAO,SAAS,aAAa,SAAS,MAAM,CAAC,CAAC,KAAK,GAAG,EAAE;CAChE,QAAQ;EACN,QAAQ,OAAO,MAAM,6BAA6B,SAAS,2DAA2D;EACtH,OAAO;CACT;CACA,IAAI,CAAC,OAAO,UAAU,GAAG,KAAK,OAAO,GAAG;EACtC,QAAQ,OAAO,MAAM,WAAW,QAAQ,2BAA2B;EACnE,OAAO;CACT;CACA,IAAI;EAGF,QAAQ,KAAK,KAAK,SAAS;CAC7B,QAAQ;EACN,QAAQ,OAAO,MAAM,sBAAsB,IAAI,qBAAqB,SAAS,IAAI;EACjF,OAAO;CACT;CACA,QAAQ,OAAO,MAAM,qBAAqB,IAAI,GAAG;CACjD,OAAO;AACT"}
1
+ {"version":3,"file":"reload-command-CnTDXayN.mjs","names":["resolvePath","parseCliArgs"],"sources":["../src/dev/reload-command.ts"],"sourcesContent":["import { readFileSync } from 'node:fs'\nimport { join, resolve as resolvePath } from 'node:path'\nimport { parseArgs } from 'node:util'\nimport { ConfigError, loadConfigFile, resolveInstanceConfig, parseArgs as parseCliArgs } from '../config.ts'\n\nconst HELP = `usage: workerdeck reload [--state-dir PATH] [--config PATH]\n\nTells a gateway started with --hot-reload to re-evaluate its own source in place.\nLive sessions, their engine child processes and any turn in flight are carried\nacross the swap. Resolves the running gateway through <state-dir>/gateway.pid,\nso it only ever reaches an instance on this machine.\n\nexit 0 = signalled, 1 = no instance found, 2 = bad arguments\n`\n\nexport async function runReload(argv: string[]): Promise<number> {\n let values: { 'state-dir'?: string; config?: string; help: boolean }\n try {\n values = parseArgs({\n args: argv,\n options: {\n 'state-dir': { type: 'string' },\n config: { type: 'string' },\n help: { type: 'boolean', default: false },\n },\n }).values as typeof values\n } catch (error) {\n process.stderr.write(`reload: ${error instanceof Error ? error.message : String(error)}\\n`)\n return 2\n }\n if (values.help) {\n process.stdout.write(HELP)\n return 0\n }\n\n let stateDir: string | null\n if (values['state-dir']) {\n stateDir = resolvePath(values['state-dir'])\n } else {\n // Resolved the way the gateway itself resolves it, config file included, so `reload` and the instance it is\n // aimed at cannot disagree about where the pidfile is.\n try {\n const loaded = await loadConfigFile(values.config)\n stateDir = resolveInstanceConfig(parseCliArgs(values.config ? ['--config', values.config] : []), loaded).stateDir\n } catch (error) {\n process.stderr.write(`reload: ${error instanceof ConfigError ? error.message : String(error)}\\n`)\n return 2\n }\n }\n if (!stateDir) {\n process.stderr.write(\n 'reload: this configuration has no state dir, so there is no pidfile to read.\\n Send SIGUSR2 to the gateway process instead.\\n',\n )\n return 1\n }\n\n const pidPath = join(stateDir, 'gateway.pid')\n let pid: number\n try {\n pid = Number.parseInt(readFileSync(pidPath, 'utf8').trim(), 10)\n } catch {\n process.stderr.write(`reload: no gateway.pid in ${stateDir}\\n Only a gateway started with --hot-reload writes one.\\n`)\n return 1\n }\n if (!Number.isInteger(pid) || pid <= 0) {\n process.stderr.write(`reload: ${pidPath} does not name a process\\n`)\n return 1\n }\n try {\n // The pid, never the process group: this reload happens inside the gateway process, and signalling the group\n // would reach the npx launcher and every engine child with it.\n process.kill(pid, 'SIGUSR2')\n } catch {\n process.stderr.write(`reload: no process ${pid} (stale pidfile in ${stateDir})\\n`)\n return 1\n }\n process.stdout.write(`reloading gateway ${pid}\\n`)\n return 0\n}\n"],"mappings":";;;;;AAKA,MAAM,OAAO;;;;;;;;;AAUb,eAAsB,UAAU,MAAiC;CAC/D,IAAI;CACJ,IAAI;EACF,SAAS,UAAU;GACjB,MAAM;GACN,SAAS;IACP,aAAa,EAAE,MAAM,SAAS;IAC9B,QAAQ,EAAE,MAAM,SAAS;IACzB,MAAM;KAAE,MAAM;KAAW,SAAS;IAAM;GAC1C;EACF,CAAC,CAAC,CAAC;CACL,SAAS,OAAO;EACd,QAAQ,OAAO,MAAM,WAAW,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,EAAE,GAAG;EAC1F,OAAO;CACT;CACA,IAAI,OAAO,MAAM;EACf,QAAQ,OAAO,MAAM,IAAI;EACzB,OAAO;CACT;CAEA,IAAI;CACJ,IAAI,OAAO,cACT,WAAWA,QAAY,OAAO,YAAY;MAI1C,IAAI;EACF,MAAM,SAAS,MAAM,eAAe,OAAO,MAAM;EACjD,WAAW,sBAAsBC,YAAa,OAAO,SAAS,CAAC,YAAY,OAAO,MAAM,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;CAC3G,SAAS,OAAO;EACd,QAAQ,OAAO,MAAM,WAAW,iBAAiB,cAAc,MAAM,UAAU,OAAO,KAAK,EAAE,GAAG;EAChG,OAAO;CACT;CAEF,IAAI,CAAC,UAAU;EACb,QAAQ,OAAO,MACb,gIACF;EACA,OAAO;CACT;CAEA,MAAM,UAAU,KAAK,UAAU,aAAa;CAC5C,IAAI;CACJ,IAAI;EACF,MAAM,OAAO,SAAS,aAAa,SAAS,MAAM,CAAC,CAAC,KAAK,GAAG,EAAE;CAChE,QAAQ;EACN,QAAQ,OAAO,MAAM,6BAA6B,SAAS,2DAA2D;EACtH,OAAO;CACT;CACA,IAAI,CAAC,OAAO,UAAU,GAAG,KAAK,OAAO,GAAG;EACtC,QAAQ,OAAO,MAAM,WAAW,QAAQ,2BAA2B;EACnE,OAAO;CACT;CACA,IAAI;EAGF,QAAQ,KAAK,KAAK,SAAS;CAC7B,QAAQ;EACN,QAAQ,OAAO,MAAM,sBAAsB,IAAI,qBAAqB,SAAS,IAAI;EACjF,OAAO;CACT;CACA,QAAQ,OAAO,MAAM,qBAAqB,IAAI,GAAG;CACjD,OAAO;AACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workerdeck",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "type": "module",
5
5
  "description": "Turnkey WorkerDeck instance: `npx workerdeck` runs the session gateway and the full dashboard on one port. The @workerdeck/* packages are the libraries you embed; this is the service you run.",
6
6
  "license": "MIT",
@@ -21,8 +21,9 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@openai/codex": "~0.158.0",
24
- "@workerdeck/server": "3.2.0",
25
- "@workerdeck/web": "3.2.0"
24
+ "@workerdeck/relay": "3.3.0",
25
+ "@workerdeck/server": "3.3.0",
26
+ "@workerdeck/web": "3.3.0"
26
27
  },
27
28
  "devDependencies": {
28
29
  "@anthropic-ai/claude-agent-sdk": "^0.3.284",
@@ -34,7 +35,7 @@
34
35
  "tsdown": "^0.22.14",
35
36
  "vitest": "^4.1.11",
36
37
  "ws": "^8.21.3",
37
- "@workerdeck/protocol": "3.2.0"
38
+ "@workerdeck/protocol": "3.3.0"
38
39
  },
39
40
  "author": "Tobias Strebitzer",
40
41
  "repository": {