tesseract-agent 0.12.1-beta.1 → 0.12.1-beta.2
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-bundle/cli.js +361 -270
- package/dist-bundle/mesh-core/package.json +1 -1
- package/dist-bundle/office-page.js +118 -118
- package/dist-bundle/serpapi-mcp.js +149 -58
- package/package.json +1 -1
package/dist-bundle/cli.js
CHANGED
|
@@ -2615,7 +2615,7 @@ var require_websocket = __commonJS({
|
|
|
2615
2615
|
var http = __require("http");
|
|
2616
2616
|
var net = __require("net");
|
|
2617
2617
|
var tls2 = __require("tls");
|
|
2618
|
-
var { randomBytes: randomBytes53, createHash:
|
|
2618
|
+
var { randomBytes: randomBytes53, createHash: createHash84 } = __require("crypto");
|
|
2619
2619
|
var { Duplex: Duplex2, Readable: Readable19 } = __require("stream");
|
|
2620
2620
|
var { URL: URL4 } = __require("url");
|
|
2621
2621
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
@@ -3283,7 +3283,7 @@ var require_websocket = __commonJS({
|
|
|
3283
3283
|
abortHandshake(websocket, socket2, "Invalid Upgrade header");
|
|
3284
3284
|
return;
|
|
3285
3285
|
}
|
|
3286
|
-
const digest2 =
|
|
3286
|
+
const digest2 = createHash84("sha1").update(key7 + GUID).digest("base64");
|
|
3287
3287
|
if (res.headers["sec-websocket-accept"] !== digest2) {
|
|
3288
3288
|
abortHandshake(websocket, socket2, "Invalid Sec-WebSocket-Accept header");
|
|
3289
3289
|
return;
|
|
@@ -3652,7 +3652,7 @@ var require_websocket_server = __commonJS({
|
|
|
3652
3652
|
var EventEmitter4 = __require("events");
|
|
3653
3653
|
var http = __require("http");
|
|
3654
3654
|
var { Duplex: Duplex2 } = __require("stream");
|
|
3655
|
-
var { createHash:
|
|
3655
|
+
var { createHash: createHash84 } = __require("crypto");
|
|
3656
3656
|
var extension2 = require_extension();
|
|
3657
3657
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
3658
3658
|
var subprotocol2 = require_subprotocol();
|
|
@@ -3959,7 +3959,7 @@ var require_websocket_server = __commonJS({
|
|
|
3959
3959
|
);
|
|
3960
3960
|
}
|
|
3961
3961
|
if (this._state > RUNNING) return abortHandshake(socket2, 503);
|
|
3962
|
-
const digest2 =
|
|
3962
|
+
const digest2 = createHash84("sha1").update(key7 + GUID).digest("base64");
|
|
3963
3963
|
const headers = [
|
|
3964
3964
|
"HTTP/1.1 101 Switching Protocols",
|
|
3965
3965
|
"Upgrade: websocket",
|
|
@@ -317266,6 +317266,12 @@ function validateEdl(edl) {
|
|
|
317266
317266
|
if (t2.pitchSemitones != null && (!isNum(t2.pitchSemitones) || Math.abs(t2.pitchSemitones) > 12)) {
|
|
317267
317267
|
errors.push(`audio[${i}]: pitchSemitones must be -12..12.`);
|
|
317268
317268
|
}
|
|
317269
|
+
for (const [name, shape, bend] of [["fadeIn", t2.fadeInShape, t2.fadeInBend], ["fadeOut", t2.fadeOutShape, t2.fadeOutBend]]) {
|
|
317270
|
+
if (shape != null && !EDL_FADE_SHAPES.includes(shape))
|
|
317271
|
+
errors.push(`audio[${i}]: ${name}Shape must be one of ${EDL_FADE_SHAPES.join(", ")}.`);
|
|
317272
|
+
if (bend != null && (!isNum(bend) || Math.abs(bend) > 1))
|
|
317273
|
+
errors.push(`audio[${i}]: ${name}Bend must be -1..1.`);
|
|
317274
|
+
}
|
|
317269
317275
|
if (t2.gainKeys != null) {
|
|
317270
317276
|
if (!Array.isArray(t2.gainKeys) || t2.gainKeys.length > 64)
|
|
317271
317277
|
errors.push(`audio[${i}]: gainKeys must be a list of at most 64 keys.`);
|
|
@@ -317277,6 +317283,17 @@ function validateEdl(edl) {
|
|
|
317277
317283
|
errors.push(`audio[${i}].gainKeys[${j}]: keys must be in time order.`);
|
|
317278
317284
|
});
|
|
317279
317285
|
}
|
|
317286
|
+
if (t2.panKeys != null) {
|
|
317287
|
+
if (!Array.isArray(t2.panKeys) || t2.panKeys.length > 64)
|
|
317288
|
+
errors.push(`audio[${i}]: panKeys must be a list of at most 64 keys.`);
|
|
317289
|
+
else
|
|
317290
|
+
t2.panKeys.forEach((k, j) => {
|
|
317291
|
+
if (!isNum(k?.atSec) || k.atSec < 0 || !isNum(k.pan) || Math.abs(k.pan) > 1)
|
|
317292
|
+
errors.push(`audio[${i}].panKeys[${j}]: atSec must be \u2265 0 and pan -1..1.`);
|
|
317293
|
+
else if (j > 0 && k.atSec < t2.panKeys[j - 1].atSec)
|
|
317294
|
+
errors.push(`audio[${i}].panKeys[${j}]: keys must be in time order.`);
|
|
317295
|
+
});
|
|
317296
|
+
}
|
|
317280
317297
|
if (t2.bus != null && !busIds.has(t2.bus))
|
|
317281
317298
|
errors.push(`audio[${i}]: unknown bus '${t2.bus}'.`);
|
|
317282
317299
|
if (t2.sends != null) {
|
|
@@ -317290,6 +317307,8 @@ function validateEdl(edl) {
|
|
|
317290
317307
|
errors.push(`audio[${i}].sends[${j}]: the track already goes to bus '${x.bus}'.`);
|
|
317291
317308
|
if (!isNum(x?.db) || x.db < -120 || x.db > 24)
|
|
317292
317309
|
errors.push(`audio[${i}].sends[${j}]: db must be -120..24.`);
|
|
317310
|
+
if (x?.keys != null && (!Array.isArray(x.keys) || x.keys.length > 64 || x.keys.some((k, n2) => !isNum(k?.atSec) || k.atSec < 0 || !isNum(k.db) || k.db < -96 || k.db > 24 || n2 > 0 && k.atSec < x.keys[n2 - 1].atSec)))
|
|
317311
|
+
errors.push(`audio[${i}].sends[${j}]: keys must be at most 64 in time order, db -96..24.`);
|
|
317293
317312
|
});
|
|
317294
317313
|
}
|
|
317295
317314
|
});
|
|
@@ -317379,10 +317398,11 @@ function validateEdl(edl) {
|
|
|
317379
317398
|
errors.push("output.height must be \u2265 1.");
|
|
317380
317399
|
return errors;
|
|
317381
317400
|
}
|
|
317382
|
-
var MAX_AUDIO_BUSES, isNum;
|
|
317401
|
+
var EDL_FADE_SHAPES, MAX_AUDIO_BUSES, isNum;
|
|
317383
317402
|
var init_edl = __esm({
|
|
317384
317403
|
"../../packages/video-core/dist/edl.js"() {
|
|
317385
317404
|
"use strict";
|
|
317405
|
+
EDL_FADE_SHAPES = ["linear", "equalPower", "sCurve", "exponential", "logarithmic"];
|
|
317386
317406
|
MAX_AUDIO_BUSES = 8;
|
|
317387
317407
|
isNum = (n2) => typeof n2 === "number" && Number.isFinite(n2);
|
|
317388
317408
|
}
|
|
@@ -317427,6 +317447,28 @@ function gainKeysExpr(keys2) {
|
|
|
317427
317447
|
db = `if(lt(t,${round(keys2[0].atSec)}),${round(keys2[0].db)},${db})`;
|
|
317428
317448
|
return `pow(10,(${db})/20)`.replace(/,/g, "\\,");
|
|
317429
317449
|
}
|
|
317450
|
+
function fadeGainExpr(shape, bend, x) {
|
|
317451
|
+
const base2 = { linear: `(${x})`, equalPower: `sin((${x})*PI/2)`, sCurve: `(0.5-0.5*cos((${x})*PI))`, exponential: `pow(${x},3)`, logarithmic: `(1-pow(1-(${x}),3))` }[shape];
|
|
317452
|
+
if (!bend)
|
|
317453
|
+
return base2;
|
|
317454
|
+
const k = round(2 ** (4 * Math.max(-1, Math.min(1, bend))));
|
|
317455
|
+
return `(st(0,${base2});ld(0)*${k}/(ld(0)*${k}+1-ld(0)))`;
|
|
317456
|
+
}
|
|
317457
|
+
function shapedFades(t2) {
|
|
317458
|
+
const parts = [];
|
|
317459
|
+
if (t2.fadeInSec && !straightFade(t2.fadeInShape, t2.fadeInBend))
|
|
317460
|
+
parts.push(fadeGainExpr(t2.fadeInShape ?? "linear", t2.fadeInBend ?? 0, `clip(t/${round(t2.fadeInSec)},0,1)`));
|
|
317461
|
+
if (t2.fadeOutSec && t2.out != null && !straightFade(t2.fadeOutShape, t2.fadeOutBend))
|
|
317462
|
+
parts.push(fadeGainExpr(t2.fadeOutShape ?? "linear", t2.fadeOutBend ?? 0, `clip((${round(t2.out - (t2.in ?? 0))}-t)/${round(t2.fadeOutSec)},0,1)`));
|
|
317463
|
+
if (!parts.length)
|
|
317464
|
+
return null;
|
|
317465
|
+
const g = parts.join("*").replace(/,/g, "\\,");
|
|
317466
|
+
return `aeval='val(0)*${g}|val(1)*${g}':c=same`;
|
|
317467
|
+
}
|
|
317468
|
+
function panKeysFilter(keys2) {
|
|
317469
|
+
const p = `clip(${keyedExpr(keys2.map((k) => ({ atSec: k.atSec, value: k.pan })))}\\,-1\\,1)`;
|
|
317470
|
+
return `aeval='val(0)*min(1\\,1-${p})|val(1)*min(1\\,1+${p})':c=same`;
|
|
317471
|
+
}
|
|
317430
317472
|
function filterArg(path15) {
|
|
317431
317473
|
return path15.replace(/[\\':]/g, (c) => `\\${c}`).replace(/[\\'[\],;]/g, (c) => `\\${c}`);
|
|
317432
317474
|
}
|
|
@@ -317447,7 +317489,8 @@ function routeBuses(edl, labels, filters) {
|
|
|
317447
317489
|
filters.push(`${label4}asplit=${outs.length}${outs.join("")}`);
|
|
317448
317490
|
dest.push(outs[0]);
|
|
317449
317491
|
sends.forEach((x, j) => {
|
|
317450
|
-
|
|
317492
|
+
const keyed = x.keys?.length ? `,volume='${gainKeysExpr(x.keys.map((k) => ({ atSec: k.atSec + t2.startSec, db: k.db })))}':eval=frame` : "";
|
|
317493
|
+
filters.push(`${outs[j + 1]}volume=${round(x.db)}dB${keyed}[snd${i}s${j}]`);
|
|
317451
317494
|
into.get(x.bus).push(`[snd${i}s${j}]`);
|
|
317452
317495
|
});
|
|
317453
317496
|
});
|
|
@@ -317697,12 +317740,19 @@ function compileEdl(edl, opts) {
|
|
|
317697
317740
|
a.push(`volume=${round(t2.gainDb)}dB`);
|
|
317698
317741
|
if (t2.gainKeys?.length)
|
|
317699
317742
|
a.push(`volume='${gainKeysExpr(t2.gainKeys)}':eval=frame`);
|
|
317700
|
-
if (t2.fadeInSec)
|
|
317743
|
+
if (t2.fadeInSec && straightFade(t2.fadeInShape, t2.fadeInBend))
|
|
317701
317744
|
a.push(`afade=t=in:st=0:d=${round(t2.fadeInSec)}`);
|
|
317702
|
-
if (t2.fadeOutSec && t2.out != null)
|
|
317745
|
+
if (t2.fadeOutSec && t2.out != null && straightFade(t2.fadeOutShape, t2.fadeOutBend))
|
|
317703
317746
|
a.push(`afade=t=out:st=${round(Math.max(0, t2.out - (t2.in ?? 0) - t2.fadeOutSec))}:d=${round(t2.fadeOutSec)}`);
|
|
317704
317747
|
a.push("aresample=48000", "aformat=channel_layouts=stereo");
|
|
317705
|
-
|
|
317748
|
+
const shaped = shapedFades(t2);
|
|
317749
|
+
if (shaped)
|
|
317750
|
+
a.push(shaped);
|
|
317751
|
+
if (t2.invert)
|
|
317752
|
+
a.push("aeval='-val(0)|-val(1)':c=same");
|
|
317753
|
+
if (t2.panKeys?.length)
|
|
317754
|
+
a.push(panKeysFilter(t2.panKeys));
|
|
317755
|
+
else if (t2.pan) {
|
|
317706
317756
|
const p = Math.max(-1, Math.min(1, t2.pan));
|
|
317707
317757
|
a.push(`pan=stereo|c0=${round(Math.min(1, 1 - p))}*c0|c1=${round(Math.min(1, 1 + p))}*c1`);
|
|
317708
317758
|
}
|
|
@@ -317819,7 +317869,7 @@ function motionFilters(motion, amount, frames, W3, H3, fps) {
|
|
|
317819
317869
|
`zoompan=z='${z2}':x='${x}':y='${center.y}':d=1:s=${W3}x${H3}:fps=${fps}`
|
|
317820
317870
|
];
|
|
317821
317871
|
}
|
|
317822
|
-
var DEFAULTS2, MAX_SEGMENTS, MAX_AUDIO_TRACKS, ASPECT, round, dbToLinear, XFADE_NAME, EdlCompileError;
|
|
317872
|
+
var DEFAULTS2, MAX_SEGMENTS, MAX_AUDIO_TRACKS, ASPECT, round, straightFade, dbToLinear, XFADE_NAME, EdlCompileError;
|
|
317823
317873
|
var init_edl_compile = __esm({
|
|
317824
317874
|
"../../packages/video-core/dist/edl-compile.js"() {
|
|
317825
317875
|
"use strict";
|
|
@@ -317829,6 +317879,7 @@ var init_edl_compile = __esm({
|
|
|
317829
317879
|
MAX_AUDIO_TRACKS = 8;
|
|
317830
317880
|
ASPECT = { "16:9": 16 / 9, "9:16": 9 / 16, "1:1": 1 };
|
|
317831
317881
|
round = (n2) => Math.round(n2 * 1e3) / 1e3;
|
|
317882
|
+
straightFade = (shape, bend) => (!shape || shape === "linear") && !bend;
|
|
317832
317883
|
dbToLinear = (db) => 10 ** (db / 20);
|
|
317833
317884
|
XFADE_NAME = { crossfade: "fade", "fade-black": "fadeblack", wipeleft: "wipeleft", slideleft: "slideleft" };
|
|
317834
317885
|
EdlCompileError = class extends Error {
|
|
@@ -318673,9 +318724,9 @@ var init_dist25 = __esm({
|
|
|
318673
318724
|
|
|
318674
318725
|
// ../../packages/host-core/dist/video-edit.js
|
|
318675
318726
|
import { spawn as spawn16 } from "node:child_process";
|
|
318676
|
-
import { existsSync as existsSync85, mkdirSync as mkdirSync95, readFileSync as readFileSync125, rmSync as rmSync37, statSync as statSync72, writeFileSync as writeFileSync87 } from "node:fs";
|
|
318727
|
+
import { existsSync as existsSync85, mkdirSync as mkdirSync95, readFileSync as readFileSync125, readdirSync as readdirSync53, renameSync as renameSync49, rmSync as rmSync37, statSync as statSync72, utimesSync, writeFileSync as writeFileSync87 } from "node:fs";
|
|
318677
318728
|
import { join as join164, isAbsolute as isAbsolute35, dirname as dirname70, resolve as resolve34, sep as sep25, basename as basename31 } from "node:path";
|
|
318678
|
-
import { randomUUID as randomUUID60 } from "node:crypto";
|
|
318729
|
+
import { createHash as createHash38, randomUUID as randomUUID60 } from "node:crypto";
|
|
318679
318730
|
function requireAbsolutePath(p, label4 = "path") {
|
|
318680
318731
|
const raw2 = typeof p === "string" ? p.trim() : "";
|
|
318681
318732
|
if (!raw2)
|
|
@@ -319020,6 +319071,8 @@ async function detectSilence(path15, opts) {
|
|
|
319020
319071
|
}
|
|
319021
319072
|
async function extractAudio(path15, format4, outDir, opts) {
|
|
319022
319073
|
path15 = requireAbsolutePath(path15, "path");
|
|
319074
|
+
if (format4.startsWith("float:"))
|
|
319075
|
+
return decodeSound(path15, Number(format4.slice(6)));
|
|
319023
319076
|
const dir2 = outDir ?? workDir();
|
|
319024
319077
|
mkdirSync95(dir2, { recursive: true });
|
|
319025
319078
|
const out = join164(dir2, `audio.${format4}`);
|
|
@@ -319030,6 +319083,42 @@ async function extractAudio(path15, format4, outDir, opts) {
|
|
|
319030
319083
|
throw new Error(`Audio export failed${r.timedOut ? " (timed out)" : ""}: ${r.stderr.slice(-300)}`);
|
|
319031
319084
|
return { path: out, mime: MIME_BY_EXT[format4] ?? "audio/mp4" };
|
|
319032
319085
|
}
|
|
319086
|
+
function trimSoundCache(dir2, keep5, limit5 = SOUND_CACHE_BYTES) {
|
|
319087
|
+
const list7 = readdirSync53(dir2).filter((f3) => f3.endsWith(".wav")).map((f3) => {
|
|
319088
|
+
const p = join164(dir2, f3), s = statSync72(p);
|
|
319089
|
+
return { p, size: s.size, at: s.mtimeMs };
|
|
319090
|
+
}).sort((a, b) => b.at - a.at);
|
|
319091
|
+
let total = list7.reduce((n2, f3) => n2 + f3.size, 0);
|
|
319092
|
+
for (const f3 of list7.reverse()) {
|
|
319093
|
+
if (total <= limit5)
|
|
319094
|
+
break;
|
|
319095
|
+
if (f3.p === keep5)
|
|
319096
|
+
continue;
|
|
319097
|
+
rmSync37(f3.p, { force: true });
|
|
319098
|
+
total -= f3.size;
|
|
319099
|
+
}
|
|
319100
|
+
}
|
|
319101
|
+
async function decodeSound(path15, rate) {
|
|
319102
|
+
if (!Number.isInteger(rate) || rate < 8e3 || rate > 384e3)
|
|
319103
|
+
throw new Error("Bad sample rate.");
|
|
319104
|
+
const s = statSync72(path15), dir2 = join164(tesseractHome(), "media-work", "sound"), mime = MIME_BY_EXT.wav;
|
|
319105
|
+
mkdirSync95(dir2, { recursive: true });
|
|
319106
|
+
const out = join164(dir2, `${createHash38("sha256").update(JSON.stringify([path15, s.size, s.mtimeMs, rate])).digest("hex").slice(0, 32)}.wav`);
|
|
319107
|
+
if (existsSync85(out)) {
|
|
319108
|
+
const now2 = /* @__PURE__ */ new Date();
|
|
319109
|
+
utimesSync(out, now2, now2);
|
|
319110
|
+
return { path: out, mime };
|
|
319111
|
+
}
|
|
319112
|
+
const part = `${out}.${randomUUID60()}.part`;
|
|
319113
|
+
const r = await run7(resolveFfmpeg(), ["-y", "-i", path15, "-map", "0:a:0", "-ar", String(rate), "-c:a", "pcm_f32le", "-rf64", "auto", "-f", "wav", part], { timeoutMs: SOUND_TIMEOUT_MS });
|
|
319114
|
+
if (r.ok && existsSync85(part)) {
|
|
319115
|
+
renameSync49(part, out);
|
|
319116
|
+
trimSoundCache(dir2, out);
|
|
319117
|
+
return { path: out, mime };
|
|
319118
|
+
}
|
|
319119
|
+
rmSync37(part, { force: true });
|
|
319120
|
+
throw new Error(/matches no streams/.test(r.stderr) ? "This file has no sound." : `The sound could not be decoded${r.timedOut ? " (timed out)" : ""}: ${r.stderr.slice(-300)}`);
|
|
319121
|
+
}
|
|
319033
319122
|
async function isolateSpeakerAudio(path15, windows3, outDir) {
|
|
319034
319123
|
path15 = requireAbsolutePath(path15, "path");
|
|
319035
319124
|
if (!windows3.length)
|
|
@@ -319093,7 +319182,7 @@ function cleanupDir(dir2) {
|
|
|
319093
319182
|
function readChunkBase64(path15) {
|
|
319094
319183
|
return readFileSync125(path15).toString("base64");
|
|
319095
319184
|
}
|
|
319096
|
-
var mediaCwd, workDir, MIME_BY_EXT, DEFAULT_TIMEOUT_MS2, LONG_TIMEOUT_MS, MAX_FRAMES3;
|
|
319185
|
+
var mediaCwd, workDir, MIME_BY_EXT, DEFAULT_TIMEOUT_MS2, LONG_TIMEOUT_MS, MAX_FRAMES3, SOUND_TIMEOUT_MS, SOUND_CACHE_BYTES;
|
|
319097
319186
|
var init_video_edit = __esm({
|
|
319098
319187
|
"../../packages/host-core/dist/video-edit.js"() {
|
|
319099
319188
|
"use strict";
|
|
@@ -319121,12 +319210,14 @@ var init_video_edit = __esm({
|
|
|
319121
319210
|
DEFAULT_TIMEOUT_MS2 = 12e4;
|
|
319122
319211
|
LONG_TIMEOUT_MS = 6e5;
|
|
319123
319212
|
MAX_FRAMES3 = 1e6;
|
|
319213
|
+
SOUND_TIMEOUT_MS = 2 * 36e5;
|
|
319214
|
+
SOUND_CACHE_BYTES = 20 * 1024 ** 3;
|
|
319124
319215
|
}
|
|
319125
319216
|
});
|
|
319126
319217
|
|
|
319127
319218
|
// ../../packages/host-core/dist/video-upscale.js
|
|
319128
319219
|
import { spawn as spawn17 } from "node:child_process";
|
|
319129
|
-
import { existsSync as existsSync86, mkdirSync as mkdirSync96, readFileSync as readFileSync126, readdirSync as
|
|
319220
|
+
import { existsSync as existsSync86, mkdirSync as mkdirSync96, readFileSync as readFileSync126, readdirSync as readdirSync54, statSync as statSync73 } from "node:fs";
|
|
319130
319221
|
import { join as join165, dirname as dirname71 } from "node:path";
|
|
319131
319222
|
function upscaleSpawnCwd() {
|
|
319132
319223
|
if (!upscaleCwd) {
|
|
@@ -319310,7 +319401,7 @@ async function realesrganUpscale(path15, opts) {
|
|
|
319310
319401
|
const ext = await run7(resolveFfmpeg(), ["-i", extractSrc, "-fps_mode", "passthrough", join165(fin, "f%08d.png")], { timeoutMs: LONG });
|
|
319311
319402
|
if (!ext.ok)
|
|
319312
319403
|
throw new Error(`Frame extraction failed: ${ext.stderr.slice(-300)}`);
|
|
319313
|
-
const nFrames =
|
|
319404
|
+
const nFrames = readdirSync54(fin).filter((f3) => f3.endsWith(".png")).length;
|
|
319314
319405
|
if (!nFrames)
|
|
319315
319406
|
throw new Error("No frames extracted.");
|
|
319316
319407
|
await new Promise((resolve57, reject) => {
|
|
@@ -319484,7 +319575,7 @@ var init_video_mute = __esm({
|
|
|
319484
319575
|
});
|
|
319485
319576
|
|
|
319486
319577
|
// ../../packages/host-core/dist/video-jobs.js
|
|
319487
|
-
import { closeSync as closeSync14, constants as constants6, mkdirSync as mkdirSync97, openSync as openSync13, readdirSync as
|
|
319578
|
+
import { closeSync as closeSync14, constants as constants6, mkdirSync as mkdirSync97, openSync as openSync13, readdirSync as readdirSync55, readFileSync as readFileSync127, writeFileSync as writeFileSync88, rmSync as rmSync38 } from "node:fs";
|
|
319488
319579
|
import { mkdir as mkdir21, writeFile as writeFile22 } from "node:fs/promises";
|
|
319489
319580
|
import { dirname as dirname72, join as join167 } from "node:path";
|
|
319490
319581
|
import { randomUUID as randomUUID61 } from "node:crypto";
|
|
@@ -319660,7 +319751,7 @@ var init_video_jobs = __esm({
|
|
|
319660
319751
|
let resumed = 0;
|
|
319661
319752
|
let files;
|
|
319662
319753
|
try {
|
|
319663
|
-
files =
|
|
319754
|
+
files = readdirSync55(mediaJobsDir()).filter((f3) => f3.endsWith(".json"));
|
|
319664
319755
|
} catch {
|
|
319665
319756
|
return 0;
|
|
319666
319757
|
}
|
|
@@ -327267,7 +327358,7 @@ var init_source2 = __esm({
|
|
|
327267
327358
|
|
|
327268
327359
|
// ../../packages/host-core/dist/agent-config/skills.js
|
|
327269
327360
|
import { randomUUID as randomUUID65 } from "node:crypto";
|
|
327270
|
-
import { existsSync as existsSync88, mkdirSync as mkdirSync99, readFileSync as readFileSync132, readdirSync as
|
|
327361
|
+
import { existsSync as existsSync88, mkdirSync as mkdirSync99, readFileSync as readFileSync132, readdirSync as readdirSync56, renameSync as renameSync50, rmSync as rmSync39, statSync as statSync75, writeFileSync as writeFileSync90 } from "node:fs";
|
|
327271
327362
|
import { homedir as homedir43 } from "node:os";
|
|
327272
327363
|
import { dirname as dirname73, join as join173, resolve as resolve35, sep as sep27 } from "node:path";
|
|
327273
327364
|
function defaultSkillFolders(extensionsRoot) {
|
|
@@ -327339,7 +327430,7 @@ function writeAtomic5(file8, text45) {
|
|
|
327339
327430
|
mkdirSync99(dirname73(file8), { recursive: true });
|
|
327340
327431
|
const tmp = `${file8}.${process.pid}.${randomUUID65().slice(0, 8)}.tmp`;
|
|
327341
327432
|
writeFileSync90(tmp, text45, { mode: 384 });
|
|
327342
|
-
|
|
327433
|
+
renameSync50(tmp, file8);
|
|
327343
327434
|
}
|
|
327344
327435
|
function readProfile2(managed) {
|
|
327345
327436
|
const raw2 = readJson3(join173(managed, "profile.json"), {});
|
|
@@ -327354,7 +327445,7 @@ function skillDirs(base2, exclude = []) {
|
|
|
327354
327445
|
const out = [];
|
|
327355
327446
|
let top;
|
|
327356
327447
|
try {
|
|
327357
|
-
top =
|
|
327448
|
+
top = readdirSync56(base2).sort();
|
|
327358
327449
|
} catch {
|
|
327359
327450
|
return out;
|
|
327360
327451
|
}
|
|
@@ -327377,7 +327468,7 @@ function skillDirs(base2, exclude = []) {
|
|
|
327377
327468
|
}
|
|
327378
327469
|
let inner2;
|
|
327379
327470
|
try {
|
|
327380
|
-
inner2 =
|
|
327471
|
+
inner2 = readdirSync56(dir2).sort();
|
|
327381
327472
|
} catch {
|
|
327382
327473
|
continue;
|
|
327383
327474
|
}
|
|
@@ -327509,7 +327600,7 @@ function setSkillEnabled(folders, id2, enabled2) {
|
|
|
327509
327600
|
const [from, to] = enabled2 ? [off, on] : [on, off];
|
|
327510
327601
|
if (existsSync88(from) && !existsSync88(to)) {
|
|
327511
327602
|
mkdirSync99(dirname73(to), { recursive: true });
|
|
327512
|
-
|
|
327603
|
+
renameSync50(from, to);
|
|
327513
327604
|
}
|
|
327514
327605
|
if (enabled2 && profile.disabled.includes(s.name)) {
|
|
327515
327606
|
profile.disabled = profile.disabled.filter((n2) => n2 !== s.name);
|
|
@@ -327615,7 +327706,7 @@ function installSkillFiles(folders, input, origin2) {
|
|
|
327615
327706
|
}
|
|
327616
327707
|
for (const sub of ["skills", "disabled"])
|
|
327617
327708
|
rmSync39(join173(ext, sub, slug5), { recursive: true, force: true });
|
|
327618
|
-
|
|
327709
|
+
renameSync50(stage, join173(ext, "skills", slug5));
|
|
327619
327710
|
} finally {
|
|
327620
327711
|
rmSync39(stage, { recursive: true, force: true });
|
|
327621
327712
|
}
|
|
@@ -327650,7 +327741,7 @@ var init_skills5 = __esm({
|
|
|
327650
327741
|
|
|
327651
327742
|
// ../../packages/host-core/dist/agent-config/plugins.js
|
|
327652
327743
|
import { spawn as spawn18 } from "node:child_process";
|
|
327653
|
-
import { existsSync as existsSync89, mkdirSync as mkdirSync100, readdirSync as
|
|
327744
|
+
import { existsSync as existsSync89, mkdirSync as mkdirSync100, readdirSync as readdirSync57, rmSync as rmSync40, writeFileSync as writeFileSync91 } from "node:fs";
|
|
327654
327745
|
import { join as join174 } from "node:path";
|
|
327655
327746
|
import { gzipSync } from "node:zlib";
|
|
327656
327747
|
function npmSpecName(spec) {
|
|
@@ -327698,7 +327789,7 @@ function writePluginTarball(pkg, archivesDir) {
|
|
|
327698
327789
|
function forgetPluginTarballs(archivesDir, name) {
|
|
327699
327790
|
let entries;
|
|
327700
327791
|
try {
|
|
327701
|
-
entries =
|
|
327792
|
+
entries = readdirSync57(archivesDir);
|
|
327702
327793
|
} catch {
|
|
327703
327794
|
return;
|
|
327704
327795
|
}
|
|
@@ -327817,11 +327908,11 @@ var init_plugins = __esm({
|
|
|
327817
327908
|
});
|
|
327818
327909
|
|
|
327819
327910
|
// ../../packages/host-core/dist/subscription-signin.js
|
|
327820
|
-
import { createHash as
|
|
327911
|
+
import { createHash as createHash39, randomBytes as randomBytes29 } from "node:crypto";
|
|
327821
327912
|
function startSubscriptionSignIn(provider11) {
|
|
327822
327913
|
const c = CLIENTS[provider11];
|
|
327823
327914
|
const verifier = b64url2(randomBytes29(32));
|
|
327824
|
-
const challenge = b64url2(
|
|
327915
|
+
const challenge = b64url2(createHash39("sha256").update(verifier).digest());
|
|
327825
327916
|
const state6 = b64url2(randomBytes29(24));
|
|
327826
327917
|
const url2 = new URL(c.authorizeUrl);
|
|
327827
327918
|
for (const [k, v] of Object.entries({
|
|
@@ -334043,7 +334134,7 @@ var init_types16 = __esm({
|
|
|
334043
334134
|
// ../../packages/host-core/dist/vfs/http-client.js
|
|
334044
334135
|
import { Agent as HttpAgent, request as httpRequest4 } from "node:http";
|
|
334045
334136
|
import { Agent as HttpsAgent, request as httpsRequest2 } from "node:https";
|
|
334046
|
-
import { createHash as
|
|
334137
|
+
import { createHash as createHash40, randomBytes as randomBytes30 } from "node:crypto";
|
|
334047
334138
|
async function readText3(res, cap = 32 * 1024 * 1024) {
|
|
334048
334139
|
const chunks3 = [];
|
|
334049
334140
|
let n2 = 0;
|
|
@@ -334158,8 +334249,8 @@ var init_http_client = __esm({
|
|
|
334158
334249
|
this.agent.destroy();
|
|
334159
334250
|
}
|
|
334160
334251
|
};
|
|
334161
|
-
md52 = (s) =>
|
|
334162
|
-
sha2563 = (s) =>
|
|
334252
|
+
md52 = (s) => createHash40("md5").update(s).digest("hex");
|
|
334253
|
+
sha2563 = (s) => createHash40("sha256").update(s).digest("hex");
|
|
334163
334254
|
Authenticator = class {
|
|
334164
334255
|
login;
|
|
334165
334256
|
digest = null;
|
|
@@ -340727,7 +340818,7 @@ var require_keyParser = __commonJS({
|
|
|
340727
340818
|
var {
|
|
340728
340819
|
createDecipheriv: createDecipheriv2,
|
|
340729
340820
|
createECDH,
|
|
340730
|
-
createHash:
|
|
340821
|
+
createHash: createHash84,
|
|
340731
340822
|
createHmac: createHmac9,
|
|
340732
340823
|
createSign: createSign2,
|
|
340733
340824
|
createVerify,
|
|
@@ -341415,11 +341506,11 @@ ${formatted}-----END ${type2} KEY-----`;
|
|
|
341415
341506
|
);
|
|
341416
341507
|
}
|
|
341417
341508
|
const ivSlice = bufferSlice(cipherIV, 0, 8);
|
|
341418
|
-
let cipherKey =
|
|
341509
|
+
let cipherKey = createHash84("md5").update(passphrase).update(ivSlice).digest();
|
|
341419
341510
|
while (cipherKey.length < encInfo.keyLen) {
|
|
341420
341511
|
cipherKey = combineBuffers(
|
|
341421
341512
|
cipherKey,
|
|
341422
|
-
|
|
341513
|
+
createHash84("md5").update(cipherKey).update(passphrase).update(ivSlice).digest()
|
|
341423
341514
|
);
|
|
341424
341515
|
}
|
|
341425
341516
|
if (cipherKey.length > encInfo.keyLen)
|
|
@@ -341584,8 +341675,8 @@ ${formatted}-----END ${type2} KEY-----`;
|
|
|
341584
341675
|
if (encrypted) {
|
|
341585
341676
|
const encInfo = CIPHER_INFO[cipherName];
|
|
341586
341677
|
let cipherKey = combineBuffers(
|
|
341587
|
-
|
|
341588
|
-
|
|
341678
|
+
createHash84("sha1").update(PPK_PP1).update(passphrase).digest(),
|
|
341679
|
+
createHash84("sha1").update(PPK_PP2).update(passphrase).digest()
|
|
341589
341680
|
);
|
|
341590
341681
|
if (cipherKey.length > encInfo.keyLen)
|
|
341591
341682
|
cipherKey = bufferSlice(cipherKey, 0, encInfo.keyLen);
|
|
@@ -341625,7 +341716,7 @@ ${formatted}-----END ${type2} KEY-----`;
|
|
|
341625
341716
|
passphrase = EMPTY_PASSPHRASE;
|
|
341626
341717
|
const calcMAC = createHmac9(
|
|
341627
341718
|
"sha1",
|
|
341628
|
-
|
|
341719
|
+
createHash84("sha1").update("putty-private-key-file-mac-key").update(passphrase).digest()
|
|
341629
341720
|
).update(macData).digest("hex");
|
|
341630
341721
|
if (calcMAC !== mac3) {
|
|
341631
341722
|
if (encrypted) {
|
|
@@ -343947,7 +344038,7 @@ var require_kex = __commonJS({
|
|
|
343947
344038
|
createDiffieHellman,
|
|
343948
344039
|
createDiffieHellmanGroup,
|
|
343949
344040
|
createECDH,
|
|
343950
|
-
createHash:
|
|
344041
|
+
createHash: createHash84,
|
|
343951
344042
|
createPublicKey: createPublicKey5,
|
|
343952
344043
|
diffieHellman: diffieHellman2,
|
|
343953
344044
|
generateKeyPairSync: generateKeyPairSync2,
|
|
@@ -344373,7 +344464,7 @@ var require_kex = __commonJS({
|
|
|
344373
344464
|
DISCONNECT_REASON.KEY_EXCHANGE_FAILED
|
|
344374
344465
|
);
|
|
344375
344466
|
}
|
|
344376
|
-
const hash3 =
|
|
344467
|
+
const hash3 = createHash84(this.hashName);
|
|
344377
344468
|
hashString2(hash3, isServer ? this._remoteIdentRaw : this._identRaw);
|
|
344378
344469
|
hashString2(hash3, isServer ? this._identRaw : this._remoteIdentRaw);
|
|
344379
344470
|
hashString2(hash3, isServer ? this._remoteKexinit : this._kexinit);
|
|
@@ -345381,9 +345472,9 @@ var require_kex = __commonJS({
|
|
|
345381
345472
|
function generateKEXVal(len2, hashName, secret, exchangeHash, sessionID, char) {
|
|
345382
345473
|
let ret;
|
|
345383
345474
|
if (len2) {
|
|
345384
|
-
let digest2 =
|
|
345475
|
+
let digest2 = createHash84(hashName).update(secret).update(exchangeHash).update(char).update(sessionID).digest();
|
|
345385
345476
|
while (digest2.length < len2) {
|
|
345386
|
-
const chunk =
|
|
345477
|
+
const chunk = createHash84(hashName).update(secret).update(exchangeHash).update(digest2).digest();
|
|
345387
345478
|
const extended = Buffer.allocUnsafe(digest2.length + chunk.length);
|
|
345388
345479
|
extended.set(digest2, 0);
|
|
345389
345480
|
extended.set(chunk, digest2.length);
|
|
@@ -350818,7 +350909,7 @@ var require_client = __commonJS({
|
|
|
350818
350909
|
"../../node_modules/ssh2/lib/client.js"(exports2, module) {
|
|
350819
350910
|
"use strict";
|
|
350820
350911
|
var {
|
|
350821
|
-
createHash:
|
|
350912
|
+
createHash: createHash84,
|
|
350822
350913
|
getHashes,
|
|
350823
350914
|
randomFillSync
|
|
350824
350915
|
} = __require("crypto");
|
|
@@ -351040,7 +351131,7 @@ var require_client = __commonJS({
|
|
|
351040
351131
|
}
|
|
351041
351132
|
hostVerifier = (key7, verify5) => {
|
|
351042
351133
|
if (hashAlgo)
|
|
351043
|
-
key7 =
|
|
351134
|
+
key7 = createHash84(hashAlgo).update(key7).digest("hex");
|
|
351044
351135
|
const ret = hashCb(key7, verify5);
|
|
351045
351136
|
if (ret !== void 0)
|
|
351046
351137
|
verify5(ret);
|
|
@@ -354341,8 +354432,8 @@ var require_lib7 = __commonJS({
|
|
|
354341
354432
|
});
|
|
354342
354433
|
|
|
354343
354434
|
// ../../packages/host-core/dist/vfs/secrets.js
|
|
354344
|
-
import { createHash as
|
|
354345
|
-
import { existsSync as existsSync91, readFileSync as readFileSync134, renameSync as
|
|
354435
|
+
import { createHash as createHash41 } from "node:crypto";
|
|
354436
|
+
import { existsSync as existsSync91, readFileSync as readFileSync134, renameSync as renameSync51, rmSync as rmSync42 } from "node:fs";
|
|
354346
354437
|
import { join as join181 } from "node:path";
|
|
354347
354438
|
function setVfsVault(v) {
|
|
354348
354439
|
installed5 = v;
|
|
@@ -354460,7 +354551,7 @@ async function describeKey(privateKey, passphrase) {
|
|
|
354460
354551
|
const pub2 = k.getPublicSSH();
|
|
354461
354552
|
return {
|
|
354462
354553
|
publicKey: `${k.type} ${pub2.toString("base64")}`,
|
|
354463
|
-
fingerprint: `SHA256:${
|
|
354554
|
+
fingerprint: `SHA256:${createHash41("sha256").update(pub2).digest("base64").replace(/=+$/, "")}`,
|
|
354464
354555
|
keyType: k.type.startsWith("ecdsa") ? "ecdsa" : k.type.replace(/^ssh-/, "")
|
|
354465
354556
|
};
|
|
354466
354557
|
} catch {
|
|
@@ -354532,7 +354623,7 @@ function migrate2(v) {
|
|
|
354532
354623
|
return;
|
|
354533
354624
|
const claim = `${f3}.moving-${process.pid}`;
|
|
354534
354625
|
try {
|
|
354535
|
-
|
|
354626
|
+
renameSync51(f3, claim);
|
|
354536
354627
|
} catch {
|
|
354537
354628
|
return;
|
|
354538
354629
|
}
|
|
@@ -354554,7 +354645,7 @@ function migrate2(v) {
|
|
|
354554
354645
|
} catch (err2) {
|
|
354555
354646
|
try {
|
|
354556
354647
|
if (!existsSync91(f3))
|
|
354557
|
-
|
|
354648
|
+
renameSync51(claim, f3);
|
|
354558
354649
|
} catch {
|
|
354559
354650
|
}
|
|
354560
354651
|
throw err2;
|
|
@@ -354698,7 +354789,7 @@ var init_secrets2 = __esm({
|
|
|
354698
354789
|
});
|
|
354699
354790
|
|
|
354700
354791
|
// ../../packages/host-core/dist/vfs/s3.js
|
|
354701
|
-
import { createHash as
|
|
354792
|
+
import { createHash as createHash42, createHmac as createHmac3 } from "node:crypto";
|
|
354702
354793
|
import { mkdirSync as mkdirSync101, readFileSync as readFileSync135, rmSync as rmSync43, writeFileSync as writeFileSync93 } from "node:fs";
|
|
354703
354794
|
import { join as join182, posix as posix4 } from "node:path";
|
|
354704
354795
|
import { Readable as Readable3 } from "node:stream";
|
|
@@ -354797,10 +354888,10 @@ var init_s3 = __esm({
|
|
|
354797
354888
|
init_http_client();
|
|
354798
354889
|
init_secrets2();
|
|
354799
354890
|
init_types16();
|
|
354800
|
-
EMPTY_SHA =
|
|
354891
|
+
EMPTY_SHA = createHash42("sha256").update("").digest("hex");
|
|
354801
354892
|
PART_SIZE = 16 * 1024 * 1024;
|
|
354802
354893
|
PENDING_MAX_AGE_MS = 7 * 24 * 3600 * 1e3;
|
|
354803
|
-
recordFile2 = (endpoint5, bucket2, key7) => join182(vfsDataDir(), "uploads",
|
|
354894
|
+
recordFile2 = (endpoint5, bucket2, key7) => join182(vfsDataDir(), "uploads", createHash42("sha256").update(`s3
|
|
354804
354895
|
${endpoint5}
|
|
354805
354896
|
${bucket2}
|
|
354806
354897
|
${key7}`).digest("hex").slice(0, 32) + ".json");
|
|
@@ -354817,7 +354908,7 @@ ${key7}`).digest("hex").slice(0, 32) + ".json");
|
|
|
354817
354908
|
isArray: (name) => ["Bucket", "Contents", "CommonPrefixes", "Part"].includes(name)
|
|
354818
354909
|
});
|
|
354819
354910
|
hmac2 = (key7, data3) => createHmac3("sha256", key7).update(data3).digest();
|
|
354820
|
-
sha256hex = (data3) =>
|
|
354911
|
+
sha256hex = (data3) => createHash42("sha256").update(data3).digest("hex");
|
|
354821
354912
|
S3Session = class {
|
|
354822
354913
|
u;
|
|
354823
354914
|
keys;
|
|
@@ -355238,7 +355329,7 @@ ${key7}`).digest("hex").slice(0, 32) + ".json");
|
|
|
355238
355329
|
});
|
|
355239
355330
|
|
|
355240
355331
|
// ../../packages/host-core/dist/vfs/azure.js
|
|
355241
|
-
import { createHash as
|
|
355332
|
+
import { createHash as createHash43, createHmac as createHmac4, randomBytes as randomBytes31 } from "node:crypto";
|
|
355242
355333
|
import { posix as posix5 } from "node:path";
|
|
355243
355334
|
import { Readable as Readable4 } from "node:stream";
|
|
355244
355335
|
function sharedKeyAuthorization(i) {
|
|
@@ -355460,7 +355551,7 @@ var init_azure3 = __esm({
|
|
|
355460
355551
|
* and the upload continues after them. Ids within a blob must all be the same length.
|
|
355461
355552
|
*/
|
|
355462
355553
|
blockId(path15, size2, mtimeMs, ix, random2) {
|
|
355463
|
-
const token4 = random2 ??
|
|
355554
|
+
const token4 = random2 ?? createHash43("sha256").update(`${path15}
|
|
355464
355555
|
${size2}
|
|
355465
355556
|
${mtimeMs ?? ""}`).digest("hex").slice(0, 16);
|
|
355466
355557
|
return Buffer.from(`${token4}-${String(ix).padStart(6, "0")}`).toString("base64");
|
|
@@ -355605,7 +355696,7 @@ ${mtimeMs ?? ""}`).digest("hex").slice(0, 16);
|
|
|
355605
355696
|
});
|
|
355606
355697
|
|
|
355607
355698
|
// ../../packages/host-core/dist/vfs/oauth.js
|
|
355608
|
-
import { createHash as
|
|
355699
|
+
import { createHash as createHash44, randomBytes as randomBytes32 } from "node:crypto";
|
|
355609
355700
|
import { createServer as createServer11 } from "node:http";
|
|
355610
355701
|
async function getJson5(url2, token4, init = {}) {
|
|
355611
355702
|
const res = await fetch(url2, { method: init.method ?? "GET", headers: { authorization: `Bearer ${token4}`, ...init.headers ?? {} }, body: init.body });
|
|
@@ -355664,7 +355755,7 @@ async function signInToCloud(protocol, opts) {
|
|
|
355664
355755
|
if (!p.clientId)
|
|
355665
355756
|
throw new VfsError("unsupported", `${p.label} sign-in isn't set up in this version yet.`);
|
|
355666
355757
|
const verifier = b64url3(randomBytes32(48));
|
|
355667
|
-
const challenge = b64url3(
|
|
355758
|
+
const challenge = b64url3(createHash44("sha256").update(verifier).digest());
|
|
355668
355759
|
const state6 = b64url3(randomBytes32(18));
|
|
355669
355760
|
const { server: server3, port } = await listen2(p);
|
|
355670
355761
|
const path15 = p.redirectPath ?? "/callback";
|
|
@@ -355924,7 +356015,7 @@ __export(webdav_exports, {
|
|
|
355924
356015
|
skipBytes: () => skipBytes,
|
|
355925
356016
|
webdavDriver: () => webdavDriver
|
|
355926
356017
|
});
|
|
355927
|
-
import { createHash as
|
|
356018
|
+
import { createHash as createHash45 } from "node:crypto";
|
|
355928
356019
|
import { posix as posix6 } from "node:path";
|
|
355929
356020
|
import { Readable as Readable5, Transform } from "node:stream";
|
|
355930
356021
|
function originOf(u) {
|
|
@@ -356273,7 +356364,7 @@ var init_webdav = __esm({
|
|
|
356273
356364
|
return `${this.origin}/remote.php/dav/uploads/${encodeURIComponent(this.u.user ?? "")}/${id2}/${name ? encodeURIComponent(name) : ""}`;
|
|
356274
356365
|
}
|
|
356275
356366
|
uploadId(path15, size2, mtimeMs) {
|
|
356276
|
-
return "tess-" +
|
|
356367
|
+
return "tess-" + createHash45("sha256").update(`${path15}
|
|
356277
356368
|
${size2}
|
|
356278
356369
|
${mtimeMs ?? ""}`).digest("hex").slice(0, 24);
|
|
356279
356370
|
}
|
|
@@ -356473,7 +356564,7 @@ ${mtimeMs ?? ""}`).digest("hex").slice(0, 24);
|
|
|
356473
356564
|
});
|
|
356474
356565
|
|
|
356475
356566
|
// ../../packages/host-core/dist/vfs/dropbox.js
|
|
356476
|
-
import { createHash as
|
|
356567
|
+
import { createHash as createHash46 } from "node:crypto";
|
|
356477
356568
|
import { mkdirSync as mkdirSync102, readFileSync as readFileSync136, rmSync as rmSync44, writeFileSync as writeFileSync94 } from "node:fs";
|
|
356478
356569
|
import { join as join183, posix as posix7 } from "node:path";
|
|
356479
356570
|
import { Readable as Readable6 } from "node:stream";
|
|
@@ -356591,7 +356682,7 @@ var init_dropbox = __esm({
|
|
|
356591
356682
|
}
|
|
356592
356683
|
// ── uploads ──────────────────────────────────────────────────────────────────────
|
|
356593
356684
|
recordFile(path15) {
|
|
356594
|
-
return join183(vfsDataDir(), "uploads",
|
|
356685
|
+
return join183(vfsDataDir(), "uploads", createHash46("sha256").update(`dropbox
|
|
356595
356686
|
${this.connKey}
|
|
356596
356687
|
${path15.toLowerCase()}`).digest("hex").slice(0, 32) + ".json");
|
|
356597
356688
|
}
|
|
@@ -359538,7 +359629,7 @@ var init_ftp = __esm({
|
|
|
359538
359629
|
});
|
|
359539
359630
|
|
|
359540
359631
|
// ../../packages/host-core/dist/vfs/googledrive.js
|
|
359541
|
-
import { createHash as
|
|
359632
|
+
import { createHash as createHash47 } from "node:crypto";
|
|
359542
359633
|
import { mkdirSync as mkdirSync103, readFileSync as readFileSync137, rmSync as rmSync45, writeFileSync as writeFileSync95 } from "node:fs";
|
|
359543
359634
|
import { join as join184, posix as posix10 } from "node:path";
|
|
359544
359635
|
function nodeOf(f3) {
|
|
@@ -359799,7 +359890,7 @@ var init_googledrive = __esm({
|
|
|
359799
359890
|
}
|
|
359800
359891
|
// ── uploads ──────────────────────────────────────────────────────────────────────
|
|
359801
359892
|
recordFile(path15) {
|
|
359802
|
-
return join184(vfsDataDir(), "uploads",
|
|
359893
|
+
return join184(vfsDataDir(), "uploads", createHash47("sha256").update(`googledrive
|
|
359803
359894
|
${this.connKey}
|
|
359804
359895
|
${path15}`).digest("hex").slice(0, 32) + ".json");
|
|
359805
359896
|
}
|
|
@@ -359962,7 +360053,7 @@ ${path15}`).digest("hex").slice(0, 32) + ".json");
|
|
|
359962
360053
|
});
|
|
359963
360054
|
|
|
359964
360055
|
// ../../packages/host-core/dist/vfs/irods.js
|
|
359965
|
-
import { createHash as
|
|
360056
|
+
import { createHash as createHash48, randomBytes as randomBytes33 } from "node:crypto";
|
|
359966
360057
|
import { connect as netConnect3, isIP as isIP2 } from "node:net";
|
|
359967
360058
|
import { posix as posix11 } from "node:path";
|
|
359968
360059
|
import { Readable as Readable8 } from "node:stream";
|
|
@@ -360009,7 +360100,7 @@ function header3(type2, msgLen, errorLen, bsLen, intInfo) {
|
|
|
360009
360100
|
function challengeDigest(challenge, password) {
|
|
360010
360101
|
const pw = Buffer.alloc(MAX_PASSWORD);
|
|
360011
360102
|
Buffer.from(password.replace(/^[\t\n\v\f\r ]+|[\t\n\v\f\r ]+$/g, ""), "utf-8").copy(pw, 0, 0, MAX_PASSWORD);
|
|
360012
|
-
const d =
|
|
360103
|
+
const d = createHash48("md5").update(challenge).update(pw).digest();
|
|
360013
360104
|
for (let i = 0; i < d.length; i++)
|
|
360014
360105
|
if (d[i] === 0)
|
|
360015
360106
|
d[i] = 1;
|
|
@@ -360641,7 +360732,7 @@ var init_irods = __esm({
|
|
|
360641
360732
|
});
|
|
360642
360733
|
|
|
360643
360734
|
// ../../packages/host-core/dist/vfs/onedrive.js
|
|
360644
|
-
import { createHash as
|
|
360735
|
+
import { createHash as createHash49 } from "node:crypto";
|
|
360645
360736
|
import { mkdirSync as mkdirSync104, readFileSync as readFileSync138, rmSync as rmSync46, writeFileSync as writeFileSync96 } from "node:fs";
|
|
360646
360737
|
import { join as join185, posix as posix12 } from "node:path";
|
|
360647
360738
|
import { Readable as Readable9 } from "node:stream";
|
|
@@ -360768,7 +360859,7 @@ var init_onedrive = __esm({
|
|
|
360768
360859
|
}
|
|
360769
360860
|
// ── uploads ──────────────────────────────────────────────────────────────────────
|
|
360770
360861
|
recordFile(path15) {
|
|
360771
|
-
return join185(vfsDataDir(), "uploads",
|
|
360862
|
+
return join185(vfsDataDir(), "uploads", createHash49("sha256").update(`onedrive
|
|
360772
360863
|
${this.connKey}
|
|
360773
360864
|
${path15}`).digest("hex").slice(0, 32) + ".json");
|
|
360774
360865
|
}
|
|
@@ -361068,8 +361159,8 @@ var init_registry6 = __esm({
|
|
|
361068
361159
|
});
|
|
361069
361160
|
|
|
361070
361161
|
// ../../packages/host-core/dist/ssh/ssh-connect.js
|
|
361071
|
-
import { createHash as
|
|
361072
|
-
import { existsSync as existsSync92, mkdirSync as mkdirSync105, readFileSync as readFileSync139, renameSync as
|
|
361162
|
+
import { createHash as createHash50 } from "node:crypto";
|
|
361163
|
+
import { existsSync as existsSync92, mkdirSync as mkdirSync105, readFileSync as readFileSync139, renameSync as renameSync52, writeFileSync as writeFileSync97 } from "node:fs";
|
|
361073
361164
|
import { homedir as homedir47 } from "node:os";
|
|
361074
361165
|
import { join as join186 } from "node:path";
|
|
361075
361166
|
function globToRe(pattern) {
|
|
@@ -361134,7 +361225,7 @@ function remember2(id2, fp) {
|
|
|
361134
361225
|
all2[id2] = fp;
|
|
361135
361226
|
const tmp = `${knownFile()}.${process.pid}.tmp`;
|
|
361136
361227
|
writeFileSync97(tmp, JSON.stringify(all2, null, 2), { mode: 384 });
|
|
361137
|
-
|
|
361228
|
+
renameSync52(tmp, knownFile());
|
|
361138
361229
|
} catch {
|
|
361139
361230
|
}
|
|
361140
361231
|
}
|
|
@@ -361147,7 +361238,7 @@ function forgetHostKey(host3, port) {
|
|
|
361147
361238
|
}
|
|
361148
361239
|
}
|
|
361149
361240
|
function hostKeyFingerprint(key7) {
|
|
361150
|
-
return "SHA256:" +
|
|
361241
|
+
return "SHA256:" + createHash50("sha256").update(key7).digest("base64").replace(/=+$/, "");
|
|
361151
361242
|
}
|
|
361152
361243
|
function loadKey(file8) {
|
|
361153
361244
|
try {
|
|
@@ -361609,8 +361700,8 @@ var init_local2 = __esm({
|
|
|
361609
361700
|
|
|
361610
361701
|
// ../../packages/host-core/dist/vfs/smb.js
|
|
361611
361702
|
import { spawn as spawn20 } from "node:child_process";
|
|
361612
|
-
import { createHash as
|
|
361613
|
-
import { existsSync as existsSync93, mkdirSync as mkdirSync106, readdirSync as
|
|
361703
|
+
import { createHash as createHash51 } from "node:crypto";
|
|
361704
|
+
import { existsSync as existsSync93, mkdirSync as mkdirSync106, readdirSync as readdirSync58, realpathSync as realpathSync27 } from "node:fs";
|
|
361614
361705
|
import { join as join188, posix as posix14, win32 as win325 } from "node:path";
|
|
361615
361706
|
function run8(cmd, args, input, timeoutMs = 3e4) {
|
|
361616
361707
|
return new Promise((resolve57) => {
|
|
@@ -361708,7 +361799,7 @@ var init_smb = __esm({
|
|
|
361708
361799
|
encSmb = (s) => encodeURIComponent(s);
|
|
361709
361800
|
macMounter = {
|
|
361710
361801
|
async mount(u, share, secret) {
|
|
361711
|
-
const root = join188(vfsDataDir(), "mnt",
|
|
361802
|
+
const root = join188(vfsDataDir(), "mnt", createHash51("sha256").update(`${u.host}
|
|
361712
361803
|
${u.port ?? ""}
|
|
361713
361804
|
${u.domain ?? ""}
|
|
361714
361805
|
${u.user ?? ""}
|
|
@@ -361762,7 +361853,7 @@ ${share}`).digest("hex").slice(0, 16));
|
|
|
361762
361853
|
linuxMounter = {
|
|
361763
361854
|
async mount(u, share, secret) {
|
|
361764
361855
|
const base2 = `/run/user/${process.getuid?.() ?? 1e3}/gvfs`;
|
|
361765
|
-
const existing = existsSync93(base2) ? findGvfsRoot(
|
|
361856
|
+
const existing = existsSync93(base2) ? findGvfsRoot(readdirSync58(base2), u.host, share) : void 0;
|
|
361766
361857
|
if (existing)
|
|
361767
361858
|
return join188(base2, existing);
|
|
361768
361859
|
const url2 = `smb://${u.user ? `${u.domain ? `${encSmb(u.domain)};` : ""}${encSmb(u.user)}@` : ""}${u.host}${u.port ? `:${u.port}` : ""}/${encSmb(share)}`;
|
|
@@ -361775,7 +361866,7 @@ ${secret?.password ?? ""}
|
|
|
361775
361866
|
throw new VfsError("unsupported", "Connecting to file shares needs GVfs (the gio command), which this computer doesn\u2019t have.");
|
|
361776
361867
|
throw smbError(r.err || r.out, share, secret?.password !== void 0);
|
|
361777
361868
|
}
|
|
361778
|
-
const found = existsSync93(base2) ? findGvfsRoot(
|
|
361869
|
+
const found = existsSync93(base2) ? findGvfsRoot(readdirSync58(base2), u.host, share) : void 0;
|
|
361779
361870
|
if (!found)
|
|
361780
361871
|
throw new VfsError("failed", `The share ${share} connected but its folder didn't appear.`);
|
|
361781
361872
|
return join188(base2, found);
|
|
@@ -362610,7 +362701,7 @@ var init_swift = __esm({
|
|
|
362610
362701
|
});
|
|
362611
362702
|
|
|
362612
362703
|
// ../../packages/host-core/dist/vfs/transfer.js
|
|
362613
|
-
import { createHash as
|
|
362704
|
+
import { createHash as createHash52 } from "node:crypto";
|
|
362614
362705
|
import { mkdirSync as mkdirSync107, readFileSync as readFileSync140, rmSync as rmSync47, writeFileSync as writeFileSync98 } from "node:fs";
|
|
362615
362706
|
import { join as joinLocal } from "node:path";
|
|
362616
362707
|
import { posix as posix17 } from "node:path";
|
|
@@ -362854,7 +362945,7 @@ var init_transfer = __esm({
|
|
|
362854
362945
|
}
|
|
362855
362946
|
};
|
|
362856
362947
|
journalDir = () => joinLocal(vfsDataDir(), "transfers");
|
|
362857
|
-
journalFile = (op2, src2, destDir) => joinLocal(journalDir(),
|
|
362948
|
+
journalFile = (op2, src2, destDir) => joinLocal(journalDir(), createHash52("sha256").update(`${op2}
|
|
362858
362949
|
${src2}
|
|
362859
362950
|
${destDir}`).digest("hex").slice(0, 32) + ".json");
|
|
362860
362951
|
}
|
|
@@ -363308,7 +363399,7 @@ var init_ops = __esm({
|
|
|
363308
363399
|
});
|
|
363309
363400
|
|
|
363310
363401
|
// ../../packages/host-core/dist/vfs/bookmarks.js
|
|
363311
|
-
import { readFileSync as readFileSync141, writeFileSync as writeFileSync99, mkdirSync as mkdirSync108, renameSync as
|
|
363402
|
+
import { readFileSync as readFileSync141, writeFileSync as writeFileSync99, mkdirSync as mkdirSync108, renameSync as renameSync53, existsSync as existsSync94 } from "node:fs";
|
|
363312
363403
|
import { join as join189 } from "node:path";
|
|
363313
363404
|
import { randomUUID as randomUUID68 } from "node:crypto";
|
|
363314
363405
|
function readAll2() {
|
|
@@ -363325,7 +363416,7 @@ function writeAll(list7) {
|
|
|
363325
363416
|
mkdirSync108(dir2, { recursive: true, mode: 448 });
|
|
363326
363417
|
const tmp = `${file7()}.${process.pid}.tmp`;
|
|
363327
363418
|
writeFileSync99(tmp, JSON.stringify(list7, null, 2), { mode: 384 });
|
|
363328
|
-
|
|
363419
|
+
renameSync53(tmp, file7());
|
|
363329
363420
|
}
|
|
363330
363421
|
function onBookmarksChanged(fn) {
|
|
363331
363422
|
listeners4.add(fn);
|
|
@@ -363428,7 +363519,7 @@ var init_vfs = __esm({
|
|
|
363428
363519
|
|
|
363429
363520
|
// ../../packages/host-core/dist/fs-remote.js
|
|
363430
363521
|
import { access as access2, open as open14, readdir as readdir15, readFile as readFile34, realpath as realpath5, writeFile as writeFile25, mkdir as mkdir25, cp as cp2, rm as rm10, rename as renameAsync, stat as stat18 } from "node:fs/promises";
|
|
363431
|
-
import { mkdtempSync as mkdtempSync7, rmSync as rmSync48, readFileSync as readFileSync142, readdirSync as
|
|
363522
|
+
import { mkdtempSync as mkdtempSync7, rmSync as rmSync48, readFileSync as readFileSync142, readdirSync as readdirSync59, constants as fsConstants } from "node:fs";
|
|
363432
363523
|
import { homedir as homedir48, tmpdir as tmpdir17 } from "node:os";
|
|
363433
363524
|
import { basename as basename38, dirname as dirname77, join as join190, relative as relative24, resolve as resolve39, sep as sep31, isAbsolute as isAbsolute37 } from "node:path";
|
|
363434
363525
|
import { execFile as execFile24 } from "node:child_process";
|
|
@@ -363580,7 +363671,7 @@ async function renderThumbnailImpl(real4, maxPx) {
|
|
|
363580
363671
|
try {
|
|
363581
363672
|
dir2 = mkdtempSync7(join190(tmpdir17(), "fp-thumb-"));
|
|
363582
363673
|
await execFileAsync2("qlmanage", ["-t", "-s", String(maxPx), "-o", dir2, real4], { timeout: 1e4, killSignal: "SIGKILL" }).catch(() => void 0);
|
|
363583
|
-
const produced =
|
|
363674
|
+
const produced = readdirSync59(dir2).find((f3) => f3.toLowerCase().endsWith(".png"));
|
|
363584
363675
|
if (!produced)
|
|
363585
363676
|
return { error: "No thumbnail available." };
|
|
363586
363677
|
return { png: readFileSync142(join190(dir2, produced)).toString("base64") };
|
|
@@ -364583,7 +364674,7 @@ var init_fs_datachannel_host = __esm({
|
|
|
364583
364674
|
});
|
|
364584
364675
|
|
|
364585
364676
|
// ../../packages/host-core/dist/active-link/paths.js
|
|
364586
|
-
import { createHash as
|
|
364677
|
+
import { createHash as createHash53 } from "node:crypto";
|
|
364587
364678
|
import { realpathSync as realpathSync28 } from "node:fs";
|
|
364588
364679
|
import { join as join191, relative as relative25, sep as sep32 } from "node:path";
|
|
364589
364680
|
function activeLinkEnabled() {
|
|
@@ -364610,7 +364701,7 @@ function suggestLinkId(localRoot) {
|
|
|
364610
364701
|
canon2 = realpathSync28.native(localRoot);
|
|
364611
364702
|
} catch {
|
|
364612
364703
|
}
|
|
364613
|
-
return
|
|
364704
|
+
return createHash53("sha256").update(canon2).digest("hex").slice(0, 16);
|
|
364614
364705
|
}
|
|
364615
364706
|
function activeLinkRoot() {
|
|
364616
364707
|
return process.env.CCB_ACTIVE_LINK_DIR ?? tessPath("active-link");
|
|
@@ -385671,19 +385762,19 @@ var init_host_name = __esm({
|
|
|
385671
385762
|
});
|
|
385672
385763
|
|
|
385673
385764
|
// ../../packages/host-core/dist/active-link/blocks.js
|
|
385674
|
-
import { createHash as
|
|
385765
|
+
import { createHash as createHash54 } from "node:crypto";
|
|
385675
385766
|
import { createReadStream as createReadStream4 } from "node:fs";
|
|
385676
385767
|
import { open as open15, mkdir as mkdir27, rename as rename11, chmod as chmod4, utimes as utimes3, unlink as unlink6 } from "node:fs/promises";
|
|
385677
385768
|
import { dirname as dirname80 } from "node:path";
|
|
385678
385769
|
function hashBytes(buf) {
|
|
385679
|
-
return
|
|
385770
|
+
return createHash54("sha256").update(buf).digest("hex");
|
|
385680
385771
|
}
|
|
385681
385772
|
function hashString(s) {
|
|
385682
|
-
return
|
|
385773
|
+
return createHash54("sha256").update(s, "utf-8").digest("hex");
|
|
385683
385774
|
}
|
|
385684
385775
|
function hashFile2(abs) {
|
|
385685
385776
|
return new Promise((resolve57, reject) => {
|
|
385686
|
-
const h =
|
|
385777
|
+
const h = createHash54("sha256");
|
|
385687
385778
|
const rs = createReadStream4(abs);
|
|
385688
385779
|
rs.on("data", (d) => h.update(d));
|
|
385689
385780
|
rs.on("end", () => resolve57(h.digest("hex")));
|
|
@@ -385692,9 +385783,9 @@ function hashFile2(abs) {
|
|
|
385692
385783
|
}
|
|
385693
385784
|
function hashFileBlocks(abs) {
|
|
385694
385785
|
return new Promise((resolve57, reject) => {
|
|
385695
|
-
const whole =
|
|
385786
|
+
const whole = createHash54("sha256");
|
|
385696
385787
|
const blocks2 = [];
|
|
385697
|
-
let cur =
|
|
385788
|
+
let cur = createHash54("sha256");
|
|
385698
385789
|
let curLen = 0;
|
|
385699
385790
|
let size2 = 0;
|
|
385700
385791
|
const rs = createReadStream4(abs, { highWaterMark: 256 * 1024 });
|
|
@@ -385710,7 +385801,7 @@ function hashFileBlocks(abs) {
|
|
|
385710
385801
|
off += take;
|
|
385711
385802
|
if (curLen === CHUNK5) {
|
|
385712
385803
|
blocks2.push(cur.digest("hex"));
|
|
385713
|
-
cur =
|
|
385804
|
+
cur = createHash54("sha256");
|
|
385714
385805
|
curLen = 0;
|
|
385715
385806
|
}
|
|
385716
385807
|
}
|
|
@@ -385797,9 +385888,9 @@ var init_blocks = __esm({
|
|
|
385797
385888
|
stagingPath;
|
|
385798
385889
|
fh = null;
|
|
385799
385890
|
bytes = 0;
|
|
385800
|
-
whole =
|
|
385891
|
+
whole = createHash54("sha256");
|
|
385801
385892
|
blocks = [];
|
|
385802
|
-
cur =
|
|
385893
|
+
cur = createHash54("sha256");
|
|
385803
385894
|
curLen = 0;
|
|
385804
385895
|
constructor(stagingPath) {
|
|
385805
385896
|
this.stagingPath = stagingPath;
|
|
@@ -385824,7 +385915,7 @@ var init_blocks = __esm({
|
|
|
385824
385915
|
off += take;
|
|
385825
385916
|
if (this.curLen === CHUNK5) {
|
|
385826
385917
|
this.blocks.push(this.cur.digest("hex"));
|
|
385827
|
-
this.cur =
|
|
385918
|
+
this.cur = createHash54("sha256");
|
|
385828
385919
|
this.curLen = 0;
|
|
385829
385920
|
}
|
|
385830
385921
|
}
|
|
@@ -385966,7 +386057,7 @@ var init_reconcile2 = __esm({
|
|
|
385966
386057
|
});
|
|
385967
386058
|
|
|
385968
386059
|
// ../../packages/host-core/dist/active-link/manifest.js
|
|
385969
|
-
import { readFileSync as readFileSync144, writeFileSync as writeFileSync101, mkdirSync as mkdirSync110, existsSync as existsSync97, renameSync as
|
|
386060
|
+
import { readFileSync as readFileSync144, writeFileSync as writeFileSync101, mkdirSync as mkdirSync110, existsSync as existsSync97, renameSync as renameSync54 } from "node:fs";
|
|
385970
386061
|
import { join as join194 } from "node:path";
|
|
385971
386062
|
var LinkManifest;
|
|
385972
386063
|
var init_manifest2 = __esm({
|
|
@@ -386077,7 +386168,7 @@ var init_manifest2 = __esm({
|
|
|
386077
386168
|
};
|
|
386078
386169
|
const tmp = `${this.file()}.tmp`;
|
|
386079
386170
|
writeFileSync101(tmp, JSON.stringify(json4));
|
|
386080
|
-
|
|
386171
|
+
renameSync54(tmp, this.file());
|
|
386081
386172
|
this.dirty = false;
|
|
386082
386173
|
} catch {
|
|
386083
386174
|
}
|
|
@@ -386172,7 +386263,7 @@ var init_gitignore = __esm({
|
|
|
386172
386263
|
});
|
|
386173
386264
|
|
|
386174
386265
|
// ../../packages/host-core/dist/active-link/session.js
|
|
386175
|
-
import { createHash as
|
|
386266
|
+
import { createHash as createHash55 } from "node:crypto";
|
|
386176
386267
|
import { lstat as lstat7, readlink as readlink5, open as open16 } from "node:fs/promises";
|
|
386177
386268
|
var OutboundSender;
|
|
386178
386269
|
var init_session3 = __esm({
|
|
@@ -386271,7 +386362,7 @@ var init_session3 = __esm({
|
|
|
386271
386362
|
const size2 = st.size;
|
|
386272
386363
|
const mtimeMs = Math.floor(st.mtimeMs);
|
|
386273
386364
|
const mode = st.mode;
|
|
386274
|
-
const running3 =
|
|
386365
|
+
const running3 = createHash55("sha256");
|
|
386275
386366
|
let fh;
|
|
386276
386367
|
try {
|
|
386277
386368
|
fh = await open16(abs, "r");
|
|
@@ -388913,7 +389004,7 @@ var init_engine = __esm({
|
|
|
388913
389004
|
});
|
|
388914
389005
|
|
|
388915
389006
|
// ../../packages/host-core/dist/active-link/config.js
|
|
388916
|
-
import { readFileSync as readFileSync145, writeFileSync as writeFileSync102, mkdirSync as mkdirSync111, existsSync as existsSync99, renameSync as
|
|
389007
|
+
import { readFileSync as readFileSync145, writeFileSync as writeFileSync102, mkdirSync as mkdirSync111, existsSync as existsSync99, renameSync as renameSync55, watch as watch4 } from "node:fs";
|
|
388917
389008
|
import { join as join199 } from "node:path";
|
|
388918
389009
|
function configPath2() {
|
|
388919
389010
|
return join199(activeLinkRoot(), "links.json");
|
|
@@ -388935,7 +389026,7 @@ function writeAll2(links) {
|
|
|
388935
389026
|
mkdirSync111(dir2, { recursive: true });
|
|
388936
389027
|
const tmp = `${configPath2()}.tmp`;
|
|
388937
389028
|
writeFileSync102(tmp, JSON.stringify({ links }, null, 2));
|
|
388938
|
-
|
|
389029
|
+
renameSync55(tmp, configPath2());
|
|
388939
389030
|
} catch {
|
|
388940
389031
|
}
|
|
388941
389032
|
}
|
|
@@ -388973,7 +389064,7 @@ function writePending(pending6) {
|
|
|
388973
389064
|
mkdirSync111(dir2, { recursive: true });
|
|
388974
389065
|
const tmp = `${pendingPath()}.tmp`;
|
|
388975
389066
|
writeFileSync102(tmp, JSON.stringify({ pending: pending6 }, null, 2));
|
|
388976
|
-
|
|
389067
|
+
renameSync55(tmp, pendingPath());
|
|
388977
389068
|
} catch {
|
|
388978
389069
|
}
|
|
388979
389070
|
}
|
|
@@ -389178,10 +389269,10 @@ var init_grant_fence = __esm({
|
|
|
389178
389269
|
|
|
389179
389270
|
// ../../packages/host-core/dist/pty-reap.js
|
|
389180
389271
|
import { execFile as execFile26, execFileSync as execFileSync3 } from "node:child_process";
|
|
389181
|
-
import { readdirSync as
|
|
389272
|
+
import { readdirSync as readdirSync60, readFileSync as readFileSync146 } from "node:fs";
|
|
389182
389273
|
function readProcLinux() {
|
|
389183
389274
|
const rows2 = [];
|
|
389184
|
-
for (const name of
|
|
389275
|
+
for (const name of readdirSync60("/proc")) {
|
|
389185
389276
|
if (!/^\d+$/.test(name))
|
|
389186
389277
|
continue;
|
|
389187
389278
|
let stat28;
|
|
@@ -389980,7 +390071,7 @@ var init_pty_manager = __esm({
|
|
|
389980
390071
|
});
|
|
389981
390072
|
|
|
389982
390073
|
// ../../packages/host-core/dist/engines/store-relocate.js
|
|
389983
|
-
import { existsSync as existsSync101, mkdirSync as mkdirSync112, readdirSync as
|
|
390074
|
+
import { existsSync as existsSync101, mkdirSync as mkdirSync112, readdirSync as readdirSync61, renameSync as renameSync56 } from "node:fs";
|
|
389984
390075
|
import { dirname as dirname85, join as join201 } from "node:path";
|
|
389985
390076
|
function claudeRoots3() {
|
|
389986
390077
|
return [claudeProjectsDir(), tessPath("runner-home", "projects")];
|
|
@@ -389997,7 +390088,7 @@ function relocateClaude(oldCwd, newCwd) {
|
|
|
389997
390088
|
if (!existsSync101(src2) || existsSync101(dst))
|
|
389998
390089
|
continue;
|
|
389999
390090
|
mkdirSync112(dirname85(dst), { recursive: true });
|
|
390000
|
-
|
|
390091
|
+
renameSync56(src2, dst);
|
|
390001
390092
|
} catch {
|
|
390002
390093
|
}
|
|
390003
390094
|
}
|
|
@@ -390008,7 +390099,7 @@ async function relocateCodex(oldCwd, newCwd) {
|
|
|
390008
390099
|
for (const home2 of defaultCodexHomes()) {
|
|
390009
390100
|
let names3 = [];
|
|
390010
390101
|
try {
|
|
390011
|
-
names3 =
|
|
390102
|
+
names3 = readdirSync61(home2).filter((n2) => /^state.*\.sqlite$/.test(n2));
|
|
390012
390103
|
} catch {
|
|
390013
390104
|
continue;
|
|
390014
390105
|
}
|
|
@@ -390051,7 +390142,7 @@ function relocateTesseractMirror(oldCwd, newCwd) {
|
|
|
390051
390142
|
if (!existsSync101(from) || existsSync101(to))
|
|
390052
390143
|
return;
|
|
390053
390144
|
mkdirSync112(dirname85(to), { recursive: true });
|
|
390054
|
-
|
|
390145
|
+
renameSync56(from, to);
|
|
390055
390146
|
} catch {
|
|
390056
390147
|
}
|
|
390057
390148
|
}
|
|
@@ -390696,7 +390787,7 @@ __export(routines_exports, {
|
|
|
390696
390787
|
syncSeededRoutines: () => syncSeededRoutines,
|
|
390697
390788
|
taskSession: () => taskSession
|
|
390698
390789
|
});
|
|
390699
|
-
import { createHash as
|
|
390790
|
+
import { createHash as createHash56 } from "node:crypto";
|
|
390700
390791
|
import { join as join203 } from "node:path";
|
|
390701
390792
|
function namesCharter(prompt2, folder) {
|
|
390702
390793
|
return !!folder && charterPaths(folder).some((p) => prompt2.includes(p));
|
|
@@ -390713,7 +390804,7 @@ function routineSeed(folder, held3 = [], file8 = daemonTasksFile()) {
|
|
|
390713
390804
|
}));
|
|
390714
390805
|
}
|
|
390715
390806
|
function seedRoutineHash(r) {
|
|
390716
|
-
return
|
|
390807
|
+
return createHash56("sha256").update(JSON.stringify([r.cron.trim(), r.prompt, r.paused === true])).digest("hex").slice(0, 16);
|
|
390717
390808
|
}
|
|
390718
390809
|
function syncSeededRoutines(folder, routines, applied, file8 = daemonTasksFile(), now2 = Date.now()) {
|
|
390719
390810
|
const store2 = new CronStore({ file: file8 });
|
|
@@ -390841,7 +390932,7 @@ var init_routines = __esm({
|
|
|
390841
390932
|
});
|
|
390842
390933
|
|
|
390843
390934
|
// ../../packages/host-core/dist/assistant/person-board.js
|
|
390844
|
-
import { chmodSync as chmodSync16, mkdirSync as mkdirSync113, readFileSync as readFileSync148, renameSync as
|
|
390935
|
+
import { chmodSync as chmodSync16, mkdirSync as mkdirSync113, readFileSync as readFileSync148, renameSync as renameSync57, writeFileSync as writeFileSync103 } from "node:fs";
|
|
390845
390936
|
import { dirname as dirname86 } from "node:path";
|
|
390846
390937
|
import { randomUUID as randomUUID71 } from "node:crypto";
|
|
390847
390938
|
function oneLineOf(s, max) {
|
|
@@ -391087,7 +391178,7 @@ var init_person_board = __esm({
|
|
|
391087
391178
|
const tmp = `${file8}.${process.pid}.tmp`;
|
|
391088
391179
|
writeFileSync103(tmp, `${JSON.stringify({ version: 1, tasks: kept2 })}
|
|
391089
391180
|
`, { mode: 384 });
|
|
391090
|
-
|
|
391181
|
+
renameSync57(tmp, file8);
|
|
391091
391182
|
chmodSync16(file8, 384);
|
|
391092
391183
|
} catch {
|
|
391093
391184
|
}
|
|
@@ -392572,7 +392663,7 @@ __export(person_views_exports, {
|
|
|
392572
392663
|
personViews: () => personViews,
|
|
392573
392664
|
setPersonViews: () => setPersonViews
|
|
392574
392665
|
});
|
|
392575
|
-
import { closeSync as closeSync17, constants as constants7, fstatSync as fstatSync5, lstatSync as lstatSync10, openSync as openSync16, readdirSync as
|
|
392666
|
+
import { closeSync as closeSync17, constants as constants7, fstatSync as fstatSync5, lstatSync as lstatSync10, openSync as openSync16, readdirSync as readdirSync62, readSync as readSync10 } from "node:fs";
|
|
392576
392667
|
import { extname as extname11, join as join204, normalize as normalize7, sep as sep35 } from "node:path";
|
|
392577
392668
|
function madeFiles(folder) {
|
|
392578
392669
|
const out = /* @__PURE__ */ new Map();
|
|
@@ -392580,7 +392671,7 @@ function madeFiles(folder) {
|
|
|
392580
392671
|
const walk6 = (dir2, rel, depth) => {
|
|
392581
392672
|
let names3;
|
|
392582
392673
|
try {
|
|
392583
|
-
names3 =
|
|
392674
|
+
names3 = readdirSync62(dir2);
|
|
392584
392675
|
} catch {
|
|
392585
392676
|
return;
|
|
392586
392677
|
}
|
|
@@ -393842,7 +393933,7 @@ __export(person_exports, {
|
|
|
393842
393933
|
writeHelpersList: () => writeHelpersList,
|
|
393843
393934
|
writePersonCard: () => writePersonCard
|
|
393844
393935
|
});
|
|
393845
|
-
import { chmodSync as chmodSync17, existsSync as existsSync102, lchownSync as lchownSync5, lstatSync as lstatSync11, mkdirSync as mkdirSync114, readdirSync as
|
|
393936
|
+
import { chmodSync as chmodSync17, existsSync as existsSync102, lchownSync as lchownSync5, lstatSync as lstatSync11, mkdirSync as mkdirSync114, readdirSync as readdirSync63, readFileSync as readFileSync149, renameSync as renameSync58, rmSync as rmSync49, statSync as statSync77, writeFileSync as writeFileSync104 } from "node:fs";
|
|
393846
393937
|
import { dirname as dirname87, join as join205 } from "node:path";
|
|
393847
393938
|
function personCardFile() {
|
|
393848
393939
|
return join205(personRoot(), PERSON_CARD_FILE);
|
|
@@ -393880,7 +393971,7 @@ function writePersonCard(card, file8 = personCardFile()) {
|
|
|
393880
393971
|
mkdirSync114(dirname87(file8), { recursive: true, mode: 457 });
|
|
393881
393972
|
writeFileSync104(`${file8}.tmp`, `${JSON.stringify(card, null, 2)}
|
|
393882
393973
|
`, { mode: 420 });
|
|
393883
|
-
|
|
393974
|
+
renameSync58(`${file8}.tmp`, file8);
|
|
393884
393975
|
try {
|
|
393885
393976
|
chmodSync17(file8, 420);
|
|
393886
393977
|
} catch {
|
|
@@ -393929,7 +394020,7 @@ function writeHelpersList(list7, file8 = helpersListFile()) {
|
|
|
393929
394020
|
mkdirSync114(dirname87(file8), { recursive: true, mode: 448 });
|
|
393930
394021
|
writeFileSync104(`${file8}.tmp`, `${JSON.stringify(list7.map((h) => ({ folder: h.folder, id: h.id, seat: h.seat, ...h.name ? { name: h.name } : {} })), null, 2)}
|
|
393931
394022
|
`, { mode: 384 });
|
|
393932
|
-
|
|
394023
|
+
renameSync58(`${file8}.tmp`, file8);
|
|
393933
394024
|
forgetHelpersList();
|
|
393934
394025
|
}
|
|
393935
394026
|
function freeSeat(taken) {
|
|
@@ -394139,7 +394230,7 @@ async function stopUidProcesses(uid, procDir = "/proc", kill2 = (pid) => process
|
|
|
394139
394230
|
const pids = [];
|
|
394140
394231
|
let names3 = [];
|
|
394141
394232
|
try {
|
|
394142
|
-
names3 =
|
|
394233
|
+
names3 = readdirSync63(procDir);
|
|
394143
394234
|
} catch {
|
|
394144
394235
|
return seen.size;
|
|
394145
394236
|
}
|
|
@@ -394197,7 +394288,7 @@ async function removeHelper(helperId, deps6) {
|
|
|
394197
394288
|
const folderOf3 = deps6.folderOf ?? ((sid) => sessionJournal2().projectDirOf(sid));
|
|
394198
394289
|
const conversations2 = /* @__PURE__ */ new Set();
|
|
394199
394290
|
try {
|
|
394200
|
-
for (const n2 of
|
|
394291
|
+
for (const n2 of readdirSync63(join205(sessionsRoot2(), safeSegment2(sanitizeProjectDir2(h.folder)))))
|
|
394201
394292
|
conversations2.add(unsafeSegment3(n2));
|
|
394202
394293
|
} catch {
|
|
394203
394294
|
}
|
|
@@ -394270,7 +394361,7 @@ async function removeHelper(helperId, deps6) {
|
|
|
394270
394361
|
const u = seatFrameworkUser(h.seat);
|
|
394271
394362
|
if (u?.home && u.home.startsWith("/")) {
|
|
394272
394363
|
try {
|
|
394273
|
-
for (const n2 of
|
|
394364
|
+
for (const n2 of readdirSync63(u.home))
|
|
394274
394365
|
removeExactly(join205(u.home, n2));
|
|
394275
394366
|
handOver(u.home, { tree: false }, u);
|
|
394276
394367
|
chmodSync17(u.home, 1472);
|
|
@@ -395386,13 +395477,13 @@ var init_model = __esm({
|
|
|
395386
395477
|
});
|
|
395387
395478
|
|
|
395388
395479
|
// ../../packages/embed-core/dist/fetch.js
|
|
395389
|
-
import { createHash as
|
|
395390
|
-
import { createWriteStream as createWriteStream5, existsSync as existsSync103, mkdirSync as mkdirSync116, readFileSync as readFileSync151, renameSync as
|
|
395480
|
+
import { createHash as createHash57 } from "node:crypto";
|
|
395481
|
+
import { createWriteStream as createWriteStream5, existsSync as existsSync103, mkdirSync as mkdirSync116, readFileSync as readFileSync151, renameSync as renameSync59, rmSync as rmSync50, statSync as statSync78, writeFileSync as writeFileSync106 } from "node:fs";
|
|
395391
395482
|
import { dirname as dirname88 } from "node:path";
|
|
395392
395483
|
import { Readable as Readable14 } from "node:stream";
|
|
395393
395484
|
import { pipeline as pipeline4 } from "node:stream/promises";
|
|
395394
395485
|
async function sha256File(path15) {
|
|
395395
|
-
const h =
|
|
395486
|
+
const h = createHash57("sha256");
|
|
395396
395487
|
const { createReadStream: createReadStream10 } = await import("node:fs");
|
|
395397
395488
|
await pipeline4(createReadStream10(path15), async function* (src2) {
|
|
395398
395489
|
for await (const chunk of src2)
|
|
@@ -395431,7 +395522,7 @@ async function downloadVerified(url2, path15, f3, opts = {}, onBytes) {
|
|
|
395431
395522
|
const res = await (opts.fetchImpl ?? fetch)(url2, { signal: opts.signal, redirect: "follow" });
|
|
395432
395523
|
if (!res.ok || !res.body)
|
|
395433
395524
|
throw new Error(`HTTP ${res.status} for ${f3.asset}`);
|
|
395434
|
-
const hash3 =
|
|
395525
|
+
const hash3 = createHash57("sha256");
|
|
395435
395526
|
let size2 = 0;
|
|
395436
395527
|
try {
|
|
395437
395528
|
await pipeline4(Readable14.fromWeb(res.body), async function* (src2) {
|
|
@@ -395452,7 +395543,7 @@ async function downloadVerified(url2, path15, f3, opts = {}, onBytes) {
|
|
|
395452
395543
|
rmSync50(part, { force: true });
|
|
395453
395544
|
throw new Error(`${f3.asset}: got ${size2} bytes / sha256 ${digest2.slice(0, 12)}\u2026, expected ${f3.size} / ${f3.sha256.slice(0, 12)}\u2026`);
|
|
395454
395545
|
}
|
|
395455
|
-
|
|
395546
|
+
renameSync59(part, path15);
|
|
395456
395547
|
const st = statSync78(path15);
|
|
395457
395548
|
try {
|
|
395458
395549
|
writeFileSync106(markerPath(path15), `${f3.size}:${Math.round(st.mtimeMs)}:${f3.sha256}
|
|
@@ -398942,11 +399033,11 @@ ${ENCODE_SOURCE}
|
|
|
398942
399033
|
});
|
|
398943
399034
|
|
|
398944
399035
|
// ../../packages/embed-core/dist/vector-store.js
|
|
398945
|
-
import { createHash as
|
|
399036
|
+
import { createHash as createHash58 } from "node:crypto";
|
|
398946
399037
|
import { appendFileSync as appendFileSync8, mkdirSync as mkdirSync117, readFileSync as readFileSync153, statSync as statSync79 } from "node:fs";
|
|
398947
399038
|
import { dirname as dirname89, join as join209 } from "node:path";
|
|
398948
399039
|
function textKey(text45) {
|
|
398949
|
-
return
|
|
399040
|
+
return createHash58("sha256").update(text45).digest("hex").slice(0, KEY_BYTES * 2);
|
|
398950
399041
|
}
|
|
398951
399042
|
function encodeRecord(key7, vec, dims) {
|
|
398952
399043
|
const b = Buffer.alloc(KEY_BYTES + dims * 4);
|
|
@@ -399037,7 +399128,7 @@ var init_vector_store = __esm({
|
|
|
399037
399128
|
});
|
|
399038
399129
|
|
|
399039
399130
|
// ../../packages/embed-core/dist/vector-seed.js
|
|
399040
|
-
import { mkdirSync as mkdirSync118, readFileSync as readFileSync154, renameSync as
|
|
399131
|
+
import { mkdirSync as mkdirSync118, readFileSync as readFileSync154, renameSync as renameSync60, writeFileSync as writeFileSync107 } from "node:fs";
|
|
399041
399132
|
function readVectorSeed(file8, tag2, dims) {
|
|
399042
399133
|
let buf;
|
|
399043
399134
|
try {
|
|
@@ -400770,7 +400861,7 @@ var init_window = __esm({
|
|
|
400770
400861
|
});
|
|
400771
400862
|
|
|
400772
400863
|
// ../../packages/host-core/dist/violet-sessions/service.js
|
|
400773
|
-
import { createHash as
|
|
400864
|
+
import { createHash as createHash59, randomUUID as randomUUID74 } from "node:crypto";
|
|
400774
400865
|
import { lstat as lstat11, readFile as readFile36, readdir as readdir21 } from "node:fs/promises";
|
|
400775
400866
|
import { basename as basename43, isAbsolute as isAbsolute42, join as join213, normalize as normalize10 } from "node:path";
|
|
400776
400867
|
function surfaceFiles(m) {
|
|
@@ -401201,7 +401292,7 @@ function createVioletSessions(d) {
|
|
|
401201
401292
|
const paths = [...new Set([...t2.kept, ...turn.made, ...t2.made].map((p) => normalize10(p)))].filter((p) => inFolder2(u.folder, p));
|
|
401202
401293
|
const shown3 = [];
|
|
401203
401294
|
const sameOf = /* @__PURE__ */ new Map();
|
|
401204
|
-
const sameKey = (f3) => f3.bytes ?
|
|
401295
|
+
const sameKey = (f3) => f3.bytes ? createHash59("sha256").update(f3.bytes).digest("hex") : `${madeKind(f3.path)}:${f3.size}`;
|
|
401205
401296
|
if (paths.length) {
|
|
401206
401297
|
const read4 = await readAs(u, paths, { maxBytes: SAME_READ_MAX });
|
|
401207
401298
|
for (const f3 of read4) {
|
|
@@ -402367,9 +402458,9 @@ var init_pg_store = __esm({
|
|
|
402367
402458
|
});
|
|
402368
402459
|
|
|
402369
402460
|
// ../../packages/host-core/dist/memory/qdrant-client.js
|
|
402370
|
-
import { createHash as
|
|
402461
|
+
import { createHash as createHash60 } from "node:crypto";
|
|
402371
402462
|
function pointId(item, n2) {
|
|
402372
|
-
const h =
|
|
402463
|
+
const h = createHash60("sha1").update(`${item}#${n2}`).digest("hex");
|
|
402373
402464
|
return `${h.slice(0, 8)}-${h.slice(8, 12)}-5${h.slice(13, 16)}-${(parseInt(h[16], 16) & 3 | 8).toString(16)}${h.slice(17, 20)}-${h.slice(20, 32)}`;
|
|
402374
402465
|
}
|
|
402375
402466
|
var COLLECTION2, TENANT_FIELD, TENANT_PID, DIMS, INDEX_LAYOUT, RESCORE, SMALL, DENSE_SHARE, QdrantError, QdrantClient;
|
|
@@ -402666,12 +402757,12 @@ var init_qdrant_client = __esm({
|
|
|
402666
402757
|
});
|
|
402667
402758
|
|
|
402668
402759
|
// ../../packages/host-core/dist/memory/store.js
|
|
402669
|
-
import { createHash as
|
|
402670
|
-
import { appendFileSync as appendFileSync9, closeSync as closeSync18, createReadStream as createReadStream6, existsSync as existsSync106, mkdirSync as mkdirSync119, openSync as openSync17, readFileSync as readFileSync155, readSync as readSync11, renameSync as
|
|
402760
|
+
import { createHash as createHash61 } from "node:crypto";
|
|
402761
|
+
import { appendFileSync as appendFileSync9, closeSync as closeSync18, createReadStream as createReadStream6, existsSync as existsSync106, mkdirSync as mkdirSync119, openSync as openSync17, readFileSync as readFileSync155, readSync as readSync11, renameSync as renameSync61, statSync as statSync80, writeFileSync as writeFileSync108 } from "node:fs";
|
|
402671
402762
|
import { dirname as dirname90 } from "node:path";
|
|
402672
402763
|
import { createInterface as createInterface4 } from "node:readline";
|
|
402673
402764
|
function fingerprint2(...parts) {
|
|
402674
|
-
const h =
|
|
402765
|
+
const h = createHash61("sha1");
|
|
402675
402766
|
for (const p of parts)
|
|
402676
402767
|
h.update(typeof p === "string" || p == null ? p ?? "" : p.join("")).update("\0");
|
|
402677
402768
|
return h.digest("hex").slice(0, 16);
|
|
@@ -402775,7 +402866,7 @@ var init_store5 = __esm({
|
|
|
402775
402866
|
const tmp = `${this.path}.compact`;
|
|
402776
402867
|
writeFileSync108(tmp, recs.map((r) => `${JSON.stringify(r)}
|
|
402777
402868
|
`).join(""), { mode: 384 });
|
|
402778
|
-
|
|
402869
|
+
renameSync61(tmp, this.path);
|
|
402779
402870
|
this.live.clear();
|
|
402780
402871
|
let at2 = 0;
|
|
402781
402872
|
for (const r of recs) {
|
|
@@ -403088,7 +403179,7 @@ var init_writer = __esm({
|
|
|
403088
403179
|
});
|
|
403089
403180
|
|
|
403090
403181
|
// ../../packages/host-core/dist/memory/capture.js
|
|
403091
|
-
import { existsSync as existsSync107, mkdirSync as mkdirSync120, readFileSync as readFileSync156, readdirSync as
|
|
403182
|
+
import { existsSync as existsSync107, mkdirSync as mkdirSync120, readFileSync as readFileSync156, readdirSync as readdirSync64, statSync as statSync81, writeFileSync as writeFileSync109 } from "node:fs";
|
|
403092
403183
|
import { basename as basename45, dirname as dirname91, join as join214 } from "node:path";
|
|
403093
403184
|
function projectKeyOf(cwd, fallback) {
|
|
403094
403185
|
return cwd ? cwd.replace(/[^a-zA-Z0-9]/g, "-") : fallback;
|
|
@@ -403132,7 +403223,7 @@ function readNotes(roots3) {
|
|
|
403132
403223
|
};
|
|
403133
403224
|
const mdIn = (dir2) => {
|
|
403134
403225
|
try {
|
|
403135
|
-
return
|
|
403226
|
+
return readdirSync64(dir2).filter((f3) => f3.endsWith(".md") && f3 !== "MEMORY.md");
|
|
403136
403227
|
} catch {
|
|
403137
403228
|
return [];
|
|
403138
403229
|
}
|
|
@@ -403151,7 +403242,7 @@ function readNotes(roots3) {
|
|
|
403151
403242
|
}
|
|
403152
403243
|
function dirs2(dir2) {
|
|
403153
403244
|
try {
|
|
403154
|
-
return
|
|
403245
|
+
return readdirSync64(dir2, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name);
|
|
403155
403246
|
} catch {
|
|
403156
403247
|
return [];
|
|
403157
403248
|
}
|
|
@@ -418189,7 +418280,7 @@ var init_email = __esm({
|
|
|
418189
418280
|
|
|
418190
418281
|
// ../../packages/host-core/dist/routine-email-triggers.js
|
|
418191
418282
|
import { randomUUID as randomUUID77 } from "node:crypto";
|
|
418192
|
-
import { chmodSync as chmodSync19, mkdirSync as mkdirSync122, readFileSync as readFileSync158, renameSync as
|
|
418283
|
+
import { chmodSync as chmodSync19, mkdirSync as mkdirSync122, readFileSync as readFileSync158, renameSync as renameSync62, writeFileSync as writeFileSync110 } from "node:fs";
|
|
418193
418284
|
import { dirname as dirname93, join as join218 } from "node:path";
|
|
418194
418285
|
function emailMatches(filter, m) {
|
|
418195
418286
|
const has8 = (hay, needle) => !needle?.trim() || (hay ?? "").toLowerCase().includes(needle.trim().toLowerCase());
|
|
@@ -418213,7 +418304,7 @@ function createEmailTriggers(deps6) {
|
|
|
418213
418304
|
const tmp = `${file8}.${process.pid}.tmp`;
|
|
418214
418305
|
writeFileSync110(tmp, `${JSON.stringify({ version: 1, triggers: list7 }, null, 2)}
|
|
418215
418306
|
`, { mode: 384 });
|
|
418216
|
-
|
|
418307
|
+
renameSync62(tmp, file8);
|
|
418217
418308
|
try {
|
|
418218
418309
|
chmodSync19(file8, 384);
|
|
418219
418310
|
} catch {
|
|
@@ -425998,7 +426089,7 @@ var init_supervisor = __esm({
|
|
|
425998
426089
|
|
|
425999
426090
|
// ../../packages/host-core/dist/assistant/outreach.js
|
|
426000
426091
|
import { randomUUID as randomUUID81 } from "node:crypto";
|
|
426001
|
-
import { promises as fs25, readdirSync as
|
|
426092
|
+
import { promises as fs25, readdirSync as readdirSync65, readFileSync as readFileSync159 } from "node:fs";
|
|
426002
426093
|
import { join as join226 } from "node:path";
|
|
426003
426094
|
function wayOf(by) {
|
|
426004
426095
|
const b = by.trim().toLowerCase();
|
|
@@ -426073,7 +426164,7 @@ function createOutreach(deps6) {
|
|
|
426073
426164
|
return [];
|
|
426074
426165
|
let names3 = [];
|
|
426075
426166
|
try {
|
|
426076
|
-
names3 =
|
|
426167
|
+
names3 = readdirSync65(join226(folder, "outreach")).filter((n2) => n2.endsWith(".json"));
|
|
426077
426168
|
} catch {
|
|
426078
426169
|
}
|
|
426079
426170
|
let added = false;
|
|
@@ -426865,7 +426956,7 @@ var init_approvals = __esm({
|
|
|
426865
426956
|
|
|
426866
426957
|
// ../../packages/host-core/dist/assistant/host.js
|
|
426867
426958
|
import { randomBytes as randomBytes40 } from "node:crypto";
|
|
426868
|
-
import { promises as fs26, readdirSync as
|
|
426959
|
+
import { promises as fs26, readdirSync as readdirSync66, statSync as statSync83 } from "node:fs";
|
|
426869
426960
|
import { basename as basename57, join as join228 } from "node:path";
|
|
426870
426961
|
import { homedir as homedir51 } from "node:os";
|
|
426871
426962
|
function asData(text45) {
|
|
@@ -426887,7 +426978,7 @@ function briefsNow(folder) {
|
|
|
426887
426978
|
const walk6 = (dir2, depth) => {
|
|
426888
426979
|
let entries;
|
|
426889
426980
|
try {
|
|
426890
|
-
entries =
|
|
426981
|
+
entries = readdirSync66(dir2, { withFileTypes: true });
|
|
426891
426982
|
} catch {
|
|
426892
426983
|
return;
|
|
426893
426984
|
}
|
|
@@ -429015,7 +429106,7 @@ __export(schedule_mirror_exports, {
|
|
|
429015
429106
|
scheduleMirror: () => scheduleMirror,
|
|
429016
429107
|
setScheduleMirror: () => setScheduleMirror
|
|
429017
429108
|
});
|
|
429018
|
-
import { chmodSync as chmodSync20, mkdirSync as mkdirSync123, readFileSync as readFileSync160, renameSync as
|
|
429109
|
+
import { chmodSync as chmodSync20, mkdirSync as mkdirSync123, readFileSync as readFileSync160, renameSync as renameSync63, writeFileSync as writeFileSync111 } from "node:fs";
|
|
429019
429110
|
import { dirname as dirname95 } from "node:path";
|
|
429020
429111
|
function createScheduleMirror(deps6) {
|
|
429021
429112
|
const store2 = new CronStore({ file: deps6.tasksFile ?? daemonTasksFile() });
|
|
@@ -429035,7 +429126,7 @@ function createScheduleMirror(deps6) {
|
|
|
429035
429126
|
mkdirSync123(dirname95(file8), { recursive: true, mode: 448 });
|
|
429036
429127
|
const tmp = `${file8}.tmp`;
|
|
429037
429128
|
writeFileSync111(tmp, JSON.stringify(kept2), { mode: 384 });
|
|
429038
|
-
|
|
429129
|
+
renameSync63(tmp, file8);
|
|
429039
429130
|
chmodSync20(file8, 384);
|
|
429040
429131
|
} catch (e) {
|
|
429041
429132
|
deps6.log?.(`[schedules] could not keep what was taken in: ${e.message}`);
|
|
@@ -430749,7 +430840,7 @@ var init_calibration = __esm({
|
|
|
430749
430840
|
});
|
|
430750
430841
|
|
|
430751
430842
|
// ../../packages/host-core/dist/crew/claude-peer.js
|
|
430752
|
-
import { createHash as
|
|
430843
|
+
import { createHash as createHash62, randomUUID as randomUUID84 } from "node:crypto";
|
|
430753
430844
|
import { chmodSync as chmodSync21, readFileSync as readFileSync163, rmSync as rmSync53 } from "node:fs";
|
|
430754
430845
|
import { connect as connect3, createServer as createServer14 } from "node:net";
|
|
430755
430846
|
import { homedir as homedir52 } from "node:os";
|
|
@@ -430899,7 +430990,7 @@ var init_claude_peer = __esm({
|
|
|
430899
430990
|
/** The session's own token, from its key file — none when there is no such file (not needed on macOS/Linux). */
|
|
430900
430991
|
tokenOf(t2) {
|
|
430901
430992
|
const home2 = this.deps.home ?? homedir52();
|
|
430902
|
-
const hash3 =
|
|
430993
|
+
const hash3 = createHash62("sha256").update(t2.socketPath).digest("hex");
|
|
430903
430994
|
try {
|
|
430904
430995
|
const raw2 = JSON.parse(readFileSync163(join233(home2, ".claude", "sessions", `${t2.pid}.${hash3}.key`), "utf8"));
|
|
430905
430996
|
return typeof raw2.peerToken === "string" && /^[0-9a-f]{16,128}$/.test(raw2.peerToken) ? raw2.peerToken : void 0;
|
|
@@ -430927,8 +431018,8 @@ var init_claude_peer = __esm({
|
|
|
430927
431018
|
});
|
|
430928
431019
|
|
|
430929
431020
|
// ../../packages/host-core/dist/crew/external-claude.js
|
|
430930
|
-
import { createHash as
|
|
430931
|
-
import { readdirSync as
|
|
431021
|
+
import { createHash as createHash63 } from "node:crypto";
|
|
431022
|
+
import { readdirSync as readdirSync67, readFileSync as readFileSync164, realpathSync as realpathSync30, statSync as statSync84 } from "node:fs";
|
|
430932
431023
|
import { readdir as readdir23, readFile as readFile37, stat as stat24 } from "node:fs/promises";
|
|
430933
431024
|
import { homedir as homedir53 } from "node:os";
|
|
430934
431025
|
import { join as join234, relative as relative32, isAbsolute as isAbsolute43 } from "node:path";
|
|
@@ -430969,7 +431060,7 @@ function readRegistrySync(home2, reg) {
|
|
|
430969
431060
|
const dir2 = join234(home2, ".claude", "sessions");
|
|
430970
431061
|
let names3;
|
|
430971
431062
|
try {
|
|
430972
|
-
names3 =
|
|
431063
|
+
names3 = readdirSync67(dir2).filter(isRecord10);
|
|
430973
431064
|
} catch {
|
|
430974
431065
|
names3 = [];
|
|
430975
431066
|
}
|
|
@@ -431099,7 +431190,7 @@ function buildIndexSync(home2) {
|
|
|
431099
431190
|
const dirs3 = /* @__PURE__ */ new Map();
|
|
431100
431191
|
let sessions3 = [];
|
|
431101
431192
|
try {
|
|
431102
|
-
sessions3 =
|
|
431193
|
+
sessions3 = readdirSync67(dir2);
|
|
431103
431194
|
} catch {
|
|
431104
431195
|
}
|
|
431105
431196
|
const since = Date.now() - RECENT_MS;
|
|
@@ -431115,7 +431206,7 @@ function buildIndexSync(home2) {
|
|
|
431115
431206
|
continue;
|
|
431116
431207
|
let files = [];
|
|
431117
431208
|
try {
|
|
431118
|
-
files =
|
|
431209
|
+
files = readdirSync67(sdir);
|
|
431119
431210
|
} catch {
|
|
431120
431211
|
continue;
|
|
431121
431212
|
}
|
|
@@ -431176,7 +431267,7 @@ async function refreshClaudeHistory(home2 = homedir53()) {
|
|
|
431176
431267
|
await i.reading;
|
|
431177
431268
|
}
|
|
431178
431269
|
function claudeEditorsOf(absPath2, sinceMs = 0, home2 = homedir53()) {
|
|
431179
|
-
const h =
|
|
431270
|
+
const h = createHash63("sha256").update(absPath2).digest("hex").slice(0, 16);
|
|
431180
431271
|
const index = indexes.get(home2) ?? buildIndexSync(home2);
|
|
431181
431272
|
return (index.byHash.get(h) ?? []).filter((e) => e.at > sinceMs).sort((a, b) => b.at - a.at);
|
|
431182
431273
|
}
|
|
@@ -431455,7 +431546,7 @@ var init_messaging = __esm({
|
|
|
431455
431546
|
|
|
431456
431547
|
// ../../packages/host-core/dist/crew/project.js
|
|
431457
431548
|
import { execFile as execFile31 } from "node:child_process";
|
|
431458
|
-
import { createHash as
|
|
431549
|
+
import { createHash as createHash64 } from "node:crypto";
|
|
431459
431550
|
import { readFileSync as readFileSync165, realpathSync as realpathSync31, statSync as statSync85 } from "node:fs";
|
|
431460
431551
|
import { basename as basename59, dirname as dirname99, join as join235, resolve as resolve43 } from "node:path";
|
|
431461
431552
|
function git6(cwd, args, input, timeoutMs = 2e4) {
|
|
@@ -431525,7 +431616,7 @@ function gitDirOf(root) {
|
|
|
431525
431616
|
}
|
|
431526
431617
|
function crewDir(root) {
|
|
431527
431618
|
const name = basename59(root).replace(/[^\w.-]/g, "_") || "project";
|
|
431528
|
-
const hash3 =
|
|
431619
|
+
const hash3 = createHash64("sha1").update(resolve43(root)).digest("hex").slice(0, 10);
|
|
431529
431620
|
return join235(tesseractHome(), "projects", `${name}-${hash3}`, "crew");
|
|
431530
431621
|
}
|
|
431531
431622
|
async function catFiles(root, specs) {
|
|
@@ -432074,7 +432165,7 @@ var init_commit = __esm({
|
|
|
432074
432165
|
});
|
|
432075
432166
|
|
|
432076
432167
|
// ../../packages/host-core/dist/crew/runs.js
|
|
432077
|
-
import { mkdirSync as mkdirSync127, readdirSync as
|
|
432168
|
+
import { mkdirSync as mkdirSync127, readdirSync as readdirSync68, readFileSync as readFileSync166, renameSync as renameSync64, writeFileSync as writeFileSync113 } from "node:fs";
|
|
432078
432169
|
import { dirname as dirname100, join as join237 } from "node:path";
|
|
432079
432170
|
function isReady(step, steps) {
|
|
432080
432171
|
if (step.state !== "todo" || !step.after?.length)
|
|
@@ -432170,7 +432261,7 @@ var init_runs6 = __esm({
|
|
|
432170
432261
|
mkdirSync127(dirname100(f3), { recursive: true });
|
|
432171
432262
|
const tmp = `${f3}.${process.pid}.tmp`;
|
|
432172
432263
|
writeFileSync113(tmp, JSON.stringify(l, null, 1));
|
|
432173
|
-
|
|
432264
|
+
renameSync64(tmp, f3);
|
|
432174
432265
|
return l;
|
|
432175
432266
|
}
|
|
432176
432267
|
/** `who` takes step `id` — free, or already its own — and starts it. Why not, when it cannot. */
|
|
@@ -432195,7 +432286,7 @@ var init_runs6 = __esm({
|
|
|
432195
432286
|
/** Every plan kept here, by the session it is — the cited facts of each are checked when a source changes. */
|
|
432196
432287
|
all() {
|
|
432197
432288
|
try {
|
|
432198
|
-
return
|
|
432289
|
+
return readdirSync68(this.dir).filter((f3) => f3.endsWith(".json")).map((f3) => f3.slice(0, -".json".length));
|
|
432199
432290
|
} catch {
|
|
432200
432291
|
return [];
|
|
432201
432292
|
}
|
|
@@ -432260,7 +432351,7 @@ var init_runs6 = __esm({
|
|
|
432260
432351
|
});
|
|
432261
432352
|
|
|
432262
432353
|
// ../../packages/host-core/dist/crew/federation.js
|
|
432263
|
-
import { mkdirSync as mkdirSync128, readFileSync as readFileSync167, renameSync as
|
|
432354
|
+
import { mkdirSync as mkdirSync128, readFileSync as readFileSync167, renameSync as renameSync65, writeFileSync as writeFileSync114 } from "node:fs";
|
|
432264
432355
|
import { dirname as dirname101 } from "node:path";
|
|
432265
432356
|
function readOutbox(file8) {
|
|
432266
432357
|
if (!file8)
|
|
@@ -432347,7 +432438,7 @@ var init_federation2 = __esm({
|
|
|
432347
432438
|
try {
|
|
432348
432439
|
mkdirSync128(dirname101(file8), { recursive: true });
|
|
432349
432440
|
writeFileSync114(`${file8}.tmp`, JSON.stringify(this.outbox), { mode: 384 });
|
|
432350
|
-
|
|
432441
|
+
renameSync65(`${file8}.tmp`, file8);
|
|
432351
432442
|
} catch (e) {
|
|
432352
432443
|
this.log("[crew] the outbox could not be kept:", e.message);
|
|
432353
432444
|
}
|
|
@@ -432565,7 +432656,7 @@ var init_federation2 = __esm({
|
|
|
432565
432656
|
});
|
|
432566
432657
|
|
|
432567
432658
|
// ../../packages/host-core/dist/crew/leases.js
|
|
432568
|
-
import { mkdirSync as mkdirSync129, readFileSync as readFileSync168, renameSync as
|
|
432659
|
+
import { mkdirSync as mkdirSync129, readFileSync as readFileSync168, renameSync as renameSync66, writeFileSync as writeFileSync115 } from "node:fs";
|
|
432569
432660
|
import { randomUUID as randomUUID87 } from "node:crypto";
|
|
432570
432661
|
import { dirname as dirname102 } from "node:path";
|
|
432571
432662
|
function normScope(s) {
|
|
@@ -432770,7 +432861,7 @@ var init_leases = __esm({
|
|
|
432770
432861
|
mkdirSync129(dirname102(this.file), { recursive: true });
|
|
432771
432862
|
const tmp = `${this.file}.${process.pid}.tmp`;
|
|
432772
432863
|
writeFileSync115(tmp, JSON.stringify({ leases: this.leases }, null, 1));
|
|
432773
|
-
|
|
432864
|
+
renameSync66(tmp, this.file);
|
|
432774
432865
|
} catch {
|
|
432775
432866
|
}
|
|
432776
432867
|
}
|
|
@@ -447746,7 +447837,7 @@ print(json.dumps({'exports': exports, 'imports': imports}))
|
|
|
447746
447837
|
});
|
|
447747
447838
|
|
|
447748
447839
|
// ../../packages/host-core/dist/crew/workspace.js
|
|
447749
|
-
import { existsSync as existsSync113, readdirSync as
|
|
447840
|
+
import { existsSync as existsSync113, readdirSync as readdirSync69, readFileSync as readFileSync169, statSync as statSync86 } from "node:fs";
|
|
447750
447841
|
import { join as join240 } from "node:path";
|
|
447751
447842
|
function patternsOf(root) {
|
|
447752
447843
|
const top = json3(join240(root, "package.json"));
|
|
@@ -447841,7 +447932,7 @@ var init_workspace = __esm({
|
|
|
447841
447932
|
};
|
|
447842
447933
|
readdirSafe = (d) => {
|
|
447843
447934
|
try {
|
|
447844
|
-
return
|
|
447935
|
+
return readdirSync69(d);
|
|
447845
447936
|
} catch {
|
|
447846
447937
|
return [];
|
|
447847
447938
|
}
|
|
@@ -448578,7 +448669,7 @@ var init_tracker = __esm({
|
|
|
448578
448669
|
});
|
|
448579
448670
|
|
|
448580
448671
|
// ../../packages/host-core/dist/crew/watch.js
|
|
448581
|
-
import { createHash as
|
|
448672
|
+
import { createHash as createHash65 } from "node:crypto";
|
|
448582
448673
|
function commandOf2(input) {
|
|
448583
448674
|
if (!input || typeof input !== "object")
|
|
448584
448675
|
return void 0;
|
|
@@ -448643,7 +448734,7 @@ var init_watch2 = __esm({
|
|
|
448643
448734
|
if (ev.input === void 0 || call5.signed || !tool5)
|
|
448644
448735
|
return {};
|
|
448645
448736
|
call5.signed = true;
|
|
448646
|
-
const sig =
|
|
448737
|
+
const sig = createHash65("sha1").update(`${tool5}\0${stable(ev.input)}`).digest("hex");
|
|
448647
448738
|
s.repeats = s.lastSig === sig ? s.repeats + 1 : 1;
|
|
448648
448739
|
s.lastSig = sig;
|
|
448649
448740
|
if (SHELL_TOOLS2.has(tool5) || ev.kind === "execute") {
|
|
@@ -449178,7 +449269,7 @@ var init_install_assist_tools = __esm({
|
|
|
449178
449269
|
});
|
|
449179
449270
|
|
|
449180
449271
|
// ../../packages/host-core/dist/install-assist/executor.js
|
|
449181
|
-
import { copyFileSync as copyFileSync4, existsSync as existsSync114, mkdirSync as mkdirSync131, readdirSync as
|
|
449272
|
+
import { copyFileSync as copyFileSync4, existsSync as existsSync114, mkdirSync as mkdirSync131, readdirSync as readdirSync70, readFileSync as readFileSync171, statSync as statSync87, writeFileSync as writeFileSync117 } from "node:fs";
|
|
449182
449273
|
import { homedir as homedir55 } from "node:os";
|
|
449183
449274
|
import { dirname as dirname106, isAbsolute as isAbsolute45, join as join242, relative as relative34, resolve as resolve45, sep as sep36 } from "node:path";
|
|
449184
449275
|
function loginShell() {
|
|
@@ -449196,7 +449287,7 @@ function walk5(root, visit2) {
|
|
|
449196
449287
|
const { dir: dir2, depth } = stack2.pop();
|
|
449197
449288
|
let names3;
|
|
449198
449289
|
try {
|
|
449199
|
-
names3 =
|
|
449290
|
+
names3 = readdirSync70(dir2);
|
|
449200
449291
|
} catch {
|
|
449201
449292
|
continue;
|
|
449202
449293
|
}
|
|
@@ -449534,7 +449625,7 @@ var init_ports = __esm({
|
|
|
449534
449625
|
});
|
|
449535
449626
|
|
|
449536
449627
|
// ../../packages/host-core/dist/crew/cite.js
|
|
449537
|
-
import { createHash as
|
|
449628
|
+
import { createHash as createHash66 } from "node:crypto";
|
|
449538
449629
|
function parseSpec(spec) {
|
|
449539
449630
|
const s = spec.trim();
|
|
449540
449631
|
const hash3 = s.lastIndexOf("#");
|
|
@@ -449588,7 +449679,7 @@ var init_cite = __esm({
|
|
|
449588
449679
|
"use strict";
|
|
449589
449680
|
init_interfaces();
|
|
449590
449681
|
MAX_CITED = 4e3;
|
|
449591
|
-
sha = (s) =>
|
|
449682
|
+
sha = (s) => createHash66("sha256").update(s).digest("hex");
|
|
449592
449683
|
}
|
|
449593
449684
|
});
|
|
449594
449685
|
|
|
@@ -449961,7 +450052,7 @@ var init_trace = __esm({
|
|
|
449961
450052
|
});
|
|
449962
450053
|
|
|
449963
450054
|
// ../../packages/host-core/dist/crew/tree.js
|
|
449964
|
-
import { mkdirSync as mkdirSync132, readFileSync as readFileSync172, renameSync as
|
|
450055
|
+
import { mkdirSync as mkdirSync132, readFileSync as readFileSync172, renameSync as renameSync67, writeFileSync as writeFileSync118 } from "node:fs";
|
|
449965
450056
|
import { dirname as dirname107 } from "node:path";
|
|
449966
450057
|
var MAX_RUNNING_PER_TREE, MAX_NODES_PER_TREE, ROLES2, CrewTree;
|
|
449967
450058
|
var init_tree = __esm({
|
|
@@ -450122,7 +450213,7 @@ var init_tree = __esm({
|
|
|
450122
450213
|
mkdirSync132(dirname107(this.file), { recursive: true });
|
|
450123
450214
|
const tmp = `${this.file}.${process.pid}.tmp`;
|
|
450124
450215
|
writeFileSync118(tmp, JSON.stringify({ nodes: [...this.nodes.values()], grants: Object.fromEntries(this.grants) }, null, 1));
|
|
450125
|
-
|
|
450216
|
+
renameSync67(tmp, this.file);
|
|
450126
450217
|
} catch {
|
|
450127
450218
|
}
|
|
450128
450219
|
}
|
|
@@ -450131,8 +450222,8 @@ var init_tree = __esm({
|
|
|
450131
450222
|
});
|
|
450132
450223
|
|
|
450133
450224
|
// ../../packages/host-core/dist/crew/organization.js
|
|
450134
|
-
import { createHash as
|
|
450135
|
-
import { mkdirSync as mkdirSync133, readFileSync as readFileSync173, renameSync as
|
|
450225
|
+
import { createHash as createHash67, randomUUID as randomUUID88 } from "node:crypto";
|
|
450226
|
+
import { mkdirSync as mkdirSync133, readFileSync as readFileSync173, renameSync as renameSync68, writeFileSync as writeFileSync119 } from "node:fs";
|
|
450136
450227
|
import { dirname as dirname108, isAbsolute as isAbsolute46, relative as relative35, resolve as resolve46 } from "node:path";
|
|
450137
450228
|
import { realpathSync as realpathSync33 } from "node:fs";
|
|
450138
450229
|
var active5, scopeValid, withinScope, normalize16, finiteMoney, CrewOrganizations;
|
|
@@ -450171,7 +450262,7 @@ var init_organization3 = __esm({
|
|
|
450171
450262
|
mkdirSync133(dirname108(this.file), { recursive: true });
|
|
450172
450263
|
const tmp = `${this.file}.${process.pid}.${randomUUID88()}.tmp`;
|
|
450173
450264
|
writeFileSync119(tmp, JSON.stringify({ version: 1, runs: this.runs }), { mode: 384 });
|
|
450174
|
-
|
|
450265
|
+
renameSync68(tmp, this.file);
|
|
450175
450266
|
return structuredClone(result);
|
|
450176
450267
|
} catch (error51) {
|
|
450177
450268
|
this.runs = before;
|
|
@@ -450614,7 +450705,7 @@ var init_organization3 = __esm({
|
|
|
450614
450705
|
const rel = relative35(root, file8);
|
|
450615
450706
|
if (isAbsolute46(artifact) || rel === ".." || rel.startsWith("../") || isAbsolute46(rel))
|
|
450616
450707
|
throw new Error("Artifact is outside this project");
|
|
450617
|
-
const actual = `sha256:${
|
|
450708
|
+
const actual = `sha256:${createHash67("sha256").update(readFileSync173(file8)).digest("hex")}`;
|
|
450618
450709
|
if (actual !== version4)
|
|
450619
450710
|
throw new Error("Artifact changed since this version; publish the new version and repeat verification");
|
|
450620
450711
|
}
|
|
@@ -450713,7 +450804,7 @@ __export(crew_exports, {
|
|
|
450713
450804
|
tapCrew: () => tapCrew
|
|
450714
450805
|
});
|
|
450715
450806
|
import { spawn as spawnProcess, spawnSync as spawnSync8 } from "node:child_process";
|
|
450716
|
-
import { cpSync as cpSync6, existsSync as existsSync115, mkdirSync as mkdirSync134, mkdtempSync as mkdtempSync10, readFileSync as readFileSync174, realpathSync as realpathSync34, renameSync as
|
|
450807
|
+
import { cpSync as cpSync6, existsSync as existsSync115, mkdirSync as mkdirSync134, mkdtempSync as mkdtempSync10, readFileSync as readFileSync174, realpathSync as realpathSync34, renameSync as renameSync69, rmdirSync as rmdirSync2, rmSync as rmSync56, statSync as statSync88, watch as watch5, writeFileSync as writeFileSync120 } from "node:fs";
|
|
450717
450808
|
import { readFile as readFile38 } from "node:fs/promises";
|
|
450718
450809
|
import { homedir as homedir56, tmpdir as tmpdir21 } from "node:os";
|
|
450719
450810
|
import { basename as basename60, dirname as dirname109, isAbsolute as isAbsolute47, join as join243, relative as relative36, resolve as resolve47, sep as sep37 } from "node:path";
|
|
@@ -452526,7 +452617,7 @@ ${imp.mine.map(line4).join("\n")}
|
|
|
452526
452617
|
try {
|
|
452527
452618
|
mkdirSync134(dirname109(file8), { recursive: true });
|
|
452528
452619
|
writeFileSync120(`${file8}.tmp`, ledgerMarkdown(l, sid === BOARD ? "The project's board" : `Plan \u2014 the run of ${this.ownerName(root, sid)}`));
|
|
452529
|
-
|
|
452620
|
+
renameSync69(`${file8}.tmp`, file8);
|
|
452530
452621
|
} catch (e) {
|
|
452531
452622
|
this.log("[crew] the plan could not be kept in", l.keep, "\u2014", e.message);
|
|
452532
452623
|
}
|
|
@@ -453749,7 +453840,7 @@ The decision went to ${to.map((n2) => handleOf(n2.id)).join(", ")}.` : "";
|
|
|
453749
453840
|
mkdirSync134(dirname109(file8), { recursive: true });
|
|
453750
453841
|
writeFileSync120(`${file8}.tmp`, `${md3}
|
|
453751
453842
|
`);
|
|
453752
|
-
|
|
453843
|
+
renameSync69(`${file8}.tmp`, file8);
|
|
453753
453844
|
return `${md3}
|
|
453754
453845
|
|
|
453755
453846
|
(Kept in ${rel} \u2014 add what only the session knows, and commit it with the work.)`;
|
|
@@ -460264,8 +460355,8 @@ var init_assist_shell = __esm({
|
|
|
460264
460355
|
|
|
460265
460356
|
// ../../packages/host-core/dist/remote-install/wsl.js
|
|
460266
460357
|
import { spawn as spawn24 } from "node:child_process";
|
|
460267
|
-
import { createHash as
|
|
460268
|
-
import { createReadStream as createReadStream7, createWriteStream as createWriteStream6, existsSync as existsSync116, mkdirSync as mkdirSync136, renameSync as
|
|
460358
|
+
import { createHash as createHash68 } from "node:crypto";
|
|
460359
|
+
import { createReadStream as createReadStream7, createWriteStream as createWriteStream6, existsSync as existsSync116, mkdirSync as mkdirSync136, renameSync as renameSync70, rmSync as rmSync57, statSync as statSync89 } from "node:fs";
|
|
460269
460360
|
import { basename as basename63, join as join246 } from "node:path";
|
|
460270
460361
|
import { Readable as Readable15, Transform as Transform3 } from "node:stream";
|
|
460271
460362
|
import { pipeline as pipeline5 } from "node:stream/promises";
|
|
@@ -460448,7 +460539,7 @@ async function hashFile3(hash3, path15) {
|
|
|
460448
460539
|
}
|
|
460449
460540
|
async function downloadImage(image3, dir2, opts = {}) {
|
|
460450
460541
|
const file8 = join246(dir2, basename63(new URL(image3.url).pathname) || "distribution.wsl");
|
|
460451
|
-
if (existsSync116(file8) && (await hashFile3(
|
|
460542
|
+
if (existsSync116(file8) && (await hashFile3(createHash68("sha256"), file8)).digest("hex") === image3.sha256)
|
|
460452
460543
|
return file8;
|
|
460453
460544
|
mkdirSync136(dir2, { recursive: true });
|
|
460454
460545
|
const part = `${file8}.part`;
|
|
@@ -460460,7 +460551,7 @@ async function downloadImage(image3, dir2, opts = {}) {
|
|
|
460460
460551
|
if (!res.ok || !res.body)
|
|
460461
460552
|
throw new Error(`The download did not start (HTTP ${res.status}).`);
|
|
460462
460553
|
const resumed = have > 0 && res.status === 206;
|
|
460463
|
-
const hash3 = resumed ? await hashFile3(
|
|
460554
|
+
const hash3 = resumed ? await hashFile3(createHash68("sha256"), part) : createHash68("sha256");
|
|
460464
460555
|
let received = resumed ? have : 0;
|
|
460465
460556
|
const length = Number(res.headers.get("content-length"));
|
|
460466
460557
|
const total = Number.isFinite(length) && length > 0 ? received + length : null;
|
|
@@ -460487,7 +460578,7 @@ async function downloadImage(image3, dir2, opts = {}) {
|
|
|
460487
460578
|
rmSync57(part, { force: true });
|
|
460488
460579
|
throw new Error("The download arrived damaged \u2014 its checksum is not the one Microsoft lists. Try again.");
|
|
460489
460580
|
}
|
|
460490
|
-
|
|
460581
|
+
renameSync70(part, file8);
|
|
460491
460582
|
return file8;
|
|
460492
460583
|
}
|
|
460493
460584
|
function keeperArgs(distro) {
|
|
@@ -467153,7 +467244,7 @@ var init_dist29 = __esm({
|
|
|
467153
467244
|
});
|
|
467154
467245
|
|
|
467155
467246
|
// ../../packages/host-core/dist/mesh/config.js
|
|
467156
|
-
import { chmodSync as chmodSync22, chownSync as chownSync3, existsSync as existsSync118, mkdirSync as mkdirSync137, readdirSync as
|
|
467247
|
+
import { chmodSync as chmodSync22, chownSync as chownSync3, existsSync as existsSync118, mkdirSync as mkdirSync137, readdirSync as readdirSync71, readFileSync as readFileSync177, renameSync as renameSync71, rmSync as rmSync59, statSync as statSync90, writeFileSync as writeFileSync123 } from "node:fs";
|
|
467157
467248
|
import { dirname as dirname110, join as join251 } from "node:path";
|
|
467158
467249
|
function meshDir() {
|
|
467159
467250
|
return join251(daemonDir2(), "mesh");
|
|
@@ -467203,7 +467294,7 @@ function migrateSingleMesh() {
|
|
|
467203
467294
|
for (const f3 of Object.values(FILES)) {
|
|
467204
467295
|
const from = join251(meshDir(), f3);
|
|
467205
467296
|
if (existsSync118(from))
|
|
467206
|
-
|
|
467297
|
+
renameSync71(from, join251(dest, f3));
|
|
467207
467298
|
}
|
|
467208
467299
|
const key7 = join251(dest, FILES.key);
|
|
467209
467300
|
if (existsSync118(key7))
|
|
@@ -467217,7 +467308,7 @@ function listMeshIds() {
|
|
|
467217
467308
|
migrateSingleMesh();
|
|
467218
467309
|
let names3;
|
|
467219
467310
|
try {
|
|
467220
|
-
names3 =
|
|
467311
|
+
names3 = readdirSync71(meshesDir(), { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name);
|
|
467221
467312
|
} catch {
|
|
467222
467313
|
return [];
|
|
467223
467314
|
}
|
|
@@ -467442,7 +467533,7 @@ var init_config3 = __esm({
|
|
|
467442
467533
|
});
|
|
467443
467534
|
|
|
467444
467535
|
// ../../packages/host-core/dist/mesh/mesh-instance.js
|
|
467445
|
-
import { readdirSync as
|
|
467536
|
+
import { readdirSync as readdirSync72 } from "node:fs";
|
|
467446
467537
|
import { win32 as win326 } from "node:path";
|
|
467447
467538
|
function instanceNameError(name) {
|
|
467448
467539
|
if (!name)
|
|
@@ -467495,7 +467586,7 @@ function listMeshInstances(platform9 = process.platform, readDirs = dirsIn) {
|
|
|
467495
467586
|
return names3.filter((n2) => instanceNameError(n2) === null).sort();
|
|
467496
467587
|
}
|
|
467497
467588
|
function dirsIn(root) {
|
|
467498
|
-
return
|
|
467589
|
+
return readdirSync72(root, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name);
|
|
467499
467590
|
}
|
|
467500
467591
|
var MAX_INSTANCE_NAME, MESH_MANAGERS_GROUP, MESH_CONTROL_USER, MESH_EXEC_DIR, MESH_EXEC, TAILNET_WORKER;
|
|
467501
467592
|
var init_mesh_instance = __esm({
|
|
@@ -467512,7 +467603,7 @@ var init_mesh_instance = __esm({
|
|
|
467512
467603
|
|
|
467513
467604
|
// ../../packages/host-core/dist/mesh/netd-client.js
|
|
467514
467605
|
import { AsyncLocalStorage as AsyncLocalStorage7 } from "node:async_hooks";
|
|
467515
|
-
import { existsSync as existsSync119, readdirSync as
|
|
467606
|
+
import { existsSync as existsSync119, readdirSync as readdirSync73 } from "node:fs";
|
|
467516
467607
|
import { connect as connect5, isIP as isIP3 } from "node:net";
|
|
467517
467608
|
import { platform as platform3 } from "node:process";
|
|
467518
467609
|
function netdEndpoint() {
|
|
@@ -467528,7 +467619,7 @@ function netdListening() {
|
|
|
467528
467619
|
return existsSync119(ep);
|
|
467529
467620
|
try {
|
|
467530
467621
|
const name = ep.replace(/^\\\\\.\\pipe\\/, "");
|
|
467531
|
-
return
|
|
467622
|
+
return readdirSync73("\\\\.\\pipe\\").includes(name);
|
|
467532
467623
|
} catch {
|
|
467533
467624
|
return false;
|
|
467534
467625
|
}
|
|
@@ -468421,7 +468512,7 @@ var init_reissue = __esm({
|
|
|
468421
468512
|
});
|
|
468422
468513
|
|
|
468423
468514
|
// ../../packages/host-core/dist/mesh/wireguard-psk.js
|
|
468424
|
-
import { createCipheriv, createDecipheriv, createHash as
|
|
468515
|
+
import { createCipheriv, createDecipheriv, createHash as createHash69, createPrivateKey as createPrivateKey2, createPublicKey, diffieHellman, randomBytes as randomBytes45 } from "node:crypto";
|
|
468425
468516
|
function check32(name, b) {
|
|
468426
468517
|
if (b.length !== 32)
|
|
468427
468518
|
throw new Error(`${name} must be 32 bytes`);
|
|
@@ -468500,7 +468591,7 @@ var init_wireguard_psk = __esm({
|
|
|
468500
468591
|
priv = (raw2) => createPrivateKey2({ key: Buffer.concat([PKCS8, raw2]), format: "der", type: "pkcs8" });
|
|
468501
468592
|
pub = (raw2) => createPublicKey({ key: Buffer.concat([SPKI, raw2]), format: "der", type: "spki" });
|
|
468502
468593
|
rawPublic = (raw2) => Buffer.from(createPublicKey(priv(raw2)).export({ format: "der", type: "spki" })).subarray(SPKI.length);
|
|
468503
|
-
key5 = (s, ephemeralPub, gateway) =>
|
|
468594
|
+
key5 = (s, ephemeralPub, gateway) => createHash69("blake2s256").update(LABEL3).update(s).update(ephemeralPub).update(gateway).digest();
|
|
468504
468595
|
}
|
|
468505
468596
|
});
|
|
468506
468597
|
|
|
@@ -469610,7 +469701,7 @@ var init_manager4 = __esm({
|
|
|
469610
469701
|
});
|
|
469611
469702
|
|
|
469612
469703
|
// ../../packages/host-core/dist/mesh/route-sync.js
|
|
469613
|
-
import { createHash as
|
|
469704
|
+
import { createHash as createHash70 } from "node:crypto";
|
|
469614
469705
|
async function syncRoutes(running3, memo2, now2 = Date.now) {
|
|
469615
469706
|
const out = { up: [], added: [], down: [], failed: [], helperAbsent: false };
|
|
469616
469707
|
if (!await netdAvailable()) {
|
|
@@ -469691,7 +469782,7 @@ async function syncRoutes(running3, memo2, now2 = Date.now) {
|
|
|
469691
469782
|
return out;
|
|
469692
469783
|
}
|
|
469693
469784
|
function upFingerprint(args) {
|
|
469694
|
-
const h =
|
|
469785
|
+
const h = createHash70("sha256");
|
|
469695
469786
|
const part = (b) => {
|
|
469696
469787
|
const bytes3 = typeof b === "string" ? Buffer.from(b) : Buffer.from(b ?? new Uint8Array());
|
|
469697
469788
|
h.update(`${bytes3.length}:`);
|
|
@@ -470697,7 +470788,7 @@ var init_restart_policy = __esm({
|
|
|
470697
470788
|
});
|
|
470698
470789
|
|
|
470699
470790
|
// ../../packages/host-core/dist/net-service/self-update.js
|
|
470700
|
-
import { createHash as
|
|
470791
|
+
import { createHash as createHash71 } from "node:crypto";
|
|
470701
470792
|
import { readFileSync as readFileSync179, statSync as statSync91 } from "node:fs";
|
|
470702
470793
|
function shippedSeq(sigText) {
|
|
470703
470794
|
let o;
|
|
@@ -470798,7 +470889,7 @@ function cachedDigest(path15) {
|
|
|
470798
470889
|
const seen = digests.get(path15);
|
|
470799
470890
|
if (seen && seen.size === st.size && seen.mtimeMs === st.mtimeMs)
|
|
470800
470891
|
return seen.sum;
|
|
470801
|
-
const sum =
|
|
470892
|
+
const sum = createHash71("sha256").update(readFileSync179(path15)).digest("hex");
|
|
470802
470893
|
digests.set(path15, { size: st.size, mtimeMs: st.mtimeMs, sum });
|
|
470803
470894
|
return sum;
|
|
470804
470895
|
} catch {
|
|
@@ -470886,7 +470977,7 @@ var init_self_update = __esm({
|
|
|
470886
470977
|
});
|
|
470887
470978
|
|
|
470888
470979
|
// ../../packages/host-core/dist/net-service/instance-update.js
|
|
470889
|
-
import { createHash as
|
|
470980
|
+
import { createHash as createHash72 } from "node:crypto";
|
|
470890
470981
|
import { mkdtempSync as mkdtempSync11, rmSync as rmSync60, writeFileSync as writeFileSync125 } from "node:fs";
|
|
470891
470982
|
import { tmpdir as tmpdir22 } from "node:os";
|
|
470892
470983
|
import { join as join253 } from "node:path";
|
|
@@ -471017,7 +471108,7 @@ async function fetchReleaseHelper(fetchImpl = fetch, target2 = { platform: proce
|
|
|
471017
471108
|
continue;
|
|
471018
471109
|
throw e;
|
|
471019
471110
|
}
|
|
471020
|
-
const got =
|
|
471111
|
+
const got = createHash72("sha256").update(bytes3).digest("hex");
|
|
471021
471112
|
if (!sum || got !== sum)
|
|
471022
471113
|
return { ok: false, detail: `${asset} from ${tag2} does not match its published checksum` };
|
|
471023
471114
|
const dir2 = mkdtempSync11(join253(tmpdir22(), "tesseract-netd-update-"));
|
|
@@ -471030,7 +471121,7 @@ async function fetchReleaseHelper(fetchImpl = fetch, target2 = { platform: proce
|
|
|
471030
471121
|
const wBytes = new Uint8Array(await (await get(`${base2}/${workerAsset}`)).arrayBuffer());
|
|
471031
471122
|
const wSum = (await (await get(`${base2}/${workerAsset}.sha256`)).text()).trim().split(/\s+/)[0]?.toLowerCase();
|
|
471032
471123
|
const wSig = await (await get(`${base2}/${workerAsset}.sig`)).text();
|
|
471033
|
-
if (wSum &&
|
|
471124
|
+
if (wSum && createHash72("sha256").update(wBytes).digest("hex") === wSum) {
|
|
471034
471125
|
const wName = target2.platform === "win32" ? "tesseract-tailnet.exe" : "tesseract-tailnet";
|
|
471035
471126
|
writeFileSync125(join253(dir2, wName), wBytes, { mode: 384 });
|
|
471036
471127
|
writeFileSync125(join253(dir2, `${wName}.sig`), wSig, { mode: 384 });
|
|
@@ -472960,7 +473051,7 @@ var init_local_server = __esm({
|
|
|
472960
473051
|
|
|
472961
473052
|
// ../../packages/host-core/dist/stray-sweep.js
|
|
472962
473053
|
import { execFile as execFile36 } from "node:child_process";
|
|
472963
|
-
import { readdirSync as
|
|
473054
|
+
import { readdirSync as readdirSync74 } from "node:fs";
|
|
472964
473055
|
function sweepStrays(log16) {
|
|
472965
473056
|
const bin = reaperBinaryPath();
|
|
472966
473057
|
if (!bin)
|
|
@@ -472996,7 +473087,7 @@ function goneLedgers(dir2 = spawnLedgerDir(), pid) {
|
|
|
472996
473087
|
return [];
|
|
472997
473088
|
let names3;
|
|
472998
473089
|
try {
|
|
472999
|
-
names3 =
|
|
473090
|
+
names3 = readdirSync74(dir2);
|
|
473000
473091
|
} catch {
|
|
473001
473092
|
return [];
|
|
473002
473093
|
}
|
|
@@ -473238,7 +473329,7 @@ var init_catalog_search_host = __esm({
|
|
|
473238
473329
|
});
|
|
473239
473330
|
|
|
473240
473331
|
// ../../packages/shared/dist/model-spec-store.js
|
|
473241
|
-
import { mkdirSync as mkdirSync140, readFileSync as readFileSync180, renameSync as
|
|
473332
|
+
import { mkdirSync as mkdirSync140, readFileSync as readFileSync180, renameSync as renameSync72, writeFileSync as writeFileSync127 } from "node:fs";
|
|
473242
473333
|
import { dirname as dirname114 } from "node:path";
|
|
473243
473334
|
function readStamp() {
|
|
473244
473335
|
try {
|
|
@@ -473270,7 +473361,7 @@ function writeStamp(cached8) {
|
|
|
473270
473361
|
try {
|
|
473271
473362
|
const tmp = `${modelSpecsStampPath()}.tmp`;
|
|
473272
473363
|
writeFileSync127(tmp, JSON.stringify({ fetchedAt: memory.fetchedAt, rev: memory.payload.rev, ...memory.appVersion ? { appVersion: memory.appVersion } : {} }), { mode: 384 });
|
|
473273
|
-
|
|
473364
|
+
renameSync72(tmp, modelSpecsStampPath());
|
|
473274
473365
|
} catch {
|
|
473275
473366
|
}
|
|
473276
473367
|
}
|
|
@@ -473280,7 +473371,7 @@ function writeCache2(payload, appVersion) {
|
|
|
473280
473371
|
mkdirSync140(dirname114(modelSpecsCachePath()), { recursive: true });
|
|
473281
473372
|
const tmp = `${modelSpecsCachePath()}.tmp`;
|
|
473282
473373
|
writeFileSync127(tmp, JSON.stringify(memory), { mode: 384 });
|
|
473283
|
-
|
|
473374
|
+
renameSync72(tmp, modelSpecsCachePath());
|
|
473284
473375
|
} catch {
|
|
473285
473376
|
}
|
|
473286
473377
|
}
|
|
@@ -473389,7 +473480,7 @@ var init_model_records_host = __esm({
|
|
|
473389
473480
|
|
|
473390
473481
|
// ../../packages/shared/dist/daemon-registry.js
|
|
473391
473482
|
import { execFileSync as execFileSync5 } from "node:child_process";
|
|
473392
|
-
import { existsSync as existsSync123, mkdirSync as mkdirSync141, readdirSync as
|
|
473483
|
+
import { existsSync as existsSync123, mkdirSync as mkdirSync141, readdirSync as readdirSync75, readFileSync as readFileSync181, readlinkSync as readlinkSync3, unlinkSync as unlinkSync11, writeFileSync as writeFileSync128 } from "node:fs";
|
|
473393
473484
|
import { join as join256 } from "node:path";
|
|
473394
473485
|
function isPidAlive2(pid) {
|
|
473395
473486
|
try {
|
|
@@ -473482,7 +473573,7 @@ function readRecord5(pid) {
|
|
|
473482
473573
|
}
|
|
473483
473574
|
function allRegisteredPids() {
|
|
473484
473575
|
try {
|
|
473485
|
-
return
|
|
473576
|
+
return readdirSync75(registryDir()).filter((f3) => f3.endsWith(".json")).map((f3) => Number(f3.slice(0, -".json".length))).filter((p) => p > 0);
|
|
473486
473577
|
} catch {
|
|
473487
473578
|
return [];
|
|
473488
473579
|
}
|
|
@@ -473729,7 +473820,7 @@ var init_cli_agent = __esm({
|
|
|
473729
473820
|
|
|
473730
473821
|
// ../../packages/host-core/dist/device-identity.js
|
|
473731
473822
|
import { join as join258 } from "node:path";
|
|
473732
|
-
import { readFileSync as readFileSync183, writeFileSync as writeFileSync129, existsSync as existsSync125, mkdirSync as mkdirSync142, renameSync as
|
|
473823
|
+
import { readFileSync as readFileSync183, writeFileSync as writeFileSync129, existsSync as existsSync125, mkdirSync as mkdirSync142, renameSync as renameSync73, chmodSync as chmodSync24 } from "node:fs";
|
|
473733
473824
|
function identityPath() {
|
|
473734
473825
|
return join258(daemonDir2(), "identity.json");
|
|
473735
473826
|
}
|
|
@@ -473751,7 +473842,7 @@ async function loadOrCreateDeviceIdentity() {
|
|
|
473751
473842
|
mkdirSync142(dir2, { recursive: true, mode: 448 });
|
|
473752
473843
|
const tmp = `${identityPath()}.tmp`;
|
|
473753
473844
|
writeFileSync129(tmp, JSON.stringify({ privateJwk, publicRaw, alg: "P256-ECDSA" }, null, 2), { mode: 384 });
|
|
473754
|
-
|
|
473845
|
+
renameSync73(tmp, identityPath());
|
|
473755
473846
|
try {
|
|
473756
473847
|
chmodSync24(identityPath(), 384);
|
|
473757
473848
|
} catch {
|
|
@@ -473783,7 +473874,7 @@ async function loadOrCreateSealingKey() {
|
|
|
473783
473874
|
mkdirSync142(dir2, { recursive: true, mode: 448 });
|
|
473784
473875
|
const tmp = `${sealingPath()}.tmp`;
|
|
473785
473876
|
writeFileSync129(tmp, JSON.stringify({ privateJwk, publicRaw: b64u(publicRaw), alg: "P256-ECDH" }, null, 2), { mode: 384 });
|
|
473786
|
-
|
|
473877
|
+
renameSync73(tmp, sealingPath());
|
|
473787
473878
|
try {
|
|
473788
473879
|
chmodSync24(sealingPath(), 384);
|
|
473789
473880
|
} catch {
|
|
@@ -478816,11 +478907,11 @@ var init_rdesk_call_window = __esm({
|
|
|
478816
478907
|
});
|
|
478817
478908
|
|
|
478818
478909
|
// ../../packages/host-core/dist/assistant/sign-in.js
|
|
478819
|
-
import { createHash as
|
|
478820
|
-
import { chmodSync as chmodSync26, mkdirSync as mkdirSync151, readFileSync as readFileSync189, renameSync as
|
|
478910
|
+
import { createHash as createHash73 } from "node:crypto";
|
|
478911
|
+
import { chmodSync as chmodSync26, mkdirSync as mkdirSync151, readFileSync as readFileSync189, renameSync as renameSync74, unlinkSync as unlinkSync13, writeFileSync as writeFileSync135 } from "node:fs";
|
|
478821
478912
|
import { join as join273 } from "node:path";
|
|
478822
478913
|
function signInPrint(c) {
|
|
478823
|
-
return
|
|
478914
|
+
return createHash73("sha256").update(`tesseract-assistant-sign-in
|
|
478824
478915
|
${c.dtid}
|
|
478825
478916
|
${c.refreshSecret}`).digest("hex");
|
|
478826
478917
|
}
|
|
@@ -478842,7 +478933,7 @@ function writeSignInState(s) {
|
|
|
478842
478933
|
const file8 = statePath();
|
|
478843
478934
|
writeFileSync135(`${file8}.tmp`, `${JSON.stringify(s, null, 2)}
|
|
478844
478935
|
`, { mode: 384 });
|
|
478845
|
-
|
|
478936
|
+
renameSync74(`${file8}.tmp`, file8);
|
|
478846
478937
|
try {
|
|
478847
478938
|
chmodSync26(file8, 384);
|
|
478848
478939
|
} catch {
|
|
@@ -479047,7 +479138,7 @@ var init_identity = __esm({
|
|
|
479047
479138
|
|
|
479048
479139
|
// ../../packages/host-core/dist/error-report.js
|
|
479049
479140
|
import { randomUUID as randomUUID93 } from "node:crypto";
|
|
479050
|
-
import { appendFileSync as appendFileSync13, existsSync as existsSync133, mkdirSync as mkdirSync154, readFileSync as readFileSync192, renameSync as
|
|
479141
|
+
import { appendFileSync as appendFileSync13, existsSync as existsSync133, mkdirSync as mkdirSync154, readFileSync as readFileSync192, renameSync as renameSync75, rmSync as rmSync64 } from "node:fs";
|
|
479051
479142
|
import { release as osRelease, arch as osArch } from "node:os";
|
|
479052
479143
|
import { join as join276 } from "node:path";
|
|
479053
479144
|
function endpoint3(apiOrigin2) {
|
|
@@ -479233,7 +479324,7 @@ function adoptPendingErrorReports() {
|
|
|
479233
479324
|
if (!existsSync133(p))
|
|
479234
479325
|
return;
|
|
479235
479326
|
const mine = `${p}.${process.pid}.adopting`;
|
|
479236
|
-
|
|
479327
|
+
renameSync75(p, mine);
|
|
479237
479328
|
const lines3 = readFileSync192(mine, "utf8").split("\n").filter(Boolean);
|
|
479238
479329
|
rmSync64(mine, { force: true });
|
|
479239
479330
|
if (!hasConsent())
|
|
@@ -480587,8 +480678,8 @@ ${known2.body}`).join("\n\n");
|
|
|
480587
480678
|
});
|
|
480588
480679
|
|
|
480589
480680
|
// ../../packages/host-core/dist/memory/qdrant-binary.js
|
|
480590
|
-
import { createHash as
|
|
480591
|
-
import { chmodSync as chmodSync27, createWriteStream as createWriteStream8, existsSync as existsSync134, mkdirSync as mkdirSync155, readFileSync as readFileSync193, renameSync as
|
|
480681
|
+
import { createHash as createHash74 } from "node:crypto";
|
|
480682
|
+
import { chmodSync as chmodSync27, createWriteStream as createWriteStream8, existsSync as existsSync134, mkdirSync as mkdirSync155, readFileSync as readFileSync193, renameSync as renameSync76, rmSync as rmSync65, statSync as statSync92, writeFileSync as writeFileSync138 } from "node:fs";
|
|
480592
480683
|
import { join as join277 } from "node:path";
|
|
480593
480684
|
import { Readable as Readable18 } from "node:stream";
|
|
480594
480685
|
import { pipeline as pipeline7 } from "node:stream/promises";
|
|
@@ -480634,7 +480725,7 @@ async function ensureQdrant(opts = {}) {
|
|
|
480634
480725
|
const res = await (opts.fetchImpl ?? fetch)(assetUrl(a), { signal: opts.signal, redirect: "follow" });
|
|
480635
480726
|
if (!res.ok || !res.body)
|
|
480636
480727
|
throw new Error(`HTTP ${res.status} for ${a.asset}`);
|
|
480637
|
-
const hash3 =
|
|
480728
|
+
const hash3 = createHash74("sha256");
|
|
480638
480729
|
let size2 = 0;
|
|
480639
480730
|
try {
|
|
480640
480731
|
await pipeline7(Readable18.fromWeb(res.body), async function* (src2) {
|
|
@@ -480654,7 +480745,7 @@ async function ensureQdrant(opts = {}) {
|
|
|
480654
480745
|
rmSync65(part, { force: true });
|
|
480655
480746
|
throw new Error(`${a.asset}: got ${size2} bytes sha256 ${digest2}, expected ${a.size} ${a.sha256}`);
|
|
480656
480747
|
}
|
|
480657
|
-
|
|
480748
|
+
renameSync76(part, archive);
|
|
480658
480749
|
await untar2(archive, dir2);
|
|
480659
480750
|
rmSync65(archive, { force: true });
|
|
480660
480751
|
if (!existsSync134(bin) || statSync92(bin).size === 0)
|
|
@@ -480687,7 +480778,7 @@ var init_qdrant_binary = __esm({
|
|
|
480687
480778
|
|
|
480688
480779
|
// ../../packages/host-core/dist/memory/qdrant-process.js
|
|
480689
480780
|
import { randomBytes as randomBytes49 } from "node:crypto";
|
|
480690
|
-
import { closeSync as closeSync20, mkdirSync as mkdirSync156, openSync as openSync19, statSync as statSync93, renameSync as
|
|
480781
|
+
import { closeSync as closeSync20, mkdirSync as mkdirSync156, openSync as openSync19, statSync as statSync93, renameSync as renameSync77, writeFileSync as writeFileSync139 } from "node:fs";
|
|
480691
480782
|
import { createServer as createServer17 } from "node:net";
|
|
480692
480783
|
import { join as join278 } from "node:path";
|
|
480693
480784
|
async function freePort2() {
|
|
@@ -480727,7 +480818,7 @@ function openLog() {
|
|
|
480727
480818
|
const path15 = join278(daemonDir(), "qdrant.log");
|
|
480728
480819
|
try {
|
|
480729
480820
|
if (statSync93(path15).size > LOG_MAX2)
|
|
480730
|
-
|
|
480821
|
+
renameSync77(path15, `${path15}.1`);
|
|
480731
480822
|
} catch {
|
|
480732
480823
|
}
|
|
480733
480824
|
mkdirSync156(daemonDir(), { recursive: true });
|
|
@@ -480930,7 +481021,7 @@ var init_recall_log = __esm({
|
|
|
480930
481021
|
});
|
|
480931
481022
|
|
|
480932
481023
|
// ../../packages/host-core/dist/memory/rebuild.js
|
|
480933
|
-
import { existsSync as existsSync135, mkdirSync as mkdirSync157, readFileSync as readFileSync194, renameSync as
|
|
481024
|
+
import { existsSync as existsSync135, mkdirSync as mkdirSync157, readFileSync as readFileSync194, renameSync as renameSync78, rmSync as rmSync66, writeFileSync as writeFileSync140 } from "node:fs";
|
|
480934
481025
|
import { dirname as dirname124 } from "node:path";
|
|
480935
481026
|
var MemoryRebuild;
|
|
480936
481027
|
var init_rebuild = __esm({
|
|
@@ -480967,7 +481058,7 @@ var init_rebuild = __esm({
|
|
|
480967
481058
|
mkdirSync157(dirname124(this.d.path), { recursive: true });
|
|
480968
481059
|
const tmp = `${this.d.path}.tmp`;
|
|
480969
481060
|
writeFileSync140(tmp, JSON.stringify(checkpoint), { mode: 384 });
|
|
480970
|
-
|
|
481061
|
+
renameSync78(tmp, this.d.path);
|
|
480971
481062
|
}
|
|
480972
481063
|
/** One phase from its checkpoint: batches of `size`, up to `concurrency` written at once, the checkpoint moved over
|
|
480973
481064
|
* the written batches at the front. False when cancelled. A failed batch fails the run, the checkpoint before it. */
|
|
@@ -481054,7 +481145,7 @@ var init_rebuild = __esm({
|
|
|
481054
481145
|
});
|
|
481055
481146
|
|
|
481056
481147
|
// ../../packages/host-core/dist/memory/profiles.js
|
|
481057
|
-
import { createHash as
|
|
481148
|
+
import { createHash as createHash75 } from "node:crypto";
|
|
481058
481149
|
function profileSubjects(items2, sizes) {
|
|
481059
481150
|
const on = /* @__PURE__ */ new Map();
|
|
481060
481151
|
for (const it of items2) {
|
|
@@ -481208,7 +481299,7 @@ with its date. Write:
|
|
|
481208
481299
|
};
|
|
481209
481300
|
day6 = (ts) => new Date(ts).toLocaleDateString("en-GB", { day: "numeric", month: "long", year: "numeric", timeZone: "UTC" });
|
|
481210
481301
|
when3 = (it) => it.eventAt || day6(it.ts);
|
|
481211
|
-
hash2 = (s) =>
|
|
481302
|
+
hash2 = (s) => createHash75("sha256").update(s).digest("hex");
|
|
481212
481303
|
promptOf = (s) => `SUBJECT: ${s.concept}
|
|
481213
481304
|
|
|
481214
481305
|
MEMORIES:
|
|
@@ -483755,7 +483846,7 @@ var init_clipboard_privacy = __esm({
|
|
|
483755
483846
|
});
|
|
483756
483847
|
|
|
483757
483848
|
// ../../packages/host-core/dist/clipboard/clipboard-platform.js
|
|
483758
|
-
import { createHash as
|
|
483849
|
+
import { createHash as createHash76 } from "node:crypto";
|
|
483759
483850
|
import { spawn as spawn26 } from "node:child_process";
|
|
483760
483851
|
import { accessSync, constants as fsConstants2, existsSync as existsSync138 } from "node:fs";
|
|
483761
483852
|
import { delimiter as delimiter3, join as join282 } from "node:path";
|
|
@@ -483806,7 +483897,7 @@ function imageFingerprint(img) {
|
|
|
483806
483897
|
const { width, height } = size2;
|
|
483807
483898
|
if (!width || !height)
|
|
483808
483899
|
return "";
|
|
483809
|
-
const h =
|
|
483900
|
+
const h = createHash76("sha1");
|
|
483810
483901
|
if (typeof img.toBitmap !== "function") {
|
|
483811
483902
|
try {
|
|
483812
483903
|
h.update(img.toPNG());
|
|
@@ -483841,7 +483932,7 @@ function imageFingerprint(img) {
|
|
|
483841
483932
|
return `${width}x${height}:${bmp.length}:${h.digest("base64")}`;
|
|
483842
483933
|
}
|
|
483843
483934
|
function sha13(s) {
|
|
483844
|
-
return
|
|
483935
|
+
return createHash76("sha1").update(s).digest("base64");
|
|
483845
483936
|
}
|
|
483846
483937
|
function readBufferSafe(clip9, format4) {
|
|
483847
483938
|
try {
|
|
@@ -484543,8 +484634,8 @@ Gtk.main()
|
|
|
484543
484634
|
});
|
|
484544
484635
|
|
|
484545
484636
|
// ../../packages/host-core/dist/clipboard/paste-history-store.js
|
|
484546
|
-
import { createHash as
|
|
484547
|
-
import { appendFileSync as appendFileSync14, existsSync as existsSync139, mkdirSync as mkdirSync161, readFileSync as readFileSync198, renameSync as
|
|
484637
|
+
import { createHash as createHash77, randomUUID as randomUUID94 } from "node:crypto";
|
|
484638
|
+
import { appendFileSync as appendFileSync14, existsSync as existsSync139, mkdirSync as mkdirSync161, readFileSync as readFileSync198, renameSync as renameSync79, statSync as statSync95, unlinkSync as unlinkSync15, writeFileSync as writeFileSync144 } from "node:fs";
|
|
484548
484639
|
import { join as join283 } from "node:path";
|
|
484549
484640
|
function pasteHistoryPath() {
|
|
484550
484641
|
return join283(daemonDir2(), "clipboard-history.json");
|
|
@@ -484716,7 +484807,7 @@ function createPasteHistoryStore(opts = {}) {
|
|
|
484716
484807
|
const gen = randomUUID94();
|
|
484717
484808
|
const tmp = `${pasteHistoryPath()}.tmp`;
|
|
484718
484809
|
writeFileSync144(tmp, JSON.stringify({ version: 2, gen, items: list7 }), { mode: 384 });
|
|
484719
|
-
|
|
484810
|
+
renameSync79(tmp, pasteHistoryPath());
|
|
484720
484811
|
const header6 = `${JSON.stringify({ gen })}
|
|
484721
484812
|
`;
|
|
484722
484813
|
writeFileSync144(pasteJournalPath(), header6, { mode: 384 });
|
|
@@ -484780,7 +484871,7 @@ function createPasteHistoryStore(opts = {}) {
|
|
|
484780
484871
|
return gone.map((i) => i.id);
|
|
484781
484872
|
}
|
|
484782
484873
|
function writeImage(png, thumbJpeg) {
|
|
484783
|
-
const base2 =
|
|
484874
|
+
const base2 = createHash77("sha256").update(png).digest("hex");
|
|
484784
484875
|
const dir2 = pasteImagesDir();
|
|
484785
484876
|
mkdirSync161(dir2, { recursive: true, mode: 448 });
|
|
484786
484877
|
const imageFile = `${base2}.png`;
|
|
@@ -488058,11 +488149,11 @@ import { existsSync as existsSync145, readFileSync as readFileSync204, statSync
|
|
|
488058
488149
|
import { homedir as homedir64 } from "node:os";
|
|
488059
488150
|
import { dirname as dirname128, isAbsolute as isAbsolute48, join as join289, relative as relative38 } from "node:path";
|
|
488060
488151
|
import { promisify as promisify23 } from "node:util";
|
|
488061
|
-
import { createHash as
|
|
488152
|
+
import { createHash as createHash78 } from "node:crypto";
|
|
488062
488153
|
import { readFileSync as readFileForHash } from "node:fs";
|
|
488063
488154
|
function sha256File2(file8) {
|
|
488064
488155
|
try {
|
|
488065
|
-
return
|
|
488156
|
+
return createHash78("sha256").update(readFileForHash(file8)).digest("hex");
|
|
488066
488157
|
} catch {
|
|
488067
488158
|
return void 0;
|
|
488068
488159
|
}
|
|
@@ -488264,7 +488355,7 @@ var init_ensure_instance = __esm({
|
|
|
488264
488355
|
});
|
|
488265
488356
|
|
|
488266
488357
|
// ../../packages/host-core/dist/mesh/move-to-instance.js
|
|
488267
|
-
import { closeSync as closeSync21, existsSync as existsSync147, openSync as openSync20, readFileSync as readFileSync205, renameSync as
|
|
488358
|
+
import { closeSync as closeSync21, existsSync as existsSync147, openSync as openSync20, readFileSync as readFileSync205, renameSync as renameSync80, rmSync as rmSync70, statSync as statSync97, writeFileSync as writeFileSync147 } from "node:fs";
|
|
488268
488359
|
import { dirname as dirname130, join as join291 } from "node:path";
|
|
488269
488360
|
function realMoveDeps(instance, reload2) {
|
|
488270
488361
|
const svc = makeMeshInstanceService(instance);
|
|
@@ -488301,7 +488392,7 @@ function writeMoveRecord(r) {
|
|
|
488301
488392
|
const tmp = `${recordFile3()}.tmp`;
|
|
488302
488393
|
writeFileSync147(tmp, `${JSON.stringify(r)}
|
|
488303
488394
|
`, { mode: 384 });
|
|
488304
|
-
|
|
488395
|
+
renameSync80(tmp, recordFile3());
|
|
488305
488396
|
}
|
|
488306
488397
|
function networksToMove(instance = DEFAULT_INSTANCE) {
|
|
488307
488398
|
const rec = readMoveRecord();
|
|
@@ -489714,9 +489805,9 @@ var init_standalone_atrium_app = __esm({
|
|
|
489714
489805
|
});
|
|
489715
489806
|
|
|
489716
489807
|
// ../../packages/host-core/dist/clipboard/clipboard-sync.js
|
|
489717
|
-
import { createHash as
|
|
489808
|
+
import { createHash as createHash79, randomUUID as randomUUID96 } from "node:crypto";
|
|
489718
489809
|
function sha2(input) {
|
|
489719
|
-
return
|
|
489810
|
+
return createHash79("sha1").update(input).digest("base64");
|
|
489720
489811
|
}
|
|
489721
489812
|
function entrySignature(e) {
|
|
489722
489813
|
return e.kind === "image" ? `img:${e.imagePngBase64 ? sha2(e.imagePngBase64) : ""}` : `txt:${sha2(e.text ?? "")}`;
|
|
@@ -490976,7 +491067,7 @@ var init_send = __esm({
|
|
|
490976
491067
|
});
|
|
490977
491068
|
|
|
490978
491069
|
// ../../packages/host-core/dist/mesh/instance-choice.js
|
|
490979
|
-
import { mkdirSync as mkdirSync166, readFileSync as readFileSync210, renameSync as
|
|
491070
|
+
import { mkdirSync as mkdirSync166, readFileSync as readFileSync210, renameSync as renameSync81, rmSync as rmSync72, writeFileSync as writeFileSync152 } from "node:fs";
|
|
490980
491071
|
import { join as join301 } from "node:path";
|
|
490981
491072
|
function choiceFile() {
|
|
490982
491073
|
return join301(meshDir(), "helper.json");
|
|
@@ -491007,7 +491098,7 @@ function chooseInstance(name) {
|
|
|
491007
491098
|
const tmp = `${choiceFile()}.tmp`;
|
|
491008
491099
|
writeFileSync152(tmp, `${JSON.stringify({ instance: name })}
|
|
491009
491100
|
`, { mode: 384 });
|
|
491010
|
-
|
|
491101
|
+
renameSync81(tmp, choiceFile());
|
|
491011
491102
|
giveToDirOwner(choiceFile(), meshDir());
|
|
491012
491103
|
}
|
|
491013
491104
|
function applyChosenInstance(log16 = () => {
|
|
@@ -491710,7 +491801,7 @@ var init_tailnet_embedded = __esm({
|
|
|
491710
491801
|
});
|
|
491711
491802
|
|
|
491712
491803
|
// ../../packages/host-core/dist/mesh/wireguard-windows.js
|
|
491713
|
-
import { closeSync as closeSync22, constants as constants8, fstatSync as fstatSync6, lstatSync as lstatSync16, mkdirSync as mkdirSync167, openSync as openSync21, readFileSync as readFileSync211, readdirSync as
|
|
491804
|
+
import { closeSync as closeSync22, constants as constants8, fstatSync as fstatSync6, lstatSync as lstatSync16, mkdirSync as mkdirSync167, openSync as openSync21, readFileSync as readFileSync211, readdirSync as readdirSync76, unlinkSync as unlinkSync19, writeFileSync as writeFileSync154 } from "node:fs";
|
|
491714
491805
|
import { join as join302, win32 as win3211 } from "node:path";
|
|
491715
491806
|
function windowsWireGuardNetworks(deps6, nameOf4, conflicts) {
|
|
491716
491807
|
const binary = deps6.client ?? win3211.join(process.env.ProgramW6432 || process.env.ProgramFiles || "C:\\Program Files", "WireGuard", "wireguard.exe");
|
|
@@ -491830,7 +491921,7 @@ ${normalized}`);
|
|
|
491830
491921
|
if (!await directory())
|
|
491831
491922
|
return [];
|
|
491832
491923
|
const names3 = [];
|
|
491833
|
-
for (const entry of
|
|
491924
|
+
for (const entry of readdirSync76(deps6.directory)) {
|
|
491834
491925
|
const match2 = /^tsw-([a-z][a-z0-9-]{0,10})\.conf$/.exec(entry);
|
|
491835
491926
|
if (match2 && await read4(match2[1]) !== null)
|
|
491836
491927
|
names3.push(match2[1]);
|
|
@@ -491890,7 +491981,7 @@ var init_wireguard_windows = __esm({
|
|
|
491890
491981
|
});
|
|
491891
491982
|
|
|
491892
491983
|
// ../../packages/host-core/dist/mesh/wireguard-darwin.js
|
|
491893
|
-
import { closeSync as closeSync23, constants as constants9, fchmodSync, fstatSync as fstatSync7, lstatSync as lstatSync17, mkdirSync as mkdirSync168, openSync as openSync22, readFileSync as readFileSync212, readdirSync as
|
|
491984
|
+
import { closeSync as closeSync23, constants as constants9, fchmodSync, fstatSync as fstatSync7, lstatSync as lstatSync17, mkdirSync as mkdirSync168, openSync as openSync22, readFileSync as readFileSync212, readdirSync as readdirSync77, unlinkSync as unlinkSync20, writeFileSync as writeFileSync155 } from "node:fs";
|
|
491894
491985
|
import { createPrivateKey as createPrivateKey4, createPublicKey as createPublicKey3 } from "node:crypto";
|
|
491895
491986
|
import { networkInterfaces as networkInterfaces3 } from "node:os";
|
|
491896
491987
|
import { dirname as dirname135, join as join303 } from "node:path";
|
|
@@ -492163,7 +492254,7 @@ ${normalized}`);
|
|
|
492163
492254
|
if (!await directory())
|
|
492164
492255
|
return [];
|
|
492165
492256
|
const names3 = [];
|
|
492166
|
-
for (const file8 of
|
|
492257
|
+
for (const file8 of readdirSync77(deps6.directory)) {
|
|
492167
492258
|
const m = /^tsw-([a-z][a-z0-9-]{0,10})\.conf$/.exec(file8);
|
|
492168
492259
|
if (m && await read4(m[1]) !== null)
|
|
492169
492260
|
names3.push(m[1]);
|
|
@@ -492247,7 +492338,7 @@ var init_wireguard_darwin = __esm({
|
|
|
492247
492338
|
|
|
492248
492339
|
// ../../packages/host-core/dist/mesh/wireguard-network.js
|
|
492249
492340
|
import { execFile as execFile49 } from "node:child_process";
|
|
492250
|
-
import { closeSync as closeSync24, constants as constants10, fchmodSync as fchmodSync2, fstatSync as fstatSync8, lstatSync as lstatSync18, mkdirSync as mkdirSync169, openSync as openSync23, readFileSync as readFileSync213, readdirSync as
|
|
492341
|
+
import { closeSync as closeSync24, constants as constants10, fchmodSync as fchmodSync2, fstatSync as fstatSync8, lstatSync as lstatSync18, mkdirSync as mkdirSync169, openSync as openSync23, readFileSync as readFileSync213, readdirSync as readdirSync78, unlinkSync as unlinkSync21, writeFileSync as writeFileSync156 } from "node:fs";
|
|
492251
492342
|
import { isIP as isIP7 } from "node:net";
|
|
492252
492343
|
import { join as join304 } from "node:path";
|
|
492253
492344
|
import { promisify as promisify25 } from "node:util";
|
|
@@ -492413,7 +492504,7 @@ ${normalized}`);
|
|
|
492413
492504
|
root();
|
|
492414
492505
|
if (!directory())
|
|
492415
492506
|
return [];
|
|
492416
|
-
return
|
|
492507
|
+
return readdirSync78(deps6.directory).flatMap((entry) => {
|
|
492417
492508
|
const m = /^tsw-([a-z][a-z0-9-]{0,10})\.conf$/.exec(entry);
|
|
492418
492509
|
return m && read4(m[1]) !== null ? [m[1]] : [];
|
|
492419
492510
|
}).sort();
|
|
@@ -492596,7 +492687,7 @@ var init_relay_address = __esm({
|
|
|
492596
492687
|
});
|
|
492597
492688
|
|
|
492598
492689
|
// ../../packages/host-core/dist/assistant/seed-files.js
|
|
492599
|
-
import { createHash as
|
|
492690
|
+
import { createHash as createHash80 } from "node:crypto";
|
|
492600
492691
|
import { promises as fs30, existsSync as existsSync153, readFileSync as readFileSync214 } from "node:fs";
|
|
492601
492692
|
import { dirname as dirname136, join as join305, normalize as normalize18, relative as relative40, sep as sep41 } from "node:path";
|
|
492602
492693
|
import { gunzipSync as gunzipSync3, gzipSync as gzipSync2 } from "node:zlib";
|
|
@@ -492670,7 +492761,7 @@ function unpackSeedFiles(env) {
|
|
|
492670
492761
|
for (const [p, t2] of Object.entries(parsed.files ?? {}))
|
|
492671
492762
|
if (typeof t2 === "string")
|
|
492672
492763
|
files[p] = t2;
|
|
492673
|
-
return { files, hash:
|
|
492764
|
+
return { files, hash: createHash80("sha256").update(data3).digest("hex") };
|
|
492674
492765
|
} catch {
|
|
492675
492766
|
return null;
|
|
492676
492767
|
}
|
|
@@ -492728,8 +492819,8 @@ var init_seed_files = __esm({
|
|
|
492728
492819
|
});
|
|
492729
492820
|
|
|
492730
492821
|
// ../../packages/host-core/dist/assistant/boot.js
|
|
492731
|
-
import { createHash as
|
|
492732
|
-
import { cpSync as cpSync7, existsSync as existsSync154, lstatSync as lstatSync19, mkdirSync as mkdirSync170, readdirSync as
|
|
492822
|
+
import { createHash as createHash81 } from "node:crypto";
|
|
492823
|
+
import { cpSync as cpSync7, existsSync as existsSync154, lstatSync as lstatSync19, mkdirSync as mkdirSync170, readdirSync as readdirSync79, readFileSync as readFileSync215, readlinkSync as readlinkSync4, renameSync as renameSync82, rmSync as rmSync73, statSync as statSync98, symlinkSync as symlinkSync3, writeFileSync as writeFileSync157, chmodSync as chmodSync29 } from "node:fs";
|
|
492733
492824
|
import { homedir as homedir68 } from "node:os";
|
|
492734
492825
|
import { dirname as dirname137, join as join306, resolve as resolve51, sep as sep42 } from "node:path";
|
|
492735
492826
|
function parse14(raw2, what, problems) {
|
|
@@ -492745,7 +492836,7 @@ function parse14(raw2, what, problems) {
|
|
|
492745
492836
|
function writePrivate(file8, text45) {
|
|
492746
492837
|
mkdirSync170(join306(file8, ".."), { recursive: true, mode: 448 });
|
|
492747
492838
|
writeFileSync157(`${file8}.tmp`, text45, { mode: 384 });
|
|
492748
|
-
|
|
492839
|
+
renameSync82(`${file8}.tmp`, file8);
|
|
492749
492840
|
try {
|
|
492750
492841
|
chmodSync29(file8, 384);
|
|
492751
492842
|
} catch {
|
|
@@ -492937,7 +493028,7 @@ function seedHouseSkills(src2) {
|
|
|
492937
493028
|
} catch {
|
|
492938
493029
|
}
|
|
492939
493030
|
let changed3 = 0;
|
|
492940
|
-
for (const slug5 of
|
|
493031
|
+
for (const slug5 of readdirSync79(src2).sort()) {
|
|
492941
493032
|
const md3 = join306(src2, slug5, "SKILL.md");
|
|
492942
493033
|
if (!existsSync154(md3))
|
|
492943
493034
|
continue;
|
|
@@ -493005,7 +493096,7 @@ function readableByAll(dir2) {
|
|
|
493005
493096
|
return;
|
|
493006
493097
|
let names3 = [];
|
|
493007
493098
|
try {
|
|
493008
|
-
names3 =
|
|
493099
|
+
names3 = readdirSync79(p);
|
|
493009
493100
|
} catch {
|
|
493010
493101
|
return;
|
|
493011
493102
|
}
|
|
@@ -493115,7 +493206,7 @@ function migrateLegacyEngineHomes(home2, legacyDir, problems = []) {
|
|
|
493115
493206
|
if (!st || !st.isDirectory())
|
|
493116
493207
|
continue;
|
|
493117
493208
|
const there = lstatSync19(to, { throwIfNoEntry: false });
|
|
493118
|
-
if (there?.isDirectory() &&
|
|
493209
|
+
if (there?.isDirectory() && readdirSync79(to).length)
|
|
493119
493210
|
continue;
|
|
493120
493211
|
mkdirSync170(dirname137(to), { recursive: true });
|
|
493121
493212
|
if (there)
|
|
@@ -493459,7 +493550,7 @@ var init_boot = __esm({
|
|
|
493459
493550
|
init_helper_seat();
|
|
493460
493551
|
init_hosting();
|
|
493461
493552
|
init_violet2();
|
|
493462
|
-
sha3 = (s) =>
|
|
493553
|
+
sha3 = (s) => createHash81("sha256").update(s).digest("hex");
|
|
493463
493554
|
SEED_PARTS_FILE = ".seed-parts.json";
|
|
493464
493555
|
ENGINE_HOMES = [".claude", ".codex", ".gemini", ".local/share/opencode", ".config/opencode"];
|
|
493465
493556
|
under4 = (p, dir2) => p === dir2 || p.startsWith(dir2.endsWith(sep42) ? dir2 : dir2 + sep42);
|
|
@@ -493471,7 +493562,7 @@ var init_boot = __esm({
|
|
|
493471
493562
|
});
|
|
493472
493563
|
|
|
493473
493564
|
// ../../packages/host-core/dist/assistant/pool.js
|
|
493474
|
-
import { chmodSync as chmodSync30, existsSync as existsSync155, mkdirSync as mkdirSync171, readFileSync as readFileSync216, renameSync as
|
|
493565
|
+
import { chmodSync as chmodSync30, existsSync as existsSync155, mkdirSync as mkdirSync171, readFileSync as readFileSync216, renameSync as renameSync83, writeFileSync as writeFileSync158 } from "node:fs";
|
|
493475
493566
|
import { dirname as dirname138, join as join307 } from "node:path";
|
|
493476
493567
|
function poolMode(env = process.env) {
|
|
493477
493568
|
return env[POOL_ENV]?.trim() === "1" && personMode(env);
|
|
@@ -493490,7 +493581,7 @@ function writeKept(k, file8 = poolClaimFile()) {
|
|
|
493490
493581
|
mkdirSync171(dirname138(file8), { recursive: true, mode: 448 });
|
|
493491
493582
|
writeFileSync158(`${file8}.tmp`, `${JSON.stringify(k)}
|
|
493492
493583
|
`, { mode: 384 });
|
|
493493
|
-
|
|
493584
|
+
renameSync83(`${file8}.tmp`, file8);
|
|
493494
493585
|
try {
|
|
493495
493586
|
chmodSync30(file8, 384);
|
|
493496
493587
|
} catch {
|
|
@@ -515766,7 +515857,7 @@ init_dist30();
|
|
|
515766
515857
|
init_dist30();
|
|
515767
515858
|
init_dist30();
|
|
515768
515859
|
import { existsSync as existsSync165, mkdtempSync as mkdtempSync15, readFileSync as readFileSync229, rmSync as rmSync78 } from "node:fs";
|
|
515769
|
-
import { createHash as
|
|
515860
|
+
import { createHash as createHash83 } from "node:crypto";
|
|
515770
515861
|
import { execFileSync as execFileSync12, spawn as spawn34, spawnSync as spawnSync11 } from "node:child_process";
|
|
515771
515862
|
import { fileURLToPath as fileURLToPath12 } from "node:url";
|
|
515772
515863
|
import { tmpdir as tmpdir27 } from "node:os";
|
|
@@ -515776,7 +515867,7 @@ import { setDefaultAutoSelectFamilyAttemptTimeout } from "node:net";
|
|
|
515776
515867
|
|
|
515777
515868
|
// src/crash-reports.ts
|
|
515778
515869
|
init_base_paths();
|
|
515779
|
-
import { existsSync as existsSync156, mkdirSync as mkdirSync172, readFileSync as readFileSync217, renameSync as
|
|
515870
|
+
import { existsSync as existsSync156, mkdirSync as mkdirSync172, readFileSync as readFileSync217, renameSync as renameSync84, writeFileSync as writeFileSync159 } from "node:fs";
|
|
515780
515871
|
import { dirname as dirname139 } from "node:path";
|
|
515781
515872
|
function settingsPath() {
|
|
515782
515873
|
return tessPath("cli.json");
|
|
@@ -515794,7 +515885,7 @@ function writeCrashReportConsent(on) {
|
|
|
515794
515885
|
if (!existsSync156(dirname139(p))) mkdirSync172(dirname139(p), { recursive: true, mode: 448 });
|
|
515795
515886
|
const tmp = `${p}.tmp`;
|
|
515796
515887
|
writeFileSync159(tmp, JSON.stringify(next, null, 2) + "\n", { mode: 384 });
|
|
515797
|
-
|
|
515888
|
+
renameSync84(tmp, p);
|
|
515798
515889
|
}
|
|
515799
515890
|
function readAppSettings() {
|
|
515800
515891
|
try {
|
|
@@ -518454,7 +518545,7 @@ async function meshCommand(rest, flags) {
|
|
|
518454
518545
|
// src/deploy.ts
|
|
518455
518546
|
init_hosting();
|
|
518456
518547
|
import { execFileSync as execFileSync11 } from "node:child_process";
|
|
518457
|
-
import { lstatSync as lstatSync20, readdirSync as
|
|
518548
|
+
import { lstatSync as lstatSync20, readdirSync as readdirSync80, readFileSync as readFileSync223, statSync as statSync99 } from "node:fs";
|
|
518458
518549
|
import { basename as basename70, join as join312, relative as relative41, resolve as resolve54, sep as sep43 } from "node:path";
|
|
518459
518550
|
import { gzipSync as gzipSync3 } from "node:zlib";
|
|
518460
518551
|
function listProjectFiles(root) {
|
|
@@ -518469,7 +518560,7 @@ function listProjectFiles(root) {
|
|
|
518469
518560
|
} catch {
|
|
518470
518561
|
const out = [];
|
|
518471
518562
|
const walk6 = (dir2) => {
|
|
518472
|
-
for (const name of
|
|
518563
|
+
for (const name of readdirSync80(dir2)) {
|
|
518473
518564
|
const abs = join312(dir2, name);
|
|
518474
518565
|
const rel = relative41(root, abs).split(sep43).join("/");
|
|
518475
518566
|
if (!shouldUploadPath(rel)) continue;
|
|
@@ -518654,8 +518745,8 @@ async function assistantSignIn(provider11, label4) {
|
|
|
518654
518745
|
init_dist2();
|
|
518655
518746
|
init_base_paths();
|
|
518656
518747
|
import { spawnSync as spawnSync10 } from "node:child_process";
|
|
518657
|
-
import { createHash as
|
|
518658
|
-
import { chmodSync as chmodSync32, existsSync as existsSync161, mkdirSync as mkdirSync175, readdirSync as
|
|
518748
|
+
import { createHash as createHash82 } from "node:crypto";
|
|
518749
|
+
import { chmodSync as chmodSync32, existsSync as existsSync161, mkdirSync as mkdirSync175, readdirSync as readdirSync81, renameSync as renameSync85, rmSync as rmSync76, statSync as statSync100, symlinkSync as symlinkSync4, writeFileSync as writeFileSync164, lstatSync as lstatSync21, unlinkSync as unlinkSync22 } from "node:fs";
|
|
518659
518750
|
import { writeFile as writeFile30 } from "node:fs/promises";
|
|
518660
518751
|
import { createRequire as createRequire8 } from "node:module";
|
|
518661
518752
|
import { delimiter as delimiter4, join as join313 } from "node:path";
|
|
@@ -518788,7 +518879,7 @@ function pythonExe(tools3) {
|
|
|
518788
518879
|
const dir2 = pyDir(tools3);
|
|
518789
518880
|
if (!existsSync161(join313(dir2, ".complete"))) return null;
|
|
518790
518881
|
try {
|
|
518791
|
-
for (const d of
|
|
518882
|
+
for (const d of readdirSync81(dir2).filter((n2) => n2.startsWith("cpython-")).sort().reverse()) {
|
|
518792
518883
|
const exe = isWin(process.platform) ? join313(dir2, d, "python.exe") : join313(dir2, d, "bin", "python3");
|
|
518793
518884
|
if (existsSync161(exe)) return exe;
|
|
518794
518885
|
}
|
|
@@ -518805,7 +518896,7 @@ async function fetchChecked(url2, to) {
|
|
|
518805
518896
|
const want2 = (await (await fetch(`${url2}.sha256`, { signal: AbortSignal.timeout(6e4), headers: { "user-agent": "tesseract-agent" } })).text()).trim().split(/\s+/)[0]?.toLowerCase();
|
|
518806
518897
|
if (!want2 || !/^[0-9a-f]{64}$/.test(want2)) throw new Error(`${url2}.sha256: no checksum published`);
|
|
518807
518898
|
await download2(url2, to);
|
|
518808
|
-
const got =
|
|
518899
|
+
const got = createHash82("sha256").update(await import("node:fs/promises").then((f3) => f3.readFile(to))).digest("hex");
|
|
518809
518900
|
if (got !== want2) throw new Error(`${url2}: checksum mismatch (got ${got.slice(0, 12)}\u2026, expected ${want2.slice(0, 12)}\u2026)`);
|
|
518810
518901
|
}
|
|
518811
518902
|
function extract(archive, into) {
|
|
@@ -518862,7 +518953,7 @@ async function installGit(bin, tools3, log16) {
|
|
|
518862
518953
|
extract(archive, tmp);
|
|
518863
518954
|
rmSync76(archive, { force: true });
|
|
518864
518955
|
rmSync76(dir2, { recursive: true, force: true });
|
|
518865
|
-
|
|
518956
|
+
renameSync85(tmp, dir2);
|
|
518866
518957
|
mkdirSync175(bin, { recursive: true });
|
|
518867
518958
|
if (isWin(process.platform)) {
|
|
518868
518959
|
const exe = [join313(dir2, "cmd", "git.exe"), join313(dir2, "mingw64", "bin", "git.exe"), join313(dir2, "bin", "git.exe")].find((p) => existsSync161(p));
|
|
@@ -518902,9 +518993,9 @@ async function installPython(bin, tools3, log16) {
|
|
|
518902
518993
|
rmSync76(tmp, { recursive: true, force: true });
|
|
518903
518994
|
extract(archive, tmp);
|
|
518904
518995
|
rmSync76(archive, { force: true });
|
|
518905
|
-
const inner2 =
|
|
518996
|
+
const inner2 = readdirSync81(tmp).find((n2) => n2.startsWith("uv-"));
|
|
518906
518997
|
rmSync76(uvDir, { recursive: true, force: true });
|
|
518907
|
-
|
|
518998
|
+
renameSync85(inner2 ? join313(tmp, inner2) : tmp, uvDir);
|
|
518908
518999
|
rmSync76(tmp, { recursive: true, force: true });
|
|
518909
519000
|
}
|
|
518910
519001
|
const dir2 = pyDir(tools3);
|
|
@@ -519283,7 +519374,7 @@ async function linkCommand(rest, flags) {
|
|
|
519283
519374
|
}
|
|
519284
519375
|
let linkId;
|
|
519285
519376
|
if (typeof flags.id === "string") linkId = flags.id;
|
|
519286
|
-
else if (typeof flags.name === "string") linkId =
|
|
519377
|
+
else if (typeof flags.name === "string") linkId = createHash83("sha256").update(flags.name).digest("hex").slice(0, 16);
|
|
519287
519378
|
else {
|
|
519288
519379
|
console.error("Provide --name <shared-label> (identical on both machines) or --id <sharedId>.");
|
|
519289
519380
|
process.exit(1);
|