@lazehq/cli 0.1.138 → 0.1.139

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 +737 -244
  2. package/package.json +1 -1
package/dist/laze.mjs CHANGED
@@ -12915,8 +12915,8 @@ var require_client_h2 = __commonJS({
12915
12915
  }
12916
12916
  this[kClient][kOnError](err);
12917
12917
  }
12918
- function onHttp2FrameError(type, code4, id8) {
12919
- if (id8 === 0) {
12918
+ function onHttp2FrameError(type, code4, id9) {
12919
+ if (id9 === 0) {
12920
12920
  if (this[kReceivedGoAway]) {
12921
12921
  return;
12922
12922
  }
@@ -31077,15 +31077,15 @@ ${value}`;
31077
31077
  pos = 0;
31078
31078
  }
31079
31079
  }
31080
- discardLeadingBytes(count14) {
31081
- while (count14 > 0 && this.lineChunkIndex < this.chunks.length) {
31080
+ discardLeadingBytes(count16) {
31081
+ while (count16 > 0 && this.lineChunkIndex < this.chunks.length) {
31082
31082
  const chunk = this.chunks[this.lineChunkIndex];
31083
31083
  const remaining = chunk.length - this.linePos;
31084
- if (count14 < remaining) {
31085
- this.linePos += count14;
31086
- count14 = 0;
31084
+ if (count16 < remaining) {
31085
+ this.linePos += count16;
31086
+ count16 = 0;
31087
31087
  } else {
31088
- count14 -= remaining;
31088
+ count16 -= remaining;
31089
31089
  this.lineChunkIndex++;
31090
31090
  this.linePos = 0;
31091
31091
  }
@@ -31675,8 +31675,8 @@ function holdsKeyRun(word3) {
31675
31675
  }
31676
31676
  function withoutLazeIds(text3) {
31677
31677
  let held = false;
31678
- const rest = text3.replace(LAZE_ID_INSIDE, (id8) => {
31679
- if (!isLazeId(id8)) return id8;
31678
+ const rest = text3.replace(LAZE_ID_INSIDE, (id9) => {
31679
+ if (!isLazeId(id9)) return id9;
31680
31680
  held = true;
31681
31681
  return "/";
31682
31682
  });
@@ -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 count14 of counts.values()) {
31838
- const p = count14 / sample.length;
31837
+ for (const count16 of counts.values()) {
31838
+ const p = count16 / sample.length;
31839
31839
  entropy -= p * Math.log2(p);
31840
31840
  }
31841
31841
  return entropy;
@@ -34733,8 +34733,8 @@ function queryTimeZone(rawTimeZoneId) {
34733
34733
  }
34734
34734
  var queryTimeZoneRecord = /* @__PURE__ */ memoize((normTimeZoneId, record5) => "named" === record5.kind ? new IntlTimeZone(normTimeZoneId, record5.m, record5.format) : new FixedTimeZone(normTimeZoneId, record5.m, "fixed" === record5.kind ? record5.X : 0));
34735
34735
  var FixedTimeZone = class {
34736
- constructor(id8, compareKey, offsetNano) {
34737
- this.id = id8, this.m = compareKey, this.X = offsetNano;
34736
+ constructor(id9, compareKey, offsetNano) {
34737
+ this.id = id9, this.m = compareKey, this.X = offsetNano;
34738
34738
  }
34739
34739
  B() {
34740
34740
  return this.X;
@@ -34746,8 +34746,8 @@ var FixedTimeZone = class {
34746
34746
  }
34747
34747
  };
34748
34748
  var IntlTimeZone = class {
34749
- constructor(id8, compareKey, format2) {
34750
- this.id = id8, this.m = compareKey, this.ke = ((computeOffsetSec, periodDays) => {
34749
+ constructor(id9, compareKey, format2) {
34750
+ this.id = id9, this.m = compareKey, this.ke = ((computeOffsetSec, periodDays) => {
34751
34751
  const getSample = memoize(computeOffsetSec);
34752
34752
  const getSplit = memoize(createSplitTuple);
34753
34753
  const periodSec = 86400 * periodDays;
@@ -34829,7 +34829,7 @@ var IntlTimeZone = class {
34829
34829
  })(format2), ((timeZoneId) => {
34830
34830
  const timeZoneName = timeZoneId.split("/").pop();
34831
34831
  return timeZonePeriodDaysByName[timeZoneName] || 60;
34832
- })(id8));
34832
+ })(id9));
34833
34833
  }
34834
34834
  B(epochNano) {
34835
34835
  return this.ke.we(((epochNano2) => epochNanoToSecMod(epochNano2)[0])(epochNano)) * nanoInSec2;
@@ -36970,7 +36970,7 @@ function shadowedLinkLineOf({ shadow }) {
36970
36970
  }
36971
36971
 
36972
36972
  // src/rules/cli-version.rules.ts
36973
- var STAMPED = "0.1.138";
36973
+ var STAMPED = "0.1.139";
36974
36974
  function cliVersionOf({ stamped = STAMPED } = {}) {
36975
36975
  return stamped.startsWith("__") ? "dev" : stamped;
36976
36976
  }
@@ -37545,6 +37545,7 @@ var SWITCHES = /* @__PURE__ */ new Set([
37545
37545
  "resend",
37546
37546
  "replace",
37547
37547
  "reset",
37548
+ "take-back",
37548
37549
  "ask",
37549
37550
  "real-value"
37550
37551
  ]);
@@ -38856,14 +38857,14 @@ function codePointLength(str) {
38856
38857
  const units = str.length;
38857
38858
  if (!highSurrogate.test(str))
38858
38859
  return units;
38859
- let count14 = units;
38860
+ let count16 = units;
38860
38861
  for (let i = 0; i < units - 1; i++) {
38861
38862
  if ((str.charCodeAt(i) & 64512) === 55296 && (str.charCodeAt(i + 1) & 64512) === 56320) {
38862
- count14--;
38863
+ count16--;
38863
38864
  i++;
38864
38865
  }
38865
38866
  }
38866
- return count14;
38867
+ return count16;
38867
38868
  }
38868
38869
  function getLengthableOrigin(input2) {
38869
38870
  if (Array.isArray(input2))
@@ -41221,15 +41222,15 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
41221
41222
  const syms = normalized.symbolKeys;
41222
41223
  const doc = new Doc(["payload", "ctx"], { shape, inst, memo: memo2, syms });
41223
41224
  const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
41224
- const prefixStr = (id8, k) => `
41225
- let ${id8}_ab = false;
41226
- for (let i = 0; i < ${id8}.issues.length; i++) {
41227
- const iss = ${id8}.issues[i];
41225
+ const prefixStr = (id9, k) => `
41226
+ let ${id9}_ab = false;
41227
+ for (let i = 0; i < ${id9}.issues.length; i++) {
41228
+ const iss = ${id9}.issues[i];
41228
41229
  iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
41229
41230
  payload.issues.push(iss);
41230
- if (iss.continue !== true) ${id8}_ab = true;
41231
+ if (iss.continue !== true) ${id9}_ab = true;
41231
41232
  }
41232
- if (${id8}_ab && ctx && ctx.abortEarly) {
41233
+ if (${id9}_ab && ctx && ctx.abortEarly) {
41233
41234
  payload.value = newResult;
41234
41235
  return payload;
41235
41236
  }`;
@@ -41243,34 +41244,34 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
41243
41244
  for (const key of normalized.allKeys) {
41244
41245
  if (key === "__proto__")
41245
41246
  continue;
41246
- const id8 = ids[key];
41247
+ const id9 = ids[key];
41247
41248
  const k = typeof key === "symbol" ? `syms[${syms.indexOf(key)}]` : esc(key);
41248
41249
  const isPresent = `${k} in input`;
41249
41250
  const schema = shape[key];
41250
41251
  const optin = schema?._zod?.optin;
41251
41252
  const isOptionalIn = optin !== void 0;
41252
41253
  const isOptionalOut = schema?._zod?.optout === "optional";
41253
- doc.write(`const ${id8} = ${parseStr(k)};`);
41254
+ doc.write(`const ${id9} = ${parseStr(k)};`);
41254
41255
  if (isOptionalIn && isOptionalOut) {
41255
- const assign = optin === "optional" ? `${id8}_present` : `${id8}.value !== undefined || ${id8}_present`;
41256
+ const assign = optin === "optional" ? `${id9}_present` : `${id9}.value !== undefined || ${id9}_present`;
41256
41257
  doc.write(`
41257
- const ${id8}_present = ${isPresent};
41258
- if (!${id8}.issues.length || ${id8}_present) {
41259
- if (${id8}.issues.length) {${prefixStr(id8, k)}
41258
+ const ${id9}_present = ${isPresent};
41259
+ if (!${id9}.issues.length || ${id9}_present) {
41260
+ if (${id9}.issues.length) {${prefixStr(id9, k)}
41260
41261
  }
41261
41262
 
41262
41263
  if (${assign}) {
41263
- newResult[${k}] = ${id8}.value;
41264
+ newResult[${k}] = ${id9}.value;
41264
41265
  }
41265
41266
  }
41266
41267
 
41267
41268
  `);
41268
41269
  } else if (!isOptionalIn) {
41269
41270
  doc.write(`
41270
- const ${id8}_present = ${isPresent};
41271
- if (${id8}.issues.length) {${prefixStr(id8, k)}
41271
+ const ${id9}_present = ${isPresent};
41272
+ if (${id9}.issues.length) {${prefixStr(id9, k)}
41272
41273
  }
41273
- if (!${id8}_present && !${id8}.issues.length) {
41274
+ if (!${id9}_present && !${id9}.issues.length) {
41274
41275
  payload.issues.push({
41275
41276
  code: "invalid_type",
41276
41277
  expected: "nonoptional",
@@ -41283,22 +41284,22 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
41283
41284
  }
41284
41285
  }
41285
41286
 
41286
- if (${id8}_present) {
41287
- newResult[${k}] = ${id8}.value;
41287
+ if (${id9}_present) {
41288
+ newResult[${k}] = ${id9}.value;
41288
41289
  }
41289
41290
 
41290
41291
  `);
41291
41292
  } else {
41292
41293
  doc.write(`
41293
- if (${id8}.issues.length) {${prefixStr(id8, k)}
41294
+ if (${id9}.issues.length) {${prefixStr(id9, k)}
41294
41295
  }
41295
41296
  `);
41296
41297
  if (optin === "defaulted") {
41297
- doc.write(`newResult[${k}] = ${id8}.value;`);
41298
+ doc.write(`newResult[${k}] = ${id9}.value;`);
41298
41299
  } else {
41299
41300
  doc.write(`
41300
- if (${id8}.value !== undefined || ${isPresent}) {
41301
- newResult[${k}] = ${id8}.value;
41301
+ if (${id9}.value !== undefined || ${isPresent}) {
41302
+ newResult[${k}] = ${id9}.value;
41302
41303
  }
41303
41304
  `);
41304
41305
  }
@@ -43218,8 +43219,8 @@ function az_default() {
43218
43219
  }
43219
43220
 
43220
43221
  // ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/be.js
43221
- function getBelarusianPlural(count14, one, few, many) {
43222
- const absCount = Math.abs(count14);
43222
+ function getBelarusianPlural(count16, one, few, many) {
43223
+ const absCount = Math.abs(count16);
43223
43224
  const lastDigit = absCount % 10;
43224
43225
  const lastTwoDigits = absCount % 100;
43225
43226
  if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
@@ -45866,8 +45867,8 @@ function hu_default() {
45866
45867
  }
45867
45868
 
45868
45869
  // ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hy.js
45869
- function getArmenianPlural(count14, one, many) {
45870
- return Math.abs(count14) === 1 ? one : many;
45870
+ function getArmenianPlural(count16, one, many) {
45871
+ return Math.abs(count16) === 1 ? one : many;
45871
45872
  }
45872
45873
  function withDefiniteArticle(word3) {
45873
45874
  if (!word3)
@@ -48605,8 +48606,8 @@ function ro_default() {
48605
48606
  }
48606
48607
 
48607
48608
  // ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ru.js
48608
- function getRussianPlural(count14, one, few, many) {
48609
- const absCount = Math.abs(count14);
48609
+ function getRussianPlural(count16, one, few, many) {
48610
+ const absCount = Math.abs(count16);
48610
48611
  const lastDigit = absCount % 10;
48611
48612
  const lastTwoDigits = absCount % 100;
48612
48613
  if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
@@ -53316,26 +53317,26 @@ function extractDefs(ctx, schema) {
53316
53317
  return;
53317
53318
  const idToSchema = /* @__PURE__ */ new Map();
53318
53319
  for (const entry2 of ctx.seen.entries()) {
53319
- const id8 = ctx.metadataRegistry.get(entry2[0])?.id;
53320
- if (id8) {
53321
- const existing = idToSchema.get(id8);
53320
+ const id9 = ctx.metadataRegistry.get(entry2[0])?.id;
53321
+ if (id9) {
53322
+ const existing = idToSchema.get(id9);
53322
53323
  if (existing && existing !== entry2[0]) {
53323
- throw new Error(`Duplicate schema id "${id8}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
53324
+ throw new Error(`Duplicate schema id "${id9}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
53324
53325
  }
53325
- idToSchema.set(id8, entry2[0]);
53326
+ idToSchema.set(id9, entry2[0]);
53326
53327
  }
53327
53328
  }
53328
53329
  const makeURI = (entry2) => {
53329
53330
  const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
53330
53331
  if (ctx.external) {
53331
53332
  const externalId = ctx.external.registry.get(entry2[0])?.id;
53332
- const uriGenerator = ctx.external.uri ?? ((id9) => id9);
53333
+ const uriGenerator = ctx.external.uri ?? ((id10) => id10);
53333
53334
  if (externalId) {
53334
53335
  return { ref: uriGenerator(externalId) };
53335
53336
  }
53336
- const id8 = entry2[1].defId ?? entry2[1].schema.id ?? `schema${ctx.counter++}`;
53337
- entry2[1].defId = id8;
53338
- return { defId: id8, ref: `${uriGenerator("__shared")}#/${defsSegment}/${encodeJSONPointerSegment(id8)}` };
53337
+ const id9 = entry2[1].defId ?? entry2[1].schema.id ?? `schema${ctx.counter++}`;
53338
+ entry2[1].defId = id9;
53339
+ return { defId: id9, ref: `${uriGenerator("__shared")}#/${defsSegment}/${encodeJSONPointerSegment(id9)}` };
53339
53340
  }
53340
53341
  const uriPrefix = `#`;
53341
53342
  const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
@@ -53383,8 +53384,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
53383
53384
  continue;
53384
53385
  }
53385
53386
  }
53386
- const id8 = ctx.metadataRegistry.get(entry2[0])?.id;
53387
- if (id8) {
53387
+ const id9 = ctx.metadataRegistry.get(entry2[0])?.id;
53388
+ if (id9) {
53388
53389
  extractToDef(entry2);
53389
53390
  continue;
53390
53391
  }
@@ -53617,10 +53618,10 @@ function finalize(ctx, schema) {
53617
53618
  } else {
53618
53619
  }
53619
53620
  if (ctx.external?.uri) {
53620
- const id8 = ctx.external.registry.get(schema)?.id;
53621
- if (!id8)
53621
+ const id9 = ctx.external.registry.get(schema)?.id;
53622
+ if (!id9)
53622
53623
  throw new Error("Schema is missing an `id` property");
53623
- result2.$id = ctx.external.uri(id8);
53624
+ result2.$id = ctx.external.uri(id9);
53624
53625
  }
53625
53626
  assignProps(result2, root.defId ? root.schema : root.def ?? root.schema);
53626
53627
  const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
@@ -54226,7 +54227,7 @@ function stringifyKeyNames(bySchema, json7, visited) {
54226
54227
  const values = json7.enum ?? (json7.const !== void 0 ? [json7.const] : void 0);
54227
54228
  if (!numericType && !values?.some((v) => typeof v === "number"))
54228
54229
  return json7;
54229
- const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format: format2, id: id8, ...rest } = json7;
54230
+ const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format: format2, id: id9, ...rest } = json7;
54230
54231
  if (rest.enum)
54231
54232
  rest.enum = rest.enum.map((v) => typeof v === "number" ? String(v) : v);
54232
54233
  else if (typeof rest.const === "number")
@@ -58108,12 +58109,12 @@ var isHex = new Uint8Array([
58108
58109
  1,
58109
58110
  1
58110
58111
  ]);
58111
- function isValidHex(id8, length) {
58112
- if (typeof id8 !== "string" || id8.length !== length)
58112
+ function isValidHex(id9, length) {
58113
+ if (typeof id9 !== "string" || id9.length !== length)
58113
58114
  return false;
58114
58115
  let r = 0;
58115
- for (let i = 0; i < id8.length; i += 4) {
58116
- r += (isHex[id8.charCodeAt(i)] | 0) + (isHex[id8.charCodeAt(i + 1)] | 0) + (isHex[id8.charCodeAt(i + 2)] | 0) + (isHex[id8.charCodeAt(i + 3)] | 0);
58116
+ for (let i = 0; i < id9.length; i += 4) {
58117
+ r += (isHex[id9.charCodeAt(i)] | 0) + (isHex[id9.charCodeAt(i + 1)] | 0) + (isHex[id9.charCodeAt(i + 2)] | 0) + (isHex[id9.charCodeAt(i + 3)] | 0);
58117
58118
  }
58118
58119
  return r === length;
58119
58120
  }
@@ -59564,7 +59565,7 @@ var ModuleApiToken = class _ModuleApiToken extends FeatureApiIdentity {
59564
59565
  };
59565
59566
  function moduleApi(name3) {
59566
59567
  if (name3 === void 0) {
59567
- return (id8) => ModuleApiToken.create(id8);
59568
+ return (id9) => ModuleApiToken.create(id9);
59568
59569
  }
59569
59570
  return ModuleApiToken.create(name3);
59570
59571
  }
@@ -62065,15 +62066,15 @@ function clustersIn({
62065
62066
  const out = [];
62066
62067
  let current3 = null;
62067
62068
  for (let index = segment.start; index <= segment.end; index += 1) {
62068
- const count14 = flagged[index] ?? 0;
62069
- if (count14 === 0) continue;
62069
+ const count16 = flagged[index] ?? 0;
62070
+ if (count16 === 0) continue;
62070
62071
  if (current3 && index - current3.end - 1 <= REDACTED_BLOCK_MAX_GAP) {
62071
62072
  current3.end = index;
62072
- current3.values += count14;
62073
+ current3.values += count16;
62073
62074
  continue;
62074
62075
  }
62075
62076
  if (current3) out.push(current3);
62076
- current3 = { start: index, end: index, values: count14 };
62077
+ current3 = { start: index, end: index, values: count16 };
62077
62078
  }
62078
62079
  if (current3) out.push(current3);
62079
62080
  return out;
@@ -62113,7 +62114,7 @@ function redactedBlocksAt({
62113
62114
  }
62114
62115
  const blocks = redactedBlocks({ lines: lines2, flagged });
62115
62116
  const inside = (line) => blocks.some((block2) => line >= block2.start && line <= block2.end);
62116
- const values = flagged.reduce((sum, count14, line) => inside(line) ? sum + count14 : sum, 0);
62117
+ const values = flagged.reduce((sum, count16, line) => inside(line) ? sum + count16 : sum, 0);
62117
62118
  return { values, insideAt: (offset) => inside(lineAt(offset)) };
62118
62119
  }
62119
62120
 
@@ -69257,7 +69258,7 @@ var NAMING_FREE_CLI_COMMANDS = [
69257
69258
  ];
69258
69259
  var NAMING_IS_SILENT = "Naming or renaming a conversation is silent: never post a message about it.";
69259
69260
  function namingReminderTextOf({ channelIds }) {
69260
- const lines2 = channelIds.map((id8) => ` laze conversation rename ${id8} "<a few words>"`);
69261
+ const lines2 = channelIds.map((id9) => ` laze conversation rename ${id9} "<a few words>"`);
69261
69262
  return [
69262
69263
  "Your new conversation has no name yet. Name it in a few words that say what it is about:",
69263
69264
  ...lines2,
@@ -74347,10 +74348,10 @@ function whereOf(message2) {
74347
74348
  }
74348
74349
  function catchUpLinesOf(message2) {
74349
74350
  if (!message2.catchUp) return [];
74350
- const { count: count14, older } = message2.catchUp;
74351
+ const { count: count16, older } = message2.catchUp;
74351
74352
  const where = whereOf(message2);
74352
74353
  const lines2 = [
74353
- `${count14} ${count14 === 1 ? "message" : "messages"} in ${where} while you were away.`
74354
+ `${count16} ${count16 === 1 ? "message" : "messages"} in ${where} while you were away.`
74354
74355
  ];
74355
74356
  if (older === 0) return lines2;
74356
74357
  const channel = message2.channelKind === "public" || message2.channelKind === "private";
@@ -74378,9 +74379,9 @@ function hookContextOf({
74378
74379
  messages,
74379
74380
  self: self2
74380
74381
  }) {
74381
- const count14 = messages.length === 1 ? "A message" : `${messages.length} messages`;
74382
+ const count16 = messages.length === 1 ? "A message" : `${messages.length} messages`;
74382
74383
  return [
74383
- `${count14} reached you in Laze${selfClauseOf({ self: self2 })}:`,
74384
+ `${count16} reached you in Laze${selfClauseOf({ self: self2 })}:`,
74384
74385
  "",
74385
74386
  ...messages.map((message2) => formatInboxMessage({ message: message2 })),
74386
74387
  "",
@@ -75382,10 +75383,10 @@ var DURATION = /^(\d+)\s*(m|min|mins|minutes?|h|hours?|d|days?)$/i;
75382
75383
  function minutesOf({ text: text3 }) {
75383
75384
  const match = DURATION.exec(text3.trim());
75384
75385
  if (!match?.[1] || !match[2]) return null;
75385
- const count14 = Number(match[1]);
75386
+ const count16 = Number(match[1]);
75386
75387
  const unit = match[2].toLowerCase()[0];
75387
75388
  const perUnit = { d: 1440, h: 60, m: 1 };
75388
- const minutes = count14 * (perUnit[unit ?? "m"] ?? 1);
75389
+ const minutes = count16 * (perUnit[unit ?? "m"] ?? 1);
75389
75390
  return minutes > 0 ? minutes : null;
75390
75391
  }
75391
75392
  function muteTextOf({ mute }) {
@@ -75468,17 +75469,17 @@ function bodyAsText({
75468
75469
  body,
75469
75470
  mentions
75470
75471
  }) {
75471
- const actorName = (kind2, id8) => mentions.actors.find((actor) => actor.kind === kind2 && actor.id === id8)?.name ?? kind2;
75472
+ const actorName = (kind2, id9) => mentions.actors.find((actor) => actor.kind === kind2 && actor.id === id9)?.name ?? kind2;
75472
75473
  const written = withSlackMarkupAsText(body);
75473
75474
  let text3 = "";
75474
75475
  let from = 0;
75475
75476
  for (const token2 of written.matchAll(TOKEN)) {
75476
- const [whole, kind2, id8, broadcast, channelId] = token2;
75477
+ const [whole, kind2, id9, broadcast, channelId] = token2;
75477
75478
  text3 += plain2(written.slice(from, token2.index));
75478
75479
  from = token2.index + whole.length;
75479
75480
  if (channelId) {
75480
75481
  text3 += `#${mentions.channels.find((channel) => channel.id === channelId)?.name ?? "channel"}`;
75481
- } else if (kind2 && id8) text3 += `@${actorName(kind2, id8)}`;
75482
+ } else if (kind2 && id9) text3 += `@${actorName(kind2, id9)}`;
75482
75483
  else text3 += `@${broadcast ?? "channel"}`;
75483
75484
  }
75484
75485
  text3 += plain2(written.slice(from));
@@ -75657,12 +75658,12 @@ function rushSessionOf({
75657
75658
  parentArgs
75658
75659
  }) {
75659
75660
  if (!parentArgs) return void 0;
75660
- const [program = "", verb, action, id8] = parentArgs;
75661
- if (!program || !id8 || verb !== "host") return void 0;
75662
- return HOST_ACTIONS.has(action ?? "") ? { id: id8, program } : void 0;
75661
+ const [program = "", verb, action, id9] = parentArgs;
75662
+ if (!program || !id9 || verb !== "host") return void 0;
75663
+ return HOST_ACTIONS.has(action ?? "") ? { id: id9, program } : void 0;
75663
75664
  }
75664
- function rushSendCommand({ program, id: id8 }) {
75665
- return ["sh", "-c", 'printf "%s\\n" "$LAZE_WAKE_TEXT" | "$0" session send "$1"', program, id8];
75665
+ function rushSendCommand({ program, id: id9 }) {
75666
+ return ["sh", "-c", 'printf "%s\\n" "$LAZE_WAKE_TEXT" | "$0" session send "$1"', program, id9];
75666
75667
  }
75667
75668
  function rushListedOf({ listed }) {
75668
75669
  try {
@@ -76549,14 +76550,14 @@ async function scheduleMessage({
76549
76550
  var USAGE = "Usage: laze scheduled [--channel <channel>] [--json], laze scheduled send|cancel <id>, laze scheduled edit <id> [--text <text|->] [--at <time> [--tz <zone>]]";
76550
76551
  var EDIT_USAGE = "Usage: laze scheduled edit <id> [--text <text|->] [--at <time> [--tz <zone>]]; give the text, the time or both";
76551
76552
  async function scheduled({ context, args }) {
76552
- const [, action, id8] = args.words;
76553
+ const [, action, id9] = args.words;
76553
76554
  if (action === "send" || action === "cancel") {
76554
- if (!id8) throw new CliUsageError(USAGE);
76555
- return actOn({ context, args, action, id: id8 });
76555
+ if (!id9) throw new CliUsageError(USAGE);
76556
+ return actOn({ context, args, action, id: id9 });
76556
76557
  }
76557
76558
  if (action === "edit") {
76558
- if (!id8) throw new CliUsageError(EDIT_USAGE);
76559
- return editOne({ context, args, id: id8 });
76559
+ if (!id9) throw new CliUsageError(EDIT_USAGE);
76560
+ return editOne({ context, args, id: id9 });
76560
76561
  }
76561
76562
  if (action !== void 0) throw new CliUsageError(USAGE);
76562
76563
  const { client } = await signedIn({ context, args });
@@ -76582,14 +76583,14 @@ async function newTextOf({
76582
76583
  async function editOne({
76583
76584
  context,
76584
76585
  args,
76585
- id: id8
76586
+ id: id9
76586
76587
  }) {
76587
76588
  const at8 = scheduleAtOf({ args, usage: EDIT_USAGE });
76588
76589
  const body = await newTextOf({ context, args });
76589
76590
  if (!at8 && body === void 0) throw new CliUsageError(EDIT_USAGE);
76590
76591
  const { client } = await signedIn({ context, args });
76591
76592
  const edited = await client.post("/api/agents/me/scheduled/edit", {
76592
- scheduledId: id8,
76593
+ scheduledId: id9,
76593
76594
  ...body === void 0 ? {} : { body },
76594
76595
  ...at8 ? { sendAt: at8.sendAt } : {}
76595
76596
  });
@@ -76602,11 +76603,11 @@ async function actOn({
76602
76603
  context,
76603
76604
  args,
76604
76605
  action,
76605
- id: id8
76606
+ id: id9
76606
76607
  }) {
76607
76608
  const { client } = await signedIn({ context, args });
76608
76609
  const done = await client.post(`/api/agents/me/scheduled/${action}`, {
76609
- scheduledId: id8
76610
+ scheduledId: id9
76610
76611
  });
76611
76612
  if (args.flags.json) return context.out(`${JSON.stringify(done, null, 2)}
76612
76613
  `);
@@ -76774,7 +76775,7 @@ function leavesLazeOf({
76774
76775
  }
76775
76776
  function turnAnswersOf({ context }) {
76776
76777
  const listed = context.environment.inherited.LAZE_TURN_MESSAGES ?? "";
76777
- const answers = listed.split(",").flatMap((id8) => id8.trim() ? [id8.trim()] : []);
76778
+ const answers = listed.split(",").flatMap((id9) => id9.trim() ? [id9.trim()] : []);
76778
76779
  return answers.length > 0 ? { answers } : {};
76779
76780
  }
76780
76781
  var FILES_USAGE = "[--image <path|url|fileId>]... [--file <path|url|fileId>]... (at most 6)";
@@ -77228,7 +77229,7 @@ function rolloutEventOf({
77228
77229
  if (type === "task_complete" || type === "turn_aborted") return { kind: "ended" };
77229
77230
  const text3 = userTextOf({ parsed });
77230
77231
  if (text3 === void 0) return void 0;
77231
- const held = messageIds.filter((id8) => text3.includes(`[${id8}]`));
77232
+ const held = messageIds.filter((id9) => text3.includes(`[${id9}]`));
77232
77233
  return held.length > 0 ? { kind: "holds", messageIds: held } : void 0;
77233
77234
  }
77234
77235
 
@@ -77318,8 +77319,8 @@ var CodexTurnWatch = class _CodexTurnWatch {
77318
77319
  async #follow({ line }) {
77319
77320
  const event = rolloutEventOf({ line, messageIds: [...this.#queued.keys()] });
77320
77321
  if (event?.kind === "holds") {
77321
- const held = event.messageIds.flatMap((id8) => this.#queued.get(id8) ?? []);
77322
- for (const id8 of event.messageIds) this.#queued.delete(id8);
77322
+ const held = event.messageIds.flatMap((id9) => this.#queued.get(id9) ?? []);
77323
+ for (const id9 of event.messageIds) this.#queued.delete(id9);
77323
77324
  this.#answering = [...this.#answering, ...held];
77324
77325
  await this.#tell({ working: true });
77325
77326
  } else if (event?.kind === "ended" && this.#answering.length > 0) {
@@ -77609,8 +77610,8 @@ var answer = (status11, value) => ({
77609
77610
  headers: value === void 0 ? {} : JSON_HEADERS,
77610
77611
  body: value === void 0 ? "" : JSON.stringify(value)
77611
77612
  });
77612
- var result = (id8, value) => answer(200, { jsonrpc: "2.0", id: id8, result: value });
77613
- var error62 = (id8, code4, message2) => answer(200, { jsonrpc: "2.0", id: id8 ?? null, error: { code: code4, message: message2 } });
77613
+ var result = (id9, value) => answer(200, { jsonrpc: "2.0", id: id9, result: value });
77614
+ var error62 = (id9, code4, message2) => answer(200, { jsonrpc: "2.0", id: id9 ?? null, error: { code: code4, message: message2 } });
77614
77615
  function headerOf(headers, name3) {
77615
77616
  const found = Object.entries(headers).find(([key]) => key.toLowerCase() === name3);
77616
77617
  return found?.[1];
@@ -79474,10 +79475,10 @@ var CodexAppServer = class _CodexAppServer {
79474
79475
  return new _CodexAppServer(spawn2("codex", ["app-server"], { env, stdio: "pipe" }));
79475
79476
  }
79476
79477
  async call(method, params) {
79477
- const id8 = ++this.#nextId;
79478
+ const id9 = ++this.#nextId;
79478
79479
  const reply3 = await new Promise((resolve29) => {
79479
- this.#pending.set(id8, resolve29);
79480
- this.write({ id: id8, method, params });
79480
+ this.#pending.set(id9, resolve29);
79481
+ this.write({ id: id9, method, params });
79481
79482
  });
79482
79483
  if (reply3.error !== void 0) throw new Error(`${method}: ${JSON.stringify(reply3.error)}`);
79483
79484
  return record4(reply3.result);
@@ -79543,9 +79544,9 @@ async function newestThreadId({ codexHome }) {
79543
79544
  rollouts.map(async (file4) => ({ file: file4, at: (await stat6(join19(root, file4))).mtimeMs }))
79544
79545
  );
79545
79546
  const newest = dated.toSorted((a, b) => b.at - a.at)[0]?.file ?? "";
79546
- const id8 = /([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/.exec(newest);
79547
- if (!id8?.[1]) throw new CliUsageError("No Codex session found: pass --thread <id>.");
79548
- return id8[1];
79547
+ const id9 = /([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/.exec(newest);
79548
+ if (!id9?.[1]) throw new CliUsageError("No Codex session found: pass --thread <id>.");
79549
+ return id9[1];
79549
79550
  }
79550
79551
  function promptOf({ message: message2, self: self2 }) {
79551
79552
  return [
@@ -82255,8 +82256,8 @@ async function uploadTranscript({ context, args, client }) {
82255
82256
  args,
82256
82257
  usage: "Usage: laze agent migrate upload <migrationId>"
82257
82258
  });
82258
- const id8 = encodeURIComponent(migrationId);
82259
- const ticket = await client.get(`/api/agents/me/migrations/${id8}`);
82259
+ const id9 = encodeURIComponent(migrationId);
82260
+ const ticket = await client.get(`/api/agents/me/migrations/${id9}`);
82260
82261
  if (ticket.status === "cancelled") {
82261
82262
  throw new CliUsageError("This migration was cancelled; nothing was uploaded.");
82262
82263
  }
@@ -82275,10 +82276,10 @@ async function uploadTranscript({ context, args, client }) {
82275
82276
  maxParts: Math.min(ticket.partsMax, MIGRATION_PARTS_MAX)
82276
82277
  });
82277
82278
  const upload = { parts, truncated, redactions: redacted.redactions };
82278
- await uploadParts({ client, migrationId: id8, upload });
82279
+ await uploadParts({ client, migrationId: id9, upload });
82279
82280
  const fileName = basename6(found.path);
82280
82281
  const completed = await client.post(
82281
- `/api/agents/me/migrations/${id8}/complete`,
82282
+ `/api/agents/me/migrations/${id9}/complete`,
82282
82283
  {
82283
82284
  parts: parts.length,
82284
82285
  sha256: sha256Of({ text: parts.join("") }),
@@ -86654,7 +86655,7 @@ async function appPinsCommand({
86654
86655
  if (!channel) throw new CliUsageError(USAGE5);
86655
86656
  const client = await signed2();
86656
86657
  const order = flagText({ args, name: "order" });
86657
- const appIds = order.split(",").map((id8) => id8.trim()).filter(Boolean);
86658
+ const appIds = order.split(",").map((id9) => id9.trim()).filter(Boolean);
86658
86659
  const listed = appIds.length ? await client.post("/api/apps/pins/order", { channel, appIds }) : await client.post("/api/apps/pins", { channel });
86659
86660
  print3({ context, args, value: listed, text: pinsText({ channel, listed }) });
86660
86661
  }
@@ -87298,7 +87299,7 @@ var appWrite = async ({ context, args }) => {
87298
87299
  );
87299
87300
  }
87300
87301
  const folder = folderOf({ context, word: void 0 });
87301
- const remove10 = (flagText({ args, name: "remove" }) ?? "").split(",").map((path) => path.trim()).filter(Boolean);
87302
+ const remove11 = (flagText({ args, name: "remove" }) ?? "").split(",").map((path) => path.trim()).filter(Boolean);
87302
87303
  const files3 = await Promise.all(
87303
87304
  words.slice(2).map(async (word3) => {
87304
87305
  const path = resolve9(context.cwd, word3);
@@ -87309,7 +87310,7 @@ var appWrite = async ({ context, args }) => {
87309
87310
  return file4;
87310
87311
  })
87311
87312
  );
87312
- if (files3.length + remove10.length === 0) {
87313
+ if (files3.length + remove11.length === 0) {
87313
87314
  throw new CliUsageError("laze app write needs a file to write or --remove <path,...>");
87314
87315
  }
87315
87316
  const client = await appClient({ context, args });
@@ -87317,19 +87318,19 @@ var appWrite = async ({ context, args }) => {
87317
87318
  const { publish, ...version2 } = await client.post("/api/apps/files/write", {
87318
87319
  appId,
87319
87320
  files: files3,
87320
- remove: remove10,
87321
+ remove: remove11,
87321
87322
  message: message2
87322
87323
  });
87323
87324
  print5({
87324
87325
  context,
87325
87326
  args,
87326
87327
  value: { version: version2, app: publish.app, publish },
87327
- text: `Wrote ${version2.version.slice(0, 7)} "${version2.message}" (${files3.length} written, ${remove10.length} removed)
87328
+ text: `Wrote ${version2.version.slice(0, 7)} "${version2.message}" (${files3.length} written, ${remove11.length} removed)
87328
87329
  ` + publishLine(publish)
87329
87330
  });
87330
87331
  };
87331
87332
  function seedLine(seeded) {
87332
- const created = Object.entries(seeded.created).map(([name3, count14]) => `${count14} in ${name3}`);
87333
+ const created = Object.entries(seeded.created).map(([name3, count16]) => `${count16} in ${name3}`);
87333
87334
  const parts = [
87334
87335
  created.length ? `Loaded starter records: ${created.join(", ")}.` : "",
87335
87336
  seeded.skipped.length ? `Left ${seeded.skipped.join(", ")} as it was: it already holds records.` : ""
@@ -87655,8 +87656,8 @@ function cardLine({ choice }) {
87655
87656
  var appCard = async ({ context, args }) => {
87656
87657
  const client = await appClient({ context, args });
87657
87658
  const appId = await appIdOf({ client, args, folder: folderOf({ context, word: void 0 }) });
87658
- const count14 = Number(flagText({ args, name: "rows", fallback: "5" }));
87659
- if (!Number.isInteger(count14) || count14 < 1 || count14 > 10) {
87659
+ const count16 = Number(flagText({ args, name: "rows", fallback: "5" }));
87660
+ if (!Number.isInteger(count16) || count16 < 1 || count16 > 10) {
87660
87661
  throw new CliUsageError("--rows is a whole number from 1 to 10");
87661
87662
  }
87662
87663
  const text3 = (name3) => flagText({ args, name: name3 }) || null;
@@ -87669,7 +87670,7 @@ var appCard = async ({ context, args }) => {
87669
87670
  collection: text3("collection"),
87670
87671
  filter: flagText({ args, name: "where" }) || flagText({ args, name: "filter" }),
87671
87672
  sort: flagText({ args, name: "sort" }),
87672
- rows: count14,
87673
+ rows: count16,
87673
87674
  caption: text3("caption")
87674
87675
  }
87675
87676
  });
@@ -87850,11 +87851,11 @@ function isSubjectType(type) {
87850
87851
  }
87851
87852
  function subjectOf(word3) {
87852
87853
  const [type, ...rest] = (word3 ?? "").split(":");
87853
- const id8 = rest.join(":");
87854
- if (!isSubjectType(type) || !id8) {
87854
+ const id9 = rest.join(":");
87855
+ if (!isSubjectType(type) || !id9) {
87855
87856
  throw new CliUsageError("Name who with user:<id>, agent:<id>, channel:<id> or group:<id>");
87856
87857
  }
87857
- return { type, id: id8 };
87858
+ return { type, id: id9 };
87858
87859
  }
87859
87860
  function agentPathText(path) {
87860
87861
  if (!path) return "you cannot open the app yourself, so you cannot let it in";
@@ -89364,9 +89365,9 @@ function presenceColumns(member) {
89364
89365
  return [member.presence, `${status11.emoji} ${status11.text}`.trim() + until, ...dndColumn(member)];
89365
89366
  }
89366
89367
  function formatMembers({ detail }) {
89367
- const count14 = `${detail.members.length} ${detail.members.length === 1 ? "member" : "members"}`;
89368
+ const count16 = `${detail.members.length} ${detail.members.length === 1 ? "member" : "members"}`;
89368
89369
  const ends = detail.endsAt ? `, ends ${utcTimeOf(detail.endsAt)}` : "";
89369
- const head = `${channelLabelOf(detail)} (${detail.id}), ${count14}${ends}`;
89370
+ const head = `${channelLabelOf(detail)} (${detail.id}), ${count16}${ends}`;
89370
89371
  const rows = detail.members.map(
89371
89372
  (member) => [ROLE[member.role], member.name, member.kind, member.id, ...presenceColumns(member)].join(" ")
89372
89373
  );
@@ -89406,13 +89407,13 @@ function formatBrowsable({
89406
89407
  }) {
89407
89408
  if (channels3.length === 0) return "No channels to browse.\n";
89408
89409
  const rows = channels3.map((channel) => {
89409
- const count14 = `${channel.memberCount} ${channel.memberCount === 1 ? "member" : "members"}`;
89410
+ const count16 = `${channel.memberCount} ${channel.memberCount === 1 ? "member" : "members"}`;
89410
89411
  const marks = [
89411
89412
  channel.joined ? "joined" : "not joined",
89412
89413
  ...channel.private ? ["private"] : [],
89413
89414
  ...channel.archived ? ["archived"] : []
89414
89415
  ].join(", ");
89415
- const text3 = `#${channel.name} ${channel.id} ${count14} ${marks} ${channel.topic}`;
89416
+ const text3 = `#${channel.name} ${channel.id} ${count16} ${marks} ${channel.topic}`;
89416
89417
  return withLink({ text: text3, url: channel.url, base });
89417
89418
  });
89418
89419
  return `${rows.join("\n")}
@@ -90967,7 +90968,7 @@ var billingConfig = Config.define((c) => ({
90967
90968
  earlierTeamPriceIds: c.env(
90968
90969
  "STRIPE_PRICES_TEAM_EARLIER",
90969
90970
  external_exports.string().optional().transform(
90970
- (value) => (value ?? "").split(",").map((id8) => id8.trim()).filter(Boolean)
90971
+ (value) => (value ?? "").split(",").map((id9) => id9.trim()).filter(Boolean)
90971
90972
  )
90972
90973
  ),
90973
90974
  /** The product every top-up and auto-recharge line names; a bare line without it. */
@@ -90993,7 +90994,7 @@ var billingConfig = Config.define((c) => ({
90993
90994
  qaWorkspaceIds: c.env(
90994
90995
  "LAZE_BILLING_QA_WORKSPACES",
90995
90996
  external_exports.string().default(MAC_QA_WORKSPACE_ID).transform(
90996
- (value) => value.split(",").map((id8) => id8.trim()).filter(Boolean)
90997
+ (value) => value.split(",").map((id9) => id9.trim()).filter(Boolean)
90997
90998
  )
90998
90999
  ),
90999
91000
  /** USD per euro until the first ECB rate is stored. */
@@ -94034,11 +94035,11 @@ async function answerSupportLine({
94034
94035
  } catch {
94035
94036
  return rpc(null, { error: { code: -32700, message: "Parse error" } });
94036
94037
  }
94037
- const { id: id8, method } = request2;
94038
- if (id8 === void 0 || id8 === null) return "";
94038
+ const { id: id9, method } = request2;
94039
+ if (id9 === void 0 || id9 === null) return "";
94039
94040
  const params = recordOf3(request2.params);
94040
94041
  if (method === "initialize") {
94041
- return rpc(id8, {
94042
+ return rpc(id9, {
94042
94043
  result: {
94043
94044
  protocolVersion: typeof params.protocolVersion === "string" ? params.protocolVersion : "2025-06-18",
94044
94045
  capabilities: { tools: {} },
@@ -94046,21 +94047,21 @@ async function answerSupportLine({
94046
94047
  }
94047
94048
  });
94048
94049
  }
94049
- if (method === "ping") return rpc(id8, { result: {} });
94050
- if (method === "tools/list") return rpc(id8, { result: { tools: SUPPORT_MCP_TOOLS } });
94050
+ if (method === "ping") return rpc(id9, { result: {} });
94051
+ if (method === "tools/list") return rpc(id9, { result: { tools: SUPPORT_MCP_TOOLS } });
94051
94052
  if (method !== "tools/call") {
94052
- return rpc(id8, { error: { code: METHOD_NOT_FOUND, message: `No method ${String(method)}` } });
94053
+ return rpc(id9, { error: { code: METHOD_NOT_FOUND, message: `No method ${String(method)}` } });
94053
94054
  }
94054
94055
  const call = routeOf({ name: params.name, input: recordOf3(params.arguments) });
94055
- if (!call) return rpc(id8, { error: { code: INVALID_PARAMS, message: "Unknown tool or input" } });
94056
+ if (!call) return rpc(id9, { error: { code: INVALID_PARAMS, message: "Unknown tool or input" } });
94056
94057
  const scoped = client.withHeaders({ "x-laze-turn": turn });
94057
94058
  try {
94058
94059
  const answer6 = call.body === void 0 ? await scoped.get(call.path) : await scoped.post(call.path, call.body);
94059
- return rpc(id8, { result: { content: contentOf(answer6) } });
94060
+ return rpc(id9, { result: { content: contentOf(answer6) } });
94060
94061
  } catch (error63) {
94061
94062
  if (!(error63 instanceof LazeApiError)) throw error63;
94062
94063
  const text3 = `${error63.code}: ${error63.message}`;
94063
- return rpc(id8, { result: { content: [{ type: "text", text: text3 }], isError: true } });
94064
+ return rpc(id9, { result: { content: [{ type: "text", text: text3 }], isError: true } });
94064
94065
  }
94065
94066
  }
94066
94067
  function routeOf({
@@ -94093,8 +94094,8 @@ function contentOf(answer6) {
94093
94094
  )
94094
94095
  ];
94095
94096
  }
94096
- function rpc(id8, body) {
94097
- return JSON.stringify({ jsonrpc: "2.0", id: id8, ...body });
94097
+ function rpc(id9, body) {
94098
+ return JSON.stringify({ jsonrpc: "2.0", id: id9, ...body });
94098
94099
  }
94099
94100
 
94100
94101
  // src/services/mcp-gateway.service.ts
@@ -94265,8 +94266,8 @@ async function recheckTools({ relay: relay2, listed }) {
94265
94266
  listed.busy = true;
94266
94267
  try {
94267
94268
  listed.asked += 1;
94268
- const id8 = `laze-relist-${listed.asked}`;
94269
- const line = JSON.stringify({ jsonrpc: "2.0", id: id8, method: "tools/list" });
94269
+ const id9 = `laze-relist-${listed.asked}`;
94270
+ const line = JSON.stringify({ jsonrpc: "2.0", id: id9, method: "tools/list" });
94270
94271
  const names = toolNamesOf(await relay2.post({ line, turn }));
94271
94272
  listed.turn = turn;
94272
94273
  if (names !== null && names !== listed.names) {
@@ -94516,15 +94517,15 @@ function printGrant({ context, grant }) {
94516
94517
  var grantTo = async ({ context, args }) => {
94517
94518
  const [kind2 = "", ...rest] = flagText({ args, name: "to" }).split(":");
94518
94519
  const subject = SUBJECTS.find((one) => one === kind2);
94519
- const id8 = rest.join(":");
94520
- if (!subject || !id8) {
94520
+ const id9 = rest.join(":");
94521
+ if (!subject || !id9) {
94521
94522
  throw new CliUsageError("--to is person:<id>, group:<id>, channel:<id> or agent:<id>.");
94522
94523
  }
94523
94524
  const { client } = await signedIn({ context, args });
94524
94525
  const target = await connectionOf({ client, args, word: args.words[2] });
94525
94526
  const grant = await client.post("/api/vault/grants", {
94526
94527
  connectionId: target.id,
94527
- subject: { kind: subject, id: id8 },
94528
+ subject: { kind: subject, id: id9 },
94528
94529
  ...durationOf(args)
94529
94530
  });
94530
94531
  if (args.flags.json) return printJson4({ context, data: grant });
@@ -98247,8 +98248,8 @@ function draftFilesMissingText(names) {
98247
98248
  }
98248
98249
 
98249
98250
  // ../../modules/feed/contract/src/feed.decisions.ts
98250
- function decisionsLineOf(count14) {
98251
- return `${count14} ${count14 === 1 ? "decision" : "decisions"} waiting on you`;
98251
+ function decisionsLineOf(count16) {
98252
+ return `${count16} ${count16 === 1 ? "decision" : "decisions"} waiting on you`;
98252
98253
  }
98253
98254
 
98254
98255
  // src/rules/feed-input.rules.ts
@@ -98786,8 +98787,8 @@ function optionalWords(words) {
98786
98787
  }
98787
98788
  function shareLinesOf({ move: move3, answer: answer6 }) {
98788
98789
  const names = answer6.people.map((person) => person.name).join(", ") || "no one new";
98789
- const count14 = answer6.itemIds.length;
98790
- const items = `${count14} item${count14 === 1 ? "" : "s"}`;
98790
+ const count16 = answer6.itemIds.length;
98791
+ const items = `${count16} item${count16 === 1 ? "" : "s"}`;
98791
98792
  const head = move3 === "share" ? `Shared ${items} with ${names}` : `Took ${names} off ${items}`;
98792
98793
  return [head, ...answer6.itemIds].map((line) => `${line}
98793
98794
  `).join("");
@@ -99434,13 +99435,13 @@ function formatHistory(output2) {
99434
99435
  const lines2 = linesOf3(output2);
99435
99436
  if (lines2.length === 0) return `${where}${from}: no messages.
99436
99437
  `;
99437
- const count14 = lines2.length === 1 ? "1 message" : `${lines2.length} messages`;
99438
+ const count16 = lines2.length === 1 ? "1 message" : `${lines2.length} messages`;
99438
99439
  const blocks = lines2.map(blockOf2).join("\n\n");
99439
99440
  const cursor = olderCursorOf(output2);
99440
99441
  const older = cursor ? `
99441
99442
 
99442
99443
  Older: laze history ${output2.channel} --before ${cursor}` : "";
99443
- return `${where}${from}: ${count14}, oldest first
99444
+ return `${where}${from}: ${count16}, oldest first
99444
99445
 
99445
99446
  ${blocks}${older}
99446
99447
  `;
@@ -100074,7 +100075,7 @@ async function connect2({ context, args }) {
100074
100075
  sensitivity: sensitivity2
100075
100076
  });
100076
100077
  const { connection, relayKey } = answer6;
100077
- const rest = Object.fromEntries(Object.entries(relays).filter(([id8]) => id8 !== kept?.[0]));
100078
+ const rest = Object.fromEntries(Object.entries(relays).filter(([id9]) => id9 !== kept?.[0]));
100078
100079
  await saveMcpRelays({
100079
100080
  context,
100080
100081
  relays: {
@@ -100789,10 +100790,10 @@ ${USAGE13}`);
100789
100790
  if ("exitCode" in released) return released;
100790
100791
  Object.assign(env, released.env);
100791
100792
  }
100792
- const count14 = Object.keys(env).length;
100793
- if (count14 > EXEC_ENV_MAX) {
100793
+ const count16 = Object.keys(env).length;
100794
+ if (count16 > EXEC_ENV_MAX) {
100794
100795
  context.err(
100795
- `laze: these connections hold ${count14} variables; at most ${EXEC_ENV_MAX} go with a command. Send fewer connections, or run the command with \`laze vault run\` where you run.
100796
+ `laze: these connections hold ${count16} variables; at most ${EXEC_ENV_MAX} go with a command. Send fewer connections, or run the command with \`laze vault run\` where you run.
100796
100797
  `
100797
100798
  );
100798
100799
  return { exitCode: 1 };
@@ -100937,8 +100938,8 @@ function recordOf4(value) {
100937
100938
  function idsOf(message2) {
100938
100939
  const messages = Array.isArray(message2) ? message2 : [message2];
100939
100940
  return messages.flatMap((each) => {
100940
- const id8 = recordOf4(each).id;
100941
- return id8 === void 0 || id8 === null ? [] : [id8];
100941
+ const id9 = recordOf4(each).id;
100942
+ return id9 === void 0 || id9 === null ? [] : [id9];
100942
100943
  });
100943
100944
  }
100944
100945
  function toolResultOf({ text: text3, isError }) {
@@ -100949,7 +100950,7 @@ function secretRefusal({
100949
100950
  rules = MCP_SECRET_COMMANDS
100950
100951
  }) {
100951
100952
  const { words, flags: flags2 } = parseArgs({ argv });
100952
- const command = [3, 2, 1].map((count14) => words.slice(0, count14).join(" ")).find((name3) => Object.hasOwn(rules, name3));
100953
+ const command = [3, 2, 1].map((count16) => words.slice(0, count16).join(" ")).find((name3) => Object.hasOwn(rules, name3));
100953
100954
  const rule = command === void 0 ? void 0 : rules[command];
100954
100955
  if (!command || !rule) return void 0;
100955
100956
  const vaultFlag = rule.vaultFlag ?? "from-vault";
@@ -101002,9 +101003,9 @@ function refusedLines2({
101002
101003
  const migrated = status11 === 401 ? migratedNoticeOf(apiErrorOf({ status: status11, text: text3 })) : void 0;
101003
101004
  const refused = status11 === 401 ? "Laze refused this key: run `laze login` or link the agent again" : `Laze answered ${status11}`;
101004
101005
  const reason2 = migrated?.notice ?? refused;
101005
- const errors = idsOf(message2).map((id8) => ({
101006
+ const errors = idsOf(message2).map((id9) => ({
101006
101007
  jsonrpc: "2.0",
101007
- id: id8,
101008
+ id: id9,
101008
101009
  error: { code: SERVER_REFUSED, message: reason2 }
101009
101010
  }));
101010
101011
  if (errors.length === 0) return [];
@@ -101290,7 +101291,7 @@ function logTarget({
101290
101291
  const layer = flagText({ args, name: "layer", fallback: "person" });
101291
101292
  if (layer !== "person" && layer !== "agent") throw new CliUsageError(USAGE14);
101292
101293
  const channel = turn ? flagText({ args, name: "channel" }) : turnChannel({ context, args });
101293
- const messages = (context.environment.inherited.LAZE_TURN_MESSAGES ?? "").split(",").map((id8) => id8.trim()).filter(Boolean);
101294
+ const messages = (context.environment.inherited.LAZE_TURN_MESSAGES ?? "").split(",").map((id9) => id9.trim()).filter(Boolean);
101294
101295
  const message2 = flagText({ args, name: "message" }) || messages.at(-1) || "";
101295
101296
  const person = flagText({ args, name: "person" });
101296
101297
  return {
@@ -101346,9 +101347,9 @@ async function logCall({
101346
101347
  printAnswer2({ context, args, answer: answer6 });
101347
101348
  }
101348
101349
  function entryId(args) {
101349
- const id8 = Number((args.words[2] ?? "").replace(/^#/, ""));
101350
- if (!Number.isInteger(id8) || id8 < 0) throw new CliUsageError(USAGE14);
101351
- return id8;
101350
+ const id9 = Number((args.words[2] ?? "").replace(/^#/, ""));
101351
+ if (!Number.isInteger(id9) || id9 < 0) throw new CliUsageError(USAGE14);
101352
+ return id9;
101352
101353
  }
101353
101354
  function blockArg(args) {
101354
101355
  const block2 = (args.words[2] ?? "").replace(/^#/, "");
@@ -101360,9 +101361,9 @@ async function memoryNote({ context, args }) {
101360
101361
  await logCall({ context, args, path: "note", body: line });
101361
101362
  }
101362
101363
  async function memoryCorrect({ context, args }) {
101363
- const id8 = entryId(args);
101364
+ const id9 = entryId(args);
101364
101365
  const line = await taggedLine({ context, args, from: 3 });
101365
- await logCall({ context, args, path: "correct", body: { id: id8, ...line } });
101366
+ await logCall({ context, args, path: "correct", body: { id: id9, ...line } });
101366
101367
  }
101367
101368
  async function memoryRemove({ context, args }) {
101368
101369
  await logCall({ context, args, path: "remove", body: { id: entryId(args) } });
@@ -101700,11 +101701,11 @@ async function monitorAdd({ context, args }) {
101700
101701
  });
101701
101702
  if (args.flags.json) return context.out(`${JSON.stringify(added, null, 2)}
101702
101703
  `);
101703
- const count14 = added.watching.length;
101704
+ const count16 = added.watching.length;
101704
101705
  context.out(
101705
101706
  `${added.monitor.id} ${added.monitor.name}
101706
101707
  ${added.watching.join(" ")}
101707
- Watching ${count14} ${count14 === 1 ? "channel" : "channels"}
101708
+ Watching ${count16} ${count16 === 1 ? "channel" : "channels"}
101708
101709
  `
101709
101710
  );
101710
101711
  }
@@ -101934,7 +101935,7 @@ var connectLocal = async ({ context, args, client, url: url2 }) => {
101934
101935
  ...label3 && { label: label3 }
101935
101936
  });
101936
101937
  const { connection, relayKey } = answer6;
101937
- const rest = Object.fromEntries(Object.entries(relays).filter(([id8]) => id8 !== kept?.[0]));
101938
+ const rest = Object.fromEntries(Object.entries(relays).filter(([id9]) => id9 !== kept?.[0]));
101938
101939
  await saveRelays({
101939
101940
  context,
101940
101941
  relays: { ...rest, [connection.id]: { url: url2, relayKey, gatewayUrl: gatewayUrl2, label: connection.label } }
@@ -102957,8 +102958,8 @@ var RumApi = moduleApi()("rum");
102957
102958
 
102958
102959
  // ../../packages/secrets/src/secret.ts
102959
102960
  var SecretHandle = class {
102960
- constructor(id8, optional2, schema) {
102961
- this.id = id8;
102961
+ constructor(id9, optional2, schema) {
102962
+ this.id = id9;
102962
102963
  this.optional = optional2;
102963
102964
  this.schema = schema;
102964
102965
  }
@@ -102972,8 +102973,8 @@ var SecretFamilyHandle = class extends SecretHandle {
102972
102973
  super(prefix2, true, void 0);
102973
102974
  }
102974
102975
  };
102975
- function load(id8, options) {
102976
- return new SecretHandle(id8, options?.optional === true, options?.schema);
102976
+ function load(id9, options) {
102977
+ return new SecretHandle(id9, options?.optional === true, options?.schema);
102977
102978
  }
102978
102979
  function family(prefix2) {
102979
102980
  return new SecretFamilyHandle(prefix2);
@@ -103033,6 +103034,469 @@ var rumBrowserConfigDefinition = external_exports.strictObject({
103033
103034
  sampleRatio: external_exports.number().min(0).max(1)
103034
103035
  });
103035
103036
 
103037
+ // ../../modules/wiki/contract/src/wiki-comments.ts
103038
+ var COMMENT_MAX = 4e3;
103039
+ var QUOTE_MAX = 1e3;
103040
+ var wikiCommentAuthorSchema = external_exports.object({
103041
+ kind: external_exports.enum(["person", "agent"]),
103042
+ id: external_exports.string(),
103043
+ name: external_exports.string()
103044
+ });
103045
+ var wikiCommentSchema = external_exports.object({
103046
+ id: external_exports.string(),
103047
+ author: wikiCommentAuthorSchema,
103048
+ body: external_exports.string(),
103049
+ createdAt: external_exports.iso.datetime()
103050
+ });
103051
+ var wikiThreadSchemaDefinition = external_exports.object({
103052
+ id: external_exports.string(),
103053
+ /** The text the thread is about, as it was selected. */
103054
+ quote: external_exports.string(),
103055
+ /** The quote is no longer in the page's body. */
103056
+ detached: external_exports.boolean(),
103057
+ resolved: external_exports.object({ by: wikiCommentAuthorSchema, at: external_exports.iso.datetime() }).nullable(),
103058
+ /** The first comment, then the replies, oldest first. */
103059
+ comments: external_exports.array(wikiCommentSchema)
103060
+ });
103061
+ var wikiThreadSchema = wikiThreadSchemaDefinition;
103062
+ var wikiThreadsSchemaDefinition = external_exports.object({
103063
+ path: external_exports.string(),
103064
+ /** Open threads on the page, whatever the listing holds. */
103065
+ open: external_exports.number().int().nonnegative(),
103066
+ threads: external_exports.array(wikiThreadSchemaDefinition)
103067
+ });
103068
+ var wikiThreadsSchema = wikiThreadsSchemaDefinition;
103069
+ var wikiCommentPostedSchemaDefinition = external_exports.object({
103070
+ thread: wikiThreadSchemaDefinition,
103071
+ /** People mentioned who were not told, because they cannot read the page. */
103072
+ notTold: external_exports.array(external_exports.string())
103073
+ });
103074
+ var wikiCommentPostedSchema = wikiCommentPostedSchemaDefinition;
103075
+ var pathSchema = external_exports.string().min(1).max(200);
103076
+ var bodySchema2 = external_exports.string().trim().min(1).max(COMMENT_MAX);
103077
+ var wikiThreadsInputSchemaDefinition = external_exports.object({
103078
+ path: pathSchema,
103079
+ /** Only the threads not resolved. */
103080
+ open: external_exports.boolean().optional()
103081
+ });
103082
+ var wikiCommentInputSchemaDefinition = external_exports.object({
103083
+ path: pathSchema,
103084
+ quote: external_exports.string().trim().min(1).max(QUOTE_MAX),
103085
+ body: bodySchema2
103086
+ });
103087
+ var wikiReplyInputSchemaDefinition = external_exports.object({ threadId: external_exports.string().min(1), body: bodySchema2 });
103088
+ var wikiResolveInputSchemaDefinition = external_exports.object({
103089
+ threadId: external_exports.string().min(1),
103090
+ /** False reopens it. */
103091
+ resolved: external_exports.boolean().default(true)
103092
+ });
103093
+ var wikiCommentRefSchemaDefinition = external_exports.object({ commentId: external_exports.string().min(1) });
103094
+ var workspaced = { workspaceId: external_exports.string().min(1) };
103095
+ var wikiThreadsInWorkspaceSchemaDefinition = external_exports.object({
103096
+ ...wikiThreadsInputSchemaDefinition.shape,
103097
+ ...workspaced
103098
+ });
103099
+ var wikiThreadsInWorkspaceSchema = wikiThreadsInWorkspaceSchemaDefinition;
103100
+ var wikiCommentInWorkspaceSchemaDefinition = external_exports.object({
103101
+ ...wikiCommentInputSchemaDefinition.shape,
103102
+ ...workspaced
103103
+ });
103104
+ var wikiCommentInWorkspaceSchema = wikiCommentInWorkspaceSchemaDefinition;
103105
+ var wikiReplyInWorkspaceSchemaDefinition = external_exports.object({
103106
+ ...wikiReplyInputSchemaDefinition.shape,
103107
+ ...workspaced
103108
+ });
103109
+ var wikiReplyInWorkspaceSchema = wikiReplyInWorkspaceSchemaDefinition;
103110
+ var wikiResolveInWorkspaceSchemaDefinition = external_exports.object({
103111
+ ...wikiResolveInputSchemaDefinition.shape,
103112
+ ...workspaced
103113
+ });
103114
+ var wikiResolveInWorkspaceSchema = wikiResolveInWorkspaceSchemaDefinition;
103115
+ var wikiCommentRefInWorkspaceSchemaDefinition = external_exports.object({
103116
+ ...wikiCommentRefSchemaDefinition.shape,
103117
+ ...workspaced
103118
+ });
103119
+ var wikiCommentRefInWorkspaceSchema = wikiCommentRefInWorkspaceSchemaDefinition;
103120
+ var wikiMentionViewSchemaDefinition = external_exports.discriminatedUnion("found", [
103121
+ external_exports.object({
103122
+ commentId: external_exports.string(),
103123
+ found: external_exports.literal(true),
103124
+ authorName: external_exports.string(),
103125
+ pageTitle: external_exports.string(),
103126
+ body: external_exports.string(),
103127
+ /** The page's address, opened on the thread. */
103128
+ path: external_exports.string()
103129
+ }),
103130
+ external_exports.object({ commentId: external_exports.string(), found: external_exports.literal(false) })
103131
+ ]);
103132
+
103133
+ // ../../modules/wiki/contract/src/wiki-files.ts
103134
+ var WIKI_FILE_MAX_BYTES = 25 * 1024 * 1024;
103135
+ var wikiFileSchemaDefinition = external_exports.object({
103136
+ id: external_exports.string(),
103137
+ name: external_exports.string(),
103138
+ contentType: external_exports.string(),
103139
+ sizeBytes: external_exports.number().int().nonnegative(),
103140
+ /** The address bodies embed; it asks the wiki whether the reader may read the page. */
103141
+ url: external_exports.string(),
103142
+ ready: external_exports.boolean()
103143
+ });
103144
+ var wikiFileSchema = wikiFileSchemaDefinition;
103145
+ var wikiFilesSchemaDefinition = external_exports.object({
103146
+ path: external_exports.string(),
103147
+ files: external_exports.array(wikiFileSchemaDefinition)
103148
+ });
103149
+ var wikiFilesSchema = wikiFilesSchemaDefinition;
103150
+ var wikiAttachTicketSchemaDefinition = external_exports.object({
103151
+ file: wikiFileSchemaDefinition,
103152
+ /** Where to send the bytes, then call attachDone with each part's tag. */
103153
+ upload: uploadTicketSchema2
103154
+ });
103155
+ var wikiAttachTicketSchema = wikiAttachTicketSchemaDefinition;
103156
+ var wikiFileLinkSchemaDefinition = external_exports.object({ url: external_exports.string(), expiresAt: external_exports.string() });
103157
+ var pathSchema2 = external_exports.string().min(1).max(200);
103158
+ var wikiAttachInputSchemaDefinition = external_exports.object({
103159
+ path: pathSchema2,
103160
+ fileName: external_exports.string().trim().min(1).max(255),
103161
+ contentType: external_exports.string().trim().min(1).max(200),
103162
+ sizeBytes: external_exports.number().int().positive()
103163
+ });
103164
+ var wikiAttachDoneInputSchemaDefinition = external_exports.object({
103165
+ path: pathSchema2,
103166
+ fileId: external_exports.string().min(1).max(200),
103167
+ parts: external_exports.array(finishedPartSchema).max(1e4)
103168
+ });
103169
+ var wikiFileRefSchemaDefinition = external_exports.object({
103170
+ workspaceId: external_exports.string().min(1).max(200),
103171
+ fileId: external_exports.string().min(1).max(200)
103172
+ });
103173
+ var wikiFileRefSchema = wikiFileRefSchemaDefinition;
103174
+ var wikiPublicFileRefSchemaDefinition = external_exports.object({
103175
+ token: external_exports.string().min(1).max(200),
103176
+ fileId: external_exports.string().min(1).max(200)
103177
+ });
103178
+ var workspaced2 = { workspaceId: external_exports.string().min(1) };
103179
+ var wikiAttachInWorkspaceSchemaDefinition = external_exports.object({
103180
+ ...wikiAttachInputSchemaDefinition.shape,
103181
+ ...workspaced2
103182
+ });
103183
+ var wikiAttachInWorkspaceSchema = wikiAttachInWorkspaceSchemaDefinition;
103184
+ var wikiAttachDoneInWorkspaceSchemaDefinition = external_exports.object({
103185
+ ...wikiAttachDoneInputSchemaDefinition.shape,
103186
+ ...workspaced2
103187
+ });
103188
+ var wikiAttachDoneInWorkspaceSchema = wikiAttachDoneInWorkspaceSchemaDefinition;
103189
+
103190
+ // ../../modules/wiki/contract/src/wiki-frontmatter.ts
103191
+ var wikiFieldValueSchema = external_exports.json();
103192
+
103193
+ // ../../modules/wiki/contract/src/wiki-roles.ts
103194
+ var WIKI_VISIBILITIES = ["restricted", "channel", "internal", "public"];
103195
+ var wikiVisibilitySchema = external_exports.enum(WIKI_VISIBILITIES);
103196
+ var WIKI_ROLES = ["view", "edit"];
103197
+ var wikiRoleSchema = external_exports.enum(WIKI_ROLES);
103198
+
103199
+ // ../../modules/wiki/contract/src/wiki-pins.ts
103200
+ var wikiPinInputSchemaDefinition = external_exports.object({
103201
+ workspaceId: external_exports.string().min(1),
103202
+ path: external_exports.string().min(1).max(200),
103203
+ channelId: external_exports.string().min(1),
103204
+ /** What the conversation's members may do: edit by default, or view. */
103205
+ role: wikiRoleSchema.default("edit")
103206
+ });
103207
+ var wikiPinInputSchema = wikiPinInputSchemaDefinition;
103208
+ var wikiUnpinInputSchemaDefinition = external_exports.object({
103209
+ workspaceId: external_exports.string().min(1),
103210
+ path: external_exports.string().min(1).max(200),
103211
+ channelId: external_exports.string().min(1)
103212
+ });
103213
+ var wikiUnpinInputSchema = wikiUnpinInputSchemaDefinition;
103214
+ var wikiPinsInputSchemaDefinition = external_exports.object({
103215
+ workspaceId: external_exports.string().min(1),
103216
+ channelId: external_exports.string().min(1)
103217
+ });
103218
+ var wikiPinsInputSchema = wikiPinsInputSchemaDefinition;
103219
+ var wikiPinByKeyInputSchemaDefinition = external_exports.object({
103220
+ path: external_exports.string().min(1).max(200),
103221
+ channel: external_exports.string().trim().min(1).max(200),
103222
+ role: wikiRoleSchema.default("edit")
103223
+ });
103224
+ var wikiPinTabSchemaDefinition = external_exports.object({
103225
+ path: external_exports.string(),
103226
+ /** The page's title, or the folder's last segment. */
103227
+ title: external_exports.string(),
103228
+ folder: external_exports.boolean(),
103229
+ role: wikiRoleSchema,
103230
+ pinnedBy: external_exports.string().nullable(),
103231
+ pinnedAt: external_exports.string().nullable()
103232
+ });
103233
+ var wikiChannelPinsSchemaDefinition = external_exports.object({
103234
+ channelId: external_exports.string(),
103235
+ pins: external_exports.array(wikiPinTabSchemaDefinition)
103236
+ });
103237
+ var wikiChannelPinsSchema = wikiChannelPinsSchemaDefinition;
103238
+ var WikiPinStripSlot = uiTokens("wiki").component("pinStrip");
103239
+ var WikiPanelSlot = uiTokens("wiki").component("panel");
103240
+
103241
+ // ../../modules/wiki/contract/src/wiki.ts
103242
+ var WIKI_BODY_MAX_CHARS = 1e6;
103243
+ var wikiAuthorSchemaDefinition = external_exports.object({
103244
+ kind: external_exports.enum(["person", "agent"]),
103245
+ id: external_exports.string(),
103246
+ name: external_exports.string()
103247
+ });
103248
+ var wikiPageAccessSchemaDefinition = external_exports.object({
103249
+ visibility: wikiVisibilitySchema,
103250
+ role: wikiRoleSchema
103251
+ });
103252
+ var wikiPageLinkSchemaDefinition = external_exports.object({ path: external_exports.string(), title: external_exports.string() });
103253
+ var wikiPageSchemaDefinition = external_exports.object({
103254
+ id: external_exports.string(),
103255
+ workspaceId: external_exports.string(),
103256
+ /** Nested by `/`: `ops/oncall/rota`. */
103257
+ path: external_exports.string(),
103258
+ title: external_exports.string(),
103259
+ body: external_exports.string(),
103260
+ /** Set when only that channel's members see the page. */
103261
+ channelId: external_exports.string().nullable(),
103262
+ version: external_exports.number().int().positive(),
103263
+ /** The paths this page links to with `[[path]]`. */
103264
+ links: external_exports.array(external_exports.string()),
103265
+ /** The pages the reader can see that link here. */
103266
+ backlinks: external_exports.array(wikiPageLinkSchemaDefinition),
103267
+ updatedBy: wikiAuthorSchemaDefinition,
103268
+ createdAt: external_exports.iso.datetime(),
103269
+ updatedAt: external_exports.iso.datetime(),
103270
+ /** The page's web address, on the answers a key reads. */
103271
+ url: lazeUrlSchema.optional(),
103272
+ /** Who sees it and what the reader may do. */
103273
+ sharing: wikiPageAccessSchemaDefinition.optional(),
103274
+ /** `type` in its YAML header (wiki-page-fields ADR). */
103275
+ type: external_exports.string().nullable().optional(),
103276
+ /** Every other key of its YAML header, as written. */
103277
+ fields: external_exports.record(external_exports.string(), wikiFieldValueSchema).optional(),
103278
+ /** Why the YAML header does not read, with its line; the body is kept as written. */
103279
+ headerProblem: external_exports.string().nullable().optional()
103280
+ });
103281
+ var wikiPageSchema = wikiPageSchemaDefinition;
103282
+ var wikiPageSummarySchemaDefinition = external_exports.object({
103283
+ path: external_exports.string(),
103284
+ title: external_exports.string(),
103285
+ channelId: external_exports.string().nullable(),
103286
+ updatedAt: external_exports.iso.datetime(),
103287
+ /** The page's web address, on the answers a key reads. */
103288
+ url: lazeUrlSchema.optional(),
103289
+ /** Who sees it and what the reader may do. */
103290
+ sharing: wikiPageAccessSchemaDefinition.optional(),
103291
+ /** `type` in its YAML header. */
103292
+ type: external_exports.string().nullable().optional()
103293
+ });
103294
+ var wikiTreeNodeSchemaDefinition = external_exports.lazy(
103295
+ () => external_exports.object({
103296
+ path: external_exports.string(),
103297
+ name: external_exports.string(),
103298
+ title: external_exports.string().nullable(),
103299
+ children: external_exports.array(wikiTreeNodeSchemaDefinition)
103300
+ })
103301
+ );
103302
+ var wikiListingSchemaDefinition = external_exports.object({
103303
+ pages: external_exports.array(wikiPageSummarySchemaDefinition),
103304
+ tree: external_exports.array(wikiTreeNodeSchemaDefinition)
103305
+ });
103306
+ var wikiListingSchema = wikiListingSchemaDefinition;
103307
+ var wikiWritableInputSchemaDefinition = external_exports.object({
103308
+ workspaceId: external_exports.string().min(1),
103309
+ paths: external_exports.array(external_exports.string().trim().max(200)).min(1).max(10)
103310
+ });
103311
+ var wikiWritableInputSchema = wikiWritableInputSchemaDefinition;
103312
+ var wikiWritablePlaceSchemaDefinition = external_exports.object({
103313
+ path: external_exports.string(),
103314
+ noChannel: external_exports.boolean(),
103315
+ channelIds: external_exports.array(external_exports.string())
103316
+ });
103317
+ var wikiWritablePlaceSchema = wikiWritablePlaceSchemaDefinition;
103318
+ var wikiHitSchemaDefinition = external_exports.object({
103319
+ path: external_exports.string(),
103320
+ title: external_exports.string(),
103321
+ /** A few words around the match. */
103322
+ snippet: external_exports.string(),
103323
+ rank: external_exports.number(),
103324
+ /** The page's web address. */
103325
+ url: lazeUrlSchema.optional()
103326
+ });
103327
+ var wikiHitSchema = wikiHitSchemaDefinition;
103328
+ var wikiRevisionSchemaDefinition = external_exports.object({
103329
+ version: external_exports.number().int().positive(),
103330
+ title: external_exports.string(),
103331
+ body: external_exports.string(),
103332
+ by: wikiAuthorSchemaDefinition,
103333
+ createdAt: external_exports.iso.datetime()
103334
+ });
103335
+ var wikiRevisionSchema = wikiRevisionSchemaDefinition;
103336
+ var wikiPathRefSchemaDefinition = external_exports.object({
103337
+ workspaceId: external_exports.string().min(1),
103338
+ path: external_exports.string().min(1).max(200)
103339
+ });
103340
+ var wikiPathRefSchema = wikiPathRefSchemaDefinition;
103341
+ var putFields = {
103342
+ path: external_exports.string().min(1).max(200),
103343
+ /** Defaults to the last path segment, as words. */
103344
+ title: external_exports.string().trim().max(200).optional(),
103345
+ body: external_exports.string().max(WIKI_BODY_MAX_CHARS, { error: "A page takes up to 1,000,000 characters" }),
103346
+ /** The version the editor opened; 0 for a new page. Left out, it saves over the newest. */
103347
+ baseVersion: external_exports.number().int().nonnegative().optional()
103348
+ };
103349
+ var putWikiPageInputSchemaDefinition = external_exports.object({
103350
+ ...putFields,
103351
+ workspaceId: external_exports.string().min(1),
103352
+ /** Only for a new page: the channel whose members alone see it. */
103353
+ channelId: external_exports.string().min(1).nullable().optional()
103354
+ });
103355
+ var putWikiPageInputSchema = putWikiPageInputSchemaDefinition;
103356
+ var wikiPutByKeyInputSchemaDefinition = external_exports.object({
103357
+ ...putFields,
103358
+ /** A channel the key's agent is in, by id or name. */
103359
+ channel: external_exports.string().trim().min(1).max(81).optional()
103360
+ });
103361
+ var moveWikiPageInputSchemaDefinition = external_exports.object({
103362
+ workspaceId: external_exports.string().min(1),
103363
+ path: external_exports.string().min(1).max(200),
103364
+ /** The new path; pages under the old one move with it. */
103365
+ to: external_exports.string().min(1).max(200)
103366
+ });
103367
+ var moveWikiPageInputSchema = moveWikiPageInputSchemaDefinition;
103368
+ var wikiMoveByKeyInputSchemaDefinition = external_exports.object({
103369
+ path: external_exports.string().min(1).max(200),
103370
+ to: external_exports.string().min(1).max(200)
103371
+ });
103372
+ var wikiQuerySchemaDefinition = external_exports.object({ query: external_exports.string().trim().min(1).max(200) });
103373
+ var wikiPathSchemaDefinition = external_exports.object({ path: external_exports.string().min(1).max(200) });
103374
+ var wikiGrantSubjectSchemaDefinition = external_exports.object({
103375
+ type: external_exports.enum(["user", "agent", "channel", "group"]),
103376
+ id: external_exports.string().min(1).max(100)
103377
+ });
103378
+ var wikiShareGrantSchemaDefinition = external_exports.object({
103379
+ subject: wikiGrantSubjectSchemaDefinition,
103380
+ role: wikiRoleSchema,
103381
+ /** As the dialog shows it ("Ada", "@people", "#ops"); null for a channel the reader is not in. */
103382
+ name: external_exports.string().nullable(),
103383
+ /** A channel share made by pinning: the page shows as a tab of that conversation. */
103384
+ pinned: external_exports.boolean().optional()
103385
+ });
103386
+ var wikiSharingSchemaDefinition = external_exports.object({
103387
+ path: external_exports.string(),
103388
+ /** `own`: set on this path; `inherited`: from the folder `from`; `default`: never set. */
103389
+ source: external_exports.enum(["own", "inherited", "default"]),
103390
+ /** The folder the sharing comes from, when inherited. */
103391
+ from: external_exports.string().nullable(),
103392
+ visibility: wikiVisibilitySchema,
103393
+ /** What General access lets people do. */
103394
+ memberRole: wikiRoleSchema,
103395
+ /** The channel `channel` visibility names; its name is null outside the reader's channels. */
103396
+ channel: external_exports.object({ id: external_exports.string(), name: external_exports.string().nullable() }).nullable(),
103397
+ grants: external_exports.array(wikiShareGrantSchemaDefinition),
103398
+ /** What the reader may do here. */
103399
+ role: wikiRoleSchema,
103400
+ /** The public link's token, while the sharing is public. */
103401
+ publicToken: external_exports.string().nullable(),
103402
+ /** Pages under this path that keep their own sharing. */
103403
+ ownBelow: external_exports.number().int().nonnegative(),
103404
+ /** The address of the public link, on the answers a key reads. */
103405
+ publicUrl: lazeUrlSchema.optional()
103406
+ });
103407
+ var wikiSharingSchema = wikiSharingSchemaDefinition;
103408
+ var sharingFields = {
103409
+ visibility: wikiVisibilitySchema.optional(),
103410
+ memberRole: wikiRoleSchema.optional()
103411
+ };
103412
+ var setWikiSharingInputSchemaDefinition = external_exports.object({
103413
+ workspaceId: external_exports.string().min(1),
103414
+ path: external_exports.string().min(1).max(200),
103415
+ ...sharingFields,
103416
+ /** For `channel`: a channel the setter is in; left out, the page's own channel. */
103417
+ channelId: external_exports.string().min(1).nullable().optional()
103418
+ });
103419
+ var setWikiSharingInputSchema = setWikiSharingInputSchemaDefinition;
103420
+ var wikiGrantInputSchemaDefinition = external_exports.object({
103421
+ workspaceId: external_exports.string().min(1),
103422
+ path: external_exports.string().min(1).max(200),
103423
+ subject: wikiGrantSubjectSchemaDefinition,
103424
+ role: wikiRoleSchema
103425
+ });
103426
+ var wikiGrantInputSchema = wikiGrantInputSchemaDefinition;
103427
+ var wikiRevokeInputSchemaDefinition = external_exports.object({
103428
+ workspaceId: external_exports.string().min(1),
103429
+ path: external_exports.string().min(1).max(200),
103430
+ subject: wikiGrantSubjectSchemaDefinition
103431
+ });
103432
+ var wikiRevokeInputSchema = wikiRevokeInputSchemaDefinition;
103433
+ var wikiSetSharingByKeyInputSchemaDefinition = external_exports.object({
103434
+ path: external_exports.string().min(1).max(200),
103435
+ ...sharingFields,
103436
+ /** A channel the key's agent or person is in, by id or name. */
103437
+ channel: external_exports.string().trim().min(1).max(81).optional()
103438
+ });
103439
+ var wikiGrantByKeyInputSchemaDefinition = external_exports.object({
103440
+ path: external_exports.string().min(1).max(200),
103441
+ who: external_exports.string().trim().min(1).max(200),
103442
+ role: wikiRoleSchema.default("view")
103443
+ });
103444
+ var wikiRevokeByKeyInputSchemaDefinition = external_exports.object({
103445
+ path: external_exports.string().min(1).max(200),
103446
+ who: external_exports.string().trim().min(1).max(200)
103447
+ });
103448
+ var wikiPublicRefSchemaDefinition = external_exports.object({
103449
+ token: external_exports.string().min(20).max(100),
103450
+ path: external_exports.string().max(200).optional()
103451
+ });
103452
+ var wikiPublicRefSchema = wikiPublicRefSchemaDefinition;
103453
+ var wikiPublicPageSchemaDefinition = external_exports.object({ title: external_exports.string(), body: external_exports.string() });
103454
+ var wikiPublicPageSchema = wikiPublicPageSchemaDefinition;
103455
+ var WikiApi = moduleApi()("wiki");
103456
+ var WIKI_LIST_PATH = "wiki.list";
103457
+ var WIKI_GET_PATH = "wiki.get";
103458
+ var paintCopyOf = (path) => ({
103459
+ path,
103460
+ paintOnly: true,
103461
+ storable: (copy2) => VAULT_NAMED_TEXT.test(JSON.stringify(copy2)) ? void 0 : copy2
103462
+ });
103463
+ var wikiListCopy = paintCopyOf(WIKI_LIST_PATH);
103464
+ var wikiPageCopy = paintCopyOf(WIKI_GET_PATH);
103465
+ var wikiTrpc = defineTrpcContract("wiki").query("list", { mirrored: wikiListCopy }).withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(wikiListingSchema).query("get", { mirrored: wikiPageCopy }).withInput(wikiPathRefSchema).withOutput(wikiPageSchema).query("history").withInput(wikiPathRefSchema).withOutput(external_exports.array(wikiRevisionSchema)).query("writable").withInput(wikiWritableInputSchema).withOutput(external_exports.array(wikiWritablePlaceSchema)).query("search").withInput(external_exports.object({ workspaceId: external_exports.string().min(1), query: external_exports.string().trim().min(1).max(200) })).withOutput(external_exports.array(wikiHitSchema)).mutation("put").withInput(putWikiPageInputSchema).withOutput(wikiPageSchema).mutation("move").withInput(moveWikiPageInputSchema).withOutput(wikiPageSchema).mutation("remove").withInput(wikiPathRefSchema).withOutput(external_exports.object({ removed: external_exports.literal(true) })).query("sharing").withInput(wikiPathRefSchema).withOutput(wikiSharingSchema).mutation("setSharing").withInput(setWikiSharingInputSchema).withOutput(wikiSharingSchema).mutation("resetSharing").withInput(wikiPathRefSchema).withOutput(wikiSharingSchema).mutation("takeBack").withInput(wikiPathRefSchema).withOutput(wikiSharingSchema).mutation("grant").withInput(wikiGrantInputSchema).withOutput(wikiSharingSchema).mutation("revoke").withInput(wikiRevokeInputSchema).withOutput(wikiSharingSchema).query("publicPage").withInput(wikiPublicRefSchema).withOutput(wikiPublicPageSchema).mutation("pin").withInput(wikiPinInputSchema).withOutput(wikiSharingSchema).mutation("unpin").withInput(wikiUnpinInputSchema).withOutput(wikiSharingSchema).query("pins").withInput(wikiPinsInputSchema).withOutput(wikiChannelPinsSchema).query("threads").withInput(wikiThreadsInWorkspaceSchema).withOutput(wikiThreadsSchema).mutation("comment").withInput(wikiCommentInWorkspaceSchema).withOutput(wikiCommentPostedSchema).mutation("reply").withInput(wikiReplyInWorkspaceSchema).withOutput(wikiCommentPostedSchema).mutation("resolve").withInput(wikiResolveInWorkspaceSchema).withOutput(wikiThreadSchema).mutation("deleteComment").withInput(wikiCommentRefInWorkspaceSchema).withOutput(wikiThreadsSchema).mutation("attach").withInput(wikiAttachInWorkspaceSchema).withOutput(wikiAttachTicketSchema).mutation("attachDone").withInput(wikiAttachDoneInWorkspaceSchema).withOutput(wikiFileSchema).query("files").withInput(external_exports.object({ workspaceId: external_exports.string().min(1), path: external_exports.string().min(1).max(200) })).withOutput(wikiFilesSchema).mutation("removeFile").withInput(wikiFileRefSchema).withOutput(external_exports.object({ removed: external_exports.literal(true) })).build();
103466
+ var wikiUi = uiTokens("wiki");
103467
+ var WikiNavSlot = wikiUi.component("nav");
103468
+
103469
+ // ../../modules/wiki/contract/src/wiki.config.ts
103470
+ var wikiConfig = Config.define(() => ({ publicBaseUrl }));
103471
+
103472
+ // ../../modules/wiki/contract/src/wiki.events.ts
103473
+ var wikiMentionedPayloadSchemaDefinition = external_exports.object({
103474
+ workspaceId: external_exports.string().min(1),
103475
+ pageId: external_exports.string().min(1),
103476
+ threadId: external_exports.string().min(1),
103477
+ commentId: external_exports.string().min(1),
103478
+ mentionedUserId: external_exports.string().min(1),
103479
+ author: external_exports.object({ kind: external_exports.enum(["person", "agent"]), id: external_exports.string().min(1) }).strict(),
103480
+ at: external_exports.iso.datetime()
103481
+ }).strict();
103482
+
103483
+ // ../../modules/wiki/contract/src/wiki-support-pages.ts
103484
+ var count13 = external_exports.number().int().nonnegative();
103485
+ var wikiSupportPageCountDefinition = external_exports.object({ pages: count13, workspaces: count13 }).strict();
103486
+ var wikiSupportPageCountSchema = wikiSupportPageCountDefinition;
103487
+
103488
+ // ../../modules/wiki/contract/src/wiki-locked-pages.ts
103489
+ var WIKI_LOCKED_PAGES_LIMIT = 200;
103490
+ var count14 = external_exports.number().int().nonnegative();
103491
+ var id7 = external_exports.string().min(1).max(200);
103492
+ var wikiLockedPagesDefinition = external_exports.object({
103493
+ pages: count14,
103494
+ workspaces: count14,
103495
+ locked: external_exports.array(external_exports.object({ workspaceId: id7, pageId: id7 }).strict()).max(WIKI_LOCKED_PAGES_LIMIT),
103496
+ truncated: external_exports.boolean()
103497
+ }).strict();
103498
+ var wikiLockedPagesSchema = wikiLockedPagesDefinition;
103499
+
103036
103500
  // ../../modules/ops/contract/src/ops-functions.ts
103037
103501
  var OPS_FUNCTION = {
103038
103502
  /** Functions one lease may name. */
@@ -103091,12 +103555,12 @@ var funnelInputDefinition = external_exports.object({
103091
103555
  to: external_exports.iso.datetime(),
103092
103556
  bucketMinutes: external_exports.union([external_exports.literal(10), external_exports.literal(60), external_exports.literal(1440)]).default(60)
103093
103557
  }).strict();
103094
- var count13 = external_exports.number().int().nonnegative();
103558
+ var count15 = external_exports.number().int().nonnegative();
103095
103559
  var funnelCountsDefinition = external_exports.object({
103096
- signUps: count13,
103097
- workspaces: count13,
103098
- activatedTeams: count13,
103099
- payingTeams: count13
103560
+ signUps: count15,
103561
+ workspaces: count15,
103562
+ activatedTeams: count15,
103563
+ payingTeams: count15
103100
103564
  });
103101
103565
  var funnelOutputDefinition = external_exports.object({
103102
103566
  bucketMinutes: external_exports.number().int(),
@@ -103125,34 +103589,34 @@ var cohortOutputDefinition = external_exports.object({
103125
103589
  promotionId: external_exports.string().nullable(),
103126
103590
  plan: external_exports.string(),
103127
103591
  paying: external_exports.boolean(),
103128
- members: count13,
103592
+ members: count15,
103129
103593
  agents: external_exports.object({
103130
- laze: count13,
103131
- connected: count13,
103594
+ laze: count15,
103595
+ connected: count15,
103132
103596
  firstLazeAgentAt: external_exports.iso.datetime().nullable()
103133
103597
  }),
103134
- turns: count13,
103135
- appsCreated: count13,
103136
- connectionsLinked: count13,
103598
+ turns: count15,
103599
+ appsCreated: count15,
103600
+ connectionsLinked: count15,
103137
103601
  /** Slack channels mirrored, Slack and Discord link and intake events, WhatsApp mirrors on. */
103138
103602
  messaging: external_exports.object({
103139
- slackChannels: count13,
103140
- slackEvents: count13,
103141
- discordEvents: count13,
103142
- whatsappMirrors: count13
103603
+ slackChannels: count15,
103604
+ slackEvents: count15,
103605
+ discordEvents: count15,
103606
+ whatsappMirrors: count15
103143
103607
  }),
103144
103608
  creatorLastMessageAt: external_exports.iso.datetime().nullable(),
103145
103609
  /** The creator's last heartbeat from a Laze web or desktop window here; null when never. */
103146
103610
  creatorLastSeenAt: external_exports.iso.datetime().nullable(),
103147
103611
  /** Members whose last heartbeat here falls in the 7 days before `until`. */
103148
- peopleSeenLast7Days: count13,
103612
+ peopleSeenLast7Days: count15,
103149
103613
  /** Live messages per UTC day; days with none are left out. */
103150
103614
  days: external_exports.array(
103151
103615
  external_exports.object({
103152
103616
  day: external_exports.string(),
103153
- byPeople: count13,
103154
- byAgents: count13,
103155
- people: count13
103617
+ byPeople: count15,
103618
+ byAgents: count15,
103619
+ people: count15
103156
103620
  })
103157
103621
  ),
103158
103622
  /** The once-only sends nurturing kept (first_agent_made, first_agent_nudge, ...). */
@@ -103176,29 +103640,29 @@ var capacityOutputDefinition = external_exports.object({
103176
103640
  /** The last day of host load, oldest first. */
103177
103641
  history: external_exports.array(hostLoadPointSchema)
103178
103642
  });
103179
- var tally = external_exports.array(external_exports.object({ key: external_exports.string(), count: count13 }));
103643
+ var tally = external_exports.array(external_exports.object({ key: external_exports.string(), count: count15 }));
103180
103644
  var snapshotOutputDefinition = external_exports.object({
103181
103645
  workspaceId: external_exports.string(),
103182
103646
  createdAt: external_exports.iso.datetime(),
103183
103647
  plan: external_exports.string(),
103184
103648
  status: external_exports.string(),
103185
- seats: external_exports.object({ people: count13, limit: external_exports.number().int().nullable() }),
103649
+ seats: external_exports.object({ people: count15, limit: external_exports.number().int().nullable() }),
103186
103650
  membersByRole: tally,
103187
103651
  invitesByStatus: tally,
103188
103652
  agentsByKind: tally,
103189
103653
  agentsByHosting: tally,
103190
- agentsConnected: count13,
103654
+ agentsConnected: count15,
103191
103655
  flagsOn: external_exports.array(external_exports.string()),
103192
- complimentaryComputers: count13
103656
+ complimentaryComputers: count15
103193
103657
  });
103194
103658
  var eventsInputDefinition = external_exports.object({ from: external_exports.iso.datetime(), to: external_exports.iso.datetime() }).strict();
103195
103659
  var eventCountsDefinition = external_exports.object({
103196
- total: count13,
103660
+ total: count15,
103197
103661
  /** Per type: how many, and the stored bytes of their payloads and sealed copies. */
103198
103662
  byType: external_exports.array(
103199
103663
  external_exports.object({
103200
103664
  eventType: external_exports.string(),
103201
- count: count13,
103665
+ count: count15,
103202
103666
  payloadBytes: external_exports.number().nonnegative(),
103203
103667
  encryptedCopyBytes: external_exports.number().nonnegative()
103204
103668
  })
@@ -103252,9 +103716,9 @@ var databaseHealthDefinition = external_exports.object({
103252
103716
  deadlocks: external_exports.number().nonnegative(),
103253
103717
  tempBytes: external_exports.number().nonnegative(),
103254
103718
  connections: external_exports.object({
103255
- total: count13,
103256
- byState: external_exports.array(external_exports.object({ state: external_exports.string(), count: count13 })),
103257
- waitingOnLocks: count13,
103719
+ total: count15,
103720
+ byState: external_exports.array(external_exports.object({ state: external_exports.string(), count: count15 })),
103721
+ waitingOnLocks: count15,
103258
103722
  longestActiveSeconds: external_exports.number().nonnegative(),
103259
103723
  longestIdleInTransactionSeconds: external_exports.number().nonnegative()
103260
103724
  }),
@@ -103309,7 +103773,7 @@ var tenantAgentsDefinition = external_exports.object({
103309
103773
  createdAt: external_exports.iso.datetime(),
103310
103774
  modelLevel: external_exports.string().nullable(),
103311
103775
  model: external_exports.string().nullable(),
103312
- channels: count13,
103776
+ channels: count15,
103313
103777
  limitedUntil: external_exports.iso.datetime().nullable(),
103314
103778
  limitedBy: external_exports.string().nullable(),
103315
103779
  pausedAt: external_exports.iso.datetime().nullable(),
@@ -103363,8 +103827,8 @@ var tenantBillingDefinition = external_exports.object({
103363
103827
  currencyChosen: external_exports.boolean(),
103364
103828
  cancelAtPeriodEnd: external_exports.boolean(),
103365
103829
  period: external_exports.object({ start: external_exports.iso.datetime(), end: external_exports.iso.datetime() }).nullable(),
103366
- seats: external_exports.object({ people: count13, limit: count13.nullable(), monthlyPrice: external_exports.number() }),
103367
- complimentarySeats: count13.nullable(),
103830
+ seats: external_exports.object({ people: count15, limit: count15.nullable(), monthlyPrice: external_exports.number() }),
103831
+ complimentarySeats: count15.nullable(),
103368
103832
  credits: external_exports.object({
103369
103833
  included: external_exports.number(),
103370
103834
  includedLeft: external_exports.number(),
@@ -103403,14 +103867,14 @@ var tenantVaultDefinition = external_exports.object({
103403
103867
  external_exports.object({
103404
103868
  subject: external_exports.string(),
103405
103869
  most: external_exports.string(),
103406
- maxLeaseSeconds: count13.nullable(),
103870
+ maxLeaseSeconds: count15.nullable(),
103407
103871
  blocked: external_exports.boolean(),
103408
103872
  approveNew: external_exports.boolean(),
103409
103873
  updatedAt: external_exports.iso.datetime()
103410
103874
  })
103411
103875
  ),
103412
103876
  /** Connections waiting for an admin, counted by kind; never a name, label or field. */
103413
- waitingByKind: external_exports.array(external_exports.object({ key: external_exports.string(), count: count13 }))
103877
+ waitingByKind: external_exports.array(external_exports.object({ key: external_exports.string(), count: count15 }))
103414
103878
  });
103415
103879
  var WHATSAPP_INTAKE_KEY_KINDS = ["msg", "edit", "del", "react", "read"];
103416
103880
  var tenantWhatsappInputDefinition = external_exports.object({
@@ -103423,17 +103887,17 @@ var tenantWhatsappOutputDefinition = external_exports.object({
103423
103887
  intake: external_exports.object({
103424
103888
  since: external_exports.iso.datetime(),
103425
103889
  until: external_exports.iso.datetime(),
103426
- total: count13,
103890
+ total: count15,
103427
103891
  byKind: external_exports.array(
103428
103892
  external_exports.object({
103429
103893
  kind: external_exports.enum([...WHATSAPP_INTAKE_KEY_KINDS, "other"]),
103430
- count: count13,
103894
+ count: count15,
103431
103895
  /** Events dated over a second after Laze got them, and the most ahead: a fast clock. */
103432
- aheadOfLaze: external_exports.object({ count: count13, maxAheadMs: external_exports.number().int() }).optional()
103896
+ aheadOfLaze: external_exports.object({ count: count15, maxAheadMs: external_exports.number().int() }).optional()
103433
103897
  })
103434
103898
  ),
103435
103899
  /** The workspace's chat messages and changes dated over a second after Laze stored them. */
103436
- chatAheadOfLaze: external_exports.object({ count: count13, maxAheadMs: external_exports.number().int() }).optional()
103900
+ chatAheadOfLaze: external_exports.object({ count: count15, maxAheadMs: external_exports.number().int() }).optional()
103437
103901
  })
103438
103902
  });
103439
103903
  var computerBrowserInputDefinition = external_exports.object({
@@ -103852,6 +104316,20 @@ var OPS_FUNCTIONS = {
103852
104316
  input: serviceTracesInputDefinition,
103853
104317
  output: serviceTracesOutputDefinition
103854
104318
  }),
104319
+ "wiki.support_pages": entry({
104320
+ title: "Wiki pages in a Laze Support channel or the staff triage, and their workspaces, as counts",
104321
+ scope: "platform",
104322
+ view: "numbers",
104323
+ input: noInputDefinition,
104324
+ output: wikiSupportPageCountSchema
104325
+ }),
104326
+ "wiki.locked_pages": entry({
104327
+ title: "Wiki pages no one can edit, as workspace and page ids with their counts",
104328
+ scope: "platform",
104329
+ view: "numbers",
104330
+ input: noInputDefinition,
104331
+ output: wikiLockedPagesSchema
104332
+ }),
103855
104333
  "tenant.snapshot": entry({
103856
104334
  title: "One workspace's plan, members, agents and flags, as counts",
103857
104335
  scope: "tenant",
@@ -104281,9 +104759,9 @@ function sessionIdOf({ session }) {
104281
104759
  }
104282
104760
  async function rushWakeHook({ context, args }) {
104283
104761
  const claudePid = Number(flagText({ args, name: "claude-pid" }));
104284
- const id8 = flagText({ args, name: "rush-id" });
104762
+ const id9 = flagText({ args, name: "rush-id" });
104285
104763
  const program = flagText({ args, name: "rush-program" }) || "rush";
104286
- if (!claudePid || !id8) return 1;
104764
+ if (!claudePid || !id9) return 1;
104287
104765
  if (!await claimRushGuard({ context, claudePid })) return 0;
104288
104766
  const path = guardPathOf({ context, claudePid });
104289
104767
  try {
@@ -104293,7 +104771,7 @@ async function rushWakeHook({ context, args }) {
104293
104771
  const note = await readStateJson({ path: noted });
104294
104772
  const { launch = {}, ...session } = note ?? {};
104295
104773
  const lock = statePathOf({ context, kind: "waiters", profile: name3 });
104296
- const rush = { id: id8, program };
104774
+ const rush = { id: id9, program };
104297
104775
  const known = note ? session : void 0;
104298
104776
  const guard = { context, client, name: name3, lock, claudePid, session: known, rush, launch };
104299
104777
  try {
@@ -105978,12 +106456,12 @@ In openclaw.json: secrets.providers.laze = { "source": "exec", "command": "laze"
105978
106456
  "args": ["--profile", "<agent profile>", "vault", "exec-provider"], "jsonOnly": true }`;
105979
106457
  function execProviderIds({ request: request2 }) {
105980
106458
  const ids = request2?.ids;
105981
- return Array.isArray(ids) ? ids.filter((id8) => typeof id8 === "string") : [];
106459
+ return Array.isArray(ids) ? ids.filter((id9) => typeof id9 === "string") : [];
105982
106460
  }
105983
- function splitExecId({ id: id8 }) {
105984
- const at8 = id8.indexOf("#");
105985
- if (at8 === -1) return { connection: id8 };
105986
- return { connection: id8.slice(0, at8), field: id8.slice(at8 + 1) };
106461
+ function splitExecId({ id: id9 }) {
106462
+ const at8 = id9.indexOf("#");
106463
+ if (at8 === -1) return { connection: id9 };
106464
+ return { connection: id9.slice(0, at8), field: id9.slice(at8 + 1) };
105987
106465
  }
105988
106466
  function valueOf({
105989
106467
  fields,
@@ -106018,29 +106496,29 @@ ${EXEC_PROVIDER_USAGE}`);
106018
106496
  ids.length === 0 ? [] : (await resolveBatch({
106019
106497
  context,
106020
106498
  args,
106021
- refs: [...new Set(ids.map((id8) => splitExecId({ id: id8 }).connection))]
106499
+ refs: [...new Set(ids.map((id9) => splitExecId({ id: id9 }).connection))]
106022
106500
  })).filter((entry2) => entry2.connection).map((entry2) => entry2.ref)
106023
106501
  );
106024
- for (const id8 of ids) {
106025
- const { connection, field } = splitExecId({ id: id8 });
106502
+ for (const id9 of ids) {
106503
+ const { connection, field } = splitExecId({ id: id9 });
106026
106504
  if (!known.has(connection)) {
106027
- errors[id8] = { code: "NOT_FOUND" };
106505
+ errors[id9] = { code: "NOT_FOUND" };
106028
106506
  continue;
106029
106507
  }
106030
106508
  const outcome = await releaseBatch({
106031
106509
  context,
106032
106510
  args: noWait,
106033
106511
  refs: [connection],
106034
- reason: `OpenClaw resolves its ${id8} secret reference`,
106035
- command: ["openclaw", "secrets", "resolve", id8]
106512
+ reason: `OpenClaw resolves its ${id9} secret reference`,
106513
+ command: ["openclaw", "secrets", "resolve", id9]
106036
106514
  }).catch(() => ({ exitCode: -1 }));
106037
106515
  if ("exitCode" in outcome) {
106038
- errors[id8] = { code: codeOfExit({ exitCode: outcome.exitCode }) };
106516
+ errors[id9] = { code: codeOfExit({ exitCode: outcome.exitCode }) };
106039
106517
  continue;
106040
106518
  }
106041
106519
  const value = valueOf({ fields: outcome.released.get(connection)?.fields ?? {}, field });
106042
- if (typeof value === "string") values[id8] = value;
106043
- else errors[id8] = value;
106520
+ if (typeof value === "string") values[id9] = value;
106521
+ else errors[id9] = value;
106044
106522
  }
106045
106523
  const answer6 = {
106046
106524
  protocolVersion: 1,
@@ -106174,7 +106652,7 @@ async function vaultSave({ context, args }) {
106174
106652
  // src/services/vault-scrub-commands.service.ts
106175
106653
  function lineOf6(channel) {
106176
106654
  const where = channel.name ? `#${channel.name}` : channel.channelId;
106177
- const found = Object.entries(channel.found).map(([vendor, count14]) => `${vendor} ${count14}`).join(", ");
106655
+ const found = Object.entries(channel.found).map(([vendor, count16]) => `${vendor} ${count16}`).join(", ");
106178
106656
  const kinds = [`held ${channel.held}`, ...found ? [`found: ${found}`] : []].join("; ");
106179
106657
  return `${where} scanned ${channel.scanned} changed ${channel.messages} ${kinds}
106180
106658
  `;
@@ -106515,15 +106993,15 @@ var RECORD_WHATSAPP_BUSINESS_SEND_UNRESOLVED_COMMAND_TYPE = `${prefix}.unresolve
106515
106993
  var WHATSAPP_BUSINESS_SEND_UNRESOLVED_EVENT_TYPE = `${prefix}.unresolved`;
106516
106994
  var WHATSAPP_BUSINESS_EVIDENCE = ["sent", "delivered", "read"];
106517
106995
  var whatsappBusinessEvidenceSchema = external_exports.enum(WHATSAPP_BUSINESS_EVIDENCE);
106518
- var id7 = external_exports.string().min(1).max(200);
106996
+ var id8 = external_exports.string().min(1).max(200);
106519
106997
  var at7 = external_exports.iso.datetime();
106520
106998
  var code3 = external_exports.string().min(1).max(64).regex(/^[a-z_]+$/);
106521
106999
  var sendRef2 = {
106522
- workspaceId: id7,
106523
- connectionId: id7,
106524
- sendId: id7,
107000
+ workspaceId: id8,
107001
+ connectionId: id8,
107002
+ sendId: id8,
106525
107003
  /** `wab-send:<send id>`: the stream's id. */
106526
- stream: id7,
107004
+ stream: id8,
106527
107005
  at: at7
106528
107006
  };
106529
107007
  var requestedDefinition = external_exports.object({
@@ -106532,12 +107010,12 @@ var requestedDefinition = external_exports.object({
106532
107010
  /** After this, with no answer from Meta, the send reads unconfirmed. */
106533
107011
  sendBy: at7
106534
107012
  });
106535
- var heldDefinition = external_exports.object({ ...sendRef2, attentionId: id7 });
107013
+ var heldDefinition = external_exports.object({ ...sendRef2, attentionId: id8 });
106536
107014
  var releasedDefinition = external_exports.object({ ...sendRef2, sendBy: at7 });
106537
- var acceptedDefinition = external_exports.object({ ...sendRef2, wamid: id7 });
107015
+ var acceptedDefinition = external_exports.object({ ...sendRef2, wamid: id8 });
106538
107016
  var evidencedDefinition = external_exports.object({
106539
107017
  ...sendRef2,
106540
- wamid: id7,
107018
+ wamid: id8,
106541
107019
  evidence: whatsappBusinessEvidenceSchema
106542
107020
  });
106543
107021
  var refusedDefinition = external_exports.object({ ...sendRef2, code: code3 });
@@ -107227,7 +107705,8 @@ import { basename as basename13, resolve as resolve28 } from "node:path";
107227
107705
  var WIKI_FILE_USAGE = ` laze wiki attach <path> <file> [--name <name>] [--type <mime>]
107228
107706
  uploads a file to the page (up to 25 MB) and prints the markdown that embeds it
107229
107707
  laze wiki files <path> the page's files, with their addresses
107230
- laze wiki file <file-id> a short-lived link to a file's bytes`;
107708
+ laze wiki file <file-id> a short-lived link to a file's bytes
107709
+ laze wiki file rm <file-id> removes the file from its page, bytes too`;
107231
107710
  function wikiFileMarkdown(file4) {
107232
107711
  const label3 = file4.name.replace(/[[\]]/g, "");
107233
107712
  return `${file4.contentType.startsWith("image/") ? "!" : ""}[${label3}](${file4.url})`;
@@ -107272,7 +107751,18 @@ var files2 = async ({ context, args, usage: usage2 }) => {
107272
107751
  context.out(`${one.id} ${one.name} ${one.contentType} ${one.sizeBytes} ${one.url}
107273
107752
  `);
107274
107753
  };
107754
+ var remove10 = async ({ context, args, usage: usage2 }) => {
107755
+ const fileId = args.words[3];
107756
+ if (!fileId) throw new CliUsageError(usage2);
107757
+ const { client } = await signedIn({ context, args });
107758
+ const answer6 = await client.post("/api/wiki/file/remove", { fileId });
107759
+ if (args.flags.json) return context.out(`${JSON.stringify(answer6, null, 2)}
107760
+ `);
107761
+ context.out(`Removed ${fileId}
107762
+ `);
107763
+ };
107275
107764
  var link = async ({ context, args, usage: usage2 }) => {
107765
+ if (args.words[2] === "rm") return remove10({ context, args, usage: usage2 });
107276
107766
  const fileId = args.words[2];
107277
107767
  if (!fileId) throw new CliUsageError(usage2);
107278
107768
  const { client } = await signedIn({ context, args });
@@ -107301,9 +107791,10 @@ var USAGE21 = `Usage:
107301
107791
  laze wiki rm <path> the page and its history; pages under it stay
107302
107792
  laze wiki share <path> who sees a page or folder, and what they can do
107303
107793
  [--visibility restricted|channel|internal|public] [--role view|edit] [--channel <channel>]
107304
- [--grant <who>[:view|edit]]... [--revoke <who>]... [--reset]
107794
+ [--grant <who>[:view|edit]]... [--revoke <who>]... [--reset] [--take-back]
107305
107795
  <who> is #channel, @group, an email, or a person's or agent's name. --reset takes the
107306
- folder's sharing again. Agents can only narrow sharing.
107796
+ folder's sharing again. --take-back gives an Owner or Admin edit on a page no one can
107797
+ edit. Agents can only narrow sharing.
107307
107798
  laze wiki pin <path> --channel <channel> [--role view|edit | --view-only]
107308
107799
  shows the page or folder as a tab of the conversation; its members get edit, or view
107309
107800
  laze wiki unpin <path> --channel <channel> the access the pin gave goes with it
@@ -107448,6 +107939,8 @@ async function wikiShare({ context, args }) {
107448
107939
  let sharing = null;
107449
107940
  if (args.flags.reset)
107450
107941
  sharing = await client.post("/api/wiki/sharing/reset", { path });
107942
+ if (args.flags["take-back"])
107943
+ sharing = await client.post("/api/wiki/sharing/take-back", { path });
107451
107944
  if (visibility || memberRole || channel) {
107452
107945
  sharing = await client.post("/api/wiki/sharing", {
107453
107946
  path,
@@ -107549,8 +108042,8 @@ async function roles({ context, args }) {
107549
108042
  const catalogue = await client.get("/api/roles");
107550
108043
  if (args.flags.json) return printJson11(context, catalogue);
107551
108044
  for (const role2 of catalogue) {
107552
- const count14 = `${role2.permissions.length} permissions`;
107553
- context.out(`${role2.label} ${count14} ${role2.description}
108045
+ const count16 = `${role2.permissions.length} permissions`;
108046
+ context.out(`${role2.label} ${count16} ${role2.description}
107554
108047
  `);
107555
108048
  context.out(` ${role2.permissions.join(", ")}
107556
108049
  `);