scream-code 0.18.6 → 0.18.8

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.
@@ -4,25 +4,25 @@ import { dirname as __cjsShimDirname } from 'node:path';
4
4
  const __filename = __cjsShimFileURLToPath(import.meta.url);
5
5
  const __dirname = __cjsShimDirname(__filename);
6
6
  import { i as __require, o as __toESM, r as __exportAll, t as __commonJSMin } from "./chunk-D90kvbyJ.mjs";
7
- import { A as sharedMemoStore, B as buildProjectTagCloud, C as applyConsolidation, D as parseMemoryMemos, E as buildExitExtractionPrompt, F as probeLocalEmbeddingSupport, G as join$1, H as basename$1, I as createMemoryMemo, J as relative$1, K as normalize, L as toSummary, M as clearEmbeddingModelCache, N as createFastEmbedEngine, O as stripMemoryTags, P as hasEmbeddingModelCache$1, R as generateTags, S as DreamTracker, T as EXIT_EXTRACTION_SYSTEM_PROMPT, U as dirname$2, V as rankMemos, W as isAbsolute$1, Y as resolve$2, a as isSupportedFile, b as sharedKnowledgeStoreReady, i as ingestFile, j as classifyEmbeddingFailure, k as MemoryMemoStore, q as parse$7, r as ingestDirectory, t as multiSearch, w as buildConsolidationPlan, y as sharedKnowledgeStore, z as normalizeTags } from "./src-C7C9e5Ds.mjs";
7
+ import { A as sharedMemoStore, B as buildProjectTagCloud, C as applyConsolidation, D as parseMemoryMemos, E as buildExitExtractionPrompt, F as probeLocalEmbeddingSupport, G as join$1, H as basename$1, I as createMemoryMemo, J as relative$1, K as normalize, L as toSummary, M as clearEmbeddingModelCache, N as createEmbeddingEngine, O as stripMemoryTags, P as hasEmbeddingModelCache$1, R as generateTags, S as DreamTracker, T as EXIT_EXTRACTION_SYSTEM_PROMPT, U as dirname$2, V as rankMemos, W as isAbsolute$1, Y as resolve$2, a as isSupportedFile, b as sharedKnowledgeStoreReady, i as ingestFile, j as classifyEmbeddingFailure, k as MemoryMemoStore, q as parse$7, r as ingestDirectory, t as multiSearch, w as buildConsolidationPlan, y as sharedKnowledgeStore, z as normalizeTags } from "./src-ClB_Hzp9.mjs";
8
8
  import { n as require_base64_js, t as XMLParser } from "./XMLParser-DFAnGqkc.mjs";
9
- import { a as assertScreamHostIdentity, i as t, n as getLocale, o as createScreamDefaultHeaders, r as setLocale, t as TextInputDialogComponent } from "./text-input-dialog-BvbqjvzB.mjs";
9
+ import { a as assertScreamHostIdentity, i as t, n as getLocale, o as createScreamDefaultHeaders, r as setLocale, t as TextInputDialogComponent } from "./text-input-dialog-DHDsHCqR.mjs";
10
10
  import { createRequire } from "node:module";
11
11
  import { createHash, randomBytes, randomInt, randomUUID } from "node:crypto";
12
12
  import * as fs$1 from "node:fs/promises";
13
- import Jn, { access, appendFile, chmod, copyFile, cp, lstat, mkdir, mkdtemp, open, opendir, readFile, readdir, realpath, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
13
+ import ro, { access, appendFile, chmod, copyFile, cp, lstat, mkdir, mkdtemp, open, opendir, readFile, readdir, realpath, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
14
14
  import I, { createWriteStream } from "fs";
15
- import Vr, { EventEmitter } from "events";
15
+ import Qr, { EventEmitter } from "events";
16
16
  import * as path$1$1 from "path";
17
- import Xs, { dirname, parse } from "path";
17
+ import js, { dirname, parse } from "path";
18
18
  import { Buffer as Buffer$1 } from "buffer";
19
19
  import * as fs$11 from "fs/promises";
20
20
  import { writeFile as writeFile$1 } from "fs/promises";
21
- import Ds, { PassThrough, Readable } from "node:stream";
21
+ import Cs, { PassThrough, Readable } from "node:stream";
22
22
  import { finished, pipeline as pipeline$1 } from "node:stream/promises";
23
23
  import * as NodeWs from "ws";
24
24
  import * as fs$10 from "node:fs";
25
- import Vt, { appendFileSync, chmodSync, closeSync, constants, createReadStream, createWriteStream as createWriteStream$1, existsSync, fchmodSync, fsyncSync, mkdirSync, openSync, promises, readFileSync, readSync, readdirSync, renameSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
25
+ import Kt, { appendFileSync, chmodSync, closeSync, constants, createReadStream, createWriteStream as createWriteStream$1, existsSync, fchmodSync, fsyncSync, mkdirSync, openSync, promises, readFileSync, readSync, readdirSync, renameSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
26
26
  import * as path$8 from "node:path";
27
27
  import path, { basename, dirname as dirname$1, extname, isAbsolute, join, posix, relative, resolve, sep, win32 } from "node:path";
28
28
  import * as nodeOs from "node:os";
@@ -30,13 +30,13 @@ import { homedir, release, tmpdir } from "node:os";
30
30
  import { z } from "zod";
31
31
  import { exec, execFile, execSync, spawn, spawnSync } from "node:child_process";
32
32
  import { promisify } from "node:util";
33
- import * as vs from "zlib";
34
- import Qr from "zlib";
35
- import { diffLines, diffWords } from "diff";
36
33
  import { EventEmitter as EventEmitter$1 } from "node:events";
37
34
  import { StringDecoder } from "node:string_decoder";
38
- import Pi from "assert";
39
- import ro from "node:assert";
35
+ import zi from "assert";
36
+ import * as vs from "zlib";
37
+ import en from "zlib";
38
+ import co from "node:assert";
39
+ import { diffLines, diffWords } from "diff";
40
40
  import { fileURLToPath, pathToFileURL } from "node:url";
41
41
  import { CodemodeSandbox, CodemodeSourceError, parseCodemodeSource, renderDeclarations } from "@earendil-works/pi-codemode";
42
42
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -10494,7 +10494,7 @@ var require_gaxios = /* @__PURE__ */ __commonJSMin(((exports) => {
10494
10494
  }
10495
10495
  static async #getFetch() {
10496
10496
  const hasWindow = typeof window !== "undefined" && !!window;
10497
- this.#fetch ||= hasWindow ? window.fetch : (await import("./src-C3oCiVNb.mjs")).default;
10497
+ this.#fetch ||= hasWindow ? window.fetch : (await import("./src-CFHysu0q.mjs")).default;
10498
10498
  return this.#fetch;
10499
10499
  }
10500
10500
  /**
@@ -62231,7 +62231,7 @@ var KnowledgeLookupTool = class {
62231
62231
  const llm = { generate: async (systemPrompt, userPrompt) => {
62232
62232
  return this.agent.generateText(systemPrompt, userPrompt);
62233
62233
  } };
62234
- const { multiSearchWithTrace } = await import("./src-qit_jRUM.mjs");
62234
+ const { multiSearchWithTrace } = await import("./src-DA34cXSv.mjs");
62235
62235
  const { results, trace } = await multiSearchWithTrace(store, llm, query, {
62236
62236
  topK,
62237
62237
  skipLlm: args.deep !== true
@@ -70622,6 +70622,37 @@ var FsScanCache = class {
70622
70622
  */
70623
70623
  const scanCache = new FsScanCache();
70624
70624
  //#endregion
70625
+ //#region ../../packages/agent-core/src/tools/builtin/file/mutation-queue.ts
70626
+ /**
70627
+ * Per-path serialization for file mutations.
70628
+ *
70629
+ * Within one turn a tool batch runs concurrently (`runToolCallBatch` settles
70630
+ * it with `Promise.allSettled`), and sub-agents share this process. Two writes
70631
+ * to the same file can therefore interleave their read→modify→write steps and
70632
+ * lose an update — most visibly two edits whose `old_string` windows overlap.
70633
+ * Mutations against the same resolved path run one after another; different
70634
+ * paths still run in parallel, so throughput is unchanged in the common case.
70635
+ *
70636
+ * Scope: structured write tools only (`Write`, `Edit`). Shell commands that
70637
+ * write files themselves (redirection, scripts) are outside the reach of an
70638
+ * in-process queue, exactly like every other file-tool guarantee.
70639
+ *
70640
+ * Keys are `path.resolve`d so relative and absolute spellings of the same
70641
+ * target share one chain. Symlinked aliases of one target are not merged; the
70642
+ * tools resolve access paths before calling this anyway.
70643
+ */
70644
+ const tails = /* @__PURE__ */ new Map();
70645
+ function withFileMutationLock(filePath, task) {
70646
+ const key = path$8.resolve(filePath);
70647
+ const result = (tails.get(key) ?? Promise.resolve()).then(task, task);
70648
+ const tail = result.then(() => void 0, () => void 0);
70649
+ tails.set(key, tail);
70650
+ tail.then(() => {
70651
+ if (tails.get(key) === tail) tails.delete(key);
70652
+ });
70653
+ return result;
70654
+ }
70655
+ //#endregion
70625
70656
  //#region ../../packages/agent-core/src/tools/builtin/file/conflict-detect.ts
70626
70657
  /**
70627
70658
  * Detect unresolved git merge conflict markers in read output.
@@ -70953,7 +70984,7 @@ var EditTool = class {
70953
70984
  pathClass: this.jian.pathClass(),
70954
70985
  homeDir: this.jian.gethome()
70955
70986
  }),
70956
- execute: ({ signal }) => this.execution(args, path, signal)
70987
+ execute: ({ signal }) => withFileMutationLock(path, () => this.execution(args, path, signal))
70957
70988
  };
70958
70989
  }
70959
70990
  async execution(args, safePath, signal) {
@@ -71416,7 +71447,7 @@ var Mr = (s, t) => {
71416
71447
  var Ts = typeof process == "object" && process ? process : {
71417
71448
  stdout: null,
71418
71449
  stderr: null
71419
- }, Pr = (s) => !!s && typeof s == "object" && (s instanceof A || s instanceof Ds || zr(s) || Ur(s)), zr = (s) => !!s && typeof s == "object" && s instanceof EventEmitter$1 && typeof s.pipe == "function" && s.pipe !== Ds.Writable.prototype.pipe, Ur = (s) => !!s && typeof s == "object" && s instanceof EventEmitter$1 && typeof s.write == "function" && typeof s.end == "function", q = Symbol("EOF"), Q = Symbol("maybeEmitEnd"), rt = Symbol("emittedEnd"), Ne = Symbol("emittingEnd"), Qt = Symbol("emittedError"), De = Symbol("closed"), xs = Symbol("read"), Ae = Symbol("flush"), Ls = Symbol("flushChunk"), z$2 = Symbol("encoding"), Mt = Symbol("decoder"), g = Symbol("flowing"), Jt = Symbol("paused"), Bt = Symbol("resume"), b = Symbol("buffer"), D = Symbol("pipes"), _ = Symbol("bufferLength"), gi = Symbol("bufferPush"), Ie = Symbol("bufferShift"), L = Symbol("objectMode"), w = Symbol("destroyed"), bi = Symbol("error"), _i = Symbol("emitData"), Ns = Symbol("emitEnd"), Oi = Symbol("emitEnd2"), Z = Symbol("async"), Ti = Symbol("abort"), Ce = Symbol("aborted"), jt = Symbol("signal"), Rt = Symbol("dataListeners"), C = Symbol("discarded"), te = (s) => Promise.resolve().then(s), Hr = (s) => s(), Wr = (s) => s === "end" || s === "finish" || s === "prefinish", Gr = (s) => s instanceof ArrayBuffer || !!s && typeof s == "object" && s.constructor && s.constructor.name === "ArrayBuffer" && s.byteLength >= 0, Zr = (s) => !Buffer.isBuffer(s) && ArrayBuffer.isView(s), ke = class {
71450
+ }, Pr = (s) => !!s && typeof s == "object" && (s instanceof A || s instanceof Cs || zr(s) || Ur(s)), zr = (s) => !!s && typeof s == "object" && s instanceof EventEmitter$1 && typeof s.pipe == "function" && s.pipe !== Cs.Writable.prototype.pipe, Ur = (s) => !!s && typeof s == "object" && s instanceof EventEmitter$1 && typeof s.write == "function" && typeof s.end == "function", q = Symbol("EOF"), Q = Symbol("maybeEmitEnd"), rt = Symbol("emittedEnd"), Ne = Symbol("emittingEnd"), Qt = Symbol("emittedError"), De = Symbol("closed"), xs = Symbol("read"), Ae = Symbol("flush"), Ls = Symbol("flushChunk"), z$2 = Symbol("encoding"), Mt = Symbol("decoder"), g = Symbol("flowing"), Jt = Symbol("paused"), Bt = Symbol("resume"), b = Symbol("buffer"), D = Symbol("pipes"), _ = Symbol("bufferLength"), gi = Symbol("bufferPush"), Ie = Symbol("bufferShift"), L = Symbol("objectMode"), w = Symbol("destroyed"), bi = Symbol("error"), _i = Symbol("emitData"), Ns = Symbol("emitEnd"), Oi = Symbol("emitEnd2"), Z = Symbol("async"), Ti = Symbol("abort"), Ce = Symbol("aborted"), jt = Symbol("signal"), Rt = Symbol("dataListeners"), C = Symbol("discarded"), te = (s) => Promise.resolve().then(s), Hr = (s) => s(), Wr = (s) => s === "end" || s === "finish" || s === "prefinish", Gr = (s) => s instanceof ArrayBuffer || !!s && typeof s == "object" && s.constructor && s.constructor.name === "ArrayBuffer" && s.byteLength >= 0, Zr = (s) => !Buffer.isBuffer(s) && ArrayBuffer.isView(s), ke = class {
71420
71451
  src;
71421
71452
  dest;
71422
71453
  opts;
@@ -71834,7 +71865,7 @@ var $r = I.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), ee = Symbol(
71834
71865
  this[m] = void 0, I.closeSync(t), this.emit("close");
71835
71866
  }
71836
71867
  }
71837
- }, tt = class extends Vr {
71868
+ }, tt = class extends Qr {
71838
71869
  readable = !1;
71839
71870
  writable = !0;
71840
71871
  [bt] = !1;
@@ -71953,7 +71984,7 @@ var Xr = new Map([
71953
71984
  ["L", "follow"],
71954
71985
  ["h", "follow"],
71955
71986
  ["onentry", "onReadEntry"]
71956
- ]), As = (s) => !!s.sync && !!s.file, Is = (s) => !s.sync && !!s.file, Cs = (s) => !!s.sync && !s.file, ks = (s) => !s.sync && !s.file;
71987
+ ]), As = (s) => !!s.sync && !!s.file, Is = (s) => !s.sync && !!s.file, Cs$1 = (s) => !!s.sync && !s.file, ks = (s) => !s.sync && !s.file;
71957
71988
  var Fs = (s) => !!s.file;
71958
71989
  var qr = (s) => {
71959
71990
  return Xr.get(s) || s;
@@ -71975,7 +72006,7 @@ var K = (s, t, e, i, r) => Object.assign((n = [], o, h) => {
71975
72006
  } else if (Is(a)) {
71976
72007
  let l = t(a, o);
71977
72008
  return h ? l.then(() => h(), h) : l;
71978
- } else if (Cs(a)) {
72009
+ } else if (Cs$1(a)) {
71979
72010
  if (typeof h == "function") throw new TypeError("callback not supported for sync tar functions");
71980
72011
  return e(a, o);
71981
72012
  } else if (ks(a)) {
@@ -71990,7 +72021,7 @@ var K = (s, t, e, i, r) => Object.assign((n = [], o, h) => {
71990
72021
  asyncNoFile: i,
71991
72022
  validate: r
71992
72023
  });
71993
- var Jr = Qr.constants || { ZLIB_VERNUM: 4736 }, M = Object.freeze(Object.assign(Object.create(null), {
72024
+ var Jr = en.constants || { ZLIB_VERNUM: 4736 }, M = Object.freeze(Object.assign(Object.create(null), {
71994
72025
  Z_NO_FLUSH: 0,
71995
72026
  Z_PARTIAL_FLUSH: 1,
71996
72027
  Z_SYNC_FLUSH: 2,
@@ -72142,7 +72173,7 @@ var jr = Buffer$1.concat, Ms = Object.getOwnPropertyDescriptor(Buffer$1, "concat
72142
72173
  this.#e && (this.#e.close(), this.#e = void 0, this.emit("close"));
72143
72174
  }
72144
72175
  reset() {
72145
- if (!this.#t) return Pi(this.#e, "zlib binding closed"), this.#e.reset?.();
72176
+ if (!this.#t) return zi(this.#e, "zlib binding closed"), this.#e.reset?.();
72146
72177
  }
72147
72178
  flush(t) {
72148
72179
  this.ended || (typeof t != "number" && (t = this.#r), this.write(Object.assign(Buffer$1.alloc(0), { [Bi]: t })));
@@ -72158,7 +72189,7 @@ var jr = Buffer$1.concat, Ms = Object.getOwnPropertyDescriptor(Buffer$1, "concat
72158
72189
  }
72159
72190
  write(t, e, i) {
72160
72191
  if (typeof e == "function" && (i = e, e = "utf8"), typeof t == "string" && (t = Buffer$1.from(t, e)), this.#t) return;
72161
- Pi(this.#e, "zlib binding closed");
72192
+ zi(this.#e, "zlib binding closed");
72162
72193
  let r = this.#e._handle, n = r.close;
72163
72194
  r.close = () => {};
72164
72195
  let o = this.#e.close;
@@ -72192,7 +72223,7 @@ var jr = Buffer$1.concat, Ms = Object.getOwnPropertyDescriptor(Buffer$1, "concat
72192
72223
  if (!this.handle) throw new Error("cannot switch params when binding is closed");
72193
72224
  if (!this.handle.params) throw new Error("not supported in this implementation");
72194
72225
  if (this.#t !== t || this.#i !== e) {
72195
- this.flush(M.Z_SYNC_FLUSH), Pi(this.handle, "zlib binding closed");
72226
+ this.flush(M.Z_SYNC_FLUSH), zi(this.handle, "zlib binding closed");
72196
72227
  let i = this.handle.flush;
72197
72228
  this.handle.flush = (r, n) => {
72198
72229
  typeof r == "function" && (n = r, r = this.flushFlag), this.flush(r), n?.();
@@ -72541,7 +72572,7 @@ var On = 1024 * 1024, Ki = Buffer.from([31, 139]), Vi = Buffer.from([
72541
72572
  181,
72542
72573
  47,
72543
72574
  253
72544
- ]), Tn = Math.max(Ki.length, Vi.length), B = Symbol("state"), Dt = Symbol("writeEntry"), et = Symbol("readEntry"), Wi = Symbol("nextEntry"), Hs = Symbol("processEntry"), V = Symbol("extendedHeader"), ae = Symbol("globalExtendedHeader"), ft = Symbol("meta"), Ws = Symbol("emitMeta"), p = Symbol("buffer"), it = Symbol("queue"), dt = Symbol("ended"), Gi = Symbol("emittedEnd"), At = Symbol("emit"), y = Symbol("unzip"), $e = Symbol("consumeChunk"), Xe = Symbol("consumeChunkSub"), Zi = Symbol("consumeBody"), Gs = Symbol("consumeMeta"), Zs = Symbol("consumeHeader"), le = Symbol("consuming"), Yi = Symbol("bufferConcat"), qe = Symbol("maybeEnd"), Kt = Symbol("writing"), ut = Symbol("aborted"), Qe = Symbol("onDone"), It = Symbol("sawValidEntry"), Je = Symbol("sawNullBlock"), je = Symbol("sawEOF"), Ys = Symbol("closeStream"), xn = () => !0, st = class extends EventEmitter {
72575
+ ]), Tn = Math.max(Ki.length, Vi.length), B = Symbol("state"), Dt = Symbol("writeEntry"), et = Symbol("readEntry"), Wi = Symbol("nextEntry"), Hs = Symbol("processEntry"), V = Symbol("extendedHeader"), ae = Symbol("globalExtendedHeader"), ft = Symbol("meta"), Ws = Symbol("emitMeta"), p = Symbol("buffer"), it = Symbol("queue"), dt = Symbol("ended"), Gi = Symbol("emittedEnd"), At = Symbol("emit"), y = Symbol("unzip"), $e = Symbol("consumeChunk"), Xe = Symbol("consumeChunkSub"), Zi = Symbol("consumeBody"), Gs = Symbol("consumeMeta"), Zs = Symbol("consumeHeader"), le = Symbol("consuming"), Yi = Symbol("bufferConcat"), qe = Symbol("maybeEnd"), Kt$1 = Symbol("writing"), ut = Symbol("aborted"), Qe = Symbol("onDone"), It = Symbol("sawValidEntry"), Je = Symbol("sawNullBlock"), je = Symbol("sawEOF"), Ys = Symbol("closeStream"), xn = () => !0, st = class extends EventEmitter {
72545
72576
  file;
72546
72577
  strict;
72547
72578
  maxMetaEntrySize;
@@ -72564,7 +72595,7 @@ var On = 1024 * 1024, Ki = Buffer.from([31, 139]), Vi = Buffer.from([
72564
72595
  [It];
72565
72596
  [Je] = !1;
72566
72597
  [je] = !1;
72567
- [Kt] = !1;
72598
+ [Kt$1] = !1;
72568
72599
  [le] = !1;
72569
72600
  [Gi] = !1;
72570
72601
  constructor(t = {}) {
@@ -72625,7 +72656,7 @@ var On = 1024 * 1024, Ki = Buffer.from([31, 139]), Vi = Buffer.from([
72625
72656
  while (this[Hs](this[it].shift()));
72626
72657
  if (this[it].length === 0) {
72627
72658
  let t = this[et];
72628
- !t || t.flowing || t.size === t.remain ? this[Kt] || this.emit("drain") : t.once("drain", () => this.emit("drain"));
72659
+ !t || t.flowing || t.size === t.remain ? this[Kt$1] || this.emit("drain") : t.once("drain", () => this.emit("drain"));
72629
72660
  }
72630
72661
  }
72631
72662
  [Zi](t, e) {
@@ -72696,12 +72727,12 @@ while (this[Hs](this[it].shift()));
72696
72727
  let a = this[dt];
72697
72728
  this[dt] = !1, this[y] = this[y] === void 0 ? new Ue({}) : o ? new Ke({}) : new Ge({}), this[y].on("data", (c) => this[$e](c)), this[y].on("error", (c) => this.abort(c)), this[y].on("end", () => {
72698
72729
  this[dt] = !0, this[$e]();
72699
- }), this[Kt] = !0;
72730
+ }), this[Kt$1] = !0;
72700
72731
  let l = !!this[y][a ? "end" : "write"](t);
72701
- return this[Kt] = !1, i?.(), l;
72732
+ return this[Kt$1] = !1, i?.(), l;
72702
72733
  }
72703
72734
  }
72704
- this[Kt] = !0, this[y] ? this[y].write(t) : this[$e](t), this[Kt] = !1;
72735
+ this[Kt$1] = !0, this[y] ? this[y].write(t) : this[$e](t), this[Kt$1] = !1;
72705
72736
  let n = this[it].length > 0 ? !1 : this[et] ? this[et].flowing : !0;
72706
72737
  return !n && this[it].length === 0 && this[et]?.once("drain", () => this.emit("drain")), i?.(), n;
72707
72738
  }
@@ -72782,15 +72813,15 @@ var Dn = (s) => {
72782
72813
  }, An = (s) => {
72783
72814
  let t = new st(s), e = s.file, i;
72784
72815
  try {
72785
- i = Vt.openSync(e, "r");
72786
- let r = Vt.fstatSync(i), n = s.maxReadSize || 16 * 1024 * 1024;
72816
+ i = Kt.openSync(e, "r");
72817
+ let r = Kt.fstatSync(i), n = s.maxReadSize || 16 * 1024 * 1024;
72787
72818
  if (r.size < n) {
72788
- let o = Buffer.allocUnsafe(r.size), h = Vt.readSync(i, o, 0, r.size, 0);
72819
+ let o = Buffer.allocUnsafe(r.size), h = Kt.readSync(i, o, 0, r.size, 0);
72789
72820
  t.end(h === o.byteLength ? o : o.subarray(0, h));
72790
72821
  } else {
72791
72822
  let o = 0, h = Buffer.allocUnsafe(n);
72792
72823
  for (; o < r.size;) {
72793
- let a = Vt.readSync(i, h, 0, n, o);
72824
+ let a = Kt.readSync(i, h, 0, n, o);
72794
72825
  if (a === 0) break;
72795
72826
  o += a, t.write(h.subarray(0, a));
72796
72827
  }
@@ -72798,13 +72829,13 @@ var Dn = (s) => {
72798
72829
  }
72799
72830
  } finally {
72800
72831
  if (typeof i == "number") try {
72801
- Vt.closeSync(i);
72832
+ Kt.closeSync(i);
72802
72833
  } catch {}
72803
72834
  }
72804
72835
  }, In = (s, t) => {
72805
72836
  let e = new st(s), i = s.maxReadSize || 16 * 1024 * 1024, r = s.file;
72806
72837
  return new Promise((o, h) => {
72807
- e.on("error", h), e.on("end", o), Vt.stat(r, (a, l) => {
72838
+ e.on("error", h), e.on("end", o), Kt.stat(r, (a, l) => {
72808
72839
  if (a) h(a);
72809
72840
  else {
72810
72841
  let c = new _t(r, {
@@ -72834,7 +72865,7 @@ var ti = [
72834
72865
  "?",
72835
72866
  ":"
72836
72867
  ], qi = ti.map((s) => String.fromCodePoint(61440 + Number(s.codePointAt(0)))), Fn = new Map(ti.map((s, t) => [s, qi[t]])), vn = new Map(qi.map((s, t) => [s, ti[t]])), Qi = (s) => ti.reduce((t, e) => t.split(e).join(Fn.get(e)), s), Vs = (s) => qi.reduce((t, e) => t.split(e).join(vn.get(e)), s);
72837
- var tr = (s, t) => t ? (s = f(s).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s) : f(s), Mn = 16 * 1024 * 1024, qs = Symbol("process"), Qs = Symbol("file"), Js = Symbol("directory"), ji = Symbol("symlink"), js = Symbol("hardlink"), fe = Symbol("header"), ei = Symbol("read"), ts = Symbol("lstat"), ii = Symbol("onlstat"), es = Symbol("onread"), is$2 = Symbol("onreadlink"), ss = Symbol("openfile"), rs = Symbol("onopenfile"), pt = Symbol("close"), si = Symbol("mode"), ns = Symbol("awaitDrain"), Ji = Symbol("ondrain"), X = Symbol("prefix"), de = class extends A {
72868
+ var tr = (s, t) => t ? (s = f(s).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s) : f(s), Mn = 16 * 1024 * 1024, qs = Symbol("process"), Qs = Symbol("file"), Js = Symbol("directory"), ji = Symbol("symlink"), js$1 = Symbol("hardlink"), fe = Symbol("header"), ei = Symbol("read"), ts = Symbol("lstat"), ii = Symbol("onlstat"), es = Symbol("onread"), is$2 = Symbol("onreadlink"), ss = Symbol("openfile"), rs = Symbol("onopenfile"), pt = Symbol("close"), si = Symbol("mode"), ns = Symbol("awaitDrain"), Ji = Symbol("ondrain"), X = Symbol("prefix"), de = class extends A {
72838
72869
  path;
72839
72870
  portable;
72840
72871
  myuid = process.getuid && process.getuid() || 0;
@@ -72873,7 +72904,7 @@ var tr = (s, t) => t ? (s = f(s).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s) : f(
72873
72904
  let [o, h] = ce(this.path);
72874
72905
  o && typeof h == "string" && (this.path = h, r = o);
72875
72906
  }
72876
- this.win32 = !!i.win32 || process.platform === "win32", this.win32 && (this.path = Vs(this.path.replaceAll(/\\/g, "/")), t = t.replaceAll(/\\/g, "/")), this.absolute = f(i.absolute || Xs.resolve(this.cwd, t)), this.path === "" && (this.path = "./"), r && this.warn("TAR_ENTRY_INFO", `stripping ${r} from absolute path`, {
72907
+ this.win32 = !!i.win32 || process.platform === "win32", this.win32 && (this.path = Vs(this.path.replaceAll(/\\/g, "/")), t = t.replaceAll(/\\/g, "/")), this.absolute = f(i.absolute || js.resolve(this.cwd, t)), this.path === "" && (this.path = "./"), r && this.warn("TAR_ENTRY_INFO", `stripping ${r} from absolute path`, {
72877
72908
  entry: this,
72878
72909
  path: r + this.path
72879
72910
  });
@@ -72954,15 +72985,15 @@ var tr = (s, t) => t ? (s = f(s).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s) : f(
72954
72985
  [is$2](t) {
72955
72986
  this.linkpath = f(t), this[fe](), this.end();
72956
72987
  }
72957
- [js](t) {
72988
+ [js$1](t) {
72958
72989
  if (!this.stat) throw new Error("cannot create link entry without stat");
72959
- this.type = "Link", this.linkpath = f(Xs.relative(this.cwd, t)), this.stat.size = 0, this[fe](), this.end();
72990
+ this.type = "Link", this.linkpath = f(js.relative(this.cwd, t)), this.stat.size = 0, this[fe](), this.end();
72960
72991
  }
72961
72992
  [Qs]() {
72962
72993
  if (!this.stat) throw new Error("cannot create file entry without stat");
72963
72994
  if (this.stat.nlink > 1) {
72964
72995
  let t = `${this.stat.dev}:${this.stat.ino}`, e = this.linkCache.get(t);
72965
- if (e?.indexOf(this.cwd) === 0) return this[js](e);
72996
+ if (e?.indexOf(this.cwd) === 0) return this[js$1](e);
72966
72997
  this.linkCache.set(t, this.absolute);
72967
72998
  }
72968
72999
  if (this[fe](), this.stat.size === 0) return this.end();
@@ -73376,7 +73407,7 @@ var mi = class {
73376
73407
  return t instanceof Yt ? this[ir](t) : this[li](t), this.flowing;
73377
73408
  }
73378
73409
  [ir](t) {
73379
- let e = f(Xs.resolve(this.cwd, t.path));
73410
+ let e = f(js.resolve(this.cwd, t.path));
73380
73411
  if (!this.filter(t.path, t)) t.resume();
73381
73412
  else {
73382
73413
  let i = new mi(t.path, e);
@@ -73385,7 +73416,7 @@ var mi = class {
73385
73416
  this[kt]();
73386
73417
  }
73387
73418
  [li](t) {
73388
- let e = f(Xs.resolve(this.cwd, t));
73419
+ let e = f(js.resolve(this.cwd, t));
73389
73420
  this[W].push(new mi(t, e)), this[kt]();
73390
73421
  }
73391
73422
  [ls](t) {
@@ -73575,12 +73606,12 @@ K(Hn, Wn, Gn, Zn, (s, t) => {
73575
73606
  var dr = (process.env.__FAKE_PLATFORM__ || process.platform) === "win32", { O_CREAT: ur, O_NOFOLLOW: lr, O_TRUNC: mr, O_WRONLY: pr } = I.constants, Er = Number(process.env.__FAKE_FS_O_FILENAME__) || I.constants.UV_FS_O_FILEMAP || 0, Vn = dr && !!Er, $n = 512 * 1024, Xn = Er | mr | ur | pr, cr = !dr && typeof lr == "number" ? lr | mr | ur | pr : null, fs$5 = cr !== null ? () => cr : Vn ? (s) => s < $n ? Xn : "w" : () => "w";
73576
73607
  var ds = (s, t, e) => {
73577
73608
  try {
73578
- return Vt.lchownSync(s, t, e);
73609
+ return Kt.lchownSync(s, t, e);
73579
73610
  } catch (i) {
73580
73611
  if (i?.code !== "ENOENT") throw i;
73581
73612
  }
73582
73613
  }, pi = (s, t, e, i) => {
73583
- Vt.lchown(s, t, e, (r) => {
73614
+ Kt.lchown(s, t, e, (r) => {
73584
73615
  i(r && r?.code !== "ENOENT" ? r : null);
73585
73616
  });
73586
73617
  }, qn = (s, t, e, i, r) => {
@@ -73590,7 +73621,7 @@ var ds = (s, t, e) => {
73590
73621
  });
73591
73622
  else pi(path.resolve(s, t.name), e, i, r);
73592
73623
  }, us = (s, t, e, i) => {
73593
- Vt.readdir(s, { withFileTypes: !0 }, (r, n) => {
73624
+ Kt.readdir(s, { withFileTypes: !0 }, (r, n) => {
73594
73625
  if (r) {
73595
73626
  if (r.code === "ENOENT") return i();
73596
73627
  if (r.code !== "ENOTDIR" && r.code !== "ENOTSUP") return i(r);
@@ -73609,7 +73640,7 @@ var ds = (s, t, e) => {
73609
73640
  }, ms = (s, t, e) => {
73610
73641
  let i;
73611
73642
  try {
73612
- i = Vt.readdirSync(s, { withFileTypes: !0 });
73643
+ i = Kt.readdirSync(s, { withFileTypes: !0 });
73613
73644
  } catch (r) {
73614
73645
  let n = r;
73615
73646
  if (n?.code === "ENOENT") return;
@@ -73643,16 +73674,16 @@ var St = class extends Error {
73643
73674
  }
73644
73675
  };
73645
73676
  var jn = (s, t) => {
73646
- Vt.stat(s, (e, i) => {
73677
+ Kt.stat(s, (e, i) => {
73647
73678
  (e || !i.isDirectory()) && (e = new Se(s, e?.code || "ENOTDIR")), t(e);
73648
73679
  });
73649
73680
  }, wr = (s, t, e) => {
73650
73681
  s = f(s);
73651
73682
  let i = t.umask ?? 18, r = t.mode | 448, n = (r & i) !== 0, o = t.uid, h = t.gid, a = typeof o == "number" && typeof h == "number" && (o !== t.processUid || h !== t.processGid), l = t.preserve, c = t.unlink, d = f(t.cwd), S = (E, x) => {
73652
- E ? e(E) : x && a ? us(x, o, h, (Le) => S(Le)) : n ? Vt.chmod(s, r, e) : e();
73683
+ E ? e(E) : x && a ? us(x, o, h, (Le) => S(Le)) : n ? Kt.chmod(s, r, e) : e();
73653
73684
  };
73654
73685
  if (s === d) return jn(s, S);
73655
- if (l) return Jn.mkdir(s, {
73686
+ if (l) return ro.mkdir(s, {
73656
73687
  mode: r,
73657
73688
  recursive: !0
73658
73689
  }).then((E) => S(null, E ?? void 0), S);
@@ -73660,14 +73691,14 @@ var jn = (s, t) => {
73660
73691
  }, ps = (s, t, e, i, r, n, o) => {
73661
73692
  if (t.length === 0) return o(null, n);
73662
73693
  let h = t.shift(), a = f(path.resolve(s + "/" + h));
73663
- Vt.mkdir(a, e, Sr(a, t, e, i, r, n, o));
73694
+ Kt.mkdir(a, e, Sr(a, t, e, i, r, n, o));
73664
73695
  }, Sr = (s, t, e, i, r, n, o) => (h) => {
73665
- h ? Vt.lstat(s, (a, l) => {
73696
+ h ? Kt.lstat(s, (a, l) => {
73666
73697
  if (a) a.path = a.path && f(a.path), o(a);
73667
73698
  else if (l.isDirectory()) ps(s, t, e, i, r, n, o);
73668
- else if (i) Vt.unlink(s, (c) => {
73699
+ else if (i) Kt.unlink(s, (c) => {
73669
73700
  if (c) return o(c);
73670
- Vt.mkdir(s, e, Sr(s, t, e, i, r, n, o));
73701
+ Kt.mkdir(s, e, Sr(s, t, e, i, r, n, o));
73671
73702
  });
73672
73703
  else {
73673
73704
  if (l.isSymbolicLink()) return o(new St(s, s + "/" + t.join("/")));
@@ -73677,7 +73708,7 @@ var jn = (s, t) => {
73677
73708
  }, to = (s) => {
73678
73709
  let t = !1, e;
73679
73710
  try {
73680
- t = Vt.statSync(s).isDirectory();
73711
+ t = Kt.statSync(s).isDirectory();
73681
73712
  } catch (i) {
73682
73713
  e = i?.code;
73683
73714
  } finally {
@@ -73686,10 +73717,10 @@ var jn = (s, t) => {
73686
73717
  }, yr = (s, t) => {
73687
73718
  s = f(s);
73688
73719
  let e = t.umask ?? 18, i = t.mode | 448, r = (i & e) !== 0, n = t.uid, o = t.gid, h = typeof n == "number" && typeof o == "number" && (n !== t.processUid || o !== t.processGid), a = t.preserve, l = t.unlink, c = f(t.cwd), d = (E) => {
73689
- E && h && ms(E, n, o), r && Vt.chmodSync(s, i);
73720
+ E && h && ms(E, n, o), r && Kt.chmodSync(s, i);
73690
73721
  };
73691
73722
  if (s === c) return to(c), d();
73692
- if (a) return d(Vt.mkdirSync(s, {
73723
+ if (a) return d(Kt.mkdirSync(s, {
73693
73724
  mode: i,
73694
73725
  recursive: !0
73695
73726
  }) ?? void 0);
@@ -73697,12 +73728,12 @@ var jn = (s, t) => {
73697
73728
  for (let E = T.shift(), x = c; E && (x += "/" + E); E = T.shift()) {
73698
73729
  x = f(path.resolve(x));
73699
73730
  try {
73700
- Vt.mkdirSync(x, i), N = N || x;
73731
+ Kt.mkdirSync(x, i), N = N || x;
73701
73732
  } catch {
73702
- let Le = Vt.lstatSync(x);
73733
+ let Le = Kt.lstatSync(x);
73703
73734
  if (Le.isDirectory()) continue;
73704
73735
  if (l) {
73705
- Vt.unlinkSync(x), Vt.mkdirSync(x, i), N = N || x;
73736
+ Kt.unlinkSync(x), Kt.mkdirSync(x, i), N = N || x;
73706
73737
  continue;
73707
73738
  } else if (Le.isSymbolicLink()) return new St(x, x + "/" + T.join("/"));
73708
73739
  }
@@ -73792,16 +73823,16 @@ var io = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32"
73792
73823
  };
73793
73824
  var _r = () => process.umask();
73794
73825
  var Or = Symbol("onEntry"), Rs = Symbol("checkFs"), Tr = Symbol("checkFs2"), gs = Symbol("isReusable"), P = Symbol("makeFs"), bs = Symbol("file"), _s = Symbol("directory"), Ri = Symbol("link"), xr = Symbol("symlink"), Lr = Symbol("hardlink"), Re = Symbol("ensureNoSymlink"), Nr = Symbol("unsupported"), Dr = Symbol("checkPath"), ws = Symbol("stripAbsolutePath"), yt = Symbol("mkdir"), O = Symbol("onError"), yi = Symbol("pending"), Ar = Symbol("pend"), Xt = Symbol("unpend"), Ss = Symbol("ended"), ys = Symbol("maybeClose"), Os = Symbol("skip"), ge = Symbol("doChown"), be = Symbol("uid"), _e = Symbol("gid"), Oe = Symbol("checkedCwd"), Te = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32", oo = 1024, ho = (s, t) => {
73795
- if (!Te) return Vt.unlink(s, t);
73826
+ if (!Te) return Kt.unlink(s, t);
73796
73827
  let e = s + ".DELETE." + randomBytes(16).toString("hex");
73797
- Vt.rename(s, e, (i) => {
73828
+ Kt.rename(s, e, (i) => {
73798
73829
  if (i) return t(i);
73799
- Vt.unlink(e, t);
73830
+ Kt.unlink(e, t);
73800
73831
  });
73801
73832
  }, ao = (s) => {
73802
- if (!Te) return Vt.unlinkSync(s);
73833
+ if (!Te) return Kt.unlinkSync(s);
73803
73834
  let t = s + ".DELETE." + randomBytes(16).toString("hex");
73804
- Vt.renameSync(s, t), Vt.unlinkSync(t);
73835
+ Kt.renameSync(s, t), Kt.unlinkSync(t);
73805
73836
  }, Ir = (s, t, e) => s !== void 0 && s === s >>> 0 ? s : t !== void 0 && t === t >>> 0 ? t : e, qt = class extends st {
73806
73837
  [Ss] = !1;
73807
73838
  [Oe] = !1;
@@ -73902,7 +73933,7 @@ var Or = Symbol("onEntry"), Rs = Symbol("checkFs"), Tr = Symbol("checkFs2"), gs
73902
73933
  }
73903
73934
  [Or](t) {
73904
73935
  if (!this[Dr](t)) return t.resume();
73905
- switch (ro.equal(typeof t.absolute, "string"), t.type) {
73936
+ switch (co.equal(typeof t.absolute, "string"), t.type) {
73906
73937
  case "Directory":
73907
73938
  case "GNUDumpDir": t.mode && (t.mode = t.mode | 448);
73908
73939
  case "File":
@@ -73945,14 +73976,14 @@ var Or = Symbol("onEntry"), Rs = Symbol("checkFs"), Tr = Symbol("checkFs2"), gs
73945
73976
  autoClose: !1
73946
73977
  });
73947
73978
  r.on("error", (a) => {
73948
- r.fd && Vt.close(r.fd, () => {}), r.write = () => !0, this[O](a, t), e();
73979
+ r.fd && Kt.close(r.fd, () => {}), r.write = () => !0, this[O](a, t), e();
73949
73980
  });
73950
73981
  let n = 1, o = (a) => {
73951
73982
  if (a) {
73952
- r.fd && Vt.close(r.fd, () => {}), this[O](a, t), e();
73983
+ r.fd && Kt.close(r.fd, () => {}), this[O](a, t), e();
73953
73984
  return;
73954
73985
  }
73955
- --n === 0 && r.fd !== void 0 && Vt.close(r.fd, (l) => {
73986
+ --n === 0 && r.fd !== void 0 && Kt.close(r.fd, (l) => {
73956
73987
  l ? this[O](l, t) : this[Xt](), e();
73957
73988
  });
73958
73989
  };
@@ -73961,12 +73992,12 @@ var Or = Symbol("onEntry"), Rs = Symbol("checkFs"), Tr = Symbol("checkFs2"), gs
73961
73992
  if (typeof l == "number" && t.mtime && !this.noMtime) {
73962
73993
  n++;
73963
73994
  let c = t.atime || /* @__PURE__ */ new Date(), d = t.mtime;
73964
- Vt.futimes(l, c, d, (S) => S ? Vt.utimes(a, c, d, (T) => o(T && S)) : o());
73995
+ Kt.futimes(l, c, d, (S) => S ? Kt.utimes(a, c, d, (T) => o(T && S)) : o());
73965
73996
  }
73966
73997
  if (typeof l == "number" && this[ge](t)) {
73967
73998
  n++;
73968
73999
  let c = this[be](t), d = this[_e](t);
73969
- typeof c == "number" && typeof d == "number" && Vt.fchown(l, c, d, (S) => S ? Vt.chown(a, c, d, (T) => o(T && S)) : o());
74000
+ typeof c == "number" && typeof d == "number" && Kt.fchown(l, c, d, (S) => S ? Kt.chown(a, c, d, (T) => o(T && S)) : o());
73970
74001
  }
73971
74002
  o();
73972
74003
  });
@@ -73985,7 +74016,7 @@ var Or = Symbol("onEntry"), Rs = Symbol("checkFs"), Tr = Symbol("checkFs2"), gs
73985
74016
  let n = 1, o = () => {
73986
74017
  --n === 0 && (e(), this[Xt](), t.resume());
73987
74018
  };
73988
- t.mtime && !this.noMtime && (n++, Vt.utimes(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime, o)), this[ge](t) && (n++, Vt.chown(String(t.absolute), Number(this[be](t)), Number(this[_e](t)), o)), o();
74019
+ t.mtime && !this.noMtime && (n++, Kt.utimes(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime, o)), this[ge](t) && (n++, Kt.chown(String(t.absolute), Number(this[be](t)), Number(this[_e](t)), o)), o();
73989
74020
  });
73990
74021
  }
73991
74022
  [Nr](t) {
@@ -74007,7 +74038,7 @@ var Or = Symbol("onEntry"), Rs = Symbol("checkFs"), Tr = Symbol("checkFs2"), gs
74007
74038
  let o = i.shift();
74008
74039
  if (this.preservePaths || o === void 0) return r();
74009
74040
  let h = path.resolve(e, o);
74010
- Vt.lstat(h, (a, l) => {
74041
+ Kt.lstat(h, (a, l) => {
74011
74042
  if (a) return r();
74012
74043
  if (l?.isSymbolicLink()) return n(new St(h, path.resolve(h, i.join("/"))));
74013
74044
  this[Re](t, h, i, r, n);
@@ -74054,7 +74085,7 @@ var Or = Symbol("onEntry"), Rs = Symbol("checkFs"), Tr = Symbol("checkFs2"), gs
74054
74085
  }
74055
74086
  o();
74056
74087
  }, o = () => {
74057
- Vt.lstat(String(t.absolute), (h, a) => {
74088
+ Kt.lstat(String(t.absolute), (h, a) => {
74058
74089
  if (a && (this.keep || this.newer && a.mtime > (t.mtime ?? a.mtime))) {
74059
74090
  this[Os](t), i();
74060
74091
  return;
@@ -74063,9 +74094,9 @@ var Or = Symbol("onEntry"), Rs = Symbol("checkFs"), Tr = Symbol("checkFs2"), gs
74063
74094
  if (a.isDirectory()) {
74064
74095
  if (t.type === "Directory") {
74065
74096
  let l = this.chmod && t.mode && (a.mode & 4095) !== t.mode, c = (d) => this[P](d ?? null, t, i);
74066
- return l ? Vt.chmod(String(t.absolute), Number(t.mode), c) : c();
74097
+ return l ? Kt.chmod(String(t.absolute), Number(t.mode), c) : c();
74067
74098
  }
74068
- if (t.absolute !== this.cwd) return Vt.rmdir(String(t.absolute), (l) => this[P](l ?? null, t, i));
74099
+ if (t.absolute !== this.cwd) return Kt.rmdir(String(t.absolute), (l) => this[P](l ?? null, t, i));
74069
74100
  }
74070
74101
  if (t.absolute === this.cwd) return this[P](null, t, i);
74071
74102
  ho(String(t.absolute), (l) => this[P](l ?? null, t, i));
@@ -74089,7 +74120,7 @@ var Or = Symbol("onEntry"), Rs = Symbol("checkFs"), Tr = Symbol("checkFs2"), gs
74089
74120
  }
74090
74121
  }
74091
74122
  [Ri](t, e, i, r) {
74092
- Vt[i](e, String(t.absolute), (n) => {
74123
+ Kt[i](e, String(t.absolute), (n) => {
74093
74124
  n ? this[O](n, t) : (this[Xt](), t.resume()), r();
74094
74125
  });
74095
74126
  }
@@ -74117,17 +74148,17 @@ var Or = Symbol("onEntry"), Rs = Symbol("checkFs"), Tr = Symbol("checkFs2"), gs
74117
74148
  if (o) return this[O](o, t);
74118
74149
  }
74119
74150
  }
74120
- let [e, i] = ye(() => Vt.lstatSync(String(t.absolute)));
74151
+ let [e, i] = ye(() => Kt.lstatSync(String(t.absolute)));
74121
74152
  if (i && (this.keep || this.newer && i.mtime > (t.mtime ?? i.mtime))) return this[Os](t);
74122
74153
  if (e || this[gs](t, i)) return this[P](null, t);
74123
74154
  if (i.isDirectory()) {
74124
74155
  if (t.type === "Directory") {
74125
74156
  let [h] = this.chmod && t.mode && (i.mode & 4095) !== t.mode ? ye(() => {
74126
- Vt.chmodSync(String(t.absolute), Number(t.mode));
74157
+ Kt.chmodSync(String(t.absolute), Number(t.mode));
74127
74158
  }) : [];
74128
74159
  return this[P](h, t);
74129
74160
  }
74130
- let [n] = ye(() => Vt.rmdirSync(String(t.absolute)));
74161
+ let [n] = ye(() => Kt.rmdirSync(String(t.absolute)));
74131
74162
  this[P](n, t);
74132
74163
  }
74133
74164
  let [r] = t.absolute === this.cwd ? [] : ye(() => ao(String(t.absolute)));
@@ -74137,21 +74168,21 @@ var Or = Symbol("onEntry"), Rs = Symbol("checkFs"), Tr = Symbol("checkFs2"), gs
74137
74168
  let i = typeof t.mode == "number" ? t.mode & 4095 : this.fmode, r = (h) => {
74138
74169
  let a;
74139
74170
  try {
74140
- Vt.closeSync(n);
74171
+ Kt.closeSync(n);
74141
74172
  } catch (l) {
74142
74173
  a = l;
74143
74174
  }
74144
74175
  (h || a) && this[O](h || a, t), e();
74145
74176
  }, n;
74146
74177
  try {
74147
- n = Vt.openSync(String(t.absolute), fs$5(t.size), i);
74178
+ n = Kt.openSync(String(t.absolute), fs$5(t.size), i);
74148
74179
  } catch (h) {
74149
74180
  return r(h);
74150
74181
  }
74151
74182
  let o = this.transform && this.transform(t) || t;
74152
74183
  o !== t && (o.on("error", (h) => this[O](h, t)), t.pipe(o)), o.on("data", (h) => {
74153
74184
  try {
74154
- Vt.writeSync(n, h, 0, h.length);
74185
+ Kt.writeSync(n, h, 0, h.length);
74155
74186
  } catch (a) {
74156
74187
  r(a);
74157
74188
  }
@@ -74160,10 +74191,10 @@ var Or = Symbol("onEntry"), Rs = Symbol("checkFs"), Tr = Symbol("checkFs2"), gs
74160
74191
  if (t.mtime && !this.noMtime) {
74161
74192
  let a = t.atime || /* @__PURE__ */ new Date(), l = t.mtime;
74162
74193
  try {
74163
- Vt.futimesSync(n, a, l);
74194
+ Kt.futimesSync(n, a, l);
74164
74195
  } catch (c) {
74165
74196
  try {
74166
- Vt.utimesSync(String(t.absolute), a, l);
74197
+ Kt.utimesSync(String(t.absolute), a, l);
74167
74198
  } catch {
74168
74199
  h = c;
74169
74200
  }
@@ -74172,10 +74203,10 @@ var Or = Symbol("onEntry"), Rs = Symbol("checkFs"), Tr = Symbol("checkFs2"), gs
74172
74203
  if (this[ge](t)) {
74173
74204
  let a = this[be](t), l = this[_e](t);
74174
74205
  try {
74175
- Vt.fchownSync(n, Number(a), Number(l));
74206
+ Kt.fchownSync(n, Number(a), Number(l));
74176
74207
  } catch (c) {
74177
74208
  try {
74178
- Vt.chownSync(String(t.absolute), Number(a), Number(l));
74209
+ Kt.chownSync(String(t.absolute), Number(a), Number(l));
74179
74210
  } catch {
74180
74211
  h = h || c;
74181
74212
  }
@@ -74191,10 +74222,10 @@ var Or = Symbol("onEntry"), Rs = Symbol("checkFs"), Tr = Symbol("checkFs2"), gs
74191
74222
  return;
74192
74223
  }
74193
74224
  if (t.mtime && !this.noMtime) try {
74194
- Vt.utimesSync(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime);
74225
+ Kt.utimesSync(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime);
74195
74226
  } catch {}
74196
74227
  if (this[ge](t)) try {
74197
- Vt.chownSync(String(t.absolute), Number(this[be](t)), Number(this[_e](t)));
74228
+ Kt.chownSync(String(t.absolute), Number(this[be](t)), Number(this[_e](t)));
74198
74229
  } catch {}
74199
74230
  e(), t.resume();
74200
74231
  }
@@ -74220,7 +74251,7 @@ var Or = Symbol("onEntry"), Rs = Symbol("checkFs"), Tr = Symbol("checkFs2"), gs
74220
74251
  let o = e;
74221
74252
  for (let h of i) {
74222
74253
  o = path.resolve(o, h);
74223
- let [a, l] = ye(() => Vt.lstatSync(o));
74254
+ let [a, l] = ye(() => Kt.lstatSync(o));
74224
74255
  if (a) return r();
74225
74256
  if (l.isSymbolicLink()) return n(new St(o, path.resolve(e, i.join("/"))));
74226
74257
  }
@@ -74229,22 +74260,22 @@ var Or = Symbol("onEntry"), Rs = Symbol("checkFs"), Tr = Symbol("checkFs2"), gs
74229
74260
  [Ri](t, e, i, r) {
74230
74261
  let n = `${i}Sync`;
74231
74262
  try {
74232
- Vt[n](e, String(t.absolute)), r(), t.resume();
74263
+ Kt[n](e, String(t.absolute)), r(), t.resume();
74233
74264
  } catch (o) {
74234
74265
  return this[O](o, t);
74235
74266
  }
74236
74267
  }
74237
74268
  };
74238
74269
  var lo = (s) => {
74239
- let t = new xe(s), e = s.file, i = Vt.statSync(e);
74270
+ let t = new xe(s), e = s.file, i = Kt.statSync(e);
74240
74271
  new Be(e, {
74241
74272
  readSize: s.maxReadSize || 16 * 1024 * 1024,
74242
74273
  size: i.size
74243
74274
  }).pipe(t);
74244
- }, co = (s, t) => {
74275
+ }, co$1 = (s, t) => {
74245
74276
  let e = new qt(s), i = s.maxReadSize || 16 * 1024 * 1024, r = s.file;
74246
74277
  return new Promise((o, h) => {
74247
- e.on("error", h), e.on("close", o), Vt.stat(r, (a, l) => {
74278
+ e.on("error", h), e.on("close", o), Kt.stat(r, (a, l) => {
74248
74279
  if (a) h(a);
74249
74280
  else {
74250
74281
  let c = new _t(r, {
@@ -74255,22 +74286,22 @@ var lo = (s) => {
74255
74286
  }
74256
74287
  });
74257
74288
  });
74258
- }, fo = K(lo, co, (s) => new xe(s), (s) => new qt(s), (s, t) => {
74289
+ }, fo = K(lo, co$1, (s) => new xe(s), (s) => new qt(s), (s, t) => {
74259
74290
  t?.length && $i(s, t);
74260
74291
  });
74261
74292
  var uo = (s, t) => {
74262
74293
  let e = new Ft(s), i = !0, r, n;
74263
74294
  try {
74264
74295
  try {
74265
- r = Vt.openSync(s.file, "r+");
74296
+ r = Kt.openSync(s.file, "r+");
74266
74297
  } catch (a) {
74267
- if (a?.code === "ENOENT") r = Vt.openSync(s.file, "w+");
74298
+ if (a?.code === "ENOENT") r = Kt.openSync(s.file, "w+");
74268
74299
  else throw a;
74269
74300
  }
74270
- let o = Vt.fstatSync(r), h = Buffer.alloc(512);
74301
+ let o = Kt.fstatSync(r), h = Buffer.alloc(512);
74271
74302
  t: for (n = 0; n < o.size; n += 512) {
74272
74303
  for (let c = 0, d = 0; c < 512; c += d) {
74273
- if (d = Vt.readSync(r, h, c, h.length - c, n + c), n === 0 && h[0] === 31 && h[1] === 139) throw new Error("cannot append to compressed archives");
74304
+ if (d = Kt.readSync(r, h, c, h.length - c, n + c), n === 0 && h[0] === 31 && h[1] === 139) throw new Error("cannot append to compressed archives");
74274
74305
  if (!d) break t;
74275
74306
  }
74276
74307
  let a = new k(h);
@@ -74282,7 +74313,7 @@ var uo = (s, t) => {
74282
74313
  i = !1, mo(s, e, n, r, t);
74283
74314
  } finally {
74284
74315
  if (i) try {
74285
- Vt.closeSync(r);
74316
+ Kt.closeSync(r);
74286
74317
  } catch {}
74287
74318
  }
74288
74319
  }, mo = (s, t, e, i, r) => {
@@ -74295,29 +74326,29 @@ var uo = (s, t) => {
74295
74326
  t = Array.from(t);
74296
74327
  let e = new wt(s), i = (n, o, h) => {
74297
74328
  let a = (T, N) => {
74298
- T ? Vt.close(n, (E) => h(T)) : h(null, N);
74329
+ T ? Kt.close(n, (E) => h(T)) : h(null, N);
74299
74330
  }, l = 0;
74300
74331
  if (o === 0) return a(null, 0);
74301
74332
  let c = 0, d = Buffer.alloc(512), S = (T, N) => {
74302
74333
  if (T || N === void 0) return a(T);
74303
- if (c += N, c < 512 && N) return Vt.read(n, d, c, d.length - c, l + c, S);
74334
+ if (c += N, c < 512 && N) return Kt.read(n, d, c, d.length - c, l + c, S);
74304
74335
  if (l === 0 && d[0] === 31 && d[1] === 139) return a(/* @__PURE__ */ new Error("cannot append to compressed archives"));
74305
74336
  if (c < 512) return a(null, l);
74306
74337
  let E = new k(d);
74307
74338
  if (!E.cksumValid) return a(null, l);
74308
74339
  let x = 512 * Math.ceil((E.size ?? 0) / 512);
74309
74340
  if (l + x + 512 > o || (l += x + 512, l >= o)) return a(null, l);
74310
- s.mtimeCache && E.mtime && s.mtimeCache.set(String(E.path), E.mtime), c = 0, Vt.read(n, d, 0, 512, l, S);
74341
+ s.mtimeCache && E.mtime && s.mtimeCache.set(String(E.path), E.mtime), c = 0, Kt.read(n, d, 0, 512, l, S);
74311
74342
  };
74312
- Vt.read(n, d, 0, 512, l, S);
74343
+ Kt.read(n, d, 0, 512, l, S);
74313
74344
  };
74314
74345
  return new Promise((n, o) => {
74315
74346
  e.on("error", o);
74316
74347
  let h = "r+", a = (l, c) => {
74317
- if (l && l.code === "ENOENT" && h === "r+") return h = "w+", Vt.open(s.file, h, a);
74348
+ if (l && l.code === "ENOENT" && h === "r+") return h = "w+", Kt.open(s.file, h, a);
74318
74349
  if (l || !c) return o(l);
74319
- Vt.fstat(c, (d, S) => {
74320
- if (d) return Vt.close(c, () => o(d));
74350
+ Kt.fstat(c, (d, S) => {
74351
+ if (d) return Kt.close(c, () => o(d));
74321
74352
  i(c, S.size, (T, N) => {
74322
74353
  if (T) return o(T);
74323
74354
  let E = new tt(s.file, {
@@ -74328,7 +74359,7 @@ var uo = (s, t) => {
74328
74359
  });
74329
74360
  });
74330
74361
  };
74331
- Vt.open(s.file, h, a);
74362
+ Kt.open(s.file, h, a);
74332
74363
  });
74333
74364
  }, Eo = (s, t) => {
74334
74365
  t.forEach((e) => {
@@ -76914,7 +76945,7 @@ var WriteTool = class {
76914
76945
  pathClass: this.jian.pathClass(),
76915
76946
  homeDir: this.jian.gethome()
76916
76947
  }),
76917
- execute: ({ signal }) => this.execution(args, path, signal)
76948
+ execute: ({ signal }) => withFileMutationLock(path, () => this.execution(args, path, signal))
76918
76949
  };
76919
76950
  }
76920
76951
  async execution(args, safePath, signal) {
@@ -107549,7 +107580,7 @@ var Agent = class {
107549
107580
  this.eventBus = new EventSubscriptionBus();
107550
107581
  const embedCacheDir = options.screamHomeDir !== void 0 ? join$1(options.screamHomeDir, "cache", "fastembed") : void 0;
107551
107582
  this.embeddingCacheDir = embedCacheDir;
107552
- this.sharedEmbeddingEngine = createFastEmbedEngine(embedCacheDir);
107583
+ this.sharedEmbeddingEngine = createEmbeddingEngine(embedCacheDir);
107553
107584
  this.log = options.log ?? log;
107554
107585
  this.blobStore = options.homedir ? new BlobStore({ blobsDir: join$1(options.homedir, "blobs") }) : void 0;
107555
107586
  this.records = new AgentRecords(this, options.persistence ?? (options.homedir ? new FileSystemAgentRecordPersistence(join$1(options.homedir, "wire.jsonl"), {
@@ -129634,17 +129665,29 @@ function resolveModelCapabilities(alias, provider) {
129634
129665
  max_context_tokens: alias.maxContextSize
129635
129666
  };
129636
129667
  }
129637
- function sessionHeaderFields(provider, sessionId, screamRequestHeaders) {
129668
+ function sessionHeaderFields(provider, sessionId) {
129638
129669
  const name = provider.sessionHeader;
129639
129670
  if (name === void 0 || sessionId === void 0 || sessionId.length === 0) return {};
129640
- const out = { [name]: sessionId };
129671
+ return { [name]: sessionId };
129672
+ }
129673
+ /**
129674
+ * The first-party product identity handed to third-party provider SDKs.
129675
+ *
129676
+ * The OpenAI/Anthropic JS SDKs stamp their own default User-Agent
129677
+ * (`OpenAI/JS x.y.z`) whenever the client sends none, so gateway operators
129678
+ * see the SDK instead of the product. Only the UA is carried over here —
129679
+ * the `X-Msh-*` device headers in `screamRequestHeaders` stay host-scoped
129680
+ * and must not leak to third-party endpoints. Providers can still override
129681
+ * it via `customHeaders` (merged later by the callers).
129682
+ */
129683
+ function firstPartyUserAgentFields(screamRequestHeaders) {
129641
129684
  const userAgent = screamRequestHeaders?.["User-Agent"];
129642
- if (userAgent !== void 0) out["User-Agent"] = userAgent;
129643
- return out;
129685
+ return userAgent === void 0 ? {} : { "User-Agent": userAgent };
129644
129686
  }
129645
129687
  function resolvedHeaderFields(provider, sessionId, screamRequestHeaders) {
129646
129688
  const headers = {
129647
- ...sessionHeaderFields(provider, sessionId, screamRequestHeaders),
129689
+ ...sessionHeaderFields(provider, sessionId),
129690
+ ...firstPartyUserAgentFields(screamRequestHeaders),
129648
129691
  ...provider.customHeaders
129649
129692
  };
129650
129693
  return Object.keys(headers).length > 0 ? headers : void 0;
@@ -133513,12 +133556,12 @@ function getEmbeddingCacheDir() {
133513
133556
  return dir;
133514
133557
  }
133515
133558
  /**
133516
- * Any usable cache: the model directory with its weights present.
133559
+ * Any usable cache: every file the embedding runtime needs is on disk.
133517
133560
  *
133518
- * Such a cache can still be missing sidecars, which FlagEmbedding repairs from
133519
- * the Hub while loading — so callers must not treat it as "no model here".
133520
- * Flagging it as missing would block the very path that repairs it, and
133521
- * fastembed itself skips downloading whenever the model directory exists.
133561
+ * Loading then never downloads. A cache that only looks installed (weights
133562
+ * without the tokenizer, for instance) is deliberately *not* counted as ready:
133563
+ * the setup flow repairs it through one clean re-download instead of failing
133564
+ * halfway through a load, and reporting it as present would block that repair.
133522
133565
  * The existence check itself lives in @scream-code/memory next to the cache
133523
133566
  * layout it inspects.
133524
133567
  */
@@ -133563,15 +133606,21 @@ function getEmbeddingStatus() {
133563
133606
  * Concurrent calls join the in-flight download and share its result instead
133564
133607
  * of failing — the startup warm-up and a user-initiated download must never
133565
133608
  * race into a spurious "download already in progress" error.
133609
+ *
133610
+ * `onProgress` observes the attempt (byte progress, then verify/load phases)
133611
+ * so the caller can keep a spinner honest; it is detached when the attempt
133612
+ * settles either way.
133566
133613
  */
133567
- async function startManualEmbeddingDownload() {
133614
+ async function startManualEmbeddingDownload(onProgress) {
133568
133615
  if (embeddingEngineInstance === void 0) return failureResult("embedding engine not initialized");
133569
133616
  if (embeddingEngineInstance.available) return {
133570
133617
  ok: true,
133571
133618
  alreadyReady: true
133572
133619
  };
133573
133620
  if (downloadPromise !== void 0) return downloadPromise;
133621
+ embeddingEngineInstance.setProgressListener?.(onProgress);
133574
133622
  downloadPromise = performDownload().finally(() => {
133623
+ embeddingEngineInstance?.setProgressListener?.(void 0);
133575
133624
  downloadPromise = void 0;
133576
133625
  });
133577
133626
  return downloadPromise;
@@ -133598,7 +133647,7 @@ async function performDownload() {
133598
133647
  let ok = await embeddingEngineInstance.ensureReady();
133599
133648
  let error = ok ? void 0 : embeddingEngineInstance.lastError;
133600
133649
  if (!ok) {
133601
- if (classifyEmbeddingFailure(error) !== "platform") {
133650
+ if (classifyEmbeddingFailure(error) === "archive") {
133602
133651
  clearEmbeddingModelCache(getEmbeddingCacheDir());
133603
133652
  ok = await embeddingEngineInstance.ensureReady();
133604
133653
  error = ok ? void 0 : embeddingEngineInstance.lastError;
@@ -133624,7 +133673,7 @@ async function performDownload() {
133624
133673
  */
133625
133674
  function embeddingFailureHint(kind) {
133626
133675
  switch (kind) {
133627
- case "platform": return t("knowledge.embedding_platform_hint");
133676
+ case "install": return t("knowledge.embedding_install_hint");
133628
133677
  case "archive": return t("knowledge.embedding_cache_corrupt_hint");
133629
133678
  case "network": return t("knowledge.embedding_network_hint");
133630
133679
  default: return t("knowledge.embedding_unknown_hint");
@@ -133642,6 +133691,27 @@ function embeddingFailureDetail(kind, error) {
133642
133691
  return [embeddingFailureHint(kind), error?.split("\n")[0]].filter(Boolean).join("\n");
133643
133692
  }
133644
133693
  //#endregion
133694
+ //#region src/tui/utils/embedding-progress-label.ts
133695
+ /**
133696
+ * Spinner label for an in-flight model load: byte progress while downloading
133697
+ * ("12.3 MB / 52.9 MB (23%)"), then the verify and load phases.
133698
+ *
133699
+ * Without a content-length the byte count is still reported, so the number
133700
+ * visibly moves on a slow link instead of looking frozen — the failure mode
133701
+ * that used to leave users staring at a generic spinner.
133702
+ */
133703
+ function embeddingProgressLabel(progress) {
133704
+ if (progress.phase === "verify") return t("kw.embedding_verifying");
133705
+ if (progress.phase === "load") return t("kw.embedding_loading");
133706
+ const done = `${(progress.received / 1048576).toFixed(1)} MB`;
133707
+ if (progress.total === void 0) return t("kw.embedding_progress_unknown", { done });
133708
+ return t("kw.embedding_progress", {
133709
+ done,
133710
+ total: `${(progress.total / 1048576).toFixed(1)} MB`,
133711
+ percent: `${Math.min(100, Math.floor(progress.received / progress.total * 100))}`
133712
+ });
133713
+ }
133714
+ //#endregion
133645
133715
  //#region src/tui/commands/experimental-flags.ts
133646
133716
  let snapshot = {};
133647
133717
  /** Replace the cached flag snapshot. Call once after fetching via `harness.getExperimentalFlags()`. */
@@ -133905,6 +133975,20 @@ const BUILTIN_SLASH_COMMANDS = [
133905
133975
  priority: 198,
133906
133976
  availability: "always"
133907
133977
  },
133978
+ {
133979
+ name: "hotkeys",
133980
+ aliases: ["keys"],
133981
+ description: "registry.hotkeys_desc",
133982
+ priority: 197,
133983
+ availability: "always"
133984
+ },
133985
+ {
133986
+ name: "copy",
133987
+ aliases: ["yank"],
133988
+ description: "registry.copy_desc",
133989
+ priority: 196,
133990
+ availability: "always"
133991
+ },
133908
133992
  {
133909
133993
  name: "make-skill",
133910
133994
  aliases: ["makeskill", "craftskill"],
@@ -134175,9 +134259,15 @@ const EXIT_CONFIRM_WINDOW_MS = 1500;
134175
134259
  /** Repository page opened by Ctrl+F while the chat is empty (feedback / star). */
134176
134260
  const EMPTY_SESSION_HINT_URL = "https://github.com/LIUTod/scream-code";
134177
134261
  const SESSION_TIPS = [
134262
+ {
134263
+ i18nKey: "editor.tip_offer",
134264
+ isAd: true,
134265
+ url: "https://todapi.work"
134266
+ },
134178
134267
  {
134179
134268
  i18nKey: "editor.tip_ad",
134180
- isAd: true
134269
+ isAd: true,
134270
+ url: EMPTY_SESSION_HINT_URL
134181
134271
  },
134182
134272
  {
134183
134273
  i18nKey: "editor.tip_1",
@@ -134537,6 +134627,10 @@ var ChoicePickerComponent = class extends Container {
134537
134627
  searchable: opts.searchable === true
134538
134628
  });
134539
134629
  }
134630
+ /** Panel replaced by another one before a choice was made. */
134631
+ dispose() {
134632
+ this.opts.onDispose?.();
134633
+ }
134540
134634
  handleInput(data) {
134541
134635
  if (matchesKey(data, Key.escape)) {
134542
134636
  if (this.list.clearQuery()) return;
@@ -134614,9 +134708,10 @@ function optionLabelStyle(option, selected, colors) {
134614
134708
  //#region src/tui/utils/connect-catalog.ts
134615
134709
  /**
134616
134710
  * Resolve the catalog request for /config.
134617
- * - /config → remote-first catalog browser
134618
134711
  * - /config diy → hidden manual provider setup (not shown in help)
134619
134712
  * - /config image → hidden image-generation API setup (not shown in help)
134713
+ * - anything else → the caller must ask first: a bare `/config` opens the
134714
+ * entry menu (shortcut directory / DIY / image) before any flow starts.
134620
134715
  */
134621
134716
  function resolveConnectCatalogRequest(args) {
134622
134717
  const trimmed = args.trim().toLowerCase();
@@ -135239,6 +135334,71 @@ async function handleConnectCommand(host, args) {
135239
135334
  await handleDiyConfig(host);
135240
135335
  return;
135241
135336
  }
135337
+ const target = await promptConfigEntry(host);
135338
+ if (target === void 0) return;
135339
+ if (target === "diy") {
135340
+ await handleDiyConfig(host);
135341
+ return;
135342
+ }
135343
+ if (target === "image") {
135344
+ await handleImageConfig(host);
135345
+ return;
135346
+ }
135347
+ await runCatalogConnectFlow(host, url);
135348
+ }
135349
+ /**
135350
+ * Entry menu for a bare `/config`. Mirrors `promptImageProviderPreset`: mount
135351
+ * the picker, resolve on select/cancel, and hand the editor back in both cases.
135352
+ */
135353
+ function promptConfigEntry(host) {
135354
+ return new Promise((resolve) => {
135355
+ let settled = false;
135356
+ const settle = (value) => {
135357
+ if (settled) return;
135358
+ settled = true;
135359
+ resolve(value);
135360
+ };
135361
+ const picker = new ChoicePickerComponent({
135362
+ title: t("config.entry_title"),
135363
+ hint: t("config.entry_hint"),
135364
+ colors: host.state.theme.colors,
135365
+ options: [
135366
+ {
135367
+ value: "catalog",
135368
+ label: t("config.entry_quick"),
135369
+ description: t("config.entry_quick_desc")
135370
+ },
135371
+ {
135372
+ value: "diy",
135373
+ label: t("config.entry_diy"),
135374
+ description: t("config.entry_diy_desc")
135375
+ },
135376
+ {
135377
+ value: "image",
135378
+ label: t("config.entry_image"),
135379
+ description: t("config.entry_image_desc")
135380
+ }
135381
+ ],
135382
+ onSelect: (value) => {
135383
+ settle(value);
135384
+ host.restoreEditor();
135385
+ },
135386
+ onCancel: () => {
135387
+ settle(void 0);
135388
+ host.restoreEditor();
135389
+ },
135390
+ onDispose: () => {
135391
+ settle(void 0);
135392
+ }
135393
+ });
135394
+ host.mountEditorReplacement(picker);
135395
+ });
135396
+ }
135397
+ /**
135398
+ * The shortcut flow: remote catalog (with cache and built-in fallbacks) →
135399
+ * provider → model → API key → apply, then refresh the running config.
135400
+ */
135401
+ async function runCatalogConnectFlow(host, url) {
135242
135402
  let catalog;
135243
135403
  const controller = new AbortController();
135244
135404
  const cancel = () => {
@@ -140592,7 +140752,7 @@ async function guidedGoalSetup(host) {
140592
140752
  host.showNotice(t("goal.storm_breaker"), t("goal.conflict_loop"));
140593
140753
  return;
140594
140754
  }
140595
- const { TextInputDialogComponent } = await import("./text-input-dialog-DWepgNF4.mjs");
140755
+ const { TextInputDialogComponent } = await import("./text-input-dialog-CFRUSCi6.mjs");
140596
140756
  const initialDesc = await promptText(host, TextInputDialogComponent, {
140597
140757
  title: t("goal.setup_title_initial"),
140598
140758
  subtitle: t("goal.setup_desc_hint"),
@@ -140613,7 +140773,7 @@ async function guidedGoalSetup(host) {
140613
140773
  await showGoalConfigWizard(host, session, confirmed.trim() || objective, false);
140614
140774
  }
140615
140775
  async function showGoalConfigWizard(host, session, objective, replace) {
140616
- const { TextInputDialogComponent } = await import("./text-input-dialog-DWepgNF4.mjs");
140776
+ const { TextInputDialogComponent } = await import("./text-input-dialog-CFRUSCi6.mjs");
140617
140777
  const turnInput = await promptNumber(host, TextInputDialogComponent, {
140618
140778
  title: t("goal.wizard_title", { objective }),
140619
140779
  subtitle: t("goal.budget_turns_hint"),
@@ -147443,6 +147603,7 @@ function buildRows(servers) {
147443
147603
  const capLabels = getCapabilityLabels();
147444
147604
  const capInfo = (s.capabilities ?? []).map((c) => capLabels[c] ?? c).join(" ");
147445
147605
  const errorInfo = s.error ? ` — ${sanitizeDesc(s.error)}` : "";
147606
+ const pluginInfo = pluginIdFromMcpRuntimeName(s.name) !== void 0 ? t("mcp.plugin_owned") : "";
147446
147607
  rows.push({
147447
147608
  kind: "installed",
147448
147609
  name: s.name,
@@ -147454,6 +147615,7 @@ function buildRows(servers) {
147454
147615
  statusLabel,
147455
147616
  toolInfo,
147456
147617
  capInfo,
147618
+ pluginInfo,
147457
147619
  errorInfo
147458
147620
  ].filter(Boolean).join(" ")
147459
147621
  });
@@ -147497,6 +147659,14 @@ async function handleEnter(host, row) {
147497
147659
  }
147498
147660
  async function handleDelete$1(host, row) {
147499
147661
  if (row.kind !== "installed" || !row.status || row.status === "__section" || row.status === "__empty") return;
147662
+ const pluginId = pluginIdFromMcpRuntimeName(row.name);
147663
+ if (pluginId !== void 0) {
147664
+ host.showError(t("mcp.uninstall_plugin_blocked", {
147665
+ name: row.label,
147666
+ plugin: pluginId
147667
+ }));
147668
+ return;
147669
+ }
147500
147670
  if (!await confirmAction(host, t("mcp.uninstall_confirm", { name: row.label }))) return;
147501
147671
  await uninstallMcp(host, row.name);
147502
147672
  }
@@ -147595,7 +147765,8 @@ async function disableMcp(host, name) {
147595
147765
  if (!session) return;
147596
147766
  try {
147597
147767
  await session.stopMcpServer(name);
147598
- host.showStatus(t("mcp.disabled_done", { name }));
147768
+ const note = pluginIdFromMcpRuntimeName(name) !== void 0 ? ` ${t("mcp.plugin_owned_stop_note")}` : "";
147769
+ host.showStatus(t("mcp.disabled_done", { name }) + note);
147599
147770
  } catch (error) {
147600
147771
  host.showError(t("mcp.disable_failed", { msg: error instanceof Error ? error.message : String(error) }));
147601
147772
  }
@@ -147610,12 +147781,68 @@ async function enableMcp(host, name) {
147610
147781
  host.showError(t("mcp.start_failed", { msg: error instanceof Error ? error.message : String(error) }));
147611
147782
  }
147612
147783
  }
147784
+ /**
147785
+ * Project-level mcp.json files (cwd + parent chain) that declare `name`.
147786
+ *
147787
+ * The runtime list cannot tell where a server came from, but a server declared
147788
+ * by a project config is re-loaded on every start no matter what we delete from
147789
+ * the user-level file — removing it there is the same silent lie as removing a
147790
+ * plugin-owned server. Paths come from the core's own resolver so the rule that
147791
+ * decides "which files count" cannot drift.
147792
+ */
147793
+ function projectConfigFilesDeclaring(name) {
147794
+ let parents;
147795
+ let project;
147796
+ try {
147797
+ const resolved = resolveMcpJsonPaths({
147798
+ cwd: process.cwd(),
147799
+ homeDir: getDataDir()
147800
+ });
147801
+ parents = resolved.parents;
147802
+ project = resolved.project;
147803
+ } catch {
147804
+ return [];
147805
+ }
147806
+ return [...parents, project].filter((file) => {
147807
+ if (!existsSync(file)) return false;
147808
+ try {
147809
+ const parsed = JSON.parse(readFileSync(file, "utf-8"));
147810
+ return parsed !== null && typeof parsed === "object" && parsed.mcpServers !== void 0 && Object.hasOwn(parsed.mcpServers, name);
147811
+ } catch {
147812
+ return false;
147813
+ }
147814
+ });
147815
+ }
147613
147816
  async function uninstallMcp(host, name) {
147614
147817
  const session = host.session;
147615
147818
  if (!session) return;
147819
+ const pluginId = pluginIdFromMcpRuntimeName(name);
147820
+ if (pluginId !== void 0) {
147821
+ host.showError(t("mcp.uninstall_plugin_blocked", {
147822
+ name,
147823
+ plugin: pluginId
147824
+ }));
147825
+ return;
147826
+ }
147827
+ const projectFiles = projectConfigFilesDeclaring(name);
147828
+ if (projectFiles.length > 0) {
147829
+ host.showError(t("mcp.uninstall_project_owned", {
147830
+ name,
147831
+ files: projectFiles.join(", ")
147832
+ }));
147833
+ return;
147834
+ }
147616
147835
  try {
147617
147836
  await session.removeMcpServer(name);
147618
147837
  await removeMcpConfig(host, name);
147838
+ let stillListed = false;
147839
+ try {
147840
+ stillListed = (await session.listMcpServers()).some((server) => server.name === name);
147841
+ } catch {}
147842
+ if (stillListed) {
147843
+ host.showError(t("mcp.uninstall_verify_failed", { name }));
147844
+ return;
147845
+ }
147619
147846
  host.showStatus(t("mcp.uninstalled", { name }));
147620
147847
  } catch (error) {
147621
147848
  host.showError(t("mcp.uninstall_failed", { msg: error instanceof Error ? error.message : String(error) }));
@@ -149657,6 +149884,147 @@ async function handleMermaidCommand(host, args) {
149657
149884
  }));
149658
149885
  }
149659
149886
  //#endregion
149887
+ //#region src/utils/clipboard/clipboard-text.ts
149888
+ /**
149889
+ * Write plain text to the system clipboard with platform-specific commands.
149890
+ *
149891
+ * scream-core's clipboard layer is read-only (clipboard-native / clipboard-image),
149892
+ * so the TUI's "copy selected text" needs its own writer. Used to back the
149893
+ * pi-tui `copySelection` hook — return true/false so the TUI can flash
149894
+ * "Copied!" or "Copy failed".
149895
+ *
149896
+ * Platform mapping:
149897
+ * macOS -> pbcopy
149898
+ * Windows-> powershell Set-Clipboard (base64 payload, avoids quoting issues)
149899
+ * Linux -> wl-copy (Wayland) / xclip or xsel (X11), tried in a candidate
149900
+ * chain so a missing tool (Ubuntu ships neither by default)
149901
+ * falls through to the next one instead of failing outright.
149902
+ */
149903
+ var ClipboardTextError = class extends Error {
149904
+ constructor(message) {
149905
+ super(message);
149906
+ this.name = "ClipboardTextError";
149907
+ }
149908
+ };
149909
+ const defaultRunCommand = (command, args, input) => {
149910
+ const result = spawnSync(command, args, {
149911
+ input,
149912
+ encoding: "utf8",
149913
+ timeout: 3e3
149914
+ });
149915
+ if (result.status === 0) return { ok: true };
149916
+ return {
149917
+ ok: false,
149918
+ error: result.error?.message ?? result.stderr?.toString() ?? `exit ${result.status}`
149919
+ };
149920
+ };
149921
+ function detectPlatform() {
149922
+ if (process.platform === "darwin") return "macos";
149923
+ if (process.platform === "win32") return "windows";
149924
+ if (process.platform === "linux") return process.env["WAYLAND_DISPLAY"] ? "linux-wayland" : "linux-x11";
149925
+ return "unsupported";
149926
+ }
149927
+ function linuxCandidates(platform) {
149928
+ const wl = {
149929
+ command: "wl-copy",
149930
+ args: []
149931
+ };
149932
+ const xclip = {
149933
+ command: "xclip",
149934
+ args: [
149935
+ "-selection",
149936
+ "clipboard",
149937
+ "-i"
149938
+ ]
149939
+ };
149940
+ const xsel = {
149941
+ command: "xsel",
149942
+ args: ["--clipboard", "--input"]
149943
+ };
149944
+ return platform === "linux-wayland" ? [
149945
+ wl,
149946
+ xclip,
149947
+ xsel
149948
+ ] : [
149949
+ xclip,
149950
+ xsel,
149951
+ wl
149952
+ ];
149953
+ }
149954
+ /**
149955
+ * Write `text` to the system clipboard. Throws ClipboardTextError when the
149956
+ * platform is unsupported or every candidate command fails, so callers can
149957
+ * surface a "Copy failed" indicator.
149958
+ */
149959
+ async function writeTextClipboard(text, runCommand = defaultRunCommand) {
149960
+ const platform = detectPlatform();
149961
+ let command;
149962
+ let args;
149963
+ let input;
149964
+ switch (platform) {
149965
+ case "macos":
149966
+ command = "pbcopy";
149967
+ args = [];
149968
+ input = text;
149969
+ break;
149970
+ case "windows": {
149971
+ const base64 = Buffer.from(text, "utf8").toString("base64");
149972
+ command = "powershell";
149973
+ args = [
149974
+ "-NoProfile",
149975
+ "-Command",
149976
+ `[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('${base64}')) | Set-Clipboard`
149977
+ ];
149978
+ input = "";
149979
+ break;
149980
+ }
149981
+ case "linux-wayland":
149982
+ case "linux-x11": {
149983
+ const failures = [];
149984
+ for (const candidate of linuxCandidates(platform)) {
149985
+ const result = runCommand(candidate.command, candidate.args, text);
149986
+ if (result.ok) return;
149987
+ failures.push(`${candidate.command}: ${result.error ?? "unknown error"}`);
149988
+ }
149989
+ throw new ClipboardTextError(`failed to copy to clipboard (${failures.join(" | ")}). Install wl-clipboard (Wayland: sudo apt install wl-clipboard) or xclip/xsel (X11: sudo apt install xclip xsel)`);
149990
+ }
149991
+ default: throw new ClipboardTextError(`unsupported clipboard platform: ${process.platform}`);
149992
+ }
149993
+ const result = runCommand(command, args, input);
149994
+ if (!result.ok) throw new ClipboardTextError(`failed to copy to clipboard: ${command} ${result.error ?? "unknown error"}`);
149995
+ }
149996
+ //#endregion
149997
+ //#region src/tui/commands/copy.ts
149998
+ /**
149999
+ * `/copy` — put the most recent assistant reply on the system clipboard.
150000
+ *
150001
+ * Only `assistant` transcript entries are considered: tool output and notices
150002
+ * are not "the reply", and an empty/whitespace entry (a cancelled turn) would
150003
+ * otherwise count as copyable. Clipboard failures are reported, never swallowed:
150004
+ * the user asked for a side effect and must know whether it landed.
150005
+ */
150006
+ async function handleCopyCommand(host) {
150007
+ const entries = host.state.transcriptEntries;
150008
+ let latest;
150009
+ for (let index = entries.length - 1; index >= 0; index -= 1) {
150010
+ const entry = entries[index];
150011
+ if (entry.kind !== "assistant") continue;
150012
+ if (entry.content.trim().length === 0) continue;
150013
+ latest = entry.content;
150014
+ break;
150015
+ }
150016
+ if (latest === void 0) {
150017
+ host.showStatus(t("tui.copy_empty"));
150018
+ return;
150019
+ }
150020
+ try {
150021
+ await writeTextClipboard(latest);
150022
+ host.showStatus(t("tui.copy_done"));
150023
+ } catch (error) {
150024
+ host.showError(t("tui.copy_failed", { msg: error instanceof Error ? error.message : String(error) }));
150025
+ }
150026
+ }
150027
+ //#endregion
149660
150028
  //#region src/tui/commands/like.ts
149661
150029
  function promptTextInput$1(host, title, opts) {
149662
150030
  const { promise, resolve } = Promise.withResolvers();
@@ -151648,7 +152016,9 @@ async function ensureEmbeddingReadyInteractive(host) {
151648
152016
  return false;
151649
152017
  }
151650
152018
  const spinner = host.showProgressSpinner(t("knowledge.loading_model"));
151651
- const { ok, error, failureKind } = await startManualEmbeddingDownload();
152019
+ const { ok, error, failureKind } = await startManualEmbeddingDownload((progress) => {
152020
+ spinner.setLabel(embeddingProgressLabel(progress));
152021
+ });
151652
152022
  spinner.stop({
151653
152023
  ok,
151654
152024
  label: ok ? t("kw.embedding_ready") : t("kw.embedding_failed")
@@ -152571,6 +152941,12 @@ async function handleBuiltInSlashCommand(host, name, args) {
152571
152941
  case "help":
152572
152942
  host.showHelpPanel();
152573
152943
  return;
152944
+ case "hotkeys":
152945
+ host.showHotkeysPanel();
152946
+ return;
152947
+ case "copy":
152948
+ await handleCopyCommand(host);
152949
+ return;
152574
152950
  case "version":
152575
152951
  host.showStatus(`Scream Code v${host.state.appState.version}`);
152576
152952
  return;
@@ -152748,4 +153124,4 @@ async function handleBuiltInSlashCommand(host, name, args) {
152748
153124
  }
152749
153125
  }
152750
153126
  //#endregion
152751
- export { refineGoal as $, ScreamHarness as $n, FooterComponent as $t, renderDiffLinesClustered as A, setExperimentalFlags as An, isEmptySessionHintDismissed as At, AssistantMessageComponent as B, saveTuiConfig as Bn, ENABLE_TERMINAL_FOCUS_REPORTING as Bt, readJsonlFile as C, getCtrlDHint as Cn, supportsBalance as Ct, UserMessageComponent as D, BUILTIN_SLASH_COMMANDS as Dn, resolveThemeSync as Dt, handleRevokeCommand as E, buildSkillSlashCommands as En, showUsage as Et, NoticeMessageComponent as F, PIXEL_PULSE_FRAMES as Fn, getColorPalette as Ft, BackgroundAgentStatusComponent as G, detectInstallSource as Gn, OSC11_RESPONSE_PREFIX_NO_ESC as Gt, charsForTokenBudget as H, getDataDir as Hn, OSC11_QUERY as Ht, StatusMessageComponent as I, PULSE_WAVE_FRAMES as In, detectTerminalTheme as It, BREATHE_CYCLE_MS as J, CLI_USER_AGENT_PRODUCT as Jn, TERMINAL_FOCUS_OUT as Jt, AgentGroupComponent as K, CLI_COMMAND_NAME as Kn, QUERY_TERMINAL_THEME as Kt, replaceTabs as L, TuiConfigParseError as Ln, parseOsc11BackgroundTheme as Lt, langFromPath as M, getKnowledgeStore as Mn, toggleEmptySessionHint as Mt, CachedContainer as N, hasEmbeddingModelCache as Nn, createThemeStyles as Nt, ToolCallComponent as O, sortSlashCommands as On, createEditorTheme as Ot, ThinkingComponent as P, startManualEmbeddingDownload as Pn, contrastTextHex as Pt, clearGoalState as Q, saveCatalogCache as Qn, isStreaming as Qt, sanitizeShellOutput as R, TuiLikePreferencesSchema as Rn, DISABLE_TERMINAL_FOCUS_REPORTING as Rt, appendJsonlLine as S, getCtrlCHint as Sn, refreshProviderBalance as St, getDaemonInstructions as T, getNoActiveSessionMessage as Tn, showStatusReport as Tt, estimateTokens as U, getInputHistoryFile as Un, OSC11_RESPONSE as Ut, ActivityGroupComponent as V, detectShellEnvironment as Vn, ENABLE_TERMINAL_THEME_REPORTING as Vt, getSharedSpeedTracker as W, getLogDir as Wn, OSC11_RESPONSE_PREFIX as Wt, resetBreathingClock as X, DEFAULT_CATALOG_URL as Xn, TERMINAL_THEME_LIGHT as Xt, getBreathingFrame as Y, PRODUCT_NAME as Yn, TERMINAL_THEME_DARK as Yt, CompactionComponent as Z, fetchCatalog as Zn, isBusy as Zt, handleMcpCommand as _, EMPTY_SESSION_HINT_URL as _n, handleWolfpackCommand as _t, buildRoleAdditionalText as a, handleLogoutCommand as an, MCP_OAUTH_AUTHORIZATION_URL_TOOL_UPDATE as ar, isInternalMessage as at, refreshUpdateCache as b, SESSION_TIPS as bn, showPermissionPicker as bt, handleSkillCommand as c, appendSessionHeaderHint as cn, resolveScreamHome as cr, getModelCycleLevel as ct, isExpandable as d, formatErrorMessage as dn, resolveGlobalLogPath as dr, handleCompactCommand as dt, lerpGradient as en, encodeWorkDirKey as er, handleExportDebugZipCommand as et, isPlanExpandable as f, isTodoItemShape as fn, isScreamError as fr, handleEditorCommand as ft, handleChannelCommand as g, truncateErrorMessage as gn, handleThemeCommand as gt, handleMemoryCommand as h, stringValue as hn, SCREAM_ERROR_INFO as hr, handlePlanCommand as ht, openUrl as i, handleConnectCommand as in, removeSessionIndexEntry as ir, handleTitleCommand as it, highlightLines as j, embeddingFailureDetail as jn, isTurnElapsedEnabled as jt, renderDiffLines as k, isExperimentalFlagEnabled as kn, createMarkdownTheme as kt, disposeChildren as l, appendStreamingArgsPreview as ln, flushDiagnosticLogs as lr, handleAutoCommand as lt, formatMemoryMemoForInjection as m, serializeToolResultOutput as mn, ErrorCodes as mr, handleModelCommand as mt, clearEvalPanelState as n, handleTraceCommand as nn, appendSessionIndexEntry as nr, handleForkCommand as nt, syncDiagramCapabilityPrompt as o, printableChar as on, isRealUserPrompt as or, toTerminalHyperlink as ot, MoonLoader as p, parseStreamingArgs as pn, isOrphanedToolCallError as pr, handleFusionPlanCommand as pt, WelcomeComponent as q, CLI_UI_MODE as qn, TERMINAL_FOCUS_IN as qt, handleGrantsCommand as r, handleSearchCommand as rn, readSessionIndex as rr, handleInitCommand as rt, handleExtensionCommand as s, STATUS_BULLET as sn, parseRlmMaxDepthArg as sr, changeThinkingLevel as st, dispatchInput as t, SubagentSlots as tn, normalizeWorkDir as tr, handleExportMdCommand as tt, hasDispose as u, argsRecord as un, log as ur, handleBotCommand as ut, handleUpdateCommand as v, EXIT_CONFIRM_WINDOW_MS as vn, handleYoloCommand as vt, handleCcCommand as w, getLlmNotSetMessage as wn, clearInfoPanelState as wt, readUpdateCache as x, TIP_ROTATION_INTERVAL_MS as xn, showSettingsSelector as xt, selectUpdateTarget as y, MAIN_AGENT_ID$1 as yn, showModelPicker as yt, SkillActivationComponent as z, loadTuiConfig as zn, DISABLE_TERMINAL_THEME_REPORTING as zt };
153127
+ export { clearGoalState as $, fetchCatalog as $n, isStreaming as $t, renderDiffLines as A, isExperimentalFlagEnabled as An, createMarkdownTheme as At, SkillActivationComponent as B, TuiLikePreferencesSchema as Bn, DISABLE_TERMINAL_THEME_REPORTING as Bt, appendJsonlLine as C, getCtrlCHint as Cn, refreshProviderBalance as Ct, handleRevokeCommand as D, buildSkillSlashCommands as Dn, showUsage as Dt, getDaemonInstructions as E, getNoActiveSessionMessage as En, showStatusReport as Et, ThinkingComponent as F, hasEmbeddingModelCache as Fn, contrastTextHex as Ft, getSharedSpeedTracker as G, getInputHistoryFile as Gn, OSC11_RESPONSE_PREFIX as Gt, ActivityGroupComponent as H, saveTuiConfig as Hn, ENABLE_TERMINAL_THEME_REPORTING as Ht, NoticeMessageComponent as I, startManualEmbeddingDownload as In, getColorPalette as It, WelcomeComponent as J, CLI_COMMAND_NAME as Jn, TERMINAL_FOCUS_IN as Jt, BackgroundAgentStatusComponent as K, getLogDir as Kn, OSC11_RESPONSE_PREFIX_NO_ESC as Kt, StatusMessageComponent as L, PIXEL_PULSE_FRAMES as Ln, detectTerminalTheme as Lt, highlightLines as M, embeddingProgressLabel as Mn, isTurnElapsedEnabled as Mt, langFromPath as N, embeddingFailureDetail as Nn, toggleEmptySessionHint as Nt, UserMessageComponent as O, BUILTIN_SLASH_COMMANDS as On, resolveThemeSync as Ot, CachedContainer as P, getKnowledgeStore as Pn, createThemeStyles as Pt, CompactionComponent as Q, DEFAULT_CATALOG_URL as Qn, isBusy as Qt, replaceTabs as R, PULSE_WAVE_FRAMES as Rn, parseOsc11BackgroundTheme as Rt, readUpdateCache as S, TIP_ROTATION_INTERVAL_MS as Sn, showSettingsSelector as St, handleCcCommand as T, getLlmNotSetMessage as Tn, clearInfoPanelState as Tt, charsForTokenBudget as U, detectShellEnvironment as Un, OSC11_QUERY as Ut, AssistantMessageComponent as V, loadTuiConfig as Vn, ENABLE_TERMINAL_FOCUS_REPORTING as Vt, estimateTokens as W, getDataDir as Wn, OSC11_RESPONSE as Wt, getBreathingFrame as X, CLI_USER_AGENT_PRODUCT as Xn, TERMINAL_THEME_DARK as Xt, BREATHE_CYCLE_MS as Y, CLI_UI_MODE as Yn, TERMINAL_FOCUS_OUT as Yt, resetBreathingClock as Z, PRODUCT_NAME as Zn, TERMINAL_THEME_LIGHT as Zt, handleChannelCommand as _, truncateErrorMessage as _n, SCREAM_ERROR_INFO as _r, handleThemeCommand as _t, buildRoleAdditionalText as a, handleConnectCommand as an, readSessionIndex as ar, handleTitleCommand as at, selectUpdateTarget as b, MAIN_AGENT_ID$1 as bn, showModelPicker as bt, handleExtensionCommand as c, STATUS_BULLET as cn, isRealUserPrompt as cr, changeThinkingLevel as ct, hasDispose as d, argsRecord as dn, flushDiagnosticLogs as dr, handleBotCommand as dt, FooterComponent as en, saveCatalogCache as er, refineGoal as et, isExpandable as f, formatErrorMessage as fn, log as fr, handleCompactCommand as ft, handleMemoryCommand as g, stringValue as gn, ErrorCodes as gr, handlePlanCommand as gt, formatMemoryMemoForInjection as h, serializeToolResultOutput as hn, isOrphanedToolCallError as hr, handleModelCommand as ht, openUrl as i, handleSearchCommand as in, appendSessionIndexEntry as ir, handleInitCommand as it, renderDiffLinesClustered as j, setExperimentalFlags as jn, isEmptySessionHintDismissed as jt, ToolCallComponent as k, sortSlashCommands as kn, createEditorTheme as kt, handleSkillCommand as l, appendSessionHeaderHint as ln, parseRlmMaxDepthArg as lr, getModelCycleLevel as lt, MoonLoader as m, parseStreamingArgs as mn, isScreamError as mr, handleFusionPlanCommand as mt, clearEvalPanelState as n, SubagentSlots as nn, encodeWorkDirKey as nr, handleExportMdCommand as nt, writeTextClipboard as o, handleLogoutCommand as on, removeSessionIndexEntry as or, isInternalMessage as ot, isPlanExpandable as p, isTodoItemShape as pn, resolveGlobalLogPath as pr, handleEditorCommand as pt, AgentGroupComponent as q, detectInstallSource as qn, QUERY_TERMINAL_THEME as qt, handleGrantsCommand as r, handleTraceCommand as rn, normalizeWorkDir as rr, handleForkCommand as rt, syncDiagramCapabilityPrompt as s, printableChar as sn, MCP_OAUTH_AUTHORIZATION_URL_TOOL_UPDATE as sr, toTerminalHyperlink as st, dispatchInput as t, lerpGradient as tn, ScreamHarness as tr, handleExportDebugZipCommand as tt, disposeChildren as u, appendStreamingArgsPreview as un, resolveScreamHome as ur, handleAutoCommand as ut, handleMcpCommand as v, EMPTY_SESSION_HINT_URL as vn, handleWolfpackCommand as vt, readJsonlFile as w, getCtrlDHint as wn, supportsBalance as wt, refreshUpdateCache as x, SESSION_TIPS as xn, showPermissionPicker as xt, handleUpdateCommand as y, EXIT_CONFIRM_WINDOW_MS as yn, handleYoloCommand as yt, sanitizeShellOutput as z, TuiConfigParseError as zn, DISABLE_TERMINAL_FOCUS_REPORTING as zt };