@ricsam/r5d-worker 0.0.182 → 0.0.183

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,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-worker",
3
- "version": "0.0.182",
3
+ "version": "0.0.183",
4
4
  "type": "commonjs"
5
5
  }
@@ -20605,7 +20605,7 @@ function resolveEntrypointPath(entrypoint) {
20605
20605
  }
20606
20606
  }
20607
20607
  function getR5dctlVersion() {
20608
- if (true) return "0.0.182";
20608
+ if (true) return "0.0.183";
20609
20609
  const entrypoint = process.argv[1] ? resolveEntrypointPath(process.argv[1]) : null;
20610
20610
  let current = entrypoint ? import_node_path2.default.dirname(entrypoint) : process.cwd();
20611
20611
  for (let index = 0; index < 12; index += 1) {
package/dist/mjs/main.mjs CHANGED
@@ -7,7 +7,7 @@ import { startManagerRpc } from "./runtime/releases/rpc-main.mjs";
7
7
  import { ManagerRpcConfig } from "./runtime/releases/rpc-protocol.mjs";
8
8
  const args = process.argv.slice(2);
9
9
  if (args.includes("--version")) {
10
- console.log(`r5d-worker ${true ? "0.0.182" : "development"}`);
10
+ console.log(`r5d-worker ${true ? "0.0.183" : "development"}`);
11
11
  } else if (!args.length || args.includes("--help")) {
12
12
  console.log(
13
13
  "Usage: r5d-worker start --label <label> [--root <dir>] [--base-url <url>] [--token <worker-token>] [--initial-sync merge|reset]\n r5d-worker executor /absolute/private/config.json\n r5d-worker manager /absolute/private/config.json\n\nRun independently supervised durable runtime services. Provision configuration with r5dinfra."
@@ -15,7 +15,7 @@ if (args.includes("--version")) {
15
15
  } else if (args[0] === "start") {
16
16
  const runtime = await startPersonalWorker(
17
17
  parsePersonalWorkerOptions(args.slice(1)),
18
- true ? "0.0.182" : "development"
18
+ true ? "0.0.183" : "development"
19
19
  );
20
20
  console.log(`Worker connected: ${runtime.resourceId}`);
21
21
  let closing = false;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-worker",
3
- "version": "0.0.182",
3
+ "version": "0.0.183",
4
4
  "type": "module"
5
5
  }
@@ -375,7 +375,14 @@ exec ${quote(executable)} ${quote(cli)} "$@"
375
375
  if (command.method === "search") return authority.searchFiles(identity, WorkspaceSearch.parse(command));
376
376
  }
377
377
  if (request.kind === "terminal") {
378
- if (command.method === "open" || command.method === "start") await authority.ensureHydrated(identity);
378
+ if (command.method === "open" || command.method === "start") {
379
+ try {
380
+ await authority.ensureHydrated(identity);
381
+ } catch (error) {
382
+ const code = error instanceof WorkspaceError ? error.code : "hydration_failed";
383
+ throw new WorkspaceError(code, `Shell not opened: checkout hydration failed (${code})`, true);
384
+ }
385
+ }
379
386
  if (command.method === "open" || command.method === "start") {
380
387
  const argv = command.method === "open" ? ["/bin/bash", "--noprofile", "--norc", ...command.command ? ["-c", command.command] : []] : ["/bin/sh", "-c", command.command];
381
388
  return {
@@ -1896,7 +1896,11 @@ class WorkspaceAuthority {
1896
1896
  }
1897
1897
  async runRoute(identity, run) {
1898
1898
  const b = await this.bench(identity);
1899
- if (run.userId !== identity.userId || run.sessionId !== identity.sessionId || !b.state.runs[run.operationId] || (b.state.runs[run.operationId].sessionId ?? b.config.sessionId) !== identity.sessionId)
1899
+ if (run.userId !== identity.userId || run.sessionId !== identity.sessionId)
1900
+ throw new WorkspaceError("forbidden", "Run does not belong to this workbench", true);
1901
+ if (!b.state.runs[run.operationId])
1902
+ throw new WorkspaceError("run_not_found", "No run with this operation id was admitted into this workbench", true);
1903
+ if ((b.state.runs[run.operationId].sessionId ?? b.config.sessionId) !== identity.sessionId)
1900
1904
  throw new WorkspaceError("forbidden", "Run does not belong to this workbench", true);
1901
1905
  if (b.state.runs[run.operationId].state === "rejected_capacity")
1902
1906
  throw new WorkspaceError("run_not_admitted", "This operation was definitively rejected; no executor run exists", true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-worker",
3
- "version": "0.0.182",
3
+ "version": "0.0.183",
4
4
  "type": "module",
5
5
  "main": "./dist/mjs/main.mjs",
6
6
  "module": "./dist/mjs/main.mjs",
@@ -21,7 +21,7 @@
21
21
  "r5d-worker": "dist/mjs/main.mjs"
22
22
  },
23
23
  "dependencies": {
24
- "@ricsam/r5d-api": "^0.0.182",
24
+ "@ricsam/r5d-api": "^0.0.183",
25
25
  "node-pty": "1.1.0",
26
26
  "zod": "^4.1.13",
27
27
  "picomatch": "^4.0.3"