tesseract-agent 0.12.2-beta.4 → 0.12.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.
@@ -2640,7 +2640,7 @@ var require_websocket = __commonJS({
2640
2640
  var http = __require("http");
2641
2641
  var net = __require("net");
2642
2642
  var tls2 = __require("tls");
2643
- var { randomBytes: randomBytes53, createHash: createHash88 } = __require("crypto");
2643
+ var { randomBytes: randomBytes53, createHash: createHash89 } = __require("crypto");
2644
2644
  var { Duplex: Duplex2, Readable: Readable19 } = __require("stream");
2645
2645
  var { URL: URL4 } = __require("url");
2646
2646
  var PerMessageDeflate2 = require_permessage_deflate();
@@ -3308,7 +3308,7 @@ var require_websocket = __commonJS({
3308
3308
  abortHandshake(websocket, socket2, "Invalid Upgrade header");
3309
3309
  return;
3310
3310
  }
3311
- const digest2 = createHash88("sha1").update(key7 + GUID).digest("base64");
3311
+ const digest2 = createHash89("sha1").update(key7 + GUID).digest("base64");
3312
3312
  if (res.headers["sec-websocket-accept"] !== digest2) {
3313
3313
  abortHandshake(websocket, socket2, "Invalid Sec-WebSocket-Accept header");
3314
3314
  return;
@@ -3677,7 +3677,7 @@ var require_websocket_server = __commonJS({
3677
3677
  var EventEmitter4 = __require("events");
3678
3678
  var http = __require("http");
3679
3679
  var { Duplex: Duplex2 } = __require("stream");
3680
- var { createHash: createHash88 } = __require("crypto");
3680
+ var { createHash: createHash89 } = __require("crypto");
3681
3681
  var extension2 = require_extension();
3682
3682
  var PerMessageDeflate2 = require_permessage_deflate();
3683
3683
  var subprotocol2 = require_subprotocol();
@@ -3984,7 +3984,7 @@ var require_websocket_server = __commonJS({
3984
3984
  );
3985
3985
  }
3986
3986
  if (this._state > RUNNING) return abortHandshake(socket2, 503);
3987
- const digest2 = createHash88("sha1").update(key7 + GUID).digest("base64");
3987
+ const digest2 = createHash89("sha1").update(key7 + GUID).digest("base64");
3988
3988
  const headers = [
3989
3989
  "HTTP/1.1 101 Switching Protocols",
3990
3990
  "Upgrade: websocket",
@@ -16411,7 +16411,7 @@ var init_capabilities2 = __esm({
16411
16411
  label: "Make something in this conversation",
16412
16412
  help: "What the model is told the `studio.start` App-Control capability does (studio domain, write).",
16413
16413
  vars: [],
16414
- content: `Start one of Tesseract's makers in this conversation: a picture, a logo, a website, a mobile app, a video, a presentation, a personal assistant, deep research, a data analysis, a game (played in the browser right here, or a real Unity, Unreal or Godot project), a skin for the Tesseract app itself, a new project folder (named as the person says and set up the way they describe), a piece of writing (an email, a letter, a blog post, a CV \u2014 drafted with them in a document they edit), a postcard (a picture and their words, both sides, to print or send), social media posts (a caption for each platform and a matching picture, ready to schedule), one of their photos enhanced (restored, brightened, sharpened, made bigger, the background removed), a spreadsheet (a budget, a tracker, an invoice list, or their own data, with formulas, totals and a chart), a PDF (one they have filled in and signed by them, something turned into a PDF, or a form people can fill), a diagram (a flowchart, an org chart, a timeline, a mind map), a drawing (an illustration, an icon, poster art in the vector editor), a font (an original typeface from what it is for and how it looks, or in the spirit of a font they name \u2014 its letters drawn, then opened in the font editor), a piece of audio (a podcast episode, a voice-over, a narration, a recording of theirs cleaned up, a short music edit \u2014 finished in the audio editor, or a script voiced with music under it), a motion graphic (an animated title, a lower third, a logo reveal, a short animated explainer \u2014 built in the motion editor and exported to video), a wireframe (grayscale screens of a web page or an app linked into a clickable flow, edited by hand \u2014 or a blank canvas to build on with pictures to work from), an invoice (lines, tax, due date and payment details, numbered after their last one \u2014 a Word document with its PDF), an email newsletter (planned, looked up where needed and laid out as email-safe HTML for their mailing tool), a form or survey (questions of every kind with simple logic \u2014 a fillable PDF and a web page that collects the answers), a Remote Desktop connection (to one of their own computers, to someone else's, or letting someone reach this one \u2014 anything that opens their computer stays the person's press), or a private network for their devices (home or office; its join token and shut-down secret are shown to the person, never to you). It opens on the canvas beside the chat, asks its own questions in the chat and makes the thing itself \u2014 better than making it with your own tools. Use it whenever the person wants one of these made, in a plain chat as much as in one already making something else (that one stops; what it said stays in the chat). Pass what they said as "about" so they are not asked it again; then end your turn without writing anything \u2014 the maker carries on in the chat.`
16414
+ content: `Start one of Tesseract's makers in this conversation: a picture, a logo, a website, a mobile app, a video, a presentation, a personal assistant, deep research, a data analysis, a game (played in the browser right here, or a real Unity, Unreal or Godot project), a skin for the Tesseract app itself, a new project folder (named as the person says and set up the way they describe), a piece of writing (an email, a letter, a blog post, a CV \u2014 drafted with them in a document they edit), a postcard (a picture and their words, both sides, to print or send), social media posts (a caption for each platform and a matching picture, ready to schedule), one of their photos enhanced (restored, brightened, sharpened, made bigger, the background removed), a spreadsheet (a budget, a tracker, an invoice list, or their own data, with formulas, totals and a chart), a PDF (one they have filled in and signed by them, something turned into a PDF, or a form people can fill), a diagram (a flowchart, an org chart, a timeline, a mind map), a drawing (an illustration, an icon, poster art in the vector editor), a comic (a manga or a webtoon, from an idea or a whole script, its pages in the comic editor), a font (an original typeface from what it is for and how it looks, or in the spirit of a font they name \u2014 its letters drawn, then opened in the font editor), a piece of audio (a podcast episode, a voice-over, a narration, a recording of theirs cleaned up, a short music edit \u2014 finished in the audio editor, or a script voiced with music under it), a motion graphic (an animated title, a lower third, a logo reveal, a short animated explainer \u2014 built in the motion editor and exported to video), a wireframe (grayscale screens of a web page or an app linked into a clickable flow, edited by hand \u2014 or a blank canvas to build on with pictures to work from), an invoice (lines, tax, due date and payment details, numbered after their last one \u2014 a Word document with its PDF), an email newsletter (planned, looked up where needed and laid out as email-safe HTML for their mailing tool), a form or survey (questions of every kind with simple logic \u2014 a fillable PDF and a web page that collects the answers), a Remote Desktop connection (to one of their own computers, to someone else's, or letting someone reach this one \u2014 anything that opens their computer stays the person's press), or a private network for their devices (home or office; its join token and shut-down secret are shown to the person, never to you). It opens on the canvas beside the chat, asks its own questions in the chat and makes the thing itself \u2014 better than making it with your own tools. Use it whenever the person wants one of these made, in a plain chat as much as in one already making something else (that one stops; what it said stays in the chat). Pass what they said as "about" so they are not asked it again; then end your turn without writing anything \u2014 the maker carries on in the chat.`
16415
16415
  },
16416
16416
  {
16417
16417
  id: "capability.studio.reply",
@@ -107313,7 +107313,7 @@ ${JSON.stringify(r, null, 2)}`
107313
107313
  domain: "studio",
107314
107314
  title: "Make something in this conversation",
107315
107315
  input: external_exports.object({
107316
- kind: external_exports.enum(["picture", "logo", "website", "app", "video", "presentation", "assistant", "research", "data", "game", "skin", "project", "writing", "postcard", "social", "photo", "remote", "network", "spreadsheet", "pdf", "diagram", "drawing", "font", "audio", "motion", "wireframe", "invoice", "newsletter", "form"]).describe("What to make: picture, logo (a brand: symbol, name in type, colours), website, app (a mobile app), video, presentation, assistant (a personal assistant), research (a deep research report), data (an analysis of data), game (a browser game played right here, or a Unity, Unreal or Godot project), skin (a look for the Tesseract app itself), project (a new project folder with the name given, set up the way the person describes), writing (an email, a letter, a blog post, a CV \u2014 drafted with them in a document they edit), postcard (a picture and their words, both sides, to print or send), social (social media posts: a picture and a caption for each platform, ready to schedule), photo (their own photo enhanced: restored, brightened, sharpened, colourised, made bigger, the background removed \u2014 picture is for a new picture), remote (Remote Desktop: connect to one of the person's own computers, to someone else's by ID and password, a one-time code or asking them by email, or let someone reach this computer \u2014 the person presses anything that opens it), network (a private network for their devices, home or office: made, then devices added; its token and secret stay on the person's screen), spreadsheet (a budget, tracker, schedule, invoice list or inventory \u2014 or their own data \u2014 made into a workbook with formulas, totals and a chart), pdf (fill in and sign a PDF they have, turn a document, pictures or a web page into a PDF, or make a form people can fill), diagram (a flowchart, org chart, timeline, mind map or sequence diagram, drawn from Mermaid they can edit), drawing (an illustration, an icon or poster art drawn in the vector editor), font (an original typeface: its letters drawn by AI from what it is for and its look or a font to start from, then opened in the font editor), audio (a podcast episode, voice-over, narration, a recording cleaned up or a short music edit \u2014 from their recording, finished in the audio editor, or a script voiced with music on a timeline), motion (an animated title, a lower third, a logo reveal or a short animated explainer, built in the motion editor and exportable to video), wireframe (low-fidelity grayscale screens of a web page or an app linked into a clickable flow, edited by hand in the card \u2014 or a blank canvas to build on with pictures to work from; can be handed to the website, app or project maker as its brief), invoice (an invoice to a customer \u2014 lines, tax, due date, payment details \u2014 made as a Word document with its PDF), newsletter (an email newsletter planned, researched where needed and laid out as email-safe HTML), form (a form or survey with questions of every kind, made as a fillable PDF and a web page that collects answers)."),
107316
+ kind: external_exports.enum(["picture", "logo", "website", "app", "video", "presentation", "assistant", "research", "data", "game", "skin", "project", "writing", "postcard", "social", "photo", "remote", "network", "spreadsheet", "pdf", "diagram", "drawing", "font", "audio", "motion", "wireframe", "invoice", "newsletter", "form", "comic"]).describe("What to make: picture, logo (a brand: symbol, name in type, colours), website, app (a mobile app), video, presentation, assistant (a personal assistant), research (a deep research report), data (an analysis of data), game (a browser game played right here, or a Unity, Unreal or Godot project), skin (a look for the Tesseract app itself), project (a new project folder with the name given, set up the way the person describes), writing (an email, a letter, a blog post, a CV \u2014 drafted with them in a document they edit), postcard (a picture and their words, both sides, to print or send), social (social media posts: a picture and a caption for each platform, ready to schedule), photo (their own photo enhanced: restored, brightened, sharpened, colourised, made bigger, the background removed \u2014 picture is for a new picture), remote (Remote Desktop: connect to one of the person's own computers, to someone else's by ID and password, a one-time code or asking them by email, or let someone reach this computer \u2014 the person presses anything that opens it), network (a private network for their devices, home or office: made, then devices added; its token and secret stay on the person's screen), spreadsheet (a budget, tracker, schedule, invoice list or inventory \u2014 or their own data \u2014 made into a workbook with formulas, totals and a chart), pdf (fill in and sign a PDF they have, turn a document, pictures or a web page into a PDF, or make a form people can fill), diagram (a flowchart, org chart, timeline, mind map or sequence diagram, drawn from Mermaid they can edit), drawing (an illustration, an icon or poster art drawn in the vector editor), font (an original typeface: its letters drawn by AI from what it is for and its look or a font to start from, then opened in the font editor), audio (a podcast episode, voice-over, narration, a recording cleaned up or a short music edit \u2014 from their recording, finished in the audio editor, or a script voiced with music on a timeline), motion (an animated title, a lower third, a logo reveal or a short animated explainer, built in the motion editor and exportable to video), wireframe (low-fidelity grayscale screens of a web page or an app linked into a clickable flow, edited by hand in the card \u2014 or a blank canvas to build on with pictures to work from; can be handed to the website, app or project maker as its brief), invoice (an invoice to a customer \u2014 lines, tax, due date, payment details \u2014 made as a Word document with its PDF), newsletter (an email newsletter planned, researched where needed and laid out as email-safe HTML), form (a form or survey with questions of every kind, made as a fillable PDF and a web page that collects answers), comic (a comic, a manga or a webtoon)."),
107317
107317
  about: external_exports.string().optional().describe("What the person said they want, in their own words and language \u2014 given to the maker as the answer to its first question. Leave it out to let the maker ask.")
107318
107318
  }),
107319
107319
  mutation: "write",
@@ -323993,14 +323993,14 @@ function tapTelemetry(msg2, origin2, accountOf3, engineOf2 = () => "") {
323993
323993
  } else if (m.type === "chat:error") {
323994
323994
  if (failures.size > 200)
323995
323995
  failures.clear();
323996
- failures.set(m.sessionId ?? "", {
323996
+ failures.set(failureKey(m), {
323997
323997
  kind: m.restricted ? "refused" : m.transient ? "connection" : m.continuable ? "limit" : "failed",
323998
323998
  reason: classifyError(m.error ?? ""),
323999
323999
  ...m.clientRequestId ? { turn: m.clientRequestId } : {}
324000
324000
  });
324001
324001
  } else if (m.type === "agent:status" && m.status === "error") {
324002
- const failure2 = failures.get(m.sessionId ?? "");
324003
- failures.delete(m.sessionId ?? "");
324002
+ const failure2 = failures.get(failureKey(m));
324003
+ failures.delete(failureKey(m));
324004
324004
  let engine = "";
324005
324005
  try {
324006
324006
  engine = engineOf2(m.sessionId);
@@ -324071,7 +324071,7 @@ function wireTelemetryIpc(ipc) {
324071
324071
  trackTelemetry(name, props && typeof props === "object" ? props : void 0, typeof sessionId === "string" && sessionId ? { sessionId } : void 0);
324072
324072
  });
324073
324073
  }
324074
- var FLUSH_INTERVAL_MS, CONSENT_RECHECK_MS, BATCH_MAX, MAX_QUEUE, MAX_BACKOFF_MS, SEND_TIMEOUT_MS, sink3, extensionOrigins, failures, processCollector;
324074
+ var FLUSH_INTERVAL_MS, CONSENT_RECHECK_MS, BATCH_MAX, MAX_QUEUE, MAX_BACKOFF_MS, SEND_TIMEOUT_MS, sink3, extensionOrigins, failures, failureKey, processCollector;
324075
324075
  var init_telemetry2 = __esm({
324076
324076
  "../../packages/host-core/dist/telemetry.js"() {
324077
324077
  "use strict";
@@ -324090,6 +324090,7 @@ var init_telemetry2 = __esm({
324090
324090
  sink3 = null;
324091
324091
  extensionOrigins = /* @__PURE__ */ new Set();
324092
324092
  failures = /* @__PURE__ */ new Map();
324093
+ failureKey = (m) => m.sessionId || (m.clientRequestId ? `req:${m.clientRequestId}` : "");
324093
324094
  processCollector = null;
324094
324095
  }
324095
324096
  });
@@ -359995,7 +359996,8 @@ var init_os_favorites = __esm({
359995
359996
 
359996
359997
  // ../../packages/host-core/dist/conditional-file.js
359997
359998
  import { chmod as chmod6, mkdir as mkdir14, open as open12, readFile as readFile11, rename as rename10, rm as rm11, rmdir as rmdir4, stat as stat19, unlink as unlink7, writeFile as writeFile10 } from "node:fs/promises";
359998
- import { randomUUID as randomUUID70 } from "node:crypto";
359999
+ import { createReadStream as createReadStream4 } from "node:fs";
360000
+ import { createHash as createHash43, randomUUID as randomUUID70 } from "node:crypto";
359999
360001
  import { hostname as hostname6 } from "node:os";
360000
360002
  import { dirname as dirname83, join as join198 } from "node:path";
360001
360003
  function pidAlive2(pid) {
@@ -360103,6 +360105,77 @@ async function conditionalWriteText(path15, content, expected, limit5 = LIMIT) {
360103
360105
  }
360104
360106
  }
360105
360107
  }
360108
+ async function digestOf(path15) {
360109
+ let meta5;
360110
+ try {
360111
+ meta5 = await stat19(path15);
360112
+ } catch (error51) {
360113
+ if (isMissing(error51))
360114
+ return null;
360115
+ throw error51;
360116
+ }
360117
+ if (!meta5.isFile())
360118
+ throw new Error("Conditional target is not a regular file.");
360119
+ const hash3 = createHash43("sha256");
360120
+ for await (const chunk of createReadStream4(path15))
360121
+ hash3.update(chunk);
360122
+ return { digest: hash3.digest("hex"), identity: `${meta5.dev}:${meta5.ino}:${meta5.size}:${meta5.mtimeMs}:${meta5.ctimeMs}`, mode: meta5.mode & 4095 };
360123
+ }
360124
+ async function conditionalReplaceFile(path15, part, expected) {
360125
+ if (expected !== null && (typeof expected !== "string" || !/^[0-9a-f]{64}$/.test(expected)))
360126
+ return { ok: false, error: "Invalid conditional-write baseline." };
360127
+ if (dirname83(part) !== dirname83(path15))
360128
+ return { ok: false, error: "The new file must be beside the one it replaces." };
360129
+ const lock = `${path15}.tess-write-lock`, token4 = randomUUID70();
360130
+ let locked = false, moved = false;
360131
+ try {
360132
+ for (let attempt = 0; !locked; attempt++) {
360133
+ try {
360134
+ await mkdir14(lock);
360135
+ locked = true;
360136
+ } catch (error51) {
360137
+ if (error51.code !== "EEXIST")
360138
+ throw error51;
360139
+ if (await clearStaleLock(lock))
360140
+ continue;
360141
+ if (attempt >= 20)
360142
+ return { ok: false, conflict: true, error: "Another window is saving this file. Try again in a moment." };
360143
+ await sleep9(50);
360144
+ }
360145
+ }
360146
+ await writeFile10(join198(lock, "owner.json"), JSON.stringify({ pid: process.pid, host: hostname6(), at: Date.now(), token: token4 }));
360147
+ const before2 = await digestOf(path15);
360148
+ if ((before2?.digest ?? null) !== expected)
360149
+ return { ok: false, conflict: true, error: "File changed since it was read." };
360150
+ const meta5 = await stat19(part);
360151
+ if (!meta5.isFile())
360152
+ return { ok: false, error: "The new file is not a file." };
360153
+ if (before2)
360154
+ await chmod6(part, before2.mode);
360155
+ const now2 = await stat19(path15).catch((error51) => {
360156
+ if (isMissing(error51))
360157
+ return null;
360158
+ throw error51;
360159
+ });
360160
+ if ((now2 ? `${now2.dev}:${now2.ino}:${now2.size}:${now2.mtimeMs}:${now2.ctimeMs}` : null) !== (before2?.identity ?? null))
360161
+ return { ok: false, conflict: true, error: "File changed while the replacement was prepared." };
360162
+ await rename10(part, path15);
360163
+ moved = true;
360164
+ return { ok: true, identity: `${meta5.size}:${meta5.mtimeMs}` };
360165
+ } catch (error51) {
360166
+ return { ok: false, error: String(error51.message ?? error51) };
360167
+ } finally {
360168
+ if (!moved)
360169
+ await unlink7(part).catch(() => void 0);
360170
+ if (locked) {
360171
+ const owner = await readFile11(join198(lock, "owner.json"), "utf8").catch(() => "");
360172
+ if (owner.includes(token4))
360173
+ await rm11(lock, { recursive: true, force: true }).catch(() => void 0);
360174
+ else if (!owner)
360175
+ await rmdir4(lock).catch(() => void 0);
360176
+ }
360177
+ }
360178
+ }
360106
360179
  var LIMIT, STALE_MS3, isMissing, sleep9;
360107
360180
  var init_conditional_file = __esm({
360108
360181
  "../../packages/host-core/dist/conditional-file.js"() {
@@ -364884,7 +364957,7 @@ var init_types16 = __esm({
364884
364957
  // ../../packages/host-core/dist/vfs/http-client.js
364885
364958
  import { Agent as HttpAgent, request as httpRequest4 } from "node:http";
364886
364959
  import { Agent as HttpsAgent, request as httpsRequest2 } from "node:https";
364887
- import { createHash as createHash43, randomBytes as randomBytes30 } from "node:crypto";
364960
+ import { createHash as createHash44, randomBytes as randomBytes30 } from "node:crypto";
364888
364961
  async function readText3(res, cap2 = 32 * 1024 * 1024) {
364889
364962
  const chunks3 = [];
364890
364963
  let n2 = 0;
@@ -364999,8 +365072,8 @@ var init_http_client = __esm({
364999
365072
  this.agent.destroy();
365000
365073
  }
365001
365074
  };
365002
- md52 = (s) => createHash43("md5").update(s).digest("hex");
365003
- sha2563 = (s) => createHash43("sha256").update(s).digest("hex");
365075
+ md52 = (s) => createHash44("md5").update(s).digest("hex");
365076
+ sha2563 = (s) => createHash44("sha256").update(s).digest("hex");
365004
365077
  Authenticator = class {
365005
365078
  login;
365006
365079
  digest = null;
@@ -371568,7 +371641,7 @@ var require_keyParser = __commonJS({
371568
371641
  var {
371569
371642
  createDecipheriv: createDecipheriv2,
371570
371643
  createECDH,
371571
- createHash: createHash88,
371644
+ createHash: createHash89,
371572
371645
  createHmac: createHmac9,
371573
371646
  createSign: createSign2,
371574
371647
  createVerify,
@@ -372256,11 +372329,11 @@ ${formatted}-----END ${type2} KEY-----`;
372256
372329
  );
372257
372330
  }
372258
372331
  const ivSlice = bufferSlice(cipherIV, 0, 8);
372259
- let cipherKey = createHash88("md5").update(passphrase).update(ivSlice).digest();
372332
+ let cipherKey = createHash89("md5").update(passphrase).update(ivSlice).digest();
372260
372333
  while (cipherKey.length < encInfo.keyLen) {
372261
372334
  cipherKey = combineBuffers(
372262
372335
  cipherKey,
372263
- createHash88("md5").update(cipherKey).update(passphrase).update(ivSlice).digest()
372336
+ createHash89("md5").update(cipherKey).update(passphrase).update(ivSlice).digest()
372264
372337
  );
372265
372338
  }
372266
372339
  if (cipherKey.length > encInfo.keyLen)
@@ -372425,8 +372498,8 @@ ${formatted}-----END ${type2} KEY-----`;
372425
372498
  if (encrypted) {
372426
372499
  const encInfo = CIPHER_INFO[cipherName];
372427
372500
  let cipherKey = combineBuffers(
372428
- createHash88("sha1").update(PPK_PP1).update(passphrase).digest(),
372429
- createHash88("sha1").update(PPK_PP2).update(passphrase).digest()
372501
+ createHash89("sha1").update(PPK_PP1).update(passphrase).digest(),
372502
+ createHash89("sha1").update(PPK_PP2).update(passphrase).digest()
372430
372503
  );
372431
372504
  if (cipherKey.length > encInfo.keyLen)
372432
372505
  cipherKey = bufferSlice(cipherKey, 0, encInfo.keyLen);
@@ -372466,7 +372539,7 @@ ${formatted}-----END ${type2} KEY-----`;
372466
372539
  passphrase = EMPTY_PASSPHRASE;
372467
372540
  const calcMAC = createHmac9(
372468
372541
  "sha1",
372469
- createHash88("sha1").update("putty-private-key-file-mac-key").update(passphrase).digest()
372542
+ createHash89("sha1").update("putty-private-key-file-mac-key").update(passphrase).digest()
372470
372543
  ).update(macData).digest("hex");
372471
372544
  if (calcMAC !== mac3) {
372472
372545
  if (encrypted) {
@@ -374788,7 +374861,7 @@ var require_kex = __commonJS({
374788
374861
  createDiffieHellman,
374789
374862
  createDiffieHellmanGroup,
374790
374863
  createECDH,
374791
- createHash: createHash88,
374864
+ createHash: createHash89,
374792
374865
  createPublicKey: createPublicKey5,
374793
374866
  diffieHellman: diffieHellman2,
374794
374867
  generateKeyPairSync: generateKeyPairSync2,
@@ -375214,7 +375287,7 @@ var require_kex = __commonJS({
375214
375287
  DISCONNECT_REASON.KEY_EXCHANGE_FAILED
375215
375288
  );
375216
375289
  }
375217
- const hash3 = createHash88(this.hashName);
375290
+ const hash3 = createHash89(this.hashName);
375218
375291
  hashString2(hash3, isServer ? this._remoteIdentRaw : this._identRaw);
375219
375292
  hashString2(hash3, isServer ? this._identRaw : this._remoteIdentRaw);
375220
375293
  hashString2(hash3, isServer ? this._remoteKexinit : this._kexinit);
@@ -376222,9 +376295,9 @@ var require_kex = __commonJS({
376222
376295
  function generateKEXVal(len2, hashName, secret, exchangeHash, sessionID, char) {
376223
376296
  let ret;
376224
376297
  if (len2) {
376225
- let digest2 = createHash88(hashName).update(secret).update(exchangeHash).update(char).update(sessionID).digest();
376298
+ let digest2 = createHash89(hashName).update(secret).update(exchangeHash).update(char).update(sessionID).digest();
376226
376299
  while (digest2.length < len2) {
376227
- const chunk = createHash88(hashName).update(secret).update(exchangeHash).update(digest2).digest();
376300
+ const chunk = createHash89(hashName).update(secret).update(exchangeHash).update(digest2).digest();
376228
376301
  const extended = Buffer.allocUnsafe(digest2.length + chunk.length);
376229
376302
  extended.set(digest2, 0);
376230
376303
  extended.set(chunk, digest2.length);
@@ -381659,7 +381732,7 @@ var require_client = __commonJS({
381659
381732
  "../../node_modules/ssh2/lib/client.js"(exports2, module) {
381660
381733
  "use strict";
381661
381734
  var {
381662
- createHash: createHash88,
381735
+ createHash: createHash89,
381663
381736
  getHashes,
381664
381737
  randomFillSync
381665
381738
  } = __require("crypto");
@@ -381881,7 +381954,7 @@ var require_client = __commonJS({
381881
381954
  }
381882
381955
  hostVerifier = (key7, verify5) => {
381883
381956
  if (hashAlgo)
381884
- key7 = createHash88(hashAlgo).update(key7).digest("hex");
381957
+ key7 = createHash89(hashAlgo).update(key7).digest("hex");
381885
381958
  const ret = hashCb(key7, verify5);
381886
381959
  if (ret !== void 0)
381887
381960
  verify5(ret);
@@ -385182,7 +385255,7 @@ var require_lib7 = __commonJS({
385182
385255
  });
385183
385256
 
385184
385257
  // ../../packages/host-core/dist/vfs/secrets.js
385185
- import { createHash as createHash44 } from "node:crypto";
385258
+ import { createHash as createHash45 } from "node:crypto";
385186
385259
  import { existsSync as existsSync97, readFileSync as readFileSync49, renameSync as renameSync25, rmSync as rmSync17 } from "node:fs";
385187
385260
  import { join as join201 } from "node:path";
385188
385261
  function setVfsVault(v) {
@@ -385301,7 +385374,7 @@ async function describeKey(privateKey, passphrase) {
385301
385374
  const pub2 = k.getPublicSSH();
385302
385375
  return {
385303
385376
  publicKey: `${k.type} ${pub2.toString("base64")}`,
385304
- fingerprint: `SHA256:${createHash44("sha256").update(pub2).digest("base64").replace(/=+$/, "")}`,
385377
+ fingerprint: `SHA256:${createHash45("sha256").update(pub2).digest("base64").replace(/=+$/, "")}`,
385305
385378
  keyType: k.type.startsWith("ecdsa") ? "ecdsa" : k.type.replace(/^ssh-/, "")
385306
385379
  };
385307
385380
  } catch {
@@ -385539,7 +385612,7 @@ var init_secrets2 = __esm({
385539
385612
  });
385540
385613
 
385541
385614
  // ../../packages/host-core/dist/vfs/s3.js
385542
- import { createHash as createHash45, createHmac as createHmac3 } from "node:crypto";
385615
+ import { createHash as createHash46, createHmac as createHmac3 } from "node:crypto";
385543
385616
  import { mkdirSync as mkdirSync40, readFileSync as readFileSync50, rmSync as rmSync18, writeFileSync as writeFileSync35 } from "node:fs";
385544
385617
  import { join as join202, posix as posix4 } from "node:path";
385545
385618
  import { Readable as Readable3 } from "node:stream";
@@ -385638,10 +385711,10 @@ var init_s3 = __esm({
385638
385711
  init_http_client();
385639
385712
  init_secrets2();
385640
385713
  init_types16();
385641
- EMPTY_SHA = createHash45("sha256").update("").digest("hex");
385714
+ EMPTY_SHA = createHash46("sha256").update("").digest("hex");
385642
385715
  PART_SIZE = 16 * 1024 * 1024;
385643
385716
  PENDING_MAX_AGE_MS = 7 * 24 * 3600 * 1e3;
385644
- recordFile2 = (endpoint5, bucket2, key7) => join202(vfsDataDir(), "uploads", createHash45("sha256").update(`s3
385717
+ recordFile2 = (endpoint5, bucket2, key7) => join202(vfsDataDir(), "uploads", createHash46("sha256").update(`s3
385645
385718
  ${endpoint5}
385646
385719
  ${bucket2}
385647
385720
  ${key7}`).digest("hex").slice(0, 32) + ".json");
@@ -385658,7 +385731,7 @@ ${key7}`).digest("hex").slice(0, 32) + ".json");
385658
385731
  isArray: (name) => ["Bucket", "Contents", "CommonPrefixes", "Part"].includes(name)
385659
385732
  });
385660
385733
  hmac2 = (key7, data3) => createHmac3("sha256", key7).update(data3).digest();
385661
- sha256hex = (data3) => createHash45("sha256").update(data3).digest("hex");
385734
+ sha256hex = (data3) => createHash46("sha256").update(data3).digest("hex");
385662
385735
  S3Session = class {
385663
385736
  u;
385664
385737
  keys;
@@ -386079,7 +386152,7 @@ ${key7}`).digest("hex").slice(0, 32) + ".json");
386079
386152
  });
386080
386153
 
386081
386154
  // ../../packages/host-core/dist/vfs/azure.js
386082
- import { createHash as createHash46, createHmac as createHmac4, randomBytes as randomBytes31 } from "node:crypto";
386155
+ import { createHash as createHash47, createHmac as createHmac4, randomBytes as randomBytes31 } from "node:crypto";
386083
386156
  import { posix as posix5 } from "node:path";
386084
386157
  import { Readable as Readable4 } from "node:stream";
386085
386158
  function sharedKeyAuthorization(i) {
@@ -386301,7 +386374,7 @@ var init_azure3 = __esm({
386301
386374
  * and the upload continues after them. Ids within a blob must all be the same length.
386302
386375
  */
386303
386376
  blockId(path15, size2, mtimeMs, ix, random2) {
386304
- const token4 = random2 ?? createHash46("sha256").update(`${path15}
386377
+ const token4 = random2 ?? createHash47("sha256").update(`${path15}
386305
386378
  ${size2}
386306
386379
  ${mtimeMs ?? ""}`).digest("hex").slice(0, 16);
386307
386380
  return Buffer.from(`${token4}-${String(ix).padStart(6, "0")}`).toString("base64");
@@ -386446,7 +386519,7 @@ ${mtimeMs ?? ""}`).digest("hex").slice(0, 16);
386446
386519
  });
386447
386520
 
386448
386521
  // ../../packages/host-core/dist/vfs/oauth.js
386449
- import { createHash as createHash47, randomBytes as randomBytes32 } from "node:crypto";
386522
+ import { createHash as createHash48, randomBytes as randomBytes32 } from "node:crypto";
386450
386523
  import { createServer as createServer11 } from "node:http";
386451
386524
  async function getJson5(url2, token4, init = {}) {
386452
386525
  const res = await fetch(url2, { method: init.method ?? "GET", headers: { authorization: `Bearer ${token4}`, ...init.headers ?? {} }, body: init.body });
@@ -386505,7 +386578,7 @@ async function signInToCloud(protocol, opts) {
386505
386578
  if (!p.clientId)
386506
386579
  throw new VfsError("unsupported", `${p.label} sign-in isn't set up in this version yet.`);
386507
386580
  const verifier = b64url3(randomBytes32(48));
386508
- const challenge = b64url3(createHash47("sha256").update(verifier).digest());
386581
+ const challenge = b64url3(createHash48("sha256").update(verifier).digest());
386509
386582
  const state6 = b64url3(randomBytes32(18));
386510
386583
  const { server: server3, port } = await listen2(p);
386511
386584
  const path15 = p.redirectPath ?? "/callback";
@@ -386765,7 +386838,7 @@ __export(webdav_exports, {
386765
386838
  skipBytes: () => skipBytes,
386766
386839
  webdavDriver: () => webdavDriver
386767
386840
  });
386768
- import { createHash as createHash48 } from "node:crypto";
386841
+ import { createHash as createHash49 } from "node:crypto";
386769
386842
  import { posix as posix6 } from "node:path";
386770
386843
  import { Readable as Readable5, Transform } from "node:stream";
386771
386844
  function originOf(u) {
@@ -387114,7 +387187,7 @@ var init_webdav = __esm({
387114
387187
  return `${this.origin}/remote.php/dav/uploads/${encodeURIComponent(this.u.user ?? "")}/${id2}/${name ? encodeURIComponent(name) : ""}`;
387115
387188
  }
387116
387189
  uploadId(path15, size2, mtimeMs) {
387117
- return "tess-" + createHash48("sha256").update(`${path15}
387190
+ return "tess-" + createHash49("sha256").update(`${path15}
387118
387191
  ${size2}
387119
387192
  ${mtimeMs ?? ""}`).digest("hex").slice(0, 24);
387120
387193
  }
@@ -387314,7 +387387,7 @@ ${mtimeMs ?? ""}`).digest("hex").slice(0, 24);
387314
387387
  });
387315
387388
 
387316
387389
  // ../../packages/host-core/dist/vfs/dropbox.js
387317
- import { createHash as createHash49 } from "node:crypto";
387390
+ import { createHash as createHash50 } from "node:crypto";
387318
387391
  import { mkdirSync as mkdirSync41, readFileSync as readFileSync51, rmSync as rmSync19, writeFileSync as writeFileSync36 } from "node:fs";
387319
387392
  import { join as join203, posix as posix7 } from "node:path";
387320
387393
  import { Readable as Readable6 } from "node:stream";
@@ -387432,7 +387505,7 @@ var init_dropbox = __esm({
387432
387505
  }
387433
387506
  // ── uploads ──────────────────────────────────────────────────────────────────────
387434
387507
  recordFile(path15) {
387435
- return join203(vfsDataDir(), "uploads", createHash49("sha256").update(`dropbox
387508
+ return join203(vfsDataDir(), "uploads", createHash50("sha256").update(`dropbox
387436
387509
  ${this.connKey}
387437
387510
  ${path15.toLowerCase()}`).digest("hex").slice(0, 32) + ".json");
387438
387511
  }
@@ -390379,7 +390452,7 @@ var init_ftp = __esm({
390379
390452
  });
390380
390453
 
390381
390454
  // ../../packages/host-core/dist/vfs/googledrive.js
390382
- import { createHash as createHash50 } from "node:crypto";
390455
+ import { createHash as createHash51 } from "node:crypto";
390383
390456
  import { mkdirSync as mkdirSync42, readFileSync as readFileSync52, rmSync as rmSync20, writeFileSync as writeFileSync37 } from "node:fs";
390384
390457
  import { join as join204, posix as posix10 } from "node:path";
390385
390458
  function nodeOf(f3) {
@@ -390640,7 +390713,7 @@ var init_googledrive = __esm({
390640
390713
  }
390641
390714
  // ── uploads ──────────────────────────────────────────────────────────────────────
390642
390715
  recordFile(path15) {
390643
- return join204(vfsDataDir(), "uploads", createHash50("sha256").update(`googledrive
390716
+ return join204(vfsDataDir(), "uploads", createHash51("sha256").update(`googledrive
390644
390717
  ${this.connKey}
390645
390718
  ${path15}`).digest("hex").slice(0, 32) + ".json");
390646
390719
  }
@@ -390803,7 +390876,7 @@ ${path15}`).digest("hex").slice(0, 32) + ".json");
390803
390876
  });
390804
390877
 
390805
390878
  // ../../packages/host-core/dist/vfs/irods.js
390806
- import { createHash as createHash51, randomBytes as randomBytes33 } from "node:crypto";
390879
+ import { createHash as createHash52, randomBytes as randomBytes33 } from "node:crypto";
390807
390880
  import { connect as netConnect3, isIP as isIP2 } from "node:net";
390808
390881
  import { posix as posix11 } from "node:path";
390809
390882
  import { Readable as Readable8 } from "node:stream";
@@ -390850,7 +390923,7 @@ function header3(type2, msgLen, errorLen, bsLen, intInfo) {
390850
390923
  function challengeDigest(challenge, password) {
390851
390924
  const pw = Buffer.alloc(MAX_PASSWORD);
390852
390925
  Buffer.from(password.replace(/^[\t\n\v\f\r ]+|[\t\n\v\f\r ]+$/g, ""), "utf-8").copy(pw, 0, 0, MAX_PASSWORD);
390853
- const d = createHash51("md5").update(challenge).update(pw).digest();
390926
+ const d = createHash52("md5").update(challenge).update(pw).digest();
390854
390927
  for (let i = 0; i < d.length; i++)
390855
390928
  if (d[i] === 0)
390856
390929
  d[i] = 1;
@@ -391482,7 +391555,7 @@ var init_irods = __esm({
391482
391555
  });
391483
391556
 
391484
391557
  // ../../packages/host-core/dist/vfs/onedrive.js
391485
- import { createHash as createHash52 } from "node:crypto";
391558
+ import { createHash as createHash53 } from "node:crypto";
391486
391559
  import { mkdirSync as mkdirSync43, readFileSync as readFileSync53, rmSync as rmSync21, writeFileSync as writeFileSync38 } from "node:fs";
391487
391560
  import { join as join205, posix as posix12 } from "node:path";
391488
391561
  import { Readable as Readable9 } from "node:stream";
@@ -391609,7 +391682,7 @@ var init_onedrive = __esm({
391609
391682
  }
391610
391683
  // ── uploads ──────────────────────────────────────────────────────────────────────
391611
391684
  recordFile(path15) {
391612
- return join205(vfsDataDir(), "uploads", createHash52("sha256").update(`onedrive
391685
+ return join205(vfsDataDir(), "uploads", createHash53("sha256").update(`onedrive
391613
391686
  ${this.connKey}
391614
391687
  ${path15}`).digest("hex").slice(0, 32) + ".json");
391615
391688
  }
@@ -391909,7 +391982,7 @@ var init_registry6 = __esm({
391909
391982
  });
391910
391983
 
391911
391984
  // ../../packages/host-core/dist/ssh/ssh-connect.js
391912
- import { createHash as createHash53 } from "node:crypto";
391985
+ import { createHash as createHash54 } from "node:crypto";
391913
391986
  import { existsSync as existsSync98, mkdirSync as mkdirSync44, readFileSync as readFileSync54, renameSync as renameSync26, writeFileSync as writeFileSync39 } from "node:fs";
391914
391987
  import { homedir as homedir48 } from "node:os";
391915
391988
  import { join as join206 } from "node:path";
@@ -391988,7 +392061,7 @@ function forgetHostKey(host3, port) {
391988
392061
  }
391989
392062
  }
391990
392063
  function hostKeyFingerprint(key7) {
391991
- return "SHA256:" + createHash53("sha256").update(key7).digest("base64").replace(/=+$/, "");
392064
+ return "SHA256:" + createHash54("sha256").update(key7).digest("base64").replace(/=+$/, "");
391992
392065
  }
391993
392066
  function loadKey(file8) {
391994
392067
  try {
@@ -392310,7 +392383,7 @@ var init_sftp = __esm({
392310
392383
  });
392311
392384
 
392312
392385
  // ../../packages/host-core/dist/vfs/local.js
392313
- import { createReadStream as createReadStream4, createWriteStream as createWriteStream4 } from "node:fs";
392386
+ import { createReadStream as createReadStream5, createWriteStream as createWriteStream4 } from "node:fs";
392314
392387
  import { chmod as chmod7, copyFile as copyFile4, lstat as lstat8, mkdir as mkdir15, readdir as readdir14, readlink as readlink2, rename as rename11, rmdir as rmdir5, stat as stat20, symlink as symlink3, unlink as unlink8, utimes as utimes3 } from "node:fs/promises";
392315
392388
  import { dirname as dirname85, join as join207 } from "node:path";
392316
392389
  import { pipeline as pipeline3 } from "node:stream/promises";
@@ -392381,7 +392454,7 @@ var init_local2 = __esm({
392381
392454
  } catch (e) {
392382
392455
  throw mapErr(e, path15);
392383
392456
  }
392384
- return createReadStream4(path15, { start: opts?.start ?? 0 });
392457
+ return createReadStream5(path15, { start: opts?.start ?? 0 });
392385
392458
  },
392386
392459
  async write(path15, source3, opts) {
392387
392460
  const start7 = opts?.start ?? 0;
@@ -392450,7 +392523,7 @@ var init_local2 = __esm({
392450
392523
 
392451
392524
  // ../../packages/host-core/dist/vfs/smb.js
392452
392525
  import { spawn as spawn20 } from "node:child_process";
392453
- import { createHash as createHash54 } from "node:crypto";
392526
+ import { createHash as createHash55 } from "node:crypto";
392454
392527
  import { existsSync as existsSync99, mkdirSync as mkdirSync45, readdirSync as readdirSync19, realpathSync as realpathSync8 } from "node:fs";
392455
392528
  import { join as join208, posix as posix14, win32 as win325 } from "node:path";
392456
392529
  function run9(cmd3, args, input, timeoutMs = 3e4) {
@@ -392549,7 +392622,7 @@ var init_smb = __esm({
392549
392622
  encSmb = (s) => encodeURIComponent(s);
392550
392623
  macMounter = {
392551
392624
  async mount(u, share, secret) {
392552
- const root = join208(vfsDataDir(), "mnt", createHash54("sha256").update(`${u.host}
392625
+ const root = join208(vfsDataDir(), "mnt", createHash55("sha256").update(`${u.host}
392553
392626
  ${u.port ?? ""}
392554
392627
  ${u.domain ?? ""}
392555
392628
  ${u.user ?? ""}
@@ -393451,7 +393524,7 @@ var init_swift = __esm({
393451
393524
  });
393452
393525
 
393453
393526
  // ../../packages/host-core/dist/vfs/transfer.js
393454
- import { createHash as createHash55 } from "node:crypto";
393527
+ import { createHash as createHash56 } from "node:crypto";
393455
393528
  import { mkdirSync as mkdirSync46, readFileSync as readFileSync55, rmSync as rmSync22, writeFileSync as writeFileSync40 } from "node:fs";
393456
393529
  import { join as joinLocal } from "node:path";
393457
393530
  import { posix as posix17 } from "node:path";
@@ -393695,7 +393768,7 @@ var init_transfer = __esm({
393695
393768
  }
393696
393769
  };
393697
393770
  journalDir = () => joinLocal(vfsDataDir(), "transfers");
393698
- journalFile = (op2, src, destDir) => joinLocal(journalDir(), createHash55("sha256").update(`${op2}
393771
+ journalFile = (op2, src, destDir) => joinLocal(journalDir(), createHash56("sha256").update(`${op2}
393699
393772
  ${src}
393700
393773
  ${destDir}`).digest("hex").slice(0, 32) + ".json");
393701
393774
  }
@@ -394796,6 +394869,15 @@ async function runRemoteFsOp(root, op2, args, quotaKey) {
394796
394869
  return OUTSIDE("rename");
394797
394870
  const newPath = join210(dirname86(oldPath), newName);
394798
394871
  const caseOnlyRename = newPath.toLowerCase() === oldPath.toLowerCase() && newPath !== oldPath;
394872
+ const options = a[2];
394873
+ if (options && Object.hasOwn(options, "expectedSha256")) {
394874
+ if (options.expectedSha256 !== null && typeof options.expectedSha256 !== "string")
394875
+ return { ok: false, error: "Invalid conditional-write baseline." };
394876
+ const real4 = await safeContentPath(newPath), part = await safeContentPath(oldPath);
394877
+ if (!real4 || !part)
394878
+ return OUTSIDE("rename");
394879
+ return inFolder2(dirname86(oldPath), async () => ({ ...await conditionalReplaceFile(real4, part, options.expectedSha256), newPath }));
394880
+ }
394799
394881
  return inFolder2(dirname86(oldPath), async () => {
394800
394882
  if (!caseOnlyRename && await exists3(newPath)) {
394801
394883
  let targetIsDir = false;
@@ -395434,7 +395516,7 @@ var init_fs_datachannel_host = __esm({
395434
395516
  });
395435
395517
 
395436
395518
  // ../../packages/host-core/dist/active-link/paths.js
395437
- import { createHash as createHash56 } from "node:crypto";
395519
+ import { createHash as createHash57 } from "node:crypto";
395438
395520
  import { realpathSync as realpathSync9 } from "node:fs";
395439
395521
  import { join as join211, relative as relative27, sep as sep39 } from "node:path";
395440
395522
  function activeLinkEnabled() {
@@ -395461,7 +395543,7 @@ function suggestLinkId(localRoot) {
395461
395543
  canon2 = realpathSync9.native(localRoot);
395462
395544
  } catch {
395463
395545
  }
395464
- return createHash56("sha256").update(canon2).digest("hex").slice(0, 16);
395546
+ return createHash57("sha256").update(canon2).digest("hex").slice(0, 16);
395465
395547
  }
395466
395548
  function activeLinkRoot() {
395467
395549
  return process.env.CCB_ACTIVE_LINK_DIR ?? tessPath("active-link");
@@ -416536,20 +416618,20 @@ var init_host_name = __esm({
416536
416618
  });
416537
416619
 
416538
416620
  // ../../packages/host-core/dist/active-link/blocks.js
416539
- import { createHash as createHash57 } from "node:crypto";
416540
- import { createReadStream as createReadStream5 } from "node:fs";
416621
+ import { createHash as createHash58 } from "node:crypto";
416622
+ import { createReadStream as createReadStream6 } from "node:fs";
416541
416623
  import { open as open14, mkdir as mkdir18, rename as rename13, chmod as chmod9, utimes as utimes5, unlink as unlink9 } from "node:fs/promises";
416542
416624
  import { dirname as dirname89 } from "node:path";
416543
416625
  function hashBytes(buf) {
416544
- return createHash57("sha256").update(buf).digest("hex");
416626
+ return createHash58("sha256").update(buf).digest("hex");
416545
416627
  }
416546
416628
  function hashString(s) {
416547
- return createHash57("sha256").update(s, "utf-8").digest("hex");
416629
+ return createHash58("sha256").update(s, "utf-8").digest("hex");
416548
416630
  }
416549
416631
  function hashFile2(abs) {
416550
416632
  return new Promise((resolve64, reject) => {
416551
- const h = createHash57("sha256");
416552
- const rs = createReadStream5(abs);
416633
+ const h = createHash58("sha256");
416634
+ const rs = createReadStream6(abs);
416553
416635
  rs.on("data", (d) => h.update(d));
416554
416636
  rs.on("end", () => resolve64(h.digest("hex")));
416555
416637
  rs.on("error", reject);
@@ -416557,12 +416639,12 @@ function hashFile2(abs) {
416557
416639
  }
416558
416640
  function hashFileBlocks(abs) {
416559
416641
  return new Promise((resolve64, reject) => {
416560
- const whole = createHash57("sha256");
416642
+ const whole = createHash58("sha256");
416561
416643
  const blocks2 = [];
416562
- let cur = createHash57("sha256");
416644
+ let cur = createHash58("sha256");
416563
416645
  let curLen = 0;
416564
416646
  let size2 = 0;
416565
- const rs = createReadStream5(abs, { highWaterMark: 256 * 1024 });
416647
+ const rs = createReadStream6(abs, { highWaterMark: 256 * 1024 });
416566
416648
  rs.on("data", (chunk) => {
416567
416649
  const d = chunk;
416568
416650
  whole.update(d);
@@ -416575,7 +416657,7 @@ function hashFileBlocks(abs) {
416575
416657
  off += take;
416576
416658
  if (curLen === CHUNK5) {
416577
416659
  blocks2.push(cur.digest("hex"));
416578
- cur = createHash57("sha256");
416660
+ cur = createHash58("sha256");
416579
416661
  curLen = 0;
416580
416662
  }
416581
416663
  }
@@ -416662,9 +416744,9 @@ var init_blocks = __esm({
416662
416744
  stagingPath;
416663
416745
  fh = null;
416664
416746
  bytes = 0;
416665
- whole = createHash57("sha256");
416747
+ whole = createHash58("sha256");
416666
416748
  blocks = [];
416667
- cur = createHash57("sha256");
416749
+ cur = createHash58("sha256");
416668
416750
  curLen = 0;
416669
416751
  constructor(stagingPath) {
416670
416752
  this.stagingPath = stagingPath;
@@ -416689,7 +416771,7 @@ var init_blocks = __esm({
416689
416771
  off += take;
416690
416772
  if (this.curLen === CHUNK5) {
416691
416773
  this.blocks.push(this.cur.digest("hex"));
416692
- this.cur = createHash57("sha256");
416774
+ this.cur = createHash58("sha256");
416693
416775
  this.curLen = 0;
416694
416776
  }
416695
416777
  }
@@ -417037,7 +417119,7 @@ var init_gitignore = __esm({
417037
417119
  });
417038
417120
 
417039
417121
  // ../../packages/host-core/dist/active-link/session.js
417040
- import { createHash as createHash58 } from "node:crypto";
417122
+ import { createHash as createHash59 } from "node:crypto";
417041
417123
  import { lstat as lstat11, readlink as readlink5, open as open15 } from "node:fs/promises";
417042
417124
  var OutboundSender;
417043
417125
  var init_session3 = __esm({
@@ -417136,7 +417218,7 @@ var init_session3 = __esm({
417136
417218
  const size2 = st.size;
417137
417219
  const mtimeMs = Math.floor(st.mtimeMs);
417138
417220
  const mode = st.mode;
417139
- const running4 = createHash58("sha256");
417221
+ const running4 = createHash59("sha256");
417140
417222
  let fh;
417141
417223
  try {
417142
417224
  fh = await open15(abs, "r");
@@ -421561,7 +421643,7 @@ __export(routines_exports, {
421561
421643
  syncSeededRoutines: () => syncSeededRoutines,
421562
421644
  taskSession: () => taskSession
421563
421645
  });
421564
- import { createHash as createHash59 } from "node:crypto";
421646
+ import { createHash as createHash60 } from "node:crypto";
421565
421647
  import { join as join223 } from "node:path";
421566
421648
  function namesCharter(prompt2, folder) {
421567
421649
  return !!folder && charterPaths(folder).some((p) => prompt2.includes(p));
@@ -421578,7 +421660,7 @@ function routineSeed(folder, held5 = [], file8 = daemonTasksFile()) {
421578
421660
  }));
421579
421661
  }
421580
421662
  function seedRoutineHash(r) {
421581
- return createHash59("sha256").update(JSON.stringify([r.cron.trim(), r.prompt, r.paused === true])).digest("hex").slice(0, 16);
421663
+ return createHash60("sha256").update(JSON.stringify([r.cron.trim(), r.prompt, r.paused === true])).digest("hex").slice(0, 16);
421582
421664
  }
421583
421665
  function syncSeededRoutines(folder, routines, applied, file8 = daemonTasksFile(), now2 = Date.now()) {
421584
421666
  const store2 = new CronStore({ file: file8 });
@@ -426307,15 +426389,15 @@ var init_model = __esm({
426307
426389
  });
426308
426390
 
426309
426391
  // ../../packages/embed-core/dist/fetch.js
426310
- import { createHash as createHash60 } from "node:crypto";
426392
+ import { createHash as createHash61 } from "node:crypto";
426311
426393
  import { createWriteStream as createWriteStream6, existsSync as existsSync109, mkdirSync as mkdirSync51, readFileSync as readFileSync63, renameSync as renameSync30, rmSync as rmSync24, statSync as statSync80, writeFileSync as writeFileSync45 } from "node:fs";
426312
426394
  import { dirname as dirname97 } from "node:path";
426313
426395
  import { Readable as Readable14 } from "node:stream";
426314
426396
  import { pipeline as pipeline4 } from "node:stream/promises";
426315
426397
  async function sha256File(path15) {
426316
- const h = createHash60("sha256");
426317
- const { createReadStream: createReadStream12 } = await import("node:fs");
426318
- await pipeline4(createReadStream12(path15), async function* (src) {
426398
+ const h = createHash61("sha256");
426399
+ const { createReadStream: createReadStream13 } = await import("node:fs");
426400
+ await pipeline4(createReadStream13(path15), async function* (src) {
426319
426401
  for await (const chunk of src)
426320
426402
  h.update(chunk);
426321
426403
  });
@@ -426352,7 +426434,7 @@ async function downloadVerified(url2, path15, f3, opts = {}, onBytes) {
426352
426434
  const res = await (opts.fetchImpl ?? fetch)(url2, { signal: opts.signal, redirect: "follow" });
426353
426435
  if (!res.ok || !res.body)
426354
426436
  throw new Error(`HTTP ${res.status} for ${f3.asset}`);
426355
- const hash3 = createHash60("sha256");
426437
+ const hash3 = createHash61("sha256");
426356
426438
  let size2 = 0;
426357
426439
  try {
426358
426440
  await pipeline4(Readable14.fromWeb(res.body), async function* (src) {
@@ -429863,11 +429945,11 @@ ${ENCODE_SOURCE}
429863
429945
  });
429864
429946
 
429865
429947
  // ../../packages/embed-core/dist/vector-store.js
429866
- import { createHash as createHash61 } from "node:crypto";
429948
+ import { createHash as createHash62 } from "node:crypto";
429867
429949
  import { appendFileSync as appendFileSync6, mkdirSync as mkdirSync52, readFileSync as readFileSync65, statSync as statSync81 } from "node:fs";
429868
429950
  import { dirname as dirname98, join as join229 } from "node:path";
429869
429951
  function textKey(text51) {
429870
- return createHash61("sha256").update(text51).digest("hex").slice(0, KEY_BYTES * 2);
429952
+ return createHash62("sha256").update(text51).digest("hex").slice(0, KEY_BYTES * 2);
429871
429953
  }
429872
429954
  function encodeRecord(key7, vec, dims) {
429873
429955
  const b = Buffer.alloc(KEY_BYTES + dims * 4);
@@ -431894,7 +431976,7 @@ var init_window = __esm({
431894
431976
  });
431895
431977
 
431896
431978
  // ../../packages/host-core/dist/violet-sessions/service.js
431897
- import { createHash as createHash62, randomUUID as randomUUID77 } from "node:crypto";
431979
+ import { createHash as createHash63, randomUUID as randomUUID77 } from "node:crypto";
431898
431980
  import { basename as basename52, isAbsolute as isAbsolute44, join as join233, normalize as normalize10 } from "node:path";
431899
431981
  function surfaceFiles(m) {
431900
431982
  const p = m.payload;
@@ -432374,7 +432456,7 @@ function createVioletSessions(d) {
432374
432456
  const paths = [...new Set([...t2.kept, ...turn.made, ...t2.made].map((p) => normalize10(p)))].filter((p) => inFolder3(u.folder, p));
432375
432457
  const shown5 = [];
432376
432458
  const sameOf = /* @__PURE__ */ new Map();
432377
- const sameKey = (f3) => f3.bytes ? createHash62("sha256").update(f3.bytes).digest("hex") : `${madeKind(f3.path)}:${f3.size}`;
432459
+ const sameKey = (f3) => f3.bytes ? createHash63("sha256").update(f3.bytes).digest("hex") : `${madeKind(f3.path)}:${f3.size}`;
432378
432460
  if (paths.length) {
432379
432461
  const read4 = await readAs(u, paths, { maxBytes: SAME_READ_MAX });
432380
432462
  for (const f3 of read4) {
@@ -433348,7 +433430,7 @@ var init_turn = __esm({
433348
433430
  });
433349
433431
 
433350
433432
  // ../../packages/host-core/dist/memory/episodes.js
433351
- import { createReadStream as createReadStream6, existsSync as existsSync111 } from "node:fs";
433433
+ import { createReadStream as createReadStream7, existsSync as existsSync111 } from "node:fs";
433352
433434
  import { createInterface as createInterface3 } from "node:readline";
433353
433435
  function syntheticFolder(cwd, projectKey) {
433354
433436
  const s = `${cwd ?? ""} ${projectKey ?? ""}`;
@@ -433381,7 +433463,7 @@ async function* lineChunks(f3) {
433381
433463
  if (!existsSync111(path15))
433382
433464
  continue;
433383
433465
  let buf = [];
433384
- const rl = createInterface3({ input: createReadStream6(path15, { encoding: "utf8" }), crlfDelay: Infinity });
433466
+ const rl = createInterface3({ input: createReadStream7(path15, { encoding: "utf8" }), crlfDelay: Infinity });
433385
433467
  for await (const line5 of rl) {
433386
433468
  buf.push(line5);
433387
433469
  if (buf.length >= CHUNK_LINES) {
@@ -433630,9 +433712,9 @@ var init_pg_store = __esm({
433630
433712
  });
433631
433713
 
433632
433714
  // ../../packages/host-core/dist/memory/qdrant-client.js
433633
- import { createHash as createHash63 } from "node:crypto";
433715
+ import { createHash as createHash64 } from "node:crypto";
433634
433716
  function pointId(item, n2) {
433635
- const h = createHash63("sha1").update(`${item}#${n2}`).digest("hex");
433717
+ const h = createHash64("sha1").update(`${item}#${n2}`).digest("hex");
433636
433718
  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)}`;
433637
433719
  }
433638
433720
  var COLLECTION2, TENANT_FIELD, TENANT_PID, DIMS, INDEX_LAYOUT, RESCORE, SMALL, DENSE_SHARE, CUE_SHARE, QdrantError, QdrantClient;
@@ -433934,11 +434016,11 @@ var init_qdrant_client = __esm({
433934
434016
  });
433935
434017
 
433936
434018
  // ../../packages/host-core/dist/memory/store.js
433937
- import { createHash as createHash64 } from "node:crypto";
433938
- import { appendFileSync as appendFileSync7, closeSync as closeSync23, createReadStream as createReadStream7, existsSync as existsSync112, mkdirSync as mkdirSync54, openSync as openSync10, readFileSync as readFileSync67, readSync as readSync15, renameSync as renameSync32, statSync as statSync82, truncateSync as truncateSync3, writeFileSync as writeFileSync47 } from "node:fs";
434019
+ import { createHash as createHash65 } from "node:crypto";
434020
+ import { appendFileSync as appendFileSync7, closeSync as closeSync23, createReadStream as createReadStream8, existsSync as existsSync112, mkdirSync as mkdirSync54, openSync as openSync10, readFileSync as readFileSync67, readSync as readSync15, renameSync as renameSync32, statSync as statSync82, truncateSync as truncateSync3, writeFileSync as writeFileSync47 } from "node:fs";
433939
434021
  import { dirname as dirname99 } from "node:path";
433940
434022
  function fingerprint2(...parts2) {
433941
- const h = createHash64("sha1");
434023
+ const h = createHash65("sha1");
433942
434024
  for (const p of parts2)
433943
434025
  h.update(typeof p === "string" || p == null ? p ?? "" : p.join("")).update("\0");
433944
434026
  return h.digest("hex").slice(0, 16);
@@ -433987,7 +434069,7 @@ var init_store5 = __esm({
433987
434069
  return false;
433988
434070
  }
433989
434071
  };
433990
- for await (const chunk of createReadStream7(this.path)) {
434072
+ for await (const chunk of createReadStream8(this.path)) {
433991
434073
  let from = 0;
433992
434074
  for (let nl = chunk.indexOf(10); nl >= 0; nl = chunk.indexOf(10, from)) {
433993
434075
  const line5 = Buffer.concat([...pending6, chunk.subarray(from, nl)]);
@@ -462321,7 +462403,7 @@ var init_calibration = __esm({
462321
462403
  });
462322
462404
 
462323
462405
  // ../../packages/host-core/dist/crew/claude-peer.js
462324
- import { createHash as createHash65, randomUUID as randomUUID87 } from "node:crypto";
462406
+ import { createHash as createHash66, randomUUID as randomUUID87 } from "node:crypto";
462325
462407
  import { connect as connect3, createServer as createServer14 } from "node:net";
462326
462408
  import { homedir as homedir53 } from "node:os";
462327
462409
  import { basename as basename67, dirname as dirname107, join as join254 } from "node:path";
@@ -462471,7 +462553,7 @@ var init_claude_peer = __esm({
462471
462553
  /** The session's own token, from its key file — none when there is no such file (not needed on macOS/Linux). */
462472
462554
  tokenOf(t2) {
462473
462555
  const home2 = this.deps.home ?? homedir53();
462474
- const hash3 = createHash65("sha256").update(t2.socketPath).digest("hex");
462556
+ const hash3 = createHash66("sha256").update(t2.socketPath).digest("hex");
462475
462557
  try {
462476
462558
  const raw2 = JSON.parse(readFileSync3(join254(home2, ".claude", "sessions", `${t2.pid}.${hash3}.key`), "utf8"));
462477
462559
  return typeof raw2.peerToken === "string" && /^[0-9a-f]{16,128}$/.test(raw2.peerToken) ? raw2.peerToken : void 0;
@@ -462499,7 +462581,7 @@ var init_claude_peer = __esm({
462499
462581
  });
462500
462582
 
462501
462583
  // ../../packages/host-core/dist/crew/external-claude.js
462502
- import { createHash as createHash66 } from "node:crypto";
462584
+ import { createHash as createHash67 } from "node:crypto";
462503
462585
  import { homedir as homedir54 } from "node:os";
462504
462586
  import { join as join255, relative as relative34, isAbsolute as isAbsolute45 } from "node:path";
462505
462587
  function alive2(pid) {
@@ -462746,7 +462828,7 @@ async function refreshClaudeHistory(home2 = homedir54()) {
462746
462828
  await i.reading;
462747
462829
  }
462748
462830
  function claudeEditorsOf(absPath4, sinceMs = 0, home2 = homedir54()) {
462749
- const h = createHash66("sha256").update(absPath4).digest("hex").slice(0, 16);
462831
+ const h = createHash67("sha256").update(absPath4).digest("hex").slice(0, 16);
462750
462832
  const index = indexes.get(home2) ?? buildIndexSync(home2);
462751
462833
  return (index.byHash.get(h) ?? []).filter((e) => e.at > sinceMs).sort((a, b) => b.at - a.at);
462752
462834
  }
@@ -463027,7 +463109,7 @@ var init_messaging = __esm({
463027
463109
 
463028
463110
  // ../../packages/host-core/dist/crew/project.js
463029
463111
  import { execFile as execFile27 } from "node:child_process";
463030
- import { createHash as createHash67 } from "node:crypto";
463112
+ import { createHash as createHash68 } from "node:crypto";
463031
463113
  import { basename as basename68, dirname as dirname108, join as join256, resolve as resolve50 } from "node:path";
463032
463114
  function git6(cwd, args, input, timeoutMs = 2e4) {
463033
463115
  const env = { ...process.env, GIT_OPTIONAL_LOCKS: "0", LC_ALL: "C" };
@@ -463096,7 +463178,7 @@ function gitDirOf(root) {
463096
463178
  }
463097
463179
  function crewDir(root) {
463098
463180
  const name = basename68(root).replace(/[^\w.-]/g, "_") || "project";
463099
- const hash3 = createHash67("sha1").update(resolve50(root)).digest("hex").slice(0, 10);
463181
+ const hash3 = createHash68("sha1").update(resolve50(root)).digest("hex").slice(0, 10);
463100
463182
  return join256(tesseractHome(), "projects", `${name}-${hash3}`, "crew");
463101
463183
  }
463102
463184
  async function catFiles(root, specs) {
@@ -480150,7 +480232,7 @@ var init_tracker = __esm({
480150
480232
  });
480151
480233
 
480152
480234
  // ../../packages/host-core/dist/crew/watch.js
480153
- import { createHash as createHash68 } from "node:crypto";
480235
+ import { createHash as createHash69 } from "node:crypto";
480154
480236
  function commandOf2(input) {
480155
480237
  if (!input || typeof input !== "object")
480156
480238
  return void 0;
@@ -480215,7 +480297,7 @@ var init_watch2 = __esm({
480215
480297
  if (ev.input === void 0 || call5.signed || !tool5)
480216
480298
  return {};
480217
480299
  call5.signed = true;
480218
- const sig = createHash68("sha1").update(`${tool5}\0${stable(ev.input)}`).digest("hex");
480300
+ const sig = createHash69("sha1").update(`${tool5}\0${stable(ev.input)}`).digest("hex");
480219
480301
  s.repeats = s.lastSig === sig ? s.repeats + 1 : 1;
480220
480302
  s.lastSig = sig;
480221
480303
  if (SHELL_TOOLS2.has(tool5) || ev.kind === "execute") {
@@ -481107,7 +481189,7 @@ var init_ports = __esm({
481107
481189
  });
481108
481190
 
481109
481191
  // ../../packages/host-core/dist/crew/cite.js
481110
- import { createHash as createHash69 } from "node:crypto";
481192
+ import { createHash as createHash70 } from "node:crypto";
481111
481193
  function parseSpec(spec3) {
481112
481194
  const s = spec3.trim();
481113
481195
  const hash3 = s.lastIndexOf("#");
@@ -481161,7 +481243,7 @@ var init_cite = __esm({
481161
481243
  "use strict";
481162
481244
  init_interfaces();
481163
481245
  MAX_CITED = 4e3;
481164
- sha = (s) => createHash69("sha256").update(s).digest("hex");
481246
+ sha = (s) => createHash70("sha256").update(s).digest("hex");
481165
481247
  }
481166
481248
  });
481167
481249
 
@@ -481704,7 +481786,7 @@ var init_tree = __esm({
481704
481786
  });
481705
481787
 
481706
481788
  // ../../packages/host-core/dist/crew/organization.js
481707
- import { createHash as createHash70, randomUUID as randomUUID91 } from "node:crypto";
481789
+ import { createHash as createHash71, randomUUID as randomUUID91 } from "node:crypto";
481708
481790
  import { dirname as dirname117, isAbsolute as isAbsolute48, relative as relative37, resolve as resolve53 } from "node:path";
481709
481791
  var active5, scopeValid, withinScope, normalize16, finiteMoney, CrewOrganizations;
481710
481792
  var init_organization3 = __esm({
@@ -482187,7 +482269,7 @@ var init_organization3 = __esm({
482187
482269
  const rel = relative37(root, file8);
482188
482270
  if (isAbsolute48(artifact) || rel === ".." || rel.startsWith("../") || isAbsolute48(rel))
482189
482271
  throw new Error("Artifact is outside this project");
482190
- const actual = `sha256:${createHash70("sha256").update(readFileSync3(file8)).digest("hex")}`;
482272
+ const actual = `sha256:${createHash71("sha256").update(readFileSync3(file8)).digest("hex")}`;
482191
482273
  if (actual !== version4)
482192
482274
  throw new Error("Artifact changed since this version; publish the new version and repeat verification");
482193
482275
  }
@@ -491784,7 +491866,7 @@ var init_focus_probe = __esm({
491784
491866
  });
491785
491867
 
491786
491868
  // ../../packages/host-core/dist/rdesk/file-pull.js
491787
- import { createReadStream as createReadStream8, promises as fsp3 } from "node:fs";
491869
+ import { createReadStream as createReadStream9, promises as fsp3 } from "node:fs";
491788
491870
  import { basename as basename72 } from "node:path";
491789
491871
  function oneChooser(open18) {
491790
491872
  let current12 = null;
@@ -491808,7 +491890,7 @@ var init_file_pull = __esm({
491808
491890
  return { size: s.size, isFile: s.isFile() };
491809
491891
  },
491810
491892
  // A size of 0 says nothing: an empty file ends by itself, and a special file (some mounts) reports 0 and has contents.
491811
- read: (path15, size2) => createReadStream8(path15, { highWaterMark: FILE_PULL_CHUNK, ...size2 > 0 ? { end: size2 - 1 } : {} })
491893
+ read: (path15, size2) => createReadStream9(path15, { highWaterMark: FILE_PULL_CHUNK, ...size2 > 0 ? { end: size2 - 1 } : {} })
491812
491894
  };
491813
491895
  LinkGone = class extends Error {
491814
491896
  constructor() {
@@ -492367,7 +492449,7 @@ var init_tesseract_engine = __esm({
492367
492449
 
492368
492450
  // ../../packages/host-core/dist/engines/machine-sign-in.js
492369
492451
  import { execFile as execFile31 } from "node:child_process";
492370
- import { createHash as createHash71 } from "node:crypto";
492452
+ import { createHash as createHash72 } from "node:crypto";
492371
492453
  import { homedir as homedir58 } from "node:os";
492372
492454
  import { join as join267 } from "node:path";
492373
492455
  function securityHas(service, account2) {
@@ -492510,7 +492592,7 @@ var init_machine_sign_in = __esm({
492510
492592
  geminiDir = (ctx2) => join267(dirOf(ctx2, "GEMINI_CLI_HOME", ctx2.home), ".gemini");
492511
492593
  opencodeDir = (ctx2) => join267(dirOf(ctx2, "XDG_DATA_HOME", join267(ctx2.home, ".local", "share")), "opencode");
492512
492594
  cursorDir = (ctx2) => dirOf(ctx2, "CURSOR_CONFIG_DIR", join267(ctx2.home, ".cursor"));
492513
- sha2564 = (text51) => createHash71("sha256").update(text51).digest("hex");
492595
+ sha2564 = (text51) => createHash72("sha256").update(text51).digest("hex");
492514
492596
  SETUPS = {
492515
492597
  // A subscription: `.credentials.json` in its config dir (Linux, Windows) or the login keychain (macOS). A key: the
492516
492598
  // environment, or the one a Console login leaves in `.claude.json` where it could not use the keychain. Not its
@@ -493092,8 +493174,8 @@ var init_assist_shell = __esm({
493092
493174
 
493093
493175
  // ../../packages/host-core/dist/remote-install/wsl.js
493094
493176
  import { spawn as spawn25 } from "node:child_process";
493095
- import { createHash as createHash72 } from "node:crypto";
493096
- import { createReadStream as createReadStream9, createWriteStream as createWriteStream7, existsSync as existsSync123, mkdirSync as mkdirSync60, renameSync as renameSync34, rmSync as rmSync26, statSync as statSync91 } from "node:fs";
493177
+ import { createHash as createHash73 } from "node:crypto";
493178
+ import { createReadStream as createReadStream10, createWriteStream as createWriteStream7, existsSync as existsSync123, mkdirSync as mkdirSync60, renameSync as renameSync34, rmSync as rmSync26, statSync as statSync91 } from "node:fs";
493097
493179
  import { basename as basename73, join as join268 } from "node:path";
493098
493180
  import { Readable as Readable15, Transform as Transform3 } from "node:stream";
493099
493181
  import { pipeline as pipeline5 } from "node:stream/promises";
@@ -493270,13 +493352,13 @@ function pickImage(manifest, arch2 = process.arch, want2 = DEFAULT_IMAGE) {
493270
493352
  return null;
493271
493353
  }
493272
493354
  async function hashFile3(hash3, path15) {
493273
- for await (const chunk of createReadStream9(path15))
493355
+ for await (const chunk of createReadStream10(path15))
493274
493356
  hash3.update(chunk);
493275
493357
  return hash3;
493276
493358
  }
493277
493359
  async function downloadImage(image3, dir2, opts = {}) {
493278
493360
  const file8 = join268(dir2, basename73(new URL(image3.url).pathname) || "distribution.wsl");
493279
- if (existsSync123(file8) && (await hashFile3(createHash72("sha256"), file8)).digest("hex") === image3.sha256)
493361
+ if (existsSync123(file8) && (await hashFile3(createHash73("sha256"), file8)).digest("hex") === image3.sha256)
493280
493362
  return file8;
493281
493363
  mkdirSync60(dir2, { recursive: true });
493282
493364
  const part = `${file8}.part`;
@@ -493288,7 +493370,7 @@ async function downloadImage(image3, dir2, opts = {}) {
493288
493370
  if (!res.ok || !res.body)
493289
493371
  throw new Error(`The download did not start (HTTP ${res.status}).`);
493290
493372
  const resumed = have > 0 && res.status === 206;
493291
- const hash3 = resumed ? await hashFile3(createHash72("sha256"), part) : createHash72("sha256");
493373
+ const hash3 = resumed ? await hashFile3(createHash73("sha256"), part) : createHash73("sha256");
493292
493374
  let received = resumed ? have : 0;
493293
493375
  const length = Number(res.headers.get("content-length"));
493294
493376
  const total = Number.isFinite(length) && length > 0 ? received + length : null;
@@ -501252,7 +501334,7 @@ var init_reissue = __esm({
501252
501334
  });
501253
501335
 
501254
501336
  // ../../packages/host-core/dist/mesh/wireguard-psk.js
501255
- import { createCipheriv, createDecipheriv, createHash as createHash73, createPrivateKey as createPrivateKey2, createPublicKey, diffieHellman, randomBytes as randomBytes45 } from "node:crypto";
501337
+ import { createCipheriv, createDecipheriv, createHash as createHash74, createPrivateKey as createPrivateKey2, createPublicKey, diffieHellman, randomBytes as randomBytes45 } from "node:crypto";
501256
501338
  function check32(name, b) {
501257
501339
  if (b.length !== 32)
501258
501340
  throw new Error(`${name} must be 32 bytes`);
@@ -501331,7 +501413,7 @@ var init_wireguard_psk = __esm({
501331
501413
  priv = (raw2) => createPrivateKey2({ key: Buffer.concat([PKCS8, raw2]), format: "der", type: "pkcs8" });
501332
501414
  pub = (raw2) => createPublicKey({ key: Buffer.concat([SPKI, raw2]), format: "der", type: "spki" });
501333
501415
  rawPublic = (raw2) => Buffer.from(createPublicKey(priv(raw2)).export({ format: "der", type: "spki" })).subarray(SPKI.length);
501334
- key5 = (s, ephemeralPub, gateway) => createHash73("blake2s256").update(LABEL3).update(s).update(ephemeralPub).update(gateway).digest();
501416
+ key5 = (s, ephemeralPub, gateway) => createHash74("blake2s256").update(LABEL3).update(s).update(ephemeralPub).update(gateway).digest();
501335
501417
  }
501336
501418
  });
501337
501419
 
@@ -502441,7 +502523,7 @@ var init_manager4 = __esm({
502441
502523
  });
502442
502524
 
502443
502525
  // ../../packages/host-core/dist/mesh/route-sync.js
502444
- import { createHash as createHash74 } from "node:crypto";
502526
+ import { createHash as createHash75 } from "node:crypto";
502445
502527
  async function syncRoutes(running4, memo2, now2 = Date.now) {
502446
502528
  const out = { up: [], added: [], down: [], failed: [], helperAbsent: false };
502447
502529
  if (!await netdAvailable()) {
@@ -502522,7 +502604,7 @@ async function syncRoutes(running4, memo2, now2 = Date.now) {
502522
502604
  return out;
502523
502605
  }
502524
502606
  function upFingerprint(args) {
502525
- const h = createHash74("sha256");
502607
+ const h = createHash75("sha256");
502526
502608
  const part = (b) => {
502527
502609
  const bytes3 = typeof b === "string" ? Buffer.from(b) : Buffer.from(b ?? new Uint8Array());
502528
502610
  h.update(`${bytes3.length}:`);
@@ -503530,7 +503612,7 @@ var init_restart_policy = __esm({
503530
503612
  });
503531
503613
 
503532
503614
  // ../../packages/host-core/dist/net-service/self-update.js
503533
- import { createHash as createHash75 } from "node:crypto";
503615
+ import { createHash as createHash76 } from "node:crypto";
503534
503616
  import { readFileSync as readFileSync76, statSync as statSync93 } from "node:fs";
503535
503617
  function shippedSeq(sigText) {
503536
503618
  let o;
@@ -503631,7 +503713,7 @@ function cachedDigest(path15) {
503631
503713
  const seen2 = digests.get(path15);
503632
503714
  if (seen2 && seen2.size === st.size && seen2.mtimeMs === st.mtimeMs)
503633
503715
  return seen2.sum;
503634
- const sum = createHash75("sha256").update(readFileSync76(path15)).digest("hex");
503716
+ const sum = createHash76("sha256").update(readFileSync76(path15)).digest("hex");
503635
503717
  digests.set(path15, { size: st.size, mtimeMs: st.mtimeMs, sum });
503636
503718
  return sum;
503637
503719
  } catch {
@@ -503721,7 +503803,7 @@ var init_self_update = __esm({
503721
503803
  });
503722
503804
 
503723
503805
  // ../../packages/host-core/dist/net-service/instance-update.js
503724
- import { createHash as createHash76 } from "node:crypto";
503806
+ import { createHash as createHash77 } from "node:crypto";
503725
503807
  import { mkdtempSync as mkdtempSync7, rmSync as rmSync29, writeFileSync as writeFileSync55 } from "node:fs";
503726
503808
  import { tmpdir as tmpdir22 } from "node:os";
503727
503809
  import { join as join275 } from "node:path";
@@ -503852,7 +503934,7 @@ async function fetchReleaseHelper(fetchImpl = fetch, target2 = { platform: proce
503852
503934
  continue;
503853
503935
  throw e;
503854
503936
  }
503855
- const got = createHash76("sha256").update(bytes3).digest("hex");
503937
+ const got = createHash77("sha256").update(bytes3).digest("hex");
503856
503938
  if (!sum || got !== sum)
503857
503939
  return { ok: false, detail: `${asset} from ${tag2} does not match its published checksum` };
503858
503940
  const dir2 = mkdtempSync7(join275(tmpdir22(), "tesseract-netd-update-"));
@@ -503865,7 +503947,7 @@ async function fetchReleaseHelper(fetchImpl = fetch, target2 = { platform: proce
503865
503947
  const wBytes = new Uint8Array(await (await get(`${base2}/${workerAsset}`)).arrayBuffer());
503866
503948
  const wSum = (await (await get(`${base2}/${workerAsset}.sha256`)).text()).trim().split(/\s+/)[0]?.toLowerCase();
503867
503949
  const wSig = await (await get(`${base2}/${workerAsset}.sig`)).text();
503868
- if (wSum && createHash76("sha256").update(wBytes).digest("hex") === wSum) {
503950
+ if (wSum && createHash77("sha256").update(wBytes).digest("hex") === wSum) {
503869
503951
  const wName = target2.platform === "win32" ? "tesseract-tailnet.exe" : "tesseract-tailnet";
503870
503952
  writeFileSync55(join275(dir2, wName), wBytes, { mode: 384 });
503871
503953
  writeFileSync55(join275(dir2, `${wName}.sig`), wSig, { mode: 384 });
@@ -507714,7 +507796,7 @@ var init_run_media = __esm({
507714
507796
 
507715
507797
  // ../../packages/host-core/dist/chat-agent.js
507716
507798
  import { randomUUID as randomUUID94 } from "node:crypto";
507717
- import { createReadStream as createReadStream10, mkdirSync as mkdirSync67 } from "node:fs";
507799
+ import { createReadStream as createReadStream11, mkdirSync as mkdirSync67 } from "node:fs";
507718
507800
  import { tmpdir as tmpdir23 } from "node:os";
507719
507801
  import { join as join285 } from "node:path";
507720
507802
  import { Readable as Readable17 } from "node:stream";
@@ -507739,7 +507821,7 @@ function createChatAgentRunner(deps6) {
507739
507821
  const res = await fetch(`${deps6.apiUrl}${path15}`, {
507740
507822
  method: "POST",
507741
507823
  headers: { authorization: `Bearer ${token4}`, "content-type": CHAT_RUN_MEDIA_CONTENT_TYPE },
507742
- body: "file" in body ? Readable17.toWeb(createReadStream10(body.file)) : new Uint8Array(body.bytes),
507824
+ body: "file" in body ? Readable17.toWeb(createReadStream11(body.file)) : new Uint8Array(body.bytes),
507743
507825
  duplex: "half",
507744
507826
  signal: AbortSignal.timeout(18e4 + Math.ceil(size2 / UPLOAD_FLOOR_BYTES_PER_SEC) * 1e3)
507745
507827
  });
@@ -511777,10 +511859,10 @@ var init_rdesk_call_window = __esm({
511777
511859
  });
511778
511860
 
511779
511861
  // ../../packages/host-core/dist/assistant/sign-in.js
511780
- import { createHash as createHash77 } from "node:crypto";
511862
+ import { createHash as createHash78 } from "node:crypto";
511781
511863
  import { join as join296 } from "node:path";
511782
511864
  function signInPrint(c) {
511783
- return createHash77("sha256").update(`tesseract-assistant-sign-in
511865
+ return createHash78("sha256").update(`tesseract-assistant-sign-in
511784
511866
  ${c.dtid}
511785
511867
  ${c.refreshSecret}`).digest("hex");
511786
511868
  }
@@ -513555,7 +513637,7 @@ ${known2.body}`).join("\n\n");
513555
513637
  });
513556
513638
 
513557
513639
  // ../../packages/host-core/dist/memory/qdrant-binary.js
513558
- import { createHash as createHash78 } from "node:crypto";
513640
+ import { createHash as createHash79 } from "node:crypto";
513559
513641
  import { chmodSync as chmodSync17, createWriteStream as createWriteStream9, existsSync as existsSync141, mkdirSync as mkdirSync78, readFileSync as readFileSync89, renameSync as renameSync39, rmSync as rmSync34, statSync as statSync94, writeFileSync as writeFileSync67 } from "node:fs";
513560
513642
  import { join as join300 } from "node:path";
513561
513643
  import { Readable as Readable18 } from "node:stream";
@@ -513602,7 +513684,7 @@ async function ensureQdrant(opts = {}) {
513602
513684
  const res = await (opts.fetchImpl ?? fetch)(assetUrl(a), { signal: opts.signal, redirect: "follow" });
513603
513685
  if (!res.ok || !res.body)
513604
513686
  throw new Error(`HTTP ${res.status} for ${a.asset}`);
513605
- const hash3 = createHash78("sha256");
513687
+ const hash3 = createHash79("sha256");
513606
513688
  let size2 = 0;
513607
513689
  try {
513608
513690
  await pipeline7(Readable18.fromWeb(res.body), async function* (src) {
@@ -514022,7 +514104,7 @@ var init_rebuild = __esm({
514022
514104
  });
514023
514105
 
514024
514106
  // ../../packages/host-core/dist/memory/profiles.js
514025
- import { createHash as createHash79 } from "node:crypto";
514107
+ import { createHash as createHash80 } from "node:crypto";
514026
514108
  function profileSubjects(items2, sizes) {
514027
514109
  const on = /* @__PURE__ */ new Map();
514028
514110
  for (const it of items2) {
@@ -514176,7 +514258,7 @@ with its date. Write:
514176
514258
  };
514177
514259
  day6 = (ts) => new Date(ts).toLocaleDateString("en-GB", { day: "numeric", month: "long", year: "numeric", timeZone: "UTC" });
514178
514260
  when3 = (it) => it.eventAt || day6(it.ts);
514179
- hash2 = (s) => createHash79("sha256").update(s).digest("hex");
514261
+ hash2 = (s) => createHash80("sha256").update(s).digest("hex");
514180
514262
  promptOf = (s) => `SUBJECT: ${s.concept}
514181
514263
 
514182
514264
  MEMORIES:
@@ -517159,11 +517241,11 @@ import { existsSync as existsSync149, readFileSync as readFileSync98, statSync a
517159
517241
  import { homedir as homedir66 } from "node:os";
517160
517242
  import { dirname as dirname137, isAbsolute as isAbsolute50, join as join308, relative as relative40 } from "node:path";
517161
517243
  import { promisify as promisify23 } from "node:util";
517162
- import { createHash as createHash80 } from "node:crypto";
517244
+ import { createHash as createHash81 } from "node:crypto";
517163
517245
  import { readFileSync as readFileForHash } from "node:fs";
517164
517246
  function sha256File2(file8) {
517165
517247
  try {
517166
- return createHash80("sha256").update(readFileForHash(file8)).digest("hex");
517248
+ return createHash81("sha256").update(readFileForHash(file8)).digest("hex");
517167
517249
  } catch {
517168
517250
  return void 0;
517169
517251
  }
@@ -520098,7 +520180,7 @@ var init_clipboard_privacy = __esm({
520098
520180
  });
520099
520181
 
520100
520182
  // ../../packages/host-core/dist/clipboard/clipboard-platform.js
520101
- import { createHash as createHash81 } from "node:crypto";
520183
+ import { createHash as createHash82 } from "node:crypto";
520102
520184
  import { spawn as spawn32 } from "node:child_process";
520103
520185
  import { accessSync, constants as fsConstants2, existsSync as existsSync153 } from "node:fs";
520104
520186
  import { delimiter as delimiter3, join as join313 } from "node:path";
@@ -520149,7 +520231,7 @@ function imageFingerprint(img2) {
520149
520231
  const { width, height } = size2;
520150
520232
  if (!width || !height)
520151
520233
  return "";
520152
- const h = createHash81("sha1");
520234
+ const h = createHash82("sha1");
520153
520235
  if (typeof img2.toBitmap !== "function") {
520154
520236
  try {
520155
520237
  h.update(img2.toPNG());
@@ -520184,7 +520266,7 @@ function imageFingerprint(img2) {
520184
520266
  return `${width}x${height}:${bmp.length}:${h.digest("base64")}`;
520185
520267
  }
520186
520268
  function sha13(s) {
520187
- return createHash81("sha1").update(s).digest("base64");
520269
+ return createHash82("sha1").update(s).digest("base64");
520188
520270
  }
520189
520271
  function readBufferSafe(clip9, format4) {
520190
520272
  try {
@@ -520886,7 +520968,7 @@ Gtk.main()
520886
520968
  });
520887
520969
 
520888
520970
  // ../../packages/host-core/dist/clipboard/paste-history-store.js
520889
- import { createHash as createHash82, randomUUID as randomUUID98 } from "node:crypto";
520971
+ import { createHash as createHash83, randomUUID as randomUUID98 } from "node:crypto";
520890
520972
  import { appendFileSync as appendFileSync10, existsSync as existsSync154, mkdirSync as mkdirSync84, readFileSync as readFileSync102, renameSync as renameSync43, statSync as statSync99, unlinkSync as unlinkSync14, writeFileSync as writeFileSync76 } from "node:fs";
520891
520973
  import { join as join314 } from "node:path";
520892
520974
  function pasteHistoryPath() {
@@ -521138,7 +521220,7 @@ function createPasteHistoryStore(opts = {}) {
521138
521220
  return gone.map((i) => i.id);
521139
521221
  }
521140
521222
  function writeImage(png, thumbJpeg) {
521141
- const base2 = createHash82("sha256").update(png).digest("hex");
521223
+ const base2 = createHash83("sha256").update(png).digest("hex");
521142
521224
  const dir2 = pasteImagesDir();
521143
521225
  mkdirSync84(dir2, { recursive: true, mode: 448 });
521144
521226
  const imageFile = `${base2}.png`;
@@ -522941,9 +523023,9 @@ var init_standalone_atrium_app = __esm({
522941
523023
  });
522942
523024
 
522943
523025
  // ../../packages/host-core/dist/clipboard/clipboard-sync.js
522944
- import { createHash as createHash83, randomUUID as randomUUID99 } from "node:crypto";
523026
+ import { createHash as createHash84, randomUUID as randomUUID99 } from "node:crypto";
522945
523027
  function sha2(input) {
522946
- return createHash83("sha1").update(input).digest("base64");
523028
+ return createHash84("sha1").update(input).digest("base64");
522947
523029
  }
522948
523030
  function entrySignature(e) {
522949
523031
  return e.kind === "image" ? `img:${e.imagePngBase64 ? sha2(e.imagePngBase64) : ""}` : `txt:${sha2(e.text ?? "")}`;
@@ -524075,7 +524157,7 @@ var init_service4 = __esm({
524075
524157
  });
524076
524158
 
524077
524159
  // ../../packages/host-core/dist/drops/send.js
524078
- import { createReadStream as createReadStream11 } from "node:fs";
524160
+ import { createReadStream as createReadStream12 } from "node:fs";
524079
524161
  import { lstat as lstat17, readdir as readdir20 } from "node:fs/promises";
524080
524162
  import { basename as basename79, join as join323, relative as relative41, sep as sep47 } from "node:path";
524081
524163
  async function collectItems(paths, opts) {
@@ -524175,7 +524257,7 @@ async function sendDrop(deps6, req) {
524175
524257
  const local = byRel.get(it.rel);
524176
524258
  if (!local?.abs)
524177
524259
  continue;
524178
- const raw2 = createReadStream11(local.abs);
524260
+ const raw2 = createReadStream12(local.abs);
524179
524261
  const body2 = contentKey ? encryptStream(raw2, contentKey) : raw2;
524180
524262
  await deps6.upload(`/${created.dropId}/items/${it.itemId}/blob`, body2, contentKey ? void 0 : local.size);
524181
524263
  bytesDone += local.size;
@@ -525823,7 +525905,7 @@ var init_relay_address = __esm({
525823
525905
  });
525824
525906
 
525825
525907
  // ../../packages/host-core/dist/assistant/seed-files.js
525826
- import { createHash as createHash84 } from "node:crypto";
525908
+ import { createHash as createHash85 } from "node:crypto";
525827
525909
  import { dirname as dirname145, join as join328, normalize as normalize18, relative as relative42, sep as sep48 } from "node:path";
525828
525910
  import { gunzipSync as gunzipSync3, gzipSync as gzipSync3 } from "node:zlib";
525829
525911
  async function collectSeedFiles(folder) {
@@ -525896,7 +525978,7 @@ function unpackSeedFiles(env) {
525896
525978
  for (const [p, t2] of Object.entries(parsed.files ?? {}))
525897
525979
  if (typeof t2 === "string")
525898
525980
  files[p] = t2;
525899
- return { files, hash: createHash84("sha256").update(data3).digest("hex") };
525981
+ return { files, hash: createHash85("sha256").update(data3).digest("hex") };
525900
525982
  } catch {
525901
525983
  return null;
525902
525984
  }
@@ -525956,7 +526038,7 @@ var init_seed_files = __esm({
525956
526038
  });
525957
526039
 
525958
526040
  // ../../packages/host-core/dist/assistant/boot.js
525959
- import { createHash as createHash85 } from "node:crypto";
526041
+ import { createHash as createHash86 } from "node:crypto";
525960
526042
  import { homedir as homedir70 } from "node:os";
525961
526043
  import { dirname as dirname146, join as join329, resolve as resolve58, sep as sep49 } from "node:path";
525962
526044
  function parse15(raw2, what, problems) {
@@ -526687,7 +526769,7 @@ var init_boot = __esm({
526687
526769
  init_helper_seat();
526688
526770
  init_hosting();
526689
526771
  init_violet2();
526690
- sha3 = (s) => createHash85("sha256").update(s).digest("hex");
526772
+ sha3 = (s) => createHash86("sha256").update(s).digest("hex");
526691
526773
  SEED_PARTS_FILE = ".seed-parts.json";
526692
526774
  ENGINE_HOMES = [".claude", ".codex", ".gemini", ".local/share/opencode", ".config/opencode"];
526693
526775
  under5 = (p, dir2) => p === dir2 || p.startsWith(dir2.endsWith(sep49) ? dir2 : dir2 + sep49);
@@ -549004,7 +549086,7 @@ init_dist30();
549004
549086
  init_dist30();
549005
549087
  init_dist30();
549006
549088
  import { existsSync as existsSync172, mkdtempSync as mkdtempSync11, readFileSync as readFileSync122, rmSync as rmSync46 } from "node:fs";
549007
- import { createHash as createHash87 } from "node:crypto";
549089
+ import { createHash as createHash88 } from "node:crypto";
549008
549090
  import { execFileSync as execFileSync13, spawn as spawn35, spawnSync as spawnSync11 } from "node:child_process";
549009
549091
  import { fileURLToPath as fileURLToPath13 } from "node:url";
549010
549092
  import { tmpdir as tmpdir27 } from "node:os";
@@ -551892,7 +551974,7 @@ async function assistantSignIn(provider14, label4) {
551892
551974
  init_dist2();
551893
551975
  init_base_paths();
551894
551976
  import { spawnSync as spawnSync10 } from "node:child_process";
551895
- import { createHash as createHash86 } from "node:crypto";
551977
+ import { createHash as createHash87 } from "node:crypto";
551896
551978
  import { chmodSync as chmodSync20, existsSync as existsSync168, mkdirSync as mkdirSync96, readdirSync as readdirSync32, renameSync as renameSync46, rmSync as rmSync44, statSync as statSync102, symlinkSync as symlinkSync3, writeFileSync as writeFileSync91, lstatSync as lstatSync30, unlinkSync as unlinkSync21 } from "node:fs";
551897
551979
  import { writeFile as writeFile15 } from "node:fs/promises";
551898
551980
  import { createRequire as createRequire8 } from "node:module";
@@ -552043,7 +552125,7 @@ async function fetchChecked(url2, to) {
552043
552125
  const want2 = (await (await fetch(`${url2}.sha256`, { signal: AbortSignal.timeout(6e4), headers: { "user-agent": "tesseract-agent" } })).text()).trim().split(/\s+/)[0]?.toLowerCase();
552044
552126
  if (!want2 || !/^[0-9a-f]{64}$/.test(want2)) throw new Error(`${url2}.sha256: no checksum published`);
552045
552127
  await download2(url2, to);
552046
- const got = createHash86("sha256").update(await import("node:fs/promises").then((f3) => f3.readFile(to))).digest("hex");
552128
+ const got = createHash87("sha256").update(await import("node:fs/promises").then((f3) => f3.readFile(to))).digest("hex");
552047
552129
  if (got !== want2) throw new Error(`${url2}: checksum mismatch (got ${got.slice(0, 12)}\u2026, expected ${want2.slice(0, 12)}\u2026)`);
552048
552130
  }
552049
552131
  function extract(archive, into) {
@@ -552522,7 +552604,7 @@ async function linkCommand(rest, flags) {
552522
552604
  }
552523
552605
  let linkId;
552524
552606
  if (typeof flags.id === "string") linkId = flags.id;
552525
- else if (typeof flags.name === "string") linkId = createHash87("sha256").update(flags.name).digest("hex").slice(0, 16);
552607
+ else if (typeof flags.name === "string") linkId = createHash88("sha256").update(flags.name).digest("hex").slice(0, 16);
552526
552608
  else {
552527
552609
  console.error("Provide --name <shared-label> (identical on both machines) or --id <sharedId>.");
552528
552610
  process.exit(1);