@open-artifacts/bus 0.151.1 → 0.152.1
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/assets/oa-bus.ts +1 -1
- package/assets/openclaw/index.js +1 -1
- package/assets/openclaw/package.json +1 -1
- package/dist/index.js +206 -106
- package/package.json +1 -1
package/assets/oa-bus.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { StringDecoder } from "node:string_decoder";
|
|
|
11
11
|
type Json = Record<string, unknown>;
|
|
12
12
|
|
|
13
13
|
/** The IPC marker (CONTRACT.md): the package version, stamped by the CLI's bundler. */
|
|
14
|
-
const CLIENT_VERSION = "0.
|
|
14
|
+
const CLIENT_VERSION = "0.152.1";
|
|
15
15
|
|
|
16
16
|
type Frame = Json & { type: string; id: string };
|
|
17
17
|
type Ctx = {
|
package/assets/openclaw/index.js
CHANGED
|
@@ -27704,7 +27704,7 @@ var base2 = { v: external_exports.literal(V), id: external_exports.string().min(
|
|
|
27704
27704
|
var late = { late: external_exports.array(external_exports.string().min(1)).optional() };
|
|
27705
27705
|
var isWellFormed2 = (s) => s.isWellFormed();
|
|
27706
27706
|
var WELL_FORMED = { message: "text is not well-formed unicode" };
|
|
27707
|
-
var CLIENT_VERSION = true ? "0.
|
|
27707
|
+
var CLIENT_VERSION = true ? "0.152.1" : "0.0.0";
|
|
27708
27708
|
var clientVersion = {
|
|
27709
27709
|
client_version: external_exports.string().min(1).max(64).optional()
|
|
27710
27710
|
};
|
package/dist/index.js
CHANGED
|
@@ -21752,7 +21752,7 @@ var init_frames = __esm({
|
|
|
21752
21752
|
late = { late: external_exports.array(external_exports.string().min(1)).optional() };
|
|
21753
21753
|
isWellFormed2 = (s) => s.isWellFormed();
|
|
21754
21754
|
WELL_FORMED = { message: "text is not well-formed unicode" };
|
|
21755
|
-
CLIENT_VERSION = true ? "0.
|
|
21755
|
+
CLIENT_VERSION = true ? "0.152.1" : "0.0.0";
|
|
21756
21756
|
clientVersion = {
|
|
21757
21757
|
client_version: external_exports.string().min(1).max(64).optional()
|
|
21758
21758
|
};
|
|
@@ -40429,7 +40429,7 @@ import { join as join20 } from "node:path";
|
|
|
40429
40429
|
// ../bus-daemon/src/index.ts
|
|
40430
40430
|
init_src3();
|
|
40431
40431
|
import { randomBytes as randomBytes3 } from "node:crypto";
|
|
40432
|
-
import { lstatSync as lstatSync8, realpathSync as realpathSync7, writeFileSync as
|
|
40432
|
+
import { lstatSync as lstatSync8, realpathSync as realpathSync7, writeFileSync as writeFileSync7 } from "node:fs";
|
|
40433
40433
|
import { basename as basename5, isAbsolute as isAbsolute7, join as join16 } from "node:path";
|
|
40434
40434
|
|
|
40435
40435
|
// ../bus-adapter-opencode/src/version.ts
|
|
@@ -41516,10 +41516,9 @@ function defaultOpenSessions() {
|
|
|
41516
41516
|
});
|
|
41517
41517
|
}
|
|
41518
41518
|
|
|
41519
|
-
// ../bus-daemon/src/
|
|
41520
|
-
init_src();
|
|
41519
|
+
// ../bus-daemon/src/claude-links.ts
|
|
41521
41520
|
init_zod();
|
|
41522
|
-
import {
|
|
41521
|
+
import { renameSync as renameSync3, rmSync as rmSync3, writeFileSync as writeFileSync2 } from "node:fs";
|
|
41523
41522
|
|
|
41524
41523
|
// ../bus-daemon/src/own-file.ts
|
|
41525
41524
|
import {
|
|
@@ -41615,7 +41614,64 @@ function readOwnFile(file2, uid = process.getuid?.(), opts = {}) {
|
|
|
41615
41614
|
}
|
|
41616
41615
|
}
|
|
41617
41616
|
|
|
41617
|
+
// ../bus-daemon/src/claude-links.ts
|
|
41618
|
+
var CLAUDE_LINKS_MAX = 64;
|
|
41619
|
+
var EntrySchema = external_exports.strictObject({
|
|
41620
|
+
pid: external_exports.number().int().positive(),
|
|
41621
|
+
procStart: external_exports.string().min(1).max(100),
|
|
41622
|
+
hashes: external_exports.array(external_exports.string().regex(/^[0-9a-f]{64}$/)).min(1)
|
|
41623
|
+
});
|
|
41624
|
+
var FileSchema = external_exports.strictObject({
|
|
41625
|
+
v: external_exports.literal(1),
|
|
41626
|
+
links: external_exports.array(external_exports.unknown())
|
|
41627
|
+
});
|
|
41628
|
+
function readClaudeLinks(file2, uid = process.getuid?.(), log = () => {
|
|
41629
|
+
}) {
|
|
41630
|
+
try {
|
|
41631
|
+
const f = readOwnFile(file2, uid);
|
|
41632
|
+
if (f.state === "unsafe") log(`ignoring ${file2}: ${f.why}`);
|
|
41633
|
+
if (f.state !== "ok") return [];
|
|
41634
|
+
const top = FileSchema.safeParse(JSON.parse(f.text));
|
|
41635
|
+
if (!top.success) {
|
|
41636
|
+
log(`ignoring ${file2}: not the expected shape`);
|
|
41637
|
+
return [];
|
|
41638
|
+
}
|
|
41639
|
+
const out = [];
|
|
41640
|
+
for (const raw of top.data.links) {
|
|
41641
|
+
if (out.length >= CLAUDE_LINKS_MAX) break;
|
|
41642
|
+
const one2 = EntrySchema.safeParse(raw);
|
|
41643
|
+
if (one2.success)
|
|
41644
|
+
out.push({
|
|
41645
|
+
...one2.data,
|
|
41646
|
+
hashes: one2.data.hashes.slice(-LINK_HASHES_MAX)
|
|
41647
|
+
});
|
|
41648
|
+
}
|
|
41649
|
+
return out;
|
|
41650
|
+
} catch (e) {
|
|
41651
|
+
log(`ignoring ${file2}: ${e instanceof Error ? e.message : String(e)}`);
|
|
41652
|
+
return [];
|
|
41653
|
+
}
|
|
41654
|
+
}
|
|
41655
|
+
function writeClaudeLinks(file2, links) {
|
|
41656
|
+
const tmp = `${file2}.${process.pid}.tmp`;
|
|
41657
|
+
rmSync3(tmp, { force: true });
|
|
41658
|
+
try {
|
|
41659
|
+
writeFileSync2(
|
|
41660
|
+
tmp,
|
|
41661
|
+
JSON.stringify({ v: 1, links: links.slice(0, CLAUDE_LINKS_MAX) }),
|
|
41662
|
+
{ mode: 384, flag: "wx" }
|
|
41663
|
+
);
|
|
41664
|
+
renameSync3(tmp, file2);
|
|
41665
|
+
} catch (e) {
|
|
41666
|
+
rmSync3(tmp, { force: true });
|
|
41667
|
+
throw e;
|
|
41668
|
+
}
|
|
41669
|
+
}
|
|
41670
|
+
|
|
41618
41671
|
// ../bus-daemon/src/codex-agents.ts
|
|
41672
|
+
init_src();
|
|
41673
|
+
init_zod();
|
|
41674
|
+
import { chmodSync as chmodSync4, renameSync as renameSync4, writeFileSync as writeFileSync3 } from "node:fs";
|
|
41619
41675
|
var CodexAgentSchema = external_exports.strictObject({
|
|
41620
41676
|
/** Joined into the thread's lock path: a real ref, never `../`. */
|
|
41621
41677
|
ref: AgentRefSchema,
|
|
@@ -41626,7 +41682,7 @@ var CodexAgentSchema = external_exports.strictObject({
|
|
|
41626
41682
|
sentName: external_exports.string().max(200).optional(),
|
|
41627
41683
|
busName: external_exports.string().min(1).max(200)
|
|
41628
41684
|
});
|
|
41629
|
-
var
|
|
41685
|
+
var FileSchema2 = external_exports.strictObject({
|
|
41630
41686
|
v: external_exports.literal(1),
|
|
41631
41687
|
agents: external_exports.array(external_exports.unknown())
|
|
41632
41688
|
});
|
|
@@ -41634,7 +41690,7 @@ function readCodexAgents(file2, uid = process.getuid?.()) {
|
|
|
41634
41690
|
try {
|
|
41635
41691
|
const f = readOwnFile(file2, uid);
|
|
41636
41692
|
if (f.state !== "ok") return [];
|
|
41637
|
-
const top =
|
|
41693
|
+
const top = FileSchema2.safeParse(JSON.parse(f.text));
|
|
41638
41694
|
if (!top.success) return [];
|
|
41639
41695
|
const seen2 = /* @__PURE__ */ new Set();
|
|
41640
41696
|
const out = [];
|
|
@@ -41652,9 +41708,9 @@ function readCodexAgents(file2, uid = process.getuid?.()) {
|
|
|
41652
41708
|
}
|
|
41653
41709
|
function writeCodexAgents(file2, agents) {
|
|
41654
41710
|
const tmp = `${file2}.${process.pid}.tmp`;
|
|
41655
|
-
|
|
41711
|
+
writeFileSync3(tmp, JSON.stringify({ v: 1, agents }), { mode: 384 });
|
|
41656
41712
|
chmodSync4(tmp, 384);
|
|
41657
|
-
|
|
41713
|
+
renameSync4(tmp, file2);
|
|
41658
41714
|
}
|
|
41659
41715
|
|
|
41660
41716
|
// ../bus-daemon/src/codex-names.ts
|
|
@@ -41733,7 +41789,7 @@ import {
|
|
|
41733
41789
|
mkdirSync as mkdirSync5,
|
|
41734
41790
|
openSync as openSync4,
|
|
41735
41791
|
realpathSync as realpathSync3,
|
|
41736
|
-
renameSync as
|
|
41792
|
+
renameSync as renameSync5,
|
|
41737
41793
|
statSync as statSync5,
|
|
41738
41794
|
unlinkSync,
|
|
41739
41795
|
writeSync
|
|
@@ -41820,7 +41876,7 @@ function writeGlobalDirs(dirs, h = home()) {
|
|
|
41820
41876
|
closeSync4(fd);
|
|
41821
41877
|
try {
|
|
41822
41878
|
chmodSync5(tmp, 384);
|
|
41823
|
-
|
|
41879
|
+
renameSync5(tmp, globalFile(h));
|
|
41824
41880
|
} catch (e) {
|
|
41825
41881
|
unlinkSync(tmp);
|
|
41826
41882
|
throw e;
|
|
@@ -41848,7 +41904,7 @@ import {
|
|
|
41848
41904
|
closeSync as closeSync5,
|
|
41849
41905
|
mkdirSync as mkdirSync6,
|
|
41850
41906
|
openSync as openSync5,
|
|
41851
|
-
renameSync as
|
|
41907
|
+
renameSync as renameSync6,
|
|
41852
41908
|
unlinkSync as unlinkSync2,
|
|
41853
41909
|
writeSync as writeSync2
|
|
41854
41910
|
} from "node:fs";
|
|
@@ -41914,7 +41970,7 @@ function writePrivate(h, name, body) {
|
|
|
41914
41970
|
closeSync5(fd);
|
|
41915
41971
|
try {
|
|
41916
41972
|
chmodSync6(tmp, 384);
|
|
41917
|
-
|
|
41973
|
+
renameSync6(tmp, join10(h, name));
|
|
41918
41974
|
} catch (e) {
|
|
41919
41975
|
unlinkSync2(tmp);
|
|
41920
41976
|
throw e;
|
|
@@ -43669,9 +43725,9 @@ init_src();
|
|
|
43669
43725
|
import {
|
|
43670
43726
|
chmodSync as chmodSync7,
|
|
43671
43727
|
readFileSync as readFileSync8,
|
|
43672
|
-
renameSync as
|
|
43673
|
-
rmSync as
|
|
43674
|
-
writeFileSync as
|
|
43728
|
+
renameSync as renameSync7,
|
|
43729
|
+
rmSync as rmSync4,
|
|
43730
|
+
writeFileSync as writeFileSync4
|
|
43675
43731
|
} from "node:fs";
|
|
43676
43732
|
var metaOf = ({
|
|
43677
43733
|
at: _,
|
|
@@ -43960,13 +44016,13 @@ var SentStore = class {
|
|
|
43960
44016
|
if (!this.file) return;
|
|
43961
44017
|
const tmp = `${this.file}.${process.pid}.tmp`;
|
|
43962
44018
|
try {
|
|
43963
|
-
|
|
43964
|
-
|
|
44019
|
+
rmSync4(tmp, { force: true });
|
|
44020
|
+
writeFileSync4(tmp, JSON.stringify(Object.fromEntries(this.#all)), {
|
|
43965
44021
|
mode: 384,
|
|
43966
44022
|
flag: "wx"
|
|
43967
44023
|
});
|
|
43968
44024
|
chmodSync7(tmp, 384);
|
|
43969
|
-
|
|
44025
|
+
renameSync7(tmp, this.file);
|
|
43970
44026
|
} catch (e) {
|
|
43971
44027
|
this.#log?.(
|
|
43972
44028
|
`sent file write failed: ${e instanceof Error ? e.message : String(e)}`
|
|
@@ -44159,16 +44215,16 @@ import {
|
|
|
44159
44215
|
lstatSync as lstatSync6,
|
|
44160
44216
|
mkdirSync as mkdirSync7,
|
|
44161
44217
|
readFileSync as readFileSync10,
|
|
44162
|
-
renameSync as
|
|
44163
|
-
rmSync as
|
|
44164
|
-
writeFileSync as
|
|
44218
|
+
renameSync as renameSync9,
|
|
44219
|
+
rmSync as rmSync5,
|
|
44220
|
+
writeFileSync as writeFileSync6
|
|
44165
44221
|
} from "node:fs";
|
|
44166
44222
|
import { createServer as createServer2 } from "node:net";
|
|
44167
44223
|
import { dirname as dirname7, join as join13 } from "node:path";
|
|
44168
44224
|
import { createInterface } from "node:readline";
|
|
44169
44225
|
|
|
44170
44226
|
// ../bus-daemon/src/transports/held.ts
|
|
44171
|
-
import { chmodSync as chmodSync8, readFileSync as readFileSync9, renameSync as
|
|
44227
|
+
import { chmodSync as chmodSync8, readFileSync as readFileSync9, renameSync as renameSync8, writeFileSync as writeFileSync5 } from "node:fs";
|
|
44172
44228
|
var HeldStore = class {
|
|
44173
44229
|
constructor(file2, opts = {}) {
|
|
44174
44230
|
this.file = file2;
|
|
@@ -44206,9 +44262,9 @@ var HeldStore = class {
|
|
|
44206
44262
|
}
|
|
44207
44263
|
#write(all) {
|
|
44208
44264
|
const tmp = `${this.file}.${process.pid}.tmp`;
|
|
44209
|
-
|
|
44265
|
+
writeFileSync5(tmp, JSON.stringify(all), { mode: 384 });
|
|
44210
44266
|
chmodSync8(tmp, 384);
|
|
44211
|
-
|
|
44267
|
+
renameSync8(tmp, this.file);
|
|
44212
44268
|
}
|
|
44213
44269
|
};
|
|
44214
44270
|
|
|
@@ -44547,7 +44603,7 @@ var ClaudeTransport = class {
|
|
|
44547
44603
|
mkdirSync7(this.opts.socketsDir, { recursive: true, mode: 448 });
|
|
44548
44604
|
chmodSync9(this.opts.socketsDir, 448);
|
|
44549
44605
|
}
|
|
44550
|
-
|
|
44606
|
+
rmSync5(path, { force: true });
|
|
44551
44607
|
this.#paths.set(key2, path);
|
|
44552
44608
|
const conns = /* @__PURE__ */ new Set();
|
|
44553
44609
|
const sink = {
|
|
@@ -44617,9 +44673,9 @@ var ClaudeTransport = class {
|
|
|
44617
44673
|
const out = /* @__PURE__ */ Object.create(null);
|
|
44618
44674
|
for (const [k, v] of keep) out[k] = v;
|
|
44619
44675
|
const tmp = `${file2}.${process.pid}.tmp`;
|
|
44620
|
-
|
|
44676
|
+
writeFileSync6(tmp, JSON.stringify(out), { mode: 384 });
|
|
44621
44677
|
chmodSync9(tmp, 384);
|
|
44622
|
-
|
|
44678
|
+
renameSync9(tmp, file2);
|
|
44623
44679
|
return out;
|
|
44624
44680
|
} catch (e) {
|
|
44625
44681
|
this.opts.log?.(
|
|
@@ -44691,7 +44747,7 @@ var ClaudeTransport = class {
|
|
|
44691
44747
|
async function shut(sink) {
|
|
44692
44748
|
for (const c of sink.conns) c.destroy();
|
|
44693
44749
|
await new Promise((r) => sink.server.close(() => r()));
|
|
44694
|
-
|
|
44750
|
+
rmSync5(sink.path, { force: true });
|
|
44695
44751
|
}
|
|
44696
44752
|
|
|
44697
44753
|
// ../bus-daemon/src/transports/codex.ts
|
|
@@ -45448,6 +45504,39 @@ async function runDaemon(deps2 = {}) {
|
|
|
45448
45504
|
procStart: cachedProcStart(cl.procStart ?? claudeProcStartOf, running),
|
|
45449
45505
|
isRunning: running
|
|
45450
45506
|
};
|
|
45507
|
+
const linksFile = cl.linksFile ?? join16(home(), "claude-links.json");
|
|
45508
|
+
const sameProc = (pid, procStart) => running(pid) && claudeSessions.procStart(pid, procStart) === procStart;
|
|
45509
|
+
let saved = readClaudeLinks(linksFile, void 0, log).filter(
|
|
45510
|
+
(e) => sameProc(e.pid, e.procStart)
|
|
45511
|
+
);
|
|
45512
|
+
let linksWritten = JSON.stringify(saved);
|
|
45513
|
+
const seedLinks = (rec) => {
|
|
45514
|
+
if (rec.linkHashes !== void 0 || rec.pid === void 0) return;
|
|
45515
|
+
const hit = saved.find(
|
|
45516
|
+
(e) => e.pid === rec.pid && e.procStart === rec.procStart
|
|
45517
|
+
);
|
|
45518
|
+
if (!hit) return;
|
|
45519
|
+
rec.linkHashes = [...hit.hashes];
|
|
45520
|
+
saved = saved.filter((e) => e !== hit);
|
|
45521
|
+
};
|
|
45522
|
+
const persistLinks = () => {
|
|
45523
|
+
const rows = [];
|
|
45524
|
+
for (const a of agents.all()) {
|
|
45525
|
+
if (a.kind !== "claude-code" || !a.live || a.pid === void 0 || a.procStart === void 0 || !a.linkHashes?.length)
|
|
45526
|
+
continue;
|
|
45527
|
+
rows.push({ pid: a.pid, procStart: a.procStart, hashes: a.linkHashes });
|
|
45528
|
+
}
|
|
45529
|
+
saved = saved.filter((e) => sameProc(e.pid, e.procStart));
|
|
45530
|
+
const all = [...rows, ...saved].slice(0, CLAUDE_LINKS_MAX);
|
|
45531
|
+
const text3 = JSON.stringify(all);
|
|
45532
|
+
if (text3 === linksWritten) return;
|
|
45533
|
+
try {
|
|
45534
|
+
writeClaudeLinks(linksFile, all);
|
|
45535
|
+
linksWritten = text3;
|
|
45536
|
+
} catch (e) {
|
|
45537
|
+
log(`could not save ${linksFile}: ${e instanceof Error ? e.message : e}`);
|
|
45538
|
+
}
|
|
45539
|
+
};
|
|
45451
45540
|
const oc = deps2.opencode ?? {};
|
|
45452
45541
|
const ocRunning = oc.isRunning ?? isRunning;
|
|
45453
45542
|
const ocStart = cachedProcStart(oc.procStart ?? procStartOf, ocRunning, {
|
|
@@ -45734,6 +45823,7 @@ async function runDaemon(deps2 = {}) {
|
|
|
45734
45823
|
if (!p || p.procStart !== rec.procStart) continue;
|
|
45735
45824
|
pendingProofs.delete(rec.pid);
|
|
45736
45825
|
rec.linkHashes = withLinkHash(rec.linkHashes, p.hash);
|
|
45826
|
+
persistLinks();
|
|
45737
45827
|
sendLink(rec, p.hash);
|
|
45738
45828
|
}
|
|
45739
45829
|
};
|
|
@@ -45797,6 +45887,10 @@ async function runDaemon(deps2 = {}) {
|
|
|
45797
45887
|
live: true
|
|
45798
45888
|
})
|
|
45799
45889
|
);
|
|
45890
|
+
{
|
|
45891
|
+
const rec = agents.byRef(s.ref);
|
|
45892
|
+
if (rec) seedLinks(rec);
|
|
45893
|
+
}
|
|
45800
45894
|
void claude.revive(s.ref);
|
|
45801
45895
|
tellOwed(s.ref);
|
|
45802
45896
|
}
|
|
@@ -45808,6 +45902,7 @@ async function runDaemon(deps2 = {}) {
|
|
|
45808
45902
|
closed = true;
|
|
45809
45903
|
void claude.drop(a.ref);
|
|
45810
45904
|
}
|
|
45905
|
+
persistLinks();
|
|
45811
45906
|
if (closed) announceSessions();
|
|
45812
45907
|
};
|
|
45813
45908
|
let openBefore = /* @__PURE__ */ new Set();
|
|
@@ -45985,8 +46080,8 @@ async function runDaemon(deps2 = {}) {
|
|
|
45985
46080
|
pending.fail(id, error62, "the hub sent a frame this daemon cannot read");
|
|
45986
46081
|
},
|
|
45987
46082
|
onRevoked: () => {
|
|
45988
|
-
const
|
|
45989
|
-
if (
|
|
46083
|
+
const saved2 = savedToken();
|
|
46084
|
+
if (saved2 !== void 0 && saved2 !== cfg.machine_token) {
|
|
45990
46085
|
log(
|
|
45991
46086
|
"the hub refused the token this daemon started with; machine.json holds a newer one: restarting"
|
|
45992
46087
|
);
|
|
@@ -45997,7 +46092,7 @@ async function runDaemon(deps2 = {}) {
|
|
|
45997
46092
|
log(`this machine was revoked; run \`${BUS_CMD} install\``);
|
|
45998
46093
|
process.exitCode = 1;
|
|
45999
46094
|
try {
|
|
46000
|
-
|
|
46095
|
+
writeFileSync7(
|
|
46001
46096
|
deps2.revokedFile ?? join16(home(), "revoked"),
|
|
46002
46097
|
revokedMarker(cfg.machine_token),
|
|
46003
46098
|
{ mode: 384 }
|
|
@@ -46102,6 +46197,7 @@ async function runDaemon(deps2 = {}) {
|
|
|
46102
46197
|
if (rec && rec.procStart !== void 0) {
|
|
46103
46198
|
if (rec.procStart !== start) return { bound: false };
|
|
46104
46199
|
rec.linkHashes = withLinkHash(rec.linkHashes, req.hash);
|
|
46200
|
+
persistLinks();
|
|
46105
46201
|
sendLink(rec, req.hash);
|
|
46106
46202
|
return { bound: true };
|
|
46107
46203
|
}
|
|
@@ -46325,7 +46421,10 @@ async function runDaemon(deps2 = {}) {
|
|
|
46325
46421
|
});
|
|
46326
46422
|
if (rec.kind === "opencode") ocServiceStart.set(rec.ref, ocStart(pid));
|
|
46327
46423
|
if (rec.kind === "codex") persistCodex();
|
|
46328
|
-
if (rec.kind === "claude-code")
|
|
46424
|
+
if (rec.kind === "claude-code") {
|
|
46425
|
+
seedLinks(rec);
|
|
46426
|
+
void claude.revive(rec.ref);
|
|
46427
|
+
}
|
|
46329
46428
|
conns.set(rec.ref, (conns.get(rec.ref) ?? 0) + 1);
|
|
46330
46429
|
claimProofs();
|
|
46331
46430
|
announceUp(rec);
|
|
@@ -46383,6 +46482,7 @@ async function runDaemon(deps2 = {}) {
|
|
|
46383
46482
|
const rec = agents.byRef(ref);
|
|
46384
46483
|
if (!rec?.live) return false;
|
|
46385
46484
|
rec.linkHashes = withLinkHash(rec.linkHashes, hash2);
|
|
46485
|
+
persistLinks();
|
|
46386
46486
|
sendLink(rec, hash2);
|
|
46387
46487
|
return true;
|
|
46388
46488
|
},
|
|
@@ -46686,9 +46786,9 @@ import {
|
|
|
46686
46786
|
lstatSync as lstatSync10,
|
|
46687
46787
|
mkdirSync as mkdirSync9,
|
|
46688
46788
|
realpathSync as realpathSync8,
|
|
46689
|
-
renameSync as
|
|
46690
|
-
rmSync as
|
|
46691
|
-
writeFileSync as
|
|
46789
|
+
renameSync as renameSync11,
|
|
46790
|
+
rmSync as rmSync6,
|
|
46791
|
+
writeFileSync as writeFileSync9
|
|
46692
46792
|
} from "node:fs";
|
|
46693
46793
|
import { basename as basename6, dirname as dirname9, isAbsolute as isAbsolute8, join as join18, resolve as resolve5 } from "node:path";
|
|
46694
46794
|
import { fileURLToPath } from "node:url";
|
|
@@ -47745,8 +47845,8 @@ import {
|
|
|
47745
47845
|
chmodSync as chmodSync10,
|
|
47746
47846
|
mkdirSync as mkdirSync8,
|
|
47747
47847
|
readFileSync as readFileSync13,
|
|
47748
|
-
renameSync as
|
|
47749
|
-
writeFileSync as
|
|
47848
|
+
renameSync as renameSync10,
|
|
47849
|
+
writeFileSync as writeFileSync8
|
|
47750
47850
|
} from "node:fs";
|
|
47751
47851
|
import { dirname as dirname8 } from "node:path";
|
|
47752
47852
|
function readInstallFile(path) {
|
|
@@ -47762,10 +47862,10 @@ function updateInstallFile(path, patch) {
|
|
|
47762
47862
|
const next = { ...readInstallFile(path), ...patch };
|
|
47763
47863
|
mkdirSync8(dirname8(path), { recursive: true, mode: 448 });
|
|
47764
47864
|
const tmp = `${path}.${process.pid}.tmp`;
|
|
47765
|
-
|
|
47865
|
+
writeFileSync8(tmp, `${JSON.stringify(next, null, 2)}
|
|
47766
47866
|
`, { mode: 384 });
|
|
47767
47867
|
chmodSync10(tmp, 384);
|
|
47768
|
-
|
|
47868
|
+
renameSync10(tmp, path);
|
|
47769
47869
|
}
|
|
47770
47870
|
async function runSteps(steps, ctx, record7) {
|
|
47771
47871
|
for (const step2 of steps) {
|
|
@@ -47922,23 +48022,23 @@ function installCli(home2, src, node2) {
|
|
|
47922
48022
|
const tmp = `${bin}.${process.pid}.tmp`;
|
|
47923
48023
|
mkdirSync9(home2, { recursive: true, mode: 448 });
|
|
47924
48024
|
chmodSync11(home2, 448);
|
|
47925
|
-
|
|
48025
|
+
rmSync6(tmp, { recursive: true, force: true });
|
|
47926
48026
|
mkdirSync9(tmp);
|
|
47927
48027
|
if (src.kind === "bundle") {
|
|
47928
48028
|
const pkg = dirname9(dirname9(src.file));
|
|
47929
48029
|
for (const name of ["dist", "assets", "package.json"])
|
|
47930
48030
|
if (existsSync4(join18(pkg, name)))
|
|
47931
48031
|
cpSync(join18(pkg, name), join18(tmp, name), { recursive: true });
|
|
47932
|
-
} else
|
|
48032
|
+
} else writeFileSync9(join18(tmp, entryName(src)), shim(src));
|
|
47933
48033
|
chmodSync11(tmp, 448);
|
|
47934
48034
|
if (node2 !== void 0) {
|
|
47935
|
-
|
|
48035
|
+
writeFileSync9(join18(tmp, "node"), launcherText(node2), { mode: 448 });
|
|
47936
48036
|
chmodSync11(join18(tmp, "node"), 448);
|
|
47937
48037
|
}
|
|
47938
48038
|
if (!existsSync4(join18(tmp, "package.json")))
|
|
47939
|
-
|
|
47940
|
-
|
|
47941
|
-
|
|
48039
|
+
writeFileSync9(join18(tmp, "package.json"), '{ "type": "module" }\n');
|
|
48040
|
+
rmSync6(bin, { recursive: true, force: true });
|
|
48041
|
+
renameSync11(tmp, bin);
|
|
47942
48042
|
return join18(bin, entryName(src));
|
|
47943
48043
|
}
|
|
47944
48044
|
var present = (path) => {
|
|
@@ -47953,10 +48053,10 @@ function writeReplacing(path, text3) {
|
|
|
47953
48053
|
mkdirSync9(dirname9(path), { recursive: true });
|
|
47954
48054
|
const tmp = `${path}.${process.pid}.tmp`;
|
|
47955
48055
|
try {
|
|
47956
|
-
|
|
47957
|
-
|
|
48056
|
+
writeFileSync9(tmp, text3, { mode: 420 });
|
|
48057
|
+
renameSync11(tmp, path);
|
|
47958
48058
|
} catch (e) {
|
|
47959
|
-
|
|
48059
|
+
rmSync6(tmp, { force: true });
|
|
47960
48060
|
throw e;
|
|
47961
48061
|
}
|
|
47962
48062
|
}
|
|
@@ -48042,7 +48142,7 @@ function systemService(d) {
|
|
|
48042
48142
|
return "started";
|
|
48043
48143
|
await d.sleep(1e3);
|
|
48044
48144
|
}
|
|
48045
|
-
|
|
48145
|
+
rmSync6(f, { force: true });
|
|
48046
48146
|
return "failed";
|
|
48047
48147
|
}
|
|
48048
48148
|
async function startSystemd(f, u) {
|
|
@@ -48056,7 +48156,7 @@ function systemService(d) {
|
|
|
48056
48156
|
]) {
|
|
48057
48157
|
if ((await systemctl(...args)).code === 0) continue;
|
|
48058
48158
|
if (args[0] !== "daemon-reload") await systemctl("disable", unit);
|
|
48059
|
-
|
|
48159
|
+
rmSync6(f, { force: true });
|
|
48060
48160
|
if (args[0] !== "daemon-reload") await systemctl("daemon-reload");
|
|
48061
48161
|
return "failed";
|
|
48062
48162
|
}
|
|
@@ -48100,7 +48200,7 @@ function systemService(d) {
|
|
|
48100
48200
|
const old = recorded();
|
|
48101
48201
|
if (old && old !== f) {
|
|
48102
48202
|
if (manager === "systemd") await systemctl("disable", names2().unit);
|
|
48103
|
-
|
|
48203
|
+
rmSync6(old, { force: true });
|
|
48104
48204
|
}
|
|
48105
48205
|
const started = manager === "launchd" ? await startLaunchd(f, unit) : manager === "systemd" ? await startSystemd(f, unit) : "failed";
|
|
48106
48206
|
if (started === "started") {
|
|
@@ -48140,7 +48240,7 @@ function systemService(d) {
|
|
|
48140
48240
|
if (manager === "launchd")
|
|
48141
48241
|
await d.exec("launchctl", ["bootout", `${domain2}/${label}`]);
|
|
48142
48242
|
else await systemctl("disable", "--now", unit);
|
|
48143
|
-
|
|
48243
|
+
rmSync6(f, { force: true });
|
|
48144
48244
|
if (manager === "systemd") await systemctl("daemon-reload");
|
|
48145
48245
|
const left = await quiet();
|
|
48146
48246
|
if (left !== void 0) return { unit: manager, running: left };
|
|
@@ -48202,7 +48302,7 @@ var noService = {
|
|
|
48202
48302
|
remove: async () => ({}),
|
|
48203
48303
|
cli: () => ["oa-bus"]
|
|
48204
48304
|
};
|
|
48205
|
-
var VERSION = true ? "0.
|
|
48305
|
+
var VERSION = true ? "0.152.1" : JSON.parse(
|
|
48206
48306
|
readFileSync14(new URL("../package.json", import.meta.url), "utf8")
|
|
48207
48307
|
).version;
|
|
48208
48308
|
var which = (cmd) => {
|
|
@@ -48468,10 +48568,10 @@ import {
|
|
|
48468
48568
|
mkdirSync as mkdirSync12,
|
|
48469
48569
|
readFileSync as readFileSync24,
|
|
48470
48570
|
readlinkSync as readlinkSync4,
|
|
48471
|
-
renameSync as
|
|
48472
|
-
rmSync as
|
|
48571
|
+
renameSync as renameSync14,
|
|
48572
|
+
rmSync as rmSync14,
|
|
48473
48573
|
statSync as statSync10,
|
|
48474
|
-
writeFileSync as
|
|
48574
|
+
writeFileSync as writeFileSync12
|
|
48475
48575
|
} from "node:fs";
|
|
48476
48576
|
import { dirname as dirname13, join as join27, resolve as resolve11 } from "node:path";
|
|
48477
48577
|
import { isDeepStrictEqual } from "node:util";
|
|
@@ -49825,7 +49925,7 @@ function proofState(file2, origin) {
|
|
|
49825
49925
|
// src/steps/codex-proof.ts
|
|
49826
49926
|
init_src3();
|
|
49827
49927
|
init_src();
|
|
49828
|
-
import { existsSync as existsSync6, readFileSync as readFileSync17, rmSync as
|
|
49928
|
+
import { existsSync as existsSync6, readFileSync as readFileSync17, rmSync as rmSync7 } from "node:fs";
|
|
49829
49929
|
import { isAbsolute as isAbsolute10 } from "node:path";
|
|
49830
49930
|
var CODEX_MIN_VERSION = "0.123.0";
|
|
49831
49931
|
var PROXY_CMD = "mcp-proxy";
|
|
@@ -50105,7 +50205,7 @@ ${m.lines.join("\n")}
|
|
|
50105
50205
|
put = true;
|
|
50106
50206
|
}
|
|
50107
50207
|
}
|
|
50108
|
-
|
|
50208
|
+
rmSync7(io.moved, { force: true });
|
|
50109
50209
|
return put;
|
|
50110
50210
|
}
|
|
50111
50211
|
function linesOf(text3) {
|
|
@@ -50136,7 +50236,7 @@ import {
|
|
|
50136
50236
|
lstatSync as lstatSync14,
|
|
50137
50237
|
readFileSync as readFileSync21,
|
|
50138
50238
|
realpathSync as realpathSync12,
|
|
50139
|
-
rmSync as
|
|
50239
|
+
rmSync as rmSync11
|
|
50140
50240
|
} from "node:fs";
|
|
50141
50241
|
import { join as join25, resolve as resolve9, sep as sep3 } from "node:path";
|
|
50142
50242
|
|
|
@@ -50150,10 +50250,10 @@ import {
|
|
|
50150
50250
|
readFileSync as readFileSync18,
|
|
50151
50251
|
readlinkSync as readlinkSync2,
|
|
50152
50252
|
realpathSync as realpathSync9,
|
|
50153
|
-
renameSync as
|
|
50253
|
+
renameSync as renameSync12,
|
|
50154
50254
|
rmdirSync,
|
|
50155
|
-
rmSync as
|
|
50156
|
-
writeFileSync as
|
|
50255
|
+
rmSync as rmSync8,
|
|
50256
|
+
writeFileSync as writeFileSync10
|
|
50157
50257
|
} from "node:fs";
|
|
50158
50258
|
import {
|
|
50159
50259
|
basename as basename7,
|
|
@@ -50214,7 +50314,7 @@ function sweepStaging(staging, own2, o = {}) {
|
|
|
50214
50314
|
const m = STAGE_NAME.exec(name);
|
|
50215
50315
|
if (m ? old || !alive2(Number(m[1])) : old) {
|
|
50216
50316
|
try {
|
|
50217
|
-
|
|
50317
|
+
rmSync8(path, { recursive: true, force: true });
|
|
50218
50318
|
} catch {
|
|
50219
50319
|
}
|
|
50220
50320
|
}
|
|
@@ -50406,17 +50506,17 @@ async function installHermes(deps2) {
|
|
|
50406
50506
|
mkdirSync10(join22(tmp, f, ".."), { recursive: true });
|
|
50407
50507
|
cpSync2(join22(shipped, f), join22(tmp, f));
|
|
50408
50508
|
}
|
|
50409
|
-
|
|
50509
|
+
writeFileSync10(
|
|
50410
50510
|
join22(tmp, HERMES_MARKER),
|
|
50411
50511
|
`managed by the Open Artifacts bus installer: edits are replaced on reinstall. ${pluginHash(shipped)}
|
|
50412
50512
|
`
|
|
50413
50513
|
);
|
|
50414
50514
|
if (keepHabits)
|
|
50415
|
-
|
|
50416
|
-
if (state === "stale")
|
|
50417
|
-
|
|
50515
|
+
writeFileSync10(join22(tmp, HERMES_HABITS_MARKER), HABITS_MARKER_TEXT);
|
|
50516
|
+
if (state === "stale") rmSync8(dest, { recursive: true, force: true });
|
|
50517
|
+
renameSync12(tmp, dest);
|
|
50418
50518
|
} catch (e) {
|
|
50419
|
-
|
|
50519
|
+
rmSync8(tmp, { recursive: true, force: true });
|
|
50420
50520
|
throw e;
|
|
50421
50521
|
} finally {
|
|
50422
50522
|
try {
|
|
@@ -50451,7 +50551,7 @@ async function uninstallHermes(deps2, notes) {
|
|
|
50451
50551
|
`\`hermes plugins disable ${HERMES_PLUGIN_NAME}\` failed (${firstLine(r.stderr) || firstLine(r.stdout) || `exit ${r.code}`}); left the plugin folder, rerun once Hermes works`
|
|
50452
50552
|
);
|
|
50453
50553
|
} else notes.push(HERMES_NO_CLI);
|
|
50454
|
-
|
|
50554
|
+
rmSync8(dest, { recursive: true, force: true });
|
|
50455
50555
|
return "done";
|
|
50456
50556
|
}
|
|
50457
50557
|
async function hermesEnabled(deps2) {
|
|
@@ -50474,7 +50574,7 @@ import {
|
|
|
50474
50574
|
readdirSync as readdirSync7,
|
|
50475
50575
|
readFileSync as readFileSync20,
|
|
50476
50576
|
realpathSync as realpathSync11,
|
|
50477
|
-
rmSync as
|
|
50577
|
+
rmSync as rmSync10
|
|
50478
50578
|
} from "node:fs";
|
|
50479
50579
|
import { join as join24, resolve as resolve8 } from "node:path";
|
|
50480
50580
|
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
@@ -50489,11 +50589,11 @@ import {
|
|
|
50489
50589
|
readFileSync as readFileSync19,
|
|
50490
50590
|
readlinkSync as readlinkSync3,
|
|
50491
50591
|
realpathSync as realpathSync10,
|
|
50492
|
-
renameSync as
|
|
50592
|
+
renameSync as renameSync13,
|
|
50493
50593
|
rmdirSync as rmdirSync2,
|
|
50494
|
-
rmSync as
|
|
50594
|
+
rmSync as rmSync9,
|
|
50495
50595
|
statSync as statSync9,
|
|
50496
|
-
writeFileSync as
|
|
50596
|
+
writeFileSync as writeFileSync11
|
|
50497
50597
|
} from "node:fs";
|
|
50498
50598
|
import { dirname as dirname11, join as join23, resolve as resolve7 } from "node:path";
|
|
50499
50599
|
var SKILL_MARKER = "<!-- managed by the Open Artifacts bus installer: edits are replaced on reinstall. -->";
|
|
@@ -50653,12 +50753,12 @@ var writeAtomic = (path, text3) => {
|
|
|
50653
50753
|
mode = statSync9(path).mode & 4095;
|
|
50654
50754
|
} catch {
|
|
50655
50755
|
}
|
|
50656
|
-
|
|
50756
|
+
writeFileSync11(tmp, text3);
|
|
50657
50757
|
if (mode !== void 0) chmodSync12(tmp, mode);
|
|
50658
|
-
|
|
50758
|
+
renameSync13(tmp, path);
|
|
50659
50759
|
} catch (e) {
|
|
50660
50760
|
try {
|
|
50661
|
-
|
|
50761
|
+
rmSync9(tmp, { force: true });
|
|
50662
50762
|
} catch {
|
|
50663
50763
|
}
|
|
50664
50764
|
throw e;
|
|
@@ -50796,7 +50896,7 @@ var installCodex = (deps2, folder, text3, written, notes) => {
|
|
|
50796
50896
|
written.push(agentsPath);
|
|
50797
50897
|
if (ourFile && !shared) {
|
|
50798
50898
|
try {
|
|
50799
|
-
|
|
50899
|
+
rmSync9(targetOf(filePath), { force: true });
|
|
50800
50900
|
try {
|
|
50801
50901
|
rmdirSync2(dirname11(filePath));
|
|
50802
50902
|
} catch {
|
|
@@ -50902,7 +51002,7 @@ var uninstallSkill = (deps2, harnesses = [
|
|
|
50902
51002
|
);
|
|
50903
51003
|
continue;
|
|
50904
51004
|
}
|
|
50905
|
-
|
|
51005
|
+
rmSync9(targetOf(file2), { force: true });
|
|
50906
51006
|
try {
|
|
50907
51007
|
rmdirSync2(dir);
|
|
50908
51008
|
} catch {
|
|
@@ -51135,7 +51235,7 @@ async function installOpenclaw(deps2, notes, optedOut) {
|
|
|
51135
51235
|
);
|
|
51136
51236
|
const habitsFile = join24(dest, OPENCLAW_HABITS_MARKER);
|
|
51137
51237
|
const dropHabitsIfOptedOut = () => {
|
|
51138
|
-
if (optedOut && kind2(dest) === "dir")
|
|
51238
|
+
if (optedOut && kind2(dest) === "dir") rmSync10(habitsFile, { force: true });
|
|
51139
51239
|
};
|
|
51140
51240
|
if (state === "current") {
|
|
51141
51241
|
rememberInstall(deps2);
|
|
@@ -51171,7 +51271,7 @@ async function installOpenclaw(deps2, notes, optedOut) {
|
|
|
51171
51271
|
`
|
|
51172
51272
|
);
|
|
51173
51273
|
rememberInstall(deps2);
|
|
51174
|
-
|
|
51274
|
+
rmSync10(habitsFile, { force: true });
|
|
51175
51275
|
restore();
|
|
51176
51276
|
}
|
|
51177
51277
|
const en = await exec2(deps2, ["plugins", "enable", OPENCLAW_PLUGIN_ID]);
|
|
@@ -51221,7 +51321,7 @@ async function uninstallOpenclaw(deps2, notes) {
|
|
|
51221
51321
|
`\`openclaw plugins uninstall ${OPENCLAW_PLUGIN_ID}\` failed (${why(r)}); left the plugin folder, rerun once OpenClaw works`
|
|
51222
51322
|
);
|
|
51223
51323
|
} else notes.push(OPENCLAW_NO_CLI);
|
|
51224
|
-
|
|
51324
|
+
rmSync10(dest, { recursive: true, force: true });
|
|
51225
51325
|
forgetInstall(deps2);
|
|
51226
51326
|
return "done";
|
|
51227
51327
|
}
|
|
@@ -51460,7 +51560,7 @@ function removeHabits(deps2, harnesses = HABITS_HARNESSES) {
|
|
|
51460
51560
|
const rec = kept[path];
|
|
51461
51561
|
const after = withHabits(before, null, rec?.added);
|
|
51462
51562
|
if (rec?.created && !isLink(path) && after.trim() === "")
|
|
51463
|
-
|
|
51563
|
+
rmSync11(real3, { force: true });
|
|
51464
51564
|
else writeAtomic(real3, after);
|
|
51465
51565
|
delete kept[path];
|
|
51466
51566
|
files2.push(path);
|
|
@@ -51638,7 +51738,7 @@ function setPluginHabits(deps2, plugins2, on) {
|
|
|
51638
51738
|
continue;
|
|
51639
51739
|
}
|
|
51640
51740
|
try {
|
|
51641
|
-
|
|
51741
|
+
rmSync11(marker, { force: true });
|
|
51642
51742
|
} catch (e) {
|
|
51643
51743
|
left(
|
|
51644
51744
|
`Could not remove ${marker} (${reason(e)}): ${p.label} habits are still on there. Delete it, then rerun.`
|
|
@@ -51700,7 +51800,7 @@ var habitsQuestionLines = (q) => [
|
|
|
51700
51800
|
];
|
|
51701
51801
|
|
|
51702
51802
|
// src/steps/opencode-proof.ts
|
|
51703
|
-
import { existsSync as existsSync10, readFileSync as readFileSync22, rmSync as
|
|
51803
|
+
import { existsSync as existsSync10, readFileSync as readFileSync22, rmSync as rmSync12 } from "node:fs";
|
|
51704
51804
|
import { dirname as dirname12, isAbsolute as isAbsolute12, join as join26, resolve as resolve10 } from "node:path";
|
|
51705
51805
|
init_src();
|
|
51706
51806
|
var OPENCODE_ENTRY_FILE = "opencode-mcp-entry.json";
|
|
@@ -51869,7 +51969,7 @@ function restoreEntry2(io) {
|
|
|
51869
51969
|
put = true;
|
|
51870
51970
|
}
|
|
51871
51971
|
}
|
|
51872
|
-
|
|
51972
|
+
rmSync12(io.moved, { force: true });
|
|
51873
51973
|
return put;
|
|
51874
51974
|
}
|
|
51875
51975
|
function proxyProgramMissing2(entry, origin, which2) {
|
|
@@ -51892,7 +51992,7 @@ function proxyEntries(text3) {
|
|
|
51892
51992
|
}
|
|
51893
51993
|
|
|
51894
51994
|
// src/steps/pi-proof.ts
|
|
51895
|
-
import { existsSync as existsSync11, readFileSync as readFileSync23, rmSync as
|
|
51995
|
+
import { existsSync as existsSync11, readFileSync as readFileSync23, rmSync as rmSync13 } from "node:fs";
|
|
51896
51996
|
var PI_ENTRY_FILE = "pi-mcp-entry.json";
|
|
51897
51997
|
var OMP_ORIGIN_FILE = "omp-mcp-origin.json";
|
|
51898
51998
|
var PI_MIN_VERSION = "1.5.0";
|
|
@@ -51987,7 +52087,7 @@ function restoreEntry3(io) {
|
|
|
51987
52087
|
);
|
|
51988
52088
|
put = true;
|
|
51989
52089
|
}
|
|
51990
|
-
|
|
52090
|
+
rmSync13(io.moved, { force: true });
|
|
51991
52091
|
return put;
|
|
51992
52092
|
}
|
|
51993
52093
|
|
|
@@ -52128,11 +52228,11 @@ function writeAtomic2(path, data, mode) {
|
|
|
52128
52228
|
}
|
|
52129
52229
|
const tmp = `${dest}.${process.pid}.${randomBytes6(4).toString("hex")}.tmp`;
|
|
52130
52230
|
try {
|
|
52131
|
-
|
|
52231
|
+
writeFileSync12(tmp, data, { mode: m, flag: "wx" });
|
|
52132
52232
|
chmodSync13(tmp, m);
|
|
52133
|
-
|
|
52233
|
+
renameSync14(tmp, dest);
|
|
52134
52234
|
} catch (e) {
|
|
52135
|
-
|
|
52235
|
+
rmSync14(tmp, { force: true });
|
|
52136
52236
|
throw e;
|
|
52137
52237
|
}
|
|
52138
52238
|
}
|
|
@@ -52482,7 +52582,7 @@ var install = {
|
|
|
52482
52582
|
}
|
|
52483
52583
|
if (had !== pin) writeAtomic2(p.codexBin, pin, 384);
|
|
52484
52584
|
} else {
|
|
52485
|
-
|
|
52585
|
+
rmSync14(p.codexBin, { force: true });
|
|
52486
52586
|
notes.push(CODEX_NO_BIN);
|
|
52487
52587
|
}
|
|
52488
52588
|
await codexEntryStep(deps2, notes);
|
|
@@ -52557,7 +52657,7 @@ var uninstall = {
|
|
|
52557
52657
|
for (const { file: file2 } of edits) delete left[file2];
|
|
52558
52658
|
writeRecord2(p.record, record7, left);
|
|
52559
52659
|
const hadPlugin = existsSync12(p.opencodePlugin);
|
|
52560
|
-
|
|
52660
|
+
rmSync14(p.opencodePlugin, { recursive: true, force: true });
|
|
52561
52661
|
if (!saved.some(Boolean) && !hadPlugin && !restored) return "none";
|
|
52562
52662
|
if (deps2.which("opencode")) await restartOpencode(deps2, notes);
|
|
52563
52663
|
return saved.some(Boolean) || restored ? "done" : "folder";
|
|
@@ -52575,16 +52675,16 @@ var uninstall = {
|
|
|
52575
52675
|
}
|
|
52576
52676
|
const path = paths(deps2).pi;
|
|
52577
52677
|
if (!existsSync12(path)) return restored ? "done" : "none";
|
|
52578
|
-
|
|
52678
|
+
rmSync14(path, { force: true });
|
|
52579
52679
|
return "done";
|
|
52580
52680
|
},
|
|
52581
52681
|
async omp(deps2, _notes, done) {
|
|
52582
|
-
|
|
52682
|
+
rmSync14(paths(deps2).ompOrigin, { force: true });
|
|
52583
52683
|
if (sharedFile(deps2) && done.includes("pi")) return "done";
|
|
52584
52684
|
if (sharedFile(deps2) && existsSync12(paths(deps2).piEntry)) return "none";
|
|
52585
52685
|
const path = paths(deps2).omp;
|
|
52586
52686
|
if (!existsSync12(path)) return "none";
|
|
52587
|
-
|
|
52687
|
+
rmSync14(path, { force: true });
|
|
52588
52688
|
return "done";
|
|
52589
52689
|
},
|
|
52590
52690
|
async codex(deps2, notes) {
|
|
@@ -52607,7 +52707,7 @@ var uninstall = {
|
|
|
52607
52707
|
}
|
|
52608
52708
|
}
|
|
52609
52709
|
const pinned = present2(p.codexBin);
|
|
52610
|
-
|
|
52710
|
+
rmSync14(p.codexBin, { force: true });
|
|
52611
52711
|
return saved || pinned ? "done" : "none";
|
|
52612
52712
|
},
|
|
52613
52713
|
async hermes(deps2, notes) {
|
|
@@ -52769,7 +52869,7 @@ import {
|
|
|
52769
52869
|
readdirSync as readdirSync8,
|
|
52770
52870
|
readFileSync as readFileSync25,
|
|
52771
52871
|
rmdirSync as rmdirSync3,
|
|
52772
|
-
rmSync as
|
|
52872
|
+
rmSync as rmSync15
|
|
52773
52873
|
} from "node:fs";
|
|
52774
52874
|
import { dirname as dirname14, join as join28 } from "node:path";
|
|
52775
52875
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
@@ -52917,7 +53017,7 @@ function turnOff(deps2, out) {
|
|
|
52917
53017
|
const was = rec?.set ? rec.before : void 0;
|
|
52918
53018
|
const next = was?.state === "null" ? setJsoncValue(cur.text, ["outputStyle"], null) : was?.state === "empty" ? setJsoncValue(cur.text, ["outputStyle"], was.value) : removeJsoncValue(cur.text, ["outputStyle"]);
|
|
52919
53019
|
if (rec?.set && rec.createdFile && cur.text === createdText())
|
|
52920
|
-
|
|
53020
|
+
rmSync15(path);
|
|
52921
53021
|
else writeAtomic(path, next);
|
|
52922
53022
|
}
|
|
52923
53023
|
if (busHome2 && rec) writeRecord3(busHome2, void 0);
|
|
@@ -52944,7 +53044,7 @@ function uninstallOutputStyle(deps2) {
|
|
|
52944
53044
|
`Left ${path} alone: it has no Open Artifacts marker, so it is not ours to replace.`
|
|
52945
53045
|
);
|
|
52946
53046
|
} else {
|
|
52947
|
-
|
|
53047
|
+
rmSync15(path);
|
|
52948
53048
|
out.written.push(path);
|
|
52949
53049
|
gone = true;
|
|
52950
53050
|
if (readdirSync8(dir).length === 0) rmdirSync3(dir);
|
|
@@ -53203,8 +53303,8 @@ import {
|
|
|
53203
53303
|
closeSync as closeSync7,
|
|
53204
53304
|
mkdirSync as mkdirSync13,
|
|
53205
53305
|
openSync as openSync7,
|
|
53206
|
-
renameSync as
|
|
53207
|
-
rmSync as
|
|
53306
|
+
renameSync as renameSync15,
|
|
53307
|
+
rmSync as rmSync16,
|
|
53208
53308
|
unlinkSync as unlinkSync3,
|
|
53209
53309
|
writeSync as writeSync3
|
|
53210
53310
|
} from "node:fs";
|
|
@@ -53268,7 +53368,7 @@ function writeMachineFile(home2, body) {
|
|
|
53268
53368
|
closeSync7(fd);
|
|
53269
53369
|
try {
|
|
53270
53370
|
chmodSync14(tmp, 384);
|
|
53271
|
-
|
|
53371
|
+
renameSync15(tmp, join30(home2, "machine.json"));
|
|
53272
53372
|
} catch (e) {
|
|
53273
53373
|
unlinkSync3(tmp);
|
|
53274
53374
|
throw e;
|
|
@@ -53395,7 +53495,7 @@ async function login(args) {
|
|
|
53395
53495
|
`${JSON.stringify({ hub, label, machine_token: poll.machine_token }, null, 2)}
|
|
53396
53496
|
`
|
|
53397
53497
|
);
|
|
53398
|
-
|
|
53498
|
+
rmSync16(join30(args.home, "revoked"), { force: true });
|
|
53399
53499
|
if (!events?.code) print(`Approved this machine as ${label}.`);
|
|
53400
53500
|
return {
|
|
53401
53501
|
machineToken: poll.machine_token,
|
|
@@ -54740,7 +54840,7 @@ import { join as join37 } from "node:path";
|
|
|
54740
54840
|
|
|
54741
54841
|
// src/steps/purge.ts
|
|
54742
54842
|
init_src3();
|
|
54743
|
-
import { lstatSync as lstatSync17, readdirSync as readdirSync9, rmdirSync as rmdirSync4, rmSync as
|
|
54843
|
+
import { lstatSync as lstatSync17, readdirSync as readdirSync9, rmdirSync as rmdirSync4, rmSync as rmSync17 } from "node:fs";
|
|
54744
54844
|
import { join as join36 } from "node:path";
|
|
54745
54845
|
var FILES = [
|
|
54746
54846
|
"machine.json",
|
|
@@ -54780,7 +54880,7 @@ function kind3(path) {
|
|
|
54780
54880
|
return void 0;
|
|
54781
54881
|
}
|
|
54782
54882
|
}
|
|
54783
|
-
var remove2 = (path, k) =>
|
|
54883
|
+
var remove2 = (path, k) => rmSync17(path, { recursive: k === "dir", force: true });
|
|
54784
54884
|
var rmdirIfEmpty = (path) => {
|
|
54785
54885
|
try {
|
|
54786
54886
|
rmdirSync4(path);
|