@lazehq/cli 0.1.112 → 0.1.114

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 +797 -360
  2. package/package.json +1 -1
package/dist/laze.mjs CHANGED
@@ -832,11 +832,11 @@ var require_node_gyp_build = __commonJS({
832
832
  var libc = process.env.LIBC || (isAlpine(platform) ? "musl" : "glibc");
833
833
  var armv = process.env.ARM_VERSION || (arch === "arm64" ? "8" : vars.arm_version) || "";
834
834
  var uv = (process.versions.uv || "").split(".")[0];
835
- module.exports = load;
836
- function load(dir) {
837
- return runtimeRequire(load.resolve(dir));
835
+ module.exports = load2;
836
+ function load2(dir) {
837
+ return runtimeRequire(load2.resolve(dir));
838
838
  }
839
- load.resolve = load.path = function(dir) {
839
+ load2.resolve = load2.path = function(dir) {
840
840
  dir = path.resolve(dir || ".");
841
841
  try {
842
842
  var name3 = runtimeRequire(path.join(dir, "package.json")).name.toUpperCase().replace(/-/g, "_");
@@ -976,12 +976,12 @@ var require_node_gyp_build = __commonJS({
976
976
  function isAlpine(platform2) {
977
977
  return platform2 === "linux" && fs.existsSync("/etc/alpine-release");
978
978
  }
979
- load.parseTags = parseTags;
980
- load.matchTags = matchTags;
981
- load.compareTags = compareTags;
982
- load.parseTuple = parseTuple;
983
- load.matchTuple = matchTuple;
984
- load.compareTuples = compareTuples;
979
+ load2.parseTags = parseTags;
980
+ load2.matchTags = matchTags;
981
+ load2.compareTags = compareTags;
982
+ load2.parseTuple = parseTuple;
983
+ load2.matchTuple = matchTuple;
984
+ load2.compareTuples = compareTuples;
985
985
  }
986
986
  });
987
987
 
@@ -7512,14 +7512,14 @@ var require_connect = __commonJS({
7512
7512
  port,
7513
7513
  host: hostname8
7514
7514
  };
7515
- const family = net.isIP(hostname8);
7516
- if (family !== 0 && servername && servername !== hostname8) {
7515
+ const family2 = net.isIP(hostname8);
7516
+ if (family2 !== 0 && servername && servername !== hostname8) {
7517
7517
  connectOptions.host = servername;
7518
7518
  connectOptions.lookup = (_hostname, lookupOptions, cb) => {
7519
7519
  if (lookupOptions.all) {
7520
- cb(null, [{ address: hostname8, family }]);
7520
+ cb(null, [{ address: hostname8, family: family2 }]);
7521
7521
  } else {
7522
- cb(null, hostname8, family);
7522
+ cb(null, hostname8, family2);
7523
7523
  }
7524
7524
  };
7525
7525
  }
@@ -11254,7 +11254,7 @@ var require_client_h1 = __commonJS({
11254
11254
  * @param {number} len
11255
11255
  * @returns {number}
11256
11256
  */
11257
- wasm_on_url: (p, at2, len) => {
11257
+ wasm_on_url: (p, at4, len) => {
11258
11258
  return 0;
11259
11259
  },
11260
11260
  /**
@@ -11263,9 +11263,9 @@ var require_client_h1 = __commonJS({
11263
11263
  * @param {number} len
11264
11264
  * @returns {number}
11265
11265
  */
11266
- wasm_on_status: (p, at2, len) => {
11266
+ wasm_on_status: (p, at4, len) => {
11267
11267
  assert2(currentParser.ptr === p);
11268
- const start2 = at2 - currentBufferPtr + currentBufferRef.byteOffset;
11268
+ const start2 = at4 - currentBufferPtr + currentBufferRef.byteOffset;
11269
11269
  return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start2, len));
11270
11270
  },
11271
11271
  /**
@@ -11282,9 +11282,9 @@ var require_client_h1 = __commonJS({
11282
11282
  * @param {number} len
11283
11283
  * @returns {number}
11284
11284
  */
11285
- wasm_on_header_field: (p, at2, len) => {
11285
+ wasm_on_header_field: (p, at4, len) => {
11286
11286
  assert2(currentParser.ptr === p);
11287
- const start2 = at2 - currentBufferPtr + currentBufferRef.byteOffset;
11287
+ const start2 = at4 - currentBufferPtr + currentBufferRef.byteOffset;
11288
11288
  return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start2, len));
11289
11289
  },
11290
11290
  /**
@@ -11293,9 +11293,9 @@ var require_client_h1 = __commonJS({
11293
11293
  * @param {number} len
11294
11294
  * @returns {number}
11295
11295
  */
11296
- wasm_on_header_value: (p, at2, len) => {
11296
+ wasm_on_header_value: (p, at4, len) => {
11297
11297
  assert2(currentParser.ptr === p);
11298
- const start2 = at2 - currentBufferPtr + currentBufferRef.byteOffset;
11298
+ const start2 = at4 - currentBufferPtr + currentBufferRef.byteOffset;
11299
11299
  return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start2, len));
11300
11300
  },
11301
11301
  /**
@@ -11315,9 +11315,9 @@ var require_client_h1 = __commonJS({
11315
11315
  * @param {number} len
11316
11316
  * @returns {number}
11317
11317
  */
11318
- wasm_on_body: (p, at2, len) => {
11318
+ wasm_on_body: (p, at4, len) => {
11319
11319
  assert2(currentParser.ptr === p);
11320
- const start2 = at2 - currentBufferPtr + currentBufferRef.byteOffset;
11320
+ const start2 = at4 - currentBufferPtr + currentBufferRef.byteOffset;
11321
11321
  return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start2, len));
11322
11322
  },
11323
11323
  /**
@@ -20885,7 +20885,7 @@ var require_dns = __commonJS({
20885
20885
  #defaultPick(origin, hostnameRecords, affinity) {
20886
20886
  let ip2 = null;
20887
20887
  const { records, offset } = hostnameRecords;
20888
- let family;
20888
+ let family2;
20889
20889
  if (this.dualStack) {
20890
20890
  if (affinity == null) {
20891
20891
  if (offset == null || offset === maxInt) {
@@ -20897,28 +20897,28 @@ var require_dns = __commonJS({
20897
20897
  }
20898
20898
  }
20899
20899
  if (records[affinity] != null && records[affinity].ips.length > 0) {
20900
- family = records[affinity];
20900
+ family2 = records[affinity];
20901
20901
  } else {
20902
- family = records[affinity === 4 ? 6 : 4];
20902
+ family2 = records[affinity === 4 ? 6 : 4];
20903
20903
  }
20904
20904
  } else {
20905
- family = records[affinity];
20905
+ family2 = records[affinity];
20906
20906
  }
20907
- if (family == null || family.ips.length === 0) {
20907
+ if (family2 == null || family2.ips.length === 0) {
20908
20908
  return ip2;
20909
20909
  }
20910
- if (family.offset == null || family.offset === maxInt) {
20911
- family.offset = 0;
20910
+ if (family2.offset == null || family2.offset === maxInt) {
20911
+ family2.offset = 0;
20912
20912
  } else {
20913
- family.offset++;
20913
+ family2.offset++;
20914
20914
  }
20915
- const position = family.offset % family.ips.length;
20916
- ip2 = family.ips[position] ?? null;
20915
+ const position = family2.offset % family2.ips.length;
20916
+ ip2 = family2.ips[position] ?? null;
20917
20917
  if (ip2 == null) {
20918
20918
  return ip2;
20919
20919
  }
20920
20920
  if (Date.now() - ip2.timestamp > ip2.ttl) {
20921
- family.ips.splice(position, 1);
20921
+ family2.ips.splice(position, 1);
20922
20922
  return this.pick(origin, hostnameRecords, affinity);
20923
20923
  }
20924
20924
  return ip2;
@@ -20928,22 +20928,22 @@ var require_dns = __commonJS({
20928
20928
  if (!records) {
20929
20929
  return null;
20930
20930
  }
20931
- const family = records[ipFamily];
20932
- if (!family) {
20931
+ const family2 = records[ipFamily];
20932
+ if (!family2) {
20933
20933
  return null;
20934
20934
  }
20935
- if (family.offset == null || family.offset === maxInt) {
20936
- family.offset = 0;
20935
+ if (family2.offset == null || family2.offset === maxInt) {
20936
+ family2.offset = 0;
20937
20937
  } else {
20938
- family.offset++;
20938
+ family2.offset++;
20939
20939
  }
20940
- const position = family.offset % family.ips.length;
20941
- const ip2 = family.ips[position] ?? null;
20940
+ const position = family2.offset % family2.ips.length;
20941
+ const ip2 = family2.ips[position] ?? null;
20942
20942
  if (ip2 == null) {
20943
20943
  return ip2;
20944
20944
  }
20945
20945
  if (Date.now() - ip2.timestamp > ip2.ttl) {
20946
- family.ips.splice(position, 1);
20946
+ family2.ips.splice(position, 1);
20947
20947
  }
20948
20948
  return ip2;
20949
20949
  }
@@ -31077,15 +31077,15 @@ ${value}`;
31077
31077
  pos = 0;
31078
31078
  }
31079
31079
  }
31080
- discardLeadingBytes(count8) {
31081
- while (count8 > 0 && this.lineChunkIndex < this.chunks.length) {
31080
+ discardLeadingBytes(count10) {
31081
+ while (count10 > 0 && this.lineChunkIndex < this.chunks.length) {
31082
31082
  const chunk = this.chunks[this.lineChunkIndex];
31083
31083
  const remaining = chunk.length - this.linePos;
31084
- if (count8 < remaining) {
31085
- this.linePos += count8;
31086
- count8 = 0;
31084
+ if (count10 < remaining) {
31085
+ this.linePos += count10;
31086
+ count10 = 0;
31087
31087
  } else {
31088
- count8 -= remaining;
31088
+ count10 -= remaining;
31089
31089
  this.lineChunkIndex++;
31090
31090
  this.linePos = 0;
31091
31091
  }
@@ -31723,15 +31723,15 @@ function pairsIn({
31723
31723
  end,
31724
31724
  out
31725
31725
  }) {
31726
- let at2 = start2;
31727
- while (at2 < end) {
31728
- const next = text3.indexOf("&", at2);
31726
+ let at4 = start2;
31727
+ while (at4 < end) {
31728
+ const next = text3.indexOf("&", at4);
31729
31729
  const stop3 = next === -1 || next > end ? end : next;
31730
- const pair = text3.slice(at2, stop3);
31730
+ const pair = text3.slice(at4, stop3);
31731
31731
  const equals = pair.indexOf("=");
31732
- if (equals === -1) out.push({ start: at2, end: stop3, name: "" });
31733
- else out.push({ start: at2 + equals + 1, end: stop3, name: pair.slice(0, equals) });
31734
- at2 = stop3 + 1;
31732
+ if (equals === -1) out.push({ start: at4, end: stop3, name: "" });
31733
+ else out.push({ start: at4 + equals + 1, end: stop3, name: pair.slice(0, equals) });
31734
+ at4 = stop3 + 1;
31735
31735
  }
31736
31736
  }
31737
31737
  function segmentsIn({
@@ -31789,8 +31789,8 @@ function isRecordIdValue(value) {
31789
31789
  const prefix = RECORD_ID.exec(value)?.[1];
31790
31790
  return prefix !== void 0 && !CREDENTIAL_ID_PREFIXES.has(prefix);
31791
31791
  }
31792
- function isPlainRecordId({ text: text3, at: at2 }) {
31793
- return !isSecretParameterName(at2.name) && isRecordIdValue(text3.slice(at2.start, at2.end));
31792
+ function isPlainRecordId({ text: text3, at: at4 }) {
31793
+ return !isSecretParameterName(at4.name) && isRecordIdValue(text3.slice(at4.start, at4.end));
31794
31794
  }
31795
31795
  function isSecretParameterValue(value) {
31796
31796
  if (value.length < 8) return false;
@@ -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 count8 of counts.values()) {
31838
- const p = count8 / sample.length;
31837
+ for (const count10 of counts.values()) {
31838
+ const p = count10 / sample.length;
31839
31839
  entropy -= p * Math.log2(p);
31840
31840
  }
31841
31841
  return entropy;
@@ -32086,8 +32086,8 @@ var SECRET_RULE_IDS = [
32086
32086
  URL_PARAMETER_RULE_ID
32087
32087
  ];
32088
32088
  function keptLengthAtBoundary(match) {
32089
- const at2 = match.search(/["'`]/);
32090
- return at2 === -1 ? match.length : at2;
32089
+ const at4 = match.search(/["'`]/);
32090
+ return at4 === -1 ? match.length : at4;
32091
32091
  }
32092
32092
  function valueSpan(rule, match) {
32093
32093
  const fullStart = match.index ?? 0;
@@ -32396,41 +32396,41 @@ var FILE_EXTENSION = /^\.[A-Za-z][A-Za-z0-9]{0,7}$/;
32396
32396
  function isPathShapeMatch({
32397
32397
  text: text3,
32398
32398
  match,
32399
- at: at2
32399
+ at: at4
32400
32400
  }) {
32401
- if (match.end > at2.end) {
32401
+ if (match.end > at4.end) {
32402
32402
  const rule = RULES.find((candidate) => candidate.id === match.ruleId);
32403
- return !rule || rawMatches(rule, text3.slice(at2.start, at2.end)).length === 0;
32403
+ return !rule || rawMatches(rule, text3.slice(at4.start, at4.end)).length === 0;
32404
32404
  }
32405
- return FILE_EXTENSION.test(text3.slice(match.end, at2.end));
32405
+ return FILE_EXTENSION.test(text3.slice(match.end, at4.end));
32406
32406
  }
32407
32407
  function placedInLink({
32408
32408
  text: text3,
32409
32409
  match,
32410
32410
  urlValues
32411
32411
  }) {
32412
- const at2 = urlValueAt({ values: urlValues, offset: match.start });
32413
- if (!at2) return [match];
32412
+ const at4 = urlValueAt({ values: urlValues, offset: match.start });
32413
+ if (!at4) return [match];
32414
32414
  const shape = SHAPE_RULE_IDS.has(match.ruleId);
32415
- if (shape && isPlainRecordId({ text: text3, at: at2 })) return [];
32416
- if (shape && !isSecretParameterName(at2.name) && isPathShapeMatch({ text: text3, match, at: at2 })) return [];
32417
- const secretName = isSecretParameterName(at2.name);
32418
- const named = secretName && shape ? { parameter: at2.name } : {};
32415
+ if (shape && isPlainRecordId({ text: text3, at: at4 })) return [];
32416
+ if (shape && !isSecretParameterName(at4.name) && isPathShapeMatch({ text: text3, match, at: at4 })) return [];
32417
+ const secretName = isSecretParameterName(at4.name);
32418
+ const named = secretName && shape ? { parameter: at4.name } : {};
32419
32419
  return [
32420
- { ...match, ...named, spanStart: at2.start, start: at2.start, end: at2.end, spanEnd: at2.end }
32420
+ { ...match, ...named, spanStart: at4.start, start: at4.start, end: at4.end, spanEnd: at4.end }
32421
32421
  ];
32422
32422
  }
32423
32423
  function secretParameterValues({
32424
32424
  text: text3,
32425
32425
  urlValues
32426
32426
  }) {
32427
- return urlValues.filter((at2) => isSecretParameterName(at2.name)).filter((at2) => isSecretParameterValue(text3.slice(at2.start, at2.end))).map((at2) => ({
32427
+ return urlValues.filter((at4) => isSecretParameterName(at4.name)).filter((at4) => isSecretParameterValue(text3.slice(at4.start, at4.end))).map((at4) => ({
32428
32428
  ruleId: URL_PARAMETER_RULE_ID,
32429
- spanStart: at2.start,
32430
- start: at2.start,
32431
- end: at2.end,
32432
- spanEnd: at2.end,
32433
- parameter: at2.name
32429
+ spanStart: at4.start,
32430
+ start: at4.start,
32431
+ end: at4.end,
32432
+ spanEnd: at4.end,
32433
+ parameter: at4.name
32434
32434
  }));
32435
32435
  }
32436
32436
  function withExtension({ text: text3, match }) {
@@ -32653,17 +32653,17 @@ function createRedactor({ values }) {
32653
32653
  let carry = "";
32654
32654
  const scan = (text3, limit) => {
32655
32655
  let out = "";
32656
- let at2 = 0;
32656
+ let at4 = 0;
32657
32657
  pattern.lastIndex = 0;
32658
32658
  for (const match of text3.matchAll(pattern)) {
32659
32659
  if (match.index >= limit) break;
32660
- if (match.index < at2) continue;
32661
- out += text3.slice(at2, match.index) + REDACTED;
32662
- at2 = match.index + match[0].length;
32660
+ if (match.index < at4) continue;
32661
+ out += text3.slice(at4, match.index) + REDACTED;
32662
+ at4 = match.index + match[0].length;
32663
32663
  }
32664
- const emitUntil = Math.max(at2, limit);
32664
+ const emitUntil = Math.max(at4, limit);
32665
32665
  carry = text3.slice(emitUntil);
32666
- return out + text3.slice(at2, emitUntil);
32666
+ return out + text3.slice(at4, emitUntil);
32667
32667
  };
32668
32668
  return {
32669
32669
  push(chunk) {
@@ -36522,14 +36522,14 @@ var registry = /* @__PURE__ */ new Map();
36522
36522
  function defineMessages({
36523
36523
  namespace,
36524
36524
  en: en2,
36525
- load
36525
+ load: load2
36526
36526
  }) {
36527
36527
  const messages = {
36528
36528
  namespace,
36529
36529
  en: en2,
36530
36530
  load: async (locale) => {
36531
36531
  if (locale === DEFAULT_LOCALE) return {};
36532
- const loaded = await load(locale).catch(() => ({}));
36532
+ const loaded = await load2(locale).catch(() => ({}));
36533
36533
  return translationsOf(loaded);
36534
36534
  }
36535
36535
  };
@@ -36960,7 +36960,7 @@ function shadowedLinkLineOf({ shadow }) {
36960
36960
  }
36961
36961
 
36962
36962
  // src/rules/cli-version.rules.ts
36963
- var STAMPED = "0.1.112";
36963
+ var STAMPED = "0.1.114";
36964
36964
  function cliVersionOf({ stamped = STAMPED } = {}) {
36965
36965
  return stamped.startsWith("__") ? "dev" : stamped;
36966
36966
  }
@@ -38725,14 +38725,14 @@ function codePointLength(str) {
38725
38725
  const units = str.length;
38726
38726
  if (!highSurrogate.test(str))
38727
38727
  return units;
38728
- let count8 = units;
38728
+ let count10 = units;
38729
38729
  for (let i = 0; i < units - 1; i++) {
38730
38730
  if ((str.charCodeAt(i) & 64512) === 55296 && (str.charCodeAt(i + 1) & 64512) === 56320) {
38731
- count8--;
38731
+ count10--;
38732
38732
  i++;
38733
38733
  }
38734
38734
  }
38735
- return count8;
38735
+ return count10;
38736
38736
  }
38737
38737
  function getLengthableOrigin(input2) {
38738
38738
  if (Array.isArray(input2))
@@ -43087,8 +43087,8 @@ function az_default() {
43087
43087
  }
43088
43088
 
43089
43089
  // ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/be.js
43090
- function getBelarusianPlural(count8, one, few, many) {
43091
- const absCount = Math.abs(count8);
43090
+ function getBelarusianPlural(count10, one, few, many) {
43091
+ const absCount = Math.abs(count10);
43092
43092
  const lastDigit = absCount % 10;
43093
43093
  const lastTwoDigits = absCount % 100;
43094
43094
  if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
@@ -45735,8 +45735,8 @@ function hu_default() {
45735
45735
  }
45736
45736
 
45737
45737
  // ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hy.js
45738
- function getArmenianPlural(count8, one, many) {
45739
- return Math.abs(count8) === 1 ? one : many;
45738
+ function getArmenianPlural(count10, one, many) {
45739
+ return Math.abs(count10) === 1 ? one : many;
45740
45740
  }
45741
45741
  function withDefiniteArticle(word3) {
45742
45742
  if (!word3)
@@ -48474,8 +48474,8 @@ function ro_default() {
48474
48474
  }
48475
48475
 
48476
48476
  // ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ru.js
48477
- function getRussianPlural(count8, one, few, many) {
48478
- const absCount = Math.abs(count8);
48477
+ function getRussianPlural(count10, one, few, many) {
48478
+ const absCount = Math.abs(count10);
48479
48479
  const lastDigit = absCount % 10;
48480
48480
  const lastTwoDigits = absCount % 100;
48481
48481
  if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
@@ -61812,15 +61812,15 @@ function clustersIn({
61812
61812
  const out = [];
61813
61813
  let current3 = null;
61814
61814
  for (let index = segment.start; index <= segment.end; index += 1) {
61815
- const count8 = flagged[index] ?? 0;
61816
- if (count8 === 0) continue;
61815
+ const count10 = flagged[index] ?? 0;
61816
+ if (count10 === 0) continue;
61817
61817
  if (current3 && index - current3.end - 1 <= REDACTED_BLOCK_MAX_GAP) {
61818
61818
  current3.end = index;
61819
- current3.values += count8;
61819
+ current3.values += count10;
61820
61820
  continue;
61821
61821
  }
61822
61822
  if (current3) out.push(current3);
61823
- current3 = { start: index, end: index, values: count8 };
61823
+ current3 = { start: index, end: index, values: count10 };
61824
61824
  }
61825
61825
  if (current3) out.push(current3);
61826
61826
  return out;
@@ -61847,10 +61847,10 @@ function redactedBlocksAt({
61847
61847
  }) {
61848
61848
  const lines2 = text3.split("\n");
61849
61849
  const starts = [];
61850
- let at2 = 0;
61850
+ let at4 = 0;
61851
61851
  for (const line of lines2) {
61852
- starts.push(at2);
61853
- at2 += line.length + 1;
61852
+ starts.push(at4);
61853
+ at4 += line.length + 1;
61854
61854
  }
61855
61855
  const lineAt = (offset) => starts.findLastIndex((start2) => start2 <= offset);
61856
61856
  const flagged = lines2.map(() => 0);
@@ -61860,7 +61860,7 @@ function redactedBlocksAt({
61860
61860
  }
61861
61861
  const blocks = redactedBlocks({ lines: lines2, flagged });
61862
61862
  const inside = (line) => blocks.some((block2) => line >= block2.start && line <= block2.end);
61863
- const values = flagged.reduce((sum, count8, line) => inside(line) ? sum + count8 : sum, 0);
61863
+ const values = flagged.reduce((sum, count10, line) => inside(line) ? sum + count10 : sum, 0);
61864
61864
  return { values, insideAt: (offset) => inside(lineAt(offset)) };
61865
61865
  }
61866
61866
 
@@ -62338,6 +62338,39 @@ var vaultJudgeMeasureSchemaDefinition = external_exports.object({
62338
62338
  });
62339
62339
  var vaultJudgeMeasureSchema = vaultJudgeMeasureSchemaDefinition;
62340
62340
 
62341
+ // ../../modules/vault/contract/src/vault-ops-asks.ts
62342
+ var count3 = external_exports.number().int().nonnegative();
62343
+ var idText2 = external_exports.string().max(128);
62344
+ var codeText = external_exports.string().regex(/^[a-z][a-z0-9_.]{0,39}$/);
62345
+ var vaultOpsAskSchemaDefinition = external_exports.object({
62346
+ requestId: idText2,
62347
+ agentId: idText2,
62348
+ agentKind: vaultAgentKindSchema,
62349
+ channelId: idText2,
62350
+ connectionId: idText2.nullable(),
62351
+ action: codeText,
62352
+ whyCode: codeText,
62353
+ /** `withdrawn`: the asking turn ended first; `expired`: nobody answered in time. */
62354
+ state: external_exports.enum([...vaultApprovalStateSchema.options, "withdrawn"]),
62355
+ createdAt: external_exports.iso.datetime(),
62356
+ expiresAt: external_exports.iso.datetime(),
62357
+ answeredAt: external_exports.iso.datetime().nullable(),
62358
+ answeredVia: vaultAnswerViaSchema.nullable(),
62359
+ /** Who settled it: a person, the timeout, the turn ending, or another card's lease. */
62360
+ decider: external_exports.enum(["human", "timeout", "turn_ended", "lease"]).nullable(),
62361
+ joinCount: count3,
62362
+ turnId: idText2.nullable(),
62363
+ batchId: idText2.nullable(),
62364
+ /** The join key's first 8 hex: equal prefixes are asks that would join one card. */
62365
+ joinKeyPrefix: external_exports.string().regex(/^[0-9a-f]{0,8}$/),
62366
+ noteDeliveredAt: external_exports.iso.datetime().nullable(),
62367
+ consumedAt: external_exports.iso.datetime().nullable(),
62368
+ /** `sealed`: the value goes only to the asking run, encrypted to its key. */
62369
+ delivery: external_exports.enum(["sealed", "plain"])
62370
+ });
62371
+ var vaultOpsAskSchema = vaultOpsAskSchemaDefinition;
62372
+ var vaultOpsAsksSchemaDefinition = external_exports.object({ rows: external_exports.array(vaultOpsAskSchema), total: count3 });
62373
+
62341
62374
  // ../../modules/chat/contract/src/chat.close.ts
62342
62375
  var conversationOpenDaysSchemaDefinition = external_exports.union([external_exports.literal(7), external_exports.literal(14), external_exports.literal(30), external_exports.literal(90)]).nullable();
62343
62376
  var conversationOpenDaysSchema = conversationOpenDaysSchemaDefinition;
@@ -62594,13 +62627,23 @@ var layoutFileSchemaDefinition = external_exports.object({
62594
62627
  path: external_exports.string().max(600).regex(/^\/api\/[^\s]*$/),
62595
62628
  image: external_exports.boolean()
62596
62629
  });
62630
+ var QUOTED_FILE_KINDS = [
62631
+ "photo",
62632
+ "video",
62633
+ "voice",
62634
+ "audio",
62635
+ "document",
62636
+ "sticker"
62637
+ ];
62597
62638
  var layoutQuotedSchemaDefinition = external_exports.object({
62598
62639
  originKey: external_exports.string().min(1).max(200),
62599
62640
  channelId: external_exports.string().min(1).max(100).nullable(),
62600
62641
  seq: external_exports.number().int().positive().nullable(),
62601
62642
  imageId: external_exports.string().min(1).max(100).nullable(),
62602
62643
  /** The Laze person who wrote the original, such as a mirror's owner: their picture shows. */
62603
- by: external_exports.object({ kind: external_exports.literal("person"), id: external_exports.string().min(1).max(100) }).optional()
62644
+ by: external_exports.object({ kind: external_exports.literal("person"), id: external_exports.string().min(1).max(100) }).optional(),
62645
+ /** The original's first file, labelled when the quote has no text; its picture is `imageId`. */
62646
+ file: external_exports.enum(QUOTED_FILE_KINDS).optional().catch(void 0)
62604
62647
  });
62605
62648
  var layoutAttachmentSchemaDefinition = external_exports.object({
62606
62649
  type: external_exports.literal("attachment"),
@@ -62965,6 +63008,19 @@ var mirrorDeliveryStateSchema = external_exports.enum([
62965
63008
  "edit_kept",
62966
63009
  "reaction_kept"
62967
63010
  ]);
63011
+ var MIRROR_DELIVERY_REASONS = [
63012
+ "offline",
63013
+ "not_linked",
63014
+ "unconfirmed",
63015
+ "chat_unknown",
63016
+ "file_unavailable",
63017
+ "file_too_large",
63018
+ "too_many_files",
63019
+ "secret",
63020
+ "late",
63021
+ "rejected"
63022
+ ];
63023
+ var mirrorDeliveryReasonSchema = external_exports.enum(MIRROR_DELIVERY_REASONS);
62968
63024
  var messageOriginSchemaDefinition = external_exports.object({
62969
63025
  source: mirrorSourceSchema,
62970
63026
  /** The message's key at the source, unique in the workspace (e.g. `slack:T1:C1:1792.0001`). */
@@ -63448,6 +63504,8 @@ var messageSchemaDefinition = external_exports.object({
63448
63504
  mirrorReactionKept: external_exports.boolean().optional(),
63449
63505
  /** Set beside a waiting delivery while the computer that sends it is waking up. */
63450
63506
  mirrorDeliveryWaking: external_exports.boolean().optional(),
63507
+ /** Beside a failed delivery: why it was not sent; an unknown reason reads as none. */
63508
+ mirrorDeliveryReason: mirrorDeliveryReasonSchema.optional().catch(void 0),
63451
63509
  /** A thread reply also sent to its conversation: it shows in the thread and the channel. */
63452
63510
  alsoInChannel: external_exports.boolean().optional(),
63453
63511
  /** A Laze DM message also posted to its paired Slack DM, the id of that conversation. */
@@ -63826,6 +63884,11 @@ var agentChatMemberInputSchemaDefinition = external_exports.object({
63826
63884
  ownerUserId: idSchema4,
63827
63885
  userId: idSchema4
63828
63886
  });
63887
+ var agentChatGuestInputSchemaDefinition = external_exports.object({
63888
+ ...openAgentDirectInputSchemaDefinition.omit({ watcherUserIds: true, openerName: true }).shape,
63889
+ ownerUserId: idSchema4,
63890
+ guest: openAgentDirectInputSchemaDefinition.shape.agent
63891
+ });
63829
63892
  var handAgentChatInputSchemaDefinition = external_exports.object({
63830
63893
  workspaceId: workspaceIdSchema,
63831
63894
  agent: openAgentDirectInputSchemaDefinition.shape.agent,
@@ -64014,7 +64077,9 @@ var pinMirroredInputSchemaDefinition = external_exports.object({
64014
64077
  var setMirrorDeliveryInputSchemaDefinition = external_exports.object({
64015
64078
  workspaceId: workspaceIdSchema,
64016
64079
  messageId: idSchema4,
64017
- state: mirrorDeliveryStateSchema.nullable()
64080
+ state: mirrorDeliveryStateSchema.nullable(),
64081
+ /** Beside `failed`: why it was not sent. */
64082
+ reason: mirrorDeliveryReasonSchema.optional()
64018
64083
  });
64019
64084
  var reactMirroredInputSchemaDefinition = external_exports.object({
64020
64085
  workspaceId: workspaceIdSchema,
@@ -64351,7 +64416,11 @@ var followThreadInputSchemaDefinition = external_exports.object({
64351
64416
  following: external_exports.boolean()
64352
64417
  });
64353
64418
  var followThreadInputSchema = followThreadInputSchemaDefinition;
64354
- var threadFollowSchemaDefinition = external_exports.object({ following: external_exports.boolean() });
64419
+ var threadFollowSchemaDefinition = external_exports.object({
64420
+ following: external_exports.boolean(),
64421
+ /** When the reader last read the thread; null when never, absent from older servers. */
64422
+ readAt: external_exports.iso.datetime().nullable().optional()
64423
+ });
64355
64424
  var threadFollowSchema = threadFollowSchemaDefinition;
64356
64425
  var followedThreadSchemaDefinition = external_exports.object({
64357
64426
  root: messageSchemaDefinition,
@@ -65431,7 +65500,11 @@ var heldPhonePushShape = {
65431
65500
  /** A message alert's sender, so a held alert still shows their picture. */
65432
65501
  sender: apnsSenderSchema.optional(),
65433
65502
  /** The sender's name sealed; sealed mode leaves `sender.name` empty. */
65434
- senderNameSealed: sealedNameSchema.optional()
65503
+ senderNameSealed: sealedNameSchema.optional(),
65504
+ /** When the push was first held; a hold carried on while the person stays active keeps it. */
65505
+ firstHeldAt: external_exports.iso.datetime().optional(),
65506
+ /** How many times the hold was carried on because the person was still active. */
65507
+ round: external_exports.number().int().min(1).optional()
65435
65508
  };
65436
65509
  var phonePushHeldPayloadSchemaDefinition = external_exports.object({
65437
65510
  workspaceId: external_exports.string().min(1),
@@ -65936,6 +66009,8 @@ var observeEditInputSchemaDefinition = external_exports.object({
65936
66009
  layout: messageLayoutSchema.nullable().optional(),
65937
66010
  rerendered: external_exports.boolean().default(false),
65938
66011
  renderHash: external_exports.string().max(200).nullable().default(null),
66012
+ /** The source's order of this render within `version`: a later one with a new look lands. */
66013
+ renderOrder: external_exports.number().int().min(0).optional(),
65939
66014
  /** The source says the message was never edited: an edited mark Laze gave it comes off. */
65940
66015
  neverEdited: external_exports.boolean().default(false),
65941
66016
  fileIds: external_exports.array(external_exports.string().min(1).max(64)).max(10).default([])
@@ -68395,7 +68470,9 @@ var mcpServerViewSchemaDefinition = external_exports.object({
68395
68470
  external_exports.object({ ...mcpToolSchemaDefinition.shape, sensitivity: vaultSensitivitySchema.nullable() })
68396
68471
  ),
68397
68472
  refreshedAt: external_exports.iso.datetime(),
68398
- lastError: external_exports.string().nullable()
68473
+ lastError: external_exports.string().nullable(),
68474
+ /** The server site's own favicon through the logo route; none for a relayed server. */
68475
+ logoUrl: external_exports.string().nullable().optional()
68399
68476
  });
68400
68477
  var mcpServerViewSchema = mcpServerViewSchemaDefinition;
68401
68478
  var addedMcpServerSchemaDefinition = external_exports.discriminatedUnion("outcome", [
@@ -69321,10 +69398,71 @@ var agentLimitsClearedPayloadSchemaDefinition = external_exports.object({
69321
69398
  at: external_exports.iso.datetime()
69322
69399
  });
69323
69400
 
69401
+ // ../../modules/agent/contract/src/sign-in-attempts.ts
69402
+ var signInAttemptStepSchema = external_exports.enum([
69403
+ "started",
69404
+ "code_submitted",
69405
+ "accepted",
69406
+ "saved",
69407
+ "refused",
69408
+ "ended_without_code"
69409
+ ]);
69410
+ var signInAttemptReasonSchemaDefinition = external_exports.union([
69411
+ external_exports.enum([
69412
+ "code_refused",
69413
+ "code_expired",
69414
+ "invalid_request",
69415
+ "verifier_mismatch",
69416
+ "not_eligible",
69417
+ "rate_limited",
69418
+ "not_this_sign_in",
69419
+ "unreachable",
69420
+ "unavailable",
69421
+ "expired",
69422
+ "denied",
69423
+ "not_signed_in"
69424
+ ]),
69425
+ external_exports.string().regex(/^unknown_\d{1,3}$/)
69426
+ ]);
69427
+ var signInAttemptReasonSchema = signInAttemptReasonSchemaDefinition;
69428
+ var providerErrorSchema = external_exports.string().regex(/^(?:[a-z_]{1,40})$/);
69429
+ var signInAttemptSourceSchema = external_exports.enum(["computer", "server"]);
69430
+ var signInAttemptIdSchema = external_exports.string().regex(/^[A-Za-z0-9_-]{8,40}$/);
69431
+ var harnessSchema2 = external_exports.enum(["claude-code", "codex"]);
69432
+ var signInAttemptFactDefinition = external_exports.object({
69433
+ workspaceId: external_exports.string().min(1),
69434
+ userId: external_exports.string().min(1),
69435
+ harness: harnessSchema2,
69436
+ source: signInAttemptSourceSchema,
69437
+ attemptId: signInAttemptIdSchema,
69438
+ step: signInAttemptStepSchema,
69439
+ reason: signInAttemptReasonSchema.nullable(),
69440
+ providerError: providerErrorSchema.nullable()
69441
+ });
69442
+ var lastSignInTryDefinition = external_exports.discriminatedUnion("outcome", [
69443
+ external_exports.object({
69444
+ outcome: external_exports.literal("refused"),
69445
+ at: external_exports.iso.datetime(),
69446
+ reason: signInAttemptReasonSchema
69447
+ }),
69448
+ external_exports.object({ outcome: external_exports.literal("none") })
69449
+ ]);
69450
+ var signInAttemptViewSchemaDefinition = external_exports.object({
69451
+ attemptId: signInAttemptIdSchema,
69452
+ userId: external_exports.string(),
69453
+ harness: harnessSchema2,
69454
+ source: signInAttemptSourceSchema,
69455
+ step: signInAttemptStepSchema,
69456
+ reason: signInAttemptReasonSchema.nullable(),
69457
+ providerError: providerErrorSchema.nullable(),
69458
+ at: external_exports.iso.datetime()
69459
+ });
69460
+ var signInAttemptViewSchema = signInAttemptViewSchemaDefinition;
69461
+
69324
69462
  // ../../modules/agent/contract/src/agent-logins.ts
69325
69463
  var workspaceIdSchema9 = external_exports.string().min(1);
69326
69464
  var idSchema12 = external_exports.string().min(1).max(80);
69327
- var harnessSchema2 = external_exports.enum(["claude-code", "codex"]);
69465
+ var harnessSchema3 = external_exports.enum(["claude-code", "codex"]);
69328
69466
  var loginNameSchema = external_exports.string().max(200);
69329
69467
  var secretSchema = external_exports.string().max(2e4);
69330
69468
  var harnessSignInValueSchemaDefinition = external_exports.object({
@@ -69340,7 +69478,7 @@ var loginValueShape = {
69340
69478
  var harnessLoginEntrySchemaDefinition = external_exports.object({
69341
69479
  /** The vault connection id. */
69342
69480
  id: idSchema12,
69343
- harness: harnessSchema2,
69481
+ harness: harnessSchema3,
69344
69482
  name: external_exports.string(),
69345
69483
  /** `invalid` once its provider refused the token; `out_of_usage` until `limitedUntil`. */
69346
69484
  state: external_exports.enum(["ready", "out_of_usage", "invalid"]),
@@ -69364,7 +69502,7 @@ var harnessLoginListSchemaDefinition = external_exports.object({
69364
69502
  var harnessLoginListSchema = harnessLoginListSchemaDefinition;
69365
69503
  var addHarnessLoginInputSchemaDefinition = external_exports.object({
69366
69504
  workspaceId: workspaceIdSchema9,
69367
- harness: harnessSchema2,
69505
+ harness: harnessSchema3,
69368
69506
  name: loginNameSchema,
69369
69507
  ...loginValueShape
69370
69508
  });
@@ -69408,11 +69546,11 @@ var loginPoolSchemaDefinition = external_exports.object({
69408
69546
  groups: external_exports.array(external_exports.object({ id: idSchema12, name: external_exports.string() })).optional(),
69409
69547
  agents: external_exports.array(external_exports.object({ id: idSchema12, name: external_exports.string(), harness: external_exports.string() })),
69410
69548
  /** What its agents on Default run per harness; a harness left out has none set. */
69411
- defaultModels: external_exports.array(external_exports.object({ harness: harnessSchema2, model: external_exports.string(), name: external_exports.string() })).default([]),
69549
+ defaultModels: external_exports.array(external_exports.object({ harness: harnessSchema3, model: external_exports.string(), name: external_exports.string() })).default([]),
69412
69550
  /** The models the workspace's agents listed per harness, for the default model picker. */
69413
69551
  modelOptions: external_exports.array(
69414
69552
  external_exports.object({
69415
- harness: harnessSchema2,
69553
+ harness: harnessSchema3,
69416
69554
  models: external_exports.array(external_exports.object({ id: external_exports.string(), name: external_exports.string() }))
69417
69555
  })
69418
69556
  ).default([]),
@@ -69420,7 +69558,7 @@ var loginPoolSchemaDefinition = external_exports.object({
69420
69558
  external_exports.object({
69421
69559
  id: idSchema12,
69422
69560
  name: external_exports.string(),
69423
- harness: harnessSchema2,
69561
+ harness: harnessSchema3,
69424
69562
  contributedByUserId: idSchema12,
69425
69563
  contributedByName: external_exports.string(),
69426
69564
  /** Whether an agent runs on it now. */
@@ -69456,7 +69594,7 @@ var loginPoolRefInputSchema = loginPoolRefInputSchemaDefinition;
69456
69594
  var addPoolLoginInputSchemaDefinition = external_exports.object({
69457
69595
  workspaceId: workspaceIdSchema9,
69458
69596
  poolId: external_exports.string().min(1).max(200),
69459
- harness: harnessSchema2,
69597
+ harness: harnessSchema3,
69460
69598
  name: loginNameSchema,
69461
69599
  ...loginValueShape
69462
69600
  });
@@ -69497,7 +69635,7 @@ var setLoginPoolModelInputSchemaDefinition = external_exports.object({
69497
69635
  workspaceId: workspaceIdSchema9,
69498
69636
  /** The pool's id or, from the CLI, its name. */
69499
69637
  poolId: external_exports.string().min(1).max(200),
69500
- harness: harnessSchema2,
69638
+ harness: harnessSchema3,
69501
69639
  model: external_exports.string().trim().min(1).max(200).nullable()
69502
69640
  });
69503
69641
  var setLoginPoolModelInputSchema = setLoginPoolModelInputSchemaDefinition;
@@ -69594,11 +69732,11 @@ var checkLoginUsageAsCallerInputSchema = checkLoginUsageInputSchemaDefinition.om
69594
69732
  });
69595
69733
  var startHarnessSignInInputSchemaDefinition = external_exports.object({
69596
69734
  workspaceId: workspaceIdSchema9,
69597
- harness: harnessSchema2
69735
+ harness: harnessSchema3
69598
69736
  });
69599
69737
  var startHarnessSignInInputSchema = startHarnessSignInInputSchemaDefinition;
69600
69738
  var harnessSignInSchemaDefinition = external_exports.object({
69601
- harness: harnessSchema2,
69739
+ harness: harnessSchema3,
69602
69740
  flow: external_exports.string(),
69603
69741
  url: external_exports.url(),
69604
69742
  userCode: external_exports.string().nullable(),
@@ -69621,14 +69759,14 @@ var isoSchema = external_exports.iso.datetime();
69621
69759
  var loginStatesSchemaDefinition = external_exports.object({
69622
69760
  /** Logins signed in on a person's own Laze computer; Laze holds only the fact. */
69623
69761
  computerLogins: external_exports.array(
69624
- external_exports.object({ userId: external_exports.string(), harness: harnessSchema2, savedAt: isoSchema })
69762
+ external_exports.object({ userId: external_exports.string(), harness: harnessSchema3, savedAt: isoSchema })
69625
69763
  ),
69626
69764
  /** Logins in people's personal keychains in the vault. */
69627
69765
  personalLogins: external_exports.array(
69628
69766
  external_exports.object({
69629
69767
  id: external_exports.string(),
69630
69768
  ownerUserId: external_exports.string(),
69631
- harness: harnessSchema2,
69769
+ harness: harnessSchema3,
69632
69770
  state: loginStateSchema,
69633
69771
  /** The vault's own state: `needs_reconnect`, or still waiting for an admin's approval. */
69634
69772
  vaultStatus: external_exports.enum(["active", "needs_reconnect"]),
@@ -69647,7 +69785,7 @@ var loginStatesSchemaDefinition = external_exports.object({
69647
69785
  logins: external_exports.array(
69648
69786
  external_exports.object({
69649
69787
  id: external_exports.string(),
69650
- harness: harnessSchema2,
69788
+ harness: harnessSchema3,
69651
69789
  state: loginStateSchema,
69652
69790
  contributedByUserId: external_exports.string(),
69653
69791
  limitedUntil: isoSchema.nullable(),
@@ -69665,7 +69803,9 @@ var loginStatesSchemaDefinition = external_exports.object({
69665
69803
  loginPoolId: external_exports.string().nullable(),
69666
69804
  activeLoginId: external_exports.string().nullable()
69667
69805
  })
69668
- )
69806
+ ),
69807
+ /** Recent sign-in attempt steps, newest first; closed reason codes only. */
69808
+ signInAttempts: external_exports.array(signInAttemptViewSchema)
69669
69809
  });
69670
69810
  var loginStatesSchema = loginStatesSchemaDefinition;
69671
69811
 
@@ -70466,8 +70606,13 @@ var callerChannelSchemaDefinition = external_exports.object({
70466
70606
  name: external_exports.string(),
70467
70607
  kind: external_exports.enum(["public", "private", "dm", "group", "chat"]),
70468
70608
  unread: external_exports.number().int().nonnegative(),
70469
- /** The caller's setting there, for an agent in a channel; DMs always reach it. */
70609
+ /** The caller's setting there, for an agent in a channel or shared conversation. */
70470
70610
  level: agentChannelLevelSchema.default("mentions"),
70611
+ /**
70612
+ * The caller has a setting and a mute there: a channel, or a conversation or group DM with 3 or
70613
+ * more members. Absent from older servers; a 1:1 DM always reaches the agent.
70614
+ */
70615
+ hasSetting: external_exports.boolean().optional(),
70471
70616
  /** A message there leaves Laze: the channel mirrors Slack or holds an agent run outside. */
70472
70617
  leavesLaze: external_exports.boolean().default(false),
70473
70618
  /** The caller's own mute there, while it lasts; null when not muted. */
@@ -72666,10 +72811,10 @@ function whereOf(message2) {
72666
72811
  }
72667
72812
  function catchUpLinesOf(message2) {
72668
72813
  if (!message2.catchUp) return [];
72669
- const { count: count8, older } = message2.catchUp;
72814
+ const { count: count10, older } = message2.catchUp;
72670
72815
  const where = whereOf(message2);
72671
72816
  const lines2 = [
72672
- `${count8} ${count8 === 1 ? "message" : "messages"} in ${where} while you were away.`
72817
+ `${count10} ${count10 === 1 ? "message" : "messages"} in ${where} while you were away.`
72673
72818
  ];
72674
72819
  if (older === 0) return lines2;
72675
72820
  const channel = message2.channelKind === "public" || message2.channelKind === "private";
@@ -72692,9 +72837,9 @@ function hookContextOf({
72692
72837
  messages,
72693
72838
  self: self2
72694
72839
  }) {
72695
- const count8 = messages.length === 1 ? "A message" : `${messages.length} messages`;
72840
+ const count10 = messages.length === 1 ? "A message" : `${messages.length} messages`;
72696
72841
  return [
72697
- `${count8} reached you in Laze${selfClauseOf({ self: self2 })}:`,
72842
+ `${count10} reached you in Laze${selfClauseOf({ self: self2 })}:`,
72698
72843
  "",
72699
72844
  ...messages.map((message2) => formatInboxMessage({ message: message2 })),
72700
72845
  "",
@@ -72709,7 +72854,7 @@ function selfClauseOf({ self: self2 }) {
72709
72854
  function record2(value) {
72710
72855
  return typeof value === "object" && value !== null ? value : {};
72711
72856
  }
72712
- function count3(value) {
72857
+ function count4(value) {
72713
72858
  return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : void 0;
72714
72859
  }
72715
72860
  function parse3(line) {
@@ -72730,17 +72875,17 @@ function compactionOf({
72730
72875
  return {
72731
72876
  key: typeof entry2.uuid === "string" ? entry2.uuid : String(index),
72732
72877
  trigger: meta3.trigger === "manual" ? "manual" : "auto",
72733
- tokensBefore: count3(meta3.preTokens),
72734
- tokensAfter: count3(meta3.postTokens),
72878
+ tokensBefore: count4(meta3.preTokens),
72879
+ tokensAfter: count4(meta3.postTokens),
72735
72880
  at: typeof entry2.timestamp === "string" ? entry2.timestamp : "1970-01-01T00:00:00.000Z"
72736
72881
  };
72737
72882
  }
72738
72883
  function usageOf({ entry: entry2 }) {
72739
72884
  const message2 = record2(entry2.message);
72740
72885
  const usage = record2(message2.usage);
72741
- const input2 = count3(usage.input_tokens);
72886
+ const input2 = count4(usage.input_tokens);
72742
72887
  if (input2 === void 0) return void 0;
72743
- const cached2 = (count3(usage.cache_read_input_tokens) ?? 0) + (count3(usage.cache_creation_input_tokens) ?? 0);
72888
+ const cached2 = (count4(usage.cache_read_input_tokens) ?? 0) + (count4(usage.cache_creation_input_tokens) ?? 0);
72744
72889
  return {
72745
72890
  tokens: input2 + cached2,
72746
72891
  ...typeof message2.model === "string" ? { model: message2.model } : {}
@@ -73444,7 +73589,9 @@ var slackFileParamsSchemaDefinition = external_exports.object({
73444
73589
  var slackFileQuerySchemaDefinition = external_exports.object({
73445
73590
  via: external_exports.string().min(1).max(200).optional(),
73446
73591
  /** "1" answers the file as a download of plain bytes, whatever its type. */
73447
- download: external_exports.literal("1").optional()
73592
+ download: external_exports.literal("1").optional(),
73593
+ /** "poster" answers a video's still frame as Slack made it, in place of the video. */
73594
+ variant: external_exports.literal("poster").optional()
73448
73595
  });
73449
73596
  var SLACK_SEARCH_QUERY_MIN = 2;
73450
73597
  var SLACK_SEARCH_QUERY_MAX = 200;
@@ -73595,6 +73742,71 @@ var slackConfig = Config.define((c) => ({
73595
73742
  reconnectMaxSeconds: c.env("SLACK_RECONNECT_MAX_SECONDS", positiveInt4.default(30))
73596
73743
  }));
73597
73744
 
73745
+ // ../../modules/slack/contract/src/slack-ops.ts
73746
+ var count5 = external_exports.number().int().nonnegative();
73747
+ var at = external_exports.iso.datetime();
73748
+ var slackMirrorHealthDefinition = external_exports.object({
73749
+ mirrors: external_exports.array(
73750
+ external_exports.object({
73751
+ teamId: external_exports.string(),
73752
+ slackChannelId: external_exports.string(),
73753
+ lazeChannelId: external_exports.string(),
73754
+ /** channel, private, mpim or im. */
73755
+ kind: external_exports.string(),
73756
+ /** Shared with another organisation, such as a Slack Connect channel. */
73757
+ external: external_exports.boolean(),
73758
+ botMember: external_exports.boolean(),
73759
+ linkedMembers: count5,
73760
+ cacheDays: count5,
73761
+ backfilledAt: at.nullable(),
73762
+ reconciledAt: at.nullable(),
73763
+ /** Message links Laze holds for the conversation, both ways. */
73764
+ links: count5,
73765
+ /** Thread roots Laze holds a reply of. */
73766
+ threads: count5,
73767
+ /** Roots whose Slack reply count, when last read, is above the replies Laze holds. */
73768
+ threadsShort: count5,
73769
+ repliesShort: count5,
73770
+ /** Threads Laze holds whose root is older than the cache window. */
73771
+ oldThreads: count5
73772
+ })
73773
+ )
73774
+ });
73775
+ var slackMirrorHealthSchema = slackMirrorHealthDefinition;
73776
+
73777
+ // src/rules/channel-mute.rules.ts
73778
+ var DURATION = /^(\d+)\s*(m|min|mins|minutes?|h|hours?|d|days?)$/i;
73779
+ function minutesOf({ text: text3 }) {
73780
+ const match = DURATION.exec(text3.trim());
73781
+ if (!match?.[1] || !match[2]) return null;
73782
+ const count10 = Number(match[1]);
73783
+ const unit = match[2].toLowerCase()[0];
73784
+ const perUnit = { d: 1440, h: 60, m: 1 };
73785
+ const minutes = count10 * (perUnit[unit ?? "m"] ?? 1);
73786
+ return minutes > 0 ? minutes : null;
73787
+ }
73788
+ function muteTextOf({ mute }) {
73789
+ return `muted${mute.until ? ` until ${mute.until}` : ""}: ${mute.reason}`;
73790
+ }
73791
+ function settingTextOf({ channel }) {
73792
+ const level2 = channel.level === "everything" ? "Everything" : "Mentions only";
73793
+ const isDefault = channel.isDefault ? " default agent" : "";
73794
+ const mute = channel.mute ? ` ${muteTextOf({ mute: channel.mute })}` : "";
73795
+ return `${level2}${isDefault}${mute}`;
73796
+ }
73797
+ function hasSettingIn({ channel }) {
73798
+ return channel.hasSetting ?? (channel.kind === "public" || channel.kind === "private");
73799
+ }
73800
+ function placeOf({ channel }) {
73801
+ if (channel.kind === "public" || channel.kind === "private") return `#${channel.name}`;
73802
+ const what = channel.kind === "chat" ? "conversation" : "group DM";
73803
+ return channel.name ? `${what} ${channel.name} (${channel.id})` : `${what} ${channel.id}`;
73804
+ }
73805
+ function settingRowOf({ channel }) {
73806
+ return `${placeOf({ channel })} ${settingTextOf({ channel })}
73807
+ `;
73808
+ }
73809
+
73598
73810
  // src/rules/not-in-channel.rules.ts
73599
73811
  function notInChannelLineOf({
73600
73812
  posted,
@@ -73731,7 +73943,7 @@ function slackHitLines({
73731
73943
  ...link2 ? [` ${link2}`] : []
73732
73944
  ];
73733
73945
  }
73734
- var count4 = (n) => `${n} message${n === 1 ? "" : "s"}`;
73946
+ var count6 = (n) => `${n} message${n === 1 ? "" : "s"}`;
73735
73947
  function slackSectionLines({
73736
73948
  slack: slack2,
73737
73949
  laze,
@@ -73744,7 +73956,7 @@ function slackSectionLines({
73744
73956
  });
73745
73957
  if (slack2.teams.some((team) => team.state === "searched")) {
73746
73958
  const found = slack2.hits.length;
73747
- lines2.push(found === 0 ? "From Slack: nothing more." : `From Slack: ${count4(found)}`);
73959
+ lines2.push(found === 0 ? "From Slack: nothing more." : `From Slack: ${count6(found)}`);
73748
73960
  }
73749
73961
  for (const hit of slack2.hits) lines2.push(...slackHitLines({ hit, laze, url: url2, workspaceId }), "");
73750
73962
  return lines2;
@@ -73755,7 +73967,7 @@ function formatSearch({
73755
73967
  workspaceId
73756
73968
  }) {
73757
73969
  const { laze, slack: slack2, query } = output2;
73758
- const lines2 = laze.hits.length === 0 ? [`No Laze messages match "${query}".`] : [`Laze: ${count4(laze.hits.length)} for "${query}"`];
73970
+ const lines2 = laze.hits.length === 0 ? [`No Laze messages match "${query}".`] : [`Laze: ${count6(laze.hits.length)} for "${query}"`];
73759
73971
  for (const hit of laze.hits) {
73760
73972
  lines2.push(...lazeHitLines({ hit, laze, url: url2, workspaceId }), "");
73761
73973
  }
@@ -73787,8 +73999,8 @@ function lastCallAtOf({ text: text3, command }) {
73787
73999
  } catch {
73788
74000
  continue;
73789
74001
  }
73790
- const at2 = callAtOf({ entry: entry2, command });
73791
- if (at2 !== null) return at2;
74002
+ const at4 = callAtOf({ entry: entry2, command });
74003
+ if (at4 !== null) return at4;
73792
74004
  }
73793
74005
  return null;
73794
74006
  }
@@ -73811,7 +74023,7 @@ function newestIsSubagent({
73811
74023
  session,
73812
74024
  subagents
73813
74025
  }) {
73814
- const newest = Math.max(...subagents.map((at2) => at2 ?? Number.NEGATIVE_INFINITY));
74026
+ const newest = Math.max(...subagents.map((at4) => at4 ?? Number.NEGATIVE_INFINITY));
73815
74027
  return Number.isFinite(newest) && newest >= (session ?? Number.NEGATIVE_INFINITY);
73816
74028
  }
73817
74029
 
@@ -73969,11 +74181,11 @@ async function sessionNotesOf({
73969
74181
  dropped.push(await dropStale({ context, pid, path, tell }));
73970
74182
  continue;
73971
74183
  }
73972
- const at2 = await stat2(path).then(
74184
+ const at4 = await stat2(path).then(
73973
74185
  (info) => info.mtimeMs,
73974
74186
  () => 0
73975
74187
  );
73976
- notes.push({ pid, note, standing, at: at2 });
74188
+ notes.push({ pid, note, standing, at: at4 });
73977
74189
  }
73978
74190
  return { notes: notes.toSorted((a, b) => b.at - a.at), dropped };
73979
74191
  }
@@ -74262,7 +74474,7 @@ function beat({
74262
74474
  ...working && state?.messageId ? { messageId: state.messageId } : {}
74263
74475
  });
74264
74476
  }
74265
- function placeOf(message2) {
74477
+ function placeOf2(message2) {
74266
74478
  return { channelId: message2.channelId, threadRootId: message2.threadRootId };
74267
74479
  }
74268
74480
  function newestPerConversation({ messages }) {
@@ -74295,7 +74507,7 @@ async function turnStarted({
74295
74507
  await beat({ client, state: before, working: false }).catch(() => void 0);
74296
74508
  }
74297
74509
  for (const other of others) {
74298
- const opened = { ...placeOf(other), messageId: other.messageId };
74510
+ const opened = { ...placeOf2(other), messageId: other.messageId };
74299
74511
  await beat({ client, state: opened, working: true }).catch(() => void 0);
74300
74512
  }
74301
74513
  const path = statePath({ context, agent: agent3 });
@@ -74516,7 +74728,7 @@ async function attachmentIdsOf({
74516
74728
  function utcTimeOf(iso3) {
74517
74729
  return `${iso3.slice(0, 10)} ${iso3.slice(11, 16)} UTC`;
74518
74730
  }
74519
- function placeOf2(item) {
74731
+ function placeOf3(item) {
74520
74732
  if (item.channelKind === "public" || item.channelKind === "private") {
74521
74733
  return `in #${item.channelName}`;
74522
74734
  }
@@ -74524,7 +74736,7 @@ function placeOf2(item) {
74524
74736
  }
74525
74737
  function activityLineOf({ item }) {
74526
74738
  const who = item.actor.name;
74527
- const where = placeOf2(item);
74739
+ const where = placeOf3(item);
74528
74740
  switch (item.kind) {
74529
74741
  case "mention":
74530
74742
  return `${who} mentioned you ${where}`;
@@ -74570,8 +74782,8 @@ var AT_USAGE = `--at takes a date and time such as 2026-10-20T09:00, read in --t
74570
74782
  such as Europe/Amsterdam) or this machine's zone; a time with its own offset is taken as written.`;
74571
74783
  var OFFSET = /(Z|[+-]\d{2}(:?\d{2})?)$/i;
74572
74784
  var DATE_AND_TIME = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/;
74573
- function sendAtOf({ at: at2, timeZone }) {
74574
- const text3 = at2.trim();
74785
+ function sendAtOf({ at: at4, timeZone }) {
74786
+ const text3 = at4.trim();
74575
74787
  if (!DATE_AND_TIME.test(text3)) return null;
74576
74788
  try {
74577
74789
  if (OFFSET.test(text3)) return Temporal3.Instant.from(text3.replace(" ", "T")).toString();
@@ -74581,7 +74793,7 @@ function sendAtOf({ at: at2, timeZone }) {
74581
74793
  return null;
74582
74794
  }
74583
74795
  }
74584
- function placeOf3({ scheduled: scheduled2 }) {
74796
+ function placeOf4({ scheduled: scheduled2 }) {
74585
74797
  const inChannel = scheduled2.channelKind === "public" || scheduled2.channelKind === "private";
74586
74798
  const channel = inChannel ? `#${scheduled2.channelName}` : "a direct message";
74587
74799
  if (!scheduled2.threadRootId) return channel;
@@ -74604,7 +74816,7 @@ function scheduledLine({
74604
74816
  timeZone
74605
74817
  }) {
74606
74818
  const when = zonedTimeOf({ iso: scheduled2.sendAt, timeZone });
74607
- return `Scheduled ${scheduled2.id} for ${placeOf3({ scheduled: scheduled2 })} at ${when}.
74819
+ return `Scheduled ${scheduled2.id} for ${placeOf4({ scheduled: scheduled2 })} at ${when}.
74608
74820
  ${indented(scheduled2.body)}
74609
74821
  `;
74610
74822
  }
@@ -74617,7 +74829,7 @@ var FAILURES = {
74617
74829
  };
74618
74830
  function entryOf(scheduled2) {
74619
74831
  const failed2 = scheduled2.failure ? `failed: ${FAILURES[scheduled2.failure]}; give it a new time with laze scheduled edit --at, or cancel it` : scheduled2.status;
74620
- const head = `${utcTimeOf(scheduled2.sendAt)} ${failed2} ${placeOf3({ scheduled: scheduled2 })} ${scheduled2.id}`;
74832
+ const head = `${utcTimeOf(scheduled2.sendAt)} ${failed2} ${placeOf4({ scheduled: scheduled2 })} ${scheduled2.id}`;
74621
74833
  return `${head}
74622
74834
  ${indented(scheduled2.body)}`;
74623
74835
  }
@@ -74635,9 +74847,9 @@ function scheduleAtOf({
74635
74847
  usage
74636
74848
  }) {
74637
74849
  if (args.flags.at === void 0 && args.flags.tz === void 0) return null;
74638
- const at2 = flagText({ args, name: "at" });
74850
+ const at4 = flagText({ args, name: "at" });
74639
74851
  const timeZone = flagText({ args, name: "tz" }) || currentTimeZone();
74640
- const sendAt = at2 ? sendAtOf({ at: at2, timeZone }) : null;
74852
+ const sendAt = at4 ? sendAtOf({ at: at4, timeZone }) : null;
74641
74853
  if (!sendAt) throw new CliUsageError(`${usage}
74642
74854
  ${AT_USAGE}`);
74643
74855
  return { sendAt, timeZone };
@@ -74646,19 +74858,19 @@ async function scheduleMessage({
74646
74858
  context,
74647
74859
  args,
74648
74860
  client,
74649
- at: at2,
74861
+ at: at4,
74650
74862
  target,
74651
74863
  body
74652
74864
  }) {
74653
74865
  const scheduled2 = await client.post("/api/agents/me/scheduled", {
74654
74866
  ...target,
74655
74867
  body,
74656
- sendAt: at2.sendAt,
74868
+ sendAt: at4.sendAt,
74657
74869
  ..."replyTo" in target && args.flags["also-channel"] === true ? { alsoInChannel: true } : {}
74658
74870
  });
74659
74871
  if (args.flags.json) context.out(`${JSON.stringify(scheduled2, null, 2)}
74660
74872
  `);
74661
- else context.out(scheduledLine({ scheduled: scheduled2, timeZone: at2.timeZone }));
74873
+ else context.out(scheduledLine({ scheduled: scheduled2, timeZone: at4.timeZone }));
74662
74874
  return void 0;
74663
74875
  }
74664
74876
  var USAGE = "Usage: laze scheduled [--channel <channel>] [--json], laze scheduled send|cancel <id>, laze scheduled edit <id> [--text <text|->] [--at <time> [--tz <zone>]]";
@@ -74699,18 +74911,18 @@ async function editOne({
74699
74911
  args,
74700
74912
  id: id4
74701
74913
  }) {
74702
- const at2 = scheduleAtOf({ args, usage: EDIT_USAGE });
74914
+ const at4 = scheduleAtOf({ args, usage: EDIT_USAGE });
74703
74915
  const body = await newTextOf({ context, args });
74704
- if (!at2 && body === void 0) throw new CliUsageError(EDIT_USAGE);
74916
+ if (!at4 && body === void 0) throw new CliUsageError(EDIT_USAGE);
74705
74917
  const { client } = await signedIn({ context, args });
74706
74918
  const edited = await client.post("/api/agents/me/scheduled/edit", {
74707
74919
  scheduledId: id4,
74708
74920
  ...body === void 0 ? {} : { body },
74709
- ...at2 ? { sendAt: at2.sendAt } : {}
74921
+ ...at4 ? { sendAt: at4.sendAt } : {}
74710
74922
  });
74711
74923
  if (args.flags.json) return context.out(`${JSON.stringify(edited, null, 2)}
74712
74924
  `);
74713
- const timeZone = at2?.timeZone ?? currentTimeZone();
74925
+ const timeZone = at4?.timeZone ?? currentTimeZone();
74714
74926
  context.out(scheduledLine({ scheduled: edited, timeZone }).replace(/^Scheduled /, "Updated "));
74715
74927
  }
74716
74928
  async function actOn({
@@ -74725,7 +74937,7 @@ async function actOn({
74725
74937
  });
74726
74938
  if (args.flags.json) return context.out(`${JSON.stringify(done, null, 2)}
74727
74939
  `);
74728
- const place = placeOf3({ scheduled: done });
74940
+ const place = placeOf4({ scheduled: done });
74729
74941
  context.out(
74730
74942
  action === "send" ? `Sent ${done.id} now in ${place} as ${done.messageId ?? "a new message"}.
74731
74943
  ` : `Cancelled ${done.id} in ${place}.
@@ -74827,7 +75039,7 @@ async function listChannels({ context, args }) {
74827
75039
  if (args.flags.json) return context.out(`${JSON.stringify(channels3, null, 2)}
74828
75040
  `);
74829
75041
  for (const channel of channels3) {
74830
- const direct2 = ["dm", "group", "chat"].includes(channel.kind);
75042
+ const direct2 = !hasSettingIn({ channel });
74831
75043
  const name3 = channelLabelIn(channel);
74832
75044
  const unread = channel.unread > 0 ? ` ${channel.unread} unread` : "";
74833
75045
  const muted = channel.mute ? " muted" : "";
@@ -74853,10 +75065,9 @@ async function setChannelLevel({
74853
75065
  });
74854
75066
  if (args.flags.json) return context.out(`${JSON.stringify(set2, null, 2)}
74855
75067
  `);
74856
- context.out(
74857
- `#${set2.name} is now ${set2.level === "everything" ? "Everything" : "Mentions only"}.
74858
- `
74859
- );
75068
+ const label3 = set2.level === "everything" ? "Everything" : "Mentions only";
75069
+ context.out(`${placeOf({ channel: set2 })} is now ${label3}.
75070
+ `);
74860
75071
  }
74861
75072
  var LEADING_BLANK_LINES = /^(?:[ \t]*\r?\n)+/;
74862
75073
  async function textOf({
@@ -74894,12 +75105,12 @@ async function filesOf({
74894
75105
  context,
74895
75106
  args,
74896
75107
  client,
74897
- at: at2,
75108
+ at: at4,
74898
75109
  channel
74899
75110
  }) {
74900
75111
  const sources = fileSourcesOf({ args, what: "A message" });
74901
75112
  if (sources.length === 0) return {};
74902
- if (at2) throw new CliUsageError("A scheduled message (--at) cannot carry --image or --file yet");
75113
+ if (at4) throw new CliUsageError("A scheduled message (--at) cannot carry --image or --file yet");
74903
75114
  const attachmentIds = await attachmentIdsOf({ context, client, sources, channel });
74904
75115
  return { attachmentIds };
74905
75116
  }
@@ -74918,16 +75129,16 @@ async function post({
74918
75129
  }) {
74919
75130
  const channel = args.words[1];
74920
75131
  if (!channel) throw new CliUsageError(POST_USAGE);
74921
- const at2 = scheduleAtOf({ args, usage: POST_USAGE });
75132
+ const at4 = scheduleAtOf({ args, usage: POST_USAGE });
74922
75133
  const { client, profile } = await signedIn({ context, args });
74923
75134
  const typed = await textOf({ context, args, from: 2 });
74924
75135
  const leaves = leavesLazeOf({ client, channel });
74925
75136
  const body = await textToSend({ context, args, profile, client, text: typed, leaves });
74926
75137
  const thread2 = flagText({ args, name: "thread" });
74927
- const files2 = await filesOf({ context, args, client, at: at2, channel: async () => channel });
74928
- if (at2) {
75138
+ const files2 = await filesOf({ context, args, client, at: at4, channel: async () => channel });
75139
+ if (at4) {
74929
75140
  const target = { channel, ...thread2 ? { threadRootId: thread2 } : {} };
74930
- return scheduleMessage({ context, args, client, at: at2, target, body });
75141
+ return scheduleMessage({ context, args, client, at: at4, target, body });
74931
75142
  }
74932
75143
  const posted = await client.post("/api/agents/me/messages", {
74933
75144
  channel,
@@ -74953,7 +75164,7 @@ async function reply({
74953
75164
  }) {
74954
75165
  const messageId = args.words[1];
74955
75166
  if (!messageId) throw new CliUsageError(REPLY_USAGE);
74956
- const at2 = scheduleAtOf({ args, usage: REPLY_USAGE });
75167
+ const at4 = scheduleAtOf({ args, usage: REPLY_USAGE });
74957
75168
  const { client, profile, name: name3 } = await signedIn({ context, args });
74958
75169
  const channel = flagText({ args, name: "channel" });
74959
75170
  const typed = await textOf({ context, args, from: 2 });
@@ -74963,11 +75174,11 @@ async function reply({
74963
75174
  context,
74964
75175
  args,
74965
75176
  client,
74966
- at: at2,
75177
+ at: at4,
74967
75178
  channel: () => replyChannelOf({ client, messageId, channel })
74968
75179
  });
74969
- if (at2) {
74970
- return scheduleMessage({ context, args, client, at: at2, target: { replyTo: messageId }, body });
75180
+ if (at4) {
75181
+ return scheduleMessage({ context, args, client, at: at4, target: { replyTo: messageId }, body });
74971
75182
  }
74972
75183
  const posted = await client.post("/api/agents/me/replies", {
74973
75184
  messageId,
@@ -76477,8 +76688,8 @@ function boundAwayOf({ waiting, key }) {
76477
76688
  }
76478
76689
  async function logDelivery({ context, line }) {
76479
76690
  const folder = join13(dirname11(context.environment.configPath), "connect");
76480
- const at2 = Temporal3.Instant.fromEpochMilliseconds(context.nowMs());
76481
- const stamped = `${at2.toString({ smallestUnit: "second" })} ${line}
76691
+ const at4 = Temporal3.Instant.fromEpochMilliseconds(context.nowMs());
76692
+ const stamped = `${at4.toString({ smallestUnit: "second" })} ${line}
76482
76693
  `;
76483
76694
  context.out(stamped);
76484
76695
  await mkdir2(folder, { recursive: true, mode: 448 });
@@ -81600,9 +81811,9 @@ function formatAppMoney({
81600
81811
  maximumFractionDigits: tiny ? 4 : 2
81601
81812
  }).format(amount);
81602
81813
  }
81603
- var count5 = new Intl.NumberFormat("en-US");
81814
+ var count7 = new Intl.NumberFormat("en-US");
81604
81815
  function plural2({ value, one, many }) {
81605
- return `${count5.format(value)} ${value === 1 ? one : many}`;
81816
+ return `${count7.format(value)} ${value === 1 ? one : many}`;
81606
81817
  }
81607
81818
  function appCostQuantityText(line) {
81608
81819
  const { quantity } = line;
@@ -82873,19 +83084,19 @@ function buildFileOf({ path, bytes }) {
82873
83084
  }
82874
83085
  var WEEKDAYS = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
82875
83086
  function whenLabel({
82876
- at: at2,
83087
+ at: at4,
82877
83088
  now,
82878
83089
  timeZone
82879
83090
  }) {
82880
83091
  const zone = { timeZone: timeZone ?? currentTimeZone() };
82881
- const days = differenceInCalendarDays(now.epochMilliseconds, at2, zone);
82882
- const time3 = format(at2, "HH:mm", zone);
83092
+ const days = differenceInCalendarDays(now.epochMilliseconds, at4, zone);
83093
+ const time3 = format(at4, "HH:mm", zone);
82883
83094
  if (days === 0) return `Today ${time3}`;
82884
83095
  if (days === 1) return `Yesterday ${time3}`;
82885
83096
  if (days > 1 && days < 7) {
82886
- return `${WEEKDAYS[toZonedDateTime(at2, zone).dayOfWeek - 1] ?? ""} ${time3}`;
83097
+ return `${WEEKDAYS[toZonedDateTime(at4, zone).dayOfWeek - 1] ?? ""} ${time3}`;
82887
83098
  }
82888
- return format(at2, "d MMM HH:mm", zone);
83099
+ return format(at4, "d MMM HH:mm", zone);
82889
83100
  }
82890
83101
  function versionLine({
82891
83102
  version: version2,
@@ -82900,8 +83111,8 @@ function versionLine({
82900
83111
  }
82901
83112
  function messageOf({ args }) {
82902
83113
  const words = [...args.words];
82903
- const at2 = words.indexOf("-m");
82904
- const short = at2 >= 0 ? words.splice(at2, 2)[1] ?? "" : "";
83114
+ const at4 = words.indexOf("-m");
83115
+ const short = at4 >= 0 ? words.splice(at4, 2)[1] ?? "" : "";
82905
83116
  const long = typeof args.flags.message === "string" ? args.flags.message : "";
82906
83117
  return { message: (short || long).trim(), words };
82907
83118
  }
@@ -82957,19 +83168,19 @@ async function h264LevelOf(path) {
82957
83168
  try {
82958
83169
  const { size } = await file4.stat();
82959
83170
  const head = Buffer.alloc(16);
82960
- for (let at2 = 0; at2 + 8 <= size; ) {
82961
- await file4.read(head, 0, 16, at2);
83171
+ for (let at4 = 0; at4 + 8 <= size; ) {
83172
+ await file4.read(head, 0, 16, at4);
82962
83173
  let length = head.readUInt32BE(0);
82963
83174
  if (length === 1) length = Number(head.readBigUInt64BE(8));
82964
- if (length === 0) length = size - at2;
83175
+ if (length === 0) length = size - at4;
82965
83176
  if (length < 8) return null;
82966
83177
  if (head.toString("latin1", 4, 8) === "moov") {
82967
83178
  const moov = Buffer.alloc(Math.min(length, 64 * 1024 * 1024));
82968
- await file4.read(moov, 0, moov.byteLength, at2);
83179
+ await file4.read(moov, 0, moov.byteLength, at4);
82969
83180
  const box = moov.indexOf("avcC", 0, "latin1");
82970
83181
  return box === -1 || box + 8 > moov.byteLength ? null : moov[box + 7] ?? null;
82971
83182
  }
82972
- at2 += length;
83183
+ at4 += length;
82973
83184
  }
82974
83185
  return null;
82975
83186
  } finally {
@@ -83579,8 +83790,8 @@ function channelOf({ context, args }) {
83579
83790
  const channel = flagText({ args, name: "channel" }) || context.environment.inherited.LAZE_CHANNEL;
83580
83791
  return channel ? { channel } : {};
83581
83792
  }
83582
- function word({ args, at: at2 }) {
83583
- const value = args.words[at2];
83793
+ function word({ args, at: at4 }) {
83794
+ const value = args.words[at4];
83584
83795
  if (!value) throw new CliUsageError(BROWSER_TAB_USAGE);
83585
83796
  return value;
83586
83797
  }
@@ -84352,8 +84563,8 @@ function json2({
84352
84563
  function withServeThemeScript(page) {
84353
84564
  const head = /<head(\s[^>]*)?>/i.exec(page);
84354
84565
  if (!head) return THEME_SCRIPT + page;
84355
- const at2 = head.index + head[0].length;
84356
- return page.slice(0, at2) + THEME_SCRIPT + page.slice(at2);
84566
+ const at4 = head.index + head[0].length;
84567
+ return page.slice(0, at4) + THEME_SCRIPT + page.slice(at4);
84357
84568
  }
84358
84569
  async function staticFile({
84359
84570
  folder,
@@ -84909,7 +85120,7 @@ var appWrite = async ({ context, args }) => {
84909
85120
  });
84910
85121
  };
84911
85122
  function seedLine(seeded) {
84912
- const created = Object.entries(seeded.created).map(([name3, count8]) => `${count8} in ${name3}`);
85123
+ const created = Object.entries(seeded.created).map(([name3, count10]) => `${count10} in ${name3}`);
84913
85124
  const parts = [
84914
85125
  created.length ? `Loaded starter records: ${created.join(", ")}.` : "",
84915
85126
  seeded.skipped.length ? `Left ${seeded.skipped.join(", ")} as it was: it already holds records.` : ""
@@ -85234,8 +85445,8 @@ function cardLine({ choice }) {
85234
85445
  var appCard = async ({ context, args }) => {
85235
85446
  const client = await appClient({ context, args });
85236
85447
  const appId = await appIdOf({ client, args, folder: folderOf({ context, word: void 0 }) });
85237
- const count8 = Number(flagText({ args, name: "rows", fallback: "5" }));
85238
- if (!Number.isInteger(count8) || count8 < 1 || count8 > 10) {
85448
+ const count10 = Number(flagText({ args, name: "rows", fallback: "5" }));
85449
+ if (!Number.isInteger(count10) || count10 < 1 || count10 > 10) {
85239
85450
  throw new CliUsageError("--rows is a whole number from 1 to 10");
85240
85451
  }
85241
85452
  const text3 = (name3) => flagText({ args, name: name3 }) || null;
@@ -85248,7 +85459,7 @@ var appCard = async ({ context, args }) => {
85248
85459
  collection: text3("collection"),
85249
85460
  filter: flagText({ args, name: "where" }) || flagText({ args, name: "filter" }),
85250
85461
  sort: flagText({ args, name: "sort" }),
85251
- rows: count8,
85462
+ rows: count10,
85252
85463
  caption: text3("caption")
85253
85464
  }
85254
85465
  });
@@ -86883,9 +87094,9 @@ function presenceColumns(member) {
86883
87094
  return [member.presence, `${status11.emoji} ${status11.text}`.trim() + until, ...dndColumn(member)];
86884
87095
  }
86885
87096
  function formatMembers({ detail }) {
86886
- const count8 = `${detail.members.length} ${detail.members.length === 1 ? "member" : "members"}`;
87097
+ const count10 = `${detail.members.length} ${detail.members.length === 1 ? "member" : "members"}`;
86887
87098
  const ends = detail.endsAt ? `, ends ${utcTimeOf(detail.endsAt)}` : "";
86888
- const head = `${channelLabelOf(detail)} (${detail.id}), ${count8}${ends}`;
87099
+ const head = `${channelLabelOf(detail)} (${detail.id}), ${count10}${ends}`;
86889
87100
  const rows = detail.members.map(
86890
87101
  (member) => [ROLE[member.role], member.name, member.kind, member.id, ...presenceColumns(member)].join(" ")
86891
87102
  );
@@ -86924,13 +87135,13 @@ function formatBrowsable({
86924
87135
  }) {
86925
87136
  if (channels3.length === 0) return "No channels to browse.\n";
86926
87137
  const rows = channels3.map((channel) => {
86927
- const count8 = `${channel.memberCount} ${channel.memberCount === 1 ? "member" : "members"}`;
87138
+ const count10 = `${channel.memberCount} ${channel.memberCount === 1 ? "member" : "members"}`;
86928
87139
  const marks = [
86929
87140
  channel.joined ? "joined" : "not joined",
86930
87141
  ...channel.private ? ["private"] : [],
86931
87142
  ...channel.archived ? ["archived"] : []
86932
87143
  ].join(", ");
86933
- return `#${channel.name} ${channel.id} ${count8} ${marks} ${channel.topic}`;
87144
+ return `#${channel.name} ${channel.id} ${count10} ${marks} ${channel.topic}`;
86934
87145
  });
86935
87146
  return `${rows.join("\n")}
86936
87147
  `;
@@ -86974,31 +87185,6 @@ function notifyLine({
86974
87185
  `;
86975
87186
  }
86976
87187
 
86977
- // src/rules/channel-mute.rules.ts
86978
- var DURATION = /^(\d+)\s*(m|min|mins|minutes?|h|hours?|d|days?)$/i;
86979
- function minutesOf({ text: text3 }) {
86980
- const match = DURATION.exec(text3.trim());
86981
- if (!match?.[1] || !match[2]) return null;
86982
- const count8 = Number(match[1]);
86983
- const unit = match[2].toLowerCase()[0];
86984
- const perUnit = { d: 1440, h: 60, m: 1 };
86985
- const minutes = count8 * (perUnit[unit ?? "m"] ?? 1);
86986
- return minutes > 0 ? minutes : null;
86987
- }
86988
- function muteTextOf({ mute }) {
86989
- return `muted${mute.until ? ` until ${mute.until}` : ""}: ${mute.reason}`;
86990
- }
86991
- function settingTextOf({ channel }) {
86992
- const level2 = channel.level === "everything" ? "Everything" : "Mentions only";
86993
- const isDefault = channel.isDefault ? " default agent" : "";
86994
- const mute = channel.mute ? ` ${muteTextOf({ mute: channel.mute })}` : "";
86995
- return `${level2}${isDefault}${mute}`;
86996
- }
86997
- function settingRowOf({ channel }) {
86998
- return `#${channel.name} ${settingTextOf({ channel })}
86999
- `;
87000
- }
87001
-
87002
87188
  // src/services/channel-admin-commands.service.ts
87003
87189
  var AGENT_HINT = "Roles, archiving and removing others are a channel admin's change: ask one.\n";
87004
87190
  var ROLES2 = ["admin", "member"];
@@ -87429,7 +87615,6 @@ async function channelHide({ context, args }) {
87429
87615
  // src/services/channel-mute-commands.service.ts
87430
87616
  var MUTE_USAGE = 'Usage: laze channel mute <channel> --reason "<why>" [--for 30m|2h|1d]';
87431
87617
  var UNMUTE_USAGE = "Usage: laze channel unmute <channel>";
87432
- var isChannel = (channel) => channel.kind === "public" || channel.kind === "private";
87433
87618
  async function channelMute({ context, args }) {
87434
87619
  const channel = args.words[2];
87435
87620
  if (!channel) throw new CliUsageError(MUTE_USAGE);
@@ -87445,8 +87630,10 @@ async function channelMute({ context, args }) {
87445
87630
  if (args.flags.json) return context.out(`${JSON.stringify(muted, null, 2)}
87446
87631
  `);
87447
87632
  const mute = muted.mute ? ` ${muteTextOf({ mute: muted.mute })}` : "";
87448
- context.out(`#${muted.name}${mute}. A mention, a DM or your threads still reach you.
87449
- `);
87633
+ context.out(
87634
+ `${placeOf({ channel: muted })}${mute}. A mention, a DM or your threads still reach you.
87635
+ `
87636
+ );
87450
87637
  }
87451
87638
  async function channelUnmute({ context, args }) {
87452
87639
  const channel = args.words[2];
@@ -87456,17 +87643,21 @@ async function channelUnmute({ context, args }) {
87456
87643
  if (args.flags.json) return context.out(`${JSON.stringify(unmuted, null, 2)}
87457
87644
  `);
87458
87645
  const level2 = unmuted.level === "everything" ? "Everything" : "Mentions only";
87459
- context.out(`#${unmuted.name} is unmuted, on ${level2}.
87646
+ context.out(`${placeOf({ channel: unmuted })} is unmuted, on ${level2}.
87460
87647
  `);
87461
87648
  }
87462
87649
  async function channelSettings({ context, args }) {
87463
87650
  const wanted = args.words[2]?.trim();
87464
87651
  const { client } = await signedIn({ context, args });
87465
- const channels3 = (await client.get("/api/agents/me/channels")).filter(isChannel);
87652
+ const channels3 = (await client.get("/api/agents/me/channels")).filter(
87653
+ (channel) => hasSettingIn({ channel })
87654
+ );
87466
87655
  const name3 = wanted?.replace(/^#/, "").toLowerCase();
87467
87656
  const shown2 = wanted ? channels3.filter((channel) => channel.id === wanted || channel.name === name3) : channels3;
87468
87657
  if (wanted && shown2.length === 0) {
87469
- throw new CliUsageError(`You are not in ${wanted}. laze channel settings lists your channels.`);
87658
+ throw new CliUsageError(
87659
+ `${wanted} has no setting for you: you are not in it, or it is a 1:1 DM, which always reaches you. laze channel settings lists your channels and shared conversations.`
87660
+ );
87470
87661
  }
87471
87662
  if (args.flags.json) {
87472
87663
  const value = wanted ? shown2[0] : shown2;
@@ -88490,9 +88681,8 @@ var computerWaitlistChangedDefinition = external_exports.object({
88490
88681
  var priceId = external_exports.string().min(1).optional();
88491
88682
  var MAC_QA_WORKSPACE_ID = "workspace_0004i5nUrgRHO0Mz9PXEeGpqnPFDM";
88492
88683
  var billingConfig = Config.define((c) => ({
88684
+ /** Every link billing hands out, referral links included (`BASE_HOST`, laze.so on prod). */
88493
88685
  publicBaseUrl,
88494
- /** The first alias (`laze.so` on prod) is the short origin referral links are shared on. */
88495
- publicOriginAliases,
88496
88686
  /** Stripe's API, or the payment simulator in tests and local stacks. */
88497
88687
  stripeApiBase: c.env("STRIPE_API_BASE", external_exports.url().default("https://api.stripe.com")),
88498
88688
  /** Team's graduated per-person price (`TEAM_PRICING`), one quantity per person. */
@@ -90301,7 +90491,9 @@ var loginTerminalDefinition = external_exports.discriminatedUnion("status", [
90301
90491
  status: external_exports.literal("ready"),
90302
90492
  /** The WebSocket path of the terminal, token included; add `cols` and `rows`. */
90303
90493
  streamPath: external_exports.string(),
90304
- expiresAt: external_exports.iso.datetime()
90494
+ expiresAt: external_exports.iso.datetime(),
90495
+ /** The caller's last sign-in try of this CLI, when it ended refused: when, and why. */
90496
+ lastTry: external_exports.object({ at: external_exports.iso.datetime(), reason: external_exports.string().regex(/^[a-z0-9_]{1,40}$/) }).optional()
90305
90497
  })
90306
90498
  ]);
90307
90499
  var loginTerminalSchema = loginTerminalDefinition;
@@ -90566,8 +90758,8 @@ var whatsappObservedPayloadDefinition = external_exports.object({
90566
90758
  });
90567
90759
 
90568
90760
  // ../../modules/compute/contract/src/whatsapp-ops.ts
90569
- var count6 = external_exports.number().int().nonnegative();
90570
- var at = external_exports.iso.datetime();
90761
+ var count8 = external_exports.number().int().nonnegative();
90762
+ var at2 = external_exports.iso.datetime();
90571
90763
  var whatsappMirrorHealthDefinition = external_exports.object({
90572
90764
  mirrors: external_exports.array(
90573
90765
  external_exports.object({
@@ -90577,27 +90769,54 @@ var whatsappMirrorHealthDefinition = external_exports.object({
90577
90769
  provider: external_exports.string(),
90578
90770
  mirrorOn: external_exports.boolean(),
90579
90771
  /** When the mirror took its changes only as events (ADR-216); null while it still pulls. */
90580
- eventsAt: at.nullable(),
90772
+ eventsAt: at2.nullable(),
90581
90773
  cursor: external_exports.number().int(),
90582
- nextVisitAt: at.nullable(),
90583
- touchedAt: at.nullable(),
90584
- createdAt: at,
90585
- skipped: external_exports.object({ count: count6, from: external_exports.number().int().nullable(), at: at.nullable() }),
90774
+ nextVisitAt: at2.nullable(),
90775
+ touchedAt: at2.nullable(),
90776
+ createdAt: at2,
90777
+ skipped: external_exports.object({ count: count8, from: external_exports.number().int().nullable(), at: at2.nullable() }),
90586
90778
  /** The last pull that met files; null when none did. */
90587
90779
  files: external_exports.object({
90588
- at,
90589
- attached: count6,
90590
- unavailable: count6,
90591
- retrying: count6,
90592
- dropped: count6,
90780
+ at: at2,
90781
+ attached: count8,
90782
+ unavailable: count8,
90783
+ retrying: count8,
90784
+ dropped: count8,
90593
90785
  failureCode: external_exports.string().nullable()
90594
90786
  }).nullable(),
90595
90787
  /** Intake holds (ADR-216 §11) by kind and code, with when the oldest was made. */
90596
- holds: external_exports.array(external_exports.object({ kind: external_exports.string(), code: external_exports.string(), count: count6, oldestAt: at }))
90788
+ holds: external_exports.array(external_exports.object({ kind: external_exports.string(), code: external_exports.string(), count: count8, oldestAt: at2 }))
90597
90789
  })
90598
90790
  )
90599
90791
  });
90600
90792
  var whatsappMirrorHealthSchema = whatsappMirrorHealthDefinition;
90793
+ var WHATSAPP_SEND_KINDS = ["reply", "edit", "revoke", "react", "read", "agent"];
90794
+ var whatsappSendsDefinition = external_exports.object({
90795
+ /** Newest first. */
90796
+ sends: external_exports.array(
90797
+ external_exports.object({
90798
+ /** The send's own id: for a reply it carries the Laze message id, never WhatsApp's. */
90799
+ id: external_exports.string(),
90800
+ machineId: external_exports.string(),
90801
+ kind: external_exports.enum(WHATSAPP_SEND_KINDS),
90802
+ state: external_exports.string(),
90803
+ /** Whether it quoted a message, and how many files it carried. */
90804
+ quoted: external_exports.boolean(),
90805
+ files: count8,
90806
+ /**
90807
+ * Why a failed send did not go: its stored code, or for older sends the code its outcome
90808
+ * line reads as; "other" when none fits, null for a send that did not fail.
90809
+ */
90810
+ failureCode: external_exports.string().nullable(),
90811
+ /** For a refused or unknown failure, the error number WhatsApp's server gave, if any. */
90812
+ serverErrorCode: external_exports.number().int().nullable(),
90813
+ createdAt: at2,
90814
+ claimedAt: at2.nullable(),
90815
+ sentAt: at2.nullable()
90816
+ })
90817
+ )
90818
+ });
90819
+ var whatsappSendsSchema = whatsappSendsDefinition;
90601
90820
  var WHATSAPP_WAKE_STEPS = [
90602
90821
  "requested",
90603
90822
  "vmRunning",
@@ -90617,7 +90836,7 @@ var whatsappWakeTimelineDefinition = external_exports.object({
90617
90836
  /** Newest first. */
90618
90837
  wakes: external_exports.array(
90619
90838
  external_exports.object({
90620
- requestedAt: at,
90839
+ requestedAt: at2,
90621
90840
  /** watch, send, message, visit, link or unpair. */
90622
90841
  cause: external_exports.string(),
90623
90842
  /** done, failed, or open when no step came for a while. */
@@ -90634,12 +90853,12 @@ var whatsappWakeTimelineDefinition = external_exports.object({
90634
90853
  steps: external_exports.array(
90635
90854
  external_exports.object({
90636
90855
  step: external_exports.enum(WHATSAPP_WAKE_STEPS),
90637
- at,
90638
- sincePreviousMs: count6,
90639
- sinceRequestMs: count6
90856
+ at: at2,
90857
+ sincePreviousMs: count8,
90858
+ sinceRequestMs: count8
90640
90859
  })
90641
90860
  ),
90642
- totalMs: count6.nullable()
90861
+ totalMs: count8.nullable()
90643
90862
  })
90644
90863
  )
90645
90864
  })
@@ -91328,8 +91547,8 @@ var CONNECT_HELP = `laze connect: services for your agent's work.
91328
91547
  laze connect suggest <service|domain|https url> --reason "<one plain sentence>"
91329
91548
  [--label <name>] [--instructions "<markdown>"] [--auth oauth|key|none]
91330
91549
  [--header <name>] [--prefix "<text>"] [--keychain workspace]
91331
- post a card for the person who asked: they sign in or paste the key there, and you hear
91332
- back once it is connected. A service Laze has no card for works by its MCP URL or domain:
91550
+ post a card for your owner (a team agent: the person who asked), whose keychain you use:
91551
+ they sign in or paste the key there, and you hear back once it is connected. A service Laze has no card for works by its MCP URL or domain:
91333
91552
  Laze finds how it signs in. --instructions says where the key is and what to turn on;
91334
91553
  --keychain workspace asks an admin to connect it for the whole workspace instead
91335
91554
  laze connect search <text> find a server's MCP URL in the registry and indexes
@@ -91507,11 +91726,11 @@ function bundleOf({ text: text3, field }) {
91507
91726
  for (const line of text3.split(/\r?\n/)) {
91508
91727
  const kept = line.trim();
91509
91728
  if (!kept || kept.startsWith("#")) continue;
91510
- const at2 = line.indexOf("=");
91511
- if (at2 <= 0) {
91729
+ const at4 = line.indexOf("=");
91730
+ if (at4 <= 0) {
91512
91731
  throw new CliUsageError("Give KEY=value lines, or one value with --field <FIELD>.");
91513
91732
  }
91514
- fields[line.slice(0, at2).trim()] = line.slice(at2 + 1);
91733
+ fields[line.slice(0, at4).trim()] = line.slice(at4 + 1);
91515
91734
  }
91516
91735
  return { kind: "api_key_set", fields };
91517
91736
  }
@@ -93067,7 +93286,7 @@ function nextClock({
93067
93286
  timeZone
93068
93287
  }) {
93069
93288
  const local2 = now.toZonedDateTimeISO(timeZone);
93070
- const at2 = local2.with({
93289
+ const at4 = local2.with({
93071
93290
  hour: Number(clock[1]),
93072
93291
  minute: Number(clock[2]),
93073
93292
  second: 0,
@@ -93075,7 +93294,7 @@ function nextClock({
93075
93294
  microsecond: 0,
93076
93295
  nanosecond: 0
93077
93296
  });
93078
- const next = Temporal3.ZonedDateTime.compare(at2, local2) > 0 ? at2 : at2.add({ days: 1 });
93297
+ const next = Temporal3.ZonedDateTime.compare(at4, local2) > 0 ? at4 : at4.add({ days: 1 });
93079
93298
  return next.toString({ timeZoneName: "never", smallestUnit: "second" });
93080
93299
  }
93081
93300
  function dndInputOf({
@@ -94007,8 +94226,8 @@ var EXTERNAL_USAGE = `Usage:
94007
94226
  laze external report <workspace> --note "<why>" report a workspace to Laze staff, and block it (admins)`;
94008
94227
  var printJson6 = (context, data) => context.out(`${JSON.stringify(data, null, 2)}
94009
94228
  `);
94010
- function wordAt5({ args, at: at2, what }) {
94011
- const word3 = args.words[at2]?.trim();
94229
+ function wordAt5({ args, at: at4, what }) {
94230
+ const word3 = args.words[at4]?.trim();
94012
94231
  if (!word3) throw new CliUsageError(`Name ${what}.
94013
94232
  ${EXTERNAL_USAGE}`);
94014
94233
  return word3;
@@ -94112,9 +94331,9 @@ async function invite2({ context, args }) {
94112
94331
  });
94113
94332
  if (args.flags.json) return printJson6(context, sent);
94114
94333
  const sharing = sent.share ? `, sharing #${sent.share.name} once accepted` : "";
94115
- const at2 = sent.company ? ` at ${sent.company}` : "";
94334
+ const at4 = sent.company ? ` at ${sent.company}` : "";
94116
94335
  context.out(
94117
- `Invited ${sent.email}${at2}${sharing}. Invitation ${sent.id} expires ${utcTimeOf(sent.expiresAt)}.
94336
+ `Invited ${sent.email}${at4}${sharing}. Invitation ${sent.id} expires ${utcTimeOf(sent.expiresAt)}.
94118
94337
  `
94119
94338
  );
94120
94339
  }
@@ -95251,8 +95470,8 @@ function draftFilesMissingText(names) {
95251
95470
  }
95252
95471
 
95253
95472
  // ../../modules/feed/contract/src/feed.decisions.ts
95254
- function decisionsLineOf(count8) {
95255
- return `${count8} ${count8 === 1 ? "decision" : "decisions"} waiting on you`;
95473
+ function decisionsLineOf(count10) {
95474
+ return `${count10} ${count10 === 1 ? "decision" : "decisions"} waiting on you`;
95256
95475
  }
95257
95476
 
95258
95477
  // src/rules/feed-input.rules.ts
@@ -95260,11 +95479,11 @@ function csvCellsOf(line) {
95260
95479
  const cells = [];
95261
95480
  let cell = "";
95262
95481
  let quoted2 = false;
95263
- for (let at2 = 0; at2 < line.length; at2 += 1) {
95264
- const char = line[at2];
95265
- if (quoted2 && char === '"' && line[at2 + 1] === '"') {
95482
+ for (let at4 = 0; at4 < line.length; at4 += 1) {
95483
+ const char = line[at4];
95484
+ if (quoted2 && char === '"' && line[at4 + 1] === '"') {
95266
95485
  cell += '"';
95267
- at2 += 1;
95486
+ at4 += 1;
95268
95487
  } else if (char === '"') {
95269
95488
  quoted2 = !quoted2;
95270
95489
  } else if (char === "," && !quoted2) {
@@ -95329,11 +95548,11 @@ feed_draft_missing when a card points at a draft without its text; fix it, or pa
95329
95548
  to post it as written.`;
95330
95549
  var FEED_NO_BODY = "feed cards have no body: put the point in the title and one --summary line, text to send in --draft, sources in --link";
95331
95550
  function pairOf({ value, flag: flag2 }) {
95332
- const at2 = value.indexOf("=");
95333
- if (at2 <= 0 || at2 === value.length - 1) {
95551
+ const at4 = value.indexOf("=");
95552
+ if (at4 <= 0 || at4 === value.length - 1) {
95334
95553
  throw new Error(`--${flag2} takes <label>=<value>, got "${value}"`);
95335
95554
  }
95336
- return [value.slice(0, at2), value.slice(at2 + 1)];
95555
+ return [value.slice(0, at4), value.slice(at4 + 1)];
95337
95556
  }
95338
95557
  function sourceOf(value) {
95339
95558
  return value.startsWith("@") && value.length > 1 ? { file: value.slice(1) } : { text: value };
@@ -95434,6 +95653,31 @@ function feedFlagsOf({ args }) {
95434
95653
  return { fields: { ...fields, ...snoozeOf(args) }, texts, ...rich ? { rich } : {} };
95435
95654
  }
95436
95655
 
95656
+ // src/rules/feed-thread-format.rules.ts
95657
+ function whenOf(entry2) {
95658
+ return `${entry2.createdAt.slice(0, 16).replace("T", " ")} UTC`;
95659
+ }
95660
+ function lineOf4({ item, entry: entry2 }) {
95661
+ const own2 = item.author.kind === "agent" && entry2.author.id === item.author.id;
95662
+ const who = own2 ? `You (${entry2.author.name})` : entry2.author.name;
95663
+ const said = entry2.kind === "action" ? `pressed ${entry2.body}` : entry2.body;
95664
+ const [first = "", ...rest] = said.split("\n");
95665
+ return [` ${who}, ${whenOf(entry2)}: ${first}`, ...rest.map((line) => ` ${line}`)].join("\n");
95666
+ }
95667
+ function feedReadLinesOf(read4) {
95668
+ const { item } = read4;
95669
+ const parts = [];
95670
+ if (item.summary) parts.push(`Hint: ${item.summary}`);
95671
+ if (item.body) parts.push(`Body:
95672
+ ${item.body}`);
95673
+ const entries = item.entries.toSorted((a, b) => a.createdAt.localeCompare(b.createdAt));
95674
+ parts.push(
95675
+ entries.length === 0 ? "Thread: no comments yet." : ["Thread, oldest first:", ...entries.map((entry2) => lineOf4({ item, entry: entry2 }))].join("\n")
95676
+ );
95677
+ return `${parts.join("\n")}
95678
+ `;
95679
+ }
95680
+
95437
95681
  // src/services/feed-files.service.ts
95438
95682
  async function directWith({ client, to }) {
95439
95683
  const me = await client.get("/api/agents/me");
@@ -95703,9 +95947,11 @@ async function feedRead({ context, args }) {
95703
95947
  const { client } = await signedIn({ context, args });
95704
95948
  const read4 = await client.post("/api/feed/items/read", { itemId });
95705
95949
  printItem({ context, args, item: read4 });
95706
- if (!args.flags.json && read4.item.draft) context.out(`Draft:
95950
+ if (args.flags.json) return;
95951
+ if (read4.item.draft) context.out(`Draft:
95707
95952
  ${read4.item.draft}
95708
95953
  `);
95954
+ context.out(feedReadLinesOf(read4));
95709
95955
  }
95710
95956
  async function feedInbox({ context, args }) {
95711
95957
  const { client } = await signedIn({ context, args });
@@ -95754,8 +96000,8 @@ function optionalWords(words) {
95754
96000
  }
95755
96001
  function shareLinesOf({ move: move3, answer: answer6 }) {
95756
96002
  const names = answer6.people.map((person) => person.name).join(", ") || "no one new";
95757
- const count8 = answer6.itemIds.length;
95758
- const items = `${count8} item${count8 === 1 ? "" : "s"}`;
96003
+ const count10 = answer6.itemIds.length;
96004
+ const items = `${count10} item${count10 === 1 ? "" : "s"}`;
95759
96005
  const head = move3 === "share" ? `Shared ${items} with ${names}` : `Took ${names} off ${items}`;
95760
96006
  return [head, ...answer6.itemIds].map((line) => `${line}
95761
96007
  `).join("");
@@ -95915,10 +96161,10 @@ async function ranksOf({
95915
96161
  const [itemId, priority] = args.words.slice(2);
95916
96162
  const named = itemId && priority ? [`${itemId}=${priority}`] : [];
95917
96163
  return [...named, ...args.lists.set ?? []].map((pair) => {
95918
- const at2 = pair.indexOf("=");
95919
- if (at2 < 1) throw new CliUsageError(USAGE11);
96164
+ const at4 = pair.indexOf("=");
96165
+ if (at4 < 1) throw new CliUsageError(USAGE11);
95920
96166
  try {
95921
- return { itemId: pair.slice(0, at2), priority: rankOf(pair.slice(at2 + 1)) };
96167
+ return { itemId: pair.slice(0, at4), priority: rankOf(pair.slice(at4 + 1)) };
95922
96168
  } catch (error63) {
95923
96169
  throw new CliUsageError(error63 instanceof Error ? error63.message : String(error63));
95924
96170
  }
@@ -96266,8 +96512,8 @@ function peopleOf({ args }) {
96266
96512
  if (people2.length > 0) return people2;
96267
96513
  return one ? [one] : [];
96268
96514
  }
96269
- function wordAt6({ args, at: at2 }) {
96270
- const word3 = args.words[at2];
96515
+ function wordAt6({ args, at: at4 }) {
96516
+ const word3 = args.words[at4];
96271
96517
  if (!word3) throw new CliUsageError(USAGE12);
96272
96518
  return word3;
96273
96519
  }
@@ -96386,13 +96632,13 @@ function formatHistory(output2) {
96386
96632
  const lines2 = linesOf3(output2);
96387
96633
  if (lines2.length === 0) return `${where}${from}: no messages.
96388
96634
  `;
96389
- const count8 = lines2.length === 1 ? "1 message" : `${lines2.length} messages`;
96635
+ const count10 = lines2.length === 1 ? "1 message" : `${lines2.length} messages`;
96390
96636
  const blocks = lines2.map(blockOf2).join("\n\n");
96391
96637
  const cursor = olderCursorOf(output2);
96392
96638
  const older = cursor ? `
96393
96639
 
96394
96640
  Older: laze history ${output2.channel} --before ${cursor}` : "";
96395
- return `${where}${from}: ${count8}, oldest first
96641
+ return `${where}${from}: ${count10}, oldest first
96396
96642
 
96397
96643
  ${blocks}${older}
96398
96644
  `;
@@ -96478,7 +96724,7 @@ function money2({ amount, currency: currency2 }) {
96478
96724
  return `${currency2.toUpperCase()} ${Number(amount.toFixed(2))}`;
96479
96725
  }
96480
96726
  function inviteQuoteText(quote4) {
96481
- const at2 = (amount) => money2({ amount, currency: quote4.currency });
96727
+ const at4 = (amount) => money2({ amount, currency: quote4.currency });
96482
96728
  const people2 = `${quote4.peopleAfter} ${quote4.peopleAfter === 1 ? "person" : "people"}`;
96483
96729
  const seats = quote4.freeSeatsLeft ? ` ${quote4.freeSeatsLeft} free ${quote4.freeSeatsLeft === 1 ? "seat" : "seats"} left.` : "";
96484
96730
  if (quote4.plan === "free" && !quote4.upgradeNeeded) {
@@ -96488,11 +96734,11 @@ function inviteQuoteText(quote4) {
96488
96734
  return `Your plan holds ${quote4.seatCap} people, at no charge.
96489
96735
  `;
96490
96736
  }
96491
- const price = `${at2(quote4.monthlyAfter)} a month for ${people2} (${at2(quote4.perPersonAfter)} per person).${seats}`;
96737
+ const price = `${at4(quote4.monthlyAfter)} a month for ${people2} (${at4(quote4.perPersonAfter)} per person).${seats}`;
96492
96738
  if (quote4.upgradeNeeded)
96493
96739
  return `Team: ${price} This starts Team, paid through Stripe Checkout.
96494
96740
  `;
96495
- const change2 = quote4.monthlyAfter === quote4.monthlyNow ? "No change to your price." : `Was ${at2(quote4.monthlyNow)}; the change is prorated as each person joins.`;
96741
+ const change2 = quote4.monthlyAfter === quote4.monthlyNow ? "No change to your price." : `Was ${at4(quote4.monthlyNow)}; the change is prorated as each person joins.`;
96496
96742
  return `New price: ${price} ${change2}
96497
96743
  `;
96498
96744
  }
@@ -97044,7 +97290,7 @@ var KEYS_USAGE = `Usage:
97044
97290
  laze keys revoke <id> --any revoke any key of the workspace (admins)`;
97045
97291
  var printJson8 = (context, data) => context.out(`${JSON.stringify(data, null, 2)}
97046
97292
  `);
97047
- var lastUsed = (at2) => at2 ? `last used ${at2}` : "never used";
97293
+ var lastUsed = (at4) => at4 ? `last used ${at4}` : "never used";
97048
97294
  async function mine3({ context, args }) {
97049
97295
  const { client } = await signedIn({ context, args });
97050
97296
  const keys2 = await client.get("/api/api-keys/mine");
@@ -97324,8 +97570,8 @@ var MACHINE_ACCESS_USAGE = [
97324
97570
  " laze machine grant|revoke <machine> --member <userId> | --agent <agentId> share it or stop (owner)",
97325
97571
  " laze machine budget <machine> <usd> [--period day|week|month] its spend cap (owner)"
97326
97572
  ].join("\n");
97327
- function wordAt7({ args, at: at2 }) {
97328
- const value = args.words[at2];
97573
+ function wordAt7({ args, at: at4 }) {
97574
+ const value = args.words[at4];
97329
97575
  if (!value) throw new CliUsageError(`Usage:
97330
97576
  ${MACHINE_ACCESS_USAGE}`);
97331
97577
  return value;
@@ -97603,10 +97849,10 @@ ${USAGE13}`);
97603
97849
  if ("exitCode" in released) return released;
97604
97850
  Object.assign(env, released.env);
97605
97851
  }
97606
- const count8 = Object.keys(env).length;
97607
- if (count8 > EXEC_ENV_MAX) {
97852
+ const count10 = Object.keys(env).length;
97853
+ if (count10 > EXEC_ENV_MAX) {
97608
97854
  context.err(
97609
- `laze: these connections hold ${count8} variables; at most ${EXEC_ENV_MAX} go with a command. Send fewer connections, or run the command with \`laze vault run\` where you run.
97855
+ `laze: these connections hold ${count10} variables; at most ${EXEC_ENV_MAX} go with a command. Send fewer connections, or run the command with \`laze vault run\` where you run.
97610
97856
  `
97611
97857
  );
97612
97858
  return { exitCode: 1 };
@@ -97761,7 +98007,7 @@ function secretRefusal({
97761
98007
  rules = MCP_SECRET_COMMANDS
97762
98008
  }) {
97763
98009
  const { words, flags: flags2 } = parseArgs({ argv });
97764
- const command = [3, 2, 1].map((count8) => words.slice(0, count8).join(" ")).find((name3) => Object.hasOwn(rules, name3));
98010
+ const command = [3, 2, 1].map((count10) => words.slice(0, count10).join(" ")).find((name3) => Object.hasOwn(rules, name3));
97765
98011
  const rule = command === void 0 ? void 0 : rules[command];
97766
98012
  if (!command || !rule) return void 0;
97767
98013
  const vaultFlag = rule.vaultFlag ?? "from-vault";
@@ -98512,11 +98758,11 @@ async function monitorAdd({ context, args }) {
98512
98758
  });
98513
98759
  if (args.flags.json) return context.out(`${JSON.stringify(added, null, 2)}
98514
98760
  `);
98515
- const count8 = added.watching.length;
98761
+ const count10 = added.watching.length;
98516
98762
  context.out(
98517
98763
  `${added.monitor.id} ${added.monitor.name}
98518
98764
  ${added.watching.join(" ")}
98519
- Watching ${count8} ${count8 === 1 ? "channel" : "channels"}
98765
+ Watching ${count10} ${count10 === 1 ? "channel" : "channels"}
98520
98766
  `
98521
98767
  );
98522
98768
  }
@@ -100252,6 +100498,124 @@ var viewDefinition = external_exports.object({
100252
100498
  });
100253
100499
  var hostLoadViewSchema = viewDefinition;
100254
100500
 
100501
+ // ../../modules/rum/contract/src/browser-trace-reads.ts
100502
+ var browserSessionIdSchema = external_exports.string().regex(/^[0-9a-f]{32}$/, "a session id: 32 hex characters");
100503
+ var at3 = external_exports.iso.datetime();
100504
+ var browserErrorDefinition = external_exports.object({
100505
+ at: at3,
100506
+ traceId: external_exports.string(),
100507
+ spanId: external_exports.string(),
100508
+ sessionId: external_exports.string().nullable(),
100509
+ /** console, window or unhandledrejection. */
100510
+ source: external_exports.string().nullable(),
100511
+ /** Scrubbed by the page and again here, capped at 300 characters; untrusted text. */
100512
+ message: external_exports.string(),
100513
+ /** `file:line` per frame, at most 10. */
100514
+ frames: external_exports.array(external_exports.string()),
100515
+ uiRoute: external_exports.string().nullable(),
100516
+ /** The page build's `service.version`. */
100517
+ release: external_exports.string().nullable(),
100518
+ service: external_exports.string().nullable()
100519
+ });
100520
+ var browserErrorSchema = browserErrorDefinition;
100521
+ var sessionSpanDefinition = external_exports.object({
100522
+ at: at3,
100523
+ durationMs: external_exports.number().nonnegative(),
100524
+ traceId: external_exports.string(),
100525
+ spanId: external_exports.string(),
100526
+ name: external_exports.string().nullable(),
100527
+ kind: external_exports.string().nullable(),
100528
+ status: external_exports.string().nullable(),
100529
+ uiRoute: external_exports.string().nullable(),
100530
+ httpRoute: external_exports.string().nullable(),
100531
+ method: external_exports.string().nullable(),
100532
+ statusCode: external_exports.number().int().nullable(),
100533
+ /** The request's path: no host, query string or fragment, share links as `/share/:id`. */
100534
+ path: external_exports.string().nullable()
100535
+ });
100536
+ var sessionSpanSchema = sessionSpanDefinition;
100537
+
100538
+ // ../../modules/rum/contract/src/rum.api.ts
100539
+ var RumApi = moduleApi()("rum");
100540
+
100541
+ // ../../packages/secrets/src/secret.ts
100542
+ var SecretHandle = class {
100543
+ constructor(id4, optional2, schema) {
100544
+ this.id = id4;
100545
+ this.optional = optional2;
100546
+ this.schema = schema;
100547
+ }
100548
+ id;
100549
+ optional;
100550
+ schema;
100551
+ };
100552
+ var SecretFamilyHandle = class extends SecretHandle {
100553
+ family = true;
100554
+ constructor(prefix) {
100555
+ super(prefix, true, void 0);
100556
+ }
100557
+ };
100558
+ function load(id4, options) {
100559
+ return new SecretHandle(id4, options?.optional === true, options?.schema);
100560
+ }
100561
+ function family(prefix) {
100562
+ return new SecretFamilyHandle(prefix);
100563
+ }
100564
+ var Secret = { load, family };
100565
+
100566
+ // ../../packages/secrets/src/shared-secrets.ts
100567
+ var sessionSecret = Secret.load("NEXTAUTH_SECRET", { optional: true });
100568
+ var credentialsSecret = Secret.load("CREDENTIALS_SECRET", { optional: true });
100569
+ var credentialsSecretPrevious = Secret.load("CREDENTIALS_SECRET_PREVIOUS", {
100570
+ optional: true
100571
+ });
100572
+ var gatewayInternalSecret = Secret.load("LW_GATEWAY_INTERNAL_SECRET", { optional: true });
100573
+ var virtualKeyPepper = Secret.load("LW_VIRTUAL_KEY_PEPPER", { optional: true });
100574
+ var telemetryExporterHeaders = Secret.load("OTEL_EXPORTER_OTLP_HEADERS", {
100575
+ optional: true
100576
+ });
100577
+ var openAiApiKey = Secret.load("OPENAI_API_KEY", { optional: true });
100578
+ var internalSlackSignupsWebhook = Secret.load("SLACK_CHANNEL_SIGNUPS", { optional: true });
100579
+ var signInProviderSecrets = {
100580
+ googleClientSecret: Secret.load("GOOGLE_CLIENT_SECRET", { optional: true }),
100581
+ githubClientSecret: Secret.load("GITHUB_CLIENT_SECRET", { optional: true }),
100582
+ gitlabClientSecret: Secret.load("GITLAB_CLIENT_SECRET", { optional: true }),
100583
+ azureAdClientSecret: Secret.load("AZURE_AD_CLIENT_SECRET", { optional: true }),
100584
+ auth0ClientSecret: Secret.load("AUTH0_CLIENT_SECRET", { optional: true }),
100585
+ oktaClientSecret: Secret.load("OKTA_CLIENT_SECRET", { optional: true }),
100586
+ cognitoClientSecret: Secret.load("COGNITO_CLIENT_SECRET", { optional: true }),
100587
+ oneLoginClientSecret: Secret.load("ONELOGIN_CLIENT_SECRET", { optional: true }),
100588
+ oidcClientSecret: Secret.load("OIDC_CLIENT_SECRET", { optional: true })
100589
+ };
100590
+
100591
+ // ../../modules/rum/contract/src/rum.config.ts
100592
+ var blankIsUnset2 = (value) => value === "" ? void 0 : value;
100593
+ var ON_SPELLING = /^(1|true|on|yes)$/i;
100594
+ var OFF_SPELLING = /^(0|false|off|no)$/i;
100595
+ var rumConfig = Config.define((c) => ({
100596
+ browserTracing: c.env(
100597
+ "LAZE_BROWSER_TRACING",
100598
+ external_exports.string().optional().transform((value) => {
100599
+ if (value === void 0 || value.trim() === "") return void 0;
100600
+ if (ON_SPELLING.test(value.trim())) return true;
100601
+ return OFF_SPELLING.test(value.trim()) ? false : void 0;
100602
+ })
100603
+ ),
100604
+ sampleRatio: c.env(
100605
+ "LAZE_BROWSER_TRACING_SAMPLE_RATIO",
100606
+ external_exports.preprocess(blankIsUnset2, external_exports.coerce.number().min(0).max(1).default(1).catch(1))
100607
+ ),
100608
+ telemetryEndpoint: telemetryExporterEndpoint,
100609
+ /** Tempo's HTTP API, which the ops reads of browser errors and sessions search. */
100610
+ tempoUrl: c.env("LAZE_TEMPO_URL", external_exports.url().default("http://127.0.0.1:6651"))
100611
+ }));
100612
+ var rumBrowserConfigDefinition = external_exports.strictObject({
100613
+ /** Whether the page starts tracing and exports to `/api/rum/v1/traces`. */
100614
+ browserTracing: external_exports.boolean(),
100615
+ /** Share of visits recorded; the collector samples the rest of the way. */
100616
+ sampleRatio: external_exports.number().min(0).max(1)
100617
+ });
100618
+
100255
100619
  // ../../modules/ops/contract/src/ops-functions.ts
100256
100620
  var OPS_FUNCTION = {
100257
100621
  /** Functions one lease may name. */
@@ -100310,12 +100674,12 @@ var funnelInputDefinition = external_exports.object({
100310
100674
  to: external_exports.iso.datetime(),
100311
100675
  bucketMinutes: external_exports.union([external_exports.literal(10), external_exports.literal(60), external_exports.literal(1440)]).default(60)
100312
100676
  }).strict();
100313
- var count7 = external_exports.number().int().nonnegative();
100677
+ var count9 = external_exports.number().int().nonnegative();
100314
100678
  var funnelCountsDefinition = external_exports.object({
100315
- signUps: count7,
100316
- workspaces: count7,
100317
- activatedTeams: count7,
100318
- payingTeams: count7
100679
+ signUps: count9,
100680
+ workspaces: count9,
100681
+ activatedTeams: count9,
100682
+ payingTeams: count9
100319
100683
  });
100320
100684
  var funnelOutputDefinition = external_exports.object({
100321
100685
  bucketMinutes: external_exports.number().int(),
@@ -100341,23 +100705,23 @@ var cohortOutputDefinition = external_exports.object({
100341
100705
  promotionId: external_exports.string().nullable(),
100342
100706
  plan: external_exports.string(),
100343
100707
  paying: external_exports.boolean(),
100344
- members: count7,
100708
+ members: count9,
100345
100709
  agents: external_exports.object({
100346
- laze: count7,
100347
- connected: count7,
100710
+ laze: count9,
100711
+ connected: count9,
100348
100712
  firstLazeAgentAt: external_exports.iso.datetime().nullable()
100349
100713
  }),
100350
- turns: count7,
100351
- appsCreated: count7,
100352
- connectionsLinked: count7,
100714
+ turns: count9,
100715
+ appsCreated: count9,
100716
+ connectionsLinked: count9,
100353
100717
  creatorLastMessageAt: external_exports.iso.datetime().nullable(),
100354
100718
  /** Live messages per UTC day; days with none are left out. */
100355
100719
  days: external_exports.array(
100356
100720
  external_exports.object({
100357
100721
  day: external_exports.string(),
100358
- byPeople: count7,
100359
- byAgents: count7,
100360
- people: count7
100722
+ byPeople: count9,
100723
+ byAgents: count9,
100724
+ people: count9
100361
100725
  })
100362
100726
  ),
100363
100727
  /** The once-only sends nurturing kept (first_agent_made, first_agent_nudge, ...). */
@@ -100381,25 +100745,25 @@ var capacityOutputDefinition = external_exports.object({
100381
100745
  /** The last day of host load, oldest first. */
100382
100746
  history: external_exports.array(hostLoadPointSchema)
100383
100747
  });
100384
- var tally = external_exports.array(external_exports.object({ key: external_exports.string(), count: count7 }));
100748
+ var tally = external_exports.array(external_exports.object({ key: external_exports.string(), count: count9 }));
100385
100749
  var snapshotOutputDefinition = external_exports.object({
100386
100750
  workspaceId: external_exports.string(),
100387
100751
  createdAt: external_exports.iso.datetime(),
100388
100752
  plan: external_exports.string(),
100389
100753
  status: external_exports.string(),
100390
- seats: external_exports.object({ people: count7, limit: external_exports.number().int().nullable() }),
100754
+ seats: external_exports.object({ people: count9, limit: external_exports.number().int().nullable() }),
100391
100755
  membersByRole: tally,
100392
100756
  invitesByStatus: tally,
100393
100757
  agentsByKind: tally,
100394
100758
  agentsByHosting: tally,
100395
- agentsConnected: count7,
100759
+ agentsConnected: count9,
100396
100760
  flagsOn: external_exports.array(external_exports.string()),
100397
- complimentaryComputers: count7
100761
+ complimentaryComputers: count9
100398
100762
  });
100399
100763
  var eventsInputDefinition = external_exports.object({ from: external_exports.iso.datetime(), to: external_exports.iso.datetime() }).strict();
100400
100764
  var eventCountsDefinition = external_exports.object({
100401
- total: count7,
100402
- byType: external_exports.array(external_exports.object({ eventType: external_exports.string(), count: count7 }))
100765
+ total: count9,
100766
+ byType: external_exports.array(external_exports.object({ eventType: external_exports.string(), count: count9 }))
100403
100767
  });
100404
100768
  var tenantEventsInputDefinition = external_exports.object({
100405
100769
  from: external_exports.iso.datetime(),
@@ -100428,9 +100792,9 @@ var databaseHealthDefinition = external_exports.object({
100428
100792
  deadlocks: external_exports.number().nonnegative(),
100429
100793
  tempBytes: external_exports.number().nonnegative(),
100430
100794
  connections: external_exports.object({
100431
- total: count7,
100432
- byState: external_exports.array(external_exports.object({ state: external_exports.string(), count: count7 })),
100433
- waitingOnLocks: count7,
100795
+ total: count9,
100796
+ byState: external_exports.array(external_exports.object({ state: external_exports.string(), count: count9 })),
100797
+ waitingOnLocks: count9,
100434
100798
  longestActiveSeconds: external_exports.number().nonnegative(),
100435
100799
  longestIdleInTransactionSeconds: external_exports.number().nonnegative()
100436
100800
  }),
@@ -100461,7 +100825,7 @@ var tenantAgentsDefinition = external_exports.object({
100461
100825
  createdAt: external_exports.iso.datetime(),
100462
100826
  modelLevel: external_exports.string().nullable(),
100463
100827
  model: external_exports.string().nullable(),
100464
- channels: count7,
100828
+ channels: count9,
100465
100829
  limitedUntil: external_exports.iso.datetime().nullable(),
100466
100830
  limitedBy: external_exports.string().nullable(),
100467
100831
  pausedAt: external_exports.iso.datetime().nullable(),
@@ -100510,8 +100874,8 @@ var tenantBillingDefinition = external_exports.object({
100510
100874
  currency: external_exports.string(),
100511
100875
  cancelAtPeriodEnd: external_exports.boolean(),
100512
100876
  period: external_exports.object({ start: external_exports.iso.datetime(), end: external_exports.iso.datetime() }).nullable(),
100513
- seats: external_exports.object({ people: count7, limit: count7.nullable(), monthlyPrice: external_exports.number() }),
100514
- complimentarySeats: count7.nullable(),
100877
+ seats: external_exports.object({ people: count9, limit: count9.nullable(), monthlyPrice: external_exports.number() }),
100878
+ complimentarySeats: count9.nullable(),
100515
100879
  credits: external_exports.object({
100516
100880
  included: external_exports.number(),
100517
100881
  includedLeft: external_exports.number(),
@@ -100550,14 +100914,14 @@ var tenantVaultDefinition = external_exports.object({
100550
100914
  external_exports.object({
100551
100915
  subject: external_exports.string(),
100552
100916
  most: external_exports.string(),
100553
- maxLeaseSeconds: count7.nullable(),
100917
+ maxLeaseSeconds: count9.nullable(),
100554
100918
  blocked: external_exports.boolean(),
100555
100919
  approveNew: external_exports.boolean(),
100556
100920
  updatedAt: external_exports.iso.datetime()
100557
100921
  })
100558
100922
  ),
100559
100923
  /** Connections waiting for an admin, counted by kind; never a name, label or field. */
100560
- waitingByKind: external_exports.array(external_exports.object({ key: external_exports.string(), count: count7 }))
100924
+ waitingByKind: external_exports.array(external_exports.object({ key: external_exports.string(), count: count9 }))
100561
100925
  });
100562
100926
  var WHATSAPP_INTAKE_KEY_KINDS = ["msg", "edit", "del", "react", "read"];
100563
100927
  var tenantWhatsappInputDefinition = external_exports.object({
@@ -100570,10 +100934,21 @@ var tenantWhatsappOutputDefinition = external_exports.object({
100570
100934
  intake: external_exports.object({
100571
100935
  since: external_exports.iso.datetime(),
100572
100936
  until: external_exports.iso.datetime(),
100573
- total: count7,
100574
- byKind: external_exports.array(external_exports.object({ kind: external_exports.enum([...WHATSAPP_INTAKE_KEY_KINDS, "other"]), count: count7 }))
100937
+ total: count9,
100938
+ byKind: external_exports.array(
100939
+ external_exports.object({
100940
+ kind: external_exports.enum([...WHATSAPP_INTAKE_KEY_KINDS, "other"]),
100941
+ count: count9,
100942
+ /** Events dated over a second after Laze got them, and the most ahead: a fast clock. */
100943
+ aheadOfLaze: external_exports.object({ count: count9, maxAheadMs: external_exports.number().int() }).optional()
100944
+ })
100945
+ )
100575
100946
  })
100576
100947
  });
100948
+ var whatsappSendsInputDefinition = external_exports.object({
100949
+ since: external_exports.iso.datetime(),
100950
+ limit: external_exports.number().int().min(1).max(100).default(20)
100951
+ }).strict();
100577
100952
  var wakeTimelineInputDefinition = external_exports.object({
100578
100953
  userId: external_exports.string().trim().min(1).max(64).optional(),
100579
100954
  limit: external_exports.number().int().min(1).max(50).default(10)
@@ -100599,6 +100974,32 @@ var judgeMeasureOutputDefinition = external_exports.object({
100599
100974
  thresholds: vaultJudgeMeasureSchema.shape.thresholds,
100600
100975
  keys: pageOf(vaultJudgeMeasureSchema.shape.keys.element)
100601
100976
  });
100977
+ var vaultAsksInputDefinition = external_exports.object({
100978
+ from: external_exports.iso.datetime(),
100979
+ to: external_exports.iso.datetime(),
100980
+ agentId: external_exports.string().trim().min(1).max(128).optional(),
100981
+ limit: external_exports.number().int().min(1).max(500).default(100),
100982
+ cursor: cursorDefinition.optional()
100983
+ }).strict();
100984
+ var vaultAsksOutputDefinition = external_exports.object({ asks: pageOf(vaultOpsAskSchema) });
100985
+ var browserErrorsInputDefinition = external_exports.object({
100986
+ from: external_exports.iso.datetime(),
100987
+ to: external_exports.iso.datetime(),
100988
+ /** Keeps errors whose message holds this, ignoring case. */
100989
+ message: external_exports.string().trim().min(1).max(200).optional(),
100990
+ sessionId: browserSessionIdSchema.optional(),
100991
+ limit: external_exports.number().int().min(1).max(500).default(100),
100992
+ cursor: cursorDefinition.optional()
100993
+ }).strict();
100994
+ var browserErrorsOutputDefinition = external_exports.object({ errors: pageOf(browserErrorSchema) });
100995
+ var sessionSpansInputDefinition = external_exports.object({
100996
+ from: external_exports.iso.datetime(),
100997
+ to: external_exports.iso.datetime(),
100998
+ sessionId: browserSessionIdSchema,
100999
+ limit: external_exports.number().int().min(1).max(500).default(200),
101000
+ cursor: cursorDefinition.optional()
101001
+ }).strict();
101002
+ var sessionSpansOutputDefinition = external_exports.object({ spans: pageOf(sessionSpanSchema) });
100602
101003
  var entry = (value) => value;
100603
101004
  var OPS_FUNCTIONS = {
100604
101005
  "workspaces.find": entry({
@@ -100707,6 +101108,27 @@ var OPS_FUNCTIONS = {
100707
101108
  input: tenantWhatsappInputDefinition,
100708
101109
  output: tenantWhatsappOutputDefinition
100709
101110
  }),
101111
+ "tenant.slack": entry({
101112
+ title: "One workspace's Slack mirrors: bot, cache window and thread gaps as counts",
101113
+ scope: "tenant",
101114
+ view: "table",
101115
+ input: noInputDefinition,
101116
+ output: slackMirrorHealthSchema
101117
+ }),
101118
+ "tenant.vault_asks": entry({
101119
+ title: "One workspace's vault approval cards over a range: state, decider, joins and times",
101120
+ scope: "tenant",
101121
+ view: "table",
101122
+ input: vaultAsksInputDefinition,
101123
+ output: vaultAsksOutputDefinition
101124
+ }),
101125
+ "tenant.whatsapp_sends": entry({
101126
+ title: "One workspace's last WhatsApp sends: state, failure code and times, no content",
101127
+ scope: "tenant",
101128
+ view: "table",
101129
+ input: whatsappSendsInputDefinition,
101130
+ output: whatsappSendsSchema
101131
+ }),
100710
101132
  "computers.wake_timeline": entry({
100711
101133
  title: "One workspace's last WhatsApp wakes per computer, with each step's time",
100712
101134
  scope: "tenant",
@@ -100728,6 +101150,21 @@ var OPS_FUNCTIONS = {
100728
101150
  input: judgeMeasureInputDefinition,
100729
101151
  output: judgeMeasureOutputDefinition
100730
101152
  }),
101153
+ "traces.browser_errors": entry({
101154
+ title: "Browser errors over a range: message, frames, route, release and session",
101155
+ scope: "platform",
101156
+ view: "table",
101157
+ input: browserErrorsInputDefinition,
101158
+ output: browserErrorsOutputDefinition,
101159
+ scrubbedText: ["message"]
101160
+ }),
101161
+ "traces.session_spans": entry({
101162
+ title: "One browser session's spans over a range: names, routes, status codes and times",
101163
+ scope: "platform",
101164
+ view: "table",
101165
+ input: sessionSpansInputDefinition,
101166
+ output: sessionSpansOutputDefinition
101167
+ }),
100731
101168
  "tenant.snapshot": entry({
100732
101169
  title: "One workspace's plan, members, agents and flags, as counts",
100733
101170
  scope: "tenant",
@@ -100794,11 +101231,11 @@ function typedArg(text3) {
100794
101231
  }
100795
101232
  function argsOf({ args }) {
100796
101233
  const pairs = (args.lists.arg ?? []).map((pair) => {
100797
- const at2 = pair.indexOf("=");
100798
- if (at2 < 1) throw new CliUsageError(`--arg takes name=value.
101234
+ const at4 = pair.indexOf("=");
101235
+ if (at4 < 1) throw new CliUsageError(`--arg takes name=value.
100799
101236
  ${OPERATOR_KEY_USAGE}`);
100800
- const text3 = pair.slice(at2 + 1);
100801
- return [pair.slice(0, at2), typedArg(text3)];
101237
+ const text3 = pair.slice(at4 + 1);
101238
+ return [pair.slice(0, at4), typedArg(text3)];
100802
101239
  });
100803
101240
  return Object.fromEntries(pairs);
100804
101241
  }
@@ -101195,14 +101632,14 @@ var CHECK_WAIT_TRIES = 30;
101195
101632
  function timingOf(args) {
101196
101633
  const cron = flagText({ args, name: "cron" });
101197
101634
  const rrule = flagText({ args, name: "rrule" });
101198
- const at2 = flagText({ args, name: "at" });
101199
- const given = [cron, rrule, at2].filter(Boolean);
101635
+ const at4 = flagText({ args, name: "at" });
101636
+ const given = [cron, rrule, at4].filter(Boolean);
101200
101637
  if (given.length !== 1)
101201
101638
  throw new CliUsageError(`Give exactly one of --cron, --rrule or --at.
101202
101639
  ${USAGE17}`);
101203
101640
  if (cron) return { kind: "cron", cron };
101204
101641
  if (rrule) return { kind: "rrule", rrule };
101205
- return { kind: "once", at: at2 };
101642
+ return { kind: "once", at: at4 };
101206
101643
  }
101207
101644
  function printSchedule({ context, schedule: schedule2 }) {
101208
101645
  const next = schedule2.nextFireAt ? `next ${schedule2.nextFireAt}` : "no next fire";
@@ -102310,11 +102747,11 @@ function bareLineOf({ line, where }) {
102310
102747
  if (VARIABLE.test(line)) return { kind: "field", variable: line, ref: line };
102311
102748
  throw new CliUsageError(`${where}: not a name: ${line}`);
102312
102749
  }
102313
- function lineOf4({ line, where }) {
102314
- const at2 = line.indexOf("=");
102315
- if (at2 === -1) return bareLineOf({ line, where });
102316
- const variable = line.slice(0, at2).trim();
102317
- const value = line.slice(at2 + 1).trim();
102750
+ function lineOf5({ line, where }) {
102751
+ const at4 = line.indexOf("=");
102752
+ if (at4 === -1) return bareLineOf({ line, where });
102753
+ const variable = line.slice(0, at4).trim();
102754
+ const value = line.slice(at4 + 1).trim();
102318
102755
  if (!VARIABLE.test(variable)) {
102319
102756
  throw new CliUsageError(`${where}: not a variable name: ${variable}`);
102320
102757
  }
@@ -102327,7 +102764,7 @@ function parseManifest({ text: text3, file: file4 }) {
102327
102764
  for (const [index, raw] of text3.split(/\r?\n/).entries()) {
102328
102765
  const line = raw.trim().replace(/^export\s+/, "");
102329
102766
  if (!line || line.startsWith("#")) continue;
102330
- lines2.push(lineOf4({ line, where: `${file4}:${index + 1}` }));
102767
+ lines2.push(lineOf5({ line, where: `${file4}:${index + 1}` }));
102331
102768
  }
102332
102769
  return lines2;
102333
102770
  }
@@ -102598,12 +103035,12 @@ The reason comes from --reason, else KV_REASON or LAZE_VAULT_REASON: set it on e
102598
103035
  helm or terraform command, which reach this through credential_process.`;
102599
103036
  function withWaitSeconds(args) {
102600
103037
  if (args.flags.wait !== true) return args;
102601
- const at2 = args.words.findLastIndex((word3, index) => index >= 2 && /^\d+$/.test(word3));
102602
- if (at2 === -1) return args;
103038
+ const at4 = args.words.findLastIndex((word3, index) => index >= 2 && /^\d+$/.test(word3));
103039
+ if (at4 === -1) return args;
102603
103040
  return {
102604
103041
  ...args,
102605
- words: args.words.filter((_, index) => index !== at2),
102606
- flags: { ...args.flags, wait: args.words[at2] ?? "" }
103042
+ words: args.words.filter((_, index) => index !== at4),
103043
+ flags: { ...args.flags, wait: args.words[at4] ?? "" }
102607
103044
  };
102608
103045
  }
102609
103046
  function reasonOf({ context, args }) {
@@ -102793,9 +103230,9 @@ function execProviderIds({ request: request2 }) {
102793
103230
  return Array.isArray(ids) ? ids.filter((id4) => typeof id4 === "string") : [];
102794
103231
  }
102795
103232
  function splitExecId({ id: id4 }) {
102796
- const at2 = id4.indexOf("#");
102797
- if (at2 === -1) return { connection: id4 };
102798
- return { connection: id4.slice(0, at2), field: id4.slice(at2 + 1) };
103233
+ const at4 = id4.indexOf("#");
103234
+ if (at4 === -1) return { connection: id4 };
103235
+ return { connection: id4.slice(0, at4), field: id4.slice(at4 + 1) };
102799
103236
  }
102800
103237
  function valueOf({
102801
103238
  fields,
@@ -102937,9 +103374,9 @@ async function vaultSave({ context, args }) {
102937
103374
  }
102938
103375
 
102939
103376
  // src/services/vault-scrub-commands.service.ts
102940
- function lineOf5(channel) {
103377
+ function lineOf6(channel) {
102941
103378
  const where = channel.name ? `#${channel.name}` : channel.channelId;
102942
- const found = Object.entries(channel.found).map(([vendor, count8]) => `${vendor} ${count8}`).join(", ");
103379
+ const found = Object.entries(channel.found).map(([vendor, count10]) => `${vendor} ${count10}`).join(", ");
102943
103380
  const kinds = [`held ${channel.held}`, ...found ? [`found: ${found}`] : []].join("; ");
102944
103381
  return `${where} scanned ${channel.scanned} changed ${channel.messages} ${kinds}
102945
103382
  `;
@@ -102951,7 +103388,7 @@ async function vaultScrub({ context, args }) {
102951
103388
  if (args.flags.json) return context.out(`${JSON.stringify(report3, null, 2)}
102952
103389
  `);
102953
103390
  const changed = report3.channels.filter((channel) => channel.messages > 0);
102954
- for (const channel of changed) context.out(lineOf5(channel));
103391
+ for (const channel of changed) context.out(lineOf6(channel));
102955
103392
  const total = changed.reduce((sum, channel) => sum + channel.messages, 0);
102956
103393
  context.out(
102957
103394
  report3.dryRun ? `Dry run: ${total} message(s) would change. Nothing was changed.
@@ -103628,8 +104065,8 @@ var USAGE20 = [
103628
104065
  "With no machine it is the WhatsApp linked on your (or your agent's owner's) Laze computer.",
103629
104066
  "A chat is its id, a phone number or a contact or group name."
103630
104067
  ].join("\n");
103631
- function word2({ args, at: at2 }) {
103632
- const value = args.words[at2];
104068
+ function word2({ args, at: at4 }) {
104069
+ const value = args.words[at4];
103633
104070
  if (!value) throw new CliUsageError(USAGE20);
103634
104071
  return value;
103635
104072
  }
@@ -103929,8 +104366,8 @@ async function roles({ context, args }) {
103929
104366
  const catalogue = await client.get("/api/roles");
103930
104367
  if (args.flags.json) return printJson11(context, catalogue);
103931
104368
  for (const role2 of catalogue) {
103932
- const count8 = `${role2.permissions.length} permissions`;
103933
- context.out(`${role2.label} ${count8} ${role2.description}
104369
+ const count10 = `${role2.permissions.length} permissions`;
104370
+ context.out(`${role2.label} ${count10} ${role2.description}
103934
104371
  `);
103935
104372
  context.out(` ${role2.permissions.join(", ")}
103936
104373
  `);
@@ -104040,10 +104477,10 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
104040
104477
  laze groups rename <group> <name> | delete <group> rename one, or delete it and take back what it shared (admins)
104041
104478
  laze groups add|remove <group> --person <member>.. change who is in it (admins)
104042
104479
  laze channels list the conversations you are in, with your setting
104043
- laze channel set <channel> everything|mentions what of a channel reaches your agent
104044
- laze channel mute <channel> --reason "<why>" [--for 30m|2h|1d] stop hearing a noisy channel unless named (agents)
104045
- laze channel unmute <channel> hear the channel on your setting again (agents)
104046
- laze channel settings [<channel>] [--json] each channel's setting and mute (agents)
104480
+ laze channel set <channel> everything|mentions what of a channel or shared conversation (3+ members, by id) reaches your agent
104481
+ laze channel mute <channel> --reason "<why>" [--for 30m|2h|1d] stop hearing a noisy channel or conversation unless named (agents)
104482
+ laze channel unmute <channel> hear the channel or conversation on your setting again (agents)
104483
+ laze channel settings [<channel>] [--json] each channel's and shared conversation's setting and mute; a 1:1 DM always reaches you (agents)
104047
104484
  laze monitor add <name> --channel '#x-*' --prompt '<what to do>' [--from anyone|people|slack] [--not-from bots] [--thread roots-only] [--matches '<re>'] a turn on each new matching message (agents)
104048
104485
  laze monitor list | pause | resume | rm <name> [--json] the agent's monitors
104049
104486
  laze channel members <channel> its people and agents, each an Admin or a Member
@@ -104188,7 +104625,7 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
104188
104625
  laze vault grant|share|lend|grants|ungrant|leases|end-lease|limits|set-limit sharing, leases, limits
104189
104626
  laze vault audit|activity|most-asked|approvals|judge|devices what happened (audit: admins)
104190
104627
  laze vault every laze vault command, with its flags
104191
- laze connect suggest <service|domain|url> --reason "<why>" a connect card for whoever asked (agents)
104628
+ laze connect suggest <service|domain|url> --reason "<why>" a connect card for your owner (agents)
104192
104629
  When a person asks for something in a service that is not connected, run
104193
104630
  laze connect suggest yourself (a name, the vendor's domain or its MCP URL); never ask for
104194
104631
  passwords or keys in chat, never ask a person to run a command: the card signs in or takes the key