@lazehq/cli 0.1.103 → 0.1.105

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 +842 -395
  2. package/package.json +1 -1
package/dist/laze.mjs CHANGED
@@ -5926,8 +5926,8 @@ var require_util = __commonJS({
5926
5926
  const rawHeaders = [];
5927
5927
  for (const [name3, value] of Object.entries(headers)) {
5928
5928
  if (Array.isArray(value)) {
5929
- for (const entry of value) {
5930
- rawHeaders.push(name3, `${entry}`);
5929
+ for (const entry2 of value) {
5930
+ rawHeaders.push(name3, `${entry2}`);
5931
5931
  }
5932
5932
  } else {
5933
5933
  rawHeaders.push(name3, `${value}`);
@@ -5953,8 +5953,8 @@ var require_util = __commonJS({
5953
5953
  const rawHeaders = [];
5954
5954
  for (const [name3, value] of Object.entries(headers)) {
5955
5955
  if (Array.isArray(value)) {
5956
- for (const entry of value) {
5957
- rawHeaders.push(Buffer.from(name3, "latin1"), Buffer.from(`${entry}`, "latin1"));
5956
+ for (const entry2 of value) {
5957
+ rawHeaders.push(Buffer.from(name3, "latin1"), Buffer.from(`${entry2}`, "latin1"));
5958
5958
  }
5959
5959
  } else {
5960
5960
  rawHeaders.push(Buffer.from(name3, "latin1"), Buffer.from(`${value}`, "latin1"));
@@ -10391,22 +10391,22 @@ var require_formdata = __commonJS({
10391
10391
  } else {
10392
10392
  value = webidl.converters.USVString(value);
10393
10393
  }
10394
- const entry = makeEntry(name3, value, filename);
10395
- this.#state.push(entry);
10394
+ const entry2 = makeEntry(name3, value, filename);
10395
+ this.#state.push(entry2);
10396
10396
  }
10397
10397
  delete(name3) {
10398
10398
  webidl.brandCheck(this, _FormData);
10399
10399
  const prefix = "FormData.delete";
10400
10400
  webidl.argumentLengthCheck(arguments, 1, prefix);
10401
10401
  name3 = webidl.converters.USVString(name3);
10402
- this.#state = this.#state.filter((entry) => entry.name !== name3);
10402
+ this.#state = this.#state.filter((entry2) => entry2.name !== name3);
10403
10403
  }
10404
10404
  get(name3) {
10405
10405
  webidl.brandCheck(this, _FormData);
10406
10406
  const prefix = "FormData.get";
10407
10407
  webidl.argumentLengthCheck(arguments, 1, prefix);
10408
10408
  name3 = webidl.converters.USVString(name3);
10409
- const idx = this.#state.findIndex((entry) => entry.name === name3);
10409
+ const idx = this.#state.findIndex((entry2) => entry2.name === name3);
10410
10410
  if (idx === -1) {
10411
10411
  return null;
10412
10412
  }
@@ -10417,14 +10417,14 @@ var require_formdata = __commonJS({
10417
10417
  const prefix = "FormData.getAll";
10418
10418
  webidl.argumentLengthCheck(arguments, 1, prefix);
10419
10419
  name3 = webidl.converters.USVString(name3);
10420
- return this.#state.filter((entry) => entry.name === name3).map((entry) => entry.value);
10420
+ return this.#state.filter((entry2) => entry2.name === name3).map((entry2) => entry2.value);
10421
10421
  }
10422
10422
  has(name3) {
10423
10423
  webidl.brandCheck(this, _FormData);
10424
10424
  const prefix = "FormData.has";
10425
10425
  webidl.argumentLengthCheck(arguments, 1, prefix);
10426
10426
  name3 = webidl.converters.USVString(name3);
10427
- return this.#state.findIndex((entry) => entry.name === name3) !== -1;
10427
+ return this.#state.findIndex((entry2) => entry2.name === name3) !== -1;
10428
10428
  }
10429
10429
  set(name3, value, filename = void 0) {
10430
10430
  webidl.brandCheck(this, _FormData);
@@ -10439,16 +10439,16 @@ var require_formdata = __commonJS({
10439
10439
  } else {
10440
10440
  value = webidl.converters.USVString(value);
10441
10441
  }
10442
- const entry = makeEntry(name3, value, filename);
10443
- const idx = this.#state.findIndex((entry2) => entry2.name === name3);
10442
+ const entry2 = makeEntry(name3, value, filename);
10443
+ const idx = this.#state.findIndex((entry3) => entry3.name === name3);
10444
10444
  if (idx !== -1) {
10445
10445
  this.#state = [
10446
10446
  ...this.#state.slice(0, idx),
10447
- entry,
10448
- ...this.#state.slice(idx + 1).filter((entry2) => entry2.name !== name3)
10447
+ entry2,
10448
+ ...this.#state.slice(idx + 1).filter((entry3) => entry3.name !== name3)
10449
10449
  ];
10450
10450
  } else {
10451
- this.#state.push(entry);
10451
+ this.#state.push(entry2);
10452
10452
  }
10453
10453
  }
10454
10454
  [nodeUtil.inspect.custom](depth, options) {
@@ -16262,14 +16262,14 @@ var require_env_http_proxy_agent = __commonJS({
16262
16262
  return false;
16263
16263
  }
16264
16264
  for (let i = 0; i < this.#noProxyEntries.length; i++) {
16265
- const entry = this.#noProxyEntries[i];
16266
- if (entry.port && entry.port !== port) {
16265
+ const entry2 = this.#noProxyEntries[i];
16266
+ if (entry2.port && entry2.port !== port) {
16267
16267
  continue;
16268
16268
  }
16269
- if (hostname8 === entry.hostname) {
16269
+ if (hostname8 === entry2.hostname) {
16270
16270
  return false;
16271
16271
  }
16272
- if (hostname8.slice(-(entry.hostname.length + 1)) === `.${entry.hostname}`) {
16272
+ if (hostname8.slice(-(entry2.hostname.length + 1)) === `.${entry2.hostname}`) {
16273
16273
  return false;
16274
16274
  }
16275
16275
  }
@@ -16280,17 +16280,17 @@ var require_env_http_proxy_agent = __commonJS({
16280
16280
  const noProxySplit = noProxyValue.split(/[,\s]/);
16281
16281
  const noProxyEntries = [];
16282
16282
  for (let i = 0; i < noProxySplit.length; i++) {
16283
- const entry = noProxySplit[i];
16284
- if (!entry) {
16283
+ const entry2 = noProxySplit[i];
16284
+ if (!entry2) {
16285
16285
  continue;
16286
16286
  }
16287
16287
  let hostname8, port;
16288
- const ipv6WithPort = entry.match(/^\[(.+)\]:(\d+)$/);
16288
+ const ipv6WithPort = entry2.match(/^\[(.+)\]:(\d+)$/);
16289
16289
  if (ipv6WithPort) {
16290
16290
  hostname8 = ipv6WithPort[1];
16291
16291
  port = Number.parseInt(ipv6WithPort[2], 10);
16292
16292
  } else {
16293
- const unbracketed = entry.replace(/^\[(.+)\]$/, "$1");
16293
+ const unbracketed = entry2.replace(/^\[(.+)\]$/, "$1");
16294
16294
  const colonCount = (unbracketed.match(/:/g) || []).length;
16295
16295
  const parsed = colonCount === 1 && unbracketed.match(/^(.+):(\d+)$/);
16296
16296
  hostname8 = parsed ? parsed[1] : unbracketed;
@@ -22731,18 +22731,18 @@ var require_memory_cache_store = __commonJS({
22731
22731
  const topLevelKey = `${key.origin}:${key.path}`;
22732
22732
  const now = Date.now();
22733
22733
  const entries = this.#entries.get(topLevelKey);
22734
- const entry = entries ? findEntry(key, entries, now) : null;
22735
- return entry == null ? void 0 : {
22736
- statusMessage: entry.statusMessage,
22737
- statusCode: entry.statusCode,
22738
- headers: entry.headers,
22739
- body: entry.body,
22740
- vary: entry.vary ? entry.vary : void 0,
22741
- etag: entry.etag,
22742
- cacheControlDirectives: entry.cacheControlDirectives,
22743
- cachedAt: entry.cachedAt,
22744
- staleAt: entry.staleAt,
22745
- deleteAt: entry.deleteAt
22734
+ const entry2 = entries ? findEntry(key, entries, now) : null;
22735
+ return entry2 == null ? void 0 : {
22736
+ statusMessage: entry2.statusMessage,
22737
+ statusCode: entry2.statusCode,
22738
+ headers: entry2.headers,
22739
+ body: entry2.body,
22740
+ vary: entry2.vary ? entry2.vary : void 0,
22741
+ etag: entry2.etag,
22742
+ cacheControlDirectives: entry2.cacheControlDirectives,
22743
+ cachedAt: entry2.cachedAt,
22744
+ staleAt: entry2.staleAt,
22745
+ deleteAt: entry2.deleteAt
22746
22746
  };
22747
22747
  }
22748
22748
  /**
@@ -22755,17 +22755,17 @@ var require_memory_cache_store = __commonJS({
22755
22755
  assertCacheValue(val);
22756
22756
  const topLevelKey = `${key.origin}:${key.path}`;
22757
22757
  const store = this;
22758
- const entry = { ...key, ...val, body: [], size: 0 };
22758
+ const entry2 = { ...key, ...val, body: [], size: 0 };
22759
22759
  return new Writable({
22760
22760
  write(chunk, encoding, callback) {
22761
22761
  if (typeof chunk === "string") {
22762
22762
  chunk = Buffer.from(chunk, encoding);
22763
22763
  }
22764
- entry.size += chunk.byteLength;
22765
- if (entry.size > store.#maxEntrySize) {
22764
+ entry2.size += chunk.byteLength;
22765
+ if (entry2.size > store.#maxEntrySize) {
22766
22766
  this.destroy();
22767
22767
  } else {
22768
- entry.body.push(chunk);
22768
+ entry2.body.push(chunk);
22769
22769
  }
22770
22770
  callback(null);
22771
22771
  },
@@ -22778,13 +22778,13 @@ var require_memory_cache_store = __commonJS({
22778
22778
  const previousEntry = findEntry(key, entries, Date.now());
22779
22779
  if (previousEntry) {
22780
22780
  const index = entries.indexOf(previousEntry);
22781
- entries.splice(index, 1, entry);
22781
+ entries.splice(index, 1, entry2);
22782
22782
  store.#size -= previousEntry.size;
22783
22783
  } else {
22784
- entries.push(entry);
22784
+ entries.push(entry2);
22785
22785
  store.#count += 1;
22786
22786
  }
22787
- store.#size += entry.size;
22787
+ store.#size += entry2.size;
22788
22788
  if (store.#size > store.#maxSize || store.#count > store.#maxCount) {
22789
22789
  if (!store.#hasEmittedMaxSizeEvent) {
22790
22790
  store.emit("maxSizeExceeded", {
@@ -22796,8 +22796,8 @@ var require_memory_cache_store = __commonJS({
22796
22796
  store.#hasEmittedMaxSizeEvent = true;
22797
22797
  }
22798
22798
  for (const [key2, entries2] of store.#entries) {
22799
- for (const entry2 of entries2.splice(0, entries2.length / 2)) {
22800
- store.#size -= entry2.size;
22799
+ for (const entry3 of entries2.splice(0, entries2.length / 2)) {
22800
+ store.#size -= entry3.size;
22801
22801
  store.#count -= 1;
22802
22802
  }
22803
22803
  if (entries2.length === 0) {
@@ -22820,8 +22820,8 @@ var require_memory_cache_store = __commonJS({
22820
22820
  throw new TypeError(`expected key to be object, got ${typeof key}`);
22821
22821
  }
22822
22822
  const topLevelKey = `${key.origin}:${key.path}`;
22823
- for (const entry of this.#entries.get(topLevelKey) ?? []) {
22824
- this.#size -= entry.size;
22823
+ for (const entry2 of this.#entries.get(topLevelKey) ?? []) {
22824
+ this.#size -= entry2.size;
22825
22825
  this.#count -= 1;
22826
22826
  }
22827
22827
  this.#entries.delete(topLevelKey);
@@ -22829,18 +22829,18 @@ var require_memory_cache_store = __commonJS({
22829
22829
  };
22830
22830
  function findEntry(key, entries, now) {
22831
22831
  for (let i = 0; i < entries.length; i++) {
22832
- const entry = entries[i];
22833
- if (entry.deleteAt > now && entry.method === key.method && varyMatches(key, entry)) {
22834
- return entry;
22832
+ const entry2 = entries[i];
22833
+ if (entry2.deleteAt > now && entry2.method === key.method && varyMatches(key, entry2)) {
22834
+ return entry2;
22835
22835
  }
22836
22836
  }
22837
22837
  }
22838
- function varyMatches(key, entry) {
22839
- if (entry.vary == null) {
22838
+ function varyMatches(key, entry2) {
22839
+ if (entry2.vary == null) {
22840
22840
  return true;
22841
22841
  }
22842
- for (const headerName in entry.vary) {
22843
- if (Object.hasOwn(entry.vary, headerName) && !headerValueEquals(key.headers?.[headerName], entry.vary[headerName])) {
22842
+ for (const headerName in entry2.vary) {
22843
+ if (Object.hasOwn(entry2.vary, headerName) && !headerValueEquals(key.headers?.[headerName], entry2.vary[headerName])) {
22844
22844
  return false;
22845
22845
  }
22846
22846
  }
@@ -26321,8 +26321,8 @@ var require_fetch = __commonJS({
26321
26321
  }
26322
26322
  for (const [name3, value] of Object.entries(headers ?? {})) {
26323
26323
  if (Array.isArray(value)) {
26324
- for (const entry of value) {
26325
- headersList.append(name3, `${entry}`, true);
26324
+ for (const entry2 of value) {
26325
+ headersList.append(name3, `${entry2}`, true);
26326
26326
  }
26327
26327
  } else {
26328
26328
  headersList.append(name3, `${value}`, true);
@@ -31077,15 +31077,15 @@ ${value}`;
31077
31077
  pos = 0;
31078
31078
  }
31079
31079
  }
31080
- discardLeadingBytes(count5) {
31081
- while (count5 > 0 && this.lineChunkIndex < this.chunks.length) {
31080
+ discardLeadingBytes(count6) {
31081
+ while (count6 > 0 && this.lineChunkIndex < this.chunks.length) {
31082
31082
  const chunk = this.chunks[this.lineChunkIndex];
31083
31083
  const remaining = chunk.length - this.linePos;
31084
- if (count5 < remaining) {
31085
- this.linePos += count5;
31086
- count5 = 0;
31084
+ if (count6 < remaining) {
31085
+ this.linePos += count6;
31086
+ count6 = 0;
31087
31087
  } else {
31088
- count5 -= remaining;
31088
+ count6 -= remaining;
31089
31089
  this.lineChunkIndex++;
31090
31090
  this.linePos = 0;
31091
31091
  }
@@ -31834,8 +31834,8 @@ function shannonEntropyBits(value) {
31834
31834
  const counts = /* @__PURE__ */ new Map();
31835
31835
  for (const char of sample) counts.set(char, (counts.get(char) ?? 0) + 1);
31836
31836
  let entropy = 0;
31837
- for (const count5 of counts.values()) {
31838
- const p = count5 / sample.length;
31837
+ for (const count6 of counts.values()) {
31838
+ const p = count6 / sample.length;
31839
31839
  entropy -= p * Math.log2(p);
31840
31840
  }
31841
31841
  return entropy;
@@ -36960,7 +36960,7 @@ function shadowedLinkLineOf({ shadow }) {
36960
36960
  }
36961
36961
 
36962
36962
  // src/rules/cli-version.rules.ts
36963
- var STAMPED = "0.1.103";
36963
+ var STAMPED = "0.1.105";
36964
36964
  function cliVersionOf({ stamped = STAMPED } = {}) {
36965
36965
  return stamped.startsWith("__") ? "dev" : stamped;
36966
36966
  }
@@ -37414,7 +37414,8 @@ var SWITCHES = /* @__PURE__ */ new Set([
37414
37414
  "self",
37415
37415
  "all",
37416
37416
  "resend",
37417
- "replace"
37417
+ "replace",
37418
+ "ask"
37418
37419
  ]);
37419
37420
  function parseArgs({ argv }) {
37420
37421
  const words = [];
@@ -38724,14 +38725,14 @@ function codePointLength(str) {
38724
38725
  const units = str.length;
38725
38726
  if (!highSurrogate.test(str))
38726
38727
  return units;
38727
- let count5 = units;
38728
+ let count6 = units;
38728
38729
  for (let i = 0; i < units - 1; i++) {
38729
38730
  if ((str.charCodeAt(i) & 64512) === 55296 && (str.charCodeAt(i + 1) & 64512) === 56320) {
38730
- count5--;
38731
+ count6--;
38731
38732
  i++;
38732
38733
  }
38733
38734
  }
38734
- return count5;
38735
+ return count6;
38735
38736
  }
38736
38737
  function getLengthableOrigin(input2) {
38737
38738
  if (Array.isArray(input2))
@@ -42692,9 +42693,9 @@ var memo = {
42692
42693
  if (!bucket)
42693
42694
  return empty;
42694
42695
  handoff = void 0;
42695
- const entry = { value: empty, issues: null };
42696
- bucket.set(payload.value, entry);
42697
- open2.push(entry);
42696
+ const entry2 = { value: empty, issues: null };
42697
+ bucket.set(payload.value, entry2);
42698
+ open2.push(entry2);
42698
42699
  return empty;
42699
42700
  },
42700
42701
  guard(inst) {
@@ -42768,16 +42769,16 @@ var memo = {
42768
42769
  const depth = open2.length;
42769
42770
  const result2 = base(payload, ctx);
42770
42771
  handoff = void 0;
42771
- const entry = open2.length > depth ? open2.pop() : void 0;
42772
+ const entry2 = open2.length > depth ? open2.pop() : void 0;
42772
42773
  if (result2 instanceof Promise) {
42773
42774
  return result2.then((r) => {
42774
- if (entry)
42775
- entry.issues = r.issues.length ? cloneIssues(r.issues) : NO_ISSUES;
42775
+ if (entry2)
42776
+ entry2.issues = r.issues.length ? cloneIssues(r.issues) : NO_ISSUES;
42776
42777
  return r;
42777
42778
  });
42778
42779
  }
42779
- if (entry)
42780
- entry.issues = result2.issues.length ? cloneIssues(result2.issues) : NO_ISSUES;
42780
+ if (entry2)
42781
+ entry2.issues = result2.issues.length ? cloneIssues(result2.issues) : NO_ISSUES;
42781
42782
  return result2;
42782
42783
  };
42783
42784
  inst._zod.parse = wrapped;
@@ -43086,8 +43087,8 @@ function az_default() {
43086
43087
  }
43087
43088
 
43088
43089
  // ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/be.js
43089
- function getBelarusianPlural(count5, one, few, many) {
43090
- const absCount = Math.abs(count5);
43090
+ function getBelarusianPlural(count6, one, few, many) {
43091
+ const absCount = Math.abs(count6);
43091
43092
  const lastDigit = absCount % 10;
43092
43093
  const lastTwoDigits = absCount % 100;
43093
43094
  if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
@@ -45734,8 +45735,8 @@ function hu_default() {
45734
45735
  }
45735
45736
 
45736
45737
  // ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hy.js
45737
- function getArmenianPlural(count5, one, many) {
45738
- return Math.abs(count5) === 1 ? one : many;
45738
+ function getArmenianPlural(count6, one, many) {
45739
+ return Math.abs(count6) === 1 ? one : many;
45739
45740
  }
45740
45741
  function withDefiniteArticle(word3) {
45741
45742
  if (!word3)
@@ -48473,8 +48474,8 @@ function ro_default() {
48473
48474
  }
48474
48475
 
48475
48476
  // ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ru.js
48476
- function getRussianPlural(count5, one, few, many) {
48477
- const absCount = Math.abs(count5);
48477
+ function getRussianPlural(count6, one, few, many) {
48478
+ const absCount = Math.abs(count6);
48478
48479
  const lastDigit = absCount % 10;
48479
48480
  const lastTwoDigits = absCount % 100;
48480
48481
  if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
@@ -53183,42 +53184,42 @@ function extractDefs(ctx, schema) {
53183
53184
  if (ctx.external && ctx.sharedDefsExtractedFor === ctx.external)
53184
53185
  return;
53185
53186
  const idToSchema = /* @__PURE__ */ new Map();
53186
- for (const entry of ctx.seen.entries()) {
53187
- const id4 = ctx.metadataRegistry.get(entry[0])?.id;
53187
+ for (const entry2 of ctx.seen.entries()) {
53188
+ const id4 = ctx.metadataRegistry.get(entry2[0])?.id;
53188
53189
  if (id4) {
53189
53190
  const existing = idToSchema.get(id4);
53190
- if (existing && existing !== entry[0]) {
53191
+ if (existing && existing !== entry2[0]) {
53191
53192
  throw new Error(`Duplicate schema id "${id4}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
53192
53193
  }
53193
- idToSchema.set(id4, entry[0]);
53194
+ idToSchema.set(id4, entry2[0]);
53194
53195
  }
53195
53196
  }
53196
- const makeURI = (entry) => {
53197
+ const makeURI = (entry2) => {
53197
53198
  const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
53198
53199
  if (ctx.external) {
53199
- const externalId = ctx.external.registry.get(entry[0])?.id;
53200
+ const externalId = ctx.external.registry.get(entry2[0])?.id;
53200
53201
  const uriGenerator = ctx.external.uri ?? ((id5) => id5);
53201
53202
  if (externalId) {
53202
53203
  return { ref: uriGenerator(externalId) };
53203
53204
  }
53204
- const id4 = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
53205
- entry[1].defId = id4;
53205
+ const id4 = entry2[1].defId ?? entry2[1].schema.id ?? `schema${ctx.counter++}`;
53206
+ entry2[1].defId = id4;
53206
53207
  return { defId: id4, ref: `${uriGenerator("__shared")}#/${defsSegment}/${encodeJSONPointerSegment(id4)}` };
53207
53208
  }
53208
53209
  const uriPrefix = `#`;
53209
53210
  const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
53210
- if (entry[1] === root && !entry[1].schema.id) {
53211
+ if (entry2[1] === root && !entry2[1].schema.id) {
53211
53212
  return { ref: uriPrefix };
53212
53213
  }
53213
- const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
53214
+ const defId = entry2[1].schema.id ?? `__schema${ctx.counter++}`;
53214
53215
  return { defId, ref: defUriPrefix + encodeJSONPointerSegment(defId) };
53215
53216
  };
53216
- const extractToDef = (entry) => {
53217
- if (entry[1].schema.$ref) {
53217
+ const extractToDef = (entry2) => {
53218
+ if (entry2[1].schema.$ref) {
53218
53219
  return;
53219
53220
  }
53220
- const seen = entry[1];
53221
- const { ref, defId } = makeURI(entry);
53221
+ const seen = entry2[1];
53222
+ const { ref, defId } = makeURI(entry2);
53222
53223
  seen.def = { ...seen.schema };
53223
53224
  if (defId)
53224
53225
  seen.defId = defId;
@@ -53229,8 +53230,8 @@ function extractDefs(ctx, schema) {
53229
53230
  schema2.$ref = ref;
53230
53231
  };
53231
53232
  if (ctx.cycles === "throw") {
53232
- for (const entry of ctx.seen.entries()) {
53233
- const seen = entry[1];
53233
+ for (const entry2 of ctx.seen.entries()) {
53234
+ const seen = entry2[1];
53234
53235
  if (seen.cycle) {
53235
53236
  throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/<root>
53236
53237
 
@@ -53238,31 +53239,31 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
53238
53239
  }
53239
53240
  }
53240
53241
  }
53241
- for (const entry of ctx.seen.entries()) {
53242
- const seen = entry[1];
53243
- if (schema === entry[0]) {
53244
- extractToDef(entry);
53242
+ for (const entry2 of ctx.seen.entries()) {
53243
+ const seen = entry2[1];
53244
+ if (schema === entry2[0]) {
53245
+ extractToDef(entry2);
53245
53246
  continue;
53246
53247
  }
53247
53248
  if (ctx.external) {
53248
- const ext = ctx.external.registry.get(entry[0])?.id;
53249
- if (schema !== entry[0] && ext) {
53250
- extractToDef(entry);
53249
+ const ext = ctx.external.registry.get(entry2[0])?.id;
53250
+ if (schema !== entry2[0] && ext) {
53251
+ extractToDef(entry2);
53251
53252
  continue;
53252
53253
  }
53253
53254
  }
53254
- const id4 = ctx.metadataRegistry.get(entry[0])?.id;
53255
+ const id4 = ctx.metadataRegistry.get(entry2[0])?.id;
53255
53256
  if (id4) {
53256
- extractToDef(entry);
53257
+ extractToDef(entry2);
53257
53258
  continue;
53258
53259
  }
53259
53260
  if (seen.cycle) {
53260
- extractToDef(entry);
53261
+ extractToDef(entry2);
53261
53262
  continue;
53262
53263
  }
53263
53264
  if (seen.count > 1) {
53264
53265
  if (ctx.reused === "ref") {
53265
- extractToDef(entry);
53266
+ extractToDef(entry2);
53266
53267
  }
53267
53268
  }
53268
53269
  }
@@ -53444,12 +53445,12 @@ function finalize(ctx, schema) {
53444
53445
  });
53445
53446
  };
53446
53447
  if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {
53447
- for (const entry of [...ctx.seen.entries()].reverse()) {
53448
- flattenRef(entry[0]);
53448
+ for (const entry2 of [...ctx.seen.entries()].reverse()) {
53449
+ flattenRef(entry2[0]);
53449
53450
  }
53450
53451
  if (ctx.target !== "openapi-3.0") {
53451
- for (const entry of ctx.seen.entries()) {
53452
- compactTypeUnion(entry[1].def ?? entry[1].schema);
53452
+ for (const entry2 of ctx.seen.entries()) {
53453
+ compactTypeUnion(entry2[1].def ?? entry2[1].schema);
53453
53454
  }
53454
53455
  }
53455
53456
  for (const rewrite of ctx.deferred)
@@ -53496,8 +53497,8 @@ function finalize(ctx, schema) {
53496
53497
  delete result2.id;
53497
53498
  const defs = ctx.external?.defs ?? {};
53498
53499
  if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {
53499
- for (const entry of ctx.seen.entries()) {
53500
- const seen = entry[1];
53500
+ for (const entry2 of ctx.seen.entries()) {
53501
+ const seen = entry2[1];
53501
53502
  if (seen.def && seen.defId) {
53502
53503
  if (seen.def.id === seen.defId)
53503
53504
  delete seen.def.id;
@@ -54109,9 +54110,9 @@ function stringifyKeyNames(bySchema, json7, visited) {
54109
54110
  var pendingRecords = /* @__PURE__ */ new WeakMap();
54110
54111
  function rewriteKeyNames(ctx) {
54111
54112
  const bySchema = /* @__PURE__ */ new Map();
54112
- for (const entry of ctx.seen.values()) {
54113
- if (entry.def && !bySchema.has(entry.schema))
54114
- bySchema.set(entry.schema, entry);
54113
+ for (const entry2 of ctx.seen.values()) {
54114
+ if (entry2.def && !bySchema.has(entry2.schema))
54115
+ bySchema.set(entry2.schema, entry2);
54115
54116
  }
54116
54117
  const rewrites = /* @__PURE__ */ new Map();
54117
54118
  for (const record4 of pendingRecords.get(ctx) ?? []) {
@@ -54125,8 +54126,8 @@ function rewriteKeyNames(ctx) {
54125
54126
  }
54126
54127
  if (!rewrites.size)
54127
54128
  return;
54128
- for (const entry of ctx.seen.values()) {
54129
- for (const carrier of [entry.schema, entry.def]) {
54129
+ for (const entry2 of ctx.seen.values()) {
54130
+ for (const carrier of [entry2.schema, entry2.def]) {
54130
54131
  const rewritten = carrier && rewrites.get(carrier.propertyNames);
54131
54132
  if (rewritten)
54132
54133
  carrier.propertyNames = rewritten;
@@ -54320,8 +54321,8 @@ function toJSONSchema(input2, params) {
54320
54321
  const registry4 = input2;
54321
54322
  const ctx2 = initializeContext({ ...params, processors: allProcessors });
54322
54323
  const defs = {};
54323
- for (const entry of registry4._idmap.entries()) {
54324
- const [_, schema] = entry;
54324
+ for (const entry2 of registry4._idmap.entries()) {
54325
+ const [_, schema] = entry2;
54325
54326
  processSchema(schema, ctx2);
54326
54327
  }
54327
54328
  const schemas = {};
@@ -54331,8 +54332,8 @@ function toJSONSchema(input2, params) {
54331
54332
  defs
54332
54333
  };
54333
54334
  ctx2.external = external2;
54334
- for (const entry of registry4._idmap.entries()) {
54335
- const [key, schema] = entry;
54335
+ for (const entry2 of registry4._idmap.entries()) {
54336
+ const [key, schema] = entry2;
54336
54337
  extractDefs(ctx2, schema);
54337
54338
  assignProp(schemas, key, finalize(ctx2, schema));
54338
54339
  }
@@ -59252,7 +59253,7 @@ var registry3 = {
59252
59253
  var REMEDIATION_CODES = Object.keys(registry3);
59253
59254
  var REMEDIATION_DOC_PATHS = Object.values(
59254
59255
  registry3
59255
- ).map((entry) => entry.docsPath).filter((p) => p !== void 0);
59256
+ ).map((entry2) => entry2.docsPath).filter((p) => p !== void 0);
59256
59257
 
59257
59258
  // ../../packages/handled-error/src/serialized-handled-error.ts
59258
59259
  var handledErrorFaultSchema = external_exports.enum([
@@ -59850,7 +59851,7 @@ var { publicOriginAliases } = Config.define((c) => ({
59850
59851
  )
59851
59852
  }));
59852
59853
  function originsOf({ list: list12 }) {
59853
- const origins = list12.split(",").map((entry) => entry.trim()).filter((entry) => URL.canParse(entry)).map((entry) => new URL(entry)).filter((url2) => url2.protocol === "https:" || url2.protocol === "http:").map((url2) => url2.origin);
59854
+ const origins = list12.split(",").map((entry2) => entry2.trim()).filter((entry2) => URL.canParse(entry2)).map((entry2) => new URL(entry2)).filter((url2) => url2.protocol === "https:" || url2.protocol === "http:").map((url2) => url2.origin);
59854
59855
  return [...new Set(origins)];
59855
59856
  }
59856
59857
  var { appsDomain } = Config.define((c) => ({
@@ -61797,15 +61798,15 @@ function clustersIn({
61797
61798
  const out = [];
61798
61799
  let current3 = null;
61799
61800
  for (let index = segment.start; index <= segment.end; index += 1) {
61800
- const count5 = flagged[index] ?? 0;
61801
- if (count5 === 0) continue;
61801
+ const count6 = flagged[index] ?? 0;
61802
+ if (count6 === 0) continue;
61802
61803
  if (current3 && index - current3.end - 1 <= REDACTED_BLOCK_MAX_GAP) {
61803
61804
  current3.end = index;
61804
- current3.values += count5;
61805
+ current3.values += count6;
61805
61806
  continue;
61806
61807
  }
61807
61808
  if (current3) out.push(current3);
61808
- current3 = { start: index, end: index, values: count5 };
61809
+ current3 = { start: index, end: index, values: count6 };
61809
61810
  }
61810
61811
  if (current3) out.push(current3);
61811
61812
  return out;
@@ -61845,7 +61846,7 @@ function redactedBlocksAt({
61845
61846
  }
61846
61847
  const blocks = redactedBlocks({ lines: lines2, flagged });
61847
61848
  const inside = (line) => blocks.some((block2) => line >= block2.start && line <= block2.end);
61848
- const values = flagged.reduce((sum, count5, line) => inside(line) ? sum + count5 : sum, 0);
61849
+ const values = flagged.reduce((sum, count6, line) => inside(line) ? sum + count6 : sum, 0);
61849
61850
  return { values, insideAt: (offset) => inside(lineAt(offset)) };
61850
61851
  }
61851
61852
 
@@ -62522,7 +62523,9 @@ var layoutQuotedSchemaDefinition = external_exports.object({
62522
62523
  originKey: external_exports.string().min(1).max(200),
62523
62524
  channelId: external_exports.string().min(1).max(100).nullable(),
62524
62525
  seq: external_exports.number().int().positive().nullable(),
62525
- imageId: external_exports.string().min(1).max(100).nullable()
62526
+ imageId: external_exports.string().min(1).max(100).nullable(),
62527
+ /** The Laze person who wrote the original, such as a mirror's owner: their picture shows. */
62528
+ by: external_exports.object({ kind: external_exports.literal("person"), id: external_exports.string().min(1).max(100) }).optional()
62526
62529
  });
62527
62530
  var layoutAttachmentSchemaDefinition = external_exports.object({
62528
62531
  type: external_exports.literal("attachment"),
@@ -62562,6 +62565,10 @@ var messageLayoutSchemaDefinition = external_exports.object({
62562
62565
  });
62563
62566
  var messageLayoutSchema = messageLayoutSchemaDefinition;
62564
62567
 
62568
+ // ../../modules/chat/contract/src/chat.pairs.ts
62569
+ var directPairSchemaDefinition = external_exports.object({ laze: external_exports.string(), slack: external_exports.string() });
62570
+ var directPairSchema = directPairSchemaDefinition;
62571
+
62565
62572
  // ../../modules/chat/contract/src/chat.possible-secrets.ts
62566
62573
  var possibleSecretInputSchemaDefinition = external_exports.object({
62567
62574
  workspaceId: external_exports.string().min(1),
@@ -63426,7 +63433,12 @@ var conversationSummarySchemaDefinition = external_exports.object({
63426
63433
  */
63427
63434
  activeAt: external_exports.iso.datetime().optional(),
63428
63435
  /** In a Laze DM paired with a Slack DM: the side the reader picked; absent follows the other. */
63429
- replySide: replySideSchema.optional()
63436
+ replySide: replySideSchema.optional(),
63437
+ /**
63438
+ * On both sides of a Laze DM paired with the reader's Slack DM of the same people: the two ids,
63439
+ * so every app lists them as one. Absent when not paired.
63440
+ */
63441
+ directPair: directPairSchema.optional()
63430
63442
  });
63431
63443
  var conversationSummarySchema = conversationSummarySchemaDefinition;
63432
63444
  var directoryEntrySchemaDefinition = external_exports.object({
@@ -63692,10 +63704,20 @@ var openAgentDirectInputSchemaDefinition = external_exports.object({
63692
63704
  runsOutside: external_exports.boolean().optional()
63693
63705
  }),
63694
63706
  /** The name an agent opening the DM joins under; a person keeps their own. */
63695
- openerName: external_exports.string().trim().min(1).max(80).optional()
63707
+ openerName: external_exports.string().trim().min(1).max(80).optional(),
63708
+ /** People who read this DM of two agents without being in it: the owners of its agents. */
63709
+ watcherUserIds: external_exports.array(idSchema4).max(4).optional()
63696
63710
  });
63711
+ var agentsDirectInputSchemaDefinition = external_exports.object({
63712
+ workspaceId: workspaceIdSchema,
63713
+ agentIds: external_exports.tuple([idSchema4, idSchema4]).readonly()
63714
+ });
63715
+ var agentsDirectSchemaDefinition = external_exports.discriminatedUnion("kind", [
63716
+ external_exports.object({ kind: external_exports.literal("open"), channelId: idSchema4 }),
63717
+ external_exports.object({ kind: external_exports.literal("none") })
63718
+ ]);
63697
63719
  var agentChatMemberInputSchemaDefinition = external_exports.object({
63698
- ...openAgentDirectInputSchemaDefinition.shape,
63720
+ ...openAgentDirectInputSchemaDefinition.omit({ watcherUserIds: true }).shape,
63699
63721
  ownerUserId: idSchema4,
63700
63722
  userId: idSchema4
63701
63723
  });
@@ -63733,6 +63755,11 @@ var postMessageInputSchemaDefinition = external_exports.object({
63733
63755
  threadRootId: idSchema4.optional(),
63734
63756
  /** A reply that also shows in its conversation; ignored without `threadRootId`. */
63735
63757
  alsoInChannel: external_exports.boolean().optional(),
63758
+ /**
63759
+ * In a mirrored conversation: the message this one replies to, quoted above it as the
63760
+ * source quotes its replies. Spec: modules/chat/specs/mirror-quote-reply.feature
63761
+ */
63762
+ quotedMessageId: idSchema4.optional(),
63736
63763
  /** In a direct message: notify the people in Do Not Disturb anyway, once. */
63737
63764
  notifyAnyway: external_exports.boolean().optional(),
63738
63765
  /** In a Laze DM: also post it to this paired Slack DM, as the sender; one Laze message. */
@@ -64818,6 +64845,40 @@ var emailMessageSchemaDefinition = external_exports.discriminatedUnion("template
64818
64845
  }),
64819
64846
  unsubscribeUrl: external_exports.url()
64820
64847
  }),
64848
+ /**
64849
+ * Optional lifecycle mail written as a short letter: a picture, an optional greeting, lines, a
64850
+ * numbered list of steps (each a linked title with plain words after it), closing lines and a
64851
+ * sign-off. Sent only where `optionalEmailReach` allows, with its off link.
64852
+ */
64853
+ external_exports.object({
64854
+ template: external_exports.literal("starters"),
64855
+ to: external_exports.email(),
64856
+ locale: localeSchema,
64857
+ /** Where the email as a whole opens: its first step. */
64858
+ url: external_exports.url(),
64859
+ subject: external_exports.string().min(1).max(200),
64860
+ greeting: external_exports.string().min(1).max(200).optional(),
64861
+ lines: external_exports.array(external_exports.string().min(1).max(600)).min(1).max(4),
64862
+ steps: external_exports.array(
64863
+ external_exports.object({
64864
+ label: external_exports.string().min(1).max(120),
64865
+ url: external_exports.url(),
64866
+ /** Plain words after the linked title, joined with a colon. */
64867
+ rest: external_exports.string().min(1).max(300).optional()
64868
+ })
64869
+ ).min(1).max(5),
64870
+ closing: external_exports.array(external_exports.string().min(1).max(600)).max(3),
64871
+ signOff: external_exports.string().min(1).max(80),
64872
+ image: external_exports.object({
64873
+ url: external_exports.url(),
64874
+ alt: external_exports.string().max(200),
64875
+ width: external_exports.number().int().positive().max(600),
64876
+ height: external_exports.number().int().positive().max(600)
64877
+ }),
64878
+ /** Where the picture sits: over the words (default) or under the sign-off. */
64879
+ imageAt: external_exports.enum(["top", "bottom"]).optional(),
64880
+ unsubscribeUrl: external_exports.url()
64881
+ }),
64821
64882
  /** A Laze app a person waited for is out; `url` is its store page. */
64822
64883
  external_exports.object({
64823
64884
  template: external_exports.literal("appAvailable"),
@@ -65342,6 +65403,24 @@ var feedDigestIntentSchemaDefinition = external_exports.object({
65342
65403
  userId: external_exports.string().min(1),
65343
65404
  at: external_exports.iso.datetime()
65344
65405
  });
65406
+ var emailDeliveryStateSchema = external_exports.enum([
65407
+ "accepted",
65408
+ "deferred",
65409
+ "delivered",
65410
+ "bounced",
65411
+ "complained",
65412
+ "dropped"
65413
+ ]);
65414
+ var emailDeliveryChangedPayloadSchemaDefinition = external_exports.object({
65415
+ deliveryId: external_exports.string().min(1),
65416
+ template: external_exports.string().min(1),
65417
+ state: emailDeliveryStateSchema,
65418
+ /** Null for a row the backfill created. */
65419
+ previousState: emailDeliveryStateSchema.nullable(),
65420
+ flags: external_exports.array(external_exports.string().min(1)),
65421
+ sentAt: external_exports.iso.datetime(),
65422
+ at: external_exports.iso.datetime()
65423
+ });
65345
65424
 
65346
65425
  // ../../modules/notification/contract/src/notification.ui.ts
65347
65426
  var notificationUi = uiTokens("notification");
@@ -65436,7 +65515,12 @@ var messagePostedPayloadSchemaDefinition = external_exports.object({
65436
65515
  /** The card this message carries, such as an approval: a system card, not something said. */
65437
65516
  cardType: external_exports.string().optional(),
65438
65517
  /** Mirrored history in a batch: no live publication of its own, its conversation reads again. */
65439
- quiet: external_exports.boolean().optional()
65518
+ quiet: external_exports.boolean().optional(),
65519
+ /**
65520
+ * The message a reply in a mirrored conversation quotes: its source key when a mirror brought
65521
+ * it in, else `laze:<message id>`.
65522
+ */
65523
+ quoted: external_exports.object({ originKey: external_exports.string().min(1) }).optional()
65440
65524
  });
65441
65525
  var messageChangedPayloadSchemaDefinition = external_exports.object({
65442
65526
  workspaceId: external_exports.string().min(1),
@@ -65739,7 +65823,8 @@ var idSchema5 = external_exports.string().min(1).max(80);
65739
65823
  var agentGranteeSchemaDefinition = external_exports.discriminatedUnion("kind", [
65740
65824
  external_exports.object({ kind: external_exports.literal("person"), userId: idSchema5 }),
65741
65825
  external_exports.object({ kind: external_exports.literal("channel"), channelId: idSchema5 }),
65742
- external_exports.object({ kind: external_exports.literal("group"), groupId: idSchema5 })
65826
+ external_exports.object({ kind: external_exports.literal("group"), groupId: idSchema5 }),
65827
+ external_exports.object({ kind: external_exports.literal("agent"), agentId: idSchema5 })
65743
65828
  ]);
65744
65829
  var agentGranteeSchema = agentGranteeSchemaDefinition;
65745
65830
  var shareAgentInputSchemaDefinition = external_exports.object({
@@ -65748,6 +65833,29 @@ var shareAgentInputSchemaDefinition = external_exports.object({
65748
65833
  grantee: agentGranteeSchemaDefinition
65749
65834
  });
65750
65835
  var shareAgentInputSchema = shareAgentInputSchemaDefinition;
65836
+ var askedGranteeSchemaDefinition = external_exports.object({
65837
+ grantee: agentGranteeSchemaDefinition,
65838
+ label: external_exports.string()
65839
+ });
65840
+ var agentShareRequestSchemaDefinition = external_exports.object({
65841
+ id: idSchema5,
65842
+ requesterUserId: idSchema5,
65843
+ requesterName: external_exports.string(),
65844
+ grantees: external_exports.array(askedGranteeSchemaDefinition),
65845
+ /** Who may approve it: its owner, and for a team agent Laze runs, the workspace admins. */
65846
+ deciderIds: external_exports.array(idSchema5),
65847
+ deciderNames: external_exports.array(external_exports.string()),
65848
+ askedAt: external_exports.iso.datetime(),
65849
+ expiresAt: external_exports.iso.datetime()
65850
+ });
65851
+ var agentLinkSchema = external_exports.object({
65852
+ agentId: idSchema5,
65853
+ name: external_exports.string(),
65854
+ ownerUserId: idSchema5,
65855
+ grantedByUserId: idSchema5,
65856
+ grantedAt: external_exports.iso.datetime(),
65857
+ channelId: idSchema5.nullable()
65858
+ });
65751
65859
  var agentAccessSchemaDefinition = external_exports.object({
65752
65860
  agentId: idSchema5,
65753
65861
  kind: external_exports.enum(["personal", "team"]),
@@ -65766,8 +65874,16 @@ var agentAccessSchemaDefinition = external_exports.object({
65766
65874
  ),
65767
65875
  /** The groups it is shared with, whose people may talk to it for as long as they are in them. */
65768
65876
  groups: external_exports.array(external_exports.object({ id: idSchema5, name: external_exports.string(), memberIds: external_exports.array(external_exports.string()) })).optional(),
65877
+ /** The agents added to it, which DM it directly; `channelId` is their DM once opened. */
65878
+ agents: external_exports.array(agentLinkSchema).optional(),
65879
+ /** The agents it was added to, which it may DM; its owner takes it off any of them. */
65880
+ addedTo: external_exports.array(agentLinkSchema).optional(),
65769
65881
  /** Whether the reader may share it and take shares back. */
65770
- mayShare: external_exports.boolean()
65882
+ mayShare: external_exports.boolean(),
65883
+ /** A reader who talks to it but may not share it asks its deciders to add someone. */
65884
+ mayAsk: external_exports.boolean().optional(),
65885
+ /** Waiting requests: the reader's own, or every one for a reader who decides them. */
65886
+ shareRequests: external_exports.array(agentShareRequestSchemaDefinition).optional()
65771
65887
  });
65772
65888
  var agentAccessSchema = agentAccessSchemaDefinition;
65773
65889
 
@@ -66799,7 +66915,9 @@ var computerHostCapacityDefinition = external_exports.object({
66799
66915
  memoryMb: external_exports.number().int().positive(),
66800
66916
  diskGb: external_exports.number().int().positive(),
66801
66917
  overcommit: external_exports.number().positive(),
66802
- diskOvercommit: external_exports.number().positive()
66918
+ diskOvercommit: external_exports.number().positive(),
66919
+ /** Awake vCPU is booked up to vcpus times this; null or absent books it at `overcommit`. */
66920
+ cpuOvercommit: external_exports.number().positive().nullable().optional()
66803
66921
  });
66804
66922
  var hostIdSchema = external_exports.string().regex(/^[a-z0-9][a-z0-9-]{0,31}$/, "a host name is 1 to 32 of a-z, 0-9 and -");
66805
66923
  var addComputerHostInputDefinition = external_exports.object({
@@ -66862,7 +66980,8 @@ var computerPoolFactDefinition = external_exports.discriminatedUnion("kind", [
66862
66980
  kind: external_exports.literal("host_overcommit_changed"),
66863
66981
  hostId: external_exports.string(),
66864
66982
  overcommit: external_exports.number(),
66865
- diskOvercommit: external_exports.number()
66983
+ diskOvercommit: external_exports.number(),
66984
+ cpuOvercommit: external_exports.number().nullable().optional()
66866
66985
  }),
66867
66986
  external_exports.object({ kind: external_exports.literal("host_removed"), hostId: external_exports.string() }),
66868
66987
  external_exports.object({
@@ -69436,9 +69555,60 @@ var setRunsOnAsCallerInputSchema = setRunsOnInputSchemaDefinition.omit({
69436
69555
  workspaceId: true
69437
69556
  });
69438
69557
 
69558
+ // ../../modules/agent/contract/src/agent-share-request.ts
69559
+ var idSchema15 = external_exports.string().min(1).max(80);
69560
+ var AGENT_SHARE_REQUEST_MAX_GRANTEES = 20;
69561
+ var askAgentShareInputSchemaDefinition = external_exports.object({
69562
+ workspaceId: external_exports.string().min(1),
69563
+ agentId: idSchema15,
69564
+ grantees: external_exports.array(agentGranteeSchema).min(1).max(AGENT_SHARE_REQUEST_MAX_GRANTEES)
69565
+ });
69566
+ var askAgentShareInputSchema = askAgentShareInputSchemaDefinition;
69567
+ var decideAgentShareRequestInputSchemaDefinition = external_exports.object({
69568
+ workspaceId: external_exports.string().min(1),
69569
+ requestId: idSchema15,
69570
+ decision: external_exports.enum(["approved", "denied"])
69571
+ });
69572
+ var askAgentShareAsCallerInputSchemaDefinition = external_exports.object({
69573
+ agent: external_exports.string().trim().min(1).max(80),
69574
+ grantees: external_exports.array(agentGranteeSchema).min(1).max(AGENT_SHARE_REQUEST_MAX_GRANTEES)
69575
+ });
69576
+ var agentShareDecisionSchemaDefinition = external_exports.object({
69577
+ state: external_exports.enum(["approved", "denied"]),
69578
+ added: external_exports.array(external_exports.string()),
69579
+ skipped: external_exports.array(external_exports.string())
69580
+ });
69581
+ var agentShareRequestedPayloadSchemaDefinition = external_exports.object({
69582
+ workspaceId: external_exports.string().min(1),
69583
+ requestId: external_exports.string().min(1),
69584
+ agentId: external_exports.string().min(1),
69585
+ agentName: external_exports.string(),
69586
+ requesterUserId: external_exports.string().min(1),
69587
+ requesterName: external_exports.string(),
69588
+ /** The requester's agent whose key asked for them; empty when they asked themselves. */
69589
+ viaAgentName: external_exports.string().default(""),
69590
+ grantees: external_exports.array(external_exports.string()),
69591
+ deciderIds: external_exports.array(external_exports.string().min(1)),
69592
+ expiresAt: external_exports.iso.datetime()
69593
+ });
69594
+ var agentShareResolvedPayloadSchemaDefinition = external_exports.object({
69595
+ workspaceId: external_exports.string().min(1),
69596
+ requestId: external_exports.string().min(1),
69597
+ agentId: external_exports.string().min(1),
69598
+ agentName: external_exports.string(),
69599
+ requesterUserId: external_exports.string().min(1),
69600
+ state: external_exports.enum(["approved", "denied", "expired"]),
69601
+ /** The decider; null when it expired. */
69602
+ resolvedByUserId: external_exports.string().min(1).nullable(),
69603
+ resolvedByName: external_exports.string(),
69604
+ asked: external_exports.array(external_exports.string()),
69605
+ added: external_exports.array(external_exports.string()),
69606
+ skipped: external_exports.array(external_exports.string())
69607
+ });
69608
+
69439
69609
  // ../../modules/agent/contract/src/agent-transfer.ts
69440
69610
  var workspaceIdSchema12 = external_exports.string().min(1);
69441
- var idSchema15 = external_exports.string().min(1).max(200);
69611
+ var idSchema16 = external_exports.string().min(1).max(200);
69442
69612
  var agentRefSchema7 = external_exports.string().trim().min(1).max(80);
69443
69613
  var agentTransferOfferSchemaDefinition = external_exports.object({
69444
69614
  id: external_exports.string().min(1),
@@ -69455,7 +69625,7 @@ var agentTransferOfferSchemaDefinition = external_exports.object({
69455
69625
  var agentTransferOfferSchema = agentTransferOfferSchemaDefinition;
69456
69626
  var agentTransferInputSchemaDefinition = external_exports.object({
69457
69627
  workspaceId: workspaceIdSchema12,
69458
- agentId: idSchema15
69628
+ agentId: idSchema16
69459
69629
  });
69460
69630
  var agentTransferInputSchema = agentTransferInputSchemaDefinition;
69461
69631
  var agentTransferAsCallerInputSchemaDefinition = external_exports.object({ agent: agentRefSchema7 });
@@ -69515,18 +69685,18 @@ var agentWorkingSchema = agentWorkingSchemaDefinition;
69515
69685
 
69516
69686
  // ../../modules/agent/contract/src/agent-workspace-default.ts
69517
69687
  var workspaceIdSchema13 = external_exports.string().min(1);
69518
- var idSchema16 = external_exports.string().min(1).max(200);
69688
+ var idSchema17 = external_exports.string().min(1).max(200);
69519
69689
  var agentRefSchema8 = external_exports.string().trim().min(1).max(80);
69520
69690
  var workspaceDefaultAgentSchemaDefinition = external_exports.object({
69521
69691
  /** Null when the workspace has none, or its pick was removed. */
69522
- agentId: idSchema16.nullable(),
69692
+ agentId: idSchema17.nullable(),
69523
69693
  name: external_exports.string().nullable()
69524
69694
  });
69525
69695
  var workspaceDefaultAgentSchema = workspaceDefaultAgentSchemaDefinition;
69526
69696
  var setWorkspaceDefaultAgentInputSchemaDefinition = external_exports.object({
69527
69697
  workspaceId: workspaceIdSchema13,
69528
69698
  /** A team agent of the workspace; null clears the pick. */
69529
- agentId: idSchema16.nullable()
69699
+ agentId: idSchema17.nullable()
69530
69700
  });
69531
69701
  var setWorkspaceDefaultAgentInputSchema = setWorkspaceDefaultAgentInputSchemaDefinition;
69532
69702
  var setWorkspaceDefaultAgentAsCallerInputSchemaDefinition = external_exports.object({
@@ -69540,7 +69710,7 @@ var AGENT_JOIN_REQUEST_TTL_SECONDS = 24 * 60 * 60;
69540
69710
  var AGENT_ONLINE_WINDOW_SECONDS = 2 * 60;
69541
69711
  var INBOX_WAIT_MAX_SECONDS = 55;
69542
69712
  var workspaceIdSchema14 = external_exports.string().min(1);
69543
- var idSchema17 = external_exports.string().min(1).max(80);
69713
+ var idSchema18 = external_exports.string().min(1).max(80);
69544
69714
  var agentHarnessSchema = external_exports.enum([
69545
69715
  "claude-code",
69546
69716
  "codex",
@@ -69588,17 +69758,17 @@ var agentContextSchemaDefinition = external_exports.object({
69588
69758
  updatedAt: external_exports.iso.datetime().nullable()
69589
69759
  });
69590
69760
  var agentHostSchemaDefinition = external_exports.object({
69591
- machineId: idSchema17,
69761
+ machineId: idSchema18,
69592
69762
  whenOffline: external_exports.enum(["wait", "sandbox"])
69593
69763
  });
69594
69764
  var setAgentHostInputSchemaDefinition = external_exports.object({
69595
69765
  workspaceId: workspaceIdSchema14,
69596
- agentId: idSchema17,
69766
+ agentId: idSchema18,
69597
69767
  host: agentHostSchemaDefinition.nullable()
69598
69768
  });
69599
69769
  var setAgentComputerKeyInputSchemaDefinition = external_exports.object({
69600
69770
  workspaceId: workspaceIdSchema14,
69601
- agentId: idSchema17,
69771
+ agentId: idSchema18,
69602
69772
  computerKey: external_exports.string().min(1).max(200).nullable()
69603
69773
  });
69604
69774
  var agentSetupStateSchemaDefinition = external_exports.enum(["setting_up", "ready", "failed"]);
@@ -69610,13 +69780,13 @@ var agentSetupReadingSchemaDefinition = external_exports.object({
69610
69780
  });
69611
69781
  var agentSetupReadingSchema = agentSetupReadingSchemaDefinition;
69612
69782
  var agentSchemaDefinition = external_exports.object({
69613
- id: idSchema17,
69783
+ id: idSchema18,
69614
69784
  workspaceId: workspaceIdSchema14,
69615
69785
  name: external_exports.string(),
69616
69786
  kind: external_exports.enum(["personal", "team"]),
69617
69787
  hosting: agentHostingSchema,
69618
69788
  harness: agentHarnessSchema,
69619
- ownerUserId: idSchema17,
69789
+ ownerUserId: idSchema18,
69620
69790
  status: external_exports.enum(["connected", "disconnected"]),
69621
69791
  online: external_exports.boolean(),
69622
69792
  lastSeenAt: external_exports.iso.datetime().nullable(),
@@ -69669,7 +69839,7 @@ var agentSchemaDefinition = external_exports.object({
69669
69839
  });
69670
69840
  var agentSchema = agentSchemaDefinition;
69671
69841
  var agentChannelSchemaDefinition = external_exports.object({
69672
- id: idSchema17,
69842
+ id: idSchema18,
69673
69843
  name: external_exports.string(),
69674
69844
  kind: external_exports.enum(["public", "private", "dm", "group", "chat"])
69675
69845
  });
@@ -69691,7 +69861,7 @@ var createAgentInputSchemaDefinition = external_exports.object({
69691
69861
  modelLevel: agentModelLevelSchema.optional(),
69692
69862
  kind: external_exports.enum(["personal", "team"]).default("personal"),
69693
69863
  instructions: instructionsSchema.default(""),
69694
- channelIds: external_exports.array(idSchema17).max(50).default([]),
69864
+ channelIds: external_exports.array(idSchema18).max(50).default([]),
69695
69865
  /** A Claude Code or Codex agent drawing from this login pool; a team one needs a pool. */
69696
69866
  /** The pool's id or name. */
69697
69867
  loginPoolId: external_exports.string().min(1).max(200).optional()
@@ -69704,7 +69874,7 @@ var createSupportAgentInputSchemaDefinition = external_exports.object({
69704
69874
  });
69705
69875
  var updateAgentInputSchemaDefinition = external_exports.object({
69706
69876
  workspaceId: workspaceIdSchema14,
69707
- agentId: idSchema17,
69877
+ agentId: idSchema18,
69708
69878
  name: agentNameSchema.optional(),
69709
69879
  avatar: agentAvatarInputSchema.optional(),
69710
69880
  /** A Laze models agent's level; null puts it back on Default. */
@@ -69717,7 +69887,7 @@ var updateAgentInputSchemaDefinition = external_exports.object({
69717
69887
  effort: runEffortInputSchema.optional(),
69718
69888
  instructions: instructionsSchema.optional(),
69719
69889
  /** The whole set: channels left out are left. */
69720
- channelIds: external_exports.array(idSchema17).max(50).optional(),
69890
+ channelIds: external_exports.array(idSchema18).max(50).optional(),
69721
69891
  /** Agents Laze runs only: paused, it does not wake until resumed and its messages wait. */
69722
69892
  paused: external_exports.boolean().optional(),
69723
69893
  /** Why it is paused, shown on the agents page and in the notice under held messages. */
@@ -69748,9 +69918,9 @@ var mintLinkInputSchemaDefinition = external_exports.object({
69748
69918
  /** Left out, the agent names itself when it joins, else it takes its harness's name. */
69749
69919
  name: external_exports.string().trim().max(80).optional(),
69750
69920
  /** The channel the agent joins once linked. */
69751
- channelId: idSchema17.optional(),
69921
+ channelId: idSchema18.optional(),
69752
69922
  /** One of the minting person's connected agents: redeeming gives it a new key instead. */
69753
- reconnectAgentId: idSchema17.optional()
69923
+ reconnectAgentId: idSchema18.optional()
69754
69924
  });
69755
69925
  var mintLinkInputSchema = mintLinkInputSchemaDefinition;
69756
69926
  var mintedLinkSchemaDefinition = external_exports.object({
@@ -69782,7 +69952,7 @@ var redeemedLinkSchemaDefinition = external_exports.object({
69782
69952
  agent: agentSchemaDefinition,
69783
69953
  /** The agent's own `lz_` key, shown once. */
69784
69954
  apiKey: external_exports.string(),
69785
- channelId: idSchema17.nullable(),
69955
+ channelId: idSchema18.nullable(),
69786
69956
  /** The owner's key that may only ask for a new agent (`laze agent request`), shown once. */
69787
69957
  requestKey: external_exports.string().nullable().optional()
69788
69958
  });
@@ -69847,12 +70017,12 @@ var inboxCatchUpSchemaDefinition = external_exports.object({
69847
70017
  });
69848
70018
  var inboxCatchUpSchema = inboxCatchUpSchemaDefinition;
69849
70019
  var inboxMessageSchemaDefinition = external_exports.object({
69850
- messageId: idSchema17,
69851
- channelId: idSchema17,
70020
+ messageId: idSchema18,
70021
+ channelId: idSchema18,
69852
70022
  channelName: external_exports.string(),
69853
70023
  channelKind: external_exports.enum(["public", "private", "dm", "group", "chat"]),
69854
- threadRootId: idSchema17.nullable(),
69855
- author: external_exports.object({ kind: external_exports.enum(["person", "agent"]), id: idSchema17, name: external_exports.string() }),
70024
+ threadRootId: idSchema18.nullable(),
70025
+ author: external_exports.object({ kind: external_exports.enum(["person", "agent"]), id: idSchema18, name: external_exports.string() }),
69856
70026
  body: external_exports.string(),
69857
70027
  postedAt: external_exports.iso.datetime(),
69858
70028
  /** On the first message of each conversation in a catch up (agent-catch-up.feature). */
@@ -69873,18 +70043,18 @@ var inboxWaitingSchemaDefinition = external_exports.object({
69873
70043
  session: agentSessionSchemaDefinition.nullable()
69874
70044
  });
69875
70045
  var inboxPreviewSchemaDefinition = external_exports.object({
69876
- messageId: idSchema17,
69877
- channelId: idSchema17,
70046
+ messageId: idSchema18,
70047
+ channelId: idSchema18,
69878
70048
  channelName: external_exports.string(),
69879
70049
  channelKind: external_exports.enum(["public", "private", "dm", "group", "chat"]),
69880
- author: external_exports.object({ kind: external_exports.enum(["person", "agent"]), id: idSchema17, name: external_exports.string() }),
70050
+ author: external_exports.object({ kind: external_exports.enum(["person", "agent"]), id: idSchema18, name: external_exports.string() }),
69881
70051
  /** At most 200 characters of the message. */
69882
70052
  preview: external_exports.string().max(200),
69883
70053
  postedAt: external_exports.iso.datetime()
69884
70054
  });
69885
70055
  var callerSchemaDefinition = external_exports.object({
69886
70056
  kind: external_exports.enum(["person", "agent"]),
69887
- id: idSchema17,
70057
+ id: idSchema18,
69888
70058
  name: external_exports.string(),
69889
70059
  workspaceId: workspaceIdSchema14,
69890
70060
  agent: agentSchemaDefinition.nullable(),
@@ -69904,7 +70074,7 @@ var agentGuideFilesSchemaDefinition = external_exports.object({
69904
70074
  });
69905
70075
  var agentChannelLevelSchema = external_exports.enum(["everything", "mentions"]);
69906
70076
  var callerChannelSchemaDefinition = external_exports.object({
69907
- id: idSchema17,
70077
+ id: idSchema18,
69908
70078
  name: external_exports.string(),
69909
70079
  kind: external_exports.enum(["public", "private", "dm", "group", "chat"]),
69910
70080
  unread: external_exports.number().int().nonnegative(),
@@ -69919,8 +70089,8 @@ var callerChannelSchemaDefinition = external_exports.object({
69919
70089
  });
69920
70090
  var setChannelLevelInputSchemaDefinition = external_exports.object({
69921
70091
  workspaceId: workspaceIdSchema14,
69922
- agentId: idSchema17,
69923
- channelId: idSchema17,
70092
+ agentId: idSchema18,
70093
+ channelId: idSchema18,
69924
70094
  level: agentChannelLevelSchema
69925
70095
  });
69926
70096
  var setChannelLevelInputSchema = setChannelLevelInputSchemaDefinition;
@@ -69943,14 +70113,14 @@ var postAsCallerInputSchemaDefinition = external_exports.object({
69943
70113
  /** A channel's name (with or without `#`) or id. */
69944
70114
  channel: external_exports.string().trim().min(1).max(81),
69945
70115
  body: external_exports.string().trim().min(1).max(4e4),
69946
- threadRootId: idSchema17.optional(),
70116
+ threadRootId: idSchema18.optional(),
69947
70117
  /** Files the caller uploaded to this conversation, carried as the composer's attachments are. */
69948
- attachmentIds: external_exports.array(idSchema17).max(10).optional(),
70118
+ attachmentIds: external_exports.array(idSchema18).max(10).optional(),
69949
70119
  /** The messages of the agent's turn this post answers. */
69950
- answers: external_exports.array(idSchema17).max(200).optional()
70120
+ answers: external_exports.array(idSchema18).max(200).optional()
69951
70121
  });
69952
70122
  var replyAsCallerInputSchemaDefinition = external_exports.object({
69953
- messageId: idSchema17,
70123
+ messageId: idSchema18,
69954
70124
  body: external_exports.string().trim().min(1).max(4e4),
69955
70125
  /** Needed for a message that is not in the caller's inbox. */
69956
70126
  channel: external_exports.string().trim().min(1).max(81).optional(),
@@ -69959,20 +70129,20 @@ var replyAsCallerInputSchemaDefinition = external_exports.object({
69959
70129
  /** A thread reply also shows in the channel, as "Also send to #channel" does. */
69960
70130
  alsoInChannel: external_exports.boolean().optional(),
69961
70131
  /** Files the caller uploaded to the reply's conversation, carried as the composer's are. */
69962
- attachmentIds: external_exports.array(idSchema17).max(10).optional(),
70132
+ attachmentIds: external_exports.array(idSchema18).max(10).optional(),
69963
70133
  /** The other messages of the agent's turn this reply answers. */
69964
- answers: external_exports.array(idSchema17).max(200).optional()
70134
+ answers: external_exports.array(idSchema18).max(200).optional()
69965
70135
  });
69966
70136
  var postedMessageSchemaDefinition = external_exports.object({
69967
- messageId: idSchema17,
69968
- channelId: idSchema17,
69969
- threadRootId: idSchema17.nullable(),
70137
+ messageId: idSchema18,
70138
+ channelId: idSchema18,
70139
+ threadRootId: idSchema18.nullable(),
69970
70140
  /** Workspace members the message mentioned who are not in the channel: it did not reach them. */
69971
70141
  notInChannel: external_exports.array(external_exports.object({ ...notInChannelSchema.shape, name: external_exports.string() })).default([]),
69972
70142
  /** Mentioned agents that are paused or out of usage: the message waits for each of them. */
69973
70143
  waitsFor: external_exports.array(
69974
70144
  external_exports.object({
69975
- agentId: idSchema17,
70145
+ agentId: idSchema18,
69976
70146
  name: external_exports.string(),
69977
70147
  cause: external_exports.enum(["paused", "out_of_usage"]),
69978
70148
  /** When an agent out of usage gets its usage back; null while paused. */
@@ -69989,15 +70159,15 @@ var searchAsCallerInputSchemaDefinition = external_exports.object({
69989
70159
  });
69990
70160
  var callerActorNameSchema = external_exports.object({
69991
70161
  kind: external_exports.enum(["person", "agent"]),
69992
- id: idSchema17,
70162
+ id: idSchema18,
69993
70163
  name: external_exports.string()
69994
70164
  });
69995
70165
  var callerSearchHitSchemaDefinition = external_exports.object({
69996
- messageId: idSchema17,
69997
- channelId: idSchema17,
70166
+ messageId: idSchema18,
70167
+ channelId: idSchema18,
69998
70168
  channelName: external_exports.string(),
69999
70169
  channelKind: external_exports.enum(["public", "private", "dm", "group", "chat"]),
70000
- threadRootId: idSchema17.nullable(),
70170
+ threadRootId: idSchema18.nullable(),
70001
70171
  seq: external_exports.number().int().positive(),
70002
70172
  /** `external` for a mirrored message from someone outside Laze. */
70003
70173
  author: external_exports.object({
@@ -70019,7 +70189,7 @@ var callerSearchResultSchemaDefinition = external_exports.object({
70019
70189
  /** Names for the mention tokens in the bodies. */
70020
70190
  mentions: external_exports.object({
70021
70191
  actors: external_exports.array(callerActorNameSchema),
70022
- channels: external_exports.array(external_exports.object({ id: idSchema17, name: external_exports.string() }))
70192
+ channels: external_exports.array(external_exports.object({ id: idSchema18, name: external_exports.string() }))
70023
70193
  })
70024
70194
  });
70025
70195
  var agentMachineInputSchemaDefinition = external_exports.object({ host: external_exports.string().trim().min(1).max(200) });
@@ -70102,27 +70272,29 @@ var agentsCopy = {
70102
70272
  paintOnly: true,
70103
70273
  storable: agentsForDisk
70104
70274
  };
70105
- var agentCoreTrpc = defineTrpcContract("agents").query("list", { mirrored: agentsCopy }).withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(external_exports.array(agentListEntrySchema)).mutation("create").withInput(createAgentInputSchema).withOutput(agentSchema).mutation("update").withInput(updateAgentInputSchema).withOutput(agentSchema).mutation("remove").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(external_exports.object({ removed: external_exports.literal(true) })).mutation("transfer").withInput(transferAgentInputSchema).withOutput(agentSchema).mutation("resetSession").withInput(resetAgentSessionInputSchema).withOutput(agentSchema).query("faces").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(external_exports.array(agentFaceSchema)).query("presence").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(external_exports.array(agentPresenceSchema)).mutation("uploadAvatar").withInput(uploadAgentAvatarInputSchema).withOutput(uploadedAgentAvatarSchema).query("access").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(agentAccessSchema).query("loginActivity").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(loginActivitySchema).mutation("raiseBudget").withInput(raiseBudgetInputSchema).withOutput(external_exports.object({ limitUsd: external_exports.number() })).query("permissionPrompts").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(external_exports.array(agentPermissionPromptSchema)).mutation("share").withInput(shareAgentInputSchema).withOutput(agentAccessSchema).mutation("unshare").withInput(shareAgentInputSchema).withOutput(agentAccessSchema).query("harnessLogins").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(harnessLoginsSchema).mutation("saveHarnessLogin").withInput(saveHarnessLoginInputSchema).withOutput(harnessLoginsSchema).mutation("removeHarnessLogin").withInput(removeHarnessLoginInputSchema).withOutput(harnessLoginsSchema).query("listHarnessLogins").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(harnessLoginListSchema).mutation("addHarnessLogin").withInput(addHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("renameHarnessLogin").withInput(renameHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("deleteHarnessLogin").withInput(deleteHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("checkLoginUsage").withInput(checkLoginUsageInputSchema).withOutput(loginUsageCheckSchema).query("loginPools").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(loginPoolsSchema).mutation("createLoginPool").withInput(createLoginPoolInputSchema).withOutput(loginPoolsSchema).mutation("renameLoginPool").withInput(renameLoginPoolInputSchema).withOutput(loginPoolsSchema).mutation("deleteLoginPool").withInput(loginPoolRefInputSchema).withOutput(loginPoolsSchema).mutation("addPoolLogin").withInput(addPoolLoginInputSchema).withOutput(loginPoolsSchema).mutation("removePoolLogin").withInput(removePoolLoginInputSchema).withOutput(loginPoolsSchema).mutation("setPoolMember").withInput(setPoolMemberInputSchema).withOutput(loginPoolsSchema).mutation("removePoolMember").withInput(removePoolMemberInputSchema).withOutput(loginPoolsSchema).mutation("setAgentPool").withInput(setAgentPoolInputSchema).withOutput(agentSchema).mutation("openDirect").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(external_exports.object({ channelId: idSchema17 })).mutation("startConversation").withInput(startConversationInputSchema).withOutput(startedConversationSchema).query("conversations").withInput(listConversationsInputSchema).withOutput(external_exports.array(conversationSummarySchema2)).mutation("joinConversation").withInput(conversationInputSchema).withOutput(conversationSummarySchema2).mutation("renameConversation").withInput(renameConversationInputSchema).withOutput(conversationSummarySchema2).mutation("leaveConversation").withInput(conversationInputSchema).withOutput(external_exports.object({ left: external_exports.literal(true) })).mutation("deleteConversation").withInput(conversationInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("mintLink").withInput(mintLinkInputSchema).withOutput(mintedLinkSchema).query("linkRedemption").withInput(linkRedemptionInputSchema).withOutput(linkRedemptionSchema).query("oauthRequest").withInput(oauthRequestInputSchema).withOutput(oauthRequestViewSchema).mutation("oauthApprove").withInput(approveOAuthInputSchema).withOutput(oauthRedirectSchema).mutation("oauthDeny").withInput(oauthRequestInputSchema).withOutput(oauthRedirectSchema).mutation("disconnect").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(external_exports.object({ disconnected: external_exports.literal(true) })).mutation("setGithub").withInput(setAgentGithubInputSchema).withOutput(agentSchema).query("githubWatches").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(external_exports.array(agentGithubWatchSchema)).mutation("watchGithub").withInput(watchGithubInputSchema).withOutput(agentGithubWatchSchema).mutation("unwatchGithub").withInput(unwatchGithubInputSchema).withOutput(external_exports.object({ removed: external_exports.literal(true) })).build();
70275
+ var agentCoreTrpc = defineTrpcContract("agents").query("list", { mirrored: agentsCopy }).withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(external_exports.array(agentListEntrySchema)).mutation("create").withInput(createAgentInputSchema).withOutput(agentSchema).mutation("update").withInput(updateAgentInputSchema).withOutput(agentSchema).mutation("remove").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(external_exports.object({ removed: external_exports.literal(true) })).mutation("transfer").withInput(transferAgentInputSchema).withOutput(agentSchema).mutation("resetSession").withInput(resetAgentSessionInputSchema).withOutput(agentSchema).query("faces").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(external_exports.array(agentFaceSchema)).query("presence").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(external_exports.array(agentPresenceSchema)).mutation("uploadAvatar").withInput(uploadAgentAvatarInputSchema).withOutput(uploadedAgentAvatarSchema).query("access").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(agentAccessSchema).query("loginActivity").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(loginActivitySchema).mutation("raiseBudget").withInput(raiseBudgetInputSchema).withOutput(external_exports.object({ limitUsd: external_exports.number() })).query("permissionPrompts").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(external_exports.array(agentPermissionPromptSchema)).mutation("share").withInput(shareAgentInputSchema).withOutput(agentAccessSchema).mutation("unshare").withInput(shareAgentInputSchema).withOutput(agentAccessSchema).query("harnessLogins").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(harnessLoginsSchema).mutation("saveHarnessLogin").withInput(saveHarnessLoginInputSchema).withOutput(harnessLoginsSchema).mutation("removeHarnessLogin").withInput(removeHarnessLoginInputSchema).withOutput(harnessLoginsSchema).query("listHarnessLogins").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(harnessLoginListSchema).mutation("addHarnessLogin").withInput(addHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("renameHarnessLogin").withInput(renameHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("deleteHarnessLogin").withInput(deleteHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("checkLoginUsage").withInput(checkLoginUsageInputSchema).withOutput(loginUsageCheckSchema).query("loginPools").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(loginPoolsSchema).mutation("createLoginPool").withInput(createLoginPoolInputSchema).withOutput(loginPoolsSchema).mutation("renameLoginPool").withInput(renameLoginPoolInputSchema).withOutput(loginPoolsSchema).mutation("deleteLoginPool").withInput(loginPoolRefInputSchema).withOutput(loginPoolsSchema).mutation("addPoolLogin").withInput(addPoolLoginInputSchema).withOutput(loginPoolsSchema).mutation("removePoolLogin").withInput(removePoolLoginInputSchema).withOutput(loginPoolsSchema).mutation("setPoolMember").withInput(setPoolMemberInputSchema).withOutput(loginPoolsSchema).mutation("removePoolMember").withInput(removePoolMemberInputSchema).withOutput(loginPoolsSchema).mutation("setAgentPool").withInput(setAgentPoolInputSchema).withOutput(agentSchema).mutation("openDirect").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(external_exports.object({ channelId: idSchema18 })).mutation("startConversation").withInput(startConversationInputSchema).withOutput(startedConversationSchema).query("conversations").withInput(listConversationsInputSchema).withOutput(external_exports.array(conversationSummarySchema2)).mutation("joinConversation").withInput(conversationInputSchema).withOutput(conversationSummarySchema2).mutation("renameConversation").withInput(renameConversationInputSchema).withOutput(conversationSummarySchema2).mutation("leaveConversation").withInput(conversationInputSchema).withOutput(external_exports.object({ left: external_exports.literal(true) })).mutation("deleteConversation").withInput(conversationInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).mutation("mintLink").withInput(mintLinkInputSchema).withOutput(mintedLinkSchema).query("linkRedemption").withInput(linkRedemptionInputSchema).withOutput(linkRedemptionSchema).query("oauthRequest").withInput(oauthRequestInputSchema).withOutput(oauthRequestViewSchema).mutation("oauthApprove").withInput(approveOAuthInputSchema).withOutput(oauthRedirectSchema).mutation("oauthDeny").withInput(oauthRequestInputSchema).withOutput(oauthRedirectSchema).mutation("disconnect").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(external_exports.object({ disconnected: external_exports.literal(true) })).mutation("setGithub").withInput(setAgentGithubInputSchema).withOutput(agentSchema).query("githubWatches").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(external_exports.array(agentGithubWatchSchema)).mutation("watchGithub").withInput(watchGithubInputSchema).withOutput(agentGithubWatchSchema).mutation("unwatchGithub").withInput(unwatchGithubInputSchema).withOutput(external_exports.object({ removed: external_exports.literal(true) })).build();
70106
70276
  var agentTurnTrpc = defineTrpcContract("agents").mutation("answerAttention").withInput(answerAttentionInputSchema).withOutput(external_exports.object({ answered: external_exports.literal(true) })).query("attentionDetail").withInput(attentionDetailInputSchema).withOutput(attentionDetailSchema).mutation("stopTurn").withInput(stopAgentTurnInputSchema).withOutput(external_exports.object({ stopped: external_exports.literal(true) })).query("mayStopTurn").withInput(stopAgentTurnInputSchema).withOutput(external_exports.object({ allowed: external_exports.boolean() })).mutation("retryTurn").withInput(retryAgentTurnInputSchema).withOutput(external_exports.object({ retried: external_exports.literal(true) })).query("retryState").withInput(retryAgentTurnInputSchema).withOutput(agentRetryStateSchema).query("liveSteps").withInput(liveStepsInputSchema).withOutput(liveStepsSchema).query("workingNow").withInput(agentWorkingInputSchema).withOutput(agentWorkingSchema).mutation("compactSession").withInput(compactAgentSessionInputSchema).withOutput(external_exports.object({ requested: external_exports.literal(true) })).mutation("catchUp").withInput(startCatchUpInputSchema).withOutput(catchUpRunSchema).mutation("catchUpAsk").withInput(askCatchUpInputSchema).withOutput(catchUpRunSchema).query("catchUpRun").withInput(catchUpRunInputSchema).withOutput(catchUpRunSchema).mutation("catchUpStop").withInput(catchUpRunInputSchema).withOutput(catchUpRunSchema).mutation("restartComputer").withInput(restartAgentComputerInputSchema).withOutput(external_exports.object({ restarted: external_exports.boolean() })).build();
70107
- var agentChannelSettingsTrpc = defineTrpcContract("agents").query("monitors").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(external_exports.array(agentMonitorSchema)).query("channelLevel").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17, channelId: idSchema17 })).withOutput(channelLevelSchema).mutation("setChannelLevel").withInput(setChannelLevelInputSchema).withOutput(channelLevelSchema).mutation("unmuteChannel").withInput(unmuteAgentChannelInputSchema).withOutput(channelLevelSchema).mutation("cancelHeld").withInput(cancelHeldInputSchema).withOutput(cancelHeldResultSchema).mutation("useLazeModelsUntilReset").withInput(useLazeModelsUntilResetInputSchema).withOutput(lazeModelsUntilResetSchema).build();
70277
+ var agentChannelSettingsTrpc = defineTrpcContract("agents").query("monitors").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(external_exports.array(agentMonitorSchema)).query("channelLevel").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18, channelId: idSchema18 })).withOutput(channelLevelSchema).mutation("setChannelLevel").withInput(setChannelLevelInputSchema).withOutput(channelLevelSchema).mutation("unmuteChannel").withInput(unmuteAgentChannelInputSchema).withOutput(channelLevelSchema).mutation("cancelHeld").withInput(cancelHeldInputSchema).withOutput(cancelHeldResultSchema).mutation("useLazeModelsUntilReset").withInput(useLazeModelsUntilResetInputSchema).withOutput(lazeModelsUntilResetSchema).build();
70108
70278
  var agentJoinTrpc = defineTrpcContract("agents").query("joinRequest").withInput(joinRequestInputSchema).withOutput(joinRequestViewSchema).mutation("approveJoinRequest").withInput(approveJoinRequestInputSchema).withOutput(joinRequestViewSchema).mutation("denyJoinRequest").withInput(joinRequestInputSchema).withOutput(joinRequestViewSchema).build();
70109
70279
  var agentLoginTroubleTrpc = defineTrpcContract("agents").mutation("replaceHarnessLogin").withInput(replaceHarnessLoginInputSchema).withOutput(harnessLoginListSchema).mutation("startHarnessSignIn").withInput(startHarnessSignInInputSchema).withOutput(harnessSignInSchema).mutation("pollHarnessSignIn").withInput(pollHarnessSignInInputSchema).withOutput(harnessSignInPollSchema).mutation("waitForLogins").withInput(loginCardActionInputSchema).withOutput(external_exports.object({ waiting: external_exports.boolean() })).mutation("useAnotherLogin").withInput(loginCardActionInputSchema).withOutput(external_exports.object({ loginName: external_exports.string() })).build();
70110
70280
  var agentWorkspaceDefaultTrpc = defineTrpcContract("agents").query("workspaceDefault").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(workspaceDefaultAgentSchema).mutation("setWorkspaceDefault").withInput(setWorkspaceDefaultAgentInputSchema).withOutput(workspaceDefaultAgentSchema).build();
70111
- var agentRuntimeChoiceTrpc = defineTrpcContract("agents").query("setup").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(agentSetupReadingSchema).mutation("retrySetup").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(agentSchema).query("lastRuntime").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(lastRuntimeSchema).build();
70281
+ var agentRuntimeChoiceTrpc = defineTrpcContract("agents").query("setup").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(agentSetupReadingSchema).mutation("retrySetup").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(agentSchema).query("lastRuntime").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(lastRuntimeSchema).build();
70112
70282
  var agentArchiveTrpc = defineTrpcContract("agents").query("archived").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(external_exports.array(archivedAgentSchema)).mutation("restore").withInput(restoreAgentInputSchema).withOutput(agentSchema).mutation("copy").withInput(copyAgentInputSchema).withOutput(agentSchema).mutation("deleteArchived").withInput(restoreAgentInputSchema).withOutput(external_exports.object({ deleted: external_exports.literal(true) })).query("transferOffers").withInput(external_exports.object({ workspaceId: workspaceIdSchema14 })).withOutput(external_exports.array(agentTransferOfferSchema)).mutation("acceptTransfer").withInput(agentTransferInputSchema).withOutput(agentSchema).mutation("declineTransfer").withInput(agentTransferInputSchema).withOutput(external_exports.object({ declined: external_exports.literal(true) })).mutation("cancelTransfer").withInput(agentTransferInputSchema).withOutput(external_exports.object({ cancelled: external_exports.literal(true) })).build();
70113
70283
  var agentLangwatchTrpc = defineTrpcContract("agents").query("langwatchTracing").withInput(agentLangwatchInputSchema).withOutput(agentLangwatchTracingSchema).mutation("setLangwatchTracing").withInput(setAgentLangwatchInputSchema).withOutput(agentLangwatchTracingSchema).build();
70114
70284
  var agentPoolModelTrpc = defineTrpcContract("agents").mutation("setLoginPoolModel").withInput(setLoginPoolModelInputSchema).withOutput(loginPoolsSchema).build();
70115
70285
  var agentRunsOnTrpc = defineTrpcContract("agents").mutation("setRunsOn").withInput(setRunsOnInputSchema).withOutput(agentSchema).build();
70116
70286
  var agentWelcomeTrpc = defineTrpcContract("agents").mutation("pressWelcome").withInput(pressWelcomeInputSchema).withOutput(pressedWelcomeSchema).mutation("pressCollab").withInput(pressCollabInputSchema).withOutput(pressedCollabSchema).build();
70117
70287
  var agentPoolGroupTrpc = defineTrpcContract("agents").mutation("addPoolGroup").withInput(poolGroupInputSchema).withOutput(loginPoolsSchema).mutation("removePoolGroup").withInput(poolGroupInputSchema).withOutput(loginPoolsSchema).build();
70118
- var agentOpenConversationTrpc = defineTrpcContract("agents").mutation("openConversation").withInput(openConversationInputSchema).withOutput(external_exports.object({ channelId: idSchema17 })).build();
70288
+ var agentOpenConversationTrpc = defineTrpcContract("agents").mutation("openConversation").withInput(openConversationInputSchema).withOutput(external_exports.object({ channelId: idSchema18 })).build();
70119
70289
  var agentConversationCloseTrpc = defineTrpcContract("agents").mutation("closeConversation").withInput(conversationInputSchema).withOutput(conversationSummarySchema2).mutation("reopenConversation").withInput(conversationInputSchema).withOutput(conversationSummarySchema2).mutation("convertConversation").withInput(convertConversationInputSchema).withOutput(convertedConversationSchema).build();
70120
- var agentReconnectTrpc = defineTrpcContract("agents").query("reconnect").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema17 })).withOutput(agentReconnectSchema).build();
70290
+ var agentShareRequestTrpc = defineTrpcContract("agents").mutation("askShare").withInput(askAgentShareInputSchema).withOutput(agentAccessSchema).build();
70291
+ var agentReconnectTrpc = defineTrpcContract("agents").query("reconnect").withInput(external_exports.object({ workspaceId: workspaceIdSchema14, agentId: idSchema18 })).withOutput(agentReconnectSchema).build();
70121
70292
  var agentTrpc = joinTrpcContracts(
70122
70293
  "agents",
70123
70294
  agentCoreTrpc,
70124
70295
  agentPoolGroupTrpc,
70125
70296
  agentReconnectTrpc,
70297
+ agentShareRequestTrpc,
70126
70298
  agentOpenConversationTrpc,
70127
70299
  agentConversationCloseTrpc,
70128
70300
  agentTurnTrpc,
@@ -70301,7 +70473,7 @@ var agentKeepsFailingPayloadSchemaDefinition = external_exports.object({
70301
70473
 
70302
70474
  // ../../modules/agent/contract/src/agent-caller-access.ts
70303
70475
  var agentRefSchema9 = external_exports.string().trim().min(1).max(80);
70304
- var idSchema18 = external_exports.string().min(1).max(64);
70476
+ var idSchema19 = external_exports.string().min(1).max(64);
70305
70477
  var agentAsCallerInputSchemaDefinition = external_exports.object({ agent: agentRefSchema9 });
70306
70478
  var shareAgentAsCallerInputSchemaDefinition = external_exports.object({
70307
70479
  agent: agentRefSchema9,
@@ -70309,18 +70481,18 @@ var shareAgentAsCallerInputSchemaDefinition = external_exports.object({
70309
70481
  });
70310
70482
  var stopTurnAsCallerInputSchemaDefinition = external_exports.object({
70311
70483
  agent: agentRefSchema9,
70312
- channelId: idSchema18
70484
+ channelId: idSchema19
70313
70485
  });
70314
70486
  var retryTurnAsCallerInputSchemaDefinition = external_exports.object({
70315
70487
  agent: agentRefSchema9,
70316
- channelId: idSchema18,
70317
- messageId: idSchema18
70488
+ channelId: idSchema19,
70489
+ messageId: idSchema19
70318
70490
  });
70319
70491
  var postTurnFailureAsCallerInputSchemaDefinition = external_exports.object({
70320
- channelId: idSchema18,
70321
- threadRootId: idSchema18.optional(),
70492
+ channelId: idSchema19,
70493
+ threadRootId: idSchema19.optional(),
70322
70494
  /** The person's message the turn was on, which Try again sends to the agent again. */
70323
- messageId: idSchema18,
70495
+ messageId: idSchema19,
70324
70496
  /** The attempt that failed, so Try again knows once a later one is stored. */
70325
70497
  attempt: external_exports.number().int().min(1).optional(),
70326
70498
  line: external_exports.string().trim().min(1).max(1e3),
@@ -70329,7 +70501,7 @@ var postTurnFailureAsCallerInputSchemaDefinition = external_exports.object({
70329
70501
  var mintLinkAsCallerInputSchemaDefinition = external_exports.object({
70330
70502
  /** Left out, the agent that joins with the link names itself. */
70331
70503
  name: external_exports.string().trim().max(80).optional(),
70332
- channelId: idSchema18.optional(),
70504
+ channelId: idSchema19.optional(),
70333
70505
  /** One of the key's person's agents by id or name: redeeming gives it a new key instead. */
70334
70506
  reconnect: external_exports.string().trim().min(1).max(80).optional()
70335
70507
  });
@@ -70470,26 +70642,58 @@ var agentPersonMessageReceivedPayloadSchemaDefinition = external_exports.object(
70470
70642
  at: external_exports.iso.datetime()
70471
70643
  });
70472
70644
 
70645
+ // ../../modules/agent/contract/src/agent-link-telemetry.ts
70646
+ var agentLinkRedeemReasonSchema = external_exports.enum([
70647
+ "connected",
70648
+ "reconnected",
70649
+ "malformed_token",
70650
+ "unknown_link",
70651
+ "expired",
70652
+ "already_used",
70653
+ "secret_mismatch",
70654
+ /** A CLI link redeemed as an OAuth code, or an OAuth code redeemed by the CLI. */
70655
+ "wrong_kind",
70656
+ /** An OAuth code exchanged by another client, redirect URI or PKCE verifier. */
70657
+ "binding_mismatch",
70658
+ "owner_mismatch",
70659
+ /** The reconnect agent is gone or no longer connected. */
70660
+ "agent_unavailable"
70661
+ ]);
70662
+ var agentLinkRedeemPathSchema = external_exports.enum(["link", "oauth"]);
70663
+ var agentLinkRedeemAttemptedPayloadSchemaDefinition = external_exports.object({
70664
+ workspaceId: external_exports.string().min(1),
70665
+ linkId: external_exports.string().min(1).max(64),
70666
+ outcome: external_exports.enum(["connected", "reconnected", "refused"]),
70667
+ reason: agentLinkRedeemReasonSchema,
70668
+ path: agentLinkRedeemPathSchema,
70669
+ harness: agentHarnessSchema.catch("other"),
70670
+ /** The `x-laze-cli-version` the request carried; null for any other client. */
70671
+ cliVersion: external_exports.string().max(32).nullable(),
70672
+ /** The agent connected or reconnected; null when refused. */
70673
+ agentId: external_exports.string().min(1).nullable(),
70674
+ at: external_exports.iso.datetime()
70675
+ });
70676
+
70473
70677
  // ../../modules/agent/contract/src/agent-history.ts
70474
- var idSchema19 = external_exports.string().min(1).max(80);
70678
+ var idSchema20 = external_exports.string().min(1).max(80);
70475
70679
  var CALLER_HISTORY_LIMIT_MAX = 100;
70476
70680
  var historyAsCallerInputSchemaDefinition = external_exports.object({
70477
70681
  /** A channel the key's speaker is in, by id or name. */
70478
70682
  channel: external_exports.string().trim().min(1).max(200),
70479
70683
  /** Messages before this Laze message; none reads the newest page. */
70480
- before: idSchema19.optional(),
70684
+ before: idSchema20.optional(),
70481
70685
  /** Already past the cache: no cached messages, only where the live read goes on. */
70482
70686
  olderThan: external_exports.iso.datetime().optional(),
70483
70687
  limit: external_exports.number().int().min(1).max(CALLER_HISTORY_LIMIT_MAX).default(50)
70484
70688
  });
70485
70689
  var callerHistoryMessageSchemaDefinition = external_exports.object({
70486
- messageId: idSchema19,
70487
- threadRootId: idSchema19.nullable(),
70690
+ messageId: idSchema20,
70691
+ threadRootId: idSchema20.nullable(),
70488
70692
  seq: external_exports.number().int().positive(),
70489
70693
  /** `external` for a mirrored message from someone outside Laze. */
70490
70694
  author: external_exports.object({
70491
70695
  kind: external_exports.enum(["person", "agent", "external"]),
70492
- id: idSchema19,
70696
+ id: idSchema20,
70493
70697
  name: external_exports.string()
70494
70698
  }),
70495
70699
  body: external_exports.string(),
@@ -70499,7 +70703,7 @@ var callerHistoryMessageSchemaDefinition = external_exports.object({
70499
70703
  originKey: external_exports.string().nullable()
70500
70704
  });
70501
70705
  var callerHistorySchemaDefinition = external_exports.object({
70502
- channelId: idSchema19,
70706
+ channelId: idSchema20,
70503
70707
  channelName: external_exports.string(),
70504
70708
  channelKind: external_exports.enum(["public", "private", "dm", "group", "chat"]),
70505
70709
  /** The outside workspace a mirrored conversation shows, such as "Slack ACME HQ". */
@@ -70513,21 +70717,21 @@ var callerHistorySchemaDefinition = external_exports.object({
70513
70717
  });
70514
70718
 
70515
70719
  // ../../modules/agent/contract/src/agent-feed-refs.ts
70516
- var idSchema20 = external_exports.string().min(1).max(80);
70720
+ var idSchema21 = external_exports.string().min(1).max(80);
70517
70721
  var recordTurnFeedRefInputSchemaDefinition = external_exports.object({
70518
- cardId: idSchema20,
70722
+ cardId: idSchema21,
70519
70723
  kind: external_exports.enum(["added", "updated"]),
70520
70724
  /** The card's own chat threads: a reply in one of them links nothing. */
70521
- ownThreadRootIds: external_exports.array(idSchema20).max(50).default([])
70725
+ ownThreadRootIds: external_exports.array(idSchema21).max(50).default([])
70522
70726
  });
70523
70727
 
70524
70728
  // ../../modules/agent/contract/src/agent-channel-admin.ts
70525
- var idSchema21 = external_exports.string().min(1).max(80);
70729
+ var idSchema22 = external_exports.string().min(1).max(80);
70526
70730
  var channelRefSchema = external_exports.string().trim().min(1).max(200);
70527
70731
  var channelAsCallerInputSchemaDefinition = external_exports.object({ channel: channelRefSchema });
70528
70732
  var callerChannelMemberSchemaDefinition = external_exports.object({
70529
70733
  kind: external_exports.enum(["person", "agent"]),
70530
- id: idSchema21,
70734
+ id: idSchema22,
70531
70735
  name: external_exports.string(),
70532
70736
  role: external_exports.enum(["admin", "member"]),
70533
70737
  /** Active, away or unknown for a person the speaker may see; absent for agents. */
@@ -70537,7 +70741,7 @@ var callerChannelMemberSchemaDefinition = external_exports.object({
70537
70741
  doNotDisturb: doNotDisturbSchema.nullable().optional()
70538
70742
  });
70539
70743
  var callerChannelDetailSchemaDefinition = external_exports.object({
70540
- id: idSchema21,
70744
+ id: idSchema22,
70541
70745
  name: external_exports.string(),
70542
70746
  kind: external_exports.enum(["public", "private", "dm", "group", "chat"]),
70543
70747
  topic: external_exports.string(),
@@ -70571,17 +70775,17 @@ var activityAsCallerInputSchemaDefinition = external_exports.object({
70571
70775
  limit: external_exports.number().int().min(1).max(100).default(50)
70572
70776
  });
70573
70777
  var callerActivityItemSchemaDefinition = external_exports.object({
70574
- id: idSchema21,
70778
+ id: idSchema22,
70575
70779
  kind: external_exports.enum(["mention", "thread_reply", "keyword", "reaction"]),
70576
- channelId: idSchema21,
70780
+ channelId: idSchema22,
70577
70781
  channelName: external_exports.string(),
70578
70782
  channelKind: external_exports.enum(["public", "private", "dm", "group", "chat"]),
70579
- messageId: idSchema21,
70580
- threadRootId: idSchema21.nullable(),
70783
+ messageId: idSchema22,
70784
+ threadRootId: idSchema22.nullable(),
70581
70785
  /** `external` is someone outside Laze whose message a mirror brought in, named at the source. */
70582
70786
  actor: external_exports.object({
70583
70787
  kind: external_exports.enum(["person", "agent", "external"]),
70584
- id: idSchema21,
70788
+ id: idSchema22,
70585
70789
  name: external_exports.string()
70586
70790
  }),
70587
70791
  emoji: external_exports.string().nullable(),
@@ -70598,12 +70802,12 @@ var setStatusAsCallerInputSchemaDefinition = setStatusInputSchema.omit({ workspa
70598
70802
  var setAwayAsCallerInputSchemaDefinition = external_exports.object({ away: external_exports.boolean() });
70599
70803
 
70600
70804
  // ../../modules/agent/contract/src/agent-scheduled.ts
70601
- var idSchema22 = external_exports.string().min(1).max(80);
70805
+ var idSchema23 = external_exports.string().min(1).max(80);
70602
70806
  var channelRefSchema2 = external_exports.string().trim().min(1).max(200);
70603
70807
  var scheduleAsCallerInputSchemaDefinition = external_exports.object({
70604
70808
  channel: channelRefSchema2.optional(),
70605
- threadRootId: idSchema22.optional(),
70606
- replyTo: idSchema22.optional(),
70809
+ threadRootId: idSchema23.optional(),
70810
+ replyTo: idSchema23.optional(),
70607
70811
  body: external_exports.string().trim().min(1).max(4e4),
70608
70812
  sendAt: external_exports.iso.datetime({ offset: true }),
70609
70813
  /** A reply that also goes to the channel at its time (`--also-channel`). */
@@ -70614,9 +70818,9 @@ var scheduleAsCallerInputSchemaDefinition = external_exports.object({
70614
70818
  var listScheduledAsCallerInputSchemaDefinition = external_exports.object({
70615
70819
  channel: channelRefSchema2.optional()
70616
70820
  });
70617
- var scheduledAsCallerInputSchemaDefinition = external_exports.object({ scheduledId: idSchema22 });
70821
+ var scheduledAsCallerInputSchemaDefinition = external_exports.object({ scheduledId: idSchema23 });
70618
70822
  var editScheduledAsCallerInputSchemaDefinition = external_exports.object({
70619
- scheduledId: idSchema22,
70823
+ scheduledId: idSchema23,
70620
70824
  body: external_exports.string().trim().min(1).max(4e4).optional(),
70621
70825
  sendAt: external_exports.iso.datetime({ offset: true }).optional()
70622
70826
  }).refine((input2) => input2.body !== void 0 || input2.sendAt !== void 0, {
@@ -71417,7 +71621,7 @@ async function keepTaken({
71417
71621
  if (messages.length === 0) return;
71418
71622
  const path = statePathOf({ context, kind: "spool", profile });
71419
71623
  const ids = new Set(messages.map((message2) => message2.messageId));
71420
- const kept = (await readSpool({ path })).filter((entry) => !ids.has(entry.message.messageId));
71624
+ const kept = (await readSpool({ path })).filter((entry2) => !ids.has(entry2.message.messageId));
71421
71625
  const now = context.nowMs();
71422
71626
  const taken = messages.map((message2) => ({
71423
71627
  message: message2,
@@ -71435,7 +71639,7 @@ async function dropFromSpool({
71435
71639
  const path = statePathOf({ context, kind: "spool", profile });
71436
71640
  const entries = await readSpool({ path });
71437
71641
  const ids = new Set(messageIds);
71438
- const kept = entries.filter((entry) => !ids.has(entry.message.messageId));
71642
+ const kept = entries.filter((entry2) => !ids.has(entry2.message.messageId));
71439
71643
  if (kept.length !== entries.length) await writeSpool({ path, entries: kept });
71440
71644
  }
71441
71645
  async function dueFromSpool({
@@ -71447,19 +71651,19 @@ async function dueFromSpool({
71447
71651
  }) {
71448
71652
  const path = statePathOf({ context, kind: "spool", profile });
71449
71653
  const entries = await readSpool({ path });
71450
- const pushed = entries.some((entry) => entry.pushedAt !== void 0);
71654
+ const pushed = entries.some((entry2) => entry2.pushedAt !== void 0);
71451
71655
  const text3 = pushed ? await seen().catch(() => "") : "";
71452
71656
  const shown2 = entries.filter(
71453
- (entry) => entry.pushedAt !== void 0 && text3.includes(entry.message.messageId)
71657
+ (entry2) => entry2.pushedAt !== void 0 && text3.includes(entry2.message.messageId)
71454
71658
  );
71455
71659
  await dropFromSpool({
71456
71660
  context,
71457
71661
  profile,
71458
- messageIds: shown2.map((entry) => entry.message.messageId)
71662
+ messageIds: shown2.map((entry2) => entry2.message.messageId)
71459
71663
  });
71460
71664
  const late = context.nowMs() - PUSH_GRACE_MS;
71461
71665
  const settled2 = context.nowMs() - IN_FLIGHT_MS;
71462
- return entries.filter((entry) => !shown2.includes(entry)).filter((entry) => !settledOnly || entry.takenAt <= settled2).filter((entry) => entry.pushedAt === void 0 || pushedToo && entry.pushedAt <= late).map((entry) => entry.message);
71666
+ return entries.filter((entry2) => !shown2.includes(entry2)).filter((entry2) => !settledOnly || entry2.takenAt <= settled2).filter((entry2) => entry2.pushedAt === void 0 || pushedToo && entry2.pushedAt <= late).map((entry2) => entry2.message);
71463
71667
  }
71464
71668
 
71465
71669
  // src/services/machine-report.service.ts
@@ -71634,7 +71838,7 @@ function serverUrlOf({ context, args }) {
71634
71838
  }
71635
71839
 
71636
71840
  // src/services/agent-access-commands.service.ts
71637
- var SHARE_USAGE = "Usage: laze agent share|unshare <agent> --person <userId> | --group <groupId> | --channel <channelId>";
71841
+ var SHARE_USAGE = "Usage: laze agent share|unshare <agent> --person <userId> | --group <groupId> | --channel <channelId> | --agent <agent>\n laze agent share <agent> --ask --person <userId> [--agent <agent> ...]";
71638
71842
  function agentWord({ args, usage }) {
71639
71843
  const agent3 = args.words[2];
71640
71844
  if (!agent3) throw new CliUsageError(usage);
@@ -71646,11 +71850,15 @@ function printAccess({ context, args, access }) {
71646
71850
  const people2 = access.people.map((person) => person.userId).join(", ") || "no one";
71647
71851
  const channels3 = access.channels.map((channel) => `#${channel.name}`).join(", ") || "none";
71648
71852
  const groups2 = (access.groups ?? []).map((group) => `@${group.name}`).join(", ") || "none";
71853
+ const agents = (access.agents ?? []).map((agent3) => agent3.name).join(", ") || "none";
71854
+ const addedTo = (access.addedTo ?? []).map((agent3) => agent3.name).join(", ") || "none";
71649
71855
  context.out(
71650
71856
  `${access.kind} agent, owned by ${access.ownerUserId}
71651
71857
  People: ${people2}
71652
71858
  Groups: ${groups2}
71653
71859
  Channels: ${channels3}
71860
+ Agents: ${agents}
71861
+ Can DM: ${addedTo}
71654
71862
  `
71655
71863
  );
71656
71864
  }
@@ -71685,19 +71893,51 @@ async function agentPermissionPrompts({ context, args }) {
71685
71893
  function granteeOf({
71686
71894
  person,
71687
71895
  group,
71688
- channel
71896
+ channel,
71897
+ agent: agent3
71689
71898
  }) {
71690
71899
  if (person) return { kind: "person", userId: person };
71691
71900
  if (group) return { kind: "group", groupId: group };
71901
+ if (agent3) return { kind: "agent", agentId: agent3 };
71692
71902
  return { kind: "channel", channelId: channel };
71693
71903
  }
71904
+ var GRANTEE_FLAGS = ["person", "group", "channel", "agent"];
71905
+ function askedGranteesOf(args) {
71906
+ return GRANTEE_FLAGS.flatMap(
71907
+ (name3) => (args.lists[name3] ?? []).map(
71908
+ (value) => granteeOf({
71909
+ person: name3 === "person" ? value : void 0,
71910
+ group: name3 === "group" ? value : void 0,
71911
+ channel: name3 === "channel" ? value : void 0,
71912
+ agent: name3 === "agent" ? value : void 0
71913
+ })
71914
+ )
71915
+ );
71916
+ }
71917
+ async function askToShare({ context, args, agent: agent3 }) {
71918
+ const grantees = askedGranteesOf(args);
71919
+ if (grantees.length === 0) throw new CliUsageError(SHARE_USAGE);
71920
+ const { client } = await signedIn({ context, args });
71921
+ const access = await client.post("/api/agents/share/ask", { agent: agent3, grantees });
71922
+ const request2 = access.shareRequests?.[0];
71923
+ if (args.flags.json || access.mayShare || !request2) return printAccess({ context, args, access });
71924
+ context.out(`Asked ${request2.deciderNames.join(" or ")} to add them to ${agent3}.
71925
+ `);
71926
+ }
71694
71927
  async function shareAgent({ context, args }) {
71695
71928
  const agent3 = agentWord({ args, usage: SHARE_USAGE });
71929
+ if (args.flags.ask === true) {
71930
+ if (args.words[1] === "unshare") throw new CliUsageError(SHARE_USAGE);
71931
+ return askToShare({ context, args, agent: agent3 });
71932
+ }
71696
71933
  const person = flagText({ args, name: "person" });
71697
71934
  const group = flagText({ args, name: "group" });
71698
71935
  const channel = flagText({ args, name: "channel" });
71699
- if ([person, group, channel].filter(Boolean).length !== 1) throw new CliUsageError(SHARE_USAGE);
71700
- const grantee = granteeOf({ person, group, channel });
71936
+ const other = flagText({ args, name: "agent" });
71937
+ if ([person, group, channel, other].filter(Boolean).length !== 1) {
71938
+ throw new CliUsageError(SHARE_USAGE);
71939
+ }
71940
+ const grantee = granteeOf({ person, group, channel, agent: other });
71701
71941
  const path = args.words[1] === "unshare" ? "/api/agents/unshare" : "/api/agents/share";
71702
71942
  const { client } = await signedIn({ context, args });
71703
71943
  printAccess({ context, args, access: await client.post(path, { agent: agent3, grantee }) });
@@ -71936,7 +72176,7 @@ function withHooks({
71936
72176
  }) {
71937
72177
  const current3 = Array.isArray(hooks[event]) ? hooks[event] : [];
71938
72178
  const others = current3.filter(
71939
- (entry) => !entry.hooks?.some((hook) => hook.command?.includes(LAZE_HOOK_MARKER))
72179
+ (entry2) => !entry2.hooks?.some((hook) => hook.command?.includes(LAZE_HOOK_MARKER))
71940
72180
  );
71941
72181
  hooks[event] = [...others, ...added.map((hook) => ({ hooks: [hook] }))];
71942
72182
  }
@@ -71993,7 +72233,7 @@ function hookCommand({
71993
72233
  function holdsOurs({ settings: settings3, event }) {
71994
72234
  const hooks = settings3.hooks ?? {};
71995
72235
  return Array.isArray(hooks[event]) && hooks[event].some(
71996
- (entry) => entry.hooks?.some((hook) => hook.command?.includes(LAZE_HOOK_MARKER))
72236
+ (entry2) => entry2.hooks?.some((hook) => hook.command?.includes(LAZE_HOOK_MARKER))
71997
72237
  );
71998
72238
  }
71999
72239
  function lacksSessionStartWaiter({ settings: settings3 }) {
@@ -72013,10 +72253,10 @@ function whereOf(message2) {
72013
72253
  }
72014
72254
  function catchUpLinesOf(message2) {
72015
72255
  if (!message2.catchUp) return [];
72016
- const { count: count5, older } = message2.catchUp;
72256
+ const { count: count6, older } = message2.catchUp;
72017
72257
  const where = whereOf(message2);
72018
72258
  const lines2 = [
72019
- `${count5} ${count5 === 1 ? "message" : "messages"} in ${where} while you were away.`
72259
+ `${count6} ${count6 === 1 ? "message" : "messages"} in ${where} while you were away.`
72020
72260
  ];
72021
72261
  if (older === 0) return lines2;
72022
72262
  const channel = message2.channelKind === "public" || message2.channelKind === "private";
@@ -72039,9 +72279,9 @@ function hookContextOf({
72039
72279
  messages,
72040
72280
  self: self2
72041
72281
  }) {
72042
- const count5 = messages.length === 1 ? "A message" : `${messages.length} messages`;
72282
+ const count6 = messages.length === 1 ? "A message" : `${messages.length} messages`;
72043
72283
  return [
72044
- `${count5} reached you in Laze${selfClauseOf({ self: self2 })}:`,
72284
+ `${count6} reached you in Laze${selfClauseOf({ self: self2 })}:`,
72045
72285
  "",
72046
72286
  ...messages.map((message2) => formatInboxMessage({ message: message2 })),
72047
72287
  "",
@@ -72070,20 +72310,20 @@ function contextWindowOf({ model }) {
72070
72310
  return /\[1m\]|-1m\b/i.test(model) ? 1e6 : 2e5;
72071
72311
  }
72072
72312
  function compactionOf({
72073
- entry,
72313
+ entry: entry2,
72074
72314
  index
72075
72315
  }) {
72076
- const meta3 = record2(entry.compactMetadata);
72316
+ const meta3 = record2(entry2.compactMetadata);
72077
72317
  return {
72078
- key: typeof entry.uuid === "string" ? entry.uuid : String(index),
72318
+ key: typeof entry2.uuid === "string" ? entry2.uuid : String(index),
72079
72319
  trigger: meta3.trigger === "manual" ? "manual" : "auto",
72080
72320
  tokensBefore: count2(meta3.preTokens),
72081
72321
  tokensAfter: count2(meta3.postTokens),
72082
- at: typeof entry.timestamp === "string" ? entry.timestamp : "1970-01-01T00:00:00.000Z"
72322
+ at: typeof entry2.timestamp === "string" ? entry2.timestamp : "1970-01-01T00:00:00.000Z"
72083
72323
  };
72084
72324
  }
72085
- function usageOf({ entry }) {
72086
- const message2 = record2(entry.message);
72325
+ function usageOf({ entry: entry2 }) {
72326
+ const message2 = record2(entry2.message);
72087
72327
  const usage = record2(message2.usage);
72088
72328
  const input2 = count2(usage.input_tokens);
72089
72329
  if (input2 === void 0) return void 0;
@@ -72098,15 +72338,15 @@ function readTranscript({ lines: lines2 }) {
72098
72338
  let contextWindow;
72099
72339
  const compactions = [];
72100
72340
  for (const line of lines2) {
72101
- const entry = parse3(line);
72102
- if (!entry || entry.isSidechain === true) continue;
72103
- if (entry.type === "system" && entry.subtype === "compact_boundary") {
72104
- const compaction = compactionOf({ entry, index: compactions.length });
72341
+ const entry2 = parse3(line);
72342
+ if (!entry2 || entry2.isSidechain === true) continue;
72343
+ if (entry2.type === "system" && entry2.subtype === "compact_boundary") {
72344
+ const compaction = compactionOf({ entry: entry2, index: compactions.length });
72105
72345
  compactions.push(compaction);
72106
72346
  contextTokens = compaction.tokensAfter ?? contextTokens;
72107
72347
  continue;
72108
72348
  }
72109
- const usage = entry.type === "assistant" ? usageOf({ entry }) : void 0;
72349
+ const usage = entry2.type === "assistant" ? usageOf({ entry: entry2 }) : void 0;
72110
72350
  if (!usage) continue;
72111
72351
  contextTokens = usage.tokens;
72112
72352
  if (usage.model) contextWindow = contextWindowOf({ model: usage.model });
@@ -73128,19 +73368,19 @@ function lastCallAtOf({ text: text3, command }) {
73128
73368
  for (let index = lines2.length - 1; index >= 0; index -= 1) {
73129
73369
  const line = lines2[index]?.trim();
73130
73370
  if (!line?.startsWith("{")) continue;
73131
- let entry;
73371
+ let entry2;
73132
73372
  try {
73133
- entry = JSON.parse(line);
73373
+ entry2 = JSON.parse(line);
73134
73374
  } catch {
73135
73375
  continue;
73136
73376
  }
73137
- const at = callAtOf({ entry, command });
73377
+ const at = callAtOf({ entry: entry2, command });
73138
73378
  if (at !== null) return at;
73139
73379
  }
73140
73380
  return null;
73141
73381
  }
73142
- function callAtOf({ entry, command }) {
73143
- const { type, timestamp, message: message2 } = entry ?? {};
73382
+ function callAtOf({ entry: entry2, command }) {
73383
+ const { type, timestamp, message: message2 } = entry2 ?? {};
73144
73384
  if (type !== "assistant" || typeof timestamp !== "string") return null;
73145
73385
  const content = Array.isArray(message2?.content) ? message2.content : [];
73146
73386
  const runs = content.some((part) => {
@@ -75555,11 +75795,11 @@ var RelaySession = class {
75555
75795
  const socket = new wrapper_default(this.relay.gatewayUrl, {
75556
75796
  maxPayload: OPENCLAW_RELAY_MAX_FRAME_BYTES
75557
75797
  });
75558
- const entry = { socket, waiting: [] };
75559
- this.#lines.set(line, entry);
75798
+ const entry2 = { socket, waiting: [] };
75799
+ this.#lines.set(line, entry2);
75560
75800
  socket.on("open", () => {
75561
75801
  send({ socket: relay2, kind: "opened", line, payload: new Uint8Array() });
75562
- for (const frame of entry.waiting.splice(0))
75802
+ for (const frame of entry2.waiting.splice(0))
75563
75803
  socket.send(frame.data, { binary: frame.binary });
75564
75804
  });
75565
75805
  socket.on("message", (data, binary) => {
@@ -75567,7 +75807,7 @@ var RelaySession = class {
75567
75807
  });
75568
75808
  socket.on("error", () => void 0);
75569
75809
  socket.on("close", (code, reason2) => {
75570
- const known = this.#lines.get(line) === entry;
75810
+ const known = this.#lines.get(line) === entry2;
75571
75811
  this.#lines.delete(line);
75572
75812
  if (!known) return;
75573
75813
  const closed = relayClosePayload({
@@ -75719,8 +75959,8 @@ async function rushListenersOf({
75719
75959
  for (const [key, profile] of bound) {
75720
75960
  const one = sessions.find((each) => `claude-code:${each.sessionId}` === key);
75721
75961
  if (!one?.id) continue;
75722
- const entry = config2.profiles[profile];
75723
- const refused = entry ? refusedRecently({ profile: entry, nowMs: context.nowMs() }) : false;
75962
+ const entry2 = config2.profiles[profile];
75963
+ const refused = entry2 ? refusedRecently({ profile: entry2, nowMs: context.nowMs() }) : false;
75724
75964
  const own2 = notes.filter((note) => note.key === key);
75725
75965
  rows.push(await rowOf({ context, key, profile, rushId: one.id, one, own: own2, refused }));
75726
75966
  }
@@ -75792,15 +76032,15 @@ var UNDELIVERED_AFTER_MS = 6e4;
75792
76032
  var CHECK_TIMEOUT_MS = 5e3;
75793
76033
  function clientOf({ context, profile }) {
75794
76034
  return context.store.read().then((config2) => {
75795
- const entry = config2.profiles[profile];
75796
- if (!entry || entry.migrated) return void 0;
75797
- if (refusedRecently({ profile: entry, nowMs: context.nowMs() })) return void 0;
76035
+ const entry2 = config2.profiles[profile];
76036
+ if (!entry2 || entry2.migrated) return void 0;
76037
+ if (refusedRecently({ profile: entry2, nowMs: context.nowMs() })) return void 0;
75798
76038
  return LazeClient.create({
75799
- baseUrl: entry.url,
75800
- token: entry.token,
76039
+ baseUrl: entry2.url,
76040
+ token: entry2.token,
75801
76041
  fetcher: (input2, init) => context.fetcher(input2, { ...init, signal: AbortSignal.timeout(CHECK_TIMEOUT_MS) }),
75802
76042
  onMigrated: markMigratedOn({ context, profile }),
75803
- onRefused: markRefusedOn({ context, profile, token: entry.token })
76043
+ onRefused: markRefusedOn({ context, profile, token: entry2.token })
75804
76044
  });
75805
76045
  });
75806
76046
  }
@@ -76006,22 +76246,22 @@ function stateOfError({ error: error63, delivery }) {
76006
76246
  async function serveAgent({
76007
76247
  context,
76008
76248
  profile,
76009
- entry,
76249
+ entry: entry2,
76010
76250
  signal,
76011
76251
  report: report3
76012
76252
  }) {
76013
76253
  const client = LazeClient.create({
76014
- baseUrl: entry.url,
76015
- token: entry.token,
76254
+ baseUrl: entry2.url,
76255
+ token: entry2.token,
76016
76256
  fetcher: context.fetcher,
76017
76257
  onMigrated: markMigratedOn({ context, profile }),
76018
- onRefused: markRefusedOn({ context, profile, token: entry.token })
76258
+ onRefused: markRefusedOn({ context, profile, token: entry2.token })
76019
76259
  });
76020
- const watch = CodexTurnWatch.create({ context, client, profile, delivery: entry.delivery });
76260
+ const watch = CodexTurnWatch.create({ context, client, profile, delivery: entry2.delivery });
76021
76261
  const ended = new AbortController();
76022
76262
  const watching = watch.run({ signal: AbortSignal.any([signal, ended.signal]) });
76023
76263
  try {
76024
- await serveRounds({ context, client, profile, entry, signal, report: report3, watch });
76264
+ await serveRounds({ context, client, profile, entry: entry2, signal, report: report3, watch });
76025
76265
  } finally {
76026
76266
  ended.abort();
76027
76267
  await watching;
@@ -76031,7 +76271,7 @@ async function serveRounds({
76031
76271
  context,
76032
76272
  client,
76033
76273
  profile,
76034
- entry,
76274
+ entry: entry2,
76035
76275
  signal,
76036
76276
  report: report3,
76037
76277
  watch
@@ -76044,14 +76284,14 @@ async function serveRounds({
76044
76284
  context,
76045
76285
  client,
76046
76286
  profile,
76047
- delivery: entry.delivery,
76287
+ delivery: entry2.delivery,
76048
76288
  signal,
76049
76289
  watch
76050
76290
  });
76051
76291
  if (backoff.answered() > 0) await report3(profile, "listening");
76052
76292
  if (delivered === 0) await context.sleep(1e3, signal);
76053
76293
  } catch (error63) {
76054
- const go = await afterRoundError({ context, profile, entry, report: report3, error: error63, backoff });
76294
+ const go = await afterRoundError({ context, profile, entry: entry2, report: report3, error: error63, backoff });
76055
76295
  if (go === "stop") return;
76056
76296
  await context.sleep(go.delayMs, signal);
76057
76297
  }
@@ -76060,7 +76300,7 @@ async function serveRounds({
76060
76300
  async function afterRoundError({
76061
76301
  context,
76062
76302
  profile,
76063
- entry,
76303
+ entry: entry2,
76064
76304
  report: report3,
76065
76305
  error: error63,
76066
76306
  backoff
@@ -76083,7 +76323,7 @@ async function afterRoundError({
76083
76323
  await report3(profile, "stopped: Laze has not answered for 3 days");
76084
76324
  return "stop";
76085
76325
  }
76086
- const state = stateOfError({ error: error63, delivery: entry.delivery });
76326
+ const state = stateOfError({ error: error63, delivery: entry2.delivery });
76087
76327
  await report3(profile, state);
76088
76328
  context.err(`${profile}: ${state}; trying again in ${Math.ceil(next.delayMs / 1e3)}s
76089
76329
  `);
@@ -76102,9 +76342,9 @@ function setAgent(run4, profile, agent3) {
76102
76342
  async function syncLoops(run4) {
76103
76343
  const config2 = await run4.context.store.read();
76104
76344
  for (const [profile, current3] of run4.served) {
76105
- const entry = config2.profiles[profile];
76106
- const same2 = entry?.token === current3.token && entry.delivery?.threadId === current3.threadId;
76107
- if (same2 && !entry.migrated) continue;
76345
+ const entry2 = config2.profiles[profile];
76346
+ const same2 = entry2?.token === current3.token && entry2.delivery?.threadId === current3.threadId;
76347
+ if (same2 && !entry2.migrated) continue;
76108
76348
  current3.stop.abort();
76109
76349
  await current3.done;
76110
76350
  run4.served.delete(profile);
@@ -76113,9 +76353,9 @@ async function syncLoops(run4) {
76113
76353
  const linked = Object.entries(config2.profiles).filter(
76114
76354
  (pair) => pair[1].delivery?.harness === "codex" && pair[1].kind === "agent" && !pair[1].migrated
76115
76355
  );
76116
- for (const [profile, entry] of linked.filter(([name3]) => !run4.served.has(name3))) {
76117
- const { threadId } = entry.delivery;
76118
- setAgent(run4, profile, { agent: entry.name, threadId, state: "starting" });
76356
+ for (const [profile, entry2] of linked.filter(([name3]) => !run4.served.has(name3))) {
76357
+ const { threadId } = entry2.delivery;
76358
+ setAgent(run4, profile, { agent: entry2.name, threadId, state: "starting" });
76119
76359
  const stop3 = new AbortController();
76120
76360
  const report3 = async (name3, line) => {
76121
76361
  const agent3 = run4.state.agents[name3];
@@ -76123,8 +76363,8 @@ async function syncLoops(run4) {
76123
76363
  setAgent(run4, name3, { ...agent3, state: line });
76124
76364
  if (await holdsLock(run4)) await save(run4);
76125
76365
  };
76126
- const done = serveAgent({ context: run4.context, profile, entry, signal: stop3.signal, report: report3 });
76127
- run4.served.set(profile, { token: entry.token, threadId, stop: stop3, done });
76366
+ const done = serveAgent({ context: run4.context, profile, entry: entry2, signal: stop3.signal, report: report3 });
76367
+ run4.served.set(profile, { token: entry2.token, threadId, stop: stop3, done });
76128
76368
  }
76129
76369
  }
76130
76370
  async function runConnectLoop({ context }) {
@@ -79982,6 +80222,14 @@ var appRefSchemaDefinition = external_exports.object({
79982
80222
  appId: external_exports.string().min(1)
79983
80223
  });
79984
80224
  var appRefSchema = appRefSchemaDefinition;
80225
+ var appLinkNamesInputSchemaDefinition = external_exports.object({
80226
+ ...appRefSchemaDefinition.shape,
80227
+ userIds: external_exports.array(external_exports.string().min(1)).max(500)
80228
+ });
80229
+ var appLinkNameSchemaDefinition = external_exports.object({
80230
+ userId: external_exports.string().min(1),
80231
+ name: external_exports.string().nullable()
80232
+ });
79985
80233
  var createAppInputSchemaDefinition = external_exports.object({
79986
80234
  workspaceId: external_exports.string().min(1),
79987
80235
  name: external_exports.string().trim().min(1).max(80),
@@ -81894,6 +82142,7 @@ var appUi = uiTokens("app");
81894
82142
  var AppNavSlot = appUi.component("nav");
81895
82143
  var AppPanelSlot = appUi.component("panel");
81896
82144
  var AppCardSlot = appUi.component("card");
82145
+ var AppLinkCardSlot = appUi.component("link-card");
81897
82146
  var AppPinStripSlot = appUi.component("pin-strip");
81898
82147
  var AppLinkHooksToken = appUi.hooks("links");
81899
82148
  var AppPinListSlot = appUi.component("pin-list");
@@ -82930,7 +83179,7 @@ function backupsText({ name: name3, status: status11 }) {
82930
83179
  const window2 = status11.from && status11.to ? `A restore can go back to any time from ${status11.from} to ${status11.to}.` : "Nothing to restore to yet.";
82931
83180
  const replicating = status11.replicating ? "The app data replicates to object storage." : "The app data does not replicate on this host.";
82932
83181
  const restores = status11.restores.map(
82933
- (entry) => ` ${entry.id} ${entry.to ? `to ${entry.to}` : `undid ${entry.undid ?? ""}`}
83182
+ (entry2) => ` ${entry2.id} ${entry2.to ? `to ${entry2.to}` : `undid ${entry2.undid ?? ""}`}
82934
83183
  `
82935
83184
  );
82936
83185
  return `${name3}: ${replicating} ${window2}
@@ -83440,8 +83689,8 @@ var USAGE6 = `Usage: laze app <command>. The app comes from ${APP_MANIFEST_FILE}
83440
83689
  ${APP_ARTIFACT_RULE}
83441
83690
  ${APP_ARTIFACT_RULE}
83442
83691
 
83443
- ${appCliCommands.map((entry) => ` ${entry.command} ${entry.arguments.join(" ")}
83444
- ${entry.summary}`).join("\n")}`;
83692
+ ${appCliCommands.map((entry2) => ` ${entry2.command} ${entry2.arguments.join(" ")}
83693
+ ${entry2.summary}`).join("\n")}`;
83445
83694
  var MAX_FILES = 2e3;
83446
83695
  async function turnTokenOf3({
83447
83696
  context,
@@ -83536,12 +83785,12 @@ async function listFiles(folder) {
83536
83785
  const pending2 = [folder];
83537
83786
  while (pending2.length > 0 && found.length <= MAX_FILES) {
83538
83787
  const current3 = pending2.pop() ?? folder;
83539
- for (const entry of await readdir7(current3, { withFileTypes: true })) {
83540
- const path = join26(current3, entry.name);
83788
+ for (const entry2 of await readdir7(current3, { withFileTypes: true })) {
83789
+ const path = join26(current3, entry2.name);
83541
83790
  const rel = relative3(folder, path).split(sep3).join("/");
83542
83791
  if (isSkippedPath({ path: rel })) continue;
83543
- if (entry.isDirectory()) pending2.push(path);
83544
- else if (entry.isFile()) found.push(path);
83792
+ if (entry2.isDirectory()) pending2.push(path);
83793
+ else if (entry2.isFile()) found.push(path);
83545
83794
  }
83546
83795
  }
83547
83796
  if (found.length > MAX_FILES)
@@ -83612,7 +83861,7 @@ async function templateStart({
83612
83861
  client.post("/api/apps/pull", { appId }),
83613
83862
  client.get("/api/apps/templates")
83614
83863
  ]);
83615
- const found = templates2.find((entry) => entry.name === template);
83864
+ const found = templates2.find((entry2) => entry2.name === template);
83616
83865
  if (!found) throw new CliUsageError(`No template called ${template}`);
83617
83866
  return { files: pulled.files, template: found };
83618
83867
  }
@@ -83756,7 +84005,7 @@ var appWrite = async ({ context, args }) => {
83756
84005
  });
83757
84006
  };
83758
84007
  function seedLine(seeded) {
83759
- const created = Object.entries(seeded.created).map(([name3, count5]) => `${count5} in ${name3}`);
84008
+ const created = Object.entries(seeded.created).map(([name3, count6]) => `${count6} in ${name3}`);
83760
84009
  const parts = [
83761
84010
  created.length ? `Loaded starter records: ${created.join(", ")}.` : "",
83762
84011
  seeded.skipped.length ? `Left ${seeded.skipped.join(", ")} as it was: it already holds records.` : ""
@@ -83934,7 +84183,7 @@ async function versionOf({
83934
84183
  }) {
83935
84184
  if (/^[0-9a-f]{40}$/.test(prefix)) return prefix;
83936
84185
  const versions = await client.post("/api/apps/versions", { appId });
83937
- const matches = versions.filter((entry) => entry.version.startsWith(prefix));
84186
+ const matches = versions.filter((entry2) => entry2.version.startsWith(prefix));
83938
84187
  if (matches.length !== 1 || !matches[0]) {
83939
84188
  throw new CliUsageError(
83940
84189
  `laze: No single version starts with ${prefix} (app_version_not_found)`
@@ -84081,8 +84330,8 @@ function cardLine({ choice }) {
84081
84330
  var appCard = async ({ context, args }) => {
84082
84331
  const client = await appClient({ context, args });
84083
84332
  const appId = await appIdOf({ client, args, folder: folderOf({ context, word: void 0 }) });
84084
- const count5 = Number(flagText({ args, name: "rows", fallback: "5" }));
84085
- if (!Number.isInteger(count5) || count5 < 1 || count5 > 10) {
84333
+ const count6 = Number(flagText({ args, name: "rows", fallback: "5" }));
84334
+ if (!Number.isInteger(count6) || count6 < 1 || count6 > 10) {
84086
84335
  throw new CliUsageError("--rows is a whole number from 1 to 10");
84087
84336
  }
84088
84337
  const text3 = (name3) => flagText({ args, name: name3 }) || null;
@@ -84095,7 +84344,7 @@ var appCard = async ({ context, args }) => {
84095
84344
  collection: text3("collection"),
84096
84345
  filter: flagText({ args, name: "where" }) || flagText({ args, name: "filter" }),
84097
84346
  sort: flagText({ args, name: "sort" }),
84098
- rows: count5,
84347
+ rows: count6,
84099
84348
  caption: text3("caption")
84100
84349
  }
84101
84350
  });
@@ -84230,14 +84479,14 @@ var appImport = async ({ context, args }) => {
84230
84479
  ` : "")
84231
84480
  });
84232
84481
  };
84233
- function functionLogLine(entry) {
84234
- const head = `${entry.at.slice(0, 19).replace("T", " ")} ${entry.function} ${entry.requestId}`;
84235
- if (entry.level === "request") {
84236
- const cold = entry.cold ? " cold" : "";
84237
- return `${head} ${entry.message} -> ${entry.status ?? "?"} in ${entry.durationMs ?? 0} ms${cold}
84482
+ function functionLogLine(entry2) {
84483
+ const head = `${entry2.at.slice(0, 19).replace("T", " ")} ${entry2.function} ${entry2.requestId}`;
84484
+ if (entry2.level === "request") {
84485
+ const cold = entry2.cold ? " cold" : "";
84486
+ return `${head} ${entry2.message} -> ${entry2.status ?? "?"} in ${entry2.durationMs ?? 0} ms${cold}
84238
84487
  `;
84239
84488
  }
84240
- return `${head} ${entry.level}: ${entry.message}
84489
+ return `${head} ${entry2.level}: ${entry2.message}
84241
84490
  `;
84242
84491
  }
84243
84492
  var appLogs = async ({ context, args }) => {
@@ -85514,7 +85763,7 @@ async function computeClient({
85514
85763
  return turn ? client.withHeaders({ "x-laze-turn": turn }) : client;
85515
85764
  }
85516
85765
  function siteLine(machine2) {
85517
- return machine2.sites.map((entry) => `${entry.site} (${entry.status.replaceAll("_", " ")})`).join(", ");
85766
+ return machine2.sites.map((entry2) => `${entry2.site} (${entry2.status.replaceAll("_", " ")})`).join(", ");
85518
85767
  }
85519
85768
  function statusLine(machine2) {
85520
85769
  const cost = machine2.type === "own" ? "No Laze compute cost" : `${machine2.monthCostUsd.toFixed(2)} of ${machine2.monthlyBudgetUsd} USD this month`;
@@ -85721,9 +85970,9 @@ function presenceColumns(member) {
85721
85970
  return [member.presence, `${status11.emoji} ${status11.text}`.trim() + until, ...dndColumn(member)];
85722
85971
  }
85723
85972
  function formatMembers({ detail }) {
85724
- const count5 = `${detail.members.length} ${detail.members.length === 1 ? "member" : "members"}`;
85973
+ const count6 = `${detail.members.length} ${detail.members.length === 1 ? "member" : "members"}`;
85725
85974
  const ends = detail.endsAt ? `, ends ${utcTimeOf(detail.endsAt)}` : "";
85726
- const head = `${channelLabelOf(detail)} (${detail.id}), ${count5}${ends}`;
85975
+ const head = `${channelLabelOf(detail)} (${detail.id}), ${count6}${ends}`;
85727
85976
  const rows = detail.members.map(
85728
85977
  (member) => [ROLE[member.role], member.name, member.kind, member.id, ...presenceColumns(member)].join(" ")
85729
85978
  );
@@ -85762,13 +86011,13 @@ function formatBrowsable({
85762
86011
  }) {
85763
86012
  if (channels3.length === 0) return "No channels to browse.\n";
85764
86013
  const rows = channels3.map((channel) => {
85765
- const count5 = `${channel.memberCount} ${channel.memberCount === 1 ? "member" : "members"}`;
86014
+ const count6 = `${channel.memberCount} ${channel.memberCount === 1 ? "member" : "members"}`;
85766
86015
  const marks = [
85767
86016
  channel.joined ? "joined" : "not joined",
85768
86017
  ...channel.private ? ["private"] : [],
85769
86018
  ...channel.archived ? ["archived"] : []
85770
86019
  ].join(", ");
85771
- return `#${channel.name} ${channel.id} ${count5} ${marks} ${channel.topic}`;
86020
+ return `#${channel.name} ${channel.id} ${count6} ${marks} ${channel.topic}`;
85772
86021
  });
85773
86022
  return `${rows.join("\n")}
85774
86023
  `;
@@ -85817,10 +86066,10 @@ var DURATION = /^(\d+)\s*(m|min|mins|minutes?|h|hours?|d|days?)$/i;
85817
86066
  function minutesOf({ text: text3 }) {
85818
86067
  const match = DURATION.exec(text3.trim());
85819
86068
  if (!match?.[1] || !match[2]) return null;
85820
- const count5 = Number(match[1]);
86069
+ const count6 = Number(match[1]);
85821
86070
  const unit = match[2].toLowerCase()[0];
85822
86071
  const perUnit = { d: 1440, h: 60, m: 1 };
85823
- const minutes = count5 * (perUnit[unit ?? "m"] ?? 1);
86072
+ const minutes = count6 * (perUnit[unit ?? "m"] ?? 1);
85824
86073
  return minutes > 0 ? minutes : null;
85825
86074
  }
85826
86075
  function muteTextOf({ mute }) {
@@ -88697,7 +88946,9 @@ var whatsappChangeDefinition = external_exports.object({
88697
88946
  quote: external_exports.object({
88698
88947
  id: external_exports.string().min(1).max(200),
88699
88948
  sender: external_exports.string().max(500),
88700
- text: external_exports.string().max(1e3)
88949
+ text: external_exports.string().max(1e3),
88950
+ /** A quote of the account owner's own message; absent from older connectors. */
88951
+ fromMe: external_exports.boolean().optional()
88701
88952
  }).optional()
88702
88953
  });
88703
88954
  var whatsappReadDefinition = external_exports.object({
@@ -88872,7 +89123,7 @@ var agentHostGrantDefinition = external_exports.object({
88872
89123
  });
88873
89124
 
88874
89125
  // ../../modules/compute/contract/src/compute.ts
88875
- var idSchema23 = external_exports.string().min(1).max(64);
89126
+ var idSchema24 = external_exports.string().min(1).max(64);
88876
89127
  var workspaceIdSchema23 = external_exports.string().min(1).max(64);
88877
89128
  var machineStateSchema = external_exports.enum([
88878
89129
  "starting",
@@ -88894,24 +89145,24 @@ var machinePriceDefinition = external_exports.object({
88894
89145
  asleepMonthUsd: external_exports.number()
88895
89146
  });
88896
89147
  var machineGranteeKindSchema = external_exports.enum(["member", "agent"]);
88897
- var machineGranteeDefinition = external_exports.object({ kind: machineGranteeKindSchema, id: idSchema23 });
89148
+ var machineGranteeDefinition = external_exports.object({ kind: machineGranteeKindSchema, id: idSchema24 });
88898
89149
  var machineGrantDefinition = external_exports.object({
88899
89150
  kind: machineGranteeKindSchema,
88900
- id: idSchema23,
88901
- grantedByUserId: idSchema23,
89151
+ id: idSchema24,
89152
+ grantedByUserId: idSchema24,
88902
89153
  grantedAt: external_exports.iso.datetime()
88903
89154
  });
88904
89155
  var machineDefinition = external_exports.object({
88905
- id: idSchema23,
89156
+ id: idSchema24,
88906
89157
  workspaceId: workspaceIdSchema23,
88907
89158
  name: external_exports.string(),
88908
89159
  type: machineTypeSchema,
88909
89160
  zone: external_exports.string(),
88910
89161
  state: machineStateSchema,
88911
- ownerUserId: idSchema23,
88912
- requesterUserId: idSchema23,
88913
- renterAgentId: idSchema23.nullable(),
88914
- channelId: idSchema23.nullable(),
89162
+ ownerUserId: idSchema24,
89163
+ requesterUserId: idSchema24,
89164
+ renterAgentId: idSchema24.nullable(),
89165
+ channelId: idSchema24.nullable(),
88915
89166
  ipAddress: external_exports.string().nullable(),
88916
89167
  sites: external_exports.array(machineSiteDefinition),
88917
89168
  /** Members and agents the owner shared the machine with, beyond the owner's own agents. */
@@ -88943,7 +89194,7 @@ var machineDefinition = external_exports.object({
88943
89194
  /** The owner's agents set to run on this own machine. */
88944
89195
  hostedAgents: external_exports.array(
88945
89196
  external_exports.object({
88946
- id: idSchema23,
89197
+ id: idSchema24,
88947
89198
  name: external_exports.string(),
88948
89199
  whenOffline: external_exports.enum(["wait", "sandbox"])
88949
89200
  })
@@ -89022,11 +89273,11 @@ var loginTerminalDefinition = external_exports.discriminatedUnion("status", [
89022
89273
  var loginTerminalSchema = loginTerminalDefinition;
89023
89274
  var warmComputerDefinition = external_exports.object({ status: external_exports.enum(["starting", "ready"]) });
89024
89275
  var warmComputerSchema = warmComputerDefinition;
89025
- var screenRefDefinition = external_exports.object({ workspaceId: workspaceIdSchema23, sessionId: idSchema23 });
89276
+ var screenRefDefinition = external_exports.object({ workspaceId: workspaceIdSchema23, sessionId: idSchema24 });
89026
89277
  var screenRefSchema = screenRefDefinition;
89027
89278
  var screenSessionDefinition = external_exports.object({
89028
- sessionId: idSchema23,
89029
- machineId: idSchema23,
89279
+ sessionId: idSchema24,
89280
+ machineId: idSchema24,
89030
89281
  machineName: external_exports.string(),
89031
89282
  site: external_exports.string().nullable(),
89032
89283
  expiresAt: external_exports.iso.datetime(),
@@ -89060,7 +89311,7 @@ var ownMachineSshConnectDefinition = external_exports.object({
89060
89311
  publicKey: external_exports.string()
89061
89312
  });
89062
89313
  var ownMachineSshConnectSchema = ownMachineSshConnectDefinition;
89063
- var reconcileDefinition = external_exports.object({ workspaceId: workspaceIdSchema23, machineId: idSchema23 });
89314
+ var reconcileDefinition = external_exports.object({ workspaceId: workspaceIdSchema23, machineId: idSchema24 });
89064
89315
  var ComputeApi = moduleApi()("compute");
89065
89316
  var computeCoreTrpc = defineTrpcContract("compute").query("status").withInput(computeWorkspaceInputSchema).withOutput(computeStatusSchema).query("browserTabs").withInput(browserTabListInputSchema).withOutput(browserTabListSchema).query("browserTab").withInput(browserTabInputSchema).withOutput(browserTabSchema).mutation("openBrowserTab").withInput(openBrowserTabInputSchema).withOutput(browserTabSchema).mutation("browserTabScreen").withInput(browserTabInputSchema).withOutput(browserTabScreenSchema).mutation("sizeBrowserTabScreen").withInput(browserTabScreenSizeInputSchema).withOutput(browserTabScreenSizeSchema).mutation("gotoBrowserTab").withInput(browserTabGotoInputSchema).withOutput(browserTabPageSchema).mutation("doneOnBrowserTab").withInput(browserTabInputSchema).withOutput(browserTabSchema).mutation("shareBrowserTab").withInput(browserTabShareInputSchema).withOutput(browserTabSchema).mutation("closeBrowserTab").withInput(browserTabInputSchema).withOutput(external_exports.object({ closed: external_exports.literal(true) })).query("computer").withInput(computeWorkspaceInputSchema).withOutput(computerStatusSchema).mutation("setComputerSize").withInput(setComputerSizeInputSchema).withOutput(computerSizeAnswerSchema).mutation("requestComputerSize").withInput(setComputerSizeInputSchema).withOutput(computerRequestSchema).mutation("cancelComputerRequest").withInput(computerRequestRefSchema).withOutput(computerRequestSchema).mutation("restartComputer").withInput(restartComputerInputSchema).withOutput(computerRestartAnswerSchema).query("computers").withInput(computeWorkspaceInputSchema).withOutput(computerListSchema).query("dedicatedIp").withInput(computeWorkspaceInputSchema).withOutput(dedicatedIpStatusSchema).mutation("setDedicatedIp").withInput(setDedicatedIpInputSchema).withOutput(dedicatedIpAnswerSchema).mutation("turnOffDedicatedIp").withInput(computeWorkspaceInputSchema).withOutput(dedicatedIpAnswerSchema).mutation("setDedicatedIpDomains").withInput(setDedicatedIpDomainsInputSchema).withOutput(dedicatedIpAnswerSchema).query("dedicatedIps").withInput(computeWorkspaceInputSchema).withOutput(dedicatedIpListSchema).query("dedicatedIpCountries").withInput(computeWorkspaceInputSchema).withOutput(dedicatedIpCountriesSchema).query("dedicatedIpOffer").withInput(dedicatedIpOfferInputSchema).withOutput(dedicatedIpOfferSchema).query("list").withInput(computeWorkspaceInputSchema).withOutput(external_exports.array(machineSchema)).query("get").withInput(machineRefSchema).withOutput(machineSchema).mutation("setupBrowser").withInput(setupBrowserInputSchema).withOutput(machineSchema).mutation("sleep").withInput(machineRefSchema).withOutput(machineSchema).mutation("wake").withInput(machineRefSchema).withOutput(machineSchema).mutation("delete").withInput(machineRefSchema).withOutput(machineSchema).mutation("rename").withInput(renameMachineInputSchema).withOutput(machineSchema).mutation("grant").withInput(machineGrantInputSchema).withOutput(machineSchema).mutation("revokeGrant").withInput(machineGrantInputSchema).withOutput(machineSchema).mutation("setBudget").withInput(setMachineBudgetInputSchema).withOutput(machineSchema).mutation("openScreen").withInput(openScreenInputSchema).withOutput(screenSessionSchema).mutation("openLoginTerminal").withInput(openLoginTerminalInputSchema).withOutput(loginTerminalSchema).mutation("finishScreen").withInput(screenRefSchema).withOutput(machineSchema).mutation("connectOwn").withInput(connectOwnMachineInputSchema).withOutput(ownMachineConnectSchema).mutation("newConnectCommand").withInput(machineRefSchema).withOutput(ownMachineConnectSchema).mutation("connectSsh").withInput(connectSshMachineInputSchema).withOutput(ownMachineSshConnectSchema).mutation("trustHostKey").withInput(trustHostKeyInputSchema).withOutput(machineSchema).mutation("checkHealth").withInput(machineRefSchema).withOutput(machineSchema).mutation("hostAgent").withInput(hostAgentInputSchema).withOutput(machineSchema).mutation("unhostAgent").withInput(unhostAgentInputSchema).withOutput(external_exports.object({ agentId: external_exports.string() })).mutation("pairWhatsapp").withInput(whatsappPairInputSchema).withOutput(whatsappPairingSchema).query("whatsappMirror").withInput(machineRefSchema).withOutput(whatsappMirrorSettingsSchema).mutation("setWhatsappMirror").withInput(setWhatsappMirrorInputSchema).withOutput(whatsappMirrorSettingsSchema).query("whatsappPairing").withInput(whatsappPairingRefSchema).withOutput(whatsappPairingSchema).mutation("cancelWhatsappPairing").withInput(whatsappPairingRefSchema).withOutput(whatsappPairingSchema).mutation("unpairWhatsapp").withInput(machineRefSchema).withOutput(machineSchema).build();
89066
89317
  var computeFleetTrpc = defineTrpcContract("compute").query("whatsappComputer").withInput(whatsappComputerInputSchema).withOutput(whatsappComputerSchema).mutation("prepareWhatsappComputer").withInput(whatsappComputerInputSchema).withOutput(whatsappComputerSchema).mutation("warmComputer").withInput(computeWorkspaceInputSchema).withOutput(warmComputerSchema).query("myComputers").withInput(computeWorkspaceInputSchema).withOutput(myComputersSchema).query("personComputer").withInput(personComputerInputSchema).withOutput(computerUseSchema2).mutation("createComputer").withInput(createComputerInputSchema).withOutput(computerStatusSchema).mutation("deleteComputer").withInput(deleteComputerInputSchema).withOutput(deleteComputerAnswerSchema).mutation("setComputerCreators").withInput(setComputerCreatorsInputSchema).withOutput(computerStatusSchema).mutation("setAgentComputer").withInput(setAgentComputerInputSchema).withOutput(agentComputerAnswerSchema).query("whatsappAgents").withInput(machineRefSchema).withOutput(whatsappAgentsSchema).mutation("setWhatsappAgent").withInput(setWhatsappAgentInputSchema).withOutput(whatsappAgentsSchema).mutation("setWhatsappAgentLease").withInput(setWhatsappAgentLeaseInputSchema).withOutput(whatsappAgentsSchema).mutation("setWhatsappEveryAgent").withInput(setWhatsappEveryAgentInputSchema).withOutput(whatsappAgentsSchema).mutation("setWhatsappAgentAccess").withInput(setWhatsappAgentAccessInputSchema).withOutput(whatsappAgentsSchema).mutation("checkWhatsappNow").withInput(machineRefSchema).withOutput(whatsappMirrorSettingsSchema).query("whatsappChatPeople").withInput(whatsappChatPeopleInputSchema).withOutput(whatsappChatPeopleSchema).mutation("watchWhatsappChat").withInput(whatsappWatchInputSchema).withOutput(whatsappWatchSchema).mutation("checkWhatsappReply").withInput(whatsappReplyCheckInputSchema).withOutput(whatsappReplyCheckSchema).build();
@@ -89294,7 +89545,7 @@ ${COMPUTER_COPY_USAGE}`);
89294
89545
  const full = resolve12(context.cwd, path);
89295
89546
  const found = await stat11(full).catch(() => void 0);
89296
89547
  if (!found) throw new CliUsageError(`${path} does not exist`);
89297
- const { name: name3, parent, entry } = packingOf({
89548
+ const { name: name3, parent, entry: entry2 } = packingOf({
89298
89549
  path: path.endsWith("/") ? `${full}/` : full,
89299
89550
  isDirectory: found.isDirectory()
89300
89551
  });
@@ -89302,7 +89553,7 @@ ${COMPUTER_COPY_USAGE}`);
89302
89553
  const archive2 = resolve12(dir, `${name3}.tar.gz`);
89303
89554
  try {
89304
89555
  const code = await context.runCommand({
89305
- command: ["tar", "-czf", archive2, "-C", parent, entry],
89556
+ command: ["tar", "-czf", archive2, "-C", parent, entry2],
89306
89557
  env: { COPYFILE_DISABLE: "1" }
89307
89558
  });
89308
89559
  if (code !== 0) throw new CliUsageError(`tar could not pack ${path} (exit ${code})`);
@@ -90187,9 +90438,9 @@ function readOf(args) {
90187
90438
  ...before && { before: Number(before) }
90188
90439
  };
90189
90440
  }
90190
- function printEntry({ context, entry }) {
90191
- const who = `${entry.actorKind}:${entry.actorId ?? "-"}`;
90192
- context.out(`${entry.seq} ${entry.at} ${entry.action} ${entry.outcome} ${who}
90441
+ function printEntry({ context, entry: entry2 }) {
90442
+ const who = `${entry2.actorKind}:${entry2.actorId ?? "-"}`;
90443
+ context.out(`${entry2.seq} ${entry2.at} ${entry2.action} ${entry2.outcome} ${who}
90193
90444
  `);
90194
90445
  }
90195
90446
  var listAudit = async ({ context, args }) => {
@@ -90197,12 +90448,12 @@ var listAudit = async ({ context, args }) => {
90197
90448
  if (args.words[1] === "activity") {
90198
90449
  const entries = await client.post("/api/vault/activity", readOf(args));
90199
90450
  if (args.flags.json) return printJson4({ context, data: entries });
90200
- for (const entry of entries) printEntry({ context, entry });
90451
+ for (const entry2 of entries) printEntry({ context, entry: entry2 });
90201
90452
  return;
90202
90453
  }
90203
90454
  const page = await client.post("/api/vault/audit", readOf(args));
90204
90455
  if (args.flags.json) return printJson4({ context, data: page });
90205
- for (const entry of page.entries) printEntry({ context, entry });
90456
+ for (const entry2 of page.entries) printEntry({ context, entry: entry2 });
90206
90457
  const chain = page.chain.intact ? "intact" : `broken at ${page.chain.brokenAtSeq}`;
90207
90458
  context.out(`Chain ${chain}.${page.nextCursor ? ` Older: --before ${page.nextCursor}` : ""}
90208
90459
  `);
@@ -91765,7 +92016,7 @@ var EXTERNAL_CONNECTION_REST_PATHS = {
91765
92016
  report: "/api/external-connections/report"
91766
92017
  };
91767
92018
  var workspaceIdSchema26 = external_exports.string().min(1).max(64);
91768
- var idSchema24 = external_exports.string().min(1).max(64);
92019
+ var idSchema25 = external_exports.string().min(1).max(64);
91769
92020
  var iso2 = external_exports.iso.datetime();
91770
92021
  var workspaceInput5 = external_exports.object({ workspaceId: workspaceIdSchema26 });
91771
92022
  var connectionReference = external_exports.string().trim().min(1).max(120);
@@ -91871,11 +92122,11 @@ var rosterDefinition = external_exports.object({
91871
92122
  members: external_exports.array(rosterMemberDefinition)
91872
92123
  });
91873
92124
  var externalRosterSchema = rosterDefinition;
91874
- var rosterInputDefinition = external_exports.object({ workspaceId: workspaceIdSchema26, channelId: idSchema24 });
92125
+ var rosterInputDefinition = external_exports.object({ workspaceId: workspaceIdSchema26, channelId: idSchema25 });
91875
92126
  var externalRosterInputSchema = rosterInputDefinition;
91876
92127
  var rosterCountsInputDefinition = external_exports.object({
91877
92128
  workspaceId: workspaceIdSchema26,
91878
- channelIds: external_exports.array(idSchema24).max(200)
92129
+ channelIds: external_exports.array(idSchema25).max(200)
91879
92130
  });
91880
92131
  var externalRosterCountsInputSchema = rosterCountsInputDefinition;
91881
92132
  var rosterCountsDefinition = external_exports.object({
@@ -91891,7 +92142,7 @@ var inviteInputDefinition = external_exports.object({
91891
92142
  company: external_exports.string().trim().min(1).max(80).optional()
91892
92143
  });
91893
92144
  var externalInviteInputSchema = inviteInputDefinition;
91894
- var inviteRefDefinition = external_exports.object({ workspaceId: workspaceIdSchema26, inviteId: idSchema24 });
92145
+ var inviteRefDefinition = external_exports.object({ workspaceId: workspaceIdSchema26, inviteId: idSchema25 });
91895
92146
  var externalInviteRefSchema = inviteRefDefinition;
91896
92147
  var pendingShareDefinition = external_exports.object({
91897
92148
  channelId: external_exports.string(),
@@ -91916,7 +92167,7 @@ var externalPendingSharesSchema = pendingSharesDefinition;
91916
92167
  var acceptInviteDefinition = external_exports.object({
91917
92168
  /** The workspace to connect: one where the person is Admin or Owner. */
91918
92169
  workspaceId: workspaceIdSchema26,
91919
- inviteId: idSchema24,
92170
+ inviteId: idSchema25,
91920
92171
  /** The emailed link's secret; without it the invitation must be addressed to the person. */
91921
92172
  secret: external_exports.string().trim().max(200).optional()
91922
92173
  });
@@ -91937,8 +92188,8 @@ var settingsInputDefinition = external_exports.object({
91937
92188
  var externalSettingsInputSchema = settingsInputDefinition;
91938
92189
  var letAgentInInputDefinition = external_exports.object({
91939
92190
  workspaceId: workspaceIdSchema26,
91940
- channelId: idSchema24,
91941
- agentId: idSchema24
92191
+ channelId: idSchema25,
92192
+ agentId: idSchema25
91942
92193
  });
91943
92194
  var externalLetAgentInInputSchema = letAgentInInputDefinition;
91944
92195
  var agentLetInDefinition = external_exports.object({
@@ -91957,7 +92208,7 @@ var shareInputDefinition = external_exports.object({
91957
92208
  var externalShareInputSchema = shareInputDefinition;
91958
92209
  var acceptShareDefinition = external_exports.object({
91959
92210
  workspaceId: workspaceIdSchema26,
91960
- shareId: idSchema24,
92211
+ shareId: idSchema25,
91961
92212
  /** Its name here; the host's name when left out. */
91962
92213
  name: external_exports.string().trim().min(1).max(80).optional(),
91963
92214
  visibility: external_exports.enum(["public", "private"]).default("public")
@@ -93114,7 +93365,8 @@ var feedApprovalSchemaDefinition = external_exports.object({
93114
93365
  "computer",
93115
93366
  "agent_join",
93116
93367
  "agent_transfer",
93117
- "vault_share"
93368
+ "vault_share",
93369
+ "agent_share"
93118
93370
  ]),
93119
93371
  requestId: external_exports.string(),
93120
93372
  /** Every request an invite card answers at once, `requestId` first; absent means just it. */
@@ -93606,7 +93858,7 @@ var feedPageMirror = {
93606
93858
  },
93607
93859
  storable: feedPageForDisk
93608
93860
  };
93609
- var feedTrpc = defineTrpcContract("feed").query("channelItems").withInput(external_exports.object({ workspaceId: external_exports.string().min(1), channelId: external_exports.string().min(1) })).withOutput(external_exports.array(feedAgentItemSchema)).query("list").withInput(listFeedInputSchema).withOutput(feedViewSchema).query("page", { mirrored: feedPageMirror }).withInput(pageFeedInputSchema).withOutput(feedPageSchema).query("card").withInput(itemRef).withOutput(feedCardViewSchema).query("fileLink").withInput(feedFileLinkInputSchema).withOutput(feedFileLinkSchema).query("count").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(external_exports.object({ count: external_exports.number().int().nonnegative() })).query("decisions").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(feedDecisionsSchema).mutation("act").withInput(actFeedItemInputSchema).withOutput(feedItemSchema).mutation("comment").withInput(commentFeedItemInputSchema).withOutput(feedItemSchema).mutation("commentPlace").withInput(itemRef).withOutput(feedCommentPlaceSchema).query("commentDrafts").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(commentDraftListSchema).mutation("saveCommentDraft").withInput(saveCommentDraftInputSchema).withOutput(commentDraftSavedSchema).mutation("deleteCommentDraft").withInput(itemRef).withOutput(commentDraftSavedSchema).mutation("done").withInput(itemRef).withOutput(feedItemSchema).mutation("stopAutoSend").withInput(itemRef).withOutput(feedItemSchema).mutation("putBack").withInput(putBackFeedItemInputSchema).withOutput(feedItemSchema).mutation("snooze").withInput(snoozeFeedItemInputSchema).withOutput(feedItemSchema).mutation("unsnooze").withInput(itemRef).withOutput(feedItemSchema).mutation("saveDraft").withInput(saveFeedDraftInputSchema).withOutput(feedItemSchema).mutation("editItem").withInput(editFeedItemInputSchema).withOutput(feedItemSchema).mutation("saveMessage").withInput(saveFeedMessageInputSchema).withOutput(feedItemSchema).mutation("share").withInput(shareFeedItemInputSchema).withOutput(feedShareAnswerSchema).mutation("unshare").withInput(unshareFeedItemInputSchema).withOutput(feedShareAnswerSchema).query("shareCandidates").withInput(itemRef).withOutput(external_exports.array(feedSharePersonSchema)).query("commentReach").withInput(itemRef).withOutput(feedCommentReachSchema).mutation("moveToAgent").withInput(moveFeedItemToAgentInputSchema).withOutput(feedItemSchema).mutation("answerApproval").withInput(answerFeedApprovalInputSchema).withOutput(feedItemSchema).mutation("decidePublish").withInput(decideFeedPublishInputSchema).withOutput(feedItemSchema).mutation("decideAccess").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideServer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAppAccess").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideComputer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAgentJoin").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAgentTransfer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("pin").withInput(pinFeedItemInputSchema).withOutput(feedItemSchema).mutation("markRead").withInput(itemRef).withOutput(feedItemSchema).mutation("markUnread").withInput(itemRef).withOutput(feedItemSchema).mutation("markAllRead").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(external_exports.object({ workspaceId: external_exports.string() })).query("delegates").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(external_exports.array(feedDelegateSchema)).mutation("setDelegate").withInput(setFeedDelegateInputSchema).withOutput(external_exports.array(feedDelegateSchema)).build();
93861
+ var feedTrpc = defineTrpcContract("feed").query("channelItems").withInput(external_exports.object({ workspaceId: external_exports.string().min(1), channelId: external_exports.string().min(1) })).withOutput(external_exports.array(feedAgentItemSchema)).query("list").withInput(listFeedInputSchema).withOutput(feedViewSchema).query("page", { mirrored: feedPageMirror }).withInput(pageFeedInputSchema).withOutput(feedPageSchema).query("card").withInput(itemRef).withOutput(feedCardViewSchema).query("fileLink").withInput(feedFileLinkInputSchema).withOutput(feedFileLinkSchema).query("count").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(external_exports.object({ count: external_exports.number().int().nonnegative() })).query("decisions").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(feedDecisionsSchema).mutation("act").withInput(actFeedItemInputSchema).withOutput(feedItemSchema).mutation("comment").withInput(commentFeedItemInputSchema).withOutput(feedItemSchema).mutation("commentPlace").withInput(itemRef).withOutput(feedCommentPlaceSchema).query("commentDrafts").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(commentDraftListSchema).mutation("saveCommentDraft").withInput(saveCommentDraftInputSchema).withOutput(commentDraftSavedSchema).mutation("deleteCommentDraft").withInput(itemRef).withOutput(commentDraftSavedSchema).mutation("done").withInput(itemRef).withOutput(feedItemSchema).mutation("stopAutoSend").withInput(itemRef).withOutput(feedItemSchema).mutation("putBack").withInput(putBackFeedItemInputSchema).withOutput(feedItemSchema).mutation("snooze").withInput(snoozeFeedItemInputSchema).withOutput(feedItemSchema).mutation("unsnooze").withInput(itemRef).withOutput(feedItemSchema).mutation("saveDraft").withInput(saveFeedDraftInputSchema).withOutput(feedItemSchema).mutation("editItem").withInput(editFeedItemInputSchema).withOutput(feedItemSchema).mutation("saveMessage").withInput(saveFeedMessageInputSchema).withOutput(feedItemSchema).mutation("share").withInput(shareFeedItemInputSchema).withOutput(feedShareAnswerSchema).mutation("unshare").withInput(unshareFeedItemInputSchema).withOutput(feedShareAnswerSchema).query("shareCandidates").withInput(itemRef).withOutput(external_exports.array(feedSharePersonSchema)).query("commentReach").withInput(itemRef).withOutput(feedCommentReachSchema).mutation("moveToAgent").withInput(moveFeedItemToAgentInputSchema).withOutput(feedItemSchema).mutation("answerApproval").withInput(answerFeedApprovalInputSchema).withOutput(feedItemSchema).mutation("decidePublish").withInput(decideFeedPublishInputSchema).withOutput(feedItemSchema).mutation("decideAccess").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideServer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAppAccess").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideComputer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAgentJoin").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAgentTransfer").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("decideAgentShare").withInput(decideFeedRequestInputSchema).withOutput(feedItemSchema).mutation("pin").withInput(pinFeedItemInputSchema).withOutput(feedItemSchema).mutation("markRead").withInput(itemRef).withOutput(feedItemSchema).mutation("markUnread").withInput(itemRef).withOutput(feedItemSchema).mutation("markAllRead").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(external_exports.object({ workspaceId: external_exports.string() })).query("delegates").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(external_exports.array(feedDelegateSchema)).mutation("setDelegate").withInput(setFeedDelegateInputSchema).withOutput(external_exports.array(feedDelegateSchema)).build();
93610
93862
  var feedUi = uiTokens("feed");
93611
93863
  var FeedNavSlot = feedUi.component("nav");
93612
93864
  var FeedDecisionsSlot = feedUi.component("decisions");
@@ -93719,8 +93971,8 @@ function draftFilesMissingText(names) {
93719
93971
  }
93720
93972
 
93721
93973
  // ../../modules/feed/contract/src/feed.decisions.ts
93722
- function decisionsLineOf(count5) {
93723
- return `${count5} ${count5 === 1 ? "decision" : "decisions"} waiting on you`;
93974
+ function decisionsLineOf(count6) {
93975
+ return `${count6} ${count6 === 1 ? "decision" : "decisions"} waiting on you`;
93724
93976
  }
93725
93977
 
93726
93978
  // src/rules/feed-input.rules.ts
@@ -94217,13 +94469,13 @@ function shareCommand({ move: move3 }) {
94217
94469
  }
94218
94470
  function optionalWords(words) {
94219
94471
  return Object.fromEntries(
94220
- Object.entries(words).filter((entry) => Boolean(entry[1]))
94472
+ Object.entries(words).filter((entry2) => Boolean(entry2[1]))
94221
94473
  );
94222
94474
  }
94223
94475
  function shareLinesOf({ move: move3, answer: answer6 }) {
94224
94476
  const names = answer6.people.map((person) => person.name).join(", ") || "no one new";
94225
- const count5 = answer6.itemIds.length;
94226
- const items = `${count5} item${count5 === 1 ? "" : "s"}`;
94477
+ const count6 = answer6.itemIds.length;
94478
+ const items = `${count6} item${count6 === 1 ? "" : "s"}`;
94227
94479
  const head = move3 === "share" ? `Shared ${items} with ${names}` : `Took ${names} off ${items}`;
94228
94480
  return [head, ...answer6.itemIds].map((line) => `${line}
94229
94481
  `).join("");
@@ -94854,13 +95106,13 @@ function formatHistory(output2) {
94854
95106
  const lines2 = linesOf3(output2);
94855
95107
  if (lines2.length === 0) return `${where}${from}: no messages.
94856
95108
  `;
94857
- const count5 = lines2.length === 1 ? "1 message" : `${lines2.length} messages`;
95109
+ const count6 = lines2.length === 1 ? "1 message" : `${lines2.length} messages`;
94858
95110
  const blocks = lines2.map(blockOf2).join("\n\n");
94859
95111
  const cursor = olderCursorOf(output2);
94860
95112
  const older = cursor ? `
94861
95113
 
94862
95114
  Older: laze history ${output2.channel} --before ${cursor}` : "";
94863
- return `${where}${from}: ${count5}, oldest first
95115
+ return `${where}${from}: ${count6}, oldest first
94864
95116
 
94865
95117
  ${blocks}${older}
94866
95118
  `;
@@ -96071,10 +96323,10 @@ ${USAGE12}`);
96071
96323
  if ("exitCode" in released) return released;
96072
96324
  Object.assign(env, released.env);
96073
96325
  }
96074
- const count5 = Object.keys(env).length;
96075
- if (count5 > EXEC_ENV_MAX) {
96326
+ const count6 = Object.keys(env).length;
96327
+ if (count6 > EXEC_ENV_MAX) {
96076
96328
  context.err(
96077
- `laze: these connections hold ${count5} variables; at most ${EXEC_ENV_MAX} go with a command. Send fewer connections, or run the command with \`laze vault run\` where you run.
96329
+ `laze: these connections hold ${count6} variables; at most ${EXEC_ENV_MAX} go with a command. Send fewer connections, or run the command with \`laze vault run\` where you run.
96078
96330
  `
96079
96331
  );
96080
96332
  return { exitCode: 1 };
@@ -96229,7 +96481,7 @@ function secretRefusal({
96229
96481
  rules = MCP_SECRET_COMMANDS
96230
96482
  }) {
96231
96483
  const { words, flags: flags2 } = parseArgs({ argv });
96232
- const command = [3, 2, 1].map((count5) => words.slice(0, count5).join(" ")).find((name3) => Object.hasOwn(rules, name3));
96484
+ const command = [3, 2, 1].map((count6) => words.slice(0, count6).join(" ")).find((name3) => Object.hasOwn(rules, name3));
96233
96485
  const rule = command === void 0 ? void 0 : rules[command];
96234
96486
  if (!command || !rule) return void 0;
96235
96487
  const vaultFlag = rule.vaultFlag ?? "from-vault";
@@ -96948,11 +97200,11 @@ async function monitorAdd({ context, args }) {
96948
97200
  });
96949
97201
  if (args.flags.json) return context.out(`${JSON.stringify(added, null, 2)}
96950
97202
  `);
96951
- const count5 = added.watching.length;
97203
+ const count6 = added.watching.length;
96952
97204
  context.out(
96953
97205
  `${added.monitor.id} ${added.monitor.name}
96954
97206
  ${added.watching.join(" ")}
96955
- Watching ${count5} ${count5 === 1 ? "channel" : "channels"}
97207
+ Watching ${count6} ${count6 === 1 ? "channel" : "channels"}
96956
97208
  `
96957
97209
  );
96958
97210
  }
@@ -97615,9 +97867,9 @@ var seatAddedSchemaDefinition = external_exports.object({
97615
97867
 
97616
97868
  // ../../modules/workspace/contract/src/workspace-groups.ts
97617
97869
  var GROUP_MEMBERS_MAX_PER_CALL = 200;
97618
- var idSchema25 = external_exports.string().min(1).max(80);
97870
+ var idSchema26 = external_exports.string().min(1).max(80);
97619
97871
  var workspaceGroupSchemaDefinition = external_exports.object({
97620
- id: idSchema25,
97872
+ id: idSchema26,
97621
97873
  name: external_exports.string(),
97622
97874
  /** Who is in it, by user id. */
97623
97875
  memberIds: external_exports.array(external_exports.string()),
@@ -97625,7 +97877,7 @@ var workspaceGroupSchemaDefinition = external_exports.object({
97625
97877
  createdAt: external_exports.iso.datetime()
97626
97878
  });
97627
97879
  var workspaceGroupSchema = workspaceGroupSchemaDefinition;
97628
- var memberIdsSchema = external_exports.array(idSchema25).max(GROUP_MEMBERS_MAX_PER_CALL);
97880
+ var memberIdsSchema = external_exports.array(idSchema26).max(GROUP_MEMBERS_MAX_PER_CALL);
97629
97881
  var createGroupInputSchemaDefinition = external_exports.object({
97630
97882
  workspaceId: external_exports.string().min(1),
97631
97883
  name: external_exports.string().trim().min(1).max(80),
@@ -97634,18 +97886,18 @@ var createGroupInputSchemaDefinition = external_exports.object({
97634
97886
  var createGroupInputSchema = createGroupInputSchemaDefinition;
97635
97887
  var renameGroupInputSchemaDefinition = external_exports.object({
97636
97888
  workspaceId: external_exports.string().min(1),
97637
- groupId: idSchema25,
97889
+ groupId: idSchema26,
97638
97890
  name: external_exports.string().trim().min(1).max(80)
97639
97891
  });
97640
97892
  var renameGroupInputSchema = renameGroupInputSchemaDefinition;
97641
97893
  var groupInputSchemaDefinition = external_exports.object({
97642
97894
  workspaceId: external_exports.string().min(1),
97643
- groupId: idSchema25
97895
+ groupId: idSchema26
97644
97896
  });
97645
97897
  var groupInputSchema = groupInputSchemaDefinition;
97646
97898
  var changeGroupMembersInputSchemaDefinition = external_exports.object({
97647
97899
  workspaceId: external_exports.string().min(1),
97648
- groupId: idSchema25,
97900
+ groupId: idSchema26,
97649
97901
  add: memberIdsSchema.default([]),
97650
97902
  remove: memberIdsSchema.default([])
97651
97903
  });
@@ -98508,7 +98760,8 @@ var OPERATOR_KEY_ACTIONS = [
98508
98760
  "user.lookup",
98509
98761
  "workspace.flag",
98510
98762
  "workspace.credits",
98511
- "workspace.plan"
98763
+ "workspace.plan",
98764
+ "ops.functions"
98512
98765
  ];
98513
98766
  var operatorKeyActionSchema = external_exports.enum(OPERATOR_KEY_ACTIONS);
98514
98767
  var OPERATOR_KEY_REST_PATHS = {
@@ -98536,6 +98789,8 @@ var requestInputDefinition2 = external_exports.object({
98536
98789
  action: external_exports.string().trim().min(1).max(80),
98537
98790
  target: id3,
98538
98791
  args: argsDefinition.default({}),
98792
+ /** The ops functions an `ops.functions` lease may call (ADR-214); empty for any other action. */
98793
+ functions: external_exports.array(external_exports.string().trim().min(1).max(80)).max(50).default([]),
98539
98794
  reason,
98540
98795
  /** sha256 of the secret the CLI made and keeps; the secret itself never comes here. */
98541
98796
  secretHash: sha256Hex
@@ -98545,6 +98800,8 @@ var keyDefinition = external_exports.object({
98545
98800
  action: operatorKeyActionSchema,
98546
98801
  target: external_exports.string(),
98547
98802
  args: argsDefinition,
98803
+ /** The ops functions an `ops.functions` lease may call; empty for any other action. */
98804
+ functions: external_exports.array(external_exports.string()).default([]),
98548
98805
  reason: external_exports.string(),
98549
98806
  status: operatorKeyStatusSchema,
98550
98807
  /** The API key that asked; only that key can use this one. */
@@ -98569,12 +98826,20 @@ var keyDefinition = external_exports.object({
98569
98826
  var operatorKeySchema = keyDefinition;
98570
98827
  var statusInputDefinition = external_exports.object({ keyId: id3 });
98571
98828
  var operatorKeyIdSchema = statusInputDefinition;
98572
- var useInputDefinition = external_exports.object({ keyId: id3, secret: external_exports.string().min(32).max(128) });
98829
+ var useInputDefinition = external_exports.object({
98830
+ keyId: id3,
98831
+ secret: external_exports.string().min(32).max(128),
98832
+ /** On an `ops.functions` lease: which of its functions to call, and that function's input. */
98833
+ function: external_exports.string().trim().min(1).max(80).optional(),
98834
+ input: external_exports.unknown().optional()
98835
+ });
98573
98836
  var useAnswerDefinition = external_exports.object({
98574
98837
  keyId: external_exports.string(),
98575
98838
  action: operatorKeyActionSchema,
98576
98839
  target: external_exports.string(),
98577
98840
  endsAt: external_exports.iso.datetime(),
98841
+ /** The function called, on an `ops.functions` lease. */
98842
+ function: external_exports.string().optional(),
98578
98843
  result: external_exports.unknown()
98579
98844
  });
98580
98845
  var approveDefinition2 = external_exports.object({ keyId: id3, assertion: vaultPasskeyAssertionSchema });
@@ -98587,6 +98852,9 @@ var OPERATOR_KEY_COPY = {
98587
98852
  operator_key_needs_manage: "This action needs an owner holding ops:manage",
98588
98853
  operator_key_bad_target: "This target is not the kind this action works on",
98589
98854
  operator_key_bad_args: "This action does not take those arguments",
98855
+ operator_key_unknown_function: "Name only functions the ops registry lists (laze ops functions)",
98856
+ operator_key_bad_scope: "A lease reads the platform or one workspace: tenant functions need --tenant, platform ones must not have it",
98857
+ operator_key_bad_input: "This function does not take that input",
98590
98858
  operator_key_too_many_waiting: `At most ${OPERATOR_KEY.maxWaiting} keys can wait at once`,
98591
98859
  operator_key_not_found: "There is no such operator key",
98592
98860
  operator_key_not_pending: "This key was already answered or has expired",
@@ -98638,8 +98906,114 @@ var viewDefinition = external_exports.object({
98638
98906
  });
98639
98907
  var hostLoadViewSchema = viewDefinition;
98640
98908
 
98909
+ // ../../modules/ops/contract/src/ops-functions.ts
98910
+ var OPS_FUNCTION = {
98911
+ /** Functions one lease may name. */
98912
+ maxPerLease: 12,
98913
+ /** The longest range a function reads. */
98914
+ maxRangeDays: 31,
98915
+ /** The target of a lease that reads no single workspace. */
98916
+ platformTarget: "platform"
98917
+ };
98918
+ var opsFunctionScopeSchema = external_exports.enum(["lookup", "platform", "tenant"]);
98919
+ var findInputDefinition = external_exports.object({ query: external_exports.string().trim().min(1).max(200) }).strict();
98920
+ var findOutputDefinition = external_exports.object({
98921
+ workspaces: external_exports.array(
98922
+ external_exports.object({
98923
+ id: external_exports.string(),
98924
+ name: external_exports.string(),
98925
+ createdAt: external_exports.iso.datetime(),
98926
+ plan: external_exports.enum(["free", "team"])
98927
+ })
98928
+ )
98929
+ });
98930
+ var funnelInputDefinition = external_exports.object({
98931
+ from: external_exports.iso.datetime(),
98932
+ to: external_exports.iso.datetime(),
98933
+ bucketMinutes: external_exports.union([external_exports.literal(10), external_exports.literal(60), external_exports.literal(1440)]).default(60)
98934
+ }).strict();
98935
+ var count5 = external_exports.number().int().nonnegative();
98936
+ var funnelCountsDefinition = external_exports.object({
98937
+ signUps: count5,
98938
+ workspaces: count5,
98939
+ activatedTeams: count5,
98940
+ payingTeams: count5
98941
+ });
98942
+ var funnelOutputDefinition = external_exports.object({
98943
+ bucketMinutes: external_exports.number().int(),
98944
+ buckets: external_exports.array(external_exports.object({ at: external_exports.iso.datetime(), ...funnelCountsDefinition.shape })),
98945
+ totals: funnelCountsDefinition
98946
+ });
98947
+ var noInputDefinition = external_exports.object({}).strict();
98948
+ var capacityOutputDefinition = external_exports.object({
98949
+ /** The pool now; null where the process runs no pool. */
98950
+ pool: capacityNumbersSchema.nullable(),
98951
+ /** The last day of host load, oldest first. */
98952
+ history: external_exports.array(hostLoadPointSchema)
98953
+ });
98954
+ var tally = external_exports.array(external_exports.object({ key: external_exports.string(), count: count5 }));
98955
+ var snapshotOutputDefinition = external_exports.object({
98956
+ workspaceId: external_exports.string(),
98957
+ createdAt: external_exports.iso.datetime(),
98958
+ plan: external_exports.string(),
98959
+ status: external_exports.string(),
98960
+ seats: external_exports.object({ people: count5, limit: external_exports.number().int().nullable() }),
98961
+ membersByRole: tally,
98962
+ invitesByStatus: tally,
98963
+ agentsByKind: tally,
98964
+ agentsByHosting: tally,
98965
+ agentsConnected: count5,
98966
+ flagsOn: external_exports.array(external_exports.string()),
98967
+ complimentaryComputers: count5
98968
+ });
98969
+ var entry = (value) => value;
98970
+ var OPS_FUNCTIONS = {
98971
+ "workspaces.find": entry({
98972
+ title: "Find a workspace by name",
98973
+ scope: "lookup",
98974
+ view: "table",
98975
+ input: findInputDefinition,
98976
+ output: findOutputDefinition
98977
+ }),
98978
+ "signups.funnel": entry({
98979
+ title: "Sign-ups, workspaces, activated and paying teams over time",
98980
+ scope: "platform",
98981
+ view: "buckets",
98982
+ input: funnelInputDefinition,
98983
+ output: funnelOutputDefinition
98984
+ }),
98985
+ "computers.capacity": entry({
98986
+ title: "Computer pool capacity and host load",
98987
+ scope: "platform",
98988
+ view: "numbers",
98989
+ input: noInputDefinition,
98990
+ output: capacityOutputDefinition
98991
+ }),
98992
+ "tenant.snapshot": entry({
98993
+ title: "One workspace's plan, members, agents and flags, as counts",
98994
+ scope: "tenant",
98995
+ view: "numbers",
98996
+ input: noInputDefinition,
98997
+ output: snapshotOutputDefinition
98998
+ })
98999
+ };
99000
+ var OPS_FUNCTION_NAMES = Object.keys(OPS_FUNCTIONS);
99001
+ var opsFunctionNameSchema = external_exports.enum(OPS_FUNCTION_NAMES);
99002
+ var runDefinition = external_exports.object({
99003
+ function: external_exports.string().trim().min(1).max(80),
99004
+ input: external_exports.unknown().default({})
99005
+ });
99006
+ var opsFunctionRunInputSchema = runDefinition;
99007
+ var answerDefinition = external_exports.object({ function: external_exports.string(), result: external_exports.unknown() });
99008
+ var opsFunctionAnswerSchema = answerDefinition;
99009
+ var OPS_FUNCTION_COPY = {
99010
+ ops_function_unknown: `Choose one of: ${OPS_FUNCTION_NAMES.join(", ")}`,
99011
+ ops_function_wrong_scope: "This function does not read that scope",
99012
+ ops_function_bad_input: "This function does not take that input"
99013
+ };
99014
+
98641
99015
  // ../../modules/ops/contract/src/ops.trpc.ts
98642
- var opsTrpc = defineTrpcContract("ops").query("me").withInput(external_exports.object({})).withOutput(opsOperatorSchema).query("workspaces").withInput(opsSearchInputSchema).withOutput(external_exports.array(opsWorkspaceRowSchema)).query("workspace").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(opsWorkspaceDetailSchema).query("users").withInput(opsSearchInputSchema).withOutput(external_exports.array(opsUserRowSchema)).mutation("setPlan").withInput(opsSetPlanInputSchema).withOutput(opsWorkspaceDetailSchema).mutation("setComplimentaryComputer").withInput(opsSetComputerInputSchema).withOutput(opsWorkspaceDetailSchema).mutation("grantCredits").withInput(opsGrantCreditsInputSchema).withOutput(opsWorkspaceDetailSchema).mutation("setFlag").withInput(opsSetFlagInputSchema).withOutput(opsWorkspaceDetailSchema).query("parked").withInput(external_exports.object({})).withOutput(opsParkedSchema).mutation("parkedAct").withInput(opsParkedActInputSchema).withOutput(external_exports.object({ changed: external_exports.number().int() })).mutation("impersonate").withInput(opsImpersonateInputSchema).withOutput(impersonationSchema).query("operators").withInput(external_exports.object({})).withOutput(external_exports.array(opsOperatorGrantSchema)).query("audit").withInput(external_exports.object({ limit: external_exports.number().int().min(1).max(200).default(100) })).withOutput(external_exports.array(opsAuditRowSchema)).query("vaultLockdown").withInput(external_exports.object({})).withOutput(vaultLockdownSchema).mutation("vaultBreakerChallenge").withInput(external_exports.object({})).withOutput(vaultBreakerChallengeSchema).mutation("proposeOperatorPasskey").withInput(opsProposeOperatorPasskeyInputSchema).withOutput(vaultOperatorProposalSchema).mutation("operatorPasskeyChallenge").withInput(vaultOperatorChallengeInputSchema).withOutput(vaultOperatorChallengeSchema).mutation("commitOperatorRecord").withInput(opsCommitOperatorRecordInputSchema).withOutput(external_exports.object({ seq: external_exports.number().int() })).mutation("resetVaultBreaker").withInput(opsResetVaultBreakerInputSchema).withOutput(external_exports.object({ breaker: external_exports.literal("closed") })).mutation("setVaultOverride").withInput(opsSetVaultOverrideInputSchema).withOutput(vaultLockdownOverrideSchema).mutation("endVaultOverride").withInput(opsEndVaultOverrideInputSchema).withOutput(external_exports.object({ ended: external_exports.boolean() })).query("breakGlassRequests").withInput(external_exports.object({})).withOutput(external_exports.array(breakGlassRequestSchema)).mutation("requestBreakGlass").withInput(breakGlassRequestInputSchema).withOutput(breakGlassRequestSchema).mutation("breakGlassChallenge").withInput(breakGlassRequestIdSchema).withOutput(vaultReauthChallengeSchema).mutation("approveBreakGlass").withInput(breakGlassApproveInputSchema).withOutput(breakGlassRequestSchema).mutation("denyBreakGlass").withInput(breakGlassDenyInputSchema).withOutput(breakGlassRequestSchema).mutation("readBreakGlass").withInput(breakGlassReadInputSchema).withOutput(breakGlassPageSchema).query("operatorKeys").withInput(external_exports.object({})).withOutput(external_exports.array(operatorKeySchema)).mutation("operatorKeyChallenge").withInput(operatorKeyIdSchema).withOutput(vaultOperatorKeyChallengeSchema).mutation("approveOperatorKey").withInput(operatorKeyApproveInputSchema).withOutput(operatorKeySchema).mutation("denyOperatorKey").withInput(operatorKeyDenyInputSchema).withOutput(operatorKeySchema).mutation("revokeOperatorKey").withInput(operatorKeyDenyInputSchema).withOutput(operatorKeySchema).query("hostLoad").withInput(external_exports.object({})).withOutput(hostLoadViewSchema).build();
99016
+ var opsTrpc = defineTrpcContract("ops").query("me").withInput(external_exports.object({})).withOutput(opsOperatorSchema).query("workspaces").withInput(opsSearchInputSchema).withOutput(external_exports.array(opsWorkspaceRowSchema)).query("workspace").withInput(external_exports.object({ workspaceId: external_exports.string().min(1) })).withOutput(opsWorkspaceDetailSchema).query("users").withInput(opsSearchInputSchema).withOutput(external_exports.array(opsUserRowSchema)).mutation("setPlan").withInput(opsSetPlanInputSchema).withOutput(opsWorkspaceDetailSchema).mutation("setComplimentaryComputer").withInput(opsSetComputerInputSchema).withOutput(opsWorkspaceDetailSchema).mutation("grantCredits").withInput(opsGrantCreditsInputSchema).withOutput(opsWorkspaceDetailSchema).mutation("setFlag").withInput(opsSetFlagInputSchema).withOutput(opsWorkspaceDetailSchema).query("parked").withInput(external_exports.object({})).withOutput(opsParkedSchema).mutation("parkedAct").withInput(opsParkedActInputSchema).withOutput(external_exports.object({ changed: external_exports.number().int() })).mutation("impersonate").withInput(opsImpersonateInputSchema).withOutput(impersonationSchema).query("operators").withInput(external_exports.object({})).withOutput(external_exports.array(opsOperatorGrantSchema)).query("audit").withInput(external_exports.object({ limit: external_exports.number().int().min(1).max(200).default(100) })).withOutput(external_exports.array(opsAuditRowSchema)).query("vaultLockdown").withInput(external_exports.object({})).withOutput(vaultLockdownSchema).mutation("vaultBreakerChallenge").withInput(external_exports.object({})).withOutput(vaultBreakerChallengeSchema).mutation("proposeOperatorPasskey").withInput(opsProposeOperatorPasskeyInputSchema).withOutput(vaultOperatorProposalSchema).mutation("operatorPasskeyChallenge").withInput(vaultOperatorChallengeInputSchema).withOutput(vaultOperatorChallengeSchema).mutation("commitOperatorRecord").withInput(opsCommitOperatorRecordInputSchema).withOutput(external_exports.object({ seq: external_exports.number().int() })).mutation("resetVaultBreaker").withInput(opsResetVaultBreakerInputSchema).withOutput(external_exports.object({ breaker: external_exports.literal("closed") })).mutation("setVaultOverride").withInput(opsSetVaultOverrideInputSchema).withOutput(vaultLockdownOverrideSchema).mutation("endVaultOverride").withInput(opsEndVaultOverrideInputSchema).withOutput(external_exports.object({ ended: external_exports.boolean() })).query("breakGlassRequests").withInput(external_exports.object({})).withOutput(external_exports.array(breakGlassRequestSchema)).mutation("requestBreakGlass").withInput(breakGlassRequestInputSchema).withOutput(breakGlassRequestSchema).mutation("breakGlassChallenge").withInput(breakGlassRequestIdSchema).withOutput(vaultReauthChallengeSchema).mutation("approveBreakGlass").withInput(breakGlassApproveInputSchema).withOutput(breakGlassRequestSchema).mutation("denyBreakGlass").withInput(breakGlassDenyInputSchema).withOutput(breakGlassRequestSchema).mutation("readBreakGlass").withInput(breakGlassReadInputSchema).withOutput(breakGlassPageSchema).query("operatorKeys").withInput(external_exports.object({})).withOutput(external_exports.array(operatorKeySchema)).mutation("operatorKeyChallenge").withInput(operatorKeyIdSchema).withOutput(vaultOperatorKeyChallengeSchema).mutation("approveOperatorKey").withInput(operatorKeyApproveInputSchema).withOutput(operatorKeySchema).mutation("denyOperatorKey").withInput(operatorKeyDenyInputSchema).withOutput(operatorKeySchema).mutation("revokeOperatorKey").withInput(operatorKeyDenyInputSchema).withOutput(operatorKeySchema).query("hostLoad").withInput(external_exports.object({})).withOutput(hostLoadViewSchema).mutation("runOpsFunction").withInput(opsFunctionRunInputSchema).withOutput(opsFunctionAnswerSchema).build();
98643
99017
 
98644
99018
  // ../../modules/ops/contract/src/ops.config.ts
98645
99019
  var opsConfig = Config.define((c) => ({
@@ -98654,7 +99028,13 @@ var OPERATOR_KEY_USAGE = `Temporary operator keys (ask, an operator approves wit
98654
99028
  laze ops request <action> <target> --reason "<why>" [--arg name=value] [--wait]
98655
99029
  actions: ${OPERATOR_KEY_ACTIONS.join(", ")}
98656
99030
  laze ops status <key> waiting, approved or ended
98657
- laze ops use <key> run the approved action and print the answer`;
99031
+ laze ops use <key> run the approved action and print the answer
99032
+ Ops function leases (ADR-214), instead of reading the database:
99033
+ laze ops functions the functions, their scope and what each answers
99034
+ laze ops lease request --functions a,b --reason "<why>" [--tenant <workspace id>] [--wait]
99035
+ without --tenant: lookup and platform functions; with it: that one workspace's functions
99036
+ laze ops lease status <lease>
99037
+ laze ops call <lease> <function> [--input '<json>'] call one function of an approved lease`;
98658
99038
  var POLL_MS3 = 5e3;
98659
99039
  var keyFile = ({ context, keyId }) => join31(dirname22(context.environment.configPath), "operator-keys", keyId.replaceAll("/", "_"));
98660
99040
  async function saveSecret({
@@ -98684,7 +99064,7 @@ var EXPIRED_LINE = `Expired: nobody answered within ${OPERATOR_KEY.pendingMinute
98684
99064
  function statusLine2({ key, nowMs: nowMs2 }) {
98685
99065
  switch (key.status) {
98686
99066
  case "approved":
98687
- return `Approved until ${key.endsAt}. Run: laze ops use ${key.id}`;
99067
+ return key.action === "ops.functions" ? `Approved until ${key.endsAt}. Run: laze ops call ${key.id} <${key.functions.join("|")}>` : `Approved until ${key.endsAt}. Run: laze ops use ${key.id}`;
98688
99068
  case "pending":
98689
99069
  return Temporal3.Instant.from(key.pendingUntil).epochMilliseconds <= nowMs2 ? EXPIRED_LINE : `Waiting for an operator's passkey at /ops/keys. Nothing runs until they approve. It expires at ${key.pendingUntil} if nobody answers.`;
98690
99070
  case "expired":
@@ -98752,7 +99132,11 @@ async function forgetIfOver({
98752
99132
  }
98753
99133
  return key;
98754
99134
  }
98755
- async function useKey({ context, args }) {
99135
+ async function useKey({
99136
+ context,
99137
+ args,
99138
+ call
99139
+ }) {
98756
99140
  const [, , keyId] = args.words;
98757
99141
  if (!keyId) throw new CliUsageError(OPERATOR_KEY_USAGE);
98758
99142
  const { client } = await signedIn({ context, args });
@@ -98764,7 +99148,8 @@ async function useKey({ context, args }) {
98764
99148
  try {
98765
99149
  const answer6 = await client.post(OPERATOR_KEY_REST_PATHS.use, {
98766
99150
  keyId,
98767
- secret
99151
+ secret,
99152
+ ...call
98768
99153
  });
98769
99154
  context.out(`${JSON.stringify(answer6.result, null, 2)}
98770
99155
  `);
@@ -98781,8 +99166,68 @@ async function useKey({ context, args }) {
98781
99166
  throw error63;
98782
99167
  }
98783
99168
  }
99169
+ function listFunctions({ context, args }) {
99170
+ const rows = OPS_FUNCTION_NAMES.map((name3) => ({
99171
+ name: name3,
99172
+ scope: OPS_FUNCTIONS[name3].scope,
99173
+ title: OPS_FUNCTIONS[name3].title
99174
+ }));
99175
+ if (args.flags.json) return context.out(`${JSON.stringify(rows, null, 2)}
99176
+ `);
99177
+ const width = Math.max(...rows.map((row) => row.name.length));
99178
+ for (const row of rows) {
99179
+ context.out(`${row.name.padEnd(width)} ${row.scope.padEnd(8)} ${row.title}
99180
+ `);
99181
+ }
99182
+ }
99183
+ async function requestLease({ context, args }) {
99184
+ const reason2 = flagText({ args, name: "reason" });
99185
+ const functions = flagText({ args, name: "functions" }).split(",").map((name3) => name3.trim()).filter(Boolean);
99186
+ if (functions.length === 0 || !reason2.trim()) throw new CliUsageError(OPERATOR_KEY_USAGE);
99187
+ const tenant = flagText({ args, name: "tenant" }).trim();
99188
+ const { client } = await signedIn({ context, args });
99189
+ const secret = randomBytes5(32).toString("hex");
99190
+ const key = await client.post(OPERATOR_KEY_REST_PATHS.request, {
99191
+ action: "ops.functions",
99192
+ target: tenant || OPS_FUNCTION.platformTarget,
99193
+ args: {},
99194
+ functions,
99195
+ reason: reason2,
99196
+ secretHash: createHash7("sha256").update(secret).digest("hex")
99197
+ });
99198
+ await saveSecret({ context, keyId: key.id, secret });
99199
+ const answered = args.flags.wait ? await waitForAnswer({ context, client, key }) : key;
99200
+ if (args.flags.json) return context.out(`${JSON.stringify(answered, null, 2)}
99201
+ `);
99202
+ context.out(`Lease ${key.id}: ${statusLine2({ key: answered, nowMs: context.nowMs() })}
99203
+ `);
99204
+ }
99205
+ function inputOf({ args }) {
99206
+ const text3 = flagText({ args, name: "input" }).trim();
99207
+ if (!text3) return {};
99208
+ try {
99209
+ return JSON.parse(text3);
99210
+ } catch {
99211
+ throw new CliUsageError(`--input takes JSON, such as '{"from":"...","to":"..."}'.`);
99212
+ }
99213
+ }
99214
+ async function callFunction({ context, args }) {
99215
+ const [, , keyId, name3] = args.words;
99216
+ if (!keyId || !name3) throw new CliUsageError(OPERATOR_KEY_USAGE);
99217
+ await useKey({ context, args, call: { function: name3, input: inputOf({ args }) } });
99218
+ }
98784
99219
  function operatorKey({ context, args }) {
98785
- const [, action] = args.words;
99220
+ const [, action, step] = args.words;
99221
+ if (action === "functions") return Promise.resolve(listFunctions({ context, args }));
99222
+ if (action === "call") return callFunction({ context, args });
99223
+ if (action === "lease" && step === "request") return requestLease({ context, args });
99224
+ if (action === "lease" && step === "status") {
99225
+ return keyStatus({
99226
+ context,
99227
+ args: { ...args, words: ["ops", "status", ...args.words.slice(3)] }
99228
+ });
99229
+ }
99230
+ if (action === "lease") throw new CliUsageError(OPERATOR_KEY_USAGE);
98786
99231
  if (action === "request") return requestKey({ context, args });
98787
99232
  if (action === "status") return keyStatus({ context, args });
98788
99233
  return useKey({ context, args });
@@ -98795,7 +99240,8 @@ var OPS_USAGE = `Usage (operators, with LAZE_OPS_TOKEN set):
98795
99240
  ${OPERATOR_KEY_USAGE}`;
98796
99241
  async function ops({ context, args }) {
98797
99242
  const [, action, workspaceId] = args.words;
98798
- if (action === "request" || action === "status" || action === "use") {
99243
+ const keyed3 = ["request", "status", "use", "lease", "call", "functions"];
99244
+ if (action !== void 0 && keyed3.includes(action)) {
98799
99245
  return operatorKey({ context, args });
98800
99246
  }
98801
99247
  const reason2 = flagText({ args, name: "reason" });
@@ -99161,9 +99607,9 @@ var USAGE17 = `Usage:
99161
99607
  async function folderFiles({ root }) {
99162
99608
  const entries = await readdir9(root, { recursive: true, withFileTypes: true });
99163
99609
  const files2 = [];
99164
- for (const entry of entries) {
99165
- if (!entry.isFile()) continue;
99166
- const full = join33(entry.parentPath, entry.name);
99610
+ for (const entry2 of entries) {
99611
+ if (!entry2.isFile()) continue;
99612
+ const full = join33(entry2.parentPath, entry2.name);
99167
99613
  files2.push({ path: relative6(root, full), content: await readFile32(full, "utf8") });
99168
99614
  }
99169
99615
  return files2.toSorted((a, b) => a.path.localeCompare(b.path));
@@ -100262,7 +100708,7 @@ async function resolveBatch({
100262
100708
  const answer6 = await door.ask({ refs, reason: "", command: [], resolveOnly: true });
100263
100709
  return answer6.entries;
100264
100710
  }
100265
- var keyOf = (entry) => entry.connection?.name ?? entry.ref;
100711
+ var keyOf = (entry2) => entry2.connection?.name ?? entry2.ref;
100266
100712
  async function untilAllAnswered({
100267
100713
  context,
100268
100714
  door,
@@ -100310,21 +100756,21 @@ async function releaseBatch({
100310
100756
  let settled2;
100311
100757
  try {
100312
100758
  answer6 = await door.ask({ refs, reason: reason2, command, recipient: run4.publicKey });
100313
- const missing = answer6.entries.filter((entry) => !entry.connection);
100759
+ const missing = answer6.entries.filter((entry2) => !entry2.connection);
100314
100760
  if (missing.length > 0) {
100315
100761
  context.err(
100316
- `laze vault: no key named ${missing.map((entry) => entry.ref).join(", ")} in your vault or reachable by this agent
100762
+ `laze vault: no key named ${missing.map((entry2) => entry2.ref).join(", ")} in your vault or reachable by this agent
100317
100763
  `
100318
100764
  );
100319
100765
  return { exitCode: 1 };
100320
100766
  }
100321
100767
  settled2 = /* @__PURE__ */ new Map();
100322
100768
  const waiting = /* @__PURE__ */ new Map();
100323
- for (const entry of answer6.entries) {
100324
- const release2 = entry.release;
100769
+ for (const entry2 of answer6.entries) {
100770
+ const release2 = entry2.release;
100325
100771
  if (!release2) continue;
100326
- if (release2.outcome === "ask") waiting.set(keyOf(entry), release2);
100327
- else settled2.set(keyOf(entry), release2);
100772
+ if (release2.outcome === "ask") waiting.set(keyOf(entry2), release2);
100773
+ else settled2.set(keyOf(entry2), release2);
100328
100774
  }
100329
100775
  const later = await untilAllAnswered({ context, door, waiting, deadline });
100330
100776
  if (later === "capped") return { exitCode: 75 };
@@ -100374,9 +100820,9 @@ async function valuesOf({
100374
100820
  }
100375
100821
  if (!keep2) await rm20(keyPath, { force: true });
100376
100822
  const released = /* @__PURE__ */ new Map();
100377
- for (const entry of entries) {
100378
- const fields = opened.get(keyOf(entry));
100379
- if (fields) released.set(entry.ref, { fields });
100823
+ for (const entry2 of entries) {
100824
+ const fields = opened.get(keyOf(entry2));
100825
+ if (fields) released.set(entry2.ref, { fields });
100380
100826
  }
100381
100827
  return { released, entries };
100382
100828
  }
@@ -100462,7 +100908,7 @@ async function printNames({
100462
100908
  }) {
100463
100909
  const refs = refsOf(lines2);
100464
100910
  const entries = refs.length > 0 ? await resolveBatch({ context, args, refs }) : [];
100465
- const byRef = new Map(entries.map((entry) => [entry.ref, entry.connection]));
100911
+ const byRef = new Map(entries.map((entry2) => [entry2.ref, entry2.connection]));
100466
100912
  let missing = false;
100467
100913
  for (const line of lines2) {
100468
100914
  const label3 = line.kind === "connection" ? line.ref : line.variable;
@@ -100497,9 +100943,9 @@ async function releasedKeys({
100497
100943
  if (refs.length === 0) return { released: /* @__PURE__ */ new Map(), byConnection };
100498
100944
  const outcome = await releaseBatch({ context, args, refs, reason: reason2, command: [...command] });
100499
100945
  if ("exitCode" in outcome) return outcome;
100500
- for (const entry of outcome.entries) {
100501
- const fields = outcome.released.get(entry.ref)?.fields;
100502
- if (entry.connection && fields) byConnection.set(entry.connection.name, fields);
100946
+ for (const entry2 of outcome.entries) {
100947
+ const fields = outcome.released.get(entry2.ref)?.fields;
100948
+ if (entry2.connection && fields) byConnection.set(entry2.connection.name, fields);
100503
100949
  }
100504
100950
  return { released: outcome.released, byConnection };
100505
100951
  }
@@ -100635,7 +101081,7 @@ ${EXEC_PROVIDER_USAGE}`);
100635
101081
  context,
100636
101082
  args,
100637
101083
  refs: [...new Set(ids.map((id4) => splitExecId({ id: id4 }).connection))]
100638
- })).filter((entry) => entry.connection).map((entry) => entry.ref)
101084
+ })).filter((entry2) => entry2.connection).map((entry2) => entry2.ref)
100639
101085
  );
100640
101086
  for (const id4 of ids) {
100641
101087
  const { connection, field } = splitExecId({ id: id4 });
@@ -100743,7 +101189,7 @@ async function vaultSave({ context, args }) {
100743
101189
  // src/services/vault-scrub-commands.service.ts
100744
101190
  function lineOf5(channel) {
100745
101191
  const where = channel.name ? `#${channel.name}` : channel.channelId;
100746
- const found = Object.entries(channel.found).map(([vendor, count5]) => `${vendor} ${count5}`).join(", ");
101192
+ const found = Object.entries(channel.found).map(([vendor, count6]) => `${vendor} ${count6}`).join(", ");
100747
101193
  const kinds = [`held ${channel.held}`, ...found ? [`found: ${found}`] : []].join("; ");
100748
101194
  return `${where} scanned ${channel.scanned} changed ${channel.messages} ${kinds}
100749
101195
  `;
@@ -101733,8 +102179,8 @@ async function roles({ context, args }) {
101733
102179
  const catalogue = await client.get("/api/roles");
101734
102180
  if (args.flags.json) return printJson11(context, catalogue);
101735
102181
  for (const role2 of catalogue) {
101736
- const count5 = `${role2.permissions.length} permissions`;
101737
- context.out(`${role2.label} ${count5} ${role2.description}
102182
+ const count6 = `${role2.permissions.length} permissions`;
102183
+ context.out(`${role2.label} ${count6} ${role2.description}
101738
102184
  `);
101739
102185
  context.out(` ${role2.permissions.join(", ")}
101740
102186
  `);
@@ -101749,12 +102195,12 @@ async function audit({ context, args }) {
101749
102195
  const entries = await client.post("/api/audit-log/list", limit ? { limit } : {});
101750
102196
  if (args.flags.json) return printJson11(context, entries);
101751
102197
  if (entries.length === 0) return context.out("No audited actions yet.\n");
101752
- for (const entry of entries) {
101753
- const actor = `${entry.actorType}${entry.actorId ? ` ${entry.actorId}` : ""}`;
101754
- const target = entry.targetKind ? `${entry.targetKind} ${entry.targetId ?? ""}`.trim() : "";
101755
- const refused = entry.errorCode ? `refused: ${entry.errorCode}` : "";
102198
+ for (const entry2 of entries) {
102199
+ const actor = `${entry2.actorType}${entry2.actorId ? ` ${entry2.actorId}` : ""}`;
102200
+ const target = entry2.targetKind ? `${entry2.targetKind} ${entry2.targetId ?? ""}`.trim() : "";
102201
+ const refused = entry2.errorCode ? `refused: ${entry2.errorCode}` : "";
101756
102202
  context.out(
101757
- `${[entry.createdAt, actor, entry.action, target, refused].filter(Boolean).join(" ")}
102203
+ `${[entry2.createdAt, actor, entry2.action, target, refused].filter(Boolean).join(" ")}
101758
102204
  `
101759
102205
  );
101760
102206
  }
@@ -101960,7 +102406,8 @@ var HELP = `laze: work in a Laze workspace from your terminal or your agent.
101960
102406
  laze agent runs-on <agent> laze|claude|codex [--pool <pool>] moves it to Laze credits, Claude Code or Codex
101961
102407
  laze agent access|dm|disconnect <agent> who can talk to it, your conversation with it, revoke its key
101962
102408
  laze agent permission-prompts <agent> each permission prompt its harness raised and rush's answer
101963
- laze agent share|unshare <agent> --person <userId> | --group <groupId> | --channel <channelId> share it (its owner)
102409
+ laze agent share|unshare <agent> --person <userId> | --group <groupId> | --channel <channelId> | --agent <agent> share it (its owner); an added agent DMs it
102410
+ laze agent share <agent> --ask --person <userId> [--agent <agent> ...] ask its owner to add them; they approve in their feed
101964
102411
  laze agent stop <agent> --channel <channelId> stop its running turn there
101965
102412
  laze agent retry <agent> --channel <id> --message <id> Try again on its failed turn on that message
101966
102413
  laze agent invite [--name <name>] [--channel <id>] a one-time link that connects a new agent;