@ricsam/r5d-worker 0.0.151 → 0.0.152

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.151",
3
+ "version": "0.0.152",
4
4
  "type": "commonjs"
5
5
  }
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.151" : "development"}`);
10
+ console.log(`r5d-worker ${true ? "0.0.152" : "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>]\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.151" : "development"
18
+ true ? "0.0.152" : "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.151",
3
+ "version": "0.0.152",
4
4
  "type": "module"
5
5
  }
@@ -94,6 +94,11 @@ class WorkspaceAuthority {
94
94
  linkedWorkbench(b) {
95
95
  return Boolean(b.config.namespace && b.config.projectName);
96
96
  }
97
+ githubOrigin(b) {
98
+ if (!b.config.namespace || !b.config.projectName)
99
+ throw new WorkspaceError("invalid_config", "Project checkout is missing its GitHub repository identity");
100
+ return `https://github.com/${b.config.namespace}/${b.config.projectName}.git`;
101
+ }
97
102
  resolveHostPath(value) {
98
103
  const expanded = value === "~" ? os.homedir() : value.startsWith("~/") ? path.join(os.homedir(), value.slice(2)) : value;
99
104
  if (!path.isAbsolute(expanded) || expanded.includes("\0")) throw new WorkspaceError("unsafe_path", "Host path must be absolute or home-relative");
@@ -783,10 +788,19 @@ class WorkspaceAuthority {
783
788
  if ((await fs.readdir(b.config.cwd)).length) throw new WorkspaceError("nonempty_workbench", "Linked worktree destination must be empty");
784
789
  await git(b.repo, ["worktree", "add", "--force", b.config.cwd, b.config.branch]);
785
790
  }
786
- const remote2 = `r5d-canonical://${this.config.installationId}/${b.config.userId}/${b.config.repositoryId}`;
787
- await git(b.repo, ["config", "remote.canonical.url", remote2]);
788
- await git(b.repo, ["config", "remote.canonical.pushurl", remote2]);
791
+ const origin = this.githubOrigin(b);
792
+ await git(b.repo, ["config", "--local", "--replace-all", "remote.origin.url", origin]);
793
+ await git(b.repo, ["config", "--local", "--replace-all", "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*"]);
794
+ const localConfig = (await readRegular(path.join(b.repo, "config"), 128 * 1024)).toString("utf8");
795
+ if (/^\[remote "canonical"\]\s*$/m.test(localConfig))
796
+ await git(b.repo, ["config", "--local", "--remove-section", "remote.canonical"]);
797
+ await git(b.repo, ["config", "--local", "--replace-all", `branch.${b.config.branch}.remote`, "origin"]);
798
+ await git(b.repo, ["config", "--local", "--replace-all", `branch.${b.config.branch}.merge`, `refs/heads/${b.config.branch}`]);
799
+ await git(b.repo, ["config", "--local", "--replace-all", "push.default", "upstream"]);
800
+ await git(b.repo, ["config", "--local", "--replace-all", "credential.helper", ""]);
801
+ await git(b.repo, ["config", "--local", "--replace-all", "credential.useHttpPath", "false"]);
789
802
  await git(b.repo, ["config", "protocol.allow", "never"]);
803
+ await git(b.repo, ["config", "protocol.https.allow", "always"]);
790
804
  return;
791
805
  }
792
806
  const destination = path.join(b.config.cwd, ".git");
@@ -33,6 +33,7 @@ export declare class WorkspaceAuthority {
33
33
  private ensureRepository;
34
34
  private assertNonOverlappingCheckout;
35
35
  private linkedWorkbench;
36
+ private githubOrigin;
36
37
  private resolveHostPath;
37
38
  static open(options: WorkspaceAuthorityOptions): Promise<WorkspaceAuthority>;
38
39
  private readonly registrations;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-worker",
3
- "version": "0.0.151",
3
+ "version": "0.0.152",
4
4
  "type": "module",
5
5
  "main": "./dist/mjs/main.mjs",
6
6
  "module": "./dist/mjs/main.mjs",
@@ -21,8 +21,8 @@
21
21
  "r5d-worker": "dist/mjs/main.mjs"
22
22
  },
23
23
  "dependencies": {
24
- "@ricsam/r5d-api": "^0.0.151",
25
- "@ricsam/r5dctl": "0.0.151",
24
+ "@ricsam/r5d-api": "^0.0.152",
25
+ "@ricsam/r5dctl": "0.0.152",
26
26
  "node-pty": "1.1.0",
27
27
  "zod": "^4.1.13",
28
28
  "picomatch": "^4.0.3"