@lazehq/cli 0.1.136 → 0.1.138

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.
Files changed (2) hide show
  1. package/dist/laze.mjs +744 -383
  2. package/package.json +1 -1
package/dist/laze.mjs CHANGED
@@ -849,9 +849,9 @@ var require_node_gyp_build = __commonJS({
849
849
  var debug = getFirst(path.join(dir, "build/Debug"), matchBuild);
850
850
  if (debug) return debug;
851
851
  }
852
- var prebuild = resolve27(dir);
852
+ var prebuild = resolve29(dir);
853
853
  if (prebuild) return prebuild;
854
- var nearby = resolve27(path.dirname(process.execPath));
854
+ var nearby = resolve29(path.dirname(process.execPath));
855
855
  if (nearby) return nearby;
856
856
  var target = [
857
857
  "platform=" + platform,
@@ -867,7 +867,7 @@ var require_node_gyp_build = __commonJS({
867
867
  // eslint-disable-line
868
868
  ].filter(Boolean).join(" ");
869
869
  throw new Error("No native build was found for " + target + "\n loaded from: " + dir + "\n");
870
- function resolve27(dir2) {
870
+ function resolve29(dir2) {
871
871
  var tuples = readdirSync(path.join(dir2, "prebuilds")).map(parseTuple);
872
872
  var tuple2 = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0];
873
873
  if (!tuple2) return;
@@ -886,8 +886,8 @@ var require_node_gyp_build = __commonJS({
886
886
  }
887
887
  }
888
888
  function getFirst(dir, filter) {
889
- var files2 = readdirSync(dir).filter(filter);
890
- return files2[0] && path.join(dir, files2[0]);
889
+ var files3 = readdirSync(dir).filter(filter);
890
+ return files3[0] && path.join(dir, files3[0]);
891
891
  }
892
892
  function matchBuild(name3) {
893
893
  return /\.node$/.test(name3);
@@ -7314,9 +7314,9 @@ var require_dispatcher_base = __commonJS({
7314
7314
  }
7315
7315
  close(callback) {
7316
7316
  if (callback === void 0) {
7317
- return new Promise((resolve27, reject) => {
7317
+ return new Promise((resolve29, reject) => {
7318
7318
  this.close((err, data) => {
7319
- return err ? reject(err) : resolve27(data);
7319
+ return err ? reject(err) : resolve29(data);
7320
7320
  });
7321
7321
  });
7322
7322
  }
@@ -7354,9 +7354,9 @@ var require_dispatcher_base = __commonJS({
7354
7354
  err = null;
7355
7355
  }
7356
7356
  if (callback === void 0) {
7357
- return new Promise((resolve27, reject) => {
7357
+ return new Promise((resolve29, reject) => {
7358
7358
  this.destroy(err, (err2, data) => {
7359
- return err2 ? reject(err2) : resolve27(data);
7359
+ return err2 ? reject(err2) : resolve29(data);
7360
7360
  });
7361
7361
  });
7362
7362
  }
@@ -12311,12 +12311,12 @@ upgrade: ${upgrade2}\r
12311
12311
  cb();
12312
12312
  }
12313
12313
  }
12314
- const waitForDrain = () => new Promise((resolve27, reject) => {
12314
+ const waitForDrain = () => new Promise((resolve29, reject) => {
12315
12315
  assert2(callback === null);
12316
12316
  if (socket[kError]) {
12317
12317
  reject(socket[kError]);
12318
12318
  } else {
12319
- callback = resolve27;
12319
+ callback = resolve29;
12320
12320
  }
12321
12321
  });
12322
12322
  socket.on("close", onDrain).on("drain", onDrain);
@@ -13674,12 +13674,12 @@ var require_client_h2 = __commonJS({
13674
13674
  cb();
13675
13675
  }
13676
13676
  }
13677
- const waitForDrain = () => new Promise((resolve27, reject) => {
13677
+ const waitForDrain = () => new Promise((resolve29, reject) => {
13678
13678
  assert2(callback === null);
13679
13679
  if (socket[kError]) {
13680
13680
  reject(socket[kError]);
13681
13681
  } else {
13682
- callback = resolve27;
13682
+ callback = resolve29;
13683
13683
  }
13684
13684
  });
13685
13685
  h2stream.on("close", onDrain).on("drain", onDrain);
@@ -14047,16 +14047,16 @@ var require_client = __commonJS({
14047
14047
  return this[kNeedDrain] < 2;
14048
14048
  }
14049
14049
  [kClose]() {
14050
- return new Promise((resolve27) => {
14050
+ return new Promise((resolve29) => {
14051
14051
  if (this[kSize]) {
14052
- this[kClosedResolve] = resolve27;
14052
+ this[kClosedResolve] = resolve29;
14053
14053
  } else {
14054
- resolve27(null);
14054
+ resolve29(null);
14055
14055
  }
14056
14056
  });
14057
14057
  }
14058
14058
  [kDestroy](err) {
14059
- return new Promise((resolve27) => {
14059
+ return new Promise((resolve29) => {
14060
14060
  const requests2 = this[kQueue].splice(this[kPendingIdx]);
14061
14061
  for (let i = 0; i < requests2.length; i++) {
14062
14062
  const request2 = requests2[i];
@@ -14069,7 +14069,7 @@ var require_client = __commonJS({
14069
14069
  this[kClosedResolve]();
14070
14070
  this[kClosedResolve] = null;
14071
14071
  }
14072
- resolve27(null);
14072
+ resolve29(null);
14073
14073
  };
14074
14074
  if (this[kHTTPContext]) {
14075
14075
  this[kHTTPContext].destroy(err, callback);
@@ -14482,8 +14482,8 @@ var require_pool_base = __commonJS({
14482
14482
  }
14483
14483
  return Promise.all(closeAll);
14484
14484
  } else {
14485
- return new Promise((resolve27) => {
14486
- this[kClosedResolve] = resolve27;
14485
+ return new Promise((resolve29) => {
14486
+ this[kClosedResolve] = resolve29;
14487
14487
  });
14488
14488
  }
14489
14489
  }
@@ -15591,7 +15591,7 @@ var require_socks5_client = __commonJS({
15591
15591
  return;
15592
15592
  }
15593
15593
  const version2 = this.buffer[0];
15594
- const reply2 = this.buffer[1];
15594
+ const reply3 = this.buffer[1];
15595
15595
  const addressType = this.buffer[3];
15596
15596
  if (version2 !== SOCKS_VERSION) {
15597
15597
  throw new Socks5ProxyError(`Invalid SOCKS version in reply: ${version2}`, "UND_ERR_SOCKS5_REPLY_VERSION");
@@ -15612,9 +15612,9 @@ var require_socks5_client = __commonJS({
15612
15612
  if (this.buffer.length < responseLength) {
15613
15613
  return;
15614
15614
  }
15615
- if (reply2 !== REPLY_CODES.SUCCEEDED) {
15616
- const errorMessage = this.getReplyErrorMessage(reply2);
15617
- throw new Socks5ProxyError(`SOCKS5 connection failed: ${errorMessage}`, `UND_ERR_SOCKS5_REPLY_${reply2}`);
15615
+ if (reply3 !== REPLY_CODES.SUCCEEDED) {
15616
+ const errorMessage = this.getReplyErrorMessage(reply3);
15617
+ throw new Socks5ProxyError(`SOCKS5 connection failed: ${errorMessage}`, `UND_ERR_SOCKS5_REPLY_${reply3}`);
15618
15618
  }
15619
15619
  let boundAddress;
15620
15620
  let offset = 4;
@@ -15645,8 +15645,8 @@ var require_socks5_client = __commonJS({
15645
15645
  /**
15646
15646
  * Get human-readable error message for reply code
15647
15647
  */
15648
- getReplyErrorMessage(reply2) {
15649
- switch (reply2) {
15648
+ getReplyErrorMessage(reply3) {
15649
+ switch (reply3) {
15650
15650
  case REPLY_CODES.GENERAL_FAILURE:
15651
15651
  return "General SOCKS server failure";
15652
15652
  case REPLY_CODES.CONNECTION_NOT_ALLOWED:
@@ -15664,7 +15664,7 @@ var require_socks5_client = __commonJS({
15664
15664
  case REPLY_CODES.ADDRESS_TYPE_NOT_SUPPORTED:
15665
15665
  return "Address type not supported";
15666
15666
  default:
15667
- return `Unknown error code: ${reply2}`;
15667
+ return `Unknown error code: ${reply3}`;
15668
15668
  }
15669
15669
  }
15670
15670
  };
@@ -16994,7 +16994,7 @@ var require_readable = __commonJS({
16994
16994
  if (this._readableState.closeEmitted) {
16995
16995
  return Promise.resolve(null);
16996
16996
  }
16997
- return new Promise((resolve27, reject) => {
16997
+ return new Promise((resolve29, reject) => {
16998
16998
  if (this[kContentLength] && this[kContentLength] > limit || this[kBytesRead] > limit) {
16999
16999
  this.destroy(new AbortError());
17000
17000
  }
@@ -17008,11 +17008,11 @@ var require_readable = __commonJS({
17008
17008
  if (signal.aborted) {
17009
17009
  reject(signal.reason ?? new AbortError());
17010
17010
  } else {
17011
- resolve27(null);
17011
+ resolve29(null);
17012
17012
  }
17013
17013
  });
17014
17014
  } else {
17015
- this.on("close", resolve27);
17015
+ this.on("close", resolve29);
17016
17016
  }
17017
17017
  this.on("error", noop2).on("data", () => {
17018
17018
  if (this[kBytesRead] > limit) {
@@ -17040,7 +17040,7 @@ var require_readable = __commonJS({
17040
17040
  }
17041
17041
  function consume(stream, type) {
17042
17042
  assert2(!stream[kConsume]);
17043
- return new Promise((resolve27, reject) => {
17043
+ return new Promise((resolve29, reject) => {
17044
17044
  if (isUnusable(stream)) {
17045
17045
  const rState = stream._readableState;
17046
17046
  if (rState.destroyed && rState.closeEmitted === false) {
@@ -17055,7 +17055,7 @@ var require_readable = __commonJS({
17055
17055
  stream[kConsume] = {
17056
17056
  type,
17057
17057
  stream,
17058
- resolve: resolve27,
17058
+ resolve: resolve29,
17059
17059
  reject,
17060
17060
  length: 0,
17061
17061
  body: []
@@ -17133,18 +17133,18 @@ var require_readable = __commonJS({
17133
17133
  return buffer;
17134
17134
  }
17135
17135
  function consumeEnd(consume2, encoding) {
17136
- const { type, body, resolve: resolve27, stream, length } = consume2;
17136
+ const { type, body, resolve: resolve29, stream, length } = consume2;
17137
17137
  try {
17138
17138
  if (type === "text") {
17139
- resolve27(chunksDecode(body, length, encoding));
17139
+ resolve29(chunksDecode(body, length, encoding));
17140
17140
  } else if (type === "json") {
17141
- resolve27(JSON.parse(chunksDecode(body, length, encoding)));
17141
+ resolve29(JSON.parse(chunksDecode(body, length, encoding)));
17142
17142
  } else if (type === "arrayBuffer") {
17143
- resolve27(chunksConcat(body, length).buffer);
17143
+ resolve29(chunksConcat(body, length).buffer);
17144
17144
  } else if (type === "blob") {
17145
- resolve27(new Blob(body, { type: stream[kContentType] }));
17145
+ resolve29(new Blob(body, { type: stream[kContentType] }));
17146
17146
  } else if (type === "bytes") {
17147
- resolve27(chunksConcat(body, length));
17147
+ resolve29(chunksConcat(body, length));
17148
17148
  }
17149
17149
  consumeFinish(consume2);
17150
17150
  } catch (err) {
@@ -17363,9 +17363,9 @@ var require_api_request = __commonJS({
17363
17363
  };
17364
17364
  function request2(opts, callback) {
17365
17365
  if (callback === void 0) {
17366
- return new Promise((resolve27, reject) => {
17366
+ return new Promise((resolve29, reject) => {
17367
17367
  request2.call(this, opts, (err, data) => {
17368
- return err ? reject(err) : resolve27(data);
17368
+ return err ? reject(err) : resolve29(data);
17369
17369
  });
17370
17370
  });
17371
17371
  }
@@ -17626,9 +17626,9 @@ var require_api_stream = __commonJS({
17626
17626
  };
17627
17627
  function stream(opts, factory, callback) {
17628
17628
  if (callback === void 0) {
17629
- return new Promise((resolve27, reject) => {
17629
+ return new Promise((resolve29, reject) => {
17630
17630
  stream.call(this, opts, factory, (err, data) => {
17631
- return err ? reject(err) : resolve27(data);
17631
+ return err ? reject(err) : resolve29(data);
17632
17632
  });
17633
17633
  });
17634
17634
  }
@@ -17928,9 +17928,9 @@ var require_api_upgrade = __commonJS({
17928
17928
  };
17929
17929
  function upgrade2(opts, callback) {
17930
17930
  if (callback === void 0) {
17931
- return new Promise((resolve27, reject) => {
17931
+ return new Promise((resolve29, reject) => {
17932
17932
  upgrade2.call(this, opts, (err, data) => {
17933
- return err ? reject(err) : resolve27(data);
17933
+ return err ? reject(err) : resolve29(data);
17934
17934
  });
17935
17935
  });
17936
17936
  }
@@ -18024,9 +18024,9 @@ var require_api_connect = __commonJS({
18024
18024
  };
18025
18025
  function connect8(opts, callback) {
18026
18026
  if (callback === void 0) {
18027
- return new Promise((resolve27, reject) => {
18027
+ return new Promise((resolve29, reject) => {
18028
18028
  connect8.call(this, opts, (err, data) => {
18029
- return err ? reject(err) : resolve27(data);
18029
+ return err ? reject(err) : resolve29(data);
18030
18030
  });
18031
18031
  });
18032
18032
  }
@@ -19486,8 +19486,8 @@ var require_snapshot_utils = __commonJS({
19486
19486
  var require_snapshot_recorder = __commonJS({
19487
19487
  "../../node_modules/.pnpm/undici@8.10.0/node_modules/undici/lib/mock/snapshot-recorder.js"(exports, module) {
19488
19488
  "use strict";
19489
- var { writeFile: writeFile12, readFile: readFile40, mkdir: mkdir14 } = __require("node:fs/promises");
19490
- var { dirname: dirname29, resolve: resolve27 } = __require("node:path");
19489
+ var { writeFile: writeFile12, readFile: readFile41, mkdir: mkdir14 } = __require("node:fs/promises");
19490
+ var { dirname: dirname29, resolve: resolve29 } = __require("node:path");
19491
19491
  var { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = __require("node:timers");
19492
19492
  var { InvalidArgumentError, UndiciError } = require_errors();
19493
19493
  var { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require_snapshot_utils();
@@ -19703,7 +19703,7 @@ var require_snapshot_recorder = __commonJS({
19703
19703
  throw new InvalidArgumentError("Snapshot path is required");
19704
19704
  }
19705
19705
  try {
19706
- const data = await readFile40(resolve27(path), "utf8");
19706
+ const data = await readFile41(resolve29(path), "utf8");
19707
19707
  const parsed = JSON.parse(data);
19708
19708
  if (Array.isArray(parsed)) {
19709
19709
  this.#snapshots.clear();
@@ -19732,7 +19732,7 @@ var require_snapshot_recorder = __commonJS({
19732
19732
  if (!path) {
19733
19733
  throw new InvalidArgumentError("Snapshot path is required");
19734
19734
  }
19735
- const resolvedPath = resolve27(path);
19735
+ const resolvedPath = resolve29(path);
19736
19736
  await mkdir14(dirname29(resolvedPath), { recursive: true });
19737
19737
  const data = Array.from(this.#snapshots.entries()).map(([hash2, snapshot]) => ({
19738
19738
  hash: hash2,
@@ -27230,7 +27230,7 @@ var require_fetch = __commonJS({
27230
27230
  const hasTrailingQuestionMark = url2.search.length === 0 && url2.href[url2.href.length - url2.hash.length - 1] === "?";
27231
27231
  return dispatchWithProtocolPreference(body);
27232
27232
  function dispatchWithProtocolPreference(body2, allowH2) {
27233
- return new Promise((resolve27, reject) => agent3.dispatch(
27233
+ return new Promise((resolve29, reject) => agent3.dispatch(
27234
27234
  {
27235
27235
  path: hasTrailingQuestionMark ? `${path}?` : path,
27236
27236
  origin: url2.origin,
@@ -27313,7 +27313,7 @@ var require_fetch = __commonJS({
27313
27313
  }
27314
27314
  }
27315
27315
  const onError = (err) => this.onResponseError(controller, err);
27316
- resolve27({
27316
+ resolve29({
27317
27317
  status: status11,
27318
27318
  statusText,
27319
27319
  headersList,
@@ -27346,7 +27346,7 @@ var require_fetch = __commonJS({
27346
27346
  fetchParams.controller.off("terminated", this.abort);
27347
27347
  }
27348
27348
  if (request2.mode === "websocket" && allowH2 !== false && error63?.code === "UND_ERR_INFO" && error63?.message === "HTTP/2: Extended CONNECT protocol not supported by server") {
27349
- resolve27(dispatchWithProtocolPreference(body2, false));
27349
+ resolve29(dispatchWithProtocolPreference(body2, false));
27350
27350
  return;
27351
27351
  }
27352
27352
  this.body?.destroy(error63);
@@ -27360,7 +27360,7 @@ var require_fetch = __commonJS({
27360
27360
  const rawHeaders = controller?.rawHeaders ?? [];
27361
27361
  const headersList = new HeadersList();
27362
27362
  appendHeadersListFromResponseHeaders(headersList, headers, rawHeaders);
27363
- resolve27({
27363
+ resolve29({
27364
27364
  status: status11,
27365
27365
  statusText: STATUS_CODES[status11],
27366
27366
  headersList,
@@ -31077,15 +31077,15 @@ ${value}`;
31077
31077
  pos = 0;
31078
31078
  }
31079
31079
  }
31080
- discardLeadingBytes(count13) {
31081
- while (count13 > 0 && this.lineChunkIndex < this.chunks.length) {
31080
+ discardLeadingBytes(count14) {
31081
+ while (count14 > 0 && this.lineChunkIndex < this.chunks.length) {
31082
31082
  const chunk = this.chunks[this.lineChunkIndex];
31083
31083
  const remaining = chunk.length - this.linePos;
31084
- if (count13 < remaining) {
31085
- this.linePos += count13;
31086
- count13 = 0;
31084
+ if (count14 < remaining) {
31085
+ this.linePos += count14;
31086
+ count14 = 0;
31087
31087
  } else {
31088
- count13 -= remaining;
31088
+ count14 -= remaining;
31089
31089
  this.lineChunkIndex++;
31090
31090
  this.linePos = 0;
31091
31091
  }
@@ -31834,8 +31834,8 @@ function shannonEntropyBits(value) {
31834
31834
  const counts = /* @__PURE__ */ new Map();
31835
31835
  for (const char of sample) counts.set(char, (counts.get(char) ?? 0) + 1);
31836
31836
  let entropy = 0;
31837
- for (const count13 of counts.values()) {
31838
- const p = count13 / sample.length;
31837
+ for (const count14 of counts.values()) {
31838
+ const p = count14 / sample.length;
31839
31839
  entropy -= p * Math.log2(p);
31840
31840
  }
31841
31841
  return entropy;
@@ -32495,7 +32495,7 @@ function withoutOneTimeLinkTokens({
32495
32495
  const links = oneTimeLinksIn({ text: text3 });
32496
32496
  if (links.length === 0) return [...secrets];
32497
32497
  return secrets.filter(
32498
- (secret) => KEPT_IN_LINKS.has(secret.kind) || NEVER_ONE_TIME.test(secret.suggestedName) || !links.some((link2) => secret.start >= link2.start && secret.end <= link2.end)
32498
+ (secret) => KEPT_IN_LINKS.has(secret.kind) || NEVER_ONE_TIME.test(secret.suggestedName) || !links.some((link3) => secret.start >= link3.start && secret.end <= link3.end)
32499
32499
  );
32500
32500
  }
32501
32501
 
@@ -32703,7 +32703,7 @@ function runRedacted({
32703
32703
  redact
32704
32704
  }) {
32705
32705
  const values = redact ?? Object.values(env);
32706
- return new Promise((resolve27, reject) => {
32706
+ return new Promise((resolve29, reject) => {
32707
32707
  const [file4, ...args] = command;
32708
32708
  const child = spawn(file4, args, {
32709
32709
  env: { ...baseEnv, ...env },
@@ -32729,7 +32729,7 @@ function runRedacted({
32729
32729
  child.on("error", reject);
32730
32730
  child.on("close", (code4, ended) => {
32731
32731
  signal?.removeEventListener("abort", killGroup);
32732
- void drained.then(() => resolve27(code4 ?? (ended ? 128 + signalNumber(ended) : 1)));
32732
+ void drained.then(() => resolve29(code4 ?? (ended ? 128 + signalNumber(ended) : 1)));
32733
32733
  });
32734
32734
  });
32735
32735
  }
@@ -36970,7 +36970,7 @@ function shadowedLinkLineOf({ shadow }) {
36970
36970
  }
36971
36971
 
36972
36972
  // src/rules/cli-version.rules.ts
36973
- var STAMPED = "0.1.136";
36973
+ var STAMPED = "0.1.138";
36974
36974
  function cliVersionOf({ stamped = STAMPED } = {}) {
36975
36975
  return stamped.startsWith("__") ? "dev" : stamped;
36976
36976
  }
@@ -37277,7 +37277,7 @@ async function withStateLock({
37277
37277
  () => 0
37278
37278
  );
37279
37279
  if (since > LOCK_STALE_MS) await rm(lock, { force: true });
37280
- else await new Promise((resolve27) => setTimeout(resolve27, 15 + Math.random() * 20));
37280
+ else await new Promise((resolve29) => setTimeout(resolve29, 15 + Math.random() * 20));
37281
37281
  }
37282
37282
  try {
37283
37283
  return await work();
@@ -37544,6 +37544,7 @@ var SWITCHES = /* @__PURE__ */ new Set([
37544
37544
  "all",
37545
37545
  "resend",
37546
37546
  "replace",
37547
+ "reset",
37547
37548
  "ask",
37548
37549
  "real-value"
37549
37550
  ]);
@@ -38855,14 +38856,14 @@ function codePointLength(str) {
38855
38856
  const units = str.length;
38856
38857
  if (!highSurrogate.test(str))
38857
38858
  return units;
38858
- let count13 = units;
38859
+ let count14 = units;
38859
38860
  for (let i = 0; i < units - 1; i++) {
38860
38861
  if ((str.charCodeAt(i) & 64512) === 55296 && (str.charCodeAt(i + 1) & 64512) === 56320) {
38861
- count13--;
38862
+ count14--;
38862
38863
  i++;
38863
38864
  }
38864
38865
  }
38865
- return count13;
38866
+ return count14;
38866
38867
  }
38867
38868
  function getLengthableOrigin(input2) {
38868
38869
  if (Array.isArray(input2))
@@ -42667,7 +42668,7 @@ var recursive = /* @__PURE__ */ new WeakMap();
42667
42668
  var NONE = 0;
42668
42669
  var ASSUMED = 1;
42669
42670
  var PROVEN = 2;
42670
- function isRecursive(inst, stack, resolve27) {
42671
+ function isRecursive(inst, stack, resolve29) {
42671
42672
  const cached2 = recursive.get(inst);
42672
42673
  if (cached2 !== void 0)
42673
42674
  return cached2 ? PROVEN : NONE;
@@ -42677,7 +42678,7 @@ function isRecursive(inst, stack, resolve27) {
42677
42678
  let result2 = NONE;
42678
42679
  const check4 = (child) => {
42679
42680
  if (result2 !== PROVEN && child?._zod) {
42680
- const answer6 = isRecursive(child, stack, resolve27);
42681
+ const answer6 = isRecursive(child, stack, resolve29);
42681
42682
  if (answer6 > result2)
42682
42683
  result2 = answer6;
42683
42684
  }
@@ -42688,7 +42689,7 @@ function isRecursive(inst, stack, resolve27) {
42688
42689
  const desc = Object.getOwnPropertyDescriptor(sh, key);
42689
42690
  if (spread && !desc.enumerable)
42690
42691
  continue;
42691
- const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve27) : NONE;
42692
+ const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve29) : NONE;
42692
42693
  if (child > answer6)
42693
42694
  answer6 = child;
42694
42695
  }
@@ -42752,7 +42753,7 @@ function isRecursive(inst, stack, resolve27) {
42752
42753
  break;
42753
42754
  // `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
42754
42755
  case "lazy": {
42755
- const inner = def._cachedInner ?? (resolve27 ? inst._zod.innerType : void 0);
42756
+ const inner = def._cachedInner ?? (resolve29 ? inst._zod.innerType : void 0);
42756
42757
  merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
42757
42758
  break;
42758
42759
  }
@@ -43217,8 +43218,8 @@ function az_default() {
43217
43218
  }
43218
43219
 
43219
43220
  // ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/be.js
43220
- function getBelarusianPlural(count13, one, few, many) {
43221
- const absCount = Math.abs(count13);
43221
+ function getBelarusianPlural(count14, one, few, many) {
43222
+ const absCount = Math.abs(count14);
43222
43223
  const lastDigit = absCount % 10;
43223
43224
  const lastTwoDigits = absCount % 100;
43224
43225
  if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
@@ -45865,8 +45866,8 @@ function hu_default() {
45865
45866
  }
45866
45867
 
45867
45868
  // ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hy.js
45868
- function getArmenianPlural(count13, one, many) {
45869
- return Math.abs(count13) === 1 ? one : many;
45869
+ function getArmenianPlural(count14, one, many) {
45870
+ return Math.abs(count14) === 1 ? one : many;
45870
45871
  }
45871
45872
  function withDefiniteArticle(word3) {
45872
45873
  if (!word3)
@@ -48604,8 +48605,8 @@ function ro_default() {
48604
48605
  }
48605
48606
 
48606
48607
  // ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ru.js
48607
- function getRussianPlural(count13, one, few, many) {
48608
- const absCount = Math.abs(count13);
48608
+ function getRussianPlural(count14, one, few, many) {
48609
+ const absCount = Math.abs(count14);
48609
48610
  const lastDigit = absCount % 10;
48610
48611
  const lastTwoDigits = absCount % 100;
48611
48612
  if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
@@ -62064,15 +62065,15 @@ function clustersIn({
62064
62065
  const out = [];
62065
62066
  let current3 = null;
62066
62067
  for (let index = segment.start; index <= segment.end; index += 1) {
62067
- const count13 = flagged[index] ?? 0;
62068
- if (count13 === 0) continue;
62068
+ const count14 = flagged[index] ?? 0;
62069
+ if (count14 === 0) continue;
62069
62070
  if (current3 && index - current3.end - 1 <= REDACTED_BLOCK_MAX_GAP) {
62070
62071
  current3.end = index;
62071
- current3.values += count13;
62072
+ current3.values += count14;
62072
62073
  continue;
62073
62074
  }
62074
62075
  if (current3) out.push(current3);
62075
- current3 = { start: index, end: index, values: count13 };
62076
+ current3 = { start: index, end: index, values: count14 };
62076
62077
  }
62077
62078
  if (current3) out.push(current3);
62078
62079
  return out;
@@ -62112,7 +62113,7 @@ function redactedBlocksAt({
62112
62113
  }
62113
62114
  const blocks = redactedBlocks({ lines: lines2, flagged });
62114
62115
  const inside = (line) => blocks.some((block2) => line >= block2.start && line <= block2.end);
62115
- const values = flagged.reduce((sum, count13, line) => inside(line) ? sum + count13 : sum, 0);
62116
+ const values = flagged.reduce((sum, count14, line) => inside(line) ? sum + count14 : sum, 0);
62116
62117
  return { values, insideAt: (offset) => inside(lineAt(offset)) };
62117
62118
  }
62118
62119
 
@@ -62674,18 +62675,43 @@ var vaultOpsAskSchemaDefinition = external_exports.object({
62674
62675
  var vaultOpsAskSchema = vaultOpsAskSchemaDefinition;
62675
62676
  var vaultOpsAsksSchemaDefinition = external_exports.object({ rows: external_exports.array(vaultOpsAskSchema), total: count3 });
62676
62677
 
62677
- // ../../modules/vault/contract/src/vault-ops-connections.ts
62678
+ // ../../modules/vault/contract/src/vault-ops-reference-keys.ts
62678
62679
  var count4 = external_exports.number().int().nonnegative();
62679
62680
  var idText3 = external_exports.string().max(128);
62681
+ var vaultOpsReferenceKeySchemaDefinition = external_exports.object({
62682
+ workspaceId: idText3,
62683
+ connectionId: idText3,
62684
+ /** The keychain's owner; null for a workspace key. */
62685
+ ownerUserId: idText3.nullable(),
62686
+ createdAt: external_exports.iso.datetime(),
62687
+ status: external_exports.string().regex(/^[a-z][a-z_]{0,31}$/),
62688
+ /** The key's name, to count the messages naming it; never in an ops answer. */
62689
+ name: external_exports.string().max(200)
62690
+ });
62691
+ var vaultOpsReferenceKeySchema = vaultOpsReferenceKeySchemaDefinition;
62692
+ var vaultOpsReferenceKeysSchemaDefinition = external_exports.object({
62693
+ keys: external_exports.array(vaultOpsReferenceKeySchemaDefinition),
62694
+ /** Pasted keys looked at, opened, held for a device only, and failing to open. */
62695
+ scanned: count4,
62696
+ opened: count4,
62697
+ sealed: count4,
62698
+ failed: count4,
62699
+ /** The scan reached the open cap before the last pasted key. */
62700
+ stopped: external_exports.boolean()
62701
+ });
62702
+
62703
+ // ../../modules/vault/contract/src/vault-ops-connections.ts
62704
+ var count5 = external_exports.number().int().nonnegative();
62705
+ var idText4 = external_exports.string().max(128);
62680
62706
  var codeText2 = external_exports.string().regex(/^[a-z][a-z0-9_.]{0,39}$/);
62681
62707
  var vaultOpsConnectionSchemaDefinition = external_exports.object({
62682
- connectionId: idText3,
62708
+ connectionId: idText4,
62683
62709
  kind: vaultConnectionKindSchema,
62684
62710
  /** An OAuth or MCP connection's provider (`gmail`); null for none, `other` for free text. */
62685
62711
  provider: codeText2.nullable(),
62686
62712
  holderKind: external_exports.enum(["personal", "workspace", "agent", "pool"]),
62687
62713
  /** The person, agent or pool that owns the keychain; null for the workspace's. */
62688
- holderId: idText3.nullable(),
62714
+ holderId: idText4.nullable(),
62689
62715
  sensitivity: vaultSensitivitySchema,
62690
62716
  everyUseAsks: external_exports.boolean(),
62691
62717
  deviceApproval: external_exports.boolean(),
@@ -62693,7 +62719,7 @@ var vaultOpsConnectionSchemaDefinition = external_exports.object({
62693
62719
  serverOpens: external_exports.boolean(),
62694
62720
  sealing: external_exports.enum(["envelope_v1", "sealed_v2"]),
62695
62721
  /** The devices a `sealed_v2` bundle is sealed to; 0 on `envelope_v1`. */
62696
- recipients: count4,
62722
+ recipients: count5,
62697
62723
  status: codeText2,
62698
62724
  /** When the stored access token runs out; null for none. */
62699
62725
  grantExpiresAt: external_exports.iso.datetime().nullable(),
@@ -62702,14 +62728,14 @@ var vaultOpsConnectionSchemaDefinition = external_exports.object({
62702
62728
  });
62703
62729
  var vaultOpsConnectionSchema = vaultOpsConnectionSchemaDefinition;
62704
62730
  var vaultOpsConnectionEventSchemaDefinition = external_exports.object({
62705
- seq: count4,
62706
- connectionId: idText3,
62731
+ seq: count5,
62732
+ connectionId: idText4,
62707
62733
  action: codeText2,
62708
62734
  outcome: codeText2,
62709
62735
  actorKind: external_exports.enum(["user", "agent", "system"]),
62710
62736
  decider: codeText2.nullable(),
62711
- agentId: idText3.nullable(),
62712
- requestId: idText3.nullable(),
62737
+ agentId: idText4.nullable(),
62738
+ requestId: idText4.nullable(),
62713
62739
  /** The entry's stored code (`vault_oauth_refresh_failed`); null when it holds none. */
62714
62740
  code: codeText2.nullable(),
62715
62741
  /** The provider's error code on a refused refresh (`invalid_grant`); null when not kept. */
@@ -63626,6 +63652,8 @@ var computerCardStateSchema = external_exports.enum([
63626
63652
  var computerCardSchemaDefinition = external_exports.object({
63627
63653
  type: external_exports.literal("computer"),
63628
63654
  agentId: idSchema4,
63655
+ /** The agent's owner: only they or an Admin see its actions; null on cards drawn before. */
63656
+ ownerUserId: external_exports.string().max(200).nullable().default(null),
63629
63657
  /** The computer the agent runs on, for support. */
63630
63658
  computerId: external_exports.string().min(1).max(200),
63631
63659
  /** The workspace audit entry's reference for this failure, for support. */
@@ -63666,6 +63694,8 @@ var loginCardLoginSchemaDefinition = external_exports.object({
63666
63694
  var loginCardSchemaDefinition = external_exports.object({
63667
63695
  type: external_exports.literal("login"),
63668
63696
  agentId: idSchema4,
63697
+ /** The agent's owner: only they or an Admin see its actions; null on cards drawn before. */
63698
+ ownerUserId: external_exports.string().max(200).nullable().default(null),
63669
63699
  harness: external_exports.enum(["claude-code", "codex"]),
63670
63700
  state: loginCardStateSchema,
63671
63701
  /** The plain first line: "All of my Claude logins are out of usage." */
@@ -66530,10 +66560,10 @@ var observeSenderInputSchemaDefinition = external_exports.object({
66530
66560
  });
66531
66561
 
66532
66562
  // ../../modules/chat/contract/src/chat.read-ops.ts
66533
- var count5 = external_exports.number().int().nonnegative();
66563
+ var count6 = external_exports.number().int().nonnegative();
66534
66564
  var at = external_exports.iso.datetime();
66535
66565
  var unreadMessageDefinition = external_exports.object({
66536
- seq: count5,
66566
+ seq: count6,
66537
66567
  createdAt: at,
66538
66568
  /** self is the reader; the others are the author's kind. */
66539
66569
  author: external_exports.enum(["self", "person", "agent", "external"]),
@@ -66552,12 +66582,12 @@ var readConversationDefinition = external_exports.object({
66552
66582
  direct: external_exports.boolean(),
66553
66583
  /** The other side of a Laze DM paired with a Slack DM, or null. */
66554
66584
  pairedWith: external_exports.string().nullable(),
66555
- lastSeq: count5,
66556
- lastReadSeq: count5,
66557
- unreadHeldToSeq: count5.nullable(),
66558
- hiddenAtSeq: count5.nullable(),
66559
- unread: count5,
66560
- mentions: count5,
66585
+ lastSeq: count6,
66586
+ lastReadSeq: count6,
66587
+ unreadHeldToSeq: count6.nullable(),
66588
+ hiddenAtSeq: count6.nullable(),
66589
+ unread: count6,
66590
+ mentions: count6,
66561
66591
  lastMessageAt: at.nullable(),
66562
66592
  /** When the newest message at or before the marker was written. */
66563
66593
  markerAt: at.nullable(),
@@ -66567,41 +66597,41 @@ var readConversationDefinition = external_exports.object({
66567
66597
  var chatReadFactsDefinition = external_exports.object({
66568
66598
  conversations: external_exports.array(readConversationDefinition).max(40),
66569
66599
  /** Conversations that qualified before the cap. */
66570
- total: count5
66600
+ total: count6
66571
66601
  });
66572
66602
  var chatReadFactsSchema = chatReadFactsDefinition;
66573
66603
 
66574
66604
  // ../../modules/chat/contract/src/chat.link-domain-ops.ts
66575
- var count6 = external_exports.number().int().nonnegative();
66605
+ var count7 = external_exports.number().int().nonnegative();
66576
66606
  var linkDomainDefinition = external_exports.object({
66577
66607
  /** The link's host, lowercased, without `www.`. */
66578
66608
  domain: external_exports.string(),
66579
66609
  /** Previews on messages, one per message and preview. */
66580
- links: count6,
66610
+ links: count7,
66581
66611
  /** Messages with at least one preview of this host. */
66582
- messageCount: count6,
66612
+ messageCount: count7,
66583
66613
  /** Previews of this host a message author took off. */
66584
- removed: count6,
66614
+ removed: count7,
66585
66615
  /** Distinct previews (addresses) of this host. */
66586
- pages: count6,
66616
+ pages: count7,
66587
66617
  /** Pages whose preview carries a picture, and a page name. */
66588
- pictured: count6,
66589
- named: count6,
66618
+ pictured: count7,
66619
+ named: count7,
66590
66620
  /** Pages whose fetch failed or was blocked. */
66591
- failed: count6,
66621
+ failed: count7,
66592
66622
  /** The commonest path shapes, at most 5, each with its page count. */
66593
- shapes: external_exports.array(external_exports.object({ shape: external_exports.string(), pages: count6 })).max(5)
66623
+ shapes: external_exports.array(external_exports.object({ shape: external_exports.string(), pages: count7 })).max(5)
66594
66624
  });
66595
66625
  var linkDomainFactsDefinition = external_exports.object({
66596
66626
  domains: external_exports.array(linkDomainDefinition),
66597
66627
  /** Messages with previews read on this page, and how many previews they carry. */
66598
- scannedMessageCount: count6,
66599
- scannedLinks: count6,
66628
+ scannedMessageCount: count7,
66629
+ scannedLinks: count7,
66600
66630
  /** Messages carrying exactly 1, 2, and 3 or more previews on this page. */
66601
- messageCountByLinks: external_exports.array(count6).length(3),
66631
+ messageCountByLinks: external_exports.array(count7).length(3),
66602
66632
  /** Over the whole workspace: live messages with a link, and those with a preview. */
66603
- linkedMessageCount: count6,
66604
- previewedMessageCount: count6,
66633
+ linkedMessageCount: count7,
66634
+ previewedMessageCount: count7,
66605
66635
  /** The last message id read; pass it back as `cursor` to read on, null at the end. */
66606
66636
  nextCursor: external_exports.string().nullable()
66607
66637
  });
@@ -73565,8 +73595,8 @@ function unreachableReasonOf(error63) {
73565
73595
  function migratedNoticeOf(error63) {
73566
73596
  if (!(error63 instanceof LazeApiError) || error63.code !== AGENT_MIGRATED) return void 0;
73567
73597
  const notice = typeof error63.meta?.notice === "string" ? error63.meta.notice : error63.message;
73568
- const link2 = typeof error63.meta?.link === "string" ? error63.meta.link : null;
73569
- return { notice, link: link2 };
73598
+ const link3 = typeof error63.meta?.link === "string" ? error63.meta.link : null;
73599
+ return { notice, link: link3 };
73570
73600
  }
73571
73601
  var LazeClient = class _LazeClient {
73572
73602
  constructor(options) {
@@ -73682,10 +73712,20 @@ function errorOf({ status: status11, body }) {
73682
73712
  const code4 = typeof nested.code === "string" ? nested.code : fallback;
73683
73713
  const message2 = typeof nested.message === "string" ? nested.message : `Laze answered ${status11}`;
73684
73714
  const meta3 = typeof nested.meta === "object" && nested.meta !== null ? nested.meta : void 0;
73685
- const error63 = new LazeApiError(status11, code4, message2);
73715
+ const reasons = reasonLines(nested);
73716
+ const said = reasons.length > 0 ? `${message2.replace(/\.$/, "")}. ${reasons.join("; ")}` : message2;
73717
+ const error63 = new LazeApiError(status11, code4, said);
73686
73718
  error63.meta = meta3;
73687
73719
  return error63;
73688
73720
  }
73721
+ function reasonLines(error63) {
73722
+ const reasons = Array.isArray(error63.reasons) ? error63.reasons : [];
73723
+ return reasons.flatMap((reason2) => {
73724
+ const meta3 = reason2?.meta;
73725
+ if (typeof meta3?.message !== "string") return [];
73726
+ return [typeof meta3.field === "string" ? `${meta3.field}: ${meta3.message}` : meta3.message];
73727
+ });
73728
+ }
73689
73729
 
73690
73730
  // src/services/machine-report.service.ts
73691
73731
  import { createHash } from "node:crypto";
@@ -73713,7 +73753,7 @@ async function reportMachine({
73713
73753
 
73714
73754
  // src/services/session.service.ts
73715
73755
  function markMigratedOn({ context, profile }) {
73716
- return async ({ notice, link: link2 }) => context.store.markMigrated({ name: profile, migrated: { at: context.nowMs(), link: link2, notice } });
73756
+ return async ({ notice, link: link3 }) => context.store.markMigrated({ name: profile, migrated: { at: context.nowMs(), link: link3, notice } });
73717
73757
  }
73718
73758
  var REFUSED_RECHECK_MS = 10 * 60 * 1e3;
73719
73759
  function markRefusedOn({
@@ -74040,18 +74080,18 @@ async function inviteAgent({ context, args }) {
74040
74080
  throw new CliUsageError("Usage: laze agent invite --reconnect <agent>");
74041
74081
  }
74042
74082
  const { client } = await signedIn({ context, args });
74043
- const link2 = await client.post("/api/agents/links", {
74083
+ const link3 = await client.post("/api/agents/links", {
74044
74084
  ...name3 ? { name: name3 } : {},
74045
74085
  ...channelId ? { channelId } : {},
74046
74086
  ...reconnect ? { reconnect } : {}
74047
74087
  });
74048
- if (args.flags.json) return context.out(`${JSON.stringify(link2, null, 2)}
74088
+ if (args.flags.json) return context.out(`${JSON.stringify(link3, null, 2)}
74049
74089
  `);
74050
74090
  const where = reconnect ? `the session that should run ${reconnect} again` : "the agent's session";
74051
74091
  context.out(
74052
- `Paste this into ${where} (the link works once, until ${link2.expiresAt}):
74092
+ `Paste this into ${where} (the link works once, until ${link3.expiresAt}):
74053
74093
 
74054
- ${link2.prompt}
74094
+ ${link3.prompt}
74055
74095
  `
74056
74096
  );
74057
74097
  }
@@ -74192,12 +74232,12 @@ function linkOf({ url: url2, base }) {
74192
74232
  return `${base.replace(/\/+$/, "")}${url2.startsWith("/") ? "" : "/"}${url2}`;
74193
74233
  }
74194
74234
  function withLink({ text: text3, url: url2, base }) {
74195
- const link2 = linkOf({ url: url2, base });
74196
- return link2 ? `${text3} ${link2}` : text3;
74235
+ const link3 = linkOf({ url: url2, base });
74236
+ return link3 ? `${text3} ${link3}` : text3;
74197
74237
  }
74198
74238
  function linkLineOf({ url: url2, base }) {
74199
- const link2 = linkOf({ url: url2, base });
74200
- return link2 ? `Link: ${link2}
74239
+ const link3 = linkOf({ url: url2, base });
74240
+ return link3 ? `Link: ${link3}
74201
74241
  ` : "";
74202
74242
  }
74203
74243
 
@@ -74307,10 +74347,10 @@ function whereOf(message2) {
74307
74347
  }
74308
74348
  function catchUpLinesOf(message2) {
74309
74349
  if (!message2.catchUp) return [];
74310
- const { count: count13, older } = message2.catchUp;
74350
+ const { count: count14, older } = message2.catchUp;
74311
74351
  const where = whereOf(message2);
74312
74352
  const lines2 = [
74313
- `${count13} ${count13 === 1 ? "message" : "messages"} in ${where} while you were away.`
74353
+ `${count14} ${count14 === 1 ? "message" : "messages"} in ${where} while you were away.`
74314
74354
  ];
74315
74355
  if (older === 0) return lines2;
74316
74356
  const channel = message2.channelKind === "public" || message2.channelKind === "private";
@@ -74325,12 +74365,12 @@ function formatInboxMessage({
74325
74365
  base
74326
74366
  }) {
74327
74367
  const thread2 = message2.threadRootId ? ` (in the thread of ${message2.threadRootId})` : "";
74328
- const link2 = base === void 0 ? void 0 : linkOf({ url: message2.url, base });
74368
+ const link3 = base === void 0 ? void 0 : linkOf({ url: message2.url, base });
74329
74369
  return [
74330
74370
  ...catchUpLinesOf(message2),
74331
74371
  `[${message2.messageId}] ${message2.author.name} in ${whereOf(message2)}${thread2}:`,
74332
74372
  message2.body,
74333
- ...link2 ? [`Link: ${link2}`] : [],
74373
+ ...link3 ? [`Link: ${link3}`] : [],
74334
74374
  `Answer with: laze reply ${message2.messageId} "<your answer>"`
74335
74375
  ].join("\n");
74336
74376
  }
@@ -74338,9 +74378,9 @@ function hookContextOf({
74338
74378
  messages,
74339
74379
  self: self2
74340
74380
  }) {
74341
- const count13 = messages.length === 1 ? "A message" : `${messages.length} messages`;
74381
+ const count14 = messages.length === 1 ? "A message" : `${messages.length} messages`;
74342
74382
  return [
74343
- `${count13} reached you in Laze${selfClauseOf({ self: self2 })}:`,
74383
+ `${count14} reached you in Laze${selfClauseOf({ self: self2 })}:`,
74344
74384
  "",
74345
74385
  ...messages.map((message2) => formatInboxMessage({ message: message2 })),
74346
74386
  "",
@@ -74355,7 +74395,7 @@ function selfClauseOf({ self: self2 }) {
74355
74395
  function record2(value) {
74356
74396
  return typeof value === "object" && value !== null ? value : {};
74357
74397
  }
74358
- function count7(value) {
74398
+ function count8(value) {
74359
74399
  return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : void 0;
74360
74400
  }
74361
74401
  function parse3(line) {
@@ -74391,17 +74431,17 @@ function compactionOf({
74391
74431
  return {
74392
74432
  key: typeof entry2.uuid === "string" ? entry2.uuid : String(index),
74393
74433
  trigger: meta3.trigger === "manual" ? "manual" : "auto",
74394
- tokensBefore: count7(meta3.preTokens),
74395
- tokensAfter: count7(meta3.postTokens),
74434
+ tokensBefore: count8(meta3.preTokens),
74435
+ tokensAfter: count8(meta3.postTokens),
74396
74436
  at: typeof entry2.timestamp === "string" ? entry2.timestamp : "1970-01-01T00:00:00.000Z"
74397
74437
  };
74398
74438
  }
74399
74439
  function usageOf({ entry: entry2 }) {
74400
74440
  const message2 = record2(entry2.message);
74401
74441
  const usage2 = record2(message2.usage);
74402
- const input2 = count7(usage2.input_tokens);
74442
+ const input2 = count8(usage2.input_tokens);
74403
74443
  if (input2 === void 0) return void 0;
74404
- const cached2 = (count7(usage2.cache_read_input_tokens) ?? 0) + (count7(usage2.cache_creation_input_tokens) ?? 0);
74444
+ const cached2 = (count8(usage2.cache_read_input_tokens) ?? 0) + (count8(usage2.cache_creation_input_tokens) ?? 0);
74405
74445
  return {
74406
74446
  tokens: input2 + cached2,
74407
74447
  ...typeof message2.model === "string" ? { model: message2.model } : {}
@@ -75306,7 +75346,7 @@ var slackConfig = Config.define((c) => ({
75306
75346
  }));
75307
75347
 
75308
75348
  // ../../modules/slack/contract/src/slack-ops.ts
75309
- var count8 = external_exports.number().int().nonnegative();
75349
+ var count9 = external_exports.number().int().nonnegative();
75310
75350
  var at2 = external_exports.iso.datetime();
75311
75351
  var slackMirrorHealthDefinition = external_exports.object({
75312
75352
  mirrors: external_exports.array(
@@ -75319,19 +75359,19 @@ var slackMirrorHealthDefinition = external_exports.object({
75319
75359
  /** Shared with another organisation, such as a Slack Connect channel. */
75320
75360
  external: external_exports.boolean(),
75321
75361
  botMember: external_exports.boolean(),
75322
- linkedMembers: count8,
75323
- cacheDays: count8,
75362
+ linkedMembers: count9,
75363
+ cacheDays: count9,
75324
75364
  backfilledAt: at2.nullable(),
75325
75365
  reconciledAt: at2.nullable(),
75326
75366
  /** Message links Laze holds for the conversation, both ways. */
75327
- links: count8,
75367
+ links: count9,
75328
75368
  /** Thread roots Laze holds a reply of. */
75329
- threads: count8,
75369
+ threads: count9,
75330
75370
  /** Roots whose Slack reply count, when last read, is above the replies Laze holds. */
75331
- threadsShort: count8,
75332
- repliesShort: count8,
75371
+ threadsShort: count9,
75372
+ repliesShort: count9,
75333
75373
  /** Threads Laze holds whose root is older than the cache window. */
75334
- oldThreads: count8
75374
+ oldThreads: count9
75335
75375
  })
75336
75376
  )
75337
75377
  });
@@ -75342,10 +75382,10 @@ var DURATION = /^(\d+)\s*(m|min|mins|minutes?|h|hours?|d|days?)$/i;
75342
75382
  function minutesOf({ text: text3 }) {
75343
75383
  const match = DURATION.exec(text3.trim());
75344
75384
  if (!match?.[1] || !match[2]) return null;
75345
- const count13 = Number(match[1]);
75385
+ const count14 = Number(match[1]);
75346
75386
  const unit = match[2].toLowerCase()[0];
75347
75387
  const perUnit = { d: 1440, h: 60, m: 1 };
75348
- const minutes = count13 * (perUnit[unit ?? "m"] ?? 1);
75388
+ const minutes = count14 * (perUnit[unit ?? "m"] ?? 1);
75349
75389
  return minutes > 0 ? minutes : null;
75350
75390
  }
75351
75391
  function muteTextOf({ mute }) {
@@ -75503,13 +75543,13 @@ function lazeHitLines({
75503
75543
  url: url2,
75504
75544
  workspaceId
75505
75545
  }) {
75506
- const reply2 = hit.threadRootId ? " (thread reply)" : "";
75546
+ const reply3 = hit.threadRootId ? " (thread reply)" : "";
75507
75547
  const text3 = bodyAsText({ body: hit.body, mentions: laze.mentions });
75508
- const files2 = hit.matchedFiles.length > 0 ? [` files: ${hit.matchedFiles.join(", ")}`] : [];
75548
+ const files3 = hit.matchedFiles.length > 0 ? [` files: ${hit.matchedFiles.join(", ")}`] : [];
75509
75549
  return [
75510
- `${whereOf2({ kind: hit.channelKind, name: hit.channelName })} ${hit.author.name} ${timeOf(hit.postedAt)}${reply2}`,
75550
+ `${whereOf2({ kind: hit.channelKind, name: hit.channelName })} ${hit.author.name} ${timeOf(hit.postedAt)}${reply3}`,
75511
75551
  ` ${snippetOf({ text: text3, terms: laze.terms }) || "(no text)"}`,
75512
- ...files2,
75552
+ ...files3,
75513
75553
  ` ${linkOf({ url: hit.url, base: url2 }) ?? lazeLinkOf({ url: url2, workspaceId, channelId: hit.channelId, hit })}`
75514
75554
  ];
75515
75555
  }
@@ -75520,14 +75560,14 @@ function slackHitLines({
75520
75560
  workspaceId
75521
75561
  }) {
75522
75562
  const text3 = bodyAsText({ body: hit.body, mentions: laze.mentions });
75523
- const link2 = hit.lazeChannelId ? lazeLinkOf({ url: url2, workspaceId, channelId: hit.lazeChannelId }) : hit.permalink ?? "";
75563
+ const link3 = hit.lazeChannelId ? lazeLinkOf({ url: url2, workspaceId, channelId: hit.lazeChannelId }) : hit.permalink ?? "";
75524
75564
  return [
75525
75565
  `${whereOf2({ kind: "public", name: hit.channelName })} ${hit.authorName} ${timeOf(hit.createdAt)}`,
75526
75566
  ` ${snippetOf({ text: text3, terms: laze.terms }) || "(no text)"}`,
75527
- ...link2 ? [` ${link2}`] : []
75567
+ ...link3 ? [` ${link3}`] : []
75528
75568
  ];
75529
75569
  }
75530
- var count9 = (n) => `${n} message${n === 1 ? "" : "s"}`;
75570
+ var count10 = (n) => `${n} message${n === 1 ? "" : "s"}`;
75531
75571
  function slackSectionLines({
75532
75572
  slack: slack2,
75533
75573
  laze,
@@ -75540,7 +75580,7 @@ function slackSectionLines({
75540
75580
  });
75541
75581
  if (slack2.teams.some((team) => team.state === "searched")) {
75542
75582
  const found = slack2.hits.length;
75543
- lines2.push(found === 0 ? "From Slack: nothing more." : `From Slack: ${count9(found)}`);
75583
+ lines2.push(found === 0 ? "From Slack: nothing more." : `From Slack: ${count10(found)}`);
75544
75584
  }
75545
75585
  for (const hit of slack2.hits) lines2.push(...slackHitLines({ hit, laze, url: url2, workspaceId }), "");
75546
75586
  return lines2;
@@ -75551,7 +75591,7 @@ function formatSearch({
75551
75591
  workspaceId
75552
75592
  }) {
75553
75593
  const { laze, slack: slack2, query } = output2;
75554
- const lines2 = laze.hits.length === 0 ? [`No Laze messages match "${query}".`] : [`Laze: ${count9(laze.hits.length)} for "${query}"`];
75594
+ const lines2 = laze.hits.length === 0 ? [`No Laze messages match "${query}".`] : [`Laze: ${count10(laze.hits.length)} for "${query}"`];
75555
75595
  for (const hit of laze.hits) {
75556
75596
  lines2.push(...lazeHitLines({ hit, laze, url: url2, workspaceId }), "");
75557
75597
  }
@@ -75725,10 +75765,10 @@ async function sessionNotesOf({
75725
75765
  tell = true
75726
75766
  }) {
75727
75767
  const folder = dirname6(notePathOf({ context, pid: 1 }));
75728
- const files2 = await readdir2(folder).catch(() => []);
75768
+ const files3 = await readdir2(folder).catch(() => []);
75729
75769
  const notes = [];
75730
75770
  const dropped = [];
75731
- for (const file4 of files2) {
75771
+ for (const file4 of files3) {
75732
75772
  const pid = Number(file4.replace(/\.json$/, ""));
75733
75773
  const path = join7(folder, file4);
75734
75774
  const note = pid ? await readStateJson({ path }) : void 0;
@@ -75923,9 +75963,9 @@ async function runsInSubagent({ context, command }) {
75923
75963
  const { path } = await claudeTranscriptOf({ context, sessionId });
75924
75964
  if (!path) return false;
75925
75965
  const folder = join8(dirname7(path), sessionId, "subagents");
75926
- const files2 = await readdir3(folder).catch(() => []);
75966
+ const files3 = await readdir3(folder).catch(() => []);
75927
75967
  const subagents = await Promise.all(
75928
- files2.filter((file4) => file4.endsWith(".jsonl")).map(
75968
+ files3.filter((file4) => file4.endsWith(".jsonl")).map(
75929
75969
  async (file4) => lastCallAtOf({ text: await tailOf({ path: join8(folder, file4) }), command })
75930
75970
  )
75931
75971
  );
@@ -76794,7 +76834,7 @@ async function post({
76794
76834
  const body = await textToSend({ context, args, profile, client, text: typed, leaves });
76795
76835
  const thread2 = flagText({ args, name: "thread" });
76796
76836
  const via = viaOf({ args, usage: POST_USAGE });
76797
- const files2 = await filesOf({ context, args, client, at: at8, channel: async () => channel });
76837
+ const files3 = await filesOf({ context, args, client, at: at8, channel: async () => channel });
76798
76838
  if (at8) {
76799
76839
  const target = { channel, ...thread2 ? { threadRootId: thread2 } : {} };
76800
76840
  return scheduleMessage({ context, args, client, at: at8, target, body });
@@ -76807,7 +76847,7 @@ async function post({
76807
76847
  body,
76808
76848
  ...thread2 ? { threadRootId: thread2 } : {},
76809
76849
  ...via,
76810
- ...files2,
76850
+ ...files3,
76811
76851
  ...turnAnswersOf({ context })
76812
76852
  }
76813
76853
  });
@@ -76836,7 +76876,7 @@ async function reply({
76836
76876
  const typed = await textOf({ context, args, from: 2 });
76837
76877
  const leaves = leavesLazeOf({ client, channel });
76838
76878
  const body = await textToSend({ context, args, profile, client, text: typed, leaves });
76839
- const files2 = await filesOf({
76879
+ const files3 = await filesOf({
76840
76880
  context,
76841
76881
  args,
76842
76882
  client,
@@ -76856,7 +76896,7 @@ async function reply({
76856
76896
  ...args.flags["new-thread"] === true ? { thread: true } : {},
76857
76897
  ...args.flags["also-channel"] === true ? { alsoInChannel: true } : {},
76858
76898
  ...via,
76859
- ...files2,
76899
+ ...files3,
76860
76900
  ...turnAnswersOf({ context })
76861
76901
  }
76862
76902
  });
@@ -77029,7 +77069,7 @@ async function claudeRunOf({
77029
77069
  }) {
77030
77070
  const env = context.environment.inherited;
77031
77071
  const user = env.CLAUDE_CONFIG_DIR || join12(env.HOME || homedir3(), ".claude");
77032
- const files2 = await Promise.all(
77072
+ const files3 = await Promise.all(
77033
77073
  [
77034
77074
  join12(folder, ".claude", "settings.local.json"),
77035
77075
  join12(folder, ".claude", "settings.json"),
@@ -77037,8 +77077,8 @@ async function claudeRunOf({
77037
77077
  ].map((path) => settingsOf({ path }))
77038
77078
  );
77039
77079
  const args = claudePid > 0 ? await context.processes.argsOf(claudePid) : void 0;
77040
- const model = env.ANTHROPIC_MODEL || modelFlagOf(args) || files2.map((file4) => file4.model).find((value) => typeof value === "string");
77041
- const compactWindow = windowOf2(env.CLAUDE_CODE_AUTO_COMPACT_WINDOW) ?? files2.map((file4) => windowOf2(record3(file4.env).CLAUDE_CODE_AUTO_COMPACT_WINDOW)).find(Boolean);
77080
+ const model = env.ANTHROPIC_MODEL || modelFlagOf(args) || files3.map((file4) => file4.model).find((value) => typeof value === "string");
77081
+ const compactWindow = windowOf2(env.CLAUDE_CODE_AUTO_COMPACT_WINDOW) ?? files3.map((file4) => windowOf2(record3(file4.env).CLAUDE_CODE_AUTO_COMPACT_WINDOW)).find(Boolean);
77042
77082
  return {
77043
77083
  ...model ? { model } : {},
77044
77084
  ...compactWindow ? { compactWindow } : {}
@@ -77207,8 +77247,8 @@ async function codexRolloutPathOf({
77207
77247
  threadId
77208
77248
  }) {
77209
77249
  const root = join13(codexHome, "sessions");
77210
- const files2 = await readdir4(root, { recursive: true }).catch(() => []);
77211
- const file4 = files2.find(
77250
+ const files3 = await readdir4(root, { recursive: true }).catch(() => []);
77251
+ const file4 = files3.find(
77212
77252
  (name3) => basename5(name3).startsWith("rollout-") && name3.endsWith(`-${threadId}.jsonl`)
77213
77253
  );
77214
77254
  return file4 ? join13(root, file4) : void 0;
@@ -77465,15 +77505,15 @@ var taskCreate = async ({ args, target, authorization }) => {
77465
77505
  ...typeof worktree === "string" && worktree.trim() && { worktree },
77466
77506
  ...machine2 && { machine: machine2 }
77467
77507
  };
77468
- const reply2 = await callKanban({
77508
+ const reply3 = await callKanban({
77469
77509
  target,
77470
77510
  authorization,
77471
77511
  method: "POST",
77472
77512
  path: "/v1/tasks",
77473
77513
  body
77474
77514
  });
77475
- if (!reply2.ok) return reply2.result;
77476
- const card2 = reply2.data ?? {};
77515
+ if (!reply3.ok) return reply3.result;
77516
+ const card2 = reply3.data ?? {};
77477
77517
  return jsonText(
77478
77518
  pick2(card2, ["id", "title", "column", "projectName", "branch", "isBusy", "isLive"])
77479
77519
  );
@@ -77490,14 +77530,14 @@ var STATUS_KEYS = [
77490
77530
  "queuedPromptCount"
77491
77531
  ];
77492
77532
  var cardStatus = async ({ args, target, authorization }) => {
77493
- const reply2 = await callKanban({
77533
+ const reply3 = await callKanban({
77494
77534
  target,
77495
77535
  authorization,
77496
77536
  method: "GET",
77497
77537
  path: cardPath(required2(args, "card"))
77498
77538
  });
77499
- if (!reply2.ok) return reply2.result;
77500
- const card2 = reply2.data ?? {};
77539
+ if (!reply3.ok) return reply3.result;
77540
+ const card2 = reply3.data ?? {};
77501
77541
  const prs = Array.isArray(card2.prs) ? card2.prs : [];
77502
77542
  return jsonText({
77503
77543
  ...pick2(card2, STATUS_KEYS),
@@ -77533,14 +77573,14 @@ var cardReply = async ({ args, target, authorization }) => {
77533
77573
  var cardPrompt = async ({ args, target, authorization }) => {
77534
77574
  const card2 = required2(args, "card");
77535
77575
  const now = args.now === true;
77536
- const reply2 = await callKanban({
77576
+ const reply3 = await callKanban({
77537
77577
  target,
77538
77578
  authorization,
77539
77579
  method: "POST",
77540
77580
  path: `${cardPath(card2)}/prompt`,
77541
77581
  body: { text: required2(args, "text"), mode: now ? "now" : "queue" }
77542
77582
  });
77543
- if (!reply2.ok) return reply2.result;
77583
+ if (!reply3.ok) return reply3.result;
77544
77584
  return text2(
77545
77585
  now ? `Sent to ${card2} now.` : `Sent to ${card2}; it is delivered when the card's current turn ends.`
77546
77586
  );
@@ -79435,12 +79475,12 @@ var CodexAppServer = class _CodexAppServer {
79435
79475
  }
79436
79476
  async call(method, params) {
79437
79477
  const id8 = ++this.#nextId;
79438
- const reply2 = await new Promise((resolve27) => {
79439
- this.#pending.set(id8, resolve27);
79478
+ const reply3 = await new Promise((resolve29) => {
79479
+ this.#pending.set(id8, resolve29);
79440
79480
  this.write({ id: id8, method, params });
79441
79481
  });
79442
- if (reply2.error !== void 0) throw new Error(`${method}: ${JSON.stringify(reply2.error)}`);
79443
- return record4(reply2.result);
79482
+ if (reply3.error !== void 0) throw new Error(`${method}: ${JSON.stringify(reply3.error)}`);
79483
+ return record4(reply3.result);
79444
79484
  }
79445
79485
  notify(method) {
79446
79486
  this.write({ method });
@@ -79448,12 +79488,12 @@ var CodexAppServer = class _CodexAppServer {
79448
79488
  /** Starts one turn; `done` settles when it completes, keeping its last agent message. */
79449
79489
  async startTurn({ threadId, text: text3 }) {
79450
79490
  const result2 = { answer: "" };
79451
- const done = new Promise((resolve27) => {
79491
+ const done = new Promise((resolve29) => {
79452
79492
  const listen = (message2) => {
79453
79493
  absorbTurnEvent({ result: result2, message: message2 });
79454
79494
  if (message2.method !== "turn/completed") return;
79455
79495
  this.#listeners.delete(listen);
79456
- resolve27(result2);
79496
+ resolve29(result2);
79457
79497
  };
79458
79498
  this.#listeners.add(listen);
79459
79499
  });
@@ -79497,8 +79537,8 @@ var CodexAppServer = class _CodexAppServer {
79497
79537
  };
79498
79538
  async function newestThreadId({ codexHome }) {
79499
79539
  const root = join19(codexHome, "sessions");
79500
- const files2 = await readdir5(root, { recursive: true }).catch(() => []);
79501
- const rollouts = files2.filter((file4) => /rollout-.*\.jsonl$/.test(file4));
79540
+ const files3 = await readdir5(root, { recursive: true }).catch(() => []);
79541
+ const rollouts = files3.filter((file4) => /rollout-.*\.jsonl$/.test(file4));
79502
79542
  const dated = await Promise.all(
79503
79543
  rollouts.map(async (file4) => ({ file: file4, at: (await stat6(join19(root, file4))).mtimeMs }))
79504
79544
  );
@@ -80127,13 +80167,13 @@ async function pluginIsCurrent({ context }) {
80127
80167
  }
80128
80168
  async function writeLazePlugin({ context }) {
80129
80169
  const folder = pluginFolderOf({ context });
80130
- const files2 = lazePluginFiles({
80170
+ const files3 = lazePluginFiles({
80131
80171
  name: pluginNameHere({ context }),
80132
80172
  program: context.program,
80133
80173
  version: cliVersionOf(),
80134
80174
  configPath: context.environment.configPath
80135
80175
  });
80136
- for (const [path, text3] of Object.entries(files2)) {
80176
+ for (const [path, text3] of Object.entries(files3)) {
80137
80177
  const target = join21(folder, path);
80138
80178
  await mkdir4(dirname15(target), { recursive: true });
80139
80179
  await writeFile2(target, text3);
@@ -82264,8 +82304,8 @@ async function uploadMigration({ context, args }) {
82264
82304
  const moved = await uploadTranscript({ context, args, client }).catch((error63) => {
82265
82305
  const migrated = migratedNoticeOf(error63);
82266
82306
  if (!migrated) throw error63;
82267
- const link2 = migrated.link ?? linkIn(migrated.notice);
82268
- return { link: link2 ?? "", agentName: profile.name, sent: void 0 };
82307
+ const link3 = migrated.link ?? linkIn(migrated.notice);
82308
+ return { link: link3 ?? "", agentName: profile.name, sent: void 0 };
82269
82309
  });
82270
82310
  const notice = moved.link ? `Moved to Laze: ${moved.link}` : "Moved to Laze.";
82271
82311
  await context.store.markMigrated({
@@ -83628,7 +83668,7 @@ var appEditClaimsSchemaDefinition = external_exports.object({
83628
83668
  app: external_exports.string().min(1),
83629
83669
  vid: external_exports.string().min(1),
83630
83670
  base: external_exports.string().min(1).max(64),
83631
- files: external_exports.array(external_exports.object({ path: external_exports.string().min(1).max(300), content: external_exports.string().max(6e5) })).max(20).nullable().transform((files2) => files2 ?? []),
83671
+ files: external_exports.array(external_exports.object({ path: external_exports.string().min(1).max(300), content: external_exports.string().max(6e5) })).max(20).nullable().transform((files3) => files3 ?? []),
83632
83672
  remove: external_exports.array(external_exports.string().min(1).max(300)).max(20).nullable().optional().transform((paths) => paths ?? []),
83633
83673
  msg: external_exports.string().min(1).max(500)
83634
83674
  });
@@ -83813,9 +83853,9 @@ function formatAppMoney({
83813
83853
  maximumFractionDigits: tiny ? 4 : 2
83814
83854
  }).format(amount);
83815
83855
  }
83816
- var count10 = new Intl.NumberFormat("en-US");
83856
+ var count11 = new Intl.NumberFormat("en-US");
83817
83857
  function plural2({ value, one, many }) {
83818
- return `${count10.format(value)} ${value === 1 ? one : many}`;
83858
+ return `${count11.format(value)} ${value === 1 ? one : many}`;
83819
83859
  }
83820
83860
  function appCostQuantityText(line) {
83821
83861
  const { quantity } = line;
@@ -84138,7 +84178,8 @@ var fileScopeSchemaDefinition = external_exports.object({
84138
84178
  "workspace-logo",
84139
84179
  "custom-emoji",
84140
84180
  "computer-copy",
84141
- "app-asset"
84181
+ "app-asset",
84182
+ "wiki-page"
84142
84183
  ]),
84143
84184
  id: idSchema25
84144
84185
  });
@@ -85131,12 +85172,12 @@ function messageOf({ args }) {
85131
85172
  }
85132
85173
  var RECORDS_CALL = /\b(?:Laze|LAZE)\.records\(\s*(["'`])([^"'`$]+)\1\s*\)/g;
85133
85174
  function unknownCollectionsOf({
85134
- files: files2,
85175
+ files: files3,
85135
85176
  collections
85136
85177
  }) {
85137
85178
  if (!collections) return [];
85138
85179
  const known = Object.keys(collections);
85139
- return files2.filter((file4) => /\.(m?js|html)$/.test(file4.path)).flatMap(
85180
+ return files3.filter((file4) => /\.(m?js|html)$/.test(file4.path)).flatMap(
85140
85181
  (file4) => [...file4.text.matchAll(RECORDS_CALL)].filter(([, , name3]) => !known.includes(name3 ?? "")).map((match) => {
85141
85182
  const line = file4.text.slice(0, match.index).split("\n").length;
85142
85183
  const defines = known.length > 0 ? known.join(", ") : "none";
@@ -86645,11 +86686,11 @@ function errorOf2({ script, stderr: stderr2 }) {
86645
86686
  return `${script.path}${line ? `:${line}` : ""}: ${message2}`;
86646
86687
  }
86647
86688
  async function scriptErrorsOf({
86648
- files: files2,
86689
+ files: files3,
86649
86690
  collections
86650
86691
  }) {
86651
- const unknown2 = unknownCollectionsOf({ files: files2, collections });
86652
- const scripts = files2.flatMap(scriptsOf);
86692
+ const unknown2 = unknownCollectionsOf({ files: files3, collections });
86693
+ const scripts = files3.flatMap(scriptsOf);
86653
86694
  if (scripts.length === 0) return unknown2;
86654
86695
  const dir = await mkdtemp(join27(tmpdir3(), "laze-app-check-"));
86655
86696
  try {
@@ -86818,16 +86859,16 @@ async function serveAppFolder({
86818
86859
  (error63) => failed({ response, error: error63 })
86819
86860
  );
86820
86861
  });
86821
- await new Promise((resolve27, reject) => {
86862
+ await new Promise((resolve29, reject) => {
86822
86863
  server.once("error", reject);
86823
- server.listen(port, "127.0.0.1", () => resolve27());
86864
+ server.listen(port, "127.0.0.1", () => resolve29());
86824
86865
  });
86825
86866
  const { port: bound } = server.address();
86826
86867
  return {
86827
86868
  url: `http://127.0.0.1:${bound}/`,
86828
- close: () => new Promise((resolve27) => {
86869
+ close: () => new Promise((resolve29) => {
86829
86870
  server.closeAllConnections();
86830
- server.close(() => resolve27());
86871
+ server.close(() => resolve29());
86831
86872
  })
86832
86873
  };
86833
86874
  }
@@ -87189,7 +87230,7 @@ var appPush = async ({ context, args }) => {
87189
87230
  }
87190
87231
  const manifest = await readManifest(folder);
87191
87232
  const paths = await listFiles(folder);
87192
- const files2 = await Promise.all(
87233
+ const files3 = await Promise.all(
87193
87234
  paths.map(
87194
87235
  async (path) => buildFileOf({
87195
87236
  path: relative3(folder, path).split(sep3).join("/"),
@@ -87197,7 +87238,7 @@ var appPush = async ({ context, args }) => {
87197
87238
  })
87198
87239
  )
87199
87240
  );
87200
- const bytes = files2.reduce((sum, file4) => sum + file4.bytes, 0);
87241
+ const bytes = files3.reduce((sum, file4) => sum + file4.bytes, 0);
87201
87242
  if (bytes > MAX_APP_BUILD_BYTES) {
87202
87243
  context.err(
87203
87244
  `laze: The folder is ${Math.ceil(bytes / 1024)} KB; one version holds at most ${MAX_APP_BUILD_BYTES / 1024 / 1024} MB (app_build_too_large). Put video, audio, big images and PDFs in assets: laze app asset add <file>
@@ -87205,9 +87246,9 @@ var appPush = async ({ context, args }) => {
87205
87246
  );
87206
87247
  throw new CliUsageError("Nothing was uploaded.");
87207
87248
  }
87208
- if (files2.length === 0) throw new CliUsageError(`No files to push in ${folder}`);
87249
+ if (files3.length === 0) throw new CliUsageError(`No files to push in ${folder}`);
87209
87250
  const scriptErrors = await scriptErrorsOf({
87210
- files: files2.filter((file4) => file4.encoding === "utf8").map(({ path, content }) => ({ path, text: content })),
87251
+ files: files3.filter((file4) => file4.encoding === "utf8").map(({ path, content }) => ({ path, text: content })),
87211
87252
  collections: manifest?.collections
87212
87253
  });
87213
87254
  if (scriptErrors.length > 0) {
@@ -87234,7 +87275,7 @@ var appPush = async ({ context, args }) => {
87234
87275
  const pushed = await client.post("/api/apps/commit", {
87235
87276
  appId,
87236
87277
  message: message2,
87237
- files: files2.map(({ bytes: _bytes, ...file4 }) => file4),
87278
+ files: files3.map(({ bytes: _bytes, ...file4 }) => file4),
87238
87279
  ...manifest?.users ? { users: manifest.users } : {},
87239
87280
  ...manifest?.functions ? { functions: manifest.functions } : {}
87240
87281
  });
@@ -87244,7 +87285,7 @@ var appPush = async ({ context, args }) => {
87244
87285
  context,
87245
87286
  args,
87246
87287
  value: { version: version2, app: publish.app, publish },
87247
- text: `Pushed ${version2.version.slice(0, 7)} "${version2.message}" (${files2.length} files)
87288
+ text: `Pushed ${version2.version.slice(0, 7)} "${version2.message}" (${files3.length} files)
87248
87289
  ` + (seeded ? seedLine(seeded) : "") + publishLine(publish)
87249
87290
  });
87250
87291
  };
@@ -87257,8 +87298,8 @@ var appWrite = async ({ context, args }) => {
87257
87298
  );
87258
87299
  }
87259
87300
  const folder = folderOf({ context, word: void 0 });
87260
- const remove9 = (flagText({ args, name: "remove" }) ?? "").split(",").map((path) => path.trim()).filter(Boolean);
87261
- const files2 = await Promise.all(
87301
+ const remove10 = (flagText({ args, name: "remove" }) ?? "").split(",").map((path) => path.trim()).filter(Boolean);
87302
+ const files3 = await Promise.all(
87262
87303
  words.slice(2).map(async (word3) => {
87263
87304
  const path = resolve9(context.cwd, word3);
87264
87305
  const { bytes: _bytes, ...file4 } = buildFileOf({
@@ -87268,27 +87309,27 @@ var appWrite = async ({ context, args }) => {
87268
87309
  return file4;
87269
87310
  })
87270
87311
  );
87271
- if (files2.length + remove9.length === 0) {
87312
+ if (files3.length + remove10.length === 0) {
87272
87313
  throw new CliUsageError("laze app write needs a file to write or --remove <path,...>");
87273
87314
  }
87274
87315
  const client = await appClient({ context, args });
87275
87316
  const appId = await appIdOf({ client, args, folder });
87276
87317
  const { publish, ...version2 } = await client.post("/api/apps/files/write", {
87277
87318
  appId,
87278
- files: files2,
87279
- remove: remove9,
87319
+ files: files3,
87320
+ remove: remove10,
87280
87321
  message: message2
87281
87322
  });
87282
87323
  print5({
87283
87324
  context,
87284
87325
  args,
87285
87326
  value: { version: version2, app: publish.app, publish },
87286
- text: `Wrote ${version2.version.slice(0, 7)} "${version2.message}" (${files2.length} written, ${remove9.length} removed)
87327
+ text: `Wrote ${version2.version.slice(0, 7)} "${version2.message}" (${files3.length} written, ${remove10.length} removed)
87287
87328
  ` + publishLine(publish)
87288
87329
  });
87289
87330
  };
87290
87331
  function seedLine(seeded) {
87291
- const created = Object.entries(seeded.created).map(([name3, count13]) => `${count13} in ${name3}`);
87332
+ const created = Object.entries(seeded.created).map(([name3, count14]) => `${count14} in ${name3}`);
87292
87333
  const parts = [
87293
87334
  created.length ? `Loaded starter records: ${created.join(", ")}.` : "",
87294
87335
  seeded.skipped.length ? `Left ${seeded.skipped.join(", ")} as it was: it already holds records.` : ""
@@ -87614,8 +87655,8 @@ function cardLine({ choice }) {
87614
87655
  var appCard = async ({ context, args }) => {
87615
87656
  const client = await appClient({ context, args });
87616
87657
  const appId = await appIdOf({ client, args, folder: folderOf({ context, word: void 0 }) });
87617
- const count13 = Number(flagText({ args, name: "rows", fallback: "5" }));
87618
- if (!Number.isInteger(count13) || count13 < 1 || count13 > 10) {
87658
+ const count14 = Number(flagText({ args, name: "rows", fallback: "5" }));
87659
+ if (!Number.isInteger(count14) || count14 < 1 || count14 > 10) {
87619
87660
  throw new CliUsageError("--rows is a whole number from 1 to 10");
87620
87661
  }
87621
87662
  const text3 = (name3) => flagText({ args, name: name3 }) || null;
@@ -87628,7 +87669,7 @@ var appCard = async ({ context, args }) => {
87628
87669
  collection: text3("collection"),
87629
87670
  filter: flagText({ args, name: "where" }) || flagText({ args, name: "filter" }),
87630
87671
  sort: flagText({ args, name: "sort" }),
87631
- rows: count13,
87672
+ rows: count14,
87632
87673
  caption: text3("caption")
87633
87674
  }
87634
87675
  });
@@ -88455,8 +88496,8 @@ function printAccount({ context, args }, account) {
88455
88496
  context.out(`Plan: ${plan2}${pending2}${ending}
88456
88497
  `);
88457
88498
  if (account.paymentIssue) {
88458
- const link2 = account.paymentIssue.invoiceUrl ? ` ${account.paymentIssue.invoiceUrl}` : "";
88459
- context.out(`Payment: ${account.paymentIssue.message ?? account.paymentIssue.kind}${link2}
88499
+ const link3 = account.paymentIssue.invoiceUrl ? ` ${account.paymentIssue.invoiceUrl}` : "";
88500
+ context.out(`Payment: ${account.paymentIssue.message ?? account.paymentIssue.kind}${link3}
88460
88501
  `);
88461
88502
  }
88462
88503
  context.out(
@@ -88485,10 +88526,10 @@ async function invoices({ context, args }) {
88485
88526
  if (args.flags.json) return printJson(context, list13);
88486
88527
  if (list13.length === 0) return context.out("No invoices yet.\n");
88487
88528
  for (const invoice of list13) {
88488
- const link2 = invoice.hostedUrl ? ` ${invoice.hostedUrl}` : "";
88529
+ const link3 = invoice.hostedUrl ? ` ${invoice.hostedUrl}` : "";
88489
88530
  const tax = invoice.tax ? ` (tax ${money(invoice.tax, invoice.currency)})` : "";
88490
88531
  context.out(
88491
- `${invoice.createdAt.slice(0, 10)} ${invoice.number ?? "draft"} ${invoice.status} ${money(invoice.total, invoice.currency)}${tax}${link2}
88532
+ `${invoice.createdAt.slice(0, 10)} ${invoice.number ?? "draft"} ${invoice.status} ${money(invoice.total, invoice.currency)}${tax}${link3}
88492
88533
  `
88493
88534
  );
88494
88535
  }
@@ -88710,7 +88751,7 @@ function tunnel({
88710
88751
  host: host2,
88711
88752
  port
88712
88753
  }) {
88713
- return new Promise((resolve27, reject) => {
88754
+ return new Promise((resolve29, reject) => {
88714
88755
  const socket = connectTcp(proxy.port, proxy.host);
88715
88756
  let answer6 = "";
88716
88757
  const auth = proxy.authorization ? `Proxy-Authorization: ${proxy.authorization}\r
@@ -88727,7 +88768,7 @@ ${auth}\r
88727
88768
  answer6 += chunk.toString("latin1");
88728
88769
  if (!answer6.includes(HEADER_END)) return;
88729
88770
  socket.off("data", onData);
88730
- if (/^HTTP\/1\.[01] 200/.test(answer6)) return resolve27(socket);
88771
+ if (/^HTTP\/1\.[01] 200/.test(answer6)) return resolve29(socket);
88731
88772
  socket.destroy();
88732
88773
  reject(new Error(`proxy refused the tunnel: ${answer6.split("\r\n")[0] ?? ""}`));
88733
88774
  };
@@ -88740,8 +88781,8 @@ async function upstreamOf({ target, proxy }) {
88740
88781
  const raw = proxy ? await tunnel({ proxy, host: target.hostname, port }) : connectTcp(port, target.hostname);
88741
88782
  if (!secure) return raw;
88742
88783
  const tls = connectTls({ socket: raw, servername: target.hostname });
88743
- await new Promise((resolve27, reject) => {
88744
- tls.once("secureConnect", () => resolve27());
88784
+ await new Promise((resolve29, reject) => {
88785
+ tls.once("secureConnect", () => resolve29());
88745
88786
  tls.once("error", reject);
88746
88787
  });
88747
88788
  return tls;
@@ -88783,8 +88824,8 @@ async function browserSocket({
88783
88824
  createConnection: () => upstream,
88784
88825
  perMessageDeflate: false
88785
88826
  });
88786
- await new Promise((resolve27, reject) => {
88787
- socket.once("open", () => resolve27());
88827
+ await new Promise((resolve29, reject) => {
88828
+ socket.once("open", () => resolve29());
88788
88829
  socket.once("error", reject);
88789
88830
  });
88790
88831
  return socket;
@@ -88797,12 +88838,12 @@ async function browserCall({
88797
88838
  }) {
88798
88839
  const socket = await browserSocket({ target, proxy });
88799
88840
  try {
88800
- return await new Promise((resolve27, reject) => {
88841
+ return await new Promise((resolve29, reject) => {
88801
88842
  socket.on("message", (data) => {
88802
- const reply2 = JSON.parse(textOf3(data));
88803
- if (reply2.id !== 1) return;
88804
- if (reply2.error) reject(new Error(`${method}: ${JSON.stringify(reply2.error)}`));
88805
- else resolve27(reply2.result ?? {});
88843
+ const reply3 = JSON.parse(textOf3(data));
88844
+ if (reply3.id !== 1) return;
88845
+ if (reply3.error) reject(new Error(`${method}: ${JSON.stringify(reply3.error)}`));
88846
+ else resolve29(reply3.result ?? {});
88806
88847
  });
88807
88848
  socket.once(
88808
88849
  "close",
@@ -88966,18 +89007,18 @@ function retargetCdpBridge({
88966
89007
  target,
88967
89008
  expiresAt
88968
89009
  }) {
88969
- return new Promise((resolve27) => {
89010
+ return new Promise((resolve29) => {
88970
89011
  const call = httpRequest(
88971
89012
  { host: "127.0.0.1", port, path: TARGET_PATH, method: "PUT", timeout: 2e3 },
88972
89013
  (response) => {
88973
89014
  response.resume();
88974
- resolve27(response.statusCode === 204);
89015
+ resolve29(response.statusCode === 204);
88975
89016
  }
88976
89017
  );
88977
89018
  call.setHeader(KEY_HEADER, key);
88978
89019
  call.setHeader("content-type", "application/json");
88979
89020
  call.once("timeout", () => call.destroy());
88980
- call.once("error", () => resolve27(false));
89021
+ call.once("error", () => resolve29(false));
88981
89022
  call.end(JSON.stringify({ target, expiresAt }));
88982
89023
  });
88983
89024
  }
@@ -89026,15 +89067,15 @@ async function startCdpBridge({
89026
89067
  (socket) => relayPage({ client: socket, targetId, target: url2, proxy })
89027
89068
  );
89028
89069
  });
89029
- await new Promise((resolve27) => server.listen(0, "127.0.0.1", resolve27));
89070
+ await new Promise((resolve29) => server.listen(0, "127.0.0.1", resolve29));
89030
89071
  const port = server.address().port;
89031
89072
  return {
89032
89073
  port,
89033
- close: () => new Promise((resolve27) => {
89074
+ close: () => new Promise((resolve29) => {
89034
89075
  for (const client of relayed) client.destroy();
89035
89076
  pages.close();
89036
89077
  server.closeAllConnections();
89037
- server.close(() => resolve27());
89078
+ server.close(() => resolve29());
89038
89079
  })
89039
89080
  };
89040
89081
  }
@@ -89051,7 +89092,7 @@ function launchCdpBridge({
89051
89092
  stdio: ["ignore", "pipe", "ignore"],
89052
89093
  env: { ...env, LAZE_CDP_TARGET: target, LAZE_CDP_EXPIRES_AT: expiresAt, LAZE_CDP_KEY: key }
89053
89094
  });
89054
- return new Promise((resolve27, reject) => {
89095
+ return new Promise((resolve29, reject) => {
89055
89096
  let printed2 = "";
89056
89097
  child.once("error", reject);
89057
89098
  child.once("exit", (code4) => reject(new Error(`the CDP bridge stopped (${code4})`)));
@@ -89062,7 +89103,7 @@ function launchCdpBridge({
89062
89103
  child.stdout.destroy();
89063
89104
  child.removeAllListeners("exit");
89064
89105
  child.unref();
89065
- if (Number.isInteger(port) && port > 0) resolve27(port);
89106
+ if (Number.isInteger(port) && port > 0) resolve29(port);
89066
89107
  else reject(new Error("the CDP bridge printed no port"));
89067
89108
  });
89068
89109
  });
@@ -89233,15 +89274,15 @@ async function bridge({ context }) {
89233
89274
  async function screen({ context, args }) {
89234
89275
  const client = await computeClient({ context, args });
89235
89276
  const site = flagText({ args, name: "site" }) || void 0;
89236
- const link2 = await client.post(PATHS2.screen, {
89277
+ const link3 = await client.post(PATHS2.screen, {
89237
89278
  machine: machineArg({ args }),
89238
89279
  ...site ? { site } : {}
89239
89280
  });
89240
- if (args.flags.json) return context.out(`${JSON.stringify(link2, null, 2)}
89281
+ if (args.flags.json) return context.out(`${JSON.stringify(link3, null, 2)}
89241
89282
  `);
89242
89283
  context.out(
89243
- link2.url ? `${link2.url}
89244
- ` : `Sent a fresh screen link for ${link2.machine.name} where you were asked.
89284
+ link3.url ? `${link3.url}
89285
+ ` : `Sent a fresh screen link for ${link3.machine.name} where you were asked.
89245
89286
  `
89246
89287
  );
89247
89288
  }
@@ -89323,9 +89364,9 @@ function presenceColumns(member) {
89323
89364
  return [member.presence, `${status11.emoji} ${status11.text}`.trim() + until, ...dndColumn(member)];
89324
89365
  }
89325
89366
  function formatMembers({ detail }) {
89326
- const count13 = `${detail.members.length} ${detail.members.length === 1 ? "member" : "members"}`;
89367
+ const count14 = `${detail.members.length} ${detail.members.length === 1 ? "member" : "members"}`;
89327
89368
  const ends = detail.endsAt ? `, ends ${utcTimeOf(detail.endsAt)}` : "";
89328
- const head = `${channelLabelOf(detail)} (${detail.id}), ${count13}${ends}`;
89369
+ const head = `${channelLabelOf(detail)} (${detail.id}), ${count14}${ends}`;
89329
89370
  const rows = detail.members.map(
89330
89371
  (member) => [ROLE[member.role], member.name, member.kind, member.id, ...presenceColumns(member)].join(" ")
89331
89372
  );
@@ -89365,13 +89406,13 @@ function formatBrowsable({
89365
89406
  }) {
89366
89407
  if (channels3.length === 0) return "No channels to browse.\n";
89367
89408
  const rows = channels3.map((channel) => {
89368
- const count13 = `${channel.memberCount} ${channel.memberCount === 1 ? "member" : "members"}`;
89409
+ const count14 = `${channel.memberCount} ${channel.memberCount === 1 ? "member" : "members"}`;
89369
89410
  const marks = [
89370
89411
  channel.joined ? "joined" : "not joined",
89371
89412
  ...channel.private ? ["private"] : [],
89372
89413
  ...channel.archived ? ["archived"] : []
89373
89414
  ].join(", ");
89374
- const text3 = `#${channel.name} ${channel.id} ${count13} ${marks} ${channel.topic}`;
89415
+ const text3 = `#${channel.name} ${channel.id} ${count14} ${marks} ${channel.topic}`;
89375
89416
  return withLink({ text: text3, url: channel.url, base });
89376
89417
  });
89377
89418
  return `${rows.join("\n")}
@@ -89741,13 +89782,13 @@ async function channelGroups({ context, args }) {
89741
89782
  const [, , channel] = args.words;
89742
89783
  if (!channel) throw new CliUsageError("Usage: laze channel groups <channel>");
89743
89784
  const { client } = await signedIn({ context, args });
89744
- const reply2 = await client.post("/api/agents/me/channels/groups", {
89785
+ const reply3 = await client.post("/api/agents/me/channels/groups", {
89745
89786
  channel
89746
89787
  });
89747
- if (args.flags.json) return context.out(`${JSON.stringify(reply2, null, 2)}
89788
+ if (args.flags.json) return context.out(`${JSON.stringify(reply3, null, 2)}
89748
89789
  `);
89749
- if (reply2.groups.length === 0) return context.out("No groups in this channel.\n");
89750
- for (const group of reply2.groups) context.out(`@${group.name} ${group.memberCount}
89790
+ if (reply3.groups.length === 0) return context.out("No groups in this channel.\n");
89791
+ for (const group of reply3.groups) context.out(`@${group.name} ${group.memberCount}
89751
89792
  `);
89752
89793
  }
89753
89794
  function groupChange({
@@ -89760,11 +89801,11 @@ function groupChange({
89760
89801
  throw new CliUsageError(`Usage: laze channel ${verb} <channel> <group>`);
89761
89802
  }
89762
89803
  const { client } = await signedIn({ context, args });
89763
- const reply2 = await client.post(`/api/agents/me/channels/${verb}`, {
89804
+ const reply3 = await client.post(`/api/agents/me/channels/${verb}`, {
89764
89805
  channel,
89765
89806
  group
89766
89807
  });
89767
- if (args.flags.json) return context.out(`${JSON.stringify(reply2, null, 2)}
89808
+ if (args.flags.json) return context.out(`${JSON.stringify(reply3, null, 2)}
89768
89809
  `);
89769
89810
  context.out(`${line(group.replace(/^@/, ""))}
89770
89811
  `);
@@ -90083,15 +90124,15 @@ async function threadWaitReply({
90083
90124
  const seconds = timeoutOf({ args });
90084
90125
  const { client } = await signedIn({ context, args });
90085
90126
  const read4 = () => client.post(CHAT_KEY_PATHS.thread, { messageId });
90086
- const seen = new Set((await read4()).replies.map((reply2) => reply2.id));
90087
- const isNew = (reply2) => reply2.author.kind === "person" && !seen.has(reply2.id);
90127
+ const seen = new Set((await read4()).replies.map((reply3) => reply3.id));
90128
+ const isNew = (reply3) => reply3.author.kind === "person" && !seen.has(reply3.id);
90088
90129
  for (let waited = 0; waited < seconds * 1e3; waited += POLL_MS2) {
90089
90130
  await context.sleep(POLL_MS2);
90090
- const reply2 = (await read4()).replies.find(isNew);
90091
- if (!reply2) continue;
90092
- const line = `${reply2.seq} ${reply2.id} person ${reply2.author.id} ${reply2.body}
90131
+ const reply3 = (await read4()).replies.find(isNew);
90132
+ if (!reply3) continue;
90133
+ const line = `${reply3.seq} ${reply3.id} person ${reply3.author.id} ${reply3.body}
90093
90134
  `;
90094
- context.out(args.flags.json ? `${JSON.stringify(reply2, null, 2)}
90135
+ context.out(args.flags.json ? `${JSON.stringify(reply3, null, 2)}
90095
90136
  ` : line);
90096
90137
  return void 0;
90097
90138
  }
@@ -93321,7 +93362,7 @@ var sendWakeIntentDefinition = external_exports.object({
93321
93362
  });
93322
93363
 
93323
93364
  // ../../modules/compute/contract/src/whatsapp-ops.ts
93324
- var count11 = external_exports.number().int().nonnegative();
93365
+ var count12 = external_exports.number().int().nonnegative();
93325
93366
  var at4 = external_exports.iso.datetime();
93326
93367
  var whatsappMirrorHealthDefinition = external_exports.object({
93327
93368
  mirrors: external_exports.array(
@@ -93339,33 +93380,33 @@ var whatsappMirrorHealthDefinition = external_exports.object({
93339
93380
  nextVisitAt: at4.nullable(),
93340
93381
  touchedAt: at4.nullable(),
93341
93382
  createdAt: at4,
93342
- skipped: external_exports.object({ count: count11, from: external_exports.number().int().nullable(), at: at4.nullable() }),
93383
+ skipped: external_exports.object({ count: count12, from: external_exports.number().int().nullable(), at: at4.nullable() }),
93343
93384
  /** The last pull that met files; null when none did. */
93344
93385
  files: external_exports.object({
93345
93386
  at: at4,
93346
- attached: count11,
93347
- unavailable: count11,
93348
- retrying: count11,
93349
- dropped: count11,
93387
+ attached: count12,
93388
+ unavailable: count12,
93389
+ retrying: count12,
93390
+ dropped: count12,
93350
93391
  failureCode: external_exports.string().nullable()
93351
93392
  }).nullable(),
93352
93393
  /** Intake holds (ADR-216 §11) by kind and code, with when the oldest was made. */
93353
- holds: external_exports.array(external_exports.object({ kind: external_exports.string(), code: external_exports.string(), count: count11, oldestAt: at4 })),
93394
+ holds: external_exports.array(external_exports.object({ kind: external_exports.string(), code: external_exports.string(), count: count12, oldestAt: at4 })),
93354
93395
  /**
93355
93396
  * The computer store's fill (ADR-223): chats done, how many mirrored items from the last 6
93356
93397
  * months Laze held, those the store held and those sent; the mirrored items Laze holds now
93357
93398
  * and how many a trim to 7 days after last read would delete. Null before a fill started.
93358
93399
  */
93359
93400
  storeFill: external_exports.object({
93360
- chats: count11,
93361
- lazeHeld: count11,
93362
- alreadyHeld: count11,
93363
- sent: count11,
93401
+ chats: count12,
93402
+ lazeHeld: count12,
93403
+ alreadyHeld: count12,
93404
+ sent: count12,
93364
93405
  problem: external_exports.string().nullable(),
93365
93406
  filledAt: at4.nullable(),
93366
93407
  updatedAt: at4,
93367
- mirrored: count11,
93368
- trimmable: count11
93408
+ mirrored: count12,
93409
+ trimmable: count12
93369
93410
  }).nullable().optional()
93370
93411
  })
93371
93412
  )
@@ -93395,7 +93436,7 @@ var whatsappSendsDefinition = external_exports.object({
93395
93436
  quoted: external_exports.boolean(),
93396
93437
  /** Sends to the same chat share a number, counted from 1 in this answer; never the chat. */
93397
93438
  chatIndex: external_exports.number().int().min(1),
93398
- files: count11,
93439
+ files: count12,
93399
93440
  /**
93400
93441
  * Why a failed send did not go: its stored code, or for older sends the code its outcome
93401
93442
  * line reads as; "other" when none fits, null for a send that did not fail.
@@ -93423,7 +93464,7 @@ var whatsappSendStreamsDefinition = external_exports.object({
93423
93464
  failureCode: external_exports.string().nullable(),
93424
93465
  createdAt: at4,
93425
93466
  /** The stream's events, its last event's kind and time; zero and null for none. */
93426
- events: count11,
93467
+ events: count12,
93427
93468
  lastEvent: external_exports.enum(["requested", "taken", "evidenced", "refused", "unresolved", "recheck_requested"]).nullable(),
93428
93469
  lastEventAt: at4.nullable(),
93429
93470
  /** The process's step and deadline; null when no process holds the send. */
@@ -93434,9 +93475,9 @@ var whatsappSendStreamsDefinition = external_exports.object({
93434
93475
  })
93435
93476
  ),
93436
93477
  /** Counts over the answered sends. */
93437
- total: count11,
93438
- agree: count11,
93439
- disagree: count11
93478
+ total: count12,
93479
+ agree: count12,
93480
+ disagree: count12
93440
93481
  });
93441
93482
  var whatsappSendStreamsSchema = whatsappSendStreamsDefinition;
93442
93483
  var WHATSAPP_WAKE_STEPS = [
@@ -93476,11 +93517,11 @@ var whatsappWakeTimelineDefinition = external_exports.object({
93476
93517
  external_exports.object({
93477
93518
  step: external_exports.enum(WHATSAPP_WAKE_STEPS),
93478
93519
  at: at4,
93479
- sincePreviousMs: count11,
93480
- sinceRequestMs: count11
93520
+ sincePreviousMs: count12,
93521
+ sinceRequestMs: count12
93481
93522
  })
93482
93523
  ),
93483
- totalMs: count11.nullable()
93524
+ totalMs: count12.nullable()
93484
93525
  })
93485
93526
  )
93486
93527
  })
@@ -95956,8 +95997,8 @@ var history = async ({ context, args, client }) => {
95956
95997
  if (json4({ context, args, data: page })) return;
95957
95998
  if (page.messages.length === 0) return context.out("No older messages.\n");
95958
95999
  for (const message2 of page.messages) {
95959
- const files2 = message2.files.length > 0 ? ` [${message2.files.length} files]` : "";
95960
- context.out(`[${message2.createdAt}] ${message2.authorName}: ${message2.body}${files2}
96000
+ const files3 = message2.files.length > 0 ? ` [${message2.files.length} files]` : "";
96001
+ context.out(`[${message2.createdAt}] ${message2.authorName}: ${message2.body}${files3}
95961
96002
  `);
95962
96003
  }
95963
96004
  if (page.hasOlder) {
@@ -98206,8 +98247,8 @@ function draftFilesMissingText(names) {
98206
98247
  }
98207
98248
 
98208
98249
  // ../../modules/feed/contract/src/feed.decisions.ts
98209
- function decisionsLineOf(count13) {
98210
- return `${count13} ${count13 === 1 ? "decision" : "decisions"} waiting on you`;
98250
+ function decisionsLineOf(count14) {
98251
+ return `${count14} ${count14 === 1 ? "decision" : "decisions"} waiting on you`;
98211
98252
  }
98212
98253
 
98213
98254
  // src/rules/feed-input.rules.ts
@@ -98548,16 +98589,16 @@ async function bodyOf2({
98548
98589
  return body;
98549
98590
  }
98550
98591
  function keptFilesOf({
98551
- files: files2,
98592
+ files: files3,
98552
98593
  removing
98553
98594
  }) {
98554
98595
  const matches = (file4, name3) => file4.id === name3 || file4.fileName === name3;
98555
- const unknown2 = removing.filter((name3) => !files2.some((file4) => matches(file4, name3)));
98596
+ const unknown2 = removing.filter((name3) => !files3.some((file4) => matches(file4, name3)));
98556
98597
  if (unknown2.length > 0) {
98557
- const on = files2.map((file4) => `${file4.fileName} (${file4.id})`).join(", ") || "none";
98598
+ const on = files3.map((file4) => `${file4.fileName} (${file4.id})`).join(", ") || "none";
98558
98599
  throw new CliUsageError(`The card has no file ${unknown2.join(", ")}; its files: ${on}`);
98559
98600
  }
98560
- return files2.filter((file4) => !removing.some((name3) => matches(file4, name3)));
98601
+ return files3.filter((file4) => !removing.some((name3) => matches(file4, name3)));
98561
98602
  }
98562
98603
  function refuseNamedFilesMissing({
98563
98604
  args,
@@ -98745,8 +98786,8 @@ function optionalWords(words) {
98745
98786
  }
98746
98787
  function shareLinesOf({ move: move3, answer: answer6 }) {
98747
98788
  const names = answer6.people.map((person) => person.name).join(", ") || "no one new";
98748
- const count13 = answer6.itemIds.length;
98749
- const items = `${count13} item${count13 === 1 ? "" : "s"}`;
98789
+ const count14 = answer6.itemIds.length;
98790
+ const items = `${count14} item${count14 === 1 ? "" : "s"}`;
98750
98791
  const head = move3 === "share" ? `Shared ${items} with ${names}` : `Took ${names} off ${items}`;
98751
98792
  return [head, ...answer6.itemIds].map((line) => `${line}
98752
98793
  `).join("");
@@ -98773,9 +98814,9 @@ async function feedGroupSummary({ context, args }) {
98773
98814
  const pointer = await client.post("/api/feed/group-summary", { group });
98774
98815
  if (args.flags.json) return context.out(`${JSON.stringify(pointer, null, 2)}
98775
98816
  `);
98776
- const link2 = pointer.link.startsWith("/") ? pointer.path : pointer.link;
98817
+ const link3 = pointer.link.startsWith("/") ? pointer.path : pointer.link;
98777
98818
  const top = pointer.top.map((title, index) => `${index + 1}. ${title}`);
98778
- context.out(`${[pointer.headline, link2, ...top].join("\n")}
98819
+ context.out(`${[pointer.headline, link3, ...top].join("\n")}
98779
98820
  `);
98780
98821
  }
98781
98822
  var PLACES = { open: "open", coming_up: "coming up", handled: "handled" };
@@ -99374,8 +99415,8 @@ function linesOf3(output2) {
99374
99415
  function blockOf2(line) {
99375
99416
  const badge = line.source ? ` [${line.source}]` : "";
99376
99417
  const thread2 = line.threadRootId ? ` in thread ${line.threadRootId}` : "";
99377
- const link2 = line.link ? ` ${line.link}` : "";
99378
- const head = `${timeOf2(line.at)} ${line.author}${badge} ${line.cursor}${thread2}${link2}`;
99418
+ const link3 = line.link ? ` ${line.link}` : "";
99419
+ const head = `${timeOf2(line.at)} ${line.author}${badge} ${line.cursor}${thread2}${link3}`;
99379
99420
  const body = line.body.split("\n").map((each) => ` ${each}`);
99380
99421
  const replies = line.replyCount > 0 ? [` ${line.replyCount} ${line.replyCount === 1 ? "reply" : "replies"} in its thread`] : [];
99381
99422
  return [head, ...body, ...replies].join("\n");
@@ -99393,13 +99434,13 @@ function formatHistory(output2) {
99393
99434
  const lines2 = linesOf3(output2);
99394
99435
  if (lines2.length === 0) return `${where}${from}: no messages.
99395
99436
  `;
99396
- const count13 = lines2.length === 1 ? "1 message" : `${lines2.length} messages`;
99437
+ const count14 = lines2.length === 1 ? "1 message" : `${lines2.length} messages`;
99397
99438
  const blocks = lines2.map(blockOf2).join("\n\n");
99398
99439
  const cursor = olderCursorOf(output2);
99399
99440
  const older = cursor ? `
99400
99441
 
99401
99442
  Older: laze history ${output2.channel} --before ${cursor}` : "";
99402
- return `${where}${from}: ${count13}, oldest first
99443
+ return `${where}${from}: ${count14}, oldest first
99403
99444
 
99404
99445
  ${blocks}${older}
99405
99446
  `;
@@ -100748,10 +100789,10 @@ ${USAGE13}`);
100748
100789
  if ("exitCode" in released) return released;
100749
100790
  Object.assign(env, released.env);
100750
100791
  }
100751
- const count13 = Object.keys(env).length;
100752
- if (count13 > EXEC_ENV_MAX) {
100792
+ const count14 = Object.keys(env).length;
100793
+ if (count14 > EXEC_ENV_MAX) {
100753
100794
  context.err(
100754
- `laze: these connections hold ${count13} variables; at most ${EXEC_ENV_MAX} go with a command. Send fewer connections, or run the command with \`laze vault run\` where you run.
100795
+ `laze: these connections hold ${count14} variables; at most ${EXEC_ENV_MAX} go with a command. Send fewer connections, or run the command with \`laze vault run\` where you run.
100755
100796
  `
100756
100797
  );
100757
100798
  return { exitCode: 1 };
@@ -100908,7 +100949,7 @@ function secretRefusal({
100908
100949
  rules = MCP_SECRET_COMMANDS
100909
100950
  }) {
100910
100951
  const { words, flags: flags2 } = parseArgs({ argv });
100911
- const command = [3, 2, 1].map((count13) => words.slice(0, count13).join(" ")).find((name3) => Object.hasOwn(rules, name3));
100952
+ const command = [3, 2, 1].map((count14) => words.slice(0, count14).join(" ")).find((name3) => Object.hasOwn(rules, name3));
100912
100953
  const rule = command === void 0 ? void 0 : rules[command];
100913
100954
  if (!command || !rule) return void 0;
100914
100955
  const vaultFlag = rule.vaultFlag ?? "from-vault";
@@ -101094,12 +101135,12 @@ async function writeMount({
101094
101135
  context,
101095
101136
  args,
101096
101137
  folder,
101097
- files: files2
101138
+ files: files3
101098
101139
  }) {
101099
101140
  const root = resolve19(context.cwd, flagText({ args, name: "dir", fallback: ".laze" }), folder);
101100
101141
  await rm17(root, { recursive: true, force: true });
101101
101142
  await mkdir11(root, { recursive: true });
101102
- for (const file4 of files2) {
101143
+ for (const file4 of files3) {
101103
101144
  const target = resolve19(root, file4.path);
101104
101145
  const inside = relative4(root, target);
101105
101146
  if (!inside || inside.startsWith(".."))
@@ -101218,12 +101259,12 @@ async function memorySearch({ context, args }) {
101218
101259
  async function memoryPull({ context, args }) {
101219
101260
  const channel = turnChannel({ context, args });
101220
101261
  const { client } = await turnClient({ context, args });
101221
- const files2 = await client.post("/api/memory/files", channel ? { channel } : {});
101222
- const root = await writeMount({ context, args, folder: "memory", files: files2 });
101262
+ const files3 = await client.post("/api/memory/files", channel ? { channel } : {});
101263
+ const root = await writeMount({ context, args, folder: "memory", files: files3 });
101223
101264
  if (args.flags.json)
101224
- return context.out(`${JSON.stringify({ root, files: files2.map((f) => f.path) })}
101265
+ return context.out(`${JSON.stringify({ root, files: files3.map((f) => f.path) })}
101225
101266
  `);
101226
- context.out(`${files2.length} files in ${root}
101267
+ context.out(`${files3.length} files in ${root}
101227
101268
  `);
101228
101269
  }
101229
101270
  async function turnTokenOf5({ context }) {
@@ -101659,11 +101700,11 @@ async function monitorAdd({ context, args }) {
101659
101700
  });
101660
101701
  if (args.flags.json) return context.out(`${JSON.stringify(added, null, 2)}
101661
101702
  `);
101662
- const count13 = added.watching.length;
101703
+ const count14 = added.watching.length;
101663
101704
  context.out(
101664
101705
  `${added.monitor.id} ${added.monitor.name}
101665
101706
  ${added.watching.join(" ")}
101666
- Watching ${count13} ${count13 === 1 ? "channel" : "channels"}
101707
+ Watching ${count14} ${count14 === 1 ? "channel" : "channels"}
101667
101708
  `
101668
101709
  );
101669
101710
  }
@@ -103050,12 +103091,12 @@ var funnelInputDefinition = external_exports.object({
103050
103091
  to: external_exports.iso.datetime(),
103051
103092
  bucketMinutes: external_exports.union([external_exports.literal(10), external_exports.literal(60), external_exports.literal(1440)]).default(60)
103052
103093
  }).strict();
103053
- var count12 = external_exports.number().int().nonnegative();
103094
+ var count13 = external_exports.number().int().nonnegative();
103054
103095
  var funnelCountsDefinition = external_exports.object({
103055
- signUps: count12,
103056
- workspaces: count12,
103057
- activatedTeams: count12,
103058
- payingTeams: count12
103096
+ signUps: count13,
103097
+ workspaces: count13,
103098
+ activatedTeams: count13,
103099
+ payingTeams: count13
103059
103100
  });
103060
103101
  var funnelOutputDefinition = external_exports.object({
103061
103102
  bucketMinutes: external_exports.number().int(),
@@ -103084,34 +103125,34 @@ var cohortOutputDefinition = external_exports.object({
103084
103125
  promotionId: external_exports.string().nullable(),
103085
103126
  plan: external_exports.string(),
103086
103127
  paying: external_exports.boolean(),
103087
- members: count12,
103128
+ members: count13,
103088
103129
  agents: external_exports.object({
103089
- laze: count12,
103090
- connected: count12,
103130
+ laze: count13,
103131
+ connected: count13,
103091
103132
  firstLazeAgentAt: external_exports.iso.datetime().nullable()
103092
103133
  }),
103093
- turns: count12,
103094
- appsCreated: count12,
103095
- connectionsLinked: count12,
103134
+ turns: count13,
103135
+ appsCreated: count13,
103136
+ connectionsLinked: count13,
103096
103137
  /** Slack channels mirrored, Slack and Discord link and intake events, WhatsApp mirrors on. */
103097
103138
  messaging: external_exports.object({
103098
- slackChannels: count12,
103099
- slackEvents: count12,
103100
- discordEvents: count12,
103101
- whatsappMirrors: count12
103139
+ slackChannels: count13,
103140
+ slackEvents: count13,
103141
+ discordEvents: count13,
103142
+ whatsappMirrors: count13
103102
103143
  }),
103103
103144
  creatorLastMessageAt: external_exports.iso.datetime().nullable(),
103104
103145
  /** The creator's last heartbeat from a Laze web or desktop window here; null when never. */
103105
103146
  creatorLastSeenAt: external_exports.iso.datetime().nullable(),
103106
103147
  /** Members whose last heartbeat here falls in the 7 days before `until`. */
103107
- peopleSeenLast7Days: count12,
103148
+ peopleSeenLast7Days: count13,
103108
103149
  /** Live messages per UTC day; days with none are left out. */
103109
103150
  days: external_exports.array(
103110
103151
  external_exports.object({
103111
103152
  day: external_exports.string(),
103112
- byPeople: count12,
103113
- byAgents: count12,
103114
- people: count12
103153
+ byPeople: count13,
103154
+ byAgents: count13,
103155
+ people: count13
103115
103156
  })
103116
103157
  ),
103117
103158
  /** The once-only sends nurturing kept (first_agent_made, first_agent_nudge, ...). */
@@ -103135,29 +103176,29 @@ var capacityOutputDefinition = external_exports.object({
103135
103176
  /** The last day of host load, oldest first. */
103136
103177
  history: external_exports.array(hostLoadPointSchema)
103137
103178
  });
103138
- var tally = external_exports.array(external_exports.object({ key: external_exports.string(), count: count12 }));
103179
+ var tally = external_exports.array(external_exports.object({ key: external_exports.string(), count: count13 }));
103139
103180
  var snapshotOutputDefinition = external_exports.object({
103140
103181
  workspaceId: external_exports.string(),
103141
103182
  createdAt: external_exports.iso.datetime(),
103142
103183
  plan: external_exports.string(),
103143
103184
  status: external_exports.string(),
103144
- seats: external_exports.object({ people: count12, limit: external_exports.number().int().nullable() }),
103185
+ seats: external_exports.object({ people: count13, limit: external_exports.number().int().nullable() }),
103145
103186
  membersByRole: tally,
103146
103187
  invitesByStatus: tally,
103147
103188
  agentsByKind: tally,
103148
103189
  agentsByHosting: tally,
103149
- agentsConnected: count12,
103190
+ agentsConnected: count13,
103150
103191
  flagsOn: external_exports.array(external_exports.string()),
103151
- complimentaryComputers: count12
103192
+ complimentaryComputers: count13
103152
103193
  });
103153
103194
  var eventsInputDefinition = external_exports.object({ from: external_exports.iso.datetime(), to: external_exports.iso.datetime() }).strict();
103154
103195
  var eventCountsDefinition = external_exports.object({
103155
- total: count12,
103196
+ total: count13,
103156
103197
  /** Per type: how many, and the stored bytes of their payloads and sealed copies. */
103157
103198
  byType: external_exports.array(
103158
103199
  external_exports.object({
103159
103200
  eventType: external_exports.string(),
103160
- count: count12,
103201
+ count: count13,
103161
103202
  payloadBytes: external_exports.number().nonnegative(),
103162
103203
  encryptedCopyBytes: external_exports.number().nonnegative()
103163
103204
  })
@@ -103211,9 +103252,9 @@ var databaseHealthDefinition = external_exports.object({
103211
103252
  deadlocks: external_exports.number().nonnegative(),
103212
103253
  tempBytes: external_exports.number().nonnegative(),
103213
103254
  connections: external_exports.object({
103214
- total: count12,
103215
- byState: external_exports.array(external_exports.object({ state: external_exports.string(), count: count12 })),
103216
- waitingOnLocks: count12,
103255
+ total: count13,
103256
+ byState: external_exports.array(external_exports.object({ state: external_exports.string(), count: count13 })),
103257
+ waitingOnLocks: count13,
103217
103258
  longestActiveSeconds: external_exports.number().nonnegative(),
103218
103259
  longestIdleInTransactionSeconds: external_exports.number().nonnegative()
103219
103260
  }),
@@ -103268,7 +103309,7 @@ var tenantAgentsDefinition = external_exports.object({
103268
103309
  createdAt: external_exports.iso.datetime(),
103269
103310
  modelLevel: external_exports.string().nullable(),
103270
103311
  model: external_exports.string().nullable(),
103271
- channels: count12,
103312
+ channels: count13,
103272
103313
  limitedUntil: external_exports.iso.datetime().nullable(),
103273
103314
  limitedBy: external_exports.string().nullable(),
103274
103315
  pausedAt: external_exports.iso.datetime().nullable(),
@@ -103322,8 +103363,8 @@ var tenantBillingDefinition = external_exports.object({
103322
103363
  currencyChosen: external_exports.boolean(),
103323
103364
  cancelAtPeriodEnd: external_exports.boolean(),
103324
103365
  period: external_exports.object({ start: external_exports.iso.datetime(), end: external_exports.iso.datetime() }).nullable(),
103325
- seats: external_exports.object({ people: count12, limit: count12.nullable(), monthlyPrice: external_exports.number() }),
103326
- complimentarySeats: count12.nullable(),
103366
+ seats: external_exports.object({ people: count13, limit: count13.nullable(), monthlyPrice: external_exports.number() }),
103367
+ complimentarySeats: count13.nullable(),
103327
103368
  credits: external_exports.object({
103328
103369
  included: external_exports.number(),
103329
103370
  includedLeft: external_exports.number(),
@@ -103362,14 +103403,14 @@ var tenantVaultDefinition = external_exports.object({
103362
103403
  external_exports.object({
103363
103404
  subject: external_exports.string(),
103364
103405
  most: external_exports.string(),
103365
- maxLeaseSeconds: count12.nullable(),
103406
+ maxLeaseSeconds: count13.nullable(),
103366
103407
  blocked: external_exports.boolean(),
103367
103408
  approveNew: external_exports.boolean(),
103368
103409
  updatedAt: external_exports.iso.datetime()
103369
103410
  })
103370
103411
  ),
103371
103412
  /** Connections waiting for an admin, counted by kind; never a name, label or field. */
103372
- waitingByKind: external_exports.array(external_exports.object({ key: external_exports.string(), count: count12 }))
103413
+ waitingByKind: external_exports.array(external_exports.object({ key: external_exports.string(), count: count13 }))
103373
103414
  });
103374
103415
  var WHATSAPP_INTAKE_KEY_KINDS = ["msg", "edit", "del", "react", "read"];
103375
103416
  var tenantWhatsappInputDefinition = external_exports.object({
@@ -103382,17 +103423,17 @@ var tenantWhatsappOutputDefinition = external_exports.object({
103382
103423
  intake: external_exports.object({
103383
103424
  since: external_exports.iso.datetime(),
103384
103425
  until: external_exports.iso.datetime(),
103385
- total: count12,
103426
+ total: count13,
103386
103427
  byKind: external_exports.array(
103387
103428
  external_exports.object({
103388
103429
  kind: external_exports.enum([...WHATSAPP_INTAKE_KEY_KINDS, "other"]),
103389
- count: count12,
103430
+ count: count13,
103390
103431
  /** Events dated over a second after Laze got them, and the most ahead: a fast clock. */
103391
- aheadOfLaze: external_exports.object({ count: count12, maxAheadMs: external_exports.number().int() }).optional()
103432
+ aheadOfLaze: external_exports.object({ count: count13, maxAheadMs: external_exports.number().int() }).optional()
103392
103433
  })
103393
103434
  ),
103394
103435
  /** The workspace's chat messages and changes dated over a second after Laze stored them. */
103395
- chatAheadOfLaze: external_exports.object({ count: count12, maxAheadMs: external_exports.number().int() }).optional()
103436
+ chatAheadOfLaze: external_exports.object({ count: count13, maxAheadMs: external_exports.number().int() }).optional()
103396
103437
  })
103397
103438
  });
103398
103439
  var computerBrowserInputDefinition = external_exports.object({
@@ -103512,6 +103553,26 @@ var vaultAsksInputDefinition = external_exports.object({
103512
103553
  cursor: cursorDefinition.optional()
103513
103554
  }).strict();
103514
103555
  var vaultAsksOutputDefinition = external_exports.object({ asks: pageOf(vaultOpsAskSchema) });
103556
+ var variableReferenceKeysInputDefinition = external_exports.object({
103557
+ limit: external_exports.number().int().min(1).max(500).default(100),
103558
+ cursor: cursorDefinition.optional()
103559
+ }).strict();
103560
+ var variableReferenceKeysOutputDefinition = external_exports.object({
103561
+ keys: pageOf(
103562
+ external_exports.object({
103563
+ ...vaultOpsReferenceKeySchema.omit({ name: true }).shape,
103564
+ /** Messages since the key was made naming it in its owner's conversations; null: no owner. */
103565
+ messageCount: external_exports.number().int().nonnegative().nullable(),
103566
+ /** The count reached the cap, so there are at least that many. */
103567
+ messageCountCapped: external_exports.boolean()
103568
+ })
103569
+ ),
103570
+ scanned: external_exports.number().int().nonnegative(),
103571
+ opened: external_exports.number().int().nonnegative(),
103572
+ deviceOnlyCount: external_exports.number().int().nonnegative(),
103573
+ failed: external_exports.number().int().nonnegative(),
103574
+ stopped: external_exports.boolean()
103575
+ });
103515
103576
  var vaultConnectionsInputDefinition = external_exports.object({
103516
103577
  from: external_exports.iso.datetime(),
103517
103578
  to: external_exports.iso.datetime(),
@@ -103762,6 +103823,13 @@ var OPS_FUNCTIONS = {
103762
103823
  input: judgeMeasureInputDefinition,
103763
103824
  output: judgeMeasureOutputDefinition
103764
103825
  }),
103826
+ "vault.variable_reference_keys": entry({
103827
+ title: "Pasted keys whose value is a shell variable reference, with how many messages name them",
103828
+ scope: "platform",
103829
+ view: "table",
103830
+ input: variableReferenceKeysInputDefinition,
103831
+ output: variableReferenceKeysOutputDefinition
103832
+ }),
103765
103833
  "traces.browser_errors": entry({
103766
103834
  title: "Browser errors over a range: message, frames, route, release and session",
103767
103835
  scope: "platform",
@@ -104423,13 +104491,13 @@ var USAGE18 = `Usage:
104423
104491
  With a person's key, list without --agent shows every agent's skills.`;
104424
104492
  async function folderFiles({ root }) {
104425
104493
  const entries = await readdir8(root, { recursive: true, withFileTypes: true });
104426
- const files2 = [];
104494
+ const files3 = [];
104427
104495
  for (const entry2 of entries) {
104428
104496
  if (!entry2.isFile()) continue;
104429
104497
  const full = join36(entry2.parentPath, entry2.name);
104430
- files2.push({ path: relative5(root, full), content: await readFile33(full, "utf8") });
104498
+ files3.push({ path: relative5(root, full), content: await readFile33(full, "utf8") });
104431
104499
  }
104432
- return files2.toSorted((a, b) => a.path.localeCompare(b.path));
104500
+ return files3.toSorted((a, b) => a.path.localeCompare(b.path));
104433
104501
  }
104434
104502
  function pinNote(skill2) {
104435
104503
  if (skill2.updateAvailable) return " (pinned, a newer version is available)";
@@ -104458,12 +104526,12 @@ async function skillInstall({ context, args }) {
104458
104526
  if (!catalogueId === !from) throw new CliUsageError(USAGE18);
104459
104527
  const name3 = flagText({ args, name: "as" });
104460
104528
  const agent3 = flagText({ args, name: "agent" });
104461
- const files2 = from ? await folderFiles({ root: resolve22(context.cwd, from) }) : void 0;
104529
+ const files3 = from ? await folderFiles({ root: resolve22(context.cwd, from) }) : void 0;
104462
104530
  const { client } = await signedIn({ context, args });
104463
104531
  const installed = await client.post("/api/skills/install", {
104464
104532
  ...catalogueId ? { catalogueId } : {},
104465
104533
  ...name3 ? { name: name3 } : {},
104466
- ...files2 ? { files: files2 } : {},
104534
+ ...files3 ? { files: files3 } : {},
104467
104535
  ...agent3 ? { agentId: agent3 } : {}
104468
104536
  });
104469
104537
  if (args.flags.json) return context.out(`${JSON.stringify(installed, null, 2)}
@@ -104492,12 +104560,12 @@ ${skillMd.content}`);
104492
104560
  }
104493
104561
  async function skillPull({ context, args }) {
104494
104562
  const { client } = await signedIn({ context, args });
104495
- const files2 = await client.get("/api/skills/files");
104496
- const root = await writeMount({ context, args, folder: "skills", files: files2 });
104563
+ const files3 = await client.get("/api/skills/files");
104564
+ const root = await writeMount({ context, args, folder: "skills", files: files3 });
104497
104565
  if (args.flags.json)
104498
- return context.out(`${JSON.stringify({ root, files: files2.map((f) => f.path) })}
104566
+ return context.out(`${JSON.stringify({ root, files: files3.map((f) => f.path) })}
104499
104567
  `);
104500
- context.out(`${files2.length} files in ${root}
104568
+ context.out(`${files3.length} files in ${root}
104501
104569
  `);
104502
104570
  }
104503
104571
  function agentFlag(args) {
@@ -104651,9 +104719,9 @@ function authorizeRun2(path, label3, body) {
104651
104719
  };
104652
104720
  }
104653
104721
  function printConnection4({ context, row }) {
104654
- const link2 = row.viewerLinkState ?? "not linked";
104722
+ const link3 = row.viewerLinkState ?? "not linked";
104655
104723
  context.out(
104656
- `${row.teamId} ${row.label ?? row.teamName} ${row.status} ${row.mirrors.length} mirrored ${row.linkedPeople} linked you: ${link2}
104724
+ `${row.teamId} ${row.label ?? row.teamName} ${row.status} ${row.mirrors.length} mirrored ${row.linkedPeople} linked you: ${link3}
104657
104725
  `
104658
104726
  );
104659
104727
  }
@@ -106106,7 +106174,7 @@ async function vaultSave({ context, args }) {
106106
106174
  // src/services/vault-scrub-commands.service.ts
106107
106175
  function lineOf6(channel) {
106108
106176
  const where = channel.name ? `#${channel.name}` : channel.channelId;
106109
- const found = Object.entries(channel.found).map(([vendor, count13]) => `${vendor} ${count13}`).join(", ");
106177
+ const found = Object.entries(channel.found).map(([vendor, count14]) => `${vendor} ${count14}`).join(", ");
106110
106178
  const kinds = [`held ${channel.held}`, ...found ? [`found: ${found}`] : []].join("; ");
106111
106179
  return `${where} scanned ${channel.scanned} changed ${channel.messages} ${kinds}
106112
106180
  `;
@@ -107051,24 +107119,209 @@ async function whatsapp({
107051
107119
  throw new CliUsageError(USAGE20);
107052
107120
  }
107053
107121
 
107122
+ // src/services/wiki-comment-commands.service.ts
107123
+ var WIKI_COMMENT_USAGE = ` laze wiki comments <path> [--open] the page's comment threads, with their ids
107124
+ laze wiki comment <path> --quote <text> <comment|->
107125
+ starts a thread on text the page holds; @Name tells a person or agent who can read it
107126
+ laze wiki comment reply <thread-id> <text|->
107127
+ laze wiki comment resolve <thread-id> [--reopen]
107128
+ laze wiki comment delete <comment-id> your own comment; the first one takes its thread`;
107129
+ function commentText({ context, value }) {
107130
+ return value === "-" ? textArgument({ context, value }) : Promise.resolve(value);
107131
+ }
107132
+ function threadText(thread2) {
107133
+ const open8 = thread2.detached ? "open, its text is no longer on the page" : "open";
107134
+ const state = thread2.resolved ? `resolved by ${thread2.resolved.by.name}` : open8;
107135
+ const lines2 = [`Thread ${thread2.id} (${state})`, ` > ${thread2.quote}`];
107136
+ for (const comment of thread2.comments)
107137
+ lines2.push(
107138
+ ` ${comment.author.name}: ${comment.body.replace(/\n/g, "\n ")} [${comment.id}]`
107139
+ );
107140
+ return `${lines2.join("\n")}
107141
+ `;
107142
+ }
107143
+ function postedText(posted) {
107144
+ const told = posted.notTold.length === 0 ? "" : `Not told, as they cannot see the page: ${posted.notTold.join(", ")}
107145
+ `;
107146
+ return `${threadText(posted.thread)}${told}`;
107147
+ }
107148
+ var comments = async ({ context, args, usage: usage2 }) => {
107149
+ const path = args.words[2];
107150
+ if (!path) throw new CliUsageError(usage2);
107151
+ const { client } = await signedIn({ context, args });
107152
+ const query = args.flags.open ? "&open=true" : "";
107153
+ const threads2 = await client.get(
107154
+ `/api/wiki/comments?path=${encodeURIComponent(path)}${query}`
107155
+ );
107156
+ if (args.flags.json) return context.out(`${JSON.stringify(threads2, null, 2)}
107157
+ `);
107158
+ if (threads2.threads.length === 0) return context.out(`No comments on ${path}
107159
+ `);
107160
+ context.out(`${threads2.open} open on ${path}
107161
+
107162
+ ${threads2.threads.map(threadText).join("\n")}`);
107163
+ };
107164
+ var startThread = async ({ context, args, usage: usage2 }) => {
107165
+ const path = args.words[2];
107166
+ const quote4 = flagText({ args, name: "quote" });
107167
+ const value = args.words.slice(3).join(" ");
107168
+ if (!path || !quote4 || !value) throw new CliUsageError(usage2);
107169
+ const body = await commentText({ context, value });
107170
+ const { client } = await signedIn({ context, args });
107171
+ const posted = await client.post("/api/wiki/comment", { path, quote: quote4, body });
107172
+ if (args.flags.json) return context.out(`${JSON.stringify(posted, null, 2)}
107173
+ `);
107174
+ context.out(postedText(posted));
107175
+ };
107176
+ var reply2 = async ({ context, args, usage: usage2 }) => {
107177
+ const threadId = args.words[3];
107178
+ const value = args.words.slice(4).join(" ");
107179
+ if (!threadId || !value) throw new CliUsageError(usage2);
107180
+ const body = await commentText({ context, value });
107181
+ const { client } = await signedIn({ context, args });
107182
+ const posted = await client.post("/api/wiki/comment/reply", {
107183
+ threadId,
107184
+ body
107185
+ });
107186
+ if (args.flags.json) return context.out(`${JSON.stringify(posted, null, 2)}
107187
+ `);
107188
+ context.out(postedText(posted));
107189
+ };
107190
+ var resolve27 = async ({ context, args, usage: usage2 }) => {
107191
+ const threadId = args.words[3];
107192
+ if (!threadId) throw new CliUsageError(usage2);
107193
+ const { client } = await signedIn({ context, args });
107194
+ const thread2 = await client.post("/api/wiki/comment/resolve", {
107195
+ threadId,
107196
+ resolved: !args.flags.reopen
107197
+ });
107198
+ if (args.flags.json) return context.out(`${JSON.stringify(thread2, null, 2)}
107199
+ `);
107200
+ context.out(threadText(thread2));
107201
+ };
107202
+ var remove9 = async ({ context, args, usage: usage2 }) => {
107203
+ const commentId = args.words[3];
107204
+ if (!commentId) throw new CliUsageError(usage2);
107205
+ const { client } = await signedIn({ context, args });
107206
+ const left = await client.post("/api/wiki/comment/delete", { commentId });
107207
+ if (args.flags.json) return context.out(`${JSON.stringify(left, null, 2)}
107208
+ `);
107209
+ context.out(`Deleted ${commentId}; ${left.open} open on ${left.path}
107210
+ `);
107211
+ };
107212
+ var ACTIONS2 = { reply: reply2, resolve: resolve27, delete: remove9 };
107213
+ async function wikiComment({
107214
+ context,
107215
+ args,
107216
+ usage: usage2
107217
+ }) {
107218
+ if (args.words[1] === "comments") return comments({ context, args, usage: usage2 });
107219
+ const action = Object.hasOwn(ACTIONS2, args.words[2] ?? "") ? ACTIONS2[args.words[2] ?? ""] : null;
107220
+ if (action && !flagText({ args, name: "quote" })) return action({ context, args, usage: usage2 });
107221
+ return startThread({ context, args, usage: usage2 });
107222
+ }
107223
+
107224
+ // src/services/wiki-file-commands.service.ts
107225
+ import { readFile as readFile38 } from "node:fs/promises";
107226
+ import { basename as basename13, resolve as resolve28 } from "node:path";
107227
+ var WIKI_FILE_USAGE = ` laze wiki attach <path> <file> [--name <name>] [--type <mime>]
107228
+ uploads a file to the page (up to 25 MB) and prints the markdown that embeds it
107229
+ laze wiki files <path> the page's files, with their addresses
107230
+ laze wiki file <file-id> a short-lived link to a file's bytes`;
107231
+ function wikiFileMarkdown(file4) {
107232
+ const label3 = file4.name.replace(/[[\]]/g, "");
107233
+ return `${file4.contentType.startsWith("image/") ? "!" : ""}[${label3}](${file4.url})`;
107234
+ }
107235
+ var attach = async ({ context, args, usage: usage2 }) => {
107236
+ const path = args.words[2];
107237
+ const local2 = args.words[3];
107238
+ if (!path || !local2) throw new CliUsageError(usage2);
107239
+ const file4 = resolve28(context.cwd, local2);
107240
+ const bytes = new Uint8Array(await readFile38(file4));
107241
+ const asked = flagText({ args, name: "name" });
107242
+ const fileName = readableUploadName({ name: basename13(file4), ...asked && { asked } });
107243
+ const contentType = flagText({ args, name: "type", fallback: contentTypeOf(file4) });
107244
+ const { client } = await signedIn({ context, args });
107245
+ const ticket = await client.post("/api/wiki/attach", {
107246
+ path,
107247
+ fileName,
107248
+ contentType,
107249
+ sizeBytes: bytes.byteLength
107250
+ });
107251
+ const parts = await sendParts({ context, ticket: ticket.upload, bytes });
107252
+ const done = await client.post("/api/wiki/attach/done", {
107253
+ path,
107254
+ fileId: ticket.file.id,
107255
+ parts
107256
+ });
107257
+ if (args.flags.json) return context.out(`${JSON.stringify(done, null, 2)}
107258
+ `);
107259
+ context.out(`${wikiFileMarkdown(done)}
107260
+ `);
107261
+ };
107262
+ var files2 = async ({ context, args, usage: usage2 }) => {
107263
+ const path = args.words[2];
107264
+ if (!path) throw new CliUsageError(usage2);
107265
+ const { client } = await signedIn({ context, args });
107266
+ const listed = await client.get(`/api/wiki/files?path=${encodeURIComponent(path)}`);
107267
+ if (args.flags.json) return context.out(`${JSON.stringify(listed, null, 2)}
107268
+ `);
107269
+ if (listed.files.length === 0) return context.out(`No files on ${path}
107270
+ `);
107271
+ for (const one of listed.files)
107272
+ context.out(`${one.id} ${one.name} ${one.contentType} ${one.sizeBytes} ${one.url}
107273
+ `);
107274
+ };
107275
+ var link = async ({ context, args, usage: usage2 }) => {
107276
+ const fileId = args.words[2];
107277
+ if (!fileId) throw new CliUsageError(usage2);
107278
+ const { client } = await signedIn({ context, args });
107279
+ const answer6 = await client.get(
107280
+ `/api/wiki/file-link?fileId=${encodeURIComponent(fileId)}`
107281
+ );
107282
+ if (args.flags.json) return context.out(`${JSON.stringify(answer6, null, 2)}
107283
+ `);
107284
+ context.out(`${answer6.url}
107285
+ `);
107286
+ };
107287
+ var WIKI_FILE_COMMANDS = {
107288
+ attach,
107289
+ files: files2,
107290
+ file: link
107291
+ };
107292
+
107054
107293
  // src/services/wiki-commands.service.ts
107055
107294
  var USAGE21 = `Usage:
107056
- laze wiki list
107295
+ laze wiki list [--type <type>] every page, or only those whose header says type: <type>
107057
107296
  laze wiki get <path>
107058
107297
  laze wiki put <path> <markdown|@file|-> [--title <title>] [--channel <channel>] [--base <version>]
107059
107298
  laze wiki search <words>
107060
107299
  laze wiki history <path>
107061
107300
  laze wiki mv <path> <new-path> pages under <path> move with it
107062
107301
  laze wiki rm <path> the page and its history; pages under it stay
107302
+ laze wiki share <path> who sees a page or folder, and what they can do
107303
+ [--visibility restricted|channel|internal|public] [--role view|edit] [--channel <channel>]
107304
+ [--grant <who>[:view|edit]]... [--revoke <who>]... [--reset]
107305
+ <who> is #channel, @group, an email, or a person's or agent's name. --reset takes the
107306
+ folder's sharing again. Agents can only narrow sharing.
107307
+ laze wiki pin <path> --channel <channel> [--role view|edit | --view-only]
107308
+ shows the page or folder as a tab of the conversation; its members get edit, or view
107309
+ laze wiki unpin <path> --channel <channel> the access the pin gave goes with it
107310
+ laze wiki pins --channel <channel> the pages and folders pinned there
107311
+ ${WIKI_COMMENT_USAGE}
107312
+ ${WIKI_FILE_USAGE}
107063
107313
 
107064
107314
  Paths are lower-case segments such as handbook/onboarding; link pages with [[path]].`;
107065
107315
  async function wikiList({ context, args }) {
107066
107316
  const { client, profile } = await signedIn({ context, args });
107067
- const listing = await client.get("/api/wiki/pages");
107317
+ const type = flagText({ args, name: "type" });
107318
+ const listing = await client.get(
107319
+ type ? `/api/wiki/pages?type=${encodeURIComponent(type)}` : "/api/wiki/pages"
107320
+ );
107068
107321
  if (args.flags.json) return context.out(`${JSON.stringify(listing, null, 2)}
107069
107322
  `);
107070
107323
  for (const page of listing.pages) {
107071
- const text3 = `${page.path} ${page.title}`;
107324
+ const text3 = [page.path, page.title, ...page.type ? [page.type] : []].join(" ");
107072
107325
  context.out(`${withLink({ text: text3, url: page.url, base: profile.url })}
107073
107326
  `);
107074
107327
  }
@@ -107088,7 +107341,7 @@ ${page.body}
107088
107341
  );
107089
107342
  if (page.backlinks.length > 0)
107090
107343
  context.out(`
107091
- Linked from: ${page.backlinks.map((link2) => link2.path).join(", ")}
107344
+ Linked from: ${page.backlinks.map((link3) => link3.path).join(", ")}
107092
107345
  `);
107093
107346
  }
107094
107347
  async function wikiPut({ context, args }) {
@@ -107161,6 +107414,102 @@ async function wikiRemove({ context, args }) {
107161
107414
  context.out(`Removed ${path}
107162
107415
  `);
107163
107416
  }
107417
+ var VISIBILITY_WORDS = {
107418
+ restricted: "Restricted: only the people it is shared with",
107419
+ channel: "Members of the channel",
107420
+ internal: "Everyone in the workspace",
107421
+ public: "Anyone with the link"
107422
+ };
107423
+ function sharingLines(sharing) {
107424
+ const general = sharing.visibility === "channel" && sharing.channel ? `Members of #${sharing.channel.name ?? sharing.channel.id}` : VISIBILITY_WORDS[sharing.visibility];
107425
+ const role2 = sharing.visibility === "restricted" ? "" : `, can ${sharing.memberRole}`;
107426
+ const from = sharing.source === "inherited" ? ` (from ${sharing.from})` : "";
107427
+ const lines2 = [sharing.path, `General access: ${general}${role2}${from}`];
107428
+ if (sharing.publicUrl ?? sharing.publicToken)
107429
+ lines2.push(`Public link: ${sharing.publicUrl ?? `/wiki/p/${sharing.publicToken}`}`);
107430
+ for (const grant of sharing.grants)
107431
+ lines2.push(` ${grant.name ?? `${grant.subject.type} ${grant.subject.id}`} can ${grant.role}`);
107432
+ if (sharing.ownBelow > 0) lines2.push(`${sharing.ownBelow} pages under it keep their own sharing`);
107433
+ lines2.push(`You can ${sharing.role}`);
107434
+ return `${lines2.join("\n")}
107435
+ `;
107436
+ }
107437
+ function grantOf(value) {
107438
+ const match = /^(.*):(view|edit)$/.exec(value);
107439
+ return match ? { who: match[1] ?? value, role: match[2] } : { who: value, role: "view" };
107440
+ }
107441
+ async function wikiShare({ context, args }) {
107442
+ const path = args.words[2];
107443
+ if (!path) throw new CliUsageError(USAGE21);
107444
+ const { client } = await signedIn({ context, args });
107445
+ const visibility = flagText({ args, name: "visibility" });
107446
+ const memberRole = flagText({ args, name: "role" });
107447
+ const channel = flagText({ args, name: "channel" });
107448
+ let sharing = null;
107449
+ if (args.flags.reset)
107450
+ sharing = await client.post("/api/wiki/sharing/reset", { path });
107451
+ if (visibility || memberRole || channel) {
107452
+ sharing = await client.post("/api/wiki/sharing", {
107453
+ path,
107454
+ ...visibility ? { visibility } : {},
107455
+ ...memberRole ? { memberRole } : {},
107456
+ ...channel ? { channel } : {}
107457
+ });
107458
+ }
107459
+ for (const value of args.lists.grant ?? [])
107460
+ sharing = await client.post("/api/wiki/sharing/grant", {
107461
+ path,
107462
+ ...grantOf(value)
107463
+ });
107464
+ for (const who of args.lists.revoke ?? [])
107465
+ sharing = await client.post("/api/wiki/sharing/revoke", { path, who });
107466
+ sharing ??= await client.get(`/api/wiki/sharing?path=${encodeURIComponent(path)}`);
107467
+ if (args.flags.json) return context.out(`${JSON.stringify(sharing, null, 2)}
107468
+ `);
107469
+ context.out(sharingLines(sharing));
107470
+ }
107471
+ function channelOf3(args) {
107472
+ const channel = flagText({ args, name: "channel" });
107473
+ if (!channel) throw new CliUsageError(USAGE21);
107474
+ return channel;
107475
+ }
107476
+ async function wikiPin({ context, args }) {
107477
+ const path = args.words[2];
107478
+ if (!path) throw new CliUsageError(USAGE21);
107479
+ const channel = channelOf3(args);
107480
+ const role2 = args.flags["view-only"] ? "view" : flagText({ args, name: "role" }) || "edit";
107481
+ const { client } = await signedIn({ context, args });
107482
+ const sharing = await client.post("/api/wiki/pin", { path, channel, role: role2 });
107483
+ if (args.flags.json) return context.out(`${JSON.stringify(sharing, null, 2)}
107484
+ `);
107485
+ context.out(`Pinned ${path} to ${channel}, members can ${role2}
107486
+ `);
107487
+ }
107488
+ async function wikiUnpin({ context, args }) {
107489
+ const path = args.words[2];
107490
+ if (!path) throw new CliUsageError(USAGE21);
107491
+ const channel = channelOf3(args);
107492
+ const { client } = await signedIn({ context, args });
107493
+ const sharing = await client.post("/api/wiki/unpin", { path, channel });
107494
+ if (args.flags.json) return context.out(`${JSON.stringify(sharing, null, 2)}
107495
+ `);
107496
+ context.out(`Unpinned ${path} from ${channel}
107497
+ `);
107498
+ }
107499
+ async function wikiPins({ context, args }) {
107500
+ const channel = channelOf3(args);
107501
+ const { client } = await signedIn({ context, args });
107502
+ const pins2 = await client.get(
107503
+ `/api/wiki/pins?channel=${encodeURIComponent(channel)}`
107504
+ );
107505
+ if (args.flags.json) return context.out(`${JSON.stringify(pins2, null, 2)}
107506
+ `);
107507
+ if (pins2.pins.length === 0) return context.out(`No wiki pages pinned to ${channel}
107508
+ `);
107509
+ for (const pin of pins2.pins)
107510
+ context.out(`${pin.path} ${pin.title}${pin.folder ? " (folder)" : ""} can ${pin.role}
107511
+ `);
107512
+ }
107164
107513
  var WIKI_COMMANDS = {
107165
107514
  list: wikiList,
107166
107515
  get: wikiGet,
@@ -107168,7 +107517,19 @@ var WIKI_COMMANDS = {
107168
107517
  search: wikiSearch,
107169
107518
  history: wikiHistory,
107170
107519
  mv: wikiMove,
107171
- rm: wikiRemove
107520
+ rm: wikiRemove,
107521
+ share: wikiShare,
107522
+ pin: wikiPin,
107523
+ unpin: wikiUnpin,
107524
+ pins: wikiPins,
107525
+ comments: (input2) => wikiComment({ ...input2, usage: USAGE21 }),
107526
+ comment: (input2) => wikiComment({ ...input2, usage: USAGE21 }),
107527
+ ...Object.fromEntries(
107528
+ Object.entries(WIKI_FILE_COMMANDS).map(([name3, run4]) => [
107529
+ name3,
107530
+ (input2) => run4({ ...input2, usage: USAGE21 })
107531
+ ])
107532
+ )
107172
107533
  };
107173
107534
  async function wiki({ context, args }) {
107174
107535
  const name3 = args.words[1] ?? "";
@@ -107188,8 +107549,8 @@ async function roles({ context, args }) {
107188
107549
  const catalogue = await client.get("/api/roles");
107189
107550
  if (args.flags.json) return printJson11(context, catalogue);
107190
107551
  for (const role2 of catalogue) {
107191
- const count13 = `${role2.permissions.length} permissions`;
107192
- context.out(`${role2.label} ${count13} ${role2.description}
107552
+ const count14 = `${role2.permissions.length} permissions`;
107553
+ context.out(`${role2.label} ${count14} ${role2.description}
107193
107554
  `);
107194
107555
  context.out(` ${role2.permissions.join(", ")}
107195
107556
  `);
@@ -107387,7 +107748,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
107387
107748
  laze schedule add|update ... --check <script> a script decides each firing, without a model
107388
107749
  laze schedule list|update|pause|resume|rm|runs your agent's schedules and their runs
107389
107750
  laze memory get|set|append|history <file>, search, pull SOUL.md, AGENTS.md, a channel's MEMORY.md
107390
- laze wiki list|get|put|search|history|mv|rm the workspace wiki
107751
+ laze wiki list|get|put|search|history|mv|rm|share the workspace wiki
107391
107752
  laze skill list|install|show|pull|rm|update|pin|unpin your agent's skills and the catalogue
107392
107753
  laze app create <name> ... build an app from scratch (--template slides for a deck), push, revert
107393
107754
  apps are also called artifacts: asked for an artifact, page, dashboard, deck or mock, build a Laze app
@@ -107837,15 +108198,15 @@ import {
107837
108198
  randomBytes as randomBytes6,
107838
108199
  sign
107839
108200
  } from "node:crypto";
107840
- import { chmod, link, mkdir as mkdir13, readFile as readFile38, rm as rm21, writeFile as writeFile11 } from "node:fs/promises";
108201
+ import { chmod, link as link2, mkdir as mkdir13, readFile as readFile39, rm as rm21, writeFile as writeFile11 } from "node:fs/promises";
107841
108202
  import { dirname as dirname27, join as join38 } from "node:path";
107842
108203
  var KEYCHAIN_SERVICE = "laze-cli-machine-key";
107843
- var runProgram = ({ program, args, stdin: stdin2, timeoutMs }) => new Promise((resolve27, reject) => {
108204
+ var runProgram = ({ program, args, stdin: stdin2, timeoutMs }) => new Promise((resolve29, reject) => {
107844
108205
  const child = execFile2(
107845
108206
  program,
107846
108207
  [...args],
107847
108208
  { timeout: timeoutMs },
107848
- (error63, stdout2) => error63 ? reject(error63) : resolve27(String(stdout2))
108209
+ (error63, stdout2) => error63 ? reject(error63) : resolve29(String(stdout2))
107849
108210
  );
107850
108211
  if (stdin2 !== void 0) child.stdin?.end(stdin2);
107851
108212
  });
@@ -107910,7 +108271,7 @@ var MachineKeyStore = class _MachineKeyStore {
107910
108271
  async read() {
107911
108272
  let meta3;
107912
108273
  try {
107913
- meta3 = machineKeyRegistrationSchema.parse(JSON.parse(await readFile38(this.metaPath, "utf8")));
108274
+ meta3 = machineKeyRegistrationSchema.parse(JSON.parse(await readFile39(this.metaPath, "utf8")));
107914
108275
  } catch {
107915
108276
  return null;
107916
108277
  }
@@ -107925,7 +108286,7 @@ var MachineKeyStore = class _MachineKeyStore {
107925
108286
  "-w"
107926
108287
  ],
107927
108288
  timeoutMs: 1e4
107928
- }) : await readFile38(this.pemPathOf(meta3.jwk), "utf8");
108289
+ }) : await readFile39(this.pemPathOf(meta3.jwk), "utf8");
107929
108290
  return keyOf2({ meta: meta3, privateKey: createPrivateKey(pemOf(pem)) });
107930
108291
  }
107931
108292
  async make() {
@@ -107999,7 +108360,7 @@ async function writeOnce({ path, text: text3 }) {
107999
108360
  const temporary = `${path}.${process.pid}.${randomBytes6(6).toString("hex")}.tmp`;
108000
108361
  await writePrivate({ path: temporary, text: text3 });
108001
108362
  try {
108002
- await link(temporary, path);
108363
+ await link2(temporary, path);
108003
108364
  return true;
108004
108365
  } catch (error63) {
108005
108366
  if (error63.code === "EEXIST") return false;
@@ -108067,7 +108428,7 @@ function machineProofFetch({
108067
108428
  // src/services/processes.service.ts
108068
108429
  import { execFile as execFile3, spawn as spawn4, spawnSync } from "node:child_process";
108069
108430
  import { closeSync, mkdirSync, openSync, renameSync, statSync } from "node:fs";
108070
- import { readFile as readFile39, readlink } from "node:fs/promises";
108431
+ import { readFile as readFile40, readlink } from "node:fs/promises";
108071
108432
  import { dirname as dirname28 } from "node:path";
108072
108433
  import { promisify as promisify2 } from "node:util";
108073
108434
  var run3 = promisify2(execFile3);
@@ -108081,14 +108442,14 @@ function alive(pid) {
108081
108442
  }
108082
108443
  }
108083
108444
  async function argsOf2(pid) {
108084
- const raw = await readFile39(`/proc/${pid}/cmdline`, "utf8").catch(() => void 0);
108445
+ const raw = await readFile40(`/proc/${pid}/cmdline`, "utf8").catch(() => void 0);
108085
108446
  if (raw) return raw.split("\0").filter(Boolean);
108086
108447
  const listed = await run3("ps", ["-o", "args=", "-p", String(pid)]).catch(() => void 0);
108087
108448
  const line = listed?.stdout.trim();
108088
108449
  return line ? line.split(/\s+/) : void 0;
108089
108450
  }
108090
108451
  async function parentOf(pid) {
108091
- const stat13 = await readFile39(`/proc/${pid}/stat`, "utf8").catch(() => void 0);
108452
+ const stat13 = await readFile40(`/proc/${pid}/stat`, "utf8").catch(() => void 0);
108092
108453
  const fromStat = stat13 ? Number(stat13.slice(stat13.lastIndexOf(")") + 2).split(" ")[1]) : NaN;
108093
108454
  if (fromStat > 0) return fromStat;
108094
108455
  const listed = await run3("ps", ["-o", "ppid=", "-p", String(pid)]).catch(() => void 0);
@@ -108096,7 +108457,7 @@ async function parentOf(pid) {
108096
108457
  return parent > 0 ? parent : void 0;
108097
108458
  }
108098
108459
  async function startOf(pid) {
108099
- const stat13 = await readFile39(`/proc/${pid}/stat`, "utf8").catch(() => void 0);
108460
+ const stat13 = await readFile40(`/proc/${pid}/stat`, "utf8").catch(() => void 0);
108100
108461
  const ticks = stat13 ? stat13.slice(stat13.lastIndexOf(")") + 2).split(" ")[19] : void 0;
108101
108462
  if (ticks) return ticks;
108102
108463
  const listed = await run3("ps", ["-o", "lstart=", "-p", String(pid)]).catch(() => void 0);
@@ -108240,15 +108601,15 @@ function terminalAsk() {
108240
108601
  };
108241
108602
  }
108242
108603
  function sleep(ms2, signal) {
108243
- return new Promise((resolve27) => {
108244
- if (signal?.aborted) return resolve27();
108604
+ return new Promise((resolve29) => {
108605
+ if (signal?.aborted) return resolve29();
108245
108606
  const stop3 = () => {
108246
108607
  clearTimeout(timer);
108247
- resolve27();
108608
+ resolve29();
108248
108609
  };
108249
108610
  const timer = setTimeout(() => {
108250
108611
  signal?.removeEventListener("abort", stop3);
108251
- resolve27();
108612
+ resolve29();
108252
108613
  }, ms2);
108253
108614
  signal?.addEventListener("abort", stop3, { once: true });
108254
108615
  });