@botiverse/raft-computer 0.0.59 → 0.0.60
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/index.js +11 -1
- package/dist/lib/index.js +11 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -29971,6 +29971,9 @@ function serverDir(slockHome, serverId) {
|
|
|
29971
29971
|
function serverAttachmentPath(slockHome, serverId) {
|
|
29972
29972
|
return path2.join(serverDir(slockHome, serverId), "runner.state.json");
|
|
29973
29973
|
}
|
|
29974
|
+
function legacyServerAttachmentPath(slockHome, serverId) {
|
|
29975
|
+
return path2.join(serverDir(slockHome, serverId), "attachment.json");
|
|
29976
|
+
}
|
|
29974
29977
|
function serverRunnerPidPath(slockHome, serverId) {
|
|
29975
29978
|
return path2.join(serverDir(slockHome, serverId), "server-runner.pid");
|
|
29976
29979
|
}
|
|
@@ -30231,7 +30234,14 @@ async function readAttachmentAt(path3) {
|
|
|
30231
30234
|
}
|
|
30232
30235
|
async function readServerAttachment(slockHome, serverId) {
|
|
30233
30236
|
if (!isValidServerId(serverId)) return null;
|
|
30234
|
-
|
|
30237
|
+
const current = await readAttachmentAt(serverAttachmentPath(slockHome, serverId));
|
|
30238
|
+
const legacy = await readAttachmentAt(legacyServerAttachmentPath(slockHome, serverId));
|
|
30239
|
+
if (!current) return legacy;
|
|
30240
|
+
if (!legacy) return current;
|
|
30241
|
+
if (legacy.adoptedFromLegacy === true && current.adoptedFromLegacy !== true && legacy.serverMachineId !== current.serverMachineId) {
|
|
30242
|
+
return legacy;
|
|
30243
|
+
}
|
|
30244
|
+
return current;
|
|
30235
30245
|
}
|
|
30236
30246
|
async function writeServerAttachment(slockHome, attachment) {
|
|
30237
30247
|
if (!isValidServerId(attachment.serverId)) return;
|
package/dist/lib/index.js
CHANGED
|
@@ -358,6 +358,9 @@ function serverDir(slockHome, serverId) {
|
|
|
358
358
|
function serverAttachmentPath(slockHome, serverId) {
|
|
359
359
|
return path.join(serverDir(slockHome, serverId), "runner.state.json");
|
|
360
360
|
}
|
|
361
|
+
function legacyServerAttachmentPath(slockHome, serverId) {
|
|
362
|
+
return path.join(serverDir(slockHome, serverId), "attachment.json");
|
|
363
|
+
}
|
|
361
364
|
function serverRunnerPidPath(slockHome, serverId) {
|
|
362
365
|
return path.join(serverDir(slockHome, serverId), "server-runner.pid");
|
|
363
366
|
}
|
|
@@ -410,7 +413,14 @@ async function readAttachmentAt(path2) {
|
|
|
410
413
|
}
|
|
411
414
|
async function readServerAttachment(slockHome, serverId) {
|
|
412
415
|
if (!isValidServerId(serverId)) return null;
|
|
413
|
-
|
|
416
|
+
const current = await readAttachmentAt(serverAttachmentPath(slockHome, serverId));
|
|
417
|
+
const legacy = await readAttachmentAt(legacyServerAttachmentPath(slockHome, serverId));
|
|
418
|
+
if (!current) return legacy;
|
|
419
|
+
if (!legacy) return current;
|
|
420
|
+
if (legacy.adoptedFromLegacy === true && current.adoptedFromLegacy !== true && legacy.serverMachineId !== current.serverMachineId) {
|
|
421
|
+
return legacy;
|
|
422
|
+
}
|
|
423
|
+
return current;
|
|
414
424
|
}
|
|
415
425
|
async function listAttachedServerIds(slockHome) {
|
|
416
426
|
let entries;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botiverse/raft-computer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.60",
|
|
4
4
|
"description": "Canonical Raft Computer — standalone human/local-machine control-plane CLI (login + attach). Provides raft-computer plus the legacy slock-computer alias; distinct from the agent-facing @botiverse/raft CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|