@ricsam/r5d-worker 0.0.154 → 0.0.156
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.
package/dist/cjs/package.json
CHANGED
|
@@ -20605,7 +20605,7 @@ function resolveEntrypointPath(entrypoint) {
|
|
|
20605
20605
|
}
|
|
20606
20606
|
}
|
|
20607
20607
|
function getR5dctlVersion() {
|
|
20608
|
-
if (true) return "0.0.
|
|
20608
|
+
if (true) return "0.0.156";
|
|
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.
|
|
10
|
+
console.log(`r5d-worker ${true ? "0.0.156" : "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.
|
|
18
|
+
true ? "0.0.156" : "development"
|
|
19
19
|
);
|
|
20
20
|
console.log(`Worker connected: ${runtime.resourceId}`);
|
|
21
21
|
let closing = false;
|
package/dist/mjs/package.json
CHANGED
|
@@ -781,7 +781,7 @@ class WorkspaceAuthority {
|
|
|
781
781
|
return result;
|
|
782
782
|
});
|
|
783
783
|
}
|
|
784
|
-
async installGitPolicy(b, head, initialVisibleHead = b.config.baseCommitHash ?? head) {
|
|
784
|
+
async installGitPolicy(b, head, initialVisibleHead = b.config.baseCommitHash ?? head, remoteTrackingHead = b.config.baseCommitHash) {
|
|
785
785
|
delete b.state.publishedMetadata;
|
|
786
786
|
if (this.linkedWorkbench(b)) {
|
|
787
787
|
const destination2 = path.join(b.config.cwd, ".git");
|
|
@@ -809,6 +809,8 @@ class WorkspaceAuthority {
|
|
|
809
809
|
await git(b.repo, ["config", "--local", "--remove-section", "remote.canonical"]);
|
|
810
810
|
await git(b.repo, ["config", "--local", "--replace-all", `branch.${b.config.branch}.remote`, "origin"]);
|
|
811
811
|
await git(b.repo, ["config", "--local", "--replace-all", `branch.${b.config.branch}.merge`, `refs/heads/${b.config.branch}`]);
|
|
812
|
+
if (remoteTrackingHead)
|
|
813
|
+
await git(b.repo, ["update-ref", `refs/remotes/origin/${b.config.branch}`, remoteTrackingHead]);
|
|
812
814
|
await git(b.repo, ["config", "--local", "--replace-all", "push.default", "upstream"]);
|
|
813
815
|
await git(b.repo, ["config", "--local", "--replace-all", "credential.helper", ""]);
|
|
814
816
|
await git(b.repo, ["config", "--local", "--add", "credential.helper", GITHUB_CREDENTIAL_HELPER]);
|
|
@@ -978,7 +980,7 @@ class WorkspaceAuthority {
|
|
|
978
980
|
return this.serial(b, () => this.productAction(b, input.id, { method: "import", url: input.url, branch: input.defaultBranch }, async () => {
|
|
979
981
|
await git(b.repo, ["-c", "protocol.https.allow=always", "fetch", "--no-tags", "--no-recurse-submodules", "--", input.url, `refs/heads/${input.defaultBranch}`], void 0, void 0, { token: input.token });
|
|
980
982
|
const head = GitOid.parse((await git(b.repo, ["rev-parse", "FETCH_HEAD"])).toString().trim());
|
|
981
|
-
return this.importCommit(b, head, input.id, identity);
|
|
983
|
+
return this.importCommit(b, head, input.id, identity, head);
|
|
982
984
|
}, async () => {
|
|
983
985
|
await this.assertAvailable(b);
|
|
984
986
|
if (b.state.initialized || (await fs.readdir(b.config.cwd)).length) throw new WorkspaceError("nonempty_workbench", "Import requires a new empty workbench");
|
|
@@ -1026,7 +1028,7 @@ class WorkspaceAuthority {
|
|
|
1026
1028
|
if (target.state.initialized || (await fs.readdir(target.config.cwd)).length) throw new WorkspaceError("nonempty_workbench", "Branch already has a workbench");
|
|
1027
1029
|
}));
|
|
1028
1030
|
}
|
|
1029
|
-
async importCommit(b, head, id, identity) {
|
|
1031
|
+
async importCommit(b, head, id, identity, remoteTrackingHead) {
|
|
1030
1032
|
const visibleHead = b.config.baseCommitHash ?? head;
|
|
1031
1033
|
const entries = await selectedTree(b.repo, head);
|
|
1032
1034
|
const staged = path.join(b.directory, `import-${randomUUID()}`);
|
|
@@ -1071,7 +1073,7 @@ ${DEFAULT_WORKSPACE_IGNORE}`, { mode: 384 });
|
|
|
1071
1073
|
if (result.head !== head) throw new WorkspaceError("invalid_receipt", "Import receipt does not match selected commit");
|
|
1072
1074
|
if (this.linkedWorkbench(b)) await fs.rm(staged, { recursive: true });
|
|
1073
1075
|
else for (const name of await fs.readdir(staged)) await fs.rename(path.join(staged, name), path.join(b.config.cwd, name));
|
|
1074
|
-
await this.installGitPolicy(b, head, visibleHead);
|
|
1076
|
+
await this.installGitPolicy(b, head, visibleHead, remoteTrackingHead);
|
|
1075
1077
|
b.state.initialized = true;
|
|
1076
1078
|
b.state.head = head;
|
|
1077
1079
|
b.state.blocked = null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ricsam/r5d-worker",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.156",
|
|
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.
|
|
24
|
+
"@ricsam/r5d-api": "^0.0.156",
|
|
25
25
|
"node-pty": "1.1.0",
|
|
26
26
|
"zod": "^4.1.13",
|
|
27
27
|
"picomatch": "^4.0.3"
|