@ricsam/r5d-worker 0.0.80 → 0.0.81
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/README.md +7 -1
- package/dist/cjs/main.cjs +7 -4
- package/dist/cjs/package.json +1 -1
- package/dist/mjs/main.mjs +7 -4
- package/dist/mjs/package.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,13 @@ r5d-worker start --label macos
|
|
|
7
7
|
r5d-worker --version
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Authorize the exact worker label before starting it:
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
r5dctl auth login --worker-label macos
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The worker uses that label-bound credential from the existing `r5dctl` config file or `R5D_WORKER_TOKEN`. `R5D_API_KEY` remains an accepted legacy environment-variable name, but its value must still be the exact label-bound worker credential; a general API key or device credential cannot connect a worker. Project checkouts are managed under:
|
|
11
17
|
|
|
12
18
|
```text
|
|
13
19
|
~/.r5d/projects/<namespace>/<project>/<branch-name>
|
package/dist/cjs/main.cjs
CHANGED
|
@@ -629,7 +629,7 @@ function preparePlanEnvForShell(input) {
|
|
|
629
629
|
import_node_fs.default.mkdirSync(plansDir, { recursive: true });
|
|
630
630
|
return planEnv(input.planRoot, input.target, input.activePlanId);
|
|
631
631
|
}
|
|
632
|
-
async function verifyR5dctlAuth(baseUrl, token) {
|
|
632
|
+
async function verifyR5dctlAuth(baseUrl, token, workerLabel) {
|
|
633
633
|
const statusUrl = new URL("/api/r5dctl/auth/status", baseUrl);
|
|
634
634
|
let response;
|
|
635
635
|
try {
|
|
@@ -658,13 +658,16 @@ async function verifyR5dctlAuth(baseUrl, token) {
|
|
|
658
658
|
throw new WorkerServerUnavailableError(`Server unavailable at ${baseUrl} (${response.status})${detail}`);
|
|
659
659
|
}
|
|
660
660
|
throw new Error(
|
|
661
|
-
`Authentication failed against ${baseUrl} (${response.status})${detail}. Run \`r5dctl auth login --base-url ${baseUrl}\` or pass
|
|
661
|
+
`Authentication failed against ${baseUrl} (${response.status})${detail}. Run \`r5dctl auth login --base-url ${baseUrl} --worker-label ${workerLabel}\` or pass that exact label-bound worker token.`
|
|
662
662
|
);
|
|
663
663
|
}
|
|
664
664
|
function resolveCredentials(options, config) {
|
|
665
665
|
const token = options.token ?? process.env.R5D_WORKER_TOKEN ?? process.env.R5D_TOKEN ?? process.env.R5DCTL_TOKEN ?? config.token ?? options.apiKey ?? process.env.R5D_API_KEY ?? process.env.R5DCTL_API_KEY ?? config.apiKey;
|
|
666
666
|
if (!token) {
|
|
667
|
-
|
|
667
|
+
const workerLabel = options.label ?? "<label>";
|
|
668
|
+
throw new Error(
|
|
669
|
+
`Authentication required. Run \`r5dctl auth login --worker-label ${workerLabel}\` or set R5D_WORKER_TOKEN to that label-bound token.`
|
|
670
|
+
);
|
|
668
671
|
}
|
|
669
672
|
return {
|
|
670
673
|
baseUrl: normalizeBaseUrl(
|
|
@@ -3021,7 +3024,7 @@ async function startWorker(options) {
|
|
|
3021
3024
|
process.stdout.write(`[r5d-worker] server: ${baseUrl}
|
|
3022
3025
|
`);
|
|
3023
3026
|
runGit(["--version"]);
|
|
3024
|
-
await verifyR5dctlAuth(baseUrl, token);
|
|
3027
|
+
await verifyR5dctlAuth(baseUrl, token, label);
|
|
3025
3028
|
const initializedWorkspaceState = await workspaceSyncSingleFlight.runExclusive(() => {
|
|
3026
3029
|
if (!startupProjectSnapshotRecoveryCompleted) {
|
|
3027
3030
|
const snapshotRecovery = (0, import_project_worktrees.recoverStaleProjectWorktreeSnapshots)({
|
package/dist/cjs/package.json
CHANGED
package/dist/mjs/main.mjs
CHANGED
|
@@ -633,7 +633,7 @@ function preparePlanEnvForShell(input) {
|
|
|
633
633
|
fs.mkdirSync(plansDir, { recursive: true });
|
|
634
634
|
return planEnv(input.planRoot, input.target, input.activePlanId);
|
|
635
635
|
}
|
|
636
|
-
async function verifyR5dctlAuth(baseUrl, token) {
|
|
636
|
+
async function verifyR5dctlAuth(baseUrl, token, workerLabel) {
|
|
637
637
|
const statusUrl = new URL("/api/r5dctl/auth/status", baseUrl);
|
|
638
638
|
let response;
|
|
639
639
|
try {
|
|
@@ -662,13 +662,16 @@ async function verifyR5dctlAuth(baseUrl, token) {
|
|
|
662
662
|
throw new WorkerServerUnavailableError(`Server unavailable at ${baseUrl} (${response.status})${detail}`);
|
|
663
663
|
}
|
|
664
664
|
throw new Error(
|
|
665
|
-
`Authentication failed against ${baseUrl} (${response.status})${detail}. Run \`r5dctl auth login --base-url ${baseUrl}\` or pass
|
|
665
|
+
`Authentication failed against ${baseUrl} (${response.status})${detail}. Run \`r5dctl auth login --base-url ${baseUrl} --worker-label ${workerLabel}\` or pass that exact label-bound worker token.`
|
|
666
666
|
);
|
|
667
667
|
}
|
|
668
668
|
function resolveCredentials(options, config) {
|
|
669
669
|
const token = options.token ?? process.env.R5D_WORKER_TOKEN ?? process.env.R5D_TOKEN ?? process.env.R5DCTL_TOKEN ?? config.token ?? options.apiKey ?? process.env.R5D_API_KEY ?? process.env.R5DCTL_API_KEY ?? config.apiKey;
|
|
670
670
|
if (!token) {
|
|
671
|
-
|
|
671
|
+
const workerLabel = options.label ?? "<label>";
|
|
672
|
+
throw new Error(
|
|
673
|
+
`Authentication required. Run \`r5dctl auth login --worker-label ${workerLabel}\` or set R5D_WORKER_TOKEN to that label-bound token.`
|
|
674
|
+
);
|
|
672
675
|
}
|
|
673
676
|
return {
|
|
674
677
|
baseUrl: normalizeBaseUrl(
|
|
@@ -3025,7 +3028,7 @@ async function startWorker(options) {
|
|
|
3025
3028
|
process.stdout.write(`[r5d-worker] server: ${baseUrl}
|
|
3026
3029
|
`);
|
|
3027
3030
|
runGit(["--version"]);
|
|
3028
|
-
await verifyR5dctlAuth(baseUrl, token);
|
|
3031
|
+
await verifyR5dctlAuth(baseUrl, token, label);
|
|
3029
3032
|
const initializedWorkspaceState = await workspaceSyncSingleFlight.runExclusive(() => {
|
|
3030
3033
|
if (!startupProjectSnapshotRecoveryCompleted) {
|
|
3031
3034
|
const snapshotRecovery = recoverStaleProjectWorktreeSnapshots({
|
package/dist/mjs/package.json
CHANGED